@blotoutio/providers-shop-gpt-sdk 1.1.1 → 1.2.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.
Files changed (4) hide show
  1. package/index.cjs.js +629 -141
  2. package/index.js +629 -141
  3. package/index.mjs +629 -141
  4. package/package.json +1 -1
package/index.js CHANGED
@@ -430,11 +430,34 @@ var ProvidersShopGptSdk = (function () {
430
430
  const data = (await response.json());
431
431
  return data;
432
432
  };
433
+ const deleteSingleThread = async (threadId) => {
434
+ const response = await fetchImpl(getURL('/thread'), {
435
+ method: 'DELETE',
436
+ headers: getHeaders(),
437
+ credentials: 'include',
438
+ body: JSON.stringify({ threadId }),
439
+ });
440
+ if (!response.ok) {
441
+ throw new Error(`Failed to delete chat threads - ${response.status}: ${await response.text()}`);
442
+ }
443
+ };
444
+ const deleteAllThreads = async () => {
445
+ const response = await fetchImpl(getURL('/delete-threads'), {
446
+ method: 'DELETE',
447
+ headers: getHeaders(),
448
+ credentials: 'include',
449
+ });
450
+ if (!response.ok) {
451
+ throw new Error(`Failed to delete all chat threads - ${response.status}: ${await response.text()}`);
452
+ }
453
+ };
433
454
  return {
434
455
  processQuery,
435
456
  fetchChatHistory,
436
457
  fetchChatThreads,
437
458
  createChatThread,
459
+ deleteSingleThread,
460
+ deleteAllThreads,
438
461
  };
439
462
  };
440
463
 
@@ -551,52 +574,58 @@ var ProvidersShopGptSdk = (function () {
551
574
  * Copyright 2019 Google LLC
552
575
  * SPDX-License-Identifier: BSD-3-Clause
553
576
  */
554
- const t$3=globalThis,e$6=t$3.ShadowRoot&&(void 0===t$3.ShadyCSS||t$3.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$4=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s$2)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$6&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$4.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$4.set(s,t));}return t}toString(){return this.cssText}};const r$4=t=>new n$3("string"==typeof t?t:t+"",void 0,s$2),i$3=(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$3(o,t,s$2)},S$1=(s,o)=>{if(e$6)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$3.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$6?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$4(e)})(t):t;
577
+ 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$2=Symbol(),o$5=new WeakMap;let n$4 = class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s$2)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$2),i$3=(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$2)},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;
555
578
 
556
579
  /**
557
580
  * @license
558
581
  * Copyright 2017 Google LLC
559
582
  * SPDX-License-Identifier: BSD-3-Clause
560
- */const{is:i$2,defineProperty:e$5,getOwnPropertyDescriptor:r$3,getOwnPropertyNames:h$1,getOwnPropertySymbols:o$3,getPrototypeOf:n$2}=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$2(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$5(this.prototype,t,r);}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r$3(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$2(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$3(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
+ */const{is:i$2,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$2(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");
561
584
 
562
585
  /**
563
586
  * @license
564
587
  * Copyright 2017 Google LLC
565
588
  * SPDX-License-Identifier: BSD-3-Clause
566
589
  */
567
- const t$2=globalThis,i$1=t$2.trustedTypes,s$1=i$1?i$1.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$4="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$2="?"+h,n$1=`<${o$2}>`,r$2=document,l=()=>r$2.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),w=Symbol.for("lit-noChange"),T=Symbol.for("lit-nothing"),A=new WeakMap,E=r$2.createTreeWalker(r$2,129);function C(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$1?s$1.createHTML(i):i}const P=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":"",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$1:d>=0?(o.push(a),s.slice(0,d)+e$4+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [C(t,l+(t[s]||"<?>")+(2===i?"</svg>":"")),o]};class V{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]=P(t,s);if(this.el=V.createElement(f,n),E.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=E.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e$4)){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]?k:"?"===e[1]?H:"@"===e[1]?I:R}),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$1?i$1.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l()),E.nextNode(),d.push({type:2,index:++c});r.append(t[s],l());}}}else if(8===r.nodeType)if(r.data===o$2)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$2.createElement("template");return s.innerHTML=t,s}}function N(t,i,s=t,e){if(i===w)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=N(t,h._$AS(t,i.values),h,e)),i}class S{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$2).importNode(i,!0);E.currentNode=e;let h=E.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new M(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new L(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=E.nextNode(),o++);}return E.currentNode=r$2,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 M{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=T,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=N(this,t,i),c(t)?t===T||null==t||""===t?(this._$AH!==T&&this._$AR(),this._$AH=T):t!==this._$AH&&t!==w&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t);}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t));}_(t){this._$AH!==T&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r$2.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=V.createElement(C(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new S(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 V(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 M(this.S(l()),this.S(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 R{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=T,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=T;}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=N(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==w,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=N(this,e[s+n],i,n),r===w&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===T?t=T:t!==T&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class k extends R{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===T?void 0:t;}}class H extends R{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==T);}}class I extends R{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=N(this,t,i,0)??T)===w)return;const s=this._$AH,e=t===T&&s!==T||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==T&&(s===T||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 L{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){N(this,t);}}const Z=t$2.litHtmlPolyfillSupport;Z?.(V,M),(t$2.litHtmlVersions??=[]).push("3.1.3");const j=(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 M(i.insertBefore(l(),t),t,void 0,s??{});}return h._$AI(t),h};
590
+ const t$3=globalThis,i$1=t$3.trustedTypes,s$1=i$1?i$1.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),w=Symbol.for("lit-noChange"),T=Symbol.for("lit-nothing"),A=new WeakMap,E=r$4.createTreeWalker(r$4,129);function C(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$1?s$1.createHTML(i):i}const P=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":"",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 [C(t,l+(t[s]||"<?>")+(2===i?"</svg>":"")),o]};class V{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]=P(t,s);if(this.el=V.createElement(f,n),E.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=E.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]?k:"?"===e[1]?H:"@"===e[1]?I:R}),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$1?i$1.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l()),E.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 N(t,i,s=t,e){if(i===w)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=N(t,h._$AS(t,i.values),h,e)),i}class S{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);E.currentNode=e;let h=E.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new M(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new L(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=E.nextNode(),o++);}return E.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 M{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=T,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=N(this,t,i),c(t)?t===T||null==t||""===t?(this._$AH!==T&&this._$AR(),this._$AH=T):t!==this._$AH&&t!==w&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t);}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t));}_(t){this._$AH!==T&&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=V.createElement(C(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new S(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 V(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 M(this.S(l()),this.S(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 R{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=T,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=T;}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=N(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==w,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=N(this,e[s+n],i,n),r===w&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===T?t=T:t!==T&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class k extends R{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===T?void 0:t;}}class H extends R{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==T);}}class I extends R{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=N(this,t,i,0)??T)===w)return;const s=this._$AH,e=t===T&&s!==T||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==T&&(s===T||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 L{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){N(this,t);}}const Z=t$3.litHtmlPolyfillSupport;Z?.(V,M),(t$3.litHtmlVersions??=[]).push("3.1.3");const j=(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 M(i.insertBefore(l(),t),t,void 0,s??{});}return h._$AI(t),h};
568
591
 
569
592
  /**
570
593
  * @license
571
594
  * Copyright 2017 Google LLC
572
595
  * SPDX-License-Identifier: BSD-3-Clause
573
- */class s 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 i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=j(i,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return w}}s._$litElement$=!0,s[("finalized")]=!0,globalThis.litElementHydrateSupport?.({LitElement:s});const r$1=globalThis.litElementPolyfillSupport;r$1?.({LitElement:s});(globalThis.litElementVersions??=[]).push("4.0.5");
596
+ */class s 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 i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=j(i,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return w}}s._$litElement$=!0,s[("finalized")]=!0,globalThis.litElementHydrateSupport?.({LitElement:s});const r$3=globalThis.litElementPolyfillSupport;r$3?.({LitElement:s});(globalThis.litElementVersions??=[]).push("4.0.5");
574
597
 
