@expedite-commerce/expedite-components 0.2.135 → 0.2.137

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.
@@ -2,7 +2,7 @@
2
2
  * vue-router-lwc v1.0.4
3
3
  * (c) 2024 Eduardo San Martin Morote
4
4
  * @license MIT
5
- */var gl;(function(t){t.pop="pop",t.push="push"})(gl||(gl={}));var bl;(function(t){t.back="back",t.forward="forward",t.unknown=""})(bl||(bl={})),Symbol(process.env.NODE_ENV!=="production"?"navigation failure":"");var xl;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(xl||(xl={})),Symbol(process.env.NODE_ENV!=="production"?"router view location matched":""),Symbol(process.env.NODE_ENV!=="production"?"router view depth":"");const M0=Symbol(process.env.NODE_ENV!=="production"?"router":""),R0=Symbol(process.env.NODE_ENV!=="production"?"route location":"");Symbol(process.env.NODE_ENV!=="production"?"router view location":"");function Ko(){return e.inject(M0)}function L0(){return e.inject(R0)}function St(t,r,n){let o;return function(...i){const l=()=>{o=null,n||t.apply(this,i)},s=n&&!o;clearTimeout(o),o=setTimeout(l,r||500),s&&t.apply(this,i)}}function Jr(t,r=window.location.href){const n=r.match(new RegExp(`[?&]${t}=([^&]+)`));return n?decodeURIComponent(n[1]):null}function Xo(t,r={},n=!0){const o=(a,i="")=>{let l={};for(let s in a){const u=n?s.toLowerCase():s,h=i?`${i}.${u}`:u,d=a[s];typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(l,o(d,h)):Array.isArray(d)?l[h]=d.map(m=>typeof m=="object"&&m!==null?o(m):m):l[h]=d}return{...l,...r}};return Array.isArray(t)?t.map(a=>o(a)):o(t)}function P0(t,r){var o;let n="";return typeof t=="string"?n=t:(o=t.body)!=null&&o.message?n=t.body.message:t.message?n=t.message:n=JSON.stringify(t),{message:n,variant:"error",mode:r||"dismissable"}}function q0(t,r){var o;let n="";return typeof t=="string"?n=t:(o=t.body)!=null&&o.message?n=t.body.message:t.message?n=t.message:n=JSON.stringify(t),{message:n,variant:"success",mode:r||"dismissable"}}function $0(t){try{const r=new URL(t),n=r.protocol,o=r.hostname,a=r.port?":"+r.port:"";return n+"//"+o+a}catch{return null}}function _l(t){if(!t)return;const r=t.split("/"),n=r[0],o=r[1],a=r[2];return new Date(`${a}-${n}-${o}`).toISOString().split("T")[0]}function U0(t){return new Promise((r,n)=>{const o=new FileReader;o.readAsDataURL(t),o.onloadend=()=>{r(o.result)},o.onerror=n})}function vn(){let t=Date.now().toString();return"xxxxxxxxxxxxxxxxxx".replace(/[x]/g,()=>{const n=(parseInt(t.slice(-1))+Math.random()*16)%16|0;return t=Math.floor(parseInt(t)/16).toString(),n.toString(16)})}function Cl(t,r){if(typeof t=="string"&&(t=JSON.parse(t)),t!=null&&t.XX_ORD1__Layout_JSON__c&&(typeof t.XX_ORD1__Layout_JSON__c=="string"?t=JSON.parse(t.XX_ORD1__Layout_JSON__c):t=t.XX_ORD1__Layout_JSON__c),t!=null&&t.errorMessage)throw new Error(t.errorMessage);if(t==null||t==="null"||t==="undefined"||t==="")throw new Error(r);return t}const El=t=>t>=1024*1024?(t/(1024*1024)).toFixed(2)+" MB":(t/1024).toFixed(2)+" KB",z0=t=>{document.title=t},j0=(t,r,n)=>{if(typeof localStorage<"u"){const o=n?JSON.stringify(r):r;localStorage.setItem(t,o)}};function We(t,r,n,o=!1,a=!1){if(!r)return t;if(n&&(n==null?void 0:n.toUpperCase())==="CURRENCY"&&!o){const s=r.split("."),u=s[s.length-1],h=s.slice(0,-1).reduce((y,f)=>(y==null?void 0:y[f])??{},t);let d=u.replace(/[_.]/g,"");a&&(d=d.toLowerCase());let m=d+"Formatted";a&&(m=m.toLowerCase());let c;if(r.includes("XX_ORD1__Item__r")){let y=r.replace(/[_.]/g,"")+"Formatted";a&&(y=y.toLowerCase()),c=(h==null?void 0:h[y])??(h==null?void 0:h[m])??(h==null?void 0:h[d])??(h==null?void 0:h[u])}else c=(h==null?void 0:h[m])??(h==null?void 0:h[d])??(h==null?void 0:h[u]);return typeof c=="string"&&c&&c[0]!=="("&&(c=c.split("(")[0]),c??""}return r.split(".").reduce((s,u)=>(s==null?void 0:s[u])??"",t)}const Mt=it.defineStore("error",{state:()=>({toast:{message:"",variant:"",mode:""},errorPopup:null}),actions:{handleError(t,r){this.toast=P0(t),r&&console.info("[ERROR]: from = ",r),console.info("[ERROR]: error = ",t)},handleSuccess(t){this.toast=q0(t)},handleWarning(t){this.toast={message:t,variant:"warning",mode:""}},setDefaultErrorPopup(t){this.errorPopup={title:"Error",description:t,button:{label:"OK",action:function(){this.errorPopup=null}}}}}}),kl=it.defineStore("comShare",()=>{const t=e.ref({}),r=e.ref(""),n=e.ref(""),o=e.ref(""),a=e.ref(""),i=e.ref(""),l=e.ref(""),s=e.ref(""),u=e.ref(""),h=e.ref("Single"),d=e.ref({}),m=e.computed(()=>h.value==="Single"),c=e.ref({});function y(b){var p;return!b||b.includes("http")||b.includes("://")||!((p=c.value)!=null&&p.siteUrl)?b:`${c.value.siteUrl}${b}`}async function f(b,p,x,g){r.value=b.orgType||"Production",n.value=b.orgId||"",o.value=b.userId||"",a.value=b.accountId||"",i.value=b.opportunityId||"",u.value=b.userLocale||"en_US",h.value=b.pricingSchema||"Single",t.value=p||{},d.value=x||{},c.value=g||{}}return{orgType:r,orgId:n,userId:o,accountId:a,opportunityId:i,userLocale:u,pricingSchema:h,quoteId:l,eCatalogId:s,isSinglePricingSchema:m,securityContext:t,functions:d,setSetupData:f,getFullUrl:y}});function Yr(t){if(!t)return{};const r=a=>!a||!Array.isArray(a)?[]:a.map(i=>({label:i.label,value:i.value})),n={name:t.itemName,qty:t.qty||1,salesPrice:t.price||0,attributes:r(t.attributes)},o=[];return t.categoryOptions.forEach(a=>{a.itemTypes.forEach(i=>{i.options.forEach(l=>{i.selected.includes(l.itemId)&&o.push({name:l.itemName,qty:l.qty||1,salesPrice:l.price||0,attributes:r(l.attributes)})})})}),JSON.stringify({product:n,options:o})}function vl(t){if(!t)return{};const r=a=>!a||!Array.isArray(a)?[]:JSON.parse(JSON.stringify(a)),n=new Map,o=new Map;return n.set(t.itemId,{itemName:t.itemName,qty:t.qty,price:t.price,attributes:r(t.attributes)}),t.categoryOptions.forEach(a=>{a.itemTypes.forEach(i=>{o.set(i.itemTypeId,JSON.parse(JSON.stringify(i.selected))),i.options.forEach(l=>{n.set(l.itemId,{itemName:l.itemName,qty:l.qty,price:l.price,attributes:r(l.attributes)})})})}),{itemMapById:n,selectedItemsByTypeMap:o}}function Al(t,r){return function(){return t.apply(r,arguments)}}const{toString:H0}=Object.prototype,{getPrototypeOf:ea}=Object,{iterator:Wo,toStringTag:wl}=Symbol,Qo=(t=>r=>{const n=H0.call(r);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Kt=t=>(t=t.toLowerCase(),r=>Qo(r)===t),Zo=t=>r=>typeof r===t,{isArray:Kn}=Array,Xn=Zo("undefined");function fo(t){return t!==null&&!Xn(t)&&t.constructor!==null&&!Xn(t.constructor)&&Bt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Nl=Kt("ArrayBuffer");function G0(t){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(t):r=t&&t.buffer&&Nl(t.buffer),r}const K0=Zo("string"),Bt=Zo("function"),Sl=Zo("number"),ho=t=>t!==null&&typeof t=="object",X0=t=>t===!0||t===!1,Jo=t=>{if(Qo(t)!=="object")return!1;const r=ea(t);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(wl in t)&&!(Wo in t)},W0=t=>{if(!ho(t)||fo(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Q0=Kt("Date"),Z0=Kt("File"),J0=Kt("Blob"),Y0=Kt("FileList"),ed=t=>ho(t)&&Bt(t.pipe),td=t=>{let r;return t&&(typeof FormData=="function"&&t instanceof FormData||Bt(t.append)&&((r=Qo(t))==="formdata"||r==="object"&&Bt(t.toString)&&t.toString()==="[object FormData]"))},nd=Kt("URLSearchParams"),[od,rd,ad,id]=["ReadableStream","Request","Response","Headers"].map(Kt),ld=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function po(t,r,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let o,a;if(typeof t!="object"&&(t=[t]),Kn(t))for(o=0,a=t.length;o<a;o++)r.call(null,t[o],o,t);else{if(fo(t))return;const i=n?Object.getOwnPropertyNames(t):Object.keys(t),l=i.length;let s;for(o=0;o<l;o++)s=i[o],r.call(null,t[s],s,t)}}function Bl(t,r){if(fo(t))return null;r=r.toLowerCase();const n=Object.keys(t);let o=n.length,a;for(;o-- >0;)if(a=n[o],r===a.toLowerCase())return a;return null}const Fn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Il=t=>!Xn(t)&&t!==Fn;function ta(){const{caseless:t,skipUndefined:r}=Il(this)&&this||{},n={},o=(a,i)=>{const l=t&&Bl(n,i)||i;Jo(n[l])&&Jo(a)?n[l]=ta(n[l],a):Jo(a)?n[l]=ta({},a):Kn(a)?n[l]=a.slice():(!r||!Xn(a))&&(n[l]=a)};for(let a=0,i=arguments.length;a<i;a++)arguments[a]&&po(arguments[a],o);return n}const sd=(t,r,n,{allOwnKeys:o}={})=>(po(r,(a,i)=>{n&&Bt(a)?t[i]=Al(a,n):t[i]=a},{allOwnKeys:o}),t),cd=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),ud=(t,r,n,o)=>{t.prototype=Object.create(r.prototype,o),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:r.prototype}),n&&Object.assign(t.prototype,n)},dd=(t,r,n,o)=>{let a,i,l;const s={};if(r=r||{},t==null)return r;do{for(a=Object.getOwnPropertyNames(t),i=a.length;i-- >0;)l=a[i],(!o||o(l,t,r))&&!s[l]&&(r[l]=t[l],s[l]=!0);t=n!==!1&&ea(t)}while(t&&(!n||n(t,r))&&t!==Object.prototype);return r},fd=(t,r,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=r.length;const o=t.indexOf(r,n);return o!==-1&&o===n},hd=t=>{if(!t)return null;if(Kn(t))return t;let r=t.length;if(!Sl(r))return null;const n=new Array(r);for(;r-- >0;)n[r]=t[r];return n},pd=(t=>r=>t&&r instanceof t)(typeof Uint8Array<"u"&&ea(Uint8Array)),md=(t,r)=>{const o=(t&&t[Wo]).call(t);let a;for(;(a=o.next())&&!a.done;){const i=a.value;r.call(t,i[0],i[1])}},yd=(t,r)=>{let n;const o=[];for(;(n=t.exec(r))!==null;)o.push(n);return o},gd=Kt("HTMLFormElement"),bd=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,a){return o.toUpperCase()+a}),Tl=(({hasOwnProperty:t})=>(r,n)=>t.call(r,n))(Object.prototype),xd=Kt("RegExp"),Ol=(t,r)=>{const n=Object.getOwnPropertyDescriptors(t),o={};po(n,(a,i)=>{let l;(l=r(a,i,t))!==!1&&(o[i]=l||a)}),Object.defineProperties(t,o)},_d=t=>{Ol(t,(r,n)=>{if(Bt(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const o=t[n];if(Bt(o)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Cd=(t,r)=>{const n={},o=a=>{a.forEach(i=>{n[i]=!0})};return Kn(t)?o(t):o(String(t).split(r)),n},Ed=()=>{},kd=(t,r)=>t!=null&&Number.isFinite(t=+t)?t:r;function vd(t){return!!(t&&Bt(t.append)&&t[wl]==="FormData"&&t[Wo])}const Ad=t=>{const r=new Array(10),n=(o,a)=>{if(ho(o)){if(r.indexOf(o)>=0)return;if(fo(o))return o;if(!("toJSON"in o)){r[a]=o;const i=Kn(o)?[]:{};return po(o,(l,s)=>{const u=n(l,a+1);!Xn(u)&&(i[s]=u)}),r[a]=void 0,i}}return o};return n(t,0)},wd=Kt("AsyncFunction"),Nd=t=>t&&(ho(t)||Bt(t))&&Bt(t.then)&&Bt(t.catch),Dl=((t,r)=>t?setImmediate:r?((n,o)=>(Fn.addEventListener("message",({source:a,data:i})=>{a===Fn&&i===n&&o.length&&o.shift()()},!1),a=>{o.push(a),Fn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Bt(Fn.postMessage)),Sd=typeof queueMicrotask<"u"?queueMicrotask.bind(Fn):typeof process<"u"&&process.nextTick||Dl,he={isArray:Kn,isArrayBuffer:Nl,isBuffer:fo,isFormData:td,isArrayBufferView:G0,isString:K0,isNumber:Sl,isBoolean:X0,isObject:ho,isPlainObject:Jo,isEmptyObject:W0,isReadableStream:od,isRequest:rd,isResponse:ad,isHeaders:id,isUndefined:Xn,isDate:Q0,isFile:Z0,isBlob:J0,isRegExp:xd,isFunction:Bt,isStream:ed,isURLSearchParams:nd,isTypedArray:pd,isFileList:Y0,forEach:po,merge:ta,extend:sd,trim:ld,stripBOM:cd,inherits:ud,toFlatObject:dd,kindOf:Qo,kindOfTest:Kt,endsWith:fd,toArray:hd,forEachEntry:md,matchAll:yd,isHTMLForm:gd,hasOwnProperty:Tl,hasOwnProp:Tl,reduceDescriptors:Ol,freezeMethods:_d,toObjectSet:Cd,toCamelCase:bd,noop:Ed,toFiniteNumber:kd,findKey:Bl,global:Fn,isContextDefined:Il,isSpecCompliantForm:vd,toJSONObject:Ad,isAsyncFn:wd,isThenable:Nd,setImmediate:Dl,asap:Sd,isIterable:t=>t!=null&&Bt(t[Wo])};function Te(t,r,n,o,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",r&&(this.code=r),n&&(this.config=n),o&&(this.request=o),a&&(this.response=a,this.status=a.status?a.status:null)}he.inherits(Te,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:he.toJSONObject(this.config),code:this.code,status:this.status}}});const Vl=Te.prototype,Fl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Fl[t]={value:t}}),Object.defineProperties(Te,Fl),Object.defineProperty(Vl,"isAxiosError",{value:!0}),Te.from=(t,r,n,o,a,i)=>{const l=Object.create(Vl);he.toFlatObject(t,l,function(d){return d!==Error.prototype},h=>h!=="isAxiosError");const s=t&&t.message?t.message:"Error",u=r==null&&t?t.code:r;return Te.call(l,s,u,n,o,a),t&&l.cause==null&&Object.defineProperty(l,"cause",{value:t,configurable:!0}),l.name=t&&t.name||"Error",i&&Object.assign(l,i),l};const Bd=null;function na(t){return he.isPlainObject(t)||he.isArray(t)}function Ml(t){return he.endsWith(t,"[]")?t.slice(0,-2):t}function Rl(t,r,n){return t?t.concat(r).map(function(a,i){return a=Ml(a),!n&&i?"["+a+"]":a}).join(n?".":""):r}function Id(t){return he.isArray(t)&&!t.some(na)}const Td=he.toFlatObject(he,{},null,function(r){return/^is[A-Z]/.test(r)});function Yo(t,r,n){if(!he.isObject(t))throw new TypeError("target must be an object");r=r||new FormData,n=he.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,p){return!he.isUndefined(p[b])});const o=n.metaTokens,a=n.visitor||d,i=n.dots,l=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&he.isSpecCompliantForm(r);if(!he.isFunction(a))throw new TypeError("visitor must be a function");function h(f){if(f===null)return"";if(he.isDate(f))return f.toISOString();if(he.isBoolean(f))return f.toString();if(!u&&he.isBlob(f))throw new Te("Blob is not supported. Use a Buffer instead.");return he.isArrayBuffer(f)||he.isTypedArray(f)?u&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function d(f,b,p){let x=f;if(f&&!p&&typeof f=="object"){if(he.endsWith(b,"{}"))b=o?b:b.slice(0,-2),f=JSON.stringify(f);else if(he.isArray(f)&&Id(f)||(he.isFileList(f)||he.endsWith(b,"[]"))&&(x=he.toArray(f)))return b=Ml(b),x.forEach(function(C,_){!(he.isUndefined(C)||C===null)&&r.append(l===!0?Rl([b],_,i):l===null?b:b+"[]",h(C))}),!1}return na(f)?!0:(r.append(Rl(p,b,i),h(f)),!1)}const m=[],c=Object.assign(Td,{defaultVisitor:d,convertValue:h,isVisitable:na});function y(f,b){if(!he.isUndefined(f)){if(m.indexOf(f)!==-1)throw Error("Circular reference detected in "+b.join("."));m.push(f),he.forEach(f,function(x,g){(!(he.isUndefined(x)||x===null)&&a.call(r,x,he.isString(g)?g.trim():g,b,c))===!0&&y(x,b?b.concat(g):[g])}),m.pop()}}if(!he.isObject(t))throw new TypeError("data must be an object");return y(t),r}function Ll(t){const r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(o){return r[o]})}function oa(t,r){this._pairs=[],t&&Yo(t,this,r)}const Pl=oa.prototype;Pl.append=function(r,n){this._pairs.push([r,n])},Pl.toString=function(r){const n=r?function(o){return r.call(this,o,Ll)}:Ll;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function Od(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ql(t,r,n){if(!r)return t;const o=n&&n.encode||Od;he.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let i;if(a?i=a(r,n):i=he.isURLSearchParams(r)?r.toString():new oa(r,n).toString(o),i){const l=t.indexOf("#");l!==-1&&(t=t.slice(0,l)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class $l{constructor(){this.handlers=[]}use(r,n,o){return this.handlers.push({fulfilled:r,rejected:n,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){he.forEach(this.handlers,function(o){o!==null&&r(o)})}}const Ul={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Dd={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:oa,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ra=typeof window<"u"&&typeof document<"u",aa=typeof navigator=="object"&&navigator||void 0,Vd=ra&&(!aa||["ReactNative","NativeScript","NS"].indexOf(aa.product)<0),Fd=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Md=ra&&window.location.href||"http://localhost",pt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ra,hasStandardBrowserEnv:Vd,hasStandardBrowserWebWorkerEnv:Fd,navigator:aa,origin:Md},Symbol.toStringTag,{value:"Module"})),...Dd};function Rd(t,r){return Yo(t,new pt.classes.URLSearchParams,{visitor:function(n,o,a,i){return pt.isNode&&he.isBuffer(n)?(this.append(o,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...r})}function Ld(t){return he.matchAll(/\w+|\[(\w*)]/g,t).map(r=>r[0]==="[]"?"":r[1]||r[0])}function Pd(t){const r={},n=Object.keys(t);let o;const a=n.length;let i;for(o=0;o<a;o++)i=n[o],r[i]=t[i];return r}function zl(t){function r(n,o,a,i){let l=n[i++];if(l==="__proto__")return!0;const s=Number.isFinite(+l),u=i>=n.length;return l=!l&&he.isArray(a)?a.length:l,u?(he.hasOwnProp(a,l)?a[l]=[a[l],o]:a[l]=o,!s):((!a[l]||!he.isObject(a[l]))&&(a[l]=[]),r(n,o,a[l],i)&&he.isArray(a[l])&&(a[l]=Pd(a[l])),!s)}if(he.isFormData(t)&&he.isFunction(t.entries)){const n={};return he.forEachEntry(t,(o,a)=>{r(Ld(o),a,n,0)}),n}return null}function qd(t,r,n){if(he.isString(t))try{return(r||JSON.parse)(t),he.trim(t)}catch(o){if(o.name!=="SyntaxError")throw o}return(n||JSON.stringify)(t)}const ia={transitional:Ul,adapter:["xhr","http","fetch"],transformRequest:[function(r,n){const o=n.getContentType()||"",a=o.indexOf("application/json")>-1,i=he.isObject(r);if(i&&he.isHTMLForm(r)&&(r=new FormData(r)),he.isFormData(r))return a?JSON.stringify(zl(r)):r;if(he.isArrayBuffer(r)||he.isBuffer(r)||he.isStream(r)||he.isFile(r)||he.isBlob(r)||he.isReadableStream(r))return r;if(he.isArrayBufferView(r))return r.buffer;if(he.isURLSearchParams(r))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let s;if(i){if(o.indexOf("application/x-www-form-urlencoded")>-1)return Rd(r,this.formSerializer).toString();if((s=he.isFileList(r))||o.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Yo(s?{"files[]":r}:r,u&&new u,this.formSerializer)}}return i||a?(n.setContentType("application/json",!1),qd(r)):r}],transformResponse:[function(r){const n=this.transitional||ia.transitional,o=n&&n.forcedJSONParsing,a=this.responseType==="json";if(he.isResponse(r)||he.isReadableStream(r))return r;if(r&&he.isString(r)&&(o&&!this.responseType||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(r,this.parseReviver)}catch(s){if(l)throw s.name==="SyntaxError"?Te.from(s,Te.ERR_BAD_RESPONSE,this,null,this.response):s}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pt.classes.FormData,Blob:pt.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};he.forEach(["delete","get","head","post","put","patch"],t=>{ia.headers[t]={}});const la=ia,$d=he.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ud=t=>{const r={};let n,o,a;return t&&t.split(`
5
+ */var gl;(function(t){t.pop="pop",t.push="push"})(gl||(gl={}));var bl;(function(t){t.back="back",t.forward="forward",t.unknown=""})(bl||(bl={})),Symbol(process.env.NODE_ENV!=="production"?"navigation failure":"");var xl;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(xl||(xl={})),Symbol(process.env.NODE_ENV!=="production"?"router view location matched":""),Symbol(process.env.NODE_ENV!=="production"?"router view depth":"");const M0=Symbol(process.env.NODE_ENV!=="production"?"router":""),R0=Symbol(process.env.NODE_ENV!=="production"?"route location":"");Symbol(process.env.NODE_ENV!=="production"?"router view location":"");function Ko(){return e.inject(M0)}function L0(){return e.inject(R0)}function St(t,r,n){let o;return function(...i){const l=()=>{o=null,n||t.apply(this,i)},s=n&&!o;clearTimeout(o),o=setTimeout(l,r||500),s&&t.apply(this,i)}}function Jr(t,r=window.location.href){const n=r.match(new RegExp(`[?&]${t}=([^&]+)`));return n?decodeURIComponent(n[1]):null}function Xo(t,r={},n=!0){const o=(a,i="")=>{let l={};for(let s in a){const u=n?s.toLowerCase():s,h=i?`${i}.${u}`:u,d=a[s];typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(l,o(d,h)):Array.isArray(d)?l[h]=d.map(m=>typeof m=="object"&&m!==null?o(m):m):l[h]=d}return{...l,...r}};return Array.isArray(t)?t.map(a=>o(a)):o(t)}function P0(t,r){var o;let n="";return typeof t=="string"?n=t:(o=t.body)!=null&&o.message?n=t.body.message:t.message?n=t.message:n=JSON.stringify(t),{message:n,variant:"error",mode:r||"dismissable"}}function q0(t,r){var o;let n="";return typeof t=="string"?n=t:(o=t.body)!=null&&o.message?n=t.body.message:t.message?n=t.message:n=JSON.stringify(t),{message:n,variant:"success",mode:r||"dismissable"}}function $0(t){try{const r=new URL(t),n=r.protocol,o=r.hostname,a=r.port?":"+r.port:"";return n+"//"+o+a}catch{return null}}function _l(t){if(!t)return;const r=t.split("/"),n=r[0],o=r[1],a=r[2];return new Date(`${a}-${n}-${o}`).toISOString().split("T")[0]}function U0(t){return new Promise((r,n)=>{const o=new FileReader;o.readAsDataURL(t),o.onloadend=()=>{r(o.result)},o.onerror=n})}function vn(){let t=Date.now().toString();return"xxxxxxxxxxxxxxxxxx".replace(/[x]/g,()=>{const n=(parseInt(t.slice(-1))+Math.random()*16)%16|0;return t=Math.floor(parseInt(t)/16).toString(),n.toString(16)})}function Cl(t,r){if(typeof t=="string"&&(t=JSON.parse(t)),t!=null&&t.XX_ORD1__Layout_JSON__c&&(typeof t.XX_ORD1__Layout_JSON__c=="string"?t=JSON.parse(t.XX_ORD1__Layout_JSON__c):t=t.XX_ORD1__Layout_JSON__c),t!=null&&t.errorMessage)throw new Error(t.errorMessage);if(t==null||t==="null"||t==="undefined"||t==="")throw new Error(r);return t}const El=t=>t>=1024*1024?(t/(1024*1024)).toFixed(2)+" MB":(t/1024).toFixed(2)+" KB",z0=t=>{document.title=t},j0=(t,r,n)=>{if(typeof localStorage<"u"){const o=n?JSON.stringify(r):r;localStorage.setItem(t,o)}};function We(t,r,n,o=!1,a=!1){if(!r)return t;if(n&&(n==null?void 0:n.toUpperCase())==="CURRENCY"&&!o){const s=r.split("."),u=s[s.length-1],h=s.slice(0,-1).reduce((y,f)=>(y==null?void 0:y[f])??{},t);let d=u.replace(/[_.]/g,"");a&&(d=d.toLowerCase());let m=d+"Formatted";a&&(m=m.toLowerCase());let c;if(r.includes("XX_ORD1__Item__r")){let y=r.replace(/[_.]/g,"")+"Formatted";a&&(y=y.toLowerCase()),c=(h==null?void 0:h[y])??(h==null?void 0:h[m])??(h==null?void 0:h[d])??(h==null?void 0:h[u])}else c=(h==null?void 0:h[m])??(h==null?void 0:h[d])??(h==null?void 0:h[u]);return typeof c=="string"&&c&&c[0]!=="("&&(c=c.split("(")[0]),c??""}return r.split(".").reduce((s,u)=>(s==null?void 0:s[u])??"",t)}const Mt=it.defineStore("error",{state:()=>({toast:{message:"",variant:"",mode:""},errorPopup:null}),actions:{handleError(t,r){this.toast=P0(t),r&&console.info("[ERROR]: from = ",r),console.info("[ERROR]: error = ",t)},handleSuccess(t){this.toast=q0(t)},handleWarning(t){this.toast={message:t,variant:"warning",mode:""}},setDefaultErrorPopup(t){this.errorPopup={title:"Error",description:t,button:{label:"OK",action:function(){this.errorPopup=null}}}}}}),kl=it.defineStore("comShare",()=>{const t=e.ref({}),r=e.ref(""),n=e.ref(""),o=e.ref(""),a=e.ref(""),i=e.ref(""),l=e.ref(""),s=e.ref(""),u=e.ref(""),h=e.ref("Single"),d=e.ref({}),m=e.computed(()=>h.value==="Single"),c=e.ref({});function y(b){var g;if(!b||b.includes("://")||!((g=c.value)!=null&&g.siteUrl))return b;if(/^[\w-]+(\.[\w-]+)+\//.test(b))return`https://${b}`;const p=c.value.siteUrl.replace(/\/+$/,""),x=b.replace(/^(?:\.\.?\/)+/,"").replace(/^\/+/,"");return`${p}/${x}`}async function f(b,p,x,g){r.value=b.orgType||"Production",n.value=b.orgId||"",o.value=b.userId||"",a.value=b.accountId||"",i.value=b.opportunityId||"",u.value=b.userLocale||"en_US",h.value=b.pricingSchema||"Single",t.value=p||{},d.value=x||{},c.value=g||{}}return{orgType:r,orgId:n,userId:o,accountId:a,opportunityId:i,userLocale:u,pricingSchema:h,quoteId:l,eCatalogId:s,isSinglePricingSchema:m,securityContext:t,functions:d,setSetupData:f,getFullUrl:y}});function Yr(t){if(!t)return{};const r=a=>!a||!Array.isArray(a)?[]:a.map(i=>({label:i.label,value:i.value})),n={name:t.itemName,qty:t.qty||1,salesPrice:t.price||0,attributes:r(t.attributes)},o=[];return t.categoryOptions.forEach(a=>{a.itemTypes.forEach(i=>{i.options.forEach(l=>{i.selected.includes(l.itemId)&&o.push({name:l.itemName,qty:l.qty||1,salesPrice:l.price||0,attributes:r(l.attributes)})})})}),JSON.stringify({product:n,options:o})}function vl(t){if(!t)return{};const r=a=>!a||!Array.isArray(a)?[]:JSON.parse(JSON.stringify(a)),n=new Map,o=new Map;return n.set(t.itemId,{itemName:t.itemName,qty:t.qty,price:t.price,attributes:r(t.attributes)}),t.categoryOptions.forEach(a=>{a.itemTypes.forEach(i=>{o.set(i.itemTypeId,JSON.parse(JSON.stringify(i.selected))),i.options.forEach(l=>{n.set(l.itemId,{itemName:l.itemName,qty:l.qty,price:l.price,attributes:r(l.attributes)})})})}),{itemMapById:n,selectedItemsByTypeMap:o}}function Al(t,r){return function(){return t.apply(r,arguments)}}const{toString:H0}=Object.prototype,{getPrototypeOf:ea}=Object,{iterator:Wo,toStringTag:wl}=Symbol,Qo=(t=>r=>{const n=H0.call(r);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Kt=t=>(t=t.toLowerCase(),r=>Qo(r)===t),Zo=t=>r=>typeof r===t,{isArray:Kn}=Array,Xn=Zo("undefined");function fo(t){return t!==null&&!Xn(t)&&t.constructor!==null&&!Xn(t.constructor)&&Bt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Nl=Kt("ArrayBuffer");function G0(t){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(t):r=t&&t.buffer&&Nl(t.buffer),r}const K0=Zo("string"),Bt=Zo("function"),Sl=Zo("number"),ho=t=>t!==null&&typeof t=="object",X0=t=>t===!0||t===!1,Jo=t=>{if(Qo(t)!=="object")return!1;const r=ea(t);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(wl in t)&&!(Wo in t)},W0=t=>{if(!ho(t)||fo(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Q0=Kt("Date"),Z0=Kt("File"),J0=Kt("Blob"),Y0=Kt("FileList"),ed=t=>ho(t)&&Bt(t.pipe),td=t=>{let r;return t&&(typeof FormData=="function"&&t instanceof FormData||Bt(t.append)&&((r=Qo(t))==="formdata"||r==="object"&&Bt(t.toString)&&t.toString()==="[object FormData]"))},nd=Kt("URLSearchParams"),[od,rd,ad,id]=["ReadableStream","Request","Response","Headers"].map(Kt),ld=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function po(t,r,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let o,a;if(typeof t!="object"&&(t=[t]),Kn(t))for(o=0,a=t.length;o<a;o++)r.call(null,t[o],o,t);else{if(fo(t))return;const i=n?Object.getOwnPropertyNames(t):Object.keys(t),l=i.length;let s;for(o=0;o<l;o++)s=i[o],r.call(null,t[s],s,t)}}function Bl(t,r){if(fo(t))return null;r=r.toLowerCase();const n=Object.keys(t);let o=n.length,a;for(;o-- >0;)if(a=n[o],r===a.toLowerCase())return a;return null}const Fn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Il=t=>!Xn(t)&&t!==Fn;function ta(){const{caseless:t,skipUndefined:r}=Il(this)&&this||{},n={},o=(a,i)=>{const l=t&&Bl(n,i)||i;Jo(n[l])&&Jo(a)?n[l]=ta(n[l],a):Jo(a)?n[l]=ta({},a):Kn(a)?n[l]=a.slice():(!r||!Xn(a))&&(n[l]=a)};for(let a=0,i=arguments.length;a<i;a++)arguments[a]&&po(arguments[a],o);return n}const sd=(t,r,n,{allOwnKeys:o}={})=>(po(r,(a,i)=>{n&&Bt(a)?t[i]=Al(a,n):t[i]=a},{allOwnKeys:o}),t),cd=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),ud=(t,r,n,o)=>{t.prototype=Object.create(r.prototype,o),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:r.prototype}),n&&Object.assign(t.prototype,n)},dd=(t,r,n,o)=>{let a,i,l;const s={};if(r=r||{},t==null)return r;do{for(a=Object.getOwnPropertyNames(t),i=a.length;i-- >0;)l=a[i],(!o||o(l,t,r))&&!s[l]&&(r[l]=t[l],s[l]=!0);t=n!==!1&&ea(t)}while(t&&(!n||n(t,r))&&t!==Object.prototype);return r},fd=(t,r,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=r.length;const o=t.indexOf(r,n);return o!==-1&&o===n},hd=t=>{if(!t)return null;if(Kn(t))return t;let r=t.length;if(!Sl(r))return null;const n=new Array(r);for(;r-- >0;)n[r]=t[r];return n},pd=(t=>r=>t&&r instanceof t)(typeof Uint8Array<"u"&&ea(Uint8Array)),md=(t,r)=>{const o=(t&&t[Wo]).call(t);let a;for(;(a=o.next())&&!a.done;){const i=a.value;r.call(t,i[0],i[1])}},yd=(t,r)=>{let n;const o=[];for(;(n=t.exec(r))!==null;)o.push(n);return o},gd=Kt("HTMLFormElement"),bd=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,a){return o.toUpperCase()+a}),Tl=(({hasOwnProperty:t})=>(r,n)=>t.call(r,n))(Object.prototype),xd=Kt("RegExp"),Ol=(t,r)=>{const n=Object.getOwnPropertyDescriptors(t),o={};po(n,(a,i)=>{let l;(l=r(a,i,t))!==!1&&(o[i]=l||a)}),Object.defineProperties(t,o)},_d=t=>{Ol(t,(r,n)=>{if(Bt(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const o=t[n];if(Bt(o)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Cd=(t,r)=>{const n={},o=a=>{a.forEach(i=>{n[i]=!0})};return Kn(t)?o(t):o(String(t).split(r)),n},Ed=()=>{},kd=(t,r)=>t!=null&&Number.isFinite(t=+t)?t:r;function vd(t){return!!(t&&Bt(t.append)&&t[wl]==="FormData"&&t[Wo])}const Ad=t=>{const r=new Array(10),n=(o,a)=>{if(ho(o)){if(r.indexOf(o)>=0)return;if(fo(o))return o;if(!("toJSON"in o)){r[a]=o;const i=Kn(o)?[]:{};return po(o,(l,s)=>{const u=n(l,a+1);!Xn(u)&&(i[s]=u)}),r[a]=void 0,i}}return o};return n(t,0)},wd=Kt("AsyncFunction"),Nd=t=>t&&(ho(t)||Bt(t))&&Bt(t.then)&&Bt(t.catch),Dl=((t,r)=>t?setImmediate:r?((n,o)=>(Fn.addEventListener("message",({source:a,data:i})=>{a===Fn&&i===n&&o.length&&o.shift()()},!1),a=>{o.push(a),Fn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Bt(Fn.postMessage)),Sd=typeof queueMicrotask<"u"?queueMicrotask.bind(Fn):typeof process<"u"&&process.nextTick||Dl,he={isArray:Kn,isArrayBuffer:Nl,isBuffer:fo,isFormData:td,isArrayBufferView:G0,isString:K0,isNumber:Sl,isBoolean:X0,isObject:ho,isPlainObject:Jo,isEmptyObject:W0,isReadableStream:od,isRequest:rd,isResponse:ad,isHeaders:id,isUndefined:Xn,isDate:Q0,isFile:Z0,isBlob:J0,isRegExp:xd,isFunction:Bt,isStream:ed,isURLSearchParams:nd,isTypedArray:pd,isFileList:Y0,forEach:po,merge:ta,extend:sd,trim:ld,stripBOM:cd,inherits:ud,toFlatObject:dd,kindOf:Qo,kindOfTest:Kt,endsWith:fd,toArray:hd,forEachEntry:md,matchAll:yd,isHTMLForm:gd,hasOwnProperty:Tl,hasOwnProp:Tl,reduceDescriptors:Ol,freezeMethods:_d,toObjectSet:Cd,toCamelCase:bd,noop:Ed,toFiniteNumber:kd,findKey:Bl,global:Fn,isContextDefined:Il,isSpecCompliantForm:vd,toJSONObject:Ad,isAsyncFn:wd,isThenable:Nd,setImmediate:Dl,asap:Sd,isIterable:t=>t!=null&&Bt(t[Wo])};function Te(t,r,n,o,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",r&&(this.code=r),n&&(this.config=n),o&&(this.request=o),a&&(this.response=a,this.status=a.status?a.status:null)}he.inherits(Te,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:he.toJSONObject(this.config),code:this.code,status:this.status}}});const Vl=Te.prototype,Fl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Fl[t]={value:t}}),Object.defineProperties(Te,Fl),Object.defineProperty(Vl,"isAxiosError",{value:!0}),Te.from=(t,r,n,o,a,i)=>{const l=Object.create(Vl);he.toFlatObject(t,l,function(d){return d!==Error.prototype},h=>h!=="isAxiosError");const s=t&&t.message?t.message:"Error",u=r==null&&t?t.code:r;return Te.call(l,s,u,n,o,a),t&&l.cause==null&&Object.defineProperty(l,"cause",{value:t,configurable:!0}),l.name=t&&t.name||"Error",i&&Object.assign(l,i),l};const Bd=null;function na(t){return he.isPlainObject(t)||he.isArray(t)}function Ml(t){return he.endsWith(t,"[]")?t.slice(0,-2):t}function Rl(t,r,n){return t?t.concat(r).map(function(a,i){return a=Ml(a),!n&&i?"["+a+"]":a}).join(n?".":""):r}function Id(t){return he.isArray(t)&&!t.some(na)}const Td=he.toFlatObject(he,{},null,function(r){return/^is[A-Z]/.test(r)});function Yo(t,r,n){if(!he.isObject(t))throw new TypeError("target must be an object");r=r||new FormData,n=he.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,p){return!he.isUndefined(p[b])});const o=n.metaTokens,a=n.visitor||d,i=n.dots,l=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&he.isSpecCompliantForm(r);if(!he.isFunction(a))throw new TypeError("visitor must be a function");function h(f){if(f===null)return"";if(he.isDate(f))return f.toISOString();if(he.isBoolean(f))return f.toString();if(!u&&he.isBlob(f))throw new Te("Blob is not supported. Use a Buffer instead.");return he.isArrayBuffer(f)||he.isTypedArray(f)?u&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function d(f,b,p){let x=f;if(f&&!p&&typeof f=="object"){if(he.endsWith(b,"{}"))b=o?b:b.slice(0,-2),f=JSON.stringify(f);else if(he.isArray(f)&&Id(f)||(he.isFileList(f)||he.endsWith(b,"[]"))&&(x=he.toArray(f)))return b=Ml(b),x.forEach(function(C,_){!(he.isUndefined(C)||C===null)&&r.append(l===!0?Rl([b],_,i):l===null?b:b+"[]",h(C))}),!1}return na(f)?!0:(r.append(Rl(p,b,i),h(f)),!1)}const m=[],c=Object.assign(Td,{defaultVisitor:d,convertValue:h,isVisitable:na});function y(f,b){if(!he.isUndefined(f)){if(m.indexOf(f)!==-1)throw Error("Circular reference detected in "+b.join("."));m.push(f),he.forEach(f,function(x,g){(!(he.isUndefined(x)||x===null)&&a.call(r,x,he.isString(g)?g.trim():g,b,c))===!0&&y(x,b?b.concat(g):[g])}),m.pop()}}if(!he.isObject(t))throw new TypeError("data must be an object");return y(t),r}function Ll(t){const r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(o){return r[o]})}function oa(t,r){this._pairs=[],t&&Yo(t,this,r)}const Pl=oa.prototype;Pl.append=function(r,n){this._pairs.push([r,n])},Pl.toString=function(r){const n=r?function(o){return r.call(this,o,Ll)}:Ll;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function Od(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ql(t,r,n){if(!r)return t;const o=n&&n.encode||Od;he.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let i;if(a?i=a(r,n):i=he.isURLSearchParams(r)?r.toString():new oa(r,n).toString(o),i){const l=t.indexOf("#");l!==-1&&(t=t.slice(0,l)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class $l{constructor(){this.handlers=[]}use(r,n,o){return this.handlers.push({fulfilled:r,rejected:n,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){he.forEach(this.handlers,function(o){o!==null&&r(o)})}}const Ul={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Dd={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:oa,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ra=typeof window<"u"&&typeof document<"u",aa=typeof navigator=="object"&&navigator||void 0,Vd=ra&&(!aa||["ReactNative","NativeScript","NS"].indexOf(aa.product)<0),Fd=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Md=ra&&window.location.href||"http://localhost",pt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ra,hasStandardBrowserEnv:Vd,hasStandardBrowserWebWorkerEnv:Fd,navigator:aa,origin:Md},Symbol.toStringTag,{value:"Module"})),...Dd};function Rd(t,r){return Yo(t,new pt.classes.URLSearchParams,{visitor:function(n,o,a,i){return pt.isNode&&he.isBuffer(n)?(this.append(o,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...r})}function Ld(t){return he.matchAll(/\w+|\[(\w*)]/g,t).map(r=>r[0]==="[]"?"":r[1]||r[0])}function Pd(t){const r={},n=Object.keys(t);let o;const a=n.length;let i;for(o=0;o<a;o++)i=n[o],r[i]=t[i];return r}function zl(t){function r(n,o,a,i){let l=n[i++];if(l==="__proto__")return!0;const s=Number.isFinite(+l),u=i>=n.length;return l=!l&&he.isArray(a)?a.length:l,u?(he.hasOwnProp(a,l)?a[l]=[a[l],o]:a[l]=o,!s):((!a[l]||!he.isObject(a[l]))&&(a[l]=[]),r(n,o,a[l],i)&&he.isArray(a[l])&&(a[l]=Pd(a[l])),!s)}if(he.isFormData(t)&&he.isFunction(t.entries)){const n={};return he.forEachEntry(t,(o,a)=>{r(Ld(o),a,n,0)}),n}return null}function qd(t,r,n){if(he.isString(t))try{return(r||JSON.parse)(t),he.trim(t)}catch(o){if(o.name!=="SyntaxError")throw o}return(n||JSON.stringify)(t)}const ia={transitional:Ul,adapter:["xhr","http","fetch"],transformRequest:[function(r,n){const o=n.getContentType()||"",a=o.indexOf("application/json")>-1,i=he.isObject(r);if(i&&he.isHTMLForm(r)&&(r=new FormData(r)),he.isFormData(r))return a?JSON.stringify(zl(r)):r;if(he.isArrayBuffer(r)||he.isBuffer(r)||he.isStream(r)||he.isFile(r)||he.isBlob(r)||he.isReadableStream(r))return r;if(he.isArrayBufferView(r))return r.buffer;if(he.isURLSearchParams(r))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let s;if(i){if(o.indexOf("application/x-www-form-urlencoded")>-1)return Rd(r,this.formSerializer).toString();if((s=he.isFileList(r))||o.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Yo(s?{"files[]":r}:r,u&&new u,this.formSerializer)}}return i||a?(n.setContentType("application/json",!1),qd(r)):r}],transformResponse:[function(r){const n=this.transitional||ia.transitional,o=n&&n.forcedJSONParsing,a=this.responseType==="json";if(he.isResponse(r)||he.isReadableStream(r))return r;if(r&&he.isString(r)&&(o&&!this.responseType||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(r,this.parseReviver)}catch(s){if(l)throw s.name==="SyntaxError"?Te.from(s,Te.ERR_BAD_RESPONSE,this,null,this.response):s}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pt.classes.FormData,Blob:pt.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};he.forEach(["delete","get","head","post","put","patch"],t=>{ia.headers[t]={}});const la=ia,$d=he.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ud=t=>{const r={};let n,o,a;return t&&t.split(`
6
6
  `).forEach(function(l){a=l.indexOf(":"),n=l.substring(0,a).trim().toLowerCase(),o=l.substring(a+1).trim(),!(!n||r[n]&&$d[n])&&(n==="set-cookie"?r[n]?r[n].push(o):r[n]=[o]:r[n]=r[n]?r[n]+", "+o:o)}),r},jl=Symbol("internals");function mo(t){return t&&String(t).trim().toLowerCase()}function er(t){return t===!1||t==null?t:he.isArray(t)?t.map(er):String(t)}function zd(t){const r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(t);)r[o[1]]=o[2];return r}const jd=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function sa(t,r,n,o,a){if(he.isFunction(o))return o.call(this,r,n);if(a&&(r=n),!!he.isString(r)){if(he.isString(o))return r.indexOf(o)!==-1;if(he.isRegExp(o))return o.test(r)}}function Hd(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(r,n,o)=>n.toUpperCase()+o)}function Gd(t,r){const n=he.toCamelCase(" "+r);["get","set","has"].forEach(o=>{Object.defineProperty(t,o+n,{value:function(a,i,l){return this[o].call(this,r,a,i,l)},configurable:!0})})}class tr{constructor(r){r&&this.set(r)}set(r,n,o){const a=this;function i(s,u,h){const d=mo(u);if(!d)throw new Error("header name must be a non-empty string");const m=he.findKey(a,d);(!m||a[m]===void 0||h===!0||h===void 0&&a[m]!==!1)&&(a[m||u]=er(s))}const l=(s,u)=>he.forEach(s,(h,d)=>i(h,d,u));if(he.isPlainObject(r)||r instanceof this.constructor)l(r,n);else if(he.isString(r)&&(r=r.trim())&&!jd(r))l(Ud(r),n);else if(he.isObject(r)&&he.isIterable(r)){let s={},u,h;for(const d of r){if(!he.isArray(d))throw TypeError("Object iterator must return a key-value pair");s[h=d[0]]=(u=s[h])?he.isArray(u)?[...u,d[1]]:[u,d[1]]:d[1]}l(s,n)}else r!=null&&i(n,r,o);return this}get(r,n){if(r=mo(r),r){const o=he.findKey(this,r);if(o){const a=this[o];if(!n)return a;if(n===!0)return zd(a);if(he.isFunction(n))return n.call(this,a,o);if(he.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(r,n){if(r=mo(r),r){const o=he.findKey(this,r);return!!(o&&this[o]!==void 0&&(!n||sa(this,this[o],o,n)))}return!1}delete(r,n){const o=this;let a=!1;function i(l){if(l=mo(l),l){const s=he.findKey(o,l);s&&(!n||sa(o,o[s],s,n))&&(delete o[s],a=!0)}}return he.isArray(r)?r.forEach(i):i(r),a}clear(r){const n=Object.keys(this);let o=n.length,a=!1;for(;o--;){const i=n[o];(!r||sa(this,this[i],i,r,!0))&&(delete this[i],a=!0)}return a}normalize(r){const n=this,o={};return he.forEach(this,(a,i)=>{const l=he.findKey(o,i);if(l){n[l]=er(a),delete n[i];return}const s=r?Hd(i):String(i).trim();s!==i&&delete n[i],n[s]=er(a),o[s]=!0}),this}concat(...r){return this.constructor.concat(this,...r)}toJSON(r){const n=Object.create(null);return he.forEach(this,(o,a)=>{o!=null&&o!==!1&&(n[a]=r&&he.isArray(o)?o.join(", "):o)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([r,n])=>r+": "+n).join(`
7
7
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...n){const o=new this(r);return n.forEach(a=>o.set(a)),o}static accessor(r){const o=(this[jl]=this[jl]={accessors:{}}).accessors,a=this.prototype;function i(l){const s=mo(l);o[s]||(Gd(a,l),o[s]=!0)}return he.isArray(r)?r.forEach(i):i(r),this}}tr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),he.reduceDescriptors(tr.prototype,({value:t},r)=>{let n=r[0].toUpperCase()+r.slice(1);return{get:()=>t,set(o){this[n]=o}}}),he.freezeMethods(tr);const Xt=tr;function ca(t,r){const n=this||la,o=r||n,a=Xt.from(o.headers);let i=o.data;return he.forEach(t,function(s){i=s.call(n,i,a.normalize(),r?r.status:void 0)}),a.normalize(),i}function Hl(t){return!!(t&&t.__CANCEL__)}function Wn(t,r,n){Te.call(this,t??"canceled",Te.ERR_CANCELED,r,n),this.name="CanceledError"}he.inherits(Wn,Te,{__CANCEL__:!0});function Gl(t,r,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?t(n):r(new Te("Request failed with status code "+n.status,[Te.ERR_BAD_REQUEST,Te.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Kd(t){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return r&&r[1]||""}function Xd(t,r){t=t||10;const n=new Array(t),o=new Array(t);let a=0,i=0,l;return r=r!==void 0?r:1e3,function(u){const h=Date.now(),d=o[i];l||(l=h),n[a]=u,o[a]=h;let m=i,c=0;for(;m!==a;)c+=n[m++],m=m%t;if(a=(a+1)%t,a===i&&(i=(i+1)%t),h-l<r)return;const y=d&&h-d;return y?Math.round(c*1e3/y):void 0}}function Wd(t,r){let n=0,o=1e3/r,a,i;const l=(h,d=Date.now())=>{n=d,a=null,i&&(clearTimeout(i),i=null),t(...h)};return[(...h)=>{const d=Date.now(),m=d-n;m>=o?l(h,d):(a=h,i||(i=setTimeout(()=>{i=null,l(a)},o-m)))},()=>a&&l(a)]}const nr=(t,r,n=3)=>{let o=0;const a=Xd(50,250);return Wd(i=>{const l=i.loaded,s=i.lengthComputable?i.total:void 0,u=l-o,h=a(u),d=l<=s;o=l;const m={loaded:l,total:s,progress:s?l/s:void 0,bytes:u,rate:h||void 0,estimated:h&&s&&d?(s-l)/h:void 0,event:i,lengthComputable:s!=null,[r?"download":"upload"]:!0};t(m)},n)},Kl=(t,r)=>{const n=t!=null;return[o=>r[0]({lengthComputable:n,total:t,loaded:o}),r[1]]},Xl=t=>(...r)=>he.asap(()=>t(...r)),Qd=pt.hasStandardBrowserEnv?((t,r)=>n=>(n=new URL(n,pt.origin),t.protocol===n.protocol&&t.host===n.host&&(r||t.port===n.port)))(new URL(pt.origin),pt.navigator&&/(msie|trident)/i.test(pt.navigator.userAgent)):()=>!0,Zd=pt.hasStandardBrowserEnv?{write(t,r,n,o,a,i,l){if(typeof document>"u")return;const s=[`${t}=${encodeURIComponent(r)}`];he.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),he.isString(o)&&s.push(`path=${o}`),he.isString(a)&&s.push(`domain=${a}`),i===!0&&s.push("secure"),he.isString(l)&&s.push(`SameSite=${l}`),document.cookie=s.join("; ")},read(t){if(typeof document>"u")return null;const r=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return r?decodeURIComponent(r[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Jd(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Yd(t,r){return r?t.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):t}function Wl(t,r,n){let o=!Jd(r);return t&&(o||n==!1)?Yd(t,r):r}const Ql=t=>t instanceof Xt?{...t}:t;function Mn(t,r){r=r||{};const n={};function o(h,d,m,c){return he.isPlainObject(h)&&he.isPlainObject(d)?he.merge.call({caseless:c},h,d):he.isPlainObject(d)?he.merge({},d):he.isArray(d)?d.slice():d}function a(h,d,m,c){if(he.isUndefined(d)){if(!he.isUndefined(h))return o(void 0,h,m,c)}else return o(h,d,m,c)}function i(h,d){if(!he.isUndefined(d))return o(void 0,d)}function l(h,d){if(he.isUndefined(d)){if(!he.isUndefined(h))return o(void 0,h)}else return o(void 0,d)}function s(h,d,m){if(m in r)return o(h,d);if(m in t)return o(void 0,h)}const u={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:s,headers:(h,d,m)=>a(Ql(h),Ql(d),m,!0)};return he.forEach(Object.keys({...t,...r}),function(d){const m=u[d]||a,c=m(t[d],r[d],d);he.isUndefined(c)&&m!==s||(n[d]=c)}),n}const Zl=t=>{const r=Mn({},t);let{data:n,withXSRFToken:o,xsrfHeaderName:a,xsrfCookieName:i,headers:l,auth:s}=r;if(r.headers=l=Xt.from(l),r.url=ql(Wl(r.baseURL,r.url,r.allowAbsoluteUrls),t.params,t.paramsSerializer),s&&l.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),he.isFormData(n)){if(pt.hasStandardBrowserEnv||pt.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(he.isFunction(n.getHeaders)){const u=n.getHeaders(),h=["content-type","content-length"];Object.entries(u).forEach(([d,m])=>{h.includes(d.toLowerCase())&&l.set(d,m)})}}if(pt.hasStandardBrowserEnv&&(o&&he.isFunction(o)&&(o=o(r)),o||o!==!1&&Qd(r.url))){const u=a&&i&&Zd.read(i);u&&l.set(a,u)}return r},ef=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,o){const a=Zl(t);let i=a.data;const l=Xt.from(a.headers).normalize();let{responseType:s,onUploadProgress:u,onDownloadProgress:h}=a,d,m,c,y,f;function b(){y&&y(),f&&f(),a.cancelToken&&a.cancelToken.unsubscribe(d),a.signal&&a.signal.removeEventListener("abort",d)}let p=new XMLHttpRequest;p.open(a.method.toUpperCase(),a.url,!0),p.timeout=a.timeout;function x(){if(!p)return;const C=Xt.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),E={data:!s||s==="text"||s==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:C,config:t,request:p};Gl(function(k){n(k),b()},function(k){o(k),b()},E),p=null}"onloadend"in p?p.onloadend=x:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(x)},p.onabort=function(){p&&(o(new Te("Request aborted",Te.ECONNABORTED,t,p)),p=null)},p.onerror=function(_){const E=_&&_.message?_.message:"Network Error",A=new Te(E,Te.ERR_NETWORK,t,p);A.event=_||null,o(A),p=null},p.ontimeout=function(){let _=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const E=a.transitional||Ul;a.timeoutErrorMessage&&(_=a.timeoutErrorMessage),o(new Te(_,E.clarifyTimeoutError?Te.ETIMEDOUT:Te.ECONNABORTED,t,p)),p=null},i===void 0&&l.setContentType(null),"setRequestHeader"in p&&he.forEach(l.toJSON(),function(_,E){p.setRequestHeader(E,_)}),he.isUndefined(a.withCredentials)||(p.withCredentials=!!a.withCredentials),s&&s!=="json"&&(p.responseType=a.responseType),h&&([c,f]=nr(h,!0),p.addEventListener("progress",c)),u&&p.upload&&([m,y]=nr(u),p.upload.addEventListener("progress",m),p.upload.addEventListener("loadend",y)),(a.cancelToken||a.signal)&&(d=C=>{p&&(o(!C||C.type?new Wn(null,t,p):C),p.abort(),p=null)},a.cancelToken&&a.cancelToken.subscribe(d),a.signal&&(a.signal.aborted?d():a.signal.addEventListener("abort",d)));const g=Kd(a.url);if(g&&pt.protocols.indexOf(g)===-1){o(new Te("Unsupported protocol "+g+":",Te.ERR_BAD_REQUEST,t));return}p.send(i||null)})},tf=(t,r)=>{const{length:n}=t=t?t.filter(Boolean):[];if(r||n){let o=new AbortController,a;const i=function(h){if(!a){a=!0,s();const d=h instanceof Error?h:this.reason;o.abort(d instanceof Te?d:new Wn(d instanceof Error?d.message:d))}};let l=r&&setTimeout(()=>{l=null,i(new Te(`timeout ${r} of ms exceeded`,Te.ETIMEDOUT))},r);const s=()=>{t&&(l&&clearTimeout(l),l=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(i):h.removeEventListener("abort",i)}),t=null)};t.forEach(h=>h.addEventListener("abort",i));const{signal:u}=o;return u.unsubscribe=()=>he.asap(s),u}},nf=function*(t,r){let n=t.byteLength;if(!r||n<r){yield t;return}let o=0,a;for(;o<n;)a=o+r,yield t.slice(o,a),o=a},of=async function*(t,r){for await(const n of rf(t))yield*nf(n,r)},rf=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const r=t.getReader();try{for(;;){const{done:n,value:o}=await r.read();if(n)break;yield o}}finally{await r.cancel()}},Jl=(t,r,n,o)=>{const a=of(t,r);let i=0,l,s=u=>{l||(l=!0,o&&o(u))};return new ReadableStream({async pull(u){try{const{done:h,value:d}=await a.next();if(h){s(),u.close();return}let m=d.byteLength;if(n){let c=i+=m;n(c)}u.enqueue(new Uint8Array(d))}catch(h){throw s(h),h}},cancel(u){return s(u),a.return()}},{highWaterMark:2})},Yl=64*1024,{isFunction:or}=he,af=(({Request:t,Response:r})=>({Request:t,Response:r}))(he.global),{ReadableStream:es,TextEncoder:ts}=he.global,ns=(t,...r)=>{try{return!!t(...r)}catch{return!1}},lf=t=>{t=he.merge.call({skipUndefined:!0},af,t);const{fetch:r,Request:n,Response:o}=t,a=r?or(r):typeof fetch=="function",i=or(n),l=or(o);if(!a)return!1;const s=a&&or(es),u=a&&(typeof ts=="function"?(f=>b=>f.encode(b))(new ts):async f=>new Uint8Array(await new n(f).arrayBuffer())),h=i&&s&&ns(()=>{let f=!1;const b=new n(pt.origin,{body:new es,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!b}),d=l&&s&&ns(()=>he.isReadableStream(new o("").body)),m={stream:d&&(f=>f.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!m[f]&&(m[f]=(b,p)=>{let x=b&&b[f];if(x)return x.call(b);throw new Te(`Response type '${f}' is not supported`,Te.ERR_NOT_SUPPORT,p)})});const c=async f=>{if(f==null)return 0;if(he.isBlob(f))return f.size;if(he.isSpecCompliantForm(f))return(await new n(pt.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(he.isArrayBufferView(f)||he.isArrayBuffer(f))return f.byteLength;if(he.isURLSearchParams(f)&&(f=f+""),he.isString(f))return(await u(f)).byteLength},y=async(f,b)=>{const p=he.toFiniteNumber(f.getContentLength());return p??c(b)};return async f=>{let{url:b,method:p,data:x,signal:g,cancelToken:C,timeout:_,onDownloadProgress:E,onUploadProgress:A,responseType:k,headers:B,withCredentials:D="same-origin",fetchOptions:w}=Zl(f),v=r||fetch;k=k?(k+"").toLowerCase():"text";let S=tf([g,C&&C.toAbortSignal()],_),I=null;const R=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let z;try{if(A&&h&&p!=="get"&&p!=="head"&&(z=await y(B,x))!==0){let N=new n(b,{method:"POST",body:x,duplex:"half"}),T;if(he.isFormData(x)&&(T=N.headers.get("content-type"))&&B.setContentType(T),N.body){const[O,F]=Kl(z,nr(Xl(A)));x=Jl(N.body,Yl,O,F)}}he.isString(D)||(D=D?"include":"omit");const $=i&&"credentials"in n.prototype,X={...w,signal:S,method:p.toUpperCase(),headers:B.normalize().toJSON(),body:x,duplex:"half",credentials:$?D:void 0};I=i&&new n(b,X);let W=await(i?v(I,w):v(b,X));const K=d&&(k==="stream"||k==="response");if(d&&(E||K&&R)){const N={};["status","statusText","headers"].forEach(q=>{N[q]=W[q]});const T=he.toFiniteNumber(W.headers.get("content-length")),[O,F]=E&&Kl(T,nr(Xl(E),!0))||[];W=new o(Jl(W.body,Yl,O,()=>{F&&F(),R&&R()}),N)}k=k||"text";let P=await m[he.findKey(m,k)||"text"](W,f);return!K&&R&&R(),await new Promise((N,T)=>{Gl(N,T,{data:P,headers:Xt.from(W.headers),status:W.status,statusText:W.statusText,config:f,request:I})})}catch($){throw R&&R(),$&&$.name==="TypeError"&&/Load failed|fetch/i.test($.message)?Object.assign(new Te("Network Error",Te.ERR_NETWORK,f,I),{cause:$.cause||$}):Te.from($,$&&$.code,f,I)}}},sf=new Map,os=t=>{let r=t&&t.env||{};const{fetch:n,Request:o,Response:a}=r,i=[o,a,n];let l=i.length,s=l,u,h,d=sf;for(;s--;)u=i[s],h=d.get(u),h===void 0&&d.set(u,h=s?new Map:lf(r)),d=h;return h};os();const ua={http:Bd,xhr:ef,fetch:{get:os}};he.forEach(ua,(t,r)=>{if(t){try{Object.defineProperty(t,"name",{value:r})}catch{}Object.defineProperty(t,"adapterName",{value:r})}});const rs=t=>`- ${t}`,cf=t=>he.isFunction(t)||t===null||t===!1;function uf(t,r){t=he.isArray(t)?t:[t];const{length:n}=t;let o,a;const i={};for(let l=0;l<n;l++){o=t[l];let s;if(a=o,!cf(o)&&(a=ua[(s=String(o)).toLowerCase()],a===void 0))throw new Te(`Unknown adapter '${s}'`);if(a&&(he.isFunction(a)||(a=a.get(r))))break;i[s||"#"+l]=a}if(!a){const l=Object.entries(i).map(([u,h])=>`adapter ${u} `+(h===!1?"is not supported by the environment":"is not available in the build"));let s=n?l.length>1?`since :
8
8
  `+l.map(rs).join(`
@@ -142,7 +142,7 @@
142
142
  query SalesforceActions($action: String!, $data: SalesforceData) {
143
143
  salesforceActions(action: $action, data: $data)
144
144
  }
145
- `,ui={retrieveBlock:"/composables/retrieveComposableConfig",retrieveMeta:"/composables/retrieveComposableConfig",fetchAccessToken:"/int/auth",cart:{getQuoteProducts:"/transactions/getQuoteProducts",getGroupedQuoteProducts:"/transactions/getGroupedQuoteProducts"},catalog:{getProductItems:"/getCatalogProducts",saveItemToQuoteBlink:"/transactions/saveItemToQuoteBlink",updateLines:"/transactions/updateLines",deleteQuoteLine:"/quoting/deleteQuoteLine",getLineItems:"/quoting/getConfiguredLineItems"},promocode:{getPromoCodes:"/promotions/getPromoCodes",applyPromoCode:"/promotions/applyPromocode"},fetch:{getRecord:"/platform/getHeaderRecord"},update:{upsertRecords:"/platform/upsertRecords"},tax:{calculateAvaTax:"/transactions/calculateTax"},common:{getLineItemAttributes:"/product-pricing/getLineItemAttributes"}};async function Ct({action:t,data:r,config:n={}}){var y,f;const o=ft(),a=n.accessToken??o.accessToken.value,i=n.salesforceOrgId??o.organizationId.value,l=n.userId??o.userId.value,s=n.orgType??o.composablesOrgType.value,u=n.baseUrl??o.composablesApiUrl.value,h=ui[n.pathKey]??ui[n.pathKey.split(".")[0]][n.pathKey.split(".")[1]];if(!h)throw new Error(`Invalid pathKey: ${n.pathKey}. Available keys: ${Object.keys(ui).join(", ")}`);const d=`${u}${h}`;if(!i&&n.pathKey!=="fetchAccessToken")throw new Error("salesforceOrgId is required. Provide it in config or set it via useComposableStore.updateConfig()");let m;t?m={action:t,data:r}:m=r;const c={"Content-Type":"application/json"};if(a&&(c.Authorization=`Bearer ${a}`),i&&(c["X-Salesforce-Org-Id"]=i),s&&(c["X-Salesforce-Org-Type"]=s),l&&(c["X-Salesforce-User-Id"]=l),!d)throw new Error("composablesApiUrl is required. Provide it in props or set it via useComposableStore.updateConfig()");try{console.log(`[COMPOSABLES_API:${t||"no-action"}] request`,JSON.stringify(m)),console.log(`[COMPOSABLES_API:${t||"no-action"}] headers`,c);const b=await Ue.post(d,m,{headers:c});if(console.log(`[COMPOSABLES_API:${t||"no-action"}] response`,b.data),!t&&((y=b.data)!=null&&y.data)&&typeof b.data.data=="string")try{b.data=JSON.parse(b.data.data)}catch(p){console.warn("[COMPOSABLES_API] Failed to parse data field:",p)}else if(!t&&((f=b.data)!=null&&f.data)&&typeof b.data.data=="object")try{b.data=b.data.data}catch(p){console.warn("[COMPOSABLES_API] Failed to parse content field:",p)}return b.data}catch(b){throw console.error(`[COMPOSABLES_API:${t||"no-action"}] error:`,b),b}}const Qn="https://d2pgvmpph8dmlo.cloudfront.net";function hc(t,r,n){return t?t==null?void 0:t.map(o=>d4(o,r,n)):[]}function d4(t,r,n){const{url:o,staticResource:a}=t;if(!o)return null;if(o.includes("/resource/")&&!o.includes("://")&&a){const i=o.split("/"),l=i[i.length-1];return`${Qn}/${n}/static/${l}.${r}`}else return o}const Co=it.defineStore("blockLegacy",()=>{const t=ft(),r=e.ref(null),n=e.ref(null),o=e.ref(!1),a=e.ref(null);async function i(d,m=!0){var f,b;if(console.info("fetchBlockInformation templateId:",d.templateId),!d.templateId)return;m&&(r.value=[],o.value=!1);const c={storefrontId:d.storefrontId,templateId:d.templateId};console.log("fetchBlockInformation variables",JSON.stringify(c)),console.log("fetchBlockInformation getTemplateBlock",dc);const y=await br(dc,c);if(console.log("fetchBlockInformation getTemplateBlockResponse",y),console.log("fetchBlockInformation pageBlocks",r.value),n.value=d.templateId,m)(f=y.content)!=null&&f.blocks?(r.value=l(JSON.parse(y.content.blocks)),console.log("fetchBlockInformation pageBlocks 1",r.value)):r.value=[],o.value=!0;else return((b=y==null?void 0:y.content)==null?void 0:b.blocks)||[]}function l(d){const m=t.organizationId.value;return d==null||d.forEach(c=>{c.blocks=c.blocks?JSON.parse(c.blocks):[],c.blocks.forEach(y=>{var f,b;Object.assign(y,JSON.parse(y.contentJSON)),y.contentJSON=null,y.id=y.blockId||y.Id,(y.componentName==="catalogBlock"||y.componentName==="relatedProducts")&&(s(y.fields.productCard.actions),y.fields.noFriendlyURL=!0,y.fields.productCard.friendlyURL=null,y.fields.productCard.friendlyURLFields=null,(f=y.configuration)!=null&&f.productTemplateId?y.fields.productCard.url="/product/"+((b=y.configuration)==null?void 0:b.productTemplateId):y.fields.productCard.url=null),y.componentName==="productSummary"&&(console.log("block.fields.actions",y.fields.actions),s(y.fields.actions)),y.customJS&&(y.customJS=hc(y.customJS,"js",m)),y.customCSS&&(y.customCSS=hc(y.customCSS,"css",m))})}),d}function s(d){d.forEach(m=>{m.action==="CUSTOM_ACTION"&&(m.action="CUSTOM",m.name=m.label.title,m.value=m.url.field||m.url.title,m.newTab=m.openInNewTab)})}async function u(d,m=!0){var c,y,f;if(console.info("fetchBlockInformationREST templateId:",d.templateId),!!d.templateId){m&&(r.value=[],o.value=!1);try{const b=await Ct({action:"retrieveBlock",data:{salesforceOrgId:t.organizationId.value,storefrontId:d.templateId,templateId:"wrapperDefault"},config:{pathKey:"retrieveBlock"}});n.value=d.templateId;const p=((y=(c=b==null?void 0:b.data)==null?void 0:c[0])==null?void 0:y.blocks)??((f=b==null?void 0:b.data)==null?void 0:f.blocks);if(console.log("fetchBlockInformationREST blocksData",p),m){if(p){const x=typeof p=="string"?JSON.parse(p):p;console.log("fetchBlockInformationREST parsedBlocks",x),r.value=l(x),console.log("fetchBlockInformationREST pageBlocks",r.value)}else console.log("fetchBlockInformationREST blocksData is null"),r.value=[];o.value=!0}else return p||[]}catch(b){throw console.error("fetchBlockInformationREST error:",b),m&&(r.value=[],o.value=!0),b}}}return{metaInfo:a,currentPageId:n,pageBlocks:r,blockLoaded:o,fetchBlockInformation:i,fetchBlockInformationREST:u,getFormattedSectionBlocks:d=>e.computed(()=>{const m=[];return r.value&&r.value.length>0&&r.value.forEach(c=>{const y=c.blocks;y&&y.length>0&&y.forEach(f=>{if(f.id=f.blockId,d){const b=["checkoutAccount","shippingAddress","shippingMethod","customForm","termsAndPayment","quoteSummary","customCode"];console.log("section.sectionName",c.sectionName,f.componentName),f&&f.configuration&&(b.includes(f.componentName)||f.configuration.isCheckoutBlock)&&m.push(f)}else f&&f.configuration&&!d&&m.push(f)})}),m})}}),qn=async(t,r=null,n="",o=!1)=>{const a=ft();console.log("appsyncHandler composableStore",a);const i=a.graphqlEndpoint.value,l=a.apiKey.value;let s=200,u;const h=a.hostName.value;console.log("appsyncHandler currentHostname",h);const d=fi();try{const m=r;let c="";d.activeStorefrontInfo&&d.activeStorefrontInfo.accountId&&!c&&(c=d.activeStorefrontInfo.accountId),m.data&&d.activeStorefrontInfo&&!t.includes("CognitoActions")&&!t.includes("query listUsers")&&(m.data.userType=d.activeStorefrontInfo.userType,m.data.accountId=c,m.data.domain=h);const y=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":l},body:JSON.stringify({query:t,variables:m})});if(u=await(y==null?void 0:y.json()),u=u.data,n)u=JSON.parse(u[n]),s=Number(u.statusCode),u=u.content,s===401&&console.info("401",t,JSON.stringify(r));else if(t.includes("SalesforceActions")){let f=u;f=JSON.parse(u.salesforceActions),f.statusCode==="401"&&console.info("401",t,JSON.stringify(r),u)}}catch(m){console.log(m),s=400,u=m}return{statusCode:s,response:u}},di=["Needs Configuration","Suggests Configuration","Upload Configuration"],f4=["Upload","Upload Add","Upload Configuration"],h4=["No Configuration","Suggests Configuration","Upload Add","",null,void 0],p4=["CONFIGURE","UPLOAD","ADD_TO_CART"],m4=new Map([["Full","Full"],["FULL","Full"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","Default"],["ECATALOG_ACCOUNT_CUSTOM","Alternate"],["ECATALOG_OVERRIDE","Override"]]),y4=new Map([["Full","Item"],["FULL","Item"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","eCatalog"],["ECATALOG_ACCOUNT_CUSTOM","eCatalog"],["ECATALOG_OVERRIDE","eCatalog"]]),Eo=(t,r,n=!1)=>{const o=Mt();let a,i,l;return n?(i=t.statusCode,l=t.content):(a=JSON.parse(t.response.salesforceActions),i=a.statusCode,l=a.content),Number(i)===200&&l&&l.message&&typeof l.message=="string"&&l.message.startsWith("ERROR:")?(o.handleError(l.message,"useExtractContent"),!1):Number(i)!==200||t.statusCode!==200||typeof l=="string"&&l.includes("ERROR:")||typeof l=="string"&&l.includes("Error:")||l.errorCode==="APEX_ERROR"?(l.errorCode==="APEX_ERROR"?o.handleError(l.message,"useExtractContent"):r||o.handleError(l,"useExtractContent"),!1):l},Zn=new Map;function Lt(t,r){return Zn.has(t)||Zn.set(t,new Set),Zn.get(t).add(r),()=>{g4(t,r)}}function g4(t,r){const n=Zn.get(t);n&&(n.delete(r),n.size===0&&Zn.delete(t))}function Et(t,r){const n=Zn.get(t);!n||n.size===0||Array.from(n).forEach(o=>{try{o(r)}catch{}})}const mn=it.defineStore("catalog",()=>{const t=ft(),r=e.ref(!1),n=e.ref(0),o=e.ref(null),a=e.ref(null),i=e.ref([]),l=e.ref({}),s=e.ref({}),u=e.ref(null),h=e.ref(null),d=e.ref(!1),m=e.ref({search:""}),c=e.ref({qliRecords:!0,quoteCreate:!1,quoteDetails:!1}),y=e.computed(()=>t.accountId.value),f=e.computed(()=>({domain:t.hostName.value,accountId:y.value,userType:t.userId.value})),b=e.computed(()=>{const $=Array.isArray(i.value)?i.value:[],X={"Needs Configuration":1,"Suggests Configuration":2,"Fully Configured":3},W=N=>(N==null?void 0:N.XX_ORD1__SYS_Configuration_Status2__c)||(N==null?void 0:N.xx_ord1__sys_configuration_status2__c)||"",K=N=>N in X,P=$.filter(N=>K(W(N)));return P.sort((N,T)=>{const O=W(N),F=W(T);return(X[O]||99)-(X[F]||99)}),P});function p(){const $=b.value||[];return $.length?$[0]:null}function x($="true"){j0(`qreset-${o.value}`,$)}async function g($){try{const X={objectType:"XX_ORD1__Quote_Line_Item__c",qliIds:Array.isArray($)?$:[$]},W=await Ct({data:X,config:{pathKey:"catalog.deleteQuoteLine"}});return n.value=Math.max(0,(n.value||0)-1),v(!0),console.log("[CATALOG:deleteLineItems] success",W),x(),Et("catalog:line-deleted",{quoteId:(t==null?void 0:t.quoteId.value)||null,qliIds:X.qliIds,response:W}),W}catch(X){console.log("[CATALOG:deleteLineItems] error",X),x();return}}async function C($){var O,F;if(!$.qty)return;const X=t.quoteId.value;if(!X)return;$.retry=1;const W={...$,quoteid:X},K={action:"makeCall",data:{...f.value,callType:"POST",endpoint:"/services/apexrest/XX_ORD1/ecommerce?type=updateQLI&ut="+t.userId.value,payload:JSON.stringify(W)}},P=await qn(wn,K,void 0,!0),N=(F=(O=P.response)==null?void 0:O.salesforceActions)==null?void 0:F.toLowerCase();(N.includes("record currently unavailable")||N.includes("unable_to_lock_row"))&&$.retry<3&&setTimeout(()=>{$.retry+=1,C($)},500),Eo(P)&&v(!0),x()}async function _($){var K,P,N,T,O;const X=t==null?void 0:t.quoteId.value;Array.isArray($)&&($=$[0]);const W={itemId:$.itemID,eCatalogItemId:$.eCatalogItemID,quantity:$.qty,accountId:y.value,qtyTierAmt:($==null?void 0:$.qtyTierAmt)??null};X&&(W.quoteId=X);try{const F=await Ct({data:W,config:{pathKey:"catalog.saveItemToQuoteBlink"}}),q=(F==null?void 0:F.quoteId)||((K=F==null?void 0:F.data)==null?void 0:K.quoteId)||((N=(P=F==null?void 0:F.data)==null?void 0:P.quote)==null?void 0:N.Id);q&&q!==X&&(o.value=q,t.updateConfig({quoteId:q}));const M=((T=F==null?void 0:F.data)==null?void 0:T.QliId)||(F==null?void 0:F.QliId)||null,U=$==null?void 0:$.itemID,L=$==null?void 0:$.qty;if(M&&U){const j=s.value?s.value[U]:null;s.value={...s.value||{},[U]:{...j||{},Id:M,XX_ORD1__Item__c:U,XX_ORD1__QTY__c:typeof L=="number"?L:(j==null?void 0:j.XX_ORD1__QTY__c)||0}}}return v(!0),x(),Et("catalog:item-added",{itemId:W.itemId,eCatalogItemId:W.eCatalogItemId||null,quantity:W.quantity,quoteId:(t==null?void 0:t.quoteId.value)||q||null,qliId:((O=F==null?void 0:F.data)==null?void 0:O.QliId)||(F==null?void 0:F.QliId)||null,response:F}),F}catch(F){console.log("[CATALOG:saveItemToQuoteBlinkTxn] error",F),x();return}}async function E({itemId:$,qty:X,qliId:W,eCatalogItemId:K}={}){var T,O,F,q,M;if(console.log("updateQuoteLineQtyTxn",{itemId:$,qty:X,qliId:W,eCatalogItemId:K}),!X&&X!==0)return;let P=W||((O=(T=s.value)==null?void 0:T[$])==null?void 0:O.Id);if(P||(await S(!0),P=W||((q=(F=s.value)==null?void 0:F[$])==null?void 0:q.Id)),!P){if(X>0&&$&&K)return console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id, saving item first",{itemId:$,eCatalogItemId:K}),await _({itemID:$,eCatalogItemID:K,qty:X,qtyTierAmt:null});console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id for item",{itemId:$});return}const N={uniqueField:"",objectType:"XX_ORD1__Quote_Line_Item__c",records:[{fields:[{fieldName:"Id",fieldValue:P},{fieldName:"XX_ORD1__QTY__c",fieldValue:X}]}]};try{const U=await Ct({data:N,config:{pathKey:"catalog.updateLines"}});if($){const L=((M=s.value)==null?void 0:M[$])||{};s.value={...s.value||{},[$]:{...L,Id:P,XX_ORD1__Item__c:$,XX_ORD1__QTY__c:X}}}return v(!0),x(),Et("catalog:item-qty-updated",{itemId:$,qliId:P,quantity:X,eCatalogItemId:K||null,quoteId:(t==null?void 0:t.quoteId.value)||null,response:U}),U}catch(U){console.log("[CATALOG:updateQuoteLineQtyTxn] error",U),x();return}}async function A($,X,W){var F;const K=W==="Item",P=[],N=(($==null?void 0:$.searchText)||"").toString().trim(),T=Array.isArray($==null?void 0:$.fields)?$.fields:[];Array.isArray($==null?void 0:$.filters)&&$.filters,$==null||$.filterLogic;const O={searchPL:N,origin:"genesis_ai",userId:(t==null?void 0:t.userId.value)||"",orgId:(t==null?void 0:t.organizationId.value)||"",orgType:"Production",requestId:vn(),quoteId:(t==null?void 0:t.quoteId.value)||"",accountId:(t==null?void 0:t.accountId.value)||"",numberOfRecords:($==null?void 0:$.numberOfRecords)||($==null?void 0:$.rowLimit)||10,fields:T,filters:($==null?void 0:$.whereCondition)||[]};try{const q=await Ct({data:O,config:{pathKey:"catalog.getProductItems"}});if(!q||!q.selected_products||typeof q.selected_products!="object")return console.warn("[CATALOG:getProductItems] Invalid response structure",{responseObj:q}),{items:[],count:0};const M=q.selected_products,U=Object.values(M).map(j=>{var H;return(H=j==null?void 0:j.catalogResponse)==null?void 0:H.productInfo}).filter(Boolean);U.forEach(j=>{var ne,Q,ce,ue;const H=JSON.parse(JSON.stringify(X)),Z=We(j,K?"XX_ORD1__Friendly_URL__c":"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),te=We(j,K?"XX_ORD1__SYS_Requires_Configuration__c":"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c");K?H.itemId=j.Id:(H.itemId=j.XX_ORD1__Item__c,H.catalogItemId=j.Id),H.thumbnail.value=H.thumbnail.field&&!H.thumbnail.isStatic?We(j,H.thumbnail.field):"",H.title.value=H.title.field&&!H.title.isStatic?We(j,H.title.field):"",H.description.value=H.description.field&&!H.description.isStatic?We(j,H.description.field):"",(ne=H.attributes)==null||ne.forEach(pe=>{pe.value.field&&(pe.value.value=We(j,pe.value.field,pe.value.dataType)||"-"),pe.label.field&&(pe.label.value=We(j,pe.label.field,pe.label.dataType)||"-")}),H.requiresConfiguration=te,H.actions=H.actions.filter(({action:pe})=>pe==="ADD_TO_CART"&&h4.includes(te)||pe==="CONFIGURE"&&di.includes(te)||pe==="UPLOAD"&&f4.includes(te)||!p4.includes(pe)),(Q=H.actions)==null||Q.forEach(pe=>{if(pe.action==="CUSTOM"){const{url:ie,label:de}=pe;ie.isStatic||(ie.value=We(j,ie.field)),de.isStatic||(de.value=We(j,de.field))}}),((ce=H.friendlyURLFields)==null?void 0:ce.length)>0&&Z?((ue=H.friendlyURLFields)==null||ue.forEach(pe=>{H.friendlyURL=H.friendlyURL.replace(`{!${pe}}`,We(j,pe))}),H.friendlyURL="/"+H.friendlyURL+"/"+Z):H.url&&(H.friendlyURL=H.url+"/"+j.Id),H.friendlyURL&&(H.friendlyURL=H.friendlyURL.replace(/\/{2,}/g,"/")),P.push(H)});const L=Number(((F=q==null?void 0:q.data)==null?void 0:F.totalCount)||U.length)||0;return{items:P,count:L>2e3?2e3:L}}catch(q){console.log("[CATALOG:getProductItems] new API error",q);return}}async function k($){var P;console.log("[CATALOG:getEcatalogDetails] jsonData",$),$.accountID=t.accountId.value;const X={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getEcatalogDetails&ut=${t.userId.value}`,payload:JSON.stringify($)}},W=await qn(wn,X),K=Eo(W);if(K!==!1)return(P=JSON.parse(K))==null?void 0:P.recordData}async function B($,X=()=>{}){$.accountID=t.accountId.value||"";const W={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogGroupCounts&ut=${t.userId.value}`,payload:JSON.stringify($)}},K=await qn(wn,W,void 0,!0),P=JSON.parse(JSON.parse(K.response.salesforceActions).content);return X(P),P}async function D($,X=()=>{}){const W={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogPicklistGroupCounts&ut=${t.userId.value}`,payload:JSON.stringify($)}},K=await qn(wn,W,void 0,!0);return X(JSON.parse(JSON.parse(K.response.salesforceActions).content)),JSON.parse(JSON.parse(K.response.salesforceActions).content)}async function w(){var P,N,T,O,F,q;console.log("[CATALOG:getObjectDetails] start",{currentQuoteId:o.value,payload:f.value});const $=t.quoteId.value;if(console.log("[CATALOG:getObjectDetails] qtId",$),$)console.log("[CATALOG:getObjectDetails] Quote found!"+$),console.log("[CATALOG:getObjectDetails] Quote found",$);else{console.log("[CATALOG:getObjectDetails] No quote found!"),console.warn("[CATALOG:getObjectDetails] No quote found, aborting");return}const X={action:"makeCall",data:{...f.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getFormattedObjectDetails&objectapi=XX_ORD1__Quote__c&objectid=${$}`}};console.log("[CATALOG:getObjectDetails] request",X.data.endpoint),c.quoteDetails=!0,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> true");const W=await qn(wn,X,void 0,!0);console.log("[CATALOG:getObjectDetails] response received",{hasResponse:!!(W!=null&&W.response),len:String(((P=W==null?void 0:W.response)==null?void 0:P.salesforceActions)||"").length});const K=Eo(W,!0);return console.log("[CATALOG:getObjectDetails] extracted content",{hasContent:!!K}),c.quoteDetails=!1,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> false"),K?(l.value=JSON.parse(K),console.log("[CATALOG:getObjectDetails] quoteRecord set",{id:(N=l.value)==null?void 0:N.Id,accountName:(T=l.value)==null?void 0:T.XX_ORD1__Account_Name__c,checkedOut:(O=l.value)==null?void 0:O.XX_ORD1__Checked_Out__c}),t.quoteAccount=(F=l.value)==null?void 0:F.XX_ORD1__Account_Name__c,l.value.XX_ORD1__Checked_Out__c?(console.warn("[CATALOG:getObjectDetails] Quote is already checked out, resetting quoteId"),r.value=!0,console.log("[CATALOG:getObjectDetails] end (checked out) -> false"),!1):(console.log("[CATALOG:getObjectDetails] end (success)",{id:(q=l.value)==null?void 0:q.Id}),l.value)):(console.warn("[CATALOG:getObjectDetails] no content returned, resetting quoteId",{qtId:$}),console.log("[CATALOG:getObjectDetails] end (no content) -> false"),!1)}const v=St(S,500);async function S($=!1){var K;console.log("[CATALOG:getQuoteItems] start",{noLoad:$}),c.value.qliRecords=!$;const X=t.quoteId.value;if(console.log("[CATALOG:getQuoteItems] qtId",X),!X){console.log("[CATALOG:getQuoteItems] No quote found!"),c.value.qliRecords=!1,console.warn("[CATALOG:getQuoteItems] No quote found, aborting");return}const W={objectId:X};try{const P=await Ct({data:JSON.stringify(W),config:{pathKey:"catalog.getLineItems"}}),N=((K=P==null?void 0:P.data)==null?void 0:K.products)||(P==null?void 0:P.products)||[],T=[],O={};N.forEach(F=>{const q=F==null?void 0:F.productLineItem;q&&(T.push(q),q.XX_ORD1__Item__c&&(O[q.XX_ORD1__Item__c]=q)),(Array.isArray(F==null?void 0:F.options)?F.options:[]).forEach(U=>{T.push(U),U.XX_ORD1__Item__c&&(O[U.XX_ORD1__Item__c]=U)})}),i.value=T,s.value=O,n.value=T.length,c.value.qliRecords=!1,console.log("[CATALOG:getQuoteItems] end (success)",{count:T.length}),Et("catalog:items-fetched",{quoteId:X,items:i.value,count:n.value})}catch(P){console.warn("[CATALOG:getQuoteItems] error",P),c.value.qliRecords=!1}}async function I($){console.log("[CATALOG:getSavedFilter] ecfr",$);const X={action:"makeCall",data:{...f.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getSavedFilter&ut=${t.userId.value}&ecfr=${$}`}},W=await qn(wn,X,void 0,!0),K=Eo(W);return K?(console.log("[CATALOG:getSavedFilter] Saved Filters",K),JSON.parse(K)):!1}async function R(){var K;console.log("[CATALOG:calculateAvaTax]"),h.value=null;const $=t.quoteId.value;if(!$)return;(K=l.value)!=null&&K.Id||await w();const X=l.value;if(X.XX_ORD1__Shipping_Address__c&&X.XX_ORD1__Shipping_City__c&&X.XX_ORD1__Shipping_Country__c&&X.XX_ORD1__Shipping_State__c&&X.XX_ORD1__Shipping_Zip__c){const P={recordId:$,isCommit:!1},N={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=calculateAvaTax&ut=${t.userId.value}`,payload:JSON.stringify(P)}};d.value=!0;const T=await qn(wn,N,void 0,!0),O=Eo(T);if(O)console.log("[CATALOG:calculateAvaTax] content",O);else{const F=JSON.parse(T.response.salesforceActions).content;h.value=F}d.value=!1}else console.log("[CATALOG:calculateAvaTax] Shipping address not found so tax can not be calculated")}function z($,X,W=!0){const K=X.qtyTiers;if(!K)return null;const P=K.find(N=>N.ev===null?$>=N.sv:$>=N.sv&&$<=N.ev);return P?W?P.formattedOfferPrice:P.originalPrice:null}return{quoteCheckedOut:r,avaTaxError:h,avaTaxLoading:d,cartCount:n,cartUpdated:x,quoteId:o,loading:c,filter:m,quoteRecord:l,secondQuoteId:a,qliRecords:i,savedItems:s,savedFilter:u,getObjectDetails:w,getSavedFilter:I,saveItemToQuoteBlinkTxn:_,updateQuoteLineQtyTxn:E,deleteLineItems:g,getPicklistFilterData:D,getQuoteItems:S,updateCart:C,getFilterData:B,getProductItems:A,calculateAvaTax:R,getEcatalogDetails:k,getVolumePrice:z,configurableItemsSorted:b,getTopConfigurableItem:p,getQuoteItems:S}}),fi=it.defineStore("composableCatalog",()=>{const t=Co();mn();const r=Mt(),n=ft(),o=e.ref(!0),a=e.ref({accountId:"",contactId:"",userType:"",domain:"",locale:"en-US"}),i=e.ref({}),l=e.ref(""),s=e.ref(""),u=e.ref(""),h=e.ref(""),d=e.ref(""),m=e.ref(""),c=e.ref(null),y=e.ref(!1),f=e.computed(()=>h.value+"::"+d.value);async function b(){c.value=null,y.value=!0;try{const B={domain:n.hostName.value,templateBlocksFilter:{templateId:{eq:"wrapperDefault"}}},D=Date.now().toString(),w=await Ue.post(`${n.graphqlEndpoint.value}?t=${D}`,{query:u4,variables:B},{headers:{"Content-Type":"application/json","x-api-key":n.apiKey.value,"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0","X-Cache-Bust":D},withCredentials:!1});console.log("[COMPOSABLECATALOG:fetchDomainDetails] response",w);const v=w&&w.data?w.data:null;console.log("[COMPOSABLECATALOG:fetchDomainDetails] payload",v);const S=v&&v.data&&v.data.dataByDomain&&Array.isArray(v.data.dataByDomain.items)?v.data.dataByDomain.items:[],I=S.length?S[0]:null;return console.log("[COMPOSABLECATALOG:fetchDomainDetails] item",I),console.log("[COMPOSABLECATALOG:fetchDomainDetails] storefrontDetails",i.value),i.value=I,a.value={accountId:I.guestAccountId,contactId:"",userType:"AWSGuest",domain:I.domain,locale:"en-US"},h.value=I.organization.salesforceOrgId,d.value=I.storefrontId,I}catch(B){throw console.info("[COMPOSABLECATALOG:fetchDomainDetails] Error fetching domain",B),c.value=B&&B.message?B.message:"Unknown error",B}finally{y.value=!1}}function p(B){s.value=(B==null?void 0:B.templateId)??"",u.value=(B==null?void 0:B.quoteId)??"",m.value=(B==null?void 0:B.userId)??""}function x(B){u.value=B}function g(B){i.value=B}async function C(){try{await t.fetchBlockInformation({templateId:s.value,storefrontId:d.value},!0)}catch(B){r.handleError(B,"getBlockInformation")}}const _=async()=>{var B,D;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!d.value)try{const w=await br(fc,{storefrontId:d.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",w),((D=(B=w.content)==null?void 0:B.items)==null?void 0:D[0])??null}catch(w){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",w)}},E=()=>{if(typeof document>"u")return;const B=h.value,D=d.value;if(!B||!D)return;const w=`${Qn}/${B}/${D}/css/theme_${D}.css`;let v=!1;if(typeof window<"u"&&window.VueExpediteComponents&&typeof window.VueExpediteComponents.applyThemeToShadows=="function")try{window.VueExpediteComponents.applyThemeToShadows(w),v=!0}catch($){console.warn("[COMPOSABLECATALOG:setThemeData] shadow injection failed; will inject in head",$)}let S="";try{S=new URL(n.graphqlEndpoint.value).origin}catch{}const I=typeof window<"u"?window.location.href:"",R=($,X={})=>{const W=document.head||document.getElementsByTagName("head")[0];if(!W)return;let K=document.getElementById($);K||(K=document.createElement("link"),K.id=$,W.appendChild(K)),Object.entries(X).forEach(([P,N])=>{N!=null&&K.setAttribute(P,String(N))})};(($,X,W=!0)=>{const K=document.head||document.getElementsByTagName("head")[0];if(!K||document.getElementById($))return;const P=document.createElement("script");P.id=$,P.src=X,W&&(P.async=!0),K.appendChild(P)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),R("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),S&&R("ec-preconnect-appsync",{rel:"preconnect",href:S}),v||R("ec-theme-stylesheet",{rel:"stylesheet",href:w}),R("ec-google-fonts",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Symbols+Outlined|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Montserrat:300,400,500,600,700,800|Roboto:300,400,500,600,700,800|Abel|Caveat:400,700|Titillium+Web:400,600,700"}),I&&R("ec-canonical",{rel:"canonical",href:I}),R("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${Qn}/expedite/Expedite_Favicon.ico`})};function A(){return!0}function k(){s.value="",u.value="",h.value="",d.value="",m.value=""}return{templateId:s,isLoading:o,activeStorefrontInfo:a,quoteAccount:l,storefrontDetails:i,salesforceOrgId:h,storefrontId:d,userId:m,orgWithStorefrontId:f,useVisiblity:A,fetchDomainDetails:b,setData:p,setQuoteId:x,setStorefrontDetails:g,getBlockInformation:C,getTheme:_,setThemeData:E,reset:k}}),b4=t=>{const r=t.match(/query\s+(\w+)/);return r?r[1]:null},x4=t=>t.replace(/[-_\s]+/g," ").trim().replace(/^(.)/,(r,n)=>n.toLowerCase()).replace(/\s(\w)/g,(r,n)=>n.toUpperCase()).replace(/\s/g,""),pc=t=>{try{JSON.parse(t)}catch{return!1}return!0},hi=new Map,br=async(t,r=null)=>{var s,u,h;const n=fi(),o=ft();let a=200,i,l;try{const d=r,m=o.accountId.value||"";d.data&&n.activeStorefrontInfo&&!t.includes("CognitoActions")&&!t.includes("GetLoginInfo")&&!t.includes("query listUsers")&&!t.includes("UserActivityLog")&&(d.data.userType=((s=n.activeStorefrontInfo)==null?void 0:s.userType)||"",d.data.accountId=m||((u=n.activeStorefrontInfo)==null?void 0:u.accountId)||"",d.data.domain=o.hostName.value),!t.includes("GetLoginInfo")&&!t.includes("CognitoActions")&&!t.includes("query listUsers")&&!t.includes("UserActivityLog")&&(d.data={...d.data,domain:o.hostName.value});const c=c4([t,d,m]);if(hi.has(c))i=hi.get(c);else try{const b=await Ue.post(o.graphqlEndpoint.value,{query:t,variables:d},{headers:{"Content-Type":"application/json","x-api-key":o.apiKey.value}});if(!b.data)return{statusCode:500,content:"Error fetching data from AppSync."};i=b.data.data,hi.set(c,i)}catch(b){const p=((h=b==null?void 0:b.response)==null?void 0:h.status)||500;return p===401&&console.info("401",t,r),{statusCode:p,content:"Error fetching data from AppSync."}}const y=b4(t);if(!y)return{statusCode:404,content:"Query name not found, improper request."};const f=x4(y);i=i[f],pc(i)&&(i=JSON.parse(i)),i&&i.statusCode&&i.statusCode===401&&console.info("401",t,r),l=i!=null&&i.content?i.content:i,pc(l)&&(l=JSON.parse(l))}catch(d){a=400,l=d}return{statusCode:a,content:l}},xr=e.ref(""),mc=e.ref(""),pi=e.ref(""),yc=e.ref(""),mi=e.ref(""),ko=e.ref(""),vo=e.ref(""),gc=e.ref(""),bc=e.ref(""),xc=e.ref(""),_c=e.ref(""),yi=e.ref(""),Cc=e.ref(""),_4=e.ref(!1),C4=e.ref(null),E4=e.ref(null),Ec=e.ref(""),kc=e.ref(""),vc=e.ref(""),Ac=e.ref(""),wc=e.ref("");function ft(){function t(s){s.templateId!==void 0&&(xr.value=s.templateId),s.hostName!==void 0&&(mc.value=s.hostName),s.graphqlEndpoint!==void 0&&(pi.value=s.graphqlEndpoint),s.apiKey!==void 0&&(yc.value=s.apiKey),s.accountId!==void 0&&(mi.value=s.accountId),s.organizationId!==void 0&&(ko.value=s.organizationId),s.storefrontId!==void 0&&(vo.value=s.storefrontId),s.cid!==void 0&&(gc.value=s.cid),s.userId!==void 0&&(bc.value=s.userId),s.composablesApiUrl!==void 0&&(xc.value=s.composablesApiUrl),s.composablesApiKey!==void 0&&(_c.value=s.composablesApiKey),s.accessToken!==void 0&&(yi.value=s.accessToken),s.composablesOrgType!==void 0&&(Cc.value=s.composablesOrgType),s.isPreview!==void 0&&(_4.value=s.isPreview),s.sections!==void 0&&(C4.value=s.sections),s.theme!==void 0&&(E4.value=s.theme),s.quoteId!==void 0&&(Ec.value=s.quoteId),s.websocketUrl!==void 0&&(kc.value=s.websocketUrl),s.packageVersion!==void 0&&(vc.value=s.packageVersion),s.eCatalogId!==void 0&&(Ac.value=s.eCatalogId),s.accountId!==void 0&&(mi.value=s.accountId),s.siteUrl!==void 0&&(wc.value=s.siteUrl)}const r=async()=>{var s,u;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!vo.value)try{const h=await br(fc,{storefrontId:vo.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",h),((u=(s=h.content)==null?void 0:s.items)==null?void 0:u[0])??null}catch(h){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",h)}},n=async()=>{var s,u,h;try{const d=await Ct({action:"retrieveMeta",data:{salesforceOrgId:ko.value,storefrontId:xr.value,templateId:"wrapper",key:"theme"},config:{pathKey:"retrieveMeta"}}),m=((u=(s=d==null?void 0:d.data)==null?void 0:s[0])==null?void 0:u.value)??((h=d==null?void 0:d.data)==null?void 0:h.value);return console.log("[COMPOSABLECATALOG:fetchThemeREST] themeData",m),m??null}catch(d){throw console.log("[COMPOSABLECATALOG:fetchThemeREST] Error getting theme data",d),d}};return{hostName:mc,graphqlEndpoint:pi,apiKey:yc,accountId:mi,organizationId:ko,storefrontId:vo,cid:gc,userId:bc,composablesApiUrl:xc,composablesApiKey:_c,accessToken:yi,composablesOrgType:Cc,quoteId:Ec,websocketUrl:kc,packageVersion:vc,eCatalogId:Ac,siteUrl:wc,updateConfig:t,getTheme:r,fetchThemeREST:n,setThemeData:()=>{if(typeof document>"u")return;const s=ko.value,u=vo.value;if(!s||!u)return;const h=`${Qn}/${s}/${u}/css/theme_${u}.css`;let d="";try{d=new URL(pi.value).origin}catch{}const m=typeof window<"u"?window.location.href:"",c=(f,b={})=>{const p=document.head||document.getElementsByTagName("head")[0];if(!p)return;let x=document.getElementById(f);x||(x=document.createElement("link"),x.id=f,p.appendChild(x)),Object.entries(b).forEach(([g,C])=>{C!=null&&x.setAttribute(g,String(C))})};((f,b,p=!0)=>{const x=document.head||document.getElementsByTagName("head")[0];if(!x||document.getElementById(f))return;const g=document.createElement("script");g.id=f,g.src=b,p&&(g.async=!0),x.appendChild(g)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),c("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),d&&c("ec-preconnect-appsync",{rel:"preconnect",href:d}),c("ec-theme-stylesheet",{rel:"stylesheet",href:h}),c("ec-google-fonts",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Symbols+Outlined|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Montserrat:300,400,500,600,700,800|Roboto:300,400,500,600,700,800|Abel|Caveat:400,700|Titillium+Web:400,600,700"}),m&&c("ec-canonical",{rel:"canonical",href:m}),c("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${Qn}/expedite/Expedite_Favicon.ico`})},processSections:async(s,u)=>{const h=Co();if(s&&u)try{const d=typeof u=="string"?JSON.parse(u):u;h.pageBlocks=d}catch(d){console.error("[ExpediteCart] Error parsing sections:",d)}else s||await h.fetchBlockInformationREST({templateId:xr.value||xr.value})},processTheme:async(s,u)=>{if(console.log("[COMPOSABLECATALOG:processTheme] isPreview",s),console.log("[COMPOSABLECATALOG:processTheme] theme",u),s&&u)try{return JSON.parse(u)}catch(h){return console.error("[ExpediteCart] Error parsing theme:",h),null}else if(!s)try{return await n()}catch(h){return console.error("[ExpediteCart] Error fetching theme:",h),null}return null},fetchAccessToken:async(s,u)=>{try{const h=(u==null?void 0:u.organizationId)||ko.value||"",d=(s==null?void 0:s.version)||"",m=s==null?void 0:s.awsExternalMSBaseURL;if(!m)throw new Error("awsExternalMSBaseURL is required in awsConnectionInfo");const c=await Ct({data:{Org_Id:h,Version:d},config:{baseUrl:m,pathKey:"fetchAccessToken"}});return console.log("fetchAccessToken - Response:",c),c!=null&&c.Access_Token&&(yi.value=c.Access_Token),c}catch(h){throw console.error("getAccessToken catch ::",h),console.error("Error details:",{message:h.message,stack:h.stack,name:h.name}),h}}}}const k4=["href"],v4=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons","data-name":"ec-material-icons"},null,-1),A4=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Outlined","data-name":"ec-material-icons-outlined"},null,-1),w4=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Round","data-name":"ec-material-icons-round"},null,-1),N4=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200","data-name":"ec-material-symbols-outlined"},null,-1),Nc={__name:"AtomThemeLoader",props:{organizationId:{type:String,required:!0},templateId:{type:String,required:!0},isPreview:{type:Boolean,required:!0},theme:{type:Object,required:!0}},setup(t){const r=t,n=ft(),o=e.ref(""),a=e.ref(""),i=async()=>{if(!(!r.organizationId||!r.templateId))try{const l=await n.processTheme(r.isPreview,r.theme);l&&(o.value=l),n.setThemeData();const s=Date.now(),u=`${Qn}/${r.organizationId}/${r.templateId}/css/theme_${r.templateId}.css?t=${s}`;console.log("[ATOMTHEMELOADER:loadTheme] styleURL",u),a.value=u}catch(l){console.error("[ATOMTHEMELOADER:loadTheme] Error loading theme",l)}};return e.onBeforeMount(()=>{i()}),e.watch(()=>[r.organizationId,r.templateId,r.isPreview,r.theme],()=>{i()},{deep:!0}),(l,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:0,"data-name":"template-theme"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value),1)]),_:1})):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("link",{key:1,rel:"stylesheet",href:a.value,"data-name":"ec-theme-stylesheet-link"},null,8,k4)):e.createCommentVNode("",!0),v4,A4,w4,N4],64))}},S4={KNOWLEDGE_DETAIL:"knowledgeDetail"},Sc={"Catalog Price":"XX_ORD1__Negotiated_Price__c","List Price":"XX_ORD1__List_Price2__c"},B4={name:"SkeletonLoader"},I4={class:"skeleton-loader"};function T4(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("div",I4)}const Qt=ve(B4,[["render",T4],["__scopeId","data-v-826b27ef"]]),Re=ve({__name:"AtomCustomTag",props:{tag:{type:String,default:null},text:{type:[String,Number,Boolean],default:"-"},type:{type:String,default:null},method:{type:String,default:null},style:{type:Object,default:()=>({})},secStyle:{type:Object,default:()=>({})},cssStyle:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},inherit:{type:[Array,String],default:()=>[]}},setup(t){const r=t,n={h1:"ecb-header-lvl-1",h2:"ecb-header-lvl-2",h3:"ecb-header-lvl-3",h4:"ecb-header-lvl-4",h5:"ecb-header-lvl-5",h6:"ecb-header-lvl-6",p:"ecb-text-regular",span:"ecb-text-small",strong:"ecb-text-strong",large:"ecb-text-large"},o=e.ref(!1),a=e.computed(()=>{if(r.text===null||r.text===void 0)return"";const u=String(r.text);return(u==null?void 0:u.replace(/\r\n|\n/g,"<br>"))||""}),i=e.computed(()=>{var h,d;const u=r.tag||((h=r.style)==null?void 0:h.tag)||((d=r.secStyle)==null?void 0:d.tag)||"p";return u==="large"||u==="strong"?"div":u}),l=e.computed(()=>{var h;const u=r.tag||((h=r.style)==null?void 0:h.tag)||"p";return n[u]||"ecb-text-regular"}),s=e.computed(()=>{var h,d;const u={};if(r.style&&((h=r.style)!=null&&h.overrite)){const{bold:m,color:c,italic:y,underline:f,strikethrough:b,strikeThrough:p,size:x,family:g,lineHeight:C}=r.style;m&&(u.fontWeight="700"),c&&(u.color=c),y&&(u.fontStyle="italic"),g&&(u.fontFamily=g),C&&(u.lineHeight=C),f?u.textDecoration="underline":(b||p)&&(u.textDecoration="line-through"),x&&(u.fontSize=x)}if(r.secStyle&&((d=r.secStyle)!=null&&d.overrite)){const{bold:m,color:c,italic:y,underline:f,strikethrough:b,strikeThrough:p,size:x,family:g,lineHeight:C}=r.secStyle;m&&(u.fontWeight="700"),c&&(u.color=c),y&&(u.fontStyle="italic"),g&&(u.fontFamily=g),C&&(u.lineHeight=C),f?u.textDecoration="underline":(b||p)&&(u.textDecoration="line-through"),x&&(u.fontSize=x)}for(const m of r.inherit)u[m]="inherit";return u});return(u,h)=>t.loading?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(t.cssStyle),class:"custom-tag-skeletion"},[e.createVNode(Qt)],4)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value),e.mergeProps({key:1},u.$attrs,{type:t.method,disabled:t.disabled,style:s.value,class:l.value,onMouseover:h[0]||(h[0]=d=>o.value=!0),onMouseout:h[1]||(h[1]=d=>o.value=!1),innerHTML:a.value}),null,16,["type","disabled","style","class","innerHTML"]))}},[["__scopeId","data-v-14a516b4"]]),O4={key:1,class:"field-label"},D4={class:"ect-flex ect-flex-col ect-justify-start"},V4={key:0,class:"ect-pr-5"},F4={key:1,class:"field-value ect-pr-5"},M4={key:1,class:"field-value"},Bc=ve({__name:"AtomFieldAttribute",props:{tag:{type:String,default:"span"},field:{type:String,default:""},value:{type:Object,default:()=>({})},label:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},offer:{type:Object,default:()=>({})},itemCount:{type:Number,default:1},appliedOnOfferMatchingField:{type:Boolean,default:!1},showOfferDescription:{type:Boolean,default:!1},isProductSummary:{type:Boolean,default:!1},index:{type:Number,default:0},parentWidth:{type:Number,default:0}},setup(t){const r=mn(),n=t,o=e.computed(()=>!1),a=e.computed(()=>{var c;return n.offer.offerValue.offerId&&n.offer.offerValue.formattedOfferPrice||n.offer.offerValue.rpId&&((c=n.offer.offerValue.qtyTiers)==null?void 0:c.length)>0?!!n.appliedOnOfferMatchingField:!1}),i=e.computed(()=>n.offer.offerDetails.styles.offerValue.textStyles.tag),l=e.computed(()=>n.offer.offerDetails.styles.offerDescription.textStyles),s=e.computed(()=>{var m,c;return(m=n.offer.offerValue)!=null&&m.qtyTiers?r.getVolumePrice(n.itemCount>0?n.itemCount:1,n.offer.offerValue):(c=n.offer.offerValue)==null?void 0:c.formattedOfferPrice}),u=e.computed(()=>({"ect-flex ect-line-through":o.value&&n.offer.offerValue&&a.value})),h=e.computed(()=>n.value&&(n.value.isStatic||!n.loading)),d=e.computed(()=>(o.value&&!n.isProductSummary||n.isProductSummary&&n.index===0)&&n.showOfferDescription&&n.appliedOnOfferMatchingField);return(m,c)=>{var y,f;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.field,"field ect-gap-1 ect-flex ect-flex-col"])},[t.label?(e.openBlock(),e.createBlock(Re,{key:0,tag:(y=t.label.style)==null?void 0:y.tag,text:t.label.value,style:e.normalizeStyle(t.label.style),class:e.normalizeClass(`${t.field}_label`)},null,8,["tag","text","style","class"])):(e.openBlock(),e.createElementBlock("div",O4,[e.createVNode(Qt)])),e.createElementVNode("div",D4,[o.value&&n.offer.offerValue&&a.value?(e.openBlock(),e.createElementBlock("div",V4,[e.createVNode(Re,{tag:i.value,text:s.value,style:e.normalizeStyle(t.offer.offerDetails.styles.offerValue.textStyles),class:e.normalizeClass(`${t.field}_value`)},null,8,["tag","text","style","class"])])):o.value&&!n.offer.offerValue?(e.openBlock(),e.createElementBlock("div",F4,[e.createVNode(Qt)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(u.value)},[h.value?(e.openBlock(),e.createBlock(Re,{key:0,tag:(f=t.value.style)==null?void 0:f.tag,text:t.value.value,style:e.normalizeStyle(t.value.style),class:e.normalizeClass(`${t.field}_value`)},null,8,["tag","text","style","class"])):(e.openBlock(),e.createElementBlock("div",M4,[e.createVNode(Qt)]))],2)]),d.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"field-description ect-left-0 ect-w-max ect-pt-2",style:e.normalizeStyle({maxWidth:t.parentWidth?t.parentWidth+"px":void 0})},[e.createVNode(Re,{tag:l.value.tag,text:n.offer.offerValue.offerDescShort,style:e.normalizeStyle(l.value),class:e.normalizeClass(t.field+"_value")},null,8,["tag","text","style","class"])],4)):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-b0e72386"]]),R4={key:1,class:"filter"},L4={class:"filter-title"},P4={key:0,class:"filter-desc"},q4={key:1,class:"filter-desc"},$4={key:2,class:"filter-desc"},Ic=ve({__name:"AtomProductText",props:{title:{type:Object,default:()=>({})},description:{type:Object,default:null},loading:{type:Boolean,default:!1},url:{type:String,default:null}},setup(t){const r=Ko(),n=t;function o(){n.url&&!n.loading&&r.push(n.url)}return(a,i)=>t.loading?(e.openBlock(),e.createElementBlock("div",R4,[e.createElementVNode("div",L4,[e.createVNode(Qt)]),t.description?(e.openBlock(),e.createElementBlock("div",P4,[e.createVNode(Qt)])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("div",q4,[e.createVNode(Qt)])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("div",$4,[e.createVNode(Qt)])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.title?(e.openBlock(),e.createBlock(Re,{key:0,class:e.normalizeClass({"ect-cursor-pointer":t.url}),text:t.title.value,style:e.normalizeStyle(t.title.style),onClick:o},null,8,["class","text","style"])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createBlock(Re,{key:1,text:t.description.value,style:e.normalizeStyle(t.description.style)},null,8,["text","style"])):e.createCommentVNode("",!0)],64))}},[["__scopeId","data-v-5b4d627e"]]),U4={name:"Spinner"},z4={class:"spinner"};function j4(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("div",z4)}const Ao=ve(U4,[["render",j4],["__scopeId","data-v-83f8c910"]]),H4={name:"AtomSkeletonWidget",components:{AtomSkeletonLoader:Qt,AtomSpinner:Ao},props:{rows:{type:Number,default:4},type:{type:String,default:"full"},className:{type:String,default:""}},data(){return{SKELETON_TYPE:S4}}},gi=t=>(e.pushScopeId("data-v-956cc081"),t=t(),e.popScopeId(),t),G4={key:0,class:"page"},K4=gi(()=>e.createElementVNode("div",{class:"page-header"},null,-1)),X4={class:"page-body"},W4={class:"page-body_board"},Q4={key:1,class:"field"},Z4={key:2,class:"filter"},J4={class:"filter-option_inner"},Y4={key:3,class:"full"},e9={key:4,class:"shuttle"},t9={class:"shuttle-full"},n9={class:"shuttle-full"},o9={class:"shuttle-half"},r9={class:"shuttle-half"},a9={class:"shuttle-button"},i9={key:5,class:"shuttle2"},l9={class:"shuttle2-full"},s9=gi(()=>e.createElementVNode("span",null,"Processing payment",-1)),c9={key:6,class:"shuttle2"},u9={class:"shuttle2-full"},d9=gi(()=>e.createElementVNode("span",null,"Processing order",-1)),f9={key:10,class:"skeleton-shipping"},h9={class:"skeleton-shipping-full"},p9={class:"skeleton-shipping-half"},m9={key:11,class:"skeleton-terms"},y9={class:"skeleton-terms-half"},g9={class:"skeleton-terms-full"},b9={class:"skeleton-terms-full"},x9={key:12,class:""},_9={class:"skeleton-terms-half"},C9={key:13,class:""},E9={class:"skeleton-terms-half"},k9={key:14,class:"product"},v9={class:"product-image"},A9={class:"product-texts"},w9={class:"product-description"},N9={class:"product-action"},S9={class:"product-button"},B9={key:15,class:""};function I9(t,r,n,o,a,i){const l=e.resolveComponent("AtomSkeletonLoader"),s=e.resolveComponent("AtomSpinner");return n.type==="page"?(e.openBlock(),e.createElementBlock("div",G4,[K4,e.createElementVNode("div",X4,[e.createElementVNode("div",W4,[e.createVNode(l)])])])):n.type==="fieldattribute"?(e.openBlock(),e.createElementBlock("div",Q4,[e.createVNode(l)])):n.type==="filteroptions"?(e.openBlock(),e.createElementBlock("div",Z4,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rows,u=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"filter-option"},[e.createElementVNode("div",J4,[e.createVNode(l)])]))),128))])):n.type==="full"?(e.openBlock(),e.createElementBlock("div",Y4,[e.createVNode(l)])):n.type==="shuttle"?(e.openBlock(),e.createElementBlock("div",e9,[e.createElementVNode("div",t9,[e.createVNode(l)]),e.createElementVNode("div",n9,[e.createVNode(l)]),e.createElementVNode("div",o9,[e.createVNode(l)]),e.createElementVNode("div",r9,[e.createVNode(l)]),e.createElementVNode("div",a9,[e.createVNode(l)])])):n.type==="shuttle-done"?(e.openBlock(),e.createElementBlock("div",i9,[e.createElementVNode("div",l9,[e.createVNode(s,{class:"shuttle2-spinner"}),e.createTextVNode(),s9])])):n.type==="order-processing"?(e.openBlock(),e.createElementBlock("div",c9,[e.createElementVNode("div",u9,[e.createVNode(s,{class:"shuttle2-spinner"}),e.createTextVNode(),d9])])):n.type==="enhanceFilter"?(e.openBlock(),e.createElementBlock("div",{key:7,class:e.normalizeClass(n.className)},[e.createVNode(l)],2)):n.type==="offers"?(e.openBlock(),e.createElementBlock("div",{key:8,class:e.normalizeClass(n.className)},[e.createVNode(l)],2)):n.type==="detailPage"?(e.openBlock(),e.createElementBlock("div",{key:9,class:e.normalizeClass(n.className)},[e.createVNode(l)],2)):n.type==="shippingAddress"?(e.openBlock(),e.createElementBlock("div",f9,[e.createElementVNode("div",h9,[e.createVNode(l)]),e.createElementVNode("div",p9,[e.createVNode(l)])])):n.type==="termsAndPayment"?(e.openBlock(),e.createElementBlock("div",m9,[e.createElementVNode("div",y9,[e.createVNode(l)]),e.createElementVNode("div",g9,[e.createVNode(l)]),e.createElementVNode("div",b9,[e.createVNode(l)])])):n.type==="accordian-title"?(e.openBlock(),e.createElementBlock("div",x9,[e.createElementVNode("div",_9,[e.createVNode(l)])])):n.type==="imageDiv"?(e.openBlock(),e.createElementBlock("div",C9,[e.createElementVNode("div",E9,[e.createVNode(l)])])):n.type==="product-detail"?(e.openBlock(),e.createElementBlock("div",k9,[e.createElementVNode("div",v9,[e.createVNode(l)]),e.createElementVNode("div",A9,[e.createVNode(l)]),e.createElementVNode("div",w9,[e.createVNode(l)]),e.createElementVNode("div",N9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rows,u=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"product-action_item"},[e.createVNode(l)]))),128))]),e.createElementVNode("div",S9,[e.createVNode(l)])])):n.type===a.SKELETON_TYPE.KNOWLEDGE_DETAIL?(e.openBlock(),e.createElementBlock("div",B9,[e.createVNode(l,{class:e.normalizeClass(n.className)},null,8,["class"])])):e.createCommentVNode("",!0)}const yn=ve(H4,[["render",I9],["__scopeId","data-v-956cc081"]]),T9=["src"],bi={__name:"AtomImage",props:{src:{type:String,default:""},resourcesDomain:{type:String,default:""},placeholder:{type:String,default:""},height:{type:Number,default:200},width:{type:Number,default:200},loading:{type:Boolean,default:!1},sizes:{type:String}},setup(t){const r=ft(),n=t,o=e.computed(()=>n.src.includes("/resource/")&&!n.src.includes("://")&&n.resourcesDomain?n.resourcesDomain+n.src:n.src.includes("/servlet/servlet.ImageServer")&&!n.src.includes("://")&&n.resourcesDomain?n.resourcesDomain+"/"+n.src:n.src.includes("/servlet/servlet.ImageServer")&&!n.src.includes("://")&&r.siteUrl?r.siteUrl.value+"/"+n.src:n.src);return(a,i)=>t.loading?(e.openBlock(),e.createBlock(yn,{key:0,type:"full"})):t.src?(e.openBlock(),e.createElementBlock("img",{key:1,src:o.value,placeholder:[30,20],class:"rounded",sizes:"props.sizes"},null,8,T9)):e.createCommentVNode("",!0)}},O9={class:"counter"},D9=["disabled"],V9={key:0,class:"counter-spinner"},F9=["max","disabled","value"],M9=["disabled"],_r=ve({__name:"AtomButtonCounter",props:{min:{type:Number,default:0},max:{type:Number,default:999},modelValue:{type:Number,default:1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},decimal:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:r}){const n=t,o=r,a=e.computed(()=>n.disabled||n.loading),i=St(function(h){const d=String(h??"");if(d==="")return;const m=Number(d);Number.isNaN(m)||o("update:modelValue",m)}),l=h=>{(h.key==="."||h.key==="e"||h.key==="E")&&!h.ctrlKey&&!h.metaKey&&n.decimal&&h.preventDefault()};function s(){n.modelValue<n.max&&o("update:modelValue",n.modelValue+1)}function u(){n.modelValue>n.min&&o("update:modelValue",n.modelValue-1)}return(h,d)=>(e.openBlock(),e.createElementBlock("div",O9,[e.createElementVNode("button",{disabled:t.modelValue<=t.min||a.value,onClick:u},[e.createVNode(Be,{icon:t.modelValue>1?"minus":"close",size:10},null,8,["icon"])],8,D9),t.loading?(e.openBlock(),e.createElementBlock("div",V9,[e.createVNode(Ao,{class:"item-button_spinner"})])):(e.openBlock(),e.createElementBlock("input",{key:1,type:"number",min:"0",max:t.max,disabled:a.value,value:t.modelValue,step:"1",onInput:d[0]||(d[0]=m=>e.unref(i)(m.target.value)),onKeydown:l},null,40,F9)),e.createElementVNode("button",{disabled:t.modelValue>=t.max||a.value,onClick:s},[e.createVNode(Be,{class:"ect-transform ect-rotate-45",icon:"add",size:12})],8,M9)]))}},[["__scopeId","data-v-886bff8a"]]),Tc=e.ref(!1),Oc=e.ref(!1),Dc=e.ref(!1),Vc=e.ref(!1),xi=()=>{if(typeof window<"u"){const t=()=>{const r=window.innerWidth;Oc.value=r<768,Dc.value=r>=768&&r<1024,Vc.value=r>=1024};e.onMounted(()=>{Tc.value||(Tc.value=!0,window.addEventListener("resize",t),t())})}return{isMobile:Oc,isTablet:Dc,isDesktop:Vc}},R9=["disabled"],L9=["disabled"],P9={class:"ect-w-max"},q9={class:"button-header-icon"},$9=["onClick"],U9={key:0,class:"button-options_item-icon"},z9=["disabled"],j9={class:"ect-w-max"},H9={class:"button-header-icon"},G9=["onClick"],K9={key:0,class:"button-options_item-icon"},Fc=ve({__name:"AtomButtonMenu",props:{icon:{type:String,default:null},select:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},name:{type:String,default:null},options:{type:Array,default:()=>[]}},emits:["selected"],setup(t,{emit:r}){const n=t,o=xi(),a=e.ref(!1),i=e.ref(null),l=e.ref({}),s=e.ref(!1),u=r;function h(b){b.stopPropagation(),a.value=!a.value}function d(b){b.stopPropagation(),a.value=!a.value,s.value=e.ref(a.value)}function m(b){u("selected",b),a.value=!1}function c(){!o.isMobile.value&&!n.disabled&&(a.value=!0)}function y(){!o.isMobile.value&&!s.value&&(a.value=!1)}function f(b){a.value&&(a.value=!1,s.value=!1)}return e.onMounted(()=>{document.addEventListener("click",f)}),e.onUnmounted(()=>{document.removeEventListener("click",f)}),(b,p)=>{var x;return t.options.length===1?(e.openBlock(),e.createElementBlock("button",{key:0,class:"esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:t.disabled,onClick:p[0]||(p[0]=g=>b.$emit("selected",t.options[0]))},[e.createElementVNode("span",null,e.toDisplayString(((x=t.options[0].label)==null?void 0:x.value)||t.options[0].name),1)],8,R9)):t.options.length>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(o).isMobile.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:t.disabled,onClick:e.withModifiers(h,["stop"])},[e.createElementVNode("span",P9,e.toDisplayString(t.name||t.options[0].name),1),e.createElementVNode("div",q9,[e.createVNode(Be,{icon:"arrow_drop_down",class:"ect-relative ect-top-0.5 ect-ml-2",color:"#ffffff",size:"14"})])],8,L9),!t.disabled&&t.options.length&&a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"button-options",onClick:p[2]||(p[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"button-options_grow",onClick:p[1]||(p[1]=g=>a.value=!1)}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>(e.openBlock(),e.createElementBlock("div",{key:g,class:"button-options_item",onClick:C=>m(g)},[g.selected&&t.select?(e.openBlock(),e.createElementBlock("div",U9,[e.createVNode(Be,{icon:"done",size:20,color:"black"})])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(g.name),1)],8,$9))),128))])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"button-container",onMouseenter:c,onMouseleave:y},[e.createElementVNode("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",ref_key:"btnmenu",ref:i,disabled:t.disabled,onClick:e.withModifiers(d,["stop"])},[e.createElementVNode("span",j9,e.toDisplayString(t.name||t.options[0].name),1),e.createElementVNode("div",H9,[e.createVNode(Be,{class:"ect-relative ect-top-0.5 ect-ml-2",icon:"arrow_drop_down",color:"#ffffff",size:"14"})])],8,z9),!t.disabled&&t.options.length&&a.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(l.value),class:"button-options",onClick:p[3]||(p[3]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>{var C;return e.openBlock(),e.createElementBlock("div",{key:g,class:"button-options_item",onClick:_=>b.$emit("selected",g)},[g.selected&&t.select?(e.openBlock(),e.createElementBlock("div",K9,[e.createVNode(Be,{icon:"done",size:20,color:"black"})])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(((C=g.label)==null?void 0:C.value)||g.name),1)],8,G9)}),128))],4)):e.createCommentVNode("",!0)],32))],64)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-cfcf21a3"]]),X9={class:"ect-flex ect-flex-col ect-w-full"},W9={key:0,class:"ect-h-[20px] ect-w-[150px]"},Q9={key:1,class:"ect-flex ect-flex-col ect-gap-1"},Z9=ve({__name:"MoleculeProductItem",props:{title:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]},description:{type:Object,default:()=>({})},thumbnail:{type:Object,default:()=>({})},attributes:{type:Array,default:()=>[]},itemId:{type:String,default:null},mode:{type:String,default:"vertical"},catalogItemId:{type:String,default:null},loading:{type:Boolean,default:!1},templateId:{type:String,default:null},url:{type:String,default:null},applyOffer:{type:Boolean,default:!1},offerSetting:{type:Object,default:null},isPreview:{type:Boolean,default:!1}},setup(t){var x,g;const r=fi(),n=mn(),o=t,a=e.ref(((g=(x=n.savedItems)==null?void 0:x[o.itemId])==null?void 0:g.XX_ORD1__QTY__c)||0),i=e.ref(!1),l=e.ref(null),s=e.ref(!1),u=e.ref(!1),h=e.computed(()=>o.actions&&o.actions.length>0),d=e.computed(()=>o.actions.some(C=>C.action==="ADD_TO_CART")),m=e.computed(()=>{var C,_,E;return(C=o.offer)!=null&&C.appliedOnField?Sc[(_=o.offer)==null?void 0:_.appliedOnField]===((E=o.offerSetting.value)==null?void 0:E.field):!0});e.watch(()=>n.savedItems,C=>{var _,E;C[o.itemId]&&!u.value&&((_=C[o.itemId])==null?void 0:_.XX_ORD1__QTY__c)!==a.value&&(a.value=((E=C[o.itemId])==null?void 0:E.XX_ORD1__QTY__c)||0,u.value=!0)},{deep:!0});function c(C){var _;u.value=!0,C===0&&((_=n.savedItems)!=null&&_[o.itemId])?f():p()}const y=C=>{var _;C.action==="ADD_TO_CART"?(u.value=!0,a.value=1,b()):C.action==="CONFIGURE"?Et("catalog:item-configure-clicked",{itemId:o.itemId,catalogItemId:o.catalogItemId,title:o.title,description:o.description,attributes:o.attributes,thumbnail:o.thumbnail,url:o.url,mode:o.mode,isPreview:o.isPreview}):C.action==="CUSTOM"?window.open(((_=C.url)==null?void 0:_.value)||C.value,C.newTab?"_blank":"_self"):C.action==="ORDER_PARTS"||C.action},f=async function(){i.value=!0,l.value=null;const C=[n.savedItems[o.itemId].Id];await n.deleteLineItems(C),i.value=!1},b=async function(){i.value=!0,l.value=null;const C={itemID:o.itemId,eCatalogItemID:o.catalogItemId,qty:a.value,qtyTierAmt:null};await n.saveItemToQuoteBlinkTxn(C),i.value=!1},p=St(async function(){console.log("updateToCart 1",a.value),s.value=!0,await n.updateQuoteLineQtyTxn({itemId:o.itemId,qty:a.value,eCatalogItemId:o.catalogItemId}),s.value=!1});return(C,_)=>{var E,A;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("item ecb-theme-card "+t.mode)},[e.createElementVNode("div",{class:e.normalizeClass(`item-image ${t.mode}-image`)},[e.createVNode(bi,{src:t.thumbnail.value,loading:t.loading,"resources-domain":e.unref(r).storefrontDetails.resourcesDomain},null,8,["src","loading","resources-domain"])],2),e.createElementVNode("div",{class:e.normalizeClass(`item-text ${t.mode}-text`)},[e.createVNode(Ic,{title:t.title,loading:t.loading,description:t.description},null,8,["title","loading","description"])],2),e.createElementVNode("div",X9,[e.createElementVNode("div",{class:e.normalizeClass(`item-attributes ${t.mode}-attributes`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.attributes,(k,B)=>(e.openBlock(),e.createBlock(Bc,{key:B,class:e.normalizeClass(`item-attributes_field ${t.mode}-attributes_field`),loading:t.loading,value:k.value,label:k.label,field:k.value.field,offer:{applyOffer:k.applyOffer,offerDetails:k.offerDetails,offerValue:o.offer},"item-count":a.value,"applied-on-offer-matching-field":m.value},null,8,["class","loading","value","label","field","offer","item-count","applied-on-offer-matching-field"]))),128))],2),o.offerSetting&&m.value&&((E=o.offer)!=null&&E.offerDescShort)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`${t.mode}-offer-banner`)},[e.createVNode(Re,{tag:t.offerSetting.offerDetails.styles.offerDescription.textStyles.tag,text:(A=o.offer)==null?void 0:A.offerDescShort,style:e.normalizeStyle(t.offerSetting.offerDetails.styles.offerDescription.textStyles),class:e.normalizeClass(C.field+"_value")},null,8,["tag","text","style","class"])],2)):e.createCommentVNode("",!0)]),h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([`item-button ${t.mode}-button`,"ect-flex ect-flex-col ect-gap-2"])},[t.loading||t.applyOffer&&!o.offer?(e.openBlock(),e.createElementBlock("div",W9,[e.createVNode(Qt)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[i.value?(e.openBlock(),e.createBlock(Ao,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createElementBlock("div",Q9,[a.value>0&&!t.loading&&d.value?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:a.value,"onUpdate:modelValue":[_[0]||(_[0]=k=>a.value=k),c],loading:s.value,disabled:t.isPreview},null,8,["modelValue","loading","disabled"])):(e.openBlock(),e.createBlock(Fc,{key:1,icon:"arrow_drop_down",disabled:t.loading||t.isPreview,options:t.actions,onSelected:_[1]||(_[1]=k=>y(k))},null,8,["disabled","options"]))]))],64))],2)):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-e3d55bd3"]]),J9={class:"item"},Y9={class:"item-text"},e8={class:"item-attributes"},t8={key:0,class:"item-button"},n8={key:1,class:"ect-flex ect-flex-col ect-gap-1"},o8=ve({__name:"MoleculeProductItemTable",props:{title:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]},description:{type:Object,default:()=>({})},thumbnail:{type:Object,default:()=>({})},attributes:{type:Array,default:()=>[]},itemId:{type:String,default:null},mode:{type:String,default:"vertical"},catalogItemId:{type:String,default:null},loading:{type:Boolean,default:!1},templateId:{type:String,default:null},url:{type:String,default:null},applyOffer:{type:Boolean,default:!1},offerSetting:{type:Object,default:null},offer:{type:Object,default:null},isPreview:{type:Boolean,default:!1}},setup(t){var b,p;const r=mn(),n=t,o=e.ref(((p=(b=r.savedItems)==null?void 0:b[n.itemId])==null?void 0:p.XX_ORD1__QTY__c)||0),a=e.ref(!1),i=e.ref(!1),l=e.ref(!1),s=e.computed(()=>n.actions&&n.actions.length>0),u=e.computed(()=>n.actions.some(x=>x.action==="ADD_TO_CART")),h=e.computed(()=>{var x,g,C;return(x=n.offer)!=null&&x.appliedOnField?Sc[(g=n.offer)==null?void 0:g.appliedOnField]===((C=n.offerSetting.value)==null?void 0:C.field):!0});e.watch(()=>r.savedItems,x=>{var g,C;x[n.itemId]&&!i.value&&((g=x[n.itemId])==null?void 0:g.XX_ORD1__QTY__c)!==o.value&&(o.value=((C=x[n.itemId])==null?void 0:C.XX_ORD1__QTY__c)||0,i.value=!0)},{deep:!0});function d(x){var g;i.value=!0,x===0&&((g=r.savedItems)!=null&&g[n.itemId])?c():f()}const m=x=>{var g;x.action==="ADD_TO_CART"?(i.value=!0,o.value=1,y()):x.action==="CONFIGURE"?Et("catalog:item-configure-clicked",{itemId:n.itemId,catalogItemId:n.catalogItemId,title:n.title,description:n.description,attributes:n.attributes,thumbnail:n.thumbnail,url:n.url,offer:n.offer,mode:n.mode,isPreview:n.isPreview}):x.action==="CUSTOM"?window.open(((g=x.url)==null?void 0:g.value)||x.value,x.newTab?"_blank":"_self"):x.action==="ORDER_PARTS"||x.action},c=async function(){a.value=!0;const x=[r.savedItems[n.itemId].Id];await r.deleteLineItems(x),delete r.savedItems[n.itemId],a.value=!1},y=async function(){a.value=!0;const x={itemID:n.itemId,eCatalogItemID:n.catalogItemId,qty:o.value,qtyTierAmt:null};await r.saveItemToQuoteBlinkTxn(x),a.value=!1},f=St(async function(){console.log("updateToCart 2",o.value),l.value=!0,await r.updateQuoteLineQtyTxn({itemId:n.itemId,qty:o.value,eCatalogItemId:n.catalogItemId}),l.value=!1},800);return(x,g)=>(e.openBlock(),e.createElementBlock("div",J9,[e.createElementVNode("div",Y9,[e.createVNode(Ic,{url:t.url,title:t.title,loading:t.loading},null,8,["url","title","loading"])]),e.createElementVNode("div",e8,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.attributes,C=>{var _;return e.openBlock(),e.createBlock(Bc,{key:C.field,class:e.normalizeClass(`item-attributes_field ${t.mode}-attributes_field`),loading:t.loading,value:C.value,label:C.label,offer:{applyOffer:C.applyOffer,offerDetails:C.offerDetails,offerValue:n.offer},"item-count":o.value,"applied-on-offer-matching-field":h.value,"show-offer-description":!!((_=n.offer)!=null&&_.offerDescShort)},null,8,["class","loading","value","label","offer","item-count","applied-on-offer-matching-field","show-offer-description"])}),128))]),s.value?(e.openBlock(),e.createElementBlock("div",t8,[a.value?(e.openBlock(),e.createBlock(Ao,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createElementBlock("div",n8,[o.value>0&&!t.loading&&u.value?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:o.value,"onUpdate:modelValue":[g[0]||(g[0]=C=>o.value=C),d],loading:l.value,disabled:t.isPreview},null,8,["modelValue","loading","disabled"])):(e.openBlock(),e.createBlock(Fc,{key:1,icon:"arrow_drop_down",disabled:t.loading||t.isPreview,options:t.actions,onSelected:g[1]||(g[1]=C=>m(C))},null,8,["disabled","options"]))]))])):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-b679176d"]]),r8=["placeholder"],a8={key:0,class:"srch-error"},i8={class:"srch-option_lst-main"},l8={class:"italic"},s8={class:"srch-option_lst-sugg"},c8={class:"italic"},u8={class:"srch-option_lst-main"},d8={class:"italic"},f8={class:"srch-option_lst-sugg"},h8={class:"italic"},p8={class:"srch-option_lst-main"},m8={class:"italic"},y8={class:"srch-option_lst-sugg"},g8={class:"italic"},b8={key:1,class:"search1"},x8={class:"search-container_header"},_8={class:"search-container_header_input ectheme-input-box"},C8=["placeholder","value"],E8=ve({__name:"BlinkMoleculeSearch",props:{placeholder:{type:String,default:""},modelValue:{type:String,default:""},suggestion:{type:Boolean,default:!1},showSearchIconAlways:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},enableSearchClick:{type:Boolean,default:!1}},emits:["update:modelValue","enter"],setup(t,{emit:r}){const n=r;let o;const a=e.ref(""),i=e.ref(!1),l=e.ref(!1),s=e.ref(null),u=()=>{s.value=null,a.value="",n("update:modelValue",""),n("enter")},h=b=>{a.value.length>1?(b.target.blur(),m(a.value+"*")):s.value="Search text must be more than one character.",i.value=!1},d=()=>{l.value||(s.value=null,a.value.length>1?m(a.value+"*"):a.value.length===1&&(s.value="Search text must be more than one character."),i.value=!1)},m=b=>{n("update:modelValue",b),i.value=!1,l.value=!1},c=b=>{const p=b.target.value;s.value=null,p.length||n("update:modelValue","")},y=()=>{n("enter")},f=b=>{var x;o&&(clearTimeout(o),o=null);const p=((x=b==null?void 0:b.target)==null?void 0:x.value)??"";o=setTimeout(()=>{n("update:modelValue",p)},500)};return(b,p)=>t.suggestion?(e.openBlock(),e.createElementBlock("div",{key:0,class:"srch",tabindex:"0",onFocusin:p[6]||(p[6]=x=>i.value=!0),onFocusout:d,onKeydown:e.withKeys(h,["enter"])},[e.createElementVNode("div",{class:e.normalizeClass(["srch-inp",{"srch-error-border":s.value}])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=x=>a.value=x),type:"search",placeholder:t.placeholder,onInput:c},null,40,r8),[[e.vModelText,a.value]]),e.createVNode(Be,{icon:a.value?"close":"search",size:14,color:s.value?"red":"#acacac",onClick:u},null,8,["icon","color"])],2),s.value?(e.openBlock(),e.createElementBlock("div",a8,[e.createElementVNode("span",null,e.toDisplayString(s.value),1)])):e.createCommentVNode("",!0),a.value.length>1&&i.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"srch-option",onMouseover:p[4]||(p[4]=x=>l.value=!0),onMouseout:p[5]||(p[5]=x=>l.value=!1)},[e.createElementVNode("div",{class:"srch-option_lst",onClick:p[1]||(p[1]=x=>m(a.value+"*"))},[e.createElementVNode("div",i8,[e.createTextVNode(" Search for "),e.createElementVNode("span",l8,e.toDisplayString(a.value)+"*",1)]),e.createElementVNode("div",s8,[e.createTextVNode(" word that starts with "),e.createElementVNode("span",c8,e.toDisplayString(a.value)+"*",1)])]),e.createElementVNode("div",{class:"srch-option_lst",onClick:p[2]||(p[2]=x=>m(a.value))},[e.createElementVNode("div",u8,[e.createTextVNode(" Search for "),e.createElementVNode("span",d8,'"'+e.toDisplayString(a.value)+'"',1)]),e.createElementVNode("div",f8,[e.createTextVNode(" search exactly for "),e.createElementVNode("span",h8,'"'+e.toDisplayString(a.value)+'"',1)])]),e.createElementVNode("div",{class:"srch-option_lst",onClick:p[3]||(p[3]=x=>m("*"+a.value+"*"))},[e.createElementVNode("div",p8,[e.createTextVNode(" Search for "),e.createElementVNode("span",m8,"*"+e.toDisplayString(a.value)+"*",1)]),e.createElementVNode("div",y8,[e.createTextVNode(" word that includes "),e.createElementVNode("span",g8,"*"+e.toDisplayString(a.value)+"*",1)])])],32)):e.createCommentVNode("",!0)],32)):(e.openBlock(),e.createElementBlock("div",b8,[e.createElementVNode("div",x8,[e.createElementVNode("div",_8,[e.createElementVNode("input",{class:"",type:"search",placeholder:t.placeholder,value:t.modelValue,onInput:f,onKeyup:e.withKeys(y,["enter"])},null,40,C8),t.loading?(e.openBlock(),e.createBlock(Ao,{key:0})):e.createCommentVNode("",!0),t.modelValue?(e.openBlock(),e.createBlock(Be,{key:1,icon:"close",size:12,color:"#acacac",onClick:u})):e.createCommentVNode("",!0),t.enableSearchClick||!t.modelValue?(e.openBlock(),e.createBlock(Be,{key:2,class:"ect-relative ect-top-[-1px]",icon:"search",size:14,color:"#acacac",onClick:y})):e.createCommentVNode("",!0)])])]))}},[["__scopeId","data-v-31366d17"]]),Mc=t=>(e.pushScopeId("data-v-01d2d3f1"),t=t(),e.popScopeId(),t),k8=["id"],v8={key:0,class:"product-search"},A8={key:1,class:"product-not-found"},w8=Mc(()=>e.createElementVNode("span",{class:"product-not-found_icon material-symbols-outlined"}," error ",-1)),N8=Mc(()=>e.createElementVNode("span",{class:"product-not-found_text"},"No results found",-1)),S8={key:2,class:"product-item"},B8=20,I8=ve({__name:"MoleculeProductBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},request:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},catalogType:{type:String,required:!0},blockId:{type:String,default:""},accountId:{type:String,default:null},searchText:{type:String,default:""},onCountUpdate:{type:Function,default:null},hideHeader:{type:Boolean,default:!1},initialItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1}},setup(t,{expose:r}){const n=ft(),o=["vertical","horizontal","square","table"],a=t,i=e.ref(Math.floor(Math.random()*1e9)),l=e.ref(null),s=mn(),u=e.ref(1),h=e.ref(!0),d=e.ref(!0),m=e.ref(!1);e.ref(!1);const c=e.ref([]),y=e.ref(0),f=e.ref(a.request);let b=200;const p=e.ref(a.searchText||""),x=e.computed(()=>a.initialItems||[]),g=e.computed(()=>!!(p.value||a.searchText));function C(N,T,O){const F=O==="Item",q=[];return N.forEach(M=>{var L,j;const U=JSON.parse(JSON.stringify(T));try{F?U.itemId=M.Id:(U.itemId=M.XX_ORD1__Item__c,U.catalogItemId=M.Id);const{description:H,thumbnail:Z,title:te,attributes:ne,actions:Q}=U;Z!=null&&Z.field&&!Z.isStatic&&(Z.value=We(M,Z.field)),te!=null&&te.field&&!te.isStatic&&(te.value=We(M,te.field)),H!=null&&H.field&&!H.isStatic&&(H.value=We(M,H.field)),(ne||[]).forEach(ue=>{var pe,ie;(pe=ue==null?void 0:ue.value)!=null&&pe.field&&!ue.value.isStatic&&(ue.value.value=We(M,ue.value.field,ue.value.dataType)||"-"),(ie=ue==null?void 0:ue.label)!=null&&ie.field&&!ue.label.isStatic&&(ue.label.value=We(M,ue.label.field,ue.label.dataType)||"-")}),(Q||[]).forEach(ue=>{ue.action==="CUSTOM"&&(ue.url&&!ue.url.isStatic&&(ue.url.value=We(M,ue.url.field)),ue.label&&!ue.label.isStatic&&(ue.label.value=We(M,ue.label.field)))});try{const ue=F?We(M,"XX_ORD1__SYS_Requires_Configuration__c"):We(M,"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c");U.requiresConfiguration=ue}catch{}const ce=F?We(M,"XX_ORD1__Friendly_URL__c"):We(M,"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c");((L=U.friendlyURLFields)==null?void 0:L.length)>0&&ce?((j=U.friendlyURLFields)==null||j.forEach(ue=>{U.friendlyURL=(U.friendlyURL||"").replace(`{!${ue}}`,We(M,ue))}),U.friendlyURL="/"+(U.friendlyURL||"")+"/"+ce):U.url&&(U.friendlyURL=U.url+"/"+((M==null?void 0:M.Id)||"")),U.friendlyURL&&(U.friendlyURL=U.friendlyURL.replace(/\/{2,}/g,"/"))}catch{}q.push(U)}),q}const _=e.ref(null),E=e.ref(null),A=e.computed(()=>{}),k=e.computed(()=>{var N;return(N=a.fields)==null?void 0:N.header});e.computed(()=>{var N;return((N=k.value)==null?void 0:N.mainHeading)||{}}),e.computed(()=>{var N;return((N=k.value)==null?void 0:N.subHeading)||{}});const B=e.computed(()=>{var N;return c.value.length>0?c.value:Array(D.value).fill((N=a.fields)==null?void 0:N.productCard)}),D=e.computed(()=>Number(a.configuration.displaySettings.itemsPerPage||B8)),w=e.computed(()=>Number(a.configuration.displaySettings.lazyLoadBatch)),v=e.computed(()=>{var N;return((N=a.configuration.productItemOrientation)==null?void 0:N.toLowerCase())||"vertical"}),S=e.ref(o.includes(v.value)?_.value||v.value:"vertical"),I=e.computed(()=>c.value.length<1&&!d.value),R=e.computed(()=>`product-${S.value} width-${E.value?E.value:a.configuration.displaySettings.columns||1}`),z=e.computed(()=>a.configuration.displaySettings.enableSearch),$=e.ref(null),X=e.ref(!1),W=e.ref({});e.watch(u,(N,T)=>{N!==T&&(console.log("[fetchProducts] 1"),K(!0))}),e.watch($,N=>{N!==null&&a.onCountUpdate&&a.onCountUpdate(N)}),e.watch(p,()=>{u.value=1,console.log("[fetchProducts] 2"),K(!0)}),e.watch(()=>a.searchText,(N,T)=>{N!==T&&(p.value=N||"")});const K=St(async function(N){var q;if(b=600,m.value=!0,x.value&&x.value.length>0&&!g.value){const M=C(x.value,(q=a.fields)==null?void 0:q.productCard,a.catalogType);c.value=M,$.value=M.length,d.value=!1,m.value=!1;try{Et("catalog:items-loaded",{items:M,count:M.length})}catch{}N&&l.value&&l.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"});return}d.value=!0;let O=D.value;w.value<O&&w.value>0&&(O=w.value);const F={...f.value,accountID:a.accountId,rowLimit:O,searchText:p.value||a.searchText,rowOffSet:D.value*(u.value-1)};N&&l.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}),n.quoteId.value?s.getQuoteItems(!0).then(M=>{m.value=!1}).catch(M=>{console.error("[MOLECULEPRODUCTBLOCK:fetchProducts] error fetching line items",M),m.value=!1}).finally(()=>{m.value=!1}):m.value=!1;try{const M=await s.getProductItems(F,a.fields.productCard,a.catalogType);if(M){h.value=M.items.length===O,$.value=M.count,c.value=M.items,y.value=Math.ceil(M.count/D.value);try{Et("catalog:items-loaded",{items:M.items,count:M.count})}catch{}}console.log("[MOLECULEPRODUCTBLOCK:fetchProducts] prodData",M)}catch(M){console.error("[MOLECULEPRODUCTBLOCK:fetchProducts] error fetching products",M)}finally{d.value=!1,m.value=!1}},b);async function P(){const{mainHeading:N,subHeading:T}=a.fields.header;if(!N.isStatic&&N.field||!T.isStatic&&T.field){const O=[];N.isStatic?N.value=N.title:O.push(N.field),T.isStatic?T.value=T.title:O.push(T.field);const F={...f.value,accountID:a.accountId,fields:O},q=await s.getEcatalogDetails(F);N.isStatic||(N.value=q[N.field],N.isStatic=!0),T.isStatic||(T.value=q[T.field],T.isStatic=!0)}else N.value=N.title,T.value=T.title}return r({currentPage:u,fetchProducts:K}),e.onMounted(()=>{K(),P()}),(N,T)=>(e.openBlock(),e.createElementBlock("div",{id:i.value,ref_key:"productBlock",ref:l,class:"product"},[z.value&&A.value===void 0&&!t.hideHeader?(e.openBlock(),e.createElementBlock("div",v8,[e.createVNode(E8,{modelValue:p.value,"onUpdate:modelValue":T[0]||(T[0]=O=>p.value=O),placeholder:"Search products..."},null,8,["modelValue"])])):e.createCommentVNode("",!0),e.renderSlot(N.$slots,"default",{},void 0,!0),I.value?(e.openBlock(),e.createElementBlock("div",A8,[w8,e.createTextVNode(),N8])):(e.openBlock(),e.createElementBlock("div",S8,[S.value==="table"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(B.value,O=>(e.openBlock(),e.createElementBlock("div",{key:(O==null?void 0:O.catalogItemId)||(O==null?void 0:O.itemId),class:"product-item_table"},[e.createVNode(o8,{class:"ecb-theme-card","item-id":O==null?void 0:O.itemId,"catalog-item-id":O==null?void 0:O.catalogItemId,loading:d.value||m.value,mode:S.value,title:O==null?void 0:O.title,attributes:O==null?void 0:O.attributes,actions:O==null?void 0:O.actions,thumbnail:{value:O==null?void 0:O.thumbnail.value},description:O==null?void 0:O.description,url:O==null?void 0:O.friendlyURL,"template-id":t.configuration.productTemplateId,"apply-offer":X.value,"offer-setting":W.value,offer:O==null?void 0:O.offer,"is-preview":t.isPreview},null,8,["item-id","catalog-item-id","loading","mode","title","attributes","actions","thumbnail","description","url","template-id","apply-offer","offer-setting","offer","is-preview"])]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(B.value,O=>(e.openBlock(),e.createElementBlock("div",{key:(O==null?void 0:O.catalogItemId)||(O==null?void 0:O.itemId),class:e.normalizeClass(["product-item_record",R.value])},[e.createVNode(Z9,{"item-id":O==null?void 0:O.itemId,"catalog-item-id":O==null?void 0:O.catalogItemId,loading:d.value||m.value,mode:S.value,title:O==null?void 0:O.title,attributes:O==null?void 0:O.attributes,actions:O==null?void 0:O.actions,thumbnail:{value:O==null?void 0:O.thumbnail.value},description:O==null?void 0:O.description,url:O==null?void 0:O.friendlyURL,"template-id":t.configuration.productTemplateId,"apply-offer":X.value,"offer-setting":W.value,offer:O==null?void 0:O.offer,"is-preview":t.isPreview},null,8,["item-id","catalog-item-id","loading","mode","title","attributes","actions","thumbnail","description","url","template-id","apply-offer","offer-setting","offer","is-preview"])],2))),128))]))],8,k8))}},[["__scopeId","data-v-01d2d3f1"]]),Rc=t=>(e.pushScopeId("data-v-0eae07cd"),t=t(),e.popScopeId(),t),T8={class:"catalog ect-flex ect-flex-col ect-gap-0 md:ect-flex-row"},O8={class:"catalog-product md:ect-grow"},D8={class:"ect-px-2 ect-text-[#0A0A0A] ect-[font-family:var(--font-family-Font-3,_Montserrat)] ect-text-[18px] md:ect-text-[22px] lg:ect-text-[22px] ect-font-bold ect-leading-normal ect-mb-6","data-test-id":"catalog-block-heading-title"},V8={class:"catalog-filter-mobile ect-flex ect-justify-between m-show"},F8=Rc(()=>e.createElementVNode("h3",null,"Filter Products",-1)),M8=Rc(()=>e.createElementVNode("span",null," OPEN FILTERS",-1)),R8=ve({__name:"OrganismsCatalogBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},searchTerm:{type:String,default:""},onCountUpdate:{type:Function,default:null},initialItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1}},setup(t){var y,f,b,p,x,g,C,_,E,A,k;const r=ft(),n=t,o=e.ref(!1),a=e.computed(()=>Array.isArray(n.initialItems)&&n.initialItems.length>0?"Search Results":"Catalog"),i=e.ref(((y=n.configuration.dynamicFilters)==null?void 0:y.length)>0&&((f=n.configuration.displaySettings)==null?void 0:f.displayDynamicFilters)&&!n.searchTerm),l=e.ref(n.configuration.displaySettings),s=e.computed(()=>y4.get(n.configuration.catalogType)),u=e.computed(()=>{let B=d.value.searchText;return B&&!B.endsWith("*")&&(B+="*"),B||""}),h=e.computed(()=>{var z;const B=[],{description:D,thumbnail:w,title:v,attributes:S,actions:I}=n.fields.productCard,R=[D,w,v];return S.forEach($=>{R.push($.value),R.push($.label)}),(I==null?void 0:I.length)>0&&I.forEach($=>{$.action==="CUSTOM"&&(R.push($.url),R.push($.label))}),R.forEach($=>{!$.isStatic&&$.field?B.push($.field):$.value=$.title||"-"}),s.value==="eCatalog"?(B.push("XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),B.push("XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c")):(B.push("XX_ORD1__Friendly_URL__c"),B.push("XX_ORD1__SYS_Requires_Configuration__c")),((z=n.fields.productCard.friendlyURLFields)==null?void 0:z.length)>0&&B.push(...n.fields.productCard.friendlyURLFields),B}),d=e.ref({blockId:n.id,catalogType:m4.get(n.configuration.catalogType)||"Full",checkcurrency:(b=l.value)==null?void 0:b.checkCurrency,eCatalogIDs:n.configuration.catalogType==="ECATALOG_OVERRIDE"&&n.configuration.catalogId?[n.configuration.catalogId]:null,fields:h.value,alternateFieldName:n.configuration.catalogCustomField,searchText:"",whereCondition:n.configuration.staticFilters,sortByField:((x=(p=n.configuration.sort)==null?void 0:p.primary)==null?void 0:x.field)||"Name",sortOrder:(C=(g=n.configuration.sort)==null?void 0:g.primary)==null?void 0:C.direction,secondarySortByField:(E=(_=n.configuration.sort)==null?void 0:_.secondary)==null?void 0:E.field,secondarySortOrder:(k=(A=n.configuration.sort)==null?void 0:A.secondary)==null?void 0:k.direction}),m=e.ref(null),c=e.ref(null);return e.watch(()=>o.value,B=>{B&&window.scrollTo(0,0)}),e.onMounted(()=>{d.value.searchText=n.searchTerm||""}),e.watch(d,B=>{c.value&&c.value.fetchFilterList(),m.value&&(m.value.currentPage=1,console.log("[fetchProducts] 4"),m.value.fetchProducts())},{deep:!0}),e.watch(()=>n.searchTerm,B=>{typeof B=="string"&&(d.value.searchText=B)}),(B,D)=>(e.openBlock(),e.createElementBlock("div",T8,[e.createElementVNode("div",O8,[e.createElementVNode("h2",D8,e.toDisplayString(a.value),1),e.createVNode(I8,{ref_key:"product",ref:m,"block-id":t.id,"account-id":e.unref(r).accountId,configuration:t.configuration,"catalog-type":s.value,request:d.value,fields:t.fields,"search-text":u.value,"initial-items":n.initialItems,"hide-header":!!n.searchTerm,"on-count-update":n.onCountUpdate,"is-preview":t.isPreview},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",V8,[F8,e.createElementVNode("div",{class:"ect-flex ect-items-center ect-gap-2 m-show",onClick:D[0]||(D[0]=w=>o.value=!0)},[e.createVNode(Be,{class:"filter-product_icon",icon:"tune",color:"#acacac",size:20}),M8])],512),[[e.vShow,!o.value&&i.value]])]),_:1},8,["block-id","account-id","configuration","catalog-type","request","fields","search-text","initial-items","hide-header","on-count-update","is-preview"])])]))}},[["__scopeId","data-v-0eae07cd"]]),L8={name:"AtomIcon",props:{icon:{type:String,default:"edit"},tooltipWidth:{type:Number,default:130},color:{type:String,default:"#acacac"},hover:{type:String,default:null},size:{type:Number,default:20},disabled:{type:Boolean,default:!1},tooltip:{type:String,default:""},direction:{type:String,default:"top-right"},symbol:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},custom:{type:Boolean,default:!1},removeDefaultColor:{type:Boolean,default:!1},margin:{type:String,default:"0px"}},data(){return{isHover:!1}},computed:{style(){return{color:this.removeDefaultColor?"":this.isHover&&this.hover?this.hover:this.color,fontSize:this.size+"px",margin:this.margin}},mode(){let t="material-";return this.symbol?t+="symbols-":t+="icons-",this.rounded?t+="round":t+="outlined",t}}},P8=["width","height"],q8=["href"],$8=["width","height"],U8=["href"];function z8(t,r,n,o,a,i){const l=e.resolveComponent("AtomIcons"),s=e.resolveComponent("AtomTooltip");return n.tooltip?(e.openBlock(),e.createBlock(s,{key:0,content:n.tooltip,direction:n.direction,width:n.tooltipWidth},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["google-icon",{disabled:n.disabled}]),onMouseenter:r[0]||(r[0]=u=>a.isHover=!0),onMouseleave:r[1]||(r[1]=u=>a.isHover=!1)},[n.custom?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(l),(e.openBlock(),e.createElementBlock("svg",{width:n.size,height:n.size,style:e.normalizeStyle({fill:a.isHover&&n.hover&&!n.disabled?n.hover:n.color,color:a.isHover&&n.hover&&!n.disabled?n.hover:n.color})},[e.createElementVNode("use",{href:`#icon-${n.icon}`},null,8,q8)],12,P8))],64)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(i.mode),style:e.normalizeStyle(i.style)},e.toDisplayString(n.icon),7))],34)]),_:1},8,["content","direction","width"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["google-icon",{disabled:n.disabled}]),onMouseenter:r[2]||(r[2]=u=>a.isHover=!0),onMouseleave:r[3]||(r[3]=u=>a.isHover=!1)},[n.custom?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(l),(e.openBlock(),e.createElementBlock("svg",{width:n.size,height:n.size,style:e.normalizeStyle({fill:a.isHover&&n.hover&&!n.disabled?n.hover:n.color,color:a.isHover&&n.hover&&!n.disabled?n.hover:n.color})},[e.createElementVNode("use",{href:`#icon-${n.icon}`},null,8,U8)],12,$8))],64)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(i.mode),style:e.normalizeStyle(i.style)},e.toDisplayString(n.icon),7))],34))}const Cr=ve(L8,[["render",z8],["__scopeId","data-v-16108bca"]]);async function Lc(t,r,n,o={},a={}){let i=`/services/apexrest/${t}?type=${r}`;if(o&&Object.keys(o).length>0){const u=new URLSearchParams;Object.keys(o).forEach(d=>{const m=o[d];m!=null&&m!==""&&u.append(d,String(m))});const h=u.toString();h&&(i+=`&${h}`)}const l={action:"makeCall",data:{callType:n,endpoint:i,...n!=="GET"&&{payload:JSON.stringify(a)}}};return(await br(wn,l)).content}const Nn=it.defineStore("expediteCart",()=>{const t=e.ref(null),r=e.ref([]),n=e.ref(),o=e.ref({}),a=ft();async function i(f,b){let p=b?"cart.getGroupedQuoteProducts":"cart.getQuoteProducts";return await Ct({data:JSON.stringify(f),config:{pathKey:p}})}async function l(f){return await Ct({data:JSON.stringify({lineItemIds:f}),config:{pathKey:"common.getLineItemAttributes"}})}async function s(){const f=t.value?{quoteId:t.value}:{};return await Ct({data:JSON.stringify(f),config:{pathKey:"promocode.getPromoCodes"}})}async function u(){const f=t.value?{quoteId:t.value}:{},b=await Lc("XX_ORD1/ecommerce","getQLIsForPromoCode","POST",f,{});return n.value=b,r.value=b.qliIds,b}async function h(f,b,p){const x={promoCode:f,quoteId:t.value,qliIds:b,isLastBatch:p,originalTotalSalesPrice:f?n.value.originalTotalSalesPrice:null,isFromQLIUpdateOrDelete:"false"};return await Ct({data:JSON.stringify(x),config:{pathKey:"promocode.applyPromoCode"}})}async function d(f){const p={records:[{fields:f.fields.map(g=>({fieldName:g.fieldName,fieldValue:String(g.fieldValue)}))}],uniqueField:"Id",objectType:f.objectType};return await Ct({data:JSON.stringify(p),config:{pathKey:"update.upsertRecords"}})}async function m(f){return await Ct({data:JSON.stringify(f),config:{pathKey:"fetch.getRecord"}})}async function c(){const f=t.value;return f?await Ct({data:JSON.stringify({objectId:f,isCommit:!1}),config:{pathKey:"tax.calculateAvaTax"}}):void 0}async function y(f){const b=f||a.cid.value;return await Lc("XX_ORD1/ecommerce","startNewCart","POST",b?{cid:b}:{},{})}return{quoteId:t,qlisList:r,quoteRecord:o,getRowItems:i,getLineItemAttributesNG:l,getPromoCodeInfo:s,getQLIsForPromoCode:u,applyPromoCodeNG:h,updateRecord:d,getRecordFieldValue:m,calculateAvaTax:c,startNewCart:y}}),j8={name:"ModalApp",components:{AtomIcon:Cr},props:{show:{type:Boolean,default:!0},title:{type:String,default:""},subTitle:{type:String,default:""},maxWidth:{type:String,default:""},showCloseButtonText:{type:Boolean,default:!1},showCloseButton:{type:Boolean,default:!0}},emits:["clicked"],mounted(){document.querySelector("body").style.overflow="hidden"},unmounted(){document.querySelector("body").style.overflow="auto"}},H8={key:0,class:"modal-mask"},G8={class:"modal-wrapper"},K8={key:0,class:"close-text"},X8={key:1,class:"modal-container__header"},W8={class:"ect-flex ect-flex-col ect-gap-2"},Q8={class:"widget-upload__heading"},Z8={key:0,class:"ect-text-[#5f5f5f] ect-text-[14px] ect-font-roboto ect-font-normal ect-leading-[20px]"},J8={class:"modal-container__content"},Y8={class:"modal-container__action"};function ey(t,r,n,o,a,i){const l=e.resolveComponent("AtomIcon");return e.openBlock(),e.createBlock(e.Transition,null,{default:e.withCtx(()=>[n.show?(e.openBlock(),e.createElementBlock("div",H8,[e.createElementVNode("div",G8,[e.createElementVNode("div",{class:"modal-container",style:e.normalizeStyle(`${n.maxWidth?"max-width: "+n.maxWidth+"px; width: 100%;":""}`)},[n.showCloseButton?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-container__close ect-gap-2",onClick:r[0]||(r[0]=s=>t.$emit("clicked"))},[e.createVNode(l,{icon:"close",size:16,color:"##0a0a0a",hover:"#000000"}),n.showCloseButtonText?(e.openBlock(),e.createElementBlock("span",K8," Close ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),n.title?(e.openBlock(),e.createElementBlock("span",X8,[e.createElementVNode("div",W8,[e.createElementVNode("p",Q8,e.toDisplayString(n.title),1),n.subTitle?(e.openBlock(),e.createElementBlock("span",Z8,e.toDisplayString(n.subTitle),1)):e.createCommentVNode("",!0)]),e.renderSlot(t.$slots,"header-action",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",J8,[e.renderSlot(t.$slots,"content",{},void 0,!0)]),e.createElementVNode("div",Y8,[e.renderSlot(t.$slots,"action",{},void 0,!0)])],4)])])):e.createCommentVNode("",!0)]),_:3})}const ty=ve(j8,[["render",ey],["__scopeId","data-v-f59dbab6"]]),ny={name:"AtomLoader"},oy={class:"loader"};function ry(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("span",oy)}const Pc=ve(ny,[["render",ry],["__scopeId","data-v-32b63014"]]),ay={name:"AtomButton",components:{AtomLoader:Pc},props:{tag:{type:String,default:"button"},text:{type:String,default:"text",required:!0},btype:{type:String,default:"text"},method:{type:String,default:"button"},disabled:{type:Boolean,default:!1},buttonStyle:{type:String,default:"button"},loading:{type:Boolean,default:!1}},emits:["clicked"],data(){return{isHover:!1}},methods:{getBtnClass(){const t=[];return this.btype?this.btype==="primary"?t.push("esg-btn-primary ect-bg-primary"):this.btype==="secondary"?t.push("esg-btn-secondary"):this.btype==="link"||this.btype==="ghost"?t.push("noborder"):this.btype==="plink"?t.push("esg-pcolor-fc"):this.btype==="error"&&t.push("esg-btn-error"):t.push("esg-btn-primary"),this.buttonStyle==="link"&&t.push("link-btn"),this.disabled&&t.push("disabled"),t},getBtnStyle(){return null}}},iy={class:"loader"};function ly(t,r,n,o,a,i){const l=e.resolveComponent("AtomLoader");return e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.tag),e.mergeProps(t.$attrs,{type:n.method,class:["rectangle-button ect-uppercase ect-whitespace-nowrap",i.getBtnClass()],style:i.getBtnStyle(),onClick:r[0]||(r[0]=e.withModifiers(s=>t.$emit("clicked"),["prevent"]))}),{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass({"text-loading":n.loading})},[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.text),1)],!0)],2),e.createElementVNode("span",iy,[n.loading?(e.openBlock(),e.createBlock(l,{key:0})):e.createCommentVNode("",!0)])]),_:3},16,["type","class","style"])}const qc=ve(ay,[["render",ly],["__scopeId","data-v-ae1df853"]]),sy={components:{AppTooltip:ws,AppIcon:Be},props:{label:{type:String,default:""},modelValue:{type:Boolean,default:!1},partial:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},info:{type:String,default:null},dataTestId:{type:String,default:""}},emits:["update:modelValue"],methods:{toggleChecked(){this.disabled||this.$emit("update:modelValue",!this.modelValue)}}},$c=t=>(e.pushScopeId("data-v-888eb5f4"),t=t(),e.popScopeId(),t),cy=["data-test-id"],uy=["data-test-id"],dy={key:0,width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fy=[$c(()=>e.createElementVNode("g",{id:"minus"},[e.createElementVNode("path",{id:"Icon",d:"M3 6H10",stroke:"white","stroke-width":"1.66666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],hy={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},py=[$c(()=>e.createElementVNode("g",{id:"check"},[e.createElementVNode("path",{id:"Icon",d:"M10 3L4.5 8.5L2 6",stroke:"white","stroke-width":"1.6666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],my=["data-test-id"];function yy(t,r,n,o,a,i){const l=e.resolveComponent("AppIcon"),s=e.resolveComponent("AppTooltip");return e.openBlock(),e.createElementBlock("div",{class:"checkbox","data-test-id":n.dataTestId,onClick:r[0]||(r[0]=(...u)=>i.toggleChecked&&i.toggleChecked(...u))},[e.createElementVNode("div",{class:e.normalizeClass(["checkmark",{checked:n.modelValue&&!n.partial&&!n.disabled,disabled:n.disabled,partial:n.partial}]),"data-test-id":`${n.dataTestId}-checkmark`},[n.partial?(e.openBlock(),e.createElementBlock("svg",dy,fy)):n.modelValue?(e.openBlock(),e.createElementBlock("svg",hy,py)):e.createCommentVNode("",!0)],10,uy),n.label?(e.openBlock(),e.createElementBlock("div",{key:0,class:"label","data-test-id":`${n.dataTestId}-label`},e.toDisplayString(n.label),9,my)):e.createCommentVNode("",!0),n.info?(e.openBlock(),e.createBlock(s,{key:1,direction:"top",content:n.info,width:100,"data-test-id":`${n.dataTestId}-info-tooltip`},{default:e.withCtx(()=>[e.createVNode(l,{class:"ect-text-primary ect-pt-2 ect-pl-4",icon:"info","data-test-id":`${n.dataTestId}-info-icon`},null,8,["data-test-id"])]),_:1},8,["content","data-test-id"])):e.createCommentVNode("",!0)],8,cy)}const Er=ve(sy,[["render",yy],["__scopeId","data-v-888eb5f4"]]),gy={class:"m-content"},by={key:0,class:"attribute-input"},xy={key:1,class:"attribute-lookup"},_y={class:"attribute-lookup-main"},Cy={key:1},Ey={key:2,class:"attribute-input"},ky={key:2},vy={class:"m-footer"},Ay=ve({__name:"MoleculeAttributeModal",props:{data:{type:Object,default:()=>({})},quoteId:{type:String,default:""}},emits:["close","update","reload"],setup(t,{emit:r}){const n=Nn(),o=t,a=r,i=e.ref([]),l=e.ref([]),s=e.ref({}),u=e.ref(!1);async function h(){u.value=!0;const f=[{fieldName:"Id",fieldValue:o.quoteId}];l.value.forEach(p=>{if(p.editable&&!p.apiName.includes(".")){let x=p.apiName;p.dataType==="REFERENCE"?(x=p.apiName.replace("__r","__c"),f.push({fieldName:x,fieldValue:p.referenceRecordId})):f.push({fieldName:x,fieldValue:p.value})}});const b={fields:f,objectType:"XX_ORD1__Quote_Line_Item__c"};console.log(b),await n.updateRecord(b),d(),a("reload",o.quoteId),a("close"),u.value=!1}function d(){const f={},b={};i.value.forEach(p=>{p.dataType==="REFERENCE"&&(b[p.apiName]=p.referenceRecordId),f[p.apiName]=p.value}),o.data.forEach(p=>{p.dataType==="REFERENCE"&&(p.referenceRecordId=b[p.apiName]),p.value=f[p.apiName]})}function m(f,b){if(f){const p=i.value.find(g=>g.label===b.firstLookup.replace("Copy from ",""));console.log("Parent",p);const x={};p.relatedFields.forEach(g=>{x[g.child]=g.value}),p&&(b.referenceRecordId=p.referenceRecordId,b.value=p.value,b.options=p.options,b.relatedFields.forEach(g=>{g.value=x[g.child]}))}else b.referenceRecordId=null,b.options=[],b.relatedFields.forEach(p=>{p.value=null})}function c(f,b){console.log(f,b);const p=b.options.find(x=>x.Id===f);f===null?(b.options=[],b.value=null,b.relatedFields.forEach(x=>{x.value=null})):(b.value=p.Name,b.relatedFields.forEach(x=>{x.value=p[x.child]}))}const y=St(async function(f,b){b.loading=!0;const p={lookupObjectApiName:b.referenceObject,searchTerm:f||"",fields:s.value[b.apiName]||[]},x=await n.getLookupRecords(p);console.log(x),b.options=x,b.loading=!1});return e.onBeforeMount(()=>{const f={};i.value=JSON.parse(JSON.stringify(o.data)),i.value.forEach(p=>{p.dataType==="REFERENCE"&&(s.value[p.apiName]=[],p.relatedFields=[],f[p.apiName]=p,p.options=[{Name:p.value||"",Id:p.referenceRecordId}]),p.editable=p.editable&&!p.apiName.includes(".")});let b=null;i.value.forEach(p=>{if(p.referenceObject==="XX_Base__Location__c"&&(b?p.firstLookup="Copy from "+b.label:b=p),p.apiName.includes(".")){const[x,g]=p.apiName.split(".");p.parent=x,p.child=g,s.value[x]!=null&&(s.value[x].push(g),f[x].relatedFields.push(p))}}),l.value=i.value.filter(p=>!p.apiName.includes(".")),console.log(l.value,f)}),(f,b)=>(e.openBlock(),e.createBlock(ty,{title:"Modify attributes",onClicked:b[1]||(b[1]=p=>f.$emit("close"))},{content:e.withCtx(()=>[e.createElementVNode("div",gy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(p,x)=>{var g;return e.openBlock(),e.createElementBlock(e.Fragment,{key:x},[p.firstLookup?(e.openBlock(),e.createElementBlock("div",by,[e.createElementVNode("label",null,e.toDisplayString(p.firstLookup),1),e.createVNode(Er,{modelValue:p.same,"onUpdate:modelValue":[C=>p.same=C,C=>m(C,p)],class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0),p.dataType==="REFERENCE"&&((g=p.relatedFields)==null?void 0:g.length)>0?(e.openBlock(),e.createElementBlock("div",xy,[e.createElementVNode("div",_y,[e.createVNode(rn,{modelValue:p.referenceRecordId,"onUpdate:modelValue":[C=>p.referenceRecordId=C,C=>c(C,p)],label:p.label,disabled:!p.editable||p.same,options:p.options,lookup:"",search:"",highlight:"",loading:p.loading,property:{key:"Id",value:"Name"},onSearch:C=>e.unref(y)(C,p)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.relatedFields,(C,_)=>(e.openBlock(),e.createElementBlock("div",{key:_,class:"attribute-input"},[C.dataType==="PICKLIST"||C.dataType==="MULTIPICKLIST"?(e.openBlock(),e.createBlock(rn,{key:0,modelValue:C.value,"onUpdate:modelValue":E=>C.value=E,label:C.label,disabled:!C.editable,options:C.picklistValues.map(E=>({label:E,value:E})),select:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):C.dataType==="BOOLEAN"?(e.openBlock(),e.createElementBlock("div",Cy,[e.createElementVNode("label",null,e.toDisplayString(C.label),1),e.createVNode(Er,{modelValue:C.value,"onUpdate:modelValue":E=>C.value=E,disabled:!C.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(e.openBlock(),e.createBlock(Rn,{key:2,label:C.label,disabled:!C.editable,modelValue:C.value,"onUpdate:modelValue":E=>C.value=E,class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))),128))])):(e.openBlock(),e.createElementBlock("div",Ey,[p.dataType==="REFERENCE"?(e.openBlock(),e.createBlock(rn,{key:0,modelValue:p.referenceRecordId,"onUpdate:modelValue":[C=>p.referenceRecordId=C,C=>c(C,p)],label:p.label,disabled:!p.editable,options:p.options,lookup:"",search:"",highlight:"",loading:p.loading,property:{key:"Id",value:"Name"},onSearch:C=>e.unref(y)(C,p)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])):p.dataType==="PICKLIST"||p.dataType==="MULTIPICKLIST"?(e.openBlock(),e.createBlock(rn,{key:1,modelValue:p.value,"onUpdate:modelValue":C=>p.value=C,label:p.label,disabled:!p.editable,options:p.picklistValues.map(C=>({label:C,value:C})),select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):p.dataType==="BOOLEAN"?(e.openBlock(),e.createElementBlock("div",ky,[e.createElementVNode("label",null,e.toDisplayString(p.label),1),e.createVNode(Er,{modelValue:p.value,"onUpdate:modelValue":C=>p.value=C,disabled:!p.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(e.openBlock(),e.createBlock(Rn,{key:3,label:p.label,disabled:!p.editable,modelValue:p.value,"onUpdate:modelValue":C=>p.value=C,highlight:"",class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))],64)}),128))])]),action:e.withCtx(()=>[e.createElementVNode("div",vy,[e.createVNode(qc,{text:"CANCEL",btype:"secondary",onClick:b[0]||(b[0]=p=>f.$emit("close"))}),e.createVNode(qc,{text:"SAVE",btype:"primary",loading:u.value,onClick:h},null,8,["loading"])])]),_:1}))}},[["__scopeId","data-v-d0648f18"]]),wy={class:"datatable"},Ny={class:"m-show"},Sy={key:0},By=["onClick"],Iy={key:1},Ty=["data-test-id","onClick"],Oy={class:"desktop d-show"},Dy={class:"datatable-skeletion"},Vy={class:"datatable-skeletion"},Fy={class:"datatable-skeletion"},My=["colspan"],Ry={style:{display:"flex",gap:"1rem",height:"40px"}},Ly=["onClick"],Py=["data-test-id","onClick"],qy={key:0},$y=["colspan"],Uy={style:{display:"flex",gap:"1rem",height:"40px"}},zy={key:1},jy=["colspan"],Hy={style:{display:"flex","flex-wrap":"wrap",padding:"1rem"}},Gy={key:0,class:"attribute",style:{width:"50%"}},Ky={key:0,class:"ect-flex ect-gap-2"},Xy={key:1,class:"ect-flex ect-gap-2"},Wy={key:1,class:"attribute",style:{width:"50%"}},Qy={key:0},Zy={key:2,class:"attribute",style:{width:"50%"}},Jy={key:0},Yy={key:1},kr=ve({__name:"MoleculeDataTable",props:{rows:{type:Array,default:()=>[]},cols:{type:Array,default:()=>[]},loading:{type:Array,default:()=>[]},style:{type:Object,default:()=>({})},delRecords:{type:Set,default:()=>new Set},rowLoading:{type:Boolean,default:!1},loadingRowId:{type:String,default:null},del:{type:Boolean,default:!1},configure:{type:Boolean,default:!1},hidecolumn:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},isOption:{type:Boolean,default:!1},attribute:{type:[Object,Boolean],default:()=>({})}},emits:["delete","update","configure","reload"],setup(t,{emit:r}){const n=t,o=e.ref(null),a=e.ref(null),i=r,l=e.ref(null),s=e.ref({}),u=e.ref(null),h=e.computed(()=>n.disabled),d=function(_,E){return l.value&&l.value!==_+":"+E||n.delRecords.has(_)||h.value||u.value&&u.value!==_},m=e.computed(()=>{const{headerStyle:_,optionRow:E,productRow:A}=n.style;return{product:{backgroundColor:A.background,verticalAlign:A.verticalAlignment||"middle"},option:{backgroundColor:E.background,verticalAlign:E.verticalAlignment||"middle"},header:{backgroundColor:_.background,verticalAlign:_.verticalAlignment||"middle"}}}),c=e.computed(()=>{const{headerStyle:_,optionRow:E,productRow:A}=n.style;return{header:_.style||{},option:E.style||{},product:A.style||{}}}),y=e.computed(()=>200/n.cols.length+"px");function f(_,E,A){const k={},{table:B}=n.style;if(_){const{alignment:D,strikethrough:w}=_;D&&(k.textAlign=D),w&&(k.textDecoration="line-through")}if(E){const{width:D,minWidth:w}=E;D&&(k.width=`calc(${D.value+D.unit} - ${y.value})`),w&&(k.minWidth=w.value+w.unit)}return B.border!=="n"&&!A?(k.borderStyle="solid",k.borderColor=B.color,B.border==="b"?k.borderWidth=B.width:B.border==="x"?(k.borderTopWidth=B.width,k.borderBottomWidth=B.width,k.borderLeftWidth=0,k.borderRightWidth=0):B.border==="y"?(k.borderLeftWidth=B.width,k.borderRightWidth=B.width,k.borderTopWidth=0,k.borderBottomWidth=0):B.border==="bottom"||B.border==="default"?(k.borderTopWidth=0,k.borderBottomWidth=B.width,k.borderLeftWidth=0,k.borderRightWidth=0):B.border==="top"&&(k.borderTopWidth=B.width,k.borderBottomWidth=0,k.borderLeftWidth=0,k.borderRightWidth=0)):k.borderWidth="0px",k}function b(_,E){var k;if(E.dataType==="REFERENCE")return(k=_[E.content.replace("__c","__r")])==null?void 0:k.Name;const A=We(_,E.api,E.dataType);return A===""?A:E.dataType==="PERCENT"?A+"%":A}function p(_,E){_===0?i("delete",E):x(_,"XX_ORD1__QTY__c",E)}function x(_,E,A){u.value=A.Id,g(_,E,A)}const g=St(function(_,E,A){l.value=A.Id+":"+E,s.value.Id=A.Id,s.value[E]=_;const k=()=>{l.value=null,s.value={},u.value=null};i("update",{record:s.value,callback:k})},500),C=_=>_.content.picklist.map(E=>({label:E,value:E}));return(_,E)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o.value&&a.value?(e.openBlock(),e.createBlock(Ay,{key:0,data:o.value,"quote-id":a.value,onClose:E[0]||(E[0]=A=>(o.value=null,a.value=null)),onReload:E[1]||(E[1]=A=>_.$emit("reload",A))},null,8,["data","quote-id"])):e.createCommentVNode("",!0),e.createElementVNode("div",wy,[e.createElementVNode("div",Ny,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,A=>(e.openBlock(),e.createElementBlock("table",{key:A.Id,class:"mobile md:ect-hidden"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,(k,B)=>{var D,w,v,S;return e.openBlock(),e.createElementBlock("tr",{key:B},[e.createElementVNode("th",{style:e.normalizeStyle({...f(k.header.style),...m.value.header})},[k.header?(e.openBlock(),e.createBlock(Re,{key:0,text:k.header.title,style:e.normalizeStyle(k.header.style),"sec-style":c.value.header},null,8,["text","style","sec-style"])):e.createCommentVNode("",!0)],4),e.createElementVNode("td",{style:e.normalizeStyle({...f(k.content.style),...m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"]})},[k.editable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[k.api==="XX_ORD1__QTY__c"?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>p(I,A)],disabled:d(A.Id,k.api),loading:A.Id+":"+k.api===l.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):k.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(rn,{key:1,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),options:C(k),"use-fixed-position":!0,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(e.openBlock(),e.createBlock(Rn,{key:2,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[k.dataType==="URL"?(e.openBlock(),e.createBlock(bi,{key:0,src:b(A,k)},null,8,["src"])):k.content.isStatic?(e.openBlock(),e.createBlock(Re,{key:1,tag:(D=k.content)==null?void 0:D.style.tag,text:k.content.content,style:e.normalizeStyle((w=k.content)==null?void 0:w.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["tag","text","style","sec-style"])):(e.openBlock(),e.createBlock(Re,{key:2,loading:t.loading.includes(k.dataType)&&(!t.loadingRowId||t.loadingRowId===A.Id),tag:(v=k.content)==null?void 0:v.style.tag,text:b(A,k),style:e.normalizeStyle((S=k.content)==null?void 0:S.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],4)])}),128)),t.del?(e.openBlock(),e.createElementBlock("tr",Sy,[e.createElementVNode("th",{style:e.normalizeStyle({...f(),...m.value.header})},null,4),e.createElementVNode("td",{style:e.normalizeStyle({...f(),...m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"]})},[e.createElementVNode("span",{class:e.normalizeClass(["datatable-remove",{disabled:d(A.Id)}]),onClick:k=>!d(A.Id)&&_.$emit("delete",A)},"REMOVE",10,By)],4)])):e.createCommentVNode("",!0),t.configure&&e.unref(di).includes(A.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(e.openBlock(),e.createElementBlock("tr",Iy,[e.createElementVNode("th",{style:e.normalizeStyle({...f(),...m.value.header})},null,4),e.createElementVNode("td",{style:e.normalizeStyle({...f(),...m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"]})},[e.createElementVNode("div",{class:e.normalizeClass(["datatable-configure",{disabled:d(A.Id)}]),"data-test-id":`expeditecart-list-button-configure-${A.Id}`,onClick:k=>!d(A.Id)&&_.$emit("configure",A)},"CONFIGURE",10,Ty)],4)])):e.createCommentVNode("",!0)]))),128))]),e.createElementVNode("table",Oy,[t.hidecolumn?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,style:e.normalizeStyle(m.value.header)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,A=>{var k;return e.openBlock(),e.createElementBlock("th",{key:A.key,style:e.normalizeStyle(f((k=A.header)==null?void 0:k.style,A.style))},[A.header?(e.openBlock(),e.createBlock(Re,{key:0,text:A.header.title,style:e.normalizeStyle(A.header.style),"sec-style":c.value.header},null,8,["text","style","sec-style"])):e.createCommentVNode("",!0)],4)}),128)),t.del?(e.openBlock(),e.createElementBlock("th",{key:0,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},null,4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("th",{key:1,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},null,4)):e.createCommentVNode("",!0)],4)),t.rowLoading?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},e.renderList(5,A=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:A},[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,k=>(e.openBlock(),e.createElementBlock("td",{key:k.key,style:e.normalizeStyle(f(k.content.style,k.style))},[e.createElementVNode("div",Dy,[e.createVNode(yn)])],4))),128)),t.del?(e.openBlock(),e.createElementBlock("td",{key:0,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},[e.createElementVNode("div",Vy,[e.createVNode(yn)])],4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("th",{key:1,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},[e.createElementVNode("div",Fy,[e.createVNode(yn)])],4)):e.createCommentVNode("",!0)]),t.attribute?(e.openBlock(),e.createElementBlock("td",{key:0,colspan:t.cols.length+2,style:e.normalizeStyle(f())},[e.createElementVNode("div",Ry,[e.createVNode(yn),e.createVNode(yn)])],12,My)):e.createCommentVNode("",!0)],64))),64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(t.rows,A=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:A.Id},[e.createElementVNode("tr",{style:e.normalizeStyle(m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,(k,B)=>{var D,w,v,S;return e.openBlock(),e.createElementBlock("td",{key:B,style:e.normalizeStyle(f(k.content.style,k.style,!!A.Attributes)),class:e.normalizeClass({"padding-left":B==0&&A.XX_ORD1__Parent_QLI__c})},[k.editable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[k.api==="XX_ORD1__QTY__c"?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>p(I,A)],disabled:d(A.Id,k.api),loading:A.Id+":"+k.api===l.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):k.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(rn,{key:1,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),options:C(k),"use-fixed-position":!0,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(e.openBlock(),e.createBlock(Rn,{key:2,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[k.dataType==="URL"?(e.openBlock(),e.createBlock(bi,{key:0,src:b(A,k)},null,8,["src"])):k.content.isStatic?(e.openBlock(),e.createBlock(Re,{key:1,tag:(D=k.content)==null?void 0:D.style.tag,text:k.content.content,style:e.normalizeStyle((w=k.content)==null?void 0:w.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["tag","text","style","sec-style"])):(e.openBlock(),e.createBlock(Re,{key:2,loading:t.loading.includes(k.dataType)&&(!t.loadingRowId||t.loadingRowId===A.Id),tag:(v=k.content)==null?void 0:v.style.tag,text:b(A,k),style:e.normalizeStyle((S=k.content)==null?void 0:S.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],6)}),128)),t.del?(e.openBlock(),e.createElementBlock("td",{key:0,style:e.normalizeStyle({...f(null,null,!!A.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[e.createElementVNode("span",{class:e.normalizeClass(["datatable-remove",{disabled:d(A.Id)}]),onClick:k=>!d(A.Id)&&_.$emit("delete",A)},"REMOVE",10,Ly)],4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("td",{key:1,style:e.normalizeStyle({...f(null,null,!!A.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[e.unref(di).includes(A.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["datatable-configure",{disabled:d(A.Id)}]),"data-test-id":`expeditecart-list-button-configure-${A.Id}`,onClick:k=>!d(A.Id)&&_.$emit("configure",A)}," CONFIGURE ",10,Py)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],4),A.attributesLoading?(e.openBlock(),e.createElementBlock("tr",qy,[e.createElementVNode("td",{colspan:t.cols.length+2,style:e.normalizeStyle(f())},[e.createElementVNode("div",Uy,[e.createVNode(yn),e.createVNode(yn)])],12,$y)])):A.Attributes?(e.openBlock(),e.createElementBlock("tr",zy,[e.createElementVNode("td",{colspan:t.cols.length+2,style:e.normalizeStyle(f())},[e.createElementVNode("div",Hy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.Attributes,(k,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B},[k.value||k.existingValue||k.existingValueReferenceName?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[k.value&&(k.existingValue||k.existingValueReferenceName)?(e.openBlock(),e.createElementBlock("div",Gy,[e.createElementVNode("b",null,e.toDisplayString(k.label)+":",1),k.value!==k.existingValue&&k.value!==k.existingValueReferenceName?(e.openBlock(),e.createElementBlock("div",Ky,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"]),e.createVNode(Re,{text:k.existingValueReferenceName||k.existingValue,style:e.normalizeStyle(t.attribute.old.style)},null,8,["text","style"])])):(e.openBlock(),e.createElementBlock("div",Xy,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.regular.style)},null,8,["text","style"])])),t.attribute.edit&&k.editable&&A.XX_ORD1__QLI_Type__c!=="Remove"?(e.openBlock(),e.createBlock(Cr,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(o.value=A.Attributes,a.value=A.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)])):k.value?(e.openBlock(),e.createElementBlock("div",Wy,[e.createElementVNode("b",null,e.toDisplayString(k.label)+":",1),k.value?(e.openBlock(),e.createElementBlock("div",Qy,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"])])):e.createCommentVNode("",!0),t.attribute.edit&&k.editable?(e.openBlock(),e.createBlock(Cr,{key:1,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(o.value=A.Attributes,a.value=A.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)])):t.attribute.displayonlychanged?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Zy,[e.createElementVNode("b",null,e.toDisplayString(k.label)+":",1),k.value?(e.openBlock(),e.createElementBlock("div",Jy,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"])])):k.existingValue?(e.openBlock(),e.createElementBlock("div",Yy,[e.createVNode(Re,{text:k.existingValueReferenceName||k.existingValue,style:e.normalizeStyle(t.attribute.regular.style)},null,8,["text","style"])])):e.createCommentVNode("",!0),t.attribute.edit&&k.editable?(e.openBlock(),e.createBlock(Cr,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(o.value=A.Attributes,a.value=A.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)]))],64)):e.createCommentVNode("",!0)],64))),128))])],12,jy)])):e.createCommentVNode("",!0)],64))),128))])])],64))}},[["__scopeId","data-v-3b714a31"]]),eg={key:0,class:"prodlist"},tg={class:"prodlist-header"},ng={key:0},og={key:1,class:"summary"},rg={key:1,class:"summary"},ag=ve({__name:"OrganismsProductListBlock",props:{header:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},footer:{type:Array,default:()=>[]},configuration:{type:Object,default:()=>({})},fields:{type:Object,default:()=>({})},id:{type:String,required:!1},isPreview:{type:Boolean,default:!1}},emits:["counts"],setup(t,{emit:r}){const n=Nn(),o=mn(),a=t,i=r,l=T=>T.toUpperCase()||"",s=e.computed(()=>{var T;return((T=a.fields)==null?void 0:T.styling)||{}}),u=e.computed(()=>{var T,O;return(O=(T=a.configuration)==null?void 0:T.allowedActions)==null?void 0:O.delete}),h=e.computed(()=>{var T,O;return(O=(T=a.configuration)==null?void 0:T.allowedActions)==null?void 0:O.configure}),d=e.computed(()=>{var T;return a.configuration.displayAttributes?(T=a.configuration)==null?void 0:T.attribute:!1}),m=e.computed(()=>{var T;return(T=a.configuration)==null?void 0:T.sort}),c=e.computed(()=>{var T;return(T=a.configuration)==null?void 0:T.group}),y=e.computed(()=>{const T=c.value.groupheader.style;return T?I(T):{}}),f=e.computed(()=>{const T=c.value.groupfooter.style;return T?I(T):{}}),b=e.computed(()=>{const T={},{border:O,color:F,width:q}=s.value.table;return O==="default"&&(T.borderStyle="solid",T.borderColor=F,T.borderWidth=q,T.borderTopWidth=0),T}),p=e.computed(()=>B.value?!1:!v.value||v.value.length===0?!0:v.value.every(T=>{const O=T.rows&&T.rows.length>0,F=T.options&&T.options.some(q=>q.rows&&q.rows.length>0);return!O&&!F}));Ko();const x=["CURRENCY","DOUBLE","PERCENT"],g=["CURRENCY","DOUBLE","PERCENT","DATE","DATETIME","TIME","BOOLEAN","STRING","TEXTAREA","REFERENCE","EMAIL","PHONE","URL","TEXTAREA","TEXTAREA"],C=e.ref(null),_=e.ref([]),E=e.ref([]),A=e.ref([]),k=e.ref(!1),B=e.ref(!1),D=e.ref(new Set),w=e.ref([]),v=e.ref([]),S=new Map;function I(T){let O={padding:"1.25rem 2rem"};const{overrite:F,backgroundColor:q,verticalAlignment:M,padding:U}=T;return F&&(O={backgroundColor:q,verticalAlign:M,padding:U||"1.25rem 2rem"}),O}const R=async function({record:T,callback:O}){const F=[];for(const M in T)F.push({fieldName:M,fieldValue:T[M]});const q={fields:F,objectType:a.configuration.objectType};await n.updateRecord(q),O(),T.XX_ORD1__QTY__c!==void 0&&(C.value=T.Id,await W("FIELD_RELOAD"),C.value=null)};async function z(T){C.value=T,await W("RELOAD_ALL_FIELDS"),C.value=null}const $=T=>{Et("expeditecart:configure-clicked",{itemId:T.XX_ORD1__Item__c,lineItemId:T.Id,quoteId:n.quoteId,isPreview:a.isPreview})},X=async function(T){D.value.add(T.Id),k.value=!0;const O=[T.Id];await o.deleteLineItems(O),await W("RELOAD"),k.value=!1,D.value.delete(T.Id)};async function W(T){T==="RELOAD"?B.value=!0:T==="FIELD_RELOAD"?A.value=x:T==="RELOAD_ALL_FIELDS"&&(A.value=g);const{groupby:O,grouplevel:F}=a.configuration.group,q=n.quoteId,M=a.footer.map(H=>({field:H.field,snippet:H.function||"SUM"})),U={filterObject:a.configuration.objectType,fieldsToDisplay:[...E.value,"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c","XX_ORD1__Parent_QLI__c"],aggregateFields:M,filters:a.configuration.filters,parentObjectField:a.configuration.parentObjectField,objectId:q,groupby:O.field,grouplevel:F,primarysort:m.value.primary.field,secondarysort:m.value.secondary.field,primarysortdesc:m.value.primary.direction!=="asc",secondarysortdesc:m.value.secondary.direction!=="asc",filterlogic:a.configuration.filterlogic},L=O.field&&F,j=await n.getRowItems(U,L);L?N(j,F):P(j),a.configuration.displayAttributes&&K(),B.value=!1,A.value=[]}async function K(){const T=C.value,O=[];v.value.forEach(q=>{q.rows.forEach(M=>{M.attributes=S.get(M.Id),console.log("row.attributes",M.attributes),T?M.Attributes=S.get(M.Id):M.attributesLoading=!0,O.push(M.Id)})});const F=await n.getLineItemAttributesNG(O);v.value.forEach(q=>{q.rows.forEach(M=>{const U=F[M.Id];if(U==null?void 0:U.some(j=>j.value&&!d.value.displayonlychanged||j.value&&j.existingValue&&d.value.displayonlychanged)){const j=[],H=new Set;U.forEach(Z=>{H.has(Z.apiName)||(H.add(Z.apiName),j.push(Z))}),M.Attributes=j,S.set(M.Id,j)}M.attributesLoading=!1})}),console.log("attributesByIdMap",S)}function P(T){var M;const O=T.lstRecords,F=[],q=T.lstRecords&&((M=T.lstRecords)==null?void 0:M.length)>0;if(i("counts",q),T.lstAggregateField&&T.lstAggregateField.length>0){const U=new Map;T.lstAggregateField.forEach(L=>{U.set(L.fieldName,L.totalValue)}),a.footer.forEach(L=>{L.value=U.get(L.field),F.push(L)})}v.value=[{rows:O,summary:F}]}function N(T,O){const F=[];let q;T.forEach(M=>{var U;if(O==="option"){if((U=M.product)!=null&&U.thisobject){const L={name:"",rows:[M.product.thisobject],summary:[],isProduct:!0,options:[]};M.options.length>0&&M.options.forEach(j=>{const H={name:j.groupName,rows:[]},Z=[];j.options.forEach(te=>{H.rows.push(te.thisobject)}),j.groupTotals&&j.groupTotals.length>0&&j.groupTotals.forEach(te=>{var ne,Q;Z.push({label:H.name,value:te.amount,style:((Q=(ne=c.value)==null?void 0:ne.groupfooter)==null?void 0:Q.style)||{}})}),H.summary=Z,L.options.push(H)}),F.push(L)}}else{if(q={name:M.groupName,rows:[]},M.productRows.forEach(L=>{q.rows.push(L[O].thisobject),L.options.forEach(j=>{const H={...j.thisobject};H.isOption=!0,q.rows.push(H)})}),c.value.displaygroupfooter){const L=[];M.groupTotals&&M.groupTotals.length>0&&M.groupTotals.forEach(j=>{var H,Z;L.push({label:q.name,value:j.amount,style:((Z=(H=c.value)==null?void 0:H.groupfooter)==null?void 0:Z.style)||{}})}),q.summary=L}else q.summary=[];F.push(q)}}),v.value=F}return e.onBeforeMount(()=>{console.log("Product List - Block Before Mount"),w.value=JSON.parse(JSON.stringify(a.columns)),_.value=a.summary,w.value.forEach(T=>{T.content.dataType=l(T.content.dataType),T.editby=T.editable,T.editable=T.editable!=="not",T.dataType=T.content.dataType,T.api=T.content.field,E.value.push(T.content.field)}),E.value.includes("XX_ORD1__QLI_Type__c")||E.value.push("XX_ORD1__QLI_Type__c"),W("RELOAD")}),(T,O)=>{var F;return p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",eg,[e.createElementVNode("div",tg,[t.header.title?(e.openBlock(),e.createBlock(Re,{key:0,tag:(F=t.header.style)==null?void 0:F.tag,text:t.header.title,style:e.normalizeStyle(t.header.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0)]),!c.value.repeatcolumheadings||B.value?(e.openBlock(),e.createElementBlock("div",ng,[e.createVNode(kr,{cols:w.value,rows:[],summary:[],style:e.normalizeStyle(s.value),loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[0]||(O[0]=q=>z(q))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])])):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(b.value)},[e.createVNode(kr,{hidecolumn:"",cols:w.value,rows:[],summary:[],style:e.normalizeStyle(s.value),"row-loading":!0,loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[1]||(O[1]=q=>z(q))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])],4)):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(b.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,q=>(e.openBlock(),e.createElementBlock("div",{key:q.name,class:e.normalizeClass(["productlist",q.isProduct?"prodlist-product":"prodlist-option"])},[c.value.displaygroupheader&&q.name?(e.openBlock(),e.createElementBlock("div",{key:0,class:"groupHeader",style:e.normalizeStyle(y.value)},[e.createVNode(Re,{text:"Group: "+q.name,style:e.normalizeStyle(c.value.groupheader.style)},null,8,["text","style"])],4)):e.createCommentVNode("",!0),e.createVNode(kr,{hidecolumn:!c.value.repeatcolumheadings,cols:w.value,rows:q.rows,style:e.normalizeStyle(s.value),"row-loading":B.value,loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[2]||(O[2]=M=>z(M))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),q.summary.length>0?(e.openBlock(),e.createElementBlock("div",og,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.summary,(M,U)=>{var L,j,H;return e.openBlock(),e.createElementBlock("div",{key:U,class:"summary_row",style:e.normalizeStyle(f.value)},[e.createVNode(Re,{tag:(L=M==null?void 0:M.style)==null?void 0:L.tag,text:M.label+" : ",style:e.normalizeStyle(M==null?void 0:M.style)},null,8,["tag","text","style"]),e.createTextVNode("   "),e.createVNode(Re,{loading:((j=A.value)==null?void 0:j.length)>0||B.value,tag:(H=M==null?void 0:M.style)==null?void 0:H.tag,text:M.value,style:e.normalizeStyle(M==null?void 0:M.style)},null,8,["loading","tag","text","style"])],4)}),128))])):e.createCommentVNode("",!0),q.options?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(q.options,M=>(e.openBlock(),e.createElementBlock("div",{key:M.name},[c.value.displaygroupheader&&M.name?(e.openBlock(),e.createElementBlock("div",{key:0,class:"groupHeader",style:e.normalizeStyle(y.value)},[e.createVNode(Re,{text:"Group: "+M.name,style:e.normalizeStyle(c.value.groupheader.style)},null,8,["text","style"])],4)):e.createCommentVNode("",!0),e.createVNode(kr,{hidecolumn:!c.value.repeatcolumheadings,cols:w.value,rows:M.rows,style:e.normalizeStyle(s.value),"row-loading":B.value,loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,"is-option":!0,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[3]||(O[3]=U=>z(U))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),M.summary.length>0?(e.openBlock(),e.createElementBlock("div",rg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.summary,(U,L)=>{var j,H,Z;return e.openBlock(),e.createElementBlock("div",{key:L,class:"summary_row",style:e.normalizeStyle(f.value)},[e.createVNode(Re,{tag:(j=U==null?void 0:U.style)==null?void 0:j.tag,text:U.label+" : ",style:e.normalizeStyle(U==null?void 0:U.style)},null,8,["tag","text","style"]),e.createTextVNode("   "),e.createVNode(Re,{loading:((H=A.value)==null?void 0:H.length)>0||B.value,tag:(Z=U==null?void 0:U.style)==null?void 0:Z.tag,text:U.value,style:e.normalizeStyle(U==null?void 0:U.style)},null,8,["loading","tag","text","style"])],4)}),128))])):e.createCommentVNode("",!0)]))),128)):e.createCommentVNode("",!0)],2))),128))],4))]))}}},[["__scopeId","data-v-d933d5c5"]]),ig={class:"detail-section"},lg={key:0,class:"selectedtext sm:hidden"},sg={class:"expand material-icons-outlined"},cg={key:1,class:"detail-section_title"},ug={key:2,class:"detail-section_slot"},dg=ve({__name:"AtomDetailSection",props:{title:{type:String,required:!0},style:{type:Object,default:()=>({})},expand:{type:Boolean,default:!1},header:{type:Boolean,default:!1},selectedText:{type:String,default:""},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["expand"],setup(t,{emit:r}){const n=t;return(o,a)=>{var i,l;return e.openBlock(),e.createElementBlock("div",ig,[n.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["detail-section_header ect-border-solid ect-border-border-db",{"ect-border-b-1":n.expand,"ect-border-b-0":!n.expand}]),onClick:a[0]||(a[0]=s=>!n.disabled&&o.$emit("expand",!n.expand))},[n.title?(e.openBlock(),e.createBlock(Re,{key:0,tag:(i=n.style)==null?void 0:i.tag,text:n.title,style:e.normalizeStyle(n.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createBlock(yn,{key:1,type:"accordian-title"})):e.createCommentVNode("",!0),e.createElementVNode("div",null,[n.selectedText?(e.openBlock(),e.createElementBlock("span",lg,e.toDisplayString(n.selectedText),1)):e.createCommentVNode("",!0),e.createElementVNode("span",sg,e.toDisplayString(n.expand?"expand_more":"expand_less"),1)])],2)):(e.openBlock(),e.createElementBlock("div",cg,[t.title?(e.openBlock(),e.createBlock(Re,{key:0,tag:(l=t.style)==null?void 0:l.tag,text:t.title,style:e.normalizeStyle(t.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0)])),n.expand?(e.openBlock(),e.createElementBlock("div",ug,[e.renderSlot(o.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-3796312d"]]);function fg(t,r,n){if(!r)return t;if(n.aliasName)return hg(t,r,n);{const a=r.split(".").reduce((i,l)=>i[l]||"",t)||"";return{original:a,value:a,metadata:n}}}function hg(t,r,n){var l;const o=r.split(".");let a=r;o.length>1&&(a=o.pop(),t=o.reduce((s,u)=>s[u]||{},t));let i=t[n.aliasName]||t[a]||"";return i&&n.dataType&&((l=n.dataType)==null?void 0:l.toUpperCase())==="CURRENCY"&&i.includes("(")&&(i=i.split("(")[0]),{value:i,original:t[a],metadata:n}}function pg(t){let r=t.replace(/[_.]/g,"")+"Formatted";return console.log("aliasName",r),r}const mg={class:"quote-summary"},yg={key:0,class:"qt-smuarry"},gg={class:"summary ect-mt-[1rem] md:ect-mt-[0]"},bg=ve({__name:"OrganismsQuoteSummaryBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},tax:{type:Boolean,default:!1},quoteId:{type:String,default:""}},setup(t){const r=Nn(),n=t,o=xi(),a=e.computed(()=>{var b;return(b=n.fields)==null?void 0:b.header}),i=e.computed(()=>{var b;return(b=n.fields)==null?void 0:b.content}),l=e.computed(()=>{var b;return(b=n.fields)==null?void 0:b.footer}),s=e.ref(!1),u=e.ref(!1),h=e.ref(!1),d=e.ref([]),m=e.ref({}),c=e.computed(()=>{var b,p;return o.isMobile.value&&!s.value&&l.value&&l.value.length>0?`${l.value[0].label} &nbsp;&nbsp;&nbsp;${((b=m.value[l.value[0].field])==null?void 0:b.value)||""}`:(p=a.value)==null?void 0:p.title});async function y(b){console.log("Quote Summary",b),u.value=!0,h.value&&await r.calculateAvaTax();const p=d.value.map(({field:x})=>x);m.value=await r.getRecordFieldValue({recordId:n.quoteId,lstFields:p}),d.value.forEach(({field:x,dataType:g})=>{m.value[x]=fg(m.value,x,{dataType:g,aliasName:pg(x)})}),u.value=!1}const f=()=>{o.isMobile.value?s.value=!s.value:s.value=!0};return e.onMounted(async()=>{var p,x,g,C,_,E,A,k,B;s.value=!o.isMobile.value;const b=(x=(p=document.querySelector(`[page-block-id="${n.id}"]`))==null?void 0:p.parentElement)==null?void 0:x.parentElement;b&&(b.style.display=o.isMobile.value?"none":"block"),h.value=n.tax||((g=i.value)==null?void 0:g.some(({field:D})=>D==="XX_ORD1__Taxes__c")),(n.quoteId||h.value)&&(d.value=(_=(C=n.fields)==null?void 0:C.content)==null?void 0:_.map(({field:D,dataType:w})=>({field:D,dataType:w})),((A=(E=n.fields)==null?void 0:E.footer)==null?void 0:A.length)>0&&((B=(k=n.fields)==null?void 0:k.footer)==null||B.forEach(({field:D,dataType:w})=>d.value.push({field:D,dataType:w}))),y())}),(b,p)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"#qtsummary",disabled:!e.unref(o).isMobile.value},[e.createElementVNode("div",mg,[t.quoteId?(e.openBlock(),e.createElementBlock("div",yg,[e.createVNode(dg,{expand:s.value,title:c.value,style:e.normalizeStyle(a.value.style),header:e.unref(o).isMobile.value,onExpand:p[0]||(p[0]=x=>f())},{default:e.withCtx(()=>[e.createElementVNode("div",gg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,x=>{var g,C,_,E;return e.openBlock(),e.createElementBlock("div",{key:x.field,class:"summary-item"},[x.label?(e.openBlock(),e.createBlock(Re,{key:0,tag:(g=x.style)==null?void 0:g.tag,text:x.label,style:e.normalizeStyle(x.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),(C=m.value[x.field])!=null&&C.value?(e.openBlock(),e.createBlock(Re,{key:1,loading:u.value,tag:(_=x.style)==null?void 0:_.tag,text:(E=m.value[x.field])==null?void 0:E.value,style:e.normalizeStyle(x.style)},null,8,["loading","tag","text","style"])):e.createCommentVNode("",!0)])}),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,x=>{var g,C,_,E;return e.openBlock(),e.createElementBlock("div",{key:x.field,class:"summary-total"},[x.label?(e.openBlock(),e.createBlock(Re,{key:0,tag:(g=x.style)==null?void 0:g.tag,text:x.label,style:e.normalizeStyle(x.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),(C=m.value[x.field])!=null&&C.value?(e.openBlock(),e.createBlock(Re,{key:1,loading:u.value,tag:(_=x.style)==null?void 0:_.tag,text:(E=m.value[x.field])==null?void 0:E.value,style:e.normalizeStyle(x.style)},null,8,["loading","tag","text","style"])):e.createCommentVNode("",!0)])}),128))])]),_:1},8,["expand","title","style","header"])])):e.createCommentVNode("",!0)])],8,["disabled"]))}},[["__scopeId","data-v-0821469a"]]),xg={primary:{bgColor:"#57c046",textColor:"#ffffff"},secondary:{bgColor:"#acacac",textColor:"#ffffff"},secondaryDark:{bgColor:"#5f5f5f",textColor:"#ffffff"},delete:{bgColor:"#ff6a6a",textColor:"#ffffff"},link:{bgColor:"#ffffff",textColor:"#57c046"},ghost:{bgColor:"#ffffff",textColor:"#5f5f5f"}},_g={name:"ThemeAlt",props:{tag:{type:String,default:"button"},text:{type:String,default:"text",required:!0},type:{type:String,default:"text"},method:{type:String,default:"button"},disabled:{type:Boolean,default:!1},showspinner:{type:Boolean,default:!1}},emits:["clicked"],methods:{getBtnClass(){const t=[];return!this.type||!xg[this.type]||this.type==="primary"?t.push("esg-btn-primary"):this.type==="secondary"?t.push("esg-btn-secondary"):(this.type==="link"||this.type==="ghost")&&t.push("noborder"),this.disabled&&t.push("disabled"),t},getBtnStyle(){return null}}},Cg={key:0,class:"ect-flex ect-justify-center"},Eg={key:1};function kg(t,r,n,o,a,i){const l=e.resolveComponent("AtomSpinner");return e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.tag),e.mergeProps(t.$attrs,{type:n.method,class:["rectangle-button",i.getBtnClass()],style:i.getBtnStyle(),onClick:r[0]||(r[0]=e.withModifiers(s=>t.$emit("clicked"),["prevent"]))}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[n.showspinner?(e.openBlock(),e.createElementBlock("div",Cg,[e.createVNode(l,{class:"item-button_spinner"})])):(e.openBlock(),e.createElementBlock("div",Eg,e.toDisplayString(n.text),1))],!0)]),_:3},16,["type","class","style"])}const vr=ve(_g,[["render",kg],["__scopeId","data-v-7428ebd4"]]),vg={class:"promocode-input"},Ag={class:"m-1"},wg=ve({__name:"OrganismsPromoCodeBlock",props:{fields:{type:Object,default:()=>({})},configuration:{type:Object,default:()=>({})},id:{type:String,required:!0},isPreview:{type:Boolean,default:!1}},setup(t){const r=Nn(),n=t,o=e.computed(()=>n.fields.label),a=e.ref(!1),i=e.ref(""),l=e.ref(!1),s=e.ref(!1),u=e.ref(""),h=e.ref(null),d=async()=>{if(n.isPreview)return;l.value=!0,a.value=!0,s.value=!1,await r.getQLIsForPromoCode();const f=await m(!1);f.error||(u.value=f),l.value=!1},m=async f=>{const p=r.qlisList,x=Math.ceil(p.length/50);let g="";for(let C=0;C<x;C++){const _=C*50,E=_+50,A=C===x-1;if(g=await c(p.slice(_,E),A,f),g&&g.error)return s.value=g.error,h.value.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),l.value=!1,f||(a.value=!1,y(!0)),g}return g},c=async(f,b,p)=>await r.applyPromoCodeNG(p?"":i.value,f,b),y=async f=>{if(n.isPreview)return;l.value=!0,await r.getQLIsForPromoCode(),f!==!0&&(s.value=!1);const b=await m(!0);(!b||b&&!b.error)&&f!==!0&&(a.value=!1,u.value="",i.value=""),l.value=!1};return e.onMounted(async()=>{const f=await r.getPromoCodeInfo();console.log("Offer::",f),f!=null&&f.XX_ORD1__Promo_Code__c&&(i.value=f.XX_ORD1__Promo_Code__c,u.value=f.XX_ORD1__Short_Description__c,a.value=!0)}),(f,b)=>{var p,x,g,C,_,E,A;return e.openBlock(),e.createElementBlock("div",{ref_key:"promocodeRef",ref:h,class:"promocode"},[(p=o.value)!=null&&p.title?(e.openBlock(),e.createBlock(Re,{key:0,text:(x=o.value)==null?void 0:x.title,style:e.normalizeStyle((g=o.value)==null?void 0:g.style)},null,8,["text","style"])):e.createCommentVNode("",!0),e.createElementVNode("div",vg,[e.createVNode(Rn,{modelValue:i.value,"onUpdate:modelValue":[b[0]||(b[0]=k=>i.value=k),b[1]||(b[1]=k=>a.value=!1)],class:"promocode-input_box",disabled:a.value||t.isPreview,error:s.value},null,8,["modelValue","disabled","error"]),l.value?(e.openBlock(),e.createBlock(ya,{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.value?(e.openBlock(),e.createBlock(vr,{key:1,theme:(E=t.fields.removeButton)==null?void 0:E.style.theme,disabled:i.value.length<1,text:(A=t.fields.removeButton)==null?void 0:A.title,onClick:y},null,8,["theme","disabled","text"])):(e.openBlock(),e.createBlock(vr,{key:0,theme:(C=t.fields.applyButton)==null?void 0:C.style.theme,disabled:i.value.length<1,text:(_=t.fields.applyButton)==null?void 0:_.title,onClick:d},null,8,["theme","disabled","text"]))],64)),e.createElementVNode("span",Ag,e.toDisplayString(u.value),1)])],512)}}},[["__scopeId","data-v-861bd8dd"]]),Uc={"af-ZA":"yyyy/MM/dd","am-ET":"dd/MM/yyyy","ar-AE":"dd/MM/yyyy","ar-BH":"dd/MM/yyyy","ar-DZ":"dd-MM-yyyy","ar-EG":"dd/MM/yyyy","ar-IQ":"dd/MM/yyyy","ar-JO":"dd/MM/yyyy","ar-KW":"dd/MM/yyyy","ar-LB":"dd/MM/yyyy","ar-LY":"dd/MM/yyyy","ar-MA":"dd-MM-yyyy","ar-OM":"dd/MM/yyyy","ar-QA":"dd/MM/yyyy","ar-SA":"dd/MM/yyyy","ar-SY":"dd/MM/yyyy","ar-TN":"dd-MM-yyyy","ar-YE":"dd/MM/yyyy","arn-CL":"dd-MM-yyyy","as-IN":"dd-MM-yyyy","ba-RU":"dd.MM.yyyy","de-BE":"dd.MM.yyyy","be-BY":"dd.MM.yyyy","bg-BG":"dd.MM.yyyy","bn-BD":"dd-MM-yyyy","bs-BA":"yyyy-MM-dd","bn-IN":"dd-MM-yyyy","bo-CN":"yyyy/MM/dd","br-FR":"dd/MM/yyyy","ca-ES":"dd/MM/yyyy","co-FR":"dd/MM/yyyy","cs-CZ":"dd.MM.yyyy","cy-GB":"dd/MM/yyyy","da-DK":"dd.MM.yyyy","de-AT":"dd.MM.yyyy","de-CH":"dd.MM.yyyy","de-DE":"dd.MM.yyyy","de-LI":"dd.MM.yyyy","de-LU":"dd.MM.yyyy","dsb-DE":"dd.MM.yyyy","dv-MV":"dd/MM/yyyy","el-GR":"dd/MM/yyyy","en-029":"MM/dd/yyyy","en-AU":"dd/MM/yyyy","en-BZ":"dd/MM/yyyy","en-CA":"yyyy-MM-dd","en-GB":"dd/MM/yyyy","en-IE":"dd/MM/yyyy","en-ID":"dd/MM/yyyy","en-IN":"dd/MM/yyyy","lu-CD":"dd/MM/yyyy","en-JM":"dd/MM/yyyy","en-HK":"dd/MM/yyyy","en-MY":"dd/MM/yyyy","en-NZ":"dd/MM/yyyy","en-PH":"MM/dd/yyyy","en-SG":"dd/MM/yyyy","en-TT":"dd/MM/yyyy","en-US":"MM/dd/yyyy","en-ZA":"yyyy/MM/dd","en-ZW":"MM/dd/yyyy","es-AR":"dd/MM/yyyy","es-BO":"dd/MM/yyyy","es-CL":"dd-MM-yyyy","es-CO":"dd/MM/yyyy","es-CR":"dd/MM/yyyy","es-DO":"dd/MM/yyyy","es-EC":"dd/MM/yyyy","es-ES":"dd/MM/yyyy","es-GT":"dd/MM/yyyy","es-HN":"dd/MM/yyyy","es-MX":"dd/MM/yyyy","es-NI":"dd/MM/yyyy","es-PA":"MM/dd/yyyy","es-PE":"dd/MM/yyyy","es-PR":"dd/MM/yyyy","es-PY":"dd/MM/yyyy","es-SV":"dd/MM/yyyy","es-US":"MM/dd/yyyy","es-UY":"dd/MM/yyyy","es-VE":"dd/MM/yyyy","et-EE":"dd.MM.yyyy","eu-ES":"yyyy/MM/dd","fa-IR":"MM/dd/yyyy","fi-FI":"dd.MM.yyyy","fil-PH":"MM/dd/yyyy","fo-FO":"dd-MM-yyyy","fr-BE":"dd/MM/yyyy","fr-CA":"yyyy-MM-dd","fr-CH":"dd.MM.yyyy","fr-FR":"dd/MM/yyyy","fr-LU":"dd/MM/yyyy","fr-MC":"dd/MM/yyyy","fy-NL":"dd-MM-yyyy","ga-IE":"dd/MM/yyyy","gd-GB":"dd/MM/yyyy","gl-ES":"dd/MM/yyyy","gsw-FR":"dd/MM/yyyy","gu-IN":"dd-MM-yyyy","ha-Latn-NG":"dd/MM/yyyy","he-IL":"dd/MM/yyyy","hi-IN":"dd/MM/yyyy","hr-BA":"dd.MM.yyyy.","hr-HR":"dd.MM.yyyy","hsb-DE":"dd.MM.yyyy","hu-HU":"yyyy.MM.dd.","hy-AM":"dd.MM.yyyy","ib-LU":"dd.MM.yyyy","id-ID":"dd/MM/yyyy","ig-NG":"dd/MM/yyyy","ii-CN":"yyyy/MM/dd","in-ID":"dd/MM/yyyy","is-IS":"dd.MM.yyyy","it-CH":"dd.MM.yyyy","it-IT":"dd/MM/yyyy","iu-Cans-CA":"dd/MM/yyyy","iu-Latn-CA":"dd/MM/yyyy","ja-JP":"yyyy/MM/dd","ka-GE":"dd.MM.yyyy","kk-KZ":"dd.MM.yyyy","kl-GL":"dd-MM-yyyy","km-KH":"dd/MM/yyyy","kn-IN":"dd-MM-yyyy","ko-KR":"yyyy.MM.dd","kok-IN":"dd-MM-yyyy","ky-KG":"dd.MM.yyyy","lb-LU":"dd/MM/yyyy","lo-LA":"dd/MM/yyyy","lt-LT":"yyyy.MM.dd","lv-LV":"yyyy.MM.dd.","mi-NZ":"dd/MM/yyyy","mk-MK":"dd.MM.yyyy","ml-IN":"dd-MM-yyyy","mn-MN":"yyyy.MM.dd","mn-Mong-CN":"yyyy/MM/dd","moh-CA":"MM/dd/yyyy","mr-IN":"dd-MM-yyyy","ms-BN":"dd/MM/yyyy","ms-MY":"dd/MM/yyyy","mt-MT":"dd/MM/yyyy","nb-NO":"dd.MM.yyyy","ne-NP":"MM/dd/yyyy","nl-BE":"dd/MM/yyyy","nl-NL":"dd-MM-yyyy","nn-NO":"dd.MM.yyyy","nso-ZA":"yyyy/MM/dd","oc-FR":"dd/MM/yyyy","or-IN":"dd-MM-yyyy","pa-IN":"dd-MM-yyyy","pl-PL":"dd.MM.yyyy","prs-AF":"dd/MM/yyyy","ps-AF":"dd/MM/yyyy","pt-BR":"dd/MM/yyyy","pt-PT":"dd/MM/yyyy","qut-GT":"dd/MM/yyyy","quz-BO":"dd/MM/yyyy","quz-EC":"dd/MM/yyyy","quz-PE":"dd/MM/yyyy","rm-CH":"dd/MM/yyyy","ro-RO":"dd.MM.yyyy","ru-RU":"dd.MM.yyyy","rw-RW":"MM/dd/yyyy","sa-IN":"dd-MM-yyyy","sah-RU":"MM.dd.yyyy","sh-CS":"dd.MM.yyyy","sr-CS":"dd.MM.yyyy","se-FI":"dd.MM.yyyy","se-NO":"dd.MM.yyyy","se-SE":"yyyy-MM-dd","si-LK":"yyyy-MM-dd","sk-SK":"dd.MM.yyyy","sl-SI":"dd.MM.yyyy","sma-NO":"dd.MM.yyyy","sma-SE":"yyyy-MM-dd","smj-NO":"dd.MM.yyyy","smj-SE":"yyyy-MM-dd","smn-FI":"dd.MM.yyyy","sms-FI":"dd.MM.yyyy","sq-AL":"yyyy-MM-dd","sr-Cyrl-BA":"dd.MM.yyyy","sr-Cyrl-CS":"dd.MM.yyyy","sr-Cyrl-ME":"dd.MM.yyyy","sr-Cyrl-RS":"dd.MM.yyyy","sr-Latn-BA":"dd.MM.yyyy","sr-Latn-CS":"dd.MM.yyyy","sr-Latn-ME":"dd.MM.yyyy","sr-Latn-RS":"dd.MM.yyyy","sv-FI":"dd.MM.yyyy","sv-SE":"yyyy-MM-dd","sw-KE":"MM/dd/yyyy","syr-SY":"dd/MM/yyyy","ta-IN":"dd-MM-yyyy","te-IN":"dd-MM-yyyy","tg-Cyrl-TJ":"dd.MM.yyyy","th-TH":"dd/MM/yyyy","tk-TM":"dd.MM.yyyy","tn-ZA":"yyyy/MM/dd","tr-TR":"dd.MM.yyyy","tt-RU":"dd.MM.yyyy","tzm-Latn-DZ":"dd-MM-yyyy","ug-CN":"yyyy-MM-dd","uk-UA":"dd.MM.yyyy","ur-PK":"dd/MM/yyyy","uz-Cyrl-UZ":"dd.MM.yyyy","uz-Latn-UZ":"dd/MM yyyy","vi-VN":"dd/MM/yyyy","wo-SN":"dd/MM/yyyy","xh-ZA":"yyyy/MM/dd","yo-NG":"dd/MM/yyyy","zh-CN":"yyyy/MM/dd","zh-HK":"dd/MM/yyyy","zh-MO":"dd/MM/yyyy","zh-SG":"dd/MM/yyyy","zh-TW":"yyyy/MM/dd","zu-ZA":"MM/dd/yyyy"};function Ng(t){return Uc[t]||"dd/MM/yyyy"}function Sg(t,r){if((t==null?void 0:t.length)<6||!r)return null;const n=Uc[r]||"dd/MM/yyyy",o=n.includes("/")?"/":n.includes("-")?"-":".",a=n.split(o),i=t.split(o),l={};if(a.forEach((u,h)=>{l[u]=parseInt(i[h])}),l.yyyy>9999||l.yyyy<1e3||l.MM<0||l.MM>12||l.dd<0||l.dd>31)return null;const s=new Date(l.yyyy,l.MM-1,l.dd);return s!="Invalid Date"?s:null}const Ar=t=>(e.pushScopeId("data-v-13eaa242"),t=t(),e.popScopeId(),t),Bg=["data-test-id"],Ig=["for","data-test-id"],Tg=["data-test-id"],Og=["placeholder","data-test-id"],Dg=["data-test-id"],Vg=["data-test-id"],Fg=["data-test-id"],Mg=["data-test-id"],Rg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-left-arrows"},null,-1))],Lg=["data-test-id"],Pg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-left-arrow"},null,-1))],qg=["data-test-id"],$g=["data-test-id"],Ug=["data-test-id"],zg=["data-test-id"],jg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-right-arrow"},null,-1))],Hg=["data-test-id"],Gg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-right-arrows"},null,-1))],Kg=["data-test-id"],Xg={class:"c-container"},Wg={class:"cc-head"},Qg={class:"cc-body"},Zg={class:"cdc-day"},Jg=["onClick"],Yg=60*60*24*1e3,e7=ve({__name:"InputDatepicker",props:{locale:{type:String,default:"en-US"},max:{type:[Date,String]},min:{type:[Date,String]},label:{type:String,default:""},error:{type:[Boolean,String]},required:{type:Boolean,default:!1},modelValue:{type:String},highlight:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},fixed:{type:Boolean,default:!1},refrence:{type:Object},disableYear:{type:Boolean,default:!1},disableMonth:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:modelValue","focus-in","focus-out","error"],setup(t,{emit:r}){const n=t,o=r,a=Date.now()-Date.now()%Yg+new Date().getTimezoneOffset()*1e3*60,i=Q=>{if(!Q)return"";const[ce,ue,pe]=Q.split("-");return`${ue}/${pe}/${ce}`},l=Q=>{if(!Q)return"";const[ce,ue,pe]=Q.split("/");return`${pe}-${ce.padStart(2,"0")}-${ue.padStart(2,"0")}`},s=e.ref({year:new Date().getFullYear(),month:new Date().getMonth(),selectedDay:a,monthDetails:[]}),u=e.ref({position:"fixed",top:"0px",left:"0px",width:"0px"}),h=["SUN","MON","TUE","WED","THU","FRI","SAT"],d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],m=["January","February","March","April","May","June","July","August","September","October","November","December"],c=e.ref(new Date(1e3,0,1)),y=e.ref(new Date(9999,0,1)),f=e.ref(!0),b=e.ref(!1),p=e.ref(""),x=e.ref(""),g=e.ref(!1),C=e.ref(""),_=e.ref(-1),E=e.computed(()=>Ng(n.locale)),A=e.computed(()=>c.value.getFullYear()<s.value.year),k=e.computed(()=>y.value.getFullYear()>s.value.year),B=e.computed(()=>A.value||c.value.getMonth()<s.value.month),D=e.computed(()=>k.value||y.value.getMonth()>s.value.month),w=e.computed(()=>{if(x.value){const Q=x.value.getTime();if(y.value.getTime()<Q)return"Max date can be "+y.value.toLocaleDateString(n.locale);if(c.value.getTime()>Q)return"Min date can be "+c.value.toLocaleDateString(n.locale)}return!1}),v=e.computed(()=>{let Q=n.error===""?!1:n.error===!0?`${n.label||"Field"} is required`:n.error;return f.value||(Q="Date format must be "+E.value),w.value&&(Q=w.value),o("error",Q),Q}),S=e.computed(()=>(C.value==""||C.value==null)&&(n.modelValue==""||n.modelValue==null)?!1:C.value!=n.modelValue);e.watch(()=>n.modelValue,Q=>{p.value=Q?i(Q):""}),e.watch(()=>n.min,Q=>{c.value=Q?new Date(Q):new Date(1e3,0,1)}),e.watch(()=>n.max,Q=>{y.value=Q?new Date(Q):new Date(9999,0,1)}),e.watch(p,Q=>{if(Q)try{const ce=Sg(Q,n.locale);if(x.value=ce||x.value,f.value=!!ce,f.value){const ue=l(Q);if(C.value===ue)return;o("update:modelValue",ue)}}catch(ce){console.info("[ERROR]: Date parsing error:",ce),f.value=!1}else f.value=!0,x.value=null,o("update:modelValue","")});const I=e.ref(null),R=e.ref(null),z=e.ref(null);e.onMounted(()=>{ne(),y.value=n.max?new Date(n.max):y.value,c.value=n.min?new Date(n.min):c.value,n.modelValue&&(p.value=i(n.modelValue),f.value=!!p.value),C.value=n.modelValue,window.addEventListener("resize",$),window.addEventListener("scroll",$,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0)});const $=()=>{if(!z.value)return;const Q=z.value.getBoundingClientRect(),ce=334;u.value={position:"fixed",top:`${Q.bottom+4}px`,left:`${Q.left}px`,width:`${ce}px`,zIndex:9999}},X=()=>{g.value||(L(),g.value=!0,$(),o("focus-in"))},W=(Q=!1)=>{(!b.value||Q)&&setTimeout(()=>{_.value=-1,g.value=!1,o("focus-out",x.value)},100)},K=()=>{R.value&&R.value.focus()},P=Q=>{const ce=Q.index-Q.firstDay,ue=Q.index%7;let pe=Q.month-1,ie=Q.year;pe<0&&(pe=11,ie--);const de=N(ie,pe),_e=(ce<0?de+ce:ce%Q.numberOfDays)+1,xe=new Date(Q.year,Q.month,_e).getTime(),ye=ce<0||c.value.getTime()>xe?-1:ce>=Q.numberOfDays||y.value.getTime()<xe?1:0;return{date:_e,day:ue,month:ye,timestamp:xe,dayString:d[ue]}},N=(Q,ce)=>40-new Date(Q,ce,40).getDate(),T=(Q,ce)=>{const ue=new Date(Q,ce).getDay(),pe=N(Q,ce),ie=[],de=6;let _e=null,xe=0;const ye=7;for(let oe=0;oe<de;oe++)for(let le=0;le<ye;le++)_e=P({index:xe,numberOfDays:pe,firstDay:ue,year:Q,month:ce}),ie.push(_e),xe++;return ie},O=Q=>Q.timestamp===a,F=Q=>Q.timestamp===s.value.selectedDay,q=Q=>{if(!Q)return null;if(Q instanceof Date)return{year:Q.getFullYear(),month:Q.getMonth()+1,date:Q.getDate()};if(typeof Q=="string"&&Q.includes("/")){const[ce,ue,pe]=Q.split("/");return{year:parseInt(pe),month:parseInt(ce),date:parseInt(ue)}}return null},M=Q=>m[Math.max(Math.min(11,Q),0)]||"Month",U=Q=>{const ce=new Date(Q.year,Q.month-1,Q.date).getTime();s.value={selectedDay:ce}},L=()=>{ne();const Q=q(x.value);Q!==null&&(U(Q),s.value={year:Q.year,month:Q.month-1,monthDetails:T(Q.year,Q.month-1)})},j=Q=>{const ce=new Date(Q),ue=(ce.getMonth()+1).toString().padStart(2,"0"),pe=ce.getDate().toString().padStart(2,"0"),ie=ce.getFullYear();return p.value=`${ue}/${pe}/${ie}`,`${ie}-${ue}-${pe}`},H=Q=>{s.value={selectedDay:Q.timestamp};const ce=j(Q.timestamp);W(!0),o("update:modelValue",ce),R.value&&R.value.blur()},Z=Q=>{if(n.disableYear)return;const ce=s.value.year+Q;let ue=s.value.month;c.value.getFullYear()===ce&&c.value.getMonth()>ue&&(ue=c.value.getMonth()),y.value.getFullYear()===ce&&y.value.getMonth()<ue&&(ue=y.value.getMonth()),s.value={year:ce,month:ue,monthDetails:T(ce,ue)}},te=Q=>{if(n.disableMonth)return;let ce=s.value.year,ue=s.value.month+Q;ue===-1?(ue=11,ce--):ue===12&&(ue=0,ce++),s.value={year:ce,month:ue,monthDetails:T(ce,ue)}},ne=()=>{const Q=new Date,ce=Q.getFullYear(),ue=Q.getMonth();s.value={...s.value,year:ce,month:ue,selectedDay:a,monthDetails:T(ce,ue)}};return(Q,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"datePick",ref:I,class:"MyDatePicker","data-test-id":t.dataTestId,onMouseover:ce[2]||(ce[2]=ue=>b.value=!0),onMouseout:ce[3]||(ce[3]=ue=>b.value=!1)},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(["title_label",{error_color:!!v.value}]),for:t.label,"data-test-id":`${t.dataTestId}-label`},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass({error_color:!!v.value})},"*",2)):e.createCommentVNode("",!0)],10,Ig)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"triggerElement",ref:z,tabindex:"0",class:e.normalizeClass(["mdp-input ectheme-input-box ect-mb-0",{"mdp-input_focus":g.value,errorBorder_color:!!v.value,highlight:S.value&&t.highlight}]),"data-test-id":`${t.dataTestId}-input-wrapper`,onFocusin:X,onFocusout:ce[1]||(ce[1]=ue=>W(!1)),onClick:K},[e.withDirectives(e.createElementVNode("input",{id:"calendar",ref_key:"inputRef",ref:R,"onUpdate:modelValue":ce[0]||(ce[0]=ue=>p.value=ue),type:"text",autocomplete:"off",placeholder:E.value,"data-test-id":`${t.dataTestId}-input`},null,8,Og),[[e.vModelText,p.value]]),e.createVNode(Be,{icon:"calendar_today",size:18,for:"calendar","data-test-id":`${t.dataTestId}-calendar-icon`},null,8,["data-test-id"])],42,Tg),v.value?(e.openBlock(),e.createElementBlock("label",{key:1,class:"error_label","data-test-id":`${t.dataTestId}-error`},[e.createElementVNode("p",null,e.toDisplayString(v.value),1)],8,Dg)):e.createCommentVNode("",!0)],40,Bg),(e.openBlock(),e.createBlock(e.Teleport,{to:".dropdowntp"},[g.value&&!t.disabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mdp-container",style:e.normalizeStyle(u.value),"data-test-id":`${t.dataTestId}-calendar-popup`,onMousedown:ce[8]||(ce[8]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",{class:"mdpc-head","data-test-id":`${t.dataTestId}-calendar-header`},[e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-prev-year-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!A.value||t.disableYear}]),onClick:ce[4]||(ce[4]=ue=>Z(-1))},Rg,2)],8,Mg),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-prev-month-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!B.value||t.disableMonth}]),onClick:ce[5]||(ce[5]=ue=>te(-1))},Pg,2)],8,Lg),e.createElementVNode("div",{class:"mdpch-container","data-test-id":`${t.dataTestId}-date-display`},[e.createElementVNode("div",{class:"mdpchc-year","data-test-id":`${t.dataTestId}-year-display`},e.toDisplayString(s.value.year),9,$g),e.createElementVNode("div",{class:"mdpchc-month","data-test-id":`${t.dataTestId}-month-display`},e.toDisplayString(M(s.value.month)),9,Ug)],8,qg),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-next-month-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!D.value||t.disableMonth}]),onClick:ce[6]||(ce[6]=ue=>te(1))},jg,2)],8,zg),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-next-year-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!k.value||t.disableYear}]),onClick:ce[7]||(ce[7]=ue=>Z(1))},Gg,2)],8,Hg)],8,Fg),e.createElementVNode("div",{class:"mdpc-body","data-test-id":`${t.dataTestId}-calendar-body`},[e.createElementVNode("div",Xg,[e.createElementVNode("div",Wg,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(h,(ue,pe)=>e.createElementVNode("div",{key:pe,class:"cch-name"},e.toDisplayString(ue),1)),64))]),e.createElementVNode("div",Qg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value.monthDetails,(ue,pe)=>(e.openBlock(),e.createElementBlock("div",{key:pe,class:e.normalizeClass(["c-day-container",{disabled:ue.month!==0,highlight:O(ue),"highlight-green":F(ue)}])},[e.createElementVNode("div",Zg,[e.createElementVNode("span",{onClick:ie=>H(ue)},e.toDisplayString(ue.date),9,Jg)])],2))),128))])])],8,Kg)],44,Vg)):e.createCommentVNode("",!0)]))],64))}},[["__scopeId","data-v-13eaa242"]]),zc=t=>(e.pushScopeId("data-v-9b473c8b"),t=t(),e.popScopeId(),t),t7=zc(()=>e.createElementVNode("div",{class:"dropdowntp"},null,-1)),n7={key:0,class:"custom-form_block"},o7={class:"custom-form_block-header"},r7={key:0,class:"custom-form_block-content"},a7={key:1,class:"custom-form_block-content"},i7={key:2,class:"custom-form_block-footer"},l7={key:3,class:"custom-form_block-action"},s7={key:1,class:"custom-form_success"},c7={class:"custom-form_success_message"},u7=zc(()=>e.createElementVNode("span",{class:"custom-form_success_message-icon material-icons-outlined"}," done ",-1)),d7=ve({__name:"OrganismsCustomFormBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},options:{type:Object,default:()=>({})},quoteId:{type:String,default:""}},setup(t,{expose:r}){var B;const n=Nn(),o=t,a=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,i=e.ref({}),l=e.ref(!1),s=e.ref(!1),u=e.ref(!1),h=e.ref({}),d=e.ref({}),m=e.computed(()=>{var D;return(D=o.fields)==null?void 0:D.header}),c=e.computed(()=>{var D;return(D=o.fields)==null?void 0:D.footer}),y=e.computed(()=>o.fields&&o.fields.action&&o.fields.action.label?o.fields.action:!1),f=e.computed(()=>"en-US"),b=e.computed(()=>{var D;return(D=o.fields)==null?void 0:D.confirmation}),p=e.computed(()=>o.configuration),x=e.ref(JSON.parse(JSON.stringify((B=o.fields)==null?void 0:B.content))),g=D=>D?"custom-form_block-content_"+D.toLowerCase():"custom-form_block-content_full",C=()=>{u.value=!1,x.value.forEach(D=>{p.value.populate||(i.value[D.field]="")})},_=St(async function(D,w,v){x.value[v].loading=!0;const S={objectApiName:o.configuration.objectType,lookupFieldApiName:w,searchTerm:D||""},I=await n.getLookupRecords(S);console.log("Records:::",I),x.value[v].options=I,x.value[v].loading=!1}),E=St(()=>{!y.value&&!o.fields.isGuidance&&A(!0)},500),A=async D=>{console.log("handlerActionClick");let w=!1;if(x.value.forEach(v=>{v.isFormulaField||(v.dataType==="DATETIME"?i.value[v.field]=new Date().toISOString():v.required&&v.editable&&!i.value[v.field]&&v.dataType!=="BOOLEAN"?(v.error=!0,w=!0):(v.error=null,v.dataType==="EMAIL"&&i.value[v.field]&&!a.test(i.value[v.field])&&(v.error="Enter a valid email",w=!0)))}),!w){s.value=!0;const v=[];for(const I in i.value)(d.value[I]||I==="Id")&&v.push({fieldName:I,fieldValue:i.value[I]});const S={fields:v,objectType:o.configuration.objectType};if(o.options&&o.options.returnError){const I=await n.updateRecord(S,!0);if(!I||typeof I=="object"&&I.ERROR)return console.log("Error in saving",I),s.value=!1,I?I.ERROR:!1}else if(!await n.updateRecord(S))return s.value=!1,!1;return s.value=!1,D||(u.value=!0),!0}};async function k(){l.value=!0;const D=x.value.filter(v=>v.dataType!=="DATETIME").map(v=>v.field);let w={};if(p.value.populate&&o.quoteId&&D.length)try{w=await n.getRecordFieldValue({recordId:o.quoteId,lstFields:D})||{}}catch(v){console.error("[OrganismsCustomFormBlock] getRecordFieldValue failed",v)}x.value.forEach(v=>{var S,I,R;if(v.visiblity=v.dataType!=="DATETIME",p.value.populate&&o.quoteId)if(v.dataType==="BOOLEAN")i.value[v.field]=((S=w[v.field])==null?void 0:S.value)??!1;else if(v.dataType==="REFERENCE"){const z=v.field.replace("__c","__r"),$=(I=w[z])==null?void 0:I.value;$&&(i.value[v.field]=$.Id,v.options=[{Name:$.Name,Id:$.Id}])}else v.dataType==="DATE"?i.value[v.field]=((R=w[v.field])==null?void 0:R.value)??"":i.value[v.field]=We(w,v.field,v.dataType,!0,!0);v.editable&&v.dataType==="PICKLIST"&&(v.options=v.picklist.map(z=>({label:z,value:z})))}),l.value=!1}return e.onBeforeMount(async()=>{l.value=!0,h.value=JSON.parse(JSON.stringify(o.fields)),x.value=h.value.content,x.value.forEach(D=>{d.value[D.field]=D.editable&&!D.isFormulaField,D.size=g(D.size)}),h.value.request=i.value={Id:o.quoteId},o.quoteId&&await k()}),r({handlerActionClick:A}),(D,w)=>{var v,S,I,R,z,$,X;return e.openBlock(),e.createElementBlock(e.Fragment,null,[t7,u.value?(e.openBlock(),e.createElementBlock("div",s7,[e.createElementVNode("div",c7,[u7,e.createTextVNode("   "+e.toDisplayString((X=b.value)==null?void 0:X.label),1)]),b.value&&b.value.close?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:C},"click to close")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",n7,[e.createElementVNode("div",o7,[(v=m.value)!=null&&v.title?(e.openBlock(),e.createBlock(Re,{key:0,text:(S=m.value)==null?void 0:S.title,style:e.normalizeStyle((I=m.value)==null?void 0:I.style)},null,8,["text","style"])):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",r7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(W,K)=>(e.openBlock(),e.createElementBlock("div",{key:K,class:e.normalizeClass(["custom-form_block-content_skeletion",W.size])},[e.createVNode(Qt)],2))),128))])):l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",a7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(W,K)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:K},[W.visiblity?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["custom-form_block-content_input",W.size])},[W.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(rn,{key:0,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],options:W.options,disabled:!W.editable,select:"",error:W.error,required:W.required,label:W.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label"])):W.dataType==="BOOLEAN"?(e.openBlock(),e.createBlock(Er,{key:1,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],label:W.label},null,8,["modelValue","onUpdate:modelValue","label"])):W.dataType==="REFERENCE"?(e.openBlock(),e.createBlock(rn,{key:2,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],options:W.options,disabled:!W.editable,lookup:"",search:"",error:W.error,required:W.required,label:W.label,loading:W.loading,highlight:"",property:{key:"Id",value:"Name"},onSearch:P=>e.unref(_)(P,W.field,K)},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label","loading","onSearch"])):W.dataType==="DATE"?(e.openBlock(),e.createBlock(e7,{key:3,modelValue:i.value[W.field],"onUpdate:modelValue":P=>i.value[W.field]=P,label:W.label,required:W.required,disabled:!W.editable,error:W.error,locale:f.value,"data-test-id":`cart-customform-datepicker-${W.field}`,highlight:""},null,8,["modelValue","onUpdate:modelValue","label","required","disabled","error","locale","data-test-id"])):W.visiblity?(e.openBlock(),e.createBlock(Rn,{key:4,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],error:W.error,required:W.required,disabled:!W.editable,label:W.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","error","required","disabled","label"])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],64))),128))])),c.value?(e.openBlock(),e.createElementBlock("div",i7,[(R=c.value)!=null&&R.title?(e.openBlock(),e.createBlock(Re,{key:0,text:(z=c.value)==null?void 0:z.title,style:e.normalizeStyle(($=c.value)==null?void 0:$.style)},null,8,["text","style"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("div",l7,[s.value?(e.openBlock(),e.createBlock(ya,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createBlock(vr,{key:1,theme:y.value.style.theme,text:y.value.label,onClick:w[0]||(w[0]=W=>A(!1))},null,8,["theme","text"]))])):e.createCommentVNode("",!0)]))],64)}}},[["__scopeId","data-v-9b473c8b"]]),f7={class:"custom-button"},h7={class:"loader"},p7=ve({__name:"OrganismsCustomButtonBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},isPreview:{type:Boolean,default:!1}},setup(t){const r=Nn(),n=mn(),o=e.ref(null),a=t,i=e.computed(()=>{var d;return!!((d=n.quoteRecord)!=null&&d.XX_ORD1__Active_Customer_Contact__c)||!0}),l=e.computed(()=>{var d,m;return(m=(d=a.fields)==null?void 0:d.actions)==null?void 0:m.filter(c=>i.value?c.action!=="ACTIVATE":c.action!=="SAVE_FOR_LATER")}),s=d=>d.key??`${d.action}-${d.label}`,u=d=>o.value===s(d),h=d=>{if(a.isPreview)return;const m=s(d);d.action==="SAVE_FOR_LATER"&&(o.value=m),Et("expeditecart:clicked",{action:d.action,label:d.label,targetTemplateId:d.targetTemplateId,quoteId:r.quoteId,isActive:i.value,isPreview:a.isPreview})};return(d,m)=>(e.openBlock(),e.createElementBlock("div",f7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(c,y)=>(e.openBlock(),e.createBlock(vr,{key:y,theme:c.style.theme,text:c.label,class:"custom-button_action",onClick:f=>h(c)},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass({"text-loading":u(c)})},e.toDisplayString(c.label),3),e.createElementVNode("span",h7,[u(c)?(e.openBlock(),e.createBlock(Pc,{key:0})):e.createCommentVNode("",!0)])]),_:2},1032,["theme","text","onClick"]))),128))]))}},[["__scopeId","data-v-3245ee72"]]),_i=function(t,r){const n={};n.sectionStyle={},n.blockStyle={};const{visiblity:o}=t;n.visibility=o;const{layout:a}=t;if(n.blockStyle=m7(a,r),a&&(a!=null&&a.padding)){const{top:s,bottom:u,left:h,right:d}=a.padding;s&&(n.sectionStyle.paddingTop=`${s}px`),u&&(n.sectionStyle.paddingBottom=`${u}px`),h&&(n.sectionStyle.paddingLeft=`${h}px`),d&&(n.sectionStyle.paddingRight=`${d}px`)}a!=null&&a.gap&&(n.sectionStyle.gap=`${a.gap}px`);const{styling:i}=t;i&&(i.verticalAlignment&&(n.sectionStyle.alignItems=i.verticalAlignment),i.radius&&(n.sectionStyle.borderRadius=i.radius),i.borderStyle&&(n.sectionStyle.borderStyle=i.borderStyle));const{Background:l}=t;return l&&l.style==="Solid"&&(n.sectionStyle.backgroundColor=l.color),l&&l.opacity==="100%"&&(n.sectionStyle.opacity=1),l&&l.image&&l.image!=="sampleImage.png"&&(n.sectionStyle.backgroundImage=`url(${l.image})`,l.imageSize&&(n.sectionStyle.backgroundSize=l.imageSize)),l&&l.repeat==="no-repeat"&&(n.sectionStyle.backgroundRepeat=l.repeat),l&&(l.horizontalAlignment||l.verticalAlignment)&&(n.sectionStyle.backgroundPosition=l.horizontalAlignment+" "+l.verticalAlignment),n};function m7(t,r){if(!t)return[{}];const{columnSize:n,columns:o}=t;if(r)return Array(o).fill({display:"flex",flexDirection:"column",width:"100%"});if(!n)return Array(o).fill({});const a=n.split("/");return typeof o=="string"&&a.length!==parseInt(o)?Array(o).fill({}):typeof o=="number"&&a.length!==o?Array(o).fill({}):a.map(i=>({flexBasis:`${i}`}))}const y7=["data-sid","data-sname"],g7=["data-bid","data-bname"],b7=["page-block-id"],x7=["page-block-id"],_7=["page-block-id"],C7=["page-block-id"],E7=["page-block-id"],k7=["page-block-id"],jc={__name:"TemplateRenderer",props:{onCatalogCountUpdate:{type:Function,default:null},initialCatalogItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1},quoteId:{type:String,default:null}},setup(t,{expose:r}){const n=t,o=Co(),a=Nn(),i=xi(),l=e.computed(()=>o.pageBlocks||[]),s=e.ref(0);r({refreshTemplate:()=>{s.value+=1}});const h=m=>!0,d=e.computed(()=>{var c,y,f,b;const m=[];return console.log("props.sections template renderer",l.value),console.log("props.isPreview",n.isPreview),n.isPreview&&((c=l.value)!=null&&c.content)?(f=(y=l.value)==null?void 0:y.content)==null||f.forEach(p=>{const x=[],g=p.section,C=JSON.parse(g.XX_ORD1__Content_JSON__c);let _={};C&&(_=_i(C,i.isMobile),g.styleObject=g.hideStyle?{}:_.sectionStyle,g.visibility=_.visibility),p.blocks.forEach(E=>{let A=E.XX_ORD1__Content_Block__r;const k=JSON.parse(A.XX_ORD1__Content_JSON__c);A={...A,...k};let B={};k&&(B=_i(k,i.isMobile),A.styleObject=A.hideStyle?{}:B.blockStyle),x.push(A)}),g.blocks=x,m.push(g)}):(b=l.value)==null||b.forEach(p=>{var _;const x={...p},g=typeof p.contentJSON=="string"?JSON.parse(p.contentJSON):p.contentJSON;let C={};g&&(C=_i(g,i.isMobile),x.styleObject=p.hideStyle?{}:C.sectionStyle,x.visibility=C.visibility,(_=x.blocks)==null||_.forEach((E,A)=>{E.styleObject=C.blockStyle[A]})),m.push(x)}),m});return(m,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(pa),(e.openBlock(),e.createElementBlock("div",{key:s.value,class:"contentRendered ectheme",style:{width:"100%","box-sizing":"border-box"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,y=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:y.id},[h(y.visibility)?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(y.styleObject),class:"ect-flex ect-flex-col","data-sid":y.sectionId,"data-sname":y.sectionName},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.blocks,f=>(e.openBlock(),e.createElementBlock("div",{key:f.id,style:e.normalizeStyle(f.styleObject),class:"ect-w-full","data-bid":f.blockId,"data-bname":f.blockName},[f.componentName==="productList"&&e.unref(a).quoteId?(e.openBlock(),e.createElementBlock("div",{key:0,"page-block-id":f.Id,class:"ect-m-auto ect-w-full"},[e.createVNode(ag,{id:f.Id,header:f.fields.header,columns:f.fields.columns,footer:f.fields.footer,fields:f.fields,configuration:f.configuration,"is-preview":t.isPreview},null,8,["id","header","columns","footer","fields","configuration","is-preview"])],8,b7)):f.componentName==="quoteSummary"&&e.unref(a).quoteId?(e.openBlock(),e.createElementBlock("div",{key:1,"page-block-id":f.Id,class:""},[e.createVNode(bg,{id:f.Id,configuration:f.configuration,fields:f.fields,"quote-id":e.unref(a).quoteId},null,8,["id","configuration","fields","quote-id"])],8,x7)):f.componentName==="promoCode"?(e.openBlock(),e.createElementBlock("div",{key:2,"page-block-id":f.Id,class:""},[e.createVNode(wg,{id:f.Id,fields:f.fields,configuration:f.configuration,"is-preview":t.isPreview},null,8,["id","fields","configuration","is-preview"])],8,_7)):f.componentName==="customForm"&&e.unref(a).quoteId?(e.openBlock(),e.createElementBlock("div",{key:3,"page-block-id":f.Id,class:"ect-w-full"},[e.createVNode(d7,{id:f.Id,configuration:f.configuration,fields:f.fields,"quote-id":e.unref(a).quoteId},null,8,["id","configuration","fields","quote-id"])],8,C7)):f.componentName==="customButtons"?(e.openBlock(),e.createElementBlock("div",{key:4,"page-block-id":f.Id,class:""},[e.createVNode(p7,{id:f.Id,configuration:f.configuration,fields:f.fields,"is-preview":t.isPreview},null,8,["id","configuration","fields","is-preview"])],8,E7)):f.componentName==="catalogBlock"?(e.openBlock(),e.createElementBlock("div",{key:5,"page-block-id":f.Id,class:""},[e.createVNode(R8,{id:f.Id,mode:"preview",configuration:f.configuration,fields:f.fields,"search-term":f.searchTerm,"on-count-update":t.onCatalogCountUpdate,"initial-items":t.initialCatalogItems,"is-preview":t.isPreview,"quote-id":t.quoteId},null,8,["id","configuration","fields","search-term","on-count-update","initial-items","is-preview","quote-id"])],8,k7)):e.createCommentVNode("",!0)],12,g7))),128))],12,y7)):e.createCommentVNode("",!0)],64))),128))]))],64))}},v7=t=>(e.pushScopeId("data-v-04b2bdef"),t=t(),e.popScopeId(),t),A7={class:"ect-composable-catalog-wrapper","data-test-id":"expose-expediteCatalog-wrapper"},w7={key:0,class:"ect-flex ect-items-center ect-justify-center ect-min-h-[50vh]","data-test-id":"expose-expediteCatalog-loader"},N7=[v7(()=>e.createElementVNode("div",{class:"ect-flex ect-flex-col ect-items-center ect-gap-3"},[e.createElementVNode("div",{class:"ect-spinner","aria-label":"Loading"}),e.createElementVNode("div",{class:"ect-text-sm ect-text-gray-500"},"Loading catalog…")],-1))],wr=ve({__name:"ExpediteCatalog",props:{templateId:{type:String,required:!0},identity:{type:Object,required:!1,default:()=>({})},session:{type:Object,required:!1,default:()=>({})},security:{type:Object,required:!1,default:()=>({})},resources:{type:Object,required:!1,default:()=>({})},searchTerm:{type:String,default:""},onCatalogCountUpdate:{type:Function,default:null},previewData:{type:Object,default:()=>({})},initialData:{type:Array,default:()=>[]},isPreview:{type:Boolean,required:!0},sections:{type:Array,required:!0},theme:{type:Object,required:!0},hostName:{type:String,required:!1},graphqlEndpoint:{type:String,required:!1},apiKey:{type:String,required:!1},composablesOrgType:{type:String,required:!1},composablesApiKey:{type:String,required:!1}},emits:["catalog-item-added","catalog-item-qty-updated","catalog-line-deleted","catalog-items-fetched","catalog-item-configure","catalog-items-loaded","catalog:id"],setup(t,{emit:r}){const n=ft(),o=mn(),a=Co(),i=t,l=e.ref(!1),s=e.ref(!1),u=e.ref(null),h=r,d=[],m=()=>{l.value=window.innerWidth<=768};return e.onBeforeMount(async()=>{var y,f,b,p,x,g,C,_,E,A,k,B,D;n.updateConfig({templateId:i.templateId,organizationId:(y=i.identity)==null?void 0:y.organizationId,hostName:i.hostName,graphqlEndpoint:i.graphqlEndpoint,apiKey:((f=i.security)==null?void 0:f.apiKey)||i.apiKey,accountId:(b=i.identity)==null?void 0:b.accountId,cid:(p=i.identity)==null?void 0:p.contactId,composablesApiUrl:(x=i.security)==null?void 0:x.baseUrl,accessToken:(g=i.security)==null?void 0:g.accessToken,composablesOrgType:i.composablesOrgType,isPreview:i.isPreview,quoteId:(C=i.session)==null?void 0:C.quoteId,userId:(_=i.identity)==null?void 0:_.userId,siteUrl:(E=i.resources)==null?void 0:E.siteUrl}),n.quoteId=(A=i.session)==null?void 0:A.quoteId,console.log("props.sections expedite catalog",i.sections),await n.processSections(i.isPreview,i.sections);const c=(D=(B=(k=a.pageBlocks[0])==null?void 0:k.blocks[0])==null?void 0:B.configuration)==null?void 0:D.catalogId;c&&h("catalog:id",c)}),e.onMounted(async()=>{window.addEventListener("resize",m),m(),d.push(Lt("catalog:item-added",c=>{h("catalog-item-added",c)})),d.push(Lt("catalog:item-qty-updated",c=>{h("catalog-item-qty-updated",c)})),d.push(Lt("catalog:line-deleted",c=>{h("catalog-line-deleted",c)})),d.push(Lt("catalog:items-fetched",c=>{h("catalog-items-fetched",c)})),d.push(Lt("catalog:item-configure-clicked",c=>{h("catalog-item-configure",c)})),d.push(Lt("catalog:items-loaded",c=>{h("catalog-items-loaded",c)}))}),e.watch(()=>i.session&&i.session.quoteId,c=>{c&&(n.updateConfig({quoteId:c}),n.quoteId=c,o.getQuoteItems(!0))}),e.watch(()=>i.sections,async(c,y)=>{c!==y&&(await n.processSections(i.isPreview,c),u.value&&u.value.refreshTemplate&&u.value.refreshTemplate())},{deep:!0}),e.onBeforeUnmount(()=>{d.forEach(c=>{try{c()}catch{}})}),(c,y)=>{var f,b;return e.openBlock(),e.createElementBlock("div",A7,[e.createVNode(Nc,{"organization-id":(f=i.identity)==null?void 0:f.organizationId,"template-id":i.templateId,"is-preview":i.isPreview,theme:i.theme},null,8,["organization-id","template-id","is-preview","theme"]),s.value?(e.openBlock(),e.createElementBlock("div",w7,N7)):(e.openBlock(),e.createBlock(jc,{key:1,ref_key:"templateRendererRef",ref:u,"quote-id":(b=i.session)==null?void 0:b.quoteId,"is-preview":t.isPreview,"on-catalog-count-update":t.onCatalogCountUpdate,"initial-catalog-items":t.initialData},null,8,["quote-id","is-preview","on-catalog-count-update","initial-catalog-items"]))])}}},[["__scopeId","data-v-04b2bdef"]]),Nr={__name:"ExpediteCart",props:{templateId:{type:String,required:!0},hostName:{type:String,required:!1},composablesOrgType:{type:String,required:!1},sections:{type:String,required:!1},theme:{type:Object,required:!1},isPreview:{type:Boolean,required:!1},security:{type:Object,required:!1},identity:{type:Object,required:!1},session:{type:Object,required:!1},resources:{type:Object,required:!1}},emits:["expeditecart-item-configure","expeditecart-clicked"],setup(t,{emit:r}){const n=ft(),o=Nn(),a=e.ref(null),i=r,l=t;e.onBeforeMount(async()=>{var u,h,d,m,c,y,f,b,p;n.updateConfig({templateId:l.templateId,organizationId:(u=l.identity)==null?void 0:u.organizationId,accountId:(h=l.identity)==null?void 0:h.accountId,cid:(d=l.identity)==null?void 0:d.contactId,userId:(m=l.identity)==null?void 0:m.userId,accessToken:(c=l.security)==null?void 0:c.accessToken,composablesApiUrl:(y=l.security)==null?void 0:y.baseUrl,quoteId:(f=l.session)==null?void 0:f.quoteId,composablesOrgType:"Production",hostName:l.hostName,isPreview:l.isPreview,siteUrl:(b=l.resources)==null?void 0:b.siteUrl}),o.quoteId=(p=l.session)==null?void 0:p.quoteId,await n.processSections(l.isPreview,l.sections)});const s=[];return e.onMounted(()=>{s.push(Lt("expeditecart:configure-clicked",u=>{i("expeditecart-item-configure",u)})),s.push(Lt("expeditecart:clicked",u=>{i("expeditecart-clicked",u)}))}),e.onBeforeUnmount(()=>{s.forEach(u=>{try{u()}catch{}})}),e.watch(()=>l.sections,async(u,h)=>{u!==h&&(await n.processSections(l.isPreview,u),a.value&&a.value.refreshTemplate&&a.value.refreshTemplate())},{deep:!0}),(u,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Nc,{"organization-id":l.identity.organizationId,"template-id":l.templateId,"is-preview":l.isPreview,theme:l.theme},null,8,["organization-id","template-id","is-preview","theme"]),e.createVNode(jc,{ref_key:"templateRendererRef",ref:a,"is-preview":t.isPreview},null,8,["is-preview"])],64))}},S7={pbUniqueId:"PB_DXP_001",vUniqueId:"V_1",versionType:"ACTIVE",playBookName:"DXP AI Guidance",description:"Three-step flow to showcase in-panel component loading via playbook steps.",pbObject:"Opportunity",mode:"FULL",type:null,appliesTo:{},playBookSteps:[{stepID:"PB_DXP_001_V_1_00",stepName:"AI Guidance",stepType:"UI_COMPONENT",stepComponent:"ai-guidance",sequenceNumber:"0",description:"AI Guidance entry step. Presents chat and initial actions.",aiGuidance:"Start here to receive guidance and choose your next action.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[{beanName:"Browse Catalog",sequenceNumber:"1",disable:!1}],templateId:"a1RKb000003C3PkMAK"},{stepID:"PB_DXP_001_V_1_0",stepName:"Browse Catalog",stepType:"UI_COMPONENT",stepComponent:"catalog",sequenceNumber:"1",description:"Browse or search the catalog and add items as needed.",aiGuidance:"Use the catalog to discover and add products. Proceed to configuration when ready.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[{beanName:"Configure Products",sequenceNumber:"1",disable:!1}],templateId:"a1RKb000003C3PkMAK"},{stepID:"PB_DXP_001_V_1_1",stepName:"Configure Products",stepType:"UI_COMPONENT",stepComponent:"configurator",sequenceNumber:"2",description:"Configure selected products and adjust options as needed.",aiGuidance:"Fine-tune product options. When done, proceed to review your cart.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[{beanName:"Review Cart",sequenceNumber:"2",disable:!1}]},{stepID:"PB_DXP_001_V_1_2",stepName:"Review Cart",stepType:"UI_COMPONENT",stepComponent:"cart",sequenceNumber:"3",description:"Review all quote line items before finalizing.",aiGuidance:"Validate quantities and pricing. Return to previous steps if adjustments are required.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[],templateId:"a1RKb000003C0ryMAC"}],metadata:{s3PathKey:"ec-playbooks/00DA0000000cDUJMA2/PB_DXP_001/V_1/playbook.json",createdAt:"2025-12-29T09:05:53.163365+00:00",updatedAt:"2025-12-29T09:05:53.163365+00:00",createdBy:"0052G00000AtQQ9QAN"}},Ci=it.defineStore("expediteConfigurator",()=>{const t=e.ref(null),r=e.ref(null),n=e.ref(null),o=e.ref([]);function a(){var h,d;console.info("[expediteConfiguratorStore] getPayload",{hasComp:!!t.value,hasGetConfig:!!((h=t.value)!=null&&h.getConfig)});const u=(d=t.value)==null?void 0:d.getConfig;return{productConfiguration:u!=null?[u]:[]}}function i(u,h){var d,m,c;console.info("[expediteConfiguratorStore] setPreConfigData",{hasData:!!u,hasProductConfiguration:!!((d=u==null?void 0:u.productConfiguration)!=null&&d.length),itemId:h}),r.value=u,((m=u==null?void 0:u.productConfiguration)==null?void 0:m.length)>0&&(n.value=u.productConfiguration.find(y=>{var b;return((y==null?void 0:y.itemId)||((b=y==null?void 0:y.product)==null?void 0:b.itemId))===h}),o.value=u.productConfiguration,console.info("[expediteConfiguratorStore] apply queued?",{hasQueueItem:!!n.value,ready:!!t.value}),n.value&&((c=t.value)!=null&&c.setConfig)&&t.value.setConfig(n.value,o.value))}function l(){var u;console.info("[expediteConfiguratorStore] refresh invoked"),(u=t.value)!=null&&u.refresh&&t.value.refresh()}function s(u){var h;console.info("[expediteConfiguratorStore] setExpediteConfigComp",{received:!!u}),t.value=u,n.value&&((h=t.value)!=null&&h.setConfig)&&(console.info("[expediteConfiguratorStore] applying queued configuration on ready"),t.value.setConfig(n.value,o.value),n.value=null)}return{preConfgData:r,expediteConfigComp:t,getPayload:a,refresh:l,setPreConfigData:i,setExpediteConfigComp:s}}),Ei=["Quote_Document"],Jn=it.defineStore("composablePlaybook",()=>{const t=Mt(),r=ft(),n=mn(),o=Ci(),a=e.ref(null),i=e.ref("full"),l=e.ref(null),s=e.ref(null),u=e.ref(!1),h=e.ref(!1),d=e.ref(null),m=e.ref(null);e.ref(null);const c=e.ref("");function y(S){c.value=S}const f=()=>({Authorization:`Bearer ${c.value}`,"X-Salesforce-Org-Id":r.organizationId.value||"","X-Salesforce-Org-Type":r.composablesOrgType.value||"","X-Salesforce-User-Id":r.userId.value||"","Content-Type":"application/json"});async function b(S,I="ACTIVE"){if(!S)throw new Error("getPlaybookByKey: 'key' is required");try{const R=`${r.composablesApiUrl.value}/playbooks/getPlaybookByKey/${S}?versionType=${I}`,z=await fetch(R,{method:"GET",headers:f()});if(!z.ok)throw new Error(`Playbook fetch failed: ${z.status}`);const $=await z.json();return l.value=$.data??null,console.log("[playbook] currentPlaybook",l.value),$}catch(R){if(console.warn("[playbook] Falling back to bundled DXP playbook due to fetch error:",(R==null?void 0:R.message)||R),S==="PB_DXP_001")return l.value=S7,l.value;throw R}}function p(S){h.value=!!S}function x(S){var R,z;if(!((z=(R=l.value)==null?void 0:R.playBookSteps)!=null&&z.length))return;l.value.playBookSteps.some($=>$.stepName===S||$.name===S)&&(s.value=S)}const g=e.computed(()=>{var I;return(((I=l.value)==null?void 0:I.playBookSteps)||[]).find(R=>R.stepName===s.value)||null});function C({stepName:S,data:I=null}){var W,K,P,N,T,O,F;if(console.log("[playbook:navigateToStep] called",{stepName:S,dataProvided:!!I,data:I}),!((K=(W=l.value)==null?void 0:W.playBookSteps)!=null&&K.length)){console.info("[navigateToStep] No playbook steps available, aborting navigation.");return}if(!S){console.info("[navigateToStep] No stepName provided, aborting navigation.");return}const R=l.value.playBookSteps;console.info("[navigateToStep] Steps available:",JSON.stringify(R.map(q=>q.stepName||q.name)));const z=R.findIndex(q=>q.stepName===S||q.name===S);if(z<0){console.info(`[Warn] [navigateToStep] No step found for stepName "${S}".`);return}const $=R[z];if(console.log("[playbook:navigateToStep] target step resolved",{targetIndex:z,targetStepName:($==null?void 0:$.stepName)||($==null?void 0:$.name),stepComponent:$==null?void 0:$.stepComponent}),$!=null&&$.stepComponent&&Ei.includes($.stepComponent)){console.info(`[navigateToStep] Target step "${$.stepName}" is a NON_COMPONENT (${$.stepComponent}), storing data in localStorage and searching for a valid component step above.`);const q=getPreviousValidStep($.stepName);q&&(console.info(`[navigateToStep] Valid step to return to: "${q}".`),setDataToLocalStorage({stepName:q,pbUniqueId:(P=l.value)==null?void 0:P.pbUniqueId}))}let X=!1;for(let q=z;q>=0;q--){const M=R[q],U=M==null?void 0:M.stepComponent;if(console.info(`[navigateToStep] Checking step[${q}]:`,M),!U){console.info(`[navigateToStep] Step[${q}] has no component, skipping.`);continue}if(Array.isArray(Ei)&&Ei.includes(U)){console.info(`[navigateToStep] Step[${q}] component "${U}" is in NON_COMPONENTS, skipping.`);continue}s.value=M.stepName??S,console.info(`[navigateToStep] Navigating to step[${q}] "${s.value}" with component "${U}".`);let L=I;const j=String(U||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),H=!!((T=(N=L==null?void 0:L.payload)==null?void 0:N.savedProducts)!=null&&T.length)||((F=(O=L==null?void 0:L.payload)==null?void 0:O.productConfiguration)==null?void 0:F.length)>0;if(j==="configurator"&&!H)try{const Z=typeof n.getTopConfigurableItem=="function"?n.getTopConfigurableItem():null;if(Z){const te=Z.XX_ORD1__Item__c||Z.xx_ord1__item__c||Z.itemId||"",ne=Z.Id||Z.id||"";te&&(L={payload:{savedProducts:[ne?{itemId:te,qliId:ne}:{itemId:te}]}})}}catch(Z){console.info("[navigateToStep] Unable to auto-select configurable item:",(Z==null?void 0:Z.message)||Z)}console.log("[playbook:navigateToStep] final navigation payload",{currentStepName:s.value,stepComponent:U,hasPayload:!!L,payload:L}),w({XX_ORD1__Completed_PB_Step_Number_EX__c:String(q),XX_ORD1__Playbook_Current_Step_Meta_EX__c:JSON.stringify(L)}),E(U,L),X=!0;break}X||console.info(`[Warn] [navigateToStep] Could not find a valid component step to navigate to starting from stepName "${S}".`),console.log("[playbook:navigateToStep] completed",{navigated:X,toStep:s.value})}function _(S){var X,W,K;const I=((X=l.value)==null?void 0:X.playBookSteps)||[];if(!I.length)return;const R=I.findIndex(P=>P.stepName===s.value);if(R<0)return;if(!(Array.isArray((W=I[R])==null?void 0:W.beans)&&I[R].beans.some(P=>(P==null?void 0:P.beanName)===S))){console.info(`[navigateToBean] Bean "${S}" not found in current step "${(K=I[R])==null?void 0:K.stepName}".`);return}const $=I[R+1];$!=null&&$.stepName&&C({stepName:$.stepName})}function E(S,I=null){var X,W,K,P,N,T,O,F,q,M,U,L,j,H,Z,te,ne;console.log("[playbook:loadComponent] called",{stepComponent:S,dataProvided:!!I,data:I});const R=A(S);console.log("[playbook:loadComponent] resolved route path",{path:R});function z(Q){try{return(typeof window<"u"&&window.location.hash||"").replace(/^#/,"")===Q}catch{return!1}}const $=String(S||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_");if(h.value){console.log("[playbook:loadComponent] embeddedMode active, skipping route",{normalized:$,payloadProvided:!!I}),d.value=$,console.log("[playbook] activeComponentKey",d.value),console.log("[playbook] activeComponentData",I),m.value=I||null;return}if(R)try{if(((I==null?void 0:I.actionFunction)==="Reload"||R==="/quote-item")&&(console.info("[playbook] Reloading quote line items..."),console.log("Reloading configurator 4"),quoteStore.fetchAllQuoteLineItems().then(()=>{console.info("[playbook] Quote line items reloaded...")})),R==="/configurator")if(console.log("[playbook:loadComponent] navigating to configurator",{hasProductConfiguration:((W=(X=I==null?void 0:I.payload)==null?void 0:X.productConfiguration)==null?void 0:W.length)>0,hasSavedProducts:((P=(K=I==null?void 0:I.payload)==null?void 0:K.savedProducts)==null?void 0:P.length)>0,isReload:(I==null?void 0:I.actionFunction)==="Reload"}),((T=(N=I==null?void 0:I.payload)==null?void 0:N.productConfiguration)==null?void 0:T.length)>0){const Q=(O=I==null?void 0:I.payload)==null?void 0:O.productConfiguration[0],ce=(Q==null?void 0:Q.itemId)||((F=Q==null?void 0:Q.product)==null?void 0:F.itemId)||"";o.setPreConfigData(I==null?void 0:I.payload,ce);const ue=`/configurator/${ce}`;z(ue)||router.push(ue);return}else if(((M=(q=I==null?void 0:I.payload)==null?void 0:q.savedProducts)==null?void 0:M.length)>0){const Q=(U=I==null?void 0:I.payload)==null?void 0:U.savedProducts[0].itemId,ce=(L=I==null?void 0:I.payload)==null?void 0:L.savedProducts[0].qliId,ue=`/configurator/${Q}/${ce}`;z(ue)||router.push(ue);return}else if((I==null?void 0:I.actionFunction)==="Reload"){console.log("Reloading configurator 5"),o.refresh();return}else{const ue=[...((j=quoteStore.allQLIData)==null?void 0:j.lineItems)??[]].sort((pe,ie)=>{const de=_e=>_e.xx_ord1__sys_configuration_status2__c==="Needs Configuration"?1:_e.xx_ord1__sys_configuration_status2__c==="Suggests Configuration"?2:3;return de(pe)-de(ie)}).filter(pe=>pe.xx_ord1__sys_configuration_status2__c!=="No Configuration");if(ue.length){const pe=ue[0],ie=`/configurator/${pe.xx_ord1__item__c}${pe.id?`/${pe.id}`:""}`;z(ie)||router.push(ie)}else t.handleWarning("No items needing configuration");return}else R==="/adaptive-search"&&((H=I==null?void 0:I.payload)!=null&&H.adaptiveSearch)?(console.log("[playbook:loadComponent] navigating to adaptive-search",{hasPayload:!!((Z=I==null?void 0:I.payload)!=null&&Z.adaptiveSearch)}),adaptiveSearch.createLstItems(I==null?void 0:I.payload.adaptiveSearch)):R==="/quote-item"&&I?(console.log("[playbook:loadComponent] navigating to quote-item with data"),quoteStore.performAIAction(I)):R==="/match-records"&&((te=I==null?void 0:I.payload)!=null&&te.quickSelection)&&(console.log("[playbook:loadComponent] navigating to match-records",{hasQuickSelection:!!((ne=I==null?void 0:I.payload)!=null&&ne.quickSelection)}),quickSelectionStore.quickSelectionLayout=I.payload);z(R)||router.push(R),console.log("[playbook:loadComponent] route push called",{path:R})}catch(Q){t.handleError(Q,"playbookStore.loadComponent")}}function A(S){var z;const I=String(S||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),R={chat_screen:"/",ai_guidance:"/",catalog:"/catalog",adaptive_search:"/adaptive-search",configurator:"/configurator",quote_item:"/quote-item",cart:"/cart",quick_selection:"/match-records",quote_document:null};if(I==="quote_document"){const $=getPreviousValidStep(s.value);return $&&setDataToLocalStorage({stepName:$,pbUniqueId:(z=l.value)==null?void 0:z.pbUniqueId}),goToQuoteDocument(),null}return R[I]||"/quote-item"}function k(){var S;return((S=g.value)==null?void 0:S.beans)??[]}function B(){return k().map(I=>({action:`playbookNavigate:${I.beanName}`,label:I.beanName,disabled:!!I.disable}))}async function D(){var S;try{const I=((S=r.quoteId)==null?void 0:S.value)||"";if(!I)return console.info("getPlaybookInfoFromQuote: Missing Quote Id"),null;const R=`${r.composablesApiUrl.value}/platform/getHeaderRecord`,z={recordId:I,lstFields:["XX_ORD1__Playbook_Id_EX__c","XX_ORD1__Playbook_Version_Id_EX__c","XX_ORD1__Completed_PB_Step_Number_EX__c","XX_ORD1__Playbook_Current_Step_Meta_EX__c"]};return(await(await fetch(R,{method:"POST",headers:f(),body:JSON.stringify(z)})).json()).data}catch(I){return t.handleError(I,"playbookStore.getPlaybookInfoFromQuote"),null}}async function w(S={}){var I;try{const R=((I=r.quoteId)==null?void 0:I.value)||Jr("id")||"";if(!R)return console.info("addPlaybookInfoToQuote: Missing Quote Id"),null;const z={Id:R,...S},$=Object.entries(z).map(([N,T])=>({fieldName:N,fieldValue:T})),X=`${r.composablesApiUrl.value}/platform/upsertRecords`,W={objectType:"XX_ORD1__Quote__c",uniqueField:"Id",records:[{fields:$}]},P=await(await fetch(X,{method:"POST",headers:f(),body:JSON.stringify(W)})).json();return console.info("[playbook] addPlaybookInfoToQuote response:",JSON.stringify(P)),P}catch(R){return t.handleError(R,"playbookStore.addPlaybookInfoToQuote"),null}}async function v(){var S;try{const I=`${r.composablesApiUrl.value}/product-pricing/findCatalogInContext?accountId=${r.accountId.value}&catalogType=Primary&catalogLookupFieldName=Primary_Catalog__c`,z=await(await fetch(I,{method:"GET",headers:f()})).json();return(S=z==null?void 0:z.data)==null?void 0:S.catalogId}catch(I){return t.handleError(I,"playbookStore.getCatalogInContext"),null}}return{playbookData:a,currentPlaybook:l,currentStepName:s,currentStep:g,playbookStepsMode:i,showPlaybookSteps:u,embeddedMode:h,activeComponentKey:d,activeComponentData:m,setSecretKey:y,getPlaybookByKey:b,setCurrentStepName:x,navigateToStep:C,navigateToBean:_,loadComponent:E,setEmbeddedMode:p,getCurrentStepLinks:B,addPlaybookInfoToQuote:w,getPlaybookInfoFromQuote:D,getCatalogInContext:v}}),ki={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"},Hc={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"},B7=t=>{var n;let r=[];for(let o of t)if(o.trim()!=="xx_ord1__item__r.xx_ord1__decimal_precision__c")if(o.includes(".")){let i=o.split(".")[0];i=i.slice(0,-1)+"c";const l=((n=ki[i==null?void 0:i.toLowerCase()])==null?void 0:n.trim())||"";l&&(r.includes(l)||r.push(l||""),r.push(o))}else r.includes(ki[o==null?void 0:o.toLowerCase()])||r.push(ki[o==null?void 0:o.toLowerCase()]||"");return r.filter(o=>o!=="")},Gc=it.defineStore("actions",()=>{const t=Un(),r=$n(),n=e.ref(!1);return{openAdaptiveSearch:(s,u=!1)=>{console.info("openAdaptiveSearch",s),t.chatHistory[t.chatHistory.length-1].links=[],t.sendMessage("Open Adaptive Search",!1,{internalCall:!0}),n.value=u},openQuoteItem:s=>{console.info("openQuoteItem",s),t.chatHistory[t.chatHistory.length-1].links=[],t.sendMessage("Open Quote Item",!1,{internalCall:!0})},openQuoteDocument:s=>{console.info("openQuoteDocument",s),t.chatHistory[t.chatHistory.length-1].links=[],t.chatHistory.push({type:"response",message:"Opening quote document",loading:!0});const h=`/apex/XX_ORD1__Expedite_Commerce?scpq=true&oid=${r.quoteId}&atpverified=true&ecCache=false&origin=AI`;window.location.href=`${$0(window.location.href)}${h}`},undo:()=>{const s=t==null?void 0:t.latestDMLRequest;t.sendMessage(`UNDO-${s}`,!1,{internalCall:!0})},isStaticActionCall:n}}),Kc=it.defineStore("adaptiveSearch",()=>{const t=$n(),r=wo(),n=Un(),o=Gc(),a=e.ref(null),i=e.ref(null),l=e.ref(!1),s=e.ref(!1),u=e.ref([]),h=e.ref(""),d=e.ref(!1),m=e.ref(null),c=e.ref(!1),y=e.ref([]),f=Mt(),b=e.ref([]),p=e.ref(0),x=e.ref(!1),g=e.ref({rowLimt:10,paging:!0,offset:0,currentPage:1,totalPages:1});async function C(){l.value=!0;try{const N=JSON.stringify({layoutType:"Search Selection",layoutObject:"xx_ord1__ecatalog_item__c"});let T={};return T=await window.salesforceConnector.getDynamicPageLayout(N),i.value=Cl(T,"Unable to find the Search Selection Layout for your user profile"),g.value.rowLimt=i.value.configuration.rowLimit||10,i.value.configuration.columns.forEach(O=>{!O.field&&O.label==="QTY"&&(O.field="xx_ord1__qty__c")}),l.value=!1,_(),T}catch(N){l.value=!1,f.handleError("Failed to get Adaptive Search Layout. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",N)}}function _(){var N,T,O;m.value=(O=(T=(N=i.value)==null?void 0:N.configuration)==null?void 0:T.dynamicFilters)==null?void 0:O.filters.map(F=>({...F,field:F.field.toLowerCase(),filtervalue:F.filtervalue||[],filtervaluefrom:F.filtervaluefrom||"",filtervalueTo:F.filtervalueTo||""}))}function E(){var T;let N=[];for(const O of i.value.configuration.columns){let F=O.field;if(N.includes(F)||N.push(F),F!=null&&F.includes(".")){let M=F.split(".")[0];M=M.slice(0,-1)+"c",N.includes(M)||N.push(M)}}return(T=i.value.configuration)!=null&&T.cardHeader&&N.push(i.value.configuration.cardHeader.imageField),i.value.configuration.objectName.toLowerCase()==="xx_ord1__ecatalog_item__c"&&N.push("xx_ord1__item__r.xx_ord1__decimal_precision__c"),N=N.filter(O=>!!O),N.filter(O=>O.toLowerCase()!=="xx_ord1__qty__c"&&O.toLowerCase()!=="xx_ord1__competitor_sku__c")}function A(N,T=!1){if(!N||N.includes("undefined"))return!1;const O=/[!@#$%^&*()+=[\]{};':"\\|.<>/?]+/;if(T){const F=Array.isArray(N)?N:N.split(",");for(const q of F){const M=q.trim();if(O.test(M))return f.handleError(`Invalid character found in value: ${M}`),!1}}else if(O.test(N))return f.handleError("Special characters are not allowed in filter values"),!1;return!0}function k(N,T){return{field:N.field,operator:N.operator||"contains",value:T,dataType:N.dataType.trim()}}function B(N){if(!N.filtervalue)return null;const T=Array.isArray(N.filtervalue),O=T?N.filtervalue.join(","):N.filtervalue.trim();return A(O,T)?O:null}function D(N){var q,M;const T=(q=N.filtervaluefrom)==null?void 0:q.trim(),O=(M=N.filtervalueTo)==null?void 0:M.trim();if(!T||!O)return null;const F=`${T}, ${O}`;return F!==", "&&A(F)?F:null}function w(N){const T=`${_l(N.filtervaluefrom)}, ${_l(N.filtervalueTo)}`;return T!==", "&&A(T)?T:null}function v(N){var O;const T=(O=N.filtervaluefrom)==null?void 0:O.trim();return A(T)?T:null}function S(N){const T=[];return N.forEach(O=>{const F=O.dataType.trim();let q=null;switch(F){case"PICKLIST":case"MULTIPICKLIST":q=B(O);break;case"DOUBLE":case"CURRENCY":q=D(O);break;case"DATETIME":case"DATE":q=w(O);break;default:q=v(O)}q&&T.push(k(O,q))}),y.value=T,T}async function I(N="",T=[],O=[]){var q,M,U,L,j,H,Z,te,ne,Q;let F=[];if(T.length&&(F=S(T)),!F.length&&N.trim()===""){u.value=[],d.value=!1;return}try{d.value=!1,s.value=!0;const ce=N.trim();O.length||(O=E());const ue={fields:O,...T.length?{dynamicFilters:F}:{},searchText:ce||h.value.trim(),accountId:r.accountId,...r.eCatalogId?{catalogId:r.eCatalogId}:{},...r.objectType==="opportunity"?{opportunityId:r.id}:{},...(M=(q=i.value)==null?void 0:q.configuration)!=null&&M.sort?{primarySortBy:i.value.configuration.sort.primary.field,primarySortOrder:i.value.configuration.sort.primary.direction,secondarySortBy:i.value.configuration.sort.secondary.field,secondarySortOrder:i.value.configuration.sort.secondary.direction}:{},rowLimt:(L=(U=i.value)==null?void 0:U.configuration)==null?void 0:L.rowLimit,paging:(H=(j=i.value)==null?void 0:j.configuration)==null?void 0:H.paging,...((Z=g.value)==null?void 0:Z.offset)!==0?{offset:g.value.offset}:{},objectName:(ne=(te=i.value)==null?void 0:te.configuration)==null?void 0:ne.objectName,currencyCode:r.currencyCode},pe=await window.salesforceConnector.getItems(JSON.stringify(ue));if(pe!=null&&pe.errorMessage){f.handleError(pe.errorMessage);return}pe!=null&&pe.itemCount&&(g.value.totalPages=Math.ceil((pe==null?void 0:pe.itemCount)/g.value.rowLimt)),u.value=Xo(pe.lstItems,{xx_ord1__qty__c:"1"}),(Q=pe.lstItems)!=null&&Q.length||(d.value=!0),s.value=!1}catch(ce){f.handleError("Failed to fetch Results. Please try again."),s.value=!1,console.info("[ERROR]: Adaptive Search getItems() error = ",ce)}}async function R(N){try{c.value=!0;const T=JSON.stringify({lstQLIRequest:z(N),quoteId:t.quoteId});let O=await window.salesforceConnector.createQLI(T);typeof O=="string"&&(O=JSON.parse(O));let F=!1;if((O==null?void 0:O.length)>0&&O.forEach(q=>{q.errorMessage&&(F=!0,f.handleError(q.errorMessage))}),c.value=!1,F){b.value=O;const q=b.value.reduce((M,U)=>(M[U.eCatalogItemId]=U.errorMessage,M),{});u.value=u.value.map(M=>({...M,backendError:q[M.Id]||""}));return}return O}catch(T){f.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addToQuote() error = ",T)}}function z(N){const T=[];for(const O of N)if(!O.addedToQuote&&O.id){const F=$(O);p.value++,T.push({fields:F,recordId:O.id,...N.length===1?{maxSequenceNumber:p.value}:{}})}return T}function $(N){const T=[],O=X();return Object.keys(N).forEach(F=>{if(O.includes(F)){const q=Hc[F.toLowerCase()];q&&T.push({fieldname:q,value:N[F]})}}),T}function X(){const N=[];return i.value.configuration.columns.forEach(T=>{T.field&&!T.field.includes(".")&&T.isEditable&&T.visible&&N.push(T.field)}),N}function W(){var T,O;const N=[];return i.value.configuration.columns.forEach(F=>{const q=F.field.toLowerCase();N.includes(q)||N.push(q)}),(T=i.value.configuration)!=null&&T.dynamicFilters&&i.value.configuration.dynamicFilters.filters.forEach(F=>{const q=F.field.toLowerCase();N.includes(q)||N.push(q)}),(O=i.value.configuration)!=null&&O.cardHeader&&N.push(i.value.configuration.cardHeader.imageField),N}async function K(){var O;const N=W(),T=((O=i.value.configuration)==null?void 0:O.saveObjectName)||i.value.configuration.objectName;if(T==="xx_ord1__ecatalog_item__c"){const F=N.indexOf("xx_ord1__qty__c");F>-1&&N.splice(F,1)}await t.getFieldsData(N,T),t.fieldsData.xx_ord1__qty__c||t.getFieldsData(["xx_ord1__qty__c"],"xx_ord1__quote_line_item__c")}async function P({searchTerm:N="",filters:T=[]}={}){if(x.value=!0,N&&(h.value=N),T.length&&(y.value=T),await C()){await K(),x.value=!1;const F=h.value;F&&(h.value=F,await I(F,t.dynamicFilters)),console.info("actionStore.isStaticActionCall = ",o.isStaticActionCall),o.isStaticActionCall&&(o.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"}]})}x.value=!1}return{selectedItem:a,AdaptiveSearchLayout:i,searchText:h,loadingAdaptiveLayout:l,getAdaptiveSearchLayout:C,getItems:I,lstItems:u,rowItemsLoading:s,noSearchRecords:d,dynamicFilters:m,setDynamicFilters:_,createQliErrors:b,addToQuote:R,addingToQuote:c,getFieldsData:K,pagingData:g,appliedDynamicFilters:y,maxSequenceNumber:p,loadingAdaptiveSearch:x,initAdaptiveSearch:P}}),I7="XX_ORD1__Quote__c",T7="xxord1salespricec",Sr="xx_ord1__item__c",O7="xxord1productnrcc",D7=it.defineStore("cartStore",()=>{const t=$n(),r=Kc(),n=Mt(),o=e.ref(""),a=e.ref("$0"),i=e.ref("$0"),l=e.ref(null),s=e.ref({}),u=e.ref({}),h=e.ref({}),d=e.ref(""),m=e.ref(""),c=e.ref({}),y=e.ref(""),f=e.ref(""),b=e.ref({});async function p(){A()}async function x(){try{let D=await window.salesforceConnector.getProductCount(t.quoteId);if(D=Tt(D),D!=null&&D.errorMessage){n.handleError(D.errorMessage);return}return o.value=D,D}catch{n.handleError("Failed to get Product Count. Please try again.")}}async function g(){try{let D=await window.salesforceConnector.getQuoteTotal(t.quoteId);if(D=Tt(D),D!=null&&D.errorMessage){n.handleError(D.errorMessage);return}return i.value=D.monthlyTotal,a.value=D.onetimeTotal,D}catch{n.handleError("Failed to get Total Amount. Please try again.")}}async function C(D,w,v,S=""){if(!t.sectionDataMap.get(v).parentQLIs[w].removingItem){t.sectionDataMap.get(v).parentQLIs[w].removingItem=!0,f.value=D.id,await _(D.id)==="Success"&&(t.fetchAllQuoteLineItems(),S&&S(D,w,v));let R=t.sectionDataMap.get(v).parentQLIs.filter(z=>z[Sr]===D[Sr]).length;f.value="",r.lstItems.forEach(z=>{z[Sr]===D[Sr]&&(z.addedToQuote===!0&&(z.addedToQuote=!1),R===0&&(z.removedFromQuote=!0))})}}async function _(D){try{let w=await window.salesforceConnector.deleteQLI(D);if(w!=null&&w.errorMessage){n.handleError(w.errorMessage);return}return x(),g(),w}catch{n.handleError("Failed to remove Quote Item. Please try again.")}}function E(D){var S,I;const w=(S=D==null?void 0:D[O7])==null?void 0:S.match(/\.\d+/);w&&(w.value=w[0].length-1);const v=(I=D==null?void 0:D[T7])==null?void 0:I.match(/\.\d+/);return v&&(v.value=v[0].length-1),w||v}function A(D=!0){x(),g(),D&&t.fetchTemplates(I7).then(()=>{t.getFilteredListWithFields()})}function k(D){const w=t.sectionDataMap;for(const[,v]of w.entries())v.parentQLIs.forEach(S=>{S.id===D.id&&(v.columns.forEach(I=>{if(I.dataType==="CURRENCY"){const R=I.field.replace(/_/g,"");S[R]=B(S[R],D[I.field])}}),D!=null&&D.billingPeriodValue&&(D!=null&&D.formattedBillingPeriodValue)&&(S.formattedBillingPeriodValue=B(S.formattedBillingPeriodValue,D.billingPeriodValue)),D!=null&&D.oneTimeValue&&(D!=null&&D.formattedOneTimeValue)&&(S.formattedOneTimeValue=B(S.formattedOneTimeValue,D.oneTimeValue)))})}function B(D,w){const v=Number(w);if(isNaN(v))return D;const S=D.match(/(\d[\d,]*)(\.\d+)?/);if(!S)return D;const I=S[2]||"",R=I.length?I.length-1:0,z=v.toLocaleString("en-US",{minimumFractionDigits:R,maximumFractionDigits:R});return D.replace(S[1]+I,z)}return{initializeCart:p,loadCartState:A,productCount:o,onetimeTotal:a,monthlyTotal:i,filterCartItem:l,billingPeriodValue:d,hasOneTimeValue:m,hasBillingPeriodInList:s,oneTimeFieldAvailable:u,billingPeriodFieldAvailable:h,priceDecimalPrecision:c,cartItemUpdatingId:y,removingItemLoaderId:f,cartItemColumnsMap:b,getProductCount:x,getQuoteTotal:g,removeItem:C,removeQuoteItem:_,getDecimalPrecisionFromSalesPriceOrNRC:E,updateFormattedValues:k,formateCurrencyValue:B}}),V7=t=>[{title:"Apply Discount",subOptions:[...t.map(r=>`Apply Discount on ${r} for `),"Show Maximum discount allowed","Apply Maximum Discount Allowed",...t.map(r=>`Apply Discount on ${r} 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"]}],F7={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"}]},M7=[{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"]}],$n=it.defineStore("quote",()=>{const t=Mt(),r=D7(),n=wo(),o=e.ref(""),a=e.ref(""),i=e.ref(0),l=e.ref(""),s=e.ref([]),u=e.ref({template:!0,filteredList:!1}),h=e.ref(null),d=e.ref(new Map),m=e.ref({}),c=e.ref(!1),y=e.ref(!0),f=e.ref(!1),b=e.ref({text:"Hide Options",altText:"Show Options",handler:()=>{y.value=!y.value,B()},color:"#136E05",isActive:!1}),p=e.computed(()=>{const P=Array.from(d.value.values()).map(N=>N.sectionName);return V7(P)});e.watch(l,()=>{u.value.template||k()});function x(){const P=new Map,N=[];for(const[O,F]of d.value.entries())P.set(O,F.selected),N.push(F);const T=JSON.parse(JSON.stringify(N));return T.forEach(O=>{delete O.selected;const F=new Map,q=[];O.lineItems.forEach(M=>{M.Selected=P.get(O.tableId).get(M.id)||!1,M.xx_ord1__parent_qli__c?(F.has(M.xx_ord1__parent_qli__c)||F.set(M.xx_ord1__parent_qli__c,[]),F.get(M.xx_ord1__parent_qli__c).push(M)):q.push(M)}),O.lineItems=q.map(M=>({...M,options:F.get(M.id)||[]})),delete O.loading,delete O.parentQLIs,delete O.totalValues}),{showOptions:y.value,sections:T,templateId:l.value}}async function g(P){try{let N=await window.salesforceConnector.getPrimaryQuote(P);N=Tt(N),N!==void 0&&(console.info("getPrimaryQuote",JSON.stringify(N)),o.value=N.recordId,console.info("quoteId",o.value),a.value=N.name,l.value=N==null?void 0:N.templateId,i.value=(N==null?void 0:N.lineItemsCount)||0)}catch(N){t.handleError(N.message),console.info("[ERROR]: getPrimaryQuote() error = ",N)}}async function C(P){var N,T;try{u.value.template=!0;let O=await window.salesforceConnector.fetchContentTemplates(JSON.stringify({lstObjectName:[P],templateType:"Document",templateId:null,fetchOnlyDefault:!1}));O=Tt(O);const F=O==null?void 0:O.templates[P];return l.value||(l.value=(N=F.find(q=>q.XX_ORD1__Default__c))==null?void 0:N.Id),l.value||(l.value=(T=F[0])==null?void 0:T.Id),s.value=F,u.value.template=!1,s.value}catch(O){t.handleError(O.message),console.info("[ERROR]: fetchTemplates() error = ",O)}}function _(P){if(!P)return null;const N=/\{!\$(\w+):([\w.]+)\}/,T=P.match(N);return T?{function:T[1],apiname:T[2].split(".")[1]}:null}async function E(P){try{const N={Id:o.value,XX_ORD1__Document_Template__c:P};return await window.salesforceConnector.updateQuote(JSON.stringify([N]))}catch(N){t.handleError(N.message),console.info("[ERROR]: updateQuote() error = ",N)}}async function A(){try{u.value.filteredList=!0;let P=await window.salesforceConnector.getQuoteEPageLayout();d.value.clear(),r.cartItemColumnsMap={},P=Tt(P);const N=P.map(O=>({label:O.fieldLabel,field:O.fieldName.toLowerCase(),isEditable:O.isEditable,dataType:O.dataType,...O.picklistValues?{picklistValues:O.picklistValues}:{}})),T=vn();return d.value.set(T,{loading:!0,lineItems:[],parentQLIs:[],columns:N,tableId:T,sectionName:"All Rows",selected:new Map,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}),r.cartItemColumnsMap[T]=N,b.value.isActive=!1,y.value=!0,h.value={lstCB:[{columns:N,footer:null,title:"All Rows",sectionName:"All Rows",tableId:T,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}]},B(),u.value.filteredList=!1,P}catch(P){t.handleError(P.message),console.info("[ERROR]: getQuoteEPageLayout() error = ",P)}}async function k(){if(s.value.length===0){A();return}try{u.value.filteredList=!0;let P=await window.salesforceConnector.getFilteredListWithFields(JSON.stringify({templateId:l.value}));E(l.value),P=Tt(P),console.info("res.lstCB = ",P.lstCB);const N=P==null?void 0:P.objectFieldsMap;return d.value.clear(),r.cartItemColumnsMap={},P.lstCB=P.lstCB.map(T=>{const{fields:O,filters:F,primarysort:q,primarysortdesc:M}=JSON.parse(T.XX_ORD1__Block_Properties__c),U=O.map(j=>{var H;return{label:(H=N[j.api])==null?void 0:H.label,field:j.api.toLowerCase(),isEditable:j.api.includes(".")?!1:N[j.api].isEditable,dataType:N[j.api].dataType,...N[j.api].picklistValues?{picklistValues:N[j.api].picklistValues}:{}}}),L=T.Id||vn();return d.value.set(L,{loading:!0,lineItems:[],parentQLIs:[],columns:U,tableId:L,sectionName:T.Name,selected:new Map,footer:_(T.XX_ORD1__Table_Footer_HTML__c),filters:F,primarysort:q,primarysortdesc:M}),r.cartItemColumnsMap[L]=U,b.value.isActive=!1,y.value=!0,{columns:U,footer:_(T.XX_ORD1__Table_Footer_HTML__c),title:T.Name,sectionName:T.Name,tableId:L,filters:F,primarysort:q,primarysortdesc:M}}),h.value=P,B(),u.value.filteredList=!1,P}catch(P){t.handleError(P.message),console.info("[ERROR]: getFilteredListWithFields() error = ",P)}}async function B(P=!0){const N=[];for(const[T]of d.value)N.push(v(T,P));return await Promise.all(N),r.getProductCount(),!0}function D(P,N){return d.value.get(P).columns.some(T=>T.field.toLowerCase()===N)||r.cartItemColumnsMap[P].some(T=>T.field.toLowerCase()===N)}function w(P,N){let T=Xo(P);const O=n.pricingSchema,F=D(N,"xx_ord1__nrc__c"),q=D(N,"xx_ord1__sales_price__c"),M=D(N,"xx_ord1__qty__c");return T=T.map(U=>{let L={};O==="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?L={...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}:{},...F?{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}:{}}:O==="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)?q&&(L={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}):O!=="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?q&&(L={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}):O!=="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)&&q&&(L={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:j,xx_ord1__sales_price__c:H,xx_ord1__nrc__c:Z,...te}=U,ne={...te,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,...M?{xx_ord1__qty__c:j}:{},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",...L};return ne!=null&&ne.billingPeriodValue&&(r.hasBillingPeriodInList[N]=!0,r.billingPeriodValue=ne==null?void 0:ne.xx_ord1__billing_period__c),"oneTimeValue"in ne&&(r.oneTimeFieldAvailable[N]=!0),"billingPeriodValue"in ne&&(r.billingPeriodFieldAvailable[N]=!0),(ne==null?void 0:ne.oneTimeValue)!==""&&(ne==null?void 0:ne.oneTimeValue)!==null&&(r.hasOneTimeValue=!0),ne}),T}async function v(P,N=!0){var T,O;try{const F=d.value.get(P);if(console.info("sectionData = ",F.sectionName),!F)return;F.loading=N,N&&(F.lineItems=[]);const{columns:q,filters:M,primarysort:U,primarysortdesc:L,footer:j}=F,H=q.map(pe=>pe.field.toLowerCase());H.includes("xx_ord1__parent_qli__c")||H.push("xx_ord1__parent_qli__c"),H.includes("xx_ord1__item__c")||H.push("xx_ord1__item__c"),H.includes("xx_ord1__sys_configuration_status2__c")||H.push("xx_ord1__sys_configuration_status2__c"),(T=r.cartItemColumnsMap[P])==null||T.forEach(pe=>{H.includes(pe.field)||H.push(pe.field)});const Z=await S({fields:H,recordId:o.value,filters:M||[],primarySortBy:U||"",primarySortOrder:L?"DESC":"ASC",includeOptions:y.value,totalFields:j?[j.apiname]:[]}),te=Z.lineItems,ne=new Map;let Q=[];const ce=(O=Z.fieldTotals)==null?void 0:O.map(pe=>pe.totalValue);te.forEach(pe=>{pe.XX_ORD1__Parent_QLI__c?ne.has(pe.XX_ORD1__Parent_QLI__c)?ne.get(pe.XX_ORD1__Parent_QLI__c).push(pe):ne.set(pe.XX_ORD1__Parent_QLI__c,[pe]):Q.push(pe)});const ue=[];return Q.forEach(pe=>{ue.push(pe),ne.has(pe.Id)&&ue.push(...ne.get(pe.Id))}),Q=w(Q,P),F.lineItems=Xo(ue),F.parentQLIs=Q,F.totalValues=ce,F.loading=!1,d.value=new Map(d.value),ue}catch(F){console.info("[ERROR]: fetchQuoteLineItems()123 error = ",F.message);const q=d.value.get(P);q&&(q.loading=!1)}}async function S(P){try{let N=await window.salesforceConnector.getQuoteLineItemsWithFilteredTable(JSON.stringify(P));return N=Tt(N),N}catch(N){t.handleError(N.message),console.info("[ERROR]: getQuoteLineItemsWithFilteredTable() error = ",N)}}async function I(P){try{console.info("updateQli() payload = ",P);let N=await window.salesforceConnector.updateQli(JSON.stringify(P));return N=Tt(N),B(!1),N}catch(N){t.handleError(N.message),console.info("[ERROR]: updateQli() error = ",N)}}async function R(P){try{let N=await window.salesforceConnector.deleteQLI(P);return N=Tt(N),B(),N}catch(N){t.handleError(N.message),console.info("[ERROR]: deleteQLI() error = ",N)}}async function z(P,N){try{c.value=!0;const T={fields:P};N&&(T.objectName=N),P.includes("xx_ord1__qty__c")&&N==="xx_ord1__ecatalog_item__c"&&(T.fields=T.fields.filter(F=>F!=="xx_ord1__qty__c")),P.includes("xx_ord1__sales_price__c")&&N!=="xx_ord1__quote_line_item__c"&&(T.fields=T.fields.filter(F=>F!=="xx_ord1__sales_price__c"));let O=await window.salesforceConnector.getFieldsData(JSON.stringify(T));return typeof O=="string"&&(O=JSON.parse(O)),O!=null&&O.errorMessage?(t.handleError(O.errorMessage),null):(m.value={...m.value,...O},console.info("fieldsData.value = ",JSON.stringify(m.value)),O)}catch(T){return t.handleError("Failed to get Fields Data. Please try again."),console.info("[ERROR]: getFieldsData() error = ",T),null}finally{c.value=!1}}function $(P=""){var N;return!P||P.includes(".")?!1:P.includes("xx_ord1__qty__c")?!0:((N=m.value[P])==null?void 0:N.isEditable)||!1}function X(){W(F7)}async function W(P){var N,T,O,F,q,M,U,L,j;if(P.payload){if((N=P.payload)!=null&&N.uiModification){const H=P.payload.uiModification;if(((T=H.addColumn)==null?void 0:T.length)>0)if(H.addColumn.forEach(Z=>{Z.columns.forEach(te=>{te.field=te.field.toLowerCase()})}),H.addColumn[0].sectionName==="all_section")for(const[Z,te]of d.value)te.columns=[...te.columns,...H.addColumn[0].columns];else H.addColumn.forEach(Z=>{d.value.get(Z.tableId)&&(d.value.get(Z.tableId).columns=[...d.value.get(Z.tableId).columns,...Z.columns])});if(((O=H.removeColumn)==null?void 0:O.length)>0)if(H.removeColumn.forEach(Z=>{Z.columns=Z.columns.map(te=>te.toLowerCase())}),H.removeColumn[0].sectionName==="all_section")for(const[Z,te]of d.value)te.columns=te.columns.filter(ne=>!H.removeColumn[0].columns.includes(ne.field));else H.removeColumn.forEach(Z=>{d.value.get(Z.tableId)&&(d.value.get(Z.tableId).columns=d.value.get(Z.tableId).columns.filter(te=>!Z.columns.includes(te.field)))});if(((F=H.filter)==null?void 0:F.length)>0)if(H.filter[0].sectionName==="all_section")for(const[Z,te]of d.value)te.filters=[...te.filters,...H.filter[0].filters];else H.filter.forEach(Z=>{d.value.get(Z.tableId)&&(d.value.get(Z.tableId).filters=[...d.value.get(Z.tableId).filters,...Z.filters])});if(((q=H.groupBy)==null?void 0:q.length)>0){const Z=((M=[...d.value.values()][0])==null?void 0:M.columns)||M7;d.value.clear(),r.cartItemColumnsMap={},H.groupBy.forEach(te=>{r.cartItemColumnsMap[te.tableId]=te.columns||Z,d.value.set(te.tableId,{loading:!0,lineItems:[],parentQLIs:[],columns:te.columns||Z,tableId:te.tableId,sectionName:te.sectionName,selected:new Map,footer:_(te.footer),filters:te.filters,primarysort:te.primarysort,primarysortdesc:te.primarysortdesc})})}H.showOptions!==void 0&&(y.value=H.showOptions)}if(((L=(U=P.payload)==null?void 0:U.sections)==null?void 0:L.length)>0){const H=(j=P.payload)==null?void 0:j.sections;d.value.clear(),H.forEach(Z=>{Z.tableId||(Z.tableId=vn()),Z.selected=new Map,d.value.set(Z.tableId,Z)}),B()}}P.actionFunction==="Reload"&&(console.log("Reloading configurator 3"),B(),console.info("Reloading quote line items"))}async function K(P){var N,T;try{const O=new Set;for(const F of d.value.keys())(N=d.value.get(F).lineItems)==null||N.forEach(M=>{M.attributes=null,O.add(M.id)});if(P){const F={lineItemIds:[...O]},q=await window.productManagerController.getLineItemAttributes({request:JSON.stringify(F)}),M=JSON.parse(q.data);for(const U of d.value.keys())(T=d.value.get(U).lineItems)==null||T.forEach(j=>{j.attributes=M[j.id]||null})}}catch(O){console.info("[ERROR]: fetchAttributesData() error = ",O)}}return{showAttributes:f,quoteId:o,quoteName:a,templateId:l,templateOptions:s,loading:u,currentTemplateData:h,fieldsData:m,fieldsDataLoading:c,showOptionHeaderButton:b,sectionDataMap:d,promptSuggestions:p,lineItemsCount:i,addColumns:X,getQuoteEPageLayout:A,getPayload:x,getPrimaryQuote:g,fetchTemplates:C,getFilteredListWithFields:k,getQuoteLineItemsWithFilteredTable:S,updateQli:I,getFieldsData:z,deleteQLI:R,performAIAction:W,isEditableField:$,fetchQuoteLineItems:v,fetchAllQuoteLineItems:B,fetchAttributesData:K}}),wo=it.defineStore("comRoot",()=>{const t=Un(),r=Mt(),n=$n(),o=e.ref(""),a=e.ref(""),i=e.ref("Genesis AI"),l=e.ref(""),s=e.ref({}),u=e.ref(""),h=e.ref(""),d=e.ref(""),m=e.ref(""),c=e.ref({}),y=e.ref(""),f=e.ref(""),b=e.ref(""),p=e.ref(""),x=e.ref(""),g=e.ref(""),C=e.ref(""),_=e.ref("Single"),E=e.ref("closed"),A=e.computed(()=>n.quoteName),k=e.computed(()=>_.value==="Single");async function B(S){o.value=S||Jr("id"),a.value=Jr("origin"),await w(),await D()}async function D(){try{console.info("getRecordInfo",o.value);let S=await window.salesforceConnector.getRecordInfo(o.value);return S=Tt(S),S!==void 0&&(c.value=S,y.value=S.name,f.value=S.objectType,b.value=S.accountId,p.value=S.eCatalogId,x.value=S.currencyCode,g.value=S.userLocale,C.value=S.opportunityId),(S==null?void 0:S.objectType)==="XX_ORD1__Quote__c"?(n.quoteId=S==null?void 0:S.recordId,n.templateId=S==null?void 0:S.templateId,n.quoteName=S==null?void 0:S.name,n.lineItemsCount=(S==null?void 0:S.lineItemsCount)||0):(S==null?void 0:S.objectType)==="Opportunity"&&await n.getPrimaryQuote(S.recordId),S}catch(S){r.handleError(S.message)}}async function w(){var I,R;console.info("getOrgInformation",o.value);const S=await window.salesforceConnector.getOrgInformation();t.websocketUrl=S.websocketUrl,l.value=(I=S.locale)==null?void 0:I.replace("_","-"),s.value=S.user,u.value=S.orgName,h.value=S.orgId,d.value=S.orgType,m.value=S.packageVersion,_.value=(R=S==null?void 0:S.pricingSchema)==null?void 0:R.toLowerCase()}function v(S){i.value=S,z0(S)}return{id:o,origin:a,title:A,subTitle:i,locale:l,user:s,orgName:u,orgId:h,orgType:d,packageVersion:m,objectType:f,recordInfo:c,name:y,accountId:b,eCatalogId:p,currencyCode:x,userLocale:g,opportunityId:C,pricingSchema:_,isSinglePricingSchema:k,flyoutState:E,start:B,getRecordInfo:D,setSubTitle:v}}),R7=it.defineStore("quickSelection",()=>{const t=Mt(),r=wo(),n=$n(),o=e.ref(null),a=e.ref(!1),i=e.ref([]),l=e.ref([]),s=e.ref(!1),u=e.ref({}),h=e.ref({rowLimit:10,paging:!0,offset:0,currentPage:1,totalPages:1}),d=e.ref(!1);async function m(){a.value=!0;try{const E=JSON.stringify({layoutType:"Quick Selection",layoutObject:"xx_ord1__ecatalog_item__c",...r.objectType?{contextObject:r.objectType}:{}});let A={};A=await window.salesforceConnector.getDynamicPageLayout(E),o.value=Cl(A,"Unable to find the Quick Selection Layout for your user profile"),console.info("quickSelectionLayout.value = ",o.value),h.value.rowLimit=o.value.configuration.rowLimit||10,o.value.data.columns.forEach(k=>{!k.field&&k.label==="QTY"&&(k.field="xx_ord1__qty__c")}),a.value=!1}catch(E){a.value=!1,t.handleError("Failed to get Page structure data. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",E)}}function c(){const E=new Map;return o.value.data.columns.forEach(A=>{E.set(A.field,!0)}),o.value.data.searchResultColumns.forEach(A=>{E.set(A.field,!0)}),Array.from(E.keys())}async function y(E){var A,k;try{let B=await window.salesforceConnector.saveCompetitorSKU(E);if(B!=null&&B.errorMessage){t.handleError(B.errorMessage);return}if((A=B[0])!=null&&A.errorMessage){t.handleError((k=B[0])==null?void 0:k.errorMessage);return}return B}catch(B){t.handleError("Failed to Match Item. Please try again."),console.info("[ERROR]: saveCompetitorSKU() error = ",B)}}async function f(E="",A=[]){try{let k=o.value.data,B=o.value.configuration;const D=E.trim();if(console.info("searchTextValue.trim() = ",E.trim()),!D)return[];let w=null;console.info("useMappings = ",d.value),d.value?w=B7(b()):w=b(),console.info("fields before filter = ",w),w=w.filter(R=>R!=="xx_ord1__qty__c"),console.info("fields after filter = ",w);const v={fields:w,...A.length?{dynamicFilters:n.getDynamicFilters(A)}:{},searchText:D,accountId:r.accountId,...r.eCatalogId?{catalogId:r.eCatalogId}:{},...r.objectType==="opportunity"?{opportunityId:r.id}:{},...k!=null&&k.sort?{primarySortBy:k.sort.primary.field,primarySortOrder:k.sort.primary.direction,secondarySortBy:k.sort.secondary.field,secondarySortOrder:k.sort.secondary.direction}:{},rowLimt:(B==null?void 0:B.rowLimit)||20,paging:(B==null?void 0:B.paging)||!1,...h.value.offset!==0?{offset:h.value.offset}:{},objectName:k.objectName,currencyCode:r.currencyCode};console.info("getQuickSelectionItems payload = ",JSON.stringify(v));const S=await window.salesforceConnector.getItems(JSON.stringify(v));if(console.info("getQuickSelectionItems Res = ",JSON.stringify(S)),S!=null&&S.errorMessage){t.handleError(S.errorMessage);return}return S!=null&&S.itemCount&&(h.value.totalPages=Math.ceil((S==null?void 0:S.itemCount)/h.value.rowLimit)),Xo(S.lstItems,{xx_ord1__qty__c:"1"})}catch(k){t.handleError("Failed to fetch Results. Please try again."),console.info("[ERROR]: getQuickSelectionItems() error = ",k)}}function b(){let E=[];for(const A of o.value.data.columns){let k=A.field;if(k!=null&&k.includes(".")){E.includes(k)||E.push(k);let D=k.split(".")[0];D=D.slice(0,-1)+"c",E.includes(D)||E.push(D)}else E.includes(k)||E.push(k)}return console.info("getAllQuickSelectionFields() fields = ",E),E.filter(A=>A.toLowerCase()!=="xx_ord1__qty__c")}async function p(E,A,k,B){console.info("searchText:",JSON.stringify(E)),console.info("row:",JSON.stringify(A)),console.info("rowIndex:",JSON.stringify(k)),console.info("column:",JSON.stringify(B));const D=k+(h.value.currentPage-1)*h.value.rowLimit;if(B.field.toLowerCase().includes("xx_ord1__item__r")){if(i.value[D].itemLookupLoading=!0,d.value=!0,l.value=await f(E),l.value.length>0){const w=[];for(let v=0;v<l.value.length;v++)i.value[D].itemDataRetrieved=!0,l.value[v].xx_ord1__item__c&&w.push({name:l.value[v]["xx_ord1__item__r.name"],value:l.value[v].xx_ord1__item__c,label:l.value[v][B.field.toLowerCase()]});i.value[D][B.field.toLowerCase()+"_options"]=w}i.value[D].itemLookupLoading=!1}else if(B.field.toLowerCase().includes("xx_ord1__competitor_item__r")){i.value[D].competitorLookupLoading=!0;const w=await x(E);w!=null&&w.items&&(i.value[D][B.field.toLowerCase()+"_options"]=w.items.map(v=>({name:v.fields[2].value,value:v.fields[1].value,label:v.fields[0].value}))),i.value[D].competitorLookupLoading=!1,console.info("getLookupData:: Search Lookup Handler Response = ",w)}}async function x(E){var k,B;console.info("getLookupData() searchText = ",E);const A={searchText:E,obj:"xx_ord1__competitor_item__c",filters:null,displayFields:["xx_ord1__sku__c"]};try{let D=await window.salesforceConnector.getLookupData(JSON.stringify(A));if(typeof D=="string"&&(D=JSON.parse(D)),D!=null&&D.errorMessage){t.handleError(D.errorMessage);return}if((k=D[0])!=null&&k.errorMessage){t.handleError((B=D[0])==null?void 0:B.errorMessage);return}return D}catch(D){t.handleError("Failed to Search For Item. Please try again."),console.info("[ERROR]: getLookupData() error = ",D)}}async function g(E,A){var B;console.info("Update Other Fields Value = ",E),console.info("Update Other Fields Row Index = ",A);const k=A+(h.value.currentPage-1)*h.value.rowLimit;console.info("actualRowIndex = ",k);try{if(E){const D=l.value.filter(w=>w.xx_ord1__item__c===E)[0];if(D){s.value=!0;const w=o.value.data.columns[1].field;i.value[k][w]&&await C(D,k),(B=i.value[k])!=null&&B.itemDataRetrieved&&(i.value[k].status="New Match Requested",i.value[k].noMatchCleared=!0),Object.keys(D).forEach(v=>{const S=Hc[v.toLowerCase()];console.info("Mapped Key = ",S),S&&(i.value[k][S]=D[v])}),s.value=!1}else i.value[k].status=""}else i.value[k].status="No Match"}catch(D){t.handleError("Unable to request a match for this item please try again."),console.info("Error in updateOtherFields = ",D)}}async function C(E,A){const k=i.value[A],B=o.value.data.columns[1].field,D=[{sku:k[B],name:k[B],productDescription:k.xx_ord1__line_description__c||"",productURL:null,status:"Match Requested",competitorAccountId:null,itemId:E.xx_ord1__item__c}];let w=await y(JSON.stringify(D));console.info("Match Item: ",JSON.stringify(w)),i.value[A][`${B}_options`]=[{value:w[0].competitorItemId,label:w[0].sku}],i.value[A][B]=w[0].competitorItemId}async function _(E){try{let A=await window.salesforceConnector.createQLI(JSON.stringify(E));typeof A=="string"&&(A=JSON.parse(A));let k=!1;if((A==null?void 0:A.length)>0)for(let B=0;B<A.length;B++)A[B].errorMessage&&(k=!0,A[B].errorMessage.includes("Line Description: data value too large")&&(A[B].errorMessage="Error: The description is too long—it must be under 200 characters."));if(k){A.forEach(B=>{u.value[B.eCatalogItemId]=B});return}else u.value=[];return A}catch(A){t.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addAllItemsToQuote() error = ",A)}}return{quickSelectionLayout:o,quickSelectionLayoutLoading:a,processedRecords:i,useMappings:d,currentSearchData:l,createQliErrors:u,getQuickSelectionLayout:m,getAllFieldsForQuickSelectionLayout:c,saveCompetitorSKU:y,getQuickSelectionItems:f,searchLookupHandler:p,updateOtherFields:g,addAllItemsToQuote:_}});function L7(t,r,n){const o=[];return t.templateId||o.push("AI_GUIDANCE_MISSING_TEMPLATE_ID"),t.composablesOrgType||o.push("AI_GUIDANCE_MISSING_COMPOSABLES_ORG_TYPE"),t.websocketUrl||o.push("AI_GUIDANCE_MISSING_WEBSOCKET_URL"),t.packageVersion||o.push("AI_GUIDANCE_MISSING_PACKAGE_VERSION"),n!=null&&n.accessToken||o.push("AI_GUIDANCE_MISSING_SECURITY_TOKEN"),r!=null&&r.organizationId||o.push("AI_GUIDANCE_MISSING_IDENTITY_ORG_ID"),r!=null&&r.userId||o.push("AI_GUIDANCE_MISSING_IDENTITY_USER_ID"),r!=null&&r.accountId||o.push("AI_GUIDANCE_MISSING_IDENTITY_ACCOUNT_ID"),o}function Xc(t){return t?!t.startsWith("ws://")&&!t.startsWith("wss://")?"WEBSOCKET_INVALID_URL_FORMAT":null:"WEBSOCKET_MISSING_URL"}function P7(t){var r,n,o,a,i,l;if(!t)return{playbookId:null,error:null};try{const s=(o=(n=(r=t==null?void 0:t[0])==null?void 0:r.blocks)==null?void 0:n[0])==null?void 0:o.playbookId,u=((i=(a=t==null?void 0:t.blocks)==null?void 0:a[0])==null?void 0:i.playbookId)||((l=t==null?void 0:t[0])==null?void 0:l.playbookId);return{playbookId:s||u||null,error:null}}catch(s){return console.error("[validation] Error validating block structure:",s),{playbookId:null,error:"AI_GUIDANCE_BLOCK_STRUCTURE_INVALID"}}}function q7(t,r){const n=[];t!=null&&t.currentPlaybook||n.push("COMPONENT_LOADER_MISSING_PLAYBOOK");const o=r;return o&&o!=="catalog"&&o!=="cart"&&o!=="configurator"&&o!==""&&n.push("COMPONENT_LOADER_INVALID_COMPONENT_KEY"),n}const No="Preparing Your Quote Please Wait...",vi={message:"Your quote is ready! Click 'Add Products' to browse Products, or enter a prompt and AI will do the work for you.",type:"response",requestId:"no-request-id"},$7=18e4,U7=2e3,z7={bgColor:"#EDF8EB",textColor:"#5F5F5F"};function j7({minDisplayMs:t=2e3}={}){const r=[];let n=null,o=!1,a=null,i=null,l=null;const s=new Set;function u(){const g={isActive:o,currentMessage:a?a.message:null,queuedCount:r.length};s.forEach(C=>{try{C(g)}catch{}})}function h(){n||(n=setInterval(m,100))}function d(){n&&(clearInterval(n),n=null)}function m(){if(o){if(!a&&r.length>0){a={...r.shift(),shownAt:Date.now()},u();return}if(a&&Date.now()-a.shownAt>=a.minDisplayMs){if(r.length>0)a={...r.shift(),shownAt:Date.now()},u();else if(a=null,o=!1,d(),u(),i&&l){const C=i,_=l;i=null,l=null;try{_(C)}catch{}}}}}function c(g,C={}){return r.push({message:g,minDisplayMs:C.minDisplayMs||t}),o||(o=!0,h(),u()),r.length}function y(g,C){if(i=g,typeof C=="function"&&(l=C),o)h();else{const _=l,E=i;if(i=null,l=null,_)try{_(E)}catch{}}}function f(g){return typeof g!="function"?()=>{}:(s.add(g),g({isActive:o,currentMessage:a?a.message:null,queuedCount:r.length}),()=>s.delete(g))}function b(){return a?a.message:null}function p(){return o}function x(){r.length=0,a=null,o=!1,i=null,l=null,d(),u()}return{getCurrentMessage:b,getIsActive:p,subscribe:f,enqueue:c,setSuccess:y,clear:x}}const Un=it.defineStore("ai",()=>{const t=wo(),r=$n();Kc(),R7();const n=Rt(),o=Ci(),a=ft(),i=Jn();(()=>{try{return L0()}catch{return{path:""}}})();const l=e.ref(""),s=e.ref([]),u=e.ref(""),h=e.ref([]),d=e.ref(!1),m=e.ref(null),c=e.ref({}),y=e.ref(null),f=e.ref(null),b=e.ref(null),p=e.ref(null),x=e.ref(!1),g=e.ref(!0),C=e.ref(null),_=e.ref(!1),E=e.ref(null),A=e.ref(No),k=j7({minDisplayMs:U7});k.subscribe(({isActive:oe,currentMessage:le})=>{oe&&(A.value=le||No)});const B=e.ref([]),D=e.computed(()=>z7),w=()=>{var Ce,J,se;const le=(se=(J=(((Ce=i.currentPlaybook)==null?void 0:Ce.playBookSteps)||[])[0])==null?void 0:J.uiSpecs)==null?void 0:se.customText;return{message:typeof le=="string"&&le.trim().length>0?le:vi==null?void 0:vi.message,type:"response"}},v=e.ref(vn()),S=e.computed(()=>{const oe=a.organizationId.value,le=a.userId.value,be=a.cid.value||v.value;return`${oe}_${le}_${be}`}),I=e.computed(()=>m.value.readyState==WebSocket.OPEN),R=e.computed(()=>a.websocketUrl.value||""),z=()=>{c.value={salesforceOrgId:a.organizationId.value,salesforceOrgType:a.composablesOrgType.value,salesforceUserId:a.userId.value,userType:"Salesforce",chatRoomId:S.value,chatId:null,requestId:"",prompt:"",initiatedFrom:t.origin||"Quote",internalCall:!1,contextObjectId:a.quoteId.value,contextObjectType:"Quote",payload:{lineItemsCount:r.lineItemsCount},origin:"DXP",defaultBatchSize:10,actionType:"",packageVersion:a.packageVersion.value,relatedIds:{accountId:a.accountId.value,eCatalogId:a.eCatalogId.value||"",contactId:a.cid.value||""}}},$=(oe,le={})=>{g.value&&Et("websocket:error",{errorCode:oe,isInitialization:!0,...le})};async function X(){const oe=Xc(R.value);if(oe)throw $(oe,{url:R.value}),new Error("WebSocket URL validation failed");g.value=!0;const le=1e4;C.value=setTimeout(()=>{if(m.value&&m.value.readyState!==WebSocket.OPEN&&($("WEBSOCKET_CONNECTION_TIMEOUT"),m.value))try{m.value.close()}catch{}},le);let be=!1;return new Promise((J,se)=>{var Se,De,Oe,He;const fe=(Ve,Ge)=>{be||(be=!0,Ve?se(Ve):J(Ge))},Y=()=>{W(),fe(null)},re=Ve=>{K(Ve),be||fe(new Error("WebSocket closed before open"))},me=Ve=>{P(Ve),be||fe((Ve==null?void 0:Ve.error)||new Error("WebSocket error"))};try{const Ve=R.value+"?chatRoomId="+S.value;m.value=new WebSocket(Ve),m.value.addEventListener("open",Y),m.value.addEventListener("message",N),m.value.addEventListener("close",re),m.value.addEventListener("error",me)}catch(Ve){C.value&&(clearTimeout(C.value),C.value=null),(Se=Ve.message)!=null&&Se.includes("network")||(De=Ve.message)!=null&&De.includes("Network")?$("WEBSOCKET_NETWORK_ERROR",{error:Ve.message}):(Oe=Ve.message)!=null&&Oe.includes("CORS")||(He=Ve.message)!=null&&He.includes("cors")?$("WEBSOCKET_CORS_ERROR",{error:Ve.message}):$("WEBSOCKET_CONNECTION_FAILED",{error:Ve.message}),fe(Ve)}})}const W=()=>{C.value&&(clearTimeout(C.value),C.value=null),g.value=!1,F(),U()},K=oe=>{if(C.value&&(clearTimeout(C.value),C.value=null),g.value){const le=(oe==null?void 0:oe.code)??1006,be=(oe==null?void 0:oe.reason)??"";switch(le){case 1e3:break;case 1001:case 1002:case 1003:case 1013:case 1014:$("WEBSOCKET_UNEXPECTED_CLOSE",{closeCode:le,closeReason:be});break;case 1006:$("WEBSOCKET_ABNORMAL_CLOSURE",{closeCode:le,closeReason:be});break;case 1011:$("WEBSOCKET_SERVER_ERROR",{closeCode:le,closeReason:be});break;case 1012:$("WEBSOCKET_SERVICE_RESTART",{closeCode:le,closeReason:be});break;case 1015:$("WEBSOCKET_SSL_ERROR",{closeCode:le,closeReason:be});break;default:le!==1e3&&$("WEBSOCKET_UNEXPECTED_CLOSE",{closeCode:le,closeReason:be})}}g.value=!1,_.value=!1,q()},P=oe=>{var le;if(C.value&&(clearTimeout(C.value),C.value=null),g.value){let be="WEBSOCKET_CONNECTION_FAILED";const Ce=(oe==null?void 0:oe.message)||((le=oe==null?void 0:oe.error)==null?void 0:le.message)||"Unknown websocket error";Ce.includes("network")||Ce.includes("Network")||Ce.includes("Failed to fetch")?be="WEBSOCKET_NETWORK_ERROR":Ce.includes("CORS")||Ce.includes("cors")?be="WEBSOCKET_CORS_ERROR":Ce.includes("SSL")||Ce.includes("TLS")||Ce.includes("certificate")?be="WEBSOCKET_SSL_ERROR":Ce.includes("refused")||Ce.includes("ECONNREFUSED")?be="WEBSOCKET_CONNECTION_REFUSED":(Ce.includes("auth")||Ce.includes("unauthorized")||Ce.includes("401"))&&(be="WEBSOCKET_AUTHENTICATION_FAILED"),$(be,{error:Ce})}_.value=!1,ce(),q()},N=oe=>{var Ce,J,se,fe;F();const le=JSON.parse(oe.data);le!=null&&le.chatId&&(c.value.chatId=le.chatId);const be=(le==null?void 0:le.contextObjectId)??((Ce=le==null?void 0:le.payload)==null?void 0:Ce.contextObjectId);if(be){const Y=c.value.contextObjectId||((J=a.quoteId)==null?void 0:J.value)||"",re=be;re&&re!==Y&&(c.value.contextObjectId=re,a.updateConfig({quoteId:re}),Et("quote-id:updated",{quoteId:re}))}if(O(le),le.status!=="ALIVE"){if((le==null?void 0:le.status)==="IN_PROGRESS"||(le==null?void 0:le.loading)===!0){const Y=(le==null?void 0:le.message)||(le==null?void 0:le.statusMessage)||(le==null?void 0:le.stepName)||No;k.enqueue(Y),A.value=k.getCurrentMessage()||Y;return}if((le==null?void 0:le.status)==="SUCCESS"){const Y=(le==null?void 0:le.message)||No;A.value=k.getCurrentMessage()||Y,k.setSuccess(le,re=>{T(re)});return}Array.isArray(le.messages)?(A.value=null,_.value=!1,s.value.push(w()),le.messages.length>0&&te(le.messages)):le.agentResponse&&(le.errorMessage&&(le.agentResponse.content=le.errorMessage,le.agentResponse.error=!0),A.value=null,s.value.push({message:le.agentResponse.content,type:le.agentResponse.role,requestId:le.requestId,epoch:le.agentResponse.epoch,error:le.agentResponse.error,isDML:le.agentResponse.isDML,...(se=le.agentResponse)!=null&&se.filesData?{filesData:(fe=le.agentResponse)==null?void 0:fe.filesData}:{}})),B.value=le.links||[],ie(le)}};function T(oe,le={}){var J,se,fe,Y;const{skipComponentLoad:be=!1}=le||{},Ce=(oe==null?void 0:oe.contextObjectId)??((J=oe==null?void 0:oe.payload)==null?void 0:J.contextObjectId);if(Ce){const re=c.value.contextObjectId||((se=a.quoteId)==null?void 0:se.value)||"",me=Ce;me&&me!==re&&(console.info("[ai] Updating quoteId from contextObjectId (SUCCESS):",{current:re,new:me}),c.value.contextObjectId=me,a.updateConfig({quoteId:me}),console.info("[ai] Emitting quote-id:updated event with quoteId (SUCCESS):",me),Et("quote-id:updated",{quoteId:me}))}if(oe!=null&&oe.loading){A.value=oe.message;return}else Array.isArray(oe==null?void 0:oe.messages)?(A.value=null,_.value=!1,s.value.push(w()),oe.messages.length>0&&te(oe.messages)):oe!=null&&oe.agentResponse?(oe.errorMessage&&(oe.agentResponse.content=oe.errorMessage,oe.agentResponse.error=!0),A.value=null,s.value.push({message:oe.agentResponse.content,type:oe.agentResponse.role,requestId:oe.requestId,epoch:oe.agentResponse.epoch,error:oe.agentResponse.error,isDML:oe.agentResponse.isDML,...(fe=oe.agentResponse)!=null&&fe.filesData?{filesData:(Y=oe.agentResponse)==null?void 0:Y.filesData}:{}})):A.value=null;B.value=(oe==null?void 0:oe.links)||[];try{Et("ai-response:success",oe)}catch{}be||ie(oe)}const O=oe=>{const le=oe==null?void 0:oe.eventType,be=(oe==null?void 0:oe.loading)===!0||le==="ResponseTextDeltaEvent",Ce=le==="ResponseTextDoneEvent"||Array.isArray(oe==null?void 0:oe.messages)||!!(oe!=null&&oe.agentResponse);if(be&&!Ce){x.value=!0;return}Ce&&(x.value=!1)},F=()=>{q(),y.value=setTimeout(()=>{if(I.value){const oe={action:"heartbeat"};m.value.send(JSON.stringify(oe)),F()}},$7)},q=()=>{y.value&&(clearInterval(y.value),y.value=null)};function M(oe){const le={...c.value};le.requestType="Action",le.actionType="Undo",le.undoRequestId=oe,le.requestId=vn(),Z(le)}function U(){_.value=!0;const oe={...c.value};oe.requestType="Action",oe.actionType="History",oe.requestId=vn(),Z(oe)}function L(oe){return console.info("[ai] isUnsavedChanges check",{activeKey:((i==null?void 0:i.activeComponentKey)||"").toLowerCase(),isChangedConfiguration:n.isChangedConfiguration}),((i==null?void 0:i.activeComponentKey)||"").toLowerCase()==="configurator"&&n.isChangedConfiguration&&console.warn("[ai] Unsaved configurator changes detected; not blocking send"),!1}function j(oe,le=!0,be=null){if(console.info("[ai] sendMessage",{messageLength:(oe||"").length,hasCustomPayload:!!be,addMessageToHistory:le}),L()){console.warn("[ai] sendMessage aborted: unsaved changes detected");return}if(oe.trim()){let Ce={...c.value};Ce.prompt=oe.trim(),Ce.requestType="Chat",Ce.requestId=vn(),Ce.internalCall=!1,Ce.payload=ne(),console.log("[ai] _payload.payload",Ce.payload),Ce.componentName=Q.value,Ce.templateId=r.templateId,Ce.payload.lineItemsCount=r.lineItemsCount,Ce.relatedIds.eCatalogId=a.eCatalogId.value||"",be&&(Ce={...Ce,...be}),ue(),le&&s.value.push({message:oe.trim(),type:"user",...E.value&&{fileData:[E.value]},requestId:Ce.requestId}),console.info("[ai] sending prompt",{requestId:Ce.requestId,requestType:Ce.requestType,componentName:Ce.componentName}),Z(Ce),F()}}const H=e.computed(()=>{var be,Ce,J;const oe=((be=i.currentPlaybook)==null?void 0:be.pbUniqueId)??((Ce=i.currentPlaybook)==null?void 0:Ce.vUniqueId)??null,le=i.currentStepName??((J=i.currentStep)==null?void 0:J.stepName)??null;return{pbUniqueId:oe,stepName:le}});function Z(oe){const le={...oe},{pbUniqueId:be,stepName:Ce}=H.value||{};console.log("[ai] activePlaybookContext",H.value),be&&(le.pbUniqueId=be),Ce&&(le.stepName=Ce);const J={action:"prompt",data:le};m.value.send(JSON.stringify(J))}const te=oe=>{const le=oe.filter(({content:be})=>!!be).map(be=>({message:be.content,type:be.role,requestId:be.requestId,epoch:be.epoch,isDML:be.isDML,undone:be.undone}));le.forEach((be,Ce)=>{be.isDML===!0&&Ce!==le.length-1&&(be.isDML=!1)}),s.value=[...s.value,...le]};function ne(){const oe=((i==null?void 0:i.activeComponentKey)||"").toLowerCase();return console.info("[ai] getRequestBody activeKey",oe),oe==="cart"||oe==="quote_item"?(console.info("[ai] getRequestBody → using quoteStore.getPayload()"),r.getPayload()):oe==="configurator"?o.getPayload():(console.info("[ai] getRequestBody → empty {}"),{})}const Q=e.computed(()=>{const oe=((i==null?void 0:i.activeComponentKey)||"").toLowerCase();return oe==="cart"||oe==="quote_item"?"QuoteItem":""}),ce=()=>{s.value.push({type:"response",message:"Oops! Something went wrong while processing your request. Please try again later.",error:!0})},ue=()=>{s.value=s.value.map(oe=>({...oe,links:[]}))};function pe(oe){var le,be,Ce;try{const J=oe==null?void 0:oe.stepName;if(!J)return!1;const se=He=>String(He||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),fe=((le=i.currentPlaybook)==null?void 0:le.playBookSteps)||[],Y=fe.find(He=>He.stepName===J||He.name===J)||null,me=se(Y==null?void 0:Y.stepComponent)==="configurator"||se(J).includes("configure"),Se=!!((be=oe==null?void 0:oe.payload)!=null&&be.productConfiguration&&Array.isArray(oe.payload.productConfiguration)&&oe.payload.productConfiguration.length===0),Oe=se(i.currentStep&&i.currentStep.stepComponent||((Ce=fe.find(He=>He.stepName===(i.currentStepName||"")))==null?void 0:Ce.stepComponent)||i.activeComponentKey)==="configurator";return me&&Se&&Oe}catch{return!1}}function ie(oe){var Ce,J,se,fe;const le=(oe==null?void 0:oe.contextObjectId)??((Ce=oe==null?void 0:oe.payload)==null?void 0:Ce.contextObjectId);if(le){const Y=le,re=c.value.contextObjectId||((J=a.quoteId)==null?void 0:J.value)||"";Y&&Y!==re&&(c.value.contextObjectId=Y,a.updateConfig({quoteId:Y}),Et("quote-id:updated",{quoteId:Y}))}const be=oe==null?void 0:oe.stepName;if(be){if(be==="AI Guidance"||be==="ai_guidance"||be.toLowerCase()==="ai guidance"){console.info("[ai] Skipping navigation for AI Guidance step - side panel will remain in current state");return}if(pe(oe)){console.info("[ai] Skipping configurator update: empty productConfiguration and configurator already active"),(oe==null?void 0:oe.actionFunction)==="Reload"&&(console.log("Reloading configurator 2"),o.refresh());return}try{i.navigateToStep({stepName:be,data:oe})}catch(Y){console.info("navigateToStep failed, falling back to legacy component routing",Y)}return}else{if(i.currentStepName||i.currentStep&&i.currentStep.stepName||null)return;(fe=(se=i.currentPlaybook)==null?void 0:se.playBookSteps)!=null&&fe.length&&i.navigateToStep({stepName:i.currentPlaybook.playBookSteps[0].stepName});return}}function de(){if(I.value){const oe={action:"cancel",data:{requestId:c.value.requestId,chatRoomId:S.value}};m.value.send(JSON.stringify(oe))}}function _e(){try{if(C.value&&(clearTimeout(C.value),C.value=null),g.value=!1,m.value){try{m.value.removeEventListener("open",W)}catch{}try{m.value.removeEventListener("message",N)}catch{}try{m.value.removeEventListener("close",K)}catch{}try{m.value.removeEventListener("error",P)}catch{}try{m.value.close()}catch{}m.value=null}}finally{ye()}}function xe(){try{k.clear()}catch{}l.value="",s.value=[],u.value="",h.value=[],d.value=!1,B.value=[],E.value=null,x.value=!1,p.value=null,A.value=No,c.value={},q(),ye()}const ye=()=>{f.value&&(clearInterval(f.value),f.value=null),y.value&&(clearInterval(y.value),y.value=null),b.value&&(clearTimeout(b.value),b.value=null)};return e.onBeforeUnmount(()=>{ye()}),{unsavedChanges:p,loadingMessage:A,promptMessage:l,buttonLinks:B,websocketUrl:R,chatHistory:s,latestDMLRequest:u,strikethroughHistory:h,attachmentData:E,dataManuallyChanged:d,isThinkingMessage:x,isFetchingHistory:_,chatStyles:D,undoAction:M,connectSocket:X,sendMessage:j,setInitialPayload:z,cancelRequest:de,disconnectSocket:_e,resetState:xe}}),H7={AI_GUIDANCE_MISSING_TEMPLATE_ID:{code:"AI_GUIDANCE_MISSING_TEMPLATE_ID",message:"Template ID is required for AI Guidance to initialize",component:"aiGuidance"},AI_GUIDANCE_MISSING_COMPOSABLES_ORG_TYPE:{code:"AI_GUIDANCE_MISSING_COMPOSABLES_ORG_TYPE",message:"Composables organization type is required",component:"aiGuidance"},AI_GUIDANCE_MISSING_WEBSOCKET_URL:{code:"AI_GUIDANCE_MISSING_WEBSOCKET_URL",message:"WebSocket URL is required for AI Guidance to connect",component:"aiGuidance"},AI_GUIDANCE_MISSING_PACKAGE_VERSION:{code:"AI_GUIDANCE_MISSING_PACKAGE_VERSION",message:"Package version is required",component:"aiGuidance"},AI_GUIDANCE_MISSING_SECURITY_TOKEN:{code:"AI_GUIDANCE_MISSING_SECURITY_TOKEN",message:"Security access token is required for authentication",component:"aiGuidance"},AI_GUIDANCE_MISSING_IDENTITY_ORG_ID:{code:"AI_GUIDANCE_MISSING_IDENTITY_ORG_ID",message:"Organization ID is required in identity context",component:"aiGuidance"},AI_GUIDANCE_MISSING_IDENTITY_USER_ID:{code:"AI_GUIDANCE_MISSING_IDENTITY_USER_ID",message:"User ID is required in identity context",component:"aiGuidance"},AI_GUIDANCE_MISSING_IDENTITY_ACCOUNT_ID:{code:"AI_GUIDANCE_MISSING_IDENTITY_ACCOUNT_ID",message:"Account ID is required in identity context",component:"aiGuidance"},AI_GUIDANCE_PLAYBOOK_INFO_FETCH_FAILED:{code:"AI_GUIDANCE_PLAYBOOK_INFO_FETCH_FAILED",message:"Failed to fetch playbook information from quote",component:"aiGuidance"},AI_GUIDANCE_PLAYBOOK_FETCH_FAILED:{code:"AI_GUIDANCE_PLAYBOOK_FETCH_FAILED",message:"Failed to fetch playbook data",component:"aiGuidance"},AI_GUIDANCE_CATALOG_FETCH_FAILED:{code:"AI_GUIDANCE_CATALOG_FETCH_FAILED",message:"Failed to fetch catalog in context",component:"aiGuidance"},AI_GUIDANCE_BLOCK_FETCH_FAILED:{code:"AI_GUIDANCE_BLOCK_FETCH_FAILED",message:"Failed to fetch block information from template",component:"aiGuidance"},AI_GUIDANCE_BLOCK_STRUCTURE_INVALID:{code:"AI_GUIDANCE_BLOCK_STRUCTURE_INVALID",message:"Invalid block structure - unable to parse blocks data",component:"aiGuidance"},AI_GUIDANCE_BLOCK_PLAYBOOK_ID_MISSING:{code:"AI_GUIDANCE_BLOCK_PLAYBOOK_ID_MISSING",message:"Playbook ID not found in block structure",component:"aiGuidance"},AI_GUIDANCE_JSON_PARSE_ERROR:{code:"AI_GUIDANCE_JSON_PARSE_ERROR",message:"Failed to parse JSON data from server",component:"aiGuidance"},WEBSOCKET_MISSING_URL:{code:"WEBSOCKET_MISSING_URL",message:"WebSocket URL is missing or empty",component:"aiGuidance"},WEBSOCKET_INVALID_URL_FORMAT:{code:"WEBSOCKET_INVALID_URL_FORMAT",message:"WebSocket URL must start with ws:// or wss://",component:"aiGuidance"},WEBSOCKET_CONNECTION_TIMEOUT:{code:"WEBSOCKET_CONNECTION_TIMEOUT",message:"WebSocket connection timed out during initialization",component:"aiGuidance"},WEBSOCKET_CONNECTION_REFUSED:{code:"WEBSOCKET_CONNECTION_REFUSED",message:"WebSocket connection was refused by the server",component:"aiGuidance"},WEBSOCKET_NETWORK_ERROR:{code:"WEBSOCKET_NETWORK_ERROR",message:"Network error occurred while connecting to WebSocket",component:"aiGuidance"},WEBSOCKET_AUTHENTICATION_FAILED:{code:"WEBSOCKET_AUTHENTICATION_FAILED",message:"WebSocket authentication failed",component:"aiGuidance"},WEBSOCKET_UNEXPECTED_CLOSE:{code:"WEBSOCKET_UNEXPECTED_CLOSE",message:"WebSocket connection closed unexpectedly during initialization",component:"aiGuidance"},WEBSOCKET_ABNORMAL_CLOSURE:{code:"WEBSOCKET_ABNORMAL_CLOSURE",message:"WebSocket connection closed abnormally (no close frame received)",component:"aiGuidance"},WEBSOCKET_SERVER_ERROR:{code:"WEBSOCKET_SERVER_ERROR",message:"WebSocket server error occurred during connection",component:"aiGuidance"},WEBSOCKET_SERVICE_RESTART:{code:"WEBSOCKET_SERVICE_RESTART",message:"WebSocket service is restarting",component:"aiGuidance"},WEBSOCKET_CORS_ERROR:{code:"WEBSOCKET_CORS_ERROR",message:"CORS error prevented WebSocket connection",component:"aiGuidance"},WEBSOCKET_SSL_ERROR:{code:"WEBSOCKET_SSL_ERROR",message:"SSL/TLS handshake failed for secure WebSocket connection",component:"aiGuidance"},WEBSOCKET_CONNECTION_FAILED:{code:"WEBSOCKET_CONNECTION_FAILED",message:"WebSocket connection failed during initialization",component:"aiGuidance"},COMPONENT_LOADER_MISSING_PLAYBOOK:{code:"COMPONENT_LOADER_MISSING_PLAYBOOK",message:"Current playbook is missing - cannot load component",component:"aiComponentLoader"},COMPONENT_LOADER_INVALID_COMPONENT_KEY:{code:"COMPONENT_LOADER_INVALID_COMPONENT_KEY",message:"Invalid or unknown component key",component:"aiComponentLoader"}};function G7(t,r={}){const n=H7[t];return n?{...n,details:r}:{code:"UNKNOWN_ERROR",message:`Unknown error: ${t}`,component:"aiGuidance",details:r}}function Wc(t,r="aiGuidance"){const n=(a,i={})=>{const l=G7(a,i);t("ai-guidance:error",l),console.error(`[${r}] Error:`,l)};return{emitError:n,emitErrors:(a,i={})=>{a.forEach(l=>n(l,i))}}}const K7={class:"chat-message-links"},X7=["href","redirect","data-test-id"],W7=ve({__name:"ChatMessageActions",props:{links:{type:Array,default:()=>[]},chatIndex:{type:Number,default:0}},emits:["perform-action"],setup(t){const r=(n,o,a)=>o;return(n,o)=>(e.openBlock(),e.createElementBlock("div",K7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.links,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.label},[a!=null&&a.action?(e.openBlock(),e.createBlock(xt,{key:0,btype:"playbook",text:a.label,disabled:a==null?void 0:a.disabled,"data-test-id":`chat-message-action-${a.label}`,onClick:l=>n.$emit("perform-action",a.action,t.chatIndex,a==null?void 0:a.isStatic)},null,8,["text","disabled","data-test-id","onClick"])):(e.openBlock(),e.createElementBlock("a",{key:1,href:a.link,redirect:r(a.link,a.redirect),target:"_blank",class:"ai-links","data-test-id":`chat-message-action-${a.label}`},e.toDisplayString(a.label),9,X7))],64))),128))]))}},[["__scopeId","data-v-e0a9c744"]]),Q7={class:"a-icon"},Z7=["src"],J7={class:"a-name"},Y7={class:"a-size"},eb=ve({__name:"AppAttachment",props:{background:{type:String,default:"#f8f8f8"},info:{type:Object,required:!0,default:()=>({iconUrl:"",fileName:"",fileSize:""})},encodedString:{type:String,default:""}},emits:["download"],setup(t,{emit:r}){const n=t,o=r,a=i=>{try{const l=i.match(/^data:(.*?);base64,(.*)$/);if(!l||l.length!==3)throw new Error("Invalid Base64 file format");const s=l[1],u=l[2],h=document.createElement("a");h.href=i,h.download=n.info.fileName||"download",h.target="_blank",document.body.appendChild(h),h.click(),document.body.removeChild(h);const d=El(Math.floor(u.length*3/4));o("download",{name:n.info.fileName,size:d,url:i})}catch(l){console.info("[ERROR]: Error decoding Base64 file:",l)}};return(i,l)=>(e.openBlock(),e.createElementBlock("div",{class:"attachment-wrapper",style:e.normalizeStyle(`background: ${t.background}`)},[e.createElementVNode("span",Q7,[e.createElementVNode("img",{src:t.info.iconUrl},null,8,Z7)]),e.createElementVNode("div",null,[e.createElementVNode("p",J7,e.toDisplayString(t.info.fileName),1),e.createElementVNode("p",Y7,e.toDisplayString(t.info.fileSize),1)]),t.encodedString?(e.openBlock(),e.createElementBlock("button",{key:0,class:"a-download",onClick:l[0]||(l[0]=s=>a(t.encodedString))},[e.createVNode(Be,{icon:"download",color:"#353535"})])):e.createCommentVNode("",!0)],4))}},[["__scopeId","data-v-4194a82b"]]),Qc="data:image/svg+xml,%3csvg%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.75%204C7.75%202.20508%209.20508%200.75%2011%200.75H27C27.1212%200.75%2027.2375%200.798159%2027.3232%200.883885L38.1161%2011.6768C38.2018%2011.7625%2038.25%2011.8788%2038.25%2012V36C38.25%2037.7949%2036.7949%2039.25%2035%2039.25H11C9.20507%2039.25%207.75%2037.7949%207.75%2036V4Z'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3cpath%20d='M27%200.5V8C27%2010.2091%2028.7909%2012%2031%2012H38.5'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3crect%20x='1'%20y='18'%20width='28'%20height='16'%20rx='2'%20fill='%23198708'/%3e%3cpath%20d='M11.2726%2025.2734H9.71724C9.68883%2025.0722%209.63083%2024.8935%209.54324%2024.7372C9.45564%2024.5786%209.34319%2024.4437%209.20588%2024.3324C9.06857%2024.2211%208.90995%2024.1359%208.73002%2024.0767C8.55247%2024.0175%208.35952%2023.9879%208.15119%2023.9879C7.77477%2023.9879%207.44688%2024.0814%207.16752%2024.2685C6.88817%2024.4531%206.67155%2024.723%206.51767%2025.0781C6.36378%2025.4309%206.28684%2025.8594%206.28684%2026.3636C6.28684%2026.8821%206.36378%2027.3177%206.51767%2027.6705C6.67392%2028.0232%206.89172%2028.2895%207.17108%2028.4695C7.45043%2028.6494%207.77359%2028.7393%208.14054%2028.7393C8.3465%2028.7393%208.53708%2028.7121%208.71227%2028.6577C8.88983%2028.6032%209.04726%2028.5239%209.18457%2028.4197C9.32188%2028.3132%209.43552%2028.1842%209.52548%2028.0327C9.61781%2027.8812%209.68173%2027.7083%209.71724%2027.5142L11.2726%2027.5213C11.2324%2027.8551%2011.1318%2028.1771%2010.9708%2028.4872C10.8122%2028.795%2010.5979%2029.0708%2010.328%2029.3146C10.0605%2029.5561%209.74092%2029.7479%209.36923%2029.8899C8.99991%2030.0296%208.58206%2030.0994%208.11568%2030.0994C7.467%2030.0994%206.88699%2029.9527%206.37562%2029.6591C5.86663%2029.3655%205.46416%2028.9406%205.16824%2028.3842C4.87467%2027.8279%204.72789%2027.1544%204.72789%2026.3636C4.72789%2025.5705%204.87704%2024.8958%205.17534%2024.3395C5.47363%2023.7831%205.87846%2023.3594%206.38983%2023.0682C6.90119%2022.7746%207.47647%2022.6278%208.11568%2022.6278C8.53708%2022.6278%208.9277%2022.687%209.28755%2022.8054C9.64977%2022.9238%209.97056%2023.0966%2010.2499%2023.3239C10.5293%2023.5488%2010.7565%2023.8246%2010.9317%2024.1513C11.1093%2024.478%2011.2229%2024.852%2011.2726%2025.2734ZM16.3206%2024.8189C16.2922%2024.5324%2016.1702%2024.3099%2015.9548%2024.1513C15.7394%2023.9927%2015.447%2023.9134%2015.0777%2023.9134C14.8267%2023.9134%2014.6148%2023.9489%2014.442%2024.0199C14.2692%2024.0885%2014.1366%2024.1844%2014.0443%2024.3075C13.9543%2024.4306%2013.9094%2024.5703%2013.9094%2024.7266C13.9046%2024.8568%2013.9318%2024.9704%2013.991%2025.0675C14.0526%2025.1645%2014.1366%2025.2486%2014.2432%2025.3196C14.3497%2025.3883%2014.4728%2025.4486%2014.6125%2025.5007C14.7522%2025.5504%2014.9013%2025.593%2015.0599%2025.6286L15.7133%2025.7848C16.0306%2025.8558%2016.3218%2025.9505%2016.5869%2026.0689C16.8521%2026.1873%2017.0817%2026.3329%2017.2758%2026.5057C17.47%2026.6785%2017.6203%2026.8821%2017.7268%2027.1165C17.8357%2027.3509%2017.8914%2027.6196%2017.8937%2027.9226C17.8914%2028.3677%2017.7777%2028.7536%2017.5528%2029.0803C17.3303%2029.4046%2017.0083%2029.6567%2016.5869%2029.8366C16.1679%2030.0142%2015.6624%2030.103%2015.0706%2030.103C14.4835%2030.103%2013.9721%2030.013%2013.5365%2029.8331C13.1032%2029.6532%2012.7647%2029.3868%2012.5209%2029.0341C12.2794%2028.679%2012.1527%2028.2398%2012.1409%2027.7166H13.6288C13.6454%2027.9605%2013.7152%2028.1641%2013.8383%2028.3274C13.9638%2028.4884%2014.1307%2028.6103%2014.339%2028.6932C14.5497%2028.7737%2014.7877%2028.8139%2015.0528%2028.8139C15.3132%2028.8139%2015.5393%2028.776%2015.7311%2028.7003C15.9252%2028.6245%2016.0756%2028.5192%2016.1821%2028.3842C16.2886%2028.2493%2016.3419%2028.0942%2016.3419%2027.919C16.3419%2027.7557%2016.2934%2027.6184%2016.1963%2027.5071C16.1016%2027.3958%2015.9619%2027.3011%2015.7773%2027.223C15.595%2027.1449%2015.3712%2027.0739%2015.1061%2027.0099L14.3142%2026.8111C13.701%2026.6619%2013.2169%2026.4287%2012.8618%2026.1115C12.5067%2025.7943%2012.3303%2025.367%2012.3327%2024.8295C12.3303%2024.3892%2012.4475%2024.0045%2012.6842%2023.6754C12.9233%2023.3464%2013.2512%2023.0895%2013.6679%2022.9048C14.0845%2022.7202%2014.558%2022.6278%2015.0883%2022.6278C15.6281%2022.6278%2016.0992%2022.7202%2016.5017%2022.9048C16.9065%2023.0895%2017.2214%2023.3464%2017.4463%2023.6754C17.6712%2024.0045%2017.7872%2024.3857%2017.7943%2024.8189H16.3206ZM20.2419%2022.7273L21.9997%2028.2528H22.0672L23.8286%2022.7273H25.5331L23.026%2030H21.0445L18.5338%2022.7273H20.2419Z'%20fill='white'/%3e%3c/svg%3e",Zc="data:image/svg+xml,%3csvg%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.75%204C7.75%202.20508%209.20508%200.75%2011%200.75H27C27.1212%200.75%2027.2375%200.798159%2027.3232%200.883885L38.1161%2011.6768C38.2018%2011.7625%2038.25%2011.8788%2038.25%2012V36C38.25%2037.7949%2036.7949%2039.25%2035%2039.25H11C9.20507%2039.25%207.75%2037.7949%207.75%2036V4Z'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3cpath%20d='M27%200.5V8C27%2010.2091%2028.7909%2012%2031%2012H38.5'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3crect%20x='2'%20y='18.5'%20width='24'%20height='15'%20rx='2'%20fill='%23198708'/%3e%3cpath%20d='M7.14773%2022.9545L8.46768%2025.1854H8.51882L9.84517%2022.9545H11.408L9.41051%2026.2273L11.4528%2029.5H9.86115L8.51882%2027.266H8.46768L7.12536%2029.5H5.54013L7.58878%2026.2273L5.57848%2022.9545H7.14773ZM12.2837%2029.5V22.9545H13.6676V28.359H16.4737V29.5H12.2837ZM20.941%2024.837C20.9154%2024.5792%2020.8057%2024.3789%2020.6118%2024.2362C20.4179%2024.0934%2020.1547%2024.022%2019.8224%2024.022C19.5965%2024.022%2019.4058%2024.054%2019.2503%2024.1179C19.0947%2024.1797%2018.9754%2024.266%2018.8923%2024.3768C18.8113%2024.4876%2018.7709%2024.6133%2018.7709%2024.7539C18.7666%2024.8711%2018.7911%2024.9734%2018.8444%2025.0607C18.8998%2025.1481%2018.9754%2025.2237%2019.0713%2025.2876C19.1672%2025.3494%2019.278%2025.4038%2019.4037%2025.4506C19.5294%2025.4954%2019.6636%2025.5337%2019.8064%2025.5657L20.3944%2025.7063C20.68%2025.7702%2020.942%2025.8555%2021.1807%2025.962C21.4193%2026.0685%2021.626%2026.1996%2021.8007%2026.3551C21.9754%2026.5107%2022.1107%2026.6939%2022.2066%2026.9048C22.3046%2027.1158%2022.3547%2027.3576%2022.3568%2027.6303C22.3547%2028.0309%2022.2524%2028.3782%2022.05%2028.6722C21.8497%2028.9641%2021.5599%2029.1911%2021.1807%2029.353C20.8035%2029.5128%2020.3486%2029.5927%2019.816%2029.5927C19.2876%2029.5927%2018.8273%2029.5117%2018.4353%2029.3498C18.0454%2029.1879%2017.7407%2028.9482%2017.5212%2028.6307C17.3039%2028.3111%2017.1899%2027.9158%2017.1792%2027.445H18.5184C18.5333%2027.6644%2018.5961%2027.8477%2018.7069%2027.9947C18.8199%2028.1396%2018.9701%2028.2493%2019.1576%2028.3239C19.3472%2028.3963%2019.5613%2028.4325%2019.8%2028.4325C20.0344%2028.4325%2020.2378%2028.3984%2020.4104%2028.3303C20.5851%2028.2621%2020.7204%2028.1673%2020.8163%2028.0458C20.9122%2027.9244%2020.9601%2027.7848%2020.9601%2027.6271C20.9601%2027.4801%2020.9165%2027.3565%2020.8291%2027.2564C20.7439%2027.1562%2020.6182%2027.071%2020.452%2027.0007C20.2879%2026.9304%2020.0866%2026.8665%2019.8479%2026.8089L19.1352%2026.63C18.5834%2026.4957%2018.1476%2026.2859%2017.828%2026.0004C17.5084%2025.7148%2017.3497%2025.3303%2017.3518%2024.8466C17.3497%2024.4503%2017.4552%2024.104%2017.6682%2023.8079C17.8834%2023.5117%2018.1785%2023.2805%2018.5535%2023.1143C18.9285%2022.9482%2019.3547%2022.8651%2019.8319%2022.8651C20.3177%2022.8651%2020.7417%2022.9482%2021.104%2023.1143C21.4683%2023.2805%2021.7517%2023.5117%2021.9541%2023.8079C22.1565%2024.104%2022.2609%2024.4471%2022.2673%2024.837H20.941Z'%20fill='white'/%3e%3c/svg%3e",tb={name:"SkeletonLoader",props:{dataTestId:{type:String,default:""}}},nb=["data-test-id"];function ob(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("div",{class:"skeleton-loader","data-test-id":n.dataTestId},null,8,nb)}const So=ve(tb,[["render",ob],["__scopeId","data-v-17a86e07"]]),Jc={};function rb(t){let r=Jc[t];if(r)return r;r=Jc[t]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);r.push(o)}for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);r[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return r}function Yn(t,r){typeof r!="string"&&(r=Yn.defaultChars);const n=rb(r);return t.replace(/(%[a-f0-9]{2})+/gi,function(o){let a="";for(let i=0,l=o.length;i<l;i+=3){const s=parseInt(o.slice(i+1,i+3),16);if(s<128){a+=n[s];continue}if((s&224)===192&&i+3<l){const u=parseInt(o.slice(i+4,i+6),16);if((u&192)===128){const h=s<<6&1984|u&63;h<128?a+="��":a+=String.fromCharCode(h),i+=3;continue}}if((s&240)===224&&i+6<l){const u=parseInt(o.slice(i+4,i+6),16),h=parseInt(o.slice(i+7,i+9),16);if((u&192)===128&&(h&192)===128){const d=s<<12&61440|u<<6&4032|h&63;d<2048||d>=55296&&d<=57343?a+="���":a+=String.fromCharCode(d),i+=6;continue}}if((s&248)===240&&i+9<l){const u=parseInt(o.slice(i+4,i+6),16),h=parseInt(o.slice(i+7,i+9),16),d=parseInt(o.slice(i+10,i+12),16);if((u&192)===128&&(h&192)===128&&(d&192)===128){let m=s<<18&1835008|u<<12&258048|h<<6&4032|d&63;m<65536||m>1114111?a+="����":(m-=65536,a+=String.fromCharCode(55296+(m>>10),56320+(m&1023))),i+=9;continue}}a+="�"}return a})}Yn.defaultChars=";/?:@&=+$,#",Yn.componentChars="";const Yc={};function ab(t){let r=Yc[t];if(r)return r;r=Yc[t]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?r.push(o):r.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)r[t.charCodeAt(n)]=t[n];return r}function Bo(t,r,n){typeof r!="string"&&(n=r,r=Bo.defaultChars),typeof n>"u"&&(n=!0);const o=ab(r);let a="";for(let i=0,l=t.length;i<l;i++){const s=t.charCodeAt(i);if(n&&s===37&&i+2<l&&/^[0-9a-f]{2}$/i.test(t.slice(i+1,i+3))){a+=t.slice(i,i+3),i+=2;continue}if(s<128){a+=o[s];continue}if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&i+1<l){const u=t.charCodeAt(i+1);if(u>=56320&&u<=57343){a+=encodeURIComponent(t[i]+t[i+1]),i++;continue}}a+="%EF%BF%BD";continue}a+=encodeURIComponent(t[i])}return a}Bo.defaultChars=";/?:@&=+$,-_.!~*'()#",Bo.componentChars="-_.!~*'()";function Ai(t){let r="";return r+=t.protocol||"",r+=t.slashes?"//":"",r+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?r+="["+t.hostname+"]":r+=t.hostname||"",r+=t.port?":"+t.port:"",r+=t.pathname||"",r+=t.search||"",r+=t.hash||"",r}function Br(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const ib=/^([a-z0-9.+-]+:)/i,lb=/:[0-9]*$/,sb=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,cb=["<",">",'"',"`"," ","\r",`
145
+ `,ui={retrieveBlock:"/composables/retrieveComposableConfig",retrieveMeta:"/composables/retrieveComposableConfig",fetchAccessToken:"/int/auth",cart:{getQuoteProducts:"/transactions/getQuoteProducts",getGroupedQuoteProducts:"/transactions/getGroupedQuoteProducts"},catalog:{getProductItems:"/getCatalogProducts",saveItemToQuoteBlink:"/transactions/saveItemToQuoteBlink",updateLines:"/transactions/updateLines",deleteQuoteLine:"/quoting/deleteQuoteLine",getLineItems:"/quoting/getConfiguredLineItems"},promocode:{getPromoCodes:"/promotions/getPromoCodes",applyPromoCode:"/promotions/applyPromocode"},fetch:{getRecord:"/platform/getHeaderRecord"},update:{upsertRecords:"/platform/upsertRecords"},tax:{calculateAvaTax:"/transactions/calculateTax"},common:{getLineItemAttributes:"/product-pricing/getLineItemAttributes"}};async function Ct({action:t,data:r,config:n={}}){var y,f;const o=ft(),a=n.accessToken??o.accessToken.value,i=n.salesforceOrgId??o.organizationId.value,l=n.userId??o.userId.value,s=n.orgType??o.composablesOrgType.value,u=n.baseUrl??o.composablesApiUrl.value,h=ui[n.pathKey]??ui[n.pathKey.split(".")[0]][n.pathKey.split(".")[1]];if(!h)throw new Error(`Invalid pathKey: ${n.pathKey}. Available keys: ${Object.keys(ui).join(", ")}`);const d=`${u}${h}`;if(!i&&n.pathKey!=="fetchAccessToken")throw new Error("salesforceOrgId is required. Provide it in config or set it via useComposableStore.updateConfig()");let m;t?m={action:t,data:r}:m=r;const c={"Content-Type":"application/json"};if(a&&(c.Authorization=`Bearer ${a}`),i&&(c["X-Salesforce-Org-Id"]=i),s&&(c["X-Salesforce-Org-Type"]=s),l&&(c["X-Salesforce-User-Id"]=l),!d)throw new Error("composablesApiUrl is required. Provide it in props or set it via useComposableStore.updateConfig()");try{console.log(`[COMPOSABLES_API:${t||"no-action"}] request`,JSON.stringify(m)),console.log(`[COMPOSABLES_API:${t||"no-action"}] headers`,c);const b=await Ue.post(d,m,{headers:c});if(console.log(`[COMPOSABLES_API:${t||"no-action"}] response`,b.data),!t&&((y=b.data)!=null&&y.data)&&typeof b.data.data=="string")try{b.data=JSON.parse(b.data.data)}catch(p){console.warn("[COMPOSABLES_API] Failed to parse data field:",p)}else if(!t&&((f=b.data)!=null&&f.data)&&typeof b.data.data=="object")try{b.data=b.data.data}catch(p){console.warn("[COMPOSABLES_API] Failed to parse content field:",p)}return b.data}catch(b){throw console.error(`[COMPOSABLES_API:${t||"no-action"}] error:`,b),b}}const Qn="https://d2pgvmpph8dmlo.cloudfront.net";function hc(t,r,n){return t?t==null?void 0:t.map(o=>d4(o,r,n)):[]}function d4(t,r,n){const{url:o,staticResource:a}=t;if(!o)return null;if(o.includes("/resource/")&&!o.includes("://")&&a){const i=o.split("/"),l=i[i.length-1];return`${Qn}/${n}/static/${l}.${r}`}else return o}const Co=it.defineStore("blockLegacy",()=>{const t=ft(),r=e.ref(null),n=e.ref(null),o=e.ref(!1),a=e.ref(null);async function i(d,m=!0){var f,b;if(console.info("fetchBlockInformation templateId:",d.templateId),!d.templateId)return;m&&(r.value=[],o.value=!1);const c={storefrontId:d.storefrontId,templateId:d.templateId};console.log("fetchBlockInformation variables",JSON.stringify(c)),console.log("fetchBlockInformation getTemplateBlock",dc);const y=await br(dc,c);if(console.log("fetchBlockInformation getTemplateBlockResponse",y),console.log("fetchBlockInformation pageBlocks",r.value),n.value=d.templateId,m)(f=y.content)!=null&&f.blocks?(r.value=l(JSON.parse(y.content.blocks)),console.log("fetchBlockInformation pageBlocks 1",r.value)):r.value=[],o.value=!0;else return((b=y==null?void 0:y.content)==null?void 0:b.blocks)||[]}function l(d){const m=t.organizationId.value;return d==null||d.forEach(c=>{c.blocks=c.blocks?JSON.parse(c.blocks):[],c.blocks.forEach(y=>{var f,b;Object.assign(y,JSON.parse(y.contentJSON)),y.contentJSON=null,y.id=y.blockId||y.Id,(y.componentName==="catalogBlock"||y.componentName==="relatedProducts")&&(s(y.fields.productCard.actions),y.fields.noFriendlyURL=!0,y.fields.productCard.friendlyURL=null,y.fields.productCard.friendlyURLFields=null,(f=y.configuration)!=null&&f.productTemplateId?y.fields.productCard.url="/product/"+((b=y.configuration)==null?void 0:b.productTemplateId):y.fields.productCard.url=null),y.componentName==="productSummary"&&(console.log("block.fields.actions",y.fields.actions),s(y.fields.actions)),y.customJS&&(y.customJS=hc(y.customJS,"js",m)),y.customCSS&&(y.customCSS=hc(y.customCSS,"css",m))})}),d}function s(d){d.forEach(m=>{m.action==="CUSTOM_ACTION"&&(m.action="CUSTOM",m.name=m.label.title,m.value=m.url.field||m.url.title,m.newTab=m.openInNewTab)})}async function u(d,m=!0){var c,y,f;if(console.info("fetchBlockInformationREST templateId:",d.templateId),!!d.templateId){m&&(r.value=[],o.value=!1);try{const b=await Ct({action:"retrieveBlock",data:{salesforceOrgId:t.organizationId.value,storefrontId:d.templateId,templateId:"wrapperDefault"},config:{pathKey:"retrieveBlock"}});n.value=d.templateId;const p=((y=(c=b==null?void 0:b.data)==null?void 0:c[0])==null?void 0:y.blocks)??((f=b==null?void 0:b.data)==null?void 0:f.blocks);if(console.log("fetchBlockInformationREST blocksData",p),m){if(p){const x=typeof p=="string"?JSON.parse(p):p;console.log("fetchBlockInformationREST parsedBlocks",x),r.value=l(x),console.log("fetchBlockInformationREST pageBlocks",r.value)}else console.log("fetchBlockInformationREST blocksData is null"),r.value=[];o.value=!0}else return p||[]}catch(b){throw console.error("fetchBlockInformationREST error:",b),m&&(r.value=[],o.value=!0),b}}}return{metaInfo:a,currentPageId:n,pageBlocks:r,blockLoaded:o,fetchBlockInformation:i,fetchBlockInformationREST:u,getFormattedSectionBlocks:d=>e.computed(()=>{const m=[];return r.value&&r.value.length>0&&r.value.forEach(c=>{const y=c.blocks;y&&y.length>0&&y.forEach(f=>{if(f.id=f.blockId,d){const b=["checkoutAccount","shippingAddress","shippingMethod","customForm","termsAndPayment","quoteSummary","customCode"];console.log("section.sectionName",c.sectionName,f.componentName),f&&f.configuration&&(b.includes(f.componentName)||f.configuration.isCheckoutBlock)&&m.push(f)}else f&&f.configuration&&!d&&m.push(f)})}),m})}}),qn=async(t,r=null,n="",o=!1)=>{const a=ft();console.log("appsyncHandler composableStore",a);const i=a.graphqlEndpoint.value,l=a.apiKey.value;let s=200,u;const h=a.hostName.value;console.log("appsyncHandler currentHostname",h);const d=fi();try{const m=r;let c="";d.activeStorefrontInfo&&d.activeStorefrontInfo.accountId&&!c&&(c=d.activeStorefrontInfo.accountId),m.data&&d.activeStorefrontInfo&&!t.includes("CognitoActions")&&!t.includes("query listUsers")&&(m.data.userType=d.activeStorefrontInfo.userType,m.data.accountId=c,m.data.domain=h);const y=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":l},body:JSON.stringify({query:t,variables:m})});if(u=await(y==null?void 0:y.json()),u=u.data,n)u=JSON.parse(u[n]),s=Number(u.statusCode),u=u.content,s===401&&console.info("401",t,JSON.stringify(r));else if(t.includes("SalesforceActions")){let f=u;f=JSON.parse(u.salesforceActions),f.statusCode==="401"&&console.info("401",t,JSON.stringify(r),u)}}catch(m){console.log(m),s=400,u=m}return{statusCode:s,response:u}},di=["Needs Configuration","Suggests Configuration","Upload Configuration"],f4=["Upload","Upload Add","Upload Configuration"],h4=["No Configuration","Suggests Configuration","Upload Add","",null,void 0],p4=["CONFIGURE","UPLOAD","ADD_TO_CART"],m4=new Map([["Full","Full"],["FULL","Full"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","Default"],["ECATALOG_ACCOUNT_CUSTOM","Alternate"],["ECATALOG_OVERRIDE","Override"]]),y4=new Map([["Full","Item"],["FULL","Item"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","eCatalog"],["ECATALOG_ACCOUNT_CUSTOM","eCatalog"],["ECATALOG_OVERRIDE","eCatalog"]]),Eo=(t,r,n=!1)=>{const o=Mt();let a,i,l;return n?(i=t.statusCode,l=t.content):(a=JSON.parse(t.response.salesforceActions),i=a.statusCode,l=a.content),Number(i)===200&&l&&l.message&&typeof l.message=="string"&&l.message.startsWith("ERROR:")?(o.handleError(l.message,"useExtractContent"),!1):Number(i)!==200||t.statusCode!==200||typeof l=="string"&&l.includes("ERROR:")||typeof l=="string"&&l.includes("Error:")||l.errorCode==="APEX_ERROR"?(l.errorCode==="APEX_ERROR"?o.handleError(l.message,"useExtractContent"):r||o.handleError(l,"useExtractContent"),!1):l},Zn=new Map;function Lt(t,r){return Zn.has(t)||Zn.set(t,new Set),Zn.get(t).add(r),()=>{g4(t,r)}}function g4(t,r){const n=Zn.get(t);n&&(n.delete(r),n.size===0&&Zn.delete(t))}function Et(t,r){const n=Zn.get(t);!n||n.size===0||Array.from(n).forEach(o=>{try{o(r)}catch{}})}const mn=it.defineStore("catalog",()=>{const t=ft(),r=e.ref(!1),n=e.ref(0),o=e.ref(null),a=e.ref(null),i=e.ref([]),l=e.ref({}),s=e.ref({}),u=e.ref(null),h=e.ref(null),d=e.ref(!1),m=e.ref({search:""}),c=e.ref({qliRecords:!0,quoteCreate:!1,quoteDetails:!1}),y=e.computed(()=>t.accountId.value),f=e.computed(()=>({domain:t.hostName.value,accountId:y.value,userType:t.userId.value})),b=e.computed(()=>{const $=Array.isArray(i.value)?i.value:[],X={"Needs Configuration":1,"Suggests Configuration":2,"Fully Configured":3},W=N=>(N==null?void 0:N.XX_ORD1__SYS_Configuration_Status2__c)||(N==null?void 0:N.xx_ord1__sys_configuration_status2__c)||"",K=N=>N in X,P=$.filter(N=>K(W(N)));return P.sort((N,T)=>{const O=W(N),F=W(T);return(X[O]||99)-(X[F]||99)}),P});function p(){const $=b.value||[];return $.length?$[0]:null}function x($="true"){j0(`qreset-${o.value}`,$)}async function g($){try{const X={objectType:"XX_ORD1__Quote_Line_Item__c",qliIds:Array.isArray($)?$:[$]},W=await Ct({data:X,config:{pathKey:"catalog.deleteQuoteLine"}});return n.value=Math.max(0,(n.value||0)-1),v(!0),console.log("[CATALOG:deleteLineItems] success",W),x(),Et("catalog:line-deleted",{quoteId:(t==null?void 0:t.quoteId.value)||null,qliIds:X.qliIds,response:W}),W}catch(X){console.log("[CATALOG:deleteLineItems] error",X),x();return}}async function C($){var O,F;if(!$.qty)return;const X=t.quoteId.value;if(!X)return;$.retry=1;const W={...$,quoteid:X},K={action:"makeCall",data:{...f.value,callType:"POST",endpoint:"/services/apexrest/XX_ORD1/ecommerce?type=updateQLI&ut="+t.userId.value,payload:JSON.stringify(W)}},P=await qn(wn,K,void 0,!0),N=(F=(O=P.response)==null?void 0:O.salesforceActions)==null?void 0:F.toLowerCase();(N.includes("record currently unavailable")||N.includes("unable_to_lock_row"))&&$.retry<3&&setTimeout(()=>{$.retry+=1,C($)},500),Eo(P)&&v(!0),x()}async function _($){var K,P,N,T,O;const X=t==null?void 0:t.quoteId.value;Array.isArray($)&&($=$[0]);const W={itemId:$.itemID,eCatalogItemId:$.eCatalogItemID,quantity:$.qty,accountId:y.value,qtyTierAmt:($==null?void 0:$.qtyTierAmt)??null};X&&(W.quoteId=X);try{const F=await Ct({data:W,config:{pathKey:"catalog.saveItemToQuoteBlink"}}),q=(F==null?void 0:F.quoteId)||((K=F==null?void 0:F.data)==null?void 0:K.quoteId)||((N=(P=F==null?void 0:F.data)==null?void 0:P.quote)==null?void 0:N.Id);q&&q!==X&&(o.value=q,t.updateConfig({quoteId:q}));const M=((T=F==null?void 0:F.data)==null?void 0:T.QliId)||(F==null?void 0:F.QliId)||null,U=$==null?void 0:$.itemID,L=$==null?void 0:$.qty;if(M&&U){const j=s.value?s.value[U]:null;s.value={...s.value||{},[U]:{...j||{},Id:M,XX_ORD1__Item__c:U,XX_ORD1__QTY__c:typeof L=="number"?L:(j==null?void 0:j.XX_ORD1__QTY__c)||0}}}return v(!0),x(),Et("catalog:item-added",{itemId:W.itemId,eCatalogItemId:W.eCatalogItemId||null,quantity:W.quantity,quoteId:(t==null?void 0:t.quoteId.value)||q||null,qliId:((O=F==null?void 0:F.data)==null?void 0:O.QliId)||(F==null?void 0:F.QliId)||null,response:F}),F}catch(F){console.log("[CATALOG:saveItemToQuoteBlinkTxn] error",F),x();return}}async function E({itemId:$,qty:X,qliId:W,eCatalogItemId:K}={}){var T,O,F,q,M;if(console.log("updateQuoteLineQtyTxn",{itemId:$,qty:X,qliId:W,eCatalogItemId:K}),!X&&X!==0)return;let P=W||((O=(T=s.value)==null?void 0:T[$])==null?void 0:O.Id);if(P||(await S(!0),P=W||((q=(F=s.value)==null?void 0:F[$])==null?void 0:q.Id)),!P){if(X>0&&$&&K)return console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id, saving item first",{itemId:$,eCatalogItemId:K}),await _({itemID:$,eCatalogItemID:K,qty:X,qtyTierAmt:null});console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id for item",{itemId:$});return}const N={uniqueField:"",objectType:"XX_ORD1__Quote_Line_Item__c",records:[{fields:[{fieldName:"Id",fieldValue:P},{fieldName:"XX_ORD1__QTY__c",fieldValue:X}]}]};try{const U=await Ct({data:N,config:{pathKey:"catalog.updateLines"}});if($){const L=((M=s.value)==null?void 0:M[$])||{};s.value={...s.value||{},[$]:{...L,Id:P,XX_ORD1__Item__c:$,XX_ORD1__QTY__c:X}}}return v(!0),x(),Et("catalog:item-qty-updated",{itemId:$,qliId:P,quantity:X,eCatalogItemId:K||null,quoteId:(t==null?void 0:t.quoteId.value)||null,response:U}),U}catch(U){console.log("[CATALOG:updateQuoteLineQtyTxn] error",U),x();return}}async function A($,X,W){var F;const K=W==="Item",P=[],N=(($==null?void 0:$.searchText)||"").toString().trim(),T=Array.isArray($==null?void 0:$.fields)?$.fields:[];Array.isArray($==null?void 0:$.filters)&&$.filters,$==null||$.filterLogic;const O={searchPL:N,origin:"genesis_ai",userId:(t==null?void 0:t.userId.value)||"",orgId:(t==null?void 0:t.organizationId.value)||"",orgType:"Production",requestId:vn(),quoteId:(t==null?void 0:t.quoteId.value)||"",accountId:(t==null?void 0:t.accountId.value)||"",numberOfRecords:($==null?void 0:$.numberOfRecords)||($==null?void 0:$.rowLimit)||10,fields:T,filters:($==null?void 0:$.whereCondition)||[]};try{const q=await Ct({data:O,config:{pathKey:"catalog.getProductItems"}});if(!q||!q.selected_products||typeof q.selected_products!="object")return console.warn("[CATALOG:getProductItems] Invalid response structure",{responseObj:q}),{items:[],count:0};const M=q.selected_products,U=Object.values(M).map(j=>{var H;return(H=j==null?void 0:j.catalogResponse)==null?void 0:H.productInfo}).filter(Boolean);U.forEach(j=>{var ne,Q,ce,ue;const H=JSON.parse(JSON.stringify(X)),Z=We(j,K?"XX_ORD1__Friendly_URL__c":"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),te=We(j,K?"XX_ORD1__SYS_Requires_Configuration__c":"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c");K?H.itemId=j.Id:(H.itemId=j.XX_ORD1__Item__c,H.catalogItemId=j.Id),H.thumbnail.value=H.thumbnail.field&&!H.thumbnail.isStatic?We(j,H.thumbnail.field):"",H.title.value=H.title.field&&!H.title.isStatic?We(j,H.title.field):"",H.description.value=H.description.field&&!H.description.isStatic?We(j,H.description.field):"",(ne=H.attributes)==null||ne.forEach(pe=>{pe.value.field&&(pe.value.value=We(j,pe.value.field,pe.value.dataType)||"-"),pe.label.field&&(pe.label.value=We(j,pe.label.field,pe.label.dataType)||"-")}),H.requiresConfiguration=te,H.actions=H.actions.filter(({action:pe})=>pe==="ADD_TO_CART"&&h4.includes(te)||pe==="CONFIGURE"&&di.includes(te)||pe==="UPLOAD"&&f4.includes(te)||!p4.includes(pe)),(Q=H.actions)==null||Q.forEach(pe=>{if(pe.action==="CUSTOM"){const{url:ie,label:de}=pe;ie.isStatic||(ie.value=We(j,ie.field)),de.isStatic||(de.value=We(j,de.field))}}),((ce=H.friendlyURLFields)==null?void 0:ce.length)>0&&Z?((ue=H.friendlyURLFields)==null||ue.forEach(pe=>{H.friendlyURL=H.friendlyURL.replace(`{!${pe}}`,We(j,pe))}),H.friendlyURL="/"+H.friendlyURL+"/"+Z):H.url&&(H.friendlyURL=H.url+"/"+j.Id),H.friendlyURL&&(H.friendlyURL=H.friendlyURL.replace(/\/{2,}/g,"/")),P.push(H)});const L=Number(((F=q==null?void 0:q.data)==null?void 0:F.totalCount)||U.length)||0;return{items:P,count:L>2e3?2e3:L}}catch(q){console.log("[CATALOG:getProductItems] new API error",q);return}}async function k($){var P;console.log("[CATALOG:getEcatalogDetails] jsonData",$),$.accountID=t.accountId.value;const X={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getEcatalogDetails&ut=${t.userId.value}`,payload:JSON.stringify($)}},W=await qn(wn,X),K=Eo(W);if(K!==!1)return(P=JSON.parse(K))==null?void 0:P.recordData}async function B($,X=()=>{}){$.accountID=t.accountId.value||"";const W={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogGroupCounts&ut=${t.userId.value}`,payload:JSON.stringify($)}},K=await qn(wn,W,void 0,!0),P=JSON.parse(JSON.parse(K.response.salesforceActions).content);return X(P),P}async function D($,X=()=>{}){const W={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogPicklistGroupCounts&ut=${t.userId.value}`,payload:JSON.stringify($)}},K=await qn(wn,W,void 0,!0);return X(JSON.parse(JSON.parse(K.response.salesforceActions).content)),JSON.parse(JSON.parse(K.response.salesforceActions).content)}async function w(){var P,N,T,O,F,q;console.log("[CATALOG:getObjectDetails] start",{currentQuoteId:o.value,payload:f.value});const $=t.quoteId.value;if(console.log("[CATALOG:getObjectDetails] qtId",$),$)console.log("[CATALOG:getObjectDetails] Quote found!"+$),console.log("[CATALOG:getObjectDetails] Quote found",$);else{console.log("[CATALOG:getObjectDetails] No quote found!"),console.warn("[CATALOG:getObjectDetails] No quote found, aborting");return}const X={action:"makeCall",data:{...f.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getFormattedObjectDetails&objectapi=XX_ORD1__Quote__c&objectid=${$}`}};console.log("[CATALOG:getObjectDetails] request",X.data.endpoint),c.quoteDetails=!0,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> true");const W=await qn(wn,X,void 0,!0);console.log("[CATALOG:getObjectDetails] response received",{hasResponse:!!(W!=null&&W.response),len:String(((P=W==null?void 0:W.response)==null?void 0:P.salesforceActions)||"").length});const K=Eo(W,!0);return console.log("[CATALOG:getObjectDetails] extracted content",{hasContent:!!K}),c.quoteDetails=!1,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> false"),K?(l.value=JSON.parse(K),console.log("[CATALOG:getObjectDetails] quoteRecord set",{id:(N=l.value)==null?void 0:N.Id,accountName:(T=l.value)==null?void 0:T.XX_ORD1__Account_Name__c,checkedOut:(O=l.value)==null?void 0:O.XX_ORD1__Checked_Out__c}),t.quoteAccount=(F=l.value)==null?void 0:F.XX_ORD1__Account_Name__c,l.value.XX_ORD1__Checked_Out__c?(console.warn("[CATALOG:getObjectDetails] Quote is already checked out, resetting quoteId"),r.value=!0,console.log("[CATALOG:getObjectDetails] end (checked out) -> false"),!1):(console.log("[CATALOG:getObjectDetails] end (success)",{id:(q=l.value)==null?void 0:q.Id}),l.value)):(console.warn("[CATALOG:getObjectDetails] no content returned, resetting quoteId",{qtId:$}),console.log("[CATALOG:getObjectDetails] end (no content) -> false"),!1)}const v=St(S,500);async function S($=!1){var K;console.log("[CATALOG:getQuoteItems] start",{noLoad:$}),c.value.qliRecords=!$;const X=t.quoteId.value;if(console.log("[CATALOG:getQuoteItems] qtId",X),!X){console.log("[CATALOG:getQuoteItems] No quote found!"),c.value.qliRecords=!1,console.warn("[CATALOG:getQuoteItems] No quote found, aborting");return}const W={objectId:X};try{const P=await Ct({data:JSON.stringify(W),config:{pathKey:"catalog.getLineItems"}}),N=((K=P==null?void 0:P.data)==null?void 0:K.products)||(P==null?void 0:P.products)||[],T=[],O={};N.forEach(F=>{const q=F==null?void 0:F.productLineItem;q&&(T.push(q),q.XX_ORD1__Item__c&&(O[q.XX_ORD1__Item__c]=q)),(Array.isArray(F==null?void 0:F.options)?F.options:[]).forEach(U=>{T.push(U),U.XX_ORD1__Item__c&&(O[U.XX_ORD1__Item__c]=U)})}),i.value=T,s.value=O,n.value=T.length,c.value.qliRecords=!1,console.log("[CATALOG:getQuoteItems] end (success)",{count:T.length}),Et("catalog:items-fetched",{quoteId:X,items:i.value,count:n.value})}catch(P){console.warn("[CATALOG:getQuoteItems] error",P),c.value.qliRecords=!1}}async function I($){console.log("[CATALOG:getSavedFilter] ecfr",$);const X={action:"makeCall",data:{...f.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getSavedFilter&ut=${t.userId.value}&ecfr=${$}`}},W=await qn(wn,X,void 0,!0),K=Eo(W);return K?(console.log("[CATALOG:getSavedFilter] Saved Filters",K),JSON.parse(K)):!1}async function R(){var K;console.log("[CATALOG:calculateAvaTax]"),h.value=null;const $=t.quoteId.value;if(!$)return;(K=l.value)!=null&&K.Id||await w();const X=l.value;if(X.XX_ORD1__Shipping_Address__c&&X.XX_ORD1__Shipping_City__c&&X.XX_ORD1__Shipping_Country__c&&X.XX_ORD1__Shipping_State__c&&X.XX_ORD1__Shipping_Zip__c){const P={recordId:$,isCommit:!1},N={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=calculateAvaTax&ut=${t.userId.value}`,payload:JSON.stringify(P)}};d.value=!0;const T=await qn(wn,N,void 0,!0),O=Eo(T);if(O)console.log("[CATALOG:calculateAvaTax] content",O);else{const F=JSON.parse(T.response.salesforceActions).content;h.value=F}d.value=!1}else console.log("[CATALOG:calculateAvaTax] Shipping address not found so tax can not be calculated")}function z($,X,W=!0){const K=X.qtyTiers;if(!K)return null;const P=K.find(N=>N.ev===null?$>=N.sv:$>=N.sv&&$<=N.ev);return P?W?P.formattedOfferPrice:P.originalPrice:null}return{quoteCheckedOut:r,avaTaxError:h,avaTaxLoading:d,cartCount:n,cartUpdated:x,quoteId:o,loading:c,filter:m,quoteRecord:l,secondQuoteId:a,qliRecords:i,savedItems:s,savedFilter:u,getObjectDetails:w,getSavedFilter:I,saveItemToQuoteBlinkTxn:_,updateQuoteLineQtyTxn:E,deleteLineItems:g,getPicklistFilterData:D,getQuoteItems:S,updateCart:C,getFilterData:B,getProductItems:A,calculateAvaTax:R,getEcatalogDetails:k,getVolumePrice:z,configurableItemsSorted:b,getTopConfigurableItem:p,getQuoteItems:S}}),fi=it.defineStore("composableCatalog",()=>{const t=Co();mn();const r=Mt(),n=ft(),o=e.ref(!0),a=e.ref({accountId:"",contactId:"",userType:"",domain:"",locale:"en-US"}),i=e.ref({}),l=e.ref(""),s=e.ref(""),u=e.ref(""),h=e.ref(""),d=e.ref(""),m=e.ref(""),c=e.ref(null),y=e.ref(!1),f=e.computed(()=>h.value+"::"+d.value);async function b(){c.value=null,y.value=!0;try{const B={domain:n.hostName.value,templateBlocksFilter:{templateId:{eq:"wrapperDefault"}}},D=Date.now().toString(),w=await Ue.post(`${n.graphqlEndpoint.value}?t=${D}`,{query:u4,variables:B},{headers:{"Content-Type":"application/json","x-api-key":n.apiKey.value,"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0","X-Cache-Bust":D},withCredentials:!1});console.log("[COMPOSABLECATALOG:fetchDomainDetails] response",w);const v=w&&w.data?w.data:null;console.log("[COMPOSABLECATALOG:fetchDomainDetails] payload",v);const S=v&&v.data&&v.data.dataByDomain&&Array.isArray(v.data.dataByDomain.items)?v.data.dataByDomain.items:[],I=S.length?S[0]:null;return console.log("[COMPOSABLECATALOG:fetchDomainDetails] item",I),console.log("[COMPOSABLECATALOG:fetchDomainDetails] storefrontDetails",i.value),i.value=I,a.value={accountId:I.guestAccountId,contactId:"",userType:"AWSGuest",domain:I.domain,locale:"en-US"},h.value=I.organization.salesforceOrgId,d.value=I.storefrontId,I}catch(B){throw console.info("[COMPOSABLECATALOG:fetchDomainDetails] Error fetching domain",B),c.value=B&&B.message?B.message:"Unknown error",B}finally{y.value=!1}}function p(B){s.value=(B==null?void 0:B.templateId)??"",u.value=(B==null?void 0:B.quoteId)??"",m.value=(B==null?void 0:B.userId)??""}function x(B){u.value=B}function g(B){i.value=B}async function C(){try{await t.fetchBlockInformation({templateId:s.value,storefrontId:d.value},!0)}catch(B){r.handleError(B,"getBlockInformation")}}const _=async()=>{var B,D;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!d.value)try{const w=await br(fc,{storefrontId:d.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",w),((D=(B=w.content)==null?void 0:B.items)==null?void 0:D[0])??null}catch(w){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",w)}},E=()=>{if(typeof document>"u")return;const B=h.value,D=d.value;if(!B||!D)return;const w=`${Qn}/${B}/${D}/css/theme_${D}.css`;let v=!1;if(typeof window<"u"&&window.VueExpediteComponents&&typeof window.VueExpediteComponents.applyThemeToShadows=="function")try{window.VueExpediteComponents.applyThemeToShadows(w),v=!0}catch($){console.warn("[COMPOSABLECATALOG:setThemeData] shadow injection failed; will inject in head",$)}let S="";try{S=new URL(n.graphqlEndpoint.value).origin}catch{}const I=typeof window<"u"?window.location.href:"",R=($,X={})=>{const W=document.head||document.getElementsByTagName("head")[0];if(!W)return;let K=document.getElementById($);K||(K=document.createElement("link"),K.id=$,W.appendChild(K)),Object.entries(X).forEach(([P,N])=>{N!=null&&K.setAttribute(P,String(N))})};(($,X,W=!0)=>{const K=document.head||document.getElementsByTagName("head")[0];if(!K||document.getElementById($))return;const P=document.createElement("script");P.id=$,P.src=X,W&&(P.async=!0),K.appendChild(P)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),R("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),S&&R("ec-preconnect-appsync",{rel:"preconnect",href:S}),v||R("ec-theme-stylesheet",{rel:"stylesheet",href:w}),R("ec-google-fonts",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Symbols+Outlined|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Montserrat:300,400,500,600,700,800|Roboto:300,400,500,600,700,800|Abel|Caveat:400,700|Titillium+Web:400,600,700"}),I&&R("ec-canonical",{rel:"canonical",href:I}),R("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${Qn}/expedite/Expedite_Favicon.ico`})};function A(){return!0}function k(){s.value="",u.value="",h.value="",d.value="",m.value=""}return{templateId:s,isLoading:o,activeStorefrontInfo:a,quoteAccount:l,storefrontDetails:i,salesforceOrgId:h,storefrontId:d,userId:m,orgWithStorefrontId:f,useVisiblity:A,fetchDomainDetails:b,setData:p,setQuoteId:x,setStorefrontDetails:g,getBlockInformation:C,getTheme:_,setThemeData:E,reset:k}}),b4=t=>{const r=t.match(/query\s+(\w+)/);return r?r[1]:null},x4=t=>t.replace(/[-_\s]+/g," ").trim().replace(/^(.)/,(r,n)=>n.toLowerCase()).replace(/\s(\w)/g,(r,n)=>n.toUpperCase()).replace(/\s/g,""),pc=t=>{try{JSON.parse(t)}catch{return!1}return!0},hi=new Map,br=async(t,r=null)=>{var s,u,h;const n=fi(),o=ft();let a=200,i,l;try{const d=r,m=o.accountId.value||"";d.data&&n.activeStorefrontInfo&&!t.includes("CognitoActions")&&!t.includes("GetLoginInfo")&&!t.includes("query listUsers")&&!t.includes("UserActivityLog")&&(d.data.userType=((s=n.activeStorefrontInfo)==null?void 0:s.userType)||"",d.data.accountId=m||((u=n.activeStorefrontInfo)==null?void 0:u.accountId)||"",d.data.domain=o.hostName.value),!t.includes("GetLoginInfo")&&!t.includes("CognitoActions")&&!t.includes("query listUsers")&&!t.includes("UserActivityLog")&&(d.data={...d.data,domain:o.hostName.value});const c=c4([t,d,m]);if(hi.has(c))i=hi.get(c);else try{const b=await Ue.post(o.graphqlEndpoint.value,{query:t,variables:d},{headers:{"Content-Type":"application/json","x-api-key":o.apiKey.value}});if(!b.data)return{statusCode:500,content:"Error fetching data from AppSync."};i=b.data.data,hi.set(c,i)}catch(b){const p=((h=b==null?void 0:b.response)==null?void 0:h.status)||500;return p===401&&console.info("401",t,r),{statusCode:p,content:"Error fetching data from AppSync."}}const y=b4(t);if(!y)return{statusCode:404,content:"Query name not found, improper request."};const f=x4(y);i=i[f],pc(i)&&(i=JSON.parse(i)),i&&i.statusCode&&i.statusCode===401&&console.info("401",t,r),l=i!=null&&i.content?i.content:i,pc(l)&&(l=JSON.parse(l))}catch(d){a=400,l=d}return{statusCode:a,content:l}},xr=e.ref(""),mc=e.ref(""),pi=e.ref(""),yc=e.ref(""),mi=e.ref(""),ko=e.ref(""),vo=e.ref(""),gc=e.ref(""),bc=e.ref(""),xc=e.ref(""),_c=e.ref(""),yi=e.ref(""),Cc=e.ref(""),_4=e.ref(!1),C4=e.ref(null),E4=e.ref(null),Ec=e.ref(""),kc=e.ref(""),vc=e.ref(""),Ac=e.ref(""),wc=e.ref("");function ft(){function t(s){s.templateId!==void 0&&(xr.value=s.templateId),s.hostName!==void 0&&(mc.value=s.hostName),s.graphqlEndpoint!==void 0&&(pi.value=s.graphqlEndpoint),s.apiKey!==void 0&&(yc.value=s.apiKey),s.accountId!==void 0&&(mi.value=s.accountId),s.organizationId!==void 0&&(ko.value=s.organizationId),s.storefrontId!==void 0&&(vo.value=s.storefrontId),s.cid!==void 0&&(gc.value=s.cid),s.userId!==void 0&&(bc.value=s.userId),s.composablesApiUrl!==void 0&&(xc.value=s.composablesApiUrl),s.composablesApiKey!==void 0&&(_c.value=s.composablesApiKey),s.accessToken!==void 0&&(yi.value=s.accessToken),s.composablesOrgType!==void 0&&(Cc.value=s.composablesOrgType),s.isPreview!==void 0&&(_4.value=s.isPreview),s.sections!==void 0&&(C4.value=s.sections),s.theme!==void 0&&(E4.value=s.theme),s.quoteId!==void 0&&(Ec.value=s.quoteId),s.websocketUrl!==void 0&&(kc.value=s.websocketUrl),s.packageVersion!==void 0&&(vc.value=s.packageVersion),s.eCatalogId!==void 0&&(Ac.value=s.eCatalogId),s.accountId!==void 0&&(mi.value=s.accountId),s.siteUrl!==void 0&&(wc.value=s.siteUrl)}const r=async()=>{var s,u;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!vo.value)try{const h=await br(fc,{storefrontId:vo.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",h),((u=(s=h.content)==null?void 0:s.items)==null?void 0:u[0])??null}catch(h){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",h)}},n=async()=>{var s,u,h;try{const d=await Ct({action:"retrieveMeta",data:{salesforceOrgId:ko.value,storefrontId:xr.value,templateId:"wrapper",key:"theme"},config:{pathKey:"retrieveMeta"}}),m=((u=(s=d==null?void 0:d.data)==null?void 0:s[0])==null?void 0:u.value)??((h=d==null?void 0:d.data)==null?void 0:h.value);return console.log("[COMPOSABLECATALOG:fetchThemeREST] themeData",m),m??null}catch(d){throw console.log("[COMPOSABLECATALOG:fetchThemeREST] Error getting theme data",d),d}};return{hostName:mc,graphqlEndpoint:pi,apiKey:yc,accountId:mi,organizationId:ko,storefrontId:vo,cid:gc,userId:bc,composablesApiUrl:xc,composablesApiKey:_c,accessToken:yi,composablesOrgType:Cc,quoteId:Ec,websocketUrl:kc,packageVersion:vc,eCatalogId:Ac,siteUrl:wc,updateConfig:t,getTheme:r,fetchThemeREST:n,setThemeData:()=>{if(typeof document>"u")return;const s=ko.value,u=vo.value;if(!s||!u)return;const h=`${Qn}/${s}/${u}/css/theme_${u}.css`;let d="";try{d=new URL(pi.value).origin}catch{}const m=typeof window<"u"?window.location.href:"",c=(f,b={})=>{const p=document.head||document.getElementsByTagName("head")[0];if(!p)return;let x=document.getElementById(f);x||(x=document.createElement("link"),x.id=f,p.appendChild(x)),Object.entries(b).forEach(([g,C])=>{C!=null&&x.setAttribute(g,String(C))})};((f,b,p=!0)=>{const x=document.head||document.getElementsByTagName("head")[0];if(!x||document.getElementById(f))return;const g=document.createElement("script");g.id=f,g.src=b,p&&(g.async=!0),x.appendChild(g)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),c("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),d&&c("ec-preconnect-appsync",{rel:"preconnect",href:d}),c("ec-theme-stylesheet",{rel:"stylesheet",href:h}),c("ec-google-fonts",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Symbols+Outlined|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Montserrat:300,400,500,600,700,800|Roboto:300,400,500,600,700,800|Abel|Caveat:400,700|Titillium+Web:400,600,700"}),m&&c("ec-canonical",{rel:"canonical",href:m}),c("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${Qn}/expedite/Expedite_Favicon.ico`})},processSections:async(s,u)=>{const h=Co();if(s&&u)try{const d=typeof u=="string"?JSON.parse(u):u;h.pageBlocks=d}catch(d){console.error("[ExpediteCart] Error parsing sections:",d)}else s||await h.fetchBlockInformationREST({templateId:xr.value||xr.value})},processTheme:async(s,u)=>{if(console.log("[COMPOSABLECATALOG:processTheme] isPreview",s),console.log("[COMPOSABLECATALOG:processTheme] theme",u),s&&u)try{return JSON.parse(u)}catch(h){return console.error("[ExpediteCart] Error parsing theme:",h),null}else if(!s)try{return await n()}catch(h){return console.error("[ExpediteCart] Error fetching theme:",h),null}return null},fetchAccessToken:async(s,u)=>{try{const h=(u==null?void 0:u.organizationId)||ko.value||"",d=(s==null?void 0:s.version)||"",m=s==null?void 0:s.awsExternalMSBaseURL;if(!m)throw new Error("awsExternalMSBaseURL is required in awsConnectionInfo");const c=await Ct({data:{Org_Id:h,Version:d},config:{baseUrl:m,pathKey:"fetchAccessToken"}});return console.log("fetchAccessToken - Response:",c),c!=null&&c.Access_Token&&(yi.value=c.Access_Token),c}catch(h){throw console.error("getAccessToken catch ::",h),console.error("Error details:",{message:h.message,stack:h.stack,name:h.name}),h}}}}const k4=["href"],v4=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons","data-name":"ec-material-icons"},null,-1),A4=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Outlined","data-name":"ec-material-icons-outlined"},null,-1),w4=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Round","data-name":"ec-material-icons-round"},null,-1),N4=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200","data-name":"ec-material-symbols-outlined"},null,-1),Nc={__name:"AtomThemeLoader",props:{organizationId:{type:String,required:!0},templateId:{type:String,required:!0},isPreview:{type:Boolean,required:!0},theme:{type:Object,required:!0}},setup(t){const r=t,n=ft(),o=e.ref(""),a=e.ref(""),i=async()=>{if(!(!r.organizationId||!r.templateId))try{const l=await n.processTheme(r.isPreview,r.theme);l&&(o.value=l),n.setThemeData();const s=Date.now(),u=`${Qn}/${r.organizationId}/${r.templateId}/css/theme_${r.templateId}.css?t=${s}`;console.log("[ATOMTHEMELOADER:loadTheme] styleURL",u),a.value=u}catch(l){console.error("[ATOMTHEMELOADER:loadTheme] Error loading theme",l)}};return e.onBeforeMount(()=>{i()}),e.watch(()=>[r.organizationId,r.templateId,r.isPreview,r.theme],()=>{i()},{deep:!0}),(l,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:0,"data-name":"template-theme"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value),1)]),_:1})):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("link",{key:1,rel:"stylesheet",href:a.value,"data-name":"ec-theme-stylesheet-link"},null,8,k4)):e.createCommentVNode("",!0),v4,A4,w4,N4],64))}},S4={KNOWLEDGE_DETAIL:"knowledgeDetail"},Sc={"Catalog Price":"XX_ORD1__Negotiated_Price__c","List Price":"XX_ORD1__List_Price2__c"},B4={name:"SkeletonLoader"},I4={class:"skeleton-loader"};function T4(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("div",I4)}const Qt=ve(B4,[["render",T4],["__scopeId","data-v-826b27ef"]]),Re=ve({__name:"AtomCustomTag",props:{tag:{type:String,default:null},text:{type:[String,Number,Boolean],default:"-"},type:{type:String,default:null},method:{type:String,default:null},style:{type:Object,default:()=>({})},secStyle:{type:Object,default:()=>({})},cssStyle:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},inherit:{type:[Array,String],default:()=>[]}},setup(t){const r=t,n={h1:"ecb-header-lvl-1",h2:"ecb-header-lvl-2",h3:"ecb-header-lvl-3",h4:"ecb-header-lvl-4",h5:"ecb-header-lvl-5",h6:"ecb-header-lvl-6",p:"ecb-text-regular",span:"ecb-text-small",strong:"ecb-text-strong",large:"ecb-text-large"},o=e.ref(!1),a=e.computed(()=>{if(r.text===null||r.text===void 0)return"";const u=String(r.text);return(u==null?void 0:u.replace(/\r\n|\n/g,"<br>"))||""}),i=e.computed(()=>{var h,d;const u=r.tag||((h=r.style)==null?void 0:h.tag)||((d=r.secStyle)==null?void 0:d.tag)||"p";return u==="large"||u==="strong"?"div":u}),l=e.computed(()=>{var h;const u=r.tag||((h=r.style)==null?void 0:h.tag)||"p";return n[u]||"ecb-text-regular"}),s=e.computed(()=>{var h,d;const u={};if(r.style&&((h=r.style)!=null&&h.overrite)){const{bold:m,color:c,italic:y,underline:f,strikethrough:b,strikeThrough:p,size:x,family:g,lineHeight:C}=r.style;m&&(u.fontWeight="700"),c&&(u.color=c),y&&(u.fontStyle="italic"),g&&(u.fontFamily=g),C&&(u.lineHeight=C),f?u.textDecoration="underline":(b||p)&&(u.textDecoration="line-through"),x&&(u.fontSize=x)}if(r.secStyle&&((d=r.secStyle)!=null&&d.overrite)){const{bold:m,color:c,italic:y,underline:f,strikethrough:b,strikeThrough:p,size:x,family:g,lineHeight:C}=r.secStyle;m&&(u.fontWeight="700"),c&&(u.color=c),y&&(u.fontStyle="italic"),g&&(u.fontFamily=g),C&&(u.lineHeight=C),f?u.textDecoration="underline":(b||p)&&(u.textDecoration="line-through"),x&&(u.fontSize=x)}for(const m of r.inherit)u[m]="inherit";return u});return(u,h)=>t.loading?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(t.cssStyle),class:"custom-tag-skeletion"},[e.createVNode(Qt)],4)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value),e.mergeProps({key:1},u.$attrs,{type:t.method,disabled:t.disabled,style:s.value,class:l.value,onMouseover:h[0]||(h[0]=d=>o.value=!0),onMouseout:h[1]||(h[1]=d=>o.value=!1),innerHTML:a.value}),null,16,["type","disabled","style","class","innerHTML"]))}},[["__scopeId","data-v-14a516b4"]]),O4={key:1,class:"field-label"},D4={class:"ect-flex ect-flex-col ect-justify-start"},V4={key:0,class:"ect-pr-5"},F4={key:1,class:"field-value ect-pr-5"},M4={key:1,class:"field-value"},Bc=ve({__name:"AtomFieldAttribute",props:{tag:{type:String,default:"span"},field:{type:String,default:""},value:{type:Object,default:()=>({})},label:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},offer:{type:Object,default:()=>({})},itemCount:{type:Number,default:1},appliedOnOfferMatchingField:{type:Boolean,default:!1},showOfferDescription:{type:Boolean,default:!1},isProductSummary:{type:Boolean,default:!1},index:{type:Number,default:0},parentWidth:{type:Number,default:0}},setup(t){const r=mn(),n=t,o=e.computed(()=>!1),a=e.computed(()=>{var c;return n.offer.offerValue.offerId&&n.offer.offerValue.formattedOfferPrice||n.offer.offerValue.rpId&&((c=n.offer.offerValue.qtyTiers)==null?void 0:c.length)>0?!!n.appliedOnOfferMatchingField:!1}),i=e.computed(()=>n.offer.offerDetails.styles.offerValue.textStyles.tag),l=e.computed(()=>n.offer.offerDetails.styles.offerDescription.textStyles),s=e.computed(()=>{var m,c;return(m=n.offer.offerValue)!=null&&m.qtyTiers?r.getVolumePrice(n.itemCount>0?n.itemCount:1,n.offer.offerValue):(c=n.offer.offerValue)==null?void 0:c.formattedOfferPrice}),u=e.computed(()=>({"ect-flex ect-line-through":o.value&&n.offer.offerValue&&a.value})),h=e.computed(()=>n.value&&(n.value.isStatic||!n.loading)),d=e.computed(()=>(o.value&&!n.isProductSummary||n.isProductSummary&&n.index===0)&&n.showOfferDescription&&n.appliedOnOfferMatchingField);return(m,c)=>{var y,f;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.field,"field ect-gap-1 ect-flex ect-flex-col"])},[t.label?(e.openBlock(),e.createBlock(Re,{key:0,tag:(y=t.label.style)==null?void 0:y.tag,text:t.label.value,style:e.normalizeStyle(t.label.style),class:e.normalizeClass(`${t.field}_label`)},null,8,["tag","text","style","class"])):(e.openBlock(),e.createElementBlock("div",O4,[e.createVNode(Qt)])),e.createElementVNode("div",D4,[o.value&&n.offer.offerValue&&a.value?(e.openBlock(),e.createElementBlock("div",V4,[e.createVNode(Re,{tag:i.value,text:s.value,style:e.normalizeStyle(t.offer.offerDetails.styles.offerValue.textStyles),class:e.normalizeClass(`${t.field}_value`)},null,8,["tag","text","style","class"])])):o.value&&!n.offer.offerValue?(e.openBlock(),e.createElementBlock("div",F4,[e.createVNode(Qt)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(u.value)},[h.value?(e.openBlock(),e.createBlock(Re,{key:0,tag:(f=t.value.style)==null?void 0:f.tag,text:t.value.value,style:e.normalizeStyle(t.value.style),class:e.normalizeClass(`${t.field}_value`)},null,8,["tag","text","style","class"])):(e.openBlock(),e.createElementBlock("div",M4,[e.createVNode(Qt)]))],2)]),d.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"field-description ect-left-0 ect-w-max ect-pt-2",style:e.normalizeStyle({maxWidth:t.parentWidth?t.parentWidth+"px":void 0})},[e.createVNode(Re,{tag:l.value.tag,text:n.offer.offerValue.offerDescShort,style:e.normalizeStyle(l.value),class:e.normalizeClass(t.field+"_value")},null,8,["tag","text","style","class"])],4)):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-b0e72386"]]),R4={key:1,class:"filter"},L4={class:"filter-title"},P4={key:0,class:"filter-desc"},q4={key:1,class:"filter-desc"},$4={key:2,class:"filter-desc"},Ic=ve({__name:"AtomProductText",props:{title:{type:Object,default:()=>({})},description:{type:Object,default:null},loading:{type:Boolean,default:!1},url:{type:String,default:null}},setup(t){const r=Ko(),n=t;function o(){n.url&&!n.loading&&r.push(n.url)}return(a,i)=>t.loading?(e.openBlock(),e.createElementBlock("div",R4,[e.createElementVNode("div",L4,[e.createVNode(Qt)]),t.description?(e.openBlock(),e.createElementBlock("div",P4,[e.createVNode(Qt)])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("div",q4,[e.createVNode(Qt)])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("div",$4,[e.createVNode(Qt)])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.title?(e.openBlock(),e.createBlock(Re,{key:0,class:e.normalizeClass({"ect-cursor-pointer":t.url}),text:t.title.value,style:e.normalizeStyle(t.title.style),onClick:o},null,8,["class","text","style"])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createBlock(Re,{key:1,text:t.description.value,style:e.normalizeStyle(t.description.style)},null,8,["text","style"])):e.createCommentVNode("",!0)],64))}},[["__scopeId","data-v-5b4d627e"]]),U4={name:"Spinner"},z4={class:"spinner"};function j4(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("div",z4)}const Ao=ve(U4,[["render",j4],["__scopeId","data-v-83f8c910"]]),H4={name:"AtomSkeletonWidget",components:{AtomSkeletonLoader:Qt,AtomSpinner:Ao},props:{rows:{type:Number,default:4},type:{type:String,default:"full"},className:{type:String,default:""}},data(){return{SKELETON_TYPE:S4}}},gi=t=>(e.pushScopeId("data-v-956cc081"),t=t(),e.popScopeId(),t),G4={key:0,class:"page"},K4=gi(()=>e.createElementVNode("div",{class:"page-header"},null,-1)),X4={class:"page-body"},W4={class:"page-body_board"},Q4={key:1,class:"field"},Z4={key:2,class:"filter"},J4={class:"filter-option_inner"},Y4={key:3,class:"full"},e9={key:4,class:"shuttle"},t9={class:"shuttle-full"},n9={class:"shuttle-full"},o9={class:"shuttle-half"},r9={class:"shuttle-half"},a9={class:"shuttle-button"},i9={key:5,class:"shuttle2"},l9={class:"shuttle2-full"},s9=gi(()=>e.createElementVNode("span",null,"Processing payment",-1)),c9={key:6,class:"shuttle2"},u9={class:"shuttle2-full"},d9=gi(()=>e.createElementVNode("span",null,"Processing order",-1)),f9={key:10,class:"skeleton-shipping"},h9={class:"skeleton-shipping-full"},p9={class:"skeleton-shipping-half"},m9={key:11,class:"skeleton-terms"},y9={class:"skeleton-terms-half"},g9={class:"skeleton-terms-full"},b9={class:"skeleton-terms-full"},x9={key:12,class:""},_9={class:"skeleton-terms-half"},C9={key:13,class:""},E9={class:"skeleton-terms-half"},k9={key:14,class:"product"},v9={class:"product-image"},A9={class:"product-texts"},w9={class:"product-description"},N9={class:"product-action"},S9={class:"product-button"},B9={key:15,class:""};function I9(t,r,n,o,a,i){const l=e.resolveComponent("AtomSkeletonLoader"),s=e.resolveComponent("AtomSpinner");return n.type==="page"?(e.openBlock(),e.createElementBlock("div",G4,[K4,e.createElementVNode("div",X4,[e.createElementVNode("div",W4,[e.createVNode(l)])])])):n.type==="fieldattribute"?(e.openBlock(),e.createElementBlock("div",Q4,[e.createVNode(l)])):n.type==="filteroptions"?(e.openBlock(),e.createElementBlock("div",Z4,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rows,u=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"filter-option"},[e.createElementVNode("div",J4,[e.createVNode(l)])]))),128))])):n.type==="full"?(e.openBlock(),e.createElementBlock("div",Y4,[e.createVNode(l)])):n.type==="shuttle"?(e.openBlock(),e.createElementBlock("div",e9,[e.createElementVNode("div",t9,[e.createVNode(l)]),e.createElementVNode("div",n9,[e.createVNode(l)]),e.createElementVNode("div",o9,[e.createVNode(l)]),e.createElementVNode("div",r9,[e.createVNode(l)]),e.createElementVNode("div",a9,[e.createVNode(l)])])):n.type==="shuttle-done"?(e.openBlock(),e.createElementBlock("div",i9,[e.createElementVNode("div",l9,[e.createVNode(s,{class:"shuttle2-spinner"}),e.createTextVNode(),s9])])):n.type==="order-processing"?(e.openBlock(),e.createElementBlock("div",c9,[e.createElementVNode("div",u9,[e.createVNode(s,{class:"shuttle2-spinner"}),e.createTextVNode(),d9])])):n.type==="enhanceFilter"?(e.openBlock(),e.createElementBlock("div",{key:7,class:e.normalizeClass(n.className)},[e.createVNode(l)],2)):n.type==="offers"?(e.openBlock(),e.createElementBlock("div",{key:8,class:e.normalizeClass(n.className)},[e.createVNode(l)],2)):n.type==="detailPage"?(e.openBlock(),e.createElementBlock("div",{key:9,class:e.normalizeClass(n.className)},[e.createVNode(l)],2)):n.type==="shippingAddress"?(e.openBlock(),e.createElementBlock("div",f9,[e.createElementVNode("div",h9,[e.createVNode(l)]),e.createElementVNode("div",p9,[e.createVNode(l)])])):n.type==="termsAndPayment"?(e.openBlock(),e.createElementBlock("div",m9,[e.createElementVNode("div",y9,[e.createVNode(l)]),e.createElementVNode("div",g9,[e.createVNode(l)]),e.createElementVNode("div",b9,[e.createVNode(l)])])):n.type==="accordian-title"?(e.openBlock(),e.createElementBlock("div",x9,[e.createElementVNode("div",_9,[e.createVNode(l)])])):n.type==="imageDiv"?(e.openBlock(),e.createElementBlock("div",C9,[e.createElementVNode("div",E9,[e.createVNode(l)])])):n.type==="product-detail"?(e.openBlock(),e.createElementBlock("div",k9,[e.createElementVNode("div",v9,[e.createVNode(l)]),e.createElementVNode("div",A9,[e.createVNode(l)]),e.createElementVNode("div",w9,[e.createVNode(l)]),e.createElementVNode("div",N9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rows,u=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"product-action_item"},[e.createVNode(l)]))),128))]),e.createElementVNode("div",S9,[e.createVNode(l)])])):n.type===a.SKELETON_TYPE.KNOWLEDGE_DETAIL?(e.openBlock(),e.createElementBlock("div",B9,[e.createVNode(l,{class:e.normalizeClass(n.className)},null,8,["class"])])):e.createCommentVNode("",!0)}const yn=ve(H4,[["render",I9],["__scopeId","data-v-956cc081"]]),T9=["src"],bi={__name:"AtomImage",props:{src:{type:String,default:""},resourcesDomain:{type:String,default:""},placeholder:{type:String,default:""},height:{type:Number,default:200},width:{type:Number,default:200},loading:{type:Boolean,default:!1},sizes:{type:String}},setup(t){const r=ft(),n=t,o=e.computed(()=>n.src.includes("/resource/")&&!n.src.includes("://")&&n.resourcesDomain?n.resourcesDomain+n.src:n.src.includes("/servlet/servlet.ImageServer")&&!n.src.includes("://")&&n.resourcesDomain?n.resourcesDomain+"/"+n.src:n.src.includes("/servlet/servlet.ImageServer")&&!n.src.includes("://")&&r.siteUrl?r.siteUrl.value+"/"+n.src:n.src);return(a,i)=>t.loading?(e.openBlock(),e.createBlock(yn,{key:0,type:"full"})):t.src?(e.openBlock(),e.createElementBlock("img",{key:1,src:o.value,placeholder:[30,20],class:"rounded",sizes:"props.sizes"},null,8,T9)):e.createCommentVNode("",!0)}},O9={class:"counter"},D9=["disabled"],V9={key:0,class:"counter-spinner"},F9=["max","disabled","value"],M9=["disabled"],_r=ve({__name:"AtomButtonCounter",props:{min:{type:Number,default:0},max:{type:Number,default:999},modelValue:{type:Number,default:1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},decimal:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:r}){const n=t,o=r,a=e.computed(()=>n.disabled||n.loading),i=St(function(h){const d=String(h??"");if(d==="")return;const m=Number(d);Number.isNaN(m)||o("update:modelValue",m)}),l=h=>{(h.key==="."||h.key==="e"||h.key==="E")&&!h.ctrlKey&&!h.metaKey&&n.decimal&&h.preventDefault()};function s(){n.modelValue<n.max&&o("update:modelValue",n.modelValue+1)}function u(){n.modelValue>n.min&&o("update:modelValue",n.modelValue-1)}return(h,d)=>(e.openBlock(),e.createElementBlock("div",O9,[e.createElementVNode("button",{disabled:t.modelValue<=t.min||a.value,onClick:u},[e.createVNode(Be,{icon:t.modelValue>1?"minus":"close",size:10},null,8,["icon"])],8,D9),t.loading?(e.openBlock(),e.createElementBlock("div",V9,[e.createVNode(Ao,{class:"item-button_spinner"})])):(e.openBlock(),e.createElementBlock("input",{key:1,type:"number",min:"0",max:t.max,disabled:a.value,value:t.modelValue,step:"1",onInput:d[0]||(d[0]=m=>e.unref(i)(m.target.value)),onKeydown:l},null,40,F9)),e.createElementVNode("button",{disabled:t.modelValue>=t.max||a.value,onClick:s},[e.createVNode(Be,{class:"ect-transform ect-rotate-45",icon:"add",size:12})],8,M9)]))}},[["__scopeId","data-v-886bff8a"]]),Tc=e.ref(!1),Oc=e.ref(!1),Dc=e.ref(!1),Vc=e.ref(!1),xi=()=>{if(typeof window<"u"){const t=()=>{const r=window.innerWidth;Oc.value=r<768,Dc.value=r>=768&&r<1024,Vc.value=r>=1024};e.onMounted(()=>{Tc.value||(Tc.value=!0,window.addEventListener("resize",t),t())})}return{isMobile:Oc,isTablet:Dc,isDesktop:Vc}},R9=["disabled"],L9=["disabled"],P9={class:"ect-w-max"},q9={class:"button-header-icon"},$9=["onClick"],U9={key:0,class:"button-options_item-icon"},z9=["disabled"],j9={class:"ect-w-max"},H9={class:"button-header-icon"},G9=["onClick"],K9={key:0,class:"button-options_item-icon"},Fc=ve({__name:"AtomButtonMenu",props:{icon:{type:String,default:null},select:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},name:{type:String,default:null},options:{type:Array,default:()=>[]}},emits:["selected"],setup(t,{emit:r}){const n=t,o=xi(),a=e.ref(!1),i=e.ref(null),l=e.ref({}),s=e.ref(!1),u=r;function h(b){b.stopPropagation(),a.value=!a.value}function d(b){b.stopPropagation(),a.value=!a.value,s.value=e.ref(a.value)}function m(b){u("selected",b),a.value=!1}function c(){!o.isMobile.value&&!n.disabled&&(a.value=!0)}function y(){!o.isMobile.value&&!s.value&&(a.value=!1)}function f(b){a.value&&(a.value=!1,s.value=!1)}return e.onMounted(()=>{document.addEventListener("click",f)}),e.onUnmounted(()=>{document.removeEventListener("click",f)}),(b,p)=>{var x;return t.options.length===1?(e.openBlock(),e.createElementBlock("button",{key:0,class:"esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:t.disabled,onClick:p[0]||(p[0]=g=>b.$emit("selected",t.options[0]))},[e.createElementVNode("span",null,e.toDisplayString(((x=t.options[0].label)==null?void 0:x.value)||t.options[0].name),1)],8,R9)):t.options.length>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(o).isMobile.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:t.disabled,onClick:e.withModifiers(h,["stop"])},[e.createElementVNode("span",P9,e.toDisplayString(t.name||t.options[0].name),1),e.createElementVNode("div",q9,[e.createVNode(Be,{icon:"arrow_drop_down",class:"ect-relative ect-top-0.5 ect-ml-2",color:"#ffffff",size:"14"})])],8,L9),!t.disabled&&t.options.length&&a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"button-options",onClick:p[2]||(p[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"button-options_grow",onClick:p[1]||(p[1]=g=>a.value=!1)}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>(e.openBlock(),e.createElementBlock("div",{key:g,class:"button-options_item",onClick:C=>m(g)},[g.selected&&t.select?(e.openBlock(),e.createElementBlock("div",U9,[e.createVNode(Be,{icon:"done",size:20,color:"black"})])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(g.name),1)],8,$9))),128))])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"button-container",onMouseenter:c,onMouseleave:y},[e.createElementVNode("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",ref_key:"btnmenu",ref:i,disabled:t.disabled,onClick:e.withModifiers(d,["stop"])},[e.createElementVNode("span",j9,e.toDisplayString(t.name||t.options[0].name),1),e.createElementVNode("div",H9,[e.createVNode(Be,{class:"ect-relative ect-top-0.5 ect-ml-2",icon:"arrow_drop_down",color:"#ffffff",size:"14"})])],8,z9),!t.disabled&&t.options.length&&a.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(l.value),class:"button-options",onClick:p[3]||(p[3]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>{var C;return e.openBlock(),e.createElementBlock("div",{key:g,class:"button-options_item",onClick:_=>b.$emit("selected",g)},[g.selected&&t.select?(e.openBlock(),e.createElementBlock("div",K9,[e.createVNode(Be,{icon:"done",size:20,color:"black"})])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(((C=g.label)==null?void 0:C.value)||g.name),1)],8,G9)}),128))],4)):e.createCommentVNode("",!0)],32))],64)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-cfcf21a3"]]),X9={class:"ect-flex ect-flex-col ect-w-full"},W9={key:0,class:"ect-h-[20px] ect-w-[150px]"},Q9={key:1,class:"ect-flex ect-flex-col ect-gap-1"},Z9=ve({__name:"MoleculeProductItem",props:{title:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]},description:{type:Object,default:()=>({})},thumbnail:{type:Object,default:()=>({})},attributes:{type:Array,default:()=>[]},itemId:{type:String,default:null},mode:{type:String,default:"vertical"},catalogItemId:{type:String,default:null},loading:{type:Boolean,default:!1},templateId:{type:String,default:null},url:{type:String,default:null},applyOffer:{type:Boolean,default:!1},offerSetting:{type:Object,default:null},isPreview:{type:Boolean,default:!1}},setup(t){var x,g;const r=fi(),n=mn(),o=t,a=e.ref(((g=(x=n.savedItems)==null?void 0:x[o.itemId])==null?void 0:g.XX_ORD1__QTY__c)||0),i=e.ref(!1),l=e.ref(null),s=e.ref(!1),u=e.ref(!1),h=e.computed(()=>o.actions&&o.actions.length>0),d=e.computed(()=>o.actions.some(C=>C.action==="ADD_TO_CART")),m=e.computed(()=>{var C,_,E;return(C=o.offer)!=null&&C.appliedOnField?Sc[(_=o.offer)==null?void 0:_.appliedOnField]===((E=o.offerSetting.value)==null?void 0:E.field):!0});e.watch(()=>n.savedItems,C=>{var _,E;C[o.itemId]&&!u.value&&((_=C[o.itemId])==null?void 0:_.XX_ORD1__QTY__c)!==a.value&&(a.value=((E=C[o.itemId])==null?void 0:E.XX_ORD1__QTY__c)||0,u.value=!0)},{deep:!0});function c(C){var _;u.value=!0,C===0&&((_=n.savedItems)!=null&&_[o.itemId])?f():p()}const y=C=>{var _;C.action==="ADD_TO_CART"?(u.value=!0,a.value=1,b()):C.action==="CONFIGURE"?Et("catalog:item-configure-clicked",{itemId:o.itemId,catalogItemId:o.catalogItemId,title:o.title,description:o.description,attributes:o.attributes,thumbnail:o.thumbnail,url:o.url,mode:o.mode,isPreview:o.isPreview}):C.action==="CUSTOM"?window.open(((_=C.url)==null?void 0:_.value)||C.value,C.newTab?"_blank":"_self"):C.action==="ORDER_PARTS"||C.action},f=async function(){i.value=!0,l.value=null;const C=[n.savedItems[o.itemId].Id];await n.deleteLineItems(C),i.value=!1},b=async function(){i.value=!0,l.value=null;const C={itemID:o.itemId,eCatalogItemID:o.catalogItemId,qty:a.value,qtyTierAmt:null};await n.saveItemToQuoteBlinkTxn(C),i.value=!1},p=St(async function(){console.log("updateToCart 1",a.value),s.value=!0,await n.updateQuoteLineQtyTxn({itemId:o.itemId,qty:a.value,eCatalogItemId:o.catalogItemId}),s.value=!1});return(C,_)=>{var E,A;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("item ecb-theme-card "+t.mode)},[e.createElementVNode("div",{class:e.normalizeClass(`item-image ${t.mode}-image`)},[e.createVNode(bi,{src:t.thumbnail.value,loading:t.loading,"resources-domain":e.unref(r).storefrontDetails.resourcesDomain},null,8,["src","loading","resources-domain"])],2),e.createElementVNode("div",{class:e.normalizeClass(`item-text ${t.mode}-text`)},[e.createVNode(Ic,{title:t.title,loading:t.loading,description:t.description},null,8,["title","loading","description"])],2),e.createElementVNode("div",X9,[e.createElementVNode("div",{class:e.normalizeClass(`item-attributes ${t.mode}-attributes`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.attributes,(k,B)=>(e.openBlock(),e.createBlock(Bc,{key:B,class:e.normalizeClass(`item-attributes_field ${t.mode}-attributes_field`),loading:t.loading,value:k.value,label:k.label,field:k.value.field,offer:{applyOffer:k.applyOffer,offerDetails:k.offerDetails,offerValue:o.offer},"item-count":a.value,"applied-on-offer-matching-field":m.value},null,8,["class","loading","value","label","field","offer","item-count","applied-on-offer-matching-field"]))),128))],2),o.offerSetting&&m.value&&((E=o.offer)!=null&&E.offerDescShort)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`${t.mode}-offer-banner`)},[e.createVNode(Re,{tag:t.offerSetting.offerDetails.styles.offerDescription.textStyles.tag,text:(A=o.offer)==null?void 0:A.offerDescShort,style:e.normalizeStyle(t.offerSetting.offerDetails.styles.offerDescription.textStyles),class:e.normalizeClass(C.field+"_value")},null,8,["tag","text","style","class"])],2)):e.createCommentVNode("",!0)]),h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([`item-button ${t.mode}-button`,"ect-flex ect-flex-col ect-gap-2"])},[t.loading||t.applyOffer&&!o.offer?(e.openBlock(),e.createElementBlock("div",W9,[e.createVNode(Qt)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[i.value?(e.openBlock(),e.createBlock(Ao,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createElementBlock("div",Q9,[a.value>0&&!t.loading&&d.value?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:a.value,"onUpdate:modelValue":[_[0]||(_[0]=k=>a.value=k),c],loading:s.value,disabled:t.isPreview},null,8,["modelValue","loading","disabled"])):(e.openBlock(),e.createBlock(Fc,{key:1,icon:"arrow_drop_down",disabled:t.loading||t.isPreview,options:t.actions,onSelected:_[1]||(_[1]=k=>y(k))},null,8,["disabled","options"]))]))],64))],2)):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-e3d55bd3"]]),J9={class:"item"},Y9={class:"item-text"},e8={class:"item-attributes"},t8={key:0,class:"item-button"},n8={key:1,class:"ect-flex ect-flex-col ect-gap-1"},o8=ve({__name:"MoleculeProductItemTable",props:{title:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]},description:{type:Object,default:()=>({})},thumbnail:{type:Object,default:()=>({})},attributes:{type:Array,default:()=>[]},itemId:{type:String,default:null},mode:{type:String,default:"vertical"},catalogItemId:{type:String,default:null},loading:{type:Boolean,default:!1},templateId:{type:String,default:null},url:{type:String,default:null},applyOffer:{type:Boolean,default:!1},offerSetting:{type:Object,default:null},offer:{type:Object,default:null},isPreview:{type:Boolean,default:!1}},setup(t){var b,p;const r=mn(),n=t,o=e.ref(((p=(b=r.savedItems)==null?void 0:b[n.itemId])==null?void 0:p.XX_ORD1__QTY__c)||0),a=e.ref(!1),i=e.ref(!1),l=e.ref(!1),s=e.computed(()=>n.actions&&n.actions.length>0),u=e.computed(()=>n.actions.some(x=>x.action==="ADD_TO_CART")),h=e.computed(()=>{var x,g,C;return(x=n.offer)!=null&&x.appliedOnField?Sc[(g=n.offer)==null?void 0:g.appliedOnField]===((C=n.offerSetting.value)==null?void 0:C.field):!0});e.watch(()=>r.savedItems,x=>{var g,C;x[n.itemId]&&!i.value&&((g=x[n.itemId])==null?void 0:g.XX_ORD1__QTY__c)!==o.value&&(o.value=((C=x[n.itemId])==null?void 0:C.XX_ORD1__QTY__c)||0,i.value=!0)},{deep:!0});function d(x){var g;i.value=!0,x===0&&((g=r.savedItems)!=null&&g[n.itemId])?c():f()}const m=x=>{var g;x.action==="ADD_TO_CART"?(i.value=!0,o.value=1,y()):x.action==="CONFIGURE"?Et("catalog:item-configure-clicked",{itemId:n.itemId,catalogItemId:n.catalogItemId,title:n.title,description:n.description,attributes:n.attributes,thumbnail:n.thumbnail,url:n.url,offer:n.offer,mode:n.mode,isPreview:n.isPreview}):x.action==="CUSTOM"?window.open(((g=x.url)==null?void 0:g.value)||x.value,x.newTab?"_blank":"_self"):x.action==="ORDER_PARTS"||x.action},c=async function(){a.value=!0;const x=[r.savedItems[n.itemId].Id];await r.deleteLineItems(x),delete r.savedItems[n.itemId],a.value=!1},y=async function(){a.value=!0;const x={itemID:n.itemId,eCatalogItemID:n.catalogItemId,qty:o.value,qtyTierAmt:null};await r.saveItemToQuoteBlinkTxn(x),a.value=!1},f=St(async function(){console.log("updateToCart 2",o.value),l.value=!0,await r.updateQuoteLineQtyTxn({itemId:n.itemId,qty:o.value,eCatalogItemId:n.catalogItemId}),l.value=!1},800);return(x,g)=>(e.openBlock(),e.createElementBlock("div",J9,[e.createElementVNode("div",Y9,[e.createVNode(Ic,{url:t.url,title:t.title,loading:t.loading},null,8,["url","title","loading"])]),e.createElementVNode("div",e8,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.attributes,C=>{var _;return e.openBlock(),e.createBlock(Bc,{key:C.field,class:e.normalizeClass(`item-attributes_field ${t.mode}-attributes_field`),loading:t.loading,value:C.value,label:C.label,offer:{applyOffer:C.applyOffer,offerDetails:C.offerDetails,offerValue:n.offer},"item-count":o.value,"applied-on-offer-matching-field":h.value,"show-offer-description":!!((_=n.offer)!=null&&_.offerDescShort)},null,8,["class","loading","value","label","offer","item-count","applied-on-offer-matching-field","show-offer-description"])}),128))]),s.value?(e.openBlock(),e.createElementBlock("div",t8,[a.value?(e.openBlock(),e.createBlock(Ao,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createElementBlock("div",n8,[o.value>0&&!t.loading&&u.value?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:o.value,"onUpdate:modelValue":[g[0]||(g[0]=C=>o.value=C),d],loading:l.value,disabled:t.isPreview},null,8,["modelValue","loading","disabled"])):(e.openBlock(),e.createBlock(Fc,{key:1,icon:"arrow_drop_down",disabled:t.loading||t.isPreview,options:t.actions,onSelected:g[1]||(g[1]=C=>m(C))},null,8,["disabled","options"]))]))])):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-b679176d"]]),r8=["placeholder"],a8={key:0,class:"srch-error"},i8={class:"srch-option_lst-main"},l8={class:"italic"},s8={class:"srch-option_lst-sugg"},c8={class:"italic"},u8={class:"srch-option_lst-main"},d8={class:"italic"},f8={class:"srch-option_lst-sugg"},h8={class:"italic"},p8={class:"srch-option_lst-main"},m8={class:"italic"},y8={class:"srch-option_lst-sugg"},g8={class:"italic"},b8={key:1,class:"search1"},x8={class:"search-container_header"},_8={class:"search-container_header_input ectheme-input-box"},C8=["placeholder","value"],E8=ve({__name:"BlinkMoleculeSearch",props:{placeholder:{type:String,default:""},modelValue:{type:String,default:""},suggestion:{type:Boolean,default:!1},showSearchIconAlways:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},enableSearchClick:{type:Boolean,default:!1}},emits:["update:modelValue","enter"],setup(t,{emit:r}){const n=r;let o;const a=e.ref(""),i=e.ref(!1),l=e.ref(!1),s=e.ref(null),u=()=>{s.value=null,a.value="",n("update:modelValue",""),n("enter")},h=b=>{a.value.length>1?(b.target.blur(),m(a.value+"*")):s.value="Search text must be more than one character.",i.value=!1},d=()=>{l.value||(s.value=null,a.value.length>1?m(a.value+"*"):a.value.length===1&&(s.value="Search text must be more than one character."),i.value=!1)},m=b=>{n("update:modelValue",b),i.value=!1,l.value=!1},c=b=>{const p=b.target.value;s.value=null,p.length||n("update:modelValue","")},y=()=>{n("enter")},f=b=>{var x;o&&(clearTimeout(o),o=null);const p=((x=b==null?void 0:b.target)==null?void 0:x.value)??"";o=setTimeout(()=>{n("update:modelValue",p)},500)};return(b,p)=>t.suggestion?(e.openBlock(),e.createElementBlock("div",{key:0,class:"srch",tabindex:"0",onFocusin:p[6]||(p[6]=x=>i.value=!0),onFocusout:d,onKeydown:e.withKeys(h,["enter"])},[e.createElementVNode("div",{class:e.normalizeClass(["srch-inp",{"srch-error-border":s.value}])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=x=>a.value=x),type:"search",placeholder:t.placeholder,onInput:c},null,40,r8),[[e.vModelText,a.value]]),e.createVNode(Be,{icon:a.value?"close":"search",size:14,color:s.value?"red":"#acacac",onClick:u},null,8,["icon","color"])],2),s.value?(e.openBlock(),e.createElementBlock("div",a8,[e.createElementVNode("span",null,e.toDisplayString(s.value),1)])):e.createCommentVNode("",!0),a.value.length>1&&i.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"srch-option",onMouseover:p[4]||(p[4]=x=>l.value=!0),onMouseout:p[5]||(p[5]=x=>l.value=!1)},[e.createElementVNode("div",{class:"srch-option_lst",onClick:p[1]||(p[1]=x=>m(a.value+"*"))},[e.createElementVNode("div",i8,[e.createTextVNode(" Search for "),e.createElementVNode("span",l8,e.toDisplayString(a.value)+"*",1)]),e.createElementVNode("div",s8,[e.createTextVNode(" word that starts with "),e.createElementVNode("span",c8,e.toDisplayString(a.value)+"*",1)])]),e.createElementVNode("div",{class:"srch-option_lst",onClick:p[2]||(p[2]=x=>m(a.value))},[e.createElementVNode("div",u8,[e.createTextVNode(" Search for "),e.createElementVNode("span",d8,'"'+e.toDisplayString(a.value)+'"',1)]),e.createElementVNode("div",f8,[e.createTextVNode(" search exactly for "),e.createElementVNode("span",h8,'"'+e.toDisplayString(a.value)+'"',1)])]),e.createElementVNode("div",{class:"srch-option_lst",onClick:p[3]||(p[3]=x=>m("*"+a.value+"*"))},[e.createElementVNode("div",p8,[e.createTextVNode(" Search for "),e.createElementVNode("span",m8,"*"+e.toDisplayString(a.value)+"*",1)]),e.createElementVNode("div",y8,[e.createTextVNode(" word that includes "),e.createElementVNode("span",g8,"*"+e.toDisplayString(a.value)+"*",1)])])],32)):e.createCommentVNode("",!0)],32)):(e.openBlock(),e.createElementBlock("div",b8,[e.createElementVNode("div",x8,[e.createElementVNode("div",_8,[e.createElementVNode("input",{class:"",type:"search",placeholder:t.placeholder,value:t.modelValue,onInput:f,onKeyup:e.withKeys(y,["enter"])},null,40,C8),t.loading?(e.openBlock(),e.createBlock(Ao,{key:0})):e.createCommentVNode("",!0),t.modelValue?(e.openBlock(),e.createBlock(Be,{key:1,icon:"close",size:12,color:"#acacac",onClick:u})):e.createCommentVNode("",!0),t.enableSearchClick||!t.modelValue?(e.openBlock(),e.createBlock(Be,{key:2,class:"ect-relative ect-top-[-1px]",icon:"search",size:14,color:"#acacac",onClick:y})):e.createCommentVNode("",!0)])])]))}},[["__scopeId","data-v-31366d17"]]),Mc=t=>(e.pushScopeId("data-v-01d2d3f1"),t=t(),e.popScopeId(),t),k8=["id"],v8={key:0,class:"product-search"},A8={key:1,class:"product-not-found"},w8=Mc(()=>e.createElementVNode("span",{class:"product-not-found_icon material-symbols-outlined"}," error ",-1)),N8=Mc(()=>e.createElementVNode("span",{class:"product-not-found_text"},"No results found",-1)),S8={key:2,class:"product-item"},B8=20,I8=ve({__name:"MoleculeProductBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},request:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},catalogType:{type:String,required:!0},blockId:{type:String,default:""},accountId:{type:String,default:null},searchText:{type:String,default:""},onCountUpdate:{type:Function,default:null},hideHeader:{type:Boolean,default:!1},initialItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1}},setup(t,{expose:r}){const n=ft(),o=["vertical","horizontal","square","table"],a=t,i=e.ref(Math.floor(Math.random()*1e9)),l=e.ref(null),s=mn(),u=e.ref(1),h=e.ref(!0),d=e.ref(!0),m=e.ref(!1);e.ref(!1);const c=e.ref([]),y=e.ref(0),f=e.ref(a.request);let b=200;const p=e.ref(a.searchText||""),x=e.computed(()=>a.initialItems||[]),g=e.computed(()=>!!(p.value||a.searchText));function C(N,T,O){const F=O==="Item",q=[];return N.forEach(M=>{var L,j;const U=JSON.parse(JSON.stringify(T));try{F?U.itemId=M.Id:(U.itemId=M.XX_ORD1__Item__c,U.catalogItemId=M.Id);const{description:H,thumbnail:Z,title:te,attributes:ne,actions:Q}=U;Z!=null&&Z.field&&!Z.isStatic&&(Z.value=We(M,Z.field)),te!=null&&te.field&&!te.isStatic&&(te.value=We(M,te.field)),H!=null&&H.field&&!H.isStatic&&(H.value=We(M,H.field)),(ne||[]).forEach(ue=>{var pe,ie;(pe=ue==null?void 0:ue.value)!=null&&pe.field&&!ue.value.isStatic&&(ue.value.value=We(M,ue.value.field,ue.value.dataType)||"-"),(ie=ue==null?void 0:ue.label)!=null&&ie.field&&!ue.label.isStatic&&(ue.label.value=We(M,ue.label.field,ue.label.dataType)||"-")}),(Q||[]).forEach(ue=>{ue.action==="CUSTOM"&&(ue.url&&!ue.url.isStatic&&(ue.url.value=We(M,ue.url.field)),ue.label&&!ue.label.isStatic&&(ue.label.value=We(M,ue.label.field)))});try{const ue=F?We(M,"XX_ORD1__SYS_Requires_Configuration__c"):We(M,"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c");U.requiresConfiguration=ue}catch{}const ce=F?We(M,"XX_ORD1__Friendly_URL__c"):We(M,"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c");((L=U.friendlyURLFields)==null?void 0:L.length)>0&&ce?((j=U.friendlyURLFields)==null||j.forEach(ue=>{U.friendlyURL=(U.friendlyURL||"").replace(`{!${ue}}`,We(M,ue))}),U.friendlyURL="/"+(U.friendlyURL||"")+"/"+ce):U.url&&(U.friendlyURL=U.url+"/"+((M==null?void 0:M.Id)||"")),U.friendlyURL&&(U.friendlyURL=U.friendlyURL.replace(/\/{2,}/g,"/"))}catch{}q.push(U)}),q}const _=e.ref(null),E=e.ref(null),A=e.computed(()=>{}),k=e.computed(()=>{var N;return(N=a.fields)==null?void 0:N.header});e.computed(()=>{var N;return((N=k.value)==null?void 0:N.mainHeading)||{}}),e.computed(()=>{var N;return((N=k.value)==null?void 0:N.subHeading)||{}});const B=e.computed(()=>{var N;return c.value.length>0?c.value:Array(D.value).fill((N=a.fields)==null?void 0:N.productCard)}),D=e.computed(()=>Number(a.configuration.displaySettings.itemsPerPage||B8)),w=e.computed(()=>Number(a.configuration.displaySettings.lazyLoadBatch)),v=e.computed(()=>{var N;return((N=a.configuration.productItemOrientation)==null?void 0:N.toLowerCase())||"vertical"}),S=e.ref(o.includes(v.value)?_.value||v.value:"vertical"),I=e.computed(()=>c.value.length<1&&!d.value),R=e.computed(()=>`product-${S.value} width-${E.value?E.value:a.configuration.displaySettings.columns||1}`),z=e.computed(()=>a.configuration.displaySettings.enableSearch),$=e.ref(null),X=e.ref(!1),W=e.ref({});e.watch(u,(N,T)=>{N!==T&&(console.log("[fetchProducts] 1"),K(!0))}),e.watch($,N=>{N!==null&&a.onCountUpdate&&a.onCountUpdate(N)}),e.watch(p,()=>{u.value=1,console.log("[fetchProducts] 2"),K(!0)}),e.watch(()=>a.searchText,(N,T)=>{N!==T&&(p.value=N||"")});const K=St(async function(N){var q;if(b=600,m.value=!0,x.value&&x.value.length>0&&!g.value){const M=C(x.value,(q=a.fields)==null?void 0:q.productCard,a.catalogType);c.value=M,$.value=M.length,d.value=!1,m.value=!1;try{Et("catalog:items-loaded",{items:M,count:M.length})}catch{}N&&l.value&&l.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"});return}d.value=!0;let O=D.value;w.value<O&&w.value>0&&(O=w.value);const F={...f.value,accountID:a.accountId,rowLimit:O,searchText:p.value||a.searchText,rowOffSet:D.value*(u.value-1)};N&&l.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}),n.quoteId.value?s.getQuoteItems(!0).then(M=>{m.value=!1}).catch(M=>{console.error("[MOLECULEPRODUCTBLOCK:fetchProducts] error fetching line items",M),m.value=!1}).finally(()=>{m.value=!1}):m.value=!1;try{const M=await s.getProductItems(F,a.fields.productCard,a.catalogType);if(M){h.value=M.items.length===O,$.value=M.count,c.value=M.items,y.value=Math.ceil(M.count/D.value);try{Et("catalog:items-loaded",{items:M.items,count:M.count})}catch{}}console.log("[MOLECULEPRODUCTBLOCK:fetchProducts] prodData",M)}catch(M){console.error("[MOLECULEPRODUCTBLOCK:fetchProducts] error fetching products",M)}finally{d.value=!1,m.value=!1}},b);async function P(){const{mainHeading:N,subHeading:T}=a.fields.header;if(!N.isStatic&&N.field||!T.isStatic&&T.field){const O=[];N.isStatic?N.value=N.title:O.push(N.field),T.isStatic?T.value=T.title:O.push(T.field);const F={...f.value,accountID:a.accountId,fields:O},q=await s.getEcatalogDetails(F);N.isStatic||(N.value=q[N.field],N.isStatic=!0),T.isStatic||(T.value=q[T.field],T.isStatic=!0)}else N.value=N.title,T.value=T.title}return r({currentPage:u,fetchProducts:K}),e.onMounted(()=>{K(),P()}),(N,T)=>(e.openBlock(),e.createElementBlock("div",{id:i.value,ref_key:"productBlock",ref:l,class:"product"},[z.value&&A.value===void 0&&!t.hideHeader?(e.openBlock(),e.createElementBlock("div",v8,[e.createVNode(E8,{modelValue:p.value,"onUpdate:modelValue":T[0]||(T[0]=O=>p.value=O),placeholder:"Search products..."},null,8,["modelValue"])])):e.createCommentVNode("",!0),e.renderSlot(N.$slots,"default",{},void 0,!0),I.value?(e.openBlock(),e.createElementBlock("div",A8,[w8,e.createTextVNode(),N8])):(e.openBlock(),e.createElementBlock("div",S8,[S.value==="table"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(B.value,O=>(e.openBlock(),e.createElementBlock("div",{key:(O==null?void 0:O.catalogItemId)||(O==null?void 0:O.itemId),class:"product-item_table"},[e.createVNode(o8,{class:"ecb-theme-card","item-id":O==null?void 0:O.itemId,"catalog-item-id":O==null?void 0:O.catalogItemId,loading:d.value||m.value,mode:S.value,title:O==null?void 0:O.title,attributes:O==null?void 0:O.attributes,actions:O==null?void 0:O.actions,thumbnail:{value:O==null?void 0:O.thumbnail.value},description:O==null?void 0:O.description,url:O==null?void 0:O.friendlyURL,"template-id":t.configuration.productTemplateId,"apply-offer":X.value,"offer-setting":W.value,offer:O==null?void 0:O.offer,"is-preview":t.isPreview},null,8,["item-id","catalog-item-id","loading","mode","title","attributes","actions","thumbnail","description","url","template-id","apply-offer","offer-setting","offer","is-preview"])]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(B.value,O=>(e.openBlock(),e.createElementBlock("div",{key:(O==null?void 0:O.catalogItemId)||(O==null?void 0:O.itemId),class:e.normalizeClass(["product-item_record",R.value])},[e.createVNode(Z9,{"item-id":O==null?void 0:O.itemId,"catalog-item-id":O==null?void 0:O.catalogItemId,loading:d.value||m.value,mode:S.value,title:O==null?void 0:O.title,attributes:O==null?void 0:O.attributes,actions:O==null?void 0:O.actions,thumbnail:{value:O==null?void 0:O.thumbnail.value},description:O==null?void 0:O.description,url:O==null?void 0:O.friendlyURL,"template-id":t.configuration.productTemplateId,"apply-offer":X.value,"offer-setting":W.value,offer:O==null?void 0:O.offer,"is-preview":t.isPreview},null,8,["item-id","catalog-item-id","loading","mode","title","attributes","actions","thumbnail","description","url","template-id","apply-offer","offer-setting","offer","is-preview"])],2))),128))]))],8,k8))}},[["__scopeId","data-v-01d2d3f1"]]),Rc=t=>(e.pushScopeId("data-v-0eae07cd"),t=t(),e.popScopeId(),t),T8={class:"catalog ect-flex ect-flex-col ect-gap-0 md:ect-flex-row"},O8={class:"catalog-product md:ect-grow"},D8={class:"ect-px-2 ect-text-[#0A0A0A] ect-[font-family:var(--font-family-Font-3,_Montserrat)] ect-text-[18px] md:ect-text-[22px] lg:ect-text-[22px] ect-font-bold ect-leading-normal ect-mb-6","data-test-id":"catalog-block-heading-title"},V8={class:"catalog-filter-mobile ect-flex ect-justify-between m-show"},F8=Rc(()=>e.createElementVNode("h3",null,"Filter Products",-1)),M8=Rc(()=>e.createElementVNode("span",null," OPEN FILTERS",-1)),R8=ve({__name:"OrganismsCatalogBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},searchTerm:{type:String,default:""},onCountUpdate:{type:Function,default:null},initialItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1}},setup(t){var y,f,b,p,x,g,C,_,E,A,k;const r=ft(),n=t,o=e.ref(!1),a=e.computed(()=>Array.isArray(n.initialItems)&&n.initialItems.length>0?"Search Results":"Catalog"),i=e.ref(((y=n.configuration.dynamicFilters)==null?void 0:y.length)>0&&((f=n.configuration.displaySettings)==null?void 0:f.displayDynamicFilters)&&!n.searchTerm),l=e.ref(n.configuration.displaySettings),s=e.computed(()=>y4.get(n.configuration.catalogType)),u=e.computed(()=>{let B=d.value.searchText;return B&&!B.endsWith("*")&&(B+="*"),B||""}),h=e.computed(()=>{var z;const B=[],{description:D,thumbnail:w,title:v,attributes:S,actions:I}=n.fields.productCard,R=[D,w,v];return S.forEach($=>{R.push($.value),R.push($.label)}),(I==null?void 0:I.length)>0&&I.forEach($=>{$.action==="CUSTOM"&&(R.push($.url),R.push($.label))}),R.forEach($=>{!$.isStatic&&$.field?B.push($.field):$.value=$.title||"-"}),s.value==="eCatalog"?(B.push("XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),B.push("XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c")):(B.push("XX_ORD1__Friendly_URL__c"),B.push("XX_ORD1__SYS_Requires_Configuration__c")),((z=n.fields.productCard.friendlyURLFields)==null?void 0:z.length)>0&&B.push(...n.fields.productCard.friendlyURLFields),B}),d=e.ref({blockId:n.id,catalogType:m4.get(n.configuration.catalogType)||"Full",checkcurrency:(b=l.value)==null?void 0:b.checkCurrency,eCatalogIDs:n.configuration.catalogType==="ECATALOG_OVERRIDE"&&n.configuration.catalogId?[n.configuration.catalogId]:null,fields:h.value,alternateFieldName:n.configuration.catalogCustomField,searchText:"",whereCondition:n.configuration.staticFilters,sortByField:((x=(p=n.configuration.sort)==null?void 0:p.primary)==null?void 0:x.field)||"Name",sortOrder:(C=(g=n.configuration.sort)==null?void 0:g.primary)==null?void 0:C.direction,secondarySortByField:(E=(_=n.configuration.sort)==null?void 0:_.secondary)==null?void 0:E.field,secondarySortOrder:(k=(A=n.configuration.sort)==null?void 0:A.secondary)==null?void 0:k.direction}),m=e.ref(null),c=e.ref(null);return e.watch(()=>o.value,B=>{B&&window.scrollTo(0,0)}),e.onMounted(()=>{d.value.searchText=n.searchTerm||""}),e.watch(d,B=>{c.value&&c.value.fetchFilterList(),m.value&&(m.value.currentPage=1,console.log("[fetchProducts] 4"),m.value.fetchProducts())},{deep:!0}),e.watch(()=>n.searchTerm,B=>{typeof B=="string"&&(d.value.searchText=B)}),(B,D)=>(e.openBlock(),e.createElementBlock("div",T8,[e.createElementVNode("div",O8,[e.createElementVNode("h2",D8,e.toDisplayString(a.value),1),e.createVNode(I8,{ref_key:"product",ref:m,"block-id":t.id,"account-id":e.unref(r).accountId,configuration:t.configuration,"catalog-type":s.value,request:d.value,fields:t.fields,"search-text":u.value,"initial-items":n.initialItems,"hide-header":!!n.searchTerm,"on-count-update":n.onCountUpdate,"is-preview":t.isPreview},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",V8,[F8,e.createElementVNode("div",{class:"ect-flex ect-items-center ect-gap-2 m-show",onClick:D[0]||(D[0]=w=>o.value=!0)},[e.createVNode(Be,{class:"filter-product_icon",icon:"tune",color:"#acacac",size:20}),M8])],512),[[e.vShow,!o.value&&i.value]])]),_:1},8,["block-id","account-id","configuration","catalog-type","request","fields","search-text","initial-items","hide-header","on-count-update","is-preview"])])]))}},[["__scopeId","data-v-0eae07cd"]]),L8={name:"AtomIcon",props:{icon:{type:String,default:"edit"},tooltipWidth:{type:Number,default:130},color:{type:String,default:"#acacac"},hover:{type:String,default:null},size:{type:Number,default:20},disabled:{type:Boolean,default:!1},tooltip:{type:String,default:""},direction:{type:String,default:"top-right"},symbol:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},custom:{type:Boolean,default:!1},removeDefaultColor:{type:Boolean,default:!1},margin:{type:String,default:"0px"}},data(){return{isHover:!1}},computed:{style(){return{color:this.removeDefaultColor?"":this.isHover&&this.hover?this.hover:this.color,fontSize:this.size+"px",margin:this.margin}},mode(){let t="material-";return this.symbol?t+="symbols-":t+="icons-",this.rounded?t+="round":t+="outlined",t}}},P8=["width","height"],q8=["href"],$8=["width","height"],U8=["href"];function z8(t,r,n,o,a,i){const l=e.resolveComponent("AtomIcons"),s=e.resolveComponent("AtomTooltip");return n.tooltip?(e.openBlock(),e.createBlock(s,{key:0,content:n.tooltip,direction:n.direction,width:n.tooltipWidth},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["google-icon",{disabled:n.disabled}]),onMouseenter:r[0]||(r[0]=u=>a.isHover=!0),onMouseleave:r[1]||(r[1]=u=>a.isHover=!1)},[n.custom?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(l),(e.openBlock(),e.createElementBlock("svg",{width:n.size,height:n.size,style:e.normalizeStyle({fill:a.isHover&&n.hover&&!n.disabled?n.hover:n.color,color:a.isHover&&n.hover&&!n.disabled?n.hover:n.color})},[e.createElementVNode("use",{href:`#icon-${n.icon}`},null,8,q8)],12,P8))],64)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(i.mode),style:e.normalizeStyle(i.style)},e.toDisplayString(n.icon),7))],34)]),_:1},8,["content","direction","width"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["google-icon",{disabled:n.disabled}]),onMouseenter:r[2]||(r[2]=u=>a.isHover=!0),onMouseleave:r[3]||(r[3]=u=>a.isHover=!1)},[n.custom?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(l),(e.openBlock(),e.createElementBlock("svg",{width:n.size,height:n.size,style:e.normalizeStyle({fill:a.isHover&&n.hover&&!n.disabled?n.hover:n.color,color:a.isHover&&n.hover&&!n.disabled?n.hover:n.color})},[e.createElementVNode("use",{href:`#icon-${n.icon}`},null,8,U8)],12,$8))],64)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(i.mode),style:e.normalizeStyle(i.style)},e.toDisplayString(n.icon),7))],34))}const Cr=ve(L8,[["render",z8],["__scopeId","data-v-16108bca"]]);async function Lc(t,r,n,o={},a={}){let i=`/services/apexrest/${t}?type=${r}`;if(o&&Object.keys(o).length>0){const u=new URLSearchParams;Object.keys(o).forEach(d=>{const m=o[d];m!=null&&m!==""&&u.append(d,String(m))});const h=u.toString();h&&(i+=`&${h}`)}const l={action:"makeCall",data:{callType:n,endpoint:i,...n!=="GET"&&{payload:JSON.stringify(a)}}};return(await br(wn,l)).content}const Nn=it.defineStore("expediteCart",()=>{const t=e.ref(null),r=e.ref([]),n=e.ref(),o=e.ref({}),a=ft();async function i(f,b){let p=b?"cart.getGroupedQuoteProducts":"cart.getQuoteProducts";return await Ct({data:JSON.stringify(f),config:{pathKey:p}})}async function l(f){return await Ct({data:JSON.stringify({lineItemIds:f}),config:{pathKey:"common.getLineItemAttributes"}})}async function s(){const f=t.value?{quoteId:t.value}:{};return await Ct({data:JSON.stringify(f),config:{pathKey:"promocode.getPromoCodes"}})}async function u(){const f=t.value?{quoteId:t.value}:{},b=await Lc("XX_ORD1/ecommerce","getQLIsForPromoCode","POST",f,{});return n.value=b,r.value=b.qliIds,b}async function h(f,b,p){const x={promoCode:f,quoteId:t.value,qliIds:b,isLastBatch:p,originalTotalSalesPrice:f?n.value.originalTotalSalesPrice:null,isFromQLIUpdateOrDelete:"false"};return await Ct({data:JSON.stringify(x),config:{pathKey:"promocode.applyPromoCode"}})}async function d(f){const p={records:[{fields:f.fields.map(g=>({fieldName:g.fieldName,fieldValue:String(g.fieldValue)}))}],uniqueField:"Id",objectType:f.objectType};return await Ct({data:JSON.stringify(p),config:{pathKey:"update.upsertRecords"}})}async function m(f){return await Ct({data:JSON.stringify(f),config:{pathKey:"fetch.getRecord"}})}async function c(){const f=t.value;return f?await Ct({data:JSON.stringify({objectId:f,isCommit:!1}),config:{pathKey:"tax.calculateAvaTax"}}):void 0}async function y(f){const b=f||a.cid.value;return await Lc("XX_ORD1/ecommerce","startNewCart","POST",b?{cid:b}:{},{})}return{quoteId:t,qlisList:r,quoteRecord:o,getRowItems:i,getLineItemAttributesNG:l,getPromoCodeInfo:s,getQLIsForPromoCode:u,applyPromoCodeNG:h,updateRecord:d,getRecordFieldValue:m,calculateAvaTax:c,startNewCart:y}}),j8={name:"ModalApp",components:{AtomIcon:Cr},props:{show:{type:Boolean,default:!0},title:{type:String,default:""},subTitle:{type:String,default:""},maxWidth:{type:String,default:""},showCloseButtonText:{type:Boolean,default:!1},showCloseButton:{type:Boolean,default:!0}},emits:["clicked"],mounted(){document.querySelector("body").style.overflow="hidden"},unmounted(){document.querySelector("body").style.overflow="auto"}},H8={key:0,class:"modal-mask"},G8={class:"modal-wrapper"},K8={key:0,class:"close-text"},X8={key:1,class:"modal-container__header"},W8={class:"ect-flex ect-flex-col ect-gap-2"},Q8={class:"widget-upload__heading"},Z8={key:0,class:"ect-text-[#5f5f5f] ect-text-[14px] ect-font-roboto ect-font-normal ect-leading-[20px]"},J8={class:"modal-container__content"},Y8={class:"modal-container__action"};function ey(t,r,n,o,a,i){const l=e.resolveComponent("AtomIcon");return e.openBlock(),e.createBlock(e.Transition,null,{default:e.withCtx(()=>[n.show?(e.openBlock(),e.createElementBlock("div",H8,[e.createElementVNode("div",G8,[e.createElementVNode("div",{class:"modal-container",style:e.normalizeStyle(`${n.maxWidth?"max-width: "+n.maxWidth+"px; width: 100%;":""}`)},[n.showCloseButton?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-container__close ect-gap-2",onClick:r[0]||(r[0]=s=>t.$emit("clicked"))},[e.createVNode(l,{icon:"close",size:16,color:"##0a0a0a",hover:"#000000"}),n.showCloseButtonText?(e.openBlock(),e.createElementBlock("span",K8," Close ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),n.title?(e.openBlock(),e.createElementBlock("span",X8,[e.createElementVNode("div",W8,[e.createElementVNode("p",Q8,e.toDisplayString(n.title),1),n.subTitle?(e.openBlock(),e.createElementBlock("span",Z8,e.toDisplayString(n.subTitle),1)):e.createCommentVNode("",!0)]),e.renderSlot(t.$slots,"header-action",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",J8,[e.renderSlot(t.$slots,"content",{},void 0,!0)]),e.createElementVNode("div",Y8,[e.renderSlot(t.$slots,"action",{},void 0,!0)])],4)])])):e.createCommentVNode("",!0)]),_:3})}const ty=ve(j8,[["render",ey],["__scopeId","data-v-f59dbab6"]]),ny={name:"AtomLoader"},oy={class:"loader"};function ry(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("span",oy)}const Pc=ve(ny,[["render",ry],["__scopeId","data-v-32b63014"]]),ay={name:"AtomButton",components:{AtomLoader:Pc},props:{tag:{type:String,default:"button"},text:{type:String,default:"text",required:!0},btype:{type:String,default:"text"},method:{type:String,default:"button"},disabled:{type:Boolean,default:!1},buttonStyle:{type:String,default:"button"},loading:{type:Boolean,default:!1}},emits:["clicked"],data(){return{isHover:!1}},methods:{getBtnClass(){const t=[];return this.btype?this.btype==="primary"?t.push("esg-btn-primary ect-bg-primary"):this.btype==="secondary"?t.push("esg-btn-secondary"):this.btype==="link"||this.btype==="ghost"?t.push("noborder"):this.btype==="plink"?t.push("esg-pcolor-fc"):this.btype==="error"&&t.push("esg-btn-error"):t.push("esg-btn-primary"),this.buttonStyle==="link"&&t.push("link-btn"),this.disabled&&t.push("disabled"),t},getBtnStyle(){return null}}},iy={class:"loader"};function ly(t,r,n,o,a,i){const l=e.resolveComponent("AtomLoader");return e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.tag),e.mergeProps(t.$attrs,{type:n.method,class:["rectangle-button ect-uppercase ect-whitespace-nowrap",i.getBtnClass()],style:i.getBtnStyle(),onClick:r[0]||(r[0]=e.withModifiers(s=>t.$emit("clicked"),["prevent"]))}),{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass({"text-loading":n.loading})},[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.text),1)],!0)],2),e.createElementVNode("span",iy,[n.loading?(e.openBlock(),e.createBlock(l,{key:0})):e.createCommentVNode("",!0)])]),_:3},16,["type","class","style"])}const qc=ve(ay,[["render",ly],["__scopeId","data-v-ae1df853"]]),sy={components:{AppTooltip:ws,AppIcon:Be},props:{label:{type:String,default:""},modelValue:{type:Boolean,default:!1},partial:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},info:{type:String,default:null},dataTestId:{type:String,default:""}},emits:["update:modelValue"],methods:{toggleChecked(){this.disabled||this.$emit("update:modelValue",!this.modelValue)}}},$c=t=>(e.pushScopeId("data-v-888eb5f4"),t=t(),e.popScopeId(),t),cy=["data-test-id"],uy=["data-test-id"],dy={key:0,width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fy=[$c(()=>e.createElementVNode("g",{id:"minus"},[e.createElementVNode("path",{id:"Icon",d:"M3 6H10",stroke:"white","stroke-width":"1.66666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],hy={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},py=[$c(()=>e.createElementVNode("g",{id:"check"},[e.createElementVNode("path",{id:"Icon",d:"M10 3L4.5 8.5L2 6",stroke:"white","stroke-width":"1.6666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],my=["data-test-id"];function yy(t,r,n,o,a,i){const l=e.resolveComponent("AppIcon"),s=e.resolveComponent("AppTooltip");return e.openBlock(),e.createElementBlock("div",{class:"checkbox","data-test-id":n.dataTestId,onClick:r[0]||(r[0]=(...u)=>i.toggleChecked&&i.toggleChecked(...u))},[e.createElementVNode("div",{class:e.normalizeClass(["checkmark",{checked:n.modelValue&&!n.partial&&!n.disabled,disabled:n.disabled,partial:n.partial}]),"data-test-id":`${n.dataTestId}-checkmark`},[n.partial?(e.openBlock(),e.createElementBlock("svg",dy,fy)):n.modelValue?(e.openBlock(),e.createElementBlock("svg",hy,py)):e.createCommentVNode("",!0)],10,uy),n.label?(e.openBlock(),e.createElementBlock("div",{key:0,class:"label","data-test-id":`${n.dataTestId}-label`},e.toDisplayString(n.label),9,my)):e.createCommentVNode("",!0),n.info?(e.openBlock(),e.createBlock(s,{key:1,direction:"top",content:n.info,width:100,"data-test-id":`${n.dataTestId}-info-tooltip`},{default:e.withCtx(()=>[e.createVNode(l,{class:"ect-text-primary ect-pt-2 ect-pl-4",icon:"info","data-test-id":`${n.dataTestId}-info-icon`},null,8,["data-test-id"])]),_:1},8,["content","data-test-id"])):e.createCommentVNode("",!0)],8,cy)}const Er=ve(sy,[["render",yy],["__scopeId","data-v-888eb5f4"]]),gy={class:"m-content"},by={key:0,class:"attribute-input"},xy={key:1,class:"attribute-lookup"},_y={class:"attribute-lookup-main"},Cy={key:1},Ey={key:2,class:"attribute-input"},ky={key:2},vy={class:"m-footer"},Ay=ve({__name:"MoleculeAttributeModal",props:{data:{type:Object,default:()=>({})},quoteId:{type:String,default:""}},emits:["close","update","reload"],setup(t,{emit:r}){const n=Nn(),o=t,a=r,i=e.ref([]),l=e.ref([]),s=e.ref({}),u=e.ref(!1);async function h(){u.value=!0;const f=[{fieldName:"Id",fieldValue:o.quoteId}];l.value.forEach(p=>{if(p.editable&&!p.apiName.includes(".")){let x=p.apiName;p.dataType==="REFERENCE"?(x=p.apiName.replace("__r","__c"),f.push({fieldName:x,fieldValue:p.referenceRecordId})):f.push({fieldName:x,fieldValue:p.value})}});const b={fields:f,objectType:"XX_ORD1__Quote_Line_Item__c"};console.log(b),await n.updateRecord(b),d(),a("reload",o.quoteId),a("close"),u.value=!1}function d(){const f={},b={};i.value.forEach(p=>{p.dataType==="REFERENCE"&&(b[p.apiName]=p.referenceRecordId),f[p.apiName]=p.value}),o.data.forEach(p=>{p.dataType==="REFERENCE"&&(p.referenceRecordId=b[p.apiName]),p.value=f[p.apiName]})}function m(f,b){if(f){const p=i.value.find(g=>g.label===b.firstLookup.replace("Copy from ",""));console.log("Parent",p);const x={};p.relatedFields.forEach(g=>{x[g.child]=g.value}),p&&(b.referenceRecordId=p.referenceRecordId,b.value=p.value,b.options=p.options,b.relatedFields.forEach(g=>{g.value=x[g.child]}))}else b.referenceRecordId=null,b.options=[],b.relatedFields.forEach(p=>{p.value=null})}function c(f,b){console.log(f,b);const p=b.options.find(x=>x.Id===f);f===null?(b.options=[],b.value=null,b.relatedFields.forEach(x=>{x.value=null})):(b.value=p.Name,b.relatedFields.forEach(x=>{x.value=p[x.child]}))}const y=St(async function(f,b){b.loading=!0;const p={lookupObjectApiName:b.referenceObject,searchTerm:f||"",fields:s.value[b.apiName]||[]},x=await n.getLookupRecords(p);console.log(x),b.options=x,b.loading=!1});return e.onBeforeMount(()=>{const f={};i.value=JSON.parse(JSON.stringify(o.data)),i.value.forEach(p=>{p.dataType==="REFERENCE"&&(s.value[p.apiName]=[],p.relatedFields=[],f[p.apiName]=p,p.options=[{Name:p.value||"",Id:p.referenceRecordId}]),p.editable=p.editable&&!p.apiName.includes(".")});let b=null;i.value.forEach(p=>{if(p.referenceObject==="XX_Base__Location__c"&&(b?p.firstLookup="Copy from "+b.label:b=p),p.apiName.includes(".")){const[x,g]=p.apiName.split(".");p.parent=x,p.child=g,s.value[x]!=null&&(s.value[x].push(g),f[x].relatedFields.push(p))}}),l.value=i.value.filter(p=>!p.apiName.includes(".")),console.log(l.value,f)}),(f,b)=>(e.openBlock(),e.createBlock(ty,{title:"Modify attributes",onClicked:b[1]||(b[1]=p=>f.$emit("close"))},{content:e.withCtx(()=>[e.createElementVNode("div",gy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(p,x)=>{var g;return e.openBlock(),e.createElementBlock(e.Fragment,{key:x},[p.firstLookup?(e.openBlock(),e.createElementBlock("div",by,[e.createElementVNode("label",null,e.toDisplayString(p.firstLookup),1),e.createVNode(Er,{modelValue:p.same,"onUpdate:modelValue":[C=>p.same=C,C=>m(C,p)],class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0),p.dataType==="REFERENCE"&&((g=p.relatedFields)==null?void 0:g.length)>0?(e.openBlock(),e.createElementBlock("div",xy,[e.createElementVNode("div",_y,[e.createVNode(rn,{modelValue:p.referenceRecordId,"onUpdate:modelValue":[C=>p.referenceRecordId=C,C=>c(C,p)],label:p.label,disabled:!p.editable||p.same,options:p.options,lookup:"",search:"",highlight:"",loading:p.loading,property:{key:"Id",value:"Name"},onSearch:C=>e.unref(y)(C,p)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.relatedFields,(C,_)=>(e.openBlock(),e.createElementBlock("div",{key:_,class:"attribute-input"},[C.dataType==="PICKLIST"||C.dataType==="MULTIPICKLIST"?(e.openBlock(),e.createBlock(rn,{key:0,modelValue:C.value,"onUpdate:modelValue":E=>C.value=E,label:C.label,disabled:!C.editable,options:C.picklistValues.map(E=>({label:E,value:E})),select:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):C.dataType==="BOOLEAN"?(e.openBlock(),e.createElementBlock("div",Cy,[e.createElementVNode("label",null,e.toDisplayString(C.label),1),e.createVNode(Er,{modelValue:C.value,"onUpdate:modelValue":E=>C.value=E,disabled:!C.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(e.openBlock(),e.createBlock(Rn,{key:2,label:C.label,disabled:!C.editable,modelValue:C.value,"onUpdate:modelValue":E=>C.value=E,class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))),128))])):(e.openBlock(),e.createElementBlock("div",Ey,[p.dataType==="REFERENCE"?(e.openBlock(),e.createBlock(rn,{key:0,modelValue:p.referenceRecordId,"onUpdate:modelValue":[C=>p.referenceRecordId=C,C=>c(C,p)],label:p.label,disabled:!p.editable,options:p.options,lookup:"",search:"",highlight:"",loading:p.loading,property:{key:"Id",value:"Name"},onSearch:C=>e.unref(y)(C,p)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])):p.dataType==="PICKLIST"||p.dataType==="MULTIPICKLIST"?(e.openBlock(),e.createBlock(rn,{key:1,modelValue:p.value,"onUpdate:modelValue":C=>p.value=C,label:p.label,disabled:!p.editable,options:p.picklistValues.map(C=>({label:C,value:C})),select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):p.dataType==="BOOLEAN"?(e.openBlock(),e.createElementBlock("div",ky,[e.createElementVNode("label",null,e.toDisplayString(p.label),1),e.createVNode(Er,{modelValue:p.value,"onUpdate:modelValue":C=>p.value=C,disabled:!p.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(e.openBlock(),e.createBlock(Rn,{key:3,label:p.label,disabled:!p.editable,modelValue:p.value,"onUpdate:modelValue":C=>p.value=C,highlight:"",class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))],64)}),128))])]),action:e.withCtx(()=>[e.createElementVNode("div",vy,[e.createVNode(qc,{text:"CANCEL",btype:"secondary",onClick:b[0]||(b[0]=p=>f.$emit("close"))}),e.createVNode(qc,{text:"SAVE",btype:"primary",loading:u.value,onClick:h},null,8,["loading"])])]),_:1}))}},[["__scopeId","data-v-d0648f18"]]),wy={class:"datatable"},Ny={class:"m-show"},Sy={key:0},By=["onClick"],Iy={key:1},Ty=["data-test-id","onClick"],Oy={class:"desktop d-show"},Dy={class:"datatable-skeletion"},Vy={class:"datatable-skeletion"},Fy={class:"datatable-skeletion"},My=["colspan"],Ry={style:{display:"flex",gap:"1rem",height:"40px"}},Ly=["onClick"],Py=["data-test-id","onClick"],qy={key:0},$y=["colspan"],Uy={style:{display:"flex",gap:"1rem",height:"40px"}},zy={key:1},jy=["colspan"],Hy={style:{display:"flex","flex-wrap":"wrap",padding:"1rem"}},Gy={key:0,class:"attribute",style:{width:"50%"}},Ky={key:0,class:"ect-flex ect-gap-2"},Xy={key:1,class:"ect-flex ect-gap-2"},Wy={key:1,class:"attribute",style:{width:"50%"}},Qy={key:0},Zy={key:2,class:"attribute",style:{width:"50%"}},Jy={key:0},Yy={key:1},kr=ve({__name:"MoleculeDataTable",props:{rows:{type:Array,default:()=>[]},cols:{type:Array,default:()=>[]},loading:{type:Array,default:()=>[]},style:{type:Object,default:()=>({})},delRecords:{type:Set,default:()=>new Set},rowLoading:{type:Boolean,default:!1},loadingRowId:{type:String,default:null},del:{type:Boolean,default:!1},configure:{type:Boolean,default:!1},hidecolumn:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},isOption:{type:Boolean,default:!1},attribute:{type:[Object,Boolean],default:()=>({})}},emits:["delete","update","configure","reload"],setup(t,{emit:r}){const n=t,o=e.ref(null),a=e.ref(null),i=r,l=e.ref(null),s=e.ref({}),u=e.ref(null),h=e.computed(()=>n.disabled),d=function(_,E){return l.value&&l.value!==_+":"+E||n.delRecords.has(_)||h.value||u.value&&u.value!==_},m=e.computed(()=>{const{headerStyle:_,optionRow:E,productRow:A}=n.style;return{product:{backgroundColor:A.background,verticalAlign:A.verticalAlignment||"middle"},option:{backgroundColor:E.background,verticalAlign:E.verticalAlignment||"middle"},header:{backgroundColor:_.background,verticalAlign:_.verticalAlignment||"middle"}}}),c=e.computed(()=>{const{headerStyle:_,optionRow:E,productRow:A}=n.style;return{header:_.style||{},option:E.style||{},product:A.style||{}}}),y=e.computed(()=>200/n.cols.length+"px");function f(_,E,A){const k={},{table:B}=n.style;if(_){const{alignment:D,strikethrough:w}=_;D&&(k.textAlign=D),w&&(k.textDecoration="line-through")}if(E){const{width:D,minWidth:w}=E;D&&(k.width=`calc(${D.value+D.unit} - ${y.value})`),w&&(k.minWidth=w.value+w.unit)}return B.border!=="n"&&!A?(k.borderStyle="solid",k.borderColor=B.color,B.border==="b"?k.borderWidth=B.width:B.border==="x"?(k.borderTopWidth=B.width,k.borderBottomWidth=B.width,k.borderLeftWidth=0,k.borderRightWidth=0):B.border==="y"?(k.borderLeftWidth=B.width,k.borderRightWidth=B.width,k.borderTopWidth=0,k.borderBottomWidth=0):B.border==="bottom"||B.border==="default"?(k.borderTopWidth=0,k.borderBottomWidth=B.width,k.borderLeftWidth=0,k.borderRightWidth=0):B.border==="top"&&(k.borderTopWidth=B.width,k.borderBottomWidth=0,k.borderLeftWidth=0,k.borderRightWidth=0)):k.borderWidth="0px",k}function b(_,E){var k;if(E.dataType==="REFERENCE")return(k=_[E.content.replace("__c","__r")])==null?void 0:k.Name;const A=We(_,E.api,E.dataType);return A===""?A:E.dataType==="PERCENT"?A+"%":A}function p(_,E){_===0?i("delete",E):x(_,"XX_ORD1__QTY__c",E)}function x(_,E,A){u.value=A.Id,g(_,E,A)}const g=St(function(_,E,A){l.value=A.Id+":"+E,s.value.Id=A.Id,s.value[E]=_;const k=()=>{l.value=null,s.value={},u.value=null};i("update",{record:s.value,callback:k})},500),C=_=>_.content.picklist.map(E=>({label:E,value:E}));return(_,E)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o.value&&a.value?(e.openBlock(),e.createBlock(Ay,{key:0,data:o.value,"quote-id":a.value,onClose:E[0]||(E[0]=A=>(o.value=null,a.value=null)),onReload:E[1]||(E[1]=A=>_.$emit("reload",A))},null,8,["data","quote-id"])):e.createCommentVNode("",!0),e.createElementVNode("div",wy,[e.createElementVNode("div",Ny,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,A=>(e.openBlock(),e.createElementBlock("table",{key:A.Id,class:"mobile md:ect-hidden"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,(k,B)=>{var D,w,v,S;return e.openBlock(),e.createElementBlock("tr",{key:B},[e.createElementVNode("th",{style:e.normalizeStyle({...f(k.header.style),...m.value.header})},[k.header?(e.openBlock(),e.createBlock(Re,{key:0,text:k.header.title,style:e.normalizeStyle(k.header.style),"sec-style":c.value.header},null,8,["text","style","sec-style"])):e.createCommentVNode("",!0)],4),e.createElementVNode("td",{style:e.normalizeStyle({...f(k.content.style),...m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"]})},[k.editable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[k.api==="XX_ORD1__QTY__c"?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>p(I,A)],disabled:d(A.Id,k.api),loading:A.Id+":"+k.api===l.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):k.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(rn,{key:1,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),options:C(k),"use-fixed-position":!0,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(e.openBlock(),e.createBlock(Rn,{key:2,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[k.dataType==="URL"?(e.openBlock(),e.createBlock(bi,{key:0,src:b(A,k)},null,8,["src"])):k.content.isStatic?(e.openBlock(),e.createBlock(Re,{key:1,tag:(D=k.content)==null?void 0:D.style.tag,text:k.content.content,style:e.normalizeStyle((w=k.content)==null?void 0:w.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["tag","text","style","sec-style"])):(e.openBlock(),e.createBlock(Re,{key:2,loading:t.loading.includes(k.dataType)&&(!t.loadingRowId||t.loadingRowId===A.Id),tag:(v=k.content)==null?void 0:v.style.tag,text:b(A,k),style:e.normalizeStyle((S=k.content)==null?void 0:S.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],4)])}),128)),t.del?(e.openBlock(),e.createElementBlock("tr",Sy,[e.createElementVNode("th",{style:e.normalizeStyle({...f(),...m.value.header})},null,4),e.createElementVNode("td",{style:e.normalizeStyle({...f(),...m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"]})},[e.createElementVNode("span",{class:e.normalizeClass(["datatable-remove",{disabled:d(A.Id)}]),onClick:k=>!d(A.Id)&&_.$emit("delete",A)},"REMOVE",10,By)],4)])):e.createCommentVNode("",!0),t.configure&&e.unref(di).includes(A.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(e.openBlock(),e.createElementBlock("tr",Iy,[e.createElementVNode("th",{style:e.normalizeStyle({...f(),...m.value.header})},null,4),e.createElementVNode("td",{style:e.normalizeStyle({...f(),...m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"]})},[e.createElementVNode("div",{class:e.normalizeClass(["datatable-configure",{disabled:d(A.Id)}]),"data-test-id":`expeditecart-list-button-configure-${A.Id}`,onClick:k=>!d(A.Id)&&_.$emit("configure",A)},"CONFIGURE",10,Ty)],4)])):e.createCommentVNode("",!0)]))),128))]),e.createElementVNode("table",Oy,[t.hidecolumn?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,style:e.normalizeStyle(m.value.header)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,A=>{var k;return e.openBlock(),e.createElementBlock("th",{key:A.key,style:e.normalizeStyle(f((k=A.header)==null?void 0:k.style,A.style))},[A.header?(e.openBlock(),e.createBlock(Re,{key:0,text:A.header.title,style:e.normalizeStyle(A.header.style),"sec-style":c.value.header},null,8,["text","style","sec-style"])):e.createCommentVNode("",!0)],4)}),128)),t.del?(e.openBlock(),e.createElementBlock("th",{key:0,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},null,4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("th",{key:1,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},null,4)):e.createCommentVNode("",!0)],4)),t.rowLoading?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},e.renderList(5,A=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:A},[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,k=>(e.openBlock(),e.createElementBlock("td",{key:k.key,style:e.normalizeStyle(f(k.content.style,k.style))},[e.createElementVNode("div",Dy,[e.createVNode(yn)])],4))),128)),t.del?(e.openBlock(),e.createElementBlock("td",{key:0,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},[e.createElementVNode("div",Vy,[e.createVNode(yn)])],4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("th",{key:1,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},[e.createElementVNode("div",Fy,[e.createVNode(yn)])],4)):e.createCommentVNode("",!0)]),t.attribute?(e.openBlock(),e.createElementBlock("td",{key:0,colspan:t.cols.length+2,style:e.normalizeStyle(f())},[e.createElementVNode("div",Ry,[e.createVNode(yn),e.createVNode(yn)])],12,My)):e.createCommentVNode("",!0)],64))),64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(t.rows,A=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:A.Id},[e.createElementVNode("tr",{style:e.normalizeStyle(m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,(k,B)=>{var D,w,v,S;return e.openBlock(),e.createElementBlock("td",{key:B,style:e.normalizeStyle(f(k.content.style,k.style,!!A.Attributes)),class:e.normalizeClass({"padding-left":B==0&&A.XX_ORD1__Parent_QLI__c})},[k.editable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[k.api==="XX_ORD1__QTY__c"?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>p(I,A)],disabled:d(A.Id,k.api),loading:A.Id+":"+k.api===l.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):k.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(rn,{key:1,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),options:C(k),"use-fixed-position":!0,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(e.openBlock(),e.createBlock(Rn,{key:2,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[k.dataType==="URL"?(e.openBlock(),e.createBlock(bi,{key:0,src:b(A,k)},null,8,["src"])):k.content.isStatic?(e.openBlock(),e.createBlock(Re,{key:1,tag:(D=k.content)==null?void 0:D.style.tag,text:k.content.content,style:e.normalizeStyle((w=k.content)==null?void 0:w.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["tag","text","style","sec-style"])):(e.openBlock(),e.createBlock(Re,{key:2,loading:t.loading.includes(k.dataType)&&(!t.loadingRowId||t.loadingRowId===A.Id),tag:(v=k.content)==null?void 0:v.style.tag,text:b(A,k),style:e.normalizeStyle((S=k.content)==null?void 0:S.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],6)}),128)),t.del?(e.openBlock(),e.createElementBlock("td",{key:0,style:e.normalizeStyle({...f(null,null,!!A.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[e.createElementVNode("span",{class:e.normalizeClass(["datatable-remove",{disabled:d(A.Id)}]),onClick:k=>!d(A.Id)&&_.$emit("delete",A)},"REMOVE",10,Ly)],4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("td",{key:1,style:e.normalizeStyle({...f(null,null,!!A.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[e.unref(di).includes(A.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["datatable-configure",{disabled:d(A.Id)}]),"data-test-id":`expeditecart-list-button-configure-${A.Id}`,onClick:k=>!d(A.Id)&&_.$emit("configure",A)}," CONFIGURE ",10,Py)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],4),A.attributesLoading?(e.openBlock(),e.createElementBlock("tr",qy,[e.createElementVNode("td",{colspan:t.cols.length+2,style:e.normalizeStyle(f())},[e.createElementVNode("div",Uy,[e.createVNode(yn),e.createVNode(yn)])],12,$y)])):A.Attributes?(e.openBlock(),e.createElementBlock("tr",zy,[e.createElementVNode("td",{colspan:t.cols.length+2,style:e.normalizeStyle(f())},[e.createElementVNode("div",Hy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.Attributes,(k,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B},[k.value||k.existingValue||k.existingValueReferenceName?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[k.value&&(k.existingValue||k.existingValueReferenceName)?(e.openBlock(),e.createElementBlock("div",Gy,[e.createElementVNode("b",null,e.toDisplayString(k.label)+":",1),k.value!==k.existingValue&&k.value!==k.existingValueReferenceName?(e.openBlock(),e.createElementBlock("div",Ky,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"]),e.createVNode(Re,{text:k.existingValueReferenceName||k.existingValue,style:e.normalizeStyle(t.attribute.old.style)},null,8,["text","style"])])):(e.openBlock(),e.createElementBlock("div",Xy,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.regular.style)},null,8,["text","style"])])),t.attribute.edit&&k.editable&&A.XX_ORD1__QLI_Type__c!=="Remove"?(e.openBlock(),e.createBlock(Cr,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(o.value=A.Attributes,a.value=A.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)])):k.value?(e.openBlock(),e.createElementBlock("div",Wy,[e.createElementVNode("b",null,e.toDisplayString(k.label)+":",1),k.value?(e.openBlock(),e.createElementBlock("div",Qy,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"])])):e.createCommentVNode("",!0),t.attribute.edit&&k.editable?(e.openBlock(),e.createBlock(Cr,{key:1,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(o.value=A.Attributes,a.value=A.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)])):t.attribute.displayonlychanged?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Zy,[e.createElementVNode("b",null,e.toDisplayString(k.label)+":",1),k.value?(e.openBlock(),e.createElementBlock("div",Jy,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"])])):k.existingValue?(e.openBlock(),e.createElementBlock("div",Yy,[e.createVNode(Re,{text:k.existingValueReferenceName||k.existingValue,style:e.normalizeStyle(t.attribute.regular.style)},null,8,["text","style"])])):e.createCommentVNode("",!0),t.attribute.edit&&k.editable?(e.openBlock(),e.createBlock(Cr,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(o.value=A.Attributes,a.value=A.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)]))],64)):e.createCommentVNode("",!0)],64))),128))])],12,jy)])):e.createCommentVNode("",!0)],64))),128))])])],64))}},[["__scopeId","data-v-3b714a31"]]),eg={key:0,class:"prodlist"},tg={class:"prodlist-header"},ng={key:0},og={key:1,class:"summary"},rg={key:1,class:"summary"},ag=ve({__name:"OrganismsProductListBlock",props:{header:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},footer:{type:Array,default:()=>[]},configuration:{type:Object,default:()=>({})},fields:{type:Object,default:()=>({})},id:{type:String,required:!1},isPreview:{type:Boolean,default:!1}},emits:["counts"],setup(t,{emit:r}){const n=Nn(),o=mn(),a=t,i=r,l=T=>T.toUpperCase()||"",s=e.computed(()=>{var T;return((T=a.fields)==null?void 0:T.styling)||{}}),u=e.computed(()=>{var T,O;return(O=(T=a.configuration)==null?void 0:T.allowedActions)==null?void 0:O.delete}),h=e.computed(()=>{var T,O;return(O=(T=a.configuration)==null?void 0:T.allowedActions)==null?void 0:O.configure}),d=e.computed(()=>{var T;return a.configuration.displayAttributes?(T=a.configuration)==null?void 0:T.attribute:!1}),m=e.computed(()=>{var T;return(T=a.configuration)==null?void 0:T.sort}),c=e.computed(()=>{var T;return(T=a.configuration)==null?void 0:T.group}),y=e.computed(()=>{const T=c.value.groupheader.style;return T?I(T):{}}),f=e.computed(()=>{const T=c.value.groupfooter.style;return T?I(T):{}}),b=e.computed(()=>{const T={},{border:O,color:F,width:q}=s.value.table;return O==="default"&&(T.borderStyle="solid",T.borderColor=F,T.borderWidth=q,T.borderTopWidth=0),T}),p=e.computed(()=>B.value?!1:!v.value||v.value.length===0?!0:v.value.every(T=>{const O=T.rows&&T.rows.length>0,F=T.options&&T.options.some(q=>q.rows&&q.rows.length>0);return!O&&!F}));Ko();const x=["CURRENCY","DOUBLE","PERCENT"],g=["CURRENCY","DOUBLE","PERCENT","DATE","DATETIME","TIME","BOOLEAN","STRING","TEXTAREA","REFERENCE","EMAIL","PHONE","URL","TEXTAREA","TEXTAREA"],C=e.ref(null),_=e.ref([]),E=e.ref([]),A=e.ref([]),k=e.ref(!1),B=e.ref(!1),D=e.ref(new Set),w=e.ref([]),v=e.ref([]),S=new Map;function I(T){let O={padding:"1.25rem 2rem"};const{overrite:F,backgroundColor:q,verticalAlignment:M,padding:U}=T;return F&&(O={backgroundColor:q,verticalAlign:M,padding:U||"1.25rem 2rem"}),O}const R=async function({record:T,callback:O}){const F=[];for(const M in T)F.push({fieldName:M,fieldValue:T[M]});const q={fields:F,objectType:a.configuration.objectType};await n.updateRecord(q),O(),T.XX_ORD1__QTY__c!==void 0&&(C.value=T.Id,await W("FIELD_RELOAD"),C.value=null)};async function z(T){C.value=T,await W("RELOAD_ALL_FIELDS"),C.value=null}const $=T=>{Et("expeditecart:configure-clicked",{itemId:T.XX_ORD1__Item__c,lineItemId:T.Id,quoteId:n.quoteId,isPreview:a.isPreview})},X=async function(T){D.value.add(T.Id),k.value=!0;const O=[T.Id];await o.deleteLineItems(O),await W("RELOAD"),k.value=!1,D.value.delete(T.Id)};async function W(T){T==="RELOAD"?B.value=!0:T==="FIELD_RELOAD"?A.value=x:T==="RELOAD_ALL_FIELDS"&&(A.value=g);const{groupby:O,grouplevel:F}=a.configuration.group,q=n.quoteId,M=a.footer.map(H=>({field:H.field,snippet:H.function||"SUM"})),U={filterObject:a.configuration.objectType,fieldsToDisplay:[...E.value,"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c","XX_ORD1__Parent_QLI__c"],aggregateFields:M,filters:a.configuration.filters,parentObjectField:a.configuration.parentObjectField,objectId:q,groupby:O.field,grouplevel:F,primarysort:m.value.primary.field,secondarysort:m.value.secondary.field,primarysortdesc:m.value.primary.direction!=="asc",secondarysortdesc:m.value.secondary.direction!=="asc",filterlogic:a.configuration.filterlogic},L=O.field&&F,j=await n.getRowItems(U,L);L?N(j,F):P(j),a.configuration.displayAttributes&&K(),B.value=!1,A.value=[]}async function K(){const T=C.value,O=[];v.value.forEach(q=>{q.rows.forEach(M=>{M.attributes=S.get(M.Id),console.log("row.attributes",M.attributes),T?M.Attributes=S.get(M.Id):M.attributesLoading=!0,O.push(M.Id)})});const F=await n.getLineItemAttributesNG(O);v.value.forEach(q=>{q.rows.forEach(M=>{const U=F[M.Id];if(U==null?void 0:U.some(j=>j.value&&!d.value.displayonlychanged||j.value&&j.existingValue&&d.value.displayonlychanged)){const j=[],H=new Set;U.forEach(Z=>{H.has(Z.apiName)||(H.add(Z.apiName),j.push(Z))}),M.Attributes=j,S.set(M.Id,j)}M.attributesLoading=!1})}),console.log("attributesByIdMap",S)}function P(T){var M;const O=T.lstRecords,F=[],q=T.lstRecords&&((M=T.lstRecords)==null?void 0:M.length)>0;if(i("counts",q),T.lstAggregateField&&T.lstAggregateField.length>0){const U=new Map;T.lstAggregateField.forEach(L=>{U.set(L.fieldName,L.totalValue)}),a.footer.forEach(L=>{L.value=U.get(L.field),F.push(L)})}v.value=[{rows:O,summary:F}]}function N(T,O){const F=[];let q;T.forEach(M=>{var U;if(O==="option"){if((U=M.product)!=null&&U.thisobject){const L={name:"",rows:[M.product.thisobject],summary:[],isProduct:!0,options:[]};M.options.length>0&&M.options.forEach(j=>{const H={name:j.groupName,rows:[]},Z=[];j.options.forEach(te=>{H.rows.push(te.thisobject)}),j.groupTotals&&j.groupTotals.length>0&&j.groupTotals.forEach(te=>{var ne,Q;Z.push({label:H.name,value:te.amount,style:((Q=(ne=c.value)==null?void 0:ne.groupfooter)==null?void 0:Q.style)||{}})}),H.summary=Z,L.options.push(H)}),F.push(L)}}else{if(q={name:M.groupName,rows:[]},M.productRows.forEach(L=>{q.rows.push(L[O].thisobject),L.options.forEach(j=>{const H={...j.thisobject};H.isOption=!0,q.rows.push(H)})}),c.value.displaygroupfooter){const L=[];M.groupTotals&&M.groupTotals.length>0&&M.groupTotals.forEach(j=>{var H,Z;L.push({label:q.name,value:j.amount,style:((Z=(H=c.value)==null?void 0:H.groupfooter)==null?void 0:Z.style)||{}})}),q.summary=L}else q.summary=[];F.push(q)}}),v.value=F}return e.onBeforeMount(()=>{console.log("Product List - Block Before Mount"),w.value=JSON.parse(JSON.stringify(a.columns)),_.value=a.summary,w.value.forEach(T=>{T.content.dataType=l(T.content.dataType),T.editby=T.editable,T.editable=T.editable!=="not",T.dataType=T.content.dataType,T.api=T.content.field,E.value.push(T.content.field)}),E.value.includes("XX_ORD1__QLI_Type__c")||E.value.push("XX_ORD1__QLI_Type__c"),W("RELOAD")}),(T,O)=>{var F;return p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",eg,[e.createElementVNode("div",tg,[t.header.title?(e.openBlock(),e.createBlock(Re,{key:0,tag:(F=t.header.style)==null?void 0:F.tag,text:t.header.title,style:e.normalizeStyle(t.header.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0)]),!c.value.repeatcolumheadings||B.value?(e.openBlock(),e.createElementBlock("div",ng,[e.createVNode(kr,{cols:w.value,rows:[],summary:[],style:e.normalizeStyle(s.value),loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[0]||(O[0]=q=>z(q))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])])):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(b.value)},[e.createVNode(kr,{hidecolumn:"",cols:w.value,rows:[],summary:[],style:e.normalizeStyle(s.value),"row-loading":!0,loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[1]||(O[1]=q=>z(q))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])],4)):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(b.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,q=>(e.openBlock(),e.createElementBlock("div",{key:q.name,class:e.normalizeClass(["productlist",q.isProduct?"prodlist-product":"prodlist-option"])},[c.value.displaygroupheader&&q.name?(e.openBlock(),e.createElementBlock("div",{key:0,class:"groupHeader",style:e.normalizeStyle(y.value)},[e.createVNode(Re,{text:"Group: "+q.name,style:e.normalizeStyle(c.value.groupheader.style)},null,8,["text","style"])],4)):e.createCommentVNode("",!0),e.createVNode(kr,{hidecolumn:!c.value.repeatcolumheadings,cols:w.value,rows:q.rows,style:e.normalizeStyle(s.value),"row-loading":B.value,loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[2]||(O[2]=M=>z(M))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),q.summary.length>0?(e.openBlock(),e.createElementBlock("div",og,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.summary,(M,U)=>{var L,j,H;return e.openBlock(),e.createElementBlock("div",{key:U,class:"summary_row",style:e.normalizeStyle(f.value)},[e.createVNode(Re,{tag:(L=M==null?void 0:M.style)==null?void 0:L.tag,text:M.label+" : ",style:e.normalizeStyle(M==null?void 0:M.style)},null,8,["tag","text","style"]),e.createTextVNode("   "),e.createVNode(Re,{loading:((j=A.value)==null?void 0:j.length)>0||B.value,tag:(H=M==null?void 0:M.style)==null?void 0:H.tag,text:M.value,style:e.normalizeStyle(M==null?void 0:M.style)},null,8,["loading","tag","text","style"])],4)}),128))])):e.createCommentVNode("",!0),q.options?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(q.options,M=>(e.openBlock(),e.createElementBlock("div",{key:M.name},[c.value.displaygroupheader&&M.name?(e.openBlock(),e.createElementBlock("div",{key:0,class:"groupHeader",style:e.normalizeStyle(y.value)},[e.createVNode(Re,{text:"Group: "+M.name,style:e.normalizeStyle(c.value.groupheader.style)},null,8,["text","style"])],4)):e.createCommentVNode("",!0),e.createVNode(kr,{hidecolumn:!c.value.repeatcolumheadings,cols:w.value,rows:M.rows,style:e.normalizeStyle(s.value),"row-loading":B.value,loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,"is-option":!0,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[3]||(O[3]=U=>z(U))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),M.summary.length>0?(e.openBlock(),e.createElementBlock("div",rg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.summary,(U,L)=>{var j,H,Z;return e.openBlock(),e.createElementBlock("div",{key:L,class:"summary_row",style:e.normalizeStyle(f.value)},[e.createVNode(Re,{tag:(j=U==null?void 0:U.style)==null?void 0:j.tag,text:U.label+" : ",style:e.normalizeStyle(U==null?void 0:U.style)},null,8,["tag","text","style"]),e.createTextVNode("   "),e.createVNode(Re,{loading:((H=A.value)==null?void 0:H.length)>0||B.value,tag:(Z=U==null?void 0:U.style)==null?void 0:Z.tag,text:U.value,style:e.normalizeStyle(U==null?void 0:U.style)},null,8,["loading","tag","text","style"])],4)}),128))])):e.createCommentVNode("",!0)]))),128)):e.createCommentVNode("",!0)],2))),128))],4))]))}}},[["__scopeId","data-v-d933d5c5"]]),ig={class:"detail-section"},lg={key:0,class:"selectedtext sm:hidden"},sg={class:"expand material-icons-outlined"},cg={key:1,class:"detail-section_title"},ug={key:2,class:"detail-section_slot"},dg=ve({__name:"AtomDetailSection",props:{title:{type:String,required:!0},style:{type:Object,default:()=>({})},expand:{type:Boolean,default:!1},header:{type:Boolean,default:!1},selectedText:{type:String,default:""},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["expand"],setup(t,{emit:r}){const n=t;return(o,a)=>{var i,l;return e.openBlock(),e.createElementBlock("div",ig,[n.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["detail-section_header ect-border-solid ect-border-border-db",{"ect-border-b-1":n.expand,"ect-border-b-0":!n.expand}]),onClick:a[0]||(a[0]=s=>!n.disabled&&o.$emit("expand",!n.expand))},[n.title?(e.openBlock(),e.createBlock(Re,{key:0,tag:(i=n.style)==null?void 0:i.tag,text:n.title,style:e.normalizeStyle(n.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createBlock(yn,{key:1,type:"accordian-title"})):e.createCommentVNode("",!0),e.createElementVNode("div",null,[n.selectedText?(e.openBlock(),e.createElementBlock("span",lg,e.toDisplayString(n.selectedText),1)):e.createCommentVNode("",!0),e.createElementVNode("span",sg,e.toDisplayString(n.expand?"expand_more":"expand_less"),1)])],2)):(e.openBlock(),e.createElementBlock("div",cg,[t.title?(e.openBlock(),e.createBlock(Re,{key:0,tag:(l=t.style)==null?void 0:l.tag,text:t.title,style:e.normalizeStyle(t.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0)])),n.expand?(e.openBlock(),e.createElementBlock("div",ug,[e.renderSlot(o.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-3796312d"]]);function fg(t,r,n){if(!r)return t;if(n.aliasName)return hg(t,r,n);{const a=r.split(".").reduce((i,l)=>i[l]||"",t)||"";return{original:a,value:a,metadata:n}}}function hg(t,r,n){var l;const o=r.split(".");let a=r;o.length>1&&(a=o.pop(),t=o.reduce((s,u)=>s[u]||{},t));let i=t[n.aliasName]||t[a]||"";return i&&n.dataType&&((l=n.dataType)==null?void 0:l.toUpperCase())==="CURRENCY"&&i.includes("(")&&(i=i.split("(")[0]),{value:i,original:t[a],metadata:n}}function pg(t){let r=t.replace(/[_.]/g,"")+"Formatted";return console.log("aliasName",r),r}const mg={class:"quote-summary"},yg={key:0,class:"qt-smuarry"},gg={class:"summary ect-mt-[1rem] md:ect-mt-[0]"},bg=ve({__name:"OrganismsQuoteSummaryBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},tax:{type:Boolean,default:!1},quoteId:{type:String,default:""}},setup(t){const r=Nn(),n=t,o=xi(),a=e.computed(()=>{var b;return(b=n.fields)==null?void 0:b.header}),i=e.computed(()=>{var b;return(b=n.fields)==null?void 0:b.content}),l=e.computed(()=>{var b;return(b=n.fields)==null?void 0:b.footer}),s=e.ref(!1),u=e.ref(!1),h=e.ref(!1),d=e.ref([]),m=e.ref({}),c=e.computed(()=>{var b,p;return o.isMobile.value&&!s.value&&l.value&&l.value.length>0?`${l.value[0].label} &nbsp;&nbsp;&nbsp;${((b=m.value[l.value[0].field])==null?void 0:b.value)||""}`:(p=a.value)==null?void 0:p.title});async function y(b){console.log("Quote Summary",b),u.value=!0,h.value&&await r.calculateAvaTax();const p=d.value.map(({field:x})=>x);m.value=await r.getRecordFieldValue({recordId:n.quoteId,lstFields:p}),d.value.forEach(({field:x,dataType:g})=>{m.value[x]=fg(m.value,x,{dataType:g,aliasName:pg(x)})}),u.value=!1}const f=()=>{o.isMobile.value?s.value=!s.value:s.value=!0};return e.onMounted(async()=>{var p,x,g,C,_,E,A,k,B;s.value=!o.isMobile.value;const b=(x=(p=document.querySelector(`[page-block-id="${n.id}"]`))==null?void 0:p.parentElement)==null?void 0:x.parentElement;b&&(b.style.display=o.isMobile.value?"none":"block"),h.value=n.tax||((g=i.value)==null?void 0:g.some(({field:D})=>D==="XX_ORD1__Taxes__c")),(n.quoteId||h.value)&&(d.value=(_=(C=n.fields)==null?void 0:C.content)==null?void 0:_.map(({field:D,dataType:w})=>({field:D,dataType:w})),((A=(E=n.fields)==null?void 0:E.footer)==null?void 0:A.length)>0&&((B=(k=n.fields)==null?void 0:k.footer)==null||B.forEach(({field:D,dataType:w})=>d.value.push({field:D,dataType:w}))),y())}),(b,p)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"#qtsummary",disabled:!e.unref(o).isMobile.value},[e.createElementVNode("div",mg,[t.quoteId?(e.openBlock(),e.createElementBlock("div",yg,[e.createVNode(dg,{expand:s.value,title:c.value,style:e.normalizeStyle(a.value.style),header:e.unref(o).isMobile.value,onExpand:p[0]||(p[0]=x=>f())},{default:e.withCtx(()=>[e.createElementVNode("div",gg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,x=>{var g,C,_,E;return e.openBlock(),e.createElementBlock("div",{key:x.field,class:"summary-item"},[x.label?(e.openBlock(),e.createBlock(Re,{key:0,tag:(g=x.style)==null?void 0:g.tag,text:x.label,style:e.normalizeStyle(x.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),(C=m.value[x.field])!=null&&C.value?(e.openBlock(),e.createBlock(Re,{key:1,loading:u.value,tag:(_=x.style)==null?void 0:_.tag,text:(E=m.value[x.field])==null?void 0:E.value,style:e.normalizeStyle(x.style)},null,8,["loading","tag","text","style"])):e.createCommentVNode("",!0)])}),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,x=>{var g,C,_,E;return e.openBlock(),e.createElementBlock("div",{key:x.field,class:"summary-total"},[x.label?(e.openBlock(),e.createBlock(Re,{key:0,tag:(g=x.style)==null?void 0:g.tag,text:x.label,style:e.normalizeStyle(x.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),(C=m.value[x.field])!=null&&C.value?(e.openBlock(),e.createBlock(Re,{key:1,loading:u.value,tag:(_=x.style)==null?void 0:_.tag,text:(E=m.value[x.field])==null?void 0:E.value,style:e.normalizeStyle(x.style)},null,8,["loading","tag","text","style"])):e.createCommentVNode("",!0)])}),128))])]),_:1},8,["expand","title","style","header"])])):e.createCommentVNode("",!0)])],8,["disabled"]))}},[["__scopeId","data-v-0821469a"]]),xg={primary:{bgColor:"#57c046",textColor:"#ffffff"},secondary:{bgColor:"#acacac",textColor:"#ffffff"},secondaryDark:{bgColor:"#5f5f5f",textColor:"#ffffff"},delete:{bgColor:"#ff6a6a",textColor:"#ffffff"},link:{bgColor:"#ffffff",textColor:"#57c046"},ghost:{bgColor:"#ffffff",textColor:"#5f5f5f"}},_g={name:"ThemeAlt",props:{tag:{type:String,default:"button"},text:{type:String,default:"text",required:!0},type:{type:String,default:"text"},method:{type:String,default:"button"},disabled:{type:Boolean,default:!1},showspinner:{type:Boolean,default:!1}},emits:["clicked"],methods:{getBtnClass(){const t=[];return!this.type||!xg[this.type]||this.type==="primary"?t.push("esg-btn-primary"):this.type==="secondary"?t.push("esg-btn-secondary"):(this.type==="link"||this.type==="ghost")&&t.push("noborder"),this.disabled&&t.push("disabled"),t},getBtnStyle(){return null}}},Cg={key:0,class:"ect-flex ect-justify-center"},Eg={key:1};function kg(t,r,n,o,a,i){const l=e.resolveComponent("AtomSpinner");return e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.tag),e.mergeProps(t.$attrs,{type:n.method,class:["rectangle-button",i.getBtnClass()],style:i.getBtnStyle(),onClick:r[0]||(r[0]=e.withModifiers(s=>t.$emit("clicked"),["prevent"]))}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[n.showspinner?(e.openBlock(),e.createElementBlock("div",Cg,[e.createVNode(l,{class:"item-button_spinner"})])):(e.openBlock(),e.createElementBlock("div",Eg,e.toDisplayString(n.text),1))],!0)]),_:3},16,["type","class","style"])}const vr=ve(_g,[["render",kg],["__scopeId","data-v-7428ebd4"]]),vg={class:"promocode-input"},Ag={class:"m-1"},wg=ve({__name:"OrganismsPromoCodeBlock",props:{fields:{type:Object,default:()=>({})},configuration:{type:Object,default:()=>({})},id:{type:String,required:!0},isPreview:{type:Boolean,default:!1}},setup(t){const r=Nn(),n=t,o=e.computed(()=>n.fields.label),a=e.ref(!1),i=e.ref(""),l=e.ref(!1),s=e.ref(!1),u=e.ref(""),h=e.ref(null),d=async()=>{if(n.isPreview)return;l.value=!0,a.value=!0,s.value=!1,await r.getQLIsForPromoCode();const f=await m(!1);f.error||(u.value=f),l.value=!1},m=async f=>{const p=r.qlisList,x=Math.ceil(p.length/50);let g="";for(let C=0;C<x;C++){const _=C*50,E=_+50,A=C===x-1;if(g=await c(p.slice(_,E),A,f),g&&g.error)return s.value=g.error,h.value.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),l.value=!1,f||(a.value=!1,y(!0)),g}return g},c=async(f,b,p)=>await r.applyPromoCodeNG(p?"":i.value,f,b),y=async f=>{if(n.isPreview)return;l.value=!0,await r.getQLIsForPromoCode(),f!==!0&&(s.value=!1);const b=await m(!0);(!b||b&&!b.error)&&f!==!0&&(a.value=!1,u.value="",i.value=""),l.value=!1};return e.onMounted(async()=>{const f=await r.getPromoCodeInfo();console.log("Offer::",f),f!=null&&f.XX_ORD1__Promo_Code__c&&(i.value=f.XX_ORD1__Promo_Code__c,u.value=f.XX_ORD1__Short_Description__c,a.value=!0)}),(f,b)=>{var p,x,g,C,_,E,A;return e.openBlock(),e.createElementBlock("div",{ref_key:"promocodeRef",ref:h,class:"promocode"},[(p=o.value)!=null&&p.title?(e.openBlock(),e.createBlock(Re,{key:0,text:(x=o.value)==null?void 0:x.title,style:e.normalizeStyle((g=o.value)==null?void 0:g.style)},null,8,["text","style"])):e.createCommentVNode("",!0),e.createElementVNode("div",vg,[e.createVNode(Rn,{modelValue:i.value,"onUpdate:modelValue":[b[0]||(b[0]=k=>i.value=k),b[1]||(b[1]=k=>a.value=!1)],class:"promocode-input_box",disabled:a.value||t.isPreview,error:s.value},null,8,["modelValue","disabled","error"]),l.value?(e.openBlock(),e.createBlock(ya,{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.value?(e.openBlock(),e.createBlock(vr,{key:1,theme:(E=t.fields.removeButton)==null?void 0:E.style.theme,disabled:i.value.length<1,text:(A=t.fields.removeButton)==null?void 0:A.title,onClick:y},null,8,["theme","disabled","text"])):(e.openBlock(),e.createBlock(vr,{key:0,theme:(C=t.fields.applyButton)==null?void 0:C.style.theme,disabled:i.value.length<1,text:(_=t.fields.applyButton)==null?void 0:_.title,onClick:d},null,8,["theme","disabled","text"]))],64)),e.createElementVNode("span",Ag,e.toDisplayString(u.value),1)])],512)}}},[["__scopeId","data-v-861bd8dd"]]),Uc={"af-ZA":"yyyy/MM/dd","am-ET":"dd/MM/yyyy","ar-AE":"dd/MM/yyyy","ar-BH":"dd/MM/yyyy","ar-DZ":"dd-MM-yyyy","ar-EG":"dd/MM/yyyy","ar-IQ":"dd/MM/yyyy","ar-JO":"dd/MM/yyyy","ar-KW":"dd/MM/yyyy","ar-LB":"dd/MM/yyyy","ar-LY":"dd/MM/yyyy","ar-MA":"dd-MM-yyyy","ar-OM":"dd/MM/yyyy","ar-QA":"dd/MM/yyyy","ar-SA":"dd/MM/yyyy","ar-SY":"dd/MM/yyyy","ar-TN":"dd-MM-yyyy","ar-YE":"dd/MM/yyyy","arn-CL":"dd-MM-yyyy","as-IN":"dd-MM-yyyy","ba-RU":"dd.MM.yyyy","de-BE":"dd.MM.yyyy","be-BY":"dd.MM.yyyy","bg-BG":"dd.MM.yyyy","bn-BD":"dd-MM-yyyy","bs-BA":"yyyy-MM-dd","bn-IN":"dd-MM-yyyy","bo-CN":"yyyy/MM/dd","br-FR":"dd/MM/yyyy","ca-ES":"dd/MM/yyyy","co-FR":"dd/MM/yyyy","cs-CZ":"dd.MM.yyyy","cy-GB":"dd/MM/yyyy","da-DK":"dd.MM.yyyy","de-AT":"dd.MM.yyyy","de-CH":"dd.MM.yyyy","de-DE":"dd.MM.yyyy","de-LI":"dd.MM.yyyy","de-LU":"dd.MM.yyyy","dsb-DE":"dd.MM.yyyy","dv-MV":"dd/MM/yyyy","el-GR":"dd/MM/yyyy","en-029":"MM/dd/yyyy","en-AU":"dd/MM/yyyy","en-BZ":"dd/MM/yyyy","en-CA":"yyyy-MM-dd","en-GB":"dd/MM/yyyy","en-IE":"dd/MM/yyyy","en-ID":"dd/MM/yyyy","en-IN":"dd/MM/yyyy","lu-CD":"dd/MM/yyyy","en-JM":"dd/MM/yyyy","en-HK":"dd/MM/yyyy","en-MY":"dd/MM/yyyy","en-NZ":"dd/MM/yyyy","en-PH":"MM/dd/yyyy","en-SG":"dd/MM/yyyy","en-TT":"dd/MM/yyyy","en-US":"MM/dd/yyyy","en-ZA":"yyyy/MM/dd","en-ZW":"MM/dd/yyyy","es-AR":"dd/MM/yyyy","es-BO":"dd/MM/yyyy","es-CL":"dd-MM-yyyy","es-CO":"dd/MM/yyyy","es-CR":"dd/MM/yyyy","es-DO":"dd/MM/yyyy","es-EC":"dd/MM/yyyy","es-ES":"dd/MM/yyyy","es-GT":"dd/MM/yyyy","es-HN":"dd/MM/yyyy","es-MX":"dd/MM/yyyy","es-NI":"dd/MM/yyyy","es-PA":"MM/dd/yyyy","es-PE":"dd/MM/yyyy","es-PR":"dd/MM/yyyy","es-PY":"dd/MM/yyyy","es-SV":"dd/MM/yyyy","es-US":"MM/dd/yyyy","es-UY":"dd/MM/yyyy","es-VE":"dd/MM/yyyy","et-EE":"dd.MM.yyyy","eu-ES":"yyyy/MM/dd","fa-IR":"MM/dd/yyyy","fi-FI":"dd.MM.yyyy","fil-PH":"MM/dd/yyyy","fo-FO":"dd-MM-yyyy","fr-BE":"dd/MM/yyyy","fr-CA":"yyyy-MM-dd","fr-CH":"dd.MM.yyyy","fr-FR":"dd/MM/yyyy","fr-LU":"dd/MM/yyyy","fr-MC":"dd/MM/yyyy","fy-NL":"dd-MM-yyyy","ga-IE":"dd/MM/yyyy","gd-GB":"dd/MM/yyyy","gl-ES":"dd/MM/yyyy","gsw-FR":"dd/MM/yyyy","gu-IN":"dd-MM-yyyy","ha-Latn-NG":"dd/MM/yyyy","he-IL":"dd/MM/yyyy","hi-IN":"dd/MM/yyyy","hr-BA":"dd.MM.yyyy.","hr-HR":"dd.MM.yyyy","hsb-DE":"dd.MM.yyyy","hu-HU":"yyyy.MM.dd.","hy-AM":"dd.MM.yyyy","ib-LU":"dd.MM.yyyy","id-ID":"dd/MM/yyyy","ig-NG":"dd/MM/yyyy","ii-CN":"yyyy/MM/dd","in-ID":"dd/MM/yyyy","is-IS":"dd.MM.yyyy","it-CH":"dd.MM.yyyy","it-IT":"dd/MM/yyyy","iu-Cans-CA":"dd/MM/yyyy","iu-Latn-CA":"dd/MM/yyyy","ja-JP":"yyyy/MM/dd","ka-GE":"dd.MM.yyyy","kk-KZ":"dd.MM.yyyy","kl-GL":"dd-MM-yyyy","km-KH":"dd/MM/yyyy","kn-IN":"dd-MM-yyyy","ko-KR":"yyyy.MM.dd","kok-IN":"dd-MM-yyyy","ky-KG":"dd.MM.yyyy","lb-LU":"dd/MM/yyyy","lo-LA":"dd/MM/yyyy","lt-LT":"yyyy.MM.dd","lv-LV":"yyyy.MM.dd.","mi-NZ":"dd/MM/yyyy","mk-MK":"dd.MM.yyyy","ml-IN":"dd-MM-yyyy","mn-MN":"yyyy.MM.dd","mn-Mong-CN":"yyyy/MM/dd","moh-CA":"MM/dd/yyyy","mr-IN":"dd-MM-yyyy","ms-BN":"dd/MM/yyyy","ms-MY":"dd/MM/yyyy","mt-MT":"dd/MM/yyyy","nb-NO":"dd.MM.yyyy","ne-NP":"MM/dd/yyyy","nl-BE":"dd/MM/yyyy","nl-NL":"dd-MM-yyyy","nn-NO":"dd.MM.yyyy","nso-ZA":"yyyy/MM/dd","oc-FR":"dd/MM/yyyy","or-IN":"dd-MM-yyyy","pa-IN":"dd-MM-yyyy","pl-PL":"dd.MM.yyyy","prs-AF":"dd/MM/yyyy","ps-AF":"dd/MM/yyyy","pt-BR":"dd/MM/yyyy","pt-PT":"dd/MM/yyyy","qut-GT":"dd/MM/yyyy","quz-BO":"dd/MM/yyyy","quz-EC":"dd/MM/yyyy","quz-PE":"dd/MM/yyyy","rm-CH":"dd/MM/yyyy","ro-RO":"dd.MM.yyyy","ru-RU":"dd.MM.yyyy","rw-RW":"MM/dd/yyyy","sa-IN":"dd-MM-yyyy","sah-RU":"MM.dd.yyyy","sh-CS":"dd.MM.yyyy","sr-CS":"dd.MM.yyyy","se-FI":"dd.MM.yyyy","se-NO":"dd.MM.yyyy","se-SE":"yyyy-MM-dd","si-LK":"yyyy-MM-dd","sk-SK":"dd.MM.yyyy","sl-SI":"dd.MM.yyyy","sma-NO":"dd.MM.yyyy","sma-SE":"yyyy-MM-dd","smj-NO":"dd.MM.yyyy","smj-SE":"yyyy-MM-dd","smn-FI":"dd.MM.yyyy","sms-FI":"dd.MM.yyyy","sq-AL":"yyyy-MM-dd","sr-Cyrl-BA":"dd.MM.yyyy","sr-Cyrl-CS":"dd.MM.yyyy","sr-Cyrl-ME":"dd.MM.yyyy","sr-Cyrl-RS":"dd.MM.yyyy","sr-Latn-BA":"dd.MM.yyyy","sr-Latn-CS":"dd.MM.yyyy","sr-Latn-ME":"dd.MM.yyyy","sr-Latn-RS":"dd.MM.yyyy","sv-FI":"dd.MM.yyyy","sv-SE":"yyyy-MM-dd","sw-KE":"MM/dd/yyyy","syr-SY":"dd/MM/yyyy","ta-IN":"dd-MM-yyyy","te-IN":"dd-MM-yyyy","tg-Cyrl-TJ":"dd.MM.yyyy","th-TH":"dd/MM/yyyy","tk-TM":"dd.MM.yyyy","tn-ZA":"yyyy/MM/dd","tr-TR":"dd.MM.yyyy","tt-RU":"dd.MM.yyyy","tzm-Latn-DZ":"dd-MM-yyyy","ug-CN":"yyyy-MM-dd","uk-UA":"dd.MM.yyyy","ur-PK":"dd/MM/yyyy","uz-Cyrl-UZ":"dd.MM.yyyy","uz-Latn-UZ":"dd/MM yyyy","vi-VN":"dd/MM/yyyy","wo-SN":"dd/MM/yyyy","xh-ZA":"yyyy/MM/dd","yo-NG":"dd/MM/yyyy","zh-CN":"yyyy/MM/dd","zh-HK":"dd/MM/yyyy","zh-MO":"dd/MM/yyyy","zh-SG":"dd/MM/yyyy","zh-TW":"yyyy/MM/dd","zu-ZA":"MM/dd/yyyy"};function Ng(t){return Uc[t]||"dd/MM/yyyy"}function Sg(t,r){if((t==null?void 0:t.length)<6||!r)return null;const n=Uc[r]||"dd/MM/yyyy",o=n.includes("/")?"/":n.includes("-")?"-":".",a=n.split(o),i=t.split(o),l={};if(a.forEach((u,h)=>{l[u]=parseInt(i[h])}),l.yyyy>9999||l.yyyy<1e3||l.MM<0||l.MM>12||l.dd<0||l.dd>31)return null;const s=new Date(l.yyyy,l.MM-1,l.dd);return s!="Invalid Date"?s:null}const Ar=t=>(e.pushScopeId("data-v-13eaa242"),t=t(),e.popScopeId(),t),Bg=["data-test-id"],Ig=["for","data-test-id"],Tg=["data-test-id"],Og=["placeholder","data-test-id"],Dg=["data-test-id"],Vg=["data-test-id"],Fg=["data-test-id"],Mg=["data-test-id"],Rg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-left-arrows"},null,-1))],Lg=["data-test-id"],Pg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-left-arrow"},null,-1))],qg=["data-test-id"],$g=["data-test-id"],Ug=["data-test-id"],zg=["data-test-id"],jg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-right-arrow"},null,-1))],Hg=["data-test-id"],Gg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-right-arrows"},null,-1))],Kg=["data-test-id"],Xg={class:"c-container"},Wg={class:"cc-head"},Qg={class:"cc-body"},Zg={class:"cdc-day"},Jg=["onClick"],Yg=60*60*24*1e3,e7=ve({__name:"InputDatepicker",props:{locale:{type:String,default:"en-US"},max:{type:[Date,String]},min:{type:[Date,String]},label:{type:String,default:""},error:{type:[Boolean,String]},required:{type:Boolean,default:!1},modelValue:{type:String},highlight:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},fixed:{type:Boolean,default:!1},refrence:{type:Object},disableYear:{type:Boolean,default:!1},disableMonth:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:modelValue","focus-in","focus-out","error"],setup(t,{emit:r}){const n=t,o=r,a=Date.now()-Date.now()%Yg+new Date().getTimezoneOffset()*1e3*60,i=Q=>{if(!Q)return"";const[ce,ue,pe]=Q.split("-");return`${ue}/${pe}/${ce}`},l=Q=>{if(!Q)return"";const[ce,ue,pe]=Q.split("/");return`${pe}-${ce.padStart(2,"0")}-${ue.padStart(2,"0")}`},s=e.ref({year:new Date().getFullYear(),month:new Date().getMonth(),selectedDay:a,monthDetails:[]}),u=e.ref({position:"fixed",top:"0px",left:"0px",width:"0px"}),h=["SUN","MON","TUE","WED","THU","FRI","SAT"],d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],m=["January","February","March","April","May","June","July","August","September","October","November","December"],c=e.ref(new Date(1e3,0,1)),y=e.ref(new Date(9999,0,1)),f=e.ref(!0),b=e.ref(!1),p=e.ref(""),x=e.ref(""),g=e.ref(!1),C=e.ref(""),_=e.ref(-1),E=e.computed(()=>Ng(n.locale)),A=e.computed(()=>c.value.getFullYear()<s.value.year),k=e.computed(()=>y.value.getFullYear()>s.value.year),B=e.computed(()=>A.value||c.value.getMonth()<s.value.month),D=e.computed(()=>k.value||y.value.getMonth()>s.value.month),w=e.computed(()=>{if(x.value){const Q=x.value.getTime();if(y.value.getTime()<Q)return"Max date can be "+y.value.toLocaleDateString(n.locale);if(c.value.getTime()>Q)return"Min date can be "+c.value.toLocaleDateString(n.locale)}return!1}),v=e.computed(()=>{let Q=n.error===""?!1:n.error===!0?`${n.label||"Field"} is required`:n.error;return f.value||(Q="Date format must be "+E.value),w.value&&(Q=w.value),o("error",Q),Q}),S=e.computed(()=>(C.value==""||C.value==null)&&(n.modelValue==""||n.modelValue==null)?!1:C.value!=n.modelValue);e.watch(()=>n.modelValue,Q=>{p.value=Q?i(Q):""}),e.watch(()=>n.min,Q=>{c.value=Q?new Date(Q):new Date(1e3,0,1)}),e.watch(()=>n.max,Q=>{y.value=Q?new Date(Q):new Date(9999,0,1)}),e.watch(p,Q=>{if(Q)try{const ce=Sg(Q,n.locale);if(x.value=ce||x.value,f.value=!!ce,f.value){const ue=l(Q);if(C.value===ue)return;o("update:modelValue",ue)}}catch(ce){console.info("[ERROR]: Date parsing error:",ce),f.value=!1}else f.value=!0,x.value=null,o("update:modelValue","")});const I=e.ref(null),R=e.ref(null),z=e.ref(null);e.onMounted(()=>{ne(),y.value=n.max?new Date(n.max):y.value,c.value=n.min?new Date(n.min):c.value,n.modelValue&&(p.value=i(n.modelValue),f.value=!!p.value),C.value=n.modelValue,window.addEventListener("resize",$),window.addEventListener("scroll",$,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0)});const $=()=>{if(!z.value)return;const Q=z.value.getBoundingClientRect(),ce=334;u.value={position:"fixed",top:`${Q.bottom+4}px`,left:`${Q.left}px`,width:`${ce}px`,zIndex:9999}},X=()=>{g.value||(L(),g.value=!0,$(),o("focus-in"))},W=(Q=!1)=>{(!b.value||Q)&&setTimeout(()=>{_.value=-1,g.value=!1,o("focus-out",x.value)},100)},K=()=>{R.value&&R.value.focus()},P=Q=>{const ce=Q.index-Q.firstDay,ue=Q.index%7;let pe=Q.month-1,ie=Q.year;pe<0&&(pe=11,ie--);const de=N(ie,pe),_e=(ce<0?de+ce:ce%Q.numberOfDays)+1,xe=new Date(Q.year,Q.month,_e).getTime(),ye=ce<0||c.value.getTime()>xe?-1:ce>=Q.numberOfDays||y.value.getTime()<xe?1:0;return{date:_e,day:ue,month:ye,timestamp:xe,dayString:d[ue]}},N=(Q,ce)=>40-new Date(Q,ce,40).getDate(),T=(Q,ce)=>{const ue=new Date(Q,ce).getDay(),pe=N(Q,ce),ie=[],de=6;let _e=null,xe=0;const ye=7;for(let oe=0;oe<de;oe++)for(let le=0;le<ye;le++)_e=P({index:xe,numberOfDays:pe,firstDay:ue,year:Q,month:ce}),ie.push(_e),xe++;return ie},O=Q=>Q.timestamp===a,F=Q=>Q.timestamp===s.value.selectedDay,q=Q=>{if(!Q)return null;if(Q instanceof Date)return{year:Q.getFullYear(),month:Q.getMonth()+1,date:Q.getDate()};if(typeof Q=="string"&&Q.includes("/")){const[ce,ue,pe]=Q.split("/");return{year:parseInt(pe),month:parseInt(ce),date:parseInt(ue)}}return null},M=Q=>m[Math.max(Math.min(11,Q),0)]||"Month",U=Q=>{const ce=new Date(Q.year,Q.month-1,Q.date).getTime();s.value={selectedDay:ce}},L=()=>{ne();const Q=q(x.value);Q!==null&&(U(Q),s.value={year:Q.year,month:Q.month-1,monthDetails:T(Q.year,Q.month-1)})},j=Q=>{const ce=new Date(Q),ue=(ce.getMonth()+1).toString().padStart(2,"0"),pe=ce.getDate().toString().padStart(2,"0"),ie=ce.getFullYear();return p.value=`${ue}/${pe}/${ie}`,`${ie}-${ue}-${pe}`},H=Q=>{s.value={selectedDay:Q.timestamp};const ce=j(Q.timestamp);W(!0),o("update:modelValue",ce),R.value&&R.value.blur()},Z=Q=>{if(n.disableYear)return;const ce=s.value.year+Q;let ue=s.value.month;c.value.getFullYear()===ce&&c.value.getMonth()>ue&&(ue=c.value.getMonth()),y.value.getFullYear()===ce&&y.value.getMonth()<ue&&(ue=y.value.getMonth()),s.value={year:ce,month:ue,monthDetails:T(ce,ue)}},te=Q=>{if(n.disableMonth)return;let ce=s.value.year,ue=s.value.month+Q;ue===-1?(ue=11,ce--):ue===12&&(ue=0,ce++),s.value={year:ce,month:ue,monthDetails:T(ce,ue)}},ne=()=>{const Q=new Date,ce=Q.getFullYear(),ue=Q.getMonth();s.value={...s.value,year:ce,month:ue,selectedDay:a,monthDetails:T(ce,ue)}};return(Q,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"datePick",ref:I,class:"MyDatePicker","data-test-id":t.dataTestId,onMouseover:ce[2]||(ce[2]=ue=>b.value=!0),onMouseout:ce[3]||(ce[3]=ue=>b.value=!1)},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(["title_label",{error_color:!!v.value}]),for:t.label,"data-test-id":`${t.dataTestId}-label`},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass({error_color:!!v.value})},"*",2)):e.createCommentVNode("",!0)],10,Ig)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"triggerElement",ref:z,tabindex:"0",class:e.normalizeClass(["mdp-input ectheme-input-box ect-mb-0",{"mdp-input_focus":g.value,errorBorder_color:!!v.value,highlight:S.value&&t.highlight}]),"data-test-id":`${t.dataTestId}-input-wrapper`,onFocusin:X,onFocusout:ce[1]||(ce[1]=ue=>W(!1)),onClick:K},[e.withDirectives(e.createElementVNode("input",{id:"calendar",ref_key:"inputRef",ref:R,"onUpdate:modelValue":ce[0]||(ce[0]=ue=>p.value=ue),type:"text",autocomplete:"off",placeholder:E.value,"data-test-id":`${t.dataTestId}-input`},null,8,Og),[[e.vModelText,p.value]]),e.createVNode(Be,{icon:"calendar_today",size:18,for:"calendar","data-test-id":`${t.dataTestId}-calendar-icon`},null,8,["data-test-id"])],42,Tg),v.value?(e.openBlock(),e.createElementBlock("label",{key:1,class:"error_label","data-test-id":`${t.dataTestId}-error`},[e.createElementVNode("p",null,e.toDisplayString(v.value),1)],8,Dg)):e.createCommentVNode("",!0)],40,Bg),(e.openBlock(),e.createBlock(e.Teleport,{to:".dropdowntp"},[g.value&&!t.disabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mdp-container",style:e.normalizeStyle(u.value),"data-test-id":`${t.dataTestId}-calendar-popup`,onMousedown:ce[8]||(ce[8]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",{class:"mdpc-head","data-test-id":`${t.dataTestId}-calendar-header`},[e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-prev-year-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!A.value||t.disableYear}]),onClick:ce[4]||(ce[4]=ue=>Z(-1))},Rg,2)],8,Mg),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-prev-month-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!B.value||t.disableMonth}]),onClick:ce[5]||(ce[5]=ue=>te(-1))},Pg,2)],8,Lg),e.createElementVNode("div",{class:"mdpch-container","data-test-id":`${t.dataTestId}-date-display`},[e.createElementVNode("div",{class:"mdpchc-year","data-test-id":`${t.dataTestId}-year-display`},e.toDisplayString(s.value.year),9,$g),e.createElementVNode("div",{class:"mdpchc-month","data-test-id":`${t.dataTestId}-month-display`},e.toDisplayString(M(s.value.month)),9,Ug)],8,qg),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-next-month-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!D.value||t.disableMonth}]),onClick:ce[6]||(ce[6]=ue=>te(1))},jg,2)],8,zg),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-next-year-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!k.value||t.disableYear}]),onClick:ce[7]||(ce[7]=ue=>Z(1))},Gg,2)],8,Hg)],8,Fg),e.createElementVNode("div",{class:"mdpc-body","data-test-id":`${t.dataTestId}-calendar-body`},[e.createElementVNode("div",Xg,[e.createElementVNode("div",Wg,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(h,(ue,pe)=>e.createElementVNode("div",{key:pe,class:"cch-name"},e.toDisplayString(ue),1)),64))]),e.createElementVNode("div",Qg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value.monthDetails,(ue,pe)=>(e.openBlock(),e.createElementBlock("div",{key:pe,class:e.normalizeClass(["c-day-container",{disabled:ue.month!==0,highlight:O(ue),"highlight-green":F(ue)}])},[e.createElementVNode("div",Zg,[e.createElementVNode("span",{onClick:ie=>H(ue)},e.toDisplayString(ue.date),9,Jg)])],2))),128))])])],8,Kg)],44,Vg)):e.createCommentVNode("",!0)]))],64))}},[["__scopeId","data-v-13eaa242"]]),zc=t=>(e.pushScopeId("data-v-9b473c8b"),t=t(),e.popScopeId(),t),t7=zc(()=>e.createElementVNode("div",{class:"dropdowntp"},null,-1)),n7={key:0,class:"custom-form_block"},o7={class:"custom-form_block-header"},r7={key:0,class:"custom-form_block-content"},a7={key:1,class:"custom-form_block-content"},i7={key:2,class:"custom-form_block-footer"},l7={key:3,class:"custom-form_block-action"},s7={key:1,class:"custom-form_success"},c7={class:"custom-form_success_message"},u7=zc(()=>e.createElementVNode("span",{class:"custom-form_success_message-icon material-icons-outlined"}," done ",-1)),d7=ve({__name:"OrganismsCustomFormBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},options:{type:Object,default:()=>({})},quoteId:{type:String,default:""}},setup(t,{expose:r}){var B;const n=Nn(),o=t,a=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,i=e.ref({}),l=e.ref(!1),s=e.ref(!1),u=e.ref(!1),h=e.ref({}),d=e.ref({}),m=e.computed(()=>{var D;return(D=o.fields)==null?void 0:D.header}),c=e.computed(()=>{var D;return(D=o.fields)==null?void 0:D.footer}),y=e.computed(()=>o.fields&&o.fields.action&&o.fields.action.label?o.fields.action:!1),f=e.computed(()=>"en-US"),b=e.computed(()=>{var D;return(D=o.fields)==null?void 0:D.confirmation}),p=e.computed(()=>o.configuration),x=e.ref(JSON.parse(JSON.stringify((B=o.fields)==null?void 0:B.content))),g=D=>D?"custom-form_block-content_"+D.toLowerCase():"custom-form_block-content_full",C=()=>{u.value=!1,x.value.forEach(D=>{p.value.populate||(i.value[D.field]="")})},_=St(async function(D,w,v){x.value[v].loading=!0;const S={objectApiName:o.configuration.objectType,lookupFieldApiName:w,searchTerm:D||""},I=await n.getLookupRecords(S);console.log("Records:::",I),x.value[v].options=I,x.value[v].loading=!1}),E=St(()=>{!y.value&&!o.fields.isGuidance&&A(!0)},500),A=async D=>{console.log("handlerActionClick");let w=!1;if(x.value.forEach(v=>{v.isFormulaField||(v.dataType==="DATETIME"?i.value[v.field]=new Date().toISOString():v.required&&v.editable&&!i.value[v.field]&&v.dataType!=="BOOLEAN"?(v.error=!0,w=!0):(v.error=null,v.dataType==="EMAIL"&&i.value[v.field]&&!a.test(i.value[v.field])&&(v.error="Enter a valid email",w=!0)))}),!w){s.value=!0;const v=[];for(const I in i.value)(d.value[I]||I==="Id")&&v.push({fieldName:I,fieldValue:i.value[I]});const S={fields:v,objectType:o.configuration.objectType};if(o.options&&o.options.returnError){const I=await n.updateRecord(S,!0);if(!I||typeof I=="object"&&I.ERROR)return console.log("Error in saving",I),s.value=!1,I?I.ERROR:!1}else if(!await n.updateRecord(S))return s.value=!1,!1;return s.value=!1,D||(u.value=!0),!0}};async function k(){l.value=!0;const D=x.value.filter(v=>v.dataType!=="DATETIME").map(v=>v.field);let w={};if(p.value.populate&&o.quoteId&&D.length)try{w=await n.getRecordFieldValue({recordId:o.quoteId,lstFields:D})||{}}catch(v){console.error("[OrganismsCustomFormBlock] getRecordFieldValue failed",v)}x.value.forEach(v=>{var S,I,R;if(v.visiblity=v.dataType!=="DATETIME",p.value.populate&&o.quoteId)if(v.dataType==="BOOLEAN")i.value[v.field]=((S=w[v.field])==null?void 0:S.value)??!1;else if(v.dataType==="REFERENCE"){const z=v.field.replace("__c","__r"),$=(I=w[z])==null?void 0:I.value;$&&(i.value[v.field]=$.Id,v.options=[{Name:$.Name,Id:$.Id}])}else v.dataType==="DATE"?i.value[v.field]=((R=w[v.field])==null?void 0:R.value)??"":i.value[v.field]=We(w,v.field,v.dataType,!0,!0);v.editable&&v.dataType==="PICKLIST"&&(v.options=v.picklist.map(z=>({label:z,value:z})))}),l.value=!1}return e.onBeforeMount(async()=>{l.value=!0,h.value=JSON.parse(JSON.stringify(o.fields)),x.value=h.value.content,x.value.forEach(D=>{d.value[D.field]=D.editable&&!D.isFormulaField,D.size=g(D.size)}),h.value.request=i.value={Id:o.quoteId},o.quoteId&&await k()}),r({handlerActionClick:A}),(D,w)=>{var v,S,I,R,z,$,X;return e.openBlock(),e.createElementBlock(e.Fragment,null,[t7,u.value?(e.openBlock(),e.createElementBlock("div",s7,[e.createElementVNode("div",c7,[u7,e.createTextVNode("   "+e.toDisplayString((X=b.value)==null?void 0:X.label),1)]),b.value&&b.value.close?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:C},"click to close")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",n7,[e.createElementVNode("div",o7,[(v=m.value)!=null&&v.title?(e.openBlock(),e.createBlock(Re,{key:0,text:(S=m.value)==null?void 0:S.title,style:e.normalizeStyle((I=m.value)==null?void 0:I.style)},null,8,["text","style"])):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",r7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(W,K)=>(e.openBlock(),e.createElementBlock("div",{key:K,class:e.normalizeClass(["custom-form_block-content_skeletion",W.size])},[e.createVNode(Qt)],2))),128))])):l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",a7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(W,K)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:K},[W.visiblity?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["custom-form_block-content_input",W.size])},[W.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(rn,{key:0,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],options:W.options,disabled:!W.editable,select:"",error:W.error,required:W.required,label:W.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label"])):W.dataType==="BOOLEAN"?(e.openBlock(),e.createBlock(Er,{key:1,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],label:W.label},null,8,["modelValue","onUpdate:modelValue","label"])):W.dataType==="REFERENCE"?(e.openBlock(),e.createBlock(rn,{key:2,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],options:W.options,disabled:!W.editable,lookup:"",search:"",error:W.error,required:W.required,label:W.label,loading:W.loading,highlight:"",property:{key:"Id",value:"Name"},onSearch:P=>e.unref(_)(P,W.field,K)},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label","loading","onSearch"])):W.dataType==="DATE"?(e.openBlock(),e.createBlock(e7,{key:3,modelValue:i.value[W.field],"onUpdate:modelValue":P=>i.value[W.field]=P,label:W.label,required:W.required,disabled:!W.editable,error:W.error,locale:f.value,"data-test-id":`cart-customform-datepicker-${W.field}`,highlight:""},null,8,["modelValue","onUpdate:modelValue","label","required","disabled","error","locale","data-test-id"])):W.visiblity?(e.openBlock(),e.createBlock(Rn,{key:4,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],error:W.error,required:W.required,disabled:!W.editable,label:W.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","error","required","disabled","label"])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],64))),128))])),c.value?(e.openBlock(),e.createElementBlock("div",i7,[(R=c.value)!=null&&R.title?(e.openBlock(),e.createBlock(Re,{key:0,text:(z=c.value)==null?void 0:z.title,style:e.normalizeStyle(($=c.value)==null?void 0:$.style)},null,8,["text","style"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("div",l7,[s.value?(e.openBlock(),e.createBlock(ya,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createBlock(vr,{key:1,theme:y.value.style.theme,text:y.value.label,onClick:w[0]||(w[0]=W=>A(!1))},null,8,["theme","text"]))])):e.createCommentVNode("",!0)]))],64)}}},[["__scopeId","data-v-9b473c8b"]]),f7={class:"custom-button"},h7={class:"loader"},p7=ve({__name:"OrganismsCustomButtonBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},isPreview:{type:Boolean,default:!1}},setup(t){const r=Nn(),n=mn(),o=e.ref(null),a=t,i=e.computed(()=>{var d;return!!((d=n.quoteRecord)!=null&&d.XX_ORD1__Active_Customer_Contact__c)||!0}),l=e.computed(()=>{var d,m;return(m=(d=a.fields)==null?void 0:d.actions)==null?void 0:m.filter(c=>i.value?c.action!=="ACTIVATE":c.action!=="SAVE_FOR_LATER")}),s=d=>d.key??`${d.action}-${d.label}`,u=d=>o.value===s(d),h=d=>{if(a.isPreview)return;const m=s(d);d.action==="SAVE_FOR_LATER"&&(o.value=m),Et("expeditecart:clicked",{action:d.action,label:d.label,targetTemplateId:d.targetTemplateId,quoteId:r.quoteId,isActive:i.value,isPreview:a.isPreview})};return(d,m)=>(e.openBlock(),e.createElementBlock("div",f7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(c,y)=>(e.openBlock(),e.createBlock(vr,{key:y,theme:c.style.theme,text:c.label,class:"custom-button_action",onClick:f=>h(c)},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass({"text-loading":u(c)})},e.toDisplayString(c.label),3),e.createElementVNode("span",h7,[u(c)?(e.openBlock(),e.createBlock(Pc,{key:0})):e.createCommentVNode("",!0)])]),_:2},1032,["theme","text","onClick"]))),128))]))}},[["__scopeId","data-v-3245ee72"]]),_i=function(t,r){const n={};n.sectionStyle={},n.blockStyle={};const{visiblity:o}=t;n.visibility=o;const{layout:a}=t;if(n.blockStyle=m7(a,r),a&&(a!=null&&a.padding)){const{top:s,bottom:u,left:h,right:d}=a.padding;s&&(n.sectionStyle.paddingTop=`${s}px`),u&&(n.sectionStyle.paddingBottom=`${u}px`),h&&(n.sectionStyle.paddingLeft=`${h}px`),d&&(n.sectionStyle.paddingRight=`${d}px`)}a!=null&&a.gap&&(n.sectionStyle.gap=`${a.gap}px`);const{styling:i}=t;i&&(i.verticalAlignment&&(n.sectionStyle.alignItems=i.verticalAlignment),i.radius&&(n.sectionStyle.borderRadius=i.radius),i.borderStyle&&(n.sectionStyle.borderStyle=i.borderStyle));const{Background:l}=t;return l&&l.style==="Solid"&&(n.sectionStyle.backgroundColor=l.color),l&&l.opacity==="100%"&&(n.sectionStyle.opacity=1),l&&l.image&&l.image!=="sampleImage.png"&&(n.sectionStyle.backgroundImage=`url(${l.image})`,l.imageSize&&(n.sectionStyle.backgroundSize=l.imageSize)),l&&l.repeat==="no-repeat"&&(n.sectionStyle.backgroundRepeat=l.repeat),l&&(l.horizontalAlignment||l.verticalAlignment)&&(n.sectionStyle.backgroundPosition=l.horizontalAlignment+" "+l.verticalAlignment),n};function m7(t,r){if(!t)return[{}];const{columnSize:n,columns:o}=t;if(r)return Array(o).fill({display:"flex",flexDirection:"column",width:"100%"});if(!n)return Array(o).fill({});const a=n.split("/");return typeof o=="string"&&a.length!==parseInt(o)?Array(o).fill({}):typeof o=="number"&&a.length!==o?Array(o).fill({}):a.map(i=>({flexBasis:`${i}`}))}const y7=["data-sid","data-sname"],g7=["data-bid","data-bname"],b7=["page-block-id"],x7=["page-block-id"],_7=["page-block-id"],C7=["page-block-id"],E7=["page-block-id"],k7=["page-block-id"],jc={__name:"TemplateRenderer",props:{onCatalogCountUpdate:{type:Function,default:null},initialCatalogItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1},quoteId:{type:String,default:null}},setup(t,{expose:r}){const n=t,o=Co(),a=Nn(),i=xi(),l=e.computed(()=>o.pageBlocks||[]),s=e.ref(0);r({refreshTemplate:()=>{s.value+=1}});const h=m=>!0,d=e.computed(()=>{var c,y,f,b;const m=[];return console.log("props.sections template renderer",l.value),console.log("props.isPreview",n.isPreview),n.isPreview&&((c=l.value)!=null&&c.content)?(f=(y=l.value)==null?void 0:y.content)==null||f.forEach(p=>{const x=[],g=p.section,C=JSON.parse(g.XX_ORD1__Content_JSON__c);let _={};C&&(_=_i(C,i.isMobile),g.styleObject=g.hideStyle?{}:_.sectionStyle,g.visibility=_.visibility),p.blocks.forEach(E=>{let A=E.XX_ORD1__Content_Block__r;const k=JSON.parse(A.XX_ORD1__Content_JSON__c);A={...A,...k};let B={};k&&(B=_i(k,i.isMobile),A.styleObject=A.hideStyle?{}:B.blockStyle),x.push(A)}),g.blocks=x,m.push(g)}):(b=l.value)==null||b.forEach(p=>{var _;const x={...p},g=typeof p.contentJSON=="string"?JSON.parse(p.contentJSON):p.contentJSON;let C={};g&&(C=_i(g,i.isMobile),x.styleObject=p.hideStyle?{}:C.sectionStyle,x.visibility=C.visibility,(_=x.blocks)==null||_.forEach((E,A)=>{E.styleObject=C.blockStyle[A]})),m.push(x)}),m});return(m,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(pa),(e.openBlock(),e.createElementBlock("div",{key:s.value,class:"contentRendered ectheme",style:{width:"100%","box-sizing":"border-box"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,y=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:y.id},[h(y.visibility)?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(y.styleObject),class:"ect-flex ect-flex-col","data-sid":y.sectionId,"data-sname":y.sectionName},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.blocks,f=>(e.openBlock(),e.createElementBlock("div",{key:f.id,style:e.normalizeStyle(f.styleObject),class:"ect-w-full","data-bid":f.blockId,"data-bname":f.blockName},[f.componentName==="productList"&&e.unref(a).quoteId?(e.openBlock(),e.createElementBlock("div",{key:0,"page-block-id":f.Id,class:"ect-m-auto ect-w-full"},[e.createVNode(ag,{id:f.Id,header:f.fields.header,columns:f.fields.columns,footer:f.fields.footer,fields:f.fields,configuration:f.configuration,"is-preview":t.isPreview},null,8,["id","header","columns","footer","fields","configuration","is-preview"])],8,b7)):f.componentName==="quoteSummary"&&e.unref(a).quoteId?(e.openBlock(),e.createElementBlock("div",{key:1,"page-block-id":f.Id,class:""},[e.createVNode(bg,{id:f.Id,configuration:f.configuration,fields:f.fields,"quote-id":e.unref(a).quoteId},null,8,["id","configuration","fields","quote-id"])],8,x7)):f.componentName==="promoCode"?(e.openBlock(),e.createElementBlock("div",{key:2,"page-block-id":f.Id,class:""},[e.createVNode(wg,{id:f.Id,fields:f.fields,configuration:f.configuration,"is-preview":t.isPreview},null,8,["id","fields","configuration","is-preview"])],8,_7)):f.componentName==="customForm"&&e.unref(a).quoteId?(e.openBlock(),e.createElementBlock("div",{key:3,"page-block-id":f.Id,class:"ect-w-full"},[e.createVNode(d7,{id:f.Id,configuration:f.configuration,fields:f.fields,"quote-id":e.unref(a).quoteId},null,8,["id","configuration","fields","quote-id"])],8,C7)):f.componentName==="customButtons"?(e.openBlock(),e.createElementBlock("div",{key:4,"page-block-id":f.Id,class:""},[e.createVNode(p7,{id:f.Id,configuration:f.configuration,fields:f.fields,"is-preview":t.isPreview},null,8,["id","configuration","fields","is-preview"])],8,E7)):f.componentName==="catalogBlock"?(e.openBlock(),e.createElementBlock("div",{key:5,"page-block-id":f.Id,class:""},[e.createVNode(R8,{id:f.Id,mode:"preview",configuration:f.configuration,fields:f.fields,"search-term":f.searchTerm,"on-count-update":t.onCatalogCountUpdate,"initial-items":t.initialCatalogItems,"is-preview":t.isPreview,"quote-id":t.quoteId},null,8,["id","configuration","fields","search-term","on-count-update","initial-items","is-preview","quote-id"])],8,k7)):e.createCommentVNode("",!0)],12,g7))),128))],12,y7)):e.createCommentVNode("",!0)],64))),128))]))],64))}},v7=t=>(e.pushScopeId("data-v-04b2bdef"),t=t(),e.popScopeId(),t),A7={class:"ect-composable-catalog-wrapper","data-test-id":"expose-expediteCatalog-wrapper"},w7={key:0,class:"ect-flex ect-items-center ect-justify-center ect-min-h-[50vh]","data-test-id":"expose-expediteCatalog-loader"},N7=[v7(()=>e.createElementVNode("div",{class:"ect-flex ect-flex-col ect-items-center ect-gap-3"},[e.createElementVNode("div",{class:"ect-spinner","aria-label":"Loading"}),e.createElementVNode("div",{class:"ect-text-sm ect-text-gray-500"},"Loading catalog…")],-1))],wr=ve({__name:"ExpediteCatalog",props:{templateId:{type:String,required:!0},identity:{type:Object,required:!1,default:()=>({})},session:{type:Object,required:!1,default:()=>({})},security:{type:Object,required:!1,default:()=>({})},resources:{type:Object,required:!1,default:()=>({})},searchTerm:{type:String,default:""},onCatalogCountUpdate:{type:Function,default:null},previewData:{type:Object,default:()=>({})},initialData:{type:Array,default:()=>[]},isPreview:{type:Boolean,required:!0},sections:{type:Array,required:!0},theme:{type:Object,required:!0},hostName:{type:String,required:!1},graphqlEndpoint:{type:String,required:!1},apiKey:{type:String,required:!1},composablesOrgType:{type:String,required:!1},composablesApiKey:{type:String,required:!1}},emits:["catalog-item-added","catalog-item-qty-updated","catalog-line-deleted","catalog-items-fetched","catalog-item-configure","catalog-items-loaded","catalog:id"],setup(t,{emit:r}){const n=ft(),o=mn(),a=Co(),i=t,l=e.ref(!1),s=e.ref(!1),u=e.ref(null),h=r,d=[],m=()=>{l.value=window.innerWidth<=768};return e.onBeforeMount(async()=>{var y,f,b,p,x,g,C,_,E,A,k,B,D;n.updateConfig({templateId:i.templateId,organizationId:(y=i.identity)==null?void 0:y.organizationId,hostName:i.hostName,graphqlEndpoint:i.graphqlEndpoint,apiKey:((f=i.security)==null?void 0:f.apiKey)||i.apiKey,accountId:(b=i.identity)==null?void 0:b.accountId,cid:(p=i.identity)==null?void 0:p.contactId,composablesApiUrl:(x=i.security)==null?void 0:x.baseUrl,accessToken:(g=i.security)==null?void 0:g.accessToken,composablesOrgType:i.composablesOrgType,isPreview:i.isPreview,quoteId:(C=i.session)==null?void 0:C.quoteId,userId:(_=i.identity)==null?void 0:_.userId,siteUrl:(E=i.resources)==null?void 0:E.siteUrl}),n.quoteId=(A=i.session)==null?void 0:A.quoteId,console.log("props.sections expedite catalog",i.sections),await n.processSections(i.isPreview,i.sections);const c=(D=(B=(k=a.pageBlocks[0])==null?void 0:k.blocks[0])==null?void 0:B.configuration)==null?void 0:D.catalogId;c&&h("catalog:id",c)}),e.onMounted(async()=>{window.addEventListener("resize",m),m(),d.push(Lt("catalog:item-added",c=>{h("catalog-item-added",c)})),d.push(Lt("catalog:item-qty-updated",c=>{h("catalog-item-qty-updated",c)})),d.push(Lt("catalog:line-deleted",c=>{h("catalog-line-deleted",c)})),d.push(Lt("catalog:items-fetched",c=>{h("catalog-items-fetched",c)})),d.push(Lt("catalog:item-configure-clicked",c=>{h("catalog-item-configure",c)})),d.push(Lt("catalog:items-loaded",c=>{h("catalog-items-loaded",c)}))}),e.watch(()=>i.session&&i.session.quoteId,c=>{c&&(n.updateConfig({quoteId:c}),n.quoteId=c,o.getQuoteItems(!0))}),e.watch(()=>i.sections,async(c,y)=>{c!==y&&(await n.processSections(i.isPreview,c),u.value&&u.value.refreshTemplate&&u.value.refreshTemplate())},{deep:!0}),e.onBeforeUnmount(()=>{d.forEach(c=>{try{c()}catch{}})}),(c,y)=>{var f,b;return e.openBlock(),e.createElementBlock("div",A7,[e.createVNode(Nc,{"organization-id":(f=i.identity)==null?void 0:f.organizationId,"template-id":i.templateId,"is-preview":i.isPreview,theme:i.theme},null,8,["organization-id","template-id","is-preview","theme"]),s.value?(e.openBlock(),e.createElementBlock("div",w7,N7)):(e.openBlock(),e.createBlock(jc,{key:1,ref_key:"templateRendererRef",ref:u,"quote-id":(b=i.session)==null?void 0:b.quoteId,"is-preview":t.isPreview,"on-catalog-count-update":t.onCatalogCountUpdate,"initial-catalog-items":t.initialData},null,8,["quote-id","is-preview","on-catalog-count-update","initial-catalog-items"]))])}}},[["__scopeId","data-v-04b2bdef"]]),Nr={__name:"ExpediteCart",props:{templateId:{type:String,required:!0},hostName:{type:String,required:!1},composablesOrgType:{type:String,required:!1},sections:{type:String,required:!1},theme:{type:Object,required:!1},isPreview:{type:Boolean,required:!1},security:{type:Object,required:!1},identity:{type:Object,required:!1},session:{type:Object,required:!1},resources:{type:Object,required:!1}},emits:["expeditecart-item-configure","expeditecart-clicked"],setup(t,{emit:r}){const n=ft(),o=Nn(),a=e.ref(null),i=r,l=t;e.onBeforeMount(async()=>{var u,h,d,m,c,y,f,b,p;n.updateConfig({templateId:l.templateId,organizationId:(u=l.identity)==null?void 0:u.organizationId,accountId:(h=l.identity)==null?void 0:h.accountId,cid:(d=l.identity)==null?void 0:d.contactId,userId:(m=l.identity)==null?void 0:m.userId,accessToken:(c=l.security)==null?void 0:c.accessToken,composablesApiUrl:(y=l.security)==null?void 0:y.baseUrl,quoteId:(f=l.session)==null?void 0:f.quoteId,composablesOrgType:"Production",hostName:l.hostName,isPreview:l.isPreview,siteUrl:(b=l.resources)==null?void 0:b.siteUrl}),o.quoteId=(p=l.session)==null?void 0:p.quoteId,await n.processSections(l.isPreview,l.sections)});const s=[];return e.onMounted(()=>{s.push(Lt("expeditecart:configure-clicked",u=>{i("expeditecart-item-configure",u)})),s.push(Lt("expeditecart:clicked",u=>{i("expeditecart-clicked",u)}))}),e.onBeforeUnmount(()=>{s.forEach(u=>{try{u()}catch{}})}),e.watch(()=>l.sections,async(u,h)=>{u!==h&&(await n.processSections(l.isPreview,u),a.value&&a.value.refreshTemplate&&a.value.refreshTemplate())},{deep:!0}),(u,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Nc,{"organization-id":l.identity.organizationId,"template-id":l.templateId,"is-preview":l.isPreview,theme:l.theme},null,8,["organization-id","template-id","is-preview","theme"]),e.createVNode(jc,{ref_key:"templateRendererRef",ref:a,"is-preview":t.isPreview},null,8,["is-preview"])],64))}},S7={pbUniqueId:"PB_DXP_001",vUniqueId:"V_1",versionType:"ACTIVE",playBookName:"DXP AI Guidance",description:"Three-step flow to showcase in-panel component loading via playbook steps.",pbObject:"Opportunity",mode:"FULL",type:null,appliesTo:{},playBookSteps:[{stepID:"PB_DXP_001_V_1_00",stepName:"AI Guidance",stepType:"UI_COMPONENT",stepComponent:"ai-guidance",sequenceNumber:"0",description:"AI Guidance entry step. Presents chat and initial actions.",aiGuidance:"Start here to receive guidance and choose your next action.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[{beanName:"Browse Catalog",sequenceNumber:"1",disable:!1}],templateId:"a1RKb000003C3PkMAK"},{stepID:"PB_DXP_001_V_1_0",stepName:"Browse Catalog",stepType:"UI_COMPONENT",stepComponent:"catalog",sequenceNumber:"1",description:"Browse or search the catalog and add items as needed.",aiGuidance:"Use the catalog to discover and add products. Proceed to configuration when ready.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[{beanName:"Configure Products",sequenceNumber:"1",disable:!1}],templateId:"a1RKb000003C3PkMAK"},{stepID:"PB_DXP_001_V_1_1",stepName:"Configure Products",stepType:"UI_COMPONENT",stepComponent:"configurator",sequenceNumber:"2",description:"Configure selected products and adjust options as needed.",aiGuidance:"Fine-tune product options. When done, proceed to review your cart.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[{beanName:"Review Cart",sequenceNumber:"2",disable:!1}]},{stepID:"PB_DXP_001_V_1_2",stepName:"Review Cart",stepType:"UI_COMPONENT",stepComponent:"cart",sequenceNumber:"3",description:"Review all quote line items before finalizing.",aiGuidance:"Validate quantities and pricing. Return to previous steps if adjustments are required.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[],templateId:"a1RKb000003C0ryMAC"}],metadata:{s3PathKey:"ec-playbooks/00DA0000000cDUJMA2/PB_DXP_001/V_1/playbook.json",createdAt:"2025-12-29T09:05:53.163365+00:00",updatedAt:"2025-12-29T09:05:53.163365+00:00",createdBy:"0052G00000AtQQ9QAN"}},Ci=it.defineStore("expediteConfigurator",()=>{const t=e.ref(null),r=e.ref(null),n=e.ref(null),o=e.ref([]);function a(){var h,d;console.info("[expediteConfiguratorStore] getPayload",{hasComp:!!t.value,hasGetConfig:!!((h=t.value)!=null&&h.getConfig)});const u=(d=t.value)==null?void 0:d.getConfig;return{productConfiguration:u!=null?[u]:[]}}function i(u,h){var d,m,c;console.info("[expediteConfiguratorStore] setPreConfigData",{hasData:!!u,hasProductConfiguration:!!((d=u==null?void 0:u.productConfiguration)!=null&&d.length),itemId:h}),r.value=u,((m=u==null?void 0:u.productConfiguration)==null?void 0:m.length)>0&&(n.value=u.productConfiguration.find(y=>{var b;return((y==null?void 0:y.itemId)||((b=y==null?void 0:y.product)==null?void 0:b.itemId))===h}),o.value=u.productConfiguration,console.info("[expediteConfiguratorStore] apply queued?",{hasQueueItem:!!n.value,ready:!!t.value}),n.value&&((c=t.value)!=null&&c.setConfig)&&t.value.setConfig(n.value,o.value))}function l(){var u;console.info("[expediteConfiguratorStore] refresh invoked"),(u=t.value)!=null&&u.refresh&&t.value.refresh()}function s(u){var h;console.info("[expediteConfiguratorStore] setExpediteConfigComp",{received:!!u}),t.value=u,n.value&&((h=t.value)!=null&&h.setConfig)&&(console.info("[expediteConfiguratorStore] applying queued configuration on ready"),t.value.setConfig(n.value,o.value),n.value=null)}return{preConfgData:r,expediteConfigComp:t,getPayload:a,refresh:l,setPreConfigData:i,setExpediteConfigComp:s}}),Ei=["Quote_Document"],Jn=it.defineStore("composablePlaybook",()=>{const t=Mt(),r=ft(),n=mn(),o=Ci(),a=e.ref(null),i=e.ref("full"),l=e.ref(null),s=e.ref(null),u=e.ref(!1),h=e.ref(!1),d=e.ref(null),m=e.ref(null);e.ref(null);const c=e.ref("");function y(S){c.value=S}const f=()=>({Authorization:`Bearer ${c.value}`,"X-Salesforce-Org-Id":r.organizationId.value||"","X-Salesforce-Org-Type":r.composablesOrgType.value||"","X-Salesforce-User-Id":r.userId.value||"","Content-Type":"application/json"});async function b(S,I="ACTIVE"){if(!S)throw new Error("getPlaybookByKey: 'key' is required");try{const R=`${r.composablesApiUrl.value}/playbooks/getPlaybookByKey/${S}?versionType=${I}`,z=await fetch(R,{method:"GET",headers:f()});if(!z.ok)throw new Error(`Playbook fetch failed: ${z.status}`);const $=await z.json();return l.value=$.data??null,console.log("[playbook] currentPlaybook",l.value),$}catch(R){if(console.warn("[playbook] Falling back to bundled DXP playbook due to fetch error:",(R==null?void 0:R.message)||R),S==="PB_DXP_001")return l.value=S7,l.value;throw R}}function p(S){h.value=!!S}function x(S){var R,z;if(!((z=(R=l.value)==null?void 0:R.playBookSteps)!=null&&z.length))return;l.value.playBookSteps.some($=>$.stepName===S||$.name===S)&&(s.value=S)}const g=e.computed(()=>{var I;return(((I=l.value)==null?void 0:I.playBookSteps)||[]).find(R=>R.stepName===s.value)||null});function C({stepName:S,data:I=null}){var W,K,P,N,T,O,F;if(console.log("[playbook:navigateToStep] called",{stepName:S,dataProvided:!!I,data:I}),!((K=(W=l.value)==null?void 0:W.playBookSteps)!=null&&K.length)){console.info("[navigateToStep] No playbook steps available, aborting navigation.");return}if(!S){console.info("[navigateToStep] No stepName provided, aborting navigation.");return}const R=l.value.playBookSteps;console.info("[navigateToStep] Steps available:",JSON.stringify(R.map(q=>q.stepName||q.name)));const z=R.findIndex(q=>q.stepName===S||q.name===S);if(z<0){console.info(`[Warn] [navigateToStep] No step found for stepName "${S}".`);return}const $=R[z];if(console.log("[playbook:navigateToStep] target step resolved",{targetIndex:z,targetStepName:($==null?void 0:$.stepName)||($==null?void 0:$.name),stepComponent:$==null?void 0:$.stepComponent}),$!=null&&$.stepComponent&&Ei.includes($.stepComponent)){console.info(`[navigateToStep] Target step "${$.stepName}" is a NON_COMPONENT (${$.stepComponent}), storing data in localStorage and searching for a valid component step above.`);const q=getPreviousValidStep($.stepName);q&&(console.info(`[navigateToStep] Valid step to return to: "${q}".`),setDataToLocalStorage({stepName:q,pbUniqueId:(P=l.value)==null?void 0:P.pbUniqueId}))}let X=!1;for(let q=z;q>=0;q--){const M=R[q],U=M==null?void 0:M.stepComponent;if(console.info(`[navigateToStep] Checking step[${q}]:`,M),!U){console.info(`[navigateToStep] Step[${q}] has no component, skipping.`);continue}if(Array.isArray(Ei)&&Ei.includes(U)){console.info(`[navigateToStep] Step[${q}] component "${U}" is in NON_COMPONENTS, skipping.`);continue}s.value=M.stepName??S,console.info(`[navigateToStep] Navigating to step[${q}] "${s.value}" with component "${U}".`);let L=I;const j=String(U||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),H=!!((T=(N=L==null?void 0:L.payload)==null?void 0:N.savedProducts)!=null&&T.length)||((F=(O=L==null?void 0:L.payload)==null?void 0:O.productConfiguration)==null?void 0:F.length)>0;if(j==="configurator"&&!H)try{const Z=typeof n.getTopConfigurableItem=="function"?n.getTopConfigurableItem():null;if(Z){const te=Z.XX_ORD1__Item__c||Z.xx_ord1__item__c||Z.itemId||"",ne=Z.Id||Z.id||"";te&&(L={payload:{savedProducts:[ne?{itemId:te,qliId:ne}:{itemId:te}]}})}}catch(Z){console.info("[navigateToStep] Unable to auto-select configurable item:",(Z==null?void 0:Z.message)||Z)}console.log("[playbook:navigateToStep] final navigation payload",{currentStepName:s.value,stepComponent:U,hasPayload:!!L,payload:L}),w({XX_ORD1__Completed_PB_Step_Number_EX__c:String(q),XX_ORD1__Playbook_Current_Step_Meta_EX__c:JSON.stringify(L)}),E(U,L),X=!0;break}X||console.info(`[Warn] [navigateToStep] Could not find a valid component step to navigate to starting from stepName "${S}".`),console.log("[playbook:navigateToStep] completed",{navigated:X,toStep:s.value})}function _(S){var X,W,K;const I=((X=l.value)==null?void 0:X.playBookSteps)||[];if(!I.length)return;const R=I.findIndex(P=>P.stepName===s.value);if(R<0)return;if(!(Array.isArray((W=I[R])==null?void 0:W.beans)&&I[R].beans.some(P=>(P==null?void 0:P.beanName)===S))){console.info(`[navigateToBean] Bean "${S}" not found in current step "${(K=I[R])==null?void 0:K.stepName}".`);return}const $=I[R+1];$!=null&&$.stepName&&C({stepName:$.stepName})}function E(S,I=null){var X,W,K,P,N,T,O,F,q,M,U,L,j,H,Z,te,ne;console.log("[playbook:loadComponent] called",{stepComponent:S,dataProvided:!!I,data:I});const R=A(S);console.log("[playbook:loadComponent] resolved route path",{path:R});function z(Q){try{return(typeof window<"u"&&window.location.hash||"").replace(/^#/,"")===Q}catch{return!1}}const $=String(S||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_");if(h.value){console.log("[playbook:loadComponent] embeddedMode active, skipping route",{normalized:$,payloadProvided:!!I}),d.value=$,console.log("[playbook] activeComponentKey",d.value),console.log("[playbook] activeComponentData",I),m.value=I||null;return}if(R)try{if(((I==null?void 0:I.actionFunction)==="Reload"||R==="/quote-item")&&(console.info("[playbook] Reloading quote line items..."),console.log("Reloading configurator 4"),quoteStore.fetchAllQuoteLineItems().then(()=>{console.info("[playbook] Quote line items reloaded...")})),R==="/configurator")if(console.log("[playbook:loadComponent] navigating to configurator",{hasProductConfiguration:((W=(X=I==null?void 0:I.payload)==null?void 0:X.productConfiguration)==null?void 0:W.length)>0,hasSavedProducts:((P=(K=I==null?void 0:I.payload)==null?void 0:K.savedProducts)==null?void 0:P.length)>0,isReload:(I==null?void 0:I.actionFunction)==="Reload"}),((T=(N=I==null?void 0:I.payload)==null?void 0:N.productConfiguration)==null?void 0:T.length)>0){const Q=(O=I==null?void 0:I.payload)==null?void 0:O.productConfiguration[0],ce=(Q==null?void 0:Q.itemId)||((F=Q==null?void 0:Q.product)==null?void 0:F.itemId)||"";o.setPreConfigData(I==null?void 0:I.payload,ce);const ue=`/configurator/${ce}`;z(ue)||router.push(ue);return}else if(((M=(q=I==null?void 0:I.payload)==null?void 0:q.savedProducts)==null?void 0:M.length)>0){const Q=(U=I==null?void 0:I.payload)==null?void 0:U.savedProducts[0].itemId,ce=(L=I==null?void 0:I.payload)==null?void 0:L.savedProducts[0].qliId,ue=`/configurator/${Q}/${ce}`;z(ue)||router.push(ue);return}else if((I==null?void 0:I.actionFunction)==="Reload"){console.log("Reloading configurator 5"),o.refresh();return}else{const ue=[...((j=quoteStore.allQLIData)==null?void 0:j.lineItems)??[]].sort((pe,ie)=>{const de=_e=>_e.xx_ord1__sys_configuration_status2__c==="Needs Configuration"?1:_e.xx_ord1__sys_configuration_status2__c==="Suggests Configuration"?2:3;return de(pe)-de(ie)}).filter(pe=>pe.xx_ord1__sys_configuration_status2__c!=="No Configuration");if(ue.length){const pe=ue[0],ie=`/configurator/${pe.xx_ord1__item__c}${pe.id?`/${pe.id}`:""}`;z(ie)||router.push(ie)}else t.handleWarning("No items needing configuration");return}else R==="/adaptive-search"&&((H=I==null?void 0:I.payload)!=null&&H.adaptiveSearch)?(console.log("[playbook:loadComponent] navigating to adaptive-search",{hasPayload:!!((Z=I==null?void 0:I.payload)!=null&&Z.adaptiveSearch)}),adaptiveSearch.createLstItems(I==null?void 0:I.payload.adaptiveSearch)):R==="/quote-item"&&I?(console.log("[playbook:loadComponent] navigating to quote-item with data"),quoteStore.performAIAction(I)):R==="/match-records"&&((te=I==null?void 0:I.payload)!=null&&te.quickSelection)&&(console.log("[playbook:loadComponent] navigating to match-records",{hasQuickSelection:!!((ne=I==null?void 0:I.payload)!=null&&ne.quickSelection)}),quickSelectionStore.quickSelectionLayout=I.payload);z(R)||router.push(R),console.log("[playbook:loadComponent] route push called",{path:R})}catch(Q){t.handleError(Q,"playbookStore.loadComponent")}}function A(S){var z;const I=String(S||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),R={chat_screen:"/",ai_guidance:"/",catalog:"/catalog",adaptive_search:"/adaptive-search",configurator:"/configurator",quote_item:"/quote-item",cart:"/cart",quick_selection:"/match-records",quote_document:null};if(I==="quote_document"){const $=getPreviousValidStep(s.value);return $&&setDataToLocalStorage({stepName:$,pbUniqueId:(z=l.value)==null?void 0:z.pbUniqueId}),goToQuoteDocument(),null}return R[I]||"/quote-item"}function k(){var S;return((S=g.value)==null?void 0:S.beans)??[]}function B(){return k().map(I=>({action:`playbookNavigate:${I.beanName}`,label:I.beanName,disabled:!!I.disable}))}async function D(){var S;try{const I=((S=r.quoteId)==null?void 0:S.value)||"";if(!I)return console.info("getPlaybookInfoFromQuote: Missing Quote Id"),null;const R=`${r.composablesApiUrl.value}/platform/getHeaderRecord`,z={recordId:I,lstFields:["XX_ORD1__Playbook_Id_EX__c","XX_ORD1__Playbook_Version_Id_EX__c","XX_ORD1__Completed_PB_Step_Number_EX__c","XX_ORD1__Playbook_Current_Step_Meta_EX__c"]};return(await(await fetch(R,{method:"POST",headers:f(),body:JSON.stringify(z)})).json()).data}catch(I){return t.handleError(I,"playbookStore.getPlaybookInfoFromQuote"),null}}async function w(S={}){var I;try{const R=((I=r.quoteId)==null?void 0:I.value)||Jr("id")||"";if(!R)return console.info("addPlaybookInfoToQuote: Missing Quote Id"),null;const z={Id:R,...S},$=Object.entries(z).map(([N,T])=>({fieldName:N,fieldValue:T})),X=`${r.composablesApiUrl.value}/platform/upsertRecords`,W={objectType:"XX_ORD1__Quote__c",uniqueField:"Id",records:[{fields:$}]},P=await(await fetch(X,{method:"POST",headers:f(),body:JSON.stringify(W)})).json();return console.info("[playbook] addPlaybookInfoToQuote response:",JSON.stringify(P)),P}catch(R){return t.handleError(R,"playbookStore.addPlaybookInfoToQuote"),null}}async function v(){var S;try{const I=`${r.composablesApiUrl.value}/product-pricing/findCatalogInContext?accountId=${r.accountId.value}&catalogType=Primary&catalogLookupFieldName=Primary_Catalog__c`,z=await(await fetch(I,{method:"GET",headers:f()})).json();return(S=z==null?void 0:z.data)==null?void 0:S.catalogId}catch(I){return t.handleError(I,"playbookStore.getCatalogInContext"),null}}return{playbookData:a,currentPlaybook:l,currentStepName:s,currentStep:g,playbookStepsMode:i,showPlaybookSteps:u,embeddedMode:h,activeComponentKey:d,activeComponentData:m,setSecretKey:y,getPlaybookByKey:b,setCurrentStepName:x,navigateToStep:C,navigateToBean:_,loadComponent:E,setEmbeddedMode:p,getCurrentStepLinks:B,addPlaybookInfoToQuote:w,getPlaybookInfoFromQuote:D,getCatalogInContext:v}}),ki={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"},Hc={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"},B7=t=>{var n;let r=[];for(let o of t)if(o.trim()!=="xx_ord1__item__r.xx_ord1__decimal_precision__c")if(o.includes(".")){let i=o.split(".")[0];i=i.slice(0,-1)+"c";const l=((n=ki[i==null?void 0:i.toLowerCase()])==null?void 0:n.trim())||"";l&&(r.includes(l)||r.push(l||""),r.push(o))}else r.includes(ki[o==null?void 0:o.toLowerCase()])||r.push(ki[o==null?void 0:o.toLowerCase()]||"");return r.filter(o=>o!=="")},Gc=it.defineStore("actions",()=>{const t=Un(),r=$n(),n=e.ref(!1);return{openAdaptiveSearch:(s,u=!1)=>{console.info("openAdaptiveSearch",s),t.chatHistory[t.chatHistory.length-1].links=[],t.sendMessage("Open Adaptive Search",!1,{internalCall:!0}),n.value=u},openQuoteItem:s=>{console.info("openQuoteItem",s),t.chatHistory[t.chatHistory.length-1].links=[],t.sendMessage("Open Quote Item",!1,{internalCall:!0})},openQuoteDocument:s=>{console.info("openQuoteDocument",s),t.chatHistory[t.chatHistory.length-1].links=[],t.chatHistory.push({type:"response",message:"Opening quote document",loading:!0});const h=`/apex/XX_ORD1__Expedite_Commerce?scpq=true&oid=${r.quoteId}&atpverified=true&ecCache=false&origin=AI`;window.location.href=`${$0(window.location.href)}${h}`},undo:()=>{const s=t==null?void 0:t.latestDMLRequest;t.sendMessage(`UNDO-${s}`,!1,{internalCall:!0})},isStaticActionCall:n}}),Kc=it.defineStore("adaptiveSearch",()=>{const t=$n(),r=wo(),n=Un(),o=Gc(),a=e.ref(null),i=e.ref(null),l=e.ref(!1),s=e.ref(!1),u=e.ref([]),h=e.ref(""),d=e.ref(!1),m=e.ref(null),c=e.ref(!1),y=e.ref([]),f=Mt(),b=e.ref([]),p=e.ref(0),x=e.ref(!1),g=e.ref({rowLimt:10,paging:!0,offset:0,currentPage:1,totalPages:1});async function C(){l.value=!0;try{const N=JSON.stringify({layoutType:"Search Selection",layoutObject:"xx_ord1__ecatalog_item__c"});let T={};return T=await window.salesforceConnector.getDynamicPageLayout(N),i.value=Cl(T,"Unable to find the Search Selection Layout for your user profile"),g.value.rowLimt=i.value.configuration.rowLimit||10,i.value.configuration.columns.forEach(O=>{!O.field&&O.label==="QTY"&&(O.field="xx_ord1__qty__c")}),l.value=!1,_(),T}catch(N){l.value=!1,f.handleError("Failed to get Adaptive Search Layout. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",N)}}function _(){var N,T,O;m.value=(O=(T=(N=i.value)==null?void 0:N.configuration)==null?void 0:T.dynamicFilters)==null?void 0:O.filters.map(F=>({...F,field:F.field.toLowerCase(),filtervalue:F.filtervalue||[],filtervaluefrom:F.filtervaluefrom||"",filtervalueTo:F.filtervalueTo||""}))}function E(){var T;let N=[];for(const O of i.value.configuration.columns){let F=O.field;if(N.includes(F)||N.push(F),F!=null&&F.includes(".")){let M=F.split(".")[0];M=M.slice(0,-1)+"c",N.includes(M)||N.push(M)}}return(T=i.value.configuration)!=null&&T.cardHeader&&N.push(i.value.configuration.cardHeader.imageField),i.value.configuration.objectName.toLowerCase()==="xx_ord1__ecatalog_item__c"&&N.push("xx_ord1__item__r.xx_ord1__decimal_precision__c"),N=N.filter(O=>!!O),N.filter(O=>O.toLowerCase()!=="xx_ord1__qty__c"&&O.toLowerCase()!=="xx_ord1__competitor_sku__c")}function A(N,T=!1){if(!N||N.includes("undefined"))return!1;const O=/[!@#$%^&*()+=[\]{};':"\\|.<>/?]+/;if(T){const F=Array.isArray(N)?N:N.split(",");for(const q of F){const M=q.trim();if(O.test(M))return f.handleError(`Invalid character found in value: ${M}`),!1}}else if(O.test(N))return f.handleError("Special characters are not allowed in filter values"),!1;return!0}function k(N,T){return{field:N.field,operator:N.operator||"contains",value:T,dataType:N.dataType.trim()}}function B(N){if(!N.filtervalue)return null;const T=Array.isArray(N.filtervalue),O=T?N.filtervalue.join(","):N.filtervalue.trim();return A(O,T)?O:null}function D(N){var q,M;const T=(q=N.filtervaluefrom)==null?void 0:q.trim(),O=(M=N.filtervalueTo)==null?void 0:M.trim();if(!T||!O)return null;const F=`${T}, ${O}`;return F!==", "&&A(F)?F:null}function w(N){const T=`${_l(N.filtervaluefrom)}, ${_l(N.filtervalueTo)}`;return T!==", "&&A(T)?T:null}function v(N){var O;const T=(O=N.filtervaluefrom)==null?void 0:O.trim();return A(T)?T:null}function S(N){const T=[];return N.forEach(O=>{const F=O.dataType.trim();let q=null;switch(F){case"PICKLIST":case"MULTIPICKLIST":q=B(O);break;case"DOUBLE":case"CURRENCY":q=D(O);break;case"DATETIME":case"DATE":q=w(O);break;default:q=v(O)}q&&T.push(k(O,q))}),y.value=T,T}async function I(N="",T=[],O=[]){var q,M,U,L,j,H,Z,te,ne,Q;let F=[];if(T.length&&(F=S(T)),!F.length&&N.trim()===""){u.value=[],d.value=!1;return}try{d.value=!1,s.value=!0;const ce=N.trim();O.length||(O=E());const ue={fields:O,...T.length?{dynamicFilters:F}:{},searchText:ce||h.value.trim(),accountId:r.accountId,...r.eCatalogId?{catalogId:r.eCatalogId}:{},...r.objectType==="opportunity"?{opportunityId:r.id}:{},...(M=(q=i.value)==null?void 0:q.configuration)!=null&&M.sort?{primarySortBy:i.value.configuration.sort.primary.field,primarySortOrder:i.value.configuration.sort.primary.direction,secondarySortBy:i.value.configuration.sort.secondary.field,secondarySortOrder:i.value.configuration.sort.secondary.direction}:{},rowLimt:(L=(U=i.value)==null?void 0:U.configuration)==null?void 0:L.rowLimit,paging:(H=(j=i.value)==null?void 0:j.configuration)==null?void 0:H.paging,...((Z=g.value)==null?void 0:Z.offset)!==0?{offset:g.value.offset}:{},objectName:(ne=(te=i.value)==null?void 0:te.configuration)==null?void 0:ne.objectName,currencyCode:r.currencyCode},pe=await window.salesforceConnector.getItems(JSON.stringify(ue));if(pe!=null&&pe.errorMessage){f.handleError(pe.errorMessage);return}pe!=null&&pe.itemCount&&(g.value.totalPages=Math.ceil((pe==null?void 0:pe.itemCount)/g.value.rowLimt)),u.value=Xo(pe.lstItems,{xx_ord1__qty__c:"1"}),(Q=pe.lstItems)!=null&&Q.length||(d.value=!0),s.value=!1}catch(ce){f.handleError("Failed to fetch Results. Please try again."),s.value=!1,console.info("[ERROR]: Adaptive Search getItems() error = ",ce)}}async function R(N){try{c.value=!0;const T=JSON.stringify({lstQLIRequest:z(N),quoteId:t.quoteId});let O=await window.salesforceConnector.createQLI(T);typeof O=="string"&&(O=JSON.parse(O));let F=!1;if((O==null?void 0:O.length)>0&&O.forEach(q=>{q.errorMessage&&(F=!0,f.handleError(q.errorMessage))}),c.value=!1,F){b.value=O;const q=b.value.reduce((M,U)=>(M[U.eCatalogItemId]=U.errorMessage,M),{});u.value=u.value.map(M=>({...M,backendError:q[M.Id]||""}));return}return O}catch(T){f.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addToQuote() error = ",T)}}function z(N){const T=[];for(const O of N)if(!O.addedToQuote&&O.id){const F=$(O);p.value++,T.push({fields:F,recordId:O.id,...N.length===1?{maxSequenceNumber:p.value}:{}})}return T}function $(N){const T=[],O=X();return Object.keys(N).forEach(F=>{if(O.includes(F)){const q=Hc[F.toLowerCase()];q&&T.push({fieldname:q,value:N[F]})}}),T}function X(){const N=[];return i.value.configuration.columns.forEach(T=>{T.field&&!T.field.includes(".")&&T.isEditable&&T.visible&&N.push(T.field)}),N}function W(){var T,O;const N=[];return i.value.configuration.columns.forEach(F=>{const q=F.field.toLowerCase();N.includes(q)||N.push(q)}),(T=i.value.configuration)!=null&&T.dynamicFilters&&i.value.configuration.dynamicFilters.filters.forEach(F=>{const q=F.field.toLowerCase();N.includes(q)||N.push(q)}),(O=i.value.configuration)!=null&&O.cardHeader&&N.push(i.value.configuration.cardHeader.imageField),N}async function K(){var O;const N=W(),T=((O=i.value.configuration)==null?void 0:O.saveObjectName)||i.value.configuration.objectName;if(T==="xx_ord1__ecatalog_item__c"){const F=N.indexOf("xx_ord1__qty__c");F>-1&&N.splice(F,1)}await t.getFieldsData(N,T),t.fieldsData.xx_ord1__qty__c||t.getFieldsData(["xx_ord1__qty__c"],"xx_ord1__quote_line_item__c")}async function P({searchTerm:N="",filters:T=[]}={}){if(x.value=!0,N&&(h.value=N),T.length&&(y.value=T),await C()){await K(),x.value=!1;const F=h.value;F&&(h.value=F,await I(F,t.dynamicFilters)),console.info("actionStore.isStaticActionCall = ",o.isStaticActionCall),o.isStaticActionCall&&(o.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"}]})}x.value=!1}return{selectedItem:a,AdaptiveSearchLayout:i,searchText:h,loadingAdaptiveLayout:l,getAdaptiveSearchLayout:C,getItems:I,lstItems:u,rowItemsLoading:s,noSearchRecords:d,dynamicFilters:m,setDynamicFilters:_,createQliErrors:b,addToQuote:R,addingToQuote:c,getFieldsData:K,pagingData:g,appliedDynamicFilters:y,maxSequenceNumber:p,loadingAdaptiveSearch:x,initAdaptiveSearch:P}}),I7="XX_ORD1__Quote__c",T7="xxord1salespricec",Sr="xx_ord1__item__c",O7="xxord1productnrcc",D7=it.defineStore("cartStore",()=>{const t=$n(),r=Kc(),n=Mt(),o=e.ref(""),a=e.ref("$0"),i=e.ref("$0"),l=e.ref(null),s=e.ref({}),u=e.ref({}),h=e.ref({}),d=e.ref(""),m=e.ref(""),c=e.ref({}),y=e.ref(""),f=e.ref(""),b=e.ref({});async function p(){A()}async function x(){try{let D=await window.salesforceConnector.getProductCount(t.quoteId);if(D=Tt(D),D!=null&&D.errorMessage){n.handleError(D.errorMessage);return}return o.value=D,D}catch{n.handleError("Failed to get Product Count. Please try again.")}}async function g(){try{let D=await window.salesforceConnector.getQuoteTotal(t.quoteId);if(D=Tt(D),D!=null&&D.errorMessage){n.handleError(D.errorMessage);return}return i.value=D.monthlyTotal,a.value=D.onetimeTotal,D}catch{n.handleError("Failed to get Total Amount. Please try again.")}}async function C(D,w,v,S=""){if(!t.sectionDataMap.get(v).parentQLIs[w].removingItem){t.sectionDataMap.get(v).parentQLIs[w].removingItem=!0,f.value=D.id,await _(D.id)==="Success"&&(t.fetchAllQuoteLineItems(),S&&S(D,w,v));let R=t.sectionDataMap.get(v).parentQLIs.filter(z=>z[Sr]===D[Sr]).length;f.value="",r.lstItems.forEach(z=>{z[Sr]===D[Sr]&&(z.addedToQuote===!0&&(z.addedToQuote=!1),R===0&&(z.removedFromQuote=!0))})}}async function _(D){try{let w=await window.salesforceConnector.deleteQLI(D);if(w!=null&&w.errorMessage){n.handleError(w.errorMessage);return}return x(),g(),w}catch{n.handleError("Failed to remove Quote Item. Please try again.")}}function E(D){var S,I;const w=(S=D==null?void 0:D[O7])==null?void 0:S.match(/\.\d+/);w&&(w.value=w[0].length-1);const v=(I=D==null?void 0:D[T7])==null?void 0:I.match(/\.\d+/);return v&&(v.value=v[0].length-1),w||v}function A(D=!0){x(),g(),D&&t.fetchTemplates(I7).then(()=>{t.getFilteredListWithFields()})}function k(D){const w=t.sectionDataMap;for(const[,v]of w.entries())v.parentQLIs.forEach(S=>{S.id===D.id&&(v.columns.forEach(I=>{if(I.dataType==="CURRENCY"){const R=I.field.replace(/_/g,"");S[R]=B(S[R],D[I.field])}}),D!=null&&D.billingPeriodValue&&(D!=null&&D.formattedBillingPeriodValue)&&(S.formattedBillingPeriodValue=B(S.formattedBillingPeriodValue,D.billingPeriodValue)),D!=null&&D.oneTimeValue&&(D!=null&&D.formattedOneTimeValue)&&(S.formattedOneTimeValue=B(S.formattedOneTimeValue,D.oneTimeValue)))})}function B(D,w){const v=Number(w);if(isNaN(v))return D;const S=D.match(/(\d[\d,]*)(\.\d+)?/);if(!S)return D;const I=S[2]||"",R=I.length?I.length-1:0,z=v.toLocaleString("en-US",{minimumFractionDigits:R,maximumFractionDigits:R});return D.replace(S[1]+I,z)}return{initializeCart:p,loadCartState:A,productCount:o,onetimeTotal:a,monthlyTotal:i,filterCartItem:l,billingPeriodValue:d,hasOneTimeValue:m,hasBillingPeriodInList:s,oneTimeFieldAvailable:u,billingPeriodFieldAvailable:h,priceDecimalPrecision:c,cartItemUpdatingId:y,removingItemLoaderId:f,cartItemColumnsMap:b,getProductCount:x,getQuoteTotal:g,removeItem:C,removeQuoteItem:_,getDecimalPrecisionFromSalesPriceOrNRC:E,updateFormattedValues:k,formateCurrencyValue:B}}),V7=t=>[{title:"Apply Discount",subOptions:[...t.map(r=>`Apply Discount on ${r} for `),"Show Maximum discount allowed","Apply Maximum Discount Allowed",...t.map(r=>`Apply Discount on ${r} 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"]}],F7={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"}]},M7=[{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"]}],$n=it.defineStore("quote",()=>{const t=Mt(),r=D7(),n=wo(),o=e.ref(""),a=e.ref(""),i=e.ref(0),l=e.ref(""),s=e.ref([]),u=e.ref({template:!0,filteredList:!1}),h=e.ref(null),d=e.ref(new Map),m=e.ref({}),c=e.ref(!1),y=e.ref(!0),f=e.ref(!1),b=e.ref({text:"Hide Options",altText:"Show Options",handler:()=>{y.value=!y.value,B()},color:"#136E05",isActive:!1}),p=e.computed(()=>{const P=Array.from(d.value.values()).map(N=>N.sectionName);return V7(P)});e.watch(l,()=>{u.value.template||k()});function x(){const P=new Map,N=[];for(const[O,F]of d.value.entries())P.set(O,F.selected),N.push(F);const T=JSON.parse(JSON.stringify(N));return T.forEach(O=>{delete O.selected;const F=new Map,q=[];O.lineItems.forEach(M=>{M.Selected=P.get(O.tableId).get(M.id)||!1,M.xx_ord1__parent_qli__c?(F.has(M.xx_ord1__parent_qli__c)||F.set(M.xx_ord1__parent_qli__c,[]),F.get(M.xx_ord1__parent_qli__c).push(M)):q.push(M)}),O.lineItems=q.map(M=>({...M,options:F.get(M.id)||[]})),delete O.loading,delete O.parentQLIs,delete O.totalValues}),{showOptions:y.value,sections:T,templateId:l.value}}async function g(P){try{let N=await window.salesforceConnector.getPrimaryQuote(P);N=Tt(N),N!==void 0&&(console.info("getPrimaryQuote",JSON.stringify(N)),o.value=N.recordId,console.info("quoteId",o.value),a.value=N.name,l.value=N==null?void 0:N.templateId,i.value=(N==null?void 0:N.lineItemsCount)||0)}catch(N){t.handleError(N.message),console.info("[ERROR]: getPrimaryQuote() error = ",N)}}async function C(P){var N,T;try{u.value.template=!0;let O=await window.salesforceConnector.fetchContentTemplates(JSON.stringify({lstObjectName:[P],templateType:"Document",templateId:null,fetchOnlyDefault:!1}));O=Tt(O);const F=O==null?void 0:O.templates[P];return l.value||(l.value=(N=F.find(q=>q.XX_ORD1__Default__c))==null?void 0:N.Id),l.value||(l.value=(T=F[0])==null?void 0:T.Id),s.value=F,u.value.template=!1,s.value}catch(O){t.handleError(O.message),console.info("[ERROR]: fetchTemplates() error = ",O)}}function _(P){if(!P)return null;const N=/\{!\$(\w+):([\w.]+)\}/,T=P.match(N);return T?{function:T[1],apiname:T[2].split(".")[1]}:null}async function E(P){try{const N={Id:o.value,XX_ORD1__Document_Template__c:P};return await window.salesforceConnector.updateQuote(JSON.stringify([N]))}catch(N){t.handleError(N.message),console.info("[ERROR]: updateQuote() error = ",N)}}async function A(){try{u.value.filteredList=!0;let P=await window.salesforceConnector.getQuoteEPageLayout();d.value.clear(),r.cartItemColumnsMap={},P=Tt(P);const N=P.map(O=>({label:O.fieldLabel,field:O.fieldName.toLowerCase(),isEditable:O.isEditable,dataType:O.dataType,...O.picklistValues?{picklistValues:O.picklistValues}:{}})),T=vn();return d.value.set(T,{loading:!0,lineItems:[],parentQLIs:[],columns:N,tableId:T,sectionName:"All Rows",selected:new Map,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}),r.cartItemColumnsMap[T]=N,b.value.isActive=!1,y.value=!0,h.value={lstCB:[{columns:N,footer:null,title:"All Rows",sectionName:"All Rows",tableId:T,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}]},B(),u.value.filteredList=!1,P}catch(P){t.handleError(P.message),console.info("[ERROR]: getQuoteEPageLayout() error = ",P)}}async function k(){if(s.value.length===0){A();return}try{u.value.filteredList=!0;let P=await window.salesforceConnector.getFilteredListWithFields(JSON.stringify({templateId:l.value}));E(l.value),P=Tt(P),console.info("res.lstCB = ",P.lstCB);const N=P==null?void 0:P.objectFieldsMap;return d.value.clear(),r.cartItemColumnsMap={},P.lstCB=P.lstCB.map(T=>{const{fields:O,filters:F,primarysort:q,primarysortdesc:M}=JSON.parse(T.XX_ORD1__Block_Properties__c),U=O.map(j=>{var H;return{label:(H=N[j.api])==null?void 0:H.label,field:j.api.toLowerCase(),isEditable:j.api.includes(".")?!1:N[j.api].isEditable,dataType:N[j.api].dataType,...N[j.api].picklistValues?{picklistValues:N[j.api].picklistValues}:{}}}),L=T.Id||vn();return d.value.set(L,{loading:!0,lineItems:[],parentQLIs:[],columns:U,tableId:L,sectionName:T.Name,selected:new Map,footer:_(T.XX_ORD1__Table_Footer_HTML__c),filters:F,primarysort:q,primarysortdesc:M}),r.cartItemColumnsMap[L]=U,b.value.isActive=!1,y.value=!0,{columns:U,footer:_(T.XX_ORD1__Table_Footer_HTML__c),title:T.Name,sectionName:T.Name,tableId:L,filters:F,primarysort:q,primarysortdesc:M}}),h.value=P,B(),u.value.filteredList=!1,P}catch(P){t.handleError(P.message),console.info("[ERROR]: getFilteredListWithFields() error = ",P)}}async function B(P=!0){const N=[];for(const[T]of d.value)N.push(v(T,P));return await Promise.all(N),r.getProductCount(),!0}function D(P,N){return d.value.get(P).columns.some(T=>T.field.toLowerCase()===N)||r.cartItemColumnsMap[P].some(T=>T.field.toLowerCase()===N)}function w(P,N){let T=Xo(P);const O=n.pricingSchema,F=D(N,"xx_ord1__nrc__c"),q=D(N,"xx_ord1__sales_price__c"),M=D(N,"xx_ord1__qty__c");return T=T.map(U=>{let L={};O==="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?L={...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}:{},...F?{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}:{}}:O==="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)?q&&(L={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}):O!=="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?q&&(L={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}):O!=="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)&&q&&(L={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:j,xx_ord1__sales_price__c:H,xx_ord1__nrc__c:Z,...te}=U,ne={...te,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,...M?{xx_ord1__qty__c:j}:{},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",...L};return ne!=null&&ne.billingPeriodValue&&(r.hasBillingPeriodInList[N]=!0,r.billingPeriodValue=ne==null?void 0:ne.xx_ord1__billing_period__c),"oneTimeValue"in ne&&(r.oneTimeFieldAvailable[N]=!0),"billingPeriodValue"in ne&&(r.billingPeriodFieldAvailable[N]=!0),(ne==null?void 0:ne.oneTimeValue)!==""&&(ne==null?void 0:ne.oneTimeValue)!==null&&(r.hasOneTimeValue=!0),ne}),T}async function v(P,N=!0){var T,O;try{const F=d.value.get(P);if(console.info("sectionData = ",F.sectionName),!F)return;F.loading=N,N&&(F.lineItems=[]);const{columns:q,filters:M,primarysort:U,primarysortdesc:L,footer:j}=F,H=q.map(pe=>pe.field.toLowerCase());H.includes("xx_ord1__parent_qli__c")||H.push("xx_ord1__parent_qli__c"),H.includes("xx_ord1__item__c")||H.push("xx_ord1__item__c"),H.includes("xx_ord1__sys_configuration_status2__c")||H.push("xx_ord1__sys_configuration_status2__c"),(T=r.cartItemColumnsMap[P])==null||T.forEach(pe=>{H.includes(pe.field)||H.push(pe.field)});const Z=await S({fields:H,recordId:o.value,filters:M||[],primarySortBy:U||"",primarySortOrder:L?"DESC":"ASC",includeOptions:y.value,totalFields:j?[j.apiname]:[]}),te=Z.lineItems,ne=new Map;let Q=[];const ce=(O=Z.fieldTotals)==null?void 0:O.map(pe=>pe.totalValue);te.forEach(pe=>{pe.XX_ORD1__Parent_QLI__c?ne.has(pe.XX_ORD1__Parent_QLI__c)?ne.get(pe.XX_ORD1__Parent_QLI__c).push(pe):ne.set(pe.XX_ORD1__Parent_QLI__c,[pe]):Q.push(pe)});const ue=[];return Q.forEach(pe=>{ue.push(pe),ne.has(pe.Id)&&ue.push(...ne.get(pe.Id))}),Q=w(Q,P),F.lineItems=Xo(ue),F.parentQLIs=Q,F.totalValues=ce,F.loading=!1,d.value=new Map(d.value),ue}catch(F){console.info("[ERROR]: fetchQuoteLineItems()123 error = ",F.message);const q=d.value.get(P);q&&(q.loading=!1)}}async function S(P){try{let N=await window.salesforceConnector.getQuoteLineItemsWithFilteredTable(JSON.stringify(P));return N=Tt(N),N}catch(N){t.handleError(N.message),console.info("[ERROR]: getQuoteLineItemsWithFilteredTable() error = ",N)}}async function I(P){try{console.info("updateQli() payload = ",P);let N=await window.salesforceConnector.updateQli(JSON.stringify(P));return N=Tt(N),B(!1),N}catch(N){t.handleError(N.message),console.info("[ERROR]: updateQli() error = ",N)}}async function R(P){try{let N=await window.salesforceConnector.deleteQLI(P);return N=Tt(N),B(),N}catch(N){t.handleError(N.message),console.info("[ERROR]: deleteQLI() error = ",N)}}async function z(P,N){try{c.value=!0;const T={fields:P};N&&(T.objectName=N),P.includes("xx_ord1__qty__c")&&N==="xx_ord1__ecatalog_item__c"&&(T.fields=T.fields.filter(F=>F!=="xx_ord1__qty__c")),P.includes("xx_ord1__sales_price__c")&&N!=="xx_ord1__quote_line_item__c"&&(T.fields=T.fields.filter(F=>F!=="xx_ord1__sales_price__c"));let O=await window.salesforceConnector.getFieldsData(JSON.stringify(T));return typeof O=="string"&&(O=JSON.parse(O)),O!=null&&O.errorMessage?(t.handleError(O.errorMessage),null):(m.value={...m.value,...O},console.info("fieldsData.value = ",JSON.stringify(m.value)),O)}catch(T){return t.handleError("Failed to get Fields Data. Please try again."),console.info("[ERROR]: getFieldsData() error = ",T),null}finally{c.value=!1}}function $(P=""){var N;return!P||P.includes(".")?!1:P.includes("xx_ord1__qty__c")?!0:((N=m.value[P])==null?void 0:N.isEditable)||!1}function X(){W(F7)}async function W(P){var N,T,O,F,q,M,U,L,j;if(P.payload){if((N=P.payload)!=null&&N.uiModification){const H=P.payload.uiModification;if(((T=H.addColumn)==null?void 0:T.length)>0)if(H.addColumn.forEach(Z=>{Z.columns.forEach(te=>{te.field=te.field.toLowerCase()})}),H.addColumn[0].sectionName==="all_section")for(const[Z,te]of d.value)te.columns=[...te.columns,...H.addColumn[0].columns];else H.addColumn.forEach(Z=>{d.value.get(Z.tableId)&&(d.value.get(Z.tableId).columns=[...d.value.get(Z.tableId).columns,...Z.columns])});if(((O=H.removeColumn)==null?void 0:O.length)>0)if(H.removeColumn.forEach(Z=>{Z.columns=Z.columns.map(te=>te.toLowerCase())}),H.removeColumn[0].sectionName==="all_section")for(const[Z,te]of d.value)te.columns=te.columns.filter(ne=>!H.removeColumn[0].columns.includes(ne.field));else H.removeColumn.forEach(Z=>{d.value.get(Z.tableId)&&(d.value.get(Z.tableId).columns=d.value.get(Z.tableId).columns.filter(te=>!Z.columns.includes(te.field)))});if(((F=H.filter)==null?void 0:F.length)>0)if(H.filter[0].sectionName==="all_section")for(const[Z,te]of d.value)te.filters=[...te.filters,...H.filter[0].filters];else H.filter.forEach(Z=>{d.value.get(Z.tableId)&&(d.value.get(Z.tableId).filters=[...d.value.get(Z.tableId).filters,...Z.filters])});if(((q=H.groupBy)==null?void 0:q.length)>0){const Z=((M=[...d.value.values()][0])==null?void 0:M.columns)||M7;d.value.clear(),r.cartItemColumnsMap={},H.groupBy.forEach(te=>{r.cartItemColumnsMap[te.tableId]=te.columns||Z,d.value.set(te.tableId,{loading:!0,lineItems:[],parentQLIs:[],columns:te.columns||Z,tableId:te.tableId,sectionName:te.sectionName,selected:new Map,footer:_(te.footer),filters:te.filters,primarysort:te.primarysort,primarysortdesc:te.primarysortdesc})})}H.showOptions!==void 0&&(y.value=H.showOptions)}if(((L=(U=P.payload)==null?void 0:U.sections)==null?void 0:L.length)>0){const H=(j=P.payload)==null?void 0:j.sections;d.value.clear(),H.forEach(Z=>{Z.tableId||(Z.tableId=vn()),Z.selected=new Map,d.value.set(Z.tableId,Z)}),B()}}P.actionFunction==="Reload"&&(console.log("Reloading configurator 3"),B(),console.info("Reloading quote line items"))}async function K(P){var N,T;try{const O=new Set;for(const F of d.value.keys())(N=d.value.get(F).lineItems)==null||N.forEach(M=>{M.attributes=null,O.add(M.id)});if(P){const F={lineItemIds:[...O]},q=await window.productManagerController.getLineItemAttributes({request:JSON.stringify(F)}),M=JSON.parse(q.data);for(const U of d.value.keys())(T=d.value.get(U).lineItems)==null||T.forEach(j=>{j.attributes=M[j.id]||null})}}catch(O){console.info("[ERROR]: fetchAttributesData() error = ",O)}}return{showAttributes:f,quoteId:o,quoteName:a,templateId:l,templateOptions:s,loading:u,currentTemplateData:h,fieldsData:m,fieldsDataLoading:c,showOptionHeaderButton:b,sectionDataMap:d,promptSuggestions:p,lineItemsCount:i,addColumns:X,getQuoteEPageLayout:A,getPayload:x,getPrimaryQuote:g,fetchTemplates:C,getFilteredListWithFields:k,getQuoteLineItemsWithFilteredTable:S,updateQli:I,getFieldsData:z,deleteQLI:R,performAIAction:W,isEditableField:$,fetchQuoteLineItems:v,fetchAllQuoteLineItems:B,fetchAttributesData:K}}),wo=it.defineStore("comRoot",()=>{const t=Un(),r=Mt(),n=$n(),o=e.ref(""),a=e.ref(""),i=e.ref("Genesis AI"),l=e.ref(""),s=e.ref({}),u=e.ref(""),h=e.ref(""),d=e.ref(""),m=e.ref(""),c=e.ref({}),y=e.ref(""),f=e.ref(""),b=e.ref(""),p=e.ref(""),x=e.ref(""),g=e.ref(""),C=e.ref(""),_=e.ref("Single"),E=e.ref("closed"),A=e.computed(()=>n.quoteName),k=e.computed(()=>_.value==="Single");async function B(S){o.value=S||Jr("id"),a.value=Jr("origin"),await w(),await D()}async function D(){try{console.info("getRecordInfo",o.value);let S=await window.salesforceConnector.getRecordInfo(o.value);return S=Tt(S),S!==void 0&&(c.value=S,y.value=S.name,f.value=S.objectType,b.value=S.accountId,p.value=S.eCatalogId,x.value=S.currencyCode,g.value=S.userLocale,C.value=S.opportunityId),(S==null?void 0:S.objectType)==="XX_ORD1__Quote__c"?(n.quoteId=S==null?void 0:S.recordId,n.templateId=S==null?void 0:S.templateId,n.quoteName=S==null?void 0:S.name,n.lineItemsCount=(S==null?void 0:S.lineItemsCount)||0):(S==null?void 0:S.objectType)==="Opportunity"&&await n.getPrimaryQuote(S.recordId),S}catch(S){r.handleError(S.message)}}async function w(){var I,R;console.info("getOrgInformation",o.value);const S=await window.salesforceConnector.getOrgInformation();t.websocketUrl=S.websocketUrl,l.value=(I=S.locale)==null?void 0:I.replace("_","-"),s.value=S.user,u.value=S.orgName,h.value=S.orgId,d.value=S.orgType,m.value=S.packageVersion,_.value=(R=S==null?void 0:S.pricingSchema)==null?void 0:R.toLowerCase()}function v(S){i.value=S,z0(S)}return{id:o,origin:a,title:A,subTitle:i,locale:l,user:s,orgName:u,orgId:h,orgType:d,packageVersion:m,objectType:f,recordInfo:c,name:y,accountId:b,eCatalogId:p,currencyCode:x,userLocale:g,opportunityId:C,pricingSchema:_,isSinglePricingSchema:k,flyoutState:E,start:B,getRecordInfo:D,setSubTitle:v}}),R7=it.defineStore("quickSelection",()=>{const t=Mt(),r=wo(),n=$n(),o=e.ref(null),a=e.ref(!1),i=e.ref([]),l=e.ref([]),s=e.ref(!1),u=e.ref({}),h=e.ref({rowLimit:10,paging:!0,offset:0,currentPage:1,totalPages:1}),d=e.ref(!1);async function m(){a.value=!0;try{const E=JSON.stringify({layoutType:"Quick Selection",layoutObject:"xx_ord1__ecatalog_item__c",...r.objectType?{contextObject:r.objectType}:{}});let A={};A=await window.salesforceConnector.getDynamicPageLayout(E),o.value=Cl(A,"Unable to find the Quick Selection Layout for your user profile"),console.info("quickSelectionLayout.value = ",o.value),h.value.rowLimit=o.value.configuration.rowLimit||10,o.value.data.columns.forEach(k=>{!k.field&&k.label==="QTY"&&(k.field="xx_ord1__qty__c")}),a.value=!1}catch(E){a.value=!1,t.handleError("Failed to get Page structure data. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",E)}}function c(){const E=new Map;return o.value.data.columns.forEach(A=>{E.set(A.field,!0)}),o.value.data.searchResultColumns.forEach(A=>{E.set(A.field,!0)}),Array.from(E.keys())}async function y(E){var A,k;try{let B=await window.salesforceConnector.saveCompetitorSKU(E);if(B!=null&&B.errorMessage){t.handleError(B.errorMessage);return}if((A=B[0])!=null&&A.errorMessage){t.handleError((k=B[0])==null?void 0:k.errorMessage);return}return B}catch(B){t.handleError("Failed to Match Item. Please try again."),console.info("[ERROR]: saveCompetitorSKU() error = ",B)}}async function f(E="",A=[]){try{let k=o.value.data,B=o.value.configuration;const D=E.trim();if(console.info("searchTextValue.trim() = ",E.trim()),!D)return[];let w=null;console.info("useMappings = ",d.value),d.value?w=B7(b()):w=b(),console.info("fields before filter = ",w),w=w.filter(R=>R!=="xx_ord1__qty__c"),console.info("fields after filter = ",w);const v={fields:w,...A.length?{dynamicFilters:n.getDynamicFilters(A)}:{},searchText:D,accountId:r.accountId,...r.eCatalogId?{catalogId:r.eCatalogId}:{},...r.objectType==="opportunity"?{opportunityId:r.id}:{},...k!=null&&k.sort?{primarySortBy:k.sort.primary.field,primarySortOrder:k.sort.primary.direction,secondarySortBy:k.sort.secondary.field,secondarySortOrder:k.sort.secondary.direction}:{},rowLimt:(B==null?void 0:B.rowLimit)||20,paging:(B==null?void 0:B.paging)||!1,...h.value.offset!==0?{offset:h.value.offset}:{},objectName:k.objectName,currencyCode:r.currencyCode};console.info("getQuickSelectionItems payload = ",JSON.stringify(v));const S=await window.salesforceConnector.getItems(JSON.stringify(v));if(console.info("getQuickSelectionItems Res = ",JSON.stringify(S)),S!=null&&S.errorMessage){t.handleError(S.errorMessage);return}return S!=null&&S.itemCount&&(h.value.totalPages=Math.ceil((S==null?void 0:S.itemCount)/h.value.rowLimit)),Xo(S.lstItems,{xx_ord1__qty__c:"1"})}catch(k){t.handleError("Failed to fetch Results. Please try again."),console.info("[ERROR]: getQuickSelectionItems() error = ",k)}}function b(){let E=[];for(const A of o.value.data.columns){let k=A.field;if(k!=null&&k.includes(".")){E.includes(k)||E.push(k);let D=k.split(".")[0];D=D.slice(0,-1)+"c",E.includes(D)||E.push(D)}else E.includes(k)||E.push(k)}return console.info("getAllQuickSelectionFields() fields = ",E),E.filter(A=>A.toLowerCase()!=="xx_ord1__qty__c")}async function p(E,A,k,B){console.info("searchText:",JSON.stringify(E)),console.info("row:",JSON.stringify(A)),console.info("rowIndex:",JSON.stringify(k)),console.info("column:",JSON.stringify(B));const D=k+(h.value.currentPage-1)*h.value.rowLimit;if(B.field.toLowerCase().includes("xx_ord1__item__r")){if(i.value[D].itemLookupLoading=!0,d.value=!0,l.value=await f(E),l.value.length>0){const w=[];for(let v=0;v<l.value.length;v++)i.value[D].itemDataRetrieved=!0,l.value[v].xx_ord1__item__c&&w.push({name:l.value[v]["xx_ord1__item__r.name"],value:l.value[v].xx_ord1__item__c,label:l.value[v][B.field.toLowerCase()]});i.value[D][B.field.toLowerCase()+"_options"]=w}i.value[D].itemLookupLoading=!1}else if(B.field.toLowerCase().includes("xx_ord1__competitor_item__r")){i.value[D].competitorLookupLoading=!0;const w=await x(E);w!=null&&w.items&&(i.value[D][B.field.toLowerCase()+"_options"]=w.items.map(v=>({name:v.fields[2].value,value:v.fields[1].value,label:v.fields[0].value}))),i.value[D].competitorLookupLoading=!1,console.info("getLookupData:: Search Lookup Handler Response = ",w)}}async function x(E){var k,B;console.info("getLookupData() searchText = ",E);const A={searchText:E,obj:"xx_ord1__competitor_item__c",filters:null,displayFields:["xx_ord1__sku__c"]};try{let D=await window.salesforceConnector.getLookupData(JSON.stringify(A));if(typeof D=="string"&&(D=JSON.parse(D)),D!=null&&D.errorMessage){t.handleError(D.errorMessage);return}if((k=D[0])!=null&&k.errorMessage){t.handleError((B=D[0])==null?void 0:B.errorMessage);return}return D}catch(D){t.handleError("Failed to Search For Item. Please try again."),console.info("[ERROR]: getLookupData() error = ",D)}}async function g(E,A){var B;console.info("Update Other Fields Value = ",E),console.info("Update Other Fields Row Index = ",A);const k=A+(h.value.currentPage-1)*h.value.rowLimit;console.info("actualRowIndex = ",k);try{if(E){const D=l.value.filter(w=>w.xx_ord1__item__c===E)[0];if(D){s.value=!0;const w=o.value.data.columns[1].field;i.value[k][w]&&await C(D,k),(B=i.value[k])!=null&&B.itemDataRetrieved&&(i.value[k].status="New Match Requested",i.value[k].noMatchCleared=!0),Object.keys(D).forEach(v=>{const S=Hc[v.toLowerCase()];console.info("Mapped Key = ",S),S&&(i.value[k][S]=D[v])}),s.value=!1}else i.value[k].status=""}else i.value[k].status="No Match"}catch(D){t.handleError("Unable to request a match for this item please try again."),console.info("Error in updateOtherFields = ",D)}}async function C(E,A){const k=i.value[A],B=o.value.data.columns[1].field,D=[{sku:k[B],name:k[B],productDescription:k.xx_ord1__line_description__c||"",productURL:null,status:"Match Requested",competitorAccountId:null,itemId:E.xx_ord1__item__c}];let w=await y(JSON.stringify(D));console.info("Match Item: ",JSON.stringify(w)),i.value[A][`${B}_options`]=[{value:w[0].competitorItemId,label:w[0].sku}],i.value[A][B]=w[0].competitorItemId}async function _(E){try{let A=await window.salesforceConnector.createQLI(JSON.stringify(E));typeof A=="string"&&(A=JSON.parse(A));let k=!1;if((A==null?void 0:A.length)>0)for(let B=0;B<A.length;B++)A[B].errorMessage&&(k=!0,A[B].errorMessage.includes("Line Description: data value too large")&&(A[B].errorMessage="Error: The description is too long—it must be under 200 characters."));if(k){A.forEach(B=>{u.value[B.eCatalogItemId]=B});return}else u.value=[];return A}catch(A){t.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addAllItemsToQuote() error = ",A)}}return{quickSelectionLayout:o,quickSelectionLayoutLoading:a,processedRecords:i,useMappings:d,currentSearchData:l,createQliErrors:u,getQuickSelectionLayout:m,getAllFieldsForQuickSelectionLayout:c,saveCompetitorSKU:y,getQuickSelectionItems:f,searchLookupHandler:p,updateOtherFields:g,addAllItemsToQuote:_}});function L7(t,r,n){const o=[];return t.templateId||o.push("AI_GUIDANCE_MISSING_TEMPLATE_ID"),t.composablesOrgType||o.push("AI_GUIDANCE_MISSING_COMPOSABLES_ORG_TYPE"),t.websocketUrl||o.push("AI_GUIDANCE_MISSING_WEBSOCKET_URL"),t.packageVersion||o.push("AI_GUIDANCE_MISSING_PACKAGE_VERSION"),n!=null&&n.accessToken||o.push("AI_GUIDANCE_MISSING_SECURITY_TOKEN"),r!=null&&r.organizationId||o.push("AI_GUIDANCE_MISSING_IDENTITY_ORG_ID"),r!=null&&r.userId||o.push("AI_GUIDANCE_MISSING_IDENTITY_USER_ID"),r!=null&&r.accountId||o.push("AI_GUIDANCE_MISSING_IDENTITY_ACCOUNT_ID"),o}function Xc(t){return t?!t.startsWith("ws://")&&!t.startsWith("wss://")?"WEBSOCKET_INVALID_URL_FORMAT":null:"WEBSOCKET_MISSING_URL"}function P7(t){var r,n,o,a,i,l;if(!t)return{playbookId:null,error:null};try{const s=(o=(n=(r=t==null?void 0:t[0])==null?void 0:r.blocks)==null?void 0:n[0])==null?void 0:o.playbookId,u=((i=(a=t==null?void 0:t.blocks)==null?void 0:a[0])==null?void 0:i.playbookId)||((l=t==null?void 0:t[0])==null?void 0:l.playbookId);return{playbookId:s||u||null,error:null}}catch(s){return console.error("[validation] Error validating block structure:",s),{playbookId:null,error:"AI_GUIDANCE_BLOCK_STRUCTURE_INVALID"}}}function q7(t,r){const n=[];t!=null&&t.currentPlaybook||n.push("COMPONENT_LOADER_MISSING_PLAYBOOK");const o=r;return o&&o!=="catalog"&&o!=="cart"&&o!=="configurator"&&o!==""&&n.push("COMPONENT_LOADER_INVALID_COMPONENT_KEY"),n}const No="Preparing Your Quote Please Wait...",vi={message:"Your quote is ready! Click 'Add Products' to browse Products, or enter a prompt and AI will do the work for you.",type:"response",requestId:"no-request-id"},$7=18e4,U7=2e3,z7={bgColor:"#EDF8EB",textColor:"#5F5F5F"};function j7({minDisplayMs:t=2e3}={}){const r=[];let n=null,o=!1,a=null,i=null,l=null;const s=new Set;function u(){const g={isActive:o,currentMessage:a?a.message:null,queuedCount:r.length};s.forEach(C=>{try{C(g)}catch{}})}function h(){n||(n=setInterval(m,100))}function d(){n&&(clearInterval(n),n=null)}function m(){if(o){if(!a&&r.length>0){a={...r.shift(),shownAt:Date.now()},u();return}if(a&&Date.now()-a.shownAt>=a.minDisplayMs){if(r.length>0)a={...r.shift(),shownAt:Date.now()},u();else if(a=null,o=!1,d(),u(),i&&l){const C=i,_=l;i=null,l=null;try{_(C)}catch{}}}}}function c(g,C={}){return r.push({message:g,minDisplayMs:C.minDisplayMs||t}),o||(o=!0,h(),u()),r.length}function y(g,C){if(i=g,typeof C=="function"&&(l=C),o)h();else{const _=l,E=i;if(i=null,l=null,_)try{_(E)}catch{}}}function f(g){return typeof g!="function"?()=>{}:(s.add(g),g({isActive:o,currentMessage:a?a.message:null,queuedCount:r.length}),()=>s.delete(g))}function b(){return a?a.message:null}function p(){return o}function x(){r.length=0,a=null,o=!1,i=null,l=null,d(),u()}return{getCurrentMessage:b,getIsActive:p,subscribe:f,enqueue:c,setSuccess:y,clear:x}}const Un=it.defineStore("ai",()=>{const t=wo(),r=$n();Kc(),R7();const n=Rt(),o=Ci(),a=ft(),i=Jn();(()=>{try{return L0()}catch{return{path:""}}})();const l=e.ref(""),s=e.ref([]),u=e.ref(""),h=e.ref([]),d=e.ref(!1),m=e.ref(null),c=e.ref({}),y=e.ref(null),f=e.ref(null),b=e.ref(null),p=e.ref(null),x=e.ref(!1),g=e.ref(!0),C=e.ref(null),_=e.ref(!1),E=e.ref(null),A=e.ref(No),k=j7({minDisplayMs:U7});k.subscribe(({isActive:oe,currentMessage:le})=>{oe&&(A.value=le||No)});const B=e.ref([]),D=e.computed(()=>z7),w=()=>{var Ce,J,se;const le=(se=(J=(((Ce=i.currentPlaybook)==null?void 0:Ce.playBookSteps)||[])[0])==null?void 0:J.uiSpecs)==null?void 0:se.customText;return{message:typeof le=="string"&&le.trim().length>0?le:vi==null?void 0:vi.message,type:"response"}},v=e.ref(vn()),S=e.computed(()=>{const oe=a.organizationId.value,le=a.userId.value,be=a.quoteId.value||a.cid.value||v.value;return`${oe}_${le}_${be}`}),I=e.computed(()=>m.value.readyState==WebSocket.OPEN),R=e.computed(()=>a.websocketUrl.value||""),z=()=>{c.value={salesforceOrgId:a.organizationId.value,salesforceOrgType:a.composablesOrgType.value,salesforceUserId:a.userId.value,userType:"Salesforce",chatRoomId:S.value,chatId:null,requestId:"",prompt:"",initiatedFrom:t.origin||"Quote",internalCall:!1,contextObjectId:a.quoteId.value,contextObjectType:"Quote",payload:{lineItemsCount:r.lineItemsCount},origin:"DXP",defaultBatchSize:10,actionType:"",packageVersion:a.packageVersion.value,relatedIds:{accountId:a.accountId.value,eCatalogId:a.eCatalogId.value||"",contactId:a.cid.value||""}}},$=(oe,le={})=>{g.value&&Et("websocket:error",{errorCode:oe,isInitialization:!0,...le})};async function X(){const oe=Xc(R.value);if(oe)throw $(oe,{url:R.value}),new Error("WebSocket URL validation failed");g.value=!0;const le=1e4;C.value=setTimeout(()=>{if(m.value&&m.value.readyState!==WebSocket.OPEN&&($("WEBSOCKET_CONNECTION_TIMEOUT"),m.value))try{m.value.close()}catch{}},le);let be=!1;return new Promise((J,se)=>{var Se,De,Oe,He;const fe=(Ve,Ge)=>{be||(be=!0,Ve?se(Ve):J(Ge))},Y=()=>{W(),fe(null)},re=Ve=>{K(Ve),be||fe(new Error("WebSocket closed before open"))},me=Ve=>{P(Ve),be||fe((Ve==null?void 0:Ve.error)||new Error("WebSocket error"))};try{const Ve=R.value+"?chatRoomId="+S.value;m.value=new WebSocket(Ve),m.value.addEventListener("open",Y),m.value.addEventListener("message",N),m.value.addEventListener("close",re),m.value.addEventListener("error",me)}catch(Ve){C.value&&(clearTimeout(C.value),C.value=null),(Se=Ve.message)!=null&&Se.includes("network")||(De=Ve.message)!=null&&De.includes("Network")?$("WEBSOCKET_NETWORK_ERROR",{error:Ve.message}):(Oe=Ve.message)!=null&&Oe.includes("CORS")||(He=Ve.message)!=null&&He.includes("cors")?$("WEBSOCKET_CORS_ERROR",{error:Ve.message}):$("WEBSOCKET_CONNECTION_FAILED",{error:Ve.message}),fe(Ve)}})}const W=()=>{C.value&&(clearTimeout(C.value),C.value=null),g.value=!1,F(),U()},K=oe=>{if(C.value&&(clearTimeout(C.value),C.value=null),g.value){const le=(oe==null?void 0:oe.code)??1006,be=(oe==null?void 0:oe.reason)??"";switch(le){case 1e3:break;case 1001:case 1002:case 1003:case 1013:case 1014:$("WEBSOCKET_UNEXPECTED_CLOSE",{closeCode:le,closeReason:be});break;case 1006:$("WEBSOCKET_ABNORMAL_CLOSURE",{closeCode:le,closeReason:be});break;case 1011:$("WEBSOCKET_SERVER_ERROR",{closeCode:le,closeReason:be});break;case 1012:$("WEBSOCKET_SERVICE_RESTART",{closeCode:le,closeReason:be});break;case 1015:$("WEBSOCKET_SSL_ERROR",{closeCode:le,closeReason:be});break;default:le!==1e3&&$("WEBSOCKET_UNEXPECTED_CLOSE",{closeCode:le,closeReason:be})}}g.value=!1,_.value=!1,q()},P=oe=>{var le;if(C.value&&(clearTimeout(C.value),C.value=null),g.value){let be="WEBSOCKET_CONNECTION_FAILED";const Ce=(oe==null?void 0:oe.message)||((le=oe==null?void 0:oe.error)==null?void 0:le.message)||"Unknown websocket error";Ce.includes("network")||Ce.includes("Network")||Ce.includes("Failed to fetch")?be="WEBSOCKET_NETWORK_ERROR":Ce.includes("CORS")||Ce.includes("cors")?be="WEBSOCKET_CORS_ERROR":Ce.includes("SSL")||Ce.includes("TLS")||Ce.includes("certificate")?be="WEBSOCKET_SSL_ERROR":Ce.includes("refused")||Ce.includes("ECONNREFUSED")?be="WEBSOCKET_CONNECTION_REFUSED":(Ce.includes("auth")||Ce.includes("unauthorized")||Ce.includes("401"))&&(be="WEBSOCKET_AUTHENTICATION_FAILED"),$(be,{error:Ce})}_.value=!1,ce(),q()},N=oe=>{var Ce,J,se,fe;F();const le=JSON.parse(oe.data);le!=null&&le.chatId&&(c.value.chatId=le.chatId);const be=(le==null?void 0:le.contextObjectId)??((Ce=le==null?void 0:le.payload)==null?void 0:Ce.contextObjectId);if(be){const Y=c.value.contextObjectId||((J=a.quoteId)==null?void 0:J.value)||"",re=be;re&&re!==Y&&(c.value.contextObjectId=re,a.updateConfig({quoteId:re}),Et("quote-id:updated",{quoteId:re}))}if(O(le),le.status!=="ALIVE"){if((le==null?void 0:le.status)==="IN_PROGRESS"||(le==null?void 0:le.loading)===!0){const Y=(le==null?void 0:le.message)||(le==null?void 0:le.statusMessage)||(le==null?void 0:le.stepName)||No;k.enqueue(Y),A.value=k.getCurrentMessage()||Y;return}if((le==null?void 0:le.status)==="SUCCESS"){const Y=(le==null?void 0:le.message)||No;A.value=k.getCurrentMessage()||Y,k.setSuccess(le,re=>{T(re)});return}Array.isArray(le.messages)?(A.value=null,_.value=!1,s.value.push(w()),le.messages.length>0&&te(le.messages)):le.agentResponse&&(le.errorMessage&&(le.agentResponse.content=le.errorMessage,le.agentResponse.error=!0),A.value=null,s.value.push({message:le.agentResponse.content,type:le.agentResponse.role,requestId:le.requestId,epoch:le.agentResponse.epoch,error:le.agentResponse.error,isDML:le.agentResponse.isDML,...(se=le.agentResponse)!=null&&se.filesData?{filesData:(fe=le.agentResponse)==null?void 0:fe.filesData}:{}})),B.value=le.links||[],ie(le)}};function T(oe,le={}){var J,se,fe,Y;const{skipComponentLoad:be=!1}=le||{},Ce=(oe==null?void 0:oe.contextObjectId)??((J=oe==null?void 0:oe.payload)==null?void 0:J.contextObjectId);if(Ce){const re=c.value.contextObjectId||((se=a.quoteId)==null?void 0:se.value)||"",me=Ce;me&&me!==re&&(console.info("[ai] Updating quoteId from contextObjectId (SUCCESS):",{current:re,new:me}),c.value.contextObjectId=me,a.updateConfig({quoteId:me}),console.info("[ai] Emitting quote-id:updated event with quoteId (SUCCESS):",me),Et("quote-id:updated",{quoteId:me}))}if(oe!=null&&oe.loading){A.value=oe.message;return}else Array.isArray(oe==null?void 0:oe.messages)?(A.value=null,_.value=!1,s.value.push(w()),oe.messages.length>0&&te(oe.messages)):oe!=null&&oe.agentResponse?(oe.errorMessage&&(oe.agentResponse.content=oe.errorMessage,oe.agentResponse.error=!0),A.value=null,s.value.push({message:oe.agentResponse.content,type:oe.agentResponse.role,requestId:oe.requestId,epoch:oe.agentResponse.epoch,error:oe.agentResponse.error,isDML:oe.agentResponse.isDML,...(fe=oe.agentResponse)!=null&&fe.filesData?{filesData:(Y=oe.agentResponse)==null?void 0:Y.filesData}:{}})):A.value=null;B.value=(oe==null?void 0:oe.links)||[];try{Et("ai-response:success",oe)}catch{}be||ie(oe)}const O=oe=>{const le=oe==null?void 0:oe.eventType,be=(oe==null?void 0:oe.loading)===!0||le==="ResponseTextDeltaEvent",Ce=le==="ResponseTextDoneEvent"||Array.isArray(oe==null?void 0:oe.messages)||!!(oe!=null&&oe.agentResponse);if(be&&!Ce){x.value=!0;return}Ce&&(x.value=!1)},F=()=>{q(),y.value=setTimeout(()=>{if(I.value){const oe={action:"heartbeat"};m.value.send(JSON.stringify(oe)),F()}},$7)},q=()=>{y.value&&(clearInterval(y.value),y.value=null)};function M(oe){const le={...c.value};le.requestType="Action",le.actionType="Undo",le.undoRequestId=oe,le.requestId=vn(),Z(le)}function U(){_.value=!0;const oe={...c.value};oe.requestType="Action",oe.actionType="History",oe.requestId=vn(),Z(oe)}function L(oe){return console.info("[ai] isUnsavedChanges check",{activeKey:((i==null?void 0:i.activeComponentKey)||"").toLowerCase(),isChangedConfiguration:n.isChangedConfiguration}),((i==null?void 0:i.activeComponentKey)||"").toLowerCase()==="configurator"&&n.isChangedConfiguration&&console.warn("[ai] Unsaved configurator changes detected; not blocking send"),!1}function j(oe,le=!0,be=null){if(console.info("[ai] sendMessage",{messageLength:(oe||"").length,hasCustomPayload:!!be,addMessageToHistory:le}),L()){console.warn("[ai] sendMessage aborted: unsaved changes detected");return}if(oe.trim()){let Ce={...c.value};Ce.prompt=oe.trim(),Ce.requestType="Chat",Ce.requestId=vn(),Ce.internalCall=!1,Ce.payload=ne(),console.log("[ai] _payload.payload",Ce.payload),Ce.componentName=Q.value,Ce.templateId=r.templateId,Ce.payload.lineItemsCount=r.lineItemsCount,Ce.relatedIds.eCatalogId=a.eCatalogId.value||"",be&&(Ce={...Ce,...be}),ue(),le&&s.value.push({message:oe.trim(),type:"user",...E.value&&{fileData:[E.value]},requestId:Ce.requestId}),console.info("[ai] sending prompt",{requestId:Ce.requestId,requestType:Ce.requestType,componentName:Ce.componentName}),Z(Ce),F()}}const H=e.computed(()=>{var be,Ce,J;const oe=((be=i.currentPlaybook)==null?void 0:be.pbUniqueId)??((Ce=i.currentPlaybook)==null?void 0:Ce.vUniqueId)??null,le=i.currentStepName??((J=i.currentStep)==null?void 0:J.stepName)??null;return{pbUniqueId:oe,stepName:le}});function Z(oe){const le={...oe},{pbUniqueId:be,stepName:Ce}=H.value||{};console.log("[ai] activePlaybookContext",H.value),be&&(le.pbUniqueId=be),Ce&&(le.stepName=Ce);const J={action:"prompt",data:le};m.value.send(JSON.stringify(J))}const te=oe=>{const le=oe.filter(({content:be})=>!!be).map(be=>({message:be.content,type:be.role,requestId:be.requestId,epoch:be.epoch,isDML:be.isDML,undone:be.undone}));le.forEach((be,Ce)=>{be.isDML===!0&&Ce!==le.length-1&&(be.isDML=!1)}),s.value=[...s.value,...le]};function ne(){const oe=((i==null?void 0:i.activeComponentKey)||"").toLowerCase();return console.info("[ai] getRequestBody activeKey",oe),oe==="cart"||oe==="quote_item"?(console.info("[ai] getRequestBody → using quoteStore.getPayload()"),r.getPayload()):oe==="configurator"?o.getPayload():(console.info("[ai] getRequestBody → empty {}"),{})}const Q=e.computed(()=>{const oe=((i==null?void 0:i.activeComponentKey)||"").toLowerCase();return oe==="cart"||oe==="quote_item"?"QuoteItem":""}),ce=()=>{s.value.push({type:"response",message:"Oops! Something went wrong while processing your request. Please try again later.",error:!0})},ue=()=>{s.value=s.value.map(oe=>({...oe,links:[]}))};function pe(oe){var le,be,Ce;try{const J=oe==null?void 0:oe.stepName;if(!J)return!1;const se=He=>String(He||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),fe=((le=i.currentPlaybook)==null?void 0:le.playBookSteps)||[],Y=fe.find(He=>He.stepName===J||He.name===J)||null,me=se(Y==null?void 0:Y.stepComponent)==="configurator"||se(J).includes("configure"),Se=!!((be=oe==null?void 0:oe.payload)!=null&&be.productConfiguration&&Array.isArray(oe.payload.productConfiguration)&&oe.payload.productConfiguration.length===0),Oe=se(i.currentStep&&i.currentStep.stepComponent||((Ce=fe.find(He=>He.stepName===(i.currentStepName||"")))==null?void 0:Ce.stepComponent)||i.activeComponentKey)==="configurator";return me&&Se&&Oe}catch{return!1}}function ie(oe){var Ce,J,se,fe;const le=(oe==null?void 0:oe.contextObjectId)??((Ce=oe==null?void 0:oe.payload)==null?void 0:Ce.contextObjectId);if(le){const Y=le,re=c.value.contextObjectId||((J=a.quoteId)==null?void 0:J.value)||"";Y&&Y!==re&&(c.value.contextObjectId=Y,a.updateConfig({quoteId:Y}),Et("quote-id:updated",{quoteId:Y}))}const be=oe==null?void 0:oe.stepName;if(be){if(be==="AI Guidance"||be==="ai_guidance"||be.toLowerCase()==="ai guidance"){console.info("[ai] Skipping navigation for AI Guidance step - side panel will remain in current state");return}if(pe(oe)){console.info("[ai] Skipping configurator update: empty productConfiguration and configurator already active"),(oe==null?void 0:oe.actionFunction)==="Reload"&&(console.log("Reloading configurator 2"),o.refresh());return}try{i.navigateToStep({stepName:be,data:oe})}catch(Y){console.info("navigateToStep failed, falling back to legacy component routing",Y)}return}else{if(i.currentStepName||i.currentStep&&i.currentStep.stepName||null)return;(fe=(se=i.currentPlaybook)==null?void 0:se.playBookSteps)!=null&&fe.length&&i.navigateToStep({stepName:i.currentPlaybook.playBookSteps[0].stepName});return}}function de(){if(I.value){const oe={action:"cancel",data:{requestId:c.value.requestId,chatRoomId:S.value}};m.value.send(JSON.stringify(oe))}}function _e(){try{if(C.value&&(clearTimeout(C.value),C.value=null),g.value=!1,m.value){try{m.value.removeEventListener("open",W)}catch{}try{m.value.removeEventListener("message",N)}catch{}try{m.value.removeEventListener("close",K)}catch{}try{m.value.removeEventListener("error",P)}catch{}try{m.value.close()}catch{}m.value=null}}finally{ye()}}function xe(){try{k.clear()}catch{}l.value="",s.value=[],u.value="",h.value=[],d.value=!1,B.value=[],E.value=null,x.value=!1,p.value=null,A.value=No,c.value={},q(),ye()}const ye=()=>{f.value&&(clearInterval(f.value),f.value=null),y.value&&(clearInterval(y.value),y.value=null),b.value&&(clearTimeout(b.value),b.value=null)};return e.onBeforeUnmount(()=>{ye()}),{unsavedChanges:p,loadingMessage:A,promptMessage:l,buttonLinks:B,websocketUrl:R,chatHistory:s,latestDMLRequest:u,strikethroughHistory:h,attachmentData:E,dataManuallyChanged:d,isThinkingMessage:x,isFetchingHistory:_,chatStyles:D,undoAction:M,connectSocket:X,sendMessage:j,setInitialPayload:z,cancelRequest:de,disconnectSocket:_e,resetState:xe}}),H7={AI_GUIDANCE_MISSING_TEMPLATE_ID:{code:"AI_GUIDANCE_MISSING_TEMPLATE_ID",message:"Template ID is required for AI Guidance to initialize",component:"aiGuidance"},AI_GUIDANCE_MISSING_COMPOSABLES_ORG_TYPE:{code:"AI_GUIDANCE_MISSING_COMPOSABLES_ORG_TYPE",message:"Composables organization type is required",component:"aiGuidance"},AI_GUIDANCE_MISSING_WEBSOCKET_URL:{code:"AI_GUIDANCE_MISSING_WEBSOCKET_URL",message:"WebSocket URL is required for AI Guidance to connect",component:"aiGuidance"},AI_GUIDANCE_MISSING_PACKAGE_VERSION:{code:"AI_GUIDANCE_MISSING_PACKAGE_VERSION",message:"Package version is required",component:"aiGuidance"},AI_GUIDANCE_MISSING_SECURITY_TOKEN:{code:"AI_GUIDANCE_MISSING_SECURITY_TOKEN",message:"Security access token is required for authentication",component:"aiGuidance"},AI_GUIDANCE_MISSING_IDENTITY_ORG_ID:{code:"AI_GUIDANCE_MISSING_IDENTITY_ORG_ID",message:"Organization ID is required in identity context",component:"aiGuidance"},AI_GUIDANCE_MISSING_IDENTITY_USER_ID:{code:"AI_GUIDANCE_MISSING_IDENTITY_USER_ID",message:"User ID is required in identity context",component:"aiGuidance"},AI_GUIDANCE_MISSING_IDENTITY_ACCOUNT_ID:{code:"AI_GUIDANCE_MISSING_IDENTITY_ACCOUNT_ID",message:"Account ID is required in identity context",component:"aiGuidance"},AI_GUIDANCE_PLAYBOOK_INFO_FETCH_FAILED:{code:"AI_GUIDANCE_PLAYBOOK_INFO_FETCH_FAILED",message:"Failed to fetch playbook information from quote",component:"aiGuidance"},AI_GUIDANCE_PLAYBOOK_FETCH_FAILED:{code:"AI_GUIDANCE_PLAYBOOK_FETCH_FAILED",message:"Failed to fetch playbook data",component:"aiGuidance"},AI_GUIDANCE_CATALOG_FETCH_FAILED:{code:"AI_GUIDANCE_CATALOG_FETCH_FAILED",message:"Failed to fetch catalog in context",component:"aiGuidance"},AI_GUIDANCE_BLOCK_FETCH_FAILED:{code:"AI_GUIDANCE_BLOCK_FETCH_FAILED",message:"Failed to fetch block information from template",component:"aiGuidance"},AI_GUIDANCE_BLOCK_STRUCTURE_INVALID:{code:"AI_GUIDANCE_BLOCK_STRUCTURE_INVALID",message:"Invalid block structure - unable to parse blocks data",component:"aiGuidance"},AI_GUIDANCE_BLOCK_PLAYBOOK_ID_MISSING:{code:"AI_GUIDANCE_BLOCK_PLAYBOOK_ID_MISSING",message:"Playbook ID not found in block structure",component:"aiGuidance"},AI_GUIDANCE_JSON_PARSE_ERROR:{code:"AI_GUIDANCE_JSON_PARSE_ERROR",message:"Failed to parse JSON data from server",component:"aiGuidance"},WEBSOCKET_MISSING_URL:{code:"WEBSOCKET_MISSING_URL",message:"WebSocket URL is missing or empty",component:"aiGuidance"},WEBSOCKET_INVALID_URL_FORMAT:{code:"WEBSOCKET_INVALID_URL_FORMAT",message:"WebSocket URL must start with ws:// or wss://",component:"aiGuidance"},WEBSOCKET_CONNECTION_TIMEOUT:{code:"WEBSOCKET_CONNECTION_TIMEOUT",message:"WebSocket connection timed out during initialization",component:"aiGuidance"},WEBSOCKET_CONNECTION_REFUSED:{code:"WEBSOCKET_CONNECTION_REFUSED",message:"WebSocket connection was refused by the server",component:"aiGuidance"},WEBSOCKET_NETWORK_ERROR:{code:"WEBSOCKET_NETWORK_ERROR",message:"Network error occurred while connecting to WebSocket",component:"aiGuidance"},WEBSOCKET_AUTHENTICATION_FAILED:{code:"WEBSOCKET_AUTHENTICATION_FAILED",message:"WebSocket authentication failed",component:"aiGuidance"},WEBSOCKET_UNEXPECTED_CLOSE:{code:"WEBSOCKET_UNEXPECTED_CLOSE",message:"WebSocket connection closed unexpectedly during initialization",component:"aiGuidance"},WEBSOCKET_ABNORMAL_CLOSURE:{code:"WEBSOCKET_ABNORMAL_CLOSURE",message:"WebSocket connection closed abnormally (no close frame received)",component:"aiGuidance"},WEBSOCKET_SERVER_ERROR:{code:"WEBSOCKET_SERVER_ERROR",message:"WebSocket server error occurred during connection",component:"aiGuidance"},WEBSOCKET_SERVICE_RESTART:{code:"WEBSOCKET_SERVICE_RESTART",message:"WebSocket service is restarting",component:"aiGuidance"},WEBSOCKET_CORS_ERROR:{code:"WEBSOCKET_CORS_ERROR",message:"CORS error prevented WebSocket connection",component:"aiGuidance"},WEBSOCKET_SSL_ERROR:{code:"WEBSOCKET_SSL_ERROR",message:"SSL/TLS handshake failed for secure WebSocket connection",component:"aiGuidance"},WEBSOCKET_CONNECTION_FAILED:{code:"WEBSOCKET_CONNECTION_FAILED",message:"WebSocket connection failed during initialization",component:"aiGuidance"},COMPONENT_LOADER_MISSING_PLAYBOOK:{code:"COMPONENT_LOADER_MISSING_PLAYBOOK",message:"Current playbook is missing - cannot load component",component:"aiComponentLoader"},COMPONENT_LOADER_INVALID_COMPONENT_KEY:{code:"COMPONENT_LOADER_INVALID_COMPONENT_KEY",message:"Invalid or unknown component key",component:"aiComponentLoader"}};function G7(t,r={}){const n=H7[t];return n?{...n,details:r}:{code:"UNKNOWN_ERROR",message:`Unknown error: ${t}`,component:"aiGuidance",details:r}}function Wc(t,r="aiGuidance"){const n=(a,i={})=>{const l=G7(a,i);t("ai-guidance:error",l),console.error(`[${r}] Error:`,l)};return{emitError:n,emitErrors:(a,i={})=>{a.forEach(l=>n(l,i))}}}const K7={class:"chat-message-links"},X7=["href","redirect","data-test-id"],W7=ve({__name:"ChatMessageActions",props:{links:{type:Array,default:()=>[]},chatIndex:{type:Number,default:0}},emits:["perform-action"],setup(t){const r=(n,o,a)=>o;return(n,o)=>(e.openBlock(),e.createElementBlock("div",K7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.links,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.label},[a!=null&&a.action?(e.openBlock(),e.createBlock(xt,{key:0,btype:"playbook",text:a.label,disabled:a==null?void 0:a.disabled,"data-test-id":`chat-message-action-${a.label}`,onClick:l=>n.$emit("perform-action",a.action,t.chatIndex,a==null?void 0:a.isStatic)},null,8,["text","disabled","data-test-id","onClick"])):(e.openBlock(),e.createElementBlock("a",{key:1,href:a.link,redirect:r(a.link,a.redirect),target:"_blank",class:"ai-links","data-test-id":`chat-message-action-${a.label}`},e.toDisplayString(a.label),9,X7))],64))),128))]))}},[["__scopeId","data-v-e0a9c744"]]),Q7={class:"a-icon"},Z7=["src"],J7={class:"a-name"},Y7={class:"a-size"},eb=ve({__name:"AppAttachment",props:{background:{type:String,default:"#f8f8f8"},info:{type:Object,required:!0,default:()=>({iconUrl:"",fileName:"",fileSize:""})},encodedString:{type:String,default:""}},emits:["download"],setup(t,{emit:r}){const n=t,o=r,a=i=>{try{const l=i.match(/^data:(.*?);base64,(.*)$/);if(!l||l.length!==3)throw new Error("Invalid Base64 file format");const s=l[1],u=l[2],h=document.createElement("a");h.href=i,h.download=n.info.fileName||"download",h.target="_blank",document.body.appendChild(h),h.click(),document.body.removeChild(h);const d=El(Math.floor(u.length*3/4));o("download",{name:n.info.fileName,size:d,url:i})}catch(l){console.info("[ERROR]: Error decoding Base64 file:",l)}};return(i,l)=>(e.openBlock(),e.createElementBlock("div",{class:"attachment-wrapper",style:e.normalizeStyle(`background: ${t.background}`)},[e.createElementVNode("span",Q7,[e.createElementVNode("img",{src:t.info.iconUrl},null,8,Z7)]),e.createElementVNode("div",null,[e.createElementVNode("p",J7,e.toDisplayString(t.info.fileName),1),e.createElementVNode("p",Y7,e.toDisplayString(t.info.fileSize),1)]),t.encodedString?(e.openBlock(),e.createElementBlock("button",{key:0,class:"a-download",onClick:l[0]||(l[0]=s=>a(t.encodedString))},[e.createVNode(Be,{icon:"download",color:"#353535"})])):e.createCommentVNode("",!0)],4))}},[["__scopeId","data-v-4194a82b"]]),Qc="data:image/svg+xml,%3csvg%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.75%204C7.75%202.20508%209.20508%200.75%2011%200.75H27C27.1212%200.75%2027.2375%200.798159%2027.3232%200.883885L38.1161%2011.6768C38.2018%2011.7625%2038.25%2011.8788%2038.25%2012V36C38.25%2037.7949%2036.7949%2039.25%2035%2039.25H11C9.20507%2039.25%207.75%2037.7949%207.75%2036V4Z'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3cpath%20d='M27%200.5V8C27%2010.2091%2028.7909%2012%2031%2012H38.5'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3crect%20x='1'%20y='18'%20width='28'%20height='16'%20rx='2'%20fill='%23198708'/%3e%3cpath%20d='M11.2726%2025.2734H9.71724C9.68883%2025.0722%209.63083%2024.8935%209.54324%2024.7372C9.45564%2024.5786%209.34319%2024.4437%209.20588%2024.3324C9.06857%2024.2211%208.90995%2024.1359%208.73002%2024.0767C8.55247%2024.0175%208.35952%2023.9879%208.15119%2023.9879C7.77477%2023.9879%207.44688%2024.0814%207.16752%2024.2685C6.88817%2024.4531%206.67155%2024.723%206.51767%2025.0781C6.36378%2025.4309%206.28684%2025.8594%206.28684%2026.3636C6.28684%2026.8821%206.36378%2027.3177%206.51767%2027.6705C6.67392%2028.0232%206.89172%2028.2895%207.17108%2028.4695C7.45043%2028.6494%207.77359%2028.7393%208.14054%2028.7393C8.3465%2028.7393%208.53708%2028.7121%208.71227%2028.6577C8.88983%2028.6032%209.04726%2028.5239%209.18457%2028.4197C9.32188%2028.3132%209.43552%2028.1842%209.52548%2028.0327C9.61781%2027.8812%209.68173%2027.7083%209.71724%2027.5142L11.2726%2027.5213C11.2324%2027.8551%2011.1318%2028.1771%2010.9708%2028.4872C10.8122%2028.795%2010.5979%2029.0708%2010.328%2029.3146C10.0605%2029.5561%209.74092%2029.7479%209.36923%2029.8899C8.99991%2030.0296%208.58206%2030.0994%208.11568%2030.0994C7.467%2030.0994%206.88699%2029.9527%206.37562%2029.6591C5.86663%2029.3655%205.46416%2028.9406%205.16824%2028.3842C4.87467%2027.8279%204.72789%2027.1544%204.72789%2026.3636C4.72789%2025.5705%204.87704%2024.8958%205.17534%2024.3395C5.47363%2023.7831%205.87846%2023.3594%206.38983%2023.0682C6.90119%2022.7746%207.47647%2022.6278%208.11568%2022.6278C8.53708%2022.6278%208.9277%2022.687%209.28755%2022.8054C9.64977%2022.9238%209.97056%2023.0966%2010.2499%2023.3239C10.5293%2023.5488%2010.7565%2023.8246%2010.9317%2024.1513C11.1093%2024.478%2011.2229%2024.852%2011.2726%2025.2734ZM16.3206%2024.8189C16.2922%2024.5324%2016.1702%2024.3099%2015.9548%2024.1513C15.7394%2023.9927%2015.447%2023.9134%2015.0777%2023.9134C14.8267%2023.9134%2014.6148%2023.9489%2014.442%2024.0199C14.2692%2024.0885%2014.1366%2024.1844%2014.0443%2024.3075C13.9543%2024.4306%2013.9094%2024.5703%2013.9094%2024.7266C13.9046%2024.8568%2013.9318%2024.9704%2013.991%2025.0675C14.0526%2025.1645%2014.1366%2025.2486%2014.2432%2025.3196C14.3497%2025.3883%2014.4728%2025.4486%2014.6125%2025.5007C14.7522%2025.5504%2014.9013%2025.593%2015.0599%2025.6286L15.7133%2025.7848C16.0306%2025.8558%2016.3218%2025.9505%2016.5869%2026.0689C16.8521%2026.1873%2017.0817%2026.3329%2017.2758%2026.5057C17.47%2026.6785%2017.6203%2026.8821%2017.7268%2027.1165C17.8357%2027.3509%2017.8914%2027.6196%2017.8937%2027.9226C17.8914%2028.3677%2017.7777%2028.7536%2017.5528%2029.0803C17.3303%2029.4046%2017.0083%2029.6567%2016.5869%2029.8366C16.1679%2030.0142%2015.6624%2030.103%2015.0706%2030.103C14.4835%2030.103%2013.9721%2030.013%2013.5365%2029.8331C13.1032%2029.6532%2012.7647%2029.3868%2012.5209%2029.0341C12.2794%2028.679%2012.1527%2028.2398%2012.1409%2027.7166H13.6288C13.6454%2027.9605%2013.7152%2028.1641%2013.8383%2028.3274C13.9638%2028.4884%2014.1307%2028.6103%2014.339%2028.6932C14.5497%2028.7737%2014.7877%2028.8139%2015.0528%2028.8139C15.3132%2028.8139%2015.5393%2028.776%2015.7311%2028.7003C15.9252%2028.6245%2016.0756%2028.5192%2016.1821%2028.3842C16.2886%2028.2493%2016.3419%2028.0942%2016.3419%2027.919C16.3419%2027.7557%2016.2934%2027.6184%2016.1963%2027.5071C16.1016%2027.3958%2015.9619%2027.3011%2015.7773%2027.223C15.595%2027.1449%2015.3712%2027.0739%2015.1061%2027.0099L14.3142%2026.8111C13.701%2026.6619%2013.2169%2026.4287%2012.8618%2026.1115C12.5067%2025.7943%2012.3303%2025.367%2012.3327%2024.8295C12.3303%2024.3892%2012.4475%2024.0045%2012.6842%2023.6754C12.9233%2023.3464%2013.2512%2023.0895%2013.6679%2022.9048C14.0845%2022.7202%2014.558%2022.6278%2015.0883%2022.6278C15.6281%2022.6278%2016.0992%2022.7202%2016.5017%2022.9048C16.9065%2023.0895%2017.2214%2023.3464%2017.4463%2023.6754C17.6712%2024.0045%2017.7872%2024.3857%2017.7943%2024.8189H16.3206ZM20.2419%2022.7273L21.9997%2028.2528H22.0672L23.8286%2022.7273H25.5331L23.026%2030H21.0445L18.5338%2022.7273H20.2419Z'%20fill='white'/%3e%3c/svg%3e",Zc="data:image/svg+xml,%3csvg%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.75%204C7.75%202.20508%209.20508%200.75%2011%200.75H27C27.1212%200.75%2027.2375%200.798159%2027.3232%200.883885L38.1161%2011.6768C38.2018%2011.7625%2038.25%2011.8788%2038.25%2012V36C38.25%2037.7949%2036.7949%2039.25%2035%2039.25H11C9.20507%2039.25%207.75%2037.7949%207.75%2036V4Z'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3cpath%20d='M27%200.5V8C27%2010.2091%2028.7909%2012%2031%2012H38.5'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3crect%20x='2'%20y='18.5'%20width='24'%20height='15'%20rx='2'%20fill='%23198708'/%3e%3cpath%20d='M7.14773%2022.9545L8.46768%2025.1854H8.51882L9.84517%2022.9545H11.408L9.41051%2026.2273L11.4528%2029.5H9.86115L8.51882%2027.266H8.46768L7.12536%2029.5H5.54013L7.58878%2026.2273L5.57848%2022.9545H7.14773ZM12.2837%2029.5V22.9545H13.6676V28.359H16.4737V29.5H12.2837ZM20.941%2024.837C20.9154%2024.5792%2020.8057%2024.3789%2020.6118%2024.2362C20.4179%2024.0934%2020.1547%2024.022%2019.8224%2024.022C19.5965%2024.022%2019.4058%2024.054%2019.2503%2024.1179C19.0947%2024.1797%2018.9754%2024.266%2018.8923%2024.3768C18.8113%2024.4876%2018.7709%2024.6133%2018.7709%2024.7539C18.7666%2024.8711%2018.7911%2024.9734%2018.8444%2025.0607C18.8998%2025.1481%2018.9754%2025.2237%2019.0713%2025.2876C19.1672%2025.3494%2019.278%2025.4038%2019.4037%2025.4506C19.5294%2025.4954%2019.6636%2025.5337%2019.8064%2025.5657L20.3944%2025.7063C20.68%2025.7702%2020.942%2025.8555%2021.1807%2025.962C21.4193%2026.0685%2021.626%2026.1996%2021.8007%2026.3551C21.9754%2026.5107%2022.1107%2026.6939%2022.2066%2026.9048C22.3046%2027.1158%2022.3547%2027.3576%2022.3568%2027.6303C22.3547%2028.0309%2022.2524%2028.3782%2022.05%2028.6722C21.8497%2028.9641%2021.5599%2029.1911%2021.1807%2029.353C20.8035%2029.5128%2020.3486%2029.5927%2019.816%2029.5927C19.2876%2029.5927%2018.8273%2029.5117%2018.4353%2029.3498C18.0454%2029.1879%2017.7407%2028.9482%2017.5212%2028.6307C17.3039%2028.3111%2017.1899%2027.9158%2017.1792%2027.445H18.5184C18.5333%2027.6644%2018.5961%2027.8477%2018.7069%2027.9947C18.8199%2028.1396%2018.9701%2028.2493%2019.1576%2028.3239C19.3472%2028.3963%2019.5613%2028.4325%2019.8%2028.4325C20.0344%2028.4325%2020.2378%2028.3984%2020.4104%2028.3303C20.5851%2028.2621%2020.7204%2028.1673%2020.8163%2028.0458C20.9122%2027.9244%2020.9601%2027.7848%2020.9601%2027.6271C20.9601%2027.4801%2020.9165%2027.3565%2020.8291%2027.2564C20.7439%2027.1562%2020.6182%2027.071%2020.452%2027.0007C20.2879%2026.9304%2020.0866%2026.8665%2019.8479%2026.8089L19.1352%2026.63C18.5834%2026.4957%2018.1476%2026.2859%2017.828%2026.0004C17.5084%2025.7148%2017.3497%2025.3303%2017.3518%2024.8466C17.3497%2024.4503%2017.4552%2024.104%2017.6682%2023.8079C17.8834%2023.5117%2018.1785%2023.2805%2018.5535%2023.1143C18.9285%2022.9482%2019.3547%2022.8651%2019.8319%2022.8651C20.3177%2022.8651%2020.7417%2022.9482%2021.104%2023.1143C21.4683%2023.2805%2021.7517%2023.5117%2021.9541%2023.8079C22.1565%2024.104%2022.2609%2024.4471%2022.2673%2024.837H20.941Z'%20fill='white'/%3e%3c/svg%3e",tb={name:"SkeletonLoader",props:{dataTestId:{type:String,default:""}}},nb=["data-test-id"];function ob(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("div",{class:"skeleton-loader","data-test-id":n.dataTestId},null,8,nb)}const So=ve(tb,[["render",ob],["__scopeId","data-v-17a86e07"]]),Jc={};function rb(t){let r=Jc[t];if(r)return r;r=Jc[t]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);r.push(o)}for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);r[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return r}function Yn(t,r){typeof r!="string"&&(r=Yn.defaultChars);const n=rb(r);return t.replace(/(%[a-f0-9]{2})+/gi,function(o){let a="";for(let i=0,l=o.length;i<l;i+=3){const s=parseInt(o.slice(i+1,i+3),16);if(s<128){a+=n[s];continue}if((s&224)===192&&i+3<l){const u=parseInt(o.slice(i+4,i+6),16);if((u&192)===128){const h=s<<6&1984|u&63;h<128?a+="��":a+=String.fromCharCode(h),i+=3;continue}}if((s&240)===224&&i+6<l){const u=parseInt(o.slice(i+4,i+6),16),h=parseInt(o.slice(i+7,i+9),16);if((u&192)===128&&(h&192)===128){const d=s<<12&61440|u<<6&4032|h&63;d<2048||d>=55296&&d<=57343?a+="���":a+=String.fromCharCode(d),i+=6;continue}}if((s&248)===240&&i+9<l){const u=parseInt(o.slice(i+4,i+6),16),h=parseInt(o.slice(i+7,i+9),16),d=parseInt(o.slice(i+10,i+12),16);if((u&192)===128&&(h&192)===128&&(d&192)===128){let m=s<<18&1835008|u<<12&258048|h<<6&4032|d&63;m<65536||m>1114111?a+="����":(m-=65536,a+=String.fromCharCode(55296+(m>>10),56320+(m&1023))),i+=9;continue}}a+="�"}return a})}Yn.defaultChars=";/?:@&=+$,#",Yn.componentChars="";const Yc={};function ab(t){let r=Yc[t];if(r)return r;r=Yc[t]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?r.push(o):r.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)r[t.charCodeAt(n)]=t[n];return r}function Bo(t,r,n){typeof r!="string"&&(n=r,r=Bo.defaultChars),typeof n>"u"&&(n=!0);const o=ab(r);let a="";for(let i=0,l=t.length;i<l;i++){const s=t.charCodeAt(i);if(n&&s===37&&i+2<l&&/^[0-9a-f]{2}$/i.test(t.slice(i+1,i+3))){a+=t.slice(i,i+3),i+=2;continue}if(s<128){a+=o[s];continue}if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&i+1<l){const u=t.charCodeAt(i+1);if(u>=56320&&u<=57343){a+=encodeURIComponent(t[i]+t[i+1]),i++;continue}}a+="%EF%BF%BD";continue}a+=encodeURIComponent(t[i])}return a}Bo.defaultChars=";/?:@&=+$,-_.!~*'()#",Bo.componentChars="-_.!~*'()";function Ai(t){let r="";return r+=t.protocol||"",r+=t.slashes?"//":"",r+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?r+="["+t.hostname+"]":r+=t.hostname||"",r+=t.port?":"+t.port:"",r+=t.pathname||"",r+=t.search||"",r+=t.hash||"",r}function Br(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const ib=/^([a-z0-9.+-]+:)/i,lb=/:[0-9]*$/,sb=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,cb=["<",">",'"',"`"," ","\r",`
146
146
  `," "],ub=["{","}","|","\\","^","`"].concat(cb),db=["'"].concat(ub),eu=["%","/","?",";","#"].concat(db),tu=["/","?","#"],fb=255,nu=/^[+a-z0-9A-Z_-]{0,63}$/,hb=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ou={javascript:!0,"javascript:":!0},ru={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function wi(t,r){if(t&&t instanceof Br)return t;const n=new Br;return n.parse(t,r),n}Br.prototype.parse=function(t,r){let n,o,a,i=t;if(i=i.trim(),!r&&t.split("#").length===1){const h=sb.exec(i);if(h)return this.pathname=h[1],h[2]&&(this.search=h[2]),this}let l=ib.exec(i);if(l&&(l=l[0],n=l.toLowerCase(),this.protocol=l,i=i.substr(l.length)),(r||l||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(a=i.substr(0,2)==="//",a&&!(l&&ou[l])&&(i=i.substr(2),this.slashes=!0)),!ou[l]&&(a||l&&!ru[l])){let h=-1;for(let f=0;f<tu.length;f++)o=i.indexOf(tu[f]),o!==-1&&(h===-1||o<h)&&(h=o);let d,m;h===-1?m=i.lastIndexOf("@"):m=i.lastIndexOf("@",h),m!==-1&&(d=i.slice(0,m),i=i.slice(m+1),this.auth=d),h=-1;for(let f=0;f<eu.length;f++)o=i.indexOf(eu[f]),o!==-1&&(h===-1||o<h)&&(h=o);h===-1&&(h=i.length),i[h-1]===":"&&h--;const c=i.slice(0,h);i=i.slice(h),this.parseHost(c),this.hostname=this.hostname||"";const y=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!y){const f=this.hostname.split(/\./);for(let b=0,p=f.length;b<p;b++){const x=f[b];if(x&&!x.match(nu)){let g="";for(let C=0,_=x.length;C<_;C++)x.charCodeAt(C)>127?g+="x":g+=x[C];if(!g.match(nu)){const C=f.slice(0,b),_=f.slice(b+1),E=x.match(hb);E&&(C.push(E[1]),_.unshift(E[2])),_.length&&(i=_.join(".")+i),this.hostname=C.join(".");break}}}}this.hostname.length>fb&&(this.hostname=""),y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const s=i.indexOf("#");s!==-1&&(this.hash=i.substr(s),i=i.slice(0,s));const u=i.indexOf("?");return u!==-1&&(this.search=i.substr(u),i=i.slice(0,u)),i&&(this.pathname=i),ru[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this},Br.prototype.parseHost=function(t){let r=lb.exec(t);r&&(r=r[0],r!==":"&&(this.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(this.hostname=t)};const pb=Object.freeze(Object.defineProperty({__proto__:null,decode:Yn,encode:Bo,format:Ai,parse:wi},Symbol.toStringTag,{value:"Module"})),au=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,iu=/[\0-\x1F\x7F-\x9F]/,mb=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Ni=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,lu=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,su=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,yb=Object.freeze(Object.defineProperty({__proto__:null,Any:au,Cc:iu,Cf:mb,P:Ni,S:lu,Z:su},Symbol.toStringTag,{value:"Module"})),gb=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),bb=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var Si;const xb=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),_b=(Si=String.fromCodePoint)!==null&&Si!==void 0?Si:function(t){let r="";return t>65535&&(t-=65536,r+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),r+=String.fromCharCode(t),r};function Cb(t){var r;return t>=55296&&t<=57343||t>1114111?65533:(r=xb.get(t))!==null&&r!==void 0?r:t}var st;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(st||(st={}));const Eb=32;var Sn;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Sn||(Sn={}));function Bi(t){return t>=st.ZERO&&t<=st.NINE}function kb(t){return t>=st.UPPER_A&&t<=st.UPPER_F||t>=st.LOWER_A&&t<=st.LOWER_F}function vb(t){return t>=st.UPPER_A&&t<=st.UPPER_Z||t>=st.LOWER_A&&t<=st.LOWER_Z||Bi(t)}function Ab(t){return t===st.EQUALS||vb(t)}var ct;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(ct||(ct={}));var Bn;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Bn||(Bn={}));class wb{constructor(r,n,o){this.decodeTree=r,this.emitCodePoint=n,this.errors=o,this.state=ct.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Bn.Strict}startEntity(r){this.decodeMode=r,this.state=ct.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(r,n){switch(this.state){case ct.EntityStart:return r.charCodeAt(n)===st.NUM?(this.state=ct.NumericStart,this.consumed+=1,this.stateNumericStart(r,n+1)):(this.state=ct.NamedEntity,this.stateNamedEntity(r,n));case ct.NumericStart:return this.stateNumericStart(r,n);case ct.NumericDecimal:return this.stateNumericDecimal(r,n);case ct.NumericHex:return this.stateNumericHex(r,n);case ct.NamedEntity:return this.stateNamedEntity(r,n)}}stateNumericStart(r,n){return n>=r.length?-1:(r.charCodeAt(n)|Eb)===st.LOWER_X?(this.state=ct.NumericHex,this.consumed+=1,this.stateNumericHex(r,n+1)):(this.state=ct.NumericDecimal,this.stateNumericDecimal(r,n))}addToNumericResult(r,n,o,a){if(n!==o){const i=o-n;this.result=this.result*Math.pow(a,i)+parseInt(r.substr(n,i),a),this.consumed+=i}}stateNumericHex(r,n){const o=n;for(;n<r.length;){const a=r.charCodeAt(n);if(Bi(a)||kb(a))n+=1;else return this.addToNumericResult(r,o,n,16),this.emitNumericEntity(a,3)}return this.addToNumericResult(r,o,n,16),-1}stateNumericDecimal(r,n){const o=n;for(;n<r.length;){const a=r.charCodeAt(n);if(Bi(a))n+=1;else return this.addToNumericResult(r,o,n,10),this.emitNumericEntity(a,2)}return this.addToNumericResult(r,o,n,10),-1}emitNumericEntity(r,n){var o;if(this.consumed<=n)return(o=this.errors)===null||o===void 0||o.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(r===st.SEMI)this.consumed+=1;else if(this.decodeMode===Bn.Strict)return 0;return this.emitCodePoint(Cb(this.result),this.consumed),this.errors&&(r!==st.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(r,n){const{decodeTree:o}=this;let a=o[this.treeIndex],i=(a&Sn.VALUE_LENGTH)>>14;for(;n<r.length;n++,this.excess++){const l=r.charCodeAt(n);if(this.treeIndex=Nb(o,a,this.treeIndex+Math.max(1,i),l),this.treeIndex<0)return this.result===0||this.decodeMode===Bn.Attribute&&(i===0||Ab(l))?0:this.emitNotTerminatedNamedEntity();if(a=o[this.treeIndex],i=(a&Sn.VALUE_LENGTH)>>14,i!==0){if(l===st.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Bn.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var r;const{result:n,decodeTree:o}=this,a=(o[n]&Sn.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,a,this.consumed),(r=this.errors)===null||r===void 0||r.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(r,n,o){const{decodeTree:a}=this;return this.emitCodePoint(n===1?a[r]&~Sn.VALUE_LENGTH:a[r+1],o),n===3&&this.emitCodePoint(a[r+2],o),o}end(){var r;switch(this.state){case ct.NamedEntity:return this.result!==0&&(this.decodeMode!==Bn.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ct.NumericDecimal:return this.emitNumericEntity(0,2);case ct.NumericHex:return this.emitNumericEntity(0,3);case ct.NumericStart:return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ct.EntityStart:return 0}}}function cu(t){let r="";const n=new wb(t,o=>r+=_b(o));return function(a,i){let l=0,s=0;for(;(s=a.indexOf("&",s))>=0;){r+=a.slice(l,s),n.startEntity(i);const h=n.write(a,s+1);if(h<0){l=s+n.end();break}l=s+h,s=h===0?l+1:l}const u=r+a.slice(l);return r="",u}}function Nb(t,r,n,o){const a=(r&Sn.BRANCH_LENGTH)>>7,i=r&Sn.JUMP_TABLE;if(a===0)return i!==0&&o===i?n:-1;if(i){const u=o-i;return u<0||u>=a?-1:t[n+u]-1}let l=n,s=l+a-1;for(;l<=s;){const u=l+s>>>1,h=t[u];if(h<o)l=u+1;else if(h>o)s=u-1;else return t[u+a]}return-1}const Sb=cu(gb);cu(bb);function uu(t,r=Bn.Legacy){return Sb(t,r)}function Bb(t){return Object.prototype.toString.call(t)}function Ii(t){return Bb(t)==="[object String]"}const Ib=Object.prototype.hasOwnProperty;function Tb(t,r){return Ib.call(t,r)}function Ir(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(o){t[o]=n[o]})}}),t}function du(t,r,n){return[].concat(t.slice(0,r),n,t.slice(r+1))}function Ti(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function Tr(t){if(t>65535){t-=65536;const r=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(r,n)}return String.fromCharCode(t)}const fu=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Ob=/&([a-z#][a-z0-9]{1,31});/gi,Db=new RegExp(fu.source+"|"+Ob.source,"gi"),Vb=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Fb(t,r){if(r.charCodeAt(0)===35&&Vb.test(r)){const o=r[1].toLowerCase()==="x"?parseInt(r.slice(2),16):parseInt(r.slice(1),10);return Ti(o)?Tr(o):t}const n=uu(t);return n!==t?n:t}function Mb(t){return t.indexOf("\\")<0?t:t.replace(fu,"$1")}function eo(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(Db,function(r,n,o){return n||Fb(r,o)})}const Rb=/[&<>"]/,Lb=/[&<>"]/g,Pb={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function qb(t){return Pb[t]}function In(t){return Rb.test(t)?t.replace(Lb,qb):t}const $b=/[.?*+^$[\]\\(){}|-]/g;function Ub(t){return t.replace($b,"\\$&")}function je(t){switch(t){case 9:case 32:return!0}return!1}function Io(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function To(t){return Ni.test(t)||lu.test(t)}function Oo(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Or(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}const zb=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:du,assign:Ir,escapeHtml:In,escapeRE:Ub,fromCodePoint:Tr,has:Tb,isMdAsciiPunct:Oo,isPunctChar:To,isSpace:je,isString:Ii,isValidEntityCode:Ti,isWhiteSpace:Io,lib:{mdurl:pb,ucmicro:yb},normalizeReference:Or,unescapeAll:eo,unescapeMd:Mb},Symbol.toStringTag,{value:"Module"}));function jb(t,r,n){let o,a,i,l;const s=t.posMax,u=t.pos;for(t.pos=r+1,o=1;t.pos<s;){if(i=t.src.charCodeAt(t.pos),i===93&&(o--,o===0)){a=!0;break}if(l=t.pos,t.md.inline.skipToken(t),i===91){if(l===t.pos-1)o++;else if(n)return t.pos=u,-1}}let h=-1;return a&&(h=t.pos),t.pos=u,h}function Hb(t,r,n){let o,a=r;const i={ok:!1,pos:0,str:""};if(t.charCodeAt(a)===60){for(a++;a<n;){if(o=t.charCodeAt(a),o===10||o===60)return i;if(o===62)return i.pos=a+1,i.str=eo(t.slice(r+1,a)),i.ok=!0,i;if(o===92&&a+1<n){a+=2;continue}a++}return i}let l=0;for(;a<n&&(o=t.charCodeAt(a),!(o===32||o<32||o===127));){if(o===92&&a+1<n){if(t.charCodeAt(a+1)===32)break;a+=2;continue}if(o===40&&(l++,l>32))return i;if(o===41){if(l===0)break;l--}a++}return r===a||l!==0||(i.str=eo(t.slice(r,a)),i.pos=a,i.ok=!0),i}function Gb(t,r,n,o){let a,i=r;const l={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)l.str=o.str,l.marker=o.marker;else{if(i>=n)return l;let s=t.charCodeAt(i);if(s!==34&&s!==39&&s!==40)return l;r++,i++,s===40&&(s=41),l.marker=s}for(;i<n;){if(a=t.charCodeAt(i),a===l.marker)return l.pos=i+1,l.str+=eo(t.slice(r,i)),l.ok=!0,l;if(a===40&&l.marker===41)return l;a===92&&i+1<n&&i++,i++}return l.can_continue=!0,l.str+=eo(t.slice(r,i)),l}const Kb=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:Hb,parseLinkLabel:jb,parseLinkTitle:Gb},Symbol.toStringTag,{value:"Module"})),sn={};sn.code_inline=function(t,r,n,o,a){const i=t[r];return"<code"+a.renderAttrs(i)+">"+In(i.content)+"</code>"},sn.code_block=function(t,r,n,o,a){const i=t[r];return"<pre"+a.renderAttrs(i)+"><code>"+In(t[r].content)+`</code></pre>
147
147
  `},sn.fence=function(t,r,n,o,a){const i=t[r],l=i.info?eo(i.info).trim():"";let s="",u="";if(l){const d=l.split(/(\s+)/g);s=d[0],u=d.slice(2).join("")}let h;if(n.highlight?h=n.highlight(i.content,s,u)||In(i.content):h=In(i.content),h.indexOf("<pre")===0)return h+`
148
148
  `;if(l){const d=i.attrIndex("class"),m=i.attrs?i.attrs.slice():[];d<0?m.push(["class",n.langPrefix+s]):(m[d]=m[d].slice(),m[d][1]+=" "+n.langPrefix+s);const c={attrs:m};return`<pre><code${a.renderAttrs(c)}>${h}</code></pre>