expedite-components 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
* @vue/runtime-core v3.4.21
|
|
11
11
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
12
|
* @license MIT
|
|
13
|
-
**/const xr=[];function
|
|
13
|
+
**/const xr=[];function _8(e,...t){gn();const n=xr.length?xr[xr.length-1].component:null,r=n&&n.appContext.config.warnHandler,i=If();if(r)nn(r,n,11,[e+t.map(o=>{var a,s;return(s=(a=o.toString)==null?void 0:a.call(o))!=null?s:JSON.stringify(o)}).join(""),n&&n.proxy,i.map(({vnode:o})=>`at <${tc(n,o.type)}>`).join(`
|
|
14
14
|
`),i]);else{const o=[`[Vue warn]: ${e}`,...t];i.length&&o.push(`
|
|
15
15
|
`,...Af(i)),console.warn(...o)}vn()}function If(){let e=xr[xr.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const r=e.component&&e.component.parent;e=r&&r.vnode}return t}function Af(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
|
|
16
|
-
`],...Tf(n))}),t}function Tf({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,i=` at <${tc(e.component,e.type,r)}`,o=">"+n;return e.props?[i,...Nf(e.props),o]:[i+o]}function Nf(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...fl(r,e[r]))}),n.length>3&&t.push(" ..."),t}function fl(e,t,n){return Qe(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:Je(t)?(t=fl(e,Le(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Ne(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=Le(t),n?t:[`${e}=`,t])}function nn(e,t,n,r){try{return r?e(...r):e()}catch(i){_i(i,t,n)}}function Pt(e,t,n,r){if(Ne(e)){const o=nn(e,t,n,r);return o&&Ps(o)&&o.catch(a=>{_i(a,t,n)}),o}const i=[];for(let o=0;o<e.length;o++)i.push(Pt(e[o],t,n,r));return i}function _i(e,t,n,r=!0){const i=t?t.vnode:null;if(t){let o=t.parent;const a=t.proxy,s=`https://vuejs.org/error-reference/#runtime-${n}`;for(;o;){const p=o.ec;if(p){for(let c=0;c<p.length;c++)if(p[c](e,a,s)===!1)return}o=o.parent}const l=t.appContext.config.errorHandler;if(l){nn(l,null,10,[e,a,s]);return}}Pf(e,n,i,r)}function Pf(e,t,n,r=!0){console.error(e)}let kr=!1,Ko=!1;const ut=[];let Ht=0;const Gn=[];let bn=null,qn=0;const dl=Promise.resolve();let Zo=null;function Ut(e){const t=Zo||dl;return e?t.then(this?e.bind(this):e):t}function Lf(e){let t=Ht+1,n=ut.length;for(;t<n;){const r=t+n>>>1,i=ut[r],o=Er(i);o<e||o===e&&i.pre?t=r+1:n=r}return t}function Qo(e){(!ut.length||!ut.includes(e,kr&&e.allowRecurse?Ht+1:Ht))&&(e.id==null?ut.push(e):ut.splice(Lf(e.id),0,e),hl())}function hl(){!kr&&!Ko&&(Ko=!0,Zo=dl.then(gl))}function Rf(e){const t=ut.indexOf(e);t>Ht&&ut.splice(t,1)}function Mf(e){ke(e)?Gn.push(...e):(!bn||!bn.includes(e,e.allowRecurse?qn+1:qn))&&Gn.push(e),hl()}function pl(e,t,n=kr?Ht+1:0){for(;n<ut.length;n++){const r=ut[n];if(r&&r.pre){if(e&&r.id!==e.uid)continue;ut.splice(n,1),n--,r()}}}function ml(e){if(Gn.length){const t=[...new Set(Gn)].sort((n,r)=>Er(n)-Er(r));if(Gn.length=0,bn){bn.push(...t);return}for(bn=t,qn=0;qn<bn.length;qn++)bn[qn]();bn=null,qn=0}}const Er=e=>e.id==null?1/0:e.id,qf=(e,t)=>{const n=Er(e)-Er(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function gl(e){Ko=!1,kr=!0,ut.sort(qf);try{for(Ht=0;Ht<ut.length;Ht++){const t=ut[Ht];t&&t.active!==!1&&nn(t,null,14)}}finally{Ht=0,ut.length=0,ml(),kr=!1,Zo=null,(ut.length||Gn.length)&&gl()}}function jf(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||He;let i=n;const o=t.startsWith("update:"),a=o&&t.slice(7);if(a&&a in r){const c=`${a==="modelValue"?"model":a}Modifiers`,{number:f,trim:u}=r[c]||He;u&&(i=n.map(m=>Qe(m)?m.trim():m)),f&&(i=n.map(_r))}let s,l=r[s=Po(t)]||r[s=Po(vt(t))];!l&&o&&(l=r[s=Po(Et(t))]),l&&Pt(l,e,6,i);const p=r[s+"Once"];if(p){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,Pt(p,e,6,i)}}function vl(e,t,n=!1){const r=t.emitsCache,i=r.get(e);if(i!==void 0)return i;const o=e.emits;let a={},s=!1;if(!Ne(e)){const l=p=>{const c=vl(p,t,!0);c&&(s=!0,et(a,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!s?(Ue(e)&&r.set(e,null),null):(ke(o)?o.forEach(l=>a[l]=null):et(a,o),Ue(e)&&r.set(e,a),a)}function bi(e,t){return!e||!oi(t)?!1:(t=t.slice(2).replace(/Once$/,""),Me(e,t[0].toLowerCase()+t.slice(1))||Me(e,Et(t))||Me(e,t))}let We=null,Ci=null;function wi(e){const t=We;return We=e,Ci=e&&e.type.__scopeId||null,t}function Yn(e){Ci=e}function er(){Ci=null}function De(e,t=We,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&Kl(-1);const o=wi(t);let a;try{a=e(...i)}finally{wi(o),r._d&&Kl(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function _8(){}function Xo(e){const{type:t,vnode:n,proxy:r,withProxy:i,props:o,propsOptions:[a],slots:s,attrs:l,emit:p,render:c,renderCache:f,data:u,setupState:m,ctx:h,inheritAttrs:g}=e;let d,v;const _=wi(e);try{if(n.shapeFlag&4){const y=i||r,w=y;d=zt(c.call(w,y,f,o,m,u,h)),v=l}else{const y=t;d=zt(y.length>1?y(o,{attrs:l,slots:s,emit:p}):y(o,null)),v=t.props?l:Df(l)}}catch(y){Tr.length=0,_i(y,e,1),d=_e(En)}let C=d;if(v&&g!==!1){const y=Object.keys(v),{shapeFlag:w}=C;y.length&&w&7&&(a&&y.some(Ao)&&(v=Bf(v,a)),C=nr(C,v))}return n.dirs&&(C=nr(C),C.dirs=C.dirs?C.dirs.concat(n.dirs):n.dirs),n.transition&&(C.transition=n.transition),d=C,wi(_),d}const Df=e=>{let t;for(const n in e)(n==="class"||n==="style"||oi(n))&&((t||(t={}))[n]=e[n]);return t},Bf=(e,t)=>{const n={};for(const r in e)(!Ao(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function $f(e,t,n){const{props:r,children:i,component:o}=e,{props:a,children:s,patchFlag:l}=t,p=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?yl(r,a,p):!!a;if(l&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const u=c[f];if(a[u]!==r[u]&&!bi(p,u))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===a?!1:r?a?yl(r,a,p):!0:!!a;return!1}function yl(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){const o=r[i];if(t[o]!==e[o]&&!bi(n,o))return!0}return!1}function Ff({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r===e)(e=t.vnode).el=n,t=t.parent;else break}}const Jo="components",Vf="directives";function Or(e,t){return Wo(Jo,e,!0,t)||e}const _l=Symbol.for("v-ndc");function bl(e){return Qe(e)?Wo(Jo,e,!1)||e:e||_l}function Hf(e){return Wo(Vf,e)}function Wo(e,t,n=!0,r=!1){const i=We||rt;if(i){const o=i.type;if(e===Jo){const s=ec(o,!1);if(s&&(s===t||s===vt(t)||s===si(vt(t))))return o}const a=Cl(i[e]||o[e],t)||Cl(i.appContext[e],t);return!a&&r?o:a}}function Cl(e,t){return e&&(e[t]||e[vt(t)]||e[si(vt(t))])}const Uf=e=>e.__isSuspense;function zf(e,t){t&&t.pendingBranch?ke(e)?t.effects.push(...e):t.effects.push(e):Mf(e)}const Kf=Symbol.for("v-scx"),Zf=()=>kn(Kf);function Qf(e,t){return Go(e,null,{flush:"sync"})}const xi={};function St(e,t,n){return Go(e,t,n)}function Go(e,t,{immediate:n,deep:r,flush:i,once:o,onTrack:a,onTrigger:s}=He){if(t&&o){const A=t;t=(...I)=>{A(...I),w()}}const l=rt,p=A=>r===!0?A:jn(A,r===!1?1:void 0);let c,f=!1,u=!1;if(Je(e)?(c=()=>e.value,f=vi(e)):_n(e)?(c=()=>p(e),f=!0):ke(e)?(u=!0,f=e.some(A=>_n(A)||vi(A)),c=()=>e.map(A=>{if(Je(A))return A.value;if(_n(A))return p(A);if(Ne(A))return nn(A,l,2)})):Ne(e)?t?c=()=>nn(e,l,2):c=()=>(m&&m(),Pt(e,l,3,[h])):c=It,t&&r){const A=c;c=()=>jn(A())}let m,h=A=>{m=C.onStop=()=>{nn(A,l,4),m=C.onStop=void 0}},g;if(Ri)if(h=It,t?n&&Pt(t,l,3,[c(),u?[]:void 0,h]):c(),i==="sync"){const A=Zf();g=A.__watcherHandles||(A.__watcherHandles=[])}else return It;let d=u?new Array(e.length).fill(xi):xi;const v=()=>{if(!(!C.active||!C.dirty))if(t){const A=C.run();(r||f||(u?A.some((I,S)=>Vt(I,d[S])):Vt(A,d)))&&(m&&m(),Pt(t,l,3,[A,d===xi?void 0:u&&d[0]===xi?[]:d,h]),d=A)}else C.run()};v.allowRecurse=!!t;let _;i==="sync"?_=v:i==="post"?_=()=>_t(v,l&&l.suspense):(v.pre=!0,l&&(v.id=l.uid),_=()=>Qo(v));const C=new Mo(c,It,_),y=Vs(),w=()=>{C.stop(),y&&To(y.effects,C)};return t?n?v():d=C.run():i==="post"?_t(C.run.bind(C),l&&l.suspense):C.run(),g&&g.push(w),w}function Xf(e,t,n){const r=this.proxy,i=Qe(e)?e.includes(".")?wl(r,e):()=>r[e]:e.bind(r,r);let o;Ne(t)?o=t:(o=t.handler,n=t);const a=Rr(this),s=Go(i,o.bind(r),n);return a(),s}function wl(e,t){const n=t.split(".");return()=>{let r=e;for(let i=0;i<n.length&&r;i++)r=r[n[i]];return r}}function jn(e,t,n=0,r){if(!Ue(e)||e.__v_skip)return e;if(t&&t>0){if(n>=t)return e;n++}if(r=r||new Set,r.has(e))return e;if(r.add(e),Je(e))jn(e.value,t,n,r);else if(ke(e))for(let i=0;i<e.length;i++)jn(e[i],t,n,r);else if(Jn(e)||Xn(e))e.forEach(i=>{jn(i,t,n,r)});else if(Rs(e))for(const i in e)jn(e[i],t,n,r);return e}function Cn(e,t){if(We===null)return e;const n=Mi(We)||We.proxy,r=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[o,a,s,l=He]=t[i];o&&(Ne(o)&&(o={mounted:o,updated:o}),o.deep&&jn(a),r.push({dir:o,instance:n,value:a,oldValue:void 0,arg:s,modifiers:l}))}return e}function Dn(e,t,n,r){const i=e.dirs,o=t&&t.dirs;for(let a=0;a<i.length;a++){const s=i[a];o&&(s.oldValue=o[a].value);let l=s.dir[r];l&&(gn(),Pt(l,n,8,[e.el,s,e,t]),vn())}}/*! #__NO_SIDE_EFFECTS__ */function xl(e,t){return Ne(e)?et({name:e.name},t,{setup:e}):e}const Sr=e=>!!e.type.__asyncLoader,kl=e=>e.type.__isKeepAlive;function Jf(e,t){El(e,"a",t)}function Wf(e,t){El(e,"da",t)}function El(e,t,n=rt){const r=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(ki(t,r,n),n){let i=n.parent;for(;i&&i.parent;)kl(i.parent.vnode)&&Gf(r,t,n,i),i=i.parent}}function Gf(e,t,n,r){const i=ki(t,e,r,!0);Yo(()=>{To(r[t],i)},n)}function ki(e,t,n=rt,r=!1){if(n){const i=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...a)=>{if(n.isUnmounted)return;gn();const s=Rr(n),l=Pt(t,n,e,a);return s(),vn(),l});return r?i.unshift(o):i.push(o),o}}const rn=e=>(t,n=rt)=>(!Ri||e==="sp")&&ki(e,(...r)=>t(...r),n),wn=rn("bm"),xn=rn("m"),Ol=rn("bu"),Yf=rn("u"),Ei=rn("bum"),Yo=rn("um"),ed=rn("sp"),td=rn("rtg"),nd=rn("rtc");function rd(e,t=rt){ki("ec",e,t)}function ze(e,t,n,r){let i;const o=n&&n[r];if(ke(e)||Qe(e)){i=new Array(e.length);for(let a=0,s=e.length;a<s;a++)i[a]=t(e[a],a,void 0,o&&o[a])}else if(typeof e=="number"){i=new Array(e);for(let a=0;a<e;a++)i[a]=t(a+1,a,void 0,o&&o[a])}else if(Ue(e))if(e[Symbol.iterator])i=Array.from(e,(a,s)=>t(a,s,void 0,o&&o[s]));else{const a=Object.keys(e);i=new Array(a.length);for(let s=0,l=a.length;s<l;s++){const p=a[s];i[s]=t(e[p],p,s,o&&o[s])}}else i=[];return n&&(n[r]=i),i}function Ze(e,t,n={},r,i){if(We.isCE||We.parent&&Sr(We.parent)&&We.parent.isCE)return t!=="default"&&(n.name=t),_e("slot",n,r&&r());let o=e[t];o&&o._c&&(o._d=!1),X();const a=o&&Sl(o(n)),s=Te(Oe,{key:n.key||a&&a.key||`_${t}`},a||(r?r():[]),a&&e._===1?64:-2);return!i&&s.scopeId&&(s.slotScopeIds=[s.scopeId+"-s"]),o&&o._c&&(o._d=!0),s}function Sl(e){return e.some(t=>Ti(t)?!(t.type===En||t.type===Oe&&!Sl(t.children)):!0)?e:null}const ea=e=>e?Jl(e)?Mi(e)||e.proxy:ea(e.parent):null,Ir=et(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ea(e.parent),$root:e=>ea(e.root),$emit:e=>e.emit,$options:e=>ra(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Qo(e.update)}),$nextTick:e=>e.n||(e.n=Ut.bind(e.proxy)),$watch:e=>Xf.bind(e)}),ta=(e,t)=>e!==He&&!e.__isScriptSetup&&Me(e,t),id={get({_:e},t){const{ctx:n,setupState:r,data:i,props:o,accessCache:a,type:s,appContext:l}=e;let p;if(t[0]!=="$"){const m=a[t];if(m!==void 0)switch(m){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return o[t]}else{if(ta(r,t))return a[t]=1,r[t];if(i!==He&&Me(i,t))return a[t]=2,i[t];if((p=e.propsOptions[0])&&Me(p,t))return a[t]=3,o[t];if(n!==He&&Me(n,t))return a[t]=4,n[t];na&&(a[t]=0)}}const c=Ir[t];let f,u;if(c)return t==="$attrs"&&yt(e,"get",t),c(e);if((f=s.__cssModules)&&(f=f[t]))return f;if(n!==He&&Me(n,t))return a[t]=4,n[t];if(u=l.config.globalProperties,Me(u,t))return u[t]},set({_:e},t,n){const{data:r,setupState:i,ctx:o}=e;return ta(i,t)?(i[t]=n,!0):r!==He&&Me(r,t)?(r[t]=n,!0):Me(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,propsOptions:o}},a){let s;return!!n[a]||e!==He&&Me(e,a)||ta(t,a)||(s=o[0])&&Me(s,a)||Me(r,a)||Me(Ir,a)||Me(i.config.globalProperties,a)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Me(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Oi(e){return ke(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Il(e,t){return!e||!t?e||t:ke(e)&&ke(t)?e.concat(t):et({},Oi(e),Oi(t))}let na=!0;function od(e){const t=ra(e),n=e.proxy,r=e.ctx;na=!1,t.beforeCreate&&Al(t.beforeCreate,e,"bc");const{data:i,computed:o,methods:a,watch:s,provide:l,inject:p,created:c,beforeMount:f,mounted:u,beforeUpdate:m,updated:h,activated:g,deactivated:d,beforeDestroy:v,beforeUnmount:_,destroyed:C,unmounted:y,render:w,renderTracked:A,renderTriggered:I,errorCaptured:S,serverPrefetch:N,expose:T,inheritAttrs:k,components:E,directives:L,filters:V}=t;if(p&&ad(p,r,null),a)for(const te in a){const fe=a[te];Ne(fe)&&(r[te]=fe.bind(n))}if(i){const te=i.call(n,n);Ue(te)&&(e.data=br(te))}if(na=!0,o)for(const te in o){const fe=o[te],ee=Ne(fe)?fe.bind(n,n):Ne(fe.get)?fe.get.bind(n,n):It,j=!Ne(fe)&&Ne(fe.set)?fe.set.bind(n):It,O=be({get:ee,set:j});Object.defineProperty(r,te,{enumerable:!0,configurable:!0,get:()=>O.value,set:P=>O.value=P})}if(s)for(const te in s)Tl(s[te],r,n,te);if(l){const te=Ne(l)?l.call(n):l;Reflect.ownKeys(te).forEach(fe=>{dd(fe,te[fe])})}c&&Al(c,e,"c");function W(te,fe){ke(fe)?fe.forEach(ee=>te(ee.bind(n))):fe&&te(fe.bind(n))}if(W(wn,f),W(xn,u),W(Ol,m),W(Yf,h),W(Jf,g),W(Wf,d),W(rd,S),W(nd,A),W(td,I),W(Ei,_),W(Yo,y),W(ed,N),ke(T))if(T.length){const te=e.exposed||(e.exposed={});T.forEach(fe=>{Object.defineProperty(te,fe,{get:()=>n[fe],set:ee=>n[fe]=ee})})}else e.exposed||(e.exposed={});w&&e.render===It&&(e.render=w),k!=null&&(e.inheritAttrs=k),E&&(e.components=E),L&&(e.directives=L)}function ad(e,t,n=It){ke(e)&&(e=ia(e));for(const r in e){const i=e[r];let o;Ue(i)?"default"in i?o=kn(i.from||r,i.default,!0):o=kn(i.from||r):o=kn(i),Je(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:a=>o.value=a}):t[r]=o}}function Al(e,t,n){Pt(ke(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Tl(e,t,n,r){const i=r.includes(".")?wl(n,r):()=>n[r];if(Qe(e)){const o=t[e];Ne(o)&&St(i,o)}else if(Ne(e))St(i,e.bind(n));else if(Ue(e))if(ke(e))e.forEach(o=>Tl(o,t,n,r));else{const o=Ne(e.handler)?e.handler.bind(n):t[e.handler];Ne(o)&&St(i,o,e)}}function ra(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:o,config:{optionMergeStrategies:a}}=e.appContext,s=o.get(t);let l;return s?l=s:!i.length&&!n&&!r?l=t:(l={},i.length&&i.forEach(p=>Si(l,p,a,!0)),Si(l,t,a)),Ue(t)&&o.set(t,l),l}function Si(e,t,n,r=!1){const{mixins:i,extends:o}=t;o&&Si(e,o,n,!0),i&&i.forEach(a=>Si(e,a,n,!0));for(const a in t)if(!(r&&a==="expose")){const s=sd[a]||n&&n[a];e[a]=s?s(e[a],t[a]):t[a]}return e}const sd={data:Nl,props:Pl,emits:Pl,methods:Ar,computed:Ar,beforeCreate:mt,created:mt,beforeMount:mt,mounted:mt,beforeUpdate:mt,updated:mt,beforeDestroy:mt,beforeUnmount:mt,destroyed:mt,unmounted:mt,activated:mt,deactivated:mt,errorCaptured:mt,serverPrefetch:mt,components:Ar,directives:Ar,watch:cd,provide:Nl,inject:ld};function Nl(e,t){return t?e?function(){return et(Ne(e)?e.call(this,this):e,Ne(t)?t.call(this,this):t)}:t:e}function ld(e,t){return Ar(ia(e),ia(t))}function ia(e){if(ke(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function mt(e,t){return e?[...new Set([].concat(e,t))]:t}function Ar(e,t){return e?et(Object.create(null),e,t):t}function Pl(e,t){return e?ke(e)&&ke(t)?[...new Set([...e,...t])]:et(Object.create(null),Oi(e),Oi(t??{})):t}function cd(e,t){if(!e)return t;if(!t)return e;const n=et(Object.create(null),e);for(const r in t)n[r]=mt(e[r],t[r]);return n}function Ll(){return{app:null,config:{isNativeTag:Du,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let ud=0;function fd(e,t){return function(r,i=null){Ne(r)||(r=et({},r)),i!=null&&!Ue(i)&&(i=null);const o=Ll(),a=new WeakSet;let s=!1;const l=o.app={_uid:ud++,_component:r,_props:i,_container:null,_context:o,_instance:null,version:Bd,get config(){return o.config},set config(p){},use(p,...c){return a.has(p)||(p&&Ne(p.install)?(a.add(p),p.install(l,...c)):Ne(p)&&(a.add(p),p(l,...c))),l},mixin(p){return o.mixins.includes(p)||o.mixins.push(p),l},component(p,c){return c?(o.components[p]=c,l):o.components[p]},directive(p,c){return c?(o.directives[p]=c,l):o.directives[p]},mount(p,c,f){if(!s){const u=_e(r,i);return u.appContext=o,f===!0?f="svg":f===!1&&(f=void 0),c&&t?t(u,p):e(u,p,f),s=!0,l._container=p,p.__vue_app__=l,Mi(u.component)||u.component.proxy}},unmount(){s&&(e(null,l._container),delete l._container.__vue_app__)},provide(p,c){return o.provides[p]=c,l},runWithContext(p){const c=tr;tr=l;try{return p()}finally{tr=c}}};return l}}let tr=null;function dd(e,t){if(rt){let n=rt.provides;const r=rt.parent&&rt.parent.provides;r===n&&(n=rt.provides=Object.create(r)),n[e]=t}}function kn(e,t,n=!1){const r=rt||We;if(r||tr){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:tr._context.provides;if(i&&e in i)return i[e];if(arguments.length>1)return n&&Ne(t)?t.call(r&&r.proxy):t}}function Rl(){return!!(rt||We||tr)}function hd(e,t,n,r=!1){const i={},o={};ci(o,Ni,1),e.propsDefaults=Object.create(null),Ml(e,t,i,o);for(const a in e.propsOptions[0])a in i||(i[a]=void 0);n?e.props=r?i:yf(i):e.type.props?e.props=i:e.props=o,e.attrs=o}function pd(e,t,n,r){const{props:i,attrs:o,vnode:{patchFlag:a}}=e,s=Le(i),[l]=e.propsOptions;let p=!1;if((r||a>0)&&!(a&16)){if(a&8){const c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let u=c[f];if(bi(e.emitsOptions,u))continue;const m=t[u];if(l)if(Me(o,u))m!==o[u]&&(o[u]=m,p=!0);else{const h=vt(u);i[h]=oa(l,s,h,m,e,!1)}else m!==o[u]&&(o[u]=m,p=!0)}}}else{Ml(e,t,i,o)&&(p=!0);let c;for(const f in s)(!t||!Me(t,f)&&((c=Et(f))===f||!Me(t,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(i[f]=oa(l,s,f,void 0,e,!0)):delete i[f]);if(o!==s)for(const f in o)(!t||!Me(t,f))&&(delete o[f],p=!0)}p&&tn(e,"set","$attrs")}function Ml(e,t,n,r){const[i,o]=e.propsOptions;let a=!1,s;if(t)for(let l in t){if(yr(l))continue;const p=t[l];let c;i&&Me(i,c=vt(l))?!o||!o.includes(c)?n[c]=p:(s||(s={}))[c]=p:bi(e.emitsOptions,l)||(!(l in r)||p!==r[l])&&(r[l]=p,a=!0)}if(o){const l=Le(n),p=s||He;for(let c=0;c<o.length;c++){const f=o[c];n[f]=oa(i,l,f,p[f],e,!Me(p,f))}}return a}function oa(e,t,n,r,i,o){const a=e[n];if(a!=null){const s=Me(a,"default");if(s&&r===void 0){const l=a.default;if(a.type!==Function&&!a.skipFactory&&Ne(l)){const{propsDefaults:p}=i;if(n in p)r=p[n];else{const c=Rr(i);r=p[n]=l.call(null,t),c()}}else r=l}a[0]&&(o&&!s?r=!1:a[1]&&(r===""||r===Et(n))&&(r=!0))}return r}function ql(e,t,n=!1){const r=t.propsCache,i=r.get(e);if(i)return i;const o=e.props,a={},s=[];let l=!1;if(!Ne(e)){const c=f=>{l=!0;const[u,m]=ql(f,t,!0);et(a,u),m&&s.push(...m)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return Ue(e)&&r.set(e,Qn),Qn;if(ke(o))for(let c=0;c<o.length;c++){const f=vt(o[c]);jl(f)&&(a[f]=He)}else if(o)for(const c in o){const f=vt(c);if(jl(f)){const u=o[c],m=a[f]=ke(u)||Ne(u)?{type:u}:et({},u);if(m){const h=$l(Boolean,m.type),g=$l(String,m.type);m[0]=h>-1,m[1]=g<0||h<g,(h>-1||Me(m,"default"))&&s.push(f)}}}const p=[a,s];return Ue(e)&&r.set(e,p),p}function jl(e){return e[0]!=="$"&&!yr(e)}function Dl(e){return e===null?"null":typeof e=="function"?e.name||"":typeof e=="object"&&e.constructor&&e.constructor.name||""}function Bl(e,t){return Dl(e)===Dl(t)}function $l(e,t){return ke(t)?t.findIndex(n=>Bl(n,e)):Ne(t)&&Bl(t,e)?0:-1}const Fl=e=>e[0]==="_"||e==="$stable",aa=e=>ke(e)?e.map(zt):[zt(e)],md=(e,t,n)=>{if(t._n)return t;const r=De((...i)=>aa(t(...i)),n);return r._c=!1,r},Vl=(e,t,n)=>{const r=e._ctx;for(const i in e){if(Fl(i))continue;const o=e[i];if(Ne(o))t[i]=md(i,o,r);else if(o!=null){const a=aa(o);t[i]=()=>a}}},Hl=(e,t)=>{const n=aa(t);e.slots.default=()=>n},gd=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=Le(t),ci(t,"_",n)):Vl(t,e.slots={})}else e.slots={},t&&Hl(e,t);ci(e.slots,Ni,1)},vd=(e,t,n)=>{const{vnode:r,slots:i}=e;let o=!0,a=He;if(r.shapeFlag&32){const s=t._;s?n&&s===1?o=!1:(et(i,t),!n&&s===1&&delete i._):(o=!t.$stable,Vl(t,i)),a=t}else t&&(Hl(e,t),a={default:1});if(o)for(const s in i)!Fl(s)&&a[s]==null&&delete i[s]};function sa(e,t,n,r,i=!1){if(ke(e)){e.forEach((u,m)=>sa(u,t&&(ke(t)?t[m]:t),n,r,i));return}if(Sr(r)&&!i)return;const o=r.shapeFlag&4?Mi(r.component)||r.component.proxy:r.el,a=i?null:o,{i:s,r:l}=e,p=t&&t.r,c=s.refs===He?s.refs={}:s.refs,f=s.setupState;if(p!=null&&p!==l&&(Qe(p)?(c[p]=null,Me(f,p)&&(f[p]=null)):Je(p)&&(p.value=null)),Ne(l))nn(l,s,12,[a,c]);else{const u=Qe(l),m=Je(l);if(u||m){const h=()=>{if(e.f){const g=u?Me(f,l)?f[l]:c[l]:l.value;i?ke(g)&&To(g,o):ke(g)?g.includes(o)||g.push(o):u?(c[l]=[o],Me(f,l)&&(f[l]=c[l])):(l.value=[o],e.k&&(c[e.k]=l.value))}else u?(c[l]=a,Me(f,l)&&(f[l]=a)):m&&(l.value=a,e.k&&(c[e.k]=a))};a?(h.id=-1,_t(h,n)):h()}}}const _t=zf;function yd(e){return _d(e)}function _d(e,t){const n=js();n.__VUE__=!0;const{insert:r,remove:i,patchProp:o,createElement:a,createText:s,createComment:l,setText:p,setElementText:c,parentNode:f,nextSibling:u,setScopeId:m=It,insertStaticContent:h}=e,g=(R,z,oe,ce=null,le=null,Y=null,ie=void 0,se=null,ue=!!z.dynamicChildren)=>{if(R===z)return;R&&!Pr(R,z)&&(ce=U(R),P(R,le,Y,!0),R=null),z.patchFlag===-2&&(ue=!1,z.dynamicChildren=null);const{type:re,ref:pe,shapeFlag:me}=z;switch(re){case Ii:d(R,z,oe,ce);break;case En:v(R,z,oe,ce);break;case Ai:R==null&&_(z,oe,ce,ie);break;case Oe:E(R,z,oe,ce,le,Y,ie,se,ue);break;default:me&1?w(R,z,oe,ce,le,Y,ie,se,ue):me&6?L(R,z,oe,ce,le,Y,ie,se,ue):(me&64||me&128)&&re.process(R,z,oe,ce,le,Y,ie,se,ue,$)}pe!=null&&le&&sa(pe,R&&R.ref,Y,z||R,!z)},d=(R,z,oe,ce)=>{if(R==null)r(z.el=s(z.children),oe,ce);else{const le=z.el=R.el;z.children!==R.children&&p(le,z.children)}},v=(R,z,oe,ce)=>{R==null?r(z.el=l(z.children||""),oe,ce):z.el=R.el},_=(R,z,oe,ce)=>{[R.el,R.anchor]=h(R.children,z,oe,ce,R.el,R.anchor)},C=({el:R,anchor:z},oe,ce)=>{let le;for(;R&&R!==z;)le=u(R),r(R,oe,ce),R=le;r(z,oe,ce)},y=({el:R,anchor:z})=>{let oe;for(;R&&R!==z;)oe=u(R),i(R),R=oe;i(z)},w=(R,z,oe,ce,le,Y,ie,se,ue)=>{z.type==="svg"?ie="svg":z.type==="math"&&(ie="mathml"),R==null?A(z,oe,ce,le,Y,ie,se,ue):N(R,z,le,Y,ie,se,ue)},A=(R,z,oe,ce,le,Y,ie,se)=>{let ue,re;const{props:pe,shapeFlag:me,transition:ge,dirs:Ce}=R;if(ue=R.el=a(R.type,Y,pe&&pe.is,pe),me&8?c(ue,R.children):me&16&&S(R.children,ue,null,ce,le,la(R,Y),ie,se),Ce&&Dn(R,null,ce,"created"),I(ue,R,R.scopeId,ie,ce),pe){for(const we in pe)we!=="value"&&!yr(we)&&o(ue,we,null,pe[we],Y,R.children,ce,le,B);"value"in pe&&o(ue,"value",null,pe.value,Y),(re=pe.onVnodeBeforeMount)&&Kt(re,ce,R)}Ce&&Dn(R,null,ce,"beforeMount");const Ee=bd(le,ge);Ee&&ge.beforeEnter(ue),r(ue,z,oe),((re=pe&&pe.onVnodeMounted)||Ee||Ce)&&_t(()=>{re&&Kt(re,ce,R),Ee&&ge.enter(ue),Ce&&Dn(R,null,ce,"mounted")},le)},I=(R,z,oe,ce,le)=>{if(oe&&m(R,oe),ce)for(let Y=0;Y<ce.length;Y++)m(R,ce[Y]);if(le){let Y=le.subTree;if(z===Y){const ie=le.vnode;I(R,ie,ie.scopeId,ie.slotScopeIds,le.parent)}}},S=(R,z,oe,ce,le,Y,ie,se,ue=0)=>{for(let re=ue;re<R.length;re++){const pe=R[re]=se?On(R[re]):zt(R[re]);g(null,pe,z,oe,ce,le,Y,ie,se)}},N=(R,z,oe,ce,le,Y,ie)=>{const se=z.el=R.el;let{patchFlag:ue,dynamicChildren:re,dirs:pe}=z;ue|=R.patchFlag&16;const me=R.props||He,ge=z.props||He;let Ce;if(oe&&Bn(oe,!1),(Ce=ge.onVnodeBeforeUpdate)&&Kt(Ce,oe,z,R),pe&&Dn(z,R,oe,"beforeUpdate"),oe&&Bn(oe,!0),re?T(R.dynamicChildren,re,se,oe,ce,la(z,le),Y):ie||fe(R,z,se,null,oe,ce,la(z,le),Y,!1),ue>0){if(ue&16)k(se,z,me,ge,oe,ce,le);else if(ue&2&&me.class!==ge.class&&o(se,"class",null,ge.class,le),ue&4&&o(se,"style",me.style,ge.style,le),ue&8){const Ee=z.dynamicProps;for(let we=0;we<Ee.length;we++){const je=Ee[we],Se=me[je],Ke=ge[je];(Ke!==Se||je==="value")&&o(se,je,Se,Ke,le,R.children,oe,ce,B)}}ue&1&&R.children!==z.children&&c(se,z.children)}else!ie&&re==null&&k(se,z,me,ge,oe,ce,le);((Ce=ge.onVnodeUpdated)||pe)&&_t(()=>{Ce&&Kt(Ce,oe,z,R),pe&&Dn(z,R,oe,"updated")},ce)},T=(R,z,oe,ce,le,Y,ie)=>{for(let se=0;se<z.length;se++){const ue=R[se],re=z[se],pe=ue.el&&(ue.type===Oe||!Pr(ue,re)||ue.shapeFlag&70)?f(ue.el):oe;g(ue,re,pe,null,ce,le,Y,ie,!0)}},k=(R,z,oe,ce,le,Y,ie)=>{if(oe!==ce){if(oe!==He)for(const se in oe)!yr(se)&&!(se in ce)&&o(R,se,oe[se],null,ie,z.children,le,Y,B);for(const se in ce){if(yr(se))continue;const ue=ce[se],re=oe[se];ue!==re&&se!=="value"&&o(R,se,re,ue,ie,z.children,le,Y,B)}"value"in ce&&o(R,"value",oe.value,ce.value,ie)}},E=(R,z,oe,ce,le,Y,ie,se,ue)=>{const re=z.el=R?R.el:s(""),pe=z.anchor=R?R.anchor:s("");let{patchFlag:me,dynamicChildren:ge,slotScopeIds:Ce}=z;Ce&&(se=se?se.concat(Ce):Ce),R==null?(r(re,oe,ce),r(pe,oe,ce),S(z.children||[],oe,pe,le,Y,ie,se,ue)):me>0&&me&64&&ge&&R.dynamicChildren?(T(R.dynamicChildren,ge,oe,le,Y,ie,se),(z.key!=null||le&&z===le.subTree)&&Ul(R,z,!0)):fe(R,z,oe,pe,le,Y,ie,se,ue)},L=(R,z,oe,ce,le,Y,ie,se,ue)=>{z.slotScopeIds=se,R==null?z.shapeFlag&512?le.ctx.activate(z,oe,ce,ie,ue):V(z,oe,ce,le,Y,ie,ue):K(R,z,ue)},V=(R,z,oe,ce,le,Y,ie)=>{const se=R.component=Id(R,ce,le);if(kl(R)&&(se.ctx.renderer=$),Td(se),se.asyncDep){if(le&&le.registerDep(se,W),!R.el){const ue=se.subTree=_e(En);v(null,ue,z,oe)}}else W(se,R,z,oe,le,Y,ie)},K=(R,z,oe)=>{const ce=z.component=R.component;if($f(R,z,oe))if(ce.asyncDep&&!ce.asyncResolved){te(ce,z,oe);return}else ce.next=z,Rf(ce.update),ce.effect.dirty=!0,ce.update();else z.el=R.el,ce.vnode=z},W=(R,z,oe,ce,le,Y,ie)=>{const se=()=>{if(R.isMounted){let{next:pe,bu:me,u:ge,parent:Ce,vnode:Ee}=R;{const Dt=zl(R);if(Dt){pe&&(pe.el=Ee.el,te(R,pe,ie)),Dt.asyncDep.then(()=>{R.isUnmounted||se()});return}}let we=pe,je;Bn(R,!1),pe?(pe.el=Ee.el,te(R,pe,ie)):pe=Ee,me&&li(me),(je=pe.props&&pe.props.onVnodeBeforeUpdate)&&Kt(je,Ce,pe,Ee),Bn(R,!0);const Se=Xo(R),Ke=R.subTree;R.subTree=Se,g(Ke,Se,f(Ke.el),U(Ke),R,le,Y),pe.el=Se.el,we===null&&Ff(R,Se.el),ge&&_t(ge,le),(je=pe.props&&pe.props.onVnodeUpdated)&&_t(()=>Kt(je,Ce,pe,Ee),le)}else{let pe;const{el:me,props:ge}=z,{bm:Ce,m:Ee,parent:we}=R,je=Sr(z);if(Bn(R,!1),Ce&&li(Ce),!je&&(pe=ge&&ge.onVnodeBeforeMount)&&Kt(pe,we,z),Bn(R,!0),me&&J){const Se=()=>{R.subTree=Xo(R),J(me,R.subTree,R,le,null)};je?z.type.__asyncLoader().then(()=>!R.isUnmounted&&Se()):Se()}else{const Se=R.subTree=Xo(R);g(null,Se,oe,ce,R,le,Y),z.el=Se.el}if(Ee&&_t(Ee,le),!je&&(pe=ge&&ge.onVnodeMounted)){const Se=z;_t(()=>Kt(pe,we,Se),le)}(z.shapeFlag&256||we&&Sr(we.vnode)&&we.vnode.shapeFlag&256)&&R.a&&_t(R.a,le),R.isMounted=!0,z=oe=ce=null}},ue=R.effect=new Mo(se,It,()=>Qo(re),R.scope),re=R.update=()=>{ue.dirty&&ue.run()};re.id=R.uid,Bn(R,!0),re()},te=(R,z,oe)=>{z.component=R;const ce=R.vnode.props;R.vnode=z,R.next=null,pd(R,z.props,ce,oe),vd(R,z.children,oe),gn(),pl(R),vn()},fe=(R,z,oe,ce,le,Y,ie,se,ue=!1)=>{const re=R&&R.children,pe=R?R.shapeFlag:0,me=z.children,{patchFlag:ge,shapeFlag:Ce}=z;if(ge>0){if(ge&128){j(re,me,oe,ce,le,Y,ie,se,ue);return}else if(ge&256){ee(re,me,oe,ce,le,Y,ie,se,ue);return}}Ce&8?(pe&16&&B(re,le,Y),me!==re&&c(oe,me)):pe&16?Ce&16?j(re,me,oe,ce,le,Y,ie,se,ue):B(re,le,Y,!0):(pe&8&&c(oe,""),Ce&16&&S(me,oe,ce,le,Y,ie,se,ue))},ee=(R,z,oe,ce,le,Y,ie,se,ue)=>{R=R||Qn,z=z||Qn;const re=R.length,pe=z.length,me=Math.min(re,pe);let ge;for(ge=0;ge<me;ge++){const Ce=z[ge]=ue?On(z[ge]):zt(z[ge]);g(R[ge],Ce,oe,null,le,Y,ie,se,ue)}re>pe?B(R,le,Y,!0,!1,me):S(z,oe,ce,le,Y,ie,se,ue,me)},j=(R,z,oe,ce,le,Y,ie,se,ue)=>{let re=0;const pe=z.length;let me=R.length-1,ge=pe-1;for(;re<=me&&re<=ge;){const Ce=R[re],Ee=z[re]=ue?On(z[re]):zt(z[re]);if(Pr(Ce,Ee))g(Ce,Ee,oe,null,le,Y,ie,se,ue);else break;re++}for(;re<=me&&re<=ge;){const Ce=R[me],Ee=z[ge]=ue?On(z[ge]):zt(z[ge]);if(Pr(Ce,Ee))g(Ce,Ee,oe,null,le,Y,ie,se,ue);else break;me--,ge--}if(re>me){if(re<=ge){const Ce=ge+1,Ee=Ce<pe?z[Ce].el:ce;for(;re<=ge;)g(null,z[re]=ue?On(z[re]):zt(z[re]),oe,Ee,le,Y,ie,se,ue),re++}}else if(re>ge)for(;re<=me;)P(R[re],le,Y,!0),re++;else{const Ce=re,Ee=re,we=new Map;for(re=Ee;re<=ge;re++){const it=z[re]=ue?On(z[re]):zt(z[re]);it.key!=null&&we.set(it.key,re)}let je,Se=0;const Ke=ge-Ee+1;let Dt=!1,ur=0;const Bt=new Array(Ke);for(re=0;re<Ke;re++)Bt[re]=0;for(re=Ce;re<=me;re++){const it=R[re];if(Se>=Ke){P(it,le,Y,!0);continue}let st;if(it.key!=null)st=we.get(it.key);else for(je=Ee;je<=ge;je++)if(Bt[je-Ee]===0&&Pr(it,z[je])){st=je;break}st===void 0?P(it,le,Y,!0):(Bt[st-Ee]=re+1,st>=ur?ur=st:Dt=!0,g(it,z[st],oe,null,le,Y,ie,se,ue),Se++)}const ln=Dt?Cd(Bt):Qn;for(je=ln.length-1,re=Ke-1;re>=0;re--){const it=Ee+re,st=z[it],Jt=it+1<pe?z[it+1].el:ce;Bt[re]===0?g(null,st,oe,Jt,le,Y,ie,se,ue):Dt&&(je<0||re!==ln[je]?O(st,oe,Jt,2):je--)}}},O=(R,z,oe,ce,le=null)=>{const{el:Y,type:ie,transition:se,children:ue,shapeFlag:re}=R;if(re&6){O(R.component.subTree,z,oe,ce);return}if(re&128){R.suspense.move(z,oe,ce);return}if(re&64){ie.move(R,z,oe,$);return}if(ie===Oe){r(Y,z,oe);for(let me=0;me<ue.length;me++)O(ue[me],z,oe,ce);r(R.anchor,z,oe);return}if(ie===Ai){C(R,z,oe);return}if(ce!==2&&re&1&&se)if(ce===0)se.beforeEnter(Y),r(Y,z,oe),_t(()=>se.enter(Y),le);else{const{leave:me,delayLeave:ge,afterLeave:Ce}=se,Ee=()=>r(Y,z,oe),we=()=>{me(Y,()=>{Ee(),Ce&&Ce()})};ge?ge(Y,Ee,we):we()}else r(Y,z,oe)},P=(R,z,oe,ce=!1,le=!1)=>{const{type:Y,props:ie,ref:se,children:ue,dynamicChildren:re,shapeFlag:pe,patchFlag:me,dirs:ge}=R;if(se!=null&&sa(se,null,oe,R,!0),pe&256){z.ctx.deactivate(R);return}const Ce=pe&1&&ge,Ee=!Sr(R);let we;if(Ee&&(we=ie&&ie.onVnodeBeforeUnmount)&&Kt(we,z,R),pe&6)Q(R.component,oe,ce);else{if(pe&128){R.suspense.unmount(oe,ce);return}Ce&&Dn(R,null,z,"beforeUnmount"),pe&64?R.type.remove(R,z,oe,le,$,ce):re&&(Y!==Oe||me>0&&me&64)?B(re,z,oe,!1,!0):(Y===Oe&&me&384||!le&&pe&16)&&B(ue,z,oe),ce&&M(R)}(Ee&&(we=ie&&ie.onVnodeUnmounted)||Ce)&&_t(()=>{we&&Kt(we,z,R),Ce&&Dn(R,null,z,"unmounted")},oe)},M=R=>{const{type:z,el:oe,anchor:ce,transition:le}=R;if(z===Oe){Z(oe,ce);return}if(z===Ai){y(R);return}const Y=()=>{i(oe),le&&!le.persisted&&le.afterLeave&&le.afterLeave()};if(R.shapeFlag&1&&le&&!le.persisted){const{leave:ie,delayLeave:se}=le,ue=()=>ie(oe,Y);se?se(R.el,Y,ue):ue()}else Y()},Z=(R,z)=>{let oe;for(;R!==z;)oe=u(R),i(R),R=oe;i(z)},Q=(R,z,oe)=>{const{bum:ce,scope:le,update:Y,subTree:ie,um:se}=R;ce&&li(ce),le.stop(),Y&&(Y.active=!1,P(ie,R,z,oe)),se&&_t(se,z),_t(()=>{R.isUnmounted=!0},z),z&&z.pendingBranch&&!z.isUnmounted&&R.asyncDep&&!R.asyncResolved&&R.suspenseId===z.pendingId&&(z.deps--,z.deps===0&&z.resolve())},B=(R,z,oe,ce=!1,le=!1,Y=0)=>{for(let ie=Y;ie<R.length;ie++)P(R[ie],z,oe,ce,le)},U=R=>R.shapeFlag&6?U(R.component.subTree):R.shapeFlag&128?R.suspense.next():u(R.anchor||R.el);let D=!1;const q=(R,z,oe)=>{R==null?z._vnode&&P(z._vnode,null,null,!0):g(z._vnode||null,R,z,null,null,null,oe),D||(D=!0,pl(),ml(),D=!1),z._vnode=R},$={p:g,um:P,m:O,r:M,mt:V,mc:S,pc:fe,pbc:T,n:U,o:e};let H,J;return t&&([H,J]=t($)),{render:q,hydrate:H,createApp:fd(q,H)}}function la({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Bn({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function bd(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ul(e,t,n=!1){const r=e.children,i=t.children;if(ke(r)&&ke(i))for(let o=0;o<r.length;o++){const a=r[o];let s=i[o];s.shapeFlag&1&&!s.dynamicChildren&&((s.patchFlag<=0||s.patchFlag===32)&&(s=i[o]=On(i[o]),s.el=a.el),n||Ul(a,s)),s.type===Ii&&(s.el=a.el)}}function Cd(e){const t=e.slice(),n=[0];let r,i,o,a,s;const l=e.length;for(r=0;r<l;r++){const p=e[r];if(p!==0){if(i=n[n.length-1],e[i]<p){t[r]=i,n.push(r);continue}for(o=0,a=n.length-1;o<a;)s=o+a>>1,e[n[s]]<p?o=s+1:a=s;p<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,a=n[o-1];o-- >0;)n[o]=a,a=t[a];return n}function zl(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:zl(t)}const wd=e=>e.__isTeleport,Oe=Symbol.for("v-fgt"),Ii=Symbol.for("v-txt"),En=Symbol.for("v-cmt"),Ai=Symbol.for("v-stc"),Tr=[];let Lt=null;function X(e=!1){Tr.push(Lt=e?null:[])}function xd(){Tr.pop(),Lt=Tr[Tr.length-1]||null}let Nr=1;function Kl(e){Nr+=e}function Zl(e){return e.dynamicChildren=Nr>0?Lt||Qn:null,xd(),Nr>0&&Lt&&Lt.push(e),e}function ne(e,t,n,r,i,o){return Zl(b(e,t,n,r,i,o,!0))}function Te(e,t,n,r,i){return Zl(_e(e,t,n,r,i,!0))}function Ti(e){return e?e.__v_isVNode===!0:!1}function Pr(e,t){return e.type===t.type&&e.key===t.key}const Ni="__vInternal",Ql=({key:e})=>e??null,Pi=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Qe(e)||Je(e)||Ne(e)?{i:We,r:e,k:t,f:!!n}:e:null);function b(e,t=null,n=null,r=0,i=null,o=e===Oe?0:1,a=!1,s=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ql(t),ref:t&&Pi(t),scopeId:Ci,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:We};return s?(ca(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=Qe(n)?8:16),Nr>0&&!a&&Lt&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Lt.push(l),l}const _e=kd;function kd(e,t=null,n=null,r=0,i=null,o=!1){if((!e||e===_l)&&(e=En),Ti(e)){const s=nr(e,t,!0);return n&&ca(s,n),Nr>0&&!o&&Lt&&(s.shapeFlag&6?Lt[Lt.indexOf(e)]=s:Lt.push(s)),s.patchFlag|=-2,s}if(qd(e)&&(e=e.__vccOpts),t){t=Ed(t);let{class:s,style:l}=t;s&&!Qe(s)&&(t.class=Ie(s)),Ue(l)&&(ll(l)&&!ke(l)&&(l=et({},l)),t.style=tt(l))}const a=Qe(e)?1:Uf(e)?128:wd(e)?64:Ue(e)?4:Ne(e)?2:0;return b(e,t,n,r,i,a,o,!0)}function Ed(e){return e?ll(e)||Ni in e?et({},e):e:null}function nr(e,t,n=!1){const{props:r,ref:i,patchFlag:o,children:a}=e,s=t?ua(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:s,key:s&&Ql(s),ref:t&&t.ref?n&&i?ke(i)?i.concat(Pi(t)):[i,Pi(t)]:Pi(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Oe?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&nr(e.ssContent),ssFallback:e.ssFallback&&nr(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Fe(e=" ",t=0){return _e(Ii,null,e,t)}function Lr(e,t){const n=_e(Ai,null,e);return n.staticCount=t,n}function ye(e="",t=!1){return t?(X(),Te(En,null,e)):_e(En,null,e)}function zt(e){return e==null||typeof e=="boolean"?_e(En):ke(e)?_e(Oe,null,e.slice()):typeof e=="object"?On(e):_e(Ii,null,String(e))}function On(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:nr(e)}function ca(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(ke(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),ca(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!(Ni in t)?t._ctx=We:i===3&&We&&(We.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ne(t)?(t={default:t,_ctx:We},n=32):(t=String(t),r&64?(n=16,t=[Fe(t)]):n=8);e.children=t,e.shapeFlag|=n}function ua(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const i in r)if(i==="class")t.class!==r.class&&(t.class=Ie([t.class,r.class]));else if(i==="style")t.style=tt([t.style,r.style]);else if(oi(i)){const o=t[i],a=r[i];a&&o!==a&&!(ke(o)&&o.includes(a))&&(t[i]=o?[].concat(o,a):a)}else i!==""&&(t[i]=r[i])}return t}function Kt(e,t,n,r=null){Pt(e,t,7,[n,r])}const Od=Ll();let Sd=0;function Id(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||Od,o={uid:Sd++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new $s(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:ql(r,i),emitsOptions:vl(r,i),emit:null,emitted:null,propsDefaults:He,inheritAttrs:r.inheritAttrs,ctx:He,data:He,props:He,attrs:He,slots:He,refs:He,setupState:He,setupContext:null,attrsProxy:null,slotsProxy:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=jf.bind(null,o),e.ce&&e.ce(o),o}let rt=null;const Ad=()=>rt||We;let Li,fa;{const e=js(),t=(n,r)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(r),o=>{i.length>1?i.forEach(a=>a(o)):i[0](o)}};Li=t("__VUE_INSTANCE_SETTERS__",n=>rt=n),fa=t("__VUE_SSR_SETTERS__",n=>Ri=n)}const Rr=e=>{const t=rt;return Li(e),e.scope.on(),()=>{e.scope.off(),Li(t)}},Xl=()=>{rt&&rt.scope.off(),Li(null)};function Jl(e){return e.vnode.shapeFlag&4}let Ri=!1;function Td(e,t=!1){t&&fa(t);const{props:n,children:r}=e.vnode,i=Jl(e);hd(e,n,i,t),gd(e,r);const o=i?Nd(e,t):void 0;return t&&fa(!1),o}function Nd(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=yi(new Proxy(e.ctx,id));const{setup:r}=n;if(r){const i=e.setupContext=r.length>1?Ld(e):null,o=Rr(e);gn();const a=nn(r,e,0,[e.props,i]);if(vn(),o(),Ps(a)){if(a.then(Xl,Xl),t)return a.then(s=>{Wl(e,s,t)}).catch(s=>{_i(s,e,0)});e.asyncDep=a}else Wl(e,a,t)}else Yl(e,t)}function Wl(e,t,n){Ne(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ue(t)&&(e.setupState=ul(t)),Yl(e,n)}let Gl;function Yl(e,t,n){const r=e.type;if(!e.render){if(!t&&Gl&&!r.render){const i=r.template||ra(e).template;if(i){const{isCustomElement:o,compilerOptions:a}=e.appContext.config,{delimiters:s,compilerOptions:l}=r,p=et(et({isCustomElement:o,delimiters:s},a),l);r.render=Gl(i,p)}}e.render=r.render||It}{const i=Rr(e);gn();try{od(e)}finally{vn(),i()}}}function Pd(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,n){return yt(e,"get","$attrs"),t[n]}}))}function Ld(e){const t=n=>{e.exposed=n||{}};return{get attrs(){return Pd(e)},slots:e.slots,emit:e.emit,expose:t}}function Mi(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(ul(yi(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ir)return Ir[n](e)},has(t,n){return n in t||n in Ir}}))}const Rd=/(?:^|[-_])(\w)/g,Md=e=>e.replace(Rd,t=>t.toUpperCase()).replace(/[-_]/g,"");function ec(e,t=!0){return Ne(e)?e.displayName||e.name:e.name||t&&e.__name}function tc(e,t,n=!1){let r=ec(t);if(!r&&t.__file){const i=t.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&e&&e.parent){const i=o=>{for(const a in o)if(o[a]===t)return a};r=i(e.components||e.parent.type.components)||i(e.appContext.components)}return r?Md(r):n?"App":"Anonymous"}function qd(e){return Ne(e)&&"__vccOpts"in e}const be=(e,t)=>_f(e,t,Ri);function jd(e,t,n=He){const r=Ad(),i=vt(t),o=Et(t),a=kf((l,p)=>{let c;return Qf(()=>{const f=e[t];Vt(c,f)&&(c=f,p())}),{get(){return l(),n.get?n.get(c):c},set(f){const u=r.vnode.props;!(u&&(t in u||i in u||o in u)&&(`onUpdate:${t}`in u||`onUpdate:${i}`in u||`onUpdate:${o}`in u))&&Vt(f,c)&&(c=f,p()),r.emit(`update:${t}`,n.set?n.set(f):f)}}}),s=t==="modelValue"?"modelModifiers":`${t}Modifiers`;return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?e[s]||{}:a,done:!1}:{done:!0}}}},a}function Dd(e,t,n){const r=arguments.length;return r===2?Ue(t)&&!ke(t)?Ti(t)?_e(e,null,[t]):_e(e,t):_e(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ti(n)&&(n=[n]),_e(e,t,n))}const Bd="3.4.21";/**
|
|
16
|
+
`],...Tf(n))}),t}function Tf({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,i=` at <${tc(e.component,e.type,r)}`,o=">"+n;return e.props?[i,...Nf(e.props),o]:[i+o]}function Nf(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...fl(r,e[r]))}),n.length>3&&t.push(" ..."),t}function fl(e,t,n){return Qe(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:Je(t)?(t=fl(e,Le(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Ne(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=Le(t),n?t:[`${e}=`,t])}function nn(e,t,n,r){try{return r?e(...r):e()}catch(i){_i(i,t,n)}}function Pt(e,t,n,r){if(Ne(e)){const o=nn(e,t,n,r);return o&&Ps(o)&&o.catch(a=>{_i(a,t,n)}),o}const i=[];for(let o=0;o<e.length;o++)i.push(Pt(e[o],t,n,r));return i}function _i(e,t,n,r=!0){const i=t?t.vnode:null;if(t){let o=t.parent;const a=t.proxy,s=`https://vuejs.org/error-reference/#runtime-${n}`;for(;o;){const p=o.ec;if(p){for(let c=0;c<p.length;c++)if(p[c](e,a,s)===!1)return}o=o.parent}const l=t.appContext.config.errorHandler;if(l){nn(l,null,10,[e,a,s]);return}}Pf(e,n,i,r)}function Pf(e,t,n,r=!0){console.error(e)}let kr=!1,Ko=!1;const ut=[];let Ht=0;const Gn=[];let bn=null,qn=0;const dl=Promise.resolve();let Zo=null;function Ut(e){const t=Zo||dl;return e?t.then(this?e.bind(this):e):t}function Lf(e){let t=Ht+1,n=ut.length;for(;t<n;){const r=t+n>>>1,i=ut[r],o=Er(i);o<e||o===e&&i.pre?t=r+1:n=r}return t}function Qo(e){(!ut.length||!ut.includes(e,kr&&e.allowRecurse?Ht+1:Ht))&&(e.id==null?ut.push(e):ut.splice(Lf(e.id),0,e),hl())}function hl(){!kr&&!Ko&&(Ko=!0,Zo=dl.then(gl))}function Rf(e){const t=ut.indexOf(e);t>Ht&&ut.splice(t,1)}function Mf(e){ke(e)?Gn.push(...e):(!bn||!bn.includes(e,e.allowRecurse?qn+1:qn))&&Gn.push(e),hl()}function pl(e,t,n=kr?Ht+1:0){for(;n<ut.length;n++){const r=ut[n];if(r&&r.pre){if(e&&r.id!==e.uid)continue;ut.splice(n,1),n--,r()}}}function ml(e){if(Gn.length){const t=[...new Set(Gn)].sort((n,r)=>Er(n)-Er(r));if(Gn.length=0,bn){bn.push(...t);return}for(bn=t,qn=0;qn<bn.length;qn++)bn[qn]();bn=null,qn=0}}const Er=e=>e.id==null?1/0:e.id,qf=(e,t)=>{const n=Er(e)-Er(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function gl(e){Ko=!1,kr=!0,ut.sort(qf);try{for(Ht=0;Ht<ut.length;Ht++){const t=ut[Ht];t&&t.active!==!1&&nn(t,null,14)}}finally{Ht=0,ut.length=0,ml(),kr=!1,Zo=null,(ut.length||Gn.length)&&gl()}}function jf(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||He;let i=n;const o=t.startsWith("update:"),a=o&&t.slice(7);if(a&&a in r){const c=`${a==="modelValue"?"model":a}Modifiers`,{number:f,trim:u}=r[c]||He;u&&(i=n.map(m=>Qe(m)?m.trim():m)),f&&(i=n.map(_r))}let s,l=r[s=Po(t)]||r[s=Po(vt(t))];!l&&o&&(l=r[s=Po(Et(t))]),l&&Pt(l,e,6,i);const p=r[s+"Once"];if(p){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,Pt(p,e,6,i)}}function vl(e,t,n=!1){const r=t.emitsCache,i=r.get(e);if(i!==void 0)return i;const o=e.emits;let a={},s=!1;if(!Ne(e)){const l=p=>{const c=vl(p,t,!0);c&&(s=!0,et(a,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!s?(Ue(e)&&r.set(e,null),null):(ke(o)?o.forEach(l=>a[l]=null):et(a,o),Ue(e)&&r.set(e,a),a)}function bi(e,t){return!e||!oi(t)?!1:(t=t.slice(2).replace(/Once$/,""),Me(e,t[0].toLowerCase()+t.slice(1))||Me(e,Et(t))||Me(e,t))}let We=null,Ci=null;function wi(e){const t=We;return We=e,Ci=e&&e.type.__scopeId||null,t}function Yn(e){Ci=e}function er(){Ci=null}function De(e,t=We,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&Kl(-1);const o=wi(t);let a;try{a=e(...i)}finally{wi(o),r._d&&Kl(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function b8(){}function Xo(e){const{type:t,vnode:n,proxy:r,withProxy:i,props:o,propsOptions:[a],slots:s,attrs:l,emit:p,render:c,renderCache:f,data:u,setupState:m,ctx:h,inheritAttrs:g}=e;let d,v;const _=wi(e);try{if(n.shapeFlag&4){const y=i||r,w=y;d=zt(c.call(w,y,f,o,m,u,h)),v=l}else{const y=t;d=zt(y.length>1?y(o,{attrs:l,slots:s,emit:p}):y(o,null)),v=t.props?l:Df(l)}}catch(y){Tr.length=0,_i(y,e,1),d=_e(En)}let C=d;if(v&&g!==!1){const y=Object.keys(v),{shapeFlag:w}=C;y.length&&w&7&&(a&&y.some(Ao)&&(v=Bf(v,a)),C=nr(C,v))}return n.dirs&&(C=nr(C),C.dirs=C.dirs?C.dirs.concat(n.dirs):n.dirs),n.transition&&(C.transition=n.transition),d=C,wi(_),d}const Df=e=>{let t;for(const n in e)(n==="class"||n==="style"||oi(n))&&((t||(t={}))[n]=e[n]);return t},Bf=(e,t)=>{const n={};for(const r in e)(!Ao(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function $f(e,t,n){const{props:r,children:i,component:o}=e,{props:a,children:s,patchFlag:l}=t,p=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?yl(r,a,p):!!a;if(l&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const u=c[f];if(a[u]!==r[u]&&!bi(p,u))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===a?!1:r?a?yl(r,a,p):!0:!!a;return!1}function yl(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){const o=r[i];if(t[o]!==e[o]&&!bi(n,o))return!0}return!1}function Ff({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r===e)(e=t.vnode).el=n,t=t.parent;else break}}const Jo="components",Vf="directives";function Or(e,t){return Wo(Jo,e,!0,t)||e}const _l=Symbol.for("v-ndc");function bl(e){return Qe(e)?Wo(Jo,e,!1)||e:e||_l}function Hf(e){return Wo(Vf,e)}function Wo(e,t,n=!0,r=!1){const i=We||rt;if(i){const o=i.type;if(e===Jo){const s=ec(o,!1);if(s&&(s===t||s===vt(t)||s===si(vt(t))))return o}const a=Cl(i[e]||o[e],t)||Cl(i.appContext[e],t);return!a&&r?o:a}}function Cl(e,t){return e&&(e[t]||e[vt(t)]||e[si(vt(t))])}const Uf=e=>e.__isSuspense;function zf(e,t){t&&t.pendingBranch?ke(e)?t.effects.push(...e):t.effects.push(e):Mf(e)}const Kf=Symbol.for("v-scx"),Zf=()=>kn(Kf);function Qf(e,t){return Go(e,null,{flush:"sync"})}const xi={};function St(e,t,n){return Go(e,t,n)}function Go(e,t,{immediate:n,deep:r,flush:i,once:o,onTrack:a,onTrigger:s}=He){if(t&&o){const A=t;t=(...I)=>{A(...I),w()}}const l=rt,p=A=>r===!0?A:jn(A,r===!1?1:void 0);let c,f=!1,u=!1;if(Je(e)?(c=()=>e.value,f=vi(e)):_n(e)?(c=()=>p(e),f=!0):ke(e)?(u=!0,f=e.some(A=>_n(A)||vi(A)),c=()=>e.map(A=>{if(Je(A))return A.value;if(_n(A))return p(A);if(Ne(A))return nn(A,l,2)})):Ne(e)?t?c=()=>nn(e,l,2):c=()=>(m&&m(),Pt(e,l,3,[h])):c=It,t&&r){const A=c;c=()=>jn(A())}let m,h=A=>{m=C.onStop=()=>{nn(A,l,4),m=C.onStop=void 0}},g;if(Ri)if(h=It,t?n&&Pt(t,l,3,[c(),u?[]:void 0,h]):c(),i==="sync"){const A=Zf();g=A.__watcherHandles||(A.__watcherHandles=[])}else return It;let d=u?new Array(e.length).fill(xi):xi;const v=()=>{if(!(!C.active||!C.dirty))if(t){const A=C.run();(r||f||(u?A.some((I,S)=>Vt(I,d[S])):Vt(A,d)))&&(m&&m(),Pt(t,l,3,[A,d===xi?void 0:u&&d[0]===xi?[]:d,h]),d=A)}else C.run()};v.allowRecurse=!!t;let _;i==="sync"?_=v:i==="post"?_=()=>_t(v,l&&l.suspense):(v.pre=!0,l&&(v.id=l.uid),_=()=>Qo(v));const C=new Mo(c,It,_),y=Vs(),w=()=>{C.stop(),y&&To(y.effects,C)};return t?n?v():d=C.run():i==="post"?_t(C.run.bind(C),l&&l.suspense):C.run(),g&&g.push(w),w}function Xf(e,t,n){const r=this.proxy,i=Qe(e)?e.includes(".")?wl(r,e):()=>r[e]:e.bind(r,r);let o;Ne(t)?o=t:(o=t.handler,n=t);const a=Rr(this),s=Go(i,o.bind(r),n);return a(),s}function wl(e,t){const n=t.split(".");return()=>{let r=e;for(let i=0;i<n.length&&r;i++)r=r[n[i]];return r}}function jn(e,t,n=0,r){if(!Ue(e)||e.__v_skip)return e;if(t&&t>0){if(n>=t)return e;n++}if(r=r||new Set,r.has(e))return e;if(r.add(e),Je(e))jn(e.value,t,n,r);else if(ke(e))for(let i=0;i<e.length;i++)jn(e[i],t,n,r);else if(Jn(e)||Xn(e))e.forEach(i=>{jn(i,t,n,r)});else if(Rs(e))for(const i in e)jn(e[i],t,n,r);return e}function Cn(e,t){if(We===null)return e;const n=Mi(We)||We.proxy,r=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[o,a,s,l=He]=t[i];o&&(Ne(o)&&(o={mounted:o,updated:o}),o.deep&&jn(a),r.push({dir:o,instance:n,value:a,oldValue:void 0,arg:s,modifiers:l}))}return e}function Dn(e,t,n,r){const i=e.dirs,o=t&&t.dirs;for(let a=0;a<i.length;a++){const s=i[a];o&&(s.oldValue=o[a].value);let l=s.dir[r];l&&(gn(),Pt(l,n,8,[e.el,s,e,t]),vn())}}/*! #__NO_SIDE_EFFECTS__ */function xl(e,t){return Ne(e)?et({name:e.name},t,{setup:e}):e}const Sr=e=>!!e.type.__asyncLoader,kl=e=>e.type.__isKeepAlive;function Jf(e,t){El(e,"a",t)}function Wf(e,t){El(e,"da",t)}function El(e,t,n=rt){const r=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(ki(t,r,n),n){let i=n.parent;for(;i&&i.parent;)kl(i.parent.vnode)&&Gf(r,t,n,i),i=i.parent}}function Gf(e,t,n,r){const i=ki(t,e,r,!0);Yo(()=>{To(r[t],i)},n)}function ki(e,t,n=rt,r=!1){if(n){const i=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...a)=>{if(n.isUnmounted)return;gn();const s=Rr(n),l=Pt(t,n,e,a);return s(),vn(),l});return r?i.unshift(o):i.push(o),o}}const rn=e=>(t,n=rt)=>(!Ri||e==="sp")&&ki(e,(...r)=>t(...r),n),wn=rn("bm"),xn=rn("m"),Ol=rn("bu"),Yf=rn("u"),Ei=rn("bum"),Yo=rn("um"),ed=rn("sp"),td=rn("rtg"),nd=rn("rtc");function rd(e,t=rt){ki("ec",e,t)}function ze(e,t,n,r){let i;const o=n&&n[r];if(ke(e)||Qe(e)){i=new Array(e.length);for(let a=0,s=e.length;a<s;a++)i[a]=t(e[a],a,void 0,o&&o[a])}else if(typeof e=="number"){i=new Array(e);for(let a=0;a<e;a++)i[a]=t(a+1,a,void 0,o&&o[a])}else if(Ue(e))if(e[Symbol.iterator])i=Array.from(e,(a,s)=>t(a,s,void 0,o&&o[s]));else{const a=Object.keys(e);i=new Array(a.length);for(let s=0,l=a.length;s<l;s++){const p=a[s];i[s]=t(e[p],p,s,o&&o[s])}}else i=[];return n&&(n[r]=i),i}function Ze(e,t,n={},r,i){if(We.isCE||We.parent&&Sr(We.parent)&&We.parent.isCE)return t!=="default"&&(n.name=t),_e("slot",n,r&&r());let o=e[t];o&&o._c&&(o._d=!1),X();const a=o&&Sl(o(n)),s=Te(Oe,{key:n.key||a&&a.key||`_${t}`},a||(r?r():[]),a&&e._===1?64:-2);return!i&&s.scopeId&&(s.slotScopeIds=[s.scopeId+"-s"]),o&&o._c&&(o._d=!0),s}function Sl(e){return e.some(t=>Ti(t)?!(t.type===En||t.type===Oe&&!Sl(t.children)):!0)?e:null}const ea=e=>e?Jl(e)?Mi(e)||e.proxy:ea(e.parent):null,Ir=et(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ea(e.parent),$root:e=>ea(e.root),$emit:e=>e.emit,$options:e=>ra(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Qo(e.update)}),$nextTick:e=>e.n||(e.n=Ut.bind(e.proxy)),$watch:e=>Xf.bind(e)}),ta=(e,t)=>e!==He&&!e.__isScriptSetup&&Me(e,t),id={get({_:e},t){const{ctx:n,setupState:r,data:i,props:o,accessCache:a,type:s,appContext:l}=e;let p;if(t[0]!=="$"){const m=a[t];if(m!==void 0)switch(m){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return o[t]}else{if(ta(r,t))return a[t]=1,r[t];if(i!==He&&Me(i,t))return a[t]=2,i[t];if((p=e.propsOptions[0])&&Me(p,t))return a[t]=3,o[t];if(n!==He&&Me(n,t))return a[t]=4,n[t];na&&(a[t]=0)}}const c=Ir[t];let f,u;if(c)return t==="$attrs"&&yt(e,"get",t),c(e);if((f=s.__cssModules)&&(f=f[t]))return f;if(n!==He&&Me(n,t))return a[t]=4,n[t];if(u=l.config.globalProperties,Me(u,t))return u[t]},set({_:e},t,n){const{data:r,setupState:i,ctx:o}=e;return ta(i,t)?(i[t]=n,!0):r!==He&&Me(r,t)?(r[t]=n,!0):Me(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,propsOptions:o}},a){let s;return!!n[a]||e!==He&&Me(e,a)||ta(t,a)||(s=o[0])&&Me(s,a)||Me(r,a)||Me(Ir,a)||Me(i.config.globalProperties,a)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Me(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Oi(e){return ke(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Il(e,t){return!e||!t?e||t:ke(e)&&ke(t)?e.concat(t):et({},Oi(e),Oi(t))}let na=!0;function od(e){const t=ra(e),n=e.proxy,r=e.ctx;na=!1,t.beforeCreate&&Al(t.beforeCreate,e,"bc");const{data:i,computed:o,methods:a,watch:s,provide:l,inject:p,created:c,beforeMount:f,mounted:u,beforeUpdate:m,updated:h,activated:g,deactivated:d,beforeDestroy:v,beforeUnmount:_,destroyed:C,unmounted:y,render:w,renderTracked:A,renderTriggered:I,errorCaptured:S,serverPrefetch:N,expose:T,inheritAttrs:k,components:E,directives:L,filters:V}=t;if(p&&ad(p,r,null),a)for(const te in a){const fe=a[te];Ne(fe)&&(r[te]=fe.bind(n))}if(i){const te=i.call(n,n);Ue(te)&&(e.data=br(te))}if(na=!0,o)for(const te in o){const fe=o[te],ee=Ne(fe)?fe.bind(n,n):Ne(fe.get)?fe.get.bind(n,n):It,j=!Ne(fe)&&Ne(fe.set)?fe.set.bind(n):It,O=be({get:ee,set:j});Object.defineProperty(r,te,{enumerable:!0,configurable:!0,get:()=>O.value,set:P=>O.value=P})}if(s)for(const te in s)Tl(s[te],r,n,te);if(l){const te=Ne(l)?l.call(n):l;Reflect.ownKeys(te).forEach(fe=>{dd(fe,te[fe])})}c&&Al(c,e,"c");function W(te,fe){ke(fe)?fe.forEach(ee=>te(ee.bind(n))):fe&&te(fe.bind(n))}if(W(wn,f),W(xn,u),W(Ol,m),W(Yf,h),W(Jf,g),W(Wf,d),W(rd,S),W(nd,A),W(td,I),W(Ei,_),W(Yo,y),W(ed,N),ke(T))if(T.length){const te=e.exposed||(e.exposed={});T.forEach(fe=>{Object.defineProperty(te,fe,{get:()=>n[fe],set:ee=>n[fe]=ee})})}else e.exposed||(e.exposed={});w&&e.render===It&&(e.render=w),k!=null&&(e.inheritAttrs=k),E&&(e.components=E),L&&(e.directives=L)}function ad(e,t,n=It){ke(e)&&(e=ia(e));for(const r in e){const i=e[r];let o;Ue(i)?"default"in i?o=kn(i.from||r,i.default,!0):o=kn(i.from||r):o=kn(i),Je(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:a=>o.value=a}):t[r]=o}}function Al(e,t,n){Pt(ke(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Tl(e,t,n,r){const i=r.includes(".")?wl(n,r):()=>n[r];if(Qe(e)){const o=t[e];Ne(o)&&St(i,o)}else if(Ne(e))St(i,e.bind(n));else if(Ue(e))if(ke(e))e.forEach(o=>Tl(o,t,n,r));else{const o=Ne(e.handler)?e.handler.bind(n):t[e.handler];Ne(o)&&St(i,o,e)}}function ra(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:o,config:{optionMergeStrategies:a}}=e.appContext,s=o.get(t);let l;return s?l=s:!i.length&&!n&&!r?l=t:(l={},i.length&&i.forEach(p=>Si(l,p,a,!0)),Si(l,t,a)),Ue(t)&&o.set(t,l),l}function Si(e,t,n,r=!1){const{mixins:i,extends:o}=t;o&&Si(e,o,n,!0),i&&i.forEach(a=>Si(e,a,n,!0));for(const a in t)if(!(r&&a==="expose")){const s=sd[a]||n&&n[a];e[a]=s?s(e[a],t[a]):t[a]}return e}const sd={data:Nl,props:Pl,emits:Pl,methods:Ar,computed:Ar,beforeCreate:mt,created:mt,beforeMount:mt,mounted:mt,beforeUpdate:mt,updated:mt,beforeDestroy:mt,beforeUnmount:mt,destroyed:mt,unmounted:mt,activated:mt,deactivated:mt,errorCaptured:mt,serverPrefetch:mt,components:Ar,directives:Ar,watch:cd,provide:Nl,inject:ld};function Nl(e,t){return t?e?function(){return et(Ne(e)?e.call(this,this):e,Ne(t)?t.call(this,this):t)}:t:e}function ld(e,t){return Ar(ia(e),ia(t))}function ia(e){if(ke(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function mt(e,t){return e?[...new Set([].concat(e,t))]:t}function Ar(e,t){return e?et(Object.create(null),e,t):t}function Pl(e,t){return e?ke(e)&&ke(t)?[...new Set([...e,...t])]:et(Object.create(null),Oi(e),Oi(t??{})):t}function cd(e,t){if(!e)return t;if(!t)return e;const n=et(Object.create(null),e);for(const r in t)n[r]=mt(e[r],t[r]);return n}function Ll(){return{app:null,config:{isNativeTag:Du,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let ud=0;function fd(e,t){return function(r,i=null){Ne(r)||(r=et({},r)),i!=null&&!Ue(i)&&(i=null);const o=Ll(),a=new WeakSet;let s=!1;const l=o.app={_uid:ud++,_component:r,_props:i,_container:null,_context:o,_instance:null,version:Bd,get config(){return o.config},set config(p){},use(p,...c){return a.has(p)||(p&&Ne(p.install)?(a.add(p),p.install(l,...c)):Ne(p)&&(a.add(p),p(l,...c))),l},mixin(p){return o.mixins.includes(p)||o.mixins.push(p),l},component(p,c){return c?(o.components[p]=c,l):o.components[p]},directive(p,c){return c?(o.directives[p]=c,l):o.directives[p]},mount(p,c,f){if(!s){const u=_e(r,i);return u.appContext=o,f===!0?f="svg":f===!1&&(f=void 0),c&&t?t(u,p):e(u,p,f),s=!0,l._container=p,p.__vue_app__=l,Mi(u.component)||u.component.proxy}},unmount(){s&&(e(null,l._container),delete l._container.__vue_app__)},provide(p,c){return o.provides[p]=c,l},runWithContext(p){const c=tr;tr=l;try{return p()}finally{tr=c}}};return l}}let tr=null;function dd(e,t){if(rt){let n=rt.provides;const r=rt.parent&&rt.parent.provides;r===n&&(n=rt.provides=Object.create(r)),n[e]=t}}function kn(e,t,n=!1){const r=rt||We;if(r||tr){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:tr._context.provides;if(i&&e in i)return i[e];if(arguments.length>1)return n&&Ne(t)?t.call(r&&r.proxy):t}}function Rl(){return!!(rt||We||tr)}function hd(e,t,n,r=!1){const i={},o={};ci(o,Ni,1),e.propsDefaults=Object.create(null),Ml(e,t,i,o);for(const a in e.propsOptions[0])a in i||(i[a]=void 0);n?e.props=r?i:yf(i):e.type.props?e.props=i:e.props=o,e.attrs=o}function pd(e,t,n,r){const{props:i,attrs:o,vnode:{patchFlag:a}}=e,s=Le(i),[l]=e.propsOptions;let p=!1;if((r||a>0)&&!(a&16)){if(a&8){const c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let u=c[f];if(bi(e.emitsOptions,u))continue;const m=t[u];if(l)if(Me(o,u))m!==o[u]&&(o[u]=m,p=!0);else{const h=vt(u);i[h]=oa(l,s,h,m,e,!1)}else m!==o[u]&&(o[u]=m,p=!0)}}}else{Ml(e,t,i,o)&&(p=!0);let c;for(const f in s)(!t||!Me(t,f)&&((c=Et(f))===f||!Me(t,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(i[f]=oa(l,s,f,void 0,e,!0)):delete i[f]);if(o!==s)for(const f in o)(!t||!Me(t,f))&&(delete o[f],p=!0)}p&&tn(e,"set","$attrs")}function Ml(e,t,n,r){const[i,o]=e.propsOptions;let a=!1,s;if(t)for(let l in t){if(yr(l))continue;const p=t[l];let c;i&&Me(i,c=vt(l))?!o||!o.includes(c)?n[c]=p:(s||(s={}))[c]=p:bi(e.emitsOptions,l)||(!(l in r)||p!==r[l])&&(r[l]=p,a=!0)}if(o){const l=Le(n),p=s||He;for(let c=0;c<o.length;c++){const f=o[c];n[f]=oa(i,l,f,p[f],e,!Me(p,f))}}return a}function oa(e,t,n,r,i,o){const a=e[n];if(a!=null){const s=Me(a,"default");if(s&&r===void 0){const l=a.default;if(a.type!==Function&&!a.skipFactory&&Ne(l)){const{propsDefaults:p}=i;if(n in p)r=p[n];else{const c=Rr(i);r=p[n]=l.call(null,t),c()}}else r=l}a[0]&&(o&&!s?r=!1:a[1]&&(r===""||r===Et(n))&&(r=!0))}return r}function ql(e,t,n=!1){const r=t.propsCache,i=r.get(e);if(i)return i;const o=e.props,a={},s=[];let l=!1;if(!Ne(e)){const c=f=>{l=!0;const[u,m]=ql(f,t,!0);et(a,u),m&&s.push(...m)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return Ue(e)&&r.set(e,Qn),Qn;if(ke(o))for(let c=0;c<o.length;c++){const f=vt(o[c]);jl(f)&&(a[f]=He)}else if(o)for(const c in o){const f=vt(c);if(jl(f)){const u=o[c],m=a[f]=ke(u)||Ne(u)?{type:u}:et({},u);if(m){const h=$l(Boolean,m.type),g=$l(String,m.type);m[0]=h>-1,m[1]=g<0||h<g,(h>-1||Me(m,"default"))&&s.push(f)}}}const p=[a,s];return Ue(e)&&r.set(e,p),p}function jl(e){return e[0]!=="$"&&!yr(e)}function Dl(e){return e===null?"null":typeof e=="function"?e.name||"":typeof e=="object"&&e.constructor&&e.constructor.name||""}function Bl(e,t){return Dl(e)===Dl(t)}function $l(e,t){return ke(t)?t.findIndex(n=>Bl(n,e)):Ne(t)&&Bl(t,e)?0:-1}const Fl=e=>e[0]==="_"||e==="$stable",aa=e=>ke(e)?e.map(zt):[zt(e)],md=(e,t,n)=>{if(t._n)return t;const r=De((...i)=>aa(t(...i)),n);return r._c=!1,r},Vl=(e,t,n)=>{const r=e._ctx;for(const i in e){if(Fl(i))continue;const o=e[i];if(Ne(o))t[i]=md(i,o,r);else if(o!=null){const a=aa(o);t[i]=()=>a}}},Hl=(e,t)=>{const n=aa(t);e.slots.default=()=>n},gd=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=Le(t),ci(t,"_",n)):Vl(t,e.slots={})}else e.slots={},t&&Hl(e,t);ci(e.slots,Ni,1)},vd=(e,t,n)=>{const{vnode:r,slots:i}=e;let o=!0,a=He;if(r.shapeFlag&32){const s=t._;s?n&&s===1?o=!1:(et(i,t),!n&&s===1&&delete i._):(o=!t.$stable,Vl(t,i)),a=t}else t&&(Hl(e,t),a={default:1});if(o)for(const s in i)!Fl(s)&&a[s]==null&&delete i[s]};function sa(e,t,n,r,i=!1){if(ke(e)){e.forEach((u,m)=>sa(u,t&&(ke(t)?t[m]:t),n,r,i));return}if(Sr(r)&&!i)return;const o=r.shapeFlag&4?Mi(r.component)||r.component.proxy:r.el,a=i?null:o,{i:s,r:l}=e,p=t&&t.r,c=s.refs===He?s.refs={}:s.refs,f=s.setupState;if(p!=null&&p!==l&&(Qe(p)?(c[p]=null,Me(f,p)&&(f[p]=null)):Je(p)&&(p.value=null)),Ne(l))nn(l,s,12,[a,c]);else{const u=Qe(l),m=Je(l);if(u||m){const h=()=>{if(e.f){const g=u?Me(f,l)?f[l]:c[l]:l.value;i?ke(g)&&To(g,o):ke(g)?g.includes(o)||g.push(o):u?(c[l]=[o],Me(f,l)&&(f[l]=c[l])):(l.value=[o],e.k&&(c[e.k]=l.value))}else u?(c[l]=a,Me(f,l)&&(f[l]=a)):m&&(l.value=a,e.k&&(c[e.k]=a))};a?(h.id=-1,_t(h,n)):h()}}}const _t=zf;function yd(e){return _d(e)}function _d(e,t){const n=js();n.__VUE__=!0;const{insert:r,remove:i,patchProp:o,createElement:a,createText:s,createComment:l,setText:p,setElementText:c,parentNode:f,nextSibling:u,setScopeId:m=It,insertStaticContent:h}=e,g=(R,z,oe,ce=null,le=null,Y=null,ie=void 0,se=null,ue=!!z.dynamicChildren)=>{if(R===z)return;R&&!Pr(R,z)&&(ce=U(R),P(R,le,Y,!0),R=null),z.patchFlag===-2&&(ue=!1,z.dynamicChildren=null);const{type:re,ref:pe,shapeFlag:me}=z;switch(re){case Ii:d(R,z,oe,ce);break;case En:v(R,z,oe,ce);break;case Ai:R==null&&_(z,oe,ce,ie);break;case Oe:E(R,z,oe,ce,le,Y,ie,se,ue);break;default:me&1?w(R,z,oe,ce,le,Y,ie,se,ue):me&6?L(R,z,oe,ce,le,Y,ie,se,ue):(me&64||me&128)&&re.process(R,z,oe,ce,le,Y,ie,se,ue,$)}pe!=null&&le&&sa(pe,R&&R.ref,Y,z||R,!z)},d=(R,z,oe,ce)=>{if(R==null)r(z.el=s(z.children),oe,ce);else{const le=z.el=R.el;z.children!==R.children&&p(le,z.children)}},v=(R,z,oe,ce)=>{R==null?r(z.el=l(z.children||""),oe,ce):z.el=R.el},_=(R,z,oe,ce)=>{[R.el,R.anchor]=h(R.children,z,oe,ce,R.el,R.anchor)},C=({el:R,anchor:z},oe,ce)=>{let le;for(;R&&R!==z;)le=u(R),r(R,oe,ce),R=le;r(z,oe,ce)},y=({el:R,anchor:z})=>{let oe;for(;R&&R!==z;)oe=u(R),i(R),R=oe;i(z)},w=(R,z,oe,ce,le,Y,ie,se,ue)=>{z.type==="svg"?ie="svg":z.type==="math"&&(ie="mathml"),R==null?A(z,oe,ce,le,Y,ie,se,ue):N(R,z,le,Y,ie,se,ue)},A=(R,z,oe,ce,le,Y,ie,se)=>{let ue,re;const{props:pe,shapeFlag:me,transition:ge,dirs:Ce}=R;if(ue=R.el=a(R.type,Y,pe&&pe.is,pe),me&8?c(ue,R.children):me&16&&S(R.children,ue,null,ce,le,la(R,Y),ie,se),Ce&&Dn(R,null,ce,"created"),I(ue,R,R.scopeId,ie,ce),pe){for(const we in pe)we!=="value"&&!yr(we)&&o(ue,we,null,pe[we],Y,R.children,ce,le,B);"value"in pe&&o(ue,"value",null,pe.value,Y),(re=pe.onVnodeBeforeMount)&&Kt(re,ce,R)}Ce&&Dn(R,null,ce,"beforeMount");const Ee=bd(le,ge);Ee&&ge.beforeEnter(ue),r(ue,z,oe),((re=pe&&pe.onVnodeMounted)||Ee||Ce)&&_t(()=>{re&&Kt(re,ce,R),Ee&&ge.enter(ue),Ce&&Dn(R,null,ce,"mounted")},le)},I=(R,z,oe,ce,le)=>{if(oe&&m(R,oe),ce)for(let Y=0;Y<ce.length;Y++)m(R,ce[Y]);if(le){let Y=le.subTree;if(z===Y){const ie=le.vnode;I(R,ie,ie.scopeId,ie.slotScopeIds,le.parent)}}},S=(R,z,oe,ce,le,Y,ie,se,ue=0)=>{for(let re=ue;re<R.length;re++){const pe=R[re]=se?On(R[re]):zt(R[re]);g(null,pe,z,oe,ce,le,Y,ie,se)}},N=(R,z,oe,ce,le,Y,ie)=>{const se=z.el=R.el;let{patchFlag:ue,dynamicChildren:re,dirs:pe}=z;ue|=R.patchFlag&16;const me=R.props||He,ge=z.props||He;let Ce;if(oe&&Bn(oe,!1),(Ce=ge.onVnodeBeforeUpdate)&&Kt(Ce,oe,z,R),pe&&Dn(z,R,oe,"beforeUpdate"),oe&&Bn(oe,!0),re?T(R.dynamicChildren,re,se,oe,ce,la(z,le),Y):ie||fe(R,z,se,null,oe,ce,la(z,le),Y,!1),ue>0){if(ue&16)k(se,z,me,ge,oe,ce,le);else if(ue&2&&me.class!==ge.class&&o(se,"class",null,ge.class,le),ue&4&&o(se,"style",me.style,ge.style,le),ue&8){const Ee=z.dynamicProps;for(let we=0;we<Ee.length;we++){const je=Ee[we],Se=me[je],Ke=ge[je];(Ke!==Se||je==="value")&&o(se,je,Se,Ke,le,R.children,oe,ce,B)}}ue&1&&R.children!==z.children&&c(se,z.children)}else!ie&&re==null&&k(se,z,me,ge,oe,ce,le);((Ce=ge.onVnodeUpdated)||pe)&&_t(()=>{Ce&&Kt(Ce,oe,z,R),pe&&Dn(z,R,oe,"updated")},ce)},T=(R,z,oe,ce,le,Y,ie)=>{for(let se=0;se<z.length;se++){const ue=R[se],re=z[se],pe=ue.el&&(ue.type===Oe||!Pr(ue,re)||ue.shapeFlag&70)?f(ue.el):oe;g(ue,re,pe,null,ce,le,Y,ie,!0)}},k=(R,z,oe,ce,le,Y,ie)=>{if(oe!==ce){if(oe!==He)for(const se in oe)!yr(se)&&!(se in ce)&&o(R,se,oe[se],null,ie,z.children,le,Y,B);for(const se in ce){if(yr(se))continue;const ue=ce[se],re=oe[se];ue!==re&&se!=="value"&&o(R,se,re,ue,ie,z.children,le,Y,B)}"value"in ce&&o(R,"value",oe.value,ce.value,ie)}},E=(R,z,oe,ce,le,Y,ie,se,ue)=>{const re=z.el=R?R.el:s(""),pe=z.anchor=R?R.anchor:s("");let{patchFlag:me,dynamicChildren:ge,slotScopeIds:Ce}=z;Ce&&(se=se?se.concat(Ce):Ce),R==null?(r(re,oe,ce),r(pe,oe,ce),S(z.children||[],oe,pe,le,Y,ie,se,ue)):me>0&&me&64&&ge&&R.dynamicChildren?(T(R.dynamicChildren,ge,oe,le,Y,ie,se),(z.key!=null||le&&z===le.subTree)&&Ul(R,z,!0)):fe(R,z,oe,pe,le,Y,ie,se,ue)},L=(R,z,oe,ce,le,Y,ie,se,ue)=>{z.slotScopeIds=se,R==null?z.shapeFlag&512?le.ctx.activate(z,oe,ce,ie,ue):V(z,oe,ce,le,Y,ie,ue):K(R,z,ue)},V=(R,z,oe,ce,le,Y,ie)=>{const se=R.component=Id(R,ce,le);if(kl(R)&&(se.ctx.renderer=$),Td(se),se.asyncDep){if(le&&le.registerDep(se,W),!R.el){const ue=se.subTree=_e(En);v(null,ue,z,oe)}}else W(se,R,z,oe,le,Y,ie)},K=(R,z,oe)=>{const ce=z.component=R.component;if($f(R,z,oe))if(ce.asyncDep&&!ce.asyncResolved){te(ce,z,oe);return}else ce.next=z,Rf(ce.update),ce.effect.dirty=!0,ce.update();else z.el=R.el,ce.vnode=z},W=(R,z,oe,ce,le,Y,ie)=>{const se=()=>{if(R.isMounted){let{next:pe,bu:me,u:ge,parent:Ce,vnode:Ee}=R;{const Dt=zl(R);if(Dt){pe&&(pe.el=Ee.el,te(R,pe,ie)),Dt.asyncDep.then(()=>{R.isUnmounted||se()});return}}let we=pe,je;Bn(R,!1),pe?(pe.el=Ee.el,te(R,pe,ie)):pe=Ee,me&&li(me),(je=pe.props&&pe.props.onVnodeBeforeUpdate)&&Kt(je,Ce,pe,Ee),Bn(R,!0);const Se=Xo(R),Ke=R.subTree;R.subTree=Se,g(Ke,Se,f(Ke.el),U(Ke),R,le,Y),pe.el=Se.el,we===null&&Ff(R,Se.el),ge&&_t(ge,le),(je=pe.props&&pe.props.onVnodeUpdated)&&_t(()=>Kt(je,Ce,pe,Ee),le)}else{let pe;const{el:me,props:ge}=z,{bm:Ce,m:Ee,parent:we}=R,je=Sr(z);if(Bn(R,!1),Ce&&li(Ce),!je&&(pe=ge&&ge.onVnodeBeforeMount)&&Kt(pe,we,z),Bn(R,!0),me&&J){const Se=()=>{R.subTree=Xo(R),J(me,R.subTree,R,le,null)};je?z.type.__asyncLoader().then(()=>!R.isUnmounted&&Se()):Se()}else{const Se=R.subTree=Xo(R);g(null,Se,oe,ce,R,le,Y),z.el=Se.el}if(Ee&&_t(Ee,le),!je&&(pe=ge&&ge.onVnodeMounted)){const Se=z;_t(()=>Kt(pe,we,Se),le)}(z.shapeFlag&256||we&&Sr(we.vnode)&&we.vnode.shapeFlag&256)&&R.a&&_t(R.a,le),R.isMounted=!0,z=oe=ce=null}},ue=R.effect=new Mo(se,It,()=>Qo(re),R.scope),re=R.update=()=>{ue.dirty&&ue.run()};re.id=R.uid,Bn(R,!0),re()},te=(R,z,oe)=>{z.component=R;const ce=R.vnode.props;R.vnode=z,R.next=null,pd(R,z.props,ce,oe),vd(R,z.children,oe),gn(),pl(R),vn()},fe=(R,z,oe,ce,le,Y,ie,se,ue=!1)=>{const re=R&&R.children,pe=R?R.shapeFlag:0,me=z.children,{patchFlag:ge,shapeFlag:Ce}=z;if(ge>0){if(ge&128){j(re,me,oe,ce,le,Y,ie,se,ue);return}else if(ge&256){ee(re,me,oe,ce,le,Y,ie,se,ue);return}}Ce&8?(pe&16&&B(re,le,Y),me!==re&&c(oe,me)):pe&16?Ce&16?j(re,me,oe,ce,le,Y,ie,se,ue):B(re,le,Y,!0):(pe&8&&c(oe,""),Ce&16&&S(me,oe,ce,le,Y,ie,se,ue))},ee=(R,z,oe,ce,le,Y,ie,se,ue)=>{R=R||Qn,z=z||Qn;const re=R.length,pe=z.length,me=Math.min(re,pe);let ge;for(ge=0;ge<me;ge++){const Ce=z[ge]=ue?On(z[ge]):zt(z[ge]);g(R[ge],Ce,oe,null,le,Y,ie,se,ue)}re>pe?B(R,le,Y,!0,!1,me):S(z,oe,ce,le,Y,ie,se,ue,me)},j=(R,z,oe,ce,le,Y,ie,se,ue)=>{let re=0;const pe=z.length;let me=R.length-1,ge=pe-1;for(;re<=me&&re<=ge;){const Ce=R[re],Ee=z[re]=ue?On(z[re]):zt(z[re]);if(Pr(Ce,Ee))g(Ce,Ee,oe,null,le,Y,ie,se,ue);else break;re++}for(;re<=me&&re<=ge;){const Ce=R[me],Ee=z[ge]=ue?On(z[ge]):zt(z[ge]);if(Pr(Ce,Ee))g(Ce,Ee,oe,null,le,Y,ie,se,ue);else break;me--,ge--}if(re>me){if(re<=ge){const Ce=ge+1,Ee=Ce<pe?z[Ce].el:ce;for(;re<=ge;)g(null,z[re]=ue?On(z[re]):zt(z[re]),oe,Ee,le,Y,ie,se,ue),re++}}else if(re>ge)for(;re<=me;)P(R[re],le,Y,!0),re++;else{const Ce=re,Ee=re,we=new Map;for(re=Ee;re<=ge;re++){const it=z[re]=ue?On(z[re]):zt(z[re]);it.key!=null&&we.set(it.key,re)}let je,Se=0;const Ke=ge-Ee+1;let Dt=!1,ur=0;const Bt=new Array(Ke);for(re=0;re<Ke;re++)Bt[re]=0;for(re=Ce;re<=me;re++){const it=R[re];if(Se>=Ke){P(it,le,Y,!0);continue}let st;if(it.key!=null)st=we.get(it.key);else for(je=Ee;je<=ge;je++)if(Bt[je-Ee]===0&&Pr(it,z[je])){st=je;break}st===void 0?P(it,le,Y,!0):(Bt[st-Ee]=re+1,st>=ur?ur=st:Dt=!0,g(it,z[st],oe,null,le,Y,ie,se,ue),Se++)}const ln=Dt?Cd(Bt):Qn;for(je=ln.length-1,re=Ke-1;re>=0;re--){const it=Ee+re,st=z[it],Jt=it+1<pe?z[it+1].el:ce;Bt[re]===0?g(null,st,oe,Jt,le,Y,ie,se,ue):Dt&&(je<0||re!==ln[je]?O(st,oe,Jt,2):je--)}}},O=(R,z,oe,ce,le=null)=>{const{el:Y,type:ie,transition:se,children:ue,shapeFlag:re}=R;if(re&6){O(R.component.subTree,z,oe,ce);return}if(re&128){R.suspense.move(z,oe,ce);return}if(re&64){ie.move(R,z,oe,$);return}if(ie===Oe){r(Y,z,oe);for(let me=0;me<ue.length;me++)O(ue[me],z,oe,ce);r(R.anchor,z,oe);return}if(ie===Ai){C(R,z,oe);return}if(ce!==2&&re&1&&se)if(ce===0)se.beforeEnter(Y),r(Y,z,oe),_t(()=>se.enter(Y),le);else{const{leave:me,delayLeave:ge,afterLeave:Ce}=se,Ee=()=>r(Y,z,oe),we=()=>{me(Y,()=>{Ee(),Ce&&Ce()})};ge?ge(Y,Ee,we):we()}else r(Y,z,oe)},P=(R,z,oe,ce=!1,le=!1)=>{const{type:Y,props:ie,ref:se,children:ue,dynamicChildren:re,shapeFlag:pe,patchFlag:me,dirs:ge}=R;if(se!=null&&sa(se,null,oe,R,!0),pe&256){z.ctx.deactivate(R);return}const Ce=pe&1&&ge,Ee=!Sr(R);let we;if(Ee&&(we=ie&&ie.onVnodeBeforeUnmount)&&Kt(we,z,R),pe&6)Q(R.component,oe,ce);else{if(pe&128){R.suspense.unmount(oe,ce);return}Ce&&Dn(R,null,z,"beforeUnmount"),pe&64?R.type.remove(R,z,oe,le,$,ce):re&&(Y!==Oe||me>0&&me&64)?B(re,z,oe,!1,!0):(Y===Oe&&me&384||!le&&pe&16)&&B(ue,z,oe),ce&&M(R)}(Ee&&(we=ie&&ie.onVnodeUnmounted)||Ce)&&_t(()=>{we&&Kt(we,z,R),Ce&&Dn(R,null,z,"unmounted")},oe)},M=R=>{const{type:z,el:oe,anchor:ce,transition:le}=R;if(z===Oe){Z(oe,ce);return}if(z===Ai){y(R);return}const Y=()=>{i(oe),le&&!le.persisted&&le.afterLeave&&le.afterLeave()};if(R.shapeFlag&1&&le&&!le.persisted){const{leave:ie,delayLeave:se}=le,ue=()=>ie(oe,Y);se?se(R.el,Y,ue):ue()}else Y()},Z=(R,z)=>{let oe;for(;R!==z;)oe=u(R),i(R),R=oe;i(z)},Q=(R,z,oe)=>{const{bum:ce,scope:le,update:Y,subTree:ie,um:se}=R;ce&&li(ce),le.stop(),Y&&(Y.active=!1,P(ie,R,z,oe)),se&&_t(se,z),_t(()=>{R.isUnmounted=!0},z),z&&z.pendingBranch&&!z.isUnmounted&&R.asyncDep&&!R.asyncResolved&&R.suspenseId===z.pendingId&&(z.deps--,z.deps===0&&z.resolve())},B=(R,z,oe,ce=!1,le=!1,Y=0)=>{for(let ie=Y;ie<R.length;ie++)P(R[ie],z,oe,ce,le)},U=R=>R.shapeFlag&6?U(R.component.subTree):R.shapeFlag&128?R.suspense.next():u(R.anchor||R.el);let D=!1;const q=(R,z,oe)=>{R==null?z._vnode&&P(z._vnode,null,null,!0):g(z._vnode||null,R,z,null,null,null,oe),D||(D=!0,pl(),ml(),D=!1),z._vnode=R},$={p:g,um:P,m:O,r:M,mt:V,mc:S,pc:fe,pbc:T,n:U,o:e};let H,J;return t&&([H,J]=t($)),{render:q,hydrate:H,createApp:fd(q,H)}}function la({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Bn({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function bd(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ul(e,t,n=!1){const r=e.children,i=t.children;if(ke(r)&&ke(i))for(let o=0;o<r.length;o++){const a=r[o];let s=i[o];s.shapeFlag&1&&!s.dynamicChildren&&((s.patchFlag<=0||s.patchFlag===32)&&(s=i[o]=On(i[o]),s.el=a.el),n||Ul(a,s)),s.type===Ii&&(s.el=a.el)}}function Cd(e){const t=e.slice(),n=[0];let r,i,o,a,s;const l=e.length;for(r=0;r<l;r++){const p=e[r];if(p!==0){if(i=n[n.length-1],e[i]<p){t[r]=i,n.push(r);continue}for(o=0,a=n.length-1;o<a;)s=o+a>>1,e[n[s]]<p?o=s+1:a=s;p<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,a=n[o-1];o-- >0;)n[o]=a,a=t[a];return n}function zl(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:zl(t)}const wd=e=>e.__isTeleport,Oe=Symbol.for("v-fgt"),Ii=Symbol.for("v-txt"),En=Symbol.for("v-cmt"),Ai=Symbol.for("v-stc"),Tr=[];let Lt=null;function X(e=!1){Tr.push(Lt=e?null:[])}function xd(){Tr.pop(),Lt=Tr[Tr.length-1]||null}let Nr=1;function Kl(e){Nr+=e}function Zl(e){return e.dynamicChildren=Nr>0?Lt||Qn:null,xd(),Nr>0&&Lt&&Lt.push(e),e}function ne(e,t,n,r,i,o){return Zl(b(e,t,n,r,i,o,!0))}function Te(e,t,n,r,i){return Zl(_e(e,t,n,r,i,!0))}function Ti(e){return e?e.__v_isVNode===!0:!1}function Pr(e,t){return e.type===t.type&&e.key===t.key}const Ni="__vInternal",Ql=({key:e})=>e??null,Pi=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Qe(e)||Je(e)||Ne(e)?{i:We,r:e,k:t,f:!!n}:e:null);function b(e,t=null,n=null,r=0,i=null,o=e===Oe?0:1,a=!1,s=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ql(t),ref:t&&Pi(t),scopeId:Ci,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:We};return s?(ca(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=Qe(n)?8:16),Nr>0&&!a&&Lt&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Lt.push(l),l}const _e=kd;function kd(e,t=null,n=null,r=0,i=null,o=!1){if((!e||e===_l)&&(e=En),Ti(e)){const s=nr(e,t,!0);return n&&ca(s,n),Nr>0&&!o&&Lt&&(s.shapeFlag&6?Lt[Lt.indexOf(e)]=s:Lt.push(s)),s.patchFlag|=-2,s}if(qd(e)&&(e=e.__vccOpts),t){t=Ed(t);let{class:s,style:l}=t;s&&!Qe(s)&&(t.class=Ie(s)),Ue(l)&&(ll(l)&&!ke(l)&&(l=et({},l)),t.style=tt(l))}const a=Qe(e)?1:Uf(e)?128:wd(e)?64:Ue(e)?4:Ne(e)?2:0;return b(e,t,n,r,i,a,o,!0)}function Ed(e){return e?ll(e)||Ni in e?et({},e):e:null}function nr(e,t,n=!1){const{props:r,ref:i,patchFlag:o,children:a}=e,s=t?ua(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:s,key:s&&Ql(s),ref:t&&t.ref?n&&i?ke(i)?i.concat(Pi(t)):[i,Pi(t)]:Pi(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Oe?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&nr(e.ssContent),ssFallback:e.ssFallback&&nr(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Fe(e=" ",t=0){return _e(Ii,null,e,t)}function Lr(e,t){const n=_e(Ai,null,e);return n.staticCount=t,n}function ye(e="",t=!1){return t?(X(),Te(En,null,e)):_e(En,null,e)}function zt(e){return e==null||typeof e=="boolean"?_e(En):ke(e)?_e(Oe,null,e.slice()):typeof e=="object"?On(e):_e(Ii,null,String(e))}function On(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:nr(e)}function ca(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(ke(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),ca(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!(Ni in t)?t._ctx=We:i===3&&We&&(We.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ne(t)?(t={default:t,_ctx:We},n=32):(t=String(t),r&64?(n=16,t=[Fe(t)]):n=8);e.children=t,e.shapeFlag|=n}function ua(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const i in r)if(i==="class")t.class!==r.class&&(t.class=Ie([t.class,r.class]));else if(i==="style")t.style=tt([t.style,r.style]);else if(oi(i)){const o=t[i],a=r[i];a&&o!==a&&!(ke(o)&&o.includes(a))&&(t[i]=o?[].concat(o,a):a)}else i!==""&&(t[i]=r[i])}return t}function Kt(e,t,n,r=null){Pt(e,t,7,[n,r])}const Od=Ll();let Sd=0;function Id(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||Od,o={uid:Sd++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new $s(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:ql(r,i),emitsOptions:vl(r,i),emit:null,emitted:null,propsDefaults:He,inheritAttrs:r.inheritAttrs,ctx:He,data:He,props:He,attrs:He,slots:He,refs:He,setupState:He,setupContext:null,attrsProxy:null,slotsProxy:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=jf.bind(null,o),e.ce&&e.ce(o),o}let rt=null;const Ad=()=>rt||We;let Li,fa;{const e=js(),t=(n,r)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(r),o=>{i.length>1?i.forEach(a=>a(o)):i[0](o)}};Li=t("__VUE_INSTANCE_SETTERS__",n=>rt=n),fa=t("__VUE_SSR_SETTERS__",n=>Ri=n)}const Rr=e=>{const t=rt;return Li(e),e.scope.on(),()=>{e.scope.off(),Li(t)}},Xl=()=>{rt&&rt.scope.off(),Li(null)};function Jl(e){return e.vnode.shapeFlag&4}let Ri=!1;function Td(e,t=!1){t&&fa(t);const{props:n,children:r}=e.vnode,i=Jl(e);hd(e,n,i,t),gd(e,r);const o=i?Nd(e,t):void 0;return t&&fa(!1),o}function Nd(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=yi(new Proxy(e.ctx,id));const{setup:r}=n;if(r){const i=e.setupContext=r.length>1?Ld(e):null,o=Rr(e);gn();const a=nn(r,e,0,[e.props,i]);if(vn(),o(),Ps(a)){if(a.then(Xl,Xl),t)return a.then(s=>{Wl(e,s,t)}).catch(s=>{_i(s,e,0)});e.asyncDep=a}else Wl(e,a,t)}else Yl(e,t)}function Wl(e,t,n){Ne(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ue(t)&&(e.setupState=ul(t)),Yl(e,n)}let Gl;function Yl(e,t,n){const r=e.type;if(!e.render){if(!t&&Gl&&!r.render){const i=r.template||ra(e).template;if(i){const{isCustomElement:o,compilerOptions:a}=e.appContext.config,{delimiters:s,compilerOptions:l}=r,p=et(et({isCustomElement:o,delimiters:s},a),l);r.render=Gl(i,p)}}e.render=r.render||It}{const i=Rr(e);gn();try{od(e)}finally{vn(),i()}}}function Pd(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,n){return yt(e,"get","$attrs"),t[n]}}))}function Ld(e){const t=n=>{e.exposed=n||{}};return{get attrs(){return Pd(e)},slots:e.slots,emit:e.emit,expose:t}}function Mi(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(ul(yi(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ir)return Ir[n](e)},has(t,n){return n in t||n in Ir}}))}const Rd=/(?:^|[-_])(\w)/g,Md=e=>e.replace(Rd,t=>t.toUpperCase()).replace(/[-_]/g,"");function ec(e,t=!0){return Ne(e)?e.displayName||e.name:e.name||t&&e.__name}function tc(e,t,n=!1){let r=ec(t);if(!r&&t.__file){const i=t.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&e&&e.parent){const i=o=>{for(const a in o)if(o[a]===t)return a};r=i(e.components||e.parent.type.components)||i(e.appContext.components)}return r?Md(r):n?"App":"Anonymous"}function qd(e){return Ne(e)&&"__vccOpts"in e}const be=(e,t)=>_f(e,t,Ri);function jd(e,t,n=He){const r=Ad(),i=vt(t),o=Et(t),a=kf((l,p)=>{let c;return Qf(()=>{const f=e[t];Vt(c,f)&&(c=f,p())}),{get(){return l(),n.get?n.get(c):c},set(f){const u=r.vnode.props;!(u&&(t in u||i in u||o in u)&&(`onUpdate:${t}`in u||`onUpdate:${i}`in u||`onUpdate:${o}`in u))&&Vt(f,c)&&(c=f,p()),r.emit(`update:${t}`,n.set?n.set(f):f)}}}),s=t==="modelValue"?"modelModifiers":`${t}Modifiers`;return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?e[s]||{}:a,done:!1}:{done:!0}}}},a}function Dd(e,t,n){const r=arguments.length;return r===2?Ue(t)&&!ke(t)?Ti(t)?_e(e,null,[t]):_e(e,t):_e(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ti(n)&&(n=[n]),_e(e,t,n))}const Bd="3.4.21";/**
|
|
17
17
|
* @vue/runtime-dom v3.4.21
|
|
18
18
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
19
|
* @license MIT
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* vue-router-lwc v1.0.4
|
|
26
26
|
* (c) 2024 Eduardo San Martin Morote
|
|
27
27
|
* @license MIT
|
|
28
|
-
*/var Sc;(function(e){e.pop="pop",e.push="push"})(Sc||(Sc={}));var Ic;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Ic||(Ic={}));var Ac;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Ac||(Ac={}));const z0=Symbol(""),K0=Symbol("");function Vi(){return kn(z0)}function wa(){return kn(K0)}function bt(e){if(typeof e=="string"&&(e=JSON.parse(e)),e!=null&&e.errorMessage)throw new Error(e==null?void 0:e.errorMessage);return e}const xa={xx_ord1__item__c:"xx_ord1__item__c",xx_ord1__sales_price__c:"xx_ord1__negotiated_price__c",xx_ord1__nrc__c:"xx_ord1__nrc_for_new__c",xx_ord1__line_description__c:"xx_ord1__line_description__c",xx_ord1__list_price__c:"xx_ord1__list_price2__c",xx_ord1__cost__c:"xx_ord1__cost2__c",xx_ord1__rate_plan__c:"xx_ord1__rate_plan__c",xx_ord1__allowed_discount__c:"xx_ord1__allowed_discount__c",xx_ord1__billing_period__c:"xx_ord1__billing_period__c",xx_ord1__ship_to_account__c:"xx_ord1__ship_to_account__c",xx_ord1__erp_item_number__c:"xx_ord1__erp_item_number__c",xx_ord1__mrc__c:"xx_ord1__mrc__c",xx_ord1__qty__c:"xx_ord1__qty__c",id:"id"},Tc={xx_ord1__item__c:"xx_ord1__item__c",xx_ord1__negotiated_price__c:"xx_ord1__sales_price__c",xx_ord1__nrc_for_new__c:"xx_ord1__nrc__c",xx_ord1__line_description__c:"xx_ord1__line_description__c",xx_ord1__list_price2__c:"xx_ord1__list_price__c",xx_ord1__cost2__c:"xx_ord1__cost__c",xx_ord1__rate_plan__c:"xx_ord1__rate_plan__c",xx_ord1__allowed_discount__c:"xx_ord1__allowed_discount__c",xx_ord1__billing_period__c:"xx_ord1__billing_period__c",xx_ord1__ship_to_account__c:"xx_ord1__ship_to_account__c",xx_ord1__erp_item_number__c:"xx_ord1__erp_item_number__c",xx_ord1__mrc__c:"xx_ord1__mrc__c",xx_ord1__qty__c:"xx_ord1__qty__c",id:"id"},Z0=e=>{var n;let t=[];for(let r of e)if(r.trim()!=="xx_ord1__item__r.xx_ord1__decimal_precision__c")if(r.includes(".")){let o=r.split(".")[0];o=o.slice(0,-1)+"c";const a=((n=xa[o==null?void 0:o.toLowerCase()])==null?void 0:n.trim())||"";a&&(t.includes(a)||t.push(a||""),t.push(r))}else t.includes(xa[r==null?void 0:r.toLowerCase()])||t.push(xa[r==null?void 0:r.toLowerCase()]||"");return t.filter(r=>r!=="")},Q0=Rt("actions",()=>{const e=Ui(),t=Tn(),n=ae(!1);return{openAdaptiveSearch:(s,l=!1)=>{console.info("openAdaptiveSearch",s),e.chatHistory[e.chatHistory.length-1].links=[],e.sendMessage("Open Adaptive Search",!1,{internalCall:!0}),n.value=l},openQuoteItem:s=>{console.info("openQuoteItem",s),e.chatHistory[e.chatHistory.length-1].links=[],e.sendMessage("Open Quote Item",!1,{internalCall:!0})},openQuoteDocument:s=>{console.info("openQuoteDocument",s),e.chatHistory[e.chatHistory.length-1].links=[],e.chatHistory.push({type:"response",message:"Opening quote document",loading:!0});const p=`/apex/XX_ORD1__Expedite_Commerce?scpq=true&oid=${t.quoteId}&atpverified=true&ecCache=false&origin=AI`;window.location.href=`${a0(window.location.href)}${p}`},undo:()=>{const s=e==null?void 0:e.latestDMLRequest;e.sendMessage(`UNDO-${s}`,!1,{internalCall:!0})},isStaticActionCall:n}}),Nc=Rt("adaptiveSearch",()=>{const e=Tn(),t=ar(),n=Ui(),r=Q0(),i=ae(null),o=ae(null),a=ae(!1),s=ae(!1),l=ae([]),p=ae(""),c=ae(!1),f=ae(null),u=ae(!1),m=ae([]),h=an(),g=ae([]),d=ae(0),v=ae(!1),_=ae({rowLimt:10,paging:!0,offset:0,currentPage:1,totalPages:1});async function C(){a.value=!0;try{const O=JSON.stringify({layoutType:"Search Selection",layoutObject:"xx_ord1__ecatalog_item__c"});let P={};return P=await window.salesforceConnector.getDynamicPageLayout(O),o.value=Ec(P,"Unable to find the Search Selection Layout for your user profile"),_.value.rowLimt=o.value.configuration.rowLimit||10,o.value.configuration.columns.forEach(M=>{!M.field&&M.label==="QTY"&&(M.field="xx_ord1__qty__c")}),a.value=!1,y(),P}catch(O){a.value=!1,h.handleError("Failed to get Adaptive Search Layout. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",O)}}function y(){var O,P,M;f.value=(M=(P=(O=o.value)==null?void 0:O.configuration)==null?void 0:P.dynamicFilters)==null?void 0:M.filters.map(Z=>({...Z,field:Z.field.toLowerCase(),filtervalue:Z.filtervalue||[],filtervaluefrom:Z.filtervaluefrom||"",filtervalueTo:Z.filtervalueTo||""}))}function w(){var P;let O=[];for(const M of o.value.configuration.columns){let Z=M.field;if(O.includes(Z)||O.push(Z),Z!=null&&Z.includes(".")){let B=Z.split(".")[0];B=B.slice(0,-1)+"c",O.includes(B)||O.push(B)}}return(P=o.value.configuration)!=null&&P.cardHeader&&O.push(o.value.configuration.cardHeader.imageField),o.value.configuration.objectName.toLowerCase()==="xx_ord1__ecatalog_item__c"&&O.push("xx_ord1__item__r.xx_ord1__decimal_precision__c"),O=O.filter(M=>!!M),O.filter(M=>M.toLowerCase()!=="xx_ord1__qty__c"&&M.toLowerCase()!=="xx_ord1__competitor_sku__c")}function A(O,P=!1){if(!O||O.includes("undefined"))return!1;const M=/[!@#$%^&*()+=[\]{};':"\\|.<>/?]+/;if(P){const Z=Array.isArray(O)?O:O.split(",");for(const Q of Z){const B=Q.trim();if(M.test(B))return h.handleError(`Invalid character found in value: ${B}`),!1}}else if(M.test(O))return h.handleError("Special characters are not allowed in filter values"),!1;return!0}function I(O,P){return{field:O.field,operator:O.operator||"contains",value:P,dataType:O.dataType.trim()}}function S(O){if(!O.filtervalue)return null;const P=Array.isArray(O.filtervalue),M=P?O.filtervalue.join(","):O.filtervalue.trim();return A(M,P)?M:null}function N(O){var Q,B;const P=(Q=O.filtervaluefrom)==null?void 0:Q.trim(),M=(B=O.filtervalueTo)==null?void 0:B.trim();if(!P||!M)return null;const Z=`${P}, ${M}`;return Z!==", "&&A(Z)?Z:null}function T(O){const P=`${kc(O.filtervaluefrom)}, ${kc(O.filtervalueTo)}`;return P!==", "&&A(P)?P:null}function k(O){var M;const P=(M=O.filtervaluefrom)==null?void 0:M.trim();return A(P)?P:null}function E(O){const P=[];return O.forEach(M=>{const Z=M.dataType.trim();let Q=null;switch(Z){case"PICKLIST":case"MULTIPICKLIST":Q=S(M);break;case"DOUBLE":case"CURRENCY":Q=N(M);break;case"DATETIME":case"DATE":Q=T(M);break;default:Q=k(M)}Q&&P.push(I(M,Q))}),m.value=P,P}async function L(O="",P=[],M=[]){var Q,B,U,D,q,$,H,J,R,z;let Z=[];if(P.length&&(Z=E(P)),!Z.length&&O.trim()===""){l.value=[],c.value=!1;return}try{c.value=!1,s.value=!0;const oe=O.trim();M.length||(M=w());const ce={fields:M,...P.length?{dynamicFilters:Z}:{},searchText:oe||p.value.trim(),accountId:t.accountId,...t.eCatalogId?{catalogId:t.eCatalogId}:{},...t.objectType==="opportunity"?{opportunityId:t.id}:{},...(B=(Q=o.value)==null?void 0:Q.configuration)!=null&&B.sort?{primarySortBy:o.value.configuration.sort.primary.field,primarySortOrder:o.value.configuration.sort.primary.direction,secondarySortBy:o.value.configuration.sort.secondary.field,secondarySortOrder:o.value.configuration.sort.secondary.direction}:{},rowLimt:(D=(U=o.value)==null?void 0:U.configuration)==null?void 0:D.rowLimit,paging:($=(q=o.value)==null?void 0:q.configuration)==null?void 0:$.paging,...((H=_.value)==null?void 0:H.offset)!==0?{offset:_.value.offset}:{},objectName:(R=(J=o.value)==null?void 0:J.configuration)==null?void 0:R.objectName,currencyCode:t.currencyCode},le=await window.salesforceConnector.getItems(JSON.stringify(ce));if(le!=null&&le.errorMessage){h.handleError(le.errorMessage);return}le!=null&&le.itemCount&&(_.value.totalPages=Math.ceil((le==null?void 0:le.itemCount)/_.value.rowLimt)),l.value=$i(le.lstItems,{xx_ord1__qty__c:"1"}),(z=le.lstItems)!=null&&z.length||(c.value=!0),s.value=!1}catch(oe){h.handleError("Failed to fetch Results. Please try again."),s.value=!1,console.info("[ERROR]: Adaptive Search getItems() error = ",oe)}}async function V(O){try{u.value=!0;const P=JSON.stringify({lstQLIRequest:K(O),quoteId:e.quoteId});let M=await window.salesforceConnector.createQLI(P);typeof M=="string"&&(M=JSON.parse(M));let Z=!1;if((M==null?void 0:M.length)>0&&M.forEach(Q=>{Q.errorMessage&&(Z=!0,h.handleError(Q.errorMessage))}),u.value=!1,Z){g.value=M;const Q=g.value.reduce((B,U)=>(B[U.eCatalogItemId]=U.errorMessage,B),{});l.value=l.value.map(B=>({...B,backendError:Q[B.Id]||""}));return}return M}catch(P){h.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addToQuote() error = ",P)}}function K(O){const P=[];for(const M of O)if(!M.addedToQuote&&M.id){const Z=W(M);d.value++,P.push({fields:Z,recordId:M.id,...O.length===1?{maxSequenceNumber:d.value}:{}})}return P}function W(O){const P=[],M=te();return Object.keys(O).forEach(Z=>{if(M.includes(Z)){const Q=Tc[Z.toLowerCase()];Q&&P.push({fieldname:Q,value:O[Z]})}}),P}function te(){const O=[];return o.value.configuration.columns.forEach(P=>{P.field&&!P.field.includes(".")&&P.isEditable&&P.visible&&O.push(P.field)}),O}function fe(){var P,M;const O=[];return o.value.configuration.columns.forEach(Z=>{const Q=Z.field.toLowerCase();O.includes(Q)||O.push(Q)}),(P=o.value.configuration)!=null&&P.dynamicFilters&&o.value.configuration.dynamicFilters.filters.forEach(Z=>{const Q=Z.field.toLowerCase();O.includes(Q)||O.push(Q)}),(M=o.value.configuration)!=null&&M.cardHeader&&O.push(o.value.configuration.cardHeader.imageField),O}async function ee(){var M;const O=fe(),P=((M=o.value.configuration)==null?void 0:M.saveObjectName)||o.value.configuration.objectName;if(P==="xx_ord1__ecatalog_item__c"){const Z=O.indexOf("xx_ord1__qty__c");Z>-1&&O.splice(Z,1)}await e.getFieldsData(O,P),e.fieldsData.xx_ord1__qty__c||e.getFieldsData(["xx_ord1__qty__c"],"xx_ord1__quote_line_item__c")}async function j({searchTerm:O="",filters:P=[]}={}){if(v.value=!0,O&&(p.value=O),P.length&&(m.value=P),await C()){await ee(),v.value=!1;const Z=p.value;Z&&(p.value=Z,await L(Z,e.dynamicFilters)),console.info("actionStore.isStaticActionCall = ",r.isStaticActionCall),r.isStaticActionCall&&(r.isStaticActionCall=!1,n.chatHistory[n.chatHistory.length-1]={type:"response",message:"Adaptive search is now open. Please search for the products you require and add it quote",loading:!1,links:[{action:"quoteItem",label:"Quote Item"},{action:"quoteDocument",label:"Quote Document"}]})}v.value=!1}return{selectedItem:i,AdaptiveSearchLayout:o,searchText:p,loadingAdaptiveLayout:a,getAdaptiveSearchLayout:C,getItems:L,lstItems:l,rowItemsLoading:s,noSearchRecords:c,dynamicFilters:f,setDynamicFilters:y,createQliErrors:g,addToQuote:V,addingToQuote:u,getFieldsData:ee,pagingData:_,appliedDynamicFilters:m,maxSequenceNumber:d,loadingAdaptiveSearch:v,initAdaptiveSearch:j}}),X0="XX_ORD1__Quote__c",J0="xxord1salespricec",Hi="xx_ord1__item__c",W0="xxord1productnrcc",G0=Rt("cartStore",()=>{const e=Tn(),t=Nc(),n=an(),r=ae(""),i=ae("$0"),o=ae("$0"),a=ae(null),s=ae({}),l=ae({}),p=ae({}),c=ae(""),f=ae(""),u=ae({}),m=ae(""),h=ae(""),g=ae({});async function d(){A()}async function v(){try{let N=await window.salesforceConnector.getProductCount(e.quoteId);if(N=bt(N),N!=null&&N.errorMessage){n.handleError(N.errorMessage);return}return r.value=N,N}catch{n.handleError("Failed to get Product Count. Please try again.")}}async function _(){try{let N=await window.salesforceConnector.getQuoteTotal(e.quoteId);if(N=bt(N),N!=null&&N.errorMessage){n.handleError(N.errorMessage);return}return o.value=N.monthlyTotal,i.value=N.onetimeTotal,N}catch{n.handleError("Failed to get Total Amount. Please try again.")}}async function C(N,T,k,E=""){if(!e.sectionDataMap.get(k).parentQLIs[T].removingItem){e.sectionDataMap.get(k).parentQLIs[T].removingItem=!0,h.value=N.id,await y(N.id)==="Success"&&(e.fetchAllQuoteLineItems(),E&&E(N,T,k));let V=e.sectionDataMap.get(k).parentQLIs.filter(K=>K[Hi]===N[Hi]).length;h.value="",t.lstItems.forEach(K=>{K[Hi]===N[Hi]&&(K.addedToQuote===!0&&(K.addedToQuote=!1),V===0&&(K.removedFromQuote=!0))})}}async function y(N){try{let T=await window.salesforceConnector.deleteQLI(N);if(T!=null&&T.errorMessage){n.handleError(T.errorMessage);return}return v(),_(),T}catch{n.handleError("Failed to remove Quote Item. Please try again.")}}function w(N){var E,L;const T=(E=N==null?void 0:N[W0])==null?void 0:E.match(/\.\d+/);T&&(T.value=T[0].length-1);const k=(L=N==null?void 0:N[J0])==null?void 0:L.match(/\.\d+/);return k&&(k.value=k[0].length-1),T||k}function A(N=!0){v(),_(),N&&e.fetchTemplates(X0).then(()=>{e.getFilteredListWithFields()})}function I(N){const T=e.sectionDataMap;for(const[,k]of T.entries())k.parentQLIs.forEach(E=>{E.id===N.id&&(k.columns.forEach(L=>{if(L.dataType==="CURRENCY"){const V=L.field.replace(/_/g,"");E[V]=S(E[V],N[L.field])}}),N!=null&&N.billingPeriodValue&&(N!=null&&N.formattedBillingPeriodValue)&&(E.formattedBillingPeriodValue=S(E.formattedBillingPeriodValue,N.billingPeriodValue)),N!=null&&N.oneTimeValue&&(N!=null&&N.formattedOneTimeValue)&&(E.formattedOneTimeValue=S(E.formattedOneTimeValue,N.oneTimeValue)))})}function S(N,T){const k=Number(T);if(isNaN(k))return N;const E=N.match(/(\d[\d,]*)(\.\d+)?/);if(!E)return N;const L=E[2]||"",V=L.length?L.length-1:0,K=k.toLocaleString("en-US",{minimumFractionDigits:V,maximumFractionDigits:V});return N.replace(E[1]+L,K)}return{initializeCart:d,loadCartState:A,productCount:r,onetimeTotal:i,monthlyTotal:o,filterCartItem:a,billingPeriodValue:c,hasOneTimeValue:f,hasBillingPeriodInList:s,oneTimeFieldAvailable:l,billingPeriodFieldAvailable:p,priceDecimalPrecision:u,cartItemUpdatingId:m,removingItemLoaderId:h,cartItemColumnsMap:g,getProductCount:v,getQuoteTotal:_,removeItem:C,removeQuoteItem:y,getDecimalPrecisionFromSalesPriceOrNRC:w,updateFormattedValues:I,formateCurrencyValue:S}}),Y0=e=>[{title:"Apply Discount",subOptions:[...e.map(t=>`Apply Discount on ${t} for `),"Show Maximum discount allowed","Apply Maximum Discount Allowed",...e.map(t=>`Apply Discount on ${t} for a specific total`)]},{title:"Update Fields",subOptions:["Update the price of","Update the quantity of","Update the term start date to","Update the term end date to","Update the line description for"]},{title:"Price Ramp",subOptions:["Add a price ramp for"]}],e5={salesforceUserLocale:"en_US",chatRoomId:"00DA0000000cDUJMA2__0052G00000AHBNAQA5__a0jKb000004VSaMIAW",status:"SUCCESS",statusCode:200,requestId:"9b1d1f0a9f07aa6cdc",errorMessage:"",payload:{uiModification:{addColumn:[],removeColumn:[],filter:[],groupBy:[{sectionName:"MRC $50 and Above",filters:[{datatype:"currency",field:"XX_ORD1__MRC__c",operator:"greater or equal",value:"50"}],tableId:"4vIEgoK5CbSPrLYPbq"},{sectionName:"MRC Below $50",filters:[{datatype:"currency",field:"XX_ORD1__MRC__c",operator:"less than",value:"50"}],tableId:"BlOPCp7eLBCZ84nDT2"}],showOptions:!0}},agentResponse:{role:"agent",requestId:"9b1d1f0a9f07aa6cdc",content:"Grouped the quote items into two sections: one for MRC $50 and above, and another for MRC below $50.",error:!1,epoch:1759936160464,isDML:!1},redirectObjects:{qliId:"",itemId:"",componentName:"QuoteItem"},actionFunction:"Reload",links:[{action:"quoteDocument",label:"Quote Document"},{action:"addProducts",label:"Add Products"}]},t5=[{label:"Line Description",field:"xx_ord1__line_description__c",isEditable:!0,dataType:"STRING"},{label:"QTY",field:"xx_ord1__qty__c",isEditable:!0,dataType:"DOUBLE"},{label:"Extended Price",field:"xx_ord1__extended_price__c",isEditable:!1,dataType:"CURRENCY"},{label:"Billing Period",field:"xx_ord1__billing_period__c",isEditable:!0,dataType:"PICKLIST",picklistValues:["Monthly","Quarterly","Yearly"]}],Tn=Rt("quote",()=>{const e=an(),t=G0(),n=ar(),r=ae(""),i=ae(""),o=ae(0),a=ae(""),s=ae([]),l=ae({template:!0,filteredList:!1}),p=ae(null),c=ae(new Map),f=ae({}),u=ae(!1),m=ae(!0),h=ae(!1),g=ae({text:"Hide Options",altText:"Show Options",handler:()=>{m.value=!m.value,S()},color:"#136E05",isActive:!1}),d=be(()=>{const j=Array.from(c.value.values()).map(O=>O.sectionName);return Y0(j)});St(a,()=>{l.value.template||I()});function v(){const j=new Map,O=[];for(const[M,Z]of c.value.entries())j.set(M,Z.selected),O.push(Z);const P=JSON.parse(JSON.stringify(O));return P.forEach(M=>{delete M.selected;const Z=new Map,Q=[];M.lineItems.forEach(B=>{B.Selected=j.get(M.tableId).get(B.id)||!1,B.xx_ord1__parent_qli__c?(Z.has(B.xx_ord1__parent_qli__c)||Z.set(B.xx_ord1__parent_qli__c,[]),Z.get(B.xx_ord1__parent_qli__c).push(B)):Q.push(B)}),M.lineItems=Q.map(B=>({...B,options:Z.get(B.id)||[]})),delete M.loading,delete M.parentQLIs,delete M.totalValues}),{showOptions:m.value,sections:P,templateId:a.value}}async function _(j){try{let O=await window.salesforceConnector.getPrimaryQuote(j);O=bt(O),O!==void 0&&(console.info("getPrimaryQuote",JSON.stringify(O)),r.value=O.recordId,console.info("quoteId",r.value),i.value=O.name,a.value=O==null?void 0:O.templateId,o.value=(O==null?void 0:O.lineItemsCount)||0)}catch(O){e.handleError(O.message),console.info("[ERROR]: getPrimaryQuote() error = ",O)}}async function C(j){var O,P;try{l.value.template=!0;let M=await window.salesforceConnector.fetchContentTemplates(JSON.stringify({lstObjectName:[j],templateType:"Document",templateId:null,fetchOnlyDefault:!1}));M=bt(M);const Z=M==null?void 0:M.templates[j];return a.value||(a.value=(O=Z.find(Q=>Q.XX_ORD1__Default__c))==null?void 0:O.Id),a.value||(a.value=(P=Z[0])==null?void 0:P.Id),s.value=Z,l.value.template=!1,s.value}catch(M){e.handleError(M.message),console.info("[ERROR]: fetchTemplates() error = ",M)}}function y(j){if(!j)return null;const O=/\{!\$(\w+):([\w.]+)\}/,P=j.match(O);return P?{function:P[1],apiname:P[2].split(".")[1]}:null}async function w(j){try{const O={Id:r.value,XX_ORD1__Document_Template__c:j};return await window.salesforceConnector.updateQuote(JSON.stringify([O]))}catch(O){e.handleError(O.message),console.info("[ERROR]: updateQuote() error = ",O)}}async function A(){try{l.value.filteredList=!0;let j=await window.salesforceConnector.getQuoteEPageLayout();c.value.clear(),t.cartItemColumnsMap={},j=bt(j);const O=j.map(M=>({label:M.fieldLabel,field:M.fieldName.toLowerCase(),isEditable:M.isEditable,dataType:M.dataType,...M.picklistValues?{picklistValues:M.picklistValues}:{}})),P=or();return c.value.set(P,{loading:!0,lineItems:[],parentQLIs:[],columns:O,tableId:P,sectionName:"All Rows",selected:new Map,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}),t.cartItemColumnsMap[P]=O,g.value.isActive=!1,m.value=!0,p.value={lstCB:[{columns:O,footer:null,title:"All Rows",sectionName:"All Rows",tableId:P,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}]},S(),l.value.filteredList=!1,j}catch(j){e.handleError(j.message),console.info("[ERROR]: getQuoteEPageLayout() error = ",j)}}async function I(){if(s.value.length===0){A();return}try{l.value.filteredList=!0;let j=await window.salesforceConnector.getFilteredListWithFields(JSON.stringify({templateId:a.value}));w(a.value),j=bt(j),console.info("res.lstCB = ",j.lstCB);const O=j==null?void 0:j.objectFieldsMap;return c.value.clear(),t.cartItemColumnsMap={},j.lstCB=j.lstCB.map(P=>{const{fields:M,filters:Z,primarysort:Q,primarysortdesc:B}=JSON.parse(P.XX_ORD1__Block_Properties__c),U=M.map(q=>{var $;return{label:($=O[q.api])==null?void 0:$.label,field:q.api.toLowerCase(),isEditable:q.api.includes(".")?!1:O[q.api].isEditable,dataType:O[q.api].dataType,...O[q.api].picklistValues?{picklistValues:O[q.api].picklistValues}:{}}}),D=P.Id||or();return c.value.set(D,{loading:!0,lineItems:[],parentQLIs:[],columns:U,tableId:D,sectionName:P.Name,selected:new Map,footer:y(P.XX_ORD1__Table_Footer_HTML__c),filters:Z,primarysort:Q,primarysortdesc:B}),t.cartItemColumnsMap[D]=U,g.value.isActive=!1,m.value=!0,{columns:U,footer:y(P.XX_ORD1__Table_Footer_HTML__c),title:P.Name,sectionName:P.Name,tableId:D,filters:Z,primarysort:Q,primarysortdesc:B}}),p.value=j,S(),l.value.filteredList=!1,j}catch(j){e.handleError(j.message),console.info("[ERROR]: getFilteredListWithFields() error = ",j)}}async function S(j=!0){const O=[];for(const[P]of c.value)O.push(k(P,j));return await Promise.all(O),t.getProductCount(),!0}function N(j,O){return c.value.get(j).columns.some(P=>P.field.toLowerCase()===O)||t.cartItemColumnsMap[j].some(P=>P.field.toLowerCase()===O)}function T(j,O){let P=$i(j);const M=n.pricingSchema,Z=N(O,"xx_ord1__nrc__c"),Q=N(O,"xx_ord1__sales_price__c"),B=N(O,"xx_ord1__qty__c");return P=P.map(U=>{let D={};M==="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?D={...Q?{billingPeriodValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:U==null?void 0:U.xxord1salespricec}:{},...Z?{oneTimeValue:(U==null?void 0:U.xx_ord1__nrc__c)===0?"0":(U==null?void 0:U.xx_ord1__nrc__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1nrcc}:{}}:M==="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)?Q&&(D={oneTimeValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1salespricec}):M!=="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?Q&&(D={billingPeriodValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:U==null?void 0:U.xxord1salespricec}):M!=="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)&&Q&&(D={oneTimeValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?0:(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1salespricec});const{xx_ord1__qty__c:q,xx_ord1__sales_price__c:$,xx_ord1__nrc__c:H,...J}=U,R={...J,id:U.id,description:(U==null?void 0:U.xx_ord1__line_description__c)||"",xx_ord1__billing_period__c:U==null?void 0:U.xx_ord1__billing_period__c,...B?{xx_ord1__qty__c:q}:{},xx_ord1__item__c:U==null?void 0:U.xx_ord1__item__c,"xx_ord1__item__r.xx_ord1__decimal_precision__c":U["xx_ord1__item__r.xx_ord1__decimal_precision__c"]||"0",...D};return R!=null&&R.billingPeriodValue&&(t.hasBillingPeriodInList[O]=!0,t.billingPeriodValue=R==null?void 0:R.xx_ord1__billing_period__c),"oneTimeValue"in R&&(t.oneTimeFieldAvailable[O]=!0),"billingPeriodValue"in R&&(t.billingPeriodFieldAvailable[O]=!0),(R==null?void 0:R.oneTimeValue)!==""&&(R==null?void 0:R.oneTimeValue)!==null&&(t.hasOneTimeValue=!0),R}),P}async function k(j,O=!0){var P,M;try{const Z=c.value.get(j);if(console.info("sectionData = ",Z.sectionName),!Z)return;Z.loading=O,O&&(Z.lineItems=[]);const{columns:Q,filters:B,primarysort:U,primarysortdesc:D,footer:q}=Z,$=Q.map(le=>le.field.toLowerCase());$.includes("xx_ord1__parent_qli__c")||$.push("xx_ord1__parent_qli__c"),$.includes("xx_ord1__item__c")||$.push("xx_ord1__item__c"),$.includes("xx_ord1__sys_configuration_status2__c")||$.push("xx_ord1__sys_configuration_status2__c"),(P=t.cartItemColumnsMap[j])==null||P.forEach(le=>{$.includes(le.field)||$.push(le.field)});const H=await E({fields:$,recordId:r.value,filters:B||[],primarySortBy:U||"",primarySortOrder:D?"DESC":"ASC",includeOptions:m.value,totalFields:q?[q.apiname]:[]}),J=H.lineItems,R=new Map;let z=[];const oe=(M=H.fieldTotals)==null?void 0:M.map(le=>le.totalValue);J.forEach(le=>{le.XX_ORD1__Parent_QLI__c?R.has(le.XX_ORD1__Parent_QLI__c)?R.get(le.XX_ORD1__Parent_QLI__c).push(le):R.set(le.XX_ORD1__Parent_QLI__c,[le]):z.push(le)});const ce=[];return z.forEach(le=>{ce.push(le),R.has(le.Id)&&ce.push(...R.get(le.Id))}),z=T(z,j),Z.lineItems=$i(ce),Z.parentQLIs=z,Z.totalValues=oe,Z.loading=!1,c.value=new Map(c.value),ce}catch(Z){console.info("[ERROR]: fetchQuoteLineItems()123 error = ",Z.message);const Q=c.value.get(j);Q&&(Q.loading=!1)}}async function E(j){try{let O=await window.salesforceConnector.getQuoteLineItemsWithFilteredTable(JSON.stringify(j));return O=bt(O),O}catch(O){e.handleError(O.message),console.info("[ERROR]: getQuoteLineItemsWithFilteredTable() error = ",O)}}async function L(j){try{console.info("updateQli() payload = ",j);let O=await window.salesforceConnector.updateQli(JSON.stringify(j));return O=bt(O),S(!1),O}catch(O){e.handleError(O.message),console.info("[ERROR]: updateQli() error = ",O)}}async function V(j){try{let O=await window.salesforceConnector.deleteQLI(j);return O=bt(O),S(),O}catch(O){e.handleError(O.message),console.info("[ERROR]: deleteQLI() error = ",O)}}async function K(j,O){try{u.value=!0;const P={fields:j};O&&(P.objectName=O),j.includes("xx_ord1__qty__c")&&O==="xx_ord1__ecatalog_item__c"&&(P.fields=P.fields.filter(Z=>Z!=="xx_ord1__qty__c")),j.includes("xx_ord1__sales_price__c")&&O!=="xx_ord1__quote_line_item__c"&&(P.fields=P.fields.filter(Z=>Z!=="xx_ord1__sales_price__c"));let M=await window.salesforceConnector.getFieldsData(JSON.stringify(P));return typeof M=="string"&&(M=JSON.parse(M)),M!=null&&M.errorMessage?(e.handleError(M.errorMessage),null):(f.value={...f.value,...M},console.info("fieldsData.value = ",JSON.stringify(f.value)),M)}catch(P){return e.handleError("Failed to get Fields Data. Please try again."),console.info("[ERROR]: getFieldsData() error = ",P),null}finally{u.value=!1}}function W(j=""){var O;return!j||j.includes(".")?!1:j.includes("xx_ord1__qty__c")?!0:((O=f.value[j])==null?void 0:O.isEditable)||!1}function te(){fe(e5)}async function fe(j){var O,P,M,Z,Q,B,U,D,q;if(j.payload){if((O=j.payload)!=null&&O.uiModification){const $=j.payload.uiModification;if(((P=$.addColumn)==null?void 0:P.length)>0)if($.addColumn.forEach(H=>{H.columns.forEach(J=>{J.field=J.field.toLowerCase()})}),$.addColumn[0].sectionName==="all_section")for(const[H,J]of c.value)J.columns=[...J.columns,...$.addColumn[0].columns];else $.addColumn.forEach(H=>{c.value.get(H.tableId)&&(c.value.get(H.tableId).columns=[...c.value.get(H.tableId).columns,...H.columns])});if(((M=$.removeColumn)==null?void 0:M.length)>0)if($.removeColumn.forEach(H=>{H.columns=H.columns.map(J=>J.toLowerCase())}),$.removeColumn[0].sectionName==="all_section")for(const[H,J]of c.value)J.columns=J.columns.filter(R=>!$.removeColumn[0].columns.includes(R.field));else $.removeColumn.forEach(H=>{c.value.get(H.tableId)&&(c.value.get(H.tableId).columns=c.value.get(H.tableId).columns.filter(J=>!H.columns.includes(J.field)))});if(((Z=$.filter)==null?void 0:Z.length)>0)if($.filter[0].sectionName==="all_section")for(const[H,J]of c.value)J.filters=[...J.filters,...$.filter[0].filters];else $.filter.forEach(H=>{c.value.get(H.tableId)&&(c.value.get(H.tableId).filters=[...c.value.get(H.tableId).filters,...H.filters])});if(((Q=$.groupBy)==null?void 0:Q.length)>0){const H=((B=[...c.value.values()][0])==null?void 0:B.columns)||t5;c.value.clear(),t.cartItemColumnsMap={},$.groupBy.forEach(J=>{t.cartItemColumnsMap[J.tableId]=J.columns||H,c.value.set(J.tableId,{loading:!0,lineItems:[],parentQLIs:[],columns:J.columns||H,tableId:J.tableId,sectionName:J.sectionName,selected:new Map,footer:y(J.footer),filters:J.filters,primarysort:J.primarysort,primarysortdesc:J.primarysortdesc})})}$.showOptions!==void 0&&(m.value=$.showOptions)}if(((D=(U=j.payload)==null?void 0:U.sections)==null?void 0:D.length)>0){const $=(q=j.payload)==null?void 0:q.sections;c.value.clear(),$.forEach(H=>{H.tableId||(H.tableId=or()),H.selected=new Map,c.value.set(H.tableId,H)}),S()}}j.actionFunction==="Reload"&&(S(),console.info("Reloading quote line items"))}async function ee(j){var O,P;try{const M=new Set;for(const Z of c.value.keys())(O=c.value.get(Z).lineItems)==null||O.forEach(B=>{B.attributes=null,M.add(B.id)});if(j){const Z={lineItemIds:[...M]},Q=await window.productManagerController.getLineItemAttributes({request:JSON.stringify(Z)}),B=JSON.parse(Q.data);for(const U of c.value.keys())(P=c.value.get(U).lineItems)==null||P.forEach(q=>{q.attributes=B[q.id]||null})}}catch(M){console.info("[ERROR]: fetchAttributesData() error = ",M)}}return{showAttributes:h,quoteId:r,quoteName:i,templateId:a,templateOptions:s,loading:l,currentTemplateData:p,fieldsData:f,fieldsDataLoading:u,showOptionHeaderButton:g,sectionDataMap:c,promptSuggestions:d,lineItemsCount:o,addColumns:te,getQuoteEPageLayout:A,getPayload:v,getPrimaryQuote:_,fetchTemplates:C,getFilteredListWithFields:I,getQuoteLineItemsWithFilteredTable:E,updateQli:L,getFieldsData:K,deleteQLI:V,performAIAction:fe,isEditableField:W,fetchQuoteLineItems:k,fetchAllQuoteLineItems:S,fetchAttributesData:ee}}),n5=Rt("quickSelection",()=>{const e=an(),t=ar(),n=Tn(),r=ae(null),i=ae(!1),o=ae([]),a=ae([]),s=ae(!1),l=ae({}),p=ae({rowLimit:10,paging:!0,offset:0,currentPage:1,totalPages:1}),c=ae(!1);async function f(){i.value=!0;try{const w=JSON.stringify({layoutType:"Quick Selection",layoutObject:"xx_ord1__ecatalog_item__c",...t.objectType?{contextObject:t.objectType}:{}});let A={};A=await window.salesforceConnector.getDynamicPageLayout(w),r.value=Ec(A,"Unable to find the Quick Selection Layout for your user profile"),console.info("quickSelectionLayout.value = ",r.value),p.value.rowLimit=r.value.configuration.rowLimit||10,r.value.data.columns.forEach(I=>{!I.field&&I.label==="QTY"&&(I.field="xx_ord1__qty__c")}),i.value=!1}catch(w){i.value=!1,e.handleError("Failed to get Page structure data. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",w)}}function u(){const w=new Map;return r.value.data.columns.forEach(A=>{w.set(A.field,!0)}),r.value.data.searchResultColumns.forEach(A=>{w.set(A.field,!0)}),Array.from(w.keys())}async function m(w){var A,I;try{let S=await window.salesforceConnector.saveCompetitorSKU(w);if(S!=null&&S.errorMessage){e.handleError(S.errorMessage);return}if((A=S[0])!=null&&A.errorMessage){e.handleError((I=S[0])==null?void 0:I.errorMessage);return}return S}catch(S){e.handleError("Failed to Match Item. Please try again."),console.info("[ERROR]: saveCompetitorSKU() error = ",S)}}async function h(w="",A=[]){try{let I=r.value.data,S=r.value.configuration;const N=w.trim();if(console.info("searchTextValue.trim() = ",w.trim()),!N)return[];let T=null;console.info("useMappings = ",c.value),c.value?T=Z0(g()):T=g(),console.info("fields before filter = ",T),T=T.filter(V=>V!=="xx_ord1__qty__c"),console.info("fields after filter = ",T);const k={fields:T,...A.length?{dynamicFilters:n.getDynamicFilters(A)}:{},searchText:N,accountId:t.accountId,...t.eCatalogId?{catalogId:t.eCatalogId}:{},...t.objectType==="opportunity"?{opportunityId:t.id}:{},...I!=null&&I.sort?{primarySortBy:I.sort.primary.field,primarySortOrder:I.sort.primary.direction,secondarySortBy:I.sort.secondary.field,secondarySortOrder:I.sort.secondary.direction}:{},rowLimt:(S==null?void 0:S.rowLimit)||20,paging:(S==null?void 0:S.paging)||!1,...p.value.offset!==0?{offset:p.value.offset}:{},objectName:I.objectName,currencyCode:t.currencyCode};console.info("getQuickSelectionItems payload = ",JSON.stringify(k));const E=await window.salesforceConnector.getItems(JSON.stringify(k));if(console.info("getQuickSelectionItems Res = ",JSON.stringify(E)),E!=null&&E.errorMessage){e.handleError(E.errorMessage);return}return E!=null&&E.itemCount&&(p.value.totalPages=Math.ceil((E==null?void 0:E.itemCount)/p.value.rowLimit)),$i(E.lstItems,{xx_ord1__qty__c:"1"})}catch(I){e.handleError("Failed to fetch Results. Please try again."),console.info("[ERROR]: getQuickSelectionItems() error = ",I)}}function g(){let w=[];for(const A of r.value.data.columns){let I=A.field;if(I!=null&&I.includes(".")){w.includes(I)||w.push(I);let N=I.split(".")[0];N=N.slice(0,-1)+"c",w.includes(N)||w.push(N)}else w.includes(I)||w.push(I)}return console.info("getAllQuickSelectionFields() fields = ",w),w.filter(A=>A.toLowerCase()!=="xx_ord1__qty__c")}async function d(w,A,I,S){console.info("searchText:",JSON.stringify(w)),console.info("row:",JSON.stringify(A)),console.info("rowIndex:",JSON.stringify(I)),console.info("column:",JSON.stringify(S));const N=I+(p.value.currentPage-1)*p.value.rowLimit;if(S.field.toLowerCase().includes("xx_ord1__item__r")){if(o.value[N].itemLookupLoading=!0,c.value=!0,a.value=await h(w),a.value.length>0){const T=[];for(let k=0;k<a.value.length;k++)o.value[N].itemDataRetrieved=!0,a.value[k].xx_ord1__item__c&&T.push({name:a.value[k]["xx_ord1__item__r.name"],value:a.value[k].xx_ord1__item__c,label:a.value[k][S.field.toLowerCase()]});o.value[N][S.field.toLowerCase()+"_options"]=T}o.value[N].itemLookupLoading=!1}else if(S.field.toLowerCase().includes("xx_ord1__competitor_item__r")){o.value[N].competitorLookupLoading=!0;const T=await v(w);T!=null&&T.items&&(o.value[N][S.field.toLowerCase()+"_options"]=T.items.map(k=>({name:k.fields[2].value,value:k.fields[1].value,label:k.fields[0].value}))),o.value[N].competitorLookupLoading=!1,console.info("getLookupData:: Search Lookup Handler Response = ",T)}}async function v(w){var I,S;console.info("getLookupData() searchText = ",w);const A={searchText:w,obj:"xx_ord1__competitor_item__c",filters:null,displayFields:["xx_ord1__sku__c"]};try{let N=await window.salesforceConnector.getLookupData(JSON.stringify(A));if(typeof N=="string"&&(N=JSON.parse(N)),N!=null&&N.errorMessage){e.handleError(N.errorMessage);return}if((I=N[0])!=null&&I.errorMessage){e.handleError((S=N[0])==null?void 0:S.errorMessage);return}return N}catch(N){e.handleError("Failed to Search For Item. Please try again."),console.info("[ERROR]: getLookupData() error = ",N)}}async function _(w,A){var S;console.info("Update Other Fields Value = ",w),console.info("Update Other Fields Row Index = ",A);const I=A+(p.value.currentPage-1)*p.value.rowLimit;console.info("actualRowIndex = ",I);try{if(w){const N=a.value.filter(T=>T.xx_ord1__item__c===w)[0];if(N){s.value=!0;const T=r.value.data.columns[1].field;o.value[I][T]&&await C(N,I),(S=o.value[I])!=null&&S.itemDataRetrieved&&(o.value[I].status="New Match Requested",o.value[I].noMatchCleared=!0),Object.keys(N).forEach(k=>{const E=Tc[k.toLowerCase()];console.info("Mapped Key = ",E),E&&(o.value[I][E]=N[k])}),s.value=!1}else o.value[I].status=""}else o.value[I].status="No Match"}catch(N){e.handleError("Unable to request a match for this item please try again."),console.info("Error in updateOtherFields = ",N)}}async function C(w,A){const I=o.value[A],S=r.value.data.columns[1].field,N=[{sku:I[S],name:I[S],productDescription:I.xx_ord1__line_description__c||"",productURL:null,status:"Match Requested",competitorAccountId:null,itemId:w.xx_ord1__item__c}];let T=await m(JSON.stringify(N));console.info("Match Item: ",JSON.stringify(T)),o.value[A][`${S}_options`]=[{value:T[0].competitorItemId,label:T[0].sku}],o.value[A][S]=T[0].competitorItemId}async function y(w){try{let A=await window.salesforceConnector.createQLI(JSON.stringify(w));typeof A=="string"&&(A=JSON.parse(A));let I=!1;if((A==null?void 0:A.length)>0)for(let S=0;S<A.length;S++)A[S].errorMessage&&(I=!0,A[S].errorMessage.includes("Line Description: data value too large")&&(A[S].errorMessage="Error: The description is too long—it must be under 200 characters."));if(I){A.forEach(S=>{l.value[S.eCatalogItemId]=S});return}else l.value=[];return A}catch(A){e.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addAllItemsToQuote() error = ",A)}}return{quickSelectionLayout:r,quickSelectionLayoutLoading:i,processedRecords:o,useMappings:c,currentSearchData:a,createQliErrors:l,getQuickSelectionLayout:f,getAllFieldsForQuickSelectionLayout:u,saveCompetitorSKU:m,getQuickSelectionItems:h,searchLookupHandler:d,updateOtherFields:_,addAllItemsToQuote:y}}),r5="Preparing Your Quote Please Wait...",i5={message:"Your quote is ready! Begin adding products to complete it.",type:"response",requestId:"no-request-id"},o5=18e4,Ui=Rt("ai",()=>{const e=ar(),t=Tn(),n=Nc(),r=n5(),i=sn(),o=wa(),a=ae(""),s=ae(""),l=ae([]),p=ae(""),c=ae([]),f=ae(!1),u=ae(null),m=Vi(),h=ae({}),g=ae(null),d=ae(null),v=ae(null),_=ae(null),C=ae(null),y=ae(r5),w=ae([]),A=be(()=>e.orgId+"__"+e.user.Id+"__"+t.quoteId),I=be(()=>u.value.readyState==WebSocket.OPEN),S=()=>{h.value={salesforceOrgId:e.orgId,salesforceOrgType:e.orgType,salesforceUserId:e.user.Id,userType:"Salesforce",chatRoomId:A.value,requestId:"",prompt:"",initiatedFrom:e.origin||"Quote",internalCall:!1,contextObjectId:t.quoteId,contextObjectType:"Quote",payload:{lineItemsCount:t.lineItemsCount},origin:"Genesis AI",defaultBatchSize:10,actionType:"",packageVersion:e.packageVersion,relatedIds:{eCatalogId:e.eCatalogId,accountId:e.accountId}}};async function N(){const q=s.value+"?chatRoomId="+A.value;u.value=new WebSocket(q),u.value.addEventListener("open",T),u.value.addEventListener("message",L),u.value.addEventListener("close",k),u.value.addEventListener("error",E)}const T=()=>{V(),te()},k=()=>{K()},E=()=>{Z(),K()},L=q=>{var H,J;V();const $=JSON.parse(q.data);if($.status!=="ALIVE"){if($.loading){y.value=$.message;return}else Array.isArray($.messages)?(y.value=null,l.value.push(i5),$.messages.length>0&&O($.messages)):$.agentResponse&&($.errorMessage&&($.agentResponse.content=$.errorMessage,$.agentResponse.error=!0),y.value=null,l.value.push({message:$.agentResponse.content,type:$.agentResponse.role,requestId:$.requestId,epoch:$.agentResponse.epoch,error:$.agentResponse.error,isDML:$.agentResponse.isDML,...(H=$.agentResponse)!=null&&H.filesData?{filesData:(J=$.agentResponse)==null?void 0:J.filesData}:{}}));w.value=$.links||[],B($)}},V=()=>{K(),g.value=setTimeout(()=>{if(I.value){const q={action:"heartbeat"};u.value.send(JSON.stringify(q)),V()}},o5)},K=()=>{g.value&&(clearInterval(g.value),g.value=null)};function W(q){const $={...h.value};$.requestType="Action",$.actionType="Undo",$.undoRequestId=q,$.requestId=or(),j($)}function te(){const q={...h.value};q.requestType="Action",q.actionType="History",q.requestId=or(),j(q)}function fe(q){return o.path.startsWith("/configurator")&&i.isChangedConfiguration?(_.value={save:()=>{i.maintainQuoteConfiguration()}},a.value=q,!0):(a.value="",!1)}function ee(q,$=!0,H=null){if(!fe(q)&&q.trim()){let J={...h.value};J.prompt=q.trim(),J.requestType="Chat",J.requestId=or(),J.internalCall=!1,J.payload=P(),J.componentName=M.value,J.templateId=t.templateId,J.payload.lineItemsCount=t.lineItemsCount,H&&(J={...J,...H}),Q(),$&&l.value.push({message:q.trim(),type:"user",...C.value&&{fileData:[C.value]},requestId:J.requestId}),j(J),V()}}function j(q){const $={action:"prompt",data:q};u.value.send(JSON.stringify($))}const O=q=>{const $=q.filter(({content:H})=>!!H).map(H=>({message:H.content,type:H.role,requestId:H.requestId,epoch:H.epoch,isDML:H.isDML,undone:H.undone}));$.forEach((H,J)=>{H.isDML===!0&&J!==$.length-1&&(H.isDML=!1)}),l.value=[...l.value,...$]};function P(){return o.path==="/quote-item"?t.getPayload():{}}const M=be(()=>o.path==="/quote-item"?"QuoteItem":""),Z=()=>{l.value.push({type:"response",message:"Oops! Something went wrong while processing your request. Please try again later.",error:!0})},Q=()=>{l.value=l.value.map(q=>({...q,links:[]}))};function B(q){var J,R,z;const $=((J=q==null?void 0:q.redirectObjects)==null?void 0:J.componentName)||(q==null?void 0:q.componentName),H=(q==null?void 0:q.redirectObjects)||{};if($==="AdaptiveSearch"){const oe=(R=q==null?void 0:q.payload)==null?void 0:R.searchTerm,ce=(z=q==null?void 0:q.payload)==null?void 0:z.applyFilters;oe&&oe!==n.searchText&&n.initAdaptiveSearch({searchTerm:oe,filters:ce}),m.push("/adaptive-search")}else $==="Configurator"?m.push(`/configurator/${H.itemId}/${H.qliId}`):$==="QuoteReview"?m.push("/quote-item"):$==="QuoteItem"||$==="QuoteList"?(m.push("/quote-item"),t.performAIAction(q)):$==="QuickSelection"&&(r.quickSelectionLayout=q.payload,console.info("Loading QuickSelection data = ",JSON.stringify(r.quickSelectionLayout)),m.push("/match-records"))}function U(){if(I.value){const q={action:"cancel",data:{requestId:h.value.requestId,chatRoomId:A.value}};u.value.send(JSON.stringify(q))}}const D=()=>{d.value&&(clearInterval(d.value),d.value=null),g.value&&(clearInterval(g.value),g.value=null),v.value&&(clearTimeout(v.value),v.value=null)};return Ei(()=>{D()}),{unsavedChanges:_,loadingMessage:y,promptMessage:a,buttonLinks:w,websocketUrl:s,chatHistory:l,latestDMLRequest:p,strikethroughHistory:c,attachmentData:C,dataManuallyChanged:f,undoAction:W,connectSocket:N,sendMessage:ee,setInitialPayload:S,cancelRequest:U}}),ar=Rt("root",()=>{const e=Ui(),t=an(),n=Tn(),r=ae(""),i=ae(""),o=ae("Genesis AI"),a=ae(""),s=ae({}),l=ae(""),p=ae(""),c=ae(""),f=ae(""),u=ae({}),m=ae(""),h=ae(""),g=ae(""),d=ae(""),v=ae(""),_=ae(""),C=ae(""),y=ae("Single"),w=ae("closed"),A=be(()=>n.quoteName),I=be(()=>y.value==="Single");async function S(E){r.value=E||xc("id"),i.value=xc("origin"),await T(),await N()}async function N(){try{console.info("getRecordInfo",r.value);let E=await window.salesforceConnector.getRecordInfo(r.value);return E=bt(E),E!==void 0&&(u.value=E,m.value=E.name,h.value=E.objectType,g.value=E.accountId,d.value=E.eCatalogId,v.value=E.currencyCode,_.value=E.userLocale,C.value=E.opportunityId),(E==null?void 0:E.objectType)==="XX_ORD1__Quote__c"?(n.quoteId=E==null?void 0:E.recordId,n.templateId=E==null?void 0:E.templateId,n.quoteName=E==null?void 0:E.name,n.lineItemsCount=(E==null?void 0:E.lineItemsCount)||0):(E==null?void 0:E.objectType)==="Opportunity"&&await n.getPrimaryQuote(E.recordId),E}catch(E){t.handleError(E.message)}}async function T(){var L,V;console.info("getOrgInformation",r.value);const E=await window.salesforceConnector.getOrgInformation();e.websocketUrl=E.websocketUrl,a.value=(L=E.locale)==null?void 0:L.replace("_","-"),s.value=E.user,l.value=E.orgName,p.value=E.orgId,c.value=E.orgType,f.value=E.packageVersion,y.value=(V=E==null?void 0:E.pricingSchema)==null?void 0:V.toLowerCase()}function k(E){o.value=E,s0(E)}return{id:r,origin:i,title:A,subTitle:o,locale:a,user:s,orgName:l,orgId:p,orgType:c,packageVersion:f,objectType:h,recordInfo:u,name:m,accountId:g,eCatalogId:d,currencyCode:v,userLocale:_,opportunityId:C,pricingSchema:y,isSinglePricingSchema:I,flyoutState:w,start:S,getRecordInfo:N,setSubTitle:k}}),a5="https://api-svc.blink.expedite1.com/api/product-pricing/evaluateConfigurationSelection",s5={productJSON:{productItem:{configRules:[{publishKey:"rule-a1",name:"If latest is optA include optB",priority:1,enforceRule:!0,ruleJson:'{"latestSelected":"optA","actionType":"include","affectedOptions":["optB"]}'}]}},currentConfig:{product:{publishKey:"prod-1",attributes:[]},options:[]},selected:{publishKey:"optA",attributes:[]}};async function l5(e=s5){const t=a5;try{const n=await fetch(t,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error(`HTTP error! status: ${n.status} ${n.statusText}`);return await n.json()}catch(n){throw console.info("Error fetching data with Fetch API:",n),n}}function c5(e){const t=n=>Math.min(...n.options.map(r=>r.relationshipInfo.primarySortOrder));return e.forEach(n=>{n.itemTypes.forEach(r=>{r.options.sort((i,o)=>i.relationshipInfo.primarySortOrder-o.relationshipInfo.primarySortOrder||i.itemName.localeCompare(o.itemName))}),n.itemTypes.sort((r,i)=>t(r)-t(i)||r.itemTypeName.localeCompare(i.itemTypeName))}),e.sort((n,r)=>{const i=Math.min(...n.itemTypes.map(t)),o=Math.min(...r.itemTypes.map(t));return i-o||n.category.localeCompare(r.category)}),e}const u5=(e,t)=>{const n=(r,i)=>typeof i=="function"?void 0:i;return JSON.stringify(e,n)===JSON.stringify(t,n)},sn=Rt("configurator-main",()=>{const e=wa(),t=ar(),n=Tn(),r=an(),i=Vi(),o=ae(null),a=ae(null),s=ae(null),l=ae(null),p=ae([]),c=ae(null),f=ae(null),u=ae(new Map),m=ae(!1),h=ae({configuration:!1,lineItem:!1,productOptionsPricing:!1,bestOfferPrice:!1,lineItemAttributes:!1,save:!1}),g=ae(!1),d=be(()=>v.value&&!t.isSinglePricingSchema),v=be(()=>{let D=!0,q=!0,$=!0,H=null;for(const J of s.value.categoryOptions)for(const R of J.itemTypes)for(const z of R.options)z.billingPeriod&&(H&&H!==z.billingPeriod&&($=!1),H=z.billingPeriod,!z.yrcPrice&&z.billingPeriod==="Monthly"&&(D=!1),!z.mrcPrice&&z.billingPeriod==="Yearly"&&(q=!1));return D&&q&&$}),_=be(()=>!u5(s.value,l.value)),C=be(()=>{const D=s.value.categoryOptions;return D.forEach(q=>{q.itemTypes.forEach($=>{$.selectedOptions=$.options.filter(H=>$.selected.includes(H.itemId)),$.totalPrice=function(){return $.selectedOptions.reduce((H,J)=>H+J.price*J.qty,0)||0},$.oneTimePrice=function(){return $.selectedOptions.filter(H=>!H.billingPeriod).reduce((H,J)=>H+J.price*J.qty,0)||0},$.recurringPrice=function(){return $.selectedOptions.filter(H=>H.billingPeriod).reduce((H,J)=>H+J.price*J.qty,0)||0}}),q.selectedItemTypes=q.itemTypes.filter($=>$.selected.length>0),q.totalPrice=function(){return q.itemTypes.reduce(($,H)=>$+H.totalPrice(),0)},q.oneTimePrice=function(){return q.itemTypes.reduce(($,H)=>$+H.oneTimePrice(),0)},q.recurringPrice=function(){return q.itemTypes.reduce(($,H)=>$+H.recurringPrice(),0)}}),D.filter(q=>q.itemTypes.filter($=>$.selected.length>0).length>0)}),y=be(()=>C.value.reduce((D,q)=>D+q.totalPrice(),0)),w=be(()=>{const D=C.value.reduce((H,J)=>H+J.totalPrice(),0);let q=C.value.reduce((H,J)=>H+J.oneTimePrice(),0),$=C.value.reduce((H,J)=>H+J.recurringPrice(),0);return s.value.billingPeriod?$=($+s.value.price)*s.value.qty:q=(q+s.value.price)*s.value.qty,{basePrice:s.value.price,addOns:D,oneTimePrice:q,recurringPrice:$,total:s.value.price*s.value.qty+D*s.value.qty+q+$}}),A=be(()=>{const D=new Map;return D.set(c.value.productLineItem.XX_ORD1__Item__c,c.value.productLineItem),c.value.options.forEach(q=>{D.set(q.XX_ORD1__Item__c,q)}),D}),I=be(()=>{const D=new Map;return s.value.categoryOptions.forEach(q=>{q.itemTypes.forEach($=>{$.options.forEach(H=>{D.set(H.relationshipInfo.publishKey,H)})})}),D}),S=be(()=>{const D=new Map;return D.set(f.value.product.XX_ORD1__Item__c,f.value.product),f.value.options.forEach(q=>{D.set(q.XX_ORD1__Item__c,q)}),D});function N(D){s.value.qliId&&(s.value.qliBillingPeriod==="Monthly"&&!D?s.value.price=s.value.qliSalesPrice||s.value.qliMrcPrice:s.value.qliBillingPeriod==="Yearly"&&D&&(s.value.price=s.value.qliSalesPrice)),s.value.categoryOptions.forEach(q=>{q.itemTypes.forEach($=>{$.options.forEach(H=>{H.billingPeriod&&(H.price=(D?H.yrcPrice.offerPrice:H.mrcPrice.offerPrice)||H.price,H.qliId&&(H.qliBillingPeriod==="Monthly"&&!D?H.price=H.qliSalesPrice||H.qliMrcPrice:H.qliBillingPeriod==="Yearly"&&D&&(H.price=H.qliSalesPrice)))})})})}function T(){s.value=null,l.value=null,p.value=[],c.value=null,f.value=null,u.value=new Map,m.value=!1,h.value.configuration=!1,h.value.lineItem=!1,h.value.productOptionsPricing=!1,h.value.bestOfferPrice=!1,h.value.lineItemAttributes=!1,h.value.save=!1}async function k(D,q){T(),o.value=D||e.params.itemId,a.value=q||e.params.qliId,console.info("initConfigurator",o.value,a.value,n.quoteId);const $=await E();await te(),await fe(),s.value=V($);const H=await j();L(H),await W();let J=!1;for(const R of c.value.options)R.XX_ORD1__Billing_Period__c==="Yearly"&&(J=!0);J&&(g.value=!0,N(!0)),l.value=JSON.parse(JSON.stringify(s.value))}async function E(){try{console.info("itemId",o.value);const D=await window.productManagerController.getProductConfiguration({itemId:o.value});console.info("getProductConfiguration:result",D);const q=JSON.parse(D.data).productItem;return q.categoryOptions=c5(q.categoryOptions),q}catch(D){return console.info("error",D.message),!1}}function L(D){const q=new Map;q.set(f.value.product.Id,f.value.product.XX_ORD1__Item__c),f.value.options.forEach(H=>{q.set(H.Id,H.XX_ORD1__Item__c)});const $=new Map;if(D.forEach(H=>{const J={};H.pricingTypes.forEach(R=>{R.appliedOnField==="Catalog Price"?J.catalogPrice=R:R.appliedOnField==="MRC"?J.mrcPrice=R:R.appliedOnField==="YRC"&&(J.yrcPrice=R)}),J.billingPeriod=H.billingPeriod,J.mrcPrice&&!t.isSinglePricingSchema?J.price=J.mrcPrice.offerPrice:J.catalogPrice&&t.isSinglePricingSchema&&(J.price=J.catalogPrice.offerPrice),J.offer={offerDiscount:H.offerDiscount,offerId:H.offerId,offerType:H.offerType},$.set(q.get(H.eCatalogItemId),J)}),$.has(s.value.itemId)){const H=$.get(s.value.itemId),J=s.value.price;Object.assign(s.value,H),s.value.qliId&&(s.value.price=J)}s.value.categoryOptions.forEach(H=>{H.itemTypes.forEach(J=>{J.options.forEach(R=>{if($.has(R.itemId)){const z=$.get(R.itemId),oe=R.price;Object.assign(R,z),R.qliId&&(R.price=oe)}})})})}function V(D){D.isAttributes=D.attributes&&D.attributes.length>0,u.value.set(a.value,D.attributes),p.value=D.configRules;const q=new Set;return p.value.forEach($=>{const H=JSON.parse($.ruleJson);H.optionSelected.forEach(J=>{q.add(J)}),H.affectedOptions.forEach(J=>{q.add(J)})}),K(D),D.categoryOptions.forEach($=>{$.key=$.category.toLowerCase().replace(/\s+/g,"-").replace(/[&]/g,""),$.itemTypes.forEach(H=>{H.selected=[],H.options=H.options.filter(J=>S.value.has(J.itemId)),H.numberOfColumns||(H.numberOfColumns=1),H.numberOfColumns>1&&(H.lightboxAttributes=!0),H.maxNumber||(H.maxNumber=100),H.minNumber||(H.minNumber=0),H.maxQuantity||(H.maxQuantity=1e4),H.minQuantity||(H.minQuantity=1),H.maxNumber===1?(H.isRadio=!0,H.minMessage="Please select 1 option",H.maxMessage="",H.isKit=H.options.some(J=>J.relationshipInfo.relationship==="Kit")):(H.minMessage=`Minimum of ${H.minNumber} selection${H.minNumber!==1?"s":""} required`,H.maxMessage=`Maximum of ${H.maxNumber} selection${H.maxNumber!==1?"s":""} allowed`),H.options.forEach(J=>{$.showImage=$.showImage||!!J.defaultImageURL,J.showAttributesModal=!1,J.calculateRules=q.has(J.relationshipInfo.publishKey),J.qty=H.minQuantity||1,J.getTags=()=>(J.attributes=J.attributes||[],J.attributes.filter(R=>R.value!==null&&R.value!=="").map(R=>({label:R.label,value:R.value}))),Object.defineProperty(J,"isDisabled",{get:function(){return J.relationshipInfo.relationship==="Kit"||(H.isRadio?H.isKit:!H.selected.includes(J.itemId)&&H.maxNumber===H.selected.length)}}),K(J),(A.value.has(J.itemId)||J.relationshipInfo.relationship==="Kit")&&H.selected.push(J.itemId)})})}),D}function K(D){D.isAttributes=D.attributes&&D.attributes.length>0;const q=S.value.get(D.itemId);if(A.value.has(D.itemId)){const $=A.value.get(D.itemId);D.qliId=$.Id,D.qty=$.XX_ORD1__QTY__c,D.itemName=$.XX_ORD1__Line_Description__c,D.billingPeriod=$.XX_ORD1__Billing_Period__c,D.price=$.XX_ORD1__Sales_Price__c,D.billingPeriod?D.price=$.XX_ORD1__Sales_Price__c||$.XX_ORD1__MRC__c:D.price=$.XX_ORD1__NRC__c||$.XX_ORD1__Sales_Price__c,D.qliSalesPrice=$.XX_ORD1__Sales_Price__c,D.qliNrcPrice=$.XX_ORD1__NRC__c,D.qliMrcPrice=$.XX_ORD1__MRC__c,D.qliBillingPeriod=$.XX_ORD1__Billing_Period__c,u.value.set(D.qliId,D.attributes)}else D.itemName=q.XX_ORD1__Line_Description__c||D.itemName,D.price=q.XX_ORD1__Negotiated_Price__c||q.XX_ORD1__NRC_for_New__c,D.nrcPrice=q.XX_ORD1__NRC_for_New__c}async function W(){console.info("getLineItemAttributes"),h.value.lineItemAttributes=!0;const q={lineItemIds:[c.value.productLineItem.Id,...c.value.options.map(J=>J.Id)]},$=await window.productManagerController.getLineItemAttributes({request:JSON.stringify(q)});console.info("getLineItemAttributes:result",$);const H=JSON.parse($.data);for(const[J,R]of Object.entries(H))if(u.value.has(J)){const z=u.value.get(J),oe=new Map;R==null||R.forEach(ce=>{oe.set(ce.apiName,ce)}),z==null||z.forEach(ce=>{oe.get(ce.apiName)&&(ce.value=oe.get(ce.apiName).value||"",ce.dataType==="REFERENCE"&&(ce.referenceRecordId=oe.get(ce.apiName).referenceRecordId||"",ce.referenceRecordId?ce.options=[{Name:ce.value||"",Id:ce.referenceRecordId}]:ce.options=[]))})}h.value.lineItemAttributes=!1}async function te(){h.value.lineItem=!0,console.info("getLineItems",n.quoteId,a.value);try{const D={objectId:n.quoteId,filters:{},additionalFields:["Name","XX_ORD1__Line_Description__c"],primarySort:{field:"CreatedDate",direction:"DESC"},productPage:{recordLimit:200,offset:0,productLineItemId:a.value}},q=await window.productManagerController.getLineItems({request:JSON.stringify(D)});return console.info("getLineItems:result",q),c.value=JSON.parse(q.data).products[0],console.info("result",q),h.value.lineItem=!1,q}catch(D){return console.info("error",D.message),h.value.lineItem=!1,!1}}async function fe(){h.value.productOptionsPricing=!0,console.info("getProductOptionsPricing");try{const D={objectId:n.quoteId,itemId:o.value},q=await window.productManagerController.getProductOptionsPricing({request:JSON.stringify(D)});return console.info("getProductOptionsPricing:result",q),f.value=JSON.parse(q.data),h.value.productOptionsPricing=!1,f.value}catch(D){return console.info("error",D.message),h.value.productOptionsPricing=!1,!1}}async function ee(D){console.info("getRecords");try{const q=await window.productManagerController.getRecords({request:JSON.stringify(D)});return console.info("getRecords:result",q),JSON.parse(q.data)}catch(q){return console.info("error",q.message),!1}}async function j(){h.value.bestOfferPrice=!0,console.info("getBestOfferPrice");const D=[f.value.product.Id];f.value.options.forEach(q=>{D.push(q.Id)});try{const q=await O(D);return h.value.bestOfferPrice=!1,q}catch(q){return console.info("error",q.message),h.value.bestOfferPrice=!1,!1}}async function O(D){const q={accountId:t.accountId,eCatalogItemIds:D,pricePreference:"Heighest Priority"},$=await window.productManagerController.calculateBestOfferPrice({request:JSON.stringify(q)});return console.info("calculateBestOfferPrice:result",$),h.value.bestOfferPrice=!1,JSON.parse($.data)}async function P(){m.value=!0,h.value.save=!0,console.info("maintainQuoteConfiguration");const D=[],q=[];s.value.categoryOptions.forEach(J=>{J.itemTypes.forEach(R=>{R.options.forEach(z=>{R.selected.includes(z.itemId)?D.push(M(z)):z.qliId&&q.push(z.qliId)})})});const $={objectId:n.quoteId,eCatalogId:t.eCatalogId,isGenesisAI:!0,blinkUser:!1,optionsToRemove:q,grandFatheredOptionsToRemove:[],productLineItem:{...M(s.value),optionLineItems:D}};console.info("maintainQuoteConfiguration:request",$);const H=await window.productManagerController.maintainQuoteConfiguration({request:JSON.stringify($)});if(console.info("maintainQuoteConfiguration:result",H),H!=null&&H.error){const J={title:"Unable to Save Configuration",description:H.error,button:{label:"Back to Configuration",action:()=>{m.value=!1}},cancel:{label:"Quote List",action:()=>{i.push("/quote-item?id="+n.quoteId)}}};r.errorPopup=J}else l.value=JSON.parse(JSON.stringify(s.value)),console.info("maintainQuoteConfiguration:result",H);h.value.save=!1}function M(D){const q={};D.isAttributes&&D.attributes.forEach(H=>{H.apiName.includes(".")||(H.dataType==="BOOLEAN"?q[H.apiName]=H.value?"true":"false":H.dataType==="REFERENCE"?q[H.apiName]=H.referenceRecordId:q[H.apiName]=H.value)});const $={attributes:q,itemId:D.itemId,lineItemId:D.qliId,lineDescription:D.itemName,qty:D.qty,billingPeriod:D.billingPeriod,...D.offer};return D.billingPeriod&&v.value&&!t.isSinglePricingSchema&&($.billingPeriod=g.value?"Yearly":"Monthly"),!t.isSinglePricingSchema&&!D.billingPeriod?$.nrcPrice=D.price:($.applyOnField="Catalog Price",$.salesPrice=D.price,$.nrcPrice=D.nrcPrice),$}async function Z(){const D={objectId:t.eCatalogId,productItemId:o.value};try{let q=await window.productManagerController.getProductCrossSells({request:JSON.stringify(D)});if(console.info("getProductCrossSells:result",q),q=q.data?JSON.parse(q.data):{},q.crossSells.length===0)return q;const $=q.crossSells.map(R=>R.Id),H=await O($),J=new Map;return H.forEach(R=>{J.set(R.eCatalogItemId,{...R,...R.pricingTypes[0]})}),q.crossSells.forEach(R=>{R.loading=!1,R.Name=R.XX_ORD1__Line_Description__c||R.XX_ORD1__Item__r.Name,R.Description=R.XX_ORD1__Item__r.XX_ORD1__Product_Description__c,J.has(R.Id)?(R.Price=J.get(R.Id).offerPrice,R.priceFormatted=J.get(R.Id).formattedOfferPrice,R.offer={offerDiscount:J.get(R.Id).offerDiscount,offerId:J.get(R.Id).offerId,offerType:J.get(R.Id).offerType}):(R.Price=R.XX_ORD1__List_Price2__c,R.priceFormatted=R.XX_ORD1__List_Price2__c,R.offer={offerDiscount:0,offerId:null,offerType:null})}),q}catch(q){return console.info("error",q.message),!1}}async function Q(D,q){var R,z;const $={product:{publishKey:s.value.publishKey,lineDescription:s.value.itemName},options:[]};s.value.categoryOptions.forEach(oe=>{oe.itemTypes.forEach(ce=>{ce.options.forEach(le=>{ce.selected.includes(le.itemId)&&$.options.push({publishKey:le.relationshipInfo.publishKey,lineDescription:le.itemName})})})}),console.info("evaluateConfigSelection:currentConfig.options",$.options);const H={productJSON:{productItem:{configRules:p.value}},currentConfig:$,selected:D?{publishKey:(R=D.relationshipInfo)==null?void 0:R.publishKey,attributes:D.attributes,lineDescription:D.itemName}:{},unselected:q?{publishKey:(z=q.relationshipInfo)==null?void 0:z.publishKey,attributes:q.attributes,lineDescription:q.itemName}:{}};return await l5(H)}async function B(){try{const D=["Name","XX_ORD1__Line_Description__c","XX_ORD1__Item__r.XX_ORD1__Product_Description__c","XX_ORD1__Sales_Price__c","XX_ORD1__SYS_Configuration_Status2__c"],$=(await n.getQuoteLineItemsWithFilteredTable({fields:D,recordId:n.quoteId,filters:[],includeOptions:!1,totalFields:[]})).lineItems;return console.info("fetchQuoteLineItems:res",$),$}catch(D){console.info("[ERROR]: fetchQuoteLineItems()123 error = ",D.message)}}async function U(D){const q={quoteId:n.quoteId,lstQLIRequest:[{eCatalogItemId:D.Id,quantity:1,offerApplicable:D.offer}]};try{const $=await window.productManagerController.createQuoteProducts({request:JSON.stringify(q)});console.info("getProductCrossSells:result",$)}catch($){return console.info("error",$.message),!1}}return{itemId:o,configuration:s,_configurationCopy:l,lineItem:c,savedScreen:m,loading:h,summary:C,addOns:y,summaryPrices:w,optionByItemId:A,attributesByQLIId:u,optionByPublishKey:I,showYearlyPricing:g,isYearlyPricingExist:v,isChangedConfiguration:_,isRecurringPricingSchema:d,changePricingScheme:N,createQuoteProducts:U,resetConfigurator:T,fetchQuoteLineItems:B,getRecords:ee,getProductCrossSells:Z,initConfigurator:k,maintainQuoteConfiguration:P,evaluateConfigSelection:Q}}),f5={class:"ect-p-4 ect-flex ect-gap-2 ect-items-center ect-justify-between ect-border-b ect-border-gray-200"},d5={class:"ect-flex ect-items-center ect-gap-3"},h5={class:"ect-text-xl ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},p5={key:0,class:"ect-flex ect-gap-1.5 ect-items-center"},m5=b("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Saving configuration...",-1),g5={key:1,class:"ect-flex ect-gap-1.5 ect-items-center"},v5=b("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Configuration Saved Successfully",-1),y5={key:1,class:"ect-flex ect-flex-col ect-gap-4 ect-flex-1 ect-overflow-y-auto ect-mb-16"},_5=b("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed ect-p-4 ect-pb-0"},"You may consider these products",-1),b5={class:"ect-flex ect-flex-col ect-gap-4 ect-p-4 ect-pt-0 ect-overflow-y-auto"},C5=["data-test-id"],w5={class:"ect-flex-1 ect-flex ect-flex-col ect-gap-2"},x5={class:"ect-text-sm ect-font-semibold ect-text-gray-800 ect-leading-tight"},k5={class:"ect-text-sm ect-font-medium ect-text-gray-600 ect-leading-relaxed ect-line-clamp-2"},E5={class:"ect-flex ect-flex-row ect-justify-between ect-items-center"},O5={class:"ect-text-sm ect-font-semibold ect-text-gray-800"},S5={key:2,class:"ect-flex ect-flex-col ect-gap-4 ect-m-4 ect-flex-1 ect-overflow-y-auto"},I5=b("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},"What do you want to do next?",-1),A5={class:"ect-flex ect-flex-col ect-gap-4"},T5=["data-test-id","onClick"],N5={class:"ect-flex ect-items-center ect-justify-center"},P5={class:"ect-flex ect-flex-col ect-items-center ect-gap-2 ect-w-full"},L5=["data-test-id"],R5=["data-test-id"],M5={key:3,class:"ect-bg-light-bg-x ect-border-t ect-border-gray-200 ect-flex-shrink-0 ect-sticky ect-bottom-0 ect-pb-4"},q5={class:"ect-flex ect-flex-col ect-gap-4"},j5={class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed ect-p-4 ect-pb-0"},D5={class:"ect-flex ect-flex-col ect-gap-4 ect-p-4 ect-pt-0 ect-overflow-y-auto"},B5={class:"ect-bg-white ect-border ect-border-gray-300 ect-rounded-md ect-p-3 ect-flex ect-flex-col","data-test-id":"configurator-recommend-card-next-product"},$5={class:"ect-flex-1 ect-flex ect-flex-col ect-gap-2"},F5={class:"ect-text-sm ect-font-semibold ect-text-gray-800 ect-leading-tight"},V5={class:"ect-text-sm ect-font-medium ect-text-gray-600 ect-leading-relaxed ect-line-clamp-2"},H5={class:"ect-flex ect-flex-row ect-justify-between ect-items-center"},U5={class:"ect-text-sm ect-font-semibold ect-text-gray-800"},z5={__name:"ConfiguratorRecommend",setup(e){const t=sn(),n=Tn(),r=Vi(),i=be(()=>t.configuration),o=ae(!0),a=ae(""),s=ae([{icon:"configuration",title:"Back to current Product Configuration",description:"Returns to the active product configuration page.",link:"/item/overview",action:"backToConfiguration"},{icon:"menu",title:"Back to Quote List Page",description:"Returns to the main quote list page.",link:"/quote-item",action:"backToQuoteList"}]),l=ae(null),p=ae([]),c=async h=>{h.loading=!0,await t.createQuoteProducts(h),h.disabled=!0,h.loading=!1},f=h=>{h.action==="backToConfiguration"?t.savedScreen=!1:h.action==="backToQuoteList"?r.push("/quote-item?id="+n.quoteId):h.link&&r.push(h.link)};async function u(){const h=await t.fetchQuoteLineItems();console.info("getQuoteLineItems1:_quoteLineItems",h);const g=h.filter(v=>v.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration").length;console.info("getQuoteLineItems2:needsConfigurationCount",g),a.value=`(${h.length-g}/${h.length})`;const d=h.find(v=>v.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration"&&v.Id!=t.qliId);return console.info("getQuoteLineItems3:result",d),l.value=d?{Name:d.XX_ORD1__Line_Description__c,Description:d.XX_ORD1__Item__r.XX_ORD1__Product_Description__c,Price:d.XX_ORD1__Sales_Price__c,XX_ORD1__Item__c:d.XX_ORD1__Item__c,Id:d.Id}:null,console.info("getQuoteLineItems4:configueredProduct",l.value),h}async function m(){t.resetConfigurator(),r.push({path:"/configurator/"+l.value.XX_ORD1__Item__c+"/"+l.value.Id}),t.initConfigurator(l.value.XX_ORD1__Item__c,l.value.Id)}return wn(async()=>{o.value=!0;const h=await u(),g=await t.getProductCrossSells(),d=new Set;h.forEach(v=>{d.add(v.XX_ORD1__Item__c)}),g.crossSells.forEach(v=>{v.disabled=d.has(v.XX_ORD1__Item__c)}),p.value=g.crossSells||[],o.value=!1}),(h,g)=>(X(),ne(Oe,null,[b("div",f5,[b("div",d5,[_e(Ge,{icon:"arrow",symbol:"",size:12,onClick:g[0]||(g[0]=d=>Xe(t).savedScreen=!1)}),b("h2",h5,ve(i.value.itemName),1)]),Xe(t).loading.save?(X(),ne("div",p5,[_e(Oc,{svg:""}),m5])):(X(),ne("div",g5,[_e(Ge,{icon:"check",color:"#136E05",size:14,"data-test-id":"item-tabs-before-button-icon"}),v5]))]),o.value?(X(),Te(Ca,{key:0,type:"recommendations",rows:4})):p.value.length>0?(X(),ne("div",y5,[_5,b("div",b5,[(X(!0),ne(Oe,null,ze(p.value,(d,v)=>(X(),ne("div",{key:d.Id||v,class:"ect-bg-white ect-border ect-border-gray-300 ect-rounded-md ect-p-3 ect-flex ect-flex-col","data-test-id":`configurator-recommend-card-${d.Id||v}`},[b("div",w5,[b("h4",x5,ve(d.Name),1),b("p",k5,ve(d.Description),1)]),b("div",E5,[b("div",O5,ve(h.$formatCurrency(d.Price)),1),_e(Nt,{btype:d.disabled?"secondary":"primary","button-style":d.disabled?"normal":"outlined",size:"medium",class:Ie({"ect-w-[120px]":d.loading}),loading:d.loading,disabled:d.disabled||d.loading,"data-test-id":`configurator-recommend-button-add-${d.Id||v}`,onClick:_=>c(d)},{default:De(()=>[Fe(ve(d.loading?"":d.disabled?"Added to Quote":"Add to Quote"),1)]),_:2},1032,["btype","button-style","class","loading","disabled","data-test-id","onClick"])])],8,C5))),128))])])):(X(),ne("div",S5,[I5,b("div",A5,[(X(!0),ne(Oe,null,ze(s.value,(d,v)=>(X(),ne("div",{key:d.title||v,class:"ect-bg-white ect-border ect-border-[#DEDEDE] ect-rounded-xl ect-p-4 md:ect-p-5 lg:ect-p-6 ect-flex ect-flex-col ect-items-center ect-gap-4 md:ect-gap-6 lg:ect-gap-8 ect-cursor-pointer ect-transition-all ect-duration-200 hover:ect-shadow-md hover:ect-border-gray-400","data-test-id":`configurator-recommend-redirect-card-${v}`,onClick:_=>f(d)},[b("div",N5,[_e(Ge,{icon:d.icon,size:20,color:"#000000","data-test-id":`configurator-recommend-redirect-icon-${v}`},null,8,["icon","data-test-id"])]),b("div",P5,[b("h4",{class:"ect-text-sm ect-font-semibold ect-text-[#5F5F5F] ect-text-center ect-leading-[1.43]","data-test-id":`configurator-recommend-redirect-title-${v}`},ve(d.title),9,L5),b("p",{class:"ect-text-sm ect-font-normal ect-text-[#828282] ect-text-center ect-leading-[1.71]","data-test-id":`configurator-recommend-redirect-description-${v}`},ve(d.description),9,R5)])],8,T5))),128))])])),l.value?(X(),ne("footer",M5,[b("div",q5,[b("h3",j5," Configuere next product from your quote "+ve(a.value),1),b("div",D5,[b("div",B5,[b("div",$5,[b("h4",F5,ve(l.value.Name),1),b("p",V5,ve(l.value.Description),1)]),b("div",H5,[b("div",U5,ve(h.$formatCurrency(l.value.Price)),1),_e(Nt,{btype:"primary","button-style":"filled",size:"medium","data-test-id":"configurator-recommend-button-add-next-product",onClick:m},{default:De(()=>[Fe(" Configure Now ")]),_:1})])])])])])):ye("",!0)],64))}},K5=["data-test-id"],Z5=Ve({__name:"AppPill",props:{variant:{type:String,default:"",validator:e=>["success","error",""].includes(e)},dataTestId:{type:String,default:""}},setup(e){return(t,n)=>(X(),ne("span",{class:Ie(["ect-pill",{"ect-pill-success":e.variant==="success","ect-pill-error":e.variant==="error","ect-pill-default":!e.variant}]),"data-test-id":e.dataTestId},[Ze(t.$slots,"default",{},void 0,!0)],10,K5))}},[["__scopeId","data-v-c7f05fa0"]]),Q5=["data-test-id"],X5=["data-test-id"],J5=["data-test-id","onClick"],W5=["data-test-id"],G5=Ve({__name:"AppTabsV2",props:{showTabs:{type:Boolean,default:!0},modelValue:{type:String,default:""},border:{type:Boolean,default:!1},tabs:{type:Array,required:!0,validator:e=>e.every(t=>typeof t=="object"&&t.title&&t.key&&(t.sections===void 0||Array.isArray(t.sections)))},dataTestId:{type:String,required:!0}},emits:["update:modelValue","tab-change"],setup(e,{emit:t}){const n=e,r=t,i=be(()=>{var a;return n.modelValue||((a=n.tabs[0])==null?void 0:a.key)||""}),o=a=>{r("update:modelValue",a),r("tab-change",a)};return(a,s)=>(X(),ne("div",{class:"ect-page-tabs","data-test-id":e.dataTestId},[e.showTabs?(X(),ne("div",{key:0,class:Ie(["ect-page-tabs-header",[{"ect-tab-border":e.border}]]),"data-test-id":`${e.dataTestId}-header`},[(X(!0),ne(Oe,null,ze(e.tabs,l=>(X(),ne("button",{key:l.key,class:Ie(["ect-page-tab-button",`ect-page-tab-button${i.value===l.key?"-active":""} ${l.tabClass||""}`]),"data-test-id":`${e.dataTestId}-tab-${l.key}`,onClick:p=>o(l.key)},[Fe(ve(l.title)+" ",1),l.pill!==void 0&&l.pill!==null?(X(),Te(Z5,{key:0,class:"ect-ml-2",variant:l.pillStyle,"data-test-id":`${e.dataTestId}-tab-${l.key}-pill`},{default:De(()=>[Fe(ve(l.pill),1)]),_:2},1032,["variant","data-test-id"])):ye("",!0)],10,J5))),128))],10,X5)):ye("",!0),b("div",{class:"ect-page-tab-content","data-test-id":`${e.dataTestId}-content`},null,8,W5)],8,Q5))}},[["__scopeId","data-v-f22cb1ed"]]),Y5=["data-test-id"],eh=["disabled","data-test-id"],th=["value","disabled","data-test-id"],nh=["disabled","data-test-id"],zi={__name:"CounterButton",props:{value:{type:Number,required:!0,default:null},min:{type:Number,default:1},max:{type:Number,default:999},empty:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:value","change"],setup(e,{emit:t}){const n=e,r=t,i=be(()=>n.min==null?0:n.min),o=be(()=>n.max==null?999:n.max),a=(y,w,A)=>Math.min(Math.max(y,w),A),s=y=>{if(y==null||y==="")return NaN;const w=Number(y);return Number.isFinite(w)?w:NaN},l=ae(null),p=ae(n.value??i.value),c=y=>{p.value=a(y,i.value,o.value)};n.value!==null&&c(n.value);const f=be(()=>p.value),u=be(()=>l.value!=null?l.value:String(f.value)),m=be(()=>n.disabled||f.value<=i.value),h=be(()=>n.disabled||f.value>=o.value);function g(y){y!==n.value&&(p.value=y,r("update:value",y),r("change",y))}function d(){if(m.value)return;const y=a(f.value-1,i.value,o.value);l.value=null,g(y)}function v(){if(h.value)return;const y=a(f.value+1,i.value,o.value);l.value=null,g(y)}function _(y){const A=String(y.target.value??"").replace(/\D+/g,"");l.value=A}function C(){const y=s(l.value),w=i.value,A=a(Number.isNaN(y)?w:y,i.value,o.value);l.value=null,g(A)}return(y,w)=>(X(),ne("div",{class:"ect-flex ect-items-center ect-gap-1","data-test-id":e.dataTestId},[b("button",{type:"button",class:Ie(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":m.value,"ect-cursor-not-allowed":m.value}]),disabled:m.value,"data-test-id":`${e.dataTestId}-decrement`,onClick:d}," - ",10,eh),b("input",{type:"text",inputmode:"numeric",pattern:"[0-9]*",value:e.empty?"":u.value,disabled:e.disabled,class:"ect-h-7 ect-w-[48px] ect-px-2 ect-border ect-border-gray ect-rounded-md ect-text-center ect-text-sm ect-font-medium ect-text-gray-900 focus:ect-outline-none focus:ect-border-gray-400 ect-bg-white","data-test-id":`${e.dataTestId}-input`,onInput:_,onBlur:C},null,40,th),b("button",{type:"button",class:Ie(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":h.value,"ect-cursor-not-allowed":h.value}]),disabled:h.value,"data-test-id":`${e.dataTestId}-increment`,onClick:v}," + ",10,nh)],8,Y5))}},rh={class:"ect-flex ect-justify-end ect-items-center ect-gap-2.5 ect-px-6 ect-pb-6 ect-pt-4 ect-bg-white ect-border-t ect-border-gray-300 ect-shadow-[0_-2px_4px_0px_rgba(0,0,0,0.11)]","data-test-id":"configurator-footer"},ih={"data-test-id":"configurator-footer-quantity"},oh={class:"ect-flex ect-justify-end ect-items-center ect-gap-6 ect-px-8 ect-py-0 ect-flex-1","data-test-id":"configurator-footer-prices"},ah=["data-test-id"],sh=["data-test-id"],lh=["data-test-id"],ch=["data-test-id"],uh={__name:"ConfiguratorFooter",props:{item:{type:Object,required:!0,default:()=>{}},disabled:{type:Boolean,default:!1},btnText:{type:String,default:"Save"}},emits:["update:qty","continue"],setup(e,{emit:t}){const n=sn(),r=e,i=ae(r.item),o=be(()=>{const l=n.summaryPrices,p=[];return n.isRecurringPricingSchema?(p.push({label:"One Time Price",value:l.oneTimePrice,highlight:!1}),p.push({label:n.showYearlyPricing?"Yearly Price":"Monthly Price",value:l.recurringPrice,highlight:!1})):(p.push({label:"Base Price",value:l.basePrice,highlight:!1}),p.push({label:"Add Ons",value:l.addOns,highlight:!1}),p.push({label:"Total Price",value:l.total,highlight:!1})),p}),a=t,s=()=>{r.disabled||a("continue")};return(l,p)=>(X(),ne("footer",rh,[b("div",ih,[_e(zi,{value:i.value.qty,"onUpdate:value":p[0]||(p[0]=c=>i.value.qty=c),min:1,max:999,disabled:e.disabled,"is-selected":!0,"data-test-id":"configurator-footer-counter-button"},null,8,["value","disabled"])]),b("div",oh,[(X(!0),ne(Oe,null,ze(o.value,(c,f)=>(X(),ne(Oe,{key:f},[b("div",{class:"ect-flex ect-flex-col ect-justify-center","data-test-id":`configurator-footer-price-${f}`},[b("span",{class:"ect-text-xs ect-font-normal ect-text-gray-500 ect-text-left","data-test-id":`configurator-footer-price-label-${f}`},ve(c.label),9,sh),b("span",{class:Ie(["ect-text-left",c.highlight?"ect-text-lg ect-font-bold ect-text-green-700":"ect-text-sm ect-font-medium ect-text-gray-800 "]),"data-test-id":`configurator-footer-price-value-${f}`},ve(l.$formatCurrency(c.value)),11,lh)],8,ah),f<o.value.length-1?(X(),ne("div",{key:0,class:"ect-w-0 ect-h-5 ect-border-l ect-border-gray-400","data-test-id":`configurator-footer-divider-${f}`},null,8,ch)):ye("",!0)],64))),128))]),_e(Nt,{class:"ect-min-w-[100px]",btype:e.disabled?"secondary":"primary",disabled:e.disabled,"button-style":"primary",size:"medium","data-test-id":"configurator-footer-button-continue",onClick:s},{default:De(()=>[Fe(ve(e.btnText),1)]),_:1},8,["btype","disabled"])]))}},fh={class:"ect-w-full ect-bg-white ect-mb-4","data-test-id":"configurator-type-section"},dh={class:"ect-sticky ect-top-0 ect-z-30 ect-bg-white ect-shadow-sm ect-p-3 ect-px-4 ect-border-b ect-border-gray-200 ect-flex ect-justify-between ect-items-center","data-test-id":"configurator-type-header-sticky"},hh={class:"ect-flex ect-flex-col"},ph={class:"ect-font-bold ect-text-text-success ect-leading-tight"},mh=["innerHTML"],gh={key:0,class:"ect-flex ect-items-center ect-gap-2 ect-px-2 ect-py-1","data-test-id":"configurator-type-message"},vh={class:"ect-text-xs ect-font-medium ect-text-gray-600 ect-leading-tight ect-min-w-[190px]"},yh={class:"ect-divide-y ect-divide-gray-100 ect-overflow-y-auto"},_h={__name:"ConfiguratorType",props:{title:{type:String,required:!0},description:{type:String,default:""},message:{type:String,default:""}},setup(e){return(t,n)=>(X(),ne("section",fh,[b("header",dh,[b("div",hh,[b("h2",ph,ve(e.title),1),e.description?(X(),ne("p",{key:0,class:"ect-mt-1 ect-text-xs ect-text-gray-500 ect-leading-tight",innerHTML:e.description},null,8,mh)):ye("",!0)]),e.message?(X(),ne("div",gh,[_e(Ge,{icon:"info",symbol:"",color:"#198708",size:14,"data-test-id":"configurator-type-message-icon"}),b("span",vh,ve(e.message),1)])):ye("",!0)]),b("div",yh,[Ze(t.$slots,"default")])]))}},bh={__name:"ShadowDisplay",props:{content:{type:String,required:!0}},setup(e){const t=e,n=ae(null);let r=null;return xn(()=>{n.value&&!r&&(r=n.value.attachShadow({mode:"open"}),r.innerHTML=t.content)}),St(()=>t.content,i=>{r&&(r.innerHTML=i)}),(i,o)=>(X(),ne("div",{ref_key:"host",ref:n},null,512))}},Ch=["data-test-id"],wh=["data-test-id"],xh=["data-test-id"],kh=[b("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("g",{id:"Group"},[b("path",{id:"Vector",d:"M7 1.3125V12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"}),b("path",{id:"Vector_2",d:"M1.3125 7H12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)],Eh=["data-test-id"],Oh=["data-test-id"],Sh=["data-test-id"],Ih=["data-test-id"],Ah=["data-test-id"],Th=["data-test-id","innerHTML"],Zt={__name:"Tag",props:{label:{type:String,default:""},value:{type:String,default:""},addButton:{type:Boolean,default:!1},editButton:{type:Boolean,default:!1},dataTestId:{type:String,default:""}},setup(e){const t=e,n=be(()=>{const r=t.value;if(typeof r!="string")return!1;const i=new DOMParser().parseFromString(r,"text/html");return Array.from(i.body.childNodes).some(o=>o.nodeType===1)});return(r,i)=>e.addButton?(X(),ne("div",{key:0,class:"ect-bg-orange-4 ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-orange-secondary","data-test-id":e.dataTestId},[b("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-orange-secondary ect-flex ect-items-center ect-gap-1","data-test-id":`${e.dataTestId}-content`},[b("div",{"data-test-id":`${e.dataTestId}-add-icon`},kh,8,xh),Fe(" "+ve(e.label),1)],8,wh)],8,Ch)):e.editButton?(X(),ne("div",{key:1,class:"ect-bg-white ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-success","data-test-id":e.dataTestId},[b("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-success ect-flex ect-items-center ect-gap-1","data-test-id":`${e.dataTestId}-content`},ve(e.label),9,Oh)],8,Eh)):(X(),ne("div",{key:2,class:"ect-bg-white ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-rounded-md ect-border ect-border-solid ect-border-neutral-200","data-test-id":e.dataTestId},[b("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${e.dataTestId}-label`},ve(e.label),9,Ih),e.value?(X(),ne("span",{key:0,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${e.dataTestId}-separator`}," : ",8,Ah)):ye("",!0),n.value?(X(),Te(bh,{key:1,content:e.value},null,8,["content"])):e.value?(X(),ne("span",{key:2,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-neutral-700","data-test-id":`${e.dataTestId}-value`,innerHTML:e.value},null,8,Th)):ye("",!0)],8,Sh))}},Nh=["data-test-id"],Ph=["data-test-id"],Lh=["data-test-id"],Rh=["type","step","min","data-test-id"],ka=Ve({__name:"InputEdit",props:{modelValue:{type:String,required:!0},type:{type:String,default:"string",validator:e=>["string","number","currency"].includes(e)},tag:{type:String,default:"span"},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:modelValue","change"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=ae(!1),a=ae(!1),s=ae(""),l=ae(null),p=be(()=>r.type==="currency"?v(r.modelValue):r.type==="number"?_(r.modelValue):r.modelValue),c=be(()=>r.type==="string"?"text":"number"),f=be(()=>r.type==="currency"?"0.01":void 0),u=be(()=>r.type==="currency"?"0":void 0),m=()=>{r.disabled||(r.type==="currency"?s.value=parseFloat(r.modelValue)||"0.00":r.type==="number"?s.value=parseFloat(r.modelValue)||"0":s.value=r.modelValue,o.value=!0,Ut(()=>{l.value&&(l.value.focus(),l.value.select())}))},h=()=>{let C=s.value;if(r.type==="number"||r.type==="currency"){const y=parseFloat(s.value);isNaN(y)?C=r.modelValue:C=r.type==="currency"?y.toFixed(2):y.toString()}C!==r.modelValue&&(i("update:modelValue",C),i("change",C)),o.value=!1},g=()=>{s.value=r.modelValue,o.value=!1},d=()=>{o.value&&h()},v=C=>!C||isNaN(C)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(parseFloat(C)),_=C=>!C||isNaN(C)?"0":new Intl.NumberFormat("en-US").format(parseFloat(C));return St(()=>r.modelValue,C=>{o.value||(s.value=C)}),t({startEditing:m,saveChanges:h,cancelEditing:g}),(C,y)=>{const w=Hf("click-outside");return X(),ne("div",{class:"ect-relative ect-inline-block ect-min-w-[60px] ect-h-[30px]","data-test-id":e.dataTestId,onMouseenter:y[1]||(y[1]=A=>a.value=!0),onMouseleave:y[2]||(y[2]=A=>a.value=!1)},[o.value?Cn((X(),ne("div",{key:1,class:"ect-w-full ect-h-full","data-test-id":`${e.dataTestId}-input-wrapper`},[Cn(b("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":y[0]||(y[0]=A=>s.value=A),type:c.value,step:f.value,min:u.value,class:Ie(["ect-w-full ect-h-full ect-px-3 ect-bg-white ect-border ect-border-green-500 ect-rounded-sm ect-text-gray-700 ect-text-base ect-font-sans ect-outline-none ect-duration-200",C.$attrs.class]),"data-test-id":`${e.dataTestId}-input`,onKeyup:[qr(h,["enter"]),qr(g,["esc"])],onBlur:h},null,42,Rh),[[u1,s.value]])],8,Lh)),[[w,d]]):(X(),ne("div",{key:0,class:Ie(["ect-flex ect-items-center ect-gap-2 ect-rounded ect-transition-colors ect-duration-200",{"ect-cursor-pointer":!e.disabled}]),"data-test-id":`${e.dataTestId}-display`,onClick:m},[(X(),Te(bl(e.tag),ua(C.$attrs,{class:"ect-m-0 ect-text-inherit","data-test-id":`${e.dataTestId}-text`}),{default:De(()=>[Fe(ve(p.value)+" ",1),_e(Ge,{class:Ie(a.value&&!e.disabled?"ect-visible":"ect-invisible"),icon:"edit",size:"12",color:"#828282","data-test-id":`${e.dataTestId}-edit-icon`},null,8,["class","data-test-id"])]),_:1},16,["data-test-id"]))],10,Ph))],40,Nh)}}},[["__scopeId","data-v-07416d80"]]),Mh=["data-test-id","data-publish-key"],qh={key:0,class:"ect-text-xs ect-text-gray-500 ect-text-white ect-font-medium ect-leading-tight ect-absolute ect-top-[-.7rem] ect-left-[-1rem] ect-bg-text-success ect-rounded-xl ect-px-2 ect-py-1"},jh={key:1,class:"ect-flex ect-items-start ect-gap-4 ect-p-3 ect-px-4"},Dh={key:0,class:"ect-w-16 ect-h-16 ect-flex ect-items-center ect-justify-center ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0"},Bh=["src","alt"],$h={class:"ect-flex-1 ect-min-w-0"},Fh={class:"ect-flex ect-gap-4 ect-items-center ect-justify-between"},Vh={class:"ect-flex ect-flex-row ect-gap-3"},Hh=b("div",{class:"ect-w-px ect-h-auto ect-bg-gray-200 ect-mx-2"},null,-1),Uh={class:"ect-flex ect-flex-col ect-max-w-[125px]"},zh={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},Kh=["innerHTML"],Zh={key:0,class:"ect-flex ect-flex-wrap ect-gap-2.5 ect-mt-2"},Qh=["data-test-id"],Xh=["data-test-id"],Jh={key:1,class:"ect-inline-block ect-mb-2"},Wh={key:2,class:"ect-flex ect-flex-col ect-gap-3 ect-p-3 ect-h-full ect-justify-between"},Gh={class:"ect-flex ect-items-start ect-gap-2"},Yh={class:"ect-w-16 ect-h-16 ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0 ect-overflow-hidden"},e9=["src","alt"],t9={class:"ect-flex-1 ect-min-w-0"},n9={class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},r9={class:"ect-mt-1 ect-text-sm ect-text-gray-700 ect-leading-tight"},i9={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},o9={key:0,class:"ect-flex ect-flex-wrap ect-gap-1.5"},a9=["data-test-id"],s9=["data-test-id"],l9={key:1,class:"ect-inline-block ect-mb-2"},c9={class:"ect-flex ect-justify-between ect-items-center"},u9={class:"ect-flex ect-flex-col"},f9=b("p",{class:"ect-text-xs ect-text-gray-500 ect-font-medium ect-leading-tight"},"Price",-1),d9={key:3,"data-test-id":"configurator-item-slot-details",class:"ect-bg-white ect-rounded-md"},h9={__name:"ConfiguratorItem",props:{item:{type:Object,required:!0},name:{type:String,required:!0},description:{type:String,default:""},imageUrl:{type:String,default:""},price:{type:Number,required:!0},quantity:{type:Number,default:1},selected:{type:Boolean,default:!1},tags:{type:Array,default:()=>[]},attributes:{type:Array,default:()=>[]},size:{type:Number,default:1},minQuantity:{type:Number,default:null},maxQuantity:{type:Number,default:null},showImage:{type:Boolean,default:!1},option:{type:Object,default:null},isAttributes:{type:Boolean,default:!1},showAttributes:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:quantity","update:name","edit-attributes"],setup(e,{emit:t}){const n=e,r=t,i=ae(null),o=ae(0),a=ae(n.item),s=be(()=>a.value.relationshipInfo.relationship==="Kit"?"ect-bg-green-3 ect-border-gray-200 ect-border-success":n.disabled?"ect-bg-light-bg-x ect-border-gray-200":n.selected?"ect-bg-green-3 ect-border-gray-200 ect-border-success":"ect-bg-white ect-border-gray-200 hover:ect-border-success"),l=be({get:()=>n.quantity,set:h=>r("update:quantity",h)}),p=be({get:()=>n.name,set:h=>r("update:name",h)}),c=h=>{r("update:quantity",h)},f=be(()=>{if(o.value===0)return n.tags;const g=Math.floor(o.value/120);return n.tags.slice(0,Math.max(1,g))}),u=be(()=>Math.max(0,n.tags.length-f.value.length)),m=()=>{if(i.value){const h=i.value,g=80,d=120,v=32,_=64;o.value=h.offsetWidth-g-d-v-_}};return xn(()=>{Ut(()=>{m()})}),St(()=>n.tags,()=>{Ut(()=>{m()})},{deep:!0}),xn(()=>{window.addEventListener("resize",m)}),(h,g)=>(X(),ne("div",{ref_key:"containerRef",ref:i,class:Ie(["ect-w-full ect-rounded-md ect-border-1 ect-transition-colors ect-relative",s.value]),"data-test-id":`configurator-item-${e.item.itemId}`,"data-publish-key":e.item.publishKey},[e.item.relationshipInfo.relationship==="Kit"?(X(),ne("div",qh," KIT ")):ye("",!0),e.size===1?(X(),ne("div",jh,[e.showImage?(X(),ne("div",Dh,[e.imageUrl?(X(),ne("img",{key:0,src:e.imageUrl,alt:p.value,class:"ect-w-full ect-h-full ect-object-cover"},null,8,Bh)):(X(),Te(Ge,{key:1,disabled:"",icon:"image",symbol:"",size:20,color:"#ACACAC"}))])):ye("",!0),b("div",$h,[b("div",Fh,[_e(ka,{modelValue:p.value,"onUpdate:modelValue":g[0]||(g[0]=d=>p.value=d),tag:"h3",class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},null,8,["modelValue"]),b("div",Vh,[b("div",{onClick:g[2]||(g[2]=Tt(()=>{},["stop"]))},[_e(zi,{value:l.value,"onUpdate:value":g[1]||(g[1]=d=>l.value=d),min:e.minQuantity,max:e.maxQuantity,"data-test-id":`configurator-item-counter-${e.item.itemId}`,onChange:c},null,8,["value","min","max","data-test-id"])]),Hh,b("div",Uh,[_e(ka,{modelValue:a.value.price,"onUpdate:modelValue":g[3]||(g[3]=d=>a.value.price=d),tag:"p",type:"currency",class:"ect-text-base ect-font-bold"},null,8,["modelValue"])]),b("div",zh,[Ze(h.$slots,"selection-control")])])]),b("p",{class:"ect-mt-2 ect-text-sm ect-text-gray-700 ect-leading-tight",innerHTML:e.description},null,8,Kh),e.isAttributes&&e.showAttributes&&e.selected?(X(),ne("div",Zh,[a.value.getTags().length>0?(X(),ne(Oe,{key:0},[(X(!0),ne(Oe,null,ze(f.value,(d,v)=>(X(),ne("span",{key:v,class:"ect-inline-block"},[_e(Zt,{label:d.label,value:d.value},null,8,["label","value"])]))),128)),u.value>0?(X(),ne("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${e.item.itemId}`,onClick:g[4]||(g[4]=Tt(()=>{},["stop"]))}," +"+ve(u.value)+" more ",9,Qh)):ye("",!0),e.selected?(X(),ne("button",{key:1,"data-test-id":`configurator-item-button-edit-attributes-${e.item.itemId}`,onClick:g[5]||(g[5]=d=>r("edit-attributes"))},[_e(Zt,{label:"Edit attributes","edit-button":""})],8,Xh)):ye("",!0)],64)):(X(),ne("span",Jh,[b("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:g[6]||(g[6]=d=>r("edit-attributes"))},[_e(Zt,{label:"Add attributes","add-button":""})])]))])):ye("",!0)])])):(X(),ne("div",Wh,[b("div",Gh,[b("div",Yh,[e.imageUrl?(X(),ne("img",{key:0,src:e.imageUrl,alt:e.name,class:"ect-w-full ect-h-full ect-object-cover"},null,8,e9)):ye("",!0)]),b("div",t9,[b("h3",n9,ve(e.name),1),b("p",r9,ve(e.description),1)]),b("div",i9,[Ze(h.$slots,"selection-control")])]),e.isAttributes&&e.showAttributes&&e.selected?(X(),ne("div",o9,[a.value.getTags().length>0?(X(),ne(Oe,{key:0},[(X(!0),ne(Oe,null,ze(f.value,(d,v)=>(X(),ne("span",{key:v,class:"ect-inline-block"},[_e(Zt,{label:d.label,value:d.value},null,8,["label","value"])]))),128)),u.value>0?(X(),ne("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${e.item.itemId}`,onClick:g[7]||(g[7]=Tt(()=>{},["stop"]))}," +"+ve(u.value)+" more ",9,a9)):ye("",!0),e.selected?(X(),ne("button",{key:1,class:"ect-ml-auto","data-test-id":`configurator-item-button-edit-attributes-${e.item.itemId}`,onClick:g[8]||(g[8]=d=>r("edit-attributes"))},[_e(Zt,{label:"Edit attributes","edit-button":""})],8,s9)):ye("",!0)],64)):(X(),ne("span",l9,[b("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:g[9]||(g[9]=d=>r("edit-attributes"))},[_e(Zt,{label:"Add attributes","add-button":""})])]))])):ye("",!0),b("div",c9,[b("div",{onClick:g[11]||(g[11]=Tt(()=>{},["stop"]))},[_e(zi,{value:l.value,"onUpdate:value":g[10]||(g[10]=d=>l.value=d),min:e.minQuantity,max:e.maxQuantity,"data-test-id":`configurator-item-counter-${e.item.itemId}`,onChange:c},null,8,["value","min","max","data-test-id"])]),b("div",u9,[f9,_e(ka,{modelValue:a.value.price,"onUpdate:modelValue":g[12]||(g[12]=d=>a.value.price=d),tag:"p",type:"currency",class:"ect-w-[125px] ect-text-base ect-font-bold"},null,8,["modelValue"])])])])),e.selected&&e.isAttributes?(X(),ne("div",d9,[Ze(h.$slots,"default")])):ye("",!0)],10,Mh))}},p9={"af-ZA":",","sq-AL":",","ar-DZ":",","ar-BH":"٫","ar-EG":"٫","ar-IQ":"٫","ar-JO":"٫","ar-KW":"٫","ar-LB":"٫","ar-LY":",","ar-MA":",","ar-OM":"٫","ar-QA":"٫","ar-SA":"٫","ar-SD":"٫","ar-SY":"٫","ar-TN":",","ar-AE":"٫","ar-YE":"٫","hy-AM":",","az-AZ":",","bn-BD":".","bn-IN":".","eu-ES":",","be-BY":",","bs-BA":",","bg-BG":",","my-MM":".","ca-ES":",","ca-ES-EURO":",","zh-CN":".","zh-CN-PINYIN":".","zh-CN-STROKE":".","zh-HK":".","zh-HK-STROKE":".","zh-MO":".","zh-SG":".","zh-TW":".","zh-TW-STROKE":".","hr-HR":",","cs-CZ":",","da-DK":",","nl-AW":",","nl-BE":",","nl-NL":",","nl-SR":",","dz-BT":".","en-AG":".","en-AU":".","en-BS":".","en-BB":".","en-BZ":".","en-BM":".","en-BW":".","en-CM":".","en-CA":".","en-DE":",","en-KY":".","en-ER":".","en-FK":".","en-FJ":".","en-GM":".","en-GH":".","en-GI":".","en-GY":".","en-HK":".","en-IN":".","en-ID":".","en-IE":".","en-IE-EURO":".","en-JM":".","en-KE":".","en-LR":".","en-MG":".","en-MW":".","en-MY":".","en-MU":".","en-NA":".","en-NZ":".","en-NG":".","en-PK":".","en-PG":".","en-PH":".","en-RW":".","en-WS":".","en-SC":".","en-SL":".","en-SG":".","en-SX":".","en-SB":".","en-ZA":",","en-SH":".","en-SZ":".","en-TZ":".","en-TO":".","en-TT":".","en-UG":".","en-GB":".","en-US":".","en-VU":".","et-EE":",","fi-FI":",","fi-FI-EURO":",","fr-BE":",","fr-CA":",","fr-KM":",","fr-FR":",","fr-FR-EURO":",","fr-GN":",","fr-HT":",","fr-LU":",","fr-MR":",","fr-MC":",","fr-CH":",","fr-WF":",","ka-GE":",","de-AT":",","de-AT-EURO":",","de-BE":",","de-DE":",","de-DE-EURO":",","de-LU":",","de-LU-EURO":",","de-CH":".","el-GR":",","gu-IN":".","iw-IL":".","hi-IN":".","hu-HU":",","is-IS":",","in-ID":",","ga-IE":".","it-IT":",","it-CH":".","ja-JP":".","kn-IN":".","kk-KZ":",","km-KH":",","ko-KP":".","ko-KR":".","ky-KG":",","lo-LA":",","lv-LV":",","lt-LT":",","lu-CD":",","lb-LU":",","mk-MK":",","ms-BN":",","ms-MY":".","ml-IN":".","mt-MT":".","mi-NZ":".","mr-IN":".","ne-NP":".","no-NO":",","ps-AF":"٫","fa-IR":"٫","pl-PL":",","pt-AO":",","pt-BR":",","pt-CV":",","pt-MZ":",","pt-PT":",","pt-ST":",","ro-MD":",","ro-RO":",","rm-CH":".","rn-BI":",","ru-KZ":",","ru-RU":",","sr-BA":",","sr-RS":",","sh-BA":",","sh-ME":",","sh-ME-USD":",","sh-CS":",","sk-SK":",","sl-SI":",","so-DJ":".","so-SO":".","es-AR":",","es-BO":",","es-CL":",","es-CO":",","es-CR":",","es-CU":".","es-DO":".","es-EC":",","es-SV":".","es-GT":".","es-HN":".","es-MX":".","es-NI":".","es-PA":".","es-PY":",","es-PE":".","es-PR":".","es-ES":",","es-ES-EURO":",","es-US":".","es-UY":",","es-VE":",","sw-KE":".","sv-SE":",","tl-PH":".","tg-TJ":",","ta-IN":".","ta-LK":".","te-IN":".","th-TH":".","ti-ET":".","tr-TR":",","uk-UA":",","ur-PK":".","uz-LATN-UZ":",","vi-VN":",","cy-GB":".","xh-ZA":".","yo-BJ":".","zu-ZA":"."},m9={name:"CustomInput",components:{AppIcon:Ge},props:{editMode:{type:Boolean,default:!0},type:{type:String,default:"text"},max:{type:Number,default:500},label:{type:String,default:""},name:{type:String,default:""},showLabel:{type:Boolean,default:!0},modelValue:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},isReadOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},highlight:{type:Boolean,default:!1},placeholder:{type:String,default:""},error:{type:[Boolean,String],default:!1},cssClass:{type:Object,default:()=>({})},tooltip:{type:String,default:null},locale:{type:String,default:"en-US"},icon:{type:String,default:null},itooltip:{type:String,default:null},icolor:{type:String,default:"#7d7d7d"},ihover:{type:String,default:"#57c046"},icustom:{type:Boolean,default:!1},idisabled:{type:Boolean,default:!1},height:{type:Number,default:32},textAlignment:{type:String,default:"left"},decimalPrecision:{type:Number,default:0},allowNegatives:{type:Boolean,default:!1},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["update:modelValue","iclick","blur"],data(){return{initialValue:"",decimalSeprator:".",ctrl:!1}},computed:{getValue(){return this.modelValue?this.type==="currency"?String(this.modelValue).replace(".",this.decimalSeprator):String(this.modelValue):""},error_message(){return typeof this.error=="string"?this.error:this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},isHighlight(){return(this.initialValue===""||this.initialValue===null)&&(this.modelValue===""||this.modelValue===null)?!1:this.initialValue!==this.modelValue}},created(){this.initialValue=this.modelValue,this.decimalSeprator=this.type==="currency"?p9[this.locale]:"."},methods:{handlerInput(e){const t=e.target.value;this.type==="currency"?this.$emit("update:modelValue",t.replace(this.decimalSeprator,".")):this.$emit("update:modelValue",t)},preventNonNumeric(e){if(this.type==="number"){const t=this.decimalPrecision,n=e.target.value,r=e.key;if(["Backspace","ArrowLeft","ArrowRight","Delete","Tab"].includes(r)||this.allowNegatives&&r==="-")return;if(r==="."&&t===0){e.preventDefault();return}if(r==="."&&n.includes(".")){e.preventDefault();return}if(r==="."||n.includes(".")&&!n.endsWith(".")&&r!=="Backspace"){const i=n.split(".");if(i.length>1&&i[1].length>=t){e.preventDefault();return}}if(isNaN(r)&&![".","Backspace","Tab"].includes(r)){e.preventDefault();return}}if(e.key==="Backspace"||this.ctrl)return!0;if(e.key==="Control"&&(this.ctrl=!0),this.type==="currency"||this.type==="number"){if(!this.getValue.includes(this.decimalSeprator)&&e.key===this.decimalSeprator)return!0;/[\deE+\-]/.test(e.key)||e.preventDefault()}return!0},handlerKeyup(e){e.key==="Control"&&(this.ctrl=!1)}}},g9=["data-test-id"],v9=["for","data-test-id"],y9=["data-test-id"],_9=["id","type","name","disabled","placeholder","value","maxlength","readonly","data-test-id"],b9=["data-test-id"],C9=["data-test-id"];function w9(e,t,n,r,i,o){const a=Or("AppIcon");return X(),ne("div",{class:"input","data-test-id":n.dataTestId},[n.label&&n.showLabel?(X(),ne("label",{key:0,class:Ie({error_color:!!n.error}),for:n.label,"data-test-id":`${n.dataTestId}-label`},[Fe(ve(n.label)+" ",1),n.required?(X(),ne("span",{key:0,class:Ie({error_color:!!n.error})},"*",2)):ye("",!0)],10,v9)):ye("",!0),n.editMode?(X(),ne("div",{key:1,class:Ie(["input-wrapper ect-w-full",{errorBorder_color:!!n.error,highlight:o.isHighlight&&n.highlight}]),"data-test-id":`${n.dataTestId}-wrapper`},[n.icon?(X(),Te(a,{key:0,class:"input-wrapper_icon",icon:n.icon,hover:n.ihover,color:n.icolor,size:19,disabled:n.idisabled,custom:n.icustom,tooltip:n.itooltip,"data-test-id":`${n.dataTestId}-icon`,direction:"top-right",onClick:t[0]||(t[0]=s=>e.$emit("iclick"))},null,8,["icon","hover","color","disabled","custom","tooltip","data-test-id"])):ye("",!0),b("input",{id:n.label,class:Ie(`ectheme-input-box ${n.size}`),type:n.type,style:tt({width:n.icon?"calc(100% - 36px)":"100%",height:`${n.height}px`,textAlign:n.textAlignment}),name:n.name,disabled:n.disabled,placeholder:n.placeholder,value:o.getValue,maxlength:n.max,readonly:n.isReadOnly,"data-test-id":`${n.dataTestId}-input`,onInput:t[1]||(t[1]=(...s)=>o.handlerInput&&o.handlerInput(...s)),onKeydown:t[2]||(t[2]=(...s)=>o.preventNonNumeric&&o.preventNonNumeric(...s)),onKeyup:t[3]||(t[3]=(...s)=>o.handlerKeyup&&o.handlerKeyup(...s)),onBlur:t[4]||(t[4]=s=>e.$emit("blur"))},null,46,_9)],10,y9)):ye("",!0),n.editMode?ye("",!0):(X(),ne("p",{key:2,class:"value","data-test-id":`${n.dataTestId}-value`},ve(o.getValue),9,b9)),o.error_message?(X(),ne("div",{key:3,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${n.dataTestId}-error`},ve(o.error_message),9,C9)):ye("",!0)],8,g9)}const x9=Ve(m9,[["render",w9],["__scopeId","data-v-032ca141"]]),k9={name:"AtomSpinner",props:{dataTestId:{type:String,default:""}}},E9=["data-test-id"];function O9(e,t,n,r,i,o){return X(),ne("div",{class:"spinner","data-test-id":n.dataTestId},null,8,E9)}const S9={name:"CustomDropdown",components:{AppIcon:Ge,AtomSpinner:Ve(k9,[["render",O9],["__scopeId","data-v-771ed032"]])},props:{label:{type:String,default:""},placeholder:{type:String,default:""},options:{type:Array,default:()=>[]},display:{type:Array,default:()=>[]},modelValue:{type:String,default:""},error:{type:[Boolean,String],default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},select:{type:Boolean,default:!1},lookup:{type:Boolean,default:!1},search:{type:Boolean,default:!1},badge:{type:String,default:void 0},highlight:{type:Boolean,default:!1},property:{type:Object,default:()=>({key:"value",value:"label",assigned:"assigned"})},dropdownTheme:{type:String,default:"light"},icon:{type:String,default:""},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["search","focus-in","focus-out","update:modelValue"],data:()=>({inputFocused:!1,value:"",isHover:!1,highlightedIndex:-1,initialValue:"",teleportStyle:{position:"absolute",top:"0px",left:"0px",width:"0px"}}),computed:{isHighlight(){return(this.initialValue===""||this.initialValue==null)&&(this.modelValue===""||this.modelValue==null)?!1:this.initialValue!==this.modelValue},error_message(){return this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},getOptions(){if(this.select&&this.search){const e=this.value.toLowerCase();return this.options.filter(t=>JSON.stringify(t).toLowerCase().includes(e))}else return this.options},getSelected(){let e=null;if(this.modelValue)e=this.options.find(t=>t[this.property.key]===this.modelValue);else if(!this.search){const t=this.options.find(n=>n[this.property.key]==="");t?e=t:this.placeholder?e={[this.property.value]:this.placeholder,[this.property.key]:""}:e={[this.property.value]:"--Select--",[this.property.key]:""}}return e||{[this.property.value]:this.placeholder||"--Select--",[this.property.key]:""}},shouldShowAbove(){if(!this.$refs.triggerElement)return!1;const e=this.$refs.triggerElement.getBoundingClientRect(),t=250,n=window.innerHeight-e.bottom,r=e.top;return n<t&&r>t},dropdownStyle(){if(!this.$refs.triggerElement)return{};const e=this.$refs.triggerElement.getBoundingClientRect(),t=250,n=window.innerHeight-e.bottom,r=e.top,i=n<t&&r>t;return{position:"absolute",top:i?"auto":"100%",bottom:i?"100%":"auto",left:"0",width:"100%",zIndex:1e3}}},created(){this.initialValue=this.modelValue},mounted(){window.addEventListener("resize",this.updateDropdownPosition),window.addEventListener("scroll",this.updateDropdownPosition,!0)},beforeUnmount(){window.removeEventListener("resize",this.updateDropdownPosition),window.removeEventListener("scroll",this.updateDropdownPosition,!0)},methods:{updateDropdownPosition(){if(!this.$refs.triggerElement)return;const e=this.$refs.triggerElement.getBoundingClientRect(),t=200,n=window.innerHeight-e.bottom,r=e.top,i=n<t&&r>t;this.teleportStyle={position:"absolute",top:`${i?e.top-t:e.bottom}px`,left:`${e.left}px`,width:`${e.width}px`,zIndex:9999}},subFieldsText(e){if(!this.display||this.display.length<1)return"";const t=[];return this.display.forEach(n=>{const r=this.subField(e,n);r&&t.push(r)}),t.join(" | ")},subField(e,t){return t?t.split(".").reduce((i,o)=>i[o]||"",e):e},lookupSearchHandler:wc(function(e){this.value=e,this.search&&!this.select&&this.$emit("search",e)}),handlerFocusIn(){!(this.modelValue&&this.search)&&!this.disabled&&(this.inputFocused=!0,this.updateDropdownPosition(),this.$emit("focus-in"))},updateSelected(e){e&&(this.value="",this.$emit("update:modelValue",e[this.property.key]),this.search&&!this.select&&!this.lookup&&this.$emit("search",""),this.onInputFocusedOut(!0))},clear(){this.disabled||(this.value="",this.$emit("update:modelValue",null),this.search&&!this.select&&!this.lookup&&this.$emit("search",""))},onInputFocusedOut(e=!1){(!this.isHover||e)&&!this.disabled&&(e?(this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")):setTimeout(()=>{this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")},100))},highlightNextOption(){this.highlightedIndex<this.options.length-1&&this.highlightedIndex++},highlightPreviousOption(){this.highlightedIndex>0&&this.highlightedIndex--}}},I9=["data-test-id"],A9=["for","data-test-id"],T9={class:"input-container-box ect-grow ect-w-full"},N9=["data-test-id"],P9=["placeholder","disabled","data-test-id"],L9=["data-test-id"],R9=["title","data-test-id"],M9=["data-test-id"],q9=["data-test-id"],j9=["data-test-id"],D9=["data-test-id"],B9=["data-test-id","onClick"],$9=["data-test-id"],F9={class:"ect-text-font-clr-light ect-flex ect-gap-2 ect-items-center ect-justify-between ect-w-full"},V9=["data-test-id"],H9=["data-test-id"],U9=["data-test-id"],z9=["title","data-test-id"],K9=["data-test-id"];function Z9(e,t,n,r,i,o){const a=Or("AppIcon"),s=Or("AtomSpinner");return X(),ne("div",{ref:"dropdownWrapper",class:Ie(["customdropdown input-container",{dark:n.dropdownTheme==="dark"}]),"data-test-id":n.dataTestId,onMouseenter:t[7]||(t[7]=l=>e.isHover=!0),onMouseleave:t[8]||(t[8]=l=>e.isHover=!1)},[n.label?(X(),ne("label",{key:0,class:Ie(["title_label",{error_color:!!n.error}]),for:n.label,"data-test-id":`${n.dataTestId}-label`},[Fe(ve(n.label)+" ",1),n.required?(X(),ne("span",{key:0,class:Ie({error_color:!!n.error})},"*",2)):ye("",!0)],10,A9)):ye("",!0),b("div",T9,[b("div",{ref:"triggerElement",class:Ie(["input-wrapper ectheme-input-box ect-w-full",{disabled:n.disabled,"input-error":n.error,highlight:o.isHighlight&&n.highlight,"size-large":n.size==="large","size-medium":n.size==="medium"||n.size==="small"}]),"data-test-id":`${n.dataTestId}-trigger`,tabindex:"0",onFocusin:t[2]||(t[2]=(...l)=>o.handlerFocusIn&&o.handlerFocusIn(...l)),onFocusout:t[3]||(t[3]=l=>o.onInputFocusedOut(!1)),onKeydown:[t[4]||(t[4]=qr(l=>o.updateSelected(n.options[e.highlightedIndex]),["enter"])),t[5]||(t[5]=qr(Tt((...l)=>o.highlightPreviousOption&&o.highlightPreviousOption(...l),["prevent"]),["up"])),t[6]||(t[6]=qr(Tt((...l)=>o.highlightNextOption&&o.highlightNextOption(...l),["prevent"]),["down"]))]},[!n.modelValue&&n.search?Cn((X(),ne("input",{key:0,ref:"searchInput","onUpdate:modelValue":t[0]||(t[0]=l=>e.value=l),type:"text",name:"search",placeholder:n.placeholder,autocomplete:"off",disabled:n.disabled,"data-test-id":`${n.dataTestId}-search-input`,onInput:t[1]||(t[1]=Tt(l=>o.lookupSearchHandler(l.target.value),["prevent"]))},null,40,P9)),[[Di,e.value]]):(X(),ne("div",{key:1,class:Ie(["selection-name ect-text-text-primary-dark ect-flex ect-justify-between ect-items-center",{"size-large":n.size==="large","size-medium":n.size==="medium"||n.size==="small"}]),"data-test-id":`${n.dataTestId}-selection`},[o.getSelected?(X(),ne(Oe,{key:0},[b("span",{title:o.getSelected[n.property.value],class:Ie(["ect-flex ect-items-center ect-gap-2 ect-font-medium",{"ect-text-font-clr-light":!n.modelValue}]),"data-test-id":`${n.dataTestId}-selection-value`},[n.icon?(X(),Te(a,{key:0,class:"ect-mr-0",icon:n.icon,size:14,color:"#5F5F5F","data-test-id":`${n.dataTestId}-selection-icon`},null,8,["icon","data-test-id"])):ye("",!0),Fe(" "+ve(o.getSelected[n.property.value]),1)],10,R9),n.badge&&o.getSelected[n.badge]?(X(),ne("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${n.dataTestId}-selection-badge`},ve(o.getSelected[n.badge]),9,M9)):ye("",!0)],64)):ye("",!0)],10,L9)),n.search?(X(),ne(Oe,{key:2},[n.loading?(X(),Te(s,{key:0,class:"spinner","data-test-id":`${n.dataTestId}-loading-spinner`},null,8,["data-test-id"])):(X(),ne("div",{key:1,class:"clear-button","data-test-id":`${n.dataTestId}-action-button`},[e.value||n.modelValue?(X(),Te(a,{key:0,disabled:n.disabled,icon:"close",color:"#acacac",size:10,"data-test-id":`${n.dataTestId}-clear-button`,onClick:o.clear},null,8,["disabled","data-test-id","onClick"])):(X(),Te(a,{key:1,icon:"search",size:14,color:"#acacac",disabled:n.disabled,"data-test-id":`${n.dataTestId}-search-button`},null,8,["disabled","data-test-id"]))],8,q9))],64)):(X(),Te(a,{key:3,class:"clear-button",color:o.error_message?"#ff6a6a":"#acacac",icon:"arrow_drop_up",size:12,disabled:n.disabled,"data-test-id":`${n.dataTestId}-dropdown-arrow`},null,8,["color","disabled","data-test-id"]))],42,N9),o.error_message?(X(),ne("div",{key:0,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${n.dataTestId}-error`},ve(o.error_message),9,j9)):ye("",!0),o.getOptions&&e.inputFocused&&!n.disabled&&(n.select||n.lookup)?(X(),ne("div",{key:1,ref:"dropdown",class:Ie(["dropdown",{"dropdown-above":o.shouldShowAbove}]),style:tt(o.dropdownStyle),"data-test-id":`${n.dataTestId}-dropdown`},[(X(!0),ne(Oe,null,ze(o.getOptions,(l,p)=>(X(),ne("div",{key:l[n.property.key],class:Ie(["dropdown-item",{highlighted:p===e.highlightedIndex,"ect-pointer-events-none":l[n.property.assigned]}]),"data-test-id":`${n.dataTestId}-option-${p}`,onClick:c=>o.updateSelected(l)},[b("div",{class:"name ect-items-center","data-test-id":`${n.dataTestId}-option-${p}-name`},[b("span",F9,[b("span",{class:Ie({"ect-text-zinc-400":l[n.property.assigned]}),"data-test-id":`${n.dataTestId}-option-${p}-value`},ve(l[n.property.value]==null?"Key and Value is Wrong":l[n.property.value]),11,V9),l[n.property.assigned]?(X(),ne("span",{key:0,class:"ect-text-xs ect-leading-4 ect-text-zinc-600","data-test-id":`${n.dataTestId}-option-${p}-assigned`},"Assigned",8,H9)):ye("",!0)]),n.badge?(X(),ne("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${n.dataTestId}-option-${p}-badge`},ve(l[n.badge]),9,U9)):ye("",!0)],8,$9),b("div",{class:"info",title:o.subFieldsText(l),"data-test-id":`${n.dataTestId}-option-${p}-info`},[b("span",null,ve(o.subFieldsText(l)),1)],8,z9)],10,B9))),128)),!o.getOptions.length&&!n.loading&&(e.value||n.select)?(X(),ne("div",{key:0,class:"no-items-found","data-test-id":`${n.dataTestId}-no-options`}," no options found ",8,K9)):ye("",!0)],14,D9)):ye("",!0)])],42,I9)}const Pc=Ve(S9,[["render",Z9],["__scopeId","data-v-5ae4f6dc"]]);var ot=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rc={exports:{}};/*!
|
|
28
|
+
*/var Sc;(function(e){e.pop="pop",e.push="push"})(Sc||(Sc={}));var Ic;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Ic||(Ic={}));var Ac;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Ac||(Ac={}));const z0=Symbol(""),K0=Symbol("");function Vi(){return kn(z0)}function wa(){return kn(K0)}function bt(e){if(typeof e=="string"&&(e=JSON.parse(e)),e!=null&&e.errorMessage)throw new Error(e==null?void 0:e.errorMessage);return e}const xa={xx_ord1__item__c:"xx_ord1__item__c",xx_ord1__sales_price__c:"xx_ord1__negotiated_price__c",xx_ord1__nrc__c:"xx_ord1__nrc_for_new__c",xx_ord1__line_description__c:"xx_ord1__line_description__c",xx_ord1__list_price__c:"xx_ord1__list_price2__c",xx_ord1__cost__c:"xx_ord1__cost2__c",xx_ord1__rate_plan__c:"xx_ord1__rate_plan__c",xx_ord1__allowed_discount__c:"xx_ord1__allowed_discount__c",xx_ord1__billing_period__c:"xx_ord1__billing_period__c",xx_ord1__ship_to_account__c:"xx_ord1__ship_to_account__c",xx_ord1__erp_item_number__c:"xx_ord1__erp_item_number__c",xx_ord1__mrc__c:"xx_ord1__mrc__c",xx_ord1__qty__c:"xx_ord1__qty__c",id:"id"},Tc={xx_ord1__item__c:"xx_ord1__item__c",xx_ord1__negotiated_price__c:"xx_ord1__sales_price__c",xx_ord1__nrc_for_new__c:"xx_ord1__nrc__c",xx_ord1__line_description__c:"xx_ord1__line_description__c",xx_ord1__list_price2__c:"xx_ord1__list_price__c",xx_ord1__cost2__c:"xx_ord1__cost__c",xx_ord1__rate_plan__c:"xx_ord1__rate_plan__c",xx_ord1__allowed_discount__c:"xx_ord1__allowed_discount__c",xx_ord1__billing_period__c:"xx_ord1__billing_period__c",xx_ord1__ship_to_account__c:"xx_ord1__ship_to_account__c",xx_ord1__erp_item_number__c:"xx_ord1__erp_item_number__c",xx_ord1__mrc__c:"xx_ord1__mrc__c",xx_ord1__qty__c:"xx_ord1__qty__c",id:"id"},Z0=e=>{var n;let t=[];for(let r of e)if(r.trim()!=="xx_ord1__item__r.xx_ord1__decimal_precision__c")if(r.includes(".")){let o=r.split(".")[0];o=o.slice(0,-1)+"c";const a=((n=xa[o==null?void 0:o.toLowerCase()])==null?void 0:n.trim())||"";a&&(t.includes(a)||t.push(a||""),t.push(r))}else t.includes(xa[r==null?void 0:r.toLowerCase()])||t.push(xa[r==null?void 0:r.toLowerCase()]||"");return t.filter(r=>r!=="")},Q0=Rt("actions",()=>{const e=Ui(),t=Tn(),n=ae(!1);return{openAdaptiveSearch:(s,l=!1)=>{console.info("openAdaptiveSearch",s),e.chatHistory[e.chatHistory.length-1].links=[],e.sendMessage("Open Adaptive Search",!1,{internalCall:!0}),n.value=l},openQuoteItem:s=>{console.info("openQuoteItem",s),e.chatHistory[e.chatHistory.length-1].links=[],e.sendMessage("Open Quote Item",!1,{internalCall:!0})},openQuoteDocument:s=>{console.info("openQuoteDocument",s),e.chatHistory[e.chatHistory.length-1].links=[],e.chatHistory.push({type:"response",message:"Opening quote document",loading:!0});const p=`/apex/XX_ORD1__Expedite_Commerce?scpq=true&oid=${t.quoteId}&atpverified=true&ecCache=false&origin=AI`;window.location.href=`${a0(window.location.href)}${p}`},undo:()=>{const s=e==null?void 0:e.latestDMLRequest;e.sendMessage(`UNDO-${s}`,!1,{internalCall:!0})},isStaticActionCall:n}}),Nc=Rt("adaptiveSearch",()=>{const e=Tn(),t=ar(),n=Ui(),r=Q0(),i=ae(null),o=ae(null),a=ae(!1),s=ae(!1),l=ae([]),p=ae(""),c=ae(!1),f=ae(null),u=ae(!1),m=ae([]),h=an(),g=ae([]),d=ae(0),v=ae(!1),_=ae({rowLimt:10,paging:!0,offset:0,currentPage:1,totalPages:1});async function C(){a.value=!0;try{const O=JSON.stringify({layoutType:"Search Selection",layoutObject:"xx_ord1__ecatalog_item__c"});let P={};return P=await window.salesforceConnector.getDynamicPageLayout(O),o.value=Ec(P,"Unable to find the Search Selection Layout for your user profile"),_.value.rowLimt=o.value.configuration.rowLimit||10,o.value.configuration.columns.forEach(M=>{!M.field&&M.label==="QTY"&&(M.field="xx_ord1__qty__c")}),a.value=!1,y(),P}catch(O){a.value=!1,h.handleError("Failed to get Adaptive Search Layout. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",O)}}function y(){var O,P,M;f.value=(M=(P=(O=o.value)==null?void 0:O.configuration)==null?void 0:P.dynamicFilters)==null?void 0:M.filters.map(Z=>({...Z,field:Z.field.toLowerCase(),filtervalue:Z.filtervalue||[],filtervaluefrom:Z.filtervaluefrom||"",filtervalueTo:Z.filtervalueTo||""}))}function w(){var P;let O=[];for(const M of o.value.configuration.columns){let Z=M.field;if(O.includes(Z)||O.push(Z),Z!=null&&Z.includes(".")){let B=Z.split(".")[0];B=B.slice(0,-1)+"c",O.includes(B)||O.push(B)}}return(P=o.value.configuration)!=null&&P.cardHeader&&O.push(o.value.configuration.cardHeader.imageField),o.value.configuration.objectName.toLowerCase()==="xx_ord1__ecatalog_item__c"&&O.push("xx_ord1__item__r.xx_ord1__decimal_precision__c"),O=O.filter(M=>!!M),O.filter(M=>M.toLowerCase()!=="xx_ord1__qty__c"&&M.toLowerCase()!=="xx_ord1__competitor_sku__c")}function A(O,P=!1){if(!O||O.includes("undefined"))return!1;const M=/[!@#$%^&*()+=[\]{};':"\\|.<>/?]+/;if(P){const Z=Array.isArray(O)?O:O.split(",");for(const Q of Z){const B=Q.trim();if(M.test(B))return h.handleError(`Invalid character found in value: ${B}`),!1}}else if(M.test(O))return h.handleError("Special characters are not allowed in filter values"),!1;return!0}function I(O,P){return{field:O.field,operator:O.operator||"contains",value:P,dataType:O.dataType.trim()}}function S(O){if(!O.filtervalue)return null;const P=Array.isArray(O.filtervalue),M=P?O.filtervalue.join(","):O.filtervalue.trim();return A(M,P)?M:null}function N(O){var Q,B;const P=(Q=O.filtervaluefrom)==null?void 0:Q.trim(),M=(B=O.filtervalueTo)==null?void 0:B.trim();if(!P||!M)return null;const Z=`${P}, ${M}`;return Z!==", "&&A(Z)?Z:null}function T(O){const P=`${kc(O.filtervaluefrom)}, ${kc(O.filtervalueTo)}`;return P!==", "&&A(P)?P:null}function k(O){var M;const P=(M=O.filtervaluefrom)==null?void 0:M.trim();return A(P)?P:null}function E(O){const P=[];return O.forEach(M=>{const Z=M.dataType.trim();let Q=null;switch(Z){case"PICKLIST":case"MULTIPICKLIST":Q=S(M);break;case"DOUBLE":case"CURRENCY":Q=N(M);break;case"DATETIME":case"DATE":Q=T(M);break;default:Q=k(M)}Q&&P.push(I(M,Q))}),m.value=P,P}async function L(O="",P=[],M=[]){var Q,B,U,D,q,$,H,J,R,z;let Z=[];if(P.length&&(Z=E(P)),!Z.length&&O.trim()===""){l.value=[],c.value=!1;return}try{c.value=!1,s.value=!0;const oe=O.trim();M.length||(M=w());const ce={fields:M,...P.length?{dynamicFilters:Z}:{},searchText:oe||p.value.trim(),accountId:t.accountId,...t.eCatalogId?{catalogId:t.eCatalogId}:{},...t.objectType==="opportunity"?{opportunityId:t.id}:{},...(B=(Q=o.value)==null?void 0:Q.configuration)!=null&&B.sort?{primarySortBy:o.value.configuration.sort.primary.field,primarySortOrder:o.value.configuration.sort.primary.direction,secondarySortBy:o.value.configuration.sort.secondary.field,secondarySortOrder:o.value.configuration.sort.secondary.direction}:{},rowLimt:(D=(U=o.value)==null?void 0:U.configuration)==null?void 0:D.rowLimit,paging:($=(q=o.value)==null?void 0:q.configuration)==null?void 0:$.paging,...((H=_.value)==null?void 0:H.offset)!==0?{offset:_.value.offset}:{},objectName:(R=(J=o.value)==null?void 0:J.configuration)==null?void 0:R.objectName,currencyCode:t.currencyCode},le=await window.salesforceConnector.getItems(JSON.stringify(ce));if(le!=null&&le.errorMessage){h.handleError(le.errorMessage);return}le!=null&&le.itemCount&&(_.value.totalPages=Math.ceil((le==null?void 0:le.itemCount)/_.value.rowLimt)),l.value=$i(le.lstItems,{xx_ord1__qty__c:"1"}),(z=le.lstItems)!=null&&z.length||(c.value=!0),s.value=!1}catch(oe){h.handleError("Failed to fetch Results. Please try again."),s.value=!1,console.info("[ERROR]: Adaptive Search getItems() error = ",oe)}}async function V(O){try{u.value=!0;const P=JSON.stringify({lstQLIRequest:K(O),quoteId:e.quoteId});let M=await window.salesforceConnector.createQLI(P);typeof M=="string"&&(M=JSON.parse(M));let Z=!1;if((M==null?void 0:M.length)>0&&M.forEach(Q=>{Q.errorMessage&&(Z=!0,h.handleError(Q.errorMessage))}),u.value=!1,Z){g.value=M;const Q=g.value.reduce((B,U)=>(B[U.eCatalogItemId]=U.errorMessage,B),{});l.value=l.value.map(B=>({...B,backendError:Q[B.Id]||""}));return}return M}catch(P){h.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addToQuote() error = ",P)}}function K(O){const P=[];for(const M of O)if(!M.addedToQuote&&M.id){const Z=W(M);d.value++,P.push({fields:Z,recordId:M.id,...O.length===1?{maxSequenceNumber:d.value}:{}})}return P}function W(O){const P=[],M=te();return Object.keys(O).forEach(Z=>{if(M.includes(Z)){const Q=Tc[Z.toLowerCase()];Q&&P.push({fieldname:Q,value:O[Z]})}}),P}function te(){const O=[];return o.value.configuration.columns.forEach(P=>{P.field&&!P.field.includes(".")&&P.isEditable&&P.visible&&O.push(P.field)}),O}function fe(){var P,M;const O=[];return o.value.configuration.columns.forEach(Z=>{const Q=Z.field.toLowerCase();O.includes(Q)||O.push(Q)}),(P=o.value.configuration)!=null&&P.dynamicFilters&&o.value.configuration.dynamicFilters.filters.forEach(Z=>{const Q=Z.field.toLowerCase();O.includes(Q)||O.push(Q)}),(M=o.value.configuration)!=null&&M.cardHeader&&O.push(o.value.configuration.cardHeader.imageField),O}async function ee(){var M;const O=fe(),P=((M=o.value.configuration)==null?void 0:M.saveObjectName)||o.value.configuration.objectName;if(P==="xx_ord1__ecatalog_item__c"){const Z=O.indexOf("xx_ord1__qty__c");Z>-1&&O.splice(Z,1)}await e.getFieldsData(O,P),e.fieldsData.xx_ord1__qty__c||e.getFieldsData(["xx_ord1__qty__c"],"xx_ord1__quote_line_item__c")}async function j({searchTerm:O="",filters:P=[]}={}){if(v.value=!0,O&&(p.value=O),P.length&&(m.value=P),await C()){await ee(),v.value=!1;const Z=p.value;Z&&(p.value=Z,await L(Z,e.dynamicFilters)),console.info("actionStore.isStaticActionCall = ",r.isStaticActionCall),r.isStaticActionCall&&(r.isStaticActionCall=!1,n.chatHistory[n.chatHistory.length-1]={type:"response",message:"Adaptive search is now open. Please search for the products you require and add it quote",loading:!1,links:[{action:"quoteItem",label:"Quote Item"},{action:"quoteDocument",label:"Quote Document"}]})}v.value=!1}return{selectedItem:i,AdaptiveSearchLayout:o,searchText:p,loadingAdaptiveLayout:a,getAdaptiveSearchLayout:C,getItems:L,lstItems:l,rowItemsLoading:s,noSearchRecords:c,dynamicFilters:f,setDynamicFilters:y,createQliErrors:g,addToQuote:V,addingToQuote:u,getFieldsData:ee,pagingData:_,appliedDynamicFilters:m,maxSequenceNumber:d,loadingAdaptiveSearch:v,initAdaptiveSearch:j}}),X0="XX_ORD1__Quote__c",J0="xxord1salespricec",Hi="xx_ord1__item__c",W0="xxord1productnrcc",G0=Rt("cartStore",()=>{const e=Tn(),t=Nc(),n=an(),r=ae(""),i=ae("$0"),o=ae("$0"),a=ae(null),s=ae({}),l=ae({}),p=ae({}),c=ae(""),f=ae(""),u=ae({}),m=ae(""),h=ae(""),g=ae({});async function d(){A()}async function v(){try{let N=await window.salesforceConnector.getProductCount(e.quoteId);if(N=bt(N),N!=null&&N.errorMessage){n.handleError(N.errorMessage);return}return r.value=N,N}catch{n.handleError("Failed to get Product Count. Please try again.")}}async function _(){try{let N=await window.salesforceConnector.getQuoteTotal(e.quoteId);if(N=bt(N),N!=null&&N.errorMessage){n.handleError(N.errorMessage);return}return o.value=N.monthlyTotal,i.value=N.onetimeTotal,N}catch{n.handleError("Failed to get Total Amount. Please try again.")}}async function C(N,T,k,E=""){if(!e.sectionDataMap.get(k).parentQLIs[T].removingItem){e.sectionDataMap.get(k).parentQLIs[T].removingItem=!0,h.value=N.id,await y(N.id)==="Success"&&(e.fetchAllQuoteLineItems(),E&&E(N,T,k));let V=e.sectionDataMap.get(k).parentQLIs.filter(K=>K[Hi]===N[Hi]).length;h.value="",t.lstItems.forEach(K=>{K[Hi]===N[Hi]&&(K.addedToQuote===!0&&(K.addedToQuote=!1),V===0&&(K.removedFromQuote=!0))})}}async function y(N){try{let T=await window.salesforceConnector.deleteQLI(N);if(T!=null&&T.errorMessage){n.handleError(T.errorMessage);return}return v(),_(),T}catch{n.handleError("Failed to remove Quote Item. Please try again.")}}function w(N){var E,L;const T=(E=N==null?void 0:N[W0])==null?void 0:E.match(/\.\d+/);T&&(T.value=T[0].length-1);const k=(L=N==null?void 0:N[J0])==null?void 0:L.match(/\.\d+/);return k&&(k.value=k[0].length-1),T||k}function A(N=!0){v(),_(),N&&e.fetchTemplates(X0).then(()=>{e.getFilteredListWithFields()})}function I(N){const T=e.sectionDataMap;for(const[,k]of T.entries())k.parentQLIs.forEach(E=>{E.id===N.id&&(k.columns.forEach(L=>{if(L.dataType==="CURRENCY"){const V=L.field.replace(/_/g,"");E[V]=S(E[V],N[L.field])}}),N!=null&&N.billingPeriodValue&&(N!=null&&N.formattedBillingPeriodValue)&&(E.formattedBillingPeriodValue=S(E.formattedBillingPeriodValue,N.billingPeriodValue)),N!=null&&N.oneTimeValue&&(N!=null&&N.formattedOneTimeValue)&&(E.formattedOneTimeValue=S(E.formattedOneTimeValue,N.oneTimeValue)))})}function S(N,T){const k=Number(T);if(isNaN(k))return N;const E=N.match(/(\d[\d,]*)(\.\d+)?/);if(!E)return N;const L=E[2]||"",V=L.length?L.length-1:0,K=k.toLocaleString("en-US",{minimumFractionDigits:V,maximumFractionDigits:V});return N.replace(E[1]+L,K)}return{initializeCart:d,loadCartState:A,productCount:r,onetimeTotal:i,monthlyTotal:o,filterCartItem:a,billingPeriodValue:c,hasOneTimeValue:f,hasBillingPeriodInList:s,oneTimeFieldAvailable:l,billingPeriodFieldAvailable:p,priceDecimalPrecision:u,cartItemUpdatingId:m,removingItemLoaderId:h,cartItemColumnsMap:g,getProductCount:v,getQuoteTotal:_,removeItem:C,removeQuoteItem:y,getDecimalPrecisionFromSalesPriceOrNRC:w,updateFormattedValues:I,formateCurrencyValue:S}}),Y0=e=>[{title:"Apply Discount",subOptions:[...e.map(t=>`Apply Discount on ${t} for `),"Show Maximum discount allowed","Apply Maximum Discount Allowed",...e.map(t=>`Apply Discount on ${t} for a specific total`)]},{title:"Update Fields",subOptions:["Update the price of","Update the quantity of","Update the term start date to","Update the term end date to","Update the line description for"]},{title:"Price Ramp",subOptions:["Add a price ramp for"]}],e5={salesforceUserLocale:"en_US",chatRoomId:"00DA0000000cDUJMA2__0052G00000AHBNAQA5__a0jKb000004VSaMIAW",status:"SUCCESS",statusCode:200,requestId:"9b1d1f0a9f07aa6cdc",errorMessage:"",payload:{uiModification:{addColumn:[],removeColumn:[],filter:[],groupBy:[{sectionName:"MRC $50 and Above",filters:[{datatype:"currency",field:"XX_ORD1__MRC__c",operator:"greater or equal",value:"50"}],tableId:"4vIEgoK5CbSPrLYPbq"},{sectionName:"MRC Below $50",filters:[{datatype:"currency",field:"XX_ORD1__MRC__c",operator:"less than",value:"50"}],tableId:"BlOPCp7eLBCZ84nDT2"}],showOptions:!0}},agentResponse:{role:"agent",requestId:"9b1d1f0a9f07aa6cdc",content:"Grouped the quote items into two sections: one for MRC $50 and above, and another for MRC below $50.",error:!1,epoch:1759936160464,isDML:!1},redirectObjects:{qliId:"",itemId:"",componentName:"QuoteItem"},actionFunction:"Reload",links:[{action:"quoteDocument",label:"Quote Document"},{action:"addProducts",label:"Add Products"}]},t5=[{label:"Line Description",field:"xx_ord1__line_description__c",isEditable:!0,dataType:"STRING"},{label:"QTY",field:"xx_ord1__qty__c",isEditable:!0,dataType:"DOUBLE"},{label:"Extended Price",field:"xx_ord1__extended_price__c",isEditable:!1,dataType:"CURRENCY"},{label:"Billing Period",field:"xx_ord1__billing_period__c",isEditable:!0,dataType:"PICKLIST",picklistValues:["Monthly","Quarterly","Yearly"]}],Tn=Rt("quote",()=>{const e=an(),t=G0(),n=ar(),r=ae(""),i=ae(""),o=ae(0),a=ae(""),s=ae([]),l=ae({template:!0,filteredList:!1}),p=ae(null),c=ae(new Map),f=ae({}),u=ae(!1),m=ae(!0),h=ae(!1),g=ae({text:"Hide Options",altText:"Show Options",handler:()=>{m.value=!m.value,S()},color:"#136E05",isActive:!1}),d=be(()=>{const j=Array.from(c.value.values()).map(O=>O.sectionName);return Y0(j)});St(a,()=>{l.value.template||I()});function v(){const j=new Map,O=[];for(const[M,Z]of c.value.entries())j.set(M,Z.selected),O.push(Z);const P=JSON.parse(JSON.stringify(O));return P.forEach(M=>{delete M.selected;const Z=new Map,Q=[];M.lineItems.forEach(B=>{B.Selected=j.get(M.tableId).get(B.id)||!1,B.xx_ord1__parent_qli__c?(Z.has(B.xx_ord1__parent_qli__c)||Z.set(B.xx_ord1__parent_qli__c,[]),Z.get(B.xx_ord1__parent_qli__c).push(B)):Q.push(B)}),M.lineItems=Q.map(B=>({...B,options:Z.get(B.id)||[]})),delete M.loading,delete M.parentQLIs,delete M.totalValues}),{showOptions:m.value,sections:P,templateId:a.value}}async function _(j){try{let O=await window.salesforceConnector.getPrimaryQuote(j);O=bt(O),O!==void 0&&(console.info("getPrimaryQuote",JSON.stringify(O)),r.value=O.recordId,console.info("quoteId",r.value),i.value=O.name,a.value=O==null?void 0:O.templateId,o.value=(O==null?void 0:O.lineItemsCount)||0)}catch(O){e.handleError(O.message),console.info("[ERROR]: getPrimaryQuote() error = ",O)}}async function C(j){var O,P;try{l.value.template=!0;let M=await window.salesforceConnector.fetchContentTemplates(JSON.stringify({lstObjectName:[j],templateType:"Document",templateId:null,fetchOnlyDefault:!1}));M=bt(M);const Z=M==null?void 0:M.templates[j];return a.value||(a.value=(O=Z.find(Q=>Q.XX_ORD1__Default__c))==null?void 0:O.Id),a.value||(a.value=(P=Z[0])==null?void 0:P.Id),s.value=Z,l.value.template=!1,s.value}catch(M){e.handleError(M.message),console.info("[ERROR]: fetchTemplates() error = ",M)}}function y(j){if(!j)return null;const O=/\{!\$(\w+):([\w.]+)\}/,P=j.match(O);return P?{function:P[1],apiname:P[2].split(".")[1]}:null}async function w(j){try{const O={Id:r.value,XX_ORD1__Document_Template__c:j};return await window.salesforceConnector.updateQuote(JSON.stringify([O]))}catch(O){e.handleError(O.message),console.info("[ERROR]: updateQuote() error = ",O)}}async function A(){try{l.value.filteredList=!0;let j=await window.salesforceConnector.getQuoteEPageLayout();c.value.clear(),t.cartItemColumnsMap={},j=bt(j);const O=j.map(M=>({label:M.fieldLabel,field:M.fieldName.toLowerCase(),isEditable:M.isEditable,dataType:M.dataType,...M.picklistValues?{picklistValues:M.picklistValues}:{}})),P=or();return c.value.set(P,{loading:!0,lineItems:[],parentQLIs:[],columns:O,tableId:P,sectionName:"All Rows",selected:new Map,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}),t.cartItemColumnsMap[P]=O,g.value.isActive=!1,m.value=!0,p.value={lstCB:[{columns:O,footer:null,title:"All Rows",sectionName:"All Rows",tableId:P,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}]},S(),l.value.filteredList=!1,j}catch(j){e.handleError(j.message),console.info("[ERROR]: getQuoteEPageLayout() error = ",j)}}async function I(){if(s.value.length===0){A();return}try{l.value.filteredList=!0;let j=await window.salesforceConnector.getFilteredListWithFields(JSON.stringify({templateId:a.value}));w(a.value),j=bt(j),console.info("res.lstCB = ",j.lstCB);const O=j==null?void 0:j.objectFieldsMap;return c.value.clear(),t.cartItemColumnsMap={},j.lstCB=j.lstCB.map(P=>{const{fields:M,filters:Z,primarysort:Q,primarysortdesc:B}=JSON.parse(P.XX_ORD1__Block_Properties__c),U=M.map(q=>{var $;return{label:($=O[q.api])==null?void 0:$.label,field:q.api.toLowerCase(),isEditable:q.api.includes(".")?!1:O[q.api].isEditable,dataType:O[q.api].dataType,...O[q.api].picklistValues?{picklistValues:O[q.api].picklistValues}:{}}}),D=P.Id||or();return c.value.set(D,{loading:!0,lineItems:[],parentQLIs:[],columns:U,tableId:D,sectionName:P.Name,selected:new Map,footer:y(P.XX_ORD1__Table_Footer_HTML__c),filters:Z,primarysort:Q,primarysortdesc:B}),t.cartItemColumnsMap[D]=U,g.value.isActive=!1,m.value=!0,{columns:U,footer:y(P.XX_ORD1__Table_Footer_HTML__c),title:P.Name,sectionName:P.Name,tableId:D,filters:Z,primarysort:Q,primarysortdesc:B}}),p.value=j,S(),l.value.filteredList=!1,j}catch(j){e.handleError(j.message),console.info("[ERROR]: getFilteredListWithFields() error = ",j)}}async function S(j=!0){const O=[];for(const[P]of c.value)O.push(k(P,j));return await Promise.all(O),t.getProductCount(),!0}function N(j,O){return c.value.get(j).columns.some(P=>P.field.toLowerCase()===O)||t.cartItemColumnsMap[j].some(P=>P.field.toLowerCase()===O)}function T(j,O){let P=$i(j);const M=n.pricingSchema,Z=N(O,"xx_ord1__nrc__c"),Q=N(O,"xx_ord1__sales_price__c"),B=N(O,"xx_ord1__qty__c");return P=P.map(U=>{let D={};M==="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?D={...Q?{billingPeriodValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:U==null?void 0:U.xxord1salespricec}:{},...Z?{oneTimeValue:(U==null?void 0:U.xx_ord1__nrc__c)===0?"0":(U==null?void 0:U.xx_ord1__nrc__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1nrcc}:{}}:M==="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)?Q&&(D={oneTimeValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1salespricec}):M!=="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?Q&&(D={billingPeriodValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:U==null?void 0:U.xxord1salespricec}):M!=="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)&&Q&&(D={oneTimeValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?0:(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1salespricec});const{xx_ord1__qty__c:q,xx_ord1__sales_price__c:$,xx_ord1__nrc__c:H,...J}=U,R={...J,id:U.id,description:(U==null?void 0:U.xx_ord1__line_description__c)||"",xx_ord1__billing_period__c:U==null?void 0:U.xx_ord1__billing_period__c,...B?{xx_ord1__qty__c:q}:{},xx_ord1__item__c:U==null?void 0:U.xx_ord1__item__c,"xx_ord1__item__r.xx_ord1__decimal_precision__c":U["xx_ord1__item__r.xx_ord1__decimal_precision__c"]||"0",...D};return R!=null&&R.billingPeriodValue&&(t.hasBillingPeriodInList[O]=!0,t.billingPeriodValue=R==null?void 0:R.xx_ord1__billing_period__c),"oneTimeValue"in R&&(t.oneTimeFieldAvailable[O]=!0),"billingPeriodValue"in R&&(t.billingPeriodFieldAvailable[O]=!0),(R==null?void 0:R.oneTimeValue)!==""&&(R==null?void 0:R.oneTimeValue)!==null&&(t.hasOneTimeValue=!0),R}),P}async function k(j,O=!0){var P,M;try{const Z=c.value.get(j);if(console.info("sectionData = ",Z.sectionName),!Z)return;Z.loading=O,O&&(Z.lineItems=[]);const{columns:Q,filters:B,primarysort:U,primarysortdesc:D,footer:q}=Z,$=Q.map(le=>le.field.toLowerCase());$.includes("xx_ord1__parent_qli__c")||$.push("xx_ord1__parent_qli__c"),$.includes("xx_ord1__item__c")||$.push("xx_ord1__item__c"),$.includes("xx_ord1__sys_configuration_status2__c")||$.push("xx_ord1__sys_configuration_status2__c"),(P=t.cartItemColumnsMap[j])==null||P.forEach(le=>{$.includes(le.field)||$.push(le.field)});const H=await E({fields:$,recordId:r.value,filters:B||[],primarySortBy:U||"",primarySortOrder:D?"DESC":"ASC",includeOptions:m.value,totalFields:q?[q.apiname]:[]}),J=H.lineItems,R=new Map;let z=[];const oe=(M=H.fieldTotals)==null?void 0:M.map(le=>le.totalValue);J.forEach(le=>{le.XX_ORD1__Parent_QLI__c?R.has(le.XX_ORD1__Parent_QLI__c)?R.get(le.XX_ORD1__Parent_QLI__c).push(le):R.set(le.XX_ORD1__Parent_QLI__c,[le]):z.push(le)});const ce=[];return z.forEach(le=>{ce.push(le),R.has(le.Id)&&ce.push(...R.get(le.Id))}),z=T(z,j),Z.lineItems=$i(ce),Z.parentQLIs=z,Z.totalValues=oe,Z.loading=!1,c.value=new Map(c.value),ce}catch(Z){console.info("[ERROR]: fetchQuoteLineItems()123 error = ",Z.message);const Q=c.value.get(j);Q&&(Q.loading=!1)}}async function E(j){try{let O=await window.salesforceConnector.getQuoteLineItemsWithFilteredTable(JSON.stringify(j));return O=bt(O),O}catch(O){e.handleError(O.message),console.info("[ERROR]: getQuoteLineItemsWithFilteredTable() error = ",O)}}async function L(j){try{console.info("updateQli() payload = ",j);let O=await window.salesforceConnector.updateQli(JSON.stringify(j));return O=bt(O),S(!1),O}catch(O){e.handleError(O.message),console.info("[ERROR]: updateQli() error = ",O)}}async function V(j){try{let O=await window.salesforceConnector.deleteQLI(j);return O=bt(O),S(),O}catch(O){e.handleError(O.message),console.info("[ERROR]: deleteQLI() error = ",O)}}async function K(j,O){try{u.value=!0;const P={fields:j};O&&(P.objectName=O),j.includes("xx_ord1__qty__c")&&O==="xx_ord1__ecatalog_item__c"&&(P.fields=P.fields.filter(Z=>Z!=="xx_ord1__qty__c")),j.includes("xx_ord1__sales_price__c")&&O!=="xx_ord1__quote_line_item__c"&&(P.fields=P.fields.filter(Z=>Z!=="xx_ord1__sales_price__c"));let M=await window.salesforceConnector.getFieldsData(JSON.stringify(P));return typeof M=="string"&&(M=JSON.parse(M)),M!=null&&M.errorMessage?(e.handleError(M.errorMessage),null):(f.value={...f.value,...M},console.info("fieldsData.value = ",JSON.stringify(f.value)),M)}catch(P){return e.handleError("Failed to get Fields Data. Please try again."),console.info("[ERROR]: getFieldsData() error = ",P),null}finally{u.value=!1}}function W(j=""){var O;return!j||j.includes(".")?!1:j.includes("xx_ord1__qty__c")?!0:((O=f.value[j])==null?void 0:O.isEditable)||!1}function te(){fe(e5)}async function fe(j){var O,P,M,Z,Q,B,U,D,q;if(j.payload){if((O=j.payload)!=null&&O.uiModification){const $=j.payload.uiModification;if(((P=$.addColumn)==null?void 0:P.length)>0)if($.addColumn.forEach(H=>{H.columns.forEach(J=>{J.field=J.field.toLowerCase()})}),$.addColumn[0].sectionName==="all_section")for(const[H,J]of c.value)J.columns=[...J.columns,...$.addColumn[0].columns];else $.addColumn.forEach(H=>{c.value.get(H.tableId)&&(c.value.get(H.tableId).columns=[...c.value.get(H.tableId).columns,...H.columns])});if(((M=$.removeColumn)==null?void 0:M.length)>0)if($.removeColumn.forEach(H=>{H.columns=H.columns.map(J=>J.toLowerCase())}),$.removeColumn[0].sectionName==="all_section")for(const[H,J]of c.value)J.columns=J.columns.filter(R=>!$.removeColumn[0].columns.includes(R.field));else $.removeColumn.forEach(H=>{c.value.get(H.tableId)&&(c.value.get(H.tableId).columns=c.value.get(H.tableId).columns.filter(J=>!H.columns.includes(J.field)))});if(((Z=$.filter)==null?void 0:Z.length)>0)if($.filter[0].sectionName==="all_section")for(const[H,J]of c.value)J.filters=[...J.filters,...$.filter[0].filters];else $.filter.forEach(H=>{c.value.get(H.tableId)&&(c.value.get(H.tableId).filters=[...c.value.get(H.tableId).filters,...H.filters])});if(((Q=$.groupBy)==null?void 0:Q.length)>0){const H=((B=[...c.value.values()][0])==null?void 0:B.columns)||t5;c.value.clear(),t.cartItemColumnsMap={},$.groupBy.forEach(J=>{t.cartItemColumnsMap[J.tableId]=J.columns||H,c.value.set(J.tableId,{loading:!0,lineItems:[],parentQLIs:[],columns:J.columns||H,tableId:J.tableId,sectionName:J.sectionName,selected:new Map,footer:y(J.footer),filters:J.filters,primarysort:J.primarysort,primarysortdesc:J.primarysortdesc})})}$.showOptions!==void 0&&(m.value=$.showOptions)}if(((D=(U=j.payload)==null?void 0:U.sections)==null?void 0:D.length)>0){const $=(q=j.payload)==null?void 0:q.sections;c.value.clear(),$.forEach(H=>{H.tableId||(H.tableId=or()),H.selected=new Map,c.value.set(H.tableId,H)}),S()}}j.actionFunction==="Reload"&&(S(),console.info("Reloading quote line items"))}async function ee(j){var O,P;try{const M=new Set;for(const Z of c.value.keys())(O=c.value.get(Z).lineItems)==null||O.forEach(B=>{B.attributes=null,M.add(B.id)});if(j){const Z={lineItemIds:[...M]},Q=await window.productManagerController.getLineItemAttributes({request:JSON.stringify(Z)}),B=JSON.parse(Q.data);for(const U of c.value.keys())(P=c.value.get(U).lineItems)==null||P.forEach(q=>{q.attributes=B[q.id]||null})}}catch(M){console.info("[ERROR]: fetchAttributesData() error = ",M)}}return{showAttributes:h,quoteId:r,quoteName:i,templateId:a,templateOptions:s,loading:l,currentTemplateData:p,fieldsData:f,fieldsDataLoading:u,showOptionHeaderButton:g,sectionDataMap:c,promptSuggestions:d,lineItemsCount:o,addColumns:te,getQuoteEPageLayout:A,getPayload:v,getPrimaryQuote:_,fetchTemplates:C,getFilteredListWithFields:I,getQuoteLineItemsWithFilteredTable:E,updateQli:L,getFieldsData:K,deleteQLI:V,performAIAction:fe,isEditableField:W,fetchQuoteLineItems:k,fetchAllQuoteLineItems:S,fetchAttributesData:ee}}),n5=Rt("quickSelection",()=>{const e=an(),t=ar(),n=Tn(),r=ae(null),i=ae(!1),o=ae([]),a=ae([]),s=ae(!1),l=ae({}),p=ae({rowLimit:10,paging:!0,offset:0,currentPage:1,totalPages:1}),c=ae(!1);async function f(){i.value=!0;try{const w=JSON.stringify({layoutType:"Quick Selection",layoutObject:"xx_ord1__ecatalog_item__c",...t.objectType?{contextObject:t.objectType}:{}});let A={};A=await window.salesforceConnector.getDynamicPageLayout(w),r.value=Ec(A,"Unable to find the Quick Selection Layout for your user profile"),console.info("quickSelectionLayout.value = ",r.value),p.value.rowLimit=r.value.configuration.rowLimit||10,r.value.data.columns.forEach(I=>{!I.field&&I.label==="QTY"&&(I.field="xx_ord1__qty__c")}),i.value=!1}catch(w){i.value=!1,e.handleError("Failed to get Page structure data. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",w)}}function u(){const w=new Map;return r.value.data.columns.forEach(A=>{w.set(A.field,!0)}),r.value.data.searchResultColumns.forEach(A=>{w.set(A.field,!0)}),Array.from(w.keys())}async function m(w){var A,I;try{let S=await window.salesforceConnector.saveCompetitorSKU(w);if(S!=null&&S.errorMessage){e.handleError(S.errorMessage);return}if((A=S[0])!=null&&A.errorMessage){e.handleError((I=S[0])==null?void 0:I.errorMessage);return}return S}catch(S){e.handleError("Failed to Match Item. Please try again."),console.info("[ERROR]: saveCompetitorSKU() error = ",S)}}async function h(w="",A=[]){try{let I=r.value.data,S=r.value.configuration;const N=w.trim();if(console.info("searchTextValue.trim() = ",w.trim()),!N)return[];let T=null;console.info("useMappings = ",c.value),c.value?T=Z0(g()):T=g(),console.info("fields before filter = ",T),T=T.filter(V=>V!=="xx_ord1__qty__c"),console.info("fields after filter = ",T);const k={fields:T,...A.length?{dynamicFilters:n.getDynamicFilters(A)}:{},searchText:N,accountId:t.accountId,...t.eCatalogId?{catalogId:t.eCatalogId}:{},...t.objectType==="opportunity"?{opportunityId:t.id}:{},...I!=null&&I.sort?{primarySortBy:I.sort.primary.field,primarySortOrder:I.sort.primary.direction,secondarySortBy:I.sort.secondary.field,secondarySortOrder:I.sort.secondary.direction}:{},rowLimt:(S==null?void 0:S.rowLimit)||20,paging:(S==null?void 0:S.paging)||!1,...p.value.offset!==0?{offset:p.value.offset}:{},objectName:I.objectName,currencyCode:t.currencyCode};console.info("getQuickSelectionItems payload = ",JSON.stringify(k));const E=await window.salesforceConnector.getItems(JSON.stringify(k));if(console.info("getQuickSelectionItems Res = ",JSON.stringify(E)),E!=null&&E.errorMessage){e.handleError(E.errorMessage);return}return E!=null&&E.itemCount&&(p.value.totalPages=Math.ceil((E==null?void 0:E.itemCount)/p.value.rowLimit)),$i(E.lstItems,{xx_ord1__qty__c:"1"})}catch(I){e.handleError("Failed to fetch Results. Please try again."),console.info("[ERROR]: getQuickSelectionItems() error = ",I)}}function g(){let w=[];for(const A of r.value.data.columns){let I=A.field;if(I!=null&&I.includes(".")){w.includes(I)||w.push(I);let N=I.split(".")[0];N=N.slice(0,-1)+"c",w.includes(N)||w.push(N)}else w.includes(I)||w.push(I)}return console.info("getAllQuickSelectionFields() fields = ",w),w.filter(A=>A.toLowerCase()!=="xx_ord1__qty__c")}async function d(w,A,I,S){console.info("searchText:",JSON.stringify(w)),console.info("row:",JSON.stringify(A)),console.info("rowIndex:",JSON.stringify(I)),console.info("column:",JSON.stringify(S));const N=I+(p.value.currentPage-1)*p.value.rowLimit;if(S.field.toLowerCase().includes("xx_ord1__item__r")){if(o.value[N].itemLookupLoading=!0,c.value=!0,a.value=await h(w),a.value.length>0){const T=[];for(let k=0;k<a.value.length;k++)o.value[N].itemDataRetrieved=!0,a.value[k].xx_ord1__item__c&&T.push({name:a.value[k]["xx_ord1__item__r.name"],value:a.value[k].xx_ord1__item__c,label:a.value[k][S.field.toLowerCase()]});o.value[N][S.field.toLowerCase()+"_options"]=T}o.value[N].itemLookupLoading=!1}else if(S.field.toLowerCase().includes("xx_ord1__competitor_item__r")){o.value[N].competitorLookupLoading=!0;const T=await v(w);T!=null&&T.items&&(o.value[N][S.field.toLowerCase()+"_options"]=T.items.map(k=>({name:k.fields[2].value,value:k.fields[1].value,label:k.fields[0].value}))),o.value[N].competitorLookupLoading=!1,console.info("getLookupData:: Search Lookup Handler Response = ",T)}}async function v(w){var I,S;console.info("getLookupData() searchText = ",w);const A={searchText:w,obj:"xx_ord1__competitor_item__c",filters:null,displayFields:["xx_ord1__sku__c"]};try{let N=await window.salesforceConnector.getLookupData(JSON.stringify(A));if(typeof N=="string"&&(N=JSON.parse(N)),N!=null&&N.errorMessage){e.handleError(N.errorMessage);return}if((I=N[0])!=null&&I.errorMessage){e.handleError((S=N[0])==null?void 0:S.errorMessage);return}return N}catch(N){e.handleError("Failed to Search For Item. Please try again."),console.info("[ERROR]: getLookupData() error = ",N)}}async function _(w,A){var S;console.info("Update Other Fields Value = ",w),console.info("Update Other Fields Row Index = ",A);const I=A+(p.value.currentPage-1)*p.value.rowLimit;console.info("actualRowIndex = ",I);try{if(w){const N=a.value.filter(T=>T.xx_ord1__item__c===w)[0];if(N){s.value=!0;const T=r.value.data.columns[1].field;o.value[I][T]&&await C(N,I),(S=o.value[I])!=null&&S.itemDataRetrieved&&(o.value[I].status="New Match Requested",o.value[I].noMatchCleared=!0),Object.keys(N).forEach(k=>{const E=Tc[k.toLowerCase()];console.info("Mapped Key = ",E),E&&(o.value[I][E]=N[k])}),s.value=!1}else o.value[I].status=""}else o.value[I].status="No Match"}catch(N){e.handleError("Unable to request a match for this item please try again."),console.info("Error in updateOtherFields = ",N)}}async function C(w,A){const I=o.value[A],S=r.value.data.columns[1].field,N=[{sku:I[S],name:I[S],productDescription:I.xx_ord1__line_description__c||"",productURL:null,status:"Match Requested",competitorAccountId:null,itemId:w.xx_ord1__item__c}];let T=await m(JSON.stringify(N));console.info("Match Item: ",JSON.stringify(T)),o.value[A][`${S}_options`]=[{value:T[0].competitorItemId,label:T[0].sku}],o.value[A][S]=T[0].competitorItemId}async function y(w){try{let A=await window.salesforceConnector.createQLI(JSON.stringify(w));typeof A=="string"&&(A=JSON.parse(A));let I=!1;if((A==null?void 0:A.length)>0)for(let S=0;S<A.length;S++)A[S].errorMessage&&(I=!0,A[S].errorMessage.includes("Line Description: data value too large")&&(A[S].errorMessage="Error: The description is too long—it must be under 200 characters."));if(I){A.forEach(S=>{l.value[S.eCatalogItemId]=S});return}else l.value=[];return A}catch(A){e.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addAllItemsToQuote() error = ",A)}}return{quickSelectionLayout:r,quickSelectionLayoutLoading:i,processedRecords:o,useMappings:c,currentSearchData:a,createQliErrors:l,getQuickSelectionLayout:f,getAllFieldsForQuickSelectionLayout:u,saveCompetitorSKU:m,getQuickSelectionItems:h,searchLookupHandler:d,updateOtherFields:_,addAllItemsToQuote:y}}),r5="Preparing Your Quote Please Wait...",i5={message:"Your quote is ready! Begin adding products to complete it.",type:"response",requestId:"no-request-id"},o5=18e4,Ui=Rt("ai",()=>{const e=ar(),t=Tn(),n=Nc(),r=n5(),i=sn(),o=wa(),a=ae(""),s=ae(""),l=ae([]),p=ae(""),c=ae([]),f=ae(!1),u=ae(null),m=Vi(),h=ae({}),g=ae(null),d=ae(null),v=ae(null),_=ae(null),C=ae(null),y=ae(r5),w=ae([]),A=be(()=>e.orgId+"__"+e.user.Id+"__"+t.quoteId),I=be(()=>u.value.readyState==WebSocket.OPEN),S=()=>{h.value={salesforceOrgId:e.orgId,salesforceOrgType:e.orgType,salesforceUserId:e.user.Id,userType:"Salesforce",chatRoomId:A.value,requestId:"",prompt:"",initiatedFrom:e.origin||"Quote",internalCall:!1,contextObjectId:t.quoteId,contextObjectType:"Quote",payload:{lineItemsCount:t.lineItemsCount},origin:"Genesis AI",defaultBatchSize:10,actionType:"",packageVersion:e.packageVersion,relatedIds:{eCatalogId:e.eCatalogId,accountId:e.accountId}}};async function N(){const q=s.value+"?chatRoomId="+A.value;u.value=new WebSocket(q),u.value.addEventListener("open",T),u.value.addEventListener("message",L),u.value.addEventListener("close",k),u.value.addEventListener("error",E)}const T=()=>{V(),te()},k=()=>{K()},E=()=>{Z(),K()},L=q=>{var H,J;V();const $=JSON.parse(q.data);if($.status!=="ALIVE"){if($.loading){y.value=$.message;return}else Array.isArray($.messages)?(y.value=null,l.value.push(i5),$.messages.length>0&&O($.messages)):$.agentResponse&&($.errorMessage&&($.agentResponse.content=$.errorMessage,$.agentResponse.error=!0),y.value=null,l.value.push({message:$.agentResponse.content,type:$.agentResponse.role,requestId:$.requestId,epoch:$.agentResponse.epoch,error:$.agentResponse.error,isDML:$.agentResponse.isDML,...(H=$.agentResponse)!=null&&H.filesData?{filesData:(J=$.agentResponse)==null?void 0:J.filesData}:{}}));w.value=$.links||[],B($)}},V=()=>{K(),g.value=setTimeout(()=>{if(I.value){const q={action:"heartbeat"};u.value.send(JSON.stringify(q)),V()}},o5)},K=()=>{g.value&&(clearInterval(g.value),g.value=null)};function W(q){const $={...h.value};$.requestType="Action",$.actionType="Undo",$.undoRequestId=q,$.requestId=or(),j($)}function te(){const q={...h.value};q.requestType="Action",q.actionType="History",q.requestId=or(),j(q)}function fe(q){return o.path.startsWith("/configurator")&&i.isChangedConfiguration?(_.value={save:()=>{i.maintainQuoteConfiguration()}},a.value=q,!0):(a.value="",!1)}function ee(q,$=!0,H=null){if(!fe(q)&&q.trim()){let J={...h.value};J.prompt=q.trim(),J.requestType="Chat",J.requestId=or(),J.internalCall=!1,J.payload=P(),J.componentName=M.value,J.templateId=t.templateId,J.payload.lineItemsCount=t.lineItemsCount,H&&(J={...J,...H}),Q(),$&&l.value.push({message:q.trim(),type:"user",...C.value&&{fileData:[C.value]},requestId:J.requestId}),j(J),V()}}function j(q){const $={action:"prompt",data:q};u.value.send(JSON.stringify($))}const O=q=>{const $=q.filter(({content:H})=>!!H).map(H=>({message:H.content,type:H.role,requestId:H.requestId,epoch:H.epoch,isDML:H.isDML,undone:H.undone}));$.forEach((H,J)=>{H.isDML===!0&&J!==$.length-1&&(H.isDML=!1)}),l.value=[...l.value,...$]};function P(){return o.path==="/quote-item"?t.getPayload():{}}const M=be(()=>o.path==="/quote-item"?"QuoteItem":""),Z=()=>{l.value.push({type:"response",message:"Oops! Something went wrong while processing your request. Please try again later.",error:!0})},Q=()=>{l.value=l.value.map(q=>({...q,links:[]}))};function B(q){var J,R,z;const $=((J=q==null?void 0:q.redirectObjects)==null?void 0:J.componentName)||(q==null?void 0:q.componentName),H=(q==null?void 0:q.redirectObjects)||{};if($==="AdaptiveSearch"){const oe=(R=q==null?void 0:q.payload)==null?void 0:R.searchTerm,ce=(z=q==null?void 0:q.payload)==null?void 0:z.applyFilters;oe&&oe!==n.searchText&&n.initAdaptiveSearch({searchTerm:oe,filters:ce}),m.push("/adaptive-search")}else $==="Configurator"?m.push(`/configurator/${H.itemId}/${H.qliId}`):$==="QuoteReview"?m.push("/quote-item"):$==="QuoteItem"||$==="QuoteList"?(m.push("/quote-item"),t.performAIAction(q)):$==="QuickSelection"&&(r.quickSelectionLayout=q.payload,console.info("Loading QuickSelection data = ",JSON.stringify(r.quickSelectionLayout)),m.push("/match-records"))}function U(){if(I.value){const q={action:"cancel",data:{requestId:h.value.requestId,chatRoomId:A.value}};u.value.send(JSON.stringify(q))}}const D=()=>{d.value&&(clearInterval(d.value),d.value=null),g.value&&(clearInterval(g.value),g.value=null),v.value&&(clearTimeout(v.value),v.value=null)};return Ei(()=>{D()}),{unsavedChanges:_,loadingMessage:y,promptMessage:a,buttonLinks:w,websocketUrl:s,chatHistory:l,latestDMLRequest:p,strikethroughHistory:c,attachmentData:C,dataManuallyChanged:f,undoAction:W,connectSocket:N,sendMessage:ee,setInitialPayload:S,cancelRequest:U}}),ar=Rt("root",()=>{const e=Ui(),t=an(),n=Tn(),r=ae(""),i=ae(""),o=ae("Genesis AI"),a=ae(""),s=ae({}),l=ae(""),p=ae(""),c=ae(""),f=ae(""),u=ae({}),m=ae(""),h=ae(""),g=ae(""),d=ae(""),v=ae(""),_=ae(""),C=ae(""),y=ae("Single"),w=ae("closed"),A=be(()=>n.quoteName),I=be(()=>y.value==="Single");async function S(E){r.value=E||xc("id"),i.value=xc("origin"),await T(),await N()}async function N(){try{console.info("getRecordInfo",r.value);let E=await window.salesforceConnector.getRecordInfo(r.value);return E=bt(E),E!==void 0&&(u.value=E,m.value=E.name,h.value=E.objectType,g.value=E.accountId,d.value=E.eCatalogId,v.value=E.currencyCode,_.value=E.userLocale,C.value=E.opportunityId),(E==null?void 0:E.objectType)==="XX_ORD1__Quote__c"?(n.quoteId=E==null?void 0:E.recordId,n.templateId=E==null?void 0:E.templateId,n.quoteName=E==null?void 0:E.name,n.lineItemsCount=(E==null?void 0:E.lineItemsCount)||0):(E==null?void 0:E.objectType)==="Opportunity"&&await n.getPrimaryQuote(E.recordId),E}catch(E){t.handleError(E.message)}}async function T(){var L,V;console.info("getOrgInformation",r.value);const E=await window.salesforceConnector.getOrgInformation();e.websocketUrl=E.websocketUrl,a.value=(L=E.locale)==null?void 0:L.replace("_","-"),s.value=E.user,l.value=E.orgName,p.value=E.orgId,c.value=E.orgType,f.value=E.packageVersion,y.value=(V=E==null?void 0:E.pricingSchema)==null?void 0:V.toLowerCase()}function k(E){o.value=E,s0(E)}return{id:r,origin:i,title:A,subTitle:o,locale:a,user:s,orgName:l,orgId:p,orgType:c,packageVersion:f,objectType:h,recordInfo:u,name:m,accountId:g,eCatalogId:d,currencyCode:v,userLocale:_,opportunityId:C,pricingSchema:y,isSinglePricingSchema:I,flyoutState:w,start:S,getRecordInfo:N,setSubTitle:k}}),a5="https://api-svc.blink.expedite1.com/api/product-pricing/evaluateConfigurationSelection",s5={productJSON:{productItem:{configRules:[{publishKey:"rule-a1",name:"If latest is optA include optB",priority:1,enforceRule:!0,ruleJson:'{"latestSelected":"optA","actionType":"include","affectedOptions":["optB"]}'}]}},currentConfig:{product:{publishKey:"prod-1",attributes:[]},options:[]},selected:{publishKey:"optA",attributes:[]}};async function l5(e=s5){const t=a5;try{const n=await fetch(t,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error(`HTTP error! status: ${n.status} ${n.statusText}`);return await n.json()}catch(n){throw console.info("Error fetching data with Fetch API:",n),n}}function c5(e){const t=n=>Math.min(...n.options.map(r=>r.relationshipInfo.primarySortOrder));return e.forEach(n=>{n.itemTypes.forEach(r=>{r.options.sort((i,o)=>i.relationshipInfo.primarySortOrder-o.relationshipInfo.primarySortOrder||i.itemName.localeCompare(o.itemName))}),n.itemTypes.sort((r,i)=>t(r)-t(i)||r.itemTypeName.localeCompare(i.itemTypeName))}),e.sort((n,r)=>{const i=Math.min(...n.itemTypes.map(t)),o=Math.min(...r.itemTypes.map(t));return i-o||n.category.localeCompare(r.category)}),e}const u5=(e,t)=>{const n=(r,i)=>typeof i=="function"?void 0:i;return JSON.stringify(e,n)===JSON.stringify(t,n)},sn=Rt("configurator-main",()=>{const e=wa(),t=ar(),n=Tn(),r=an(),i=Vi(),o=ae(null),a=ae(null),s=ae(null),l=ae(null),p=ae([]),c=ae(null),f=ae(null),u=ae(new Map),m=ae(!1),h=ae({configuration:!1,lineItem:!1,productOptionsPricing:!1,bestOfferPrice:!1,lineItemAttributes:!1,save:!1}),g=ae(!1),d=be(()=>v.value&&!t.isSinglePricingSchema),v=be(()=>{let D=!0,q=!0,$=!0,H=null;for(const J of s.value.categoryOptions)for(const R of J.itemTypes)for(const z of R.options)z.billingPeriod&&(H&&H!==z.billingPeriod&&($=!1),H=z.billingPeriod,!z.yrcPrice&&z.billingPeriod==="Monthly"&&(D=!1),!z.mrcPrice&&z.billingPeriod==="Yearly"&&(q=!1));return D&&q&&$}),_=be(()=>!u5(s.value,l.value)),C=be(()=>{const D=s.value.categoryOptions;return D.forEach(q=>{q.itemTypes.forEach($=>{$.selectedOptions=$.options.filter(H=>$.selected.includes(H.itemId)),$.totalPrice=function(){return $.selectedOptions.reduce((H,J)=>H+J.price*J.qty,0)||0},$.oneTimePrice=function(){return $.selectedOptions.filter(H=>!H.billingPeriod).reduce((H,J)=>H+J.price*J.qty,0)||0},$.recurringPrice=function(){return $.selectedOptions.filter(H=>H.billingPeriod).reduce((H,J)=>H+J.price*J.qty,0)||0}}),q.selectedItemTypes=q.itemTypes.filter($=>$.selected.length>0),q.totalPrice=function(){return q.itemTypes.reduce(($,H)=>$+H.totalPrice(),0)},q.oneTimePrice=function(){return q.itemTypes.reduce(($,H)=>$+H.oneTimePrice(),0)},q.recurringPrice=function(){return q.itemTypes.reduce(($,H)=>$+H.recurringPrice(),0)}}),D.filter(q=>q.itemTypes.filter($=>$.selected.length>0).length>0)}),y=be(()=>C.value.reduce((D,q)=>D+q.totalPrice(),0)),w=be(()=>{const D=C.value.reduce((H,J)=>H+J.totalPrice(),0);let q=C.value.reduce((H,J)=>H+J.oneTimePrice(),0),$=C.value.reduce((H,J)=>H+J.recurringPrice(),0);return s.value.billingPeriod?$=($+s.value.price)*s.value.qty:q=(q+s.value.price)*s.value.qty,{basePrice:s.value.price,addOns:D,oneTimePrice:q,recurringPrice:$,total:s.value.price*s.value.qty+D*s.value.qty+q+$}}),A=be(()=>{const D=new Map;return D.set(c.value.productLineItem.XX_ORD1__Item__c,c.value.productLineItem),c.value.options.forEach(q=>{D.set(q.XX_ORD1__Item__c,q)}),D}),I=be(()=>{const D=new Map;return s.value.categoryOptions.forEach(q=>{q.itemTypes.forEach($=>{$.options.forEach(H=>{D.set(H.relationshipInfo.publishKey,H)})})}),D}),S=be(()=>{const D=new Map;return D.set(f.value.product.XX_ORD1__Item__c,f.value.product),f.value.options.forEach(q=>{D.set(q.XX_ORD1__Item__c,q)}),D});function N(D){s.value.qliId&&(s.value.qliBillingPeriod==="Monthly"&&!D?s.value.price=s.value.qliSalesPrice||s.value.qliMrcPrice:s.value.qliBillingPeriod==="Yearly"&&D&&(s.value.price=s.value.qliSalesPrice)),s.value.categoryOptions.forEach(q=>{q.itemTypes.forEach($=>{$.options.forEach(H=>{H.billingPeriod&&(H.price=(D?H.yrcPrice.offerPrice:H.mrcPrice.offerPrice)||H.price,H.qliId&&(H.qliBillingPeriod==="Monthly"&&!D?H.price=H.qliSalesPrice||H.qliMrcPrice:H.qliBillingPeriod==="Yearly"&&D&&(H.price=H.qliSalesPrice)))})})})}function T(){s.value=null,l.value=null,p.value=[],c.value=null,f.value=null,u.value=new Map,m.value=!1,h.value.configuration=!1,h.value.lineItem=!1,h.value.productOptionsPricing=!1,h.value.bestOfferPrice=!1,h.value.lineItemAttributes=!1,h.value.save=!1}async function k(D,q){T(),o.value=D||e.params.itemId,a.value=q||e.params.qliId,console.info("initConfigurator",o.value,a.value,n.quoteId);const $=await E();await te(),await fe(),s.value=V($);const H=await j();L(H),await W();let J=!1;for(const R of c.value.options)R.XX_ORD1__Billing_Period__c==="Yearly"&&(J=!0);J&&(g.value=!0,N(!0)),l.value=JSON.parse(JSON.stringify(s.value))}async function E(){try{console.info("itemId",o.value);const D=await window.productManagerController.getProductConfiguration({itemId:o.value});console.info("getProductConfiguration:result",D);const q=JSON.parse(D.data).productItem;return q.categoryOptions=c5(q.categoryOptions),q}catch(D){return console.info("error",D.message),!1}}function L(D){const q=new Map;q.set(f.value.product.Id,f.value.product.XX_ORD1__Item__c),f.value.options.forEach(H=>{q.set(H.Id,H.XX_ORD1__Item__c)});const $=new Map;if(D.forEach(H=>{const J={};H.pricingTypes.forEach(R=>{R.appliedOnField==="Catalog Price"?J.catalogPrice=R:R.appliedOnField==="MRC"?J.mrcPrice=R:R.appliedOnField==="YRC"&&(J.yrcPrice=R)}),J.billingPeriod=H.billingPeriod,J.mrcPrice&&!t.isSinglePricingSchema?J.price=J.mrcPrice.offerPrice:J.catalogPrice&&t.isSinglePricingSchema&&(J.price=J.catalogPrice.offerPrice),J.offer={offerDiscount:H.offerDiscount,offerId:H.offerId,offerType:H.offerType},$.set(q.get(H.eCatalogItemId),J)}),$.has(s.value.itemId)){const H=$.get(s.value.itemId),J=s.value.price;Object.assign(s.value,H),s.value.qliId&&(s.value.price=J)}s.value.categoryOptions.forEach(H=>{H.itemTypes.forEach(J=>{J.options.forEach(R=>{if($.has(R.itemId)){const z=$.get(R.itemId),oe=R.price;Object.assign(R,z),R.qliId&&(R.price=oe)}})})})}function V(D){D.isAttributes=D.attributes&&D.attributes.length>0,u.value.set(a.value,D.attributes),p.value=D.configRules;const q=new Set;return p.value.forEach($=>{const H=JSON.parse($.ruleJson);H.optionSelected.forEach(J=>{q.add(J)}),H.affectedOptions.forEach(J=>{q.add(J)})}),K(D),D.categoryOptions.forEach($=>{$.key=$.category.toLowerCase().replace(/\s+/g,"-").replace(/[&]/g,""),$.itemTypes.forEach(H=>{H.selected=[],H.options=H.options.filter(J=>S.value.has(J.itemId)),H.numberOfColumns||(H.numberOfColumns=1),H.numberOfColumns>1&&(H.lightboxAttributes=!0),H.maxNumber||(H.maxNumber=100),H.minNumber||(H.minNumber=0),H.maxQuantity||(H.maxQuantity=1e4),H.minQuantity||(H.minQuantity=1),H.maxNumber===1?(H.isRadio=!0,H.minMessage="Please select 1 option",H.maxMessage="",H.isKit=H.options.some(J=>J.relationshipInfo.relationship==="Kit")):(H.minMessage=`Minimum of ${H.minNumber} selection${H.minNumber!==1?"s":""} required`,H.maxMessage=`Maximum of ${H.maxNumber} selection${H.maxNumber!==1?"s":""} allowed`),H.options.forEach(J=>{$.showImage=$.showImage||!!J.defaultImageURL,J.showAttributesModal=!1,J.calculateRules=q.has(J.relationshipInfo.publishKey),J.qty=H.minQuantity||1,J.getTags=()=>(J.attributes=J.attributes||[],J.attributes.filter(R=>R.value!==null&&R.value!=="").map(R=>({label:R.label,value:R.value}))),Object.defineProperty(J,"isDisabled",{get:function(){return J.relationshipInfo.relationship==="Kit"||(H.isRadio?H.isKit:!H.selected.includes(J.itemId)&&H.maxNumber===H.selected.length)}}),K(J),(A.value.has(J.itemId)||J.relationshipInfo.relationship==="Kit")&&H.selected.push(J.itemId)})})}),D}function K(D){D.isAttributes=D.attributes&&D.attributes.length>0;const q=S.value.get(D.itemId);if(A.value.has(D.itemId)){const $=A.value.get(D.itemId);D.qliId=$.Id,D.qty=$.XX_ORD1__QTY__c,D.itemName=$.XX_ORD1__Line_Description__c,D.billingPeriod=$.XX_ORD1__Billing_Period__c,D.price=$.XX_ORD1__Sales_Price__c,D.billingPeriod?D.price=$.XX_ORD1__Sales_Price__c||$.XX_ORD1__MRC__c:D.price=$.XX_ORD1__NRC__c||$.XX_ORD1__Sales_Price__c,D.qliSalesPrice=$.XX_ORD1__Sales_Price__c,D.qliNrcPrice=$.XX_ORD1__NRC__c,D.qliMrcPrice=$.XX_ORD1__MRC__c,D.qliBillingPeriod=$.XX_ORD1__Billing_Period__c,u.value.set(D.qliId,D.attributes)}else D.itemName=q.XX_ORD1__Line_Description__c||D.itemName,D.price=q.XX_ORD1__Negotiated_Price__c||q.XX_ORD1__NRC_for_New__c,D.nrcPrice=q.XX_ORD1__NRC_for_New__c}async function W(){console.info("getLineItemAttributes"),h.value.lineItemAttributes=!0;const q={lineItemIds:[c.value.productLineItem.Id,...c.value.options.map(J=>J.Id)]},$=await window.productManagerController.getLineItemAttributes({request:JSON.stringify(q)});console.info("getLineItemAttributes:result",$);const H=JSON.parse($.data);for(const[J,R]of Object.entries(H))if(u.value.has(J)){const z=u.value.get(J),oe=new Map;R==null||R.forEach(ce=>{oe.set(ce.apiName,ce)}),z==null||z.forEach(ce=>{oe.get(ce.apiName)&&(ce.value=oe.get(ce.apiName).value||"",ce.dataType==="REFERENCE"&&(ce.referenceRecordId=oe.get(ce.apiName).referenceRecordId||"",ce.referenceRecordId?ce.options=[{Name:ce.value||"",Id:ce.referenceRecordId}]:ce.options=[]))})}h.value.lineItemAttributes=!1}async function te(){h.value.lineItem=!0,console.info("getLineItems",n.quoteId,a.value);try{const D={objectId:n.quoteId,filters:{},additionalFields:["Name","XX_ORD1__Line_Description__c"],primarySort:{field:"CreatedDate",direction:"DESC"},productPage:{recordLimit:200,offset:0,productLineItemId:a.value}},q=await window.productManagerController.getLineItems({request:JSON.stringify(D)});return console.info("getLineItems:result",q),c.value=JSON.parse(q.data).products[0],console.info("result",q),h.value.lineItem=!1,q}catch(D){return console.info("error",D.message),h.value.lineItem=!1,!1}}async function fe(){h.value.productOptionsPricing=!0,console.info("getProductOptionsPricing");try{const D={objectId:n.quoteId,itemId:o.value},q=await window.productManagerController.getProductOptionsPricing({request:JSON.stringify(D)});return console.info("getProductOptionsPricing:result",q),f.value=JSON.parse(q.data),h.value.productOptionsPricing=!1,f.value}catch(D){return console.info("error",D.message),h.value.productOptionsPricing=!1,!1}}async function ee(D){console.info("getRecords");try{const q=await window.productManagerController.getRecords({request:JSON.stringify(D)});return console.info("getRecords:result",q),JSON.parse(q.data)}catch(q){return console.info("error",q.message),!1}}async function j(){h.value.bestOfferPrice=!0,console.info("getBestOfferPrice");const D=[f.value.product.Id];f.value.options.forEach(q=>{D.push(q.Id)});try{const q=await O(D);return h.value.bestOfferPrice=!1,q}catch(q){return console.info("error",q.message),h.value.bestOfferPrice=!1,!1}}async function O(D){const q={accountId:t.accountId,eCatalogItemIds:D,pricePreference:"Heighest Priority"},$=await window.productManagerController.calculateBestOfferPrice({request:JSON.stringify(q)});return console.info("calculateBestOfferPrice:result",$),h.value.bestOfferPrice=!1,JSON.parse($.data)}async function P(){m.value=!0,h.value.save=!0,console.info("maintainQuoteConfiguration");const D=[],q=[];s.value.categoryOptions.forEach(J=>{J.itemTypes.forEach(R=>{R.options.forEach(z=>{R.selected.includes(z.itemId)?D.push(M(z)):z.qliId&&q.push(z.qliId)})})});const $={objectId:n.quoteId,eCatalogId:t.eCatalogId,isGenesisAI:!0,blinkUser:!1,optionsToRemove:q,grandFatheredOptionsToRemove:[],productLineItem:{...M(s.value),optionLineItems:D}};console.info("maintainQuoteConfiguration:request",$);const H=await window.productManagerController.maintainQuoteConfiguration({request:JSON.stringify($)});if(console.info("maintainQuoteConfiguration:result",H),H!=null&&H.error){const J={title:"Unable to Save Configuration",description:H.error,button:{label:"Back to Configuration",action:()=>{m.value=!1}},cancel:{label:"Quote List",action:()=>{i.push("/quote-item?id="+n.quoteId)}}};r.errorPopup=J}else l.value=JSON.parse(JSON.stringify(s.value)),console.info("maintainQuoteConfiguration:result",H);h.value.save=!1}function M(D){const q={};D.isAttributes&&D.attributes.forEach(H=>{H.apiName.includes(".")||(H.dataType==="BOOLEAN"?q[H.apiName]=H.value?"true":"false":H.dataType==="REFERENCE"?q[H.apiName]=H.referenceRecordId:q[H.apiName]=H.value)});const $={attributes:q,itemId:D.itemId,lineItemId:D.qliId,lineDescription:D.itemName,qty:D.qty,billingPeriod:D.billingPeriod,...D.offer};return D.billingPeriod&&v.value&&!t.isSinglePricingSchema&&($.billingPeriod=g.value?"Yearly":"Monthly"),!t.isSinglePricingSchema&&!D.billingPeriod?$.nrcPrice=D.price:($.applyOnField="Catalog Price",$.salesPrice=D.price,$.nrcPrice=D.nrcPrice),$}async function Z(){const D={objectId:t.eCatalogId,productItemId:o.value};try{let q=await window.productManagerController.getProductCrossSells({request:JSON.stringify(D)});if(console.info("getProductCrossSells:result",q),q=q.data?JSON.parse(q.data):{},q.crossSells.length===0)return q;const $=q.crossSells.map(R=>R.Id),H=await O($),J=new Map;return H.forEach(R=>{J.set(R.eCatalogItemId,{...R,...R.pricingTypes[0]})}),q.crossSells.forEach(R=>{R.loading=!1,R.Name=R.XX_ORD1__Line_Description__c||R.XX_ORD1__Item__r.Name,R.Description=R.XX_ORD1__Item__r.XX_ORD1__Product_Description__c,J.has(R.Id)?(R.Price=J.get(R.Id).offerPrice,R.priceFormatted=J.get(R.Id).formattedOfferPrice,R.offer={offerDiscount:J.get(R.Id).offerDiscount,offerId:J.get(R.Id).offerId,offerType:J.get(R.Id).offerType}):(R.Price=R.XX_ORD1__List_Price2__c,R.priceFormatted=R.XX_ORD1__List_Price2__c,R.offer={offerDiscount:0,offerId:null,offerType:null})}),q}catch(q){return console.info("error",q.message),!1}}async function Q(D,q){var R,z;const $={product:{publishKey:s.value.publishKey,lineDescription:s.value.itemName},options:[]};s.value.categoryOptions.forEach(oe=>{oe.itemTypes.forEach(ce=>{ce.options.forEach(le=>{ce.selected.includes(le.itemId)&&$.options.push({publishKey:le.relationshipInfo.publishKey,lineDescription:le.itemName})})})}),console.info("evaluateConfigSelection:currentConfig.options",$.options);const H={productJSON:{productItem:{configRules:p.value}},currentConfig:$,selected:D?{publishKey:(R=D.relationshipInfo)==null?void 0:R.publishKey,attributes:D.attributes,lineDescription:D.itemName}:{},unselected:q?{publishKey:(z=q.relationshipInfo)==null?void 0:z.publishKey,attributes:q.attributes,lineDescription:q.itemName}:{}};return await l5(H)}async function B(){try{const D=["Name","XX_ORD1__Line_Description__c","XX_ORD1__Item__r.XX_ORD1__Product_Description__c","XX_ORD1__Sales_Price__c","XX_ORD1__SYS_Configuration_Status2__c"],$=(await n.getQuoteLineItemsWithFilteredTable({fields:D,recordId:n.quoteId,filters:[],includeOptions:!1,totalFields:[]})).lineItems;return console.info("fetchQuoteLineItems:res",$),$}catch(D){console.info("[ERROR]: fetchQuoteLineItems()123 error = ",D.message)}}async function U(D){const q={quoteId:n.quoteId,lstQLIRequest:[{eCatalogItemId:D.Id,quantity:1,offerApplicable:D.offer}]};try{const $=await window.productManagerController.createQuoteProducts({request:JSON.stringify(q)});console.info("getProductCrossSells:result",$)}catch($){return console.info("error",$.message),!1}}return{itemId:o,configuration:s,_configurationCopy:l,lineItem:c,savedScreen:m,loading:h,summary:C,addOns:y,summaryPrices:w,optionByItemId:A,attributesByQLIId:u,optionByPublishKey:I,showYearlyPricing:g,isYearlyPricingExist:v,isChangedConfiguration:_,isRecurringPricingSchema:d,changePricingScheme:N,createQuoteProducts:U,resetConfigurator:T,fetchQuoteLineItems:B,getRecords:ee,getProductCrossSells:Z,initConfigurator:k,maintainQuoteConfiguration:P,evaluateConfigSelection:Q}}),f5={class:"ect-p-4 ect-flex ect-gap-2 ect-items-center ect-justify-between ect-border-b ect-border-gray-200"},d5={class:"ect-flex ect-items-center ect-gap-3"},h5={class:"ect-text-xl ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},p5={key:0,class:"ect-flex ect-gap-1.5 ect-items-center"},m5=b("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Saving configuration...",-1),g5={key:1,class:"ect-flex ect-gap-1.5 ect-items-center"},v5=b("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Configuration Saved Successfully",-1),y5={key:1,class:"ect-flex ect-flex-col ect-gap-4 ect-flex-1 ect-overflow-y-auto ect-mb-16"},_5=b("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed ect-p-4 ect-pb-0"},"You may consider these products",-1),b5={class:"ect-flex ect-flex-col ect-gap-4 ect-p-4 ect-pt-0 ect-overflow-y-auto"},C5=["data-test-id"],w5={class:"ect-flex-1 ect-flex ect-flex-col ect-gap-2"},x5={class:"ect-text-sm ect-font-semibold ect-text-gray-800 ect-leading-tight"},k5={class:"ect-text-sm ect-font-medium ect-text-gray-600 ect-leading-relaxed ect-line-clamp-2"},E5={class:"ect-flex ect-flex-row ect-justify-between ect-items-center"},O5={class:"ect-text-sm ect-font-semibold ect-text-gray-800"},S5={key:2,class:"ect-flex ect-flex-col ect-gap-4 ect-m-4 ect-flex-1 ect-overflow-y-auto"},I5=b("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},"What do you want to do next?",-1),A5={class:"ect-flex ect-flex-col ect-gap-4"},T5=["data-test-id","onClick"],N5={class:"ect-flex ect-items-center ect-justify-center"},P5={class:"ect-flex ect-flex-col ect-items-center ect-gap-2 ect-w-full"},L5=["data-test-id"],R5=["data-test-id"],M5={key:3,class:"ect-bg-light-bg-x ect-border-t ect-border-gray-200 ect-flex-shrink-0 ect-sticky ect-bottom-0 ect-pb-4"},q5={class:"ect-flex ect-flex-col ect-gap-4"},j5={class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed ect-p-4 ect-pb-0"},D5={class:"ect-flex ect-flex-col ect-gap-4 ect-p-4 ect-pt-0 ect-overflow-y-auto"},B5={class:"ect-bg-white ect-border ect-border-gray-300 ect-rounded-md ect-p-3 ect-flex ect-flex-col","data-test-id":"configurator-recommend-card-next-product"},$5={class:"ect-flex-1 ect-flex ect-flex-col ect-gap-2"},F5={class:"ect-text-sm ect-font-semibold ect-text-gray-800 ect-leading-tight"},V5={class:"ect-text-sm ect-font-medium ect-text-gray-600 ect-leading-relaxed ect-line-clamp-2"},H5={class:"ect-flex ect-flex-row ect-justify-between ect-items-center"},U5={class:"ect-text-sm ect-font-semibold ect-text-gray-800"},z5={__name:"ConfiguratorRecommend",setup(e){const t=sn(),n=Tn(),r=Vi(),i=be(()=>t.configuration),o=ae(!0),a=ae(""),s=ae([{icon:"configuration",title:"Back to current Product Configuration",description:"Returns to the active product configuration page.",link:"/item/overview",action:"backToConfiguration"},{icon:"menu",title:"Back to Quote List Page",description:"Returns to the main quote list page.",link:"/quote-item",action:"backToQuoteList"}]),l=ae(null),p=ae([]),c=async h=>{h.loading=!0,await t.createQuoteProducts(h),h.disabled=!0,h.loading=!1},f=h=>{h.action==="backToConfiguration"?t.savedScreen=!1:h.action==="backToQuoteList"?r.push("/quote-item?id="+n.quoteId):h.link&&r.push(h.link)};async function u(){const h=await t.fetchQuoteLineItems();console.info("getQuoteLineItems1:_quoteLineItems",h);const g=h.filter(v=>v.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration").length;console.info("getQuoteLineItems2:needsConfigurationCount",g),a.value=`(${h.length-g}/${h.length})`;const d=h.find(v=>v.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration"&&v.Id!=t.qliId);return console.info("getQuoteLineItems3:result",d),l.value=d?{Name:d.XX_ORD1__Line_Description__c,Description:d.XX_ORD1__Item__r.XX_ORD1__Product_Description__c,Price:d.XX_ORD1__Sales_Price__c,XX_ORD1__Item__c:d.XX_ORD1__Item__c,Id:d.Id}:null,console.info("getQuoteLineItems4:configueredProduct",l.value),h}async function m(){t.resetConfigurator(),r.push({path:"/configurator/"+l.value.XX_ORD1__Item__c+"/"+l.value.Id}),t.initConfigurator(l.value.XX_ORD1__Item__c,l.value.Id)}return wn(async()=>{o.value=!0;const h=await u(),g=await t.getProductCrossSells(),d=new Set;h.forEach(v=>{d.add(v.XX_ORD1__Item__c)}),g.crossSells.forEach(v=>{v.disabled=d.has(v.XX_ORD1__Item__c)}),p.value=g.crossSells||[],o.value=!1}),(h,g)=>(X(),ne(Oe,null,[b("div",f5,[b("div",d5,[_e(Ge,{icon:"arrow",symbol:"",size:12,onClick:g[0]||(g[0]=d=>Xe(t).savedScreen=!1)}),b("h2",h5,ve(i.value.itemName),1)]),Xe(t).loading.save?(X(),ne("div",p5,[_e(Oc,{svg:""}),m5])):(X(),ne("div",g5,[_e(Ge,{icon:"check",color:"#136E05",size:14,"data-test-id":"item-tabs-before-button-icon"}),v5]))]),o.value?(X(),Te(Ca,{key:0,type:"recommendations",rows:4})):p.value.length>0?(X(),ne("div",y5,[_5,b("div",b5,[(X(!0),ne(Oe,null,ze(p.value,(d,v)=>(X(),ne("div",{key:d.Id||v,class:"ect-bg-white ect-border ect-border-gray-300 ect-rounded-md ect-p-3 ect-flex ect-flex-col","data-test-id":`configurator-recommend-card-${d.Id||v}`},[b("div",w5,[b("h4",x5,ve(d.Name),1),b("p",k5,ve(d.Description),1)]),b("div",E5,[b("div",O5,ve(h.$formatCurrency(d.Price)),1),_e(Nt,{btype:d.disabled?"secondary":"primary","button-style":d.disabled?"normal":"outlined",size:"medium",class:Ie({"ect-w-[120px]":d.loading}),loading:d.loading,disabled:d.disabled||d.loading,"data-test-id":`configurator-recommend-button-add-${d.Id||v}`,onClick:_=>c(d)},{default:De(()=>[Fe(ve(d.loading?"":d.disabled?"Added to Quote":"Add to Quote"),1)]),_:2},1032,["btype","button-style","class","loading","disabled","data-test-id","onClick"])])],8,C5))),128))])])):(X(),ne("div",S5,[I5,b("div",A5,[(X(!0),ne(Oe,null,ze(s.value,(d,v)=>(X(),ne("div",{key:d.title||v,class:"ect-bg-white ect-border ect-border-[#DEDEDE] ect-rounded-xl ect-p-4 md:ect-p-5 lg:ect-p-6 ect-flex ect-flex-col ect-items-center ect-gap-4 md:ect-gap-6 lg:ect-gap-8 ect-cursor-pointer ect-transition-all ect-duration-200 hover:ect-shadow-md hover:ect-border-gray-400","data-test-id":`configurator-recommend-redirect-card-${v}`,onClick:_=>f(d)},[b("div",N5,[_e(Ge,{icon:d.icon,size:20,color:"#000000","data-test-id":`configurator-recommend-redirect-icon-${v}`},null,8,["icon","data-test-id"])]),b("div",P5,[b("h4",{class:"ect-text-sm ect-font-semibold ect-text-[#5F5F5F] ect-text-center ect-leading-[1.43]","data-test-id":`configurator-recommend-redirect-title-${v}`},ve(d.title),9,L5),b("p",{class:"ect-text-sm ect-font-normal ect-text-[#828282] ect-text-center ect-leading-[1.71]","data-test-id":`configurator-recommend-redirect-description-${v}`},ve(d.description),9,R5)])],8,T5))),128))])])),l.value?(X(),ne("footer",M5,[b("div",q5,[b("h3",j5," Configuere next product from your quote "+ve(a.value),1),b("div",D5,[b("div",B5,[b("div",$5,[b("h4",F5,ve(l.value.Name),1),b("p",V5,ve(l.value.Description),1)]),b("div",H5,[b("div",U5,ve(h.$formatCurrency(l.value.Price)),1),_e(Nt,{btype:"primary","button-style":"filled",size:"medium","data-test-id":"configurator-recommend-button-add-next-product",onClick:m},{default:De(()=>[Fe(" Configure Now ")]),_:1})])])])])])):ye("",!0)],64))}},K5=["data-test-id"],Z5=Ve({__name:"AppPill",props:{variant:{type:String,default:"",validator:e=>["success","error",""].includes(e)},dataTestId:{type:String,default:""}},setup(e){return(t,n)=>(X(),ne("span",{class:Ie(["ect-pill",{"ect-pill-success":e.variant==="success","ect-pill-error":e.variant==="error","ect-pill-default":!e.variant}]),"data-test-id":e.dataTestId},[Ze(t.$slots,"default",{},void 0,!0)],10,K5))}},[["__scopeId","data-v-c7f05fa0"]]),Q5=["data-test-id"],X5=["data-test-id"],J5=["data-test-id","onClick"],W5=["data-test-id"],G5=Ve({__name:"AppTabsV2",props:{showTabs:{type:Boolean,default:!0},modelValue:{type:String,default:""},border:{type:Boolean,default:!1},tabs:{type:Array,required:!0,validator:e=>e.every(t=>typeof t=="object"&&t.title&&t.key&&(t.sections===void 0||Array.isArray(t.sections)))},dataTestId:{type:String,required:!0}},emits:["update:modelValue","tab-change"],setup(e,{emit:t}){const n=e,r=t,i=be(()=>{var a;return n.modelValue||((a=n.tabs[0])==null?void 0:a.key)||""}),o=a=>{r("update:modelValue",a),r("tab-change",a)};return(a,s)=>(X(),ne("div",{class:"ect-page-tabs","data-test-id":e.dataTestId},[e.showTabs?(X(),ne("div",{key:0,class:Ie(["ect-page-tabs-header",[{"ect-tab-border":e.border}]]),"data-test-id":`${e.dataTestId}-header`},[(X(!0),ne(Oe,null,ze(e.tabs,l=>(X(),ne("button",{key:l.key,class:Ie(["ect-page-tab-button",`ect-page-tab-button${i.value===l.key?"-active":""} ${l.tabClass||""}`]),"data-test-id":`${e.dataTestId}-tab-${l.key}`,onClick:p=>o(l.key)},[Fe(ve(l.title)+" ",1),l.pill!==void 0&&l.pill!==null?(X(),Te(Z5,{key:0,class:"ect-ml-2",variant:l.pillStyle,"data-test-id":`${e.dataTestId}-tab-${l.key}-pill`},{default:De(()=>[Fe(ve(l.pill),1)]),_:2},1032,["variant","data-test-id"])):ye("",!0)],10,J5))),128))],10,X5)):ye("",!0),b("div",{class:"ect-page-tab-content","data-test-id":`${e.dataTestId}-content`},null,8,W5)],8,Q5))}},[["__scopeId","data-v-f22cb1ed"]]),Y5=["data-test-id"],eh=["disabled","data-test-id"],th=["value","disabled","data-test-id"],nh=["disabled","data-test-id"],zi={__name:"CounterButton",props:{value:{type:Number,required:!0,default:null},min:{type:Number,default:1},max:{type:Number,default:999},empty:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:value","change"],setup(e,{emit:t}){const n=e,r=t,i=be(()=>n.min==null?0:n.min),o=be(()=>n.max==null?999:n.max),a=(y,w,A)=>Math.min(Math.max(y,w),A),s=y=>{if(y==null||y==="")return NaN;const w=Number(y);return Number.isFinite(w)?w:NaN},l=ae(null),p=ae(n.value??i.value),c=y=>{p.value=a(y,i.value,o.value)};n.value!==null&&c(n.value);const f=be(()=>p.value),u=be(()=>l.value!=null?l.value:String(f.value)),m=be(()=>n.disabled||f.value<=i.value),h=be(()=>n.disabled||f.value>=o.value);function g(y){y!==n.value&&(p.value=y,r("update:value",y),r("change",y))}function d(){if(m.value)return;const y=a(f.value-1,i.value,o.value);l.value=null,g(y)}function v(){if(h.value)return;const y=a(f.value+1,i.value,o.value);l.value=null,g(y)}function _(y){const A=String(y.target.value??"").replace(/\D+/g,"");l.value=A}function C(){const y=s(l.value),w=i.value,A=a(Number.isNaN(y)?w:y,i.value,o.value);l.value=null,g(A)}return(y,w)=>(X(),ne("div",{class:"ect-flex ect-items-center ect-gap-1","data-test-id":e.dataTestId},[b("button",{type:"button",class:Ie(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":m.value,"ect-cursor-not-allowed":m.value}]),disabled:m.value,"data-test-id":`${e.dataTestId}-decrement`,onClick:d}," - ",10,eh),b("input",{type:"text",inputmode:"numeric",pattern:"[0-9]*",value:e.empty?"":u.value,disabled:e.disabled,class:"ect-h-7 ect-w-[48px] ect-px-2 ect-border ect-border-gray ect-rounded-md ect-text-center ect-text-sm ect-font-medium ect-text-gray-900 focus:ect-outline-none focus:ect-border-gray-400 ect-bg-white","data-test-id":`${e.dataTestId}-input`,onInput:_,onBlur:C},null,40,th),b("button",{type:"button",class:Ie(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":h.value,"ect-cursor-not-allowed":h.value}]),disabled:h.value,"data-test-id":`${e.dataTestId}-increment`,onClick:v}," + ",10,nh)],8,Y5))}},rh={class:"ect-flex ect-justify-end ect-items-center ect-gap-2.5 ect-px-6 ect-pb-6 ect-pt-4 ect-bg-white ect-border-t ect-border-gray-300 ect-shadow-[0_-2px_4px_0px_rgba(0,0,0,0.11)]","data-test-id":"configurator-footer"},ih={"data-test-id":"configurator-footer-quantity"},oh={class:"ect-flex ect-justify-end ect-items-center ect-gap-6 ect-px-8 ect-py-0 ect-flex-1","data-test-id":"configurator-footer-prices"},ah=["data-test-id"],sh=["data-test-id"],lh=["data-test-id"],ch=["data-test-id"],uh={__name:"ConfiguratorFooter",props:{item:{type:Object,required:!0,default:()=>{}},disabled:{type:Boolean,default:!1},btnText:{type:String,default:"Save"}},emits:["update:qty","continue"],setup(e,{emit:t}){const n=sn(),r=e,i=ae(r.item),o=be(()=>{const l=n.summaryPrices,p=[];return n.isRecurringPricingSchema?(p.push({label:"One Time Price",value:l.oneTimePrice,highlight:!1}),p.push({label:n.showYearlyPricing?"Yearly Price":"Monthly Price",value:l.recurringPrice,highlight:!1})):(p.push({label:"Base Price",value:l.basePrice,highlight:!1}),p.push({label:"Add Ons",value:l.addOns,highlight:!1}),p.push({label:"Total Price",value:l.total,highlight:!1})),p}),a=t,s=()=>{r.disabled||a("continue")};return(l,p)=>(X(),ne("footer",rh,[b("div",ih,[_e(zi,{value:i.value.qty,"onUpdate:value":p[0]||(p[0]=c=>i.value.qty=c),min:1,max:999,disabled:e.disabled,"is-selected":!0,"data-test-id":"configurator-footer-counter-button"},null,8,["value","disabled"])]),b("div",oh,[(X(!0),ne(Oe,null,ze(o.value,(c,f)=>(X(),ne(Oe,{key:f},[b("div",{class:"ect-flex ect-flex-col ect-justify-center","data-test-id":`configurator-footer-price-${f}`},[b("span",{class:"ect-text-xs ect-font-normal ect-text-gray-500 ect-text-left","data-test-id":`configurator-footer-price-label-${f}`},ve(c.label),9,sh),b("span",{class:Ie(["ect-text-left",c.highlight?"ect-text-lg ect-font-bold ect-text-green-700":"ect-text-sm ect-font-medium ect-text-gray-800 "]),"data-test-id":`configurator-footer-price-value-${f}`},ve(c.value),11,lh)],8,ah),f<o.value.length-1?(X(),ne("div",{key:0,class:"ect-w-0 ect-h-5 ect-border-l ect-border-gray-400","data-test-id":`configurator-footer-divider-${f}`},null,8,ch)):ye("",!0)],64))),128))]),_e(Nt,{class:"ect-min-w-[100px]",btype:e.disabled?"secondary":"primary",disabled:e.disabled,"button-style":"primary",size:"medium","data-test-id":"configurator-footer-button-continue",onClick:s},{default:De(()=>[Fe(ve(e.btnText),1)]),_:1},8,["btype","disabled"])]))}},fh={class:"ect-w-full ect-bg-white ect-mb-4","data-test-id":"configurator-type-section"},dh={class:"ect-sticky ect-top-0 ect-z-30 ect-bg-white ect-shadow-sm ect-p-3 ect-px-4 ect-border-b ect-border-gray-200 ect-flex ect-justify-between ect-items-center","data-test-id":"configurator-type-header-sticky"},hh={class:"ect-flex ect-flex-col"},ph={class:"ect-font-bold ect-text-text-success ect-leading-tight"},mh=["innerHTML"],gh={key:0,class:"ect-flex ect-items-center ect-gap-2 ect-px-2 ect-py-1","data-test-id":"configurator-type-message"},vh={class:"ect-text-xs ect-font-medium ect-text-gray-600 ect-leading-tight ect-min-w-[190px]"},yh={class:"ect-divide-y ect-divide-gray-100 ect-overflow-y-auto"},_h={__name:"ConfiguratorType",props:{title:{type:String,required:!0},description:{type:String,default:""},message:{type:String,default:""}},setup(e){return(t,n)=>(X(),ne("section",fh,[b("header",dh,[b("div",hh,[b("h2",ph,ve(e.title),1),e.description?(X(),ne("p",{key:0,class:"ect-mt-1 ect-text-xs ect-text-gray-500 ect-leading-tight",innerHTML:e.description},null,8,mh)):ye("",!0)]),e.message?(X(),ne("div",gh,[_e(Ge,{icon:"info",symbol:"",color:"#198708",size:14,"data-test-id":"configurator-type-message-icon"}),b("span",vh,ve(e.message),1)])):ye("",!0)]),b("div",yh,[Ze(t.$slots,"default")])]))}},bh={__name:"ShadowDisplay",props:{content:{type:String,required:!0}},setup(e){const t=e,n=ae(null);let r=null;return xn(()=>{n.value&&!r&&(r=n.value.attachShadow({mode:"open"}),r.innerHTML=t.content)}),St(()=>t.content,i=>{r&&(r.innerHTML=i)}),(i,o)=>(X(),ne("div",{ref_key:"host",ref:n},null,512))}},Ch=["data-test-id"],wh=["data-test-id"],xh=["data-test-id"],kh=[b("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("g",{id:"Group"},[b("path",{id:"Vector",d:"M7 1.3125V12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"}),b("path",{id:"Vector_2",d:"M1.3125 7H12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)],Eh=["data-test-id"],Oh=["data-test-id"],Sh=["data-test-id"],Ih=["data-test-id"],Ah=["data-test-id"],Th=["data-test-id","innerHTML"],Zt={__name:"Tag",props:{label:{type:String,default:""},value:{type:String,default:""},addButton:{type:Boolean,default:!1},editButton:{type:Boolean,default:!1},dataTestId:{type:String,default:""}},setup(e){const t=e,n=be(()=>{const r=t.value;if(typeof r!="string")return!1;const i=new DOMParser().parseFromString(r,"text/html");return Array.from(i.body.childNodes).some(o=>o.nodeType===1)});return(r,i)=>e.addButton?(X(),ne("div",{key:0,class:"ect-bg-orange-4 ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-orange-secondary","data-test-id":e.dataTestId},[b("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-orange-secondary ect-flex ect-items-center ect-gap-1","data-test-id":`${e.dataTestId}-content`},[b("div",{"data-test-id":`${e.dataTestId}-add-icon`},kh,8,xh),Fe(" "+ve(e.label),1)],8,wh)],8,Ch)):e.editButton?(X(),ne("div",{key:1,class:"ect-bg-white ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-success","data-test-id":e.dataTestId},[b("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-success ect-flex ect-items-center ect-gap-1","data-test-id":`${e.dataTestId}-content`},ve(e.label),9,Oh)],8,Eh)):(X(),ne("div",{key:2,class:"ect-bg-white ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-rounded-md ect-border ect-border-solid ect-border-neutral-200","data-test-id":e.dataTestId},[b("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${e.dataTestId}-label`},ve(e.label),9,Ih),e.value?(X(),ne("span",{key:0,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${e.dataTestId}-separator`}," : ",8,Ah)):ye("",!0),n.value?(X(),Te(bh,{key:1,content:e.value},null,8,["content"])):e.value?(X(),ne("span",{key:2,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-neutral-700","data-test-id":`${e.dataTestId}-value`,innerHTML:e.value},null,8,Th)):ye("",!0)],8,Sh))}},Nh=["data-test-id"],Ph=["data-test-id"],Lh=["data-test-id"],Rh=["type","step","min","data-test-id"],ka=Ve({__name:"InputEdit",props:{modelValue:{type:String,required:!0},type:{type:String,default:"string",validator:e=>["string","number","currency"].includes(e)},tag:{type:String,default:"span"},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:modelValue","change"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=ae(!1),a=ae(!1),s=ae(""),l=ae(null),p=be(()=>r.type==="currency"?v(r.modelValue):r.type==="number"?_(r.modelValue):r.modelValue),c=be(()=>r.type==="string"?"text":"number"),f=be(()=>r.type==="currency"?"0.01":void 0),u=be(()=>r.type==="currency"?"0":void 0),m=()=>{r.disabled||(r.type==="currency"?s.value=parseFloat(r.modelValue)||"0.00":r.type==="number"?s.value=parseFloat(r.modelValue)||"0":s.value=r.modelValue,o.value=!0,Ut(()=>{l.value&&(l.value.focus(),l.value.select())}))},h=()=>{let C=s.value;if(r.type==="number"||r.type==="currency"){const y=parseFloat(s.value);isNaN(y)?C=r.modelValue:C=r.type==="currency"?y.toFixed(2):y.toString()}C!==r.modelValue&&(i("update:modelValue",C),i("change",C)),o.value=!1},g=()=>{s.value=r.modelValue,o.value=!1},d=()=>{o.value&&h()},v=C=>!C||isNaN(C)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(parseFloat(C)),_=C=>!C||isNaN(C)?"0":new Intl.NumberFormat("en-US").format(parseFloat(C));return St(()=>r.modelValue,C=>{o.value||(s.value=C)}),t({startEditing:m,saveChanges:h,cancelEditing:g}),(C,y)=>{const w=Hf("click-outside");return X(),ne("div",{class:"ect-relative ect-inline-block ect-min-w-[60px] ect-h-[30px]","data-test-id":e.dataTestId,onMouseenter:y[1]||(y[1]=A=>a.value=!0),onMouseleave:y[2]||(y[2]=A=>a.value=!1)},[o.value?Cn((X(),ne("div",{key:1,class:"ect-w-full ect-h-full","data-test-id":`${e.dataTestId}-input-wrapper`},[Cn(b("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":y[0]||(y[0]=A=>s.value=A),type:c.value,step:f.value,min:u.value,class:Ie(["ect-w-full ect-h-full ect-px-3 ect-bg-white ect-border ect-border-green-500 ect-rounded-sm ect-text-gray-700 ect-text-base ect-font-sans ect-outline-none ect-duration-200",C.$attrs.class]),"data-test-id":`${e.dataTestId}-input`,onKeyup:[qr(h,["enter"]),qr(g,["esc"])],onBlur:h},null,42,Rh),[[u1,s.value]])],8,Lh)),[[w,d]]):(X(),ne("div",{key:0,class:Ie(["ect-flex ect-items-center ect-gap-2 ect-rounded ect-transition-colors ect-duration-200",{"ect-cursor-pointer":!e.disabled}]),"data-test-id":`${e.dataTestId}-display`,onClick:m},[(X(),Te(bl(e.tag),ua(C.$attrs,{class:"ect-m-0 ect-text-inherit","data-test-id":`${e.dataTestId}-text`}),{default:De(()=>[Fe(ve(p.value)+" ",1),_e(Ge,{class:Ie(a.value&&!e.disabled?"ect-visible":"ect-invisible"),icon:"edit",size:"12",color:"#828282","data-test-id":`${e.dataTestId}-edit-icon`},null,8,["class","data-test-id"])]),_:1},16,["data-test-id"]))],10,Ph))],40,Nh)}}},[["__scopeId","data-v-07416d80"]]),Mh=["data-test-id","data-publish-key"],qh={key:0,class:"ect-text-xs ect-text-gray-500 ect-text-white ect-font-medium ect-leading-tight ect-absolute ect-top-[-.7rem] ect-left-[-1rem] ect-bg-text-success ect-rounded-xl ect-px-2 ect-py-1"},jh={key:1,class:"ect-flex ect-items-start ect-gap-4 ect-p-3 ect-px-4"},Dh={key:0,class:"ect-w-16 ect-h-16 ect-flex ect-items-center ect-justify-center ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0"},Bh=["src","alt"],$h={class:"ect-flex-1 ect-min-w-0"},Fh={class:"ect-flex ect-gap-4 ect-items-center ect-justify-between"},Vh={class:"ect-flex ect-flex-row ect-gap-3"},Hh=b("div",{class:"ect-w-px ect-h-auto ect-bg-gray-200 ect-mx-2"},null,-1),Uh={class:"ect-flex ect-flex-col ect-max-w-[125px]"},zh={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},Kh=["innerHTML"],Zh={key:0,class:"ect-flex ect-flex-wrap ect-gap-2.5 ect-mt-2"},Qh=["data-test-id"],Xh=["data-test-id"],Jh={key:1,class:"ect-inline-block ect-mb-2"},Wh={key:2,class:"ect-flex ect-flex-col ect-gap-3 ect-p-3 ect-h-full ect-justify-between"},Gh={class:"ect-flex ect-items-start ect-gap-2"},Yh={class:"ect-w-16 ect-h-16 ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0 ect-overflow-hidden"},e9=["src","alt"],t9={class:"ect-flex-1 ect-min-w-0"},n9={class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},r9={class:"ect-mt-1 ect-text-sm ect-text-gray-700 ect-leading-tight"},i9={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},o9={key:0,class:"ect-flex ect-flex-wrap ect-gap-1.5"},a9=["data-test-id"],s9=["data-test-id"],l9={key:1,class:"ect-inline-block ect-mb-2"},c9={class:"ect-flex ect-justify-between ect-items-center"},u9={class:"ect-flex ect-flex-col"},f9=b("p",{class:"ect-text-xs ect-text-gray-500 ect-font-medium ect-leading-tight"},"Price",-1),d9={key:3,"data-test-id":"configurator-item-slot-details",class:"ect-bg-white ect-rounded-md"},h9={__name:"ConfiguratorItem",props:{item:{type:Object,required:!0},name:{type:String,required:!0},description:{type:String,default:""},imageUrl:{type:String,default:""},price:{type:Number,required:!0},quantity:{type:Number,default:1},selected:{type:Boolean,default:!1},tags:{type:Array,default:()=>[]},attributes:{type:Array,default:()=>[]},size:{type:Number,default:1},minQuantity:{type:Number,default:null},maxQuantity:{type:Number,default:null},showImage:{type:Boolean,default:!1},option:{type:Object,default:null},isAttributes:{type:Boolean,default:!1},showAttributes:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:quantity","update:name","edit-attributes"],setup(e,{emit:t}){const n=e,r=t,i=ae(null),o=ae(0),a=ae(n.item),s=be(()=>a.value.relationshipInfo.relationship==="Kit"?"ect-bg-green-3 ect-border-gray-200 ect-border-success":n.disabled?"ect-bg-light-bg-x ect-border-gray-200":n.selected?"ect-bg-green-3 ect-border-gray-200 ect-border-success":"ect-bg-white ect-border-gray-200 hover:ect-border-success"),l=be({get:()=>n.quantity,set:h=>r("update:quantity",h)}),p=be({get:()=>n.name,set:h=>r("update:name",h)}),c=h=>{r("update:quantity",h)},f=be(()=>{if(o.value===0)return n.tags;const g=Math.floor(o.value/120);return n.tags.slice(0,Math.max(1,g))}),u=be(()=>Math.max(0,n.tags.length-f.value.length)),m=()=>{if(i.value){const h=i.value,g=80,d=120,v=32,_=64;o.value=h.offsetWidth-g-d-v-_}};return xn(()=>{Ut(()=>{m()})}),St(()=>n.tags,()=>{Ut(()=>{m()})},{deep:!0}),xn(()=>{window.addEventListener("resize",m)}),(h,g)=>(X(),ne("div",{ref_key:"containerRef",ref:i,class:Ie(["ect-w-full ect-rounded-md ect-border-1 ect-transition-colors ect-relative",s.value]),"data-test-id":`configurator-item-${e.item.itemId}`,"data-publish-key":e.item.publishKey},[e.item.relationshipInfo.relationship==="Kit"?(X(),ne("div",qh," KIT ")):ye("",!0),e.size===1?(X(),ne("div",jh,[e.showImage?(X(),ne("div",Dh,[e.imageUrl?(X(),ne("img",{key:0,src:e.imageUrl,alt:p.value,class:"ect-w-full ect-h-full ect-object-cover"},null,8,Bh)):(X(),Te(Ge,{key:1,disabled:"",icon:"image",symbol:"",size:20,color:"#ACACAC"}))])):ye("",!0),b("div",$h,[b("div",Fh,[_e(ka,{modelValue:p.value,"onUpdate:modelValue":g[0]||(g[0]=d=>p.value=d),tag:"h3",class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},null,8,["modelValue"]),b("div",Vh,[b("div",{onClick:g[2]||(g[2]=Tt(()=>{},["stop"]))},[_e(zi,{value:l.value,"onUpdate:value":g[1]||(g[1]=d=>l.value=d),min:e.minQuantity,max:e.maxQuantity,"data-test-id":`configurator-item-counter-${e.item.itemId}`,onChange:c},null,8,["value","min","max","data-test-id"])]),Hh,b("div",Uh,[_e(ka,{modelValue:a.value.price,"onUpdate:modelValue":g[3]||(g[3]=d=>a.value.price=d),tag:"p",type:"currency",class:"ect-text-base ect-font-bold"},null,8,["modelValue"])]),b("div",zh,[Ze(h.$slots,"selection-control")])])]),b("p",{class:"ect-mt-2 ect-text-sm ect-text-gray-700 ect-leading-tight",innerHTML:e.description},null,8,Kh),e.isAttributes&&e.showAttributes&&e.selected?(X(),ne("div",Zh,[a.value.getTags().length>0?(X(),ne(Oe,{key:0},[(X(!0),ne(Oe,null,ze(f.value,(d,v)=>(X(),ne("span",{key:v,class:"ect-inline-block"},[_e(Zt,{label:d.label,value:d.value},null,8,["label","value"])]))),128)),u.value>0?(X(),ne("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${e.item.itemId}`,onClick:g[4]||(g[4]=Tt(()=>{},["stop"]))}," +"+ve(u.value)+" more ",9,Qh)):ye("",!0),e.selected?(X(),ne("button",{key:1,"data-test-id":`configurator-item-button-edit-attributes-${e.item.itemId}`,onClick:g[5]||(g[5]=d=>r("edit-attributes"))},[_e(Zt,{label:"Edit attributes","edit-button":""})],8,Xh)):ye("",!0)],64)):(X(),ne("span",Jh,[b("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:g[6]||(g[6]=d=>r("edit-attributes"))},[_e(Zt,{label:"Add attributes","add-button":""})])]))])):ye("",!0)])])):(X(),ne("div",Wh,[b("div",Gh,[b("div",Yh,[e.imageUrl?(X(),ne("img",{key:0,src:e.imageUrl,alt:e.name,class:"ect-w-full ect-h-full ect-object-cover"},null,8,e9)):ye("",!0)]),b("div",t9,[b("h3",n9,ve(e.name),1),b("p",r9,ve(e.description),1)]),b("div",i9,[Ze(h.$slots,"selection-control")])]),e.isAttributes&&e.showAttributes&&e.selected?(X(),ne("div",o9,[a.value.getTags().length>0?(X(),ne(Oe,{key:0},[(X(!0),ne(Oe,null,ze(f.value,(d,v)=>(X(),ne("span",{key:v,class:"ect-inline-block"},[_e(Zt,{label:d.label,value:d.value},null,8,["label","value"])]))),128)),u.value>0?(X(),ne("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${e.item.itemId}`,onClick:g[7]||(g[7]=Tt(()=>{},["stop"]))}," +"+ve(u.value)+" more ",9,a9)):ye("",!0),e.selected?(X(),ne("button",{key:1,class:"ect-ml-auto","data-test-id":`configurator-item-button-edit-attributes-${e.item.itemId}`,onClick:g[8]||(g[8]=d=>r("edit-attributes"))},[_e(Zt,{label:"Edit attributes","edit-button":""})],8,s9)):ye("",!0)],64)):(X(),ne("span",l9,[b("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:g[9]||(g[9]=d=>r("edit-attributes"))},[_e(Zt,{label:"Add attributes","add-button":""})])]))])):ye("",!0),b("div",c9,[b("div",{onClick:g[11]||(g[11]=Tt(()=>{},["stop"]))},[_e(zi,{value:l.value,"onUpdate:value":g[10]||(g[10]=d=>l.value=d),min:e.minQuantity,max:e.maxQuantity,"data-test-id":`configurator-item-counter-${e.item.itemId}`,onChange:c},null,8,["value","min","max","data-test-id"])]),b("div",u9,[f9,_e(ka,{modelValue:a.value.price,"onUpdate:modelValue":g[12]||(g[12]=d=>a.value.price=d),tag:"p",type:"currency",class:"ect-w-[125px] ect-text-base ect-font-bold"},null,8,["modelValue"])])])])),e.selected&&e.isAttributes?(X(),ne("div",d9,[Ze(h.$slots,"default")])):ye("",!0)],10,Mh))}},p9={"af-ZA":",","sq-AL":",","ar-DZ":",","ar-BH":"٫","ar-EG":"٫","ar-IQ":"٫","ar-JO":"٫","ar-KW":"٫","ar-LB":"٫","ar-LY":",","ar-MA":",","ar-OM":"٫","ar-QA":"٫","ar-SA":"٫","ar-SD":"٫","ar-SY":"٫","ar-TN":",","ar-AE":"٫","ar-YE":"٫","hy-AM":",","az-AZ":",","bn-BD":".","bn-IN":".","eu-ES":",","be-BY":",","bs-BA":",","bg-BG":",","my-MM":".","ca-ES":",","ca-ES-EURO":",","zh-CN":".","zh-CN-PINYIN":".","zh-CN-STROKE":".","zh-HK":".","zh-HK-STROKE":".","zh-MO":".","zh-SG":".","zh-TW":".","zh-TW-STROKE":".","hr-HR":",","cs-CZ":",","da-DK":",","nl-AW":",","nl-BE":",","nl-NL":",","nl-SR":",","dz-BT":".","en-AG":".","en-AU":".","en-BS":".","en-BB":".","en-BZ":".","en-BM":".","en-BW":".","en-CM":".","en-CA":".","en-DE":",","en-KY":".","en-ER":".","en-FK":".","en-FJ":".","en-GM":".","en-GH":".","en-GI":".","en-GY":".","en-HK":".","en-IN":".","en-ID":".","en-IE":".","en-IE-EURO":".","en-JM":".","en-KE":".","en-LR":".","en-MG":".","en-MW":".","en-MY":".","en-MU":".","en-NA":".","en-NZ":".","en-NG":".","en-PK":".","en-PG":".","en-PH":".","en-RW":".","en-WS":".","en-SC":".","en-SL":".","en-SG":".","en-SX":".","en-SB":".","en-ZA":",","en-SH":".","en-SZ":".","en-TZ":".","en-TO":".","en-TT":".","en-UG":".","en-GB":".","en-US":".","en-VU":".","et-EE":",","fi-FI":",","fi-FI-EURO":",","fr-BE":",","fr-CA":",","fr-KM":",","fr-FR":",","fr-FR-EURO":",","fr-GN":",","fr-HT":",","fr-LU":",","fr-MR":",","fr-MC":",","fr-CH":",","fr-WF":",","ka-GE":",","de-AT":",","de-AT-EURO":",","de-BE":",","de-DE":",","de-DE-EURO":",","de-LU":",","de-LU-EURO":",","de-CH":".","el-GR":",","gu-IN":".","iw-IL":".","hi-IN":".","hu-HU":",","is-IS":",","in-ID":",","ga-IE":".","it-IT":",","it-CH":".","ja-JP":".","kn-IN":".","kk-KZ":",","km-KH":",","ko-KP":".","ko-KR":".","ky-KG":",","lo-LA":",","lv-LV":",","lt-LT":",","lu-CD":",","lb-LU":",","mk-MK":",","ms-BN":",","ms-MY":".","ml-IN":".","mt-MT":".","mi-NZ":".","mr-IN":".","ne-NP":".","no-NO":",","ps-AF":"٫","fa-IR":"٫","pl-PL":",","pt-AO":",","pt-BR":",","pt-CV":",","pt-MZ":",","pt-PT":",","pt-ST":",","ro-MD":",","ro-RO":",","rm-CH":".","rn-BI":",","ru-KZ":",","ru-RU":",","sr-BA":",","sr-RS":",","sh-BA":",","sh-ME":",","sh-ME-USD":",","sh-CS":",","sk-SK":",","sl-SI":",","so-DJ":".","so-SO":".","es-AR":",","es-BO":",","es-CL":",","es-CO":",","es-CR":",","es-CU":".","es-DO":".","es-EC":",","es-SV":".","es-GT":".","es-HN":".","es-MX":".","es-NI":".","es-PA":".","es-PY":",","es-PE":".","es-PR":".","es-ES":",","es-ES-EURO":",","es-US":".","es-UY":",","es-VE":",","sw-KE":".","sv-SE":",","tl-PH":".","tg-TJ":",","ta-IN":".","ta-LK":".","te-IN":".","th-TH":".","ti-ET":".","tr-TR":",","uk-UA":",","ur-PK":".","uz-LATN-UZ":",","vi-VN":",","cy-GB":".","xh-ZA":".","yo-BJ":".","zu-ZA":"."},m9={name:"CustomInput",components:{AppIcon:Ge},props:{editMode:{type:Boolean,default:!0},type:{type:String,default:"text"},max:{type:Number,default:500},label:{type:String,default:""},name:{type:String,default:""},showLabel:{type:Boolean,default:!0},modelValue:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},isReadOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},highlight:{type:Boolean,default:!1},placeholder:{type:String,default:""},error:{type:[Boolean,String],default:!1},cssClass:{type:Object,default:()=>({})},tooltip:{type:String,default:null},locale:{type:String,default:"en-US"},icon:{type:String,default:null},itooltip:{type:String,default:null},icolor:{type:String,default:"#7d7d7d"},ihover:{type:String,default:"#57c046"},icustom:{type:Boolean,default:!1},idisabled:{type:Boolean,default:!1},height:{type:Number,default:32},textAlignment:{type:String,default:"left"},decimalPrecision:{type:Number,default:0},allowNegatives:{type:Boolean,default:!1},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["update:modelValue","iclick","blur"],data(){return{initialValue:"",decimalSeprator:".",ctrl:!1}},computed:{getValue(){return this.modelValue?this.type==="currency"?String(this.modelValue).replace(".",this.decimalSeprator):String(this.modelValue):""},error_message(){return typeof this.error=="string"?this.error:this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},isHighlight(){return(this.initialValue===""||this.initialValue===null)&&(this.modelValue===""||this.modelValue===null)?!1:this.initialValue!==this.modelValue}},created(){this.initialValue=this.modelValue,this.decimalSeprator=this.type==="currency"?p9[this.locale]:"."},methods:{handlerInput(e){const t=e.target.value;this.type==="currency"?this.$emit("update:modelValue",t.replace(this.decimalSeprator,".")):this.$emit("update:modelValue",t)},preventNonNumeric(e){if(this.type==="number"){const t=this.decimalPrecision,n=e.target.value,r=e.key;if(["Backspace","ArrowLeft","ArrowRight","Delete","Tab"].includes(r)||this.allowNegatives&&r==="-")return;if(r==="."&&t===0){e.preventDefault();return}if(r==="."&&n.includes(".")){e.preventDefault();return}if(r==="."||n.includes(".")&&!n.endsWith(".")&&r!=="Backspace"){const i=n.split(".");if(i.length>1&&i[1].length>=t){e.preventDefault();return}}if(isNaN(r)&&![".","Backspace","Tab"].includes(r)){e.preventDefault();return}}if(e.key==="Backspace"||this.ctrl)return!0;if(e.key==="Control"&&(this.ctrl=!0),this.type==="currency"||this.type==="number"){if(!this.getValue.includes(this.decimalSeprator)&&e.key===this.decimalSeprator)return!0;/[\deE+\-]/.test(e.key)||e.preventDefault()}return!0},handlerKeyup(e){e.key==="Control"&&(this.ctrl=!1)}}},g9=["data-test-id"],v9=["for","data-test-id"],y9=["data-test-id"],_9=["id","type","name","disabled","placeholder","value","maxlength","readonly","data-test-id"],b9=["data-test-id"],C9=["data-test-id"];function w9(e,t,n,r,i,o){const a=Or("AppIcon");return X(),ne("div",{class:"input","data-test-id":n.dataTestId},[n.label&&n.showLabel?(X(),ne("label",{key:0,class:Ie({error_color:!!n.error}),for:n.label,"data-test-id":`${n.dataTestId}-label`},[Fe(ve(n.label)+" ",1),n.required?(X(),ne("span",{key:0,class:Ie({error_color:!!n.error})},"*",2)):ye("",!0)],10,v9)):ye("",!0),n.editMode?(X(),ne("div",{key:1,class:Ie(["input-wrapper ect-w-full",{errorBorder_color:!!n.error,highlight:o.isHighlight&&n.highlight}]),"data-test-id":`${n.dataTestId}-wrapper`},[n.icon?(X(),Te(a,{key:0,class:"input-wrapper_icon",icon:n.icon,hover:n.ihover,color:n.icolor,size:19,disabled:n.idisabled,custom:n.icustom,tooltip:n.itooltip,"data-test-id":`${n.dataTestId}-icon`,direction:"top-right",onClick:t[0]||(t[0]=s=>e.$emit("iclick"))},null,8,["icon","hover","color","disabled","custom","tooltip","data-test-id"])):ye("",!0),b("input",{id:n.label,class:Ie(`ectheme-input-box ${n.size}`),type:n.type,style:tt({width:n.icon?"calc(100% - 36px)":"100%",height:`${n.height}px`,textAlign:n.textAlignment}),name:n.name,disabled:n.disabled,placeholder:n.placeholder,value:o.getValue,maxlength:n.max,readonly:n.isReadOnly,"data-test-id":`${n.dataTestId}-input`,onInput:t[1]||(t[1]=(...s)=>o.handlerInput&&o.handlerInput(...s)),onKeydown:t[2]||(t[2]=(...s)=>o.preventNonNumeric&&o.preventNonNumeric(...s)),onKeyup:t[3]||(t[3]=(...s)=>o.handlerKeyup&&o.handlerKeyup(...s)),onBlur:t[4]||(t[4]=s=>e.$emit("blur"))},null,46,_9)],10,y9)):ye("",!0),n.editMode?ye("",!0):(X(),ne("p",{key:2,class:"value","data-test-id":`${n.dataTestId}-value`},ve(o.getValue),9,b9)),o.error_message?(X(),ne("div",{key:3,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${n.dataTestId}-error`},ve(o.error_message),9,C9)):ye("",!0)],8,g9)}const x9=Ve(m9,[["render",w9],["__scopeId","data-v-032ca141"]]),k9={name:"AtomSpinner",props:{dataTestId:{type:String,default:""}}},E9=["data-test-id"];function O9(e,t,n,r,i,o){return X(),ne("div",{class:"spinner","data-test-id":n.dataTestId},null,8,E9)}const S9={name:"CustomDropdown",components:{AppIcon:Ge,AtomSpinner:Ve(k9,[["render",O9],["__scopeId","data-v-771ed032"]])},props:{label:{type:String,default:""},placeholder:{type:String,default:""},options:{type:Array,default:()=>[]},display:{type:Array,default:()=>[]},modelValue:{type:String,default:""},error:{type:[Boolean,String],default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},select:{type:Boolean,default:!1},lookup:{type:Boolean,default:!1},search:{type:Boolean,default:!1},badge:{type:String,default:void 0},highlight:{type:Boolean,default:!1},property:{type:Object,default:()=>({key:"value",value:"label",assigned:"assigned"})},dropdownTheme:{type:String,default:"light"},icon:{type:String,default:""},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["search","focus-in","focus-out","update:modelValue"],data:()=>({inputFocused:!1,value:"",isHover:!1,highlightedIndex:-1,initialValue:"",teleportStyle:{position:"absolute",top:"0px",left:"0px",width:"0px"}}),computed:{isHighlight(){return(this.initialValue===""||this.initialValue==null)&&(this.modelValue===""||this.modelValue==null)?!1:this.initialValue!==this.modelValue},error_message(){return this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},getOptions(){if(this.select&&this.search){const e=this.value.toLowerCase();return this.options.filter(t=>JSON.stringify(t).toLowerCase().includes(e))}else return this.options},getSelected(){let e=null;if(this.modelValue)e=this.options.find(t=>t[this.property.key]===this.modelValue);else if(!this.search){const t=this.options.find(n=>n[this.property.key]==="");t?e=t:this.placeholder?e={[this.property.value]:this.placeholder,[this.property.key]:""}:e={[this.property.value]:"--Select--",[this.property.key]:""}}return e||{[this.property.value]:this.placeholder||"--Select--",[this.property.key]:""}},shouldShowAbove(){if(!this.$refs.triggerElement)return!1;const e=this.$refs.triggerElement.getBoundingClientRect(),t=250,n=window.innerHeight-e.bottom,r=e.top;return n<t&&r>t},dropdownStyle(){if(!this.$refs.triggerElement)return{};const e=this.$refs.triggerElement.getBoundingClientRect(),t=250,n=window.innerHeight-e.bottom,r=e.top,i=n<t&&r>t;return{position:"absolute",top:i?"auto":"100%",bottom:i?"100%":"auto",left:"0",width:"100%",zIndex:1e3}}},created(){this.initialValue=this.modelValue},mounted(){window.addEventListener("resize",this.updateDropdownPosition),window.addEventListener("scroll",this.updateDropdownPosition,!0)},beforeUnmount(){window.removeEventListener("resize",this.updateDropdownPosition),window.removeEventListener("scroll",this.updateDropdownPosition,!0)},methods:{updateDropdownPosition(){if(!this.$refs.triggerElement)return;const e=this.$refs.triggerElement.getBoundingClientRect(),t=200,n=window.innerHeight-e.bottom,r=e.top,i=n<t&&r>t;this.teleportStyle={position:"absolute",top:`${i?e.top-t:e.bottom}px`,left:`${e.left}px`,width:`${e.width}px`,zIndex:9999}},subFieldsText(e){if(!this.display||this.display.length<1)return"";const t=[];return this.display.forEach(n=>{const r=this.subField(e,n);r&&t.push(r)}),t.join(" | ")},subField(e,t){return t?t.split(".").reduce((i,o)=>i[o]||"",e):e},lookupSearchHandler:wc(function(e){this.value=e,this.search&&!this.select&&this.$emit("search",e)}),handlerFocusIn(){!(this.modelValue&&this.search)&&!this.disabled&&(this.inputFocused=!0,this.updateDropdownPosition(),this.$emit("focus-in"))},updateSelected(e){e&&(this.value="",this.$emit("update:modelValue",e[this.property.key]),this.search&&!this.select&&!this.lookup&&this.$emit("search",""),this.onInputFocusedOut(!0))},clear(){this.disabled||(this.value="",this.$emit("update:modelValue",null),this.search&&!this.select&&!this.lookup&&this.$emit("search",""))},onInputFocusedOut(e=!1){(!this.isHover||e)&&!this.disabled&&(e?(this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")):setTimeout(()=>{this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")},100))},highlightNextOption(){this.highlightedIndex<this.options.length-1&&this.highlightedIndex++},highlightPreviousOption(){this.highlightedIndex>0&&this.highlightedIndex--}}},I9=["data-test-id"],A9=["for","data-test-id"],T9={class:"input-container-box ect-grow ect-w-full"},N9=["data-test-id"],P9=["placeholder","disabled","data-test-id"],L9=["data-test-id"],R9=["title","data-test-id"],M9=["data-test-id"],q9=["data-test-id"],j9=["data-test-id"],D9=["data-test-id"],B9=["data-test-id","onClick"],$9=["data-test-id"],F9={class:"ect-text-font-clr-light ect-flex ect-gap-2 ect-items-center ect-justify-between ect-w-full"},V9=["data-test-id"],H9=["data-test-id"],U9=["data-test-id"],z9=["title","data-test-id"],K9=["data-test-id"];function Z9(e,t,n,r,i,o){const a=Or("AppIcon"),s=Or("AtomSpinner");return X(),ne("div",{ref:"dropdownWrapper",class:Ie(["customdropdown input-container",{dark:n.dropdownTheme==="dark"}]),"data-test-id":n.dataTestId,onMouseenter:t[7]||(t[7]=l=>e.isHover=!0),onMouseleave:t[8]||(t[8]=l=>e.isHover=!1)},[n.label?(X(),ne("label",{key:0,class:Ie(["title_label",{error_color:!!n.error}]),for:n.label,"data-test-id":`${n.dataTestId}-label`},[Fe(ve(n.label)+" ",1),n.required?(X(),ne("span",{key:0,class:Ie({error_color:!!n.error})},"*",2)):ye("",!0)],10,A9)):ye("",!0),b("div",T9,[b("div",{ref:"triggerElement",class:Ie(["input-wrapper ectheme-input-box ect-w-full",{disabled:n.disabled,"input-error":n.error,highlight:o.isHighlight&&n.highlight,"size-large":n.size==="large","size-medium":n.size==="medium"||n.size==="small"}]),"data-test-id":`${n.dataTestId}-trigger`,tabindex:"0",onFocusin:t[2]||(t[2]=(...l)=>o.handlerFocusIn&&o.handlerFocusIn(...l)),onFocusout:t[3]||(t[3]=l=>o.onInputFocusedOut(!1)),onKeydown:[t[4]||(t[4]=qr(l=>o.updateSelected(n.options[e.highlightedIndex]),["enter"])),t[5]||(t[5]=qr(Tt((...l)=>o.highlightPreviousOption&&o.highlightPreviousOption(...l),["prevent"]),["up"])),t[6]||(t[6]=qr(Tt((...l)=>o.highlightNextOption&&o.highlightNextOption(...l),["prevent"]),["down"]))]},[!n.modelValue&&n.search?Cn((X(),ne("input",{key:0,ref:"searchInput","onUpdate:modelValue":t[0]||(t[0]=l=>e.value=l),type:"text",name:"search",placeholder:n.placeholder,autocomplete:"off",disabled:n.disabled,"data-test-id":`${n.dataTestId}-search-input`,onInput:t[1]||(t[1]=Tt(l=>o.lookupSearchHandler(l.target.value),["prevent"]))},null,40,P9)),[[Di,e.value]]):(X(),ne("div",{key:1,class:Ie(["selection-name ect-text-text-primary-dark ect-flex ect-justify-between ect-items-center",{"size-large":n.size==="large","size-medium":n.size==="medium"||n.size==="small"}]),"data-test-id":`${n.dataTestId}-selection`},[o.getSelected?(X(),ne(Oe,{key:0},[b("span",{title:o.getSelected[n.property.value],class:Ie(["ect-flex ect-items-center ect-gap-2 ect-font-medium",{"ect-text-font-clr-light":!n.modelValue}]),"data-test-id":`${n.dataTestId}-selection-value`},[n.icon?(X(),Te(a,{key:0,class:"ect-mr-0",icon:n.icon,size:14,color:"#5F5F5F","data-test-id":`${n.dataTestId}-selection-icon`},null,8,["icon","data-test-id"])):ye("",!0),Fe(" "+ve(o.getSelected[n.property.value]),1)],10,R9),n.badge&&o.getSelected[n.badge]?(X(),ne("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${n.dataTestId}-selection-badge`},ve(o.getSelected[n.badge]),9,M9)):ye("",!0)],64)):ye("",!0)],10,L9)),n.search?(X(),ne(Oe,{key:2},[n.loading?(X(),Te(s,{key:0,class:"spinner","data-test-id":`${n.dataTestId}-loading-spinner`},null,8,["data-test-id"])):(X(),ne("div",{key:1,class:"clear-button","data-test-id":`${n.dataTestId}-action-button`},[e.value||n.modelValue?(X(),Te(a,{key:0,disabled:n.disabled,icon:"close",color:"#acacac",size:10,"data-test-id":`${n.dataTestId}-clear-button`,onClick:o.clear},null,8,["disabled","data-test-id","onClick"])):(X(),Te(a,{key:1,icon:"search",size:14,color:"#acacac",disabled:n.disabled,"data-test-id":`${n.dataTestId}-search-button`},null,8,["disabled","data-test-id"]))],8,q9))],64)):(X(),Te(a,{key:3,class:"clear-button",color:o.error_message?"#ff6a6a":"#acacac",icon:"arrow_drop_up",size:12,disabled:n.disabled,"data-test-id":`${n.dataTestId}-dropdown-arrow`},null,8,["color","disabled","data-test-id"]))],42,N9),o.error_message?(X(),ne("div",{key:0,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${n.dataTestId}-error`},ve(o.error_message),9,j9)):ye("",!0),o.getOptions&&e.inputFocused&&!n.disabled&&(n.select||n.lookup)?(X(),ne("div",{key:1,ref:"dropdown",class:Ie(["dropdown",{"dropdown-above":o.shouldShowAbove}]),style:tt(o.dropdownStyle),"data-test-id":`${n.dataTestId}-dropdown`},[(X(!0),ne(Oe,null,ze(o.getOptions,(l,p)=>(X(),ne("div",{key:l[n.property.key],class:Ie(["dropdown-item",{highlighted:p===e.highlightedIndex,"ect-pointer-events-none":l[n.property.assigned]}]),"data-test-id":`${n.dataTestId}-option-${p}`,onClick:c=>o.updateSelected(l)},[b("div",{class:"name ect-items-center","data-test-id":`${n.dataTestId}-option-${p}-name`},[b("span",F9,[b("span",{class:Ie({"ect-text-zinc-400":l[n.property.assigned]}),"data-test-id":`${n.dataTestId}-option-${p}-value`},ve(l[n.property.value]==null?"Key and Value is Wrong":l[n.property.value]),11,V9),l[n.property.assigned]?(X(),ne("span",{key:0,class:"ect-text-xs ect-leading-4 ect-text-zinc-600","data-test-id":`${n.dataTestId}-option-${p}-assigned`},"Assigned",8,H9)):ye("",!0)]),n.badge?(X(),ne("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${n.dataTestId}-option-${p}-badge`},ve(l[n.badge]),9,U9)):ye("",!0)],8,$9),b("div",{class:"info",title:o.subFieldsText(l),"data-test-id":`${n.dataTestId}-option-${p}-info`},[b("span",null,ve(o.subFieldsText(l)),1)],8,z9)],10,B9))),128)),!o.getOptions.length&&!n.loading&&(e.value||n.select)?(X(),ne("div",{key:0,class:"no-items-found","data-test-id":`${n.dataTestId}-no-options`}," no options found ",8,K9)):ye("",!0)],14,D9)):ye("",!0)])],42,I9)}const Pc=Ve(S9,[["render",Z9],["__scopeId","data-v-5ae4f6dc"]]);var ot=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rc={exports:{}};/*!
|
|
29
29
|
* Quill Editor v1.3.7
|
|
30
30
|
* https://quilljs.com/
|
|
31
31
|
* Copyright (c) 2014, Jason Chen
|
|
@@ -83,4 +83,4 @@
|
|
|
83
83
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[pu]=this[pu]={accessors:{}}).accessors,i=this.prototype;function o(a){const s=zr(a);r[s]||(C3(i,a),r[s]=!0)}return de.isArray(t)?t.forEach(o):o(t),this}}io.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),de.reduceDescriptors(io.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),de.freezeMethods(io);const jt=io;function Va(e,t){const n=this||$a,r=t||n,i=jt.from(r.headers);let o=r.data;return de.forEach(e,function(s){o=s.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function mu(e){return!!(e&&e.__CANCEL__)}function cr(e,t,n){Pe.call(this,e??"canceled",Pe.ERR_CANCELED,t,n),this.name="CanceledError"}de.inherits(cr,Pe,{__CANCEL__:!0});function gu(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Pe("Request failed with status code "+n.status,[Pe.ERR_BAD_REQUEST,Pe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function w3(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function x3(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(l){const p=Date.now(),c=r[o];a||(a=p),n[i]=l,r[i]=p;let f=o,u=0;for(;f!==i;)u+=n[f++],f=f%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),p-a<t)return;const m=c&&p-c;return m?Math.round(u*1e3/m):void 0}}function k3(e,t){let n=0,r=1e3/t,i,o;const a=(p,c=Date.now())=>{n=c,i=null,o&&(clearTimeout(o),o=null),e(...p)};return[(...p)=>{const c=Date.now(),f=c-n;f>=r?a(p,c):(i=p,o||(o=setTimeout(()=>{o=null,a(i)},r-f)))},()=>i&&a(i)]}const oo=(e,t,n=3)=>{let r=0;const i=x3(50,250);return k3(o=>{const a=o.loaded,s=o.lengthComputable?o.total:void 0,l=a-r,p=i(l),c=a<=s;r=a;const f={loaded:a,total:s,progress:s?a/s:void 0,bytes:l,rate:p||void 0,estimated:p&&s&&c?(s-a)/p:void 0,event:o,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(f)},n)},vu=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},yu=e=>(...t)=>de.asap(()=>e(...t)),E3=ft.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ft.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ft.origin),ft.navigator&&/(msie|trident)/i.test(ft.navigator.userAgent)):()=>!0,O3=ft.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(t)}`];de.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),de.isString(r)&&s.push(`path=${r}`),de.isString(i)&&s.push(`domain=${i}`),o===!0&&s.push("secure"),de.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function S3(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function I3(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function _u(e,t,n){let r=!S3(t);return e&&(r||n==!1)?I3(e,t):t}const bu=e=>e instanceof jt?{...e}:e;function Vn(e,t){t=t||{};const n={};function r(p,c,f,u){return de.isPlainObject(p)&&de.isPlainObject(c)?de.merge.call({caseless:u},p,c):de.isPlainObject(c)?de.merge({},c):de.isArray(c)?c.slice():c}function i(p,c,f,u){if(de.isUndefined(c)){if(!de.isUndefined(p))return r(void 0,p,f,u)}else return r(p,c,f,u)}function o(p,c){if(!de.isUndefined(c))return r(void 0,c)}function a(p,c){if(de.isUndefined(c)){if(!de.isUndefined(p))return r(void 0,p)}else return r(void 0,c)}function s(p,c,f){if(f in t)return r(p,c);if(f in e)return r(void 0,p)}const l={url:o,method:o,data:o,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:s,headers:(p,c,f)=>i(bu(p),bu(c),f,!0)};return de.forEach(Object.keys({...e,...t}),function(c){const f=l[c]||i,u=f(e[c],t[c],c);de.isUndefined(u)&&f!==s||(n[c]=u)}),n}const Cu=e=>{const t=Vn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:s}=t;if(t.headers=a=jt.from(a),t.url=uu(_u(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),de.isFormData(n)){if(ft.hasStandardBrowserEnv||ft.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(de.isFunction(n.getHeaders)){const l=n.getHeaders(),p=["content-type","content-length"];Object.entries(l).forEach(([c,f])=>{p.includes(c.toLowerCase())&&a.set(c,f)})}}if(ft.hasStandardBrowserEnv&&(r&&de.isFunction(r)&&(r=r(t)),r||r!==!1&&E3(t.url))){const l=i&&o&&O3.read(o);l&&a.set(i,l)}return t},A3=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=Cu(e);let o=i.data;const a=jt.from(i.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:p}=i,c,f,u,m,h;function g(){m&&m(),h&&h(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let d=new XMLHttpRequest;d.open(i.method.toUpperCase(),i.url,!0),d.timeout=i.timeout;function v(){if(!d)return;const C=jt.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),w={data:!s||s==="text"||s==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:C,config:e,request:d};gu(function(I){n(I),g()},function(I){r(I),g()},w),d=null}"onloadend"in d?d.onloadend=v:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(v)},d.onabort=function(){d&&(r(new Pe("Request aborted",Pe.ECONNABORTED,e,d)),d=null)},d.onerror=function(y){const w=y&&y.message?y.message:"Network Error",A=new Pe(w,Pe.ERR_NETWORK,e,d);A.event=y||null,r(A),d=null},d.ontimeout=function(){let y=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||du;i.timeoutErrorMessage&&(y=i.timeoutErrorMessage),r(new Pe(y,w.clarifyTimeoutError?Pe.ETIMEDOUT:Pe.ECONNABORTED,e,d)),d=null},o===void 0&&a.setContentType(null),"setRequestHeader"in d&&de.forEach(a.toJSON(),function(y,w){d.setRequestHeader(w,y)}),de.isUndefined(i.withCredentials)||(d.withCredentials=!!i.withCredentials),s&&s!=="json"&&(d.responseType=i.responseType),p&&([u,h]=oo(p,!0),d.addEventListener("progress",u)),l&&d.upload&&([f,m]=oo(l),d.upload.addEventListener("progress",f),d.upload.addEventListener("loadend",m)),(i.cancelToken||i.signal)&&(c=C=>{d&&(r(!C||C.type?new cr(null,e,d):C),d.abort(),d=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const _=w3(i.url);if(_&&ft.protocols.indexOf(_)===-1){r(new Pe("Unsupported protocol "+_+":",Pe.ERR_BAD_REQUEST,e));return}d.send(o||null)})},T3=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(p){if(!i){i=!0,s();const c=p instanceof Error?p:this.reason;r.abort(c instanceof Pe?c:new cr(c instanceof Error?c.message:c))}};let a=t&&setTimeout(()=>{a=null,o(new Pe(`timeout ${t} of ms exceeded`,Pe.ETIMEDOUT))},t);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(p=>{p.unsubscribe?p.unsubscribe(o):p.removeEventListener("abort",o)}),e=null)};e.forEach(p=>p.addEventListener("abort",o));const{signal:l}=r;return l.unsubscribe=()=>de.asap(s),l}},N3=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},P3=async function*(e,t){for await(const n of L3(e))yield*N3(n,t)},L3=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},wu=(e,t,n,r)=>{const i=P3(e,t);let o=0,a,s=l=>{a||(a=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:p,value:c}=await i.next();if(p){s(),l.close();return}let f=c.byteLength;if(n){let u=o+=f;n(u)}l.enqueue(new Uint8Array(c))}catch(p){throw s(p),p}},cancel(l){return s(l),i.return()}},{highWaterMark:2})},xu=64*1024,{isFunction:ao}=de,R3=(({Request:e,Response:t})=>({Request:e,Response:t}))(de.global),{ReadableStream:ku,TextEncoder:Eu}=de.global,Ou=(e,...t)=>{try{return!!e(...t)}catch{return!1}},M3=e=>{e=de.merge.call({skipUndefined:!0},R3,e);const{fetch:t,Request:n,Response:r}=e,i=t?ao(t):typeof fetch=="function",o=ao(n),a=ao(r);if(!i)return!1;const s=i&&ao(ku),l=i&&(typeof Eu=="function"?(h=>g=>h.encode(g))(new Eu):async h=>new Uint8Array(await new n(h).arrayBuffer())),p=o&&s&&Ou(()=>{let h=!1;const g=new n(ft.origin,{body:new ku,method:"POST",get duplex(){return h=!0,"half"}}).headers.has("Content-Type");return h&&!g}),c=a&&s&&Ou(()=>de.isReadableStream(new r("").body)),f={stream:c&&(h=>h.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(h=>{!f[h]&&(f[h]=(g,d)=>{let v=g&&g[h];if(v)return v.call(g);throw new Pe(`Response type '${h}' is not supported`,Pe.ERR_NOT_SUPPORT,d)})});const u=async h=>{if(h==null)return 0;if(de.isBlob(h))return h.size;if(de.isSpecCompliantForm(h))return(await new n(ft.origin,{method:"POST",body:h}).arrayBuffer()).byteLength;if(de.isArrayBufferView(h)||de.isArrayBuffer(h))return h.byteLength;if(de.isURLSearchParams(h)&&(h=h+""),de.isString(h))return(await l(h)).byteLength},m=async(h,g)=>{const d=de.toFiniteNumber(h.getContentLength());return d??u(g)};return async h=>{let{url:g,method:d,data:v,signal:_,cancelToken:C,timeout:y,onDownloadProgress:w,onUploadProgress:A,responseType:I,headers:S,withCredentials:N="same-origin",fetchOptions:T}=Cu(h),k=t||fetch;I=I?(I+"").toLowerCase():"text";let E=T3([_,C&&C.toAbortSignal()],y),L=null;const V=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let K;try{if(A&&p&&d!=="get"&&d!=="head"&&(K=await m(S,v))!==0){let O=new n(g,{method:"POST",body:v,duplex:"half"}),P;if(de.isFormData(v)&&(P=O.headers.get("content-type"))&&S.setContentType(P),O.body){const[M,Z]=vu(K,oo(yu(A)));v=wu(O.body,xu,M,Z)}}de.isString(N)||(N=N?"include":"omit");const W=o&&"credentials"in n.prototype,te={...T,signal:E,method:d.toUpperCase(),headers:S.normalize().toJSON(),body:v,duplex:"half",credentials:W?N:void 0};L=o&&new n(g,te);let fe=await(o?k(L,T):k(g,te));const ee=c&&(I==="stream"||I==="response");if(c&&(w||ee&&V)){const O={};["status","statusText","headers"].forEach(Q=>{O[Q]=fe[Q]});const P=de.toFiniteNumber(fe.headers.get("content-length")),[M,Z]=w&&vu(P,oo(yu(w),!0))||[];fe=new r(wu(fe.body,xu,M,()=>{Z&&Z(),V&&V()}),O)}I=I||"text";let j=await f[de.findKey(f,I)||"text"](fe,h);return!ee&&V&&V(),await new Promise((O,P)=>{gu(O,P,{data:j,headers:jt.from(fe.headers),status:fe.status,statusText:fe.statusText,config:h,request:L})})}catch(W){throw V&&V(),W&&W.name==="TypeError"&&/Load failed|fetch/i.test(W.message)?Object.assign(new Pe("Network Error",Pe.ERR_NETWORK,h,L),{cause:W.cause||W}):Pe.from(W,W&&W.code,h,L)}}},q3=new Map,Su=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let a=o.length,s=a,l,p,c=q3;for(;s--;)l=o[s],p=c.get(l),p===void 0&&c.set(l,p=s?new Map:M3(t)),c=p;return p};Su();const Ha={http:i3,xhr:A3,fetch:{get:Su}};de.forEach(Ha,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Iu=e=>`- ${e}`,j3=e=>de.isFunction(e)||e===null||e===!1;function D3(e,t){e=de.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){r=e[a];let s;if(i=r,!j3(r)&&(i=Ha[(s=String(r)).toLowerCase()],i===void 0))throw new Pe(`Unknown adapter '${s}'`);if(i&&(de.isFunction(i)||(i=i.get(t))))break;o[s||"#"+a]=i}if(!i){const a=Object.entries(o).map(([l,p])=>`adapter ${l} `+(p===!1?"is not supported by the environment":"is not available in the build"));let s=n?a.length>1?`since :
|
|
84
84
|
`+a.map(Iu).join(`
|
|
85
85
|
`):" "+Iu(a[0]):"as no adapter specified";throw new Pe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return i}const Au={getAdapter:D3,adapters:Ha};function Ua(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new cr(null,e)}function Tu(e){return Ua(e),e.headers=jt.from(e.headers),e.data=Va.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Au.getAdapter(e.adapter||$a.adapter,e)(e).then(function(r){return Ua(e),r.data=Va.call(e,e.transformResponse,r),r.headers=jt.from(r.headers),r},function(r){return mu(r)||(Ua(e),r&&r.response&&(r.response.data=Va.call(e,e.transformResponse,r.response),r.response.headers=jt.from(r.response.headers))),Promise.reject(r)})}const Nu="1.13.2",so={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{so[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Pu={};so.transitional=function(t,n,r){function i(o,a){return"[Axios v"+Nu+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,s)=>{if(t===!1)throw new Pe(i(a," has been removed"+(n?" in "+n:"")),Pe.ERR_DEPRECATED);return n&&!Pu[a]&&(Pu[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,s):!0}},so.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function B3(e,t,n){if(typeof e!="object")throw new Pe("options must be an object",Pe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=t[o];if(a){const s=e[o],l=s===void 0||a(s,o,e);if(l!==!0)throw new Pe("option "+o+" must be "+l,Pe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Pe("Unknown option "+o,Pe.ERR_BAD_OPTION)}}const lo={assertOptions:B3,validators:so},Xt=lo.validators;class co{constructor(t){this.defaults=t||{},this.interceptors={request:new fu,response:new fu}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
86
|
-
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Vn(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&lo.assertOptions(r,{silentJSONParsing:Xt.transitional(Xt.boolean),forcedJSONParsing:Xt.transitional(Xt.boolean),clarifyTimeoutError:Xt.transitional(Xt.boolean)},!1),i!=null&&(de.isFunction(i)?n.paramsSerializer={serialize:i}:lo.assertOptions(i,{encode:Xt.function,serialize:Xt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),lo.assertOptions(n,{baseUrl:Xt.spelling("baseURL"),withXsrfToken:Xt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&de.merge(o.common,o[n.method]);o&&de.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=jt.concat(a,o);const s=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,s.unshift(g.fulfilled,g.rejected))});const p=[];this.interceptors.response.forEach(function(g){p.push(g.fulfilled,g.rejected)});let c,f=0,u;if(!l){const h=[Tu.bind(this),void 0];for(h.unshift(...s),h.push(...p),u=h.length,c=Promise.resolve(n);f<u;)c=c.then(h[f++],h[f++]);return c}u=s.length;let m=n;for(;f<u;){const h=s[f++],g=s[f++];try{m=h(m)}catch(d){g.call(this,d);break}}try{c=Tu.call(this,m)}catch(h){return Promise.reject(h)}for(f=0,u=p.length;f<u;)c=c.then(p[f++],p[f++]);return c}getUri(t){t=Vn(this.defaults,t);const n=_u(t.baseURL,t.url,t.allowAbsoluteUrls);return uu(n,t.params,t.paramsSerializer)}}de.forEach(["delete","get","head","options"],function(t){co.prototype[t]=function(n,r){return this.request(Vn(r||{},{method:t,url:n,data:(r||{}).data}))}}),de.forEach(["post","put","patch"],function(t){function n(r){return function(o,a,s){return this.request(Vn(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}co.prototype[t]=n(),co.prototype[t+"Form"]=n(!0)});const uo=co;class za{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(s=>{r.subscribe(s),o=s}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,s){r.reason||(r.reason=new cr(o,a,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new za(function(i){t=i}),cancel:t}}}const $3=za;function F3(e){return function(n){return e.apply(null,n)}}function V3(e){return de.isObject(e)&&e.isAxiosError===!0}const Ka={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ka).forEach(([e,t])=>{Ka[t]=e});const H3=Ka;function Lu(e){const t=new uo(e),n=Xc(uo.prototype.request,t);return de.extend(n,uo.prototype,t,{allOwnKeys:!0}),de.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Lu(Vn(e,i))},n}const Be=Lu($a);Be.Axios=uo,Be.CanceledError=cr,Be.CancelToken=$3,Be.isCancel=mu,Be.VERSION=Nu,Be.toFormData=no,Be.AxiosError=Pe,Be.Cancel=Be.CanceledError,Be.all=function(t){return Promise.all(t)},Be.spread=F3,Be.isAxiosError=V3,Be.mergeConfig=Vn,Be.AxiosHeaders=jt,Be.formToJSON=e=>hu(de.isHTMLForm(e)?new FormData(e):e),Be.getAdapter=Au.getAdapter,Be.HttpStatusCode=H3,Be.default=Be;class U3{constructor(t){this.restURL=t+"/services/apexrest/XX_ORD1/router"}async getProductConfiguration(t){return(await Be.post(`${this.restURL}?methodName=getProductConfiguration`,t,{headers:{"Content-Type":"application/json"}})).data}async getLineItems({request:t}){return(await Be.post(`${this.restURL}?methodName=getLineItems`,t,{headers:{"Content-Type":"application/json"}})).data}async getLineItemAttributes({request:t}){return(await Be.post(`${this.restURL}?methodName=getLineItemAttributes`,t,{headers:{"Content-Type":"application/json"}})).data}async getProductOptionsPricing({request:t}){return(await Be.post(`${this.restURL}?methodName=getProductOptionsPricing`,t,{headers:{"Content-Type":"application/json"}})).data}async calculateBestOfferPrice({request:t}){return(await Be.post(`${this.restURL}?methodName=calculateBestOfferPrice`,t,{headers:{"Content-Type":"application/json"}})).data}async getRecords({request:t}){return(await Be.post(`${this.restURL}?methodName=getRecords`,t,{headers:{"Content-Type":"application/json"}})).data}async maintainQuoteConfiguration({request:t}){return(await Be.post(`${this.restURL}?methodName=maintainQuoteConfiguration`,t,{headers:{"Content-Type":"application/json"}})).data}async getProductCrossSells({request:t}){return(await Be.post(`${this.restURL}?methodName=getProductCrossSells`,t,{headers:{"Content-Type":"application/json"}})).data}async createQuoteProducts({request:t}){return(await Be.post(`${this.restURL}?methodName=createQuoteProducts`,t,{headers:{"Content-Type":"application/json"}})).data}}class z3{constructor(t){this.restURL=t+"/services/apexrest/XX_ORD1/router"}getReturn(t){return{error:null,data:JSON.stringify(t.data),isSuccess:!0}}async getOrgInformation(){return(await Be.post(`${this.restURL}?methodName=getOrgInformation`,{},{headers:{"Content-Type":"application/json"}})).data}async getRecordInfo(t){return(await Be.post(`${this.restURL}?methodName=getRecordInfo`,t,{headers:{"Content-Type":"application/json"}})).data}getPrimaryQuote(){return new Promise((t,n)=>{setTimeout(()=>{t({userLocale:null,templateId:"a1RA000000XMtU7MAL",recordId:"a0jKb000004V2dsIACC",orgType:null,orgId:null,opportunityId:null,objectType:"XX_ORD1__Quote__c",name:"QUOTE-1379639",maxSequenceNumber:null,lineItemsCount:1,eCatalogId:"a1BKb000004oKC9MAM",currencycode:null,accountId:"0012G0000277jkgQAA"})},500)})}}const K3=(e=>(Yn("data-v-adfc84e9"),e=e(),er(),e))(()=>b("div",{class:"dropdowntp"},null,-1)),Z3={class:"app-wrapper"},Q3=Ve({__name:"ExpediteConfigurator",props:{itemId:{type:String,required:!0},qliId:{type:String,required:!1},quoteId:{type:String,required:!1},restUrl:{type:String,required:"https://ec-ord1-dev-ed.my.salesforce-sites.com/Order"}},setup(e){const t=ar(),n=Ui(),r=an(),i=ae(!1),o=e;return wn(async()=>{window.productManagerController=new U3(o.restUrl),window.salesforceConnector=new z3(o.restUrl),i.value=!0,await t.start(o.quoteId),i.value=!1}),(a,s)=>(X(),ne(Oe,null,[_e(h0),_e(y0),Xe(r).errorPopup?(X(),Te(e0,{key:0,data:Xe(r).errorPopup,onClose:s[0]||(s[0]=l=>Xe(r).errorPopup=null)},null,8,["data"])):ye("",!0),Xe(n).unsavedChanges?(X(),Te(r0,{key:1,data:Xe(n).unsavedChanges,onClose:s[1]||(s[1]=l=>Xe(n).unsavedChanges=null)},null,8,["data"])):ye("",!0),K3,b("div",Z3,[i.value?(X(),Te(Ca,{key:1})):(X(),Te(_p,{key:0,"item-id":o.itemId,"qli-id":o.qliId},null,8,["item-id","qli-id"]))])],64))}},[["__scopeId","data-v-adfc84e9"]]),X3=Rt("mygpt",()=>{const e=ae("");async function t(r,i="gpt-3.5-turbo",o=300){var a,s,l;if(!e.value)throw new Error("Secret key is required. Please set it in the store.");try{const p=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.value}`},body:JSON.stringify({model:i,messages:r,max_tokens:Math.min(o,300),temperature:.7})});if(!p.ok){const f=await p.json().catch(()=>({}));throw new Error(((a=f.error)==null?void 0:a.message)||`API Error: ${p.status} ${p.statusText}`)}return((l=(s=(await p.json()).choices[0])==null?void 0:s.message)==null?void 0:l.content)||"No response generated"}catch(p){throw new Error(p.message||"Failed to get response from GPT")}}function n(r){e.value=r}return{secretKey:e,getGptResponse:t,setSecretKey:n}}),Kr=e=>(Yn("data-v-46273585"),e=e(),er(),e),J3={class:"custom-gpt-container"},W3={class:"gpt-header"},G3=Kr(()=>b("h3",{class:"gpt-title"},"GPT Chat",-1)),Y3={class:"gpt-response-area"},e8={key:0,class:"loading-indicator"},t8=[Kr(()=>b("div",{class:"spinner"},null,-1)),Kr(()=>b("span",null,"Thinking...",-1))],n8={key:1,class:"error-message"},r8=Kr(()=>b("strong",null,"Error:",-1)),i8={key:2,class:"response-content"},o8={key:3,class:"empty-state"},a8=[Kr(()=>b("p",null,"Enter a message below to start a conversation with GPT 5.0",-1))],s8={class:"gpt-input-area"},l8={class:"input-wrapper"},c8=["placeholder","disabled"],u8=["disabled"],f8={key:0},d8={key:1},h8={key:0,class:"warning-message"},p8=Ve({__name:"ExpediteGPT",props:{secretKey:{type:String,required:!1,default:""},model:{type:String,required:!1,default:"gpt-3.5-turbo"},maxTokens:{type:Number,required:!1,default:300},placeholder:{type:String,required:!1,default:"Enter your message..."}},setup(e){const t=e,n=X3(),r=be(()=>t.secretKey||n.secretKey),i=ae(""),o=ae(""),a=ae(!1),s=ae(null),l=ae([]),p=be(()=>o.value.trim().length>0),c=be(()=>i.value.trim().length>0&&!a.value&&r.value),f=async()=>{if(!c.value)return;const h=i.value.trim();if(h){a.value=!0,s.value=null,i.value="";try{l.value.push({role:"user",content:h});const g=l.value.reduce((_,C)=>_+Math.ceil(C.content.length/4),0);let d=[...l.value];g>t.maxTokens&&(d=l.value.slice(-3));const v=await n.getGptResponse(d,t.model,t.maxTokens);o.value=v,l.value.push({role:"assistant",content:v})}catch(g){s.value=g.message||"Failed to get response from GPT",console.error("GPT API Error:",g)}finally{a.value=!1}}},u=h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),f())},m=()=>{l.value=[],o.value="",s.value=null};return wn(()=>{n.setSecretKey(t.secretKey)}),(h,g)=>(X(),ne("div",J3,[b("div",W3,[G3,p.value||l.value.length>0?(X(),ne("button",{key:0,onClick:m,class:"clear-button",type:"button"}," Clear ")):ye("",!0)]),b("div",Y3,[a.value?(X(),ne("div",e8,t8)):s.value?(X(),ne("div",n8,[r8,Fe(" "+ve(s.value),1)])):p.value?(X(),ne("div",i8,ve(o.value),1)):(X(),ne("div",o8,a8))]),b("div",s8,[b("div",l8,[Cn(b("textarea",{"onUpdate:modelValue":g[0]||(g[0]=d=>i.value=d),placeholder:e.placeholder,disabled:a.value||!r.value,onKeypress:u,class:"gpt-input",rows:"3"},null,40,c8),[[Di,i.value]]),b("button",{onClick:f,disabled:!c.value,class:"send-button",type:"button"},[a.value?(X(),ne("span",f8,"...")):(X(),ne("span",d8,"Send"))],8,u8)]),r.value?ye("",!0):(X(),ne("div",h8," ⚠️ Secret key is required to use this component. Set it via prop or in the store. "))])]))}},[["__scopeId","data-v-46273585"]]);let fo=null;if(typeof window<"u"){try{fo=y1()}catch{}fo||(fo=_1(),jr(fo))}let ho=null,po=null;async function m8(){return ho||po||(po=(async()=>{try{const e=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:hn&&hn.src||new URL("vue-expedite-components.umd.cjs",document.baseURI).href).href,t=await fetch(e);if(t.ok)return ho=await t.text(),ho}catch(e){console.warn("[ExpediteComponents] Failed to load CSS:",e)}return null})(),po)}const Ru=e=>class extends e{async connectedCallback(){if(super.connectedCallback&&super.connectedCallback(),!!this.shadowRoot&&!this.shadowRoot.querySelector("style[data-vue-expedite-style]"))try{const t=await m8();if(t){const n=document.createElement("style");n.setAttribute("data-vue-expedite-style","true"),n.textContent=t,this.shadowRoot.prepend(n)}else{const n=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:hn&&hn.src||new URL("vue-expedite-components.umd.cjs",document.baseURI).href).href,r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("data-vue-expedite-style","true"),r.href=n,this.shadowRoot.prepend(r)}}catch(t){console.warn("[ExpediteComponents] Failed to inject CSS:",t)}}},Mu=Ru(uc(Q3)),qu=Ru(uc(p8));function Za(){typeof window<"u"&&(customElements.get("vue-expedite-configurator")||customElements.define("vue-expedite-configurator",Mu),customElements.get("vue-expedite-gpt")||customElements.define("vue-expedite-gpt",qu))}typeof window<"u"&&Za();const g8={register:Za};en.ExpediteConfiguratorElement=Mu,en.ExpediteGPTElement=qu,en.default=g8,en.registerWebComponents=Za,Object.defineProperties(en,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
86
|
+
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Vn(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&lo.assertOptions(r,{silentJSONParsing:Xt.transitional(Xt.boolean),forcedJSONParsing:Xt.transitional(Xt.boolean),clarifyTimeoutError:Xt.transitional(Xt.boolean)},!1),i!=null&&(de.isFunction(i)?n.paramsSerializer={serialize:i}:lo.assertOptions(i,{encode:Xt.function,serialize:Xt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),lo.assertOptions(n,{baseUrl:Xt.spelling("baseURL"),withXsrfToken:Xt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&de.merge(o.common,o[n.method]);o&&de.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=jt.concat(a,o);const s=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,s.unshift(g.fulfilled,g.rejected))});const p=[];this.interceptors.response.forEach(function(g){p.push(g.fulfilled,g.rejected)});let c,f=0,u;if(!l){const h=[Tu.bind(this),void 0];for(h.unshift(...s),h.push(...p),u=h.length,c=Promise.resolve(n);f<u;)c=c.then(h[f++],h[f++]);return c}u=s.length;let m=n;for(;f<u;){const h=s[f++],g=s[f++];try{m=h(m)}catch(d){g.call(this,d);break}}try{c=Tu.call(this,m)}catch(h){return Promise.reject(h)}for(f=0,u=p.length;f<u;)c=c.then(p[f++],p[f++]);return c}getUri(t){t=Vn(this.defaults,t);const n=_u(t.baseURL,t.url,t.allowAbsoluteUrls);return uu(n,t.params,t.paramsSerializer)}}de.forEach(["delete","get","head","options"],function(t){co.prototype[t]=function(n,r){return this.request(Vn(r||{},{method:t,url:n,data:(r||{}).data}))}}),de.forEach(["post","put","patch"],function(t){function n(r){return function(o,a,s){return this.request(Vn(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}co.prototype[t]=n(),co.prototype[t+"Form"]=n(!0)});const uo=co;class za{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(s=>{r.subscribe(s),o=s}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,s){r.reason||(r.reason=new cr(o,a,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new za(function(i){t=i}),cancel:t}}}const $3=za;function F3(e){return function(n){return e.apply(null,n)}}function V3(e){return de.isObject(e)&&e.isAxiosError===!0}const Ka={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ka).forEach(([e,t])=>{Ka[t]=e});const H3=Ka;function Lu(e){const t=new uo(e),n=Xc(uo.prototype.request,t);return de.extend(n,uo.prototype,t,{allOwnKeys:!0}),de.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Lu(Vn(e,i))},n}const Be=Lu($a);Be.Axios=uo,Be.CanceledError=cr,Be.CancelToken=$3,Be.isCancel=mu,Be.VERSION=Nu,Be.toFormData=no,Be.AxiosError=Pe,Be.Cancel=Be.CanceledError,Be.all=function(t){return Promise.all(t)},Be.spread=F3,Be.isAxiosError=V3,Be.mergeConfig=Vn,Be.AxiosHeaders=jt,Be.formToJSON=e=>hu(de.isHTMLForm(e)?new FormData(e):e),Be.getAdapter=Au.getAdapter,Be.HttpStatusCode=H3,Be.default=Be;class U3{constructor(t){this.restURL=t+"/services/apexrest/XX_ORD1/router"}async getProductConfiguration(t){return(await Be.post(`${this.restURL}?methodName=getProductConfiguration`,t,{headers:{"Content-Type":"application/json"}})).data}async getLineItems({request:t}){return(await Be.post(`${this.restURL}?methodName=getLineItems`,t,{headers:{"Content-Type":"application/json"}})).data}async getLineItemAttributes({request:t}){return(await Be.post(`${this.restURL}?methodName=getLineItemAttributes`,t,{headers:{"Content-Type":"application/json"}})).data}async getProductOptionsPricing({request:t}){return(await Be.post(`${this.restURL}?methodName=getProductOptionsPricing`,t,{headers:{"Content-Type":"application/json"}})).data}async calculateBestOfferPrice({request:t}){return(await Be.post(`${this.restURL}?methodName=calculateBestOfferPrice`,t,{headers:{"Content-Type":"application/json"}})).data}async getRecords({request:t}){return(await Be.post(`${this.restURL}?methodName=getRecords`,t,{headers:{"Content-Type":"application/json"}})).data}async maintainQuoteConfiguration({request:t}){return(await Be.post(`${this.restURL}?methodName=maintainQuoteConfiguration`,t,{headers:{"Content-Type":"application/json"}})).data}async getProductCrossSells({request:t}){return(await Be.post(`${this.restURL}?methodName=getProductCrossSells`,t,{headers:{"Content-Type":"application/json"}})).data}async createQuoteProducts({request:t}){return(await Be.post(`${this.restURL}?methodName=createQuoteProducts`,t,{headers:{"Content-Type":"application/json"}})).data}}class z3{constructor(t){this.restURL=t+"/services/apexrest/XX_ORD1/router"}getReturn(t){return{error:null,data:JSON.stringify(t.data),isSuccess:!0}}async getOrgInformation(){return(await Be.post(`${this.restURL}?methodName=getOrgInformation`,{},{headers:{"Content-Type":"application/json"}})).data}async getRecordInfo(t){return(await Be.post(`${this.restURL}?methodName=getRecordInfo`,t,{headers:{"Content-Type":"application/json"}})).data}getPrimaryQuote(){return new Promise((t,n)=>{setTimeout(()=>{t({userLocale:null,templateId:"a1RA000000XMtU7MAL",recordId:"a0jKb000004V2dsIACC",orgType:null,orgId:null,opportunityId:null,objectType:"XX_ORD1__Quote__c",name:"QUOTE-1379639",maxSequenceNumber:null,lineItemsCount:1,eCatalogId:"a1BKb000004oKC9MAM",currencycode:null,accountId:"0012G0000277jkgQAA"})},500)})}}const K3=(e=>(Yn("data-v-adfc84e9"),e=e(),er(),e))(()=>b("div",{class:"dropdowntp"},null,-1)),Z3={class:"app-wrapper"},Q3=Ve({__name:"ExpediteConfigurator",props:{itemId:{type:String,required:!0},qliId:{type:String,required:!1},quoteId:{type:String,required:!1},restUrl:{type:String,required:"https://ec-ord1-dev-ed.my.salesforce-sites.com/Order"}},setup(e){const t=ar(),n=Ui(),r=an(),i=ae(!1),o=e;return wn(async()=>{window.productManagerController=new U3(o.restUrl),window.salesforceConnector=new z3(o.restUrl),i.value=!0,await t.start(o.quoteId),i.value=!1}),(a,s)=>(X(),ne(Oe,null,[_e(h0),_e(y0),Xe(r).errorPopup?(X(),Te(e0,{key:0,data:Xe(r).errorPopup,onClose:s[0]||(s[0]=l=>Xe(r).errorPopup=null)},null,8,["data"])):ye("",!0),Xe(n).unsavedChanges?(X(),Te(r0,{key:1,data:Xe(n).unsavedChanges,onClose:s[1]||(s[1]=l=>Xe(n).unsavedChanges=null)},null,8,["data"])):ye("",!0),K3,b("div",Z3,[i.value?(X(),Te(Ca,{key:1})):(X(),Te(_p,{key:0,"item-id":o.itemId,"qli-id":o.qliId},null,8,["item-id","qli-id"]))])],64))}},[["__scopeId","data-v-adfc84e9"]]),X3=Rt("mygpt",()=>{const e=ae("");async function t(r,i="gpt-3.5-turbo",o=300){var a,s,l;if(!e.value)throw new Error("Secret key is required. Please set it in the store.");try{const p=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.value}`},body:JSON.stringify({model:i,messages:r,max_tokens:Math.min(o,300),temperature:.7})});if(!p.ok){const f=await p.json().catch(()=>({}));throw new Error(((a=f.error)==null?void 0:a.message)||`API Error: ${p.status} ${p.statusText}`)}return((l=(s=(await p.json()).choices[0])==null?void 0:s.message)==null?void 0:l.content)||"No response generated"}catch(p){throw new Error(p.message||"Failed to get response from GPT")}}function n(r){e.value=r}return{secretKey:e,getGptResponse:t,setSecretKey:n}}),Kr=e=>(Yn("data-v-46273585"),e=e(),er(),e),J3={class:"custom-gpt-container"},W3={class:"gpt-header"},G3=Kr(()=>b("h3",{class:"gpt-title"},"GPT Chat",-1)),Y3={class:"gpt-response-area"},e8={key:0,class:"loading-indicator"},t8=[Kr(()=>b("div",{class:"spinner"},null,-1)),Kr(()=>b("span",null,"Thinking...",-1))],n8={key:1,class:"error-message"},r8=Kr(()=>b("strong",null,"Error:",-1)),i8={key:2,class:"response-content"},o8={key:3,class:"empty-state"},a8=[Kr(()=>b("p",null,"Enter a message below to start a conversation with GPT 5.0",-1))],s8={class:"gpt-input-area"},l8={class:"input-wrapper"},c8=["placeholder","disabled"],u8=["disabled"],f8={key:0},d8={key:1},h8={key:0,class:"warning-message"},p8=Ve({__name:"ExpediteGPT",props:{secretKey:{type:String,required:!1,default:""},model:{type:String,required:!1,default:"gpt-3.5-turbo"},maxTokens:{type:Number,required:!1,default:300},placeholder:{type:String,required:!1,default:"Enter your message..."}},setup(e){const t=e,n=X3(),r=be(()=>t.secretKey||n.secretKey),i=ae(""),o=ae(""),a=ae(!1),s=ae(null),l=ae([]),p=be(()=>o.value.trim().length>0),c=be(()=>i.value.trim().length>0&&!a.value&&r.value),f=async()=>{if(!c.value)return;const h=i.value.trim();if(h){a.value=!0,s.value=null,i.value="";try{l.value.push({role:"user",content:h});const g=l.value.reduce((_,C)=>_+Math.ceil(C.content.length/4),0);let d=[...l.value];g>t.maxTokens&&(d=l.value.slice(-3));const v=await n.getGptResponse(d,t.model,t.maxTokens);o.value=v,l.value.push({role:"assistant",content:v})}catch(g){s.value=g.message||"Failed to get response from GPT",console.error("GPT API Error:",g)}finally{a.value=!1}}},u=h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),f())},m=()=>{l.value=[],o.value="",s.value=null};return wn(()=>{n.setSecretKey(t.secretKey)}),(h,g)=>(X(),ne("div",J3,[b("div",W3,[G3,p.value||l.value.length>0?(X(),ne("button",{key:0,onClick:m,class:"clear-button",type:"button"}," Clear ")):ye("",!0)]),b("div",Y3,[a.value?(X(),ne("div",e8,t8)):s.value?(X(),ne("div",n8,[r8,Fe(" "+ve(s.value),1)])):p.value?(X(),ne("div",i8,ve(o.value),1)):(X(),ne("div",o8,a8))]),b("div",s8,[b("div",l8,[Cn(b("textarea",{"onUpdate:modelValue":g[0]||(g[0]=d=>i.value=d),placeholder:e.placeholder,disabled:a.value||!r.value,onKeypress:u,class:"gpt-input",rows:"3"},null,40,c8),[[Di,i.value]]),b("button",{onClick:f,disabled:!c.value,class:"send-button",type:"button"},[a.value?(X(),ne("span",f8,"...")):(X(),ne("span",d8,"Send"))],8,u8)]),r.value?ye("",!0):(X(),ne("div",h8," ⚠️ Secret key is required to use this component. Set it via prop or in the store. "))])]))}},[["__scopeId","data-v-46273585"]]),m8={install(e){e.config.globalProperties.$formatCurrency=(t,n={})=>{const r={},i=n.locale||r.locale||"en-US",o=n.currency||r.currency||"USD";let a=t;return typeof t=="string"&&(a=Number(t.replace(/[^0-9.-]/g,""))),new Intl.NumberFormat(i,{style:"currency",currency:o,...n}).format(Number.isFinite(a)?a:0)}}};let fo=null;if(typeof window<"u"){try{fo=y1()}catch{}fo||(fo=_1(),jr(fo))}let ho=null,po=null;async function g8(){return ho||po||(po=(async()=>{try{const e=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:hn&&hn.src||new URL("vue-expedite-components.umd.cjs",document.baseURI).href).href,t=await fetch(e);if(t.ok)return ho=await t.text(),ho}catch(e){console.warn("[ExpediteComponents] Failed to load CSS:",e)}return null})(),po)}const Ru=e=>class extends e{async connectedCallback(){var t;if(this._instance){const n=(t=this._instance.appContext)==null?void 0:t.app;n&&(n.config.globalProperties.$formatCurrency||n.use(m8))}if(super.connectedCallback&&super.connectedCallback(),!!this.shadowRoot&&!this.shadowRoot.querySelector("style[data-vue-expedite-style]"))try{const n=await g8();if(n){const r=document.createElement("style");r.setAttribute("data-vue-expedite-style","true"),r.textContent=n,this.shadowRoot.prepend(r)}else{const r=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:hn&&hn.src||new URL("vue-expedite-components.umd.cjs",document.baseURI).href).href,i=document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("data-vue-expedite-style","true"),i.href=r,this.shadowRoot.prepend(i)}}catch(n){console.warn("[ExpediteComponents] Failed to inject CSS:",n)}}},Mu=Ru(uc(Q3)),qu=Ru(uc(p8));function Za(){typeof window<"u"&&(customElements.get("vue-expedite-configurator")||customElements.define("vue-expedite-configurator",Mu),customElements.get("vue-expedite-gpt")||customElements.define("vue-expedite-gpt",qu))}typeof window<"u"&&Za();const v8={register:Za};en.ExpediteConfiguratorElement=Mu,en.ExpediteGPTElement=qu,en.default=v8,en.registerWebComponents=Za,Object.defineProperties(en,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|