zZzzZ.
home2
/
zrzvbdry
/
public_html
/
wp-content
/
plugins
/
woolentor-addons
/
includes
/
admin-panel
/
assets
/
js
New Folder
Editing: admin.js
Save
Cancel
import{y as p,z as y,A as l,P as c,O as B,a4 as ee,r as F,k as it,M as A,C as x,aw as Se,ax as Fe,G as w,H as m,I as be,K as C,ay as ua,c as Q,az as $n,ag as V,L as k,D as Ce,J as at,a6 as ks,V as he,Q as zt,ak as Rn,ac as pa,aA as fa,ae as Rs,T as ma,X as Mo,u as ve,af as Pn,w as Ft,aB as ga,aC as ha,W as _a,aD as ya,E as Go,x as va,at as ba}from"./vendor.js";import{E as Wn,a as qn,b as Ps,c as on,v as sn,l as Ta,u as wa,d as Ea,e as Kn,f as de,g as Ca,h as Sa,i as Ae,j as pe,k as Fo,m as Aa,n as Da,o as Ms,p as La,q as te,r as ae,s as an,t as ht,w as _t,x as yt,y as lt,z as rt,A as Lt,B as Gs,C as Fs,D as ln,F as Vo,G as It,H as Ot,I as Uo,J as Bo,K as Ia,L as ss,M as zo,N as Oa,O as Na,P as Vs,Q as Ho,R as jo,S as Us,T as ft,U as xa,V as Bs,W as $o,X as zs,Y as Wo,Z as Hs,_ as js,$ as $s,a0 as Ws,a1 as qo,a2 as qs,a3 as ka,a4 as Ra,a5 as rn,a6 as Ks,a7 as Ys,a8 as Pa,a9 as Ma,aa as Ga,ab as Js,ac as cn,ad as Fa,ae as Va,af as Xs,ag as Qs,ah as Ua,ai as Ba,aj as za,ak as Ha,al as ja,am as $a,an as Wa,ao as qa,ap as Ka,aq as Zs,ar as Ya}from"./element-plus.js";const M=(t,e)=>{const o=t.__vccOpts||t;for(const[n,s]of e)o[n]=s;return o},Ja={name:"WooLentorSidebarSkeleton"},Xa={class:"woolentor-sidebar-skeleton"},Qa={class:"woolentor-logo-skeleton"},Za={class:"woolentor-content-skeleton"},el={class:"woolentor-features-skeleton"},tl={class:"woolentor-button-skeleton"};function nl(t,e,o,n,s,i){const a=Wn;return p(),y("div",Xa,[l("div",Qa,[c(a,{variant:"circle",style:{width:"80px",height:"80px"}})]),l("div",Za,[c(a,{variant:"text",style:{width:"90%",height:"20px",margin:"0 auto"}}),c(a,{variant:"text",style:{width:"80%",height:"20px",margin:"8px auto"}}),c(a,{variant:"text",style:{width:"85%",height:"20px",margin:"8px auto"}})]),l("div",el,[(p(),y(B,null,ee(4,r=>l("div",{class:"feature-item",key:r},[c(a,{variant:"circle",style:{width:"20px",height:"20px"}}),c(a,{variant:"text",style:{"margin-left":"12px",width:"80%"}})])),64))]),l("div",tl,[c(a,{variant:"button",style:{width:"160px",height:"40px",margin:"20px auto"}})])])}const ei=M(Ja,[["render",nl],["__scopeId","data-v-cae3c1a7"]]);function ti(t,e){return function(){return t.apply(e,arguments)}}const{toString:ol}=Object.prototype,{getPrototypeOf:Ko}=Object,Yn=(t=>e=>{const o=ol.call(e);return t[o]||(t[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Xe=t=>(t=t.toLowerCase(),e=>Yn(e)===t),Jn=t=>e=>typeof e===t,{isArray:Ht}=Array,nn=Jn("undefined");function sl(t){return t!==null&&!nn(t)&&t.constructor!==null&&!nn(t.constructor)&&He(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const ni=Xe("ArrayBuffer");function il(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&ni(t.buffer),e}const al=Jn("string"),He=Jn("function"),oi=Jn("number"),Xn=t=>t!==null&&typeof t=="object",ll=t=>t===!0||t===!1,Sn=t=>{if(Yn(t)!=="object")return!1;const e=Ko(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},rl=Xe("Date"),cl=Xe("File"),dl=Xe("Blob"),ul=Xe("FileList"),pl=t=>Xn(t)&&He(t.pipe),fl=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||He(t.append)&&((e=Yn(t))==="formdata"||e==="object"&&He(t.toString)&&t.toString()==="[object FormData]"))},ml=Xe("URLSearchParams"),[gl,hl,_l,yl]=["ReadableStream","Request","Response","Headers"].map(Xe),vl=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function dn(t,e,{allOwnKeys:o=!1}={}){if(t===null||typeof t>"u")return;let n,s;if(typeof t!="object"&&(t=[t]),Ht(t))for(n=0,s=t.length;n<s;n++)e.call(null,t[n],n,t);else{const i=o?Object.getOwnPropertyNames(t):Object.keys(t),a=i.length;let r;for(n=0;n<a;n++)r=i[n],e.call(null,t[r],r,t)}}function si(t,e){e=e.toLowerCase();const o=Object.keys(t);let n=o.length,s;for(;n-- >0;)if(s=o[n],e===s.toLowerCase())return s;return null}const St=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ii=t=>!nn(t)&&t!==St;function Co(){const{caseless:t}=ii(this)&&this||{},e={},o=(n,s)=>{const i=t&&si(e,s)||s;Sn(e[i])&&Sn(n)?e[i]=Co(e[i],n):Sn(n)?e[i]=Co({},n):Ht(n)?e[i]=n.slice():e[i]=n};for(let n=0,s=arguments.length;n<s;n++)arguments[n]&&dn(arguments[n],o);return e}const bl=(t,e,o,{allOwnKeys:n}={})=>(dn(e,(s,i)=>{o&&He(s)?t[i]=ti(s,o):t[i]=s},{allOwnKeys:n}),t),Tl=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),wl=(t,e,o,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),o&&Object.assign(t.prototype,o)},El=(t,e,o,n)=>{let s,i,a;const r={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)a=s[i],(!n||n(a,t,e))&&!r[a]&&(e[a]=t[a],r[a]=!0);t=o!==!1&&Ko(t)}while(t&&(!o||o(t,e))&&t!==Object.prototype);return e},Cl=(t,e,o)=>{t=String(t),(o===void 0||o>t.length)&&(o=t.length),o-=e.length;const n=t.indexOf(e,o);return n!==-1&&n===o},Sl=t=>{if(!t)return null;if(Ht(t))return t;let e=t.length;if(!oi(e))return null;const o=new Array(e);for(;e-- >0;)o[e]=t[e];return o},Al=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ko(Uint8Array)),Dl=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let s;for(;(s=n.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},Ll=(t,e)=>{let o;const n=[];for(;(o=t.exec(e))!==null;)n.push(o);return n},Il=Xe("HTMLFormElement"),Ol=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,n,s){return n.toUpperCase()+s}),is=(({hasOwnProperty:t})=>(e,o)=>t.call(e,o))(Object.prototype),Nl=Xe("RegExp"),ai=(t,e)=>{const o=Object.getOwnPropertyDescriptors(t),n={};dn(o,(s,i)=>{let a;(a=e(s,i,t))!==!1&&(n[i]=a||s)}),Object.defineProperties(t,n)},xl=t=>{ai(t,(e,o)=>{if(He(t)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;const n=t[o];if(He(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},kl=(t,e)=>{const o={},n=s=>{s.forEach(i=>{o[i]=!0})};return Ht(t)?n(t):n(String(t).split(e)),o},Rl=()=>{},Pl=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,lo="abcdefghijklmnopqrstuvwxyz",as="0123456789",li={DIGIT:as,ALPHA:lo,ALPHA_DIGIT:lo+lo.toUpperCase()+as},Ml=(t=16,e=li.ALPHA_DIGIT)=>{let o="";const{length:n}=e;for(;t--;)o+=e[Math.random()*n|0];return o};function Gl(t){return!!(t&&He(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Fl=t=>{const e=new Array(10),o=(n,s)=>{if(Xn(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[s]=n;const i=Ht(n)?[]:{};return dn(n,(a,r)=>{const f=o(a,s+1);!nn(f)&&(i[r]=f)}),e[s]=void 0,i}}return n};return o(t,0)},Vl=Xe("AsyncFunction"),Ul=t=>t&&(Xn(t)||He(t))&&He(t.then)&&He(t.catch),ri=((t,e)=>t?setImmediate:e?((o,n)=>(St.addEventListener("message",({source:s,data:i})=>{s===St&&i===o&&n.length&&n.shift()()},!1),s=>{n.push(s),St.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",He(St.postMessage)),Bl=typeof queueMicrotask<"u"?queueMicrotask.bind(St):typeof process<"u"&&process.nextTick||ri,E={isArray:Ht,isArrayBuffer:ni,isBuffer:sl,isFormData:fl,isArrayBufferView:il,isString:al,isNumber:oi,isBoolean:ll,isObject:Xn,isPlainObject:Sn,isReadableStream:gl,isRequest:hl,isResponse:_l,isHeaders:yl,isUndefined:nn,isDate:rl,isFile:cl,isBlob:dl,isRegExp:Nl,isFunction:He,isStream:pl,isURLSearchParams:ml,isTypedArray:Al,isFileList:ul,forEach:dn,merge:Co,extend:bl,trim:vl,stripBOM:Tl,inherits:wl,toFlatObject:El,kindOf:Yn,kindOfTest:Xe,endsWith:Cl,toArray:Sl,forEachEntry:Dl,matchAll:Ll,isHTMLForm:Il,hasOwnProperty:is,hasOwnProp:is,reduceDescriptors:ai,freezeMethods:xl,toObjectSet:kl,toCamelCase:Ol,noop:Rl,toFiniteNumber:Pl,findKey:si,global:St,isContextDefined:ii,ALPHABET:li,generateString:Ml,isSpecCompliantForm:Gl,toJSONObject:Fl,isAsyncFn:Vl,isThenable:Ul,setImmediate:ri,asap:Bl};function J(t,e,o,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),o&&(this.config=o),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}E.inherits(J,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:E.toJSONObject(this.config),code:this.code,status:this.status}}});const ci=J.prototype,di={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{di[t]={value:t}});Object.defineProperties(J,di);Object.defineProperty(ci,"isAxiosError",{value:!0});J.from=(t,e,o,n,s,i)=>{const a=Object.create(ci);return E.toFlatObject(t,a,function(f){return f!==Error.prototype},r=>r!=="isAxiosError"),J.call(a,t.message,e,o,n,s),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const zl=null;function So(t){return E.isPlainObject(t)||E.isArray(t)}function ui(t){return E.endsWith(t,"[]")?t.slice(0,-2):t}function ls(t,e,o){return t?t.concat(e).map(function(s,i){return s=ui(s),!o&&i?"["+s+"]":s}).join(o?".":""):e}function Hl(t){return E.isArray(t)&&!t.some(So)}const jl=E.toFlatObject(E,{},null,function(e){return/^is[A-Z]/.test(e)});function Qn(t,e,o){if(!E.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,o=E.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,T){return!E.isUndefined(T[b])});const n=o.metaTokens,s=o.visitor||u,i=o.dots,a=o.indexes,f=(o.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(e);if(!E.isFunction(s))throw new TypeError("visitor must be a function");function d(h){if(h===null)return"";if(E.isDate(h))return h.toISOString();if(!f&&E.isBlob(h))throw new J("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(h)||E.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,b,T){let D=h;if(h&&!T&&typeof h=="object"){if(E.endsWith(b,"{}"))b=n?b:b.slice(0,-2),h=JSON.stringify(h);else if(E.isArray(h)&&Hl(h)||(E.isFileList(h)||E.endsWith(b,"[]"))&&(D=E.toArray(h)))return b=ui(b),D.forEach(function(P,O){!(E.isUndefined(P)||P===null)&&e.append(a===!0?ls([b],O,i):a===null?b:b+"[]",d(P))}),!1}return So(h)?!0:(e.append(ls(T,b,i),d(h)),!1)}const g=[],_=Object.assign(jl,{defaultVisitor:u,convertValue:d,isVisitable:So});function v(h,b){if(!E.isUndefined(h)){if(g.indexOf(h)!==-1)throw Error("Circular reference detected in "+b.join("."));g.push(h),E.forEach(h,function(D,S){(!(E.isUndefined(D)||D===null)&&s.call(e,D,E.isString(S)?S.trim():S,b,_))===!0&&v(D,b?b.concat(S):[S])}),g.pop()}}if(!E.isObject(t))throw new TypeError("data must be an object");return v(t),e}function rs(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Yo(t,e){this._pairs=[],t&&Qn(t,this,e)}const pi=Yo.prototype;pi.append=function(e,o){this._pairs.push([e,o])};pi.toString=function(e){const o=e?function(n){return e.call(this,n,rs)}:rs;return this._pairs.map(function(s){return o(s[0])+"="+o(s[1])},"").join("&")};function $l(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function fi(t,e,o){if(!e)return t;const n=o&&o.encode||$l;E.isFunction(o)&&(o={serialize:o});const s=o&&o.serialize;let i;if(s?i=s(e,o):i=E.isURLSearchParams(e)?e.toString():new Yo(e,o).toString(n),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class cs{constructor(){this.handlers=[]}use(e,o,n){return this.handlers.push({fulfilled:e,rejected:o,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){E.forEach(this.handlers,function(n){n!==null&&e(n)})}}const mi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Wl=typeof URLSearchParams<"u"?URLSearchParams:Yo,ql=typeof FormData<"u"?FormData:null,Kl=typeof Blob<"u"?Blob:null,Yl={isBrowser:!0,classes:{URLSearchParams:Wl,FormData:ql,Blob:Kl},protocols:["http","https","file","blob","url","data"]},Jo=typeof window<"u"&&typeof document<"u",Ao=typeof navigator=="object"&&navigator||void 0,Jl=Jo&&(!Ao||["ReactNative","NativeScript","NS"].indexOf(Ao.product)<0),Xl=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ql=Jo&&window.location.href||"http://localhost",Zl=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Jo,hasStandardBrowserEnv:Jl,hasStandardBrowserWebWorkerEnv:Xl,navigator:Ao,origin:Ql},Symbol.toStringTag,{value:"Module"})),xe={...Zl,...Yl};function er(t,e){return Qn(t,new xe.classes.URLSearchParams,Object.assign({visitor:function(o,n,s,i){return xe.isNode&&E.isBuffer(o)?(this.append(n,o.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function tr(t){return E.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function nr(t){const e={},o=Object.keys(t);let n;const s=o.length;let i;for(n=0;n<s;n++)i=o[n],e[i]=t[i];return e}function gi(t){function e(o,n,s,i){let a=o[i++];if(a==="__proto__")return!0;const r=Number.isFinite(+a),f=i>=o.length;return a=!a&&E.isArray(s)?s.length:a,f?(E.hasOwnProp(s,a)?s[a]=[s[a],n]:s[a]=n,!r):((!s[a]||!E.isObject(s[a]))&&(s[a]=[]),e(o,n,s[a],i)&&E.isArray(s[a])&&(s[a]=nr(s[a])),!r)}if(E.isFormData(t)&&E.isFunction(t.entries)){const o={};return E.forEachEntry(t,(n,s)=>{e(tr(n),s,o,0)}),o}return null}function or(t,e,o){if(E.isString(t))try{return(e||JSON.parse)(t),E.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(0,JSON.stringify)(t)}const un={transitional:mi,adapter:["xhr","http","fetch"],transformRequest:[function(e,o){const n=o.getContentType()||"",s=n.indexOf("application/json")>-1,i=E.isObject(e);if(i&&E.isHTMLForm(e)&&(e=new FormData(e)),E.isFormData(e))return s?JSON.stringify(gi(e)):e;if(E.isArrayBuffer(e)||E.isBuffer(e)||E.isStream(e)||E.isFile(e)||E.isBlob(e)||E.isReadableStream(e))return e;if(E.isArrayBufferView(e))return e.buffer;if(E.isURLSearchParams(e))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let r;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return er(e,this.formSerializer).toString();if((r=E.isFileList(e))||n.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Qn(r?{"files[]":e}:e,f&&new f,this.formSerializer)}}return i||s?(o.setContentType("application/json",!1),or(e)):e}],transformResponse:[function(e){const o=this.transitional||un.transitional,n=o&&o.forcedJSONParsing,s=this.responseType==="json";if(E.isResponse(e)||E.isReadableStream(e))return e;if(e&&E.isString(e)&&(n&&!this.responseType||s)){const a=!(o&&o.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(r){if(a)throw r.name==="SyntaxError"?J.from(r,J.ERR_BAD_RESPONSE,this,null,this.response):r}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xe.classes.FormData,Blob:xe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};E.forEach(["delete","get","head","post","put","patch"],t=>{un.headers[t]={}});const sr=E.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ir=t=>{const e={};let o,n,s;return t&&t.split(` `).forEach(function(a){s=a.indexOf(":"),o=a.substring(0,s).trim().toLowerCase(),n=a.substring(s+1).trim(),!(!o||e[o]&&sr[o])&&(o==="set-cookie"?e[o]?e[o].push(n):e[o]=[n]:e[o]=e[o]?e[o]+", "+n:n)}),e},ds=Symbol("internals");function qt(t){return t&&String(t).trim().toLowerCase()}function An(t){return t===!1||t==null?t:E.isArray(t)?t.map(An):String(t)}function ar(t){const e=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=o.exec(t);)e[n[1]]=n[2];return e}const lr=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ro(t,e,o,n,s){if(E.isFunction(n))return n.call(this,e,o);if(s&&(e=o),!!E.isString(e)){if(E.isString(n))return e.indexOf(n)!==-1;if(E.isRegExp(n))return n.test(e)}}function rr(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,o,n)=>o.toUpperCase()+n)}function cr(t,e){const o=E.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+o,{value:function(s,i,a){return this[n].call(this,e,s,i,a)},configurable:!0})})}class Ge{constructor(e){e&&this.set(e)}set(e,o,n){const s=this;function i(r,f,d){const u=qt(f);if(!u)throw new Error("header name must be a non-empty string");const g=E.findKey(s,u);(!g||s[g]===void 0||d===!0||d===void 0&&s[g]!==!1)&&(s[g||f]=An(r))}const a=(r,f)=>E.forEach(r,(d,u)=>i(d,u,f));if(E.isPlainObject(e)||e instanceof this.constructor)a(e,o);else if(E.isString(e)&&(e=e.trim())&&!lr(e))a(ir(e),o);else if(E.isHeaders(e))for(const[r,f]of e.entries())i(f,r,n);else e!=null&&i(o,e,n);return this}get(e,o){if(e=qt(e),e){const n=E.findKey(this,e);if(n){const s=this[n];if(!o)return s;if(o===!0)return ar(s);if(E.isFunction(o))return o.call(this,s,n);if(E.isRegExp(o))return o.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,o){if(e=qt(e),e){const n=E.findKey(this,e);return!!(n&&this[n]!==void 0&&(!o||ro(this,this[n],n,o)))}return!1}delete(e,o){const n=this;let s=!1;function i(a){if(a=qt(a),a){const r=E.findKey(n,a);r&&(!o||ro(n,n[r],r,o))&&(delete n[r],s=!0)}}return E.isArray(e)?e.forEach(i):i(e),s}clear(e){const o=Object.keys(this);let n=o.length,s=!1;for(;n--;){const i=o[n];(!e||ro(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const o=this,n={};return E.forEach(this,(s,i)=>{const a=E.findKey(n,i);if(a){o[a]=An(s),delete o[i];return}const r=e?rr(i):String(i).trim();r!==i&&delete o[i],o[r]=An(s),n[r]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const o=Object.create(null);return E.forEach(this,(n,s)=>{n!=null&&n!==!1&&(o[s]=e&&E.isArray(n)?n.join(", "):n)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,o])=>e+": "+o).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...o){const n=new this(e);return o.forEach(s=>n.set(s)),n}static accessor(e){const n=(this[ds]=this[ds]={accessors:{}}).accessors,s=this.prototype;function i(a){const r=qt(a);n[r]||(cr(s,a),n[r]=!0)}return E.isArray(e)?e.forEach(i):i(e),this}}Ge.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);E.reduceDescriptors(Ge.prototype,({value:t},e)=>{let o=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[o]=n}}});E.freezeMethods(Ge);function co(t,e){const o=this||un,n=e||o,s=Ge.from(n.headers);let i=n.data;return E.forEach(t,function(r){i=r.call(o,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function hi(t){return!!(t&&t.__CANCEL__)}function jt(t,e,o){J.call(this,t??"canceled",J.ERR_CANCELED,e,o),this.name="CanceledError"}E.inherits(jt,J,{__CANCEL__:!0});function _i(t,e,o){const n=o.config.validateStatus;!o.status||!n||n(o.status)?t(o):e(new J("Request failed with status code "+o.status,[J.ERR_BAD_REQUEST,J.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function dr(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ur(t,e){t=t||10;const o=new Array(t),n=new Array(t);let s=0,i=0,a;return e=e!==void 0?e:1e3,function(f){const d=Date.now(),u=n[i];a||(a=d),o[s]=f,n[s]=d;let g=i,_=0;for(;g!==s;)_+=o[g++],g=g%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),d-a<e)return;const v=u&&d-u;return v?Math.round(_*1e3/v):void 0}}function pr(t,e){let o=0,n=1e3/e,s,i;const a=(d,u=Date.now())=>{o=u,s=null,i&&(clearTimeout(i),i=null),t.apply(null,d)};return[(...d)=>{const u=Date.now(),g=u-o;g>=n?a(d,u):(s=d,i||(i=setTimeout(()=>{i=null,a(s)},n-g)))},()=>s&&a(s)]}const Mn=(t,e,o=3)=>{let n=0;const s=ur(50,250);return pr(i=>{const a=i.loaded,r=i.lengthComputable?i.total:void 0,f=a-n,d=s(f),u=a<=r;n=a;const g={loaded:a,total:r,progress:r?a/r:void 0,bytes:f,rate:d||void 0,estimated:d&&r&&u?(r-a)/d:void 0,event:i,lengthComputable:r!=null,[e?"download":"upload"]:!0};t(g)},o)},us=(t,e)=>{const o=t!=null;return[n=>e[0]({lengthComputable:o,total:t,loaded:n}),e[1]]},ps=t=>(...e)=>E.asap(()=>t(...e)),fr=xe.hasStandardBrowserEnv?((t,e)=>o=>(o=new URL(o,xe.origin),t.protocol===o.protocol&&t.host===o.host&&(e||t.port===o.port)))(new URL(xe.origin),xe.navigator&&/(msie|trident)/i.test(xe.navigator.userAgent)):()=>!0,mr=xe.hasStandardBrowserEnv?{write(t,e,o,n,s,i){const a=[t+"="+encodeURIComponent(e)];E.isNumber(o)&&a.push("expires="+new Date(o).toGMTString()),E.isString(n)&&a.push("path="+n),E.isString(s)&&a.push("domain="+s),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function gr(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function hr(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function yi(t,e){return t&&!gr(e)?hr(t,e):e}const fs=t=>t instanceof Ge?{...t}:t;function Dt(t,e){e=e||{};const o={};function n(d,u,g,_){return E.isPlainObject(d)&&E.isPlainObject(u)?E.merge.call({caseless:_},d,u):E.isPlainObject(u)?E.merge({},u):E.isArray(u)?u.slice():u}function s(d,u,g,_){if(E.isUndefined(u)){if(!E.isUndefined(d))return n(void 0,d,g,_)}else return n(d,u,g,_)}function i(d,u){if(!E.isUndefined(u))return n(void 0,u)}function a(d,u){if(E.isUndefined(u)){if(!E.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function r(d,u,g){if(g in e)return n(d,u);if(g in t)return n(void 0,d)}const f={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:r,headers:(d,u,g)=>s(fs(d),fs(u),g,!0)};return E.forEach(Object.keys(Object.assign({},t,e)),function(u){const g=f[u]||s,_=g(t[u],e[u],u);E.isUndefined(_)&&g!==r||(o[u]=_)}),o}const vi=t=>{const e=Dt({},t);let{data:o,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:r}=e;e.headers=a=Ge.from(a),e.url=fi(yi(e.baseURL,e.url),t.params,t.paramsSerializer),r&&a.set("Authorization","Basic "+btoa((r.username||"")+":"+(r.password?unescape(encodeURIComponent(r.password)):"")));let f;if(E.isFormData(o)){if(xe.hasStandardBrowserEnv||xe.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((f=a.getContentType())!==!1){const[d,...u]=f?f.split(";").map(g=>g.trim()).filter(Boolean):[];a.setContentType([d||"multipart/form-data",...u].join("; "))}}if(xe.hasStandardBrowserEnv&&(n&&E.isFunction(n)&&(n=n(e)),n||n!==!1&&fr(e.url))){const d=s&&i&&mr.read(i);d&&a.set(s,d)}return e},_r=typeof XMLHttpRequest<"u",yr=_r&&function(t){return new Promise(function(o,n){const s=vi(t);let i=s.data;const a=Ge.from(s.headers).normalize();let{responseType:r,onUploadProgress:f,onDownloadProgress:d}=s,u,g,_,v,h;function b(){v&&v(),h&&h(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let T=new XMLHttpRequest;T.open(s.method.toUpperCase(),s.url,!0),T.timeout=s.timeout;function D(){if(!T)return;const P=Ge.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),L={data:!r||r==="text"||r==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:P,config:t,request:T};_i(function(z){o(z),b()},function(z){n(z),b()},L),T=null}"onloadend"in T?T.onloadend=D:T.onreadystatechange=function(){!T||T.readyState!==4||T.status===0&&!(T.responseURL&&T.responseURL.indexOf("file:")===0)||setTimeout(D)},T.onabort=function(){T&&(n(new J("Request aborted",J.ECONNABORTED,t,T)),T=null)},T.onerror=function(){n(new J("Network Error",J.ERR_NETWORK,t,T)),T=null},T.ontimeout=function(){let O=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const L=s.transitional||mi;s.timeoutErrorMessage&&(O=s.timeoutErrorMessage),n(new J(O,L.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,t,T)),T=null},i===void 0&&a.setContentType(null),"setRequestHeader"in T&&E.forEach(a.toJSON(),function(O,L){T.setRequestHeader(L,O)}),E.isUndefined(s.withCredentials)||(T.withCredentials=!!s.withCredentials),r&&r!=="json"&&(T.responseType=s.responseType),d&&([_,h]=Mn(d,!0),T.addEventListener("progress",_)),f&&T.upload&&([g,v]=Mn(f),T.upload.addEventListener("progress",g),T.upload.addEventListener("loadend",v)),(s.cancelToken||s.signal)&&(u=P=>{T&&(n(!P||P.type?new jt(null,t,T):P),T.abort(),T=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const S=dr(s.url);if(S&&xe.protocols.indexOf(S)===-1){n(new J("Unsupported protocol "+S+":",J.ERR_BAD_REQUEST,t));return}T.send(i||null)})},vr=(t,e)=>{const{length:o}=t=t?t.filter(Boolean):[];if(e||o){let n=new AbortController,s;const i=function(d){if(!s){s=!0,r();const u=d instanceof Error?d:this.reason;n.abort(u instanceof J?u:new jt(u instanceof Error?u.message:u))}};let a=e&&setTimeout(()=>{a=null,i(new J(`timeout ${e} of ms exceeded`,J.ETIMEDOUT))},e);const r=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),t=null)};t.forEach(d=>d.addEventListener("abort",i));const{signal:f}=n;return f.unsubscribe=()=>E.asap(r),f}},br=function*(t,e){let o=t.byteLength;if(o<e){yield t;return}let n=0,s;for(;n<o;)s=n+e,yield t.slice(n,s),n=s},Tr=async function*(t,e){for await(const o of wr(t))yield*br(o,e)},wr=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:o,value:n}=await e.read();if(o)break;yield n}}finally{await e.cancel()}},ms=(t,e,o,n)=>{const s=Tr(t,e);let i=0,a,r=f=>{a||(a=!0,n&&n(f))};return new ReadableStream({async pull(f){try{const{done:d,value:u}=await s.next();if(d){r(),f.close();return}let g=u.byteLength;if(o){let _=i+=g;o(_)}f.enqueue(new Uint8Array(u))}catch(d){throw r(d),d}},cancel(f){return r(f),s.return()}},{highWaterMark:2})},Zn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",bi=Zn&&typeof ReadableStream=="function",Er=Zn&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Ti=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Cr=bi&&Ti(()=>{let t=!1;const e=new Request(xe.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),gs=64*1024,Do=bi&&Ti(()=>E.isReadableStream(new Response("").body)),Gn={stream:Do&&(t=>t.body)};Zn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Gn[e]&&(Gn[e]=E.isFunction(t[e])?o=>o[e]():(o,n)=>{throw new J(`Response type '${e}' is not supported`,J.ERR_NOT_SUPPORT,n)})})})(new Response);const Sr=async t=>{if(t==null)return 0;if(E.isBlob(t))return t.size;if(E.isSpecCompliantForm(t))return(await new Request(xe.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(E.isArrayBufferView(t)||E.isArrayBuffer(t))return t.byteLength;if(E.isURLSearchParams(t)&&(t=t+""),E.isString(t))return(await Er(t)).byteLength},Ar=async(t,e)=>{const o=E.toFiniteNumber(t.getContentLength());return o??Sr(e)},Dr=Zn&&(async t=>{let{url:e,method:o,data:n,signal:s,cancelToken:i,timeout:a,onDownloadProgress:r,onUploadProgress:f,responseType:d,headers:u,withCredentials:g="same-origin",fetchOptions:_}=vi(t);d=d?(d+"").toLowerCase():"text";let v=vr([s,i&&i.toAbortSignal()],a),h;const b=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let T;try{if(f&&Cr&&o!=="get"&&o!=="head"&&(T=await Ar(u,n))!==0){let L=new Request(e,{method:"POST",body:n,duplex:"half"}),R;if(E.isFormData(n)&&(R=L.headers.get("content-type"))&&u.setContentType(R),L.body){const[z,W]=us(T,Mn(ps(f)));n=ms(L.body,gs,z,W)}}E.isString(g)||(g=g?"include":"omit");const D="credentials"in Request.prototype;h=new Request(e,{..._,signal:v,method:o.toUpperCase(),headers:u.normalize().toJSON(),body:n,duplex:"half",credentials:D?g:void 0});let S=await fetch(h);const P=Do&&(d==="stream"||d==="response");if(Do&&(r||P&&b)){const L={};["status","statusText","headers"].forEach(se=>{L[se]=S[se]});const R=E.toFiniteNumber(S.headers.get("content-length")),[z,W]=r&&us(R,Mn(ps(r),!0))||[];S=new Response(ms(S.body,gs,z,()=>{W&&W(),b&&b()}),L)}d=d||"text";let O=await Gn[E.findKey(Gn,d)||"text"](S,t);return!P&&b&&b(),await new Promise((L,R)=>{_i(L,R,{data:O,headers:Ge.from(S.headers),status:S.status,statusText:S.statusText,config:t,request:h})})}catch(D){throw b&&b(),D&&D.name==="TypeError"&&/fetch/i.test(D.message)?Object.assign(new J("Network Error",J.ERR_NETWORK,t,h),{cause:D.cause||D}):J.from(D,D&&D.code,t,h)}}),Lo={http:zl,xhr:yr,fetch:Dr};E.forEach(Lo,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const hs=t=>`- ${t}`,Lr=t=>E.isFunction(t)||t===null||t===!1,wi={getAdapter:t=>{t=E.isArray(t)?t:[t];const{length:e}=t;let o,n;const s={};for(let i=0;i<e;i++){o=t[i];let a;if(n=o,!Lr(o)&&(n=Lo[(a=String(o)).toLowerCase()],n===void 0))throw new J(`Unknown adapter '${a}'`);if(n)break;s[a||"#"+i]=n}if(!n){const i=Object.entries(s).map(([r,f])=>`adapter ${r} `+(f===!1?"is not supported by the environment":"is not available in the build"));let a=e?i.length>1?`since : `+i.map(hs).join(` `):" "+hs(i[0]):"as no adapter specified";throw new J("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:Lo};function uo(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new jt(null,t)}function _s(t){return uo(t),t.headers=Ge.from(t.headers),t.data=co.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),wi.getAdapter(t.adapter||un.adapter)(t).then(function(n){return uo(t),n.data=co.call(t,t.transformResponse,n),n.headers=Ge.from(n.headers),n},function(n){return hi(n)||(uo(t),n&&n.response&&(n.response.data=co.call(t,t.transformResponse,n.response),n.response.headers=Ge.from(n.response.headers))),Promise.reject(n)})}const Ei="1.7.9",eo={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{eo[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const ys={};eo.transitional=function(e,o,n){function s(i,a){return"[Axios v"+Ei+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return(i,a,r)=>{if(e===!1)throw new J(s(a," has been removed"+(o?" in "+o:"")),J.ERR_DEPRECATED);return o&&!ys[a]&&(ys[a]=!0,console.warn(s(a," has been deprecated since v"+o+" and will be removed in the near future"))),e?e(i,a,r):!0}};eo.spelling=function(e){return(o,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Ir(t,e,o){if(typeof t!="object")throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let s=n.length;for(;s-- >0;){const i=n[s],a=e[i];if(a){const r=t[i],f=r===void 0||a(r,i,t);if(f!==!0)throw new J("option "+i+" must be "+f,J.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new J("Unknown option "+i,J.ERR_BAD_OPTION)}}const Dn={assertOptions:Ir,validators:eo},Ze=Dn.validators;class At{constructor(e){this.defaults=e,this.interceptors={request:new cs,response:new cs}}async request(e,o){try{return await this._request(e,o)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=` `+i):n.stack=i}catch{}}throw n}}_request(e,o){typeof e=="string"?(o=o||{},o.url=e):o=e||{},o=Dt(this.defaults,o);const{transitional:n,paramsSerializer:s,headers:i}=o;n!==void 0&&Dn.assertOptions(n,{silentJSONParsing:Ze.transitional(Ze.boolean),forcedJSONParsing:Ze.transitional(Ze.boolean),clarifyTimeoutError:Ze.transitional(Ze.boolean)},!1),s!=null&&(E.isFunction(s)?o.paramsSerializer={serialize:s}:Dn.assertOptions(s,{encode:Ze.function,serialize:Ze.function},!0)),Dn.assertOptions(o,{baseUrl:Ze.spelling("baseURL"),withXsrfToken:Ze.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let a=i&&E.merge(i.common,i[o.method]);i&&E.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),o.headers=Ge.concat(a,i);const r=[];let f=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(o)===!1||(f=f&&b.synchronous,r.unshift(b.fulfilled,b.rejected))});const d=[];this.interceptors.response.forEach(function(b){d.push(b.fulfilled,b.rejected)});let u,g=0,_;if(!f){const h=[_s.bind(this),void 0];for(h.unshift.apply(h,r),h.push.apply(h,d),_=h.length,u=Promise.resolve(o);g<_;)u=u.then(h[g++],h[g++]);return u}_=r.length;let v=o;for(g=0;g<_;){const h=r[g++],b=r[g++];try{v=h(v)}catch(T){b.call(this,T);break}}try{u=_s.call(this,v)}catch(h){return Promise.reject(h)}for(g=0,_=d.length;g<_;)u=u.then(d[g++],d[g++]);return u}getUri(e){e=Dt(this.defaults,e);const o=yi(e.baseURL,e.url);return fi(o,e.params,e.paramsSerializer)}}E.forEach(["delete","get","head","options"],function(e){At.prototype[e]=function(o,n){return this.request(Dt(n||{},{method:e,url:o,data:(n||{}).data}))}});E.forEach(["post","put","patch"],function(e){function o(n){return function(i,a,r){return this.request(Dt(r||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}At.prototype[e]=o(),At.prototype[e+"Form"]=o(!0)});class Xo{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(i){o=i});const n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i;const a=new Promise(r=>{n.subscribe(r),i=r}).then(s);return a.cancel=function(){n.unsubscribe(i)},a},e(function(i,a,r){n.reason||(n.reason=new jt(i,a,r),o(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const o=this._listeners.indexOf(e);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const e=new AbortController,o=n=>{e.abort(n)};return this.subscribe(o),e.signal.unsubscribe=()=>this.unsubscribe(o),e.signal}static source(){let e;return{token:new Xo(function(s){e=s}),cancel:e}}}function Or(t){return function(o){return t.apply(null,o)}}function Nr(t){return E.isObject(t)&&t.isAxiosError===!0}const Io={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Io).forEach(([t,e])=>{Io[e]=t});function Ci(t){const e=new At(t),o=ti(At.prototype.request,e);return E.extend(o,At.prototype,e,{allOwnKeys:!0}),E.extend(o,e,null,{allOwnKeys:!0}),o.create=function(s){return Ci(Dt(t,s))},o}const _e=Ci(un);_e.Axios=At;_e.CanceledError=jt;_e.CancelToken=Xo;_e.isCancel=hi;_e.VERSION=Ei;_e.toFormData=Qn;_e.AxiosError=J;_e.Cancel=_e.CanceledError;_e.all=function(e){return Promise.all(e)};_e.spread=Or;_e.isAxiosError=Nr;_e.mergeConfig=Dt;_e.AxiosHeaders=Ge;_e.formToJSON=t=>gi(E.isHTMLForm(t)?new FormData(t):t);_e.getAdapter=wi.getAdapter;_e.HttpStatusCode=Io;_e.default=_e;const X=_e.create({baseURL:woolentorOptions.rootApiUrl,headers:{"content-type":"application/json","X-WP-Nonce":woolentorOptions.restNonce}}),Ln=_e.create({baseURL:woolentorOptions.adminUrl,headers:{"content-type":"application/json","X-WP-Nonce":woolentorOptions.restNonce}}),xr={name:"WooLentorSidebar",components:{sidebarSkeleton:ei},setup(){const t=F(!0),e=F(null),o=F(""),n=async()=>{try{t.value=!0,e.value=null;const s=await X.get("/woolentoropt/v1/sidebar-content",{params:{nonce:woolentorOptions.verifynonce}});s?.data?.content&&(o.value=s.data.content)}catch(s){e.value="Failed to load sidebar content. Please try again.",console.error("Sidebar fetch error:",s)}finally{t.value=!1}};return it(()=>{n()}),{loading:t,error:e,sidebarContent:o,fetchSidebarContent:n}}},kr={key:0,class:"woolentor-sidebar-loading"},Rr={key:1,class:"woolentor-sidebar-error"},Pr=["innerHTML"];function Mr(t,e,o,n,s,i){const a=ei;return p(),y("div",{class:x(`woolentor-sidebar-wrapper ${n.loading?"is-loading":""}`)},[n.loading?(p(),y("div",kr,[c(a)])):n.error?(p(),y("div",Rr,[l("p",null,A(n.error),1),l("button",{onClick:e[0]||(e[0]=(...r)=>n.fetchSidebarContent&&n.fetchSidebarContent(...r)),class:"retry-btn"}," Retry ")])):(p(),y("div",{key:2,class:"woolentor-sidebar-content",innerHTML:n.sidebarContent},null,8,Pr))],2)}const Gr=M(xr,[["render",Mr],["__scopeId","data-v-5d0b5fae"]]),Fr={name:"save-button",computed:{...Se(["GET_SAVE_BUTTON"]),saveButton:{get(){return this.GET_SAVE_BUTTON}}},methods:{buttonClass(){return[`button button-primary button-primary woolentor-opt-submit ${this.saveButton.class!==""?this.saveButton.class:""}`,this.GET_SAVE_BUTTON.disabled==!0?"disabled":""]}}},Vr=["disabled"];function Ur(t,e,o,n,s,i){return p(),y("button",{type:"submit",class:x(i.buttonClass()),disabled:i.saveButton.disabled},A(i.saveButton.text),11,Vr)}const Si=M(Fr,[["render",Ur],["__scopeId","data-v-f4ee3bf8"]]),Br={name:"NotificationDrawer",props:{modelValue:{type:Boolean,required:!0}},emits:["update:modelValue"],data(){return{isInitialLoad:!0}},computed:{...Se(["GET_CHANGELOG","GET_CHANGELOG_LOADING","GET_CHANGELOG_READ"]),visible:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}},changelogData(){return this.GET_CHANGELOG},isLoading(){return this.GET_CHANGELOG_LOADING},isRead(){return this.GET_CHANGELOG_READ}},watch:{visible:{immediate:!0,async handler(t){t&&this.isInitialLoad&&(await this.FETCH_CHANGELOG(),this.isInitialLoad=!1)}}},methods:{...Fe(["FETCH_CHANGELOG","MARK_CHANGELOG_READ"]),async handleClose(){this.visible=!1,!this.isRead&&await this.MARK_CHANGELOG_READ()}}},zr={class:"version-header"},Hr={class:"release-date"},jr={class:"changelog-details"};function $r(t,e,o,n,s,i){const a=Ps,r=on,f=qn,d=sn;return p(),w(f,{modelValue:i.visible,"onUpdate:modelValue":e[0]||(e[0]=u=>i.visible=u),title:"Changelog",direction:"rtl",size:"500px","before-close":i.handleClose,class:"woolentor-notification-drawer"},{header:m(()=>e[1]||(e[1]=[l("h3",{class:"drawer-title"},"What's New in ShopLentor",-1)])),default:m(()=>[c(r,{height:"calc(100vh - 150px)"},{default:m(()=>[be((p(),y("div",{class:x({"changelog-content":!0,loading:i.isLoading})},[i.changelogData?(p(!0),y(B,{key:0},ee(i.changelogData,(u,g)=>(p(),y("div",{key:g,class:"changelog-item"},[l("div",zr,[l("h4",null,"Version "+A(u.version),1),l("span",Hr,A(u.date),1)]),l("div",jr,[u.changes?(p(!0),y(B,{key:0},ee(u.changes,(_,v)=>(p(),y("div",{key:v,class:"change-type"},[l("h5",null,A(v)+":",1),l("ul",null,[(p(!0),y(B,null,ee(_,(h,b)=>(p(),y("li",{key:b},A(h),1))),128))])]))),128)):C("",!0)])]))),128)):(p(),w(a,{key:1,description:"No changelog available"}))],2)),[[d,i.isLoading]])]),_:1})]),_:1},8,["modelValue","before-close"])}const Ai=M(Br,[["render",$r],["__scopeId","data-v-ffdab427"]]),Wr={SAVE_SETTINGS:({commit:t},e)=>new Promise((o,n)=>{t("SETLOADER"),e[2]?t("SAVING_MODULE_BUTTON_CONTROL",{text:woolentorOptions.labels.saveButton.saving,class:"updating-message",disabled:!0}):t("SAVING_BUTTON_CONTROL",{text:woolentorOptions.labels.saveButton.saving,class:"updating-message",disabled:!0}),X.post("/woolentoropt/v1/settings",{settings:e[0],section:e[1],subsection:e[2]?e[2]:""}).then(s=>{e[2]?t("SAVING_MODULE_BUTTON_CONTROL",{text:woolentorOptions.labels.saveButton.saved,class:"",disabled:!0}):t("SAVING_BUTTON_CONTROL",{text:woolentorOptions.labels.saveButton.saved,class:"",disabled:!0}),t("REMOVELOADER"),o(s)}).catch(s=>{console.log(s),n(s)})}),SAVE_DEPENDENCY_SETTINGS:async({commit:t},e)=>new Promise((o,n)=>{t("SETLOADER"),t("SAVING_MODULE_BUTTON_CONTROL",{text:woolentorOptions.labels.saveButton.saving,class:"updating-message",disabled:!0}),X.post("/woolentoropt/v1/settings/dependelement",{settings:e[0],section:e[1]}).then(s=>{t("SAVING_MODULE_BUTTON_CONTROL",{text:woolentorOptions.labels.saveButton.saved,class:"",disabled:!0}),t("REMOVELOADER"),o(s)}).catch(s=>{console.log(s),n(s)})}),SAVE_GROUP_SETTINGS:async({commit:t},e)=>new Promise((o,n)=>{t("SET_GROUP_SETTING_LOADER",{groupId:e[1],isLoading:!0}),X.post("/woolentoropt/v1/settings/group",{settings:e[0],group:e[1],parentId:e[2]}).then(s=>{t("SET_GROUP_SETTING_LOADER",{groupId:e[1],isLoading:!1}),o(s)}).catch(s=>{n(s)})}),FETCH_SETTINGS:({commit:t},e)=>new Promise((o,n)=>{t("SETLOADER"),X.get("/woolentoropt/v1/settings",{params:{section:e[1],nonce:woolentorOptions.verifynonce}}).then(s=>{t("REMOVELOADER"),t("SET_SETTINGS",s.data),o(s)}).catch(s=>{console.log(s),n(s)})}),FETCH_SETTINGS_DATA:async({commit:t},e)=>new Promise((o,n)=>{t("SETLOADER"),X.get("/woolentoropt/v1/settings",{params:{section:e[1],nonce:woolentorOptions.verifynonce}}).then(s=>{t("SET_SETTINGS",s.data),t("REMOVELOADER"),o(s.data)}).catch(s=>{t("REMOVELOADER"),t("SET_ERROR",s.message||"Failed to fetch settings"),n(s)})}),RESET_SETTINGS:({commit:t},e)=>new Promise((o,n)=>{e[2]?t("RESETING_MODULE_BUTTON_CONTROL",{text:woolentorOptions.labels.resetButton.reseting,class:"updating-message",disabled:!0}):t("RESETING_BUTTON_CONTROL",{text:woolentorOptions.labels.resetButton.reseting,class:"updating-message",disabled:!0}),X.post("/woolentoropt/v1/settings",{settings:e[0],section:e[1],reset:!0}).then(s=>{e[2]?t("RESETING_MODULE_BUTTON_CONTROL",{text:woolentorOptions.labels.resetButton.reseted,class:"",disabled:!0}):t("RESETING_BUTTON_CONTROL",{text:woolentorOptions.labels.resetButton.reseted,class:"",disabled:!0}),o(s)}).catch(s=>{console.log(s),n(s)})}),FETCH_LICENSE_INFO:({commit:t},e)=>(t("SET_LICENSE_LOADING",!0),new Promise((o,n)=>{Ln.get("/admin-post.php",{params:{action:"WooLentorPro_el_"+e[0],_wpnonce:woolentorOptions.licenseNonce}}).then(s=>{t("SET_LICENSE_INFO",s.data),o(s.data),t("SET_LICENSE_LOADING",!1)}).catch(s=>{console.error("Error fetching license info:",s),n(s),t("SET_LICENSE_LOADING",!1)})})),ACTIVATE_LICENSE:({commit:t},e)=>{t("SET_LICENSE_ACTIVATING",!0);const o=new FormData;return o.append("action","WooLentorPro_el_"+e[0]),o.append("_wpnonce",woolentorOptions.licenseNonce),o.append("el_license_key",e[1]),o.append("el_license_email",e[2]),new Promise((n,s)=>{Ln.post("/admin-post.php",o,{headers:{"Content-Type":"multipart/form-data"}}).then(i=>{t("SET_LICENSE_INFO",i.data),n(i.data),t("SET_LICENSE_ACTIVATING",!1)}).catch(i=>{t("SET_LICENSE_ACTIVATING",!1),s(i)})})},DEACTIVATE_LICENSE:({commit:t},e)=>{t("SET_LICENSE_DEACTIVATING",!0);const o=new FormData;return o.append("action","WooLentorPro_el_"+e[0]),o.append("_wpnonce",woolentorOptions.licenseNonce),new Promise((n,s)=>{Ln.post("/admin-post.php",o,{headers:{"Content-Type":"multipart/form-data"}}).then(i=>{t("SET_LICENSE_DEACTIVATING",!1),t("SET_LICENSE_INFO",{}),n(i.data)}).catch(i=>{t("SET_LICENSE_DEACTIVATING",!1),s(i)})})},FETCH_CHANGELOG:({commit:t})=>(t("SET_CHANGELOG_LOADING",!0),new Promise((e,o)=>{X.get("/woolentoropt/v1/changelog").then(n=>{if(n?.data?.success)t("SET_CHANGELOG",n.data.data),e(n.data.data);else throw new Error("Invalid response format")}).catch(n=>{console.error("Error fetching changelog:",n),o(n)}).finally(()=>{t("SET_CHANGELOG_LOADING",!1)})})),MARK_CHANGELOG_READ:({commit:t})=>new Promise((e,o)=>{X.post("/woolentoropt/v1/changelog/mark-read").then(n=>{if(n?.data?.success)t("SET_CHANGELOG_READ",!0),e(n.data);else throw new Error("Invalid response format")}).catch(n=>{console.error("Error marking changelog as read:",n),o(n)})}),CHECK_NOTIFICATION_STATUS:({commit:t})=>new Promise((e,o)=>{X.get("/woolentoropt/v1/changelog/status").then(n=>{if(n?.data?.success)t("SET_NOTIFICATION_STATUS",n.data.data),e(n.data.data);else throw new Error("Invalid response format")}).catch(n=>{console.error("Error checking notification status:",n),o(n)})}),FETCH_ABANDONED_CART_DATA:({dispatch:t},e)=>t("abandonedCart/FETCH_ABANDONED_CARTS",e,{root:!0}),CALL_API:({commit:t},{method:e,url:o,data:n,params:s})=>new Promise((i,a)=>{X({method:e.toLowerCase(),url:o,data:n,params:s}).then(f=>{i(f)}).catch(f=>{console.error("API Error:",f),a(f)})}),REMOVE_LOADER:({commit:t},e)=>{t("REMOVELOADER")},SAVE_BUTTON_CONTROL:({commit:t},e)=>{t("SAVING_BUTTON_CONTROL",e)},SAVE_MODULE_BUTTON_CONTROL:({commit:t},e)=>{t("SAVING_MODULE_BUTTON_CONTROL",e)},RESET_BUTTON_CONTROL:({commit:t},e)=>{t("RESETING_BUTTON_CONTROL",e)},RESET_MODULE_BUTTON_CONTROL:({commit:t},e)=>{t("RESETING_MODULE_BUTTON_CONTROL",e)},SET_MODULE_SETTING_LOADER:({commit:t},{moduleId:e,isLoading:o})=>{t("SET_MODULE_SETTING_LOADER",{moduleId:e,isLoading:o})}},qr={GET_SETTINGS:t=>t.settings,GET_SAVE_BUTTON:t=>t.saveButton,GET_MODULE_SAVE_BUTTON:t=>t.saveModuleButton,GET_RESET_BUTTON:t=>t.resetButton,GET_RESET_MODULE_BUTTON:t=>t.resetModuleButton,GET_LOADER:t=>t.loaderClass,GET_MODULE_SETTING_LOADER:t=>e=>t.moduleSettingLoader[e]||!1,GET_GROUP_SETTING_LOADER:t=>e=>t.groupSettingLoader[e]||!1,GET_LICENSE_INFO:t=>t.licenseInfo||{},GET_LICENSE_LOADING:t=>t.licenseLoading,GET_LICENSE_ACTIVATING:t=>t.licenseActivating,GET_LICENSE_DEACTIVATING:t=>t.licenseDeactivating,GET_CHANGELOG:t=>t.changelog||[],GET_CHANGELOG_LOADING:t=>t.changelogLoading,GET_NOTIFICATION_STATUS:t=>t.notificationStatus,HAS_UNREAD_NOTIFICATIONS:t=>t.notificationStatus?.has_unread||!1,GET_CHANGELOG_READ:t=>t.changelogRead},Kr={namespaced:!0,state:{carts:[],cartsTotal:0,cartsPages:1,cartsLoading:!1,cartsSearching:!1,selectedCarts:[],filters:{status:"all",dateFrom:null,dateTo:null,search:""},pagination:{currentPage:1,perPage:20},emailTemplates:[],emailTemplatesLoading:!1,templateCreating:!1,templateUpdating:!1,analytics:{totalAbandoned:0,totalRecovered:0,recoveredRevenue:0,recoveryRate:0},analyticsLoading:!1,settings:{},settingsLoading:!1,settingsSaving:!1,cartDetails:null,cartDetailsLoading:!1,bulkActionLoading:!1,error:null,lastAction:null},getters:{GET_CARTS:t=>t.carts,GET_CARTS_TOTAL:t=>t.cartsTotal,GET_CARTS_PAGES:t=>t.cartsPages,GET_CARTS_LOADING:t=>t.cartsLoading,GET_CARTS_SEARCHING:t=>t.cartsSearching,GET_SELECTED_CARTS:t=>t.selectedCarts,GET_FILTERS:t=>t.filters,GET_PAGINATION:t=>t.pagination,GET_EMAIL_TEMPLATES:t=>t.emailTemplates,GET_EMAIL_TEMPLATES_LOADING:t=>t.emailTemplatesLoading,GET_TEMPLATE_CREATING:t=>t.templateCreating,GET_TEMPLATE_UPDATING:t=>t.templateUpdating,GET_ANALYTICS:t=>t.analytics,GET_ANALYTICS_LOADING:t=>t.analyticsLoading,GET_SETTINGS:t=>t.settings,GET_SETTINGS_LOADING:t=>t.settingsLoading,GET_SETTINGS_SAVING:t=>t.settingsSaving,GET_CART_DETAILS:t=>t.cartDetails,GET_CART_DETAILS_LOADING:t=>t.cartDetailsLoading,GET_BULK_ACTION_LOADING:t=>t.bulkActionLoading,GET_ERROR:t=>t.error,GET_LAST_ACTION:t=>t.lastAction,GET_FILTERED_CARTS:t=>{let e=t.carts;if(t.filters.status&&t.filters.status!=="all"&&(e=e.filter(o=>o.status===t.filters.status)),t.filters.dateFrom){const o=new Date(t.filters.dateFrom);e=e.filter(n=>new Date(n.created_at)>=o)}if(t.filters.dateTo){const o=new Date(t.filters.dateTo);o.setHours(23,59,59,999),e=e.filter(n=>new Date(n.created_at)<=o)}return e},GET_CART_STATS:t=>{const e=t.carts.filter(s=>s.status==="abandoned").length,o=t.carts.filter(s=>s.status==="recovered").length,n=t.carts.length;return{abandoned:e,recovered:o,total:n,recoveryRate:n>0?(o/n*100).toFixed(2):0}}},mutations:{SET_CARTS:(t,e)=>{t.carts=e.carts||[],t.cartsTotal=e.total||0,t.cartsPages=e.pages||1},SET_CARTS_LOADING:(t,e)=>{t.cartsLoading=e},SET_CARTS_SEARCHING:(t,e)=>{t.cartsSearching=e},SET_SELECTED_CARTS:(t,e)=>{t.selectedCarts=e},ADD_SELECTED_CART:(t,e)=>{t.selectedCarts.includes(e)||t.selectedCarts.push(e)},REMOVE_SELECTED_CART:(t,e)=>{t.selectedCarts=t.selectedCarts.filter(o=>o!==e)},CLEAR_SELECTED_CARTS:t=>{t.selectedCarts=[]},SET_FILTERS:(t,e)=>{t.filters={...t.filters,...e}},RESET_FILTERS:t=>{t.filters={status:"all",dateFrom:null,dateTo:null,search:""}},SET_PAGINATION:(t,e)=>{t.pagination={...t.pagination,...e}},SET_EMAIL_TEMPLATES:(t,e)=>{t.emailTemplates=e},SET_EMAIL_TEMPLATES_LOADING:(t,e)=>{t.emailTemplatesLoading=e},SET_TEMPLATE_CREATING:(t,e)=>{t.templateCreating=e},SET_TEMPLATE_UPDATING:(t,e)=>{t.templateUpdating=e},ADD_EMAIL_TEMPLATE:(t,e)=>{t.emailTemplates.push(e)},UPDATE_EMAIL_TEMPLATE:(t,{id:e,template:o})=>{const n=t.emailTemplates.findIndex(s=>s.id===e);n!==-1&&t.emailTemplates.splice(n,1,o)},REMOVE_EMAIL_TEMPLATE:(t,e)=>{t.emailTemplates=t.emailTemplates.filter(o=>o.id!==e)},SET_ANALYTICS:(t,e)=>{t.analytics={...t.analytics,...e}},SET_ANALYTICS_LOADING:(t,e)=>{t.analyticsLoading=e},SET_SETTINGS:(t,e)=>{t.settings={...t.settings,...e}},SET_SETTINGS_LOADING:(t,e)=>{t.settingsLoading=e},SET_SETTINGS_SAVING:(t,e)=>{t.settingsSaving=e},SET_CART_DETAILS:(t,e)=>{t.cartDetails=e},SET_CART_DETAILS_LOADING:(t,e)=>{t.cartDetailsLoading=e},SET_BULK_ACTION_LOADING:(t,e)=>{t.bulkActionLoading=e},REMOVE_CART:(t,e)=>{t.carts=t.carts.filter(o=>o.id!==e),t.cartsTotal=Math.max(0,t.cartsTotal-1)},UPDATE_CART:(t,{cartId:e,updates:o})=>{const n=t.carts.findIndex(s=>s.id===e);n!==-1&&t.carts.splice(n,1,{...t.carts[n],...o})},REMOVE_MULTIPLE_CARTS:(t,e)=>{t.carts=t.carts.filter(o=>!e.includes(o.id)),t.cartsTotal=Math.max(0,t.cartsTotal-e.length)},SET_ERROR:(t,e)=>{t.error=e},CLEAR_ERROR:t=>{t.error=null},SET_LAST_ACTION:(t,e)=>{t.lastAction=e}},actions:{FETCH_ABANDONED_CARTS:async({commit:t,state:e},o={})=>{t("SET_CARTS_LOADING",!0),t("SET_LAST_ACTION","FETCH_ABANDONED_CARTS"),t("CLEAR_ERROR");try{const n={page:e.pagination.currentPage,per_page:e.pagination.perPage,status:e.filters.status,...o};e.filters.dateFrom&&(n.date_from=new Date(e.filters.dateFrom).toLocaleDateString("en-CA").split("T")[0]),e.filters.dateTo&&(n.date_to=new Date(e.filters.dateTo).toLocaleDateString("en-CA").split("T")[0]);const s=await X.get("/woolentor/v1/abandoned-cart/carts",{params:n});return t("SET_CARTS",s.data.data),t("SET_CARTS_LOADING",!1),s.data}catch(n){throw t("SET_ERROR",n.message||"Failed to fetch abandoned carts"),t("SET_CARTS_LOADING",!1),n}},SET_CARTS_FROM_CACHE:({commit:t},e)=>{t("SET_CARTS",e)},SEARCH_CARTS:async({commit:t,state:e},o,n={})=>{if(!(!o||!o.trim())){t("SET_CARTS_SEARCHING",!0),t("SET_LAST_ACTION","SEARCH_CARTS"),t("CLEAR_ERROR");try{const s=await X.get("/woolentor/v1/abandoned-cart/carts/search",{params:{search:o.trim(),page:e.pagination.currentPage,per_page:e.pagination.perPage,status:e.filters.status,...n}});return t("SET_CARTS",s.data.data),t("SET_CARTS_SEARCHING",!1),s.data}catch(s){throw t("SET_ERROR",s.message||"Failed to search carts"),t("SET_CARTS_SEARCHING",!1),s}}},FETCH_CART_DETAILS:async({commit:t},e)=>{t("SET_CART_DETAILS_LOADING",!0),t("SET_LAST_ACTION","FETCH_CART_DETAILS"),t("CLEAR_ERROR");try{const o=await X.get(`/woolentor/v1/abandoned-cart/carts/${e}`);return t("SET_CART_DETAILS",o.data),t("SET_CART_DETAILS_LOADING",!1),o.data}catch(o){throw t("SET_ERROR",o.message||"Failed to fetch cart details"),t("SET_CART_DETAILS_LOADING",!1),o}},DELETE_CART:async({commit:t},e)=>{t("SET_LAST_ACTION","DELETE_CART"),t("CLEAR_ERROR");try{return await X.delete(`/woolentor/v1/abandoned-cart/carts/${e}`),t("REMOVE_CART",e),t("REMOVE_SELECTED_CART",e),{success:!0,message:"Cart deleted successfully"}}catch(o){throw t("SET_ERROR",o.message||"Failed to delete cart"),o}},SEND_RECOVERY_EMAIL:async({commit:t},e)=>{t("SET_LAST_ACTION","SEND_RECOVERY_EMAIL"),t("CLEAR_ERROR");try{return(await X.post(`/woolentor/v1/abandoned-cart/carts/${e}/send-email`)).data}catch(o){throw t("SET_ERROR",o.message||"Failed to send recovery email"),o}},BULK_ACTION:async({commit:t,state:e},{action:o,cartIds:n})=>{t("SET_BULK_ACTION_LOADING",!0),t("SET_LAST_ACTION","BULK_ACTION"),t("CLEAR_ERROR");try{const s=await X.post("/woolentor/v1/abandoned-cart/carts/bulk",{action:o,cart_ids:n||e.selectedCarts}),i=n||e.selectedCarts;switch(o){case"delete":t("REMOVE_MULTIPLE_CARTS",i);break;case"unsubscribe":i.forEach(a=>{t("UPDATE_CART",{cartId:a,updates:{unsubscribed:"1"}})});break}return t("CLEAR_SELECTED_CARTS"),t("SET_BULK_ACTION_LOADING",!1),s.data}catch(s){throw t("SET_ERROR",s.message||"Failed to perform bulk action"),t("SET_BULK_ACTION_LOADING",!1),s}},FETCH_EMAIL_TEMPLATES:async({commit:t,state:e},o={})=>{t("SET_EMAIL_TEMPLATES_LOADING",!0),t("SET_LAST_ACTION","FETCH_EMAIL_TEMPLATES"),t("CLEAR_ERROR");try{const n={page:e.pagination.currentPage,per_page:e.pagination.perPage,status:e.filters.status,...o},s=await X.get("/woolentor/v1/abandoned-cart/email-templates",{params:n});return t("SET_EMAIL_TEMPLATES",s.data?.data?.templates||[]),t("SET_EMAIL_TEMPLATES_LOADING",!1),s.data}catch(n){throw t("SET_ERROR",n.message||"Failed to fetch email templates"),t("SET_EMAIL_TEMPLATES_LOADING",!1),n}},CREATE_EMAIL_TEMPLATE:async({commit:t},e)=>{t("SET_TEMPLATE_CREATING",!0),t("SET_LAST_ACTION","CREATE_EMAIL_TEMPLATE"),t("CLEAR_ERROR");try{const o=await X.post("/woolentor/v1/abandoned-cart/email-templates",e);return t("ADD_EMAIL_TEMPLATE",o.data),t("SET_TEMPLATE_CREATING",!1),o.data}catch(o){throw t("SET_ERROR",o.message||"Failed to create email template"),t("SET_TEMPLATE_CREATING",!1),o}},UPDATE_EMAIL_TEMPLATE:async({commit:t},{id:e,templateData:o})=>{t("SET_TEMPLATE_UPDATING",!0),t("SET_LAST_ACTION","UPDATE_EMAIL_TEMPLATE"),t("CLEAR_ERROR");try{const n=await X.put(`/woolentor/v1/abandoned-cart/email-templates/${e}`,o);return t("UPDATE_EMAIL_TEMPLATE",{id:e,template:n.data}),t("SET_TEMPLATE_UPDATING",!1),n.data}catch(n){throw t("SET_ERROR",n.message||"Failed to update email template"),t("SET_TEMPLATE_UPDATING",!1),n}},DELETE_EMAIL_TEMPLATE:async({commit:t},e)=>{t("SET_LAST_ACTION","DELETE_EMAIL_TEMPLATE"),t("CLEAR_ERROR");try{return await X.delete(`/woolentor/v1/abandoned-cart/email-templates/${e}`),t("REMOVE_EMAIL_TEMPLATE",e),{success:!0,message:"Template deleted successfully"}}catch(o){throw t("SET_ERROR",o.message||"Failed to delete email template"),o}},FETCH_ANALYTICS:async({commit:t},e={})=>{t("SET_ANALYTICS_LOADING",!0),t("SET_LAST_ACTION","FETCH_ANALYTICS"),t("CLEAR_ERROR");try{const o=await X.get("/woolentor/v1/abandoned-cart/analytics",{params:e});return t("SET_ANALYTICS",o.data),t("SET_ANALYTICS_LOADING",!1),o.data}catch(o){throw t("SET_ERROR",o.message||"Failed to fetch analytics"),t("SET_ANALYTICS_LOADING",!1),o}},SET_ANALYTICS:({commit:t},e)=>{t("SET_ANALYTICS",e)},FETCH_ABANDONED_CART_SETTINGS:async({commit:t})=>{t("SET_SETTINGS_LOADING",!0),t("SET_LAST_ACTION","FETCH_ABANDONED_CART_SETTINGS"),t("CLEAR_ERROR");try{const e=await X.get("/woolentor/v1/abandoned-cart/settings");return t("SET_SETTINGS",e.data),t("SET_SETTINGS_LOADING",!1),e.data}catch(e){throw t("SET_ERROR",e.message||"Failed to fetch settings"),t("SET_SETTINGS_LOADING",!1),e}},SAVE_ABANDONED_CART_SETTINGS:async({commit:t},e)=>{t("SET_SETTINGS_SAVING",!0),t("SET_LAST_ACTION","SAVE_ABANDONED_CART_SETTINGS"),t("CLEAR_ERROR");try{const o=await X.post("/woolentor/v1/abandoned-cart/settings",e);return t("SET_SETTINGS",o.data),t("SET_SETTINGS_SAVING",!1),o.data}catch(o){throw t("SET_ERROR",o.message||"Failed to save settings"),t("SET_SETTINGS_SAVING",!1),o}},UPDATE_FILTERS:({commit:t,dispatch:e},o)=>{t("SET_FILTERS",o)},UPDATE_PAGINATION:({commit:t,dispatch:e},o)=>{t("SET_PAGINATION",o)},SELECT_CART:({commit:t},e)=>{t("ADD_SELECTED_CART",e)},DESELECT_CART:({commit:t},e)=>{t("REMOVE_SELECTED_CART",e)},SELECT_ALL_CARTS:({commit:t,state:e})=>{const o=e.carts.map(n=>n.id);t("SET_SELECTED_CARTS",o)},DESELECT_ALL_CARTS:({commit:t})=>{t("CLEAR_SELECTED_CARTS")},CLEAR_ERROR:({commit:t})=>{t("CLEAR_ERROR")},RESET_FILTERS:({commit:t,dispatch:e})=>{t("RESET_FILTERS"),t("SET_PAGINATION",{currentPage:1})},SET_SETTINGS_LOADING:({commit:t},e)=>{t("SET_SETTINGS_LOADING",e)}}},Yr={namespaced:!0,state:{currentStep:1,completedSteps:[],settings:{editorChoice:"both",userType:"starter",modules:{},email:woolentorOptions?.onboarding?.admin_email||"",consent:!0,plugins:{}},isCompleting:!1,lastAppliedUserType:null,finalizing:{active:!1,completed:!1,tasks:[]}},getters:{getCurrentStep:t=>t.currentStep,getCompletedSteps:t=>t.completedSteps,isStepCompleted:t=>e=>t.completedSteps.includes(e),getOnboardingSettings:t=>t.settings,isCompleting:t=>t.isCompleting,getLastAppliedUserType:t=>t.lastAppliedUserType,getFinalizing:t=>t.finalizing,getFinalizingProgress:t=>{const e=t.finalizing.tasks;if(e.length===0)return 0;const o=e.filter(n=>n.status==="completed"||n.status==="failed").length;return Math.round(o/e.length*100)}},mutations:{SET_ONBOARDING_STEP(t,e){t.currentStep=e},COMPLETE_ONBOARDING_STEP(t,e){t.completedSteps.includes(e)||t.completedSteps.push(e),t.currentStep=e+1},BACK_ONBOARDING_STEP(t){t.currentStep>1&&(t.currentStep-=1)},UPDATE_ONBOARDING_SETTINGS(t,e){t.settings={...t.settings,...e}},SET_ONBOARDING_COMPLETING(t,e){t.isCompleting=e},SET_LAST_APPLIED_USER_TYPE(t,e){t.lastAppliedUserType=e},INIT_FINALIZING(t,e){t.finalizing={active:!0,completed:!1,tasks:e.map(o=>({...o,status:"pending"}))}},UPDATE_TASK_STATUS(t,{taskId:e,status:o}){const n=t.finalizing.tasks.find(s=>s.id===e);n&&(n.status=o)},SET_FINALIZING_COMPLETED(t){t.finalizing.completed=!0},RESET_FINALIZING(t){t.finalizing={active:!1,completed:!1,tasks:[]}}},actions:{setOnboardingStep({commit:t},e){t("SET_ONBOARDING_STEP",e)},completeOnboardingStep({commit:t},e){t("COMPLETE_ONBOARDING_STEP",e)},backOnboardingStep({commit:t}){t("BACK_ONBOARDING_STEP")},updateOnboardingSettings({commit:t},e){t("UPDATE_ONBOARDING_SETTINGS",e)},setLastAppliedUserType({commit:t},e){t("SET_LAST_APPLIED_USER_TYPE",e)},async skipOnboarding({commit:t}){t("SET_ONBOARDING_COMPLETING",!0);try{return await X.post("/woolentoropt/v1/onboarding/skip"),woolentorOptions.onboarding.status=!0,!0}catch(e){throw console.error("Failed to skip onboarding:",e),e}finally{t("SET_ONBOARDING_COMPLETING",!1)}},async completeOnboarding({commit:t,state:e}){t("SET_ONBOARDING_COMPLETING",!0);const o=woolentorOptions?.onboarding?.plugins||[],n=Object.entries(e.settings.plugins).filter(([,i])=>i).map(([i])=>i),s=[{id:"save_config",label:"Saving Configurations"}];n.forEach(i=>{const a=o.find(r=>r.slug===i);s.push({id:`plugin_${i}`,label:a?`Activating ${a.name}`:`Activating ${i}`})}),t("INIT_FINALIZING",s);try{t("UPDATE_TASK_STATUS",{taskId:"save_config",status:"in_progress"});const i=woolentorOptions?.onboarding?.modules||[],a=Object.entries(e.settings.modules).map(([r,f])=>{const d=i.find(u=>u.section===r)?i.find(u=>u.section===r):i.find(u=>u.id===r&&u.section===void 0);if(d!==void 0)return{id:d?.id,enabled:f,section:d?.section||"woolentor_others_tabs"}});if(await X.post("/woolentoropt/v1/onboarding/complete",{editor_choice:e.settings.editorChoice,user_type:e.settings.userType,email:e.settings.email,consent:e.settings.consent,modules:a}),t("UPDATE_TASK_STATUS",{taskId:"save_config",status:"completed"}),n.length>0){const f=(await X.get("/woolentoropt/v1/plugins-status",{params:{plugins:n.join(","),nonce:woolentorOptions.verifynonce}})).data?.plugins||[];for(const d of f){const u=`plugin_${d.slug}`;t("UPDATE_TASK_STATUS",{taskId:u,status:"in_progress"});try{d.status==="not_installed"?(await X.post("/woolentoropt/v1/install-plugin",{slug:d.slug,nonce:woolentorOptions.verifynonce}),await X.post("/woolentoropt/v1/activate-plugin",{slug:d.slug,nonce:woolentorOptions.verifynonce})):d.status==="inactive"&&await X.post("/woolentoropt/v1/activate-plugin",{slug:d.slug,nonce:woolentorOptions.verifynonce}),t("UPDATE_TASK_STATUS",{taskId:u,status:"completed"})}catch(g){console.error(`Failed to install/activate: ${d.slug}`,g),t("UPDATE_TASK_STATUS",{taskId:u,status:"failed"})}}}return t("SET_FINALIZING_COMPLETED"),woolentorOptions.onboarding.status=!0,!0}catch(i){throw console.error("Failed to complete onboarding:",i),t("SET_FINALIZING_COMPLETED"),woolentorOptions.onboarding.status=!0,i}finally{t("SET_ONBOARDING_COMPLETING",!1)}}}},K={cache:new Map,durations:new Map,DEFAULT_DURATION:5*60*1e3,get(t){const e=this.cache.get(t);if(!e)return null;const{data:o,timestamp:n}=e,s=Date.now(),i=this.durations.get(t)||this.DEFAULT_DURATION;return s-n>i?(this.invalidate(t),null):o},set(t,e,o={}){if(this.cache.set(t,{data:e,timestamp:Date.now()}),o.duration){const n=o.duration*60*1e3;this.durations.set(t,n)}},remove(t){this.cache.delete(t)},removeAll(){this.cache.clear()},getStatus(t){const e=this.cache.get(t);if(!e)return{isValid:!1,remaining:0};const o=Date.now(),n=this.durations.get(t)||this.DEFAULT_DURATION,s=o-e.timestamp,i=n-s;return{isValid:i>0,remaining:Math.max(0,Math.ceil(i/1e3)),duration:n/1e3}},invalidate(t){t?(this.cache.delete(t),this.durations.delete(t)):(this.cache.clear(),this.durations.clear())},updateDuration(t,e){if(!this.cache.has(t))return!1;const o=e*60*1e3;return this.durations.set(t,o),!0},getDuration(t){return(this.durations.get(t)||this.DEFAULT_DURATION)/(60*1e3)}},_n="templateLibrary",yn="gutenbergTemplateLibrary",vn=6e3;class Jr{constructor(){this.initialized=!1,this.gutenbergInitialized=!1}async init(){this.initialized||(await this.fetchTemplates(),this.initialized=!0)}async fetchTemplates(){try{const e=K.get(_n);if(e)return Ne.commit("template/SET_TEMPLATES",e),e;const o=await Ne.dispatch("template/FETCH_TEMPLATES");return o?.data?(K.set(_n,o,{duration:vn}),o):(K.set(_n,{templates:[],categories:[]},{duration:vn}),{templates:[],categories:[]})}catch(e){return console.error("Error fetching templates:",e),{templates:[],categories:[]}}}async initGutenberg(){this.gutenbergInitialized||(await this.fetchGutenbergTemplates(),this.gutenbergInitialized=!0)}async fetchGutenbergTemplates(){try{const e=K.get(yn);if(e)return Ne.commit("template/SET_GUTENBERG_TEMPLATES",e),e;const o=await Ne.dispatch("template/FETCH_GUTENBERG_TEMPLATES");return o?.data?(K.set(yn,o,{duration:vn}),o):(K.set(yn,{templates:[],categories:[]},{duration:vn}),{templates:[],categories:[]})}catch(e){return console.error("Error fetching Gutenberg templates:",e),{templates:[],categories:[]}}}async refreshGutenbergTemplates(){return this.clearGutenbergCache(),await this.fetchGutenbergTemplates()}clearGutenbergCache(){K.invalidate(yn),this.gutenbergInitialized=!1}async importTemplate(e,o){try{return await Ne.dispatch("template/IMPORT_TEMPLATE",[e,o])}catch(n){throw console.error("Error importing template:",n),n}}async refreshTemplates(){return this.clearCache(),await this.fetchTemplates()}isLoading(){return Ne.getters["template/GET_TEMPLATES_LOADING"]}clearCache(){K.invalidate(_n),this.initialized=!1}getTemplates(){return Ne.getters["template/GET_TEMPLATES"]}getCategories(){return Ne.getters["template/GET_CATEGORIES"]}getAvailableDestinations(e,o){const n=this.getTemplateType(e),s=o?.includes("elementor");return["shop","single","cart","checkout","myaccount"].includes(n)?{builder:!0,library:!1,page:!1}:n==="popup"?{builder:!0,library:s,page:!1}:{builder:!0,library:s,page:!0}}getTemplateType(e){switch(e){case"Shop":return"shop";case"Product Details":return"single";case"Cart":return"cart";case"Checkout Page":return"checkout";case"My Account":return"myaccount";case"Popup Builder":return"popup";default:return"other"}}}const ut=new Jr,Xr={namespaced:!0,state:{templates:[],categories:[],gutenbergTemplates:[],gutenbergCategories:[],loading:!1,importing:!1,error:null},getters:{GET_TEMPLATES:t=>t.templates,GET_CATEGORIES:t=>t.categories,GET_GUTENBERG_TEMPLATES:t=>t.gutenbergTemplates,GET_GUTENBERG_CATEGORIES:t=>t.gutenbergCategories,GET_TEMPLATES_LOADING:t=>t.loading,GET_TEMPLATE_IMPORTING:t=>t.importing,GET_TEMPLATE_ERROR:t=>t.error},mutations:{SET_TEMPLATES:(t,e)=>{t.templates=e.templates||[],t.categories=e.categories||[]},SET_GUTENBERG_TEMPLATES:(t,e)=>{t.gutenbergTemplates=e.templates||[],t.gutenbergCategories=e.categories||[]},SET_TEMPLATES_LOADING:(t,e)=>{t.loading=e},SET_TEMPLATE_IMPORTING:(t,e)=>{t.importing=e},SET_TEMPLATE_ERROR:(t,e)=>{t.error=e}},actions:{FETCH_TEMPLATES:async({commit:t})=>{t("SET_TEMPLATES_LOADING",!0);try{const e=await X.get("/woolentoropt/v1/templates"),o=["No Category","Email Customizer"],s=(woolentorOptions?.isPro==="yes"?e.data?.templates?.map(r=>({...r,isPro:0})):e.data?.templates)?.filter(r=>!o.includes(r.shareId)),i=new Map;s.forEach(r=>{r.shareId&&(i.has(r.shareId)?i.get(r.shareId).count++:i.set(r.shareId,{id:r.shareId.toLowerCase().replace(/\s+/g,"-"),name:r.shareId,count:1,type:r.type,thumbnail:r.thumbnail}))});const a=Array.from(i.values());return t("SET_TEMPLATES",{templates:s,categories:a}),t("SET_TEMPLATES_LOADING",!1),{templates:s,categories:a}}catch(e){throw t("SET_TEMPLATE_ERROR",e.message||"Failed to fetch templates"),t("SET_TEMPLATES_LOADING",!1),e}},FETCH_GUTENBERG_TEMPLATES:async({commit:t})=>{t("SET_TEMPLATES_LOADING",!0);try{const e=await X.get("/woolentoropt/v1/templates/gutenberg"),o=["No Category","Email Customizer"],s=(woolentorOptions?.isPro==="yes"?e.data?.templates?.map(r=>({...r,isPro:0})):e.data?.templates)?.filter(r=>!o.includes(r.shareId)),i=new Map;s.forEach(r=>{r.shareId&&(i.has(r.shareId)?i.get(r.shareId).count++:i.set(r.shareId,{id:r.shareId.toLowerCase().replace(/\s+/g,"-"),name:r.shareId,count:1,type:r.type,thumbnail:r.thumbnail}))});const a=Array.from(i.values());return t("SET_GUTENBERG_TEMPLATES",{templates:s,categories:a}),t("SET_TEMPLATES_LOADING",!1),{templates:s,categories:a}}catch(e){throw t("SET_TEMPLATE_ERROR",e.message||"Failed to fetch Gutenberg templates"),t("SET_TEMPLATES_LOADING",!1),e}},IMPORT_TEMPLATE:async({commit:t},e)=>{t("SET_TEMPLATE_IMPORTING",!0);try{const o=e[0],n=e[1],s=n==="builder"?ut.getTemplateType(o.shareId):"other",i=o.builder.includes("elementor")?"elementor":"gutenberg",a=await X.post("/woolentoropt/v1/templates/import",{template_id:o.id,template_title:o.title,verifynonce:woolentorOptions?.verifynonce||"",template_type:s,parent_id:o.shareId,import_to:n,builder:i});return t("SET_TEMPLATE_IMPORTING",!1),a.data}catch(o){throw t("SET_TEMPLATE_ERROR",o.message||"Failed to import template"),t("SET_TEMPLATE_IMPORTING",!1),o}}}},Qr={SET_SETTINGS:(t,e)=>{t.settings=e},SAVING_BUTTON_CONTROL:(t,e)=>{t.saveButton=e},SAVING_MODULE_BUTTON_CONTROL:(t,e)=>{t.saveModuleButton=e},RESETING_BUTTON_CONTROL:(t,e)=>{t.resetButton=e},RESETING_MODULE_BUTTON_CONTROL:(t,e)=>{t.resetModuleButton=e},SETLOADER:t=>{t.loaderClass="option-loading"},REMOVELOADER:t=>{t.loaderClass="option-loaded"},SET_MODULE_SETTING_LOADER:(t,{moduleId:e,isLoading:o})=>{t.moduleSettingLoader={...t.moduleSettingLoader,[e]:o}},SET_GROUP_SETTING_LOADER:(t,{groupId:e,isLoading:o})=>{t.groupSettingLoader={...t.groupSettingLoader,[e]:o}},SET_LICENSE_INFO:(t,e)=>{t.licenseInfo=e},SET_LICENSE_LOADING:(t,e)=>{t.licenseLoading=e},SET_LICENSE_ACTIVATING:(t,e)=>{t.licenseActivating=e},SET_LICENSE_DEACTIVATING:(t,e)=>{t.licenseDeactivating=e},SET_CHANGELOG:(t,e)=>{t.changelog=e},SET_CHANGELOG_LOADING:(t,e)=>{t.changelogLoading=e},SET_CHANGELOG_READ:(t,e)=>{t.changelogRead=e},SET_NOTIFICATION_STATUS:(t,e)=>{t.notificationStatus=e}},Ne=ua({state:{settings:{},saveButton:{text:woolentorOptions.labels.saveButton.text,class:"",disabled:!0},saveModuleButton:{text:woolentorOptions.labels.saveButton.text,class:"",disabled:!0},resetButton:{text:woolentorOptions.labels.resetButton.text,class:"",disabled:!1},resetModuleButton:{text:woolentorOptions.labels.resetButton.text,class:"",disabled:!1},loaderClass:"option-loading",moduleSettingLoader:{},groupSettingLoader:{},changelog:null,changelogLoading:!1,changelogRead:!1,notificationStatus:null},actions:Wr,getters:qr,mutations:Qr,modules:{abandonedCart:Kr,onboarding:Yr,template:Xr}}),Rt="licenseInfo",po=6e3;class Zr{constructor(){this.initialized=!1}async init(){this.initialized||(await this.fetchLicenseInfo(),this.initialized=!0)}async fetchLicenseInfo(){try{const e=K.get(Rt);if(e)return Ne.commit("SET_LICENSE_INFO",e),e;const o=await Ne.dispatch("FETCH_LICENSE_INFO",["license_info"]);return o?.data?(K.set(Rt,o,{duration:po}),o):(K.set(Rt,{},{duration:po}),{})}catch(e){return console.error("Error fetching license info:",e),null}}async activateLicense(e,o){try{const n=await Ne.dispatch("ACTIVATE_LICENSE",["activate_license",e,o]);return n?.data?.is_valid&&K.set(Rt,n,{duration:po}),n}catch(n){throw console.error("Error activating license:",n),n}}async deactivateLicense(){try{const e=await Ne.dispatch("DEACTIVATE_LICENSE",["deactivate_license"]);return K.invalidate(Rt),e}catch(e){throw console.error("Error deactivating license:",e),e}}isLicenseValid(){return Ne.getters.GET_LICENSE_INFO?.data?.is_valid}isLoading(){return Ne.getters.GET_LICENSE_LOADING}clearCache(){K.invalidate(Rt),this.initialized=!1}getLicenseInfo(){return Ne.getters.GET_LICENSE_INFO}}const bn=new Zr;function Di(){const t=$n(),e=Q(()=>t.getters.GET_LICENSE_LOADING),o=Q(()=>t.getters.GET_LICENSE_ACTIVATING),n=Q(()=>t.getters.GET_LICENSE_DEACTIVATING),s=Q(()=>t.getters.GET_LICENSE_INFO),i=Q(()=>s.value?.data?.is_valid),a=F(null);return{isLoading:e,isActivating:o,isDeactivating:n,licenseInfo:s,isValid:i,error:a,initializeLicense:async()=>{try{await bn.init()}catch(u){a.value=u}},activateLicense:async(u,g)=>{a.value=null;try{return await bn.activateLicense(u,g)}catch(_){throw a.value=_,_}},deactivateLicense:async()=>{a.value=null;try{return await bn.deactivateLicense()}catch(u){throw a.value=u,u}},licenseService:bn}}const ec={name:"App",data(){return{items:[],isMainTab:Boolean,isFooter:Boolean,isSidebar:Boolean,activeIndex:F("/welcome"),success:!1,model:null,content:null,isLoading:!0,hasError:!1,errorMessage:"",isDataReady:!1,showNotifications:!1}},components:{SaveButton:Si,Lock:Ta,Unlock:wa,Bell:Ea,Loading:Kn,NotificationDrawer:Ai},setup(){const{initializeLicense:t,licenseInfo:e,isValid:o,isLoading:n}=Di();return it(async()=>{woolentorOptions?.isPro==="yes"&&await t()}),{isLicenseValid:o,licenseLoading:n,licenseInfo:e}},created(){this.initializeApp()},computed:{...Se(["GET_LOADER","GET_LICENSE_INFO","GET_LICENSE_LOADING","HAS_UNREAD_NOTIFICATIONS","GET_CHANGELOG_LOADING","GET_CHANGELOG_READ"]),buttonLoading:{get(){return this.GET_LOADER}},isLicenseValid(){return this.GET_LICENSE_INFO?.data?.is_valid},licenseButtonIcon(){return this.GET_LICENSE_LOADING?"Loading":this.isLicenseValid?"Unlock":"Lock"},statusText(){return this.licenseLoading?"Checking...":this.isLicenseValid?"Active":"Inactive"},hasUnreadNotifications(){return this.GET_CHANGELOG_READ?!1:this.HAS_UNREAD_NOTIFICATIONS},isWizardRoute(){return this.$route.path==="/setup-wizard"}},watch:{$route:{handler:"handleRouteChange",immediate:!0}},mounted(){this.removeLoader(),this.initializeNotifications()},methods:{...Fe(["FETCH_SETTINGS_DATA","SAVE_SETTINGS","REMOVE_LOADER","CHECK_NOTIFICATION_STATUS"]),handleLicense(){this.$router.push("/license")},isPro(){return this.woolentorLocalizeData?.isPro==="yes"},openActionLink(t){t&&window.open(t,"_blank")},async initializeNotifications(){try{await this.CHECK_NOTIFICATION_STATUS()}catch(t){console.error("Failed to check notifications:",t)}},async initializeApp(){this.detectMainTab(),this.detectSidebar(),this.setupRoutes(),await this.initializeRouteData()},async handleRouteChange(){this.isDataReady=!1,this.isLoading=!0,this.detectMainTab(),this.detectSidebar(),this.updateActiveIndex(),this.success=!1,await this.initializeRouteData()},async initializeRouteData(){const t=this.$route.meta.id;if(!t){this.isLoading=!1,this.isDataReady=!0;return}try{this.isApiRoute()?await this.fetchApiDataWithCache(t):this.loadLocalData(t),this.isDataReady=!0}catch(e){console.error("Failed to initialize route data:",e)}finally{this.isLoading=!1}},setupRoutes(){this.$router.options.routes.forEach(t=>{t.name&&this.items.push({name:t.name,path:t.path,showInNav:t.props.showInNav,navIcon:t.props.navIcon,children:t.children,pathname:t.meta.pathname})})},isApiRoute(){return this.$route.meta.isCallApiRoute},async fetchApiDataWithCache(t){this.hasError=!1;const e=`${t}_${this.$route.meta.pathname}`,o=K.get(e);if(o){this.model=o,this.setContent();return}try{const n=await this.FETCH_SETTINGS_DATA(["",t]);K.set(e,n),this.model=n,this.setContent()}catch(n){this.handleError(n)}},loadLocalData(t){try{this.model=this.woolentorLocalizeData.options[t],this.setContent()}catch(e){this.handleError(e)}},setContent(){typeof this.$route.meta.parentPathName<"u"?this.content=this.woolentorLocalizeData.tabs[this.$route.meta.parentPathName].sections[this.$route.meta.pathname]?.content:this.content=this.woolentorLocalizeData.tabs[this.$route.meta.pathname]?.content},handleError(t){throw this.hasError=!0,this.errorMessage="Failed to load data. Please try again.",de({title:"Error",message:"Failed to load data",type:"error",duration:4e3,position:"top-right",offset:30}),t},removeLoader(){this.REMOVE_LOADER()},detectMainTab(){this.isMainTab=typeof this.$route.meta.id<"u"},detectSidebar(){this.isSidebar=typeof this.$route.meta.sidebar<"u"?this.$route.meta.sidebar:!0},detectPassFooter(){return this.isFooter=typeof this.$route.meta?.footer<"u"?this.$route.meta?.footer:!0,this.isFooter},footerArea(){return this.isMainTab&&this.detectPassFooter()?this.content?.footer||typeof this.content?.footer>"u":!1},updateActiveIndex(){typeof this.$route.meta.parentPathName<"u"?this.activeIndex=`/${this.$route.meta.parentPathName}`:this.activeIndex=`/${this.$route.meta.pathname}`},handleSelect(t){this.$router.push(t).catch(e=>{if(e.name!=="NavigationDuplicated")throw e})},async submit(t){if(t.preventDefault(),!!this.model){this.model.verifynonce=this.woolentorLocalizeData.verifynonce;try{const e=await this.SAVE_SETTINGS([this.model,this.$route.meta.id]);if(e&&e.data){const o=`${this.$route.meta.id}_${this.$route.meta.pathname}`;K.invalidate(o),de({title:"Success",message:"Settings saved successfully!",type:"success",position:"top-right",duration:3e3,offset:30,customClass:"woolentor-notification"})}}catch{de({title:"Error",message:"Failed to save settings. Please try again.",type:"error",position:"top-right",duration:4e3,offset:30,customClass:"woolentor-notification"})}}},changeStateField(){this.woolentorLocalizeData.settings[this.$route.meta.id].filter(o=>!o.is_pro).forEach(o=>{this.model[o.id]=o.default||""})}}},tc={class:"woolentoropt-admin-panel"},nc={key:0,class:"woolentor-navigation-wrapper"},oc={class:"woolentor-navigation-menu"},sc={class:"woolentor-right-menu"},ic={key:0,class:"woolentor-status-dot"},ac={class:"woolentor-status-text"},lc={key:0,class:"woolentor-notification-dot"},rc={key:2,class:"woolentor-opt-footer"},cc={class:"woolentor-footer-savebutton"},dc={key:0,class:"woolentor-options-sidebar"};function uc(t,e,o,n,s,i){const a=V("router-view"),r=Ca,f=Sa,d=Ae,u=pe,g=Ai,_=Fo,v=Si,h=Aa,b=Da,T=Gr,D=sn;return p(),y("div",tc,[i.isWizardRoute?(p(),w(a,{key:0})):(p(),y(B,{key:1},[s.isMainTab?(p(),y("div",nc,[l("div",oc,[c(f,{"default-active":s.activeIndex,class:"el-menu-demo",mode:"horizontal",onSelect:i.handleSelect},{default:m(()=>[(p(!0),y(B,null,ee(s.items,S=>(p(),w(r,{key:S.path,index:S.path,class:x(S.pathname),disabled:!S.showInNav,style:Ce({display:S.showInNav?"":"none"})},{default:m(()=>[l("span",{class:x(S.navIcon)},null,2),k(" "+A(S.name),1)]),_:2},1032,["index","class","disabled","style"]))),128))]),_:1},8,["default-active","onSelect"])]),l("div",sc,[i.isPro()?(p(),y("div",{key:0,class:x({"woolentor-status-indicator":!0,inactive:!i.isLicenseValid&&!n.licenseLoading,loading:n.licenseLoading})},[n.licenseLoading?C("",!0):(p(),y("span",ic)),l("span",ac,A(i.statusText),1)],2)):C("",!0),i.isPro()?(p(),w(u,{key:1,class:x({"woolentor-license-button":!0,active:t.$route.path==="/license"}),onClick:i.handleLicense,type:(i.isLicenseValid,"default"),loading:n.licenseLoading},{default:m(()=>[n.licenseLoading?C("",!0):(p(),w(d,{key:0,class:"el-icon--left"},{default:m(()=>[(p(),w(at(i.licenseButtonIcon)))]),_:1})),k(" "+A(i.isLicenseValid?"Licensed":"Licensing"),1)]),_:1},8,["class","onClick","type","loading"])):(p(),w(u,{key:2,class:"woolentor-gopro-button",onClick:e[0]||(e[0]=S=>i.openActionLink("https://woolentor.com/pricing/?utm_source=admin&utm_medium=mainmenu&utm_campaign=free")),type:"primary"},{default:m(()=>e[4]||(e[4]=[k(" Upgrade to Pro ")])),_:1})),c(u,{circle:"",class:"woolentor-notification-button",onClick:e[1]||(e[1]=S=>s.showNotifications=!0)},{default:m(()=>[i.hasUnreadNotifications?(p(),y("span",lc)):C("",!0),c(d,null,{default:m(()=>e[5]||(e[5]=[l("i",{class:"sli sli-bell"},null,-1)])),_:1})]),_:1}),c(g,{modelValue:s.showNotifications,"onUpdate:modelValue":e[2]||(e[2]=S=>s.showNotifications=S)},null,8,["modelValue"])])])):C("",!0),l("div",{class:"woolentor-options-content-wrapper",style:Ce({"margin-top":s.isSidebar?"0":"20px"})},[l("div",{class:x({"woolentor-options-wrapper":!0,"woolentor-options-wrapper-full":!s.isSidebar}),style:Ce({width:s.isSidebar?"calc(100% - 425px)":"100%",padding:s.isSidebar?"":"0"})},[be((p(),w(b,null,{default:m(()=>[c(h,{style:Ce({padding:s.isSidebar?"":"0"})},{default:m(()=>[s.isDataReady?(p(),y("form",{key:0,onSubmit:e[3]||(e[3]=(...S)=>i.submit&&i.submit(...S)),class:"woolentor-options-form"},[s.hasError?(p(),w(_,{key:0,title:"Error loading data",type:"error",description:s.errorMessage,"show-icon":""},null,8,["description"])):C("",!0),s.isDataReady?(p(),y(B,{key:1},[c(a,{model:s.model,content:s.content},null,8,["model","content"]),t.$route.matched.length===1?(p(),w(a,{key:0,name:"fields",model:s.model,content:s.content},null,8,["model","content"])):C("",!0)],64)):C("",!0),i.footerArea()?(p(),y("div",rc,[l("div",cc,[c(v)])])):C("",!0)],32)):C("",!0)]),_:1},8,["style"])]),_:1})),[[D,s.isLoading]])],6),s.isSidebar?(p(),y("div",dc,[c(T)])):C("",!0)],4)],64))])}const pc=M(ec,[["render",uc]]),fc={name:"save-module-button",computed:{...Se(["GET_MODULE_SAVE_BUTTON"]),saveModuleButton:{get(){return this.GET_MODULE_SAVE_BUTTON}}},methods:{buttonClass(){return[`woolentor-module-save woolentor-admin-btn ${this.saveModuleButton.class!==""?this.saveModuleButton.class:""}`,this.GET_MODULE_SAVE_BUTTON.disabled==!0?"disabled":""]}}},mc=["disabled"];function gc(t,e,o,n,s,i){return p(),y("button",{type:"submit",class:x(i.buttonClass()),disabled:i.saveModuleButton.disabled},A(i.saveModuleButton.text),11,mc)}const to=M(fc,[["render",gc],["__scopeId","data-v-470827db"]]),hc={name:"module-reset-button",emits:["resetAlldata"],computed:{...Se(["GET_RESET_MODULE_BUTTON"]),resetModuleButton:{get(){return this.GET_RESET_MODULE_BUTTON}}},methods:{buttonClass(){return[`woolentor-module-reset woolentor-admin-btn ${this.resetModuleButton.class!==""?this.resetModuleButton.class:""}`,this.GET_RESET_MODULE_BUTTON.disabled==!0?"disabled":""]}}},_c=["disabled"];function yc(t,e,o,n,s,i){return p(),y("button",{type:"button",class:x(i.buttonClass()),disabled:i.resetModuleButton.disabled,onClick:e[0]||(e[0]=a=>t.$emit("resetAlldata"))},A(i.resetModuleButton.text),11,_c)}const Li=M(hc,[["render",yc]]),$t=()=>{const t=(o,n)=>{if(o.type==="hidden")return!1;if(!o.condition)return!0;let s=o.condition;s instanceof Array||(s=[s]);const i={"!=":(a,r)=>a!=r,"!==":(a,r)=>a!==r,"==":(a,r)=>a==r,"===":(a,r)=>a===r,">=":(a,r)=>a>=r,">":(a,r)=>a>r,"<":(a,r)=>a<r,"<=":(a,r)=>a<=r,any:(a,r)=>r.split(",").map(d=>d.trim()).includes(a),"not-any":(a,r)=>!r.split(",").map(d=>d.trim()).includes(a)};for(let a=0;a<s.length;a++){const r=s[a];let f=r.operator||"!=",d=!0;if(r?.key?.includes("|")){const u=r.key.split("|"),g=f.split("|"),_=r.value.split("|");if(u.forEach((v,h)=>{const b=g[h]||g[0],T=_[h]||_[0];i[b](n[v],T)||(d=!1)}),d)return!0}else if(i[f](n[r.key],r.value))return!0}return!1};return{maybeShowField:t,evaluateComplexConditions:(o,n)=>!o||!o.length?!0:o.some(s=>s.type==="AND"?s.rules.every(i=>t({condition:[i]},n)):s.rules.some(i=>t({condition:[i]},n)))}},vc={name:"ProBadge"},bc={class:"woolentor-admin-pro-badge"};function Tc(t,e,o,n,s,i){return p(),y("span",bc,A(this.woolentorLocalizeData.labels.pro),1)}const q=M(vc,[["render",Tc],["__scopeId","data-v-c398e55d"]]),wc={name:"field-default",props:["field","model","class"],emits:["onChange","openProModal"],data(){return{fieldData:this.field,model:this.model,currentRoute:this.$route,copySuccess:!1}},components:{ProBadge:q,CopyDocument:Ms,Check:La},methods:{classes(t,e=""){return e!==""?e.hasOwnProperty("class")?e.class:"":["woolentor-opt-field",t=="text"?"woolentor-regular-text":`woolentor-opt-field-${t}`]},copyToClipboard(t,e){const o=n=>{const s=document.createElement("textarea");s.value=n,s.setAttribute("readonly",""),s.style.position="absolute",s.style.left="-9999px",document.body.appendChild(s);try{if(s.select(),s.setSelectionRange(0,99999),document.execCommand("copy"),te({message:this.fieldData?.generate_value?.success_msg||"Success copied to clipboard!",type:"success",duration:2e3,offset:80}),e&&e.currentTarget){const i=e.currentTarget;this.copySuccess=!0,i.classList.add("copy-success"),setTimeout(()=>{this.copySuccess=!1,i.classList.remove("copy-success")},1e3)}}catch{te({message:this.fieldData?.generate_value?.error_msg||"Error copying value!",type:"error",duration:1e3,offset:80})}finally{document.body.removeChild(s)}};navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(t).then(()=>{if(te({message:this.fieldData?.generate_value?.success_msg||"Success copied to clipboard!",type:"success",duration:1e3,offset:80}),e&&e.currentTarget){const n=e.currentTarget;this.copySuccess=!0,n.classList.add("copy-success"),setTimeout(()=>{this.copySuccess=!1,n.classList.remove("copy-success")},1e3)}}).catch(()=>{o(t)}):o(t)}}},Ec={class:"woolentor-card-field-label"},Cc={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},Sc=["innerHTML"],Ac=["innerHTML"],Dc={class:"woolentor-card-field-element"},Lc={class:"woolentor-shortcode-copy"};function Ic(t,e,o,n,s,i){const a=q,r=an,f=V("Check"),d=V("CopyDocument"),u=Ae,g=pe,_=ht,v=ae;return p(),w(v,{style:{width:"auto",border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{class:x(`woolentor-element-card ${s.fieldData?.class||""} ${this.class}`),style:{display:"flex","align-items":"center","justify-content":"space-between",gap:"0px"},onClick:e[6]||(e[6]=h=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},[l("div",Ec,[l("span",Cc,[l("span",{innerHTML:s.fieldData.name},null,8,Sc),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)]),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,Ac)):C("",!0)]),l("div",Dc,[s.fieldData.type==="checkbox"?(p(),w(r,{key:0,modelValue:s.model[s.fieldData.id],"onUpdate:modelValue":e[0]||(e[0]=h=>s.model[s.fieldData.id]=h),class:"ml-2","inline-prompt":"",style:{"--el-switch-on-color":"#409eff","--el-switch-off-color":"#4C4D4F"},"active-text":s.fieldData?.label_on||"ON","inactive-text":s.fieldData?.label_off||"OFF","active-value":"on","inactive-value":"off",onChange:e[1]||(e[1]=h=>t.$emit("onChange")),disabled:s.fieldData.is_pro},null,8,["modelValue","active-text","inactive-text","disabled"])):(p(),w(_,{key:1,modelValue:s.model[s.fieldData.id],"onUpdate:modelValue":e[3]||(e[3]=h=>s.model[s.fieldData.id]=h),size:"large",type:s.fieldData.type,placeholder:s.fieldData?.placeholder,onChange:e[4]||(e[4]=h=>t.$emit("onChange")),onInput:e[5]||(e[5]=h=>t.$emit("onChange")),disabled:s.fieldData.is_pro},ks({_:2},[s.fieldData.generate_value?.copyable?{name:"append",fn:m(()=>[l("div",Lc,[c(g,{onClick:e[2]||(e[2]=he(h=>i.copyToClipboard(s.model[s.fieldData.id],h),["stop"]))},{default:m(()=>[c(u,{class:"copy-icon"},{default:m(()=>[s.copySuccess?(p(),w(f,{key:0,style:{color:"#67C23A"}})):(p(),w(d,{key:1}))]),_:1})]),_:1})])]),key:"0"}:void 0]),1032,["modelValue","type","placeholder","disabled"]))])],2)]),_:1})}const Nt=M(wc,[["render",Ic],["__scopeId","data-v-9481f4f5"]]),Oc={name:"MoudleSettngsModal",props:["className","fields","fieldId","model"],emits:["onChange","openProModal","openSettingsModal","resetAlldata"],setup(t){const{maybeShowField:e}=$t();return{shouldShowField:(n,s)=>e(n,s)}},data(){return{fields:this.fields,fieldId:this.fieldId,fieldData:function(){return this.fields.filter(t=>t.id==this.fieldId)},updateData:this.woolentorLocalizeData.options[this.fieldId]||{},dataArray:this.fields.filter(t=>t.id==this.fieldId)[0],readyToSave:{},dialogVisible:!1,resetDialogVisible:!1}},components:{ModuleSaveButton:to,ModuleResetButton:Li,DefaultField:Nt,ElDialog:_t,ElDivider:yt},created(){this.initializeModal()},computed:{...Se(["GET_MODULE_SAVE_BUTTON","GET_LOADER"])},mounted(){document.addEventListener("click",this.onClick)},beforeUnmount(){document.removeEventListener("click",this.onClick)},beforeDestroy(){document.removeEventListener("click",this.onClick)},methods:{...Fe(["FETCH_SETTINGS","SAVE_SETTINGS","REMOVE_LOADER","SET_MODULE_SETTING_LOADER"]),getFieldComponentName(t){return"field-"+t},hasComponent(t){const e=this.getFieldComponentName(t);return!!this.woolentorCustomComponents.find(n=>n.name===e)},classes(t,e=""){return e!==""?e.hasOwnProperty("class")?e.class:"":["woolentor-opt-field",t=="text"?"woolentor-regular-text":`woolentor-opt-field-${t}`]},triggerSubmit(){this.submit()},async submit(t=null){t&&t.preventDefault();try{this.readyToSave.verifynonce=this.woolentorLocalizeData.verifynonce;const e={...this.readyToSave,...this.updateData},o=await this.SAVE_SETTINGS([e,this.$router.currentRoute._value.meta.id,this.dataArray.section]);o&&o.data&&(K.set(this.fieldId,this.updateData),de({title:"Success",message:"Settings saved successfully",type:"success",duration:2e3,position:"top-right",offset:30}))}catch{de({title:"Error",message:"Failed to save settings. Please try again.",type:"error",duration:3e3,position:"top-right",offset:30})}},async confirmReset(t){this.resetDialogVisible=!1;try{const e=await this.$store.dispatch("RESET_SETTINGS",[{verifynonce:this.woolentorLocalizeData.verifynonce},t,"module"]);e&&e.data&&(K.invalidate(this.fieldId),this.defaultEnableProperties(),de({title:"Reset!",message:"Settings have been reset successfully.",type:"success",duration:1500,position:"top-right",offset:30}))}catch{de({title:"Error",message:"Failed to reset settings. Please try again.",type:"error",duration:3e3,position:"top-right",offset:30})}},onClick(t){t.target.classList.contains("el-overlay-dialog")&&this.closeModalClick()},resetAlldata(){this.resetDialogVisible=!0},defaultEnableProperties(){this.dataArray.setting_fields.forEach(t=>{this.updateData[t.id]=t.default})},updateFields(t){t&&Object.keys(t).forEach(e=>{const o=t[e],n=this.dataArray.setting_fields.find(s=>s.id===e);if(n)switch(o.type){case"select":n.type==="select"&&(n.options=o.options);break;case"repeater":const s=n.fields.find(i=>i.id===o.field_id);if(s&&(s.type==="select"||s.type==="multiselect")){let i={};o.items.forEach(a=>{i[a.value]=a.label}),s.options=i}break}})},onChange(t){t?.fieldUpdates&&this.updateFields(t.fieldUpdates),this.saveAndResetButtonEnable()},saveAndResetButtonEnable(){this.$store.dispatch("SAVE_MODULE_BUTTON_CONTROL",{text:this.woolentorLocalizeData.labels.saveButton.text,class:"",disabled:!1}),this.$store.dispatch("RESET_MODULE_BUTTON_CONTROL",{text:this.woolentorLocalizeData.labels.resetButton.text,class:"",disabled:!1})},async initializeModal(){this.dialogVisible=!1;try{const t=K.get(this.fieldId);if(t){this.updateData=t,this.dialogVisible=!0,this.SET_MODULE_SETTING_LOADER({moduleId:this.fieldId,isLoading:!1});return}const e=await this.FETCH_SETTINGS(["SET_SETTINGS",this.dataArray.section]);K.set(this.fieldId,this.updateData),e&&e.data&&(this.dialogVisible=!0,this.SET_MODULE_SETTING_LOADER({moduleId:this.fieldId,isLoading:!1}))}catch{de({title:"Error",message:"Failed to load settings. Please try again.",type:"error",duration:3e3,position:"top-right",offset:30}),this.SET_MODULE_SETTING_LOADER({moduleId:this.fieldId,isLoading:!1})}},closeModalClick(){this.dialogVisible=!1,this.SET_MODULE_SETTING_LOADER({moduleId:this.fieldId,isLoading:!1}),setTimeout(()=>{this.$emit("openSettingsModal",!1)},500)}}},Nc={class:"woolentor-form-wrapper"},xc={class:"woolentor-form-module-fields"},kc={class:"woolentor-footer-resetbutton"},Rc={class:"woolentor-footer-savebutton"},Pc={class:"reset-dialog-content",style:{"text-align":"center"}},Mc={class:"reset-title"},Gc={class:"reset-message"},Fc={class:"dialog-footer"};function Vc(t,e,o,n,s,i){const a=V("DefaultField"),r=yt,f=Li,d=to,u=_t,g=pe;return p(),y(B,null,[c(u,{modelValue:s.dialogVisible,"onUpdate:modelValue":e[6]||(e[6]=_=>s.dialogVisible=_),width:800,"close-on-click-modal":!1,onClose:i.closeModalClick,class:"woolentor-module-setting-popup",style:{padding:"20px"}},{footer:m(()=>[l("div",{class:"woolentor-module-footer-settings",onClick:e[5]||(e[5]=he(()=>{},["stop"]))},[l("div",kc,[c(f,{onClick:e[4]||(e[4]=he(_=>i.resetAlldata(),["stop"]))})]),l("div",Rc,[c(d,{onClick:he(i.submit,["stop"])},null,8,["onClick"])])])]),default:m(()=>[l("div",{class:"woolentor-module-content",onClick:e[3]||(e[3]=he(()=>{},["stop"]))},[l("form",{onSubmit:e[2]||(e[2]=he(_=>i.submit(_),["prevent"])),class:"woolentor-module-setting-data"},[l("div",Nc,[l("div",xc,[(p(!0),y(B,null,ee(s.dataArray.setting_fields,_=>be((p(),y("div",{class:"woolentor-module-field-item",key:_.id},[i.hasComponent(_.type)?(p(),w(at(i.getFieldComponentName(_.type)),{key:_.id,field:_,model:s.updateData,class:x(i.classes(_.type)),onOnChange:i.onChange,onOpenProModal:e[0]||(e[0]=v=>t.$emit("openProModal",!0)),onTriggerSave:i.triggerSubmit},null,40,["field","model","class","onOnChange","onTriggerSave"])):(p(),w(a,{key:_.id+"unique",field:_,model:s.updateData,class:x(i.classes(_.type)),onOnChange:i.onChange,onOpenProModal:e[1]||(e[1]=v=>t.$emit("openProModal",!0)),onTriggerSave:i.triggerSubmit},null,8,["field","model","class","onOnChange","onTriggerSave"])),_.id!==s.dataArray.setting_fields[s.dataArray.setting_fields.length-1].id?(p(),w(r,{key:2})):C("",!0)])),[[zt,n.shouldShowField(_,s.updateData)]])),128))])])],32)])]),_:1},8,["modelValue","onClose"]),c(u,{modelValue:s.resetDialogVisible,"onUpdate:modelValue":e[9]||(e[9]=_=>s.resetDialogVisible=_),width:"420px","close-on-click-modal":!1,"show-close":!1,class:"reset-dialog module-reset-dialog","append-to-body":"",center:""},{footer:m(()=>[l("div",Fc,[c(g,{class:"action-button yes-button",onClick:e[7]||(e[7]=_=>i.confirmReset(s.dataArray.section))},{default:m(()=>e[11]||(e[11]=[k(" Yes ")])),_:1}),c(g,{class:"action-button no-button",onClick:e[8]||(e[8]=_=>s.resetDialogVisible=!1)},{default:m(()=>e[12]||(e[12]=[k(" No ")])),_:1})])]),default:m(()=>[l("div",Pc,[e[10]||(e[10]=l("div",{class:"reset-icon"},[l("div",{class:"icon-circle"},[l("svg",{viewBox:"0 0 24 24",width:"32",height:"32"},[l("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z",fill:"#f5a623"})])])],-1)),l("h2",Mc,A(t.woolentorLocalizeData.labels.resetButton.alert.one.title),1),l("p",Gc,A(t.woolentorLocalizeData.labels.resetButton.alert.one.text),1)])]),_:1},8,["modelValue"])],64)}const Ii=M(Oc,[["render",Vc]]),Uc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAABbCAYAAADdsbM1AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAw6SURBVHgB1V1tbBTHGX5m9/buOBv7zDcNIUeSqhLgYNpUbSIicAO0DVKBP6lE1AI/qiofUhqpUsmfAv0DrapApEpR+weoCpX6JyBBP/gQroQKUkU5Y4yaQJ2DQAOmNP62z3e3k3nnfLbP3rvb2Z217x5pdXezs7Mzz77vO+/MvLPHMBP48Foc9dYuMLYeDC3gPDF2Jil+J8HtU9j43ElXZZ3r2CDK2SmODUXlgKVg81PYvPooZgAMQeNv17fBNI6Ib/HyGWXD92MwcxLb1/YUnSoQD+yUxLspJ2ACgyXuQudeIRX7oA4hQciTx1hikmS5B2P78PKq/QgIwRHnnTR9CJC8YIjL26GLqAZw3opNzW3QDANBgEmbVh1gbC8CgH7izt98WzzmBKoHG3D+xk5ohl5V/cu1BCzrGir2oDOOHmQya/HdtSlogj6JI7tWnaQR4rDCF3H2Rgs0wb/EkY/VYIkeFD9BLYB62tHRY36lT504IqrOSogrRc+JNSJlG6pTysqhR9T9JGy0C3uc9NLruidOuhgQhl8MdWqPqMpgOIrRzH63kuiOuAs3DgWpimzEBuvLwuzOwOjLgKU5kM7lT0ZM8AhDblFEfBrIPRlBoHDpNFcm7kLnEeFE7oJmEFHhzkGYn44gJA4VZJ+MIvvsHGSeiYE3hqAdJH0vr95dPks5BDBsIqIil3uVySoFIjGzqk4c9dAKjnewafXhUqdLE5f3yT6BJhBhc/76WKhiFkHAbggh/WKjXgIzmRWlbF5pPy5saRmqGL1ZxP70EHXiCIo0eR9RNj2YqDhYr6b7WFZJu+4scReFy5GzPodPhG4PycawtI2ZBEnfSOs8aQd9ogemkLrWKfODKCVx2ZBvDzvyjx7ETj2acdIIJH2xU93SlvpEHBnhszrdwzG7wRwzuwWRpqHSvqGpHo5CpH12pFpIKyCo+mglLvyvvqoirQAij+rmCYynnJKdictlklAE9Z7Ri777k8BAdTO6R6GKSHr4rlN6CeLQA0WQy1HtkJ3ViFpnteYXbzmqkDNxptognlQhSB9NF6iO4Wv9Std0vfqjhGNZjrkN0zGzY1ahotVo10ohfLVPyUEeWrZiqVO6M3HM2AqXqCXSCORXqtR5aP7i553SpxNHY1Qu59wqgqTN6hxArSEs6uza1jH2tlPydOLC4Z1uV6lC/xlCrULB1sVx7sa0MWsxcWevtahMI4WvqhnaaoJ1Q0FTGPZKTZyECeKINMNyvfpOaloLPWkpUN2Z+/rnV8kmkZcnjhKM8IdQWEsw7+mZiJxNWLdUTI0wX0QezRwJ5Oedae5NMSIodHvYdd7GOgtbXlhUlNY7mEVHVx/uPpwoZ8fGJyrmyZcXEuUtxvLFMfn7xPl70/K4gfFIdSQhOMqFKbxjO/M601v3+89gurzx8sVz0HGkdVo6NfbA8Y9Fw+/L371/fmVant7BDPb89uZ4HirrzC+/ieWLiufaDh6/Jcq6BRXkFoUx+IOlUAbnrQaskKfVK6/27biQDmpgR1e/JOHgj1dKCZqMM5cfyjx3u4eltE7O8+5rX5akEel7fndTlkfYI9LXNc+DCgyvM8WMbRM2jq2BB3idoDxx7p6Uji0/uyJVMa/GS4rynBbEUZ51b16SvylP89MN8nPHxmUy7fX32vHByRTeeO86Ll1/LNN2bFoGFfiYZF1vyIhHRejoTUkF6SCQ5JXKMxnNz8wd/36p4//j309f6ZafLzXPhyqYt7YkgomPcwEiq2CnOrqKh0BxoZZ0/o1tK8bTpNrGwo5l9Q5kMMOIh8BtithOqFxFK+peceLnz4uGjo73iGSrzlzuLspzQNg0OsZ/k70T+dZ5kKiKCHtqS48hFl7boQg/xDVKaYpJ+0bqtmXPlWl56BwdBHJHDo71lr0D+h1uHvXUliR1VW3iUF5D5WIJzot9oE5hsn1yArkfdx8OSbeDOgXqLemau90TDis9gAK5BRs51SZWAi0jeoKNY8ZYiFMbFJFrMBEkiChyWQivjfWWpK4Fsl4fs39EYOH89S61dQXbW9xJSiwttOXllHPlkHZ7URhB4/TlB/KTRgl5CcvgwB8+lmnkz505+A10HP2W7GSI0IOKDrC90EMbON6nsIg8cSR1FGSiAAp2CRrkpxV8vYKEfXAqJTsLSl/33HxJKNlBspWqw66sesjYsUIgTnEIxLmOfW7D28l5nPubTzGbKLgz5Kp4Qf+bTyp0DvwkNjZvL/wqvmpT8z6ZwU0xomfNLgs4yK8CiDCvpJHGKPSoKfRni+Llpl9pygyulgdHv9aAWgXF1LkG57unbsybThxF5nD+Plwg+2zMl083W6DeVCGOrs0puNoomdklRr86F7WG9AuN7jNznHJKdiZOIXyd1NUOIg43IChKG2Q4vwNK6xljKbgpVqjq8LcDGEMGBCVpIxim4ySvFgOVEz1ULajsqMYg69LEKa5BpF+MV7XKUt3SrWozxBI5u8kp2Zm4KWuIbkAqO/Tq4qrsZYm0Qe91Cz4ik2YbBr9fXeTJB7p1oZzN0QntLaSBM5FXDWpLpMm6LPQxIcENx8GAM3H5TRHKwYUFUEVJbWeTPLr3wA+X+iONwOyUU3IZieNt8AFSWyJP+1YhF6B70nqpBvVMYfNqRT+O5p18gsgb/s58ecyE9NE9yJ7R/bTY2TIclN8Ed/4GBeFsgCZQyKt1c9D7QnAJEEnkR9IoRmPHlMLG1StKnSwvBpnMblgygikBDSBfjw4KRqQwq9C9NPxgfPulUE3NPTm9/KC1XIbK+1XzsSXayJsMWtiW+1VvD4nvOZgVwulJ9WnWlqbtAyCrgB7YgrTNa8tuWXC3Q5pCmzLmYRiG9vd3TAWtnE1WZZpsJIJ0+2El0Ca1zMX2crWXGZD0haxt4ioKriaPutb35pPLRW//+rt8uYHCrJC/12dINaZoJ0ZEJlA7OCrG4sf8vHNJz5tuiEDT3DcTquwLHElkM9t1vPFG7yuCFFbJZgHHhHuxC5qg/zVo5zvEuqPz3oBZRFmfzAu09+dL2puSRpUFoy/oCPkeBU2FduKs/szWxjvBxpWooO4BQ92j0a9DM7QTxzhvabjHEOkJ/r2llRAaYYjfEU00I69AM7QSt/BXvAU8m6DvCz4yZMVnC0aWYWFnoQ48vnzfnaehEVrdcdNES7ZuKayB+7LCi9sNPFplY7Seu7re4gxP2cKrtg3ExtIo4u2RYeO/4hEPMXfl0L2JtPBA/sFlo2J2Jrrge+LrYWiC7nHMetuqhx2KiSc+JBuw9KqJgSUcvYKRbNS54TFB2MqcgadyzhL6JduU71u7Y3L8m9sYsJzLISmbe5+BTAV9J3DDQm7OAoy9sk0b9BLH8lNQuTnzYfRPRE/WCwNd/8CUkpeNimW6unzDQ2kmpAJoXi4a7CIMhYid12eis4uLsibKIZLCg0DUwa5K0ghc3/QYQZsRWnJALCdGML54Gxr5H8zhx66u/cpKuCKO0N8HfHTTXd5cuBHZuok9FCyMxGdvsTvQAH2dQ7j4iWajC6TkeQEzDLCQlT8Mb1W0Q3OQixXvH+NptEITdKrq+qkJRB7ZGJI8ZpcPbCaCjLlNMKIxsGis6BwfHYE9mobdSxJcvhzODNERNMl7T4Mh63gUGqCNOGHfW5z0ntSl0FkY6T75ORkkGWZDDKEn5pWULhaOwqSjvhEG7xXX9IHlRoTPOLGlyDYj4OF65CLzJHnOldRn57TYuKn2reJNx6SPpJHQIvz6piZ31/Z8Dlz751g5RBzPjZfjBqKjb+p5h3le+ixAi42zrUp/FVAMaqhKY0uWIyRLtZyoLd8i6xtaiDPyM8I1Ac7UHnIpaCFOV2VmCOuhAb6Jix/icYbaIY7qSnWGT/gmLpzT65HPBHTU2TdxplF7xDGjCoizNdmMGYbvOvtygKV941rtW1IM25PCDrVzLv/wR6z90N9Rgf6WKgFNtrRg5/z4c76Ii2ZFQzzMkgtyaB6DSGoXxCdHhpH840usVMhBGybNo206y1tsGwlSN1HGGlEGjViUjb2VXwdWfjNjAb5GDvTUIhyfVKh4SjDVxvNSlDIySD54191WAJV6yIc4RqYtpLNcT08PTsxorfAjcb6HXIt+zbeJIeYhUZn4ZCnK5ZDMWEjpGN54QYFMbggC80RK6aRzYqS2u/unzNVmv1L4Art2odi1dkomAAAAAElFTkSuQmCC",Bc={name:"ProModal",props:{className:{type:String,default:""}},emits:["openProModal"],methods:{onClick(t){t.target.classList.contains("woolentor-admin-popup")&&this.$emit("openProModal",!1)}},data(){return{proBadgeImg:Uc}},mounted(){document.addEventListener("click",this.onClick)},beforeUnmount(){document.removeEventListener("click",this.onClick)}},zc={class:"woolentor-admin-popup-inner"},Hc={class:"woolentor-admin-popup-icon"},jc=["src"],$c={class:"woolentor-admin-popup-title"},Wc={class:"woolentor-admin-popup-text"},qc={href:"https://woolentor.com/pricing/?utm_source=admin&utm_medium=locksettings&utm_campaign=free",class:"woolenroe-admin-btn woolenroe-opt-submit woolenroe-admin-btn-primary",target:"_blank"};function Kc(t,e,o,n,s,i){return p(),y("div",{id:"woolenroe-admin-pro-popup",class:x(`woolentor-admin-popup ${o.className}`)},[l("div",zc,[l("button",{class:"woolentor-admin-popup-close",onClick:e[0]||(e[0]=a=>t.$emit("openProModal",!1))},e[1]||(e[1]=[l("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M9.08366 1.73916L8.26116 0.916656L5.00033 4.17749L1.73949 0.916656L0.916992 1.73916L4.17783 4.99999L0.916992 8.26082L1.73949 9.08332L5.00033 5.82249L8.26116 9.08332L9.08366 8.26082L5.82283 4.99999L9.08366 1.73916Z",fill:"currentColor"})],-1)])),l("div",Hc,[l("img",{src:s.proBadgeImg,alt:"pro"},null,8,jc)]),l("h3",$c,A(t.woolentorLocalizeData.labels.modal.title),1),l("p",Wc,A(t.woolentorLocalizeData.labels.modal.desc),1),l("a",qc,A(t.woolentorLocalizeData.labels.modal.buynow),1)])],2)}const Oi=M(Bc,[["render",Kc],["__scopeId","data-v-dcf93490"]]),Yc={name:"FieldHeader",props:["content","value"],emits:["enableAllControl"],data(){return{currentData:this.woolentorLocalizeData.options[this.$route.meta.id]}},methods:{hideShowManage(t){return t===void 0||t===""||t===!0},enableAllControl(t){this.$emit("enableAllControl",t),this.$store.dispatch("SAVE_BUTTON_CONTROL",{text:this.woolentorLocalizeData?.labels?.saveButton?.text||"Save Settings",class:"",disabled:!1})},showNotice(){return!!this.content?.notice?.condition}}},Jc={key:0,class:"woolentor-options-notice-area"},Xc={key:1,class:"woolentor-header-area"},Qc={key:0,class:"woolentor-header-content"},Zc={key:0,class:"woolentor-header-title"},ed={key:1},td={class:"woolentor-header-actions"};function nd(t,e,o,n,s,i){const a=Fo,r=pe;return p(),y(B,null,[i.showNotice()?(p(),y("div",Jc,[c(a,{title:o.content.notice.title,type:o.content.notice.type,description:o.content.notice.message,closable:!1,center:"","show-icon":""},null,8,["title","type","description"])])):C("",!0),i.hideShowManage(o.content.header)?(p(),y("div",Xc,[o.content?(p(),y("div",Qc,[o.content.title?(p(),y("h6",Zc,A(o.content.title),1)):C("",!0),o.content.desc?(p(),y("p",ed,A(o.content.desc),1)):C("",!0)])):C("",!0),l("div",td,[i.hideShowManage(o.content.enableall)?(p(),w(r,{key:0,onClick:e[0]||(e[0]=f=>i.enableAllControl("on")),class:"enable-button",disabled:o.value==="on"},{default:m(()=>[k(A(t.woolentorLocalizeData.labels.enableAllButton.enable),1)]),_:1},8,["disabled"])):C("",!0),i.hideShowManage(o.content.enableall)?(p(),w(r,{key:1,onClick:e[1]||(e[1]=f=>i.enableAllControl("off")),class:"disable-button",disabled:o.value==="off"},{default:m(()=>[k(A(t.woolentorLocalizeData.labels.enableAllButton.disable),1)]),_:1},8,["disabled"])):C("",!0)])])):C("",!0)],64)}const Ni=M(Yc,[["render",nd],["__scopeId","data-v-a33c1772"]]),od={name:"fields-wrapper",props:{fields:{},model:{},content:{}},setup(t){const{maybeShowField:e}=$t();return{shouldShowField:n=>e(n,t.model)}},data(){return{enableDisableButtonValue:"",proModalVisible:!1,ModuleModalVisible:!1,fieldId:"",dataElements:[],currentRouteId:this.$route?.meta?.id||""}},components:{DefaulField:Nt,FieldHeader:Ni,ProModal:Oi,MoudleSettngsModal:Ii},computed:{...Se(["woolentorLocalizeData"])},created(){let t=this.fields?this.fields:[];this.enableDisableButtonValue=this.enableDisableButtonManager(t)},watch:{$route:{handler(){this.$nextTick(()=>{this.enableDisableButtonValue=this.enableDisableButtonManager(this.fields),this.currentRouteId=this.$route?.meta?.id||""})},immediate:!0}},methods:{getFieldComponentName(t){return"field-"+t},hasComponent(t){const e=this.getFieldComponentName(t);return!!this.woolentorCustomComponents.find(n=>n.name===e)},classes(t,e=""){return e!==""?e.hasOwnProperty("class")?e.class:"":["woolentor-opt-field",t=="text"?"woolentor-regular-text":`woolentor-opt-field-${t}`]},onChange(t){this.enableDisableButtonValue="",this.$store.dispatch("SAVE_BUTTON_CONTROL",{text:this.woolentorLocalizeData?.labels?.saveButton?.text||"Save Settings",class:"",disabled:!1}),this.$store.dispatch("RESET_BUTTON_CONTROL",{text:this.woolentorLocalizeData?.labels?.resetButton?.text||"Reset All Settings",class:"",disabled:!1})},enableDisableButtonManager(t){if(!t||!Array.isArray(t))return"";const e=this.filterAllCheckboxes(t);if(!e.length)return"";const o=e.every(s=>this.model[s.id]==="on"),n=e.every(s=>this.model[s.id]==="off");return o?"on":n?"off":""},filterAllCheckboxes(t){return Array.isArray(t)?t.filter(e=>(e.type==="element"||e.type==="checkbox"||e.type==="switcher")&&e.is_pro!==!0):[]},enableAllControl(t){const e=t;this.filterAllCheckboxes(this.fields).forEach(n=>{(n.type==="checkbox"||n.type==="element"||n.type==="switcher")&&(this.model[n.id]=e)}),this.enableDisableButtonValue=e,this.$store.dispatch("SAVE_BUTTON_CONTROL",{text:this.woolentorLocalizeData?.labels?.saveButton?.text||"Save Settings",class:"",disabled:!1}),this.$store.dispatch("RESET_BUTTON_CONTROL",{text:this.woolentorLocalizeData?.labels?.resetButton?.text||"Reset All Settings",class:"",disabled:!1})},openProModal(t){this.proModalVisible=t},openSettingsModal(t){this.ModuleModalVisible=t,this.fieldId=t}}},sd={class:"woolentor-form-wrapper"};function id(t,e,o,n,s,i){const a=Ni,r=yt,f=Nt,d=rt,u=lt,g=Oi,_=Ii;return p(),y("div",sd,[c(a,{content:o.content,value:s.enableDisableButtonValue,onEnableAllControl:i.enableAllControl},null,8,["content","value","onEnableAllControl"]),l("div",{class:x(`woolentor-fields-area ${s.currentRouteId}`)},[c(u,{gutter:20},{default:m(()=>[(p(!0),y(B,null,ee(o.fields,v=>be((p(),w(d,{key:v.id,style:Ce({"padding-bottom":o.content.column?"30px":"","padding-top":v.type==="title"||v?.column===1?"0":""}),span:v.type==="title"||v?.column===1?24:o.content.column===3?8:o.content.column===2?12:o.content.column===4?6:24,md:v.type==="title"||v?.column===1?24:o.content.column===3||o.content.column===4?8:o.content.column===2?12:24,sm:v.type==="title"||v?.column===1?24:o.content.column===3||o.content.column===2||o.content.column===4?12:24,xs:24,class:x(`${v.type==="title"?"woolentor-admin-option-title":"woolentor-admin-option-field"} woolentor-filed-type-${v.type}`)},{default:m(()=>[v?.column===1?(p(),w(r,{key:0})):C("",!0),i.hasComponent(v.type)?(p(),w(at(i.getFieldComponentName(v.type)),{key:v.id,field:v,model:o.model,class:x(i.classes(v.type)),onOnChange:i.onChange,onOpenProModal:i.openProModal,onOpenSettingsModal:h=>i.openSettingsModal(v.id)},null,40,["field","model","class","onOnChange","onOpenProModal","onOpenSettingsModal"])):(p(),w(f,{key:v.id+"unique",field:v,model:o.model,class:x(i.classes(v.type)),onOnChange:i.onChange,onOpenProModal:i.openProModal,onOpenSettingsModal:h=>i.openSettingsModal(v.id)},null,8,["field","model","class","onOnChange","onOpenProModal","onOpenSettingsModal"])),v.id!==o.fields[o.fields.length-1].id&&!o.content.column?(p(),w(r,{key:3,mar:""})):C("",!0)]),_:2},1032,["style","span","md","sm","class"])),[[zt,n.shouldShowField(v)]])),128))]),_:1})],2),s.proModalVisible?(p(),w(g,{key:0,className:s.proModalVisible?"open":"",onOpenProModal:i.openProModal},null,8,["className","onOpenProModal"])):C("",!0),s.ModuleModalVisible?(p(),w(_,{key:1,fields:o.fields,onOnChange:i.onChange,model:o.model,fieldId:s.fieldId,className:s.ModuleModalVisible?"open":"",onOpenSettingsModal:i.openSettingsModal,onOpenProModal:i.openProModal},null,8,["fields","onOnChange","model","fieldId","className","onOpenSettingsModal","onOpenProModal"])):C("",!0)])}const vs=M(od,[["render",id],["__scopeId","data-v-b1885335"]]),pn=()=>{const t={NOT_INSTALLED:"not_installed",INSTALLING:"installing",INACTIVE:"inactive",ACTIVATING:"activating",ACTIVE:"active"},e=(_,v=!1)=>{if(v)switch(_){case t.NOT_INSTALLED:case t.INSTALLING:return"Installing...";case t.INACTIVE:case t.ACTIVATING:return"Activating...";default:return"Processing..."}switch(_){case t.NOT_INSTALLED:return"Install";case t.INACTIVE:return"Activate";case t.ACTIVE:return"Activated";default:return"Install"}},o=async(_,v)=>{try{if(v&&v(_.slug,t.INSTALLING),(await X.post("/woolentoropt/v1/install-plugin",{slug:_.slug,nonce:woolentorOptions.verifynonce})).data.success)return a("Success","Plugin installed successfully","success"),t.INACTIVE}catch(h){throw r(h),h}},n=async(_,v)=>{try{if(v&&v(_.slug,t.ACTIVATING),(await X.post("/woolentoropt/v1/activate-plugin",{slug:_.slug,nonce:woolentorOptions.verifynonce})).data.success)return a("Success","Plugin activated successfully","success"),t.ACTIVE}catch(h){throw r(h),h}},s=async(_,v)=>{try{let h=null;return _.status===t.NOT_INSTALLED?await o(_,v)===t.INACTIVE&&(h=await n(_,v)):_.status===t.INACTIVE&&(h=await n(_,v)),h&&v&&v(_.slug,h),h}catch(h){return r(h),v&&v(_.slug,_.status),null}},i=async _=>{try{const v=await X.get("/woolentoropt/v1/plugins-status",{params:{plugins:Array.isArray(_)?_.join(","):_,nonce:woolentorOptions.verifynonce}});return v.data.success?v.data.plugins:[]}catch(v){return r(v),[]}},a=(_,v,h="success")=>{de({title:_,message:v,type:h,duration:3e3,offset:30})},r=_=>{let v="An error occurred";_.response&&(v=_.response.data.message||v),a("Error",v,"error")},f=_=>_.status===t.ACTIVE||_.status===t.INSTALLING||_.status===t.ACTIVATING||_.isLoading,d=async _=>{try{const v=_.map(b=>b.slug).join(","),h=await X.get("/woolentoropt/v1/plugins-info",{params:{slugs:v,nonce:woolentorOptions.verifynonce}});if(h.data.success){const b=h.data.plugins;return _.map(T=>{const D=b[T.slug];return D?{...T,description:D.short_description||T.description,version:D.version,rating:D.rating,num_ratings:D.num_ratings,active_installs:D.active_installs,last_updated:D.last_updated,author:D.author,author_profile:D.author_profile,download_link:D.download_link,homepage:D.homepage,icons:D.icons||{},banners:D.banners||{}}:T})}return _}catch(v){return console.error("Error fetching plugins data:",v),_}};return{PLUGIN_STATES:t,getPluginButtonText:e,handlePluginAction:s,fetchPluginStatus:i,isPluginManaged:f,fetchPluginsData:d,initializePluginsWithData:async(_,v="wordpress")=>{try{const h=v==="local"?_:await d(_),b=h.map(D=>D.slug),T=await i(b);return h.map(D=>{const S=T.find(P=>P.slug===D.slug);return{...D,status:S?S.status:"not_installed"}})}catch(h){return console.error("Error initializing plugins:",h),_}},formatNumber:_=>_>=1e6?(_/1e6).toFixed(1)+"M":_>=1e3?(_/1e3).toFixed(1)+"K":_}},ad={name:"BoostStep",data(){return{pluginStatuses:{},statusLoading:!0}},setup(){const{fetchPluginStatus:t,PLUGIN_STATES:e}=pn();return{fetchPluginStatus:t,PLUGIN_STATES:e}},computed:{...Se("onboarding",["getOnboardingSettings"]),plugins(){return woolentorOptions?.onboarding?.plugins||[]},pluginStates(){return this.getOnboardingSettings.plugins},pluginsWithStatus(){return this.plugins.map(t=>({...t,installStatus:this.pluginStatuses[t.slug]||"not_installed"}))}},async mounted(){await this.loadPluginStatuses()},methods:{...Fe("onboarding",["updateOnboardingSettings"]),async loadPluginStatuses(){this.statusLoading=!0;try{const t=this.plugins.map(s=>s.slug),e=await this.fetchPluginStatus(t),o={};Array.isArray(e)&&e.forEach(s=>{o[s.slug]=s.status}),this.pluginStatuses=o;const n={...this.pluginStates};Object.entries(o).forEach(([s,i])=>{i==="active"&&(n[s]=!0)}),this.updateOnboardingSettings({plugins:n})}catch(t){console.error("Failed to load plugin statuses:",t)}finally{this.statusLoading=!1}},togglePlugin(t,e){const o={...this.getOnboardingSettings.plugins,[t]:e};this.updateOnboardingSettings({plugins:o})},toggleAll(t){const e={};this.plugins.forEach(o=>{this.pluginStatuses[o.slug]==="active"?e[o.slug]=!0:e[o.slug]=t}),this.updateOnboardingSettings({plugins:e})}}},ld={class:"woolentor-wizard__step-content"},rd={class:"woolentor-wizard__plugins"},cd={class:"woolentor-wizard__plugin-top"},dd={class:"woolentor-wizard__plugin-name"},ud={key:0,class:"woolentor-wizard__plugin-active-badge"},pd={class:"woolentor-wizard__toggle"},fd=["checked","disabled","onChange"],md={class:"woolentor-wizard__plugin-desc"},gd={key:0,class:"woolentor-wizard__plugins-loading"};function hd(t,e,o,n,s,i){return p(),y("div",ld,[e[1]||(e[1]=l("div",{class:"woolentor-wizard__step-heading"},"Supercharge Your Store",-1)),e[2]||(e[2]=l("div",{class:"woolentor-wizard__step-desc"},"Handpicked companion plugins to extend your WooCommerce store with powerful features.",-1)),l("div",rd,[(p(!0),y(B,null,ee(i.pluginsWithStatus,a=>(p(),y("div",{key:a.slug,class:x(["woolentor-wizard__plugin-card",{"woolentor-wizard__plugin-card--active":a.installStatus==="active"}])},[l("div",cd,[l("div",dd,[k(A(a.name)+" ",1),a.installStatus==="active"?(p(),y("span",ud,"Active")):C("",!0)]),l("label",pd,[l("input",{type:"checkbox",checked:a.installStatus==="active"||i.pluginStates[a.slug],disabled:a.installStatus==="active"||s.statusLoading,onChange:r=>i.togglePlugin(a.slug,r.target.checked)},null,40,fd),e[0]||(e[0]=l("span",{class:"woolentor-wizard__toggle-slider"},null,-1))])]),l("div",md,A(a.desc),1)],2))),128))]),s.statusLoading?(p(),y("div",gd," Checking plugin status... ")):C("",!0)])}const _d=M(ad,[["render",hd],["__scopeId","data-v-ddd2db4c"]]),yd={name:"ModulesStep",computed:{...Se("onboarding",["getOnboardingSettings","getLastAppliedUserType"]),modules(){return woolentorOptions?.onboarding?.modules||[]},isPro(){return woolentorOptions?.isPro==="yes"},moduleStates(){return this.getOnboardingSettings.modules}},mounted(){const t=this.getOnboardingSettings.userType;this.getLastAppliedUserType!==t&&(this.applyPreset(),this.$store.dispatch("onboarding/setLastAppliedUserType",t))},methods:{...Fe("onboarding",["updateOnboardingSettings"]),applyPreset(){const t=this.getOnboardingSettings.userType,o=(woolentorOptions?.onboarding?.module_presets||{})[t]||[],n={};this.modules.forEach(s=>{s.is_pro&&!this.isPro?n[s.id]=!1:s?.section&&o.includes(s.section)?n[s.section]=!0:o.includes(s.id)&&!s?.section?n[s.id]=!0:n[s.id]=!1}),this.updateOnboardingSettings({modules:n})},toggleModule(t,e){this.modules.find(n=>n.id===t);const o={...this.getOnboardingSettings.modules,[t]:e};this.updateOnboardingSettings({modules:o})},toggleAll(t){const e={};this.modules.forEach(o=>{o.is_pro&&!this.isPro?o?.section?e[o.section]=!1:e[o.id]=!1:o?.section?e[o.section]=t:e[o.id]=t}),this.updateOnboardingSettings({modules:e})}}},vd={class:"woolentor-wizard__step-content"},bd={class:"woolentor-wizard__modules-header"},Td={class:"woolentor-wizard__modules-header-actions"},wd={class:"woolentor-wizard__modules-scroll"},Ed={class:"woolentor-wizard__modules"},Cd={class:"woolentor-wizard__module-name"},Sd={key:0,class:"woolentor-wizard__module-pro-badge"},Ad={class:"woolentor-wizard__toggle"},Dd=["checked","disabled","onChange"],Ld=["checked","disabled","onChange"];function Id(t,e,o,n,s,i){return p(),y("div",vd,[e[4]||(e[4]=l("div",{class:"woolentor-wizard__step-heading"},"Activate the Modules You Need",-1)),e[5]||(e[5]=l("div",{class:"woolentor-wizard__step-desc"},"Enable or disable modules based on your store requirements. You can change these anytime later.",-1)),l("div",bd,[e[2]||(e[2]=l("div",{class:"woolentor-wizard__modules-header-label"},"ShopLentor Modules",-1)),l("div",Td,[l("button",{class:"woolentor-wizard__modules-toggle-btn woolentor-wizard__modules-toggle-btn--enable",onClick:e[0]||(e[0]=a=>i.toggleAll(!0))},"Enable All"),l("button",{class:"woolentor-wizard__modules-toggle-btn woolentor-wizard__modules-toggle-btn--disable",onClick:e[1]||(e[1]=a=>i.toggleAll(!1))},"Disable All")])]),l("div",wd,[l("div",Ed,[(p(!0),y(B,null,ee(i.modules,a=>(p(),y("div",{key:a.id,class:"woolentor-wizard__module-item"},[l("div",Cd,[k(A(a.name)+" ",1),a.is_pro?(p(),y("span",Sd,"Pro")):C("",!0)]),l("label",Ad,[a.section?(p(),y("input",{key:0,type:"checkbox",checked:i.moduleStates[a.section],disabled:a.is_pro&&!i.isPro,onChange:r=>i.toggleModule(a.section,r.target.checked)},null,40,Dd)):(p(),y("input",{key:1,type:"checkbox",checked:i.moduleStates[a.id],disabled:a.is_pro&&!i.isPro,onChange:r=>i.toggleModule(a.id,r.target.checked)},null,40,Ld)),e[3]||(e[3]=l("span",{class:"woolentor-wizard__toggle-slider"},null,-1))])]))),128))])])])}const Od=M(yd,[["render",Id],["__scopeId","data-v-0167024e"]]),Nd={name:"SignUpStep",data(){return{showCollectInfo:!1}},computed:{...Se("onboarding",["getOnboardingSettings"]),email:{get(){return this.getOnboardingSettings.email},set(t){this.updateOnboardingSettings({email:t})}},consent:{get(){return this.getOnboardingSettings.consent},set(t){this.updateOnboardingSettings({consent:t})}}},methods:{...Fe("onboarding",["updateOnboardingSettings"])}},xd={class:"woolentor-wizard__step-content"},kd={class:"woolentor-wizard__email-form"},Rd={class:"woolentor-wizard__input-group"},Pd={class:"woolentor-wizard__consent"},Md={for:"wizard_consent"};function Gd(t,e,o,n,s,i){return p(),y("div",xd,[e[6]||(e[6]=l("div",{class:"woolentor-wizard__step-heading"},"Stay in the Loop",-1)),e[7]||(e[7]=l("div",{class:"woolentor-wizard__step-desc"},"Subscribe to receive plugin updates, tips, and exclusive offers directly in your inbox.",-1)),l("div",kd,[l("div",Rd,[e[3]||(e[3]=l("label",{for:"wizard_email"},"Email Address",-1)),be(l("input",{type:"email",id:"wizard_email",class:"woolentor-wizard__input","onUpdate:modelValue":e[0]||(e[0]=a=>i.email=a),placeholder:"you@example.com"},null,512),[[Rn,i.email]])]),l("div",Pd,[be(l("input",{type:"checkbox",id:"wizard_consent","onUpdate:modelValue":e[1]||(e[1]=a=>i.consent=a)},null,512),[[pa,i.consent]]),l("label",Md,[e[4]||(e[4]=k(" By continuing, you agree to allow this plugin to collect some of your data for the purpose of improving your experience. ")),l("a",{href:"#",class:"woolentor-wizard__collect-toggle",onClick:e[2]||(e[2]=he(a=>s.showCollectInfo=!s.showCollectInfo,["prevent"]))},"What We Collect")])]),l("div",{class:x(["woolentor-wizard__collect-info",{"is-visible":s.showCollectInfo}])},e[5]||(e[5]=[l("p",null,"We gather basic, non-sensitive information to ensure the plugin works smoothly on your site. This includes your site's URL, the versions of WordPress and PHP you're using, and a list of your installed plugins and themes. Additionally, we collect your email address to send you exclusive discounts and important updates.",-1),l("p",null,"This data helps us ensure that ShopLentor stays up-to-date and compatible with the most popular plugins and themes. Your privacy is important to us. We will never send you spam, and we handle your data with the utmost care.",-1),l("a",{href:"https://woolentor.com/privacy-policy/",target:"_blank",class:"woolentor-wizard__collect-privacy"},"Privacy Policy",-1)]),2)])])}const Fd=M(Nd,[["render",Gd],["__scopeId","data-v-0ff3b17e"]]),Vd={name:"SurpriseStep",data(){return{copyButtonText:"Copy"}},computed:{couponCode(){return woolentorOptions?.onboarding?.coupon_code||"STARTER10"}},methods:{async copyCoupon(){try{await navigator.clipboard.writeText(this.couponCode),this.copyButtonText="Copied!",setTimeout(()=>{this.copyButtonText="Copy"},2e3)}catch{this.copyButtonText="Failed",setTimeout(()=>{this.copyButtonText="Copy"},2e3)}}}},Ud={class:"woolentor-wizard__step-content"},Bd={class:"woolentor-wizard__discount"},zd={class:"woolentor-wizard__coupon"},Hd={class:"woolentor-wizard__coupon-code"};function jd(t,e,o,n,s,i){return p(),y("div",Ud,[e[3]||(e[3]=l("div",{class:"woolentor-wizard__step-heading"},"You're All Set!",-1)),e[4]||(e[4]=l("div",{class:"woolentor-wizard__step-desc"},"One last thing — here's something special just for you.",-1)),l("div",Bd,[e[1]||(e[1]=fa('<div class="woolentor-wizard__discount-badge" data-v-1e22744f><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-1e22744f><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" data-v-1e22744f></polygon></svg> Exclusive Offer — 10% OFF </div><div class="woolentor-wizard__discount-title" data-v-1e22744f>Upgrade to ShopLentor Pro</div><div class="woolentor-wizard__discount-desc" data-v-1e22744f>Access 90+ widgets, advanced modules, premium templates, and priority support to take your store to the next level.</div>',3)),l("div",zd,[l("span",Hd,A(i.couponCode),1),l("button",{class:"woolentor-wizard__coupon-copy",onClick:e[0]||(e[0]=(...a)=>i.copyCoupon&&i.copyCoupon(...a))},A(s.copyButtonText),1)]),e[2]||(e[2]=l("div",null,[l("a",{href:"https://woolentor.com/pricing/?utm_source=admin&utm_medium=setupwizard&utm_campaign=free",target:"_blank",class:"woolentor-wizard__discount-cta"},[k(" Get Pro Now "),l("svg",{viewBox:"0 0 24 24"},[l("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),l("polyline",{points:"12 5 19 12 12 19"})])])],-1))])])}const $d=M(Vd,[["render",jd],["__scopeId","data-v-1e22744f"]]),Wd={name:"UsageStep",data(){return{userTypeOptions:[{value:"starter",title:"Basic",desc:"General widgets will be activated to build your store. Best for lightweight-fast starter websites.",recommended:!0},{value:"intermediate",title:"Advanced",desc:"Build customized stores with advanced functionalities. All dynamic elements will be activated.",recommended:!1},{value:"advanced",title:"Custom",desc:"Configure the elements of ShopLentor to your preferences. Full control over every feature.",recommended:!1}]}},computed:{...Se("onboarding",["getOnboardingSettings"]),userType:{get(){return this.getOnboardingSettings.userType},set(t){this.updateOnboardingSettings({userType:t})}}},methods:{...Fe("onboarding",["updateOnboardingSettings"])}},qd={class:"woolentor-wizard__step-content"},Kd={class:"woolentor-wizard__cards"},Yd=["id","value"],Jd=["for"],Xd={class:"woolentor-wizard__card-title"},Qd={key:0,class:"woolentor-wizard__recommended"},Zd={class:"woolentor-wizard__card-desc"};function eu(t,e,o,n,s,i){return p(),y("div",qd,[e[2]||(e[2]=l("div",{class:"woolentor-wizard__step-heading"},"How Will You Use ShopLentor?",-1)),e[3]||(e[3]=l("div",{class:"woolentor-wizard__step-desc"},"This helps us tailor your experience and recommend the right features for your store.",-1)),l("div",Kd,[(p(!0),y(B,null,ee(s.userTypeOptions,a=>(p(),y("div",{class:"woolentor-wizard__card",key:a.value},[be(l("input",{type:"radio",name:"user_type",id:"user_"+a.value,value:a.value,"onUpdate:modelValue":e[0]||(e[0]=r=>i.userType=r)},null,8,Yd),[[Rs,i.userType]]),l("label",{for:"user_"+a.value,class:"woolentor-wizard__card-label"},[e[1]||(e[1]=l("div",{class:"woolentor-wizard__card-check"},[l("svg",{viewBox:"0 0 24 24"},[l("polyline",{points:"20 6 9 17 4 12"})])],-1)),l("div",Xd,[k(A(a.title)+" ",1),a.recommended?(p(),y("span",Qd,"(Recommended)")):C("",!0)]),l("div",Zd,A(a.desc),1)],8,Jd)]))),128))])])}const tu=M(Wd,[["render",eu],["__scopeId","data-v-15def3d9"]]),nu={name:"WelcomeStep",data(){return{editorOptions:[{value:"elementor",title:"Elementor",desc:"Build pages with the popular drag & drop visual editor for your WooCommerce store.",recommended:!1},{value:"gutenberg",title:"Gutenberg",desc:"Use the native WordPress block editor. Best for lightweight-fast starter websites.",recommended:!1},{value:"both",title:"Both",desc:"Enable both Elementor widgets & Gutenberg blocks for maximum flexibility.",recommended:!0}]}},computed:{...Se("onboarding",["getOnboardingSettings"]),editorChoice:{get(){return this.getOnboardingSettings.editorChoice},set(t){this.updateOnboardingSettings({editorChoice:t})}}},methods:{...Fe("onboarding",["updateOnboardingSettings"])}},ou={class:"woolentor-wizard__step-content"},su={class:"woolentor-wizard__cards"},iu=["id","value"],au=["for"],lu={class:"woolentor-wizard__card-title"},ru={key:0,class:"woolentor-wizard__recommended"},cu={class:"woolentor-wizard__card-desc"};function du(t,e,o,n,s,i){return p(),y("div",ou,[e[2]||(e[2]=l("div",{class:"woolentor-wizard__step-heading"},"Welcome To ShopLentor",-1)),e[3]||(e[3]=l("div",{class:"woolentor-wizard__step-desc"},"Thank you for choosing ShopLentor! Follow these simple steps of easy setup wizard & enjoy your WooCommerce store-building experience.",-1)),l("div",su,[(p(!0),y(B,null,ee(s.editorOptions,a=>(p(),y("div",{class:"woolentor-wizard__card",key:a.value},[be(l("input",{type:"radio",name:"editor_choice",id:"editor_"+a.value,value:a.value,"onUpdate:modelValue":e[0]||(e[0]=r=>i.editorChoice=r)},null,8,iu),[[Rs,i.editorChoice]]),l("label",{for:"editor_"+a.value,class:"woolentor-wizard__card-label"},[e[1]||(e[1]=l("div",{class:"woolentor-wizard__card-check"},[l("svg",{viewBox:"0 0 24 24"},[l("polyline",{points:"20 6 9 17 4 12"})])],-1)),l("div",lu,[k(A(a.title)+" ",1),a.recommended?(p(),y("span",ru,"(Recommended)")):C("",!0)]),l("div",cu,A(a.desc),1)],8,au)]))),128))])])}const uu=M(nu,[["render",du],["__scopeId","data-v-b673cb04"]]),pu={name:"SetupWizard",components:{WelcomeStep:uu,UsageStep:tu,ModulesStep:Od,SignUpStep:Fd,BoostStep:_d,SurpriseStep:$d},data(){return{totalSteps:6,stepComponents:{1:"WelcomeStep",2:"UsageStep",3:"ModulesStep",4:"SignUpStep",5:"BoostStep",6:"SurpriseStep"}}},computed:{...Se("onboarding",["getCurrentStep","getCompletedSteps","getOnboardingSettings","isCompleting","getFinalizing","getFinalizingProgress"]),finalizing(){return this.getFinalizing},finalizingProgress(){return this.getFinalizingProgress},currentTask(){return this.finalizing.tasks&&this.finalizing.tasks.find(t=>t.status==="in_progress")||null},steps(){return woolentorOptions?.onboarding?.steps||[]},currentStep(){return this.getCurrentStep},currentStepComponent(){return this.stepComponents[this.currentStep]||"WelcomeStep"},trackFillWidth(){return this.currentStep<=1?"0%":(this.currentStep-1)/(this.totalSteps-1)*100+"%"}},mounted(){this.$nextTick(()=>{this.positionTrack()}),window.addEventListener("resize",this.positionTrack)},beforeUnmount(){window.removeEventListener("resize",this.positionTrack)},methods:{...Fe("onboarding",["completeOnboardingStep","backOnboardingStep","skipOnboarding","completeOnboarding"]),stepClass(t){return t<this.currentStep?"woolentor-wizard__step--completed":t===this.currentStep?"woolentor-wizard__step--active":"woolentor-wizard__step--pending"},positionTrack(){const t=this.$refs.stepperSteps,e=this.$refs.stepperTrack;if(!t||!e)return;const o=t.querySelectorAll(".woolentor-wizard__step-circle");if(o.length<2)return;const n=t.getBoundingClientRect(),s=o[0].getBoundingClientRect(),i=o[o.length-1].getBoundingClientRect(),a=s.left+s.width/2-n.left,r=i.left+i.width/2-n.left;e.style.left=a+"px",e.style.width=r-a+"px"},goNext(){this.currentStep<this.totalSteps&&(this.completeOnboardingStep(this.currentStep),this.$nextTick(()=>this.positionTrack()))},goBack(){this.backOnboardingStep(),this.$nextTick(()=>this.positionTrack())},enableAllAndProceed(){this.$emit("enable-all-plugins");const t={};(woolentorOptions?.onboarding?.plugins||[]).forEach(o=>{t[o.slug]=!0}),this.$store.dispatch("onboarding/updateOnboardingSettings",{plugins:t}),this.goNext()},async finishSetup(){try{await this.completeOnboarding()}catch(t){console.error("Failed to finish setup:",t)}},goToDashboard(){this.$router.push("/welcome")},async skipWizard(){try{await this.skipOnboarding(),this.$router.push("/welcome")}catch(t){console.error("Failed to skip wizard:",t)}}}},fu={class:"woolentor-wizard-overlay"},mu={class:"woolentor-wizard-container"},gu={key:0,class:"woolentor-wizard-finalizing"},hu={class:"woolentor-wizard-finalizing__icon"},_u={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},yu={key:1,class:"woolentor-wizard-finalizing__spinner-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},vu={class:"woolentor-wizard-finalizing__heading"},bu={class:"woolentor-wizard-finalizing__desc"},Tu={class:"woolentor-wizard-finalizing__progress"},wu={class:"woolentor-wizard-finalizing__progress-bar"},Eu={class:"woolentor-wizard-finalizing__progress-text"},Cu={key:0,class:"woolentor-wizard-finalizing__current-task"},Su={class:"woolentor-wizard-finalizing__current-task-label"},Au={class:"woolentor-wizard-stepper"},Du={class:"woolentor-wizard-stepper__steps",ref:"stepperSteps"},Lu={class:"woolentor-wizard-stepper__track",ref:"stepperTrack"},Iu={class:"woolentor-wizard__step-circle"},Ou={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},Nu={key:1},xu={class:"woolentor-wizard__step-label"},ku={class:"woolentor-wizard-content"},Ru={class:"woolentor-wizard-footer__right"},Pu=["disabled"],Mu={key:0,class:"woolentor-wizard-skip"};function Gu(t,e,o,n,s,i){return p(),y("div",fu,[l("div",mu,[l("div",{class:x(["woolentor-wizard",{"woolentor-wizard--finalizing":i.finalizing.active}])},[i.finalizing.active?(p(),y("div",gu,[l("div",hu,[i.finalizing.completed?(p(),y("svg",_u,e[7]||(e[7]=[l("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"},null,-1),l("polyline",{points:"22 4 12 14.01 9 11.01"},null,-1)]))):(p(),y("svg",yu,e[8]||(e[8]=[l("path",{d:"M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83"},null,-1)])))]),l("h2",vu,A(i.finalizing.completed?"Great! You're All Set!":"Setting Up Your Store..."),1),l("p",bu,A(i.finalizing.completed?"Your store has been configured successfully.":"Please wait while we configure your store settings and install selected plugins."),1),l("div",Tu,[l("div",wu,[l("div",{class:"woolentor-wizard-finalizing__progress-fill",style:Ce({width:i.finalizingProgress+"%"})},null,4)]),l("div",Eu,A(i.finalizingProgress)+"%",1)]),i.currentTask&&!i.finalizing.completed?(p(),y("div",Cu,[e[9]||(e[9]=l("span",{class:"woolentor-wizard-finalizing__task-spinner"},null,-1)),l("span",Su,A(i.currentTask.label)+"...",1)])):C("",!0),i.finalizing.completed?(p(),y("button",{key:1,class:"woolentor-wizard__btn woolentor-wizard__btn--dashboard",onClick:e[0]||(e[0]=(...a)=>i.goToDashboard&&i.goToDashboard(...a))},e[10]||(e[10]=[k(" Go to Dashboard "),l("svg",{viewBox:"0 0 24 24"},[l("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),l("polyline",{points:"12 5 19 12 12 19"})],-1)]))):C("",!0)])):(p(),y(B,{key:1},[l("div",Au,[l("div",Du,[l("div",Lu,[l("div",{class:"woolentor-wizard-stepper__track-fill",style:Ce({width:i.trackFillWidth})},null,4)],512),(p(!0),y(B,null,ee(i.steps,(a,r)=>(p(),y("div",{key:a.key,class:x(["woolentor-wizard__step",i.stepClass(r+1)])},[l("div",Iu,[r+1<i.currentStep?(p(),y("svg",Ou,e[11]||(e[11]=[l("polyline",{points:"20 6 9 17 4 12"},null,-1)]))):(p(),y("span",Nu,A(r+1),1))]),l("div",xu,A(a.label),1)],2))),128))],512)]),l("div",ku,[c(ma,{name:"wizard-fade",mode:"out-in"},{default:m(()=>[(p(),w(at(i.currentStepComponent),{key:i.currentStep}))]),_:1})]),l("div",{class:x(["woolentor-wizard-footer",{"woolentor-wizard-footer--centered":i.currentStep===1}])},[i.currentStep>1?(p(),y("button",{key:0,class:"woolentor-wizard__btn woolentor-wizard__btn--back",onClick:e[1]||(e[1]=(...a)=>i.goBack&&i.goBack(...a))},e[12]||(e[12]=[l("svg",{viewBox:"0 0 24 24"},[l("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),l("polyline",{points:"12 19 5 12 12 5"})],-1),k(" Back ")]))):C("",!0),l("div",Ru,[i.currentStep===5?(p(),y(B,{key:0},[l("button",{class:"woolentor-wizard__btn woolentor-wizard__btn--continue",onClick:e[2]||(e[2]=(...a)=>i.goNext&&i.goNext(...a))},e[13]||(e[13]=[k(" Continue "),l("svg",{viewBox:"0 0 24 24"},[l("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),l("polyline",{points:"12 5 19 12 12 19"})],-1)])),l("button",{class:"woolentor-wizard__btn woolentor-wizard__btn--enable-all",onClick:e[3]||(e[3]=(...a)=>i.enableAllAndProceed&&i.enableAllAndProceed(...a))},e[14]||(e[14]=[k(" Enable All & Proceed "),l("svg",{viewBox:"0 0 24 24"},[l("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),l("polyline",{points:"12 5 19 12 12 19"})],-1)]))],64)):i.currentStep===s.totalSteps?(p(),y("button",{key:1,class:"woolentor-wizard__btn woolentor-wizard__btn--finish",disabled:t.isCompleting,onClick:e[4]||(e[4]=(...a)=>i.finishSetup&&i.finishSetup(...a))},A(t.isCompleting?"Finishing...":"Finish Setup"),9,Pu)):(p(),y("button",{key:2,class:"woolentor-wizard__btn woolentor-wizard__btn--next",onClick:e[5]||(e[5]=(...a)=>i.goNext&&i.goNext(...a))},e[15]||(e[15]=[k(" Proceed to Next "),l("svg",{viewBox:"0 0 24 24"},[l("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),l("polyline",{points:"12 5 19 12 12 19"})],-1)])))])],2)],64))],2),i.finalizing.active?C("",!0):(p(),y("div",Mu,[l("a",{href:"#",onClick:e[6]||(e[6]=he((...a)=>i.skipWizard&&i.skipWizard(...a),["prevent"]))},"Skip & Go to Dashboard")]))])])}const Fu=M(pu,[["render",Gu],["__scopeId","data-v-d34e3af6"]]),Vu={name:"SubTabNavigation",props:{sections:{type:[Object,Array,Boolean],default:()=>[]},model:{type:Object,default:()=>({})},content:{type:Object,default:()=>({})},parentName:{type:String,required:!0},parentPath:{type:String,required:!0}},created(){this.handleParentRouteRedirect()},watch:{$route:{immediate:!0,handler(t){this.handleParentRouteRedirect()}}},methods:{handleParentRouteRedirect(){(this.$route.path===this.parentPath||this.$route.path===`${this.parentPath}/`)&&this.sections.length>0&&this.$nextTick(()=>{this.$router.push(this.sections[0].path).catch(t=>{if(t.name!=="NavigationDuplicated")throw t})})},isFirstTabActive(t){return this.$route.path===this.parentPath&&this.sections.length>0&&this.sections[0].path===t.path}}},Uu={class:"woolentor-opt-sub-sections-wrapper"},Bu={key:0,class:"woolentor-nested-tabs-area"},zu={class:"woolentor-nested-tabs"},Hu=["onClick"];function ju(t,e,o,n,s,i){const a=V("router-link"),r=V("router-view");return p(),y("div",Uu,[o.sections.length>0?(p(),y("div",Bu,[l("ul",zu,[(p(!0),y(B,null,ee(o.sections,f=>(p(),y("li",{key:f.path},[f.name?(p(),w(a,{key:0,to:f.path,custom:""},{default:m(({navigate:d,isActive:u,isExactActive:g})=>[l("a",{href:"#",onClick:d,class:x(["woolentor-opt-sub-section",{wlactive:u||i.isFirstTabActive(f)},{"wlexact-active":g}])},A(f.name),11,Hu)]),_:2},1032,["to"])):C("",!0)]))),128))])])):C("",!0),c(r,{model:o.model,content:o.content},null,8,["model","content"])])}const $u=M(Vu,[["render",ju],["__scopeId","data-v-43f1a2c6"]]),Wu={name:"License",setup(){const{licenseInfo:t,isLoading:e,isActivating:o,isDeactivating:n,isValid:s,activateLicense:i,deactivateLicense:a,initializeLicense:r}=Di(),f=F(null),d=Mo({licenseKey:"",email:""}),u=F(!1),g={licenseKey:[{required:!0,message:"Please enter your license key",trigger:"submit"}],email:[{required:!0,message:"Please enter your email",trigger:"submit"},{type:"email",message:"Please enter a valid email address",trigger:"submit"}]},_=Q(()=>s.value?"ShopLentor Pro License Info":"ShopLentor Pro Licensing"),v=async()=>{if(f.value)try{await f.value.validate();const T=await i(d.licenseKey,d.email);if(T?.data?.is_valid)te({message:"License activated successfully!",type:"success",duration:3e3,offset:50});else throw new Error(T?.message||"License activation failed")}catch(T){te({message:T.message||"Failed to activate license. Please check your inputs and try again.",type:"error",duration:4e3,offset:50})}},h=()=>{u.value=!0},b=async()=>{try{u.value=!1,await a(),te({message:"License deactivated successfully",type:"success",duration:3e3,offset:50}),d.licenseKey="",d.email=window?.woolentorOptions?.userData?.email||""}catch{te({message:"Failed to deactivate license. Please try again.",type:"error",duration:4e3,offset:50})}};return it(async()=>{d.email=window?.woolentorOptions?.userData?.email||""}),{formData:d,formRules:g,licenseForm:f,showDeactivateConfirm:u,pageTitle:_,licenseInfo:t,isLoading:e,isActivating:o,isDeactivating:n,isValid:s,handleActivation:v,confirmDeactivation:h,handleDeactivation:b}}},qu={class:"license-management-wrapper"},Ku={class:"card-header"},Yu={key:1},Ju={key:0,class:"loading-state"},Xu={key:1,class:"license-form"},Qu={key:2,class:"license-info"},Zu={class:"license-details"},ep={class:"action-buttons"},tp={class:"dialog-footer"};function np(t,e,o,n,s,i){const a=Lt,r=ht,f=Gs,d=pe,u=Fs,g=ln,_=ae,v=_t;return p(),y("div",qu,[c(_,{class:"license-card",shadow:"never"},{header:m(()=>[l("div",Ku,[n.isLoading?(p(),w(a,{key:0,rows:1,animated:""})):(p(),y("h3",Yu,A(n.pageTitle),1))])]),default:m(()=>[n.isLoading?(p(),y("div",Ju,[c(a,{rows:4,animated:""})])):n.isValid?(p(),y("div",Qu,[l("ul",Zu,[l("li",null,[e[8]||(e[8]=l("strong",null,"Status:",-1)),c(g,{type:"success"},{default:m(()=>e[7]||(e[7]=[k("Active")])),_:1})]),l("li",null,[e[9]||(e[9]=l("strong",null,"License Type:",-1)),l("span",null,A(n.licenseInfo?.data?.license_title),1)]),l("li",null,[e[10]||(e[10]=l("strong",null,"License Key:",-1)),l("span",null,A(n.licenseInfo?.data?.license_key),1)]),l("li",null,[e[11]||(e[11]=l("strong",null,"Expiry Date:",-1)),l("span",null,A(n.licenseInfo?.data?.expire_date),1)]),l("li",null,[e[12]||(e[12]=l("strong",null,"Support Until:",-1)),l("span",null,A(n.licenseInfo?.data?.support_end),1)])]),l("div",ep,[c(d,{type:"danger",onClick:n.confirmDeactivation,loading:n.isDeactivating,size:"large"},{default:m(()=>e[13]||(e[13]=[k(" Deactivate License ")])),_:1},8,["onClick","loading"])])])):(p(),y("div",Xu,[e[6]||(e[6]=l("p",{class:"form-description"},"Enter your license key here, to activate the product, and get future updates and premium support.",-1)),c(u,{ref:"licenseForm",model:n.formData,rules:n.formRules,onSubmit:he(n.handleActivation,["prevent"])},{default:m(()=>[c(f,{prop:"licenseKey"},{default:m(()=>[c(r,{modelValue:n.formData.licenseKey,"onUpdate:modelValue":e[0]||(e[0]=h=>n.formData.licenseKey=h),placeholder:"Enter your license key",disabled:n.isActivating,size:"large","validate-event":!1},null,8,["modelValue","disabled"])]),_:1}),c(f,{prop:"email"},{default:m(()=>[c(r,{modelValue:n.formData.email,"onUpdate:modelValue":e[1]||(e[1]=h=>n.formData.email=h),placeholder:"Enter your email",disabled:n.isActivating,size:"large","validate-event":!1},null,8,["modelValue","disabled"])]),_:1}),e[5]||(e[5]=l("p",{class:"form-description"},"We will send update news of this product by this email address, don't worry, we hate spam",-1)),c(f,null,{default:m(()=>[c(d,{type:"primary",onClick:n.handleActivation,loading:n.isActivating,size:"large"},{default:m(()=>e[4]||(e[4]=[k(" Activate License ")])),_:1},8,["onClick","loading"])]),_:1})]),_:1},8,["model","rules","onSubmit"])]))]),_:1}),c(v,{modelValue:n.showDeactivateConfirm,"onUpdate:modelValue":e[3]||(e[3]=h=>n.showDeactivateConfirm=h),title:"Confirm Deactivation",width:"30%","close-on-click-modal":!1},{footer:m(()=>[l("span",tp,[c(d,{onClick:e[2]||(e[2]=h=>n.showDeactivateConfirm=!1)},{default:m(()=>e[14]||(e[14]=[k("Cancel")])),_:1}),c(d,{type:"danger",onClick:n.handleDeactivation},{default:m(()=>e[15]||(e[15]=[k(" Confirm Deactivation ")])),_:1},8,["onClick"])])]),default:m(()=>[e[16]||(e[16]=l("span",null,"Are you sure you want to deactivate your license? This will disable all pro features.",-1))]),_:1},8,["modelValue"])])}const op=M(Wu,[["render",np],["__scopeId","data-v-d6ff66f7"]]),sp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAtFBMVEUAAABpG0KiK2qPKWqIJFlMG0dIKXWCKmuTKmnOLWCxLGhnKG54Km6FKm2iKmRwH06LLGhhKHDAMGh9K2+OJ2NRKnRqKm+sK2XGK2FQKXTGK2F+KGeGJ2VhJWGNI1pIKHRyKG7NLGClKmaTJFhIKHVyK22iK2jNLWBHH1iKIE5BG0xAKHjXMGBYKXJhKXC1K2S9K2JpKW9yKW56Km2cKmekK2asK2VQKXPFK2GCKmuLKmqTKmkdwDxUAAAALXRSTlMALre2cS/f39/fvby0tHdLIBAQ1NHPz8/Pv7+kpIuLgICAf3FgYGBgS0gvICCieEKSAAAAgklEQVQI1y2LVw6DMADFXoAUWjbde+8mBBLKuv+9CBL+s2QDSC6TVKye6IkcVfxTUY1/WuymHSzBXdahERDyFtUZi1wSc2YY+tuAZzn1d9Y10CUYz6i3tayD/rBm/ONNfdNUxRLHkr3cPSVhqx6IRyXTn6wbB8B3MDtCz23OuHuKgQ4HOxBzb+pgVAAAAABJRU5ErkJggg==",ip="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAbFBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0Iv+qAAAAJHRSTlMAm4V7KoyAa1A2tpFoYDkwvqSUdnJuZlciEQtxPCYeGKFMPwUf47jtAAAAeklEQVQI1w3MRQKEMBAF0d8ddxyCjtz/jmRZi3owV+Cy6vRhZ2H+R++Ins7UETZkXwSl3vINq1ljwy36YcH0KFQAUrmEk6cNQlYMnUMm3hEtQP4ESpF7m+KSgZUUt4pKN+D7I8Pkj5kuCRFgohjTCDUj+7AKN/OkO/kCDLoGfh+oAXgAAAAASUVORK5CYII=",ap=(t,e,o="other")=>t.reduce((n,s)=>{const i=s[e]||o;return n[i]||(n[i]=[]),n[i].push(s),n},{}),xi=(t,e=23,o="....")=>{if(!t)return"";const n=t.split(/\s+/);return n.length>e?n.slice(0,e).join(" ")+" "+o:t},xt=t=>{if(!t)return"";const e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""},Fn=(t=0)=>(isNaN(t)?t=0:(t=parseFloat(t),t=Math.abs(t),t=Math.floor(t)),t),lp=(t=0,e=9)=>(t=Fn(t),e=Fn(e),Math.floor(Math.random()*(e-t+1)+t)),rp=(t=0)=>(t=Fn(t),t=0<t?t:Date.now()+""+lp(1,9),Fn(t)),Vn=t=>Array.isArray(t)?t.map(e=>Math.abs(e).toString()):Math.abs(t).toString(),Qo=t=>Array.isArray(t)?t.map(e=>Math.abs(Number(e))):Math.abs(Number(t)),Oe=(t,e="woolentor")=>window.wp?.i18n?.__(t,e)||t,cp={class:"template-card"},dp={class:"template-thumbnail"},up={class:"image-placeholder"},pp={key:0,class:"new-badge"},fp={class:"quick-view-overlay"},mp={class:"template-info"},gp={class:"builder-badge"},hp=["src","alt"],_p={class:"template-header"},yp={class:"template-title"},vp={class:"template-actions"},bp={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Tp={__name:"TemplateGrid",props:{template:{type:Object,required:!0},checkingRequirement:{type:Number,default:!1}},emits:["preview","import"],setup(t,{emit:e}){const o=t,n=e,s=Q(()=>o.template.builder?.includes("elementor")?"Elementor":o.template.builder?.includes("gutenberg")?"Gutenberg":"Builder"),i=Q(()=>o.template.builder?.includes("elementor")?sp:ip),a=Q(()=>{if(!o.template.human_date)return!1;const u=new Date(o.template.human_date);if(isNaN(u.getTime()))return!1;const g=new Date;return g.setDate(g.getDate()-30),u>=g}),r=u=>{n("preview",u)},f=u=>{n("import",u)},d=()=>{o.template.url&&window.open(o.template.url,"_blank")};return(u,g)=>{const _=V("PictureFilled"),v=Ae,h=Vo,b=pe,T=ln;return p(),y("div",cp,[l("div",dp,[c(h,{src:t.template.thumbnail,alt:t.template.title,loading:"lazy",style:{"transform-origin":"top"},class:"library-template-image"},{error:m(()=>[l("div",up,[c(v,null,{default:m(()=>[c(_)]),_:1})])]),_:1},8,["src","alt"]),a.value?(p(),y("span",pp,A(ve(Oe)("New","woolentor")),1)):C("",!0),l("div",fp,[c(b,{size:"large",onClick:g[0]||(g[0]=D=>r(t.template))},{icon:m(()=>g[2]||(g[2]=[l("svg",{width:"16",height:"15",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})],-1)])),default:m(()=>[k(" "+A(ve(Oe)("Quick View","woolentor")),1)]),_:1})])]),l("div",mp,[l("div",gp,[l("img",{src:i.value,alt:s.value,class:"builder-icon"},null,8,hp),l("span",null,A(s.value),1)]),l("div",_p,[l("h3",yp,A(t.template.title),1),c(T,{type:t.template.tmpType==="pro"?"warning":"success",size:"small",effect:"plain",round:""},{default:m(()=>[k(A(t.template.tmpType==="pro"?"PRO":"FREE"),1)]),_:1},8,["type"])]),l("div",vp,[c(b,{size:"large",onClick:d},{icon:m(()=>g[3]||(g[3]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[l("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),l("polyline",{points:"15 3 21 3 21 9"}),l("line",{x1:"10",y1:"14",x2:"21",y2:"3"})],-1)])),default:m(()=>[k(" "+A(ve(Oe)("Live Demo","woolentor")),1)]),_:1}),c(b,{type:"primary",plain:"",size:"large",loading:t.checkingRequirement===t.template.id,disabled:t.checkingRequirement===t.template.id,onClick:g[1]||(g[1]=D=>f(t.template))},ks({default:m(()=>[k(" "+A(t.template.isPro?ve(Oe)("Buy Now","woolentor"):ve(Oe)("Import","woolentor")),1)]),_:2},[t.template.isPro?{name:"icon",fn:m(()=>[g[4]||(g[4]=l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[l("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),l("polyline",{points:"15 3 21 3 21 9"}),l("line",{x1:"10",y1:"14",x2:"21",y2:"3"})],-1))]),key:"0"}:{name:"icon",fn:m(()=>[t.checkingRequirement!==t.template.id?(p(),y("svg",bp,g[5]||(g[5]=[l("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},null,-1),l("polyline",{points:"7 10 12 15 17 10"},null,-1),l("line",{x1:"12",y1:"15",x2:"12",y2:"3"},null,-1)]))):(p(),w(v,{key:1,class:"is-loading"},{default:m(()=>[c(ve(Kn))]),_:1}))]),key:"1"}]),1032,["loading","disabled"])])])])}}},ki=M(Tp,[["__scopeId","data-v-bae5cefe"]]),Ep={key:0,class:"woolentor-options-notice-area"},Cp={class:"templates-header"},Sp={class:"header-title"},Ap={class:"header-actions"},Dp={__name:"TemplateHeader",props:{selectedCategory:{type:String,required:!0},categories:{type:Array,required:!0},industries:{type:Array,default:()=>[]},searchQuery:{type:String,default:""},isRefreshing:{type:Boolean,default:!1},selectedBuilder:{type:String,default:"all"},sortOrder:{type:String,default:"popular"},industry:{type:String,default:"all"}},emits:["handleRefresh","update:searchQuery","update:sortOrder","update:industry"],setup(t,{emit:e}){const o={name:"Crown",render(){return Pn("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em"},[Pn("path",{d:"M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm14 3c0 .6-.4 1-1 1H6c-.6 0-1-.4-1-1v-1h14v1z"})])}},n=t,s=e,i=()=>{s("handleRefresh")},a=h=>{s("update:searchQuery",h)},r=Q({get:()=>n.sortOrder,set:h=>s("update:sortOrder",h)}),f=Q({get:()=>n.industry,set:h=>s("update:industry",h)}),d=h=>{const b=n.categories.find(T=>T.id===h);return b?b.name+" Templates":"Templates"},u=()=>woolentorOptions?.isPro==="yes",g=h=>{window.open(h,"_blank")},_={notice:{message:"If you want to use these templates, you need to install and activate the Elementor plugin.",type:"warning"}},v=()=>n.selectedBuilder==="elementor"?!!woolentorOptions?.tabs?.elements?.content?.notice?.condition:!1;return(h,b)=>{const T=Fo,D=ht,S=It,P=Ot,O=pe,L=Ae;return p(),y(B,null,[v()?(p(),y("div",Ep,[c(T,{title:_.notice.title,type:_.notice.type,description:_.notice.message,closable:!1,center:"","show-icon":""},null,8,["title","type","description"])])):C("",!0),l("div",Cp,[l("h1",Sp,A(n.selectedCategory==="all"?ve(Oe)("All Templates","woolentor"):d(n.selectedCategory)),1),l("div",Ap,[c(D,{modelValue:n.searchQuery,"onUpdate:modelValue":b[0]||(b[0]=R=>n.searchQuery=R),placeholder:ve(Oe)("Search templates...","woolentor"),"prefix-icon":ve(Uo),clearable:"",class:"search-input",size:"large",onInput:a},null,8,["modelValue","placeholder","prefix-icon"]),c(P,{size:"large",modelValue:r.value,"onUpdate:modelValue":b[1]||(b[1]=R=>r.value=R),class:"sort-filter",placeholder:ve(Oe)("Popular","woolentor")},{default:m(()=>[c(S,{label:ve(Oe)("Popular","woolentor"),value:"popular"},null,8,["label"]),c(S,{label:ve(Oe)("A to Z","woolentor"),value:"a-z"},null,8,["label"]),c(S,{label:ve(Oe)("Z to A","woolentor"),value:"z-a"},null,8,["label"]),c(S,{label:ve(Oe)("Newest First","woolentor"),value:"newest"},null,8,["label"])]),_:1},8,["modelValue","placeholder"]),c(P,{size:"large",modelValue:f.value,"onUpdate:modelValue":b[2]||(b[2]=R=>f.value=R),class:"industry-filter",placeholder:ve(Oe)("All Industry","woolentor")},{default:m(()=>[c(S,{label:ve(Oe)("All Industry","woolentor"),value:"all"},null,8,["label"]),(p(!0),y(B,null,ee(n.industries,R=>(p(),w(S,{key:R,label:ve(xt)(R),value:R},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"]),c(O,{icon:ve(Bo),circle:"",loading:n.isRefreshing,onClick:i,size:"large"},null,8,["icon","loading"]),u()?C("",!0):(p(),w(O,{key:0,type:"primary",size:"large",onClick:b[3]||(b[3]=R=>g("https://woolentor.com/pricing/?utm_source=admin&utm_medium=library"))},{default:m(()=>[c(L,{style:{"margin-right":"4px"}},{default:m(()=>[c(o)]),_:1}),k(" "+A(ve(Oe)("Upgrade to PRO","woolentor")),1)]),_:1}))])])],64)}}},Ri=M(Dp,[["__scopeId","data-v-bcca81f2"]]),Lp={class:"categories-sidebar"},Ip={class:"sidebar-header"},Op={class:"sidebar-content"},Np={class:"pricing-filter-tabs"},xp={class:"skeleton-category",style:{display:"flex","justify-content":"space-between"}},kp={key:1,class:"category-list"},Rp=["onClick"],Pp={__name:"TemplateSidebar",props:{categories:{type:Array,required:!0},selectedCategory:{type:String,required:!0},isLoading:{type:Boolean,default:!1},filterType:{type:String,default:"all"},pricingFilter:{type:String,default:"all"}},emits:["select-category","update:filterType","update:pricingFilter"],setup(t,{emit:e}){const o=t,n=e,s=r=>{n("select-category",r)},i=Q({get:()=>o.filterType,set:r=>{r!==o.filterType&&n("update:filterType",r)}}),a=Q({get:()=>o.pricingFilter,set:r=>{r!==o.pricingFilter&&n("update:pricingFilter",r)}});return(r,f)=>{const d=pe,u=It,g=Ot,_=Wn,v=Lt,h=ln,b=on;return p(),y("div",Lp,[l("div",Ip,[f[4]||(f[4]=l("h3",null,"Categories",-1)),c(d,{type:"text",icon:ve(Ia),link:""},null,8,["icon"])]),l("div",Op,[c(g,{size:"large",modelValue:i.value,"onUpdate:modelValue":f[0]||(f[0]=T=>i.value=T),placeholder:"All Builders",class:"filter-select",disabled:t.isLoading},{default:m(()=>[c(u,{label:"All Builders",value:"all"}),c(u,{label:"Elementor",value:"elementor"}),c(u,{label:"Gutenberg",value:"gutenberg"})]),_:1},8,["modelValue","disabled"]),l("div",Np,[l("button",{class:x(["pricing-tab",{active:a.value==="all"}]),onClick:f[1]||(f[1]=T=>a.value="all")},"All",2),l("button",{class:x(["pricing-tab",{active:a.value==="free"}]),onClick:f[2]||(f[2]=T=>a.value="free")},"Free",2),l("button",{class:x(["pricing-tab",{active:a.value==="pro"}]),onClick:f[3]||(f[3]=T=>a.value="pro")},"PRO",2)]),t.isLoading?(p(),y(B,{key:0},ee(16,T=>l("div",{key:T,class:"category-skeleton",style:{margin:"20px 0"}},[c(v,{animated:""},{template:m(()=>[l("div",xp,[c(_,{variant:"text",style:{width:"85%",height:"20px"}}),c(_,{variant:"text",style:{width:"10%",height:"20px"}})])]),_:1})])),64)):(p(),y("div",kp,[c(b,{"max-height":"calc(100vh - 200px)"},{default:m(()=>[(p(!0),y(B,null,ee(t.categories,T=>(p(),y("div",{key:T.id,class:x(["category-item",{active:t.selectedCategory===T.id}]),onClick:D=>s(T)},[l("span",null,A(T.name),1),c(h,{type:"primary",class:x({active:t.selectedCategory===T.id}),effect:t.selectedCategory===T.id?"dark":"light",round:""},{default:m(()=>[k(A(T.count),1)]),_:2},1032,["class","effect"])],10,Rp))),128))]),_:1})]))])])}}},Pi=M(Pp,[["__scopeId","data-v-e1f50010"]]),Mp={name:"TemplateGridSkeleton",props:{numberOfGrid:{type:Number,default:12}}},Gp={class:"templategrid-skeleton"},Fp={class:"skeleton-card",style:{"margin-top":"20px"}},Vp={class:"skeleton-content"},Up={class:"skeleton-buttons"};function Bp(t,e,o,n,s,i){const a=Wn,r=rt,f=lt,d=Lt;return p(),y("div",Gp,[c(d,{animated:"",rows:1},{template:m(()=>[c(f,{gutter:20},{default:m(()=>[(p(!0),y(B,null,ee(o.numberOfGrid,u=>(p(),w(r,{xs:24,sm:24,md:8,lg:8,xl:6,key:u},{default:m(()=>[l("div",Fp,[c(a,{variant:"image",style:{width:"100%",height:"200px"}}),l("div",Vp,[c(a,{variant:"text",style:{width:"80%",margin:"10px 0"}}),l("div",Up,[c(a,{variant:"button",style:{width:"45%",height:"35px"}}),c(a,{variant:"button",style:{width:"45%",height:"35px"}})])])])]),_:2},1024))),128))]),_:1})]),_:1})])}const zp=M(Mp,[["render",Bp],["__scopeId","data-v-045c5052"]]);function Hp(){const t=$n(),e=F(null),o=F(!1),n=Q(()=>t.getters["template/GET_TEMPLATES_LOADING"]),s=Q(()=>t.getters["template/GET_TEMPLATES"]||[]),i=Q(()=>t.getters["template/GET_FILTERED_TEMPLATES"]||[]),a=Q(()=>t.getters["template/GET_CATEGORIES"]||[]),r=Q(()=>t.getters["template/GET_GUTENBERG_TEMPLATES"]||[]),f=Q(()=>t.getters["template/GET_GUTENBERG_CATEGORIES"]||[]);return{isLoading:n,isImporting:o,templates:s,filteredTemplates:i,categories:a,gutenbergTemplates:r,gutenbergCategories:f,error:e,initializeTemplates:async()=>{e.value=null;try{await ut.init()}catch(h){e.value=h}},refreshTemplates:async()=>{e.value=null;try{await ut.refreshTemplates()}catch(h){e.value=h}},initializeGutenbergTemplates:async()=>{e.value=null;try{await ut.initGutenberg()}catch(h){e.value=h}},refreshGutenbergTemplates:async()=>{e.value=null;try{await ut.refreshGutenbergTemplates()}catch(h){e.value=h}},importTemplate:async(h,b)=>{e.value=null,o.value=!0;try{const T=await ut.importTemplate(h,b);return o.value=!1,T}catch(T){throw e.value=T,o.value=!1,T}},templateService:ut}}const jp={name:"TemplateLibrary",components:{TemplateGrid:ki,TemplateGridSkeleton:zp,SuccessFilled:ss,Loading:Kn,TemplateSidebar:Pi,TemplateHeader:Ri},setup(){const t=F(null),{PLUGIN_STATES:e,getPluginButtonText:o,handlePluginAction:n,fetchPluginStatus:s,initializePluginsWithData:i}=pn(),{isLoading:a,isImporting:r,templates:f,categories:d,gutenbergTemplates:u,gutenbergCategories:g,error:_,initializeTemplates:v,refreshTemplates:h,initializeGutenbergTemplates:b,refreshGutenbergTemplates:T,importTemplate:D}=Hp(),S=F(!1),P=F(!1),O=F("all"),L=F(""),R=F("all"),z=F("all"),W=F("popular"),se=F("all"),je=F(!1),De=F(!1),ue=F(null),Le=F(null),G=F(!1),ne=F(!1),le=F(null),re=F([]),ke=F(""),$e=F(null),We=F("builder"),Re=F(new Set),Qe=F(1),oo=F(16),dt=F(!0),Tt=Q(()=>R.value==="gutenberg"?u.value||[]:R.value==="elementor"?f.value||[]:[...f.value||[],...u.value||[]]),H=Q(()=>{let N=[];if(R.value==="gutenberg")N=g.value||[];else if(R.value==="elementor")N=d.value||[];else{const Z=new Map;[...d.value||[],...g.value||[]].forEach(Ve=>{if(Z.has(Ve.name)){const fe=Z.get(Ve.name);fe.count+=Ve.count}else Z.set(Ve.name,{...Ve})}),N=Array.from(Z.values())}return[...[{id:"all",name:"All Templates",count:Tt.value.length}],...N]}),kt=Q(()=>{let N=Tt.value;return O.value!=="all"&&(N=N.filter(U=>U.shareId.toLowerCase().replace(/\s+/g,"-")===O.value)),z.value==="free"?N=N.filter(U=>U.tmpType==="free"):z.value==="pro"&&(N=N.filter(U=>U.tmpType==="pro")),R.value==="elementor"?N=N.filter(U=>U.builder.includes("elementor")):R.value==="gutenberg"&&(N=N.filter(U=>U.builder.includes("gutenberg"))),N}),gn=Q(()=>{const N=new Set;return kt.value.forEach(U=>{U.industry&&Array.isArray(U.industry)&&U.industry.forEach(Z=>{Z&&N.add(Z)})}),Array.from(N).sort()}),so=Q(()=>{let N=kt.value;if(se.value!=="all"&&(N=N.filter(U=>U.industry&&Array.isArray(U.industry)&&U.industry.includes(se.value))),L.value){const U=L.value.toLowerCase();N=N.filter(Z=>Z.title.toLowerCase().includes(U)||Z.shareId?.toLowerCase().includes(U))}if(W.value==="popular"){const U=Z=>Z.tags&&Array.isArray(Z.tags)&&Z.tags.some(Ke=>Ke.toLowerCase()==="popular");N=[...N].sort((Z,Ke)=>{const Ve=U(Z)?0:1,fe=U(Ke)?0:1;return Ve-fe})}else W.value==="a-z"?N=[...N].sort((U,Z)=>U.title.localeCompare(Z.title)):W.value==="z-a"?N=[...N].sort((U,Z)=>Z.title.localeCompare(U.title)):W.value==="newest"&&(N=[...N].sort((U,Z)=>(Z.id||0)-(U.id||0)));return N}),io=Q(()=>{const N=Qe.value*oo.value;return so.value.slice(0,N)}),aa=Q(()=>ue.value?ut.getAvailableDestinations(ue.value.shareId,ue.value.builder):{builder:!0,library:!1,page:!0}),la=Q(()=>!re.value||re.value.length===0?!0:re.value.every(N=>N.status===e.ACTIVE));Ft(gn,N=>{se.value!=="all"&&!N.includes(se.value)&&(se.value="all")}),Ft(De,N=>{N&&(We.value="builder",ke.value="")}),Ft([O,L,R,z,W,se],()=>{Qe.value=1,dt.value=!0}),Ft(R,async N=>{O.value="all";const U=[];if((N==="gutenberg"||N==="all")&&!P.value&&U.push(b().then(()=>{P.value=!0})),(N==="elementor"||N==="all")&&!S.value&&U.push(v().then(()=>{S.value=!0})),U.length>0)try{await Promise.all(U)}catch{de({title:"Error",message:"Failed to load templates. Please try again later.",type:"error",duration:4e3})}}),it(async()=>{try{const N=[];(R.value==="elementor"||R.value==="all")&&N.push(v().then(()=>{S.value=!0})),(R.value==="gutenberg"||R.value==="all")&&N.push(b().then(()=>{P.value=!0})),await Promise.all(N)}catch{de({title:"Error",message:"Failed to load templates. Please try again later.",type:"error",duration:4e3})}});const ra=N=>{const U=H.value.find(Z=>Z.id===N);return U?U.name+" Templates":"Templates"},ca=()=>{if(!le.value)return;const{scrollTop:N,scrollHeight:U,clientHeight:Z}=le.value;N+Z>=U-200&&!ne.value&&dt.value&&ns()},ns=async()=>{const N=so.value.length;if(io.value.length>=N){dt.value=!1;return}ne.value=!0;try{await new Promise(Z=>setTimeout(Z,800)),Qe.value++,io.value.length>=N&&(dt.value=!1)}catch(Z){console.error("Error loading more templates:",Z)}finally{ne.value=!1}};return{selectedCategory:O,searchQuery:L,filterType:R,pricingFilter:z,sortOrder:W,industry:se,isLoading:a,isImporting:r,isRefreshing:G,previewDialogVisible:je,importDialogVisible:De,selectedTemplate:ue,importingTemplateId:Le,loadingMore:ne,hasMoreTemplates:dt,templatesGridRef:le,requiredPlugins:re,isCheckingRequirement:t,PLUGIN_STATES:e,pageTitle:ke,importResponse:$e,selectedDestination:We,categories:H,industries:gn,templates:Tt,filteredTemplates:so,displayedTemplates:io,availableDestinations:aa,allPluginsReady:la,getCategoryName:ra,handlePreview:N=>{ue.value=N,je.value=!0},handleImport:async N=>{if(N.isPro){window.open("https://woolentor.com/pricing/?utm_source=admin&utm_medium=library","_blank");return}t.value=N.id,$e.value=null;try{const U=N?.builder.includes("elementor")?["elementor//elementor.php//Elementor"]:[],Z=N?.proPlugins||[],Ke=[...U.map(fe=>{const we=fe.split("//");return{slug:we[0],location:`${we[0]}/${we[1]}`,name:we[2],isLoading:!1,link:typeof we[3]<"u"?`https://${we[3]}`:"#",status:"not_installed"}}),...Z.map(fe=>{const we=fe.split("//");return{slug:we[0],location:`${we[0]}/${we[1]}`,name:we[2],isLoading:!1,link:typeof we[3]<"u"?`https://${we[3]}`:"#",status:"not_installed",is_pro:!0}})];Ke.forEach(fe=>{Re.value.has(fe.slug)&&(fe.status="active")});const Ve=Ke.filter(fe=>fe.status!=="active").map(fe=>fe.slug);if(Ve.length>0){let fe=null;const we=Ve.join(",")+"cache",os=K.get(we);os?fe=os:(fe=await s(Ve),K.set(we,fe,{duration:6e3})),Ke.forEach(hn=>{if(hn.status!=="active"){const ao=fe.find(da=>da.slug===hn.slug);ao&&(hn.status=ao.status,ao.status==="active"&&Re.value.add(hn.slug))}})}re.value=Ke,ue.value=N,De.value=!0}catch(U){console.error("Error checking template import status:",U)}finally{t.value=null}},confirmImport:async(N="builder")=>{if(ue.value){Le.value=ue.value.id,ke.value&&(ue.value.title=ke.value);try{const U=await D(ue.value,N);U.id&&($e.value=U),de({title:"Success",message:`"${ue.value.title}" has been imported successfully.`,type:"success",duration:3e3,position:"top-right",offset:30})}catch(U){de({title:"Error",message:U.message||"Failed to import template. Please try again.",type:"error",duration:4e3,position:"top-right",offset:30})}finally{Le.value=null}}},handleRefresh:async()=>{G.value=!0,Qe.value=1,dt.value=!0;try{R.value==="all"?await Promise.all([h(),T()]):R.value==="gutenberg"?await T():await h(),de({title:"Success",message:"Templates refreshed successfully.",type:"success",duration:2e3,position:"top-right",offset:30})}catch{de({title:"Error",message:"Failed to refresh templates. Please try again.",type:"error",duration:3e3,position:"top-right",offset:30})}finally{G.value=!1}},handleScroll:ca,loadMoreTemplates:ns,handleCategorySelect:N=>{O.value=N.id},getPluginButtonText:o,handlePluginAction:n,toggleActivation:async N=>{if(N.status===e.NOT_INSTALLED&&N?.is_pro){window.open(N.link,"_blank");return}else{const U=re.value.findIndex(Z=>Z.slug===N.slug);if(U===-1)return;re.value[U].isLoading=!0;try{const Z=await n(N,(Ke,Ve)=>{const fe=re.value.findIndex(we=>we.slug===Ke);fe!==-1&&(re.value[fe].status=Ve)});Z&&(re.value[U].status=Z,Z===e.ACTIVE&&Re.value.add(N.slug))}finally{re.value[U].isLoading=!1}}},goEdit:()=>{let N=`${woolentorOptions.adminUrl}post.php?post=${$e.value.id}&action=${$e.value.edit_action}`;window.open(N,"_blank")},openPreviewLiveDemo:()=>{ue.value?.url&&window.open(ue.value.url,"_blank")},getTemplateBuilder:()=>ue.value?.builder.includes("elementor")?"elementor":"builder",__:Oe,SuccessFilled:ss}}},$p={class:"template-library-container"},Wp={class:"templates-content"},qp={key:0,class:"loading-more"},Kp={key:1,class:"end-of-results"},Yp={key:0,class:"preview-content"},Jp={class:"preview-image-wrapper"},Xp={class:"preview-footer"},Qp={key:0,class:"loading",style:{"text-align":"center","margin-bottom":"20px","padding-top":"20px","border-top":"1px solid #ddd"}},Zp={key:0,style:{"text-align":"center","border-top":"1px solid #ddd","padding-top":"30px","margin-bottom":"30px"}},ef={class:"success-icon"},tf={style:{"margin-top":"0"}},nf={class:"success-actions",style:{margin:"20px 0 15px"}},of={key:1},sf={key:0,class:"required-plugins"},af={class:"plugin-info"},lf={class:"plugin-actions"},rf={class:"import-destinations"},cf={key:0,class:"page-name-section"};function df(t,e,o,n,s,i){const a=Pi,r=Ri,f=V("TemplateGridSkeleton"),d=V("templates"),u=Ps,g=ki,_=rt,v=lt,h=Vo,b=pe,T=_t,D=V("Loading"),S=Ae,P=V("SuccessFilled"),O=ht;return p(),y("div",$p,[c(a,{categories:n.categories,selectedCategory:n.selectedCategory,isLoading:n.isLoading,filterType:n.filterType,"onUpdate:filterType":e[0]||(e[0]=L=>n.filterType=L),pricingFilter:n.pricingFilter,"onUpdate:pricingFilter":e[1]||(e[1]=L=>n.pricingFilter=L),onSelectCategory:n.handleCategorySelect},null,8,["categories","selectedCategory","isLoading","filterType","pricingFilter","onSelectCategory"]),l("div",Wp,[c(r,{selectedCategory:n.selectedCategory,categories:n.categories,industries:n.industries,selectedBuilder:n.filterType,searchQuery:n.searchQuery,"onUpdate:searchQuery":e[2]||(e[2]=L=>n.searchQuery=L),sortOrder:n.sortOrder,"onUpdate:sortOrder":e[3]||(e[3]=L=>n.sortOrder=L),industry:n.industry,"onUpdate:industry":e[4]||(e[4]=L=>n.industry=L),isRefreshing:n.isRefreshing,onHandleRefresh:n.handleRefresh},null,8,["selectedCategory","categories","industries","selectedBuilder","searchQuery","sortOrder","industry","isRefreshing","onHandleRefresh"]),l("div",{class:"templates-grid",ref:"templatesGridRef",onScroll:e[5]||(e[5]=(...L)=>n.handleScroll&&n.handleScroll(...L))},[n.isLoading&&!n.loadingMore?(p(),w(d,{key:0},{default:m(()=>[c(f)]),_:1})):(p(),w(d,{key:1},{default:m(()=>[n.displayedTemplates.length===0?(p(),w(u,{key:0,description:"No templates found"})):(p(),y(B,{key:1},[c(v,{gutter:20},{default:m(()=>[(p(!0),y(B,null,ee(n.displayedTemplates,L=>(p(),w(_,{key:L.id,xs:24,sm:24,md:12,lg:8,xl:6},{default:m(()=>[c(g,{template:L,onPreview:n.handlePreview,onImport:n.handleImport,checkingRequirement:n.isCheckingRequirement},null,8,["template","onPreview","onImport","checkingRequirement"])]),_:2},1024))),128))]),_:1}),n.loadingMore?(p(),y("div",qp,[c(f,{numberOfGrid:4})])):C("",!0),!n.hasMoreTemplates&&n.displayedTemplates.length>0&&!n.loadingMore?(p(),y("div",Kp,e[14]||(e[14]=[l("span",null,"All Templates have been Loaded",-1)]))):C("",!0)],64))]),_:1}))],544)]),c(T,{modelValue:n.previewDialogVisible,"onUpdate:modelValue":e[6]||(e[6]=L=>n.previewDialogVisible=L),"z-index":9995,title:n.selectedTemplate?.title||"Template Preview",fullscreen:!1,"show-close":!0,class:"template-preview-dialog",top:"46px"},{footer:m(()=>[l("div",Xp,[c(b,{size:"large",type:"primary",plain:"",onClick:n.openPreviewLiveDemo},{icon:m(()=>e[15]||(e[15]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[l("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),l("polyline",{points:"15 3 21 3 21 9"}),l("line",{x1:"10",y1:"14",x2:"21",y2:"3"})],-1)])),default:m(()=>[k(" "+A(n.__("Live Demo","woolentor")),1)]),_:1},8,["onClick"])])]),default:m(()=>[n.selectedTemplate?(p(),y("div",Yp,[l("div",Jp,[c(h,{src:n.selectedTemplate.fullimage||n.selectedTemplate.thumbnail,fit:"contain",class:"preview-scrollable-image"},null,8,["src"])])])):C("",!0)]),_:1},8,["modelValue","title"]),c(T,{modelValue:n.importDialogVisible,"onUpdate:modelValue":e[13]||(e[13]=L=>n.importDialogVisible=L),title:`${n.selectedTemplate?.shareId} → ${n.selectedTemplate?.title}`||"Import Template",width:"30%","close-on-click-modal":!1,class:"template-import-dialog"},{default:m(()=>[n.isImporting?(p(),y("div",Qp,[c(S,{class:"is-loading",size:"48"},{default:m(()=>[c(D)]),_:1}),e[16]||(e[16]=l("p",{style:{"margin-top":"10px"}},"Importing Template...",-1))])):(p(),y(B,{key:1},[n.importResponse?(p(),y("div",Zp,[l("div",ef,[c(S,{size:"48",color:"#67C23A"},{default:m(()=>[c(P)]),_:1})]),e[18]||(e[18]=l("h2",{style:{"margin-top":"0","margin-bottom":"5px"}},"Template Imported Successfully!",-1)),l("p",tf,A(n.selectedTemplate.shareId)+" -> "+A(n.selectedTemplate.title)+" has been imported.",1),l("div",nf,[c(b,{type:"primary",onClick:n.goEdit},{default:m(()=>[k(A(n.importResponse.edittxt),1)]),_:1},8,["onClick"]),c(b,{onClick:e[7]||(e[7]=L=>n.importDialogVisible=!1)},{default:m(()=>e[17]||(e[17]=[k("Close")])),_:1})])])):(p(),y("div",of,[n.allPluginsReady?C("",!0):(p(),y("div",sf,[l("ul",null,[(p(!0),y(B,null,ee(n.requiredPlugins.filter(L=>L.status!==n.PLUGIN_STATES.ACTIVE),L=>(p(),y("li",{key:L.id},[l("div",af,[l("span",null,A(L.name),1)]),l("div",lf,[c(b,{type:"primary",loading:L.isLoading,disabled:L.status===n.PLUGIN_STATES.ACTIVE||L.status===n.PLUGIN_STATES.INSTALLING||L.status===n.PLUGIN_STATES.ACTIVATING,onClick:R=>n.toggleActivation(L),class:x({"is-active":L.status==="active","is-not-installed":L.status==="not_installed"})},{default:m(()=>[k(A(L.status===n.PLUGIN_STATES.NOT_INSTALLED&&L?.is_pro?"Buy Now":n.getPluginButtonText(L.status,L.isLoading)),1)]),_:2},1032,["loading","disabled","onClick","class"])])]))),128))])])),l("div",rf,[l("div",{class:x(["destination-card",{active:n.selectedDestination==="builder"}]),onClick:e[8]||(e[8]=L=>n.selectedDestination="builder")},e[19]||(e[19]=[l("div",{class:"destination-radio"},null,-1),l("div",{class:"destination-info"},[l("h4",null,"Template Builder"),l("p",null,"Assign as a WooCommerce template (Shop, Cart, Checkout, etc.)")],-1)]),2),n.availableDestinations.library?(p(),y("div",{key:0,class:x(["destination-card",{active:n.selectedDestination==="library"}]),onClick:e[9]||(e[9]=L=>n.selectedDestination="library")},e[20]||(e[20]=[l("div",{class:"destination-radio"},null,-1),l("div",{class:"destination-info"},[l("h4",null,"Elementor Library"),l("p",null,"Save to Elementor's template library for reuse across any page")],-1)]),2)):C("",!0),n.availableDestinations.page?(p(),y("div",{key:1,class:x(["destination-card-group",{active:n.selectedDestination==="page"}])},[l("div",{class:x(["destination-card",{active:n.selectedDestination==="page","no-bottom-radius":n.selectedDestination==="page"}]),onClick:e[10]||(e[10]=L=>n.selectedDestination="page")},e[21]||(e[21]=[l("div",{class:"destination-radio"},null,-1),l("div",{class:"destination-info"},[l("h4",null,"Create New Page"),l("p",null,"Create a standalone page from this template")],-1)]),2),n.selectedDestination==="page"?(p(),y("div",cf,[c(O,{modelValue:n.pageTitle,"onUpdate:modelValue":e[11]||(e[11]=L=>n.pageTitle=L),placeholder:"Enter a name for the new page",clearable:!0,size:"large"},null,8,["modelValue"])])):C("",!0)],2)):C("",!0)]),c(b,{type:"primary",size:"large",onClick:e[12]||(e[12]=L=>n.confirmImport(n.selectedDestination)),disabled:!n.allPluginsReady||n.selectedDestination==="page"&&!n.pageTitle,style:{width:"100%"}},{default:m(()=>e[22]||(e[22]=[k(" Import Template ")])),_:1},8,["disabled"])]))],64))]),_:1},8,["modelValue","title"])])}const uf=M(jp,[["render",df],["__scopeId","data-v-ecb1f518"]]),vt=[];vt.push({path:"/setup-wizard",name:"SetupWizard",component:Fu,meta:{sidebar:!1,footer:!1,pathname:"setup-wizard",isCallApiRoute:!1,isWizard:!0},props:{showInNav:!1,default:{parentPath:"/setup-wizard",parentName:"Setup Wizard"}}});vt.push({path:"/",redirect:()=>woolentorOptions.onboarding.status?"/"+Object.keys(woolentorOptions.tabs)[0]:"/setup-wizard"});Object.keys(woolentorOptions.tabs).forEach(function(t){let e="/"+t,o=woolentorOptions.tabs[t].sections,n=[];if(typeof o<"u"){let s=woolentorOptions.tabs[t]?.save_under_parent||!1;Object.keys(o).forEach(function(i){let a=Object.keys(o)[0],r=s?ap(woolentorOptions.settings[woolentorOptions.tabs[t].id],"group",a)[i]:woolentorOptions.settings[o[i].id];n.push({path:e+"/"+i,name:o[i].title,component:vs,meta:{id:s?woolentorOptions.tabs[t]?.id:o[i].id,pathname:i,parentPathName:t,isCallApiRoute:o[i]?.is_api_route||!1},props:{fields:r}})})}vt.push({path:e,name:woolentorOptions.tabs[t].title,components:{default:$u,fields:vs},meta:{id:woolentorOptions.tabs[t].id,pathname:e.substring(1),isCallApiRoute:woolentorOptions.tabs[t]?.is_api_route||!1},props:{default:{sections:n,parentPath:e,parentName:woolentorOptions.tabs[t].title},fields:{fields:woolentorOptions.settings[woolentorOptions.tabs[t].id]},navIcon:woolentorOptions.tabs[t].icon,showInNav:woolentorOptions.tabs[t]?.show_in_nav||!1},children:n})});vt.push({path:"/template-library",name:"TemplateLibrary",component:uf,meta:{sidebar:!1,pathname:"template-library",isCallApiRoute:!1},props:{showInNav:!1,default:{parentPath:"/template-library",parentName:"Template Library"}}});woolentorOptions?.isPro==="yes"&&vt.push({path:"/license",name:"License",component:op,meta:{id:"license",pathname:"license",isCallApiRoute:!1,footer:!1},props:{showInNav:!1,default:{parentPath:"/license",parentName:"License"}}});vt.push({path:"/:pathMatch(.*)*",redirect:"/welcome"});const Mi=ga({history:ha(),routes:vt});Mi.beforeEach((t,e,o)=>{const n=vt.map(i=>i.path),s="/"+t.path.split("/")[1];if(s==="/setup-wizard"){if(woolentorOptions.onboarding.status){o("/welcome");return}o();return}if(!woolentorOptions.onboarding.status&&s!=="/setup-wizard"){o("/setup-wizard");return}n.includes(s)?o():o("/welcome")});function pf(t,e=[]){var o=jQuery;let n=o("#toplevel_page_"+t),s=window.location.href,i=s.substr(s.indexOf("admin.php")),a=i.substring(i.indexOf("/")+1);n.on("click","a",function(){var r=o(this);o("ul.wp-submenu li",n).removeClass("current"),r.hasClass("wp-has-submenu")?o("li.wp-first-item",n).addClass("current"):r.parents("li").addClass("current")}),o("ul.wp-submenu a",n).each(function(r,f){if(o(f).attr("href")===i){o(f).parent().addClass("current");return}else if(e.indexOf(a)!=-1){o("li.wp-first-item",n).addClass("current");return}})}function bs(){var t=jQuery;const e=t(".woolentor-navigation-wrapper"),o=t(".woolentor-opt-footer,.woolentor-sticky-condition");if(!o||!e)return;const n=e.offset()?.top+e.outerHeight(),s=t(window).scrollTop(),i=t(window).height(),a=t(document).height();n<s&&s+i!==a?o.addClass("woolentor-admin-sticky"):(s+i===a||n>s)&&o.removeClass("woolentor-admin-sticky")}const ff={class:"woolentor-editor-field"},mf={class:"woolentor-editor-tabs"},gf={class:"woolentor-editor-container"},hf=["value"],Gi={__name:"EditorField",props:{fieldData:{type:Object,required:!0},modelValue:{required:!0},placeholders:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(t,{emit:e}){const o={height:200,skin:"lightgray",theme:"modern",menubar:!1,statusbar:!1,branding:!1,plugins:"charmap colorpicker hr lists paste tabfocus textcolor fullscreen wordpress wpautoresize wpeditimage wpemoji wpgallery wplink wptextpattern",toolbar1:"formatselect bold italic bullist numlist blockquote alignleft aligncenter alignright link unlink wlac_placeholders wp_more wp_adv dfw",toolbar2:"strikethrough hr forecolor pastetext removeformat charmap outdent indent undo redo wp_help",force_br_newlines:!0,force_p_newlines:!1,forced_root_block:""},n=t,s=e,i=F(!1),a=F(null);let r=null;const f=Q(()=>n.modelValue||""),d=Q(()=>{const b=[{text:"Site Name",value:"{{site_name}}"},{text:"Site URL",value:"{{site_url}}"},{text:"Customer First Name",value:"{{customer_first_name}}"},{text:"Customer Last Name",value:"{{customer_last_name}}"},{text:"Customer Full Name",value:"{{customer_full_name}}"},{text:"Customer Email",value:"{{customer_email}}"}];if(Object.keys(n.placeholders).length>0){let T=[];return Object.keys(n.placeholders).forEach(function(D){T.push({text:n.placeholders[D],value:"{"+D+"}"})}),T}return b}),u=()=>{if(i.value){const b=a.value.value.replace(/\n/g,"<br>");s("update:modelValue",b),i.value=!1,h()}},g=()=>{if(!i.value){const b=(r?.getContent()||"").replace(/<br\s*\/?>/g,` `);r?.destroy(),r=null,a.value.value=b,s("update:modelValue",b),i.value=!0}},_=b=>{s("update:modelValue",b.target.value)},v=b=>{if(!b.addButton){console.warn("TinyMCE addButton method not available");return}try{b.addButton("wlac_placeholders",{text:"WLAC Placeholders",type:"menubutton",icon:"",menu:d.value.map(T=>({text:T.text,onclick:function(){b.insertContent(T.value)}}))})}catch(T){console.warn("Failed to add placeholder button:",T)}},h=()=>{if(!window.tinymce||!a.value||i.value)return;const T={...window.wp.editor.getDefaultSettings().tinymce,...o,target:a.value,setup:D=>{r=D,v(D),D.on("change",S=>{s("update:modelValue",D.getContent())}),D.on("init",()=>{const S=n.modelValue?.replace(/\n/g,"<br>")||"";D.setContent(S)})}};window.tinymce.init(T)};return Ft(()=>n.modelValue,b=>{if(r&&r.getContent()!==b){const T=b?.replace(/\n/g,"<br>");r.setContent(T||"")}}),it(()=>{h()}),_a(()=>{r&&r.destroy()}),(b,T)=>(p(),y("div",ff,[l("div",mf,[l("button",{type:"button",class:x(["woolentor-editor-tab-btn",{active:!i.value}]),onClick:u}," Visual ",2),l("button",{type:"button",class:x(["woolentor-editor-tab-btn",{active:i.value}]),onClick:g}," Text ",2)]),l("div",gf,[l("textarea",{ref_key:"editorRef",ref:a,value:f.value,class:"woolentor-editor-height",style:Ce({visibility:i.value?"visible":"hidden"}),onInput:_},null,44,hf)])]))}},_f={name:"EmailTemplateDrawer",components:{Clock:zo,Discount:Oa,Document:Na,InfoFilled:Vs,Message:Ho,View:jo,EditorField:Gi},props:{placeholders:{type:Object,default:()=>({})},visible:{type:Boolean,default:!1},templateData:{type:Object,default:()=>({id:null,name:"",subject:"",body:"",status:"active",coupon_data:{enable_coupon:!1,coupon_type:"percentage",coupon_amount:10,auto_generate:!0,coupon_code:"",coupon_prefix:"SAVE",coupon_length:8,coupon_expiry_days:7,minimum_amount:0}})},isCreatingTemplate:{type:Boolean,default:!1},isSaving:{type:Boolean,default:!1}},emits:["update:visible","template-saved"],setup(t,{emit:e}){const o=$n(),n={name:[{required:!0,message:"Template name is required",trigger:"blur"},{min:3,max:100,message:"Length should be 3 to 100 characters",trigger:"blur"}],subject:[{required:!0,message:"Email subject is required",trigger:"blur"},{min:5,max:200,message:"Length should be 5 to 200 characters",trigger:"blur"}],body:[{required:!0,message:"Email content is required",trigger:"blur"},{min:10,max:1e4,message:"Length should be 10 to 10000 characters",trigger:"blur"}]},s=F(null),i=F(!1),a=Mo({id:null,name:"",subject:"",body:"",status:"active",coupon_data:{enable_coupon:!1,coupon_type:"percentage",coupon_amount:10,auto_generate:!0,coupon_code:"",coupon_prefix:"SAVE",coupon_length:8,coupon_expiry_days:7,minimum_amount:0},...t.templateData,coupon_data:{enable_coupon:!1,coupon_type:"percentage",coupon_amount:10,auto_generate:!0,coupon_code:"",coupon_prefix:"SAVE",coupon_length:8,coupon_expiry_days:7,minimum_amount:0,...t.templateData.coupon_data}});Ft(()=>t.visible,b=>{if(b){const T={...t.templateData,coupon_data:{enable_coupon:!1,coupon_type:"percentage",coupon_amount:10,auto_generate:!0,coupon_code:"",coupon_prefix:"SAVE",coupon_length:8,coupon_expiry_days:7,minimum_amount:0,...t.templateData.coupon_data}};Object.assign(a,T)}},{immediate:!0});const r=Q({get:()=>a.status==="active",set:b=>{a.status=b?"active":"inactive"}}),f=Q(()=>i.value||t.isSaving),d=()=>{setTimeout(()=>{const b=document.querySelector(".email-template-drawer input");b&&b.focus()},300)},u=()=>{e("update:visible",!1)},g=b=>{a.coupon_data.enable_coupon=b,b||Object.assign(a.coupon_data,{enable_coupon:!1,coupon_type:"percentage",coupon_amount:10,auto_generate:!0,coupon_code:"",coupon_prefix:"SAVE",coupon_length:8,coupon_expiry_days:7,minimum_amount:0})},_=b=>{b&&(a.coupon_data.coupon_code="")},v=async()=>{if(!i.value)try{if(!await s.value.validate())return;i.value=!0;const T={name:a.name,subject:a.subject,body:a.body,status:a.status,coupon_data:a.coupon_data};!a.id?(await o.dispatch("abandonedCart/CREATE_EMAIL_TEMPLATE",T),te.success({message:"Template created successfully",duration:3e3,type:"success",offset:50})):(await o.dispatch("abandonedCart/UPDATE_EMAIL_TEMPLATE",{id:a.id,templateData:T}),te.success({message:"Template updated successfully",duration:3e3,type:"success",offset:50})),e("template-saved"),e("update:visible",!1)}catch(b){console.error("Error saving template:",b),te.error({message:`Failed to ${a.id?"update":"create"} template`,duration:3e3,type:"error",offset:50})}finally{i.value=!1}},h=()=>{e("update:visible",!1)};return{templateFormRef:s,isSavingLocal:i,currentTemplate:a,templateRules:n,isSaving:Q(()=>t.isSaving),isCreatingTemplate:Q(()=>t.isCreatingTemplate),templateStatusActive:r,isCurrentlySaving:f,handleDrawerOpen:d,handleDrawerClose:u,handleCouponToggle:g,handleAutoGenerateToggle:_,saveTemplate:v,cancelEdit:h}}},yf={class:"drawer-header"},vf={class:"drawer-title"},bf={class:"drawer-content"},Tf={class:"form-section"},wf={class:"section-title"},Ef={class:"form-grid"},Cf={class:"form-grid"},Sf={class:"form-grid"},Af={class:"form-section"},Df={class:"section-title"},Lf={class:"form-section"},If={class:"section-title"},Of={key:0,class:"coupon-settings"},Nf={class:"form-grid"},xf={class:"form-grid"},kf={class:"field-description"},Rf={class:"form-grid"},Pf={key:0,class:"form-grid"},Mf={key:1,class:"form-grid"},Gf={class:"form-grid"},Ff={class:"expiry-input-group"},Vf={class:"drawer-footer"};function Uf(t,e,o,n,s,i){const a=V("Message"),r=Ae,f=V("InfoFilled"),d=an,u=Gs,g=ht,_=V("Document"),v=Gi,h=V("Discount"),b=It,T=Ot,D=Us,S=Fs,P=on,O=pe,L=qn,R=sn;return p(),w(L,{"model-value":o.visible,"onUpdate:modelValue":e[11]||(e[11]=z=>t.$emit("update:visible",z)),title:n.isCreatingTemplate?"Create New Template":"Edit Template",size:"70%","with-header":!0,"destroy-on-close":"",class:"email-template-drawer woolentor-settings-drawer",style:{"max-width":"900px"},onOpen:n.handleDrawerOpen,onClose:n.handleDrawerClose},{header:m(()=>[l("div",yf,[l("h3",vf,[c(r,null,{default:m(()=>[c(a)]),_:1}),k(" "+A(n.isCreatingTemplate?"Create New Template":"Edit Template"),1)])])]),footer:m(()=>[l("div",Vf,[c(O,{onClick:n.cancelEdit,disabled:n.isCurrentlySaving},{default:m(()=>e[22]||(e[22]=[k(" Cancel ")])),_:1},8,["onClick","disabled"]),c(O,{type:"primary",onClick:n.saveTemplate,loading:n.isCurrentlySaving,disabled:n.isCurrentlySaving},{default:m(()=>[k(A(n.isCreatingTemplate?"Create Template":"Update Template"),1)]),_:1},8,["onClick","loading","disabled"])])]),default:m(()=>[be((p(),y("div",bf,[c(P,{height:"calc(100vh - 250px)"},{default:m(()=>[c(S,{ref:"templateFormRef",model:n.currentTemplate,rules:n.templateRules,"label-width":"auto",class:"template-form","label-position":"left",size:"large"},{default:m(()=>[l("div",Tf,[l("h4",wf,[c(r,null,{default:m(()=>[c(f)]),_:1}),e[12]||(e[12]=k(" Basic Information "))]),l("div",Ef,[c(u,{label:"Template Status",prop:"status",class:"status-field"},{default:m(()=>[c(d,{modelValue:n.templateStatusActive,"onUpdate:modelValue":e[0]||(e[0]=z=>n.templateStatusActive=z),"active-text":"Active","inactive-text":"Inactive","active-color":"#13ce66","inactive-color":"#ff4949","inline-prompt":"",style:{"--el-switch-on-color":"#13ce66","--el-switch-off-color":"#ff4949"}},null,8,["modelValue"]),e[13]||(e[13]=l("p",{class:"field-description"},"Enable or disable this email template",-1))]),_:1})]),l("div",Cf,[c(u,{label:"Template Name",prop:"name"},{default:m(()=>[c(g,{modelValue:n.currentTemplate.name,"onUpdate:modelValue":e[1]||(e[1]=z=>n.currentTemplate.name=z),placeholder:"Enter a descriptive name for this template",maxlength:"100","show-word-limit":"",clearable:""},null,8,["modelValue"]),e[14]||(e[14]=l("p",{class:"field-description"},"A descriptive name to identify this template",-1))]),_:1})]),l("div",Sf,[c(u,{label:"Email Subject",prop:"subject"},{default:m(()=>[c(g,{modelValue:n.currentTemplate.subject,"onUpdate:modelValue":e[2]||(e[2]=z=>n.currentTemplate.subject=z),placeholder:"Enter the email subject line",maxlength:"200","show-word-limit":"",clearable:""},null,8,["modelValue"]),e[15]||(e[15]=l("p",{class:"field-description"}," Available placeholders: {site_name}, {customer_full_name}, {cart_total} ",-1))]),_:1})])]),l("div",Af,[l("h4",Df,[c(r,null,{default:m(()=>[c(_)]),_:1}),e[16]||(e[16]=k(" Email Content "))]),c(u,{label:"",prop:"body"},{default:m(()=>[c(v,{modelValue:n.currentTemplate.body,"onUpdate:modelValue":e[3]||(e[3]=z=>n.currentTemplate.body=z),fieldData:t.fieldData,placeholders:o.placeholders},null,8,["modelValue","fieldData","placeholders"])]),_:1})]),l("div",Lf,[l("h4",If,[c(r,null,{default:m(()=>[c(h)]),_:1}),e[17]||(e[17]=k(" Coupon Settings "))]),c(u,{label:"Enable Coupon"},{default:m(()=>[c(d,{"model-value":n.currentTemplate.coupon_data.enable_coupon,"active-text":"Include coupon in this email","active-color":"#13ce66",onChange:n.handleCouponToggle},null,8,["model-value","onChange"])]),_:1}),n.currentTemplate.coupon_data.enable_coupon?(p(),y("div",Of,[l("div",Nf,[c(u,{label:"Coupon Type"},{default:m(()=>[c(T,{modelValue:n.currentTemplate.coupon_data.coupon_type,"onUpdate:modelValue":e[4]||(e[4]=z=>n.currentTemplate.coupon_data.coupon_type=z),style:{width:"60%"}},{default:m(()=>[c(b,{label:"Percentage Discount",value:"percentage"}),c(b,{label:"Fixed Cart Discount",value:"fixed_cart"})]),_:1},8,["modelValue"])]),_:1})]),l("div",xf,[c(u,{label:"Coupon Amount"},{default:m(()=>[l("div",null,[c(D,{modelValue:n.currentTemplate.coupon_data.coupon_amount,"onUpdate:modelValue":e[5]||(e[5]=z=>n.currentTemplate.coupon_data.coupon_amount=z),min:0,step:.01,precision:2,style:{width:"100%"},"controls-position":"right"},null,8,["modelValue"]),l("p",kf,A(n.currentTemplate.coupon_data.coupon_type==="percentage"?"Percentage (%)":"Fixed amount"),1)])]),_:1})]),l("div",Rf,[c(u,{label:"Auto Generate"},{default:m(()=>[c(d,{modelValue:n.currentTemplate.coupon_data.auto_generate,"onUpdate:modelValue":e[6]||(e[6]=z=>n.currentTemplate.coupon_data.auto_generate=z),"active-text":"Auto-generate unique coupon codes",onChange:n.handleAutoGenerateToggle},null,8,["modelValue","onChange"])]),_:1})]),n.currentTemplate.coupon_data.auto_generate?C("",!0):(p(),y("div",Pf,[c(u,{label:"Coupon Code"},{default:m(()=>[c(g,{modelValue:n.currentTemplate.coupon_data.coupon_code,"onUpdate:modelValue":e[7]||(e[7]=z=>n.currentTemplate.coupon_data.coupon_code=z),placeholder:"Enter fixed coupon code",maxlength:"50",style:{width:"60%"}},null,8,["modelValue"]),e[18]||(e[18]=l("p",{class:"field-description"},"Fixed coupon code (only if auto-generate is disabled)",-1))]),_:1})])),n.currentTemplate.coupon_data.auto_generate?(p(),y("div",Mf,[c(u,{label:"Coupon Prefix & Length",class:"coupon-prefix-length"},{default:m(()=>[l("div",null,[c(g,{modelValue:n.currentTemplate.coupon_data.coupon_prefix,"onUpdate:modelValue":e[8]||(e[8]=z=>n.currentTemplate.coupon_data.coupon_prefix=z),placeholder:"SAVE",maxlength:"10",style:{width:"150px"}},null,8,["modelValue"]),e[19]||(e[19]=l("p",{class:"field-description"},"Prefix",-1))]),l("div",null,[c(D,{modelValue:n.currentTemplate.coupon_data.coupon_length,"onUpdate:modelValue":e[9]||(e[9]=z=>n.currentTemplate.coupon_data.coupon_length=z),min:4,max:20,style:{width:"120px"},"controls-position":"right"},null,8,["modelValue"]),e[20]||(e[20]=l("p",{class:"field-description"},"Length",-1))])]),_:1})])):C("",!0),l("div",Gf,[c(u,{label:"Expires After"},{default:m(()=>[l("div",Ff,[c(D,{modelValue:n.currentTemplate.coupon_data.coupon_expiry_days,"onUpdate:modelValue":e[10]||(e[10]=z=>n.currentTemplate.coupon_data.coupon_expiry_days=z),min:1,max:365,style:{width:"120px"},"controls-position":"right"},null,8,["modelValue"]),e[21]||(e[21]=l("span",{style:{"margin-left":"10px"}},"days",-1))])]),_:1})])])):C("",!0)])]),_:1},8,["model","rules"])]),_:1})])),[[R,n.isSaving]])]),_:1},8,["model-value","title","onOpen","onClose"])}const Fi=M(_f,[["render",Uf],["__scopeId","data-v-ac7042a8"]]);function Bf(){const t=$n(),e=F(!1),o=F(!1),n=F(!1),s=F(null),i=F(!1),a=F(!1),r=Mo({id:null,name:"",subject:"",body:"",status:"active",coupon_data:{enable_coupon:!1,coupon_type:"percentage",coupon_amount:10,auto_generate:!0,coupon_code:"",coupon_prefix:"SAVE",coupon_length:8,coupon_expiry_days:7,minimum_amount:0}}),f=F(null),d={name:[{required:!0,message:"Template name is required",trigger:"blur"},{min:3,max:100,message:"Length should be 3 to 100 characters",trigger:"blur"}],subject:[{required:!0,message:"Email subject is required",trigger:"blur"},{min:5,max:200,message:"Length should be 5 to 200 characters",trigger:"blur"}],body:[{required:!0,message:"Email content is required",trigger:"blur"},{min:10,max:1e4,message:"Length should be 10 to 10000 characters",trigger:"blur"}]},u=Q(()=>t.getters["abandonedCart/GET_EMAIL_TEMPLATES"]),g=Q(()=>t.getters["abandonedCart/GET_EMAIL_TEMPLATES_LOADING"]),_=Q(()=>!r.id),v=async(G={})=>{try{return e.value=!0,await t.dispatch("abandonedCart/FETCH_EMAIL_TEMPLATES",G)}catch(ne){console.error("Error loading email templates:",ne),te.error("Failed to load email templates")}finally{e.value=!1}},h=()=>{L(),i.value=!0},b=G=>{s.value=G.id,Object.assign(r,{...G,coupon_data:G.coupon_data||{enable_coupon:!1,coupon_type:"percentage",coupon_amount:10,auto_generate:!0,coupon_code:"",coupon_prefix:"SAVE",coupon_length:8,coupon_expiry_days:7,minimum_amount:0}}),i.value=!0,a.value=!1},T=async(G,ne=null)=>{const le=ne||r,re=!le.id;try{if(!await G.validate())return!1;const $e={name:le.name,subject:le.subject,body:le.body,status:le.status,coupon_data:le.coupon_data};return re?(o.value=!0,await t.dispatch("abandonedCart/CREATE_EMAIL_TEMPLATE",$e),te.success("Template created successfully")):(n.value=!0,await t.dispatch("abandonedCart/UPDATE_EMAIL_TEMPLATE",{id:le.id,template:$e}),te.success("Template updated successfully")),i.value=!1,await v(),!0}catch(ke){return console.error("Error saving template:",ke),te.error(`Failed to ${re?"create":"update"} template`),!1}finally{o.value=!1,n.value=!1}},D=async G=>{try{await ft.confirm(`Are you sure you want to delete the template "${G.name}"?`,"Delete Template",{type:"error",confirmButtonText:"Delete",cancelButtonText:"Cancel"}),await t.dispatch("abandonedCart/DELETE_EMAIL_TEMPLATE",G.id),te.success("Template deleted successfully"),await v()}catch(ne){ne!=="cancel"&&(console.error("Error deleting template:",ne),te.error("Failed to delete template"))}},S=async G=>{try{const ne=G.status==="active"?"inactive":"active",le=ne==="active"?"activate":"deactivate";await ft.confirm(`Are you sure you want to ${le} this template?`,`${le.charAt(0).toUpperCase()+le.slice(1)} Template`,{type:"warning"});const re={...G,status:ne};delete re.id,delete re.created_at,delete re.updated_at,await t.dispatch("abandonedCart/UPDATE_EMAIL_TEMPLATE",{id:G.id,templateData:re}),te.success({message:`Template ${le}d successfully`,duration:3e3,type:"success",offset:50}),await v()}catch(ne){ne!=="cancel"&&(console.error("Error toggling template status:",ne),te.error({message:"Failed to update template status",duration:3e3,type:"error",offset:50}))}},P=G=>{f.value=G,a.value=!0},O=async G=>{try{const ne={...G,name:`${G.name} (Copy)`,status:"inactive"};delete ne.id,delete ne.created_at,delete ne.updated_at,await t.dispatch("abandonedCart/CREATE_EMAIL_TEMPLATE",ne),te.success("Template duplicated successfully"),await v()}catch(ne){console.error("Error duplicating template:",ne),te.error("Failed to duplicate template")}},L=()=>{s.value=null,Object.assign(r,{id:null,name:"",subject:"",body:"",status:"active",coupon_data:{enable_coupon:!1,coupon_type:"percentage",coupon_amount:10,auto_generate:!0,coupon_code:"",coupon_prefix:"SAVE",coupon_length:8,coupon_expiry_days:7,minimum_amount:0}})};return{isLoading:e,isCreating:o,isUpdating:n,currentTemplateId:s,templateDrawerVisible:i,previewDialogVisible:a,currentTemplate:r,previewingTemplate:f,templateRules:d,availablePlaceholders:[{code:"{site_name}",description:"Your website name"},{code:"{customer_full_name}",description:"Customer's full name"},{code:"{customer_name}",description:"Customer's first name"},{code:"{customer_email}",description:"Customer's email address"},{code:"{cart_url}",description:"Link to recover the cart"},{code:"{cart_total}",description:"Total cart value"},{code:"{site_url}",description:"Your website URL"},{code:"{coupon_code}",description:"Generated coupon code (if enabled)"},{code:"{coupon_amount}",description:"Coupon discount amount"},{code:"{coupon_expiry}",description:"Coupon expiry date"}],templates:u,templatesLoading:g,isCreatingTemplate:_,loadEmailTemplates:v,createTemplate:h,editTemplate:b,saveTemplate:T,deleteTemplate:D,toggleTemplateStatus:S,previewTemplate:P,duplicateTemplate:O,resetCurrentTemplate:L,cancelEdit:()=>{i.value=!1,L()},getStatusTagType:G=>{switch(G){case"active":return"success";case"inactive":return"info";default:return"warning"}},getStatusLabel:G=>{switch(G){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},getTriggerUnitLabel:G=>{switch(G){case"minutes":return"Minutes";case"hours":return"Hours";case"days":return"Days";default:return"Minutes"}},getCouponTypeLabel:G=>{switch(G){case"percentage":return"Percentage Discount";case"fixed_cart":return"Fixed Cart Discount";case"fixed_product":return"Fixed Product Discount";default:return"Percentage Discount"}},getPreviewContent:()=>{if(!r.body)return"No content to preview";let G=r.body;return G=G.replace(/{site_name}/g,"Your Store"),G=G.replace(/{customer_full_name}/g,"John Doe"),G=G.replace(/{customer_name}/g,"John Doe"),G=G.replace(/{customer_email}/g,"john.doe@example.com"),G=G.replace(/{cart_url}/g,"#recovery-link"),G=G.replace(/{cart_total}/g,"$150.00"),G=G.replace(/{site_url}/g,"https://yourstore.com"),G.replace(/\n/g,"<br>")},formatDate:G=>G?new Date(G).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"N/A"}}const zf={name:"EmailTemplates",components:{CircleCheck:xa,CircleClose:Bs,Clock:zo,CopyDocument:Ms,Delete:$o,Edit:zs,EmailTemplateDrawer:Fi,Message:Ho,Plus:Wo,Refresh:Bo,View:jo},props:{placeholders:{type:Object,default:()=>({})}},data(){return{templatesCurrentPage:1,templatesPerPage:10,templatesTotal:0}},methods:{handleTemplatesPageChange(t){this.templatesCurrentPage=t,this.loadEmailTemplates({page:t,per_page:this.templatesPerPage})},handleSaveTemplate(){this.loadEmailTemplates({page:this.templatesCurrentPage,per_page:this.templatesPerPage})}},setup(){const{isCreating:t,isUpdating:e,currentTemplateId:o,templateDrawerVisible:n,previewingTemplate:s,currentTemplate:i,isCreatingTemplate:a,templates:r,templatesLoading:f,loadEmailTemplates:d,createTemplate:u,editTemplate:g,deleteTemplate:_,toggleTemplateStatus:v,previewTemplate:h,duplicateTemplate:b,getStatusTagType:T,getStatusLabel:D,getCouponTypeLabel:S,formatDate:P}=Bf(),O=F(!1);return{isCreating:t,isUpdating:e,currentTemplateId:o,templateDrawerVisible:n,previewingTemplate:s,previewDialogVisible:O,currentTemplate:i,templates:r,templatesLoading:f,isCreatingTemplate:a,loadEmailTemplates:d,createTemplate:u,editTemplate:g,deleteTemplate:_,toggleTemplateStatus:v,previewTemplate:h,duplicateTemplate:b,handleTemplateSaved:(R={})=>{d(R)},getStatusTagType:T,getStatusLabel:D,getCouponTypeLabel:S,formatDate:P}},mounted(){this.loadEmailTemplates({page:this.templatesCurrentPage,per_page:this.templatesPerPage}).then(t=>{this.templatesTotal=t.data.total})}},Hf={class:"email-templates-tab"},jf={class:"templates-header"},$f={class:"header-actions"},Wf={class:"template-name"},qf={class:"template-subject"},Kf={class:"date-info"},Yf={class:"carts-pagination",style:{"margin-top":"20px","text-align":"center"}};function Jf(t,e,o,n,s,i){const a=V("Plus"),r=Ae,f=pe,d=V("Refresh"),u=V("Message"),g=$s,_=ln,v=V("Clock"),h=V("Edit"),b=V("CopyDocument"),T=V("CircleClose"),D=V("CircleCheck"),S=V("Delete"),P=Ws,O=Hs,L=js,R=Fi,z=sn;return p(),y("div",Hf,[l("div",jf,[c(f,{type:"primary",onClick:n.createTemplate,loading:n.isCreating},{default:m(()=>[c(r,null,{default:m(()=>[c(a)]),_:1}),e[2]||(e[2]=k(" Add New Template "))]),_:1},8,["onClick","loading"]),l("div",$f,[c(f,{onClick:i.handleSaveTemplate,loading:n.templatesLoading},{default:m(()=>[n.templatesLoading?C("",!0):(p(),w(r,{key:0},{default:m(()=>[c(d)]),_:1})),e[3]||(e[3]=l("span",null,"Refresh",-1))]),_:1},8,["onClick","loading"])])]),be((p(),w(O,{data:n.templates,style:{width:"100%"},"empty-text":"No email templates found",class:"templates-table"},{default:m(()=>[c(g,{prop:"name",label:"Template Name","min-width":"200"},{default:m(({row:W})=>[l("div",Wf,[c(r,null,{default:m(()=>[c(u)]),_:1}),l("span",null,A(W.name||"Untitled Template"),1)])]),_:1}),c(g,{prop:"subject",label:"Subject","min-width":"250"},{default:m(({row:W})=>[l("div",qf,A(W.subject||"No subject"),1)]),_:1}),c(g,{prop:"status",label:"Status",width:"120"},{default:m(({row:W})=>[c(_,{type:n.getStatusTagType(W.status)},{default:m(()=>[k(A(n.getStatusLabel(W.status)),1)]),_:2},1032,["type"])]),_:1}),c(g,{prop:"created_at",label:"Created",width:"200"},{default:m(({row:W})=>[l("div",Kf,[c(r,null,{default:m(()=>[c(v)]),_:1}),k(" "+A(n.formatDate(W.created_at)),1)])]),_:1}),c(g,{label:"Actions",width:"200",fixed:"right"},{default:m(({row:W})=>[c(P,{size:"small"},{default:m(()=>[c(f,{type:"primary",onClick:se=>n.editTemplate(W),title:"Edit Template",loading:n.isUpdating&&n.currentTemplateId===W.id},{default:m(()=>[c(r,null,{default:m(()=>[c(h)]),_:1})]),_:2},1032,["onClick","loading"]),c(f,{type:"warning",onClick:se=>n.duplicateTemplate(W),title:"Duplicate Template"},{default:m(()=>[c(r,null,{default:m(()=>[c(b)]),_:1})]),_:2},1032,["onClick"]),c(f,{type:W.status==="active"?"warning":"success",onClick:se=>n.toggleTemplateStatus(W),title:W.status==="active"?"Deactivate":"Activate"},{default:m(()=>[W.status==="active"?(p(),w(r,{key:0},{default:m(()=>[c(T)]),_:1})):(p(),w(r,{key:1},{default:m(()=>[c(D)]),_:1}))]),_:2},1032,["type","onClick","title"]),c(f,{type:"danger",onClick:se=>n.deleteTemplate(W),title:"Delete Template"},{default:m(()=>[c(r,null,{default:m(()=>[c(S)]),_:1})]),_:2},1032,["onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"])),[[z,n.templatesLoading]]),l("div",Yf,[c(L,{"current-page":s.templatesCurrentPage,"onUpdate:currentPage":e[0]||(e[0]=W=>s.templatesCurrentPage=W),"page-size":s.templatesPerPage,total:s.templatesTotal,layout:"total, prev, pager, next, jumper",onCurrentChange:i.handleTemplatesPageChange},null,8,["current-page","page-size","total","onCurrentChange"])]),c(R,{visible:n.templateDrawerVisible,"onUpdate:visible":e[1]||(e[1]=W=>n.templateDrawerVisible=W),"template-data":n.currentTemplate,"is-creating-template":n.isCreatingTemplate,"is-saving":n.isCreating||n.isUpdating,placeholders:o.placeholders,onTemplateSaved:i.handleSaveTemplate},null,8,["visible","template-data","is-creating-template","is-saving","placeholders","onTemplateSaved"])])}const Vi=M(zf,[["render",Jf],["__scopeId","data-v-5b8c47d2"]]),Xf={name:"AbandonedCartDrawer",components:{ArrowDown:qo,CircleClose:Bs,Clock:zo,Delete:$o,Edit:zs,Message:Ho,Plus:Wo,Search:Uo,ShoppingCart:qs,User:ka,UserFilled:Ra,View:jo,Setting:rn,Loading:Kn,DefaultField:Nt,EmailTemplates:Vi,Refresh:Bo},props:{modelValue:{type:Boolean,default:!1},fields:{type:Array,default:()=>({})},fieldsData:{type:Object,default:()=>({})},placeholders:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t){const{maybeShowField:e}=$t();return{shouldShowField:(n,s)=>e(n,s)}},data(){return{activeTab:"settings",loading:!1,settingsFields:this.fields,settingsData:this.fieldsData,cartsCurrentPage:1,cartsPerPage:10,cartsTotalPages:1,cartsTotal:0,cartsFilters:{status:"",dateFrom:"",dateTo:""},searchTerm:"",searchTimeout:null,selectedCarts:[],selectedDateRange:"30days",customDateRange:null,cartsDateRange:"all",cartsCustomDateRange:null}},watch:{visible(t){t&&this.loadInitialData()}},computed:{...Se("abandonedCart",["GET_CARTS","GET_CARTS_LOADING","GET_CART_DETAILS_LOADING","GET_CARTS_SEARCHING","GET_SELECTED_CARTS","GET_ANALYTICS","GET_ANALYTICS_LOADING","GET_EMAIL_TEMPLATES","GET_EMAIL_TEMPLATES_LOADING","GET_BULK_ACTION_LOADING","GET_SETTINGS_LOADING"]),visible:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}},methods:{...Fe(["CALL_API","SAVE_SETTINGS"]),...Fe("abandonedCart",["FETCH_ABANDONED_CARTS","SET_CARTS_FROM_CACHE","FETCH_CART_DETAILS","DELETE_CART","SEND_RECOVERY_EMAIL","BULK_ACTION","SEARCH_CARTS","FETCH_EMAIL_TEMPLATES","FETCH_ANALYTICS","SET_ANALYTICS","SELECT_CART","DESELECT_CART","SELECT_ALL_CARTS","DESELECT_ALL_CARTS","UPDATE_FILTERS","UPDATE_PAGINATION","SET_SETTINGS_LOADING"]),pieChartInstance:null,lineChartInstance:null,barChartInstance:null,hourChartInstance:null,async loadInitialData(){this.loading=!0;try{await this.loadTabData(this.activeTab)}catch(t){console.error("Error loading initial data:",t),te.error("Failed to load data")}finally{this.loading=!1}},async handleTabChange(t){await this.loadTabData(t)},async loadTabData(t){switch(t){case"email-templates":await this.loadEmailTemplates();break;case"abandoned-carts":await this.loadAbandonedCarts();break;case"analytics":await this.loadAnalytics();break}},async saveSettings(){this.SET_SETTINGS_LOADING(!0);try{const t={...this.settingsData,verifynonce:this.woolentorLocalizeData.verifynonce},e=await this.SAVE_SETTINGS([t,this.$router.currentRoute._value.meta.id,"woolentor_abandoned_cart_settings"]);te.success({message:"Settings saved successfully",type:"success",duration:1e3,offset:50})}catch(t){console.error("Error saving settings:",t),te({message:"Failed to save settings",type:"error",duration:1e3,offset:50})}finally{this.SET_SETTINGS_LOADING(!1)}},async loadEmailTemplates(){},async loadAbandonedCarts(t=!1){try{await this.UPDATE_PAGINATION({currentPage:this.cartsCurrentPage,perPage:this.cartsPerPage}),await this.UPDATE_FILTERS(this.cartsFilters);const e=this.cartsFilters.status+this.cartsFilters.dateFrom+this.cartsFilters.dateTo+this.cartsCurrentPage+this.cartsPerPage;t&&K.remove(e);const o=K.get(e);if(o)this.SET_CARTS_FROM_CACHE(o),this.cartsTotal=o?.total||0,this.cartsTotalPages=o?.pages||1;else{const n=await this.FETCH_ABANDONED_CARTS();K.set(e,n?.data,{duration:6e3}),n&&n.data&&(this.cartsTotal=n?.data?.total||0,this.cartsTotalPages=n?.data?.pages||1)}}catch(e){console.error("Error loading abandoned carts:",e),te.error("Failed to load abandoned carts")}},async loadAnalytics(t=!1){try{const e=this.getDateRangeParams(),o=this.selectedDateRange;t&&K.remove(o);const n=K.get(o);if(n)this.SET_ANALYTICS(n);else{const s=await this.FETCH_ANALYTICS(e);K.set(o,s,{duration:6e3})}this.$nextTick(()=>{this.createCharts()})}catch(e){console.error("Error loading analytics:",e),te.error("Failed to load analytics")}},getDateRangeParams(){return this.selectedDateRange==="custom"&&this.customDateRange?{range:"custom",startDate:this.customDateRange[0],endDate:this.customDateRange[1]}:{range:this.selectedDateRange}},onDateRangeChange(){this.activeTab==="analytics"&&this.loadAnalytics()},onCustomDateChange(){this.selectedDateRange==="custom"&&this.customDateRange&&this.loadAnalytics()},onCartsDateRangeChange(){this.updateCartsDateFilters(),this.loadAbandonedCarts()},onCartsCustomDateChange(){this.cartsDateRange==="custom"&&this.cartsCustomDateRange&&(this.updateCartsDateFilters(),this.loadAbandonedCarts())},updateCartsDateFilters(){if(this.cartsDateRange==="custom"&&this.cartsCustomDateRange)this.cartsFilters.dateFrom=this.cartsCustomDateRange[0],this.cartsFilters.dateTo=this.cartsCustomDateRange[1];else if(this.cartsDateRange==="all")this.cartsFilters.dateFrom="",this.cartsFilters.dateTo="";else{const t=new Date;let e;switch(this.cartsDateRange){case"7days":e=new Date(t.getTime()-7*24*60*60*1e3);break;case"30days":e=new Date(t.getTime()-30*24*60*60*1e3);break;case"3months":e=new Date,e.setMonth(e.getMonth()-3);break;default:e=null}this.cartsFilters.dateFrom=e?e.toISOString().split("T")[0]:"",this.cartsFilters.dateTo=t.toISOString().split("T")[0]}},async sendRecoveryEmail(t){try{await ft.confirm("Are you sure you want to send a recovery email for this cart?","Send Recovery Email",{confirmButtonText:"Send Email",cancelButtonText:"Cancel",type:"warning"}),await this.SEND_RECOVERY_EMAIL(t)&&(te.success("Recovery email sent successfully"),await this.loadAbandonedCarts())}catch(e){e!=="cancel"&&(console.error("Error sending recovery email:",e),te.error("Failed to send recovery email"))}},handleCartsPageChange(t){this.cartsCurrentPage=t,this.loadAbandonedCarts()},handleCartsFilterChange(t){this.cartsCurrentPage=1,this.loadAbandonedCarts()},clearCartsFilters(){this.cartsFilters={status:"",dateFrom:"",dateTo:""},this.handleCartsFilterChange()},handleSettingsChange(){},getFieldComponentName(t){return"field-"+t},hasComponent(t){const e=this.getFieldComponentName(t);return!!this.woolentorCustomComponents.find(n=>n.name===e)},classes(t,e=""){return e!==""?e.hasOwnProperty("class")?e.class:"":["woolentor-opt-field",t=="text"?"woolentor-regular-text":`woolentor-opt-field-${t}`]},formatCurrency(t){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(t||0)},formatDate(t){return t?new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"-"},getStatusColor(t){return{abandoned:"warning",recovered:"success",lost:"danger"}[t]||"info"},async viewCartDetails(t){try{const o=await this.FETCH_CART_DETAILS(t.id)||t;ft.alert(`<div> <p><strong>Customer:</strong> ${this.getCustomerName(o)}</p> <p><strong>Email:</strong> ${o.user_email||"N/A"}</p> <p><strong>Total:</strong> ${this.formatCurrency(o.cart_total)}</p> <p><strong>Status:</strong> ${this.capitalizeFirst(o.status)}</p> <p><strong>Created:</strong> ${this.formatDate(o.created_at)}</p> </div>`,"Cart Details",{dangerouslyUseHTMLString:!0,confirmButtonText:"Close"})}catch(e){console.error("Error loading cart details:",e),te.error("Failed to load cart details")}},async deleteCart(t){try{await ft.confirm("Are you sure you want to delete this cart? This action cannot be undone.","Delete Cart",{confirmButtonText:"Delete",cancelButtonText:"Cancel",type:"warning"});const e=await this.DELETE_CART(t);e&&e.success&&(te.success({message:"Cart deleted successfully",duration:1e3,offset:50}),await this.loadAbandonedCarts(!0))}catch(e){e!=="cancel"&&(console.error("Error deleting cart:",e),te.error({message:"Failed to delete cart",duration:1e3,offset:50}))}},async unsubscribeCart(t){try{await ft.confirm("Are you sure you want to unsubscribe this cart from recovery emails?","Unsubscribe Cart",{confirmButtonText:"Unsubscribe",cancelButtonText:"Cancel",type:"warning"});const e=await this.BULK_ACTION({action:"unsubscribe",cartIds:[t]});e&&e.success&&(te.success({message:"Cart unsubscribed successfully",duration:1e3,offset:50}),await this.loadAbandonedCarts())}catch(e){e!=="cancel"&&(console.error("Error unsubscribing cart:",e),te.error({message:"Failed to unsubscribe cart",duration:1e3,offset:50}))}},handleSelectionChange(t){this.selectedCarts=t.map(e=>e.id)},async handleBulkAction(t){if(this.selectedCarts.length===0){te.warning({message:"Please select carts first",duration:1e3,offset:50});return}const e={delete:"delete the selected carts",send_email:"send recovery emails to the selected carts",unsubscribe:"unsubscribe the selected carts"};try{await ft.confirm(`Are you sure you want to ${e[t]}?`,"Bulk Action",{confirmButtonText:"Confirm",cancelButtonText:"Cancel",type:"warning"});const o=await this.BULK_ACTION({action:t,cartIds:this.selectedCarts});o&&o.message&&te.success({message:o.message,duration:1e3,offset:50}),this.selectedCarts=[],await this.loadAbandonedCarts()}catch(o){o!=="cancel"&&(console.error("Error performing bulk action:",o),te.error({message:"Failed to perform bulk action",duration:1e3,offset:50}))}},handleSearch(){this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.performSearch()},500)},async performSearch(){if(!this.searchTerm.trim()){await this.loadAbandonedCarts();return}try{const t=this.searchTerm+this.cartsCurrentPage+this.cartsPerPage,e=K.get(t);if(e)this.SET_CARTS_FROM_CACHE(e);else{const o=await this.SEARCH_CARTS(this.searchTerm);K.set(t,o?.data,{duration:6e3}),o&&o.data&&(this.cartsTotal=o.data.total||0,this.cartsTotalPages=o.data.pages||1)}}catch(t){console.error("Error searching carts:",t),te.error({message:"Failed to search carts",duration:1e3,offset:50})}},clearSearch(){this.searchTerm="",this.loadAbandonedCarts()},getCustomerName(t){return t.customer_name?t.customer_name:t.user_email?"Guest User":"Unknown"},capitalizeFirst(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},async loadChartJs(){return new Promise((t,e)=>{if(window.Chart){t();return}const o=document.createElement("script");o.src=woolentorOptions.assetsUrl+"/js/chart.min.js",o.onload=t,o.onerror=e,document.head.appendChild(o)})},async createCharts(){try{await this.loadChartJs(),this.destroyCharts(),this.createPieChart(),this.createLineChart(),this.createBarChart(),this.createHourChart()}catch(t){console.error("Error creating charts:",t)}},destroyCharts(){this.pieChartInstance&&(this.pieChartInstance.destroy(),this.pieChartInstance=null),this.lineChartInstance&&(this.lineChartInstance.destroy(),this.lineChartInstance=null),this.barChartInstance&&(this.barChartInstance.destroy(),this.barChartInstance=null),this.hourChartInstance&&(this.hourChartInstance.destroy(),this.hourChartInstance=null)},createPieChart(){const t=this.$refs.pieChart;if(!t)return;const e=this.GET_ANALYTICS||{},o=e.totalAbandoned||0,n=e.totalRecovered||0;this.pieChartInstance=new Chart(t,{type:"doughnut",data:{labels:["Abandoned","Recovered"],datasets:[{data:[o,n],backgroundColor:["#ff6b6b","#51cf66"],borderWidth:2,borderColor:"#fff"}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom"},title:{display:!0,text:`Total Carts: ${o}`}}}})},createLineChart(){const t=this.$refs.lineChart;if(!t)return;const o=(this.GET_ANALYTICS||{}).chartData?.dailyTrend||{},n=o.labels||this.generateSampleLabels(7),s=o.recoveryRate||this.generateSampleData(7,5,20),i=o.abandoned||this.generateSampleData(7,10,30);this.lineChartInstance=new Chart(t,{type:"line",data:{labels:n,datasets:[{label:"Recovery Rate %",data:s,borderColor:"#51cf66",backgroundColor:"rgba(81, 207, 102, 0.1)",fill:!0,tension:.4},{label:"Carts Abandoned",data:i,borderColor:"#ff6b6b",backgroundColor:"rgba(255, 107, 107, 0.1)",fill:!0,tension:.4,yAxisID:"y1"}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{y:{type:"linear",display:!0,position:"left",beginAtZero:!0,max:100,ticks:{callback:function(a){return a+"%"}}},y1:{type:"linear",display:!0,position:"right",beginAtZero:!0,grid:{drawOnChartArea:!1}}},plugins:{legend:{position:"bottom"}}}})},createBarChart(){const t=this.$refs.barChart;if(!t)return;const o=(this.GET_ANALYTICS||{}).chartData?.monthlyRevenue||{},n=o.labels||["Jan","Feb","Mar","Apr","May","Jun"],s=o.revenue||this.generateSampleData(6,1e3,5e3);this.barChartInstance=new Chart(t,{type:"bar",data:{labels:n,datasets:[{label:"Recovered Revenue ($)",data:s,backgroundColor:"rgba(51, 154, 240, 0.8)",borderColor:"#339af0",borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{y:{beginAtZero:!0,ticks:{callback:function(i){return"$"+i.toLocaleString()}}}},plugins:{legend:{position:"bottom"}}}})},createHourChart(){const t=this.$refs.hourChart;if(!t)return;const o=(this.GET_ANALYTICS||{}).chartData?.hourlyPattern||{},n=o.labels||this.generateHourlyLabels(),s=o.counts||this.generateHourlyData();this.hourChartInstance=new Chart(t,{type:"bar",data:{labels:n,datasets:[{label:"Carts Abandoned",data:s,backgroundColor:"rgba(255, 107, 107, 0.8)",borderColor:"#ff6b6b",borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{y:{beginAtZero:!0},x:{ticks:{maxTicksLimit:12}}},plugins:{legend:{position:"bottom"}}}})},generateSampleLabels(t){const e=[];for(let o=t-1;o>=0;o--){const n=new Date;n.setDate(n.getDate()-o),e.push(n.toLocaleDateString("en-US",{month:"short",day:"numeric"}))}return e},generateSampleData(t,e,o){const n=[];for(let s=0;s<t;s++)n.push(Math.floor(Math.random()*(o-e))+e);return n},generateHourlyLabels(){const t=[];for(let e=0;e<24;e++)t.push(e+":00");return t},generateHourlyData(){const t=[];for(let e=0;e<24;e++)e>=9&&e<=17?t.push(Math.floor(Math.random()*15)+10):t.push(Math.floor(Math.random()*8)+2);return t}},beforeUnmount(){this.destroyCharts()}},Qf={class:"drawer-title"},Zf={class:"drawer-content"},em={class:"tab-content"},tm={key:1,class:"settings-content"},nm={class:"settings-actions",style:{"margin-top":"20px","padding-top":"20px","border-top":"1px solid #eee"}},om={class:"tab-content"},sm={class:"tab-content"},im={class:"carts-filter-section"},am={class:"date-filter-row"},lm={class:"filter-group-area"},rm={class:"date-filter-controls"},cm={key:0,class:"custom-date-range"},dm={class:"filter-group-area"},um={class:"status-search-row"},pm={class:"search-group"},fm={class:"header-actions"},mm={class:"customer-info"},gm={class:"customer-icon",style:{display:"flex","align-items":"center",gap:"8px"}},hm={class:"customer-name",style:{"font-weight":"500"}},_m={class:"customer-email",style:{"font-size":"12px",color:"#666"}},ym={style:{display:"flex","align-items":"center",gap:"6px"}},vm={class:"carts-pagination",style:{"margin-top":"20px","text-align":"center"}},bm={key:0,class:"floating-bulk-actions"},Tm={class:"action-count"},wm={class:"tab-content"},Em={class:"analytics-content"},Cm={class:"date-range-selector",style:{"margin-bottom":"20px"}},Sm={class:"date-controls"},Am={class:"period-selector-row"},Dm={class:"period-select-wrapper"},Lm={key:0,class:"custom-date-range"},Im={class:"header-actions"},Om={class:"metric-content"},Nm={class:"metric-value"},xm={class:"metric-content"},km={class:"metric-value"},Rm={class:"metric-content"},Pm={class:"metric-value"},Mm={class:"metric-content"},Gm={class:"metric-value"},Fm={class:"analytics-charts"},Vm={class:"chart-container"},Um={ref:"pieChart",id:"pieChart",width:"400",height:"300"},Bm={class:"chart-container"},zm={ref:"lineChart",id:"lineChart",width:"400",height:"300"},Hm={class:"chart-container"},jm={ref:"barChart",id:"barChart",width:"400",height:"300"},$m={class:"chart-container"},Wm={ref:"hourChart",id:"hourChart",width:"400",height:"300"};function qm(t,e,o,n,s,i){const a=V("ShoppingCart"),r=Ae,f=Lt,d=V("DefaultField"),u=pe,g=on,_=Ks,v=Vi,h=It,b=Ot,T=Ys,D=V("Search"),S=ht,P=V("Refresh"),O=$s,L=V("User"),R=V("UserFilled"),z=ln,W=V("Clock"),se=V("View"),je=V("CircleClose"),De=V("Delete"),ue=Ws,Le=Hs,G=js,ne=V("Setting"),le=V("Loading"),re=Pa,ke=Ma,$e=Ga,We=ae,Re=rt,Qe=lt,oo=Js,dt=qn,Tt=sn;return p(),w(dt,{modelValue:i.visible,"onUpdate:modelValue":e[12]||(e[12]=H=>i.visible=H),title:"Abandoned Cart Module",size:"80vw","with-header":!0,"destroy-on-close":"",class:"woolentor-abandoned-cart-drawer woolentor-settings-drawer",style:{"max-width":"1200px"}},{header:m(()=>[l("h3",Qf,[c(r,null,{default:m(()=>[c(a)]),_:1}),e[13]||(e[13]=k(" Abandoned Cart Management "))])]),default:m(()=>[be((p(),y("div",Zf,[c(oo,{modelValue:s.activeTab,"onUpdate:modelValue":e[11]||(e[11]=H=>s.activeTab=H),class:"abandoned-cart-tabs",onTabChange:i.handleTabChange},{default:m(()=>[c(_,{label:"Settings",name:"settings"},{default:m(()=>[c(g,{height:"calc(100vh - 250px)"},{default:m(()=>[l("div",em,[s.loading?(p(),w(f,{key:0,rows:8,animated:""})):(p(),y("div",tm,[(p(!0),y(B,null,ee(s.settingsFields,(H,kt)=>be((p(),y("div",{class:"woolentor-group-field-item",key:H.id},[i.hasComponent(H.type)?(p(),w(at(i.getFieldComponentName(H.type)),{key:H.id,field:H,model:s.settingsData,class:x(i.classes(H.type)),onOnChange:i.handleSettingsChange,onOpenProModal:e[0]||(e[0]=gn=>t.$emit("openProModal",!0))},null,40,["field","model","class","onOnChange"])):(p(),w(d,{key:H.id+"unique",field:H,model:s.settingsData,class:x(i.classes(H.type)),onOnChange:i.handleSettingsChange,onOpenProModal:e[1]||(e[1]=gn=>t.$emit("openProModal",!0))},null,8,["field","model","class","onOnChange"]))])),[[zt,n.shouldShowField(H,s.settingsData)]])),128)),l("div",nm,[c(u,{type:"primary",onClick:i.saveSettings,loading:t.GET_SETTINGS_LOADING},{default:m(()=>e[14]||(e[14]=[k(" Save Settings ")])),_:1},8,["onClick","loading"])])]))])]),_:1})]),_:1}),c(_,{label:"Email Templates",name:"email-templates"},{default:m(()=>[c(g,{height:"calc(100vh - 250px)"},{default:m(()=>[l("div",om,[(p(),w(ya,null,[c(v,{key:"email-templates-component",placeholders:o.placeholders},null,8,["placeholders"])],1024))])]),_:1})]),_:1}),c(_,{label:"Abandoned Carts",name:"abandoned-carts"},{default:m(()=>[c(g,{height:"calc(100vh - 250px)"},{default:m(()=>[l("div",sm,[l("div",im,[l("div",am,[l("div",lm,[l("div",rm,[c(b,{modelValue:s.cartsDateRange,"onUpdate:modelValue":e[2]||(e[2]=H=>s.cartsDateRange=H),onChange:i.onCartsDateRangeChange,placeholder:"Select Period",style:{width:"180px"}},{default:m(()=>[c(h,{label:"All Time",value:"all"}),c(h,{label:"Last 7 Days",value:"7days"}),c(h,{label:"Last 30 Days",value:"30days"}),c(h,{label:"Last 3 Months",value:"3months"}),c(h,{label:"Custom Range",value:"custom"})]),_:1},8,["modelValue","onChange"]),s.cartsDateRange==="custom"?(p(),y("div",cm,[c(T,{modelValue:s.cartsCustomDateRange,"onUpdate:modelValue":e[3]||(e[3]=H=>s.cartsCustomDateRange=H),type:"daterange","range-separator":"To","start-placeholder":"Start date","end-placeholder":"End date",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",onChange:i.onCartsCustomDateChange,style:{width:"300px"}},null,8,["modelValue","onChange"])])):C("",!0)]),l("div",dm,[c(b,{modelValue:s.cartsFilters.status,"onUpdate:modelValue":e[4]||(e[4]=H=>s.cartsFilters.status=H),placeholder:"Filter by status",clearable:"",onChange:i.handleCartsFilterChange,style:{width:"150px"}},{default:m(()=>[c(h,{label:"All statuses",value:"all"}),c(h,{label:"Abandoned",value:"abandoned"}),c(h,{label:"Recovered",value:"recovered"})]),_:1},8,["modelValue","onChange"])])]),l("div",um,[l("div",pm,[c(S,{modelValue:s.searchTerm,"onUpdate:modelValue":e[5]||(e[5]=H=>s.searchTerm=H),placeholder:"Search by email...",style:{width:"300px"},onInput:i.handleSearch,onClear:i.clearSearch,clearable:""},{prefix:m(()=>[c(r,null,{default:m(()=>[c(D)]),_:1})]),_:1},8,["modelValue","onInput","onClear"])]),l("div",fm,[c(u,{type:"primary",onClick:e[6]||(e[6]=()=>{i.loadAbandonedCarts(!0)}),loading:t.GET_CARTS_LOADING},{default:m(()=>[t.GET_CARTS_LOADING?C("",!0):(p(),w(r,{key:0},{default:m(()=>[c(P)]),_:1})),e[15]||(e[15]=l("span",null,"Refresh",-1))]),_:1},8,["loading"])])])])]),be((p(),w(Le,{data:t.GET_CARTS,style:{width:"100%"},"empty-text":"No abandoned carts found",onSelectionChange:i.handleSelectionChange,"row-key":"id"},{default:m(()=>[c(O,{type:"selection",width:"55"}),c(O,{label:"Customer","min-width":"200",prop:"user_email"},{default:m(({row:H})=>[l("div",mm,[l("div",gm,[c(r,{style:Ce({color:H.user_id?"#0073aa":"#72777c"})},{default:m(()=>[H.user_id?(p(),w(L,{key:0})):(p(),w(R,{key:1}))]),_:2},1032,["style"]),l("div",null,[l("div",hm,A(i.getCustomerName(H)),1),l("div",_m,A(H.user_email||"No email"),1)])])])]),_:1}),c(O,{prop:"cart_total",label:"Cart Total",width:"130"},{default:m(({row:H})=>[l("strong",null,A(i.formatCurrency(H.cart_total)),1)]),_:1}),c(O,{prop:"status",label:"Order Status",width:"140"},{default:m(({row:H})=>[c(z,{type:i.getStatusColor(H.status),size:"small"},{default:m(()=>[k(A(i.capitalizeFirst(H.status)),1)]),_:2},1032,["type"])]),_:1}),c(O,{prop:"created_at",label:"Date",width:"200"},{default:m(({row:H})=>[l("div",ym,[c(r,{style:{color:"#72777c"}},{default:m(()=>[c(W)]),_:1}),l("span",null,A(i.formatDate(H.created_at)),1)])]),_:1}),c(O,{label:"Actions",width:"220",fixed:"right",align:"right"},{default:m(({row:H})=>[c(ue,{size:"small"},{default:m(()=>[c(u,{onClick:kt=>i.viewCartDetails(H),title:"View cart details"},{default:m(()=>[c(r,null,{default:m(()=>[c(se)]),_:1})]),_:2},1032,["onClick"]),c(u,{type:"warning",onClick:kt=>i.unsubscribeCart(H.id),disabled:H.unsubscribed!=="0",title:"Unsubscribe"},{default:m(()=>[c(r,null,{default:m(()=>[c(je)]),_:1})]),_:2},1032,["onClick","disabled"]),c(u,{type:"danger",onClick:kt=>i.deleteCart(H.id),title:"Delete cart"},{default:m(()=>[c(r,null,{default:m(()=>[c(De)]),_:1})]),_:2},1032,["onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data","onSelectionChange"])),[[Tt,t.GET_CARTS_LOADING||t.GET_CARTS_SEARCHING||t.GET_CART_DETAILS_LOADING]]),l("div",vm,[c(G,{"current-page":s.cartsCurrentPage,"onUpdate:currentPage":e[7]||(e[7]=H=>s.cartsCurrentPage=H),"page-size":s.cartsPerPage,total:s.cartsTotal,layout:"total, prev, pager, next, jumper",onCurrentChange:i.handleCartsPageChange},null,8,["current-page","page-size","total","onCurrentChange"])]),s.selectedCarts.length>0?(p(),y("div",bm,[c($e,{onCommand:i.handleBulkAction,placement:"top"},{dropdown:m(()=>[c(ke,null,{default:m(()=>[c(re,{command:"delete"},{default:m(()=>[c(r,null,{default:m(()=>[c(De)]),_:1}),k(" Delete Selected ("+A(s.selectedCarts.length)+") ",1)]),_:1}),c(re,{command:"unsubscribe"},{default:m(()=>[c(r,null,{default:m(()=>[c(je)]),_:1}),k(" Unsubscribe Selected ("+A(s.selectedCarts.length)+") ",1)]),_:1})]),_:1})]),default:m(()=>[c(u,{type:"primary",size:"large",circle:"",class:"floating-action-btn"},{default:m(()=>[t.GET_BULK_ACTION_LOADING?(p(),w(r,{key:1,class:"is-loading"},{default:m(()=>[c(le)]),_:1})):(p(),w(r,{key:0},{default:m(()=>[c(ne)]),_:1})),l("span",Tm,A(s.selectedCarts.length),1)]),_:1})]),_:1},8,["onCommand"])])):C("",!0)])]),_:1})]),_:1}),c(_,{label:"Analytics",name:"analytics"},{default:m(()=>[c(g,{height:"calc(100vh - 250px)"},{default:m(()=>[l("div",wm,[be((p(),y("div",Em,[l("div",Cm,[l("div",Sm,[l("div",Am,[l("div",Dm,[c(b,{modelValue:s.selectedDateRange,"onUpdate:modelValue":e[8]||(e[8]=H=>s.selectedDateRange=H),onChange:i.onDateRangeChange,placeholder:"Select Period",style:{width:"200px"}},{default:m(()=>[c(h,{label:"Last 7 Days",value:"7days"}),c(h,{label:"Last 30 Days",value:"30days"}),c(h,{label:"Last 3 Months",value:"3months"}),c(h,{label:"Last Year",value:"year"}),c(h,{label:"Custom Range",value:"custom"})]),_:1},8,["modelValue","onChange"])]),s.selectedDateRange==="custom"?(p(),y("div",Lm,[c(T,{modelValue:s.customDateRange,"onUpdate:modelValue":e[9]||(e[9]=H=>s.customDateRange=H),type:"daterange","range-separator":"To","start-placeholder":"Start date","end-placeholder":"End date",format:"YYYY-MM-DD","value-format":"YYYY-MM-DD",onChange:i.onCustomDateChange,style:{width:"300px"}},null,8,["modelValue","onChange"])])):C("",!0)])]),l("div",Im,[c(u,{onClick:e[10]||(e[10]=()=>{i.loadAnalytics(!0)}),loading:t.GET_ANALYTICS_LOADING},{default:m(()=>[t.GET_ANALYTICS_LOADING?C("",!0):(p(),w(r,{key:0},{default:m(()=>[c(P)]),_:1})),e[16]||(e[16]=l("span",null,"Refresh",-1))]),_:1},8,["loading"])])]),c(Qe,{gutter:20,style:{"margin-bottom":"30px"}},{default:m(()=>[c(Re,{span:6},{default:m(()=>[c(We,{class:"metric-card"},{default:m(()=>[l("div",Om,[l("div",Nm,A(t.GET_ANALYTICS.totalAbandoned||0),1),e[17]||(e[17]=l("div",{class:"metric-label"},"Total Abandoned",-1))])]),_:1})]),_:1}),c(Re,{span:6},{default:m(()=>[c(We,{class:"metric-card"},{default:m(()=>[l("div",xm,[l("div",km,A(t.GET_ANALYTICS.totalRecovered||0),1),e[18]||(e[18]=l("div",{class:"metric-label"},"Total Recovered",-1))])]),_:1})]),_:1}),c(Re,{span:6},{default:m(()=>[c(We,{class:"metric-card"},{default:m(()=>[l("div",Rm,[l("div",Pm,A(i.formatCurrency(t.GET_ANALYTICS.recoveredRevenue)),1),e[19]||(e[19]=l("div",{class:"metric-label"},"Recovered Revenue",-1))])]),_:1})]),_:1}),c(Re,{span:6},{default:m(()=>[c(We,{class:"metric-card"},{default:m(()=>[l("div",Mm,[l("div",Gm,A(t.GET_ANALYTICS.recoveryRate||0)+"%",1),e[20]||(e[20]=l("div",{class:"metric-label"},"Recovery Rate",-1))])]),_:1})]),_:1})]),_:1}),l("div",Fm,[c(Qe,{gutter:20},{default:m(()=>[c(Re,{span:12},{default:m(()=>[c(We,null,{header:m(()=>e[21]||(e[21]=[l("span",null,"Cart Status Distribution",-1)])),default:m(()=>[l("div",Vm,[l("canvas",Um,null,512)])]),_:1})]),_:1}),c(Re,{span:12},{default:m(()=>[c(We,null,{header:m(()=>e[22]||(e[22]=[l("span",null,"Recovery Rate Trend",-1)])),default:m(()=>[l("div",Bm,[l("canvas",zm,null,512)])]),_:1})]),_:1})]),_:1}),c(Qe,{gutter:20,style:{"margin-top":"20px"}},{default:m(()=>[c(Re,{span:12},{default:m(()=>[c(We,null,{header:m(()=>e[23]||(e[23]=[l("span",null,"Monthly Revenue Recovery",-1)])),default:m(()=>[l("div",Hm,[l("canvas",jm,null,512)])]),_:1})]),_:1}),c(Re,{span:12},{default:m(()=>[c(We,null,{header:m(()=>e[24]||(e[24]=[l("span",null,"Abandonment by Hour",-1)])),default:m(()=>[l("div",$m,[l("canvas",Wm,null,512)])]),_:1})]),_:1})]),_:1})])])),[[Tt,t.GET_ANALYTICS_LOADING]])])]),_:1})]),_:1})]),_:1},8,["modelValue","onTabChange"])])),[[Tt,s.loading]])]),_:1},8,["modelValue"])}const Ui=M(Xf,[["render",qm],["__scopeId","data-v-32aebd8d"]]),Km={name:"VideoPreview",props:{previewUrl:{type:String,default:""}},data(){return{videoDialogVisible:!1,videoEmbedUrl:""}},methods:{getVideoEmbedUrl(t){if(!t)return"";let e=t.match(/(?:youtube\.com\/(?:watch\?v=|embed\/|v\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})/);return e?`https://www.youtube.com/embed/${e[1]}?autoplay=1&rel=0`:(e=t.match(/vimeo\.com\/(\d+)/),e?`https://player.vimeo.com/video/${e[1]}?autoplay=1`:(t.includes("/embed/")||t.includes("player.vimeo.com"),t))},openVideoPreview(){this.videoEmbedUrl=this.getVideoEmbedUrl(this.previewUrl),this.videoDialogVisible=!0},closeVideoPreview(){this.videoDialogVisible=!1,this.videoEmbedUrl=""}}},Ym={class:"woolentor-video-wrapper"},Jm=["src"];function Xm(t,e,o,n,s,i){const a=cn,r=_t;return p(),y(B,null,[o.previewUrl?(p(),w(a,{key:0,content:"Video",placement:"top",effect:"dark"},{default:m(()=>[l("span",{class:"woolentor-admin-settings-link",onClick:e[0]||(e[0]=he((...f)=>i.openVideoPreview&&i.openVideoPreview(...f),["stop"])),style:{cursor:"pointer"}},e[2]||(e[2]=[l("i",{class:"wli wli-monitor"},null,-1)]))]),_:1})):C("",!0),c(r,{modelValue:s.videoDialogVisible,"onUpdate:modelValue":e[1]||(e[1]=f=>s.videoDialogVisible=f),width:750,"close-on-click-modal":!0,onClose:i.closeVideoPreview,class:"woolentor-video-preview-popup","show-close":!0,"destroy-on-close":""},{default:m(()=>[l("div",Ym,[s.videoDialogVisible&&s.videoEmbedUrl?(p(),y("iframe",{key:0,src:s.videoEmbedUrl,frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:""},null,8,Jm)):C("",!0)])]),_:1},8,["modelValue","onClose"])],64)}const bt=M(Km,[["render",Xm]]),Qm={name:"AbandonCart",components:{ProBadge:q,VideoPreview:bt,AbandonedCartDrawer:Ui,ShoppingCart:qs,Setting:rn},props:["field","model","class"],emits:["openProModal"],data(){return{showDrawer:!1,loading:!1,fieldData:this.field,updateData:this.woolentorLocalizeData.options[this.field.id]||this.model,optionIds:this.getOptionIds()}},computed:{isAnyOptionActive(){return this.optionIds.length?this.optionIds.some(t=>this.updateData[t]==="on"):this.updateData[this.field?.id]==="on"}},methods:{openAbandonedCartDrawer(){if(this.loading=!0,this.fieldData?.is_pro){this.$emit("openProModal",!0);return}setTimeout(()=>{this.showDrawer=!0,this.loading=!1},500)},getOptionIds(){const t=this.field?.option_id;return t?t.split(",").map(e=>e.trim()):[]}}},Zm={class:"woolentor-card-field-label-switcher",style:{display:"flex","align-items":"center",gap:"8px"}},eg=["innerHTML"],tg=["href"],ng={class:"woolentor-card-field-element-switcher"},og={class:"settings-icon-wrapper"};function sg(t,e,o,n,s,i){const a=q,r=cn,f=bt,d=V("Setting"),u=Ae,g=pe,_=Ui,v=ae;return p(),w(v,{style:{width:"auto",border:"1px solid #DCDCDC","border-radius":"8px"},shadow:"never","border-card":"false","body-style":"padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap:10px;",onClick:e[1]||(e[1]=h=>s.fieldData?.is_pro?t.$emit("openProModal",!0):null)},{default:m(()=>[l("div",Zm,[l("span",{style:Ce([{display:"flex","align-items":"center","font-size":"14px","font-weight":"400"},{color:i.isAnyOptionActive?"#000000":"#7D8087"}])},[l("span",{innerHTML:s.fieldData.name},null,8,eg),s.fieldData?.is_pro?(p(),w(a,{key:0})):C("",!0)],4),s.fieldData?.documentation?(p(),w(r,{key:0,content:"Documentation",placement:"top",effect:"dark"},{default:m(()=>[l("a",{href:s.fieldData?.documentation,target:"_blank",class:"woolentor-admin-settings-link"},e[2]||(e[2]=[l("i",{class:"wli wli-question"},null,-1)]),8,tg)]),_:1})):C("",!0),c(f,{"preview-url":s.fieldData?.preview},null,8,["preview-url"])]),l("div",ng,[l("div",og,[c(g,{class:x({"settings-icon-btn":!0,"is-active":i.isAnyOptionActive}),disabled:s.fieldData?.is_pro,onClick:he(i.openAbandonedCartDrawer,["stop"]),style:Ce({color:i.isAnyOptionActive?"#409eff":"#7D8087"})},{default:m(()=>[c(u,{class:x({"is-spinning":s.loading})},{default:m(()=>[c(d)]),_:1},8,["class"])]),_:1},8,["class","disabled","onClick","style"])])]),c(_,{modelValue:s.showDrawer,"onUpdate:modelValue":e[0]||(e[0]=h=>s.showDrawer=h),fields:o.field.setting_fields,placeholders:o.field.placeholders,fieldsData:s.updateData},null,8,["modelValue","fields","placeholders","fieldsData"])]),_:1})}const ig=M(Qm,[["render",sg],["__scopeId","data-v-a5b36aab"]]),ag={name:"field-abandon-cart",template:ig},lg={name:"field-color",props:["field","model","class"],emits:["onChange","openProModal"],components:{ProBadge:q},data(){return{fieldData:this.field,currentRoute:this.$route}}},rg={class:"woolentor-card-field-label"},cg={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},dg=["innerHTML"],ug=["innerHTML"];function pg(t,e,o,n,s,i){const a=q,r=Fa,f=ae;return p(),w(f,{style:{width:"auto",border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{style:{display:"flex","align-items":"center","justify-content":"space-between",gap:"15px"},onClick:e[2]||(e[2]=d=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},[l("div",rg,[l("span",cg,[l("span",{innerHTML:s.fieldData.name},null,8,dg),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)]),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,ug)):C("",!0)]),l("div",{class:x(`woolentor-card-field-element ${s.fieldData?.class||""} ${this.class}`)},[c(r,{modelValue:this.model[s.fieldData.id],"onUpdate:modelValue":e[0]||(e[0]=d=>this.model[s.fieldData.id]=d),size:s.fieldData?.size,onChange:e[1]||(e[1]=d=>t.$emit("onChange")),disabled:s.fieldData?.is_pro},null,8,["modelValue","size","disabled"])],2)])]),_:1})}const fg=M(lg,[["render",pg]]),mg={name:"field-color",template:fg},gg={name:"field-date",props:["field","model","class"],emits:["onChange","openProModal"],data(){return{model:this.model,fieldData:this.field,currentRoute:this.$route}},components:{ProBadge:q},methods:{}},hg={class:"woolentor-card-field-label"},_g={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},yg=["innerHTML"],vg=["innerHTML"],bg={class:"woolentor-card-field-element"};function Tg(t,e,o,n,s,i){const a=q,r=Ys,f=ae;return p(),w(f,{style:{width:"auto",border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{style:{display:"flex","align-items":"center","justify-content":"space-between",gap:"15px"},onClick:e[2]||(e[2]=d=>s.fieldData.is_pro?t.$emit("openProModal",!0):null),class:"woolentor-element-card"},[l("div",hg,[l("span",_g,[l("span",{innerHTML:s.fieldData.name},null,8,yg),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)]),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,vg)):C("",!0)]),l("div",bg,[c(r,{modelValue:s.model[s.fieldData.id],"onUpdate:modelValue":e[0]||(e[0]=d=>s.model[s.fieldData.id]=d),type:"date",placeholder:s.fieldData?.placeholder||"Pick a day",size:"large",onChange:e[1]||(e[1]=d=>t.$emit("onChange")),disabled:s.fieldData.is_pro},null,8,["modelValue","placeholder","disabled"])])])]),_:1})}const wg=M(gg,[["render",Tg]]),Eg={name:"field-date",template:wg},Cg={name:"field-dimensions",props:["field","model","class"],emits:["onChange","openProModal"],components:{ProBadge:q},data(){return{fieldData:this.field,dimensions:{width:"",height:"",unit:"px"},units:["px","%","em","rem","vh","vw"]}},created(){this.initializeDimensions()},methods:{initializeDimensions(){const t=this.model[this.fieldData.id],e={};Object.keys(this.fieldData.options).forEach(o=>{e[o]=""}),e.unit||(e.unit="px"),this.dimensions={...e,...this.fieldData.default||{},...t||{}},t||(this.model[this.fieldData.id]=this.dimensions)},handleDimensionChange(){this.$emit("onChange"),this.model[this.fieldData.id]={...this.dimensions}}}},Sg={class:"woolentor-card-field-label"},Ag={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},Dg=["innerHTML"],Lg=["innerHTML"],Ig={class:"woolentor-card-field-element"},Og={class:"woolentor-dimensions-field"},Ng={class:"woolentor-dimension-input-wrap"},xg={class:"woolentor_dimensions"},kg=["id","onUpdate:modelValue","disabled"],Rg=["onUpdate:modelValue","id","disabled"],Pg=["for"];function Mg(t,e,o,n,s,i){const a=q,r=ae;return p(),w(r,{style:{width:"auto",border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{class:x(`woolentor-element-card ${s.fieldData?.class||""} ${this.class}`),style:{display:"flex","align-items":"center","flex-wrap":"wrap"},onClick:e[2]||(e[2]=f=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},[l("div",Sg,[l("span",Ag,[l("span",{innerHTML:s.fieldData.name},null,8,Dg),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)]),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,Lg)):C("",!0)]),l("div",Ig,[l("div",Og,[l("div",Ng,[l("ul",xg,[(p(!0),y(B,null,ee(s.fieldData.options,(f,d,u)=>(p(),y("li",{key:d,class:x({"woolentor-first-item":u===0,"woolentor-last-item":u===Object.keys(s.fieldData.options).length-1})},[d==="unit"?be((p(),y("input",{key:0,type:"text",class:"dimensionsbox",id:`woolentor_sp_${s.fieldData.id}${d}`,"onUpdate:modelValue":g=>s.dimensions[d]=g,disabled:s.fieldData.is_pro,onInput:e[0]||(e[0]=(...g)=>i.handleDimensionChange&&i.handleDimensionChange(...g))},null,40,kg)),[[Rn,s.dimensions[d]]]):be((p(),y("input",{key:1,type:"number",class:"dimensionsbox","onUpdate:modelValue":g=>s.dimensions[d]=g,id:`woolentor_sp_${s.fieldData.id}${d}`,disabled:s.fieldData.is_pro,onInput:e[1]||(e[1]=(...g)=>i.handleDimensionChange&&i.handleDimensionChange(...g))},null,40,Rg)),[[Rn,s.dimensions[d]]]),l("label",{for:`woolentor_sp_${s.fieldData.id}${d}`},A(f),9,Pg)],2))),128))])])])])],2)]),_:1})}const Gg=M(Cg,[["render",Mg],["__scopeId","data-v-3a0e1002"]]),Fg={name:"field-dimensions",template:Gg},Vg={name:"field-switcher",props:["field","model","class"],emits:["onChange","openProModal","openSettingsModal"],setup(t){const{maybeShowField:e}=$t();return{shouldShowField:(n,s)=>e(n,s)}},components:{ProBadge:q,VideoPreview:bt,Setting:rn,ModuleSaveButton:to,DefaultField:Nt},data(){return{fieldData:this.field,currentRoute:this.$route,dialogVisible:!1,updateData:{},readyToSave:{}}},computed:{...Se(["GET_MODULE_SETTING_LOADER"]),isSpinning(){return this.GET_MODULE_SETTING_LOADER(this.fieldData.id)}},mounted(){document.addEventListener("click",this.onClick)},beforeUnmount(){document.removeEventListener("click",this.onClick)},beforeDestroy(){document.removeEventListener("click",this.onClick)},methods:{...Fe(["FETCH_SETTINGS","FETCH_SETTINGS_DATA","SAVE_DEPENDENCY_SETTINGS","REMOVE_LOADER","SET_MODULE_SETTING_LOADER"]),openSettings(){this.SET_MODULE_SETTING_LOADER({moduleId:this.fieldData.id,isLoading:!0}),this.initializeModal()},async initializeModal(){this.dialogVisible=!1;try{const t=K.get(this.fieldData.parent_id);if(t){this.updateData=t,this.dialogVisible=!0,this.SET_MODULE_SETTING_LOADER({moduleId:this.fieldData.id,isLoading:!1});return}const e=await this.FETCH_SETTINGS_DATA(["",this.fieldData.parent_id]);this.updateData=e,K.set(this.fieldData.parent_id,this.updateData,6e3),this.dialogVisible=!0,this.SET_MODULE_SETTING_LOADER({moduleId:this.fieldData.id,isLoading:!1})}catch(t){console.log(t)}},onChange(){this.saveAndResetButtonEnable()},saveAndResetButtonEnable(){this.$store.dispatch("SAVE_MODULE_BUTTON_CONTROL",{text:this.woolentorLocalizeData.labels.saveButton.text,class:"",disabled:!1}),this.$store.dispatch("RESET_MODULE_BUTTON_CONTROL",{text:this.woolentorLocalizeData.labels.resetButton.text,class:"",disabled:!1})},getFieldComponentName(t){return"field-"+t},hasComponent(t){const e=this.getFieldComponentName(t);return!!this.woolentorCustomComponents.find(n=>n.name===e)},classes(t,e=""){return e!==""?e.hasOwnProperty("class")?e.class:"":["woolentor-opt-field",t=="text"?"woolentor-regular-text":`woolentor-opt-field-${t}`]},async submit(t){t.preventDefault();try{this.readyToSave.verifynonce=this.woolentorLocalizeData.verifynonce;const e={...this.readyToSave,...this.updateData,detectId:this.field.id},o=await this.SAVE_DEPENDENCY_SETTINGS([e,this.$router.currentRoute._value.meta.id]);o&&o.data&&(K.set(this.fieldData.parent_id,this.updateData),de({title:"Success",message:"Settings saved successfully",type:"success",duration:2e3,position:"top-right",offset:30}))}catch{de({title:"Error",message:"Failed to save settings. Please try again.",type:"error",duration:3e3,position:"top-right",offset:30})}},closeModalClick(){this.SET_MODULE_SETTING_LOADER({moduleId:this.fieldData.parent_id,isLoading:!1}),this.dialogVisible=!1},onClick(t){t.target.classList.contains("el-overlay-dialog")&&this.closeModalClick()}}},Ug={key:0,class:"woolentor-option-badge-area"},Bg={class:"woolentor-card-field-label-switcher",style:{display:"flex","align-items":"center",gap:"8px"}},zg=["innerHTML"],Hg=["href"],jg={class:"woolentor-form-wrapper"},$g={class:"woolentor-form-module-fields"},Wg={class:"woolentor-footer-savebutton"};function qg(t,e,o,n,s,i){const a=q,r=cn,f=bt,d=V("Setting"),u=Ae,g=pe,_=an,v=V("DefaultField"),h=yt,b=to,T=_t,D=ae;return p(),w(D,{style:{width:"auto",border:"1px solid #DCDCDC","border-radius":"8px"},shadow:"never","border-card":"false","body-style":"padding: 12px 20px;display: flex; align-items: center; justify-content: space-between;gap:10px;position:relative;",onClick:e[8]||(e[8]=S=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},{default:m(()=>[s.fieldData?.badge?.is_active?(p(),y("div",Ug,[s.fieldData?.badge?.label!==""?(p(),y("span",{key:0,class:x(`woolentor-option-single-badge badge-type-${s.fieldData?.badge?.type||""}`)},A(s.fieldData?.badge?.label),3)):C("",!0)])):C("",!0),l("div",Bg,[l("span",{style:Ce([{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"400"},{color:o.model[s.fieldData.id]=="on"?"#000000":"#7D8087"}])},[l("span",{innerHTML:s.fieldData.name},null,8,zg),s.fieldData.is_pro?(p(),w(a,{key:0})):C("",!0)],4),s.fieldData?.documentation?(p(),w(r,{key:0,content:"Documentation",placement:"top",effect:"dark"},{default:m(()=>[l("a",{href:s.fieldData?.documentation,target:"_blank",class:"woolentor-admin-settings-link"},e[9]||(e[9]=[l("i",{class:"wli wli-question"},null,-1)]),8,Hg)]),_:1})):C("",!0),c(f,{"preview-url":s.fieldData?.preview},null,8,["preview-url"])]),l("div",{class:x(`woolentor-card-field-element-switcher ${s.fieldData?.class||""} ${this.class}`)},[s.fieldData.require_settings&&o.model[s.fieldData.id]=="on"?(p(),w(g,{key:0,class:"settings-icon-btn",disabled:s.fieldData?.is_pro,onClick:he(i.openSettings,["stop"]),style:{color:"#409eff"},type:"text"},{default:m(()=>[c(u,{class:x({"is-spinning":i.isSpinning})},{default:m(()=>[c(d)]),_:1},8,["class"])]),_:1},8,["disabled","onClick"])):C("",!0),c(_,{modelValue:o.model[s.fieldData.id],"onUpdate:modelValue":e[0]||(e[0]=S=>o.model[s.fieldData.id]=S),class:"ml-2","inline-prompt":"",style:{"--el-switch-on-color":"#3489FE","--el-switch-off-color":"#7D8087"},"active-text":"ON","inactive-text":"OFF","active-value":"on","inactive-value":"off",onChange:e[1]||(e[1]=S=>t.$emit("onChange")),disabled:s.fieldData.is_pro},null,8,["modelValue","disabled"])],2),c(T,{modelValue:s.dialogVisible,"onUpdate:modelValue":e[7]||(e[7]=S=>s.dialogVisible=S),width:800,"close-on-click-modal":!1,onClose:i.closeModalClick,class:"woolentor-module-setting-popup woolentor-element-dependency-popup",style:{padding:"20px"}},{footer:m(()=>[l("div",{class:"woolentor-module-footer-settings",onClick:e[6]||(e[6]=he(()=>{},["stop"]))},[l("div",Wg,[c(b,{onClick:he(i.submit,["stop"])},null,8,["onClick"])])])]),default:m(()=>[l("div",{class:"woolentor-module-content",onClick:e[5]||(e[5]=he(()=>{},["stop"]))},[l("form",{onSubmit:e[4]||(e[4]=he((...S)=>i.submit&&i.submit(...S),["prevent"])),class:"woolentor-module-setting-data"},[l("div",jg,[l("div",$g,[(p(!0),y(B,null,ee(s.fieldData.setting_fields,S=>be((p(),y("div",{class:"woolentor-module-field-item",key:S.id},[i.hasComponent(S.type)?(p(),w(at(i.getFieldComponentName(S.type)),{key:S.id,field:S,model:s.updateData,class:x(i.classes(S.type)),onOnChange:i.onChange,onOpenProModal:e[2]||(e[2]=P=>t.$emit("openProModal",!0))},null,40,["field","model","class","onOnChange"])):(p(),w(v,{key:S.id+"unique",field:S,model:s.updateData,class:x(i.classes(S.type)),onOnChange:i.onChange,onOpenProModal:e[3]||(e[3]=P=>t.$emit("openProModal",!0))},null,8,["field","model","class","onOnChange"])),S.id!==s.fieldData.setting_fields[s.fieldData.setting_fields.length-1].id?(p(),w(h,{key:2})):C("",!0)])),[[zt,n.shouldShowField(s.fieldData.setting_fields,s.updateData)]])),128))])])],32)])]),_:1},8,["modelValue","onClose"])]),_:1})}const Kg=M(Vg,[["render",qg]]),Yg={name:"field-element",template:Kg},Jg={name:"field-groupsetting",props:["field","model","class"],emits:["onChange","openProModal"],components:{ProBadge:q,VideoPreview:bt,Setting:rn,Close:Va,DefaultField:Nt,ElNotification:de},setup(t){const{maybeShowField:e}=$t();return{getTextFromHtml:xt,shouldShowField:(n,s)=>e(n,s)}},data(){return{fieldData:this.field,currentRoute:this.$route,drawerVisible:!1,updateData:this.woolentorLocalizeData.options[this.field.id+"_group"]||{},readyToSave:{},activeTab:this.field?.active_tab||"general",settingsTabs:this.field?.setting_tabs||[],isOpening:!1,disabledSaveBtn:!0}},computed:{...Se(["GET_GROUP_SETTING_LOADER"]),isSpinning(){return this.GET_GROUP_SETTING_LOADER(this.fieldData.id)}},methods:{...Fe(["SAVE_GROUP_SETTINGS"]),openSettingsDrawer(t){t.preventDefault(),this.isOpening=!0,this.fieldData.is_pro||(this.drawerVisible=!0),this.isOpening=!1},cancelClick(){this.drawerVisible=!1},onChange(){this.disabledSaveBtn=!1},async saveSettings(){try{this.readyToSave.verifynonce=this.woolentorLocalizeData.verifynonce;const t={...this.readyToSave,...this.updateData},e=await this.SAVE_GROUP_SETTINGS([t,this.fieldData.id,this.$router.currentRoute._value.meta.id]);e&&e.data&&(K.set(this.fieldData.id,this.updateData),this.disabledSaveBtn=!0,de({title:"Success",message:"Settings saved successfully",type:"success",duration:2e3,position:"top-right",offset:30}))}catch{de({title:"Error",message:"Failed to save settings. Please try again.",type:"error",duration:3e3,position:"top-right",offset:30})}},getFieldComponentName(t){return"field-"+t},hasComponent(t){const e=this.getFieldComponentName(t);return!!this.woolentorCustomComponents.find(n=>n.name===e)},classes(t,e=""){return e!==""?e.hasOwnProperty("class")?e.class:"":["woolentor-opt-field",t=="text"?"woolentor-regular-text":`woolentor-opt-field-${t}`]}}},Xg={class:"woolentor-card-field-label-switcher",style:{display:"flex","align-items":"center",gap:"8px"}},Qg=["innerHTML"],Zg=["href"],eh={class:"settings-icon-wrapper"},th={class:"drawer-title"},nh={class:"tab-content"},oh={style:{flex:"auto"},class:"woolentor-drawer-footer"};function sh(t,e,o,n,s,i){const a=q,r=cn,f=bt,d=V("Setting"),u=Ae,g=pe,_=an,v=ae,h=V("DefaultField"),b=yt,T=on,D=Ks,S=Js,P=qn;return p(),y(B,null,[c(v,{style:{width:"auto",border:"1px solid #DCDCDC","border-radius":"8px"},shadow:"never","border-card":"false","body-style":"padding: 12px 20px; display: flex; align-items: center; justify-content: space-between;gap:10px;",onClick:e[2]||(e[2]=O=>s.fieldData?.is_pro?t.$emit("openProModal",!0):null)},{default:m(()=>[l("div",Xg,[l("span",{style:Ce([{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"400"},{color:o.model[s.fieldData.id]=="on"?"#000000":"#7D8087"}])},[l("span",{innerHTML:s.fieldData.name},null,8,Qg),s.fieldData.is_pro?(p(),w(a,{key:0})):C("",!0)],4),s.fieldData?.documentation?(p(),w(r,{key:0,content:"Documentation",placement:"top",effect:"dark"},{default:m(()=>[l("a",{href:s.fieldData?.documentation,target:"_blank",class:"woolentor-admin-settings-link"},e[8]||(e[8]=[l("i",{class:"wli wli-question"},null,-1)]),8,Zg)]),_:1})):C("",!0),c(f,{"preview-url":s.fieldData?.preview},null,8,["preview-url"])]),l("div",{class:x(`woolentor-card-field-element-switcher ${s.fieldData?.class||""} ${this.class}`)},[l("div",eh,[o.model[s.fieldData.id]=="on"?(p(),w(g,{key:0,class:"settings-icon-btn",disabled:s.fieldData?.is_pro,style:{color:"#409eff"},type:"text",onClick:he(i.openSettingsDrawer,["stop"])},{default:m(()=>[c(u,{class:x({"is-spinning":s.isOpening})},{default:m(()=>[c(d)]),_:1},8,["class"])]),_:1},8,["disabled","onClick"])):C("",!0),c(_,{modelValue:o.model[s.fieldData.id],"onUpdate:modelValue":e[0]||(e[0]=O=>o.model[s.fieldData.id]=O),class:"ml-2","inline-prompt":"",style:{"--el-switch-on-color":"#3489FE","--el-switch-off-color":"#7D8087"},"active-text":"ON","inactive-text":"OFF","active-value":"on","inactive-value":"off",onChange:e[1]||(e[1]=O=>t.$emit("onChange")),disabled:s.fieldData.is_pro},null,8,["modelValue","disabled"])])],2)]),_:1}),c(P,{modelValue:s.drawerVisible,"onUpdate:modelValue":e[7]||(e[7]=O=>s.drawerVisible=O),title:"Settings",size:"75vw","with-header":!0,"destroy-on-close":"",class:"woolentor-settings-drawer",style:{"max-width":"900px"}},{header:m(()=>[l("h3",th,A(s.fieldData.name)+" Settings",1)]),footer:m(()=>[l("div",oh,[c(g,{type:"primary",size:"large",onClick:i.saveSettings,disabled:i.isSpinning||s.disabledSaveBtn,loading:i.isSpinning},{default:m(()=>e[9]||(e[9]=[k("Save Settings")])),_:1},8,["onClick","disabled","loading"])])]),default:m(()=>[l("div",{class:"drawer-content",onClick:e[6]||(e[6]=he(()=>{},["stop"]))},[c(S,{modelValue:s.activeTab,"onUpdate:modelValue":e[5]||(e[5]=O=>s.activeTab=O),class:"settings-tabs"},{default:m(()=>[(p(!0),y(B,null,ee(s.settingsTabs,(O,L)=>(p(),w(D,{key:L,label:O.name,name:O.id},{default:m(()=>[c(T,{height:"calc(100vh - 250px)"},{default:m(()=>[l("div",nh,[(p(!0),y(B,null,ee(O.fields,(R,z)=>be((p(),y("div",{class:"woolentor-group-field-item",key:R.id},[i.hasComponent(R.type)?(p(),w(at(i.getFieldComponentName(R.type)),{key:R.id,field:R,model:s.updateData[O.setting_group],class:x(i.classes(R.type)),onOnChange:i.onChange,onOpenProModal:e[3]||(e[3]=W=>t.$emit("openProModal",!0))},null,40,["field","model","class","onOnChange"])):(p(),w(h,{key:R.id+"unique",field:R,model:s.updateData[O.setting_group],class:x(i.classes(R.type)),onOnChange:i.onChange,onOpenProModal:e[4]||(e[4]=W=>t.$emit("openProModal",!0))},null,8,["field","model","class","onOnChange"])),R.id!==O.fields[O.fields.length-1].id?(p(),w(b,{key:2})):C("",!0)])),[[zt,n.shouldShowField(R,s.updateData[O.setting_group])]])),128))])]),_:2},1024)]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])]),_:1},8,["modelValue"])],64)}const ih=M(Jg,[["render",sh]]),ah={name:"field-groupsetting",template:ih},lh={name:"field-html",props:["field","model","class"],emits:["onChange","openProModal"],components:{ProBadge:q},setup(t){const e=F(!1),o=F(null),n=F(null),s=async i=>{const a=i,r=K.get(a);if(r){n.value=r;return}e.value=!0,o.value=null;try{const f=await X.get(i,{params:{nonce:woolentorOptions.verifynonce}});f?.data?.content&&(n.value=f.data.content,K.set(a,f.data.content,{duration:6e3}))}catch(f){o.value="Failed to load content. Please try again later.",console.error("API Error:",f)}finally{e.value=!1}};return it(()=>{t.field?.api_info?.url&&s(t.field.api_info.url)}),{loading:e,error:o,apiContent:n}},data(){return{fieldData:this.field}},methods:{handleCustomComponentUpdate(t){this.$emit("onChange",t)}},computed:{displayContent(){return this.apiContent||this.fieldData.html}}},rh={key:0,class:"woolentor-card-field-label"},ch={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},dh=["innerHTML"],uh=["innerHTML"],ph={key:0,class:"woolentor-loading"},fh={key:1,class:"woolentor-error"},mh=["innerHTML"];function gh(t,e,o,n,s,i){const a=q,r=Lt,f=ae;return p(),w(f,{style:{width:"auto",border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{style:{display:"flex","align-items":"center","justify-content":"space-between",gap:"15px"},onClick:e[0]||(e[0]=d=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},[s.fieldData.name?(p(),y("div",rh,[l("span",ch,[l("span",{innerHTML:s.fieldData.name},null,8,dh),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)]),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,uh)):C("",!0)])):C("",!0),l("div",{class:x(`${s.fieldData.name?"woolentor-card-field-element":"woolentor-html-field-area"}`)},[s.fieldData.component?(p(),w(at(s.fieldData.component),Go({key:0},s.fieldData||{},{onUpdate:i.handleCustomComponentUpdate}),null,16,["onUpdate"])):(p(),y("div",{key:1,class:x(`${s.fieldData.name?"woolentor-admin-html-field":"woolentor-html-field-wrapper"}`)},[n.loading?(p(),y("div",ph,[c(r,{rows:3,animated:""})])):n.error?(p(),y("div",fh,A(n.error),1)):(p(),y("div",{key:2,innerHTML:i.displayContent},null,8,mh))],2))],2)])]),_:1})}const hh=M(lh,[["render",gh],["__scopeId","data-v-4bd803f8"]]),_h={name:"field-html",template:hh},yh={name:"field-iconpicker",props:["field","model"],emits:["onChange","openProModal"],components:{ProBadge:q,Search:Uo,ArrowDown:qo,ArrowUp:Xs,ArrowRight:Qs,ArrowLeft:Ua},setup(t,{emit:e}){const o=F(t.field),n=F(""),s=F(!1),i=F([{value:"all",label:"From all categories"},{value:"general",label:"General"},{value:"social",label:"Social"},{value:"business",label:"Business"}]),a=F("all"),r=[{icon:"",category:"general",isNone:!0},{icon:"sli sli-user",category:"general"},{icon:"sli sli-people",category:"general"},{icon:"sli sli-user-female",category:"general"},{icon:"sli sli-user-follow",category:"general"},{icon:"sli sli-user-following",category:"general"},{icon:"sli sli-user-unfollow",category:"general"},{icon:"sli sli-login",category:"general"},{icon:"sli sli-logout",category:"general"},{icon:"sli sli-emotsmile",category:"general"},{icon:"sli sli-phone",category:"general"},{icon:"sli sli-call-end",category:"general"},{icon:"sli sli-call-in",category:"general"},{icon:"sli sli-call-out",category:"general"},{icon:"sli sli-map",category:"general"},{icon:"sli sli-location-pin",category:"general"},{icon:"sli sli-direction",category:"general"},{icon:"sli sli-directions",category:"general"},{icon:"sli sli-compass",category:"general"},{icon:"sli sli-layers",category:"general"},{icon:"sli sli-menu",category:"general"},{icon:"sli sli-list",category:"general"},{icon:"sli sli-options-vertical",category:"general"},{icon:"sli sli-options",category:"general"},{icon:"sli sli-arrow-down",category:"general"},{icon:"sli sli-arrow-left",category:"general"},{icon:"sli sli-arrow-right",category:"general"},{icon:"sli sli-arrow-up",category:"general"},{icon:"sli sli-arrow-up-circle",category:"general"},{icon:"sli sli-arrow-left-circle",category:"general"},{icon:"sli sli-arrow-right-circle",category:"general"},{icon:"sli sli-arrow-down-circle",category:"general"},{icon:"sli sli-check",category:"general"},{icon:"sli sli-clock",category:"general"},{icon:"sli sli-plus",category:"general"},{icon:"sli sli-minus",category:"general"},{icon:"sli sli-close",category:"general"},{icon:"sli sli-event",category:"general"},{icon:"sli sli-exclamation",category:"general"},{icon:"sli sli-organization",category:"general"},{icon:"sli sli-trophy",category:"general"},{icon:"sli sli-screen-smartphone",category:"general"},{icon:"sli sli-screen-desktop",category:"general"},{icon:"sli sli-plane",category:"general"},{icon:"sli sli-notebook",category:"general"},{icon:"sli sli-mustache",category:"general"},{icon:"sli sli-mouse",category:"general"},{icon:"sli sli-magnet",category:"general"},{icon:"sli sli-energy",category:"general"},{icon:"sli sli-disc",category:"general"},{icon:"sli sli-cursor",category:"general"},{icon:"sli sli-cursor-move",category:"general"},{icon:"sli sli-crop",category:"general"},{icon:"sli sli-chemistry",category:"general"},{icon:"sli sli-speedometer",category:"general"},{icon:"sli sli-shield",category:"general"},{icon:"sli sli-screen-tablet",category:"general"},{icon:"sli sli-magic-wand",category:"general"},{icon:"sli sli-hourglass",category:"general"},{icon:"sli sli-graduation",category:"general"},{icon:"sli sli-ghost",category:"general"},{icon:"sli sli-game-controller",category:"general"},{icon:"sli sli-fire",category:"general"},{icon:"sli sli-eyeglass",category:"general"},{icon:"sli sli-envelope-open",category:"general"},{icon:"sli sli-envelope-letter",category:"general"},{icon:"sli sli-bell",category:"general"},{icon:"sli sli-badge",category:"general"},{icon:"sli sli-anchor",category:"general"},{icon:"sli sli-wallet",category:"general"},{icon:"sli sli-vector",category:"general"},{icon:"sli sli-speech",category:"general"},{icon:"sli sli-puzzle",category:"general"},{icon:"sli sli-printer",category:"general"},{icon:"sli sli-present",category:"general"},{icon:"sli sli-playlist",category:"general"},{icon:"sli sli-pin",category:"general"},{icon:"sli sli-picture",category:"general"},{icon:"sli sli-handbag",category:"general"},{icon:"sli sli-globe-alt",category:"general"},{icon:"sli sli-globe",category:"general"},{icon:"sli sli-folder-alt",category:"general"},{icon:"sli sli-folder",category:"general"},{icon:"sli sli-film",category:"general"},{icon:"sli sli-feed",category:"general"},{icon:"sli sli-drop",category:"general"},{icon:"sli sli-drawer",category:"general"},{icon:"sli sli-docs",category:"general"},{icon:"sli sli-doc",category:"general"},{icon:"sli sli-diamond",category:"general"},{icon:"sli sli-cup",category:"general"},{icon:"sli sli-calculator",category:"general"},{icon:"sli sli-bubbles",category:"general"},{icon:"sli sli-briefcase",category:"general"},{icon:"sli sli-book-open",category:"general"},{icon:"sli sli-basket-loaded",category:"general"},{icon:"sli sli-basket",category:"general"},{icon:"sli sli-bag",category:"general"},{icon:"sli sli-action-undo",category:"general"},{icon:"sli sli-action-redo",category:"general"},{icon:"sli sli-wrench",category:"general"},{icon:"sli sli-umbrella",category:"general"},{icon:"sli sli-trash",category:"general"},{icon:"sli sli-tag",category:"general"},{icon:"sli sli-support",category:"general"},{icon:"sli sli-frame",category:"general"},{icon:"sli sli-size-fullscreen",category:"general"},{icon:"sli sli-size-actual",category:"general"},{icon:"sli sli-shuffle",category:"general"},{icon:"sli sli-share-alt",category:"general"},{icon:"sli sli-share",category:"general"},{icon:"sli sli-rocket",category:"general"},{icon:"sli sli-question",category:"general"},{icon:"sli sli-pie-chart",category:"general"},{icon:"sli sli-pencil",category:"general"},{icon:"sli sli-note",category:"general"},{icon:"sli sli-loop",category:"general"},{icon:"sli sli-home",category:"general"},{icon:"sli sli-grid",category:"general"},{icon:"sli sli-graph",category:"general"},{icon:"sli sli-microphone",category:"general"},{icon:"sli sli-music-tone-alt",category:"general"},{icon:"sli sli-music-tone",category:"general"},{icon:"sli sli-earphones-alt",category:"general"},{icon:"sli sli-earphones",category:"general"},{icon:"sli sli-equalizer",category:"general"},{icon:"sli sli-like",category:"general"},{icon:"sli sli-dislike",category:"general"},{icon:"sli sli-control-start",category:"general"},{icon:"sli sli-control-rewind",category:"general"},{icon:"sli sli-control-play",category:"general"},{icon:"sli sli-control-pause",category:"general"},{icon:"sli sli-control-forward",category:"general"},{icon:"sli sli-control-end",category:"general"},{icon:"sli sli-volume-1",category:"general"},{icon:"sli sli-volume-2",category:"general"},{icon:"sli sli-volume-off",category:"general"},{icon:"sli sli-calendar",category:"general"},{icon:"sli sli-bulb",category:"general"},{icon:"sli sli-chart",category:"general"},{icon:"sli sli-ban",category:"general"},{icon:"sli sli-bubble",category:"general"},{icon:"sli sli-camrecorder",category:"general"},{icon:"sli sli-camera",category:"general"},{icon:"sli sli-cloud-download",category:"general"},{icon:"sli sli-cloud-upload",category:"general"},{icon:"sli sli-eye",category:"general"},{icon:"sli sli-flag",category:"general"},{icon:"sli sli-heart",category:"general"},{icon:"sli sli-info",category:"general"},{icon:"sli sli-key",category:"general"},{icon:"sli sli-link",category:"general"},{icon:"sli sli-lock",category:"general"},{icon:"sli sli-lock-open",category:"general"},{icon:"sli sli-magnifier",category:"general"},{icon:"sli sli-magnifier-add",category:"general"},{icon:"sli sli-magnifier-remove",category:"general"},{icon:"sli sli-paper-clip",category:"general"},{icon:"sli sli-paper-plane",category:"general"},{icon:"sli sli-power",category:"general"},{icon:"sli sli-refresh",category:"general"},{icon:"sli sli-reload",category:"general"},{icon:"sli sli-settings",category:"general"},{icon:"sli sli-star",category:"general"},{icon:"sli sli-symbol-female",category:"general"},{icon:"sli sli-symbol-male",category:"general"},{icon:"sli sli-target",category:"general"},{icon:"sli sli-credit-card",category:"general"},{icon:"sli sli-paypal",category:"general"},{icon:"sli sli-social-tumblr",category:"social"},{icon:"sli sli-social-twitter",category:"social"},{icon:"sli sli-social-facebook",category:"social"},{icon:"sli sli-social-instagram",category:"social"},{icon:"sli sli-social-linkedin",category:"social"},{icon:"sli sli-social-pinterest",category:"social"},{icon:"sli sli-social-github",category:"social"},{icon:"sli sli-social-google",category:"social"},{icon:"sli sli-social-reddit",category:"social"},{icon:"sli sli-social-skype",category:"social"},{icon:"sli sli-social-dribbble",category:"social"},{icon:"sli sli-social-behance",category:"social"},{icon:"sli sli-social-foursqare",category:"social"},{icon:"sli sli-social-soundcloud",category:"social"},{icon:"sli sli-social-spotify",category:"social"},{icon:"sli sli-social-stumbleupon",category:"social"},{icon:"sli sli-social-youtube",category:"social"},{icon:"sli sli-social-dropbox",category:"social"},{icon:"sli sli-social-vkontakte",category:"social"},{icon:"sli sli-social-steam",category:"social"}],f=15,d=F(1),u=Q(()=>r.length),g=Q(()=>Math.ceil(u.value/f)),_=Q(()=>{let D=r;a.value!=="all"&&(D=D.filter(O=>O.category===a.value||O.isNone)),n.value&&(D=D.filter(O=>O.isNone||O.icon&&O.icon.toLowerCase().includes(n.value.toLowerCase())));const S=(d.value-1)*f,P=S+f;return D.slice(S,P)});return{fieldData:o,searchQuery:n,categories:i,selectedCategory:a,filteredIcons:_,currentPage:d,totalPages:g,totalIcons:u,selectIcon:D=>{t.model[t.field.id]=D,e("onChange"),s.value=!1},popoverVisible:s,handleChange:()=>{console.log("Change"),console.log(s.value)},prevPage:()=>{d.value>1&&d.value--},nextPage:()=>{d.value<g.value&&d.value++}}}},vh={class:"woolentor-card-field-label"},bh={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},Th=["innerHTML"],wh=["innerHTML"],Eh={class:"woolentor-card-field-element woolentor-icon-picker-field"},Ch={key:1,class:"no-icon-preview"},Sh={class:"woolentor-icon-picker-arrow"},Ah={class:"woolentor-icon-picker-content"},Dh={class:"woolentor-icon-search-wrap"},Lh={class:"woolentor-icons-grid"},Ih=["onClick"],Oh={key:0,class:"no-icon-symbol"},Nh={class:"woolentor-icons-pagination"},xh={class:"woolentor-icons-pagination-left"},kh={class:"woolentor-icons-pagination-right"};function Rh(t,e,o,n,s,i){const a=q,r=V("ArrowUp"),f=Ae,d=V("ArrowDown"),u=ht,g=V("Search"),_=V("ArrowLeft"),v=V("ArrowRight"),h=Ba,b=ae;return p(),w(b,{style:{width:"auto",border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{style:{display:"flex","align-items":"center","flex-wrap":"wrap"},onClick:e[5]||(e[5]=T=>n.fieldData.is_pro?t.$emit("openProModal",!0):null)},[l("div",vh,[l("span",bh,[l("span",{innerHTML:n.fieldData.name},null,8,Th),n.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)]),n.fieldData.desc?(p(),y("p",{key:0,innerHTML:n.fieldData.desc},null,8,wh)):C("",!0)]),l("div",Eh,[c(h,{placement:"bottom",width:400,trigger:"click",visible:n.popoverVisible,"onUpdate:visible":e[4]||(e[4]=T=>n.popoverVisible=T),"popper-class":"woolentor-icon-picker-popover"},{reference:m(()=>[c(u,{modelValue:o.model[n.fieldData.id],"onUpdate:modelValue":e[0]||(e[0]=T=>o.model[n.fieldData.id]=T),placeholder:n.fieldData?.placeholder||"Select Icon",size:"large",disabled:n.fieldData.is_pro,readonly:""},{prefix:m(()=>[o.model[n.fieldData.id]?(p(),y("i",{key:0,class:x(o.model[n.fieldData.id])},null,2)):(p(),y("span",Ch,"Ø"))]),suffix:m(()=>[l("div",Sh,[n.popoverVisible?(p(),w(f,{key:0},{default:m(()=>[c(r)]),_:1})):(p(),w(f,{key:1},{default:m(()=>[c(d)]),_:1}))])]),_:1},8,["modelValue","placeholder","disabled"])]),default:m(()=>[l("div",Ah,[l("div",Dh,[c(u,{modelValue:n.searchQuery,"onUpdate:modelValue":e[1]||(e[1]=T=>n.searchQuery=T),placeholder:"Search Icon",size:"large",class:"woolentor-icon-search"},{suffix:m(()=>[c(f,null,{default:m(()=>[c(g)]),_:1})]),_:1},8,["modelValue"])]),l("div",Lh,[(p(!0),y(B,null,ee(n.filteredIcons,T=>(p(),y("div",{key:T.icon||"none",class:x(["woolentor-icon-item",{active:o.model[n.fieldData.id]===T.icon,"none-icon":T.isNone}]),onClick:D=>n.selectIcon(T.icon)},[T.isNone?(p(),y("span",Oh,"Ø")):(p(),y("i",{key:1,class:x(T.icon)},null,2))],10,Ih))),128))]),l("div",Nh,[l("div",xh,A(n.currentPage)+"/"+A(n.totalPages)+" ("+A(n.totalIcons)+") ",1),l("div",kh,[n.currentPage>1?(p(),y("span",{key:0,class:"woolentor-icons-pagination-left-arrow",onClick:e[2]||(e[2]=(...T)=>n.prevPage&&n.prevPage(...T))},[c(_)])):C("",!0),n.currentPage<n.totalPages?(p(),y("span",{key:1,class:"woolentor-icons-pagination-right-arrow",onClick:e[3]||(e[3]=(...T)=>n.nextPage&&n.nextPage(...T))},[c(v)])):C("",!0)])])])]),_:1},8,["visible"])])])]),_:1})}const Ph=M(yh,[["render",Rh]]),Mh={name:"field-iconpicker",template:Ph},Gh={name:"field-imageupload",props:["field","model","class"],emits:["onChange","openProModal"],components:{ProBadge:q},data(){return{model:this.model,fieldData:this.field,currentRoute:this.$route}},methods:{openMediaUploader(){const t=wp.media({title:this.fieldData.name,button:{text:"Use this image"},multiple:!1});t.on("select",()=>{const e=t.state().get("selection").first().toJSON();this.model[this.fieldData.id]=e.url,this.$emit("onChange")}),t.open()},removeImage(){this.model[this.fieldData.id]="",this.$emit("onChange")}}},Fh={class:"woolentor-card-field-label"},Vh={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},Uh=["innerHTML"],Bh=["innerHTML"],zh={class:"woolentor-imageupload"},Hh={key:0,class:"woolentor-imageupload-display"},jh=["src","alt"];function $h(t,e,o,n,s,i){const a=q,r=pe,f=ae;return p(),w(f,{style:{width:"auto",border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{style:{display:"flex","align-items":"center","justify-content":"space-between",gap:"15px"},onClick:e[0]||(e[0]=d=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},[l("div",Fh,[l("span",Vh,[l("span",{innerHTML:s.fieldData.name},null,8,Uh),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)]),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,Bh)):C("",!0)]),l("div",{class:x(`woolentor-card-field-element ${s.fieldData?.class||""} ${this.class}`)},[l("div",zh,[s.model[s.fieldData.id]?(p(),y("div",Hh,[l("img",{src:s.model[s.fieldData.id],alt:s.fieldData.name},null,8,jh)])):C("",!0),c(r,{disabled:s.fieldData.is_pro,type:"primary",onClick:i.openMediaUploader},{default:m(()=>[k(A(s.fieldData?.options?.button_label||"Upload Image"),1)]),_:1},8,["disabled","onClick"]),s.model[s.fieldData.id]?(p(),w(r,{key:1,disabled:s.fieldData.is_pro,type:"danger",onClick:i.removeImage},{default:m(()=>[k(A(s.fieldData?.options?.button_remove_label||"Remove Image"),1)]),_:1},8,["disabled","onClick"])):C("",!0)])],2)])]),_:1})}const Wh=M(Gh,[["render",$h],["__scopeId","data-v-5bd49236"]]),qh={name:"field-imageupload",template:Wh},Kh={name:"field-switcher",props:["field","model","class"],emits:["onChange","openProModal","openSettingsModal"],components:{ProBadge:q,VideoPreview:bt,Setting:rn},data(){return{fieldData:this.field,currentRoute:this.$route,settingFields:this.field.setting_fields,model:this.model,moduleModel:this.woolentorLocalizeData.options[this.field.id]||this.model,optionIds:this.getOptionIds()}},computed:{...Se(["GET_MODULE_SETTING_LOADER"]),isSpinning(){return this.GET_MODULE_SETTING_LOADER(this.fieldData.id)},isAnyOptionActive(){return this.optionIds.length?this.optionIds.some(t=>this.moduleModel[t]==="on"):this.moduleModel[this.field?.id]==="on"}},methods:{...Fe(["FETCH_SETTINGS","SAVE_SETTINGS","REMOVE_LOADER","SET_MODULE_SETTING_LOADER"]),getOptionIds(){const t=this.field?.option_id;return t?t.split(",").map(e=>e.trim()):[]},openSettings(){this.SET_MODULE_SETTING_LOADER({moduleId:this.fieldData.id,isLoading:!0}),this.$emit("openSettingsModal",!0)}}},Yh={class:"woolentor-card-field-label-switcher",style:{display:"flex","align-items":"center",gap:"8px"}},Jh=["innerHTML"],Xh=["href"],Qh={key:0,class:"settings-icon-wrapper"};function Zh(t,e,o,n,s,i){const a=q,r=cn,f=bt,d=V("Setting"),u=Ae,g=pe,_=ae;return p(),w(_,{style:{width:"auto",border:"1px solid #DCDCDC","border-radius":"8px"},shadow:"never","border-card":"false","body-style":"padding: 12px 20px; display: flex; align-items: center; justify-content: space-between;gap:10px;",onClick:e[0]||(e[0]=v=>s.fieldData?.is_pro?t.$emit("openProModal",!0):null)},{default:m(()=>[l("div",Yh,[l("span",{style:Ce([{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"400"},{color:i.isAnyOptionActive?"#000000":"#7D8087"}])},[l("span",{innerHTML:s.fieldData.name},null,8,Jh),s.fieldData?.is_pro?(p(),w(a,{key:0})):C("",!0)],4),s.fieldData?.documentation?(p(),w(r,{key:0,content:"Documentation",placement:"top",effect:"dark"},{default:m(()=>[l("a",{href:s.fieldData?.documentation,target:"_blank",class:"woolentor-admin-settings-link"},e[1]||(e[1]=[l("i",{class:"wli wli-question"},null,-1)]),8,Xh)]),_:1})):C("",!0),c(f,{"preview-url":s.fieldData?.preview},null,8,["preview-url"])]),l("div",{class:x(`woolentor-card-field-element-switcher ${s.fieldData?.class||""} ${this.class}`)},[s.fieldData.type==="module"?(p(),y("div",Qh,[c(g,{class:x({"settings-icon-btn":!0,"is-active":i.isAnyOptionActive}),disabled:s.fieldData?.is_pro,onClick:he(i.openSettings,["stop"]),style:Ce({color:i.isAnyOptionActive?"#409eff":"#7D8087"})},{default:m(()=>[c(u,{class:x({"is-spinning":i.isSpinning})},{default:m(()=>[c(d)]),_:1},8,["class"])]),_:1},8,["class","disabled","onClick","style"])])):C("",!0)],2)]),_:1})}const e_=M(Kh,[["render",Zh]]),t_={name:"field-module",template:e_},n_={name:"field-multiselect",props:["field","model","class"],emits:["onChange","openProModal"],components:{ProBadge:q},setup(t){return{getTextFromHtml:xt,absoluteNumberToString:Vn,stringToAbsoluteNumber:Qo}},data(){return{fieldData:this.field,currentRoute:this.$route,selectedValues:this.model[this.field.id]}},created(){this.field?.convertnumber===!0&&this.model[this.field.id]&&(this.selectedValues=this.absoluteNumberToString(this.model[this.field.id]))},methods:{handleChange(t){this.model[this.field.id]=this.field?.convertnumber===!0?this.stringToAbsoluteNumber(t):t,this.$emit("onChange")}}},o_={class:"woolentor-card-field-label"},s_={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},i_=["innerHTML"],a_=["innerHTML"],l_={class:"woolentor-card-field-element"},r_=["innerHTML"];function c_(t,e,o,n,s,i){const a=q,r=It,f=Ot,d=ae;return p(),w(d,{style:{width:"auto",border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{class:x(`${s.fieldData?.class||""} ${this.class}`),style:{display:"flex","align-items":"center","justify-content":"space-between",gap:"15px"},onClick:e[1]||(e[1]=u=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},[l("div",o_,[l("span",s_,[l("span",{innerHTML:s.fieldData.name},null,8,i_),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)]),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,a_)):C("",!0)]),l("div",l_,[c(f,{modelValue:s.selectedValues,"onUpdate:modelValue":e[0]||(e[0]=u=>s.selectedValues=u),multiple:"",placeholder:s.fieldData?.placeholder||"Select",onChange:i.handleChange,size:"large",disabled:s.fieldData.is_pro,style:{"max-width":"400px"}},{default:m(()=>[(p(!0),y(B,null,ee(s.fieldData.options,(u,g)=>(p(),w(r,{key:s.fieldData?.convertnumber===!0?n.absoluteNumberToString(g):g,label:n.getTextFromHtml(u),value:s.fieldData?.convertnumber===!0?n.absoluteNumberToString(g):g,disabled:s.fieldData.is_pro},{default:m(()=>[l("span",{innerHTML:u},null,8,r_)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["modelValue","placeholder","onChange","disabled"])])],2)]),_:1})}const d_=M(n_,[["render",c_]]),u_={name:"field-multiselect",template:d_},p_={name:"field-multitext",props:["field","model","class"],emits:["onChange","openProModal"],components:{ProBadge:q},setup(t){return{getTextFromHtml:xt}},data(){return{fieldData:this.field,currentRoute:this.$route,hasGroup:!!this.field?.options?.group}},created(){this.initializeModelField()},methods:{initializeModelField(){const t=this.model[this.fieldData.id];(!t||typeof t!="object"||Array.isArray(t))&&(this.model[this.fieldData.id]={...Array.isArray(t)?{}:t||{}})},getInputValue(t){return this.initializeModelField(),this.model[this.fieldData.id][t]||""},updateValue(t,e){this.initializeModelField(),this.model[this.fieldData.id]||(this.model[this.fieldData.id]={}),this.model[this.fieldData.id][t]=e,this.$emit("onChange")}}},f_={style:{display:"flex",color:"#000","font-size":"14px","font-weight":"700"}},m_=["innerHTML"],g_={class:"woolentor-card-field-label"},h_={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},__=["innerHTML"],y_={class:"woolentor-card-field-element"};function v_(t,e,o,n,s,i){const a=q,r=ht,f=yt,d=za,u=Ha;return p(),w(u,null,{default:m(()=>[c(d,{title:s.fieldData.name,name:s.fieldData.id},{title:m(()=>[l("span",f_,[l("span",{innerHTML:s.fieldData.name},null,8,m_),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)])]),default:m(()=>[(p(!0),y(B,null,ee(s.fieldData.options,(g,_)=>(p(),y("div",{key:_,class:x(`woolentor-element-card ${s.fieldData?.class||""} ${this.class}`),style:{display:"flex","align-items":"center","flex-wrap":"wrap"},onClick:e[1]||(e[1]=v=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},[l("div",g_,[l("span",h_,[l("span",{innerHTML:g},null,8,__)])]),l("div",y_,[c(r,{"model-value":i.getInputValue(_),"onUpdate:modelValue":v=>i.updateValue(_,v),onChange:e[0]||(e[0]=v=>t.$emit("onChange")),disabled:s.fieldData.is_pro},null,8,["model-value","onUpdate:modelValue","disabled"])]),_!==Object.keys(s.fieldData.options).length-1?(p(),w(f,{key:0})):C("",!0)],2))),128))]),_:1},8,["title","name"])]),_:1})}const b_=M(p_,[["render",v_]]),T_={name:"field-multitext",template:b_},w_={name:"field-number",props:["field","model","class"],emits:["onChange","openProModal"],data(){return{model:this.model,fieldData:this.field,currentRoute:this.$route}},components:{ProBadge:q},methods:{}},E_={class:"woolentor-card-field-label"},C_={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},S_=["innerHTML"],A_=["innerHTML"],D_={class:"woolentor-card-field-element"};function L_(t,e,o,n,s,i){const a=q,r=Us,f=ae;return p(),w(f,{style:{width:"auto",border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{style:{display:"flex","align-items":"center","justify-content":"space-between",gap:"15px"},onClick:e[2]||(e[2]=d=>s.fieldData.is_pro?t.$emit("openProModal",!0):null),class:"woolentor-element-card"},[l("div",E_,[l("span",C_,[l("span",{innerHTML:s.fieldData.name},null,8,S_),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)]),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,A_)):C("",!0)]),l("div",D_,[c(r,{modelValue:s.model[s.fieldData.id],"onUpdate:modelValue":e[0]||(e[0]=d=>s.model[s.fieldData.id]=d),min:s.fieldData?.min,max:s.fieldData?.max,placeholder:s.fieldData?.placeholder,"controls-position":"right",size:"large",onInput:e[1]||(e[1]=d=>t.$emit("onChange")),disabled:s.fieldData.is_pro},null,8,["modelValue","min","max","placeholder","disabled"])])])]),_:1})}const I_=M(w_,[["render",L_],["__scopeId","data-v-17b4598a"]]),O_={name:"field-number",template:I_},N_={name:"field-radio",props:["field","model","class"],emits:["onChange","openProModal"],components:{ProBadge:q},data(){return{fieldData:this.field,currentRoute:this.$route}}},x_={class:"woolentor-card-field-label"},k_={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},R_=["innerHTML"],P_=["innerHTML"];function M_(t,e,o,n,s,i){const a=q,r=ja,f=$a,d=ae;return p(),w(d,{style:{width:"auto",border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{style:{display:"flex","align-items":"center","justify-content":"space-between",gap:"15px"},onClick:e[2]||(e[2]=u=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},[l("div",x_,[l("span",k_,[l("span",{innerHTML:s.fieldData.name},null,8,R_),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)]),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,P_)):C("",!0)]),l("div",{class:x(`woolentor-card-field-element ${s.fieldData?.class||""} ${this.class}`)},[c(f,{modelValue:this.model[s.fieldData.id],"onUpdate:modelValue":e[0]||(e[0]=u=>this.model[s.fieldData.id]=u),onChange:e[1]||(e[1]=u=>t.$emit("onChange"))},{default:m(()=>[(p(!0),y(B,null,ee(s.fieldData.options,(u,g)=>(p(),w(r,{key:g,label:u,value:g,disabled:s.fieldData.is_pro},null,8,["label","value","disabled"]))),128))]),_:1},8,["modelValue"])],2)])]),_:1})}const G_=M(N_,[["render",M_]]),F_={name:"field-radio",template:G_};/*! * vue-draggable-next v2.2.0 * (c) 2023 Anish George * @license MIT *//**! * Sortable 1.14.0 * @author RubaXa <trash@rubaxa.org> * @author owenm <owen23355@gmail.com> * @license MIT */function Ts(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),o.push.apply(o,n)}return o}function nt(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?Ts(Object(o),!0).forEach(function(n){V_(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Ts(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function In(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?In=function(e){return typeof e}:In=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},In(t)}function V_(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function st(){return st=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},st.apply(this,arguments)}function U_(t,e){if(t==null)return{};var o={},n=Object.keys(t),s,i;for(i=0;i<n.length;i++)s=n[i],!(e.indexOf(s)>=0)&&(o[s]=t[s]);return o}function B_(t,e){if(t==null)return{};var o=U_(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var z_="1.14.0";function ot(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var ct=ot(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),fn=ot(/Edge/i),ws=ot(/firefox/i),Xt=ot(/safari/i)&&!ot(/chrome/i)&&!ot(/android/i),Bi=ot(/iP(ad|od|hone)/i),H_=ot(/chrome/i)&&ot(/android/i),zi={capture:!1,passive:!1};function ie(t,e,o){t.addEventListener(e,o,!ct&&zi)}function oe(t,e,o){t.removeEventListener(e,o,!ct&&zi)}function Un(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function j_(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function et(t,e,o,n){if(t){o=o||document;do{if(e!=null&&(e[0]===">"?t.parentNode===o&&Un(t,e):Un(t,e))||n&&t===o)return t;if(t===o)break}while(t=j_(t))}return null}var Es=/\s+/g;function Ue(t,e,o){if(t&&e)if(t.classList)t.classList[o?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(Es," ").replace(" "+e+" "," ");t.className=(n+(o?" "+e:"")).replace(Es," ")}}function j(t,e,o){var n=t&&t.style;if(n){if(o===void 0)return document.defaultView&&document.defaultView.getComputedStyle?o=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(o=t.currentStyle),e===void 0?o:o[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=o+(typeof o=="string"?"":"px")}}function Ut(t,e){var o="";if(typeof t=="string")o=t;else do{var n=j(t,"transform");n&&n!=="none"&&(o=n+" "+o)}while(!e&&(t=t.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(o)}function Hi(t,e,o){if(t){var n=t.getElementsByTagName(e),s=0,i=n.length;if(o)for(;s<i;s++)o(n[s],s);return n}return[]}function tt(){var t=document.scrollingElement;return t||document.documentElement}function Te(t,e,o,n,s){if(!(!t.getBoundingClientRect&&t!==window)){var i,a,r,f,d,u,g;if(t!==window&&t.parentNode&&t!==tt()?(i=t.getBoundingClientRect(),a=i.top,r=i.left,f=i.bottom,d=i.right,u=i.height,g=i.width):(a=0,r=0,f=window.innerHeight,d=window.innerWidth,u=window.innerHeight,g=window.innerWidth),(e||o)&&t!==window&&(s=s||t.parentNode,!ct))do if(s&&s.getBoundingClientRect&&(j(s,"transform")!=="none"||o&&j(s,"position")!=="static")){var _=s.getBoundingClientRect();a-=_.top+parseInt(j(s,"border-top-width")),r-=_.left+parseInt(j(s,"border-left-width")),f=a+i.height,d=r+i.width;break}while(s=s.parentNode);if(n&&t!==window){var v=Ut(s||t),h=v&&v.a,b=v&&v.d;v&&(a/=b,r/=h,g/=h,u/=b,f=a+u,d=r+g)}return{top:a,left:r,bottom:f,right:d,width:g,height:u}}}function Cs(t,e,o){for(var n=gt(t,!0),s=Te(t)[e];n;){var i=Te(n)[o],a=void 0;if(a=s>=i,!a)return n;if(n===tt())break;n=gt(n,!1)}return!1}function Bt(t,e,o,n){for(var s=0,i=0,a=t.children;i<a.length;){if(a[i].style.display!=="none"&&a[i]!==$.ghost&&(n||a[i]!==$.dragged)&&et(a[i],o.draggable,t,!1)){if(s===e)return a[i];s++}i++}return null}function Zo(t,e){for(var o=t.lastElementChild;o&&(o===$.ghost||j(o,"display")==="none"||e&&!Un(o,e));)o=o.previousElementSibling;return o||null}function qe(t,e){var o=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==$.clone&&(!e||Un(t,e))&&o++;return o}function Ss(t){var e=0,o=0,n=tt();if(t)do{var s=Ut(t),i=s.a,a=s.d;e+=t.scrollLeft*i,o+=t.scrollTop*a}while(t!==n&&(t=t.parentNode));return[e,o]}function $_(t,e){for(var o in t)if(t.hasOwnProperty(o)){for(var n in e)if(e.hasOwnProperty(n)&&e[n]===t[o][n])return Number(o)}return-1}function gt(t,e){if(!t||!t.getBoundingClientRect)return tt();var o=t,n=!1;do if(o.clientWidth<o.scrollWidth||o.clientHeight<o.scrollHeight){var s=j(o);if(o.clientWidth<o.scrollWidth&&(s.overflowX=="auto"||s.overflowX=="scroll")||o.clientHeight<o.scrollHeight&&(s.overflowY=="auto"||s.overflowY=="scroll")){if(!o.getBoundingClientRect||o===document.body)return tt();if(n||e)return o;n=!0}}while(o=o.parentNode);return tt()}function W_(t,e){if(t&&e)for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}function fo(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var Qt;function ji(t,e){return function(){if(!Qt){var o=arguments,n=this;o.length===1?t.call(n,o[0]):t.apply(n,o),Qt=setTimeout(function(){Qt=void 0},e)}}}function q_(){clearTimeout(Qt),Qt=void 0}function $i(t,e,o){t.scrollLeft+=e,t.scrollTop+=o}function Wi(t){var e=window.Polymer,o=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):o?o(t).clone(!0)[0]:t.cloneNode(!0)}var ze="Sortable"+new Date().getTime();function K_(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(s){if(!(j(s,"display")==="none"||s===$.ghost)){t.push({target:s,rect:Te(s)});var i=nt({},t[t.length-1].rect);if(s.thisAnimationDuration){var a=Ut(s,!0);a&&(i.top-=a.f,i.left-=a.e)}s.fromRect=i}})}},addAnimationState:function(n){t.push(n)},removeAnimationState:function(n){t.splice($_(t,{target:n}),1)},animateAll:function(n){var s=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var i=!1,a=0;t.forEach(function(r){var f=0,d=r.target,u=d.fromRect,g=Te(d),_=d.prevFromRect,v=d.prevToRect,h=r.rect,b=Ut(d,!0);b&&(g.top-=b.f,g.left-=b.e),d.toRect=g,d.thisAnimationDuration&&fo(_,g)&&!fo(u,g)&&(h.top-g.top)/(h.left-g.left)===(u.top-g.top)/(u.left-g.left)&&(f=J_(h,_,v,s.options)),fo(g,u)||(d.prevFromRect=u,d.prevToRect=g,f||(f=s.options.animation),s.animate(d,h,g,f)),f&&(i=!0,a=Math.max(a,f),clearTimeout(d.animationResetTimer),d.animationResetTimer=setTimeout(function(){d.animationTime=0,d.prevFromRect=null,d.fromRect=null,d.prevToRect=null,d.thisAnimationDuration=null},f),d.thisAnimationDuration=f)}),clearTimeout(e),i?e=setTimeout(function(){typeof n=="function"&&n()},a):typeof n=="function"&&n(),t=[]},animate:function(n,s,i,a){if(a){j(n,"transition",""),j(n,"transform","");var r=Ut(this.el),f=r&&r.a,d=r&&r.d,u=(s.left-i.left)/(f||1),g=(s.top-i.top)/(d||1);n.animatingX=!!u,n.animatingY=!!g,j(n,"transform","translate3d("+u+"px,"+g+"px,0)"),this.forRepaintDummy=Y_(n),j(n,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),j(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){j(n,"transition",""),j(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},a)}}}}function Y_(t){return t.offsetWidth}function J_(t,e,o,n){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-o.top,2)+Math.pow(e.left-o.left,2))*n.animation}var Pt=[],mo={initializeByDefault:!0},mn={mount:function(e){for(var o in mo)mo.hasOwnProperty(o)&&!(o in e)&&(e[o]=mo[o]);Pt.forEach(function(n){if(n.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),Pt.push(e)},pluginEvent:function(e,o,n){var s=this;this.eventCanceled=!1,n.cancel=function(){s.eventCanceled=!0};var i=e+"Global";Pt.forEach(function(a){o[a.pluginName]&&(o[a.pluginName][i]&&o[a.pluginName][i](nt({sortable:o},n)),o.options[a.pluginName]&&o[a.pluginName][e]&&o[a.pluginName][e](nt({sortable:o},n)))})},initializePlugins:function(e,o,n,s){Pt.forEach(function(r){var f=r.pluginName;if(!(!e.options[f]&&!r.initializeByDefault)){var d=new r(e,o,e.options);d.sortable=e,d.options=e.options,e[f]=d,st(n,d.defaults)}});for(var i in e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);typeof a<"u"&&(e.options[i]=a)}},getEventProperties:function(e,o){var n={};return Pt.forEach(function(s){typeof s.eventProperties=="function"&&st(n,s.eventProperties.call(o[s.pluginName],e))}),n},modifyOption:function(e,o,n){var s;return Pt.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[o]=="function"&&(s=i.optionListeners[o].call(e[i.pluginName],n))}),s}};function X_(t){var e=t.sortable,o=t.rootEl,n=t.name,s=t.targetEl,i=t.cloneEl,a=t.toEl,r=t.fromEl,f=t.oldIndex,d=t.newIndex,u=t.oldDraggableIndex,g=t.newDraggableIndex,_=t.originalEvent,v=t.putSortable,h=t.extraEventProperties;if(e=e||o&&o[ze],!!e){var b,T=e.options,D="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!ct&&!fn?b=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(b=document.createEvent("Event"),b.initEvent(n,!0,!0)),b.to=a||o,b.from=r||o,b.item=s||o,b.clone=i,b.oldIndex=f,b.newIndex=d,b.oldDraggableIndex=u,b.newDraggableIndex=g,b.originalEvent=_,b.pullMode=v?v.lastPutMode:void 0;var S=nt(nt({},h),mn.getEventProperties(n,e));for(var P in S)b[P]=S[P];o&&o.dispatchEvent(b),T[D]&&T[D].call(e,b)}}var Q_=["evt"],Me=function(e,o){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=n.evt,i=B_(n,Q_);mn.pluginEvent.bind($)(e,o,nt({dragEl:I,parentEl:me,ghostEl:Y,rootEl:ce,nextEl:Ct,lastDownEl:On,cloneEl:ge,cloneHidden:mt,dragStarted:Kt,putSortable:Ee,activeSortable:$.active,originalEvent:s,oldIndex:Vt,oldDraggableIndex:Zt,newIndex:Be,newDraggableIndex:pt,hideGhostForTarget:Ji,unhideGhostForTarget:Xi,cloneNowHidden:function(){mt=!0},cloneNowShown:function(){mt=!1},dispatchSortableEvent:function(r){Pe({sortable:o,name:r,originalEvent:s})}},i))};function Pe(t){X_(nt({putSortable:Ee,cloneEl:ge,targetEl:I,rootEl:ce,oldIndex:Vt,oldDraggableIndex:Zt,newIndex:Be,newDraggableIndex:pt},t))}var I,me,Y,ce,Ct,On,ge,mt,Vt,Be,Zt,pt,Tn,Ee,Gt=!1,Bn=!1,zn=[],wt,Ye,go,ho,As,Ds,Kt,Mt,en,tn=!1,wn=!1,Nn,Ie,_o=[],Oo=!1,Hn=[],no=typeof document<"u",En=Bi,Ls=fn||ct?"cssFloat":"float",Z_=no&&!H_&&!Bi&&"draggable"in document.createElement("div"),qi=function(){if(no){if(ct)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),Ki=function(e,o){var n=j(e),s=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Bt(e,0,o),a=Bt(e,1,o),r=i&&j(i),f=a&&j(a),d=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+Te(i).width,u=f&&parseInt(f.marginLeft)+parseInt(f.marginRight)+Te(a).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&r.float&&r.float!=="none"){var g=r.float==="left"?"left":"right";return a&&(f.clear==="both"||f.clear===g)?"vertical":"horizontal"}return i&&(r.display==="block"||r.display==="flex"||r.display==="table"||r.display==="grid"||d>=s&&n[Ls]==="none"||a&&n[Ls]==="none"&&d+u>s)?"vertical":"horizontal"},ey=function(e,o,n){var s=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,r=n?o.left:o.top,f=n?o.right:o.bottom,d=n?o.width:o.height;return s===r||i===f||s+a/2===r+d/2},ty=function(e,o){var n;return zn.some(function(s){var i=s[ze].options.emptyInsertThreshold;if(!(!i||Zo(s))){var a=Te(s),r=e>=a.left-i&&e<=a.right+i,f=o>=a.top-i&&o<=a.bottom+i;if(r&&f)return n=s}}),n},Yi=function(e){function o(i,a){return function(r,f,d,u){var g=r.options.group.name&&f.options.group.name&&r.options.group.name===f.options.group.name;if(i==null&&(a||g))return!0;if(i==null||i===!1)return!1;if(a&&i==="clone")return i;if(typeof i=="function")return o(i(r,f,d,u),a)(r,f,d,u);var _=(a?r:f).options.group.name;return i===!0||typeof i=="string"&&i===_||i.join&&i.indexOf(_)>-1}}var n={},s=e.group;(!s||In(s)!="object")&&(s={name:s}),n.name=s.name,n.checkPull=o(s.pull,!0),n.checkPut=o(s.put),n.revertClone=s.revertClone,e.group=n},Ji=function(){!qi&&Y&&j(Y,"display","none")},Xi=function(){!qi&&Y&&j(Y,"display","")};no&&document.addEventListener("click",function(t){if(Bn)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Bn=!1,!1},!0);var Et=function(e){if(I){e=e.touches?e.touches[0]:e;var o=ty(e.clientX,e.clientY);if(o){var n={};for(var s in e)e.hasOwnProperty(s)&&(n[s]=e[s]);n.target=n.rootEl=o,n.preventDefault=void 0,n.stopPropagation=void 0,o[ze]._onDragOver(n)}}},ny=function(e){I&&I.parentNode[ze]._isOutsideThisEl(e.target)};function $(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=st({},e),t[ze]=this;var o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ki(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,r){a.setData("Text",r.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:$.supportPointer!==!1&&"PointerEvent"in window&&!Xt,emptyInsertThreshold:5};mn.initializePlugins(this,t,o);for(var n in o)!(n in e)&&(e[n]=o[n]);Yi(e);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=e.forceFallback?!1:Z_,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?ie(t,"pointerdown",this._onTapStart):(ie(t,"mousedown",this._onTapStart),ie(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(ie(t,"dragover",this),ie(t,"dragenter",this)),zn.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),st(this,K_())}$.prototype={constructor:$,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Mt=null)},_getDirection:function(e,o){return typeof this.options.direction=="function"?this.options.direction.call(this,e,o,I):this.options.direction},_onTapStart:function(e){if(e.cancelable){var o=this,n=this.el,s=this.options,i=s.preventOnFilter,a=e.type,r=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,f=(r||e).target,d=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||f,u=s.filter;if(dy(n),!I&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||s.disabled)&&!d.isContentEditable&&!(!this.nativeDraggable&&Xt&&f&&f.tagName.toUpperCase()==="SELECT")&&(f=et(f,s.draggable,n,!1),!(f&&f.animated)&&On!==f)){if(Vt=qe(f),Zt=qe(f,s.draggable),typeof u=="function"){if(u.call(this,e,f,this)){Pe({sortable:o,rootEl:d,name:"filter",targetEl:f,toEl:n,fromEl:n}),Me("filter",o,{evt:e}),i&&e.cancelable&&e.preventDefault();return}}else if(u&&(u=u.split(",").some(function(g){if(g=et(d,g.trim(),n,!1),g)return Pe({sortable:o,rootEl:g,name:"filter",targetEl:f,fromEl:n,toEl:n}),Me("filter",o,{evt:e}),!0}),u)){i&&e.cancelable&&e.preventDefault();return}s.handle&&!et(d,s.handle,n,!1)||this._prepareDragStart(e,r,f)}}},_prepareDragStart:function(e,o,n){var s=this,i=s.el,a=s.options,r=i.ownerDocument,f;if(n&&!I&&n.parentNode===i){var d=Te(n);if(ce=i,I=n,me=I.parentNode,Ct=I.nextSibling,On=n,Tn=a.group,$.dragged=I,wt={target:I,clientX:(o||e).clientX,clientY:(o||e).clientY},As=wt.clientX-d.left,Ds=wt.clientY-d.top,this._lastX=(o||e).clientX,this._lastY=(o||e).clientY,I.style["will-change"]="all",f=function(){if(Me("delayEnded",s,{evt:e}),$.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!ws&&s.nativeDraggable&&(I.draggable=!0),s._triggerDragStart(e,o),Pe({sortable:s,name:"choose",originalEvent:e}),Ue(I,a.chosenClass,!0)},a.ignore.split(",").forEach(function(u){Hi(I,u.trim(),yo)}),ie(r,"dragover",Et),ie(r,"mousemove",Et),ie(r,"touchmove",Et),ie(r,"mouseup",s._onDrop),ie(r,"touchend",s._onDrop),ie(r,"touchcancel",s._onDrop),ws&&this.nativeDraggable&&(this.options.touchStartThreshold=4,I.draggable=!0),Me("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||o)&&(!this.nativeDraggable||!(fn||ct))){if($.eventCanceled){this._onDrop();return}ie(r,"mouseup",s._disableDelayedDrag),ie(r,"touchend",s._disableDelayedDrag),ie(r,"touchcancel",s._disableDelayedDrag),ie(r,"mousemove",s._delayedDragTouchMoveHandler),ie(r,"touchmove",s._delayedDragTouchMoveHandler),a.supportPointer&&ie(r,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(f,a.delay)}else f()}},_delayedDragTouchMoveHandler:function(e){var o=e.touches?e.touches[0]:e;Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){I&&yo(I),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;oe(e,"mouseup",this._disableDelayedDrag),oe(e,"touchend",this._disableDelayedDrag),oe(e,"touchcancel",this._disableDelayedDrag),oe(e,"mousemove",this._delayedDragTouchMoveHandler),oe(e,"touchmove",this._delayedDragTouchMoveHandler),oe(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,o){o=o||e.pointerType=="touch"&&e,!this.nativeDraggable||o?this.options.supportPointer?ie(document,"pointermove",this._onTouchMove):o?ie(document,"touchmove",this._onTouchMove):ie(document,"mousemove",this._onTouchMove):(ie(I,"dragend",this),ie(ce,"dragstart",this._onDragStart));try{document.selection?xn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,o){if(Gt=!1,ce&&I){Me("dragStarted",this,{evt:o}),this.nativeDraggable&&ie(document,"dragover",ny);var n=this.options;!e&&Ue(I,n.dragClass,!1),Ue(I,n.ghostClass,!0),$.active=this,e&&this._appendGhost(),Pe({sortable:this,name:"start",originalEvent:o})}else this._nulling()},_emulateDragOver:function(){if(Ye){this._lastX=Ye.clientX,this._lastY=Ye.clientY,Ji();for(var e=document.elementFromPoint(Ye.clientX,Ye.clientY),o=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Ye.clientX,Ye.clientY),e!==o);)o=e;if(I.parentNode[ze]._isOutsideThisEl(e),o)do{if(o[ze]){var n=void 0;if(n=o[ze]._onDragOver({clientX:Ye.clientX,clientY:Ye.clientY,target:e,rootEl:o}),n&&!this.options.dragoverBubble)break}e=o}while(o=o.parentNode);Xi()}},_onTouchMove:function(e){if(wt){var o=this.options,n=o.fallbackTolerance,s=o.fallbackOffset,i=e.touches?e.touches[0]:e,a=Y&&Ut(Y,!0),r=Y&&a&&a.a,f=Y&&a&&a.d,d=En&&Ie&&Ss(Ie),u=(i.clientX-wt.clientX+s.x)/(r||1)+(d?d[0]-_o[0]:0)/(r||1),g=(i.clientY-wt.clientY+s.y)/(f||1)+(d?d[1]-_o[1]:0)/(f||1);if(!$.active&&!Gt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(Y){a?(a.e+=u-(go||0),a.f+=g-(ho||0)):a={a:1,b:0,c:0,d:1,e:u,f:g};var _="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");j(Y,"webkitTransform",_),j(Y,"mozTransform",_),j(Y,"msTransform",_),j(Y,"transform",_),go=u,ho=g,Ye=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!Y){var e=this.options.fallbackOnBody?document.body:ce,o=Te(I,!0,En,!0,e),n=this.options;if(En){for(Ie=e;j(Ie,"position")==="static"&&j(Ie,"transform")==="none"&&Ie!==document;)Ie=Ie.parentNode;Ie!==document.body&&Ie!==document.documentElement?(Ie===document&&(Ie=tt()),o.top+=Ie.scrollTop,o.left+=Ie.scrollLeft):Ie=tt(),_o=Ss(Ie)}Y=I.cloneNode(!0),Ue(Y,n.ghostClass,!1),Ue(Y,n.fallbackClass,!0),Ue(Y,n.dragClass,!0),j(Y,"transition",""),j(Y,"transform",""),j(Y,"box-sizing","border-box"),j(Y,"margin",0),j(Y,"top",o.top),j(Y,"left",o.left),j(Y,"width",o.width),j(Y,"height",o.height),j(Y,"opacity","0.8"),j(Y,"position",En?"absolute":"fixed"),j(Y,"zIndex","100000"),j(Y,"pointerEvents","none"),$.ghost=Y,e.appendChild(Y),j(Y,"transform-origin",As/parseInt(Y.style.width)*100+"% "+Ds/parseInt(Y.style.height)*100+"%")}},_onDragStart:function(e,o){var n=this,s=e.dataTransfer,i=n.options;if(Me("dragStart",this,{evt:e}),$.eventCanceled){this._onDrop();return}Me("setupClone",this),$.eventCanceled||(ge=Wi(I),ge.draggable=!1,ge.style["will-change"]="",this._hideClone(),Ue(ge,this.options.chosenClass,!1),$.clone=ge),n.cloneId=xn(function(){Me("clone",n),!$.eventCanceled&&(n.options.removeCloneOnHide||ce.insertBefore(ge,I),n._hideClone(),Pe({sortable:n,name:"clone"}))}),!o&&Ue(I,i.dragClass,!0),o?(Bn=!0,n._loopId=setInterval(n._emulateDragOver,50)):(oe(document,"mouseup",n._onDrop),oe(document,"touchend",n._onDrop),oe(document,"touchcancel",n._onDrop),s&&(s.effectAllowed="move",i.setData&&i.setData.call(n,s,I)),ie(document,"drop",n),j(I,"transform","translateZ(0)")),Gt=!0,n._dragStartId=xn(n._dragStarted.bind(n,o,e)),ie(document,"selectstart",n),Kt=!0,Xt&&j(document.body,"user-select","none")},_onDragOver:function(e){var o=this.el,n=e.target,s,i,a,r=this.options,f=r.group,d=$.active,u=Tn===f,g=r.sort,_=Ee||d,v,h=this,b=!1;if(Oo)return;function T(ke,$e){Me(ke,h,nt({evt:e,isOwner:u,axis:v?"vertical":"horizontal",revert:a,dragRect:s,targetRect:i,canSort:g,fromSortable:_,target:n,completed:S,onMove:function(Re,Qe){return Cn(ce,o,I,s,Re,Te(Re),e,Qe)},changed:P},$e))}function D(){T("dragOverAnimationCapture"),h.captureAnimationState(),h!==_&&_.captureAnimationState()}function S(ke){return T("dragOverCompleted",{insertion:ke}),ke&&(u?d._hideClone():d._showClone(h),h!==_&&(Ue(I,Ee?Ee.options.ghostClass:d.options.ghostClass,!1),Ue(I,r.ghostClass,!0)),Ee!==h&&h!==$.active?Ee=h:h===$.active&&Ee&&(Ee=null),_===h&&(h._ignoreWhileAnimating=n),h.animateAll(function(){T("dragOverAnimationComplete"),h._ignoreWhileAnimating=null}),h!==_&&(_.animateAll(),_._ignoreWhileAnimating=null)),(n===I&&!I.animated||n===o&&!n.animated)&&(Mt=null),!r.dragoverBubble&&!e.rootEl&&n!==document&&(I.parentNode[ze]._isOutsideThisEl(e.target),!ke&&Et(e)),!r.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),b=!0}function P(){Be=qe(I),pt=qe(I,r.draggable),Pe({sortable:h,name:"change",toEl:o,newIndex:Be,newDraggableIndex:pt,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=et(n,r.draggable,o,!0),T("dragOver"),$.eventCanceled)return b;if(I.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||h._ignoreWhileAnimating===n)return S(!1);if(Bn=!1,d&&!r.disabled&&(u?g||(a=me!==ce):Ee===this||(this.lastPutMode=Tn.checkPull(this,d,I,e))&&f.checkPut(this,d,I,e))){if(v=this._getDirection(e,n)==="vertical",s=Te(I),T("dragOverValid"),$.eventCanceled)return b;if(a)return me=ce,D(),this._hideClone(),T("revert"),$.eventCanceled||(Ct?ce.insertBefore(I,Ct):ce.appendChild(I)),S(!0);var O=Zo(o,r.draggable);if(!O||ay(e,v,this)&&!O.animated){if(O===I)return S(!1);if(O&&o===e.target&&(n=O),n&&(i=Te(n)),Cn(ce,o,I,s,n,i,e,!!n)!==!1)return D(),o.appendChild(I),me=o,P(),S(!0)}else if(O&&iy(e,v,this)){var L=Bt(o,0,r,!0);if(L===I)return S(!1);if(n=L,i=Te(n),Cn(ce,o,I,s,n,i,e,!1)!==!1)return D(),o.insertBefore(I,L),me=o,P(),S(!0)}else if(n.parentNode===o){i=Te(n);var R=0,z,W=I.parentNode!==o,se=!ey(I.animated&&I.toRect||s,n.animated&&n.toRect||i,v),je=v?"top":"left",De=Cs(n,"top","top")||Cs(I,"top","top"),ue=De?De.scrollTop:void 0;Mt!==n&&(z=i[je],tn=!1,wn=!se&&r.invertSwap||W),R=ly(e,n,i,v,se?1:r.swapThreshold,r.invertedSwapThreshold==null?r.swapThreshold:r.invertedSwapThreshold,wn,Mt===n);var Le;if(R!==0){var G=qe(I);do G-=R,Le=me.children[G];while(Le&&(j(Le,"display")==="none"||Le===Y))}if(R===0||Le===n)return S(!1);Mt=n,en=R;var ne=n.nextElementSibling,le=!1;le=R===1;var re=Cn(ce,o,I,s,n,i,e,le);if(re!==!1)return(re===1||re===-1)&&(le=re===1),Oo=!0,setTimeout(sy,30),D(),le&&!ne?o.appendChild(I):n.parentNode.insertBefore(I,le?ne:n),De&&$i(De,0,ue-De.scrollTop),me=I.parentNode,z!==void 0&&!wn&&(Nn=Math.abs(z-Te(n)[je])),P(),S(!0)}if(o.contains(I))return S(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){oe(document,"mousemove",this._onTouchMove),oe(document,"touchmove",this._onTouchMove),oe(document,"pointermove",this._onTouchMove),oe(document,"dragover",Et),oe(document,"mousemove",Et),oe(document,"touchmove",Et)},_offUpEvents:function(){var e=this.el.ownerDocument;oe(e,"mouseup",this._onDrop),oe(e,"touchend",this._onDrop),oe(e,"pointerup",this._onDrop),oe(e,"touchcancel",this._onDrop),oe(document,"selectstart",this)},_onDrop:function(e){var o=this.el,n=this.options;if(Be=qe(I),pt=qe(I,n.draggable),Me("drop",this,{evt:e}),me=I&&I.parentNode,Be=qe(I),pt=qe(I,n.draggable),$.eventCanceled){this._nulling();return}Gt=!1,wn=!1,tn=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),No(this.cloneId),No(this._dragStartId),this.nativeDraggable&&(oe(document,"drop",this),oe(o,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Xt&&j(document.body,"user-select",""),j(I,"transform",""),e&&(Kt&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),Y&&Y.parentNode&&Y.parentNode.removeChild(Y),(ce===me||Ee&&Ee.lastPutMode!=="clone")&&ge&&ge.parentNode&&ge.parentNode.removeChild(ge),I&&(this.nativeDraggable&&oe(I,"dragend",this),yo(I),I.style["will-change"]="",Kt&&!Gt&&Ue(I,Ee?Ee.options.ghostClass:this.options.ghostClass,!1),Ue(I,this.options.chosenClass,!1),Pe({sortable:this,name:"unchoose",toEl:me,newIndex:null,newDraggableIndex:null,originalEvent:e}),ce!==me?(Be>=0&&(Pe({rootEl:me,name:"add",toEl:me,fromEl:ce,originalEvent:e}),Pe({sortable:this,name:"remove",toEl:me,originalEvent:e}),Pe({rootEl:me,name:"sort",toEl:me,fromEl:ce,originalEvent:e}),Pe({sortable:this,name:"sort",toEl:me,originalEvent:e})),Ee&&Ee.save()):Be!==Vt&&Be>=0&&(Pe({sortable:this,name:"update",toEl:me,originalEvent:e}),Pe({sortable:this,name:"sort",toEl:me,originalEvent:e})),$.active&&((Be==null||Be===-1)&&(Be=Vt,pt=Zt),Pe({sortable:this,name:"end",toEl:me,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Me("nulling",this),ce=I=me=Y=Ct=ge=On=mt=wt=Ye=Kt=Be=pt=Vt=Zt=Mt=en=Ee=Tn=$.dragged=$.ghost=$.clone=$.active=null,Hn.forEach(function(e){e.checked=!0}),Hn.length=go=ho=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":I&&(this._onDragOver(e),oy(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],o,n=this.el.children,s=0,i=n.length,a=this.options;s<i;s++)o=n[s],et(o,a.draggable,this.el,!1)&&e.push(o.getAttribute(a.dataIdAttr)||cy(o));return e},sort:function(e,o){var n={},s=this.el;this.toArray().forEach(function(i,a){var r=s.children[a];et(r,this.options.draggable,s,!1)&&(n[i]=r)},this),o&&this.captureAnimationState(),e.forEach(function(i){n[i]&&(s.removeChild(n[i]),s.appendChild(n[i]))}),o&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,o){return et(e,o||this.options.draggable,this.el,!1)},option:function(e,o){var n=this.options;if(o===void 0)return n[e];var s=mn.modifyOption(this,e,o);typeof s<"u"?n[e]=s:n[e]=o,e==="group"&&Yi(n)},destroy:function(){Me("destroy",this);var e=this.el;e[ze]=null,oe(e,"mousedown",this._onTapStart),oe(e,"touchstart",this._onTapStart),oe(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(oe(e,"dragover",this),oe(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(o){o.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),zn.splice(zn.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!mt){if(Me("hideClone",this),$.eventCanceled)return;j(ge,"display","none"),this.options.removeCloneOnHide&&ge.parentNode&&ge.parentNode.removeChild(ge),mt=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(mt){if(Me("showClone",this),$.eventCanceled)return;I.parentNode==ce&&!this.options.group.revertClone?ce.insertBefore(ge,I):Ct?ce.insertBefore(ge,Ct):ce.appendChild(ge),this.options.group.revertClone&&this.animate(I,ge),j(ge,"display",""),mt=!1}}};function oy(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Cn(t,e,o,n,s,i,a,r){var f,d=t[ze],u=d.options.onMove,g;return window.CustomEvent&&!ct&&!fn?f=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(f=document.createEvent("Event"),f.initEvent("move",!0,!0)),f.to=e,f.from=t,f.dragged=o,f.draggedRect=n,f.related=s||e,f.relatedRect=i||Te(e),f.willInsertAfter=r,f.originalEvent=a,t.dispatchEvent(f),u&&(g=u.call(d,f,a)),g}function yo(t){t.draggable=!1}function sy(){Oo=!1}function iy(t,e,o){var n=Te(Bt(o.el,0,o.options,!0)),s=10;return e?t.clientX<n.left-s||t.clientY<n.top&&t.clientX<n.right:t.clientY<n.top-s||t.clientY<n.bottom&&t.clientX<n.left}function ay(t,e,o){var n=Te(Zo(o.el,o.options.draggable)),s=10;return e?t.clientX>n.right+s||t.clientX<=n.right&&t.clientY>n.bottom&&t.clientX>=n.left:t.clientX>n.right&&t.clientY>n.top||t.clientX<=n.right&&t.clientY>n.bottom+s}function ly(t,e,o,n,s,i,a,r){var f=n?t.clientY:t.clientX,d=n?o.height:o.width,u=n?o.top:o.left,g=n?o.bottom:o.right,_=!1;if(!a){if(r&&Nn<d*s){if(!tn&&(en===1?f>u+d*i/2:f<g-d*i/2)&&(tn=!0),tn)_=!0;else if(en===1?f<u+Nn:f>g-Nn)return-en}else if(f>u+d*(1-s)/2&&f<g-d*(1-s)/2)return ry(e)}return _=_||a,_&&(f<u+d*i/2||f>g-d*i/2)?f>u+d/2?1:-1:0}function ry(t){return qe(I)<qe(t)?1:-1}function cy(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,o=e.length,n=0;o--;)n+=e.charCodeAt(o);return n.toString(36)}function dy(t){Hn.length=0;for(var e=t.getElementsByTagName("input"),o=e.length;o--;){var n=e[o];n.checked&&Hn.push(n)}}function xn(t){return setTimeout(t,0)}function No(t){return clearTimeout(t)}no&&ie(document,"touchmove",function(t){($.active||Gt)&&t.cancelable&&t.preventDefault()});$.utils={on:ie,off:oe,css:j,find:Hi,is:function(e,o){return!!et(e,o,e,!1)},extend:W_,throttle:ji,closest:et,toggleClass:Ue,clone:Wi,index:qe,nextTick:xn,cancelNextTick:No,detectDirection:Ki,getChild:Bt};$.get=function(t){return t[ze]};$.mount=function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];e[0].constructor===Array&&(e=e[0]),e.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&($.utils=nt(nt({},$.utils),n.utils)),mn.mount(n)})};$.create=function(t,e){return new $(t,e)};$.version=z_;var ye=[],Yt,xo,ko=!1,vo,bo,jn,Jt;function uy(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(o){var n=o.originalEvent;this.sortable.nativeDraggable?ie(document,"dragover",this._handleAutoScroll):this.options.supportPointer?ie(document,"pointermove",this._handleFallbackAutoScroll):n.touches?ie(document,"touchmove",this._handleFallbackAutoScroll):ie(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(o){var n=o.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?oe(document,"dragover",this._handleAutoScroll):(oe(document,"pointermove",this._handleFallbackAutoScroll),oe(document,"touchmove",this._handleFallbackAutoScroll),oe(document,"mousemove",this._handleFallbackAutoScroll)),Is(),kn(),q_()},nulling:function(){jn=xo=Yt=ko=Jt=vo=bo=null,ye.length=0},_handleFallbackAutoScroll:function(o){this._handleAutoScroll(o,!0)},_handleAutoScroll:function(o,n){var s=this,i=(o.touches?o.touches[0]:o).clientX,a=(o.touches?o.touches[0]:o).clientY,r=document.elementFromPoint(i,a);if(jn=o,n||this.options.forceAutoScrollFallback||fn||ct||Xt){To(o,this.options,r,n);var f=gt(r,!0);ko&&(!Jt||i!==vo||a!==bo)&&(Jt&&Is(),Jt=setInterval(function(){var d=gt(document.elementFromPoint(i,a),!0);d!==f&&(f=d,kn()),To(o,s.options,d,n)},10),vo=i,bo=a)}else{if(!this.options.bubbleScroll||gt(r,!0)===tt()){kn();return}To(o,this.options,gt(r,!1),!1)}}},st(t,{pluginName:"scroll",initializeByDefault:!0})}function kn(){ye.forEach(function(t){clearInterval(t.pid)}),ye=[]}function Is(){clearInterval(Jt)}var To=ji(function(t,e,o,n){if(e.scroll){var s=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,r=e.scrollSpeed,f=tt(),d=!1,u;xo!==o&&(xo=o,kn(),Yt=e.scroll,u=e.scrollFn,Yt===!0&&(Yt=gt(o,!0)));var g=0,_=Yt;do{var v=_,h=Te(v),b=h.top,T=h.bottom,D=h.left,S=h.right,P=h.width,O=h.height,L=void 0,R=void 0,z=v.scrollWidth,W=v.scrollHeight,se=j(v),je=v.scrollLeft,De=v.scrollTop;v===f?(L=P<z&&(se.overflowX==="auto"||se.overflowX==="scroll"||se.overflowX==="visible"),R=O<W&&(se.overflowY==="auto"||se.overflowY==="scroll"||se.overflowY==="visible")):(L=P<z&&(se.overflowX==="auto"||se.overflowX==="scroll"),R=O<W&&(se.overflowY==="auto"||se.overflowY==="scroll"));var ue=L&&(Math.abs(S-s)<=a&&je+P<z)-(Math.abs(D-s)<=a&&!!je),Le=R&&(Math.abs(T-i)<=a&&De+O<W)-(Math.abs(b-i)<=a&&!!De);if(!ye[g])for(var G=0;G<=g;G++)ye[G]||(ye[G]={});(ye[g].vx!=ue||ye[g].vy!=Le||ye[g].el!==v)&&(ye[g].el=v,ye[g].vx=ue,ye[g].vy=Le,clearInterval(ye[g].pid),(ue!=0||Le!=0)&&(d=!0,ye[g].pid=setInterval(function(){n&&this.layer===0&&$.active._onTouchMove(jn);var ne=ye[this.layer].vy?ye[this.layer].vy*r:0,le=ye[this.layer].vx?ye[this.layer].vx*r:0;typeof u=="function"&&u.call($.dragged.parentNode[ze],le,ne,t,jn,ye[this.layer].el)!=="continue"||$i(ye[this.layer].el,le,ne)}.bind({layer:g}),24))),g++}while(e.bubbleScroll&&_!==f&&(_=gt(_,!1)));ko=d}},30),Qi=function(e){var o=e.originalEvent,n=e.putSortable,s=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,r=e.hideGhostForTarget,f=e.unhideGhostForTarget;if(o){var d=n||i;r();var u=o.changedTouches&&o.changedTouches.length?o.changedTouches[0]:o,g=document.elementFromPoint(u.clientX,u.clientY);f(),d&&!d.el.contains(g)&&(a("spill"),this.onSpill({dragEl:s,putSortable:n}))}};function es(){}es.prototype={startIndex:null,dragStart:function(e){var o=e.oldDraggableIndex;this.startIndex=o},onSpill:function(e){var o=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var s=Bt(this.sortable.el,this.startIndex,this.options);s?this.sortable.el.insertBefore(o,s):this.sortable.el.appendChild(o),this.sortable.animateAll(),n&&n.animateAll()},drop:Qi};st(es,{pluginName:"revertOnSpill"});function ts(){}ts.prototype={onSpill:function(e){var o=e.dragEl,n=e.putSortable,s=n||this.sortable;s.captureAnimationState(),o.parentNode&&o.parentNode.removeChild(o),s.animateAll()},drop:Qi};st(ts,{pluginName:"removeOnSpill"});$.mount(new uy);$.mount(ts,es);function py(){return typeof window<"u"?window.console:global.console}const fy=py();function my(t){const e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}const gy=/-(\w)/g,Os=my(t=>t.replace(gy,(e,o)=>o?o.toUpperCase():""));function wo(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function Ns(t,e,o){const n=o===0?t.children[0]:t.children[o-1].nextSibling;t.insertBefore(e,n)}function hy(t,e){return Object.values(t).indexOf(e)}function _y(t,e,o,n){if(!t)return[];const s=Object.values(t),i=e.length-n;return[...e].map((r,f)=>f>=i?s.length:s.indexOf(r))}function Zi(t,e){this.$nextTick(()=>this.$emit(t.toLowerCase(),e))}function yy(t){return e=>{this.realList!==null&&this["onDrag"+t](e),Zi.call(this,t,e)}}function vy(t){return["transition-group","TransitionGroup"].includes(t)}function by(t){if(!t||t.length!==1)return!1;const[{type:e}]=t;return e?vy(e.name):!1}function Ty(t,e){return e?{...e.props,...e.attrs}:t}const Ro=["Start","Add","Remove","Update","End"],Po=["Choose","Unchoose","Sort","Filter","Clone"],wy=["Move",...Ro,...Po].map(t=>"on"+t);let Eo=null;const Ey={options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:t=>t},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},ea=va({name:"VueDraggableNext",inheritAttrs:!1,emits:["update:modelValue","move","change",...Ro.map(t=>t.toLowerCase()),...Po.map(t=>t.toLowerCase())],props:Ey,data(){return{transitionMode:!1,noneFunctionalComponentMode:!1,headerOffset:0,footerOffset:0,_sortable:{},visibleIndexes:[],context:{}}},render(){const t=this.$slots.default?this.$slots.default():null,e=Ty(this.$attrs,this.componentData);return t?(this.transitionMode=by(t),Pn(this.getTag(),e,t)):Pn(this.getTag(),e,[])},created(){this.list!==null&&this.modelValue!==null&&fy.error("list props are mutually exclusive! Please set one.")},mounted(){const t={};Ro.forEach(s=>{t["on"+s]=yy.call(this,s)}),Po.forEach(s=>{t["on"+s]=Zi.bind(this,s)});const e=Object.keys(this.$attrs).reduce((s,i)=>(s[Os(i)]=this.$attrs[i],s),{}),o=Object.assign({},e,t,{onMove:(s,i)=>this.onDragMove(s,i)});!("draggable"in o)&&(o.draggable=">*");const n=this.$el.nodeType===1?this.$el:this.$el.parentElement;this._sortable=new $(n,o),n.__draggable_component__=this,this.computeIndexes()},beforeUnmount(){try{this._sortable!==void 0&&this._sortable.destroy()}catch{}},computed:{realList(){return this.list?this.list:this.modelValue}},watch:{$attrs:{handler(t){this.updateOptions(t)},deep:!0},realList(){this.computeIndexes()}},methods:{getTag(){return this.component?V(this.component):this.tag},updateOptions(t){for(var e in t){const o=Os(e);wy.indexOf(o)===-1&&this._sortable.option(o,t[e])}},getChildrenNodes(){return this.$el.children},computeIndexes(){this.$nextTick(()=>{this.visibleIndexes=_y(this.getChildrenNodes(),this.$el.children,this.transitionMode,this.footerOffset)})},getUnderlyingVm(t){const e=hy(this.getChildrenNodes()||[],t);if(e===-1)return null;const o=this.realList[e];return{index:e,element:o}},emitChanges(t){this.$nextTick(()=>{this.$emit("change",t)})},alterList(t){if(this.list){t(this.list);return}const e=[...this.modelValue];t(e),this.$emit("update:modelValue",e)},spliceList(){const t=e=>e.splice(...arguments);this.alterList(t)},updatePosition(t,e){const o=n=>n.splice(e,0,n.splice(t,1)[0]);this.alterList(o)},getVmIndex(t){const e=this.visibleIndexes,o=e.length;return t>o-1?o:e[t]},getComponent(){return this.$slots.default?this.$slots.default()[0].componentInstance:null},resetTransitionData(t){if(!this.noTransitionOnDrag||!this.transitionMode)return;var e=this.getChildrenNodes();e[t].data=null;const o=this.getComponent();o.children=[],o.kept=void 0},onDragStart(t){this.computeIndexes(),this.context=this.getUnderlyingVm(t.item),this.context&&(t.item._underlying_vm_=this.clone(this.context.element),Eo=t.item)},onDragAdd(t){const e=t.item._underlying_vm_;if(e===void 0)return;wo(t.item);const o=this.getVmIndex(t.newIndex);this.spliceList(o,0,e),this.computeIndexes();const n={element:e,newIndex:o};this.emitChanges({added:n})},onDragRemove(t){if(Ns(this.$el,t.item,t.oldIndex),t.pullMode==="clone"){wo(t.clone);return}if(!this.context)return;const e=this.context.index;this.spliceList(e,1);const o={element:this.context.element,oldIndex:e};this.resetTransitionData(e),this.emitChanges({removed:o})},onDragUpdate(t){wo(t.item),Ns(t.from,t.item,t.oldIndex);const e=this.context.index,o=this.getVmIndex(t.newIndex);this.updatePosition(e,o);const n={element:this.context.element,oldIndex:e,newIndex:o};this.emitChanges({moved:n})},updateProperty(t,e){t.hasOwnProperty(e)&&(t[e]+=this.headerOffset)},onDragMove(t,e){const o=this.move;if(!o||!this.realList)return!0;const n=this.getRelatedContextFromMoveEvent(t),s=this.context,i=this.computeFutureIndex(n,t);Object.assign(s,{futureIndex:i});const a=Object.assign({},t,{relatedContext:n,draggedContext:s});return o(a,e)},onDragEnd(){this.computeIndexes(),Eo=null},getTrargetedComponent(t){return t.__draggable_component__},getRelatedContextFromMoveEvent({to:t,related:e}){const o=this.getTrargetedComponent(t);if(!o)return{component:o};const n=o.realList,s={list:n,component:o};if(t!==e&&n&&o.getUnderlyingVm){const i=o.getUnderlyingVm(e);if(i)return Object.assign(i,s)}return s},computeFutureIndex(t,e){const o=[...e.to.children].filter(a=>a.style.display!=="none");if(o.length===0)return 0;const n=o.indexOf(e.related),s=t.component.getVmIndex(n);return o.indexOf(Eo)!==-1||!e.willInsertAfter?s:s+1}}}),Cy={name:"field-repeater",props:["field","model","class"],emits:["onChange","openProModal"],components:{ProBadge:q,Delete:$o,ArrowDown:qo,ArrowUp:Xs,Plus:Wo,draggable:ea},setup(t){const{maybeShowField:e}=$t();return{shouldShowField:(n,s)=>e(n,s)}},data(){return{fieldData:this.field,repeaterItems:[],activeIndex:-1,isCustomActionLoading:!1,upgradeDialogVisible:!1}},created(){if(this.model[this.fieldData.id]){let t=[...this.model[this.fieldData.id]];this.fieldData.max_items&&(t=t.slice(0,this.fieldData.max_items)),t=t.map(e=>(this.updateDynamicFields(e),e)),this.repeaterItems=t}},computed:{dragOptions(){return{animation:200,disabled:this.fieldData.is_pro,ghostClass:"ghost",group:`repeater-${this.fieldData.id}`,handle:".woolentor-repeater-header"}},isMaxLimitReached(){return this.fieldData.max_items?this.repeaterItems.length>=this.fieldData.max_items:!1}},methods:{itemMoved(t){this.updateModel()},generateUniqueId(){return rp(0)},goToPro(){window.open(this.fieldData?.message?.pro_link,"_blank")},addItem(){if(this.isMaxLimitReached){this.fieldData?.message?.pro_link?this.upgradeDialogVisible=!0:de({title:this.fieldData?.message?.title||"Warning",message:this.fieldData?.message?.desc||`Maximum ${this.fieldData.max_items} items allowed.`,type:"warning",position:"top-right",duration:3e3,customClass:"woolentor-notification",offset:20});return}const t={};this.fieldData.fields.forEach(e=>{this.fieldData?.unique_id==e.id?t[e.id]=this.generateUniqueId():t[e.id]=e.default||""}),this.repeaterItems.push(t),this.activeIndex=this.repeaterItems.length-1,this.updateModel()},removeItem(t){ft.confirm("Are you sure you want to remove this item?","Warning",{confirmButtonText:"Yes",cancelButtonText:"No",type:"warning",center:!1}).then(()=>{this.repeaterItems.splice(t,1),this.activeIndex>=this.repeaterItems.length?this.activeIndex=this.repeaterItems.length-1:this.activeIndex===t?this.activeIndex=-1:this.activeIndex>t&&this.activeIndex--,this.updateModel(),de({title:"Success",message:"Item removed successfully",type:"success",position:"top-right",duration:3e3,customClass:"woolentor-notification",offset:20})}).catch(e=>{})},updateModel(){this.model[this.fieldData.id]=[...this.repeaterItems];let t={};this.fieldData.update_fields&&this.fieldData.update_fields.forEach(e=>{switch(e.type){case"select":let o={};this.repeaterItems.forEach((s,i)=>{s[e.value_key]&&s[e.label_key]&&(o[s[e.value_key]]=this.getItemTitle(s,i))}),t[e.field_id]={type:"select",options:o};break;case"repeater":let n=this.repeaterItems.map((s,i)=>({value:s[e.value_key],label:this.fieldData?.title_pattern?this.getItemTitle(s,i):s[e.label_key]||this.getItemTitle(s,i)}));t[e.repeater_id]={type:"repeater",field_id:e.field_id,items:n};break}}),this.$emit("onChange",{modelUpdate:!0,fieldUpdates:t})},toggleCollapse(t){this.activeIndex=this.activeIndex===t?-1:t},isCollapsed(t){return this.activeIndex!==t},generateDynamicValue(t,e){if(!e.generate_value)return"";const{show_key:o,pattern:n}=e.generate_value;try{let s=n;return(n.match(/\{\{([^}]+)\}\}/g)||[]).forEach(a=>{const r=a.replace(/\{\{|\}\}/g,"").trim(),f=t[r];f!==void 0&&(s=s.replace(a,f))}),s}catch(s){return console.warn("Error generating dynamic value:",s),""}},updateDynamicFields(t){Array.isArray(this.fieldData.fields)&&this.fieldData.fields.forEach(e=>{if(e.generate_value?.show_key){const o=this.generateDynamicValue(t,e);o&&(t[e.generate_value.show_key]=o)}})},getItemTitle(t,e){if(this.fieldData.title_pattern)try{let i=this.fieldData.title_pattern;return(i.match(/\{\{([^}]+)\}\}/g)||[]).forEach(r=>{const f=r.replace(/\{\{|\}\}/g,"").trim(),d=this.fieldData.fields.find(u=>u.id===f);if(d&&t[f]!==void 0){let u=t[f];if(d.type==="select")if(d.options?.group){for(const g of Object.values(d.options.group))if(g.options[u]){u=g.options[u];break}}else d.options&&(u=d.options[u]||u);i=i.replace(r,u)}else i=i.replace(r,"")}),i=i.replace(/\s*-\s*-\s*/g," - ").replace(/^\s*-\s*|\s*-\s*$/g,"").trim(),i||`Item ${e+1}`}catch(i){return console.warn("Error generating title from pattern:",i),`Item ${e+1}`}if(!this.fieldData.title_field)return`Item ${e+1}`;const o=this.fieldData.title_field.split(",").map(i=>i.trim());return o.length?o.map(i=>{const a=this.fieldData.fields.find(r=>r.id===i);if(!a||!t[i])return"";if(a.type==="select"){if(a.options?.group){for(const r of Object.values(a.options.group))if(r.options[t[i]])return r.options[t[i]]}else if(a.options)return a.options[t[i]]||""}return t[i]}).filter(i=>i).join(" - ")||`Item ${e+1}`:`Item ${e+1}`},getFieldComponentName(t){return"field-"+t},hasComponent(t){const e=this.getFieldComponentName(t);return!!this.woolentorCustomComponents.find(n=>n.name===e)},classes(t,e=""){return e!==""?e.hasOwnProperty("class")?e.class:"":["woolentor-opt-field",t=="text"?"woolentor-regular-text":`woolentor-opt-field-${t}`]},async handleCustomAction(){try{this.isCustomActionLoading=!0;const t=this.model[this.fieldData?.action_button?.option_id],e=await X.post("/woolentoropt/v1/custom-action",{callback:this.fieldData.action_button.callback,field_id:this.fieldData.id,data:{nonce:woolentorOptions.verifynonce,depend_value:t,...this.fieldData.action_button.data}});e.data?.success&&(this.updateRepeaterFields(e.data.data),this.fieldData.action_button?.auto_save&&this.$emit("triggerSave"),de({title:"Success",message:this.fieldData.action_button.message||e.data.message||"Update successfully",type:"success",position:"top-right",duration:3e3,offset:30})),this.isCustomActionLoading=!1}catch(t){de({title:"Error",message:t.response?.data?.message||"Update failed!",type:"error",position:"top-right",duration:3e3,offset:30})}},updateRepeaterFields(t){!t||typeof t!="object"||(this.repeaterItems=this.repeaterItems.map((e,o)=>{const n=t[e[this.fieldData?.action_button?.update_key]]||t[o];if(!n)return e;const s=typeof n=="number"?parseFloat(n).toFixed(2):n;return this.fieldData.action_button.update_fields&&this.fieldData.action_button.update_fields.forEach(i=>{e.hasOwnProperty(i)&&(e[i]=s)}),e}),this.updateModel())}},watch:{model:{handler(t){if(t[this.fieldData.id]){let e=[...t[this.fieldData.id]];this.fieldData.max_items&&(e=e.slice(0,this.fieldData.max_items)),e=e.map(o=>(this.updateDynamicFields(o),o)),this.repeaterItems=e}},deep:!0,immediate:!0}}},Sy={class:"woolentor-card-field-label"},Ay={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},Dy=["innerHTML"],Ly=["innerHTML"],Iy={class:"woolentor-repeater-items"},Oy=["onClick"],Ny=["innerHTML"],xy={class:"woolentor-repeater-actions"},ky={class:"woolentor-repeater-content"},Ry={key:0},Py={class:"woolentor-repeater-footer"},My={class:"modal-upgrade-dialog-header"},Gy=["innerHTML"],Fy={class:"upgrade-dialog-content",style:{"text-align":"center"}},Vy=["innerHTML"],Uy={class:"dialog-footer"};function By(t,e,o,n,s,i){const a=q,r=V("Delete"),f=Ae,d=pe,u=V("ArrowDown"),g=V("ArrowUp"),_=Nt,v=yt,h=Wa,b=V("draggable"),T=V("Plus"),D=ae,S=_t;return p(),y(B,null,[c(D,{style:{width:"auto",border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{onClick:e[0]||(e[0]=P=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},[l("div",Sy,[l("span",Ay,[l("span",{innerHTML:s.fieldData.name},null,8,Dy),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)]),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,Ly)):C("",!0)]),l("div",Iy,[c(b,Go({class:"dragArea list-group w-full",list:s.repeaterItems},i.dragOptions,{onChange:i.itemMoved}),{default:m(()=>[(p(!0),y(B,null,ee(s.repeaterItems,(P,O)=>(p(),y("div",{key:O,class:"woolentor-repeater-item"},[l("div",{class:"woolentor-repeater-header",onClick:L=>i.toggleCollapse(O)},[l("span",{class:"woolentor-repeater-title",innerHTML:i.getItemTitle(P,O)},null,8,Ny),l("div",xy,[c(d,{type:"danger",circle:"",size:"small",onClick:he(L=>i.removeItem(O),["stop"]),disabled:s.fieldData.is_pro},{default:m(()=>[c(f,null,{default:m(()=>[c(r)]),_:1})]),_:2},1032,["onClick","disabled"]),c(d,{circle:"",size:"small",onClick:he(L=>i.toggleCollapse(O),["stop"]),disabled:s.fieldData.is_pro},{default:m(()=>[c(f,null,{default:m(()=>[i.isCollapsed(O)?(p(),w(g,{key:1})):(p(),w(u,{key:0}))]),_:2},1024)]),_:2},1032,["onClick","disabled"])])],8,Oy),c(h,null,{default:m(()=>[be(l("div",ky,[(p(!0),y(B,null,ee(s.fieldData.fields,L=>(p(),y("div",{key:L.id,class:"woolentor-repeater-field"},[n.shouldShowField(L,P)?(p(),y("div",Ry,[i.hasComponent(L.type)?(p(),w(at(i.getFieldComponentName(L.type)),{key:L.id,field:L,model:P,class:x(i.classes(L.type)),onOnChange:i.updateModel,onOpenProModal:t.openProModal},null,40,["field","model","class","onOnChange","onOpenProModal"])):(p(),w(_,{key:L.id+"unique",field:L,model:P,class:x(i.classes(L.type)),onOnChange:i.updateModel,onOpenProModal:t.openProModal},null,8,["field","model","class","onOnChange","onOpenProModal"])),L.id!==s.fieldData.fields[s.fieldData.fields.length-1].id?(p(),w(v,{key:2})):C("",!0)])):C("",!0)]))),128))],512),[[zt,!i.isCollapsed(O)]])]),_:2},1024)]))),128))]),_:1},16,["list","onChange"])]),l("div",Py,[c(d,{type:"primary",onClick:i.addItem,disabled:s.fieldData.is_pro,class:"woolentor-add-repeater-item"},{default:m(()=>[c(f,null,{default:m(()=>[c(T)]),_:1}),k(" "+A(s.fieldData.options?.button_label||"Add New Item"),1)]),_:1},8,["onClick","disabled"]),s.fieldData.action_button?(p(),w(d,{key:0,type:"primary",onClick:i.handleCustomAction,disabled:s.fieldData.is_pro,loading:s.isCustomActionLoading,class:"woolentor-custom-action-btn"},{default:m(()=>[k(A(s.fieldData.action_button.label||"Custom Action"),1)]),_:1},8,["onClick","disabled","loading"])):C("",!0)])])]),_:1}),c(S,{modelValue:s.upgradeDialogVisible,"onUpdate:modelValue":e[2]||(e[2]=P=>s.upgradeDialogVisible=P),width:"420px","close-on-click-modal":!1,"show-close":!1,class:"modal-upgrade-dialog","append-to-body":"",center:""},{header:m(()=>[l("div",My,[e[3]||(e[3]=l("div",{class:"upgrade-icon"},[l("div",{class:"icon-circle"},[l("svg",{viewBox:"0 0 24 24",width:"32",height:"32"},[l("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z",fill:"#f5a623"})])])],-1)),l("h2",{class:"upgrade-title",innerHTML:s.fieldData?.message?.title||"Warning"},null,8,Gy)])]),footer:m(()=>[l("div",Uy,[c(d,{class:"action-button yes-button",onClick:i.goToPro,type:"primary"},{default:m(()=>e[4]||(e[4]=[k(" Upgrade Now ")])),_:1},8,["onClick"]),c(d,{class:"action-button no-button",onClick:e[1]||(e[1]=P=>s.upgradeDialogVisible=!1)},{default:m(()=>e[5]||(e[5]=[k(" Not Now ")])),_:1})])]),default:m(()=>[l("div",Fy,[l("p",{class:"upgrade-message",innerHTML:s.fieldData?.message?.desc||`Maximum ${this.fieldData.max_items} items allowed.`},null,8,Vy)])]),_:1},8,["modelValue"])],64)}const zy=M(Cy,[["render",By],["__scopeId","data-v-9e7759ba"]]),Hy={name:"field-repeater",template:zy},jy={name:"field-select",props:["field","model","class"],emits:["onChange","openProModal"],components:{ProBadge:q},setup(t){return{getTextFromHtml:xt,absoluteNumberToString:Vn,stringToAbsoluteNumber:Qo}},data(){return{fieldData:this.field,currentRoute:this.$route,hasGroup:!!this.field?.options?.group,selectedValue:this.getInitialValue()}},methods:{getInitialValue(){let t=this.model[this.field.id];return t==="0"||t===0||t===""||t===null||t===void 0?"":this.field?.convertnumber===!0?Vn(t):t},handleChange(t){this.model[this.field.id]=this.field?.convertnumber===!0?this.stringToAbsoluteNumber(t):t,this.$emit("onChange")}}},$y={class:"woolentor-card-field-label"},Wy={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},qy=["innerHTML"],Ky=["innerHTML"],Yy={class:"woolentor-card-field-element"},Jy=["innerHTML"],Xy=["innerHTML"];function Qy(t,e,o,n,s,i){const a=q,r=It,f=qa,d=Ot,u=ae;return p(),w(u,{style:{width:"auto",border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{class:x(`woolentor-element-card ${s.fieldData?.class||""} ${this.class}`),style:{display:"flex","align-items":"center","flex-wrap":"wrap"},onClick:e[1]||(e[1]=g=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},[l("div",$y,[l("span",Wy,[l("span",{innerHTML:s.fieldData.name},null,8,qy),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)]),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,Ky)):C("",!0)]),l("div",Yy,[c(d,{modelValue:s.selectedValue,"onUpdate:modelValue":e[0]||(e[0]=g=>s.selectedValue=g),placeholder:s.fieldData?.placeholder||"Select",size:"large",onChange:i.handleChange,disabled:s.fieldData.is_pro,"value-key":s.fieldData.id,filterable:s.fieldData?.searchable||!1},{default:m(()=>[s.hasGroup?(p(!0),y(B,{key:0},ee(s.fieldData?.options?.group,(g,_)=>(p(),w(f,{key:_,label:g.label},{default:m(()=>[(p(!0),y(B,null,ee(g.options,(v,h)=>(p(),w(r,{key:h,label:n.getTextFromHtml(v),value:s.fieldData?.convertnumber===!0?n.absoluteNumberToString(h):h,disabled:s.fieldData.is_pro},{default:m(()=>[l("span",{innerHTML:v},null,8,Jy)]),_:2},1032,["label","value","disabled"]))),128))]),_:2},1032,["label"]))),128)):(p(!0),y(B,{key:1},ee(s.fieldData.options,(g,_)=>(p(),w(r,{key:_,label:n.getTextFromHtml(g),value:s.fieldData?.convertnumber===!0?n.absoluteNumberToString(_):_,disabled:s.fieldData.is_pro},{default:m(()=>[l("span",{innerHTML:g},null,8,Xy)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["modelValue","placeholder","onChange","disabled","value-key","filterable"])])],2)]),_:1})}const Zy=M(jy,[["render",Qy]]),ev={name:"field-select",template:Zy},tv={name:"field-shortable",components:{draggable:ea,ProBadge:q},props:["field","model"],emits:["onChange","openProModal"],data(){return{fieldData:this.field,sortableItems:[]}},created(){this.initializeSortableItems()},computed:{dragOptions(){return{animation:200,disabled:this.fieldData.is_pro,ghostClass:"ghost",group:`woolentor-sortable-${this.fieldData.id}`}}},methods:{initializeSortableItems(){const t=[],e=this.model[this.fieldData.id]||{};Object.entries(this.fieldData.options).forEach(([s,i])=>{t.push({id:s,label:i,checked:Object.prototype.hasOwnProperty.call(e,s)})});const o=t.filter(s=>s.checked),n=t.filter(s=>!s.checked);if(Object.keys(e).length>0){const s=Object.keys(e);o.sort((i,a)=>s.indexOf(i.id)-s.indexOf(a.id))}this.sortableItems=[...o,...n],this.updateModel()},handleChange(){this.updateModel(),this.$emit("onChange")},handleCheckboxChange(){this.updateModel(),this.$emit("onChange")},updateModel(){const t={};this.sortableItems.forEach(e=>{e.checked&&(t[e.id]=e.label)}),this.model[this.fieldData.id]=t}}},nv={class:"woolentor-card-field-label"},ov={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},sv=["innerHTML"],iv=["innerHTML"],av={class:"woolentor-card-field-sortable"};function lv(t,e,o,n,s,i){const a=q,r=Ka,f=V("draggable"),d=ae;return p(),w(d,{style:{width:"auto",border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{style:{display:"flex","flex-direction":"column"},onClick:e[0]||(e[0]=u=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},[l("div",nv,[l("span",ov,[l("span",{innerHTML:s.fieldData.name},null,8,sv),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)]),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,iv)):C("",!0)]),l("div",av,[c(f,Go({class:"dragArea list-group w-full",list:s.sortableItems},i.dragOptions,{onChange:i.handleChange}),{default:m(()=>[(p(!0),y(B,null,ee(s.sortableItems,u=>(p(),y("div",{class:"woolentor-sortable-item",key:u.id},[c(r,{modelValue:u.checked,"onUpdate:modelValue":g=>u.checked=g,disabled:s.fieldData.is_pro,onChange:i.handleCheckboxChange},{default:m(()=>[k(A(u.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onChange"]),e[1]||(e[1]=l("span",{class:"woolentor-drag-handle"},[l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[l("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),l("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),l("line",{x1:"3",y1:"18",x2:"21",y2:"18"})])],-1))]))),128))]),_:1},16,["list","onChange"])])])]),_:1})}const rv=M(tv,[["render",lv],["__scopeId","data-v-d35fea14"]]),cv={name:"field-shortable",template:rv},dv={name:"field-switcher",props:["field","model","class"],emits:["onChange","openProModal"],components:{ProBadge:q},data(){return{fieldData:this.field,currentRoute:this.$route}}},uv={class:"woolentor-card-field-label-switcher",style:{display:"flex","align-items":"center",gap:"8px"}},pv=["innerHTML"],fv=["innerHTML"],mv={class:"woolentor-card-field-element-switcher"};function gv(t,e,o,n,s,i){const a=q,r=an,f=ae;return p(),w(f,{style:{width:"auto","border-color":"#7D8087","border-radius":"0px"},shadow:"never","border-card":"false","body-style":"padding: 15px;display: flex; align-items: center; justify-content: space-between;gap:10px;",onClick:e[2]||(e[2]=d=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},{default:m(()=>[l("div",uv,[l("span",{style:Ce([{display:"flex","align-items":"center",color:"#000","font-size":"16px"},{color:o.model[s.fieldData.id]=="on"?"#000000":"#7D8087"}])},[l("span",{innerHTML:s.fieldData.name},null,8,pv),s.fieldData.is_pro?(p(),w(a,{key:0})):C("",!0)],4),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,fv)):C("",!0)]),l("div",mv,[c(r,{modelValue:o.model[s.fieldData.id],"onUpdate:modelValue":e[0]||(e[0]=d=>o.model[s.fieldData.id]=d),class:"ml-2","inline-prompt":"",style:{"--el-switch-on-color":"#3489FE","--el-switch-off-color":"#7D8087"},"active-text":"ON","inactive-text":"OFF","active-value":"on","inactive-value":"off",onChange:e[1]||(e[1]=d=>t.$emit("onChange")),disabled:s.fieldData.is_pro},null,8,["modelValue","disabled"])])]),_:1})}const hv=M(dv,[["render",gv]]),_v={name:"field-switcher",template:hv},yv={name:"field-title",props:["field","model","class"],emits:["onChange","openProModal"],components:{ProBadge:q},data(){return{fieldData:this.field,title:this.field.heading}}},vv={key:0,class:"woolentor-card-field-label"},bv={style:{display:"flex","align-items":"center",color:"#000","font-size":"20px"}},Tv=["innerHTML"],wv={class:"woolentor-card-field-element-heading",style:{width:"100%"}},Ev=["innerHTML"],Cv=["innerHTML"];function Sv(t,e,o,n,s,i){const a=q,r=ae;return p(),w(r,{style:{border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{style:{width:"100%",display:"flex","align-items":"center","justify-content":"space-between",gap:"15px"},onClick:e[1]||(e[1]=f=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},[s.fieldData.name?(p(),y("div",vv,[l("span",bv,[l("span",{innerHTML:s.fieldData.name},null,8,Tv),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)])])):C("",!0),l("div",wv,[l("div",{class:x(`woolentor-option-heading ${s.fieldData?.class} ${this.class}`),onClick:e[0]||(e[0]=f=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},[l("h4",{class:"woolentor-option-heading-title regular-title",innerHTML:s.title},null,8,Ev),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,Cv)):C("",!0)],2)])])]),_:1})}const Av=M(yv,[["render",Sv],["__scopeId","data-v-d780b548"]]),Dv={name:"field-title",template:Av},Lv={name:"field-ajaxselect",props:["field","model","class"],emits:["onChange","openProModal"],components:{ProBadge:q},setup(t){return{getTextFromHtml:xt,absoluteNumberToString:Vn,stringToAbsoluteNumber:Qo}},data(){return{fieldData:this.field,selectedValues:[],options:[],loading:!1,searchTimer:null}},computed:{sortedOptions(){const t=new Set(Array.isArray(this.selectedValues)?this.selectedValues:[this.selectedValues]),e=this.options.filter(n=>!t.has(n.id)),o=this.options.filter(n=>t.has(n.id));return[...e,...o]}},created(){this.initSavedValues()},methods:{initSavedValues(){let t=this.model[this.field.id];if(!t){this.selectedValues=[];return}let e=Array.isArray(t)?t:[t];if(e=e.map(String).filter(n=>n&&n!=="0"),e.length===0){this.selectedValues=[];return}this.selectedValues=e;const o=this.field.post_type||"product";X.post("/woolentoropt/v1/ajax-select/titles",{ids:e.map(Number),post_type:o}).then(n=>{n.data?.results&&(this.options=n.data.results.map(s=>({id:String(s.id),text:this.getTextFromHtml(s.text)})))}).catch(()=>{})},remoteSearch(t){if(t.length<3)return;this.loading=!0;const e=this.field.post_type||"product";X.post("/woolentoropt/v1/ajax-select/search",{s:t,post_type:e}).then(o=>{const n=new Set(Array.isArray(this.selectedValues)?this.selectedValues:[this.selectedValues]),s=this.options.filter(i=>n.has(i.id));if(o.data?.results&&o.data.results.length>0){const i=new Set(s.map(r=>r.id)),a=o.data.results.map(r=>({id:String(r.id),text:this.getTextFromHtml(r.text)})).filter(r=>!i.has(r.id));this.options=[...a,...s]}else this.options=s;this.loading=!1}).catch(()=>{this.loading=!1})},handleChange(t){this.model[this.field.id]=t,this.$emit("onChange"),this.$nextTick(()=>{const e=this.$refs.ajaxSelect;e&&(e.query="",e.previousQuery="")})}}},Iv={class:"woolentor-card-field-label"},Ov={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},Nv=["innerHTML"],xv=["innerHTML"],kv={class:"woolentor-card-field-element woolentor-field-ajaxselect"};function Rv(t,e,o,n,s,i){const a=q,r=It,f=Ot,d=ae;return p(),w(d,{style:{width:"auto",border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{class:x(`${s.fieldData?.class||""} ${this.class}`),style:{display:"flex","align-items":"center","justify-content":"space-between",gap:"15px"},onClick:e[1]||(e[1]=u=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},[l("div",Iv,[l("span",Ov,[l("span",{innerHTML:s.fieldData.name},null,8,Nv),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)]),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,xv)):C("",!0)]),l("div",kv,[c(f,{ref:"ajaxSelect",modelValue:s.selectedValues,"onUpdate:modelValue":e[0]||(e[0]=u=>s.selectedValues=u),multiple:s.fieldData.multiple!==!1,filterable:"",remote:"",placeholder:s.fieldData?.placeholder||"Search...","remote-method":i.remoteSearch,loading:s.loading,onChange:i.handleChange,size:"large",disabled:s.fieldData.is_pro,style:{"max-width":"400px"}},{default:m(()=>[(p(!0),y(B,null,ee(i.sortedOptions,u=>(p(),w(r,{key:u.id,label:u.text,value:String(u.id)},null,8,["label","value"]))),128))]),_:1},8,["modelValue","multiple","placeholder","remote-method","loading","onChange","disabled"])])],2)]),_:1})}const Pv=M(Lv,[["render",Rv]]),Mv={name:"field-ajaxselect",template:Pv},Gv={name:"field-upload",props:["field","model","class"],emits:["onChange","openProModal"],components:{ProBadge:q},data(){return{fileUrl:"",fieldData:this.field,currentRoute:this.$route}},methods:{openMediaUploader(){const t=wp.media({title:"Upload File",button:{text:"Use this file"},multiple:!1});t.on("select",()=>{const e=t.state().get("selection").first().toJSON();this.fileUrl=e.url}),t.open()}}},Fv={class:"woolentor-card-field-label"},Vv={style:{display:"flex","align-items":"center",color:"#000","font-size":"14px","font-weight":"700"}},Uv=["innerHTML"],Bv=["innerHTML"],zv={key:0};function Hv(t,e,o,n,s,i){const a=q,r=ae;return p(),w(r,{style:{width:"auto",border:"none"},shadow:"never","body-style":"padding: 0px","border-card":"false"},{default:m(()=>[l("div",{style:{display:"flex","align-items":"center","justify-content":"space-between",gap:"15px"},onClick:e[1]||(e[1]=f=>s.fieldData.is_pro?t.$emit("openProModal",!0):null)},[l("div",Fv,[l("span",Vv,[l("span",{innerHTML:s.fieldData.name},null,8,Uv),s.fieldData.is_pro?(p(),w(a,{key:0,style:{"margin-right":"10px"}})):C("",!0)]),s.fieldData.desc?(p(),y("p",{key:0,innerHTML:s.fieldData.desc},null,8,Bv)):C("",!0)]),l("div",{class:x(`woolentor-card-field-element ${s.fieldData?.class||""} ${this.class}`)},[l("div",null,[l("button",{onClick:e[0]||(e[0]=(...f)=>i.openMediaUploader&&i.openMediaUploader(...f))},"Upload File"),s.fileUrl?(p(),y("div",zv,[l("p",null,"File URL: "+A(s.fileUrl),1)])):C("",!0)])],2)])]),_:1})}const jv=M(Gv,[["render",Hv]]),$v={name:"field-upload",template:jv},Wv={name:"PluginGrid",components:{InfoFilled:Vs},props:{pluginList:{type:Array,required:!0,default:()=>[]},isLoading:{type:Boolean,default:!1},pluginStates:{type:Object,default:()=>{}},getPluginButtonText:{type:Function,default:(t,e)=>""}},methods:{toggleActivation(t){if(t.status===this.pluginStates.NOT_INSTALLED&&t?.is_pro){window.open(t.link,"_blank");return}else this.$emit("plugin-toggled",t)},trimWords(t,e){return xi(t,e)},activeInstallCount(t){let e;return t>=1e6?e=`${Math.floor(t/1e6)}+ Million`:t===0?e="Less Than 10":e=`${t.toLocaleString()}+`,e}}},qv={class:"woolentor-plugin-grid"},Kv={class:"woolentor-plugin-content"},Yv={class:"woolentor-plugin-logo"},Jv={class:"woolentor-plugin-info"},Xv={class:"woolentor-plugin-title"},Qv=["innerHTML"],Zv={class:"woolentor-plugin-footer"},eb={class:"woolentor-plugin-installation-info"},tb={key:1};function nb(t,e,o,n,s,i){const a=Lt,r=Vo,f=V("InfoFilled"),d=Ae,u=Zs,g=pe,_=ae,v=rt,h=lt;return p(),y("div",qv,[c(h,{gutter:20},{default:m(()=>[o.isLoading?(p(),w(a,{key:0,rows:6,animated:""})):(p(!0),y(B,{key:1},ee(o.pluginList,b=>(p(),w(v,{span:12,md:12,sm:12,xs:24,key:b.id},{default:m(()=>[c(_,{class:"woolentor-plugin-info-card mb-4",shadow:"hover"},{footer:m(()=>[l("div",Zv,[l("div",eb,[b.active_installs?(p(),w(d,{key:0},{default:m(()=>[c(f)]),_:1})):C("",!0),b.active_installs?(p(),y("span",tb,A(`${i.activeInstallCount(b.active_installs)} Active Installations`),1)):C("",!0),b.is_pro?(p(),w(u,{key:2,type:"primary",class:"woolentor-plugin-more-details",href:b?.link,target:"_blank"},{default:m(()=>e[0]||(e[0]=[k("More Details")])),_:2},1032,["href"])):(p(),w(u,{key:3,type:"primary",class:"thickbox open-plugin-details-modal",href:`${this.woolentorLocalizeData.adminUrl}plugin-install.php?tab=plugin-information&plugin=${b.slug}&TB_iframe=true&width=772&height=577`},{default:m(()=>e[1]||(e[1]=[k("More Details")])),_:2},1032,["href"]))]),c(g,{type:"primary",loading:b.isLoading,disabled:b.status===o.pluginStates.ACTIVE||b.status===o.pluginStates.INSTALLING||b.status===o.pluginStates.ACTIVATING,onClick:T=>i.toggleActivation(b)},{default:m(()=>[k(A(b.status===o.pluginStates.NOT_INSTALLED&&b?.is_pro?"Buy Now":o.getPluginButtonText(b.status,b.isLoading)),1)]),_:2},1032,["loading","disabled","onClick"])])]),default:m(()=>[l("div",Kv,[l("div",Yv,[c(r,{src:b.icon,alt:b.name,class:"woolentor-plugin-image"},null,8,["src","alt"])]),l("div",Jv,[l("h3",Xv,A(b.name),1),l("p",{class:"woolentor-plugin-description",innerHTML:i.trimWords(b.description,23)},null,8,Qv)])])]),_:2},1024)]),_:2},1024))),128))]),_:1})])}const Wt=M(Wv,[["render",nb],["__scopeId","data-v-cf9f229b"]]),ob={name:"FreeExtension",components:{PluginGrid:Wt},setup(){const t=F([{name:"Support Genix Lite – Support Tickets Managing System",slug:"support-genix-lite",description:"Support Genix is a support ticket system for WordPress and WooCommerce.",status:"inactive",isLoading:!1,icon:null},{name:"Pixelavo – Facebook Pixel Conversion API",slug:"pixelavo",description:"Easy connection of Facebook pixel to your online store.",status:"not_installed",isLoading:!1,icon:null},{name:"Whols – Wholesale Prices and B2B Store",slug:"whols",description:"WooCommerce Wholesale plugin for B2B store management.",status:"inactive",isLoading:!1,icon:null},{name:"JustTables – WooCommerce Product Table",slug:"just-tables",description:"JustTables is an incredible WordPress plugin that lets you showcase all your WooCommerce products in a sortable and filterable table view.",status:"inactive",isLoading:!1,icon:null}]),e=F(!0),{PLUGIN_STATES:o,getPluginButtonText:n,handlePluginAction:s,fetchPluginStatus:i,initializePluginsWithData:a}=pn(),r=async d=>{const u=t.value.findIndex(g=>g.slug===d.slug);if(u!==-1){t.value[u].isLoading=!0;try{const g=await s(d,(_,v)=>{const h=t.value.findIndex(b=>b.slug===_);h!==-1&&(t.value[h].status=v)});g&&(t.value[u].status=g)}finally{t.value[u].isLoading=!1}}},f=async()=>{e.value=!0;try{const d=t.value.map(v=>v.slug);let u=null;const g=d.join(",")+"cache",_=K.get(g);_?u=_:(u=await a(t.value),K.set(g,u,{duration:6e3})),t.value=u.map(v=>({...v,icon:v.icons?.["2x"]||v.icons?.["1x"]||v.icons?.default||null}))}catch(d){console.error("Error loading plugins:",d)}finally{e.value=!1}};return it(()=>{f()}),{pluginList:t,PLUGIN_STATES:o,isInitialLoading:e,getPluginButtonText:n,handlePluginAction:r}}};function sb(t,e,o,n,s,i){const a=Wt;return p(),w(a,{"plugin-list":n.pluginList,"is-loading":n.isInitialLoading,"plugin-states":n.PLUGIN_STATES,"get-plugin-button-text":n.getPluginButtonText,onPluginToggled:n.handlePluginAction},null,8,["plugin-list","is-loading","plugin-states","get-plugin-button-text","onPluginToggled"])}const ib=M(ob,[["render",sb]]),ab={name:"ProExtension",components:{PluginGrid:Wt},setup(){const t=F([{name:"Whols Pro – Wholesale Prices and B2B Store",slug:"whols-pro",description:"WooCommerce Wholesale plugin for B2B store management.",status:"inactive",isLoading:!1,icon:null,link:"https://hasthemes.com/plugins/whols-woocommerce-wholesale-prices/"},{name:"JustTables Pro – WooCommerce Product Table",slug:"just-tables-pro",description:"JustTables is an incredible WordPress plugin that lets you showcase all your WooCommerce products in a sortable and filterable table view.",status:"inactive",isLoading:!1,icon:null,link:"https://hasthemes.com/wp/justtables/"},{name:"Support Genix – Support Tickets Managing System",slug:"support-genix",description:"Support Genix is a support ticket system for WordPress and WooCommerce.",status:"inactive",isLoading:!1,icon:null,link:"https://supportgenix.com/"},{name:"Pixelavo Pro – Facebook Pixel Conversion API",slug:"pixelavo-pro",description:"Easy connection of Facebook pixel to your online store.",status:"not_installed",isLoading:!1,icon:null,link:"https://hasthemes.com/plugins/facebook-pixel-wordpress-plugin/"}]),e=F(!0),{PLUGIN_STATES:o,getPluginButtonText:n,handlePluginAction:s,fetchPluginStatus:i,initializePluginsWithData:a}=pn(),r=async d=>{const u=t.value.findIndex(g=>g.slug===d.slug);if(u!==-1){t.value[u].isLoading=!0;try{const g=await s(d,(_,v)=>{const h=t.value.findIndex(b=>b.slug===_);h!==-1&&(t.value[h].status=v)});g&&(t.value[u].status=g)}finally{t.value[u].isLoading=!1}}},f=async()=>{e.value=!0;try{const d=t.value.map(v=>v.slug);let u=null;const g=d.join(",")+"cache",_=K.get(g);_?u=_:(u=await a(t.value,"local"),K.set(g,u,{duration:6e3})),t.value=u.map(v=>({...v,is_pro:!0,icon:woolentorOptions?.assetsUrl+"/images/extension/"+v.slug+".png"}))}catch(d){console.error("Error loading plugins:",d)}finally{e.value=!1}};return it(()=>{f()}),{pluginList:t,PLUGIN_STATES:o,isInitialLoading:e,getPluginButtonText:n,handlePluginAction:r}}};function lb(t,e,o,n,s,i){const a=Wt;return p(),w(a,{"plugin-list":n.pluginList,"is-loading":n.isInitialLoading,"plugin-states":n.PLUGIN_STATES,"get-plugin-button-text":n.getPluginButtonText,onPluginToggled:n.handlePluginAction},null,8,["plugin-list","is-loading","plugin-states","get-plugin-button-text","onPluginToggled"])}const rb=M(ab,[["render",lb]]),cb={name:"SubscribeSection",data(){return{alreadySubscribed:this.woolentorLocalizeData?.isSubscribed||!1,email:this.woolentorLocalizeData?.userData?.email||"",submitting:!1,subscribed:!1,errorMsg:""}},methods:{async handleSubscribe(){if(this.errorMsg="",!this.email||!this.isValidEmail(this.email)){this.errorMsg="Please enter a valid email address.";return}this.submitting=!0;try{const t=new FormData;t.append("action","woolentor_newsletter_subscribe"),t.append("security",this.woolentorLocalizeData.ajaxNonce),t.append("email",this.email);const e=await Ln.post("/admin-ajax.php",t,{headers:{"Content-Type":"multipart/form-data"}});e.data?.status==="success"?this.subscribed=!0:this.errorMsg=e.data?.message||"Something went wrong. Please try again."}catch{this.errorMsg="Something went wrong. Please try again."}finally{this.submitting=!1}},isValidEmail(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}}},db={key:0,class:"subscribe-section"},ub={key:0,class:"subscribe-form"},pb={class:"subscribe-input-group"},fb={key:0,class:"subscribe-error"},mb={key:1,class:"subscribe-success"};function gb(t,e,o,n,s,i){const a=rt,r=pe,f=lt,d=ae;return s.alreadySubscribed?C("",!0):(p(),y("div",db,[c(d,{class:"subscribe-card"},{default:m(()=>[c(f,{gutter:24,class:"subscribe-content-area"},{default:m(()=>[c(a,{sm:24,md:24,lg:14,class:"subscribe-text"},{default:m(()=>e[1]||(e[1]=[l("div",{class:"subscribe-content"},[l("h3",null,"Subscribe and Get Offers"),l("p",null,"Sign up for our email list to get discounts, exclusive offers, the latest items, and news in your inbox.")],-1)])),_:1}),c(a,{sm:24,md:24,lg:10,class:"subscribe-form-wrapper"},{default:m(()=>[s.subscribed?(p(),y("div",mb,e[3]||(e[3]=[l("span",{class:"success-icon"},"✓",-1),k(" Thank you for subscribing! ")]))):(p(),y("div",ub,[l("div",pb,[be(l("input",{type:"email","onUpdate:modelValue":e[0]||(e[0]=u=>s.email=u),class:"subscribe-email-input",placeholder:"Enter your email"},null,512),[[Rn,s.email]]),c(r,{type:"primary",class:"subscribe-button",loading:s.submitting,onClick:i.handleSubscribe},{default:m(()=>e[2]||(e[2]=[k(" Subscribe ")])),_:1},8,["loading","onClick"])]),s.errorMsg?(p(),y("p",fb,A(s.errorMsg),1)):C("",!0)]))]),_:1})]),_:1})]),_:1})]))}const ta=M(cb,[["render",gb],["__scopeId","data-v-b0a64658"]]),hb={name:"ActionCards",components:{ArrowRight:Qs},data(){return{rating:5}}},_b={class:"action-cards"};function yb(t,e,o,n,s,i){const a=V("ArrowRight"),r=Ae,f=Zs,d=ae;return p(),y("div",_b,[c(d,{class:"action-card community-card",shadow:"hover"},{default:m(()=>[e[1]||(e[1]=l("h3",{class:"card-title"},"Join the Community",-1)),e[2]||(e[2]=l("p",{class:"card-description"},"Got a question about the plugin, want to share your awesome project or just say hi? Join our wonderful community!",-1)),c(f,{type:"primary",class:"action-link",href:"https://www.facebook.com/groups/shoplentor/",target:"_blank"},{default:m(()=>[e[0]||(e[0]=k(" Join Now ")),c(r,{class:"link-icon"},{default:m(()=>[c(a)]),_:1})]),_:1})]),_:1})])}const na=M(hb,[["render",yb],["__scopeId","data-v-d0e257d6"]]),vb={name:"Extension",setup(){const t=F([{name:"Support Genix – Support Tickets Managing System",slug:"support-genix-lite",description:"Support Genix is a support ticket system for WordPress and WooCommerce.",status:"inactive",isLoading:!1,icon:null,color:"#FF6B4B"},{name:"Pixelavo – Facebook Pixel Conversion API",slug:"pixelavo",description:"Easy connection of Facebook pixel to your online store.",status:"not_installed",isLoading:!1,icon:null,color:"#6B4BFF"},{name:"Whols – Wholesale Prices and B2B Store",slug:"whols",description:"WooCommerce Wholesale plugin for B2B store management.",status:"inactive",isLoading:!1,icon:null,color:"#00A0D2"},{name:"HT Slider For Elementor",slug:"ht-slider-for-elementor",description:"HT Slider For Elementor is a WordPress slider builder plugin for the popular Elementor page builder and Gutenberg block editor.",status:"inactive",isLoading:!1,icon:null,color:"#00A0D2"},{name:"WP Plugin Manager – Deactivate plugins per page",slug:"wp-plugin-manager",description:"In this modern era, there is a huge demand for faster loading websites. If a website loads fast then it is considered to be more reliable and professional. ",status:"inactive",isLoading:!1,icon:null,color:"#00A0D2"},{name:"Extensions For CF7",slug:"extensions-for-cf7",description:"The Extensions for CF7 is an excellent WordPress plugin that extends the features and functionalities of the Contact Form 7 plugin to make it more convenient and user-friendly. ",status:"inactive",isLoading:!1,icon:null,color:"#00A0D2"},{name:"HashBar – WordPress Notification Bar",slug:"hashbar-wp-notification-bar",description:"HashBar is a handy WordPress Notification Bar Plugin that will take your WordPress site to the next level. ",status:"inactive",isLoading:!1,icon:null,color:"#00A0D2"},{name:"Insert Headers and Footers Code – HT Script",slug:"insert-headers-and-footers-script",description:"Insert Headers and Footers Code allows you to insert Google Analytics, Facebook Pixel, custom CSS, custom HTML, JavaScript code to your website header and footer without modifying your theme code.",status:"inactive",isLoading:!1,icon:null,color:"#00A0D2"}]),e=F(!0),{PLUGIN_STATES:o,getPluginButtonText:n,handlePluginAction:s,initializePluginsWithData:i}=pn(),a=Q(()=>{if(t.value.every(v=>v.status===o.ACTIVE))return t.value.slice(0,3);const _=t.value.filter(v=>v.status!==o.ACTIVE).sort((v,h)=>{const b=T=>T===o.INACTIVE||T===o.ACTIVATING?0:1;return b(v.status)-b(h.status)});return _.length>=3?_.slice(0,3):t.value.slice(0,3)}),r=u=>({backgroundColor:u.color||"#FF6B4B"}),f=async u=>{const g=t.value.findIndex(_=>_.slug===u.slug);if(g!==-1){t.value[g].isLoading=!0;try{const _=await s(u,(v,h)=>{const b=t.value.findIndex(T=>T.slug===v);b!==-1&&(t.value[b].status=h)});_&&(t.value[g].status=_)}finally{t.value[g].isLoading=!1}}},d=async()=>{e.value=!0;try{const u=t.value.map(h=>h.slug);let g=null;const _=u.join(",")+"cache",v=K.get(_);v?g=v:(g=await i(t.value),K.set(_,g,{duration:6e3})),t.value=g.map(h=>({...h,icon:h.icons?.["2x"]||h.icons?.["1x"]||h.icons?.default||null}))}catch(u){console.error("Error loading plugins:",u)}finally{e.value=!1}};return it(()=>{d()}),{PLUGIN_STATES:o,visiblePlugins:a,isInitialLoading:e,getPluginButtonText:n,getIconStyle:r,handlePluginAction:f,trimWords:xi,getTextFromHtml:xt}}},bb={class:"extension-container"},Tb={class:"extension-info"},wb={class:"extension-icon"},Eb={class:"extension-details",style:{width:"100%"}},Cb={style:{display:"flex","flex-direction":"column",gap:"8px"}},Sb={class:"extension-info"},Ab=["src","alt"],Db={class:"extension-details"};function Lb(t,e,o,n,s,i){const a=Wn,r=Lt,f=pe,d=ae;return p(),y("div",bb,[e[0]||(e[0]=l("h3",{class:"section-title"},"Recommended Plugins",-1)),c(d,{class:"extension-list",style:{width:"100%"},shadow:"never","body-style":{padding:"0"}},{default:m(()=>[n.isInitialLoading?(p(),y(B,{key:0},ee(3,u=>l("div",{key:u,class:"extension-item"},[c(r,{animated:""},{template:m(()=>[l("div",Tb,[l("div",wb,[c(a,{variant:"circle",style:{width:"40px",height:"40px"}})]),l("div",Eb,[l("div",Cb,[c(a,{variant:"text",style:{width:"60%",height:"18px"}}),c(a,{variant:"text",style:{width:"80%",height:"16px"}}),c(a,{variant:"button",style:{width:"100px",height:"30px","margin-top":"3px"}})])])])]),_:1})])),64)):(p(!0),y(B,{key:1},ee(n.visiblePlugins,u=>(p(),y("div",{key:u.slug,class:"extension-item"},[l("div",Sb,[l("div",{class:"extension-icon",style:Ce(n.getIconStyle(u))},[u.icon?(p(),y("img",{key:0,src:u.icon,alt:u.name},null,8,Ab)):C("",!0)],4),l("div",Db,[l("h3",null,A(u.name),1),l("p",null,A(n.trimWords(n.getTextFromHtml(u.description),8)),1),c(f,{type:"text",plain:"",class:"extension-button",loading:u.isLoading,disabled:u.status===n.PLUGIN_STATES.ACTIVE||u.status===n.PLUGIN_STATES.INSTALLING||u.status===n.PLUGIN_STATES.ACTIVATING,onClick:g=>n.handlePluginAction(u)},{default:m(()=>[k(A(n.getPluginButtonText(u.status,u.isLoading)),1)]),_:2},1032,["loading","disabled","onClick"])])])]))),128))]),_:1})])}const oa=M(vb,[["render",Lb],["__scopeId","data-v-e7d787d8"]]),Ib={name:"HelpResources",components:{},methods:{openActionLink(t){t&&window.open(t,"_blank")}}},Ob={class:"help-resources"},Nb={class:"card-content"},xb={class:"icon-wrapper blue-bg"},kb={class:"text-content"},Rb={class:"card-content"},Pb={class:"icon-wrapper blue-bg"},Mb={class:"text-content"},Gb={class:"card-content"},Fb={class:"icon-wrapper blue-bg"},Vb={class:"text-content"},Ub={class:"card-content"},Bb={class:"icon-wrapper blue-bg"},zb={class:"text-content"};function Hb(t,e,o,n,s,i){const a=Ae,r=pe,f=ae,d=rt,u=lt;return p(),y("div",Ob,[e[20]||(e[20]=l("h3",{class:"section-title"},"Help & Resources",-1)),c(u,{gutter:24},{default:m(()=>[c(d,{xs:24,sm:12,md:12},{default:m(()=>[c(f,{class:"resource-card",shadow:"hover"},{default:m(()=>[l("div",Nb,[l("div",xb,[c(a,null,{default:m(()=>e[4]||(e[4]=[l("i",{class:"wli wli-file"},null,-1)])),_:1})]),l("div",kb,[e[6]||(e[6]=l("h3",null,"Documentation",-1)),e[7]||(e[7]=l("p",null,"We've organized the documentation and kept it up to date on a regular basis. This manual will assist you in using our plugin effectively.",-1)),c(r,{type:"text",plain:"",onClick:e[0]||(e[0]=g=>i.openActionLink("https://woolentor.com/documentation/"))},{default:m(()=>e[5]||(e[5]=[k("Get Now")])),_:1})])])]),_:1})]),_:1}),c(d,{xs:24,sm:12,md:12},{default:m(()=>[c(f,{class:"resource-card",shadow:"hover"},{default:m(()=>[l("div",Rb,[l("div",Pb,[c(a,null,{default:m(()=>e[8]||(e[8]=[l("i",{class:"wli wli-play"},null,-1)])),_:1})]),l("div",Mb,[e[10]||(e[10]=l("h3",null,"Video Tutorial",-1)),e[11]||(e[11]=l("p",null,"We create videos to make our customers comprehend the product quickly. Using video tutorials is a fantastic method to learn how to use our plugins. We've compiled a list of videos for you.",-1)),c(r,{type:"text",plain:"",onClick:e[1]||(e[1]=g=>i.openActionLink("https://www.youtube.com/playlist?list=PLk25BQFrj7wH9zCECMNCtEvvUKkpV5TYA"))},{default:m(()=>e[9]||(e[9]=[k("Video Tutorial")])),_:1})])])]),_:1})]),_:1}),c(d,{xs:24,sm:12,md:12},{default:m(()=>[c(f,{class:"resource-card",shadow:"hover"},{default:m(()=>[l("div",Gb,[l("div",Fb,[c(a,null,{default:m(()=>e[12]||(e[12]=[l("i",{class:"wli wli-support"},null,-1)])),_:1})]),l("div",Vb,[e[14]||(e[14]=l("h3",null,"Support",-1)),e[15]||(e[15]=l("p",null,"Please do not hesitate to contact us if you require assistance or want a free store set-up. We will assist you within 12-24 hours of receiving your inquiry.",-1)),c(r,{type:"text",plain:"",onClick:e[2]||(e[2]=g=>i.openActionLink("https://woolentor.com/contact/"))},{default:m(()=>e[13]||(e[13]=[k("Get Support")])),_:1})])])]),_:1})]),_:1}),c(d,{xs:24,sm:12,md:12},{default:m(()=>[c(f,{class:"resource-card",shadow:"hover"},{default:m(()=>[l("div",Ub,[l("div",Bb,[c(a,null,{default:m(()=>e[16]||(e[16]=[l("i",{class:"wli wli-feature-list"},null,-1)])),_:1})]),l("div",zb,[e[18]||(e[18]=l("h3",null,"Missing any Feature?",-1)),e[19]||(e[19]=l("p",null,"Have you ever noticed any missing features? Please notify us if you do. As soon as possible, our staff will add any necessary features based on your requests. Our commitment to our clients is second to none.",-1)),c(r,{type:"text",plain:"",onClick:e[3]||(e[3]=g=>i.openActionLink("https://woolentor.com/contact/"))},{default:m(()=>e[17]||(e[17]=[k("Request")])),_:1})])])]),_:1})]),_:1})]),_:1})])}const sa=M(Ib,[["render",Hb],["__scopeId","data-v-7d2c9e4b"]]),jb={name:"HeroSection",props:{videoId:{type:String,default:"XG70Ge2srz4"}},data(){return{dialogVisible:!1,videoUrl:""}},methods:{showVideo(){this.videoUrl=`https://www.youtube.com/embed/${this.videoId}?autoplay=1`,this.dialogVisible=!0},stopVideo(){this.videoUrl="",this.dialogVisible=!1},openActionLink(t){t&&window.open(t,"_blank")}}},$b={class:"hero-container"},Wb={class:"welcome-content"},qb={class:"welcome-header"},Kb={class:"welcome-actions"},Yb={class:"video-wrapper"},Jb=["src"];function Xb(t,e,o,n,s,i){const a=pe,r=rt,f=ae,d=lt,u=_t;return p(),y("div",$b,[c(d,{gutter:24,class:"welcome-container"},{default:m(()=>[c(r,{xs:24,lg:12},{default:m(()=>[l("div",Wb,[l("div",qb,[l("h4",null,"Hello "+A(this.woolentorLocalizeData?.userData?.showName)+",",1),e[3]||(e[3]=l("h3",null,"Welcome to ShopLentor",-1))]),e[6]||(e[6]=l("p",{class:"welcome-description"}," ShopLentor is All-in-one Solution for WooCommerce aims to replace the need for multiple plugins, offering a singular, integrated tool that addresses all your e-commerce needs. ",-1)),l("div",Kb,[c(a,{type:"primary",size:"large",onClick:e[0]||(e[0]=g=>i.openActionLink("https://woolentor.com/documentation/"))},{default:m(()=>e[4]||(e[4]=[k(" Documentation ")])),_:1}),c(a,{type:"text",size:"large",class:"guide-button",onClick:e[1]||(e[1]=g=>i.openActionLink("https://www.youtube.com/playlist?list=PLk25BQFrj7wH9zCECMNCtEvvUKkpV5TYA"))},{default:m(()=>e[5]||(e[5]=[k(" Watch the Video Tutorial ")])),_:1})])])]),_:1}),c(r,{xs:24,lg:12},{default:m(()=>[c(f,{class:"video-card","body-style":{padding:"0",height:"100%"},onClick:i.showVideo},{default:m(()=>e[7]||(e[7]=[l("div",{class:"video-content"},[l("div",{class:"play-button"},[l("div",{class:"play-icon"})])],-1)])),_:1},8,["onClick"])]),_:1})]),_:1}),c(u,{modelValue:s.dialogVisible,"onUpdate:modelValue":e[2]||(e[2]=g=>s.dialogVisible=g),width:"50%","close-on-click-modal":!1,class:"video-dialog",onClose:i.stopVideo},{default:m(()=>[l("div",Yb,[l("iframe",{src:s.videoUrl,frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:""},null,8,Jb)])]),_:1},8,["modelValue","onClose"])])}const ia=M(jb,[["render",Xb],["__scopeId","data-v-7177212b"]]),Qb={name:"WelcomeComponent",components:{HeroSection:ia,HelpResources:sa,Extension:oa,ActionCards:na,SubscribeSection:ta,PluginGrid:Wt}};function Zb(t,e,o,n,s,i){const a=ia,r=yt,f=sa,d=rt,u=oa,g=na,_=ta,v=lt,h=Wt;return p(),y(B,null,[c(a,{"video-id":"XG70Ge2srz4"}),c(r),c(v,{gutter:24,class:"welcome-container welcome-content-container"},{default:m(()=>[c(d,{span:16,md:16,sm:24,xs:24},{default:m(()=>[c(f)]),_:1}),c(d,{span:8,md:8,sm:24,xs:24},{default:m(()=>[c(u),c(g)]),_:1}),c(d,{span:24},{default:m(()=>[c(_)]),_:1})]),_:1}),c(h)],64)}const eT=M(Qb,[["render",Zb],["__scopeId","data-v-c020127a"]]),Je=ba(pc);Je.use(Ya);const xs=()=>[_v,ev,u_,O_,_h,Yg,t_,Dv,F_,mg,$v,ag,qh,Hy,Fg,cv,Mh,Eg,ah,T_,Mv],tT=t=>{t&&Je.component(t.name,t.template)},nT=()=>{Je.use(Mi),Je.use(Ne),xs().forEach(tT),Je.component("WelcomeComponent",eT),Je.component("FreeExtension",ib),Je.component("ProExtension",rb),Je.config.globalProperties.optPrefix=woolentorOptions.prefix,Je.config.globalProperties.woolentorLocalizeData=woolentorOptions,Je.config.globalProperties.woolentorCustomComponents=xs(),Je.mount("#woolentor-opt-admin-app"),pf("woolentor_page",Object.keys(woolentorOptions.tabs)),bs(),window.addEventListener("scroll",bs)};nT();