expedite-components 0.0.9 → 0.0.10

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.
@@ -25,7 +25,7 @@
25
25
  * vue-router-lwc v1.0.4
26
26
  * (c) 2024 Eduardo San Martin Morote
27
27
  * @license MIT
28
- */var Ic;(function(e){e.pop="pop",e.push="push"})(Ic||(Ic={}));var Ac;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Ac||(Ac={}));var Tc;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Tc||(Tc={}));const K0=Symbol(""),Z0=Symbol("");function Hi(){return En(K0)}function xa(){return En(Z0)}function bt(e){if(typeof e=="string"&&(e=JSON.parse(e)),e!=null&&e.errorMessage)throw new Error(e==null?void 0:e.errorMessage);return e}const ka={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"},Nc={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"},Q0=e=>{var n;let t=[];for(let r of e)if(r.trim()!=="xx_ord1__item__r.xx_ord1__decimal_precision__c")if(r.includes(".")){let o=r.split(".")[0];o=o.slice(0,-1)+"c";const a=((n=ka[o==null?void 0:o.toLowerCase()])==null?void 0:n.trim())||"";a&&(t.includes(a)||t.push(a||""),t.push(r))}else t.includes(ka[r==null?void 0:r.toLowerCase()])||t.push(ka[r==null?void 0:r.toLowerCase()]||"");return t.filter(r=>r!=="")},X0=Mt("actions",()=>{const e=zi(),t=Nn(),n=ae(!1);return{openAdaptiveSearch:(s,l=!1)=>{console.info("openAdaptiveSearch",s),e.chatHistory[e.chatHistory.length-1].links=[],e.sendMessage("Open Adaptive Search",!1,{internalCall:!0}),n.value=l},openQuoteItem:s=>{console.info("openQuoteItem",s),e.chatHistory[e.chatHistory.length-1].links=[],e.sendMessage("Open Quote Item",!1,{internalCall:!0})},openQuoteDocument:s=>{console.info("openQuoteDocument",s),e.chatHistory[e.chatHistory.length-1].links=[],e.chatHistory.push({type:"response",message:"Opening quote document",loading:!0});const h=`/apex/XX_ORD1__Expedite_Commerce?scpq=true&oid=${t.quoteId}&atpverified=true&ecCache=false&origin=AI`;window.location.href=`${s0(window.location.href)}${h}`},undo:()=>{const s=e==null?void 0:e.latestDMLRequest;e.sendMessage(`UNDO-${s}`,!1,{internalCall:!0})},isStaticActionCall:n}}),Pc=Mt("adaptiveSearch",()=>{const e=Nn(),t=sr(),n=zi(),r=X0(),i=ae(null),o=ae(null),a=ae(!1),s=ae(!1),l=ae([]),h=ae(""),c=ae(!1),f=ae(null),u=ae(!1),g=ae([]),p=sn(),m=ae([]),d=ae(0),v=ae(!1),_=ae({rowLimt:10,paging:!0,offset:0,currentPage:1,totalPages:1});async function C(){a.value=!0;try{const O=JSON.stringify({layoutType:"Search Selection",layoutObject:"xx_ord1__ecatalog_item__c"});let P={};return P=await window.salesforceConnector.getDynamicPageLayout(O),o.value=Oc(P,"Unable to find the Search Selection Layout for your user profile"),_.value.rowLimt=o.value.configuration.rowLimit||10,o.value.configuration.columns.forEach(M=>{!M.field&&M.label==="QTY"&&(M.field="xx_ord1__qty__c")}),a.value=!1,y(),P}catch(O){a.value=!1,p.handleError("Failed to get Adaptive Search Layout. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",O)}}function y(){var O,P,M;f.value=(M=(P=(O=o.value)==null?void 0:O.configuration)==null?void 0:P.dynamicFilters)==null?void 0:M.filters.map(Z=>({...Z,field:Z.field.toLowerCase(),filtervalue:Z.filtervalue||[],filtervaluefrom:Z.filtervaluefrom||"",filtervalueTo:Z.filtervalueTo||""}))}function w(){var P;let O=[];for(const M of o.value.configuration.columns){let Z=M.field;if(O.includes(Z)||O.push(Z),Z!=null&&Z.includes(".")){let B=Z.split(".")[0];B=B.slice(0,-1)+"c",O.includes(B)||O.push(B)}}return(P=o.value.configuration)!=null&&P.cardHeader&&O.push(o.value.configuration.cardHeader.imageField),o.value.configuration.objectName.toLowerCase()==="xx_ord1__ecatalog_item__c"&&O.push("xx_ord1__item__r.xx_ord1__decimal_precision__c"),O=O.filter(M=>!!M),O.filter(M=>M.toLowerCase()!=="xx_ord1__qty__c"&&M.toLowerCase()!=="xx_ord1__competitor_sku__c")}function A(O,P=!1){if(!O||O.includes("undefined"))return!1;const M=/[!@#$%^&*()+=[\]{};':"\\|.<>/?]+/;if(P){const Z=Array.isArray(O)?O:O.split(",");for(const Q of Z){const B=Q.trim();if(M.test(B))return p.handleError(`Invalid character found in value: ${B}`),!1}}else if(M.test(O))return p.handleError("Special characters are not allowed in filter values"),!1;return!0}function I(O,P){return{field:O.field,operator:O.operator||"contains",value:P,dataType:O.dataType.trim()}}function S(O){if(!O.filtervalue)return null;const P=Array.isArray(O.filtervalue),M=P?O.filtervalue.join(","):O.filtervalue.trim();return A(M,P)?M:null}function N(O){var Q,B;const P=(Q=O.filtervaluefrom)==null?void 0:Q.trim(),M=(B=O.filtervalueTo)==null?void 0:B.trim();if(!P||!M)return null;const Z=`${P}, ${M}`;return Z!==", "&&A(Z)?Z:null}function T(O){const P=`${Ec(O.filtervaluefrom)}, ${Ec(O.filtervalueTo)}`;return P!==", "&&A(P)?P:null}function k(O){var M;const P=(M=O.filtervaluefrom)==null?void 0:M.trim();return A(P)?P:null}function E(O){const P=[];return O.forEach(M=>{const Z=M.dataType.trim();let Q=null;switch(Z){case"PICKLIST":case"MULTIPICKLIST":Q=S(M);break;case"DOUBLE":case"CURRENCY":Q=N(M);break;case"DATETIME":case"DATE":Q=T(M);break;default:Q=k(M)}Q&&P.push(I(M,Q))}),g.value=P,P}async function L(O="",P=[],M=[]){var Q,B,U,D,q,$,H,J,R,z;let Z=[];if(P.length&&(Z=E(P)),!Z.length&&O.trim()===""){l.value=[],c.value=!1;return}try{c.value=!1,s.value=!0;const oe=O.trim();M.length||(M=w());const ce={fields:M,...P.length?{dynamicFilters:Z}:{},searchText:oe||h.value.trim(),accountId:t.accountId,...t.eCatalogId?{catalogId:t.eCatalogId}:{},...t.objectType==="opportunity"?{opportunityId:t.id}:{},...(B=(Q=o.value)==null?void 0:Q.configuration)!=null&&B.sort?{primarySortBy:o.value.configuration.sort.primary.field,primarySortOrder:o.value.configuration.sort.primary.direction,secondarySortBy:o.value.configuration.sort.secondary.field,secondarySortOrder:o.value.configuration.sort.secondary.direction}:{},rowLimt:(D=(U=o.value)==null?void 0:U.configuration)==null?void 0:D.rowLimit,paging:($=(q=o.value)==null?void 0:q.configuration)==null?void 0:$.paging,...((H=_.value)==null?void 0:H.offset)!==0?{offset:_.value.offset}:{},objectName:(R=(J=o.value)==null?void 0:J.configuration)==null?void 0:R.objectName,currencyCode:t.currencyCode},le=await window.salesforceConnector.getItems(JSON.stringify(ce));if(le!=null&&le.errorMessage){p.handleError(le.errorMessage);return}le!=null&&le.itemCount&&(_.value.totalPages=Math.ceil((le==null?void 0:le.itemCount)/_.value.rowLimt)),l.value=Fi(le.lstItems,{xx_ord1__qty__c:"1"}),(z=le.lstItems)!=null&&z.length||(c.value=!0),s.value=!1}catch(oe){p.handleError("Failed to fetch Results. Please try again."),s.value=!1,console.info("[ERROR]: Adaptive Search getItems() error = ",oe)}}async function V(O){try{u.value=!0;const P=JSON.stringify({lstQLIRequest:K(O),quoteId:e.quoteId});let M=await window.salesforceConnector.createQLI(P);typeof M=="string"&&(M=JSON.parse(M));let Z=!1;if((M==null?void 0:M.length)>0&&M.forEach(Q=>{Q.errorMessage&&(Z=!0,p.handleError(Q.errorMessage))}),u.value=!1,Z){m.value=M;const Q=m.value.reduce((B,U)=>(B[U.eCatalogItemId]=U.errorMessage,B),{});l.value=l.value.map(B=>({...B,backendError:Q[B.Id]||""}));return}return M}catch(P){p.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addToQuote() error = ",P)}}function K(O){const P=[];for(const M of O)if(!M.addedToQuote&&M.id){const Z=W(M);d.value++,P.push({fields:Z,recordId:M.id,...O.length===1?{maxSequenceNumber:d.value}:{}})}return P}function W(O){const P=[],M=te();return Object.keys(O).forEach(Z=>{if(M.includes(Z)){const Q=Nc[Z.toLowerCase()];Q&&P.push({fieldname:Q,value:O[Z]})}}),P}function te(){const O=[];return o.value.configuration.columns.forEach(P=>{P.field&&!P.field.includes(".")&&P.isEditable&&P.visible&&O.push(P.field)}),O}function fe(){var P,M;const O=[];return o.value.configuration.columns.forEach(Z=>{const Q=Z.field.toLowerCase();O.includes(Q)||O.push(Q)}),(P=o.value.configuration)!=null&&P.dynamicFilters&&o.value.configuration.dynamicFilters.filters.forEach(Z=>{const Q=Z.field.toLowerCase();O.includes(Q)||O.push(Q)}),(M=o.value.configuration)!=null&&M.cardHeader&&O.push(o.value.configuration.cardHeader.imageField),O}async function ee(){var M;const O=fe(),P=((M=o.value.configuration)==null?void 0:M.saveObjectName)||o.value.configuration.objectName;if(P==="xx_ord1__ecatalog_item__c"){const Z=O.indexOf("xx_ord1__qty__c");Z>-1&&O.splice(Z,1)}await e.getFieldsData(O,P),e.fieldsData.xx_ord1__qty__c||e.getFieldsData(["xx_ord1__qty__c"],"xx_ord1__quote_line_item__c")}async function j({searchTerm:O="",filters:P=[]}={}){if(v.value=!0,O&&(h.value=O),P.length&&(g.value=P),await C()){await ee(),v.value=!1;const Z=h.value;Z&&(h.value=Z,await L(Z,e.dynamicFilters)),console.info("actionStore.isStaticActionCall = ",r.isStaticActionCall),r.isStaticActionCall&&(r.isStaticActionCall=!1,n.chatHistory[n.chatHistory.length-1]={type:"response",message:"Adaptive search is now open. Please search for the products you require and add it quote",loading:!1,links:[{action:"quoteItem",label:"Quote Item"},{action:"quoteDocument",label:"Quote Document"}]})}v.value=!1}return{selectedItem:i,AdaptiveSearchLayout:o,searchText:h,loadingAdaptiveLayout:a,getAdaptiveSearchLayout:C,getItems:L,lstItems:l,rowItemsLoading:s,noSearchRecords:c,dynamicFilters:f,setDynamicFilters:y,createQliErrors:m,addToQuote:V,addingToQuote:u,getFieldsData:ee,pagingData:_,appliedDynamicFilters:g,maxSequenceNumber:d,loadingAdaptiveSearch:v,initAdaptiveSearch:j}}),J0="XX_ORD1__Quote__c",W0="xxord1salespricec",Ui="xx_ord1__item__c",G0="xxord1productnrcc",Y0=Mt("cartStore",()=>{const e=Nn(),t=Pc(),n=sn(),r=ae(""),i=ae("$0"),o=ae("$0"),a=ae(null),s=ae({}),l=ae({}),h=ae({}),c=ae(""),f=ae(""),u=ae({}),g=ae(""),p=ae(""),m=ae({});async function d(){A()}async function v(){try{let N=await window.salesforceConnector.getProductCount(e.quoteId);if(N=bt(N),N!=null&&N.errorMessage){n.handleError(N.errorMessage);return}return r.value=N,N}catch{n.handleError("Failed to get Product Count. Please try again.")}}async function _(){try{let N=await window.salesforceConnector.getQuoteTotal(e.quoteId);if(N=bt(N),N!=null&&N.errorMessage){n.handleError(N.errorMessage);return}return o.value=N.monthlyTotal,i.value=N.onetimeTotal,N}catch{n.handleError("Failed to get Total Amount. Please try again.")}}async function C(N,T,k,E=""){if(!e.sectionDataMap.get(k).parentQLIs[T].removingItem){e.sectionDataMap.get(k).parentQLIs[T].removingItem=!0,p.value=N.id,await y(N.id)==="Success"&&(e.fetchAllQuoteLineItems(),E&&E(N,T,k));let V=e.sectionDataMap.get(k).parentQLIs.filter(K=>K[Ui]===N[Ui]).length;p.value="",t.lstItems.forEach(K=>{K[Ui]===N[Ui]&&(K.addedToQuote===!0&&(K.addedToQuote=!1),V===0&&(K.removedFromQuote=!0))})}}async function y(N){try{let T=await window.salesforceConnector.deleteQLI(N);if(T!=null&&T.errorMessage){n.handleError(T.errorMessage);return}return v(),_(),T}catch{n.handleError("Failed to remove Quote Item. Please try again.")}}function w(N){var E,L;const T=(E=N==null?void 0:N[G0])==null?void 0:E.match(/\.\d+/);T&&(T.value=T[0].length-1);const k=(L=N==null?void 0:N[W0])==null?void 0:L.match(/\.\d+/);return k&&(k.value=k[0].length-1),T||k}function A(N=!0){v(),_(),N&&e.fetchTemplates(J0).then(()=>{e.getFilteredListWithFields()})}function I(N){const T=e.sectionDataMap;for(const[,k]of T.entries())k.parentQLIs.forEach(E=>{E.id===N.id&&(k.columns.forEach(L=>{if(L.dataType==="CURRENCY"){const V=L.field.replace(/_/g,"");E[V]=S(E[V],N[L.field])}}),N!=null&&N.billingPeriodValue&&(N!=null&&N.formattedBillingPeriodValue)&&(E.formattedBillingPeriodValue=S(E.formattedBillingPeriodValue,N.billingPeriodValue)),N!=null&&N.oneTimeValue&&(N!=null&&N.formattedOneTimeValue)&&(E.formattedOneTimeValue=S(E.formattedOneTimeValue,N.oneTimeValue)))})}function S(N,T){const k=Number(T);if(isNaN(k))return N;const E=N.match(/(\d[\d,]*)(\.\d+)?/);if(!E)return N;const L=E[2]||"",V=L.length?L.length-1:0,K=k.toLocaleString("en-US",{minimumFractionDigits:V,maximumFractionDigits:V});return N.replace(E[1]+L,K)}return{initializeCart:d,loadCartState:A,productCount:r,onetimeTotal:i,monthlyTotal:o,filterCartItem:a,billingPeriodValue:c,hasOneTimeValue:f,hasBillingPeriodInList:s,oneTimeFieldAvailable:l,billingPeriodFieldAvailable:h,priceDecimalPrecision:u,cartItemUpdatingId:g,removingItemLoaderId:p,cartItemColumnsMap:m,getProductCount:v,getQuoteTotal:_,removeItem:C,removeQuoteItem:y,getDecimalPrecisionFromSalesPriceOrNRC:w,updateFormattedValues:I,formateCurrencyValue:S}}),e5=e=>[{title:"Apply Discount",subOptions:[...e.map(t=>`Apply Discount on ${t} for `),"Show Maximum discount allowed","Apply Maximum Discount Allowed",...e.map(t=>`Apply Discount on ${t} for a specific total`)]},{title:"Update Fields",subOptions:["Update the price of","Update the quantity of","Update the term start date to","Update the term end date to","Update the line description for"]},{title:"Price Ramp",subOptions:["Add a price ramp for"]}],t5={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"}]},n5=[{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"]}],Nn=Mt("quote",()=>{const e=sn(),t=Y0(),n=sr(),r=ae(""),i=ae(""),o=ae(0),a=ae(""),s=ae([]),l=ae({template:!0,filteredList:!1}),h=ae(null),c=ae(new Map),f=ae({}),u=ae(!1),g=ae(!0),p=ae(!1),m=ae({text:"Hide Options",altText:"Show Options",handler:()=>{g.value=!g.value,S()},color:"#136E05",isActive:!1}),d=be(()=>{const j=Array.from(c.value.values()).map(O=>O.sectionName);return e5(j)});St(a,()=>{l.value.template||I()});function v(){const j=new Map,O=[];for(const[M,Z]of c.value.entries())j.set(M,Z.selected),O.push(Z);const P=JSON.parse(JSON.stringify(O));return P.forEach(M=>{delete M.selected;const Z=new Map,Q=[];M.lineItems.forEach(B=>{B.Selected=j.get(M.tableId).get(B.id)||!1,B.xx_ord1__parent_qli__c?(Z.has(B.xx_ord1__parent_qli__c)||Z.set(B.xx_ord1__parent_qli__c,[]),Z.get(B.xx_ord1__parent_qli__c).push(B)):Q.push(B)}),M.lineItems=Q.map(B=>({...B,options:Z.get(B.id)||[]})),delete M.loading,delete M.parentQLIs,delete M.totalValues}),{showOptions:g.value,sections:P,templateId:a.value}}async function _(j){try{let O=await window.salesforceConnector.getPrimaryQuote(j);O=bt(O),O!==void 0&&(console.info("getPrimaryQuote",JSON.stringify(O)),r.value=O.recordId,console.info("quoteId",r.value),i.value=O.name,a.value=O==null?void 0:O.templateId,o.value=(O==null?void 0:O.lineItemsCount)||0)}catch(O){e.handleError(O.message),console.info("[ERROR]: getPrimaryQuote() error = ",O)}}async function C(j){var O,P;try{l.value.template=!0;let M=await window.salesforceConnector.fetchContentTemplates(JSON.stringify({lstObjectName:[j],templateType:"Document",templateId:null,fetchOnlyDefault:!1}));M=bt(M);const Z=M==null?void 0:M.templates[j];return a.value||(a.value=(O=Z.find(Q=>Q.XX_ORD1__Default__c))==null?void 0:O.Id),a.value||(a.value=(P=Z[0])==null?void 0:P.Id),s.value=Z,l.value.template=!1,s.value}catch(M){e.handleError(M.message),console.info("[ERROR]: fetchTemplates() error = ",M)}}function y(j){if(!j)return null;const O=/\{!\$(\w+):([\w.]+)\}/,P=j.match(O);return P?{function:P[1],apiname:P[2].split(".")[1]}:null}async function w(j){try{const O={Id:r.value,XX_ORD1__Document_Template__c:j};return await window.salesforceConnector.updateQuote(JSON.stringify([O]))}catch(O){e.handleError(O.message),console.info("[ERROR]: updateQuote() error = ",O)}}async function A(){try{l.value.filteredList=!0;let j=await window.salesforceConnector.getQuoteEPageLayout();c.value.clear(),t.cartItemColumnsMap={},j=bt(j);const O=j.map(M=>({label:M.fieldLabel,field:M.fieldName.toLowerCase(),isEditable:M.isEditable,dataType:M.dataType,...M.picklistValues?{picklistValues:M.picklistValues}:{}})),P=ar();return c.value.set(P,{loading:!0,lineItems:[],parentQLIs:[],columns:O,tableId:P,sectionName:"All Rows",selected:new Map,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}),t.cartItemColumnsMap[P]=O,m.value.isActive=!1,g.value=!0,h.value={lstCB:[{columns:O,footer:null,title:"All Rows",sectionName:"All Rows",tableId:P,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}]},S(),l.value.filteredList=!1,j}catch(j){e.handleError(j.message),console.info("[ERROR]: getQuoteEPageLayout() error = ",j)}}async function I(){if(s.value.length===0){A();return}try{l.value.filteredList=!0;let j=await window.salesforceConnector.getFilteredListWithFields(JSON.stringify({templateId:a.value}));w(a.value),j=bt(j),console.info("res.lstCB = ",j.lstCB);const O=j==null?void 0:j.objectFieldsMap;return c.value.clear(),t.cartItemColumnsMap={},j.lstCB=j.lstCB.map(P=>{const{fields:M,filters:Z,primarysort:Q,primarysortdesc:B}=JSON.parse(P.XX_ORD1__Block_Properties__c),U=M.map(q=>{var $;return{label:($=O[q.api])==null?void 0:$.label,field:q.api.toLowerCase(),isEditable:q.api.includes(".")?!1:O[q.api].isEditable,dataType:O[q.api].dataType,...O[q.api].picklistValues?{picklistValues:O[q.api].picklistValues}:{}}}),D=P.Id||ar();return c.value.set(D,{loading:!0,lineItems:[],parentQLIs:[],columns:U,tableId:D,sectionName:P.Name,selected:new Map,footer:y(P.XX_ORD1__Table_Footer_HTML__c),filters:Z,primarysort:Q,primarysortdesc:B}),t.cartItemColumnsMap[D]=U,m.value.isActive=!1,g.value=!0,{columns:U,footer:y(P.XX_ORD1__Table_Footer_HTML__c),title:P.Name,sectionName:P.Name,tableId:D,filters:Z,primarysort:Q,primarysortdesc:B}}),h.value=j,S(),l.value.filteredList=!1,j}catch(j){e.handleError(j.message),console.info("[ERROR]: getFilteredListWithFields() error = ",j)}}async function S(j=!0){const O=[];for(const[P]of c.value)O.push(k(P,j));return await Promise.all(O),t.getProductCount(),!0}function N(j,O){return c.value.get(j).columns.some(P=>P.field.toLowerCase()===O)||t.cartItemColumnsMap[j].some(P=>P.field.toLowerCase()===O)}function T(j,O){let P=Fi(j);const M=n.pricingSchema,Z=N(O,"xx_ord1__nrc__c"),Q=N(O,"xx_ord1__sales_price__c"),B=N(O,"xx_ord1__qty__c");return P=P.map(U=>{let D={};M==="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?D={...Q?{billingPeriodValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:U==null?void 0:U.xxord1salespricec}:{},...Z?{oneTimeValue:(U==null?void 0:U.xx_ord1__nrc__c)===0?"0":(U==null?void 0:U.xx_ord1__nrc__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1nrcc}:{}}:M==="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)?Q&&(D={oneTimeValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1salespricec}):M!=="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?Q&&(D={billingPeriodValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:U==null?void 0:U.xxord1salespricec}):M!=="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)&&Q&&(D={oneTimeValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?0:(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1salespricec});const{xx_ord1__qty__c:q,xx_ord1__sales_price__c:$,xx_ord1__nrc__c:H,...J}=U,R={...J,id:U.id,description:(U==null?void 0:U.xx_ord1__line_description__c)||"",xx_ord1__billing_period__c:U==null?void 0:U.xx_ord1__billing_period__c,...B?{xx_ord1__qty__c:q}:{},xx_ord1__item__c:U==null?void 0:U.xx_ord1__item__c,"xx_ord1__item__r.xx_ord1__decimal_precision__c":U["xx_ord1__item__r.xx_ord1__decimal_precision__c"]||"0",...D};return R!=null&&R.billingPeriodValue&&(t.hasBillingPeriodInList[O]=!0,t.billingPeriodValue=R==null?void 0:R.xx_ord1__billing_period__c),"oneTimeValue"in R&&(t.oneTimeFieldAvailable[O]=!0),"billingPeriodValue"in R&&(t.billingPeriodFieldAvailable[O]=!0),(R==null?void 0:R.oneTimeValue)!==""&&(R==null?void 0:R.oneTimeValue)!==null&&(t.hasOneTimeValue=!0),R}),P}async function k(j,O=!0){var P,M;try{const Z=c.value.get(j);if(console.info("sectionData = ",Z.sectionName),!Z)return;Z.loading=O,O&&(Z.lineItems=[]);const{columns:Q,filters:B,primarysort:U,primarysortdesc:D,footer:q}=Z,$=Q.map(le=>le.field.toLowerCase());$.includes("xx_ord1__parent_qli__c")||$.push("xx_ord1__parent_qli__c"),$.includes("xx_ord1__item__c")||$.push("xx_ord1__item__c"),$.includes("xx_ord1__sys_configuration_status2__c")||$.push("xx_ord1__sys_configuration_status2__c"),(P=t.cartItemColumnsMap[j])==null||P.forEach(le=>{$.includes(le.field)||$.push(le.field)});const H=await E({fields:$,recordId:r.value,filters:B||[],primarySortBy:U||"",primarySortOrder:D?"DESC":"ASC",includeOptions:g.value,totalFields:q?[q.apiname]:[]}),J=H.lineItems,R=new Map;let z=[];const oe=(M=H.fieldTotals)==null?void 0:M.map(le=>le.totalValue);J.forEach(le=>{le.XX_ORD1__Parent_QLI__c?R.has(le.XX_ORD1__Parent_QLI__c)?R.get(le.XX_ORD1__Parent_QLI__c).push(le):R.set(le.XX_ORD1__Parent_QLI__c,[le]):z.push(le)});const ce=[];return z.forEach(le=>{ce.push(le),R.has(le.Id)&&ce.push(...R.get(le.Id))}),z=T(z,j),Z.lineItems=Fi(ce),Z.parentQLIs=z,Z.totalValues=oe,Z.loading=!1,c.value=new Map(c.value),ce}catch(Z){console.info("[ERROR]: fetchQuoteLineItems()123 error = ",Z.message);const Q=c.value.get(j);Q&&(Q.loading=!1)}}async function E(j){try{let O=await window.salesforceConnector.getQuoteLineItemsWithFilteredTable(JSON.stringify(j));return O=bt(O),O}catch(O){e.handleError(O.message),console.info("[ERROR]: getQuoteLineItemsWithFilteredTable() error = ",O)}}async function L(j){try{console.info("updateQli() payload = ",j);let O=await window.salesforceConnector.updateQli(JSON.stringify(j));return O=bt(O),S(!1),O}catch(O){e.handleError(O.message),console.info("[ERROR]: updateQli() error = ",O)}}async function V(j){try{let O=await window.salesforceConnector.deleteQLI(j);return O=bt(O),S(),O}catch(O){e.handleError(O.message),console.info("[ERROR]: deleteQLI() error = ",O)}}async function K(j,O){try{u.value=!0;const P={fields:j};O&&(P.objectName=O),j.includes("xx_ord1__qty__c")&&O==="xx_ord1__ecatalog_item__c"&&(P.fields=P.fields.filter(Z=>Z!=="xx_ord1__qty__c")),j.includes("xx_ord1__sales_price__c")&&O!=="xx_ord1__quote_line_item__c"&&(P.fields=P.fields.filter(Z=>Z!=="xx_ord1__sales_price__c"));let M=await window.salesforceConnector.getFieldsData(JSON.stringify(P));return typeof M=="string"&&(M=JSON.parse(M)),M!=null&&M.errorMessage?(e.handleError(M.errorMessage),null):(f.value={...f.value,...M},console.info("fieldsData.value = ",JSON.stringify(f.value)),M)}catch(P){return e.handleError("Failed to get Fields Data. Please try again."),console.info("[ERROR]: getFieldsData() error = ",P),null}finally{u.value=!1}}function W(j=""){var O;return!j||j.includes(".")?!1:j.includes("xx_ord1__qty__c")?!0:((O=f.value[j])==null?void 0:O.isEditable)||!1}function te(){fe(t5)}async function fe(j){var O,P,M,Z,Q,B,U,D,q;if(j.payload){if((O=j.payload)!=null&&O.uiModification){const $=j.payload.uiModification;if(((P=$.addColumn)==null?void 0:P.length)>0)if($.addColumn.forEach(H=>{H.columns.forEach(J=>{J.field=J.field.toLowerCase()})}),$.addColumn[0].sectionName==="all_section")for(const[H,J]of c.value)J.columns=[...J.columns,...$.addColumn[0].columns];else $.addColumn.forEach(H=>{c.value.get(H.tableId)&&(c.value.get(H.tableId).columns=[...c.value.get(H.tableId).columns,...H.columns])});if(((M=$.removeColumn)==null?void 0:M.length)>0)if($.removeColumn.forEach(H=>{H.columns=H.columns.map(J=>J.toLowerCase())}),$.removeColumn[0].sectionName==="all_section")for(const[H,J]of c.value)J.columns=J.columns.filter(R=>!$.removeColumn[0].columns.includes(R.field));else $.removeColumn.forEach(H=>{c.value.get(H.tableId)&&(c.value.get(H.tableId).columns=c.value.get(H.tableId).columns.filter(J=>!H.columns.includes(J.field)))});if(((Z=$.filter)==null?void 0:Z.length)>0)if($.filter[0].sectionName==="all_section")for(const[H,J]of c.value)J.filters=[...J.filters,...$.filter[0].filters];else $.filter.forEach(H=>{c.value.get(H.tableId)&&(c.value.get(H.tableId).filters=[...c.value.get(H.tableId).filters,...H.filters])});if(((Q=$.groupBy)==null?void 0:Q.length)>0){const H=((B=[...c.value.values()][0])==null?void 0:B.columns)||n5;c.value.clear(),t.cartItemColumnsMap={},$.groupBy.forEach(J=>{t.cartItemColumnsMap[J.tableId]=J.columns||H,c.value.set(J.tableId,{loading:!0,lineItems:[],parentQLIs:[],columns:J.columns||H,tableId:J.tableId,sectionName:J.sectionName,selected:new Map,footer:y(J.footer),filters:J.filters,primarysort:J.primarysort,primarysortdesc:J.primarysortdesc})})}$.showOptions!==void 0&&(g.value=$.showOptions)}if(((D=(U=j.payload)==null?void 0:U.sections)==null?void 0:D.length)>0){const $=(q=j.payload)==null?void 0:q.sections;c.value.clear(),$.forEach(H=>{H.tableId||(H.tableId=ar()),H.selected=new Map,c.value.set(H.tableId,H)}),S()}}j.actionFunction==="Reload"&&(S(),console.info("Reloading quote line items"))}async function ee(j){var O,P;try{const M=new Set;for(const Z of c.value.keys())(O=c.value.get(Z).lineItems)==null||O.forEach(B=>{B.attributes=null,M.add(B.id)});if(j){const Z={lineItemIds:[...M]},Q=await window.productManagerController.getLineItemAttributes({request:JSON.stringify(Z)}),B=JSON.parse(Q.data);for(const U of c.value.keys())(P=c.value.get(U).lineItems)==null||P.forEach(q=>{q.attributes=B[q.id]||null})}}catch(M){console.info("[ERROR]: fetchAttributesData() error = ",M)}}return{showAttributes:p,quoteId:r,quoteName:i,templateId:a,templateOptions:s,loading:l,currentTemplateData:h,fieldsData:f,fieldsDataLoading:u,showOptionHeaderButton:m,sectionDataMap:c,promptSuggestions:d,lineItemsCount:o,addColumns:te,getQuoteEPageLayout:A,getPayload:v,getPrimaryQuote:_,fetchTemplates:C,getFilteredListWithFields:I,getQuoteLineItemsWithFilteredTable:E,updateQli:L,getFieldsData:K,deleteQLI:V,performAIAction:fe,isEditableField:W,fetchQuoteLineItems:k,fetchAllQuoteLineItems:S,fetchAttributesData:ee}}),r5=Mt("quickSelection",()=>{const e=sn(),t=sr(),n=Nn(),r=ae(null),i=ae(!1),o=ae([]),a=ae([]),s=ae(!1),l=ae({}),h=ae({rowLimit:10,paging:!0,offset:0,currentPage:1,totalPages:1}),c=ae(!1);async function f(){i.value=!0;try{const w=JSON.stringify({layoutType:"Quick Selection",layoutObject:"xx_ord1__ecatalog_item__c",...t.objectType?{contextObject:t.objectType}:{}});let A={};A=await window.salesforceConnector.getDynamicPageLayout(w),r.value=Oc(A,"Unable to find the Quick Selection Layout for your user profile"),console.info("quickSelectionLayout.value = ",r.value),h.value.rowLimit=r.value.configuration.rowLimit||10,r.value.data.columns.forEach(I=>{!I.field&&I.label==="QTY"&&(I.field="xx_ord1__qty__c")}),i.value=!1}catch(w){i.value=!1,e.handleError("Failed to get Page structure data. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",w)}}function u(){const w=new Map;return r.value.data.columns.forEach(A=>{w.set(A.field,!0)}),r.value.data.searchResultColumns.forEach(A=>{w.set(A.field,!0)}),Array.from(w.keys())}async function g(w){var A,I;try{let S=await window.salesforceConnector.saveCompetitorSKU(w);if(S!=null&&S.errorMessage){e.handleError(S.errorMessage);return}if((A=S[0])!=null&&A.errorMessage){e.handleError((I=S[0])==null?void 0:I.errorMessage);return}return S}catch(S){e.handleError("Failed to Match Item. Please try again."),console.info("[ERROR]: saveCompetitorSKU() error = ",S)}}async function p(w="",A=[]){try{let I=r.value.data,S=r.value.configuration;const N=w.trim();if(console.info("searchTextValue.trim() = ",w.trim()),!N)return[];let T=null;console.info("useMappings = ",c.value),c.value?T=Q0(m()):T=m(),console.info("fields before filter = ",T),T=T.filter(V=>V!=="xx_ord1__qty__c"),console.info("fields after filter = ",T);const k={fields:T,...A.length?{dynamicFilters:n.getDynamicFilters(A)}:{},searchText:N,accountId:t.accountId,...t.eCatalogId?{catalogId:t.eCatalogId}:{},...t.objectType==="opportunity"?{opportunityId:t.id}:{},...I!=null&&I.sort?{primarySortBy:I.sort.primary.field,primarySortOrder:I.sort.primary.direction,secondarySortBy:I.sort.secondary.field,secondarySortOrder:I.sort.secondary.direction}:{},rowLimt:(S==null?void 0:S.rowLimit)||20,paging:(S==null?void 0:S.paging)||!1,...h.value.offset!==0?{offset:h.value.offset}:{},objectName:I.objectName,currencyCode:t.currencyCode};console.info("getQuickSelectionItems payload = ",JSON.stringify(k));const E=await window.salesforceConnector.getItems(JSON.stringify(k));if(console.info("getQuickSelectionItems Res = ",JSON.stringify(E)),E!=null&&E.errorMessage){e.handleError(E.errorMessage);return}return E!=null&&E.itemCount&&(h.value.totalPages=Math.ceil((E==null?void 0:E.itemCount)/h.value.rowLimit)),Fi(E.lstItems,{xx_ord1__qty__c:"1"})}catch(I){e.handleError("Failed to fetch Results. Please try again."),console.info("[ERROR]: getQuickSelectionItems() error = ",I)}}function m(){let w=[];for(const A of r.value.data.columns){let I=A.field;if(I!=null&&I.includes(".")){w.includes(I)||w.push(I);let N=I.split(".")[0];N=N.slice(0,-1)+"c",w.includes(N)||w.push(N)}else w.includes(I)||w.push(I)}return console.info("getAllQuickSelectionFields() fields = ",w),w.filter(A=>A.toLowerCase()!=="xx_ord1__qty__c")}async function d(w,A,I,S){console.info("searchText:",JSON.stringify(w)),console.info("row:",JSON.stringify(A)),console.info("rowIndex:",JSON.stringify(I)),console.info("column:",JSON.stringify(S));const N=I+(h.value.currentPage-1)*h.value.rowLimit;if(S.field.toLowerCase().includes("xx_ord1__item__r")){if(o.value[N].itemLookupLoading=!0,c.value=!0,a.value=await p(w),a.value.length>0){const T=[];for(let k=0;k<a.value.length;k++)o.value[N].itemDataRetrieved=!0,a.value[k].xx_ord1__item__c&&T.push({name:a.value[k]["xx_ord1__item__r.name"],value:a.value[k].xx_ord1__item__c,label:a.value[k][S.field.toLowerCase()]});o.value[N][S.field.toLowerCase()+"_options"]=T}o.value[N].itemLookupLoading=!1}else if(S.field.toLowerCase().includes("xx_ord1__competitor_item__r")){o.value[N].competitorLookupLoading=!0;const T=await v(w);T!=null&&T.items&&(o.value[N][S.field.toLowerCase()+"_options"]=T.items.map(k=>({name:k.fields[2].value,value:k.fields[1].value,label:k.fields[0].value}))),o.value[N].competitorLookupLoading=!1,console.info("getLookupData:: Search Lookup Handler Response = ",T)}}async function v(w){var I,S;console.info("getLookupData() searchText = ",w);const A={searchText:w,obj:"xx_ord1__competitor_item__c",filters:null,displayFields:["xx_ord1__sku__c"]};try{let N=await window.salesforceConnector.getLookupData(JSON.stringify(A));if(typeof N=="string"&&(N=JSON.parse(N)),N!=null&&N.errorMessage){e.handleError(N.errorMessage);return}if((I=N[0])!=null&&I.errorMessage){e.handleError((S=N[0])==null?void 0:S.errorMessage);return}return N}catch(N){e.handleError("Failed to Search For Item. Please try again."),console.info("[ERROR]: getLookupData() error = ",N)}}async function _(w,A){var S;console.info("Update Other Fields Value = ",w),console.info("Update Other Fields Row Index = ",A);const I=A+(h.value.currentPage-1)*h.value.rowLimit;console.info("actualRowIndex = ",I);try{if(w){const N=a.value.filter(T=>T.xx_ord1__item__c===w)[0];if(N){s.value=!0;const T=r.value.data.columns[1].field;o.value[I][T]&&await C(N,I),(S=o.value[I])!=null&&S.itemDataRetrieved&&(o.value[I].status="New Match Requested",o.value[I].noMatchCleared=!0),Object.keys(N).forEach(k=>{const E=Nc[k.toLowerCase()];console.info("Mapped Key = ",E),E&&(o.value[I][E]=N[k])}),s.value=!1}else o.value[I].status=""}else o.value[I].status="No Match"}catch(N){e.handleError("Unable to request a match for this item please try again."),console.info("Error in updateOtherFields = ",N)}}async function C(w,A){const I=o.value[A],S=r.value.data.columns[1].field,N=[{sku:I[S],name:I[S],productDescription:I.xx_ord1__line_description__c||"",productURL:null,status:"Match Requested",competitorAccountId:null,itemId:w.xx_ord1__item__c}];let T=await g(JSON.stringify(N));console.info("Match Item: ",JSON.stringify(T)),o.value[A][`${S}_options`]=[{value:T[0].competitorItemId,label:T[0].sku}],o.value[A][S]=T[0].competitorItemId}async function y(w){try{let A=await window.salesforceConnector.createQLI(JSON.stringify(w));typeof A=="string"&&(A=JSON.parse(A));let I=!1;if((A==null?void 0:A.length)>0)for(let S=0;S<A.length;S++)A[S].errorMessage&&(I=!0,A[S].errorMessage.includes("Line Description: data value too large")&&(A[S].errorMessage="Error: The description is too long—it must be under 200 characters."));if(I){A.forEach(S=>{l.value[S.eCatalogItemId]=S});return}else l.value=[];return A}catch(A){e.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addAllItemsToQuote() error = ",A)}}return{quickSelectionLayout:r,quickSelectionLayoutLoading:i,processedRecords:o,useMappings:c,currentSearchData:a,createQliErrors:l,getQuickSelectionLayout:f,getAllFieldsForQuickSelectionLayout:u,saveCompetitorSKU:g,getQuickSelectionItems:p,searchLookupHandler:d,updateOtherFields:_,addAllItemsToQuote:y}}),i5="Preparing Your Quote Please Wait...",o5={message:"Your quote is ready! Begin adding products to complete it.",type:"response",requestId:"no-request-id"},a5=18e4,zi=Mt("ai",()=>{const e=sr(),t=Nn(),n=Pc(),r=r5(),i=ln(),o=xa(),a=ae(""),s=ae(""),l=ae([]),h=ae(""),c=ae([]),f=ae(!1),u=ae(null),g=Hi(),p=ae({}),m=ae(null),d=ae(null),v=ae(null),_=ae(null),C=ae(null),y=ae(i5),w=ae([]),A=be(()=>e.orgId+"__"+e.user.Id+"__"+t.quoteId),I=be(()=>u.value.readyState==WebSocket.OPEN),S=()=>{p.value={salesforceOrgId:e.orgId,salesforceOrgType:e.orgType,salesforceUserId:e.user.Id,userType:"Salesforce",chatRoomId:A.value,requestId:"",prompt:"",initiatedFrom:e.origin||"Quote",internalCall:!1,contextObjectId:t.quoteId,contextObjectType:"Quote",payload:{lineItemsCount:t.lineItemsCount},origin:"Genesis AI",defaultBatchSize:10,actionType:"",packageVersion:e.packageVersion,relatedIds:{eCatalogId:e.eCatalogId,accountId:e.accountId}}};async function N(){const q=s.value+"?chatRoomId="+A.value;u.value=new WebSocket(q),u.value.addEventListener("open",T),u.value.addEventListener("message",L),u.value.addEventListener("close",k),u.value.addEventListener("error",E)}const T=()=>{V(),te()},k=()=>{K()},E=()=>{Z(),K()},L=q=>{var H,J;V();const $=JSON.parse(q.data);if($.status!=="ALIVE"){if($.loading){y.value=$.message;return}else Array.isArray($.messages)?(y.value=null,l.value.push(o5),$.messages.length>0&&O($.messages)):$.agentResponse&&($.errorMessage&&($.agentResponse.content=$.errorMessage,$.agentResponse.error=!0),y.value=null,l.value.push({message:$.agentResponse.content,type:$.agentResponse.role,requestId:$.requestId,epoch:$.agentResponse.epoch,error:$.agentResponse.error,isDML:$.agentResponse.isDML,...(H=$.agentResponse)!=null&&H.filesData?{filesData:(J=$.agentResponse)==null?void 0:J.filesData}:{}}));w.value=$.links||[],B($)}},V=()=>{K(),m.value=setTimeout(()=>{if(I.value){const q={action:"heartbeat"};u.value.send(JSON.stringify(q)),V()}},a5)},K=()=>{m.value&&(clearInterval(m.value),m.value=null)};function W(q){const $={...p.value};$.requestType="Action",$.actionType="Undo",$.undoRequestId=q,$.requestId=ar(),j($)}function te(){const q={...p.value};q.requestType="Action",q.actionType="History",q.requestId=ar(),j(q)}function fe(q){return o.path.startsWith("/configurator")&&i.isChangedConfiguration?(_.value={save:()=>{i.maintainQuoteConfiguration()}},a.value=q,!0):(a.value="",!1)}function ee(q,$=!0,H=null){if(!fe(q)&&q.trim()){let J={...p.value};J.prompt=q.trim(),J.requestType="Chat",J.requestId=ar(),J.internalCall=!1,J.payload=P(),J.componentName=M.value,J.templateId=t.templateId,J.payload.lineItemsCount=t.lineItemsCount,H&&(J={...J,...H}),Q(),$&&l.value.push({message:q.trim(),type:"user",...C.value&&{fileData:[C.value]},requestId:J.requestId}),j(J),V()}}function j(q){const $={action:"prompt",data:q};u.value.send(JSON.stringify($))}const O=q=>{const $=q.filter(({content:H})=>!!H).map(H=>({message:H.content,type:H.role,requestId:H.requestId,epoch:H.epoch,isDML:H.isDML,undone:H.undone}));$.forEach((H,J)=>{H.isDML===!0&&J!==$.length-1&&(H.isDML=!1)}),l.value=[...l.value,...$]};function P(){return o.path==="/quote-item"?t.getPayload():{}}const M=be(()=>o.path==="/quote-item"?"QuoteItem":""),Z=()=>{l.value.push({type:"response",message:"Oops! Something went wrong while processing your request. Please try again later.",error:!0})},Q=()=>{l.value=l.value.map(q=>({...q,links:[]}))};function B(q){var J,R,z;const $=((J=q==null?void 0:q.redirectObjects)==null?void 0:J.componentName)||(q==null?void 0:q.componentName),H=(q==null?void 0:q.redirectObjects)||{};if($==="AdaptiveSearch"){const oe=(R=q==null?void 0:q.payload)==null?void 0:R.searchTerm,ce=(z=q==null?void 0:q.payload)==null?void 0:z.applyFilters;oe&&oe!==n.searchText&&n.initAdaptiveSearch({searchTerm:oe,filters:ce}),g.push("/adaptive-search")}else $==="Configurator"?g.push(`/configurator/${H.itemId}/${H.qliId}`):$==="QuoteReview"?g.push("/quote-item"):$==="QuoteItem"||$==="QuoteList"?(g.push("/quote-item"),t.performAIAction(q)):$==="QuickSelection"&&(r.quickSelectionLayout=q.payload,console.info("Loading QuickSelection data = ",JSON.stringify(r.quickSelectionLayout)),g.push("/match-records"))}function U(){if(I.value){const q={action:"cancel",data:{requestId:p.value.requestId,chatRoomId:A.value}};u.value.send(JSON.stringify(q))}}const D=()=>{d.value&&(clearInterval(d.value),d.value=null),m.value&&(clearInterval(m.value),m.value=null),v.value&&(clearTimeout(v.value),v.value=null)};return Oi(()=>{D()}),{unsavedChanges:_,loadingMessage:y,promptMessage:a,buttonLinks:w,websocketUrl:s,chatHistory:l,latestDMLRequest:h,strikethroughHistory:c,attachmentData:C,dataManuallyChanged:f,undoAction:W,connectSocket:N,sendMessage:ee,setInitialPayload:S,cancelRequest:U}}),sr=Mt("root",()=>{const e=zi(),t=sn(),n=Nn(),r=ae(""),i=ae(""),o=ae("Genesis AI"),a=ae(""),s=ae({}),l=ae(""),h=ae(""),c=ae(""),f=ae(""),u=ae({}),g=ae(""),p=ae(""),m=ae(""),d=ae(""),v=ae(""),_=ae(""),C=ae(""),y=ae("Single"),w=ae("closed"),A=be(()=>n.quoteName),I=be(()=>y.value==="Single");async function S(E){r.value=E||kc("id"),i.value=kc("origin"),await T(),await N()}async function N(){try{console.info("getRecordInfo",r.value);let E=await window.salesforceConnector.getRecordInfo(r.value);return E=bt(E),E!==void 0&&(u.value=E,g.value=E.name,p.value=E.objectType,m.value=E.accountId,d.value=E.eCatalogId,v.value=E.currencyCode,_.value=E.userLocale,C.value=E.opportunityId),(E==null?void 0:E.objectType)==="XX_ORD1__Quote__c"?(n.quoteId=E==null?void 0:E.recordId,n.templateId=E==null?void 0:E.templateId,n.quoteName=E==null?void 0:E.name,n.lineItemsCount=(E==null?void 0:E.lineItemsCount)||0):(E==null?void 0:E.objectType)==="Opportunity"&&await n.getPrimaryQuote(E.recordId),E}catch(E){t.handleError(E.message)}}async function T(){var L,V;console.info("getOrgInformation",r.value);const E=await window.salesforceConnector.getOrgInformation();e.websocketUrl=E.websocketUrl,a.value=(L=E.locale)==null?void 0:L.replace("_","-"),s.value=E.user,l.value=E.orgName,h.value=E.orgId,c.value=E.orgType,f.value=E.packageVersion,y.value=(V=E==null?void 0:E.pricingSchema)==null?void 0:V.toLowerCase()}function k(E){o.value=E,l0(E)}return{id:r,origin:i,title:A,subTitle:o,locale:a,user:s,orgName:l,orgId:h,orgType:c,packageVersion:f,objectType:p,recordInfo:u,name:g,accountId:m,eCatalogId:d,currencyCode:v,userLocale:_,opportunityId:C,pricingSchema:y,isSinglePricingSchema:I,flyoutState:w,start:S,getRecordInfo:N,setSubTitle:k}}),s5="https://api-svc.blink.expedite1.com/api/product-pricing/evaluateConfigurationSelection",l5={productJSON:{productItem:{configRules:[{publishKey:"rule-a1",name:"If latest is optA include optB",priority:1,enforceRule:!0,ruleJson:'{"latestSelected":"optA","actionType":"include","affectedOptions":["optB"]}'}]}},currentConfig:{product:{publishKey:"prod-1",attributes:[]},options:[]},selected:{publishKey:"optA",attributes:[]}};async function c5(e=l5){const t=s5;try{const n=await fetch(t,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error(`HTTP error! status: ${n.status} ${n.statusText}`);return await n.json()}catch(n){throw console.info("Error fetching data with Fetch API:",n),n}}function u5(e){const t=n=>Math.min(...n.options.map(r=>r.relationshipInfo.primarySortOrder));return e.forEach(n=>{n.itemTypes.forEach(r=>{r.options.sort((i,o)=>i.relationshipInfo.primarySortOrder-o.relationshipInfo.primarySortOrder||i.itemName.localeCompare(o.itemName))}),n.itemTypes.sort((r,i)=>t(r)-t(i)||r.itemTypeName.localeCompare(i.itemTypeName))}),e.sort((n,r)=>{const i=Math.min(...n.itemTypes.map(t)),o=Math.min(...r.itemTypes.map(t));return i-o||n.category.localeCompare(r.category)}),e}const f5=(e,t)=>{const n=(r,i)=>typeof i=="function"?void 0:i;return JSON.stringify(e,n)===JSON.stringify(t,n)},ln=Mt("configurator-main",()=>{const e=xa(),t=sr(),n=Nn(),r=sn(),i=Hi(),o=ae(null),a=ae(null),s=ae(null),l=ae(null),h=ae([]),c=ae(null),f=ae(null),u=ae(new Map),g=ae(!1),p=ae({configuration:!1,lineItem:!1,productOptionsPricing:!1,bestOfferPrice:!1,lineItemAttributes:!1,save:!1}),m=ae(!1),d=be(()=>v.value&&!t.isSinglePricingSchema),v=be(()=>{let D=!0,q=!0,$=!0,H=null;for(const J of s.value.categoryOptions)for(const R of J.itemTypes)for(const z of R.options)z.billingPeriod&&(H&&H!==z.billingPeriod&&($=!1),H=z.billingPeriod,!z.yrcPrice&&z.billingPeriod==="Monthly"&&(D=!1),!z.mrcPrice&&z.billingPeriod==="Yearly"&&(q=!1));return D&&q&&$}),_=be(()=>!f5(s.value,l.value)),C=be(()=>{const D=s.value.categoryOptions;return D.forEach(q=>{q.itemTypes.forEach($=>{$.selectedOptions=$.options.filter(H=>$.selected.includes(H.itemId)),$.totalPrice=function(){return $.selectedOptions.reduce((H,J)=>H+J.price*J.qty,0)||0},$.oneTimePrice=function(){return $.selectedOptions.filter(H=>!H.billingPeriod).reduce((H,J)=>H+J.price*J.qty,0)||0},$.recurringPrice=function(){return $.selectedOptions.filter(H=>H.billingPeriod).reduce((H,J)=>H+J.price*J.qty,0)||0}}),q.selectedItemTypes=q.itemTypes.filter($=>$.selected.length>0),q.totalPrice=function(){return q.itemTypes.reduce(($,H)=>$+H.totalPrice(),0)},q.oneTimePrice=function(){return q.itemTypes.reduce(($,H)=>$+H.oneTimePrice(),0)},q.recurringPrice=function(){return q.itemTypes.reduce(($,H)=>$+H.recurringPrice(),0)}}),D.filter(q=>q.itemTypes.filter($=>$.selected.length>0).length>0)}),y=be(()=>C.value.reduce((D,q)=>D+q.totalPrice(),0)),w=be(()=>{const D=C.value.reduce((H,J)=>H+J.totalPrice(),0);let q=C.value.reduce((H,J)=>H+J.oneTimePrice(),0),$=C.value.reduce((H,J)=>H+J.recurringPrice(),0);return s.value.billingPeriod?$=($+s.value.price)*s.value.qty:q=(q+s.value.price)*s.value.qty,{basePrice:s.value.price,addOns:D,oneTimePrice:q,recurringPrice:$,total:s.value.price*s.value.qty+D*s.value.qty+q+$}}),A=be(()=>{const D=new Map;return D.set(c.value.productLineItem.XX_ORD1__Item__c,c.value.productLineItem),c.value.options.forEach(q=>{D.set(q.XX_ORD1__Item__c,q)}),D}),I=be(()=>{const D=new Map;return s.value.categoryOptions.forEach(q=>{q.itemTypes.forEach($=>{$.options.forEach(H=>{D.set(H.relationshipInfo.publishKey,H)})})}),D}),S=be(()=>{const D=new Map;return D.set(f.value.product.XX_ORD1__Item__c,f.value.product),f.value.options.forEach(q=>{D.set(q.XX_ORD1__Item__c,q)}),D});function N(D){s.value.qliId&&(s.value.qliBillingPeriod==="Monthly"&&!D?s.value.price=s.value.qliSalesPrice||s.value.qliMrcPrice:s.value.qliBillingPeriod==="Yearly"&&D&&(s.value.price=s.value.qliSalesPrice)),s.value.categoryOptions.forEach(q=>{q.itemTypes.forEach($=>{$.options.forEach(H=>{H.billingPeriod&&(H.price=(D?H.yrcPrice.offerPrice:H.mrcPrice.offerPrice)||H.price,H.qliId&&(H.qliBillingPeriod==="Monthly"&&!D?H.price=H.qliSalesPrice||H.qliMrcPrice:H.qliBillingPeriod==="Yearly"&&D&&(H.price=H.qliSalesPrice)))})})})}function T(){s.value=null,l.value=null,h.value=[],c.value=null,f.value=null,u.value=new Map,g.value=!1,p.value.configuration=!1,p.value.lineItem=!1,p.value.productOptionsPricing=!1,p.value.bestOfferPrice=!1,p.value.lineItemAttributes=!1,p.value.save=!1}async function k(D,q){T(),o.value=D||e.params.itemId,a.value=q||e.params.qliId,console.info("initConfigurator",o.value,a.value,n.quoteId);const $=await E();await te(),await fe(),s.value=V($);const H=await j();L(H),await W();let J=!1;for(const R of c.value.options)R.XX_ORD1__Billing_Period__c==="Yearly"&&(J=!0);J&&(m.value=!0,N(!0)),l.value=JSON.parse(JSON.stringify(s.value))}async function E(){try{console.info("itemId",o.value);const D=await window.productManagerController.getProductConfiguration({itemId:o.value});console.info("getProductConfiguration:result",D);const q=JSON.parse(D.data).productItem;return q.categoryOptions=u5(q.categoryOptions),q}catch(D){return console.info("error",D.message),!1}}function L(D){const q=new Map;q.set(f.value.product.Id,f.value.product.XX_ORD1__Item__c),f.value.options.forEach(H=>{q.set(H.Id,H.XX_ORD1__Item__c)});const $=new Map;if(D.forEach(H=>{const J={};H.pricingTypes.forEach(R=>{R.appliedOnField==="Catalog Price"?J.catalogPrice=R:R.appliedOnField==="MRC"?J.mrcPrice=R:R.appliedOnField==="YRC"&&(J.yrcPrice=R)}),J.billingPeriod=H.billingPeriod,J.mrcPrice&&!t.isSinglePricingSchema?J.price=J.mrcPrice.offerPrice:J.catalogPrice&&t.isSinglePricingSchema&&(J.price=J.catalogPrice.offerPrice),J.offer={offerDiscount:H.offerDiscount,offerId:H.offerId,offerType:H.offerType},$.set(q.get(H.eCatalogItemId),J)}),$.has(s.value.itemId)){const H=$.get(s.value.itemId),J=s.value.price;Object.assign(s.value,H),s.value.qliId&&(s.value.price=J)}s.value.categoryOptions.forEach(H=>{H.itemTypes.forEach(J=>{J.options.forEach(R=>{if($.has(R.itemId)){const z=$.get(R.itemId),oe=R.price;Object.assign(R,z),R.qliId&&(R.price=oe)}})})})}function V(D){D.isAttributes=D.attributes&&D.attributes.length>0,u.value.set(a.value,D.attributes),h.value=D.configRules;const q=new Set;return h.value.forEach($=>{const H=JSON.parse($.ruleJson);H.optionSelected.forEach(J=>{q.add(J)}),H.affectedOptions.forEach(J=>{q.add(J)})}),K(D),D.categoryOptions.forEach($=>{$.key=$.category.toLowerCase().replace(/\s+/g,"-").replace(/[&]/g,""),$.itemTypes.forEach(H=>{H.selected=[],H.options=H.options.filter(J=>S.value.has(J.itemId)),H.numberOfColumns||(H.numberOfColumns=1),H.numberOfColumns>1&&(H.lightboxAttributes=!0),H.maxNumber||(H.maxNumber=100),H.minNumber||(H.minNumber=0),H.maxQuantity||(H.maxQuantity=1e4),H.minQuantity||(H.minQuantity=1),H.maxNumber===1?(H.isRadio=!0,H.minMessage="Please select 1 option",H.maxMessage="",H.isKit=H.options.some(J=>J.relationshipInfo.relationship==="Kit")):(H.minMessage=`Minimum of ${H.minNumber} selection${H.minNumber!==1?"s":""} required`,H.maxMessage=`Maximum of ${H.maxNumber} selection${H.maxNumber!==1?"s":""} allowed`),H.options.forEach(J=>{$.showImage=$.showImage||!!J.defaultImageURL,J.showAttributesModal=!1,J.calculateRules=q.has(J.relationshipInfo.publishKey),J.qty=H.minQuantity||1,J.getTags=()=>(J.attributes=J.attributes||[],J.attributes.filter(R=>R.value!==null&&R.value!=="").map(R=>({label:R.label,value:R.value}))),Object.defineProperty(J,"isDisabled",{get:function(){return J.relationshipInfo.relationship==="Kit"||(H.isRadio?H.isKit:!H.selected.includes(J.itemId)&&H.maxNumber===H.selected.length)}}),K(J),(A.value.has(J.itemId)||J.relationshipInfo.relationship==="Kit")&&H.selected.push(J.itemId)})})}),D}function K(D){D.isAttributes=D.attributes&&D.attributes.length>0;const q=S.value.get(D.itemId);if(A.value.has(D.itemId)){const $=A.value.get(D.itemId);D.qliId=$.Id,D.qty=$.XX_ORD1__QTY__c,D.itemName=$.XX_ORD1__Line_Description__c,D.billingPeriod=$.XX_ORD1__Billing_Period__c,D.price=$.XX_ORD1__Sales_Price__c,D.billingPeriod?D.price=$.XX_ORD1__Sales_Price__c||$.XX_ORD1__MRC__c:D.price=$.XX_ORD1__NRC__c||$.XX_ORD1__Sales_Price__c,D.qliSalesPrice=$.XX_ORD1__Sales_Price__c,D.qliNrcPrice=$.XX_ORD1__NRC__c,D.qliMrcPrice=$.XX_ORD1__MRC__c,D.qliBillingPeriod=$.XX_ORD1__Billing_Period__c,u.value.set(D.qliId,D.attributes)}else D.itemName=q.XX_ORD1__Line_Description__c||D.itemName,D.price=q.XX_ORD1__Negotiated_Price__c||q.XX_ORD1__NRC_for_New__c,D.nrcPrice=q.XX_ORD1__NRC_for_New__c}async function W(){console.info("getLineItemAttributes"),p.value.lineItemAttributes=!0;const q={lineItemIds:[c.value.productLineItem.Id,...c.value.options.map(J=>J.Id)]},$=await window.productManagerController.getLineItemAttributes({request:JSON.stringify(q)});console.info("getLineItemAttributes:result",$);const H=JSON.parse($.data);for(const[J,R]of Object.entries(H))if(u.value.has(J)){const z=u.value.get(J),oe=new Map;R==null||R.forEach(ce=>{oe.set(ce.apiName,ce)}),z==null||z.forEach(ce=>{oe.get(ce.apiName)&&(ce.value=oe.get(ce.apiName).value||"",ce.dataType==="REFERENCE"&&(ce.referenceRecordId=oe.get(ce.apiName).referenceRecordId||"",ce.referenceRecordId?ce.options=[{Name:ce.value||"",Id:ce.referenceRecordId}]:ce.options=[]))})}p.value.lineItemAttributes=!1}async function te(){p.value.lineItem=!0,console.info("getLineItems",n.quoteId,a.value);try{const D={objectId:n.quoteId,filters:{},additionalFields:["Name","XX_ORD1__Line_Description__c"],primarySort:{field:"CreatedDate",direction:"DESC"},productPage:{recordLimit:200,offset:0,productLineItemId:a.value}},q=await window.productManagerController.getLineItems({request:JSON.stringify(D)});return console.info("getLineItems:result",q),c.value=JSON.parse(q.data).products[0],console.info("result",q),p.value.lineItem=!1,q}catch(D){return console.info("error",D.message),p.value.lineItem=!1,!1}}async function fe(){p.value.productOptionsPricing=!0,console.info("getProductOptionsPricing");try{const D={objectId:n.quoteId,itemId:o.value},q=await window.productManagerController.getProductOptionsPricing({request:JSON.stringify(D)});return console.info("getProductOptionsPricing:result",q),f.value=JSON.parse(q.data),p.value.productOptionsPricing=!1,f.value}catch(D){return console.info("error",D.message),p.value.productOptionsPricing=!1,!1}}async function ee(D){console.info("getRecords");try{const q=await window.productManagerController.getRecords({request:JSON.stringify(D)});return console.info("getRecords:result",q),JSON.parse(q.data)}catch(q){return console.info("error",q.message),!1}}async function j(){p.value.bestOfferPrice=!0,console.info("getBestOfferPrice");const D=[f.value.product.Id];f.value.options.forEach(q=>{D.push(q.Id)});try{const q=await O(D);return p.value.bestOfferPrice=!1,q}catch(q){return console.info("error",q.message),p.value.bestOfferPrice=!1,!1}}async function O(D){const q={accountId:t.accountId,eCatalogItemIds:D,pricePreference:"Heighest Priority"},$=await window.productManagerController.calculateBestOfferPrice({request:JSON.stringify(q)});return console.info("calculateBestOfferPrice:result",$),p.value.bestOfferPrice=!1,JSON.parse($.data)}async function P(){g.value=!0,p.value.save=!0,console.info("maintainQuoteConfiguration");const D=[],q=[];s.value.categoryOptions.forEach(J=>{J.itemTypes.forEach(R=>{R.options.forEach(z=>{R.selected.includes(z.itemId)?D.push(M(z)):z.qliId&&q.push(z.qliId)})})});const $={objectId:n.quoteId,eCatalogId:t.eCatalogId,isGenesisAI:!0,blinkUser:!1,optionsToRemove:q,grandFatheredOptionsToRemove:[],productLineItem:{...M(s.value),optionLineItems:D}};console.info("maintainQuoteConfiguration:request",$);const H=await window.productManagerController.maintainQuoteConfiguration({request:JSON.stringify($)});if(console.info("maintainQuoteConfiguration:result",H),H!=null&&H.error){const J={title:"Unable to Save Configuration",description:H.error,button:{label:"Back to Configuration",action:()=>{g.value=!1}},cancel:{label:"Quote List",action:()=>{i.push("/quote-item?id="+n.quoteId)}}};r.errorPopup=J}else l.value=JSON.parse(JSON.stringify(s.value)),console.info("maintainQuoteConfiguration:result",H);p.value.save=!1}function M(D){const q={};D.isAttributes&&D.attributes.forEach(H=>{H.apiName.includes(".")||(H.dataType==="BOOLEAN"?q[H.apiName]=H.value?"true":"false":H.dataType==="REFERENCE"?q[H.apiName]=H.referenceRecordId:q[H.apiName]=H.value)});const $={attributes:q,itemId:D.itemId,lineItemId:D.qliId,lineDescription:D.itemName,qty:D.qty,billingPeriod:D.billingPeriod,...D.offer};return D.billingPeriod&&v.value&&!t.isSinglePricingSchema&&($.billingPeriod=m.value?"Yearly":"Monthly"),!t.isSinglePricingSchema&&!D.billingPeriod?$.nrcPrice=D.price:($.applyOnField="Catalog Price",$.salesPrice=D.price,$.nrcPrice=D.nrcPrice),$}async function Z(){const D={objectId:t.eCatalogId,productItemId:o.value};try{let q=await window.productManagerController.getProductCrossSells({request:JSON.stringify(D)});if(console.info("getProductCrossSells:result",q),q=q.data?JSON.parse(q.data):{},q.crossSells.length===0)return q;const $=q.crossSells.map(R=>R.Id),H=await O($),J=new Map;return H.forEach(R=>{J.set(R.eCatalogItemId,{...R,...R.pricingTypes[0]})}),q.crossSells.forEach(R=>{R.loading=!1,R.Name=R.XX_ORD1__Line_Description__c||R.XX_ORD1__Item__r.Name,R.Description=R.XX_ORD1__Item__r.XX_ORD1__Product_Description__c,J.has(R.Id)?(R.Price=J.get(R.Id).offerPrice,R.priceFormatted=J.get(R.Id).formattedOfferPrice,R.offer={offerDiscount:J.get(R.Id).offerDiscount,offerId:J.get(R.Id).offerId,offerType:J.get(R.Id).offerType}):(R.Price=R.XX_ORD1__List_Price2__c,R.priceFormatted=R.XX_ORD1__List_Price2__c,R.offer={offerDiscount:0,offerId:null,offerType:null})}),q}catch(q){return console.info("error",q.message),!1}}async function Q(D,q){var R,z;const $={product:{publishKey:s.value.publishKey,lineDescription:s.value.itemName},options:[]};s.value.categoryOptions.forEach(oe=>{oe.itemTypes.forEach(ce=>{ce.options.forEach(le=>{ce.selected.includes(le.itemId)&&$.options.push({publishKey:le.relationshipInfo.publishKey,lineDescription:le.itemName})})})}),console.info("evaluateConfigSelection:currentConfig.options",$.options);const H={productJSON:{productItem:{configRules:h.value}},currentConfig:$,selected:D?{publishKey:(R=D.relationshipInfo)==null?void 0:R.publishKey,attributes:D.attributes,lineDescription:D.itemName}:{},unselected:q?{publishKey:(z=q.relationshipInfo)==null?void 0:z.publishKey,attributes:q.attributes,lineDescription:q.itemName}:{}};return await c5(H)}async function B(){try{const D=["Name","XX_ORD1__Line_Description__c","XX_ORD1__Item__r.XX_ORD1__Product_Description__c","XX_ORD1__Sales_Price__c","XX_ORD1__SYS_Configuration_Status2__c"],$=(await n.getQuoteLineItemsWithFilteredTable({fields:D,recordId:n.quoteId,filters:[],includeOptions:!1,totalFields:[]})).lineItems;return console.info("fetchQuoteLineItems:res",$),$}catch(D){console.info("[ERROR]: fetchQuoteLineItems()123 error = ",D.message)}}async function U(D){const q={quoteId:n.quoteId,lstQLIRequest:[{eCatalogItemId:D.Id,quantity:1,offerApplicable:D.offer}]};try{const $=await window.productManagerController.createQuoteProducts({request:JSON.stringify(q)});console.info("getProductCrossSells:result",$)}catch($){return console.info("error",$.message),!1}}return{itemId:o,configuration:s,_configurationCopy:l,lineItem:c,savedScreen:g,loading:p,summary:C,addOns:y,summaryPrices:w,optionByItemId:A,attributesByQLIId:u,optionByPublishKey:I,showYearlyPricing:m,isYearlyPricingExist:v,isChangedConfiguration:_,isRecurringPricingSchema:d,changePricingScheme:N,createQuoteProducts:U,resetConfigurator:T,fetchQuoteLineItems:B,getRecords:ee,getProductCrossSells:Z,initConfigurator:k,maintainQuoteConfiguration:P,evaluateConfigSelection:Q}}),d5={class:"ect-p-4 ect-flex ect-gap-2 ect-items-center ect-justify-between ect-border-b ect-border-gray-200"},h5={class:"ect-flex ect-items-center ect-gap-3"},p5={class:"ect-text-xl ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},g5={key:0,class:"ect-flex ect-gap-1.5 ect-items-center"},m5=b("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Saving configuration...",-1),v5={key:1,class:"ect-flex ect-gap-1.5 ect-items-center"},y5=b("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Configuration Saved Successfully",-1),_5={key:1,class:"ect-flex ect-flex-col ect-gap-4 ect-flex-1 ect-overflow-y-auto ect-mb-16"},b5=b("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed ect-p-4 ect-pb-0"},"You may consider these products",-1),C5={class:"ect-flex ect-flex-col ect-gap-4 ect-p-4 ect-pt-0 ect-overflow-y-auto"},w5=["data-test-id"],x5={class:"ect-flex-1 ect-flex ect-flex-col ect-gap-2"},k5={class:"ect-text-sm ect-font-semibold ect-text-gray-800 ect-leading-tight"},E5={class:"ect-text-sm ect-font-medium ect-text-gray-600 ect-leading-relaxed ect-line-clamp-2"},O5={class:"ect-flex ect-flex-row ect-justify-between ect-items-center"},S5={class:"ect-text-sm ect-font-semibold ect-text-gray-800"},I5={key:2,class:"ect-flex ect-flex-col ect-gap-4 ect-m-4 ect-flex-1 ect-overflow-y-auto"},A5=b("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},"What do you want to do next?",-1),T5={class:"ect-flex ect-flex-col ect-gap-4"},N5=["data-test-id","onClick"],P5={class:"ect-flex ect-items-center ect-justify-center"},L5={class:"ect-flex ect-flex-col ect-items-center ect-gap-2 ect-w-full"},R5=["data-test-id"],M5=["data-test-id"],q5={key:3,class:"ect-bg-light-bg-x ect-border-t ect-border-gray-200 ect-flex-shrink-0 ect-sticky ect-bottom-0 ect-pb-4"},j5={class:"ect-flex ect-flex-col ect-gap-4"},D5={class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed ect-p-4 ect-pb-0"},B5={class:"ect-flex ect-flex-col ect-gap-4 ect-p-4 ect-pt-0 ect-overflow-y-auto"},$5={class:"ect-bg-white ect-border ect-border-gray-300 ect-rounded-md ect-p-3 ect-flex ect-flex-col","data-test-id":"configurator-recommend-card-next-product"},F5={class:"ect-flex-1 ect-flex ect-flex-col ect-gap-2"},V5={class:"ect-text-sm ect-font-semibold ect-text-gray-800 ect-leading-tight"},H5={class:"ect-text-sm ect-font-medium ect-text-gray-600 ect-leading-relaxed ect-line-clamp-2"},U5={class:"ect-flex ect-flex-row ect-justify-between ect-items-center"},z5={class:"ect-text-sm ect-font-semibold ect-text-gray-800"},K5={__name:"ConfiguratorRecommend",setup(e){const t=ln(),n=Nn(),r=Hi(),i=be(()=>t.configuration),o=ae(!0),a=ae(""),s=ae([{icon:"configuration",title:"Back to current Product Configuration",description:"Returns to the active product configuration page.",link:"/item/overview",action:"backToConfiguration"},{icon:"menu",title:"Back to Quote List Page",description:"Returns to the main quote list page.",link:"/quote-item",action:"backToQuoteList"}]),l=ae(null),h=ae([]),c=async p=>{p.loading=!0,await t.createQuoteProducts(p),p.disabled=!0,p.loading=!1},f=p=>{p.action==="backToConfiguration"?t.savedScreen=!1:p.action==="backToQuoteList"?r.push("/quote-item?id="+n.quoteId):p.link&&r.push(p.link)};async function u(){const p=await t.fetchQuoteLineItems();console.info("getQuoteLineItems1:_quoteLineItems",p);const m=p.filter(v=>v.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration").length;console.info("getQuoteLineItems2:needsConfigurationCount",m),a.value=`(${p.length-m}/${p.length})`;const d=p.find(v=>v.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration"&&v.Id!=t.qliId);return console.info("getQuoteLineItems3:result",d),l.value=d?{Name:d.XX_ORD1__Line_Description__c,Description:d.XX_ORD1__Item__r.XX_ORD1__Product_Description__c,Price:d.XX_ORD1__Sales_Price__c,XX_ORD1__Item__c:d.XX_ORD1__Item__c,Id:d.Id}:null,console.info("getQuoteLineItems4:configueredProduct",l.value),p}async function g(){t.resetConfigurator(),r.push({path:"/configurator/"+l.value.XX_ORD1__Item__c+"/"+l.value.Id}),t.initConfigurator(l.value.XX_ORD1__Item__c,l.value.Id)}return xn(async()=>{o.value=!0;const p=await u(),m=await t.getProductCrossSells(),d=new Set;p.forEach(v=>{d.add(v.XX_ORD1__Item__c)}),m.crossSells.forEach(v=>{v.disabled=d.has(v.XX_ORD1__Item__c)}),h.value=m.crossSells||[],o.value=!1}),(p,m)=>(X(),ne(Oe,null,[b("div",d5,[b("div",h5,[_e(Ge,{icon:"arrow",symbol:"",size:12,onClick:m[0]||(m[0]=d=>Me(t).savedScreen=!1)}),b("h2",p5,ve(i.value.itemName),1)]),Me(t).loading.save?(X(),ne("div",g5,[_e(Sc,{svg:""}),m5])):(X(),ne("div",v5,[_e(Ge,{icon:"check",color:"#136E05",size:14,"data-test-id":"item-tabs-before-button-icon"}),y5]))]),o.value?(X(),Te(wa,{key:0,type:"recommendations",rows:4})):h.value.length>0?(X(),ne("div",_5,[b5,b("div",C5,[(X(!0),ne(Oe,null,Ke(h.value,(d,v)=>(X(),ne("div",{key:d.Id||v,class:"ect-bg-white ect-border ect-border-gray-300 ect-rounded-md ect-p-3 ect-flex ect-flex-col","data-test-id":`configurator-recommend-card-${d.Id||v}`},[b("div",x5,[b("h4",k5,ve(d.Name),1),b("p",E5,ve(d.Description),1)]),b("div",O5,[b("div",S5,ve(Me(It)(d.Price)),1),_e(Pt,{btype:d.disabled?"secondary":"primary","button-style":d.disabled?"normal":"outlined",size:"medium",class:Ie({"ect-w-[120px]":d.loading}),loading:d.loading,disabled:d.disabled||d.loading,"data-test-id":`configurator-recommend-button-add-${d.Id||v}`,onClick:_=>c(d)},{default:Be(()=>[Ve(ve(d.loading?"":d.disabled?"Added to Quote":"Add to Quote"),1)]),_:2},1032,["btype","button-style","class","loading","disabled","data-test-id","onClick"])])],8,w5))),128))])])):(X(),ne("div",I5,[A5,b("div",T5,[(X(!0),ne(Oe,null,Ke(s.value,(d,v)=>(X(),ne("div",{key:d.title||v,class:"ect-bg-white ect-border ect-border-[#DEDEDE] ect-rounded-xl ect-p-4 md:ect-p-5 lg:ect-p-6 ect-flex ect-flex-col ect-items-center ect-gap-4 md:ect-gap-6 lg:ect-gap-8 ect-cursor-pointer ect-transition-all ect-duration-200 hover:ect-shadow-md hover:ect-border-gray-400","data-test-id":`configurator-recommend-redirect-card-${v}`,onClick:_=>f(d)},[b("div",P5,[_e(Ge,{icon:d.icon,size:20,color:"#000000","data-test-id":`configurator-recommend-redirect-icon-${v}`},null,8,["icon","data-test-id"])]),b("div",L5,[b("h4",{class:"ect-text-sm ect-font-semibold ect-text-[#5F5F5F] ect-text-center ect-leading-[1.43]","data-test-id":`configurator-recommend-redirect-title-${v}`},ve(d.title),9,R5),b("p",{class:"ect-text-sm ect-font-normal ect-text-[#828282] ect-text-center ect-leading-[1.71]","data-test-id":`configurator-recommend-redirect-description-${v}`},ve(d.description),9,M5)])],8,N5))),128))])])),l.value?(X(),ne("footer",q5,[b("div",j5,[b("h3",D5," Configuere next product from your quote "+ve(a.value),1),b("div",B5,[b("div",$5,[b("div",F5,[b("h4",V5,ve(l.value.Name),1),b("p",H5,ve(l.value.Description),1)]),b("div",U5,[b("div",z5,ve(Me(It)(l.value.Price)),1),_e(Pt,{btype:"primary","button-style":"filled",size:"medium","data-test-id":"configurator-recommend-button-add-next-product",onClick:g},{default:Be(()=>[Ve(" Configure Now ")]),_:1})])])])])])):ye("",!0)],64))}},Z5=["data-test-id"],Q5=He({__name:"AppPill",props:{variant:{type:String,default:"",validator:e=>["success","error",""].includes(e)},dataTestId:{type:String,default:""}},setup(e){return(t,n)=>(X(),ne("span",{class:Ie(["ect-pill",{"ect-pill-success":e.variant==="success","ect-pill-error":e.variant==="error","ect-pill-default":!e.variant}]),"data-test-id":e.dataTestId},[Qe(t.$slots,"default",{},void 0,!0)],10,Z5))}},[["__scopeId","data-v-c7f05fa0"]]),X5=["data-test-id"],J5=["data-test-id"],W5=["data-test-id","onClick"],G5=["data-test-id"],Y5=He({__name:"AppTabsV2",props:{showTabs:{type:Boolean,default:!0},modelValue:{type:String,default:""},border:{type:Boolean,default:!1},tabs:{type:Array,required:!0,validator:e=>e.every(t=>typeof t=="object"&&t.title&&t.key&&(t.sections===void 0||Array.isArray(t.sections)))},dataTestId:{type:String,required:!0}},emits:["update:modelValue","tab-change"],setup(e,{emit:t}){const n=e,r=t,i=be(()=>{var a;return n.modelValue||((a=n.tabs[0])==null?void 0:a.key)||""}),o=a=>{r("update:modelValue",a),r("tab-change",a)};return(a,s)=>(X(),ne("div",{class:"ect-page-tabs","data-test-id":e.dataTestId},[e.showTabs?(X(),ne("div",{key:0,class:Ie(["ect-page-tabs-header",[{"ect-tab-border":e.border}]]),"data-test-id":`${e.dataTestId}-header`},[(X(!0),ne(Oe,null,Ke(e.tabs,l=>(X(),ne("button",{key:l.key,class:Ie(["ect-page-tab-button",`ect-page-tab-button${i.value===l.key?"-active":""} ${l.tabClass||""}`]),"data-test-id":`${e.dataTestId}-tab-${l.key}`,onClick:h=>o(l.key)},[Ve(ve(l.title)+" ",1),l.pill!==void 0&&l.pill!==null?(X(),Te(Q5,{key:0,class:"ect-ml-2",variant:l.pillStyle,"data-test-id":`${e.dataTestId}-tab-${l.key}-pill`},{default:Be(()=>[Ve(ve(l.pill),1)]),_:2},1032,["variant","data-test-id"])):ye("",!0)],10,W5))),128))],10,J5)):ye("",!0),b("div",{class:"ect-page-tab-content","data-test-id":`${e.dataTestId}-content`},null,8,G5)],8,X5))}},[["__scopeId","data-v-f22cb1ed"]]),eh=["data-test-id"],th=["disabled","data-test-id"],nh=["value","disabled","data-test-id"],rh=["disabled","data-test-id"],Ki={__name:"CounterButton",props:{value:{type:Number,required:!0,default:null},min:{type:Number,default:1},max:{type:Number,default:999},empty:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:value","change"],setup(e,{emit:t}){const n=e,r=t,i=be(()=>n.min==null?0:n.min),o=be(()=>n.max==null?999:n.max),a=(y,w,A)=>Math.min(Math.max(y,w),A),s=y=>{if(y==null||y==="")return NaN;const w=Number(y);return Number.isFinite(w)?w:NaN},l=ae(null),h=ae(n.value??i.value),c=y=>{h.value=a(y,i.value,o.value)};n.value!==null&&c(n.value);const f=be(()=>h.value),u=be(()=>l.value!=null?l.value:String(f.value)),g=be(()=>n.disabled||f.value<=i.value),p=be(()=>n.disabled||f.value>=o.value);function m(y){y!==n.value&&(h.value=y,r("update:value",y),r("change",y))}function d(){if(g.value)return;const y=a(f.value-1,i.value,o.value);l.value=null,m(y)}function v(){if(p.value)return;const y=a(f.value+1,i.value,o.value);l.value=null,m(y)}function _(y){const A=String(y.target.value??"").replace(/\D+/g,"");l.value=A}function C(){const y=s(l.value),w=i.value,A=a(Number.isNaN(y)?w:y,i.value,o.value);l.value=null,m(A)}return(y,w)=>(X(),ne("div",{class:"ect-flex ect-items-center ect-gap-1","data-test-id":e.dataTestId},[b("button",{type:"button",class:Ie(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":g.value,"ect-cursor-not-allowed":g.value}]),disabled:g.value,"data-test-id":`${e.dataTestId}-decrement`,onClick:d}," - ",10,th),b("input",{type:"text",inputmode:"numeric",pattern:"[0-9]*",value:e.empty?"":u.value,disabled:e.disabled,class:"ect-h-7 ect-w-[48px] ect-px-2 ect-border ect-border-gray ect-rounded-md ect-text-center ect-text-sm ect-font-medium ect-text-gray-900 focus:ect-outline-none focus:ect-border-gray-400 ect-bg-white","data-test-id":`${e.dataTestId}-input`,onInput:_,onBlur:C},null,40,nh),b("button",{type:"button",class:Ie(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":p.value,"ect-cursor-not-allowed":p.value}]),disabled:p.value,"data-test-id":`${e.dataTestId}-increment`,onClick:v}," + ",10,rh)],8,eh))}},ih={class:"ect-flex ect-justify-end ect-items-center ect-gap-2.5 ect-px-6 ect-pb-6 ect-pt-4 ect-bg-white ect-border-t ect-border-gray-300 ect-shadow-[0_-2px_4px_0px_rgba(0,0,0,0.11)]","data-test-id":"configurator-footer"},oh={"data-test-id":"configurator-footer-quantity"},ah={class:"ect-flex ect-justify-end ect-items-center ect-gap-6 ect-px-8 ect-py-0 ect-flex-1","data-test-id":"configurator-footer-prices"},sh=["data-test-id"],lh=["data-test-id"],ch=["data-test-id"],uh=["data-test-id"],fh={__name:"ConfiguratorFooter",props:{item:{type:Object,required:!0,default:()=>{}},disabled:{type:Boolean,default:!1},btnText:{type:String,default:"Save"}},emits:["update:qty","continue"],setup(e,{emit:t}){const n=ln(),r=e,i=ae(r.item),o=be(()=>{const l=n.summaryPrices,h=[];return n.isRecurringPricingSchema?(h.push({label:"One Time Price",value:l.oneTimePrice,highlight:!1}),h.push({label:n.showYearlyPricing?"Yearly Price":"Monthly Price",value:l.recurringPrice,highlight:!1})):(h.push({label:"Base Price",value:l.basePrice,highlight:!1}),h.push({label:"Add Ons",value:l.addOns,highlight:!1}),h.push({label:"Total Price",value:l.total,highlight:!1})),h}),a=t,s=()=>{r.disabled||a("continue")};return(l,h)=>(X(),ne("footer",ih,[b("div",oh,[_e(Ki,{value:i.value.qty,"onUpdate:value":h[0]||(h[0]=c=>i.value.qty=c),min:1,max:999,disabled:e.disabled,"is-selected":!0,"data-test-id":"configurator-footer-counter-button"},null,8,["value","disabled"])]),b("div",ah,[(X(!0),ne(Oe,null,Ke(o.value,(c,f)=>(X(),ne(Oe,{key:f},[b("div",{class:"ect-flex ect-flex-col ect-justify-center","data-test-id":`configurator-footer-price-${f}`},[b("span",{class:"ect-text-xs ect-font-normal ect-text-gray-500 ect-text-left","data-test-id":`configurator-footer-price-label-${f}`},ve(c.label),9,lh),b("span",{class:Ie(["ect-text-left",c.highlight?"ect-text-lg ect-font-bold ect-text-green-700":"ect-text-sm ect-font-medium ect-text-gray-800 "]),"data-test-id":`configurator-footer-price-value-${f}`},ve(Me(It)(c.value)),11,ch)],8,sh),f<o.value.length-1?(X(),ne("div",{key:0,class:"ect-w-0 ect-h-5 ect-border-l ect-border-gray-400","data-test-id":`configurator-footer-divider-${f}`},null,8,uh)):ye("",!0)],64))),128))]),_e(Pt,{class:"ect-min-w-[100px]",btype:e.disabled?"secondary":"primary",disabled:e.disabled,"button-style":"primary",size:"medium","data-test-id":"configurator-footer-button-continue",onClick:s},{default:Be(()=>[Ve(ve(e.btnText),1)]),_:1},8,["btype","disabled"])]))}},dh={class:"ect-w-full ect-bg-white ect-mb-4","data-test-id":"configurator-type-section"},hh={class:"ect-sticky ect-top-0 ect-z-30 ect-bg-white ect-shadow-sm ect-p-3 ect-px-4 ect-border-b ect-border-gray-200 ect-flex ect-justify-between ect-items-center","data-test-id":"configurator-type-header-sticky"},ph={class:"ect-flex ect-flex-col"},gh={class:"ect-font-bold ect-text-text-success ect-leading-tight"},mh=["innerHTML"],vh={key:0,class:"ect-flex ect-items-center ect-gap-2 ect-px-2 ect-py-1","data-test-id":"configurator-type-message"},yh={class:"ect-text-xs ect-font-medium ect-text-gray-600 ect-leading-tight ect-min-w-[190px]"},_h={class:"ect-divide-y ect-divide-gray-100 ect-overflow-y-auto"},bh={__name:"ConfiguratorType",props:{title:{type:String,required:!0},description:{type:String,default:""},message:{type:String,default:""}},setup(e){return(t,n)=>(X(),ne("section",dh,[b("header",hh,[b("div",ph,[b("h2",gh,ve(e.title),1),e.description?(X(),ne("p",{key:0,class:"ect-mt-1 ect-text-xs ect-text-gray-500 ect-leading-tight",innerHTML:e.description},null,8,mh)):ye("",!0)]),e.message?(X(),ne("div",vh,[_e(Ge,{icon:"info",symbol:"",color:"#198708",size:14,"data-test-id":"configurator-type-message-icon"}),b("span",yh,ve(e.message),1)])):ye("",!0)]),b("div",_h,[Qe(t.$slots,"default")])]))}},Ch={__name:"ShadowDisplay",props:{content:{type:String,required:!0}},setup(e){const t=e,n=ae(null);let r=null;return kn(()=>{n.value&&!r&&(r=n.value.attachShadow({mode:"open"}),r.innerHTML=t.content)}),St(()=>t.content,i=>{r&&(r.innerHTML=i)}),(i,o)=>(X(),ne("div",{ref_key:"host",ref:n},null,512))}},wh=["data-test-id"],xh=["data-test-id"],kh=["data-test-id"],Eh=[b("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("g",{id:"Group"},[b("path",{id:"Vector",d:"M7 1.3125V12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"}),b("path",{id:"Vector_2",d:"M1.3125 7H12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)],Oh=["data-test-id"],Sh=["data-test-id"],Ih=["data-test-id"],Ah=["data-test-id"],Th=["data-test-id"],Nh=["data-test-id","innerHTML"],Qt={__name:"Tag",props:{label:{type:String,default:""},value:{type:String,default:""},addButton:{type:Boolean,default:!1},editButton:{type:Boolean,default:!1},dataTestId:{type:String,default:""}},setup(e){const t=e,n=be(()=>{const r=t.value;if(typeof r!="string")return!1;const i=new DOMParser().parseFromString(r,"text/html");return Array.from(i.body.childNodes).some(o=>o.nodeType===1)});return(r,i)=>e.addButton?(X(),ne("div",{key:0,class:"ect-bg-orange-4 ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-orange-secondary","data-test-id":e.dataTestId},[b("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-orange-secondary ect-flex ect-items-center ect-gap-1","data-test-id":`${e.dataTestId}-content`},[b("div",{"data-test-id":`${e.dataTestId}-add-icon`},Eh,8,kh),Ve(" "+ve(e.label),1)],8,xh)],8,wh)):e.editButton?(X(),ne("div",{key:1,class:"ect-bg-white ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-success","data-test-id":e.dataTestId},[b("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-success ect-flex ect-items-center ect-gap-1","data-test-id":`${e.dataTestId}-content`},ve(e.label),9,Sh)],8,Oh)):(X(),ne("div",{key:2,class:"ect-bg-white ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-rounded-md ect-border ect-border-solid ect-border-neutral-200","data-test-id":e.dataTestId},[b("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${e.dataTestId}-label`},ve(e.label),9,Ah),e.value?(X(),ne("span",{key:0,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${e.dataTestId}-separator`}," : ",8,Th)):ye("",!0),n.value?(X(),Te(Ch,{key:1,content:e.value},null,8,["content"])):e.value?(X(),ne("span",{key:2,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-neutral-700","data-test-id":`${e.dataTestId}-value`,innerHTML:e.value},null,8,Nh)):ye("",!0)],8,Ih))}},Ph=["data-test-id"],Lh=["data-test-id"],Rh=["data-test-id"],Mh=["type","step","min","data-test-id"],Ea=He({__name:"InputEdit",props:{modelValue:{type:String,required:!0},type:{type:String,default:"string",validator:e=>["string","number","currency"].includes(e)},tag:{type:String,default:"span"},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:modelValue","change"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=ae(!1),a=ae(!1),s=ae(""),l=ae(null),h=be(()=>r.type==="currency"?v(r.modelValue):r.type==="number"?_(r.modelValue):r.modelValue),c=be(()=>r.type==="string"?"text":"number"),f=be(()=>r.type==="currency"?"0.01":void 0),u=be(()=>r.type==="currency"?"0":void 0),g=()=>{r.disabled||(r.type==="currency"?s.value=parseFloat(r.modelValue)||"0.00":r.type==="number"?s.value=parseFloat(r.modelValue)||"0":s.value=r.modelValue,o.value=!0,zt(()=>{l.value&&(l.value.focus(),l.value.select())}))},p=()=>{let C=s.value;if(r.type==="number"||r.type==="currency"){const y=parseFloat(s.value);isNaN(y)?C=r.modelValue:C=r.type==="currency"?y.toFixed(2):y.toString()}C!==r.modelValue&&(i("update:modelValue",C),i("change",C)),o.value=!1},m=()=>{s.value=r.modelValue,o.value=!1},d=()=>{o.value&&p()},v=C=>!C||isNaN(C)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(parseFloat(C)),_=C=>!C||isNaN(C)?"0":new Intl.NumberFormat("en-US").format(parseFloat(C));return St(()=>r.modelValue,C=>{o.value||(s.value=C)}),t({startEditing:g,saveChanges:p,cancelEditing:m}),(C,y)=>{const w=Uf("click-outside");return X(),ne("div",{class:"ect-relative ect-inline-block ect-min-w-[60px] ect-h-[30px]","data-test-id":e.dataTestId,onMouseenter:y[1]||(y[1]=A=>a.value=!0),onMouseleave:y[2]||(y[2]=A=>a.value=!1)},[o.value?wn((X(),ne("div",{key:1,class:"ect-w-full ect-h-full","data-test-id":`${e.dataTestId}-input-wrapper`},[wn(b("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":y[0]||(y[0]=A=>s.value=A),type:c.value,step:f.value,min:u.value,class:Ie(["ect-w-full ect-h-full ect-px-3 ect-bg-white ect-border ect-border-green-500 ect-rounded-sm ect-text-gray-700 ect-text-base ect-font-sans ect-outline-none ect-duration-200",C.$attrs.class]),"data-test-id":`${e.dataTestId}-input`,onKeyup:[jr(p,["enter"]),jr(m,["esc"])],onBlur:p},null,42,Mh),[[f1,s.value]])],8,Rh)),[[w,d]]):(X(),ne("div",{key:0,class:Ie(["ect-flex ect-items-center ect-gap-2 ect-rounded ect-transition-colors ect-duration-200",{"ect-cursor-pointer":!e.disabled}]),"data-test-id":`${e.dataTestId}-display`,onClick:g},[(X(),Te(Cl(e.tag),fa(C.$attrs,{class:"ect-m-0 ect-text-inherit","data-test-id":`${e.dataTestId}-text`}),{default:Be(()=>[Ve(ve(h.value)+" ",1),_e(Ge,{class:Ie(a.value&&!e.disabled?"ect-visible":"ect-invisible"),icon:"edit",size:"12",color:"#828282","data-test-id":`${e.dataTestId}-edit-icon`},null,8,["class","data-test-id"])]),_:1},16,["data-test-id"]))],10,Lh))],40,Ph)}}},[["__scopeId","data-v-07416d80"]]),qh=["data-test-id","data-publish-key"],jh={key:0,class:"ect-text-xs ect-text-gray-500 ect-text-white ect-font-medium ect-leading-tight ect-absolute ect-top-[-.7rem] ect-left-[-1rem] ect-bg-text-success ect-rounded-xl ect-px-2 ect-py-1"},Dh={key:1,class:"ect-flex ect-items-start ect-gap-4 ect-p-3 ect-px-4"},Bh={key:0,class:"ect-w-16 ect-h-16 ect-flex ect-items-center ect-justify-center ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0"},$h=["src","alt"],Fh={class:"ect-flex-1 ect-min-w-0"},Vh={class:"ect-flex ect-gap-4 ect-items-center ect-justify-between"},Hh={class:"ect-flex ect-flex-row ect-gap-3"},Uh=b("div",{class:"ect-w-px ect-h-auto ect-bg-gray-200 ect-mx-2"},null,-1),zh={class:"ect-flex ect-flex-col ect-max-w-[125px]"},Kh={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},Zh=["innerHTML"],Qh={key:0,class:"ect-flex ect-flex-wrap ect-gap-2.5 ect-mt-2"},Xh=["data-test-id"],Jh=["data-test-id"],Wh={key:1,class:"ect-inline-block ect-mb-2"},Gh={key:2,class:"ect-flex ect-flex-col ect-gap-3 ect-p-3 ect-h-full ect-justify-between"},Yh={class:"ect-flex ect-items-start ect-gap-2"},e9={class:"ect-w-16 ect-h-16 ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0 ect-overflow-hidden"},t9=["src","alt"],n9={class:"ect-flex-1 ect-min-w-0"},r9={class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},i9={class:"ect-mt-1 ect-text-sm ect-text-gray-700 ect-leading-tight"},o9={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},a9={key:0,class:"ect-flex ect-flex-wrap ect-gap-1.5"},s9=["data-test-id"],l9=["data-test-id"],c9={key:1,class:"ect-inline-block ect-mb-2"},u9={class:"ect-flex ect-justify-between ect-items-center"},f9={class:"ect-flex ect-flex-col"},d9=b("p",{class:"ect-text-xs ect-text-gray-500 ect-font-medium ect-leading-tight"},"Price",-1),h9={key:3,"data-test-id":"configurator-item-slot-details",class:"ect-bg-white ect-rounded-md"},p9={__name:"ConfiguratorItem",props:{item:{type:Object,required:!0},name:{type:String,required:!0},description:{type:String,default:""},imageUrl:{type:String,default:""},price:{type:Number,required:!0},quantity:{type:Number,default:1},selected:{type:Boolean,default:!1},tags:{type:Array,default:()=>[]},attributes:{type:Array,default:()=>[]},size:{type:Number,default:1},minQuantity:{type:Number,default:null},maxQuantity:{type:Number,default:null},showImage:{type:Boolean,default:!1},option:{type:Object,default:null},isAttributes:{type:Boolean,default:!1},showAttributes:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:quantity","update:name","edit-attributes"],setup(e,{emit:t}){const n=e,r=t,i=ae(null),o=ae(0),a=ae(n.item),s=be(()=>a.value.relationshipInfo.relationship==="Kit"?"ect-bg-green-3 ect-border-gray-200 ect-border-success":n.disabled?"ect-bg-light-bg-x ect-border-gray-200":n.selected?"ect-bg-green-3 ect-border-gray-200 ect-border-success":"ect-bg-white ect-border-gray-200 hover:ect-border-success"),l=be({get:()=>n.quantity,set:p=>r("update:quantity",p)}),h=be({get:()=>n.name,set:p=>r("update:name",p)}),c=p=>{r("update:quantity",p)},f=be(()=>{if(o.value===0)return n.tags;const m=Math.floor(o.value/120);return n.tags.slice(0,Math.max(1,m))}),u=be(()=>Math.max(0,n.tags.length-f.value.length)),g=()=>{if(i.value){const p=i.value,m=80,d=120,v=32,_=64;o.value=p.offsetWidth-m-d-v-_}};return kn(()=>{zt(()=>{g()})}),St(()=>n.tags,()=>{zt(()=>{g()})},{deep:!0}),kn(()=>{window.addEventListener("resize",g)}),(p,m)=>(X(),ne("div",{ref_key:"containerRef",ref:i,class:Ie(["ect-w-full ect-rounded-md ect-border-1 ect-transition-colors ect-relative",s.value]),"data-test-id":`configurator-item-${e.item.itemId}`,"data-publish-key":e.item.publishKey},[e.item.relationshipInfo.relationship==="Kit"?(X(),ne("div",jh," KIT ")):ye("",!0),e.size===1?(X(),ne("div",Dh,[e.showImage?(X(),ne("div",Bh,[e.imageUrl?(X(),ne("img",{key:0,src:e.imageUrl,alt:h.value,class:"ect-w-full ect-h-full ect-object-cover"},null,8,$h)):(X(),Te(Ge,{key:1,disabled:"",icon:"image",symbol:"",size:20,color:"#ACACAC"}))])):ye("",!0),b("div",Fh,[b("div",Vh,[_e(Ea,{modelValue:h.value,"onUpdate:modelValue":m[0]||(m[0]=d=>h.value=d),tag:"h3",class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},null,8,["modelValue"]),b("div",Hh,[b("div",{onClick:m[2]||(m[2]=Nt(()=>{},["stop"]))},[_e(Ki,{value:l.value,"onUpdate:value":m[1]||(m[1]=d=>l.value=d),min:e.minQuantity,max:e.maxQuantity,"data-test-id":`configurator-item-counter-${e.item.itemId}`,onChange:c},null,8,["value","min","max","data-test-id"])]),Uh,b("div",zh,[_e(Ea,{modelValue:a.value.price,"onUpdate:modelValue":m[3]||(m[3]=d=>a.value.price=d),tag:"p",type:"currency",class:"ect-text-base ect-font-bold"},null,8,["modelValue"])]),b("div",Kh,[Qe(p.$slots,"selection-control")])])]),b("p",{class:"ect-mt-2 ect-text-sm ect-text-gray-700 ect-leading-tight",innerHTML:e.description},null,8,Zh),e.isAttributes&&e.showAttributes&&e.selected?(X(),ne("div",Qh,[a.value.getTags().length>0?(X(),ne(Oe,{key:0},[(X(!0),ne(Oe,null,Ke(f.value,(d,v)=>(X(),ne("span",{key:v,class:"ect-inline-block"},[_e(Qt,{label:d.label,value:d.value},null,8,["label","value"])]))),128)),u.value>0?(X(),ne("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${e.item.itemId}`,onClick:m[4]||(m[4]=Nt(()=>{},["stop"]))}," +"+ve(u.value)+" more ",9,Xh)):ye("",!0),e.selected?(X(),ne("button",{key:1,"data-test-id":`configurator-item-button-edit-attributes-${e.item.itemId}`,onClick:m[5]||(m[5]=d=>r("edit-attributes"))},[_e(Qt,{label:"Edit attributes","edit-button":""})],8,Jh)):ye("",!0)],64)):(X(),ne("span",Wh,[b("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:m[6]||(m[6]=d=>r("edit-attributes"))},[_e(Qt,{label:"Add attributes","add-button":""})])]))])):ye("",!0)])])):(X(),ne("div",Gh,[b("div",Yh,[b("div",e9,[e.imageUrl?(X(),ne("img",{key:0,src:e.imageUrl,alt:e.name,class:"ect-w-full ect-h-full ect-object-cover"},null,8,t9)):ye("",!0)]),b("div",n9,[b("h3",r9,ve(e.name),1),b("p",i9,ve(e.description),1)]),b("div",o9,[Qe(p.$slots,"selection-control")])]),e.isAttributes&&e.showAttributes&&e.selected?(X(),ne("div",a9,[a.value.getTags().length>0?(X(),ne(Oe,{key:0},[(X(!0),ne(Oe,null,Ke(f.value,(d,v)=>(X(),ne("span",{key:v,class:"ect-inline-block"},[_e(Qt,{label:d.label,value:d.value},null,8,["label","value"])]))),128)),u.value>0?(X(),ne("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${e.item.itemId}`,onClick:m[7]||(m[7]=Nt(()=>{},["stop"]))}," +"+ve(u.value)+" more ",9,s9)):ye("",!0),e.selected?(X(),ne("button",{key:1,class:"ect-ml-auto","data-test-id":`configurator-item-button-edit-attributes-${e.item.itemId}`,onClick:m[8]||(m[8]=d=>r("edit-attributes"))},[_e(Qt,{label:"Edit attributes","edit-button":""})],8,l9)):ye("",!0)],64)):(X(),ne("span",c9,[b("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:m[9]||(m[9]=d=>r("edit-attributes"))},[_e(Qt,{label:"Add attributes","add-button":""})])]))])):ye("",!0),b("div",u9,[b("div",{onClick:m[11]||(m[11]=Nt(()=>{},["stop"]))},[_e(Ki,{value:l.value,"onUpdate:value":m[10]||(m[10]=d=>l.value=d),min:e.minQuantity,max:e.maxQuantity,"data-test-id":`configurator-item-counter-${e.item.itemId}`,onChange:c},null,8,["value","min","max","data-test-id"])]),b("div",f9,[d9,_e(Ea,{modelValue:a.value.price,"onUpdate:modelValue":m[12]||(m[12]=d=>a.value.price=d),tag:"p",type:"currency",class:"ect-w-[125px] ect-text-base ect-font-bold"},null,8,["modelValue"])])])])),e.selected&&e.isAttributes?(X(),ne("div",h9,[Qe(p.$slots,"default")])):ye("",!0)],10,qh))}},g9={"af-ZA":",","sq-AL":",","ar-DZ":",","ar-BH":"٫","ar-EG":"٫","ar-IQ":"٫","ar-JO":"٫","ar-KW":"٫","ar-LB":"٫","ar-LY":",","ar-MA":",","ar-OM":"٫","ar-QA":"٫","ar-SA":"٫","ar-SD":"٫","ar-SY":"٫","ar-TN":",","ar-AE":"٫","ar-YE":"٫","hy-AM":",","az-AZ":",","bn-BD":".","bn-IN":".","eu-ES":",","be-BY":",","bs-BA":",","bg-BG":",","my-MM":".","ca-ES":",","ca-ES-EURO":",","zh-CN":".","zh-CN-PINYIN":".","zh-CN-STROKE":".","zh-HK":".","zh-HK-STROKE":".","zh-MO":".","zh-SG":".","zh-TW":".","zh-TW-STROKE":".","hr-HR":",","cs-CZ":",","da-DK":",","nl-AW":",","nl-BE":",","nl-NL":",","nl-SR":",","dz-BT":".","en-AG":".","en-AU":".","en-BS":".","en-BB":".","en-BZ":".","en-BM":".","en-BW":".","en-CM":".","en-CA":".","en-DE":",","en-KY":".","en-ER":".","en-FK":".","en-FJ":".","en-GM":".","en-GH":".","en-GI":".","en-GY":".","en-HK":".","en-IN":".","en-ID":".","en-IE":".","en-IE-EURO":".","en-JM":".","en-KE":".","en-LR":".","en-MG":".","en-MW":".","en-MY":".","en-MU":".","en-NA":".","en-NZ":".","en-NG":".","en-PK":".","en-PG":".","en-PH":".","en-RW":".","en-WS":".","en-SC":".","en-SL":".","en-SG":".","en-SX":".","en-SB":".","en-ZA":",","en-SH":".","en-SZ":".","en-TZ":".","en-TO":".","en-TT":".","en-UG":".","en-GB":".","en-US":".","en-VU":".","et-EE":",","fi-FI":",","fi-FI-EURO":",","fr-BE":",","fr-CA":",","fr-KM":",","fr-FR":",","fr-FR-EURO":",","fr-GN":",","fr-HT":",","fr-LU":",","fr-MR":",","fr-MC":",","fr-CH":",","fr-WF":",","ka-GE":",","de-AT":",","de-AT-EURO":",","de-BE":",","de-DE":",","de-DE-EURO":",","de-LU":",","de-LU-EURO":",","de-CH":".","el-GR":",","gu-IN":".","iw-IL":".","hi-IN":".","hu-HU":",","is-IS":",","in-ID":",","ga-IE":".","it-IT":",","it-CH":".","ja-JP":".","kn-IN":".","kk-KZ":",","km-KH":",","ko-KP":".","ko-KR":".","ky-KG":",","lo-LA":",","lv-LV":",","lt-LT":",","lu-CD":",","lb-LU":",","mk-MK":",","ms-BN":",","ms-MY":".","ml-IN":".","mt-MT":".","mi-NZ":".","mr-IN":".","ne-NP":".","no-NO":",","ps-AF":"٫","fa-IR":"٫","pl-PL":",","pt-AO":",","pt-BR":",","pt-CV":",","pt-MZ":",","pt-PT":",","pt-ST":",","ro-MD":",","ro-RO":",","rm-CH":".","rn-BI":",","ru-KZ":",","ru-RU":",","sr-BA":",","sr-RS":",","sh-BA":",","sh-ME":",","sh-ME-USD":",","sh-CS":",","sk-SK":",","sl-SI":",","so-DJ":".","so-SO":".","es-AR":",","es-BO":",","es-CL":",","es-CO":",","es-CR":",","es-CU":".","es-DO":".","es-EC":",","es-SV":".","es-GT":".","es-HN":".","es-MX":".","es-NI":".","es-PA":".","es-PY":",","es-PE":".","es-PR":".","es-ES":",","es-ES-EURO":",","es-US":".","es-UY":",","es-VE":",","sw-KE":".","sv-SE":",","tl-PH":".","tg-TJ":",","ta-IN":".","ta-LK":".","te-IN":".","th-TH":".","ti-ET":".","tr-TR":",","uk-UA":",","ur-PK":".","uz-LATN-UZ":",","vi-VN":",","cy-GB":".","xh-ZA":".","yo-BJ":".","zu-ZA":"."},m9={name:"CustomInput",components:{AppIcon:Ge},props:{editMode:{type:Boolean,default:!0},type:{type:String,default:"text"},max:{type:Number,default:500},label:{type:String,default:""},name:{type:String,default:""},showLabel:{type:Boolean,default:!0},modelValue:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},isReadOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},highlight:{type:Boolean,default:!1},placeholder:{type:String,default:""},error:{type:[Boolean,String],default:!1},cssClass:{type:Object,default:()=>({})},tooltip:{type:String,default:null},locale:{type:String,default:"en-US"},icon:{type:String,default:null},itooltip:{type:String,default:null},icolor:{type:String,default:"#7d7d7d"},ihover:{type:String,default:"#57c046"},icustom:{type:Boolean,default:!1},idisabled:{type:Boolean,default:!1},height:{type:Number,default:32},textAlignment:{type:String,default:"left"},decimalPrecision:{type:Number,default:0},allowNegatives:{type:Boolean,default:!1},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["update:modelValue","iclick","blur"],data(){return{initialValue:"",decimalSeprator:".",ctrl:!1}},computed:{getValue(){return this.modelValue?this.type==="currency"?String(this.modelValue).replace(".",this.decimalSeprator):String(this.modelValue):""},error_message(){return typeof this.error=="string"?this.error:this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},isHighlight(){return(this.initialValue===""||this.initialValue===null)&&(this.modelValue===""||this.modelValue===null)?!1:this.initialValue!==this.modelValue}},created(){this.initialValue=this.modelValue,this.decimalSeprator=this.type==="currency"?g9[this.locale]:"."},methods:{handlerInput(e){const t=e.target.value;this.type==="currency"?this.$emit("update:modelValue",t.replace(this.decimalSeprator,".")):this.$emit("update:modelValue",t)},preventNonNumeric(e){if(this.type==="number"){const t=this.decimalPrecision,n=e.target.value,r=e.key;if(["Backspace","ArrowLeft","ArrowRight","Delete","Tab"].includes(r)||this.allowNegatives&&r==="-")return;if(r==="."&&t===0){e.preventDefault();return}if(r==="."&&n.includes(".")){e.preventDefault();return}if(r==="."||n.includes(".")&&!n.endsWith(".")&&r!=="Backspace"){const i=n.split(".");if(i.length>1&&i[1].length>=t){e.preventDefault();return}}if(isNaN(r)&&![".","Backspace","Tab"].includes(r)){e.preventDefault();return}}if(e.key==="Backspace"||this.ctrl)return!0;if(e.key==="Control"&&(this.ctrl=!0),this.type==="currency"||this.type==="number"){if(!this.getValue.includes(this.decimalSeprator)&&e.key===this.decimalSeprator)return!0;/[\deE+\-]/.test(e.key)||e.preventDefault()}return!0},handlerKeyup(e){e.key==="Control"&&(this.ctrl=!1)}}},v9=["data-test-id"],y9=["for","data-test-id"],_9=["data-test-id"],b9=["id","type","name","disabled","placeholder","value","maxlength","readonly","data-test-id"],C9=["data-test-id"],w9=["data-test-id"];function x9(e,t,n,r,i,o){const a=Sr("AppIcon");return X(),ne("div",{class:"input","data-test-id":n.dataTestId},[n.label&&n.showLabel?(X(),ne("label",{key:0,class:Ie({error_color:!!n.error}),for:n.label,"data-test-id":`${n.dataTestId}-label`},[Ve(ve(n.label)+" ",1),n.required?(X(),ne("span",{key:0,class:Ie({error_color:!!n.error})},"*",2)):ye("",!0)],10,y9)):ye("",!0),n.editMode?(X(),ne("div",{key:1,class:Ie(["input-wrapper ect-w-full",{errorBorder_color:!!n.error,highlight:o.isHighlight&&n.highlight}]),"data-test-id":`${n.dataTestId}-wrapper`},[n.icon?(X(),Te(a,{key:0,class:"input-wrapper_icon",icon:n.icon,hover:n.ihover,color:n.icolor,size:19,disabled:n.idisabled,custom:n.icustom,tooltip:n.itooltip,"data-test-id":`${n.dataTestId}-icon`,direction:"top-right",onClick:t[0]||(t[0]=s=>e.$emit("iclick"))},null,8,["icon","hover","color","disabled","custom","tooltip","data-test-id"])):ye("",!0),b("input",{id:n.label,class:Ie(`ectheme-input-box ${n.size}`),type:n.type,style:tt({width:n.icon?"calc(100% - 36px)":"100%",height:`${n.height}px`,textAlign:n.textAlignment}),name:n.name,disabled:n.disabled,placeholder:n.placeholder,value:o.getValue,maxlength:n.max,readonly:n.isReadOnly,"data-test-id":`${n.dataTestId}-input`,onInput:t[1]||(t[1]=(...s)=>o.handlerInput&&o.handlerInput(...s)),onKeydown:t[2]||(t[2]=(...s)=>o.preventNonNumeric&&o.preventNonNumeric(...s)),onKeyup:t[3]||(t[3]=(...s)=>o.handlerKeyup&&o.handlerKeyup(...s)),onBlur:t[4]||(t[4]=s=>e.$emit("blur"))},null,46,b9)],10,_9)):ye("",!0),n.editMode?ye("",!0):(X(),ne("p",{key:2,class:"value","data-test-id":`${n.dataTestId}-value`},ve(o.getValue),9,C9)),o.error_message?(X(),ne("div",{key:3,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${n.dataTestId}-error`},ve(o.error_message),9,w9)):ye("",!0)],8,v9)}const k9=He(m9,[["render",x9],["__scopeId","data-v-032ca141"]]),E9={name:"AtomSpinner",props:{dataTestId:{type:String,default:""}}},O9=["data-test-id"];function S9(e,t,n,r,i,o){return X(),ne("div",{class:"spinner","data-test-id":n.dataTestId},null,8,O9)}const I9={name:"CustomDropdown",components:{AppIcon:Ge,AtomSpinner:He(E9,[["render",S9],["__scopeId","data-v-771ed032"]])},props:{label:{type:String,default:""},placeholder:{type:String,default:""},options:{type:Array,default:()=>[]},display:{type:Array,default:()=>[]},modelValue:{type:String,default:""},error:{type:[Boolean,String],default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},select:{type:Boolean,default:!1},lookup:{type:Boolean,default:!1},search:{type:Boolean,default:!1},badge:{type:String,default:void 0},highlight:{type:Boolean,default:!1},property:{type:Object,default:()=>({key:"value",value:"label",assigned:"assigned"})},dropdownTheme:{type:String,default:"light"},icon:{type:String,default:""},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["search","focus-in","focus-out","update:modelValue"],data:()=>({inputFocused:!1,value:"",isHover:!1,highlightedIndex:-1,initialValue:"",teleportStyle:{position:"absolute",top:"0px",left:"0px",width:"0px"}}),computed:{isHighlight(){return(this.initialValue===""||this.initialValue==null)&&(this.modelValue===""||this.modelValue==null)?!1:this.initialValue!==this.modelValue},error_message(){return this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},getOptions(){if(this.select&&this.search){const e=this.value.toLowerCase();return this.options.filter(t=>JSON.stringify(t).toLowerCase().includes(e))}else return this.options},getSelected(){let e=null;if(this.modelValue)e=this.options.find(t=>t[this.property.key]===this.modelValue);else if(!this.search){const t=this.options.find(n=>n[this.property.key]==="");t?e=t:this.placeholder?e={[this.property.value]:this.placeholder,[this.property.key]:""}:e={[this.property.value]:"--Select--",[this.property.key]:""}}return e||{[this.property.value]:this.placeholder||"--Select--",[this.property.key]:""}},shouldShowAbove(){if(!this.$refs.triggerElement)return!1;const e=this.$refs.triggerElement.getBoundingClientRect(),t=250,n=window.innerHeight-e.bottom,r=e.top;return n<t&&r>t},dropdownStyle(){if(!this.$refs.triggerElement)return{};const e=this.$refs.triggerElement.getBoundingClientRect(),t=250,n=window.innerHeight-e.bottom,r=e.top,i=n<t&&r>t;return{position:"absolute",top:i?"auto":"100%",bottom:i?"100%":"auto",left:"0",width:"100%",zIndex:1e3}}},created(){this.initialValue=this.modelValue},mounted(){window.addEventListener("resize",this.updateDropdownPosition),window.addEventListener("scroll",this.updateDropdownPosition,!0)},beforeUnmount(){window.removeEventListener("resize",this.updateDropdownPosition),window.removeEventListener("scroll",this.updateDropdownPosition,!0)},methods:{updateDropdownPosition(){if(!this.$refs.triggerElement)return;const e=this.$refs.triggerElement.getBoundingClientRect(),t=200,n=window.innerHeight-e.bottom,r=e.top,i=n<t&&r>t;this.teleportStyle={position:"absolute",top:`${i?e.top-t:e.bottom}px`,left:`${e.left}px`,width:`${e.width}px`,zIndex:9999}},subFieldsText(e){if(!this.display||this.display.length<1)return"";const t=[];return this.display.forEach(n=>{const r=this.subField(e,n);r&&t.push(r)}),t.join(" | ")},subField(e,t){return t?t.split(".").reduce((i,o)=>i[o]||"",e):e},lookupSearchHandler:xc(function(e){this.value=e,this.search&&!this.select&&this.$emit("search",e)}),handlerFocusIn(){!(this.modelValue&&this.search)&&!this.disabled&&(this.inputFocused=!0,this.updateDropdownPosition(),this.$emit("focus-in"))},updateSelected(e){e&&(this.value="",this.$emit("update:modelValue",e[this.property.key]),this.search&&!this.select&&!this.lookup&&this.$emit("search",""),this.onInputFocusedOut(!0))},clear(){this.disabled||(this.value="",this.$emit("update:modelValue",null),this.search&&!this.select&&!this.lookup&&this.$emit("search",""))},onInputFocusedOut(e=!1){(!this.isHover||e)&&!this.disabled&&(e?(this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")):setTimeout(()=>{this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")},100))},highlightNextOption(){this.highlightedIndex<this.options.length-1&&this.highlightedIndex++},highlightPreviousOption(){this.highlightedIndex>0&&this.highlightedIndex--}}},A9=["data-test-id"],T9=["for","data-test-id"],N9={class:"input-container-box ect-grow ect-w-full"},P9=["data-test-id"],L9=["placeholder","disabled","data-test-id"],R9=["data-test-id"],M9=["title","data-test-id"],q9=["data-test-id"],j9=["data-test-id"],D9=["data-test-id"],B9=["data-test-id"],$9=["data-test-id","onClick"],F9=["data-test-id"],V9={class:"ect-text-font-clr-light ect-flex ect-gap-2 ect-items-center ect-justify-between ect-w-full"},H9=["data-test-id"],U9=["data-test-id"],z9=["data-test-id"],K9=["title","data-test-id"],Z9=["data-test-id"];function Q9(e,t,n,r,i,o){const a=Sr("AppIcon"),s=Sr("AtomSpinner");return X(),ne("div",{ref:"dropdownWrapper",class:Ie(["customdropdown input-container",{dark:n.dropdownTheme==="dark"}]),"data-test-id":n.dataTestId,onMouseenter:t[7]||(t[7]=l=>e.isHover=!0),onMouseleave:t[8]||(t[8]=l=>e.isHover=!1)},[n.label?(X(),ne("label",{key:0,class:Ie(["title_label",{error_color:!!n.error}]),for:n.label,"data-test-id":`${n.dataTestId}-label`},[Ve(ve(n.label)+" ",1),n.required?(X(),ne("span",{key:0,class:Ie({error_color:!!n.error})},"*",2)):ye("",!0)],10,T9)):ye("",!0),b("div",N9,[b("div",{ref:"triggerElement",class:Ie(["input-wrapper ectheme-input-box ect-w-full",{disabled:n.disabled,"input-error":n.error,highlight:o.isHighlight&&n.highlight,"size-large":n.size==="large","size-medium":n.size==="medium"||n.size==="small"}]),"data-test-id":`${n.dataTestId}-trigger`,tabindex:"0",onFocusin:t[2]||(t[2]=(...l)=>o.handlerFocusIn&&o.handlerFocusIn(...l)),onFocusout:t[3]||(t[3]=l=>o.onInputFocusedOut(!1)),onKeydown:[t[4]||(t[4]=jr(l=>o.updateSelected(n.options[e.highlightedIndex]),["enter"])),t[5]||(t[5]=jr(Nt((...l)=>o.highlightPreviousOption&&o.highlightPreviousOption(...l),["prevent"]),["up"])),t[6]||(t[6]=jr(Nt((...l)=>o.highlightNextOption&&o.highlightNextOption(...l),["prevent"]),["down"]))]},[!n.modelValue&&n.search?wn((X(),ne("input",{key:0,ref:"searchInput","onUpdate:modelValue":t[0]||(t[0]=l=>e.value=l),type:"text",name:"search",placeholder:n.placeholder,autocomplete:"off",disabled:n.disabled,"data-test-id":`${n.dataTestId}-search-input`,onInput:t[1]||(t[1]=Nt(l=>o.lookupSearchHandler(l.target.value),["prevent"]))},null,40,L9)),[[Bi,e.value]]):(X(),ne("div",{key:1,class:Ie(["selection-name ect-text-text-primary-dark ect-flex ect-justify-between ect-items-center",{"size-large":n.size==="large","size-medium":n.size==="medium"||n.size==="small"}]),"data-test-id":`${n.dataTestId}-selection`},[o.getSelected?(X(),ne(Oe,{key:0},[b("span",{title:o.getSelected[n.property.value],class:Ie(["ect-flex ect-items-center ect-gap-2 ect-font-medium",{"ect-text-font-clr-light":!n.modelValue}]),"data-test-id":`${n.dataTestId}-selection-value`},[n.icon?(X(),Te(a,{key:0,class:"ect-mr-0",icon:n.icon,size:14,color:"#5F5F5F","data-test-id":`${n.dataTestId}-selection-icon`},null,8,["icon","data-test-id"])):ye("",!0),Ve(" "+ve(o.getSelected[n.property.value]),1)],10,M9),n.badge&&o.getSelected[n.badge]?(X(),ne("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${n.dataTestId}-selection-badge`},ve(o.getSelected[n.badge]),9,q9)):ye("",!0)],64)):ye("",!0)],10,R9)),n.search?(X(),ne(Oe,{key:2},[n.loading?(X(),Te(s,{key:0,class:"spinner","data-test-id":`${n.dataTestId}-loading-spinner`},null,8,["data-test-id"])):(X(),ne("div",{key:1,class:"clear-button","data-test-id":`${n.dataTestId}-action-button`},[e.value||n.modelValue?(X(),Te(a,{key:0,disabled:n.disabled,icon:"close",color:"#acacac",size:10,"data-test-id":`${n.dataTestId}-clear-button`,onClick:o.clear},null,8,["disabled","data-test-id","onClick"])):(X(),Te(a,{key:1,icon:"search",size:14,color:"#acacac",disabled:n.disabled,"data-test-id":`${n.dataTestId}-search-button`},null,8,["disabled","data-test-id"]))],8,j9))],64)):(X(),Te(a,{key:3,class:"clear-button",color:o.error_message?"#ff6a6a":"#acacac",icon:"arrow_drop_up",size:12,disabled:n.disabled,"data-test-id":`${n.dataTestId}-dropdown-arrow`},null,8,["color","disabled","data-test-id"]))],42,P9),o.error_message?(X(),ne("div",{key:0,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${n.dataTestId}-error`},ve(o.error_message),9,D9)):ye("",!0),o.getOptions&&e.inputFocused&&!n.disabled&&(n.select||n.lookup)?(X(),ne("div",{key:1,ref:"dropdown",class:Ie(["dropdown",{"dropdown-above":o.shouldShowAbove}]),style:tt(o.dropdownStyle),"data-test-id":`${n.dataTestId}-dropdown`},[(X(!0),ne(Oe,null,Ke(o.getOptions,(l,h)=>(X(),ne("div",{key:l[n.property.key],class:Ie(["dropdown-item",{highlighted:h===e.highlightedIndex,"ect-pointer-events-none":l[n.property.assigned]}]),"data-test-id":`${n.dataTestId}-option-${h}`,onClick:c=>o.updateSelected(l)},[b("div",{class:"name ect-items-center","data-test-id":`${n.dataTestId}-option-${h}-name`},[b("span",V9,[b("span",{class:Ie({"ect-text-zinc-400":l[n.property.assigned]}),"data-test-id":`${n.dataTestId}-option-${h}-value`},ve(l[n.property.value]==null?"Key and Value is Wrong":l[n.property.value]),11,H9),l[n.property.assigned]?(X(),ne("span",{key:0,class:"ect-text-xs ect-leading-4 ect-text-zinc-600","data-test-id":`${n.dataTestId}-option-${h}-assigned`},"Assigned",8,U9)):ye("",!0)]),n.badge?(X(),ne("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${n.dataTestId}-option-${h}-badge`},ve(l[n.badge]),9,z9)):ye("",!0)],8,F9),b("div",{class:"info",title:o.subFieldsText(l),"data-test-id":`${n.dataTestId}-option-${h}-info`},[b("span",null,ve(o.subFieldsText(l)),1)],8,K9)],10,$9))),128)),!o.getOptions.length&&!n.loading&&(e.value||n.select)?(X(),ne("div",{key:0,class:"no-items-found","data-test-id":`${n.dataTestId}-no-options`}," no options found ",8,Z9)):ye("",!0)],14,B9)):ye("",!0)])],42,A9)}const Lc=He(I9,[["render",Q9],["__scopeId","data-v-5ae4f6dc"]]);var ot=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mc={exports:{}};/*!
28
+ */var Ic;(function(e){e.pop="pop",e.push="push"})(Ic||(Ic={}));var Ac;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Ac||(Ac={}));var Tc;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Tc||(Tc={}));const K0=Symbol(""),Z0=Symbol("");function Hi(){return En(K0)}function xa(){return En(Z0)}function bt(e){if(typeof e=="string"&&(e=JSON.parse(e)),e!=null&&e.errorMessage)throw new Error(e==null?void 0:e.errorMessage);return e}const ka={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"},Nc={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"},Q0=e=>{var n;let t=[];for(let r of e)if(r.trim()!=="xx_ord1__item__r.xx_ord1__decimal_precision__c")if(r.includes(".")){let o=r.split(".")[0];o=o.slice(0,-1)+"c";const a=((n=ka[o==null?void 0:o.toLowerCase()])==null?void 0:n.trim())||"";a&&(t.includes(a)||t.push(a||""),t.push(r))}else t.includes(ka[r==null?void 0:r.toLowerCase()])||t.push(ka[r==null?void 0:r.toLowerCase()]||"");return t.filter(r=>r!=="")},X0=Mt("actions",()=>{const e=zi(),t=Nn(),n=ae(!1);return{openAdaptiveSearch:(s,l=!1)=>{console.info("openAdaptiveSearch",s),e.chatHistory[e.chatHistory.length-1].links=[],e.sendMessage("Open Adaptive Search",!1,{internalCall:!0}),n.value=l},openQuoteItem:s=>{console.info("openQuoteItem",s),e.chatHistory[e.chatHistory.length-1].links=[],e.sendMessage("Open Quote Item",!1,{internalCall:!0})},openQuoteDocument:s=>{console.info("openQuoteDocument",s),e.chatHistory[e.chatHistory.length-1].links=[],e.chatHistory.push({type:"response",message:"Opening quote document",loading:!0});const h=`/apex/XX_ORD1__Expedite_Commerce?scpq=true&oid=${t.quoteId}&atpverified=true&ecCache=false&origin=AI`;window.location.href=`${s0(window.location.href)}${h}`},undo:()=>{const s=e==null?void 0:e.latestDMLRequest;e.sendMessage(`UNDO-${s}`,!1,{internalCall:!0})},isStaticActionCall:n}}),Pc=Mt("adaptiveSearch",()=>{const e=Nn(),t=sr(),n=zi(),r=X0(),i=ae(null),o=ae(null),a=ae(!1),s=ae(!1),l=ae([]),h=ae(""),c=ae(!1),f=ae(null),u=ae(!1),g=ae([]),p=sn(),m=ae([]),d=ae(0),v=ae(!1),_=ae({rowLimt:10,paging:!0,offset:0,currentPage:1,totalPages:1});async function C(){a.value=!0;try{const O=JSON.stringify({layoutType:"Search Selection",layoutObject:"xx_ord1__ecatalog_item__c"});let P={};return P=await window.salesforceConnector.getDynamicPageLayout(O),o.value=Oc(P,"Unable to find the Search Selection Layout for your user profile"),_.value.rowLimt=o.value.configuration.rowLimit||10,o.value.configuration.columns.forEach(M=>{!M.field&&M.label==="QTY"&&(M.field="xx_ord1__qty__c")}),a.value=!1,y(),P}catch(O){a.value=!1,p.handleError("Failed to get Adaptive Search Layout. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",O)}}function y(){var O,P,M;f.value=(M=(P=(O=o.value)==null?void 0:O.configuration)==null?void 0:P.dynamicFilters)==null?void 0:M.filters.map(Z=>({...Z,field:Z.field.toLowerCase(),filtervalue:Z.filtervalue||[],filtervaluefrom:Z.filtervaluefrom||"",filtervalueTo:Z.filtervalueTo||""}))}function w(){var P;let O=[];for(const M of o.value.configuration.columns){let Z=M.field;if(O.includes(Z)||O.push(Z),Z!=null&&Z.includes(".")){let B=Z.split(".")[0];B=B.slice(0,-1)+"c",O.includes(B)||O.push(B)}}return(P=o.value.configuration)!=null&&P.cardHeader&&O.push(o.value.configuration.cardHeader.imageField),o.value.configuration.objectName.toLowerCase()==="xx_ord1__ecatalog_item__c"&&O.push("xx_ord1__item__r.xx_ord1__decimal_precision__c"),O=O.filter(M=>!!M),O.filter(M=>M.toLowerCase()!=="xx_ord1__qty__c"&&M.toLowerCase()!=="xx_ord1__competitor_sku__c")}function A(O,P=!1){if(!O||O.includes("undefined"))return!1;const M=/[!@#$%^&*()+=[\]{};':"\\|.<>/?]+/;if(P){const Z=Array.isArray(O)?O:O.split(",");for(const Q of Z){const B=Q.trim();if(M.test(B))return p.handleError(`Invalid character found in value: ${B}`),!1}}else if(M.test(O))return p.handleError("Special characters are not allowed in filter values"),!1;return!0}function I(O,P){return{field:O.field,operator:O.operator||"contains",value:P,dataType:O.dataType.trim()}}function S(O){if(!O.filtervalue)return null;const P=Array.isArray(O.filtervalue),M=P?O.filtervalue.join(","):O.filtervalue.trim();return A(M,P)?M:null}function N(O){var Q,B;const P=(Q=O.filtervaluefrom)==null?void 0:Q.trim(),M=(B=O.filtervalueTo)==null?void 0:B.trim();if(!P||!M)return null;const Z=`${P}, ${M}`;return Z!==", "&&A(Z)?Z:null}function T(O){const P=`${Ec(O.filtervaluefrom)}, ${Ec(O.filtervalueTo)}`;return P!==", "&&A(P)?P:null}function k(O){var M;const P=(M=O.filtervaluefrom)==null?void 0:M.trim();return A(P)?P:null}function E(O){const P=[];return O.forEach(M=>{const Z=M.dataType.trim();let Q=null;switch(Z){case"PICKLIST":case"MULTIPICKLIST":Q=S(M);break;case"DOUBLE":case"CURRENCY":Q=N(M);break;case"DATETIME":case"DATE":Q=T(M);break;default:Q=k(M)}Q&&P.push(I(M,Q))}),g.value=P,P}async function L(O="",P=[],M=[]){var Q,B,U,D,q,$,H,J,R,z;let Z=[];if(P.length&&(Z=E(P)),!Z.length&&O.trim()===""){l.value=[],c.value=!1;return}try{c.value=!1,s.value=!0;const oe=O.trim();M.length||(M=w());const ce={fields:M,...P.length?{dynamicFilters:Z}:{},searchText:oe||h.value.trim(),accountId:t.accountId,...t.eCatalogId?{catalogId:t.eCatalogId}:{},...t.objectType==="opportunity"?{opportunityId:t.id}:{},...(B=(Q=o.value)==null?void 0:Q.configuration)!=null&&B.sort?{primarySortBy:o.value.configuration.sort.primary.field,primarySortOrder:o.value.configuration.sort.primary.direction,secondarySortBy:o.value.configuration.sort.secondary.field,secondarySortOrder:o.value.configuration.sort.secondary.direction}:{},rowLimt:(D=(U=o.value)==null?void 0:U.configuration)==null?void 0:D.rowLimit,paging:($=(q=o.value)==null?void 0:q.configuration)==null?void 0:$.paging,...((H=_.value)==null?void 0:H.offset)!==0?{offset:_.value.offset}:{},objectName:(R=(J=o.value)==null?void 0:J.configuration)==null?void 0:R.objectName,currencyCode:t.currencyCode},le=await window.salesforceConnector.getItems(JSON.stringify(ce));if(le!=null&&le.errorMessage){p.handleError(le.errorMessage);return}le!=null&&le.itemCount&&(_.value.totalPages=Math.ceil((le==null?void 0:le.itemCount)/_.value.rowLimt)),l.value=Fi(le.lstItems,{xx_ord1__qty__c:"1"}),(z=le.lstItems)!=null&&z.length||(c.value=!0),s.value=!1}catch(oe){p.handleError("Failed to fetch Results. Please try again."),s.value=!1,console.info("[ERROR]: Adaptive Search getItems() error = ",oe)}}async function V(O){try{u.value=!0;const P=JSON.stringify({lstQLIRequest:K(O),quoteId:e.quoteId});let M=await window.salesforceConnector.createQLI(P);typeof M=="string"&&(M=JSON.parse(M));let Z=!1;if((M==null?void 0:M.length)>0&&M.forEach(Q=>{Q.errorMessage&&(Z=!0,p.handleError(Q.errorMessage))}),u.value=!1,Z){m.value=M;const Q=m.value.reduce((B,U)=>(B[U.eCatalogItemId]=U.errorMessage,B),{});l.value=l.value.map(B=>({...B,backendError:Q[B.Id]||""}));return}return M}catch(P){p.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addToQuote() error = ",P)}}function K(O){const P=[];for(const M of O)if(!M.addedToQuote&&M.id){const Z=W(M);d.value++,P.push({fields:Z,recordId:M.id,...O.length===1?{maxSequenceNumber:d.value}:{}})}return P}function W(O){const P=[],M=te();return Object.keys(O).forEach(Z=>{if(M.includes(Z)){const Q=Nc[Z.toLowerCase()];Q&&P.push({fieldname:Q,value:O[Z]})}}),P}function te(){const O=[];return o.value.configuration.columns.forEach(P=>{P.field&&!P.field.includes(".")&&P.isEditable&&P.visible&&O.push(P.field)}),O}function fe(){var P,M;const O=[];return o.value.configuration.columns.forEach(Z=>{const Q=Z.field.toLowerCase();O.includes(Q)||O.push(Q)}),(P=o.value.configuration)!=null&&P.dynamicFilters&&o.value.configuration.dynamicFilters.filters.forEach(Z=>{const Q=Z.field.toLowerCase();O.includes(Q)||O.push(Q)}),(M=o.value.configuration)!=null&&M.cardHeader&&O.push(o.value.configuration.cardHeader.imageField),O}async function ee(){var M;const O=fe(),P=((M=o.value.configuration)==null?void 0:M.saveObjectName)||o.value.configuration.objectName;if(P==="xx_ord1__ecatalog_item__c"){const Z=O.indexOf("xx_ord1__qty__c");Z>-1&&O.splice(Z,1)}await e.getFieldsData(O,P),e.fieldsData.xx_ord1__qty__c||e.getFieldsData(["xx_ord1__qty__c"],"xx_ord1__quote_line_item__c")}async function j({searchTerm:O="",filters:P=[]}={}){if(v.value=!0,O&&(h.value=O),P.length&&(g.value=P),await C()){await ee(),v.value=!1;const Z=h.value;Z&&(h.value=Z,await L(Z,e.dynamicFilters)),console.info("actionStore.isStaticActionCall = ",r.isStaticActionCall),r.isStaticActionCall&&(r.isStaticActionCall=!1,n.chatHistory[n.chatHistory.length-1]={type:"response",message:"Adaptive search is now open. Please search for the products you require and add it quote",loading:!1,links:[{action:"quoteItem",label:"Quote Item"},{action:"quoteDocument",label:"Quote Document"}]})}v.value=!1}return{selectedItem:i,AdaptiveSearchLayout:o,searchText:h,loadingAdaptiveLayout:a,getAdaptiveSearchLayout:C,getItems:L,lstItems:l,rowItemsLoading:s,noSearchRecords:c,dynamicFilters:f,setDynamicFilters:y,createQliErrors:m,addToQuote:V,addingToQuote:u,getFieldsData:ee,pagingData:_,appliedDynamicFilters:g,maxSequenceNumber:d,loadingAdaptiveSearch:v,initAdaptiveSearch:j}}),J0="XX_ORD1__Quote__c",W0="xxord1salespricec",Ui="xx_ord1__item__c",G0="xxord1productnrcc",Y0=Mt("cartStore",()=>{const e=Nn(),t=Pc(),n=sn(),r=ae(""),i=ae("$0"),o=ae("$0"),a=ae(null),s=ae({}),l=ae({}),h=ae({}),c=ae(""),f=ae(""),u=ae({}),g=ae(""),p=ae(""),m=ae({});async function d(){A()}async function v(){try{let N=await window.salesforceConnector.getProductCount(e.quoteId);if(N=bt(N),N!=null&&N.errorMessage){n.handleError(N.errorMessage);return}return r.value=N,N}catch{n.handleError("Failed to get Product Count. Please try again.")}}async function _(){try{let N=await window.salesforceConnector.getQuoteTotal(e.quoteId);if(N=bt(N),N!=null&&N.errorMessage){n.handleError(N.errorMessage);return}return o.value=N.monthlyTotal,i.value=N.onetimeTotal,N}catch{n.handleError("Failed to get Total Amount. Please try again.")}}async function C(N,T,k,E=""){if(!e.sectionDataMap.get(k).parentQLIs[T].removingItem){e.sectionDataMap.get(k).parentQLIs[T].removingItem=!0,p.value=N.id,await y(N.id)==="Success"&&(e.fetchAllQuoteLineItems(),E&&E(N,T,k));let V=e.sectionDataMap.get(k).parentQLIs.filter(K=>K[Ui]===N[Ui]).length;p.value="",t.lstItems.forEach(K=>{K[Ui]===N[Ui]&&(K.addedToQuote===!0&&(K.addedToQuote=!1),V===0&&(K.removedFromQuote=!0))})}}async function y(N){try{let T=await window.salesforceConnector.deleteQLI(N);if(T!=null&&T.errorMessage){n.handleError(T.errorMessage);return}return v(),_(),T}catch{n.handleError("Failed to remove Quote Item. Please try again.")}}function w(N){var E,L;const T=(E=N==null?void 0:N[G0])==null?void 0:E.match(/\.\d+/);T&&(T.value=T[0].length-1);const k=(L=N==null?void 0:N[W0])==null?void 0:L.match(/\.\d+/);return k&&(k.value=k[0].length-1),T||k}function A(N=!0){v(),_(),N&&e.fetchTemplates(J0).then(()=>{e.getFilteredListWithFields()})}function I(N){const T=e.sectionDataMap;for(const[,k]of T.entries())k.parentQLIs.forEach(E=>{E.id===N.id&&(k.columns.forEach(L=>{if(L.dataType==="CURRENCY"){const V=L.field.replace(/_/g,"");E[V]=S(E[V],N[L.field])}}),N!=null&&N.billingPeriodValue&&(N!=null&&N.formattedBillingPeriodValue)&&(E.formattedBillingPeriodValue=S(E.formattedBillingPeriodValue,N.billingPeriodValue)),N!=null&&N.oneTimeValue&&(N!=null&&N.formattedOneTimeValue)&&(E.formattedOneTimeValue=S(E.formattedOneTimeValue,N.oneTimeValue)))})}function S(N,T){const k=Number(T);if(isNaN(k))return N;const E=N.match(/(\d[\d,]*)(\.\d+)?/);if(!E)return N;const L=E[2]||"",V=L.length?L.length-1:0,K=k.toLocaleString("en-US",{minimumFractionDigits:V,maximumFractionDigits:V});return N.replace(E[1]+L,K)}return{initializeCart:d,loadCartState:A,productCount:r,onetimeTotal:i,monthlyTotal:o,filterCartItem:a,billingPeriodValue:c,hasOneTimeValue:f,hasBillingPeriodInList:s,oneTimeFieldAvailable:l,billingPeriodFieldAvailable:h,priceDecimalPrecision:u,cartItemUpdatingId:g,removingItemLoaderId:p,cartItemColumnsMap:m,getProductCount:v,getQuoteTotal:_,removeItem:C,removeQuoteItem:y,getDecimalPrecisionFromSalesPriceOrNRC:w,updateFormattedValues:I,formateCurrencyValue:S}}),e5=e=>[{title:"Apply Discount",subOptions:[...e.map(t=>`Apply Discount on ${t} for `),"Show Maximum discount allowed","Apply Maximum Discount Allowed",...e.map(t=>`Apply Discount on ${t} for a specific total`)]},{title:"Update Fields",subOptions:["Update the price of","Update the quantity of","Update the term start date to","Update the term end date to","Update the line description for"]},{title:"Price Ramp",subOptions:["Add a price ramp for"]}],t5={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"}]},n5=[{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"]}],Nn=Mt("quote",()=>{const e=sn(),t=Y0(),n=sr(),r=ae(""),i=ae(""),o=ae(0),a=ae(""),s=ae([]),l=ae({template:!0,filteredList:!1}),h=ae(null),c=ae(new Map),f=ae({}),u=ae(!1),g=ae(!0),p=ae(!1),m=ae({text:"Hide Options",altText:"Show Options",handler:()=>{g.value=!g.value,S()},color:"#136E05",isActive:!1}),d=be(()=>{const j=Array.from(c.value.values()).map(O=>O.sectionName);return e5(j)});St(a,()=>{l.value.template||I()});function v(){const j=new Map,O=[];for(const[M,Z]of c.value.entries())j.set(M,Z.selected),O.push(Z);const P=JSON.parse(JSON.stringify(O));return P.forEach(M=>{delete M.selected;const Z=new Map,Q=[];M.lineItems.forEach(B=>{B.Selected=j.get(M.tableId).get(B.id)||!1,B.xx_ord1__parent_qli__c?(Z.has(B.xx_ord1__parent_qli__c)||Z.set(B.xx_ord1__parent_qli__c,[]),Z.get(B.xx_ord1__parent_qli__c).push(B)):Q.push(B)}),M.lineItems=Q.map(B=>({...B,options:Z.get(B.id)||[]})),delete M.loading,delete M.parentQLIs,delete M.totalValues}),{showOptions:g.value,sections:P,templateId:a.value}}async function _(j){try{let O=await window.salesforceConnector.getPrimaryQuote(j);O=bt(O),O!==void 0&&(console.info("getPrimaryQuote",JSON.stringify(O)),r.value=O.recordId,console.info("quoteId",r.value),i.value=O.name,a.value=O==null?void 0:O.templateId,o.value=(O==null?void 0:O.lineItemsCount)||0)}catch(O){e.handleError(O.message),console.info("[ERROR]: getPrimaryQuote() error = ",O)}}async function C(j){var O,P;try{l.value.template=!0;let M=await window.salesforceConnector.fetchContentTemplates(JSON.stringify({lstObjectName:[j],templateType:"Document",templateId:null,fetchOnlyDefault:!1}));M=bt(M);const Z=M==null?void 0:M.templates[j];return a.value||(a.value=(O=Z.find(Q=>Q.XX_ORD1__Default__c))==null?void 0:O.Id),a.value||(a.value=(P=Z[0])==null?void 0:P.Id),s.value=Z,l.value.template=!1,s.value}catch(M){e.handleError(M.message),console.info("[ERROR]: fetchTemplates() error = ",M)}}function y(j){if(!j)return null;const O=/\{!\$(\w+):([\w.]+)\}/,P=j.match(O);return P?{function:P[1],apiname:P[2].split(".")[1]}:null}async function w(j){try{const O={Id:r.value,XX_ORD1__Document_Template__c:j};return await window.salesforceConnector.updateQuote(JSON.stringify([O]))}catch(O){e.handleError(O.message),console.info("[ERROR]: updateQuote() error = ",O)}}async function A(){try{l.value.filteredList=!0;let j=await window.salesforceConnector.getQuoteEPageLayout();c.value.clear(),t.cartItemColumnsMap={},j=bt(j);const O=j.map(M=>({label:M.fieldLabel,field:M.fieldName.toLowerCase(),isEditable:M.isEditable,dataType:M.dataType,...M.picklistValues?{picklistValues:M.picklistValues}:{}})),P=ar();return c.value.set(P,{loading:!0,lineItems:[],parentQLIs:[],columns:O,tableId:P,sectionName:"All Rows",selected:new Map,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}),t.cartItemColumnsMap[P]=O,m.value.isActive=!1,g.value=!0,h.value={lstCB:[{columns:O,footer:null,title:"All Rows",sectionName:"All Rows",tableId:P,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}]},S(),l.value.filteredList=!1,j}catch(j){e.handleError(j.message),console.info("[ERROR]: getQuoteEPageLayout() error = ",j)}}async function I(){if(s.value.length===0){A();return}try{l.value.filteredList=!0;let j=await window.salesforceConnector.getFilteredListWithFields(JSON.stringify({templateId:a.value}));w(a.value),j=bt(j),console.info("res.lstCB = ",j.lstCB);const O=j==null?void 0:j.objectFieldsMap;return c.value.clear(),t.cartItemColumnsMap={},j.lstCB=j.lstCB.map(P=>{const{fields:M,filters:Z,primarysort:Q,primarysortdesc:B}=JSON.parse(P.XX_ORD1__Block_Properties__c),U=M.map(q=>{var $;return{label:($=O[q.api])==null?void 0:$.label,field:q.api.toLowerCase(),isEditable:q.api.includes(".")?!1:O[q.api].isEditable,dataType:O[q.api].dataType,...O[q.api].picklistValues?{picklistValues:O[q.api].picklistValues}:{}}}),D=P.Id||ar();return c.value.set(D,{loading:!0,lineItems:[],parentQLIs:[],columns:U,tableId:D,sectionName:P.Name,selected:new Map,footer:y(P.XX_ORD1__Table_Footer_HTML__c),filters:Z,primarysort:Q,primarysortdesc:B}),t.cartItemColumnsMap[D]=U,m.value.isActive=!1,g.value=!0,{columns:U,footer:y(P.XX_ORD1__Table_Footer_HTML__c),title:P.Name,sectionName:P.Name,tableId:D,filters:Z,primarysort:Q,primarysortdesc:B}}),h.value=j,S(),l.value.filteredList=!1,j}catch(j){e.handleError(j.message),console.info("[ERROR]: getFilteredListWithFields() error = ",j)}}async function S(j=!0){const O=[];for(const[P]of c.value)O.push(k(P,j));return await Promise.all(O),t.getProductCount(),!0}function N(j,O){return c.value.get(j).columns.some(P=>P.field.toLowerCase()===O)||t.cartItemColumnsMap[j].some(P=>P.field.toLowerCase()===O)}function T(j,O){let P=Fi(j);const M=n.pricingSchema,Z=N(O,"xx_ord1__nrc__c"),Q=N(O,"xx_ord1__sales_price__c"),B=N(O,"xx_ord1__qty__c");return P=P.map(U=>{let D={};M==="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?D={...Q?{billingPeriodValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:U==null?void 0:U.xxord1salespricec}:{},...Z?{oneTimeValue:(U==null?void 0:U.xx_ord1__nrc__c)===0?"0":(U==null?void 0:U.xx_ord1__nrc__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1nrcc}:{}}:M==="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)?Q&&(D={oneTimeValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1salespricec}):M!=="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?Q&&(D={billingPeriodValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:U==null?void 0:U.xxord1salespricec}):M!=="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)&&Q&&(D={oneTimeValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?0:(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1salespricec});const{xx_ord1__qty__c:q,xx_ord1__sales_price__c:$,xx_ord1__nrc__c:H,...J}=U,R={...J,id:U.id,description:(U==null?void 0:U.xx_ord1__line_description__c)||"",xx_ord1__billing_period__c:U==null?void 0:U.xx_ord1__billing_period__c,...B?{xx_ord1__qty__c:q}:{},xx_ord1__item__c:U==null?void 0:U.xx_ord1__item__c,"xx_ord1__item__r.xx_ord1__decimal_precision__c":U["xx_ord1__item__r.xx_ord1__decimal_precision__c"]||"0",...D};return R!=null&&R.billingPeriodValue&&(t.hasBillingPeriodInList[O]=!0,t.billingPeriodValue=R==null?void 0:R.xx_ord1__billing_period__c),"oneTimeValue"in R&&(t.oneTimeFieldAvailable[O]=!0),"billingPeriodValue"in R&&(t.billingPeriodFieldAvailable[O]=!0),(R==null?void 0:R.oneTimeValue)!==""&&(R==null?void 0:R.oneTimeValue)!==null&&(t.hasOneTimeValue=!0),R}),P}async function k(j,O=!0){var P,M;try{const Z=c.value.get(j);if(console.info("sectionData = ",Z.sectionName),!Z)return;Z.loading=O,O&&(Z.lineItems=[]);const{columns:Q,filters:B,primarysort:U,primarysortdesc:D,footer:q}=Z,$=Q.map(le=>le.field.toLowerCase());$.includes("xx_ord1__parent_qli__c")||$.push("xx_ord1__parent_qli__c"),$.includes("xx_ord1__item__c")||$.push("xx_ord1__item__c"),$.includes("xx_ord1__sys_configuration_status2__c")||$.push("xx_ord1__sys_configuration_status2__c"),(P=t.cartItemColumnsMap[j])==null||P.forEach(le=>{$.includes(le.field)||$.push(le.field)});const H=await E({fields:$,recordId:r.value,filters:B||[],primarySortBy:U||"",primarySortOrder:D?"DESC":"ASC",includeOptions:g.value,totalFields:q?[q.apiname]:[]}),J=H.lineItems,R=new Map;let z=[];const oe=(M=H.fieldTotals)==null?void 0:M.map(le=>le.totalValue);J.forEach(le=>{le.XX_ORD1__Parent_QLI__c?R.has(le.XX_ORD1__Parent_QLI__c)?R.get(le.XX_ORD1__Parent_QLI__c).push(le):R.set(le.XX_ORD1__Parent_QLI__c,[le]):z.push(le)});const ce=[];return z.forEach(le=>{ce.push(le),R.has(le.Id)&&ce.push(...R.get(le.Id))}),z=T(z,j),Z.lineItems=Fi(ce),Z.parentQLIs=z,Z.totalValues=oe,Z.loading=!1,c.value=new Map(c.value),ce}catch(Z){console.info("[ERROR]: fetchQuoteLineItems()123 error = ",Z.message);const Q=c.value.get(j);Q&&(Q.loading=!1)}}async function E(j){try{let O=await window.salesforceConnector.getQuoteLineItemsWithFilteredTable(JSON.stringify(j));return O=bt(O),O}catch(O){e.handleError(O.message),console.info("[ERROR]: getQuoteLineItemsWithFilteredTable() error = ",O)}}async function L(j){try{console.info("updateQli() payload = ",j);let O=await window.salesforceConnector.updateQli(JSON.stringify(j));return O=bt(O),S(!1),O}catch(O){e.handleError(O.message),console.info("[ERROR]: updateQli() error = ",O)}}async function V(j){try{let O=await window.salesforceConnector.deleteQLI(j);return O=bt(O),S(),O}catch(O){e.handleError(O.message),console.info("[ERROR]: deleteQLI() error = ",O)}}async function K(j,O){try{u.value=!0;const P={fields:j};O&&(P.objectName=O),j.includes("xx_ord1__qty__c")&&O==="xx_ord1__ecatalog_item__c"&&(P.fields=P.fields.filter(Z=>Z!=="xx_ord1__qty__c")),j.includes("xx_ord1__sales_price__c")&&O!=="xx_ord1__quote_line_item__c"&&(P.fields=P.fields.filter(Z=>Z!=="xx_ord1__sales_price__c"));let M=await window.salesforceConnector.getFieldsData(JSON.stringify(P));return typeof M=="string"&&(M=JSON.parse(M)),M!=null&&M.errorMessage?(e.handleError(M.errorMessage),null):(f.value={...f.value,...M},console.info("fieldsData.value = ",JSON.stringify(f.value)),M)}catch(P){return e.handleError("Failed to get Fields Data. Please try again."),console.info("[ERROR]: getFieldsData() error = ",P),null}finally{u.value=!1}}function W(j=""){var O;return!j||j.includes(".")?!1:j.includes("xx_ord1__qty__c")?!0:((O=f.value[j])==null?void 0:O.isEditable)||!1}function te(){fe(t5)}async function fe(j){var O,P,M,Z,Q,B,U,D,q;if(j.payload){if((O=j.payload)!=null&&O.uiModification){const $=j.payload.uiModification;if(((P=$.addColumn)==null?void 0:P.length)>0)if($.addColumn.forEach(H=>{H.columns.forEach(J=>{J.field=J.field.toLowerCase()})}),$.addColumn[0].sectionName==="all_section")for(const[H,J]of c.value)J.columns=[...J.columns,...$.addColumn[0].columns];else $.addColumn.forEach(H=>{c.value.get(H.tableId)&&(c.value.get(H.tableId).columns=[...c.value.get(H.tableId).columns,...H.columns])});if(((M=$.removeColumn)==null?void 0:M.length)>0)if($.removeColumn.forEach(H=>{H.columns=H.columns.map(J=>J.toLowerCase())}),$.removeColumn[0].sectionName==="all_section")for(const[H,J]of c.value)J.columns=J.columns.filter(R=>!$.removeColumn[0].columns.includes(R.field));else $.removeColumn.forEach(H=>{c.value.get(H.tableId)&&(c.value.get(H.tableId).columns=c.value.get(H.tableId).columns.filter(J=>!H.columns.includes(J.field)))});if(((Z=$.filter)==null?void 0:Z.length)>0)if($.filter[0].sectionName==="all_section")for(const[H,J]of c.value)J.filters=[...J.filters,...$.filter[0].filters];else $.filter.forEach(H=>{c.value.get(H.tableId)&&(c.value.get(H.tableId).filters=[...c.value.get(H.tableId).filters,...H.filters])});if(((Q=$.groupBy)==null?void 0:Q.length)>0){const H=((B=[...c.value.values()][0])==null?void 0:B.columns)||n5;c.value.clear(),t.cartItemColumnsMap={},$.groupBy.forEach(J=>{t.cartItemColumnsMap[J.tableId]=J.columns||H,c.value.set(J.tableId,{loading:!0,lineItems:[],parentQLIs:[],columns:J.columns||H,tableId:J.tableId,sectionName:J.sectionName,selected:new Map,footer:y(J.footer),filters:J.filters,primarysort:J.primarysort,primarysortdesc:J.primarysortdesc})})}$.showOptions!==void 0&&(g.value=$.showOptions)}if(((D=(U=j.payload)==null?void 0:U.sections)==null?void 0:D.length)>0){const $=(q=j.payload)==null?void 0:q.sections;c.value.clear(),$.forEach(H=>{H.tableId||(H.tableId=ar()),H.selected=new Map,c.value.set(H.tableId,H)}),S()}}j.actionFunction==="Reload"&&(S(),console.info("Reloading quote line items"))}async function ee(j){var O,P;try{const M=new Set;for(const Z of c.value.keys())(O=c.value.get(Z).lineItems)==null||O.forEach(B=>{B.attributes=null,M.add(B.id)});if(j){const Z={lineItemIds:[...M]},Q=await window.productManagerController.getLineItemAttributes({request:JSON.stringify(Z)}),B=JSON.parse(Q.data);for(const U of c.value.keys())(P=c.value.get(U).lineItems)==null||P.forEach(q=>{q.attributes=B[q.id]||null})}}catch(M){console.info("[ERROR]: fetchAttributesData() error = ",M)}}return{showAttributes:p,quoteId:r,quoteName:i,templateId:a,templateOptions:s,loading:l,currentTemplateData:h,fieldsData:f,fieldsDataLoading:u,showOptionHeaderButton:m,sectionDataMap:c,promptSuggestions:d,lineItemsCount:o,addColumns:te,getQuoteEPageLayout:A,getPayload:v,getPrimaryQuote:_,fetchTemplates:C,getFilteredListWithFields:I,getQuoteLineItemsWithFilteredTable:E,updateQli:L,getFieldsData:K,deleteQLI:V,performAIAction:fe,isEditableField:W,fetchQuoteLineItems:k,fetchAllQuoteLineItems:S,fetchAttributesData:ee}}),r5=Mt("quickSelection",()=>{const e=sn(),t=sr(),n=Nn(),r=ae(null),i=ae(!1),o=ae([]),a=ae([]),s=ae(!1),l=ae({}),h=ae({rowLimit:10,paging:!0,offset:0,currentPage:1,totalPages:1}),c=ae(!1);async function f(){i.value=!0;try{const w=JSON.stringify({layoutType:"Quick Selection",layoutObject:"xx_ord1__ecatalog_item__c",...t.objectType?{contextObject:t.objectType}:{}});let A={};A=await window.salesforceConnector.getDynamicPageLayout(w),r.value=Oc(A,"Unable to find the Quick Selection Layout for your user profile"),console.info("quickSelectionLayout.value = ",r.value),h.value.rowLimit=r.value.configuration.rowLimit||10,r.value.data.columns.forEach(I=>{!I.field&&I.label==="QTY"&&(I.field="xx_ord1__qty__c")}),i.value=!1}catch(w){i.value=!1,e.handleError("Failed to get Page structure data. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",w)}}function u(){const w=new Map;return r.value.data.columns.forEach(A=>{w.set(A.field,!0)}),r.value.data.searchResultColumns.forEach(A=>{w.set(A.field,!0)}),Array.from(w.keys())}async function g(w){var A,I;try{let S=await window.salesforceConnector.saveCompetitorSKU(w);if(S!=null&&S.errorMessage){e.handleError(S.errorMessage);return}if((A=S[0])!=null&&A.errorMessage){e.handleError((I=S[0])==null?void 0:I.errorMessage);return}return S}catch(S){e.handleError("Failed to Match Item. Please try again."),console.info("[ERROR]: saveCompetitorSKU() error = ",S)}}async function p(w="",A=[]){try{let I=r.value.data,S=r.value.configuration;const N=w.trim();if(console.info("searchTextValue.trim() = ",w.trim()),!N)return[];let T=null;console.info("useMappings = ",c.value),c.value?T=Q0(m()):T=m(),console.info("fields before filter = ",T),T=T.filter(V=>V!=="xx_ord1__qty__c"),console.info("fields after filter = ",T);const k={fields:T,...A.length?{dynamicFilters:n.getDynamicFilters(A)}:{},searchText:N,accountId:t.accountId,...t.eCatalogId?{catalogId:t.eCatalogId}:{},...t.objectType==="opportunity"?{opportunityId:t.id}:{},...I!=null&&I.sort?{primarySortBy:I.sort.primary.field,primarySortOrder:I.sort.primary.direction,secondarySortBy:I.sort.secondary.field,secondarySortOrder:I.sort.secondary.direction}:{},rowLimt:(S==null?void 0:S.rowLimit)||20,paging:(S==null?void 0:S.paging)||!1,...h.value.offset!==0?{offset:h.value.offset}:{},objectName:I.objectName,currencyCode:t.currencyCode};console.info("getQuickSelectionItems payload = ",JSON.stringify(k));const E=await window.salesforceConnector.getItems(JSON.stringify(k));if(console.info("getQuickSelectionItems Res = ",JSON.stringify(E)),E!=null&&E.errorMessage){e.handleError(E.errorMessage);return}return E!=null&&E.itemCount&&(h.value.totalPages=Math.ceil((E==null?void 0:E.itemCount)/h.value.rowLimit)),Fi(E.lstItems,{xx_ord1__qty__c:"1"})}catch(I){e.handleError("Failed to fetch Results. Please try again."),console.info("[ERROR]: getQuickSelectionItems() error = ",I)}}function m(){let w=[];for(const A of r.value.data.columns){let I=A.field;if(I!=null&&I.includes(".")){w.includes(I)||w.push(I);let N=I.split(".")[0];N=N.slice(0,-1)+"c",w.includes(N)||w.push(N)}else w.includes(I)||w.push(I)}return console.info("getAllQuickSelectionFields() fields = ",w),w.filter(A=>A.toLowerCase()!=="xx_ord1__qty__c")}async function d(w,A,I,S){console.info("searchText:",JSON.stringify(w)),console.info("row:",JSON.stringify(A)),console.info("rowIndex:",JSON.stringify(I)),console.info("column:",JSON.stringify(S));const N=I+(h.value.currentPage-1)*h.value.rowLimit;if(S.field.toLowerCase().includes("xx_ord1__item__r")){if(o.value[N].itemLookupLoading=!0,c.value=!0,a.value=await p(w),a.value.length>0){const T=[];for(let k=0;k<a.value.length;k++)o.value[N].itemDataRetrieved=!0,a.value[k].xx_ord1__item__c&&T.push({name:a.value[k]["xx_ord1__item__r.name"],value:a.value[k].xx_ord1__item__c,label:a.value[k][S.field.toLowerCase()]});o.value[N][S.field.toLowerCase()+"_options"]=T}o.value[N].itemLookupLoading=!1}else if(S.field.toLowerCase().includes("xx_ord1__competitor_item__r")){o.value[N].competitorLookupLoading=!0;const T=await v(w);T!=null&&T.items&&(o.value[N][S.field.toLowerCase()+"_options"]=T.items.map(k=>({name:k.fields[2].value,value:k.fields[1].value,label:k.fields[0].value}))),o.value[N].competitorLookupLoading=!1,console.info("getLookupData:: Search Lookup Handler Response = ",T)}}async function v(w){var I,S;console.info("getLookupData() searchText = ",w);const A={searchText:w,obj:"xx_ord1__competitor_item__c",filters:null,displayFields:["xx_ord1__sku__c"]};try{let N=await window.salesforceConnector.getLookupData(JSON.stringify(A));if(typeof N=="string"&&(N=JSON.parse(N)),N!=null&&N.errorMessage){e.handleError(N.errorMessage);return}if((I=N[0])!=null&&I.errorMessage){e.handleError((S=N[0])==null?void 0:S.errorMessage);return}return N}catch(N){e.handleError("Failed to Search For Item. Please try again."),console.info("[ERROR]: getLookupData() error = ",N)}}async function _(w,A){var S;console.info("Update Other Fields Value = ",w),console.info("Update Other Fields Row Index = ",A);const I=A+(h.value.currentPage-1)*h.value.rowLimit;console.info("actualRowIndex = ",I);try{if(w){const N=a.value.filter(T=>T.xx_ord1__item__c===w)[0];if(N){s.value=!0;const T=r.value.data.columns[1].field;o.value[I][T]&&await C(N,I),(S=o.value[I])!=null&&S.itemDataRetrieved&&(o.value[I].status="New Match Requested",o.value[I].noMatchCleared=!0),Object.keys(N).forEach(k=>{const E=Nc[k.toLowerCase()];console.info("Mapped Key = ",E),E&&(o.value[I][E]=N[k])}),s.value=!1}else o.value[I].status=""}else o.value[I].status="No Match"}catch(N){e.handleError("Unable to request a match for this item please try again."),console.info("Error in updateOtherFields = ",N)}}async function C(w,A){const I=o.value[A],S=r.value.data.columns[1].field,N=[{sku:I[S],name:I[S],productDescription:I.xx_ord1__line_description__c||"",productURL:null,status:"Match Requested",competitorAccountId:null,itemId:w.xx_ord1__item__c}];let T=await g(JSON.stringify(N));console.info("Match Item: ",JSON.stringify(T)),o.value[A][`${S}_options`]=[{value:T[0].competitorItemId,label:T[0].sku}],o.value[A][S]=T[0].competitorItemId}async function y(w){try{let A=await window.salesforceConnector.createQLI(JSON.stringify(w));typeof A=="string"&&(A=JSON.parse(A));let I=!1;if((A==null?void 0:A.length)>0)for(let S=0;S<A.length;S++)A[S].errorMessage&&(I=!0,A[S].errorMessage.includes("Line Description: data value too large")&&(A[S].errorMessage="Error: The description is too long—it must be under 200 characters."));if(I){A.forEach(S=>{l.value[S.eCatalogItemId]=S});return}else l.value=[];return A}catch(A){e.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addAllItemsToQuote() error = ",A)}}return{quickSelectionLayout:r,quickSelectionLayoutLoading:i,processedRecords:o,useMappings:c,currentSearchData:a,createQliErrors:l,getQuickSelectionLayout:f,getAllFieldsForQuickSelectionLayout:u,saveCompetitorSKU:g,getQuickSelectionItems:p,searchLookupHandler:d,updateOtherFields:_,addAllItemsToQuote:y}}),i5="Preparing Your Quote Please Wait...",o5={message:"Your quote is ready! Begin adding products to complete it.",type:"response",requestId:"no-request-id"},a5=18e4,zi=Mt("ai",()=>{const e=sr(),t=Nn(),n=Pc(),r=r5(),i=ln(),o=xa(),a=ae(""),s=ae(""),l=ae([]),h=ae(""),c=ae([]),f=ae(!1),u=ae(null),g=Hi(),p=ae({}),m=ae(null),d=ae(null),v=ae(null),_=ae(null),C=ae(null),y=ae(i5),w=ae([]),A=be(()=>e.orgId+"__"+e.user.Id+"__"+t.quoteId),I=be(()=>u.value.readyState==WebSocket.OPEN),S=()=>{p.value={salesforceOrgId:e.orgId,salesforceOrgType:e.orgType,salesforceUserId:e.user.Id,userType:"Salesforce",chatRoomId:A.value,requestId:"",prompt:"",initiatedFrom:e.origin||"Quote",internalCall:!1,contextObjectId:t.quoteId,contextObjectType:"Quote",payload:{lineItemsCount:t.lineItemsCount},origin:"Genesis AI",defaultBatchSize:10,actionType:"",packageVersion:e.packageVersion,relatedIds:{eCatalogId:e.eCatalogId,accountId:e.accountId}}};async function N(){const q=s.value+"?chatRoomId="+A.value;u.value=new WebSocket(q),u.value.addEventListener("open",T),u.value.addEventListener("message",L),u.value.addEventListener("close",k),u.value.addEventListener("error",E)}const T=()=>{V(),te()},k=()=>{K()},E=()=>{Z(),K()},L=q=>{var H,J;V();const $=JSON.parse(q.data);if($.status!=="ALIVE"){if($.loading){y.value=$.message;return}else Array.isArray($.messages)?(y.value=null,l.value.push(o5),$.messages.length>0&&O($.messages)):$.agentResponse&&($.errorMessage&&($.agentResponse.content=$.errorMessage,$.agentResponse.error=!0),y.value=null,l.value.push({message:$.agentResponse.content,type:$.agentResponse.role,requestId:$.requestId,epoch:$.agentResponse.epoch,error:$.agentResponse.error,isDML:$.agentResponse.isDML,...(H=$.agentResponse)!=null&&H.filesData?{filesData:(J=$.agentResponse)==null?void 0:J.filesData}:{}}));w.value=$.links||[],B($)}},V=()=>{K(),m.value=setTimeout(()=>{if(I.value){const q={action:"heartbeat"};u.value.send(JSON.stringify(q)),V()}},a5)},K=()=>{m.value&&(clearInterval(m.value),m.value=null)};function W(q){const $={...p.value};$.requestType="Action",$.actionType="Undo",$.undoRequestId=q,$.requestId=ar(),j($)}function te(){const q={...p.value};q.requestType="Action",q.actionType="History",q.requestId=ar(),j(q)}function fe(q){return o.path.startsWith("/configurator")&&i.isChangedConfiguration?(_.value={save:()=>{i.maintainQuoteConfiguration()}},a.value=q,!0):(a.value="",!1)}function ee(q,$=!0,H=null){if(!fe(q)&&q.trim()){let J={...p.value};J.prompt=q.trim(),J.requestType="Chat",J.requestId=ar(),J.internalCall=!1,J.payload=P(),J.componentName=M.value,J.templateId=t.templateId,J.payload.lineItemsCount=t.lineItemsCount,H&&(J={...J,...H}),Q(),$&&l.value.push({message:q.trim(),type:"user",...C.value&&{fileData:[C.value]},requestId:J.requestId}),j(J),V()}}function j(q){const $={action:"prompt",data:q};u.value.send(JSON.stringify($))}const O=q=>{const $=q.filter(({content:H})=>!!H).map(H=>({message:H.content,type:H.role,requestId:H.requestId,epoch:H.epoch,isDML:H.isDML,undone:H.undone}));$.forEach((H,J)=>{H.isDML===!0&&J!==$.length-1&&(H.isDML=!1)}),l.value=[...l.value,...$]};function P(){return o.path==="/quote-item"?t.getPayload():{}}const M=be(()=>o.path==="/quote-item"?"QuoteItem":""),Z=()=>{l.value.push({type:"response",message:"Oops! Something went wrong while processing your request. Please try again later.",error:!0})},Q=()=>{l.value=l.value.map(q=>({...q,links:[]}))};function B(q){var J,R,z;const $=((J=q==null?void 0:q.redirectObjects)==null?void 0:J.componentName)||(q==null?void 0:q.componentName),H=(q==null?void 0:q.redirectObjects)||{};if($==="AdaptiveSearch"){const oe=(R=q==null?void 0:q.payload)==null?void 0:R.searchTerm,ce=(z=q==null?void 0:q.payload)==null?void 0:z.applyFilters;oe&&oe!==n.searchText&&n.initAdaptiveSearch({searchTerm:oe,filters:ce}),g.push("/adaptive-search")}else $==="Configurator"?g.push(`/configurator/${H.itemId}/${H.qliId}`):$==="QuoteReview"?g.push("/quote-item"):$==="QuoteItem"||$==="QuoteList"?(g.push("/quote-item"),t.performAIAction(q)):$==="QuickSelection"&&(r.quickSelectionLayout=q.payload,console.info("Loading QuickSelection data = ",JSON.stringify(r.quickSelectionLayout)),g.push("/match-records"))}function U(){if(I.value){const q={action:"cancel",data:{requestId:p.value.requestId,chatRoomId:A.value}};u.value.send(JSON.stringify(q))}}const D=()=>{d.value&&(clearInterval(d.value),d.value=null),m.value&&(clearInterval(m.value),m.value=null),v.value&&(clearTimeout(v.value),v.value=null)};return Oi(()=>{D()}),{unsavedChanges:_,loadingMessage:y,promptMessage:a,buttonLinks:w,websocketUrl:s,chatHistory:l,latestDMLRequest:h,strikethroughHistory:c,attachmentData:C,dataManuallyChanged:f,undoAction:W,connectSocket:N,sendMessage:ee,setInitialPayload:S,cancelRequest:U}}),sr=Mt("root",()=>{const e=zi(),t=sn(),n=Nn(),r=ae(""),i=ae(""),o=ae("Genesis AI"),a=ae(""),s=ae({}),l=ae(""),h=ae(""),c=ae(""),f=ae(""),u=ae({}),g=ae(""),p=ae(""),m=ae(""),d=ae(""),v=ae(""),_=ae(""),C=ae(""),y=ae("Single"),w=ae("closed"),A=be(()=>n.quoteName),I=be(()=>y.value==="Single");async function S(E){r.value=E||kc("id"),i.value=kc("origin"),await T(),await N()}async function N(){try{console.info("getRecordInfo",r.value);let E=await window.salesforceConnector.getRecordInfo(r.value);return E=bt(E),E!==void 0&&(u.value=E,g.value=E.name,p.value=E.objectType,m.value=E.accountId,d.value=E.eCatalogId,v.value=E.currencyCode,_.value=E.userLocale,C.value=E.opportunityId),(E==null?void 0:E.objectType)==="XX_ORD1__Quote__c"?(n.quoteId=E==null?void 0:E.recordId,n.templateId=E==null?void 0:E.templateId,n.quoteName=E==null?void 0:E.name,n.lineItemsCount=(E==null?void 0:E.lineItemsCount)||0):(E==null?void 0:E.objectType)==="Opportunity"&&await n.getPrimaryQuote(E.recordId),E}catch(E){t.handleError(E.message)}}async function T(){var L,V;console.info("getOrgInformation",r.value);const E=await window.salesforceConnector.getOrgInformation();e.websocketUrl=E.websocketUrl,a.value=(L=E.locale)==null?void 0:L.replace("_","-"),s.value=E.user,l.value=E.orgName,h.value=E.orgId,c.value=E.orgType,f.value=E.packageVersion,y.value=(V=E==null?void 0:E.pricingSchema)==null?void 0:V.toLowerCase()}function k(E){o.value=E,l0(E)}return{id:r,origin:i,title:A,subTitle:o,locale:a,user:s,orgName:l,orgId:h,orgType:c,packageVersion:f,objectType:p,recordInfo:u,name:g,accountId:m,eCatalogId:d,currencyCode:v,userLocale:_,opportunityId:C,pricingSchema:y,isSinglePricingSchema:I,flyoutState:w,start:S,getRecordInfo:N,setSubTitle:k}}),s5="https://api-svc.blink.expedite1.com/api/product-pricing/evaluateConfigurationSelection",l5={productJSON:{productItem:{configRules:[{publishKey:"rule-a1",name:"If latest is optA include optB",priority:1,enforceRule:!0,ruleJson:'{"latestSelected":"optA","actionType":"include","affectedOptions":["optB"]}'}]}},currentConfig:{product:{publishKey:"prod-1",attributes:[]},options:[]},selected:{publishKey:"optA",attributes:[]}};async function c5(e=l5){const t=s5;try{const n=await fetch(t,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error(`HTTP error! status: ${n.status} ${n.statusText}`);return await n.json()}catch(n){throw console.info("Error fetching data with Fetch API:",n),n}}function u5(e){const t=n=>Math.min(...n.options.map(r=>r.relationshipInfo.primarySortOrder));return e.forEach(n=>{n.itemTypes.forEach(r=>{r.options.sort((i,o)=>i.relationshipInfo.primarySortOrder-o.relationshipInfo.primarySortOrder||i.itemName.localeCompare(o.itemName))}),n.itemTypes.sort((r,i)=>t(r)-t(i)||r.itemTypeName.localeCompare(i.itemTypeName))}),e.sort((n,r)=>{const i=Math.min(...n.itemTypes.map(t)),o=Math.min(...r.itemTypes.map(t));return i-o||n.category.localeCompare(r.category)}),e}const f5=(e,t)=>{const n=(r,i)=>typeof i=="function"?void 0:i;return JSON.stringify(e,n)===JSON.stringify(t,n)},ln=Mt("configurator-main",()=>{const e=xa(),t=sr(),n=Nn(),r=sn(),i=Hi(),o=ae(null),a=ae(null),s=ae(null),l=ae(null),h=ae([]),c=ae(null),f=ae(null),u=ae(new Map),g=ae(!1),p=ae({configuration:!1,lineItem:!1,productOptionsPricing:!1,bestOfferPrice:!1,lineItemAttributes:!1,save:!1}),m=ae(!1),d=be(()=>v.value&&!t.isSinglePricingSchema),v=be(()=>{let D=!0,q=!0,$=!0,H=null;for(const J of s.value.categoryOptions)for(const R of J.itemTypes)for(const z of R.options)z.billingPeriod&&(H&&H!==z.billingPeriod&&($=!1),H=z.billingPeriod,!z.yrcPrice&&z.billingPeriod==="Monthly"&&(D=!1),!z.mrcPrice&&z.billingPeriod==="Yearly"&&(q=!1));return D&&q&&$}),_=be(()=>!f5(s.value,l.value)),C=be(()=>{const D=s.value.categoryOptions;return D.forEach(q=>{q.itemTypes.forEach($=>{$.selectedOptions=$.options.filter(H=>$.selected.includes(H.itemId)),$.totalPrice=function(){return $.selectedOptions.reduce((H,J)=>H+J.price*J.qty,0)||0},$.oneTimePrice=function(){return $.selectedOptions.filter(H=>!H.billingPeriod).reduce((H,J)=>H+J.price*J.qty,0)||0},$.recurringPrice=function(){return $.selectedOptions.filter(H=>H.billingPeriod).reduce((H,J)=>H+J.price*J.qty,0)||0}}),q.selectedItemTypes=q.itemTypes.filter($=>$.selected.length>0),q.totalPrice=function(){return q.itemTypes.reduce(($,H)=>$+H.totalPrice(),0)},q.oneTimePrice=function(){return q.itemTypes.reduce(($,H)=>$+H.oneTimePrice(),0)},q.recurringPrice=function(){return q.itemTypes.reduce(($,H)=>$+H.recurringPrice(),0)}}),D.filter(q=>q.itemTypes.filter($=>$.selected.length>0).length>0)}),y=be(()=>C.value.reduce((D,q)=>D+q.totalPrice(),0)),w=be(()=>{const D=C.value.reduce((H,J)=>H+J.totalPrice(),0);let q=C.value.reduce((H,J)=>H+J.oneTimePrice(),0),$=C.value.reduce((H,J)=>H+J.recurringPrice(),0);return s.value.billingPeriod?$=($+s.value.price)*s.value.qty:q=(q+s.value.price)*s.value.qty,{basePrice:s.value.price,addOns:D,oneTimePrice:q,recurringPrice:$,total:s.value.price*s.value.qty+D*s.value.qty+q+$}}),A=be(()=>{const D=new Map;return D.set(c.value.productLineItem.XX_ORD1__Item__c,c.value.productLineItem),c.value.options.forEach(q=>{D.set(q.XX_ORD1__Item__c,q)}),D}),I=be(()=>{const D=new Map;return s.value.categoryOptions.forEach(q=>{q.itemTypes.forEach($=>{$.options.forEach(H=>{D.set(H.relationshipInfo.publishKey,H)})})}),D}),S=be(()=>{const D=new Map;return D.set(f.value.product.XX_ORD1__Item__c,f.value.product),f.value.options.forEach(q=>{D.set(q.XX_ORD1__Item__c,q)}),D});function N(D){s.value.qliId&&(s.value.qliBillingPeriod==="Monthly"&&!D?s.value.price=s.value.qliSalesPrice||s.value.qliMrcPrice:s.value.qliBillingPeriod==="Yearly"&&D&&(s.value.price=s.value.qliSalesPrice)),s.value.categoryOptions.forEach(q=>{q.itemTypes.forEach($=>{$.options.forEach(H=>{H.billingPeriod&&(H.price=(D?H.yrcPrice.offerPrice:H.mrcPrice.offerPrice)||H.price,H.qliId&&(H.qliBillingPeriod==="Monthly"&&!D?H.price=H.qliSalesPrice||H.qliMrcPrice:H.qliBillingPeriod==="Yearly"&&D&&(H.price=H.qliSalesPrice)))})})})}function T(){s.value=null,l.value=null,h.value=[],c.value=null,f.value=null,u.value=new Map,g.value=!1,p.value.configuration=!1,p.value.lineItem=!1,p.value.productOptionsPricing=!1,p.value.bestOfferPrice=!1,p.value.lineItemAttributes=!1,p.value.save=!1}async function k(D,q){T(),o.value=D||e.params.itemId,a.value=q||e.params.qliId,console.info("initConfigurator",o.value,a.value,n.quoteId);const $=await E();await te(),await fe(),s.value=V($);const H=await j();L(H),await W();let J=!1;for(const R of c.value.options)R.XX_ORD1__Billing_Period__c==="Yearly"&&(J=!0);J&&(m.value=!0,N(!0)),l.value=JSON.parse(JSON.stringify(s.value))}async function E(){try{console.info("itemId",o.value);const D=await window.productManagerController.getProductConfiguration({itemId:o.value});console.info("getProductConfiguration:result",D);const q=JSON.parse(D.data).productItem;return q.categoryOptions=u5(q.categoryOptions),q}catch(D){return console.info("error",D.message),!1}}function L(D){const q=new Map;q.set(f.value.product.Id,f.value.product.XX_ORD1__Item__c),f.value.options.forEach(H=>{q.set(H.Id,H.XX_ORD1__Item__c)});const $=new Map;if(D.forEach(H=>{const J={};H.pricingTypes.forEach(R=>{R.appliedOnField==="Catalog Price"?J.catalogPrice=R:R.appliedOnField==="MRC"?J.mrcPrice=R:R.appliedOnField==="YRC"&&(J.yrcPrice=R)}),J.billingPeriod=H.billingPeriod,J.mrcPrice&&!t.isSinglePricingSchema?J.price=J.mrcPrice.offerPrice:J.catalogPrice&&t.isSinglePricingSchema&&(J.price=J.catalogPrice.offerPrice),J.offer={offerDiscount:H.offerDiscount,offerId:H.offerId,offerType:H.offerType},$.set(q.get(H.eCatalogItemId),J)}),$.has(s.value.itemId)){const H=$.get(s.value.itemId),J=s.value.price;Object.assign(s.value,H),s.value.qliId&&(s.value.price=J)}s.value.categoryOptions.forEach(H=>{H.itemTypes.forEach(J=>{J.options.forEach(R=>{if($.has(R.itemId)){const z=$.get(R.itemId),oe=R.price;Object.assign(R,z),R.qliId&&(R.price=oe)}})})})}function V(D){D.isAttributes=D.attributes&&D.attributes.length>0,u.value.set(a.value,D.attributes),h.value=D.configRules;const q=new Set;return h.value.forEach($=>{const H=JSON.parse($.ruleJson);H.optionSelected.forEach(J=>{q.add(J)}),H.affectedOptions.forEach(J=>{q.add(J)})}),K(D),D.categoryOptions.forEach($=>{$.key=$.category.toLowerCase().replace(/\s+/g,"-").replace(/[&]/g,""),$.itemTypes.forEach(H=>{H.selected=[],H.options=H.options.filter(J=>S.value.has(J.itemId)),H.numberOfColumns||(H.numberOfColumns=1),H.numberOfColumns>1&&(H.lightboxAttributes=!0),H.maxNumber||(H.maxNumber=100),H.minNumber||(H.minNumber=0),H.maxQuantity||(H.maxQuantity=1e4),H.minQuantity||(H.minQuantity=1),H.maxNumber===1?(H.isRadio=!0,H.minMessage="Please select 1 option",H.maxMessage="",H.isKit=H.options.some(J=>J.relationshipInfo.relationship==="Kit")):(H.minMessage=`Minimum of ${H.minNumber} selection${H.minNumber!==1?"s":""} required`,H.maxMessage=`Maximum of ${H.maxNumber} selection${H.maxNumber!==1?"s":""} allowed`),H.options.forEach(J=>{$.showImage=$.showImage||!!J.defaultImageURL,J.showAttributesModal=!1,J.calculateRules=q.has(J.relationshipInfo.publishKey),J.qty=H.minQuantity||1,J.getTags=()=>(J.attributes=J.attributes||[],J.attributes.filter(R=>R.value!==null&&R.value!=="").map(R=>({label:R.label,value:R.value}))),Object.defineProperty(J,"isDisabled",{get:function(){return J.relationshipInfo.relationship==="Kit"||(H.isRadio?H.isKit:!H.selected.includes(J.itemId)&&H.maxNumber===H.selected.length)}}),K(J),(A.value.has(J.itemId)||J.relationshipInfo.relationship==="Kit")&&H.selected.push(J.itemId)})})}),D}function K(D){D.isAttributes=D.attributes&&D.attributes.length>0;const q=S.value.get(D.itemId);if(A.value.has(D.itemId)){const $=A.value.get(D.itemId);D.qliId=$.Id,D.qty=$.XX_ORD1__QTY__c,D.itemName=$.XX_ORD1__Line_Description__c,D.billingPeriod=$.XX_ORD1__Billing_Period__c,D.price=$.XX_ORD1__Sales_Price__c,D.billingPeriod?D.price=$.XX_ORD1__Sales_Price__c||$.XX_ORD1__MRC__c:D.price=$.XX_ORD1__NRC__c||$.XX_ORD1__Sales_Price__c,D.qliSalesPrice=$.XX_ORD1__Sales_Price__c,D.qliNrcPrice=$.XX_ORD1__NRC__c,D.qliMrcPrice=$.XX_ORD1__MRC__c,D.qliBillingPeriod=$.XX_ORD1__Billing_Period__c,u.value.set(D.qliId,D.attributes)}else D.itemName=q.XX_ORD1__Line_Description__c||D.itemName,D.price=q.XX_ORD1__Negotiated_Price__c||q.XX_ORD1__NRC_for_New__c,D.nrcPrice=q.XX_ORD1__NRC_for_New__c}async function W(){console.info("getLineItemAttributes"),p.value.lineItemAttributes=!0;const q={lineItemIds:[c.value.productLineItem.Id,...c.value.options.map(J=>J.Id)]},$=await window.productManagerController.getLineItemAttributes({request:JSON.stringify(q)});console.info("getLineItemAttributes:result",$);const H=JSON.parse($.data);for(const[J,R]of Object.entries(H))if(u.value.has(J)){const z=u.value.get(J),oe=new Map;R==null||R.forEach(ce=>{oe.set(ce.apiName,ce)}),z==null||z.forEach(ce=>{oe.get(ce.apiName)&&(ce.value=oe.get(ce.apiName).value||"",ce.dataType==="REFERENCE"&&(ce.referenceRecordId=oe.get(ce.apiName).referenceRecordId||"",ce.referenceRecordId?ce.options=[{Name:ce.value||"",Id:ce.referenceRecordId}]:ce.options=[]))})}p.value.lineItemAttributes=!1}async function te(){p.value.lineItem=!0,console.info("getLineItems",n.quoteId,a.value);try{const D={objectId:n.quoteId,filters:{},additionalFields:["Name","XX_ORD1__Line_Description__c"],primarySort:{field:"CreatedDate",direction:"DESC"},productPage:{recordLimit:200,offset:0,productLineItemId:a.value}},q=await window.productManagerController.getLineItems({request:JSON.stringify(D)});return console.info("getLineItems:result",q),c.value=JSON.parse(q.data).products[0],console.info("result",q),p.value.lineItem=!1,q}catch(D){return console.info("error",D.message),p.value.lineItem=!1,!1}}async function fe(){p.value.productOptionsPricing=!0,console.info("getProductOptionsPricing");try{const D={objectId:n.quoteId,itemId:o.value},q=await window.productManagerController.getProductOptionsPricing({request:JSON.stringify(D)});return console.info("getProductOptionsPricing:result",q),f.value=JSON.parse(q.data),p.value.productOptionsPricing=!1,f.value}catch(D){return console.info("error",D.message),p.value.productOptionsPricing=!1,!1}}async function ee(D){console.info("getRecords");try{const q=await window.productManagerController.getRecords({request:JSON.stringify(D)});return console.info("getRecords:result",q),JSON.parse(q.data)}catch(q){return console.info("error",q.message),!1}}async function j(){p.value.bestOfferPrice=!0,console.info("getBestOfferPrice");const D=[f.value.product.Id];f.value.options.forEach(q=>{D.push(q.Id)});try{const q=await O(D);return p.value.bestOfferPrice=!1,q}catch(q){return console.info("error",q.message),p.value.bestOfferPrice=!1,!1}}async function O(D){const q={accountId:t.accountId,eCatalogItemIds:D,pricePreference:"Heighest Priority"},$=await window.productManagerController.calculateBestOfferPrice({request:JSON.stringify(q)});return console.info("calculateBestOfferPrice:result",$),p.value.bestOfferPrice=!1,JSON.parse($.data)}async function P(){g.value=!0,p.value.save=!0,console.info("maintainQuoteConfiguration");const D=[],q=[];s.value.categoryOptions.forEach(J=>{J.itemTypes.forEach(R=>{R.options.forEach(z=>{R.selected.includes(z.itemId)?D.push(M(z)):z.qliId&&q.push(z.qliId)})})});const $={objectId:n.quoteId,eCatalogId:t.eCatalogId,isGenesisAI:!0,blinkUser:!1,optionsToRemove:q,grandFatheredOptionsToRemove:[],productLineItem:{...M(s.value),optionLineItems:D}};console.info("maintainQuoteConfiguration:request",$);const H=await window.productManagerController.maintainQuoteConfiguration({request:JSON.stringify($)});if(console.info("maintainQuoteConfiguration:result",H),H!=null&&H.error){const J={title:"Unable to Save Configuration",description:H.error,button:{label:"Back to Configuration",action:()=>{g.value=!1}},cancel:{label:"Quote List",action:()=>{i.push("/quote-item?id="+n.quoteId)}}};r.errorPopup=J}else l.value=JSON.parse(JSON.stringify(s.value)),console.info("maintainQuoteConfiguration:result",H);p.value.save=!1}function M(D){const q={};D.isAttributes&&D.attributes.forEach(H=>{H.apiName.includes(".")||(H.dataType==="BOOLEAN"?q[H.apiName]=H.value?"true":"false":H.dataType==="REFERENCE"?q[H.apiName]=H.referenceRecordId:q[H.apiName]=H.value)});const $={attributes:q,itemId:D.itemId,lineItemId:D.qliId,lineDescription:D.itemName,qty:D.qty,billingPeriod:D.billingPeriod,...D.offer};return D.billingPeriod&&v.value&&!t.isSinglePricingSchema&&($.billingPeriod=m.value?"Yearly":"Monthly"),!t.isSinglePricingSchema&&!D.billingPeriod?$.nrcPrice=D.price:($.applyOnField="Catalog Price",$.salesPrice=D.price,$.nrcPrice=D.nrcPrice),$}async function Z(){const D={objectId:t.eCatalogId,productItemId:o.value};try{let q=await window.productManagerController.getProductCrossSells({request:JSON.stringify(D)});if(console.info("getProductCrossSells:result",q),q=q.data?JSON.parse(q.data):{},q.crossSells.length===0)return q;const $=q.crossSells.map(R=>R.Id),H=await O($),J=new Map;return H.forEach(R=>{J.set(R.eCatalogItemId,{...R,...R.pricingTypes[0]})}),q.crossSells.forEach(R=>{R.loading=!1,R.Name=R.XX_ORD1__Line_Description__c||R.XX_ORD1__Item__r.Name,R.Description=R.XX_ORD1__Item__r.XX_ORD1__Product_Description__c,J.has(R.Id)?(R.Price=J.get(R.Id).offerPrice,R.priceFormatted=J.get(R.Id).formattedOfferPrice,R.offer={offerDiscount:J.get(R.Id).offerDiscount,offerId:J.get(R.Id).offerId,offerType:J.get(R.Id).offerType}):(R.Price=R.XX_ORD1__List_Price2__c,R.priceFormatted=R.XX_ORD1__List_Price2__c,R.offer={offerDiscount:0,offerId:null,offerType:null})}),q}catch(q){return console.info("error",q.message),!1}}async function Q(D,q){var R,z;const $={product:{publishKey:s.value.publishKey,lineDescription:s.value.itemName},options:[]};s.value.categoryOptions.forEach(oe=>{oe.itemTypes.forEach(ce=>{ce.options.forEach(le=>{ce.selected.includes(le.itemId)&&$.options.push({publishKey:le.relationshipInfo.publishKey,lineDescription:le.itemName})})})}),console.info("evaluateConfigSelection:currentConfig.options",$.options);const H={productJSON:{productItem:{configRules:h.value}},currentConfig:$,selected:D?{publishKey:(R=D.relationshipInfo)==null?void 0:R.publishKey,attributes:D.attributes,lineDescription:D.itemName}:{},unselected:q?{publishKey:(z=q.relationshipInfo)==null?void 0:z.publishKey,attributes:q.attributes,lineDescription:q.itemName}:{}};return await c5(H)}async function B(){try{const D=["Name","XX_ORD1__Line_Description__c","XX_ORD1__Item__r.XX_ORD1__Product_Description__c","XX_ORD1__Sales_Price__c","XX_ORD1__SYS_Configuration_Status2__c"],$=(await n.getQuoteLineItemsWithFilteredTable({fields:D,recordId:n.quoteId,filters:[],includeOptions:!1,totalFields:[]})).lineItems;return console.info("fetchQuoteLineItems:res",$),$}catch(D){console.info("[ERROR]: fetchQuoteLineItems()123 error = ",D.message)}}async function U(D){const q={quoteId:n.quoteId,lstQLIRequest:[{eCatalogItemId:D.Id,quantity:1,offerApplicable:D.offer}]};try{const $=await window.productManagerController.createQuoteProducts({request:JSON.stringify(q)});console.info("getProductCrossSells:result",$)}catch($){return console.info("error",$.message),!1}}return{itemId:o,configuration:s,_configurationCopy:l,lineItem:c,savedScreen:g,loading:p,summary:C,addOns:y,summaryPrices:w,optionByItemId:A,attributesByQLIId:u,optionByPublishKey:I,showYearlyPricing:m,isYearlyPricingExist:v,isChangedConfiguration:_,isRecurringPricingSchema:d,changePricingScheme:N,createQuoteProducts:U,resetConfigurator:T,fetchQuoteLineItems:B,getRecords:ee,getProductCrossSells:Z,initConfigurator:k,maintainQuoteConfiguration:P,evaluateConfigSelection:Q}}),d5={class:"ect-p-4 ect-flex ect-gap-2 ect-items-center ect-justify-between ect-border-b ect-border-gray-200"},h5={class:"ect-flex ect-items-center ect-gap-3"},p5={class:"ect-text-xl ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},g5={key:0,class:"ect-flex ect-gap-1.5 ect-items-center"},m5=b("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Saving configuration...",-1),v5={key:1,class:"ect-flex ect-gap-1.5 ect-items-center"},y5=b("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Configuration Saved Successfully",-1),_5={key:1,class:"ect-flex ect-flex-col ect-gap-4 ect-flex-1 ect-overflow-y-auto ect-mb-16"},b5=b("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed ect-p-4 ect-pb-0"},"You may consider these products",-1),C5={class:"ect-flex ect-flex-col ect-gap-4 ect-p-4 ect-pt-0 ect-overflow-y-auto"},w5=["data-test-id"],x5={class:"ect-flex-1 ect-flex ect-flex-col ect-gap-2"},k5={class:"ect-text-sm ect-font-semibold ect-text-gray-800 ect-leading-tight"},E5={class:"ect-text-sm ect-font-medium ect-text-gray-600 ect-leading-relaxed ect-line-clamp-2"},O5={class:"ect-flex ect-flex-row ect-justify-between ect-items-center"},S5={class:"ect-text-sm ect-font-semibold ect-text-gray-800"},I5={key:2,class:"ect-flex ect-flex-col ect-gap-4 ect-m-4 ect-flex-1 ect-overflow-y-auto"},A5=b("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},"What do you want to do next?",-1),T5={class:"ect-flex ect-flex-col ect-gap-4"},N5=["data-test-id","onClick"],P5={class:"ect-flex ect-items-center ect-justify-center"},L5={class:"ect-flex ect-flex-col ect-items-center ect-gap-2 ect-w-full"},R5=["data-test-id"],M5=["data-test-id"],q5={key:3,class:"ect-bg-light-bg-x ect-border-t ect-border-gray-200 ect-flex-shrink-0 ect-sticky ect-bottom-0 ect-pb-4"},j5={class:"ect-flex ect-flex-col ect-gap-4"},D5={class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed ect-p-4 ect-pb-0"},B5={class:"ect-flex ect-flex-col ect-gap-4 ect-p-4 ect-pt-0 ect-overflow-y-auto"},$5={class:"ect-bg-white ect-border ect-border-gray-300 ect-rounded-md ect-p-3 ect-flex ect-flex-col","data-test-id":"configurator-recommend-card-next-product"},F5={class:"ect-flex-1 ect-flex ect-flex-col ect-gap-2"},V5={class:"ect-text-sm ect-font-semibold ect-text-gray-800 ect-leading-tight"},H5={class:"ect-text-sm ect-font-medium ect-text-gray-600 ect-leading-relaxed ect-line-clamp-2"},U5={class:"ect-flex ect-flex-row ect-justify-between ect-items-center"},z5={class:"ect-text-sm ect-font-semibold ect-text-gray-800"},K5={__name:"ConfiguratorRecommend",setup(e){const t=ln(),n=Nn(),r=Hi(),i=be(()=>t.configuration),o=ae(!0),a=ae(""),s=ae([{icon:"configuration",title:"Back to current Product Configuration",description:"Returns to the active product configuration page.",link:"/item/overview",action:"backToConfiguration"},{icon:"menu",title:"Back to Quote List Page",description:"Returns to the main quote list page.",link:"/quote-item",action:"backToQuoteList"}]),l=ae(null),h=ae([]),c=async p=>{p.loading=!0,await t.createQuoteProducts(p),p.disabled=!0,p.loading=!1},f=p=>{p.action==="backToConfiguration"?t.savedScreen=!1:p.action==="backToQuoteList"?r.push("/quote-item?id="+n.quoteId):p.link&&r.push(p.link)};async function u(){const p=await t.fetchQuoteLineItems();console.info("getQuoteLineItems1:_quoteLineItems",p);const m=p.filter(v=>v.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration").length;console.info("getQuoteLineItems2:needsConfigurationCount",m),a.value=`(${p.length-m}/${p.length})`;const d=p.find(v=>v.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration"&&v.Id!=t.qliId);return console.info("getQuoteLineItems3:result",d),l.value=d?{Name:d.XX_ORD1__Line_Description__c,Description:d.XX_ORD1__Item__r.XX_ORD1__Product_Description__c,Price:d.XX_ORD1__Sales_Price__c,XX_ORD1__Item__c:d.XX_ORD1__Item__c,Id:d.Id}:null,console.info("getQuoteLineItems4:configueredProduct",l.value),p}async function g(){t.resetConfigurator(),r.push({path:"/configurator/"+l.value.XX_ORD1__Item__c+"/"+l.value.Id}),t.initConfigurator(l.value.XX_ORD1__Item__c,l.value.Id)}return xn(async()=>{o.value=!0;const p=await u(),m=await t.getProductCrossSells(),d=new Set;p.forEach(v=>{d.add(v.XX_ORD1__Item__c)}),m.crossSells.forEach(v=>{v.disabled=d.has(v.XX_ORD1__Item__c)}),h.value=m.crossSells||[],o.value=!1}),(p,m)=>(X(),ne(Oe,null,[b("div",d5,[b("div",h5,[_e(Ge,{icon:"arrow",symbol:"",size:12,onClick:m[0]||(m[0]=d=>Me(t).savedScreen=!1)}),b("h2",p5,ve(i.value.itemName),1)]),Me(t).loading.save?(X(),ne("div",g5,[_e(Sc,{svg:""}),m5])):(X(),ne("div",v5,[_e(Ge,{icon:"check",color:"#136E05",size:14,"data-test-id":"item-tabs-before-button-icon"}),y5]))]),o.value?(X(),Te(wa,{key:0,type:"recommendations",rows:4})):h.value.length>0?(X(),ne("div",_5,[b5,b("div",C5,[(X(!0),ne(Oe,null,Ke(h.value,(d,v)=>(X(),ne("div",{key:d.Id||v,class:"ect-bg-white ect-border ect-border-gray-300 ect-rounded-md ect-p-3 ect-flex ect-flex-col","data-test-id":`configurator-recommend-card-${d.Id||v}`},[b("div",x5,[b("h4",k5,ve(d.Name),1),b("p",E5,ve(d.Description),1)]),b("div",O5,[b("div",S5,ve(Me(It)(d.Price)),1),_e(Pt,{btype:d.disabled?"secondary":"primary","button-style":d.disabled?"normal":"outlined",size:"medium",class:Ie({"ect-w-[120px]":d.loading}),loading:d.loading,disabled:d.disabled||d.loading,"data-test-id":`configurator-recommend-button-add-${d.Id||v}`,onClick:_=>c(d)},{default:Be(()=>[Ve(ve(d.loading?"":d.disabled?"Added to Quote":"Add to Quote"),1)]),_:2},1032,["btype","button-style","class","loading","disabled","data-test-id","onClick"])])],8,w5))),128))])])):(X(),ne("div",I5,[A5,b("div",T5,[(X(!0),ne(Oe,null,Ke(s.value,(d,v)=>(X(),ne("div",{key:d.title||v,class:"ect-bg-white ect-border ect-border-[#DEDEDE] ect-rounded-xl ect-p-4 md:ect-p-5 lg:ect-p-6 ect-flex ect-flex-col ect-items-center ect-gap-4 md:ect-gap-6 lg:ect-gap-8 ect-cursor-pointer ect-transition-all ect-duration-200 hover:ect-shadow-md hover:ect-border-gray-400","data-test-id":`configurator-recommend-redirect-card-${v}`,onClick:_=>f(d)},[b("div",P5,[_e(Ge,{icon:d.icon,size:20,color:"#000000","data-test-id":`configurator-recommend-redirect-icon-${v}`},null,8,["icon","data-test-id"])]),b("div",L5,[b("h4",{class:"ect-text-sm ect-font-semibold ect-text-[#5F5F5F] ect-text-center ect-leading-[1.43]","data-test-id":`configurator-recommend-redirect-title-${v}`},ve(d.title),9,R5),b("p",{class:"ect-text-sm ect-font-normal ect-text-[#828282] ect-text-center ect-leading-[1.71]","data-test-id":`configurator-recommend-redirect-description-${v}`},ve(d.description),9,M5)])],8,N5))),128))])])),l.value?(X(),ne("footer",q5,[b("div",j5,[b("h3",D5," Configuere next product from your quote "+ve(a.value),1),b("div",B5,[b("div",$5,[b("div",F5,[b("h4",V5,ve(l.value.Name),1),b("p",H5,ve(l.value.Description),1)]),b("div",U5,[b("div",z5,ve(Me(It)(l.value.Price)),1),_e(Pt,{btype:"primary","button-style":"filled",size:"medium","data-test-id":"configurator-recommend-button-add-next-product",onClick:g},{default:Be(()=>[Ve(" Configure Now ")]),_:1})])])])])])):ye("",!0)],64))}},Z5=["data-test-id"],Q5=He({__name:"AppPill",props:{variant:{type:String,default:"",validator:e=>["success","error",""].includes(e)},dataTestId:{type:String,default:""}},setup(e){return(t,n)=>(X(),ne("span",{class:Ie(["ect-pill",{"ect-pill-success":e.variant==="success","ect-pill-error":e.variant==="error","ect-pill-default":!e.variant}]),"data-test-id":e.dataTestId},[Qe(t.$slots,"default",{},void 0,!0)],10,Z5))}},[["__scopeId","data-v-c7f05fa0"]]),X5=["data-test-id"],J5=["data-test-id"],W5=["data-test-id","onClick"],G5=["data-test-id"],Y5=He({__name:"AppTabsV2",props:{showTabs:{type:Boolean,default:!0},modelValue:{type:String,default:""},border:{type:Boolean,default:!1},tabs:{type:Array,required:!0,validator:e=>e.every(t=>typeof t=="object"&&t.title&&t.key&&(t.sections===void 0||Array.isArray(t.sections)))},dataTestId:{type:String,required:!0}},emits:["update:modelValue","tab-change"],setup(e,{emit:t}){const n=e,r=t,i=be(()=>{var a;return n.modelValue||((a=n.tabs[0])==null?void 0:a.key)||""}),o=a=>{r("update:modelValue",a),r("tab-change",a)};return(a,s)=>(X(),ne("div",{class:"ect-page-tabs","data-test-id":e.dataTestId},[e.showTabs?(X(),ne("div",{key:0,class:Ie(["ect-page-tabs-header",[{"ect-tab-border":e.border}]]),"data-test-id":`${e.dataTestId}-header`},[(X(!0),ne(Oe,null,Ke(e.tabs,l=>(X(),ne("button",{key:l.key,class:Ie(["ect-page-tab-button",`ect-page-tab-button${i.value===l.key?"-active":""} ${l.tabClass||""}`]),"data-test-id":`${e.dataTestId}-tab-${l.key}`,onClick:h=>o(l.key)},[Ve(ve(l.title)+" ",1),l.pill!==void 0&&l.pill!==null?(X(),Te(Q5,{key:0,class:"ect-ml-2",variant:l.pillStyle,"data-test-id":`${e.dataTestId}-tab-${l.key}-pill`},{default:Be(()=>[Ve(ve(l.pill),1)]),_:2},1032,["variant","data-test-id"])):ye("",!0)],10,W5))),128))],10,J5)):ye("",!0),b("div",{class:"ect-page-tab-content","data-test-id":`${e.dataTestId}-content`},null,8,G5)],8,X5))}},[["__scopeId","data-v-f22cb1ed"]]),eh=["data-test-id"],th=["disabled","data-test-id"],nh=["value","disabled","data-test-id"],rh=["disabled","data-test-id"],Ki={__name:"CounterButton",props:{value:{type:Number,required:!0,default:null},min:{type:Number,default:1},max:{type:Number,default:999},empty:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:value","change"],setup(e,{emit:t}){const n=e,r=t,i=be(()=>n.min==null?0:n.min),o=be(()=>n.max==null?999:n.max),a=(y,w,A)=>Math.min(Math.max(y,w),A),s=y=>{if(y==null||y==="")return NaN;const w=Number(y);return Number.isFinite(w)?w:NaN},l=ae(null),h=ae(n.value??i.value),c=y=>{h.value=a(y,i.value,o.value)};n.value!==null&&c(n.value);const f=be(()=>h.value),u=be(()=>l.value!=null?l.value:String(f.value)),g=be(()=>n.disabled||f.value<=i.value),p=be(()=>n.disabled||f.value>=o.value);function m(y){y!==n.value&&(h.value=y,r("update:value",y),r("change",y))}function d(){if(g.value)return;const y=a(f.value-1,i.value,o.value);l.value=null,m(y)}function v(){if(p.value)return;const y=a(f.value+1,i.value,o.value);l.value=null,m(y)}function _(y){const A=String(y.target.value??"").replace(/\D+/g,"");l.value=A}function C(){const y=s(l.value),w=i.value,A=a(Number.isNaN(y)?w:y,i.value,o.value);l.value=null,m(A)}return(y,w)=>(X(),ne("div",{class:"ect-flex ect-items-center ect-gap-1","data-test-id":e.dataTestId},[b("button",{type:"button",class:Ie(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":g.value,"ect-cursor-not-allowed":g.value}]),disabled:g.value,"data-test-id":`${e.dataTestId}-decrement`,onClick:d}," - ",10,th),b("input",{type:"text",inputmode:"numeric",pattern:"[0-9]*",value:e.empty?"":u.value,disabled:e.disabled,class:"ect-h-7 ect-w-[48px] ect-px-2 ect-border ect-border-gray ect-rounded-md ect-text-center ect-text-sm ect-font-medium ect-text-gray-900 focus:ect-outline-none focus:ect-border-gray-400 ect-bg-white","data-test-id":`${e.dataTestId}-input`,onInput:_,onBlur:C},null,40,nh),b("button",{type:"button",class:Ie(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":p.value,"ect-cursor-not-allowed":p.value}]),disabled:p.value,"data-test-id":`${e.dataTestId}-increment`,onClick:v}," + ",10,rh)],8,eh))}},ih={class:"ect-flex ect-justify-end ect-items-center ect-gap-2.5 ect-px-6 ect-py-4 ect-bg-white ect-border-t ect-border-gray-300 ect-shadow-[0_-2px_4px_0px_rgba(0,0,0,0.11)]","data-test-id":"configurator-footer"},oh={"data-test-id":"configurator-footer-quantity"},ah={class:"ect-flex ect-justify-end ect-items-center ect-gap-6 ect-px-8 ect-py-0 ect-flex-1","data-test-id":"configurator-footer-prices"},sh=["data-test-id"],lh=["data-test-id"],ch=["data-test-id"],uh=["data-test-id"],fh={__name:"ConfiguratorFooter",props:{item:{type:Object,required:!0,default:()=>{}},disabled:{type:Boolean,default:!1},btnText:{type:String,default:"Save"}},emits:["update:qty","continue"],setup(e,{emit:t}){const n=ln(),r=e,i=ae(r.item),o=be(()=>{const l=n.summaryPrices,h=[];return n.isRecurringPricingSchema?(h.push({label:"One Time Price",value:l.oneTimePrice,highlight:!1}),h.push({label:n.showYearlyPricing?"Yearly Price":"Monthly Price",value:l.recurringPrice,highlight:!1})):(h.push({label:"Base Price",value:l.basePrice,highlight:!1}),h.push({label:"Add Ons",value:l.addOns,highlight:!1}),h.push({label:"Total Price",value:l.total,highlight:!1})),h}),a=t,s=()=>{r.disabled||a("continue")};return(l,h)=>(X(),ne("footer",ih,[b("div",oh,[_e(Ki,{value:i.value.qty,"onUpdate:value":h[0]||(h[0]=c=>i.value.qty=c),min:1,max:999,disabled:e.disabled,"is-selected":!0,"data-test-id":"configurator-footer-counter-button"},null,8,["value","disabled"])]),b("div",ah,[(X(!0),ne(Oe,null,Ke(o.value,(c,f)=>(X(),ne(Oe,{key:f},[b("div",{class:"ect-flex ect-flex-col ect-justify-center","data-test-id":`configurator-footer-price-${f}`},[b("span",{class:"ect-text-xs ect-font-normal ect-text-gray-500 ect-text-left","data-test-id":`configurator-footer-price-label-${f}`},ve(c.label),9,lh),b("span",{class:Ie(["ect-text-left",c.highlight?"ect-text-lg ect-font-bold ect-text-green-700":"ect-text-sm ect-font-medium ect-text-gray-800 "]),"data-test-id":`configurator-footer-price-value-${f}`},ve(Me(It)(c.value)),11,ch)],8,sh),f<o.value.length-1?(X(),ne("div",{key:0,class:"ect-w-0 ect-h-5 ect-border-l ect-border-gray-400","data-test-id":`configurator-footer-divider-${f}`},null,8,uh)):ye("",!0)],64))),128))]),_e(Pt,{class:"ect-min-w-[100px]",btype:e.disabled?"secondary":"primary",disabled:e.disabled,"button-style":"primary",size:"medium","data-test-id":"configurator-footer-button-continue",onClick:s},{default:Be(()=>[Ve(ve(e.btnText),1)]),_:1},8,["btype","disabled"])]))}},dh={class:"ect-w-full ect-bg-white ect-mb-4","data-test-id":"configurator-type-section"},hh={class:"ect-sticky ect-top-0 ect-z-30 ect-bg-white ect-shadow-sm ect-p-3 ect-px-4 ect-border-b ect-border-gray-200 ect-flex ect-justify-between ect-items-center","data-test-id":"configurator-type-header-sticky"},ph={class:"ect-flex ect-flex-col"},gh={class:"ect-font-bold ect-text-text-success ect-leading-tight"},mh=["innerHTML"],vh={key:0,class:"ect-flex ect-items-center ect-gap-2 ect-px-2 ect-py-1","data-test-id":"configurator-type-message"},yh={class:"ect-text-xs ect-font-medium ect-text-gray-600 ect-leading-tight ect-min-w-[190px]"},_h={class:"ect-divide-y ect-divide-gray-100 ect-overflow-y-auto"},bh={__name:"ConfiguratorType",props:{title:{type:String,required:!0},description:{type:String,default:""},message:{type:String,default:""}},setup(e){return(t,n)=>(X(),ne("section",dh,[b("header",hh,[b("div",ph,[b("h2",gh,ve(e.title),1),e.description?(X(),ne("p",{key:0,class:"ect-mt-1 ect-text-xs ect-text-gray-500 ect-leading-tight",innerHTML:e.description},null,8,mh)):ye("",!0)]),e.message?(X(),ne("div",vh,[_e(Ge,{icon:"info",symbol:"",color:"#198708",size:14,"data-test-id":"configurator-type-message-icon"}),b("span",yh,ve(e.message),1)])):ye("",!0)]),b("div",_h,[Qe(t.$slots,"default")])]))}},Ch={__name:"ShadowDisplay",props:{content:{type:String,required:!0}},setup(e){const t=e,n=ae(null);let r=null;return kn(()=>{n.value&&!r&&(r=n.value.attachShadow({mode:"open"}),r.innerHTML=t.content)}),St(()=>t.content,i=>{r&&(r.innerHTML=i)}),(i,o)=>(X(),ne("div",{ref_key:"host",ref:n},null,512))}},wh=["data-test-id"],xh=["data-test-id"],kh=["data-test-id"],Eh=[b("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[b("g",{id:"Group"},[b("path",{id:"Vector",d:"M7 1.3125V12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"}),b("path",{id:"Vector_2",d:"M1.3125 7H12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)],Oh=["data-test-id"],Sh=["data-test-id"],Ih=["data-test-id"],Ah=["data-test-id"],Th=["data-test-id"],Nh=["data-test-id","innerHTML"],Qt={__name:"Tag",props:{label:{type:String,default:""},value:{type:String,default:""},addButton:{type:Boolean,default:!1},editButton:{type:Boolean,default:!1},dataTestId:{type:String,default:""}},setup(e){const t=e,n=be(()=>{const r=t.value;if(typeof r!="string")return!1;const i=new DOMParser().parseFromString(r,"text/html");return Array.from(i.body.childNodes).some(o=>o.nodeType===1)});return(r,i)=>e.addButton?(X(),ne("div",{key:0,class:"ect-bg-orange-4 ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-orange-secondary","data-test-id":e.dataTestId},[b("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-orange-secondary ect-flex ect-items-center ect-gap-1","data-test-id":`${e.dataTestId}-content`},[b("div",{"data-test-id":`${e.dataTestId}-add-icon`},Eh,8,kh),Ve(" "+ve(e.label),1)],8,xh)],8,wh)):e.editButton?(X(),ne("div",{key:1,class:"ect-bg-white ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-success","data-test-id":e.dataTestId},[b("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-success ect-flex ect-items-center ect-gap-1","data-test-id":`${e.dataTestId}-content`},ve(e.label),9,Sh)],8,Oh)):(X(),ne("div",{key:2,class:"ect-bg-white ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-rounded-md ect-border ect-border-solid ect-border-neutral-200","data-test-id":e.dataTestId},[b("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${e.dataTestId}-label`},ve(e.label),9,Ah),e.value?(X(),ne("span",{key:0,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${e.dataTestId}-separator`}," : ",8,Th)):ye("",!0),n.value?(X(),Te(Ch,{key:1,content:e.value},null,8,["content"])):e.value?(X(),ne("span",{key:2,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-neutral-700","data-test-id":`${e.dataTestId}-value`,innerHTML:e.value},null,8,Nh)):ye("",!0)],8,Ih))}},Ph=["data-test-id"],Lh=["data-test-id"],Rh=["data-test-id"],Mh=["type","step","min","data-test-id"],Ea=He({__name:"InputEdit",props:{modelValue:{type:String,required:!0},type:{type:String,default:"string",validator:e=>["string","number","currency"].includes(e)},tag:{type:String,default:"span"},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:modelValue","change"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=ae(!1),a=ae(!1),s=ae(""),l=ae(null),h=be(()=>r.type==="currency"?v(r.modelValue):r.type==="number"?_(r.modelValue):r.modelValue),c=be(()=>r.type==="string"?"text":"number"),f=be(()=>r.type==="currency"?"0.01":void 0),u=be(()=>r.type==="currency"?"0":void 0),g=()=>{r.disabled||(r.type==="currency"?s.value=parseFloat(r.modelValue)||"0.00":r.type==="number"?s.value=parseFloat(r.modelValue)||"0":s.value=r.modelValue,o.value=!0,zt(()=>{l.value&&(l.value.focus(),l.value.select())}))},p=()=>{let C=s.value;if(r.type==="number"||r.type==="currency"){const y=parseFloat(s.value);isNaN(y)?C=r.modelValue:C=r.type==="currency"?y.toFixed(2):y.toString()}C!==r.modelValue&&(i("update:modelValue",C),i("change",C)),o.value=!1},m=()=>{s.value=r.modelValue,o.value=!1},d=()=>{o.value&&p()},v=C=>!C||isNaN(C)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(parseFloat(C)),_=C=>!C||isNaN(C)?"0":new Intl.NumberFormat("en-US").format(parseFloat(C));return St(()=>r.modelValue,C=>{o.value||(s.value=C)}),t({startEditing:g,saveChanges:p,cancelEditing:m}),(C,y)=>{const w=Uf("click-outside");return X(),ne("div",{class:"ect-relative ect-inline-block ect-min-w-[60px] ect-h-[30px]","data-test-id":e.dataTestId,onMouseenter:y[1]||(y[1]=A=>a.value=!0),onMouseleave:y[2]||(y[2]=A=>a.value=!1)},[o.value?wn((X(),ne("div",{key:1,class:"ect-w-full ect-h-full","data-test-id":`${e.dataTestId}-input-wrapper`},[wn(b("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":y[0]||(y[0]=A=>s.value=A),type:c.value,step:f.value,min:u.value,class:Ie(["ect-w-full ect-h-full ect-px-3 ect-bg-white ect-border ect-border-green-500 ect-rounded-sm ect-text-gray-700 ect-text-base ect-font-sans ect-outline-none ect-duration-200",C.$attrs.class]),"data-test-id":`${e.dataTestId}-input`,onKeyup:[jr(p,["enter"]),jr(m,["esc"])],onBlur:p},null,42,Mh),[[f1,s.value]])],8,Rh)),[[w,d]]):(X(),ne("div",{key:0,class:Ie(["ect-flex ect-items-center ect-gap-2 ect-rounded ect-transition-colors ect-duration-200",{"ect-cursor-pointer":!e.disabled}]),"data-test-id":`${e.dataTestId}-display`,onClick:g},[(X(),Te(Cl(e.tag),fa(C.$attrs,{class:"ect-m-0 ect-text-inherit","data-test-id":`${e.dataTestId}-text`}),{default:Be(()=>[Ve(ve(h.value)+" ",1),_e(Ge,{class:Ie(a.value&&!e.disabled?"ect-visible":"ect-invisible"),icon:"edit",size:"12",color:"#828282","data-test-id":`${e.dataTestId}-edit-icon`},null,8,["class","data-test-id"])]),_:1},16,["data-test-id"]))],10,Lh))],40,Ph)}}},[["__scopeId","data-v-07416d80"]]),qh=["data-test-id","data-publish-key"],jh={key:0,class:"ect-text-xs ect-text-gray-500 ect-text-white ect-font-medium ect-leading-tight ect-absolute ect-top-[-.7rem] ect-left-[-1rem] ect-bg-text-success ect-rounded-xl ect-px-2 ect-py-1"},Dh={key:1,class:"ect-flex ect-items-start ect-gap-4 ect-p-3 ect-px-4"},Bh={key:0,class:"ect-w-16 ect-h-16 ect-flex ect-items-center ect-justify-center ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0"},$h=["src","alt"],Fh={class:"ect-flex-1 ect-min-w-0"},Vh={class:"ect-flex ect-gap-4 ect-items-center ect-justify-between"},Hh={class:"ect-flex ect-flex-row ect-gap-3"},Uh=b("div",{class:"ect-w-px ect-h-auto ect-bg-gray-200 ect-mx-2"},null,-1),zh={class:"ect-flex ect-flex-col ect-max-w-[125px]"},Kh={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},Zh=["innerHTML"],Qh={key:0,class:"ect-flex ect-flex-wrap ect-gap-2.5 ect-mt-2"},Xh=["data-test-id"],Jh=["data-test-id"],Wh={key:1,class:"ect-inline-block ect-mb-2"},Gh={key:2,class:"ect-flex ect-flex-col ect-gap-3 ect-p-3 ect-h-full ect-justify-between"},Yh={class:"ect-flex ect-items-start ect-gap-2"},e9={class:"ect-w-16 ect-h-16 ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0 ect-overflow-hidden"},t9=["src","alt"],n9={class:"ect-flex-1 ect-min-w-0"},r9={class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},i9={class:"ect-mt-1 ect-text-sm ect-text-gray-700 ect-leading-tight"},o9={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},a9={key:0,class:"ect-flex ect-flex-wrap ect-gap-1.5"},s9=["data-test-id"],l9=["data-test-id"],c9={key:1,class:"ect-inline-block ect-mb-2"},u9={class:"ect-flex ect-justify-between ect-items-center"},f9={class:"ect-flex ect-flex-col"},d9=b("p",{class:"ect-text-xs ect-text-gray-500 ect-font-medium ect-leading-tight"},"Price",-1),h9={key:3,"data-test-id":"configurator-item-slot-details",class:"ect-bg-white ect-rounded-md"},p9={__name:"ConfiguratorItem",props:{item:{type:Object,required:!0},name:{type:String,required:!0},description:{type:String,default:""},imageUrl:{type:String,default:""},price:{type:Number,required:!0},quantity:{type:Number,default:1},selected:{type:Boolean,default:!1},tags:{type:Array,default:()=>[]},attributes:{type:Array,default:()=>[]},size:{type:Number,default:1},minQuantity:{type:Number,default:null},maxQuantity:{type:Number,default:null},showImage:{type:Boolean,default:!1},option:{type:Object,default:null},isAttributes:{type:Boolean,default:!1},showAttributes:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:quantity","update:name","edit-attributes"],setup(e,{emit:t}){const n=e,r=t,i=ae(null),o=ae(0),a=ae(n.item),s=be(()=>a.value.relationshipInfo.relationship==="Kit"?"ect-bg-green-3 ect-border-gray-200 ect-border-success":n.disabled?"ect-bg-light-bg-x ect-border-gray-200":n.selected?"ect-bg-green-3 ect-border-gray-200 ect-border-success":"ect-bg-white ect-border-gray-200 hover:ect-border-success"),l=be({get:()=>n.quantity,set:p=>r("update:quantity",p)}),h=be({get:()=>n.name,set:p=>r("update:name",p)}),c=p=>{r("update:quantity",p)},f=be(()=>{if(o.value===0)return n.tags;const m=Math.floor(o.value/120);return n.tags.slice(0,Math.max(1,m))}),u=be(()=>Math.max(0,n.tags.length-f.value.length)),g=()=>{if(i.value){const p=i.value,m=80,d=120,v=32,_=64;o.value=p.offsetWidth-m-d-v-_}};return kn(()=>{zt(()=>{g()})}),St(()=>n.tags,()=>{zt(()=>{g()})},{deep:!0}),kn(()=>{window.addEventListener("resize",g)}),(p,m)=>(X(),ne("div",{ref_key:"containerRef",ref:i,class:Ie(["ect-w-full ect-rounded-md ect-border-1 ect-transition-colors ect-relative",s.value]),"data-test-id":`configurator-item-${e.item.itemId}`,"data-publish-key":e.item.publishKey},[e.item.relationshipInfo.relationship==="Kit"?(X(),ne("div",jh," KIT ")):ye("",!0),e.size===1?(X(),ne("div",Dh,[e.showImage?(X(),ne("div",Bh,[e.imageUrl?(X(),ne("img",{key:0,src:e.imageUrl,alt:h.value,class:"ect-w-full ect-h-full ect-object-cover"},null,8,$h)):(X(),Te(Ge,{key:1,disabled:"",icon:"image",symbol:"",size:20,color:"#ACACAC"}))])):ye("",!0),b("div",Fh,[b("div",Vh,[_e(Ea,{modelValue:h.value,"onUpdate:modelValue":m[0]||(m[0]=d=>h.value=d),tag:"h3",class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},null,8,["modelValue"]),b("div",Hh,[b("div",{onClick:m[2]||(m[2]=Nt(()=>{},["stop"]))},[_e(Ki,{value:l.value,"onUpdate:value":m[1]||(m[1]=d=>l.value=d),min:e.minQuantity,max:e.maxQuantity,"data-test-id":`configurator-item-counter-${e.item.itemId}`,onChange:c},null,8,["value","min","max","data-test-id"])]),Uh,b("div",zh,[_e(Ea,{modelValue:a.value.price,"onUpdate:modelValue":m[3]||(m[3]=d=>a.value.price=d),tag:"p",type:"currency",class:"ect-text-base ect-font-bold"},null,8,["modelValue"])]),b("div",Kh,[Qe(p.$slots,"selection-control")])])]),b("p",{class:"ect-mt-2 ect-text-sm ect-text-gray-700 ect-leading-tight",innerHTML:e.description},null,8,Zh),e.isAttributes&&e.showAttributes&&e.selected?(X(),ne("div",Qh,[a.value.getTags().length>0?(X(),ne(Oe,{key:0},[(X(!0),ne(Oe,null,Ke(f.value,(d,v)=>(X(),ne("span",{key:v,class:"ect-inline-block"},[_e(Qt,{label:d.label,value:d.value},null,8,["label","value"])]))),128)),u.value>0?(X(),ne("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${e.item.itemId}`,onClick:m[4]||(m[4]=Nt(()=>{},["stop"]))}," +"+ve(u.value)+" more ",9,Xh)):ye("",!0),e.selected?(X(),ne("button",{key:1,"data-test-id":`configurator-item-button-edit-attributes-${e.item.itemId}`,onClick:m[5]||(m[5]=d=>r("edit-attributes"))},[_e(Qt,{label:"Edit attributes","edit-button":""})],8,Jh)):ye("",!0)],64)):(X(),ne("span",Wh,[b("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:m[6]||(m[6]=d=>r("edit-attributes"))},[_e(Qt,{label:"Add attributes","add-button":""})])]))])):ye("",!0)])])):(X(),ne("div",Gh,[b("div",Yh,[b("div",e9,[e.imageUrl?(X(),ne("img",{key:0,src:e.imageUrl,alt:e.name,class:"ect-w-full ect-h-full ect-object-cover"},null,8,t9)):ye("",!0)]),b("div",n9,[b("h3",r9,ve(e.name),1),b("p",i9,ve(e.description),1)]),b("div",o9,[Qe(p.$slots,"selection-control")])]),e.isAttributes&&e.showAttributes&&e.selected?(X(),ne("div",a9,[a.value.getTags().length>0?(X(),ne(Oe,{key:0},[(X(!0),ne(Oe,null,Ke(f.value,(d,v)=>(X(),ne("span",{key:v,class:"ect-inline-block"},[_e(Qt,{label:d.label,value:d.value},null,8,["label","value"])]))),128)),u.value>0?(X(),ne("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${e.item.itemId}`,onClick:m[7]||(m[7]=Nt(()=>{},["stop"]))}," +"+ve(u.value)+" more ",9,s9)):ye("",!0),e.selected?(X(),ne("button",{key:1,class:"ect-ml-auto","data-test-id":`configurator-item-button-edit-attributes-${e.item.itemId}`,onClick:m[8]||(m[8]=d=>r("edit-attributes"))},[_e(Qt,{label:"Edit attributes","edit-button":""})],8,l9)):ye("",!0)],64)):(X(),ne("span",c9,[b("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:m[9]||(m[9]=d=>r("edit-attributes"))},[_e(Qt,{label:"Add attributes","add-button":""})])]))])):ye("",!0),b("div",u9,[b("div",{onClick:m[11]||(m[11]=Nt(()=>{},["stop"]))},[_e(Ki,{value:l.value,"onUpdate:value":m[10]||(m[10]=d=>l.value=d),min:e.minQuantity,max:e.maxQuantity,"data-test-id":`configurator-item-counter-${e.item.itemId}`,onChange:c},null,8,["value","min","max","data-test-id"])]),b("div",f9,[d9,_e(Ea,{modelValue:a.value.price,"onUpdate:modelValue":m[12]||(m[12]=d=>a.value.price=d),tag:"p",type:"currency",class:"ect-w-[125px] ect-text-base ect-font-bold"},null,8,["modelValue"])])])])),e.selected&&e.isAttributes?(X(),ne("div",h9,[Qe(p.$slots,"default")])):ye("",!0)],10,qh))}},g9={"af-ZA":",","sq-AL":",","ar-DZ":",","ar-BH":"٫","ar-EG":"٫","ar-IQ":"٫","ar-JO":"٫","ar-KW":"٫","ar-LB":"٫","ar-LY":",","ar-MA":",","ar-OM":"٫","ar-QA":"٫","ar-SA":"٫","ar-SD":"٫","ar-SY":"٫","ar-TN":",","ar-AE":"٫","ar-YE":"٫","hy-AM":",","az-AZ":",","bn-BD":".","bn-IN":".","eu-ES":",","be-BY":",","bs-BA":",","bg-BG":",","my-MM":".","ca-ES":",","ca-ES-EURO":",","zh-CN":".","zh-CN-PINYIN":".","zh-CN-STROKE":".","zh-HK":".","zh-HK-STROKE":".","zh-MO":".","zh-SG":".","zh-TW":".","zh-TW-STROKE":".","hr-HR":",","cs-CZ":",","da-DK":",","nl-AW":",","nl-BE":",","nl-NL":",","nl-SR":",","dz-BT":".","en-AG":".","en-AU":".","en-BS":".","en-BB":".","en-BZ":".","en-BM":".","en-BW":".","en-CM":".","en-CA":".","en-DE":",","en-KY":".","en-ER":".","en-FK":".","en-FJ":".","en-GM":".","en-GH":".","en-GI":".","en-GY":".","en-HK":".","en-IN":".","en-ID":".","en-IE":".","en-IE-EURO":".","en-JM":".","en-KE":".","en-LR":".","en-MG":".","en-MW":".","en-MY":".","en-MU":".","en-NA":".","en-NZ":".","en-NG":".","en-PK":".","en-PG":".","en-PH":".","en-RW":".","en-WS":".","en-SC":".","en-SL":".","en-SG":".","en-SX":".","en-SB":".","en-ZA":",","en-SH":".","en-SZ":".","en-TZ":".","en-TO":".","en-TT":".","en-UG":".","en-GB":".","en-US":".","en-VU":".","et-EE":",","fi-FI":",","fi-FI-EURO":",","fr-BE":",","fr-CA":",","fr-KM":",","fr-FR":",","fr-FR-EURO":",","fr-GN":",","fr-HT":",","fr-LU":",","fr-MR":",","fr-MC":",","fr-CH":",","fr-WF":",","ka-GE":",","de-AT":",","de-AT-EURO":",","de-BE":",","de-DE":",","de-DE-EURO":",","de-LU":",","de-LU-EURO":",","de-CH":".","el-GR":",","gu-IN":".","iw-IL":".","hi-IN":".","hu-HU":",","is-IS":",","in-ID":",","ga-IE":".","it-IT":",","it-CH":".","ja-JP":".","kn-IN":".","kk-KZ":",","km-KH":",","ko-KP":".","ko-KR":".","ky-KG":",","lo-LA":",","lv-LV":",","lt-LT":",","lu-CD":",","lb-LU":",","mk-MK":",","ms-BN":",","ms-MY":".","ml-IN":".","mt-MT":".","mi-NZ":".","mr-IN":".","ne-NP":".","no-NO":",","ps-AF":"٫","fa-IR":"٫","pl-PL":",","pt-AO":",","pt-BR":",","pt-CV":",","pt-MZ":",","pt-PT":",","pt-ST":",","ro-MD":",","ro-RO":",","rm-CH":".","rn-BI":",","ru-KZ":",","ru-RU":",","sr-BA":",","sr-RS":",","sh-BA":",","sh-ME":",","sh-ME-USD":",","sh-CS":",","sk-SK":",","sl-SI":",","so-DJ":".","so-SO":".","es-AR":",","es-BO":",","es-CL":",","es-CO":",","es-CR":",","es-CU":".","es-DO":".","es-EC":",","es-SV":".","es-GT":".","es-HN":".","es-MX":".","es-NI":".","es-PA":".","es-PY":",","es-PE":".","es-PR":".","es-ES":",","es-ES-EURO":",","es-US":".","es-UY":",","es-VE":",","sw-KE":".","sv-SE":",","tl-PH":".","tg-TJ":",","ta-IN":".","ta-LK":".","te-IN":".","th-TH":".","ti-ET":".","tr-TR":",","uk-UA":",","ur-PK":".","uz-LATN-UZ":",","vi-VN":",","cy-GB":".","xh-ZA":".","yo-BJ":".","zu-ZA":"."},m9={name:"CustomInput",components:{AppIcon:Ge},props:{editMode:{type:Boolean,default:!0},type:{type:String,default:"text"},max:{type:Number,default:500},label:{type:String,default:""},name:{type:String,default:""},showLabel:{type:Boolean,default:!0},modelValue:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},isReadOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},highlight:{type:Boolean,default:!1},placeholder:{type:String,default:""},error:{type:[Boolean,String],default:!1},cssClass:{type:Object,default:()=>({})},tooltip:{type:String,default:null},locale:{type:String,default:"en-US"},icon:{type:String,default:null},itooltip:{type:String,default:null},icolor:{type:String,default:"#7d7d7d"},ihover:{type:String,default:"#57c046"},icustom:{type:Boolean,default:!1},idisabled:{type:Boolean,default:!1},height:{type:Number,default:32},textAlignment:{type:String,default:"left"},decimalPrecision:{type:Number,default:0},allowNegatives:{type:Boolean,default:!1},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["update:modelValue","iclick","blur"],data(){return{initialValue:"",decimalSeprator:".",ctrl:!1}},computed:{getValue(){return this.modelValue?this.type==="currency"?String(this.modelValue).replace(".",this.decimalSeprator):String(this.modelValue):""},error_message(){return typeof this.error=="string"?this.error:this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},isHighlight(){return(this.initialValue===""||this.initialValue===null)&&(this.modelValue===""||this.modelValue===null)?!1:this.initialValue!==this.modelValue}},created(){this.initialValue=this.modelValue,this.decimalSeprator=this.type==="currency"?g9[this.locale]:"."},methods:{handlerInput(e){const t=e.target.value;this.type==="currency"?this.$emit("update:modelValue",t.replace(this.decimalSeprator,".")):this.$emit("update:modelValue",t)},preventNonNumeric(e){if(this.type==="number"){const t=this.decimalPrecision,n=e.target.value,r=e.key;if(["Backspace","ArrowLeft","ArrowRight","Delete","Tab"].includes(r)||this.allowNegatives&&r==="-")return;if(r==="."&&t===0){e.preventDefault();return}if(r==="."&&n.includes(".")){e.preventDefault();return}if(r==="."||n.includes(".")&&!n.endsWith(".")&&r!=="Backspace"){const i=n.split(".");if(i.length>1&&i[1].length>=t){e.preventDefault();return}}if(isNaN(r)&&![".","Backspace","Tab"].includes(r)){e.preventDefault();return}}if(e.key==="Backspace"||this.ctrl)return!0;if(e.key==="Control"&&(this.ctrl=!0),this.type==="currency"||this.type==="number"){if(!this.getValue.includes(this.decimalSeprator)&&e.key===this.decimalSeprator)return!0;/[\deE+\-]/.test(e.key)||e.preventDefault()}return!0},handlerKeyup(e){e.key==="Control"&&(this.ctrl=!1)}}},v9=["data-test-id"],y9=["for","data-test-id"],_9=["data-test-id"],b9=["id","type","name","disabled","placeholder","value","maxlength","readonly","data-test-id"],C9=["data-test-id"],w9=["data-test-id"];function x9(e,t,n,r,i,o){const a=Sr("AppIcon");return X(),ne("div",{class:"input","data-test-id":n.dataTestId},[n.label&&n.showLabel?(X(),ne("label",{key:0,class:Ie({error_color:!!n.error}),for:n.label,"data-test-id":`${n.dataTestId}-label`},[Ve(ve(n.label)+" ",1),n.required?(X(),ne("span",{key:0,class:Ie({error_color:!!n.error})},"*",2)):ye("",!0)],10,y9)):ye("",!0),n.editMode?(X(),ne("div",{key:1,class:Ie(["input-wrapper ect-w-full",{errorBorder_color:!!n.error,highlight:o.isHighlight&&n.highlight}]),"data-test-id":`${n.dataTestId}-wrapper`},[n.icon?(X(),Te(a,{key:0,class:"input-wrapper_icon",icon:n.icon,hover:n.ihover,color:n.icolor,size:19,disabled:n.idisabled,custom:n.icustom,tooltip:n.itooltip,"data-test-id":`${n.dataTestId}-icon`,direction:"top-right",onClick:t[0]||(t[0]=s=>e.$emit("iclick"))},null,8,["icon","hover","color","disabled","custom","tooltip","data-test-id"])):ye("",!0),b("input",{id:n.label,class:Ie(`ectheme-input-box ${n.size}`),type:n.type,style:tt({width:n.icon?"calc(100% - 36px)":"100%",height:`${n.height}px`,textAlign:n.textAlignment}),name:n.name,disabled:n.disabled,placeholder:n.placeholder,value:o.getValue,maxlength:n.max,readonly:n.isReadOnly,"data-test-id":`${n.dataTestId}-input`,onInput:t[1]||(t[1]=(...s)=>o.handlerInput&&o.handlerInput(...s)),onKeydown:t[2]||(t[2]=(...s)=>o.preventNonNumeric&&o.preventNonNumeric(...s)),onKeyup:t[3]||(t[3]=(...s)=>o.handlerKeyup&&o.handlerKeyup(...s)),onBlur:t[4]||(t[4]=s=>e.$emit("blur"))},null,46,b9)],10,_9)):ye("",!0),n.editMode?ye("",!0):(X(),ne("p",{key:2,class:"value","data-test-id":`${n.dataTestId}-value`},ve(o.getValue),9,C9)),o.error_message?(X(),ne("div",{key:3,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${n.dataTestId}-error`},ve(o.error_message),9,w9)):ye("",!0)],8,v9)}const k9=He(m9,[["render",x9],["__scopeId","data-v-032ca141"]]),E9={name:"AtomSpinner",props:{dataTestId:{type:String,default:""}}},O9=["data-test-id"];function S9(e,t,n,r,i,o){return X(),ne("div",{class:"spinner","data-test-id":n.dataTestId},null,8,O9)}const I9={name:"CustomDropdown",components:{AppIcon:Ge,AtomSpinner:He(E9,[["render",S9],["__scopeId","data-v-771ed032"]])},props:{label:{type:String,default:""},placeholder:{type:String,default:""},options:{type:Array,default:()=>[]},display:{type:Array,default:()=>[]},modelValue:{type:String,default:""},error:{type:[Boolean,String],default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},select:{type:Boolean,default:!1},lookup:{type:Boolean,default:!1},search:{type:Boolean,default:!1},badge:{type:String,default:void 0},highlight:{type:Boolean,default:!1},property:{type:Object,default:()=>({key:"value",value:"label",assigned:"assigned"})},dropdownTheme:{type:String,default:"light"},icon:{type:String,default:""},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["search","focus-in","focus-out","update:modelValue"],data:()=>({inputFocused:!1,value:"",isHover:!1,highlightedIndex:-1,initialValue:"",teleportStyle:{position:"absolute",top:"0px",left:"0px",width:"0px"}}),computed:{isHighlight(){return(this.initialValue===""||this.initialValue==null)&&(this.modelValue===""||this.modelValue==null)?!1:this.initialValue!==this.modelValue},error_message(){return this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},getOptions(){if(this.select&&this.search){const e=this.value.toLowerCase();return this.options.filter(t=>JSON.stringify(t).toLowerCase().includes(e))}else return this.options},getSelected(){let e=null;if(this.modelValue)e=this.options.find(t=>t[this.property.key]===this.modelValue);else if(!this.search){const t=this.options.find(n=>n[this.property.key]==="");t?e=t:this.placeholder?e={[this.property.value]:this.placeholder,[this.property.key]:""}:e={[this.property.value]:"--Select--",[this.property.key]:""}}return e||{[this.property.value]:this.placeholder||"--Select--",[this.property.key]:""}},shouldShowAbove(){if(!this.$refs.triggerElement)return!1;const e=this.$refs.triggerElement.getBoundingClientRect(),t=250,n=window.innerHeight-e.bottom,r=e.top;return n<t&&r>t},dropdownStyle(){if(!this.$refs.triggerElement)return{};const e=this.$refs.triggerElement.getBoundingClientRect(),t=250,n=window.innerHeight-e.bottom,r=e.top,i=n<t&&r>t;return{position:"absolute",top:i?"auto":"100%",bottom:i?"100%":"auto",left:"0",width:"100%",zIndex:1e3}}},created(){this.initialValue=this.modelValue},mounted(){window.addEventListener("resize",this.updateDropdownPosition),window.addEventListener("scroll",this.updateDropdownPosition,!0)},beforeUnmount(){window.removeEventListener("resize",this.updateDropdownPosition),window.removeEventListener("scroll",this.updateDropdownPosition,!0)},methods:{updateDropdownPosition(){if(!this.$refs.triggerElement)return;const e=this.$refs.triggerElement.getBoundingClientRect(),t=200,n=window.innerHeight-e.bottom,r=e.top,i=n<t&&r>t;this.teleportStyle={position:"absolute",top:`${i?e.top-t:e.bottom}px`,left:`${e.left}px`,width:`${e.width}px`,zIndex:9999}},subFieldsText(e){if(!this.display||this.display.length<1)return"";const t=[];return this.display.forEach(n=>{const r=this.subField(e,n);r&&t.push(r)}),t.join(" | ")},subField(e,t){return t?t.split(".").reduce((i,o)=>i[o]||"",e):e},lookupSearchHandler:xc(function(e){this.value=e,this.search&&!this.select&&this.$emit("search",e)}),handlerFocusIn(){!(this.modelValue&&this.search)&&!this.disabled&&(this.inputFocused=!0,this.updateDropdownPosition(),this.$emit("focus-in"))},updateSelected(e){e&&(this.value="",this.$emit("update:modelValue",e[this.property.key]),this.search&&!this.select&&!this.lookup&&this.$emit("search",""),this.onInputFocusedOut(!0))},clear(){this.disabled||(this.value="",this.$emit("update:modelValue",null),this.search&&!this.select&&!this.lookup&&this.$emit("search",""))},onInputFocusedOut(e=!1){(!this.isHover||e)&&!this.disabled&&(e?(this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")):setTimeout(()=>{this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")},100))},highlightNextOption(){this.highlightedIndex<this.options.length-1&&this.highlightedIndex++},highlightPreviousOption(){this.highlightedIndex>0&&this.highlightedIndex--}}},A9=["data-test-id"],T9=["for","data-test-id"],N9={class:"input-container-box ect-grow ect-w-full"},P9=["data-test-id"],L9=["placeholder","disabled","data-test-id"],R9=["data-test-id"],M9=["title","data-test-id"],q9=["data-test-id"],j9=["data-test-id"],D9=["data-test-id"],B9=["data-test-id"],$9=["data-test-id","onClick"],F9=["data-test-id"],V9={class:"ect-text-font-clr-light ect-flex ect-gap-2 ect-items-center ect-justify-between ect-w-full"},H9=["data-test-id"],U9=["data-test-id"],z9=["data-test-id"],K9=["title","data-test-id"],Z9=["data-test-id"];function Q9(e,t,n,r,i,o){const a=Sr("AppIcon"),s=Sr("AtomSpinner");return X(),ne("div",{ref:"dropdownWrapper",class:Ie(["customdropdown input-container",{dark:n.dropdownTheme==="dark"}]),"data-test-id":n.dataTestId,onMouseenter:t[7]||(t[7]=l=>e.isHover=!0),onMouseleave:t[8]||(t[8]=l=>e.isHover=!1)},[n.label?(X(),ne("label",{key:0,class:Ie(["title_label",{error_color:!!n.error}]),for:n.label,"data-test-id":`${n.dataTestId}-label`},[Ve(ve(n.label)+" ",1),n.required?(X(),ne("span",{key:0,class:Ie({error_color:!!n.error})},"*",2)):ye("",!0)],10,T9)):ye("",!0),b("div",N9,[b("div",{ref:"triggerElement",class:Ie(["input-wrapper ectheme-input-box ect-w-full",{disabled:n.disabled,"input-error":n.error,highlight:o.isHighlight&&n.highlight,"size-large":n.size==="large","size-medium":n.size==="medium"||n.size==="small"}]),"data-test-id":`${n.dataTestId}-trigger`,tabindex:"0",onFocusin:t[2]||(t[2]=(...l)=>o.handlerFocusIn&&o.handlerFocusIn(...l)),onFocusout:t[3]||(t[3]=l=>o.onInputFocusedOut(!1)),onKeydown:[t[4]||(t[4]=jr(l=>o.updateSelected(n.options[e.highlightedIndex]),["enter"])),t[5]||(t[5]=jr(Nt((...l)=>o.highlightPreviousOption&&o.highlightPreviousOption(...l),["prevent"]),["up"])),t[6]||(t[6]=jr(Nt((...l)=>o.highlightNextOption&&o.highlightNextOption(...l),["prevent"]),["down"]))]},[!n.modelValue&&n.search?wn((X(),ne("input",{key:0,ref:"searchInput","onUpdate:modelValue":t[0]||(t[0]=l=>e.value=l),type:"text",name:"search",placeholder:n.placeholder,autocomplete:"off",disabled:n.disabled,"data-test-id":`${n.dataTestId}-search-input`,onInput:t[1]||(t[1]=Nt(l=>o.lookupSearchHandler(l.target.value),["prevent"]))},null,40,L9)),[[Bi,e.value]]):(X(),ne("div",{key:1,class:Ie(["selection-name ect-text-text-primary-dark ect-flex ect-justify-between ect-items-center",{"size-large":n.size==="large","size-medium":n.size==="medium"||n.size==="small"}]),"data-test-id":`${n.dataTestId}-selection`},[o.getSelected?(X(),ne(Oe,{key:0},[b("span",{title:o.getSelected[n.property.value],class:Ie(["ect-flex ect-items-center ect-gap-2 ect-font-medium",{"ect-text-font-clr-light":!n.modelValue}]),"data-test-id":`${n.dataTestId}-selection-value`},[n.icon?(X(),Te(a,{key:0,class:"ect-mr-0",icon:n.icon,size:14,color:"#5F5F5F","data-test-id":`${n.dataTestId}-selection-icon`},null,8,["icon","data-test-id"])):ye("",!0),Ve(" "+ve(o.getSelected[n.property.value]),1)],10,M9),n.badge&&o.getSelected[n.badge]?(X(),ne("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${n.dataTestId}-selection-badge`},ve(o.getSelected[n.badge]),9,q9)):ye("",!0)],64)):ye("",!0)],10,R9)),n.search?(X(),ne(Oe,{key:2},[n.loading?(X(),Te(s,{key:0,class:"spinner","data-test-id":`${n.dataTestId}-loading-spinner`},null,8,["data-test-id"])):(X(),ne("div",{key:1,class:"clear-button","data-test-id":`${n.dataTestId}-action-button`},[e.value||n.modelValue?(X(),Te(a,{key:0,disabled:n.disabled,icon:"close",color:"#acacac",size:10,"data-test-id":`${n.dataTestId}-clear-button`,onClick:o.clear},null,8,["disabled","data-test-id","onClick"])):(X(),Te(a,{key:1,icon:"search",size:14,color:"#acacac",disabled:n.disabled,"data-test-id":`${n.dataTestId}-search-button`},null,8,["disabled","data-test-id"]))],8,j9))],64)):(X(),Te(a,{key:3,class:"clear-button",color:o.error_message?"#ff6a6a":"#acacac",icon:"arrow_drop_up",size:12,disabled:n.disabled,"data-test-id":`${n.dataTestId}-dropdown-arrow`},null,8,["color","disabled","data-test-id"]))],42,P9),o.error_message?(X(),ne("div",{key:0,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${n.dataTestId}-error`},ve(o.error_message),9,D9)):ye("",!0),o.getOptions&&e.inputFocused&&!n.disabled&&(n.select||n.lookup)?(X(),ne("div",{key:1,ref:"dropdown",class:Ie(["dropdown",{"dropdown-above":o.shouldShowAbove}]),style:tt(o.dropdownStyle),"data-test-id":`${n.dataTestId}-dropdown`},[(X(!0),ne(Oe,null,Ke(o.getOptions,(l,h)=>(X(),ne("div",{key:l[n.property.key],class:Ie(["dropdown-item",{highlighted:h===e.highlightedIndex,"ect-pointer-events-none":l[n.property.assigned]}]),"data-test-id":`${n.dataTestId}-option-${h}`,onClick:c=>o.updateSelected(l)},[b("div",{class:"name ect-items-center","data-test-id":`${n.dataTestId}-option-${h}-name`},[b("span",V9,[b("span",{class:Ie({"ect-text-zinc-400":l[n.property.assigned]}),"data-test-id":`${n.dataTestId}-option-${h}-value`},ve(l[n.property.value]==null?"Key and Value is Wrong":l[n.property.value]),11,H9),l[n.property.assigned]?(X(),ne("span",{key:0,class:"ect-text-xs ect-leading-4 ect-text-zinc-600","data-test-id":`${n.dataTestId}-option-${h}-assigned`},"Assigned",8,U9)):ye("",!0)]),n.badge?(X(),ne("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${n.dataTestId}-option-${h}-badge`},ve(l[n.badge]),9,z9)):ye("",!0)],8,F9),b("div",{class:"info",title:o.subFieldsText(l),"data-test-id":`${n.dataTestId}-option-${h}-info`},[b("span",null,ve(o.subFieldsText(l)),1)],8,K9)],10,$9))),128)),!o.getOptions.length&&!n.loading&&(e.value||n.select)?(X(),ne("div",{key:0,class:"no-items-found","data-test-id":`${n.dataTestId}-no-options`}," no options found ",8,Z9)):ye("",!0)],14,B9)):ye("",!0)])],42,A9)}const Lc=He(I9,[["render",Q9],["__scopeId","data-v-5ae4f6dc"]]);var ot=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mc={exports:{}};/*!
29
29
  * Quill Editor v1.3.7
30
30
  * https://quilljs.com/
31
31
  * Copyright (c) 2014, Jason Chen
@@ -78,7 +78,7 @@
78
78
  * Date: 2023-05-12T08:44:03.742Z
79
79
  */const Qc={essential:[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline"],[{list:"ordered"},{list:"bullet"},{align:[]}],["blockquote","code-block","link"],[{color:[]},"clean"]],minimal:[[{header:1},{header:2}],["bold","italic","underline"],[{list:"ordered"},{list:"bullet"},{align:[]}]],full:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["link","video","image"],["clean"]]},u2=kl({name:"QuillEditor",inheritAttrs:!1,props:{content:{type:[String,Object]},contentType:{type:String,default:"delta",validator:e=>["delta","html","text"].includes(e)},enable:{type:Boolean,default:!0},readOnly:{type:Boolean,default:!1},placeholder:{type:String,required:!1},theme:{type:String,default:"snow",validator:e=>["snow","bubble",""].includes(e)},toolbar:{type:[String,Array,Object],required:!1,validator:e=>typeof e=="string"&&e!==""?e.charAt(0)==="#"?!0:Object.keys(Qc).indexOf(e)!==-1:!0},modules:{type:Object,required:!1},options:{type:Object,required:!1},globalOptions:{type:Object,required:!1}},emits:["textChange","selectionChange","editorChange","update:content","focus","blur","ready"],setup:(e,t)=>{kn(()=>{o()}),Oi(()=>{n=null});let n,r;const i=ae(),o=()=>{var k;if(i.value){if(r=a(),e.modules)if(Array.isArray(e.modules))for(const E of e.modules)Oa.register(`modules/${E.name}`,E.module);else Oa.register(`modules/${e.modules.name}`,e.modules.module);n=new Oa(i.value,r),C(e.content),n.on("text-change",f),n.on("selection-change",g),n.on("editor-change",p),e.theme!=="bubble"&&i.value.classList.remove("ql-bubble"),e.theme!=="snow"&&i.value.classList.remove("ql-snow"),(k=n.getModule("toolbar"))===null||k===void 0||k.container.addEventListener("mousedown",E=>{E.preventDefault()}),t.emit("ready",n)}},a=()=>{const k={};if(e.theme!==""&&(k.theme=e.theme),e.readOnly&&(k.readOnly=e.readOnly),e.placeholder&&(k.placeholder=e.placeholder),e.toolbar&&e.toolbar!==""&&(k.modules={toolbar:(()=>{if(typeof e.toolbar=="object")return e.toolbar;if(typeof e.toolbar=="string")return e.toolbar.charAt(0)==="#"?e.toolbar:Qc[e.toolbar]})()}),e.modules){const E=(()=>{var L,V;const K={};if(Array.isArray(e.modules))for(const W of e.modules)K[W.name]=(L=W.options)!==null&&L!==void 0?L:{};else K[e.modules.name]=(V=e.modules.options)!==null&&V!==void 0?V:{};return K})();k.modules=Object.assign({},k.modules,E)}return Object.assign({},e.globalOptions,e.options,k)},s=k=>typeof k=="object"&&k?k.slice():k,l=k=>Object.values(k.ops).some(E=>!E.retain||Object.keys(E).length!==1);let h;const c=k=>{if(typeof h==typeof k){if(k===h)return!0;if(typeof k=="object"&&k&&typeof h=="object"&&h)return!l(h.diff(k))}return!1},f=(k,E,L)=>{h=s(_()),c(e.content)||t.emit("update:content",h),t.emit("textChange",{delta:k,oldContents:E,source:L})},u=ae(),g=(k,E,L)=>{u.value=!!(n!=null&&n.hasFocus()),t.emit("selectionChange",{range:k,oldRange:E,source:L})};St(u,k=>{k?t.emit("focus",i):t.emit("blur",i)});const p=(...k)=>{k[0]==="text-change"&&t.emit("editorChange",{name:k[0],delta:k[1],oldContents:k[2],source:k[3]}),k[0]==="selection-change"&&t.emit("editorChange",{name:k[0],range:k[1],oldRange:k[2],source:k[3]})},m=()=>i.value,d=()=>{var k;return(k=n==null?void 0:n.getModule("toolbar"))===null||k===void 0?void 0:k.container},v=()=>{if(n)return n;throw`The quill editor hasn't been instantiated yet,
80
80
  make sure to call this method when the editor ready
81
- or use v-on:ready="onReady(quill)" event instead.`},_=(k,E)=>e.contentType==="html"?A():e.contentType==="text"?y(k,E):n==null?void 0:n.getContents(k,E),C=(k,E="api")=>{const L=k||(e.contentType==="delta"?new c2:"");e.contentType==="html"?I(L):e.contentType==="text"?w(L,E):n==null||n.setContents(L,E),h=s(L)},y=(k,E)=>{var L;return(L=n==null?void 0:n.getText(k,E))!==null&&L!==void 0?L:""},w=(k,E="api")=>{n==null||n.setText(k,E)},A=()=>{var k;return(k=n==null?void 0:n.root.innerHTML)!==null&&k!==void 0?k:""},I=k=>{n&&(n.root.innerHTML=k)},S=(k,E="api")=>{const L=n==null?void 0:n.clipboard.convert(k);L&&(n==null||n.setContents(L,E))},N=()=>{n==null||n.focus()},T=()=>{zt(()=>{var k;!t.slots.toolbar&&n&&((k=n.getModule("toolbar"))===null||k===void 0||k.container.remove()),o()})};return St(()=>e.content,k=>{if(!n||!k||c(k))return;const E=n.getSelection();E&&zt(()=>n==null?void 0:n.setSelection(E)),C(k)},{deep:!0}),St(()=>e.enable,k=>{n&&n.enable(k)}),{editor:i,getEditor:m,getToolbar:d,getQuill:v,getContents:_,setContents:C,getHTML:A,setHTML:I,pasteHTML:S,focus:N,getText:y,setText:w,reinit:T}},render(){var e,t;return[(t=(e=this.$slots).toolbar)===null||t===void 0?void 0:t.call(e),Bd("div",{ref:"editor",...this.$attrs})]}}),f2={class:"input"},d2=["for","data-test-id"],h2=["data-test-id"],p2=He({__name:"RichTextEditor",props:{modelValue:{type:String,default:""},editorOptions:{type:Object,default:()=>({modules:{toolbar:["bold","italic","underline",{align:[]},{list:"ordered"},{list:"bullet"}]},placeholder:"Add AI Instructions",theme:"snow"})},dataTestId:{type:String,default:""},label:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["update:modelValue"],setup(e){const t=e,n=be(()=>typeof t.error=="string"?t.error:t.error===""?!1:t.error===!0?`${t.label||"Field"} is required`:t.error),r=ae("");return xn(()=>{r.value=t.modelValue}),(i,o)=>(X(),ne("div",f2,[e.label?(X(),ne("label",{key:0,class:Ie({error_color:!!e.error}),for:e.label,"data-test-id":`${e.dataTestId}-label`},[Ve(ve(e.label)+" ",1),e.required?(X(),ne("span",{key:0,class:Ie({error_color:!!e.error})},"*",2)):ye("",!0)],10,d2)):ye("",!0),_e(Me(u2),{"content-type":"html",toolbar:e.editorOptions,"model-value":e.modelValue,"data-test-id":e.dataTestId,content:r.value,"onUpdate:content":o[0]||(o[0]=a=>i.$emit("update:modelValue",a))},null,8,["toolbar","model-value","data-test-id","content"]),n.value?(X(),ne("div",{key:1,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${e.dataTestId}-error`},ve(n.value),9,h2)):ye("",!0)]))}},[["__scopeId","data-v-76aecac0"]]),g2={class:"ect-w-full ect-flex ect-flex-col ect-gap-4 ect-p-4 ect-rounded-md ect-border-1 ect-border-gray-200 md:ect-gap-5 lg:ect-gap-6","data-test-id":"configurator-inputs-container"},m2={key:0,class:"ect-text-sm ect-font-regular ect-text-gray-900"},v2={class:"ect-grid ect-grid-cols-1 sm:ect-grid-cols-2 ect-gap-4"},y2={key:0,class:"ect-col-span-2"},_2=["data-test-id"],b2=["id","onUpdate:modelValue","disabled","data-test-id"],C2=["for","data-test-id"],w2={key:2,class:"quill-editor-styles"},x2=b("div",{class:"dropdowntp"},null,-1),k2=b("div",{id:"modals"},null,-1),Xc={__name:"InputsContainer",props:{title:{type:String,default:""},lookup:{type:Object,default:()=>null},attributes:{type:Array,required:!0,default:()=>[]},locale:{type:String,default:"en-US"}},setup(e){const t=ln(),n=e,r=ae({modules:{toolbar:["bold","italic","underline",{align:[]},{list:"ordered"},{list:"bullet"}]},placeholder:"Add AI Instructions",theme:"snow"}),i=ae(n.lookup),o=be(()=>{const l=n.lookup.relatedFields.map(h=>h.child);return l.push("Name"),l});function a(l,h){const c=h.options.find(f=>f.Id===l);l===null?(h.options=[],h.value=null,h.relatedFields.forEach(f=>{f.value=null})):(h.value=c.Name,h.relatedFields.forEach(f=>{f.value=c[f.child]}))}const s=xc(async function(l,h){h.loading=!0;const c={objectType:h.referenceObject,searchText:l||"",lstFields:o.value||[]},f=await t.getRecords(c);h.options=f,h.loading=!1});return(l,h)=>(X(),ne(Oe,null,[b("div",g2,[e.title?(X(),ne("div",m2,ve(e.title),1)):ye("",!0),b("div",v2,[i.value?(X(),ne("div",y2,[_e(Lc,{modelValue:i.value.referenceRecordId,"onUpdate:modelValue":[h[0]||(h[0]=c=>i.value.referenceRecordId=c),h[1]||(h[1]=c=>a(c,i.value))],"data-test-id":`configurator-inputs-lookup-${i.value.attRecordId??l.index}`,label:i.value.label,options:i.value.options,disabled:!i.value.editable,required:i.value.required,loading:i.value.loading,property:{key:"Id",value:"Name"},lookup:"",search:"",highlight:"",onSearch:h[2]||(h[2]=c=>Me(s)(c,i.value))},null,8,["modelValue","data-test-id","label","options","disabled","required","loading"])])):ye("",!0),(X(!0),ne(Oe,null,Ke(e.attributes,(c,f)=>(X(),ne("div",{key:f,class:"attribute-input"},[c.dataType==="PICKLIST"||c.dataType==="MULTIPICKLIST"?(X(),Te(Lc,{key:0,modelValue:c.value,"onUpdate:modelValue":u=>c.value=u,label:c.label,placeholder:c.label,disabled:!c.editable,options:c.picklistValues.map(u=>({label:u,value:u})),select:"",highlight:"","data-test-id":`configurator-inputs-dropdown-${c.attRecordId??l.index}`},null,8,["modelValue","onUpdate:modelValue","label","placeholder","disabled","options","data-test-id"])):c.dataType==="BOOLEAN"?(X(),ne("div",{key:1,class:"ect-flex ect-items-center ect-gap-3 ect-py-3.5","data-test-id":`configurator-inputs-checkbox-${c.attRecordId??l.index}`},[wn(b("input",{id:`checkbox-${c.attRecordId??l.index}`,"onUpdate:modelValue":u=>c.value=u,type:"checkbox",disabled:!c.editable,class:"ect-w-4 ect-h-4 ect-accent-success ect-border-gray-300 ect-rounded ect-text-text-success focus:ect-ring-green-500","data-test-id":`configurator-inputs-checkbox-input-${c.attRecordId??l.index}`},null,8,b2),[[ma,c.value]]),b("label",{for:`checkbox-${c.attRecordId??l.index}`,class:"ect-text-sm ect-font-medium ect-text-gray-900 ect-cursor-pointer","data-test-id":`configurator-inputs-checkbox-label-${c.attRecordId??l.index}`},ve(c.label),9,C2)],8,_2)):c.dataType==="TEXTAREA"?(X(),ne("div",w2,[_e(p2,{modelValue:c.value,"onUpdate:modelValue":u=>c.value=u,label:c.label,required:c.required,"editor-options":r.value,"data-test-id":`configurator-inputs-textarea-quill-editor-${c.attRecordId??l.index}`},null,8,["modelValue","onUpdate:modelValue","label","required","editor-options","data-test-id"])])):(X(),Te(k9,{key:3,modelValue:c.value,"onUpdate:modelValue":u=>c.value=u,label:c.label,disabled:!c.editable,highlight:"","data-test-id":`configurator-inputs-custom-${c.attRecordId??l.index}`},null,8,["modelValue","onUpdate:modelValue","label","disabled","data-test-id"]))]))),128))])]),x2,k2],64))}},E2={class:"ect-w-full ect-flex ect-flex-col ect-gap-4","data-test-id":"configurator-inputs-container"},O2={class:"ect-bg-white ect-rounded-lg"},La={__name:"AttributesContainer",props:{attributes:{type:Array,required:!0,default:()=>[]},locale:{type:String,default:"en-US"}},setup(e){const t=e,n=ae([]),r=ae([]),i=ae({});return xn(()=>{const o={},a=[...t.attributes];a.forEach(l=>{l.dataType==="REFERENCE"&&(i.value[l.apiName]=["Name"],l.relatedFields=[],o[l.apiName]=l),l.editable=l.editable&&!l.apiName.includes(".")});let s=null;a.forEach(l=>{if(l.referenceObject==="XX_Base__Location__c"&&(s?l.firstLookup="Copy from "+s.label:s=l),l.apiName.includes(".")){const[h,c]=l.apiName.split(".");l.parent=h,l.child=c,i.value[h]!=null&&(i.value[h].push(c),o[h].relatedFields.push(l))}}),r.value=a.filter(l=>l.dataType==="REFERENCE"),n.value=a.filter(l=>!(l.apiName.includes(".")||l.dataType==="REFERENCE"))}),(o,a)=>(X(),ne("div",E2,[b("div",O2,[_e(Xc,{attributes:n.value},null,8,["attributes"])]),(X(!0),ne(Oe,null,Ke(r.value,s=>(X(),ne("div",{key:s.attRecordId,class:"ect-bg-white ect-rounded-lg"},[_e(Xc,{title:s.referenceLabel+" Lookup",lookup:s,attributes:s.relatedFields},null,8,["title","lookup","attributes"])]))),128))]))}},S2={class:"ect-px-6 ect-pt-4 ect-pb-6 ect-w-full ect-text-sm ect-leading-none ect-text-neutral-700 ect-max-md:max-w-full"},I2=b("p",{class:"ect-m-1 ect-text-sm ect-font-regular ect-leading-5 ect-text-neutral-700"},"You Selected",-1),A2={class:"ect-flex ect-items-center ect-justify-between ect-rounded-lg ect-px-4 ect-py-2 ect-gap-2 ect-bg-light-bg-x"},T2={class:"ect-mt-1 ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700"},N2={class:"ect-mt-1 ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700"},P2={class:"ect-mt-1 ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700"},L2={class:"ect-px-6 ect-pt-4 ect-pb-6 ect-w-full ect-bg-light-bg-x ect-max-md:max-w-full"},R2={class:"ect-flex ect-justify-end ect-gap-2 ect-p-4"},M2={__name:"AttributesModal",props:{option:{type:Object,required:!0},attributes:{type:Array,required:!0}},emits:["close","done"],setup(e,{emit:t}){const n=t,r=e,i=be(()=>JSON.parse(JSON.stringify(r.attributes))),o=()=>{n("close")},a=()=>{n("done",i.value),n("close")};return(s,l)=>(X(),Te(Ca,{header:"",title:"Update Attributes Values",description:"Update the values associated with selected attributes.",footer:"","no-close":"",onClose:o},{content:Be(()=>[b("header",S2,[I2,b("div",A2,[b("p",T2,ve(e.option.itemName),1),b("p",N2,ve(e.option.qty),1),b("p",P2,ve(e.option.price),1)])]),b("main",L2,[_e(La,{attributes:i.value},null,8,["attributes"])])]),footer:Be(()=>[b("div",R2,[_e(Pt,{class:"ect-min-w-[100px]",btype:"secondary","button-style":"outlined",size:"medium","data-test-id":"attributes-modal-button-cancel",onClick:l[0]||(l[0]=h=>n("close"))},{default:Be(()=>[Ve("Cancel")]),_:1}),_e(Pt,{class:"ect-min-w-[100px]",btype:"primary","button-style":"primary",size:"medium","data-test-id":"attributes-modal-button-done",onClick:a},{default:Be(()=>[Ve("Done")]),_:1})])]),_:1}))}},q2=["data-test-id"],j2=["data-test-id"],D2=["data-test-id"],B2={class:"ect-bg-white ect-rounded-xl ect-shadow-sm"},$2={class:"ect-relative ect-w-full ect-border-b ect-border-solid ect-border-b-neutral-200 max-md:ect-max-w-full"},F2={key:0,class:"ect-flex ect-z-0 ect-flex-col ect-gap-4 ect-justify-center ect-py-4 ect-px-6 ect-w-full max-md:ect-px-5 max-md:ect-max-w-full"},V2={class:"ect-gap-1 ect-w-full max-md:ect-max-w-full"},H2={class:"ect-text-lg ect-font-semibold ect-leading-5 ect-text-neutral-700 max-md:ect-max-w-full"},U2={key:0,class:"ect-mt-1 ect-text-sm ect-leading-none ect-text-zinc-600 max-md:ect-max-w-full"},z2={class:"ect-flex ect-overflow-hidden ect-absolute ect-top-2.5 ect-right-4 ect-z-0 ect-p-1 ect-rounded-lg"},K2={key:0,class:"ect-flex-1 ect-overflow-y-auto ect-h-[600px] ect-max-h-[70vh]"},Z2={key:1,class:"ect-px-6 ect-pt-4 ect-pb-6 ect-w-full ect-text-xs ect-leading-4 ect-text-neutral-700 max-md:ect-px-5 max-md:ect-max-w-full"},Q2={key:2,class:"ect-relative ect-w-full ect-border-t ect-border-solid ect-border-t-neutral-200 max-md:ect-max-w-full"},X2=He({__name:"AppModalGen3",props:{title:{type:String,required:!0},description:{type:String,required:!0},header:{type:Boolean,default:!1},footer:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:t}){const n=t;return(r,i)=>(X(),Te(wc,{to:"modaltp"},{default:Be(()=>[b("div",{class:"modal-mask","data-test-id":`${r.dataTestId}-mask`},[b("div",{class:"modal-wrapper","data-test-id":`${r.dataTestId}-wrapper`},[b("div",{class:"modal-container",style:tt(r.width?`max-width: ${r.width.includes("calc")?r.width:r.width+"px"}; width: 100%;`:""),"data-test-id":`${r.dataTestId}-container`},[b("div",B2,[b("div",$2,[e.header?(X(),ne("div",F2,[b("div",V2,[b("div",H2,ve(e.title),1),e.description?(X(),ne("div",U2,ve(e.description),1)):ye("",!0)])])):ye("",!0),b("div",z2,[b("button",{class:"ect-flex ect-self-stretch ect-my-auto ect-w-6 ect-min-h-6 ect-cursor-pointer hover:ect-bg-gray-100 ect-rounded ect-transition-colors ect-justify-center ect-items-center","aria-label":"Close modal",onClick:i[0]||(i[0]=o=>n("close"))},[_e(Ge,{icon:"close",color:"#000000",size:"11",height:"11"})])])]),r.$slots.content?(X(),ne("div",K2,[Qe(r.$slots,"content",{},void 0,!0)])):(X(),ne("div",Z2,[Qe(r.$slots,"default",{},void 0,!0)])),e.footer?(X(),ne("div",Q2,[Qe(r.$slots,"footer",{},void 0,!0)])):ye("",!0)])],12,D2)],8,j2)],8,q2)]),_:3}))}},[["__scopeId","data-v-41ebff01"]]),Fn=e=>(er("data-v-d109b9d7"),e=e(),tr(),e),J2={class:"ect-w-[600px]"},W2={class:"ect-px-6 ect-pt-4 ect-w-full ect-text-sm ect-leading-none ect-text-neutral-700 ect-max-md:max-w-full"},G2=Fn(()=>b("p",{class:"ect-m-1 ect-text-sm ect-font-regular ect-leading-5 ect-text-neutral-700"},"You Selected",-1)),Y2={class:"ect-flex ect-items-center ect-justify-between ect-rounded-lg ect-px-4 ect-py-2 ect-gap-2 ect-bg-light-bg-x"},e6={class:"ect-mt-1 ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700"},t6={class:"ect-mt-1 ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700"},n6={class:"ect-mt-1 ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700"},r6={class:"ect-px-6 ect-pt-4 ect-pb-6 ect-mt-4 ect-w-full ect-bg-light-bg-x ect-max-md:max-w-full"},i6=Fn(()=>b("p",{class:"ect-text-xs ect-font-medium ect-leading-6 ect-text-neutral-700 ect-mb-3","data-test-id":"conflict-modal-supporting-text"}," Above selection requires a configuration change ",-1)),o6={class:"ect-flex ect-flex-col ect-gap-2"},a6={key:0,class:"ect-bg-white ect-border ect-border-neutral-200 ect-rounded-md","data-test-id":"conflict-modal-add-table"},s6=Fn(()=>b("div",{class:"ect-px-4 ect-py-2"},[b("p",{class:"ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700","data-test-id":"conflict-modal-add-header"}," This change will add: ")],-1)),l6={class:"ect-flex-grow font-regular","data-test-id":"conflict-modal-add-product"},c6={class:"ect-w-20 ect-text-center font-regular","data-test-id":"conflict-modal-add-qty"},u6={class:"ect-w-28 ect-text-right font-regular","data-test-id":"conflict-modal-add-price"},f6={key:1,class:"ect-bg-white ect-border ect-border-neutral-200 ect-rounded-md","data-test-id":"conflict-modal-remove-table"},d6=Fn(()=>b("div",{class:"ect-px-4 ect-py-2"},[b("p",{class:"ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700","data-test-id":"conflict-modal-remove-header"}," This change will remove: ")],-1)),h6={class:"ect-flex-grow font-regular","data-test-id":"conflict-modal-remove-product"},p6={class:"ect-w-20 ect-text-center font-regular","data-test-id":"conflict-modal-remove-qty"},g6={class:"ect-w-28 ect-text-right font-regular","data-test-id":"conflict-modal-remove-price"},m6={class:"ect-flex ect-justify-between ect-items-center ect-px-4 ect-py-1 ect-w-full ect-text-sm ect-leading-none ect-text-neutral-700 ect-bg-white ect-rounded-md ect-border ect-border-neutral-200 ect-rounded-md"},v6=Fn(()=>b("p",{class:"ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700","data-test-id":"conflict-modal-price-change-label"}," Price change ",-1)),y6={class:"ect-text-sm ect-font-semibold ect-leading-5","data-test-id":"conflict-modal-price-change-value"},_6={class:"ect-px-6 ect-pt-4 ect-pb-6 ect-w-full"},b6=Fn(()=>b("p",{class:"ect-text-xs ect-font-medium ect-leading-6 ect-text-neutral-500 ect-mb-2","data-test-id":"conflict-modal-summary-supporting-text"}," Price Adjustment Summary ",-1)),C6={class:"ect-border ect-border-neutral-200 ect-rounded-md ect-overflow-hidden ect-mt-2 ect-bg-neutral-50","data-test-id":"conflict-modal-summary-table"},w6={class:"ect-flex ect-flex-col ect-gap-2"},x6={class:"ect-flex-1"},k6={class:"font-regular","data-test-id":"conflict-modal-summary-base-price-label"},E6={class:"ect-text-center ect-w-28"},O6={class:"ect-text-sm ect-font-medium ect-leading-5 ect-text-neutral-700 ect-text-right ect-line-through","data-test-id":"conflict-modal-summary-base-price-original"},S6={class:"ect-text-center ect-w-28"},I6={class:"ect-text-sm ect-font-semibold ect-leading-5 ect-text-text-success ect-text-right","data-test-id":"conflict-modal-summary-base-price-adjusted"},A6={class:"ect-border ect-border-neutral-200 ect-rounded-md ect-overflow-hidden ect-px-4 ect-py-1 ect-mt-2","data-test-id":"conflict-modal-summary-total"},T6={class:"ect-flex ect-items-center"},N6=Fn(()=>b("div",{class:"ect-flex-1"},[b("p",{class:"ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700","data-test-id":"conflict-modal-summary-total-label"}," Total Price change ")],-1)),P6={class:"ect-text-center ect-w-28"},L6={class:"ect-text-sm ect-font-medium ect-leading-5 ect-text-neutral-700 ect-text-right ect-line-through","data-test-id":"conflict-modal-summary-base-price-original"},R6={class:"ect-text-center ect-w-28"},M6={class:"ect-text-sm ect-font-semibold ect-leading-5 ect-text-text-success ect-text-right","data-test-id":"conflict-modal-summary-base-price-adjusted"},q6={class:"ect-flex ect-justify-end ect-gap-2 ect-p-4"},j6=He({__name:"ConflictModal",props:{item:{type:Object,required:!0},data:{type:Object,required:!0}},emits:["close","done"],setup(e,{emit:t}){const n=ln(),r=t,i=e,o=be(()=>{const p=n.summaryPrices,m=[];return m.push({label:"Base Price",value:p.basePrice,priceChange:p.basePrice}),m.push({label:"Add Ons",value:p.addOns,priceChange:p.addOns+f.value}),m}),a=be(()=>{const p=n.summaryPrices;return{label:"Total Price",value:p.total,priceChange:p.total+f.value}}),s=be(()=>i.data.inclusions.map(m=>n.optionByPublishKey.get(m))),l=be(()=>s.value.filter(p=>p.itemId!==i.item.itemId)),h=be(()=>i.data.exclusions.map(p=>n.optionByPublishKey.get(p))),c=be(()=>h.value.filter(p=>p.itemId!==i.item.itemId)),f=be(()=>s.value.reduce((p,m)=>p+m.price,0)-h.value.reduce((p,m)=>p+m.price,0)),u=()=>{r("close")},g=()=>{r("done")};return(p,m)=>(X(),Te(X2,{header:"",title:"Confirm Your Selection",description:"This selection requires a configuration change",footer:"","no-close":"",onClose:u},{content:Be(()=>[b("div",J2,[b("header",W2,[G2,b("div",Y2,[b("p",e6,ve(e.item.itemName),1),b("p",t6,ve(e.item.qty),1),b("p",n6,ve(Me(It)(e.item.price)),1)])]),b("main",r6,[i6,b("div",o6,[l.value.length>0?(X(),ne("div",a6,[s6,(X(!0),ne(Oe,null,Ke(l.value,d=>(X(),ne("div",{key:d.itemId,class:"ect-flex ect-items-center ect-py-2 ect-px-4 ect-border-t ect-border-neutral-200"},[b("p",l6,ve(d.itemName),1),b("p",c6,ve(d.qty),1),b("p",u6," + "+ve(Me(It)(d.price)),1)]))),128))])):ye("",!0),c.value.length>0?(X(),ne("div",f6,[d6,(X(!0),ne(Oe,null,Ke(c.value,d=>(X(),ne("div",{key:d.itemId,class:"ect-flex ect-items-center ect-py-2 ect-px-4 ect-border-t ect-border-neutral-200"},[b("p",h6,ve(d.itemName),1),b("p",p6,ve(d.qty),1),b("p",g6," - "+ve(Me(It)(d.price)),1)]))),128))])):ye("",!0),b("div",m6,[v6,b("p",y6,ve(Me(It)(f.value)),1)])])]),b("footer",null,[b("div",_6,[b6,b("div",C6,[b("div",w6,[(X(!0),ne(Oe,null,Ke(o.value,(d,v)=>(X(),ne("div",{key:d.label,class:Ie(["ect-flex ect-px-4 ect-py-1",{"ect-border-t ect-border-neutral-200":v>0}])},[b("div",x6,[b("p",k6,ve(d.label),1)]),b("div",E6,[b("p",O6,ve(Me(It)(d.value)),1)]),b("div",S6,[b("p",I6,ve(Me(It)(d.priceChange)),1)])],2))),128))])]),b("div",A6,[b("div",T6,[N6,b("div",P6,[b("p",L6,ve(Me(It)(a.value.value)),1)]),b("div",R6,[b("p",M6,ve(Me(It)(a.value.priceChange)),1)])])])])])])]),footer:Be(()=>[b("div",q6,[_e(Pt,{class:"ect-min-w-[100px]",btype:"secondary","button-style":"outlined",size:"medium","data-test-id":"conflict-modal-button-cancel",onClick:m[0]||(m[0]=d=>r("close"))},{default:Be(()=>[Ve("Cancel")]),_:1}),_e(Pt,{class:"ect-min-w-[100px]",btype:"primary","button-style":"primary",size:"medium","data-test-id":"conflict-modal-button-done",onClick:g},{default:Be(()=>[Ve("Done")]),_:1})])]),_:1}))}},[["__scopeId","data-v-d109b9d7"]]),D6={class:"ect-flex ect-flex-col"},B6=["onUpdate:modelValue","data-test-id","value","disabled","onChange"],$6=["onUpdate:modelValue","data-test-id","value","disabled","onChange"],F6={key:0},V6={key:1,class:"ect-border-t ect-border-gray-200 ect-p-4"},H6={__name:"ConfiguratorTabSections",props:{data:{type:Object,required:!0}},setup(e){const t=ln(),n=e,r=be(()=>n.data.itemTypes||[]),i=be(()=>n.data.showImage||!1),o=ae(null),a=ae({});let s=ae(null),l=ae(null);const h=(p,m)=>{p.qty=m},c=(p,m)=>{p.itemName=m},f=()=>{t.configuration.categoryOptions.forEach(p=>{p.itemTypes.forEach(m=>{m.options.forEach(d=>{t.configuration.sysGuidedOptions&&(o.value.hidden.includes(d.relationshipInfo.publishKey)?d.hidden=!0:d.hidden=!1),o.value.inclusions.includes(d.relationshipInfo.publishKey)&&!m.selected.includes(d.itemId)&&m.selected.push(d.itemId),o.value.exclusions.includes(d.relationshipInfo.publishKey)&&m.selected.includes(d.itemId)&&m.selected.splice(m.selected.indexOf(d.itemId),1)})})}),o.value=null,a.value=null},u=async(p,m,d,v)=>{if(p.preventDefault(),p.stopPropagation(),s.value=null,l.value=null,m.calculateRules){v&&v.isRadio?d.includes(m.itemId)?(d.splice(0,d.length),l.value=m.relationshipInfo.publishKey):(d.splice(0,d.length),d.push(m.itemId),s.value=m.relationshipInfo.publishKey):d.includes(m.itemId)?(d.splice(d.indexOf(m.itemId),1),l.value=m.relationshipInfo.publishKey):(d.push(m.itemId),s.value=m.relationshipInfo.publishKey);const _=l.value?m:null,C=s.value?m:null,y=await t.evaluateConfigSelection(_,C);y.inclusions.length>0||y.exclusions.length>0?(o.value=y,a.value=m,[...y.inclusions,...y.exclusions].includes(m.relationshipInfo.publishKey)||(s.value&&o.value.exclusions.push(s.value),l.value&&o.value.inclusions.push(l.value))):(o.value=y,s.value&&o.value.exclusions.push(s.value),l.value&&o.value.inclusions.push(l.value),f())}},g=(p,m,d,v)=>{p.target.type==="checkbox"||p.target.type==="radio"||(p.preventDefault(),p.stopPropagation(),v.isRadio?d.includes(m.itemId)?d.splice(0,d.length):(d.splice(0,d.length),d.push(m.itemId)):d.includes(m.itemId)?d.splice(d.indexOf(m.itemId),1):d.push(m.itemId),u(p,m,d,v))};return(p,m)=>(X(),ne(Oe,null,[o.value?(X(),Te(j6,{key:0,item:a.value,data:o.value,onClose:m[0]||(m[0]=d=>o.value=null),onDone:f},null,8,["item","data"])):ye("",!0),b("div",D6,[(X(!0),ne(Oe,null,Ke(r.value,d=>(X(),Te(bh,{key:d.itemTypeId,title:d.itemTypeName,description:d.description,message:d.isRadio?d.selected?"":d.minMessage:d.selected.length<d.minNumber?d.minMessage:d.selected.length===d.maxNumber?d.maxMessage:""},{default:Be(()=>[b("div",{class:Ie([d.numberOfColumns===1?"ect-space-y-3 md:ect-space-y-4 ect-p-2 md:ect-p-4":d.numberOfColumns===2?"ect-grid ect-grid-cols-1 md:ect-grid-cols-2 ect-gap-3 md:ect-gap-4 ect-p-2 md:ect-p-4":"ect-grid ect-grid-cols-1 md:ect-grid-cols-2 lg:ect-grid-cols-3 ect-gap-3 md:ect-gap-4 ect-p-2 md:ect-p-4"])},[(X(!0),ne(Oe,null,Ke(d.options||[],v=>(X(),ne(Oe,{key:v.itemId},[v.hidden?ye("",!0):(X(),Te(p9,{key:0,item:v,name:v.itemName,description:v.description||"","min-quantity":d.minQuantity,"max-quantity":d.maxQuantity,"show-image":i.value,selected:d.selected.includes(v.itemId),tags:v.getTags(),price:v.price,quantity:v.qty,"image-url":v.defaultImageURL,attributes:v.attributes||[],size:d.numberOfColumns,"item-id":v.itemId,"item-type":d.itemTypeName||"",category:d.category,"relationship-info":v.relationshipInfo||{},option:Me(t).optionByItemId.get(v.itemId),"is-attributes":v.isAttributes,"show-attributes":d.lightboxAttributes,disabled:v.isDisabled,"onUpdate:quantity":_=>h(v,_),"onUpdate:name":_=>c(v,_),onEditAttributes:_=>v.showAttributesModal=!0,onClick:_=>d.selected.includes(v.itemId)||v.isDisabled?null:g(_,v,d.selected,d)},{"selection-control":Be(()=>[d.isRadio?wn((X(),ne("input",{key:0,"onUpdate:modelValue":_=>d.selected[0]=_,"data-test-id":`configurator-${d.itemTypeId}-radio-${v.itemId}`,class:"ect-accent-success ect-w-5 ect-h-5",type:"radio",value:v.itemId,disabled:v.isDisabled,onClick:m[1]||(m[1]=Nt(()=>{},["stop"])),onChange:_=>u(_,v,d.selected,d)},null,40,B6)),[[pc,d.selected[0]]]):wn((X(),ne("input",{key:1,"onUpdate:modelValue":_=>d.selected=_,"data-test-id":`configurator-${d.itemTypeId}-checkbox-${v.itemId}`,class:"ect-accent-success ect-w-5 ect-h-5",type:"checkbox",value:v.itemId,disabled:v.isDisabled,onClick:m[2]||(m[2]=Nt(()=>{},["stop"])),onChange:_=>u(_,v,d.selected,d)},null,40,$6)),[[ma,d.selected]])]),default:Be(()=>[d.lightboxAttributes?(X(),ne("div",F6,[v.showAttributesModal?(X(),Te(M2,{key:0,option:v,attributes:v.attributes,onDone:_=>v.attributes=_,onClose:_=>v.showAttributesModal=!1},null,8,["option","attributes","onDone","onClose"])):ye("",!0)])):(X(),ne("div",V6,[_e(La,{attributes:v.attributes},null,8,["attributes"])]))]),_:2},1032,["item","name","description","min-quantity","max-quantity","show-image","selected","tags","price","quantity","image-url","attributes","size","item-id","item-type","category","relationship-info","option","is-attributes","show-attributes","disabled","onUpdate:quantity","onUpdate:name","onEditAttributes","onClick"]))],64))),128))],2)]),_:2},1032,["title","description","message"]))),128))])],64))}},U6=e=>(er("data-v-cb7a75a9"),e=e(),tr(),e),z6={class:"ect-space-y-4"},K6={class:"ect-w-full ect-bg-white ect-border ect-border-ect-gray-200 ect-rounded-lg"},Z6={class:"ect-bg-white ect-border-b ect-border-ect-gray-200 ect-px-4 ect-py-4 ect-sticky ect-top-0 ect-z-[5] ect-overflow-hidden ect-rounded-t-lg"},Q6={class:"ect-text-sm ect-font-semibold ect-text-green-700","data-test-id":"configurator-summary-header-title"},X6={class:"ect-bg-white ect-px-4 ect-py-4 ect-pb-3 ect-border-b ect-border-ect-gray-200 ect-top-[53px] ect-z-9 ect-overflow-hidden ect-sticky ect-top-[53px]"},J6={class:"ect-text-sm ect-font-medium ect-text-ect-gray-800","data-test-id":"configurator-summary-section-frame-color"},W6={class:"ect-flex ect-items-center ect-bg-light-bg-x ect-border-b ect-border-ect-gray-200"},G6={class:"ect-flex-1 ect-bg-ect-gray-50 ect-px-8 ect-py-4 ect-min-h-[56px] ect-flex ect-items-center"},Y6={class:"ect-text-sm ect-text-font-clr-light","data-test-id":"configurator-summary-item-red"},e4={class:"ect-flex ect-items-center ect-px-8 ect-py-4 ect-gap-5"},t4={class:"ect-flex ect-justify-center ect-min-w-[128px]"},n4=U6(()=>b("div",{class:"ect-border-r ect-w-[1px] ect-border-text-muted-light ect-h-6"},null,-1)),r4={class:"ect-flex ect-justify-center ect-min-w-[100px]"},i4={class:"ect-text-sm ect-font-semibold ect-text-ect-gray-800","data-test-id":"configurator-summary-price-red"},o4={key:0,class:"ect-flex ect-items-center ect-bg-light-bg-x ect-px-10 ect-py-3"},a4={class:"ect-flex ect-flex-wrap ect-items-center ect-bg-light-bg-x ect-gap-2"},s4={class:"ect-bg-white ect-px-8 ect-py-4 ect-pr-4 ect-flex ect-justify-end"},l4={class:"ect-text-sm ect-font-semibold ect-text-ect-gray-800","data-test-id":"configurator-summary-total"},c4=He({__name:"ConfiguratorSummaryTab",props:{summary:{type:Array,required:!0}},setup(e){return(t,n)=>(X(),ne("div",z6,[(X(!0),ne(Oe,null,Ke(e.summary,r=>(X(),ne("div",{key:r.key,class:"ect-mb-4"},[b("section",K6,[b("div",Z6,[b("h3",Q6,ve(r.category),1)]),(X(!0),ne(Oe,null,Ke(r.selectedItemTypes,i=>(X(),ne("div",{key:i.itemTypeId,class:"ect-flex ect-flex-col ect-border-b ect-border-ect-gray-200"},[b("div",X6,[b("h4",J6,ve(i.itemTypeName),1)]),(X(!0),ne(Oe,null,Ke(i.selectedOptions,o=>(X(),ne(Oe,{key:o.itemId},[b("div",W6,[b("div",G6,[b("span",Y6,ve(o.itemName),1)]),b("div",e4,[b("div",t4,[_e(Ki,{value:o.qty,"onUpdate:value":a=>o.qty=a,min:i.minQuantity,max:i.maxQuantity,"data-test-id":`configurator-summary-counter-${o.itemId}`},null,8,["value","onUpdate:value","min","max","data-test-id"])]),n4,b("div",r4,[b("span",i4,ve(Me(It)(o.price)),1)])])]),o.isAttributes&&o.getTags().length>0?(X(),ne("div",o4,[b("div",a4,[(X(!0),ne(Oe,null,Ke(o.getTags(),a=>(X(),Te(Qt,{key:a.attributeId,label:a.label,value:a.value},null,8,["label","value"]))),128))])])):ye("",!0)],64))),128))]))),128)),b("div",s4,[b("span",l4," Total : "+ve(Me(It)(r.totalPrice())),1)])])]))),128))]))}},[["__scopeId","data-v-cb7a75a9"]]),u4={class:"configurator-page ect-flex ect-flex-col ect-h-full","data-test-id":"configurator-page-container"},f4={"data-test-id":"configurator-tabs-container",class:"ect-bg-white ect-shadow-sm ect-flex-shrink-0 ect-mb-4"},d4={class:"ect-bg-white ect-border-t ect-border-gray-200 ect-flex-shrink-0 ect-absolute ect-bottom-0 ect-w-full ect-h-[66px]","data-test-id":"configurator-footer-sticky"},h4=He({__name:"ConfiguratorTabs",emits:["scroll"],setup(e,{emit:t}){const n=ln(),r=ae("billing-options"),i=be(()=>n.configuration.categoryOptions),o=be(()=>{const u=i.value.map(g=>({key:g.key,title:g.category}));return u.push({key:"summary",title:"Summary"}),u}),a=t,s=be(()=>l.value.get(r.value)),l=be(()=>{const u=new Map;return i.value.forEach(g=>{u.set(g.key,g)}),u}),h=()=>{console.info("Continue");const u=o.value.findIndex(g=>g.key===r.value);if(u<o.value.length-1){const g=o.value[u+1];r.value=g.key}else n.maintainQuoteConfiguration()};St(r,u=>{c(u),a("scroll",0)});const c=u=>{r.value=u},f=u=>{const g=u.target.scrollTop;a("scroll",g)};return xn(()=>{r.value=o.value[0].key}),(u,g)=>(X(),ne("div",u4,[b("div",f4,[_e(Y5,{modelValue:r.value,"onUpdate:modelValue":g[0]||(g[0]=p=>r.value=p),"show-tabs":!0,border:"",tabs:o.value,"data-test-id":"configurator-tabs-container",onTabChange:c},null,8,["modelValue","tabs"])]),r.value!=="summary"?(X(),ne("div",{key:0,class:"ect-flex-1 ect-min-h-0 ect-overflow-y-auto ect-p-4 ect-pt-0 ect-pb-12","data-test-id":"`configurator-${activeTab}-tab-content`",onScroll:f},[_e(H6,{data:s.value},null,8,["data"])],32)):(X(),ne("div",{key:1,class:"ect-flex-1 ect-min-h-0 ect-overflow-y-auto ect-p-4 ect-pt-0 ect-pb-12","data-test-id":"`configurator-${activeTab}-tab-content`",onScroll:f},[_e(c4,{summary:Me(n).summary},null,8,["summary"])],32)),b("div",d4,[_e(fh,{"btn-text":r.value!=="summary"?"Continue":"Save",item:Me(n).configuration,onContinue:h},null,8,["btn-text","item"])])]))}},[["__scopeId","data-v-288b29ad"]]),p4={class:"ect-px-6 ect-pt-4 ect-pb-2 ect-bg-white"},g4={class:"ect-flow-root"},m4=["src","alt"],v4={key:1,class:"ect-mb-2"},y4={class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed ect-transition-all ect-duration-400"},_4={key:0,class:"ect-mt-2"},b4={class:"ect-inline-block ect-mb-2"},C4={key:1,class:"ect-inline-block ect-mb-2"},w4={key:1,class:"ect-mt-2"},x4={__name:"ConfiguratorInfo",props:{config:{type:Object,required:!0},editAttributes:{type:Boolean,required:!0},scroll:{type:Number,default:0}},emits:["edit-attributes"],setup(e,{emit:t}){const n=e,r=t,i=be(()=>n.config.attributes.map(o=>({label:o.label,value:o.value})).filter(o=>o.value!==null&&o.value!==""));return(o,a)=>(X(),ne("div",p4,[b("div",g4,[e.config.defaultImageURL&&e.scroll<50?(X(),ne("div",{key:0,class:Ie(["ect-bg-gray-200 ect-rounded-lg ect-overflow-hidden ect-float-left ect-mr-4 ect-mb-2",e.editAttributes?"ect-w-[40px] ect-h-[40px]":"ect-w-[104px] ect-h-[104px]"])},[e.config.defaultImageURL?(X(),ne("img",{key:0,src:e.config.defaultImageURL,alt:e.config.itemName,class:"ect-w-full ect-h-full ect-object-cover"},null,8,m4)):ye("",!0)],2)):ye("",!0),e.scroll<50?(X(),ne("div",v4,[b("p",y4,ve(e.config.description),1)])):ye("",!0),e.config.isAttributes?(X(),ne(Oe,{key:2},[e.editAttributes?(X(),ne("div",w4,[_e(La,{attributes:e.config.attributes},null,8,["attributes"])])):(X(),ne("div",_4,[i.value.length>0?(X(),ne(Oe,{key:0},[(X(!0),ne(Oe,null,Ke(i.value,(s,l)=>(X(),ne("span",{key:l,class:"ect-inline-block ect-mr-2 ect-mb-2"},[_e(Qt,{label:s.label,value:s.value},null,8,["label","value"])]))),128)),b("span",b4,[b("button",{"data-test-id":"configurator-info-button-edit-attributes",onClick:a[0]||(a[0]=s=>r("edit-attributes"))},[_e(Qt,{label:"Edit attributes","edit-button":""})])])],64)):(X(),ne("span",C4,[b("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:a[1]||(a[1]=s=>r("edit-attributes"))},[_e(Qt,{label:"Add attributes","add-button":""})])]))]))],64)):ye("",!0)])]))}},k4=["data-test-id"],E4=["placeholder","value","data-test-id"],O4=["data-test-id"],S4=["data-test-id","onClick"],I4=He({__name:"MoleculeSearch",props:{placeholder:{type:String,default:""},modelValue:{type:String,default:""},height:{type:[Number,String],default:32},size:{type:String,default:"regular"},loading:{type:Boolean,default:!1},options:{type:Array,default:()=>[]},iconPosition:{type:String,default:"right",validator:e=>["left","right"].includes(e)},dataTestId:{type:String,required:!0}},emits:["update:modelValue","optionClick"],setup(e,{emit:t}){const n=e,r=t,i=ae(""),o=ae(null),a=ae(!1),s=ae(null),l=ae(!0),h=be(()=>l.value?{}:{bottom:"100%",marginTop:"0",marginBottom:"4px"}),c=async()=>{var w;if(await zt(),!s.value)return;const v=s.value.getBoundingClientRect(),C=window.innerHeight-v.bottom,y=Math.min(((w=n.options)==null?void 0:w.length)*40+20,200);l.value=C>=y},f=()=>{o.value=null,r("update:modelValue","")},u=d=>{const v=d.target.value;i.value&&(clearTimeout(i.value),i.value=null),i.value=setTimeout(()=>{r("update:modelValue",v)},500)},g=async()=>{a.value=!0,await c()},p=()=>{setTimeout(()=>{a.value=!1},150)},m=d=>{a.value=!1,i.value&&(clearTimeout(i.value),i.value=null),r("update:modelValue",d.label),r("optionClick",d)};return(d,v)=>{var _;return X(),ne("div",{ref_key:"searchContainer",ref:s,class:Ie(["molecule-search",{"icon-left":e.iconPosition==="left"}]),"data-test-id":e.dataTestId},[e.loading?(X(),Te(Sc,{key:0,size:16,class:"icon ect-top-2 icon-loader","data-test-id":`${e.dataTestId}-loader`},null,8,["data-test-id"])):e.iconPosition==="left"||!e.modelValue?(X(),Te(Ge,{key:1,class:"icon-search ect-mt-[-1px]",icon:"search",size:14,color:"#5f5f5f","data-test-id":`${e.dataTestId}-search`,onClick:f},null,8,["data-test-id"])):ye("",!0),b("input",{class:Ie(["search-input-box",{large:e.size==="large"}]),type:"text",style:tt({height:`${e.height}px`}),placeholder:n.placeholder,value:e.modelValue,"data-test-id":`${e.dataTestId}-input`,onInput:u,onFocus:g,onBlur:p},null,46,E4),e.modelValue&&!e.loading?(X(),Te(Ge,{key:2,class:"close-btn",icon:"close",size:8,color:"#5f5f5f","data-test-id":`${e.dataTestId}-close`,onClick:f},null,8,["data-test-id"])):ye("",!0),((_=e.options)==null?void 0:_.length)>0&&a.value?(X(),ne("div",{key:3,class:Ie(["search-options",{"dropdown-top":!l.value}]),style:tt(h.value),"data-test-id":`${e.dataTestId}-dropdown`},[(X(!0),ne(Oe,null,Ke(e.options,(C,y)=>(X(),ne("div",{key:C.id,class:"search-option","data-test-id":`${e.dataTestId}-option-${y}`,onClick:Nt(w=>m(C),["stop"]),onMousedown:v[0]||(v[0]=Nt(()=>{},["prevent"]))},[Ve(ve(C.label)+" ",1),b("span",null,ve(C.subLabel),1)],40,S4))),128))],14,O4)):ye("",!0)],10,k4)}}},[["__scopeId","data-v-6cdaa802"]]),A4=["data-test-id"],T4=He({__name:"StatePill",props:{text:{type:String,required:!0},state:{type:String,default:"default",validator:e=>["default","draft","review","active","inactive","in draft","active"].includes(e)},dataTestId:{type:String,default:""}},setup(e){const t=e,n=be(()=>({"ect-state-pill--default":t.state==="default","ect-state-pill--draft":t.state==="draft"||t.state==="in draft","ect-state-pill--review":t.state==="review","ect-state-pill--active":t.state==="active","ect-state-pill--inactive":t.state==="inactive"}));return(r,i)=>(X(),ne("span",{class:Ie(["ect-state-pill",n.value]),"data-test-id":e.dataTestId},ve(e.text),11,A4))}},[["__scopeId","data-v-6be678b8"]]),N4=["data-test-id"],P4=["data-test-id"],L4=["data-test-id"],R4=["data-test-id"],M4=["data-test-id","onClick"],q4=["data-test-id"],j4=He({__name:"ecBreadcrumbs",props:{links:{type:Array,default:()=>[],validator:e=>e.every(t=>typeof t=="object"&&typeof t.text=="string"&&(t.route===void 0||typeof t.route=="string"||typeof t.route=="object"))},dataTestId:{type:String,required:!0}},setup(e){const t=Hi(),n=r=>{r&&t.push(r)};return(r,i)=>(X(),ne("div",{class:"ect-flex ect-items-center ect-justify-between","data-test-id":e.dataTestId},[b("div",{class:"ect-flex ect-items-center ect-gap-4","data-test-id":`${e.dataTestId}-container`},[b("div",{class:"ect-flex ect-items-center ect-gap-1","data-test-id":`${e.dataTestId}-breadcrumbs`},[(X(!0),ne(Oe,null,Ke(e.links,(o,a)=>(X(),ne(Oe,{key:a},[a>0?(X(),ne("span",{key:0,class:"ect-text-[#828282] ect-text-xs ect-font-semibold","data-test-id":`${e.dataTestId}-separator-${a}`}," / ",8,R4)):ye("",!0),o.route?(X(),ne("button",{key:1,class:"ect-text-[#828282] ect-text-xs ect-font-semibold ect-font-ui ect-leading-normal hover:ect-text-[#0076D6] hover:ect-underline ect-transition-colors","data-test-id":`${e.dataTestId}-link-${a}`,onClick:s=>n(o.route)},ve(o.text),9,M4)):(X(),ne("span",{key:2,class:"ect-text-[#828282] ect-text-xs ect-font-semibold ect-font-ui ect-leading-normal","data-test-id":`${e.dataTestId}-text-${a}`},ve(o.text),9,q4))],64))),128))],8,L4)],8,P4)],8,N4))}},[["__scopeId","data-v-151ca816"]]),D4={components:{AppIcon:Ge},props:{direction:{type:String,default:"top",validator:e=>["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"].includes(e)},content:{type:String,default:null},disabled:{type:Boolean,default:!1},width:{type:Number,default:130},icon:{type:String,default:null},dataTestId:{type:String,default:""}},data(){return{show:!1}},computed:{tooltipClass(){return{tooltip:!0,[`tooltip-${this.direction}`]:!0}},styleObj(){return{width:`${this.width}px !important`}}},methods:{showTooltip(){this.disabled||(this.show=!0)},hideTooltip(){this.show=!1}}},B4=["data-test-id"],$4=["data-test-id"];function F4(e,t,n,r,i,o){const a=Sr("AppIcon");return n.content?(X(),ne("div",{key:0,class:"tooltip-container","data-test-id":n.dataTestId,onMouseover:t[0]||(t[0]=(...s)=>o.showTooltip&&o.showTooltip(...s)),onMouseleave:t[1]||(t[1]=(...s)=>o.hideTooltip&&o.hideTooltip(...s))},[Qe(e.$slots,"default",{},void 0,!0),wn(b("div",{class:Ie(o.tooltipClass),style:tt(o.styleObj),"data-test-id":`${n.dataTestId}-content`},[n.icon?(X(),Te(a,{key:0,icon:n.icon,color:"#57c046",size:14,"data-test-id":`${n.dataTestId}-icon`},null,8,["icon","data-test-id"])):ye("",!0),Ve(" "+ve(n.content),1)],14,$4),[[Kd,i.show]])],40,B4)):Qe(e.$slots,"default",{key:1},void 0,!0)}const V4=He(D4,[["render",F4],["__scopeId","data-v-b36acc62"]]),H4=Mt("item",()=>{const e=sn(),t=ae([]),n=ae([]),r=ae(!1),i=ae(0),o=ae(1),a=ae(""),s=ae(20),l=ae(null),h=ae(!1),c=ae(null),f=ae(!1),u=ae(null),g=ae(null),p=ae(null),m=ae(null),d=ae(null),v=ae({addedOptionIds:null,eCatalogCount:null,ecatalogs:null,publishVersionId:null,removedOptionIds:null}),_=ae([]),C=ae({ecatalogIds:[],optionItemsToAdd:[]}),y=ae(!1),w=ae(null),A=ae(0),I=2,S=D=>{!Array.isArray(D)||D.every($=>{var H;return $.id&&((H=$.itemTypes)==null?void 0:H.every(J=>{var R;return J.id&&((R=J.options)==null?void 0:R.every(z=>z.id))}))})||D.forEach(($,H)=>{$.id||($.id=`category-${H}-${$.category}`),$.itemTypes&&Array.isArray($.itemTypes)&&$.itemTypes.forEach((J,R)=>{J.id||(J.id=J.itemTypeId||`itemType-${H}-${R}-${J.itemTypeName||"unnamed"}`),J.options&&Array.isArray(J.options)&&J.options.forEach((z,oe)=>{z.id||(z.id=z.itemId||`option-${H}-${R}-${oe}-${z.itemName||"unnamed"}`)})})})},N=async(D,q=null)=>{var $;try{f.value=!0;let H={};if(q)H={fileId:q};else{const R=_.value.find(oe=>oe.status==="Draft"),z=_.value.find(oe=>oe.status==="Active");z?H={fileId:z.id}:R?H={fileId:R.id}:H={itemId:D}}let J=await window.AdminConfiguratorManager.getItemConfiguration({request:JSON.stringify(H)});return J!=null&&J.errorMessage?(e.handleError(J.errorMessage),null):(J=bt(J.data),typeof J.data=="string"&&(J=JSON.parse(J.data)),($=J==null?void 0:J.productItem)!=null&&$.categoryOptions&&S(J.productItem.categoryOptions),l.value=J,f.value=!1,_.value.length===0&&!r.value&&await fe(),J.data)}catch(H){return f.value=!1,e.handleError("Failed to fetch item configuration. Please try again.",H),null}},T=async(D,q="",$="")=>{try{const H={searchTerm:D,itemTypeId:q,filterType:$};let J=await window.AdminConfiguratorManager.getItemsList({request:JSON.stringify(H)});return J=bt(J),J!=null&&J.errorMessage?(e.handleError(J.errorMessage),null):J}catch{return e.handleError("Failed to fetch option list. Please try again."),null}},k=async(D,q)=>{try{const $={productItemId:d.value,optionItemId:D,existingItemType:q};let H=await window.AdminConfiguratorManager.getItemDetails({request:JSON.stringify($)});return H=bt(H),H!=null&&H.errorMessage?(e.handleError(H.errorMessage),null):H}catch{return e.handleError("Failed to fetch option details. Please try again."),null}},E=async()=>{try{const D=await window.AdminConfiguratorManager.getAvailableAttributes();return JSON.parse(D)}catch{e.handleError("Failed to fetch available attributes. Please try again.")}},L=async D=>{try{const q=await window.AdminConfiguratorManager.addAttribute({request:JSON.stringify(D)});return JSON.parse(q)}catch{e.handleError("Failed to fetch item configuration. Please try again.")}},V=async D=>{try{const q=JSON.stringify(D),$=await window.AdminConfiguratorManager.getChildFields({request:q});return JSON.parse($)}catch(q){throw e.handleError("Failed to fetch child fields. Please try again.",q),q}},K=async()=>{const D={objectApiName:"XX_Base__Item_Type__c",fieldApiName:"XX_Base__Item_Type_Category__c"};try{return(await window.AdminConfiguratorManager.getPicklistValues({request:JSON.stringify(D)})).data}catch(q){throw e.handleError("Failed to fetch picklist values. Please try again.",q),q}},W=async()=>{var D,q,$;try{const H=(q=(D=l.value)==null?void 0:D.productItem)==null?void 0:q.itemStatus,R={fileId:($=_.value.find(oe=>oe.status===H))==null?void 0:$.id,itemId:d.value};let z=await window.AdminConfiguratorManager.activateItemConfig({request:JSON.stringify(R)});return z!=null&&z.error?(P(z==null?void 0:z.error),null):(z=bt(z.data),v.value=z,z)}catch{return P(),null}},te=async()=>{try{const D={productId:"068bn00000Anu0YAAR"};return(await window.AdminConfiguratorManager.getECatalogsForProduct({request:JSON.stringify(D)})).data}catch(D){e.handleError("Failed to fetch e catalogs for product. Please try again.",D)}},fe=async()=>{try{const D={productId:d.value},q=await window.AdminConfiguratorManager.getProductConfigInfo({request:JSON.stringify(D)}),$=JSON.parse(q.data);return _.value=$.data,$}catch(D){e.handleError("Failed to save item configuration. Please try again.",D)}},ee=async()=>{try{const D={ecatalogIds:C.value.ecatalogIds,productItemId:d.value,optionItemsToAdd:C.value.optionItemsToAdd};return(await window.AdminConfiguratorManager.saveItemConfigToCatalog({request:JSON.stringify(D)})).data}catch(D){e.handleError("Failed to save item configuration to catalog. Please try again.",D)}},j=async()=>{var D,q,$;try{const H=(q=(D=l.value)==null?void 0:D.productItem)==null?void 0:q.itemStatus,J={itemId:d.value,fileId:($=_.value.find(ce=>ce.status===H))==null?void 0:$.id},R=await window.AdminConfiguratorManager.createNewVersion({request:JSON.stringify(J)}),z=JSON.parse(R);await fe(),await N(d.value,z.id);const oe=_.value.findIndex(ce=>ce.status==="Draft");return oe!==-1?_.value[oe]=z:_.value.push(z),z}catch(H){e.handleError("Failed to create new version. Please try again.",H)}},O=async()=>{var H,J;const D=(H=_.value.find(R=>R.status==="Inactive"))==null?void 0:H.id,q=(J=_.value.find(R=>R.status==="Active"))==null?void 0:J.id,$={itemId:d.value,activeVersionId:q,inactiveVersionId:D};try{return(await window.AdminConfiguratorManager.rollbackItemConfig({request:JSON.stringify($)})).data}catch(R){e.handleError("Failed to rollback item configuration. Please try again.",R)}},P=D=>{D?w.value=D:w.value=null,y.value=!0};return{items:t,loading:r,totalCount:i,currentPage:o,searchTerm:a,itemLimit:s,columns:n,currentItemConfig:l,savingItemConfiguration:h,currentItem:c,configLoader:f,currentItemData:u,currentGroupIndex:g,currentOptionIndex:p,currentOptionData:m,versionInfo:_,activateConfigData:v,activatePayload:C,itemId:d,showActivationErrorModal:y,activationError:w,activationRetryCount:A,maxRetries:I,getItemConfiguration:N,getItemsList:T,getItemDetails:k,getAvailableAttributes:E,addAttribute:L,getChildFields:V,getPicklistValues:K,activateItemConfig:W,getECatalogsForProduct:te,getversionInfo:fe,saveItemConfigToCatalog:ee,createNewVersion:j,rollbackItemConfig:O,addCrossSell:async D=>{const q={itemId:D.id||D.itemId,primarySortOrder:D.primarySortOrder};try{const $=await window.AdminConfiguratorManager.addCrossSell({request:JSON.stringify(q)});return JSON.parse($.data)}catch($){return e.handleError("Failed to add cross sell. Please try again.",$),null}},saveItemConfiguration:async()=>{var D;if(f.value||r.value||h.value||!((D=l.value)!=null&&D.productItem))return null;if(!(l.value.productItem.itemStatus==="Active"||l.value.productItem.itemStatus==="Inactive"))try{h.value=!0;const q={itemId:d.value,configurationData:l.value},$=await window.AdminConfiguratorManager.saveItemConfiguration({request:JSON.stringify(q)});if($!=null&&$.errorMessage)return e.handleError($.errorMessage),null;if(!($!=null&&$.error)){const H=_.value.findIndex(J=>J.status==="Draft");_.value[H].id=$.data}return $}catch(q){return e.handleError("Failed to save item configuration. Please try again.",q),null}finally{h.value=!1}},showActivationError:P,hideActivationError:()=>{y.value=!1,A.value=0},incrementRetryCount:()=>{A.value+=1,y.value=!0},canRetry:()=>A.value<I,assignStableIds:S}}),U4={class:"app-filters-main-wrapper"},z4={class:"app-filters-wrapper"},K4={class:"app-filters"},Z4={class:"left-section"},Q4={class:"ect-flex ect-gap-2 ect-items-center"},X4={class:"ect-absolute ect-top-0 ect-right-0 ect-w-full ect-h-full ect-z-10"},J4={class:"right-section"},W4={class:"after-search-wrapper"},G4={class:"buttons-wrapper"},Y4={class:"before-button-wrapper"},ep={key:0,class:"action-wrapper"},tp={key:1,class:"button-text ect-font-medium"},np={key:2,class:"count-badge"},rp=He({__name:"FilterHeader",props:{title:{type:String,default:""},showSearch:{type:Boolean,default:!1},buttons:{type:Array,default:()=>[],validator:e=>e.every(t=>(t.icon||t.text)&&typeof t.handler=="function")},searchWidth:{type:String,default:"312px"},showBackButton:{type:Boolean,default:!1},statusText:{type:String,default:""},placeholder:{type:String,default:"Search by name"},breadcrumbLinks:{type:Array,default:()=>[],validator:e=>e.every(t=>typeof t=="object"&&typeof t.text=="string"&&(t.route===void 0||typeof t.route=="string"))},recordLink:{type:String,default:""}},emits:["search","back"],setup(e,{emit:t}){const n=H4(),r=e,i=Cr([]);kn(()=>{o()});const o=()=>{i.splice(0,i.length),r.buttons&&r.buttons.length>0&&r.buttons.forEach(u=>{i.push({...u})})};St(()=>r.buttons,()=>{o()},{deep:!0});const a=u=>{s("search",u)},s=t,l=ae(""),h=(u,g)=>{u.supportsToggle&&(u.isActive=!u.isActive),typeof u.handler=="function"&&u.handler(u,u.isActive)},c=()=>{s("back")},f=()=>{if(!r.recordLink)return;let u=r.recordLink;if(!u){let v=n.itemId;if(!v){const _=new URLSearchParams(window.location.search),C=new URLSearchParams(window.location.hash.split("?")[1]);v=_.get("itemId")||C.get("itemId")}u=v}if(!u)return;const p=window.location.href.match(/^(https?:\/\/[^/]+)/);if(!p){console.info("[ERROR]: Unable to extract base domain from current URL");return}const d=`${p[1]}/${u}`;window.open(d,"_blank")};return(u,g)=>(X(),ne("div",U4,[b("div",z4,[b("div",K4,[b("div",Z4,[e.breadcrumbLinks&&e.breadcrumbLinks.length>1?(X(),Te(j4,{key:0,links:e.breadcrumbLinks,"data-test-id":"filter-header-breadcrumbs",class:"ect-mb-3"},null,8,["links"])):ye("",!0),b("div",Q4,[e.showBackButton?(X(),ne("button",{key:0,class:"back-button","data-test-id":"filter-header-button-back",onClick:c},[_e(Ge,{icon:"arrow",symbol:"",size:16,color:"#198708",class:"ect-relative ect-top-[3px]"})])):ye("",!0),e.title?(X(),ne("p",{key:1,class:Ie(["ect-relative ect-text-lg ect-font-semibold ect-leading-5 ect-text-[#1F1F1F] ect-transition-colors ect-duration-200",{"hover:ect-text-[#0076D6] ect-cursor-pointer":e.recordLink}]),"data-test-id":"filter-header-title",onClick:g[0]||(g[0]=p=>e.recordLink?f():null)},[Ve(ve(e.title)+" ",1),e.recordLink?(X(),ne(Oe,{key:0},[_e(Ge,{icon:"open-link",symbol:"",size:16,color:"currentColor",class:"ect-relative ect-top-[3px]"}),b("div",X4,[_e(V4,{class:"ect-min-w-full ect-h-full",direction:"top",content:"View Item in Salesforce","data-test-id":"filter-header-tooltip",width:160})])],64)):ye("",!0)],2)):ye("",!0),e.statusText?(X(),Te(T4,{key:2,text:e.statusText,state:e.statusText.toLowerCase(),"data-test-id":"`filter-header-status-pill`"},null,8,["text","state"])):ye("",!0),Qe(u.$slots,"after-status",{},void 0,!0)])]),b("div",J4,[e.showSearch?(X(),ne("div",{key:0,class:"search-wrapper",style:tt({width:e.searchWidth})},[_e(I4,{modelValue:l.value,"onUpdate:modelValue":[g[1]||(g[1]=p=>l.value=p),a],class:"search-input",placeholder:e.placeholder,"data-test-id":"filter-header-search-input"},null,8,["modelValue","placeholder"])],4)):ye("",!0),b("div",W4,[Qe(u.$slots,"afterSearch",{},void 0,!0)]),b("div",G4,[b("div",Y4,[Qe(u.$slots,"before-button",{},void 0,!0)]),u.$slots.buttons?(X(),ne("div",ep,[Qe(u.$slots,"buttons",{},void 0,!0)])):(X(!0),ne(Oe,{key:1},Ke(i,(p,m)=>(X(),ne("div",{key:m,class:"action-wrapper"},[_e(Pt,{btype:p.type||"primary","button-style":p.style||"outlined",size:"medium",style:tt({minWidth:p.minWidth||"auto"}),class:Ie([{active:p.isActive},{"icon-only":p.icon&&!p.text},{"text-button":p.text}]),loading:p.loading,disabled:p.disabled,"data-test-id":`filter-header-button-${p.text?p.text.toLowerCase().replace(/\s+/g,"-"):m}`,onClick:d=>h(p)},{default:Be(()=>[p.icon?(X(),Te(Ge,{key:0,icon:p.icon,symbol:"",color:p.color||"#136E05",size:p.size||14},null,8,["icon","color","size"])):ye("",!0),p.text?(X(),ne("span",tp,ve(p.isActive?p.altText:p.text),1)):ye("",!0),p.count?(X(),ne("span",np,ve(p.count),1)):ye("",!0)]),_:2},1032,["btype","button-style","style","class","loading","disabled","data-test-id","onClick"])]))),128))])])])])]))}},[["__scopeId","data-v-2ea70801"]]),ip=["data-test-id"],op=["data-test-id"],ap=["data-test-id"],sp=["data-test-id"],lp=["data-test-id"],cp=["data-test-id"],up=["data-test-id"],fp=He({__name:"ecSwitch",props:Al({text:{type:[String,Object],required:!1,validator:e=>typeof e=="string"?!0:typeof e=="object"&&e!==null?Object.prototype.hasOwnProperty.call(e,"on")&&Object.prototype.hasOwnProperty.call(e,"off"):!1},subtext:{type:String,required:!1},size:{type:String,default:"regular",validator:e=>["regular","large"].includes(e)},disabled:{type:Boolean,default:!1},dataTestId:{type:String,default:""},leftAlign:{type:Boolean,default:!1}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:Al(["update:modelValue"],["update:modelValue"]),setup(e,{emit:t}){const n=e,r=Dd(e,"modelValue"),i=t,o=be(()=>typeof n.text=="string"?n.text:typeof n.text=="object"&&n.text!==null?r.value?n.text.on:n.text.off:""),a=()=>{n.disabled||i("update:modelValue",!r.value)};return(s,l)=>(X(),ne("div",{class:Ie(["ec-switch-container",{disabled:e.disabled}]),"data-test-id":e.dataTestId},[e.leftAlign?(X(),ne("span",{key:0,class:"ec-switch__label","data-test-id":`${e.dataTestId}-label`},[Ve(ve(o.value)+" ",1),e.subtext?(X(),ne("span",{key:0,class:"ec-switch__subtext","data-test-id":`${e.dataTestId}-subtext`},ve(e.subtext),9,ap)):ye("",!0)],8,op)):ye("",!0),b("div",{class:Ie(["ec-switch",{"ec-switch--active":r.value,"ec-switch--large":e.size==="large"}]),"data-test-id":`${e.dataTestId}-switch`,onClick:a},[b("div",{class:"ec-switch__handle","data-test-id":`${e.dataTestId}-handle`},null,8,lp)],10,sp),e.leftAlign?ye("",!0):(X(),ne("span",{key:1,class:"ec-switch__label","data-test-id":`${e.dataTestId}-label`},[Ve(ve(o.value)+" ",1),e.subtext?(X(),ne("span",{key:0,class:"ec-switch__subtext","data-test-id":`${e.dataTestId}-subtext`},ve(e.subtext),9,up)):ye("",!0)],8,cp))],10,ip))}},[["__scopeId","data-v-cfefad9a"]]),dp={key:0,class:"ect-bg-white ect-h-full ect-flex ect-flex-col ect-overflow-auto"},hp={class:"ect-sticky ect-top-0 ect-z-50 ect-bg-white","data-test-id":"configurator-header-sticky"},pp={class:"ect-flex ect-flex-col ect-sticky ect-top-0 ect-z-50 ect-bg-white ect-border-b ect-border-gray-200"},gp={key:0,class:"ect-flex-1 ect-min-h-0 ect-overflow-y-auto ect-bg-light-bg-x","data-test-id":"configurator-content-scrollable"},mp=He({__name:"ProductConfiguration",setup(e){const t=ln(),n=ae(!1),r=ae(0),i=be(()=>t.configuration),o=be(()=>n.value?[{text:"Done",altText:"Done",type:"primary",style:"primary",handler:()=>a()}]:[{text:"Save",altText:"Save",type:t.isChangedConfiguration?"primary":"secondary",style:"primary",disabled:!t.isChangedConfiguration,handler:()=>s()}]),a=()=>{n.value=!1},s=()=>{console.info("Save"),t.maintainQuoteConfiguration()},l=h=>{r.value=h};return(h,c)=>Me(t).configuration?(X(),ne("div",dp,[Me(t).savedScreen?(X(),Te(K5,{key:1})):(X(),ne(Oe,{key:0},[b("div",hp,[b("div",pp,[ye("",!0),_e(rp,{title:i.value.itemName,buttons:o.value},{"before-button":Be(()=>[Me(t).isYearlyPricingExist?(X(),Te(fp,{key:0,modelValue:Me(t).showYearlyPricing,"onUpdate:modelValue":[c[0]||(c[0]=f=>Me(t).showYearlyPricing=f),Me(t).changePricingScheme],"left-align":"",class:"ect-text-nowrap",text:{on:"Yearly Price",off:"Monthly Price"},"data-test-id":"configurator-switch-show-yearly-pricing"},null,8,["modelValue","onUpdate:modelValue"])):ye("",!0)]),_:1},8,["title","buttons"])]),b("div",{class:Ie(n.value?"ect-pb-16":"ect-pb-0")},[_e(x4,{config:i.value,"edit-attributes":n.value,scroll:r.value,onEditAttributes:c[1]||(c[1]=f=>n.value=!0)},null,8,["config","edit-attributes","scroll"])],2)]),n.value?ye("",!0):(X(),ne("div",gp,[_e(h4,{onScroll:l})]))],64))])):ye("",!0)}},[["__scopeId","data-v-fcdd05ac"]]),vp=["data-item-id","data-qli-id"],yp={key:0,class:"ect-flex-1 ect-min-h-0"},_p={key:1,class:"ect-flex-1 ect-min-h-0"},bp={__name:"Configurator",props:{itemId:{type:String,required:!0},qliId:{type:String,required:!1}},setup(e){xa();const t=e,n=ae(!0),r=ln();return xn(async()=>{n.value=!0,await r.initConfigurator(t.itemId,t.qliId),n.value=!1}),(i,o)=>(X(),ne("div",{class:"ect-h-screen ect-flex ect-flex-col","data-item-id":e.itemId,"data-qli-id":e.qliId},[n.value?(X(),ne("div",_p,[_e(wa)])):(X(),ne("div",yp,[_e(mp)]))],8,vp))}};function Jc(e,t){return function(){return e.apply(t,arguments)}}const{toString:Cp}=Object.prototype,{getPrototypeOf:Ra}=Object,{iterator:Yi,toStringTag:Wc}=Symbol,eo=(e=>t=>{const n=Cp.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),jt=e=>(e=e.toLowerCase(),t=>eo(t)===e),to=e=>t=>typeof t===e,{isArray:lr}=Array,cr=to("undefined");function Hr(e){return e!==null&&!cr(e)&&e.constructor!==null&&!cr(e.constructor)&&wt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Gc=jt("ArrayBuffer");function wp(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Gc(e.buffer),t}const xp=to("string"),wt=to("function"),Yc=to("number"),Ur=e=>e!==null&&typeof e=="object",kp=e=>e===!0||e===!1,no=e=>{if(eo(e)!=="object")return!1;const t=Ra(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Wc in e)&&!(Yi in e)},Ep=e=>{if(!Ur(e)||Hr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Op=jt("Date"),Sp=jt("File"),Ip=jt("Blob"),Ap=jt("FileList"),Tp=e=>Ur(e)&&wt(e.pipe),Np=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||wt(e.append)&&((t=eo(e))==="formdata"||t==="object"&&wt(e.toString)&&e.toString()==="[object FormData]"))},Pp=jt("URLSearchParams"),[Lp,Rp,Mp,qp]=["ReadableStream","Request","Response","Headers"].map(jt),jp=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function zr(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),lr(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(Hr(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let s;for(r=0;r<a;r++)s=o[r],t.call(null,e[s],s,e)}}function eu(e,t){if(Hr(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Vn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,tu=e=>!cr(e)&&e!==Vn;function Ma(){const{caseless:e,skipUndefined:t}=tu(this)&&this||{},n={},r=(i,o)=>{const a=e&&eu(n,o)||o;no(n[a])&&no(i)?n[a]=Ma(n[a],i):no(i)?n[a]=Ma({},i):lr(i)?n[a]=i.slice():(!t||!cr(i))&&(n[a]=i)};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&zr(arguments[i],r);return n}const Dp=(e,t,n,{allOwnKeys:r}={})=>(zr(t,(i,o)=>{n&&wt(i)?e[o]=Jc(i,n):e[o]=i},{allOwnKeys:r}),e),Bp=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),$p=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Fp=(e,t,n,r)=>{let i,o,a;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],(!r||r(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=n!==!1&&Ra(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Vp=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Hp=e=>{if(!e)return null;if(lr(e))return e;let t=e.length;if(!Yc(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Up=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ra(Uint8Array)),zp=(e,t)=>{const r=(e&&e[Yi]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},Kp=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Zp=jt("HTMLFormElement"),Qp=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),nu=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Xp=jt("RegExp"),ru=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};zr(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(r[o]=a||i)}),Object.defineProperties(e,r)},Jp=e=>{ru(e,(t,n)=>{if(wt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(wt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Wp=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return lr(e)?r(e):r(String(e).split(t)),n},Gp=()=>{},Yp=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function e3(e){return!!(e&&wt(e.append)&&e[Wc]==="FormData"&&e[Yi])}const t3=e=>{const t=new Array(10),n=(r,i)=>{if(Ur(r)){if(t.indexOf(r)>=0)return;if(Hr(r))return r;if(!("toJSON"in r)){t[i]=r;const o=lr(r)?[]:{};return zr(r,(a,s)=>{const l=n(a,i+1);!cr(l)&&(o[s]=l)}),t[i]=void 0,o}}return r};return n(e,0)},n3=jt("AsyncFunction"),r3=e=>e&&(Ur(e)||wt(e))&&wt(e.then)&&wt(e.catch),iu=((e,t)=>e?setImmediate:t?((n,r)=>(Vn.addEventListener("message",({source:i,data:o})=>{i===Vn&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Vn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",wt(Vn.postMessage)),i3=typeof queueMicrotask<"u"?queueMicrotask.bind(Vn):typeof process<"u"&&process.nextTick||iu,de={isArray:lr,isArrayBuffer:Gc,isBuffer:Hr,isFormData:Np,isArrayBufferView:wp,isString:xp,isNumber:Yc,isBoolean:kp,isObject:Ur,isPlainObject:no,isEmptyObject:Ep,isReadableStream:Lp,isRequest:Rp,isResponse:Mp,isHeaders:qp,isUndefined:cr,isDate:Op,isFile:Sp,isBlob:Ip,isRegExp:Xp,isFunction:wt,isStream:Tp,isURLSearchParams:Pp,isTypedArray:Up,isFileList:Ap,forEach:zr,merge:Ma,extend:Dp,trim:jp,stripBOM:Bp,inherits:$p,toFlatObject:Fp,kindOf:eo,kindOfTest:jt,endsWith:Vp,toArray:Hp,forEachEntry:zp,matchAll:Kp,isHTMLForm:Zp,hasOwnProperty:nu,hasOwnProp:nu,reduceDescriptors:ru,freezeMethods:Jp,toObjectSet:Wp,toCamelCase:Qp,noop:Gp,toFiniteNumber:Yp,findKey:eu,global:Vn,isContextDefined:tu,isSpecCompliantForm:e3,toJSONObject:t3,isAsyncFn:n3,isThenable:r3,setImmediate:iu,asap:i3,isIterable:e=>e!=null&&wt(e[Yi])};function Pe(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}de.inherits(Pe,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:de.toJSONObject(this.config),code:this.code,status:this.status}}});const ou=Pe.prototype,au={};["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(e=>{au[e]={value:e}}),Object.defineProperties(Pe,au),Object.defineProperty(ou,"isAxiosError",{value:!0}),Pe.from=(e,t,n,r,i,o)=>{const a=Object.create(ou);de.toFlatObject(e,a,function(c){return c!==Error.prototype},h=>h!=="isAxiosError");const s=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return Pe.call(a,s,l,n,r,i),e&&a.cause==null&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",o&&Object.assign(a,o),a};const o3=null;function qa(e){return de.isPlainObject(e)||de.isArray(e)}function su(e){return de.endsWith(e,"[]")?e.slice(0,-2):e}function lu(e,t,n){return e?e.concat(t).map(function(i,o){return i=su(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function a3(e){return de.isArray(e)&&!e.some(qa)}const s3=de.toFlatObject(de,{},null,function(t){return/^is[A-Z]/.test(t)});function ro(e,t,n){if(!de.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=de.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,d){return!de.isUndefined(d[m])});const r=n.metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&de.isSpecCompliantForm(t);if(!de.isFunction(i))throw new TypeError("visitor must be a function");function h(p){if(p===null)return"";if(de.isDate(p))return p.toISOString();if(de.isBoolean(p))return p.toString();if(!l&&de.isBlob(p))throw new Pe("Blob is not supported. Use a Buffer instead.");return de.isArrayBuffer(p)||de.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function c(p,m,d){let v=p;if(p&&!d&&typeof p=="object"){if(de.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(de.isArray(p)&&a3(p)||(de.isFileList(p)||de.endsWith(m,"[]"))&&(v=de.toArray(p)))return m=su(m),v.forEach(function(C,y){!(de.isUndefined(C)||C===null)&&t.append(a===!0?lu([m],y,o):a===null?m:m+"[]",h(C))}),!1}return qa(p)?!0:(t.append(lu(d,m,o),h(p)),!1)}const f=[],u=Object.assign(s3,{defaultVisitor:c,convertValue:h,isVisitable:qa});function g(p,m){if(!de.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(p),de.forEach(p,function(v,_){(!(de.isUndefined(v)||v===null)&&i.call(t,v,de.isString(_)?_.trim():_,m,u))===!0&&g(v,m?m.concat(_):[_])}),f.pop()}}if(!de.isObject(e))throw new TypeError("data must be an object");return g(e),t}function cu(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ja(e,t){this._pairs=[],e&&ro(e,this,t)}const uu=ja.prototype;uu.append=function(t,n){this._pairs.push([t,n])},uu.toString=function(t){const n=t?function(r){return t.call(this,r,cu)}:cu;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function l3(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function fu(e,t,n){if(!t)return e;const r=n&&n.encode||l3;de.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=de.isURLSearchParams(t)?t.toString():new ja(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class du{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){de.forEach(this.handlers,function(r){r!==null&&t(r)})}}const hu={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},c3={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ja,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Da=typeof window<"u"&&typeof document<"u",Ba=typeof navigator=="object"&&navigator||void 0,u3=Da&&(!Ba||["ReactNative","NativeScript","NS"].indexOf(Ba.product)<0),f3=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",d3=Da&&window.location.href||"http://localhost",ft={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Da,hasStandardBrowserEnv:u3,hasStandardBrowserWebWorkerEnv:f3,navigator:Ba,origin:d3},Symbol.toStringTag,{value:"Module"})),...c3};function h3(e,t){return ro(e,new ft.classes.URLSearchParams,{visitor:function(n,r,i,o){return ft.isNode&&de.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function p3(e){return de.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function g3(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}function pu(e){function t(n,r,i,o){let a=n[o++];if(a==="__proto__")return!0;const s=Number.isFinite(+a),l=o>=n.length;return a=!a&&de.isArray(i)?i.length:a,l?(de.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!s):((!i[a]||!de.isObject(i[a]))&&(i[a]=[]),t(n,r,i[a],o)&&de.isArray(i[a])&&(i[a]=g3(i[a])),!s)}if(de.isFormData(e)&&de.isFunction(e.entries)){const n={};return de.forEachEntry(e,(r,i)=>{t(p3(r),i,n,0)}),n}return null}function m3(e,t,n){if(de.isString(e))try{return(t||JSON.parse)(e),de.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const $a={transitional:hu,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=de.isObject(t);if(o&&de.isHTMLForm(t)&&(t=new FormData(t)),de.isFormData(t))return i?JSON.stringify(pu(t)):t;if(de.isArrayBuffer(t)||de.isBuffer(t)||de.isStream(t)||de.isFile(t)||de.isBlob(t)||de.isReadableStream(t))return t;if(de.isArrayBufferView(t))return t.buffer;if(de.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return h3(t,this.formSerializer).toString();if((s=de.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ro(s?{"files[]":t}:t,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),m3(t)):t}],transformResponse:[function(t){const n=this.transitional||$a.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(de.isResponse(t)||de.isReadableStream(t))return t;if(t&&de.isString(t)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(s){if(a)throw s.name==="SyntaxError"?Pe.from(s,Pe.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ft.classes.FormData,Blob:ft.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};de.forEach(["delete","get","head","post","put","patch"],e=>{$a.headers[e]={}});const Fa=$a,v3=de.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"]),y3=e=>{const t={};let n,r,i;return e&&e.split(`
81
+ or use v-on:ready="onReady(quill)" event instead.`},_=(k,E)=>e.contentType==="html"?A():e.contentType==="text"?y(k,E):n==null?void 0:n.getContents(k,E),C=(k,E="api")=>{const L=k||(e.contentType==="delta"?new c2:"");e.contentType==="html"?I(L):e.contentType==="text"?w(L,E):n==null||n.setContents(L,E),h=s(L)},y=(k,E)=>{var L;return(L=n==null?void 0:n.getText(k,E))!==null&&L!==void 0?L:""},w=(k,E="api")=>{n==null||n.setText(k,E)},A=()=>{var k;return(k=n==null?void 0:n.root.innerHTML)!==null&&k!==void 0?k:""},I=k=>{n&&(n.root.innerHTML=k)},S=(k,E="api")=>{const L=n==null?void 0:n.clipboard.convert(k);L&&(n==null||n.setContents(L,E))},N=()=>{n==null||n.focus()},T=()=>{zt(()=>{var k;!t.slots.toolbar&&n&&((k=n.getModule("toolbar"))===null||k===void 0||k.container.remove()),o()})};return St(()=>e.content,k=>{if(!n||!k||c(k))return;const E=n.getSelection();E&&zt(()=>n==null?void 0:n.setSelection(E)),C(k)},{deep:!0}),St(()=>e.enable,k=>{n&&n.enable(k)}),{editor:i,getEditor:m,getToolbar:d,getQuill:v,getContents:_,setContents:C,getHTML:A,setHTML:I,pasteHTML:S,focus:N,getText:y,setText:w,reinit:T}},render(){var e,t;return[(t=(e=this.$slots).toolbar)===null||t===void 0?void 0:t.call(e),Bd("div",{ref:"editor",...this.$attrs})]}}),f2={class:"input"},d2=["for","data-test-id"],h2=["data-test-id"],p2=He({__name:"RichTextEditor",props:{modelValue:{type:String,default:""},editorOptions:{type:Object,default:()=>({modules:{toolbar:["bold","italic","underline",{align:[]},{list:"ordered"},{list:"bullet"}]},placeholder:"Add AI Instructions",theme:"snow"})},dataTestId:{type:String,default:""},label:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["update:modelValue"],setup(e){const t=e,n=be(()=>typeof t.error=="string"?t.error:t.error===""?!1:t.error===!0?`${t.label||"Field"} is required`:t.error),r=ae("");return xn(()=>{r.value=t.modelValue}),(i,o)=>(X(),ne("div",f2,[e.label?(X(),ne("label",{key:0,class:Ie({error_color:!!e.error}),for:e.label,"data-test-id":`${e.dataTestId}-label`},[Ve(ve(e.label)+" ",1),e.required?(X(),ne("span",{key:0,class:Ie({error_color:!!e.error})},"*",2)):ye("",!0)],10,d2)):ye("",!0),_e(Me(u2),{"content-type":"html",toolbar:e.editorOptions,"model-value":e.modelValue,"data-test-id":e.dataTestId,content:r.value,"onUpdate:content":o[0]||(o[0]=a=>i.$emit("update:modelValue",a))},null,8,["toolbar","model-value","data-test-id","content"]),n.value?(X(),ne("div",{key:1,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${e.dataTestId}-error`},ve(n.value),9,h2)):ye("",!0)]))}},[["__scopeId","data-v-76aecac0"]]),g2={class:"ect-w-full ect-flex ect-flex-col ect-gap-4 ect-p-4 ect-rounded-md ect-border-1 ect-border-gray-200 md:ect-gap-5 lg:ect-gap-6","data-test-id":"configurator-inputs-container"},m2={key:0,class:"ect-text-sm ect-font-regular ect-text-gray-900"},v2={class:"ect-grid ect-grid-cols-1 sm:ect-grid-cols-2 ect-gap-4"},y2={key:0,class:"ect-col-span-2"},_2=["data-test-id"],b2=["id","onUpdate:modelValue","disabled","data-test-id"],C2=["for","data-test-id"],w2={key:2,class:"quill-editor-styles"},x2=b("div",{class:"dropdowntp"},null,-1),k2=b("div",{id:"modals"},null,-1),Xc={__name:"InputsContainer",props:{title:{type:String,default:""},lookup:{type:Object,default:()=>null},attributes:{type:Array,required:!0,default:()=>[]},locale:{type:String,default:"en-US"}},setup(e){const t=ln(),n=e,r=ae({modules:{toolbar:["bold","italic","underline",{align:[]},{list:"ordered"},{list:"bullet"}]},placeholder:"Add AI Instructions",theme:"snow"}),i=ae(n.lookup),o=be(()=>{const l=n.lookup.relatedFields.map(h=>h.child);return l.push("Name"),l});function a(l,h){const c=h.options.find(f=>f.Id===l);l===null?(h.options=[],h.value=null,h.relatedFields.forEach(f=>{f.value=null})):(h.value=c.Name,h.relatedFields.forEach(f=>{f.value=c[f.child]}))}const s=xc(async function(l,h){h.loading=!0;const c={objectType:h.referenceObject,searchText:l||"",lstFields:o.value||[]},f=await t.getRecords(c);h.options=f,h.loading=!1});return(l,h)=>(X(),ne(Oe,null,[b("div",g2,[e.title?(X(),ne("div",m2,ve(e.title),1)):ye("",!0),b("div",v2,[i.value?(X(),ne("div",y2,[_e(Lc,{modelValue:i.value.referenceRecordId,"onUpdate:modelValue":[h[0]||(h[0]=c=>i.value.referenceRecordId=c),h[1]||(h[1]=c=>a(c,i.value))],"data-test-id":`configurator-inputs-lookup-${i.value.attRecordId??l.index}`,label:i.value.label,options:i.value.options,disabled:!i.value.editable,required:i.value.required,loading:i.value.loading,property:{key:"Id",value:"Name"},lookup:"",search:"",highlight:"",onSearch:h[2]||(h[2]=c=>Me(s)(c,i.value))},null,8,["modelValue","data-test-id","label","options","disabled","required","loading"])])):ye("",!0),(X(!0),ne(Oe,null,Ke(e.attributes,(c,f)=>(X(),ne("div",{key:f,class:"attribute-input"},[c.dataType==="PICKLIST"||c.dataType==="MULTIPICKLIST"?(X(),Te(Lc,{key:0,modelValue:c.value,"onUpdate:modelValue":u=>c.value=u,label:c.label,placeholder:c.label,disabled:!c.editable,options:c.picklistValues.map(u=>({label:u,value:u})),select:"",highlight:"","data-test-id":`configurator-inputs-dropdown-${c.attRecordId??l.index}`},null,8,["modelValue","onUpdate:modelValue","label","placeholder","disabled","options","data-test-id"])):c.dataType==="BOOLEAN"?(X(),ne("div",{key:1,class:"ect-flex ect-items-center ect-gap-3 ect-py-3.5","data-test-id":`configurator-inputs-checkbox-${c.attRecordId??l.index}`},[wn(b("input",{id:`checkbox-${c.attRecordId??l.index}`,"onUpdate:modelValue":u=>c.value=u,type:"checkbox",disabled:!c.editable,class:"ect-w-4 ect-h-4 ect-accent-success ect-border-gray-300 ect-rounded ect-text-text-success focus:ect-ring-green-500","data-test-id":`configurator-inputs-checkbox-input-${c.attRecordId??l.index}`},null,8,b2),[[ma,c.value]]),b("label",{for:`checkbox-${c.attRecordId??l.index}`,class:"ect-text-sm ect-font-medium ect-text-gray-900 ect-cursor-pointer","data-test-id":`configurator-inputs-checkbox-label-${c.attRecordId??l.index}`},ve(c.label),9,C2)],8,_2)):c.dataType==="TEXTAREA"?(X(),ne("div",w2,[_e(p2,{modelValue:c.value,"onUpdate:modelValue":u=>c.value=u,label:c.label,required:c.required,"editor-options":r.value,"data-test-id":`configurator-inputs-textarea-quill-editor-${c.attRecordId??l.index}`},null,8,["modelValue","onUpdate:modelValue","label","required","editor-options","data-test-id"])])):(X(),Te(k9,{key:3,modelValue:c.value,"onUpdate:modelValue":u=>c.value=u,label:c.label,disabled:!c.editable,highlight:"","data-test-id":`configurator-inputs-custom-${c.attRecordId??l.index}`},null,8,["modelValue","onUpdate:modelValue","label","disabled","data-test-id"]))]))),128))])]),x2,k2],64))}},E2={class:"ect-w-full ect-flex ect-flex-col ect-gap-4","data-test-id":"configurator-inputs-container"},O2={class:"ect-bg-white ect-rounded-lg"},La={__name:"AttributesContainer",props:{attributes:{type:Array,required:!0,default:()=>[]},locale:{type:String,default:"en-US"}},setup(e){const t=e,n=ae([]),r=ae([]),i=ae({});return xn(()=>{const o={},a=[...t.attributes];a.forEach(l=>{l.dataType==="REFERENCE"&&(i.value[l.apiName]=["Name"],l.relatedFields=[],o[l.apiName]=l),l.editable=l.editable&&!l.apiName.includes(".")});let s=null;a.forEach(l=>{if(l.referenceObject==="XX_Base__Location__c"&&(s?l.firstLookup="Copy from "+s.label:s=l),l.apiName.includes(".")){const[h,c]=l.apiName.split(".");l.parent=h,l.child=c,i.value[h]!=null&&(i.value[h].push(c),o[h].relatedFields.push(l))}}),r.value=a.filter(l=>l.dataType==="REFERENCE"),n.value=a.filter(l=>!(l.apiName.includes(".")||l.dataType==="REFERENCE"))}),(o,a)=>(X(),ne("div",E2,[b("div",O2,[_e(Xc,{attributes:n.value},null,8,["attributes"])]),(X(!0),ne(Oe,null,Ke(r.value,s=>(X(),ne("div",{key:s.attRecordId,class:"ect-bg-white ect-rounded-lg"},[_e(Xc,{title:s.referenceLabel+" Lookup",lookup:s,attributes:s.relatedFields},null,8,["title","lookup","attributes"])]))),128))]))}},S2={class:"ect-px-6 ect-pt-4 ect-pb-6 ect-w-full ect-text-sm ect-leading-none ect-text-neutral-700 ect-max-md:max-w-full"},I2=b("p",{class:"ect-m-1 ect-text-sm ect-font-regular ect-leading-5 ect-text-neutral-700"},"You Selected",-1),A2={class:"ect-flex ect-items-center ect-justify-between ect-rounded-lg ect-px-4 ect-py-2 ect-gap-2 ect-bg-light-bg-x"},T2={class:"ect-mt-1 ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700"},N2={class:"ect-mt-1 ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700"},P2={class:"ect-mt-1 ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700"},L2={class:"ect-px-6 ect-pt-4 ect-pb-6 ect-w-full ect-bg-light-bg-x ect-max-md:max-w-full"},R2={class:"ect-flex ect-justify-end ect-gap-2 ect-p-4"},M2={__name:"AttributesModal",props:{option:{type:Object,required:!0},attributes:{type:Array,required:!0}},emits:["close","done"],setup(e,{emit:t}){const n=t,r=e,i=be(()=>JSON.parse(JSON.stringify(r.attributes))),o=()=>{n("close")},a=()=>{n("done",i.value),n("close")};return(s,l)=>(X(),Te(Ca,{header:"",title:"Update Attributes Values",description:"Update the values associated with selected attributes.",footer:"","no-close":"",onClose:o},{content:Be(()=>[b("header",S2,[I2,b("div",A2,[b("p",T2,ve(e.option.itemName),1),b("p",N2,ve(e.option.qty),1),b("p",P2,ve(e.option.price),1)])]),b("main",L2,[_e(La,{attributes:i.value},null,8,["attributes"])])]),footer:Be(()=>[b("div",R2,[_e(Pt,{class:"ect-min-w-[100px]",btype:"secondary","button-style":"outlined",size:"medium","data-test-id":"attributes-modal-button-cancel",onClick:l[0]||(l[0]=h=>n("close"))},{default:Be(()=>[Ve("Cancel")]),_:1}),_e(Pt,{class:"ect-min-w-[100px]",btype:"primary","button-style":"primary",size:"medium","data-test-id":"attributes-modal-button-done",onClick:a},{default:Be(()=>[Ve("Done")]),_:1})])]),_:1}))}},q2=["data-test-id"],j2=["data-test-id"],D2=["data-test-id"],B2={class:"ect-bg-white ect-rounded-xl ect-shadow-sm"},$2={class:"ect-relative ect-w-full ect-border-b ect-border-solid ect-border-b-neutral-200 max-md:ect-max-w-full"},F2={key:0,class:"ect-flex ect-z-0 ect-flex-col ect-gap-4 ect-justify-center ect-py-4 ect-px-6 ect-w-full max-md:ect-px-5 max-md:ect-max-w-full"},V2={class:"ect-gap-1 ect-w-full max-md:ect-max-w-full"},H2={class:"ect-text-lg ect-font-semibold ect-leading-5 ect-text-neutral-700 max-md:ect-max-w-full"},U2={key:0,class:"ect-mt-1 ect-text-sm ect-leading-none ect-text-zinc-600 max-md:ect-max-w-full"},z2={class:"ect-flex ect-overflow-hidden ect-absolute ect-top-2.5 ect-right-4 ect-z-0 ect-p-1 ect-rounded-lg"},K2={key:0,class:"ect-flex-1 ect-overflow-y-auto ect-h-[600px] ect-max-h-[70vh]"},Z2={key:1,class:"ect-px-6 ect-pt-4 ect-pb-6 ect-w-full ect-text-xs ect-leading-4 ect-text-neutral-700 max-md:ect-px-5 max-md:ect-max-w-full"},Q2={key:2,class:"ect-relative ect-w-full ect-border-t ect-border-solid ect-border-t-neutral-200 max-md:ect-max-w-full"},X2=He({__name:"AppModalGen3",props:{title:{type:String,required:!0},description:{type:String,required:!0},header:{type:Boolean,default:!1},footer:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:t}){const n=t;return(r,i)=>(X(),Te(wc,{to:"modaltp"},{default:Be(()=>[b("div",{class:"modal-mask","data-test-id":`${r.dataTestId}-mask`},[b("div",{class:"modal-wrapper","data-test-id":`${r.dataTestId}-wrapper`},[b("div",{class:"modal-container",style:tt(r.width?`max-width: ${r.width.includes("calc")?r.width:r.width+"px"}; width: 100%;`:""),"data-test-id":`${r.dataTestId}-container`},[b("div",B2,[b("div",$2,[e.header?(X(),ne("div",F2,[b("div",V2,[b("div",H2,ve(e.title),1),e.description?(X(),ne("div",U2,ve(e.description),1)):ye("",!0)])])):ye("",!0),b("div",z2,[b("button",{class:"ect-flex ect-self-stretch ect-my-auto ect-w-6 ect-min-h-6 ect-cursor-pointer hover:ect-bg-gray-100 ect-rounded ect-transition-colors ect-justify-center ect-items-center","aria-label":"Close modal",onClick:i[0]||(i[0]=o=>n("close"))},[_e(Ge,{icon:"close",color:"#000000",size:"11",height:"11"})])])]),r.$slots.content?(X(),ne("div",K2,[Qe(r.$slots,"content",{},void 0,!0)])):(X(),ne("div",Z2,[Qe(r.$slots,"default",{},void 0,!0)])),e.footer?(X(),ne("div",Q2,[Qe(r.$slots,"footer",{},void 0,!0)])):ye("",!0)])],12,D2)],8,j2)],8,q2)]),_:3}))}},[["__scopeId","data-v-41ebff01"]]),Fn=e=>(er("data-v-d109b9d7"),e=e(),tr(),e),J2={class:"ect-w-[600px]"},W2={class:"ect-px-6 ect-pt-4 ect-w-full ect-text-sm ect-leading-none ect-text-neutral-700 ect-max-md:max-w-full"},G2=Fn(()=>b("p",{class:"ect-m-1 ect-text-sm ect-font-regular ect-leading-5 ect-text-neutral-700"},"You Selected",-1)),Y2={class:"ect-flex ect-items-center ect-justify-between ect-rounded-lg ect-px-4 ect-py-2 ect-gap-2 ect-bg-light-bg-x"},e6={class:"ect-mt-1 ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700"},t6={class:"ect-mt-1 ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700"},n6={class:"ect-mt-1 ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700"},r6={class:"ect-px-6 ect-pt-4 ect-pb-6 ect-mt-4 ect-w-full ect-bg-light-bg-x ect-max-md:max-w-full"},i6=Fn(()=>b("p",{class:"ect-text-xs ect-font-medium ect-leading-6 ect-text-neutral-700 ect-mb-3","data-test-id":"conflict-modal-supporting-text"}," Above selection requires a configuration change ",-1)),o6={class:"ect-flex ect-flex-col ect-gap-2"},a6={key:0,class:"ect-bg-white ect-border ect-border-neutral-200 ect-rounded-md","data-test-id":"conflict-modal-add-table"},s6=Fn(()=>b("div",{class:"ect-px-4 ect-py-2"},[b("p",{class:"ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700","data-test-id":"conflict-modal-add-header"}," This change will add: ")],-1)),l6={class:"ect-flex-grow font-regular","data-test-id":"conflict-modal-add-product"},c6={class:"ect-w-20 ect-text-center font-regular","data-test-id":"conflict-modal-add-qty"},u6={class:"ect-w-28 ect-text-right font-regular","data-test-id":"conflict-modal-add-price"},f6={key:1,class:"ect-bg-white ect-border ect-border-neutral-200 ect-rounded-md","data-test-id":"conflict-modal-remove-table"},d6=Fn(()=>b("div",{class:"ect-px-4 ect-py-2"},[b("p",{class:"ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700","data-test-id":"conflict-modal-remove-header"}," This change will remove: ")],-1)),h6={class:"ect-flex-grow font-regular","data-test-id":"conflict-modal-remove-product"},p6={class:"ect-w-20 ect-text-center font-regular","data-test-id":"conflict-modal-remove-qty"},g6={class:"ect-w-28 ect-text-right font-regular","data-test-id":"conflict-modal-remove-price"},m6={class:"ect-flex ect-justify-between ect-items-center ect-px-4 ect-py-1 ect-w-full ect-text-sm ect-leading-none ect-text-neutral-700 ect-bg-white ect-rounded-md ect-border ect-border-neutral-200 ect-rounded-md"},v6=Fn(()=>b("p",{class:"ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700","data-test-id":"conflict-modal-price-change-label"}," Price change ",-1)),y6={class:"ect-text-sm ect-font-semibold ect-leading-5","data-test-id":"conflict-modal-price-change-value"},_6={class:"ect-px-6 ect-pt-4 ect-pb-6 ect-w-full"},b6=Fn(()=>b("p",{class:"ect-text-xs ect-font-medium ect-leading-6 ect-text-neutral-500 ect-mb-2","data-test-id":"conflict-modal-summary-supporting-text"}," Price Adjustment Summary ",-1)),C6={class:"ect-border ect-border-neutral-200 ect-rounded-md ect-overflow-hidden ect-mt-2 ect-bg-neutral-50","data-test-id":"conflict-modal-summary-table"},w6={class:"ect-flex ect-flex-col ect-gap-2"},x6={class:"ect-flex-1"},k6={class:"font-regular","data-test-id":"conflict-modal-summary-base-price-label"},E6={class:"ect-text-center ect-w-28"},O6={class:"ect-text-sm ect-font-medium ect-leading-5 ect-text-neutral-700 ect-text-right ect-line-through","data-test-id":"conflict-modal-summary-base-price-original"},S6={class:"ect-text-center ect-w-28"},I6={class:"ect-text-sm ect-font-semibold ect-leading-5 ect-text-text-success ect-text-right","data-test-id":"conflict-modal-summary-base-price-adjusted"},A6={class:"ect-border ect-border-neutral-200 ect-rounded-md ect-overflow-hidden ect-px-4 ect-py-1 ect-mt-2","data-test-id":"conflict-modal-summary-total"},T6={class:"ect-flex ect-items-center"},N6=Fn(()=>b("div",{class:"ect-flex-1"},[b("p",{class:"ect-text-sm ect-font-semibold ect-leading-5 ect-text-neutral-700","data-test-id":"conflict-modal-summary-total-label"}," Total Price change ")],-1)),P6={class:"ect-text-center ect-w-28"},L6={class:"ect-text-sm ect-font-medium ect-leading-5 ect-text-neutral-700 ect-text-right ect-line-through","data-test-id":"conflict-modal-summary-base-price-original"},R6={class:"ect-text-center ect-w-28"},M6={class:"ect-text-sm ect-font-semibold ect-leading-5 ect-text-text-success ect-text-right","data-test-id":"conflict-modal-summary-base-price-adjusted"},q6={class:"ect-flex ect-justify-end ect-gap-2 ect-p-4"},j6=He({__name:"ConflictModal",props:{item:{type:Object,required:!0},data:{type:Object,required:!0}},emits:["close","done"],setup(e,{emit:t}){const n=ln(),r=t,i=e,o=be(()=>{const p=n.summaryPrices,m=[];return m.push({label:"Base Price",value:p.basePrice,priceChange:p.basePrice}),m.push({label:"Add Ons",value:p.addOns,priceChange:p.addOns+f.value}),m}),a=be(()=>{const p=n.summaryPrices;return{label:"Total Price",value:p.total,priceChange:p.total+f.value}}),s=be(()=>i.data.inclusions.map(m=>n.optionByPublishKey.get(m))),l=be(()=>s.value.filter(p=>p.itemId!==i.item.itemId)),h=be(()=>i.data.exclusions.map(p=>n.optionByPublishKey.get(p))),c=be(()=>h.value.filter(p=>p.itemId!==i.item.itemId)),f=be(()=>s.value.reduce((p,m)=>p+m.price,0)-h.value.reduce((p,m)=>p+m.price,0)),u=()=>{r("close")},g=()=>{r("done")};return(p,m)=>(X(),Te(X2,{header:"",title:"Confirm Your Selection",description:"This selection requires a configuration change",footer:"","no-close":"",onClose:u},{content:Be(()=>[b("div",J2,[b("header",W2,[G2,b("div",Y2,[b("p",e6,ve(e.item.itemName),1),b("p",t6,ve(e.item.qty),1),b("p",n6,ve(Me(It)(e.item.price)),1)])]),b("main",r6,[i6,b("div",o6,[l.value.length>0?(X(),ne("div",a6,[s6,(X(!0),ne(Oe,null,Ke(l.value,d=>(X(),ne("div",{key:d.itemId,class:"ect-flex ect-items-center ect-py-2 ect-px-4 ect-border-t ect-border-neutral-200"},[b("p",l6,ve(d.itemName),1),b("p",c6,ve(d.qty),1),b("p",u6," + "+ve(Me(It)(d.price)),1)]))),128))])):ye("",!0),c.value.length>0?(X(),ne("div",f6,[d6,(X(!0),ne(Oe,null,Ke(c.value,d=>(X(),ne("div",{key:d.itemId,class:"ect-flex ect-items-center ect-py-2 ect-px-4 ect-border-t ect-border-neutral-200"},[b("p",h6,ve(d.itemName),1),b("p",p6,ve(d.qty),1),b("p",g6," - "+ve(Me(It)(d.price)),1)]))),128))])):ye("",!0),b("div",m6,[v6,b("p",y6,ve(Me(It)(f.value)),1)])])]),b("footer",null,[b("div",_6,[b6,b("div",C6,[b("div",w6,[(X(!0),ne(Oe,null,Ke(o.value,(d,v)=>(X(),ne("div",{key:d.label,class:Ie(["ect-flex ect-px-4 ect-py-1",{"ect-border-t ect-border-neutral-200":v>0}])},[b("div",x6,[b("p",k6,ve(d.label),1)]),b("div",E6,[b("p",O6,ve(Me(It)(d.value)),1)]),b("div",S6,[b("p",I6,ve(Me(It)(d.priceChange)),1)])],2))),128))])]),b("div",A6,[b("div",T6,[N6,b("div",P6,[b("p",L6,ve(Me(It)(a.value.value)),1)]),b("div",R6,[b("p",M6,ve(Me(It)(a.value.priceChange)),1)])])])])])])]),footer:Be(()=>[b("div",q6,[_e(Pt,{class:"ect-min-w-[100px]",btype:"secondary","button-style":"outlined",size:"medium","data-test-id":"conflict-modal-button-cancel",onClick:m[0]||(m[0]=d=>r("close"))},{default:Be(()=>[Ve("Cancel")]),_:1}),_e(Pt,{class:"ect-min-w-[100px]",btype:"primary","button-style":"primary",size:"medium","data-test-id":"conflict-modal-button-done",onClick:g},{default:Be(()=>[Ve("Done")]),_:1})])]),_:1}))}},[["__scopeId","data-v-d109b9d7"]]),D6={class:"ect-flex ect-flex-col"},B6=["onUpdate:modelValue","data-test-id","value","disabled","onChange"],$6=["onUpdate:modelValue","data-test-id","value","disabled","onChange"],F6={key:0},V6={key:1,class:"ect-border-t ect-border-gray-200 ect-p-4"},H6={__name:"ConfiguratorTabSections",props:{data:{type:Object,required:!0}},setup(e){const t=ln(),n=e,r=be(()=>n.data.itemTypes||[]),i=be(()=>n.data.showImage||!1),o=ae(null),a=ae({});let s=ae(null),l=ae(null);const h=(p,m)=>{p.qty=m},c=(p,m)=>{p.itemName=m},f=()=>{t.configuration.categoryOptions.forEach(p=>{p.itemTypes.forEach(m=>{m.options.forEach(d=>{t.configuration.sysGuidedOptions&&(o.value.hidden.includes(d.relationshipInfo.publishKey)?d.hidden=!0:d.hidden=!1),o.value.inclusions.includes(d.relationshipInfo.publishKey)&&!m.selected.includes(d.itemId)&&m.selected.push(d.itemId),o.value.exclusions.includes(d.relationshipInfo.publishKey)&&m.selected.includes(d.itemId)&&m.selected.splice(m.selected.indexOf(d.itemId),1)})})}),o.value=null,a.value=null},u=async(p,m,d,v)=>{if(p.preventDefault(),p.stopPropagation(),s.value=null,l.value=null,m.calculateRules){v&&v.isRadio?d.includes(m.itemId)?(d.splice(0,d.length),l.value=m.relationshipInfo.publishKey):(d.splice(0,d.length),d.push(m.itemId),s.value=m.relationshipInfo.publishKey):d.includes(m.itemId)?(d.splice(d.indexOf(m.itemId),1),l.value=m.relationshipInfo.publishKey):(d.push(m.itemId),s.value=m.relationshipInfo.publishKey);const _=l.value?m:null,C=s.value?m:null,y=await t.evaluateConfigSelection(_,C);y.inclusions.length>0||y.exclusions.length>0?(o.value=y,a.value=m,[...y.inclusions,...y.exclusions].includes(m.relationshipInfo.publishKey)||(s.value&&o.value.exclusions.push(s.value),l.value&&o.value.inclusions.push(l.value))):(o.value=y,s.value&&o.value.exclusions.push(s.value),l.value&&o.value.inclusions.push(l.value),f())}},g=(p,m,d,v)=>{p.target.type==="checkbox"||p.target.type==="radio"||(p.preventDefault(),p.stopPropagation(),v.isRadio?d.includes(m.itemId)?d.splice(0,d.length):(d.splice(0,d.length),d.push(m.itemId)):d.includes(m.itemId)?d.splice(d.indexOf(m.itemId),1):d.push(m.itemId),u(p,m,d,v))};return(p,m)=>(X(),ne(Oe,null,[o.value?(X(),Te(j6,{key:0,item:a.value,data:o.value,onClose:m[0]||(m[0]=d=>o.value=null),onDone:f},null,8,["item","data"])):ye("",!0),b("div",D6,[(X(!0),ne(Oe,null,Ke(r.value,d=>(X(),Te(bh,{key:d.itemTypeId,title:d.itemTypeName,description:d.description,message:d.isRadio?d.selected?"":d.minMessage:d.selected.length<d.minNumber?d.minMessage:d.selected.length===d.maxNumber?d.maxMessage:""},{default:Be(()=>[b("div",{class:Ie([d.numberOfColumns===1?"ect-space-y-3 md:ect-space-y-4 ect-p-2 md:ect-p-4":d.numberOfColumns===2?"ect-grid ect-grid-cols-1 md:ect-grid-cols-2 ect-gap-3 md:ect-gap-4 ect-p-2 md:ect-p-4":"ect-grid ect-grid-cols-1 md:ect-grid-cols-2 lg:ect-grid-cols-3 ect-gap-3 md:ect-gap-4 ect-p-2 md:ect-p-4"])},[(X(!0),ne(Oe,null,Ke(d.options||[],v=>(X(),ne(Oe,{key:v.itemId},[v.hidden?ye("",!0):(X(),Te(p9,{key:0,item:v,name:v.itemName,description:v.description||"","min-quantity":d.minQuantity,"max-quantity":d.maxQuantity,"show-image":i.value,selected:d.selected.includes(v.itemId),tags:v.getTags(),price:v.price,quantity:v.qty,"image-url":v.defaultImageURL,attributes:v.attributes||[],size:d.numberOfColumns,"item-id":v.itemId,"item-type":d.itemTypeName||"",category:d.category,"relationship-info":v.relationshipInfo||{},option:Me(t).optionByItemId.get(v.itemId),"is-attributes":v.isAttributes,"show-attributes":d.lightboxAttributes,disabled:v.isDisabled,"onUpdate:quantity":_=>h(v,_),"onUpdate:name":_=>c(v,_),onEditAttributes:_=>v.showAttributesModal=!0,onClick:_=>d.selected.includes(v.itemId)||v.isDisabled?null:g(_,v,d.selected,d)},{"selection-control":Be(()=>[d.isRadio?wn((X(),ne("input",{key:0,"onUpdate:modelValue":_=>d.selected[0]=_,"data-test-id":`configurator-${d.itemTypeId}-radio-${v.itemId}`,class:"ect-accent-success ect-w-5 ect-h-5",type:"radio",value:v.itemId,disabled:v.isDisabled,onClick:m[1]||(m[1]=Nt(()=>{},["stop"])),onChange:_=>u(_,v,d.selected,d)},null,40,B6)),[[pc,d.selected[0]]]):wn((X(),ne("input",{key:1,"onUpdate:modelValue":_=>d.selected=_,"data-test-id":`configurator-${d.itemTypeId}-checkbox-${v.itemId}`,class:"ect-accent-success ect-w-5 ect-h-5",type:"checkbox",value:v.itemId,disabled:v.isDisabled,onClick:m[2]||(m[2]=Nt(()=>{},["stop"])),onChange:_=>u(_,v,d.selected,d)},null,40,$6)),[[ma,d.selected]])]),default:Be(()=>[d.lightboxAttributes?(X(),ne("div",F6,[v.showAttributesModal?(X(),Te(M2,{key:0,option:v,attributes:v.attributes,onDone:_=>v.attributes=_,onClose:_=>v.showAttributesModal=!1},null,8,["option","attributes","onDone","onClose"])):ye("",!0)])):(X(),ne("div",V6,[_e(La,{attributes:v.attributes},null,8,["attributes"])]))]),_:2},1032,["item","name","description","min-quantity","max-quantity","show-image","selected","tags","price","quantity","image-url","attributes","size","item-id","item-type","category","relationship-info","option","is-attributes","show-attributes","disabled","onUpdate:quantity","onUpdate:name","onEditAttributes","onClick"]))],64))),128))],2)]),_:2},1032,["title","description","message"]))),128))])],64))}},U6=e=>(er("data-v-cb7a75a9"),e=e(),tr(),e),z6={class:"ect-space-y-4"},K6={class:"ect-w-full ect-bg-white ect-border ect-border-ect-gray-200 ect-rounded-lg"},Z6={class:"ect-bg-white ect-border-b ect-border-ect-gray-200 ect-px-4 ect-py-4 ect-sticky ect-top-0 ect-z-[5] ect-overflow-hidden ect-rounded-t-lg"},Q6={class:"ect-text-sm ect-font-semibold ect-text-green-700","data-test-id":"configurator-summary-header-title"},X6={class:"ect-bg-white ect-px-4 ect-py-4 ect-pb-3 ect-border-b ect-border-ect-gray-200 ect-top-[53px] ect-z-9 ect-overflow-hidden ect-sticky ect-top-[53px]"},J6={class:"ect-text-sm ect-font-medium ect-text-ect-gray-800","data-test-id":"configurator-summary-section-frame-color"},W6={class:"ect-flex ect-items-center ect-bg-light-bg-x ect-border-b ect-border-ect-gray-200"},G6={class:"ect-flex-1 ect-bg-ect-gray-50 ect-px-8 ect-py-4 ect-min-h-[56px] ect-flex ect-items-center"},Y6={class:"ect-text-sm ect-text-font-clr-light","data-test-id":"configurator-summary-item-red"},e4={class:"ect-flex ect-items-center ect-px-8 ect-py-4 ect-gap-5"},t4={class:"ect-flex ect-justify-center ect-min-w-[128px]"},n4=U6(()=>b("div",{class:"ect-border-r ect-w-[1px] ect-border-text-muted-light ect-h-6"},null,-1)),r4={class:"ect-flex ect-justify-center ect-min-w-[100px]"},i4={class:"ect-text-sm ect-font-semibold ect-text-ect-gray-800","data-test-id":"configurator-summary-price-red"},o4={key:0,class:"ect-flex ect-items-center ect-bg-light-bg-x ect-px-10 ect-py-3"},a4={class:"ect-flex ect-flex-wrap ect-items-center ect-bg-light-bg-x ect-gap-2"},s4={class:"ect-bg-white ect-px-8 ect-py-4 ect-pr-4 ect-flex ect-justify-end"},l4={class:"ect-text-sm ect-font-semibold ect-text-ect-gray-800","data-test-id":"configurator-summary-total"},c4=He({__name:"ConfiguratorSummaryTab",props:{summary:{type:Array,required:!0}},setup(e){return(t,n)=>(X(),ne("div",z6,[(X(!0),ne(Oe,null,Ke(e.summary,r=>(X(),ne("div",{key:r.key,class:"ect-mb-4"},[b("section",K6,[b("div",Z6,[b("h3",Q6,ve(r.category),1)]),(X(!0),ne(Oe,null,Ke(r.selectedItemTypes,i=>(X(),ne("div",{key:i.itemTypeId,class:"ect-flex ect-flex-col ect-border-b ect-border-ect-gray-200"},[b("div",X6,[b("h4",J6,ve(i.itemTypeName),1)]),(X(!0),ne(Oe,null,Ke(i.selectedOptions,o=>(X(),ne(Oe,{key:o.itemId},[b("div",W6,[b("div",G6,[b("span",Y6,ve(o.itemName),1)]),b("div",e4,[b("div",t4,[_e(Ki,{value:o.qty,"onUpdate:value":a=>o.qty=a,min:i.minQuantity,max:i.maxQuantity,"data-test-id":`configurator-summary-counter-${o.itemId}`},null,8,["value","onUpdate:value","min","max","data-test-id"])]),n4,b("div",r4,[b("span",i4,ve(Me(It)(o.price)),1)])])]),o.isAttributes&&o.getTags().length>0?(X(),ne("div",o4,[b("div",a4,[(X(!0),ne(Oe,null,Ke(o.getTags(),a=>(X(),Te(Qt,{key:a.attributeId,label:a.label,value:a.value},null,8,["label","value"]))),128))])])):ye("",!0)],64))),128))]))),128)),b("div",s4,[b("span",l4," Total : "+ve(Me(It)(r.totalPrice())),1)])])]))),128))]))}},[["__scopeId","data-v-cb7a75a9"]]),u4={class:"configurator-page ect-flex ect-flex-col ect-h-full","data-test-id":"configurator-page-container"},f4={"data-test-id":"configurator-tabs-container",class:"ect-bg-white ect-shadow-sm ect-flex-shrink-0 ect-mb-4"},d4={class:"ect-bg-white ect-border-t ect-border-gray-200 ect-flex-shrink-0 ect-absolute ect-bottom-0 ect-w-full","data-test-id":"configurator-footer-sticky"},h4=He({__name:"ConfiguratorTabs",emits:["scroll"],setup(e,{emit:t}){const n=ln(),r=ae("billing-options"),i=be(()=>n.configuration.categoryOptions),o=be(()=>{const u=i.value.map(g=>({key:g.key,title:g.category}));return u.push({key:"summary",title:"Summary"}),u}),a=t,s=be(()=>l.value.get(r.value)),l=be(()=>{const u=new Map;return i.value.forEach(g=>{u.set(g.key,g)}),u}),h=()=>{console.info("Continue");const u=o.value.findIndex(g=>g.key===r.value);if(u<o.value.length-1){const g=o.value[u+1];r.value=g.key}else n.maintainQuoteConfiguration()};St(r,u=>{c(u),a("scroll",0)});const c=u=>{r.value=u},f=u=>{const g=u.target.scrollTop;a("scroll",g)};return xn(()=>{r.value=o.value[0].key}),(u,g)=>(X(),ne("div",u4,[b("div",f4,[_e(Y5,{modelValue:r.value,"onUpdate:modelValue":g[0]||(g[0]=p=>r.value=p),"show-tabs":!0,border:"",tabs:o.value,"data-test-id":"configurator-tabs-container",onTabChange:c},null,8,["modelValue","tabs"])]),r.value!=="summary"?(X(),ne("div",{key:0,class:"ect-flex-1 ect-min-h-0 ect-overflow-y-auto ect-p-4 ect-pt-0 ect-pb-20","data-test-id":"`configurator-${activeTab}-tab-content`",onScroll:f},[_e(H6,{data:s.value},null,8,["data"])],32)):(X(),ne("div",{key:1,class:"ect-flex-1 ect-min-h-0 ect-overflow-y-auto ect-p-4 ect-pt-0 ect-pb-20","data-test-id":"`configurator-${activeTab}-tab-content`",onScroll:f},[_e(c4,{summary:Me(n).summary},null,8,["summary"])],32)),b("div",d4,[_e(fh,{"btn-text":r.value!=="summary"?"Continue":"Save",item:Me(n).configuration,onContinue:h},null,8,["btn-text","item"])])]))}},[["__scopeId","data-v-722d536d"]]),p4={class:"ect-px-6 ect-pt-4 ect-pb-2 ect-bg-white"},g4={class:"ect-flow-root"},m4=["src","alt"],v4={key:1,class:"ect-mb-2"},y4={class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed ect-transition-all ect-duration-400"},_4={key:0,class:"ect-mt-2"},b4={class:"ect-inline-block ect-mb-2"},C4={key:1,class:"ect-inline-block ect-mb-2"},w4={key:1,class:"ect-mt-2"},x4={__name:"ConfiguratorInfo",props:{config:{type:Object,required:!0},editAttributes:{type:Boolean,required:!0},scroll:{type:Number,default:0}},emits:["edit-attributes"],setup(e,{emit:t}){const n=e,r=t,i=be(()=>n.config.attributes.map(o=>({label:o.label,value:o.value})).filter(o=>o.value!==null&&o.value!==""));return(o,a)=>(X(),ne("div",p4,[b("div",g4,[e.config.defaultImageURL&&e.scroll<50?(X(),ne("div",{key:0,class:Ie(["ect-bg-gray-200 ect-rounded-lg ect-overflow-hidden ect-float-left ect-mr-4 ect-mb-2",e.editAttributes?"ect-w-[40px] ect-h-[40px]":"ect-w-[104px] ect-h-[104px]"])},[e.config.defaultImageURL?(X(),ne("img",{key:0,src:e.config.defaultImageURL,alt:e.config.itemName,class:"ect-w-full ect-h-full ect-object-cover"},null,8,m4)):ye("",!0)],2)):ye("",!0),e.scroll<50?(X(),ne("div",v4,[b("p",y4,ve(e.config.description),1)])):ye("",!0),e.config.isAttributes?(X(),ne(Oe,{key:2},[e.editAttributes?(X(),ne("div",w4,[_e(La,{attributes:e.config.attributes},null,8,["attributes"])])):(X(),ne("div",_4,[i.value.length>0?(X(),ne(Oe,{key:0},[(X(!0),ne(Oe,null,Ke(i.value,(s,l)=>(X(),ne("span",{key:l,class:"ect-inline-block ect-mr-2 ect-mb-2"},[_e(Qt,{label:s.label,value:s.value},null,8,["label","value"])]))),128)),b("span",b4,[b("button",{"data-test-id":"configurator-info-button-edit-attributes",onClick:a[0]||(a[0]=s=>r("edit-attributes"))},[_e(Qt,{label:"Edit attributes","edit-button":""})])])],64)):(X(),ne("span",C4,[b("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:a[1]||(a[1]=s=>r("edit-attributes"))},[_e(Qt,{label:"Add attributes","add-button":""})])]))]))],64)):ye("",!0)])]))}},k4=["data-test-id"],E4=["placeholder","value","data-test-id"],O4=["data-test-id"],S4=["data-test-id","onClick"],I4=He({__name:"MoleculeSearch",props:{placeholder:{type:String,default:""},modelValue:{type:String,default:""},height:{type:[Number,String],default:32},size:{type:String,default:"regular"},loading:{type:Boolean,default:!1},options:{type:Array,default:()=>[]},iconPosition:{type:String,default:"right",validator:e=>["left","right"].includes(e)},dataTestId:{type:String,required:!0}},emits:["update:modelValue","optionClick"],setup(e,{emit:t}){const n=e,r=t,i=ae(""),o=ae(null),a=ae(!1),s=ae(null),l=ae(!0),h=be(()=>l.value?{}:{bottom:"100%",marginTop:"0",marginBottom:"4px"}),c=async()=>{var w;if(await zt(),!s.value)return;const v=s.value.getBoundingClientRect(),C=window.innerHeight-v.bottom,y=Math.min(((w=n.options)==null?void 0:w.length)*40+20,200);l.value=C>=y},f=()=>{o.value=null,r("update:modelValue","")},u=d=>{const v=d.target.value;i.value&&(clearTimeout(i.value),i.value=null),i.value=setTimeout(()=>{r("update:modelValue",v)},500)},g=async()=>{a.value=!0,await c()},p=()=>{setTimeout(()=>{a.value=!1},150)},m=d=>{a.value=!1,i.value&&(clearTimeout(i.value),i.value=null),r("update:modelValue",d.label),r("optionClick",d)};return(d,v)=>{var _;return X(),ne("div",{ref_key:"searchContainer",ref:s,class:Ie(["molecule-search",{"icon-left":e.iconPosition==="left"}]),"data-test-id":e.dataTestId},[e.loading?(X(),Te(Sc,{key:0,size:16,class:"icon ect-top-2 icon-loader","data-test-id":`${e.dataTestId}-loader`},null,8,["data-test-id"])):e.iconPosition==="left"||!e.modelValue?(X(),Te(Ge,{key:1,class:"icon-search ect-mt-[-1px]",icon:"search",size:14,color:"#5f5f5f","data-test-id":`${e.dataTestId}-search`,onClick:f},null,8,["data-test-id"])):ye("",!0),b("input",{class:Ie(["search-input-box",{large:e.size==="large"}]),type:"text",style:tt({height:`${e.height}px`}),placeholder:n.placeholder,value:e.modelValue,"data-test-id":`${e.dataTestId}-input`,onInput:u,onFocus:g,onBlur:p},null,46,E4),e.modelValue&&!e.loading?(X(),Te(Ge,{key:2,class:"close-btn",icon:"close",size:8,color:"#5f5f5f","data-test-id":`${e.dataTestId}-close`,onClick:f},null,8,["data-test-id"])):ye("",!0),((_=e.options)==null?void 0:_.length)>0&&a.value?(X(),ne("div",{key:3,class:Ie(["search-options",{"dropdown-top":!l.value}]),style:tt(h.value),"data-test-id":`${e.dataTestId}-dropdown`},[(X(!0),ne(Oe,null,Ke(e.options,(C,y)=>(X(),ne("div",{key:C.id,class:"search-option","data-test-id":`${e.dataTestId}-option-${y}`,onClick:Nt(w=>m(C),["stop"]),onMousedown:v[0]||(v[0]=Nt(()=>{},["prevent"]))},[Ve(ve(C.label)+" ",1),b("span",null,ve(C.subLabel),1)],40,S4))),128))],14,O4)):ye("",!0)],10,k4)}}},[["__scopeId","data-v-6cdaa802"]]),A4=["data-test-id"],T4=He({__name:"StatePill",props:{text:{type:String,required:!0},state:{type:String,default:"default",validator:e=>["default","draft","review","active","inactive","in draft","active"].includes(e)},dataTestId:{type:String,default:""}},setup(e){const t=e,n=be(()=>({"ect-state-pill--default":t.state==="default","ect-state-pill--draft":t.state==="draft"||t.state==="in draft","ect-state-pill--review":t.state==="review","ect-state-pill--active":t.state==="active","ect-state-pill--inactive":t.state==="inactive"}));return(r,i)=>(X(),ne("span",{class:Ie(["ect-state-pill",n.value]),"data-test-id":e.dataTestId},ve(e.text),11,A4))}},[["__scopeId","data-v-6be678b8"]]),N4=["data-test-id"],P4=["data-test-id"],L4=["data-test-id"],R4=["data-test-id"],M4=["data-test-id","onClick"],q4=["data-test-id"],j4=He({__name:"ecBreadcrumbs",props:{links:{type:Array,default:()=>[],validator:e=>e.every(t=>typeof t=="object"&&typeof t.text=="string"&&(t.route===void 0||typeof t.route=="string"||typeof t.route=="object"))},dataTestId:{type:String,required:!0}},setup(e){const t=Hi(),n=r=>{r&&t.push(r)};return(r,i)=>(X(),ne("div",{class:"ect-flex ect-items-center ect-justify-between","data-test-id":e.dataTestId},[b("div",{class:"ect-flex ect-items-center ect-gap-4","data-test-id":`${e.dataTestId}-container`},[b("div",{class:"ect-flex ect-items-center ect-gap-1","data-test-id":`${e.dataTestId}-breadcrumbs`},[(X(!0),ne(Oe,null,Ke(e.links,(o,a)=>(X(),ne(Oe,{key:a},[a>0?(X(),ne("span",{key:0,class:"ect-text-[#828282] ect-text-xs ect-font-semibold","data-test-id":`${e.dataTestId}-separator-${a}`}," / ",8,R4)):ye("",!0),o.route?(X(),ne("button",{key:1,class:"ect-text-[#828282] ect-text-xs ect-font-semibold ect-font-ui ect-leading-normal hover:ect-text-[#0076D6] hover:ect-underline ect-transition-colors","data-test-id":`${e.dataTestId}-link-${a}`,onClick:s=>n(o.route)},ve(o.text),9,M4)):(X(),ne("span",{key:2,class:"ect-text-[#828282] ect-text-xs ect-font-semibold ect-font-ui ect-leading-normal","data-test-id":`${e.dataTestId}-text-${a}`},ve(o.text),9,q4))],64))),128))],8,L4)],8,P4)],8,N4))}},[["__scopeId","data-v-151ca816"]]),D4={components:{AppIcon:Ge},props:{direction:{type:String,default:"top",validator:e=>["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"].includes(e)},content:{type:String,default:null},disabled:{type:Boolean,default:!1},width:{type:Number,default:130},icon:{type:String,default:null},dataTestId:{type:String,default:""}},data(){return{show:!1}},computed:{tooltipClass(){return{tooltip:!0,[`tooltip-${this.direction}`]:!0}},styleObj(){return{width:`${this.width}px !important`}}},methods:{showTooltip(){this.disabled||(this.show=!0)},hideTooltip(){this.show=!1}}},B4=["data-test-id"],$4=["data-test-id"];function F4(e,t,n,r,i,o){const a=Sr("AppIcon");return n.content?(X(),ne("div",{key:0,class:"tooltip-container","data-test-id":n.dataTestId,onMouseover:t[0]||(t[0]=(...s)=>o.showTooltip&&o.showTooltip(...s)),onMouseleave:t[1]||(t[1]=(...s)=>o.hideTooltip&&o.hideTooltip(...s))},[Qe(e.$slots,"default",{},void 0,!0),wn(b("div",{class:Ie(o.tooltipClass),style:tt(o.styleObj),"data-test-id":`${n.dataTestId}-content`},[n.icon?(X(),Te(a,{key:0,icon:n.icon,color:"#57c046",size:14,"data-test-id":`${n.dataTestId}-icon`},null,8,["icon","data-test-id"])):ye("",!0),Ve(" "+ve(n.content),1)],14,$4),[[Kd,i.show]])],40,B4)):Qe(e.$slots,"default",{key:1},void 0,!0)}const V4=He(D4,[["render",F4],["__scopeId","data-v-b36acc62"]]),H4=Mt("item",()=>{const e=sn(),t=ae([]),n=ae([]),r=ae(!1),i=ae(0),o=ae(1),a=ae(""),s=ae(20),l=ae(null),h=ae(!1),c=ae(null),f=ae(!1),u=ae(null),g=ae(null),p=ae(null),m=ae(null),d=ae(null),v=ae({addedOptionIds:null,eCatalogCount:null,ecatalogs:null,publishVersionId:null,removedOptionIds:null}),_=ae([]),C=ae({ecatalogIds:[],optionItemsToAdd:[]}),y=ae(!1),w=ae(null),A=ae(0),I=2,S=D=>{!Array.isArray(D)||D.every($=>{var H;return $.id&&((H=$.itemTypes)==null?void 0:H.every(J=>{var R;return J.id&&((R=J.options)==null?void 0:R.every(z=>z.id))}))})||D.forEach(($,H)=>{$.id||($.id=`category-${H}-${$.category}`),$.itemTypes&&Array.isArray($.itemTypes)&&$.itemTypes.forEach((J,R)=>{J.id||(J.id=J.itemTypeId||`itemType-${H}-${R}-${J.itemTypeName||"unnamed"}`),J.options&&Array.isArray(J.options)&&J.options.forEach((z,oe)=>{z.id||(z.id=z.itemId||`option-${H}-${R}-${oe}-${z.itemName||"unnamed"}`)})})})},N=async(D,q=null)=>{var $;try{f.value=!0;let H={};if(q)H={fileId:q};else{const R=_.value.find(oe=>oe.status==="Draft"),z=_.value.find(oe=>oe.status==="Active");z?H={fileId:z.id}:R?H={fileId:R.id}:H={itemId:D}}let J=await window.AdminConfiguratorManager.getItemConfiguration({request:JSON.stringify(H)});return J!=null&&J.errorMessage?(e.handleError(J.errorMessage),null):(J=bt(J.data),typeof J.data=="string"&&(J=JSON.parse(J.data)),($=J==null?void 0:J.productItem)!=null&&$.categoryOptions&&S(J.productItem.categoryOptions),l.value=J,f.value=!1,_.value.length===0&&!r.value&&await fe(),J.data)}catch(H){return f.value=!1,e.handleError("Failed to fetch item configuration. Please try again.",H),null}},T=async(D,q="",$="")=>{try{const H={searchTerm:D,itemTypeId:q,filterType:$};let J=await window.AdminConfiguratorManager.getItemsList({request:JSON.stringify(H)});return J=bt(J),J!=null&&J.errorMessage?(e.handleError(J.errorMessage),null):J}catch{return e.handleError("Failed to fetch option list. Please try again."),null}},k=async(D,q)=>{try{const $={productItemId:d.value,optionItemId:D,existingItemType:q};let H=await window.AdminConfiguratorManager.getItemDetails({request:JSON.stringify($)});return H=bt(H),H!=null&&H.errorMessage?(e.handleError(H.errorMessage),null):H}catch{return e.handleError("Failed to fetch option details. Please try again."),null}},E=async()=>{try{const D=await window.AdminConfiguratorManager.getAvailableAttributes();return JSON.parse(D)}catch{e.handleError("Failed to fetch available attributes. Please try again.")}},L=async D=>{try{const q=await window.AdminConfiguratorManager.addAttribute({request:JSON.stringify(D)});return JSON.parse(q)}catch{e.handleError("Failed to fetch item configuration. Please try again.")}},V=async D=>{try{const q=JSON.stringify(D),$=await window.AdminConfiguratorManager.getChildFields({request:q});return JSON.parse($)}catch(q){throw e.handleError("Failed to fetch child fields. Please try again.",q),q}},K=async()=>{const D={objectApiName:"XX_Base__Item_Type__c",fieldApiName:"XX_Base__Item_Type_Category__c"};try{return(await window.AdminConfiguratorManager.getPicklistValues({request:JSON.stringify(D)})).data}catch(q){throw e.handleError("Failed to fetch picklist values. Please try again.",q),q}},W=async()=>{var D,q,$;try{const H=(q=(D=l.value)==null?void 0:D.productItem)==null?void 0:q.itemStatus,R={fileId:($=_.value.find(oe=>oe.status===H))==null?void 0:$.id,itemId:d.value};let z=await window.AdminConfiguratorManager.activateItemConfig({request:JSON.stringify(R)});return z!=null&&z.error?(P(z==null?void 0:z.error),null):(z=bt(z.data),v.value=z,z)}catch{return P(),null}},te=async()=>{try{const D={productId:"068bn00000Anu0YAAR"};return(await window.AdminConfiguratorManager.getECatalogsForProduct({request:JSON.stringify(D)})).data}catch(D){e.handleError("Failed to fetch e catalogs for product. Please try again.",D)}},fe=async()=>{try{const D={productId:d.value},q=await window.AdminConfiguratorManager.getProductConfigInfo({request:JSON.stringify(D)}),$=JSON.parse(q.data);return _.value=$.data,$}catch(D){e.handleError("Failed to save item configuration. Please try again.",D)}},ee=async()=>{try{const D={ecatalogIds:C.value.ecatalogIds,productItemId:d.value,optionItemsToAdd:C.value.optionItemsToAdd};return(await window.AdminConfiguratorManager.saveItemConfigToCatalog({request:JSON.stringify(D)})).data}catch(D){e.handleError("Failed to save item configuration to catalog. Please try again.",D)}},j=async()=>{var D,q,$;try{const H=(q=(D=l.value)==null?void 0:D.productItem)==null?void 0:q.itemStatus,J={itemId:d.value,fileId:($=_.value.find(ce=>ce.status===H))==null?void 0:$.id},R=await window.AdminConfiguratorManager.createNewVersion({request:JSON.stringify(J)}),z=JSON.parse(R);await fe(),await N(d.value,z.id);const oe=_.value.findIndex(ce=>ce.status==="Draft");return oe!==-1?_.value[oe]=z:_.value.push(z),z}catch(H){e.handleError("Failed to create new version. Please try again.",H)}},O=async()=>{var H,J;const D=(H=_.value.find(R=>R.status==="Inactive"))==null?void 0:H.id,q=(J=_.value.find(R=>R.status==="Active"))==null?void 0:J.id,$={itemId:d.value,activeVersionId:q,inactiveVersionId:D};try{return(await window.AdminConfiguratorManager.rollbackItemConfig({request:JSON.stringify($)})).data}catch(R){e.handleError("Failed to rollback item configuration. Please try again.",R)}},P=D=>{D?w.value=D:w.value=null,y.value=!0};return{items:t,loading:r,totalCount:i,currentPage:o,searchTerm:a,itemLimit:s,columns:n,currentItemConfig:l,savingItemConfiguration:h,currentItem:c,configLoader:f,currentItemData:u,currentGroupIndex:g,currentOptionIndex:p,currentOptionData:m,versionInfo:_,activateConfigData:v,activatePayload:C,itemId:d,showActivationErrorModal:y,activationError:w,activationRetryCount:A,maxRetries:I,getItemConfiguration:N,getItemsList:T,getItemDetails:k,getAvailableAttributes:E,addAttribute:L,getChildFields:V,getPicklistValues:K,activateItemConfig:W,getECatalogsForProduct:te,getversionInfo:fe,saveItemConfigToCatalog:ee,createNewVersion:j,rollbackItemConfig:O,addCrossSell:async D=>{const q={itemId:D.id||D.itemId,primarySortOrder:D.primarySortOrder};try{const $=await window.AdminConfiguratorManager.addCrossSell({request:JSON.stringify(q)});return JSON.parse($.data)}catch($){return e.handleError("Failed to add cross sell. Please try again.",$),null}},saveItemConfiguration:async()=>{var D;if(f.value||r.value||h.value||!((D=l.value)!=null&&D.productItem))return null;if(!(l.value.productItem.itemStatus==="Active"||l.value.productItem.itemStatus==="Inactive"))try{h.value=!0;const q={itemId:d.value,configurationData:l.value},$=await window.AdminConfiguratorManager.saveItemConfiguration({request:JSON.stringify(q)});if($!=null&&$.errorMessage)return e.handleError($.errorMessage),null;if(!($!=null&&$.error)){const H=_.value.findIndex(J=>J.status==="Draft");_.value[H].id=$.data}return $}catch(q){return e.handleError("Failed to save item configuration. Please try again.",q),null}finally{h.value=!1}},showActivationError:P,hideActivationError:()=>{y.value=!1,A.value=0},incrementRetryCount:()=>{A.value+=1,y.value=!0},canRetry:()=>A.value<I,assignStableIds:S}}),U4={class:"app-filters-main-wrapper"},z4={class:"app-filters-wrapper"},K4={class:"app-filters"},Z4={class:"left-section"},Q4={class:"ect-flex ect-gap-2 ect-items-center"},X4={class:"ect-absolute ect-top-0 ect-right-0 ect-w-full ect-h-full ect-z-10"},J4={class:"right-section"},W4={class:"after-search-wrapper"},G4={class:"buttons-wrapper"},Y4={class:"before-button-wrapper"},ep={key:0,class:"action-wrapper"},tp={key:1,class:"button-text ect-font-medium"},np={key:2,class:"count-badge"},rp=He({__name:"FilterHeader",props:{title:{type:String,default:""},showSearch:{type:Boolean,default:!1},buttons:{type:Array,default:()=>[],validator:e=>e.every(t=>(t.icon||t.text)&&typeof t.handler=="function")},searchWidth:{type:String,default:"312px"},showBackButton:{type:Boolean,default:!1},statusText:{type:String,default:""},placeholder:{type:String,default:"Search by name"},breadcrumbLinks:{type:Array,default:()=>[],validator:e=>e.every(t=>typeof t=="object"&&typeof t.text=="string"&&(t.route===void 0||typeof t.route=="string"))},recordLink:{type:String,default:""}},emits:["search","back"],setup(e,{emit:t}){const n=H4(),r=e,i=Cr([]);kn(()=>{o()});const o=()=>{i.splice(0,i.length),r.buttons&&r.buttons.length>0&&r.buttons.forEach(u=>{i.push({...u})})};St(()=>r.buttons,()=>{o()},{deep:!0});const a=u=>{s("search",u)},s=t,l=ae(""),h=(u,g)=>{u.supportsToggle&&(u.isActive=!u.isActive),typeof u.handler=="function"&&u.handler(u,u.isActive)},c=()=>{s("back")},f=()=>{if(!r.recordLink)return;let u=r.recordLink;if(!u){let v=n.itemId;if(!v){const _=new URLSearchParams(window.location.search),C=new URLSearchParams(window.location.hash.split("?")[1]);v=_.get("itemId")||C.get("itemId")}u=v}if(!u)return;const p=window.location.href.match(/^(https?:\/\/[^/]+)/);if(!p){console.info("[ERROR]: Unable to extract base domain from current URL");return}const d=`${p[1]}/${u}`;window.open(d,"_blank")};return(u,g)=>(X(),ne("div",U4,[b("div",z4,[b("div",K4,[b("div",Z4,[e.breadcrumbLinks&&e.breadcrumbLinks.length>1?(X(),Te(j4,{key:0,links:e.breadcrumbLinks,"data-test-id":"filter-header-breadcrumbs",class:"ect-mb-3"},null,8,["links"])):ye("",!0),b("div",Q4,[e.showBackButton?(X(),ne("button",{key:0,class:"back-button","data-test-id":"filter-header-button-back",onClick:c},[_e(Ge,{icon:"arrow",symbol:"",size:16,color:"#198708",class:"ect-relative ect-top-[3px]"})])):ye("",!0),e.title?(X(),ne("p",{key:1,class:Ie(["ect-relative ect-text-lg ect-font-semibold ect-leading-5 ect-text-[#1F1F1F] ect-transition-colors ect-duration-200",{"hover:ect-text-[#0076D6] ect-cursor-pointer":e.recordLink}]),"data-test-id":"filter-header-title",onClick:g[0]||(g[0]=p=>e.recordLink?f():null)},[Ve(ve(e.title)+" ",1),e.recordLink?(X(),ne(Oe,{key:0},[_e(Ge,{icon:"open-link",symbol:"",size:16,color:"currentColor",class:"ect-relative ect-top-[3px]"}),b("div",X4,[_e(V4,{class:"ect-min-w-full ect-h-full",direction:"top",content:"View Item in Salesforce","data-test-id":"filter-header-tooltip",width:160})])],64)):ye("",!0)],2)):ye("",!0),e.statusText?(X(),Te(T4,{key:2,text:e.statusText,state:e.statusText.toLowerCase(),"data-test-id":"`filter-header-status-pill`"},null,8,["text","state"])):ye("",!0),Qe(u.$slots,"after-status",{},void 0,!0)])]),b("div",J4,[e.showSearch?(X(),ne("div",{key:0,class:"search-wrapper",style:tt({width:e.searchWidth})},[_e(I4,{modelValue:l.value,"onUpdate:modelValue":[g[1]||(g[1]=p=>l.value=p),a],class:"search-input",placeholder:e.placeholder,"data-test-id":"filter-header-search-input"},null,8,["modelValue","placeholder"])],4)):ye("",!0),b("div",W4,[Qe(u.$slots,"afterSearch",{},void 0,!0)]),b("div",G4,[b("div",Y4,[Qe(u.$slots,"before-button",{},void 0,!0)]),u.$slots.buttons?(X(),ne("div",ep,[Qe(u.$slots,"buttons",{},void 0,!0)])):(X(!0),ne(Oe,{key:1},Ke(i,(p,m)=>(X(),ne("div",{key:m,class:"action-wrapper"},[_e(Pt,{btype:p.type||"primary","button-style":p.style||"outlined",size:"medium",style:tt({minWidth:p.minWidth||"auto"}),class:Ie([{active:p.isActive},{"icon-only":p.icon&&!p.text},{"text-button":p.text}]),loading:p.loading,disabled:p.disabled,"data-test-id":`filter-header-button-${p.text?p.text.toLowerCase().replace(/\s+/g,"-"):m}`,onClick:d=>h(p)},{default:Be(()=>[p.icon?(X(),Te(Ge,{key:0,icon:p.icon,symbol:"",color:p.color||"#136E05",size:p.size||14},null,8,["icon","color","size"])):ye("",!0),p.text?(X(),ne("span",tp,ve(p.isActive?p.altText:p.text),1)):ye("",!0),p.count?(X(),ne("span",np,ve(p.count),1)):ye("",!0)]),_:2},1032,["btype","button-style","style","class","loading","disabled","data-test-id","onClick"])]))),128))])])])])]))}},[["__scopeId","data-v-2ea70801"]]),ip=["data-test-id"],op=["data-test-id"],ap=["data-test-id"],sp=["data-test-id"],lp=["data-test-id"],cp=["data-test-id"],up=["data-test-id"],fp=He({__name:"ecSwitch",props:Al({text:{type:[String,Object],required:!1,validator:e=>typeof e=="string"?!0:typeof e=="object"&&e!==null?Object.prototype.hasOwnProperty.call(e,"on")&&Object.prototype.hasOwnProperty.call(e,"off"):!1},subtext:{type:String,required:!1},size:{type:String,default:"regular",validator:e=>["regular","large"].includes(e)},disabled:{type:Boolean,default:!1},dataTestId:{type:String,default:""},leftAlign:{type:Boolean,default:!1}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:Al(["update:modelValue"],["update:modelValue"]),setup(e,{emit:t}){const n=e,r=Dd(e,"modelValue"),i=t,o=be(()=>typeof n.text=="string"?n.text:typeof n.text=="object"&&n.text!==null?r.value?n.text.on:n.text.off:""),a=()=>{n.disabled||i("update:modelValue",!r.value)};return(s,l)=>(X(),ne("div",{class:Ie(["ec-switch-container",{disabled:e.disabled}]),"data-test-id":e.dataTestId},[e.leftAlign?(X(),ne("span",{key:0,class:"ec-switch__label","data-test-id":`${e.dataTestId}-label`},[Ve(ve(o.value)+" ",1),e.subtext?(X(),ne("span",{key:0,class:"ec-switch__subtext","data-test-id":`${e.dataTestId}-subtext`},ve(e.subtext),9,ap)):ye("",!0)],8,op)):ye("",!0),b("div",{class:Ie(["ec-switch",{"ec-switch--active":r.value,"ec-switch--large":e.size==="large"}]),"data-test-id":`${e.dataTestId}-switch`,onClick:a},[b("div",{class:"ec-switch__handle","data-test-id":`${e.dataTestId}-handle`},null,8,lp)],10,sp),e.leftAlign?ye("",!0):(X(),ne("span",{key:1,class:"ec-switch__label","data-test-id":`${e.dataTestId}-label`},[Ve(ve(o.value)+" ",1),e.subtext?(X(),ne("span",{key:0,class:"ec-switch__subtext","data-test-id":`${e.dataTestId}-subtext`},ve(e.subtext),9,up)):ye("",!0)],8,cp))],10,ip))}},[["__scopeId","data-v-cfefad9a"]]),dp={key:0,class:"ect-bg-white ect-h-full ect-flex ect-flex-col ect-overflow-auto"},hp={class:"ect-sticky ect-top-0 ect-z-50 ect-bg-white","data-test-id":"configurator-header-sticky"},pp={class:"ect-flex ect-flex-col ect-sticky ect-top-0 ect-z-50 ect-bg-white ect-border-b ect-border-gray-200"},gp={key:0,class:"ect-flex-1 ect-min-h-0 ect-overflow-y-auto ect-bg-light-bg-x","data-test-id":"configurator-content-scrollable"},mp=He({__name:"ProductConfiguration",setup(e){const t=ln(),n=ae(!1),r=ae(0),i=be(()=>t.configuration),o=be(()=>n.value?[{text:"Done",altText:"Done",type:"primary",style:"primary",handler:()=>a()}]:[{text:"Save",altText:"Save",type:t.isChangedConfiguration?"primary":"secondary",style:"primary",disabled:!t.isChangedConfiguration,handler:()=>s()}]),a=()=>{n.value=!1},s=()=>{console.info("Save"),t.maintainQuoteConfiguration()};return(l,h)=>Me(t).configuration?(X(),ne("div",dp,[Me(t).savedScreen?(X(),Te(K5,{key:1})):(X(),ne(Oe,{key:0},[b("div",hp,[b("div",pp,[ye("",!0),_e(rp,{title:i.value.itemName,buttons:o.value},{"before-button":Be(()=>[Me(t).isYearlyPricingExist?(X(),Te(fp,{key:0,modelValue:Me(t).showYearlyPricing,"onUpdate:modelValue":[h[0]||(h[0]=c=>Me(t).showYearlyPricing=c),Me(t).changePricingScheme],"left-align":"",class:"ect-text-nowrap",text:{on:"Yearly Price",off:"Monthly Price"},"data-test-id":"configurator-switch-show-yearly-pricing"},null,8,["modelValue","onUpdate:modelValue"])):ye("",!0)]),_:1},8,["title","buttons"])]),b("div",{class:Ie(n.value?"ect-pb-16":"ect-pb-0")},[_e(x4,{config:i.value,"edit-attributes":n.value,scroll:r.value,onEditAttributes:h[1]||(h[1]=c=>n.value=!0)},null,8,["config","edit-attributes","scroll"])],2)]),n.value?ye("",!0):(X(),ne("div",gp,[_e(h4)]))],64))])):ye("",!0)}},[["__scopeId","data-v-9269c2c0"]]),vp=["data-item-id","data-qli-id"],yp={key:0,class:"ect-flex-1 ect-min-h-0"},_p={key:1,class:"ect-flex-1 ect-min-h-0"},bp={__name:"Configurator",props:{itemId:{type:String,required:!0},qliId:{type:String,required:!1}},setup(e){xa();const t=e,n=ae(!0),r=ln();return xn(async()=>{n.value=!0,await r.initConfigurator(t.itemId,t.qliId),n.value=!1}),(i,o)=>(X(),ne("div",{class:"ect-h-screen ect-flex ect-flex-col","data-item-id":e.itemId,"data-qli-id":e.qliId},[n.value?(X(),ne("div",_p,[_e(wa)])):(X(),ne("div",yp,[_e(mp)]))],8,vp))}};function Jc(e,t){return function(){return e.apply(t,arguments)}}const{toString:Cp}=Object.prototype,{getPrototypeOf:Ra}=Object,{iterator:Yi,toStringTag:Wc}=Symbol,eo=(e=>t=>{const n=Cp.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),jt=e=>(e=e.toLowerCase(),t=>eo(t)===e),to=e=>t=>typeof t===e,{isArray:lr}=Array,cr=to("undefined");function Hr(e){return e!==null&&!cr(e)&&e.constructor!==null&&!cr(e.constructor)&&wt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Gc=jt("ArrayBuffer");function wp(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Gc(e.buffer),t}const xp=to("string"),wt=to("function"),Yc=to("number"),Ur=e=>e!==null&&typeof e=="object",kp=e=>e===!0||e===!1,no=e=>{if(eo(e)!=="object")return!1;const t=Ra(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Wc in e)&&!(Yi in e)},Ep=e=>{if(!Ur(e)||Hr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Op=jt("Date"),Sp=jt("File"),Ip=jt("Blob"),Ap=jt("FileList"),Tp=e=>Ur(e)&&wt(e.pipe),Np=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||wt(e.append)&&((t=eo(e))==="formdata"||t==="object"&&wt(e.toString)&&e.toString()==="[object FormData]"))},Pp=jt("URLSearchParams"),[Lp,Rp,Mp,qp]=["ReadableStream","Request","Response","Headers"].map(jt),jp=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function zr(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),lr(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(Hr(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let s;for(r=0;r<a;r++)s=o[r],t.call(null,e[s],s,e)}}function eu(e,t){if(Hr(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Vn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,tu=e=>!cr(e)&&e!==Vn;function Ma(){const{caseless:e,skipUndefined:t}=tu(this)&&this||{},n={},r=(i,o)=>{const a=e&&eu(n,o)||o;no(n[a])&&no(i)?n[a]=Ma(n[a],i):no(i)?n[a]=Ma({},i):lr(i)?n[a]=i.slice():(!t||!cr(i))&&(n[a]=i)};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&zr(arguments[i],r);return n}const Dp=(e,t,n,{allOwnKeys:r}={})=>(zr(t,(i,o)=>{n&&wt(i)?e[o]=Jc(i,n):e[o]=i},{allOwnKeys:r}),e),Bp=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),$p=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Fp=(e,t,n,r)=>{let i,o,a;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],(!r||r(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=n!==!1&&Ra(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Vp=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Hp=e=>{if(!e)return null;if(lr(e))return e;let t=e.length;if(!Yc(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Up=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ra(Uint8Array)),zp=(e,t)=>{const r=(e&&e[Yi]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},Kp=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Zp=jt("HTMLFormElement"),Qp=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),nu=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Xp=jt("RegExp"),ru=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};zr(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(r[o]=a||i)}),Object.defineProperties(e,r)},Jp=e=>{ru(e,(t,n)=>{if(wt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(wt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Wp=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return lr(e)?r(e):r(String(e).split(t)),n},Gp=()=>{},Yp=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function e3(e){return!!(e&&wt(e.append)&&e[Wc]==="FormData"&&e[Yi])}const t3=e=>{const t=new Array(10),n=(r,i)=>{if(Ur(r)){if(t.indexOf(r)>=0)return;if(Hr(r))return r;if(!("toJSON"in r)){t[i]=r;const o=lr(r)?[]:{};return zr(r,(a,s)=>{const l=n(a,i+1);!cr(l)&&(o[s]=l)}),t[i]=void 0,o}}return r};return n(e,0)},n3=jt("AsyncFunction"),r3=e=>e&&(Ur(e)||wt(e))&&wt(e.then)&&wt(e.catch),iu=((e,t)=>e?setImmediate:t?((n,r)=>(Vn.addEventListener("message",({source:i,data:o})=>{i===Vn&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Vn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",wt(Vn.postMessage)),i3=typeof queueMicrotask<"u"?queueMicrotask.bind(Vn):typeof process<"u"&&process.nextTick||iu,de={isArray:lr,isArrayBuffer:Gc,isBuffer:Hr,isFormData:Np,isArrayBufferView:wp,isString:xp,isNumber:Yc,isBoolean:kp,isObject:Ur,isPlainObject:no,isEmptyObject:Ep,isReadableStream:Lp,isRequest:Rp,isResponse:Mp,isHeaders:qp,isUndefined:cr,isDate:Op,isFile:Sp,isBlob:Ip,isRegExp:Xp,isFunction:wt,isStream:Tp,isURLSearchParams:Pp,isTypedArray:Up,isFileList:Ap,forEach:zr,merge:Ma,extend:Dp,trim:jp,stripBOM:Bp,inherits:$p,toFlatObject:Fp,kindOf:eo,kindOfTest:jt,endsWith:Vp,toArray:Hp,forEachEntry:zp,matchAll:Kp,isHTMLForm:Zp,hasOwnProperty:nu,hasOwnProp:nu,reduceDescriptors:ru,freezeMethods:Jp,toObjectSet:Wp,toCamelCase:Qp,noop:Gp,toFiniteNumber:Yp,findKey:eu,global:Vn,isContextDefined:tu,isSpecCompliantForm:e3,toJSONObject:t3,isAsyncFn:n3,isThenable:r3,setImmediate:iu,asap:i3,isIterable:e=>e!=null&&wt(e[Yi])};function Pe(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}de.inherits(Pe,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:de.toJSONObject(this.config),code:this.code,status:this.status}}});const ou=Pe.prototype,au={};["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(e=>{au[e]={value:e}}),Object.defineProperties(Pe,au),Object.defineProperty(ou,"isAxiosError",{value:!0}),Pe.from=(e,t,n,r,i,o)=>{const a=Object.create(ou);de.toFlatObject(e,a,function(c){return c!==Error.prototype},h=>h!=="isAxiosError");const s=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return Pe.call(a,s,l,n,r,i),e&&a.cause==null&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",o&&Object.assign(a,o),a};const o3=null;function qa(e){return de.isPlainObject(e)||de.isArray(e)}function su(e){return de.endsWith(e,"[]")?e.slice(0,-2):e}function lu(e,t,n){return e?e.concat(t).map(function(i,o){return i=su(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function a3(e){return de.isArray(e)&&!e.some(qa)}const s3=de.toFlatObject(de,{},null,function(t){return/^is[A-Z]/.test(t)});function ro(e,t,n){if(!de.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=de.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,d){return!de.isUndefined(d[m])});const r=n.metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&de.isSpecCompliantForm(t);if(!de.isFunction(i))throw new TypeError("visitor must be a function");function h(p){if(p===null)return"";if(de.isDate(p))return p.toISOString();if(de.isBoolean(p))return p.toString();if(!l&&de.isBlob(p))throw new Pe("Blob is not supported. Use a Buffer instead.");return de.isArrayBuffer(p)||de.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function c(p,m,d){let v=p;if(p&&!d&&typeof p=="object"){if(de.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(de.isArray(p)&&a3(p)||(de.isFileList(p)||de.endsWith(m,"[]"))&&(v=de.toArray(p)))return m=su(m),v.forEach(function(C,y){!(de.isUndefined(C)||C===null)&&t.append(a===!0?lu([m],y,o):a===null?m:m+"[]",h(C))}),!1}return qa(p)?!0:(t.append(lu(d,m,o),h(p)),!1)}const f=[],u=Object.assign(s3,{defaultVisitor:c,convertValue:h,isVisitable:qa});function g(p,m){if(!de.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(p),de.forEach(p,function(v,_){(!(de.isUndefined(v)||v===null)&&i.call(t,v,de.isString(_)?_.trim():_,m,u))===!0&&g(v,m?m.concat(_):[_])}),f.pop()}}if(!de.isObject(e))throw new TypeError("data must be an object");return g(e),t}function cu(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ja(e,t){this._pairs=[],e&&ro(e,this,t)}const uu=ja.prototype;uu.append=function(t,n){this._pairs.push([t,n])},uu.toString=function(t){const n=t?function(r){return t.call(this,r,cu)}:cu;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function l3(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function fu(e,t,n){if(!t)return e;const r=n&&n.encode||l3;de.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=de.isURLSearchParams(t)?t.toString():new ja(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class du{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){de.forEach(this.handlers,function(r){r!==null&&t(r)})}}const hu={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},c3={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ja,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Da=typeof window<"u"&&typeof document<"u",Ba=typeof navigator=="object"&&navigator||void 0,u3=Da&&(!Ba||["ReactNative","NativeScript","NS"].indexOf(Ba.product)<0),f3=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",d3=Da&&window.location.href||"http://localhost",ft={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Da,hasStandardBrowserEnv:u3,hasStandardBrowserWebWorkerEnv:f3,navigator:Ba,origin:d3},Symbol.toStringTag,{value:"Module"})),...c3};function h3(e,t){return ro(e,new ft.classes.URLSearchParams,{visitor:function(n,r,i,o){return ft.isNode&&de.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function p3(e){return de.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function g3(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}function pu(e){function t(n,r,i,o){let a=n[o++];if(a==="__proto__")return!0;const s=Number.isFinite(+a),l=o>=n.length;return a=!a&&de.isArray(i)?i.length:a,l?(de.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!s):((!i[a]||!de.isObject(i[a]))&&(i[a]=[]),t(n,r,i[a],o)&&de.isArray(i[a])&&(i[a]=g3(i[a])),!s)}if(de.isFormData(e)&&de.isFunction(e.entries)){const n={};return de.forEachEntry(e,(r,i)=>{t(p3(r),i,n,0)}),n}return null}function m3(e,t,n){if(de.isString(e))try{return(t||JSON.parse)(e),de.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const $a={transitional:hu,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=de.isObject(t);if(o&&de.isHTMLForm(t)&&(t=new FormData(t)),de.isFormData(t))return i?JSON.stringify(pu(t)):t;if(de.isArrayBuffer(t)||de.isBuffer(t)||de.isStream(t)||de.isFile(t)||de.isBlob(t)||de.isReadableStream(t))return t;if(de.isArrayBufferView(t))return t.buffer;if(de.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return h3(t,this.formSerializer).toString();if((s=de.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ro(s?{"files[]":t}:t,l&&new l,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),m3(t)):t}],transformResponse:[function(t){const n=this.transitional||$a.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(de.isResponse(t)||de.isReadableStream(t))return t;if(t&&de.isString(t)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(s){if(a)throw s.name==="SyntaxError"?Pe.from(s,Pe.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ft.classes.FormData,Blob:ft.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};de.forEach(["delete","get","head","post","put","patch"],e=>{$a.headers[e]={}});const Fa=$a,v3=de.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"]),y3=e=>{const t={};let n,r,i;return e&&e.split(`
82
82
  `).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||t[n]&&v3[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},gu=Symbol("internals");function Kr(e){return e&&String(e).trim().toLowerCase()}function io(e){return e===!1||e==null?e:de.isArray(e)?e.map(io):String(e)}function _3(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const b3=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Va(e,t,n,r,i){if(de.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!de.isString(t)){if(de.isString(r))return t.indexOf(r)!==-1;if(de.isRegExp(r))return r.test(t)}}function C3(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function w3(e,t){const n=de.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,a){return this[r].call(this,t,i,o,a)},configurable:!0})})}class oo{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(s,l,h){const c=Kr(l);if(!c)throw new Error("header name must be a non-empty string");const f=de.findKey(i,c);(!f||i[f]===void 0||h===!0||h===void 0&&i[f]!==!1)&&(i[f||l]=io(s))}const a=(s,l)=>de.forEach(s,(h,c)=>o(h,c,l));if(de.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(de.isString(t)&&(t=t.trim())&&!b3(t))a(y3(t),n);else if(de.isObject(t)&&de.isIterable(t)){let s={},l,h;for(const c of t){if(!de.isArray(c))throw TypeError("Object iterator must return a key-value pair");s[h=c[0]]=(l=s[h])?de.isArray(l)?[...l,c[1]]:[l,c[1]]:c[1]}a(s,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=Kr(t),t){const r=de.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return _3(i);if(de.isFunction(n))return n.call(this,i,r);if(de.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Kr(t),t){const r=de.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Va(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(a){if(a=Kr(a),a){const s=de.findKey(r,a);s&&(!n||Va(r,r[s],s,n))&&(delete r[s],i=!0)}}return de.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||Va(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return de.forEach(this,(i,o)=>{const a=de.findKey(r,o);if(a){n[a]=io(i),delete n[o];return}const s=t?C3(o):String(o).trim();s!==o&&delete n[o],n[s]=io(i),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return de.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&de.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
83
83
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[gu]=this[gu]={accessors:{}}).accessors,i=this.prototype;function o(a){const s=Kr(a);r[s]||(w3(i,a),r[s]=!0)}return de.isArray(t)?t.forEach(o):o(t),this}}oo.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),de.reduceDescriptors(oo.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),de.freezeMethods(oo);const Dt=oo;function Ha(e,t){const n=this||Fa,r=t||n,i=Dt.from(r.headers);let o=r.data;return de.forEach(e,function(s){o=s.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function mu(e){return!!(e&&e.__CANCEL__)}function ur(e,t,n){Pe.call(this,e??"canceled",Pe.ERR_CANCELED,t,n),this.name="CanceledError"}de.inherits(ur,Pe,{__CANCEL__:!0});function vu(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Pe("Request failed with status code "+n.status,[Pe.ERR_BAD_REQUEST,Pe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function x3(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function k3(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(l){const h=Date.now(),c=r[o];a||(a=h),n[i]=l,r[i]=h;let f=o,u=0;for(;f!==i;)u+=n[f++],f=f%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),h-a<t)return;const g=c&&h-c;return g?Math.round(u*1e3/g):void 0}}function E3(e,t){let n=0,r=1e3/t,i,o;const a=(h,c=Date.now())=>{n=c,i=null,o&&(clearTimeout(o),o=null),e(...h)};return[(...h)=>{const c=Date.now(),f=c-n;f>=r?a(h,c):(i=h,o||(o=setTimeout(()=>{o=null,a(i)},r-f)))},()=>i&&a(i)]}const ao=(e,t,n=3)=>{let r=0;const i=k3(50,250);return E3(o=>{const a=o.loaded,s=o.lengthComputable?o.total:void 0,l=a-r,h=i(l),c=a<=s;r=a;const f={loaded:a,total:s,progress:s?a/s:void 0,bytes:l,rate:h||void 0,estimated:h&&s&&c?(s-a)/h:void 0,event:o,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(f)},n)},yu=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},_u=e=>(...t)=>de.asap(()=>e(...t)),O3=ft.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ft.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ft.origin),ft.navigator&&/(msie|trident)/i.test(ft.navigator.userAgent)):()=>!0,S3=ft.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(t)}`];de.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),de.isString(r)&&s.push(`path=${r}`),de.isString(i)&&s.push(`domain=${i}`),o===!0&&s.push("secure"),de.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function I3(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function A3(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function bu(e,t,n){let r=!I3(t);return e&&(r||n==!1)?A3(e,t):t}const Cu=e=>e instanceof Dt?{...e}:e;function Hn(e,t){t=t||{};const n={};function r(h,c,f,u){return de.isPlainObject(h)&&de.isPlainObject(c)?de.merge.call({caseless:u},h,c):de.isPlainObject(c)?de.merge({},c):de.isArray(c)?c.slice():c}function i(h,c,f,u){if(de.isUndefined(c)){if(!de.isUndefined(h))return r(void 0,h,f,u)}else return r(h,c,f,u)}function o(h,c){if(!de.isUndefined(c))return r(void 0,c)}function a(h,c){if(de.isUndefined(c)){if(!de.isUndefined(h))return r(void 0,h)}else return r(void 0,c)}function s(h,c,f){if(f in t)return r(h,c);if(f in e)return r(void 0,h)}const l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(h,c,f)=>i(Cu(h),Cu(c),f,!0)};return de.forEach(Object.keys({...e,...t}),function(c){const f=l[c]||i,u=f(e[c],t[c],c);de.isUndefined(u)&&f!==s||(n[c]=u)}),n}const wu=e=>{const t=Hn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:s}=t;if(t.headers=a=Dt.from(a),t.url=fu(bu(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),de.isFormData(n)){if(ft.hasStandardBrowserEnv||ft.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(de.isFunction(n.getHeaders)){const l=n.getHeaders(),h=["content-type","content-length"];Object.entries(l).forEach(([c,f])=>{h.includes(c.toLowerCase())&&a.set(c,f)})}}if(ft.hasStandardBrowserEnv&&(r&&de.isFunction(r)&&(r=r(t)),r||r!==!1&&O3(t.url))){const l=i&&o&&S3.read(o);l&&a.set(i,l)}return t},T3=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=wu(e);let o=i.data;const a=Dt.from(i.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:h}=i,c,f,u,g,p;function m(){g&&g(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let d=new XMLHttpRequest;d.open(i.method.toUpperCase(),i.url,!0),d.timeout=i.timeout;function v(){if(!d)return;const C=Dt.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),w={data:!s||s==="text"||s==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:C,config:e,request:d};vu(function(I){n(I),m()},function(I){r(I),m()},w),d=null}"onloadend"in d?d.onloadend=v:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(v)},d.onabort=function(){d&&(r(new Pe("Request aborted",Pe.ECONNABORTED,e,d)),d=null)},d.onerror=function(y){const w=y&&y.message?y.message:"Network Error",A=new Pe(w,Pe.ERR_NETWORK,e,d);A.event=y||null,r(A),d=null},d.ontimeout=function(){let y=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||hu;i.timeoutErrorMessage&&(y=i.timeoutErrorMessage),r(new Pe(y,w.clarifyTimeoutError?Pe.ETIMEDOUT:Pe.ECONNABORTED,e,d)),d=null},o===void 0&&a.setContentType(null),"setRequestHeader"in d&&de.forEach(a.toJSON(),function(y,w){d.setRequestHeader(w,y)}),de.isUndefined(i.withCredentials)||(d.withCredentials=!!i.withCredentials),s&&s!=="json"&&(d.responseType=i.responseType),h&&([u,p]=ao(h,!0),d.addEventListener("progress",u)),l&&d.upload&&([f,g]=ao(l),d.upload.addEventListener("progress",f),d.upload.addEventListener("loadend",g)),(i.cancelToken||i.signal)&&(c=C=>{d&&(r(!C||C.type?new ur(null,e,d):C),d.abort(),d=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const _=x3(i.url);if(_&&ft.protocols.indexOf(_)===-1){r(new Pe("Unsupported protocol "+_+":",Pe.ERR_BAD_REQUEST,e));return}d.send(o||null)})},N3=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(h){if(!i){i=!0,s();const c=h instanceof Error?h:this.reason;r.abort(c instanceof Pe?c:new ur(c instanceof Error?c.message:c))}};let a=t&&setTimeout(()=>{a=null,o(new Pe(`timeout ${t} of ms exceeded`,Pe.ETIMEDOUT))},t);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(o):h.removeEventListener("abort",o)}),e=null)};e.forEach(h=>h.addEventListener("abort",o));const{signal:l}=r;return l.unsubscribe=()=>de.asap(s),l}},P3=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},L3=async function*(e,t){for await(const n of R3(e))yield*P3(n,t)},R3=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},xu=(e,t,n,r)=>{const i=L3(e,t);let o=0,a,s=l=>{a||(a=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:h,value:c}=await i.next();if(h){s(),l.close();return}let f=c.byteLength;if(n){let u=o+=f;n(u)}l.enqueue(new Uint8Array(c))}catch(h){throw s(h),h}},cancel(l){return s(l),i.return()}},{highWaterMark:2})},ku=64*1024,{isFunction:so}=de,M3=(({Request:e,Response:t})=>({Request:e,Response:t}))(de.global),{ReadableStream:Eu,TextEncoder:Ou}=de.global,Su=(e,...t)=>{try{return!!e(...t)}catch{return!1}},q3=e=>{e=de.merge.call({skipUndefined:!0},M3,e);const{fetch:t,Request:n,Response:r}=e,i=t?so(t):typeof fetch=="function",o=so(n),a=so(r);if(!i)return!1;const s=i&&so(Eu),l=i&&(typeof Ou=="function"?(p=>m=>p.encode(m))(new Ou):async p=>new Uint8Array(await new n(p).arrayBuffer())),h=o&&s&&Su(()=>{let p=!1;const m=new n(ft.origin,{body:new Eu,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!m}),c=a&&s&&Su(()=>de.isReadableStream(new r("").body)),f={stream:c&&(p=>p.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!f[p]&&(f[p]=(m,d)=>{let v=m&&m[p];if(v)return v.call(m);throw new Pe(`Response type '${p}' is not supported`,Pe.ERR_NOT_SUPPORT,d)})});const u=async p=>{if(p==null)return 0;if(de.isBlob(p))return p.size;if(de.isSpecCompliantForm(p))return(await new n(ft.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(de.isArrayBufferView(p)||de.isArrayBuffer(p))return p.byteLength;if(de.isURLSearchParams(p)&&(p=p+""),de.isString(p))return(await l(p)).byteLength},g=async(p,m)=>{const d=de.toFiniteNumber(p.getContentLength());return d??u(m)};return async p=>{let{url:m,method:d,data:v,signal:_,cancelToken:C,timeout:y,onDownloadProgress:w,onUploadProgress:A,responseType:I,headers:S,withCredentials:N="same-origin",fetchOptions:T}=wu(p),k=t||fetch;I=I?(I+"").toLowerCase():"text";let E=N3([_,C&&C.toAbortSignal()],y),L=null;const V=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let K;try{if(A&&h&&d!=="get"&&d!=="head"&&(K=await g(S,v))!==0){let O=new n(m,{method:"POST",body:v,duplex:"half"}),P;if(de.isFormData(v)&&(P=O.headers.get("content-type"))&&S.setContentType(P),O.body){const[M,Z]=yu(K,ao(_u(A)));v=xu(O.body,ku,M,Z)}}de.isString(N)||(N=N?"include":"omit");const W=o&&"credentials"in n.prototype,te={...T,signal:E,method:d.toUpperCase(),headers:S.normalize().toJSON(),body:v,duplex:"half",credentials:W?N:void 0};L=o&&new n(m,te);let fe=await(o?k(L,T):k(m,te));const ee=c&&(I==="stream"||I==="response");if(c&&(w||ee&&V)){const O={};["status","statusText","headers"].forEach(Q=>{O[Q]=fe[Q]});const P=de.toFiniteNumber(fe.headers.get("content-length")),[M,Z]=w&&yu(P,ao(_u(w),!0))||[];fe=new r(xu(fe.body,ku,M,()=>{Z&&Z(),V&&V()}),O)}I=I||"text";let j=await f[de.findKey(f,I)||"text"](fe,p);return!ee&&V&&V(),await new Promise((O,P)=>{vu(O,P,{data:j,headers:Dt.from(fe.headers),status:fe.status,statusText:fe.statusText,config:p,request:L})})}catch(W){throw V&&V(),W&&W.name==="TypeError"&&/Load failed|fetch/i.test(W.message)?Object.assign(new Pe("Network Error",Pe.ERR_NETWORK,p,L),{cause:W.cause||W}):Pe.from(W,W&&W.code,p,L)}}},j3=new Map,Iu=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let a=o.length,s=a,l,h,c=j3;for(;s--;)l=o[s],h=c.get(l),h===void 0&&c.set(l,h=s?new Map:q3(t)),c=h;return h};Iu();const Ua={http:o3,xhr:T3,fetch:{get:Iu}};de.forEach(Ua,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Au=e=>`- ${e}`,D3=e=>de.isFunction(e)||e===null||e===!1;function B3(e,t){e=de.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a<n;a++){r=e[a];let s;if(i=r,!D3(r)&&(i=Ua[(s=String(r)).toLowerCase()],i===void 0))throw new Pe(`Unknown adapter '${s}'`);if(i&&(de.isFunction(i)||(i=i.get(t))))break;o[s||"#"+a]=i}if(!i){const a=Object.entries(o).map(([l,h])=>`adapter ${l} `+(h===!1?"is not supported by the environment":"is not available in the build"));let s=n?a.length>1?`since :
84
84
  `+a.map(Au).join(`