@expedite-commerce/expedite-components 0.2.82 → 0.2.83
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.
|
@@ -41492,7 +41492,7 @@ const jT = ["innerHTML"], HT = {
|
|
|
41492
41492
|
])
|
|
41493
41493
|
]));
|
|
41494
41494
|
}
|
|
41495
|
-
}, qO = (e) => (tn("data-v-
|
|
41495
|
+
}, qO = (e) => (tn("data-v-2f2aa6e4"), e = e(), nn(), e), $O = {
|
|
41496
41496
|
class: "ect-h-full ect-w-full ect-bg-white",
|
|
41497
41497
|
"data-test-id": "aiComponentLoader-wrapper"
|
|
41498
41498
|
}, jO = {
|
|
@@ -41554,7 +41554,7 @@ const jT = ["innerHTML"], HT = {
|
|
|
41554
41554
|
setup(e, { emit: n }) {
|
|
41555
41555
|
const t = n, r = e, o = Vo(), i = Tc(), a = Kt(), s = me(() => ({
|
|
41556
41556
|
...r.session,
|
|
41557
|
-
qliId: m.value,
|
|
41557
|
+
qliId: m.value || r.configQliId || void 0,
|
|
41558
41558
|
itemId: d.value
|
|
41559
41559
|
})), l = me(() => {
|
|
41560
41560
|
const S = o == null ? void 0 : o.activeComponentKey, M = r.stepComponent;
|
|
@@ -41765,73 +41765,67 @@ const jT = ["innerHTML"], HT = {
|
|
|
41765
41765
|
(S == null ? void 0 : S.actionFunction) === "Reload" && (console.log("Reloading configurator 1"), i.refresh());
|
|
41766
41766
|
},
|
|
41767
41767
|
{ deep: !0 }
|
|
41768
|
-
), (S, M) =>
|
|
41769
|
-
|
|
41770
|
-
|
|
41771
|
-
|
|
41772
|
-
|
|
41773
|
-
|
|
41774
|
-
|
|
41775
|
-
|
|
41776
|
-
|
|
41777
|
-
|
|
41778
|
-
|
|
41779
|
-
|
|
41780
|
-
|
|
41781
|
-
|
|
41782
|
-
|
|
41783
|
-
|
|
41784
|
-
|
|
41785
|
-
|
|
41786
|
-
|
|
41787
|
-
|
|
41788
|
-
|
|
41789
|
-
|
|
41790
|
-
|
|
41791
|
-
|
|
41792
|
-
|
|
41793
|
-
|
|
41794
|
-
|
|
41795
|
-
|
|
41796
|
-
|
|
41797
|
-
|
|
41798
|
-
|
|
41799
|
-
|
|
41800
|
-
|
|
41801
|
-
|
|
41802
|
-
|
|
41803
|
-
|
|
41804
|
-
|
|
41805
|
-
|
|
41806
|
-
|
|
41807
|
-
|
|
41808
|
-
|
|
41809
|
-
|
|
41810
|
-
|
|
41811
|
-
|
|
41812
|
-
|
|
41813
|
-
|
|
41814
|
-
|
|
41815
|
-
|
|
41816
|
-
|
|
41817
|
-
|
|
41818
|
-
|
|
41819
|
-
|
|
41820
|
-
|
|
41821
|
-
|
|
41822
|
-
|
|
41823
|
-
|
|
41824
|
-
|
|
41825
|
-
|
|
41826
|
-
|
|
41827
|
-
UO,
|
|
41828
|
-
C("div", VO, ge(v.value), 1)
|
|
41829
|
-
])
|
|
41830
|
-
]))
|
|
41831
|
-
]);
|
|
41832
|
-
};
|
|
41768
|
+
), (S, M) => (B(), U("div", $O, [
|
|
41769
|
+
l.value === "catalog" ? (B(), xe(X2, {
|
|
41770
|
+
key: x.value,
|
|
41771
|
+
"data-test-id": "aiComponentLoader-catalog",
|
|
41772
|
+
class: "ect-h-full ect-w-full",
|
|
41773
|
+
"template-id": e.templateId,
|
|
41774
|
+
identity: e.identity,
|
|
41775
|
+
session: e.session,
|
|
41776
|
+
security: e.security,
|
|
41777
|
+
"search-term": h.value,
|
|
41778
|
+
"on-catalog-count-update": e.onCatalogCountUpdate,
|
|
41779
|
+
"preview-data": e.catalogPreviewData,
|
|
41780
|
+
"initial-data": c.value,
|
|
41781
|
+
sections: e.sections,
|
|
41782
|
+
theme: e.theme,
|
|
41783
|
+
"composables-org-type": e.composablesOrgType,
|
|
41784
|
+
onCatalogQuoteCreated: O,
|
|
41785
|
+
onCatalogQuoteUpdated: F,
|
|
41786
|
+
onCatalogItemsLoaded: E,
|
|
41787
|
+
onCatalogItemAdded: I,
|
|
41788
|
+
onCatalogItemQtyUpdated: k,
|
|
41789
|
+
onCatalogLineDeleted: T,
|
|
41790
|
+
onCatalogItemsFetched: D,
|
|
41791
|
+
onCatalogItemConfigure: H,
|
|
41792
|
+
"onCatalog:id": Y
|
|
41793
|
+
}, null, 8, ["template-id", "identity", "session", "security", "search-term", "on-catalog-count-update", "preview-data", "initial-data", "sections", "theme", "composables-org-type"])) : l.value === "cart" && u.value ? (B(), xe(K2, {
|
|
41794
|
+
key: g.value,
|
|
41795
|
+
"data-test-id": "aiComponentLoader-cart",
|
|
41796
|
+
class: "ect-h-full ect-w-full",
|
|
41797
|
+
"template-id": e.templateId,
|
|
41798
|
+
"host-name": e.hostName,
|
|
41799
|
+
"composables-org-type": e.composablesOrgType,
|
|
41800
|
+
security: e.security,
|
|
41801
|
+
identity: e.identity,
|
|
41802
|
+
session: e.session,
|
|
41803
|
+
onExpeditecartItemConfigure: ie,
|
|
41804
|
+
onExpeditecartClicked: te
|
|
41805
|
+
}, null, 8, ["template-id", "host-name", "composables-org-type", "security", "identity", "session"])) : l.value === "configurator" && f.value ? (B(), xe(R2, {
|
|
41806
|
+
key: b.value,
|
|
41807
|
+
"data-test-id": "aiComponentLoader-configurator",
|
|
41808
|
+
class: "ect-h-full ect-w-full",
|
|
41809
|
+
security: e.security,
|
|
41810
|
+
identity: e.identity,
|
|
41811
|
+
"user-locale": S.userLocale,
|
|
41812
|
+
"composables-org-type": e.composablesOrgType,
|
|
41813
|
+
session: s.value,
|
|
41814
|
+
onReady: Ae(i).setExpediteConfigComp,
|
|
41815
|
+
onAction: N
|
|
41816
|
+
}, null, 8, ["security", "identity", "user-locale", "composables-org-type", "session", "onReady"])) : l.value === "configurator" && !f.value ? (B(), xe(PO, {
|
|
41817
|
+
key: 3,
|
|
41818
|
+
onReturn: j,
|
|
41819
|
+
onGoCart: K
|
|
41820
|
+
})) : (B(), U("div", jO, [
|
|
41821
|
+
C("div", HO, [
|
|
41822
|
+
UO,
|
|
41823
|
+
C("div", VO, ge(v.value), 1)
|
|
41824
|
+
])
|
|
41825
|
+
]))
|
|
41826
|
+
]));
|
|
41833
41827
|
}
|
|
41834
|
-
}, XO = /* @__PURE__ */ Oe(zO, [["__scopeId", "data-v-
|
|
41828
|
+
}, XO = /* @__PURE__ */ Oe(zO, [["__scopeId", "data-v-2f2aa6e4"]]), KO = {
|
|
41835
41829
|
class: "ai-guidance-loader",
|
|
41836
41830
|
"data-test-id": "aiGuidance-loader-container"
|
|
41837
41831
|
}, GO = {
|
|
@@ -184,4 +184,4 @@
|
|
|
184
184
|
`+Lt),de&&Cs([T,D,j],An=>{Lt=ji(Lt,An," ")}),b&&ne?b.createHTML(Lt):Lt},t.setConfig=function(){let Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Gn(Be),W=!0},t.clearConfig=function(){nn=null,W=!1},t.isValidAttribute=function(Be,pe,Se){nn||Gn({});const Te=lt(Be),rt=lt(pe);return Ho(Te,rt,Se)},t.addHook=function(Be,pe){typeof pe=="function"&&$i(k[Be],pe)},t.removeHook=function(Be,pe){if(pe!==void 0){const Se=dI(k[Be],pe);return Se===-1?void 0:fI(k[Be],Se,1)[0]}return _h(k[Be])},t.removeHooks=function(Be){k[Be]=[]},t.removeAllHooks=function(){k=Oh()},t}var TI=Dh();const OI=["innerHTML"],Mh=Oe({__name:"MarkdownRenderer",props:{source:{type:String,default:""},wrapperClass:{type:[String,Array,Object],default:""}},setup(e){const t=e,n=new Mn({html:!1,linkify:!0,breaks:!0}),r=me(()=>{const o=n.render(t.source||"");return TI.sanitize(o)});return(o,i)=>(R(),H("div",{class:ke(["markdown-renderer",e.wrapperClass]),innerHTML:r.value},null,10,OI))}},[["__scopeId","data-v-ecacea26"]]),DI={class:"message-content"},MI={key:0,class:"message-name"},FI={class:"ect-w-full"},RI={class:"message-content"},BI={class:"message-text ect-relative"},LI={class:"ect-pr-1"},NI={class:"loading-message-skeleton"},PI={key:1,class:"buttons-wrapper ect-mt-[-8px]"},qI=Oe({__name:"chatMessages",props:{undoId:{type:String,default:""},strikethroughIds:{type:Array,default:()=>[]},messages:{type:Array,required:!0,default:()=>[]},chatIndex:{type:Number,default:0},dataChanged:{type:Boolean,default:!1},loadingMessage:{type:String,default:""},buttonLinks:{type:Array,default:()=>[]}},setup(e){const t=tf(),n=Q(null),r=Q(null);ho();const o=fo(),i=Bo(),a=e,s=me(()=>!(i!=null&&i.activeComponentKey)),l=()=>{n.value&&n.value.scrollTo({top:n.value.scrollHeight,behavior:"smooth"})};U0(()=>{a.messages.length>0&&Nt(()=>{l()})}),U0(()=>{a.loadingMessage&&Nt(()=>{l(),r.value&&(r.value.scrollTop=r.value.scrollHeight)})});const u=me(()=>{var f;return(f=o.chatStyles)==null?void 0:f.bgColor}),c=me(()=>`linear-gradient(180deg, ${u.value} 0%, transparent 100%)`),h=me(()=>{var f;return(f=o.chatStyles)==null?void 0:f.textColor}),d=(f,v,p=!1)=>{if(typeof f=="string"&&f.startsWith("playbookNavigate:")){const x=f.slice(17);i.navigateToBean(x);return}f==="addProducts"?i.loadComponent("catalog"):f==="quoteDocument"?t.openQuoteDocument(v.requestId):f==="quoteItem"?i.loadComponent("cart"):f==="Undo"&&o.undoAction(v.requestId)},m=f=>{if(!f)return"";let v=f.replace(/\\r\\n/g,`
|
|
185
185
|
`).replace(/\\n/g,`
|
|
186
186
|
`).replace(/\\r/g,`
|
|
187
|
-
`);return v=v.replace(/^[ \t]*•[ \t]+/gm,"- "),v};return(f,v)=>(R(),H("div",{class:ke(["chat-messages",{"root-path":s.value}])},[C("div",{class:"chat-gradient",style:we({background:c.value})},null,4),C("div",{ref_key:"chatMessagesRef",ref:n,class:"messages-wrapper"},[(R(!0),H(Ce,null,Fe([...e.messages],(p,x)=>{var g;return R(),H("div",{key:x,class:ke(["message",{"user-message":p.type==="user"}])},[C("div",DI,[p.name?(R(),H("div",MI,ge(p.name),1)):he("",!0),C("div",{class:ke(["message-text ect-relative",{"error-message":p.error,strikethrough:p.undone}]),style:we(p.type==="user"?{color:h.value,backgroundColor:u.value}:{})},[C("div",FI,[fe(Mh,{source:m(p.message)},null,8,["source"])]),((g=p==null?void 0:p.filesData)==null?void 0:g.length)>0?(R(!0),H(Ce,{key:0},Fe(p==null?void 0:p.filesData,y=>(R(),xe(Mw,{key:y.name,info:{iconUrl:(y==null?void 0:y.type)==="csv"?Ae(S2):Ae(I2),fileName:y==null?void 0:y.name,fileSize:y==null?void 0:y.size},background:p.type=="user"?"#fff":"#f8f8f8","encoded-string":y==null?void 0:y.encodedString},null,8,["info","background","encoded-string"]))),128)):he("",!0)],6)])],2)}),128)),e.loadingMessage?(R(),H("div",{key:0,class:ke(["loading-message",{"thinking-message":Ae(o).isThinkingMessage}])},[C("div",{class:ke(["ect-flex ect-gap-3",{"ect-w-full":Ae(o).isThinkingMessage}])},[C("div",RI,[C("div",BI,[C("div",{ref_key:"loadingWindowRef",ref:r,class:"loading-window"},[C("div",LI,[fe(Mh,{source:m(e.loadingMessage)},null,8,["source"])])],512)]),C("div",NI,[fe(Oi,{style:{height:"100%",width:"100%"}})])])],2)],2)):e.buttonLinks.length>0?(R(),H("div",PI,[fe(Sw,{links:e.buttonLinks,onPerformAction:d},null,8,["links"])])):he("",!0)],512)],2))}},[["__scopeId","data-v-47319f83"]]),$I={class:"ai-upload ect-flex-inline ect-items-center"},jI=Oe({__name:"FileUpload",props:{resetFileInput:{type:Boolean,default:!1}},emits:["upload-status","error"],setup(e,{emit:t}){const n=e,r=t,o=Q(null),i=Q(""),a=Q(""),s=Q(!1);Xe(()=>n.resetFileInput,h=>{h&&o.value&&(o.value.value="",i.value="",a.value="")});const l=h=>{const m=o.value.accept.split(",").map(v=>v.trim().toLowerCase()),f="."+h.name.split(".").pop().toLowerCase();return m.includes(f)||m.includes(h.type.toLowerCase())?!0:m.some(v=>{if(v.includes("*")){const p=v.split("*")[0];return h.type.toLowerCase().startsWith(p)}return!1})},u=async h=>{const d=h.target.files[0];if(console.info("File = ",d),d){if(!l(d)){o.value&&(o.value.value="");const f={message:"Invalid file type. Please upload a valid file type.",fileName:d.name,fileType:d.type};window&&window.$toast&&window.$toast.add({severity:"error",summary:"File Upload Error",detail:f.message,life:5e3}),r("error",f);return}i.value=d.name,a.value=d.type.split("/").pop(),r("upload-status",{status:"uploading",fileName:i.value,fileType:a.value});const m=new FileReader;m.onload=async f=>{const v=new Blob([f.target.result],{type:d.type});console.info("Blob data:",v);try{const p=await a3(v),x={attachment:{name:d.name,data:p}};console.info("AIRequestPayload = ",x),r("upload-status",{status:"uploaded",fileName:i.value,fileType:a.value,size:Yd(d.size),fileData:x}),o.value&&(o.value.value="")}catch(p){console.info("[ERROR]: File upload error:",p),window&&window.$toast&&window.$toast.add({severity:"error",summary:"File Processing Error",detail:"Error processing file: "+(p.message||"Unknown error"),life:5e3}),r("error",{message:"Error processing file",fileName:i.value,fileType:a.value,error:p.message}),r("upload-status",{status:"error",fileName:i.value,fileType:a.value})}},m.onerror=f=>{console.info("[ERROR]: FileReader error:",f),window&&window.$toast&&window.$toast.add({severity:"error",summary:"File Reading Error",detail:"Could not read the selected file",life:5e3}),r("error",{message:"Error reading file",fileName:d.name,fileType:d.type,error:f})},setTimeout(()=>{m.readAsText(d)},100)}},c=()=>{o.value.click()};return(h,d)=>(R(),H("div",$I,[C("input",{ref_key:"fileInput",ref:o,type:"file",accept:".csv, .xls, .xlsx, text/csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",class:"ect-opacity-0 ect-h-0 ect-w-0 ect-absolute",onChange:u},null,544),C("button",{class:"attachment-button",onClick:c,onMouseenter:d[0]||(d[0]=m=>s.value=!0),onMouseleave:d[1]||(d[1]=m=>s.value=!1)},[fe(He,{icon:"attachment",size:"11",height:"17",color:s.value?"#198708":"#828282"},null,8,["color"])],32)]))}},[["__scopeId","data-v-7fbbb7c9"]]),UI={key:0,class:"suggestions-container"},HI={key:0,class:"logo-section"},VI={class:"help-text-section"},zI={key:0,class:"help-text"},XI={key:1,class:"sub-help-text"},KI=["onClick"],GI={key:2,class:"suggestions-list"},QI=["onClick"],WI=Oe({__name:"AISuggestionsDropdown",props:{options:{type:Array,required:!0},helpText:{type:String,default:""},subHelpText:{type:String,default:""},showSuggestions:{type:Boolean,default:!1}},emits:["select","preview"],setup(e,{emit:t}){const n=e,r=t,o=Q(0),i=Q(0),a=Q(null),s=Q(null),l=d=>{a.value=d,i.value=0},u=()=>{a.value=null,o.value=0},c=d=>{r("select",d)},h=d=>{if(n.showSuggestions)switch(d.key){case"ArrowDown":d.preventDefault(),a.value?(i.value=(i.value+1)%a.value.subOptions.length,r("preview",a.value.subOptions[i.value])):(o.value=(o.value+1)%n.options.length,r("preview",n.options[o.value].title));break;case"ArrowUp":d.preventDefault(),a.value?(i.value=i.value-1<0?a.value.subOptions.length-1:i.value-1,r("preview",a.value.subOptions[i.value])):(o.value=o.value-1<0?n.options.length-1:o.value-1,r("preview",n.options[o.value].title));break;case"Enter":d.preventDefault(),a.value?c(a.value.subOptions[i.value]):l(n.options[o.value]);break;case"Escape":case"ArrowLeft":case"Backspace":a.value&&(d.preventDefault(),u());break}};return Xe(()=>n.showSuggestions,d=>{d?(window.addEventListener("keydown",h),a.value=null,o.value=0,i.value=0):window.removeEventListener("keydown",h)}),(d,m)=>e.showSuggestions?(R(),H("div",UI,[a.value?he("",!0):(R(),H("div",HI,[fe(pb)])),C("div",VI,[e.helpText&&!a.value?(R(),H("div",zI,ge(e.helpText),1)):he("",!0),e.subHelpText?(R(),H("div",XI,ge(e.subHelpText),1)):he("",!0)]),a.value?(R(),H("div",GI,[(R(!0),H(Ce,null,Fe(a.value.subOptions,(f,v)=>(R(),H("div",{key:v,class:ke(["sub-option",{"sub-active":i.value===v}]),onClick:p=>c(f)},ge(f),11,QI))),128))])):(R(),H("div",{key:1,ref_key:"suggestionsList",ref:s,class:"suggestions-list"},[(R(!0),H(Ce,null,Fe(e.options,(f,v)=>(R(),H("div",{key:v,class:ke(["suggestion-item",{active:o.value===v}]),onClick:p=>l(f)},ge(f.title),11,KI))),128))],512))])):he("",!0)}},[["__scopeId","data-v-bbb514b3"]]),ZI={class:"chat-file-info"},JI={class:"ect-flex ect-gap-2 ect-items-center ect-self-stretch ect-my-auto ect-text-xs ect-font-medium ect-text-black"},YI=["src"],eT={class:"ect-self-stretch ect-my-auto"},tT={key:0,class:"ect-flex ect-gap-2 ect-justify-center ect-items-center ect-self-stretch ect-my-auto ect-w-4 ect-h-4"},nT=Oe({__name:"ChatInputFileInfo",props:{fileInfo:{type:Object,required:!0}},emits:["cancel"],setup(e,{emit:t}){const n=t,r=()=>{n("cancel")};return(o,i)=>(R(),H("div",ZI,[C("div",JI,[C("img",{loading:"lazy",src:e.fileInfo.fileType==="csv"?Ae(S2):Ae(I2),class:"ect-object-contain ect-shrink-0 ect-self-stretch ect-my-auto ect-w-7 ect-aspect-square",alt:""},null,8,YI),C("div",eT,ge(e.fileInfo.fileName),1)]),e.fileInfo.status==="uploading"?(R(),H("div",tT,[fe($u,{size:18})])):he("",!0),e.fileInfo.status==="uploaded"?(R(),H("button",{key:1,class:"ect-flex ect-gap-2 ect-justify-center ect-items-center ect-self-stretch ect-my-auto ect-w-4 ect-h-4",onClick:r},[fe(He,{icon:"close",size:"8"})])):he("",!0)]))}},[["__scopeId","data-v-24d881bd"]]),rT={class:"chat-input-wrapper"},oT={class:"chat-input-inner"},iT={class:"input-row"},aT=["disabled","placeholder","onKeydown"],sT={key:1,class:"icon-wrapper"},lT={class:"icon-wrapper"},uT=Oe({__name:"chatInput",props:{modelValue:{type:String,default:""},loading:{type:Boolean,default:!1},placeholder:{type:String,default:"Ask Genesis AI"},helpText:{type:String,default:"Here are few areas where I can help"},subHelpText:{type:String,default:"Suggestions by Genesis (Click to Apply)"},showFile:{type:Boolean,default:!1},showMic:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","submit","speak","file-upload-status"],setup(e,{emit:t}){const n=e,r=t;fo();const o=_n(),i=Bo(),a=Q({}),s=Q(!1),l=Q(!1),u=Q(n.modelValue),c=Q(null),h=me(()=>{const E=i.currentStep||null;return(Array.isArray(E==null?void 0:E.promptGuidance)?E.promptGuidance:[]).slice().sort((I,k)=>Number((I==null?void 0:I.sequenceNumber)??0)-Number((k==null?void 0:k.sequenceNumber)??0)).map(I=>{const T=(Array.isArray(I==null?void 0:I.relatedPG)?I.relatedPG:[]).slice().sort((D,j)=>Number((D==null?void 0:D.sequenceNumber)??0)-Number((j==null?void 0:j.sequenceNumber)??0)).map(D=>D.pgName);return{title:I.pgName,subOptions:T}})}),d=me(()=>{var E;return(E=h.value)!=null&&E.length?h.value:[]}),m=me(()=>{var E;return(E=h.value)!=null&&E.length?"Prompt Guidance":n.helpText});Xe(()=>n.loading,async(E,O)=>{!E&&O&&(await Nt(),c.value.focus())}),Xe(u,E=>{r("update:modelValue",E),Nt(()=>b())}),Xe(()=>n.modelValue,E=>{u.value=E});const f=E=>{console.info("[ERROR]: File upload error:",E),o.handleError(E,"ChatInput")},v=()=>{u.value.trim()&&(l.value=!1,r("submit",u.value),u.value="",c.value&&(c.value.style.height="32px"),a.value=null)},p=E=>{u.value=E,l.value=!1,Nt(()=>{b(),c.value&&(c.value.focus(),c.value.selectionStart=c.value.selectionEnd=u.value.length)})},x=E=>{u.value=E,Nt(()=>b())},g=()=>{l.value=!1},y=E=>{console.info("handleFileUploadStatus event = ",E),E!=null&&E.fileName?(a.value=E,r("file-upload-status",E)):(a.value=null,s.value=!0,r("file-upload-status",null),setTimeout(()=>{s.value=!1},3e3))},b=()=>{const E=c.value;if(!E)return;E.style.height="auto";const I=Math.max(32,Math.min(E.scrollHeight,120));E.style.height=`${I}px`},_=()=>{console.info("removeFile"),a.value=null,s.value=!0,r("file-upload-status",null),setTimeout(()=>{s.value=!1},100)},w=()=>{l.value=!1,b()};return(E,O)=>{var I,k,T,D,j;const F=$0("click-outside");return xn((R(),H("div",rT,[fe(WI,{options:d.value,"help-text":m.value,"sub-help-text":e.subHelpText,"show-suggestions":l.value,onSelect:p,onPreview:x},null,8,["options","help-text","sub-help-text","show-suggestions"]),C("div",oT,[C("div",iT,[C("div",{class:ke(["icon-wrapper",{"active-suggestions":l.value,disabled:((I=d.value)==null?void 0:I.length)<=0}])},[fe(He,{disabled:((k=d.value)==null?void 0:k.length)<=0||e.loading,color:((T=d.value)==null?void 0:T.length)<=0?"#DEDEDE":l.value?"#198708":"#828282",icon:"suggestions",size:"13",height:15,onClick:O[0]||(O[0]=K=>l.value=!l.value)},null,8,["disabled","color"])],2),xn(C("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":O[1]||(O[1]=K=>u.value=K),disabled:e.loading,placeholder:e.placeholder,rows:"1",onKeydown:Nn(vt(v,["exact","prevent"]),["enter"]),onInput:w},null,40,aT),[[oo,u.value]]),e.showFile?(R(),H("div",{key:0,class:ke(["icon-wrapper",{"file-upload-disabled":e.loading}])},[fe(jI,{"reset-file-input":s.value,onUploadStatus:y,onError:f},null,8,["reset-file-input"])],2)):he("",!0),e.showMic?(R(),H("div",sT,[fe(He,{color:"#828282",disabled:e.loading,icon:"mic",size:"13",height:15,onClick:O[2]||(O[2]=K=>E.$emit("speak"))},null,8,["disabled"])])):he("",!0),C("div",lT,[(R(),xe(He,{key:1,disabled:e.loading,icon:"send",size:"20",onClick:v},null,8,["disabled"]))])]),((D=a.value)==null?void 0:D.status)==="uploading"||((j=a.value)==null?void 0:j.status)==="uploaded"?(R(),xe(nT,{key:0,class:"ect-mt-3 ect-mb-0.5","file-info":a.value,onCancel:_},null,8,["file-info"])):he("",!0)])])),[[F,g]])}}},[["__scopeId","data-v-e205d71c"]]),cT=["data-test-id"],dT=["data-test-id"],fT=["data-test-id"],hT=Oe({__name:"aiChat",props:{dataTestId:{type:String,required:!0},isExternalGuidance:{type:Boolean,required:!1,default:!1},styles:{type:Object,required:!1,default:()=>({}),validator:e=>typeof(e==null?void 0:e.height)=="string"}},setup(e){const t=Bo(),n=fo(),r=Q(null),o=me(()=>{var l;return((l=t.getCurrentStepLinks)==null?void 0:l.call(t))||[]}),i=me(()=>!0),a=l=>{console.info("[aiChat] handleSubmit",{hasFileData:!!r.value,messageLength:(l||"").length}),r.value?(console.info("[aiChat] sending with file attachment"),n.sendMessage(l,!0,r.value)):(console.info("[aiChat] sending without attachment"),n.sendMessage(l))},s=l=>{console.info("ChatScreen handleFileUploadStatus event = ",l),l!=null&&l.fileData?(r.value=l.fileData,n.attachmentData={size:l.size,type:l.fileType,name:l.fileName}):(r.value=null,n.attachmentData=null)};return(l,u)=>(R(),H("div",{class:"chat-screen","data-test-id":e.dataTestId},[C("div",{class:ke(["messages-container",{"playbook-steps-mode-hybrid":Ae(t).playbookStepsMode==="hybrid","playbook-steps-mode-full":Ae(t).playbookStepsMode==="full","dxp-guiddance":e.isExternalGuidance}]),style:we({maxHeight:`calc(${e.styles.height} - 72px)`,height:`calc(${e.styles.height} - 72px)`}),"data-test-id":`${e.dataTestId}-messages-container`},[fe(qI,{messages:Ae(n).chatHistory,"loading-message":Ae(n).loadingMessage,"undo-id":Ae(n).latestDMLRequest,"button-links":o.value,"strikethrough-ids":Ae(n).strikethroughHistory,"data-changed":Ae(n).dataManuallyChanged,"data-test-id":`${e.dataTestId}-messages`},null,8,["messages","loading-message","undo-id","button-links","strikethrough-ids","data-changed","data-test-id"])],14,dT),C("div",{class:"input-container","data-test-id":`${e.dataTestId}-input-container`},[fe(uT,{modelValue:Ae(n).promptMessage,"onUpdate:modelValue":u[0]||(u[0]=c=>Ae(n).promptMessage=c),disabled:!i.value,"file-info":r.value,loading:!!Ae(n).loadingMessage,"data-test-id":`${e.dataTestId}-input`,onSubmit:a,onFileUploadStatus:s},null,8,["modelValue","disabled","file-info","loading","data-test-id"])],8,fT)],8,cT))}},[["__scopeId","data-v-99005673"]]),pT={class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center","data-test-id":"configurator-not-found"},mT={class:"ect-max-w-[720px] ect-p-[50px] ect-border ect-rounded-lg ect-bg-white ect-shadow-sm"},gT={class:"ect-text-[40px] ect-leading-none ect-mb-3"},yT=C("div",{class:"ect-text-[22px] ect-font-normal ect-leading-normal ect-mb-[12px] ect-capitalize ect-text-[#5F5F5F]","data-test-id":"configurator-not-found-title"}," Product Configurator Not Found ",-1),vT=C("div",{class:"ect-text-sm ect-text-gray-500","data-test-id":"configurator-not-found-subtitle"}," Linked composable product configurator UI component for this screen is not found OR the composable product configurator UI component does not exist. Please create / connect one and try again. ",-1),bT={class:"ect-mt-4 ect-flex ect-items-center ect-justify-between ect-gap-6"},xT={__name:"MoleculeConfiguratorNotFound",emits:["return","go-cart"],setup(e){return(t,n)=>(R(),H("div",pT,[C("div",mT,[C("div",gT,[fe(He,{icon:"error",size:48})]),yT,vT,C("div",bT,[C("button",{type:"button",class:"ect-text-green-600 ect-text-sm ect-font-medium",onClick:n[0]||(n[0]=r=>t.$emit("return")),"data-test-id":"configurator-not-found-return"}," RETURN TO PRODUCT RESULTS "),C("button",{type:"button",class:"ect-text-green-600 ect-text-sm ect-font-medium",onClick:n[1]||(n[1]=r=>t.$emit("go-cart")),"data-test-id":"configurator-not-found-go-to-cart"}," GO TO CART ")])])]))}},_T=e=>(Gt("data-v-1dca0cd9"),e=e(),Qt(),e),CT={class:"ect-h-full ect-w-full ect-bg-white","data-test-id":"aiComponentLoader-wrapper"},ET={key:4,class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center"},kT={class:"ect-text-center"},wT=_T(()=>C("div",{class:"ect-text-base ect-font-medium","data-test-id":"aiComponentLoader-fallback-title"}," No component to display for this step ",-1)),AT={class:"ect-text-sm ect-text-gray-500 ect-mt-2","data-test-id":"aiComponentLoader-fallback-subtitle"},ST=Oe({__name:"aiComponentLoader",props:{stepComponent:{type:String,default:null},identity:{type:Object,default:()=>({})},session:{type:Object,default:()=>({})},security:{type:Object,default:()=>({})},packageVersion:{type:String,default:""},composablesOrgType:{type:String,default:""},composablesApiKey:{type:String,default:""},templateId:{type:String,default:""},hostName:{type:String,default:""},graphqlEndpoint:{type:String,default:""},apiKey:{type:String,default:""},isPreview:{type:Boolean,default:!1},sections:{type:Array,default:()=>[]},theme:{type:Object,default:()=>({})},catalogPreviewData:{type:Object,default:()=>({})},catalogInitialData:{type:Array,default:()=>[]},catalogSearchTerm:{type:String,default:""},onCatalogCountUpdate:{type:Function,default:null},cartSections:{type:String,default:""},configItemId:{type:String,default:""},configQliId:{type:String,default:""},configApiKey:{type:String,default:""}},emits:["expeditecart-clicked","catalog-quote-created","catalog-quote-updated","catalog-items-loaded","catalog-item-added","catalog-item-qty-updated","catalog-line-deleted","catalog-items-fetched","catalog-item-configure"],setup(e,{emit:t}){const n=t,r=e,o=Bo(),i=Lu(),a=Ht(),s=me(()=>({...r.session,qliId:m.value,itemId:d.value})),l=me(()=>{const S=o==null?void 0:o.activeComponentKey,M=r.stepComponent;return(S||M||"").toString().trim().toLowerCase().replace(/[^a-z0-9]+/g,"_")}),u=me(()=>{var L,V;const S=!!r.templateId,M=!!((L=r.identity)!=null&&L.organizationId),q=!!((V=r.identity)!=null&&V.accountId),z=typeof r.cartSections=="string"&&r.cartSections.length>0;return S&&M&&q&&z}),c=me(()=>{var M;if(Array.isArray(r.catalogInitialData)&&r.catalogInitialData.length>0)return r.catalogInitialData;const S=((M=o==null?void 0:o.activeComponentData)==null?void 0:M.payload)||{};if(S.catalog&&typeof S.catalog=="object")try{const z=Object.values(S.catalog).map(L=>{var V;return(V=L==null?void 0:L.catalogResponse)==null?void 0:V.productInfo}).filter(Boolean);if(z.length>0)return z}catch{}return Array.isArray(S.initialData)&&S.initialData.length>0?S.initialData:Array.isArray(S.catalogInitialData)&&S.catalogInitialData.length>0?S.catalogInitialData:Array.isArray(S.items)&&S.items.length>0?S.items:[]}),h=me(()=>{var M;const S=((M=o==null?void 0:o.activeComponentData)==null?void 0:M.payload)||{};return r.catalogSearchTerm||S.searchTerm||""}),d=me(()=>{var M,q,z,L,V,Z;const S=((L=(z=(q=(M=o==null?void 0:o.activeComponentData)==null?void 0:M.payload)==null?void 0:q.savedProducts)==null?void 0:z[0])==null?void 0:L.itemId)||((V=o==null?void 0:o.activeComponentData)==null?void 0:V.payload)&&Object.keys(((Z=o.activeComponentData.payload)==null?void 0:Z.quoteConfiguration)||{})[0]||"";return r.configItemId||S||""}),m=me(()=>{var M,q,z,L,V,Z,oe,re;const S=(L=(z=(q=(M=o==null?void 0:o.activeComponentData)==null?void 0:M.payload)==null?void 0:q.savedProducts)==null?void 0:z[0])==null?void 0:L.qliId;if(!S){console.log("[aiComponentLoader] configQliIdComputed: No qliId from savedProducts");const ue=(Z=(V=o==null?void 0:o.activeComponentData)==null?void 0:V.payload)==null?void 0:Z.quoteConfiguration;if(console.log("[aiComponentLoader] configQliIdComputed: quoteConfiguration:",ue),ue&&typeof ue=="object"){const de=Object.keys(ue)[0];if(console.log("[aiComponentLoader] configQliIdComputed: firstItemId:",de),de){const P=(oe=ue[de])==null?void 0:oe.product;if(console.log("[aiComponentLoader] configQliIdComputed: productObj:",P),P&&P.qliId)return console.log("[aiComponentLoader] configQliIdComputed: found qliId in productObj:",P.qliId),P.qliId;if((re=ue[de])!=null&&re.qliId)return console.log("[aiComponentLoader] configQliIdComputed: found qliId directly under itemId:",ue[de].qliId),ue[de].qliId}}}return S||""}),f=me(()=>!!d.value),v=me(()=>l.value==="configurator"&&!f.value?"Configurator requires an itemId (and optional qliId). Provide via playbook payload or props.":l.value==="catalog"?"Catalog step is active. Provide templateId/sections/theme when available.":l.value==="cart"?"Cart step is active.":"Awaiting playbook step selection."),p=me(()=>{try{return JSON.stringify((o==null?void 0:o.activeComponentData)||{})}catch{return""}}),x=me(()=>`catalog::${p.value}`),g=me(()=>`cart::${p.value}`),y=me(()=>{var S;try{return(((S=o==null?void 0:o.activeComponentData)==null?void 0:S.actionFunction)||"")==="Reload"}catch{return!1}}),b=me(()=>{var M;const S=`configurator::${d.value||""}::${m.value||""}`;if(y.value){const q=((M=o==null?void 0:o.activeComponentData)==null?void 0:M.requestId)||"";return`${S}::${q}`}return S}),_=Q([]),w=Q(null),E=S=>{const M=Array.isArray(S)?S:Array.isArray(S==null?void 0:S.items)?S.items:[];if(!Array.isArray(M))return;const q={"Needs Configuration":1,"Suggests Configuration":2,"Fully Configured":3},z=Z=>(Z==null?void 0:Z.requiresConfiguration)||"",L=Z=>!!Z&&Z in q,V=M.filter(Z=>L(z(Z)));V.sort((Z,oe)=>{const re=z(Z),ue=z(oe);return(q[re]||99)-(q[ue]||99)}),_.value=V,w.value=V.length?V[0]:null},O=S=>{console.log("onQuoteCreated",S),n("catalog-quote-created",S)},F=S=>{console.log("onQuoteUpdated",S),n("catalog-quote-updated",S)},I=S=>{console.log("onItemAdded",S),n("catalog-item-added",S)},k=S=>{console.log("onItemQtyUpdated",S),n("catalog-item-qty-updated",S)},T=S=>{console.log("onLineDeleted",S),n("catalog-line-deleted",S)},D=S=>{console.log("onQuoteItemsFetched",S),n("catalog-items-fetched",S)};Xe(()=>l.value,(S,M)=>{var q,z,L,V,Z,oe,re,ue,de,P,$;if(S==="configurator"){const W=!!((L=(z=(q=o==null?void 0:o.activeComponentData)==null?void 0:q.payload)==null?void 0:z.savedProducts)!=null&&L.length),G=!!((Z=(V=o==null?void 0:o.activeComponentData)==null?void 0:V.payload)!=null&&Z.quoteConfiguration&&Object.keys(((re=(oe=o==null?void 0:o.activeComponentData)==null?void 0:oe.payload)==null?void 0:re.quoteConfiguration)||{}).length>0);if(!W&&!G&&w.value&&!d.value){const J=((ue=w.value)==null?void 0:ue.itemId)||"";if(J){const X=((de=o==null?void 0:o.currentPlaybook)==null?void 0:de.playBookSteps)||[],ne=ve=>String(ve||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_");let se=null;const le=X.findIndex(ve=>ve.stepName===(o==null?void 0:o.currentStepName));if(le>=0&&X[le+1]&&ne((P=X[le+1])==null?void 0:P.stepComponent)==="configurator")se=X[le+1].stepName;else{const ve=X.findIndex(_e=>ne(_e==null?void 0:_e.stepComponent)==="configurator");se=ve>=0?($=X[ve])==null?void 0:$.stepName:null}const ae={payload:{savedProducts:[{itemId:J}]}};se?o.navigateToStep({stepName:se,data:ae}):o.loadComponent("configurator",ae)}}}});const j=()=>{var z,L;const S=((z=o==null?void 0:o.currentPlaybook)==null?void 0:z.playBookSteps)||[],M=V=>String(V||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),q=S.findIndex(V=>M(V==null?void 0:V.stepComponent)==="catalog"||M(V==null?void 0:V.stepName).includes("catalog"));if(q>=0){const V=(L=S[q])==null?void 0:L.stepName;o.navigateToStep({stepName:V})}else o.loadComponent("catalog")},K=()=>{var z,L;const S=((z=o==null?void 0:o.currentPlaybook)==null?void 0:z.playBookSteps)||[],M=V=>String(V||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),q=S.findIndex(V=>M(V==null?void 0:V.stepComponent)==="cart"||M(V==null?void 0:V.stepName).includes("cart"));if(q>=0){const V=(L=S[q])==null?void 0:L.stepName;o.navigateToStep({stepName:V})}else o.loadComponent("cart")},U=S=>{var M,q;console.log("onItemConfigureClicked",S),n("catalog-item-configure",S);try{const z=(S==null?void 0:S.itemId)||"",L=(S==null?void 0:S.qliId)||(S==null?void 0:S.QliId)||"",V=[];if(z){const de={itemId:z};L&&(de.qliId=L),V.push(de)}const Z={payload:{savedProducts:V}},oe=((M=o==null?void 0:o.currentPlaybook)==null?void 0:M.playBookSteps)||[],re=de=>String(de||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),ue=oe.findIndex(de=>{const P=re(de==null?void 0:de.stepComponent),$=re(de==null?void 0:de.stepName);return P==="configurator"||$.includes("configure")});if(ue>=0){const de=(q=oe[ue])==null?void 0:q.stepName;o.navigateToStep({stepName:de,data:Z})}else o.loadComponent("configurator",Z)}catch(z){console.warn("[aiComponentLoader] Failed to navigate to configurator from configure click:",z),o.loadComponent("configurator",{payload:{}})}},te=S=>{console.log("onCartClicked",S),n("expeditecart-clicked",S)},ie=S=>{var M,q;try{const z=(S==null?void 0:S.itemId)||"",L=(S==null?void 0:S.lineItemId)||(S==null?void 0:S.qliId)||"",V=[];if(z){const de={itemId:z};L&&(de.qliId=L),V.push(de)}const Z={payload:{savedProducts:V}},oe=((M=o==null?void 0:o.currentPlaybook)==null?void 0:M.playBookSteps)||[],re=de=>String(de||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),ue=oe.findIndex(de=>{const P=re(de==null?void 0:de.stepComponent),$=re(de==null?void 0:de.stepName);return P==="configurator"||$.includes("configure")});if(ue>=0){const de=(q=oe[ue])==null?void 0:q.stepName;o.navigateToStep({stepName:de,data:Z})}else o.loadComponent("configurator",Z)}catch(z){console.warn("[aiComponentLoader] Failed to navigate to configurator from cart configure click:",z),o.loadComponent("configurator",{payload:{}})}},Y=S=>{console.log("onCatalogIdReceived",S),a.updateConfig({eCatalogId:S})},N=S=>{console.log("Action",S),S.event==="add-to-quote"?n("configurator:add-to-quote",S.data):S.event==="save"&&n("configurator:save",S.data)},A=Q("");return Xe(()=>o==null?void 0:o.activeComponentData,async S=>{var q,z,L;if(!S)return;console.log("activeComponentData Changed",S);const M=(S==null?void 0:S.requestId)||"";if(console.log("requestId",M),console.log("lastReloadRequestId",A.value),M&&M!==A.value)if(A.value=M,await Nt(),(q=S==null?void 0:S.payload)!=null&&q.quoteConfiguration&&Object.keys(((z=S==null?void 0:S.payload)==null?void 0:z.quoteConfiguration)??{}).length>0){const V=Object.keys(((L=S==null?void 0:S.payload)==null?void 0:L.quoteConfiguration)??{})[0];i.setPreConfigData(S==null?void 0:S.payload,V)}else(S==null?void 0:S.actionFunction)==="Reload"&&(console.log("Reloading configurator 1"),i.refresh())},{deep:!0}),(S,M)=>{var q;return R(),H("div",CT,[l.value==="catalog"?(R(),xe(w2,{key:x.value,"data-test-id":"aiComponentLoader-catalog",class:"ect-h-full ect-w-full","template-id":e.templateId,identity:e.identity,session:e.session,security:e.security,"search-term":h.value,"on-catalog-count-update":e.onCatalogCountUpdate,"preview-data":e.catalogPreviewData,"initial-data":c.value,sections:e.sections,theme:e.theme,"composables-org-type":e.composablesOrgType,onCatalogQuoteCreated:O,onCatalogQuoteUpdated:F,onCatalogItemsLoaded:E,onCatalogItemAdded:I,onCatalogItemQtyUpdated:k,onCatalogLineDeleted:T,onCatalogItemsFetched:D,onCatalogItemConfigure:U,"onCatalog:id":Y},null,8,["template-id","identity","session","security","search-term","on-catalog-count-update","preview-data","initial-data","sections","theme","composables-org-type"])):l.value==="cart"&&u.value?(R(),xe(A2,{key:g.value,"data-test-id":"aiComponentLoader-cart",class:"ect-h-full ect-w-full","template-id":e.templateId,"host-name":e.hostName,"composables-org-type":e.composablesOrgType,security:e.security,identity:e.identity,session:e.session,onExpeditecartItemConfigure:ie,onExpeditecartClicked:te},null,8,["template-id","host-name","composables-org-type","security","identity","session"])):l.value==="configurator"&&f.value?(R(),xe(u2,{key:b.value,"data-test-id":"aiComponentLoader-configurator",class:"ect-h-full ect-w-full","item-id":d.value,"qli-id":m.value||e.configQliId||void 0,"quote-id":(q=e.session)==null?void 0:q.quoteId,security:e.security,identity:e.identity,"user-locale":S.userLocale,"composables-org-type":e.composablesOrgType,session:s.value,onReady:Ae(i).setExpediteConfigComp,onAction:N},null,8,["item-id","qli-id","quote-id","security","identity","user-locale","composables-org-type","session","onReady"])):l.value==="configurator"&&!f.value?(R(),xe(xT,{key:3,onReturn:j,onGoCart:K})):(R(),H("div",ET,[C("div",kT,[wT,C("div",AT,ge(v.value),1)])]))])}}},[["__scopeId","data-v-1dca0cd9"]]),IT={class:"ai-guidance-loader","data-test-id":"aiGuidance-loader-container"},TT={class:"aig-message-text","data-test-id":"aiGuidance-loader-message"},OT={class:"aig-button","data-test-id":"aiGuidance-loader-button"},DT={class:"aig-input-box","data-test-id":"aiGuidance-loader-input"},MT=Oe({__name:"AiGuidanceLoader",props:{errors:{type:Array,required:!1,default:()=>[]}},setup(e){return(t,n)=>(R(),H("div",IT,[C("div",TT,[fe(Oi,{style:{height:"16px",width:"90%","margin-bottom":"8px"}}),fe(Oi,{style:{height:"16px",width:"65%","margin-bottom":"20px"}})]),C("div",OT,[fe(Oi,{style:{height:"40px",width:"100%"}})]),(R(!0),H(Ce,null,Fe(e.errors,r=>(R(),H("div",{key:r,class:"aig-message-error","data-test-id":"aiGuidance-loader-error"},ge(r),1))),128)),C("div",DT,[fe(Oi,{style:{height:"40px",width:"100%"}})])]))}},[["__scopeId","data-v-aae34926"]]),FT={class:"ai-guidance-wrapper","data-test-id":"aiGuidance-wrapper"},RT=Oe({__name:"aiGuidance",props:{templateId:{type:String,required:!1},playbookData:{type:Object,required:!1},composablesOrgType:{type:String,required:!0},identity:{type:Object,required:!1,default:()=>({})},session:{type:Object,required:!1,default:()=>({})},security:{type:Object,required:!1,default:()=>({})},websocketUrl:{type:String,required:!0},packageVersion:{type:String,required:!0},hostName:{type:String,required:!1},graphqlEndpoint:{type:String,required:!1},apiKey:{type:String,required:!1},isPreview:{type:Boolean,required:!1,default:!1},catalogSections:{type:Array,required:!1,default:()=>[]},cartSections:{type:String,required:!1,default:""},theme:{type:Object,required:!1,default:()=>({})},styles:{type:Object,required:!1,default:()=>({height:"100vh"}),validator:e=>typeof(e==null?void 0:e.height)=="string"}},emits:["expeditecart-item-configure","expeditecart-clicked","component-action","ai-response:success"],setup(e,{emit:t}){const n=Bo(),r=Ht(),o=fo(),i=Ci(),a=t,s=Q(!0),l=Q(!1),u=Q(!0),c=Q(!0),h=Q(!1),d=Q([]),m=e,{composablesOrgType:f,websocketUrl:v,packageVersion:p,identity:x,session:g,security:y,templateId:b,hostName:_,graphqlEndpoint:w,apiKey:E,isPreview:O,catalogSections:F,cartSections:I,theme:k}=m;Wt(async()=>{console.log("security",y),console.log("apiKey",E),r.updateConfig({userId:x==null?void 0:x.userId,organizationId:x==null?void 0:x.organizationId,accessToken:y==null?void 0:y.accessToken,composablesApiUrl:y==null?void 0:y.baseUrl,composablesOrgType:f,websocketUrl:v,quoteId:g==null?void 0:g.quoteId,packageVersion:p,accountId:x==null?void 0:x.accountId,templateId:b,hostName:_,graphqlEndpoint:w,apiKey:(y==null?void 0:y.apiKey)||E,cid:x==null?void 0:x.contactId,isPreview:O})}),_t(async()=>{var A,S,M,q;n.setSecretKey(y==null?void 0:y.accessToken);const ie=await n.getPlaybookInfoFromQuote();let Y=(ie==null?void 0:ie.XX_ORD1__Completed_PB_Step_Number_EX__c)??void 0,N=(ie==null?void 0:ie.XX_ORD1__Playbook_Current_Step_Meta_EX__c)??void 0;if(N&&(N=JSON.parse(N)),console.info("sequenceNumberServer = ",Y),m.templateId){s.value=!0;const z=await n.getCatalogInContext();console.log("catalogInContext = ",z),z&&r.updateConfig({eCatalogId:z}),await i.fetchBlockInformationREST({templateId:m.templateId});const L=i.pageBlocks[0].blocks[0].playbookId;if(console.log("playbookID",L),L?l.value=!0:d.value.push("No playbook ID found in template"),n.setEmbeddedMode(!0),L&&(n.currentPlaybook=L,await n.getPlaybookByKey(L),n.showPlaybookSteps=!0),n.playbookStepsMode="full",o.setInitialPayload(),await o.connectSocket(),Y!==void 0){n.navigateToStep({stepName:(S=(A=n.currentPlaybook)==null?void 0:A.playBookSteps[Number(Y)])==null?void 0:S.stepName,data:N}),s.value=!1;return}(q=(M=n.currentPlaybook)==null?void 0:M.playBookSteps)!=null&&q.length&&n.setCurrentStepName(n.currentPlaybook.playBookSteps[0].stepName),s.value=!1}else d.value.push("templateId is required")});const T=me(()=>{var N;const ie=((N=n.currentPlaybook)==null?void 0:N.playBookSteps)||[],Y=n.currentStepName;return ie.find(A=>A.stepName===Y)||ie[0]||null}),D=me(()=>{var ie;return((ie=T.value)==null?void 0:ie.stepComponent)||null});Xe(()=>n.activeComponentKey,ie=>{ie&&(u.value=!1)});const j=[];_t(()=>{j.push($n("expeditecart:configure-clicked",ie=>{a("expeditecart-item-configure",ie)})),j.push($n("expeditecart:clicked",ie=>{a("expeditecart-clicked",ie)})),j.push($n("ai-response:success",ie=>{try{a("ai-response:success",ie)}catch{}}))});const K=ie=>{console.log("onExpediteCartClicked",ie),a("component-action",{component:"cart",details:ie})},U=(ie,Y)=>{a("component-action",{component:"catalog",action:ie,details:Y})},te=(ie,Y)=>{a("component-action",{component:"configurator",action:ie,details:Y})};return gr(()=>{try{o.cancelRequest()}catch{}try{o.disconnectSocket()}catch{}try{o.resetState()}catch{}try{n.setEmbeddedMode(!1),n.currentPlaybook=null,n.currentStepName=null,n.activeComponentKey=null,n.activeComponentData=null,n.showPlaybookSteps=!1,n.playbookStepsMode="full"}catch{}s.value=!1,l.value=!1,u.value=!0,c.value=!0,h.value=!1,d.value=[],j.forEach(ie=>{try{ie()}catch{}})}),(ie,Y)=>{var N;return R(),H("div",FT,[fe(qu,{icon:"logo",color:"#000000",size:"18.75",height:"16.25"}),s.value?(R(),xe(MT,{key:0,errors:d.value,"data-test-id":"aiGuidance-loader"},null,8,["errors"])):(R(),H("div",{key:1,class:ke(["ai-app",{"root-path":u.value,"playbook-steps-mode-full":Ae(n).playbookStepsMode==="full","dxp-guiddance":l.value}]),style:we(e.styles)},[C("div",{class:"ai-app-chat-wrapper",style:we({height:e.styles.height})},[fe(hT,{"data-test-id":"chat-screen","is-external-guidance":l.value,styles:e.styles},null,8,["is-external-guidance","styles"])],4),!u.value&&c.value&&!h.value?(R(),H("div",{key:0,class:"component-loader-wrapper",style:we({height:e.styles.height,maxHeight:e.styles.height})},[Ae(n).currentPlaybook?(R(),xe(ST,{key:0,"template-id":((N=T.value)==null?void 0:N.templateId)||Ae(b),"step-component":D.value,identity:Ae(x),session:Ae(g),security:Ae(y),"composables-org-type":Ae(f),"package-version":Ae(p),"host-name":Ae(_),"graphql-endpoint":Ae(w),"api-key":Ae(E),"is-preview":Ae(O),sections:Ae(F),"cart-sections":Ae(I),theme:Ae(k),"data-test-id":"aiComponentLoader-mounted",onExpeditecartClicked:K,onCatalogQuoteCreated:Y[0]||(Y[0]=A=>U("quote-created",A)),onCatalogQuoteUpdated:Y[1]||(Y[1]=A=>U("quote-updated",A)),onCatalogItemsLoaded:Y[2]||(Y[2]=A=>U("items-loaded",A)),onCatalogItemAdded:Y[3]||(Y[3]=A=>U("item-added",A)),onCatalogItemQtyUpdated:Y[4]||(Y[4]=A=>U("item-qty-updated",A)),onCatalogLineDeleted:Y[5]||(Y[5]=A=>U("line-deleted",A)),onCatalogItemsFetched:Y[6]||(Y[6]=A=>U("items-fetched",A)),onCatalogItemConfigure:Y[7]||(Y[7]=A=>U("item-configure",A)),"onConfigurator:addToQuote":Y[8]||(Y[8]=A=>te("add-to-quote",A)),"onConfigurator:save":Y[9]||(Y[9]=A=>te("save",A))},null,8,["template-id","step-component","identity","session","security","composables-org-type","package-version","host-name","graphql-endpoint","api-key","is-preview","sections","cart-sections","theme"])):he("",!0)],4)):he("",!0)],6))])}}},[["__scopeId","data-v-ee278ef7"]]);let ws=null;if(typeof window<"u"){try{ws=v6()}catch{}ws||(ws=b6(),mi(ws))}let As=null,Ss=null;const Sc=new Set;let mo=null;const Ic=new Map;async function BT(e){if(!e)return"";if(Ic.has(e))return Ic.get(e);try{const t=await fetch(e,{credentials:"omit",cache:"no-cache"});if(t.ok){const n=await t.text();return Ic.set(e,n),n}}catch(t){console.warn("[ExpediteComponents] Failed to fetch theme CSS:",t)}return""}async function Tc(e,t){if(!e||!t)return;const n=e.querySelector("style[data-vue-expedite-theme]");n&&n.remove();try{const r=await BT(t);if(r){const o=document.createElement("style");o.setAttribute("data-vue-expedite-theme","true"),o.textContent=r,e.prepend(o)}}catch(r){console.warn("[ExpediteComponents] Failed to inject theme CSS:",r)}}function Oc(e){mo=e||null,mo&&Sc.forEach(t=>{t&&t.shadowRoot&&Tc(t.shadowRoot,mo)})}async function LT(){return As||Ss||(Ss=(async()=>{try{const e=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Sr&&Sr.src||new URL("vue-expedite-components.umd.cjs",document.baseURI).href).href,t=await fetch(e);if(t.ok)return As=await t.text(),As}catch(e){console.warn("[ExpediteComponents] Failed to load CSS:",e)}return null})(),Ss)}const zi=e=>class extends e{async connectedCallback(){if(super.connectedCallback&&super.connectedCallback(),Sc.add(this),!!this.shadowRoot){if(this.shadowRoot.querySelector("style[data-vue-expedite-style]")){mo&&Tc(this.shadowRoot,mo);return}try{const t=await LT();if(t){const n=document.createElement("style");n.setAttribute("data-vue-expedite-style","true"),n.textContent=t,this.shadowRoot.prepend(n)}else{const n=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Sr&&Sr.src||new URL("vue-expedite-components.umd.cjs",document.baseURI).href).href,r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("data-vue-expedite-style","true"),r.href=n,this.shadowRoot.prepend(r)}mo&&Tc(this.shadowRoot,mo)}catch(t){console.warn("[ExpediteComponents] Failed to inject CSS:",t)}}}disconnectedCallback(){Sc.delete(this),super.disconnectedCallback&&super.disconnectedCallback()}},Fh=zi(pi(u2)),Rh=zi(pi(Nx)),Bh=zi(pi(w2)),Lh=zi(pi(A2)),Nh=zi(pi(RT));function Dc(){typeof window<"u"&&(customElements.get("vue-expedite-configurator")||customElements.define("vue-expedite-configurator",Fh),customElements.get("vue-expedite-gpt")||customElements.define("vue-expedite-gpt",Rh),customElements.get("vue-expedite-catalog")||customElements.define("vue-expedite-catalog",Bh),customElements.get("vue-expedite-cart")||customElements.define("vue-expedite-cart",Lh),customElements.get("vue-expedite-ai-guidance")||customElements.define("vue-expedite-ai-guidance",Nh))}typeof window<"u"&&Dc();const NT={register:Dc,applyThemeToShadows:Oc};typeof window<"u"&&(window.VueExpediteComponents=Object.assign(window.VueExpediteComponents||{},{applyThemeToShadows:Oc})),yn.ExpediteAIGuidanceElement=Nh,yn.ExpediteCartElement=Lh,yn.ExpediteCatalogElement=Bh,yn.ExpediteConfiguratorElement=Fh,yn.ExpediteGPTElement=Rh,yn.applyThemeToShadows=Oc,yn.default=NT,yn.registerWebComponents=Dc,Object.defineProperties(yn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
187
|
+
`);return v=v.replace(/^[ \t]*•[ \t]+/gm,"- "),v};return(f,v)=>(R(),H("div",{class:ke(["chat-messages",{"root-path":s.value}])},[C("div",{class:"chat-gradient",style:we({background:c.value})},null,4),C("div",{ref_key:"chatMessagesRef",ref:n,class:"messages-wrapper"},[(R(!0),H(Ce,null,Fe([...e.messages],(p,x)=>{var g;return R(),H("div",{key:x,class:ke(["message",{"user-message":p.type==="user"}])},[C("div",DI,[p.name?(R(),H("div",MI,ge(p.name),1)):he("",!0),C("div",{class:ke(["message-text ect-relative",{"error-message":p.error,strikethrough:p.undone}]),style:we(p.type==="user"?{color:h.value,backgroundColor:u.value}:{})},[C("div",FI,[fe(Mh,{source:m(p.message)},null,8,["source"])]),((g=p==null?void 0:p.filesData)==null?void 0:g.length)>0?(R(!0),H(Ce,{key:0},Fe(p==null?void 0:p.filesData,y=>(R(),xe(Mw,{key:y.name,info:{iconUrl:(y==null?void 0:y.type)==="csv"?Ae(S2):Ae(I2),fileName:y==null?void 0:y.name,fileSize:y==null?void 0:y.size},background:p.type=="user"?"#fff":"#f8f8f8","encoded-string":y==null?void 0:y.encodedString},null,8,["info","background","encoded-string"]))),128)):he("",!0)],6)])],2)}),128)),e.loadingMessage?(R(),H("div",{key:0,class:ke(["loading-message",{"thinking-message":Ae(o).isThinkingMessage}])},[C("div",{class:ke(["ect-flex ect-gap-3",{"ect-w-full":Ae(o).isThinkingMessage}])},[C("div",RI,[C("div",BI,[C("div",{ref_key:"loadingWindowRef",ref:r,class:"loading-window"},[C("div",LI,[fe(Mh,{source:m(e.loadingMessage)},null,8,["source"])])],512)]),C("div",NI,[fe(Oi,{style:{height:"100%",width:"100%"}})])])],2)],2)):e.buttonLinks.length>0?(R(),H("div",PI,[fe(Sw,{links:e.buttonLinks,onPerformAction:d},null,8,["links"])])):he("",!0)],512)],2))}},[["__scopeId","data-v-47319f83"]]),$I={class:"ai-upload ect-flex-inline ect-items-center"},jI=Oe({__name:"FileUpload",props:{resetFileInput:{type:Boolean,default:!1}},emits:["upload-status","error"],setup(e,{emit:t}){const n=e,r=t,o=Q(null),i=Q(""),a=Q(""),s=Q(!1);Xe(()=>n.resetFileInput,h=>{h&&o.value&&(o.value.value="",i.value="",a.value="")});const l=h=>{const m=o.value.accept.split(",").map(v=>v.trim().toLowerCase()),f="."+h.name.split(".").pop().toLowerCase();return m.includes(f)||m.includes(h.type.toLowerCase())?!0:m.some(v=>{if(v.includes("*")){const p=v.split("*")[0];return h.type.toLowerCase().startsWith(p)}return!1})},u=async h=>{const d=h.target.files[0];if(console.info("File = ",d),d){if(!l(d)){o.value&&(o.value.value="");const f={message:"Invalid file type. Please upload a valid file type.",fileName:d.name,fileType:d.type};window&&window.$toast&&window.$toast.add({severity:"error",summary:"File Upload Error",detail:f.message,life:5e3}),r("error",f);return}i.value=d.name,a.value=d.type.split("/").pop(),r("upload-status",{status:"uploading",fileName:i.value,fileType:a.value});const m=new FileReader;m.onload=async f=>{const v=new Blob([f.target.result],{type:d.type});console.info("Blob data:",v);try{const p=await a3(v),x={attachment:{name:d.name,data:p}};console.info("AIRequestPayload = ",x),r("upload-status",{status:"uploaded",fileName:i.value,fileType:a.value,size:Yd(d.size),fileData:x}),o.value&&(o.value.value="")}catch(p){console.info("[ERROR]: File upload error:",p),window&&window.$toast&&window.$toast.add({severity:"error",summary:"File Processing Error",detail:"Error processing file: "+(p.message||"Unknown error"),life:5e3}),r("error",{message:"Error processing file",fileName:i.value,fileType:a.value,error:p.message}),r("upload-status",{status:"error",fileName:i.value,fileType:a.value})}},m.onerror=f=>{console.info("[ERROR]: FileReader error:",f),window&&window.$toast&&window.$toast.add({severity:"error",summary:"File Reading Error",detail:"Could not read the selected file",life:5e3}),r("error",{message:"Error reading file",fileName:d.name,fileType:d.type,error:f})},setTimeout(()=>{m.readAsText(d)},100)}},c=()=>{o.value.click()};return(h,d)=>(R(),H("div",$I,[C("input",{ref_key:"fileInput",ref:o,type:"file",accept:".csv, .xls, .xlsx, text/csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",class:"ect-opacity-0 ect-h-0 ect-w-0 ect-absolute",onChange:u},null,544),C("button",{class:"attachment-button",onClick:c,onMouseenter:d[0]||(d[0]=m=>s.value=!0),onMouseleave:d[1]||(d[1]=m=>s.value=!1)},[fe(He,{icon:"attachment",size:"11",height:"17",color:s.value?"#198708":"#828282"},null,8,["color"])],32)]))}},[["__scopeId","data-v-7fbbb7c9"]]),UI={key:0,class:"suggestions-container"},HI={key:0,class:"logo-section"},VI={class:"help-text-section"},zI={key:0,class:"help-text"},XI={key:1,class:"sub-help-text"},KI=["onClick"],GI={key:2,class:"suggestions-list"},QI=["onClick"],WI=Oe({__name:"AISuggestionsDropdown",props:{options:{type:Array,required:!0},helpText:{type:String,default:""},subHelpText:{type:String,default:""},showSuggestions:{type:Boolean,default:!1}},emits:["select","preview"],setup(e,{emit:t}){const n=e,r=t,o=Q(0),i=Q(0),a=Q(null),s=Q(null),l=d=>{a.value=d,i.value=0},u=()=>{a.value=null,o.value=0},c=d=>{r("select",d)},h=d=>{if(n.showSuggestions)switch(d.key){case"ArrowDown":d.preventDefault(),a.value?(i.value=(i.value+1)%a.value.subOptions.length,r("preview",a.value.subOptions[i.value])):(o.value=(o.value+1)%n.options.length,r("preview",n.options[o.value].title));break;case"ArrowUp":d.preventDefault(),a.value?(i.value=i.value-1<0?a.value.subOptions.length-1:i.value-1,r("preview",a.value.subOptions[i.value])):(o.value=o.value-1<0?n.options.length-1:o.value-1,r("preview",n.options[o.value].title));break;case"Enter":d.preventDefault(),a.value?c(a.value.subOptions[i.value]):l(n.options[o.value]);break;case"Escape":case"ArrowLeft":case"Backspace":a.value&&(d.preventDefault(),u());break}};return Xe(()=>n.showSuggestions,d=>{d?(window.addEventListener("keydown",h),a.value=null,o.value=0,i.value=0):window.removeEventListener("keydown",h)}),(d,m)=>e.showSuggestions?(R(),H("div",UI,[a.value?he("",!0):(R(),H("div",HI,[fe(pb)])),C("div",VI,[e.helpText&&!a.value?(R(),H("div",zI,ge(e.helpText),1)):he("",!0),e.subHelpText?(R(),H("div",XI,ge(e.subHelpText),1)):he("",!0)]),a.value?(R(),H("div",GI,[(R(!0),H(Ce,null,Fe(a.value.subOptions,(f,v)=>(R(),H("div",{key:v,class:ke(["sub-option",{"sub-active":i.value===v}]),onClick:p=>c(f)},ge(f),11,QI))),128))])):(R(),H("div",{key:1,ref_key:"suggestionsList",ref:s,class:"suggestions-list"},[(R(!0),H(Ce,null,Fe(e.options,(f,v)=>(R(),H("div",{key:v,class:ke(["suggestion-item",{active:o.value===v}]),onClick:p=>l(f)},ge(f.title),11,KI))),128))],512))])):he("",!0)}},[["__scopeId","data-v-bbb514b3"]]),ZI={class:"chat-file-info"},JI={class:"ect-flex ect-gap-2 ect-items-center ect-self-stretch ect-my-auto ect-text-xs ect-font-medium ect-text-black"},YI=["src"],eT={class:"ect-self-stretch ect-my-auto"},tT={key:0,class:"ect-flex ect-gap-2 ect-justify-center ect-items-center ect-self-stretch ect-my-auto ect-w-4 ect-h-4"},nT=Oe({__name:"ChatInputFileInfo",props:{fileInfo:{type:Object,required:!0}},emits:["cancel"],setup(e,{emit:t}){const n=t,r=()=>{n("cancel")};return(o,i)=>(R(),H("div",ZI,[C("div",JI,[C("img",{loading:"lazy",src:e.fileInfo.fileType==="csv"?Ae(S2):Ae(I2),class:"ect-object-contain ect-shrink-0 ect-self-stretch ect-my-auto ect-w-7 ect-aspect-square",alt:""},null,8,YI),C("div",eT,ge(e.fileInfo.fileName),1)]),e.fileInfo.status==="uploading"?(R(),H("div",tT,[fe($u,{size:18})])):he("",!0),e.fileInfo.status==="uploaded"?(R(),H("button",{key:1,class:"ect-flex ect-gap-2 ect-justify-center ect-items-center ect-self-stretch ect-my-auto ect-w-4 ect-h-4",onClick:r},[fe(He,{icon:"close",size:"8"})])):he("",!0)]))}},[["__scopeId","data-v-24d881bd"]]),rT={class:"chat-input-wrapper"},oT={class:"chat-input-inner"},iT={class:"input-row"},aT=["disabled","placeholder","onKeydown"],sT={key:1,class:"icon-wrapper"},lT={class:"icon-wrapper"},uT=Oe({__name:"chatInput",props:{modelValue:{type:String,default:""},loading:{type:Boolean,default:!1},placeholder:{type:String,default:"Ask Genesis AI"},helpText:{type:String,default:"Here are few areas where I can help"},subHelpText:{type:String,default:"Suggestions by Genesis (Click to Apply)"},showFile:{type:Boolean,default:!1},showMic:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","submit","speak","file-upload-status"],setup(e,{emit:t}){const n=e,r=t;fo();const o=_n(),i=Bo(),a=Q({}),s=Q(!1),l=Q(!1),u=Q(n.modelValue),c=Q(null),h=me(()=>{const E=i.currentStep||null;return(Array.isArray(E==null?void 0:E.promptGuidance)?E.promptGuidance:[]).slice().sort((I,k)=>Number((I==null?void 0:I.sequenceNumber)??0)-Number((k==null?void 0:k.sequenceNumber)??0)).map(I=>{const T=(Array.isArray(I==null?void 0:I.relatedPG)?I.relatedPG:[]).slice().sort((D,j)=>Number((D==null?void 0:D.sequenceNumber)??0)-Number((j==null?void 0:j.sequenceNumber)??0)).map(D=>D.pgName);return{title:I.pgName,subOptions:T}})}),d=me(()=>{var E;return(E=h.value)!=null&&E.length?h.value:[]}),m=me(()=>{var E;return(E=h.value)!=null&&E.length?"Prompt Guidance":n.helpText});Xe(()=>n.loading,async(E,O)=>{!E&&O&&(await Nt(),c.value.focus())}),Xe(u,E=>{r("update:modelValue",E),Nt(()=>b())}),Xe(()=>n.modelValue,E=>{u.value=E});const f=E=>{console.info("[ERROR]: File upload error:",E),o.handleError(E,"ChatInput")},v=()=>{u.value.trim()&&(l.value=!1,r("submit",u.value),u.value="",c.value&&(c.value.style.height="32px"),a.value=null)},p=E=>{u.value=E,l.value=!1,Nt(()=>{b(),c.value&&(c.value.focus(),c.value.selectionStart=c.value.selectionEnd=u.value.length)})},x=E=>{u.value=E,Nt(()=>b())},g=()=>{l.value=!1},y=E=>{console.info("handleFileUploadStatus event = ",E),E!=null&&E.fileName?(a.value=E,r("file-upload-status",E)):(a.value=null,s.value=!0,r("file-upload-status",null),setTimeout(()=>{s.value=!1},3e3))},b=()=>{const E=c.value;if(!E)return;E.style.height="auto";const I=Math.max(32,Math.min(E.scrollHeight,120));E.style.height=`${I}px`},_=()=>{console.info("removeFile"),a.value=null,s.value=!0,r("file-upload-status",null),setTimeout(()=>{s.value=!1},100)},w=()=>{l.value=!1,b()};return(E,O)=>{var I,k,T,D,j;const F=$0("click-outside");return xn((R(),H("div",rT,[fe(WI,{options:d.value,"help-text":m.value,"sub-help-text":e.subHelpText,"show-suggestions":l.value,onSelect:p,onPreview:x},null,8,["options","help-text","sub-help-text","show-suggestions"]),C("div",oT,[C("div",iT,[C("div",{class:ke(["icon-wrapper",{"active-suggestions":l.value,disabled:((I=d.value)==null?void 0:I.length)<=0}])},[fe(He,{disabled:((k=d.value)==null?void 0:k.length)<=0||e.loading,color:((T=d.value)==null?void 0:T.length)<=0?"#DEDEDE":l.value?"#198708":"#828282",icon:"suggestions",size:"13",height:15,onClick:O[0]||(O[0]=K=>l.value=!l.value)},null,8,["disabled","color"])],2),xn(C("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":O[1]||(O[1]=K=>u.value=K),disabled:e.loading,placeholder:e.placeholder,rows:"1",onKeydown:Nn(vt(v,["exact","prevent"]),["enter"]),onInput:w},null,40,aT),[[oo,u.value]]),e.showFile?(R(),H("div",{key:0,class:ke(["icon-wrapper",{"file-upload-disabled":e.loading}])},[fe(jI,{"reset-file-input":s.value,onUploadStatus:y,onError:f},null,8,["reset-file-input"])],2)):he("",!0),e.showMic?(R(),H("div",sT,[fe(He,{color:"#828282",disabled:e.loading,icon:"mic",size:"13",height:15,onClick:O[2]||(O[2]=K=>E.$emit("speak"))},null,8,["disabled"])])):he("",!0),C("div",lT,[(R(),xe(He,{key:1,disabled:e.loading,icon:"send",size:"20",onClick:v},null,8,["disabled"]))])]),((D=a.value)==null?void 0:D.status)==="uploading"||((j=a.value)==null?void 0:j.status)==="uploaded"?(R(),xe(nT,{key:0,class:"ect-mt-3 ect-mb-0.5","file-info":a.value,onCancel:_},null,8,["file-info"])):he("",!0)])])),[[F,g]])}}},[["__scopeId","data-v-e205d71c"]]),cT=["data-test-id"],dT=["data-test-id"],fT=["data-test-id"],hT=Oe({__name:"aiChat",props:{dataTestId:{type:String,required:!0},isExternalGuidance:{type:Boolean,required:!1,default:!1},styles:{type:Object,required:!1,default:()=>({}),validator:e=>typeof(e==null?void 0:e.height)=="string"}},setup(e){const t=Bo(),n=fo(),r=Q(null),o=me(()=>{var l;return((l=t.getCurrentStepLinks)==null?void 0:l.call(t))||[]}),i=me(()=>!0),a=l=>{console.info("[aiChat] handleSubmit",{hasFileData:!!r.value,messageLength:(l||"").length}),r.value?(console.info("[aiChat] sending with file attachment"),n.sendMessage(l,!0,r.value)):(console.info("[aiChat] sending without attachment"),n.sendMessage(l))},s=l=>{console.info("ChatScreen handleFileUploadStatus event = ",l),l!=null&&l.fileData?(r.value=l.fileData,n.attachmentData={size:l.size,type:l.fileType,name:l.fileName}):(r.value=null,n.attachmentData=null)};return(l,u)=>(R(),H("div",{class:"chat-screen","data-test-id":e.dataTestId},[C("div",{class:ke(["messages-container",{"playbook-steps-mode-hybrid":Ae(t).playbookStepsMode==="hybrid","playbook-steps-mode-full":Ae(t).playbookStepsMode==="full","dxp-guiddance":e.isExternalGuidance}]),style:we({maxHeight:`calc(${e.styles.height} - 72px)`,height:`calc(${e.styles.height} - 72px)`}),"data-test-id":`${e.dataTestId}-messages-container`},[fe(qI,{messages:Ae(n).chatHistory,"loading-message":Ae(n).loadingMessage,"undo-id":Ae(n).latestDMLRequest,"button-links":o.value,"strikethrough-ids":Ae(n).strikethroughHistory,"data-changed":Ae(n).dataManuallyChanged,"data-test-id":`${e.dataTestId}-messages`},null,8,["messages","loading-message","undo-id","button-links","strikethrough-ids","data-changed","data-test-id"])],14,dT),C("div",{class:"input-container","data-test-id":`${e.dataTestId}-input-container`},[fe(uT,{modelValue:Ae(n).promptMessage,"onUpdate:modelValue":u[0]||(u[0]=c=>Ae(n).promptMessage=c),disabled:!i.value,"file-info":r.value,loading:!!Ae(n).loadingMessage,"data-test-id":`${e.dataTestId}-input`,onSubmit:a,onFileUploadStatus:s},null,8,["modelValue","disabled","file-info","loading","data-test-id"])],8,fT)],8,cT))}},[["__scopeId","data-v-99005673"]]),pT={class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center","data-test-id":"configurator-not-found"},mT={class:"ect-max-w-[720px] ect-p-[50px] ect-border ect-rounded-lg ect-bg-white ect-shadow-sm"},gT={class:"ect-text-[40px] ect-leading-none ect-mb-3"},yT=C("div",{class:"ect-text-[22px] ect-font-normal ect-leading-normal ect-mb-[12px] ect-capitalize ect-text-[#5F5F5F]","data-test-id":"configurator-not-found-title"}," Product Configurator Not Found ",-1),vT=C("div",{class:"ect-text-sm ect-text-gray-500","data-test-id":"configurator-not-found-subtitle"}," Linked composable product configurator UI component for this screen is not found OR the composable product configurator UI component does not exist. Please create / connect one and try again. ",-1),bT={class:"ect-mt-4 ect-flex ect-items-center ect-justify-between ect-gap-6"},xT={__name:"MoleculeConfiguratorNotFound",emits:["return","go-cart"],setup(e){return(t,n)=>(R(),H("div",pT,[C("div",mT,[C("div",gT,[fe(He,{icon:"error",size:48})]),yT,vT,C("div",bT,[C("button",{type:"button",class:"ect-text-green-600 ect-text-sm ect-font-medium",onClick:n[0]||(n[0]=r=>t.$emit("return")),"data-test-id":"configurator-not-found-return"}," RETURN TO PRODUCT RESULTS "),C("button",{type:"button",class:"ect-text-green-600 ect-text-sm ect-font-medium",onClick:n[1]||(n[1]=r=>t.$emit("go-cart")),"data-test-id":"configurator-not-found-go-to-cart"}," GO TO CART ")])])]))}},_T=e=>(Gt("data-v-2f2aa6e4"),e=e(),Qt(),e),CT={class:"ect-h-full ect-w-full ect-bg-white","data-test-id":"aiComponentLoader-wrapper"},ET={key:4,class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center"},kT={class:"ect-text-center"},wT=_T(()=>C("div",{class:"ect-text-base ect-font-medium","data-test-id":"aiComponentLoader-fallback-title"}," No component to display for this step ",-1)),AT={class:"ect-text-sm ect-text-gray-500 ect-mt-2","data-test-id":"aiComponentLoader-fallback-subtitle"},ST=Oe({__name:"aiComponentLoader",props:{stepComponent:{type:String,default:null},identity:{type:Object,default:()=>({})},session:{type:Object,default:()=>({})},security:{type:Object,default:()=>({})},packageVersion:{type:String,default:""},composablesOrgType:{type:String,default:""},composablesApiKey:{type:String,default:""},templateId:{type:String,default:""},hostName:{type:String,default:""},graphqlEndpoint:{type:String,default:""},apiKey:{type:String,default:""},isPreview:{type:Boolean,default:!1},sections:{type:Array,default:()=>[]},theme:{type:Object,default:()=>({})},catalogPreviewData:{type:Object,default:()=>({})},catalogInitialData:{type:Array,default:()=>[]},catalogSearchTerm:{type:String,default:""},onCatalogCountUpdate:{type:Function,default:null},cartSections:{type:String,default:""},configItemId:{type:String,default:""},configQliId:{type:String,default:""},configApiKey:{type:String,default:""}},emits:["expeditecart-clicked","catalog-quote-created","catalog-quote-updated","catalog-items-loaded","catalog-item-added","catalog-item-qty-updated","catalog-line-deleted","catalog-items-fetched","catalog-item-configure"],setup(e,{emit:t}){const n=t,r=e,o=Bo(),i=Lu(),a=Ht(),s=me(()=>({...r.session,qliId:m.value||r.configQliId||void 0,itemId:d.value})),l=me(()=>{const S=o==null?void 0:o.activeComponentKey,M=r.stepComponent;return(S||M||"").toString().trim().toLowerCase().replace(/[^a-z0-9]+/g,"_")}),u=me(()=>{var L,V;const S=!!r.templateId,M=!!((L=r.identity)!=null&&L.organizationId),q=!!((V=r.identity)!=null&&V.accountId),z=typeof r.cartSections=="string"&&r.cartSections.length>0;return S&&M&&q&&z}),c=me(()=>{var M;if(Array.isArray(r.catalogInitialData)&&r.catalogInitialData.length>0)return r.catalogInitialData;const S=((M=o==null?void 0:o.activeComponentData)==null?void 0:M.payload)||{};if(S.catalog&&typeof S.catalog=="object")try{const z=Object.values(S.catalog).map(L=>{var V;return(V=L==null?void 0:L.catalogResponse)==null?void 0:V.productInfo}).filter(Boolean);if(z.length>0)return z}catch{}return Array.isArray(S.initialData)&&S.initialData.length>0?S.initialData:Array.isArray(S.catalogInitialData)&&S.catalogInitialData.length>0?S.catalogInitialData:Array.isArray(S.items)&&S.items.length>0?S.items:[]}),h=me(()=>{var M;const S=((M=o==null?void 0:o.activeComponentData)==null?void 0:M.payload)||{};return r.catalogSearchTerm||S.searchTerm||""}),d=me(()=>{var M,q,z,L,V,Z;const S=((L=(z=(q=(M=o==null?void 0:o.activeComponentData)==null?void 0:M.payload)==null?void 0:q.savedProducts)==null?void 0:z[0])==null?void 0:L.itemId)||((V=o==null?void 0:o.activeComponentData)==null?void 0:V.payload)&&Object.keys(((Z=o.activeComponentData.payload)==null?void 0:Z.quoteConfiguration)||{})[0]||"";return r.configItemId||S||""}),m=me(()=>{var M,q,z,L,V,Z,oe,re;const S=(L=(z=(q=(M=o==null?void 0:o.activeComponentData)==null?void 0:M.payload)==null?void 0:q.savedProducts)==null?void 0:z[0])==null?void 0:L.qliId;if(!S){console.log("[aiComponentLoader] configQliIdComputed: No qliId from savedProducts");const ue=(Z=(V=o==null?void 0:o.activeComponentData)==null?void 0:V.payload)==null?void 0:Z.quoteConfiguration;if(console.log("[aiComponentLoader] configQliIdComputed: quoteConfiguration:",ue),ue&&typeof ue=="object"){const de=Object.keys(ue)[0];if(console.log("[aiComponentLoader] configQliIdComputed: firstItemId:",de),de){const P=(oe=ue[de])==null?void 0:oe.product;if(console.log("[aiComponentLoader] configQliIdComputed: productObj:",P),P&&P.qliId)return console.log("[aiComponentLoader] configQliIdComputed: found qliId in productObj:",P.qliId),P.qliId;if((re=ue[de])!=null&&re.qliId)return console.log("[aiComponentLoader] configQliIdComputed: found qliId directly under itemId:",ue[de].qliId),ue[de].qliId}}}return S||""}),f=me(()=>!!d.value),v=me(()=>l.value==="configurator"&&!f.value?"Configurator requires an itemId (and optional qliId). Provide via playbook payload or props.":l.value==="catalog"?"Catalog step is active. Provide templateId/sections/theme when available.":l.value==="cart"?"Cart step is active.":"Awaiting playbook step selection."),p=me(()=>{try{return JSON.stringify((o==null?void 0:o.activeComponentData)||{})}catch{return""}}),x=me(()=>`catalog::${p.value}`),g=me(()=>`cart::${p.value}`),y=me(()=>{var S;try{return(((S=o==null?void 0:o.activeComponentData)==null?void 0:S.actionFunction)||"")==="Reload"}catch{return!1}}),b=me(()=>{var M;const S=`configurator::${d.value||""}::${m.value||""}`;if(y.value){const q=((M=o==null?void 0:o.activeComponentData)==null?void 0:M.requestId)||"";return`${S}::${q}`}return S}),_=Q([]),w=Q(null),E=S=>{const M=Array.isArray(S)?S:Array.isArray(S==null?void 0:S.items)?S.items:[];if(!Array.isArray(M))return;const q={"Needs Configuration":1,"Suggests Configuration":2,"Fully Configured":3},z=Z=>(Z==null?void 0:Z.requiresConfiguration)||"",L=Z=>!!Z&&Z in q,V=M.filter(Z=>L(z(Z)));V.sort((Z,oe)=>{const re=z(Z),ue=z(oe);return(q[re]||99)-(q[ue]||99)}),_.value=V,w.value=V.length?V[0]:null},O=S=>{console.log("onQuoteCreated",S),n("catalog-quote-created",S)},F=S=>{console.log("onQuoteUpdated",S),n("catalog-quote-updated",S)},I=S=>{console.log("onItemAdded",S),n("catalog-item-added",S)},k=S=>{console.log("onItemQtyUpdated",S),n("catalog-item-qty-updated",S)},T=S=>{console.log("onLineDeleted",S),n("catalog-line-deleted",S)},D=S=>{console.log("onQuoteItemsFetched",S),n("catalog-items-fetched",S)};Xe(()=>l.value,(S,M)=>{var q,z,L,V,Z,oe,re,ue,de,P,$;if(S==="configurator"){const W=!!((L=(z=(q=o==null?void 0:o.activeComponentData)==null?void 0:q.payload)==null?void 0:z.savedProducts)!=null&&L.length),G=!!((Z=(V=o==null?void 0:o.activeComponentData)==null?void 0:V.payload)!=null&&Z.quoteConfiguration&&Object.keys(((re=(oe=o==null?void 0:o.activeComponentData)==null?void 0:oe.payload)==null?void 0:re.quoteConfiguration)||{}).length>0);if(!W&&!G&&w.value&&!d.value){const J=((ue=w.value)==null?void 0:ue.itemId)||"";if(J){const X=((de=o==null?void 0:o.currentPlaybook)==null?void 0:de.playBookSteps)||[],ne=ve=>String(ve||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_");let se=null;const le=X.findIndex(ve=>ve.stepName===(o==null?void 0:o.currentStepName));if(le>=0&&X[le+1]&&ne((P=X[le+1])==null?void 0:P.stepComponent)==="configurator")se=X[le+1].stepName;else{const ve=X.findIndex(_e=>ne(_e==null?void 0:_e.stepComponent)==="configurator");se=ve>=0?($=X[ve])==null?void 0:$.stepName:null}const ae={payload:{savedProducts:[{itemId:J}]}};se?o.navigateToStep({stepName:se,data:ae}):o.loadComponent("configurator",ae)}}}});const j=()=>{var z,L;const S=((z=o==null?void 0:o.currentPlaybook)==null?void 0:z.playBookSteps)||[],M=V=>String(V||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),q=S.findIndex(V=>M(V==null?void 0:V.stepComponent)==="catalog"||M(V==null?void 0:V.stepName).includes("catalog"));if(q>=0){const V=(L=S[q])==null?void 0:L.stepName;o.navigateToStep({stepName:V})}else o.loadComponent("catalog")},K=()=>{var z,L;const S=((z=o==null?void 0:o.currentPlaybook)==null?void 0:z.playBookSteps)||[],M=V=>String(V||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),q=S.findIndex(V=>M(V==null?void 0:V.stepComponent)==="cart"||M(V==null?void 0:V.stepName).includes("cart"));if(q>=0){const V=(L=S[q])==null?void 0:L.stepName;o.navigateToStep({stepName:V})}else o.loadComponent("cart")},U=S=>{var M,q;console.log("onItemConfigureClicked",S),n("catalog-item-configure",S);try{const z=(S==null?void 0:S.itemId)||"",L=(S==null?void 0:S.qliId)||(S==null?void 0:S.QliId)||"",V=[];if(z){const de={itemId:z};L&&(de.qliId=L),V.push(de)}const Z={payload:{savedProducts:V}},oe=((M=o==null?void 0:o.currentPlaybook)==null?void 0:M.playBookSteps)||[],re=de=>String(de||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),ue=oe.findIndex(de=>{const P=re(de==null?void 0:de.stepComponent),$=re(de==null?void 0:de.stepName);return P==="configurator"||$.includes("configure")});if(ue>=0){const de=(q=oe[ue])==null?void 0:q.stepName;o.navigateToStep({stepName:de,data:Z})}else o.loadComponent("configurator",Z)}catch(z){console.warn("[aiComponentLoader] Failed to navigate to configurator from configure click:",z),o.loadComponent("configurator",{payload:{}})}},te=S=>{console.log("onCartClicked",S),n("expeditecart-clicked",S)},ie=S=>{var M,q;try{const z=(S==null?void 0:S.itemId)||"",L=(S==null?void 0:S.lineItemId)||(S==null?void 0:S.qliId)||"",V=[];if(z){const de={itemId:z};L&&(de.qliId=L),V.push(de)}const Z={payload:{savedProducts:V}},oe=((M=o==null?void 0:o.currentPlaybook)==null?void 0:M.playBookSteps)||[],re=de=>String(de||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),ue=oe.findIndex(de=>{const P=re(de==null?void 0:de.stepComponent),$=re(de==null?void 0:de.stepName);return P==="configurator"||$.includes("configure")});if(ue>=0){const de=(q=oe[ue])==null?void 0:q.stepName;o.navigateToStep({stepName:de,data:Z})}else o.loadComponent("configurator",Z)}catch(z){console.warn("[aiComponentLoader] Failed to navigate to configurator from cart configure click:",z),o.loadComponent("configurator",{payload:{}})}},Y=S=>{console.log("onCatalogIdReceived",S),a.updateConfig({eCatalogId:S})},N=S=>{console.log("Action",S),S.event==="add-to-quote"?n("configurator:add-to-quote",S.data):S.event==="save"&&n("configurator:save",S.data)},A=Q("");return Xe(()=>o==null?void 0:o.activeComponentData,async S=>{var q,z,L;if(!S)return;console.log("activeComponentData Changed",S);const M=(S==null?void 0:S.requestId)||"";if(console.log("requestId",M),console.log("lastReloadRequestId",A.value),M&&M!==A.value)if(A.value=M,await Nt(),(q=S==null?void 0:S.payload)!=null&&q.quoteConfiguration&&Object.keys(((z=S==null?void 0:S.payload)==null?void 0:z.quoteConfiguration)??{}).length>0){const V=Object.keys(((L=S==null?void 0:S.payload)==null?void 0:L.quoteConfiguration)??{})[0];i.setPreConfigData(S==null?void 0:S.payload,V)}else(S==null?void 0:S.actionFunction)==="Reload"&&(console.log("Reloading configurator 1"),i.refresh())},{deep:!0}),(S,M)=>(R(),H("div",CT,[l.value==="catalog"?(R(),xe(w2,{key:x.value,"data-test-id":"aiComponentLoader-catalog",class:"ect-h-full ect-w-full","template-id":e.templateId,identity:e.identity,session:e.session,security:e.security,"search-term":h.value,"on-catalog-count-update":e.onCatalogCountUpdate,"preview-data":e.catalogPreviewData,"initial-data":c.value,sections:e.sections,theme:e.theme,"composables-org-type":e.composablesOrgType,onCatalogQuoteCreated:O,onCatalogQuoteUpdated:F,onCatalogItemsLoaded:E,onCatalogItemAdded:I,onCatalogItemQtyUpdated:k,onCatalogLineDeleted:T,onCatalogItemsFetched:D,onCatalogItemConfigure:U,"onCatalog:id":Y},null,8,["template-id","identity","session","security","search-term","on-catalog-count-update","preview-data","initial-data","sections","theme","composables-org-type"])):l.value==="cart"&&u.value?(R(),xe(A2,{key:g.value,"data-test-id":"aiComponentLoader-cart",class:"ect-h-full ect-w-full","template-id":e.templateId,"host-name":e.hostName,"composables-org-type":e.composablesOrgType,security:e.security,identity:e.identity,session:e.session,onExpeditecartItemConfigure:ie,onExpeditecartClicked:te},null,8,["template-id","host-name","composables-org-type","security","identity","session"])):l.value==="configurator"&&f.value?(R(),xe(u2,{key:b.value,"data-test-id":"aiComponentLoader-configurator",class:"ect-h-full ect-w-full",security:e.security,identity:e.identity,"user-locale":S.userLocale,"composables-org-type":e.composablesOrgType,session:s.value,onReady:Ae(i).setExpediteConfigComp,onAction:N},null,8,["security","identity","user-locale","composables-org-type","session","onReady"])):l.value==="configurator"&&!f.value?(R(),xe(xT,{key:3,onReturn:j,onGoCart:K})):(R(),H("div",ET,[C("div",kT,[wT,C("div",AT,ge(v.value),1)])]))]))}},[["__scopeId","data-v-2f2aa6e4"]]),IT={class:"ai-guidance-loader","data-test-id":"aiGuidance-loader-container"},TT={class:"aig-message-text","data-test-id":"aiGuidance-loader-message"},OT={class:"aig-button","data-test-id":"aiGuidance-loader-button"},DT={class:"aig-input-box","data-test-id":"aiGuidance-loader-input"},MT=Oe({__name:"AiGuidanceLoader",props:{errors:{type:Array,required:!1,default:()=>[]}},setup(e){return(t,n)=>(R(),H("div",IT,[C("div",TT,[fe(Oi,{style:{height:"16px",width:"90%","margin-bottom":"8px"}}),fe(Oi,{style:{height:"16px",width:"65%","margin-bottom":"20px"}})]),C("div",OT,[fe(Oi,{style:{height:"40px",width:"100%"}})]),(R(!0),H(Ce,null,Fe(e.errors,r=>(R(),H("div",{key:r,class:"aig-message-error","data-test-id":"aiGuidance-loader-error"},ge(r),1))),128)),C("div",DT,[fe(Oi,{style:{height:"40px",width:"100%"}})])]))}},[["__scopeId","data-v-aae34926"]]),FT={class:"ai-guidance-wrapper","data-test-id":"aiGuidance-wrapper"},RT=Oe({__name:"aiGuidance",props:{templateId:{type:String,required:!1},playbookData:{type:Object,required:!1},composablesOrgType:{type:String,required:!0},identity:{type:Object,required:!1,default:()=>({})},session:{type:Object,required:!1,default:()=>({})},security:{type:Object,required:!1,default:()=>({})},websocketUrl:{type:String,required:!0},packageVersion:{type:String,required:!0},hostName:{type:String,required:!1},graphqlEndpoint:{type:String,required:!1},apiKey:{type:String,required:!1},isPreview:{type:Boolean,required:!1,default:!1},catalogSections:{type:Array,required:!1,default:()=>[]},cartSections:{type:String,required:!1,default:""},theme:{type:Object,required:!1,default:()=>({})},styles:{type:Object,required:!1,default:()=>({height:"100vh"}),validator:e=>typeof(e==null?void 0:e.height)=="string"}},emits:["expeditecart-item-configure","expeditecart-clicked","component-action","ai-response:success"],setup(e,{emit:t}){const n=Bo(),r=Ht(),o=fo(),i=Ci(),a=t,s=Q(!0),l=Q(!1),u=Q(!0),c=Q(!0),h=Q(!1),d=Q([]),m=e,{composablesOrgType:f,websocketUrl:v,packageVersion:p,identity:x,session:g,security:y,templateId:b,hostName:_,graphqlEndpoint:w,apiKey:E,isPreview:O,catalogSections:F,cartSections:I,theme:k}=m;Wt(async()=>{console.log("security",y),console.log("apiKey",E),r.updateConfig({userId:x==null?void 0:x.userId,organizationId:x==null?void 0:x.organizationId,accessToken:y==null?void 0:y.accessToken,composablesApiUrl:y==null?void 0:y.baseUrl,composablesOrgType:f,websocketUrl:v,quoteId:g==null?void 0:g.quoteId,packageVersion:p,accountId:x==null?void 0:x.accountId,templateId:b,hostName:_,graphqlEndpoint:w,apiKey:(y==null?void 0:y.apiKey)||E,cid:x==null?void 0:x.contactId,isPreview:O})}),_t(async()=>{var A,S,M,q;n.setSecretKey(y==null?void 0:y.accessToken);const ie=await n.getPlaybookInfoFromQuote();let Y=(ie==null?void 0:ie.XX_ORD1__Completed_PB_Step_Number_EX__c)??void 0,N=(ie==null?void 0:ie.XX_ORD1__Playbook_Current_Step_Meta_EX__c)??void 0;if(N&&(N=JSON.parse(N)),console.info("sequenceNumberServer = ",Y),m.templateId){s.value=!0;const z=await n.getCatalogInContext();console.log("catalogInContext = ",z),z&&r.updateConfig({eCatalogId:z}),await i.fetchBlockInformationREST({templateId:m.templateId});const L=i.pageBlocks[0].blocks[0].playbookId;if(console.log("playbookID",L),L?l.value=!0:d.value.push("No playbook ID found in template"),n.setEmbeddedMode(!0),L&&(n.currentPlaybook=L,await n.getPlaybookByKey(L),n.showPlaybookSteps=!0),n.playbookStepsMode="full",o.setInitialPayload(),await o.connectSocket(),Y!==void 0){n.navigateToStep({stepName:(S=(A=n.currentPlaybook)==null?void 0:A.playBookSteps[Number(Y)])==null?void 0:S.stepName,data:N}),s.value=!1;return}(q=(M=n.currentPlaybook)==null?void 0:M.playBookSteps)!=null&&q.length&&n.setCurrentStepName(n.currentPlaybook.playBookSteps[0].stepName),s.value=!1}else d.value.push("templateId is required")});const T=me(()=>{var N;const ie=((N=n.currentPlaybook)==null?void 0:N.playBookSteps)||[],Y=n.currentStepName;return ie.find(A=>A.stepName===Y)||ie[0]||null}),D=me(()=>{var ie;return((ie=T.value)==null?void 0:ie.stepComponent)||null});Xe(()=>n.activeComponentKey,ie=>{ie&&(u.value=!1)});const j=[];_t(()=>{j.push($n("expeditecart:configure-clicked",ie=>{a("expeditecart-item-configure",ie)})),j.push($n("expeditecart:clicked",ie=>{a("expeditecart-clicked",ie)})),j.push($n("ai-response:success",ie=>{try{a("ai-response:success",ie)}catch{}}))});const K=ie=>{console.log("onExpediteCartClicked",ie),a("component-action",{component:"cart",details:ie})},U=(ie,Y)=>{a("component-action",{component:"catalog",action:ie,details:Y})},te=(ie,Y)=>{a("component-action",{component:"configurator",action:ie,details:Y})};return gr(()=>{try{o.cancelRequest()}catch{}try{o.disconnectSocket()}catch{}try{o.resetState()}catch{}try{n.setEmbeddedMode(!1),n.currentPlaybook=null,n.currentStepName=null,n.activeComponentKey=null,n.activeComponentData=null,n.showPlaybookSteps=!1,n.playbookStepsMode="full"}catch{}s.value=!1,l.value=!1,u.value=!0,c.value=!0,h.value=!1,d.value=[],j.forEach(ie=>{try{ie()}catch{}})}),(ie,Y)=>{var N;return R(),H("div",FT,[fe(qu,{icon:"logo",color:"#000000",size:"18.75",height:"16.25"}),s.value?(R(),xe(MT,{key:0,errors:d.value,"data-test-id":"aiGuidance-loader"},null,8,["errors"])):(R(),H("div",{key:1,class:ke(["ai-app",{"root-path":u.value,"playbook-steps-mode-full":Ae(n).playbookStepsMode==="full","dxp-guiddance":l.value}]),style:we(e.styles)},[C("div",{class:"ai-app-chat-wrapper",style:we({height:e.styles.height})},[fe(hT,{"data-test-id":"chat-screen","is-external-guidance":l.value,styles:e.styles},null,8,["is-external-guidance","styles"])],4),!u.value&&c.value&&!h.value?(R(),H("div",{key:0,class:"component-loader-wrapper",style:we({height:e.styles.height,maxHeight:e.styles.height})},[Ae(n).currentPlaybook?(R(),xe(ST,{key:0,"template-id":((N=T.value)==null?void 0:N.templateId)||Ae(b),"step-component":D.value,identity:Ae(x),session:Ae(g),security:Ae(y),"composables-org-type":Ae(f),"package-version":Ae(p),"host-name":Ae(_),"graphql-endpoint":Ae(w),"api-key":Ae(E),"is-preview":Ae(O),sections:Ae(F),"cart-sections":Ae(I),theme:Ae(k),"data-test-id":"aiComponentLoader-mounted",onExpeditecartClicked:K,onCatalogQuoteCreated:Y[0]||(Y[0]=A=>U("quote-created",A)),onCatalogQuoteUpdated:Y[1]||(Y[1]=A=>U("quote-updated",A)),onCatalogItemsLoaded:Y[2]||(Y[2]=A=>U("items-loaded",A)),onCatalogItemAdded:Y[3]||(Y[3]=A=>U("item-added",A)),onCatalogItemQtyUpdated:Y[4]||(Y[4]=A=>U("item-qty-updated",A)),onCatalogLineDeleted:Y[5]||(Y[5]=A=>U("line-deleted",A)),onCatalogItemsFetched:Y[6]||(Y[6]=A=>U("items-fetched",A)),onCatalogItemConfigure:Y[7]||(Y[7]=A=>U("item-configure",A)),"onConfigurator:addToQuote":Y[8]||(Y[8]=A=>te("add-to-quote",A)),"onConfigurator:save":Y[9]||(Y[9]=A=>te("save",A))},null,8,["template-id","step-component","identity","session","security","composables-org-type","package-version","host-name","graphql-endpoint","api-key","is-preview","sections","cart-sections","theme"])):he("",!0)],4)):he("",!0)],6))])}}},[["__scopeId","data-v-ee278ef7"]]);let ws=null;if(typeof window<"u"){try{ws=v6()}catch{}ws||(ws=b6(),mi(ws))}let As=null,Ss=null;const Sc=new Set;let mo=null;const Ic=new Map;async function BT(e){if(!e)return"";if(Ic.has(e))return Ic.get(e);try{const t=await fetch(e,{credentials:"omit",cache:"no-cache"});if(t.ok){const n=await t.text();return Ic.set(e,n),n}}catch(t){console.warn("[ExpediteComponents] Failed to fetch theme CSS:",t)}return""}async function Tc(e,t){if(!e||!t)return;const n=e.querySelector("style[data-vue-expedite-theme]");n&&n.remove();try{const r=await BT(t);if(r){const o=document.createElement("style");o.setAttribute("data-vue-expedite-theme","true"),o.textContent=r,e.prepend(o)}}catch(r){console.warn("[ExpediteComponents] Failed to inject theme CSS:",r)}}function Oc(e){mo=e||null,mo&&Sc.forEach(t=>{t&&t.shadowRoot&&Tc(t.shadowRoot,mo)})}async function LT(){return As||Ss||(Ss=(async()=>{try{const e=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Sr&&Sr.src||new URL("vue-expedite-components.umd.cjs",document.baseURI).href).href,t=await fetch(e);if(t.ok)return As=await t.text(),As}catch(e){console.warn("[ExpediteComponents] Failed to load CSS:",e)}return null})(),Ss)}const zi=e=>class extends e{async connectedCallback(){if(super.connectedCallback&&super.connectedCallback(),Sc.add(this),!!this.shadowRoot){if(this.shadowRoot.querySelector("style[data-vue-expedite-style]")){mo&&Tc(this.shadowRoot,mo);return}try{const t=await LT();if(t){const n=document.createElement("style");n.setAttribute("data-vue-expedite-style","true"),n.textContent=t,this.shadowRoot.prepend(n)}else{const n=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Sr&&Sr.src||new URL("vue-expedite-components.umd.cjs",document.baseURI).href).href,r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("data-vue-expedite-style","true"),r.href=n,this.shadowRoot.prepend(r)}mo&&Tc(this.shadowRoot,mo)}catch(t){console.warn("[ExpediteComponents] Failed to inject CSS:",t)}}}disconnectedCallback(){Sc.delete(this),super.disconnectedCallback&&super.disconnectedCallback()}},Fh=zi(pi(u2)),Rh=zi(pi(Nx)),Bh=zi(pi(w2)),Lh=zi(pi(A2)),Nh=zi(pi(RT));function Dc(){typeof window<"u"&&(customElements.get("vue-expedite-configurator")||customElements.define("vue-expedite-configurator",Fh),customElements.get("vue-expedite-gpt")||customElements.define("vue-expedite-gpt",Rh),customElements.get("vue-expedite-catalog")||customElements.define("vue-expedite-catalog",Bh),customElements.get("vue-expedite-cart")||customElements.define("vue-expedite-cart",Lh),customElements.get("vue-expedite-ai-guidance")||customElements.define("vue-expedite-ai-guidance",Nh))}typeof window<"u"&&Dc();const NT={register:Dc,applyThemeToShadows:Oc};typeof window<"u"&&(window.VueExpediteComponents=Object.assign(window.VueExpediteComponents||{},{applyThemeToShadows:Oc})),yn.ExpediteAIGuidanceElement=Nh,yn.ExpediteCartElement=Lh,yn.ExpediteCatalogElement=Bh,yn.ExpediteConfiguratorElement=Fh,yn.ExpediteGPTElement=Rh,yn.applyThemeToShadows=Oc,yn.default=NT,yn.registerWebComponents=Dc,Object.defineProperties(yn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED