@expedite-commerce/expedite-components 0.2.130 → 0.2.132

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.
@@ -42163,7 +42163,7 @@ const fD = ["innerHTML"], hD = {
42163
42163
  var p;
42164
42164
  return (p = i.chatStyles) == null ? void 0 : p.textColor;
42165
42165
  }), f = (p, v, g = !1) => {
42166
- if (typeof p == "string" && p.startsWith("playbookNavigate:")) {
42166
+ if (console.info("performAction action", p), typeof p == "string" && p.startsWith("playbookNavigate:")) {
42167
42167
  const x = p.slice(17);
42168
42168
  a.navigateToBean(x);
42169
42169
  return;
@@ -42265,7 +42265,7 @@ const fD = ["innerHTML"], hD = {
42265
42265
  ], 512)
42266
42266
  ], 2));
42267
42267
  }
42268
- }, ED = /* @__PURE__ */ Ne(CD, [["__scopeId", "data-v-fe989f2b"]]), kD = { class: "ai-upload ect-flex-inline ect-items-center" }, AD = {
42268
+ }, ED = /* @__PURE__ */ Ne(CD, [["__scopeId", "data-v-4ae19744"]]), kD = { class: "ai-upload ect-flex-inline ect-items-center" }, AD = {
42269
42269
  __name: "FileUpload",
42270
42270
  props: {
42271
42271
  // Prop to reset the file input state when changed to true
@@ -181,7 +181,7 @@
181
181
  `;break}return r},Ko.prototype.render=function(e,n,t){let r="";const o=this.rules;for(let i=0,a=e.length;i<a;i++){const s=e[i].type;s==="inline"?r+=this.renderInline(e[i].children,n,t):typeof o[s]<"u"?r+=o[s](e,i,n,t,this):r+=this.renderToken(e,i,n,t)}return r};function vn(){this.__rules__=[],this.__cache__=null}vn.prototype.__find__=function(e){for(let n=0;n<this.__rules__.length;n++)if(this.__rules__[n].name===e)return n;return-1},vn.prototype.__compile__=function(){const e=this,n=[""];e.__rules__.forEach(function(t){t.enabled&&t.alt.forEach(function(r){n.indexOf(r)<0&&n.push(r)})}),e.__cache__={},n.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(r){r.enabled&&(t&&r.alt.indexOf(t)<0||e.__cache__[t].push(r.fn))})})},vn.prototype.at=function(e,n,t){const r=this.__find__(e),o=t||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=n,this.__rules__[r].alt=o.alt||[],this.__cache__=null},vn.prototype.before=function(e,n,t,r){const o=this.__find__(e),i=r||{};if(o===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o,0,{name:n,enabled:!0,fn:t,alt:i.alt||[]}),this.__cache__=null},vn.prototype.after=function(e,n,t,r){const o=this.__find__(e),i=r||{};if(o===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o+1,0,{name:n,enabled:!0,fn:t,alt:i.alt||[]}),this.__cache__=null},vn.prototype.push=function(e,n,t){const r=t||{};this.__rules__.push({name:e,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null},vn.prototype.enable=function(e,n){Array.isArray(e)||(e=[e]);const t=[];return e.forEach(function(r){const o=this.__find__(r);if(o<0){if(n)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[o].enabled=!0,t.push(r)},this),this.__cache__=null,t},vn.prototype.enableOnly=function(e,n){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(t){t.enabled=!1}),this.enable(e,n)},vn.prototype.disable=function(e,n){Array.isArray(e)||(e=[e]);const t=[];return e.forEach(function(r){const o=this.__find__(r);if(o<0){if(n)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[o].enabled=!1,t.push(r)},this),this.__cache__=null,t},vn.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Xn(e,n,t){this.type=e,this.tag=n,this.attrs=null,this.map=null,this.nesting=t,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Xn.prototype.attrIndex=function(n){if(!this.attrs)return-1;const t=this.attrs;for(let r=0,o=t.length;r<o;r++)if(t[r][0]===n)return r;return-1},Xn.prototype.attrPush=function(n){this.attrs?this.attrs.push(n):this.attrs=[n]},Xn.prototype.attrSet=function(n,t){const r=this.attrIndex(n),o=[n,t];r<0?this.attrPush(o):this.attrs[r]=o},Xn.prototype.attrGet=function(n){const t=this.attrIndex(n);let r=null;return t>=0&&(r=this.attrs[t][1]),r},Xn.prototype.attrJoin=function(n,t){const r=this.attrIndex(n);r<0?this.attrPush([n,t]):this.attrs[r][1]=this.attrs[r][1]+" "+t};function bh(e,n,t){this.src=e,this.env=t,this.tokens=[],this.inlineMode=!1,this.md=n}bh.prototype.Token=Xn;const XI=/\r\n?|\n/g,WI=/\0/g;function QI(e){let n;n=e.src.replace(XI,`
182
182
  `),n=n.replace(WI,"�"),e.src=n}function ZI(e){let n;e.inlineMode?(n=new e.Token("inline","",0),n.content=e.src,n.map=[0,1],n.children=[],e.tokens.push(n)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function JI(e){const n=e.tokens;for(let t=0,r=n.length;t<r;t++){const o=n[t];o.type==="inline"&&e.md.inline.parse(o.content,e.md,e.env,o.children)}}function YI(e){return/^<a[>\s]/i.test(e)}function eS(e){return/^<\/a\s*>/i.test(e)}function tS(e){const n=e.tokens;if(e.md.options.linkify)for(let t=0,r=n.length;t<r;t++){if(n[t].type!=="inline"||!e.md.linkify.pretest(n[t].content))continue;let o=n[t].children,i=0;for(let a=o.length-1;a>=0;a--){const s=o[a];if(s.type==="link_close"){for(a--;o[a].level!==s.level&&o[a].type!=="link_open";)a--;continue}if(s.type==="html_inline"&&(YI(s.content)&&i>0&&i--,eS(s.content)&&i++),!(i>0)&&s.type==="text"&&e.md.linkify.test(s.content)){const l=s.content;let u=e.md.linkify.match(l);const c=[];let h=s.level,d=0;u.length>0&&u[0].index===0&&a>0&&o[a-1].type==="text_special"&&(u=u.slice(1));for(let m=0;m<u.length;m++){const f=u[m].url,y=e.md.normalizeLink(f);if(!e.md.validateLink(y))continue;let p=u[m].text;u[m].schema?u[m].schema==="mailto:"&&!/^mailto:/i.test(p)?p=e.md.normalizeLinkText("mailto:"+p).replace(/^mailto:/,""):p=e.md.normalizeLinkText(p):p=e.md.normalizeLinkText("http://"+p).replace(/^http:\/\//,"");const v=u[m].index;if(v>d){const C=new e.Token("text","",0);C.content=l.slice(d,v),C.level=h,c.push(C)}const g=new e.Token("link_open","a",1);g.attrs=[["href",y]],g.level=h++,g.markup="linkify",g.info="auto",c.push(g);const _=new e.Token("text","",0);_.content=p,_.level=h,c.push(_);const b=new e.Token("link_close","a",-1);b.level=--h,b.markup="linkify",b.info="auto",c.push(b),d=u[m].lastIndex}if(d<l.length){const m=new e.Token("text","",0);m.content=l.slice(d),m.level=h,c.push(m)}n[t].children=o=yh(o,a,c)}}}}const _h=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,nS=/\((c|tm|r)\)/i,rS=/\((c|tm|r)\)/ig,oS={c:"©",r:"®",tm:"™"};function iS(e,n){return oS[n.toLowerCase()]}function aS(e){let n=0;for(let t=e.length-1;t>=0;t--){const r=e[t];r.type==="text"&&!n&&(r.content=r.content.replace(rS,iS)),r.type==="link_open"&&r.info==="auto"&&n--,r.type==="link_close"&&r.info==="auto"&&n++}}function sS(e){let n=0;for(let t=e.length-1;t>=0;t--){const r=e[t];r.type==="text"&&!n&&_h.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&n--,r.type==="link_close"&&r.info==="auto"&&n++}}function lS(e){let n;if(e.md.options.typographer)for(n=e.tokens.length-1;n>=0;n--)e.tokens[n].type==="inline"&&(nS.test(e.tokens[n].content)&&aS(e.tokens[n].children),_h.test(e.tokens[n].content)&&sS(e.tokens[n].children))}const uS=/['"]/,xh=/['"]/g,Ch="’";function Ss(e,n,t){return e.slice(0,n)+t+e.slice(n+1)}function cS(e,n){let t;const r=[];for(let o=0;o<e.length;o++){const i=e[o],a=e[o].level;for(t=r.length-1;t>=0&&!(r[t].level<=a);t--);if(r.length=t+1,i.type!=="text")continue;let s=i.content,l=0,u=s.length;e:for(;l<u;){xh.lastIndex=l;const c=xh.exec(s);if(!c)break;let h=!0,d=!0;l=c.index+1;const m=c[0]==="'";let f=32;if(c.index-1>=0)f=s.charCodeAt(c.index-1);else for(t=o-1;t>=0&&!(e[t].type==="softbreak"||e[t].type==="hardbreak");t--)if(e[t].content){f=e[t].content.charCodeAt(e[t].content.length-1);break}let y=32;if(l<u)y=s.charCodeAt(l);else for(t=o+1;t<e.length&&!(e[t].type==="softbreak"||e[t].type==="hardbreak");t++)if(e[t].content){y=e[t].content.charCodeAt(0);break}const p=Vi(f)||Hi(String.fromCharCode(f)),v=Vi(y)||Hi(String.fromCharCode(y)),g=ji(f),_=ji(y);if(_?h=!1:v&&(g||p||(h=!1)),g?d=!1:p&&(_||v||(d=!1)),y===34&&c[0]==='"'&&f>=48&&f<=57&&(d=h=!1),h&&d&&(h=p,d=v),!h&&!d){m&&(i.content=Ss(i.content,c.index,Ch));continue}if(d)for(t=r.length-1;t>=0;t--){let b=r[t];if(r[t].level<a)break;if(b.single===m&&r[t].level===a){b=r[t];let C,A;m?(C=n.md.options.quotes[2],A=n.md.options.quotes[3]):(C=n.md.options.quotes[0],A=n.md.options.quotes[1]),i.content=Ss(i.content,c.index,A),e[b.token].content=Ss(e[b.token].content,b.pos,C),l+=A.length-1,b.token===o&&(l+=C.length-1),s=i.content,u=s.length,r.length=t;continue e}}h?r.push({token:o,pos:c.index,single:m,level:a}):d&&m&&(i.content=Ss(i.content,c.index,Ch))}}}function dS(e){if(e.md.options.typographer)for(let n=e.tokens.length-1;n>=0;n--)e.tokens[n].type!=="inline"||!uS.test(e.tokens[n].content)||cS(e.tokens[n].children,e)}function fS(e){let n,t;const r=e.tokens,o=r.length;for(let i=0;i<o;i++){if(r[i].type!=="inline")continue;const a=r[i].children,s=a.length;for(n=0;n<s;n++)a[n].type==="text_special"&&(a[n].type="text");for(n=t=0;n<s;n++)a[n].type==="text"&&n+1<s&&a[n+1].type==="text"?a[n+1].content=a[n].content+a[n+1].content:(n!==t&&(a[t]=a[n]),t++);n!==t&&(a.length=t)}}const wc=[["normalize",QI],["block",ZI],["inline",JI],["linkify",tS],["replacements",lS],["smartquotes",dS],["text_join",fS]];function Ic(){this.ruler=new vn;for(let e=0;e<wc.length;e++)this.ruler.push(wc[e][0],wc[e][1])}Ic.prototype.process=function(e){const n=this.ruler.getRules("");for(let t=0,r=n.length;t<r;t++)n[t](e)},Ic.prototype.State=bh;function cr(e,n,t,r){this.src=e,this.md=n,this.env=t,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const o=this.src;for(let i=0,a=0,s=0,l=0,u=o.length,c=!1;a<u;a++){const h=o.charCodeAt(a);if(!c)if(mt(h)){s++,h===9?l+=4-l%4:l++;continue}else c=!0;(h===10||a===u-1)&&(h!==10&&a++,this.bMarks.push(i),this.eMarks.push(a),this.tShift.push(s),this.sCount.push(l),this.bsCount.push(0),c=!1,s=0,l=0,i=a+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}cr.prototype.push=function(e,n,t){const r=new Xn(e,n,t);return r.block=!0,t<0&&this.level--,r.level=this.level,t>0&&this.level++,this.tokens.push(r),r},cr.prototype.isEmpty=function(n){return this.bMarks[n]+this.tShift[n]>=this.eMarks[n]},cr.prototype.skipEmptyLines=function(n){for(let t=this.lineMax;n<t&&!(this.bMarks[n]+this.tShift[n]<this.eMarks[n]);n++);return n},cr.prototype.skipSpaces=function(n){for(let t=this.src.length;n<t;n++){const r=this.src.charCodeAt(n);if(!mt(r))break}return n},cr.prototype.skipSpacesBack=function(n,t){if(n<=t)return n;for(;n>t;)if(!mt(this.src.charCodeAt(--n)))return n+1;return n},cr.prototype.skipChars=function(n,t){for(let r=this.src.length;n<r&&this.src.charCodeAt(n)===t;n++);return n},cr.prototype.skipCharsBack=function(n,t,r){if(n<=r)return n;for(;n>r;)if(t!==this.src.charCodeAt(--n))return n+1;return n},cr.prototype.getLines=function(n,t,r,o){if(n>=t)return"";const i=new Array(t-n);for(let a=0,s=n;s<t;s++,a++){let l=0;const u=this.bMarks[s];let c=u,h;for(s+1<t||o?h=this.eMarks[s]+1:h=this.eMarks[s];c<h&&l<r;){const d=this.src.charCodeAt(c);if(mt(d))d===9?l+=4-(l+this.bsCount[s])%4:l++;else if(c-u<this.tShift[s])l++;else break;c++}l>r?i[a]=new Array(l-r+1).join(" ")+this.src.slice(c,h):i[a]=this.src.slice(c,h)}return i.join("")},cr.prototype.Token=Xn;const hS=65536;function Sc(e,n){const t=e.bMarks[n]+e.tShift[n],r=e.eMarks[n];return e.src.slice(t,r)}function Eh(e){const n=[],t=e.length;let r=0,o=e.charCodeAt(r),i=!1,a=0,s="";for(;r<t;)o===124&&(i?(s+=e.substring(a,r-1),a=r):(n.push(s+e.substring(a,r)),s="",a=r+1)),i=o===92,r++,o=e.charCodeAt(r);return n.push(s+e.substring(a)),n}function pS(e,n,t,r){if(n+2>t)return!1;let o=n+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let i=e.bMarks[o]+e.tShift[o];if(i>=e.eMarks[o])return!1;const a=e.src.charCodeAt(i++);if(a!==124&&a!==45&&a!==58||i>=e.eMarks[o])return!1;const s=e.src.charCodeAt(i++);if(s!==124&&s!==45&&s!==58&&!mt(s)||a===45&&mt(s))return!1;for(;i<e.eMarks[o];){const b=e.src.charCodeAt(i);if(b!==124&&b!==45&&b!==58&&!mt(b))return!1;i++}let l=Sc(e,n+1),u=l.split("|");const c=[];for(let b=0;b<u.length;b++){const C=u[b].trim();if(!C){if(b===0||b===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(C))return!1;C.charCodeAt(C.length-1)===58?c.push(C.charCodeAt(0)===58?"center":"right"):C.charCodeAt(0)===58?c.push("left"):c.push("")}if(l=Sc(e,n).trim(),l.indexOf("|")===-1||e.sCount[n]-e.blkIndent>=4)return!1;u=Eh(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const h=u.length;if(h===0||h!==c.length)return!1;if(r)return!0;const d=e.parentType;e.parentType="table";const m=e.md.block.ruler.getRules("blockquote"),f=e.push("table_open","table",1),y=[n,0];f.map=y;const p=e.push("thead_open","thead",1);p.map=[n,n+1];const v=e.push("tr_open","tr",1);v.map=[n,n+1];for(let b=0;b<u.length;b++){const C=e.push("th_open","th",1);c[b]&&(C.attrs=[["style","text-align:"+c[b]]]);const A=e.push("inline","",0);A.content=u[b].trim(),A.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g,_=0;for(o=n+2;o<t&&!(e.sCount[o]<e.blkIndent);o++){let b=!1;for(let A=0,E=m.length;A<E;A++)if(m[A](e,o,t,!0)){b=!0;break}if(b||(l=Sc(e,o).trim(),!l)||e.sCount[o]-e.blkIndent>=4||(u=Eh(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),_+=h-u.length,_>hS))break;if(o===n+2){const A=e.push("tbody_open","tbody",1);A.map=g=[n+2,0]}const C=e.push("tr_open","tr",1);C.map=[o,o+1];for(let A=0;A<h;A++){const E=e.push("td_open","td",1);c[A]&&(E.attrs=[["style","text-align:"+c[A]]]);const S=e.push("inline","",0);S.content=u[A]?u[A].trim():"",S.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return g&&(e.push("tbody_close","tbody",-1),g[1]=o),e.push("table_close","table",-1),y[1]=o,e.parentType=d,e.line=o,!0}function mS(e,n,t){if(e.sCount[n]-e.blkIndent<4)return!1;let r=n+1,o=r;for(;r<t;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,o=r;continue}break}e.line=o;const i=e.push("code_block","code",0);return i.content=e.getLines(n,o,4+e.blkIndent,!1)+`
183
183
  `,i.map=[n,e.line],!0}function gS(e,n,t,r){let o=e.bMarks[n]+e.tShift[n],i=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||o+3>i)return!1;const a=e.src.charCodeAt(o);if(a!==126&&a!==96)return!1;let s=o;o=e.skipChars(o,a);let l=o-s;if(l<3)return!1;const u=e.src.slice(s,o),c=e.src.slice(o,i);if(a===96&&c.indexOf(String.fromCharCode(a))>=0)return!1;if(r)return!0;let h=n,d=!1;for(;h++,!(h>=t||(o=s=e.bMarks[h]+e.tShift[h],i=e.eMarks[h],o<i&&e.sCount[h]<e.blkIndent));)if(e.src.charCodeAt(o)===a&&!(e.sCount[h]-e.blkIndent>=4)&&(o=e.skipChars(o,a),!(o-s<l)&&(o=e.skipSpaces(o),!(o<i)))){d=!0;break}l=e.sCount[n],e.line=h+(d?1:0);const m=e.push("fence","code",0);return m.info=c,m.content=e.getLines(n+1,h,l,!0),m.markup=u,m.map=[n,e.line],!0}function yS(e,n,t,r){let o=e.bMarks[n]+e.tShift[n],i=e.eMarks[n];const a=e.lineMax;if(e.sCount[n]-e.blkIndent>=4||e.src.charCodeAt(o)!==62)return!1;if(r)return!0;const s=[],l=[],u=[],c=[],h=e.md.block.ruler.getRules("blockquote"),d=e.parentType;e.parentType="blockquote";let m=!1,f;for(f=n;f<t;f++){const _=e.sCount[f]<e.blkIndent;if(o=e.bMarks[f]+e.tShift[f],i=e.eMarks[f],o>=i)break;if(e.src.charCodeAt(o++)===62&&!_){let C=e.sCount[f]+1,A,E;e.src.charCodeAt(o)===32?(o++,C++,E=!1,A=!0):e.src.charCodeAt(o)===9?(A=!0,(e.bsCount[f]+C)%4===3?(o++,C++,E=!1):E=!0):A=!1;let S=C;for(s.push(e.bMarks[f]),e.bMarks[f]=o;o<i;){const D=e.src.charCodeAt(o);if(mt(D))D===9?S+=4-(S+e.bsCount[f]+(E?1:0))%4:S++;else break;o++}m=o>=i,l.push(e.bsCount[f]),e.bsCount[f]=e.sCount[f]+1+(A?1:0),u.push(e.sCount[f]),e.sCount[f]=S-C,c.push(e.tShift[f]),e.tShift[f]=o-e.bMarks[f];continue}if(m)break;let b=!1;for(let C=0,A=h.length;C<A;C++)if(h[C](e,f,t,!0)){b=!0;break}if(b){e.lineMax=f,e.blkIndent!==0&&(s.push(e.bMarks[f]),l.push(e.bsCount[f]),c.push(e.tShift[f]),u.push(e.sCount[f]),e.sCount[f]-=e.blkIndent);break}s.push(e.bMarks[f]),l.push(e.bsCount[f]),c.push(e.tShift[f]),u.push(e.sCount[f]),e.sCount[f]=-1}const y=e.blkIndent;e.blkIndent=0;const p=e.push("blockquote_open","blockquote",1);p.markup=">";const v=[n,0];p.map=v,e.md.block.tokenize(e,n,f);const g=e.push("blockquote_close","blockquote",-1);g.markup=">",e.lineMax=a,e.parentType=d,v[1]=e.line;for(let _=0;_<c.length;_++)e.bMarks[_+n]=s[_],e.tShift[_+n]=c[_],e.sCount[_+n]=u[_],e.bsCount[_+n]=l[_];return e.blkIndent=y,!0}function vS(e,n,t,r){const o=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4)return!1;let i=e.bMarks[n]+e.tShift[n];const a=e.src.charCodeAt(i++);if(a!==42&&a!==45&&a!==95)return!1;let s=1;for(;i<o;){const u=e.src.charCodeAt(i++);if(u!==a&&!mt(u))return!1;u===a&&s++}if(s<3)return!1;if(r)return!0;e.line=n+1;const l=e.push("hr","hr",0);return l.map=[n,e.line],l.markup=Array(s+1).join(String.fromCharCode(a)),!0}function kh(e,n){const t=e.eMarks[n];let r=e.bMarks[n]+e.tShift[n];const o=e.src.charCodeAt(r++);if(o!==42&&o!==45&&o!==43)return-1;if(r<t){const i=e.src.charCodeAt(r);if(!mt(i))return-1}return r}function Ah(e,n){const t=e.bMarks[n]+e.tShift[n],r=e.eMarks[n];let o=t;if(o+1>=r)return-1;let i=e.src.charCodeAt(o++);if(i<48||i>57)return-1;for(;;){if(o>=r)return-1;if(i=e.src.charCodeAt(o++),i>=48&&i<=57){if(o-t>=10)return-1;continue}if(i===41||i===46)break;return-1}return o<r&&(i=e.src.charCodeAt(o),!mt(i))?-1:o}function bS(e,n){const t=e.level+2;for(let r=n+2,o=e.tokens.length-2;r<o;r++)e.tokens[r].level===t&&e.tokens[r].type==="paragraph_open"&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function _S(e,n,t,r){let o,i,a,s,l=n,u=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;r&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let h,d,m;if((m=Ah(e,l))>=0){if(h=!0,a=e.bMarks[l]+e.tShift[l],d=Number(e.src.slice(a,m-1)),c&&d!==1)return!1}else if((m=kh(e,l))>=0)h=!1;else return!1;if(c&&e.skipSpaces(m)>=e.eMarks[l])return!1;if(r)return!0;const f=e.src.charCodeAt(m-1),y=e.tokens.length;h?(s=e.push("ordered_list_open","ol",1),d!==1&&(s.attrs=[["start",d]])):s=e.push("bullet_list_open","ul",1);const p=[l,0];s.map=p,s.markup=String.fromCharCode(f);let v=!1;const g=e.md.block.ruler.getRules("list"),_=e.parentType;for(e.parentType="list";l<t;){i=m,o=e.eMarks[l];const b=e.sCount[l]+m-(e.bMarks[l]+e.tShift[l]);let C=b;for(;i<o;){const X=e.src.charCodeAt(i);if(X===9)C+=4-(C+e.bsCount[l])%4;else if(X===32)C++;else break;i++}const A=i;let E;A>=o?E=1:E=C-b,E>4&&(E=1);const S=b+E;s=e.push("list_item_open","li",1),s.markup=String.fromCharCode(f);const D=[l,0];s.map=D,h&&(s.info=e.src.slice(a,m-1));const I=e.tight,k=e.tShift[l],w=e.sCount[l],T=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=S,e.tight=!0,e.tShift[l]=A-e.bMarks[l],e.sCount[l]=C,A>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,t):e.md.block.tokenize(e,l,t,!0),(!e.tight||v)&&(u=!1),v=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=T,e.tShift[l]=k,e.sCount[l]=w,e.tight=I,s=e.push("list_item_close","li",-1),s.markup=String.fromCharCode(f),l=e.line,D[1]=l,l>=t||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let P=!1;for(let X=0,$=g.length;X<$;X++)if(g[X](e,l,t,!0)){P=!0;break}if(P)break;if(h){if(m=Ah(e,l),m<0)break;a=e.bMarks[l]+e.tShift[l]}else if(m=kh(e,l),m<0)break;if(f!==e.src.charCodeAt(m-1))break}return h?s=e.push("ordered_list_close","ol",-1):s=e.push("bullet_list_close","ul",-1),s.markup=String.fromCharCode(f),p[1]=l,e.line=l,e.parentType=_,u&&bS(e,y),!0}function xS(e,n,t,r){let o=e.bMarks[n]+e.tShift[n],i=e.eMarks[n],a=n+1;if(e.sCount[n]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function s(g){const _=e.lineMax;if(g>=_||e.isEmpty(g))return null;let b=!1;if(e.sCount[g]-e.blkIndent>3&&(b=!0),e.sCount[g]<0&&(b=!0),!b){const E=e.md.block.ruler.getRules("reference"),S=e.parentType;e.parentType="reference";let D=!1;for(let I=0,k=E.length;I<k;I++)if(E[I](e,g,_,!0)){D=!0;break}if(e.parentType=S,D)return null}const C=e.bMarks[g]+e.tShift[g],A=e.eMarks[g];return e.src.slice(C,A+1)}let l=e.src.slice(o,i+1);i=l.length;let u=-1;for(o=1;o<i;o++){const g=l.charCodeAt(o);if(g===91)return!1;if(g===93){u=o;break}else if(g===10){const _=s(a);_!==null&&(l+=_,i=l.length,a++)}else if(g===92&&(o++,o<i&&l.charCodeAt(o)===10)){const _=s(a);_!==null&&(l+=_,i=l.length,a++)}}if(u<0||l.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<i;o++){const g=l.charCodeAt(o);if(g===10){const _=s(a);_!==null&&(l+=_,i=l.length,a++)}else if(!mt(g))break}const c=e.md.helpers.parseLinkDestination(l,o,i);if(!c.ok)return!1;const h=e.md.normalizeLink(c.str);if(!e.md.validateLink(h))return!1;o=c.pos;const d=o,m=a,f=o;for(;o<i;o++){const g=l.charCodeAt(o);if(g===10){const _=s(a);_!==null&&(l+=_,i=l.length,a++)}else if(!mt(g))break}let y=e.md.helpers.parseLinkTitle(l,o,i);for(;y.can_continue;){const g=s(a);if(g===null)break;l+=g,o=i,i=l.length,a++,y=e.md.helpers.parseLinkTitle(l,o,i,y)}let p;for(o<i&&f!==o&&y.ok?(p=y.str,o=y.pos):(p="",o=d,a=m);o<i;){const g=l.charCodeAt(o);if(!mt(g))break;o++}if(o<i&&l.charCodeAt(o)!==10&&p)for(p="",o=d,a=m;o<i;){const g=l.charCodeAt(o);if(!mt(g))break;o++}if(o<i&&l.charCodeAt(o)!==10)return!1;const v=Is(l.slice(1,u));return v?(r||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:p,href:h}),e.line=a),!0):!1}const CS=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ES="[a-zA-Z_:][a-zA-Z0-9:._-]*",kS="(?:"+"[^\"'=<>`\\x00-\\x20]+"+"|"+"'[^']*'"+"|"+'"[^"]*"'+")",wh="<[A-Za-z][A-Za-z0-9\\-]*"+("(?:\\s+"+ES+"(?:\\s*=\\s*"+kS+")?)")+"*\\s*\\/?>",Ih="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",AS="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",wS="<[?][\\s\\S]*?[?]>",IS="<![A-Za-z][^>]*>",SS="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",OS=new RegExp("^(?:"+wh+"|"+Ih+"|"+AS+"|"+wS+"|"+IS+"|"+SS+")"),TS=new RegExp("^(?:"+wh+"|"+Ih+")"),Go=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+CS.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(TS.source+"\\s*$"),/^$/,!1]];function DS(e,n,t,r){let o=e.bMarks[n]+e.tShift[n],i=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let a=e.src.slice(o,i),s=0;for(;s<Go.length&&!Go[s][0].test(a);s++);if(s===Go.length)return!1;if(r)return Go[s][2];let l=n+1;if(!Go[s][1].test(a)){for(;l<t&&!(e.sCount[l]<e.blkIndent);l++)if(o=e.bMarks[l]+e.tShift[l],i=e.eMarks[l],a=e.src.slice(o,i),Go[s][1].test(a)){a.length!==0&&l++;break}}e.line=l;const u=e.push("html_block","",0);return u.map=[n,l],u.content=e.getLines(n,l,e.blkIndent,!0),!0}function RS(e,n,t,r){let o=e.bMarks[n]+e.tShift[n],i=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4)return!1;let a=e.src.charCodeAt(o);if(a!==35||o>=i)return!1;let s=1;for(a=e.src.charCodeAt(++o);a===35&&o<i&&s<=6;)s++,a=e.src.charCodeAt(++o);if(s>6||o<i&&!mt(a))return!1;if(r)return!0;i=e.skipSpacesBack(i,o);const l=e.skipCharsBack(i,35,o);l>o&&mt(e.src.charCodeAt(l-1))&&(i=l),e.line=n+1;const u=e.push("heading_open","h"+String(s),1);u.markup="########".slice(0,s),u.map=[n,e.line];const c=e.push("inline","",0);c.content=e.src.slice(o,i).trim(),c.map=[n,e.line],c.children=[];const h=e.push("heading_close","h"+String(s),-1);return h.markup="########".slice(0,s),!0}function MS(e,n,t){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[n]-e.blkIndent>=4)return!1;const o=e.parentType;e.parentType="paragraph";let i=0,a,s=n+1;for(;s<t&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let m=e.bMarks[s]+e.tShift[s];const f=e.eMarks[s];if(m<f&&(a=e.src.charCodeAt(m),(a===45||a===61)&&(m=e.skipChars(m,a),m=e.skipSpaces(m),m>=f))){i=a===61?1:2;break}}if(e.sCount[s]<0)continue;let d=!1;for(let m=0,f=r.length;m<f;m++)if(r[m](e,s,t,!0)){d=!0;break}if(d)break}if(!i)return!1;const l=e.getLines(n,s,e.blkIndent,!1).trim();e.line=s+1;const u=e.push("heading_open","h"+String(i),1);u.markup=String.fromCharCode(a),u.map=[n,e.line];const c=e.push("inline","",0);c.content=l,c.map=[n,e.line-1],c.children=[];const h=e.push("heading_close","h"+String(i),-1);return h.markup=String.fromCharCode(a),e.parentType=o,!0}function FS(e,n,t){const r=e.md.block.ruler.getRules("paragraph"),o=e.parentType;let i=n+1;for(e.parentType="paragraph";i<t&&!e.isEmpty(i);i++){if(e.sCount[i]-e.blkIndent>3||e.sCount[i]<0)continue;let u=!1;for(let c=0,h=r.length;c<h;c++)if(r[c](e,i,t,!0)){u=!0;break}if(u)break}const a=e.getLines(n,i,e.blkIndent,!1).trim();e.line=i;const s=e.push("paragraph_open","p",1);s.map=[n,e.line];const l=e.push("inline","",0);return l.content=a,l.map=[n,e.line],l.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}const Os=[["table",pS,["paragraph","reference"]],["code",mS],["fence",gS,["paragraph","reference","blockquote","list"]],["blockquote",yS,["paragraph","reference","blockquote","list"]],["hr",vS,["paragraph","reference","blockquote","list"]],["list",_S,["paragraph","reference","blockquote"]],["reference",xS],["html_block",DS,["paragraph","reference","blockquote"]],["heading",RS,["paragraph","reference","blockquote"]],["lheading",MS],["paragraph",FS]];function Ts(){this.ruler=new vn;for(let e=0;e<Os.length;e++)this.ruler.push(Os[e][0],Os[e][1],{alt:(Os[e][2]||[]).slice()})}Ts.prototype.tokenize=function(e,n,t){const r=this.ruler.getRules(""),o=r.length,i=e.md.options.maxNesting;let a=n,s=!1;for(;a<t&&(e.line=a=e.skipEmptyLines(a),!(a>=t||e.sCount[a]<e.blkIndent));){if(e.level>=i){e.line=t;break}const l=e.line;let u=!1;for(let c=0;c<o;c++)if(u=r[c](e,a,t,!1),u){if(l>=e.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),a=e.line,a<t&&e.isEmpty(a)&&(s=!0,a++,e.line=a)}},Ts.prototype.parse=function(e,n,t,r){if(!e)return;const o=new this.State(e,n,t,r);this.tokenize(o,o.line,o.lineMax)},Ts.prototype.State=cr;function zi(e,n,t,r){this.src=e,this.env=t,this.md=n,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}zi.prototype.pushPending=function(){const e=new Xn("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},zi.prototype.push=function(e,n,t){this.pending&&this.pushPending();const r=new Xn(e,n,t);let o=null;return t<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,t>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(o),r},zi.prototype.scanDelims=function(e,n){const t=this.posMax,r=this.src.charCodeAt(e),o=e>0?this.src.charCodeAt(e-1):32;let i=e;for(;i<t&&this.src.charCodeAt(i)===r;)i++;const a=i-e,s=i<t?this.src.charCodeAt(i):32,l=Vi(o)||Hi(String.fromCharCode(o)),u=Vi(s)||Hi(String.fromCharCode(s)),c=ji(o),h=ji(s),d=!h&&(!u||c||l),m=!c&&(!l||h||u);return{can_open:d&&(n||!m||l),can_close:m&&(n||!d||u),length:a}},zi.prototype.Token=Xn;function BS(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function NS(e,n){let t=e.pos;for(;t<e.posMax&&!BS(e.src.charCodeAt(t));)t++;return t===e.pos?!1:(n||(e.pending+=e.src.slice(e.pos,t)),e.pos=t,!0)}const LS=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function PS(e,n){if(!e.md.options.linkify||e.linkLevel>0)return!1;const t=e.pos,r=e.posMax;if(t+3>r||e.src.charCodeAt(t)!==58||e.src.charCodeAt(t+1)!==47||e.src.charCodeAt(t+2)!==47)return!1;const o=e.pending.match(LS);if(!o)return!1;const i=o[1],a=e.md.linkify.matchAtStart(e.src.slice(t-i.length));if(!a)return!1;let s=a.url;if(s.length<=i.length)return!1;s=s.replace(/\*+$/,"");const l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!n){e.pending=e.pending.slice(0,-i.length);const u=e.push("link_open","a",1);u.attrs=[["href",l]],u.markup="linkify",u.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(s);const h=e.push("link_close","a",-1);h.markup="linkify",h.info="auto"}return e.pos+=s.length-i.length,!0}function qS(e,n){let t=e.pos;if(e.src.charCodeAt(t)!==10)return!1;const r=e.pending.length-1,o=e.posMax;if(!n)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let i=r-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(t++;t<o&&mt(e.src.charCodeAt(t));)t++;return e.pos=t,!0}const Oc=[];for(let e=0;e<256;e++)Oc.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Oc[e.charCodeAt(0)]=1});function $S(e,n){let t=e.pos;const r=e.posMax;if(e.src.charCodeAt(t)!==92||(t++,t>=r))return!1;let o=e.src.charCodeAt(t);if(o===10){for(n||e.push("hardbreak","br",0),t++;t<r&&(o=e.src.charCodeAt(t),!!mt(o));)t++;return e.pos=t,!0}let i=e.src[t];if(o>=55296&&o<=56319&&t+1<r){const s=e.src.charCodeAt(t+1);s>=56320&&s<=57343&&(i+=e.src[t+1],t++)}const a="\\"+i;if(!n){const s=e.push("text_special","",0);o<256&&Oc[o]!==0?s.content=i:s.content=a,s.markup=a,s.info="escape"}return e.pos=t+1,!0}function US(e,n){let t=e.pos;if(e.src.charCodeAt(t)!==96)return!1;const o=t;t++;const i=e.posMax;for(;t<i&&e.src.charCodeAt(t)===96;)t++;const a=e.src.slice(o,t),s=a.length;if(e.backticksScanned&&(e.backticks[s]||0)<=o)return n||(e.pending+=a),e.pos+=s,!0;let l=t,u;for(;(u=e.src.indexOf("`",l))!==-1;){for(l=u+1;l<i&&e.src.charCodeAt(l)===96;)l++;const c=l-u;if(c===s){if(!n){const h=e.push("code_inline","code",0);h.markup=a,h.content=e.src.slice(t,u).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=l,!0}e.backticks[c]=u}return e.backticksScanned=!0,n||(e.pending+=a),e.pos+=s,!0}function jS(e,n){const t=e.pos,r=e.src.charCodeAt(t);if(n||r!==126)return!1;const o=e.scanDelims(e.pos,!0);let i=o.length;const a=String.fromCharCode(r);if(i<2)return!1;let s;i%2&&(s=e.push("text","",0),s.content=a,i--);for(let l=0;l<i;l+=2)s=e.push("text","",0),s.content=a+a,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function Sh(e,n){let t;const r=[],o=n.length;for(let i=0;i<o;i++){const a=n[i];if(a.marker!==126||a.end===-1)continue;const s=n[a.end];t=e.tokens[a.token],t.type="s_open",t.tag="s",t.nesting=1,t.markup="~~",t.content="",t=e.tokens[s.token],t.type="s_close",t.tag="s",t.nesting=-1,t.markup="~~",t.content="",e.tokens[s.token-1].type==="text"&&e.tokens[s.token-1].content==="~"&&r.push(s.token-1)}for(;r.length;){const i=r.pop();let a=i+1;for(;a<e.tokens.length&&e.tokens[a].type==="s_close";)a++;a--,i!==a&&(t=e.tokens[a],e.tokens[a]=e.tokens[i],e.tokens[i]=t)}}function HS(e){const n=e.tokens_meta,t=e.tokens_meta.length;Sh(e,e.delimiters);for(let r=0;r<t;r++)n[r]&&n[r].delimiters&&Sh(e,n[r].delimiters)}const Oh={tokenize:jS,postProcess:HS};function VS(e,n){const t=e.pos,r=e.src.charCodeAt(t);if(n||r!==95&&r!==42)return!1;const o=e.scanDelims(e.pos,r===42);for(let i=0;i<o.length;i++){const a=e.push("text","",0);a.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function Th(e,n){const t=n.length;for(let r=t-1;r>=0;r--){const o=n[r];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const i=n[o.end],a=r>0&&n[r-1].end===o.end+1&&n[r-1].marker===o.marker&&n[r-1].token===o.token-1&&n[o.end+1].token===i.token+1,s=String.fromCharCode(o.marker),l=e.tokens[o.token];l.type=a?"strong_open":"em_open",l.tag=a?"strong":"em",l.nesting=1,l.markup=a?s+s:s,l.content="";const u=e.tokens[i.token];u.type=a?"strong_close":"em_close",u.tag=a?"strong":"em",u.nesting=-1,u.markup=a?s+s:s,u.content="",a&&(e.tokens[n[r-1].token].content="",e.tokens[n[o.end+1].token].content="",r--)}}function zS(e){const n=e.tokens_meta,t=e.tokens_meta.length;Th(e,e.delimiters);for(let r=0;r<t;r++)n[r]&&n[r].delimiters&&Th(e,n[r].delimiters)}const Dh={tokenize:VS,postProcess:zS};function KS(e,n){let t,r,o,i,a="",s="",l=e.pos,u=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const c=e.pos,h=e.posMax,d=e.pos+1,m=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(m<0)return!1;let f=m+1;if(f<h&&e.src.charCodeAt(f)===40){for(u=!1,f++;f<h&&(t=e.src.charCodeAt(f),!(!mt(t)&&t!==10));f++);if(f>=h)return!1;if(l=f,o=e.md.helpers.parseLinkDestination(e.src,f,e.posMax),o.ok){for(a=e.md.normalizeLink(o.str),e.md.validateLink(a)?f=o.pos:a="",l=f;f<h&&(t=e.src.charCodeAt(f),!(!mt(t)&&t!==10));f++);if(o=e.md.helpers.parseLinkTitle(e.src,f,e.posMax),f<h&&l!==f&&o.ok)for(s=o.str,f=o.pos;f<h&&(t=e.src.charCodeAt(f),!(!mt(t)&&t!==10));f++);}(f>=h||e.src.charCodeAt(f)!==41)&&(u=!0),f++}if(u){if(typeof e.env.references>"u")return!1;if(f<h&&e.src.charCodeAt(f)===91?(l=f+1,f=e.md.helpers.parseLinkLabel(e,f),f>=0?r=e.src.slice(l,f++):f=m+1):f=m+1,r||(r=e.src.slice(d,m)),i=e.env.references[Is(r)],!i)return e.pos=c,!1;a=i.href,s=i.title}if(!n){e.pos=d,e.posMax=m;const y=e.push("link_open","a",1),p=[["href",a]];y.attrs=p,s&&p.push(["title",s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=f,e.posMax=h,!0}function GS(e,n){let t,r,o,i,a,s,l,u,c="";const h=e.pos,d=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const m=e.pos+2,f=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(f<0)return!1;if(i=f+1,i<d&&e.src.charCodeAt(i)===40){for(i++;i<d&&(t=e.src.charCodeAt(i),!(!mt(t)&&t!==10));i++);if(i>=d)return!1;for(u=i,s=e.md.helpers.parseLinkDestination(e.src,i,e.posMax),s.ok&&(c=e.md.normalizeLink(s.str),e.md.validateLink(c)?i=s.pos:c=""),u=i;i<d&&(t=e.src.charCodeAt(i),!(!mt(t)&&t!==10));i++);if(s=e.md.helpers.parseLinkTitle(e.src,i,e.posMax),i<d&&u!==i&&s.ok)for(l=s.str,i=s.pos;i<d&&(t=e.src.charCodeAt(i),!(!mt(t)&&t!==10));i++);else l="";if(i>=d||e.src.charCodeAt(i)!==41)return e.pos=h,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<d&&e.src.charCodeAt(i)===91?(u=i+1,i=e.md.helpers.parseLinkLabel(e,i),i>=0?o=e.src.slice(u,i++):i=f+1):i=f+1,o||(o=e.src.slice(m,f)),a=e.env.references[Is(o)],!a)return e.pos=h,!1;c=a.href,l=a.title}if(!n){r=e.src.slice(m,f);const y=[];e.md.inline.parse(r,e.md,e.env,y);const p=e.push("image","img",0),v=[["src",c],["alt",""]];p.attrs=v,p.children=y,p.content=r,l&&v.push(["title",l])}return e.pos=i,e.posMax=d,!0}const XS=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,WS=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function QS(e,n){let t=e.pos;if(e.src.charCodeAt(t)!==60)return!1;const r=e.pos,o=e.posMax;for(;;){if(++t>=o)return!1;const a=e.src.charCodeAt(t);if(a===60)return!1;if(a===62)break}const i=e.src.slice(r+1,t);if(WS.test(i)){const a=e.md.normalizeLink(i);if(!e.md.validateLink(a))return!1;if(!n){const s=e.push("link_open","a",1);s.attrs=[["href",a]],s.markup="autolink",s.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(i);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=i.length+2,!0}if(XS.test(i)){const a=e.md.normalizeLink("mailto:"+i);if(!e.md.validateLink(a))return!1;if(!n){const s=e.push("link_open","a",1);s.attrs=[["href",a]],s.markup="autolink",s.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(i);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=i.length+2,!0}return!1}function ZS(e){return/^<a[>\s]/i.test(e)}function JS(e){return/^<\/a\s*>/i.test(e)}function YS(e){const n=e|32;return n>=97&&n<=122}function eO(e,n){if(!e.md.options.html)return!1;const t=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=t)return!1;const o=e.src.charCodeAt(r+1);if(o!==33&&o!==63&&o!==47&&!YS(o))return!1;const i=e.src.slice(r).match(OS);if(!i)return!1;if(!n){const a=e.push("html_inline","",0);a.content=i[0],ZS(a.content)&&e.linkLevel++,JS(a.content)&&e.linkLevel--}return e.pos+=i[0].length,!0}const tO=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,nO=/^&([a-z][a-z0-9]{1,31});/i;function rO(e,n){const t=e.pos,r=e.posMax;if(e.src.charCodeAt(t)!==38||t+1>=r)return!1;if(e.src.charCodeAt(t+1)===35){const i=e.src.slice(t).match(tO);if(i){if(!n){const a=i[1][0].toLowerCase()==="x"?parseInt(i[1].slice(1),16):parseInt(i[1],10),s=e.push("text_special","",0);s.content=Ac(a)?ws(a):ws(65533),s.markup=i[0],s.info="entity"}return e.pos+=i[0].length,!0}}else{const i=e.src.slice(t).match(nO);if(i){const a=gh(i[0]);if(a!==i[0]){if(!n){const s=e.push("text_special","",0);s.content=a,s.markup=i[0],s.info="entity"}return e.pos+=i[0].length,!0}}}return!1}function Rh(e){const n={},t=e.length;if(!t)return;let r=0,o=-2;const i=[];for(let a=0;a<t;a++){const s=e[a];if(i.push(0),(e[r].marker!==s.marker||o!==s.token-1)&&(r=a),o=s.token,s.length=s.length||0,!s.close)continue;n.hasOwnProperty(s.marker)||(n[s.marker]=[-1,-1,-1,-1,-1,-1]);const l=n[s.marker][(s.open?3:0)+s.length%3];let u=r-i[r]-1,c=u;for(;u>l;u-=i[u]+1){const h=e[u];if(h.marker===s.marker&&h.open&&h.end<0){let d=!1;if((h.close||s.open)&&(h.length+s.length)%3===0&&(h.length%3!==0||s.length%3!==0)&&(d=!0),!d){const m=u>0&&!e[u-1].open?i[u-1]+1:0;i[a]=a-u+m,i[u]=m,s.open=!1,h.end=a,h.close=!1,c=-1,o=-2;break}}}c!==-1&&(n[s.marker][(s.open?3:0)+(s.length||0)%3]=c)}}function oO(e){const n=e.tokens_meta,t=e.tokens_meta.length;Rh(e.delimiters);for(let r=0;r<t;r++)n[r]&&n[r].delimiters&&Rh(n[r].delimiters)}function iO(e){let n,t,r=0;const o=e.tokens,i=e.tokens.length;for(n=t=0;n<i;n++)o[n].nesting<0&&r--,o[n].level=r,o[n].nesting>0&&r++,o[n].type==="text"&&n+1<i&&o[n+1].type==="text"?o[n+1].content=o[n].content+o[n+1].content:(n!==t&&(o[t]=o[n]),t++);n!==t&&(o.length=t)}const Tc=[["text",NS],["linkify",PS],["newline",qS],["escape",$S],["backticks",US],["strikethrough",Oh.tokenize],["emphasis",Dh.tokenize],["link",KS],["image",GS],["autolink",QS],["html_inline",eO],["entity",rO]],Dc=[["balance_pairs",oO],["strikethrough",Oh.postProcess],["emphasis",Dh.postProcess],["fragments_join",iO]];function Ki(){this.ruler=new vn;for(let e=0;e<Tc.length;e++)this.ruler.push(Tc[e][0],Tc[e][1]);this.ruler2=new vn;for(let e=0;e<Dc.length;e++)this.ruler2.push(Dc[e][0],Dc[e][1])}Ki.prototype.skipToken=function(e){const n=e.pos,t=this.ruler.getRules(""),r=t.length,o=e.md.options.maxNesting,i=e.cache;if(typeof i[n]<"u"){e.pos=i[n];return}let a=!1;if(e.level<o){for(let s=0;s<r;s++)if(e.level++,a=t[s](e,!0),e.level--,a){if(n>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;a||e.pos++,i[n]=e.pos},Ki.prototype.tokenize=function(e){const n=this.ruler.getRules(""),t=n.length,r=e.posMax,o=e.md.options.maxNesting;for(;e.pos<r;){const i=e.pos;let a=!1;if(e.level<o){for(let s=0;s<t;s++)if(a=n[s](e,!1),a){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(a){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Ki.prototype.parse=function(e,n,t,r){const o=new this.State(e,n,t,r);this.tokenize(o);const i=this.ruler2.getRules(""),a=i.length;for(let s=0;s<a;s++)i[s](o)},Ki.prototype.State=zi;function aO(e){const n={};e=e||{},n.src_Any=dh.source,n.src_Cc=fh.source,n.src_Z=ph.source,n.src_P=xc.source,n.src_ZPCc=[n.src_Z,n.src_P,n.src_Cc].join("|"),n.src_ZCc=[n.src_Z,n.src_Cc].join("|");const t="[><|]";return n.src_pseudo_letter="(?:(?!"+t+"|"+n.src_ZPCc+")"+n.src_Any+")",n.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",n.src_auth="(?:(?:(?!"+n.src_ZCc+"|[@/\\[\\]()]).)+@)?",n.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",n.src_host_terminator="(?=$|"+t+"|"+n.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+n.src_ZPCc+"))",n.src_path="(?:[/?#](?:(?!"+n.src_ZCc+"|"+t+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+n.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+n.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+n.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+n.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+n.src_ZCc+"|[']).)+\\'|\\'(?="+n.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+n.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+n.src_ZCc+"|$)|;(?!"+n.src_ZCc+"|$)|\\!+(?!"+n.src_ZCc+"|[!]|$)|\\?(?!"+n.src_ZCc+"|[?]|$))+|\\/)?",n.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',n.src_xn="xn--[a-z0-9\\-]{1,59}",n.src_domain_root="(?:"+n.src_xn+"|"+n.src_pseudo_letter+"{1,63})",n.src_domain="(?:"+n.src_xn+"|(?:"+n.src_pseudo_letter+")|(?:"+n.src_pseudo_letter+"(?:-|"+n.src_pseudo_letter+"){0,61}"+n.src_pseudo_letter+"))",n.src_host="(?:(?:(?:(?:"+n.src_domain+")\\.)*"+n.src_domain+"))",n.tpl_host_fuzzy="(?:"+n.src_ip4+"|(?:(?:(?:"+n.src_domain+")\\.)+(?:%TLDS%)))",n.tpl_host_no_ip_fuzzy="(?:(?:(?:"+n.src_domain+")\\.)+(?:%TLDS%))",n.src_host_strict=n.src_host+n.src_host_terminator,n.tpl_host_fuzzy_strict=n.tpl_host_fuzzy+n.src_host_terminator,n.src_host_port_strict=n.src_host+n.src_port+n.src_host_terminator,n.tpl_host_port_fuzzy_strict=n.tpl_host_fuzzy+n.src_port+n.src_host_terminator,n.tpl_host_port_no_ip_fuzzy_strict=n.tpl_host_no_ip_fuzzy+n.src_port+n.src_host_terminator,n.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+n.src_ZPCc+"|>|$))",n.tpl_email_fuzzy="(^|"+t+'|"|\\(|'+n.src_ZCc+")("+n.src_email_name+"@"+n.tpl_host_fuzzy_strict+")",n.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+n.src_ZPCc+"))((?![$+<=>^`||])"+n.tpl_host_port_fuzzy_strict+n.src_path+")",n.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+n.src_ZPCc+"))((?![$+<=>^`||])"+n.tpl_host_port_no_ip_fuzzy_strict+n.src_path+")",n}function Rc(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(r){e[r]=t[r]})}),e}function Ds(e){return Object.prototype.toString.call(e)}function sO(e){return Ds(e)==="[object String]"}function lO(e){return Ds(e)==="[object Object]"}function uO(e){return Ds(e)==="[object RegExp]"}function Mh(e){return Ds(e)==="[object Function]"}function cO(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Fh={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function dO(e){return Object.keys(e||{}).reduce(function(n,t){return n||Fh.hasOwnProperty(t)},!1)}const fO={"http:":{validate:function(e,n,t){const r=e.slice(n);return t.re.http||(t.re.http=new RegExp("^\\/\\/"+t.re.src_auth+t.re.src_host_port_strict+t.re.src_path,"i")),t.re.http.test(r)?r.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,n,t){const r=e.slice(n);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+"(?:localhost|(?:(?:"+t.re.src_domain+")\\.)+"+t.re.src_domain_root+")"+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(r)?n>=3&&e[n-3]===":"||n>=3&&e[n-3]==="/"?0:r.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(e,n,t){const r=e.slice(n);return t.re.mailto||(t.re.mailto=new RegExp("^"+t.re.src_email_name+"@"+t.re.src_host_strict,"i")),t.re.mailto.test(r)?r.match(t.re.mailto)[0].length:0}}},hO="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",pO="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function mO(e){e.__index__=-1,e.__text_cache__=""}function gO(e){return function(n,t){const r=n.slice(t);return e.test(r)?r.match(e)[0].length:0}}function Bh(){return function(e,n){n.normalize(e)}}function Rs(e){const n=e.re=aO(e.__opts__),t=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||t.push(hO),t.push(n.src_xn),n.src_tlds=t.join("|");function r(s){return s.replace("%TLDS%",n.src_tlds)}n.email_fuzzy=RegExp(r(n.tpl_email_fuzzy),"i"),n.link_fuzzy=RegExp(r(n.tpl_link_fuzzy),"i"),n.link_no_ip_fuzzy=RegExp(r(n.tpl_link_no_ip_fuzzy),"i"),n.host_fuzzy_test=RegExp(r(n.tpl_host_fuzzy_test),"i");const o=[];e.__compiled__={};function i(s,l){throw new Error('(LinkifyIt) Invalid schema "'+s+'": '+l)}Object.keys(e.__schemas__).forEach(function(s){const l=e.__schemas__[s];if(l===null)return;const u={validate:null,link:null};if(e.__compiled__[s]=u,lO(l)){uO(l.validate)?u.validate=gO(l.validate):Mh(l.validate)?u.validate=l.validate:i(s,l),Mh(l.normalize)?u.normalize=l.normalize:l.normalize?i(s,l):u.normalize=Bh();return}if(sO(l)){o.push(s);return}i(s,l)}),o.forEach(function(s){e.__compiled__[e.__schemas__[s]]&&(e.__compiled__[s].validate=e.__compiled__[e.__schemas__[s]].validate,e.__compiled__[s].normalize=e.__compiled__[e.__schemas__[s]].normalize)}),e.__compiled__[""]={validate:null,normalize:Bh()};const a=Object.keys(e.__compiled__).filter(function(s){return s.length>0&&e.__compiled__[s]}).map(cO).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+n.src_ZPCc+"))("+a+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+n.src_ZPCc+"))("+a+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),mO(e)}function yO(e,n){const t=e.__index__,r=e.__last_index__,o=e.__text_cache__.slice(t,r);this.schema=e.__schema__.toLowerCase(),this.index=t+n,this.lastIndex=r+n,this.raw=o,this.text=o,this.url=o}function Mc(e,n){const t=new yO(e,n);return e.__compiled__[t.schema].normalize(t,e),t}function On(e,n){if(!(this instanceof On))return new On(e,n);n||dO(e)&&(n=e,e={}),this.__opts__=Rc({},Fh,n),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Rc({},fO,e),this.__compiled__={},this.__tlds__=pO,this.__tlds_replaced__=!1,this.re={},Rs(this)}On.prototype.add=function(n,t){return this.__schemas__[n]=t,Rs(this),this},On.prototype.set=function(n){return this.__opts__=Rc(this.__opts__,n),this},On.prototype.test=function(n){if(this.__text_cache__=n,this.__index__=-1,!n.length)return!1;let t,r,o,i,a,s,l,u,c;if(this.re.schema_test.test(n)){for(l=this.re.schema_search,l.lastIndex=0;(t=l.exec(n))!==null;)if(i=this.testSchemaAt(n,t[2],l.lastIndex),i){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=n.search(this.re.host_fuzzy_test),u>=0&&(this.__index__<0||u<this.__index__)&&(r=n.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(a=r.index+r[1].length,(this.__index__<0||a<this.__index__)&&(this.__schema__="",this.__index__=a,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(c=n.indexOf("@"),c>=0&&(o=n.match(this.re.email_fuzzy))!==null&&(a=o.index+o[1].length,s=o.index+o[0].length,(this.__index__<0||a<this.__index__||a===this.__index__&&s>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=a,this.__last_index__=s))),this.__index__>=0},On.prototype.pretest=function(n){return this.re.pretest.test(n)},On.prototype.testSchemaAt=function(n,t,r){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(n,r,this):0},On.prototype.match=function(n){const t=[];let r=0;this.__index__>=0&&this.__text_cache__===n&&(t.push(Mc(this,r)),r=this.__last_index__);let o=r?n.slice(r):n;for(;this.test(o);)t.push(Mc(this,r)),o=o.slice(this.__last_index__),r+=this.__last_index__;return t.length?t:null},On.prototype.matchAtStart=function(n){if(this.__text_cache__=n,this.__index__=-1,!n.length)return null;const t=this.re.schema_at_start.exec(n);if(!t)return null;const r=this.testSchemaAt(n,t[2],t[0].length);return r?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+r,Mc(this,0)):null},On.prototype.tlds=function(n,t){return n=Array.isArray(n)?n:[n],t?(this.__tlds__=this.__tlds__.concat(n).sort().filter(function(r,o,i){return r!==i[o-1]}).reverse(),Rs(this),this):(this.__tlds__=n.slice(),this.__tlds_replaced__=!0,Rs(this),this)},On.prototype.normalize=function(n){n.schema||(n.url="http://"+n.url),n.schema==="mailto:"&&!/^mailto:/i.test(n.url)&&(n.url="mailto:"+n.url)},On.prototype.onCompile=function(){};const Xo=2147483647,dr=36,Fc=1,Gi=26,vO=38,bO=700,Nh=72,Lh=128,Ph="-",_O=/^xn--/,xO=/[^\0-\x7F]/,CO=/[\x2E\u3002\uFF0E\uFF61]/g,EO={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Bc=dr-Fc,fr=Math.floor,Nc=String.fromCharCode;function Yr(e){throw new RangeError(EO[e])}function kO(e,n){const t=[];let r=e.length;for(;r--;)t[r]=n(e[r]);return t}function qh(e,n){const t=e.split("@");let r="";t.length>1&&(r=t[0]+"@",e=t[1]),e=e.replace(CO,".");const o=e.split("."),i=kO(o,n).join(".");return r+i}function $h(e){const n=[];let t=0;const r=e.length;for(;t<r;){const o=e.charCodeAt(t++);if(o>=55296&&o<=56319&&t<r){const i=e.charCodeAt(t++);(i&64512)==56320?n.push(((o&1023)<<10)+(i&1023)+65536):(n.push(o),t--)}else n.push(o)}return n}const AO=e=>String.fromCodePoint(...e),wO=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:dr},Uh=function(e,n){return e+22+75*(e<26)-((n!=0)<<5)},jh=function(e,n,t){let r=0;for(e=t?fr(e/bO):e>>1,e+=fr(e/n);e>Bc*Gi>>1;r+=dr)e=fr(e/Bc);return fr(r+(Bc+1)*e/(e+vO))},Hh=function(e){const n=[],t=e.length;let r=0,o=Lh,i=Nh,a=e.lastIndexOf(Ph);a<0&&(a=0);for(let s=0;s<a;++s)e.charCodeAt(s)>=128&&Yr("not-basic"),n.push(e.charCodeAt(s));for(let s=a>0?a+1:0;s<t;){const l=r;for(let c=1,h=dr;;h+=dr){s>=t&&Yr("invalid-input");const d=wO(e.charCodeAt(s++));d>=dr&&Yr("invalid-input"),d>fr((Xo-r)/c)&&Yr("overflow"),r+=d*c;const m=h<=i?Fc:h>=i+Gi?Gi:h-i;if(d<m)break;const f=dr-m;c>fr(Xo/f)&&Yr("overflow"),c*=f}const u=n.length+1;i=jh(r-l,u,l==0),fr(r/u)>Xo-o&&Yr("overflow"),o+=fr(r/u),r%=u,n.splice(r++,0,o)}return String.fromCodePoint(...n)},Vh=function(e){const n=[];e=$h(e);const t=e.length;let r=Lh,o=0,i=Nh;for(const l of e)l<128&&n.push(Nc(l));const a=n.length;let s=a;for(a&&n.push(Ph);s<t;){let l=Xo;for(const c of e)c>=r&&c<l&&(l=c);const u=s+1;l-r>fr((Xo-o)/u)&&Yr("overflow"),o+=(l-r)*u,r=l;for(const c of e)if(c<r&&++o>Xo&&Yr("overflow"),c===r){let h=o;for(let d=dr;;d+=dr){const m=d<=i?Fc:d>=i+Gi?Gi:d-i;if(h<m)break;const f=h-m,y=dr-m;n.push(Nc(Uh(m+f%y,0))),h=fr(f/y)}n.push(Nc(Uh(h,0))),i=jh(o,u,s===a),o=0,++s}++o,++r}return n.join("")},zh={version:"2.3.1",ucs2:{decode:$h,encode:AO},decode:Hh,encode:Vh,toASCII:function(e){return qh(e,function(n){return xO.test(n)?"xn--"+Vh(n):n})},toUnicode:function(e){return qh(e,function(n){return _O.test(n)?Hh(n.slice(4).toLowerCase()):n})}},IO={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},SO=/^(vbscript|javascript|file|data):/,OO=/^data:image\/(gif|png|jpeg|webp);/;function TO(e){const n=e.trim().toLowerCase();return SO.test(n)?OO.test(n):!0}const Kh=["http:","https:","mailto:"];function DO(e){const n=_c(e,!0);if(n.hostname&&(!n.protocol||Kh.indexOf(n.protocol)>=0))try{n.hostname=zh.toASCII(n.hostname)}catch{}return Ui(bc(n))}function RO(e){const n=_c(e,!0);if(n.hostname&&(!n.protocol||Kh.indexOf(n.protocol)>=0))try{n.hostname=zh.toUnicode(n.hostname)}catch{}return Vo(bc(n),Vo.defaultChars+"%")}function qn(e,n){if(!(this instanceof qn))return new qn(e,n);n||kc(e)||(n=e||{},e="default"),this.inline=new Ki,this.block=new Ts,this.core=new Ic,this.renderer=new Ko,this.linkify=new On,this.validateLink=TO,this.normalizeLink=DO,this.normalizeLinkText=RO,this.utils=HI,this.helpers=As({},GI),this.options={},this.configure(e),n&&this.set(n)}qn.prototype.set=function(e){return As(this.options,e),this},qn.prototype.configure=function(e){const n=this;if(kc(e)){const t=e;if(e=IO[t],!e)throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&n.set(e.options),e.components&&Object.keys(e.components).forEach(function(t){e.components[t].rules&&n[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&n[t].ruler2.enableOnly(e.components[t].rules2)}),this},qn.prototype.enable=function(e,n){let t=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(o){t=t.concat(this[o].ruler.enable(e,!0))},this),t=t.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(function(o){return t.indexOf(o)<0});if(r.length&&!n)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},qn.prototype.disable=function(e,n){let t=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(o){t=t.concat(this[o].ruler.disable(e,!0))},this),t=t.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(function(o){return t.indexOf(o)<0});if(r.length&&!n)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},qn.prototype.use=function(e){const n=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,n),this},qn.prototype.parse=function(e,n){if(typeof e!="string")throw new Error("Input data should be a String");const t=new this.core.State(e,this,n);return this.core.process(t),t.tokens},qn.prototype.render=function(e,n){return n=n||{},this.renderer.render(this.parse(e,n),this.options,n)},qn.prototype.parseInline=function(e,n){const t=new this.core.State(e,this,n);return t.inlineMode=!0,this.core.process(t),t.tokens},qn.prototype.renderInline=function(e,n){return n=n||{},this.renderer.render(this.parseInline(e,n),this.options,n)};/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:Gh,setPrototypeOf:Xh,isFrozen:MO,getPrototypeOf:FO,getOwnPropertyDescriptor:BO}=Object;let{freeze:on,seal:$n,create:Wh}=Object,{apply:Lc,construct:Pc}=typeof Reflect<"u"&&Reflect;on||(on=function(n){return n}),$n||($n=function(n){return n}),Lc||(Lc=function(n,t,r){return n.apply(t,r)}),Pc||(Pc=function(n,t){return new n(...t)});const Ms=sn(Array.prototype.forEach),NO=sn(Array.prototype.lastIndexOf),Qh=sn(Array.prototype.pop),Xi=sn(Array.prototype.push),LO=sn(Array.prototype.splice),Fs=sn(String.prototype.toLowerCase),qc=sn(String.prototype.toString),Zh=sn(String.prototype.match),Wi=sn(String.prototype.replace),PO=sn(String.prototype.indexOf),qO=sn(String.prototype.trim),Wn=sn(Object.prototype.hasOwnProperty),an=sn(RegExp.prototype.test),Qi=$O(TypeError);function sn(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];return Lc(e,n,r)}}function $O(e){return function(){for(var n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return Pc(e,t)}}function et(e,n){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fs;Xh&&Xh(e,null);let r=n.length;for(;r--;){let o=n[r];if(typeof o=="string"){const i=t(o);i!==o&&(MO(n)||(n[r]=i),o=i)}e[o]=!0}return e}function UO(e){for(let n=0;n<e.length;n++)Wn(e,n)||(e[n]=null);return e}function Cr(e){const n=Wh(null);for(const[t,r]of Gh(e))Wn(e,t)&&(Array.isArray(r)?n[t]=UO(r):r&&typeof r=="object"&&r.constructor===Object?n[t]=Cr(r):n[t]=r);return n}function Zi(e,n){for(;e!==null;){const r=BO(e,n);if(r){if(r.get)return sn(r.get);if(typeof r.value=="function")return sn(r.value)}e=FO(e)}function t(){return null}return t}const Jh=on(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),$c=on(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Uc=on(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),jO=on(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),jc=on(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),HO=on(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Yh=on(["#text"]),ep=on(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Hc=on(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),tp=on(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Bs=on(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),VO=$n(/\{\{[\w\W]*|[\w\W]*\}\}/gm),zO=$n(/<%[\w\W]*|[\w\W]*%>/gm),KO=$n(/\$\{[\w\W]*/gm),GO=$n(/^data-[\-\w.\u00B7-\uFFFF]+$/),XO=$n(/^aria-[\-\w]+$/),np=$n(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),WO=$n(/^(?:\w+script|data):/i),QO=$n(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),rp=$n(/^html$/i),ZO=$n(/^[a-z][.\w]*(-[.\w]+)+$/i);var op=Object.freeze({__proto__:null,ARIA_ATTR:XO,ATTR_WHITESPACE:QO,CUSTOM_ELEMENT:ZO,DATA_ATTR:GO,DOCTYPE_NAME:rp,ERB_EXPR:zO,IS_ALLOWED_URI:np,IS_SCRIPT_OR_DATA:WO,MUSTACHE_EXPR:VO,TMPLIT_EXPR:KO});const Ji={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},JO=function(){return typeof window>"u"?null:window},YO=function(n,t){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(r=t.getAttribute(o));const i="dompurify"+(r?"#"+r:"");try{return n.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},ip=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ap(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:JO();const n=Pe=>ap(Pe);if(n.version="3.2.6",n.removed=[],!e||!e.document||e.document.nodeType!==Ji.document||!e.Element)return n.isSupported=!1,n;let{document:t}=e;const r=t,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:s,Element:l,NodeFilter:u,NamedNodeMap:c=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:d,trustedTypes:m}=e,f=l.prototype,y=Zi(f,"cloneNode"),p=Zi(f,"remove"),v=Zi(f,"nextSibling"),g=Zi(f,"childNodes"),_=Zi(f,"parentNode");if(typeof a=="function"){const Pe=t.createElement("template");Pe.content&&Pe.content.ownerDocument&&(t=Pe.content.ownerDocument)}let b,C="";const{implementation:A,createNodeIterator:E,createDocumentFragment:S,getElementsByTagName:D}=t,{importNode:I}=r;let k=ip();n.isSupported=typeof Gh=="function"&&typeof _=="function"&&A&&A.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:w,ERB_EXPR:T,TMPLIT_EXPR:P,DATA_ATTR:X,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:J,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:Y}=op;let{IS_ALLOWED_URI:U}=op,O=null;const R=et({},[...Jh,...$c,...Uc,...jc,...Yh]);let M=null;const N=et({},[...ep,...Hc,...tp,...Bs]);let H=Object.seal(Wh(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),L=null,z=null,j=!0,W=!0,Q=!1,ae=!0,fe=!1,K=!0,V=!1,te=!1,oe=!1,le=!1,ne=!1,de=!1,ve=!0,xe=!1;const ce="user-content-";let re=!0,ue=!1,Ce={},Ie=null;const ie=et({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ye=null;const Ee=et({},["audio","video","img","source","image","track"]);let se=null;const ge=et({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ae="http://www.w3.org/1998/Math/MathML",je="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml";let Xe=Ke,Ye=!1,He=null;const ct=et({},[Ae,je,Ke],qc);let st=et({},["mi","mo","mn","ms","mtext"]),gt=et({},["annotation-xml"]);const Rt=et({},["title","style","font","a","script"]);let Gt=null;const Er=["application/xhtml+xml","text/html"],Qn="text/html";let yt=null,ln=null;const kr=t.createElement("form"),Tn=function(_e){return _e instanceof RegExp||_e instanceof Function},Zn=function(){let _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ln&&ln===_e)){if((!_e||typeof _e!="object")&&(_e={}),_e=Cr(_e),Gt=Er.indexOf(_e.PARSER_MEDIA_TYPE)===-1?Qn:_e.PARSER_MEDIA_TYPE,yt=Gt==="application/xhtml+xml"?qc:Fs,O=Wn(_e,"ALLOWED_TAGS")?et({},_e.ALLOWED_TAGS,yt):R,M=Wn(_e,"ALLOWED_ATTR")?et({},_e.ALLOWED_ATTR,yt):N,He=Wn(_e,"ALLOWED_NAMESPACES")?et({},_e.ALLOWED_NAMESPACES,qc):ct,se=Wn(_e,"ADD_URI_SAFE_ATTR")?et(Cr(ge),_e.ADD_URI_SAFE_ATTR,yt):ge,ye=Wn(_e,"ADD_DATA_URI_TAGS")?et(Cr(Ee),_e.ADD_DATA_URI_TAGS,yt):Ee,Ie=Wn(_e,"FORBID_CONTENTS")?et({},_e.FORBID_CONTENTS,yt):ie,L=Wn(_e,"FORBID_TAGS")?et({},_e.FORBID_TAGS,yt):Cr({}),z=Wn(_e,"FORBID_ATTR")?et({},_e.FORBID_ATTR,yt):Cr({}),Ce=Wn(_e,"USE_PROFILES")?_e.USE_PROFILES:!1,j=_e.ALLOW_ARIA_ATTR!==!1,W=_e.ALLOW_DATA_ATTR!==!1,Q=_e.ALLOW_UNKNOWN_PROTOCOLS||!1,ae=_e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,fe=_e.SAFE_FOR_TEMPLATES||!1,K=_e.SAFE_FOR_XML!==!1,V=_e.WHOLE_DOCUMENT||!1,le=_e.RETURN_DOM||!1,ne=_e.RETURN_DOM_FRAGMENT||!1,de=_e.RETURN_TRUSTED_TYPE||!1,oe=_e.FORCE_BODY||!1,ve=_e.SANITIZE_DOM!==!1,xe=_e.SANITIZE_NAMED_PROPS||!1,re=_e.KEEP_CONTENT!==!1,ue=_e.IN_PLACE||!1,U=_e.ALLOWED_URI_REGEXP||np,Xe=_e.NAMESPACE||Ke,st=_e.MATHML_TEXT_INTEGRATION_POINTS||st,gt=_e.HTML_INTEGRATION_POINTS||gt,H=_e.CUSTOM_ELEMENT_HANDLING||{},_e.CUSTOM_ELEMENT_HANDLING&&Tn(_e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=_e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),_e.CUSTOM_ELEMENT_HANDLING&&Tn(_e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=_e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),_e.CUSTOM_ELEMENT_HANDLING&&typeof _e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(H.allowCustomizedBuiltInElements=_e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),fe&&(W=!1),ne&&(le=!0),Ce&&(O=et({},Yh),M=[],Ce.html===!0&&(et(O,Jh),et(M,ep)),Ce.svg===!0&&(et(O,$c),et(M,Hc),et(M,Bs)),Ce.svgFilters===!0&&(et(O,Uc),et(M,Hc),et(M,Bs)),Ce.mathMl===!0&&(et(O,jc),et(M,tp),et(M,Bs))),_e.ADD_TAGS&&(O===R&&(O=Cr(O)),et(O,_e.ADD_TAGS,yt)),_e.ADD_ATTR&&(M===N&&(M=Cr(M)),et(M,_e.ADD_ATTR,yt)),_e.ADD_URI_SAFE_ATTR&&et(se,_e.ADD_URI_SAFE_ATTR,yt),_e.FORBID_CONTENTS&&(Ie===ie&&(Ie=Cr(Ie)),et(Ie,_e.FORBID_CONTENTS,yt)),re&&(O["#text"]=!0),V&&et(O,["html","head","body"]),O.table&&(et(O,["tbody"]),delete L.tbody),_e.TRUSTED_TYPES_POLICY){if(typeof _e.TRUSTED_TYPES_POLICY.createHTML!="function")throw Qi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof _e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Qi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=_e.TRUSTED_TYPES_POLICY,C=b.createHTML("")}else b===void 0&&(b=YO(m,o)),b!==null&&typeof C=="string"&&(C=b.createHTML(""));on&&on(_e),ln=_e}},bn=et({},[...$c,...Uc,...jO]),Ar=et({},[...jc,...HO]),Mt=function(_e){let Fe=_(_e);(!Fe||!Fe.tagName)&&(Fe={namespaceURI:Xe,tagName:"template"});const Be=Fs(_e.tagName),ft=Fs(Fe.tagName);return He[_e.namespaceURI]?_e.namespaceURI===je?Fe.namespaceURI===Ke?Be==="svg":Fe.namespaceURI===Ae?Be==="svg"&&(ft==="annotation-xml"||st[ft]):!!bn[Be]:_e.namespaceURI===Ae?Fe.namespaceURI===Ke?Be==="math":Fe.namespaceURI===je?Be==="math"&&gt[ft]:!!Ar[Be]:_e.namespaceURI===Ke?Fe.namespaceURI===je&&!gt[ft]||Fe.namespaceURI===Ae&&!st[ft]?!1:!Ar[Be]&&(Rt[Be]||!bn[Be]):!!(Gt==="application/xhtml+xml"&&He[_e.namespaceURI]):!1},bt=function(_e){Xi(n.removed,{element:_e});try{_(_e).removeChild(_e)}catch{p(_e)}},_n=function(_e,Fe){try{Xi(n.removed,{attribute:Fe.getAttributeNode(_e),from:Fe})}catch{Xi(n.removed,{attribute:null,from:Fe})}if(Fe.removeAttribute(_e),_e==="is")if(le||ne)try{bt(Fe)}catch{}else try{Fe.setAttribute(_e,"")}catch{}},hr=function(_e){let Fe=null,Be=null;if(oe)_e="<remove></remove>"+_e;else{const _t=Zh(_e,/^[\r\n\t ]+/);Be=_t&&_t[0]}Gt==="application/xhtml+xml"&&Xe===Ke&&(_e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+_e+"</body></html>");const ft=b?b.createHTML(_e):_e;if(Xe===Ke)try{Fe=new d().parseFromString(ft,Gt)}catch{}if(!Fe||!Fe.documentElement){Fe=A.createDocument(Xe,"template",null);try{Fe.documentElement.innerHTML=Ye?C:ft}catch{}}const Ot=Fe.body||Fe.documentElement;return _e&&Be&&Ot.insertBefore(t.createTextNode(Be),Ot.childNodes[0]||null),Xe===Ke?D.call(Fe,V?"html":"body")[0]:V?Fe.documentElement:Ot},St=function(_e){return E.call(_e.ownerDocument||_e,_e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},ko=function(_e){return _e instanceof h&&(typeof _e.nodeName!="string"||typeof _e.textContent!="string"||typeof _e.removeChild!="function"||!(_e.attributes instanceof c)||typeof _e.removeAttribute!="function"||typeof _e.setAttribute!="function"||typeof _e.namespaceURI!="string"||typeof _e.insertBefore!="function"||typeof _e.hasChildNodes!="function")},Wo=function(_e){return typeof s=="function"&&_e instanceof s};function Dn(Pe,_e,Fe){Ms(Pe,Be=>{Be.call(n,_e,Fe,ln)})}const Qo=function(_e){let Fe=null;if(Dn(k.beforeSanitizeElements,_e,null),ko(_e))return bt(_e),!0;const Be=yt(_e.nodeName);if(Dn(k.uponSanitizeElement,_e,{tagName:Be,allowedTags:O}),K&&_e.hasChildNodes()&&!Wo(_e.firstElementChild)&&an(/<[/\w!]/g,_e.innerHTML)&&an(/<[/\w!]/g,_e.textContent)||_e.nodeType===Ji.progressingInstruction||K&&_e.nodeType===Ji.comment&&an(/<[/\w]/g,_e.data))return bt(_e),!0;if(!O[Be]||L[Be]){if(!L[Be]&&Ft(Be)&&(H.tagNameCheck instanceof RegExp&&an(H.tagNameCheck,Be)||H.tagNameCheck instanceof Function&&H.tagNameCheck(Be)))return!1;if(re&&!Ie[Be]){const ft=_(_e)||_e.parentNode,Ot=g(_e)||_e.childNodes;if(Ot&&ft){const _t=Ot.length;for(let Ut=_t-1;Ut>=0;--Ut){const Rn=y(Ot[Ut],!0);Rn.__removalCount=(_e.__removalCount||0)+1,ft.insertBefore(Rn,v(_e))}}}return bt(_e),!0}return _e instanceof l&&!Mt(_e)||(Be==="noscript"||Be==="noembed"||Be==="noframes")&&an(/<\/no(script|embed|frames)/i,_e.innerHTML)?(bt(_e),!0):(fe&&_e.nodeType===Ji.text&&(Fe=_e.textContent,Ms([w,T,P],ft=>{Fe=Wi(Fe,ft," ")}),_e.textContent!==Fe&&(Xi(n.removed,{element:_e.cloneNode()}),_e.textContent=Fe)),Dn(k.afterSanitizeElements,_e,null),!1)},Zo=function(_e,Fe,Be){if(ve&&(Fe==="id"||Fe==="name")&&(Be in t||Be in kr))return!1;if(!(W&&!z[Fe]&&an(X,Fe))){if(!(j&&an($,Fe))){if(!M[Fe]||z[Fe]){if(!(Ft(_e)&&(H.tagNameCheck instanceof RegExp&&an(H.tagNameCheck,_e)||H.tagNameCheck instanceof Function&&H.tagNameCheck(_e))&&(H.attributeNameCheck instanceof RegExp&&an(H.attributeNameCheck,Fe)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(Fe))||Fe==="is"&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&an(H.tagNameCheck,Be)||H.tagNameCheck instanceof Function&&H.tagNameCheck(Be))))return!1}else if(!se[Fe]){if(!an(U,Wi(Be,ee,""))){if(!((Fe==="src"||Fe==="xlink:href"||Fe==="href")&&_e!=="script"&&PO(Be,"data:")===0&&ye[_e])){if(!(Q&&!an(J,Wi(Be,ee,"")))){if(Be)return!1}}}}}}return!0},Ft=function(_e){return _e!=="annotation-xml"&&Zh(_e,Y)},Jo=function(_e){Dn(k.beforeSanitizeAttributes,_e,null);const{attributes:Fe}=_e;if(!Fe||ko(_e))return;const Be={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0};let ft=Fe.length;for(;ft--;){const Ot=Fe[ft],{name:_t,namespaceURI:Ut,value:Rn}=Ot,Un=yt(_t),eo=Rn;let xt=_t==="value"?eo:qO(eo);if(Be.attrName=Un,Be.attrValue=xt,Be.keepAttr=!0,Be.forceKeepAttr=void 0,Dn(k.uponSanitizeAttribute,_e,Be),xt=Be.attrValue,xe&&(Un==="id"||Un==="name")&&(_n(_t,_e),xt=ce+xt),K&&an(/((--!?|])>)|<\/(style|title)/i,xt)){_n(_t,_e);continue}if(Be.forceKeepAttr)continue;if(!Be.keepAttr){_n(_t,_e);continue}if(!ae&&an(/\/>/i,xt)){_n(_t,_e);continue}fe&&Ms([w,T,P],to=>{xt=Wi(xt,to," ")});const Mn=yt(_e.nodeName);if(!Zo(Mn,Un,xt)){_n(_t,_e);continue}if(b&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!Ut)switch(m.getAttributeType(Mn,Un)){case"TrustedHTML":{xt=b.createHTML(xt);break}case"TrustedScriptURL":{xt=b.createScriptURL(xt);break}}if(xt!==eo)try{Ut?_e.setAttributeNS(Ut,_t,xt):_e.setAttribute(_t,xt),ko(_e)?bt(_e):Qh(n.removed)}catch{_n(_t,_e)}}Dn(k.afterSanitizeAttributes,_e,null)},ea=function Pe(_e){let Fe=null;const Be=St(_e);for(Dn(k.beforeSanitizeShadowDOM,_e,null);Fe=Be.nextNode();)Dn(k.uponSanitizeShadowNode,Fe,null),Qo(Fe),Jo(Fe),Fe.content instanceof i&&Pe(Fe.content);Dn(k.afterSanitizeShadowDOM,_e,null)};return n.sanitize=function(Pe){let _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Fe=null,Be=null,ft=null,Ot=null;if(Ye=!Pe,Ye&&(Pe="<!-->"),typeof Pe!="string"&&!Wo(Pe))if(typeof Pe.toString=="function"){if(Pe=Pe.toString(),typeof Pe!="string")throw Qi("dirty is not a string, aborting")}else throw Qi("toString is not a function");if(!n.isSupported)return Pe;if(te||Zn(_e),n.removed=[],typeof Pe=="string"&&(ue=!1),ue){if(Pe.nodeName){const Rn=yt(Pe.nodeName);if(!O[Rn]||L[Rn])throw Qi("root node is forbidden and cannot be sanitized in-place")}}else if(Pe instanceof s)Fe=hr("<!---->"),Be=Fe.ownerDocument.importNode(Pe,!0),Be.nodeType===Ji.element&&Be.nodeName==="BODY"||Be.nodeName==="HTML"?Fe=Be:Fe.appendChild(Be);else{if(!le&&!fe&&!V&&Pe.indexOf("<")===-1)return b&&de?b.createHTML(Pe):Pe;if(Fe=hr(Pe),!Fe)return le?null:de?C:""}Fe&&oe&&bt(Fe.firstChild);const _t=St(ue?Pe:Fe);for(;ft=_t.nextNode();)Qo(ft),Jo(ft),ft.content instanceof i&&ea(ft.content);if(ue)return Pe;if(le){if(ne)for(Ot=S.call(Fe.ownerDocument);Fe.firstChild;)Ot.appendChild(Fe.firstChild);else Ot=Fe;return(M.shadowroot||M.shadowrootmode)&&(Ot=I.call(r,Ot,!0)),Ot}let Ut=V?Fe.outerHTML:Fe.innerHTML;return V&&O["!doctype"]&&Fe.ownerDocument&&Fe.ownerDocument.doctype&&Fe.ownerDocument.doctype.name&&an(rp,Fe.ownerDocument.doctype.name)&&(Ut="<!DOCTYPE "+Fe.ownerDocument.doctype.name+`>
