@molin.ai/shop-ai 0.5.10 → 0.5.11

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.
@@ -1099,7 +1099,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1099
1099
  <mw-bubble state="${this.state}" src="${dv(this.config?.bubble?.imageUrl)}"></mw-bubble>
1100
1100
  `:Ue}};ff=new WeakMap,Jt(cf,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",cf);var df,sh,ah,so,Wl,Ul,uf=class{constructor(e,i,r,s=window.history){Qt(this,df,void 0);Qt(this,sh,void 0);Qt(this,ah,void 0);Qt(this,so,void 0);Qt(this,Wl,!1);Qt(this,Ul,()=>{Xt(this,sh).test(window.location.pathname)&&Xt(this,ah).navigated()});Ie(this,df,e),Ie(this,sh,i),Ie(this,ah,r),Ie(this,so,s),e.addController(this)}hostConnected(){window.addEventListener("pageshow",Xt(this,Ul));let e=Xt(this,so).pushState;Xt(this,so).pushState=(...i)=>{if(e.call(Xt(this,so),...i),!Xt(this,Wl))try{let r=new URL(i[2],window.location.origin);Xt(this,sh).test(r.pathname)&&Xt(this,ah).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",Xt(this,Ul)),Ie(this,Wl,!0)}};df=new WeakMap,sh=new WeakMap,ah=new WeakMap,so=new WeakMap,Wl=new WeakMap,Ul=new WeakMap;function mf(t,e=""){return Object.entries(t).filter(([i,r])=>r).map(([i,r])=>`${e}${i}-[${r}]`).join(" ")}var yf,om,gr,vf,bf,mv,_f,gv,xf,yv,Sf,vv,Pf,bv,gf=class extends hi(Xe){constructor(){super();Qt(this,bf);Qt(this,_f);Qt(this,xf);Qt(this,Sf);Qt(this,Pf);Qt(this,yf,new cn(this,{onError:console.error}));Qt(this,om,new uf(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let i=Xt(this,_f,gv);i&&hr("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:i.conversationId,hasSentMessage:i.messages.length>0})}}));Qt(this,gr,!1);Qt(this,vf,{onError:i=>{alert(i.error),console.error(i.widgetId,i.error),hr("ShopAssistant: error",i)},onNewMessageStartedStreaming:i=>hr("ShopAssistant: user received bot message (streaming started)",i),onMessageEndedStreaming:i=>hr("ShopAssistant: user received bot message (streaming ended)",i),onUserCanceledStreaming:i=>hr("ShopAssistant: user canceled streaming",i),onUserClickedLink:i=>hr("ShopAssistant: user clicked link",i),onUserSentInput:i=>hr("ShopAssistant: user sent input",i)});this.cdn="https://widget.molin.ai",this.widgetId=""}get config(){return Xt(this,yf).data}render(){if(!this.config)return Ue;let i=[mf(this.config.bubble.position),mf(this.config.bubble.mobilePosition||{},"max-sm:")].join(" "),r=mf(this.config.bubble.position),s={bottom:"72px"},a=Object.entries(this.config.bubble.position).filter(([l,o])=>o).map(([l,o])=>`sm:${l}-[calc(${[s[l],o].filter(u=>!!u).join("+")})]`).join(" "),n=a;return this.config.hidden&&!this.config.kioskMode?Ue:Te`
1101
1101
  ${this.config.kioskMode?Ue:Te`
1102
- <mw-bubble class="${i} fixed z-[2147483647]" @click=${we(this,Sf,vv)} state="${Xt(this,gr)?"close":"open"}" src="https://widget.molin.ai/bubble/?w=${this.widgetId}"></mw-bubble>
1102
+ <mw-bubble class="${i} fixed z-[2147483647]" @click=${we(this,Sf,vv)} state="${Xt(this,gr)?"close":"open"}" src="${this.config.bubble?.imageUrl||""}"></mw-bubble>
1103
1103
 
1104
1104
  <!-- only load the component if enabled on any platform-->
1105
1105
  ${this.config?.popup?.mobileEnabled||this.config?.popup?.desktopEnabled?Te`<mw-popup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molin.ai/shop-ai",
3
- "version": "0.5.10",
3
+ "version": "0.5.11",
4
4
  "description": "Molin Shop AI",
5
5
  "keywords": [
6
6
  "molin",
@@ -28,9 +28,6 @@
28
28
  "publish:latest": "npm publish --access public --tag latest",
29
29
  "publish:beta": "npm publish --access public --tag beta"
30
30
  },
31
- "dependencies": {
32
- "posthog-js": "^1.114.2"
33
- },
34
31
  "files": [
35
32
  "/dist/molin-shop-ai.min.js"
36
33
  ]