@blotoutio/providers-shop-gpt-sdk 1.2.1 → 1.3.0
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.
- package/index.cjs.js +201 -103
- package/index.js +201 -103
- package/index.mjs +201 -103
- package/package.json +1 -1
package/index.cjs.js
CHANGED
@@ -490,7 +490,7 @@ const init = (params) => {
|
|
490
490
|
// exit if not in top window
|
491
491
|
return;
|
492
492
|
}
|
493
|
-
const { enabled, devMode, merchantUrl, profiles, productHandles, targetPath, uiMode, } = (_c = params.manifest.variables) !== null && _c !== void 0 ? _c : {};
|
493
|
+
const { enabled, devMode, merchantUrl, profiles, productHandles, targetPath, uiMode, brandName, quickPrompts, merchantImage, } = (_c = params.manifest.variables) !== null && _c !== void 0 ? _c : {};
|
494
494
|
let shouldShowUI = enabled;
|
495
495
|
if (!enabled && hasPreviewKey()) {
|
496
496
|
logger.log('Enabling UI in preview mode');
|
@@ -516,6 +516,9 @@ const init = (params) => {
|
|
516
516
|
profiles,
|
517
517
|
productHandles,
|
518
518
|
path: targetPath,
|
519
|
+
brandName,
|
520
|
+
quickPrompts,
|
521
|
+
merchantImage,
|
519
522
|
});
|
520
523
|
}
|
521
524
|
};
|
@@ -549,7 +552,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
549
552
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
550
553
|
PERFORMANCE OF THIS SOFTWARE.
|
551
554
|
***************************************************************************** */
|
552
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
555
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
553
556
|
|
554
557
|
|
555
558
|
function __decorate(decorators, target, key, desc) {
|
@@ -573,26 +576,26 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
573
576
|
* Copyright 2019 Google LLC
|
574
577
|
* SPDX-License-Identifier: BSD-3-Clause
|
575
578
|
*/
|
576
|
-
const t$4=globalThis,e$8=t$4.ShadowRoot&&(void 0===t$4.ShadyCSS||t$4.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$
|
579
|
+
const t$4=globalThis,e$8=t$4.ShadowRoot&&(void 0===t$4.ShadyCSS||t$4.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$1=Symbol(),o$5=new WeakMap;let n$4 = class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s$1)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$8&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$5.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$5.set(s,t));}return t}toString(){return this.cssText}};const r$6=t=>new n$4("string"==typeof t?t:t+"",void 0,s$1),i$4=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1]),t[0]);return new n$4(o,t,s$1)},S$1=(s,o)=>{if(e$8)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$4.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$8?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$6(e)})(t):t;
|
577
580
|
|
578
581
|
/**
|
579
582
|
* @license
|
580
583
|
* Copyright 2017 Google LLC
|
581
584
|
* SPDX-License-Identifier: BSD-3-Clause
|
582
|
-
*/const{is:i$
|
585
|
+
*/const{is:i$3,defineProperty:e$7,getOwnPropertyDescriptor:r$5,getOwnPropertyNames:h$1,getOwnPropertySymbols:o$4,getPrototypeOf:n$3}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$1={toAttribute(t,s){switch(s){case Boolean:t=t?l$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$3(t,s),y$1={attribute:!0,type:String,converter:u$1,reflect:!1,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;let b$1 = class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=y$1){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e$7(this.prototype,t,r);}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r$5(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y$1}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$3(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...h$1(t),...o$4(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return !1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$EC(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u$1).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$1;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f$1)(this[t],s))return;this.P(t,s,i);}!1===this.isUpdatePending&&(this._$ES=this._$ET());}P(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t);}async _$ET(){this.isUpdatePending=!0;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t)!0!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.P(s,this[s],i);}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EU();}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$EU(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return !0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU();}updated(t){}firstUpdated(t){}};b$1.elementStyles=[],b$1.shadowRootOptions={mode:"open"},b$1[d$1("elementProperties")]=new Map,b$1[d$1("finalized")]=new Map,p$1?.({ReactiveElement:b$1}),(a$1.reactiveElementVersions??=[]).push("2.0.4");
|
583
586
|
|
584
587
|
/**
|
585
588
|
* @license
|
586
589
|
* Copyright 2017 Google LLC
|
587
590
|
* SPDX-License-Identifier: BSD-3-Clause
|
588
591
|
*/
|
589
|
-
const t$3=globalThis,i$
|
592
|
+
const t$3=globalThis,i$2=t$3.trustedTypes,s=i$2?i$2.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$6="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$3="?"+h,n$2=`<${o$3}>`,r$4=document,l=()=>r$4.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,u=t=>a(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),b=y(2),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r$4.createTreeWalker(r$4,129);function P(t,i){if(!a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m):void 0!==u[3]&&(c=m):c===m?">"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===f?s+n$2:d>=0?(o.push(a),s.slice(0,d)+e$6+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [P(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e$6)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H:"?"===e[1]?I:"@"===e[1]?L:k}),r.removeAttribute(t);}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i$2?i$2.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l());}}}else if(8===r.nodeType)if(r.data===o$3)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1;}c++;}}static createElement(t,i){const s=r$4.createElement("template");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r$4).importNode(i,!0);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C.nextNode(),o++);}return C.currentNode=r$4,e}p(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r$4.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l()),this.O(l()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E;}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class H extends k{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E?void 0:t;}}class I extends k{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E);}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t);}}const j=t$3.litHtmlPolyfillSupport;j?.(N,R),(t$3.litHtmlVersions??=[]).push("3.2.1");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l(),t),t,void 0,s??{});}return h._$AI(t),h};
|
590
593
|
|
591
594
|
/**
|
592
595
|
* @license
|
593
596
|
* Copyright 2017 Google LLC
|
594
597
|
* SPDX-License-Identifier: BSD-3-Clause
|
595
|
-
*/class
|
598
|
+
*/let r$3 = class r extends b$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(s,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return T}};r$3._$litElement$=!0,r$3["finalized"]=!0,globalThis.litElementHydrateSupport?.({LitElement:r$3});const i$1=globalThis.litElementPolyfillSupport;i$1?.({LitElement:r$3});(globalThis.litElementVersions??=[]).push("4.1.1");
|
596
599
|
|
597
600
|
/**
|
598
601
|
* @license
|
@@ -626,7 +629,7 @@ const e$5=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&"object"
|
|
626
629
|
* SPDX-License-Identifier: BSD-3-Clause
|
627
630
|
*/function e$4(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;if(r){const{get:e,set:r}="object"==typeof s?n:i??(()=>{const t=Symbol();return {get(){return this[t]},set(e){this[t]=e;}}})();return e$5(n,s,{get(){let t=e.call(this);return void 0===t&&(t=o(this),(null!==t||this.hasUpdated)&&r.call(this,t)),t}})}return e$5(n,s,{get(){return o(this)}})}}
|
628
631
|
|
629
|
-
const scrollBarStyles = i$
|
632
|
+
const scrollBarStyles = i$4 `
|
630
633
|
::-webkit-scrollbar {
|
631
634
|
width: 20px;
|
632
635
|
}
|
@@ -646,7 +649,7 @@ const scrollBarStyles = i$3 `
|
|
646
649
|
background-color: #a8bbbf;
|
647
650
|
}
|
648
651
|
`;
|
649
|
-
const shopGPTStyles = i$
|
652
|
+
const shopGPTStyles = i$4 `
|
650
653
|
${scrollBarStyles}
|
651
654
|
|
652
655
|
* {
|
@@ -763,7 +766,7 @@ const t$1={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6}
|
|
763
766
|
* @license
|
764
767
|
* Copyright 2018 Google LLC
|
765
768
|
* SPDX-License-Identifier: BSD-3-Clause
|
766
|
-
*/const e$2=e$3(class extends i{constructor(t){if(super(t),t.type!==t$1.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return
|
769
|
+
*/const e$2=e$3(class extends i{constructor(t){if(super(t),t.type!==t$1.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return T}});
|
767
770
|
|
768
771
|
/**
|
769
772
|
* @license
|
@@ -843,7 +846,7 @@ const shopGPTIcon = b `<svg xmlns="http://www.w3.org/2000/svg" width="105" heigh
|
|
843
846
|
<path d="M90.323 25.7117C90.2401 25.7117 90.1986 25.7117 90.1669 25.7281C90.1391 25.7424 90.1165 25.7653 90.1022 25.7934C90.0861 25.8255 90.0861 25.8674 90.0861 25.9512V26.9203H89.7359C89.6558 26.9203 89.6148 26.9205 89.5836 26.9366C89.5558 26.9509 89.5331 26.9738 89.5189 27.002C89.5028 27.034 89.5028 27.0759 89.5028 27.1597V27.717C89.5028 27.8008 89.5028 27.8427 89.5189 27.8748C89.5331 27.9029 89.5558 27.9258 89.5836 27.9402C89.6153 27.9565 89.6568 27.9565 89.7397 27.9565H90.0861V32.1113H90.0847C90.0843 32.1182 90.0838 32.1251 90.0835 32.1319C90.0841 32.1478 90.085 32.1637 90.0861 32.1795V32.2192L90.0883 32.2191C90.1341 33.0885 90.844 33.7701 91.7052 33.7715C91.8727 33.7713 92.0388 33.745 92.1978 33.6936C92.2668 33.6713 92.321 33.5887 92.3208 33.5154L92.3225 32.749C92.3226 32.7376 92.3205 32.7194 92.3176 32.7084C92.317 32.7064 92.3165 32.7043 92.3159 32.7022C92.3113 32.6856 92.297 32.6611 92.283 32.651C92.2793 32.6484 92.2311 32.6207 92.1908 32.6453C92.1477 32.6656 92.147 32.6659 92.1463 32.6662C92.1353 32.6715 92.0981 32.6856 92.0807 32.6958C91.9299 32.7603 91.9074 32.7589 91.8631 32.7651C91.8328 32.7694 91.8023 32.7716 91.7716 32.7716C91.7139 32.7716 91.6565 32.7639 91.6007 32.7488C91.5449 32.7337 91.4914 32.7113 91.4414 32.6821C91.4146 32.6643 91.3891 32.6445 91.3652 32.623C91.3511 32.613 91.3375 32.6024 91.3243 32.5912C91.3176 32.5863 91.3111 32.5812 91.3046 32.576C91.3029 32.5738 91.3012 32.5715 91.2995 32.5692C91.1797 32.456 91.1115 32.2977 91.1112 32.1319C91.1116 32.1265 91.1121 32.1212 91.1127 32.1158C91.1122 32.1118 91.1116 32.1079 91.1112 32.1039V27.9565H92.0702C92.1531 27.9565 92.1946 27.9565 92.2262 27.9402C92.2541 27.9258 92.2767 27.9029 92.2909 27.8748C92.3071 27.8427 92.3071 27.8008 92.3071 27.717V27.1597C92.3071 27.0759 92.3071 27.034 92.2909 27.002C92.2767 26.9738 92.2541 26.9509 92.2262 26.9366C92.1946 26.9203 92.1531 26.9203 92.0702 26.9203H91.1112V25.9512C91.1112 25.8674 91.1112 25.8255 91.095 25.7934C91.0808 25.7653 91.0582 25.7424 91.0303 25.7281C90.9986 25.7117 90.9572 25.7117 90.8743 25.7117H90.323Z" fill="#F25C2B"/>
|
844
847
|
</svg>`;
|
845
848
|
|
846
|
-
const chatThreadsStyles = i$
|
849
|
+
const chatThreadsStyles = i$4 `
|
847
850
|
:host {
|
848
851
|
padding: 24px 24px 21px;
|
849
852
|
font-family: 'Inter', sans-serif;
|
@@ -996,13 +999,13 @@ const chatThreadsStyles = i$3 `
|
|
996
999
|
|
997
1000
|
let LoadSpinner =
|
998
1001
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
999
|
-
class LoadSpinner extends
|
1002
|
+
class LoadSpinner extends r$3 {
|
1000
1003
|
render() {
|
1001
1004
|
return x ` <div class="loader"><div class="spinner"></div></div> `;
|
1002
1005
|
}
|
1003
1006
|
};
|
1004
1007
|
LoadSpinner.styles = [
|
1005
|
-
i$
|
1008
|
+
i$4 `
|
1006
1009
|
.loader {
|
1007
1010
|
display: flex;
|
1008
1011
|
flex: 1;
|
@@ -1041,7 +1044,7 @@ LoadSpinner = __decorate([
|
|
1041
1044
|
|
1042
1045
|
let ChatThreads =
|
1043
1046
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1044
|
-
class ChatThreads extends
|
1047
|
+
class ChatThreads extends r$3 {
|
1045
1048
|
getDomain() {
|
1046
1049
|
var _a;
|
1047
1050
|
if ((_a = this.merchantUrl) === null || _a === void 0 ? void 0 : _a.startsWith('https://')) {
|
@@ -1105,7 +1108,7 @@ class ChatThreads extends s {
|
|
1105
1108
|
</div>
|
1106
1109
|
`)}
|
1107
1110
|
</div>`
|
1108
|
-
:
|
1111
|
+
: E}
|
1109
1112
|
</div>
|
1110
1113
|
`;
|
1111
1114
|
}
|
@@ -1127,21 +1130,21 @@ class ChatThreads extends s {
|
|
1127
1130
|
${this.getDomain().replace('https://', '')}
|
1128
1131
|
</a>
|
1129
1132
|
</div>`
|
1130
|
-
:
|
1133
|
+
: E}
|
1131
1134
|
${this.deleteThreadId
|
1132
1135
|
? x `
|
1133
1136
|
<confirm-dialog
|
1134
1137
|
@accept=${this.handleThreadDelete}
|
1135
1138
|
@decline=${() => (this.deleteThreadId = '')}
|
1136
1139
|
>
|
1137
|
-
<h2 slot="title">Delete
|
1140
|
+
<h2 slot="title">Delete Chat?</h2>
|
1138
1141
|
<p slot="content">
|
1139
1142
|
This action cannot be undone. Are you sure you want to delete
|
1140
1143
|
<b>"${this.chatThreads.get(this.deleteThreadId).title}"</b>?
|
1141
1144
|
</p>
|
1142
1145
|
</confirm-dialog>
|
1143
1146
|
`
|
1144
|
-
:
|
1147
|
+
: E}
|
1145
1148
|
`;
|
1146
1149
|
}
|
1147
1150
|
};
|
@@ -1175,7 +1178,7 @@ ChatThreads = __decorate([
|
|
1175
1178
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1176
1179
|
], ChatThreads);
|
1177
1180
|
|
1178
|
-
const productsSectionStyles = i$
|
1181
|
+
const productsSectionStyles = i$4 `
|
1179
1182
|
:host {
|
1180
1183
|
padding: 24px 16px;
|
1181
1184
|
background-color: #fff;
|
@@ -1211,9 +1214,14 @@ const productsSectionStyles = i$3 `
|
|
1211
1214
|
justify-content: center;
|
1212
1215
|
height: 100%;
|
1213
1216
|
}
|
1217
|
+
|
1218
|
+
.merchant-image {
|
1219
|
+
width: 100%;
|
1220
|
+
object-fit: contain;
|
1221
|
+
}
|
1214
1222
|
`;
|
1215
1223
|
|
1216
|
-
const productItemStyles = i$
|
1224
|
+
const productItemStyles = i$4 `
|
1217
1225
|
:host {
|
1218
1226
|
font-family: 'Inter', sans-serif;
|
1219
1227
|
font-size: 16px;
|
@@ -1358,7 +1366,7 @@ const productItemStyles = i$3 `
|
|
1358
1366
|
|
1359
1367
|
let ProductItem =
|
1360
1368
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1361
|
-
class ProductItem extends
|
1369
|
+
class ProductItem extends r$3 {
|
1362
1370
|
getLocalPrice(price) {
|
1363
1371
|
if (!this.siteCurrency) {
|
1364
1372
|
return price;
|
@@ -1374,8 +1382,8 @@ class ProductItem extends s {
|
|
1374
1382
|
(_a = open(url, '_blank')) === null || _a === void 0 ? void 0 : _a.focus();
|
1375
1383
|
}
|
1376
1384
|
renderVariantTitles() {
|
1377
|
-
if (
|
1378
|
-
return
|
1385
|
+
if (this.product.hasOnlyDefaultVariant) {
|
1386
|
+
return E;
|
1379
1387
|
}
|
1380
1388
|
return this.product.variants[0].selectedOptions.map((option) => x `
|
1381
1389
|
<p class="product-variation-details">${option.name}: ${option.value}</p>
|
@@ -1405,7 +1413,7 @@ class ProductItem extends s {
|
|
1405
1413
|
? x `<p class="price-compared">
|
1406
1414
|
${this.getLocalPrice(this.product.variants[0].comparedAtPrice)}
|
1407
1415
|
</p>`
|
1408
|
-
:
|
1416
|
+
: E}
|
1409
1417
|
<p>${this.getLocalPrice(this.product.variants[0].price)}</p>
|
1410
1418
|
</div>
|
1411
1419
|
<button
|
@@ -1433,7 +1441,7 @@ ProductItem = __decorate([
|
|
1433
1441
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1434
1442
|
], ProductItem);
|
1435
1443
|
|
1436
|
-
const productsListStyles = i$
|
1444
|
+
const productsListStyles = i$4 `
|
1437
1445
|
.products::-webkit-scrollbar {
|
1438
1446
|
display: none;
|
1439
1447
|
}
|
@@ -1495,17 +1503,34 @@ const productsListStyles = i$3 `
|
|
1495
1503
|
|
1496
1504
|
let ProductsList =
|
1497
1505
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1498
|
-
class ProductsList extends
|
1506
|
+
class ProductsList extends r$3 {
|
1507
|
+
constructor() {
|
1508
|
+
super(...arguments);
|
1509
|
+
this.showButtons = true;
|
1510
|
+
this.updateButtonsState = () => {
|
1511
|
+
if (!this.leftBtnEle || !this.productsEle || !this.rightBtnEle) {
|
1512
|
+
return;
|
1513
|
+
}
|
1514
|
+
const { scrollWidth, clientWidth } = this.productsEle;
|
1515
|
+
this.showButtons = scrollWidth > clientWidth;
|
1516
|
+
this.leftBtnEle.classList.toggle('disabled', this.productsEle.scrollLeft === 0);
|
1517
|
+
const maxScroll = this.productsEle.scrollWidth - this.productsEle.clientWidth;
|
1518
|
+
this.rightBtnEle.classList.toggle('disabled', this.productsEle.scrollLeft >= maxScroll - 1);
|
1519
|
+
};
|
1520
|
+
}
|
1499
1521
|
connectedCallback() {
|
1500
1522
|
super.connectedCallback();
|
1523
|
+
this.updateButtonsState();
|
1524
|
+
window.addEventListener('resize', this.updateButtonsState);
|
1501
1525
|
}
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1526
|
+
disconnectedCallback() {
|
1527
|
+
window.removeEventListener('resize', this.updateButtonsState);
|
1528
|
+
super.disconnectedCallback();
|
1529
|
+
}
|
1530
|
+
updated(_changedProperties) {
|
1531
|
+
if (_changedProperties.has('products')) {
|
1532
|
+
this.updateButtonsState();
|
1505
1533
|
}
|
1506
|
-
this.leftBtnEle.classList.toggle('disabled', this.productsEle.scrollLeft === 0);
|
1507
|
-
const maxScroll = this.productsEle.scrollWidth - this.productsEle.clientWidth;
|
1508
|
-
this.rightBtnEle.classList.toggle('disabled', this.productsEle.scrollLeft >= maxScroll - 1);
|
1509
1534
|
}
|
1510
1535
|
scrollToLeft(e) {
|
1511
1536
|
var _a;
|
@@ -1519,7 +1544,7 @@ class ProductsList extends s {
|
|
1519
1544
|
}
|
1520
1545
|
render() {
|
1521
1546
|
if (!this.products.length) {
|
1522
|
-
return
|
1547
|
+
return E;
|
1523
1548
|
}
|
1524
1549
|
return x `
|
1525
1550
|
<div class="products-wrapper">
|
@@ -1538,12 +1563,16 @@ class ProductsList extends s {
|
|
1538
1563
|
</div>
|
1539
1564
|
`)}
|
1540
1565
|
</div>
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1566
|
+
${this.showButtons
|
1567
|
+
? x ` <div class="scroll-btns">
|
1568
|
+
<div class="left-btn disabled" @click=${this.scrollToLeft}>
|
1569
|
+
${leftBtn}
|
1570
|
+
</div>
|
1571
|
+
<div class="right-btn" @click=${this.scrollToRight}>
|
1572
|
+
${rightBtn}
|
1573
|
+
</div>
|
1574
|
+
</div>`
|
1575
|
+
: E}
|
1547
1576
|
</div>
|
1548
1577
|
`;
|
1549
1578
|
}
|
@@ -1557,6 +1586,10 @@ __decorate([
|
|
1557
1586
|
n$1({ type: Object }),
|
1558
1587
|
__metadata("design:type", Object)
|
1559
1588
|
], ProductsList.prototype, "siteCurrency", void 0);
|
1589
|
+
__decorate([
|
1590
|
+
r$1(),
|
1591
|
+
__metadata("design:type", Object)
|
1592
|
+
], ProductsList.prototype, "showButtons", void 0);
|
1560
1593
|
__decorate([
|
1561
1594
|
e$4('.left-btn'),
|
1562
1595
|
__metadata("design:type", Object)
|
@@ -1576,22 +1609,28 @@ ProductsList = __decorate([
|
|
1576
1609
|
|
1577
1610
|
let ProductsSection =
|
1578
1611
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1579
|
-
class ProductsSection extends
|
1612
|
+
class ProductsSection extends r$3 {
|
1580
1613
|
connectedCallback() {
|
1581
1614
|
super.connectedCallback();
|
1582
1615
|
}
|
1616
|
+
renderMerchantImage() {
|
1617
|
+
if (this.merchantImage) {
|
1618
|
+
return x ` <img class="merchant-image" src=${this.merchantImage} /> `;
|
1619
|
+
}
|
1620
|
+
return x `
|
1621
|
+
<div>${searchIcon}</div>
|
1622
|
+
<p>
|
1623
|
+
Start exploring by typing your query in the search bar on the right.
|
1624
|
+
</p>
|
1625
|
+
`;
|
1626
|
+
}
|
1583
1627
|
render() {
|
1584
1628
|
if (this.isLoadingHistory) {
|
1585
1629
|
return x ` <load-spinner></load-spinner> `;
|
1586
1630
|
}
|
1587
1631
|
if (!this.products.length) {
|
1588
1632
|
return x `
|
1589
|
-
<div class="no-products">
|
1590
|
-
<div>${searchIcon}</div>
|
1591
|
-
<p>
|
1592
|
-
Start exploring by typing your query in the search bar on the right.
|
1593
|
-
</p>
|
1594
|
-
</div>
|
1633
|
+
<div class="no-products">${this.renderMerchantImage()}</div>
|
1595
1634
|
`;
|
1596
1635
|
}
|
1597
1636
|
const topResult = this.products[0];
|
@@ -1617,6 +1656,10 @@ class ProductsSection extends s {
|
|
1617
1656
|
}
|
1618
1657
|
};
|
1619
1658
|
ProductsSection.styles = [productsSectionStyles];
|
1659
|
+
__decorate([
|
1660
|
+
n$1({ type: String }),
|
1661
|
+
__metadata("design:type", Object)
|
1662
|
+
], ProductsSection.prototype, "merchantImage", void 0);
|
1620
1663
|
__decorate([
|
1621
1664
|
n$1({ type: Array }),
|
1622
1665
|
__metadata("design:type", Array)
|
@@ -1646,7 +1689,7 @@ ProductsSection = __decorate([
|
|
1646
1689
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
1647
1690
|
], ProductsSection);
|
1648
1691
|
|
1649
|
-
const chatSectionStyles = i$
|
1692
|
+
const chatSectionStyles = i$4 `
|
1650
1693
|
:host {
|
1651
1694
|
font-family: 'Inter', sans-serif;
|
1652
1695
|
font-size: 16px;
|
@@ -2120,7 +2163,7 @@ const crossBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="2
|
|
2120
2163
|
<path d="M18 7.05L16.95 6L12 10.95L7.05 6L6 7.05L10.95 12L6 16.95L7.05 18L12 13.05L16.95 18L18 16.95L13.05 12L18 7.05Z" fill="white"/>
|
2121
2164
|
</svg>`;
|
2122
2165
|
|
2123
|
-
const personalizeDialogStyles = i$
|
2166
|
+
const personalizeDialogStyles = i$4 `
|
2124
2167
|
:host {
|
2125
2168
|
font-family: 'Inter', sans-serif;
|
2126
2169
|
font-size: 16px;
|
@@ -2360,7 +2403,7 @@ const profilePlusIcon = b `<svg xmlns="http://www.w3.org/2000/svg" width="56" he
|
|
2360
2403
|
|
2361
2404
|
let PersonalizeDialog =
|
2362
2405
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2363
|
-
class PersonalizeDialog extends
|
2406
|
+
class PersonalizeDialog extends r$3 {
|
2364
2407
|
constructor() {
|
2365
2408
|
super(...arguments);
|
2366
2409
|
this.isLoading = false;
|
@@ -2383,7 +2426,7 @@ class PersonalizeDialog extends s {
|
|
2383
2426
|
return this.selectProductHandle();
|
2384
2427
|
}
|
2385
2428
|
}
|
2386
|
-
return
|
2429
|
+
return E;
|
2387
2430
|
};
|
2388
2431
|
}
|
2389
2432
|
showModal() {
|
@@ -2567,7 +2610,7 @@ class PersonalizeDialog extends s {
|
|
2567
2610
|
: 'Select Product'}
|
2568
2611
|
</div>
|
2569
2612
|
<ul class="dropdown-list">
|
2570
|
-
${(_a = this.defaultProductHandles) === null || _a === void 0 ? void 0 : _a.map((productHandle) => x
|
2613
|
+
${(_a = this.defaultProductHandles) === null || _a === void 0 ? void 0 : _a.map((productHandle) => x ` <li
|
2571
2614
|
class="dropdown-item"
|
2572
2615
|
@click=${() => {
|
2573
2616
|
this.productHandle = productHandle;
|
@@ -2579,10 +2622,10 @@ class PersonalizeDialog extends s {
|
|
2579
2622
|
</ul>
|
2580
2623
|
</div>
|
2581
2624
|
${this.productHandle
|
2582
|
-
? x
|
2625
|
+
? x ` <button class="finish-btn" @click=${this.handleSubmit}>
|
2583
2626
|
Finish
|
2584
2627
|
</button>`
|
2585
|
-
:
|
2628
|
+
: E}
|
2586
2629
|
`;
|
2587
2630
|
}
|
2588
2631
|
render() {
|
@@ -2590,10 +2633,10 @@ class PersonalizeDialog extends s {
|
|
2590
2633
|
<dialog>
|
2591
2634
|
<div class="dialog-title">
|
2592
2635
|
${this.state !== 'profile-type'
|
2593
|
-
? x
|
2636
|
+
? x ` <div class="back-btn btn" @click=${this.handleBackStep}>
|
2594
2637
|
${backBtn}
|
2595
2638
|
</div>`
|
2596
|
-
:
|
2639
|
+
: E}
|
2597
2640
|
<h2>Personalize your search</h2>
|
2598
2641
|
<div class="close-btn btn" @click=${() => this.dialogModal.close()}>
|
2599
2642
|
${closeBtn}
|
@@ -2627,7 +2670,7 @@ __decorate([
|
|
2627
2670
|
], PersonalizeDialog.prototype, "defaultProfiles", void 0);
|
2628
2671
|
__decorate([
|
2629
2672
|
n$1({ type: Boolean }),
|
2630
|
-
__metadata("design:type",
|
2673
|
+
__metadata("design:type", Object)
|
2631
2674
|
], PersonalizeDialog.prototype, "isLoading", void 0);
|
2632
2675
|
__decorate([
|
2633
2676
|
n$1({ type: String }),
|
@@ -2658,20 +2701,20 @@ PersonalizeDialog = __decorate([
|
|
2658
2701
|
* @license
|
2659
2702
|
* Copyright 2017 Google LLC
|
2660
2703
|
* SPDX-License-Identifier: BSD-3-Clause
|
2661
|
-
*/let e$1 = class e extends i{constructor(i){if(super(i),this.it=
|
2704
|
+
*/let e$1 = class e extends i{constructor(i){if(super(i),this.it=E,i.type!==t$1.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===E||null==r)return this._t=void 0,this.it=r;if(r===T)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.it)return this._t;this.it=r;const s=[r];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}};e$1.directiveName="unsafeHTML",e$1.resultType=1;const o=e$3(e$1);
|
2662
2705
|
|
2663
2706
|
var e={"":["<em>","</em>"],_:["<strong>","</strong>"],"*":["<strong>","</strong>"],"~":["<s>","</s>"],"\n":["<br />"]," ":["<br />"],"-":["<hr />"]};function n(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function r(e){return (e+"").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function t(a,c){var o,l,g,s,p,u=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,m=[],h="",i=c||{},d=0;function f(n){var r=e[n[1]||""],t=m[m.length-1]==n;return r?r[1]?(t?m.pop():m.push(n),r[0|t]):r[0]:n}function $(){for(var e="";m.length;)e+=f(m[m.length-1]);return e}for(a=a.replace(/^\[(.+?)\]:\s*(.+)$/gm,function(e,n,r){return i[n.toLowerCase()]=r,""}).replace(/^\n+|\n+$/g,"");g=u.exec(a);)l=a.substring(d,g.index),d=u.lastIndex,o=g[0],l.match(/[^\\](\\\\)*\\$/)||((p=g[3]||g[4])?o='<pre class="code '+(g[4]?"poetry":g[2].toLowerCase())+'"><code'+(g[2]?' class="language-'+g[2].toLowerCase()+'"':"")+">"+n(r(p).replace(/^\n+|\n+$/g,""))+"</code></pre>":(p=g[6])?(p.match(/\./)&&(g[5]=g[5].replace(/^\d+/gm,"")),s=t(n(g[5].replace(/^\s*[>*+.-]/gm,""))),">"==p?p="blockquote":(p=p.match(/\./)?"ol":"ul",s=s.replace(/^(.*)(\n|$)/gm,"<li>$1</li>")),o="<"+p+">"+s+"</"+p+">"):g[8]?o='<img src="'+r(g[8])+'" alt="'+r(g[7])+'">':g[10]?(h=h.replace("<a>",'<a href="'+r(g[11]||i[l.toLowerCase()])+'">'),o=$()+"</a>"):g[9]?o="<a>":g[12]||g[14]?o="<"+(p="h"+(g[14]?g[14].length:g[13]>"="?1:2))+">"+t(g[12]||g[15],i)+"</"+p+">":g[16]?o="<code>"+r(g[16])+"</code>":(g[17]||g[1])&&(o=f(g[17]||"--"))),h+=l,h+=o;return (h+a.substring(d)+$()).replace(/^\n+|\n+$/g,"")}
|
2664
2707
|
|
2665
2708
|
let MarkdownRenderer =
|
2666
2709
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2667
|
-
class MarkdownRenderer extends
|
2710
|
+
class MarkdownRenderer extends r$3 {
|
2668
2711
|
render() {
|
2669
2712
|
const slotContent = this.innerHTML.trim();
|
2670
2713
|
const parsedContent = t(slotContent);
|
2671
2714
|
return o(parsedContent);
|
2672
2715
|
}
|
2673
2716
|
};
|
2674
|
-
MarkdownRenderer.styles = i$
|
2717
|
+
MarkdownRenderer.styles = i$4 `
|
2675
2718
|
:host {
|
2676
2719
|
font-family: 'Inter', sans-serif;
|
2677
2720
|
font-size: 16px;
|
@@ -2689,7 +2732,7 @@ MarkdownRenderer = __decorate([
|
|
2689
2732
|
|
2690
2733
|
let TooltipComponent =
|
2691
2734
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2692
|
-
class TooltipComponent extends
|
2735
|
+
class TooltipComponent extends r$3 {
|
2693
2736
|
constructor() {
|
2694
2737
|
super(...arguments);
|
2695
2738
|
this.position = 'bottom-left';
|
@@ -2703,11 +2746,12 @@ class TooltipComponent extends s {
|
|
2703
2746
|
}
|
2704
2747
|
};
|
2705
2748
|
TooltipComponent.styles = [
|
2706
|
-
i$
|
2749
|
+
i$4 `
|
2707
2750
|
:host {
|
2708
2751
|
position: relative;
|
2709
2752
|
display: inline-block;
|
2710
2753
|
}
|
2754
|
+
|
2711
2755
|
.tooltip {
|
2712
2756
|
position: absolute;
|
2713
2757
|
color: #172a41;
|
@@ -2728,57 +2772,70 @@ TooltipComponent.styles = [
|
|
2728
2772
|
font-weight: 400;
|
2729
2773
|
line-height: 150%;
|
2730
2774
|
}
|
2775
|
+
|
2731
2776
|
:host(:hover) .tooltip {
|
2732
2777
|
opacity: 1;
|
2733
2778
|
}
|
2779
|
+
|
2734
2780
|
.top-center {
|
2735
2781
|
bottom: calc(100% + 2px);
|
2736
2782
|
left: 50%;
|
2737
2783
|
transform: translateX(-50%);
|
2738
2784
|
}
|
2785
|
+
|
2739
2786
|
.top-left {
|
2740
2787
|
bottom: calc(100% + 2px);
|
2741
2788
|
left: 0;
|
2742
2789
|
}
|
2790
|
+
|
2743
2791
|
.top-right {
|
2744
2792
|
bottom: calc(100% + 2px);
|
2745
2793
|
right: 0;
|
2746
2794
|
}
|
2795
|
+
|
2747
2796
|
.bottom-center {
|
2748
2797
|
top: calc(100% + 2px);
|
2749
2798
|
left: 50%;
|
2750
2799
|
transform: translateX(-50%);
|
2751
2800
|
}
|
2801
|
+
|
2752
2802
|
.bottom-left {
|
2753
2803
|
top: calc(100% + 2px);
|
2754
2804
|
left: 0;
|
2755
2805
|
}
|
2806
|
+
|
2756
2807
|
.bottom-right {
|
2757
2808
|
top: calc(100% + 2px);
|
2758
2809
|
right: 0;
|
2759
2810
|
}
|
2811
|
+
|
2760
2812
|
.left-center {
|
2761
2813
|
right: calc(100% + 2px);
|
2762
2814
|
top: 50%;
|
2763
2815
|
transform: translateY(-50%);
|
2764
2816
|
}
|
2817
|
+
|
2765
2818
|
.left-top {
|
2766
2819
|
right: calc(100% + 2px);
|
2767
2820
|
top: 0;
|
2768
2821
|
}
|
2822
|
+
|
2769
2823
|
.left-bottom {
|
2770
2824
|
right: calc(100% + 2px);
|
2771
2825
|
bottom: 0;
|
2772
2826
|
}
|
2827
|
+
|
2773
2828
|
.right-center {
|
2774
2829
|
left: calc(100% + 2px);
|
2775
2830
|
top: 50%;
|
2776
2831
|
transform: translateY(-50%);
|
2777
2832
|
}
|
2833
|
+
|
2778
2834
|
.right-top {
|
2779
2835
|
left: calc(100% + 2px);
|
2780
2836
|
top: 0;
|
2781
2837
|
}
|
2838
|
+
|
2782
2839
|
.right-bottom {
|
2783
2840
|
left: calc(100% + 2px);
|
2784
2841
|
bottom: 0;
|
@@ -2791,14 +2848,14 @@ __decorate([
|
|
2791
2848
|
], TooltipComponent.prototype, "position", void 0);
|
2792
2849
|
__decorate([
|
2793
2850
|
n$1({ type: String }),
|
2794
|
-
__metadata("design:type",
|
2851
|
+
__metadata("design:type", Object)
|
2795
2852
|
], TooltipComponent.prototype, "text", void 0);
|
2796
2853
|
TooltipComponent = __decorate([
|
2797
2854
|
t$2('tooltip-component')
|
2798
2855
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2799
2856
|
], TooltipComponent);
|
2800
2857
|
|
2801
|
-
const confirmDialogStyles = i$
|
2858
|
+
const confirmDialogStyles = i$4 `
|
2802
2859
|
:host {
|
2803
2860
|
font-family: 'Inter', sans-serif;
|
2804
2861
|
font-size: 16px;
|
@@ -2879,7 +2936,7 @@ const confirmDialogStyles = i$3 `
|
|
2879
2936
|
|
2880
2937
|
let ConfirmDialog =
|
2881
2938
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2882
|
-
class ConfirmDialog extends
|
2939
|
+
class ConfirmDialog extends r$3 {
|
2883
2940
|
onAcceptClick(e) {
|
2884
2941
|
e.preventDefault();
|
2885
2942
|
this.dispatchEvent(new CustomEvent('accept', {
|
@@ -2921,7 +2978,7 @@ ConfirmDialog = __decorate([
|
|
2921
2978
|
|
2922
2979
|
let ChatSection =
|
2923
2980
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2924
|
-
class ChatSection extends
|
2981
|
+
class ChatSection extends r$3 {
|
2925
2982
|
constructor() {
|
2926
2983
|
super(...arguments);
|
2927
2984
|
this.showChatThreads = false;
|
@@ -2960,7 +3017,7 @@ class ChatSection extends s {
|
|
2960
3017
|
this.deleteThreadId = '';
|
2961
3018
|
}
|
2962
3019
|
typingIndicator() {
|
2963
|
-
return x
|
3020
|
+
return x ` <div class="typing-dots">
|
2964
3021
|
<div class="dot"></div>
|
2965
3022
|
<div class="dot"></div>
|
2966
3023
|
<div class="dot"></div>
|
@@ -2976,8 +3033,8 @@ class ChatSection extends s {
|
|
2976
3033
|
</div>
|
2977
3034
|
<div>
|
2978
3035
|
${message.message
|
2979
|
-
? x
|
2980
|
-
:
|
3036
|
+
? x ` <markdown-renderer>${message.message}</markdown-renderer>`
|
3037
|
+
: E}
|
2981
3038
|
${this.viewType !== 'modal' && ((_a = message.products) === null || _a === void 0 ? void 0 : _a[0])
|
2982
3039
|
? x `
|
2983
3040
|
<span class="line"></span>
|
@@ -2988,16 +3045,16 @@ class ChatSection extends s {
|
|
2988
3045
|
></product-item>
|
2989
3046
|
</div>
|
2990
3047
|
`
|
2991
|
-
:
|
3048
|
+
: E}
|
2992
3049
|
</div>
|
2993
3050
|
</div>
|
2994
3051
|
${this.viewType === 'modal' && message.products
|
2995
|
-
? x
|
3052
|
+
? x ` <products-list
|
2996
3053
|
.products=${message.products}
|
2997
3054
|
.siteCurrency=${this.siteCurrency}
|
2998
3055
|
.viewType=${this.viewType}
|
2999
3056
|
></products-list>`
|
3000
|
-
:
|
3057
|
+
: E}
|
3001
3058
|
</div>
|
3002
3059
|
`;
|
3003
3060
|
}
|
@@ -3008,7 +3065,7 @@ class ChatSection extends s {
|
|
3008
3065
|
return x `
|
3009
3066
|
<div class="messages">
|
3010
3067
|
${this.isTyping
|
3011
|
-
? x
|
3068
|
+
? x ` <div class="message bot">
|
3012
3069
|
<div>
|
3013
3070
|
<div class="bot-icon">${botIcon}</div>
|
3014
3071
|
</div>
|
@@ -3020,7 +3077,7 @@ class ChatSection extends s {
|
|
3020
3077
|
sender: 'bot',
|
3021
3078
|
message: "Uh-oh! Looks like I tripped over some alpha-stage wires. Things are still a bit wobbly here, buy hey, that's what testing is for, Let's try that again; or feel free to throw another challenge my way!",
|
3022
3079
|
})
|
3023
|
-
:
|
3080
|
+
: E}
|
3024
3081
|
${this.messages.map((message) => {
|
3025
3082
|
if (message.sender === 'bot') {
|
3026
3083
|
return this.botMessage(message);
|
@@ -3033,11 +3090,10 @@ class ChatSection extends s {
|
|
3033
3090
|
</div>
|
3034
3091
|
<div>
|
3035
3092
|
<p>
|
3036
|
-
|
3037
|
-
|
3038
|
-
|
3039
|
-
|
3040
|
-
started:
|
3093
|
+
Hi,
|
3094
|
+
${this.brandName ? x `Welcome to ${this.brandName}.` : E}
|
3095
|
+
I'm here to help you find the perfect product? What are you
|
3096
|
+
looking to resolve today?
|
3041
3097
|
</p>
|
3042
3098
|
</div>
|
3043
3099
|
</div>
|
@@ -3047,9 +3103,11 @@ class ChatSection extends s {
|
|
3047
3103
|
quickPrompts() {
|
3048
3104
|
var _a;
|
3049
3105
|
if (((_a = this.thread) === null || _a === void 0 ? void 0 : _a.threadId) || this.messages.length) {
|
3050
|
-
return
|
3106
|
+
return E;
|
3051
3107
|
}
|
3052
|
-
const defaultPrompts =
|
3108
|
+
const defaultPrompts = this.prompts
|
3109
|
+
? this.prompts.split(',').map((prompt) => prompt.trim())
|
3110
|
+
: ['Best Selling Items', 'Hot Sales'];
|
3053
3111
|
return x `
|
3054
3112
|
<div class="prompts btn">
|
3055
3113
|
${defaultPrompts.map((prompt) => x `
|
@@ -3119,8 +3177,8 @@ class ChatSection extends s {
|
|
3119
3177
|
<span class="context-type-value"> ${profileType} </span>
|
3120
3178
|
</div>
|
3121
3179
|
${userDetails
|
3122
|
-
? x
|
3123
|
-
:
|
3180
|
+
? x ` <div class="context user-details">${userDetails}</div>`
|
3181
|
+
: E}
|
3124
3182
|
</div>
|
3125
3183
|
<div>
|
3126
3184
|
<div class="context">
|
@@ -3128,10 +3186,10 @@ class ChatSection extends s {
|
|
3128
3186
|
<span class="context-type-value">${visitationType}</span>
|
3129
3187
|
</div>
|
3130
3188
|
${devContext.productHandle
|
3131
|
-
? x
|
3189
|
+
? x ` <div class="context product-handle">
|
3132
3190
|
${devContext.productHandle}
|
3133
3191
|
</div>`
|
3134
|
-
:
|
3192
|
+
: E}
|
3135
3193
|
</div>
|
3136
3194
|
</div>
|
3137
3195
|
`;
|
@@ -3227,9 +3285,9 @@ class ChatSection extends s {
|
|
3227
3285
|
}
|
3228
3286
|
renderChatThreads() {
|
3229
3287
|
if (!this.chatThreads || !this.showChatThreads) {
|
3230
|
-
return
|
3288
|
+
return E;
|
3231
3289
|
}
|
3232
|
-
return x
|
3290
|
+
return x ` <div id="modal-chat-threads">
|
3233
3291
|
<div class="chat-threads">
|
3234
3292
|
<h2>Your Search History</h2>
|
3235
3293
|
<div class="thread-titles-wrapper">
|
@@ -3315,18 +3373,26 @@ class ChatSection extends s {
|
|
3315
3373
|
@accept=${this.handleThreadDelete}
|
3316
3374
|
@decline=${() => (this.deleteThreadId = '')}
|
3317
3375
|
>
|
3318
|
-
<h2 slot="title">Delete
|
3376
|
+
<h2 slot="title">Delete Chat?</h2>
|
3319
3377
|
<p slot="content">
|
3320
3378
|
This action cannot be undone. Are you sure you want to delete
|
3321
3379
|
<b>"${this.chatThreads.get(this.deleteThreadId).title}"</b>?
|
3322
3380
|
</p>
|
3323
3381
|
</confirm-dialog>
|
3324
3382
|
`
|
3325
|
-
:
|
3383
|
+
: E}
|
3326
3384
|
`;
|
3327
3385
|
}
|
3328
3386
|
};
|
3329
3387
|
ChatSection.styles = [chatSectionStyles];
|
3388
|
+
__decorate([
|
3389
|
+
n$1({ type: String }),
|
3390
|
+
__metadata("design:type", Object)
|
3391
|
+
], ChatSection.prototype, "brandName", void 0);
|
3392
|
+
__decorate([
|
3393
|
+
n$1({ type: String }),
|
3394
|
+
__metadata("design:type", Object)
|
3395
|
+
], ChatSection.prototype, "prompts", void 0);
|
3330
3396
|
__decorate([
|
3331
3397
|
n$1({ type: Object }),
|
3332
3398
|
__metadata("design:type", Map)
|
@@ -3337,7 +3403,7 @@ __decorate([
|
|
3337
3403
|
], ChatSection.prototype, "deleteThreadId", void 0);
|
3338
3404
|
__decorate([
|
3339
3405
|
n$1({ type: Boolean }),
|
3340
|
-
__metadata("design:type",
|
3406
|
+
__metadata("design:type", Object)
|
3341
3407
|
], ChatSection.prototype, "showChatThreads", void 0);
|
3342
3408
|
__decorate([
|
3343
3409
|
n$1({ type: Boolean }),
|
@@ -3389,7 +3455,7 @@ __decorate([
|
|
3389
3455
|
], ChatSection.prototype, "personalizeDialogElement", void 0);
|
3390
3456
|
__decorate([
|
3391
3457
|
n$1({ type: String }),
|
3392
|
-
__metadata("design:type",
|
3458
|
+
__metadata("design:type", Object)
|
3393
3459
|
], ChatSection.prototype, "userQuery", void 0);
|
3394
3460
|
ChatSection = __decorate([
|
3395
3461
|
t$2('chat-section')
|
@@ -3397,8 +3463,9 @@ ChatSection = __decorate([
|
|
3397
3463
|
], ChatSection);
|
3398
3464
|
|
3399
3465
|
const DIALOG_DELAY = 1000;
|
3466
|
+
const LATEST_THREAD_LOAD_DAYS = 14;
|
3400
3467
|
const normalizePath = (path) => path.replace(/\/$/, '');
|
3401
|
-
let ShopGPT = class ShopGPT extends
|
3468
|
+
let ShopGPT = class ShopGPT extends r$3 {
|
3402
3469
|
constructor() {
|
3403
3470
|
super(...arguments);
|
3404
3471
|
this.modalState = 'close';
|
@@ -3410,6 +3477,14 @@ let ShopGPT = class ShopGPT extends s {
|
|
3410
3477
|
this.products = [];
|
3411
3478
|
this.messages = [];
|
3412
3479
|
this.chatThreads = new Map();
|
3480
|
+
this.loadData = async () => {
|
3481
|
+
if (!this.shopGPTAPI) {
|
3482
|
+
return;
|
3483
|
+
}
|
3484
|
+
await this.loadChatThreads();
|
3485
|
+
await this.loadInitialQuery();
|
3486
|
+
this.selectLatestThread();
|
3487
|
+
};
|
3413
3488
|
this.submitQuery = (message) => {
|
3414
3489
|
if (!message) {
|
3415
3490
|
return;
|
@@ -3433,14 +3508,12 @@ let ShopGPT = class ShopGPT extends s {
|
|
3433
3508
|
}
|
3434
3509
|
this.init();
|
3435
3510
|
}
|
3511
|
+
disconnectedCallback() {
|
3512
|
+
window.removeEventListener('edgetag-initialized', this.loadData);
|
3513
|
+
super.disconnectedCallback();
|
3514
|
+
}
|
3436
3515
|
init() {
|
3437
|
-
window.addEventListener('edgetag-initialized',
|
3438
|
-
if (!this.shopGPTAPI) {
|
3439
|
-
return;
|
3440
|
-
}
|
3441
|
-
await this.loadChatThreads();
|
3442
|
-
await this.loadInitialQuery();
|
3443
|
-
});
|
3516
|
+
window.addEventListener('edgetag-initialized', this.loadData);
|
3444
3517
|
if (!this.uiMode || this.uiMode === 'overlay') {
|
3445
3518
|
delay(DIALOG_DELAY).then(() => {
|
3446
3519
|
var _a;
|
@@ -3500,6 +3573,23 @@ let ShopGPT = class ShopGPT extends s {
|
|
3500
3573
|
this.isLoadingThreads = false;
|
3501
3574
|
}
|
3502
3575
|
}
|
3576
|
+
selectLatestThread() {
|
3577
|
+
if (!this.devMode) {
|
3578
|
+
return;
|
3579
|
+
}
|
3580
|
+
const cutoffTime = Date.now() - LATEST_THREAD_LOAD_DAYS * 24 * 60 * 60 * 1000;
|
3581
|
+
// If the latest thread is not older than cutoff we should load the thread
|
3582
|
+
let latestThread;
|
3583
|
+
for (const thread of this.chatThreads.values()) {
|
3584
|
+
if (thread.createdAt >= cutoffTime &&
|
3585
|
+
(!latestThread || latestThread.createdAt < thread.createdAt)) {
|
3586
|
+
latestThread = thread;
|
3587
|
+
}
|
3588
|
+
}
|
3589
|
+
if (latestThread) {
|
3590
|
+
this.setSelectedThreadId(latestThread.threadId);
|
3591
|
+
}
|
3592
|
+
}
|
3503
3593
|
async loadHistory(threadId) {
|
3504
3594
|
var _a, _b, _c;
|
3505
3595
|
try {
|
@@ -3637,11 +3727,14 @@ let ShopGPT = class ShopGPT extends s {
|
|
3637
3727
|
.merchantUrl=${this.merchantUrl}
|
3638
3728
|
></chat-threads>
|
3639
3729
|
<products-section
|
3730
|
+
.merchantImage=${this.merchantImage}
|
3640
3731
|
.products=${this.products}
|
3641
3732
|
.isLoadingHistory=${this.isLoadingHistory}
|
3642
3733
|
.siteCurrency=${this.getSiteCurrency()}
|
3643
3734
|
></products-section>
|
3644
3735
|
<chat-section
|
3736
|
+
.prompts=${this.quickPrompts}
|
3737
|
+
.brandName=${this.brandName}
|
3645
3738
|
.isFailed=${this.isFailed}
|
3646
3739
|
.isLoadingHistory=${this.isLoadingHistory}
|
3647
3740
|
.isTyping=${this.isTyping}
|
@@ -3665,7 +3758,7 @@ let ShopGPT = class ShopGPT extends s {
|
|
3665
3758
|
this.modalState = 'close';
|
3666
3759
|
};
|
3667
3760
|
if (this.modalState === 'close') {
|
3668
|
-
return x
|
3761
|
+
return x ` <div class="chatbot-widget">
|
3669
3762
|
<button
|
3670
3763
|
@click=${(e) => {
|
3671
3764
|
e.preventDefault();
|
@@ -3679,6 +3772,8 @@ let ShopGPT = class ShopGPT extends s {
|
|
3679
3772
|
return x `
|
3680
3773
|
<div id="shop-gpt-modal" @delete-thread=${this.handleThreadDelete}>
|
3681
3774
|
<chat-section
|
3775
|
+
.prompts=${this.quickPrompts}
|
3776
|
+
.brandName=${this.brandName}
|
3682
3777
|
.isFailed=${this.isFailed}
|
3683
3778
|
.isLoadingHistory=${this.isLoadingHistory}
|
3684
3779
|
.isTyping=${this.isTyping}
|
@@ -3710,23 +3805,23 @@ __decorate([
|
|
3710
3805
|
], ShopGPT.prototype, "modalState", void 0);
|
3711
3806
|
__decorate([
|
3712
3807
|
n$1({ type: Boolean }),
|
3713
|
-
__metadata("design:type",
|
3808
|
+
__metadata("design:type", Object)
|
3714
3809
|
], ShopGPT.prototype, "isLoadingHistory", void 0);
|
3715
3810
|
__decorate([
|
3716
3811
|
n$1({ type: Boolean }),
|
3717
|
-
__metadata("design:type",
|
3812
|
+
__metadata("design:type", Object)
|
3718
3813
|
], ShopGPT.prototype, "isLoadingThreads", void 0);
|
3719
3814
|
__decorate([
|
3720
3815
|
n$1({ type: Boolean }),
|
3721
|
-
__metadata("design:type",
|
3816
|
+
__metadata("design:type", Object)
|
3722
3817
|
], ShopGPT.prototype, "isTyping", void 0);
|
3723
3818
|
__decorate([
|
3724
3819
|
n$1({ type: Boolean }),
|
3725
|
-
__metadata("design:type",
|
3820
|
+
__metadata("design:type", Object)
|
3726
3821
|
], ShopGPT.prototype, "isFailed", void 0);
|
3727
3822
|
__decorate([
|
3728
3823
|
n$1({ type: String }),
|
3729
|
-
__metadata("design:type",
|
3824
|
+
__metadata("design:type", Object)
|
3730
3825
|
], ShopGPT.prototype, "selectedThreadId", void 0);
|
3731
3826
|
__decorate([
|
3732
3827
|
n$1({ type: Array }),
|
@@ -3763,6 +3858,9 @@ if (typeof window != 'undefined' && typeof document != 'undefined') {
|
|
3763
3858
|
shopGPT.productHandles = params.productHandles;
|
3764
3859
|
shopGPT.uiMode = params.uiMode;
|
3765
3860
|
shopGPT.path = params.path;
|
3861
|
+
shopGPT.brandName = params.brandName;
|
3862
|
+
shopGPT.quickPrompts = params.quickPrompts;
|
3863
|
+
shopGPT.merchantImage = params.merchantImage;
|
3766
3864
|
document.body.append(shopGPT);
|
3767
3865
|
},
|
3768
3866
|
});
|