184
- `+Ut),fe&&Ms([w,T,P],Rn=>{Ut=Wi(Ut,Rn," ")}),b&&de?b.createHTML(Ut):Ut},n.setConfig=function(){let Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zn(Pe),te=!0},n.clearConfig=function(){ln=null,te=!1},n.isValidAttribute=function(Pe,_e,Fe){ln||Zn({});const Be=yt(Pe),ft=yt(_e);return Zo(Be,ft,Fe)},n.addHook=function(Pe,_e){typeof _e=="function"&&Xi(k[Pe],_e)},n.removeHook=function(Pe,_e){if(_e!==void 0){const Fe=NO(k[Pe],_e);return Fe===-1?void 0:LO(k[Pe],Fe,1)[0]}return Qh(k[Pe])},n.removeHooks=function(Pe){k[Pe]=[]},n.removeAllHooks=function(){k=ip()},n}var eT=ap();const tT=["innerHTML"],sp=Ne({__name:"MarkdownRenderer",props:{source:{type:String,default:""},wrapperClass:{type:[String,Array,Object],default:""}},setup(e){const n=e,t=new qn({html:!1,linkify:!0,breaks:!0}),r=be(()=>{const o=t.render(n.source||"");return eT.sanitize(o)});return(o,i)=>(F(),q("div",{class:Me(["markdown-renderer",e.wrapperClass]),innerHTML:r.value},null,10,tT))}},[["__scopeId","data-v-ecacea26"]]),nT={class:"message-content"},rT={key:0,class:"message-name"},oT={class:"ect-w-full"},iT={class:"message-content"},aT={class:"message-text ect-relative"},sT={class:"ect-pr-1"},lT={class:"loading-message-skeleton"},uT={key:1,class:"buttons-wrapper ect-mt-[-8px]"},cT=Ne({__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:()=>[]}},emits:["component-action"],setup(e,{emit:n}){const t=J2(),r=G(null),o=G(null);xo();const i=Co(),a=Ho(),s=n,l=e,u=be(()=>!(a!=null&&a.activeComponentKey)),c=()=>{r.value&&r.value.scrollTo({top:r.value.scrollHeight,behavior:"smooth"})};od(()=>{l.messages.length>0&&Dt(()=>{c()})}),od(()=>{l.loadingMessage&&Dt(()=>{c(),o.value&&(o.value.scrollTop=o.value.scrollHeight)})});const h=be(()=>{var p;return(p=i.chatStyles)==null?void 0:p.bgColor}),d=be(()=>`linear-gradient(180deg, ${h.value} 0%, transparent 100%)`),m=be(()=>{var p;return(p=i.chatStyles)==null?void 0:p.textColor}),f=(p,v,g=!1)=>{if(typeof p=="string"&&p.startsWith("playbookNavigate:")){const _=p.slice(17);a.navigateToBean(_);return}p==="addProducts"?a.loadComponent("catalog"):p==="quoteDocument"?t.openQuoteDocument(v.requestId):p==="quoteItem"?a.loadComponent("cart"):p==="Undo"?i.undoAction(v.requestId):p==="Checkout"&&s("component-action",{component:"chat",action:"checkout",details:{action:"CHECKOUT",label:"Checkout"}})},y=p=>{if(!p)return"";let v=p.replace(/\\r\\n/g,`
184
+ `+Ut),fe&&Ms([w,T,P],Rn=>{Ut=Wi(Ut,Rn," ")}),b&&de?b.createHTML(Ut):Ut},n.setConfig=function(){let Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zn(Pe),te=!0},n.clearConfig=function(){ln=null,te=!1},n.isValidAttribute=function(Pe,_e,Fe){ln||Zn({});const Be=yt(Pe),ft=yt(_e);return Zo(Be,ft,Fe)},n.addHook=function(Pe,_e){typeof _e=="function"&&Xi(k[Pe],_e)},n.removeHook=function(Pe,_e){if(_e!==void 0){const Fe=NO(k[Pe],_e);return Fe===-1?void 0:LO(k[Pe],Fe,1)[0]}return Qh(k[Pe])},n.removeHooks=function(Pe){k[Pe]=[]},n.removeAllHooks=function(){k=ip()},n}var eT=ap();const tT=["innerHTML"],sp=Ne({__name:"MarkdownRenderer",props:{source:{type:String,default:""},wrapperClass:{type:[String,Array,Object],default:""}},setup(e){const n=e,t=new qn({html:!1,linkify:!0,breaks:!0}),r=be(()=>{const o=t.render(n.source||"");return eT.sanitize(o)});return(o,i)=>(F(),q("div",{class:Me(["markdown-renderer",e.wrapperClass]),innerHTML:r.value},null,10,tT))}},[["__scopeId","data-v-ecacea26"]]),nT={class:"message-content"},rT={key:0,class:"message-name"},oT={class:"ect-w-full"},iT={class:"message-content"},aT={class:"message-text ect-relative"},sT={class:"ect-pr-1"},lT={class:"loading-message-skeleton"},uT={key:1,class:"buttons-wrapper ect-mt-[-8px]"},cT=Ne({__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:()=>[]}},emits:["component-action"],setup(e,{emit:n}){const t=J2(),r=G(null),o=G(null);xo();const i=Co(),a=Ho(),s=n,l=e,u=be(()=>!(a!=null&&a.activeComponentKey)),c=()=>{r.value&&r.value.scrollTo({top:r.value.scrollHeight,behavior:"smooth"})};od(()=>{l.messages.length>0&&Dt(()=>{c()})}),od(()=>{l.loadingMessage&&Dt(()=>{c(),o.value&&(o.value.scrollTop=o.value.scrollHeight)})});const h=be(()=>{var p;return(p=i.chatStyles)==null?void 0:p.bgColor}),d=be(()=>`linear-gradient(180deg, ${h.value} 0%, transparent 100%)`),m=be(()=>{var p;return(p=i.chatStyles)==null?void 0:p.textColor}),f=(p,v,g=!1)=>{if(console.info("performAction action",p),typeof p=="string"&&p.startsWith("playbookNavigate:")){const _=p.slice(17);a.navigateToBean(_);return}p==="addProducts"?a.loadComponent("catalog"):p==="quoteDocument"?t.openQuoteDocument(v.requestId):p==="quoteItem"?a.loadComponent("cart"):p==="Undo"?i.undoAction(v.requestId):p==="Checkout"&&s("component-action",{component:"chat",action:"checkout",details:{action:"CHECKOUT",label:"Checkout"}})},y=p=>{if(!p)return"";let v=p.replace(/\\r\\n/g,`
185
185
  `).replace(/\\n/g,`