575
598
  /**
576
599
  * @license
577
600
  * Copyright 2017 Google LLC
578
601
  * SPDX-License-Identifier: BSD-3-Clause
579
602
  */
580
- const t$1=t=>(e,o)=>{void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
603
+ const t$2=t=>(e,o)=>{void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
581
604
 
582
605
  /**
583
606
  * @license
584
607
  * Copyright 2017 Google LLC
585
608
  * SPDX-License-Identifier: BSD-3-Clause
586
- */const o$1={attribute:!0,type:String,converter:u$1,reflect:!1,hasChanged:f$1},r=(t=o$1,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t);},init(e){return void 0!==e&&this.P(o,void 0,t),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t);}}throw Error("Unsupported decorator location: "+n)};function n(t){return (e,o)=>"object"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
609
+ */const o$2={attribute:!0,type:String,converter:u$1,reflect:!1,hasChanged:f$1},r$2=(t=o$2,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t);},init(e){return void 0!==e&&this.P(o,void 0,t),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t);}}throw Error("Unsupported decorator location: "+n)};function n$1(t){return (e,o)=>"object"==typeof o?r$2(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
610
+
611
+ /**
612
+ * @license
613
+ * Copyright 2017 Google LLC
614
+ * SPDX-License-Identifier: BSD-3-Clause
615
+ */function r$1(r){return n$1({...r,state:!0,attribute:!1})}
587
616
 
588
617
  /**
589
618
  * @license
590
619
  * Copyright 2017 Google LLC
591
620
  * SPDX-License-Identifier: BSD-3-Clause
592
621
  */
593
- const e$3=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
622
+ const e$5=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
594
623
 
595
624
  /**
596
625
  * @license
597
626
  * Copyright 2017 Google LLC
598
627
  * SPDX-License-Identifier: BSD-3-Clause
599
- */function e$2(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$3(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$3(n,s,{get(){return o(this)}})}}
628
+ */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)}})}}
600
629
 
601
630
  const scrollBarStyles = i$3 `
602
631
  ::-webkit-scrollbar {
@@ -729,20 +758,20 @@ var ProvidersShopGptSdk = (function () {
729
758
  * Copyright 2017 Google LLC
730
759
  * SPDX-License-Identifier: BSD-3-Clause
731
760
  */
732
- const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e$1=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
761
+ const t$1={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e$3=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
733
762
 
734
763
  /**
735
764
  * @license
736
765
  * Copyright 2018 Google LLC
737
766
  * SPDX-License-Identifier: BSD-3-Clause
738
- */const e=e$1(class extends i{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.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 w}});
767
+ */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 w}});
739
768
 
740
769
  /**
741
770
  * @license
742
771
  * Copyright 2021 Google LLC
743
772
  * SPDX-License-Identifier: BSD-3-Clause
744
773
  */
745
- function*o(o,f){if(void 0!==o){let i=0;for(const t of o)yield f(t,i++);}}
774
+ function*o$1(o,f){if(void 0!==o){let i=0;for(const t of o)yield f(t,i++);}}
746
775
 
747
776
  const sendFilledIcon = b `
