f7cloud_client/apps/mail/js/mail.9140.76a3e2e776c1b4852a24.js
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

2 lines
47 KiB
JavaScript

"use strict";(globalThis.webpackChunkf7cloud_mail=globalThis.webpackChunkf7cloud_mail||[]).push([[9140],{75377(t,e,n){n.d(e,{s:()=>a});const a={forwarded:"",hasattachment:"",has_cal:"","has cal":"",hasnoattachment:"",notjunk:"",loadremoteimages:"","unsubscribe newsletter":""}},10362(t,e,n){function a(){return Math.random().toString(16).slice(2)}n.d(e,{z:()=>a})},80023(t,e,n){n.d(e,{A:()=>l});var a=n(71354),i=n.n(a),o=n(76314),s=n.n(o)()(i());s.push([t.id,".action[data-v-283703a8]{display:flex;margin-bottom:calc(var(--default-grid-baseline)*2)}.action__type[data-v-283703a8]{display:flex;gap:var(--default-grid-baseline);width:100%}.action__type__column[data-v-283703a8]{flex:0 1 auto}.action__type__column__select[data-v-283703a8]{margin:0}.action__delete[data-v-283703a8]{width:30px}[data-v-283703a8] .vs__dropdown-toggle{height:100%}","",{version:3,sources:["webpack://./src/components/mailFilter/Action.vue"],names:[],mappings:"AACA,yBACC,YAAA,CACA,kDAAA,CACA,+BACC,YAAA,CACA,gCAAA,CACA,UAAA,CACA,uCACC,aAAA,CACA,+CACC,QAAA,CAIH,iCACC,UAAA,CAIF,uCACC,WAAA",sourcesContent:["\n.action {\n\tdisplay: flex;\n\tmargin-bottom: calc(var(--default-grid-baseline) * 2);\n\t&__type {\n\t\tdisplay: flex;\n\t\tgap: var(--default-grid-baseline);\n\t\twidth: 100%;\n\t\t&__column {\n\t\t\tflex: 0 1 auto;\n\t\t\t&__select {\n\t\t\t\tmargin: 0\n\t\t\t}\n\t\t}\n\t}\n\t&__delete {\n\t\twidth: 30px;\n\t}\n}\n\n:deep(.vs__dropdown-toggle) {\n\theight: 100%;\n}\n"],sourceRoot:""}]);const l=s},60934(t,e,n){n.d(e,{A:()=>l});var a=n(71354),i=n.n(a),o=n(76314),s=n.n(o)()(i());s.push([t.id,".input-field[data-v-3f181b31]{display:inline-block}","",{version:3,sources:["webpack://./src/components/mailFilter/ActionAddflag.vue"],names:[],mappings:"AACA,8BACC,oBAAA",sourcesContent:["\n.input-field {\n\tdisplay: inline-block; /* for flex expand */\n}\n"],sourceRoot:""}]);const l=s},29149(t,e,n){n.d(e,{A:()=>l});var a=n(71354),i=n.n(a),o=n(76314),s=n.n(o)()(i());s.push([t.id,"[data-v-7d263524] .vue-treeselect__control{width:100%}[data-v-7d263524] .vue-treeselect__input-container{padding-inline-end:0}","",{version:3,sources:["webpack://./src/components/mailFilter/ActionFileinto.vue"],names:[],mappings:"AACA,2CACC,UAAA,CAGD,mDACC,oBAAA",sourcesContent:["\n:deep(.vue-treeselect__control) {\n\twidth: 100%; /* todo: fix MailboxInlinePicker.vue styling instead */\n}\n\n:deep(.vue-treeselect__input-container) {\n\tpadding-inline-end: 0; /* todo: fix MailboxInlinePicker.vue styling instead */\n}\n"],sourceRoot:""}]);const l=s},36126(t,e,n){n.d(e,{A:()=>l});var a=n(71354),i=n.n(a),o=n(76314),s=n.n(o)()(i());s.push([t.id,".help-text[data-v-d857b390]{align-content:center}","",{version:3,sources:["webpack://./src/components/mailFilter/ActionStop.vue"],names:[],mappings:"AACA,4BACC,oBAAA",sourcesContent:["\n.help-text {\n\talign-content: center;\n}\n"],sourceRoot:""}]);const l=s},8723(t,e,n){n.d(e,{A:()=>l});var a=n(71354),i=n.n(a),o=n(76314),s=n.n(o)()(i());s.push([t.id,".operator[data-v-1ae70da6]{display:flex;margin-bottom:calc(var(--default-grid-baseline)*2)}.operator__select[data-v-1ae70da6]{margin-inline-end:var(--default-grid-baseline);width:100%}.operator__popover[data-v-1ae70da6]{width:30px}.operator__popover__help[data-v-1ae70da6]{margin:calc(var(--default-grid-baseline)*2);max-width:600px}.operator__popover__help p[data-v-1ae70da6]{margin-bottom:.2em}","",{version:3,sources:["webpack://./src/components/mailFilter/Operator.vue"],names:[],mappings:"AACA,2BACC,YAAA,CACA,kDAAA,CACA,mCACC,8CAAA,CACA,UAAA,CAED,oCACC,UAAA,CACA,0CACC,2CAAA,CACA,eAAA,CACA,4CACC,kBAAA",sourcesContent:["\n.operator {\n\tdisplay: flex;\n\tmargin-bottom: calc(var(--default-grid-baseline) * 2);\n\t&__select {\n\t\tmargin-inline-end: var(--default-grid-baseline);\n\t\twidth: 100%;\n\t}\n\t&__popover {\n\t\twidth: 30px;\n\t\t&__help {\n\t\t\tmargin: calc(var(--default-grid-baseline) * 2);\n\t\t\tmax-width: 600px;\n\t\t\t& p {\n\t\t\t\tmargin-bottom: 0.2em;\n\t\t\t}\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const l=s},53210(t,e,n){n.d(e,{A:()=>l});var a=n(71354),i=n.n(a),o=n(76314),s=n.n(o)()(i());s.push([t.id,".condition[data-v-9a0873b6]{display:flex;margin-bottom:calc(var(--default-grid-baseline)*2)}.condition__value[data-v-9a0873b6]{width:100%;margin-inline-end:var(--default-grid-baseline)}.condition__value__field_operator[data-v-9a0873b6]{display:flex;gap:var(--default-grid-baseline)}.condition__value__field_operator__column[data-v-9a0873b6]{flex:1}.condition__value__values[data-v-9a0873b6]{width:100%}.condition__delete[data-v-9a0873b6]{width:30px}","",{version:3,sources:["webpack://./src/components/mailFilter/Test.vue"],names:[],mappings:"AACA,4BACC,YAAA,CACA,kDAAA,CACA,mCACC,UAAA,CACA,8CAAA,CACA,mDACC,YAAA,CACA,gCAAA,CACA,2DACC,MAAA,CAGF,2CACC,UAAA,CAGF,oCACC,UAAA",sourcesContent:["\n.condition {\n\tdisplay: flex;\n\tmargin-bottom: calc(var(--default-grid-baseline) * 2);\n\t&__value {\n\t\twidth: 100%;\n\t\tmargin-inline-end: var(--default-grid-baseline);\n\t\t&__field_operator {\n\t\t\tdisplay: flex;\n\t\t\tgap: var(--default-grid-baseline);\n\t\t\t&__column {\n\t\t\t\tflex: 1;\n\t\t\t}\n\t\t}\n\t\t&__values {\n\t\t\twidth: 100%;\n\t\t}\n\t}\n\t&__delete {\n\t\twidth: 30px;\n\t}\n}\n"],sourceRoot:""}]);const l=s},77928(t,e,n){n.d(e,{A:()=>l});var a=n(71354),i=n.n(a),o=n(76314),s=n.n(o)()(i());s.push([t.id,".modal__content[data-v-a38618dc]{margin:20px}.filter-name[data-v-a38618dc],.filter-tests[data-v-a38618dc],.filter-actions[data-v-a38618dc],.filter-settings[data-v-a38618dc]{margin-bottom:calc(var(--default-grid-baseline)*4)}.form-group[data-v-a38618dc]{margin:calc(var(--default-grid-baseline)*4) 0;display:flex;flex-direction:column;align-items:flex-start}.external-label[data-v-a38618dc]{display:flex;width:100%;margin-top:1rem}.external-label label[data-v-a38618dc]{padding-top:7px;padding-inline-end:14px;white-space:nowrap}.add-condition[data-v-a38618dc],.add-action[data-v-a38618dc],.filter-name[data-v-a38618dc],.filter-settings[data-v-a38618dc]{width:calc(100% - (30px + var(--default-grid-baseline)))}","",{version:3,sources:["webpack://./src/components/mailFilter/UpdateModal.vue"],names:[],mappings:"AACA,iCACC,WAAA,CAGD,gIACC,kDAAA,CAGD,6BACC,6CAAA,CACA,YAAA,CACA,qBAAA,CACA,sBAAA,CAGD,iCACC,YAAA,CACA,UAAA,CACA,eAAA,CAGD,uCACC,eAAA,CACA,uBAAA,CACA,kBAAA,CAGD,6HACC,wDAAA",sourcesContent:["\n.modal__content {\n\tmargin: 20px;\n}\n\n.filter-name, .filter-tests, .filter-actions, .filter-settings {\n\tmargin-bottom: calc(var(--default-grid-baseline) * 4)\n}\n\n.form-group {\n\tmargin: calc(var(--default-grid-baseline) * 4) 0;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: flex-start;\n}\n\n.external-label {\n\tdisplay: flex;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\tpadding-inline-end: 14px;\n\twhite-space: nowrap;\n}\n\n.add-condition, .add-action, .filter-name, .filter-settings {\n\twidth: calc(100% - (30px + var(--default-grid-baseline)));\n}\n"],sourceRoot:""}]);const l=s},26266(t,e,n){n.d(e,{A:()=>l});var a=n(71354),i=n.n(a),o=n(76314),s=n.n(o)()(i());s.push([t.id,".action[data-v-1495d437]{display:flex;width:100%;justify-content:space-between;align-items:center}.action__info[data-v-1495d437]{display:flex}.action__info__icon[data-v-1495d437]{margin-inline-end:3px}.action__info__drag[data-v-1495d437]{margin-inline-end:6px;cursor:grab}","",{version:3,sources:["webpack://./src/components/quickActions/Action.vue"],names:[],mappings:"AACA,yBACC,YAAA,CACA,UAAA,CACA,6BAAA,CACA,kBAAA,CACA,+BACC,YAAA,CACA,qCACC,qBAAA,CAED,qCACC,qBAAA,CACA,WAAA",sourcesContent:["\n.action {\n\tdisplay: flex;\n\twidth: 100%;\n\tjustify-content: space-between;\n\talign-items: center;\n\t&__info{\n\t\tdisplay: flex;\n\t\t&__icon{\n\t\t\tmargin-inline-end : 3px\n\t\t}\n\t\t&__drag{\n\t\t\tmargin-inline-end : 6px;\n\t\t\tcursor: grab;\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const l=s},30829(t,e,n){n.d(e,{A:()=>l});var a=n(71354),i=n.n(a),o=n(76314),s=n.n(o)()(i());s.push([t.id,".modal-content[data-v-3a32a870]{padding:30px}.modal-content__action[data-v-3a32a870]{padding:9px}.modal-content__save[data-v-3a32a870]{position:absolute;bottom:10px;inset-inline-end:10px}[data-v-3a32a870] .v-select{display:flex;align-items:center;justify-content:space-between}.modal-name[data-v-3a32a870]{text-align:center}@media only screen and (max-width: 512px){.modal-name[data-v-3a32a870]{text-align:start;margin-inline-end:var(--default-clickable-area)}}","",{version:3,sources:["webpack://./src/components/quickActions/Settings.vue"],names:[],mappings:"AAEA,gCACC,YAAA,CACA,wCACC,WAAA,CAED,sCACC,iBAAA,CACA,WAAA,CACA,qBAAA,CAIF,4BACC,YAAA,CACG,kBAAA,CACA,6BAAA,CAGJ,6BACC,iBAAA,CAED,0CAEC,6BACC,gBAAA,CACA,+CAAA,CAAA",sourcesContent:["\n\n.modal-content{\n\tpadding: 30px;\n\t&__action{\n\t\tpadding: 9px;\n\t}\n\t&__save {\n\t\tposition: absolute;\n\t\tbottom: 10px;\n\t\tinset-inline-end: 10px;\n\t}\n}\n\n:deep(.v-select){\n\tdisplay: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.modal-name{\n\ttext-align: center;\n}\n@media only screen and (max-width: 512px) {\n\t// Ensure the modal name does not interfere with the close button\n\t.modal-name {\n\t\ttext-align: start;\n\t\tmargin-inline-end: var(--default-clickable-area);\n\t}\n}\n"],sourceRoot:""}]);const l=s},69639(t,e,n){n.d(e,{A:()=>l});var a=n(71354),i=n.n(a),o=n(76314),s=n.n(o)()(i());s.push([t.id,"\n.vue-treeselect__control {\n\tpadding: 0;\n\tborder: 0;\n\twidth: 250px;\n}\n.vue-treeselect__control-arrow-container {\n\tdisplay: none;\n}\n.vue-treeselect--searchable .vue-treeselect__input-container {\n\tpadding-inline-start: 0;\n\tbackground-color: var(--color-main-background)\n}\ninput.vue-treeselect__input {\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 1px solid var(--color-border-maxcontrast) !important;\n}\n.vue-treeselect__menu {\n\tbackground: var(--color-main-background);\n}\n.vue-treeselect--single .vue-treeselect__option--selected {\n\tbackground: var(--color-primary-element-light);\n\tborder-radius: var(--border-radius-large);\n}\n.vue-treeselect__option.vue-treeselect__option--highlight,\n.vue-treeselect__option:hover,\n.vue-treeselect__option:focus {\n\tborder-radius: var(--border-radius-large);\n}\n.vue-treeselect__placeholder, .vue-treeselect__single-value {\n\tline-height: 34px;\n\tcolor: var(--color-main-text);\n}\n\n","",{version:3,sources:["webpack://./src/components/MailboxInlinePicker.vue"],names:[],mappings:";AAyFA;CACA,UAAA;CACA,SAAA;CACA,YAAA;AACA;AAEA;CACA,aAAA;AACA;AAEA;CACA,uBAAA;CACA;AACA;AAEA;CACA,SAAA;CACA,UAAA;CACA,4DAAA;AACA;AAEA;CACA,wCAAA;AACA;AAEA;CACA,8CAAA;CACA,yCAAA;AACA;AAEA;;;CAGA,yCAAA;AACA;AAEA;CACA,iBAAA;CACA,6BAAA;AACA",sourcesContent:["\x3c!--\n - SPDX-FileCopyrightText: 2018 F7cloud GmbH and F7cloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n--\x3e\n<template>\n\t<Treeselect\n\t\tref=\"Treeselect\"\n\t\tv-model=\"selected\"\n\t\t:options=\"mailboxes\"\n\t\t:multiple=\"false\"\n\t\t:clearable=\"false\"\n\t\t:disabled=\"disabled\" />\n</template>\n\n<script>\nimport Treeselect from '@riophae/vue-treeselect'\nimport { mapStores } from 'pinia'\nimport useMainStore from '../store/mainStore.js'\nimport { mailboxHasRights } from '../util/acl.js'\n\nimport '@riophae/vue-treeselect/dist/vue-treeselect.css'\n\nexport default {\n\tname: 'MailboxInlinePicker',\n\tcomponents: {\n\t\tTreeselect,\n\t},\n\n\tprops: {\n\t\taccount: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\tvalue: {\n\t\t\ttype: Number,\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tselected: this.value,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t...mapStores(useMainStore),\n\t\tmailboxes() {\n\t\t\treturn this.getMailboxes()\n\t\t},\n\t},\n\n\twatch: {\n\t\tselected(val) {\n\t\t\tif (val !== this.value) {\n\t\t\t\tthis.$emit('input', val)\n\t\t\t\tthis.selected = val\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\tgetMailboxes(mailboxId) {\n\t\t\tlet mailboxes = []\n\t\t\tif (!mailboxId) {\n\t\t\t\tmailboxes = this.mainStore.getMailboxes(this.account.accountId)\n\t\t\t} else {\n\t\t\t\tmailboxes = this.mainStore.getSubMailboxes(mailboxId)\n\t\t\t}\n\t\t\tmailboxes = mailboxes.filter((mailbox) => mailboxHasRights(mailbox, 'i'))\n\t\t\treturn mailboxes.map((mailbox) => {\n\t\t\t\treturn {\n\t\t\t\t\tid: mailbox.databaseId,\n\t\t\t\t\tlabel: mailbox.displayName,\n\t\t\t\t\tchildren: mailbox.mailboxes.length > 0 ? this.getMailboxes(mailbox.databaseId) : '',\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t},\n}\n<\/script>\n\n<style>\n.vue-treeselect__control {\n\tpadding: 0;\n\tborder: 0;\n\twidth: 250px;\n}\n\n.vue-treeselect__control-arrow-container {\n\tdisplay: none;\n}\n\n.vue-treeselect--searchable .vue-treeselect__input-container {\n\tpadding-inline-start: 0;\n\tbackground-color: var(--color-main-background)\n}\n\ninput.vue-treeselect__input {\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 1px solid var(--color-border-maxcontrast) !important;\n}\n\n.vue-treeselect__menu {\n\tbackground: var(--color-main-background);\n}\n\n.vue-treeselect--single .vue-treeselect__option--selected {\n\tbackground: var(--color-primary-element-light);\n\tborder-radius: var(--border-radius-large);\n}\n\n.vue-treeselect__option.vue-treeselect__option--highlight,\n.vue-treeselect__option:hover,\n.vue-treeselect__option:focus {\n\tborder-radius: var(--border-radius-large);\n\t}\n\n.vue-treeselect__placeholder, .vue-treeselect__single-value {\n\tline-height: 34px;\n\tcolor: var(--color-main-text);\n}\n\n</style>\n"],sourceRoot:""}]);const l=s},42702(t,e,n){n.d(e,{R2:()=>o,Vp:()=>s,cc:()=>d,cj:()=>u,fJ:()=>c,hB:()=>l,kv:()=>a,sm:()=>A,xj:()=>i});var a,i,o,s,l,r=n(10362);!function(t){t.All="allof",t.Any="anyof"}(a||(a={})),function(t){t.From="from",t.Subject="subject",t.To="to"}(i||(i={})),function(t){t.Contains="contains",t.Is="is",t.Matches="matches"}(o||(o={})),function(t){t.AddSystemFlag="addsystemflag",t.Stop="stop"}(s||(s={})),function(t){t.Answered="\\Answered",t.Deleted="\\Deleted",t.Draft="\\Draft",t.Flagged="\\Flagged",t.Seen="\\Seen"}(l||(l={}));class c{id;field;operator;values;constructor(){this.id=(0,r.z)()}hasValues(){return this.values.length>0}}class A{id;type;mailbox;constructor(){this.id=(0,r.z)(),this.type="fileinto"}}class d{id;type;constructor(){this.id=(0,r.z)(),this.type="stop"}}class u{id;name;enable=!1;operator;tests;actions;priority=0;constructor(){this.id=(0,r.z)()}}},83957(t,e,n){n.d(e,{A:()=>r});var a=n(51849),i=n(85745),o=n(66802),s=n(63814),l=n(10362);const r=(0,a.nY)("mailFilter",{state:()=>({filters:[]}),actions:{async fetch(t){await this.$patch(async e=>{const n=await async function(t){const e=(0,s.Jv)("/apps/mail/api/filter/{accountId}",{accountId:t}),{data:n}=await o.Ay.get(e);return n}(t);e.filters=n.map(t=>(t.id=(0,l.z)(),t.tests.map(t=>(t.id=(0,l.z)(),t)),t.actions.map(t=>(t.id=(0,l.z)(),t)),t))})},async store(t){let e=structuredClone(this.filters);e=e.map(t=>(delete t.id,t.tests.map(t=>(delete t.id,t)),t.actions.map(t=>(delete t.id,t)),t)),await async function(t,e){const n=(0,s.Jv)("/apps/mail/api/filter/{accountId}",{accountId:t}),{data:a}=await o.Ay.put(n,{filters:e});return a}(t,e)},async update(t){await this.$patch(e=>{const n=e.filters.findIndex(e=>e.id===t.id);i.A.debug("update filter",{filter:t,index:n}),-1===n?e.filters.push(t):e.filters[n]=t,e.filters.sort((t,e)=>t.priority-e.priority)})},async delete(t){await this.$patch(e=>{const n=e.filters.findIndex(e=>e.id===t.id);i.A.debug("delete filter",{filter:t,index:n}),-1!==n&&e.filters.splice(n,1)})}}})},88881(t,e,n){n.d(e,{A:()=>y});var a=n(49123),i=n.n(a),o=n(51849),s=n(49519),l=n(28290);n(18149);const r={name:"MailboxInlinePicker",components:{Treeselect:i()},props:{account:{type:Object,required:!0},disabled:{type:Boolean,default:!1},value:{type:Number,default:void 0}},data(){return{selected:this.value}},computed:{...(0,o.n2)(s.A),mailboxes(){return this.getMailboxes()}},watch:{selected(t){t!==this.value&&(this.$emit("input",t),this.selected=t)}},methods:{getMailboxes(t){let e=[];return e=t?this.mainStore.getSubMailboxes(t):this.mainStore.getMailboxes(this.account.accountId),e=e.filter(t=>(0,l.w)(t,"i")),e.map(t=>({id:t.databaseId,label:t.displayName,children:t.mailboxes.length>0?this.getMailboxes(t.databaseId):""}))}}};var c=n(85072),A=n.n(c),d=n(97825),u=n.n(d),p=n(77659),m=n.n(p),h=n(55056),g=n.n(h),v=n(10540),f=n.n(v),_=n(41113),b=n.n(_),C=n(69639),x={};x.styleTagTransform=b(),x.setAttributes=g(),x.insert=m().bind(null,"head"),x.domAPI=u(),x.insertStyleElement=f(),A()(C.A,x),C.A&&C.A.locals&&C.A.locals;const y=(0,n(14486).A)(r,function(){var t=this;return(0,t._self._c)("Treeselect",{ref:"Treeselect",attrs:{options:t.mailboxes,multiple:!1,clearable:!1,disabled:t.disabled},model:{value:t.selected,callback:function(e){t.selected=e},expression:"selected"}})},[],!1,null,null,null).exports},63158(e,n,a){a.d(n,{A:()=>et});var i=a(60103),o=a(90629),s=a(76476);const l={name:"ActionAddflag",components:{NcTextField:i.v},props:{action:{type:Object,required:!0},account:{type:Object,required:!0}},computed:{flag(){return this.action.flag??""}},methods:{onInput(t){this.$emit("update-action",{flag:t})}}};var r=a(85072),c=a.n(r),A=a(97825),d=a.n(A),u=a(77659),p=a.n(u),m=a(55056),h=a.n(m),g=a(10540),v=a.n(g),f=a(41113),_=a.n(f),b=a(60934),C={};C.styleTagTransform=_(),C.setAttributes=h(),C.insert=p().bind(null,"head"),C.domAPI=d(),C.insertStyleElement=v(),c()(b.A,C),b.A&&b.A.locals&&b.A.locals;var x=a(14486);const y=(0,x.A)(l,function(){var t=this;return(0,t._self._c)("NcTextField",{attrs:{required:!0,value:t.flag,"label-outside":!0,placeholder:t.t("mail","Enter flag")},on:{"update:value":t.onInput}})},[],!1,null,"3f181b31",null).exports;var k=a(42702);const I={name:"ActionAddSystemFlag",components:{NcSelect:i.EQ},props:{action:{type:Object,required:!0},account:{type:Object,required:!0}},data:()=>({flags:[k.hB.Answered,k.hB.Deleted,k.hB.Draft,k.hB.Flagged,k.hB.Seen]}),computed:{flag(){return this.action.flag??""}},methods:{updateAction(t){this.$emit("update-action",t)},getLabelForFlag(e){switch(e){case k.hB.Answered:return t("mail","Answered");case k.hB.Deleted:return t("mail","Deleted");case k.hB.Draft:return t("mail","Draft");case k.hB.Flagged:return t("mail","Flagged");case k.hB.Seen:return t("mail","Seen")}return e}}},S=(0,x.A)(I,function(){var t=this;return(0,t._self._c)("NcSelect",{attrs:{"input-label":"flag",value:t.flag,required:!0,"label-outside":!0,options:t.flags,clearable:!1},on:{input:function(e){return t.updateAction({flag:e})}},scopedSlots:t._u([{key:"selected-option",fn:function({label:e}){return[t._v("\n\t\t"+t._s(t.getLabelForFlag(e))+"\n\t")]}},{key:"option",fn:function({label:e}){return[t._v("\n\t\t"+t._s(t.getLabelForFlag(e))+"\n\t")]}}])})},[],!1,null,null,null).exports;var B=a(51849),T=a(88881),w=a(49519);const M={name:"ActionFileinto",components:{MailboxInlinePicker:T.A},props:{action:{type:Object,required:!0},account:{type:Object,required:!0}},computed:{...(0,B.n2)(w.A),mailbox(){return this.getMailboxDatabaseIdByName(this.action?.mailbox)}},methods:{onInput(t){this.$emit("update-action",{mailbox:this.getMailboxNameByDatabaseId(t)})},getMailboxDatabaseIdByName(t){return this.mainStore.getMailboxesAndSubmailboxesByAccountId(this.account.id).find(e=>e.name===t)?.databaseId},getMailboxNameByDatabaseId(t){return this.mainStore.getMailbox(t)?.name}}};var N=a(29149),E={};E.styleTagTransform=_(),E.setAttributes=h(),E.insert=p().bind(null,"head"),E.domAPI=d(),E.insertStyleElement=v(),c()(N.A,E),N.A&&N.A.locals&&N.A.locals;const D=(0,x.A)(M,function(){var t=this;return(0,t._self._c)("MailboxInlinePicker",{attrs:{account:t.account,value:t.mailbox},on:{input:t.onInput}})},[],!1,null,"7d263524",null).exports,F={name:"ActionStop",props:{action:{type:Object,required:!0},account:{type:Object,required:!0}}};var O=a(36126),R={};R.styleTagTransform=_(),R.setAttributes=h(),R.insert=p().bind(null,"head"),R.domAPI=d(),R.insertStyleElement=v(),c()(O.A,R),O.A&&O.A.locals&&O.A.locals;const U=(0,x.A)(F,function(){var t=this;return(0,t._self._c)("p",{staticClass:"help-text"},[t._v("\n\t"+t._s(t.t("mail","Stop ends all processing"))+"\n")])},[],!1,null,"d857b390",null).exports,Q={name:"Action",components:{NcSelect:i.EQ,NcTextField:i.v,NcButton:i.x1,ActionFileinto:D,ActionAddflag:y,ActionStop:U,DeleteIcon:s.A},props:{action:{type:Object,required:!0},account:{type:Object,required:!0}},data(){return{availableTypes:[{id:k.Vp.AddSystemFlag,label:this.t("mail","Mark message as")},{id:"addflag",label:this.t("mail","Add flag")},{id:"fileinto",label:this.t("mail","Move into folder")},{id:k.Vp.Stop,label:this.t("mail","Stop")}]}},computed:{currentAction(){return this.availableTypes.find(t=>t.id===this.action.type)},componentInstance(){return"fileinto"===this.action.type?D:"addflag"===this.action.type?y:this.action.type===k.Vp.Stop?U:this.action.type===k.Vp.AddSystemFlag?S:null}},methods:{updateAction(t){this.$emit("update-action",{...this.action,...t})},deleteAction(){this.$emit("delete-action",this.action)}}};var j=a(80023),H={};H.styleTagTransform=_(),H.setAttributes=h(),H.insert=p().bind(null,"head"),H.domAPI=d(),H.insertStyleElement=v(),c()(j.A,H),j.A&&j.A.locals&&j.A.locals;const V=(0,x.A)(Q,function(){var t=this,e=t._self._c;return e("div",{staticClass:"action"},[e("div",{staticClass:"action__type"},[e("NcSelect",{staticClass:"action__type__column action__type__column__select",attrs:{value:t.currentAction,required:!0,"label-outside":!0,options:t.availableTypes,clearable:!1},on:{input:function(e){return t.updateAction({type:e.id})}}}),t._v(" "),t.componentInstance?e(t.componentInstance,{tag:"component",staticClass:"action__type__column",attrs:{action:t.action,account:t.account},on:{"update-action":t.updateAction}}):t._e()],1),t._v(" "),e("NcButton",{staticClass:"action__delete",attrs:{"aria-label":t.t("mail","Delete action"),variant:"tertiary-no-background"},on:{click:t.deleteAction},scopedSlots:t._u([{key:"icon",fn:function(){return[e("DeleteIcon",{attrs:{size:20}})]},proxy:!0}])})],1)},[],!1,null,"283703a8",null).exports,q={name:"Operator",components:{IconInformationOutline:a(25216).A,NcPopover:i.rI,NcButton:i.x1,NcSelect:i.EQ},props:{filter:{type:Object,required:!0}},data:()=>({availableOperators:[{value:k.kv.All,label:t("mail","If all the conditions are met, the actions will be performed")},{value:k.kv.Any,label:t("mail","If any of the conditions are met, the actions will be performed")}]}),methods:{updateOperator(t){this.$emit("update:operator",t)}}};var z=a(8723),P={};P.styleTagTransform=_(),P.setAttributes=h(),P.insert=p().bind(null,"head"),P.domAPI=d(),P.insertStyleElement=v(),c()(z.A,P),z.A&&z.A.locals&&z.A.locals;const Y=(0,x.A)(q,function(){var t=this,e=t._self._c;return e("div",{staticClass:"operator"},[e("NcSelect",{staticClass:"operator__select",attrs:{value:t.filter.operator,required:!0,"label-outside":!0,options:t.availableOperators,reduce:t=>t.value,clearable:!1},on:{input:function(e){return t.updateOperator(e)}}}),t._v(" "),e("NcPopover",{staticClass:"operator__popover",attrs:{"no-focus-trap":!0,"popup-role":"dialog"},scopedSlots:t._u([{key:"trigger",fn:function(){return[e("NcButton",{attrs:{variant:"tertiary-no-background","aria-label":t.t("mail","Help")},scopedSlots:t._u([{key:"icon",fn:function(){return[e("IconInformationOutline",{attrs:{size:20}})]},proxy:!0}])})]},proxy:!0},{key:"default",fn:function(){return[e("div",{staticClass:"operator__popover__help"},[e("p",[e("strong",[t._v(t._s(t.t("mail","contains")))]),t._v(": "+t._s(t.t("mail",'A substring match. The field matches if the provided value is contained within it. For example, "report" would match "port".'))+"\n\t\t\t\t")]),t._v(" "),e("p",[e("strong",[t._v(t._s(t.t("mail","matches")))]),t._v(": "+t._s(t.t("mail",'A pattern match using wildcards. The "*" symbol represents any number of characters (including none), while "?" represents exactly one character. For example, "*report*" would match "Business report 2024".'))+"\n\t\t\t\t")])])]},proxy:!0}])})],1)},[],!1,null,"1ae70da6",null).exports,L={name:"Test",components:{NcButton:i.x1,NcSelect:i.EQ,DeleteIcon:s.A},props:{test:{type:Object,required:!0}},data:()=>({inputValue:"",localValues:[],fields:[k.xj.Subject,k.xj.From,k.xj.To],operators:[k.R2.Is,k.R2.Contains,k.R2.Matches]}),computed:{placeholderText(){switch(this.test.field){case k.xj.Subject:return t("mail","Enter subject");case k.xj.From:return t("mail","Enter sender");case k.xj.To:return t("mail","Enter recipient")}return""}},mounted(){this.localValues=[...this.test.values]},methods:{updateTest(t){this.$emit("update-test",{...this.test,...t})},deleteTest(){this.$emit("delete-test",this.test)},getLabelForField(e){switch(e){case k.xj.Subject:return t("mail","Subject");case k.xj.From:return t("mail","Sender");case k.xj.To:return t("mail","Recipient")}return e},getLabelForOperator(e){switch(e){case k.R2.Is:return t("mail","is exactly");case k.R2.Contains:return t("mail","contains");case k.R2.Matches:return t("mail","matches")}return e}}};var G=a(53210),J={};J.styleTagTransform=_(),J.setAttributes=h(),J.insert=p().bind(null,"head"),J.domAPI=d(),J.insertStyleElement=v(),c()(G.A,J),G.A&&G.A.locals&&G.A.locals;const K=(0,x.A)(L,function(){var t=this,e=t._self._c;return e("div",{staticClass:"condition"},[e("div",{staticClass:"condition__value"},[e("div",{staticClass:"condition__value__field_operator"},[e("NcSelect",{staticClass:"condition__value__field_operator__column",attrs:{"input-label":"field",value:t.test.field,required:!0,"label-outside":!0,options:t.fields,clearable:!1},on:{input:function(e){return t.updateTest({field:e})}},scopedSlots:t._u([{key:"selected-option",fn:function({label:e}){return[t._v("\n\t\t\t\t\t"+t._s(t.getLabelForField(e))+"\n\t\t\t\t")]}},{key:"option",fn:function({label:e}){return[t._v("\n\t\t\t\t\t"+t._s(t.getLabelForField(e))+"\n\t\t\t\t")]}}])}),t._v(" "),e("NcSelect",{staticClass:"condition__value__field_operator__column",attrs:{"input-label":"operator",value:t.test.operator,required:!0,"label-outside":!0,options:t.operators,clearable:!1},on:{input:function(e){return t.updateTest({operator:e})}},scopedSlots:t._u([{key:"selected-option",fn:function({label:e}){return[t._v("\n\t\t\t\t\t"+t._s(t.getLabelForOperator(e))+"\n\t\t\t\t")]}},{key:"option",fn:function({label:e}){return[t._v("\n\t\t\t\t\t"+t._s(t.getLabelForOperator(e))+"\n\t\t\t\t")]}}])})],1),t._v(" "),e("NcSelect",{staticClass:"condition__value__values",attrs:{"input-label":"value",multiple:!0,wrap:!0,"keep-open":!0,taggable:!0,required:!0,"label-outside":!0,placeholder:t.placeholderText},on:{"option:selected":function(e){return t.updateTest({values:t.localValues})},"option:deselected":function(e){return t.updateTest({values:t.localValues})}},model:{value:t.localValues,callback:function(e){t.localValues=e},expression:"localValues"}})],1),t._v(" "),e("div",{staticClass:"condition__delete"},[e("NcButton",{attrs:{"aria-label":"Delete action",variant:"tertiary-no-background"},on:{click:t.deleteTest},scopedSlots:t._u([{key:"icon",fn:function(){return[e("DeleteIcon",{attrs:{size:20}})]},proxy:!0}])})],1)])},[],!1,null,"9a0873b6",null).exports;var X=a(10362);const W={name:"UpdateModal",components:{IconCheck:o.A,Action:V,Operator:Y,Test:K,NcButton:i.x1,NcCheckboxRadioSwitch:i.AO,NcLoadingIcon:i.ne,NcModal:i.FH,NcTextField:i.v},props:{filter:{type:Object,required:!0},account:{type:Object,required:!0},loading:{type:Boolean,required:!1}},data(){return{clone:structuredClone(this.filter),boundaryElement:null}},methods:{createTest(){this.clone.tests.push({id:(0,X.z)(),field:k.xj.Subject,operator:k.R2.Is,values:[]})},updateTest(t){const e=this.clone.tests.findIndex(e=>e.id===t.id);this.$set(this.clone.tests,e,t)},deleteTest(t){this.clone.tests=this.clone.tests.filter(e=>e.id!==t.id)},createAction(){this.clone.actions.push({id:(0,X.z)(),type:"fileinto"}),this.clone.actions.sort((t,e)=>"stop"===t.type?1:"stop"===e.type?-1:0)},updateAction(t){const e=this.clone.actions.findIndex(e=>e.id===t.id);this.$set(this.clone.actions,e,t)},updateOperator(t){this.clone.operator=t},deleteAction(t){this.clone.actions=this.clone.actions.filter(e=>e.id!==t.id)},updateFilter(){this.$emit("update-filter",structuredClone(this.clone))},closeModal(){this.$emit("close")}}};var $=a(77928),Z={};Z.styleTagTransform=_(),Z.setAttributes=h(),Z.insert=p().bind(null,"head"),Z.domAPI=d(),Z.insertStyleElement=v(),c()($.A,Z),$.A&&$.A.locals&&$.A.locals;var tt=(0,x.A)(W,function(){var t=this,e=t._self._c;return e("NcModal",{attrs:{size:"normal","close-on-click-outside":!1,name:t.t("mail","New filter")},on:{close:t.closeModal}},[e("form",{staticClass:"modal__content",on:{submit:function(e){return e.preventDefault(),t.updateFilter.apply(null,arguments)}}},[e("h2",[t._v(t._s(t.t("mail","New filter")))]),t._v(" "),e("div",{staticClass:"filter-name"},[e("NcTextField",{attrs:{value:t.clone.name,label:t.t("mail","Name"),required:!0},on:{"update:value":function(e){return t.$set(t.clone,"name",e)}}})],1),t._v(" "),e("div",{staticClass:"filter-tests"},[e("h6",[t._v(t._s(t.t("mail","Conditions")))]),t._v(" "),e("Operator",{staticClass:"filter-operator",attrs:{filter:t.clone},on:{"update:operator":t.updateOperator}}),t._v(" "),t._l(t.clone.tests,function(n){return e("Test",{key:n.id,attrs:{test:n},on:{"update-test":t.updateTest,"delete-test":t.deleteTest}})}),t._v(" "),e("NcButton",{staticClass:"add-condition",attrs:{variant:"secondary","aria-label":t.t("mail","Add condition")},on:{click:t.createTest}},[t._v("\n\t\t\t\t"+t._s(t.t("mail","Add condition"))+"\n\t\t\t")])],2),t._v(" "),e("div",{staticClass:"filter-actions"},[e("h6",[t._v(t._s(t.t("mail","Actions")))]),t._v(" "),t._l(t.clone.actions,function(n){return e("Action",{key:n.id,attrs:{action:n,account:t.account},on:{"update-action":t.updateAction,"delete-action":t.deleteAction}})}),t._v(" "),e("NcButton",{staticClass:"add-action",attrs:{variant:"secondary","aria-label":t.t("mail","Add action")},on:{click:t.createAction}},[t._v("\n\t\t\t\t"+t._s(t.t("mail","Add action"))+"\n\t\t\t")])],2),t._v(" "),e("div",{staticClass:"filter-settings"},[e("NcTextField",{attrs:{value:t.clone.priority,type:"number",label:t.t("mail","Priority"),required:!0},on:{"update:value":function(e){return t.$set(t.clone,"priority",e)}}}),t._v(" "),e("NcCheckboxRadioSwitch",{attrs:{checked:t.clone.enable,type:"switch"},on:{"update:checked":function(e){return t.$set(t.clone,"enable",e)}}},[t._v("\n\t\t\t\t"+t._s(t.t("mail","Enable filter"))+"\n\t\t\t")])],1),t._v(" "),e("NcButton",{attrs:{variant:"primary",type:"submit"},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("NcLoadingIcon",{attrs:{size:20}}):e("IconCheck",{attrs:{size:20}})]},proxy:!0}])},[t._v("\n\t\t\t"+t._s(t.t("mail","Save"))+"\n\t\t")])],1)])},[],!1,null,"a38618dc",null);const et=tt.exports},28462(t,e,n){n.d(e,{A:()=>p});var a=n(8895),i=n(33057),o=n(67069),s=n(5652),l=n(6178),r=n(35195),c=n(29080),A=n(12497),d=n(76476);const u={name:"Icon",props:{action:{type:String,default:""}},computed:{quickActionIcon(){switch(this.action){case"markAsSpam":return a.A;case"applyTag":return A.A;case"markAsImportant":return l.A;case"markAsFavorite":return c.A;case"markAsRead":return o.A;case"markAsUnread":return s.A;case"moveThread":return r.A;case"deleteThread":return d.A;default:return i.A}}}},p=(0,n(14486).A)(u,function(){return(0,this._self._c)(this.quickActionIcon,{tag:"component",attrs:{size:20}})},[],!1,null,null,null).exports},49224(e,n,a){a.d(n,{A:()=>Y});var i=a(85168),o=a(60103),s=a(2853),l=a(8895),r=a(33057),c=a(67069),A=a(5652),d=a(6178),u=a(35195),p=a(86791),m=a(49954),h=a(29080),g=a(12497),v=a(76476),f=a(56702),_=a(82028),b=a(28462),C=a(49519),x=a(75377);const y={name:"Action",components:{NcSelect:o.EQ,CloseIcon:f.A,NcButton:o.x1,Icon:b.A,DragIcon:_.A},props:{action:{type:Object,required:!0},account:{type:Object,required:!0}},computed:{mainStore:()=>(0,C.A)(),needsSelection(){return["applyTag","moveThread"].includes(this.action.name)},selectedOption(){return"applyTag"===this.action.name?this.options.find(t=>t.id===this.action.tagId)||null:"moveThread"===this.action.name&&this.options.find(t=>t.id===this.action.mailboxId)||null},options(){return"applyTag"===this.action.name?this.mainStore.getTags.filter(t=>"$label1"!==t.imapLabel&&!(t.displayName.toLowerCase()in x.s)).map(t=>({value:t.displayName,id:t.id})):"moveThread"===this.action.name?this.mainStore.getMailboxes(this.account.accountId).map(t=>({value:t.displayName,id:t.databaseId})):[]},actionTitle(){switch(this.action.name){case"markAsSpam":return this.t("mail","Mark as spam");case"applyTag":return this.t("mail","Tag");case"moveThread":return this.t("mail","Move thread");case"deleteThread":return this.t("mail","Delete thread");case"markAsRead":return this.t("mail","Mark as read");case"markAsUnread":return this.t("mail","Mark as unread");case"markAsImportant":return this.t("mail","Mark as important");case"markAsFavorite":return this.t("mail","Mark as favorite");default:return this.action.name}}},methods:{update(t){this.$emit("update",{id:t.id,type:this.action.name})}}};var k=a(85072),I=a.n(k),S=a(97825),B=a.n(S),T=a(77659),w=a.n(T),M=a(55056),N=a.n(M),E=a(10540),D=a.n(E),F=a(41113),O=a.n(F),R=a(26266),U={};U.styleTagTransform=O(),U.setAttributes=N(),U.insert=w().bind(null,"head"),U.domAPI=B(),U.insertStyleElement=D(),I()(R.A,U),R.A&&R.A.locals&&R.A.locals;var Q=a(14486);const j=(0,Q.A)(y,function(){var t=this,e=t._self._c;return e("div",{staticClass:"action"},[e("div",{staticClass:"action__info"},[e("DragIcon",{staticClass:"action__info__drag",attrs:{size:16}}),t._v(" "),e("Icon",{staticClass:"action__info__icon",attrs:{action:t.action.name}}),t._v(" "),t.needsSelection?e("NcSelect",{attrs:{"input-label":t.actionTitle,options:t.options,label:"value","model-value":t.selectedOption},on:{"update:modelValue":t.update}}):e("p",[t._v("\n\t\t\t"+t._s(t.actionTitle)+"\n\t\t")])],1),t._v(" "),e("NcButton",{attrs:{"aria-label":t.t("mail","delete"),variant:"tertiary-no-background"},on:{click:function(e){return t.$emit("delete")}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("CloseIcon",{attrs:{size:20}})]},proxy:!0}])})],1)},[],!1,null,"1495d437",null).exports;var H=a(85745),V=a(33748);const q={name:"Settings",components:{NcListItem:o.l,NcModal:o.FH,NcActionButton:o.Ko,NcButton:o.x1,NcTextField:o.v,NcActions:o.B6,IconDelete:v.A,IconEdit:p.A,Action:j,IconEmailFast:r.A,Container:s.mc,Draggable:s.sx,AlertOctagonIcon:l.A,TagIcon:g.A,OpenInNewIcon:u.A,ImportantIcon:d.A,EmailRead:c.A,EmailUnread:A.A,IconFavorite:h.A,PlusIcon:m.A,NcLoadingIcon:o.ne},props:{account:{type:Object,required:!0}},data:()=>({editModal:!1,localAction:{id:null,name:""},editMode:!1,actions:[],highestOrder:0,loading:!1}),computed:{mainStore:()=>(0,C.A)(),quickActions(){return this.mainStore.getQuickActions().filter(t=>t.accountId===this.account.id)},modalName(){return this.editMode?this.t("mail","Edit quick action"):this.t("mail","Add quick action")},deletionAndMovingDisabled(){return this.actions.some(t=>["deleteThread","moveThread","markAsSpam"].includes(t.name))},canSave(){return this.actions.length>0&&this.localAction.name.trim().length>0&&this.actions.every(t=>!!("moveThread"!==t.name||t.mailboxId&&null!==t.mailboxId)&&!!("applyTag"!==t.name||t.tagId&&null!==t.tagId))}},methods:{async deleteQuickAction(e){try{await this.mainStore.deleteQuickAction(e),(0,i.Te)(t("mail","Quick action deleted"))}catch(e){H.A.error("Could not delete quick action",{error:e}),(0,i.Qg)(t("mail","Failed to delete quick action"))}},async openEditModal(t){t?(this.localAction={...t},delete this.localAction.actionSteps,this.actions=t.actionSteps,this.highestOrder=Math.max(...this.actions.map(t=>t.order),0),this.editMode=!0):(this.editMode=!1,this.localAction={id:null,name:""},this.actions=[]),this.editModal=!0},closeEditModal(){this.loading=!1,this.editModal=!1,this.localAction={id:null,name:""},this.actions=[],this.highestOrder=0},async saveQuickAction(){if(this.loading=!0,this.editMode){let e;try{e=await this.mainStore.patchQuickAction(this.localAction.id,this.localAction.name)}catch(e){return H.A.error("Could not update action",{error:e}),void(0,i.Qg)(t("mail","Failed to update quick action"))}for(const[n,a]of this.actions.entries()){if(null!=a?.id)try{this.actions[n]=await(0,V.yg)(a.id,a.name,a.order,a?.tagId,a?.mailboxId)}catch(e){H.A.error("Could not update quick action step",{error:e}),(0,i.Qg)(t("mail","Failed to update step in quick action"))}else{const t=await(0,V.Xf)(a.name,a.order,e.id,a?.tagId,a?.mailboxId);t&&(this.actions[n]=t)}this.localAction=e}(0,i.Te)(t("mail","Quick action updated"))}else{let e;const n=[];try{e=await this.mainStore.createQuickAction(this.localAction.name,this.account.id)}catch(e){return H.A.error("Could not create action",{error:e}),void(0,i.Qg)(t("mail","Failed to create quick action"))}try{for(const t of this.actions){const a=await(0,V.Xf)(t.name,t.order,e.id,t?.tagId,t?.mailboxId);a&&n.push(a)}this.actions=n}catch(e){H.A.error("Could not add step to quick action",{error:e}),(0,i.Qg)(t("mail","Failed to add steps to quick action")),this.closeEditModal()}this.localAction=e,(0,i.Te)(t("mail","Quick action created"))}this.mainStore.patchActionStepsLocally(this.localAction.id,this.actions),this.closeEditModal()},addQuickAction(t){this.deletionAndMovingDisabled?(this.actions[this.actions.length-1].order=++this.highestOrder,this.actions.push({name:t,order:this.highestOrder-1})):this.actions.push({name:t,order:++this.highestOrder}),this.actions.sort((t,e)=>t.order-e.order)},updateAction({id:t,type:e},n){const a=this.actions.findIndex(t=>t.order===n.order);if(-1===a)return;const i={...this.actions[a]};"applyTag"===e?i.tagId=t:"moveThread"===e&&(i.mailboxId=t),this.actions.splice(a,1,i)},onDrop(t){const{removedIndex:e,addedIndex:n}=t;if(this.deletionAndMovingDisabled&&(n===this.actions.length-1||e===this.actions.length-1))return;const a=this.actions[e];this.actions.splice(e,1),this.actions.splice(n,0,a),this.actions=this.actions.map((t,e)=>({...t,order:e+1}))},async deleteAction(e){if(this.actions=this.actions.filter(t=>t.order!==e.order).map((t,e)=>({...t,order:e+1})),this.highestOrder=Math.max(...this.actions.map(t=>t.order),0),e.id)try{await(0,V.AU)(e.id);const t=this.actions.filter(t=>t.id);this.mainStore.patchActionStepsLocally(this.localAction.id,t)}catch(e){return H.A.error("Could not delete action step",{error:e}),void(0,i.Qg)(t("mail","Failed to delete action step"))}}}};var z=a(30829),P={};P.styleTagTransform=O(),P.setAttributes=N(),P.insert=w().bind(null,"head"),P.domAPI=B(),P.insertStyleElement=D(),I()(z.A,P),z.A&&z.A.locals&&z.A.locals;const Y=(0,Q.A)(q,function(){var t=this,e=t._self._c;return e("div",{staticClass:"quick-actions-settings"},[0===t.quickActions.length?e("div",[t._v("\n\t\t"+t._s(t.t("mail","No quick actions yet."))+"\n\t")]):t._e(),t._v(" "),t._l(t.quickActions,function(n){return e("NcListItem",{key:n.id,attrs:{name:n?.name},scopedSlots:t._u([{key:"icon",fn:function(){return[e("IconEmailFast",{attrs:{size:20}})]},proxy:!0},{key:"actions",fn:function(){return[e("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(e){return t.openEditModal(n)}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("IconEdit",{attrs:{size:20}})]},proxy:!0}],null,!0)},[t._v("\n\t\t\t\t"+t._s(t.t("mail","Edit"))+"\n\t\t\t")]),t._v(" "),e("NcActionButton",{attrs:{"close-after-click":!0,variant:"error"},on:{click:function(e){return t.deleteQuickAction(n.id)}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("IconDelete",{attrs:{size:20}})]},proxy:!0}],null,!0)},[t._v("\n\t\t\t\t"+t._s(t.t("mail","Delete"))+"\n\t\t\t")])]},proxy:!0}],null,!0)})}),t._v(" "),e("NcButton",{staticClass:"add-quick-action",attrs:{variant:"primary"},on:{click:function(e){return t.openEditModal()}}},[t._v("\n\t\t"+t._s(t.t("mail","Add quick action"))+"\n\t")]),t._v(" "),t.editModal?e("NcModal",{attrs:{name:t.modalName},on:{close:t.closeEditModal}},[e("h2",{staticClass:"modal-name",domProps:{textContent:t._s(t.modalName)}}),t._v(" "),e("div",{staticClass:"modal-content"},[e("NcTextField",{attrs:{value:t.localAction.name,label:t.t("mail","Quick action name")},on:{"update:value":function(e){return t.$set(t.localAction,"name",e)}}}),t._v(" "),e("h3",[t._v(t._s(t.t("mail","Do the following actions")))]),t._v(" "),e("Container",{on:{onDrop:t.onDrop}},t._l(t.actions,function(n){return e("Draggable",{key:n.id,staticClass:"modal-content__action",attrs:{"drag-not-allowed":"deleteThread"===n.name||"moveThread"===n.name}},[e("Action",{attrs:{action:n,account:t.account},on:{update:e=>t.updateAction(e,n),delete:function(e){return t.deleteAction(n)}}})],1)}),1),t._v(" "),e("NcActions",{attrs:{"menu-name":t.t("mail","Add another action")},scopedSlots:t._u([{key:"icon",fn:function(){return[e("PlusIcon",{attrs:{size:20}})]},proxy:!0}],null,!1,2953566425)},[t._v(" "),t.deletionAndMovingDisabled?t._e():e("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(e){return t.addQuickAction("markAsSpam")}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("AlertOctagonIcon",{attrs:{size:20}})]},proxy:!0}],null,!1,4042396370)},[t._v("\n\t\t\t\t\t"+t._s(t.t("mail","Mark as spam"))+"\n\t\t\t\t")]),t._v(" "),e("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(e){return t.addQuickAction("applyTag")}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("TagIcon",{attrs:{size:20}})]},proxy:!0}],null,!1,3295128625)},[t._v("\n\t\t\t\t\t"+t._s(t.t("mail","Tag"))+"\n\t\t\t\t")]),t._v(" "),t.deletionAndMovingDisabled?t._e():e("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(e){return t.addQuickAction("moveThread")}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("OpenInNewIcon",{attrs:{size:20}})]},proxy:!0}],null,!1,1266168172)},[t._v("\n\t\t\t\t\t"+t._s(t.t("mail","Move thread"))+"\n\t\t\t\t")]),t._v(" "),t.deletionAndMovingDisabled?t._e():e("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(e){return t.addQuickAction("deleteThread")}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("IconDelete",{attrs:{size:20}})]},proxy:!0}],null,!1,881161434)},[t._v("\n\t\t\t\t\t"+t._s(t.t("mail","Delete thread"))+"\n\t\t\t\t")]),t._v(" "),e("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(e){return t.addQuickAction("markAsRead")}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("EmailRead",{attrs:{size:20}})]},proxy:!0}],null,!1,600311030)},[t._v("\n\t\t\t\t\t"+t._s(t.t("mail","Mark as read"))+"\n\t\t\t\t")]),t._v(" "),e("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(e){return t.addQuickAction("markAsUnread")}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("EmailUnread",{attrs:{size:20}})]},proxy:!0}],null,!1,1647220237)},[t._v("\n\t\t\t\t\t"+t._s(t.t("mail","Mark as unread"))+"\n\t\t\t\t")]),t._v(" "),e("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(e){return t.addQuickAction("markAsImportant")}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("ImportantIcon",{attrs:{size:20}})]},proxy:!0}],null,!1,4006335173)},[t._v("\n\t\t\t\t\t"+t._s(t.t("mail","Mark as important"))+"\n\t\t\t\t")]),t._v(" "),e("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(e){return t.addQuickAction("markAsFavorite")}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("IconFavorite",{attrs:{size:20}})]},proxy:!0}],null,!1,747028727)},[t._v("\n\t\t\t\t\t"+t._s(t.t("mail","Mark as favorite"))+"\n\t\t\t\t")])],1),t._v(" "),e("NcButton",{staticClass:"modal-content__save",attrs:{disabled:!t.canSave||t.loading,variant:"primary"},on:{click:t.saveQuickAction},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("NcLoadingIcon",{attrs:{size:20}}):t._e()]},proxy:!0}],null,!1,775270961)},[t._v("\n\t\t\t\t"+t._s(t.t("mail","Save"))+"\n\t\t\t")])],1)]):t._e()],2)},[],!1,null,"3a32a870",null).exports},8663(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAgMAAAC5YVYYAAAACVBMVEUAAAD///////9zeKVjAAAAAnRSTlMAuLMp9oYAAAAPSURBVAjXY4CDrJUgBAMAGaECJ9dz3BAAAAAASUVORK5CYII="},34867(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAgMAAAC5YVYYAAAACVBMVEUAAADi4uLh4eHOxeSRAAAAAnRSTlMAuLMp9oYAAAAPSURBVAjXY4CDrJUgBAMAGaECJ9dz3BAAAAAASUVORK5CYII="},77905(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAP1BMVEUAAADj4+Pf39/h4eHh4eHh4eHk5OTh4eHg4ODi4uLh4eHh4eHg4ODh4eHh4eHg4ODh4eHh4eHp6en////h4eFqcyvUAAAAFHRSTlMAOQfy7bgS5NrBvqOIfXNHMSELAgQ/iFsAAAA2SURBVAjXY4AANjYIzcjMAaVFuBkY+RkEWERYmRjYRXjANAOfiIgIFxNIAa8IpxBEi6AwiAQAK2MBd7xY8csAAAAASUVORK5CYII="},96443(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAQlBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////8IX9KGAAAAFXRSTlMA8u24NxILB+Tawb6jiH1zRz0xIQIIP3GUAAAAMklEQVQI1y3FtQEAMQDDQD+EGbz/qkEVOpyEOP6PudKjZNSXn4Jm2CKRdBKzSLsFWl8fMG0Bl6Jk1rMAAAAASUVORK5CYII="},63679(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEUAAAD///////////84wDuoAAAAA3RSTlMAyTzPIdReAAAAGUlEQVQI12PAD+b///+Nof7//79gAsLFCwAx/w4blADeeQAAAABJRU5ErkJggg=="},35121(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEUAAADi4uLi4uLh4eE5RQaIAAAAA3RSTlMAyTzPIdReAAAAGUlEQVQI12PAD+b///+Nof7//79gAsLFCwAx/w4blADeeQAAAABJRU5ErkJggg=="},95773(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAXVBMVEUAAADh4eHh4eHh4eHi4uLb29vh4eHh4eHh4eHh4eHh4eHh4eHh4eHi4uLi4uLj4+Pi4uLk5OTo6Ojh4eHh4eHi4uLg4ODg4ODh4eHg4ODh4eHf39/g4OD////h4eEzIk+wAAAAHnRSTlMAzu6/LA3p5eLZx8ONTjYiHRIKooV+YWBaRzEnCANnm5rnAAAAZElEQVQY033P2wqAIAyA4VWaaWrnc/n+j5mbhBjUf7WPoTD47TJb4i5zTr/sRDRHuyFaoWX7uK/RlbctlPEuyI1f4WY9yQINEkf6rzzo8YIzmUFoCs7J1EjeIaa9bXIEmzl8dgOZEAj/+2IvzAAAAABJRU5ErkJggg=="},40136(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAYFBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////98JRy6AAAAH3RSTlMAzu4sDenl38fBvo1OMyIdEQrj1cSihX5hYFpHNycIcQOASAAAAF9JREFUGNN9zEcOgDAMRFHTS0LvNfe/JRmHKAIJ/mqeLJn+k9uDtaeUeFnFziGsBucUTirrprfe81RqZ3Bb6hPWeuZwDFOHyf+ig9CCzQ7INBn7bG5kF+QSt13BHNJnF7AaCT4Y+CW7AAAAAElFTkSuQmCC"},4872(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYBAMAAAASWSDLAAAAD1BMVEUAAAD///////////////+PQt5oAAAABHRSTlMAy2EFIuWxUgAAACRJREFUGNNjGBBgJOICBY7KDCoucODEAJSAS6FwUJShGjAQAADBPRGrK2/FhgAAAABJRU5ErkJggg=="},41387(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYBAMAAAASWSDLAAAAD1BMVEUAAADh4eHg4ODNzc3h4eEYfw2wAAAABHRSTlMAy2EFIuWxUgAAACRJREFUGNNjGBBgJOICBY7KDCoucODEAJSAS6FwUJShGjAQAADBPRGrK2/FhgAAAABJRU5ErkJggg=="},18467(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAUVBMVEUAAADh4eHh4eHh4eHh4eHi4uLi4uLh4eHh4eHh4eHf39/j4+Ph4eHh4eHh4eHg4ODi4uLh4eHh4eHi4uLh4eHh4eHh4eHh4eHh4eH////h4eF3FMFTAAAAGnRSTlMA+/eJhGhfSHE9JBzz5KaQf3pXT0Xbz0I5AYDw8F0AAAB+SURBVCjPrdHbDoMgEEVRKAii1dZe9fz/hxplTiKIT7qfYCWTEEZdUvOwbckNAD2WHeh3brHW5f5EzGQ+iN+b1Gt6KPvtv16Dn6JX9M9ya3/A1yfu5dlyduL6Hec7mXY6ddXLPP2lpABGZ8PWXfYLTJxZekVhhl7eTX24zZPNKXoRC7zQLjUAAAAASUVORK5CYII="},85752(t){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAWlBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////9ZMre9AAAAHXRSTlMA/PiJhGNI9XlEHJB/b2ldV08+Oibk49vPp6QhAYgGBuwAAACCSURBVCjPrdHdDoIwDAXgTWAqCigo/+f9X5OwnoUwtis4V92XNWladUl+rzQPeQJAN2EHxoOnsPn7/oYk8fxBv08Rr/deOH/aZ2Nm8ZJ+s573QGfWKnNuZGzWm3+lv2V3pcU1XQ385/yjmBoM3Z+dXvlbYLLD3ujhTaOM3KaIXvNkFkuSEvYy1LqOAAAAAElFTkSuQmCC"}}]);
//# sourceMappingURL=mail.9140.76a3e2e776c1b4852a24.js.map