186
186
  `).replace(/\\r/g,`
187
- `);return v=v.replace(/^[ \t]*•[ \t]+/gm,"- "),v};return(p,v)=>(F(),q("div",{class:Me(["chat-messages",{"root-path":u.value}])},[x("div",{class:"chat-gradient",style:Re({background:d.value})},null,4),x("div",{ref_key:"chatMessagesRef",ref:r,class:"messages-wrapper"},[(F(!0),q(De,null,Le([...e.messages],(g,_)=>{var b;return F(),q("div",{key:_,class:Me(["message",{"user-message":g.type==="user"}])},[x("div",nT,[g.name?(F(),q("div",rT,ke(g.name),1)):me("",!0),x("div",{class:Me(["message-text ect-relative",{"error-message":g.error,strikethrough:g.undone}]),style:Re(g.type==="user"?{color:m.value,backgroundColor:h.value}:{})},[x("div",oT,[pe(sp,{source:y(g.message)},null,8,["source"])]),((b=g==null?void 0:g.filesData)==null?void 0:b.length)>0?(F(!0),q(De,{key:0},Le(g==null?void 0:g.filesData,C=>(F(),Oe(eI,{key:C.name,info:{iconUrl:(C==null?void 0:C.type)==="csv"?Te(nh):Te(rh),fileName:C==null?void 0:C.name,fileSize:C==null?void 0:C.size},background:g.type=="user"?"#fff":"#f8f8f8","encoded-string":C==null?void 0:C.encodedString},null,8,["info","background","encoded-string"]))),128)):me("",!0)],6)])],2)}),128)),e.loadingMessage?(F(),q("div",{key:0,class:Me(["loading-message",{"thinking-message":Te(i).isThinkingMessage}])},[x("div",{class:Me(["ect-flex ect-gap-3",{"ect-w-full":Te(i).isThinkingMessage}])},[x("div",iT,[x("div",aT,[x("div",{ref_key:"loadingWindowRef",ref:o,class:"loading-window"},[x("div",sT,[pe(sp,{source:y(e.loadingMessage)},null,8,["source"])])],512)]),x("div",lT,[pe($i,{style:{height:"100%",width:"100%"}})])])],2)],2)):e.buttonLinks.length>0?(F(),q("div",uT,[pe(Ww,{links:e.buttonLinks,onPerformAction:f},null,8,["links"])])):me("",!0)],512)],2))}},[["__scopeId","data-v-fe989f2b"]]),dT={class:"ai-upload ect-flex-inline ect-items-center"},fT=Ne({__name:"FileUpload",props:{resetFileInput:{type:Boolean,default:!1}},emits:["upload-status","error"],setup(e,{emit:n}){const t=e,r=n,o=G(null),i=G(""),a=G(""),s=G(!1);We(()=>t.resetFileInput,h=>{h&&o.value&&(o.value.value="",i.value="",a.value="")});const l=h=>{const m=o.value.accept.split(",").map(y=>y.trim().toLowerCase()),f="."+h.name.split(".").pop().toLowerCase();return m.includes(f)||m.includes(h.type.toLowerCase())?!0:m.some(y=>{if(y.includes("*")){const p=y.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 y=new Blob([f.target.result],{type:d.type});console.info("Blob data:",y);try{const p=await j3(y),v={attachment:{name:d.name,data:p}};console.info("AIRequestPayload = ",v),r("upload-status",{status:"uploaded",fileName:i.value,fileType:a.value,size:Af(d.size),fileData:v}),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)=>(F(),q("div",dT,[x("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),x("button",{class:"attachment-button",onClick:c,onMouseenter:d[0]||(d[0]=m=>s.value=!0),onMouseleave:d[1]||(d[1]=m=>s.value=!1)},[pe(Ge,{icon:"attachment",size:"11",height:"17",color:s.value?"#198708":"#828282"},null,8,["color"])],32)]))}},[["__scopeId","data-v-7fbbb7c9"]]),hT=["width","height","data-test-id"],pT=[yi('<g transform="translate(1 1)"><g fill="#57C046"><path d="M72.991 22.112v.119c0 .588-.051 1.162-.13 1.729h12.096c.049-.61.083-1.225.083-1.849v-.122c0-.432-.016-.861-.04-1.288H72.902c.052.466.089.934.089 1.411zM12.059 22.109v-.12c0-.435.027-.863.07-1.287H.05c-.03.466-.05.934-.05 1.407v.121c0 .583.029 1.158.073 1.729h12.136a12.162 12.162 0 0 1-.15-1.85z" vector-effect="non-scaling-stroke"></path></g><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="-737.86" y1="348.135" x2="-696.809" y2="348.135" gradientTransform="matrix(1 0 0 -1 737.86 359.283)" vector-effect="non-scaling-stroke"><stop offset=".3" style="stop-color:#57c046;"></stop><stop offset="1" style="stop-color:#1c8d0a;"></stop></linearGradient><path fill="url(#a)" d="M12.059 22.109v-.12c0-6.117 4.324-11.324 10.841-11.324 8.247 0 13.073 6.397 13.073 6.397l5.078-8.799C36.944 3.258 30.544.068 23.023.068 9.866.068 0 9.938 0 22.109v.121h12.065c-.001-.04-.006-.08-.006-.121z" vector-effect="non-scaling-stroke"></path><linearGradient id="b" gradientUnits="userSpaceOnUse" x1="-693.833" y1="326.091" x2="-652.825" y2="326.091" gradientTransform="matrix(1 0 0 -1 737.86 359.283)" vector-effect="non-scaling-stroke"><stop offset="0" style="stop-color:#1c8d0a;"></stop><stop offset=".7" style="stop-color:#57c046;"></stop></linearGradient><path fill="url(#b)" d="M72.991 22.23c0 6.117-4.32 11.325-10.831 11.325-8.238 0-13.062-6.399-13.062-6.399l-5.071 8.802c4.103 5.003 10.497 8.194 18.01 8.194 13.101 0 22.934-9.805 22.997-21.921l-12.043-.001z" vector-effect="non-scaling-stroke"></path><linearGradient id="c" gradientUnits="userSpaceOnUse" x1="-737.86" y1="337.172" x2="-652.822" y2="337.172" gradientTransform="matrix(1 0 0 -1 737.86 359.283)" vector-effect="non-scaling-stroke"><stop offset=".14" style="stop-color:#57c046;"></stop><stop offset=".37" style="stop-color:#97d952;"></stop><stop offset=".59" style="stop-color:#c3eb5b;"></stop><stop offset=".86" style="stop-color:#57c046;"></stop></linearGradient><path fill="url(#c)" d="m42.533 33.78.071-.028s9.631-16.844 10.384-18.051c2.378-3.72 5.028-5.034 9.05-5.034 6.511 0 10.952 5.329 10.952 11.445v.119h12.045c0-.04.003-.079.003-.119v-.122C85.038 9.819 75.303.072 62.161.072c-8.515 0-15.645 4.144-19.615 10.371l-.071.026s-9.641 16.845-10.394 18.052c-2.38 3.721-5.033 5.035-9.059 5.035-6.473 0-10.899-5.259-10.958-11.324H0c0 12.171 9.745 21.92 22.9 21.92 8.522-.001 15.659-4.147 19.633-10.372z" vector-effect="non-scaling-stroke"></path></g>',1)],mT={__name:"ExpediteLogo",props:{width:{type:Number,default:38},height:{type:Number,default:20},dataTestId:{type:String,default:""}},setup(e){return(n,t)=>(F(),q("svg",{xmlns:"http://www.w3.org/2000/svg",overflow:"visible",preserveAspectRatio:"none",viewBox:"0 0 87.04 46.221",width:e.width,height:e.height,"data-test-id":e.dataTestId,"xml:space":"preserve"},pT,8,hT))}},gT={key:0,class:"suggestions-container"},yT={key:0,class:"logo-section"},vT={class:"help-text-section"},bT={key:0,class:"help-text"},_T={key:1,class:"sub-help-text"},xT=["onClick"],CT={key:2,class:"suggestions-list"},ET=["onClick"],kT=Ne({__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:n}){const t=e,r=n,o=G(0),i=G(0),a=G(null),s=G(null),l=d=>{a.value=d,i.value=0},u=()=>{a.value=null,o.value=0},c=d=>{r("select",d)},h=d=>{if(t.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)%t.options.length,r("preview",t.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?t.options.length-1:o.value-1,r("preview",t.options[o.value].title));break;case"Enter":d.preventDefault(),a.value?c(a.value.subOptions[i.value]):l(t.options[o.value]);break;case"Escape":case"ArrowLeft":case"Backspace":a.value&&(d.preventDefault(),u());break}};return We(()=>t.showSuggestions,d=>{d?(window.addEventListener("keydown",h),a.value=null,o.value=0,i.value=0):window.removeEventListener("keydown",h)}),(d,m)=>e.showSuggestions?(F(),q("div",gT,[a.value?me("",!0):(F(),q("div",yT,[pe(mT)])),x("div",vT,[e.helpText&&!a.value?(F(),q("div",bT,ke(e.helpText),1)):me("",!0),e.subHelpText?(F(),q("div",_T,ke(e.subHelpText),1)):me("",!0)]),a.value?(F(),q("div",CT,[(F(!0),q(De,null,Le(a.value.subOptions,(f,y)=>(F(),q("div",{key:y,class:Me(["sub-option",{"sub-active":i.value===y}]),onClick:p=>c(f)},ke(f),11,ET))),128))])):(F(),q("div",{key:1,ref_key:"suggestionsList",ref:s,class:"suggestions-list"},[(F(!0),q(De,null,Le(e.options,(f,y)=>(F(),q("div",{key:y,class:Me(["suggestion-item",{active:o.value===y}]),onClick:p=>l(f)},ke(f.title),11,xT))),128))],512))])):me("",!0)}},[["__scopeId","data-v-bbb514b3"]]),AT={class:"chat-file-info"},wT={class:"ect-flex ect-gap-2 ect-items-center ect-self-stretch ect-my-auto ect-text-xs ect-font-medium ect-text-black"},IT=["src"],ST={class:"ect-self-stretch ect-my-auto"},OT={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"},TT=Ne({__name:"ChatInputFileInfo",props:{fileInfo:{type:Object,required:!0}},emits:["cancel"],setup(e,{emit:n}){const t=n,r=()=>{t("cancel")};return(o,i)=>(F(),q("div",AT,[x("div",wT,[x("img",{loading:"lazy",src:e.fileInfo.fileType==="csv"?Te(nh):Te(rh),class:"ect-object-contain ect-shrink-0 ect-self-stretch ect-my-auto ect-w-7 ect-aspect-square",alt:""},null,8,IT),x("div",ST,ke(e.fileInfo.fileName),1)]),e.fileInfo.status==="uploading"?(F(),q("div",OT,[pe(cu,{size:18})])):me("",!0),e.fileInfo.status==="uploaded"?(F(),q("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},[pe(Ge,{icon:"close",size:"8"})])):me("",!0)]))}},[["__scopeId","data-v-24d881bd"]]),DT={class:"chat-input-wrapper"},RT={class:"chat-input-inner"},MT={class:"input-row"},FT=["disabled","placeholder","onKeydown"],BT={key:1,class:"icon-wrapper"},NT={class:"icon-wrapper"},LT=Ne({__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:n}){const t=e,r=n;Co();const o=wn(),i=Ho(),a=G({}),s=G(!1),l=G(!1),u=G(t.modelValue),c=G(null),h=be(()=>{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 w=(Array.isArray(I==null?void 0:I.relatedPG)?I.relatedPG:[]).slice().sort((T,P)=>Number((T==null?void 0:T.sequenceNumber)??0)-Number((P==null?void 0:P.sequenceNumber)??0)).map(T=>T.pgName);return{title:I.pgName,subOptions:w}})}),d=be(()=>{var E;return(E=h.value)!=null&&E.length?h.value:[]}),m=be(()=>{var E;return(E=h.value)!=null&&E.length?"Prompt Guidance":t.helpText});We(()=>t.loading,async(E,S)=>{!E&&S&&(await Dt(),c.value.focus())}),We(u,E=>{r("update:modelValue",E),Dt(()=>b())}),We(()=>t.modelValue,E=>{u.value=E});const f=E=>{console.info("[ERROR]: File upload error:",E),o.handleError(E,"ChatInput")},y=()=>{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,Dt(()=>{b(),c.value&&(c.value.focus(),c.value.selectionStart=c.value.selectionEnd=u.value.length)})},v=E=>{u.value=E,Dt(()=>b())},g=()=>{l.value=!1},_=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`},C=()=>{console.info("removeFile"),a.value=null,s.value=!0,r("file-upload-status",null),setTimeout(()=>{s.value=!1},100)},A=()=>{l.value=!1,b()};return(E,S)=>{var I,k,w,T,P;const D=nd("click-outside");return An((F(),q("div",DT,[pe(kT,{options:d.value,"help-text":m.value,"sub-help-text":e.subHelpText,"show-suggestions":l.value,onSelect:p,onPreview:v},null,8,["options","help-text","sub-help-text","show-suggestions"]),x("div",RT,[x("div",MT,[x("div",{class:Me(["icon-wrapper",{"active-suggestions":l.value,disabled:((I=d.value)==null?void 0:I.length)<=0}])},[pe(Ge,{disabled:((k=d.value)==null?void 0:k.length)<=0||e.loading,color:((w=d.value)==null?void 0:w.length)<=0?"#DEDEDE":l.value?"#198708":"#828282",icon:"suggestions",size:"13",height:15,onClick:S[0]||(S[0]=X=>l.value=!l.value)},null,8,["disabled","color"])],2),An(x("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":S[1]||(S[1]=X=>u.value=X),disabled:e.loading,placeholder:e.placeholder,rows:"1",onKeydown:Hn(kt(y,["exact","prevent"]),["enter"]),onInput:A},null,40,FT),[[po,u.value]]),e.showFile?(F(),q("div",{key:0,class:Me(["icon-wrapper",{"file-upload-disabled":e.loading}])},[pe(fT,{"reset-file-input":s.value,onUploadStatus:_,onError:f},null,8,["reset-file-input"])],2)):me("",!0),e.showMic?(F(),q("div",BT,[pe(Ge,{color:"#828282",disabled:e.loading,icon:"mic",size:"13",height:15,onClick:S[2]||(S[2]=X=>E.$emit("speak"))},null,8,["disabled"])])):me("",!0),x("div",NT,[(F(),Oe(Ge,{key:1,disabled:e.loading,icon:"send",size:"20",onClick:y},null,8,["disabled"]))])]),((T=a.value)==null?void 0:T.status)==="uploading"||((P=a.value)==null?void 0:P.status)==="uploaded"?(F(),Oe(TT,{key:0,class:"ect-mt-3 ect-mb-0.5","file-info":a.value,onCancel:C},null,8,["file-info"])):me("",!0)])])),[[D,g]])}}},[["__scopeId","data-v-e205d71c"]]),PT=["data-test-id"],qT=["data-test-id"],$T=["data-test-id"],UT=Ne({__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"}},emits:["component-action"],setup(e,{emit:n}){const t=Ho(),r=n,o=Co(),i=G(null),a=be(()=>{var h;return((h=t.getCurrentStepLinks)==null?void 0:h.call(t))||[]}),s=be(()=>!0),l=h=>{console.info("[aiChat] handleSubmit",{hasFileData:!!i.value,messageLength:(h||"").length}),i.value?(console.info("[aiChat] sending with file attachment"),o.sendMessage(h,!0,i.value)):(console.info("[aiChat] sending without attachment"),o.sendMessage(h))},u=h=>{console.info("ChatScreen handleFileUploadStatus event = ",h),h!=null&&h.fileData?(i.value=h.fileData,o.attachmentData={size:h.size,type:h.fileType,name:h.fileName}):(i.value=null,o.attachmentData=null)},c=h=>{r("component-action",h)};return(h,d)=>(F(),q("div",{class:"chat-screen","data-test-id":e.dataTestId},[x("div",{class:Me(["messages-container",{"playbook-steps-mode-hybrid":Te(t).playbookStepsMode==="hybrid","playbook-steps-mode-full":Te(t).playbookStepsMode==="full","dxp-guiddance":e.isExternalGuidance}]),style:Re({maxHeight:`calc(${e.styles.height} - 72px)`,height:`calc(${e.styles.height} - 72px)`}),"data-test-id":`${e.dataTestId}-messages-container`},[pe(cT,{messages:Te(o).chatHistory,"loading-message":Te(o).loadingMessage,"undo-id":Te(o).latestDMLRequest,"button-links":a.value,"strikethrough-ids":Te(o).strikethroughHistory,"data-changed":Te(o).dataManuallyChanged,"data-test-id":`${e.dataTestId}-messages`,onComponentAction:c},null,8,["messages","loading-message","undo-id","button-links","strikethrough-ids","data-changed","data-test-id"])],14,qT),x("div",{class:"input-container","data-test-id":`${e.dataTestId}-input-container`},[pe(LT,{modelValue:Te(o).promptMessage,"onUpdate:modelValue":d[0]||(d[0]=m=>Te(o).promptMessage=m),disabled:!s.value,"file-info":i.value,loading:!!Te(o).loadingMessage,"data-test-id":`${e.dataTestId}-input`,onSubmit:l,onFileUploadStatus:u},null,8,["modelValue","disabled","file-info","loading","data-test-id"])],8,$T)],8,PT))}},[["__scopeId","data-v-dcfc28bd"]]),jT={class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center","data-test-id":"configurator-not-found"},HT={class:"ect-max-w-[720px] ect-p-[50px] ect-border ect-rounded-lg ect-bg-white ect-shadow-sm"},VT={class:"ect-text-[40px] ect-leading-none ect-mb-3"},zT=x("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),KT=x("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),GT={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(n,t)=>(F(),q("div",jT,[x("div",HT,[x("div",VT,[pe(Ge,{icon:"error",size:48})]),zT,KT,x("div",GT,[x("button",{type:"button",class:"ect-text-green-600 ect-text-sm ect-font-medium",onClick:t[0]||(t[0]=r=>n.$emit("return")),"data-test-id":"configurator-not-found-return"}," RETURN TO PRODUCT RESULTS "),x("button",{type:"button",class:"ect-text-green-600 ect-text-sm ect-font-medium",onClick:t[1]||(t[1]=r=>n.$emit("go-cart")),"data-test-id":"configurator-not-found-go-to-cart"}," GO TO CART ")])])]))}},lp=e=>(Qt("data-v-bf75aa89"),e=e(),Zt(),e),WT={class:"ect-h-full ect-w-full ect-bg-white","data-test-id":"aiComponentLoader-wrapper"},QT={key:2,class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center","data-test-id":"aiComponentLoader-cart-error"},ZT=[lp(()=>x("div",{class:"ect-text-center"},[x("div",{class:"ect-text-base ect-font-medium ect-text-red-600","data-test-id":"aiComponentLoader-cart-error-title"}," Quote Required "),x("div",{class:"ect-text-sm ect-text-gray-500 ect-mt-2","data-test-id":"aiComponentLoader-cart-error-message"}," A quote is required for the cart component to work. Please ensure a quoteId is provided in the session prop. ")],-1))],JT={key:5,class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center"},YT={class:"ect-text-center"},eD=lp(()=>x("div",{class:"ect-text-base ect-font-medium","data-test-id":"aiComponentLoader-fallback-title"}," No component to display for this step ",-1)),tD={class:"ect-text-sm ect-text-gray-500 ect-mt-2","data-test-id":"aiComponentLoader-fallback-subtitle"},nD=Ne({__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:""},functions:{type:Object,default:()=>({})},resources:{type:Object,required:!1}},emits:["expeditecart-clicked","ai-guidance:error","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:n}){const t=n,r=e,o=Ho(),i=mc(),a=Ht(),s=be(()=>{var W,Q,ae,fe,K;const j=((W=r.session)==null?void 0:W.quoteId)||((Q=a.quoteId)==null?void 0:Q.value)||((ae=o==null?void 0:o.activeComponentData)==null?void 0:ae.contextObjectId)||((K=(fe=o==null?void 0:o.activeComponentData)==null?void 0:fe.payload)==null?void 0:K.contextObjectId);return{...r.session,...j&&{quoteId:j},qliId:p.value||r.configQliId||void 0,itemId:y.value}}),l=be(()=>{const j=r.functions||{},W=j.createQuote;return typeof W!="function"?j:{...j,createQuote:async(...Q)=>{const ae=await W(...Q);return ae&&a.updateConfig({quoteId:ae}),ae}}}),u=be(()=>{const j=o==null?void 0:o.activeComponentKey,W=r.stepComponent;return(j||W||"").toString().trim().toLowerCase().replace(/[^a-z0-9]+/g,"_")}),c=be(()=>{var fe,K;const j=!!r.templateId,W=!!((fe=r.identity)!=null&&fe.organizationId),Q=!!((K=r.identity)!=null&&K.accountId),ae=typeof r.cartSections=="string"&&r.cartSections.length>0;return j&&W&&Q&&ae}),h=be(()=>{var ae,fe,K,V,te;const j=(ae=r.session)==null?void 0:ae.quoteId,W=(fe=a.quoteId)==null?void 0:fe.value,Q=((K=o==null?void 0:o.activeComponentData)==null?void 0:K.contextObjectId)||((te=(V=o==null?void 0:o.activeComponentData)==null?void 0:V.payload)==null?void 0:te.contextObjectId);return!!(j||W||Q)}),d=be(()=>{var W,Q,ae,fe,K;const j=((W=r.session)==null?void 0:W.quoteId)||((Q=a.quoteId)==null?void 0:Q.value)||((ae=o==null?void 0:o.activeComponentData)==null?void 0:ae.contextObjectId)||((K=(fe=o==null?void 0:o.activeComponentData)==null?void 0:fe.payload)==null?void 0:K.contextObjectId);return{...r.session,...j&&{quoteId:j}}}),m=be(()=>{var W;if(Array.isArray(r.catalogInitialData)&&r.catalogInitialData.length>0)return r.catalogInitialData;const j=((W=o==null?void 0:o.activeComponentData)==null?void 0:W.payload)||{};if(j.catalog&&typeof j.catalog=="object")try{const ae=Object.values(j.catalog).map(fe=>{var K;return(K=fe==null?void 0:fe.catalogResponse)==null?void 0:K.productInfo}).filter(Boolean);if(ae.length>0)return ae}catch{}return Array.isArray(j.initialData)&&j.initialData.length>0?j.initialData:Array.isArray(j.catalogInitialData)&&j.catalogInitialData.length>0?j.catalogInitialData:Array.isArray(j.items)&&j.items.length>0?j.items:[]}),f=be(()=>{var W;const j=((W=o==null?void 0:o.activeComponentData)==null?void 0:W.payload)||{};return r.catalogSearchTerm||j.searchTerm||""}),y=be(()=>{var Q,ae,fe,K,V,te,oe,le;const j=(fe=(ae=(Q=o==null?void 0:o.activeComponentData)==null?void 0:Q.payload)==null?void 0:ae.productConfiguration)==null?void 0:fe[0],W=((oe=(te=(V=(K=o==null?void 0:o.activeComponentData)==null?void 0:K.payload)==null?void 0:V.savedProducts)==null?void 0:te[0])==null?void 0:oe.itemId)||(j==null?void 0:j.itemId)||((le=j==null?void 0:j.product)==null?void 0:le.itemId)||"";return r.configItemId||W||""}),p=be(()=>{var W,Q,ae,fe,K,V;const j=(fe=(ae=(Q=(W=o==null?void 0:o.activeComponentData)==null?void 0:W.payload)==null?void 0:Q.savedProducts)==null?void 0:ae[0])==null?void 0:fe.qliId;if(!j){const te=(V=(K=o==null?void 0:o.activeComponentData)==null?void 0:K.payload)==null?void 0:V.productConfiguration,oe=Array.isArray(te)&&te.length>0?te[0]:null;if(oe){const le=oe==null?void 0:oe.product;if(le!=null&&le.qliId)return le.qliId;if(oe!=null&&oe.qliId)return oe.qliId}}return j||""}),v=be(()=>!!y.value),g=be(()=>u.value==="configurator"&&!v.value?"Configurator requires an itemId (and optional qliId). Provide via playbook payload or props.":u.value==="catalog"?"Catalog step is active. Provide templateId/sections/theme when available.":u.value==="cart"?"Cart step is active.":"Awaiting playbook step selection."),_=be(()=>{try{return JSON.stringify((o==null?void 0:o.activeComponentData)||{})}catch{return""}}),b=be(()=>`catalog::${_.value}`),C=be(()=>`cart::${_.value}`),A=be(()=>{var j;try{return(((j=o==null?void 0:o.activeComponentData)==null?void 0:j.actionFunction)||"")==="Reload"}catch{return!1}}),E=be(()=>{var W;const j=`configurator::${y.value||""}::${p.value||""}`;if(A.value){const Q=((W=o==null?void 0:o.activeComponentData)==null?void 0:W.requestId)||"";return`${j}::${Q}`}return j}),{emitError:S,emitErrors:D}=th(t,"aiComponentLoader"),I=()=>{const j=$w(o,u.value);D(j)},k=G([]),w=G(null),T=j=>{const W=Array.isArray(j)?j:Array.isArray(j==null?void 0:j.items)?j.items:[];if(!Array.isArray(W))return;const Q={"Needs Configuration":1,"Suggests Configuration":2,"Fully Configured":3},ae=V=>(V==null?void 0:V.requiresConfiguration)||"",fe=V=>!!V&&V in Q,K=W.filter(V=>fe(ae(V)));K.sort((V,te)=>{const oe=ae(V),le=ae(te);return(Q[oe]||99)-(Q[le]||99)}),k.value=K,w.value=K.length?K[0]:null},P=j=>{console.log("onQuoteCreated",j),t("catalog-quote-created",j)},X=j=>{console.log("onQuoteUpdated",j),t("catalog-quote-updated",j)},$=j=>{console.log("onItemAdded",j),t("catalog-item-added",j)},J=j=>{console.log("onItemQtyUpdated",j),t("catalog-item-qty-updated",j)},ee=j=>{console.log("onLineDeleted",j),t("catalog-line-deleted",j)},Y=j=>{console.log("onQuoteItemsFetched",j),t("catalog-items-fetched",j)};We(()=>u.value,(j,W)=>{var Q,ae,fe,K,V,te,oe,le,ne,de;if(j==="configurator"){const ve=!!((fe=(ae=(Q=o==null?void 0:o.activeComponentData)==null?void 0:Q.payload)==null?void 0:ae.savedProducts)!=null&&fe.length),xe=((te=(V=(K=o==null?void 0:o.activeComponentData)==null?void 0:K.payload)==null?void 0:V.productConfiguration)==null?void 0:te.length)>0;if(!ve&&!xe&&w.value&&!y.value){const ce=((oe=w.value)==null?void 0:oe.itemId)||"";if(ce){const re=((le=o==null?void 0:o.currentPlaybook)==null?void 0:le.playBookSteps)||[],ue=ye=>String(ye||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_");let Ce=null;const Ie=re.findIndex(ye=>ye.stepName===(o==null?void 0:o.currentStepName));if(Ie>=0&&re[Ie+1]&&ue((ne=re[Ie+1])==null?void 0:ne.stepComponent)==="configurator")Ce=re[Ie+1].stepName;else{const ye=re.findIndex(Ee=>ue(Ee==null?void 0:Ee.stepComponent)==="configurator");Ce=ye>=0?(de=re[ye])==null?void 0:de.stepName:null}const ie={payload:{savedProducts:[{itemId:ce}]}};Ce?o.navigateToStep({stepName:Ce,data:ie}):o.loadComponent("configurator",ie)}}}});const U=()=>{var ae,fe;const j=((ae=o==null?void 0:o.currentPlaybook)==null?void 0:ae.playBookSteps)||[],W=K=>String(K||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),Q=j.findIndex(K=>W(K==null?void 0:K.stepComponent)==="catalog"||W(K==null?void 0:K.stepName).includes("catalog"));if(Q>=0){const K=(fe=j[Q])==null?void 0:fe.stepName;o.navigateToStep({stepName:K})}else o.loadComponent("catalog")},O=()=>{var ae,fe;const j=((ae=o==null?void 0:o.currentPlaybook)==null?void 0:ae.playBookSteps)||[],W=K=>String(K||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),Q=j.findIndex(K=>W(K==null?void 0:K.stepComponent)==="cart"||W(K==null?void 0:K.stepName).includes("cart"));if(Q>=0){const K=(fe=j[Q])==null?void 0:fe.stepName;o.navigateToStep({stepName:K})}else o.loadComponent("cart")},R=j=>{var W,Q;console.log("onItemConfigureClicked",j),t("catalog-item-configure",j);try{const ae=(j==null?void 0:j.itemId)||"",fe=(j==null?void 0:j.qliId)||(j==null?void 0:j.QliId)||"",K=[];if(ae){const ne={itemId:ae};fe&&(ne.qliId=fe),K.push(ne)}const V={payload:{savedProducts:K}},te=((W=o==null?void 0:o.currentPlaybook)==null?void 0:W.playBookSteps)||[],oe=ne=>String(ne||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),le=te.findIndex(ne=>{const de=oe(ne==null?void 0:ne.stepComponent),ve=oe(ne==null?void 0:ne.stepName);return de==="configurator"||ve.includes("configure")});if(le>=0){const ne=(Q=te[le])==null?void 0:Q.stepName;o.navigateToStep({stepName:ne,data:V})}else o.loadComponent("configurator",V)}catch(ae){console.warn("[aiComponentLoader] Failed to navigate to configurator from configure click:",ae),o.loadComponent("configurator",{payload:{}})}},M=j=>{console.log("onCartClicked",j),t("expeditecart-clicked",j)},N=j=>{var W,Q;try{const ae=(j==null?void 0:j.itemId)||"",fe=(j==null?void 0:j.lineItemId)||(j==null?void 0:j.qliId)||"",K=[];if(ae){const ne={itemId:ae};fe&&(ne.qliId=fe),K.push(ne)}const V={payload:{savedProducts:K}},te=((W=o==null?void 0:o.currentPlaybook)==null?void 0:W.playBookSteps)||[],oe=ne=>String(ne||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),le=te.findIndex(ne=>{const de=oe(ne==null?void 0:ne.stepComponent),ve=oe(ne==null?void 0:ne.stepName);return de==="configurator"||ve.includes("configure")});if(le>=0){const ne=(Q=te[le])==null?void 0:Q.stepName;o.navigateToStep({stepName:ne,data:V})}else o.loadComponent("configurator",V)}catch(ae){console.warn("[aiComponentLoader] Failed to navigate to configurator from cart configure click:",ae),o.loadComponent("configurator",{payload:{}})}},H=j=>{console.log("onCatalogIdReceived",j),a.updateConfig({eCatalogId:j})},L=j=>{console.log("Action",j),j.event==="add-to-quote"?t("configurator:add-to-quote",j.data):j.event==="save"&&t("configurator:save",j.data)},z=G("");return We(()=>o==null?void 0:o.activeComponentData,async j=>{var Q,ae,fe,K;if(!j)return;console.log("activeComponentData Changed",j);const W=(j==null?void 0:j.requestId)||"";if(console.log("requestId",W),console.log("lastReloadRequestId",z.value),W&&W!==z.value)if(z.value=W,await Dt(),((ae=(Q=j==null?void 0:j.payload)==null?void 0:Q.productConfiguration)==null?void 0:ae.length)>0){const V=(fe=j==null?void 0:j.payload)==null?void 0:fe.productConfiguration[0],te=(V==null?void 0:V.itemId)||((K=V==null?void 0:V.product)==null?void 0:K.itemId)||"";i.setPreConfigData(j==null?void 0:j.payload,te)}else(j==null?void 0:j.actionFunction)==="Reload"&&(console.log("Reloading configurator 1"),i.refresh())},{deep:!0}),Et(()=>{Dt(()=>{I()})}),(j,W)=>(F(),q("div",WT,[u.value==="catalog"?(F(),Oe(W2,{key:b.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":f.value,"on-catalog-count-update":e.onCatalogCountUpdate,"preview-data":e.catalogPreviewData,"initial-data":m.value,sections:e.sections,theme:e.theme,"composables-org-type":e.composablesOrgType,onCatalogQuoteCreated:P,onCatalogQuoteUpdated:X,onCatalogItemsLoaded:T,onCatalogItemAdded:$,onCatalogItemQtyUpdated:J,onCatalogLineDeleted:ee,onCatalogItemsFetched:Y,onCatalogItemConfigure:R,"onCatalog:id":H},null,8,["template-id","identity","session","security","search-term","on-catalog-count-update","preview-data","initial-data","sections","theme","composables-org-type"])):u.value==="cart"&&c.value&&h.value?(F(),Oe(Q2,{key:C.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:d.value,onExpeditecartItemConfigure:N,onExpeditecartClicked:M},null,8,["template-id","host-name","composables-org-type","security","identity","session"])):u.value==="cart"&&c.value&&!h.value?(F(),q("div",QT,ZT)):u.value==="configurator"&&v.value?(F(),Oe(T1,{key:E.value,"data-test-id":"aiComponentLoader-configurator",class:"ect-h-full ect-w-full",security:e.security,identity:e.identity,resources:e.resources,"user-locale":j.userLocale,cart:!0,"composables-org-type":e.composablesOrgType,session:s.value,functions:l.value,onReady:Te(i).setExpediteConfigComp,onAction:L},null,8,["security","identity","resources","user-locale","composables-org-type","session","functions","onReady"])):u.value==="configurator"&&!v.value?(F(),Oe(XT,{key:4,onReturn:U,onGoCart:O})):(F(),q("div",JT,[x("div",YT,[eD,x("div",tD,ke(g.value),1)])]))]))}},[["__scopeId","data-v-bf75aa89"]]),rD={class:"ai-guidance-loader","data-test-id":"aiGuidance-loader-container"},oD={"data-test-id":"aiGuidance-loader-text"},iD={class:"aig-button","data-test-id":"aiGuidance-loader-button"},aD={class:"aig-input-box","data-test-id":"aiGuidance-loader-input"},sD=Ne({__name:"AiGuidanceLoader",props:{errors:{type:Array,required:!1,default:()=>[]},chatBgColor:{type:String,required:!1,default:""}},setup(e){const n=e,t=be(()=>`linear-gradient(180deg, ${n.chatBgColor} 0%, transparent 100%)`);return(r,o)=>(F(),q(De,null,[x("div",{class:"chat-gradient",style:Re({background:t.value})},null,4),x("div",rD,[x("div",oD,[pe($i,{style:{width:"100%",height:"16px","margin-bottom":"8px"}}),pe($i,{style:{width:"100%",height:"16px","margin-bottom":"32px","max-width":"481px"}})]),x("div",iD,[pe($i,{style:{width:"100%",height:"24px"}})]),(F(!0),q(De,null,Le(e.errors,i=>(F(),q("div",{key:i,class:"aig-message-error","data-test-id":"aiGuidance-loader-error"},ke(i),1))),128)),x("div",aD,[pe($i,{style:{height:"36px",width:"100%"}})])])],64))}},[["__scopeId","data-v-5e4a9913"]]),lD={class:"ai-guidance-wrapper","data-test-id":"aiGuidance-wrapper"},uD=Ne({__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:()=>({})},functions:{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"},resources:{type:Object,required:!1,default:()=>({})}},emits:["expeditecart-item-configure","expeditecart-clicked","component-action","ai-response:success","quote-id:updated","ai-guidance:error"],setup(e,{emit:n}){const t=Ho(),r=Ht(),o=Co(),i=Fi(),a=n,s=G(!0),l=G(!1),u=G(!0),c=G(!0),h=G(!1),d=G([]),{emitError:m,emitErrors:f}=th(a,"aiGuidance"),y=e,{composablesOrgType:p,websocketUrl:v,packageVersion:g,identity:_,session:b,security:C,functions:A,templateId:E,hostName:S,graphqlEndpoint:D,apiKey:I,isPreview:k,catalogSections:w,cartSections:T,theme:P}=y,X=be(()=>{var N,H,L;return{...y.session||{},quoteId:((N=y.session)==null?void 0:N.quoteId)||(((H=r.quoteId)==null?void 0:H.value)??""),eCatalogId:(L=r.eCatalogId)==null?void 0:L.value}});Jt(async()=>{var N;console.log("security",C),console.log("apiKey",I),r.updateConfig({userId:_==null?void 0:_.userId,organizationId:_==null?void 0:_.organizationId,accessToken:C==null?void 0:C.accessToken,composablesApiUrl:C==null?void 0:C.baseUrl,composablesOrgType:p,websocketUrl:v,quoteId:b==null?void 0:b.quoteId,packageVersion:g,accountId:_==null?void 0:_.accountId,templateId:E,hostName:S,graphqlEndpoint:D,apiKey:(C==null?void 0:C.apiKey)||I,cid:_==null?void 0:_.contactId,isPreview:k,siteUrl:(N=y.resources)==null?void 0:N.siteUrl})}),Et(async()=>{var W,Q,ae,fe;const N=Pw(y,_,C);f(N);const H=eh(v);if(H&&m(H),N.length>0||H){s.value=!1;return}t.setSecretKey(C==null?void 0:C.accessToken);let L=null,z,j;try{L=await t.getPlaybookInfoFromQuote(),z=(L==null?void 0:L.XX_ORD1__Completed_PB_Step_Number_EX__c)??void 0,j=(L==null?void 0:L.XX_ORD1__Playbook_Current_Step_Meta_EX__c)??void 0}catch(K){console.error("[aiGuidance] Failed to get playbook info from quote:",K),m("AI_GUIDANCE_PLAYBOOK_INFO_FETCH_FAILED",{error:K.message})}if(j)try{j=JSON.parse(j)}catch(K){console.error("[aiGuidance] Failed to parse currentStepMetaServer:",K),m("AI_GUIDANCE_JSON_PARSE_ERROR",{error:K.message,data:"currentStepMetaServer"}),j=void 0}if(console.info("sequenceNumberServer = ",z),y.templateId){s.value=!0;try{const V=await t.getCatalogInContext();console.log("catalogInContext = ",V),V&&r.updateConfig({eCatalogId:V})}catch(V){console.error("[aiGuidance] Failed to get catalog in context:",V),m("AI_GUIDANCE_CATALOG_FETCH_FAILED",{error:V.message})}let K=null;try{await i.fetchBlockInformationREST({templateId:y.templateId});const V=qw(i.pageBlocks);K=V.playbookId,V.error&&m(V.error,{error:"Block structure validation failed"}),K||m("AI_GUIDANCE_BLOCK_PLAYBOOK_ID_MISSING",{pageBlocks:i.pageBlocks})}catch(V){console.error("[aiGuidance] Failed to fetch block information:",V),m("AI_GUIDANCE_BLOCK_FETCH_FAILED",{error:V.message})}if(console.log("playbookID",K),K?l.value=!0:d.value.push("No playbook ID found in template"),t.setEmbeddedMode(!0),K)try{t.currentPlaybook=K,await t.getPlaybookByKey(K),t.showPlaybookSteps=!0}catch(V){console.error("[aiGuidance] Failed to get playbook by key:",V),m("AI_GUIDANCE_PLAYBOOK_FETCH_FAILED",{error:V.message,playbookID:K})}t.playbookStepsMode="full",o.setInitialPayload();try{await o.connectSocket()}catch(V){console.error("[aiGuidance] Failed to connect socket:",V),m("WEBSOCKET_CONNECTION_FAILED",{error:V.message})}if(z!==void 0){t.navigateToStep({stepName:(Q=(W=t.currentPlaybook)==null?void 0:W.playBookSteps[Number(z)])==null?void 0:Q.stepName,data:j}),s.value=!1;return}(fe=(ae=t.currentPlaybook)==null?void 0:ae.playBookSteps)!=null&&fe.length&&t.setCurrentStepName(t.currentPlaybook.playBookSteps[0].stepName),s.value=!1}else d.value.push("templateId is required")});const $=be(()=>{var L;const N=((L=t.currentPlaybook)==null?void 0:L.playBookSteps)||[],H=t.currentStepName;return N.find(z=>z.stepName===H)||N[0]||null}),J=be(()=>{var N;return((N=$.value)==null?void 0:N.stepComponent)||null});We(()=>t.activeComponentKey,N=>{N&&(u.value=!1)});const ee=[];Et(()=>{ee.push(Sn("expeditecart:configure-clicked",N=>{a("expeditecart-item-configure",N)})),ee.push(Sn("expeditecart:clicked",N=>{a("expeditecart-clicked",N)})),ee.push(Sn("ai-response:success",N=>{try{a("ai-response:success",N)}catch{}})),ee.push(Sn("quote-id:updated",N=>{try{a("quote-id:updated",N)}catch(H){console.info("[aiGuidance] Error emitting quote-id:updated event:",H)}})),ee.push(Sn("websocket:error",N=>{try{N!=null&&N.isInitialization&&m(N.errorCode||"WEBSOCKET_CONNECTION_FAILED",N)}catch(H){console.info("[aiGuidance] Error handling websocket error event:",H)}}))});const Y=N=>{console.log("[aiGuidance] Received error from aiComponentLoader:",N),a("ai-guidance:error",N)},U=N=>{console.log("onExpediteCartClicked",N),a("component-action",{component:"cart",details:N})},O=(N,H)=>{var z;a("component-action",{component:"catalog",action:N,details:H});const L=(H==null?void 0:H.quoteId)??((z=H==null?void 0:H.response)==null?void 0:z.quoteId);if(L&&(N==="item-added"||N==="items-fetched"))try{a("quote-id:updated",{quoteId:L})}catch(j){console.info("[aiGuidance] Error emitting quote-id:updated from catalog event:",j)}},R=(N,H)=>{a("component-action",{component:"configurator",action:N,details:H})},M=N=>{a("component-action",N)};return tr(()=>{try{o.cancelRequest()}catch{}try{o.disconnectSocket()}catch{}try{o.resetState()}catch{}try{t.setEmbeddedMode(!1),t.currentPlaybook=null,t.currentStepName=null,t.activeComponentKey=null,t.activeComponentData=null,t.showPlaybookSteps=!1,t.playbookStepsMode="full"}catch{}s.value=!1,l.value=!1,u.value=!0,c.value=!0,h.value=!1,d.value=[],ee.forEach(N=>{try{N()}catch{}})}),(N,H)=>{var L;return F(),q("div",lD,[pe(uu,{icon:"logo",color:"#000000",size:"18.75",height:"16.25"}),s.value||Te(o).isFetchingHistory?(F(),Oe(sD,{key:0,errors:d.value,"data-test-id":"aiGuidance-loader"},null,8,["errors"])):(F(),q("div",{key:1,class:Me(["ai-app",{"root-path":u.value,"playbook-steps-mode-full":Te(t).playbookStepsMode==="full","dxp-guiddance":l.value}]),style:Re(e.styles)},[x("div",{class:"ai-app-chat-wrapper",style:Re({height:e.styles.height})},[pe(UT,{"data-test-id":"chat-screen","is-external-guidance":l.value,styles:e.styles,onComponentAction:M},null,8,["is-external-guidance","styles"])],4),!u.value&&c.value&&!h.value?(F(),q("div",{key:0,class:"component-loader-wrapper",style:Re({height:e.styles.height,maxHeight:e.styles.height})},[Te(t).currentPlaybook?(F(),Oe(nD,{key:0,"template-id":((L=$.value)==null?void 0:L.templateId)||Te(E),"step-component":J.value,identity:Te(_),session:X.value,security:Te(C),functions:Te(A),"composables-org-type":Te(p),"package-version":Te(g),"host-name":Te(S),"graphql-endpoint":Te(D),"api-key":Te(I),"is-preview":Te(k),sections:Te(w),"cart-sections":Te(T),theme:Te(P),resources:e.resources,"data-test-id":"aiComponentLoader-mounted",onExpeditecartClicked:U,onCatalogQuoteCreated:H[0]||(H[0]=z=>O("quote-created",z)),onCatalogQuoteUpdated:H[1]||(H[1]=z=>O("quote-updated",z)),onCatalogItemsLoaded:H[2]||(H[2]=z=>O("items-loaded",z)),onCatalogItemAdded:H[3]||(H[3]=z=>O("item-added",z)),onCatalogItemQtyUpdated:H[4]||(H[4]=z=>O("item-qty-updated",z)),onCatalogLineDeleted:H[5]||(H[5]=z=>O("line-deleted",z)),onCatalogItemsFetched:H[6]||(H[6]=z=>O("items-fetched",z)),onCatalogItemConfigure:H[7]||(H[7]=z=>O("item-configure",z)),"onConfigurator:addToQuote":H[8]||(H[8]=z=>R("add-to-quote",z)),"onConfigurator:save":H[9]||(H[9]=z=>R("save",z)),"onAiGuidance:error":Y},null,8,["template-id","step-component","identity","session","security","functions","composables-org-type","package-version","host-name","graphql-endpoint","api-key","is-preview","sections","cart-sections","theme","resources"])):me("",!0)],4)):me("",!0)],6))])}}},[["__scopeId","data-v-7835e48c"]]);let Ns=null;if(typeof window<"u"){try{Ns=J6()}catch{}Ns||(Ns=Y6(),Ei(Ns))}let Ls=null,Ps=null;const Vc=new Set;let Eo=null;const zc=new Map;async function cD(e){if(!e)return"";if(zc.has(e))return zc.get(e);try{const n=await fetch(e,{credentials:"omit",cache:"no-cache"});if(n.ok){const t=await n.text();return zc.set(e,t),t}}catch(n){console.warn("[ExpediteComponents] Failed to fetch theme CSS:",n)}return""}async function Kc(e,n){if(!e||!n)return;const t=e.querySelector("style[data-vue-expedite-theme]");t&&t.remove();try{const r=await cD(n);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 Gc(e){Eo=e||null,Eo&&Vc.forEach(n=>{n&&n.shadowRoot&&Kc(n.shadowRoot,Eo)})}async function dD(){return Ls||Ps||(Ps=(async()=>{try{const e=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Or&&Or.src||new URL("vue-expedite-components.umd.cjs",document.baseURI).href).href,n=await fetch(e);if(n.ok)return Ls=await n.text(),Ls}catch(e){console.warn("[ExpediteComponents] Failed to load CSS:",e)}return null})(),Ps)}const Yi=e=>class extends e{async connectedCallback(){if(super.connectedCallback&&super.connectedCallback(),Vc.add(this),!!this.shadowRoot){if(this.shadowRoot.querySelector("style[data-vue-expedite-style]")){Eo&&Kc(this.shadowRoot,Eo);return}try{const n=await dD();if(n){const t=document.createElement("style");t.setAttribute("data-vue-expedite-style","true"),t.textContent=n,this.shadowRoot.prepend(t)}else{const t=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Or&&Or.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=t,this.shadowRoot.prepend(r)}Eo&&Kc(this.shadowRoot,Eo)}catch(n){console.warn("[ExpediteComponents] Failed to inject CSS:",n)}}}disconnectedCallback(){Vc.delete(this),super.disconnectedCallback&&super.disconnectedCallback()}},up=Yi(Ci(T1)),cp=Yi(Ci(M_)),dp=Yi(Ci(W2)),fp=Yi(Ci(Q2)),hp=Yi(Ci(uD));function Xc(){typeof window<"u"&&(customElements.get("vue-expedite-configurator")||customElements.define("vue-expedite-configurator",up),customElements.get("vue-expedite-gpt")||customElements.define("vue-expedite-gpt",cp),customElements.get("vue-expedite-catalog")||customElements.define("vue-expedite-catalog",dp),customElements.get("vue-expedite-cart")||customElements.define("vue-expedite-cart",fp),customElements.get("vue-expedite-ai-guidance")||customElements.define("vue-expedite-ai-guidance",hp))}typeof window<"u"&&Xc();const fD={register:Xc,applyThemeToShadows:Gc};typeof window<"u"&&(window.VueExpediteComponents=Object.assign(window.VueExpediteComponents||{},{applyThemeToShadows:Gc})),Cn.ExpediteAIGuidanceElement=hp,Cn.ExpediteCartElement=fp,Cn.ExpediteCatalogElement=dp,Cn.ExpediteConfiguratorElement=up,Cn.ExpediteGPTElement=cp,Cn.applyThemeToShadows=Gc,Cn.default=fD,Cn.registerWebComponents=Xc,Object.defineProperties(Cn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
187
+ `);return v=v.replace(/^[ \t]*•[ \t]+/gm,"- "),v};return(p,v)=>(F(),q("div",{class:Me(["chat-messages",{"root-path":u.value}])},[x("div",{class:"chat-gradient",style:Re({background:d.value})},null,4),x("div",{ref_key:"chatMessagesRef",ref:r,class:"messages-wrapper"},[(F(!0),q(De,null,Le([...e.messages],(g,_)=>{var b;return F(),q("div",{key:_,class:Me(["message",{"user-message":g.type==="user"}])},[x("div",nT,[g.name?(F(),q("div",rT,ke(g.name),1)):me("",!0),x("div",{class:Me(["message-text ect-relative",{"error-message":g.error,strikethrough:g.undone}]),style:Re(g.type==="user"?{color:m.value,backgroundColor:h.value}:{})},[x("div",oT,[pe(sp,{source:y(g.message)},null,8,["source"])]),((b=g==null?void 0:g.filesData)==null?void 0:b.length)>0?(F(!0),q(De,{key:0},Le(g==null?void 0:g.filesData,C=>(F(),Oe(eI,{key:C.name,info:{iconUrl:(C==null?void 0:C.type)==="csv"?Te(nh):Te(rh),fileName:C==null?void 0:C.name,fileSize:C==null?void 0:C.size},background:g.type=="user"?"#fff":"#f8f8f8","encoded-string":C==null?void 0:C.encodedString},null,8,["info","background","encoded-string"]))),128)):me("",!0)],6)])],2)}),128)),e.loadingMessage?(F(),q("div",{key:0,class:Me(["loading-message",{"thinking-message":Te(i).isThinkingMessage}])},[x("div",{class:Me(["ect-flex ect-gap-3",{"ect-w-full":Te(i).isThinkingMessage}])},[x("div",iT,[x("div",aT,[x("div",{ref_key:"loadingWindowRef",ref:o,class:"loading-window"},[x("div",sT,[pe(sp,{source:y(e.loadingMessage)},null,8,["source"])])],512)]),x("div",lT,[pe($i,{style:{height:"100%",width:"100%"}})])])],2)],2)):e.buttonLinks.length>0?(F(),q("div",uT,[pe(Ww,{links:e.buttonLinks,onPerformAction:f},null,8,["links"])])):me("",!0)],512)],2))}},[["__scopeId","data-v-4ae19744"]]),dT={class:"ai-upload ect-flex-inline ect-items-center"},fT=Ne({__name:"FileUpload",props:{resetFileInput:{type:Boolean,default:!1}},emits:["upload-status","error"],setup(e,{emit:n}){const t=e,r=n,o=G(null),i=G(""),a=G(""),s=G(!1);We(()=>t.resetFileInput,h=>{h&&o.value&&(o.value.value="",i.value="",a.value="")});const l=h=>{const m=o.value.accept.split(",").map(y=>y.trim().toLowerCase()),f="."+h.name.split(".").pop().toLowerCase();return m.includes(f)||m.includes(h.type.toLowerCase())?!0:m.some(y=>{if(y.includes("*")){const p=y.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 y=new Blob([f.target.result],{type:d.type});console.info("Blob data:",y);try{const p=await j3(y),v={attachment:{name:d.name,data:p}};console.info("AIRequestPayload = ",v),r("upload-status",{status:"uploaded",fileName:i.value,fileType:a.value,size:Af(d.size),fileData:v}),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)=>(F(),q("div",dT,[x("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),x("button",{class:"attachment-button",onClick:c,onMouseenter:d[0]||(d[0]=m=>s.value=!0),onMouseleave:d[1]||(d[1]=m=>s.value=!1)},[pe(Ge,{icon:"attachment",size:"11",height:"17",color:s.value?"#198708":"#828282"},null,8,["color"])],32)]))}},[["__scopeId","data-v-7fbbb7c9"]]),hT=["width","height","data-test-id"],pT=[yi('<g transform="translate(1 1)"><g fill="#57C046"><path d="M72.991 22.112v.119c0 .588-.051 1.162-.13 1.729h12.096c.049-.61.083-1.225.083-1.849v-.122c0-.432-.016-.861-.04-1.288H72.902c.052.466.089.934.089 1.411zM12.059 22.109v-.12c0-.435.027-.863.07-1.287H.05c-.03.466-.05.934-.05 1.407v.121c0 .583.029 1.158.073 1.729h12.136a12.162 12.162 0 0 1-.15-1.85z" vector-effect="non-scaling-stroke"></path></g><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="-737.86" y1="348.135" x2="-696.809" y2="348.135" gradientTransform="matrix(1 0 0 -1 737.86 359.283)" vector-effect="non-scaling-stroke"><stop offset=".3" style="stop-color:#57c046;"></stop><stop offset="1" style="stop-color:#1c8d0a;"></stop></linearGradient><path fill="url(#a)" d="M12.059 22.109v-.12c0-6.117 4.324-11.324 10.841-11.324 8.247 0 13.073 6.397 13.073 6.397l5.078-8.799C36.944 3.258 30.544.068 23.023.068 9.866.068 0 9.938 0 22.109v.121h12.065c-.001-.04-.006-.08-.006-.121z" vector-effect="non-scaling-stroke"></path><linearGradient id="b" gradientUnits="userSpaceOnUse" x1="-693.833" y1="326.091" x2="-652.825" y2="326.091" gradientTransform="matrix(1 0 0 -1 737.86 359.283)" vector-effect="non-scaling-stroke"><stop offset="0" style="stop-color:#1c8d0a;"></stop><stop offset=".7" style="stop-color:#57c046;"></stop></linearGradient><path fill="url(#b)" d="M72.991 22.23c0 6.117-4.32 11.325-10.831 11.325-8.238 0-13.062-6.399-13.062-6.399l-5.071 8.802c4.103 5.003 10.497 8.194 18.01 8.194 13.101 0 22.934-9.805 22.997-21.921l-12.043-.001z" vector-effect="non-scaling-stroke"></path><linearGradient id="c" gradientUnits="userSpaceOnUse" x1="-737.86" y1="337.172" x2="-652.822" y2="337.172" gradientTransform="matrix(1 0 0 -1 737.86 359.283)" vector-effect="non-scaling-stroke"><stop offset=".14" style="stop-color:#57c046;"></stop><stop offset=".37" style="stop-color:#97d952;"></stop><stop offset=".59" style="stop-color:#c3eb5b;"></stop><stop offset=".86" style="stop-color:#57c046;"></stop></linearGradient><path fill="url(#c)" d="m42.533 33.78.071-.028s9.631-16.844 10.384-18.051c2.378-3.72 5.028-5.034 9.05-5.034 6.511 0 10.952 5.329 10.952 11.445v.119h12.045c0-.04.003-.079.003-.119v-.122C85.038 9.819 75.303.072 62.161.072c-8.515 0-15.645 4.144-19.615 10.371l-.071.026s-9.641 16.845-10.394 18.052c-2.38 3.721-5.033 5.035-9.059 5.035-6.473 0-10.899-5.259-10.958-11.324H0c0 12.171 9.745 21.92 22.9 21.92 8.522-.001 15.659-4.147 19.633-10.372z" vector-effect="non-scaling-stroke"></path></g>',1)],mT={__name:"ExpediteLogo",props:{width:{type:Number,default:38},height:{type:Number,default:20},dataTestId:{type:String,default:""}},setup(e){return(n,t)=>(F(),q("svg",{xmlns:"http://www.w3.org/2000/svg",overflow:"visible",preserveAspectRatio:"none",viewBox:"0 0 87.04 46.221",width:e.width,height:e.height,"data-test-id":e.dataTestId,"xml:space":"preserve"},pT,8,hT))}},gT={key:0,class:"suggestions-container"},yT={key:0,class:"logo-section"},vT={class:"help-text-section"},bT={key:0,class:"help-text"},_T={key:1,class:"sub-help-text"},xT=["onClick"],CT={key:2,class:"suggestions-list"},ET=["onClick"],kT=Ne({__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:n}){const t=e,r=n,o=G(0),i=G(0),a=G(null),s=G(null),l=d=>{a.value=d,i.value=0},u=()=>{a.value=null,o.value=0},c=d=>{r("select",d)},h=d=>{if(t.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)%t.options.length,r("preview",t.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?t.options.length-1:o.value-1,r("preview",t.options[o.value].title));break;case"Enter":d.preventDefault(),a.value?c(a.value.subOptions[i.value]):l(t.options[o.value]);break;case"Escape":case"ArrowLeft":case"Backspace":a.value&&(d.preventDefault(),u());break}};return We(()=>t.showSuggestions,d=>{d?(window.addEventListener("keydown",h),a.value=null,o.value=0,i.value=0):window.removeEventListener("keydown",h)}),(d,m)=>e.showSuggestions?(F(),q("div",gT,[a.value?me("",!0):(F(),q("div",yT,[pe(mT)])),x("div",vT,[e.helpText&&!a.value?(F(),q("div",bT,ke(e.helpText),1)):me("",!0),e.subHelpText?(F(),q("div",_T,ke(e.subHelpText),1)):me("",!0)]),a.value?(F(),q("div",CT,[(F(!0),q(De,null,Le(a.value.subOptions,(f,y)=>(F(),q("div",{key:y,class:Me(["sub-option",{"sub-active":i.value===y}]),onClick:p=>c(f)},ke(f),11,ET))),128))])):(F(),q("div",{key:1,ref_key:"suggestionsList",ref:s,class:"suggestions-list"},[(F(!0),q(De,null,Le(e.options,(f,y)=>(F(),q("div",{key:y,class:Me(["suggestion-item",{active:o.value===y}]),onClick:p=>l(f)},ke(f.title),11,xT))),128))],512))])):me("",!0)}},[["__scopeId","data-v-bbb514b3"]]),AT={class:"chat-file-info"},wT={class:"ect-flex ect-gap-2 ect-items-center ect-self-stretch ect-my-auto ect-text-xs ect-font-medium ect-text-black"},IT=["src"],ST={class:"ect-self-stretch ect-my-auto"},OT={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"},TT=Ne({__name:"ChatInputFileInfo",props:{fileInfo:{type:Object,required:!0}},emits:["cancel"],setup(e,{emit:n}){const t=n,r=()=>{t("cancel")};return(o,i)=>(F(),q("div",AT,[x("div",wT,[x("img",{loading:"lazy",src:e.fileInfo.fileType==="csv"?Te(nh):Te(rh),class:"ect-object-contain ect-shrink-0 ect-self-stretch ect-my-auto ect-w-7 ect-aspect-square",alt:""},null,8,IT),x("div",ST,ke(e.fileInfo.fileName),1)]),e.fileInfo.status==="uploading"?(F(),q("div",OT,[pe(cu,{size:18})])):me("",!0),e.fileInfo.status==="uploaded"?(F(),q("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},[pe(Ge,{icon:"close",size:"8"})])):me("",!0)]))}},[["__scopeId","data-v-24d881bd"]]),DT={class:"chat-input-wrapper"},RT={class:"chat-input-inner"},MT={class:"input-row"},FT=["disabled","placeholder","onKeydown"],BT={key:1,class:"icon-wrapper"},NT={class:"icon-wrapper"},LT=Ne({__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:n}){const t=e,r=n;Co();const o=wn(),i=Ho(),a=G({}),s=G(!1),l=G(!1),u=G(t.modelValue),c=G(null),h=be(()=>{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 w=(Array.isArray(I==null?void 0:I.relatedPG)?I.relatedPG:[]).slice().sort((T,P)=>Number((T==null?void 0:T.sequenceNumber)??0)-Number((P==null?void 0:P.sequenceNumber)??0)).map(T=>T.pgName);return{title:I.pgName,subOptions:w}})}),d=be(()=>{var E;return(E=h.value)!=null&&E.length?h.value:[]}),m=be(()=>{var E;return(E=h.value)!=null&&E.length?"Prompt Guidance":t.helpText});We(()=>t.loading,async(E,S)=>{!E&&S&&(await Dt(),c.value.focus())}),We(u,E=>{r("update:modelValue",E),Dt(()=>b())}),We(()=>t.modelValue,E=>{u.value=E});const f=E=>{console.info("[ERROR]: File upload error:",E),o.handleError(E,"ChatInput")},y=()=>{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,Dt(()=>{b(),c.value&&(c.value.focus(),c.value.selectionStart=c.value.selectionEnd=u.value.length)})},v=E=>{u.value=E,Dt(()=>b())},g=()=>{l.value=!1},_=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`},C=()=>{console.info("removeFile"),a.value=null,s.value=!0,r("file-upload-status",null),setTimeout(()=>{s.value=!1},100)},A=()=>{l.value=!1,b()};return(E,S)=>{var I,k,w,T,P;const D=nd("click-outside");return An((F(),q("div",DT,[pe(kT,{options:d.value,"help-text":m.value,"sub-help-text":e.subHelpText,"show-suggestions":l.value,onSelect:p,onPreview:v},null,8,["options","help-text","sub-help-text","show-suggestions"]),x("div",RT,[x("div",MT,[x("div",{class:Me(["icon-wrapper",{"active-suggestions":l.value,disabled:((I=d.value)==null?void 0:I.length)<=0}])},[pe(Ge,{disabled:((k=d.value)==null?void 0:k.length)<=0||e.loading,color:((w=d.value)==null?void 0:w.length)<=0?"#DEDEDE":l.value?"#198708":"#828282",icon:"suggestions",size:"13",height:15,onClick:S[0]||(S[0]=X=>l.value=!l.value)},null,8,["disabled","color"])],2),An(x("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":S[1]||(S[1]=X=>u.value=X),disabled:e.loading,placeholder:e.placeholder,rows:"1",onKeydown:Hn(kt(y,["exact","prevent"]),["enter"]),onInput:A},null,40,FT),[[po,u.value]]),e.showFile?(F(),q("div",{key:0,class:Me(["icon-wrapper",{"file-upload-disabled":e.loading}])},[pe(fT,{"reset-file-input":s.value,onUploadStatus:_,onError:f},null,8,["reset-file-input"])],2)):me("",!0),e.showMic?(F(),q("div",BT,[pe(Ge,{color:"#828282",disabled:e.loading,icon:"mic",size:"13",height:15,onClick:S[2]||(S[2]=X=>E.$emit("speak"))},null,8,["disabled"])])):me("",!0),x("div",NT,[(F(),Oe(Ge,{key:1,disabled:e.loading,icon:"send",size:"20",onClick:y},null,8,["disabled"]))])]),((T=a.value)==null?void 0:T.status)==="uploading"||((P=a.value)==null?void 0:P.status)==="uploaded"?(F(),Oe(TT,{key:0,class:"ect-mt-3 ect-mb-0.5","file-info":a.value,onCancel:C},null,8,["file-info"])):me("",!0)])])),[[D,g]])}}},[["__scopeId","data-v-e205d71c"]]),PT=["data-test-id"],qT=["data-test-id"],$T=["data-test-id"],UT=Ne({__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"}},emits:["component-action"],setup(e,{emit:n}){const t=Ho(),r=n,o=Co(),i=G(null),a=be(()=>{var h;return((h=t.getCurrentStepLinks)==null?void 0:h.call(t))||[]}),s=be(()=>!0),l=h=>{console.info("[aiChat] handleSubmit",{hasFileData:!!i.value,messageLength:(h||"").length}),i.value?(console.info("[aiChat] sending with file attachment"),o.sendMessage(h,!0,i.value)):(console.info("[aiChat] sending without attachment"),o.sendMessage(h))},u=h=>{console.info("ChatScreen handleFileUploadStatus event = ",h),h!=null&&h.fileData?(i.value=h.fileData,o.attachmentData={size:h.size,type:h.fileType,name:h.fileName}):(i.value=null,o.attachmentData=null)},c=h=>{r("component-action",h)};return(h,d)=>(F(),q("div",{class:"chat-screen","data-test-id":e.dataTestId},[x("div",{class:Me(["messages-container",{"playbook-steps-mode-hybrid":Te(t).playbookStepsMode==="hybrid","playbook-steps-mode-full":Te(t).playbookStepsMode==="full","dxp-guiddance":e.isExternalGuidance}]),style:Re({maxHeight:`calc(${e.styles.height} - 72px)`,height:`calc(${e.styles.height} - 72px)`}),"data-test-id":`${e.dataTestId}-messages-container`},[pe(cT,{messages:Te(o).chatHistory,"loading-message":Te(o).loadingMessage,"undo-id":Te(o).latestDMLRequest,"button-links":a.value,"strikethrough-ids":Te(o).strikethroughHistory,"data-changed":Te(o).dataManuallyChanged,"data-test-id":`${e.dataTestId}-messages`,onComponentAction:c},null,8,["messages","loading-message","undo-id","button-links","strikethrough-ids","data-changed","data-test-id"])],14,qT),x("div",{class:"input-container","data-test-id":`${e.dataTestId}-input-container`},[pe(LT,{modelValue:Te(o).promptMessage,"onUpdate:modelValue":d[0]||(d[0]=m=>Te(o).promptMessage=m),disabled:!s.value,"file-info":i.value,loading:!!Te(o).loadingMessage,"data-test-id":`${e.dataTestId}-input`,onSubmit:l,onFileUploadStatus:u},null,8,["modelValue","disabled","file-info","loading","data-test-id"])],8,$T)],8,PT))}},[["__scopeId","data-v-dcfc28bd"]]),jT={class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center","data-test-id":"configurator-not-found"},HT={class:"ect-max-w-[720px] ect-p-[50px] ect-border ect-rounded-lg ect-bg-white ect-shadow-sm"},VT={class:"ect-text-[40px] ect-leading-none ect-mb-3"},zT=x("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),KT=x("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),GT={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(n,t)=>(F(),q("div",jT,[x("div",HT,[x("div",VT,[pe(Ge,{icon:"error",size:48})]),zT,KT,x("div",GT,[x("button",{type:"button",class:"ect-text-green-600 ect-text-sm ect-font-medium",onClick:t[0]||(t[0]=r=>n.$emit("return")),"data-test-id":"configurator-not-found-return"}," RETURN TO PRODUCT RESULTS "),x("button",{type:"button",class:"ect-text-green-600 ect-text-sm ect-font-medium",onClick:t[1]||(t[1]=r=>n.$emit("go-cart")),"data-test-id":"configurator-not-found-go-to-cart"}," GO TO CART ")])])]))}},lp=e=>(Qt("data-v-bf75aa89"),e=e(),Zt(),e),WT={class:"ect-h-full ect-w-full ect-bg-white","data-test-id":"aiComponentLoader-wrapper"},QT={key:2,class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center","data-test-id":"aiComponentLoader-cart-error"},ZT=[lp(()=>x("div",{class:"ect-text-center"},[x("div",{class:"ect-text-base ect-font-medium ect-text-red-600","data-test-id":"aiComponentLoader-cart-error-title"}," Quote Required "),x("div",{class:"ect-text-sm ect-text-gray-500 ect-mt-2","data-test-id":"aiComponentLoader-cart-error-message"}," A quote is required for the cart component to work. Please ensure a quoteId is provided in the session prop. ")],-1))],JT={key:5,class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center"},YT={class:"ect-text-center"},eD=lp(()=>x("div",{class:"ect-text-base ect-font-medium","data-test-id":"aiComponentLoader-fallback-title"}," No component to display for this step ",-1)),tD={class:"ect-text-sm ect-text-gray-500 ect-mt-2","data-test-id":"aiComponentLoader-fallback-subtitle"},nD=Ne({__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:""},functions:{type:Object,default:()=>({})},resources:{type:Object,required:!1}},emits:["expeditecart-clicked","ai-guidance:error","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:n}){const t=n,r=e,o=Ho(),i=mc(),a=Ht(),s=be(()=>{var W,Q,ae,fe,K;const j=((W=r.session)==null?void 0:W.quoteId)||((Q=a.quoteId)==null?void 0:Q.value)||((ae=o==null?void 0:o.activeComponentData)==null?void 0:ae.contextObjectId)||((K=(fe=o==null?void 0:o.activeComponentData)==null?void 0:fe.payload)==null?void 0:K.contextObjectId);return{...r.session,...j&&{quoteId:j},qliId:p.value||r.configQliId||void 0,itemId:y.value}}),l=be(()=>{const j=r.functions||{},W=j.createQuote;return typeof W!="function"?j:{...j,createQuote:async(...Q)=>{const ae=await W(...Q);return ae&&a.updateConfig({quoteId:ae}),ae}}}),u=be(()=>{const j=o==null?void 0:o.activeComponentKey,W=r.stepComponent;return(j||W||"").toString().trim().toLowerCase().replace(/[^a-z0-9]+/g,"_")}),c=be(()=>{var fe,K;const j=!!r.templateId,W=!!((fe=r.identity)!=null&&fe.organizationId),Q=!!((K=r.identity)!=null&&K.accountId),ae=typeof r.cartSections=="string"&&r.cartSections.length>0;return j&&W&&Q&&ae}),h=be(()=>{var ae,fe,K,V,te;const j=(ae=r.session)==null?void 0:ae.quoteId,W=(fe=a.quoteId)==null?void 0:fe.value,Q=((K=o==null?void 0:o.activeComponentData)==null?void 0:K.contextObjectId)||((te=(V=o==null?void 0:o.activeComponentData)==null?void 0:V.payload)==null?void 0:te.contextObjectId);return!!(j||W||Q)}),d=be(()=>{var W,Q,ae,fe,K;const j=((W=r.session)==null?void 0:W.quoteId)||((Q=a.quoteId)==null?void 0:Q.value)||((ae=o==null?void 0:o.activeComponentData)==null?void 0:ae.contextObjectId)||((K=(fe=o==null?void 0:o.activeComponentData)==null?void 0:fe.payload)==null?void 0:K.contextObjectId);return{...r.session,...j&&{quoteId:j}}}),m=be(()=>{var W;if(Array.isArray(r.catalogInitialData)&&r.catalogInitialData.length>0)return r.catalogInitialData;const j=((W=o==null?void 0:o.activeComponentData)==null?void 0:W.payload)||{};if(j.catalog&&typeof j.catalog=="object")try{const ae=Object.values(j.catalog).map(fe=>{var K;return(K=fe==null?void 0:fe.catalogResponse)==null?void 0:K.productInfo}).filter(Boolean);if(ae.length>0)return ae}catch{}return Array.isArray(j.initialData)&&j.initialData.length>0?j.initialData:Array.isArray(j.catalogInitialData)&&j.catalogInitialData.length>0?j.catalogInitialData:Array.isArray(j.items)&&j.items.length>0?j.items:[]}),f=be(()=>{var W;const j=((W=o==null?void 0:o.activeComponentData)==null?void 0:W.payload)||{};return r.catalogSearchTerm||j.searchTerm||""}),y=be(()=>{var Q,ae,fe,K,V,te,oe,le;const j=(fe=(ae=(Q=o==null?void 0:o.activeComponentData)==null?void 0:Q.payload)==null?void 0:ae.productConfiguration)==null?void 0:fe[0],W=((oe=(te=(V=(K=o==null?void 0:o.activeComponentData)==null?void 0:K.payload)==null?void 0:V.savedProducts)==null?void 0:te[0])==null?void 0:oe.itemId)||(j==null?void 0:j.itemId)||((le=j==null?void 0:j.product)==null?void 0:le.itemId)||"";return r.configItemId||W||""}),p=be(()=>{var W,Q,ae,fe,K,V;const j=(fe=(ae=(Q=(W=o==null?void 0:o.activeComponentData)==null?void 0:W.payload)==null?void 0:Q.savedProducts)==null?void 0:ae[0])==null?void 0:fe.qliId;if(!j){const te=(V=(K=o==null?void 0:o.activeComponentData)==null?void 0:K.payload)==null?void 0:V.productConfiguration,oe=Array.isArray(te)&&te.length>0?te[0]:null;if(oe){const le=oe==null?void 0:oe.product;if(le!=null&&le.qliId)return le.qliId;if(oe!=null&&oe.qliId)return oe.qliId}}return j||""}),v=be(()=>!!y.value),g=be(()=>u.value==="configurator"&&!v.value?"Configurator requires an itemId (and optional qliId). Provide via playbook payload or props.":u.value==="catalog"?"Catalog step is active. Provide templateId/sections/theme when available.":u.value==="cart"?"Cart step is active.":"Awaiting playbook step selection."),_=be(()=>{try{return JSON.stringify((o==null?void 0:o.activeComponentData)||{})}catch{return""}}),b=be(()=>`catalog::${_.value}`),C=be(()=>`cart::${_.value}`),A=be(()=>{var j;try{return(((j=o==null?void 0:o.activeComponentData)==null?void 0:j.actionFunction)||"")==="Reload"}catch{return!1}}),E=be(()=>{var W;const j=`configurator::${y.value||""}::${p.value||""}`;if(A.value){const Q=((W=o==null?void 0:o.activeComponentData)==null?void 0:W.requestId)||"";return`${j}::${Q}`}return j}),{emitError:S,emitErrors:D}=th(t,"aiComponentLoader"),I=()=>{const j=$w(o,u.value);D(j)},k=G([]),w=G(null),T=j=>{const W=Array.isArray(j)?j:Array.isArray(j==null?void 0:j.items)?j.items:[];if(!Array.isArray(W))return;const Q={"Needs Configuration":1,"Suggests Configuration":2,"Fully Configured":3},ae=V=>(V==null?void 0:V.requiresConfiguration)||"",fe=V=>!!V&&V in Q,K=W.filter(V=>fe(ae(V)));K.sort((V,te)=>{const oe=ae(V),le=ae(te);return(Q[oe]||99)-(Q[le]||99)}),k.value=K,w.value=K.length?K[0]:null},P=j=>{console.log("onQuoteCreated",j),t("catalog-quote-created",j)},X=j=>{console.log("onQuoteUpdated",j),t("catalog-quote-updated",j)},$=j=>{console.log("onItemAdded",j),t("catalog-item-added",j)},J=j=>{console.log("onItemQtyUpdated",j),t("catalog-item-qty-updated",j)},ee=j=>{console.log("onLineDeleted",j),t("catalog-line-deleted",j)},Y=j=>{console.log("onQuoteItemsFetched",j),t("catalog-items-fetched",j)};We(()=>u.value,(j,W)=>{var Q,ae,fe,K,V,te,oe,le,ne,de;if(j==="configurator"){const ve=!!((fe=(ae=(Q=o==null?void 0:o.activeComponentData)==null?void 0:Q.payload)==null?void 0:ae.savedProducts)!=null&&fe.length),xe=((te=(V=(K=o==null?void 0:o.activeComponentData)==null?void 0:K.payload)==null?void 0:V.productConfiguration)==null?void 0:te.length)>0;if(!ve&&!xe&&w.value&&!y.value){const ce=((oe=w.value)==null?void 0:oe.itemId)||"";if(ce){const re=((le=o==null?void 0:o.currentPlaybook)==null?void 0:le.playBookSteps)||[],ue=ye=>String(ye||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_");let Ce=null;const Ie=re.findIndex(ye=>ye.stepName===(o==null?void 0:o.currentStepName));if(Ie>=0&&re[Ie+1]&&ue((ne=re[Ie+1])==null?void 0:ne.stepComponent)==="configurator")Ce=re[Ie+1].stepName;else{const ye=re.findIndex(Ee=>ue(Ee==null?void 0:Ee.stepComponent)==="configurator");Ce=ye>=0?(de=re[ye])==null?void 0:de.stepName:null}const ie={payload:{savedProducts:[{itemId:ce}]}};Ce?o.navigateToStep({stepName:Ce,data:ie}):o.loadComponent("configurator",ie)}}}});const U=()=>{var ae,fe;const j=((ae=o==null?void 0:o.currentPlaybook)==null?void 0:ae.playBookSteps)||[],W=K=>String(K||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),Q=j.findIndex(K=>W(K==null?void 0:K.stepComponent)==="catalog"||W(K==null?void 0:K.stepName).includes("catalog"));if(Q>=0){const K=(fe=j[Q])==null?void 0:fe.stepName;o.navigateToStep({stepName:K})}else o.loadComponent("catalog")},O=()=>{var ae,fe;const j=((ae=o==null?void 0:o.currentPlaybook)==null?void 0:ae.playBookSteps)||[],W=K=>String(K||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),Q=j.findIndex(K=>W(K==null?void 0:K.stepComponent)==="cart"||W(K==null?void 0:K.stepName).includes("cart"));if(Q>=0){const K=(fe=j[Q])==null?void 0:fe.stepName;o.navigateToStep({stepName:K})}else o.loadComponent("cart")},R=j=>{var W,Q;console.log("onItemConfigureClicked",j),t("catalog-item-configure",j);try{const ae=(j==null?void 0:j.itemId)||"",fe=(j==null?void 0:j.qliId)||(j==null?void 0:j.QliId)||"",K=[];if(ae){const ne={itemId:ae};fe&&(ne.qliId=fe),K.push(ne)}const V={payload:{savedProducts:K}},te=((W=o==null?void 0:o.currentPlaybook)==null?void 0:W.playBookSteps)||[],oe=ne=>String(ne||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),le=te.findIndex(ne=>{const de=oe(ne==null?void 0:ne.stepComponent),ve=oe(ne==null?void 0:ne.stepName);return de==="configurator"||ve.includes("configure")});if(le>=0){const ne=(Q=te[le])==null?void 0:Q.stepName;o.navigateToStep({stepName:ne,data:V})}else o.loadComponent("configurator",V)}catch(ae){console.warn("[aiComponentLoader] Failed to navigate to configurator from configure click:",ae),o.loadComponent("configurator",{payload:{}})}},M=j=>{console.log("onCartClicked",j),t("expeditecart-clicked",j)},N=j=>{var W,Q;try{const ae=(j==null?void 0:j.itemId)||"",fe=(j==null?void 0:j.lineItemId)||(j==null?void 0:j.qliId)||"",K=[];if(ae){const ne={itemId:ae};fe&&(ne.qliId=fe),K.push(ne)}const V={payload:{savedProducts:K}},te=((W=o==null?void 0:o.currentPlaybook)==null?void 0:W.playBookSteps)||[],oe=ne=>String(ne||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),le=te.findIndex(ne=>{const de=oe(ne==null?void 0:ne.stepComponent),ve=oe(ne==null?void 0:ne.stepName);return de==="configurator"||ve.includes("configure")});if(le>=0){const ne=(Q=te[le])==null?void 0:Q.stepName;o.navigateToStep({stepName:ne,data:V})}else o.loadComponent("configurator",V)}catch(ae){console.warn("[aiComponentLoader] Failed to navigate to configurator from cart configure click:",ae),o.loadComponent("configurator",{payload:{}})}},H=j=>{console.log("onCatalogIdReceived",j),a.updateConfig({eCatalogId:j})},L=j=>{console.log("Action",j),j.event==="add-to-quote"?t("configurator:add-to-quote",j.data):j.event==="save"&&t("configurator:save",j.data)},z=G("");return We(()=>o==null?void 0:o.activeComponentData,async j=>{var Q,ae,fe,K;if(!j)return;console.log("activeComponentData Changed",j);const W=(j==null?void 0:j.requestId)||"";if(console.log("requestId",W),console.log("lastReloadRequestId",z.value),W&&W!==z.value)if(z.value=W,await Dt(),((ae=(Q=j==null?void 0:j.payload)==null?void 0:Q.productConfiguration)==null?void 0:ae.length)>0){const V=(fe=j==null?void 0:j.payload)==null?void 0:fe.productConfiguration[0],te=(V==null?void 0:V.itemId)||((K=V==null?void 0:V.product)==null?void 0:K.itemId)||"";i.setPreConfigData(j==null?void 0:j.payload,te)}else(j==null?void 0:j.actionFunction)==="Reload"&&(console.log("Reloading configurator 1"),i.refresh())},{deep:!0}),Et(()=>{Dt(()=>{I()})}),(j,W)=>(F(),q("div",WT,[u.value==="catalog"?(F(),Oe(W2,{key:b.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":f.value,"on-catalog-count-update":e.onCatalogCountUpdate,"preview-data":e.catalogPreviewData,"initial-data":m.value,sections:e.sections,theme:e.theme,"composables-org-type":e.composablesOrgType,onCatalogQuoteCreated:P,onCatalogQuoteUpdated:X,onCatalogItemsLoaded:T,onCatalogItemAdded:$,onCatalogItemQtyUpdated:J,onCatalogLineDeleted:ee,onCatalogItemsFetched:Y,onCatalogItemConfigure:R,"onCatalog:id":H},null,8,["template-id","identity","session","security","search-term","on-catalog-count-update","preview-data","initial-data","sections","theme","composables-org-type"])):u.value==="cart"&&c.value&&h.value?(F(),Oe(Q2,{key:C.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:d.value,onExpeditecartItemConfigure:N,onExpeditecartClicked:M},null,8,["template-id","host-name","composables-org-type","security","identity","session"])):u.value==="cart"&&c.value&&!h.value?(F(),q("div",QT,ZT)):u.value==="configurator"&&v.value?(F(),Oe(T1,{key:E.value,"data-test-id":"aiComponentLoader-configurator",class:"ect-h-full ect-w-full",security:e.security,identity:e.identity,resources:e.resources,"user-locale":j.userLocale,cart:!0,"composables-org-type":e.composablesOrgType,session:s.value,functions:l.value,onReady:Te(i).setExpediteConfigComp,onAction:L},null,8,["security","identity","resources","user-locale","composables-org-type","session","functions","onReady"])):u.value==="configurator"&&!v.value?(F(),Oe(XT,{key:4,onReturn:U,onGoCart:O})):(F(),q("div",JT,[x("div",YT,[eD,x("div",tD,ke(g.value),1)])]))]))}},[["__scopeId","data-v-bf75aa89"]]),rD={class:"ai-guidance-loader","data-test-id":"aiGuidance-loader-container"},oD={"data-test-id":"aiGuidance-loader-text"},iD={class:"aig-button","data-test-id":"aiGuidance-loader-button"},aD={class:"aig-input-box","data-test-id":"aiGuidance-loader-input"},sD=Ne({__name:"AiGuidanceLoader",props:{errors:{type:Array,required:!1,default:()=>[]},chatBgColor:{type:String,required:!1,default:""}},setup(e){const n=e,t=be(()=>`linear-gradient(180deg, ${n.chatBgColor} 0%, transparent 100%)`);return(r,o)=>(F(),q(De,null,[x("div",{class:"chat-gradient",style:Re({background:t.value})},null,4),x("div",rD,[x("div",oD,[pe($i,{style:{width:"100%",height:"16px","margin-bottom":"8px"}}),pe($i,{style:{width:"100%",height:"16px","margin-bottom":"32px","max-width":"481px"}})]),x("div",iD,[pe($i,{style:{width:"100%",height:"24px"}})]),(F(!0),q(De,null,Le(e.errors,i=>(F(),q("div",{key:i,class:"aig-message-error","data-test-id":"aiGuidance-loader-error"},ke(i),1))),128)),x("div",aD,[pe($i,{style:{height:"36px",width:"100%"}})])])],64))}},[["__scopeId","data-v-5e4a9913"]]),lD={class:"ai-guidance-wrapper","data-test-id":"aiGuidance-wrapper"},uD=Ne({__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:()=>({})},functions:{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"},resources:{type:Object,required:!1,default:()=>({})}},emits:["expeditecart-item-configure","expeditecart-clicked","component-action","ai-response:success","quote-id:updated","ai-guidance:error"],setup(e,{emit:n}){const t=Ho(),r=Ht(),o=Co(),i=Fi(),a=n,s=G(!0),l=G(!1),u=G(!0),c=G(!0),h=G(!1),d=G([]),{emitError:m,emitErrors:f}=th(a,"aiGuidance"),y=e,{composablesOrgType:p,websocketUrl:v,packageVersion:g,identity:_,session:b,security:C,functions:A,templateId:E,hostName:S,graphqlEndpoint:D,apiKey:I,isPreview:k,catalogSections:w,cartSections:T,theme:P}=y,X=be(()=>{var N,H,L;return{...y.session||{},quoteId:((N=y.session)==null?void 0:N.quoteId)||(((H=r.quoteId)==null?void 0:H.value)??""),eCatalogId:(L=r.eCatalogId)==null?void 0:L.value}});Jt(async()=>{var N;console.log("security",C),console.log("apiKey",I),r.updateConfig({userId:_==null?void 0:_.userId,organizationId:_==null?void 0:_.organizationId,accessToken:C==null?void 0:C.accessToken,composablesApiUrl:C==null?void 0:C.baseUrl,composablesOrgType:p,websocketUrl:v,quoteId:b==null?void 0:b.quoteId,packageVersion:g,accountId:_==null?void 0:_.accountId,templateId:E,hostName:S,graphqlEndpoint:D,apiKey:(C==null?void 0:C.apiKey)||I,cid:_==null?void 0:_.contactId,isPreview:k,siteUrl:(N=y.resources)==null?void 0:N.siteUrl})}),Et(async()=>{var W,Q,ae,fe;const N=Pw(y,_,C);f(N);const H=eh(v);if(H&&m(H),N.length>0||H){s.value=!1;return}t.setSecretKey(C==null?void 0:C.accessToken);let L=null,z,j;try{L=await t.getPlaybookInfoFromQuote(),z=(L==null?void 0:L.XX_ORD1__Completed_PB_Step_Number_EX__c)??void 0,j=(L==null?void 0:L.XX_ORD1__Playbook_Current_Step_Meta_EX__c)??void 0}catch(K){console.error("[aiGuidance] Failed to get playbook info from quote:",K),m("AI_GUIDANCE_PLAYBOOK_INFO_FETCH_FAILED",{error:K.message})}if(j)try{j=JSON.parse(j)}catch(K){console.error("[aiGuidance] Failed to parse currentStepMetaServer:",K),m("AI_GUIDANCE_JSON_PARSE_ERROR",{error:K.message,data:"currentStepMetaServer"}),j=void 0}if(console.info("sequenceNumberServer = ",z),y.templateId){s.value=!0;try{const V=await t.getCatalogInContext();console.log("catalogInContext = ",V),V&&r.updateConfig({eCatalogId:V})}catch(V){console.error("[aiGuidance] Failed to get catalog in context:",V),m("AI_GUIDANCE_CATALOG_FETCH_FAILED",{error:V.message})}let K=null;try{await i.fetchBlockInformationREST({templateId:y.templateId});const V=qw(i.pageBlocks);K=V.playbookId,V.error&&m(V.error,{error:"Block structure validation failed"}),K||m("AI_GUIDANCE_BLOCK_PLAYBOOK_ID_MISSING",{pageBlocks:i.pageBlocks})}catch(V){console.error("[aiGuidance] Failed to fetch block information:",V),m("AI_GUIDANCE_BLOCK_FETCH_FAILED",{error:V.message})}if(console.log("playbookID",K),K?l.value=!0:d.value.push("No playbook ID found in template"),t.setEmbeddedMode(!0),K)try{t.currentPlaybook=K,await t.getPlaybookByKey(K),t.showPlaybookSteps=!0}catch(V){console.error("[aiGuidance] Failed to get playbook by key:",V),m("AI_GUIDANCE_PLAYBOOK_FETCH_FAILED",{error:V.message,playbookID:K})}t.playbookStepsMode="full",o.setInitialPayload();try{await o.connectSocket()}catch(V){console.error("[aiGuidance] Failed to connect socket:",V),m("WEBSOCKET_CONNECTION_FAILED",{error:V.message})}if(z!==void 0){t.navigateToStep({stepName:(Q=(W=t.currentPlaybook)==null?void 0:W.playBookSteps[Number(z)])==null?void 0:Q.stepName,data:j}),s.value=!1;return}(fe=(ae=t.currentPlaybook)==null?void 0:ae.playBookSteps)!=null&&fe.length&&t.setCurrentStepName(t.currentPlaybook.playBookSteps[0].stepName),s.value=!1}else d.value.push("templateId is required")});const $=be(()=>{var L;const N=((L=t.currentPlaybook)==null?void 0:L.playBookSteps)||[],H=t.currentStepName;return N.find(z=>z.stepName===H)||N[0]||null}),J=be(()=>{var N;return((N=$.value)==null?void 0:N.stepComponent)||null});We(()=>t.activeComponentKey,N=>{N&&(u.value=!1)});const ee=[];Et(()=>{ee.push(Sn("expeditecart:configure-clicked",N=>{a("expeditecart-item-configure",N)})),ee.push(Sn("expeditecart:clicked",N=>{a("expeditecart-clicked",N)})),ee.push(Sn("ai-response:success",N=>{try{a("ai-response:success",N)}catch{}})),ee.push(Sn("quote-id:updated",N=>{try{a("quote-id:updated",N)}catch(H){console.info("[aiGuidance] Error emitting quote-id:updated event:",H)}})),ee.push(Sn("websocket:error",N=>{try{N!=null&&N.isInitialization&&m(N.errorCode||"WEBSOCKET_CONNECTION_FAILED",N)}catch(H){console.info("[aiGuidance] Error handling websocket error event:",H)}}))});const Y=N=>{console.log("[aiGuidance] Received error from aiComponentLoader:",N),a("ai-guidance:error",N)},U=N=>{console.log("onExpediteCartClicked",N),a("component-action",{component:"cart",details:N})},O=(N,H)=>{var z;a("component-action",{component:"catalog",action:N,details:H});const L=(H==null?void 0:H.quoteId)??((z=H==null?void 0:H.response)==null?void 0:z.quoteId);if(L&&(N==="item-added"||N==="items-fetched"))try{a("quote-id:updated",{quoteId:L})}catch(j){console.info("[aiGuidance] Error emitting quote-id:updated from catalog event:",j)}},R=(N,H)=>{a("component-action",{component:"configurator",action:N,details:H})},M=N=>{a("component-action",N)};return tr(()=>{try{o.cancelRequest()}catch{}try{o.disconnectSocket()}catch{}try{o.resetState()}catch{}try{t.setEmbeddedMode(!1),t.currentPlaybook=null,t.currentStepName=null,t.activeComponentKey=null,t.activeComponentData=null,t.showPlaybookSteps=!1,t.playbookStepsMode="full"}catch{}s.value=!1,l.value=!1,u.value=!0,c.value=!0,h.value=!1,d.value=[],ee.forEach(N=>{try{N()}catch{}})}),(N,H)=>{var L;return F(),q("div",lD,[pe(uu,{icon:"logo",color:"#000000",size:"18.75",height:"16.25"}),s.value||Te(o).isFetchingHistory?(F(),Oe(sD,{key:0,errors:d.value,"data-test-id":"aiGuidance-loader"},null,8,["errors"])):(F(),q("div",{key:1,class:Me(["ai-app",{"root-path":u.value,"playbook-steps-mode-full":Te(t).playbookStepsMode==="full","dxp-guiddance":l.value}]),style:Re(e.styles)},[x("div",{class:"ai-app-chat-wrapper",style:Re({height:e.styles.height})},[pe(UT,{"data-test-id":"chat-screen","is-external-guidance":l.value,styles:e.styles,onComponentAction:M},null,8,["is-external-guidance","styles"])],4),!u.value&&c.value&&!h.value?(F(),q("div",{key:0,class:"component-loader-wrapper",style:Re({height:e.styles.height,maxHeight:e.styles.height})},[Te(t).currentPlaybook?(F(),Oe(nD,{key:0,"template-id":((L=$.value)==null?void 0:L.templateId)||Te(E),"step-component":J.value,identity:Te(_),session:X.value,security:Te(C),functions:Te(A),"composables-org-type":Te(p),"package-version":Te(g),"host-name":Te(S),"graphql-endpoint":Te(D),"api-key":Te(I),"is-preview":Te(k),sections:Te(w),"cart-sections":Te(T),theme:Te(P),resources:e.resources,"data-test-id":"aiComponentLoader-mounted",onExpeditecartClicked:U,onCatalogQuoteCreated:H[0]||(H[0]=z=>O("quote-created",z)),onCatalogQuoteUpdated:H[1]||(H[1]=z=>O("quote-updated",z)),onCatalogItemsLoaded:H[2]||(H[2]=z=>O("items-loaded",z)),onCatalogItemAdded:H[3]||(H[3]=z=>O("item-added",z)),onCatalogItemQtyUpdated:H[4]||(H[4]=z=>O("item-qty-updated",z)),onCatalogLineDeleted:H[5]||(H[5]=z=>O("line-deleted",z)),onCatalogItemsFetched:H[6]||(H[6]=z=>O("items-fetched",z)),onCatalogItemConfigure:H[7]||(H[7]=z=>O("item-configure",z)),"onConfigurator:addToQuote":H[8]||(H[8]=z=>R("add-to-quote",z)),"onConfigurator:save":H[9]||(H[9]=z=>R("save",z)),"onAiGuidance:error":Y},null,8,["template-id","step-component","identity","session","security","functions","composables-org-type","package-version","host-name","graphql-endpoint","api-key","is-preview","sections","cart-sections","theme","resources"])):me("",!0)],4)):me("",!0)],6))])}}},[["__scopeId","data-v-7835e48c"]]);let Ns=null;if(typeof window<"u"){try{Ns=J6()}catch{}Ns||(Ns=Y6(),Ei(Ns))}let Ls=null,Ps=null;const Vc=new Set;let Eo=null;const zc=new Map;async function cD(e){if(!e)return"";if(zc.has(e))return zc.get(e);try{const n=await fetch(e,{credentials:"omit",cache:"no-cache"});if(n.ok){const t=await n.text();return zc.set(e,t),t}}catch(n){console.warn("[ExpediteComponents] Failed to fetch theme CSS:",n)}return""}async function Kc(e,n){if(!e||!n)return;const t=e.querySelector("style[data-vue-expedite-theme]");t&&t.remove();try{const r=await cD(n);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 Gc(e){Eo=e||null,Eo&&Vc.forEach(n=>{n&&n.shadowRoot&&Kc(n.shadowRoot,Eo)})}async function dD(){return Ls||Ps||(Ps=(async()=>{try{const e=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Or&&Or.src||new URL("vue-expedite-components.umd.cjs",document.baseURI).href).href,n=await fetch(e);if(n.ok)return Ls=await n.text(),Ls}catch(e){console.warn("[ExpediteComponents] Failed to load CSS:",e)}return null})(),Ps)}const Yi=e=>class extends e{async connectedCallback(){if(super.connectedCallback&&super.connectedCallback(),Vc.add(this),!!this.shadowRoot){if(this.shadowRoot.querySelector("style[data-vue-expedite-style]")){Eo&&Kc(this.shadowRoot,Eo);return}try{const n=await dD();if(n){const t=document.createElement("style");t.setAttribute("data-vue-expedite-style","true"),t.textContent=n,this.shadowRoot.prepend(t)}else{const t=new URL("./style.css",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Or&&Or.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=t,this.shadowRoot.prepend(r)}Eo&&Kc(this.shadowRoot,Eo)}catch(n){console.warn("[ExpediteComponents] Failed to inject CSS:",n)}}}disconnectedCallback(){Vc.delete(this),super.disconnectedCallback&&super.disconnectedCallback()}},up=Yi(Ci(T1)),cp=Yi(Ci(M_)),dp=Yi(Ci(W2)),fp=Yi(Ci(Q2)),hp=Yi(Ci(uD));function Xc(){typeof window<"u"&&(customElements.get("vue-expedite-configurator")||customElements.define("vue-expedite-configurator",up),customElements.get("vue-expedite-gpt")||customElements.define("vue-expedite-gpt",cp),customElements.get("vue-expedite-catalog")||customElements.define("vue-expedite-catalog",dp),customElements.get("vue-expedite-cart")||customElements.define("vue-expedite-cart",fp),customElements.get("vue-expedite-ai-guidance")||customElements.define("vue-expedite-ai-guidance",hp))}typeof window<"u"&&Xc();const fD={register:Xc,applyThemeToShadows:Gc};typeof window<"u"&&(window.VueExpediteComponents=Object.assign(window.VueExpediteComponents||{},{applyThemeToShadows:Gc})),Cn.ExpediteAIGuidanceElement=hp,Cn.ExpediteCartElement=fp,Cn.ExpediteCatalogElement=dp,Cn.ExpediteConfiguratorElement=up,Cn.ExpediteGPTElement=cp,Cn.applyThemeToShadows=Gc,Cn.default=fD,Cn.registerWebComponents=Xc,Object.defineProperties(Cn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@expedite-commerce/expedite-components",
3
3
  "private": false,
4
- "version": "0.2.130",
4
+ "version": "0.2.132",
5
5
  "type": "module",
6
6
  "description": "Vue 3 components library for Expedite",
7
7
  "main": "./dist/expedite-components.cjs.js",
@@ -52,19 +52,19 @@
52
52
  ]
53
53
  },
54
54
  "dependencies": {
55
- "@expedite-commerce/expedite-components": "^0.2.103",
55
+ "@expedite-commerce/expedite-components": "^0.2.131",
56
56
  "@vueup/vue-quill": "^1.2.0",
57
57
  "axios": "^1.13.2",
58
58
  "crypto-js": "^4.2.0",
59
59
  "dompurify": "^3.2.6",
60
60
  "lodash.clonedeep": "^4.5.0",
61
+ "markdown-it": "^14.1.0",
61
62
  "pinia": "^2.1.7",
62
63
  "v-click-outside": "^3.2.0",
63
64
  "vue": "^3.4.21",
64
65
  "vue-router-lwc": "^1.0.4",
65
- "vuedraggable": "^4.1.0",
66
- "markdown-it": "^14.1.0",
67
- "vue3-markdown-it": "^1.0.10"
66
+ "vue3-markdown-it": "^1.0.10",
67
+ "vuedraggable": "^4.1.0"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@rushstack/eslint-patch": "^1.8.0",