(()=>{var p,e,f,g,i,o,u,y,F,R,V,H,d,b,z,q,B,v,U,r,G,Z,s,l,$,c,W,Y,t,h,J,_,Q,n,a,w,k,x,X,K,S,ee,te,ne,C,ae,j,ie,re,T,oe,se,le,ce,ue,P,me,de,pe,fe,ge,ye,be,ve,he,E,_e,we,ke,xe={37:function(e,t,n){var l=n(146);e.exports=function(a,e,t){var i=[],n=!1,r=-1;function o(){for(r=0;rt||r{for(var t in e)if(m.call(e,t))return;return 1})(i)?i=d:l.set(i,r),f[e]={tag:n,attrs:i,is:i.is}}e.exports=function(e,t){if(null==e||"string"!=typeof e&&"function"!=typeof e&&"function"!=typeof e.view)throw Error("The selector must be either a string or a component.");for(var n=arguments.length,a=new Array(2{if(Array.isArray(e))return i(e)})(e)||(e=>{if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)})(e)||((e,t)=>{var n;if(e)return"string"==typeof e?i(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0})(e)||(()=>{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n{var n;if(e)return"string"==typeof e?l(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0})(e))||t&&e&&"number"==typeof e.length)return o&&(e=o),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n{var n;if("function"==typeof e.tag.view){if(e.state=Object.create(e.tag),null!=(n=e.state.view).$$reentrantLock$$)return;n.$$reentrantLock$$=!0}else{if(e.state=void 0,null!=(n=e.tag).$$reentrantLock$$)return;n.$$reentrantLock$$=!0,e.state=null!=e.tag.prototype&&"function"==typeof e.tag.prototype.view?new e.tag(e):e.tag(e)}if(A(e.state,e,t),null!=e.attrs&&A(e.attrs,e,t),e.instance=K.normalize(R.call(e.state.view,e)),e.instance===e)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null})(r=t,o=n),null!=r.instance?(H(c,r.instance,o,s,l),r.dom=r.instance.dom,r.domSize=r.instance.domSize):r.domSize=0}var l={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function z(e,t,n,a){for(var i,r=t.children.match(/^\s*?<(\w+)/im)||[],o=C(e).createElement(l[r[1]]||"div"),s=("http://www.w3.org/2000/svg"===n?(o.innerHTML=''+t.children+"",o=o.firstChild):o.innerHTML=t.children,t.dom=o.firstChild,t.domSize=o.childNodes.length,C(e).createDocumentFragment());i=o.firstChild;)s.appendChild(i);j(e,s,a)}function q(e,t,n,a,i,r){if(t!==n&&(null!=t||null!=n))if(null==t||0===t.length)T(e,n,0,n.length,a,i,r);else if(null==n||0===n.length)D(e,t,0,t.length);else{var o=null!=t[0]&&null!=t[0].key,s=null!=n[0]&&null!=n[0].key,l=0,c=0;if(!o)for(;c{for(var a=Object.create(null);t{for(var t=[0],n=0,a=0,i=0,r=P.length=e.length,i=0;i>>1)+(a>>>1)+(n&a&1);e[t[s]]{do{var n;if(null!=e.attrs&&"function"==typeof e.attrs.onbeforeupdate)if(void 0!==(n=R.call(e.attrs.onbeforeupdate,e,t))&&!n)break;if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeupdate)if(void 0!==(n=R.call(e.state.onbeforeupdate,e,t))&&!n)break;return}while(0);return e.dom=t.dom,e.domSize=t.domSize,e.instance=t.instance,e.attrs=t.attrs,e.children=t.children,e.text=t.text,1})(n,t))if("string"==typeof o)switch(null!=n.attrs&&X(n.attrs,n,a),o){case"#":var s=t,l=n;s.children.toString()!==l.children.toString()&&(s.dom.nodeValue=l.children),l.dom=s.dom;break;case"<":l=e,s=n,u=r,m=i,(d=t).children!==s.children?(Z(l,d),z(l,s,u,m)):(s.dom=d.dom,s.domSize=d.domSize);break;case"[":var c=n,u=a,m=i,d=r,p=(q(e,t.children,c.children,u,m,d),0),f=c.children;if(f!=(c.dom=null))for(var g=0;g(e=((e,t)=>{if("object"!=D(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=D(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==D(e)?e:e+""))(a.key),a)}}function A(e){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function je(e,t){for(var n=0;n{if("object"!=A(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=A(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==A(e)?e:e+""}function Pe(e){return(Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ee(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=Pe(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Pe(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==Pe(e)?e:e+""))(a.key),a)}}function Oe(e){return(Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function De(e,t){for(var n=0;n{if("object"!=Oe(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Oe(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==Oe(e)?e:e+""}function Me(e){return(Me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ie(e){return(e=>{if(Array.isArray(e))return Ne(e)})(e)||(e=>{if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)})(e)||((e,t)=>{var n;if(e)return"string"==typeof e?Ne(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ne(e,t):void 0})(e)||(()=>{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n(e=((e,t)=>{if("object"!=Me(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Me(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==Me(e)?e:e+""))(a.key),a)}}function I(e){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fe(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,n)),a}function Re(t){for(var e=1;e{if("object"!=I(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=I(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==I(e)?e:e+""}function qe(e){return(qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Be(e,t){for(var n=0;n{if("object"!=qe(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=qe(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==qe(e)?e:e+""}function Ze(e){return(Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $e(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=Ze(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Ze(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==Ze(e)?e:e+""))(a.key),a)}}function We(e){return(We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ye(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=We(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=We(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==We(e)?e:e+""))(a.key),a)}}function Je(e){return(Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qe(e,t){for(var n=0;n{if("object"!=Je(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Je(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==Je(e)?e:e+""}function Ke(e){return(Ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function et(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=Ke(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Ke(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==Ke(e)?e:e+""))(a.key),a)}}function tt(e){return(tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nt(e,t){for(var n=0;n{if("object"!=tt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=tt(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==tt(e)?e:e+""}function it(e){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rt(e,t){for(var n=0;n{if("object"!=it(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=it(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==it(e)?e:e+""}function st(e){return(st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lt(e,t){for(var n=0;n{if("object"!=st(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=st(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==st(e)?e:e+""}function ut(e){return(ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mt(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=ut(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=ut(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==ut(e)?e:e+""))(a.key),a)}}function dt(e){return(dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pt(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=dt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=dt(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==dt(e)?e:e+""))(a.key),a)}}function ft(e){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gt(e,t){for(var n=0;n{if("object"!=ft(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=ft(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==ft(e)?e:e+""}function bt(e){return(bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vt(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=bt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=bt(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==bt(e)?e:e+""))(a.key),a)}}function ht(e){return(ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _t(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=ht(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=ht(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==ht(e)?e:e+""))(a.key),a)}}function wt(e){return(wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kt(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=wt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=wt(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==wt(e)?e:e+""))(a.key),a)}}function xt(e){return(xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function St(e,t){var n,a,i,r,o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(o)return i=!(a=!0),{s:function(){o=o.call(e)},n:function(){var e=o.next();return a=e.done,e},e:function(e){i=!0,n=e},f:function(){try{a||null==o.return||o.return()}finally{if(i)throw n}}};if(Array.isArray(e)||(o=((e,t)=>{var n;if(e)return"string"==typeof e?Ct(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ct(e,t):void 0})(e))||t&&e&&"number"==typeof e.length)return o&&(e=o),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ct(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n{if("object"!=xt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=xt(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==xt(e)?e:e+""}function Et(e){return(Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ot(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=Et(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Et(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==Et(e)?e:e+""))(a.key),a)}}function Dt(e){return(Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function At(e,t){for(var n=0;n{if("object"!=Dt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Dt(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==Dt(e)?e:e+""}function It(e){return(It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nt(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=It(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=It(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==It(e)?e:e+""))(a.key),a)}}function Lt(e){return(Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ft(e,t){for(var n=0;n{if("object"!=Lt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Lt(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==Lt(e)?e:e+""}function Ht(e){return(Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zt(e){return(e=>{if(Array.isArray(e))return qt(e)})(e)||(e=>{if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)})(e)||((e,t)=>{var n;if(e)return"string"==typeof e?qt(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qt(e,t):void 0})(e)||(()=>{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function qt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n{if("object"!=Ht(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Ht(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==Ht(e)?e:e+""}function Gt(e){return(Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zt(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=Gt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Gt(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==Gt(e)?e:e+""))(a.key),a)}}function $t(e){return($t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wt(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=$t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=$t(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==$t(e)?e:e+""))(a.key),a)}}function Yt(e){return(Yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jt(e,t){for(var n=0;n{if("object"!=Yt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Yt(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==Yt(e)?e:e+""}function Xt(e){return(Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kt(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=Xt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Xt(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==Xt(e)?e:e+""))(a.key),a)}}function en(e){return(en="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=en(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=en(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==en(e)?e:e+""))(a.key),a)}}function nn(e){return(nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function an(e,t){for(var n=0;n{if("object"!=nn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=nn(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==nn(e)?e:e+""}function on(e){return(on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=on(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=on(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==on(e)?e:e+""))(a.key),a)}}function ln(e){return(ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=ln(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=ln(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==ln(e)?e:e+""))(a.key),a)}}function un(e){return(un="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=un(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=un(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==un(e)?e:e+""))(a.key),a)}}function dn(e){return(dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=dn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=dn(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==dn(e)?e:e+""))(a.key),a)}}function fn(e){return(fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=fn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=fn(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==fn(e)?e:e+""))(a.key),a)}}function yn(e){return(yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=yn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=yn(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==yn(e)?e:e+""))(a.key),a)}}function vn(e){return(vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hn(e,t){for(var n=0;n{if("object"!=vn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=vn(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==vn(e)?e:e+""}function kn(e){return(kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=kn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=kn(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==kn(e)?e:e+""))(a.key),a)}}function Sn(e){return(Sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Cn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=Sn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Sn(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==Sn(e)?e:e+""))(a.key),a)}}function jn(e){return(jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=jn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=jn(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==jn(e)?e:e+""))(a.key),a)}}function Pn(e){return(Pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function En(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=Pn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Pn(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==Pn(e)?e:e+""))(a.key),a)}}function On(e){return(On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Dn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=On(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=On(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==On(e)?e:e+""))(a.key),a)}}function An(e){return(An="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Mn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=An(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=An(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==An(e)?e:e+""))(a.key),a)}}function In(e){return(In="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=In(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=In(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==In(e)?e:e+""))(a.key),a)}}function Ln(e){return(Ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=Ln(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Ln(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==Ln(e)?e:e+""))(a.key),a)}}function Rn(e){return(Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=Rn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Rn(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==Rn(e)?e:e+""))(a.key),a)}}function Hn(e){return(Hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zn(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,n)),a}function qn(t){for(var e=1;e{if("object"!=Hn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Hn(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==Hn(e)?e:e+""}function Zn(e){return(Zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $n(e,t){for(var n=0;n{if("object"!=Zn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Zn(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string");return"symbol"==Zn(e)?e:e+""}function Yn(e){return(Yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jn(e,t){for(var n=0;n(e=((e,t)=>{if("object"!=Yn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=Yn(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==Yn(e)?e:e+""))(a.key),a)}}O.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return O.d(t,{a:t}),t},O.d=function(e,t){for(var n in t)O.o(t,n)&&!O.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},O.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),O.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},O(185),p=(()=>{function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");t.msg=t.msg||"Loading"}return e=t,(n=[{key:"view",value:function(e){return m("div",{class:"fixed w-full mt-64 flex flex-col justify-center text-center items-center space-y-4 z-50"},m("div",{class:"text-lg text-gray-600"},t.msg||""),m("div",{class:"text-indigo-600"},m("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-16 h-16",stroke:"currentColor",fill:"none",viewBox:"0 0 57 57"},m("g",{transform:"translate(1 1)","stroke-width":"2",fill:"none","fill-rule":"evenodd"},m("circle",{cx:"5",cy:"50",r:"5"},m("animate",{attributeName:"cy",begin:"0s",dur:"2.2s",values:"50;5;50;50",calcMode:"linear",repeatCount:"indefinite"}),m("animate",{attributeName:"cx",begin:"0s",dur:"2.2s",values:"5;27;49;5",calcMode:"linear",repeatCount:"indefinite"})),m("circle",{cx:"27",cy:"5",r:"5"},m("animate",{attributeName:"cy",begin:"0s",dur:"2.2s",from:"5",to:"5",values:"5;50;50;5",calcMode:"linear",repeatCount:"indefinite"}),m("animate",{attributeName:"cx",begin:"0s",dur:"2.2s",from:"27",to:"27",values:"27;49;5;27",calcMode:"linear",repeatCount:"indefinite"})),m("circle",{cx:"49",cy:"50",r:"5"},m("animate",{attributeName:"cy",begin:"0s",dur:"2.2s",values:"50;50;5;50",calcMode:"linear",repeatCount:"indefinite"}),m("animate",{attributeName:"cx",from:"49",to:"49",begin:"0s",dur:"2.2s",values:"49;5;27;49",calcMode:"linear",repeatCount:"indefinite"}))))))}}])&&Ce(e.prototype,n),a&&Ce(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,a})(),e=(()=>{function i(){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");M(this,"filters",{searchText:"",selectedCampaignType:"",selectedCampaignStatus:""}),M(this,"showLoader",!0),this.getCampaignsCount(1),this.getCampaigns(1)}return e=i,n=[{key:"prepareFilterData",value:function(){i.includeTypes=[],i.campaignStatus=[];var e=i.selectedCampaignType,t=i.selectedCampaignStatus;e&&i.includeTypes.push(e),t&&i.campaignStatus.push(t)}},{key:"getNextCampaigns",value:function(e){p.showLoader=!0,i.prepareFilterData();e={requestData:{method:"get_campaigns",handler:"campaigns",data:{exclude_types:["sequence_message","workflow_email"],order_by_column:"id",order:"DESC",currentPage:e,include_types:0\n \n \n \n \n \n \n \n ',close:'\n \n ',copy:'\n \n \n \n \n ',delete:' \n \n \n',downArrow:'\n \n',search:'\n\n',action:' \n\n\n\n',successIcon:'',failureIcon:''},i=(()=>{function r(){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function");r.show=!1}return e=r,(t=[{key:"view",value:function(e){function t(e){return"yes"===e?m("div",{class:"flex h-5 w-5 items-center justify-center rounded-full bg-green-100 mr-2"},m.trust(g.successIcon)):m("div",{class:"flex h-5 w-5 items-center justify-center rounded-full bg-red-100 mr-2"},m.trust(g.failureIcon))}function n(e){return"yes"===e?"enabled":"disabled"}var a,i="schedule_later"===u.details.scheduling_option;return m("div",{class:"form-fields ig-es-popup-container"},m("div",{class:"ig-es-popup-overlay"}),m("div",{class:"ig-es-popup"},m("div",{class:"ig-es-popup-close-container"},m("button",{onclick:function(e){e.preventDefault(),r.show=!1},class:"cross"},m.trust(g.close))),m("div",{class:"px-12 py-6"},m("div",{class:"mt-3 text-center sm:mt-5"},m("h1",{class:"modal-headline",id:"modal-title"},y.isPro()&&i?__("Ready to schedule the campaign?","email-subscribers"):__("Ready to send the campaign?","email-subscribers")),m("p",{class:"mt-3 text-left font-medium"}," ",__("Double-Check Recipients and Configuration once.","email-subscribers")),m("div",{class:"mt-3"},m("p",{class:"text-sm font-medium text-left"},__("Total recipients","email-subscribers")," : ",m("span",{class:"text-sm text-gray-500"},(null==(a=u.details)?void 0:a.meta.recipient_matching_count)||0)),m("div",{class:"mt-3 text-left"},m("p",{class:"text-sm font-medium"},__("Tracking configuration","email-subscribers")," :"),m("ul",{class:"pl-5 mt-2 text-sm text-gray-500"},m("li",{class:"flex items-center"},t(null==(a=u.details)||null==(a=a.meta)?void 0:a.enable_open_tracking),m("span",null," ",__("Open tracking","email-subscribers")," ",n(null==(a=u.details)||null==(a=a.meta)?void 0:a.enable_open_tracking))),y.isPro()&&m("li",{class:"flex items-center"},t(null==(a=u.details)||null==(a=a.meta)?void 0:a.enable_link_tracking),m("span",null," ",__("Click tracking ","email-subscribers"),n(null==(a=u.details)||null==(a=a.meta)?void 0:a.enable_link_tracking))),(y.isPro()||y.isTrial())&&m("li",{class:"flex items-center"},t(null==(a=u.details)||null==(a=a.meta)?void 0:a.enable_utm_tracking),m("span",null," ",__("UTM tracking ","email-subscribers"),n(null==(a=u.details)||null==(a=a.meta)?void 0:a.enable_utm_tracking))))),y.isPro()&&i&&m("p",{class:" mt-3 text-sm font-medium text-left"},__("Scheduled At","email-subscribers")," : ",m("span",{class:"text-sm text-gray-500"}),(null==(a=u.details)?void 0:a.meta.es_schedule_date)||"00:00:00"," ",(null==(a=u.details)?void 0:a.meta.es_schedule_time)||"00:00:00"," ",m("span",null)),m("div",{class:"pt-4"},m("button",{class:"primary text-white text-center inline-flex items-center ml-3 mr-2",type:"button",onclick:function(e){e.preventDefault(),u.sendCamapign(u.details)}},y.isPro()&&i?m("span",null," ",__("Schedule","email-subscribers")):m("span",null," ",__("Send","email-subscribers"))),m("button",{onclick:function(e){e.preventDefault(),r.show=!1},class:"secondary"},__("Edit","email-subscribers"))))))))}}])&&Ee(e.prototype,t),n&&Ee(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n})(),e=o=(()=>{function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");t.show=!1}return e=t,(n=[{key:"view",value:function(e){return m("div",{class:"form-fields\r ig-es-popup-container"},m("div",{class:"ig-es-popup-overlay"}),m("div",{class:"ig-es-popup"},m("div",{class:"ig-es-popup-close-container"},m("button",{href:"#",onclick:function(e){e.preventDefault(),t.show=!1},class:"cross"},m.trust(g.close))),m("div",{class:"p-8"},m("div",{class:"mx-auto flex h-20 w-20 items-center justify-center rounded-full bg-green-100"},m("svg",{class:"h-12 w-12 text-green-600",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"}))),m("div",{class:"mt-3 text-center sm:mt-5"},m("h3",{class:"modal-headline",id:"modal-title"},t.message),m("div",{class:"mt-2"},m("p",{class:"text-sm text-gray-500"},"Success"))))))}}])&&De(e.prototype,n),a&&De(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,a})(),n=void 0,(a=Ae(a="message"))in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,u=(()=>{function r(e){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function");void 0===r.details&&(r.details={id:0,name:"",subject:"",body:"",meta:{}}),"true"!==new URLSearchParams(window.location.search).get("iframeMode")&&window.self===window.top&&r.initialize()}return e=r,n=[{key:"initialize",value:function(){r.setCurrentCampaign(r.currentCampaignID),r.setRecipientRules(),r.updateMatchingRecipientsCount()}},{key:"setCurrentCampaign",value:function(t){var n=1{function s(){if(!(this instanceof s))throw new TypeError("Cannot call a class as a function")}return e=s,n=[{key:"requestHandler",value:function(t){var e,n=new FormData,a=(e=Re(Re({},{security:ig_es_js_data.security}),t.requestData)).method,i=!0===t.cacheable,r=null;if(i){var r="".concat(e.handler,":").concat(a,":").concat(JSON.stringify(e.data||{})),o=s.responseCache.get(r);if(o&&Date.now()-o.timestamp{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");Ue(this,"filters",{searchText:"",selectedCampaignType:"",selectedCampaignStatus:""}),Ue(this,"showLoader",!0),this.data={kpis:{},campaigns:[]},this.getCampaignsAndStats()}return t=e,(n=[{key:"getCampaignsAndStats",value:function(){var t=this;return y.requestHandler({requestData:{method:"get_kpis",handler:"campaigns",data:{days:30}},callback:function(e){e.success&&(t.data.kpis=e.data||{}),t.showLoader=!1}})}}])&&Be(t.prototype,n),a&&Be(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),R={view:function(){return m("svg",{width:"13",height:"8",viewBox:"0 0 13 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m("path",{d:"M7.24984 1.08366H11.9165M11.9165 1.08366V5.75033M11.9165 1.08366L7.24984 5.75033L4.9165 3.41699L1.4165 6.91699",stroke:"#1D9E2A","stroke-width":"1.3125","stroke-linecap":"round","stroke-linejoin":"round"}))}},V={view:function(){return m("svg",{width:"13",height:"8",viewBox:"0 0 13 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m("path",{d:"M6.91634 6.91634H11.583M11.583 6.91634V2.24967M11.583 6.91634L6.91634 2.24967L4.58301 4.58301L1.08301 1.08301",stroke:"#CA3131","stroke-width":"1.3125","stroke-linecap":"round","stroke-linejoin":"round"}))}},H={view:function(e){e=e.attrs;return"up"===e.class?m(R,null):"down"===e.class?m(V,null):void 0}},d={view:function(e){var e=e.attrs,t=e.badgeText,e=e.badgeClass;return m("div",{class:"change ".concat(e)},m("span",{class:"value"},t),m("span",null,m(H,{class:e})))}},b=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"view",value:function(e){e=e.attrs;return m("span",{class:"relative flex flex-col items-center group cursor-pointer"},m("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m("path",{d:"M9.00188 4.36987C7.62484 4.36987 6.48877 5.48872 6.48877 6.88299C6.48877 7.24446 6.78139 7.51987 7.12565 7.51987C7.46992 7.51987 7.76254 7.22725 7.76254 6.88299C7.76254 6.21168 8.31336 5.66086 8.98467 5.66086C9.69041 5.66086 10.2068 6.16004 10.2068 6.83135C10.2068 6.83135 10.2068 6.84856 10.2068 6.88299C10.2068 7.26168 10.1035 8.15676 8.88139 8.3461C8.57156 8.39774 8.33057 8.65594 8.33057 8.98299V10.7215C8.33057 11.083 8.6232 11.3584 8.96746 11.3584C9.31172 11.3584 9.60434 11.0658 9.60434 10.7215V9.49938C11.2224 9.0002 11.4806 7.60594 11.4806 6.83135C11.515 5.4543 10.3789 4.36987 9.00188 4.36987Z",fill:"#575362"}),m("path",{d:"M8.99908 12.1328C8.53433 12.1328 8.17285 12.5115 8.17285 12.959C8.17285 13.4066 8.55154 13.7853 8.99908 13.7853C9.44662 13.7853 9.82531 13.4066 9.82531 12.959C9.82531 12.5115 9.44662 12.1328 8.99908 12.1328Z",fill:"#575362"}),m("path",{d:"M9.00058 0.600098C4.37026 0.600098 0.600586 4.36977 0.600586 9.0001C0.600586 13.6304 4.37026 17.4001 9.00058 17.4001C13.6309 17.4001 17.4006 13.6304 17.4006 9.0001C17.4006 4.36977 13.6309 0.600098 9.00058 0.600098ZM9.00058 16.1263C5.07599 16.1263 1.87436 12.9247 1.87436 9.0001C1.87436 5.07551 5.07599 1.87387 9.00058 1.87387C12.9252 1.87387 16.1268 5.07551 16.1268 9.0001C16.1096 12.9247 12.9252 16.1263 9.00058 16.1263Z",fill:"#575362"})),m("div",{class:"absolute top-0 flex flex-col items-center hidden mb-6 group-hover:flex z-10"},m("div",{class:"w-2 h-2 mt-6 rotate-45 bg-white"}),m("span",{class:"relative w-48 h-16 p-2 text-xs font-medium flex items-center justify-center shadow-lg rounded-sm bg-white bg-opacity-100"},e.tooltipText)))}}])&&$e(t.prototype,n),a&&$e(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),z=(()=>{function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.initialize(e.attrs)}return e=t,(n=[{key:"initialize",value:function(e){y.toggleAdminMenuVisibility(!1),this.model=new F(this.urlParams)}},{key:"view",value:function(){var e=null==(e=this.model.data)?void 0:e.kpis,t=null==e?void 0:e.total_message_sent,n=null==e?void 0:e.sent_percentage_growth,a=null==e?void 0:e.avg_open_rate,i=null==e?void 0:e.open_percentage_growth,r=null==e?void 0:e.avg_click_rate,o=null==e?void 0:e.click_percentage_growth,s=null==e?void 0:e.avg_unsubscribe_rate,l=null==e?void 0:e.unsubscribe_percentage_growth,c=null==e?void 0:e.avg_bounce_rate,e=null==e?void 0:e.hard_bounces_percentage_growth;return this.model.showLoader?m(p,null):(y.isPro()||(r=c=0),m("div",{class:"overview"},m("div",{class:"flex flex-row justify-between"},m("h2",null,"Overview"),m("p",{class:"text-gray-500"},"Compared to last 30 days")),m("div",{class:"flex flex-row w-full"},m("div",{class:"hidden lg:flex"},m("img",{width:"180",src:ig_es_main_js_data.image_path+"lite/admin/images/new/overview-snippet.png",alt:""})),m("div",{class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 w-full ml-0 lg:ml-5"},m("div",{class:"kpi"},m("div",{class:"stats"},m("div",{class:"flex space-x-2"},m("span",{class:"kpi-title"},"Email Sent "),m(b,{tooltipText:__("Count of email sent","email-subscribers")})),m("span",{class:"kpi-stats"},t||0)),n?m(d,{badgeText:n+"%",badgeClass:0{function r(){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function");this.showActionDropdown=!1}return e=r,(t=[{key:"oninit",value:function(n){var a=this;n.state.handleAction=function(e,t){m.redraw(),n.attrs.onAction(e,t),a.showActionDropdown=!1,r.activeCampaignId=null}}},{key:"toggleActionsDropdown",value:function(e){r.activeCampaignId=r.activeCampaignId&&r.activeCampaignId!==e||null===r.activeCampaignId?e:null,this.showActionDropdown=r.activeCampaignId===e,m.redraw()}},{key:"view",value:function(e){var t=this,n=e.attrs,a=e.state,i=n.campaignId,e=n.actions,n=r.activeCampaignId===i;return m("div",{class:"text-right dropdown"},m("div",null,m("button",{type:"button",id:"menu-button",class:"px-2 secondary menu-button","aria-expanded":n,"aria-haspopup":"true",onclick:function(){return t.toggleActionsDropdown(i)}},m.trust(g.action))),m("div",{class:"".concat("absolute font-normal text-left dropdown-menu scale-95 z-50"," ").concat(n?"":"hidden opacity-0"),role:"menu","aria-orientation":"vertical","aria-labelledby":"menu-button",tabindex:"-1",id:"dropdown-menu"},e.map(function(t){return m("div",{role:"none"},m("a",{href:"#",role:"menuitem",tabindex:"-1",onclick:function(e){e.preventDefault(),a.handleAction(i,t)}},t.title))})))}},{key:"onremove",value:function(){r.activeCampaignId===this.campaignId&&(r.activeCampaignId=null)}}])&&Qe(e.prototype,t),n&&Qe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n})(),n=null,(t=Xe(t="activeCampaignId"))in a?Object.defineProperty(a,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[t]=n,q=e,B=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"view",value:function(e){var t,n,a=f.data.campaign_data[0],i=f.data.campaign_data[1],r=f.data.currentPage;return(null==r||(r=parseInt(r,10),isNaN(r))||r<1)&&(r=1),t=null!=r&&r{function o(){var r=this;if(!(this instanceof o))throw new TypeError("Cannot call a class as a function");N(this,"pauseCampaign",function(t,e){o.show=!1;var n=ig_es_main_js_data.campaign_status_codes.paused,a=ig_es_main_js_data.campaign_status_codes.queued,i=e.status===n?"resume":"pause";r.model.pauseCampaign(t,i,function(e){e.success?f.data.campaigns=f.data.campaigns.map(function(e){return e.id===t&&(e.status="pause"==i?n:a,e.status_text="pause"==i?__("Paused","email-subscribers"):__("Sending","email-subscribers")),e}):alert(__("Failed to change campaign status.","email-subscribers"))})}),this.initialize()}return e=o,n=[{key:"mayDeleteCampaign",value:function(e,t){var n=t.campaignType,a=t.campaignStatus,i=ig_es_main_js_data.campaign_status_codes,r=ig_es_main_js_data.campaign_types;o.campaignId=e,o.actionData=t,n==r.sequence||a==i.draft?(o.isCampaignSending=!1,o.deletePopupText=__("Are you sure you want to delete this campaign?","email-subscribers")):(a==i.queued?o.isCampaignSending=!0:o.isCampaignSending=!1,o.deletePopupText=__("Are you sure you want to delete this ongoing campaign and its report?","email-subscribers")),o.show=!0}}],(t=[{key:"initialize",value:function(){this.model=new f}},{key:"deleteCampaign",value:function(e){var t;e&&0<(t=[e]).length&&(o.show=!1,p.msg=__("Deleting campaign","email-subscribers"),p.showLoader=!0,this.model.deleteCampaigns(t,function(e){p.showLoader=!1,p.msg="Loading",e.success?f.data.campaigns=f.data.campaigns.filter(function(e){return!t.includes(e.id)}):alert(ig_es_js_data.i18n_data.ajax_error_message)}))}},{key:"view",value:function(e){var t=this;return m("div",{class:"form-fields\r ig-es-popup-container"},m("div",{class:"ig-es-popup-overlay"}),m("div",{class:"ig-es-popup"},m("div",{class:"ig-es-popup-close-container"},m("button",{href:"#",onclick:function(e){e.preventDefault(),o.show=!1},class:"cross"},m.trust(g.close))),m("div",{class:"px-12 py-6"},m("div",{class:"mx-auto flex h-20 w-20 items-center justify-center"},m("img",{src:ig_es_main_js_data.image_path+"lite/admin/images/new/image 29.png",alt:"Campaign delete"})),m("div",{class:"mt-3 text-center sm:mt-5"},m("h3",{class:"modal-headline",id:"modal-title"},o.deletePopupText),m("div",{class:"mt-2"},1==o.isCampaignSending&&ig_es_js_data.is_premium?m("[",null," ",m("p",{class:"text-sm text-gray-500"},__("Alternatively you can also pause the campaign to halt sending.","email-subscribers"))):"",m("div",{class:"pt-4"},m("button",{id:"dropdownDefaultButton","data-dropdown-toggle":"dropdown",class:"primary text-white text-center inline-flex items-center ml-3 mr-2",type:"button",onclick:function(e){e.preventDefault(),t.deleteCampaign(o.campaignId)}},m("span",null,__("Delete","email-subscribers"))),1==o.isCampaignSending&&ig_es_js_data.is_premium?m("[",null,m("button",{href:"#",onclick:function(e){e.preventDefault(),t.pauseCampaign(o.campaignId,o.actionData)},class:"secondary"},__("Pause","email-subscribers"))):"",0==o.isCampaignSending?m("[",null,m("button",{href:"#",onclick:function(e){e.preventDefault(),o.show=!1},class:"secondary"},__("Cancel","email-subscribers"))):""))))))}}])&&nt(e.prototype,t),n&&nt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n})(),N(v,"show",!1),N(v,"campaignId",null),N(v,"actionData",[]),N(v,"deletePopupText",null),N(v,"isCampaignSending",!1),U=(()=>{function e(){var a=this;if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");L(this,"handleCampaignAction",function(e,t){"editCampaign"===t.handler?a.editCampaign(e,t):"toggleStatus"===t.handler?a.toggleStatus(e,t):"deleteCampaign"===t.handler?v.mayDeleteCampaign(e,t):"viewReport"===t.handler?a.redirectToReportPage(e,t):"duplicateCampaign"===t.handler?a.duplicateCampaign(e):"pauseCampaign"===t.handler&&a.pauseCampaign(e,t)}),L(this,"toggleStatus",function(t,e){var n="1"===e.currentStatus?"0":"1";a.model.toggleStatus(t,n,function(e){e.success?f.data.campaigns=f.data.campaigns.map(function(e){return e.id===t&&(e.status=n,e.status_text="1"==n?__("Active","email-subscribers"):__("Draft","email-subscribers")),e}):alert(__("Failed to change campaign status.","email-subscribers"))})}),L(this,"redirectToReportPage",function(e,t){window.location.href=t.url}),L(this,"duplicateCampaign",function(e,t){a.model.duplicateCampaign(e,function(e){e.success?(e=e.data,f.data.campaigns.unshift(e)):alert(__("Failed to duplicate campaign. Please try again later.","email-subscribers"))})}),L(this,"pauseCampaign",function(t,e){var n="4"===e.status?"resume":"pause";a.model.pauseCampaign(t,n,function(e){e.success?f.data.campaigns=f.data.campaigns.map(function(e){return e.id===t&&(e.status="pause"==n?"4":"3",e.status_text="pause"==n?__("Paused","email-subscribers"):__("Sending","email-subscribers")),e}):alert(__("Failed to change campaign status.","email-subscribers"))})}),this.initialize()}return t=e,(n=[{key:"initialize",value:function(){this.model=new f}},{key:"refreshCampaignModel",value:function(e){u.currentCampaignID=e,u.setCurrentCampaign(e)}},{key:"setSearchText",value:function(e){this.model.filters.searchText=e,f.searchText=e,this.model.getCampaigns(),this.model.getCampaignsCount(1)}},{key:"setSelectedCampaignType",value:function(e){this.model.filters.selectedCampaignType=e,f.selectedCampaignType=e,this.model.getCampaigns(),this.model.getCampaignsCount(1)}},{key:"setSelectedCampaignStatus",value:function(e){this.model.filters.selectedCampaignStatus=e,f.selectedCampaignStatus=e,this.model.getCampaigns(),this.model.getCampaignsCount(1)}},{key:"toggleCheckbox",value:function(t){document.querySelectorAll('.ig-es-list-table tbody input[type="checkbox"]').forEach(function(e){e.checked=t})}},{key:"redirectToEditUrl",value:function(e){var t=e.type,n=ig_es_main_js_data,a=n.newsletter_campaign_type,i=n.sequence_campaign_type,r=n.workflow_campaign_type;-1<[a,n.post_notification_campaign_type,n.post_digest_campaign_type].indexOf(t)?(this.refreshCampaignModel(e.id),m.route.set("/campaign/edit/:campaignId",{campaignId:e.id})):t===i?window.location.href="?page=es_sequence&action=edit&id="+e.id:t===r&&(window.location.href="?page=es_workflows&action=edit&id="+e.parent_id)}},{key:"mayDeleteCampaigns",value:function(){var t=[];document.querySelectorAll('.ig-es-list-table tbody input[type="checkbox"]').forEach(function(e){e.checked&&t.push(e.value)}),0===t.length?alert(__("Please select campaigns to delete.","email-subscribers")):confirm(__("Do you really want to delete selected campaigns?","email-subscribers"))&&(p.msg=__("Deleting campaigns","email-subscribers"),p.showLoader=!0,this.model.deleteCampaigns(t,function(e){p.showLoader=!1,p.msg="Loading",e.success?(f.data.campaigns=f.data.campaigns.filter(function(e){return!t.includes(e.id)}),m.redraw()):alert(ig_es_js_data.i18n_data.ajax_error_message)}))}},{key:"editCampaign",value:function(e,t){this.redirectToEditUrl(t.campaign)}},{key:"view",value:function(e){var i,t,n,r,o,s,l,c,a,u,d=this;e.attrs;return this.model.showLoader?"":(i={post_notification:"notification.svg",newsletter:"broadcast.svg",post_digest:"notification.svg",sequence:"sequences.svg",workflow_email:"sequences.svg",workflow:"sequences.svg"},t=ig_es_main_js_data.campaign_types,n=ig_es_main_js_data.campaign_status_names,r=ig_es_main_js_data.campaign_status_codes,e=f.data.campaigns.filter(function(e){return 0<=e.name.toLowerCase().indexOf(d.model.filters.searchText.toLowerCase())}),o=ig_es_main_js_data.post_notification_campaign_type,s=ig_es_main_js_data.post_digest_campaign_type,l=ig_es_main_js_data.newsletter_campaign_type,c=ig_es_main_js_data.sequence_campaign_type,u=f.data.campaign_data[0],a=f.data.campaign_data[3],u=!(null!==u&&u<=a),m("div",null,v.show?m(v,null):null,m("div",{class:"ig-es-list-table"},m("div",{class:"flex flex-col justify-start gap-4 md:gap-0 md:flex-row md:justify-between"},m("div",{class:"flex flex-row space-x-1"},m("h2",null,e?e.length:0," Items")),m("div",{class:"flex flex-row flex-wrap gap-5"},m("div",{class:"cta"},m("button",{href:"#",class:"cross",onclick:function(){return d.mayDeleteCampaigns()}},m.trust(g.delete))),m("div",null,m("div",{class:"relative"},m("div",{class:"search-icon"},m.trust(g.search)),m("input",{type:"search",id:"default-search",class:"search",placeholder:"Search",oninput:function(e){d.setSearchText(e.target.value)}}))),m("div",null,m("select",{class:"w-32 text-sm",onchange:function(e){return d.setSelectedCampaignType(e.target.value)}},m("option",{value:""}," ",__("All Types","email-subscribers")),Object.keys(t).map(function(e){return m("option",{value:e},t[e])}))),m("div",null,m("select",{class:"w-32 text-sm",onchange:function(e){return d.setSelectedCampaignStatus(e.target.value)}},m("option",{value:""},__("All Status","email-subscribers")),Object.keys(n).map(function(e){return m("option",{value:e},n[e])}))))),p.showLoader?m(p,null):null,m("div",{class:"overflow-x-auto"},m("div",{class:"table"},m("table",null,m("thead",{class:"bg-light-gray"},m("tr",null,m("th",{scope:"col"},m("input",{type:"checkbox",class:"checkbox",onchange:function(e){return d.toggleCheckbox(e.target.checked)}})),m("th",{scope:"col"},m("div",{class:"flex space-x-2"}," ",m("label",{for:"Name"},__("NAME","email-subscribers")))),m("th",{scope:"col"},m("div",{class:"flex space-x-2"}," ",m("label",{for:"CATEGORY"},__("CATEGORY","email-subscribers")),m(b,{tooltipText:__("Category of Post Notification","email-subscribers")})," ")),m("th",{scope:"col"}," ",m("div",{class:"flex space-x-2"},m("label",{for:"open"},__("OPEN","email-subscribers")),m(b,{tooltipText:__("Open rate of campaign","email-subscribers")})," ")),y.isPro()&&m("th",{scope:"col"},m("div",{class:"flex space-x-2"},m("label",{for:"click"},__("CLICKS","email-subscribers")),m(b,{tooltipText:__("Click rate of campaign","email-subscribers")})," ")),m("th",{scope:"col"}," ",__("STATUS","email-subscribers")),m("th",{scope:"col"},__("ACTIONS","email-subscribers")))),m("tbody",null,e&&e.map(function(t){t.id;var e=t.type,n=([o,s].includes(e),t.status),a=[];return t.created_at=t.created_at.startsWith("<")?"":t.created_at,t.editUrl="",a=[{title:__("Edit","email-subscribers"),handler:"editCampaign",campaign:t},{title:__("Delete","email-subscribers"),handler:"deleteCampaign",campaignType:e,campaignStatus:n}],e!==l&&a.push({title:"1"===n?__("Disable","email-subscribers"):__("Enable","email-subscribers"),handler:"toggleStatus",currentStatus:n}),t.report_link&&a.push({title:__("View report","email-subscribers"),handler:"viewReport",url:t.report_link}),"starter"!==ig_es_main_js_data.es_plan&&"pro"!==ig_es_main_js_data.es_plan||e!==l||"3"!==n&&"4"!==n||a.push({title:"3"===n?__("Pause","email-subscribers"):__("Resume","email-subscribers"),handler:"pauseCampaign",status:n}),"pro"!==ig_es_main_js_data.es_plan||e!==l&&e!==c||a.push({title:__("Duplicate","email-subscribers"),handler:"duplicateCampaign"}),m("tr",null,m("td",null,m("input",{type:"checkbox",class:"checkbox",value:t.id})),m("td",null,m("div",{class:"list-item"},m("div",{class:"avatar"},m("img",{src:ig_es_main_js_data.image_path+"lite/admin/images/new/"+i[t.type],alt:""})),m("div",{class:"item-details"},m("p",null,m("a",{href:"#",onclick:function(e){e.preventDefault(),d.redirectToEditUrl(t)}},t.name)),m("div",{class:"item-meta"},m("span",null,t.list_ids?"Lists: "+t.list_ids:""),m("span",null,t.created_at))))),m("td",null,t.categories||"-"),m("td",null,t.open_rate,"%"),y.isPro()&&m("td",null,t.click_rate,"%"),m("td",null,m("div",{class:"status"},t.status==r.draft?m("[",null,m("p",{class:"text-indigo-600"},m("span",{class:"bg-indigo-600 dot"}),t.status_text)):"",t.status==r.active?m("[",null,m("p",{class:"text-green-600"},m("span",{class:"bg-green-600 dot"}),t.status_text)):"",t.status==r.scheduled?m("[",null,m("p",{class:"text-red-600"},m("span",{class:"bg-red-600 dot"}),t.status_text),m("span",{class:"sub-text",title:__("Campaign scheduled at","email-subscribers")},t.start_at)):"",t.status==r.queued?m("[",null,m("p",{class:"text-blue-600"},m("span",{class:"bg-blue-600 dot"}),t.status_text),m("span",{class:"sub-text",title:__("Campaign scheduled at","email-subscribers")},t.start_at)):"",t.status==r.paused?m("[",null,m("p",{class:"text-gray-400"},m("span",{class:"bg-gray-400 dot"}),t.status_text),m("span",{class:"sub-text",title:__("Campaign scheduled at","email-subscribers")},t.start_at)):"",t.status==r.finished?m("[",null,m("p",{class:"text-green-600"},m("span",{class:"bg-green-600 dot"}),t.status_text),m("span",{class:"sub-text",title:__("Campaign scheduled at","email-subscribers")},t.start_at)):"")),m("td",null,m("div",{class:""},m(q,{campaignId:t.id,actions:a,onAction:d.handleCampaignAction}))))}),this.model.showLoader||0!==e.length?"":m("tr",null,m("td",{colspan:"7"},__("No campaigns found","email-subscribers"))),this.model.showLoader?__("Loading campaigns","email-subscribers"):"")))),u?m(B,null):"")))}}])&&rt(t.prototype,n),a&&rt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),a=r=(()=>{function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function")}return e=t,a=[{key:"loadItems",value:function(){return p.showLoader=!0,y.requestHandler({requestData:{handler:"gallery",method:"get_gallery_items"},callback:function(e){e.success&&(t.items=e.data.items),p.showLoader=!1}})}},{key:"loadTemplatePreviewData",value:function(e,t,n){return p.showLoader=!0,y.requestHandler({requestData:{handler:"gallery",method:"preview_template",data:{gallery_type:t,template_id:e}},callback:n})}},{key:"deleteTemplate",value:function(e,t){return y.requestHandler({requestData:{handler:"gallery",method:"delete_template",data:{template_id:e}},callback:t})}}],(n=null)&<(e.prototype,n),a&<(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,a})(),t=[],(n=ct(n="items"))in a?Object.defineProperty(a,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[n]=t,G=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"view",value:function(e){var n=e.attrs.item,t=e.attrs.campaignType,a=n.gallery_type,e=n.es_plan,i=n.template_version,e=canUpsellESTemplate(e,i),r=c.manageTemplates,o=!r&&!e,s=r&&"local"===a,r=r&&"remote"===a&&!e;return m("div",{class:"ig-es-card"},m("div",{class:"card-head"},m("div",{class:"group"},n.thumbnail?m("img",{src:n.thumbnail,alt:"{item.title}"}):m("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-40 w-full mb-8 ",fill:"none",viewBox:"0 0 24 24",stroke:"#d2d6dc"},m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1",d:"M3 19v-8.93a2 2 0 01.89-1.664l7-4.666a2 2 0 012.22 0l7 4.666A2 2 0 0121 10.07V19M3 19a2 2 0 002 2h14a2 2 0 002-2M3 19l6.75-4.5M21 19l-6.75-4.5M3 10l6.75 4.5M21 10l-6.75 4.5m0 0l-1.14.76a2 2 0 01-2.22 0l-1.14-.76"})),m("div",{class:"hidden group-hover:flex group-hover:absolute w-full h-full top-0 right-3 flex-col items-center justify-start pt-6 space-y-8 cursor-pointer bg-gray-700/50"},m("div",{class:"flex justify-end w-full px-5"},s&&m("button",{href:"#",onclick:function(e){e.preventDefault(),c.deleteGalleryTemplate(n.ID)},class:"cross white text-end"},m.trust(g.close)),r&&m("button",{onclick:function(e){location.href="?action=ig_es_import_remote_gallery_template&template-id="+n.ID+"&_wpnonce="+ig_es_js_data.security},class:"font-semibold text-base text-indigo-500 inline-flex items-center md:mb-2 lg:mb-0",title:__("Import this template","email-subscribers")},m("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4"},m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})))),m("div",{class:"flex flex-col space-y-3"},m("button",{onclick:function(){return c.showPreview(n,t,a)},class:"white"},"Preview"),o&&m("button",{onclick:function(){return location.href="?action=ig_es_import_gallery_item&template-id="+n.ID+"&campaign-type="+t+"&gallery-type="+a+"&_wpnonce="+ig_es_js_data.security},class:"outline"},"Use This"),s&&m("button",{onclick:function(){m.route.set("/template/edit/"+n.ID)},class:"outline"}," ",__("Edit This","email-subscribers")))))),m("div",{class:"card-desc"},m("div",{class:"title"},m("div",null,m("h2",null,n.title)),s&&m("div",{class:"saved"},m("div",{class:"relative flex flex-row-reverse items-center group"},m("button",{onclick:function(){return location.href="?action=ig_es_duplicate_template&template-id="+n.ID+"&_wpnonce="+ig_es_js_data.security}},m("svg",{width:"11",height:"13",viewBox:"0 0 11 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.400391 0.609805C0.400391 0.272989 0.670663 0 1.00404 0H9.79675C10.1301 0 10.4004 0.272989 10.4004 0.609805V12.3902C10.4004 12.6141 10.2789 12.8201 10.0839 12.9266C9.8889 13.0331 9.65179 13.0231 9.46627 12.9005L5.40039 10.2134L1.33451 12.9005C1.14903 13.0231 0.91192 13.0331 0.716902 12.9266C0.521924 12.8201 0.400391 12.6141 0.400391 12.3902V0.609805ZM1.60768 1.21961V11.2625L5.06991 8.97442C5.27065 8.84173 5.53013 8.84173 5.73087 8.97442L9.1931 11.2625V1.21961H1.60768Z",fill:"#5E19CF"}))),m("div",{class:"absolute top-0 right-4 flex flex-row-reverse items-center hidden mb-6 group-hover:flex"},m("div",{class:"relative w-2 h-2 rotate-45 -left-1 bg-neutral-950"}),m("span",{class:"relative w-11 z-10 p-2 text-xs font-medium justify-center leading-none text-white bg-neutral-950 shadow-lg rounded-sm"},__("Duplicate","email-subscribers"))))),r&&m("div",{class:"save"},m("div",{class:"relative flex flex-row-reverse items-center group"},m("button",{onclick:function(){return location.href="?action=ig_es_import_remote_gallery_template&template-id="+n.ID+"&_wpnonce="+ig_es_js_data.security}},m("svg",{width:"11",height:"13",viewBox:"0 0 11 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.400391 0.609805C0.400391 0.272989 0.670663 0 1.00404 0H9.79675C10.1301 0 10.4004 0.272989 10.4004 0.609805V12.3902C10.4004 12.6141 10.2789 12.8201 10.0839 12.9266C9.8889 13.0331 9.65179 13.0231 9.46627 12.9005L5.40039 10.2134L1.33451 12.9005C1.14903 13.0231 0.91192 13.0331 0.716902 12.9266C0.521924 12.8201 0.400391 12.6141 0.400391 12.3902V0.609805ZM1.60768 1.21961V11.2625L5.06991 8.97442C5.27065 8.84173 5.53013 8.84173 5.73087 8.97442L9.1931 11.2625V1.21961H1.60768Z",fill:"#5E19CF"}))),m("div",{class:"absolute top-0 right-4 flex flex-row-reverse items-center hidden mb-6 group-hover:flex"},m("div",{class:"relative w-2 h-2 rotate-45 -left-1 bg-neutral-950"}),m("span",{class:"relative w-11 z-10 p-2 text-xs font-medium justify-center leading-none text-white bg-neutral-950 shadow-lg rounded-sm"},__("Import","email-subscribers")))))),m("ul",{class:"meta-tags"},n.categories.map(function(e,t){t=n.categories[t].replace(/_/g," ");return"1.0.0"==i&&("starter"===t?t="pro":"pro"===t&&(t="max")),m("li",{class:"text-purple-500 bg-purple-500/20"},t)}))))}}])&&mt(t.prototype,n),a&&mt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),Z=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"view",value:function(e){return m("div",{class:"tabs"},m("ul",null,m("li",null,m("a",{href:"#",onclick:function(e){e.preventDefault(),c.clearAllActiveFilters(),e.even.addClss("active")},class:"tab"},__("All","email-subscribers"))),m("li",null,m("a",{href:"#",onclick:function(e){e.preventDefault(),c.setActiveFilters("type",ig_es_main_js_data.newsletter_campaign_type)},class:(-1{function i(e){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function");r.canShowEditorChoicePopup=!1,r.activeFilters=[],r.manageTemplates=!1,y.toggleAdminMenuVisibility(!0)}return e=i,n=[{key:"showPreview",value:function(t,n,e){r.loadTemplatePreviewData(t.ID,e,function(e){p.showLoader=!1,l.previewHTML=e.data.template_html,l.item=t,l.showPreview=!0,l.campaignType=n})}},{key:"showEditorChoicePopup",value:function(){r.canShowEditorChoicePopup=!0}},{key:"hideEditorChoicePopup",value:function(){r.canShowEditorChoicePopup=!1}},{key:"deleteGalleryTemplate",value:function(t){confirm(__("Do you really want to delete this template?","email-subscribers"))&&r.deleteTemplate(t,function(e){e.success?r.items=r.items.filter(function(e){return e.ID!==t}):alert(__("An error has occured. Please try again later","email-subscribers"))})}},{key:"setActiveFilters",value:function(e,t){void 0===r.activeFilters&&(r.activeFilters=[]),void 0===r.activeFilters[e]&&(r.activeFilters[e]=[]),-1{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"view",value:function(){y.isPro();return m("div",{class:"form-fields ig-es-popup-container"},m("div",{class:"ig-es-popup-overlay"}),m("div",{class:"ig-es-popup"},m("div",{class:"ig-es-popup-title"},m("h3",null,"Create A New Campaign"),m("div",{class:"ig-es-popup-close-container"},m("button",{href:"#",onclick:function(e){e.preventDefault(),Y.hideCampaignChoicePopup()},class:"cross"},m.trust(g.close)))),m("div",{class:"p-6 bg-gray-50 grid grid-cols-1 ".concat(y.isPro()?"md:grid-cols-3":"md:grid-cols-2"," gap-5")},m("div",{class:"ig-es-new-campaign-type-tab",onclick:function(e){m.route.set("/gallery",{campaignType:ig_es_main_js_data.post_notification_campaign_type})}},m("img",{class:"inline",src:ig_es_main_js_data.image_path+"lite/admin/images/new/image 9.png",alt:""}),m("p",{class:"ig-es-campaign-type-title"},"Post Notification")),m("div",{class:"ig-es-new-campaign-type-tab",onclick:function(e){m.route.set("/gallery",{campaignType:ig_es_main_js_data.newsletter_campaign_type})}},m("img",{class:"inline",src:ig_es_main_js_data.image_path+"lite/admin/images/new/image 10.png",alt:""}),m("p",{class:"ig-es-campaign-type-title"},"Broadcast")),y.isPro()&&m("div",{class:"ig-es-new-campaign-type-tab",onclick:function(e){location.href="admin.php?page=es_sequence&action=new"}},m("img",{class:"inline",src:ig_es_main_js_data.image_path+"lite/admin/images/new/image 12.png",alt:""}),m("p",{class:"ig-es-campaign-type-title"},"Sequence")))))}}])&&vt(t.prototype,n),a&&vt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),Y=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");e.CamapignChoicePopup=!1}return t=e,a=[{key:"hideCampaignChoicePopup",value:function(){e.CamapignChoicePopup=!1}}],(n=[{key:"showCampaignChoicePopup",value:function(){e.CamapignChoicePopup=!0}},{key:"view",value:function(){var t=this;return m("main",{class:"gap-5"},m("div",{class:"sticky top-0 z-10"},m("header",null,m("nav",{"aria-label":"Global",class:"pb-5 w-full"},m("div",{class:"brand-logo"},m("span",null,m("img",{src:ig_es_main_js_data.image_path+"lite/admin/images/new/brand-logo/IG LOGO 192X192.svg",alt:"brand logo"}),m("div",{class:"divide"}),m("h1",null,"Campaigns"))),m("div",{class:"cta"},m("button",{href:"#",class:"secondary",onclick:function(e){m.route.set("/gallery",{manageTemplates:"yes"})}},"Templates"),m("button",{href:"#",class:"primary",onclick:function(e){e.preventDefault(),u.currentCampaignID="",t.showCampaignChoicePopup()}},"Create New"))))),m(z,null),m(U,null),e.CamapignChoicePopup?m(W,null):"")}}])&&_t(t.prototype,n),a&&_t(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),t=O(243),h=O.n(t),J=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"oncreate",value:function(e){var e=e.attrs,t=e.content;if("undefined"!=typeof esVisualEditor&&esVisualEditor.destroy)try{esVisualEditor.destroy()}catch(e){console.warn("[DNDEditorCanvas] Cleanup warning:",e)}var n=document.querySelectorAll(".gjs-pn-panel, .gjs-pn-devices-c, .gjs-pn-buttons"),n=(0\n \n \n \n \n \n \n \n \n Hello {{subscriber.name | fallback=\'there\'}},\n We have published a new post on our site.\n \n \n \n \n
\n {{campaign.posts}}\n \n \n \n \n {{post.title}}\n \n \n {{post.excerpt}}\n \n \n Read More\n \n \n \n \n {{/campaign.posts}}\n
\n
\n
\n \n \n @2022, Your Brand Name.\n You received this email because in the past you have provided us your email address : {{subscriber.email}} to receive notifications when new updates are posted. If you wish to unsubscribe from our newsletter, click here\n \n \n \n
\n ':'\n \n \n \n \n \n \n \n \n Hello {{subscriber.name | fallback=\'there\'}},\n \n \n \n \n Your content...\n \n \n \n \n @2023, Your Brand Name.\n You are receiving this email because you have visited our site or asked\n about our regular newsletter. If you wish to unsubscribe from our newsletter, click here \n \n \n \n \n '),setTimeout(function(){try{esVisualEditor.importMjml(t),esVisualEditor.Canvas&&esVisualEditor.Canvas.refresh(),esVisualEditor.render&&esVisualEditor.render()}catch(e){console.error("DNDEditorCanvas: Error importing MJML:",e)}},500),this.fixComponentSelectIssueOnScroll()}},{key:"onremove",value:function(){var e=document.getElementById("campaign-content");if(e&&e.removeEventListener("scroll",this.scrollHandler),"undefined"!=typeof esVisualEditor&&esVisualEditor.destroy)try{esVisualEditor.destroy()}catch(e){console.warn("Editor cleanup warning:",e)}}},{key:"fixComponentSelectIssueOnScroll",value:function(){this.scrollHandler=function(){var e=new Event("scroll");window.dispatchEvent(e)};var e=document.getElementById("campaign-content");e&&e.addEventListener("scroll",this.scrollHandler)}},{key:"updateCampaignContent",value:function(){u.addDnDEditorData()}},{key:"view",value:function(e){e.attrs;return m("div",{class:"es-dnd-editor"},m("div",{id:"ig-es-dnd-builder"}))}}])&&kt(t.prototype,n),a&&kt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),Tt(_=(()=>{function s(){if(!(this instanceof s))throw new TypeError("Cannot call a class as a function")}return e=s,(t=[{key:"oncreate",value:function(e){e=e.attrs.campaignType;y.isPostCampaign(e)&&esVisualEditor.on("component:update:post-format",this.updateCategoryData)}},{key:"onDragStart",value:function(e){s.dragStart(e)}},{key:"onDragStop",value:function(){s.dragStop()}},{key:"updateCategoryData",value:function(e){"blank"===e.get("post-format")&&(x.activeTab="blocksManager",s.activeTab=2,m.redraw())}},{key:"view",value:function(e){var t,a=this,n=(e.attrs,{}),i=St(s.blocks);try{for(i.s();!(t=i.n()).done;){var r=t.value,o=r.getCategoryLabel();void 0===n[o]&&(n[o]=[]),n[o].push(r)}}catch(e){i.e(e)}finally{i.f()}return m("div",{class:"gjs-blocks-cs gjs-one-bg gjs-two-color"},m("div",{class:"gjs-block-categories"},m("nav",null,Object.keys(n).map(function(e,t){return m("div",{class:"links",onclick:function(){s.activeTab=t}},m("a",{class:"cursor-pointer"+(s.activeTab===t?" active":"")},"Post blocks"!==e&&e,"Post blocks"===e&&m("div",{class:"flex space-x-2 text-black"},m("span",null," ",e),m(b,{tooltipText:__("Manage Post related settings","email-subscribers")}))))})),Object.keys(n).map(function(e,t){return m("div",{class:"gjs-blocks-c "+(t===s.activeTab?"active":"hidden")},n[e].map(function(e){var t=null==e||null==(t=e.attributes)||null==(t=t.attributes)?void 0:t.class,n=null==e||null==(n=e.attributes)?void 0:n.disable;return m("div",{class:"gjs-block gjs-one-bg gjs-four-color-h"+(void 0!==t?" "+t:""),ondragstart:function(){return a.onDragStart(e)},ondragend:function(){return a.onDragStop()},draggable:n?"":"draggable"},m("div",{class:"gjs-block-media"},m.trust(e.getMedia())),m("div",{class:"gjs-block-label"},e.getLabel()),m("div",{class:"gjs-block-icon-draggable"},m.trust(g.draggable)))}))})))}}])&&jt(e.prototype,t),n&&jt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n})(),"blocks",[]),Tt(_,"dragStart",void 0),Tt(_,"dragStop",void 0),Tt(_,"activeTab",0),Q=(()=>{function i(){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function")}return e=i,(t=[{key:"view",value:function(e){var e=e.attrs,s="gjs-",l=e.prop,t=l.getId(),c=l.getName(),n=l.getType(),u=l.hasValue()?l.getValue():"",a=l.getDefaultValue(),d=e.selectedComponent;return m("div",{id:t,class:"".concat(s,"sm-property ").concat(s,"sm-").concat(c," ").concat(s,"sm-property__").concat(c," ").concat("composite"===n?"".concat(s,"sm-property--full"):"")},m("div",null,m("div",{class:"".concat(s,"sm-label")},m("span",{class:"".concat(s,"sm-icon")},l.getLabel()),l.canClear()&&m("b",{class:"".concat(s,"sm-clear"),"data-clear-style":!0,onclick:function(e){e.preventDefault(),l.clear()}},"⨯")),m("div",{class:"".concat(s,"fields"),"data-sm-fields":""},m("div",{class:"".concat(s,"field ").concat(s,"field-").concat(n)},("number"===n||"integer"===n||"slider"===n)&&m("input",{type:"number",placeholder:a,value:u,oninput:function(e){return l.upValue(e.target.value,{partial:!0})},onchange:function(e){l.upValue(e.target.value)},step:l.getStep(),min:l.getMin(),max:l.getMax()}),"radio"===n&&m("div",{class:"".concat(s,"radio-items")},l.getOptions().map(function(e){var t=l.getOptionId(e),n=c+"-"+d.getId(),a=n+"-"+t,i=e.className?"".concat(e.className," ").concat(s,"icon ").concat(s,"radio-item-label"):"",r=i?"":l.getOptionLabel(e),e=e.title||"",o=u===t?"checked":"";return m("div",{class:"".concat(s,"radio-item")},m("input",{id:a,type:"radio",class:"".concat(s,"sm-radio ").concat(s,"sm-radio-").concat(c),name:n,value:t,onchange:function(e){l.upValue(e.target.value)},checked:o}),m("label",{class:i||s+"radio-item-label",for:a,title:e},r))})),"select"===n&&m("select",{value:u,onchange:function(e){l.upValue(e.target.value)}},l.getOptions().map(function(e){return m("option",{value:l.getOptionId(e)},l.getOptionLabel(e))})),"color"===n&&m("div",{class:"ig-es-color-picker"},m("input",{type:"text",placeholder:a,value:u,onchange:function(e){l.upValue(e.target.value)}}),m("div",{style:(l.hasValue(),l.getValue()),class:"ig-es-color-picker-input"},m("input",{class:"ig-es-input-color",type:"color",value:l.hasValue()?l.getValue():a,onchange:function(e){l.upValue(e.target.value)},oninput:function(e){l.upValue(e.target.value,{partial:!0})}}))),"file"===n&&m("div",{class:"".concat(s,"field ").concat(s,"file")},m("div",{id:"".concat(s,"input-holder")},m("div",{class:"".concat(s,"btn-c")},m("button",{onclick:function(){var n=esVisualEditor.Assets;n.open({select:function(e,t){l.upValue(e.getSrc(),{partial:!t}),t&&n.close()},types:["image"],accept:"image/*"})}},__("Image","email-subscribers")))),l.getValue()&&l.getValue()!==a&&m("div",{class:"ig-es-btn-prv",style:"background-image: url(".concat(l.getValue(),")")})),"composite"===n&&m("div",{class:"ig-es-type-cmp pa-2"},l.getProperties().map(function(e){return m(i,{prop:e})}))))))}}])&&Ot(e.prototype,t),n&&Ot(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n})(),e=w=(()=>{function i(){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function")}return e=i,(t=[{key:"view",value:function(e){var t,n=e.attrs,a=esVisualEditor.getSelected();return a&&(t=a.get("stylable"))&&Array.isArray(t)?(e=i.sectors,a&&m("div",{class:"p-4 bg-light-gray"},m("div",{class:"prev-sector-cta"},m("a",{href:"#",onclick:function(e){e.preventDefault(),n.setActiveTab("blocksManager")}},m("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m("path",{d:"M8.19151 2.87899L4.73472 6.45346C4.44225 6.75589 4.44225 7.24421 4.73472 7.54664L8.19151 11.1211C8.48671 11.4264 8.96747 11.4264 9.26267 11.1211C9.55515 10.8187 9.55515 10.3304 9.26267 10.0279L6.33448 7.00005L9.26267 3.97217C9.55515 3.66974 9.55515 3.18142 9.26268 2.87899C8.96747 2.57374 8.48671 2.57374 8.19151 2.87899Z",fill:"#575362",stroke:"#575362","stroke-width":"0.3"}))),m("span",null,__("Go to Blocks","email-subscribers"))),e.map(function(e){return m("div",{id:e.getId(),class:"gjs-sm-sector gjs-sm-sector__".concat(e.getName())},m("div",{class:"gjs-sm-title"},e.getName()),m("div",{class:"gjs-sm-properties"},e.getProperties().map(function(e){return t.includes(e.getName())&&m(Q,{selectedComponent:a,prop:e})})))}))):""}}])&&At(e.prototype,t),n&&At(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n})(),a=[],(n=Mt(n="sectors"))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,k=new((()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.isIframeMode=!1,this.parentOrigin=window.location.origin,this.hasNotifiedParent=!1,this.initialize()}return t=e,(n=[{key:"initialize",value:function(){var e=this;this.isIframeMode=window.self!==window.top,"true"===new URLSearchParams(window.location.search).get("iframeMode")&&(this.isIframeMode=!0),this.isIframeMode&&(this.setupMessageListener(),document.addEventListener("es_drag_and_drop_editor_loaded",function(){e.notifyParentLoaded()}),this.waitForEditorContent())}},{key:"waitForEditorContent",value:function(){var a=this,i=setInterval(function(){var e=document.querySelector("#es-email-subscribers"),t=document.querySelector(".ig-es-campaign-design-classic-editor"),n=document.querySelector(".ig-es-campaign-content");(e||t||n)&&(clearInterval(i),setTimeout(function(){a.notifyParentLoaded()},300))},100);setTimeout(function(){clearInterval(i),a.notifyParentLoaded()},5e3)}},{key:"setupMessageListener",value:function(){var t=this;window.addEventListener("message",function(e){"REQUEST_CONTENT"===e.data.type&&t.sendContentToParent()})}},{key:"notifyParentLoaded",value:function(){this.hasNotifiedParent||window.parent&&this.isIframeMode&&(this.hasNotifiedParent=!0,window.parent.postMessage({type:"EDITOR_LOADED"},"*"))}},{key:"sendContentToParent",value:function(){try{if(u.formatCampaignDetail(),!u.details.body||""===u.details.body.trim())throw new Error("No content to save. Please add some content to your email.");this._sendContentData()}catch(e){console.error("[Mithril IframeIntegration] Error in sendContentToParent:",e),window.parent.postMessage({type:"SAVE_ERROR",error:e.message||"Failed to process request"},"*")}}},{key:"_sendContentData",value:function(){var e=u.details.body,t=u.details.meta.editor_type,n=u.details.meta.dnd_editor_data,e={type:"CONTENT_READY",campaign_id:u.details.id,body:e,editor_type:t,custom_css:u.details.meta.es_custom_css,attachments:u.details.meta.attachments||[]};"drag-and-drop"===t&&n&&(e.dnd_editor_data=n),window.parent.postMessage(e,"*")}},{key:"isInIframeMode",value:function(){return this.isIframeMode}}])&&Nt(t.prototype,n),a&&Nt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})()),Rt(x=(()=>{function a(){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function")}return e=a,n=[{key:"updateBlocks",value:function(e,t){e=y.filterCampaignWiseBlocks(e,t),_.blocks=e,m.redraw()}},{key:"setActiveTab",value:function(e){a.activeTab=e,m.redraw()}}],(t=[{key:"oncreate",value:function(e){e=e.attrs;a.campaignType=e.campaignType,a.isIframeMode=k.isInIframeMode(),esVisualEditor.on("style:custom",this.setupStyleManager),esVisualEditor.on("component:remove",this.showBlockManager),esVisualEditor.on("block:custom",this.setupBlockManager),esVisualEditor.on("component:add",this.showStyleManager),esVisualEditor.on("component:selected",this.showStyleManager),esVisualEditor.on("show_es_dnd_block_manager",this.showBlockManager)}},{key:"setupBlockManager",value:function(e){var t=e.blocks,n=e.dragStart,e=e.dragStop;a.updateBlocks(t,a.campaignType),_.dragStart=n,_.dragStop=e}},{key:"setupStyleManager",value:function(e){w.sectors=esVisualEditor.StyleManager.getSectors({visible:!0}),m.redraw()}},{key:"showBlockManager",value:function(){a.setActiveTab("blocksManager")}},{key:"showStyleManager",value:function(){if(a.isIframeMode){var e=esVisualEditor.getSelected(),t=a.campaignType;if(e&&"es-posts"===e.get("type")&&("post_notification"===t||"post_digest"===t))return void a.setActiveTab("blocksManager")}a.setActiveTab("styleManager")}},{key:"view",value:function(){return m("div",{class:"es-dnd-editor"},m("div",{class:"es-sidebar sticky top-0"},m("div",{id:"bs-container"},m("div",{id:"gj-blocks-container"},0<_.blocks.length&&"blocksManager"===a.activeTab&&m(_,{campaignType:a.campaignType})),m("div",{id:"gj-design-container"},m("div",{id:"gj-settings-container",style:"styleManager"!==a.activeTab?"display:none":""}),0{function a(){var e,t,n;if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");e=this,n="es-campaign-body",(t=Ut(t="editorId"))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}return e=a,n=[{key:"addAttachments",value:function(){var e=(null==(e=u.details)||null==(e=e.meta)?void 0:e.attachments)||[],t=zt(e=Array.isArray(e)?e:e?[e]:[]);document.querySelectorAll('input[name="data[meta][attachments][]"]').forEach(function(e){e=e.value;e&&!t.includes(e)&&t.push(e)}),u.details.meta||(u.details.meta={}),u.details.meta.attachments=t}}],(t=[{key:"oncreate",value:function(e){var e=e.attrs,t=e.content,e=e.campaignType||"newsletter";t&&""!==t.trim()||(t="post_notification"===e||"post_digest"===e?"\n\n\n\n\n

Hello {{subscriber.name | fallback='there'}},

\n

We have published a new blog article on our website.
{{campaign.posts}}
{{post.title}}
{{post.image}}

\n

{{post.link}}
{{/campaign.posts}}

\n

Thanks & Regards,
Admin

\n

You received this email because in the past you have provided us your email address : {{subscriber.email}} to receive notifications when new updates are posted.

\n\n":"\n\n\n\n\n

Hello {{subscriber.name | fallback='there'}},

\n

Your content...

\n

Thanks & Regards,
Admin

\n

You received this email because in the past you have provided us your email address : {{subscriber.email}} to receive notifications when new updates are posted.

\n\n"),renderESClassicEditor(this.editorId,t)}},{key:"onremove",value:function(e){var e=e.attrs,t=(void 0!==window.tinyMCE&&window.tinyMCE.triggerSave(),a.addAttachments(),document.getElementById(this.editorId).value);e.onRemove(t),removeESClassicEditor(this.editorId)}},{key:"view",value:function(e){e.attrs;return m("div",{class:"es-classic-editor"},m("textarea",{id:this.editorId,name:"body",class:"wp-campaign-body-editor",rows:"40"}))}}])&&Bt(e.prototype,t),n&&Bt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n})(),K=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.postNotificationDropdownVisible=!1,this.broadcastDropdownVisible=!1,this.postDigestDropdownVisible=!1}return t=e,(n=[{key:"postNotificationToggleDropdown",value:function(){this.postNotificationDropdownVisible=!this.postNotificationDropdownVisible}},{key:"broadcastToggleDropdown",value:function(){this.broadcastDropdownVisible=!this.broadcastDropdownVisible}},{key:"postDigestToggleDropdown",value:function(){this.postDigestDropdownVisible=!this.postDigestDropdownVisible}},{key:"copyTagToClipboard",value:function(t){var n=this;navigator.clipboard?navigator.clipboard.writeText(t).then(function(){}).catch(function(e){console.error("Copy to clipboard failed: "+e),n.copyTagManually(t)}):(console.error("Clipboard API is not supported in this browser."),this.copyTagManually(t))}},{key:"copyTagManually",value:function(e){var t=document.createElement("input");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}},{key:"view",value:function(e){var n=this,e=e.attrs.campaignType,t=!1,a=!1,i=!1,e=("newsletter"===e?t=!0:"post_notification"===e?a=!0:i=!0,y.getSidebarCampaignTags());return 0===e.length?"":m("[",null,m("p",{class:"font-medium text-sm px-8 py-3"},"Tags"),m("div",{class:"accordion ig-es-campaign-tags-list"},a?m("div",{class:"ig-es-campaign-tags"},m("div",null,m("p",{class:"campaign-tags-title"},m("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-3 h-3 inline-flex"},m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})),m("span",{class:"ml-2",onclick:function(e){e.preventDefault(),n.postNotificationToggleDropdown()}}," ",__("Post Notification","email-subscribers"))," ")),m("div",{class:"panel active"},m("div",{class:"all-tags",style:" ".concat(this.postNotificationDropdownVisible?"":"display:none")},m("ul",null,e.postNotificationTags.map(function(t){return m("li",null,m("span",{onclick:function(e){e.preventDefault(),n.copyTagToClipboard(t)}},t,m.trust(g.copy)))}))))):"",t?m("div",{class:"ig-es-campaign-tags"},m("div",null,m("p",{class:"campaign-tags-title"},m("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-3 h-3 inline-flex"},m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})),m("span",{class:"ml-2",onclick:function(e){e.preventDefault(),n.broadcastToggleDropdown()}}," ",__("Broadcast","email-subscribers")))),m("div",{class:"panel active"},m("div",{class:"all-tags",style:" ".concat(this.broadcastDropdownVisible?"":"display:none")},m("ul",null,e.subscriberTags.map(function(t){return m("li",null,m("span",{onclick:function(e){e.preventDefault(),n.copyTagToClipboard(t)}},t,m.trust(g.copy)))}),e.siteTags.map(function(t){return m("li",null,m("span",{onclick:function(e){e.preventDefault(),n.copyTagToClipboard(t)}},t,m.trust(g.copy)))}))))):"",i?m("div",{class:"ig-es-campaign-tags"},m("div",null,m("p",{class:"campaign-tags-title"},m("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-3 h-3 inline-flex"},m("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})),m("span",{class:"ml-2",onclick:function(e){e.preventDefault(),n.postDigestToggleDropdown()}},__("Post Digest","email-subscribers")))),m("div",{class:"panel active"},m("div",{class:"all-tags",style:" ".concat(this.postDigestDropdownVisible?"":"display:none")},m("ul",null,e.subscriberTags.map(function(t){return m("li",null,m("span",{onclick:function(e){e.preventDefault(),n.copyTagToClipboard({tag:t})}},t,m.trust(g.copy)))}),e.siteTags.map(function(t){return m("li",null,m("span",{onclick:function(e){e.preventDefault(),n.copyTagToClipboard({tag:t})}},t,m.trust(g.copy)))}))))):""))}}])&&Zt(t.prototype,n),a&&Zt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),S={oncreate:function(e){var e=e.attrs,n=e.id,a=e.changeHandler;jQuery("#"+n).select2({placeholder:"Select",closeOnSelect:!1}),jQuery("#"+n).on("change",function(e){var t=jQuery("#"+n).val();a(t)})},view:function(e){var e=e.attrs,t=e.id,n=e.options,a=e.selectedOptions||[];return m("select",{id:t,multiple:e.multiple?"multiple":""},m("option",{value:""},"Select"),n.map(function(e){return m("option",{value:e.value,selected:-1{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"oninit",value:function(){this.setDefaultPostSettings()}},{key:"setDefaultPostSettings",value:function(){void 0===u.details.meta.rules&&(u.details.meta.rules={}),void 0===u.details.meta.rules.no_of_posts&&(u.details.meta.rules.no_of_posts=[1]),void 0===u.details.meta.rules.sorting_orders&&(u.details.meta.rules.sorting_orders=["descending"])}},{key:"setPostsCount",value:function(e){u.details.meta.rules.no_of_posts=[e],u.details.type=1{function a(){var e,t,n;if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");e=this,n="post_setting",(t=Qt(t="activeTab"))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}return e=a,(t=[{key:"setActiveTab",value:function(e){this.activeTab=e}},{key:"view",value:function(){var e=this,t="tags_tab",n="post_setting",a=u.details,i=a.type===ig_es_main_js_data.post_notification_campaign_type||a.type===ig_es_main_js_data.post_digest_campaign_type,r="true"===new URLSearchParams(window.location.search).get("iframeMode")||window.self!==window.top,i=i&&!r;return m("[",null,i&&m("div",null,m("nav",null,m("div",{class:"links w-full text-center"},m("a",{onclick:function(){return e.setActiveTab(t)},class:"cursor-pointer ig-es-campaign-sidebar-nav-menu ig-es-campaign-tags-nav w-1/2 ".concat(this.activeTab===t?"active":"")},"Tags"),m("a",{onclick:function(){return e.setActiveTab(n)},class:"cursor-pointer ig-es-campaign-sidebar-nav-menu ig-es-post-settings-nav w-1/2 ".concat(this.activeTab===n?"active":"")},"Post Settings")))),m("div",{class:"nav-child-sections"},m("div",{id:"ig-es-campaign-tags-section",class:"nav-child ".concat(this.activeTab!==t&&i?"hidden":"active")},m(K,{campaignType:a.type})),i&&m("div",{id:"ig-es-post-settings-section",class:"nav-child ".concat(this.activeTab===n?"active":"hidden")},m(ee,null))))}}])&&Jt(e.prototype,t),n&&Jt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n})(),ne=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"view",value:function(e){var t=e.attrs,e=void 0!==t.customCSS?t.customCSS:'';return m("div",{class:"es-classic-css"},m("label",null,__("Custom CSS","email-subscribers")),m("textarea",{id:"es-campaign-css",name:"css",class:"w-full",rows:"5",onchange:function(e){return t.onChangeHandler(e.target.value)}},e))}}])&&Kt(t.prototype,n),a&&Kt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),C=(()=>{function a(e){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");a.initialize()}return e=a,n=[{key:"initialize",value:function(){a.setCurrentTemplate(a.currentCampaignID)}},{key:"setCurrentTemplate",value:function(t){var e=1{function a(){var e,t,n;if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");e=this,n=!(t="showTemplateActionDropdown"),(t=rn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}return e=a,(t=[{key:"oncreate",value:function(e){e=e.attrs;this.switchTab=e.switchTab}},{key:"toggleActionsDropdown",value:function(){this.showTemplateActionDropdown=!this.showTemplateActionDropdown}},{key:"saveAsDraft",value:function(){u.details.status=0,u.saveCamapign(),this.toggleActionsDropdown()}},{key:"saveAndContinue",value:function(){this.toggleActionsDropdown(),this.switchTab("publish")}},{key:"saveAsTemplate",value:function(){this.formatCampaignDetail(),C.saveTemplate(),this.toggleActionsDropdown()}},{key:"formatCampaignDetail",value:function(){this.model=new C;var e=C.details,t=u.details;e.subject=t.subject,e.meta.es_template_type=t.type,e.meta.es_custom_css=t.meta.es_custom_css,e.meta.es_editor_type=u.usingDndEditor()?ig_es_main_js_data.dnd_editor_slug:ig_es_main_js_data.classic_editor_slug}},{key:"view",value:function(e){var t=this;e.attrs;return m("div",{class:"relative inline-block text-left w-auto dropdown"},m("div",{class:"w-24"},m("button",{type:"button",id:"menu-button",class:"primary text-white text-center inline-flex items-center menu-button","aria-expanded":"false","aria-haspopup":"true",onclick:function(){return t.toggleActionsDropdown()}},m("span",null," ",__("Save","email-subscribers")),m("svg",{class:"w-2.5 h-2.5 ml-2.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 10 6"},m("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m1 1 4 4 4-4"})))),m("div",{class:"".concat("absolute font-normal text-left dropdown-menu scale-95 z-50 w-40"," ").concat(this.showTemplateActionDropdown?"":"hidden opacity-0"),role:"menu","aria-orientation":"vertical","aria-labelledby":"menu-button",tabindex:"-1",id:"dropdown-menu"},m("div",null,m("a",{href:"#",onclick:function(e){e.preventDefault(),t.saveAndContinue()}}," ",__("Save & Continue","email-subscribers"))),m("div",null,m("a",{href:"#",onclick:function(e){e.preventDefault(),t.saveAsDraft()}},__("Save As Draft","email-subscribers"))),m("div",null,m("a",{href:"#",onclick:function(e){e.preventDefault(),t.saveAsTemplate()}},__("Save As Template","email-subscribers")))))}}])&&an(e.prototype,t),n&&an(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n})(),ie=j={showAllTags:"no",toggleTags:function(){j.showAllTags="yes"===j.showAllTags?"no":"yes"},view:function(e){e=e.attrs.campaignType,e=y.getCampaignWiseTags(e);return 0===e.length?"":m("div",{class:"all-tags"},m("div",{class:"flex flex-col gap-3"},m("ul",{class:"primary-list flex flex-wrap gap-3"},0{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.isIframeMode=k.isInIframeMode(),this.dropdownVisible=!1}return t=e,(n=[{key:"switchEditor",value:function(){var e=u.usingDndEditor();u.details.meta.editor_type=e?ig_es_campaign_editor_data.classicEditor:ig_es_campaign_editor_data.dndEditor,e&&(e=esVisualEditor.exportEditorContent(),u.details.body=e.html)}},{key:"updateContent",value:function(e){u.details.body=e}},{key:"updateCustomCSS",value:function(e){void 0===u.details.meta&&(u.details.meta={}),u.details.meta.es_custom_css=e}},{key:"toggleDropdown",value:function(){this.dropdownVisible=!this.dropdownVisible}},{key:"onremove",value:function(e){var t=u.details.type,n=u.details.meta.editor_type;y.isPostCampaign(t)&&y.isDnDEditor(n)&&(t=esVisualEditor.Canvas.getDocument().getElementsByClassName("es-posts").length,e.attrs.onRemove(t))}},{key:"view",value:function(e){var n,t,a=this,i=(e.attrs,u.details);if(0!==i.id||""!==i.body)return e=i.type,i.meta.editor_type,t=(n=u.usingDndEditor())?i.meta.dnd_editor_data||"":i.body,m("div",{class:"flex justify-between w-full ".concat(this.isIframeMode?"pt-4":"")},m("div",{id:"campaign-content",class:"template-editor h-screen"},!this.isIframeMode&&m("[",null,m("div",{class:"flex flex-col gap-4 px-5 pt-5"},m("div",null,m("div",{class:"flex space-x-2"},m("label",{for:"Subject"},__("Subject","email-subscribers")," "),m(b,{tooltipText:__("The email subject line is the first single-line text recipients see","email-subscribers")})),m("div",{class:"mt-2"},m("input",{type:"text",name:"subject",id:"subject",placeholder:"Subject line goes here {{post.title}}",value:u.details.subject||"",onchange:function(e){u.details.subject=e.target.value}}))),m(ie,{campaignType:e})),m("div",{class:"px-5"},m("div",null,m("div",{class:"flex space-x-2"},m("label",{for:"Preheader"},__("Preheader","email-subscribers")),m(b,{tooltipText:__("The summary text that follows a subject line when the email is viewed in an inbox","email-subscribers")})),m("div",{class:"mt-2"},m("input",{type:"text",name:"Preheader",id:"Preheader",placeholder:"Enter Preheader",value:u.details.meta.preheader||"",onchange:function(e){return u.details.meta.preheader=e.target.value}}))))),m("div",{class:"template-preview w-full px-5"},n?m(J,{campaignType:e,content:t}):"",n?"":m(X,{campaignType:e,content:t,onRemove:this.updateContent}),((e,t)=>(e=(null==(e=ig_es_main_js_data)?void 0:e.es_plan)||"lite",!n&&("pro"===e||"starter"===e||"trial"===e)?m(ne,{customCSS:null==(t=i.meta)?void 0:t.es_custom_css,onChangeHandler:a.updateCustomCSS}):""))())),m("div",{class:"sidebar"},m("div",{class:"switch"},m("p",null,__("Switch To","email-subscribers")," ",n?__("Classic Editor","email-subscribers"):__("Drag & Drop Editor","email-subscribers")," "),m("a",{class:"cursor-pointer",onclick:this.switchEditor},__("Switch","email-subscribers"))),m("div",{class:"w-full"},n?m(x,{campaignType:e}):"",n?"":m(te,{campaignType:e}))))}}])&&sn(t.prototype,n),a&&sn(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),T=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,a=[{key:"getUtmTrackingUrl",value:function(){var e=0\n
\n
\n
\n \n \n \n
\n \n
\n
\n

\n ').concat(e.upsellMessage||"",'\n

\n \n

\n Upgrade now & get 10% discount!

\n Use coupon code:\n PREMIUM10\n

\n ');return e.ctaHtml&&(t+='\n \n ')),t+="\n
\n
\n \n ",m.trust(t)}}])&&cn(t.prototype,n),a&&cn(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),oe=(()=>{function n(){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function")}return e=n,a=[{key:"getOptimizationOption",value:function(){var e=ig_es_main_js_data.optimization_option;return"subscriber_timezone"===e?"Email will send in 'Subscriber timezone' as per your settings set ":"subscriber_average_open_time"===e?" Emails will be sent at the average open time of subscribers as per your settings set ":"You can optimize email delivery time option available for you "}}],(t=[{key:"view",value:function(e){e.attrs;var e=T.canUpsellFeatures(["lite","starter","trial"]),t=n.getOptimizationOption();return e?null:m("div",null,m("p",{class:"field-desciption mb-2 text-xs italic font-normal leading-snug text-gray-500 helper "},t," ",m("a",{class:"underline text-blue-600",href:"?page=es_settings",target:"_blank"},"here")," "))}}])&&mn(e.prototype,t),a&&mn(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,a})(),se=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"oninit",value:function(){void 0===u.details.meta.scheduling_option?(u.details.scheduling_option="schedule_now",u.details.meta.scheduling_option="schedule_now"):u.details.scheduling_option=u.details.meta.scheduling_option}},{key:"handleScheduleOptionChange",value:function(e){u.details.scheduling_option=e,u.details.meta.scheduling_option=e}},{key:"view",value:function(){var e=this;return h()("div",{class:"flex flex-col gap-4"},h()("div",{class:"flex space-x-2"},h()("h2",null,__("Send Options","email-subscribers")),h()(b,{tooltipText:__("When to send this email","email-subscribers")})),h()("div",{class:"flex flex-row space-x-4 justify-between rounded-sm"},h()("div",{class:"flex flex-row space-x-3 justify-start bg-white p-4 rounded-sm w-full"},h()("div",null,h()("label",{class:"relative inline-flex items-center cursor-pointer"},h()("input",{type:"radio",value:"schedule_now",id:"schedule_now",name:"schedule_option",class:"w-6 h-6 text-purple-600 bg-gray-100 border-gray-300 focus:ring-purple-500 dark:focus:ring-purple-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600",style:"width:25px;height:25px;",checked:"schedule_now"===u.details.scheduling_option,onchange:function(){return e.handleScheduleOptionChange("schedule_now")}}))),h()("div",null,h()("span",{class:"text-sm"},__("Send Now","email-subscribers")))),h()("div",{class:"flex flex-row space-x-3 justify-start bg-white p-4 rounded-sm w-full"},h()("div",null,h()("label",{class:"relative inline-flex items-center cursor-pointer"},h()("input",{type:"radio",value:"schedule_later",id:"schedule_later",name:"schedule_option",class:"w-6 h-6 text-purple-600 bg-gray-100 border-gray-300 focus:ring-purple-500 dark:focus:ring-purple-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600",style:"width:25px;height:25px;",checked:"schedule_later"===u.details.scheduling_option,onchange:function(){return e.handleScheduleOptionChange("schedule_later")}}))),h()("div",null,h()("span",{class:"text-sm"},__("Schedule For Later","email-subscribers"))))),"schedule_later"===u.details.scheduling_option&&h()("div",{class:"flex",style:"padding-left: 26.6rem;"},h()("span",{class:"pr-4"},h()("input",{type:"date",value:u.details.meta.es_schedule_date,name:"",id:"",class:"w-48 h-10",oninput:function(e){u.details.es_schedule_date=e.target.value,u.details.meta.es_schedule_date=e.target.value}})),h()("span",null,h()("input",{type:"time",value:u.details.meta.es_schedule_time,name:"",id:"",class:"w-48 h-10",oninput:function(e){u.details.es_schedule_time=e.target.value,u.details.meta.es_schedule_time=e.target.value}}))),"schedule_later"===u.details.scheduling_option&&h()(oe,null))}}])&&pn(t.prototype,n),a&&pn(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),le=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"view",value:function(){return m("div",{class:"flex flex-col gap-4"},m("div",null,m("h2",null,__("Archive Settings","email-subscribers"))),m("div",{class:"flex flex-row space-x-4 justify-between rounded-sm"},m("div",{class:"flex flex-row space-x-3 justify-start bg-white p-4 rounded-sm w-full"},m("div",null,m("label",{class:"relative inline-flex items-center cursor-pointer"},m("input",{type:"checkbox",value:"",class:"sr-only peer",onchange:function(e){u.details.meta.enable_archive=e.target.checked?"yes":"no"}}),m("div",{class:"w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-primary"}))),m("div",null,m("span",{class:"text-sm"},__("Show In Archive","email-subscribers"))))),m("div",{class:"h-px border border-lighter-gray"}))}}])&&gn(t.prototype,n),a&&gn(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),ce=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"toggleOpenTracking",value:function(){"yes"===u.details.meta.enable_open_tracking?u.details.meta.enable_open_tracking="no":u.details.meta.enable_open_tracking="yes"}},{key:"toggleLinkTracking",value:function(){"yes"===u.details.meta.enable_link_tracking?u.details.meta.enable_link_tracking="no":u.details.meta.enable_link_tracking="yes"}},{key:"toggleUTMTracking",value:function(){"yes"===u.details.meta.enable_utm_tracking?u.details.meta.enable_utm_tracking="no":u.details.meta.enable_utm_tracking="yes"}},{key:"view",value:function(e){var t=this,e=(e.attrs,"yes"===u.details.meta.enable_utm_tracking);return u.details.meta.enable_open_tracking&&""!==u.details.meta.enable_open_tracking||(u.details.meta.enable_open_tracking=ig_es_main_js_data.tracking_details.is_track_email_opens),m("div",{class:"flex flex-col gap-4"},m("div",{class:"flex space-x-2"},m("h2",null,"Tracking"),m(b,{tooltipText:__("Monitoring how recipients interact with emails","email-subscribers")})),m("div",{class:"flex flex-row space-x-4 justify-between rounded-sm"},m("div",{class:"flex flex-row space-x-3 justify-start bg-white p-4 rounded-sm w-full"},m("div",null,m("label",{class:"relative inline-flex items-center cursor-pointer"},m("input",{type:"checkbox",value:u.details.meta.enable_open_tracking||"",id:"enable_open_tracking",class:"sr-only peer",onchange:function(e){e.preventDefault(),t.toggleOpenTracking()},checked:"yes"===u.details.meta.enable_open_tracking}),m("div",{class:"w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-primary"}))),m("div",null,m("span",{class:"text-sm"},"Open Tracking"))),y.isPro()?m("div",{class:"flex flex-row space-x-3 justify-start bg-white p-4 rounded-sm w-full"},m("div",null,m("label",{class:"relative inline-flex items-center cursor-pointer"},m("input",{type:"checkbox",value:u.details.meta.enable_link_tracking||"",id:"enable_link_tracking",class:"sr-only peer",onchange:function(e){e.preventDefault(),t.toggleLinkTracking()},checked:"yes"===u.details.meta.enable_link_tracking}),m("div",{class:"w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-primary"}))),m("div",null,m("span",{class:"text-sm"},"Link Tracking"))):"",y.isPro()||y.isTrial()?m("div",{class:"flex flex-row space-x-3 justify-start bg-white p-4 rounded-sm w-full"},m("div",null,m("label",{class:"relative inline-flex items-center cursor-pointer"},m("input",{type:"checkbox",value:u.details.meta.enable_utm_tracking||"",id:"enable_utm_tracking",class:"sr-only peer",onchange:function(e){e.preventDefault(),t.toggleUTMTracking()},checked:"yes"===u.details.meta.enable_utm_tracking}),m("div",{class:"w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-primary"}))),m("div",null,m("span",{class:"text-sm"},"UTM Tracking"))):"",(y.isPro()||y.isTrial())&&e?m("div",{class:"flex flex-row space-x-3 justify-start bg-white p-4 rounded-sm w-full",id:"es_utm_campaign_container"},m("div",null),m("div",null),m("div",{id:"campaignInput"},m("input",{name:"es_utm_campaign",placeholder:"Campaign Name",id:"es_utm_campaign",class:"form-input border-gray-400 text-sm relative rounded-md shadow-sm block w-2/4 sm:leading-5",oninput:function(e){u.details.meta.es_utm_campaign=e.target.value},value:u.details.meta.es_utm_campaign||""}))):""))}}])&&bn(t.prototype,n),a&&bn(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),P=ue={options:{0:"12:00 am",3600:"1:00 am",7200:"2:00 am",10800:"3:00 am",14400:"4:00 am",18e3:"5:00 am",21600:"6:00 am",25200:"7:00 am",28800:"8:00 am",32400:"9:00 am",36e3:"10:00 am",39600:"11:00 am",43200:"12:00 pm",46800:"1:00 pm",50400:"2:00 pm",54e3:"3:00 pm",57600:"4:00 pm",61200:"5:00 pm",64800:"6:00 pm",68400:"7:00 pm",72e3:"8:00 pm",75600:"9:00 pm",79200:"10:00 pm",82800:"11:00 pm"},view:function(e){var t=e.attrs,n=ue.options,a=t.value;return m("select",{onchange:function(e){return t.changeHandler(e.target.value)},class:"w-28"},Object.keys(n).map(function(e){return m("option",{value:e,selected:e===a?"selected":""},n[e])}))}},me=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");_n(this,"timeFrameOptions",{daily:__("Every Day","email-subscribers"),weekly:__("Every Week On","email-subscribers"),monthly:__("Every Month On","email-subscribers")}),_n(this,"weekDays",[__("Sunday","email-subscribers"),__("Monday","email-subscribers"),__("Tuesday","email-subscribers"),__("Wednesday","email-subscribers"),__("Thursday","email-subscribers"),__("Friday","email-subscribers"),__("Saturday","email-subscribers")]),_n(this,"monthDays",{1:"1st",2:"2nd",3:"3rd",4:"4th",5:"5th",6:"6th",7:"7th",8:"8th",9:"9th",10:"10th",11:"11th",12:"12th",13:"13th",14:"14th",15:"15th",16:"16th",17:"17th",18:"18th",19:"19th",20:"20th",21:"21th",22:"22th",23:"23th",24:"24th",25:"25th",26:"26th",27:"27th",28:"28th",30:"30th"})}return t=e,(n=[{key:"oninit",value:function(){this.setDefaultValues()}},{key:"setDefaultValues",value:function(){void 0===u.details.meta.rules&&(u.details.meta.rules={}),void 0===u.details.meta.rules.time_frame&&(u.details.meta.rules.time_frame="immediately"),void 0===u.details.meta.rules.week_day&&(u.details.meta.rules.week_day=0),void 0===u.details.meta.rules.month_day&&(u.details.meta.rules.month_day=1)}},{key:"setTimeFrame",value:function(e){u.details.meta.rules.time_frame=e,u.details.type="immediately"===e?ig_es_main_js_data.post_notification_campaign_type:ig_es_main_js_data.post_digest_campaign_type,this.resetNextRunDate()}},{key:"setWeekDay",value:function(e){u.details.meta.rules.week_day=e,this.resetNextRunDate()}},{key:"setTime",value:function(e){u.details.meta.rules.time_of_day=e,this.resetNextRunDate()}},{key:"setMonthDay",value:function(e){u.details.meta.rules.month_day=e,this.resetNextRunDate()}},{key:"resetNextRunDate",value:function(){u.details.meta.next_run="",u.details.meta.scheduled=0}},{key:"toggleSendNowMatchingPost",value:function(){"yes"===u.details.meta.send_posts_now?u.details.meta.send_posts_now="no":u.details.meta.send_posts_now="yes"}},{key:"view",value:function(){var t=this,e=null==(e=u.details)||null==(e=e.meta)||null==(e=e.rules)?void 0:e.time_frame,n=null==(n=u.details)||null==(n=n.meta)||null==(n=n.rules)?void 0:n.week_day,a=null==(a=u.details)||null==(a=a.meta)||null==(a=a.rules)?void 0:a.time_of_day,i=null==(i=u.details)||null==(i=i.meta)||null==(i=i.rules)?void 0:i.month_day;return u.details.type===ig_es_main_js_data.post_digest_campaign_type&&delete this.timeFrameOptions.immediately,m("[",null,m("div",{class:"flex flex-col gap-4"},m("div",{class:"flex space-x-2"},m("h2",null," ",__("When To Send","email-subscribers")),m(b,{tooltipText:__("When to send this email","email-subscribers")})),m("div",{class:"flex flex-col space-y-4 justify-start rounded-sm"},m("div",{class:"flex space-x-4 items-center"},m("div",{class:"w-36"},m("div",{class:"w-full"},m("select",{class:"w-full text-sm",onchange:function(e){return t.setTimeFrame(e.target.value)},value:e},m("option",{value:"immediately",class:"bg-white"},"Immediately"),Object.keys(this.timeFrameOptions).map(function(e){return m("option",{value:e,class:"bg-white"},t.timeFrameOptions[e])})))),"immediately"===e&&m("div",{class:"items-center"},m("p",null,__("After post is published","email-subscribers"))),"daily"===e&&m("[",null,m("div",{class:"items-center"},m("p",null,__("At","email-subscribers"))),m("div",null,m(P,{changeHandler:this.setTime.bind(this),value:a}))),"weekly"===e&&m("[",null,m("div",{class:""},m("div",{class:"w-full"},m("select",{class:"w-32 text-sm",onchange:function(e){return t.setWeekDay(e.target.value)},value:n},this.weekDays.map(function(e,t){return m("option",{value:t,class:"bg-white"},e)})))),m("div",{class:"items-center"},m("p",null,"At")),m("div",null,m(P,{changeHandler:this.setTime.bind(this),value:a}))),"monthly"===e&&m("[",null,m("div",{class:""},m("div",{class:"w-full"},m("select",{class:"w-20 text-sm",value:i,onchange:function(e){return t.setMonthDay(e.target.value)}},Object.keys(this.monthDays).map(function(e){return m("option",{value:e,class:"bg-white"},t.monthDays[e])})))),m("div",{class:"items-center"},m("p",null,"At")),m("div",null,m(P,{changeHandler:this.setTime.bind(this),value:a}))))),("monthly"===e||"daily"===e||"weekly"===e)&&m("div",{className:"flex flex-col space-y-4 justify-start rounded-sm"},m("div",{className:"flex space-x-4 items-center"},m("div",{className:"w-full"},m(oe,null)))),m("div",{class:"flex flex-col space-y-4 justify-start rounded-sm"},m("div",{class:"flex space-x-4 items-center"},m("div",{class:""},m("div",{class:"w-full"},m("label",{class:"relative items-center cursor-pointer"},m("input",{type:"checkbox",value:u.details.meta.send_posts_now||"",id:"send_posts_now",class:"sr-only peer",onchange:function(e){e.preventDefault(),t.toggleSendNowMatchingPost()},checked:"yes"===u.details.meta.send_posts_now}),m("div",{class:"w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-primary"})))),m("div",{class:"items-center"},m("p",null,__("Include latest post in campaign and send now","email-subscribers")))))),m("div",{class:"h-px border border-lighter-gray"}))}}])&&hn(t.prototype,n),a&&hn(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),de=(()=>{function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.ruleRow=e.attrs.ruleRow,this.field=e.attrs.ruleRow.field,this.index=e.attrs.index,this.groupIndex=e.attrs.groupIndex,this.group=e.attrs.group,this.operator=e.attrs.ruleRow.operator,this.value=e.attrs.ruleRow.value,this.callbackToParent=e.attrs.callbackToParent,this.operators=u.allRules[this.field].operators,this.valueFieldType=u.allRules[this.field].value_field_type,this.isOnlyOne=e.attrs.isOnlyOne,this.isOnlyOneGroup=e.attrs.isOnlyOneGroup,this.select_id=Math.random().toString(36).substring(7)}return e=t,(n=[{key:"oncreate",value:function(e){"select"!==this.valueFieldType&&this.valueFieldType,this.intializeSelectwoo()}},{key:"onupdate",value:function(e){this.index=e.attrs.index,this.intializeSelectwoo()}},{key:"getDetails",value:function(){return{field:this.field,operator:this.operator,value:this.value}}},{key:"refreshValues",value:function(e){this.value="",this.field=e,this.operators=u.allRules[this.field].operators,this.valueFieldType=u.allRules[this.field].value_field_type,this.renderValues()}},{key:"getRowID",value:function(){return"rule-row-"+this.groupIndex+"-"+this.index}},{key:"intializeSelectwoo",value:function(){var t=this;jQuery("#"+this.getRowID()+" select.rule-value-field").data("select2")&&jQuery("#"+this.getRowID()+" select.rule-value-field").select2("destroy"),jQuery("#"+this.getRowID()+" .select2-container").remove(),jQuery("#"+this.getRowID()+" select.rule-value-field").select2(),jQuery(document).off("change","#"+this.getRowID()+" .rule-value-field"),jQuery(document).on("change","#"+this.getRowID()+" .rule-value-field",function(e){t.value=jQuery(e.target).val(),t.informParent()})}},{key:"renderFieldSelect",value:function(e){var t=this,a=ig_es_main_js_data.recipient_rules,i=this.field||"";return m("select",{class:"py-1 pl-3 pr-8 text-sm font-medium leading-5 text-gray-700 bg-transparent form-select",onchange:function(e){t.refreshValues(e.target.value)}},Object.keys(a).map(function(n,e){return m("optgroup",{label:n},Object.keys(a[n]).map(function(e,t){return m("option",{value:e,selected:i===e?"selected":""},a[n][e].title)}))}))}},{key:"renderOperatorSelect",value:function(e){var t,n=this;return this.operators&&0!==this.operators.length?(t=this.operator||"",m("select",{class:"py-1 pl-3 pr-8 text-sm leading-5 text-gray-500 bg-transparent form-select",style:"width:220px",onchange:function(e){n.listenOpChange(e)}},this.operators.map(function(e){return m("option",{value:e.op,selected:t===e.op?"selected":""},e.label)}))):(this.operator="is","")}},{key:"listenOpChange",value:function(e){this.operator=e.target.value,this.informParent()}},{key:"informParent",value:function(){this.callbackToParent(this.getDetails(),"update",this.index)}},{key:"deleteRule",value:function(){this.callbackToParent(null,"delete",this.index)}},{key:"renderValues",value:function(e){var t=this,n=u.allRules[this.field].allowed_values||{},a=u.allRules[this.field].value_field_type;return m("div",{class:"flex-1 relative"},("text"===a||"date"===a)&&m("input",{type:a,class:"rule-value-field w-full max-w-fullpy-1 text-sm leading-5 text-gray-700 form-input",value:this.value}),"number"===a&&m("input",{type:"number",min:u.allRules[this.field].min_value,max:u.allRules[this.field].max_value,class:"rule-value-field w-full max-w-fullpy-1 text-sm leading-5 text-gray-700 form-input",value:this.value}),"select"===a&&m("select",{class:"rule-value-field max-w-full py-1 pl-3 pr-8 text-sm leading-5 text-gray-500 bg-transparent form-select w-full block",value:this.value},Object.keys(n).map(function(e){return m("option",{value:e},n[e])})),"multi-select"===a&&m("select",{class:"rule-value-field max-w-full py-1 pl-3 pr-8 text-sm leading-5 text-gray-500 bg-transparent form-select w-full block",multiple:!0},Object.keys(n).map(function(e){return m("option",{value:e,selected:t.value.includes(e)?"selected":""},n[e])})))}},{key:"addConditionRow",value:function(e){var t=this;return m("[",null,m("div",{id:this.getRowID(),class:"flex space-x-4"},m("div",{class:"w-full"},this.renderFieldSelect(e)),this.renderOperatorSelect(e),m("div",{class:"w-full"},m("div",{class:"dropdown"},m("div",null,this.renderValues(e)))),m("div",{class:"cta"},m("button",{href:"#",onclick:function(){t.deleteRule()},class:(this.isOnlyOne&&this.isOnlyOneGroup?"invisible":"")+" cross"},m.trust(g.close)))))}},{key:"view",value:function(e){return this.isOnlyOne=e.attrs.isOnlyOne,m("[",null,this.addConditionRow(this.ruleRow))}}])&&xn(e.prototype,n),a&&xn(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,a})(),pe=(()=>{function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.callbackToParent=e.attrs.callbackToParent,this.index=e.attrs.index,this.rules=e.attrs.ruleGroup,this.isOnlyOne=e.attrs.isOnlyOne}return e=t,(n=[{key:"updateData",value:function(e,t,n){"update"==t?this.rules[n]=e:"delete"==t&&this.rules.splice(n,1),this.informParent()}},{key:"onupdate",value:function(e){this.index=e.attrs.index}},{key:"addNewRule",value:function(){var e=JSON.parse(JSON.stringify(u.ruleRow));this.rules.push(e),this.informParent()}},{key:"getDetails",value:function(){return this.rules}},{key:"informParent",value:function(){this.callbackToParent(this.getDetails(),"update",this.index)}},{key:"addNewRuleGroup",value:function(){this.callbackToParent(null,"add",null)}},{key:"deleteRuleGroup",value:function(){this.callbackToParent(null,"delete",this.index)}},{key:"view",value:function(e){var n=this;return m("div",{class:"flex flex-col space-y-4 justify-start bg-white p-4 rounded-sm"},this.rules.map(function(e,t){return"_lists__in"===e.field?e.field="list":"_lists__not_in"===e.field&&(e.field="list",e.operator="is_not"),m("[",null,0{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"view",value:function(e){return m("div",{class:"hidden",id:"spam_score_modal"},m("div",{class:"fixed z-50 top-0 left-0 w-full h-full flex items-center justify-center",style:"background-color: rgba(0,0,0,.5);"},m("div",{class:"text-left bg-white h-auto p-2 md:max-w-xl md:p-2 lg:p-6 shadow-xl rounded mx-2 md:mx-0"},m("h3",{class:"text-2xl uppercase text-center text-gray-800"},"Spam score"),m("h3",{class:"es-spam-score text-4xl font-bold pb-1 text-center mt-8"}),m("div",{class:"es-logs es-spam-success",style:"display:none;"},"Awesome score. Your email is almost perfect."),m("div",{class:"es-logs es-spam-error text-base font-normal text-gray-500 pb-2 text-center pt-4 list-none",style:"display:none;"},"Ouch! your email needs improvement."),m("div",{class:"es-spam-error-log",style:"display:none;"},m("div",{class:"text-base font-normal text-gray-500 pb-2 list-none text-center"},"Here are some things to fix:"),m("ul",null)),m("div",{class:"flex justify-center mt-8"},m("button",{id:"close_score",class:"secondary",onclick:function(e){e.preventDefault(),u.closeSpamScoreModal()}},"Close")))))}}])&&Tn(t.prototype,n),a&&Tn(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),ge=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"oncreate",value:function(){u.saveAndPreview(function(e){e.success?e.data.preview_html&&(u.details.id=e.data.id,u.previewHTML=e.data.preview_html,ig_es_load_iframe_preview(".campaign-preview",u.previewHTML)):alert(__("An error occured while processing the request","email-subscribers"))})}},{key:"view",value:function(){return m("div",{class:"campaign-preview w-full ",style:"height: 140vh;"})}}])&&En(t.prototype,n),a&&En(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),ye=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"view",value:function(e){e.attrs;var e=T.canUpsellFeatures(["lite","starter","trial"]),t=T.getUtmTrackingUrl({utmMedium:"campaign_summary"});return e?m("div",{class:"flex flex-row space-x-3 justify-start bg-white p-4 rounded-sm w-full"},m("div",{class:"block"},m(T,{upsellInfo:{upgradeTitle:"Reduce the possibility to land in spam with MAX",pricingUrl:t,upsellMessage:"Build your brand, track your links with the help of Link tracking, UTM tracking and schedule your next campaign accordingly. Also prevent your emails from landing into spam by checking its spam score",ctaHtml:!1}}))):null}}])&&Dn(t.prototype,n),a&&Dn(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),be=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"view",value:function(e){e.attrs;var e=T.canUpsellFeatures(["lite","starter","trial"]),t=T.getUtmTrackingUrl({utmMedium:"campaign_rules",url:"https://www.icegram.com/documentation/how-to-send-broadcast-post-notification-post-digest-to-multiple-lists-in-one-campaign/"});return e?m("div",{class:"block"},m(T,{upsellInfo:{upgradeTitle:"Send campaign to specific audience with MAX",pricingUrl:t,upsellMessage:"Now, you can select multiple lists and also filter your subscribers based on their country, emails and whether they have received, opened or clicked a specific campaign or not and then send campaign emails to them.",ctaHtml:!1}})):null}}])&&Mn(t.prototype,n),a&&Mn(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),ve=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function")}return t=e,(n=[{key:"view",value:function(e){e.attrs;var e=T.canUpsellFeatures(["lite","starter","trial"]),t=T.getUtmTrackingUrl({utmMedium:"optimize_delivery_time",url:"https://www.icegram.com/docs/category/icegram-express/"});return e?m("div",{class:"flex flex-row space-x-3 justify-start bg-white p-4 rounded-sm w-full"},m("div",{class:"block"},m(T,{upsellInfo:{upgradeTitle:"Optimize the email delivery with MAX",pricingUrl:t,upsellMessage:"Optimize email delivery time based on 'Subscriber timezone' or 'Average open time'. This feature is exclusively available in Icegram Max. Please upgrade to Icegram Max to access this feature.",ctaHtml:!1}}))):null}}])&&Nn(t.prototype,n),a&&Nn(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,a})(),he=(()=>{function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.initialize()}return t=e,(n=[{key:"initialize",value:function(){var e,t=u.details;null!=t&&null!=(e=t.meta)&&e.list_conditions&&0{function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");t.show=!1}return e=t,(n=[{key:"view",value:function(e){return m("div",{class:"fixed z-50 top-0 left-0 w-full h-full flex items-center justify-center",style:"background-color: rgba(0,0,0,.5);"},m("div",{class:"form-fields\r ig-es-popup-container"},m("div",{class:"ig-es-popup-overlay"}),m("div",{class:"ig-es-popup",style:"padding:20px;height:250px;width:500px;border-radius:2px; z-index:99;"},m("h1",null,"Test Email"),m("div",{class:"ig-es-popup-close-container"},m("button",{href:"#",onclick:function(e){e.preventDefault(),t.show=!1},class:"cross"},m.trust(g.close))),m("div",{class:"p-8 pt-1"},m("div",{style:"background-color:#F8F8F8;padding:20px;"},m("label",{for:"email",class:""},"Email Id"),m("input",{type:"email",id:"es_test_email",class:"",placeholder:"Enter email here",value:u.details.es_admin_email,required:!0})),m("div",{style:"display: inline-block; float:right; padding-top: 50px; text-align: center;"},m("button",{href:"#",onclick:function(e){e.preventDefault(),t.show=!1},class:"secondary",style:"margin-right: 10px;"},"Cancel"),m("button",{href:"#",onclick:function(e){e.preventDefault(),u.testCamapign(u.details)},class:"primary"},"Send"))))))}}])&&Vn(e.prototype,n),a&&Vn(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,a})(),_e=(()=>{function t(e){e=e.attrs;if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");Un(this,"activeTab","design"),this.initialize(e)}return e=t,(n=[{key:"initialize",value:function(e){y.toggleAdminMenuVisibility(!0),this.model=new u,this.isIframeMode=k.isInIframeMode();t=window.location.hash;var n,t=-1!==(a=t.indexOf("?"))?(t=t.substring(a+1),a=new URLSearchParams(t),n={},a.forEach(function(e,t){n[t]=e}),n):{},a=qn(qn({},e),t),e=void 0!==a.campaignId?parseInt(a.campaignId,10):0;!this.isIframeMode&&u.details.id&&u.details.id===e||(0{function a(){var e,t,n;if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");e=this,n="tags_tab",(t=Wn(t="activeTab"))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}return e=a,(t=[{key:"setActiveTab",value:function(e){this.activeTab=e}},{key:"view",value:function(){var e=this;return m("[",null,m("div",null,m("nav",null,m("div",{class:"links w-full text-center"},m("a",{onclick:function(){return e.setActiveTab("tags_tab")},class:"cursor-pointer ig-es-campaign-sidebar-nav-menu ig-es-campaign-tags-nav w-1/2 ".concat("tags_tab"===this.activeTab?"active":"")},"Tags")))),m("div",{class:"nav-child-sections"},m("div",{id:"ig-es-campaign-tags-section",class:"nav-child"},m(K,{campaignType:"newsletter"}))))}}])&&$n(e.prototype,t),n&&$n(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n})(),ke=(()=>{function t(e){e=e.attrs;if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.initialize(e),this.campaignType=C.details.meta.es_template_type}return e=t,(n=[{key:"initialize",value:function(e){var t;y.toggleAdminMenuVisibility(!0),this.model=new C,C.details.id||(0<(t=void 0!==e.templateId?e.templateId:0)?C.getTemplate(t):(e=this.getCampaignDefaultData(e),C.setCurrentTemplate(t,e)))}},{key:"switchEditor",value:function(){var e=C.details.meta.es_editor_type===ig_es_campaign_editor_data.dndEditor;C.details.meta.es_editor_type=e?ig_es_campaign_editor_data.classicEditor:ig_es_campaign_editor_data.dndEditor}},{key:"updateContent",value:function(e){C.details.body=e}},{key:"getCampaignDefaultData",value:function(e){var t=void 0!==e.campaignType?e.campaignType:ig_es_main_js_data.post_notification_campaign_type,e=void 0!==e.editorType?e.editorType:ig_es_main_js_data.dnd_editor_slug,n=e===ig_es_main_js_data.dnd_editor_slug,a=y.getCampaignDefaultSubject(t),i=y.getCampaignDefaultContent(t),a={subject:a,body:i[ig_es_main_js_data.classic_editor_slug],meta:{es_editor_type:e,es_template_type:t}};return n&&(a.meta.dnd_editor_data=i[ig_es_main_js_data.dnd_editor_slug]),a}},{key:"updateCustomCSS",value:function(e){void 0===C.details.meta&&(C.details.meta={}),C.details.meta.es_custom_css=e}},{key:"updateCampaignType",value:function(e){C.details.meta.es_template_type=e,this.campaignType=e,x.campaignType=e;var t=esVisualEditor.BlockManager.blocks.models,t=y.filterCampaignWiseBlocks(t,e);_.blocks=t,m.redraw()}},{key:"view",value:function(e){var t=this,e=(e.attrs,C.details),n=e.meta.es_template_type,a=e.meta.es_editor_type===ig_es_campaign_editor_data.dndEditor,e=a?e.meta.es_dnd_editor_data:e.body;if(""!==e)return m("div",{class:"absolute w-full bg-white"},m("div",{class:"sticky top-0 z-10"},m("header",null,m("nav",{"aria-label":"Global"},m("div",{class:"brand-logo"},m("span",null,m("img",{src:ig_es_main_js_data.image_path+"lite/admin/images/new/brand-logo/IG LOGO 192X192.svg",alt:"brand logo"}),m("div",{class:"divide"}),m("h1",null,C.details.post_title))),m("div",{class:"links"},m("a",{href:"#"}," ",__("Template","email-subscribers")),m("a",{href:"#",class:"active"}," ",__("Edit","email-subscribers"))),m("div",{class:"cta"},m("select",{value:n,style:"width:147px",onchange:function(e){t.updateCampaignType(e.target.value)}},m("option",{value:"post_notification"},"Post Notification"),y.isPro()&&m("option",{value:"post_digest"},"Post Digest"),m("option",{value:"newsletter"},"Broadcast")),m("div",{class:"flex flex-col"},m("button",{id:"dropdownDefaultButton","data-dropdown-toggle":"dropdown",class:"primary text-white text-center inline-flex items-center",type:"button",onclick:function(){C.saveTemplate()}},m("span",null," ",__("Save","email-subscribers")))),m("button",{href:"#",class:"cross",onclick:function(e){m.route.set("/gallery",{manageTemplates:"yes"})}},m.trust(g.close)))))),p.showLoader?m(p,null):null,o.show?m(o,null):null,m("div",{class:"flex justify-between w-full overflow-hidden"},m("div",{id:"campaign-content",class:"template-editor dnd-editor"},m("div",{class:"flex flex-col gap-4"},m("div",null,m("label",{for:"Subject"}," ",__("Subject","email-subscribers")),m("div",{class:"mt-2"},m("input",{type:"text",name:"subject",id:"subject",placeholder:"Subject line goes here {{post.title}}",value:C.details.subject||"",onchange:function(e){return C.details.subject=e.target.value}}))),m(ie,{campaignType:n})),m("div",{class:"template-preview w-full"},a?m(J,{campaignType:n,content:e}):"",a?"":m(X,{campaignType:n,content:e,onRemove:this.updateContent}),a||!y.isPro()&&!y.isTrial()?"":m(ne,{customCSS:null==(e=C.details.meta)?void 0:e.es_custom_css,onChangeHandler:this.updateCustomCSS}))),m("div",{class:"sidebar"},m("div",{class:"switch"},m("p",null,"Switch To ",a?__("Classic Editor","email-subscribers"):__("Drag & Drop Editor","email-subscribers")," "),m("a",{class:"cursor-pointer",onclick:this.switchEditor},"Switch")),m("div",{class:"w-full"},a?m(x,{campaignType:n}):"",a?"":m(we,{campaignType:n})))))}}])&&Jn(e.prototype,n),a&&Jn(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,a})(),void 0!==wp.i18n?O.g.__=wp.i18n.__:O.g.__=function(e,t){return e},document.getElementById("ig-es-campaign-gallery-items-wrapper"),t=document.getElementById("ig-es-campaign-dashboard"),O.g.canUpsellESTemplate=function(e,t){var n=!1;return"lite"===ig_es_main_js_data.es_plan||"trial"===ig_es_main_js_data.es_plan?n="starter"===e||"pro"===e:"starter"===ig_es_main_js_data.es_plan&&(n="pro"===e),"1.0.1"===t&&("lite"===ig_es_main_js_data.es_plan||"trial"===ig_es_main_js_data.es_plan?n="pro"===e||"max"===e:"starter"===ig_es_main_js_data.es_plan&&(n="max"===e)),n},m.route(t,"/campaigns",{"/campaigns":{view:function(e){return[m(Y,e.attrs)]}},"/campaign/edit":{view:function(e){return[m(_e,e.attrs)]}},"/campaign/edit/:campaignId":{view:function(e){return[m(_e,e.attrs)]}},"/template/edit":{view:function(e){return[m(ke,e.attrs)]}},"/template/edit/:templateId":{view:function(e){return[m(ke,e.attrs)]}},"/gallery":{view:function(e){return e.attrs.campaignType=void 0!==e.attrs.campaignType?e.attrs.campaignType:ig_es_main_js_data.post_notification_campaign_type,e.attrs.campaignId=void 0!==e.attrs.campaignId?e.attrs.campaignId:0,e.attrs.manageTemplates=void 0!==e.attrs.manageTemplates?e.attrs.manageTemplates:"no",[m(c,e.attrs)]}}})})();