@molin.ai/shop-ai 0.9.43 → 0.9.44

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.
@@ -1936,7 +1936,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1936
1936
 
1937
1937
  ${this.#s()}
1938
1938
  </div>
1939
- `:d`<div class="${this.darkMode?"dark bg-[#1E1F23] text-gray-300":"bg-white/70 text-black/60"} mx-auto w-full max-w-xs rounded-2xl p-4 text-center text-sm">Loading game...</div>`}};customElements.get("mw-chat-wait-game")||customElements.define("mw-chat-wait-game",xi);var ki=class extends C(v){static properties={totalSeconds:{type:Number},heading:{type:String},message:{type:String},completeMessage:{type:String},gameButton:{type:String},question:{type:String},options:{type:String},gameTitle:{type:String,attribute:"game-title"},resultPrefix:{type:String,attribute:"result-prefix"},correctButtonText:{type:String,attribute:"correct-button-text"},wrongButtonText:{type:String,attribute:"wrong-button-text"},targetEndTime:{type:String,attribute:"target-end-time"},color:{type:String},apiBaseUrl:{type:String},cdnBaseUrl:{type:String},soundUrl:{type:String,attribute:"sound"},darkMode:{type:Boolean,attribute:"dark-mode"},_remainingSeconds:{type:Number,state:!0},_isComplete:{type:Boolean,state:!0},_showGame:{type:Boolean,state:!0}};static styles=j`
1939
+ `:d` <div class="${this.darkMode?"dark bg-[#1E1F23] text-gray-300":"bg-white/70 text-black/60"} mx-auto w-full max-w-xs rounded-2xl p-4 text-center text-sm">Loading game...</div> `}};customElements.get("mw-chat-wait-game")||customElements.define("mw-chat-wait-game",xi);var ki=class extends C(v){static properties={totalSeconds:{type:Number},heading:{type:String},message:{type:String},completeMessage:{type:String},gameButton:{type:String},question:{type:String},options:{type:String},gameTitle:{type:String,attribute:"game-title"},resultPrefix:{type:String,attribute:"result-prefix"},correctButtonText:{type:String,attribute:"correct-button-text"},wrongButtonText:{type:String,attribute:"wrong-button-text"},targetEndTime:{type:String,attribute:"target-end-time"},color:{type:String},apiBaseUrl:{type:String},cdnBaseUrl:{type:String},soundUrl:{type:String,attribute:"sound"},darkMode:{type:Boolean,attribute:"dark-mode"},_remainingSeconds:{type:Number,state:!0},_isComplete:{type:Boolean,state:!0},_showGame:{type:Boolean,state:!0}};static styles=j`
1940
1940
  :host {
1941
1941
  display: block;
1942
1942
  }
@@ -2020,7 +2020,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2020
2020
  <div class="h-8 flex-auto animate-pulse rounded-xl bg-gray-200 dark:bg-gray-700"></div>
2021
2021
  </div>
2022
2022
  </div>
2023
- `;if(this.product.layout==="horizontal")return d`<mw-product-card-horizontal product="${JSON.stringify(this.product)}" ?dark-mode="${this.darkMode}"></mw-product-card-horizontal>`;let{name:e,description:r,price:n,category:i}=this.product;return d`
2023
+ `;if(this.product.layout==="horizontal")return d` <mw-product-card-horizontal product="${JSON.stringify(this.product)}" ?dark-mode="${this.darkMode}"></mw-product-card-horizontal> `;let{name:e,description:r,price:n,category:i}=this.product;return d`
2024
2024
  <div class="${this.darkMode?"dark border-gray-600 bg-[#1E1F23]":"border-[#5e5d59]/25 bg-white"} my-2 w-full rounded-3xl border-[0.5px] p-4 hover:shadow-sm">
2025
2025
  <div class="pointer-events-auto mx-auto mb-4">
2026
2026
  <div class="group relative overflow-hidden rounded-2xl">
@@ -2066,11 +2066,9 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2066
2066
  </div>
2067
2067
  </div>
2068
2068
  <div @click="${this.#t}" class="cursor-pointer">
2069
- ${i?d`
2070
- <a @click="${this.#t}" class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600 hover:underline dark:text-gray-400">
2071
- ${i}
2072
- </a>
2073
- `:null}
2069
+ ${i?d`<a @click="${this.#t}" class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600 hover:underline dark:text-gray-400">
2070
+ ${i}
2071
+ </a>`:null}
2074
2072
 
2075
2073
  <h3
2076
2074
  @click="${this.#t}"
@@ -2115,45 +2113,37 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2115
2113
  </div>
2116
2114
  </li>
2117
2115
  `)}
2118
- `:Q(e,i=>i.label,(i,s)=>{let o=i.status==="completed",a=i.status==="in_progress",l=s===e.length-1;return d`
2119
- <li class="relative pb-4">
2120
- ${l?"":d`<div class="${`absolute left-2 top-2 -ml-px mt-0.5 h-full w-0.5 ${o?`bg-[${this.color}]`:"bg-gray-300 dark:bg-gray-600"}`}" aria-hidden="true"></div>`}
2116
+ `:Q(e,i=>i.label,(i,s)=>{let o=i.status==="completed",a=i.status==="in_progress",l=s===e.length-1;return d`<li class="relative pb-4">
2117
+ ${l?"":d`<div class="${`absolute left-2 top-2 -ml-px mt-0.5 h-full w-0.5 ${o?`bg-[${this.color}]`:"bg-gray-300 dark:bg-gray-600"}`}" aria-hidden="true"></div>`}
2121
2118
 
2122
- <div class="group relative flex items-start">
2123
- ${Zr(i.status,[["pending",()=>d`
2124
- <span class="flex h-6 items-center">
2125
- <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-gray-300 bg-white dark:border-gray-500 dark:bg-[#1E1F23]">
2126
- <span class="h-1.5 w-1.5 rounded-full bg-transparent"></span>
2127
- </span>
2119
+ <div class="group relative flex items-start">
2120
+ ${Zr(i.status,[["pending",()=>d` <span class="flex h-6 items-center">
2121
+ <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-gray-300 bg-white dark:border-gray-500 dark:bg-[#1E1F23]">
2122
+ <span class="h-1.5 w-1.5 rounded-full bg-transparent"></span>
2128
2123
  </span>
2129
- `],["in_progress",()=>d`
2130
- <span class="flex h-6 items-center">
2131
- <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[${this.color}] bg-white dark:bg-[#1E1F23]">
2132
- <span class="h-1.5 w-1.5 rounded-full bg-[${this.color}]"></span>
2133
- </span>
2124
+ </span>`],["in_progress",()=>d`<span class="flex h-6 items-center">
2125
+ <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[${this.color}] bg-white dark:bg-[#1E1F23]">
2126
+ <span class="h-1.5 w-1.5 rounded-full bg-[${this.color}]"></span>
2134
2127
  </span>
2135
- `],["completed",()=>d`
2136
- <span class="flex h-6 items-center">
2137
- <span class="flex h-4 w-4 items-center justify-center rounded-full bg-[${this.color}]">
2138
- <hi-outline class="mb-3 block h-3 w-3 text-white dark:text-gray-800" name="check"></hi-outline>
2139
- </span>
2128
+ </span>`],["completed",()=>d`
2129
+ <span class="flex h-6 items-center">
2130
+ <span class="flex h-4 w-4 items-center justify-center rounded-full bg-[${this.color}]">
2131
+ <hi-outline class="mb-3 block h-3 w-3 text-white dark:text-gray-800" name="check"></hi-outline>
2140
2132
  </span>
2141
- `]],()=>d`
2142
- <span class="flex h-6 items-center">
2143
- <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[${this.color}] bg-white dark:bg-[#1E1F23]">
2144
- <span class="h-1.5 w-1.5 rounded-full bg-[${this.color}]"></span>
2145
2133
  </span>
2134
+ `]],()=>d`<span class="flex h-6 items-center">
2135
+ <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[${this.color}] bg-white dark:bg-[#1E1F23]">
2136
+ <span class="h-1.5 w-1.5 rounded-full bg-[${this.color}]"></span>
2146
2137
  </span>
2147
- `)}
2138
+ </span>`)}
2148
2139
 
2149
- <span class="ml-3 flex min-w-0 flex-col">
2150
- <span class="${`text-sm font-medium ${a?`text-[${this.color}]`:o?"text-gray-900 dark:text-gray-100":"text-gray-500 dark:text-gray-400"}`}">
2151
- ${i.label}
2152
- </span>
2140
+ <span class="ml-3 flex min-w-0 flex-col">
2141
+ <span class="${`text-sm font-medium ${a?`text-[${this.color}]`:o?"text-gray-900 dark:text-gray-100":"text-gray-500 dark:text-gray-400"}`}">
2142
+ ${i.label}
2153
2143
  </span>
2154
- </div>
2155
- </li>
2156
- `})}
2144
+ </span>
2145
+ </div>
2146
+ </li>`})}
2157
2147
  </ol>
2158
2148
  </div>
2159
2149
 
@@ -2387,24 +2377,22 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2387
2377
  ?streaming="${!g}"
2388
2378
  ?links-new-tab="${i}"
2389
2379
  ?dark-mode="${c}"
2390
- color="${l}"></mw-product-order-status-card> `;case"live-chat-wait-card-v1":{let f=t.data||{};if(a)return d`<p><i>${f.message}</i></p>`;let S=h?`${h}/assets/game-intro.aac`:"";return d`
2391
- <mw-chat-wait-timer
2392
- heading="${f.title||""}"
2393
- message="${f.message||""}"
2394
- completeMessage="${f.completeMessage||""}"
2395
- gameButton="${f.gameButton||""}"
2396
- target-end-time="${f.targetEndTime||""}"
2397
- question="${f.firstQuestion||""}"
2398
- .options="${f.options?.option||["No","Yes"]}"
2399
- game-title="${f.gameTitle||""}"
2400
- result-prefix="${f.resultPrefix||""}"
2401
- correct-button-text="${f.correctButtonText||"Correct"}"
2402
- wrong-button-text="${f.wrongButtonText||"Wrong"}"
2403
- color="${l}"
2404
- apiBaseUrl="${u}"
2405
- cdnBaseUrl="${h}"
2406
- sound="${S}"></mw-chat-wait-timer>
2407
- `}case"request-input-v1":return d``}return console.warn("could not render part:",t),d`<p><i>data type not supported</i></p>`}var Jr=class{#e;#t;#r;#n=!1;timeoutMs;get isTyping(){return this.#n}constructor(e,r,{timeoutMs:n=2e3}={}){this.#e=e,this.#t=r,this.timeoutMs=n,e.addController(this)}hostDisconnected(){clearTimeout(this.#r),this.#r=void 0}onInput(e){if(this.#e.isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(this.#r),this.#r=setTimeout(()=>this.typingStopped(),this.timeoutMs),this.#n||this.#i()}}#i(){this.#n=!0,this.#t.typingStarted()}typingStopped(){clearTimeout(this.#r),this.#n=!1,this.#t.typingStopped()}};function Ia(t,e="en-US"){let r=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(t);return`${t.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${r}`}function Aa(t){t?.body?.cancel().catch(console.warn)}var Fi=class{#e=[];#t;#r=10;#n=5e3;#i=!1;async add(e,r){if(this.#e.push(ja(e,r)),this.#e.length>=this.#r)return this.flush();this.#t||(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#n))}async flush(){if(this.#i||this.#e.length===0)return;let e=[...this.#e];try{this.#i=!0,clearTimeout(this.#t),this.#t=void 0,this.#e=[];let r=new AbortController,n=setTimeout(()=>r.abort(),5e3);await La(e,{signal:r.signal}),clearTimeout(n)}catch(r){if(r.name==="AbortError")console.error("Request timed out, retrying events"),this.#e=[...e,...this.#e];else{console.error("Failed to send events to backend:",r);let n=e.filter(i=>i.event.includes("error"));this.#e=[...n,...this.#e]}}finally{this.#i=!1,this.#e.length>0&&!this.#t&&(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#n))}}async flushBeforeUnload(){if(this.#e.length>0)try{let e=new FormData;e.set("events",JSON.stringify(this.#e)),navigator.sendBeacon(new URL("/widgets/data/collect",Kr()).href,e)}catch(e){console.error("Failed to send final events:",e)}}},Ta=new Fi;window.addEventListener("beforeunload",()=>{Ta.flushBeforeUnload().catch(console.error)});async function T(t,e,r){if(typeof t!="string")throw new TypeError("Event name must be a string");if(typeof e!="object"||e===null)throw new TypeError("Properties must be an object");try{if(t==="ShopAssistant: user clicked link"&&Ru("molin_link_click",e),r?.immediate){await La([ja(t,e)]);return}else return Ta.add(t,e)}catch(n){console.error("Failed to send event:",n)}}async function La(t,{signal:e}={}){let r=new FormData;r.set("events",JSON.stringify(t));let n=await fetch(new URL("/widgets/data/collect",Kr()),{method:"POST",body:r,signal:e});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);Aa(n)}function ja(t,e){return{event:t,widget_id:e.widgetId,properties:Object.assign({},e,Pu()),distinct_id:Uu(),timestamp:new Date().toISOString()}}function Uu(){let t=U.distinctID;if(t&&typeof t=="string")return t;let e=crypto.randomUUID();try{U.distinctID=e}catch(r){console.error("Failed to store distinct_id:",r)}return e}function Pu(){return{referrer:document.referrer,userAgent:navigator.userAgent,language:navigator.language,screenWidth:window.innerWidth,screenHeight:window.innerHeight,timestamp:new Date().toISOString(),timezoneOffset:new Date().getTimezoneOffset(),doNotTrack:navigator.doNotTrack??void 0}}function Kr(){let t=new URL(import.meta.url).hostname;return{localhost:"http://localhost:8787","molin.localhost":"http://molin.localhost:8787","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://molin.ai","molin.foo":"https://molin.foo"}[t]||"https://molin.ai"}function Ru(t,e){try{window.dataLayer=window.dataLayer||[];let r={event:t,link_url:e.url};window.dataLayer.push(r)}catch(r){console.error("Failed to send event to dataLayer:",r)}}function Oa(){let t=new URL(import.meta.url).hostname;return{localhost:"http://uploads.molin.localhost:8787","molin.localhost":"http://uploads.molin.localhost:8787","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo"}[t]||"https://widget.molin.ai"}function Ua(){let t=new URL(import.meta.url).hostname;return{localhost:"http://localhost:8702","molin.localhost":"http://localhost:8702","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo"}[t]||"https://widget.molin.ai"}var Bu="\xB7 \xB7 \xB7",qu=["star-rating","binary-vote","new-conversation-button"],Vt=class t extends C(v){static styles=j`
2380
+ color="${l}"></mw-product-order-status-card> `;case"live-chat-wait-card-v1":{let f=t.data||{};if(a)return d`<p><i>${f.message}</i></p>`;let S=h?`${h}/assets/game-intro.aac`:"";return d`<mw-chat-wait-timer
2381
+ heading="${f.title||""}"
2382
+ message="${f.message||""}"
2383
+ completeMessage="${f.completeMessage||""}"
2384
+ gameButton="${f.gameButton||""}"
2385
+ target-end-time="${f.targetEndTime||""}"
2386
+ question="${f.firstQuestion||""}"
2387
+ .options="${f.options?.option||["No","Yes"]}"
2388
+ game-title="${f.gameTitle||""}"
2389
+ result-prefix="${f.resultPrefix||""}"
2390
+ correct-button-text="${f.correctButtonText||"Correct"}"
2391
+ wrong-button-text="${f.wrongButtonText||"Wrong"}"
2392
+ color="${l}"
2393
+ apiBaseUrl="${u}"
2394
+ cdnBaseUrl="${h}"
2395
+ sound="${S}"></mw-chat-wait-timer>`}case"request-input-v1":return d``}return console.warn("could not render part:",t),d`<p><i>data type not supported</i></p>`}var Jr=class{#e;#t;#r;#n=!1;timeoutMs;get isTyping(){return this.#n}constructor(e,r,{timeoutMs:n=2e3}={}){this.#e=e,this.#t=r,this.timeoutMs=n,e.addController(this)}hostDisconnected(){clearTimeout(this.#r),this.#r=void 0}onInput(e){if(this.#e.isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(this.#r),this.#r=setTimeout(()=>this.typingStopped(),this.timeoutMs),this.#n||this.#i()}}#i(){this.#n=!0,this.#t.typingStarted()}typingStopped(){clearTimeout(this.#r),this.#n=!1,this.#t.typingStopped()}};function Ia(t,e="en-US"){let r=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(t);return`${t.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${r}`}function Aa(t){t?.body?.cancel().catch(console.warn)}var Fi=class{#e=[];#t;#r=10;#n=5e3;#i=!1;async add(e,r){if(this.#e.push(ja(e,r)),this.#e.length>=this.#r)return this.flush();this.#t||(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#n))}async flush(){if(this.#i||this.#e.length===0)return;let e=[...this.#e];try{this.#i=!0,clearTimeout(this.#t),this.#t=void 0,this.#e=[];let r=new AbortController,n=setTimeout(()=>r.abort(),5e3);await La(e,{signal:r.signal}),clearTimeout(n)}catch(r){if(r.name==="AbortError")console.error("Request timed out, retrying events"),this.#e=[...e,...this.#e];else{console.error("Failed to send events to backend:",r);let n=e.filter(i=>i.event.includes("error"));this.#e=[...n,...this.#e]}}finally{this.#i=!1,this.#e.length>0&&!this.#t&&(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#n))}}async flushBeforeUnload(){if(this.#e.length>0)try{let e=new FormData;e.set("events",JSON.stringify(this.#e)),navigator.sendBeacon(new URL("/widgets/data/collect",Kr()).href,e)}catch(e){console.error("Failed to send final events:",e)}}},Ta=new Fi;window.addEventListener("beforeunload",()=>{Ta.flushBeforeUnload().catch(console.error)});async function T(t,e,r){if(typeof t!="string")throw new TypeError("Event name must be a string");if(typeof e!="object"||e===null)throw new TypeError("Properties must be an object");try{if(t==="ShopAssistant: user clicked link"&&Ru("molin_link_click",e),r?.immediate){await La([ja(t,e)]);return}else return Ta.add(t,e)}catch(n){console.error("Failed to send event:",n)}}async function La(t,{signal:e}={}){let r=new FormData;r.set("events",JSON.stringify(t));let n=await fetch(new URL("/widgets/data/collect",Kr()),{method:"POST",body:r,signal:e});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);Aa(n)}function ja(t,e){return{event:t,widget_id:e.widgetId,properties:Object.assign({},e,Pu()),distinct_id:Uu(),timestamp:new Date().toISOString()}}function Uu(){let t=U.distinctID;if(t&&typeof t=="string")return t;let e=crypto.randomUUID();try{U.distinctID=e}catch(r){console.error("Failed to store distinct_id:",r)}return e}function Pu(){return{referrer:document.referrer,userAgent:navigator.userAgent,language:navigator.language,screenWidth:window.innerWidth,screenHeight:window.innerHeight,timestamp:new Date().toISOString(),timezoneOffset:new Date().getTimezoneOffset(),doNotTrack:navigator.doNotTrack??void 0}}function Kr(){let t=new URL(import.meta.url).hostname;return{localhost:"http://localhost:8787","molin.localhost":"http://molin.localhost:8787","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://molin.ai","molin.foo":"https://molin.foo"}[t]||"https://molin.ai"}function Ru(t,e){try{window.dataLayer=window.dataLayer||[];let r={event:t,link_url:e.url};window.dataLayer.push(r)}catch(r){console.error("Failed to send event to dataLayer:",r)}}function Oa(){let t=new URL(import.meta.url).hostname;return{localhost:"http://uploads.molin.localhost:8787","molin.localhost":"http://uploads.molin.localhost:8787","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo"}[t]||"https://widget.molin.ai"}function Ua(){let t=new URL(import.meta.url).hostname;return{localhost:"http://localhost:8702","molin.localhost":"http://localhost:8702","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo"}[t]||"https://widget.molin.ai"}var Bu="\xB7 \xB7 \xB7",qu=["star-rating","binary-vote","new-conversation-button"],Vt=class t extends C(v){static styles=j`
2408
2396
  div.dark::before {
2409
2397
  opacity: 0.8;
2410
2398
  background-color: rgba(20, 22, 26, var(--tw-bg-opacity));
@@ -2464,23 +2452,21 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2464
2452
  width="300px"></mw-chat-image>
2465
2453
  </div>
2466
2454
  `):null}
2467
- ${(a.content||a.parts)&&!E?d`
2468
- <div data-id="${a.id}" class="${u?"mb-[1px]":"mb-3"} mx-2 flex-row">
2469
- <mw-chat-message
2470
- .color="${this.config?.color}"
2471
- status="${b}"
2472
- logo="${a.metadata?.avatar||this.config?.logoUrl}"
2473
- side="${a.role}"
2474
- position=${this.#i}
2475
- ?dark-mode="${i}"
2476
- @click="${this.#l}">
2477
- <div
2478
- class="prose prose-h1:first:mt-0 prose-h2:first:mt-0 prose-h3:first:mt-0 prose-h4:first:mt-0 prose-h1:last:mb-0 prose-h2:last:mb-0 prose-h3:last:mb-0 prose-h4:last:mb-0 prose-h1:mt-5 prose-h2:mt-5 prose-h3:mt-5 prose-h4:mt-5 prose-h1:mb-2 prose-h2:mb-2 prose-h3:mb-2 prose-h4:mb-2 prose-h1:text-xl prose-h1:font-bold prose-h2:text-lg prose-h2:font-bold prose-h3:text-base prose-h3:font-bold prose-h4:text-sm prose-h4:font-bold prose-p:whitespace-pre-wrap dark:prose-headings:text-white dark:prose-strong:text-white dark:prose-p:text-inherit break-words text-inherit">
2479
- ${a.content===Bu?d`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config?.color}]"></mw-loading>`:a.parts?Q(a.parts,(y,x)=>x,(y,x)=>Ma(y,x,a.parts??[],{imagesByProductUrl:a.metadata?.imagesByProductUrl,linksNewTab:this.config?.linksNewTab??!0,searchParams:this.config?.disableUtmInjection?void 0:new URLSearchParams({utm_source:"molin.ai",utm_medium:"chat",utm_campaign:"general"}),messageIsStreaming:a.streaming,color:this.config?.color,darkMode:i,apiBaseUrl:Kr(),cdnBaseUrl:Ua()})):d`<p>${a.content}</p>`}
2480
- </div>
2481
- </mw-chat-message>
2482
- </div>
2483
- `:null}
2455
+ ${(a.content||a.parts)&&!E?d` <div data-id="${a.id}" class="${u?"mb-[1px]":"mb-3"} mx-2 flex-row">
2456
+ <mw-chat-message
2457
+ .color="${this.config?.color}"
2458
+ status="${b}"
2459
+ logo="${a.metadata?.avatar||this.config?.logoUrl}"
2460
+ side="${a.role}"
2461
+ position=${this.#i}
2462
+ ?dark-mode="${i}"
2463
+ @click="${this.#l}">
2464
+ <div
2465
+ class="prose prose-h1:first:mt-0 prose-h2:first:mt-0 prose-h3:first:mt-0 prose-h4:first:mt-0 prose-h1:last:mb-0 prose-h2:last:mb-0 prose-h3:last:mb-0 prose-h4:last:mb-0 prose-h1:mt-5 prose-h2:mt-5 prose-h3:mt-5 prose-h4:mt-5 prose-h1:mb-2 prose-h2:mb-2 prose-h3:mb-2 prose-h4:mb-2 prose-h1:text-xl prose-h1:font-bold prose-h2:text-lg prose-h2:font-bold prose-h3:text-base prose-h3:font-bold prose-h4:text-sm prose-h4:font-bold prose-p:whitespace-pre-wrap dark:prose-headings:text-white dark:prose-strong:text-white dark:prose-p:text-inherit break-words text-inherit">
2466
+ ${a.content===Bu?d`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config?.color}]"></mw-loading>`:a.parts?Q(a.parts,(y,x)=>x,(y,x)=>Ma(y,x,a.parts??[],{imagesByProductUrl:a.metadata?.imagesByProductUrl,linksNewTab:this.config?.linksNewTab??!0,searchParams:this.config?.disableUtmInjection?void 0:new URLSearchParams({utm_source:"molin.ai",utm_medium:"chat",utm_campaign:"general"}),messageIsStreaming:a.streaming,color:this.config?.color,darkMode:i,apiBaseUrl:Kr(),cdnBaseUrl:Ua()})):d`<p>${a.content}</p>`}
2467
+ </div>
2468
+ </mw-chat-message>
2469
+ </div>`:null}
2484
2470
  `})}
2485
2471
  `)}
2486
2472
 
@@ -2720,12 +2706,10 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2720
2706
  `:null}
2721
2707
 
2722
2708
  <!-- show "Try it out" if enabled (even if the chat window is showing) -->
2723
- ${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?d`
2724
- <mw-try-it-out
2725
- class="${this.config?.tryItOut?.mobileEnabled?"visible":"invisible"} ${this.config?.tryItOut?.desktopEnabled?"sm:visible":"sm:invisible"}"
2726
- position="${r}"
2727
- text="${this.config.tryItOut?.text||""}"></mw-try-it-out>
2728
- `:null}
2709
+ ${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?d`<mw-try-it-out
2710
+ class="${this.config?.tryItOut?.mobileEnabled?"visible":"invisible"} ${this.config?.tryItOut?.desktopEnabled?"sm:visible":"sm:invisible"}"
2711
+ position="${r}"
2712
+ text="${this.config.tryItOut?.text||""}"></mw-try-it-out>`:null}
2729
2713
 
2730
2714
  <!-- On first render, do not render the dialog, so it does not connect to backend. Once it's rendered once, it's never removed from the DOM. -->
2731
2715
  <div
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molin.ai/shop-ai",
3
- "version": "0.9.43",
3
+ "version": "0.9.44",
4
4
  "description": "Molin Shop AI",
5
5
  "keywords": [
6
6
  "molin",