748
777
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
@@ -756,6 +785,9 @@ var ProvidersShopGptSdk = (function () {
756
785
  </defs>
757
786
  </svg>
758
787
  `;
788
+ const trashIcon = b `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
789
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6.75 1.125H11.25V2.25H6.75V1.125ZM2.25 3.375V4.5H3.375V15.75C3.375 16.0484 3.49353 16.3345 3.7045 16.5455C3.91548 16.7565 4.20163 16.875 4.5 16.875H13.5C13.7984 16.875 14.0845 16.7565 14.2955 16.5455C14.5065 16.3345 14.625 16.0484 14.625 15.75V4.5H15.75V3.375H2.25ZM4.5 15.75V4.5H13.5V15.75H4.5ZM6.75 6.75H7.875V13.5H6.75V6.75ZM10.125 6.75H11.25V13.5H10.125V6.75Z" fill="#A3B2C6"/>
790
+ </svg>`;
759
791
  const chatIcon = b `<svg focusable="false" preserveAspectRatio="xMidYMid meet" fill="currentColor" width="16" height="16" viewBox="0 0 32 32" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><path d="M16 19a6.9908 6.9908 0 01-5.833-3.1287l1.666-1.1074a5.0007 5.0007 0 008.334 0l1.666 1.1074A6.9908 6.9908 0 0116 19zM20 8a2 2 0 102 2A1.9806 1.9806 0 0020 8zM12 8a2 2 0 102 2A1.9806 1.9806 0 0012 8z"></path><path d="M17.7358,30,16,29l4-7h6a1.9966,1.9966,0,0,0,2-2V6a1.9966,1.9966,0,0,0-2-2H6A1.9966,1.9966,0,0,0,4,6V20a1.9966,1.9966,0,0,0,2,2h9v2H6a3.9993,3.9993,0,0,1-4-4V6A3.9988,3.9988,0,0,1,6,2H26a3.9988,3.9988,0,0,1,4,4V20a3.9993,3.9993,0,0,1-4,4H21.1646Z"></path></svg>`;
760
792
  const botIcon = b `
761
793
  <svg xmlns="http://www.w3.org/2000/svg" width="12" height="18" viewBox="0 0 12 18" fill="none">
@@ -896,6 +928,37 @@ var ProvidersShopGptSdk = (function () {
896
928
  flex: 1;
897
929
  overflow-y: auto;
898
930
  overflow-x: hidden;
931
+
932
+ .thread-wrapper {
933
+ display: flex;
934
+ justify-content: space-between;
935
+ align-items: center;
936
+
937
+ .trash-icon {
938
+ display: none;
939
+ padding: 2px;
940
+ cursor: pointer;
941
+
942
+ &:hover {
943
+ border-radius: 5px;
944
+ background: #dc3545;
945
+
946
+ path {
947
+ fill: white;
948
+ }
949
+ }
950
+ }
951
+
952
+ &:hover {
953
+ background: #f1f4f880;
954
+
955
+ .trash-icon {
956
+ display: flex;
957
+ justify-content: center;
958
+ align-items: center;
959
+ }
960
+ }
961
+ }
899
962
  }
900
963
 
901
964
  .thread-title {
@@ -905,12 +968,12 @@ var ProvidersShopGptSdk = (function () {
905
968
  cursor: pointer;
906
969
  }
907
970
 
908
- .thread-title.active {
971
+ .thread-wrapper.active {
909
972
  border-radius: 5px;
910
973
  background: #f1f4f8;
911
974
  }
912
975
 
913
- .thread-title.disabled {
976
+ .thread-wrapper.disabled {
914
977
  cursor: not-allowed;
915
978
  }
916
979
  }
@@ -973,13 +1036,31 @@ var ProvidersShopGptSdk = (function () {
973
1036
  `,
974
1037
  ];
975
1038
  LoadSpinner = __decorate([
976
- t$1('load-spinner')
1039
+ t$2('load-spinner')
977
1040
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
978
1041
  ], LoadSpinner);
979
1042
 
980
1043
  let ChatThreads =
981
1044
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
982
1045
  class ChatThreads extends s {
1046
+ getDomain() {
1047
+ var _a;
1048
+ if ((_a = this.merchantUrl) === null || _a === void 0 ? void 0 : _a.startsWith('https://')) {
1049
+ return this.merchantUrl;
1050
+ }
1051
+ return `https://${this.merchantUrl}`;
1052
+ }
1053
+ handleThreadDelete() {
1054
+ if (!this.deleteThreadId) {
1055
+ return;
1056
+ }
1057
+ this.dispatchEvent(new CustomEvent('delete-thread', {
1058
+ detail: { threadId: this.deleteThreadId },
1059
+ composed: true,
1060
+ bubbles: true,
1061
+ }));
1062
+ this.deleteThreadId = '';
1063
+ }
983
1064
  renderChatThreads() {
984
1065
  if (this.isLoading) {
985
1066
  return x `<div class="history">
@@ -992,21 +1073,36 @@ var ProvidersShopGptSdk = (function () {
992
1073
  <p class="title">History</p>
993
1074
  ${this.chatThreads.size
994
1075
  ? x `<div class="threads">
995
- ${o(this.chatThreads.values(), (thread) => x `
1076
+ ${o$1(this.chatThreads.values(), (thread) => x `
996
1077
  <div
997
- class=${e({
998
- 'thread-title': true,
1078
+ class=${e$2({
1079
+ 'thread-wrapper': true,
999
1080
  active: this.selectedThreadId === thread.threadId,
1000
1081
  disabled: this.isTyping,
1001
1082
  })}
1002
- @click=${async () => {
1083
+ >
1084
+ <div
1085
+ class="thread-title"
1086
+ @click=${async () => {
1003
1087
  if (this.isLoading || this.isTyping) {
1004
1088
  return;
1005
1089
  }
1006
1090
  await this.setSelectedThreadId(thread.threadId);
1007
1091
  }}
1008
- >
1009
- ${thread.title || 'New Search'}
1092
+ >
1093
+ ${thread.title || 'New Search'}
1094
+ </div>
1095
+ <div
1096
+ class="trash-icon"
1097
+ @click=${() => {
1098
+ if (this.isLoading || this.isTyping) {
1099
+ return;
1100
+ }
1101
+ this.deleteThreadId = thread.threadId;
1102
+ }}
1103
+ >
1104
+ ${trashIcon}
1105
+ </div>
1010
1106
  </div>
1011
1107
  `)}
1012
1108
  </div>`
@@ -1014,13 +1110,6 @@ var ProvidersShopGptSdk = (function () {
1014
1110
  </div>
1015
1111
  `;
1016
1112
  }
1017
- getDomain() {
1018
- var _a;
1019
- if ((_a = this.merchantUrl) === null || _a === void 0 ? void 0 : _a.startsWith('https://')) {
1020
- return this.merchantUrl;
1021
- }
1022
- return `https://${this.merchantUrl}`;
1023
- }
1024
1113
  render() {
1025
1114
  return x `
1026
1115
  <div class="shop-gpt-icon">${shopGPTIcon}</div>
@@ -1040,32 +1129,50 @@ var ProvidersShopGptSdk = (function () {
1040
1129
  </a>
1041
1130
  </div>`
1042
1131
  : T}
1132
+ ${this.deleteThreadId
1133
+ ? x `
1134
+ <confirm-dialog
1135
+ @accept=${this.handleThreadDelete}
1136
+ @decline=${() => (this.deleteThreadId = '')}
1137
+ >
1138
+ <h2 slot="title">Delete Thread?</h2>
1139
+ <p slot="content">
1140
+ This action cannot be undone. Are you sure you want to delete
1141
+ <b>"${this.chatThreads.get(this.deleteThreadId).title}"</b>?
1142
+ </p>
1143
+ </confirm-dialog>
1144
+ `
1145
+ : T}
1043
1146
  `;
1044
1147
  }
1045
1148
  };
1046
1149
  ChatThreads.styles = [chatThreadsStyles];
1047
1150
  __decorate([
1048
- n({ type: Object }),
1151
+ n$1({ type: Object }),
1049
1152
  __metadata("design:type", Map)
1050
1153
  ], ChatThreads.prototype, "chatThreads", void 0);
1051
1154
  __decorate([
1052
- n({ type: String }),
1155
+ n$1({ type: String }),
1053
1156
  __metadata("design:type", Object)
1054
1157
  ], ChatThreads.prototype, "merchantUrl", void 0);
1055
1158
  __decorate([
1056
- n({ type: Boolean }),
1159
+ n$1({ type: Boolean }),
1057
1160
  __metadata("design:type", Boolean)
1058
1161
  ], ChatThreads.prototype, "isLoading", void 0);
1059
1162
  __decorate([
1060
- n({ type: Boolean }),
1163
+ n$1({ type: Boolean }),
1061
1164
  __metadata("design:type", Boolean)
1062
1165
  ], ChatThreads.prototype, "isTyping", void 0);
1063
1166
  __decorate([
1064
- n({ type: String }),
1167
+ n$1({ type: String }),
1065
1168
  __metadata("design:type", String)
1066
1169
  ], ChatThreads.prototype, "selectedThreadId", void 0);
1170
+ __decorate([
1171
+ r$1(),
1172
+ __metadata("design:type", String)
1173
+ ], ChatThreads.prototype, "deleteThreadId", void 0);
1067
1174
  ChatThreads = __decorate([
1068
- t$1('chat-threads')
1175
+ t$2('chat-threads')
1069
1176
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1070
1177
  ], ChatThreads);
1071
1178
 
@@ -1267,6 +1374,14 @@ var ProvidersShopGptSdk = (function () {
1267
1374
  }
1268
1375
  (_a = open(url, '_blank')) === null || _a === void 0 ? void 0 : _a.focus();
1269
1376
  }
1377
+ renderVariantTitles() {
1378
+ if (!this.product.hasVariantsThatRequiresComponents) {
1379
+ return T;
1380
+ }
1381
+ return this.product.variants[0].selectedOptions.map((option) => x `
1382
+ <p class="product-variation-details">${option.name}: ${option.value}</p>
1383
+ `);
1384
+ }
1270
1385
  render() {
1271
1386
  return x `
1272
1387
  <div class="product">
@@ -1283,11 +1398,7 @@ var ProvidersShopGptSdk = (function () {
1283
1398
  >
1284
1399
  ${this.product.title}
1285
1400
  </p>
1286
- ${this.product.variants[0].selectedOptions.map((option) => x `
1287
- <p class="product-variation-details">
1288
- ${option.name}: ${option.value}
1289
- </p>
1290
- `)}
1401
+ ${this.renderVariantTitles()}
1291
1402
  <div class="prices">
1292
1403
  ${this.product.variants[0].comparedAtPrice &&
1293
1404
  this.product.variants[0].comparedAtPrice !==
@@ -1311,15 +1422,15 @@ var ProvidersShopGptSdk = (function () {
1311
1422
  };
1312
1423
  ProductItem.styles = [productItemStyles];
1313
1424
  __decorate([
1314
- n({ type: Object }),
1425
+ n$1({ type: Object }),
1315
1426
  __metadata("design:type", Object)
1316
1427
  ], ProductItem.prototype, "product", void 0);
1317
1428
  __decorate([
1318
- n({ type: Object }),
1429
+ n$1({ type: Object }),
1319
1430
  __metadata("design:type", Object)
1320
1431
  ], ProductItem.prototype, "siteCurrency", void 0);
1321
1432
  ProductItem = __decorate([
1322
- t$1('product-item')
1433
+ t$2('product-item')
1323
1434
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1324
1435
  ], ProductItem);
1325
1436
 
@@ -1414,9 +1525,9 @@ var ProvidersShopGptSdk = (function () {
1414
1525
  return x `
1415
1526
  <div class="products-wrapper">
1416
1527
  <div class="products" @scroll=${this.updateButtonsState}>
1417
- ${o(this.products, (product) => x `
1528
+ ${o$1(this.products, (product) => x `
1418
1529
  <div
1419
- class=${e({
1530
+ class=${e$2({
1420
1531
  'product-container': true,
1421
1532
  modal: this.viewType === 'modal',
1422
1533
  })}
@@ -1440,27 +1551,27 @@ var ProvidersShopGptSdk = (function () {
1440
1551
  };
1441
1552
  ProductsList.styles = [productsListStyles];
1442
1553
  __decorate([
1443
- n({ type: Array }),
1554
+ n$1({ type: Array }),
1444
1555
  __metadata("design:type", Array)
1445
1556
  ], ProductsList.prototype, "products", void 0);
1446
1557
  __decorate([
1447
- n({ type: Object }),
1558
+ n$1({ type: Object }),
1448
1559
  __metadata("design:type", Object)
1449
1560
  ], ProductsList.prototype, "siteCurrency", void 0);
1450
1561
  __decorate([
1451
- e$2('.left-btn'),
1562
+ e$4('.left-btn'),
1452
1563
  __metadata("design:type", Object)
1453
1564
  ], ProductsList.prototype, "leftBtnEle", void 0);
1454
1565
  __decorate([
1455
- e$2('.right-btn'),
1566
+ e$4('.right-btn'),
1456
1567
  __metadata("design:type", Object)
1457
1568
  ], ProductsList.prototype, "rightBtnEle", void 0);
1458
1569
  __decorate([
1459
- e$2('.products'),
1570
+ e$4('.products'),
1460
1571
  __metadata("design:type", Object)
1461
1572
  ], ProductsList.prototype, "productsEle", void 0);
1462
1573
  ProductsList = __decorate([
1463
- t$1('products-list')
1574
+ t$2('products-list')
1464
1575
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1465
1576
  ], ProductsList);
1466
1577
 
@@ -1508,31 +1619,31 @@ var ProvidersShopGptSdk = (function () {
1508
1619
  };
1509
1620
  ProductsSection.styles = [productsSectionStyles];
1510
1621
  __decorate([
1511
- n({ type: Array }),
1622
+ n$1({ type: Array }),
1512
1623
  __metadata("design:type", Array)
1513
1624
  ], ProductsSection.prototype, "products", void 0);
1514
1625
  __decorate([
1515
- n({ type: Boolean }),
1626
+ n$1({ type: Boolean }),
1516
1627
  __metadata("design:type", Boolean)
1517
1628
  ], ProductsSection.prototype, "isLoadingHistory", void 0);
1518
1629
  __decorate([
1519
- n({ type: Object }),
1630
+ n$1({ type: Object }),
1520
1631
  __metadata("design:type", Object)
1521
1632
  ], ProductsSection.prototype, "siteCurrency", void 0);
1522
1633
  __decorate([
1523
- e$2('.left-btn'),
1634
+ e$4('.left-btn'),
1524
1635
  __metadata("design:type", Object)
1525
1636
  ], ProductsSection.prototype, "leftBtnEle", void 0);
1526
1637
  __decorate([
1527
- e$2('.right-btn'),
1638
+ e$4('.right-btn'),
1528
1639
  __metadata("design:type", Object)
1529
1640
  ], ProductsSection.prototype, "rightBtnEle", void 0);
1530
1641
  __decorate([
1531
- e$2('.products'),
1642
+ e$4('.products'),
1532
1643
  __metadata("design:type", Object)
1533
1644
  ], ProductsSection.prototype, "productsEle", void 0);
1534
1645
  ProductsSection = __decorate([
1535
- t$1('products-section')
1646
+ t$2('products-section')
1536
1647
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1537
1648
  ], ProductsSection);
1538
1649
 
@@ -1573,6 +1684,9 @@ var ProvidersShopGptSdk = (function () {
1573
1684
  font-weight: 600;
1574
1685
  line-height: 21px;
1575
1686
  text-transform: capitalize;
1687
+ white-space: nowrap;
1688
+ overflow: hidden;
1689
+ text-overflow: ellipsis;
1576
1690
  }
1577
1691
 
1578
1692
  .btn-context {
@@ -1711,6 +1825,10 @@ var ProvidersShopGptSdk = (function () {
1711
1825
  gap: 28px;
1712
1826
  padding-bottom: 10px;
1713
1827
  margin-bottom: -10px;
1828
+
1829
+ .message:last-child {
1830
+ margin-top: 10px;
1831
+ }
1714
1832
  }
1715
1833
 
1716
1834
  .message {
@@ -1928,15 +2046,28 @@ var ProvidersShopGptSdk = (function () {
1928
2046
  }
1929
2047
 
1930
2048
  .thread-title {
2049
+ display: flex;
2050
+ justify-content: space-between;
1931
2051
  padding: 10px 16px;
1932
2052
  color: #4e647f;
1933
- font-size: 14px;
1934
- font-weight: 400;
1935
- line-height: 20px;
1936
2053
  cursor: pointer;
1937
2054
 
2055
+ p {
2056
+ font-size: 14px;
2057
+ font-weight: 400;
2058
+ line-height: 20px;
2059
+ }
2060
+
2061
+ .trash-icon {
2062
+ display: none;
2063
+ }
2064
+
1938
2065
  &:hover {
1939
2066
  background: #f1f4f8;
2067
+
2068
+ .trash-icon {
2069
+ display: flex;
2070
+ }
1940
2071
  }
1941
2072
  }
1942
2073
 
@@ -1945,6 +2076,23 @@ var ProvidersShopGptSdk = (function () {
1945
2076
  }
1946
2077
  }
1947
2078
 
2079
+ .trash-icon {
2080
+ display: flex;
2081
+ justify-content: center;
2082
+ align-items: center;
2083
+ padding: 2px;
2084
+ cursor: pointer;
2085
+
2086
+ &:hover {
2087
+ border-radius: 5px;
2088
+ background: #dc3545;
2089
+
2090
+ path {
2091
+ fill: white;
2092
+ }
2093
+ }
2094
+ }
2095
+
1948
2096
  .chat-threads-background {
1949
2097
  position: absolute;
1950
2098
  top: 78px;
@@ -1963,6 +2111,16 @@ var ProvidersShopGptSdk = (function () {
1963
2111
  return str === null || str === void 0 ? void 0 : str.replace(/^\w/, (char) => char.toUpperCase());
1964
2112
  };
1965
2113
 
2114
+ const plusBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
2115
+ <path d="M12.75 11.25V6H11.25V11.25H6V12.75H11.25V18H12.75V12.75H18V11.25H12.75Z" fill="white"/>
2116
+ </svg>`;
2117
+ const timerBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
2118
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6.16652 20.7304C7.89323 21.8842 9.9233 22.5 12 22.5C14.7848 22.5 17.4555 21.3938 19.4246 19.4246C21.3938 17.4555 22.5 14.7848 22.5 12C22.5 9.9233 21.8842 7.89323 20.7304 6.16652C19.5767 4.4398 17.9368 3.09399 16.0182 2.29927C14.0996 1.50455 11.9884 1.29661 9.95156 1.70176C7.91476 2.1069 6.04383 3.10693 4.57538 4.57538C3.10693 6.04383 2.1069 7.91476 1.70176 9.95156C1.29661 11.9884 1.50455 14.0996 2.29927 16.0182C3.09399 17.9368 4.4398 19.5767 6.16652 20.7304ZM6.99987 4.51678C8.47992 3.52785 10.22 3 12 3C14.387 3 16.6761 3.94822 18.364 5.63604C20.0518 7.32387 21 9.61306 21 12C21 13.78 20.4722 15.5201 19.4832 17.0001C18.4943 18.4802 17.0887 19.6337 15.4442 20.3149C13.7996 20.9961 11.99 21.1743 10.2442 20.8271C8.49836 20.4798 6.89472 19.6226 5.63604 18.364C4.37737 17.1053 3.5202 15.5016 3.17294 13.7558C2.82567 12.01 3.0039 10.2004 3.68509 8.55585C4.36628 6.91132 5.51983 5.50571 6.99987 4.51678ZM11.25 12.3075L15.4425 16.5L16.5 15.4425L12.75 11.685V5.25H11.25V12.3075Z" fill="white"/>
2119
+ </svg>`;
2120
+ const crossBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
2121
+ <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"/>
2122
+ </svg>`;
2123
+
1966
2124
  const personalizeDialogStyles = i$3 `
1967
2125
  :host {
1968
2126
  font-family: 'Inter', sans-serif;
@@ -2449,63 +2607,318 @@ var ProvidersShopGptSdk = (function () {
2449
2607
  };
2450
2608
  PersonalizeDialog.styles = [personalizeDialogStyles];
2451
2609
  __decorate([
2452
- e$2('dialog'),
2610
+ e$4('dialog'),
2453
2611
  __metadata("design:type", HTMLDialogElement)
2454
2612
  ], PersonalizeDialog.prototype, "dialogModal", void 0);
2455
2613
  __decorate([
2456
- e$2('.dropdown-list'),
2614
+ e$4('.dropdown-list'),
2457
2615
  __metadata("design:type", HTMLUListElement)
2458
2616
  ], PersonalizeDialog.prototype, "dropdownList", void 0);
2459
2617
  __decorate([
2460
- e$2('.dropdown-trigger'),
2618
+ e$4('.dropdown-trigger'),
2461
2619
  __metadata("design:type", HTMLDivElement)
2462
2620
  ], PersonalizeDialog.prototype, "dropdownTrigger", void 0);
2463
2621
  __decorate([
2464
- n({ type: Array }),
2622
+ n$1({ type: Array }),
2465
2623
  __metadata("design:type", Array)
2466
2624
  ], PersonalizeDialog.prototype, "defaultProductHandles", void 0);
2467
2625
  __decorate([
2468
- n({ type: Array }),
2626
+ n$1({ type: Array }),
2469
2627
  __metadata("design:type", Array)
2470
2628
  ], PersonalizeDialog.prototype, "defaultProfiles", void 0);
2471
2629
  __decorate([
2472
- n({ type: Boolean }),
2630
+ n$1({ type: Boolean }),
2473
2631
  __metadata("design:type", Boolean)
2474
2632
  ], PersonalizeDialog.prototype, "isLoading", void 0);
2475
2633
  __decorate([
2476
- n({ type: String }),
2634
+ n$1({ type: String }),
2477
2635
  __metadata("design:type", Object)
2478
2636
  ], PersonalizeDialog.prototype, "state", void 0);
2479
2637
  __decorate([
2480
- n({ type: String }),
2638
+ n$1({ type: String }),
2481
2639
  __metadata("design:type", Object)
2482
2640
  ], PersonalizeDialog.prototype, "profileType", void 0);
2483
2641
  __decorate([
2484
- n({ type: String }),
2642
+ n$1({ type: String }),
2485
2643
  __metadata("design:type", Object)
2486
2644
  ], PersonalizeDialog.prototype, "selectedProfile", void 0);
2487
2645
  __decorate([
2488
- n({ type: String }),
2646
+ n$1({ type: String }),
2489
2647
  __metadata("design:type", Object)
2490
2648
  ], PersonalizeDialog.prototype, "visitorType", void 0);
2491
2649
  __decorate([
2492
- n({ type: String }),
2650
+ n$1({ type: String }),
2493
2651
  __metadata("design:type", Object)
2494
2652
  ], PersonalizeDialog.prototype, "productHandle", void 0);
2495
2653
  PersonalizeDialog = __decorate([
2496
- t$1('personalize-dialog')
2654
+ t$2('personalize-dialog')
2497
2655
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2498
2656
  ], PersonalizeDialog);
2499
2657
 
2500
- const plusBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
2501
- <path d="M12.75 11.25V6H11.25V11.25H6V12.75H11.25V18H12.75V12.75H18V11.25H12.75Z" fill="white"/>
2502
- </svg>`;
2503
- const timerBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
2504
- <path fill-rule="evenodd" clip-rule="evenodd" d="M6.16652 20.7304C7.89323 21.8842 9.9233 22.5 12 22.5C14.7848 22.5 17.4555 21.3938 19.4246 19.4246C21.3938 17.4555 22.5 14.7848 22.5 12C22.5 9.9233 21.8842 7.89323 20.7304 6.16652C19.5767 4.4398 17.9368 3.09399 16.0182 2.29927C14.0996 1.50455 11.9884 1.29661 9.95156 1.70176C7.91476 2.1069 6.04383 3.10693 4.57538 4.57538C3.10693 6.04383 2.1069 7.91476 1.70176 9.95156C1.29661 11.9884 1.50455 14.0996 2.29927 16.0182C3.09399 17.9368 4.4398 19.5767 6.16652 20.7304ZM6.99987 4.51678C8.47992 3.52785 10.22 3 12 3C14.387 3 16.6761 3.94822 18.364 5.63604C20.0518 7.32387 21 9.61306 21 12C21 13.78 20.4722 15.5201 19.4832 17.0001C18.4943 18.4802 17.0887 19.6337 15.4442 20.3149C13.7996 20.9961 11.99 21.1743 10.2442 20.8271C8.49836 20.4798 6.89472 19.6226 5.63604 18.364C4.37737 17.1053 3.5202 15.5016 3.17294 13.7558C2.82567 12.01 3.0039 10.2004 3.68509 8.55585C4.36628 6.91132 5.51983 5.50571 6.99987 4.51678ZM11.25 12.3075L15.4425 16.5L16.5 15.4425L12.75 11.685V5.25H11.25V12.3075Z" fill="white"/>
2505
- </svg>`;
2506
- const crossBtn = b `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
2507
- <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"/>
2508
- </svg>`;
2658
+ /**
2659
+ * @license
2660
+ * Copyright 2017 Google LLC
2661
+ * SPDX-License-Identifier: BSD-3-Clause
2662
+ */let e$1 = class e extends i{constructor(i){if(super(i),this.it=T,i.type!==t$1.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===T||null==r)return this._t=void 0,this.it=r;if(r===w)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);
2663
+
2664
+ 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,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}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,"")}
2665
+
2666
+ let MarkdownRenderer =
2667
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2668
+ class MarkdownRenderer extends s {
2669
+ render() {
2670
+ const slotContent = this.innerHTML.trim();
2671
+ const parsedContent = t(slotContent);
2672
+ return o(parsedContent);
2673
+ }
2674
+ };
2675
+ MarkdownRenderer.styles = i$3 `
2676
+ :host {
2677
+ font-family: 'Inter', sans-serif;
2678
+ font-size: 16px;
2679
+ font-weight: 400;
2680
+
2681
+ p {
2682
+ margin: 0;
2683
+ }
2684
+ }
2685
+ `;
2686
+ MarkdownRenderer = __decorate([
2687
+ t$2('markdown-renderer')
2688
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2689
+ ], MarkdownRenderer);
2690
+
2691
+ let TooltipComponent =
2692
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2693
+ class TooltipComponent extends s {
2694
+ constructor() {
2695
+ super(...arguments);
2696
+ this.position = 'bottom-left';
2697
+ this.text = '';
2698
+ }
2699
+ render() {
2700
+ return x `
2701
+ <slot></slot>
2702
+ <div class="tooltip ${this.position}">${this.text}</div>
2703
+ `;
2704
+ }
2705
+ };
2706
+ TooltipComponent.styles = [
2707
+ i$3 `
2708
+ :host {
2709
+ position: relative;
2710
+ display: inline-block;
2711
+ }
2712
+ .tooltip {
2713
+ position: absolute;
2714
+ color: #172a41;
2715
+ padding: 4px 8px;
2716
+ border-radius: 4px;
2717
+ white-space: nowrap;
2718
+ font-size: 12px;
2719
+ opacity: 0;
2720
+ transition: opacity 0.2s;
2721
+ pointer-events: none;
2722
+
2723
+ border-radius: 5px;
2724
+ background: #ffcc81;
2725
+ box-shadow: 0px 4px 6px -1px rgba(0, 0, 0, 0.1),
2726
+ 0px 2px 4px -1px rgba(0, 0, 0, 0.06);
2727
+
2728
+ font-style: normal;
2729
+ font-weight: 400;
2730
+ line-height: 150%;
2731
+ }
2732
+ :host(:hover) .tooltip {
2733
+ opacity: 1;
2734
+ }
2735
+ .top-center {
2736
+ bottom: calc(100% + 2px);
2737
+ left: 50%;
2738
+ transform: translateX(-50%);
2739
+ }
2740
+ .top-left {
2741
+ bottom: calc(100% + 2px);
2742
+ left: 0;
2743
+ }
2744
+ .top-right {
2745
+ bottom: calc(100% + 2px);
2746
+ right: 0;
2747
+ }
2748
+ .bottom-center {
2749
+ top: calc(100% + 2px);
2750
+ left: 50%;
2751
+ transform: translateX(-50%);
2752
+ }
2753
+ .bottom-left {
2754
+ top: calc(100% + 2px);
2755
+ left: 0;
2756
+ }
2757
+ .bottom-right {
2758
+ top: calc(100% + 2px);
2759
+ right: 0;
2760
+ }
2761
+ .left-center {
2762
+ right: calc(100% + 2px);
2763
+ top: 50%;
2764
+ transform: translateY(-50%);
2765
+ }
2766
+ .left-top {
2767
+ right: calc(100% + 2px);
2768
+ top: 0;
2769
+ }
2770
+ .left-bottom {
2771
+ right: calc(100% + 2px);
2772
+ bottom: 0;
2773
+ }
2774
+ .right-center {
2775
+ left: calc(100% + 2px);
2776
+ top: 50%;
2777
+ transform: translateY(-50%);
2778
+ }
2779
+ .right-top {
2780
+ left: calc(100% + 2px);
2781
+ top: 0;
2782
+ }
2783
+ .right-bottom {
2784
+ left: calc(100% + 2px);
2785
+ bottom: 0;
2786
+ }
2787
+ `,
2788
+ ];
2789
+ __decorate([
2790
+ n$1({ type: String }),
2791
+ __metadata("design:type", String)
2792
+ ], TooltipComponent.prototype, "position", void 0);
2793
+ __decorate([
2794
+ n$1({ type: String }),
2795
+ __metadata("design:type", String)
2796
+ ], TooltipComponent.prototype, "text", void 0);
2797
+ TooltipComponent = __decorate([
2798
+ t$2('tooltip-component')
2799
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2800
+ ], TooltipComponent);
2801
+
2802
+ const confirmDialogStyles = i$3 `
2803
+ :host {
2804
+ font-family: 'Inter', sans-serif;
2805
+ font-size: 16px;
2806
+ font-weight: 400;
2807
+
2808
+ display: flex;
2809
+ position: absolute;
2810
+ top: 0;
2811
+ left: 0;
2812
+ width: 100%;
2813
+ height: 100%;
2814
+ background: #00000050;
2815
+ }
2816
+
2817
+ .modal {
2818
+ width: 75%;
2819
+ max-width: 350px;
2820
+ background: #fff;
2821
+ padding: 16px;
2822
+ margin: auto;
2823
+
2824
+ border-radius: 10px;
2825
+ box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.12),
2826
+ 0px 20px 20px 0px rgba(0, 0, 0, 0.08);
2827
+
2828
+ z-index: 2000;
2829
+ }
2830
+
2831
+ ::slotted([slot='title']) {
2832
+ margin-bottom: 8px !important;
2833
+ color: #172a41;
2834
+ font-size: 18px;
2835
+ font-weight: 700;
2836
+ line-height: 150%;
2837
+ }
2838
+
2839
+ ::slotted([slot='content']) {
2840
+ color: #4e647f;
2841
+ line-height: 150%;
2842
+ }
2843
+
2844
+ .button-wrapper {
2845
+ margin-top: 12px;
2846
+ display: flex;
2847
+ gap: 12px;
2848
+
2849
+ .btn {
2850
+ justify-self: stretch;
2851
+ padding: 10px;
2852
+ cursor: pointer;
2853
+ text-align: center;
2854
+ width: 100%;
2855
+ border: 0;
2856
+ color: #fff;
2857
+ line-height: 150%;
2858
+ text-transform: capitalize;
2859
+ }
2860
+
2861
+ .accept-btn {
2862
+ border-radius: 5px;
2863
+ background: #dc3545;
2864
+
2865
+ &:hover {
2866
+ background: rgb(176, 62, 25);
2867
+ }
2868
+ }
2869
+
2870
+ .decline-btn {
2871
+ border-radius: 5px;
2872
+ background: #4e647f;
2873
+
2874
+ &:hover {
2875
+ background: rgb(57, 77, 102);
2876
+ }
2877
+ }
2878
+ }
2879
+ `;
2880
+
2881
+ let ConfirmDialog =
2882
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2883
+ class ConfirmDialog extends s {
2884
+ onAcceptClick(e) {
2885
+ e.preventDefault();
2886
+ this.dispatchEvent(new CustomEvent('accept', {
2887
+ composed: true,
2888
+ }));
2889
+ }
2890
+ onCancelClick(e) {
2891
+ e.preventDefault();
2892
+ this.dispatchEvent(new CustomEvent('decline', {
2893
+ composed: true,
2894
+ }));
2895
+ }
2896
+ render() {
2897
+ return x `
2898
+ <div class="modal">
2899
+ <slot name="title"></slot>
2900
+ <slot name="content"></slot>
2901
+ <div class="button-wrapper">
2902
+ <slot name="accept-btn">
2903
+ <button class="btn accept-btn" @click=${this.onAcceptClick}>
2904
+ Delete
2905
+ </button>
2906
+ </slot>
2907
+ <slot name="decline-btn">
2908
+ <button class="btn decline-btn" @click=${this.onCancelClick}>
2909
+ Cancel
2910
+ </button>
2911
+ </slot>
2912
+ </div>
2913
+ </div>
2914
+ `;
2915
+ }
2916
+ };
2917
+ ConfirmDialog.styles = [confirmDialogStyles];
2918
+ ConfirmDialog = __decorate([
2919
+ t$2('confirm-dialog')
2920
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2921
+ ], ConfirmDialog);
2509
2922
 
2510
2923
  let ChatSection =
2511
2924
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -2536,6 +2949,17 @@ var ProvidersShopGptSdk = (function () {
2536
2949
  this.userQuery = '';
2537
2950
  await this.processMessage(e, message);
2538
2951
  }
2952
+ handleThreadDelete() {
2953
+ if (!this.deleteThreadId) {
2954
+ return;
2955
+ }
2956
+ this.dispatchEvent(new CustomEvent('delete-thread', {
2957
+ detail: { threadId: this.deleteThreadId },
2958
+ composed: true,
2959
+ bubbles: true,
2960
+ }));
2961
+ this.deleteThreadId = '';
2962
+ }
2539
2963
  typingIndicator() {
2540
2964
  return x `<div class="typing-dots">
2541
2965
  <div class="dot"></div>
@@ -2552,7 +2976,9 @@ var ProvidersShopGptSdk = (function () {
2552
2976
  <div class="bot-icon">${botIcon}</div>
2553
2977
  </div>
2554
2978
  <div>
2555
- ${message.message ? x `<p>${message.message}</p>` : T}
2979
+ ${message.message
2980
+ ? x `<markdown-renderer>${message.message}</markdown-renderer>`
2981
+ : T}
2556
2982
  ${this.viewType !== 'modal' && ((_a = message.products) === null || _a === void 0 ? void 0 : _a[0])
2557
2983
  ? x `
2558
2984
  <span class="line"></span>
@@ -2717,37 +3143,49 @@ var ProvidersShopGptSdk = (function () {
2717
3143
  <div>${botIcon}</div>
2718
3144
  <h2>${((_a = this.thread) === null || _a === void 0 ? void 0 : _a.title) || 'New Search'}</h2>
2719
3145
  <div class="btns-wrapper">
2720
- <button
2721
- class="btn btn-icon new-search-btn"
2722
- title="New chat"
2723
- @click=${async () => {
3146
+ <tooltip-component .position=${'bottom-right'} .text=${'New Chat'}>
3147
+ <button
3148
+ class="btn btn-icon new-search-btn"
3149
+ @click=${(e) => {
2724
3150
  var _a;
2725
- await ((_a = this.setSelectedThreadId) === null || _a === void 0 ? void 0 : _a.call(this, ''));
3151
+ e.preventDefault();
3152
+ (_a = this.setSelectedThreadId) === null || _a === void 0 ? void 0 : _a.call(this, '');
2726
3153
  }}
3154
+ >
3155
+ ${plusBtn}
3156
+ </button>
3157
+ </tooltip-component>
3158
+ <tooltip-component
3159
+ .position=${'bottom-right'}
3160
+ .text=${'Your Search History'}
2727
3161
  >
2728
- ${plusBtn}
2729
- </button>
2730
- <button
2731
- class=${e({
3162
+ <button
3163
+ class=${e$2({
2732
3164
  btn: true,
2733
3165
  'btn-icon': true,
2734
3166
  'threads-btn': true,
2735
3167
  active: this.showChatThreads,
2736
3168
  })}
2737
- title="Your Search History"
2738
- @click=${() => {
3169
+ @click=${(e) => {
3170
+ e.preventDefault();
2739
3171
  this.showChatThreads = !this.showChatThreads;
2740
3172
  }}
2741
- >
2742
- ${timerBtn}
2743
- </button>
2744
- <button
2745
- class="btn btn-icon close-btn"
2746
- title="Close chat"
2747
- @click=${() => { var _a; return (_a = this.closeModal) === null || _a === void 0 ? void 0 : _a.call(this); }}
2748
- >
2749
- ${crossBtn}
2750
- </button>
3173
+ >
3174
+ ${timerBtn}
3175
+ </button>
3176
+ </tooltip-component>
3177
+ <tooltip-component .position=${'bottom-right'} .text=${'Close Chat'}>
3178
+ <button
3179
+ class="btn btn-icon close-btn"
3180
+ @click=${(e) => {
3181
+ var _a;
3182
+ e.preventDefault();
3183
+ (_a = this.closeModal) === null || _a === void 0 ? void 0 : _a.call(this);
3184
+ }}
3185
+ >
3186
+ ${crossBtn}
3187
+ </button>
3188
+ </tooltip-component>
2751
3189
  </div>
2752
3190
  `;
2753
3191
  }
@@ -2796,23 +3234,38 @@ var ProvidersShopGptSdk = (function () {
2796
3234
  <div class="chat-threads">
2797
3235
  <h2>Your Search History</h2>
2798
3236
  <div class="thread-titles-wrapper">
2799
- ${o(this.chatThreads.values(), (thread) => x `
2800
- <p
2801
- class=${e({
3237
+ ${o$1(this.chatThreads.values(), (thread) => x `
3238
+ <div
3239
+ class=${e$2({
2802
3240
  'thread-title': true,
2803
3241
  disabled: this.isTyping,
2804
3242
  })}
2805
- @click=${async () => {
3243
+ >
3244
+ <p
3245
+ @click=${() => {
2806
3246
  var _a;
2807
3247
  if (this.isTyping) {
2808
3248
  return;
2809
3249
  }
2810
3250
  this.showChatThreads = false;
2811
- await ((_a = this.setSelectedThreadId) === null || _a === void 0 ? void 0 : _a.call(this, thread.threadId));
3251
+ (_a = this.setSelectedThreadId) === null || _a === void 0 ? void 0 : _a.call(this, thread.threadId);
2812
3252
  }}
2813
- >
2814
- ${thread.title || 'New Search'}
2815
- </p>
3253
+ >
3254
+ ${thread.title || 'New Search'}
3255
+ </p>
3256
+ <div
3257
+ class="trash-icon"
3258
+ @click=${() => {
3259
+ if (this.isTyping) {
3260
+ return;
3261
+ }
3262
+ this.deleteThreadId = thread.threadId;
3263
+ this.showChatThreads = false;
3264
+ }}
3265
+ >
3266
+ ${trashIcon}
3267
+ </div>
3268
+ </div>
2816
3269
  `)}
2817
3270
  </div>
2818
3271
  </div>
@@ -2826,7 +3279,7 @@ var ProvidersShopGptSdk = (function () {
2826
3279
  return x `
2827
3280
  <div class="chat-header">${this.contextButton()}</div>
2828
3281
  <div
2829
- class=${e({
3282
+ class=${e$2({
2830
3283
  'chatbot-section': true,
2831
3284
  'modal-view': this.viewType === 'modal',
2832
3285
  })}
@@ -2840,7 +3293,7 @@ var ProvidersShopGptSdk = (function () {
2840
3293
  placeholder="Type your search here..."
2841
3294
  />
2842
3295
  <button
2843
- class=${e({
3296
+ class=${e$2({
2844
3297
  btn: true,
2845
3298
  modal: this.viewType === 'modal',
2846
3299
  })}
@@ -2857,72 +3310,90 @@ var ProvidersShopGptSdk = (function () {
2857
3310
  .defaultProfiles=${this.profiles}
2858
3311
  ></personalize-dialog>
2859
3312
  ${this.renderChatThreads()}
3313
+ ${this.deleteThreadId
3314
+ ? x `
3315
+ <confirm-dialog
3316
+ @accept=${this.handleThreadDelete}
3317
+ @decline=${() => (this.deleteThreadId = '')}
3318
+ >
3319
+ <h2 slot="title">Delete Thread?</h2>
3320
+ <p slot="content">
3321
+ This action cannot be undone. Are you sure you want to delete
3322
+ <b>"${this.chatThreads.get(this.deleteThreadId).title}"</b>?
3323
+ </p>
3324
+ </confirm-dialog>
3325
+ `
3326
+ : T}
2860
3327
  `;
2861
3328
  }
2862
3329
  };
2863
3330
  ChatSection.styles = [chatSectionStyles];
2864
3331
  __decorate([
2865
- n({ type: Object }),
3332
+ n$1({ type: Object }),
2866
3333
  __metadata("design:type", Map)
2867
3334
  ], ChatSection.prototype, "chatThreads", void 0);
2868
3335
  __decorate([
2869
- n({ type: Boolean }),
3336
+ r$1(),
3337
+ __metadata("design:type", String)
3338
+ ], ChatSection.prototype, "deleteThreadId", void 0);
3339
+ __decorate([
3340
+ n$1({ type: Boolean }),
2870
3341
  __metadata("design:type", Boolean)
2871
3342
  ], ChatSection.prototype, "showChatThreads", void 0);
2872
3343
  __decorate([
2873
- n({ type: Boolean }),
3344
+ n$1({ type: Boolean }),
2874
3345
  __metadata("design:type", Boolean)
2875
3346
  ], ChatSection.prototype, "isLoadingHistory", void 0);
2876
3347
  __decorate([
2877
- n({ type: Boolean }),
3348
+ n$1({ type: Boolean }),
2878
3349
  __metadata("design:type", Object)
2879
3350
  ], ChatSection.prototype, "devMode", void 0);
2880
3351
  __decorate([
2881
- n({ type: Boolean }),
3352
+ n$1({ type: Boolean }),
2882
3353
  __metadata("design:type", Boolean)
2883
3354
  ], ChatSection.prototype, "isTyping", void 0);
2884
3355
  __decorate([
2885
- n({ type: Boolean }),
3356
+ n$1({ type: Boolean }),
2886
3357
  __metadata("design:type", Boolean)
2887
3358
  ], ChatSection.prototype, "isFailed", void 0);
2888
3359
  __decorate([
2889
- n({ type: Array }),
3360
+ n$1({ type: Array }),
2890
3361
  __metadata("design:type", Array)
2891
3362
  ], ChatSection.prototype, "messages", void 0);
2892
3363
  __decorate([
2893
- n({ type: Array }),
3364
+ n$1({ type: Array }),
2894
3365
  __metadata("design:type", Array)
2895
3366
  ], ChatSection.prototype, "profiles", void 0);
2896
3367
  __decorate([
2897
- n({ type: Array }),
3368
+ n$1({ type: Array }),
2898
3369
  __metadata("design:type", Array)
2899
3370
  ], ChatSection.prototype, "productHandles", void 0);
2900
3371
  __decorate([
2901
- n({ type: Object }),
3372
+ n$1({ type: Object }),
2902
3373
  __metadata("design:type", Object)
2903
3374
  ], ChatSection.prototype, "thread", void 0);
2904
3375
  __decorate([
2905
- n({ type: Object }),
3376
+ n$1({ type: Object }),
2906
3377
  __metadata("design:type", Object)
2907
3378
  ], ChatSection.prototype, "siteCurrency", void 0);
2908
3379
  __decorate([
2909
- e$2('.context-container'),
3380
+ e$4('.context-container'),
2910
3381
  __metadata("design:type", Object)
2911
3382
  ], ChatSection.prototype, "contextContainerElement", void 0);
2912
3383
  __decorate([
2913
- e$2('.chat-window'),
3384
+ e$4('.chat-window'),
2914
3385
  __metadata("design:type", Object)
2915
3386
  ], ChatSection.prototype, "chatWindowElement", void 0);
2916
3387
  __decorate([
2917
- e$2('personalize-dialog'),
3388
+ e$4('personalize-dialog'),
2918
3389
  __metadata("design:type", Object)
2919
3390
  ], ChatSection.prototype, "personalizeDialogElement", void 0);
2920
3391
  __decorate([
2921
- n({ type: String }),
3392
+ n$1({ type: String }),
2922
3393
  __metadata("design:type", String)
2923
3394
  ], ChatSection.prototype, "userQuery", void 0);
2924
3395
  ChatSection = __decorate([
2925
- t$1('chat-section')
3396
+ t$2('chat-section')
2926
3397
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2927
3398
  ], ChatSection);
2928
3399
 
@@ -3085,6 +3556,20 @@ var ProvidersShopGptSdk = (function () {
3085
3556
  logger.error(e);
3086
3557
  }
3087
3558
  }
3559
+ handleThreadDelete(e) {
3560
+ e.stopPropagation();
3561
+ this.isLoadingThreads = true;
3562
+ const threadId = e.detail.threadId;
3563
+ if (!threadId) {
3564
+ logger.error('ThreadId is missing to delete the thread!');
3565
+ return;
3566
+ }
3567
+ this.shopGPTAPI
3568
+ .deleteSingleThread(threadId)
3569
+ .then(this.loadChatThreads.bind(this))
3570
+ .catch(logger.error)
3571
+ .finally(() => (this.isLoadingThreads = false));
3572
+ }
3088
3573
  async sendMessageToServer(e, message) {
3089
3574
  e.preventDefault();
3090
3575
  e.stopPropagation();
@@ -3136,7 +3621,10 @@ var ProvidersShopGptSdk = (function () {
3136
3621
  overlayMode() {
3137
3622
  const thread = this.chatThreads.get(this.selectedThreadId);
3138
3623
  return x `
3139
- <dialog id="shop-gpt-dialog-overlay">
3624
+ <dialog
3625
+ id="shop-gpt-dialog-overlay"
3626
+ @delete-thread=${this.handleThreadDelete}
3627
+ >
3140
3628
  <div class="mobile-version">
3141
3629
  Please switch to the desktop version for the best experience.
3142
3630
  </div>
@@ -3190,7 +3678,7 @@ var ProvidersShopGptSdk = (function () {
3190
3678
  </div>`;
3191
3679
  }
3192
3680
  return x `
3193
- <div id="shop-gpt-modal">
3681
+ <div id="shop-gpt-modal" @delete-thread=${this.handleThreadDelete}>
3194
3682
  <chat-section
3195
3683
  .isFailed=${this.isFailed}
3196
3684
  .isLoadingHistory=${this.isLoadingHistory}
@@ -3214,47 +3702,47 @@ var ProvidersShopGptSdk = (function () {
3214
3702
  };
3215
3703
  ShopGPT.styles = [shopGPTStyles];
3216
3704
  __decorate([
3217
- e$2('#shop-gpt-dialog-overlay'),
3705
+ e$4('#shop-gpt-dialog-overlay'),
3218
3706
  __metadata("design:type", Object)
3219
3707
  ], ShopGPT.prototype, "shopGPTDialog", void 0);
3220
3708
  __decorate([
3221
- n({ type: String }),
3709
+ n$1({ type: String }),
3222
3710
  __metadata("design:type", String)
3223
3711
  ], ShopGPT.prototype, "modalState", void 0);
3224
3712
  __decorate([
3225
- n({ type: Boolean }),
3713
+ n$1({ type: Boolean }),
3226
3714
  __metadata("design:type", Boolean)
3227
3715
  ], ShopGPT.prototype, "isLoadingHistory", void 0);
3228
3716
  __decorate([
3229
- n({ type: Boolean }),
3717
+ n$1({ type: Boolean }),
3230
3718
  __metadata("design:type", Boolean)
3231
3719
  ], ShopGPT.prototype, "isLoadingThreads", void 0);
3232
3720
  __decorate([
3233
- n({ type: Boolean }),
3721
+ n$1({ type: Boolean }),
3234
3722
  __metadata("design:type", Boolean)
3235
3723
  ], ShopGPT.prototype, "isTyping", void 0);
3236
3724
  __decorate([
3237
- n({ type: Boolean }),
3725
+ n$1({ type: Boolean }),
3238
3726
  __metadata("design:type", Boolean)
3239
3727
  ], ShopGPT.prototype, "isFailed", void 0);
3240
3728
  __decorate([
3241
- n({ type: String }),
3729
+ n$1({ type: String }),
3242
3730
  __metadata("design:type", String)
3243
3731
  ], ShopGPT.prototype, "selectedThreadId", void 0);
3244
3732
  __decorate([
3245
- n({ type: Array }),
3733
+ n$1({ type: Array }),
3246
3734
  __metadata("design:type", Array)
3247
3735
  ], ShopGPT.prototype, "products", void 0);
3248
3736
  __decorate([
3249
- n({ type: Array }),
3737
+ n$1({ type: Array }),
3250
3738
  __metadata("design:type", Array)
3251
3739
  ], ShopGPT.prototype, "messages", void 0);
3252
3740
  __decorate([
3253
- n({ type: Object }),
3741
+ n$1({ type: Object }),
3254
3742
  __metadata("design:type", Map)
3255
3743
  ], ShopGPT.prototype, "chatThreads", void 0);
3256
3744
  ShopGPT = __decorate([
3257
- t$1('shop-gpt')
3745
+ t$2('shop-gpt')
3258
3746
  ], ShopGPT);
3259
3747
 
3260
3748
  var _a, _b;