302.fb028876.js 342 KB

1
  1. "use strict";(self["webpackChunk_zoom_client_email_desktop"]=self["webpackChunk_zoom_client_email_desktop"]||[]).push([[302,763],{69003:function(e,t,i){i.d(t,{Z:function(){return c}});var n=function(){var e=this,t=e._self._c;return t("div",{ref:"contextMenuSubRef",staticClass:"context-menu-sub"},[t("div",{staticClass:"context-menu-sub-trigger",on:{mouseenter:e.openSubmenu,mouseleave:e.hideSubMenu}},[e._t("trigger")],2),t("div",{directives:[{name:"show",rawName:"v-show",value:e.showSubMenu,expression:"showSubMenu"}],ref:"subContentRef",staticClass:"sub-content",on:{mouseenter:e.mouseEnter2SubMenu,mouseleave:e.mouseLeave2SubMenu}},[e._t("default")],2)])},a=[],s={name:"ContextMenuSub",data:function(){return{showSubMenu:!1,isInSubMenu:!1,a:!1}},methods:{_isOutOfViewport:function(e){var t=e.getBoundingClientRect(),i=t.bottom>window.innerHeight,n=t.top<0,a=t.right>window.innerWidth,s=t.left<0;return{isOutOfBottom:i,isOutOfTop:n,isOutOfRight:a,isOutOfLeft:s}},openSubmenu:function(e){var t=this;this.showSubMenu=!0,this.$refs.subContentRef&&(this.$refs.subContentRef.style.top="".concat(this.$refs.contextMenuSubRef.offsetTop,"px"),this.$refs.subContentRef.style.left="".concat(this.$refs.contextMenuSubRef.offsetWidth+18,"px")),this.$nextTick((function(){var e=t._isOutOfViewport(t.$refs.subContentRef),i=e.isOutOfRight;i&&(t.$refs.subContentRef.style.left="".concat(t.$refs.contextMenuSubRef.offsetLeft-t.$refs.subContentRef.offsetWidth-18,"px"))}))},hideSubMenu:function(){var e=this;setTimeout((function(){e.isInSubMenu||(e.showSubMenu=!1)}),32)},mouseEnter2SubMenu:function(){this.isInSubMenu=!0},mouseLeave2SubMenu:function(){this.showSubMenu=!1,this.isInSubMenu=!1}}},r=s,o=i(93483),l=(0,o.Z)(r,n,a,!1,null,null,null),c=l.exports},21784:function(e,t,i){var n=i(39812),a=(i(39729),i(93483)),s={},r=(0,a.Z)(s,n.s,n.x,!1,null,"15242d0c",null);t["Z"]=r.exports},60258:function(e,t,i){i.d(t,{Z:function(){return p}});var n=function(){var e=this,t=e._self._c;return e.labels.length>0?t("div",{staticClass:"label-list tab-focus"},[e._l(e.visibleLabels,(function(i){var n;return t("zm-tooltip",{key:i,attrs:{"append-to-body":!0,placement:"top",content:e.getLabelArialLabel(i)}},[t("LabelFlag",{attrs:{labelColor:null===(n=e.labelIdToLabel.get(i))||void 0===n?void 0:n.backgroundColor,labelContent:e.getLabelDisplayContent(i)}})],1)})),e.collapsedLabels.length>0?t("zm-tooltip",[t("LabelFlag",{attrs:{labelContent:"+".concat(e.collapsedLabels.length)}}),t("div",{staticClass:"label-list label-list-tooltip",attrs:{slot:"content"},slot:"content"},e._l(e.collapsedLabels,(function(i){var n;return t("zm-tooltip",{key:i,attrs:{"append-to-body":!0,placement:"top",content:e.getLabelArialLabel(i)}},[t("LabelFlag",{attrs:{labelColor:null===(n=e.labelIdToLabel.get(i))||void 0===n?void 0:n.backgroundColor,labelContent:e.getLabelDisplayContent(i)}})],1)})),1)],1):e._e()],2):e._e()},a=[],s=i(34948),r=i(53806),o=i(80309),l=i(29648),c=i(10100),d={name:"LabelFlagsList",components:{LabelFlag:o.Z},props:{labels:{type:Array,default:function(){return[]},required:!0},maxNumVisible:{type:Number,default:-1}},computed:(0,s.Z)((0,s.Z)({},(0,l.Se)(["isGmail","labelNameInfo","labelIdToLabel"])),{},{visibleLabels:function(e){var t=this,i=e.labels,n=e.maxNumVisible;return n>=0?i.slice(0,n).filter((function(e){return!t.isQuarantinedLabel(e)})):i.filter((function(e){return!t.isQuarantinedLabel(e)}))},collapsedLabels:function(e){var t=this,i=e.labels,n=e.maxNumVisible;return n>=0?i.slice(n).filter((function(e){return!t.isQuarantinedLabel(e)})):[]}}),methods:{isQuarantinedLabel:function(e){return e===c.SystemDefinedMailLabelIds.QUARANTINED},getLabelArialLabel:function(e){var t,i=this.labelIdToLabel.get(e);return i?r.Utils.isDecryptFailed(i.labelDecryptionStatus)?this.$t("label.encryptedLabel"):i.isSystem?i.displayName:null===(t=this.labelNameInfo[e])||void 0===t?void 0:t.labelDisplayFullName:""},getLabelDisplayContent:function(e){var t,i=this.labelIdToLabel.get(e);return i?r.Utils.isDecryptFailed(i.labelDecryptionStatus)?this.$t("label.encryptedLabel"):i.isSystem?i.displayName:null===(t=this.labelNameInfo[e])||void 0===t?void 0:t.labelDisplayName:""}}},u=d,h=i(93483),m=(0,h.Z)(u,n,a,!1,null,"3ac6503c",null),p=m.exports},60753:function(e,t,i){i.d(t,{Z:function(){return L}});var n=function(){var e=this,t=e._self._c;return t("ul",{staticClass:"snooze-menu",on:{click:e.handleCommand}},[t("li",{staticClass:"later-today time-option",attrs:{"data-id":"later-today"}},[t("span",[e._v(e._s(e.$t("time.laterToday")))]),t("span",{staticClass:"time-detail"},[e._v(e._s(e.laterTodayTime.format))])]),t("li",{staticClass:"tomorrow time-option",attrs:{"data-id":"tommrrow"}},[t("span",[e._v(e._s(e.$t("time.tomorrow")))]),t("span",{staticClass:"time-detail"},[e._v(e._s(e.tomorrowTime.format))])]),t("li",{staticClass:"this-weekend time-option",attrs:{"data-id":"this-week"}},[t("span",[e._v(e._s(e.$t("time.thisWeekend")))]),t("span",{staticClass:"time-detail"},[e._v(e._s(e.thisWeekendTime.format))])]),t("li",{staticClass:"next-week time-option",attrs:{"data-id":"next-week"}},[t("span",[e._v(e._s(e.$t("time.nextWeek")))]),t("span",{staticClass:"time-detail"},[e._v(e._s(e.nextWeek.format))])]),t("divider"),t("li",{staticClass:"time-option",attrs:{"data-id":"custom-date"},on:{click:e.showDatePicker}},[t("span",[e._v(e._s(e.$t("time.customDate")))])]),t("li",{directives:[{name:"show",rawName:"v-show",value:e.hasUnsnooze,expression:"hasUnsnooze"}],staticClass:"time-option",attrs:{"data-id":"unsnooze"}},[t("span",[e._v(e._s(e.$t("operation.unSnooze")))])]),t("zm-dialog",{attrs:{visible:e.datePickerIsShown,"append-to-body":!0,title:e.$t("time.customDate")},on:{"update:visible":function(t){e.datePickerIsShown=t}}},[t("div",{staticClass:"snooze-time-picker"},[t("div",{staticClass:"date-picker"},[t("h3",{staticClass:"leading-label"},[e._v(e._s(e.$t("editor.date")))]),t("date-picker",{attrs:{value:e.reminderDate},on:{onChange:e.onDateChange}})],1),t("div",{staticClass:"time-select"},[t("h3",{staticClass:"leading-label"},[e._v(e._s(e.$t("time.time")))]),t("time-picker",{attrs:{value:e.timeStr,startTime:e.startTime},on:{onChange:e.onTimeChange}})],1)]),t("div",{attrs:{slot:"footer"},slot:"footer"},[t("zm-button",{on:{click:e.closeCustomDate}},[e._v(e._s(e.$t("common.cancel")))]),t("zm-button",{attrs:{type:"primary"},on:{click:e.onSnooze}},[e._v(e._s(e.$t("operation.snooze")))])],1)])],1)},a=[],s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"zm-mc-date-picker"},[t("zm-date-picker",{attrs:{type:"date",format:"MM dd, yyyy","picker-options":e.pickerOPtions},on:{change:e.onChange},model:{value:e.time,callback:function(t){e.time=t},expression:"time"}})],1)},r=[],o=i(79337),l={name:"DatePicker",props:{value:{type:Number,default:o.ou.now().toMillis()}},data:function(){return{time:this.value,pickerOPtions:{disabledDate:this.disabledDate}}},methods:{onChange:function(e){this.$emit("onChange",o.ou.fromJSDate(e).toMillis())},disabledDate:function(e){var t=o.ou.fromJSDate(e).set({hour:0,minute:0,second:0}).plus({day:1}),i=o.ou.fromJSDate(new Date).set({hour:0,minute:0,second:0});return i>=t}}},c=l,d=i(93483),u=(0,d.Z)(c,s,r,!1,null,null,null),h=u.exports,m=function(){var e=this,t=e._self._c;return t("div",{staticClass:"zm-mc-time-picker"},[t("zm-time-select",{attrs:{"picker-options":{formatTime:e.formatTime,start:e.startTime,step:"00:15",end:"24:00"}},on:{change:e.onChange},model:{value:e.time,callback:function(t){e.time=t},expression:"time"}})],1)},p=[],f={name:"TimePicker",props:{value:{type:String,default:"9:00"},startTime:{type:String,default:"9:00"}},data:function(){return{time:this.value}},methods:{formatTime:function(e){var t=e,i=o.ou.fromFormat(t,"T");return i.toFormat("t")},onChange:function(e){var t=o.ou.fromFormat(e,"t");this.$emit("onChange",t.toFormat("T"))}}},v=f,b=(0,d.Z)(v,m,p,!1,null,"99318074",null),g=b.exports,S=i(21784),I=function(){var e=o.ou.fromFormat("9:00","T");if(e<o.ou.now()){var t=o.ou.now().plus({hour:1}).set({minute:0,second:0});return t.toFormat("T")}return"9:00"},y={name:"SnoozeMenu",components:{DatePicker:h,TimePicker:g,Divider:S.Z},props:{hasUnsnooze:{type:Boolean,default:!1}},data:function(){var e=o.ou.now(),t=function(){var t=e.set({weekday:6}),i=e.set({weekday:7}),n=e.diff(t)<e.diff(i)?t:i;return n.set({year:n.year,month:n.month,day:n.day,hour:e.hour+1,minute:0,second:0})};return{datePickerIsShown:!1,reminderDate:Date.now(),reminderTime:I(),laterTodayTime:{value:e.set({hour:e.hour+3,minute:0,second:0}),format:e.set({hour:e.hour+3,minute:0,second:0}).toFormat("t")},tomorrowTime:{value:e.plus({days:1}).set({hour:9,minute:0,second:0,millisecond:0}),format:e.plus({days:1}).set({hour:9,minute:0,second:0,millisecond:0}).toFormat("ccc t")},thisWeekendTime:{value:t(),format:t().toFormat("ccc t")},nextWeek:{value:e.plus({days:7}).set({hour:9,minute:0,second:0,millisecond:0}),format:e.plus({days:7}).set({hour:9,minute:0,second:0,millisecond:0}).toFormat("ccc t")},timeStr:o.ou.now().plus({hour:1}).set({minute:0,second:0}).toFormat("t"),startTime:I()}},methods:{showDatePicker:function(){this.datePickerIsShown=!0},handleCommand:function(e){var t=e.target.getAttribute("data-id");switch(t){case"later-today":this.$emit("onSnoozeTime",this.laterTodayTime.value.toMillis());break;case"tommrrow":this.$emit("onSnoozeTime",this.tomorrowTime.value.toMillis());break;case"this-week":this.$emit("onSnoozeTime",this.thisWeekendTime.value.toMillis());break;case"next-week":this.$emit("onSnoozeTime",this.nextWeek.value.toMillis());break;case"unsnooze":this.$emit("unsnooze");break}},closeCustomDate:function(){this.datePickerIsShown=!1},onSnooze:function(){this.closeCustomDate();var e="".concat(o.ou.fromMillis(this.reminderDate).toFormat("DDD"),", ").concat(this.reminderTime);console.debug("Snoozed time",e),this.$emit("onSnoozeTime",o.ou.fromFormat(e,"MMMM d, yyyy, h:mm").toMillis())},onDateChange:function(e){var t=!o.ou.fromMillis(e).hasSame(o.ou.now(),"day");t?(this.timeStr="9:00",this.startTime="9:00"):(this.timeStr=o.ou.now().plus({hour:1}).set({minute:0,second:0}).toFormat("t"),this.startTime=I()),this.reminderDate=e},onTimeChange:function(e){this.reminderTime=e}}},w=y,x=(0,d.Z)(w,n,a,!1,null,"575a6271",null),L=x.exports},29942:function(e,t,i){i.r(t),i.d(t,{default:function(){return _o}});var n=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.isAuthed,expression:"isAuthed"}]},[e.showBanner?t("vacation-responder-banner"):e._e(),t("div",{class:["mail",{"banner-active":e.showBanner}]},[t("ThreadDragImage"),t("div",{class:["mail-left resizable",e.isMinimized&&"minimized"],style:{width:e.isResized?"".concat(e.width,"px"):"".concat(e.sidebarMenuWidth,"px")},on:{contextmenu:e.closeInboxContextMenu}},[t("div",{staticClass:"mail-left-container"},[t("div",{staticClass:"mail-left-header"},[t("AccountDropdown",{ref:"accountDropdown",on:{dropdownOpened:e.onSettingDropdownOpened},scopedSlots:e._u([{key:"trigger",fn:function(){return[t("mail-logo",{directives:[{name:"show",rawName:"v-show",value:!e.isMinimized,expression:"!isMinimized"}]})]},proxy:!0}])}),t("shortcut-reminder",{attrs:{preTooltip:e.$t("compose.compose"),shortcutKey:"compose"}},[t("zm-button",{directives:[{name:"show",rawName:"v-show",value:e.composePermission,expression:"composePermission"}],staticClass:"mail-left-compose",attrs:{"aria-label":e.$t("compose.compose"),"zm-ta":"sidebar-open-compose",tabindex:"0"},on:{click:e.openCompose}},[t("svg-icon",{attrs:{iconClass:"edit"}})],1)],1)],1),e.userLabelIsVisible?t("div",{ref:"labelSidebar",class:["mail-left-label-wrap",e.enableVirtualUserLabelList&&"virtual-user-label-list-enabled"],attrs:{role:"navigation"},on:{dragenter:e.handleDragEnter}},[t("system-labels",{attrs:{isMinimized:e.isMinimized,isImportantEnabled:e.isImportantEnabled},on:{handleSelectLabel:e.handleSelectLabel}}),e.isStickerEnabled?[t("div",{staticClass:"mail-left-label-divider"}),t("AddonList",{on:{select:e.handleSelectAddon}})]:e._e(),t("div",{staticClass:"mail-left-label-divider"}),e.userLabelIsVisible?t("user-labels",{attrs:{isMinimized:e.isMinimized},on:{handleSelectLabel:e.handleSelectLabel}}):e._e()],2):e._e()])]),t("div",{staticClass:"mail-divider"},[t("div",{staticClass:"mail-divider-container",on:{mousemove:e.handleDividerMouseMove,mousedown:e.startResize}},[t("div",{staticClass:"mail-divider-line"}),t("shortcut-reminder",{ref:"sidebarTriggerRef",attrs:{preTooltip:e.isMinimized?e.$t("common.openSidebar"):e.$t("common.closeSidebar"),shortcutKey:"openOrCloseSidebar",placement:"right"}},[t("span",{class:["toggle-minimize-action","tab-focus"],style:e.minimizeButtonPosStyles,attrs:{"zm-ta":e.isMinimized?"sidebar-toggle-min":"sidebar-toggle-max",role:"button","aria-label":e.isMinimized?e.$t("common.expand"):e.$t("common.minimize")},on:{click:function(t){return t.preventDefault(),e.toggleMinimize.apply(null,arguments)}}},[t("svg-icon",{attrs:{iconClass:e.isMinimized?"maximize-triangle":"minimize-triangle"}})],1)])],1)]),t("div",{staticClass:"mail-right",attrs:{id:"mail-right"}},[t("inbox",{ref:"inboxRef",style:{display:e.isAddonViewVisible?"none":"flex"},on:{resetInstantDraftsMsgIdByThreadIds:e.resetInstantDraftsMsgIdByThreadIds,onMounted:e.showUserLabels}}),e.isAddonViewVisible?t("AddonView"):e._e()],1),t("compose-container",{ref:"composeContainer"})],1)],1)},a=[],s=i(70021),r=i(56706),o=i(68571),l=i(34948),c=(i(6886),i(6710),i(84878)),d=i(53806),u=i(63012),h=i(29648),m=function(){var e=this,t=e._self._c;return t("div",{class:["label-list",e.isMinimized&&"label-list__minimized"]},[t("LabelList",{attrs:{labels:e.displayLabels,isMinimized:e.isMinimized,isUserLabel:!1,selection:e.selectMailLabel,moreOrLess:e.ShowMoreOrLessConfig},on:{itemCommand:e.handleItemCommand,select:e.handleSelectLabel}}),t("label-dialog",{attrs:{visible:e.dialogVisible,action:e.action,item:e.labelItem,labelListTree:e.allLabelsTree,"append-to-body":"","zm-ta":"create-label-dialog"},on:{onOk:e.handleOperationOk,onCancel:e.handleOperationCancel,handleSelectLabel:e.handleSelectLabel,close:function(t){e.dialogVisible=!1}}})],1)},p=[],f=i(6041),v=function(){var e=this,t=e._self._c;return t("zm-tree",{ref:"tree",class:["tab-focus zm-tree",{labels__minimized:e.isMinimized}],attrs:{data:e.labels,"node-key":"id","auto-expand-parent":!1,"default-expanded-keys":e.expandKeys,"empty-text":"","expand-on-click-node":!1,role:"list"},on:{"node-expand":e.handleNodeExpand,"node-collapse":e.handleNodeCollapse,"current-change":e.handleCurrentChange,keydown:[function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.stopPropagation()},function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.stopPropagation()}]},scopedSlots:e._u([{key:"default",fn:function(i){var n,a=i.data;return t("ShortcutReminder",{attrs:{shortcutKey:a.isSystem?"go-to-".concat(null===(n=e.getLabelContent(a))||void 0===n?void 0:n.toLowerCase()):"",placement:"right",preTooltip:e.isMinimized||!a.isSystem?e.getLabelContent(a):"",alwaysShowTooltip:e.isMinimized||a.isSystem,disabled:e.isDecryptFailed(a)}},[t("LabelItem",{directives:[{name:"metric",rawName:"v-metric:sidebar_custom_label",value:!a.isSystem,expression:"!data.isSystem",arg:"sidebar_custom_label"},{name:"metric",rawName:"v-metric:sidebar_label",value:{labelId:a.id},expression:"{ labelId: data.id }",arg:"sidebar_label"}],attrs:{noDropDownAction:e.noDropDownAction||e.noDropDownActionLabels.includes(a.id),isSystemRootLabel:e.rootLabels.includes(a.id),selectMailLabel:e.selection,item:a,isMinimized:e.isMinimized,isBolded:!a.isSystem&&e.boldLabelIDs.includes(a.id),"zm-ta":e.getZmTaTag(a),tabindex:"-1"},on:{handleCommand:function(t){return e.$emit("itemCommand",t)}}})],1)}}])})},b=[],g=function(){var e=this,t=e._self._c;return t("div",{class:["label-item",{"label-item__selected":e.getIsSelectedLabel(e.item),"label-item__bolded":!e.getIsSelectedLabel(e.item)&&e.isBolded,"label-item__minimized":e.isMinimized,"drop-target":e.canDrop}],attrs:{id:"".concat(e.item.id,"_label_item"),"aria-label":e.ariaLabel,tabindex:"-1"},on:{dragover:e.handleDragOver,dragenter:function(t){return t.target!==t.currentTarget?null:e.handleDragEnter.apply(null,arguments)},dragleave:function(t){return t.target!==t.currentTarget?null:e.handleDragLeave.apply(null,arguments)},drop:function(t){return t.target!==t.currentTarget?null:e.handleDrop.apply(null,arguments)},click:e.handleClick}},[t("div",{staticClass:"label-item-content"},[e.isMoving?t("i",{staticClass:"zm-icon-loading small",attrs:{tabindex:"-1"}}):e.item.isSystem?t("svg-icon",{staticClass:"svg-icon",attrs:{"aria-hidden":"true",isSelected:e.selectMailLabel.id===e.item.id,iconClass:e.getFolderIconClass(e.item)}}):e.isDecryptFailed?t("svg-icon",{staticClass:"locked-label",attrs:{"aria-hidden":"true",iconClass:"triangle-alert-filled"}}):t("svg-label",{attrs:{labelClass:e.labelIcon,"aria-hidden":"true",labelColor:e.item.backgroundColor}}),e.isMinimized?e._e():t("div",{staticClass:"label-item-right"},[t("span",{class:["label-name",!e.item.isSystem&&e.isDecryptFailed?"locked-label":""],attrs:{tabindex:"-1"}},[e._v(" "+e._s(e.labelDiaplay)+" ")]),e.noDropDownAction||e.noPermittedAction?e._e():t("zm-dropdown",{attrs:{trigger:"click",placement:"bottom"},on:{command:e.handleCommand}},[t("zm-button",{staticClass:"dropdown-btn show-on-hover",attrs:{"aria-label":e.$t("accessibility.moreOptionsFor",[e.item.displayName]),tabindex:"0"},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:(t.stopPropagation(),t.preventDefault(),e.focusTreeNode.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.stopPropagation(),t.preventDefault(),e.focusTreeNode.apply(null,arguments))}]}},[t("svg-icon",{attrs:{"aria-hidden":!0,iconClass:"more-horizontal"}})],1),t("zm-dropdown-menu",{attrs:{slot:"dropdown","aria-hidden":!0,"zm-ta":"label-decrypt"},slot:"dropdown"},[e.isDecryptFailed?t("zm-dropdown-item",{staticClass:"clearfix",attrs:{command:e.labelActions.RETRYDECRYPT}},[t("span",[e._v(e._s(e.$t("common.decrypt")))])]):e._e(),t("zm-dropdown-item",{directives:[{name:"show",rawName:"v-show",value:e.editLabelPermission&&!e.isSystemRootLabel,expression:"editLabelPermission && !isSystemRootLabel"}],class:["clearfix",{"disabled-item":e.isDecryptFailed}],attrs:{command:e.labelActions.EDIT,disabled:e.isDecryptFailed,"zm-ta":"label-edit"}},[t("span",[e._v(e._s(e.$t("operation.edit")))])]),t("zm-dropdown-item",{directives:[{name:"show",rawName:"v-show",value:e.editLabelPermission&&!e.isSystemRootLabel,expression:"editLabelPermission && !isSystemRootLabel"}],staticClass:"clearfix",attrs:{command:e.labelActions.DELETE,"zm-ta":"label-delete"}},[t("span",[e._v(e._s(e.$t("operation.delete")))])]),t("zm-dropdown-item",{directives:[{name:"show",rawName:"v-show",value:e.editLabelPermission,expression:"editLabelPermission"}],class:["clearfix",{"disabled-item":e.isDecryptFailed}],attrs:{command:e.labelActions.ADDSUB,disabled:e.isDecryptFailed,"zm-ta":"label-add-sub-label"}},[t("span",[e._v(e._s(e.isOutlook?e.$t("label.addSubfolder"):e.$t("label.addSublabel")))])])],1)],1),!e.isMinimized&&e.presentThreadCount&&e.showLabelCount?t("zm-badge",{class:["label-item-badge",{"hide-on-hover":!e.noDropDownAction,"zm-badge-draft":e.isDraftLabel(e.item.id),"zm-badge-no-background":e.isPlainBadge||!e.item.isSystem,selected:e.getIsSelectedLabel(e.item)}],attrs:{"is-dot":e.isMinimized||e.showDot,value:e.item.displayNum,max:9999}}):e._e()],1)],1),e.isMinimized&&e.presentThreadCount?t("zm-badge",{class:["label-item-badge",{"zm-badge-draft":e.isDraftLabel(e.item.id)}],attrs:{"is-dot":e.showLabelCount}}):e._e()],1)},S=[],I=i(97626),y=i(87692),w=i(50620),x=i(63147),L=i(43251),C=d.Enums.SystemDefinedCategoryIds,M=d.Enums.SystemDefinedMailLabelIds,k=d.Enums.UNREAD_EMAIL_STATUS,_=d.Business.labelUtils,D={name:"LabelItem",components:{SvgLabel:y.Z,SvgIcon:I.Z},props:{item:Object,selectMailLabel:Object,isMinimized:{type:Boolean,default:!1},isBolded:{type:Boolean,default:!1},noDropDownAction:{type:Boolean,default:!1},showFlattenName:{type:Boolean,default:!1},isSystemRootLabel:{type:Boolean,default:!1}},data:function(){return{canDrop:!1,isMoving:!1,categoryIds:Object.values(C),systemLabelIdsForMove:[M.INBOX,M.STARRED,M.IMPORTANT,M.TRASH,M.ARCHIVE,M.SPAM],labelActions:d.Enums.LabelActions}},computed:(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.Se)(["enableLabelCount","isGmail","isOutlook","labelNameInfo"])),(0,h.rn)(["draggedEmails","dragType"])),(0,h.rn)("search",["inSearching","searchString"])),(0,h.rn)("auth",["isMailBetaFeatureEnabled"])),{},{showDot:function(){return this.enableLabelCount===k.REDDOT},showLabelCount:function(){return this.enableLabelCount!==k.HIDE}},(0,h.Se)("delegate",["permissionRole"])),{},{editLabelPermission:function(e){var t=e.permissionRole;return(0,c.yz)(t,c.Vn.EDIT_LABEL)},noPermittedAction:function(e){var t=e.isDecryptFailed,i=e.editLabelPermission;return!i&&!t},isDecryptFailed:function(){return d.Utils.isDecryptFailed(this.item.labelDecryptionStatus)},labelIcon:function(){return d.Business.labelUtils.getLabelIconName(this.isOutlook)},presentThreadCount:function(e){var t=e.isDecryptFailed,i=e.item;return!t&&0!==i.displayNum&&this.showLabelCountBadge(i.id)},ariaLabel:function(e){var t=e.item,i=e.presentThreadCount,n=this.labelDiaplay,a=t.displayNum;if(i){var s=this.isDraftLabel(t.id)?this.$tc("accessibility.draftCount",a,[a]):this.$tc("accessibility.unreadCountOfLabel",a,[a]);return"".concat(n,", ").concat(s)}return n},labelDiaplay:function(e){var t=e.item;return this.getLabelContent(t)},isPlainBadge:function(e){var t=e.item;return[M.SNOOZED,M.DRAFT].includes(t.id)}}),methods:(0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.OI)(["setDragCursorStyle"])),(0,h.nv)({moveMails:"action/moveMails"})),{},{focusTreeNode:function(){this.$el.closest(".zm-tree-node").focus()},handleDragEnter:function(e){this.canDrop=this.validateDrop(),this.setDragCursorStyle(this.canDrop?"grab":"not-allowed"),e.preventDefault()},validateDrop:function(){if("messages"!==this.dragType)return!1;if(this.selectMailLabel.id===this.item.id)return!1;if(this.item.isSystem&&!this.systemLabelIdsForMove.includes(this.item.id))return!1;if(0===this.draggedEmails.length)return!1;var e=new Set([M.SENT,M.CATEGORY_PERSONAL,M.CATEGORY_SOCIAL]),t=this.item.id===M.ARCHIVE||this.item.id===M.SPAM;return(!e.has(this.selectMailLabel.id)||!t)&&!(this.isOutlook&&!this.selectMailLabel.isSystem&&t)},handleDragOver:function(e){this.canDrop&&e.preventDefault()},handleDragLeave:function(e){this.canDrop=!1,this.setDragCursorStyle(),e.preventDefault()},handleDrop:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n,a,o,l;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(t.canDrop=!1,"messages"===t.dragType){i.next=3;break}return i.abrupt("return");case 3:if(n=t.selectMailLabel.id,a=t.item.id,n!==a){i.next=7;break}return i.abrupt("return");case 7:return t.isMoving=!0,o=t.draggedEmails,i.next=11,Promise.all(o.map(function(){var e=(0,r.Z)((0,s.Z)().mark((function e(i){var n,a;return(0,s.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,u.Inbox.getMailHead({labelId:t.selectMailLabel.id,mailId:i});case 2:return n=e.sent,a=n.msgIds,e.abrupt("return",{msgIds:a,groupId:i});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 11:return l=i.sent,i.next=14,t.moveMails({mails:l.map((function(e){return{mailId:e.groupId,msgIds:e.msgIds}})),fromLabelId:n,toLabelId:a});case 14:t.isMoving=!1,e.preventDefault();case 16:case"end":return i.stop()}}),i)})))()},isDraftLabel:function(e){return e===M.DRAFT},showLabelCountBadge:function(e){return!_.HIDE_COUNT_LABELS.includes(e)},getIsSelectedLabel:function(e){if(this.selectMailLabel.id===e.id)return!0;if(e.id===M.INBOX&&this.categoryIds.includes(this.selectMailLabel.id))return!0;if(this.inSearching&&!this.selectMailLabel.id){var t,i=null===(t=this.searchString)||void 0===t?void 0:t.toLowerCase();if(i==="in:".concat(e.id.toLowerCase()," ")||i==="is:".concat(e.id.toLowerCase()," "))return!0;if(x.Z.isArchive(e.id)&&("in:archive "===i||"is:archive "===i))return!0;if(i==="in:".concat(e.name.toLowerCase()," ")||i==="is:".concat(e.name.toLowerCase()," "))return!0}return!1},getFolderIconClass:function(e){if(e.isShowMoreOrLess)return e.icon;var t,i,n="folder";this.isOutlook?n=(null===(t=L.Z[e.id])||void 0===t?void 0:t.icon)||"folder":n=(null===(i=w.Z[e.id])||void 0===i?void 0:i.icon)||"folder";return this.getIsSelectedLabel(e)?"".concat(n,"-filled"):n},handleCommand:function(e){console.log("labelItem",this.item),this.$emit("handleCommand",{method:e,item:this.item})},handleClick:function(e,t){var i=this,n=this.$el.closest(".zm-tree-node");null===n||void 0===n||n.focus(),"click"===(null===e||void 0===e?void 0:e.type)&&"MOREORLESS"===(null===t||void 0===t?void 0:t.id)&&setTimeout((function(){i.focusOnCurrentSelectedLabel()}),20),this.$emit("click")},focusOnLabel:function(e){var t,i="".concat(null===e||void 0===e?void 0:e.id,"_label_item"),n=null===(t=document.getElementById(i))||void 0===t?void 0:t.closest(".zm-tree-node");null===n||void 0===n||n.focus()},focusOnCurrentSelectedLabel:function(){this.focusOnLabel(this.selectMailLabel)},getLabelContent:function(e){var t,i,n,a;return e.isSystem?e.isShowMoreOrLess?e.displayName:this.isOutlook?null!==(n=L.Z[e.id])&&void 0!==n&&n.displayName?this.$t(null===(a=L.Z[e.id])||void 0===a?void 0:a.displayName):"":null!==(t=w.Z[e.id])&&void 0!==t&&t.displayName?this.$t(null===(i=w.Z[e.id])||void 0===i?void 0:i.displayName):"":this.isDecryptFailed?this.$t("label.encryptedLabel"):this.showFlattenName?e.labelDisplayNamePathArray.join("/"):e.displayName}})},T=D,E=i(93483),$=(0,E.Z)(T,g,S,!1,null,"63fd0922",null),A=$.exports,R=i(91007),Z=i(50334),O={name:"LabelList",components:{LabelItem:A,ShortcutReminder:R.Z},mixins:[Z.Z],props:{labels:{type:Array,default:[]},isMinimized:{type:Boolean,default:!1},isUserLabel:{type:Boolean,default:!1},selection:{type:Object,default:null},moreOrLess:{type:Object,default:null}},data:function(){return{expandKeys:[],expandKeysTmp:[],emptyText:"",boldLabelIDs:[],noDropDownActionLabels:[d.Enums.SystemDefinedMailLabelIds.OUTBOX,d.Enums.SystemDefinedMailLabelIds.SYNC_ISSUES,d.Enums.SystemDefinedMailLabelIds.MOREORLESS]}},computed:(0,l.Z)((0,l.Z)({},(0,h.Se)(["isGmail","isOutlook"])),{},{treeRef:function(){return this.$refs.tree},rootLabels:function(){return this.isUserLabel?[]:this.labels.map((function(e){return e.id}))},noDropDownAction:function(){return!this.isOutlook&&!this.isUserLabel}}),watch:{labels:function(){var e=this;this.expandKeys=this.expandKeysTmp,setTimeout((function(){e.expandKeys=[]}),0),this.findAndCheckBoldLabel(),this.updateZmTreeSelectionNextTick()},expandKeysTmp:function(){this.findAndCheckBoldLabel()},selection:function(){this.updateZmTreeSelectionNextTick()}},created:function(){this.updateZmTreeSelectionNextTick()},mounted:function(){this.findAndCheckBoldLabel()},methods:{getZmTaTag:function(e){var t,i=null===(t=this.getLabelContent(e))||void 0===t?void 0:t.toLowerCase();return e.isSystem?"sidebar-sys-label-".concat(i):"sidebar-user-label-".concat(i)},handleNodeExpand:function(e){this.expandKeysTmp.push(e.id),this.updateZmTreeAriaNextTick()},handleNodeCollapse:function(e){this.expandKeysTmp=this.expandKeysTmp.filter((function(t){return t!==e.id})),this.updateZmTreeAriaNextTick()},handleCurrentChange:function(e){this.$emit("select",e),this.updateZmTreeAriaNextTick()},updateZmTreeSelectionNextTick:function(){var e=this;this.$nextTick((function(){e.treeRef.setCurrentKey(e.selection.id),e.updateZmTreeAriaNextTick()}))},updateZmTreeAriaNextTick:function(){var e=this;this.$nextTick((function(){e.updateZmTreeAria(e.treeRef)}))},isDecryptFailed:function(e){return d.Utils.isDecryptFailed(e.labelDecryptionStatus)},getLabelContent:function(e){if(e.id===d.Enums.SystemDefinedMailLabelIds.MOREORLESS)return this.moreOrLess.displayName;if(e.isSystem){var t;if(this.isOutlook){var i,n=this.$t("common.unknownFolderName");return e.id&&this.$t(null===(i=L.Z[e.id])||void 0===i?void 0:i.displayName)||n}var a=this.$t("common.unknownLabelName");return e.id&&this.$t(null===(t=w.Z[e.id])||void 0===t?void 0:t.displayName)||a}return this.isGmail?e.displayName:d.Utils.isDecryptFailed(e.labelDecryptionStatus)?this.$t("label.encryptedLabel"):e.displayName},findAndCheckBoldLabel:function(){var e=this;this.boldLabelIDs=[],this.labels.forEach((function(t){e.DFS_CheckLabelTreeHasUnreadEmail(t)}))},DFS_CheckLabelTreeHasUnreadEmail:function(e){var t,i=this;if(null===e||void 0===e||!e.isShowMoreOrLess){var n,a;if(0===(null===e||void 0===e||null===(t=e.children)||void 0===t?void 0:t.length))return(null===e||void 0===e||null===(n=e.count)||void 0===n?void 0:n.msgUnread)>0&&this.boldLabelIDs.push(e.id),(null===e||void 0===e||null===(a=e.count)||void 0===a?void 0:a.msgUnread)>0;var s,r,o,l=!1;return null===e||void 0===e||null===(s=e.children)||void 0===s||s.forEach((function(e){l|=i.DFS_CheckLabelTreeHasUnreadEmail(e)})),l|=(null===e||void 0===e||null===(r=e.count)||void 0===r?void 0:r.msgUnread)>0,(null===e||void 0===e||null===(o=e.count)||void 0===o?void 0:o.msgUnread)>0&&this.boldLabelIDs.push(e.id),!this.expandKeysTmp.includes(e.id)&&l&&this.boldLabelIDs.push(e.id),l}}}},z=O,N=(0,E.Z)(z,v,b,!1,null,"2a15f0ed",null),P=N.exports,F=i(65803),V=d.Enums.SystemDefinedCategoryIds,H=d.Enums.LabelActions,B={name:"SystemLabels",components:{LabelList:P,labelDialog:F.Z},props:{isMinimized:{type:Boolean},isImportantEnabled:{type:Boolean}},data:function(){return{categoryIds:Object.values(V),addOnlyOneLabel:!1,action:"",dialogVisible:!1,labelItem:{}}},computed:(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.Se)(["currentLabelId","isOutlook","isZmail","labelIdToLabel","systemLabels","systemLabelsTree","allLabelsTree"])),(0,h.rn)("inbox",["isConversationView"])),(0,h.rn)(["showAllSystemLabels","allLabels","selectMailLabel","prefersColorScheme"])),(0,h.rn)({isDelegated:function(e){return e.userProfile.isDelegated}})),{},{ShowMoreOrLessConfig:function(){return{id:"MOREORLESS",displayName:this.showAllSystemLabels?this.$t("label.less"):this.$t("label.more"),icon:this.showAllSystemLabels?"minus":"more",isShowMoreOrLess:!0,isSystem:!0}},mailLabelsLength:function(){return this.isZmail?7:9},displayLabels:function(){return this.totalSystemLabels.length-this.mailLabelsLength>1?this.addOnlyOneLabel?[].concat((0,f.Z)(this.totalSystemLabels),[this.ShowMoreOrLessConfig]):[].concat((0,f.Z)(this.labels),[this.ShowMoreOrLessConfig]):this.totalSystemLabels},totalSystemLabels:function(){var e=this,t=d.Business.labelUtils.orderSystemLabels(this.systemLabels),i=this.isOutlook?this.systemLabelsTree:t;return i.filter((function(t){if(!t.isSystem)return!1;if(e.isZmail&&!e.isImportantEnabled&&t.id===d.Enums.SystemDefinedMailLabelIds.IMPORTANT)return!1;if(e.categoryIds.includes(t.id))return!1;var i=t.id,n=t.count;return e.isOutlook?![d.Enums.SystemDefinedMailLabelIds.OUTBOX,d.Enums.SystemDefinedMailLabelIds.SYNC_ISSUES].includes(t.id)||!!n.threadsTotal:i!==d.Enums.SystemDefinedMailLabelIds.QUARANTINED&&((!e.isZmail||i!==d.Enums.SystemDefinedMailLabelIds.BUBBLE_UP)&&((!e.isZmail||i!==d.Enums.SystemDefinedMailLabelIds.REPLY_LATER)&&((!e.isDelegated||t.id!==d.Enums.SystemDefinedMailLabelIds.PRIVATE)&&(![d.Enums.SystemDefinedMailLabelIds.OUTBOX,d.Enums.SystemDefinedMailLabelIds.USER_SCHEDULED,d.Enums.SystemDefinedMailLabelIds.ESCROW,d.Enums.SystemDefinedMailLabelIds.GROUP_APPROVAL].includes(i)||e.isConversationView&&n.threadsTotal||!e.isConversationView&&n.msgTotal))))}))},labels:function(){var e=this,t=this.totalSystemLabels,i=t.length===this.mailLabelsLength;return i||(t=t.filter((function(t,i){return e.showAllSystemLabels||i<e.mailLabelsLength}))),t},hasSubLabel:function(){return this.labels.some((function(e){return e.children.length}))}}),watch:{currentLabelId:function(e){this.labels.findIndex((function(t){return t.id===e}))>this.mailLabelsLength&&(this.showAllSystemLabels||this.handleToggleLabels())},allLabels:function(e){this.checkTempFolderCount(e)},totalSystemLabels:function(e,t){this.addOnlyOneLabel=e.length-t.length===1&&this.showAllSystemLabels}},methods:(0,l.Z)((0,l.Z)({},(0,h.OI)(["setShowAllSystemLabels"])),{},{getLabelContent:function(e){var t;if(this.isOutlook){var i,n=this.$t("common.unknownFolderName");return e.id&&this.$t(null===(i=L.Z[e.id])||void 0===i?void 0:i.displayName)||n}var a=this.$t("common.unknownLabelName");return e.id&&this.$t(null===(t=w.Z[e.id])||void 0===t?void 0:t.displayName)||a},handleSelectLabel:function(e){null!==e&&void 0!==e&&e.isShowMoreOrLess?this.handleToggleLabels():this.$emit("handleSelectLabel",e)},handleToggleLabels:function(){this.setShowAllSystemLabels(!this.showAllSystemLabels),this.$metric.report("sidebar_label_more")},handleItemCommand:function(e){var t=e.item,i=e.method;this.action=i,(i===H.DELETE||i===H.EDIT||i===H.ADDSUB)&&(this.labelItem=t,this.dialogVisible=!0)},handleOperationOk:function(e){var t=this,i=e.action,n=e.labels;this.dialogVisible=!1,i===d.Enums.LabelActions.CREATE&&(this.listExpanded=!0),i===d.Enums.LabelActions.ADDSUB&&(this.listExpanded=!0,n.forEach((function(e){var i;null===(i=t.$refs.labelList)||void 0===i||i.handleNodeExpand({id:e.parentFolderId})})))},handleOperationCancel:function(){this.dialogVisible=!1},checkTempFolderCount:function(){var e=this.labelIdToLabel.get(d.Enums.SystemDefinedMailLabelIds.OUTBOX),t=this.labelIdToLabel.get(d.Enums.SystemDefinedMailLabelIds.USER_SCHEDULED);if(this.currentLabelId===d.Enums.SystemDefinedMailLabelIds.OUTBOX&&0===e.displayNum||this.currentLabelId===d.Enums.SystemDefinedMailLabelIds.USER_SCHEDULED&&0===t.displayNum){var i=this.labelIdToLabel.get(d.Enums.SystemDefinedMailLabelIds.INBOX);i&&this.$emit("handleSelectLabel",i)}}})},U=B,j=(0,E.Z)(U,m,p,!1,null,"493ef048",null),W=j.exports,K=function(){var e=this,t=e._self._c;return t("div",{class:["labels","sidebar-user-labels","tab-focus",{"is-minimized":e.isMinimized}]},[t("div",{class:["labels-header","tab-focus"],attrs:{role:"button","aria-label":e.headerText,"aria-expanded":e.listExpanded.toString(),tabindex:"0"},on:{click:function(t){return t.stopPropagation(),e.toggleListExpanded.apply(null,arguments)},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])?null:e.toggleListExpanded.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.toggleListExpanded.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:e.toggleListExpanded.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"right",39,t.key,["Right","ArrowRight"])||"button"in t&&2!==t.button?null:e.toggleListExpanded.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:e.focusOnTree.apply(null,arguments)}]}},[!e.isMinimized&&e.userLabelsTree.length>0?t("svg-icon",{attrs:{iconClass:e.listExpanded?"triangle-down":"triangle-right","zm-ta":"user-labels-tree-".concat(e.listExpanded?"expanded":"collapsed")}}):e._e(),e.isMinimized?e._e():t("span",{staticClass:"header-text"},[e._v(" "+e._s(e.headerText)+" ")]),t("zm-button",{directives:[{name:"show",rawName:"v-show",value:e.createLabelPermission,expression:"createLabelPermission"}],staticClass:"create-button",attrs:{"zm-ta":"sidebar-user-label-add","aria-label":e.createBtnText},on:{click:function(t){return t.stopPropagation(),e.handleAddLabel.apply(null,arguments)}},nativeOn:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])?null:(t.stopPropagation(),t.preventDefault(),e.handleAddLabel.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.stopPropagation(),t.preventDefault(),e.handleAddLabel.apply(null,arguments))}]}},[t("shortcut-reminder",{attrs:{preTooltip:e.createBtnText,placement:"right"}},[t("svg-icon",{attrs:{iconClass:"add"}})],1)],1)],1),e.enableVirtualUserLabelList?t("VirtualUserLabelItems",{directives:[{name:"show",rawName:"v-show",value:e.listExpanded||e.isMinimized,expression:"listExpanded || isMinimized"}],attrs:{labels:e.flattenedUserLabels,isMinimized:e.isMinimized,selection:e.selectMailLabel},on:{select:e.handleSelectLabel,itemCommand:e.handleItemCommand}}):[t("LabelList",{directives:[{name:"show",rawName:"v-show",value:e.listExpanded||e.isMinimized,expression:"listExpanded || isMinimized"}],ref:"labelList",staticClass:"label-list",attrs:{labels:e.userLabelsTree,isMinimized:e.isMinimized,isUserLabel:!0,selection:e.selectMailLabel},on:{select:e.handleSelectLabel,itemCommand:e.handleItemCommand}})],t("label-dialog",{attrs:{visible:e.dialogVisible,action:e.action,item:e.labelItem,labelListTree:e.allLabelsTree,"append-to-body":"","zm-ta":"create-label-dialog"},on:{onOk:e.handleOperationOk,onCancel:e.handleOperationCancel,handleSelectLabel:e.handleSelectLabel,close:function(t){e.dialogVisible=!1}}})],2)},Y=[],X=i(10100),G=function(){var e=this,t=e._self._c;return t("RecycleScroller",{staticClass:"user-label-virtual-list tab-focus-button",attrs:{keyField:"id",items:e.labels,itemSize:32},scopedSlots:e._u([{key:"default",fn:function(i){var n=i.item;return[t("ShortcutReminder",{attrs:{placement:"right",preTooltip:e.isMinimized||!n.isSystem?e.getLabelContent(n):"",alwaysShowTooltip:e.isMinimized||n.isSystem,disabled:e.isDecryptFailed(n)}},[t("LabelItem",{directives:[{name:"metric",rawName:"v-metric:sidebar_custom_label",value:!n.isSystem,expression:"!item.isSystem",arg:"sidebar_custom_label"},{name:"metric",rawName:"v-metric:sidebar_label",value:{labelId:n.id},expression:"{ labelId: item.id }",arg:"sidebar_label"}],attrs:{noDropDownAction:!1,selectMailLabel:e.selection,item:n,isMinimized:e.isMinimized,isBolded:e.isBold(n),"zm-ta":e.getZmTaTag(n),showFlattenName:"",tabindex:"-1"},on:{click:function(t){return e.$emit("select",n)},handleCommand:function(t){return e.$emit("itemCommand",t)}}})],1)]}}])})},q=[],J=i(84282),Q=i(56632);i(43430),i(71372);function ee(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var i=e.indexOf("Trident/");if(i>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var a=e.indexOf("Edge/");return a>0?parseInt(e.substring(a+5,e.indexOf(".",a)),10):-1}var te=void 0;function ie(){ie.init||(ie.init=!0,te=-1!==ee())}var ne={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"resize-observer",attrs:{tabindex:"-1"}})},staticRenderFns:[],_scopeId:"data-v-b329ee4c",name:"resize-observer",methods:{compareAndNotify:function(){this._w===this.$el.offsetWidth&&this._h===this.$el.offsetHeight||(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.$emit("notify"))},addResizeHandlers:function(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers:function(){this._resizeObject&&this._resizeObject.onload&&(!te&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),delete this._resizeObject.onload)}},mounted:function(){var e=this;ie(),this.$nextTick((function(){e._w=e.$el.offsetWidth,e._h=e.$el.offsetHeight}));var t=document.createElement("object");this._resizeObject=t,t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",te&&this.$el.appendChild(t),t.data="about:blank",te||this.$el.appendChild(t)},beforeDestroy:function(){this.removeResizeHandlers()}};function ae(e){e.component("resize-observer",ne),e.component("ResizeObserver",ne)}var se={version:"0.4.5",install:ae},re=null;"undefined"!==typeof window?re=window.Vue:"undefined"!==typeof i.g&&(re=i.g.Vue),re&&re.use(se);i(634);function oe(e){return oe="function"===typeof Symbol&&"symbol"===(0,Q.Z)(Symbol.iterator)?function(e){return(0,Q.Z)(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":(0,Q.Z)(e)},oe(e)}function le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ce(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function de(e,t,i){return t&&ce(e.prototype,t),i&&ce(e,i),e}function ue(e){return he(e)||me(e)||pe()}function he(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}function me(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function pe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function fe(e){var t;return t="function"===typeof e?{callback:e}:e,t}function ve(e,t){var i,n,a,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=function(r){for(var o=arguments.length,l=new Array(o>1?o-1:0),c=1;c<o;c++)l[c-1]=arguments[c];if(a=l,!i||r!==n){var d=s.leading;"function"===typeof d&&(d=d(r,n)),i&&r===n||!d||e.apply(void 0,[r].concat(ue(a))),n=r,clearTimeout(i),i=setTimeout((function(){e.apply(void 0,[r].concat(ue(a))),i=0}),t)}};return r._clear=function(){clearTimeout(i),i=null},r}function be(e,t){if(e===t)return!0;if("object"===oe(e)){for(var i in e)if(!be(e[i],t[i]))return!1;return!0}return!1}var ge=function(){function e(t,i,n){le(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(i,n)}return de(e,[{key:"createObserver",value:function(e,t){var i=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=fe(e),this.callback=function(e,t){i.options.callback(e,t),e&&i.options.once&&(i.frozen=!0,i.destroyObserver())},this.callback&&this.options.throttle){var n=this.options.throttleOptions||{},a=n.leading;this.callback=ve(this.callback,this.options.throttle,{leading:function(e){return"both"===a||"visible"===a&&e||"hidden"===a&&!e}})}this.oldResult=void 0,this.observer=new IntersectionObserver((function(e){var t=e[0];if(e.length>1){var n=e.find((function(e){return e.isIntersecting}));n&&(t=n)}if(i.callback){var a=t.isIntersecting&&t.intersectionRatio>=i.threshold;if(a===i.oldResult)return;i.oldResult=a,i.callback(a,t)}}),this.options.intersection),t.context.$nextTick((function(){i.observer&&i.observer.observe(i.el)}))}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&this.options.intersection.threshold||0}}]),e}();function Se(e,t,i){var n=t.value;if(n)if("undefined"===typeof IntersectionObserver)console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var a=new ge(e,n,i);e._vue_visibilityState=a}}function Ie(e,t,i){var n=t.value,a=t.oldValue;if(!be(n,a)){var s=e._vue_visibilityState;n?s?s.createObserver(n,i):Se(e,{value:n},i):ye(e)}}function ye(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var we={bind:Se,update:Ie,unbind:ye};function xe(e){e.directive("observe-visibility",we)}var Le={version:"0.4.6",install:xe},Ce=null;"undefined"!==typeof window?Ce=window.Vue:"undefined"!==typeof i.g&&(Ce=i.g.Vue),Ce&&Ce.use(Le);var Me=i(66311),ke=i.n(Me),_e={itemsLimit:1e3},De={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:function(e){return["vertical","horizontal"].includes(e)}},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"}};function Te(){return this.items.length&&"object"!==(0,Q.Z)(this.items[0])}var Ee=!1;if("undefined"!==typeof window){Ee=!1;try{var $e=Object.defineProperty({},"passive",{get:function(){Ee=!0}});window.addEventListener("test",null,$e)}catch(Do){}}var Ae=0,Re={name:"RecycleScroller",components:{ResizeObserver:ne},directives:{ObserveVisibility:we},props:(0,l.Z)((0,l.Z)({},De),{},{itemSize:{type:Number,default:null},gridItems:{type:Number,default:void 0},itemSecondarySize:{type:Number,default:void 0},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1},skipHover:{type:Boolean,default:!1},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},listClass:{type:[String,Object,Array],default:""},itemClass:{type:[String,Object,Array],default:""}}),data:function(){return{pool:[],totalSize:0,ready:!1,hoverKey:null}},computed:{sizes:function(){if(null===this.itemSize){for(var e,t={"-1":{accumulator:0}},i=this.items,n=this.sizeField,a=this.minItemSize,s=1e4,r=0,o=0,l=i.length;o<l;o++)e=i[o][n]||a,e<s&&(s=e),r+=e,t[o]={accumulator:r,size:e};return this.$_computedMinItemSize=s,t}return[]},simpleArray:Te},watch:{items:function(){this.updateVisibleItems(!0)},pageMode:function(){this.applyPageMode(),this.updateVisibleItems(!1)},sizes:{handler:function(){this.updateVisibleItems(!1)},deep:!0},gridItems:function(){this.updateVisibleItems(!0)},itemSecondarySize:function(){this.updateVisibleItems(!0)}},created:function(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$_lastUpdateScrollPosition=0,this.prerender&&(this.$_prerender=!0,this.updateVisibleItems(!1)),this.gridItems&&!this.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems")},mounted:function(){var e=this;this.applyPageMode(),this.$nextTick((function(){e.$_prerender=!1,e.updateVisibleItems(!0),e.ready=!0}))},activated:function(){var e=this,t=this.$_lastUpdateScrollPosition;"number"===typeof t&&this.$nextTick((function(){e.scrollToPosition(t)}))},beforeDestroy:function(){this.removeListeners()},methods:{addView:function(e,t,i,n,a){var s={item:i,position:0},r={id:Ae++,index:t,used:!0,key:n,type:a};return Object.defineProperty(s,"nr",{configurable:!1,value:r}),e.push(s),s},unuseView:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.$_unusedViews,n=e.nr.type,a=i.get(n);a||(a=[],i.set(n,a)),a.push(e),t||(e.nr.used=!1,e.position=-9999,this.$_views["delete"](e.nr.key))},handleResize:function(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll:function(e){var t=this;this.$_scrollDirty||(this.$_scrollDirty=!0,requestAnimationFrame((function(){t.$_scrollDirty=!1;var e=t.updateVisibleItems(!1,!0),i=e.continuous;i||(clearTimeout(t.$_refreshTimout),t.$_refreshTimout=setTimeout(t.handleScroll,100))})))},handleVisibilityChange:function(e,t){var i=this;this.ready&&(e||0!==t.boundingClientRect.width||0!==t.boundingClientRect.height?(this.$emit("visible"),requestAnimationFrame((function(){i.updateVisibleItems(!1)}))):this.$emit("hidden"))},updateVisibleItems:function(e){var t,i,n,a,s,r,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.itemSize,c=this.gridItems||1,d=this.itemSecondarySize||l,u=this.$_computedMinItemSize,h=this.typeField,m=this.simpleArray?null:this.keyField,p=this.items,f=p.length,v=this.sizes,b=this.$_views,g=this.$_unusedViews,S=this.pool;if(f)if(this.$_prerender)t=a=0,i=s=Math.min(this.prerender,p.length),n=null;else{var I=this.getScroll();if(o){var y=I.start-this.$_lastUpdateScrollPosition;if(y<0&&(y=-y),null===l&&y<u||y<l)return{continuous:!0}}this.$_lastUpdateScrollPosition=I.start;var w=this.buffer;I.start-=w,I.end+=w;var x=0;if(this.$refs.before&&(x=this.$refs.before.scrollHeight,I.start-=x),this.$refs.after){var L=this.$refs.after.scrollHeight;I.end+=L}if(null===l){var C,M,k=0,_=f-1,D=~~(f/2);do{M=D,C=v[D].accumulator,C<I.start?k=D:D<f-1&&v[D+1].accumulator>I.start&&(_=D),D=~~((k+_)/2)}while(D!==M);for(D<0&&(D=0),t=D,n=v[f-1].accumulator,i=D;i<f&&v[i].accumulator<I.end;i++);for(-1===i?i=p.length-1:(i++,i>f&&(i=f)),a=t;a<f&&x+v[a].accumulator<I.start;a++);for(s=a;s<f&&x+v[s].accumulator<I.end;s++);}else{t=~~(I.start/l*c);var T=t%c;t-=T,i=Math.ceil(I.end/l*c),a=Math.max(0,Math.floor((I.start-x)/l*c)),s=Math.floor((I.end-x)/l*c),t<0&&(t=0),i>f&&(i=f),a<0&&(a=0),s>f&&(s=f),n=Math.ceil(f/c)*l}}else t=i=a=s=n=0;i-t>_e.itemsLimit&&this.itemsLimitError(),this.totalSize=n;var E=t<=this.$_endIndex&&i>=this.$_startIndex;if(this.$_continuous!==E){if(E){b.clear(),g.clear();for(var $=0,A=S.length;$<A;$++)r=S[$],this.unuseView(r)}this.$_continuous=E}else if(E)for(var R=0,Z=S.length;R<Z;R++)r=S[R],r.nr.used&&(e&&(r.nr.index=p.indexOf(r.item)),(-1===r.nr.index||r.nr.index<t||r.nr.index>=i)&&this.unuseView(r));for(var O,z,N,P,F=E?null:new Map,V=t;V<i;V++){O=p[V];var H=m?O[m]:O;if(null==H)throw new Error("Key is ".concat(H," on item (keyField is '").concat(m,"')"));r=b.get(H),l||v[V].size?(r?(r.nr.used=!0,r.item=O):(V===p.length-1&&this.$emit("scroll-end"),0===V&&this.$emit("scroll-start"),z=O[h],N=g.get(z),E?N&&N.length?(r=N.pop(),r.item=O,r.nr.used=!0,r.nr.index=V,r.nr.key=H,r.nr.type=z):r=this.addView(S,V,O,H,z):(P=F.get(z)||0,(!N||P>=N.length)&&(r=this.addView(S,V,O,H,z),this.unuseView(r,!0),N=g.get(z)),r=N[P],r.item=O,r.nr.used=!0,r.nr.index=V,r.nr.key=H,r.nr.type=z,F.set(z,P+1),P++),b.set(H,r)),null===l?(r.position=v[V-1].accumulator,r.offset=0):(r.position=Math.floor(V/c)*l,r.offset=V%c*d)):r&&this.unuseView(r)}return this.$_startIndex=t,this.$_endIndex=i,this.emitUpdate&&this.$emit("update",t,i,a,s),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,300),{continuous:E}},getListenerTarget:function(){var e=ke()(this.$el);return!window.document||e!==window.document.documentElement&&e!==window.document.body||(e=window),e},getScroll:function(){var e,t=this.$el,i=this.direction,n="vertical"===i;if(this.pageMode){var a=t.getBoundingClientRect(),s=n?a.height:a.width,r=-(n?a.top:a.left),o=n?window.innerHeight:window.innerWidth;r<0&&(o+=r,r=0),r+o>s&&(o=s-r),e={start:r,end:r+o}}else e=n?{start:t.scrollTop,end:t.scrollTop+t.clientHeight}:{start:t.scrollLeft,end:t.scrollLeft+t.clientWidth};return e},applyPageMode:function(){this.pageMode?this.addListeners():this.removeListeners()},addListeners:function(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,!!Ee&&{passive:!0}),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners:function(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem:function(e){var t;t=null===this.itemSize?e>0?this.sizes[e-1].accumulator:0:Math.floor(e/this.gridItems)*this.itemSize,this.scrollToPosition(t)},scrollToPosition:function(e){var t,i,n,a="vertical"===this.direction?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};if(this.pageMode){var s=ke()(this.$el),r="HTML"===s.tagName?0:s[a.scroll],o=s.getBoundingClientRect(),l=this.$el.getBoundingClientRect(),c=l[a.start]-o[a.start];t=s,i=a.scroll,n=e+r+c}else t=this.$el,i=a.scroll,n=e;t[i]=n},itemsLimitError:function(){var e=this;throw setTimeout((function(){console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",e.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")})),new Error("Rendered items limit reached")},sortViews:function(){this.pool.sort((function(e,t){return e.nr.index-t.nr.index}))}}};function Ze(e,t,i,n,a,s,r,o,l,c){"boolean"!==typeof r&&(l=o,o=r,r=!1);var d,u="function"===typeof i?i.options:i;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,a&&(u.functional=!0)),n&&(u._scopeId=n),s?(d=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(s)},u._ssrRegister=d):t&&(d=r?function(e){t.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,o(e))}),d)if(u.functional){var h=u.render;u.render=function(e,t){return d.call(t),h(e,t)}}else{var m=u.beforeCreate;u.beforeCreate=m?[].concat(m,d):[d]}return i}var Oe=Re,ze=function(){var e,t,i=this,n=i.$createElement,a=i._self._c||n;return a("div",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:i.handleVisibilityChange,expression:"handleVisibilityChange"}],staticClass:"vue-recycle-scroller",class:(e={ready:i.ready,"page-mode":i.pageMode},e["direction-"+i.direction]=!0,e),on:{"&scroll":function(e){return i.handleScroll.apply(null,arguments)}}},[i.$slots.before?a("div",{ref:"before",staticClass:"vue-recycle-scroller__slot"},[i._t("before")],2):i._e(),i._v(" "),a(i.listTag,{ref:"wrapper",tag:"component",staticClass:"vue-recycle-scroller__item-wrapper",class:i.listClass,style:(t={},t["vertical"===i.direction?"minHeight":"minWidth"]=i.totalSize+"px",t)},[i._l(i.pool,(function(e){return a(i.itemTag,i._g({key:e.nr.id,tag:"component",staticClass:"vue-recycle-scroller__item-view",class:[i.itemClass,{hover:!i.skipHover&&i.hoverKey===e.nr.key}],style:i.ready?{transform:"translate"+("vertical"===i.direction?"Y":"X")+"("+e.position+"px) translate"+("vertical"===i.direction?"X":"Y")+"("+e.offset+"px)",width:i.gridItems?("vertical"===i.direction&&i.itemSecondarySize||i.itemSize)+"px":void 0,height:i.gridItems?("horizontal"===i.direction&&i.itemSecondarySize||i.itemSize)+"px":void 0}:null},i.skipHover?{}:{mouseenter:function(){i.hoverKey=e.nr.key},mouseleave:function(){i.hoverKey=null}}),[i._t("default",null,{item:e.item,index:e.nr.index,active:e.nr.used})],2)})),i._v(" "),i._t("empty")],2),i._v(" "),i.$slots.after?a("div",{ref:"after",staticClass:"vue-recycle-scroller__slot"},[i._t("after")],2):i._e(),i._v(" "),a("ResizeObserver",{on:{notify:i.handleResize}})],1)},Ne=[];ze._withStripped=!0;var Pe=void 0,Fe=void 0,Ve=void 0,He=!1,Be=Ze({render:ze,staticRenderFns:Ne},Pe,Oe,Fe,He,Ve,!1,void 0,void 0,void 0),Ue={name:"DynamicScroller",components:{RecycleScroller:Be},provide:function(){return"undefined"!==typeof ResizeObserver&&(this.$_resizeObserver=new ResizeObserver((function(e){requestAnimationFrame((function(){if(Array.isArray(e)){var t,i=(0,J.Z)(e);try{for(i.s();!(t=i.n()).done;){var n=t.value;if(n.target){var a=new CustomEvent("resize",{detail:{contentRect:n.contentRect}});n.target.dispatchEvent(a)}}}catch(s){i.e(s)}finally{i.f()}}}))}))),{vscrollData:this.vscrollData,vscrollParent:this,vscrollResizeObserver:this.$_resizeObserver}},inheritAttrs:!1,props:(0,l.Z)((0,l.Z)({},De),{},{minItemSize:{type:[Number,String],required:!0}}),data:function(){return{vscrollData:{active:!0,sizes:{},validSizes:{},keyField:this.keyField,simpleArray:!1}}},computed:{simpleArray:Te,itemsWithSize:function(){for(var e=[],t=this.items,i=this.keyField,n=this.simpleArray,a=this.vscrollData.sizes,s=t.length,r=0;r<s;r++){var o=t[r],l=n?r:o[i],c=a[l];"undefined"!==typeof c||this.$_undefinedMap[l]||(c=0),e.push({item:o,id:l,size:c})}return e},listeners:function(){var e={};for(var t in this.$listeners)"resize"!==t&&"visible"!==t&&(e[t]=this.$listeners[t]);return e}},watch:{items:function(){this.forceUpdate(!1)},simpleArray:{handler:function(e){this.vscrollData.simpleArray=e},immediate:!0},direction:function(e){this.forceUpdate(!0)},itemsWithSize:function(e,t){for(var i=this.$el.scrollTop,n=0,a=0,s=Math.min(e.length,t.length),r=0;r<s;r++){if(n>=i)break;n+=t[r].size||this.minItemSize,a+=e[r].size||this.minItemSize}var o=a-n;0!==o&&(this.$el.scrollTop+=o)}},beforeCreate:function(){this.$_updates=[],this.$_undefinedSizes=0,this.$_undefinedMap={}},activated:function(){this.vscrollData.active=!0},deactivated:function(){this.vscrollData.active=!1},methods:{onScrollerResize:function(){var e=this.$refs.scroller;e&&this.forceUpdate(),this.$emit("resize")},onScrollerVisible:function(){this.$emit("vscroll:update",{force:!1}),this.$emit("visible")},forceUpdate:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];(e||this.simpleArray)&&(this.vscrollData.validSizes={}),this.$emit("vscroll:update",{force:!0})},scrollToItem:function(e){var t=this.$refs.scroller;t&&t.scrollToItem(e)},getItemSize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=this.simpleArray?null!=t?t:this.items.indexOf(e):e[this.keyField];return this.vscrollData.sizes[i]||0},scrollToBottom:function(){var e=this;if(!this.$_scrollingToBottom){this.$_scrollingToBottom=!0;var t=this.$el;this.$nextTick((function(){t.scrollTop=t.scrollHeight+5e3;var i=function i(){t.scrollTop=t.scrollHeight+5e3,requestAnimationFrame((function(){t.scrollTop=t.scrollHeight+5e3,0===e.$_undefinedSizes?e.$_scrollingToBottom=!1:requestAnimationFrame(i)}))};requestAnimationFrame(i)}))}}}},je=Ue,We=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("RecycleScroller",e._g(e._b({ref:"scroller",attrs:{items:e.itemsWithSize,"min-item-size":e.minItemSize,direction:e.direction,"key-field":"id","list-tag":e.listTag,"item-tag":e.itemTag},on:{resize:e.onScrollerResize,visible:e.onScrollerVisible},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.item,n=t.index,a=t.active;return[e._t("default",null,null,{item:i.item,index:n,active:a,itemWithSize:i})]}}],null,!0)},"RecycleScroller",e.$attrs,!1),e.listeners),[e._v(" "),i("template",{slot:"before"},[e._t("before")],2),e._v(" "),i("template",{slot:"after"},[e._t("after")],2),e._v(" "),i("template",{slot:"empty"},[e._t("empty")],2)],2)},Ke=[];We._withStripped=!0;var Ye=void 0,Xe=void 0,Ge=void 0,qe=!1,Je=Ze({render:We,staticRenderFns:Ke},Ye,je,Xe,qe,Ge,!1,void 0,void 0,void 0),Qe={name:"DynamicScrollerItem",inject:["vscrollData","vscrollParent","vscrollResizeObserver"],props:{item:{required:!0},watchData:{type:Boolean,default:!1},active:{type:Boolean,required:!0},index:{type:Number,default:void 0},sizeDependencies:{type:[Array,Object],default:null},emitResize:{type:Boolean,default:!1},tag:{type:String,default:"div"}},computed:{id:function(){if(this.vscrollData.simpleArray)return this.index;if(this.item.hasOwnProperty(this.vscrollData.keyField))return this.item[this.vscrollData.keyField];throw new Error("keyField '".concat(this.vscrollData.keyField,"' not found in your item. You should set a valid keyField prop on your Scroller"))},size:function(){return this.vscrollData.validSizes[this.id]&&this.vscrollData.sizes[this.id]||0},finalActive:function(){return this.active&&this.vscrollData.active}},watch:{watchData:"updateWatchData",id:function(){this.size||this.onDataUpdate()},finalActive:function(e){this.size||(e?this.vscrollParent.$_undefinedMap[this.id]||(this.vscrollParent.$_undefinedSizes++,this.vscrollParent.$_undefinedMap[this.id]=!0):this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=!1)),this.vscrollResizeObserver?e?this.observeSize():this.unobserveSize():e&&this.$_pendingVScrollUpdate===this.id&&this.updateSize()}},created:function(){var e=this;if(!this.$isServer&&(this.$_forceNextVScrollUpdate=null,this.updateWatchData(),!this.vscrollResizeObserver)){var t=function(t){e.$watch((function(){return e.sizeDependencies[t]}),e.onDataUpdate)};for(var i in this.sizeDependencies)t(i);this.vscrollParent.$on("vscroll:update",this.onVscrollUpdate),this.vscrollParent.$on("vscroll:update-size",this.onVscrollUpdateSize)}},mounted:function(){this.vscrollData.active&&(this.updateSize(),this.observeSize())},beforeDestroy:function(){this.vscrollParent.$off("vscroll:update",this.onVscrollUpdate),this.vscrollParent.$off("vscroll:update-size",this.onVscrollUpdateSize),this.unobserveSize()},methods:{updateSize:function(){this.finalActive?this.$_pendingSizeUpdate!==this.id&&(this.$_pendingSizeUpdate=this.id,this.$_forceNextVScrollUpdate=null,this.$_pendingVScrollUpdate=null,this.computeSize(this.id)):this.$_forceNextVScrollUpdate=this.id},updateWatchData:function(){var e=this;this.watchData&&!this.vscrollResizeObserver?this.$_watchData=this.$watch("item",(function(){e.onDataUpdate()}),{deep:!0}):this.$_watchData&&(this.$_watchData(),this.$_watchData=null)},onVscrollUpdate:function(e){var t=e.force;!this.finalActive&&t&&(this.$_pendingVScrollUpdate=this.id),this.$_forceNextVScrollUpdate!==this.id&&!t&&this.size||this.updateSize()},onDataUpdate:function(){this.updateSize()},computeSize:function(e){var t=this;this.$nextTick((function(){if(t.id===e){var i=t.$el.offsetWidth,n=t.$el.offsetHeight;t.applySize(i,n)}t.$_pendingSizeUpdate=null}))},applySize:function(e,t){var i=~~("vertical"===this.vscrollParent.direction?t:e);i&&this.size!==i&&(this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=void 0),this.$set(this.vscrollData.sizes,this.id,i),this.$set(this.vscrollData.validSizes,this.id,!0),this.emitResize&&this.$emit("resize",this.id))},observeSize:function(){this.vscrollResizeObserver&&this.$el.parentNode&&(this.vscrollResizeObserver.observe(this.$el.parentNode),this.$el.parentNode.addEventListener("resize",this.onResize))},unobserveSize:function(){this.vscrollResizeObserver&&(this.vscrollResizeObserver.unobserve(this.$el.parentNode),this.$el.parentNode.removeEventListener("resize",this.onResize))},onResize:function(e){var t=e.detail.contentRect,i=t.width,n=t.height;this.applySize(i,n)}},render:function(e){return e(this.tag,this.$slots["default"])}},et=Qe,tt=void 0,it=void 0,nt=void 0,at=void 0,st=Ze({},tt,et,it,at,nt,!1,void 0,void 0,void 0);function rt(e,t){e.component("".concat(t,"recycle-scroller"),Be),e.component("".concat(t,"RecycleScroller"),Be),e.component("".concat(t,"dynamic-scroller"),Je),e.component("".concat(t,"DynamicScroller"),Je),e.component("".concat(t,"dynamic-scroller-item"),st),e.component("".concat(t,"DynamicScrollerItem"),st)}var ot={version:"1.1.2",install:function(e,t){var i=Object.assign({},{installComponents:!0,componentsPrefix:""},t);for(var n in i)"undefined"!==typeof i[n]&&(_e[n]=i[n]);i.installComponents&&rt(e,i.componentsPrefix)}},lt=null;"undefined"!==typeof window?lt=window.Vue:"undefined"!==typeof i.g&&(lt=i.g.Vue),lt&&lt.use(ot);var ct,dt={name:"VirtualUserLabelItems",components:{RecycleScroller:Be,LabelItem:A,ShortcutReminder:R.Z},props:{labels:{type:Array,default:[]},isMinimized:{type:Boolean,default:!1},selection:{type:Object,default:null}},computed:(0,l.Z)({},(0,h.Se)(["isGmail","isOutlook"])),methods:{getZmTaTag:function(e){var t,i=null===(t=this.getLabelContent(e))||void 0===t?void 0:t.toLowerCase();return"sidebar-user-label-".concat(i)},isDecryptFailed:function(e){return d.Utils.isDecryptFailed(e.labelDecryptionStatus)},isBold:function(e){var t;return(null===(t=e.count)||void 0===t?void 0:t.msgUnread)>0},getLabelContent:function(e){return d.Utils.isDecryptFailed(e.labelDecryptionStatus)?this.$t("label.encryptedLabel"):e.labelDisplayNamePathArray.join("/")}}},ut=dt,ht=(0,E.Z)(ut,G,q,!1,null,"09f74a31",null),mt=ht.exports,pt=d.Enums.LabelActions,ft=d.Enums.ADDON_ITEM_IDS,vt={name:"UserLabels",components:{LabelList:P,labelDialog:F.Z,ShortcutReminder:R.Z,VirtualUserLabelItems:mt},props:{isMinimized:{type:Boolean}},data:function(){return{action:"",listExpanded:!0,dialogVisible:!1,labelItem:{}}},computed:(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)(["selectMailLabel","allLabels","prefersColorScheme"])),(0,h.Se)(["isZmail","isOutlook","showDecryptFailedReminder","enableVirtualUserLabelList","userLabelsTree","allLabelsTree","flattenedUserLabels"])),(0,h.rn)("auth",["isAuthed"])),(0,h.Se)("delegate",["permissionRole"])),{},{createLabelPermission:function(e){var t=e.permissionRole;return(0,c.yz)(t,c.Vn.CREATE_LABEL)},providerIsGmail:function(){return this.$store.state.typeOfEmail===X.EMAIL_PROVIDER.GMAIL},headerText:function(){return this.isOutlook?this.$t("label.folders"):this.$t("label.labels")},createBtnText:function(){return this.isOutlook?this.$t("label.createFolder"):this.$t("label.createLabel")}}),watch:{allLabels:function(e){var t,i,n=this;if((null===(t=this.selectMailLabel)||void 0===t?void 0:t.id)!==d.Enums.SystemDefinedMailLabelIds.SEARCH&&!Object.values(ft).includes(null===(i=this.selectMailLabel)||void 0===i?void 0:i.id)){var a=e.find((function(e){var t;return e.id===(null===(t=n.selectMailLabel)||void 0===t?void 0:t.id)}))||{};if(!Object.keys(a).length&&this.isAuthed){var s=null===e||void 0===e?void 0:e.some((function(e){return e.id===d.Enums.SystemDefinedMailLabelIds.INBOX&&e.isSystem}));s?this.handleSelectLabel({isSystem:!0,id:d.Enums.SystemDefinedMailLabelIds.INBOX}):console.warn("allLabels data changed, but not found inbox label, maybe label data didn't initialized",e)}}}},methods:(0,l.Z)((0,l.Z)({},(0,h.OI)(["setShowDecryptFailedReminder","setDecryptFailedReminderContent"])),{},{toggleListExpanded:function(){this.listExpanded=!this.listExpanded},handleSelectLabel:function(e){this.$emit("handleSelectLabel",e)},handleAddLabel:function(){this.dialogVisible=!0,this.labelItem={},this.action=pt.CREATE},handleItemCommand:function(e){var t=e.item,i=e.method;console.log("handleItemCommand ---------- ",t,i),this.action=i,i===pt.DELETE||i===pt.EDIT||i===pt.ADDSUB?(this.labelItem=t,this.dialogVisible=!0):i===pt.RETRYDECRYPT&&this.retryDecryptLabel(t,!0)},handleOperationOk:function(e){var t=this,i=e.action,n=e.labels;this.dialogVisible=!1,i===d.Enums.LabelActions.CREATE&&(this.listExpanded=!0),i===d.Enums.LabelActions.ADDSUB&&(this.listExpanded=!0,n.forEach((function(e){var i;null===(i=t.$refs.labelList)||void 0===i||i.handleNodeExpand({id:e.parentFolderId})})))},handleOperationCancel:function(){this.dialogVisible=!1},retryDecryptLabel:function(e,t){var i=this;return(0,r.Z)((0,s.Z)().mark((function n(){var a;return(0,s.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,console.log("retrying decryption for label",e),n.next=4,window.zoomSdk.postJsMessage({functionName:"mailui_retrydecryptlabel",params:{labelId:e.id}});case 4:a=n.sent,0===a.returnCode?i.$store.commit("changeMailLabelsDisplayNum",[a.result.RetryDecryptLabel]):t&&i.$undoNotice({title:d.Utils.getErrMsgWithCode(i.$t("label.unableToDecryptLabel"),a)}),n.next=11;break;case 8:n.prev=8,n.t0=n["catch"](0),i.$msg({type:"Error",content:i.$t("label.errorDecryptingLabel")});case 11:case"end":return n.stop()}}),n,null,[[0,8]])})))()},focusOnTree:function(){this.$refs.labelList.$el.children[0].focus()}})},bt=vt,gt=(0,E.Z)(bt,K,Y,!1,null,"c33dc8f2",null),St=gt.exports,It=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"scale",rawName:"v-scale",value:1,expression:"1"}],staticClass:"inbox-container",attrs:{id:"inbox-container"}},[e.globalFilterDialogIsInited?t("add-filter-dialog",{ref:"addFilterDialog",attrs:{filterEdits:e.filterEdits},on:{cancel:function(){},submit:function(){}}}):e._e(),t("div",{staticClass:"top-bar"},[t("search",{ref:"searchRef",staticClass:"search-container",attrs:{"zm-ta":"inbox-search"},on:{changeSearchErrorStatus:e.changeSearchErrorStatus,redirect:e.redirectToThread}}),t("div",{staticClass:"header-bar-right"},[e.isTestClient?t("span",{staticClass:"header-bar__version"},[e._v(" "+e._s(e.$t("common.version",[e.versionInfo]))+" "),e.fixedJiras.length>0?t("span",[e._v(" ("),t("a",{on:{click:function(t){return e.handDevInfo(!0)}}},[e._v(e._s(e.$t("common.packageInfo"))+" ")]),e._v(") ")]):e._e()]):e._e(),t("zm-tooltip",{attrs:{content:e.$t("operation.refresh"),placement:"bottom",enterable:!1}},[t("zm-button",{directives:[{name:"metric",rawName:"v-metric:inbox_refresh",arg:"inbox_refresh"}],staticClass:"header-bar-btn",attrs:{tabindex:"0","aria-label":e.$t("operation.refresh"),"aria-expanded":void 0,"zm-ta":"inbox-refresh"},on:{click:e.throttleHandleSyncMail}},[t("svg-icon",{class:{"circle-refresh":e.refreshRun},attrs:{iconClass:"refresh"}})],1)],1),t("zm-tooltip",{attrs:{content:e.$t(e.isSplitView?"common.listView":"common.splitView"),placement:"bottom",enterable:!1}},[t("zm-button",{directives:[{name:"metric",rawName:"v-metric:inbox_toggle_view",arg:"inbox_toggle_view"}],staticClass:"header-bar-btn",attrs:{"zm-ta":e.isSplitView?"inbox-toggle-list-view":"inbox-toggle-split-view",tabindex:"0","aria-label":e.$t(e.isSplitView?"common.listView":"common.splitView"),"aria-expanded":void 0},on:{click:e.toggleListView}},[t("svg-icon",{attrs:{iconClass:e.isSplitView?"list-view":"split-view"}})],1)],1),t("zm-tooltip",{attrs:{value:e.settingsTooltipVisible,content:e.$t("common.settings"),placement:"bottom",enterable:!1,manual:!0}},[t("zm-button",{directives:[{name:"metric",rawName:"v-metric:inbox_go_setting",arg:"inbox_go_setting"}],staticClass:"header-bar-btn",attrs:{tabindex:"0","zm-ta":"inbox-go-setting-page","aria-expanded":void 0,"aria-label":e.$t("common.settings")},on:{click:e.goToSettings}},[t("svg-icon",{attrs:{iconClass:"setting"},on:{mouseover:function(t){e.settingsTooltipVisible=!0},mouseleave:function(t){e.settingsTooltipVisible=!1}}})],1)],1),e.enablePopoutClientTab?t("MailPopoutButton"):e._e()],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.showDetail||e.isSplitView,expression:"!showDetail || isSplitView"}],ref:"headerBar",staticClass:"header-bar-wrap",on:{contextmenu:e.handleHideActions}},[t("div",{staticClass:"header-bar"},[t("CategoryTabs",{attrs:{selectionCount:e.selectedInboxMailIds.length}})],1),e.isShowControlHeader?t("ControlHeader",{ref:"controlHeader",attrs:{isLoading:e.isLoading,actions:e.actions,mailCount:e.mailCount},on:{showApproveDialog:e.showApproveDialog,handleCheckMore:e.handleCheckMore,changeSearchErrorStatus:e.changeSearchErrorStatus,handleCheckAllChange:e.handleCheckAllChange,setSelectInboxes:e.setSelectInboxes,viewFilters:e.handleViewFilters,filterChange:e.handleSearchFilterChange}}):e._e()],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.showScreener,expression:"showScreener"}]},[t("ScreenerPreview",{on:{select:e.handleScreenerSelect,goToSettings:function(t){return e.goToSettings({tab:"inbox",highlightId:"approver"})},goToManage:function(t){return e.goToSettings({tab:"newSenders"})}}})],1),e.isShowAutoDeleteTip?t("auto-delete-tip",{attrs:{shouldShowEmptyState:e.shouldShowEmptyState},on:{emptyStart:e.handleEmptyStart,emptyEnd:e.handleEmptyEnd}}):e._e(),t("inbox-page-layout",{ref:"layoutRef",scopedSlots:e._u([{key:"list",fn:function(){return[t("context-menu",{attrs:{hitTest:e.contextMenuIsAvailable}},[t("div",{staticClass:"mail-list",attrs:{slot:"trigger",id:"mail-list"},slot:"trigger"},[e.isZmail?t("low-storage-usage-tips"):e._e(),e.currentLabelId===e.groupLabel?t("div",{staticClass:"group-label-description tab-focus",attrs:{tabindex:"0"}},[e._v(" "+e._s(e.$t("groupSetting.groupLabelDescription",[5]))+" ")]):e._e(),e.inboxSectionVisible?t("div",{staticClass:"recycle-scroller-container-sections"},[t("inbox-sections",{ref:"inboxSections",on:{handleDelete:function(t){return e.handleTrashItems([t])},handleDeleteForever:function(t){return e.handleDeleteForeverItems([t])},handleArchive:function(t){return e.handleArchiveItems([t])},handleMove:function(t){return e.handleItemsMoveToInbox([t])},handleNotSpam:function(t){return e.handleItemsNotSpam([t])},handleMark:function(t){return e.handleItemsMark([t.item],t.type)},handleCheckedItemsChange:e.handleCheckedItemsChange,handleShowActions:e.handleShowActions,handleHideActions:e.handleHideActions,showDetail:e.handleShowDetail,handleCancelScheduledSend:e.handleCancelScheduledSend,handleDiscardDrafts:e.handleDiscardDrafts,setSelectItem:e.setSelectItem,moreMenuVisibleChange:e.handleMoreMenuVisibleChange,handleRenameSubject:e.showRenameSubjectDialog,handleReplyLater:e.handleReplyLater,handleRemoveReplyLater:e.handleRemoveReplyLater}})],1):[e.shouldShowEmptyState?t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.isLoading,expression:"isLoading"}],staticClass:"no-data empty-state",attrs:{"element-loading-spinner":"zm-icon-loading"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:!e.isLoading,expression:"!isLoading"}],staticClass:"no-data-tip"},[t("div",{staticClass:"no-data-in-label"},[e.isSplitView?e._e():t("div",{staticClass:"splash-image"},[t("img",{staticClass:"splash",attrs:{src:i(66813),alt:e.$t("list.splashImage")}})]),t("div",{staticClass:"list-no-data-text"},[t("span",{class:{"list-no-data-text-primary":e.inSearching&&e.isEncryptedZmail}},[e._v(" "+e._s(e.inSearchOrFilter?e.$t("list.noEmailsInSearch"):e.listText)+" ")]),e.inSearching&&e.isEncryptedZmail?t("div",[e.showCacheMailTip?t("div",[e._v(" "+e._s(e.$t("search.searchLimited"))+" ")]):t("div",[e._v(" "+e._s(e.$t("search.usingDifferentKeywords"))+" ")])]):e._e(),e.isAutoDeleteInbox?t("div",[e._v(e._s(e.autoDeleteText))]):e._e()]),t("zm-button",{directives:[{name:"show",rawName:"v-show",value:e.retryVisible,expression:"retryVisible"}],attrs:{"zm-ta":"inbox-list-retry"},on:{click:e.retry}},[e._v(" "+e._s(e.$t("common.retry"))+" ")])],1)])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.shouldShowEmptyState,expression:"!shouldShowEmptyState"},{name:"loading",rawName:"v-loading",value:e.isWaitingFirstResponse,expression:"isWaitingFirstResponse"}],staticClass:"recycle-scroller-container",attrs:{id:"virtual-container","element-loading-spinner":"zm-icon-loading",tabindex:"-1"}},[t("RecycleScroller",{ref:"recycleScroller",staticClass:"recycle-scroller tab-focus-button",attrs:{id:"threads-list",tabindex:"0","aria-label":e.$t("accessibility.emailList"),keyField:"mailId",items:e.mails,sizeField:"height",simpleArray:!1},on:{handleHideActions:e.handleHideActions,onLoadMore:e.loadMore},scopedSlots:e._u([{key:"default",fn:function(i){var n=i.item;return[t("inbox-item",{key:n.mailId,attrs:{"zm-ta":"inbox-item-"+n.mailId,isLoadingDetail:e.currentLoadingMailId===n.mailId,inboxItem:n,hideDropDownMenu:e.showActions,tabindex:"-1"},on:{handleDelete:function(t){return e.handleTrashItems([t])},handleDeleteForever:function(t){return e.handleDeleteForeverItems([t])},handleArchive:function(t){return e.handleArchiveItems([t])},handleMove:function(t){return e.handleItemsMoveToInbox([t])},handleNotSpam:function(t){return e.handleItemsNotSpam([t])},handleMark:function(t){return e.handleItemsMark([t.item],t.type)},handleCheckedItemsChange:e.handleCheckedItemsChange,handleShowActions:e.handleShowActions,handleHideActions:e.handleHideActions,showDetail:e.handleShowDetail,handleCancelScheduledSend:e.handleCancelScheduledSend,handleDiscardDrafts:e.handleDiscardDrafts,setSelectItem:e.setSelectItem,moreMenuVisibleChange:e.handleMoreMenuVisibleChange,handleRenameSubject:e.showRenameSubjectDialog,handleInboxItemFocus:e.handleInboxItemFocus,handleReplyLater:e.handleReplyLater,handleRemoveReplyLater:e.handleRemoveReplyLater,popoutDetail:e.handlePopoutDetail}})]}},{key:"after",fn:function(){return[t("div",{directives:[{name:"show",rawName:"v-show",value:e.showLoadMoreIcon,expression:"showLoadMoreIcon"}],staticClass:"list-loading"},[t("i",{staticClass:"zm-icon-loading"})]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.errorStatus&&!e.showLoadMoreIcon&&!e.isReachLastPage,expression:"errorStatus && !showLoadMoreIcon && !isReachLastPage"}],staticClass:"mail-list-retry",on:{click:e.retry}},[t("zm-button",{staticClass:"retry-button",attrs:{"zm-ta":"inbox-list-retry",type:"link"}},[t("svg-icon",{staticClass:"retry-icon",attrs:{iconClass:"refresh"}})],1),t("div",{staticClass:"retry-text"},[e._v(" "+e._s(e.$t("common.retry"))+" ")])],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.isReachLastPage&&!e.isLoading&&0!==e.inboxList.length,expression:"isReachLastPage && !isLoading && inboxList.length !== 0"}],staticClass:"list-marker",on:{contextmenu:function(t){return t.stopPropagation(),e.handleHideActions.apply(null,arguments)}}},[e.inSearching&&e.isEncryptedZmail&&e.showCacheMailTip?t("span",{staticClass:"list-marker-secondary"},[e._v(" "+e._s(e.$t("search.searchLimited"))+" ")]):t("span",[e._v(" "+e._s(e.$t("list.endOfEmails"))+" ")])])]},proxy:!0}],null,!1,2938363741)})],1)]],2),t("div",[e.showMove2Inbox?t("context-menu-item",{attrs:{"zm-ta":"inbox-action-move-to-inbox"},on:{click:function(t){return e.handleItemsMoveToInbox(e.selectedThreadItems)}}},[t("svg-icon",{attrs:{iconClass:"inbox"}}),t("div",[e._v(e._s(e.$t("operation.moveToInbox")))])],1):e._e(),e.showMove2Trash?t("context-menu-item",{attrs:{"zm-ta":"inbox-action-delete"},on:{click:function(t){return e.handleTrashItems(e.selectedThreadItems)}}},[t("svg-icon",{attrs:{iconClass:"delete"}}),t("div",[e._v(e._s(e.$t("operation.delete")))])],1):e._e(),e.canDeleteForever?t("context-menu-item",{attrs:{"zm-ta":"inbox-action-delete-forever"},on:{click:function(t){return e.handleDeleteForeverItems(e.selectedThreadItems)}}},[t("svg-icon",{attrs:{iconClass:"delete"}}),t("div",[e._v(e._s(e.$t("operation.deleteForever")))])],1):e._e(),e.archiveStatus?t("context-menu-item",{attrs:{"zm-ta":"inbox-action-archive"},on:{click:function(t){return e.handleArchiveItems(e.selectedThreadItems)}}},[t("svg-icon",{attrs:{iconClass:"archive"}}),t("div",[e._v(e._s(e.$t("operation.archive")))])],1):e._e(),e.hasRead?t("context-menu-item",{attrs:{"zm-ta":"inbox-action-mark-as-unread"},on:{click:function(t){return e.handleReadToggle(!1)}}},[t("svg-icon",{attrs:{iconClass:"unread"}}),t("div",[e._v(e._s(e.$t("operation.markAsUnread")))])],1):e._e(),e.hasUnread&&e.allowMarkAsRead?t("context-menu-item",{attrs:{"zm-ta":"inbox-action-mark-as-read"},on:{click:function(t){return e.handleReadToggle(!0)}}},[t("svg-icon",{attrs:{iconClass:"read"}}),t("div",[e._v(e._s(e.$t("operation.markAsRead")))])],1):e._e(),e.hasDraft?t("context-menu-item",{attrs:{"zm-ta":"inbox-action-discard-draft"},on:{click:function(t){return e.handleDiscardDrafts(!0)}}},[t("svg-icon",{attrs:{iconClass:"draft"}}),t("div",[e._v(e._s(e.$t("operation.discardDraft")))])],1):e._e(),e.enableReplyLater&&!e.areThreadsMarkedAsReplyLater?t("context-menu-item",{attrs:{"zm-ta":"inbox-action-add-reply-later"},on:{click:e.handleBatchReplyLater}},[t("svg-icon",{attrs:{iconClass:"reply-later"}}),t("div",[e._v(e._s(e.$t("operation.replyLater")))])],1):e._e(),e.enableReplyLater&&e.areThreadsMarkedAsReplyLater?t("context-menu-item",{attrs:{"zm-ta":"inbox-action-remove-reply-later"},on:{click:e.handleBatchRemoveReplyLater}},[t("svg-icon",{attrs:{iconClass:"remove-reply-later"}}),t("div",[e._v(e._s(e.$t("operation.removeReplyLater")))])],1):e._e(),e.isAllowSnooze?t("context-menu-sub",[t("div",{staticClass:"snooze-item",attrs:{slot:"trigger"},slot:"trigger"},[t("svg-icon",{attrs:{iconClass:"snooze"}}),t("div",{staticClass:"label"},[e._v(e._s(e.$t("operation.snooze")))]),t("svg-icon",{attrs:{iconClass:"arrow-right"}})],1),t("snooze-menu",{attrs:{hasUnsnooze:e.isInSnoozed},on:{onSnoozeTime:e.snoozeEmails,unsnooze:e.onUnsnooze}})],1):e._e(),e.shouldShowRenameSubjectMenuItem?t("context-menu-item",{attrs:{"zm-ta":"inbox-action-rename-subject"},on:{click:e.showRenameSubjectDialog}},[t("svg-icon",{attrs:{iconClass:"pen"}}),e._v(" "+e._s(e.$t("operation.renameSubject"))+" ")],1):e._e(),e.isOutlook?e._e():t("divider"),e.isOutlook?e._e():t("context-menu-item",{attrs:{"zm-ta":"inbox-action-filter-messages-like-this"},on:{click:e.createFilterFromSelectedItem}},[t("svg-icon",{attrs:{iconClass:"funnel"}}),e._v(" "+e._s(e.$t("operation.createFilter"))+" ")],1),e.hasNegativeActions?t("divider"):e._e(),e.isOutlook||e.allSelectedInvalidToSpam?e._e():t("context-menu-item",{attrs:{"zm-ta":"inbox-action-"+(e.isSpammed?"remove-from-spam":"mark-as-spam")},on:{click:e.handleItemsSpamToggle}},[t("svg-icon",{attrs:{iconClass:e.isSpammed?"unspam":"spam"}}),e._v(" "+e._s(e.spamStatus)+" ")],1),e.isZmail&&!e.userProfile.isDelegated&&e.isHideFromDelegateActionVisible?t("context-menu-item",{attrs:{"zm-ta":"inbox-action-make-private"},on:{click:e.hideFromDelegates}},[t("svg-icon",{attrs:{iconClass:"locked"}}),e._v(" "+e._s(e.$t("operation.hideFromDelegates"))+" ")],1):e._e(),e.isZmail&&!e.userProfile.isDelegated&&e.isShowToDelegateActionVisible?t("context-menu-item",{attrs:{"zm-ta":"inbox-action-remove-private"},on:{click:e.showToDelegates}},[t("svg-icon",{attrs:{iconClass:"unlocked"}}),e._v(" "+e._s(e.$t("operation.showToDelegates"))+" ")],1):e._e(),"DRAFT"!==e.currentLabelId?[t("divider"),t("context-menu-item",{attrs:{"zm-ta":"inbox-action-popout-details"},on:{click:e.popoutSelectedInboxItemsDetails}},[t("svg-icon",{attrs:{iconClass:"pop-window"}}),e._v(" "+e._s(e.$t("operation.openInNewWindow"))+" ")],1)]:e._e()],2)])]},proxy:!0},{key:"detail",fn:function(){return[e.isSplitView&&!e.showDetail?t("div",{staticClass:"detail-view splash-image"},[t("div",{staticClass:"no-data-tip"},[t("img",{staticClass:"splash",attrs:{src:i(66813),alt:e.$t("list.splashImage"),draggable:"false"}})])]):e._e(),e.isSplitView&&e.currentLoadingMailId?t("div",{directives:[{name:"loading",rawName:"v-loading",value:!0,expression:"true"}],staticClass:"response-detail-loading",attrs:{"element-loading-spinner":"zm-icon-loading","element-loading-text":e.$t("detail.loadingEmail")}}):e._e(),t("detail",{directives:[{name:"show",rawName:"v-show",value:e.showDetail,expression:"showDetail"}],ref:"detailRef",staticClass:"detail-view",on:{showDetail:e.handleShowDetail,handleRenameSubject:e.showRenameSubjectDialog,openLastMailInInboxList:e.loadMore}})]},proxy:!0}])}),e.isOfflineByDisconnection?t("offline-mode-inbox-banner"):e._e(),t("confirm-dialog",{attrs:{visible:e.showApproveUserDialog,hasBold:e.hasBold,actions:e.approveUserActions,title:e.$t("operation.approveThisEmailAddress"),width:"475px"}}),t("zm-dialog",{staticClass:"get-started",attrs:{width:"490px",visible:e.showGetStartedModal,"append-to-body":"",modal:"","aria-label":e.$t("accessibility.zoom")}},[t("div",{staticClass:"logo",attrs:{"aria-label":e.$t("landing.zoomLogo"),role:"text"}},[t("svg-icon",{attrs:{"aria-hidden":!0,iconClass:"logo"}})],1),t("div",{staticClass:"description"},[e._v(e._s(e.$t("landing.aimsToHelp")))]),t("div",{staticClass:"items"},e._l(["enjoyInbox","useTeamChat","customizeInbox"],(function(i,n){return t("div",{key:i,staticClass:"item"},[t("div",{staticClass:"item-title"},[t("span",[e._v(e._s(n+1))]),t("div",[e._v(e._s(e.$t("landing.".concat(i))))])]),t("div",{staticClass:"item-detail"},[e._v(e._s(e.$t("landing.".concat(i,"Detail"))))])])})),0),t("zm-button",{attrs:{type:"primary"},on:{click:e.closeGetStartedModal}},[e._v(" "+e._s(e.$t("landing.getStarted"))+" ")])],1),e.isTestClient&&e.fixedJiras.length>0?t("zm-dialog",{staticClass:"fixed-jiras-dialog",attrs:{visible:e.showDevJIRA,title:"Fixed Issues In Recent 3 Days","append-to-body":"",modal:""}},[t("div",{staticClass:"fixed-jiras-continer"},[t("p",[e._v(e._s(e.latestMergeInfo))]),e._l(e.fixedJiras,(function(i){return t("div",{key:i},[t("a",{attrs:{href:i}},[e._v(e._s(i))])])}))],2),t("zm-button",{on:{click:function(t){return e.handDevInfo(!1)}}},[e._v("Close")])],1):e._e(),e.renameSubjectDialogVisible?t("RenameSubjectDialog",{attrs:{"mail-head-item":e.renameMailHeadItem},on:{close:e.closeRenameSubjectDialog}}):e._e(),t("ScreenerDialog",{ref:"screenerDialog",attrs:{visible:e.showScreenerDialog},on:{close:function(t){e.showScreenerDialog=!1}}}),e.enableReplyLater&&e.showReplyLaterCard&&e.replyLaterMailHeads.length>0?t("ReplyLater",{attrs:{"mail-heads":e.replyLaterMailHeads},on:{onRemoveCard:e.onRemoveReplyLater,onCardClick:e.instantOpenDetails}}):e._e()],1)},yt=[],wt=i(26274),xt=(i(21515),i(77950),i(85940),i(27072),i(67694),i(37348)),Lt=i.n(xt),Ct=i(37761),Mt=i.n(Ct),kt=i(46905),_t=i(87693),Dt=i(41236),Tt=i(87585),Et=i(89202),$t=function(){var e=this,t=e._self._c;return t("div",{ref:"inboxItem",class:["inbox-item","tab-focus",e.scaleClass,(0,wt.Z)({"inbox-border":!e.isString(e.inboxItem),"checked-item":!e.isString(e.inboxItem)&&e.isSelected,"is-sticky":e.isString(e.inboxItem),"split-view":e.isSplitView,"split-view-last-selected":e.splitViewSelected,"drag-selection":e.includedInDragSelection,"inbox-item-header":e.isString(e.inboxItem)},"normal-inbox-item-".concat(e.selectMailLabel.id),!e.isString(e.inboxItem)),e.isString(e.inboxItem)||e.inboxItem.mailHead.isUnread?"unread-item":"read-item"],style:{height:!e.isSplitView||e.isString(e.inboxItem)?"40px":"80px"},attrs:{draggable:e.isDraggable,tabindex:"0"},on:{drag:e.throttledHandleDrag,dragstart:e.handleDragStart,dragend:e.handleDragEnd,focusin:e.handleFocusIn,focusout:e.handleFocusOut,keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])||t.target!==t.currentTarget?null:(t.preventDefault(),e.getDetail.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")||t.target!==t.currentTarget?null:(t.preventDefault(),e.getDetail.apply(null,arguments))}],contextmenu:function(t){return t.preventDefault(),e.onContextMenu(t,e.inboxItem)}}},[e.isString(e.inboxItem)?t("div",{staticClass:"inbox-item-title",attrs:{tabindex:"-1"}},[e._v(" "+e._s(e.CATEGORY_DATE_FORMAT_MAP_DISPLAYNAME[e.inboxItem.value])+" ")]):t("div",{staticClass:"inbox-item-regular",attrs:{tabindex:"-1"}},[t("div",{staticClass:"inbox-item-status"},[t("SvgIcon",{directives:[{name:"show",rawName:"v-show",value:e.attachmentWithError&&!e.starHover,expression:"attachmentWithError && !starHover"}],class:["alert-icon",{"split-view-last-selected":e.splitViewSelected,read:!e.inboxItem.mailHead.isUnread}],attrs:{iconClass:"triangle-alert"}}),e.checkboxVisible?t("zm-checkbox-group",{directives:[{name:"show",rawName:"v-show",value:!e.attachmentWithError||e.starHover,expression:"!attachmentWithError || starHover"}],ref:"checkboxGroup",attrs:{"aria-label":"","zm-ta":"inbox-item-checkbox-"+e.inboxItem.mailId,tabindex:"-1"},on:{change:e.handleCheckedItemsChange},model:{value:e.checkedList,callback:function(t){e.checkedList=t},expression:"checkedList"}},[t("zm-checkbox",{ref:"checkbox",class:[{"split-view-last-selected":e.splitViewSelected}],attrs:{id:e.inboxItem.mailId,label:e.inboxItem.mailId,"aria-label":e.$t("accessibility.select"),tabindex:e.hasFocusWithin?"0":"-1"}},[e._v("   ")])],1):e.escrowActionsDisabled?t("div",{staticClass:"escrow-outlined"},[t("svg-icon",{class:[{"split-view-last-selected":e.splitViewSelected}],attrs:{iconClass:"escrow"}})],1):e._e()],1),t("div",{class:["inbox-item-content",{"display-unset":e.isSplitView,"inbox-item-content-group":e.inboxItem.labelId===e.groupLabel}],style:e.getCursorStyle,attrs:{role:"button"},on:{click:function(t){return t.preventDefault(),e.getDetail.apply(null,arguments)}}},[t("div",{class:["inbox-item-left",e.isString(e.inboxItem)||e.inboxItem.mailHead.isUnread?"unread-item":"read-item",{"split-view":e.isSplitView,"split-view-last-selected":e.splitViewSelected}]},[t("div",{staticClass:"inbox-item-left-header"},[t("i",{directives:[{name:"show",rawName:"v-show",value:e.iconVisible.loading,expression:"iconVisible.loading"}],staticClass:"zm-icon-loading small"}),t("zm-tooltip",{directives:[{name:"show",rawName:"v-show",value:e.iconVisible.important,expression:"iconVisible.important"}],attrs:{content:e.inboxItem.mailHead.isImportant?e.$t("operation.markAsUnImportant"):e.$t("operation.markAsImportant"),placement:"bottom",enterable:!1}},[t("SvgIcon",{ref:"markImportantOrUnImportantRef",class:["tab-focus","inbox-item-important",{"split-view-last-selected":e.splitViewSelected}],attrs:{iconClass:e.inboxItem.mailHead.isImportant?"important-colored":"important",tabindex:"0","zm-ta":"inbox-item-"+(e.inboxItem.mailHead.isImportant?"remove-important":"important")+"-"+e.inboxItem.mailId,role:"button","aria-label":e.inboxItem.mailHead.isImportant?e.$t("operation.markAsUnImportant"):e.$t("operation.markAsImportant")},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.handleMark(e.inboxItem,e.inboxItem.mailHead.isImportant?"UnImportant":"Important","click")},keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.stopPropagation(),t.preventDefault(),e.handleMark(e.inboxItem,e.inboxItem.mailHead.isImportant?"UnImportant":"Important"))}}})],1),t("zm-tooltip",{directives:[{name:"show",rawName:"v-show",value:e.iconVisible.star,expression:"iconVisible.star"}],attrs:{content:e.inboxItem.mailHead.isStarred?e.$t("operation.markAsUnstarred"):e.$t("operation.markAsStarred"),placement:"bottom",enterable:!1}},[t("svg-icon",{ref:"markStarOrUnstar",class:["tab-focus",{"empty-star":!e.inboxItem.mailHead.isStarred&&(e.starHover||e.hasFocusWithin),"split-view-last-selected":e.splitViewSelected}],attrs:{iconClass:e.inboxItem.mailHead.isStarred?"starred-colored":"starred","zm-ta":"inbox-item-"+(e.inboxItem.mailHead.isStarred?"remove-star":"star")+"-"+e.inboxItem.mailId,role:"button","aria-label":e.inboxItem.mailHead.isStarred?e.$t("operation.markAsUnstarred"):e.$t("operation.markAsStarred"),"aria-expanded":void 0,tabindex:e.starHover||e.hasFocusWithin?"0":"-1"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.handleMark(e.inboxItem,e.inboxItem.mailHead.isStarred?"UnStarred":"Starred","click")},keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.stopPropagation(),t.preventDefault(),e.handleMark(e.inboxItem,e.inboxItem.mailHead.isStarred?"UnStarred":"Starred"))}}})],1),t("Avatar",{directives:[{name:"show",rawName:"v-show",value:e.iconVisible.avatar,expression:"iconVisible.avatar"}],staticClass:"head-img",attrs:{email:e.getInboxItemFirstEmail,name:e.getInboxItemFirstName,tabindex:"-1"}}),t("svg-icon",{directives:[{name:"show",rawName:"v-show",value:e.iconVisible.draft,expression:"iconVisible.draft"}],staticClass:"draft-icon",attrs:{iconClass:"draft-filled"}})],1),t("div",{class:["inbox-item-left-name","much-hidden",{"split-view-last-selected":e.splitViewSelected}],attrs:{"zm-ta":"inbox-item-left-name-"+e.inboxItem.mailId}},["SENT"===e.selectedMailLabel.id?t("span",[e._v(" "+e._s(e.$t("list.sentTo"))+" ")]):e._e(),"SENT"!==e.selectedMailLabel.id||e.isConversationView?e._l(e.inboxItem.mailHead.userEmailStatusList,(function(i,n){return t("span",{key:n,style:{color:i.isDraft?"#E8173D":"",fontWeight:i.isUnread?"var(--text-bold)":"var(--text-normal)"}},e._l(e.senderInSearch(i.userEmail.displayName),(function(i,a){return t("span",{key:a},[i.searchTerm?t("span",{class:["highlight",{"split-view-last-selected":e.splitViewSelected}]},[e._v(" "+e._s(i.searchTerm)+" ")]):t("span",{class:["unhighlight",{"split-view-last-selected":e.splitViewSelected}]},[e._v(" "+e._s(i)+" ")]),t("span",{class:["unhighlight",{"split-view-last-selected":e.splitViewSelected}],style:{color:e.splitViewSelected?"var(--inbox-item-split-selected)":"var(--text-secondary)"}},[e._v(" "+e._s(n!==e.inboxItem.mailHead.userEmailStatusList.length-1?", ":"")+" ")])])})),0)})):e._l(e.inboxItem.mailHead.to,(function(i,n){return t("span",{key:n,style:{color:e.inboxItem.mailHead.isDraft?"#E8173D":"",fontWeight:e.inboxItem.mailHead.isUnread?"var(--text-bold)":"var(--text-normal)"}},e._l(e.senderInSearch(i.displayName),(function(i,a){return t("span",{key:a},[i.searchTerm?t("span",{class:["highlight",{"split-view-last-selected":e.splitViewSelected}]},[e._v(" "+e._s(i.searchTerm)+" ")]):t("span",{class:["unhighlight",{"split-view-last-selected":e.splitViewSelected}]},[e._v(" "+e._s(i)+" ")]),t("span",{class:["unhighlight",{"split-view-last-selected":e.splitViewSelected}],style:{color:e.splitViewSelected?"var(--inbox-item-split-selected)":"var(--text-secondary)"}},[e._v(" "+e._s(n!==e.inboxItem.mailHead.to.length-1?", ":"")+" ")])])})),0)}))],2),e.showMessageCount?t("div",{class:["inbox-item-left-num",{"split-view-last-selected":e.splitViewSelected}]},[e._v(" ("+e._s(e.getDisplayMessageCount())+") ")]):e._e()]),t("div",{staticClass:"inbox-item-right"},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.lastReadValid&&!e.isSplitView,expression:"lastReadValid && !isSplitView"}],staticClass:"inbox-item-last-read"},[e._v(" "+e._s(e.$t("list.lastRead"))+" ")]),t("div",{class:["content",{"display-unset":e.isSplitView}]},[!e.hasQuarantinedMsg||e.isSplitView||e.isOutlook?e._e():t("zm-tooltip",{key:"QUARANTINED",attrs:{"append-to-body":!0,placement:"top",content:e.quarantinedInfo.tip}},[t("span",{staticClass:"quarantined-mark"},[e._v(" "+e._s(e.$t("compliance.quarantined"))+" ")])]),e.isSplitView||e.isOutlook?e._e():t("LabelFlagsList",{attrs:{labels:e.labels,maxNumVisible:3}}),e.isLocalSearch(e.selectMailLabel.id)&&e.inboxItem.mailHead.subject?t("div",{class:["content-subject",!e.isString(e.inboxItem)&&e.inboxItem.mailHead.isUnread?"noRead":"",{"split-view-last-selected":e.splitViewSelected}]},e._l(e.subjectInSearch,(function(i,n){return t("span",{key:n},[i.searchTerm?t("span",{staticClass:"highlight"},[e._v(" "+e._s(i.searchTerm)+" ")]):t("span",{staticClass:"unhighlight",attrs:{"zm-ta":"inbox-item-content-subject-"+e.inboxItem.mailId}},[e._v(e._s(i))])])})),0):t("div",{class:["content-subject",!e.isString(e.inboxItem)&&e.inboxItem.mailHead.isUnread?"noRead":"",{"split-view-last-selected":e.splitViewSelected}],attrs:{"zm-ta":"inbox-item-content-subject-"+e.inboxItem.mailId}},[e._v(" "+e._s(e.renamedSubject||(e.inboxItem.mailHead.subject?e.inboxItem.mailHead.subject:e.$t("detail.noSubject")))+" ")]),t("div",{class:["content-snippet-wrap"]},[e.hasQuarantinedMsg&&e.isSplitView?t("zm-tooltip",{key:"QUARANTINED",attrs:{"append-to-body":!0,placement:"top",content:e.quarantinedInfo.tip}},[t("span",{staticClass:"quarantined-mark"},[e._v(" "+e._s(e.$t("compliance.quarantined"))+" ")])]):e._e(),e.isSplitView&&!e.isOutlook?t("LabelFlagsList",{attrs:{labels:e.labels,maxNumVisible:1}}):e._e(),e.isLocalSearch(e.selectMailLabel.id)&&!e.escrowActionsDisabled?t("div",{class:["content-snippet",{"split-view-last-selected":e.splitViewSelected}],attrs:{"zm-ta":"inbox-item-content-snippet-"+e.inboxItem.mailId}},e._l(e.snippetInSearch,(function(i,n){return t("span",{key:n},[i.searchTerm?t("span",{class:["highlight",{"split-view-last-selected":e.splitViewSelected}]},[e._v(" "+e._s(i.searchTerm)+" ")]):t("span",{class:["unhighlight",{"split-view-last-selected":e.splitViewSelected}]},[e._v(" "+e._s(e.cleanSnippet(i))+" ")])])})),0):e.escrowActionsDisabled?e._e():t("div",{class:["content-snippet",{"split-view-last-selected":e.splitViewSelected}],attrs:{"zm-ta":"inbox-item-content-snippet-"+e.inboxItem.mailId}},[e._v(" "+e._s(e.quarantinedInfo.snippet||e.cleanSnippet(e.inboxItem.mailHead.snippet))+" ")])],1)],1),t("div",{staticClass:"extras"},[t("Timestamp",{staticClass:"timestamp",style:e.getTimestampStyle,attrs:{"zm-ta":"inbox-item-timestamp-"+e.inboxItem.mailId,inboxItem:e.inboxItem,splitViewSelected:e.splitViewSelected}}),t("ActionButtons",{ref:"actionButtons",staticClass:"action-buttons",style:e.getActionButtonsStyle,attrs:{item:e.inboxItem,splitViewSelected:e.splitViewSelected,visibleActions:e.visibleActions,moreMenuActions:e.moreMenuActions},on:{moreMenuVisibleChange:e.onMoreMenuVisibleChange,handleInboxItemFocus:e.handleInboxItemFocus,updateActionButtonVisible:e.updateActionButtonVisible}})],1)])])])])},At=[],Rt=(i(96920),i(17368),i(24471),function(){var e,t=this,i=t._self._c;return i("div",{staticClass:"item-action-wrap"},[t._l(t.visibleActions,(function(e){return i("span",{key:e.id,staticClass:"action-button-wrap"},[i("zm-tooltip",{attrs:{content:e.label,placement:e.tooltipPlacement||"bottom",enterable:!1,disabled:t.isThreadExist,tabindex:"0"}},[e.iconClass?i("svg-icon",{attrs:{iconClass:e.iconClass,className:"label-btn-icon tab-focus",role:"button","aria-label":e.label,"aria-expanded":void 0,"zm-ta":e.zmTa},on:{click:function(i){return i.stopPropagation(),i.preventDefault(),e["do"](t.item)},keydown:[function(i){return!i.type.indexOf("key")&&t._k(i.keyCode,"space",32,i.key,[" ","Spacebar"])?null:(i.stopPropagation(),i.preventDefault(),t.handleActionByTab(e,t.item))},function(i){return!i.type.indexOf("key")&&t._k(i.keyCode,"enter",13,i.key,"Enter")?null:(i.stopPropagation(),i.preventDefault(),t.handleActionByTab(e,t.item))}]}}):i("zm-button",{attrs:{size:"mini","zm-ta":e.zmTa,"aria-expanded":void 0},on:{click:function(i){return i.stopPropagation(),i.preventDefault(),e["do"](t.item)}}},[t._v(" "+t._s(e.label)+" ")])],1)],1)})),t.moreMenuActions.length?i("zm-dropdown",{ref:"moreMenu",staticClass:"action-button-wrap",attrs:{placement:"bottom-start"},on:{command:t.onMoreMenuCommand,"visible-change":t.onMoreMenuVisibleChange}},[i("span",{staticClass:"inbox-item-more-menu-btn tab-focus",attrs:{tabindex:"0","zm-ta":"inbox-item-more-menu-".concat(null===(e=t.item)||void 0===e?void 0:e.mailId),"aria-label":t.$t("common.moreOptions")}},[i("svg-icon",{attrs:{iconClass:"more-horizontal"}})],1),i("zm-dropdown-menu",{staticClass:"inbox-item-more-menu-dropdown",attrs:{slot:"dropdown"},slot:"dropdown"},t._l(t.moreMenuActions,(function(e){return i("zm-dropdown-item",{key:e.id,attrs:{"zm-ta":e.zmTa,divided:e.divided,command:e["do"]}},[t._v(t._s(e.label))])})),1)],1):t._e()],2)}),Zt=[],Ot=i(85796),zt={components:{},props:{item:{type:[Object,String]},visibleActions:{type:Array,default:function(){return[]}},moreMenuActions:{type:Array,default:function(){return[]}}},computed:{mailHead:function(){return this.$store.state.mailHead[this.currentLabelId]||{}},isThreadExist:function(){var e;return this.mailHead[null===(e=this.item)||void 0===e?void 0:e.mailId]},moreMenuRef:function(){return this.$refs.moreMenu}},mounted:function(){var e;null===(e=this.moreMenuRef)||void 0===e||e.$on("menu-list-keydown",this.handleMoreDropdownMenuKeyDown)},methods:{handleActionByTab:function(e,t){e["do"](t),e.id!==Ot.s4.DELETE&&e.id!==Ot.s4.ARCHIVE||this.$emit("handleInboxItemFocus")},onMoreMenuCommand:function(e){"function"===typeof e&&e(this.item)},onMoreMenuVisibleChange:function(e){this.$emit("moreMenuVisibleChange",e),this.$emit("updateActionButtonVisible",e)},handleMoreDropdownMenuKeyDown:function(e){var t=this;["Escape","Enter","Tab"].includes(e.key)&&this.$nextTick((function(){var e,i,n;t.$emit("updateActionButtonVisible",!0);var a=(null===(e=t.moreMenuRef)||void 0===e||null===(i=e.trigger)||void 0===i?void 0:i.$el)||(null===(n=t.moreMenuRef)||void 0===n?void 0:n.$slots["default"][0].elm);t.$nextTick((function(){a.focus()}))}))}}},Nt=zt,Pt=(0,E.Z)(Nt,Rt,Zt,!1,null,"f1e3b394",null),Ft=Pt.exports,Vt=function(){var e=this,t=e._self._c;return t("div",{class:["timestamp-icon-wrap",e.splitViewSelected&&"split-view-last-selected"]},[e.inboxItem.mailHead.hasAttachment?t("svg-icon",{class:["attachment-icon",e.isRead&&"read"],attrs:{"zm-ta":"inbox-item-attachment-"+e.inboxItem.mailId,iconClass:e.includeCalendarEvent?"calendar-event":"clip"}}):e._e(),e.isScheduledEmail?t("svg-icon",{class:["scheduled-time-icon"],attrs:{iconClass:"scheduled","zm-ta":"inbox-item-scheduled-"+e.inboxItem.mailId}}):e._e(),e.isSnoozed?t("svg-icon",{class:["snooze-time-icon"],attrs:{iconClass:"snooze-fill","zm-ta":"inbox-item-snooze-"+e.inboxItem.mailId}}):e._e(),t("div",{class:["timestamp",!e.isRead&&"timestamp__unread",e.isScheduledEmail&&"scheduled-time",e.splitViewSelected&&"split-view-last-selected",e.isSnoozed&&"snooze-time"]},[e._v(" "+e._s(e.isSnoozed?e.getSnoozeFormat():e.formatTime(e.inboxItem.mailHead.date))+" ")])],1)},Ht=[],Bt=i(79337),Ut=d.Utils.Time,jt={props:{splitViewSelected:{type:Boolean,default:!1},inboxItem:{type:[Object,String]}},computed:{includeCalendarEvent:function(){var e,t;return"None"!==(null===(e=this.inboxItem)||void 0===e||null===(t=e.mailHead)||void 0===t?void 0:t.calendarType)},isScheduledEmail:function(){return this.inboxItem.labelId===d.Enums.SystemDefinedMailLabelIds.USER_SCHEDULED},isRead:function(){var e,t;return!(null!==(e=this.inboxItem)&&void 0!==e&&null!==(t=e.mailHead)&&void 0!==t&&t.isUnread)},snoozedTime:function(e){var t=e.inboxItem;return t.mailHead.snoozeInfo?1e3*t.mailHead.snoozeInfo.notifyTime:null},isSnoozed:function(){return!!this.snoozedTime},isInToday:function(){return Ut.isInSameDay(Bt.ou.fromMillis(this.snoozedTime))},isInSameWeek:function(){return Ut.isInSameWeek(Bt.ou.fromMillis(this.snoozedTime))}},methods:{formatTime:function(e){if("undefined"!==typeof e){var t,i=1e3*e,n={Upcoming:"LLL d",Today:"t","This Month":"LLL d","This Year":"LLL d"},a=(0,_t.Gt)(i),s=new Date(i).getTime(),r=new Date(Date.now()).getTime(),o=Bt.ou.fromMillis(i).hasSame(Bt.ou.now(),"day");return t="Upcoming"===a&&s>r&&o?"t":n[a]||"L/d/kk",Bt.ou.fromMillis(i).setZone(this.userTimeZone).toFormat(t)}return this.$t("time.notValidTime")},getSnoozeFormat:function(){return this.isInToday?Bt.ou.fromMillis(this.snoozedTime).toFormat("t"):this.isInSameWeek?Bt.ou.fromMillis(this.snoozedTime).toFormat("ccc t"):Bt.ou.fromMillis(this.snoozedTime).toFormat("ff")}}},Wt=jt,Kt=(0,E.Z)(Wt,Vt,Ht,!1,null,"9a34ca68",null),Yt=Kt.exports,Xt=i(60258),Gt=i(90479),qt=i(71951),Jt=i(38017),Qt=i(6800),ei=d.Business.getListItemActions,ti=d.Business.labelUtils,ii=d.Enums.SystemDefinedMailLabelIds,ni=d.Enums.BAN_ACTION_MENU_LABELS,ai=[Ot.s4.SCHEDULE_MEETING,Ot.s4.HIDE_FROM_DELEGATES,Ot.s4.SHOW_TO_DELEGATES,Ot.s4.RENAME_SUBJECT,Ot.s4.REPLY_LATER,Ot.s4.POPOUT_DETAIL],si={components:{SvgIcon:I.Z,LabelFlagsList:Xt.Z,Avatar:Gt.Z,ActionButtons:Ft,Timestamp:Yt},props:{isLoadingDetail:{type:Boolean,default:!1},inboxItem:{type:[Object,String]},hideDropDownMenu:{type:Boolean,default:!1}},data:function(){return{checkedList:[],attachments:[],starHover:!1,hasFocusWithin:!1,CATEGORY_DATE_FORMAT_MAP_DISPLAYNAME:qt.Di,actionButtonVisible:!1,moreMenuDropdownVisible:!1,originalScreenX:0,originalScreenY:0,originalClientX:0,originalClientY:0,scaleClassMap:{.8:"scale-xs",1:"",1.2:"scale-lg",1.25:"scale-125",1.5:"scale-xl",1.8:"scale-2xl",2:"scale-3xl"}}},computed:(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)(["allLabels","typeOfEmail","userProfile","selectMailLabel","scaleRatio","isSplitView","splitViewSelectedMails","draggedEmails","dragCursorStyle","mailHead","selectMailLabel","selectPrevLabel"])),(0,h.Se)(["userLabelIdToLabel"])),(0,h.rn)({isCalendarEnabled:function(e){return e.userProfile.isCalendarEnabled||!1},isDelegated:function(e){return e.userProfile.isDelegated},selectedMailLabel:function(e){return e.selectMailLabel}})),(0,h.rn)("inbox",["lastReadInboxMailId","isConversationView"])),(0,h.rn)("mail",["replyLaterLabelMailHeads"])),(0,h.Se)(["isOutlook","isGmail","isZmail"])),(0,h.Se)("inbox",["selectedInboxMailIds"])),(0,h.Se)("inbox",["isImportantEnabled"])),(0,h.Se)("delegate",{delegates:"getDelegateList"})),(0,h.Se)("mail",["getRenamedNameByThreadId"])),(0,h.Se)("features",["enableRenameSubject","allowMarkAsRead","enableReplyLater"])),(0,h.rn)("search",["inSearching","inFilters","searchString","searchFiltersOptions"])),(0,h.Se)("delegate",{delegates:"getDelegateList"})),(0,h.Se)("delegate",["permissionRole"])),{},{threadOperationPermission:function(e){var t=e.permissionRole;return(0,c.yz)(t,c.Vn.THREAD_OPERATION)},isDraggable:function(){return![ii.PRIVATE,ii.GROUP_APPROVAL,ii.ESCROW,ii.OUTBOX,ii.USER_SCHEDULED,ii.DRAFT].includes(this.selectMailLabel.id)&&!this.isString(this.inboxItem)},scaleClass:function(){return this.scaleClassMap[this.scaleRatio]?this.scaleClassMap[this.scaleRatio]:""},isMarkedReplyLater:function(){var e=this;return this.replyLaterLabelMailHeads.some((function(t){return t.mailId===e.inboxItem.mailId}))},getTimestampStyle:function(e){var t=e.threadOperationPermission;return t?this.visibleActions.length<1?{display:"flex"}:this.actionButtonVisible?{display:"none"}:{}:{display:"flex"}},getActionButtonsStyle:function(e){var t=e.threadOperationPermission;return t?this.visibleActions.length<1?{display:"none"}:this.actionButtonVisible?{display:"flex"}:{}:{display:"none"}},getCursorStyle:function(){return this.draggedEmails.length>0?{cursor:this.dragCursorStyle}:{}},includedInDragSelection:function(){return this.draggedEmails.includes(this.inboxItem.mailId)},splitViewSelected:function(){var e;return!(!this.$store.state.isSplitView||!this.$store.state.splitViewSelectedMails)&&(this.isSplitView&&this.inboxItem.mailId&&(null===(e=this.$store.state.splitViewSelectedMails[this.$store.state.selectMailLabel.id])||void 0===e?void 0:e.mailId)===this.inboxItem.mailId)},searchTermObj:function(){return(0,_t.gE)(this.searchString)},senderInSearch:function(){var e=this;return this.searchString?function(t){return"[Draft]"===t||t.includes("Drafts]")?[t]:(0,_t._k)(t,[].concat((0,f.Z)(e.searchTermObj["default"]),(0,f.Z)(e.searchTermObj.from)))}:function(e){return[e]}},subjectInSearch:function(){var e,t,i,n,a=this.inboxItem.mailId,s=this.getRenamedNameByThreadId(a);return null!==(e=this.inboxItem)&&void 0!==e&&null!==(t=e.mailHead)&&void 0!==t&&t.subject?(0,_t._k)(s||this.inboxItem.mailHead.subject,[].concat((0,f.Z)(this.searchTermObj["default"]),(0,f.Z)(this.searchTermObj.subject))):[null===(i=this.inboxItem)||void 0===i||null===(n=i.mailHead)||void 0===n?void 0:n.subject]},snippetInSearch:function(){var e,t,i,n;return null!==(e=this.inboxItem)&&void 0!==e&&null!==(t=e.mailHead)&&void 0!==t&&t.snippet?(0,_t._k)(this.inboxItem.mailHead.snippet,this.searchTermObj["default"]):[null===(i=this.inboxItem)||void 0===i||null===(n=i.mailHead)||void 0===n?void 0:n.snippet]},labels:function(){var e,t=this;return(null===(e=this.inboxItem.mailHead.showLabelIds)||void 0===e?void 0:e.filter((function(e){return t.userLabelIdToLabel.has(e)||(0,_t["in"])(e)})))||[]},getInboxItemFirstName:function(){var e=this.inboxItem.mailHead.userEmailStatusList.filter((function(e){return!/^\[(\d+ Drafts|Draft)\]$/.test(e.userEmail.displayName)}));return e.length>0?e[0].userEmail.displayName.toUpperCase():""},getInboxItemFirstEmail:function(){var e=this.inboxItem.mailHead.userEmailStatusList.filter((function(e){return"[Draft]"!==e.userEmail.displayName}));return e.length>0?e[0].userEmail.emailAddr:""},userTimeZone:function(e){var t=e.userProfile;return t.userTimeZone},archiveStatus:function(){var e;return(0,_t.XP)(null===(e=this.inboxItem)||void 0===e?void 0:e.labelId)},lastReadValid:function(){return this.lastReadInboxMailId===this.inboxItem.mailId&&"DRAFT"!==this.inboxItem.labelId&&"OUTBOX"!==this.inboxItem.labelId},canMoveToInbox:function(){var e=[ii.INBOX,ii.SPAM,ii.DRAFT];return!e.includes(this.inboxItem.labelId)&&!this.labels.includes(ii.INBOX)},attachmentWithError:function(e){var t,i=e.inboxItem,n=["DRAFT"],a=n.indexOf(i.labelId)>-1,s=this.checkedList.indexOf(i.mailId)>-1,r=null===(t=i.mailHead.attachmentList)||void 0===t?void 0:t.some((function(e){return"Error"===e.downloadStatus}));return a&&r&&!s},isSelected:function(){return this.selectedInboxMailIds.includes(this.inboxItem.mailId)},escrowLabel:function(){return d.Enums.SystemDefinedMailLabelIds.ESCROW},groupLabel:function(){return d.Enums.SystemDefinedMailLabelIds.GROUP_APPROVAL},isSelectedTrashLabel:function(){return this.selectMailLabel.id===ii.TRASH},escrowActionsDisabled:function(e){var t=e.escrowLabel;return this.disableActions(t)},showToDelegateDisabled:function(){var e;return!!this.isDelegated||this.inboxItem.labelId!==ii.PRIVATE&&!(null!==(e=this.inboxItem.mailHead)&&void 0!==e&&e.showLabelIds.includes(ii.PRIVATE))},showMessageCount:function(){var e=this.inboxItem.msgIds&&this.inboxItem.msgIds.length>1;return this.isOutlook?e&&this.inboxItem.mailHead.unreadMsgCnt:e},iconVisible:function(e){var t=e.inboxItem,i=e.isLoadingDetail,n=e.isSplitView,a=e.isOutlook,s=e.starHover,r=e.hasFocusWithin,o=e.isNoActionFolder,l=e.hasHideActionMenuLabel,c=e.getInboxItemFirstEmail,d=e.getInboxItemFirstName,u=t.labelId!==ii.OUTBOX&&i&&!n,h=(t.mailHead.isStarred||s||r)&&!o(t.labelId)&&!l(t),m=c&&d;return{important:(!this.isZmail||this.isImportantEnabled)&&!u&&!a&&!o(t.labelId),loading:u,star:!u&&h,avatar:!u&&!h&&m,draft:!u&&!h&&!m}},currentFilterLabel:function(){var e;return(null===(e=this.selectMailLabel)||void 0===e?void 0:e.id)!==ii.SEARCH?this.selectMailLabel:this.selectPrevLabel||{id:ii.INBOX,isSystem:!0}},allowArchive:function(e){var t,i=e.inboxItem,n=e.isGmail,a=e.inFilters,s=e.inSearching,r=e.currentFilterLabel,o=e.searchFiltersOptions,l=!0,c=null===(t=i.mailHead.allLabelIds)||void 0===t?void 0:t.includes(ii.INBOX);if(n)l=c;else{var d=!0;a&&(d=r.id!==ii.ARCHIVE),s&&(d=o.inLabelId!==ii.ARCHIVE),l=(0,_t.XP)(null===i||void 0===i?void 0:i.labelId)&&c&&d}return l},actionConfigMap:function(e){var t,i,n,a,o,l,c,u=this,h=e.allowArchive,m=(c={},(0,wt.Z)(c,Ot.s4.MOVE_TO_INBOX,{label:this.$t("operation.moveToInbox"),iconClass:"move-to-inbox",zmTa:"inbox-item-move-to-inbox-".concat(this.inboxItem.mailId),disabled:this.labels.includes(ii.INBOX),do:this.handleMove}),(0,wt.Z)(c,Ot.s4.DELETE,{label:this.$t("operation.delete"),iconClass:"delete",zmTa:"inbox-item-delete-".concat(this.inboxItem.mailId),do:this.handleDelete}),(0,wt.Z)(c,Ot.s4.DELETE_FOREVER,{label:this.$t("operation.deleteForever"),iconClass:"delete",zmTa:"inbox-item-delete-forever-".concat(this.inboxItem.mailId),do:this.handleDeleteForever}),(0,wt.Z)(c,Ot.s4.ARCHIVE,{label:this.$t("operation.archive"),iconClass:"archive",zmTa:"inbox-item-archive-".concat(this.inboxItem.mailId),disabled:!h,do:this.handleArchive}),(0,wt.Z)(c,Ot.s4.UNREAD,{label:this.inboxItem.mailHead.isUnread?this.$t("operation.markAsRead"):this.$t("operation.markAsUnread"),iconClass:this.inboxItem.mailHead.isUnread?"read":"unread",zmTa:"inbox-item-".concat(this.inboxItem.mailHead.isUnread?"mark-as-read":"mark-as-unread","-").concat(this.inboxItem.mailId),do:function(){var e=u.inboxItem.mailHead.isUnread?"Read":"UnRead";u.handleMark(u.inboxItem,e)},disabled:!this.allowMarkAsRead&&this.inboxItem.mailHead.isUnread}),(0,wt.Z)(c,Ot.s4.NOT_SPAM,{label:this.$t("operation.notSpam"),iconClass:"spam",zmTa:"inbox-item-remove-from-spam-".concat(this.inboxItem.mailId),do:this.handleNotSpam}),(0,wt.Z)(c,Ot.s4.SCHEDULE_MEETING,{label:this.$t("operation.scheduleMeeting"),zmTa:"inbox-item-schedule-meeting-".concat(this.inboxItem.mailId),disabled:!this.isCalendarEnabled||!this.inboxItem.msgIds||1!==this.inboxItem.msgIds.length,do:function(){var e=(0,r.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(u.isCalendarEnabled){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,(0,Jt.sv)(u.inboxItem.mailId,u.inboxItem.labelId);case 4:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}()}),(0,wt.Z)(c,Ot.s4.HIDE_FROM_DELEGATES,{label:this.$t("operation.hideFromDelegates"),zmTa:"inbox-item-hide-from-delegates-".concat(this.inboxItem.mailId),disabled:(null===(t=this.inboxItem.mailHead)||void 0===t||null===(i=t.showLabelIds)||void 0===i?void 0:i.includes(ii.PRIVATE))||this.isDelegated,do:function(){(0,Jt.OJ)([u.inboxItem],u.selectMailLabel.id)}}),(0,wt.Z)(c,Ot.s4.SHOW_TO_DELEGATES,{label:this.$t("operation.showToDelegates"),zmTa:"inbox-item-show-to-delegates-".concat(this.inboxItem.mailId),disabled:this.showToDelegateDisabled,do:function(){(0,Jt.b_)([u.inboxItem],u.selectMailLabel.id)}}),(0,wt.Z)(c,Ot.s4.CANCEL_SEND,{label:this.$t("operation.cancelScheduled"),zmTa:"inbox-item-cancel-schedule-send-".concat(this.inboxItem.mailId),do:this.cancelScheduledSend}),(0,wt.Z)(c,Ot.s4.DISCARD_DRAFT,{label:this.$t("operation.discardDraft"),zmTa:"inbox-item-discard-drafts-".concat(this.inboxItem.mailId),do:this.discardDraft}),(0,wt.Z)(c,Ot.s4.RENAME_SUBJECT,{label:this.$t("operation.renameSubject"),zmTa:"inbox-item-rename-subject-".concat(this.inboxItem.mailId),do:this.renameSubject,disabled:this.selectMailLabel.id===ii.USER_SCHEDULED||this.selectMailLabel.id===ii.OUTBOX||!this.enableRenameSubject||!d.Utils.isDecrypted(null===(n=this.inboxItem)||void 0===n||null===(a=n.mailHead)||void 0===a?void 0:a.decryptionStatus)||!this.isConversationView}),(0,wt.Z)(c,Ot.s4.REPLY_LATER,{label:this.isMarkedReplyLater?this.$t("operation.removeReplyLater"):this.$t("operation.replyLater"),zmTa:"inbox-item-".concat(this.isMarkedReplyLater?"remove-":"","reply-later-").concat(this.inboxItem.mailId),do:this.isMarkedReplyLater?this.removeReplyLater:this.replyLater,disabled:!this.enableReplyLater||!d.Utils.isDecrypted(null===(o=this.inboxItem)||void 0===o||null===(l=o.mailHead)||void 0===l?void 0:l.decryptionStatus)}),(0,wt.Z)(c,Ot.s4.POPOUT_DETAIL,{label:this.$t("operation.openInNewWindow"),zmTa:"inbox-item-popout-detail",do:this.popoutDetail,disabled:!1}),c);return m},actions:function(e){var t,i,n=this,a=e.inboxItem;this.hasHideActionMenuLabel(a)?t=ei(this.typeOfEmail,{id:null===a||void 0===a||null===(i=a.mailHead)||void 0===i?void 0:i.showLabelIds[0],isSystem:!0}):t=ei(this.typeOfEmail,this.selectMailLabel);return t.map((function(e){var t=n.actionConfigMap[e]||{label:n.$t("common.unknown"),do:function(){}};return(0,l.Z)((0,l.Z)({},t),{},{id:e})})).filter((function(e){var t=e.disabled;return!t}))},visibleActions:function(){return this.actions.filter((function(e){return!ai.includes(e.id)&&!e.disabled}))},moreMenuActions:function(){var e=this.actions.filter((function(e){return ai.includes(e.id)&&!e.disabled})),t=[],i=[];return e.forEach((function(e){[Ot.s4.SCHEDULE_MEETING].includes(e.id)?t.push(e):i.push(e)})),t.length>0&&i.length>0&&(i[0].divided=!0),t.concat(i)},renamedSubject:function(e){var t=e.inboxItem,i=e.getRenamedNameByThreadId;return i(t.mailId)},checkboxVisible:function(){return(0,Qt.w)(this.inboxItem)},hasQuarantinedMsg:function(e){var t=e.inboxItem;return ti.hasQuarantinedMsg(t)},quarantinedInfo:function(e){var t=e.inboxItem,i=ti.getQuarantinedInfo(t),n=i.count,a=i.quarantinedMsgIds,s="",r="";if(n>0){var o=t.msgIds,l=1===o.length;if(l&&1===n)return s=this.$t("compliance.theEmailIsQuarantinedTip"),{tip:s,snippet:this.$t("compliance.noticeTitle")};var c=a.includes(o[0]);if(!l)return c&&1===n?{tip:this.$t("compliance.emailsAreQuarantinedTip",[n]),snippet:this.$t("compliance.anEmailIsQuarantinedSnippet")}:{tip:this.$t("compliance.emailsAreQuarantinedTip",[n]),snippet:this.$t("compliance.emailsAreQuarantinedTip",[n])}}return{tip:s,snippet:r}}}),watch:{hideDropDownMenu:function(e){e&&this.hideMoreMenu()},scaleRadio:function(e){this.$refs.inboxItem.style.zoom="".concat(100*e,"%")},selectedInboxMailIds:function(e){this.checkedList=e},splitViewSelected:{handler:function(e){var t=this;e&&this.$nextTick((function(){var e=document.getElementById("virtual-container");if(t.$el&&e){var i=d.Utils.checkInContainer(t.$el,e);!i&&t.$el.scrollIntoView({behavior:"smooth",block:"center"})}}))},immediate:!0}},created:function(){this.checkedList=this.selectedInboxMailIds||[],this.throttledHandleDrag=Mt().throttle(this.handleDrag,10)},mounted:function(){!this.isString(this.inboxItem)&&this.$refs.checkbox&&this.$refs.checkbox.$el.addEventListener("mouseup",this.checkboxSelect),!this.isString(this.inboxItem)&&this.$refs.inboxItem&&(this.$refs.inboxItem.addEventListener("mouseenter",this.starredHover),this.$refs.inboxItem.addEventListener("mouseleave",this.starredUnhover))},beforeDestroy:function(){!this.isString(this.inboxItem)&&this.$refs.checkbox&&this.$refs.checkbox.$el.removeEventListener("mouseup",this.checkboxSelect),!this.isString(this.inboxItem)&&this.$refs.inboxItem&&(this.$refs.inboxItem.removeEventListener("mouseenter",this.starredHover),this.$refs.inboxItem.removeEventListener("mouseleave",this.starredUnhover))},methods:(0,l.Z)((0,l.Z)({},(0,h.OI)({setDraggedEmails:"setDraggedEmails",setDragImageCoords:"setDragImageCoords",setDragType:"setDragType",setDragCursorStyle:"setDragCursorStyle"})),{},{handleInboxItemFocus:function(){this.$emit("handleInboxItemFocus")},disableActions:function(e){var t;return e===this.inboxItem.labelId||(null===(t=this.inboxItem.mailHead.showLabelIds)||void 0===t?void 0:t.includes(e))},handleFocusIn:function(e){var t=this.$refs.inboxItem;(t===e.target||t.contains(e.target))&&(this.actionButtonVisible=!0,this.hasFocusWithin=!0)},handleFocusOut:function(e){var t=this.$refs.inboxItem;t===e.relatedTarget||t.contains(e.relatedTarget)||(!this.moreMenuDropdownVisible&&(this.actionButtonVisible=!1),this.hasFocusWithin=!1)},handleDrag:function(e){var t=e.screenX-this.originalScreenX,i=e.screenY-this.originalScreenY,n=this.originalClientX+t,a=this.originalClientY+i;this.setDragImageCoords([n,a])},handleDragStart:function(e){var t=new Image;if(t.src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",e.dataTransfer.setDragImage(t,0,0),this.threadOperationPermission){var i=this.isSelected?this.selectedInboxMailIds:[this.inboxItem.mailId];if(this.isOutlook){var n=this.mailHead[this.selectMailLabel.id];i=i.filter((function(e){var t=n[e],i=t.mailHead.userEmailStatusList,a=i.some((function(e){var t=e.isDraft;return!t}));return a}))}this.setDragType("messages"),this.setDraggedEmails(i),e.dataTransfer.allowedEffect="move",this.originalScreenX=e.screenX,this.originalScreenY=e.screenY,this.originalClientX=e.clientX,this.originalClientY=e.clientY,this.setDragCursorStyle("grab")}},handleDragEnd:function(e){this.setDraggedEmails([]),this.setDragType(""),this.setDragImageCoords([-1,-1]),this.$emit("handleHideActions")},checkboxSelect:function(e){var t=this;e.shiftKey&&e.preventDefault(),setTimeout((function(){t.$refs.checkbox.$refs.input.blur(),t.$refs.checkboxGroup.$el.blur()}))},onMoreMenuVisibleChange:function(e){this.$emit("moreMenuVisibleChange",e),this.moreMenuDropdownVisible=e},updateActionButtonVisible:function(e){this.actionButtonVisible=e},onMoreMenuCommand:function(e){"function"===typeof e&&e()},starredHover:function(e){this.starHover=!0,this.actionButtonVisible=!0},starredUnhover:function(e){this.starHover=!1,this.moreMenuDropdownVisible||(this.actionButtonVisible=!1)},substringSearch:function(e,t){var i=new Array(e.length).fill("0"),n=/[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/,a=[];t.forEach((function(e){var t=e.split(n);a.push(t)})),a=a.flat(),a.forEach((function(t){var n=(0,f.Z)(e.matchAll(new RegExp(t,"gi"))).map((function(e){return e.index}));n.forEach((function(e){for(var n=e;n<e+t.length;n++)i[n]="1"}))})),i=i.join("").match(/(.)\1*/g);var s=0,r=[];return i.forEach((function(t){"0"===t[0]?r.push(e.slice(s,s+t.length)):r.push({searchTerm:e.slice(s,s+t.length)}),s+=t.length})),r},handleMove:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:t.$emit("handleMove",e);case 1:case"end":return i.stop()}}),i)})))()},handleDelete:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:t.$emit("handleDelete",e);case 1:case"end":return i.stop()}}),i)})))()},handleDeleteForever:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:t.$emit("handleDeleteForever",e);case 1:case"end":return i.stop()}}),i)})))()},handleArchive:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:t.$emit("handleArchive",e);case 1:case"end":return i.stop()}}),i)})))()},handleNotSpam:function(e){this.$emit("handleNotSpam",e)},handleCheckedItemsChange:function(e){console.debug("===> inbox item select",e),this.$emit("handleCheckedItemsChange",{mailId:this.inboxItem.mailId,status:e.length>0})},isString:function(e){return!!e.isPlain},getDetail:function(){this.isString(this.inboxItem)||(this.$emit("showDetail",this.inboxItem),this.$metric.report("inbox_open_item",{labelId:this.inboxItem.labelId,msgId:this.inboxItem.mailId}))},handleHideActions:function(){this.$emit("handleHideActions")},handleShowActions:function(e,t){if(console.debug("inbox item",t),!this.isNoActionFolder(t.labelId)){if(!(0,Qt.w)(t))return this.handleHideActions(),void this.hideMoreMenu();this.hideMoreMenu(),this.$emit("handleShowActions",{e:e,item:t})}},isNoActionFolder:function(e){return ni.includes(e)},hasHideActionMenuLabel:function(e){var t,i;return(null===e||void 0===e?void 0:e.labelId)===qt.v8&&(null===e||void 0===e||null===(t=e.mailHead)||void 0===t||null===(i=t.showLabelIds)||void 0===i?void 0:i.some((function(e){return ni.includes(e)})))},handleMark:function(e,t){var i=arguments,n=this;return(0,r.Z)((0,s.Z)().mark((function a(){var r;return(0,s.Z)().wrap((function(a){while(1)switch(a.prev=a.next){case 0:r=i.length>2&&void 0!==i[2]?i[2]:"",n.$emit("handleMark",{item:e,type:t}),"click"===r&&setTimeout((function(){var e,i;if(["UnStarred","Starred"].includes(t))null===(e=n.$refs.markStarOrUnstar)||void 0===e||null===(i=e.$el)||void 0===i||i.blur();else if(["Read","UnRead"].includes(t))n.$refs.markReadOrUnread.$el.blur();else if(["Important","UnImportant"].includes(t)){var a,s;null===(a=n.$refs.markImportantOrUnImportantRef)||void 0===a||null===(s=a.$el)||void 0===s||s.blur()}}));case 3:case"end":return a.stop()}}),a)})))()},isLocalSearch:function(e){return x.Z.isLocalSearch(e)},filterMailSnippet:function(e){return(0,_t.mM)(e)},cleanSnippet:function(e){return(0,_t.X4)(e)},cancelScheduledSend:function(){this.$emit("handleCancelScheduledSend",[this.inboxItem.mailId])},discardDraft:function(e){this.$emit("setSelectItem",e),this.$emit("handleDiscardDrafts",!1),this.$emit("setSelectItem",{})},renameSubject:function(e){this.$emit("setSelectItem",e),this.$emit("handleRenameSubject")},replyLater:function(e){this.$emit("setSelectItem",e),this.$emit("handleReplyLater",e)},removeReplyLater:function(e){this.$emit("setSelectItem",e),this.$emit("handleRemoveReplyLater",e)},getDisplayMessageCount:function(){return this.isOutlook?this.inboxItem.mailHead.unreadMsgCnt:this.inboxItem.msgIds.length},hideMoreMenu:function(){var e,t,i,n;null!==(e=this.$refs)&&void 0!==e&&null!==(t=e.actionButtons)&&void 0!==t&&null!==(i=t.$refs)&&void 0!==i&&null!==(n=i.moreMenu)&&void 0!==n&&n.visible&&(this.$refs.actionButtons.$refs.moreMenu.visible=!1)},isQuarantinedLabel:function(e){return e===ii.QUARANTINED},onContextMenu:function(e,t){return this.isString(t)&&e.stopPropagation(),t.isPlain?this.handleHideActions():this.handleShowActions(e,t)},popoutDetail:function(e){this.$emit("popoutDetail",e)}})},ri=si,oi=(0,E.Z)(ri,$t,At,!1,null,"1672431a",null),li=oi.exports,ci=function(){var e=this,t=e._self._c;return t("div",{staticClass:"category-tabs"},[e.showSelectionCount?t("div",{class:["tab","selection-count"]},[t("span",{staticClass:"tab-name"},[e._v(e._s(e.getSelectionCountString()))])]):e.showTabs?e._t("default",(function(){return e._l(e.visibleCategoryTabIds,(function(i){return t("div",{key:i,class:["tab","tab-focus",{selected:i===e.selectedTabId}],attrs:{"zm-ta":"inbox-toggle-category-"+e.getName(i).toLowerCase(),tabindex:"0",role:"tab","aria-selected":(i===e.selectedTabId).toString()},on:{click:function(t){return e.selectTabId(i)},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])?null:e.selectTabId(i)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.selectTabId(i)}]}},[t("span",{staticClass:"tab-name"},[e._v(e._s(e.getName(i)))]),e.getTabCount(i)&&!e.isRedundantCountInfo(i)?t("span",{staticClass:"tab-count"},[e._v(" "+e._s(e.getTabCount(i))+" ")]):e._e()])}))})):t("div",{staticClass:"tab selected"},[t("span",{staticClass:"tab-name"},[e._v(e._s(e.getName(e.selectedTabId)))]),e.getTabCount(e.selectedTabId)&&!e.isRedundantCountInfo(e.selectedTabId)?t("span",{staticClass:"tab-count"},[e._v(" "+e._s(e.getTabCount(e.selectedTabId))+" ")]):e._e()])],2)},di=[],ui=d.Enums.SystemDefinedCategoryIds,hi=d.Enums.SystemDefinedMailLabelIds,mi=d.Business.labelUtils,pi=d.Business.formatNestedLabel,fi={name:"CategoryTabs",props:{selectionCount:{type:Number,default:0}},data:function(){return{selectedTabId:"",categoryIds:Object.values(ui),omittedCategoryIds:[ui.GROUP_APPROVAL]}},computed:(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)(["allLabels","selectMailLabel","mailHead"])),(0,h.rn)("search",["inFilters"])),(0,h.Se)(["isGmail","isZmail","isOutlook","labelNameInfo","labelIdToLabel"])),(0,h.Se)("inbox",["isLabelReachLastPage"])),(0,h.rn)("inbox",["isConversationView"])),{},{visibleCategoryTabIds:function(){var e=this,t=this.categoryIds.filter((function(t){return!e.omittedCategoryIds.includes(t)})).filter((function(t){return e.allLabels.find((function(e){return e.id===t}))})),i=hi.INBOX;return[i].concat((0,f.Z)(t))},showSelectionCount:function(){return this.selectionCount>0},showTabs:function(){return this.visibleCategoryTabIds.includes(this.selectedTabId)}}),watch:{selectMailLabel:{handler:function(e){e&&!this.inFilters&&(this.selectedTabId=e.id)},immediate:!0},selectedTabId:function(e){var t=this.labelIdToLabel.get(e);t&&(this.$store.commit("clearSearchResults"),this.$store.commit("search/changeInFilters",!1),this.$store.commit("changeSelectMailLabel",t),this.$store.commit("changeSelectPrevLabel",t))}},methods:{selectTabId:function(e){this.selectedTabId=e,this.$metric.report("inbox_toggle_category",{tabId:e})},getSelectionCountString:function(){var e=this.getCount(this.selectedTabId,!0),t=this.selectionCount===e,i=this.isLabelReachLastPage(qt.v8),n=t?this.selectedTabId!==qt.v8||i?"".concat(this.$t("common.all")," ").concat(e):String(e):this.selectionCount;return"".concat(this.$t("common.selected")," (").concat(n,")")},getLabelFromId:function(e){return this.labelIdToLabel.get(e)},getTabCount:function(e){var t=this.getCount(e);return t>0?"".concat(t):""},isRedundantCountInfo:function(e){return e===hi.INBOX&&!this.isZmail||e===hi.DRAFT},getCount:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e===qt.v8){var i=this.mailHead[qt.v8];return Object.keys(i).length}var n,a,s=this.getLabelFromId(e);if(!s)return 0;if(mi.HIDE_COUNT_LABELS.includes(e))return 0;var r=this.isConversationView?null===(n=s.count)||void 0===n?void 0:n.threadsTotal:null===(a=s.count)||void 0===a?void 0:a.msgTotal;return t?r:s.displayNum},getName:function(e){if(e===qt.v8)return this.$t("search.searchResults");var t=this.getLabelFromId(e);return t?this.getLabelName(t):""},getLabelName:function(e){if(e.isSystem){var t,i=this.isOutlook?L.Z:w.Z;return this.$t(null===(t=i[e.id])||void 0===t?void 0:t.displayName)||this.$t("common.unknown")}return this.isGmail?pi(e.name,{maxLen:Number.MAX_VALUE}):d.Utils.isDecryptFailed(e.labelDecryptionStatus)?this.$t("label.encryptedLabel"):(null===(n=this.labelNameInfo[e.id])||void 0===n?void 0:n.labelDisplayFullName)||pi(e.name,{maxLen:Number.MAX_VALUE});var n}}},vi=fi,bi=(0,E.Z)(vi,ci,di,!1,null,"32c513be",null),gi=bi.exports,Si=i(20910),Ii=i(80943),yi=i(95740),wi=i(32682),xi=i(96802),Li=function(){var e=this,t=e._self._c;return t("zm-tooltip",{attrs:{content:e.label,placement:"bottom",enterable:!1}},[t("zm-button",{staticClass:"mail-popout-button",attrs:{"zm-ta":e.isMailPopout?"mail-merge-back-button":"mail-popout-button","aria-label":e.label},on:{click:e.onClick}},[t("svg-icon",{staticClass:"mail-popout-button-icon",attrs:{iconClass:e.isMailPopout?"pop-window-back":"pop-window"}})],1)],1)},Ci=[],Mi={name:"MailPopoutButton",computed:(0,l.Z)((0,l.Z)({},(0,h.rn)("auth",["isMailPopout"])),{},{label:function(e){var t=e.isMailPopout;return this.$t(t?"operation.mergeWindow":"operation.openInNewWindow")}}),methods:(0,l.Z)((0,l.Z)({},(0,h.OI)("auth",["updateMailPopoutState"])),{},{onClick:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,u.Setting.popoutMailTab({isPopout:!e.isMailPopout});case 2:case"end":return t.stop()}}),t)})))()}})},ki=Mi,_i=(0,E.Z)(ki,Li,Ci,!1,null,"03a56fdd",null),Di=_i.exports,Ti=function(){var e=this,t=e._self._c;return t("div",{staticClass:"banner"},[t("span",{staticClass:"content",attrs:{"aria-hidden":!0}},[e._v(" "+e._s(e.$t("offlineMode.inboxBannerContent"))+" ")]),t("span",{staticClass:"learn-more tab-focus",attrs:{tabindex:"0",role:"button","aria-label":"".concat(e.$t("offlineMode.inboxBannerContent")," ").concat(e.$t("offlineMode.inboxBannerLearnMore"))},on:{click:e.handleLearnMore,keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.stopPropagation(),t.preventDefault(),e.handleLearnMore.apply(null,arguments))}}},[e._v(" "+e._s(e.$t("offlineMode.inboxBannerLearnMore"))+" ")]),t("confirm-dialog",{attrs:{visible:e.showLearnMoreDialog,content:e.$t("offlineMode.learnMoreContent"),actions:e.LearnMoreActions,title:e.$t("offlineMode.learnMoreTitle"),width:"400px"}})],1)},Ei=[],$i={name:"OfflineModeInboxBanner",components:{ConfirmDialog:Ii.QH},props:{},data:function(){return{showLearnMoreDialog:!1,LearnMoreActions:[{id:"got-it",className:"got-it tab-focus",handler:this.hideDialog,text:this.$t("offlineMode.gotIt"),type:"primary"}]}},methods:{hideDialog:function(){this.showLearnMoreDialog=!1},handleLearnMore:function(){this.showLearnMoreDialog=!0}}},Ai=$i,Ri=(0,E.Z)(Ai,Ti,Ei,!1,null,"2695f3b8",null),Zi=Ri.exports,Oi=function(){var e=this,t=e._self._c;return t("div",e._b({staticClass:"zm-mc-context-menu-item",on:{click:e.handleClick}},"div",e.$attrs,!1),[e._t("default")],2)},zi=[],Ni={name:"ContextMenuItem",methods:{handleClick:function(){this.$emit("click")}}},Pi=Ni,Fi=(0,E.Z)(Pi,Oi,zi,!1,null,"3701d89b",null),Vi=Fi.exports,Hi=i(69003),Bi=i(60753),Ui=function(){var e=this,t=e._self._c;return t("div",{staticClass:"inbox-sections"},[e.currentFullSectionType?[t("inbox-section-full",e._g({attrs:{listId:"virtual-container",name:e.getSectionName(e.currentFullSectionType),mails:e.getSectionMails(e.currentFullSectionType),isLastPage:e.sectionIsLastPageMap[e.currentFullSectionType],isInitialLoading:e.getSectionInitialLoadingStatus(e.currentFullSectionType),isScrollLoading:e.getSectionFullRefreshLoadingStatus(e.currentFullSectionType),placeholderContent:e.getPlaceholderContent(e.currentFullSectionType),isShowRetryButton:e.getRetryButtonVisibility(e.currentFullSectionType)},on:{close:e.onCloseFullSection,scrollEnd:function(t){return e.onScrollEnd(e.currentFullSectionType)},retry:function(t){return e.onRetry(e.currentFullSectionType)}}},e.getListener(e.currentFullSectionType)))]:t("div",{staticClass:"inbox-sections-section-list",attrs:{id:"virtual-container"}},e._l(e.sectionTypes,(function(i){return t("div",{key:i},[t("inbox-section",e._g({class:["inbox-section-".concat(i)],attrs:{listId:i,name:e.getSectionName(i),mails:e.getTopSectionMails(i),isLastPage:e.showEndOfMails(i),isCollapsed:e.sectionCollapseStateMap[i],isInitialLoading:e.getSectionInitialLoadingStatus(i),isScrollLoading:e.getSectionRefreshLoadingStatus(i),placeholderContent:e.getPlaceholderContent(i),isShowRetryButton:e.getRetryButtonVisibility(i)},on:{menuCommand:function(t){return e.onMenuCommand(t,i)},toggleExpand:function(t){return e.onToggleExpand(i)},retry:function(t){return e.onRetry(i)}}},e.getListener(i)))],1)})),0)],2)},ji=[],Wi=function(){var e=this,t=e._self._c;return t("div",{staticClass:"inbox-section"},[t("div",{staticClass:"head"},[t("zm-button",{staticClass:"expand-button tab-focus",attrs:{tabindex:"0",role:"button","zm-ta":"inbox-section-expand-".concat(e.listId),"aria-label":e.name,"aria-expanded":e.isCollapsed?"false":"true"},on:{click:e.onToggleExpand}},[t("svg-icon",{attrs:{iconClass:e.isCollapsed?"chevron-small-down":"chevron-small-up"}}),t("span",{staticClass:"name"},[e._v(e._s(e.name))])],1),t("zm-dropdown",{directives:[{name:"show",rawName:"v-show",value:e.menuVisible,expression:"menuVisible"}],attrs:{trigger:"click",placement:"bottom"},on:{command:e.onMenu}},[t("zm-button",{staticClass:"menu-button",attrs:{tabindex:"0",role:"button","zm-ta":"inbox-section-more-menu-".concat(e.listId),"aria-label":e.$t("accessibility.moreMenu",[e.name])}},[t("svg-icon",{attrs:{iconClass:"more"}})],1),t("zm-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t("zm-dropdown-item",{attrs:{tabindex:"0","zm-ta":"inbox-section-show-all-".concat(e.listId),command:"showAll"}},[t("span",[e._v(e._s(e.$t("list.showAll")))])])],1)],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.isCollapsed,expression:"!isCollapsed"},{name:"loading",rawName:"v-loading",value:e.isInitialLoading,expression:"isInitialLoading"}],staticClass:"list-container",attrs:{"element-loading-spinner":"zm-icon-loading"}},[e.isInitialLoading?e._e():t("mail-list",e._g(e._b({staticClass:"list"},"mail-list",e.$props,!1),e.$listeners))],1)])},Ki=[],Yi=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mail-list"},[0===e.mails.length?t("div",{class:["mail-list-empty",!e.showEmptyImg&&"no-empty-image"]},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.showEmptyImg,expression:"showEmptyImg"}],staticClass:"mail-list-empty-image"},[t("img",{staticClass:"splash",attrs:{src:i(66813),alt:e.$t("list.splashImage")}})]),t("div",[e._v(e._s(e.placeholderContent||e.$t("list.defaultNoMailsTip")))]),t("div",{staticClass:"mail-list-empty-button"},[e.isShowRetryButton?t("zm-button",{attrs:{"zm-ta":"inbox-list-refresh-".concat(e.listId)},on:{click:e.onRetry}},[e._v(" "+e._s(e.$t("common.retry"))+" ")]):e._e()],1)]):t("RecycleScroller",{ref:"recycleScroller",staticClass:"recycle-scroller tab-focus-button",attrs:{id:e.listId,tabindex:"0","aria-label":"".concat(e.name," ").concat(e.$t("accessibility.emailList")),keyField:"mailId",items:e.mails,sizeField:"height",simpleArray:!1},on:{scrollEnd:e.onScrollEnd},scopedSlots:e._u([{key:"default",fn:function(i){var n=i.item;return[t("inbox-item",e._g({key:n.mailId,attrs:{"zm-ta":"inbox-item-"+n.mailId,inboxItem:n,tabindex:"-1"}},e.$listeners))]}},{key:"after",fn:function(){return[t("div",{directives:[{name:"show",rawName:"v-show",value:e.isScrollLoading&&0!==e.mails.length,expression:"isScrollLoading && mails.length !== 0"}],staticClass:"list-loading"},[t("i",{staticClass:"zm-icon-loading"})]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.isLastPage&&!e.isScrollLoading&&0!==e.mails.length,expression:"isLastPage && !isScrollLoading && mails.length !== 0"}],staticClass:"list-marker"},[e._v(" "+e._s(e.$t("list.endOfEmails"))+" ")])]},proxy:!0}])})],1)},Xi=[],Gi={name:"MailList",components:{InboxItem:li,RecycleScroller:Tt.EK},props:{name:{type:String,default:""},mails:{type:Array,default:function(){return[]}},isScrollMode:{type:Boolean,default:!1},isScrollLoading:{type:Boolean,default:!1},isLastPage:{type:Boolean,default:!1},placeholderContent:{type:String,default:""},isShowRetryButton:{type:Boolean,default:!1},listId:{type:String,default:""},showEmptyImg:{type:Boolean,default:!1}},methods:{onScrollEnd:function(){console.log("onScrollEnd"),this.isScrollMode&&this.$emit("scrollEnd")},onRetry:function(){this.$emit("retry")}}},qi=Gi,Ji=(0,E.Z)(qi,Yi,Xi,!1,null,"32bae056",null),Qi=Ji.exports,en={name:"InboxSection",components:{MailList:Qi},props:{name:{type:String,default:""},mails:{type:Array,default:function(){return[]}},isInitialLoading:{type:Boolean,default:!1},isScrollLoading:{type:Boolean,default:!1},isLastPage:{type:Boolean,default:!1},placeholderContent:{type:String,default:""},isShowRetryButton:{type:Boolean,default:!1},listId:{type:String,default:""},isCollapsed:{type:Boolean,default:!1}},computed:{menuVisible:function(){return 0!==this.mails.length}},methods:{onMenu:function(e){this.$emit("menuCommand",e)},onToggleExpand:function(){this.$emit("toggleExpand")},onScrollEnd:function(){this.$emit("scrollEnd")}}},tn=en,nn=(0,E.Z)(tn,Wi,Ki,!1,null,"b08d3476",null),an=nn.exports,sn=function(){var e=this,t=e._self._c;return t("div",{staticClass:"inbox-section-full"},[t("div",{staticClass:"head"},[t("div",{staticClass:"name"},[e._v(e._s(e.name))]),t("zm-dropdown",{attrs:{trigger:"click",placement:"bottom"},on:{command:e.onMenu}},[t("zm-button",{staticClass:"menu-button",attrs:{tabindex:"0",role:"button","zm-ta":"inbox-section-full-more-menu-".concat(e.listId)}},[t("svg-icon",{attrs:{iconClass:"more"}})],1),t("zm-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t("zm-dropdown-item",{attrs:{tabindex:"0","zm-ta":"inbox-section-full-close-all-".concat(e.listId),command:"closeAll"}},[t("span",[e._v(e._s(e.$t("list.closeAll")))])])],1)],1)],1),t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.isInitialLoading,expression:"isInitialLoading"}],staticClass:"list-container",attrs:{"element-loading-spinner":"zm-icon-loading"}},[e.isInitialLoading?e._e():t("mail-list",e._g(e._b({staticClass:"list",attrs:{isScrollMode:!0,"show-empty-img":!0}},"mail-list",e.$props,!1),e.$listeners))],1)])},rn=[],on={name:"InboxSectionFull",components:{MailList:Qi},props:{name:{type:String,default:""},mails:{type:Array,default:function(){return[]}},isInitialLoading:{type:Boolean,default:!1},isScrollLoading:{type:Boolean,default:!1},isLastPage:{type:Boolean,default:!1},placeholderContent:{type:String,default:""},isShowRetryButton:{type:Boolean,default:!1},listId:{type:String,default:""}},methods:{onMenu:function(e){var t=this,i={closeAll:function(){t.$emit("close")}};i[e]&&i[e]()},onScrollEnd:function(){this.$emit("scrollEnd")}}},ln=on,cn=(0,E.Z)(ln,sn,rn,!1,null,"8c1c2d9e",null),dn=cn.exports,un=d.Enums.SystemDefinedMailLabelIds,hn=d.Enums.INBOX_SECTION_TYPE,mn=d.Enums.INBOX_LIST_MAP_TO_SECTIONS,pn=(ct={},(0,wt.Z)(ct,hn.UNREAD,{name:"list.unreadSectionName"}),(0,wt.Z)(ct,hn.READ,{name:"list.everythingElseSectionName"}),(0,wt.Z)(ct,hn.IMPORTANT,{name:"list.importantSectionName"}),(0,wt.Z)(ct,hn.UNIMPORTANT,{name:"list.everythingElseSectionName"}),(0,wt.Z)(ct,hn.STARRED,{name:"list.starred"}),(0,wt.Z)(ct,hn.UNSTARRED,{name:"list.everythingElseSectionName"}),ct),fn=(0,wt.Z)({},un.INBOX,"list.noEmailsInInbox"),vn={name:"InboxSections",components:{InboxSection:an,InboxSectionFull:dn},data:function(){return{sectionConfigMap:pn,sectionInitialLoadingStateMap:{},sectionRefreshLoadingStateMap:{},sectionIsLastPageMap:{},sectionErrorStateMap:{},sectionCollapseStateMap:{}}},computed:(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)(["isOffline","maxNumberMailsPerRequest","selectMailLabel"])),(0,h.rn)("inbox",["currentFullSectionType","sectionFixedMailCount","inboxType"])),(0,h.Se)(["isOutlook","isGmail","isZmail"])),(0,h.Se)("inbox",["inboxLabelMails","currentInboxSectionsMails","unreadMails","readMails","importantMails","unimportantMails","starredMails","unstarredMails","selectedInboxMailIds","currentSectionViewVisibleMails"])),(0,h.Se)("features",["enableRenameSubject"])),{},{currentLabelId:function(){var e;return null===(e=this.selectMailLabel)||void 0===e?void 0:e.id},sectionTypes:function(){var e;return mn[null===(e=this.inboxType)||void 0===e?void 0:e.type]||[]}}),watch:{currentInboxSectionsMails:function(){this.updateSelection()},unreadMails:{handler:function(){this.checkSectionListCount(hn.UNREAD)},immediate:!0},readMails:{handler:function(){this.checkSectionListCount(hn.READ)},immediate:!0},importantMails:{handler:function(){this.checkSectionListCount(hn.IMPORTANT)},immediate:!0},unimportantMails:{handler:function(){this.checkSectionListCount(hn.UNIMPORTANT)},immediate:!0},starredMails:{handler:function(){this.checkSectionListCount(hn.STARRED)},immediate:!0},unstarredMails:{handler:function(){this.checkSectionListCount(hn.UNSTARRED)},immediate:!0}},beforeDestroy:function(){this.$store.commit("inbox/changeCurrentViewSectionType",""),this.clearCurrentFullSectionType(),this.clearSelectedInboxMailIds()},methods:(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.nv)("inbox",["clearSelectedInboxMailIds","setCurrentFullSectionType","clearCurrentFullSectionType","resetSelectedInboxMailIds","fetchMails"])),(0,h.nv)(["batchAddMailHeads"])),(0,h.OI)("mail",["batchSetThreadIdToName"])),{},{getListener:function(e){var t=this;return(0,l.Z)((0,l.Z)({},this.$listeners),{},{showDetail:function(i){t.showDetail(i,e)}})},onScrollEnd:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(!t.sectionIsLastPageMap[e]){i.next=2;break}return i.abrupt("return");case 2:t.refreshMailList(e);case 3:case"end":return i.stop()}}),i)})))()},onRetry:function(e){this.refreshMailList(e)},checkSectionListCount:function(e){var t=this;if(this.sectionTypes.includes(e)){var i=this.sectionInitialLoadingStateMap[e]||this.sectionRefreshLoadingStateMap[e];if(!i){var n=this.currentInboxSectionsMails[e]||[],a=this.sectionFixedMailCount;e===hn.READ&&this.isGmail&&(a=100),n.length<a&&!this.sectionIsLastPageMap[e]&&this.$nextTick((function(){console.debug("===> load more read mails",e),t.refreshMailList(e)}))}}},refreshMailList:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n,a,o,l;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:n={},(0,wt.Z)(n,hn.UNREAD,{fetch:function(){var e=(0,r.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",t.doFetchMails({isUnread:!0,isFromBegin:!!t.isOutlook&&!t.currentFullSectionType,isRead:!1}));case 1:case"end":return e.stop()}}),e)})));function i(){return e.apply(this,arguments)}return i}()}),(0,wt.Z)(n,hn.READ,{fetch:function(){var e=(0,r.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",t.doFetchMails({isRead:!0,isFromBegin:!1,isUnread:!1}));case 1:case"end":return e.stop()}}),e)})));function i(){return e.apply(this,arguments)}return i}()}),(0,wt.Z)(n,hn.IMPORTANT,{fetch:function(){var e=(0,r.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",t.doFetchMails({isImportant:!0,isFromBegin:!1,isUnImportant:!1}));case 1:case"end":return e.stop()}}),e)})));function i(){return e.apply(this,arguments)}return i}()}),(0,wt.Z)(n,hn.UNIMPORTANT,{fetch:function(){var e=(0,r.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",t.doFetchMails({isUnImportant:!0,isFromBegin:!1,isImportant:!1}));case 1:case"end":return e.stop()}}),e)})));function i(){return e.apply(this,arguments)}return i}()}),(0,wt.Z)(n,hn.STARRED,{fetch:function(){var e=(0,r.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",t.doFetchMails({isStarred:!0,isFromBegin:!1,isUnStarred:!1}));case 1:case"end":return e.stop()}}),e)})));function i(){return e.apply(this,arguments)}return i}()}),(0,wt.Z)(n,hn.UNSTARRED,{fetch:function(){var e=(0,r.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",t.doFetchMails({isStarred:!1,isFromBegin:!1,isUnStarred:!0}));case 1:case"end":return e.stop()}}),e)})));function i(){return e.apply(this,arguments)}return i}()}),a=n,o=a[e].fetch,t.$set(t.sectionRefreshLoadingStateMap,e,!0),t.$set(t.sectionErrorStateMap,e,!1),l=t.currentInboxSectionsMails[e],l&&0===l.length&&t.$set(t.sectionInitialLoadingStateMap,e,!0),o().then((function(i){var n=i.isLastPage;t.$set(t.sectionIsLastPageMap,e,n),t.$set(t.sectionRefreshLoadingStateMap,e,!1),t.$set(t.sectionInitialLoadingStateMap,e,!1)}))["catch"]((function(i){console.error(i),t.$set(t.sectionErrorStateMap,e,!0),t.$set(t.sectionRefreshLoadingStateMap,e,!1),t.$set(t.sectionInitialLoadingStateMap,e,!1)}));case 7:case"end":return i.stop()}}),i)})))()},fetchAllSectionMails:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){var i,n,a,r,o,l,c,d;return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.currentLabelId){t.next=2;break}return t.abrupt("return");case 2:i={},(0,wt.Z)(i,hn.UNREAD,{fetch:function(){return e.doFetchMails({isUnread:!0,isFromBegin:!0,isRead:!1})}}),(0,wt.Z)(i,hn.READ,{fetch:function(){return e.doFetchMails({isRead:!0,isFromBegin:!0,isUnread:!1})}}),(0,wt.Z)(i,hn.IMPORTANT,{fetch:function(){return e.doFetchMails({isImportant:!0,isFromBegin:!0,isUnImportant:!1})}}),(0,wt.Z)(i,hn.UNIMPORTANT,{fetch:function(){return e.doFetchMails({isUnImportant:!0,isFromBegin:!0,isImportant:!1})}}),(0,wt.Z)(i,hn.STARRED,{fetch:function(){return e.doFetchMails({isStarred:!0,isFromBegin:!0,isUnStarred:!1})}}),(0,wt.Z)(i,hn.UNSTARRED,{fetch:function(){return e.doFetchMails({isUnStarred:!0,isFromBegin:!0,isStarred:!1})}}),n=i,a=(0,J.Z)(e.sectionTypes),t.prev=4,a.s();case 6:if((r=a.n()).done){t.next=29;break}if(o=r.value,n[o]){t.next=10;break}return t.abrupt("return");case 10:return l=n[o].fetch,e.$set(e.sectionInitialLoadingStateMap,o,!0),e.$set(e.sectionErrorStateMap,o,!1),t.prev=13,t.next=16,l();case 16:c=t.sent,d=c.isLastPage,e.$set(e.sectionIsLastPageMap,o,d),e.$set(e.sectionInitialLoadingStateMap,o,!1),t.next=27;break;case 22:t.prev=22,t.t0=t["catch"](13),console.error(t.t0),e.$set(e.sectionErrorStateMap,o,!0),e.$set(e.sectionInitialLoadingStateMap,o,!1);case 27:t.next=6;break;case 29:t.next=34;break;case 31:t.prev=31,t.t1=t["catch"](4),a.e(t.t1);case 34:return t.prev=34,a.f(),t.finish(34);case 37:case"end":return t.stop()}}),t,null,[[4,31,34,37],[13,22]])})))()},doFetchMails:function(){var e=arguments,t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n,a,r,o,l,c,d,u,h,m;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=e.length>0&&void 0!==e[0]?e[0]:{},a=!0,r=[],i.prev=3,i.next=6,t.fetchMails({labelId:t.currentLabelId,count:n.count||t.maxNumberMailsPerRequest,options:n});case 6:if(o=i.sent,l=o.data,c=o.errorCode,0===c){i.next=11;break}return i.abrupt("return",Promise.reject(new Error("list thread failed.")));case 11:return d=l.mailIds,u=l.isLastPage,h=l.threadIdToName,a=u,t.storeThreadIdToName(h),m=t.currentLabelId,i.next=17,t.$store.dispatch("getAllMailHead",{labelId:m,mailIds:d,updateStore:!0,onProgress:function(e){console.debug("Inbox Section getAllMailHead onProgress",e),t.batchAddMailHeads({labelId:m,mailHeads:e})}});case 17:r=i.sent,i.next=24;break;case 20:return i.prev=20,i.t0=i["catch"](3),console.error(i.t0),i.abrupt("return",Promise.reject(new Error("fetch mails failed.")));case 24:return i.abrupt("return",{mailHeads:r,isLastPage:a});case 25:case"end":return i.stop()}}),i,null,[[3,20]])})))()},getSectionName:function(e){var t,i=null===(t=pn[e])||void 0===t?void 0:t.name;return i?this.$t(i):""},getSectionMails:function(e){var t,i=(t={},(0,wt.Z)(t,hn.UNREAD,this.unreadMails),(0,wt.Z)(t,hn.READ,this.readMails),(0,wt.Z)(t,hn.IMPORTANT,this.importantMails),(0,wt.Z)(t,hn.UNIMPORTANT,this.unimportantMails),(0,wt.Z)(t,hn.STARRED,this.starredMails),(0,wt.Z)(t,hn.UNSTARRED,this.unStarredMail),t);return i[e]||[]},getTopSectionMails:function(e){var t,i=(t={},(0,wt.Z)(t,hn.UNREAD,this.unreadMails),(0,wt.Z)(t,hn.READ,this.readMails),(0,wt.Z)(t,hn.IMPORTANT,this.importantMails),(0,wt.Z)(t,hn.UNIMPORTANT,this.unimportantMails),(0,wt.Z)(t,hn.STARRED,this.starredMails),(0,wt.Z)(t,hn.UNSTARRED,this.unstarredMails),t);return(i[e]||[]).slice(0,this.sectionFixedMailCount)},getSectionInitialLoadingStatus:function(e){var t=this.sectionInitialLoadingStateMap[e];return void 0===t&&!this.inboxLabelMails.length||t},getSectionFullRefreshLoadingStatus:function(e){return this.sectionRefreshLoadingStateMap[e]},getSectionRefreshLoadingStatus:function(e){var t=this.currentInboxSectionsMails[e]||[];return this.sectionRefreshLoadingStateMap[e]&&t.length<this.sectionFixedMailCount},getRetryButtonVisibility:function(e){return this.sectionErrorStateMap[e]},getPlaceholderContent:function(e){if(this.isOffline)return this.$t("list.offline");if(this.sectionErrorStateMap[e])return this.$t("list.failToList");var t=fn[this.currentLabelId]||"list.noEmailsInLabel";return this.$t(t)},onMenuCommand:function(e,t){var i=this,n={showAll:function(){i.setCurrentFullSectionType(t),i.clearSelectedInboxMailIds()}};n[e]&&n[e]()},onCloseFullSection:function(){this.clearCurrentFullSectionType(),this.clearSelectedInboxMailIds()},onToggleExpand:function(e){var t=this.sectionCollapseStateMap[e]||!1;this.$set(this.sectionCollapseStateMap,e,!t)},showEndOfMails:function(e){if(!this.sectionIsLastPageMap[e])return!1;var t=this.currentInboxSectionsMails[e]||[];return t.length<this.sectionFixedMailCount},showDetail:function(e,t){this.$store.commit("inbox/changeCurrentViewSectionType",t),this.$emit("showDetail",e)},storeThreadIdToName:function(e){Array.isArray(e)&&this.enableRenameSubject&&this.batchSetThreadIdToName(e)},updateSelection:function(){var e=this;if(this.selectedInboxMailIds&&0!==this.selectedInboxMailIds.length){var t=this.currentSectionViewVisibleMails.map((function(e){return e.mailId})),i=t.filter((function(t){var i;return null===(i=e.selectedInboxMailIds)||void 0===i?void 0:i.includes(t)}));this.resetSelectedInboxMailIds({mailIds:i})}}})},bn=vn,gn=(0,E.Z)(bn,Ui,ji,!1,null,"59c0e3ec",null),Sn=gn.exports,In=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.isLowStorage&&e.showStorageUsageTips,expression:"isLowStorage && showStorageUsageTips"}],staticClass:"low-storage-usage-tips-container"},[t("div",{staticClass:"low-storage-usage-tips"},[t("div",{staticClass:"low-storage-usage-tips-content"},[t("div",{staticClass:"low-storage-usage-tips-bar",style:{backgroundColor:e.isStorageFull?"var(--red-60)":"var(--blue-60)"},attrs:{tabindex:"-1","aria-hidden":"true"}},[t("div",{staticClass:"low-storage-usage-tips-bar-item"})]),t("div",{staticClass:"low-storage-usage-tips-description"},[t("div",{staticClass:"usage-tips-header tab-focus",attrs:{"aria-label":e.tipsHeader,tabindex:"0"}},[e._v(" "+e._s(e.tipsHeader)+" ")]),t("div",{staticClass:"usage-tips-detail tab-focus",attrs:{"aria-label":e.tipsDetail,tabindex:"0"}},[e._v(" "+e._s(e.tipsDetail)+" ")])])]),e.isStorageFull?e._e():t("zm-button",{staticClass:"low-storage-usage-tips-action tab-focus",attrs:{type:"text",tabindex:"0","aria-label":e.$t("common.close")},on:{click:e.hideTips},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.hideTips.apply(null,arguments)}}},[t("svg-icon",{attrs:{"icon-class":"close"}})],1)],1)])},yn=[],wn={name:"LowStorageUsageTips",data:function(){return{timer:null}},computed:(0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)(["showStorageUsageTips"])),(0,h.Se)(["zmailStorageUsage","isZmail"])),{},{isLowStorage:function(e){var t=e.zmailStorageUsage;return t>=.95},isStorageFull:function(e){var t=e.zmailStorageUsage;return t>=.99},tipsHeader:function(e){var t=e.isLowStorage,i=e.isStorageFull,n=e.zmailStorageUsage,a="";return i?a=this.$t("account.storageFull"):t&&(a=this.$t("account.storageAlmostFull",[(100*n).toFixed(2)+"%"])),a},tipsDetail:function(e){var t=e.isLowStorage,i=e.isStorageFull,n="";return i?n=this.$t("account.storageFullDetail"):t&&(n=this.$t("account.storageAlmostFullDetail")),n}}),created:function(){var e=this;this.isZmail&&(this.startRefreshZmailProfileTimer(),this.$once("hook:beforeDestroy",(function(){e.stopRefreshZmailProfileTimer()})))},methods:(0,l.Z)((0,l.Z)({},(0,h.OI)(["changeStorageUsageTips"])),{},{hideTips:function(){this.changeStorageUsageTips(!1)},startRefreshZmailProfileTimer:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:console.log("startRefreshZmailProfileTimer"),e.timer=setTimeout((0,r.Z)((0,s.Z)().mark((function t(){var i,n,a,r,o;return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,u.Setting.getCurrentMailUserProfile();case 3:i=t.sent,n=i.data.GetCurrentMailUserProfile,a=i.errorCode,console.log("refreshZmailProfileFn zmailUserProfile",n),!a&&n?(r=["mboxQuota","mboxSize","singleAttachmentMaxSize","singleAttachmentMaxCount","warningBannerSendEnabled","warningBannerReceiveEnabled","warningBannerContentReceive","warningBannerContentSend","outgoingRecipientsLimitPerMessage"],o={},r.forEach((function(e){n.hasOwnProperty(e)&&(o[e]=n[e])})),e.$store.commit("setUserProfile",o)):console.warn("refresh zmail user profile error",n),t.next=13;break;case 10:t.prev=10,t.t0=t["catch"](0),console.error("startRefreshZmailProfileTimer error",t.t0);case 13:return t.prev=13,t.next=16,e.startRefreshZmailProfileTimer();case 16:return e.changeStorageUsageTips(!0),t.finish(13);case 18:case"end":return t.stop()}}),t,null,[[0,10,13,18]])}))),36e5);case 2:case"end":return t.stop()}}),t)})))()},stopRefreshZmailProfileTimer:function(){clearTimeout(this.timer)}})},xn=wn,Ln=(0,E.Z)(xn,In,yn,!1,null,"9b1034ee",null),Cn=Ln.exports,Mn=(i(45794),function(){var e=this,t=e._self._c;return t("form",{ref:"searchForm",staticClass:"search-form",attrs:{role:"search"},on:{submit:function(e){e.preventDefault()}}},[t("zm-popover",{staticClass:"search-popover",attrs:{placement:"bottom-start",disabled:e.isSearchInDetailSelected,"visible-arrow":!1,"popper-options":{boundariesElement:"body",gpuAcceleration:!1},trigger:"click","tab-to-leave":!0,transition:"none"},model:{value:e.searchPopoverVisible,callback:function(t){e.searchPopoverVisible=t},expression:"searchPopoverVisible"}},[t("div",{staticClass:"search-box",attrs:{slot:"reference",name:"searchbox"},slot:"reference"},[t("zm-input",{ref:"searchInput",class:["search-input",!e.searchLabelSelectVisible&&"search-input__blurred"],attrs:{"zm-ta":"inbox-search-input",placeholder:e.$t("search.searchMail")},on:{focus:e.handleSearchInputFocused,blur:e.handleSearchInputBlurred,submit:function(t){return e.handleSubmit()}},nativeOn:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.stopPropagation(),t.preventDefault(),e.focusOnFirst.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.stopPropagation(),t.preventDefault(),e.focusOnFirst.apply(null,arguments))}],click:function(t){return e.onClickSearchInput.apply(null,arguments)}},model:{value:e.userInput,callback:function(t){e.userInput=t},expression:"userInput"}},[t("zm-select",{directives:[{name:"show",rawName:"v-show",value:e.searchLabelSelectVisible,expression:"searchLabelSelectVisible"}],ref:"searchLabelSelectRef",staticClass:"search-label-select",style:{maxWidth:"180px"},attrs:{slot:"prepend","popper-class":"search-label-select__popper","popper-append-to-body":"",filterLabel:e.getSelectorDisplayValue},on:{focus:function(t){e.isSearchLabelSelectFocused=!0},blur:function(t){e.isSearchLabelSelectFocused=!1},"visible-change":e.handleSearchLabelSelectVisibleChange,change:e.handleSearchLabelChange},slot:"prepend",model:{value:e.selectedSearchLabelId,callback:function(t){e.selectedSearchLabelId=t},expression:"selectedSearchLabelId"}},[t("RecycleScroller",{staticClass:"search-label-select-scroll-list",attrs:{id:"search-labels-rs",items:e.searchInLabelOptions,"size-field":"height","key-field":"id","simple-array":!1},scopedSlots:e._u([{key:"default",fn:function(i){var n=i.item;return[n.divided?t("div",{staticClass:"search-label-select-option-divider"},[t("div",{staticClass:"line"})]):t("zm-option",{staticClass:"search-label-select__item",attrs:{"option-id":n.value,label:n.name,value:n.value}},[t("div",{staticClass:"search-label-select__item__icon"},[t("svg-icon",{directives:[{name:"show",rawName:"v-show",value:n.value===e.selectedSearchLabelId,expression:"item.value === selectedSearchLabelId"}],attrs:{iconClass:"checkmark-green"}})],1),t("span",[e._v(e._s(n.name))])])]}}])})],1),t("svg-icon",{attrs:{slot:"prefix",iconClass:"search"},slot:"prefix"}),t("template",{slot:"append"},[t("section",{staticClass:"search-input__append"},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.detailSearchEnabled&&e.isSearchInDetailSelected,expression:"detailSearchEnabled && isSearchInDetailSelected"}],staticClass:"search-input__append__detailsearch"},[e.detailSearchResults.length?t("span",[e._v(" "+e._s(e.$tc("search.results",e.detailSearchResults.length,[e.detailSearchResults.length]))+" ")]):t("span",[e._v(e._s(e.$t("search.noResults")))]),t("div",{staticClass:"search-input__divider"})]),t("span",{directives:[{name:"show",rawName:"v-show",value:e.userInput.length>0,expression:"userInput.length > 0"}],staticClass:"clear-search-key-button",attrs:{"zm-ta":"inbox-search-clear","aria-label":e.$t("search.clear")},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.handleClose.apply(null,arguments)}}},[t("svg-icon",{attrs:{iconClass:"blocked"}})],1),t("zm-tooltip",{ref:"tooltip",attrs:{value:e.tooltipVisible,placement:"bottom",enterable:!1,manual:!0,"append-to-body":""}},[t("div",{staticClass:"shortcut-wrapper force-dark",attrs:{slot:"content"},slot:"content"},[t("div",{staticClass:"tooltip-content"},[e._v(e._s(e.$t("search.advancedSearch")))])]),t("span",{directives:[{name:"show",rawName:"v-show",value:!e.isSearchInDetailSelected,expression:"!isSearchInDetailSelected"}],staticClass:"advanced-search-button",on:{mouseover:function(t){e.tooltipVisible=!0},mouseleave:function(t){e.tooltipVisible=!1},click:function(t){return t.stopPropagation(),t.preventDefault(),e.useAdvancedSearchOptions.apply(null,arguments)}}},[t("svg-icon",{attrs:{iconClass:"filter"}})],1)])],1)])],2)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.isSearchInDetailSelected,expression:"!isSearchInDetailSelected"}],staticClass:"search-popover-container"},[t("search-quick-filters",{directives:[{name:"show",rawName:"v-show",value:e.quickFiltersVisible,expression:"quickFiltersVisible"}],ref:"searchQuickFiltersRef",staticClass:"search-filters",attrs:{value:e.tempSelectedSearchFilters},on:{change:e.handleUpdateSearchQuickFilters}}),t("search-suggestion",{ref:"searchSuggestionRef",attrs:{keyword:e.userInput.trim(),selectedSearchFilters:e.tempSelectedSearchFilters,disabled:e.isSearchInDetailSelected},on:{quickSearch:e.handleQuickSearch,redirect:e.handleRedirect}}),t("recent-search-list",{directives:[{name:"show",rawName:"v-show",value:0===e.userInput.length,expression:"userInput.length === 0"}],on:{select:e.handleRecentSelection}}),t("div",{directives:[{name:"show",rawName:"v-show",value:e.advancedSearchEnabled&&0===e.userInput.length,expression:"advancedSearchEnabled && userInput.length === 0"}],staticClass:"search-form-divider"}),t("div",{directives:[{name:"show",rawName:"v-show",value:e.advancedSearchEnabled||e.userInput.length>0,expression:"advancedSearchEnabled || userInput.length > 0"}],staticClass:"view-all-searches tab-focus",attrs:{tabindex:"0","aria-label":e.$t("search.viewAllAria",[e.userInput]),"zm-ta":"inbox-search-view-all",role:"button"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.handleSubmit()},keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.stopPropagation(),t.preventDefault(),e.handleSubmit())}}},[t("div",{staticClass:"view-all-searches-title"},[e._v(" "+e._s(e.viewSearchResultTip)+" ")]),t("div",{staticClass:"view-all-searches-action"},[e._v(" "+e._s(e.$t("search.viewAllAction"))+" ")])])],1)]),e.advanceSearchIsInited?t("advanced-search-options",{ref:"advancedSearchOptionsRef",on:{error:e.handleClose,submit:e.handleAdvancedSearchSubmitted}}):e._e()],1)}),kn=[],_n=(i(49992),function(){var e=this,t=e._self._c;return t("zm-checkbox-group",{staticClass:"search-quick-filters",attrs:{buttonstyle:""},on:{change:e.updateValue},model:{value:e.modelValue,callback:function(t){e.modelValue=t},expression:"modelValue"}},e._l(e.filters,(function(i){var n=i.id,a=i.label,s=i.zmTa;return t("zm-checkbox",{key:n,attrs:{label:n,"zm-ta":s,"aria-label":a},nativeOn:{click:function(t){return t.stopPropagation(),e.debouncedClickSearchQuickFilters.apply(null,arguments)}}},[e._v(" "+e._s(a)+" ")])})),1)}),Dn=[],Tn={name:"SearchQuickFilters",props:{value:{type:Array,default:function(){return[]}},options:{type:Array,default:function(){return[]}}},data:function(){return{modelValue:[]}},computed:(0,l.Z)((0,l.Z)({},(0,h.rn)({userEmail:function(e){return e.userProfile.userEmail||""},inSearching:function(e){return e.search.inSearching},searchFiltersOptions:function(e){return e.search.searchFiltersOptions}})),{},{defaultOptions:function(){return[{id:"hasAttachment",label:this.$t("search.hasAttachment"),zmTa:"inbox-search-attachment"},{id:"starred",label:this.$t("search.starred"),zmTa:"inbox-search-starred"},{id:"fromMe",label:this.$t("search.fromMe"),zmTa:"inbox-search-from-me"},{id:"last7days",label:this.$t("time.lastSomeDays",[7]),zmTa:"inbox-search-last7days"}]},filters:function(){return this.options.length?this.options:this.defaultOptions}}),watch:{value:function(e){this.modelValue=(0,f.Z)(e)}},mounted:function(){this.modelValue=(0,f.Z)(this.value)},methods:(0,l.Z)((0,l.Z)({},(0,h.OI)("search",["updateSearchFiltersOptions"])),{},{debouncedClickSearchQuickFilters:(0,Ct.debounce)((function(e){var t=this;"input"===e.target.localName&&this.inSearching&&(console.debug("debouncedClickSearchQuickFilters"),setTimeout((function(){console.debug("trigger",t.value),t.$emit("trigger",t.value)})))}),500,{leading:!0,trailing:!0}),update:function(){var e=(0,f.Z)(this.value);if(this.searchFiltersOptions.isStarred)!e.includes("starred")&&e.push("starred");else{var t=e.indexOf("starred");t>=0&&e.splice(t,1)}if(this.searchFiltersOptions.hasAttachment)!e.includes("hasAttachment")&&e.push("hasAttachment");else{var i=e.indexOf("hasAttachment");i>=0&&e.splice(i,1)}if(1===this.searchFiltersOptions.from.length&&this.searchFiltersOptions.from.includes(this.userEmail))!e.includes("fromMe")&&e.push("fromMe");else{var n=e.indexOf("fromMe");n>=0&&e.splice(n,1)}if(this.searchFiltersOptions.dateRange&&Array.isArray(this.searchFiltersOptions.dateRange)&&2===this.searchFiltersOptions.dateRange.length){var a=(0,o.Z)(this.searchFiltersOptions.dateRange,2),s=a[0],r=a[1],l=Bt.ou.fromJSDate(s),c=Bt.ou.fromJSDate(r);if(c.hasSame(l.plus({days:7}),"day")&&c.hasSame(Bt.ou.now(),"day"))!e.includes("last7days")&&e.push("last7days");else{var d=e.indexOf("last7days");d>=0&&e.splice(d,1)}}else{var u=e.indexOf("last7days");u>=0&&e.splice(u,1)}this.$emit("change",e)},apply:function(){this.updateSearchFiltersOptions({isStarred:this.value.includes("starred"),hasAttachment:this.value.includes("hasAttachment")}),this.value.includes("fromMe")&&this.userEmail&&this.updateSearchFiltersOptions({from:[this.userEmail]}),this.value.includes("last7days")&&this.updateSearchFiltersOptions({dateRange:[Bt.ou.utc().minus({days:7}).set({hour:0,minute:0,seconds:0,milliseconds:0}).toJSDate(),Bt.ou.utc().set({hour:0,minute:0,seconds:0,milliseconds:0}).toJSDate()]})},clear:function(){this.$emit("change",[])},updateValue:function(){console.debug("SearchQuickFilters updateValue",this.modelValue),this.$emit("change",this.modelValue)}})},En=Tn,$n=(0,E.Z)(En,_n,Dn,!1,null,"412d8fff",null),An=$n.exports,Rn=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"recent-searches-title",attrs:{"aria-label":e.$t("search.recentSearches")}},[e._v(" "+e._s(e.$t("search.recentSearches"))+" "),t("zm-button",{directives:[{name:"show",rawName:"v-show",value:e.recentSearchKeywords.length>0,expression:"recentSearchKeywords.length > 0"}],attrs:{ghost:"","zm-ta":"inbox-search-clear-all","aria-label":e.$t("search.clearRecents")},on:{click:function(t){return t.preventDefault(),e.handleClearHistory.apply(null,arguments)}}},[e._v(" "+e._s(e.$t("operation.clear"))+" ")])],1),0===e.recentSearchKeywords.length?t("div",{staticClass:"no-recent-searches",attrs:{tabindex:"0"}},[t("div",{staticClass:"no-recent-searches-image"},[t("img",{attrs:{src:i(99391),alt:e.$t("search.noSearchHistory"),draggable:"false"}})]),t("div",{staticClass:"no-recent-searches-text"},[e._v(" "+e._s(e.$t("search.noSearchHistory"))+" ")])]):e._e(),e._l(e.recentSearchKeywords,(function(i,n){return t("div",{key:i.id,ref:i.id,refInFor:!0,staticClass:"recent-item-container tab-focus",attrs:{"zm-ta":"inbox-search-recent-history-item-"+i.id,tabindex:0===n?"0":"-1","aria-label":"'".concat(i.keyword,"'")},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.handleRecentClick(i)},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleRecentClick(i)},function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.stopPropagation(),t.preventDefault(),e.selectDown(e.recentSearchKeywords.indexOf(i))},function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.stopPropagation(),t.preventDefault(),e.selectUp(e.recentSearchKeywords.indexOf(i))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"right",39,t.key,["Right","ArrowRight"])||"button"in t&&2!==t.button?null:(t.stopPropagation(),t.preventDefault(),void e.$refs["clear-"+i.id][0].focus())}]}},[t("div",{staticClass:"recent-item-left"},[t("svg-icon",{attrs:{iconClass:"recent-search"}}),t("span",{staticClass:"recent-item-text"},[e._v(e._s(i.keyword))]),t("zm-tag",{directives:[{name:"show",rawName:"v-show",value:i.labelName,expression:"item.labelName"}],staticClass:"recent-item__label",attrs:{type:"info"}},[e._v(" "+e._s(e.$t("filter.in"))+": "+e._s(i.labelName)+" ")])],1),t("span",{ref:"clear-"+i.id,refInFor:!0,staticClass:"recent-item__close tab-focus",attrs:{tabindex:"-1","aria-label":e.$t("search.clearRecentItem",[i.keyword]),role:"button"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.handleClearRecentItem(i)},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.stopPropagation(),t.preventDefault(),e.handleClearRecentItem(i))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:(t.stopPropagation(),t.preventDefault(),void e.$refs[i.id][0].focus())}]}},[t("svg-icon",{staticClass:"recent-item__close__icon",attrs:{iconClass:"close"}})],1)])}))],2)},Zn=[],On={name:"RecentSearchList",computed:(0,l.Z)({},(0,h.Se)("search",["recentSearchKeywords"])),methods:(0,l.Z)((0,l.Z)({},(0,h.OI)("search",["removeRecentSearchKeyword","clearAllRecentSearchKeywords"])),{},{selectDown:function(e){e+1>this.recentSearchKeywords.length-1||this.$refs[this.recentSearchKeywords[e+1]][0].focus()},selectUp:function(e){e<1||this.$refs[this.recentSearchKeywords[e-1]][0].focus()},handleClearRecentItem:function(e){this.removeRecentSearchKeyword(e)},handleClearHistory:function(){this.clearAllRecentSearchKeywords()},handleRecentClick:function(e){this.$emit("select",e)}})},zn=On,Nn=(0,E.Z)(zn,Rn,Zn,!1,null,"986265be",null),Pn=Nn.exports,Fn=function(){var e=this,t=e._self._c;return t("section",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"search-suggestion"},[e._l(e.contacts,(function(i,n){return t("div",{key:i.value,staticClass:"search-suggestion__item",attrs:{id:"suggestion-".concat(n),tabindex:"-1","aria-label":e.getContactAriaLabel(i)},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.stopPropagation(),t.preventDefault(),e.focusOnNext.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.stopPropagation(),t.preventDefault(),e.focusOnPrev.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.stopPropagation(),t.preventDefault(),e.quickSearch(i.value))}],click:function(t){return e.quickSearch(i.value)}}},[t("div",{staticClass:"search-suggestion__item__wrapper"},[t("div",{staticClass:"search-suggestion__item__icon",style:{marginRight:"12px"}},[t("avatar",{staticClass:"search-suggestion__item__icon__avatar",attrs:{email:i.value,name:i.displayName,tabindex:"-1"}})],1),i.contactNameHighlight?[t("div",{staticClass:"search-suggestion__item__container"},[t("div",{staticClass:"search-suggestion__item__text",domProps:{innerHTML:e._s(i.contactNameHighlight)}}),t("div",{staticClass:"search-suggestion__item__subtext",domProps:{innerHTML:e._s(i.contactAddressHighlight)}})])]:[t("div",{staticClass:"search-suggestion__item__container"},[t("div",{staticClass:"search-suggestion__item__text",domProps:{innerHTML:e._s(i.contactAddressHighlight)}})])]],2)])})),t("div",{directives:[{name:"show",rawName:"v-show",value:e.contacts.length,expression:"contacts.length"}],staticClass:"search-suggestion__divider"}),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.contents.length&&e.keyword.length,expression:"!contents.length && keyword.length"}],staticClass:"search-suggestion__item"},[t("div",{staticClass:"search-suggestion__item__container"},[t("div",{staticClass:"search-suggestion__item__subtext"},[e._v(e._s(e.$t("search.noRecentMatchedItems")))])])]),e._l(e.contents,(function(i,n){return t("div",{key:i.mailId,staticClass:"search-suggestion__item",attrs:{id:"suggestion-".concat(n+e.contacts.length),tabindex:"-1","aria-label":e.getContentAriaLabel(i)},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.stopPropagation(),t.preventDefault(),e.focusOnNext.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.stopPropagation(),t.preventDefault(),e.focusOnPrev.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.stopPropagation(),t.preventDefault(),e.redirectToThread(i.mailId,i.data))}],click:function(t){return e.redirectToThread(i.mailId,i.data)}}},[t("div",{staticClass:"search-suggestion__item__wrapper"},[t("div",{staticClass:"search-suggestion__item__icon",style:{marginRight:"12px"}},[t("svg-icon",{attrs:{"aria-hidden":"true",iconClass:"mail"}})],1),t("div",{staticClass:"search-suggestion__item__container",style:{width:"auto"}},[t("div",{staticClass:"search-suggestion__item__text",domProps:{innerHTML:e._s(i.subject)}}),t("div",{staticClass:"search-suggestion__item__subtext",domProps:{innerHTML:e._s(i.snippet)}})]),i.hasAttachments?t("div",{staticClass:"search-suggestion__item__icon search-suggestion__item__icon--attachment",style:{marginLeft:"6px"}},[t("svg-icon",{attrs:{"aria-hidden":"true",iconClass:"clip"}})],1):e._e(),t("span",{staticClass:"search-suggestion__item__date"},[e._v(e._s(e.formatDate(i.date)))])])])}))],2)},Vn=[],Hn=d.Enums.SystemDefinedMailLabelIds,Bn=2,Un=5,jn=864e5,Wn={name:"SearchSuggestion",components:{Avatar:Gt.Z,SvgIcon:I.Z},props:{keyword:{type:String,required:!0},selectedSearchFilters:{type:Array,required:!0},disabled:{type:Boolean,default:!1}},data:function(){return{focusIndex:-1,recentJsCallId:"",onceContentSearch:{hash:"",localSearchDone:!0,remoteSearchDone:!0},contentSearchResults:[]}},computed:(0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)({contactSearches:function(e){return e.contactSearches},userEmail:function(e){return e.userProfile.userEmail||""},userTimeZone:function(e){return e.userProfile.userTimeZone}})),(0,h.Se)(["isOutlook","isGmail","isZmail"])),{},{lastKeyWord:function(e){var t=e.keyword;return t.split(",").pop().trim()},restKeyWord:function(e){var t=e.keyword,i=t.split(",");return i.pop(),i.join(",").trim()},visible:function(e){var t=e.keyword;return!!t},contacts:function(e){var t=e.recentJsCallId,i=e.keyword,n=e.contactSearches,a=e.lastKeyWord;if(!t||!i||null===n||void 0===n||!n[t])return[];var s=new RegExp((0,_t.hr)(a),"gi"),r=n[t];this.combinedKeyword=(0,_t.a1)([a]).join(",");var o=r.searchResults.reduce((function(e,t){var i=t.email,n=t.displayName;return e.push({value:i.toLowerCase(),displayName:n,contactAddressHighlight:d.Utils.sanitizeHTML2String(i).trim().replace(s,(function(e){return'<span style="color: #0E72ED">'.concat(e,"</span>")})),contactNameHighlight:d.Utils.sanitizeHTML2String(n).trim().replace(s,(function(e){return'<span style="color: #0E72ED">'.concat(e,"</span>")}))}),e}),[]);return o.slice(0,Bn)},contents:function(e){var t=this,i=e.keyword,n=e.contentSearchResults,a=new RegExp((0,_t.hr)(i),"gi"),s=n.reduce((function(e,i){return e.push({labelId:i.labelId,mailId:i.mailId,date:i.mailHead.date,hasAttachments:i.mailHead.hasAttachment,subject:i.mailHead.subject?i.mailHead.subject.trim().replace(a,(function(e){return'<span style="color: #0E72ED">'.concat(e,"</span>")})):d.Utils.sanitizeHTML2String(t.$t("common.noSubject")),snippet:i.mailHead.snippet?(0,_t.X4)(i.mailHead.snippet).trim().replace(a,(function(e){return'<span style="color: #0E72ED">'.concat(e,"</span>")})):d.Utils.sanitizeHTML2String(t.$t("common.noSnippet")),data:i}),e}),[]);return s.slice(0,Un)}}),watch:{focusIndex:{handler:function(){this.focusOn()},immediate:!0},lastKeyWord:{handler:function(e,t){e!==t&&this.getContactSearchSuggestion()},immediate:!0},keyword:{handler:function(e,t){e!==t&&(this.resetFocus(),e?this.debouncedSearchSuggestion():this.clearSearchSuggestion())},immediate:!0},selectedSearchFilters:{handler:function(e,t){e!==t&&(this.resetFocus(),this.contentSearchResults=[],this.debouncedSearchSuggestion())},deep:!0}},beforeDestroy:function(){this.cancelPreviousSearch()},methods:(0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.OI)(["clearStaleContactSearch","listenForSearchCallbacks"])),(0,h.nv)(["getAllMailHead"])),{},{focusOn:function(){var e=this;console.log("focusOn",this.focusIndex),this.$nextTick((function(){var t;null===(t=document.getElementById("suggestion-".concat(e.focusIndex)))||void 0===t||t.focus()}))},focusOnFirst:function(){this.focusIndex=0},focusOnPrev:function(){document.body.classList.remove("using-mouse"),this.focusIndex<0?this.focusIndex=0:(this.focusIndex=this.focusIndex-1,this.focusIndex<0&&(this.focusIndex=this.contacts.length+this.contents.length-1))},focusOnNext:function(){document.body.classList.remove("using-mouse"),this.focusIndex<0?this.focusIndex=0:(this.focusIndex=this.focusIndex+1,this.focusIndex>=this.contacts.length+this.contents.length&&(this.focusIndex=0))},resetFocus:function(){this.focusIndex=-1},clearSearchSuggestion:function(){this.resetFocus(),this.recentJsCallId&&this.clearStaleContactSearch(this.recentJsCallId),this.contentSearchResults=[]},getContactSearchSuggestion:function(){var e=this;if(!this.lastKeyWord)return this.clearStaleContactSearch(this.recentJsCallId),void(this.recentJsCallId="");u.Setting.getRecentContacts({keyword:this.lastKeyWord}).then((function(t){0===t.errorCode&&(e.clearStaleContactSearch(e.recentJsCallId),e.listenForSearchCallbacks({jsCallId:t.data.jsCallId,result:t.data,isResultUpdated:!1}),e.recentJsCallId=t.data.jsCallId)}))},getContentSearchSuggestion:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){var i,n,a;return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.keyword){t.next=2;break}return t.abrupt("return");case 2:return e.cancelPreviousSearch(),i=function(){var t=(0,r.Z)((0,s.Z)().mark((function t(i){var n,a,r;return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.onceContentSearch.hash===e.keyword.trim()){t.next=2;break}return t.abrupt("return");case 2:if(n=i.labelId,a=i.mailIds,r=i.isLocalSearch,r?e.onceContentSearch.localSearchDone=!0:e.onceContentSearch.remoteSearchDone=!0,a&&0!==a.length){t.next=7;break}return r&&(e.contentSearchResults=[]),t.abrupt("return");case 7:e.getAllMailHead({labelId:n,mailIds:a,updateStore:!1,onProgress:function(t){e.onceContentSearch.hash===e.keyword.trim()&&t.forEach((function(t){var i=!e.isZmail||d.Utils.isDecrypted(t.decryptionStatus);i||(t.subject=e.$t("operation.emailLocked"),t.snippet=e.$t(d.Utils.getDecryptErrorInfo(t.originalCode).wording));var n=e.contentSearchResults.findIndex((function(e){return e.mailId===t.mailId})),a={labelId:Hn.INBOX,mailHead:t,msgIds:t.msgIds,mailId:t.mailId};n<0?e.contentSearchResults.push(a):e.contentSearchResults[n]=a}))}});case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.curSearchAction=d.Hooks.useSearchAction({onSuccess:i}),n=new Date,n.setTime(n.getTime()-7*jn),t.next=9,e.curSearchAction.search({keyword:e.keyword,count:Un,inSpamTrash:!1,isSearchSuggestion:!0,advSearch:{inLabelId:Hn.INBOX,isStarred:e.selectedSearchFilters.includes("starred"),hasAttach:e.selectedSearchFilters.includes("hasAttachment"),from:e.selectedSearchFilters.includes("fromMe")?[e.userEmail]:[],dateBegin:e.selectedSearchFilters.includes("last7days")?Bt.ou.fromJSDate(n).set({hour:0,minute:0,seconds:0,milliseconds:0}).toISO({suppressMilliseconds:!0}):"",dateEnd:e.selectedSearchFilters.includes("last7days")?Bt.ou.now().set({hour:0,minute:0,seconds:0,milliseconds:0}).toISO({suppressMilliseconds:!0}):""},searchFromBeginning:!0});case 9:a=t.sent,a||(e.contentSearchResults=[]),e.onceContentSearch.hash=e.keyword.trim(),e.onceContentSearch.localSearchDone=!1,e.onceContentSearch.remoteSearchDone=!1;case 14:case"end":return t.stop()}}),t)})))()},cancelPreviousSearch:function(){var e;console.log("[Suggestion] cancelPreviousSearch"),null===(e=this.curSearchAction)||void 0===e||e.destroy(),this.curSearchAction=null},getAttachmentSearchSuggestion:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.keyword){t.next=2;break}return t.abrupt("return");case 2:case"end":return t.stop()}}),t)})))()},debouncedSearchSuggestion:(0,Ct.debounce)((function(){this.getContentSearchSuggestion(),this.getAttachmentSearchSuggestion()}),500,{leading:!0,trailing:!0}),quickSearch:function(e){if(e){var t=this.lastKeyWord!==this.keyword.trim();this.$emit("quickSearch",t?"".concat(this.restKeyWord,",").concat(e):e)}},redirectToThread:function(e,t){t.labelId=Hn.INBOX,this.$emit("redirect",{mailId:e,mailHead:t})},formatDate:function(e){var t=Bt.ou.fromSeconds(e);return Bt.ou.now().hasSame(t,"day")?t.setZone(this.userTimeZone).toLocaleString(Bt.ou.TIME_SIMPLE):Bt.ou.now().hasSame(t.plus({days:1}),"day")?this.$t("time.yesterday"):Bt.ou.now().hasSame(t,"year")?t.setZone(this.userTimeZone).toFormat("LLL d"):t.setZone(this.userTimeZone).toLocaleString(Bt.ou.DATE_SHORT)},getContactAriaLabel:function(e){return e.displayName?"".concat(this.$t("accessibility.searchFor"),", ").concat(e.displayName,", ").concat(e.value):"".concat(this.$t("accessibility.searchFor"),", ").concat(e.value)},getContentAriaLabel:function(e){return"".concat(this.$t("accessibility.searchFor"),", ").concat(e.subject,", ").concat(e.snippet)}})},Kn=Wn,Yn=(0,E.Z)(Kn,Fn,Vn,!1,null,"0f2b7d1d",null),Xn=Yn.exports,Gn=function(){var e=this,t=e._self._c;return t("zm-dialog",{staticClass:"advanced-search-options",attrs:{modal:"","modal-append-to-body":"","append-to-body":"","lock-scroll":"","close-on-press-escape":!1,visible:e.visible,width:"540px"}},[t("zm-form",{ref:"formRef",attrs:{model:e.advSearchOptions,rules:e.rules,"label-width":"90px","label-position":"top"},on:{submit:function(e){e.preventDefault()}}},[t("zm-form-item",{attrs:{label:e.$t("filter.searchIn"),prop:"inLabelId"}},[t("zm-select",{style:{width:"100%"},attrs:{filterLabel:e.getSelectorDisplayValue,"popper-class":"advance-search-options-label-select"},on:{change:e.handleOptionsChange},model:{value:e.advSearchOptions.inLabelId,callback:function(t){e.$set(e.advSearchOptions,"inLabelId",t)},expression:"advSearchOptions.inLabelId"}},[t("RecycleScroller",{staticClass:"label-select-virtual-list",attrs:{items:e.searchInLabelOptions,"size-field":"height","key-field":"value","simple-array":!1},scopedSlots:e._u([{key:"default",fn:function(e){var i=e.item;return[i.divided?t("div",{staticClass:"label-select-option-divider"},[t("div",{staticClass:"line"})]):t("zm-option",{attrs:{label:i.name,value:i.value}})]}}])})],1)],1),t("zm-form-item",{attrs:{label:e.$t("filter.from"),prop:"from"}},[t("contacts-selector",{staticClass:"advanced-search-options__input",attrs:{value:e.advSearchOptions.from,placeholder:e.$t("search.searchUserName")},on:{change:e.handleFromChanged}})],1),t("zm-form-item",{attrs:{label:e.$t("filter.to"),prop:"to"}},[t("contacts-selector",{staticClass:"advanced-search-options__input",attrs:{value:e.advSearchOptions.to,placeholder:e.$t("search.searchUserName")},on:{change:e.handleToChanged}})],1),t("zm-form-item",{attrs:{label:e.$t("filter.subject"),prop:"subject"}},[t("zm-input",{on:{change:e.handleOptionsChange},model:{value:e.advSearchOptions.subject,callback:function(t){e.$set(e.advSearchOptions,"subject",t)},expression:"advSearchOptions.subject"}})],1),t("zm-form-item",{attrs:{label:e.$t("filter.keywords"),prop:"keywords"}},[t("zm-input",{on:{change:e.handleOptionsChange},model:{value:e.advSearchOptions.keywords,callback:function(t){e.$set(e.advSearchOptions,"keywords",t)},expression:"advSearchOptions.keywords"}})],1),t("zm-form-item",{attrs:{label:e.$t("filter.date"),prop:"dateRange"}},[t("zm-date-picker",{staticClass:"advanced-search-options__datepicker",style:{width:"100%"},attrs:{"popper-class":"advanced-search-options__datepicker__panel",type:"daterange",align:"right","range-separator":e.$t("filter.to"),"start-placeholder":e.$t("search.startDate"),"end-placeholder":e.$t("search.endDate"),"picker-options":e.datePickerOptions,clearable:""},model:{value:e.advSearchOptions.dateRange,callback:function(t){e.$set(e.advSearchOptions,"dateRange",t)},expression:"advSearchOptions.dateRange"}})],1),e.showCacheMailTip&&e.isEncryptedZmail?t("div",{staticClass:"cache-mail-remind-tip"},[e._v(" "+e._s(e.$t("search.searchLimited"))+" ")]):e._e(),t("zm-form-item",{attrs:{label:e.$t("filter.readStatus"),prop:"readStatus"}},[t("zm-select",{style:{width:"100%"},on:{change:e.handleOptionsChange},model:{value:e.advSearchOptions.readStatus,callback:function(t){e.$set(e.advSearchOptions,"readStatus",t)},expression:"advSearchOptions.readStatus"}},e._l(e.readStatusOptions,(function(e){return t("zm-option",{key:e.value,attrs:{"option-id":e.value,label:e.name,value:e.value}})})),1)],1),t("zm-form-item",{style:{marginTop:"6px"},attrs:{prop:"hasAttachment"}},[t("zm-row",[t("zm-col",{attrs:{span:12}},[t("zm-checkbox",{attrs:{label:e.$t("search.starred"),name:"type"},model:{value:e.advSearchOptions.isStarred,callback:function(t){e.$set(e.advSearchOptions,"isStarred",t)},expression:"advSearchOptions.isStarred"}})],1),t("zm-col",{attrs:{span:12}},[t("zm-checkbox",{attrs:{label:e.$t("filter.hasAttachment"),name:"type"},model:{value:e.advSearchOptions.hasAttachment,callback:function(t){e.$set(e.advSearchOptions,"hasAttachment",t)},expression:"advSearchOptions.hasAttachment"}})],1)],1)],1)],1),t("span",{staticClass:"advanced-search-options__footer",attrs:{slot:"footer"},slot:"footer"},[t("zm-button",{staticClass:"advanced-search-options__footer__clear",attrs:{type:"primary",ghost:""},on:{click:e.clear}},[e._v(" "+e._s(e.$t("filter.clearFilters"))+" ")]),t("zm-button",{attrs:{type:"primary"},on:{click:e.submit}},[e._v(" "+e._s(e.$t("search.search"))+" ")]),t("zm-button",{on:{click:e.cancel}},[e._v(" "+e._s(e.$t("externalImage.cancel"))+" ")])],1)],1)},qn=[],Jn=i(91866),Qn=i(70607),ea=i(11995),ta=864e5,ia={name:"AdvancedSearchOptions",components:{ContactsSelector:Qn.Z,RecycleScroller:Tt.EK},data:function(){return{visible:!1,advSearchOptions:(0,Jn.Id)().searchFiltersOptions,rules:{}}},computed:(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)({searchFiltersOptions:function(e){return e.search.searchFiltersOptions},oldestMsgDateDone:function(e){return e.search.oldestMsgDateDone}})),(0,h.Se)(["isOutlook","isEncryptedZmail"])),(0,h.Se)("search",["searchInLabelOptions"])),{},{showCacheMailTip:function(){var e=this.advSearchOptions.subject||this.advSearchOptions.keywords;if(!this.advSearchOptions.dateRange)return!1;if(!this.oldestMsgDateDone)return!0;var t=(0,o.Z)(this.advSearchOptions.dateRange,1),i=t[0],n=new Date(i).getTime();return e&&n<this.oldestMsgDateDone},readStatusOptions:function(){return[{name:this.$t("filter.all"),value:"all"},{name:this.$t("select.unread"),value:"unread"}]},datePickerOptions:function(){return{disabledDate:function(e){return e.getTime()-1*Number(ta)>Date.now()},shortcuts:[{text:this.$t("time.today"),onClick:function(e){var t=new Date,i=new Date;t.setTime(t.getTime()+1*Number(ta)),e.$emit("pick",[i,t])}},{text:this.$t("time.lastSomeDays",[7]),onClick:function(e){var t=new Date,i=new Date;i.setTime(i.getTime()-7*ta),e.$emit("pick",[i,t])}},{text:this.$t("time.lastSomeDays",[30]),onClick:function(e){var t=new Date,i=new Date;i.setTime(i.getTime()-30*ta),e.$emit("pick",[i,t])}},{text:this.$t("time.lastSomeMonths",[6]),onClick:function(e){var t=new Date,i=new Date;i.setTime(i.getTime()-180*ta),e.$emit("pick",[i,t])}},{text:this.$t("time.lastYear"),onClick:function(e){var t=new Date,i=new Date;i.setTime(i.getTime()-365*ta),e.$emit("pick",[i,t])}}]}}}),methods:(0,l.Z)((0,l.Z)({},(0,h.OI)("search",["updateSearchFiltersOptions","clearSearchFiltersOptions"])),{},{open:function(e){var t=e.keywords;this.advSearchOptions.keywords=t,this.advSearchOptions=(0,Ct.cloneDeep)(this.searchFiltersOptions),this.visible=!0},close:function(){this.visible=!1},clear:function(){this.advSearchOptions=this.$options.data.call(this).advSearchOptions,this.clearSearchFiltersOptions()},cancel:function(){this.close()},handleOptionsChange:function(){this.$emit("change",this.advSearchOptions)},handleFromChanged:function(e){this.advSearchOptions.from=e,this.handleOptionsChange()},handleToChanged:function(e){this.advSearchOptions.to=e,this.handleOptionsChange()},submit:function(){this.advSearchOptions.keywords=this.advSearchOptions.keywords.trim(),this.advSearchOptions.subject=this.advSearchOptions.subject.trim();var e=(0,ea.L8)(this.advSearchOptions,this.$options.data.call(this).advSearchOptions);if(console.debug("advanced search submit",this.advSearchOptions,this.$options.data.call(this).advSearchOptions,e),!e)return this.close(),this.$toast(this.$t("search.invalidSearchQuery"),{duration:5e3}),void this.$emit("error");this.updateSearchFiltersOptions(this.advSearchOptions),this.$emit("submit",this.advSearchOptions),this.close()},getSelectorDisplayValue:function(e,t){var i;return(null===(i=this.searchInLabelOptions.find((function(e){return e.value===t})))||void 0===i?void 0:i.name)||e}})},na=ia,aa=(0,E.Z)(na,Gn,qn,!1,null,"74d8f76e",null),sa=aa.exports,ra=d.Enums.SystemDefinedMailLabelIds,oa=d.Enums.SettingConfigField,la=d.Enums.DECRYPTION_STATUS,ca=20,da={name:"Search",components:{SearchQuickFilters:An,RecentSearchList:Pn,SearchSuggestion:Xn,AdvancedSearchOptions:sa,RecycleScroller:Tt.EK},inject:["isMailListViewportFilled","isMailListScrollToEnd"],data:function(){return{searchPopoverVisible:!1,isSearchInputFocused:!1,isSearchLabelSelectFocused:!1,tooltipVisible:!1,tempSelectedSearchFilters:[],userInput:"",selectedSearchLabelId:"",isComposing:!1,hasCompositionJustEnd:!1,retryQueue:[],advanceSearchIsInited:!1}},computed:(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)({userEmail:function(e){return e.userProfile.userEmail||""},selectedMailLabel:function(e){return e.selectMailLabel},selectPrevLabel:function(e){return e.selectPrevLabel},allLabels:function(e){return e.allLabels},maxNumberMailsPerRequest:function(e){return e.maxNumberMailsPerRequest},isMailBetaFeatureEnabled:function(e){return e.auth.isMailBetaFeatureEnabled},selectedSearchFilters:function(e){return e.search.selectedSearchFilters},currentSearchLabelId:function(e){return e.search.currentSearchLabelId},curSearchHash:function(e){return e.search.curSearchHash},searchString:function(e){return e.search.searchString},inSearching:function(e){return e.search.inSearching},inFilters:function(e){return e.search.inFilters},searchFiltersOptions:function(e){return e.search.searchFiltersOptions},minUserLabelCountForVirtualList:function(e){return e.minUserLabelCountForVirtualList},showDetail:function(e){return e.showDetail},isSplitView:function(e){return e.isSplitView},currentInboxItemMailId:function(e){return e.currentInboxItemMailId},detailSearchPattern:function(e){return e.detail.detailSearchPattern},detailSearchResults:function(e){return e.detail.detailSearchResults}})),(0,h.Se)(["isOutlook"])),(0,h.Se)("search",["systemLabels","userLabels","recentSearchKeywords","advancedSearchEnabled","forbiddenLabels","searchInLabelOptions"])),(0,h.Se)("inbox",["isLabelLoading","isLabelReachLastPage"])),(0,h.Se)("detail",["detailSearchEnabled"])),{},{isNotInSearchMode:function(){var e;return"inbox"!==this.$route.name||"inbox"===this.$route.name&&!x.Z.isLocalSearch(null===(e=this.$route.params)||void 0===e?void 0:e.id)},searchLabelSelectVisible:function(e){var t=e.selectedSearchLabelId,i=e.userInput,n=e.isSearchInputFocused,a=e.isSearchLabelSelectFocused,s=e.searchPopoverVisible;return!!t||(n||a||s||i.length>0)},quickFiltersVisible:function(e){var t=e.userInput;return t.length>0},viewSearchResultTip:function(e){var t=e.tempSelectedSearchFilters,i=this.$t("search.viewAll");return t.length>0?i.concat(" ",this.$tc("search.andSomeFilters",t.length,[t.length])):i},isSearchInDetailSelected:function(e){var t=e.selectedSearchLabelId;return t===ea.jp}}),watch:{userInput:function(e,t){var i,n=e.trim();n&&n!==t.trim()&&this.isSearchInputFocused&&!this.searchPopoverVisible&&(this.searchPopoverVisible=!0),null===(i=this.$refs.popover)||void 0===i||i.refreshAria()},selectedMailLabel:function(e){var t,i,n=null===e||void 0===e?void 0:e.id;x.Z.isLocalSearch(n)||(this.cancelPreviousSearch(),this.setLabelLoadingState({labelId:ra.SEARCH,flag:!1}),this.exitDetailSearch(),this.$store.commit("clearSearchResults"),null===(t=this.$refs.searchQuickFiltersRef)||void 0===t||t.clear(),null===(i=this.$refs.advancedSearchOptionsRef)||void 0===i||i.clear(),this.updateSelectedSearchLabelId(),this.handleSearchLabelChange(),this.changeInSearchBox(!1),this.clearCurrentSearchLabelId(),this.clearAdvSearchStatus(),this.searchPopoverVisible=!1,this.setSearchString(""),this.userInput="")},currentInboxItemMailId:function(){this.detailSearchEnabled&&(this.userInput=""),this.exitDetailSearch()},showDetail:function(e){var t=this;e&&this.isSplitView||(e&&(this.selectedSearchLabelId=ea.jp),!e&&this.updateSelectedSearchLabelId(),this.$nextTick((function(){var e;null===(e=t.$refs.searchInput)||void 0===e||e.blur(),t.searchPopoverVisible=!1})))},recentSearchKeywords:{handler:function(e){0!==e.length&&u.Setting.updateMailSetting({key:oa.SEARCH_HISTORY,value:JSON.stringify(e.slice().reverse())})},immediate:!1},searchPopoverVisible:function(e){e||this.inSearching||this.setLabelLoadingState({labelId:ra.SEARCH,flag:!1})},detailSearchEnabled:function(e){e&&this.isSearchInDetailSelected?this.userInput=this.detailSearchPattern:this.userInput=this.searchString}},created:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){var i,n;return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,u.Setting.getMailSetting({key:oa.SEARCH_HISTORY});case 2:if(i=t.sent,!i){t.next=14;break}if(t.prev=4,n=JSON.parse(i),Array.isArray(n)){t.next=8;break}return t.abrupt("return");case 8:n.forEach((function(t){var i="string"===typeof t?{labelId:"",labelName:"",keyword:t}:t;e.addRecentSearchKeyword(i)})),t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](4),console.error(t.t0);case 14:e.updateSelectedSearchLabelId(),e.handleSearchLabelChange();case 16:case"end":return t.stop()}}),t,null,[[4,11]])})))()},mounted:function(){var e,t,i,n,a,s;this.userInput=this.trimWithSpace(this.searchString),null===(e=this.$refs.searchInput)||void 0===e||null===(t=e.$el)||void 0===t||t.addEventListener("compositionstart",this.handleCompositionStart),null===(i=this.$refs.searchInput)||void 0===i||null===(n=i.$el)||void 0===n||n.addEventListener("compositionend",this.handleCompositionEnd),null===(a=this.$refs.searchInput)||void 0===a||null===(s=a.$el)||void 0===s||s.addEventListener("keydown",this.handleKeydown),this.addInboxListener()},beforeDestroy:function(){var e,t,i,n,a,s;null===(e=this.$refs.searchInput)||void 0===e||null===(t=e.$el)||void 0===t||t.removeEventListener("compositionstart",this.handleCompositionStart),null===(i=this.$refs.searchInput)||void 0===i||null===(n=i.$el)||void 0===n||n.removeEventListener("compositionend",this.handleCompositionEnd),null===(a=this.$refs.searchInput)||void 0===a||null===(s=a.$el)||void 0===s||s.removeEventListener("keydown",this.handleKeydown)},methods:(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.OI)(["clearSplitViewSelectedMail"])),(0,h.OI)("inbox",["setLabelLoadingState","updateLastPageFlag"])),(0,h.OI)("search",["setCurSearchHash","setSearchString","changeInSearchBox","addRecentSearchKeyword","updateSearchFiltersOptions","clearSearchFiltersOptions"])),(0,h.nv)("search",["updateSelectedSearchFilters","setCurrentSearchLabelId","clearCurrentSearchLabelId"])),(0,h.nv)("inbox",["clearSelectedInboxMailIds"])),(0,h.nv)("detail",["searchInDetail","exitDetailSearch"])),(0,h.nv)(["getAllMailHead"])),{},{focusOnFirst:function(){var e;console.log("focusOnFirst"),(null===(e=this.$refs)||void 0===e?void 0:e.searchSuggestionRef)&&this.$refs.searchSuggestionRef.focusOnFirst()},closePopover:function(){this.searchPopoverVisible=!1},useAdvancedSearchOptions:function(){var e,t=this;this.tooltipVisible=!1,this.searchPopoverVisible=!1,this.advanceSearchIsInited||(this.advanceSearchIsInited=!0,this.$nextTick((function(){var e;null===(e=t.$refs.advancedSearchOptionsRef)||void 0===e||e.open({keywords:t.userInput})}))),null===(e=this.$refs.advancedSearchOptionsRef)||void 0===e||e.open({keywords:this.userInput})},handleAdvancedSearchSubmitted:function(e){console.debug("handleAdvancedSearchSubmitted",e),this.cancelPreviousSearch(),this.userInput=e.keywords,this.selectedSearchLabelId=e.inLabelId,this.handleSubmit(!0,{advSearchOptions:(0,ea.DB)(e)})},onClickSearchInput:function(){var e=this;this.isSearchInputFocused=!0,setTimeout((function(){e.searchPopoverVisible=!0}))},updateSelectedSearchLabelId:function(){var e,t=this,i=x.Z.isLocalSearch(this.selectedMailLabel.id);if(i)this.selectedSearchLabelId=this.currentSearchLabelId;else{var n=[ra.INBOX,ra.CATEGORY_PERSONAL,ra.CATEGORY_SOCIAL],a=n.includes(this.selectedMailLabel.id),s=this.forbiddenLabels.includes(this.selectedMailLabel.id),r=this.selectedMailLabel.labelDecryptionStatus===la.FAILED;this.selectedSearchLabelId=a||s||r?"":this.selectedMailLabel.id,null===(e=this.$refs.searchLabelSelectRef)||void 0===e||e.focus(),this.$nextTick((function(){var e;null===(e=t.$refs.searchLabelSelectRef)||void 0===e||e.blur()}))}},handleSearchLabelSelectVisibleChange:function(e){var t=this;e&&(this.searchPopoverVisible=!1),!e&&setTimeout((function(){var e;return null===(e=t.$refs.searchInput)||void 0===e?void 0:e.focus()}))},handleSearchLabelChange:function(){console.debug("handleSearchLabelChange",this.selectedSearchLabelId),this.updateSearchFiltersOptions({inLabelId:this.selectedSearchLabelId})},handleSearchInputFocused:function(){this.isSearchInputFocused=!0},handleSearchInputBlurred:function(){var e=this;setTimeout((function(){e.isSearchInputFocused=!1}),200)},handleUpdateSearchQuickFilters:function(e){this.tempSelectedSearchFilters=e,this.searchPopoverVisible&&this.$refs.searchInput.focus()},handleCompositionStart:function(){this.isComposing=!0},handleCompositionEnd:function(){this.isComposing=!1,this.hasCompositionJustEnd=!0},handleKeydown:function(e){var t=e.keyCode||e.which;229!==t&&(this.hasCompositionJustEnd=!1)},handleClose:function(){if(this.searchPopoverVisible||(this.searchPopoverVisible=!0),this.detailSearchEnabled&&this.exitDetailSearch(),!this.isNotInSearchMode)return this.clearSearchFiltersOptions(),this.clearCurrentSearchLabelId(),void this.handleExitSearch();this.handleClearQuery()},handleClearQuery:function(){var e,t;null===(e=this.$refs.searchQuickFiltersRef)||void 0===e||e.clear(),null===(t=this.$refs.advancedSearchOptionsRef)||void 0===t||t.clear(),this.userInput="",this.$refs.searchInput.focus()},handleRecentSelection:function(e){var t=e.labelId,i=e.keyword;this.userInput=i,this.selectedSearchLabelId=t,this.handleSubmit()},handleQuickSearch:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&(this.userInput=t?this.userInput.concat(" ".concat(e)):e,this.searchPopoverVisible=!1,this.handleSubmit())},handleRedirect:function(e){e&&(this.$emit("redirect",e),this.searchPopoverVisible=!1)},trimWithSpace:function(e){return e?e.trim()+" ":""},handleSubmit:function(){var e,t,i,n,a=arguments.length>0&&void 0!==arguments[0]&&arguments[0],s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{advSearchOptions:null},r=s.advSearchOptions,o=void 0===r?null:r;this.isComposing||this.hasCompositionJustEnd?this.hasCompositionJustEnd=!1:this.isSearchInDetailSelected?this.searchInDetail(this.userInput):(this.exitDetailSearch(),a||this.advancedSearchEnabled||this.userInput&&this.userInput.trim()?(this.$store.commit("changeCurrentPage",1),o?null===(e=this.$refs.searchQuickFiltersRef)||void 0===e||e.update():null===(t=this.$refs.searchQuickFiltersRef)||void 0===t||t.apply(),this.updateSelectedSearchFilters(this.tempSelectedSearchFilters),this.$store.commit("changeShowDetail",!1),o?this.search(!0,{advSearchOptions:o}):this.search(!0,{advSearchOptions:(0,ea.DB)(this.searchFiltersOptions)}),(null===(i=this.$refs)||void 0===i?void 0:i.searchInput)&&this.$refs.searchInput.blur(),(null===(n=this.$refs)||void 0===n?void 0:n.searchLabelSelectRef)&&this.$refs.searchLabelSelectRef.blur(),this.userInput=this.trimWithSpace(this.userInput)):this.userInput="")},handleSearchArchive:function(){console.log("[Search] handleSearchArchive");var e=this.allLabels.find((function(e){return x.Z.isArchive(e.id)}));this.setLabelLoadingState({labelId:ra.SEARCH,flag:!1}),this.$store.commit("clearSearchResults"),this.changeInSearchBox(!1),this.searchPopoverVisible=!1,this.$store.commit("changeSelectMailLabel",e);var t=e.id;this.$route.params.id!==t&&this.$router.push({name:"inbox",params:{id:t}})},clearAdvSearchStatus:function(){this.tempSelectedSearchFilters=[],this.updateSelectedSearchFilters([])},getCurrentLabelId:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.selectedMailLabel.id===ra.SEARCH;if(e){var i=t?ra.INBOX:this.selectedMailLabel.id;return this.setCurrentSearchLabelId(i),i}return this.currentSearchLabelId},search:function(){var e=arguments,t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n,a,r,o,l,c;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=e.length>0&&void 0!==e[0]&&e[0],a=e.length>1&&void 0!==e[1]?e[1]:{advSearchOptions:null},r=a.advSearchOptions,o=void 0===r?null:r,console.log("[Search] searchFromBeginning ".concat(n)),!n){i.next=19;break}return t.$store.commit("clearSearchResults"),t.cancelPreviousSearch(),i.next=8,t.clearSelectedInboxMailIds();case 8:if(t.setCurSearchHash((0,wi.Z)()),t.clearSplitViewSelectedMail(),t.setSearchString(t.userInput),t.$store.commit("changeSelectMailLabel",{id:ra.SEARCH}),t.changeInSearchBox(!0),t.$store.commit("search/changeInFilters",!1),t.searchPopoverVisible=!1,l=["in:archive","is:archive","in:archived","is:archived","in:archives"],!l.includes(t.userInput.replace(" ",""))){i.next=19;break}return t.handleSearchArchive(),i.abrupt("return");case 19:return t.setLabelLoadingState({labelId:ra.SEARCH,flag:!0}),c=t.getCurrentLabelId(n),t.isNotInSearchMode&&t.$router.push({name:"inbox",params:{id:ra.SEARCH}}),i.next=24,t.getSearchResultThreadIds(t.searchString,{hash:t.curSearchHash,labelId:c,searchFromBeginning:n,advSearchOptions:n?o:(0,ea.DB)(t.searchFiltersOptions)});case 24:case"end":return i.stop()}}),i)})))()},cancelPreviousSearch:function(){var e;console.log("[Search] cancelPreviousSearch"),this.setCurSearchHash(""),null===(e=this.curSearchAction)||void 0===e||e.destroy(),this.curSearchAction=null},getSearchResultThreadIds:function(e,t){var i=this;return(0,r.Z)((0,s.Z)().mark((function n(){var a,o,c,u,h,m,p,f,v,b,g,S,I,y,w,x,L,C,M;return(0,s.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return u=t.hash,h=t.labelId,m=t.searchFromBeginning,p=t.advSearchOptions,f=void 0===p?null:p,console.log("[Search] getSearchResultThreadIds hash(".concat(u,") searchFromBeginning(").concat(m,") advSearchOptions(").concat(f,")")),v=!1,b=0,g=0,i.curSearchAction||(S=function(){var e=(0,r.Z)((0,s.Z)().mark((function e(t){var n,a,r,o,l,c;return(0,s.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(u===i.curSearchHash){e.next=2;break}return e.abrupt("return");case 2:return n=t.labelId,a=t.mailIds,r=t.isLastPage,o=t.isLocalSearch,l=t.isFinish,console.log("[Search] search get ".concat(a.length," mailIds isLocalSearch(").concat(o,") isSearchFinish(").concat(v,") isLastPage(").concat(r,")"),t),l&&(v=!0,console.log("%c[Search] all search notification received.","font-weight: bold; color: green",t)),i.$emit("changeSearchErrorStatus",!1),i.updateLastPageFlag({labelId:n,isLastPage:r}),c=function(){if(u===i.curSearchHash){g++;var e=g===b;if(v&&e){if(i.setLabelLoadingState({labelId:ra.SEARCH,flag:!1}),console.log("%c[Search] search all thread head loaded, finished!","font-weight: bold; color: green"),!r){if(!i.isMailListViewportFilled())return console.log("%c[Search] mail list viewport not full filled, continue to load more data!","font-weight: bold; color: Brown"),void i.search();i.isMailListScrollToEnd()&&(console.log("%c[Search] Mail List Scroll To End! continue to load more data!","font-weight: bold; color: Brown"),i.search())}}else console.log("%c[Search] get thread head data, search not finish! ".concat(g,"/").concat(b," Request"),"font-weight: bold;")}},b++,e.next=11,i.batchGetMailHead({hash:u,labelId:n,mailIds:a,onFetchMailHeadFinish:c});case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),I=function(e){console.log("%c[Search] failCallback!","font-weight: bold; color: red",e),i.setLabelLoadingState({labelId:ra.SEARCH,flag:!1})},i.curSearchAction=d.Hooks.useSearchAction({onSuccess:S,onFailed:I,beforeSearch:function(){console.log("%c[Search] before search, reset flag state","font-weight: bold;"),v=!1,b=0,g=0}})),console.log("%c[Search] start search! isSearchFinish ".concat(v," sentRequestCount ").concat(b," finishedRequestCount ").concat(g," "),"font-weight: bold; color: green"),y={keyword:e,count:ca,inSpamTrash:!1,isSearchSuggestion:!1,advSearch:(0,l.Z)({isStarred:i.selectedSearchFilters.includes("starred"),isImportant:i.selectedSearchFilters.includes("important"),hasAttach:i.selectedSearchFilters.includes("hasAttachment")},f||{}),searchFromBeginning:m},console.debug("search params",y),i.selectedSearchFilters.includes("fromMe")&&(y.advSearch.from=[i.userEmail]),!y.advSearch.inLabelId&&(y.advSearch.inLabelId=i.selectedSearchLabelId),y.inSpamTrash=(0,ea.hm)(y.advSearch.inLabelId),w=!(null!==(a=y.advSearch)&&void 0!==a&&a.dateBegin)&&!(null!==(o=y.advSearch)&&void 0!==o&&o.dateEnd),i.updateSearchFiltersOptions({from:(null===(c=y.advSearch)||void 0===c?void 0:c.from)||[],keywords:e,inLabelId:y.advSearch.inLabelId,dateRange:w?"":[Bt.ou.fromISO(y.advSearch.dateBegin).setZone(i.userTimeZone).toJSDate(),Bt.ou.fromISO(y.advSearch.dateEnd).setZone(i.userTimeZone).toJSDate()],hasAttachment:y.advSearch.hasAttach}),n.next=16,i.curSearchAction.search(y);case 16:if(x=n.sent,x){n.next=22;break}return i.$emit("changeSearchErrorStatus",!0),i.updateLastPageFlag({labelId:ra.SEARCH,isLastPage:!1}),i.setLabelLoadingState({labelId:ra.SEARCH,flag:!1}),n.abrupt("return");case 22:i.setCurrentSearchLabelId(h),i.$emit("changeSearchErrorStatus",!1),L=i.systemLabels.find((function(e){return e.id===y.advSearch.inLabelId})),C=i.userLabels.find((function(e){return e.id===y.advSearch.inLabelId})),M=L&&!C?(0,ea.fu)(L):(0,ea.fu)(C),i.addRecentSearchKeyword({labelId:y.advSearch.inLabelId,labelName:y.advSearch.inLabelId&&M||"",keyword:e.trim().toLowerCase()});case 28:case"end":return n.stop()}}),n)})))()},batchGetMailHead:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n,a,r,o;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=e.labelId,a=e.mailIds,r=e.hash,o=e.onFetchMailHeadFinish,0!==a.length){i.next=4;break}return o(),i.abrupt("return");case 4:if(n&&r===t.curSearchHash){i.next=6;break}return i.abrupt("return");case 6:t.getAllMailHead({labelId:n,mailIds:a,onFinish:function(){r===t.curSearchHash&&o()},onError:function(){r===t.curSearchHash&&t.$emit("changeSearchErrorStatus",!0)}});case 7:case"end":return i.stop()}}),i)})))()},handleExitSearch:function(){var e,t,i;if(this.$store.commit("clearSearchResults"),this.setSearchString(""),null===(e=this.$refs.advancedSearchOptionsRef)||void 0===e||e.clear(),this.changeInSearchBox(!1),this.setLabelLoadingState({labelId:ra.SEARCH,flag:!1}),this.clearAdvSearchStatus(),null!==(t=this.selectPrevLabel)&&void 0!==t&&t.id)this.$store.commit("changeSelectMailLabel",this.selectPrevLabel),i=this.selectPrevLabel.id;else{var n=this.allLabels.find((function(e){return(0,_t.WP)(e)}));this.$store.commit("changeSelectMailLabel",n),i=null===n||void 0===n?void 0:n.id}this.$route.params.id!==i&&this.$router.push({name:"inbox",params:{id:i}})},addInboxListener:function(){var e=this;this.$Bus.$on("onLoadMore",this.onLoadMore=function(){!e.inSearching||e.isLabelLoading(ra.SEARCH)||e.isLabelReachLastPage(ra.SEARCH)||(console.log("[LoadMore] Search load more"),e.search())}),this.$once("hook:beforeDestroy",(function(){e.$Bus.$off("onLoadMore",e.onLoadMore)})),console.log("%c[LoadMore] registered LoadMoreListener for Search","font-weight: bold; color: CornflowerBlue")},updateAdvSearchOptions:function(e){if(e){if(console.debug("updateAdvSearchOptions",e),this.updateSearchFiltersOptions(e),!this.advancedSearchEnabled)return this.handleClose(),void this.$toast(this.$t("search.invalidSearchQuery"),{duration:5e3});this.handleAdvancedSearchSubmitted(e)}},getSelectorDisplayValue:function(e,t){var i;return(null===(i=this.searchInLabelOptions.find((function(e){return e.value===t})))||void 0===i?void 0:i.name)||e}})},ua=da,ha=(0,E.Z)(ua,Mn,kn,!1,null,"c6d2582e",null),ma=ha.exports,pa=function(){var e=this,t=e._self._c;return t("div",{staticClass:"reply-later-container"},[t("div",{staticClass:"reply-later-toggle"},[t("shortcut-reminder",{attrs:{preTooltip:e.$t("operation.replyLaterCap"),placement:"left"}},[t("zm-button",{ref:"trigger",attrs:{"aria-label":"".concat(e.$t("operation.replyLaterCap"),", ").concat(e.$tc("accessibility.numItems",e.mailHeads.length,[e.mailHeads.length])),"aria-expanded":e.expanded.toString(),"aria-haspopup":"listbox"},on:{click:e.toggleExpandList}},[t("svg-icon",{attrs:{iconClass:e.expanded?"triangle-down":"reply-later-filled"}}),e.expanded?e._e():t("span",{staticClass:"count-badge"},[e._v(" "+e._s(e.mailHeads.length)+" ")])],1)],1)],1),t("message-card-list",{ref:"list",attrs:{visible:e.expanded,messages:e.messages},on:{onRemoveCard:function(t){return e.$emit("onRemoveCard",t)},onCardClick:function(t){e.$emit("onCardClick",t),e.collapseList()},close:e.collapseList}})],1)},fa=[],va=function(){var e=this,t=e._self._c;return e.shownAsDrawers?t("zm-popover",{ref:"messageDrawerRef",attrs:{value:e.visible,placement:"top-start",trigger:"manual","popper-class":e.popperClass,"tab-to-leave":!0},on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.stopPropagation(),e.handleEsc.apply(null,arguments))}}},[t("div",{staticClass:"message-list-card-containe-drawer",on:{click:function(e){return e.stopPropagation(),function(){}.apply(null,arguments)}}},[t("div",{staticClass:"message-list-card-containe-drawer-header"},[t("h3",{staticClass:"title"},[e._v(" "+e._s(e.title)+" "),t("span",{staticClass:"count"},[e._v("("+e._s(e.messages.length)+")")])]),t("zm-button",{staticClass:"manage-action",attrs:{type:"primary",ghost:"","aria-label":e.actionText},on:{click:e.onEdit}},[e._v(" "+e._s(e.actionText)+" ")])],1),t("div",{ref:"messageList",staticClass:"message-list"},e._l(e.messages,(function(i,n){return t("div",e._g(e._b({key:i.id,ref:"messageListItem",refInFor:!0,class:"message-card-".concat(n),attrs:{"aria-label":e.getAriaLabel(i)}},"div",e.getAriaBindings(n),!1),e.getAriaListeners(n)),[t("message-card",{attrs:{message:i}},[t("zm-tooltip",{attrs:{slot:"end",content:e.tooltip,placement:"top"},slot:"end"},[t("span",{staticClass:"action",on:{click:function(){return e.onCardClicked(i)}}},[t("svg-icon",{attrs:{iconClass:e.endActionIcon}})],1)])],1)],1)})),0)])]):t("div",{ref:"messageListContainerRef",staticClass:"message-list-card-container",on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.stopPropagation(),e.handleEsc.apply(null,arguments))}}},[t("Transition",{attrs:{appear:"",name:"message-list-transition"}},[t("draggable",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],ref:"messageList",staticClass:"message-list",attrs:{supportPointer:!1,group:e.dragSource,list:e.displayedMessages},on:{start:e.onStartToRemove,end:e.onEndRemove,change:e.onChange}},e._l(e.messages,(function(i,n){return t("div",e._g(e._b({key:i.id,ref:"messageListItem",refInFor:!0,staticClass:"message-list-item",attrs:{"aria-label":e.getAriaLabel(i)}},"div",e.getAriaBindings(n),!1),e.getAriaListeners(n)),[t("zm-tooltip",{ref:"messageCardRef".concat(i.id),refInFor:!0,attrs:{placement:"left",content:e.$t("operation.drag2Remove"),"open-delay":300,"popper-class":"drag-tooltip",enterable:!1}},[t("message-card",{attrs:{message:i,tabindex:"-1"}},[t("zm-tooltip",{attrs:{slot:"end",content:e.tooltip,placement:"top"},slot:"end"},[t("div",{staticClass:"action",on:{click:function(t){return e.onCardClicked(i)},mouseenter:function(t){return e.hideDrag2RemoveTip(i.id)},mouseleave:function(t){return e.showDrag2RemoveTip(i.id)}}},[t("svg-icon",{attrs:{iconClass:e.endActionIcon}})],1)])],1)],1)],1)})),0)],1),e.showDropZone?t("draggable",{staticClass:"trash-box-container",attrs:{group:e.dropTarget}},[t("div",{staticClass:"trash-box",on:{dragenter:e.handleDragEnter,dragleave:e.handleDragLeave}},[e._v(" "+e._s(e.$t("operation.drop2Remove"))+" ")])]):e._e()],1)},ba=[],ga=function(){var e=this,t=e._self._c;return t("div",{staticClass:"message-card"},[t("div",{staticClass:"user-avatar"},[t("avatar",{attrs:{email:e.message.email,name:e.message.name,role:"cell",size:"large",tabindex:"-1"}})],1),t("div",{staticClass:"message-info"},[t("h3",{staticClass:"message-subject much-hidden"},[e._v(e._s(e.message.subject||e.$t("common.noSubject")))]),t("span",{staticClass:"message-description much-hidden"},[e._v(" "+e._s(e.message.description||e.message.name||e.message.email||e.$t("common.noSnippet"))+" ")])]),e._t("end")],2)},Sa=[],Ia={name:"MessageCard",components:{Avatar:Gt.Z},props:{message:{type:Object,default:{}}}},ya=Ia,wa=(0,E.Z)(ya,ga,Sa,!1,null,"24e56e9b",null),xa=wa.exports,La=i(41985),Ca=i.n(La),Ma=7,ka={name:"MessageCardList",components:{MessageCard:xa,draggable:Ca()},props:{visible:{type:Boolean,default:!1},messages:{type:Array,default:[]}},emits:["close","onRemoveCard","onMoveCard","onCardClick"],data:function(){return{isInEdit:!1,shownAsDrawers:!1,dragSource:{name:"reply-later-cards",pull:!0,put:!0},dropTarget:{name:"reply-later-cards",pull:!0,put:!0},showDropZone:!1,displayedMessages:this.messages}},computed:{title:function(){return this.$t("operation.replyLaterCap")},endActionIcon:function(){return this.isInEdit?"close":"reply"},actionText:function(){return this.isInEdit?this.$t("operation.done"):this.$t("operation.manage")},tooltip:function(){return this.isInEdit?this.$t("operation.remove"):this.$t("operation.reply")},popperClass:function(){return this.isInEdit?"message-list-card-popover in-edit":"message-list-card-popover"},messageListRef:function(){return this.$refs.messageList.$el||this.$refs.messageList}},watch:{visible:{handler:function(e){e?this.shownAsDrawers=this.messages.length>Ma:(this.isInEdit=!1,this.showDropZone=!1)},immediate:!0},messages:function(e){this.displayedMessages=e}},mounted:function(){this.$Bus.$on("outerClicked",this.onCloseList)},beforeDestroy:function(){this.$Bus.$off("outerClicked",this.onCloseList)},methods:{handleDragLeave:function(){this.withinDropZone=!1},handleDragEnter:function(){this.withinDropZone=!0},handleEsc:function(){this.$emit("close")},onCloseList:function(e){var t,i=this.$refs.messageListContainerRef||this.$refs.messageDrawerRef.$el;if(i){var n=!(null!==(t=i.parentElement)&&void 0!==t&&t.contains(e.target));n&&this.$emit("close")}},onCardClicked:function(e){this.isInEdit?this.$emit("onRemoveCard",e):this.$emit("onCardClick",e)},onRemoveCard:function(e){this.$emit("onRemoveCard",e)},onEdit:function(){this.isInEdit=!this.isInEdit},onChange:function(e){var t=e.removed;t&&(this.withinDropZone?this.onRemoveCard(t.element):this.displayedMessages.splice(0,0,t.element))},onStartToRemove:function(){this.showDropZone=!0},onEndRemove:function(){this.showDropZone=!1},enterFocus:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.$nextTick((function(){e.messageListRef.setAttribute("role","menu"),e.focusOn(0,t.focusVisible)}))},focusOn:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=e;i<0?i=this.messages.length-1:i>=this.messages.length&&(i=0),this.$refs.messageListItem[i].focus({focusVisible:t})},handleDeleteWithKeyboard:function(e){var t=this;this.$emit("onRemoveCard",this.messages[e]),this.$nextTick((function(){return t.focusOn(Math.min(e,t.messages.length-1))}))},getAriaLabel:function(e){var t=e.subject||this.$t("common.noSubject"),i=e.description||e.name||e.email||this.$t("common.noSnippet");return"".concat(t," ").concat(i)},getAriaBindings:function(e){return{tabindex:"-1",role:"menuitem","aria-posinset":(e+1).toString(),"aria-setsize":this.messages.length}},getAriaListeners:function(e){var t=this;return{keydown:function(i){switch(i.key){case"Space":case"Enter":t.onCardClicked(t.messages[e]);break;case"ArrowUp":t.focusOn(e-1);break;case"ArrowDown":t.focusOn(e+1);break;case"Delete":t.handleDeleteWithKeyboard(e);break;default:return}i.stopPropagation(),i.preventDefault()}}},hideDrag2RemoveTip:function(e){var t=this.$refs["messageCardRef".concat(e)];t&&t[0].hide()},showDrag2RemoveTip:function(e){var t=this.$refs["messageCardRef".concat(e)];t&&t[0].show()}}},_a=ka,Da=(0,E.Z)(_a,va,ba,!1,null,"381c8fb6",null),Ta=Da.exports,Ea={name:"ReplyLater",components:{ShortcutReminder:R.Z,MessageCardList:Ta},props:{mailHeads:{type:Array,default:function(){return[]}}},data:function(){return{expanded:!1}},computed:(0,l.Z)((0,l.Z)({},(0,h.Se)("mail",["getRenamedNameByThreadId"])),{},{messages:function(){var e=this;return this.mailHeads.map((function(t){var i=t.mailId,n=t.mailHead,a=n.subject,s=n.snippet,r=n.from;return{id:i,name:null===r||void 0===r?void 0:r.displayName,email:null===r||void 0===r?void 0:r.emailAddr,subject:e.getRenamedNameByThreadId(i)||a,description:s}}))}}),methods:{toggleExpandList:function(e){this.expanded=!this.expanded,this.expanded?this.$refs.list.enterFocus({focusVisible:"mouse"===e.pointerType}):this.focusOnTrigger()},collapseList:function(){this.expanded=!1,this.focusOnTrigger()},focusOnTrigger:function(){var e,t;null===(e=this.$refs.trigger)||void 0===e||null===(t=e.$el)||void 0===t||t.focus()}}},$a=Ea,Aa=(0,E.Z)($a,pa,fa,!1,null,"7ecb93be",null),Ra=Aa.exports,Za=function(){var e=this,t=e._self._c;return t("confirm-dialog",{attrs:{title:e.$t("detail.renameSubject"),visible:!0,width:"600px",actions:e.actions,customClass:"rename-subject-dialog"}},[t("div",{staticClass:"rename-subject-dialog-content",attrs:{"zm-ta":"rename-subject-dialog-content"}},[t("div",{staticClass:"rename-subject-tips"},[e._v(" "+e._s(e.$t("detail.renameSubjectOnlyVisibleToYou"))+" ")]),t("div",{staticClass:"renamed-subject-textarea"},[t("zm-input",{ref:"textarea",attrs:{"zm-ta":"rename-subject-dialog-textarea",autofocus:"",maxlength:"200",type:"textarea","show-word-limit":"","aria-disabled":e.saving,disabled:e.saving,rows:3,placeholder:e.$t("detail.renameSubject")},model:{value:e.renamedThreadName,callback:function(t){e.renamedThreadName=t},expression:"renamedThreadName"}})],1),e.showErrorMessage?t("div",{staticClass:"rename-error"},[t("div",{staticClass:"rename-error-icon",attrs:{"zm-ta":"rename-subject-dialog-error-tips"}},[t("svg-icon",{attrs:{"aria-hidden":!0,iconClass:"error"}})],1),e.hasIllegalCharacter?t("div",{staticClass:"rename-error-message",attrs:{"zm-ta":"rename-subject-dialog-illegal-char"}},[e._v(" "+e._s(e.$t("detail.illegalCharacter"))+" ")]):t("div",{staticClass:"rename-error-message",attrs:{"zm-ta":"rename-subject-dialog-error-message"}},[e._v(" "+e._s(e.$t("detail.renameSubjectFailed"))+" ")])]):e._e(),t("div",{staticClass:"original-subject-container"},[t("div",{staticClass:"original-subject-header"},[t("div",{staticClass:"original-subject-header-title"},[e._v(" "+e._s(e.$t("detail.originalSubject"))+" ")]),t("div",{staticClass:"original-subject-header-action"},[t("div",{staticClass:"original-subject-header-action-item tab-focus",style:{cursor:e.saving?"not-allowed":"pointer"},attrs:{"aria-label":e.$t("detail.fillInAx")+e.originalSubject,role:"button",tabindex:"0","zm-ta":"rename-subject-dialog-fill-in"},on:{click:e.fillInOriginalSubject,keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])||t.target!==t.currentTarget?null:(t.stopPropagation(),e.fillInOriginalSubject.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")||t.target!==t.currentTarget?null:(t.stopPropagation(),e.fillInOriginalSubject.apply(null,arguments))}]}},[e._v(" "+e._s(e.$t("detail.fillIn"))+" ")])])]),t("div",{staticClass:"original-subject-content",attrs:{"zm-ta":"rename-subject-dialog-original-subject"}},[e._v(" "+e._s(e.originalSubject)+" ")])])])])},Oa=[],za=i(91787),Na={name:"RenameSubjectDialog",components:{ConfirmDialog:za["default"]},props:{mailHeadItem:{type:Object,default:function(){}}},data:function(){return{saving:!1,originalRenamedThreadName:"",renamedThreadName:"",hasError:!1}},computed:(0,l.Z)((0,l.Z)({},(0,h.Se)("mail",["getRenamedNameByThreadId"])),{},{threadId:function(e){var t=e.mailHeadItem;return t.mailHead.threadId},originalSubject:function(e){var t,i=e.mailHeadItem;return(null===i||void 0===i||null===(t=i.mailHead)||void 0===t?void 0:t.subject)||this.$t("detail.noSubject")},hasIllegalCharacter:function(e){var t=e.renamedThreadName;return(0,_t.qz)(t)},canSave:function(e){var t=e.hasIllegalCharacter,i=e.originalRenamedThreadName,n=e.renamedThreadName;return!t&&i!==n},showErrorMessage:function(e){var t=e.hasError,i=e.hasIllegalCharacter;return t||i},actions:function(e){var t=e.canSave;return[{id:"saveRename",text:this.$t("detail.saveRename"),handler:this.saveRename,className:"tab-focus",disabled:!t,loading:this.saving,type:"primary",zmTa:"rename-subject-dialog-save"},{id:"cancelRename",text:this.$t("detail.cancelRename"),handler:this.cancelRename,className:"tab-focus",zmTa:"rename-subject-dialog-cancel"}]}}),watch:{renamedThreadName:function(){this.resetError()}},created:function(){this.renamedThreadName=this.getRenamedNameByThreadId(this.threadId),this.originalRenamedThreadName=this.renamedThreadName},mounted:function(){var e=this;this.$nextTick((function(){e.$refs.textarea.focus()}))},methods:(0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.OI)("mail",["setThreadIdToName"])),(0,h.OI)(["ariaAnnounce"])),{},{saveRename:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){var i;return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e.resetError(),e.saving=!0,t.next=5,u.Mail.renameThread({threadId:e.threadId,threadName:e.renamedThreadName});case 5:i=t.sent,0===i?(e.setThreadIdToName({threadId:e.threadId,threadName:e.renamedThreadName}),e.$emit("close")):e.hasError=!0,t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](0),console.error("saveRename error",t.t0);case 12:return t.prev=12,e.saving=!1,t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[0,9,12,15]])})))()},cancelRename:function(){this.$emit("close")},fillInOriginalSubject:function(){this.saving||(this.renamedThreadName=this.originalSubject,this.ariaAnnounce(this.$t("detail.originalSubjectFilled")))},resetError:function(){this.hasError=!1}})},Pa=Na,Fa=(0,E.Z)(Pa,Za,Oa,!1,null,null,null),Va=Fa.exports,Ha=i(21784),Ba=function(){var e=this,t=e._self._c;return t("div",{class:["inbox-page-layout",e.isOfflineByDisconnection&&"inbox-page-layout--offline"]},[t("div",{class:["inbox-page-layout__container",e.isSplitView?"inbox-page-layout__container--splitview":"inbox-page-layout__container--listview"]},[t("div",{staticClass:"inbox-page-layout__list",style:{width:e.listWidth},attrs:{id:e.LIST_ELEMENT_ID}},[e._t("list")],2),t("div",{directives:[{name:"show",rawName:"v-show",value:e.isSplitView,expression:"isSplitView"}],staticClass:"inbox-page-layout__resizer",attrs:{id:e.RESIZER_ELEMENT_ID}},[t("div",{staticClass:"inbox-page-layout__resizer__line"})]),t("div",{class:["inbox-page-layout__detail",e.showDetail&&"inbox-page-layout__detail--show"],attrs:{id:e.DETAIL_ELEMENT_ID}},[e._t("detail")],2)])])},Ua=[],ja="inbox-page-layout__resizer",Wa="inbox-page-layout__list",Ka="inbox-page-layout__detail",Ya="100%",Xa="34%",Ga=d.Enums.SettingConfigField,qa={name:"InboxPageLayout",data:function(){return{RESIZER_ELEMENT_ID:ja,LIST_ELEMENT_ID:Wa,DETAIL_ELEMENT_ID:Ka,standaloneDetailView:!1,xDir:0,listWidthInListView:Ya,listWidthInSplitView:Xa}},computed:(0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)({isSplitView:function(e){return e.isSplitView},showDetail:function(e){return e.showDetail},isAuthed:function(e){return e.auth.isAuthed}})),(0,h.Se)({isOfflineByDisconnection:"isOfflineByDisconnection"})),{},{listWidth:function(e){var t=e.isSplitView,i=e.listWidthInSplitView,n=e.listWidthInListView;return t?i:n}}),watch:{isSplitView:function(){this.isAuthed&&this.setSplitConfig()}},mounted:function(){var e,t=this;this.throttledResizeMouseMoveHandler=(0,Ct.throttle)(this.resizeMouseMoveHandler,10),null===(e=document.getElementById(ja))||void 0===e||e.addEventListener("mousedown",this.resizeMouseDownHandler),this.$once("hook:beforeDestroy",(function(){var e;null===(e=document.getElementById(ja))||void 0===e||e.removeEventListener("mousedown",t.resizeMouseDownHandler),t.throttledResizeMouseMoveHandler.cancel()})),this.fetchSplitConfig()},methods:(0,l.Z)((0,l.Z)({},(0,h.OI)({setSplitView:"setSplitView"})),{},{fetchSplitConfig:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){var i,n,a;return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,u.Setting.getPersistentSetting({key:Ga.PANE_VIEW_MODE});case 2:if(i=t.sent,0===i.errorCode){t.next=5;break}return t.abrupt("return");case 5:if(n=i.data.value,"string"===typeof n&&n){t.next=8;break}return t.abrupt("return");case 8:try{a=JSON.parse(n),e.listWidthInSplitView=a.mailListWidth,1===a.splitMode&&e.setSplitView(!0)}catch(s){console.error("Get split mode setting failed:",s)}case 9:case"end":return t.stop()}}),t)})))()},setSplitConfig:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,u.Setting.setPersistentSetting({key:Ga.PANE_VIEW_MODE,value:JSON.stringify({splitMode:e.isSplitView?1:0,mailListWidth:e.listWidthInSplitView})})["catch"]((function(e){console.error("Toggle split view failed:",e)}));case 2:case"end":return t.stop()}}),t)})))()},resizeMouseDownHandler:function(e){e.stopPropagation(),this.xDir=e.clientX,document.removeEventListener("mousemove",this.throttledResizeMouseMoveHandler),document.removeEventListener("mouseup",this.resizeMouseUpHandler),document.addEventListener("mousemove",this.throttledResizeMouseMoveHandler),document.addEventListener("mouseup",this.resizeMouseUpHandler)},resizeMouseMoveHandler:function(e){e.stopPropagation();var t=document.getElementById(ja),i=t.previousElementSibling,n=e.clientX-this.xDir,a=i.getBoundingClientRect().width,s=100*(a+n)/t.parentNode.getBoundingClientRect().width;s<50&&(i.style.width="".concat(s,"%"),this.xDir=e.clientX)},resizeMouseUpHandler:function(){document.removeEventListener("mousemove",this.throttledResizeMouseMoveHandler),document.removeEventListener("mouseup",this.resizeMouseUpHandler),this.listWidthInSplitView=document.getElementById(Wa).style.width,this.setSplitConfig()},enableStandaloneDetailView:function(){this.standaloneDetailView=!0},disableStandaloneDetailView:function(){this.standaloneDetailView=!1}})},Ja=qa,Qa=(0,E.Z)(Ja,Ba,Ua,!1,null,"a5a26bf0",null),es=Qa.exports,ts=i(29273),is=i(24251),ns=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:!e.shouldShowEmptyState,expression:"!shouldShowEmptyState"}],staticClass:"auto-delete-tip-container"},[t("span",[e._v(e._s(e.$t("operation.autoDeleteTip",[e.$t(e.labelText)])))]),t("zm-button",{staticClass:"action-empty",attrs:{type:"link"},on:{click:e.handleShowConfirm}},[e._v(" "+e._s(e.$t("operation.emptyItem",[e.$t(e.labelText)]))+" ")]),t("confirm-dialog",{attrs:{visible:e.showConfirmDialog,title:e.$t("operation.emptyItem",[e.$t(e.labelText)]),content:e.confirmDialogContent,actions:e.emptyLabelItemActions,width:"475px"}}),t("zm-dialog",{attrs:{visible:e.showEmptyingDialog,title:e.$t("operation.emptyingItem",[e.$t(e.labelText)]),modal:"","modal-append-to-body":"","append-to-body":"","lock-scroll":""}},[t("p",[e._v(e._s(e.$t("operation.emptyingProgress",[e.progress])))]),t("div",{staticClass:"empty-progress-content"},[t("zm-progress",{staticClass:"empty-progress",attrs:{percentage:e.progress}}),t("zm-button",{attrs:{loading:e.isStopping},on:{click:e.handleStopEmptyMails}},[e._v(" "+e._s(e.$t("common.stop"))+" ")])],1)])],1)},as=[],ss=d.Enums.Notification,rs=d.Enums.EMPTY_MAILS_STATUS,os=d.Enums.SystemDefinedMailLabelIds,ls={name:"AutoDeleteTip",components:{ConfirmDialog:Ii.QH},props:{shouldShowEmptyState:{type:Boolean,default:!1}},data:function(){var e=this;return{showConfirmDialog:!1,emptyLabelItemActions:[{id:"cancelEmptyLabelItem",className:"cancel-empty-label",handler:function(){e.showConfirmDialog=!1},text:this.$t("operation.cancel")},{id:"emptyLabelItem",className:"empty-label-item",handler:function(){var t=(0,r.Z)((0,s.Z)().mark((function t(){return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.handleEmptyMails();case 1:case"end":return t.stop()}}),t)})));function i(){return t.apply(this,arguments)}return i}(),text:this.$t("operation.empty"),type:"danger"}],emptyLabelMailsStatus:{progress:0,status:""},showEmptyingDialog:!1,confirmDialogContent:""}},computed:(0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)(["selectMailLabel"])),(0,h.Se)("inbox",["currentLabelMailMessageCount","mails"])),{},{currentLabelId:function(){var e;return null===(e=this.selectMailLabel)||void 0===e?void 0:e.id},labelText:function(){var e,t=(e={},(0,wt.Z)(e,os.TRASH,"label.trash"),(0,wt.Z)(e,os.SPAM,"label.spam"),(0,wt.Z)(e,os.BLOCKED,"label.blocked"),e);return t[this.currentLabelId]},progress:function(){var e;return null===(e=this.emptyLabelMailsStatus)||void 0===e?void 0:e.progress},isStopping:function(){var e;return(null===(e=this.emptyLabelMailsStatus)||void 0===e?void 0:e.status)===rs.STOPPING}}),created:function(){var e=this;this.$Bus.$on(ss.OnMailEmptyStatusChange,(function(t){e.handleOnStatusChange(t.result.emptyStatus)}))},beforeDestroy:function(){this.$Bus.$off(ss.OnMailEmptyStatusChange)},methods:{handleShowConfirm:function(){var e,t,i=(null===(e=this.mails[0])||void 0===e?void 0:e.mailHead)||(null===(t=this.mails[0])||void 0===t?void 0:t.threadHead);1!==this.currentLabelMailMessageCount||null!==i&&void 0!==i&&i.hasSticker?this.confirmDialogContent=this.$tc("operation.emptyItemDialogContent",this.currentLabelMailMessageCount):this.confirmDialogContent=this.$tc("operation.emptyItemDialogContentWithoutStickyNotes"),this.showConfirmDialog=!0},handleStopEmpty:function(){this.setEmptyLabelMailsStatus({status:rs.STOPPING})},setEmptyLabelMailsStatus:function(e){this.emptyLabelMailsStatus=(0,l.Z)((0,l.Z)({},this.emptyLabelMailsStatus),e)},handleOnStatusChange:function(e){var t=this,i=e.status,n=e.prog,a=e.processedTotal;i===rs.COMPLETED?(this.setEmptyLabelMailsStatus({status:i,progress:n}),this.$emit("emptyEnd"),setTimeout((function(){t.showEmptyingDialog=!1,t.$toast(t.$tc("operation.emptyResult",a))}),500)):i===rs.PROCESSING?(this.setEmptyLabelMailsStatus({status:i,progress:n}),this.showEmptyingDialog=!0):i===rs.CANCELLED?(this.showEmptyingDialog=!1,this.$toast(this.$tc("operation.emptyResult",a)),this.$emit("emptyEnd")):(this.showEmptyingDialog=!1,this.$emit("emptyEnd"))},handleEmptyMails:function(){var e=this,t=this.currentLabelId;this.$set(this.emptyLabelItemActions[1],"loading",!0),this.$emit("emptyStart"),u.Mail.emptyMails({labelId:t}).then((function(t){if(t.errorCode)throw new Error("emptyMails failed");e.handleOnStatusChange(t.data.emptyStatus)}))["catch"]((function(t){console.log("emptyMails error",t),e.$emit("emptyEnd")}))["finally"]((function(){e.showConfirmDialog=!1,e.$set(e.emptyLabelItemActions[1],"loading",!1)}))},handleStopEmptyMails:function(){var e=this,t=this.currentLabelId;this.handleStopEmpty(),u.Mail.stopEmptyMails({labelId:t}).then((function(t){if(261===t.errorCode)e.setEmptyLabelMailsStatus({status:rs.CANCELLED}),e.showEmptyingDialog=!1,e.$emit("emptyEnd");else{if(t.errorCode)throw new Error("stopEmptyMails failed");e.handleOnStatusChange(t.data.emptyStatus)}}))["catch"]((function(t){console.log("stopEmptyMails error",t),e.$toast(e.$t("operation.stopEmptyMailsFailed")),e.setEmptyLabelMailsStatus({status:rs.CANCELING})}))}}},cs=ls,ds=(0,E.Z)(cs,ns,as,!1,null,"0232926a",null),us=ds.exports,hs=function(){var e=this,t=e._self._c;return t("div",{ref:"contextMenuContainerRef",staticClass:"zm-mc-contextmenu-container",on:{contextmenu:function(t){return t.stopPropagation(),e.showContextmenu.apply(null,arguments)}}},[e._t("trigger"),t("div",{directives:[{name:"show",rawName:"v-show",value:e.isMainmenuOpen,expression:"isMainmenuOpen"}],ref:"contextmenuRef",staticClass:"zm-mc-contextmenu",style:{transform:"translate(".concat(e.mainMenuOffset.left,"px, ").concat(e.mainMenuOffset.top,"px)")},on:{click:function(t){e.isMainmenuOpen=!1}}},[e._t("default")],2)],2)},ms=[],ps={name:"Contextmenu",components:{},props:{hitTest:{type:Function,default:function(){return!0}}},data:function(){return{isMainmenuOpen:!1,mainMenuOffset:{top:0,left:0}}},computed:(0,l.Z)((0,l.Z)({},(0,h.Se)("delegate",["permissionRole"])),{},{contextMenuPermission:function(e){var t=e.permissionRole;return(0,c.yz)(t,c.Vn.THREAD_OPERATION)}}),mounted:function(){this.$Bus.$on("outerClicked",this.closeContextMenu)},destroyed:function(){this.$Bus.$off("outerClicked",this.closeContextMenu)},methods:{showContextmenu:function(e){this.contextMenuPermission&&(this.$refs.contextmenuRef.contains(e.target)||this.hitTest(e)&&(this.isMainmenuOpen=!0,this.mainMenuOffset={left:e.clientX,top:e.clientY}))},closeContextMenu:function(e){this.$refs.contextmenuRef.contains(e.target)||(this.isMainmenuOpen=!1)}}},fs=ps,vs=(0,E.Z)(fs,hs,ms,!1,null,null,null),bs=vs.exports,gs=(0,_t.wE)((function(){return Promise.all([i.e(354),i.e(597),i.e(828)]).then(i.bind(i,31305))})),Ss=(0,_t.wE)((function(){return Promise.all([i.e(42),i.e(354),i.e(602),i.e(597),i.e(344),i.e(803)]).then(i.bind(i,23654))})),Is=(0,_t.wE)((function(){return Promise.all([i.e(42),i.e(354),i.e(602),i.e(438),i.e(455)]).then(i.bind(i,51424))})),ys=(0,_t.wE)((function(){return Promise.all([i.e(438),i.e(981)]).then(i.bind(i,2597))})),ws=d.Enums.SystemDefinedMailLabelIds,xs=d.Enums.BAN_ACTION_MENU_LABELS,Ls=d.Enums.MailMarkAction,Cs=d.Enums.INBOX_LIST_TYPE,Ms=d.Enums.ADDON_ITEM_IDS,ks=d.Enums.MAXIMUM_NUMBER_OF_OPENINGS_AT_ONCE,_s={name:"Inbox",components:{Divider:Ha.Z,RenameSubjectDialog:Va,LowStorageUsageTips:Cn,inboxItem:li,InboxSections:Sn,RecycleScroller:Tt.EK,CategoryTabs:gi,ControlHeader:gs,SvgIcon:I.Z,Detail:Ss,ConfirmDialog:Ii.QH,AddFilterDialog:Si["default"],OfflineModeInboxBanner:Zi,Search:ma,ReplyLater:Ra,InboxPageLayout:es,ScreenerPreview:ys,ScreenerDialog:Is,MailPopoutButton:Di,AutoDeleteTip:us,ContextMenu:bs,ContextMenuItem:Vi,ContextMenuSub:Hi.Z,SnoozeMenu:Bi.Z},mixins:[Et.Z],provide:function(){return{isMailListViewportFilled:this.isMailListViewportFilled,isMailListScrollToEnd:this.isMailListScrollToEnd}},data:function(){return{fixedJiras:xi.Z.fixedJiras,latestMergeInfo:xi.Z.latestMergeInfo,showDevJIRA:!1,showGetStartedModal:!1,errorStatus:!1,searchErrorStatus:!1,index:0,refreshRun:!1,responseItemMailLabels:[],storedTime:null,isIndeterminate:!1,checkAll:!1,showActions:!1,selectItem:{},actionX:0,actionY:0,allContextMenuSendersAreSelf:!0,allSelectedInvalidToSpam:!0,selectedSenderIsApproved:!0,filteredThreadHeads:{},hasBold:{},showApproveUserDialog:!1,approveUserActions:[{id:"cancel",className:"cancel-report-spam tab-focus",handler:this.cancelApprove,text:this.$t("operation.cancel")},{id:"blockUser",className:"report-spam tab-focus",handler:this.approveUser,text:this.$t("operation.approve"),type:"primary"}],renameMailHeadItem:null,showReplyLaterCard:!0,mailRefreshKey:0,showScreenerDialog:!1,selectedUserEmailSpamStatus:"spam",filterEdits:{id:"",criteria:{from:"",to:"",subject:"",query:"",negatedQuery:"",hasAttachment:!1,excludeChats:!1,size:"",sizeComparison:"larger"},action:{removeLabelIds:[],addLabelIds:[]}},globalFilterDialogIsInited:!1,isEmptying:!1,settingsTooltipVisible:!1}},computed:(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)(["isOffline","needReauthorize","typeOfEmail","maxNumberMailsPerRequest","isTestClient","showDetail","allLabels","selectMailLabel","selectPrevLabel","LastInboxRefreshDate","currentPage","scrollPositionY","scaleRatio","isSplitView","splitViewSelectedMails","userProfile","instantDraftList","labelPositionMap","allowMailExternalImg","actionOrdering","recipientInfo","currentInboxItemMailId"])),(0,h.rn)("auth",["isFirstLogin","isAuthed","enablePopoutClientTab","clientLanguage"])),(0,h.rn)("inbox",["lastSelectedInboxMailId","inboxType","currentLoadingMailId","isConversationView"])),(0,h.Se)(["isGmail","sidebarMenuWidth","isZmail","isEncryptedZmail","isOutlook","getLabelIdByMailId","currentLabelId","isOfflineByDisconnection","isAllMailLoaded","labelIdToLabel","userLabels"])),(0,h.Se)("inbox",["selectedInboxMailIds","inboxSectionVisible","currentSectionViewVisibleMails","isLabelLoading","isLabelReachLastPage","isWaitingFirstResponse","isAutoAdvanceEnabled","inboxList","mailHead","mails"])),(0,h.Se)("search",["showCacheMailTip"])),(0,h.Se)("approver",{visibleSenders:"visibleSenders"})),(0,h.Se)("delegate",{delegateSettings:"getDelegateSettings"})),(0,h.rn)("mail",["renameSubjectDialogVisible","replyLaterLabelIds"])),(0,h.rn)("auth",["isMailBetaFeatureEnabled"])),(0,h.rn)("search",["currentSearchLabelId","inSearching","inFilters","searchString","currentSearchLabelId"])),(0,h.Se)("features",["enableRenameSubject","enableReplyLater","allowMarkAsRead","enableApprover","enableSnoozed","enableAICPlus"])),(0,h.Se)("inbox",["isImportantEnabled"])),(0,h.rn)("approver",["status","isInitialized","isFetching","pageSize","lastFetchFailed","senders"])),(0,h.Se)("delegate",{delegates:"getDelegateList"})),(0,h.Se)("action",["canMoveToInbox","canArchive"])),{},{versionInfo:function(e){var t=e.clientLanguage;return xi.Z.version+"(".concat(t,")")},shouldShowRenameSubjectMenuItem:function(e){var t,i=e.enableRenameSubject,n=e.selectedInboxMailIds,a=e.selectItem,s=e.isConversationView;return i&&n.length<=1&&d.Utils.isDecrypted(null===a||void 0===a||null===(t=a.mailHead)||void 0===t?void 0:t.decryptionStatus)&&s},shouldShowEmptyState:function(e){var t=e.inboxList,i=e.isWaitingFirstResponse;return 0===t.length&&!i},listText:function(){var e,t=(e={},(0,wt.Z)(e,ws.INBOX,"list.noEmailsInInbox"),(0,wt.Z)(e,ws.STARRED,"list.noEmailsInStarred"),(0,wt.Z)(e,ws.DRAFT,"list.noEmailsInDrafts"),(0,wt.Z)(e,ws.SENT,"list.noEmailsInSent"),(0,wt.Z)(e,ws.TRASH,"list.noEmailsInTrash"),(0,wt.Z)(e,ws.ARCHIVE,"list.noEmailsInArchive"),(0,wt.Z)(e,ws.SPAM,"list.noEmailsInSpam"),(0,wt.Z)(e,ws.BLOCKED,"list.noEmailsInBlocked"),e);return this.$t(t[this.currentLabelId])||this.$t("list.noEmailsInLabel")},autoDeleteText:function(){var e,t=(e={},(0,wt.Z)(e,ws.TRASH,"label.trash"),(0,wt.Z)(e,ws.SPAM,"label.spam"),(0,wt.Z)(e,ws.BLOCKED,"label.blocked"),e);return this.$t("operation.autoDeleteTip",[this.$t(t[this.currentLabelId])])},mailCount:function(){return this.mails.length},pageCount:function(){return null===this.mailCount?null:Math.ceil(this.mailCount/this.maxNumberMailsPerRequest)},isInInbox:function(){return this.currentLabelId===ws.INBOX},isNotInOutbox:function(){return this.currentLabelId!==ws.OUTBOX},isInSnoozed:function(e){var t=e.currentLabelId;return t===ws.SNOOZED},isAllowSnooze:function(e){var t=e.currentLabelId,i=e.enableSnoozed;return i&&![ws.SENT,ws.OUTBOX,ws.USER_SCHEDULED].includes(t)},isAutoDeleteInbox:function(){var e=[ws.TRASH,ws.SPAM,ws.BLOCKED];return e.includes(this.currentLabelId)},isShowAutoDeleteTip:function(){return this.isZmail&&this.isAutoDeleteInbox&&(!this.isLoading||this.mails.length>0)&&this.isMailBetaFeatureEnabled&&!this.showDetail},isShowControlHeader:function(){return this.isNotInOutbox},canDeleteForever:function(){return this.currentLabelId===ws.TRASH&&this.isZmail},markRead:function(){var e=this;return this.selectedInboxMailIds.filter((function(t){var i,n,a;return null===(i=e.mailHead)||void 0===i||null===(n=i[t])||void 0===n||null===(a=n.mailHead)||void 0===a?void 0:a.isUnread})).length>0},markStarred:function(){var e=this;return this.selectedInboxMailIds.filter((function(t){var i,n,a;return!(null!==(i=e.mailHead)&&void 0!==i&&null!==(n=i[t])&&void 0!==n&&null!==(a=n.mailHead)&&void 0!==a&&a.isStarred)})).length>0},markImportant:function(){var e=this;return this.selectedInboxMailIds.filter((function(t){var i,n,a;return!(null!==(i=e.mailHead)&&void 0!==i&&null!==(n=i[t])&&void 0!==n&&null!==(a=n.mailHead)&&void 0!==a&&a.isImportant)})).length>0},archiveStatus:function(){return(0,_t.XP)(this.currentLabelId)&&this.canArchive(this.selectedThreadItems)},isSpammed:function(){return this.currentLabelId===ws.SPAM},spamStatus:function(){return this.isSpammed?this.isGmail?this.$t("operation.removeFromSpamStatus"):this.$t("operation.reportNotSpamStatus"):this.isGmail?this.$t("operation.markAsSpamStatus"):this.$t("operation.reportSpamStatus")},showMove2Trash:function(){var e;return(null===(e=this.selectItem)||void 0===e?void 0:e.labelId)!==ws.TRASH},showMove2Inbox:function(){var e=this.selectedMailHeads.map((function(e){return null===e||void 0===e?void 0:e.labelId})),t=!e.some((function(e){return e!==ws.TRASH})),i=!e.some((function(e){return e!==ws.ARCHIVE}));return t||i},selectedMailHeads:function(){var e=this;return this.selectedInboxMailIds.map((function(t){return e.mailHead[t]})).filter((function(e){return!!e}))},hasUnread:function(){return this.selectedMailHeads.some((function(e){var t;return null===e||void 0===e||null===(t=e.mailHead)||void 0===t?void 0:t.isUnread}))},hasRead:function(){return this.selectedMailHeads.some((function(e){var t;return!(null!==e&&void 0!==e&&null!==(t=e.mailHead)&&void 0!==t&&t.isUnread)}))},hasDraft:function(){return this.selectedMailHeads.some((function(e){var t;return null===e||void 0===e||null===(t=e.mailHead)||void 0===t?void 0:t.userEmailStatusList.some((function(e){return null===e||void 0===e?void 0:e.isDraft}))}))},showApprove:function(){return 1===this.selectedInboxMailIds.length&&this.selectedUserEmailSpamStatus!==qt.NW.ALLOWLIST},selectedInboxItems:function(){var e=this;return this.selectedInboxMailIds.filter((function(t){return e.mailHead[t]})).map((function(t){return{groupId:t,msgIds:e.mailHead[t].msgIds}}))},selectedThreadItems:function(){var e=this;return this.selectedInboxMailIds.filter((function(t){return e.mailHead[t]})).map((function(t){return e.mailHead[t]}))},canSpam:function(){return this.currentLabelId!==ws.OUTBOX&&this.currentLabelId!==ws.SENT},groupLabel:function(){return ws.GROUP_APPROVAL},isLoading:function(e){var t=e.currentLabelId;return this.isLabelLoading(t)},selectedUserEmail:function(){var e,t=this.selectedInboxMailIds[0],i=this.mailHead[t],n=i.mailHead.userEmailStatusList;return null===(e=n[n.length-1])||void 0===e?void 0:e.userEmail},actionMap:function(){var e,t=this;return e={},(0,wt.Z)(e,Ot.s4.DELETE,{shortcutKey:"delete",iconClass:"delete",label:this.$t("operation.delete"),onClick:function(){return t.handleTrashItems(t.selectedThreadItems)}}),(0,wt.Z)(e,Ot.s4.DELETE_FOREVER,{shortcutKey:"delete",iconClass:"delete",label:this.$t("operation.deleteForever"),onClick:function(){return t.handleDeleteForeverItems(t.selectedThreadItems)}}),(0,wt.Z)(e,Ot.s4.STAR,{shortcutKey:this.markStarred?"mark-starred":"mark-unstarred",iconClass:this.markStarred?"star":"unstar",label:this.markStarred?this.$t("operation.star"):this.$t("operation.removeStar"),onClick:function(){return t.handleItemsMark(t.selectedThreadItems,t.markStarred?"Starred":"UnStarred")},taTag:this.markStarred?"star":"remove-star"}),(0,wt.Z)(e,Ot.s4.IMPORTANT,{shortcutKey:this.markImportant?"mark-important":"mark-unimportant",iconClass:this.markImportant?"important":"unimportant",label:this.markImportant?this.$t("operation.markAsImportant"):this.$t("operation.markAsUnImportant"),disabled:this.isZmail&&!this.isImportantEnabled,onClick:function(){return t.handleItemsMark(t.selectedThreadItems,t.markImportant?"Important":"UnImportant")},taTag:this.markImportant?"important":"remove-important"}),(0,wt.Z)(e,Ot.s4.LABEL,{iconClass:"stroke",label:this.$t("operation.label")}),(0,wt.Z)(e,Ot.s4.MOVE,{iconClass:"move",label:this.$t("operation.move")}),(0,wt.Z)(e,Ot.s4.MOVE_TO_INBOX,{iconClass:"move-to-inbox",label:this.$t("operation.moveToInbox"),disabled:!this.canMoveToInbox(this.selectedThreadItems),onClick:function(){return t.handleItemsMoveToInbox(t.selectedThreadItems)}}),(0,wt.Z)(e,Ot.s4.UNREAD,{shortcutKey:this.markRead?"mark-read":"mark-unread",iconClass:this.markRead?"read":"unread",label:this.markRead?this.$t("operation.markAsRead"):this.$t("operation.markAsUnread"),disabled:!!this.markRead&&!this.allowMarkAsRead,onClick:function(){return t.handleItemsMark(t.selectedThreadItems,t.markRead?"Read":"UnRead")},taTag:this.markRead?"mark-as-read":"mark-as-unread"}),(0,wt.Z)(e,Ot.s4.ARCHIVE,{shortcutKey:"archive",iconClass:"archive",label:this.$t("operation.archive"),disabled:!this.canArchive(this.selectedThreadItems),onClick:function(){return t.handleArchiveItems(t.selectedThreadItems)}}),(0,wt.Z)(e,Ot.s4.FILTER,{iconClass:"funnel",label:this.$t("operation.createFilterFromMessages"),onClick:function(){if(t.selectedInboxMailIds.length>0){var e=[];t.selectedInboxMailIds.forEach((function(i){var n,a,s=null===(n=t.mailHead[i])||void 0===n||null===(a=n.mailHead.from)||void 0===a?void 0:a.emailAddr;s&&"string"===typeof s&&e.push(s.toLowerCase())})),e.length&&(console.log("showCreateFilter fromEmails",e),t.$Bus.$emit("showCreateFilter",{from:(0,f.Z)(new Set(e)).join(" OR "),mailIds:t.selectedInboxMailIds.slice()}))}}}),(0,wt.Z)(e,Ot.s4.CANCEL_SEND,{label:this.$t("operation.cancelScheduled"),onClick:function(){return t.handleCancelScheduledSend(t.selectedInboxMailIds)}}),(0,wt.Z)(e,Ot.s4.DISCARD_DRAFT,{label:this.$t("operation.discardDrafts"),onClick:function(){return t.handleDiscardDrafts(!0)}}),(0,wt.Z)(e,Ot.s4.APPROVE,{iconClass:"approve",label:this.$t("operation.approve"),disabled:!this.showApprove,onClick:this.showApproveDialog}),(0,wt.Z)(e,Ot.s4.SPAM,{shortcutKey:"report-spam",iconClass:this.selectMailLabel.id!==ws.SPAM?"spam":"",label:this.isSpammed?this.$t("operation.notSpam"):this.$t("operation.spam"),disabled:this.isZmail&&this.allSelectedInvalidToSpam,onClick:function(){t.handleItemsSpamToggle(t.selectedThreadItems)},taTag:this.isSpammed?"remove-from-spam":"mark-as-spam"}),(0,wt.Z)(e,Ot.s4.PHISHING,{iconClass:"phishing",label:this.$t("operation.reportPhishing"),disabled:this.isZmail&&this.allSelectedInvalidToSpam,onClick:function(){t.allSelectedInvalidToSpam||t.currentLabelId!==ws.SPAM&&t.phishingMails({mails:t.selectedThreadItems,fromLabelId:t.currentLabelId})}}),(0,wt.Z)(e,Ot.s4.REPLY_LATER,{iconClass:this.areThreadsMarkedAsReplyLater?"remove-reply-later":"reply-later",label:this.areThreadsMarkedAsReplyLater?this.$t("operation.removeReplyLater"):this.$t("operation.replyLater"),disabled:!this.enableReplyLater,onClick:this.areThreadsMarkedAsReplyLater?this.handleBatchRemoveReplyLater:this.handleBatchReplyLater}),(0,wt.Z)(e,Ot.s4.SNOOZE,{iconClass:"snooze",label:this.$t("operation.snooze"),disabled:!this.enableSnoozed,onSnooze:function(e){t.snoozeEmails(e)},unsnooze:function(){t.onUnsnooze()},onClick:function(){}}),(0,wt.Z)(e,Ot.s4.POPOUT_DETAIL,{iconClass:"pop-window",label:this.$t("operation.openInNewWindow"),disabled:!1,onClick:this.popoutSelectedInboxItemsDetails}),e},actions:function(){var e=this,t=(0,Ot.Vv)(this.typeOfEmail,this.selectMailLabel),i=t.filter((function(t){return e.actionMap[t]&&!e.actionMap[t].disabled})).map((function(t){return(0,l.Z)({key:t},e.actionMap[t])}));(0,Ot.$Q)(i,this.actionOrdering);var n=[Ot.s4.DISCARD_DRAFT].concat((0,f.Z)(this.isSpammed?[Ot.s4.SPAM]:[]));return null===i||void 0===i||i.sort((function(e){var t=e.key;return n.includes(t)?-1:0})),i},areThreadsMarkedAsReplyLater:function(){var e=this;return this.selectedMailHeads.every((function(t){return e.replyLaterLabelIds.some((function(e){return t.mailHead&&t.mailHead.showLabelIds.indexOf(e)>-1}))}))},isSomeThreadNotPrivate:function(){return this.selectedMailHeads.some((function(e){return e.mailHead&&!e.mailHead.showLabelIds.includes(ws.PRIVATE)}))},isShowToDelegateActionVisible:function(){return this.currentLabelId===ws.PRIVATE||!this.isSomeThreadNotPrivate},isHideFromDelegateActionVisible:function(){return this.currentLabelId!==ws.PRIVATE&&this.isSomeThreadNotPrivate},replyLaterMailHeads:function(){return this.$store.state.mail.replyLaterLabelMailHeads},isAllowLoadMore:function(e){var t=e.inboxSectionVisible,i=e.currentLabelId;return!this.isEmptying&&(!t&&(i!==ws.OUTBOX&&!this.isAddonItemId(i)))},isReachLastPage:function(e){var t=e.isLabelReachLastPage,i=e.currentLabelId;return t(i)},showLoadMoreIcon:function(e){var t=e.isLoading,i=e.inboxList;return t&&0!==i.length},showScreener:function(e){var t=e.enableApprover,i=e.showDetail,n=e.status,a=e.isSplitView,s=e.isInInbox,r=e.visibleSenders,o=e.lastFetchFailed;return t&&(!i||a)&&s&&n!==X.SCREENER_STATUS.OFF&&((null===r||void 0===r?void 0:r.length)>0||o)},inSearchOrFilter:function(e){var t=e.inSearching,i=e.inFilters;return t||i},retryVisible:function(e){var t=e.isOffline,i=e.isNotInOutbox,n=e.inSearchOrFilter,a=e.errorStatus,s=e.searchErrorStatus;return!!i&&(t||!n&&a||n&&s)},hasNegativeActions:function(){return!this.isOutlook&&!this.allSelectedInvalidToSpam||this.isZmail&&!this.userProfile.isDelegated&&this.isHideFromDelegateActionVisible||this.isZmail&&!this.userProfile.isDelegated&&this.isShowToDelegateActionVisible}}),watch:{showDetail:function(e){var t;e?this.isSplitView||(this.showReplyLaterCard=!1):(null===(t=this.$refs.recycleScroller)||void 0===t||t.updateVisibleItems(!0),this.showReplyLaterCard=!0,this.$store.commit("clearRecipientInfo"),this.enableAICPlus&&!this.isSplitView&&u.Mail.setCurrentMailId({mailId:"",msgsId:[]}))},$route:function(e){var t=e.path,i=e.query.mailId,n=e.params.id,a=null===t||void 0===t?void 0:t.startsWith("/main/inbox");if(a){this.clearSelectedInboxMailIds(),this.clearLastSelectedInboxMailId();var s,r,o=this.labelIdToLabel.get(n);if(o&&(this.$store.commit("changeSelectMailLabel",o),this.$store.commit("changeSelectPrevLabel",o)),i&&this.autoOpenMailHandler(i),n!==ws.SEARCH)console.debug("route id",n),null===(s=this.$refs)||void 0===s||null===(r=s.searchRef)||void 0===r||r.clearAdvSearchStatus()}},currentLabelId:function(e,t){var i,n=this;if(!this.isAddonItemId(e)){if(t===qt.v8&&this.$store.commit("setSplitViewSelectedMails",(0,wt.Z)({},t,null)),!e)return!1;this.$store.commit("changeCurrentPage",1),console.log("currentLabelId -------------- ",e),e===ws.DRAFT&&this.$store.commit("setSplitViewSelectedMails",(0,wt.Z)({},e,null)),this.isSplitView&&this.splitViewSelectedMails[e]&&e!==qt.v8&&e!==ws.DRAFT?this.handleShowDetail(this.splitViewSelectedMails[e],{fromLabel:!0}):this.isSplitView&&this.$store.commit("changeShowDetail",!1),this.labelPositionMap[e]?this.$nextTick((function(){var t;null===(t=n.$refs.recycleScroller)||void 0===t||t.scrollToPosition(n.labelPositionMap[e])})):this.$nextTick((function(){var e;null===(e=n.$refs.recycleScroller)||void 0===e||e.scrollToPosition(0)})),null===(i=this.$refs.recycleScroller)||void 0===i||i.updateVisibleItems(!0),this.checkIsLabelInited()?this.isMailListViewportFilled()||this.loadMore():this.$store.state.mailHead[e]||e!==ws.SEARCH&&(console.warn("[LoadMore] watcher currentLabelId"),this.loadMore())}},activeKeyBinding:function(e){var t,i=e.action,n=e.event;if(n&&!(0,_t.LJ)(n)&&(!this.showDetail||this.isSplitView)){var a=this.actions.find((function(e){return e.shortcutKey===i}));a&&null!==this&&void 0!==this&&null!==(t=this.selectedInboxItems)&&void 0!==t&&t.length&&a.onClick()}},inboxList:function(e){var t=this;this.isAuthed&&this.currentLabelId!==qt.v8&&(this.isAddonItemId(this.currentLabelId)||this.$nextTick((function(){var i=(null===e||void 0===e?void 0:e.length)<t.maxNumberMailsPerRequest;!i||t.isReachLastPage||t.isLoading||t.loadMore()})))},selectedInboxMailIds:function(e){this.verifySelectInboxes(e)},inboxType:function(e,t){var i=this;console.debug("Change inbox type from default style to section style",e,t),(null===t||void 0===t?void 0:t.type)===Cs.DEFAULT&&(null===e||void 0===e?void 0:e.type)!==Cs.DEFAULT&&this.$nextTick((function(){i.$refs.inboxSections&&i.$refs.inboxSections.fetchAllSectionMails()}))},isLoading:function(e){var t=this,i=this.isLabelReachLastPage(this.currentLabelId);e||i||this.errorStatus||this.$nextTick((function(){t.isMailListViewportFilled()||(console.log("%c[LoadMore] mail list viewport not full filled, continue to load more data!","font-weight: bold;"),t.loadMore())}))}},created:function(){var e=this;this.throttleHandleSyncMail=(0,Ct.throttle)(this.handleSync,1e3),document.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("focus",this.refreshIfDateChanged),this.$Bus.$on("showCreateFilter",(function(t){var i=t.mailIds,n=t.from;e.filterEdits.criteria.from=n,e.$refs.addFilterDialog.open(),e.$metric.report("filter_messages_like_these",{msgId:i})})),this.$once("hook:beforeDestroy",(function(){e.throttleHandleSyncMail.cancel(),e.$Bus.$off("showCreateFilter")}))},mounted:function(){var e=this;document.addEventListener("mousedown",this.outerClick,!0),u.Mail.getMailGptLicenseState().then((function(t){e.setSmartComposeStatus(t)})),this.showGetStartedModal=this.isFirstLogin&&this.isZmail,this.scrollPositionY&&setTimeout((function(){var t;null===(t=e.$refs.recycleScroller)||void 0===t||t.scrollToPosition(e.scrollPositionY),e.clearScrollPositionY()})),this.checkIsLabelInited()||(console.log("[LoadMore] inbox mounted, load mail list"),this.loadMore()),Lt()(window).on("click",this.handleClickOnWindow=function(){console.log("handleClickOnWindow reset selectItem"),e.showActions=!1,e.selectItem={}}),this.setupMultiSelectHandlers(),this.$Bus.$on("hideActions",this.handleHideActions),this.$once("hook:beforeDestroy",(function(){e.$Bus.$off("hideActions",e.handleHideActions)})),this.$Bus.$on(ts.r_,this.handleMailsRemovedEvent),setTimeout((function(){e.globalFilterDialogIsInited=!0,e.$emit("onMounted")}),1e3)},beforeDestroy:function(){Lt()(window).off("click",this.handleClickOnWindow),document.removeEventListener("mousedown",this.outerClick,!0),this.cleanupMultiSelectHandlers(),window.removeEventListener("focus",this.refreshIfDateChanged),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.$Bus.$off(ts.r_,this.handleMailsRemovedEvent)},methods:(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.OI)(["setScaleRatio","setCurrentInboxItem","clearCurrentInboxItemMailId","setScrollPositionY","clearScrollPositionY","setSplitView","addInstantDraftList","setSplitViewSelectedMails","clearSplitViewSelectedMail","changeRecipientInfo","clearRecipientInfo","deleteMailHead","changeShowDetail","changeSelectedLabelById","batchAddMailHeads"])),(0,h.OI)("features",["setSmartComposeStatus"])),(0,h.nv)(["getAllMailHead"])),(0,h.nv)("inbox",["addSelectedInboxMailIds","removeSelectedInboxMailIds","resetSelectedInboxMailIds","clearSelectedInboxMailIds","setLastSelectedInboxMailId","clearLastSelectedInboxMailId","setLastReadInboxMailId","clearLastReadInboxMailId","fetchMails","getNextHighlightedMail"])),(0,h.OI)("inbox",["setLabelLoadingState","updateLastPageFlag","setCurrentLoadingMailId","clearCurrentLoadingMailId","refreshMailList"])),(0,h.OI)("mail",["batchSetThreadIdToName","changeRenameSubjectDialogVisible"])),(0,h.nv)("mail",["removeReplyLater"])),(0,h.nv)("sticker",["checkThreadHasStickyNotes"])),(0,h.nv)("action",["archiveMails","trashMails","deleteForeverMails","markMails","moveMails","spamMails","notSpamMails","phishingMails","snoozeMessages","unsnoozeMessages","updateSnoozeTime"])),{},{handleMailsRemovedEvent:function(e){var t,i=this;console.debug("[action] action done",e,this.splitViewSelectedMails,this.currentLabelId,this.splitViewSelectedMails[this.currentLabelId],null===(t=this.splitViewSelectedMails[this.currentLabelId])||void 0===t?void 0:t.mailId,this.showDetail);var n,a=e.nextMail,s=e.removedMailIds,r=void 0===s?[]:s;if(r.length&&this.checkAndRemoveReplyLater(r),this.isSplitView)return a||this.goBack(),void(this.showDetail&&a.mailId!==(null===(n=this.splitViewSelectedMails[this.currentLabelId])||void 0===n?void 0:n.mailId)&&this.$nextTick((function(){i.handleShowDetail(a,{override:!0})})));this.showDetail&&(this.isAutoAdvanceEnabled?this.handleShowDetail(a,{override:!0}):this.goBack())},handleChangeScale:function(e){this.setScaleRatio(e)},handleBatchReplyLater:function(){this.handleReplyLater(),this.clearSelectedInboxMailIds()},handleBatchRemoveReplyLater:function(){this.checkAndRemoveReplyLater(this.selectedInboxMailIds,!0),this.clearSelectedInboxMailIds()},handleRemoveReplyLater:function(){var e=this.selectItem.mailId;this.checkAndRemoveReplyLater([e],!0)},checkAndRemoveReplyLater:function(e){var t=arguments,i=this;return(0,r.Z)((0,s.Z)().mark((function n(){var a;return(0,s.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(a=t.length>1&&void 0!==t[1]&&t[1],i.enableReplyLater){n.next=3;break}return n.abrupt("return");case 3:if(!(i.replyLaterLabelIds.length<1)){n.next=5;break}return n.abrupt("return");case 5:return n.next=7,Promise.all(e.map(function(){var e=(0,r.Z)((0,s.Z)().mark((function e(t){var n;return(0,s.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,i.removeReplyLater(t);case 2:if(n=e.sent,0===n.errorCode){e.next=5;break}throw Error(n.error);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())).then((function(){a&&i.$undoNotice({iconClass:"checkmark",title:i.$tc("notifications.removedMsgsReplyLater",e.length,[e.length])})}))["catch"]((function(t){console.error("error: ",t),i.$undoNotice({iconClass:"crossmark",title:i.$tc("notifications.removedMsgsReplyLaterFail",e.length,[e.length])})}));case 7:case"end":return n.stop()}}),n)})))()},handleInboxItemFocus:function(){var e=this.$refs.recycleScroller;e.handleInboxItemFocus()},handleMoreMenuVisibleChange:function(e){e&&(this.showActions=!1)},onSettingDropdownOpened:function(){var e,t;null===(e=this.$refs.searchRef)||void 0===e||null===(t=e.closePopover)||void 0===t||t.call(e)},verifySelectInboxes:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.isZmail){t.next=2;break}return t.abrupt("return");case 2:e.verifySelectInboxesSpam(e.selectedInboxMailIds),e.updateSelectedUserEmailSpamType();case 4:case"end":return t.stop()}}),t)})))()},verifySelectInboxesSpam:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n,a,r,o,l;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(t.allSelectedInvalidToSpam=!0,t.currentLabelId!==d.Enums.SystemDefinedMailLabelIds.SPAM){i.next=4;break}return t.allSelectedInvalidToSpam=!1,i.abrupt("return");case 4:n=t.userProfile.userEmail,a=(0,J.Z)(e),i.prev=6,o=function(){var e=r.value,i=t.mailHead[e].mailHead,a=i.messageIdToFromMap,s=void 0===a?[]:a,o=i.isUserScheduled,l=i.from,c=void 0===l?{}:l,d=!1;if(d=t.isConversationView?s.find((function(e){var t=Object.values(e)[0].emailAddr,i=void 0===t?"":t;return n.toLowerCase()===i.toLowerCase()||o})):n.toLowerCase()===(null===c||void 0===c?void 0:c.emailAddr.toLowerCase())||o,d){if(d)return t.allSelectedInvalidToSpam=!0,"break"}else t.allSelectedInvalidToSpam=!1},a.s();case 9:if((r=a.n()).done){i.next=15;break}if(l=o(),"break"!==l){i.next=13;break}return i.abrupt("break",15);case 13:i.next=9;break;case 15:i.next=20;break;case 17:i.prev=17,i.t0=i["catch"](6),a.e(i.t0);case 20:return i.prev=20,a.f(),i.finish(20);case 23:case"end":return i.stop()}}),i,null,[[6,17,20,23]])})))()},updateSelectedUserEmailSpamType:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){var i,n,a,r;return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(1===e.selectedInboxMailIds.length&&!e.userProfile.isDelegated){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,u.Mail.getSpamType(e.selectedUserEmail.emailAddr);case 4:if(n=t.sent,a=n.errorCode,r=n.data,0===a){t.next=10;break}return console.error("getSpamType failed"),e.$msg("Failed to get spam type"),t.abrupt("return");case 10:e.selectedUserEmailSpamStatus=(null===(i=r.BatchGetSpamTypes[0])||void 0===i?void 0:i.spamType)||qt.NW.NORMAL;case 11:case"end":return t.stop()}}),t)})))()},getAllContextMenuSendersAreSelf:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){var i,n,a,r;return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i=e.selectItem,console.log("getAllContextMenuSendersAreSelf item",i),t.next=4,u.Inbox.getMailDetails({labelId:i.labelId,mailIds:[i.mailId]});case 4:return n=t.sent,a=(null===n||void 0===n?void 0:n.mailDetails)||[],r=e.userProfile.userEmail,t.abrupt("return",a.find((function(e){var t=e.from.emailAddr,i=e.mailHead.isUserScheduled;return r.toLowerCase()===t.toLowerCase()||i})));case 8:case"end":return t.stop()}}),t)})))()},autoOpenMailHandler:function(e){var t=this,i=this.mails,n=i.findIndex((function(t){return t.msgIds&&t.msgIds.includes(e)})),a=i[n];if(console.assert(n>-1),(0,_t.eE)()&&document.hidden){console.warn("document.hidden, wait mac webview visible");var s=function e(){t.scrollListAndOpenDetail(n,a,{scroll:!document.hidden,onFinish:function(){return document.removeEventListener("visibilitychange",e)}})};document.addEventListener("visibilitychange",s)}else this.scrollListAndOpenDetail(n,a,{scroll:!0})},scrollListAndOpenDetail:function(e,t,i){var n=this,a=i.scroll,s=i.onFinish;try{var r;console.debug(" document.hidden=".concat(document.hidden," scrollListAndOpenDetail")),a&&(null===(r=this.$refs.recycleScroller)||void 0===r||r.scrollToItem(e)),setTimeout((function(){n.handleShowDetail(t,{override:!0,autoOpen:!0})}),200)}catch(Do){console.error("scrollListAndOpenDetail error",Do)}finally{null===s||void 0===s||s()}},hideFromDelegates:function(){this.showActions=!1,(0,Jt.OJ)(this.selectedMailHeads,this.currentLabelId)},showToDelegates:function(){this.showActions=!1,(0,Jt.b_)(this.selectedMailHeads,this.currentLabelId)},setSelectInboxes:function(e){this.resetSelectedInboxMailIds({mailIds:e})},handleCheckMore:function(e){console.log(e),console.log(this.inboxList);var t={All:this.selectAllThreads,None:this.unselectAllThreads,Unread:this.selectAllUnreadMails,Read:this.selectAllReadMails,Starred:this.selectStarredMails,Unstarred:this.selectAllUnstarredMails},i=t[e];console.assert("function"===typeof i),i(),this.clearLastSelectedInboxMailId()},updateZoomRadio:function(e){var t=this;["headerBar","contextMenu"].forEach((function(i){t.$refs[i]&&(t.$refs[i].style.zoom="".concat(100*e,"%"))})),this.$refs.controlHeader&&(this.$refs.controlHeader.$refs.controlHeader.style.zoom="".concat(100*e,"%"))},handleShowDetail:function(e,t){var i=arguments,n=this;return(0,r.Z)((0,s.Z)().mark((function a(){var r,o,l,c;return(0,s.Z)().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(o=i.length>2&&void 0!==i[2]?i[2]:"",n.$refs.detailRef||(console.warn("no found detailRef",n.$refs),window.location.reload()),o){a.next=5;break}return null===(l=n.$refs.detailRef)||void 0===l||l.directlyOpen(e,t),a.abrupt("return");case 5:c=e.mailId,null===(r=n.$refs.detailRef)||void 0===r||r.open(o,c,t);case 7:case"end":return a.stop()}}),a)})))()},deselectItem:function(e){this.removeSelectedInboxMailIds({mailIds:[e]}),this.lastSelectedInboxMailId===e&&this.clearLastSelectedInboxMailId()},handleItemsMoveToInbox:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,t.moveMails({mails:e,fromLabelId:t.currentLabelId,toLabelId:ws.INBOX,metricConfig:{metricKey:"inbox_item_mark",params:{labelId:t.currentLabelId,mark:Ls.MOVE_TO_INBOX,msgId:e.map((function(e){return e.mailId}))}}});case 2:case"end":return i.stop()}}),i)})))()},handleItemsNotSpam:function(e){this.notSpamMails({mails:e,fromLabelId:this.currentLabelId})},metricItemAction:function(e,t,i){var n={Read:Ls.READ,UnRead:Ls.UNREAD,Starred:Ls.STARRED,UnStarred:Ls.UN_STARRED,moveToInbox:Ls.MOVE_TO_INBOX,delete:Ls.DELETE,spam:Ls.SPAM,notSpam:Ls.NOT_SPAM,archive:Ls.ARCHIVE},a=n[e]||e;i?this.$metric.report("inbox_item_mark",{labelId:this.currentLabelId,mark:a,msgId:t,error:this.$metric.apiError(i)}):this.$metric.report("inbox_item_mark",{labelId:this.currentLabelId,mark:a,msgId:t})},handleItemsMark:function(e,t){var i=this;return(0,r.Z)((0,s.Z)().mark((function n(){var a;return(0,s.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i.showActions=!1,a=1===e.length?e[0].labelId:i.currentLabelId,n.next=4,i.markMails({mails:e,fromLabelId:a,markType:t});case 4:case"end":return n.stop()}}),n)})))()},handleCheckAllChange:function(e){e?this.resetSelectedInboxMailIds({mailIds:this.inboxList.filter((function(e){return(0,Qt.w)(e)})).map((function(e){return e.mailId}))}):this.clearSelectedInboxMailIds(),this.clearLastSelectedInboxMailId()},setupMultiSelectHandlers:function(){var e=this;window.addEventListener("keydown",this.trackShiftPressed=function(t){"Shift"===t.key&&(e.shiftModifier=!0)}),window.addEventListener("keyup",this.trackShiftReleased=function(t){"Shift"===t.key&&(e.shiftModifier=!1)}),window.addEventListener("blur",this.trackWindowBlurred=function(){e.shiftModifier=!1})},cleanupMultiSelectHandlers:function(){window.removeEventListener("keydown",this.trackShiftPressed),window.removeEventListener("keyup",this.trackShiftReleased),window.removeEventListener("blur",this.trackWindowBlurred)},handleCheckedItemsChange:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n,a,r,o,l,c,d,u;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=e.mailId,a=e.status,console.debug("===> handle item select",t.selectedInboxMailIds,t.lastSelectedInboxMailId,n),t.lastSelectedInboxMailId&&t.shiftModifier&&(o=t.inboxList.findIndex((function(e){return e.mailId===t.lastSelectedInboxMailId})),o>=0&&(l=t.inboxList.findIndex((function(e){return e.mailId===n})),l>=0&&(r=[Math.min(o,l),Math.max(o,l)+1]))),c=[n],r&&(c=(d=t.inboxList).slice.apply(d,(0,f.Z)(r)).filter((function(e){return e.mailId&&!e.isPlain})).map((function(e){return e.mailId}))),u=new Set(t.selectedInboxMailIds),console.debug("modify inbox selection range",a,n,c),i.next=9,t.setLastSelectedInboxMailId({mailId:n});case 9:a?u.has(n)?t.removeSelectedInboxMailIds({mailIds:c}):t.addSelectedInboxMailIds({mailIds:c}):t.removeSelectedInboxMailIds({mailIds:c});case 10:case"end":return i.stop()}}),i)})))()},handleSync:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.handleSyncAllLabelMails();case 2:case"end":return t.stop()}}),t)})))()},handleSyncAllLabelMails:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.refreshRun=!0,!window.zoomSdk){t.next=7;break}return t.next=4,window.zoomSdk.postJsMessage({functionName:"mailui_syncmails",params:{}});case 4:setTimeout((function(){e.refreshRun=!1}),3e3),t.next=8;break;case 7:setTimeout((function(){e.refreshRun=!1}),3e3);case 8:case"end":return t.stop()}}),t)})))()},goToSettings:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.isOutlook||(0,is.H)(),this.setScrollPositionY(null===(e=this.$refs.recycleScroller)||void 0===e?void 0:e.getScroll().start),this.$router.push({name:"emailSettings",path:"/emailSettings",params:(0,l.Z)({path:this.$route.path},t)})},instantFetchMailHeads:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];console.log("instantFetchMailHeads for ".concat(e),i);var n=[],a=(0,Ct.throttle)((function(){var i=n.slice(0);n=[],t.$store.commit("batchAddMailHeads",{labelId:e,mailHeads:i})}),500),s=0,r=0;i.forEach((function(o){u.Inbox.getMailHead({labelId:e,mailId:o}).then((function(e){e&&(n.push(e.mailHead),a())}))["catch"]((function(t){r++,console.error("[LoadMore] initial load ".concat(e," ").concat(o," failed"),t)}))["finally"]((function(){s++,console.log("[LoadMore] initial loaded (".concat(s,"/").concat(i.length,")")),s===i.length&&(t.errorStatus=r>0,t.setLabelLoadingState({labelId:e,flag:!1}),console.log("%c[LoadMore] initial load finished, total ".concat(s," thread"),"font-weight: bold; color: green"))}))}))},flattenMails:function(e){var t=this,i=["Upcoming","Today","All"],n=Object.keys(e).sort((function(e,t){var n=i.indexOf(e),a=i.indexOf(t),s=n>-1&&a>-1;return s?n-a:-1===n&&-1===a?t-e:n>-1?-1:a>-1?1:0}));return n.reduce((function(i,n){var a=e[n],s=40*t.scaleRatio,r=80*t.scaleRatio;if(a.length){i.push({mailId:n,isPlain:!0,value:n,height:s});var o="Upcoming"===n?function(e,t){return e.mailHead.date-t.mailHead.date}:function(e,t){return t.mailHead.date-e.mailHead.date};i.push.apply(i,(0,f.Z)(a.map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{height:t.isSplitView?r:s})})).sort(o)))}return i}),[])},checkIsLabelInited:function(){return Object.keys(this.mailHead).length>=this.maxNumberMailsPerRequest},loadMore:function(){var e=arguments,t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n,a,r,o,l,c,d,u,h;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=e.length>0&&void 0!==e[0]?e[0]:t.maxNumberMailsPerRequest,console.log("[LoadMore] start"),a=t.currentLabelId,t.$Bus.$emit("onLoadMore"),!t.shouldExecuteLoadMore(a)){i.next=33;break}return t.setLabelLoadingState({labelId:a,flag:!0}),t.errorStatus=!1,console.log("[LoadMore] reset errorStatus"),i.next=10,t.fetchMails({labelId:a,count:n});case 10:if(r=i.sent,o=r.errorCode,l=r.data,c=r.error,!o){i.next=19;break}return console.error("[LoadMore] mailui_listthreads failed ".concat(o,"."),c),t.errorStatus=!0,t.setLabelLoadingState({labelId:a,flag:!1}),i.abrupt("return");case 19:if(d=l.mailIds,u=l.isLastPage,h=l.threadIdToName,console.log("[LoadMore] list mails done, try to load ".concat(d.length," mail head, labelId(").concat(a,") isLastPage(").concat(u,") isConversationView(").concat(t.isConversationView,")"),d),t.updateLastPageFlag({labelId:a,isLastPage:u}),t.storeThreadIdToName(h),!(d.length>0)){i.next=32;break}if(t.checkIsLabelInited()||t.isOutlook){i.next=28;break}t.instantFetchMailHeads(a,d),i.next=30;break;case 28:return i.next=30,t.batchGetMailHead(a,d);case 30:i.next=33;break;case 32:t.setLabelLoadingState({labelId:a,flag:!1});case 33:case"end":return i.stop()}}),i)})))()},shouldExecuteLoadMore:function(e){return this.isAllowLoadMore?this.isLabelReachLastPage(e)?(console.log("[LoadMore] ".concat(e," already reach last Page, skip.")),!1):this.isLabelLoading(e)?(console.log("[LoadMore] ".concat(e," already in loading state, waiting load finish, skip.")),!1):this.inSearching?(console.log("[LoadMore] inSearching, skip."),!1):!this.inFilters||(console.log("[LoadMore] inFilters, skip."),!1):(console.log("[LoadMore] Not allow load more now"),!1)},batchGetMailHead:function(e,t){var i=this;return(0,r.Z)((0,s.Z)().mark((function n(){var a,r;return(0,s.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:console.log("[LoadMore] batchGetMailHead."),a=i.isAllMailLoaded(e,t),console.log("[LoadMore] batchGetMailHead. allMailIdExisted",a),r=function(){i.isMailListScrollToEnd()&&i.isMailListViewportFilled()?i.$nextTick((function(){console.warn("[LoadMore] allMailIdExisted, mailList ScrollUp 15px."),i.$refs.recycleScroller.$el.scrollBy(0,-15)})):console.log("[LoadMore] allMailIdExisted, no need to ScrollUp.")},i.getAllMailHead({labelId:e,mailIds:t,onError:function(){i.errorStatus=!0,i.setLabelLoadingState({labelId:e,flag:!1})},onFinish:function(){i.setLabelLoadingState({labelId:e,flag:!1}),r()}});case 5:case"end":return n.stop()}}),n)})))()},storeThreadIdToName:function(e){Array.isArray(e)&&this.enableRenameSubject&&this.batchSetThreadIdToName(e)},handleShowActions:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(e.e,n=e.item,console.log("handleShowActions",n),t.currentLabelId!==ws.OUTBOX){i.next=4;break}return i.abrupt("return");case 4:return t.selectItem=n,t.updateCheckedItems(n.mailId),t.showActions=!0,t.allContextMenuSendersAreSelf=!0,i.next=10,t.getAllContextMenuSendersAreSelf();case 10:t.allContextMenuSendersAreSelf=i.sent;case 11:case"end":return i.stop()}}),i)})))()},updateCheckedItems:function(e){this.selectedInboxMailIds.includes(e)?this.addSelectedInboxMailIds({mailIds:[e]}):this.resetSelectedInboxMailIds({mailIds:[e]})},setSelectItem:function(e){this.selectItem=e},calculateContextMenuPosition:function(e){var t=this;this.$nextTick((function(){var i,n=window.innerWidth,a=window.innerHeight,s=document.getElementById("mail-right"),r=(null===s||void 0===s?void 0:s.scrollLeft)||0,o=(null===s||void 0===s?void 0:s.scrollTop)||0,l=e.clientX,c=e.clientY,d=null===(i=document.getElementById("mail-list-actions-menu"))||void 0===i?void 0:i.getBoundingClientRect(),u=d.height,h=d.width;t.actionX=(e.clientX>n-h-20?l-h:l)+r,t.actionY=(e.clientY>a-u-20?c-u:c)+o,console.log("event:(".concat(e.clientX,", ").concat(e.clientY,") view(").concat(n,", ").concat(a,") clickX:(").concat(l.toFixed(2),", ").concat(c,") action(").concat(t.actionX,", ").concat(t.actionY,")"))}))},handleHideActions:function(){this.showActions=!1},goBack:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";/^\/main.?/gim.test(this.$route.path)||this.$router.replace({path:"/main"}),this.$store.commit("changeShowDetail",!1),this.$metric.report("detail_back",{msgId:e})},handleArchiveItems:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return console.debug("[thread action] archive",e),t.showActions=!1,n=1===e.length?e[0].labelId:t.currentLabelId,i.next=5,t.archiveMails({mails:e,fromLabelId:n});case 5:case"end":return i.stop()}}),i)})))()},handleTrashItems:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return console.debug("[thread action] trash / delete forever"),t.showActions=!1,i.next=4,t.trashMails({mails:e,fromLabelId:1===e.length?e[0].labelId:t.currentLabelId});case 4:case"end":return i.stop()}}),i)})))()},handleDeleteForeverItems:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return t.showActions=!1,i.next=3,t.deleteForeverMails({mails:e,fromLabelId:1===e.length?e[0].labelId:t.currentLabelId});case 3:case"end":return i.stop()}}),i)})))()},handleReadToggle:function(){var e=arguments,t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n,a,r,o;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=!(e.length>0&&void 0!==e[0])||e[0],a=t.selectItem,r=n?"Read":"UnRead",i.next=5,u.Inbox.markMail({fromLabelId:t.selectItem.labelId,groupMsgsIds:t.selectedInboxItems,mailMarkType:r});case 5:o=i.sent,0===o.returnCode?(t.$store.commit("changeMailHead",{labelId:a.labelId,mailId:a.mailId,type:"isUnread",status:"UnRead"===r}),t.metricItemAction(r,a.mailId)):t.metricItemAction(r,a.mailId,o),t.showActions=!1;case 8:case"end":return i.stop()}}),i)})))()},handleDiscardDrafts:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n,a,r,o;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return console.log("Inbox ==> Discard Drafts",e,t.selectedInboxItems,t.selectItem),n=t.selectItem,a={fromLabelId:e?d.Enums.SystemDefinedMailLabelIds.DRAFT:n.labelId,groupMsgsIds:e?t.selectedInboxItems:[{groupId:n.mailId,msgIds:n.mailHead.msgIds}]},i.next=5,u.Inbox.discardDraft(a);case 5:r=i.sent,console.log("discardDraft result",r),r?(o=e?t.selectedInboxItems.map((function(e){return e.groupId})).includes(t.currentInboxItemMailId):t.currentInboxItemMailId===n.mailId,o&&t.changeShowDetail(!1),t.$undoNotice({title:t.$t("operation.draftsDiscarded")}),e?(t.selectedInboxItems.forEach((function(e){t.$store.commit("removeInstantDraftsForMails",e.msgIds),t.$emit("resetInstantDraftsMsgIdByThreadIds",e.msgIds)})),t.metricItemAction("delete",t.selectedInboxItems.map((function(e){return e.groupId})))):(t.$store.commit("removeInstantDraftsForMails",[n.mailId]),t.$emit("resetInstantDraftsMsgIdByThreadIds",[n.mailId]),t.metricItemAction("delete",n.mailId)),t.clearSelectedInboxMailIds()):(t.$msg(t.$t("operation.failedToDiscardDrafts")),e?t.metricItemAction("delete",t.selectedInboxItems.map((function(e){return e.groupId})),r):t.metricItemAction("delete",n.mailId,r)),t.showActions=!1;case 9:case"end":return i.stop()}}),i)})))()},handleCancelScheduledSend:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return t.clearCurrentInboxItemMailId(),t.setCurrentInboxItem(null),i.next=4,Promise.all(e.map(function(){var e=(0,r.Z)((0,s.Z)().mark((function e(i){return(0,s.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getScheduleMsgIds(i);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())).then((function(e){var i,n=(i=[]).concat.apply(i,(0,f.Z)(e));return Promise.all(n.map(function(){var e=(0,r.Z)((0,s.Z)().mark((function e(t){var i;return(0,s.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,yi.l.cancelSendingMail(t);case 2:if(i=e.sent,0===i.returnCode){e.next=5;break}throw Error("fail to cancel send");case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()))["catch"]((function(e){t.$undoNotice({iconClass:"crossmark",title:t.$t("notification.failedToCancel")})})),n})).then((function(i){t.$undoNotice({iconClass:"checkmark",title:t.$t("operation.cancelledScheduledSendAndRevertedToDraft")}),1===i.length&&t.composeDraftForCancelSend(e[0])}));case 4:case"end":return i.stop()}}),i)})))()},composeDraftForCancelSend:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n,a,r;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,u.Inbox.getMailDetails({mailIds:[e],labelId:t.currentLabelId});case 2:return n=i.sent,a=n.mailDetails[0],r={key:(0,wi.Z)(),composeItem:(0,l.Z)({},a),isDraft:!0},t.$store.commit("addInstantDraftList",r),t.$compose({composeItem:r.composeItem}),t.clearSelectedInboxMailIds(),i.abrupt("return");case 9:case"end":return i.stop()}}),i)})))()},getScheduleMsgIds:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,u.Inbox.getMailDetails({mailIds:[e],labelId:t.currentLabelId});case 2:if(n=i.sent,console.warn("getScheduleMsgIds mailDetailRes",n),!n){i.next=6;break}return i.abrupt("return",n.mailDetails.filter((function(e){var i;return(null===(i=e.mailHead)||void 0===i?void 0:i.allLabelIds)&&e.mailHead.allLabelIds.includes(t.currentLabelId)})).map((function(e){return e.mailHead.msgId})));case 6:case"end":return i.stop()}}),i)})))()},resetLastInboxRefreshDate:function(){var e=(0,kt.YZ)();return(!this.LastInboxRefreshDate||this.LastInboxRefreshDate.getTime()!==e.getTime())&&(this.$store.commit("setLastInboxRefreshDate",e),!0)},refreshIfDateChanged:function(){this.resetLastInboxRefreshDate()&&(console.debug("===> refresh mail list: document visibilitychange or window focus"),this.refreshMailList())},changeSearchErrorStatus:function(e){this.searchErrorStatus=e},redirectToThread:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n,a,r,o;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=e.mailId,a=e.mailHead,r=e.scrollToMessageId,console.log("redirectToThread",n,a,r),n&&a){i.next=4;break}return i.abrupt("return");case 4:o=t.mails.includes((function(e){return e.mailId===n})),!o&&t.clearSplitViewSelectedMail(),console.debug("redirect to mailHead",a,o),t.handleShowDetail(a,{override:!0,autoOpen:!0,standalone:t.isSplitView&&!o,scrollToMessageId:r},a.labelId);case 8:case"end":return i.stop()}}),i)})))()},handleItemsSpamToggle:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(e||(e=t.selectedThreadItems),!t.isZmail||!t.allSelectedInvalidToSpam){i.next=3;break}return i.abrupt("return");case 3:return t.showActions=!1,n=t.currentLabelId===ws.SPAM?t.notSpamMails:t.spamMails,i.next=7,n({mails:e,fromLabelId:t.currentLabelId});case 7:case"end":return i.stop()}}),i)})))()},showApproveDialog:function(){this.showApproveUserDialog=!0,this.hasBold={key:"operation.approveDialogInfo",email:"".concat(this.selectedUserEmail.displayName," <").concat(this.selectedUserEmail.emailAddr,">")}},cancelApprove:function(){this.showApproveUserDialog=!1},approveUser:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){var i,n,a,o,l;return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(i=e.selectedUserEmail.emailAddr,e.showApproveUserDialog=!1,!i){t.next=21;break}return t.prev=3,t.next=6,u.Mail.getSpamType(i);case 6:if(n=t.sent,a=n.data,a){t.next=10;break}return t.abrupt("return");case 10:return o=a.BatchGetSpamTypes[0].spamType,t.next=13,Dt.t.reportSpam({sender:i.replace(/'/g,"&apos"),type:qt.NW.ALLOWLIST});case 13:l=function(){var t=(0,r.Z)((0,s.Z)().mark((function t(){return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Dt.t.reportSpam({sender:i.replace(/'/g,"&apos"),type:o});case 3:t.next=8;break;case 5:t.prev=5,t.t0=t["catch"](0),e.$msg({type:"Error",content:e.$t("detail.undoFailed")});case 8:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(){return t.apply(this,arguments)}}(),e.$undoNotice({iconClass:"checkmark",title:e.$t("operation.emailAddressApproved"),action:e.$t("operation.undo"),actionCallback:l}),t.next=21;break;case 17:t.prev=17,t.t0=t["catch"](3),console.log(t.t0),e.$msg({type:"Error",content:e.$t("operation.approveFailedContent",[e.selectedUserEmail.displayName])});case 21:case"end":return t.stop()}}),t,null,[[3,17]])})))()},handleVisibilityChange:function(){document.hidden||this.refreshIfDateChanged();var e=Bt.ou.now();if(document.hidden)this.storedTime=e;else if(this.storedTime){var t=Bt.ou.now().diff(this.storedTime,"hours");t.toObject().hours>6&&this.clearLastReadInboxMailId()}},closeGetStartedModal:function(){this.showGetStartedModal=!1,this.$store.commit("auth/setIsFirstLogin",!1)},handDevInfo:function(e){this.showDevJIRA=e},retry:function(){this.errorStatus&&(this.errorStatus=!1),this.searchErrorStatus&&(this.errorStatus=!1),this.loadMore()},showRenameSubjectDialog:function(e){var t=(null===e||void 0===e?void 0:e.mailId)&&e||this.selectItem;this.changeRenameSubjectDialogVisible(!0),this.renameMailHeadItem=t,this.showActions=!1},closeRenameSubjectDialog:function(){this.changeRenameSubjectDialogVisible(!1),this.renameMailHeadItem=null},instantOpenDetails:function(e){var t=this;console.log("instantOpenDetails onCardClick",e);var i=this.replyLaterMailHeads.find((function(t){var i=t.mailId;return e.id===i})),n=i.mailHead.allLabelIds,a=n.includes(this.currentLabelId)?this.currentLabelId:n.find((function(e){return!t.replyLaterLabelIds.includes(e)}));this.changeSelectedLabelById(a),this.handleShowDetail(i,{autoOpen:!0,goToReplyLatestMsg:!0},a)},onRemoveReplyLater:function(e){this.removeReplyLater(e.id)},isAddonItemId:function(e){return Object.values(Ms).includes(e)},isMailListViewportFilled:function(){var e=document.querySelector("#virtual-container"),t=document.querySelector("#threads-list");if(!e||!t)return!0;var i=e.clientHeight,n=t.clientHeight;return console.log("isMailListViewportFilled containerHeight(".concat(i,") contentHeight(").concat(n,")"),i<n&&n),0===i&&0===n||i<n&&n},isMailListScrollToEnd:function(){var e=document.querySelector("#virtual-container"),t=document.querySelector("#threads-list");return!e||!t||(console.log("[Search] isMailListScrollToEnd",e.clientHeight+e.scrollTop>=t.clientHeight-40,e.clientHeight+e.scrollTop,t.clientHeight-40),e.clientHeight+e.scrollTop>=t.clientHeight-40)},handleReplyLater:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectedInboxItems,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.currentLabelId;Array.isArray(e)||(e=[e]),this.$store.dispatch("mail/markAsReplyLater",{labelId:t,mails:e.filter((function(e){return e})).map((function(e){var t=e.mailId,i=e.groupId,n=e.msgIds;return{mailId:i||t,msgIds:n}}))})},outerClick:function(e){this.$Bus.$emit("outerClicked",e)},handleScreenerSelect:function(e){this.showScreenerDialog=!0,this.$refs.screenerDialog.openSender(e)},handleViewFilters:function(){var e;null===(e=this.$refs.searchRef)||void 0===e||e.useAdvancedSearchOptions()},handleSearchFilterChange:function(e){var t;null===(t=this.$refs.searchRef)||void 0===t||t.updateAdvSearchOptions(e)},createFilterFromSelectedItem:function(){this.selectItem&&this.$Bus.$emit("showCreateFilter",{from:this.selectItem.mailHead.from.emailAddr,mailIds:[this.selectItem.mailHead.mailId]})},toggleListView:function(){this.isSplitView?(this.$store.commit("changeShowDetail",!1),this.$store.commit("setSplitView",!1)):(this.$store.commit("clearSplitViewSelectedMail"),this.$store.commit("setSplitView",!0))},handleEmptyStart:function(){this.isEmptying=!0,this.clearSelectedInboxMailIds()},handleEmptyEnd:function(){this.isEmptying=!1,this.loadMore()},snoozeEmails:function(e){var t=this.currentLabelId===ws.SNOOZED,i=this.selectedInboxItems.map((function(e){var t=e.msgIds;return t})).flat();t?this.updateSnoozeTime({labelId:this.currentLabelId,msgIds:i,notifyTime:e}):this.snoozeMessages({labelId:this.currentLabelId,msgIds:i,notifyTime:e})},onUnsnooze:function(){var e=this.selectedInboxItems.map((function(e){var t=e.msgIds;return t})).flat();this.unsnoozeMessages({labelId:this.currentLabelId,msgIds:e})},contextMenuIsAvailable:function(e){return!xs.includes(this.currentLabelId)&&Array.from(document.getElementsByClassName("inbox-item")).filter((function(t){return t.contains(e.target)})).length>0},handlePopoutDetail:function(e){if(e){var t=e.mailId;this.popoutDetails(t)}},popoutSelectedInboxItemsDetails:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){var i;return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.showActions=!1,t.next=3,u.Thread.getPopoutThreadCount();case 3:if(i=t.sent,!(e.selectedInboxMailIds.length>ks-i)){t.next=7;break}return e.$notice({title:e.$t("detail.tooManyEmailsOpenedAtOnce"),duration:3e3}),t.abrupt("return");case 7:e.popoutDetails(e.selectedInboxMailIds);case 8:case"end":return t.stop()}}),t)})))()},popoutDetails:function(e){var t=Array.isArray(e)?e:[e];console.debug("popoutDetails",t),u.Thread.popoutThread({threadIds:t,labelId:this.currentLabelId})}})},Ds=_s,Ts=(0,E.Z)(Ds,It,yt,!1,null,"082377b4",null),Es=Ts.exports,$s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"banner"},[t("span",{staticClass:"banner-left"},[t("svg-icon",{staticClass:"icon",attrs:{iconClass:"vacation"}}),t("span",{staticClass:"text"},[e._v(" "+e._s(e.vacationResponder.responseSubject)+" ")])],1),t("zm-dropdown",{attrs:{trigger:"click"},on:{command:e.handleCommand}},[t("zm-button",{staticClass:"more-btn",attrs:{ghost:"","aria-label":e.$t("accessibility.moreMenu")}},[t("svg-icon",{attrs:{iconClass:"more-horizontal"}})],1),t("zm-dropdown-menu",{staticClass:"vacation-banner-dropdown",attrs:{slot:"dropdown"},slot:"dropdown"},[e.editVacationPermission?t("zm-dropdown-item",{attrs:{command:"end","zm-ta":"vacation-banner-end-vacation"}},[e._v(" "+e._s(e.$t("vacationSettings.endNow"))+" ")]):e._e(),t("zm-dropdown-item",{attrs:{command:"go2setting","zm-ta":"vacation-banner-go-to-vacation-setting"}},[e._v(" "+e._s(e.$t("vacationSettings.vacationSettings"))+" ")])],1)],1)],1)},As=[],Rs={name:"VacationResponderBanner",computed:(0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)(["vacationResponder"])),(0,h.Se)("delegate",["permissionRole"])),{},{editVacationPermission:function(e){var t=e.permissionRole;return(0,c.yz)(t,c.Vn.EDIT_VACATION)}}),methods:{disableVacationAutoReply:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){var i,n,a,r,o,c,d;return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i=(0,l.Z)({},e.vacationResponder),i.enableAutoReply=!1,n=JSON.stringify(i),t.prev=3,t.next=6,u.Setting.updateVacationResponder({vacationResponder:n});case 6:if(r=t.sent,o=r.errorCode,c=r.data,0===o){t.next=11;break}throw Error("fail to update vac info");case 11:d=JSON.parse(null===c||void 0===c||null===(a=c.UpdateVacationResponder)||void 0===a?void 0:a.vacationResponder),e.$store.commit("setVacationResponder",d),e.$undoNotice({title:e.$t("vacationSettings.vacationResponderDisabled")}),t.next=19;break;case 16:t.prev=16,t.t0=t["catch"](3),e.$msg({type:"Error",content:e.$t("vacationSettings.failedToUpdateVacationResponder")});case 19:case"end":return t.stop()}}),t,null,[[3,16]])})))()},goVacationSetting:function(){this.$router.push({name:"emailSettings",path:"/emailSettings",params:{tab:"vacation",path:this.$route.path}})},handleCommand:function(e){"end"===e&&this.disableVacationAutoReply(),"go2setting"===e&&this.goVacationSetting()}}},Zs=Rs,Os=(0,E.Z)(Zs,$s,As,!1,null,"5dc39e90",null),zs=Os.exports,Ns=function(){var e=this,t=e._self._c;return e.showDragImage?t("div",{staticClass:"drag-image-wrap",style:e.coordsStyles},[t("div",{staticClass:"drag-image"},[t("svg-label",{attrs:{iconClass:"stroke-label",labelColor:"var(--zoom-blue)"}}),e._v(" "+e._s(e.$tc("operation.moveNumMessage",e.numDraggedEmails,[e.numDraggedEmails]))+" ")],1)]):e._e()},Ps=[],Fs={name:"ThreadDragImage",computed:(0,l.Z)((0,l.Z)({},(0,h.rn)(["draggedEmails","dragImageCoords","dragCursorStyle"])),{},{numDraggedEmails:function(){return this.draggedEmails.length},showDragImage:function(){return this.numDraggedEmails>0&&this.dragImageCoords[0]>=0&&this.dragImageCoords[1]>=0},coordsStyles:function(){return{left:"".concat(this.dragImageCoords[0],"px"),top:"".concat(this.dragImageCoords[1],"px")}}}),watch:{dragCursorStyle:function(e){switch(this.clearCursorStyle(),e){case"not-allowed":document.body.classList.add("banned");break;case"grab":document.body.classList.add("grabbing");break}},showDragImage:function(e){e?document.body.classList.add("grabbing"):this.clearCursorStyle()}},methods:{clearCursorStyle:function(){document.body.classList.remove("grabbing"),document.body.classList.remove("banned")}}},Vs=Fs,Hs=(0,E.Z)(Vs,Ns,Ps,!1,null,null,null),Bs=Hs.exports,Us=function(){var e,t=this,i=t._self._c;return i("span",{staticClass:"mail-service",attrs:{tabindex:"0","zm-ta":"account-dropdown"}},[t.isGmail?i("svg-icon",{attrs:{"zm-ta":"current-mail-type-Google","aria-label":"Google",iconClass:"Google_logo","class-name":"mail-service-logo"}}):t._e(),t.isOutlook?i("svg-icon",{attrs:{"zm-ta":"current-mail-type-Microsoft","aria-label":"Microsoft",iconClass:"Microsoft_logo","class-name":"mail-service-logo"}}):t._e(),t.isZmail&&!t.isDelegated?i("svg-icon",{attrs:{"zm-ta":"current-mail-type-Zoom","aria-label":"Zoom",iconClass:"Zoom_logo","class-name":"mail-service-logo mail-service-logo-zoom"}}):t._e(),t.isZmail&&t.isDelegated?i("svg-icon",{attrs:{"zm-ta":"current-mail-type-Zoom","aria-label":"Zoom",iconClass:"Delegate_logo","class-name":"mail-service-logo"}}):t._e(),i("span",{class:["mail-service-name",{delegated:t.isDelegated}]},[t._v(" "+t._s((null===(e=t.account)||void 0===e?void 0:e.name)||"")+" ")]),i("SvgIcon",{attrs:{iconClass:"chevron-small-down"}})],1)},js=[],Ws=i(8158),Ks={name:"MailLogo",mixins:[Ws.Z],computed:(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)(["typeOfEmail"])),(0,h.rn)({isDelegated:function(e){return e.userProfile.isDelegated}})),(0,h.Se)(["isGmail","isZmail","isOutlook"])),{},{mailServiceName:function(){var e,t=(e={},(0,wt.Z)(e,d.Enums.EMAIL_PROVIDER.GMAIL,"Google"),(0,wt.Z)(e,d.Enums.EMAIL_PROVIDER.OFFICE365,"Microsoft"),(0,wt.Z)(e,d.Enums.EMAIL_PROVIDER.ZMAIL,"Zoom"),e);return t[this.typeOfEmail]||"Mail"},account:function(e){var t=e.currentUserAccountId,i=e.accountLists;return i.find((function(e){return e.accountId===t}))}})},Ys=Ks,Xs=(0,E.Z)(Ys,Us,js,!1,null,"b415c578",null),Gs=Xs.exports,qs=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"list"},e._l(e.items,(function(i){return t("div",{key:i.id,staticClass:"list-item"},[t("AddonItem",{attrs:{itemId:i.id,icon:i.icon,label:i.label,isSelected:e.isSelected(i)},on:{click:function(t){return e.onClick(i)}}})],1)})),0)])},Js=[],Qs=function(){var e=this,t=e._self._c;return t("zm-tooltip",{attrs:{placement:"right",content:e.isSidebarMinimized?e.label:"",disabled:!e.isSidebarMinimized,enterable:!1}},[t("div",{class:["addon-item",{"addon-item__selected":e.isSelected,"addon-item__minimized":e.isMinimized}],attrs:{id:"addon_item_".concat(e.itemId),tabindex:"-1","aria-label":e.label},on:{click:e.handleClick,keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleClick.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])?null:e.handleClick.apply(null,arguments)}]}},[t("svg-icon",{staticClass:"addon-item-icon",attrs:{"aria-hidden":"true",isSelected:e.isSelected,iconClass:e.iconClass}}),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.isMinimized,expression:"!isMinimized"}],staticClass:"addon-item-content"},[t("span",{class:["addon-item-label"],attrs:{tabindex:"-1"}},[e._v(" "+e._s(e.label)+" ")]),t("svg-icon",{staticClass:"beta-icon",attrs:{"aria-hidden":"true",iconClass:"beta"}})],1)],1)])},er=[],tr={name:"AddonItem",props:{itemId:{type:String,required:!0},label:{type:String,required:!0},icon:{type:String,required:!0},isSelected:{type:Boolean,default:!1}},computed:(0,l.Z)((0,l.Z)({},(0,h.rn)(["isSidebarMinimized","isSidebarResizing"])),{},{iconClass:function(){return this.isSelected?"".concat(this.icon,"-filled"):this.icon},isMinimized:function(e){var t=e.isSidebarMinimized;e.isSidebarResizing;return t&&!this.isSidebarResizing}}),methods:{handleClick:function(){this.$emit("click")}}},ir=tr,nr=(0,E.Z)(ir,Qs,er,!1,null,"648e3b88",null),ar=nr.exports,sr=d.Enums.ADDON_ITEM_IDS,rr={name:"AddonList",components:{AddonItem:ar},data:function(){return{items:[{id:sr.STICKER,icon:"sticker",label:this.$t("sticker.stickers")}]}},computed:(0,l.Z)({},(0,h.rn)(["selectMailLabel"])),methods:{isSelected:function(e){var t;return(null===(t=this.selectMailLabel)||void 0===t?void 0:t.id)===e.id},onClick:function(e){this.$emit("select",e.id)}}},or=rr,lr=(0,E.Z)(or,qs,Js,!1,null,"d5b5dfaa",null),cr=lr.exports,dr=function(){var e=this,t=e._self._c;return t("div",{staticClass:"addon-view-root"},[e.isStickerPageSelected?t("StickerPage"):e._e()],1)},ur=[],hr=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.jumping,expression:"jumping"}],staticClass:"sticker-page-root",attrs:{"element-loading-spinner":"zm-icon-loading"}},[t("div",{staticClass:"page-header"},[t("span",{staticClass:"page-title"},[e._v(e._s(e.$t("sticker.listTitle"))+" ")]),t("zm-tooltip",{attrs:{content:e.$t("common.settings"),placement:"bottom",enterable:!1}},[t("zm-button",{directives:[{name:"metric",rawName:"v-metric:inbox_go_setting",arg:"inbox_go_setting"}],staticClass:"header-bar-btn",attrs:{tabindex:"0","zm-ta":"inbox-go-setting-page","aria-expanded":void 0,"aria-label":e.$t("common.settings")},on:{click:e.goToSettings}},[t("svg-icon",{attrs:{iconClass:"setting"}})],1)],1)],1),t("StickerPageActionHeader"),t("StickerList",{staticClass:"sticker-list",attrs:{stickers:e.sortedStickers},on:{delete:e.handleDelete,viewEmail:e.handleViewEmail,loadMore:e.handleLoadMore}})],1)},mr=[],pr=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.isInitialLoading,expression:"isInitialLoading"}],staticClass:"sticker-list-root",attrs:{"element-loading-spinner":"zm-icon-loading"}},[0===e.stickers.length?t("div",{staticClass:"sticker-list-empty"},[e.isSearchFinished?[t("img",{staticClass:"empty-image",attrs:{src:i(32176)}}),t("div",{staticClass:"empty-search-tip"},[e._v(e._s(e.$t("common.noSearchResult")))])]:[t("img",{staticClass:"empty-image",attrs:{src:i(28798)}}),t("div",{staticClass:"empty-title"},[e._v(e._s(e.$t("sticker.emptyTitle")))]),t("div",{staticClass:"empty-sub-title"},[e._v(e._s(e.$t("sticker.emptySubTitle")))]),t("div",{staticClass:"empty-actions"},[t("zm-button",{attrs:{type:"primary"},on:{click:e.handleGoToInbox}},[e._v(e._s(e.$t("sticker.goToInbox")))])],1)]],2):t("Waterfall",{staticClass:"sticker-list-waterfall",attrs:{items:e.stickers,itemLoading:e.isMoreStickerLoading,"key-field":"id",minItemSize:"70"},on:{loadMore:e.handleLoadMore},scopedSlots:e._u([{key:"default",fn:function(i){var n=i.item,a=i.index;return[t("DynamicScrollerItem",{attrs:{item:n,active:!1,"size-dependencies":[n.clip],"data-index":a}},[t("StickerItem",{staticClass:"waterfall-sticker-item",attrs:{itemId:n.id,isFirstItem:0===a,email:n.sender,"sender-name":n.sender,"create-time":n.createTime,lastModifyTime:n.lastModifyTime,clip:n.clip,encryption:n.encryption,msgId:n.msgId,note:n.note,isDecryptSuccess:n.isDecryptionSuccess,colorIndex:n[e.STICKY_NOTE_COLOR_INDEX_ATTR]||0},on:{delete:function(t){return e.handleDelete(n)},viewEmail:function(t){return e.$emit("viewEmail",n)}}})],1)]}},{key:"after",fn:function(){return[t("div",{directives:[{name:"show",rawName:"v-show",value:e.isMoreStickerLoading,expression:"isMoreStickerLoading"}],staticClass:"list-loading"},[t("i",{staticClass:"zm-icon-loading"})]),e.isOffline?t("div",{staticClass:"list-end-text"},[e._v(" "+e._s(e.$t("sticker.listOffline"))+" ")]):[t("div",{directives:[{name:"show",rawName:"v-show",value:e.isLoadMoreVisible,expression:"isLoadMoreVisible"}],staticClass:"list-load-more",on:{click:e.handleLoadMore}},[e._v(" "+e._s(e.$t("sticker.loadMore"))+" ")]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.isEndOfStickerPage,expression:"isEndOfStickerPage"}],staticClass:"list-end-text"},[e._v(" "+e._s(e.$t("sticker.endOfStickers"))+" ")])]]},proxy:!0}])})],1)},fr=[],vr=function(){var e=this,t=e._self._c;return t("div",{class:["sticker-item-root","color-".concat(e.colorIndex),e.isSelected&&"selected"]},[t("section",{staticClass:"header"},[t("div",{staticClass:"main-row"},[t("div",{staticClass:"sender"},[t("avatar",{staticClass:"avatar",attrs:{email:e.email,name:e.senderName,tabindex:"-1"}}),t("span",{staticClass:"label"},[e._v(e._s(e.senderLabel))])],1),t("div",[e.isManaging?t("zm-checkbox",{staticClass:"select-checkbox",attrs:{value:e.isSelected},on:{change:e.onSelectChange}}):t("zm-dropdown",{on:{command:e.onMoreMenuCommand}},[t("zm-button",{staticClass:"transparent-btn",attrs:{ghost:""}},[t("svg-icon",{attrs:{iconClass:"more-horizontal"}})],1),t("zm-dropdown-menu",[t("zm-dropdown-item",{attrs:{"zm-ta":"sticky-note-item-view-email",command:"viewEmail"}},[e._v(e._s(e.$t("sticker.viewEmail")))]),t("zm-dropdown-item",{staticClass:"sticker-item-dropdown-delete",attrs:{"zm-ta":"sticky-note-item-delete",command:"delete"}},[e._v(e._s(e.$t("operation.delete")))])],1)],1)],1)]),t("div",{staticClass:"sub-row"},[e._v(" "+e._s(e.createTimeLabel)+" ")])]),t("section",{staticClass:"body"},[e.isDecryptSuccess?t("div",{staticClass:"content"},[e.isMessageLevelNote?t("div",[t("div",{staticClass:"snippet-title"},[e._v(e._s(e.$t("sticker.messageSnippetTitle")))]),t("div",{staticClass:"snippet-content"},[e._v(e._s(e.messageSnippet))])]):t("p",{staticClass:"clip-content"},[e._v(e._s(e.clip))]),e.isEditingNote?t("div",{staticClass:"note-input-row"},[t("NoteInput",{ref:"noteInputRef",attrs:{loading:e.actionLoading,initValue:e.note,maxLength:e.maxNoteContentLength},on:{cancel:e.onCancelEdit,confirm:e.onConfirmEdit}})],1):e.isEditingNote||e.note?!e.isEditingNote&&e.note?t("div",{staticClass:"note-section"},[t("div",{staticClass:"side-column"},[t("span",{staticClass:"note-icon"},[t("svg-icon",{staticClass:"alert",attrs:{iconClass:"file"}})],1)]),t("div",{staticClass:"main-column"},[t("div",{staticClass:"note-header"},[t("span",[e._v(e._s(e.$t("sticker.noteTitle")))]),t("zm-button",{staticClass:"transparent-btn edit-note-btn",attrs:{ghost:""},on:{click:e.onEditNote}},[t("svg-icon",{staticClass:"edit-note-btn-icon",attrs:{iconClass:"pen-edit"}})],1)],1),t("p",{staticClass:"note-content"},[e._v(e._s(e.note))])])]):e._e():t("div",{staticClass:"add-note-row"},[t("zm-button",{staticClass:"add-note-btn",attrs:{ghost:""},on:{click:e.onEditNote}},[t("svg-icon",{staticClass:"add-note-btn-icon",attrs:{iconClass:"annotate"}}),e._v(" "+e._s(e.$t("sticker.addNote"))+" ")],1)],1)]):t("div",{staticClass:"decrypt-fail-placeholder"},[t("svg-icon",{staticClass:"alert",attrs:{iconClass:"triangle-alert"}}),e._v(" "+e._s(e.$t("sticker.decryptFailPlaceholder"))+" ")],1)]),t("div",{staticClass:"corner"})])},br=[],gr=function(){var e=this,t=e._self._c;return t("div",{class:["note-input-root",e.focused&&"focused"]},[t("zm-input",{ref:"noteInputRef",staticClass:"note-input-textarea",attrs:{type:"textarea","show-word-limit":"",maxlength:e.maxLength,autosize:{minRows:2,maxRows:4},placeholder:e.$t("sticker.addNotePlaceholder")},on:{focus:function(t){e.focused=!0},blur:function(t){e.focused=!1}},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}}),t("div",{staticClass:"footer"},[t("zm-button",{staticClass:"cancel-btn action-btn",attrs:{ghost:""},on:{click:e.onCancel}},[t("svg-icon",{attrs:{iconClass:"action-cancel"}})],1),t("zm-button",{staticClass:"confirm-btn action-btn",attrs:{type:"primary",loading:e.loading},on:{click:e.onConfirm}},[t("svg-icon",{attrs:{iconClass:"action-confirm"}})],1)],1)],1)},Sr=[],Ir={name:"NoteInput",props:{initValue:{type:String,value:""},loading:{type:Boolean,default:!1},maxLength:{type:Number,default:200}},data:function(){return{value:this.initValue,focused:!1}},methods:{focus:function(){var e;null===(e=this.$refs.noteInputRef)||void 0===e||e.focus()},onCancel:function(){this.$emit("cancel")},onConfirm:function(){this.$emit("confirm",this.value)}}},yr=Ir,wr=(0,E.Z)(yr,gr,Sr,!1,null,"435de71f",null),xr=wr.exports,Lr=i(98663),Cr={name:"StickerItem",components:{Avatar:Gt.Z,NoteInput:xr},props:{itemId:{type:String,required:!0},email:{type:String,default:""},senderName:{type:String,default:""},clip:{type:String,default:""},msgId:{type:String,default:""},createTime:{type:Number,default:0},lastModifyTime:{type:Number,default:0},isDecryptSuccess:{type:Boolean,default:!1},encryption:{type:Boolean,default:!1},note:{type:String,default:""},colorIndex:{type:Number,default:0}},computed:(0,l.Z)((0,l.Z)({},(0,h.rn)("sticker",["currentEditingItemId","isManaging","selectedItemIds","actionLoading","maxNoteContentLength"])),{},{createTimeLabel:function(){var e=(0,Lr.KR)(this.createTime),t=e.tcCount,i=e.label;return this.$tc("sticker.addedTime",t,[i])},modifyTimeLabel:function(){var e=(0,Lr.KR)(this.lastModifyTime),t=e.tcCount,i=e.label;return this.$tc("sticker.editedTime",t,[i])},senderLabel:function(){return d.Utils.getContactName(this.email)},isEditingNote:function(){return this.currentEditingItemId===this.itemId},isSelected:function(){return this.selectedItemIds.includes(this.itemId)},isMessageLevelNote:function(){return 0===this.clip.indexOf(Lr.$5)},messageSnippet:function(){return this.isMessageLevelNote?this.clip.slice(Lr.$5.length):this.clip}}),methods:(0,l.Z)((0,l.Z)({},(0,h.nv)("sticker",["updateSticker","setCurrentEditingItemId","changeSelectItem"])),{},{onEditNote:function(){var e=this;console.debug("[sticky note] edit note"),this.setCurrentEditingItemId(this.itemId),this.$nextTick((function(){var t;null===(t=e.$refs.noteInputRef)||void 0===t||t.focus()}))},onSelectChange:function(e){console.debug("[sticky note] item select change",e,this.$props),this.changeSelectItem({id:this.itemId,selected:e})},onCancelEdit:function(){this.setCurrentEditingItemId("")},onConfirmEdit:function(e){this.updateSticker({id:this.itemId,encryption:this.encryption,note:e})},onMoreMenuCommand:function(e){console.debug("[sticky note] item more menu",e),this.$emit(e)}})},Mr=Cr,kr=(0,E.Z)(Mr,vr,br,!1,null,"312d2636",null),_r=kr.exports,Dr=i(74032),Tr=function(){var e=this,t=e._self._c;return t("div",{class:{"vue-recycle-scroller":!0,ready:e.ready,"direction-vertical":!0},attrs:{role:"application"},on:{"&scroll":function(t){return e.throttleHandleScroll.apply(null,arguments)}}},[t("div",{staticClass:"vue-recycle-scroller__item-wrapper"},[t("transition-group",{attrs:{name:"scroll-item-fade"}},e._l(e.layoutItems,(function(i){return t("div",{key:i.data.id,ref:i.data.id,refInFor:!0,staticClass:"vue-recycle-scroller__item-view",style:{left:i.x+"px",top:i.y+"px",width:e.itemWidth+"px"},attrs:{tabindex:"-1"}},[e._t("default",null,{item:i.data,index:i.data.id})],2)})),0),e.$slots.after?t("div",{staticClass:"vue-recycle-scroller__slot",style:{top:e.footerY+"px"}},[e._t("after")],2):e._e()],1),t("ResizeObserverComp",{on:{notify:e.throttleHandleResize}})],1)},Er=[],$r=i(34494);function Ar(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.nodeWidth||360,a=i.columnGap||14,s=i.rowGap||12;if(!(t<0)){var r=Math.floor(t/(n+a))||1;if(e.length){for(var o=e.map((function(e){return{data:e.item,height:e.height,x:0,y:0}})),l=0,c=0,d=Array(r).fill(0).map((function(){return{x:0,nextY:0}})),u=0;u<r;u++)o[u]&&(o[u].x=l,d[u].x=l,l+=n+a,o[u].y=0,d[u].nextY=o[u].height+s,d[u].nextY<o[c].height&&(c=u));if(o.length>r)for(var h=r;h<o.length;h++)o[h].x=d[c].x,o[h].y=d[c].nextY,d[c].nextY+=o[h].height+s,d.forEach((function(e,t){e.nextY<d[c].nextY&&(c=t)}));var m=d.map((function(e){return e.nextY}));return{layoutNodes:o,maxColumnHeight:Math.max.apply(Math,(0,f.Z)(m)),minColumnHeight:Math.min.apply(Math,(0,f.Z)(m))}}}}var Rr={name:"Waterfall",components:{ResizeObserverComp:$r["do"]},provide:function(){return"undefined"!==typeof ResizeObserver&&(this.$_resizeObserver=new ResizeObserver((function(e){var t,i=(0,J.Z)(e);try{for(i.s();!(t=i.n()).done;){var n=t.value;if(n.target){var a=new CustomEvent("resize",{detail:{contentRect:n.contentRect}});n.target.dispatchEvent(a)}}}catch(s){i.e(s)}finally{i.f()}}))),{vscrollData:this.vscrollData,vscrollParent:this,vscrollResizeObserver:this.$_resizeObserver}},props:{items:{type:Array,required:!0},itemWidth:{type:Number,default:240},itemLoading:{type:Boolean,default:!1},keyField:{type:String,required:!0},simpleArray:{type:Boolean,default:!1},direction:{type:String,default:"vertical",validator:function(e){return["vertical","horizontal"].includes(e)}}},data:function(){return{layoutItems:[],ready:!1,nextY:0,footerY:0,vscrollData:{active:!0,sizes:{},validSizes:{},keyField:this.keyField}}},computed:{itemsWithSize:function(){var e=[],t=this.items,i=this.keyField,n=this.vscrollData.sizes;console.debug("[waterfall] item size change",{size:JSON.stringify(this.vscrollData.sizes),undefinedMap:JSON.stringify(this.$_undefinedMap),items:t});for(var a=0;a<t.length;a++){var s=t[a],r=s[i],o=n[r];this.$_undefinedMap&&("undefined"!==typeof o||this.$_undefinedMap[r])||(o=0),e.push({item:s,id:r,height:o})}return e}},watch:{itemsWithSize:function(e){console.debug("[waterfall] trigger update by item size change",e),this.updateVisibleItems()}},created:function(){this.$_scrollDirty=!1,this.$_undefinedSizes=0,this.$_undefinedMap={},this.throttleHandleResize=Mt().throttle(this.handleResize,500),this.throttleHandleScroll=Mt().throttle(this.handleScroll,500)},mounted:function(){var e=this;this.$nextTick((function(){console.debug("[waterfall] trigger update by mounted"),e.updateVisibleItems(),e.ready=!0}))},beforeDestroy:function(){this.removeListeners(),this.throttleHandleResize=null},methods:{handleResize:function(){this.$emit("resize"),this.ready&&(console.debug("[waterfall] trigger update by resize"),this.updateVisibleItems())},handleScroll:function(e){var t=this;this.$_scrollDirty||(this.$_scrollDirty=!0,requestAnimationFrame((function(){t.$_scrollDirty=!1,t.checkScrollLoad()})))},checkScrollLoad:function(){if(console.debug("[waterfall] check scroll",{nextY:this.nextY,scrollTop:this.$el.scrollTop,scrollHeight:this.$parent.$el.clientHeight,offset:this.nextY-this.$el.scrollTop-this.$el.clientHeight}),!(this.footerY<=0||this.footerY-this.$el.scrollTop<=0)){var e=this.footerY-this.$el.scrollTop-this.$el.clientHeight;this.itemLoading||e>-40&&e<40&&(console.debug("[waterfall] trigger scroll load"),this.$emit("loadMore"))}},updateVisibleItems:function(){if(console.debug("[waterfall] before layout",{items:this.items.map((function(e){return e.id})),itemsLength:this.items.length,itemSizes:this.itemsWithSize.map((function(e){return e.height})),itemsSizeLength:this.itemsWithSize.length,clientHeight:this.$el.clientHeight}),0!==this.itemsWithSize.length){var e=Ar(this.itemsWithSize,this.$el.clientWidth,{nodeWidth:this.itemWidth}),t=e.layoutNodes,i=e.minColumnHeight,n=e.maxColumnHeight;this.layoutItems=t,this.nextY=i,this.footerY=n,console.debug("[waterfall] after layout",{undefinedMap:JSON.stringify(this.$_undefinedMap),undefinedSize:JSON.stringify(this.$_undefinedSizes),clientHeight:this.$el.clientHeight,nodes:t.map((function(e){return e.data.id})),minColumnHeight:i}),t.every((function(e){return e.height}))&&i<this.$el.clientHeight&&this.$emit("loadMore")}},removeListeners:function(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.throttleHandleResize),this.listenerTarget=null)}}},Zr=Rr,Or=(0,E.Z)(Zr,Tr,Er,!1,null,"3fd8618d",null),zr=Or.exports,Nr={name:"StickerList",components:{StickerItem:_r,DynamicScrollerItem:Dr.Z,Waterfall:zr},props:{stickers:{type:Array,default:[]}},data:function(){return{STICKY_NOTE_COLOR_INDEX_ATTR:Lr.Ds}},computed:(0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)(["isOffline"])),(0,h.rn)("sticker",["isSearchFinished"])),(0,h.Se)("sticker",["isInitialLoading","isLoadMoreVisible","isMoreStickerLoading","isEndOfStickerPage"])),methods:(0,l.Z)((0,l.Z)({},(0,h.nv)("sticker",["goToInbox"])),{},{handleDelete:function(e){this.$emit("delete",e)},handleLoadMore:function(){this.isEndOfStickerPage||this.$emit("loadMore")},handleGoToInbox:function(){this.goToInbox()}})},Pr=Nr,Fr=(0,E.Z)(Pr,pr,fr,!1,null,"bad4c6b8",null),Vr=Fr.exports,Hr=function(){var e=this,t=e._self._c;return t("div",{staticClass:"action-header-root"},[t("div",{staticClass:"main-row"},[t("zm-input",{ref:"searchInputRef",staticClass:"search-input",attrs:{"zm-ta":"sticker-search-input",placeholder:e.$t("sticker.searchPlaceholder")},on:{submit:e.onSubmitSearch},model:{value:e.searchKey,callback:function(t){e.searchKey=t},expression:"searchKey"}},[t("SvgIcon",{staticClass:"prefix-icon",attrs:{slot:"prefix",iconClass:"search"},slot:"prefix"}),e.isClearIconVisible?t("SvgIcon",{staticClass:"suffix-icon",attrs:{slot:"suffix",iconClass:"blocked"},on:{click:function(t){return t.stopPropagation(),e.onClearSearch.apply(null,arguments)}},slot:"suffix"}):e._e()],1),t("zm-button",{class:["manage-btn",e.isManageBtnDisabled&&"hide"],attrs:{type:"primary",ghost:"",size:"small",disabled:e.isManageBtnDisabled},on:{click:e.onManage}},[e._v(e._s(e.$t("operation.manage")))])],1),e.isManaging?t("div",{staticClass:"sub-row"},[t("zm-button",{staticClass:"action-btn",attrs:{type:"primary",ghost:"",size:"mini"},on:{click:e.onSelectOrUnselectAll}},[e._v(e._s(e.isSelectedAll?e.$t("operation.unselectAll"):e.$t("operation.selectAll")))]),t("zm-button",{staticClass:"action-btn",attrs:{type:"primary",ghost:"",size:"mini",disabled:e.isDeleteBtnDisabled},on:{click:e.onDelete}},[e._v(e._s(e.$t("operation.delete")))]),e.selectedItemIds.length?t("span",{staticClass:"selected-tips"},[e._v(e._s(e.$tc("sticker.selected",e.selectedItemIds.length,[e.selectedItemIds.length])))]):e._e()],1):e._e()])},Br=[],Ur={name:"StickerPageActionHeader",data:function(){return{searchKey:""}},computed:(0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)("sticker",["isManaging","selectedItemIds"])),(0,h.Se)("sticker",["stickers"])),{},{isClearIconVisible:function(){return this.searchKey},isManageBtnDisabled:function(){return 0===this.stickers.length},isDeleteBtnDisabled:function(){return 0===this.selectedItemIds.length},isSelectedAll:function(){return this.selectedItemIds.length===this.stickers.length}}),beforeDestroy:function(){this.clearSearch()},methods:(0,l.Z)((0,l.Z)({},(0,h.nv)("sticker",["searchStickers","deleteStickers","clearSearch","setSearchKey","updateManaging","selectAllItems","unselectAllItems"])),{},{onManage:function(){this.updateManaging(!this.isManaging)},onSelectOrUnselectAll:function(){this.isSelectedAll?this.unselectAllItems():this.selectAllItems()},onDelete:function(){this.deleteStickers({ids:this.selectedItemIds})},onSubmitSearch:function(){this.searchKey.trim()?(this.setSearchKey(this.searchKey),this.searchStickers({fromBegin:!0})):this.clearSearch()},onClearSearch:function(){this.searchKey="",this.clearSearch()}})},jr=Ur,Wr=(0,E.Z)(jr,Hr,Br,!1,null,"36fbe298",null),Kr=Wr.exports,Yr={name:"StickerPage",components:{StickerList:Vr,StickerPageActionHeader:Kr},computed:(0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)("sticker",["jumping"])),(0,h.Se)("sticker",["sortedStickers"])),(0,h.Se)(["isOutlook"])),mounted:function(){this.sortedStickers.length||this.handleLoadMore()},beforeDestroy:function(){this.resetStateIfDestroyed()},methods:(0,l.Z)((0,l.Z)({},(0,h.nv)("sticker",["listStickers","deleteStickers","openMessagePage","loadMore","resetStateIfDestroyed"])),{},{handleDelete:function(e){e&&this.deleteStickers({ids:[e.id]})},handleViewEmail:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.msgId&&this.openMessagePage({msgId:e.msgId})},handleLoadMore:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.loadMore();case 1:case"end":return t.stop()}}),t)})))()},goToSettings:function(){this.isOutlook||(0,is.H)(),this.$router.push({path:"/emailSettings",params:{path:this.$route.path}})}})},Xr=Yr,Gr=(0,E.Z)(Xr,hr,mr,!1,null,"55cca78a",null),qr=Gr.exports,Jr=d.Enums.ADDON_ITEM_IDS,Qr={name:"AddonView",components:{StickerPage:qr},computed:(0,l.Z)((0,l.Z)({},(0,h.rn)(["selectMailLabel"])),{},{isStickerPageSelected:function(){var e;return(null===(e=this.selectMailLabel)||void 0===e?void 0:e.id)===Jr.STICKER}}),methods:{}},eo=Qr,to=(0,E.Z)(eo,dr,ur,!1,null,null,null),io=to.exports,no=i(14567),ao=i(16812),so=6e5,ro=function(){function e(){(0,no.Z)(this,e),this.timeoutId=null,this.timeElapsed=0,this.isStop=!0}return(0,ao.Z)(e,[{key:"_setInterval",value:function(e,t){var i=this;this.isStop=!1,this.timeElapsed=0;var n=function n(){i.isStop||(i.timeElapsed+=t,i.timeElapsed<so?(e(),setTimeout(n,t)):i.isStop=!0)};setTimeout(n,t)}},{key:"_clearInterval",value:function(){this.isStop=!0}}]),e}(),oo=function(){var e=this,t=e._self._c;return t("div",[t("zm-dropdown",{ref:"dropdown",attrs:{trigger:"click"},on:{command:function(e){return e()},"visible-change":e.visibleChange}},[e._t("trigger"),t("zm-dropdown-menu",{ref:"menu",attrs:{slot:"dropdown"},slot:"dropdown"},[e.isOffline?e._e():t("switch-account",{ref:"switchAccount"}),t("div",{staticClass:"divider"}),t("zm-dropdown-item",{attrs:{command:e.handleLogoutWithWarning,"zm-ta":"mail-logout"}},[t("div",{directives:[{name:"metric",rawName:"v-metric:setting_logout",arg:"setting_logout"}],staticClass:"settings-dropdown-item logout-btn"},[t("svg-icon",{staticClass:"logout-icon",attrs:{iconClass:"leave"}}),t("span",{staticClass:"item-label"},[e._v(e._s(e.$t("account.signOut")))])],1)])],1)],2),t("LogoutWarningDialog",{attrs:{visible:e.logoutWarningDialogVisible},on:{close:function(t){e.logoutWarningDialogVisible=!1},confirm:e.confirmLogout}})],1)},lo=[],co=function(){var e=this,t=e._self._c;return t("div",{staticClass:"switch-account-in-dropdown-wrap"},[t("div",{staticClass:"switch-account-header"},[e._v(e._s(e.$t("account.accounts")))]),t("div",{staticClass:"account-item"},[e._l(e.accountLists,(function(i){return t("zm-dropdown-item",{key:i.accountId,attrs:{command:function(){e.handleAccountSelection(i)},"aria-label":"".concat(e.$t("accessibility.account"),", ").concat(i.name," (").concat(i.alias,"), ").concat(i.address),role:"menuitemradio","aria-checked":(e.currentUserAccountId===i.accountId).toString(),disabled:!i.address,"zm-ta":"switch-account-"+i.address,"data-debug":JSON.stringify({currentUserAccountId:e.currentUserAccountId,accountId:i.accountId})}},[t("div",{staticClass:"item"},[e.overlappingVisible(i)?t("div",{staticClass:"account-item__logo account-item__logo--overlapping"},[t("svg-icon",{staticClass:"account-item__logo--zoom",attrs:{"aria-hidden":"true",iconClass:i.icon}}),t("svg-icon",{staticClass:"account-item__logo--external",attrs:{"aria-hidden":"true",iconClass:e.externalAccountIcon}})],1):t("div",{staticClass:"account-item__logo"},[t("svg-icon",{attrs:{"aria-hidden":"true",iconClass:i.icon}})],1),i.name&&i.type!==e.ACCOUNTS.DELEGATE?t("div",{staticClass:"email-info"},[t("div",{staticClass:"email-info__name"},[e._v(e._s(i.name)+" ("+e._s(i.alias)+")")]),t("div",{staticClass:"email-info__address"},[e._v(e._s(i.address))])]):i.name&&i.type===e.ACCOUNTS.DELEGATE?t("div",{staticClass:"email-info"},[t("div",{staticClass:"email-info__name delegate-container"},[t("div",{staticClass:"delegate-name"},[e._v(e._s(i.name)+" ")]),t("div",{staticClass:"delegate-alias"},[e._v(" ("+e._s(e.getAccessDisplayText(i.delegateAccess))+e._s(i.alias)+") ")])]),t("div",{staticClass:"email-info__address"},[e._v(e._s(i.address))])]):e._e(),i.name?e._e():t("div",{staticClass:"email-address-skeleton"},[t("zm-skeleton",{attrs:{loading:!0,animated:""}},[t("template",{slot:"template"},[t("div",[t("zm-skeleton-item",{attrs:{variant:"text"}})],1),t("div",[t("zm-skeleton-item",{staticClass:"shorter-skeleton-item",attrs:{variant:"text"}})],1)])],2)],1),e.currentUserAccountId===i.accountId?t("div",{staticClass:"active-mail"},[t("svg-icon",{staticClass:"checkmark",attrs:{iconClass:"check"}})],1):e._e()])])})),e.errorVisible?t("zm-dropdown-item",{attrs:{disabled:"","aria-label":""}},[t("div",{staticClass:"item item--disable"},[t("div",{staticClass:"account-item__logo"},[t("svg-icon",{attrs:{"aria-hidden":"true",iconClass:"Delegate_logo"}})],1),t("div",{staticClass:"email-info"},[t("div",{staticClass:"email-info__name delegate-container"},[t("div",{staticClass:"delegate-name"},[e._v(" "+e._s(e.$t("delegate.delegateAccount"))+" ")])]),t("div",{staticClass:"error-info__tips"},[e._v(" "+e._s(e.isDelegated?e.$t("delegate.loadDelegatorFailed"):e.$t("delegate.loadDelegateFailed"))+" "),t("span",{staticClass:"error-info__retry",on:{click:function(t){e.isDelegated?e.refreshDelegatorList():e.refreshDelegateList()}}},[e._v(" "+e._s(e.$t("common.retry"))+" ")])])])])]):e._e()],2),e.isLoading||!e.canAddAccount||e.isDelegated?e._e():t("zm-dropdown-item",{attrs:{command:e.open,"zm-ta":"switch-account-add-account"}},[t("div",{staticClass:"add-account"},[t("svg-icon",{attrs:{iconClass:"plus"}}),t("span",{staticClass:"add-account-text"},[e._v(e._s(e.$t("account.addAccount")))])],1)]),t("select-account",{ref:"choiceAnotherAccount",attrs:{accountLists:e.accountLists},on:{addAccount:e.addAccount}})],1)},uo=[],ho=i(38406),mo=d.Enums.ACCOUNTS,po={name:"SelectAccount",components:{selectAccount:ho.Z},mixins:[Ws.Z],data:function(){return{ACCOUNTS:mo,showWarningDialog:!1,accountToSwitch:{}}},computed:(0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.Se)("account",["mergingAccountAvailable","mergingAccountPaused"])),(0,h.rn)({typeOfEmail:function(e){return e.typeOfEmail},mergeAccountData:function(e){return e.account.mergeAccount||{}}})),{},{overlappingVisible:function(e){var t=e.currentUserAccountId,i=e.typeOfEmail,n=e.mergeAccountData,a=e.accountLists,s=e.mergingAccountAvailable,r=e.mergingAccountPaused;return function(e){return t===e.accountId&&a.filter((function(e){return e.type!==mo.DELEGATE&&e.type!==mo.SHARED_INBOX&&e.type!==i})).map((function(e){return e.address})).includes(n.externalEmail)&&(s||r)}},externalAccountIcon:function(e){var t,i=e.typeOfEmail,n=e.accountLists,a=e.mergeAccountData;return null===(t=n.find((function(e){return e.address===a.externalEmail&&e.type!==mo.DELEGATE&&e.type!==mo.SHARED_INBOX&&e.type!==i})))||void 0===t?void 0:t.icon},errorVisible:function(e){var t=e.isDelegated,i=e.delegatorError,n=e.delegateError;return t?i:n}}),created:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.refreshDelegateList(),e.refreshDelegatorList();case 2:case"end":return t.stop()}}),t)})))()},methods:{getAccessDisplayText:function(e){return qt.jk[e]+" "},open:function(){this.$refs.choiceAnotherAccount.open()},close:function(){this.showWarningDialog=!1},handleAccountSelection:function(e){e.address&&([mo.SHARED_INBOX,mo.DELEGATE].includes(e.type)?this.switchToDelegateAccount(e):this.switchAccount(e))}}},fo=po,vo=(0,E.Z)(fo,co,uo,!1,null,"02d83781",null),bo=vo.exports,go=i(23510),So=i(78543),Io={name:"AccountDropdown",components:{switchAccount:bo,LogoutWarningDialog:go.Z},mixins:[So.Z],data:function(){return{logoutWarningDialogVisible:!1}},computed:(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)(["isOffline"])),(0,h.rn)("auth",["defaultAccountLists"])),(0,h.Se)("delegate",{delegators:"getDelegatorList"})),(0,h.Se)(["isOutlook","isZmail"])),watch:{defaultAccountLists:{handler:function(e,t){var i=this;e.length&&this.$nextTick((function(){var e,t;null===(e=i.$refs)||void 0===e||null===(t=e.menu)||void 0===t||t.updatePopper()}))}},delegators:{handler:function(){this.resetDropdownOptions(this.$refs.menu)}}},mounted:function(){this.bindDropdownScroll(this.$refs.menu)},methods:{confirmLogout:function(){this.logoutWarningDialogVisible=!1,this.handleLogout()},visibleChange:function(e){e&&this.$emit("dropdownOpened")},handleLogoutWithWarning:function(){this.isOffline?this.logoutWarningDialogVisible=!0:this.handleLogout()},handleLogout:function(){var e=this;return(0,r.Z)((0,s.Z)().mark((function t(){var i,n;return(0,s.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,u.Auth.removeMailAccount();case 3:if(i=t.sent,n=i.errorCode,0===n){t.next=7;break}throw Error("Failed to logout");case 7:t.next=13;break;case 9:t.prev=9,t.t0=t["catch"](0),console.error(t.t0),e.$msg(e.$t("account.failedToLogout"));case 13:case"end":return t.stop()}}),t,null,[[0,9]])})))()}}},yo=Io,wo=(0,E.Z)(yo,oo,lo,!1,null,"03ebcf0a",null),xo=wo.exports,Lo=(0,_t.wE)((function(){return Promise.all([i.e(42),i.e(551)]).then(i.bind(i,12551))})),Co={name:"NewUIView",components:{MailLogo:Gs,SystemLabels:W,UserLabels:St,inbox:Es,ComposeContainer:Lo,ShortcutReminder:R.Z,VacationResponderBanner:zs,ThreadDragImage:Bs,AddonList:cr,AddonView:io,AccountDropdown:xo},data:function(){return{expandMinimizeButtonPos:40,hasDragEnterLabelSidebar:!1,scrollUpInterval:new ro,scrollDownInterval:new ro,userLabelIsVisible:!1,startX:0,width:0,isResized:!1}},computed:(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.rn)(["selectMailLabel","isSidebarMinimized","isSidebarResizing","vacationResponder","isSplitView","userProfile","draggedEmails","dragImageCoords"])),(0,h.Se)(["sidebarMenuWidth","isZmail","isOutlook","isGmail","enableVirtualUserLabelList","labelIdToLabel"])),(0,h.Se)("inbox",["isImportantEnabled"])),(0,h.Se)("features",["isStickerEnabled"])),(0,h.rn)("auth",["isAuthed"])),(0,h.Se)("delegate",["permissionRole"])),{},{composePermission:function(e){var t=e.permissionRole;return(0,c.yz)(t,c.Vn.COMPOSE_EMAIL)},isMinimized:function(e){var t=e.isSidebarMinimized,i=e.isSidebarResizing;return t&&!i},minimizeButtonPosStyles:function(e){var t=e.expandMinimizeButtonPos;return{top:"".concat(t,"px")}},showBanner:function(e){var t=e.vacationResponder;if(!t.enableAutoReply)return!1;if(!t.startTime||!t.enableAutoReply)return!1;var i=Number(t.startTime),n=t.endTime?Number(t.endTime):Number.POSITIVE_INFINITY,a=Number(new Date);return a>=i&&a<=n},isAddonViewVisible:function(){var e,t=Array.from(Object.values(d.Enums.ADDON_ITEM_IDS)).includes(null===(e=this.selectMailLabel)||void 0===e?void 0:e.id);return this.isStickerEnabled&&t}}),watch:{activeKeyBinding:function(e){var t=e.action,i=e.event;if(i&&!(0,_t.LJ)(i))switch(t){case"compose":i.preventDefault(),this.openCompose();break;case"openOrCloseSidebar":var n,a,s,r;i.preventDefault(),null===(n=this.$refs)||void 0===n||null===(a=n.accountDropdown)||void 0===a||null===(s=a.$refs)||void 0===s||null===(r=s.dropdown)||void 0===r||r.hide(),this.isResized=!1,this.toggleMinimize();break;default:break}},dragImageCoords:function(){var e=this.dragImageCoords;if(this.draggedEmails.length<1)this.hasDragEnterLabelSidebar=!1;else if(this.hasDragEnterLabelSidebar){var t=this.getLabelSidebarRect(),i=this.isPointWithinRect({point:e,rect:t});if(i)return void this.stopScroll();var n=this.isPointAboveRect({point:e,rect:t}),a=this.isPointBelowRect({point:e,rect:t});n?this.triggerScrollUp():a?this.triggerScrollDown():this.stopScroll()}},draggedEmails:function(e){e.length<1&&this.stopScroll()}},created:function(){this.throttleHandleMouseMove=(0,Ct.throttle)(this.handleMouseMove,200),this.$store.commit("changeLoading",!1),this.fetchSliderWidth(),this.loadClientSupportedLanguage(),window.addEventListener("resize",this.onResizedWindow)},beforeDestroy:function(){window.removeEventListener("resize",this.onResizedWindow)},mounted:function(){var e=this;this.width=this.sidebarMenuWidth,document.addEventListener("keydown",this.holdScroll),this.$once("hook:beforeDestroy",(function(){document.removeEventListener("keydown",e.holdScroll),e.$Bus.$off("selectInboxLabel"),e.$Bus.$off("openThreadMessage"),e.$Bus.$off("selectAddon")})),this.$Bus.$on("selectInboxLabel",(function(){var t=e.labelIdToLabel.get(d.Enums.SystemDefinedMailLabelIds.INBOX);e.handleSelectLabel(t)})),setTimeout((function(){return(0,is.H)()}),3e3),this.$Bus.$on("openThreadMessage",(function(t){var i=t.mailId,n=t.mailHead,a=t.messageId,s=n.labelId;e.handleSelectLabel({id:s}),setTimeout((function(){var t,s;null===(t=e.$refs.inboxRef)||void 0===t||null===(s=t.redirectToThread)||void 0===s||s.call(t,{mailId:i,mailHead:n,scrollToMessageId:a})}))})),this.$Bus.$on("selectAddon",(function(t){var i=t.id;e.handleSelectAddon(i)}))},methods:(0,l.Z)((0,l.Z)((0,l.Z)({},(0,h.nv)("mail",["loadClientSupportedLanguage"])),(0,h.OI)("search",["setCurSearchHash"])),{},{startResize:function(e){this.startX=e.clientX,document.addEventListener("mousemove",this.throttleHandleMouseMove),document.addEventListener("mouseup",this.stopResize)},handleMouseMove:function(e){var t=e.clientX-this.startX;t&&(this.isSidebarResizing||this.$store.commit("changeSidebarResizing",!0),this.isResized=!0,t+this.width<=60?(this.width=60,this.minimize()):t+this.width>600?this.width=600:this.width+=t,this.startX=e.clientX)},stopResize:function(){this.$store.commit("changeSidebarMinimized",60===this.width),this.$store.commit("changeSidebarResizing",!1),document.removeEventListener("mousemove",this.throttleHandleMouseMove),document.removeEventListener("mouseup",this.stopResize)},stopScrollUp:function(){this.scrollUpInterval.isStop||this.scrollUpInterval._clearInterval()},stopScrollDown:function(){this.scrollDownInterval.isStop||this.scrollDownInterval._clearInterval()},stopScroll:function(){this.stopScrollUp(),this.stopScrollDown()},triggerScrollDown:function(){var e=this;this.stopScrollUp();var t=function(){e.$refs.labelSidebar.scrollBy({top:10,behavior:"smooth"})};this.scrollDownInterval.isStop&&this.scrollDownInterval._setInterval(t,20)},triggerScrollUp:function(){var e=this;this.stopScrollDown();var t=function(){e.$refs.labelSidebar.scrollBy({top:-10,behavior:"smooth"})};this.scrollUpInterval.isStop&&this.scrollUpInterval._setInterval(t,20)},isPointWithinRect:function(e){var t=e.point,i=e.rect,n=(0,o.Z)(t,2),a=n[0],s=n[1];return a>=i.left&&a<=i.right&&s<i.bottom&&s>i.top},isPointAboveRect:function(e){var t=e.point,i=e.rect,n=(0,o.Z)(t,2),a=(n[0],n[1]);return a<=i.top},isPointBelowRect:function(e){var t=e.point,i=e.rect,n=(0,o.Z)(t,2),a=(n[0],n[1]);return a>=i.bottom},handleDragEnter:function(){_t.eE&&(this.hasDragEnterLabelSidebar=!0)},getLabelSidebarRect:function(){var e=this.$refs.labelSidebar.getBoundingClientRect(),t=e.height,i=e.top,n=e.right,a=e.bottom,s=e.left;return{height:t,top:i,right:n,bottom:a,left:s}},holdScroll:function(e){if(e&&!(0,_t.LJ)(e))if("ArrowUp"===e.key)e.preventDefault(),this.mimicScroll("up");else{if("ArrowDown"!==e.key)return;e.preventDefault(),this.mimicScroll("down")}},mimicScroll:function(e){var t=this.$refs.inboxRef.$refs.recycleScroller.getScroll().start;switch(e){case"up":this.$refs.inboxRef.$refs.recycleScroller.scrollToPosition(t-50);break;case"down":this.$refs.inboxRef.$refs.recycleScroller.scrollToPosition(t+50);break;default:break}},closeInboxContextMenu:function(){var e=this.$children.find((function(e){return e.showActions}));e&&(e.showActions=!1,e.selectItem={})},openCompose:function(){this.$Bus.$emit("disableLinkPopoverVisible"),this.$compose()},handleSelectAddon:function(e){this.handleSelectLabel({id:e})},handleSelectLabel:function(e){var t=this;return(0,r.Z)((0,s.Z)().mark((function i(){var n;return(0,s.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(e&&!e.id.includes("label_temporary")){i.next=2;break}return i.abrupt("return");case 2:if(n=t.$store.state.showDetail,t.$store.state.isSplitView||t.$store.commit("changeShowDetail",!1),t.closeInboxContextMenu(),t.selectMailLabel.id!==e.id){i.next=8;break}return t.$nextTick((function(){var e;n||(null===(e=t.$refs.inboxRef.$refs.recycleScroller)||void 0===e||e.scrollToPosition(0))})),i.abrupt("return");case 8:t.setCurSearchHash(""),t.$store.commit("search/changeInSearchBox",!1),t.$store.commit("search/changeInFilters",!1),console.debug("new-ui handleSelectLabel",e),t.$router.push({name:"inbox",params:{id:e["id"]}},(function(){t.$store.commit("changeSelectMailLabel",e),t.$store.commit("changeSelectPrevLabel",e),t.$store.commit("search/changeInSearchBox",!1),t.$store.commit("search/changeInFilters",!1)}));case 13:case"end":return i.stop()}}),i)})))()},fetchSliderWidth:function(){var e=this;u.Setting.getPersistentSetting({key:"CustomSliderWidth"}).then((function(t){if(0===t.errorCode){var i="string"===typeof t.data.value&&JSON.parse(t.data.value).isMinimized;e.$store.commit("changeSidebarMinimized",i)}}))},toggleMinimize:function(e){var t=this;this.$refs.sidebarTriggerRef.handleClosePopper(),u.Setting.setPersistentSetting({key:"CustomSliderWidth",value:JSON.stringify({isMinimized:!this.isMinimized})}).then((function(e){0===e.errorCode&&(t.$store.commit("changeSidebarMinimized",!t.isMinimized),t.isResized=!1,t.width=t.sidebarMenuWidth)}))},minimize:function(e){var t=this;this.$refs.sidebarTriggerRef.handleClosePopper(),u.Setting.setPersistentSetting({key:"CustomSliderWidth",value:JSON.stringify({isMinimized:!0})}).then((function(e){0===e.errorCode&&(t.$store.commit("changeSidebarMinimized",!0),t.isResized=!1,t.width=t.sidebarMenuWidth)}))},resetInstantDraftsMsgIdByThreadIds:function(e){var t;null===(t=this.$refs.composeContainer)||void 0===t||t.resetInstantDraftsMsgIdByThreadIds(e)},handleDividerMouseMove:function(e){this.expandMinimizeButtonPos=this.showBanner?e.clientY-45:e.clientY-9,this.$refs.sidebarTriggerRef.updatePopper()},showUserLabels:function(){var e=this;this.$nextTick((function(){e.userLabelIsVisible=!0}))},onSettingDropdownOpened:function(){var e,t,i;null===(e=this.$refs.inboxRef)||void 0===e||null===(t=e.$refs.searchRef)||void 0===t||null===(i=t.closePopover)||void 0===i||i.call(t)},updateSidebarStatusByWindowWidth:function(){var e=window.innerWidth;e<=768&&!this.isSidebarMinimized?this.$store.commit("changeSidebarMinimized",!0):e>768&&this.isSidebarMinimized&&this.$store.commit("changeSidebarMinimized",!1)},onResizedWindow:function(){this.updateSidebarStatusByWindowWidth()}})},Mo=Co,ko=(0,E.Z)(Mo,n,a,!1,null,"286272e0",null),_o=ko.exports},39729:function(e,t,i){i(2829)},39812:function(e,t,i){i.d(t,{s:function(){return n.s},x:function(){return n.x}});var n=i(78523)},2829:function(){},6800:function(e,t,i){i.d(t,{w:function(){return l}});var n=i(23309),a=i(71951),s=i(53806),r=s.Enums.BAN_ACTION_LABELS;function o(e){var t,i,n;return 1===(null===(t=e.mailHead)||void 0===t||null===(i=t.userEmailStatusList)||void 0===i?void 0:i.length)&&!0===(null===(n=e.mailHead)||void 0===n?void 0:n.userEmailStatusList[0].isDraft)}function l(e){var t=n.Z.getters.currentLabelId;return t===a.v8?!e.mailHead.showLabelIds.some((function(e){return r.includes(e)}))&&!o(e):!r.some((function(t){return t===e.labelId}))}},32893:function(e,t,i){i.d(t,{Z:function(){return f}});var n=i(70021),a=i(56706),s=i(14567),r=i(16812),o=(i(6886),i(17368),i(77950),i(24471),i(70487)),l=i(37348),c=i.n(l),d=i(32153),u=i(53806),h="\n<!DOCTYPE html>\n<html lang=\"\" style=\"font-size: 16px\">\n <head>\n <meta charset=\"utf-8\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\" />\n <meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'self'; script-src 'none'; style-src 'unsafe-inline'; img-src https://*.zoom.us *.zoom.us zoom.us data: file:; object-src 'none'; upgrade-insecure-requests\" /> \n <title>zoom email</title>\n <style>\n html,\n body {\n background-color: #ffffff;\n color: #000000;\n font-family: -apple-system, blinkmacsystemfont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n width: 100%;\n height: 100%;\n margin: 0;\n overflow: hidden;\n overflow-y: auto;\n }\n ::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n background: transparent;\n }\n ::-webkit-scrollbar-thumb {\n min-height: 40px;\n background: #dadce0;\n border: none;\n border-radius: 8px;\n box-shadow: none;\n }\n #app {\n flex: 1;\n }\n\n </style>\n <style>\n .J_PACKAGE_MAIL_TEMPLATE_CSS_INDICATOR {\n background-color: #fff\n }\n \n .shared-mail-wrap {\n height: 100%;\n overflow: hidden\n }\n\n \n .shared-mail-header {\n display: flex;\n height: 48px;\n padding: 12px 16px;\n border-bottom: 1px solid #dfe3e8;\n box-sizing: border-box\n }\n \n .shared-mail-header .shared-mail-subject {\n display: inline-block;\n flex: 0 1 auto;\n height: 20px;\n margin: 0 16px 0 0;\n overflow: hidden;\n font-size: 16px;\n font-weight: 600;\n line-height: 20px;\n text-overflow: ellipsis;\n white-space: nowrap\n }\n \n .shared-mail-header .shared-mail-from-tag {\n display: inline-block;\n flex: 0 0 auto;\n height: 20px;\n padding: 0 6px;\n font-size: 12px;\n font-weight: 400;\n line-height: 20px;\n color: #fff;\n background: #925dff;\n border-radius: 5px\n }\n \n .shared-mail-body {\n height: calc(100% - 48px);\n overflow: auto;\n padding: 16px;\n box-sizing: border-box;\n }\n \n .shared-mail-from-avatar-wrap {\n width: 32px;\n height: 32px;\n overflow: hidden;\n line-height: 32px;\n color: #fff;\n text-align: center;\n background-color: #ffb6c1;\n border-radius: 32px\n }\n \n .shared-mail-from-info {\n margin: 0 0 10px;\n font-size: 12px;\n line-height: 16px;\n color: #131619\n }\n \n .shared-mail-recipes-wrap {\n display: flex;\n flex-wrap: nowrap;\n width: 100%\n }\n \n .shared-mail-recipes-wrap .shared-mail-recipes-label {\n display: inline-block;\n flex: 0 0 auto;\n margin: 2px 10px 0 0;\n font-size: 12px;\n font-weight: 400;\n line-height: 16px;\n color: #6e7680\n }\n \n .shared-mail-recipes-wrap .shared-mail-recipes {\n flex: 0 1 100%\n }\n \n .shared-mail-recipes-wrap .shared-mail-recipe {\n display: inline-block;\n height: auto;\n padding: 0 6px;\n margin: 0 5px 5px 0;\n font-size: 12px;\n font-weight: 400;\n line-height: 20px;\n color: #131619;\n background: #f1f4f6;\n border-radius: 5px;\n white-space: normal;\n text-overflow: ellipsis\n }\n \n .shared-mail-content {\n display: inline-block;\n margin: 20px 0 10px;\n overflow: auto;\n line-height: 1.43\n }\n \n .shared-mail-attachments {\n border-top: 1px solid #dfe3e8;\n padding: 9.5px 0\n }\n \n .shared-mail-attachments .shared-mail-attachments-info {\n font-weight: 400;\n font-size: 12px;\n line-height: 16px;\n color: #6e7680;\n margin: 0 16px 0 0;\n padding: 0 0 0 12px;\n position: relative\n }\n \n .shared-mail-attachments .shared-mail-attachments-info:before {\n background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSIxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNC43NSAxMy40OThBMi41ODEgMi41ODEgMCAwMTIuNSAxMC44OVY0LjQ4NWMwLTEuMTQzLjUtMS44MDggMS4yLTEuOTQyYTEuNTAxIDEuNTAxIDAgMDExLjggMS40NDNWMTAuNWEuNDk5LjQ5OSAwIDAxLTEgMFYzLjk4N2EuNS41IDAgMDAtMSAwdjYuOTU0YTEuNTM3IDEuNTM3IDAgMDAxLjIgMS41MjhBMS41MDEgMS41MDEgMCAwMDYuNSAxMVY0LjA5N0EyLjU3NSAyLjU3NSAwIDAwNC4yNSAxLjQ5IDIuNTAyIDIuNTAyIDAgMDAxLjUgMy45ODdWMTAuNWEuNS41IDAgMDEtMSAwVjQuMTA3QTMuNTc0IDMuNTc0IDAgMDEzLjU0LjUyYzEtLjEzMyAyLjAwOC4xNzIgMi43NjcuODM2QTMuNDk0IDMuNDk0IDAgMDE3LjUgMy45ODdWMTFhMi40OTUgMi40OTUgMCAwMS0yLjc1IDIuNDk4eiIgZmlsbD0iIzZFNzY4MCIvPjwvc3ZnPg==);\n background-size: 100% 100%;\n background-position: 50%;\n background-repeat: no-repeat;\n content: \"\";\n display: block;\n height: 14px;\n width: 7px;\n position: absolute;\n top: 0;\n left: 0\n }\n \n .shared-mail-attachments .shared-mail-attachments-tip {\n font-weight: 400;\n font-size: 12px;\n line-height: 16px;\n color: #e8173d\n }\n \n .shared-mail-footer {\n padding: 12px 16px;\n font-size: 12px;\n font-weight: 400;\n line-height: 20px;\n color: #6e7680\n }\n \n .mail-preview-wrap {\n height: 100%;\n width: 100%;\n overflow: hidden\n }\n \n .mail-preview-wrap:after {\n content: \"\";\n display: block;\n clear: both\n }\n \n .mail-preview-wrap .mail-preview-left {\n float: left;\n height: 100%;\n width: 56px\n }\n \n .mail-preview-wrap .mail-preview-right {\n float: right;\n height: 100%;\n width: calc(100% - 56px);\n overflow: auto\n }\n </style>\n </head>\n <body>\n <div id=\"app\"></div>\n </body>\n</html>\n",m=h,p=u.Business.ReplaceInlineImageSrcPlugin,f=function(){function e(){(0,s.Z)(this,e),this.templateVueComponent=null}return(0,r.Z)(e,[{key:"loadTemplate",value:function(){var e=this;return new Promise((function(t){e.templateVueComponent?t(e.templateVueComponent):i.e(814).then(i.bind(i,77497)).then((function(i){e.templateVueComponent=i,t(i)}))}))}},{key:"fetchStaticAssets",value:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(){var t,i,a,s,r,o,l;return(0,n.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=[],i=c()(document).find("script"),a=c()(document).find("style"),s=c()(document).find("link"),r=/package_mail_content_template/gm,o=new RegExp(".".concat(this.templateVueComponent.JsHooks.TEMPLATE_CSS_INDICATOR),"gm"),i.each((function(e,i){var n=c()(i).attr("src");n&&r.test(n)&&(console.log("scriptSrc",e,r.test(n),n),t.push({type:"script",url:n}))})),a.each((function(e,i){var n=c()(i).attr("href"),a=c()(i).text();n&&r.test(n)?(console.log("styleHref",e,r.test(n),n),t.push({type:"style",url:n})):a&&o.test(a)&&(console.log("styleText",e,o.test(a),a),t.push({type:"style",text:a}))})),s.each((function(e,i){var n=c()(i).attr("href");n&&"text/css"===c()(i).attr("type")&&r.test(n)&&(console.log("styleHref",e,r.test(n),n),t.push({type:"style",url:n}))})),console.log("assets ----- ",t),l=t.map((function(e){var t=e.type,i=e.url,n=e.text;return new Promise((function(e){if("script"===t&&i);else if("style"===t&&i);else if("style"===t&&n)return void e({type:t,text:n});e()}))})),e.next=13,Promise.all(l);case 13:return e.abrupt("return",e.sent);case 14:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"prepareMailContent",value:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var i,a,s,r,o,l;return(0,n.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=d.ZP.load(t.content),a=i("img"),s=i("base"),console.log("compare",i.html()),console.log("cheerioMailBase",s),console.log("cheerioMailInlineImgs",a),t.attachments&&(r=t.attachments.map((function(e){var t=/[\/\\]+([^\/\\]+)$/gi.exec(e.filePath);return t&&t[1]?t[1]:""})),console.log("trimmedFilePath",r),o=p.getInlineImageSrcMap(t),l="",s.length&&(l=s.attr("href")),console.log("base url",l),a.each((function(e){var t=a.eq(e);p.replaceCidToZmdfPath(t,o);var i=t.attr("src");if(i){var n=!1,s=i.split("?")[0];r.forEach((function(e){e&&s&&s.indexOf(e)>=0&&(t.attr("src","./".concat(e)),n=!0)})),l&&!n&&(/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/.test(i)||t.attr("src",l+"/"+i))}}))),s.remove(),e.abrupt("return",i.html());case 9:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"genHtml",value:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t){var i,a,s,r,l,u,h,p,f,v,b,g,S,I,y,w,x,L,C;return(0,n.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.mailDetail,a=t.mailContent,s=t.staticAssets,r=t.avatarElement,l=this.templateVueComponent,u=c()("<div></div>"),h=c()("<div></div>"),u.append(h),c()(document).find("body").append(u),p=d.ZP.load(m),f=p("head"),v=p("#app"),b=d.ZP.load(a),g=b("head"),S=b("body"),f.append(g.html()),I=c()(r),y=I.find("img"),w="",x="",y.length?x=y.attr("src"):w=I.text(),new o["default"]({data:{mailDetail:i,mailContent:b.html(S),avatarImg:x,avatarText:w},render:function(e){return e(l["default"])}}).$mount(h[0]),v.replaceWith(u.html()),L=s.map((function(e){return"script"===e.type||"style"===e.type&&e.blob?null:"style"===e.type&&e.text?(f.append("<style>".concat(e.text,"</style>")),null):null})).filter((function(e){return!!e})),C=p.html(),u.remove(),console.log("doPackage -------- ",C,L),e.abrupt("return",{doc:C,assets:L});case 25:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"doPackage",value:function(){var e=(0,a.Z)((0,n.Z)().mark((function e(t,i){var a,s,r,o;return(0,n.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.loadTemplate();case 2:return e.next=4,this.prepareMailContent(t);case 4:return a=e.sent,e.next=7,this.fetchStaticAssets();case 7:return s=e.sent.filter((function(e){return e})),e.next=10,this.genHtml({mailDetail:t,mailContent:a,staticAssets:s,avatarElement:i});case 10:return r=e.sent,o=r.doc,e.abrupt("return",o);case 13:case"end":return e.stop()}}),e,this)})));function t(t,i){return e.apply(this,arguments)}return t}()}]),e}()},38017:function(e,t,i){i.d(t,{OJ:function(){return M},b_:function(){return _},lp:function(){return v},sv:function(){return g},tb:function(){return L}});var n=i(70021),a=i(6041),s=i(34948),r=i(56706),o=(i(6886),i(43430),i(71372),i(70487)),l=i(12546),c=i(23309),d=i(63012),u=i(53806),h=i(32893),m=i(60659),p=u.Business.ReplaceInlineImageSrcPlugin,f=u.Enums.SystemDefinedMailLabelIds;function v(e){return b.apply(this,arguments)}function b(){return b=(0,r.Z)((0,n.Z)().mark((function e(t){var i,s,r,u,h,m,p,f,v,b,g;return(0,n.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,i=t.from,s=t.to,r=t.cc,u=[].concat((0,a.Z)(s),(0,a.Z)(r),[i]),h=t.mailHead.subject||"",m=(0,a.Z)(new Map(u.map((function(e){return[e["emailAddr"],e]}))).values()),m=m.map((function(e){return{displayName:e.displayName,email:e.emailAddr}})).sort((function(e){var t,i;return e.email.toLowerCase()===(null===(t=c.Z.state.userProfile)||void 0===t||null===(i=t.userEmail)||void 0===i?void 0:i.toLowerCase())?-1:0})),e.next=10,d.Calendar.createCalendarEvent({title:h,invitees:m});case 10:p=e.sent,f=p.errorCode,f&&(g="\n <div>\n <span>".concat(l.ZP.t("detail.scheduleMeetingFailed"),'</span>\n <a target="_blank" href="').concat(c.Z.state.auth.authBaseUrl,'">').concat(l.ZP.t("detail.goToAuthSetting"),"</a>\n </div>\n "),null===(v=(b=o["default"].prototype).$msg)||void 0===v||v.call(b,{type:"Error",useHTML:!0,content:g})),e.next=18;break;case 15:e.prev=15,e.t0=e["catch"](0),console.error("Schedule meeting failed");case 18:case"end":return e.stop()}}),e,null,[[0,15]])}))),b.apply(this,arguments)}function g(e,t){return S.apply(this,arguments)}function S(){return S=(0,r.Z)((0,n.Z)().mark((function e(t,i){var a,s,r,o,l;return(0,n.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,d.Inbox.getMailDetails({mailIds:[t],labelId:i});case 3:if(s=e.sent,r=(null===s||void 0===s?void 0:s.mailDetails)||[],r.length){e.next=7;break}return e.abrupt("return");case 7:return r.sort((function(e,t){return e.mailHead.date-t.mailHead.date})),o=r[r.length-1],l=(null===(a=c.Z.state.userProfile)||void 0===a?void 0:a.userEmail)||"",e.next=12,v(o,l);case 12:e.next=17;break;case 14:e.prev=14,e.t0=e["catch"](0),console.error("schedule meeting failed",e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,14]])}))),S.apply(this,arguments)}function I(e){var t=e.onOk;o["default"].prototype.$alert(l.ZP.t("externalImage.stcBody"),l.ZP.t("externalImage.stcTitle"),{confirmButtonText:l.ZP.t("externalImage.ok"),cancelButtonText:l.ZP.t("externalImage.cancel"),showCancelButton:!0,closeOnClickModal:!1,callback:function(e){"confirm"===e&&t()}})}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,i=(0,s.Z)({},e),n=p.getInlineImageSrcMap(e),a=(0,m.Z)(e.content,{scaleRatio:c.Z.state.scaleRatio,inlineImageSrcMap:n}),r=a.sanitize({filterDarkModeStyles:!0,filterThirdPartyLinks:!c.Z.state.allowMailExternalImg,callback:t}).process({needFold:!1,injectStyle:!1,injectScript:!1,lazyLoad:!1}).generate();return a.destroy(),a=null,i.content=r,i}function w(){return x.apply(this,arguments)}function x(){return x=(0,r.Z)((0,n.Z)().mark((function e(){var t,i,a,s,r,l,u=arguments;return(0,n.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=u.length>0&&void 0!==u[0]?u[0]:{},e.prev=1,i=y(t),a=new h.Z,e.next=6,a.doPackage(i);case 6:return s=e.sent,r={msgId:t.mailHead.msgId,fromAddress:t.from.emailAddr,mailHtmlString:s,isEncryptedZmail:c.Z.getters.isEncryptedZmail},e.next=10,d.Mail.shareToChat(r);case 10:if(l=e.sent,0===l.errorCode){e.next=13;break}throw new Error("share to chat error");case 13:e.next=19;break;case 15:e.prev=15,e.t0=e["catch"](1),console.error("share to chat failed",e.t0),o["default"].prototype.$Bus.$emit("shareToChatFailedEvent",{message:e.t0.message});case 19:case"end":return e.stop()}}),e,null,[[1,15]])}))),x.apply(this,arguments)}function L(){return C.apply(this,arguments)}function C(){return C=(0,r.Z)((0,n.Z)().mark((function e(){var t,i,a=arguments;return(0,n.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t=a.length>0&&void 0!==a[0]?a[0]:{},e.prev=1,i=!1,y(t,(function(e){i=e})),!i){e.next=7;break}return I({onOk:function(){var e=(0,r.Z)((0,n.Z)().mark((function e(){return(0,n.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,w(t);case 2:case"end":return e.stop()}}),e)})));function i(){return e.apply(this,arguments)}return i}()}),e.abrupt("return");case 7:return e.next=9,w(t);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e["catch"](1),console.error("share to chat failed",e.t0);case 14:case"end":return e.stop()}}),e,null,[[1,11]])}))),C.apply(this,arguments)}function M(e,t){return k.apply(this,arguments)}function k(){return k=(0,r.Z)((0,n.Z)().mark((function e(t,i){var a,s,u,h;return(0,n.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a=t.map((function(e){return e.mailId})),c.Z.dispatch("inbox/removeSelectedInboxMailIds",{mailIds:a}),s=t.map((function(e){return{groupId:e.mailId,msgIds:e.msgIds}})),e.prev=3,e.next=6,d.Inbox.labelsMails({fromLabelId:i,groupMsgsIds:s,labelOwnedList:[{labelId:f.PRIVATE,owned:"OwnerByAllMails"}]});case 6:if(u=e.sent,h=u.errorCode,0===h){e.next=11;break}return console.error("hide from delegate failed"),e.abrupt("return");case 11:o["default"].prototype.$undoNotice({iconClass:"checkmark",title:l.ZP.t("detail.addedPrivate"),action:l.ZP.t("operation.undo"),actionCallback:function(){var e=(0,r.Z)((0,n.Z)().mark((function e(){return(0,n.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,d.Inbox.labelsMails({fromLabelId:f.PRIVATE,groupMsgsIds:s,labelOwnedList:[{labelId:f.PRIVATE,owned:"OwnerByNoneMails"}]});case 2:case"end":return e.stop()}}),e)})));function t(){return e.apply(this,arguments)}return t}(),duration:5e3}),e.next=17;break;case 14:e.prev=14,e.t0=e["catch"](3),console.error("hide from delegate failed",e.t0);case 17:case"end":return e.stop()}}),e,null,[[3,14]])}))),k.apply(this,arguments)}function _(e,t){return D.apply(this,arguments)}function D(){return D=(0,r.Z)((0,n.Z)().mark((function e(t,i){var a,s;return(0,n.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a=t.map((function(e){return e.mailId})),c.Z.dispatch("inbox/removeSelectedInboxMailIds",{mailIds:a}),s=t.map((function(e){return{groupId:e.mailId,msgIds:e.msgIds}})),e.prev=3,e.next=6,d.Inbox.labelsMails({fromLabelId:i,groupMsgsIds:s,labelOwnedList:[{labelId:f.PRIVATE,owned:"OwnerByNoneMails"}]});case 6:e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](3),console.error("hide from delegate failed",e.t0);case 11:case"end":return e.stop()}}),e,null,[[3,8]])}))),D.apply(this,arguments)}},78543:function(e,t,i){var n=i(6041);i(43430);t["Z"]={methods:{bindDropdownScroll:function(e){var t=e.dropdown;e.$watch((function(){return t.hoverIndex}),(function(e){var i,n;null===t||void 0===t||null===(i=t.options[e])||void 0===i||null===(n=i.$el)||void 0===n||n.scrollIntoViewIfNeeded()}))},resetDropdownOptions:function(e){var t,i=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=e.dropdown,s=a.hoverIndex,r=null===(t=a.options[s])||void 0===t?void 0:t.itemId;this.$nextTick((function(){var t=i.traverseComponents(e,"zm-dropdown-menu__item");if(a.options=t,n&&r){var s=a.options.findIndex((function(e){var t=e.itemId;return t===r}));s=Math.max(0,s),a.hoverIndex=s}}))},traverseComponents:function(e,t){var i=this;if(e.$el.classList.contains(t))return[e];var a=e.$children.sort((function(e,t){return 2&e.$el.compareDocumentPosition(t.$el)?1:-1}));return a.reduce((function(e,a){return[].concat((0,n.Z)(e),(0,n.Z)(i.traverseComponents(a,t)))}),[])}}}},78523:function(e,t,i){i.d(t,{s:function(){return n},x:function(){return a}});var n=function(){var e=this;e._self._c;return e._m(0)},a=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"divider"},[t("div",{staticClass:"divider-line"})])}]},32176:function(e,t,i){e.exports=i.p+"static/img/search-empty.a0e280a9.svg"},99391:function(e,t,i){e.exports=i.p+"static/img/search-files.4487810a.svg"},66813:function(e,t,i){e.exports=i.p+"static/img/splash.77bac1b7.svg"},28798:function(e,t,i){e.exports=i.p+"static/img/sticker-empty.87ac88d6.svg"}}]);