@molin.ai/shop-ai 0.9.44 → 0.9.46

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.
@@ -1,11 +1,11 @@
1
- var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDescriptor;var Za=Object.getOwnPropertyNames;var Ja=Object.getPrototypeOf,Ka=Object.prototype.hasOwnProperty;var Ne=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ya=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Za(e))!Ka.call(t,i)&&i!==r&&Ji(t,i,{get:()=>e[i],enumerable:!(n=Ga(e,i))||n.enumerable});return t};var sn=(t,e,r)=>(r=t!=null?Wa(Ja(t)):{},Ya(e||!t||!t.__esModule?Ji(r,"default",{value:t,enumerable:!0}):r,t));var Tn=Ne(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.parseCookie=_s;ie.parse=_s;ie.stringifyCookie=$l;ie.stringifySetCookie=lr;ie.serialize=lr;ie.parseSetCookie=_l;ie.stringifySetCookie=lr;ie.serialize=lr;var Es=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,$s=/^[\u0021-\u003A\u003C-\u007E]*$/,xl=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,kl=/^[\u0020-\u003A\u003D-\u007E]*$/,Cl=/^-?\d+$/,Sl=Object.prototype.toString,El=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function _s(t,e){let r=new El,n=t.length;if(n<2)return r;let i=e?.decode||Ms,s=0;do{let o=An(t,s,n);if(o===-1)break;let a=In(t,s,n);if(o>a){s=t.lastIndexOf(";",o-1)+1;continue}let l=we(t,s,o);r[l]===void 0&&(r[l]=i(we(t,o+1,a))),s=a+1}while(s<n);return r}function $l(t,e){let r=e?.encode||encodeURIComponent,n=[];for(let i of Object.keys(t)){let s=t[i];if(s===void 0)continue;if(!Es.test(i))throw new TypeError(`cookie name is invalid: ${i}`);let o=r(s);if(!$s.test(o))throw new TypeError(`cookie val is invalid: ${s}`);n.push(`${i}=${o}`)}return n.join("; ")}function lr(t,e,r){let n=typeof t=="object"?t:{...r,name:t,value:String(e)},s=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!Es.test(n.name))throw new TypeError(`argument name is invalid: ${n.name}`);let o=n.value?s(n.value):"";if(!$s.test(o))throw new TypeError(`argument val is invalid: ${n.value}`);let a=n.name+"="+o;if(n.maxAge!==void 0){if(!Number.isInteger(n.maxAge))throw new TypeError(`option maxAge is invalid: ${n.maxAge}`);a+="; Max-Age="+n.maxAge}if(n.domain){if(!xl.test(n.domain))throw new TypeError(`option domain is invalid: ${n.domain}`);a+="; Domain="+n.domain}if(n.path){if(!kl.test(n.path))throw new TypeError(`option path is invalid: ${n.path}`);a+="; Path="+n.path}if(n.expires){if(!Ml(n.expires)||!Number.isFinite(n.expires.valueOf()))throw new TypeError(`option expires is invalid: ${n.expires}`);a+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(a+="; HttpOnly"),n.secure&&(a+="; Secure"),n.partitioned&&(a+="; Partitioned"),n.priority)switch(typeof n.priority=="string"?n.priority.toLowerCase():void 0){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${n.priority}`)}if(n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"none":a+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${n.sameSite}`)}return a}function _l(t,e){let r=e?.decode||Ms,n=t.length,i=In(t,0,n),s=An(t,0,i),o=s===-1?{name:"",value:r(we(t,0,i))}:{name:we(t,0,s),value:r(we(t,s+1,i))},a=i+1;for(;a<n;){let l=In(t,a,n),c=An(t,a,l),u=c===-1?we(t,a,l):we(t,a,c),h=c===-1?void 0:we(t,c+1,l);switch(u.toLowerCase()){case"httponly":o.httpOnly=!0;break;case"secure":o.secure=!0;break;case"partitioned":o.partitioned=!0;break;case"domain":o.domain=h;break;case"path":o.path=h;break;case"max-age":h&&Cl.test(h)&&(o.maxAge=Number(h));break;case"expires":if(!h)break;let p=new Date(h);Number.isFinite(p.valueOf())&&(o.expires=p);break;case"priority":if(!h)break;let g=h.toLowerCase();(g==="low"||g==="medium"||g==="high")&&(o.priority=g);break;case"samesite":if(!h)break;let f=h.toLowerCase();(f==="lax"||f==="strict"||f==="none")&&(o.sameSite=f);break}a=l+1}return o}function In(t,e,r){let n=t.indexOf(";",e);return n===-1?r:n}function An(t,e,r){let n=t.indexOf("=",e);return n<r?n:-1}function we(t,e,r){let n=e,i=r;do{let s=t.charCodeAt(n);if(s!==32&&s!==9)break}while(++n<i);for(;i>n;){let s=t.charCodeAt(i-1);if(s!==32&&s!==9)break;i--}return t.slice(n,i)}function Ms(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function Ml(t){return Sl.call(t)==="[object Date]"}});var Uo=Ne(Ue=>{"use strict";var $c=Ue&&Ue.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(h){o(h)}}function l(u){try{c(n.throw(u))}catch(h){o(h)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})},_c=Ue&&Ue.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(u){c=[6,u],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.base64ToBlob=Mc;function Mc(t){return $c(this,void 0,void 0,function(){var e,r,n;return _c(this,function(i){switch(i.label){case 0:return[4,fetch(t)];case 1:return e=i.sent(),[4,e.blob()];case 2:return r=i.sent(),n=Ac(t),n&&(r=r.slice(0,r.size,n)),[2,r]}})})}var Ic=/^data:(.+);base64,/;function Ac(t){var e;return(e=t.match(Ic))===null||e===void 0?void 0:e.slice(1,2).pop()}});var Po=Ne(Pe=>{"use strict";var Tc=Pe&&Pe.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(h){o(h)}}function l(u){try{c(n.throw(u))}catch(h){o(h)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})},Lc=Pe&&Pe.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(u){c=[6,u],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.base64ToFile=jc;function jc(t,e,r){return Tc(this,void 0,void 0,function(){var n,i;return Lc(this,function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:return n=s.sent(),[4,n.blob()];case 2:return i=s.sent(),[2,new File([i],e,r)]}})})}});var hi=Ne(Re=>{"use strict";var ui=Re&&Re.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(h){o(h)}}function l(u){try{c(n.throw(u))}catch(h){o(h)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})},di=Re&&Re.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(u){c=[6,u],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Re,"__esModule",{value:!0});Re.blobToBase64=Dc;function Dc(t){return ui(this,void 0,void 0,function(){return di(this,function(e){return[2,typeof FileReader=="function"?Oc(t):Pc(t)]})})}var nt;(function(t){t.error="error",t.loadend="loadend"})(nt||(nt={}));function Oc(t){return ui(this,void 0,void 0,function(){return di(this,function(e){return[2,new Promise(function(r,n){try{var i=new FileReader,s=function(){r(i.result),i.removeEventListener(nt.loadend,s)};i.addEventListener(nt.loadend,s);var o=function(){n(i.error),i.removeEventListener(nt.error,o)};i.addEventListener(nt.error,o),i.readAsDataURL(t)}catch(a){n(a)}})]})})}var Uc="application/octet-stream";function Pc(t){return ui(this,void 0,void 0,function(){var e,r,n,i;return di(this,function(s){switch(s.label){case 0:return n=(r=Buffer).from,[4,t.text()];case 1:return e=n.apply(r,[s.sent()]),i=t.type||Uc,[2,"data:".concat(i,";base64,").concat(e.toString("base64"))]}})})}});var Ro=Ne(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.fileToBase64=void 0;var Rc=hi();Object.defineProperty(Ar,"fileToBase64",{enumerable:!0,get:function(){return Rc.blobToBase64}})});var Bo=Ne(ae=>{"use strict";var Bc=ae&&ae.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Tr=ae&&ae.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Bc(e,t,r)};Object.defineProperty(ae,"__esModule",{value:!0});Tr(Uo(),ae);Tr(Po(),ae);Tr(hi(),ae);Tr(Ro(),ae)});var Wt=globalThis,Gt=Wt.ShadowRoot&&(Wt.ShadyCSS===void 0||Wt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,on=Symbol(),Ki=new WeakMap,gt=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==on)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(Gt&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=Ki.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ki.set(r,e))}return e}toString(){return this.cssText}},Yi=t=>new gt(typeof t=="string"?t:t+"",void 0,on),j=(t,...e)=>{let r=t.length===1?t[0]:e.reduce(((n,i,s)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new gt(r,t,on)},Xi=(t,e)=>{if(Gt)t.adoptedStyleSheets=e.map((r=>r instanceof CSSStyleSheet?r:r.styleSheet));else for(let r of e){let n=document.createElement("style"),i=Wt.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}},an=Gt?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return Yi(r)})(t):t;var{is:Xa,defineProperty:Qa,getOwnPropertyDescriptor:el,getOwnPropertyNames:tl,getOwnPropertySymbols:rl,getPrototypeOf:nl}=Object,Zt=globalThis,Qi=Zt.trustedTypes,il=Qi?Qi.emptyScript:"",sl=Zt.reactiveElementPolyfillSupport,wt=(t,e)=>t,ln={toAttribute(t,e){switch(e){case Boolean:t=t?il:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},ts=(t,e)=>!Xa(t,e),es={attribute:!0,type:String,converter:ln,reflect:!1,useDefault:!1,hasChanged:ts};Symbol.metadata??=Symbol("metadata"),Zt.litPropertyMetadata??=new WeakMap;var de=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=es){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(e,r),!r.noAccessor){let n=Symbol(),i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Qa(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){let{get:i,set:s}=el(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get:i,set(o){let a=i?.call(this);s?.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??es}static _$Ei(){if(this.hasOwnProperty(wt("elementProperties")))return;let e=nl(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(wt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(wt("properties"))){let r=this.properties,n=[...tl(r),...rl(r)];for(let i of n)this.createProperty(i,r[i])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[n,i]of r)this.elementProperties.set(n,i)}this._$Eh=new Map;for(let[r,n]of this.elementProperties){let i=this._$Eu(r,n);i!==void 0&&this._$Eh.set(i,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)r.unshift(an(i))}else e!==void 0&&r.push(an(e));return r}static _$Eu(e,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.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((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,r=this.constructor.elementProperties;for(let n of r.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Xi(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$ET(e,r){let n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){let s=(n.converter?.toAttribute!==void 0?n.converter:ln).toAttribute(r,n.type);this._$Em=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(e,r){let n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let s=n.getPropertyOptions(i),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:ln;this._$Em=i;let a=o.fromAttribute(r,s.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(e,r,n){if(e!==void 0){let i=this.constructor,s=this[e];if(n??=i.getPropertyOptions(e),!((n.hasChanged??ts)(s,r)||n.useDefault&&n.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,n))))return;this.C(e,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:n,reflect:i,wrapped:s},o){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??r??this[e]),s!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(r=void 0),this._$AL.set(e,r)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,s]of this._$Ep)this[i]=s;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[i,s]of n){let{wrapped:o}=s,a=this[i];o!==!0||this._$AL.has(i)||a===void 0||this.C(i,void 0,s,a)}}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach((n=>n.hostUpdate?.())),this.update(r)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$EO?.forEach((r=>r.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((r=>this._$ET(r,this[r]))),this._$EM()}updated(e){}firstUpdated(e){}};de.elementStyles=[],de.shadowRootOptions={mode:"open"},de[wt("elementProperties")]=new Map,de[wt("finalized")]=new Map,sl?.({ReactiveElement:de}),(Zt.reactiveElementVersions??=[]).push("2.1.1");var un=globalThis,Jt=un.trustedTypes,rs=Jt?Jt.createPolicy("lit-html",{createHTML:t=>t}):void 0,dn="$lit$",he=`lit$${Math.random().toFixed(9).slice(2)}$`,hn="?"+he,ol=`<${hn}>`,Me=document,vt=()=>Me.createComment(""),bt=t=>t===null||typeof t!="object"&&typeof t!="function",pn=Array.isArray,ls=t=>pn(t)||typeof t?.[Symbol.iterator]=="function",cn=`[
2
- \f\r]`,yt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ns=/-->/g,is=/>/g,$e=RegExp(`>|${cn}(?:([^\\s"'>=/]+)(${cn}*=${cn}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),ss=/'/g,os=/"/g,cs=/^(?:script|style|textarea|title)$/i,fn=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),d=fn(1),Ku=fn(2),Yu=fn(3),te=Symbol.for("lit-noChange"),D=Symbol.for("lit-nothing"),as=new WeakMap,_e=Me.createTreeWalker(Me,129);function us(t,e){if(!pn(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return rs!==void 0?rs.createHTML(e):e}var ds=(t,e)=>{let r=t.length-1,n=[],i,s=e===2?"<svg>":e===3?"<math>":"",o=yt;for(let a=0;a<r;a++){let l=t[a],c,u,h=-1,p=0;for(;p<l.length&&(o.lastIndex=p,u=o.exec(l),u!==null);)p=o.lastIndex,o===yt?u[1]==="!--"?o=ns:u[1]!==void 0?o=is:u[2]!==void 0?(cs.test(u[2])&&(i=RegExp("</"+u[2],"g")),o=$e):u[3]!==void 0&&(o=$e):o===$e?u[0]===">"?(o=i??yt,h=-1):u[1]===void 0?h=-2:(h=o.lastIndex-u[2].length,c=u[1],o=u[3]===void 0?$e:u[3]==='"'?os:ss):o===os||o===ss?o=$e:o===ns||o===is?o=yt:(o=$e,i=void 0);let g=o===$e&&t[a+1].startsWith("/>")?" ":"";s+=o===yt?l+ol:h>=0?(n.push(c),l.slice(0,h)+dn+l.slice(h)+he+g):l+he+(h===-2?a:g)}return[us(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},xt=class t{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let s=0,o=0,a=e.length-1,l=this.parts,[c,u]=ds(e,r);if(this.el=t.createElement(c,n),_e.currentNode=this.el.content,r===2||r===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=_e.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith(dn)){let p=u[o++],g=i.getAttribute(h).split(he),f=/([.?@])?(.*)/.exec(p);l.push({type:1,index:s,name:f[2],strings:g,ctor:f[1]==="."?Yt:f[1]==="?"?Xt:f[1]==="@"?Qt:Ae}),i.removeAttribute(h)}else h.startsWith(he)&&(l.push({type:6,index:s}),i.removeAttribute(h));if(cs.test(i.tagName)){let h=i.textContent.split(he),p=h.length-1;if(p>0){i.textContent=Jt?Jt.emptyScript:"";for(let g=0;g<p;g++)i.append(h[g],vt()),_e.nextNode(),l.push({type:2,index:++s});i.append(h[p],vt())}}}else if(i.nodeType===8)if(i.data===hn)l.push({type:2,index:s});else{let h=-1;for(;(h=i.data.indexOf(he,h+1))!==-1;)l.push({type:7,index:s}),h+=he.length-1}s++}}static createElement(e,r){let n=Me.createElement("template");return n.innerHTML=e,n}};function Ie(t,e,r=t,n){if(e===te)return e;let i=n!==void 0?r._$Co?.[n]:r._$Cl,s=bt(e)?void 0:e._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(t),i._$AT(t,r,n)),n!==void 0?(r._$Co??=[])[n]=i:r._$Cl=i),i!==void 0&&(e=Ie(t,i._$AS(t,e.values),i,n)),e}var Kt=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:r},parts:n}=this._$AD,i=(e?.creationScope??Me).importNode(r,!0);_e.currentNode=i;let s=_e.nextNode(),o=0,a=0,l=n[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new Ve(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new er(s,this,e)),this._$AV.push(c),l=n[++a]}o!==l?.index&&(s=_e.nextNode(),o++)}return _e.currentNode=Me,i}p(e){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}},Ve=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,n,i){this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Ie(this,e,r),bt(e)?e===D||e==null||e===""?(this._$AH!==D&&this._$AR(),this._$AH=D):e!==this._$AH&&e!==te&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ls(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==D&&bt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Me.createTextNode(e)),this._$AH=e}$(e){let{values:r,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=xt.createElement(us(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(r);else{let s=new Kt(i,this),o=s.u(this.options);s.p(r),this.T(o),this._$AH=s}}_$AC(e){let r=as.get(e.strings);return r===void 0&&as.set(e.strings,r=new xt(e)),r}k(e){pn(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let s of e)i===r.length?r.push(n=new t(this.O(vt()),this.O(vt()),this,this.options)):n=r[i],n._$AI(s),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Ae=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,n,i,s){this.type=1,this._$AH=D,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=D}_$AI(e,r=this,n,i){let s=this.strings,o=!1;if(s===void 0)e=Ie(this,e,r,0),o=!bt(e)||e!==this._$AH&&e!==te,o&&(this._$AH=e);else{let a=e,l,c;for(e=s[0],l=0;l<s.length-1;l++)c=Ie(this,a[n+l],r,l),c===te&&(c=this._$AH[l]),o||=!bt(c)||c!==this._$AH[l],c===D?e=D:e!==D&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!i&&this.j(e)}j(e){e===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Yt=class extends Ae{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===D?void 0:e}},Xt=class extends Ae{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==D)}},Qt=class extends Ae{constructor(e,r,n,i,s){super(e,r,n,i,s),this.type=5}_$AI(e,r=this){if((e=Ie(this,e,r,0)??D)===te)return;let n=this._$AH,i=e===D&&n!==D||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==D&&(n===D||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},er=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Ie(this,e)}},hs={M:dn,P:he,A:hn,C:1,L:ds,R:Kt,D:ls,V:Ie,I:Ve,H:Ae,N:Xt,U:Qt,B:Yt,F:er},al=un.litHtmlPolyfillSupport;al?.(xt,Ve),(un.litHtmlVersions??=[]).push("3.3.1");var ps=(t,e,r)=>{let n=r?.renderBefore??e,i=n._$litPart$;if(i===void 0){let s=r?.renderBefore??null;n._$litPart$=i=new Ve(e.insertBefore(vt(),s),s,void 0,r??{})}return i._$AI(t),i};var mn=globalThis,v=class extends de{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ps(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return te}};v._$litElement$=!0,v.finalized=!0,mn.litElementHydrateSupport?.({LitElement:v});var ll=mn.litElementPolyfillSupport;ll?.({LitElement:v});(mn.litElementVersions??=[]).push("4.2.1");var tr=class t extends HTMLElement{static observedAttributes=["name"];constructor(){super(),this.attachShadow({mode:"open"})}attributeChangedCallback(e,r,n){if(r!==n&&t.observedAttributes.includes(e)){switch(e){case"name":this.name=n||"";break}this.render()}}resolveIcon(e){throw new Error("Not implemented")}render(){let e=document.createElement("style");for(e.textContent=`
1
+ var Ja=Object.create;var es=Object.defineProperty;var Ka=Object.getOwnPropertyDescriptor;var Xa=Object.getOwnPropertyNames;var Ya=Object.getPrototypeOf,Qa=Object.prototype.hasOwnProperty;var ze=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var el=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Xa(e))!Qa.call(t,n)&&n!==r&&es(t,n,{get:()=>e[n],enumerable:!(i=Ka(e,n))||i.enumerable});return t};var ai=(t,e,r)=>(r=t!=null?Ja(Ya(t)):{},el(e||!t||!t.__esModule?es(r,"default",{value:t,enumerable:!0}):r,t));var Ti=ze(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.parseCookie=js;ae.parse=js;ae.stringifyCookie=Il;ae.stringifySetCookie=dr;ae.serialize=dr;ae.parseSetCookie=Al;ae.stringifySetCookie=dr;ae.serialize=dr;var As=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,Ds=/^[\u0021-\u003A\u003C-\u007E]*$/,_l=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Sl=/^[\u0020-\u003A\u003D-\u007E]*$/,$l=/^-?\d+$/,El=Object.prototype.toString,Ml=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function js(t,e){let r=new Ml,i=t.length;if(i<2)return r;let n=e?.decode||Ls,s=0;do{let o=Li(t,s,i);if(o===-1)break;let a=ji(t,s,i);if(o>a){s=t.lastIndexOf(";",o-1)+1;continue}let l=be(t,s,o);r[l]===void 0&&(r[l]=n(be(t,o+1,a))),s=a+1}while(s<i);return r}function Il(t,e){let r=e?.encode||encodeURIComponent,i=[];for(let n of Object.keys(t)){let s=t[n];if(s===void 0)continue;if(!As.test(n))throw new TypeError(`cookie name is invalid: ${n}`);let o=r(s);if(!Ds.test(o))throw new TypeError(`cookie val is invalid: ${s}`);i.push(`${n}=${o}`)}return i.join("; ")}function dr(t,e,r){let i=typeof t=="object"?t:{...r,name:t,value:String(e)},s=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!As.test(i.name))throw new TypeError(`argument name is invalid: ${i.name}`);let o=i.value?s(i.value):"";if(!Ds.test(o))throw new TypeError(`argument val is invalid: ${i.value}`);let a=i.name+"="+o;if(i.maxAge!==void 0){if(!Number.isInteger(i.maxAge))throw new TypeError(`option maxAge is invalid: ${i.maxAge}`);a+="; Max-Age="+i.maxAge}if(i.domain){if(!_l.test(i.domain))throw new TypeError(`option domain is invalid: ${i.domain}`);a+="; Domain="+i.domain}if(i.path){if(!Sl.test(i.path))throw new TypeError(`option path is invalid: ${i.path}`);a+="; Path="+i.path}if(i.expires){if(!Dl(i.expires)||!Number.isFinite(i.expires.valueOf()))throw new TypeError(`option expires is invalid: ${i.expires}`);a+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.partitioned&&(a+="; Partitioned"),i.priority)switch(typeof i.priority=="string"?i.priority.toLowerCase():void 0){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${i.priority}`)}if(i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:case"strict":a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"none":a+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${i.sameSite}`)}return a}function Al(t,e){let r=e?.decode||Ls,i=t.length,n=ji(t,0,i),s=Li(t,0,n),o=s===-1?{name:"",value:r(be(t,0,n))}:{name:be(t,0,s),value:r(be(t,s+1,n))},a=n+1;for(;a<i;){let l=ji(t,a,i),c=Li(t,a,l),d=c===-1?be(t,a,l):be(t,a,c),h=c===-1?void 0:be(t,c+1,l);switch(d.toLowerCase()){case"httponly":o.httpOnly=!0;break;case"secure":o.secure=!0;break;case"partitioned":o.partitioned=!0;break;case"domain":o.domain=h;break;case"path":o.path=h;break;case"max-age":h&&$l.test(h)&&(o.maxAge=Number(h));break;case"expires":if(!h)break;let p=new Date(h);Number.isFinite(p.valueOf())&&(o.expires=p);break;case"priority":if(!h)break;let g=h.toLowerCase();(g==="low"||g==="medium"||g==="high")&&(o.priority=g);break;case"samesite":if(!h)break;let f=h.toLowerCase();(f==="lax"||f==="strict"||f==="none")&&(o.sameSite=f);break}a=l+1}return o}function ji(t,e,r){let i=t.indexOf(";",e);return i===-1?r:i}function Li(t,e,r){let i=t.indexOf("=",e);return i<r?i:-1}function be(t,e,r){let i=e,n=r;do{let s=t.charCodeAt(i);if(s!==32&&s!==9)break}while(++i<n);for(;n>i;){let s=t.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}return t.slice(i,n)}function Ls(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function Dl(t){return El.call(t)==="[object Date]"}});var Fo=ze(Re=>{"use strict";var Ic=Re&&Re.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(h){o(h)}}function l(d){try{c(i.throw(d))}catch(h){o(h)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},Ac=Re&&Re.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Re,"__esModule",{value:!0});Re.base64ToBlob=Dc;function Dc(t){return Ic(this,void 0,void 0,function(){var e,r,i;return Ac(this,function(n){switch(n.label){case 0:return[4,fetch(t)];case 1:return e=n.sent(),[4,e.blob()];case 2:return r=n.sent(),i=Lc(t),i&&(r=r.slice(0,r.size,i)),[2,r]}})})}var jc=/^data:(.+);base64,/;function Lc(t){var e;return(e=t.match(jc))===null||e===void 0?void 0:e.slice(1,2).pop()}});var qo=ze(Be=>{"use strict";var Tc=Be&&Be.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(h){o(h)}}function l(d){try{c(i.throw(d))}catch(h){o(h)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},Oc=Be&&Be.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Be,"__esModule",{value:!0});Be.base64ToFile=Uc;function Uc(t,e,r){return Tc(this,void 0,void 0,function(){var i,n;return Oc(this,function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:return i=s.sent(),[4,i.blob()];case 2:return n=s.sent(),[2,new File([n],e,r)]}})})}});var mn=ze(Fe=>{"use strict";var pn=Fe&&Fe.__awaiter||function(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(h){o(h)}}function l(d){try{c(i.throw(d))}catch(h){o(h)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},fn=Fe&&Fe.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return l([c,d])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(s=c[0]&2?n.return:c[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,c[1])).done)return s;switch(n=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(d){c=[6,d],n=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.blobToBase64=Pc;function Pc(t){return pn(this,void 0,void 0,function(){return fn(this,function(e){return[2,typeof FileReader=="function"?Rc(t):Fc(t)]})})}var ot;(function(t){t.error="error",t.loadend="loadend"})(ot||(ot={}));function Rc(t){return pn(this,void 0,void 0,function(){return fn(this,function(e){return[2,new Promise(function(r,i){try{var n=new FileReader,s=function(){r(n.result),n.removeEventListener(ot.loadend,s)};n.addEventListener(ot.loadend,s);var o=function(){i(n.error),n.removeEventListener(ot.error,o)};n.addEventListener(ot.error,o),n.readAsDataURL(t)}catch(a){i(a)}})]})})}var Bc="application/octet-stream";function Fc(t){return pn(this,void 0,void 0,function(){var e,r,i,n;return fn(this,function(s){switch(s.label){case 0:return i=(r=Buffer).from,[4,t.text()];case 1:return e=i.apply(r,[s.sent()]),n=t.type||Bc,[2,"data:".concat(n,";base64,").concat(e.toString("base64"))]}})})}});var Vo=ze(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.fileToBase64=void 0;var qc=mn();Object.defineProperty(Lr,"fileToBase64",{enumerable:!0,get:function(){return qc.blobToBase64}})});var No=ze(ce=>{"use strict";var Vc=ce&&ce.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),Tr=ce&&ce.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Vc(e,t,r)};Object.defineProperty(ce,"__esModule",{value:!0});Tr(Fo(),ce);Tr(qo(),ce);Tr(mn(),ce);Tr(Vo(),ce)});var Jt=globalThis,Kt=Jt.ShadowRoot&&(Jt.ShadyCSS===void 0||Jt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,li=Symbol(),ts=new WeakMap,vt=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==li)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(Kt&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=ts.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&ts.set(r,e))}return e}toString(){return this.cssText}},rs=t=>new vt(typeof t=="string"?t:t+"",void 0,li),O=(t,...e)=>{let r=t.length===1?t[0]:e.reduce(((i,n,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1]),t[0]);return new vt(r,t,li)},is=(t,e)=>{if(Kt)t.adoptedStyleSheets=e.map((r=>r instanceof CSSStyleSheet?r:r.styleSheet));else for(let r of e){let i=document.createElement("style"),n=Jt.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},ci=Kt?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return rs(r)})(t):t;var{is:tl,defineProperty:rl,getOwnPropertyDescriptor:il,getOwnPropertyNames:nl,getOwnPropertySymbols:sl,getPrototypeOf:ol}=Object,Xt=globalThis,ns=Xt.trustedTypes,al=ns?ns.emptyScript:"",ll=Xt.reactiveElementPolyfillSupport,bt=(t,e)=>t,ui={toAttribute(t,e){switch(e){case Boolean:t=t?al:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},os=(t,e)=>!tl(t,e),ss={attribute:!0,type:String,converter:ui,reflect:!1,useDefault:!1,hasChanged:os};Symbol.metadata??=Symbol("metadata"),Xt.litPropertyMetadata??=new WeakMap;var pe=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=ss){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(e,r),!r.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(e,i,r);n!==void 0&&rl(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){let{get:n,set:s}=il(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get:n,set(o){let a=n?.call(this);s?.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ss}static _$Ei(){if(this.hasOwnProperty(bt("elementProperties")))return;let e=ol(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(bt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(bt("properties"))){let r=this.properties,i=[...nl(r),...sl(r)];for(let n of i)this.createProperty(n,r[n])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[i,n]of r)this.elementProperties.set(i,n)}this._$Eh=new Map;for(let[r,i]of this.elementProperties){let n=this._$Eu(r,i);n!==void 0&&this._$Eh.set(n,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)r.unshift(ci(n))}else e!==void 0&&r.push(ci(e));return r}static _$Eu(e,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.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((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,r=this.constructor.elementProperties;for(let i of r.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return is(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$ET(e,r){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:ui).toAttribute(r,i.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,r){let i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let s=i.getPropertyOptions(n),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:ui;this._$Em=n;let a=o.fromAttribute(r,s.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(e,r,i){if(e!==void 0){let n=this.constructor,s=this[e];if(i??=n.getPropertyOptions(e),!((i.hasChanged??os)(s,r)||i.useDefault&&i.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(n._$Eu(e,i))))return;this.C(e,r,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:i,reflect:n,wrapped:s},o){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??r??this[e]),s!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(r=void 0),this._$AL.set(e,r)),n===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[n,s]of i){let{wrapped:o}=s,a=this[n];o!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,s,a)}}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach((i=>i.hostUpdate?.())),this.update(r)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$EO?.forEach((r=>r.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((r=>this._$ET(r,this[r]))),this._$EM()}updated(e){}firstUpdated(e){}};pe.elementStyles=[],pe.shadowRootOptions={mode:"open"},pe[bt("elementProperties")]=new Map,pe[bt("finalized")]=new Map,ll?.({ReactiveElement:pe}),(Xt.reactiveElementVersions??=[]).push("2.1.1");var hi=globalThis,Yt=hi.trustedTypes,as=Yt?Yt.createPolicy("lit-html",{createHTML:t=>t}):void 0,pi="$lit$",fe=`lit$${Math.random().toFixed(9).slice(2)}$`,fi="?"+fe,cl=`<${fi}>`,De=document,kt=()=>De.createComment(""),Ct=t=>t===null||typeof t!="object"&&typeof t!="function",mi=Array.isArray,ps=t=>mi(t)||typeof t?.[Symbol.iterator]=="function",di=`[
2
+ \f\r]`,xt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ls=/-->/g,cs=/>/g,Ie=RegExp(`>|${di}(?:([^\\s"'>=/]+)(${di}*=${di}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),us=/'/g,ds=/"/g,fs=/^(?:script|style|textarea|title)$/i,gi=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),u=gi(1),Xu=gi(2),Yu=gi(3),ne=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),hs=new WeakMap,Ae=De.createTreeWalker(De,129);function ms(t,e){if(!mi(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return as!==void 0?as.createHTML(e):e}var gs=(t,e)=>{let r=t.length-1,i=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=xt;for(let a=0;a<r;a++){let l=t[a],c,d,h=-1,p=0;for(;p<l.length&&(o.lastIndex=p,d=o.exec(l),d!==null);)p=o.lastIndex,o===xt?d[1]==="!--"?o=ls:d[1]!==void 0?o=cs:d[2]!==void 0?(fs.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Ie):d[3]!==void 0&&(o=Ie):o===Ie?d[0]===">"?(o=n??xt,h=-1):d[1]===void 0?h=-2:(h=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?Ie:d[3]==='"'?ds:us):o===ds||o===us?o=Ie:o===ls||o===cs?o=xt:(o=Ie,n=void 0);let g=o===Ie&&t[a+1].startsWith("/>")?" ":"";s+=o===xt?l+cl:h>=0?(i.push(c),l.slice(0,h)+pi+l.slice(h)+fe+g):l+fe+(h===-2?a:g)}return[ms(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},_t=class t{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,o=0,a=e.length-1,l=this.parts,[c,d]=gs(e,r);if(this.el=t.createElement(c,i),Ae.currentNode=this.el.content,r===2||r===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(n=Ae.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let h of n.getAttributeNames())if(h.endsWith(pi)){let p=d[o++],g=n.getAttribute(h).split(fe),f=/([.?@])?(.*)/.exec(p);l.push({type:1,index:s,name:f[2],strings:g,ctor:f[1]==="."?er:f[1]==="?"?tr:f[1]==="@"?rr:Le}),n.removeAttribute(h)}else h.startsWith(fe)&&(l.push({type:6,index:s}),n.removeAttribute(h));if(fs.test(n.tagName)){let h=n.textContent.split(fe),p=h.length-1;if(p>0){n.textContent=Yt?Yt.emptyScript:"";for(let g=0;g<p;g++)n.append(h[g],kt()),Ae.nextNode(),l.push({type:2,index:++s});n.append(h[p],kt())}}}else if(n.nodeType===8)if(n.data===fi)l.push({type:2,index:s});else{let h=-1;for(;(h=n.data.indexOf(fe,h+1))!==-1;)l.push({type:7,index:s}),h+=fe.length-1}s++}}static createElement(e,r){let i=De.createElement("template");return i.innerHTML=e,i}};function je(t,e,r=t,i){if(e===ne)return e;let n=i!==void 0?r._$Co?.[i]:r._$Cl,s=Ct(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(t),n._$AT(t,r,i)),i!==void 0?(r._$Co??=[])[i]=n:r._$Cl=n),n!==void 0&&(e=je(t,n._$AS(t,e.values),n,i)),e}var Qt=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:r},parts:i}=this._$AD,n=(e?.creationScope??De).importNode(r,!0);Ae.currentNode=n;let s=Ae.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new We(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new ir(s,this,e)),this._$AV.push(c),l=i[++a]}o!==l?.index&&(s=Ae.nextNode(),o++)}return Ae.currentNode=De,n}p(e){let r=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,r),r+=i.strings.length-2):i._$AI(e[r])),r++}},We=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,i,n){this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=je(this,e,r),Ct(e)?e===U||e==null||e===""?(this._$AH!==U&&this._$AR(),this._$AH=U):e!==this._$AH&&e!==ne&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ps(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==U&&Ct(this._$AH)?this._$AA.nextSibling.data=e:this.T(De.createTextNode(e)),this._$AH=e}$(e){let{values:r,_$litType$:i}=e,n=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=_t.createElement(ms(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(r);else{let s=new Qt(n,this),o=s.u(this.options);s.p(r),this.T(o),this._$AH=s}}_$AC(e){let r=hs.get(e.strings);return r===void 0&&hs.set(e.strings,r=new _t(e)),r}k(e){mi(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,i,n=0;for(let s of e)n===r.length?r.push(i=new t(this.O(kt()),this.O(kt()),this,this.options)):i=r[n],i._$AI(s),n++;n<r.length&&(this._$AR(i&&i._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Le=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,i,n,s){this.type=1,this._$AH=U,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=U}_$AI(e,r=this,i,n){let s=this.strings,o=!1;if(s===void 0)e=je(this,e,r,0),o=!Ct(e)||e!==this._$AH&&e!==ne,o&&(this._$AH=e);else{let a=e,l,c;for(e=s[0],l=0;l<s.length-1;l++)c=je(this,a[i+l],r,l),c===ne&&(c=this._$AH[l]),o||=!Ct(c)||c!==this._$AH[l],c===U?e=U:e!==U&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!n&&this.j(e)}j(e){e===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},er=class extends Le{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===U?void 0:e}},tr=class extends Le{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==U)}},rr=class extends Le{constructor(e,r,i,n,s){super(e,r,i,n,s),this.type=5}_$AI(e,r=this){if((e=je(this,e,r,0)??U)===ne)return;let i=this._$AH,n=e===U&&i!==U||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==U&&(i===U||n);n&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ir=class{constructor(e,r,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){je(this,e)}},ws={M:pi,P:fe,A:fi,C:1,L:gs,R:Qt,D:ps,V:je,I:We,H:Le,N:tr,U:rr,B:er,F:ir},ul=hi.litHtmlPolyfillSupport;ul?.(_t,We),(hi.litHtmlVersions??=[]).push("3.3.1");var ys=(t,e,r)=>{let i=r?.renderBefore??e,n=i._$litPart$;if(n===void 0){let s=r?.renderBefore??null;i._$litPart$=n=new We(e.insertBefore(kt(),s),s,void 0,r??{})}return n._$AI(t),n};var wi=globalThis,v=class extends pe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ys(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ne}};v._$litElement$=!0,v.finalized=!0,wi.litElementHydrateSupport?.({LitElement:v});var dl=wi.litElementPolyfillSupport;dl?.({LitElement:v});(wi.litElementVersions??=[]).push("4.2.1");var nr=class t extends HTMLElement{static observedAttributes=["name"];constructor(){super(),this.attachShadow({mode:"open"})}attributeChangedCallback(e,r,i){r!==i&&t.observedAttributes.includes(e)&&(e==="name"&&(this.name=i||""),this.render())}resolveIcon(e){throw new Error("Not implemented")}render(){let e=document.createElement("style");for(e.textContent=`
4
4
  :host {
5
5
  display: inline-block;
6
6
  line-height: 0;
7
7
  }
8
- `;this.shadowRoot?.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild),this.shadowRoot.appendChild(e);if(!this.name)return;let r=this.resolveIcon(this.name);if(!r){console.warn(`'${this.name}' not found, please add it to ${t.name}`);return}let s=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;s.setAttribute("fill","currentColor"),s.style.width="100%",s.style.height="100%",this.shadowRoot?.appendChild(s)}name=""};var fs={clock:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
8
+ `;this.shadowRoot?.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild),this.shadowRoot.appendChild(e);if(!this.name)return;let r=this.resolveIcon(this.name);if(!r){console.warn(`'${this.name}' not found, please add it to ${t.name}`);return}let s=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;s.setAttribute("fill","currentColor"),s.style.width="100%",s.style.height="100%",this.shadowRoot?.appendChild(s)}name=""};var vs={clock:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
9
9
  <path d="M12 6V12H16.5M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
10
10
  </svg>`,"arrow-path":`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
11
11
  <path d="M16.0228 9.34841H21.0154V9.34663M2.98413 19.6444V14.6517M2.98413 14.6517L7.97677 14.6517M2.98413 14.6517L6.16502 17.8347C7.15555 18.8271 8.41261 19.58 9.86436 19.969C14.2654 21.1483 18.7892 18.5364 19.9685 14.1353M4.03073 9.86484C5.21 5.46374 9.73377 2.85194 14.1349 4.03121C15.5866 4.4202 16.8437 5.17312 17.8342 6.1655L21.0154 9.34663M21.0154 4.3558V9.34663" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -127,7 +127,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
127
127
  <path d="M3.97993 8.22257C3.05683 9.31382 2.35242 10.596 1.93436 12.0015C3.22565 16.338 7.24311 19.5 11.9991 19.5C12.9917 19.5 13.9521 19.3623 14.8623 19.1049M6.22763 6.22763C7.88389 5.13558 9.86771 4.5 12 4.5C16.756 4.5 20.7734 7.66205 22.0647 11.9985C21.3528 14.3919 19.8106 16.4277 17.772 17.772M6.22763 6.22763L3 3M6.22763 6.22763L9.87868 9.87868M17.772 17.772L21 21M17.772 17.772L14.1213 14.1213M14.1213 14.1213C14.6642 13.5784 15 12.8284 15 12C15 10.3431 13.6569 9 12 9C11.1716 9 10.4216 9.33579 9.87868 9.87868M14.1213 14.1213L9.87868 9.87868" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
128
128
  </svg>`,star:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
129
129
  <path d="M11.4806 3.4987C11.6728 3.03673 12.3272 3.03673 12.5193 3.4987L14.6453 8.61016C14.7263 8.80492 14.9095 8.93799 15.1197 8.95485L20.638 9.39724C21.1367 9.43722 21.339 10.0596 20.959 10.3851L16.7546 13.9866C16.5945 14.1238 16.5245 14.3391 16.5734 14.5443L17.8579 19.9292C17.974 20.4159 17.4446 20.8005 17.0176 20.5397L12.2932 17.6541C12.1132 17.5441 11.8868 17.5441 11.7068 17.6541L6.98238 20.5397C6.55539 20.8005 6.02594 20.4159 6.14203 19.9292L7.42652 14.5443C7.47546 14.3391 7.4055 14.1238 7.24531 13.9866L3.04099 10.3851C2.661 10.0596 2.86323 9.43722 3.36197 9.39724L8.88022 8.95485C9.09048 8.93799 9.27363 8.80492 9.35464 8.61016L11.4806 3.4987Z" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
130
- </svg>`};var cl=fs,gn=class extends tr{resolveIcon(e){let r=cl[e];if(!r)throw console.warn("hi-outline: icon not found",e),new Error(`Icon ${e} not found`);return r}render(){super.render();let e=this.shadowRoot?.querySelector("svg");if(!e)throw new Error("svgEl not found "+this.name);e.setAttribute("fill","none"),e.querySelectorAll("[stroke]").forEach(r=>{r.setAttribute("stroke","currentColor")})}};customElements.get("hi-outline")||customElements.define("hi-outline",gn);var rr=class{#e;#t;#r;constructor(e,r){if(!e)throw new Error("host is required");if(!r)throw new Error("config is required");this.#e=e,this.#e.addController(this),this.#t=r}connect(e){this.#t=e,this.#r=this.#n()}hostConnected(){this.#r||setTimeout(()=>{this.#r||(this.#r=this.#n())},0)}hostDisconnected(){this.#r?.close(1e3,"lit_host_disconnected"),this.#r=void 0}send(e){this.#r?.send(e)}close(e,r){this.#r?.close(e,r)}get isConnected(){return this.#r?.readyState===WebSocket.OPEN}get isConnecting(){return this.#r?.readyState===WebSocket.CONNECTING}#n(){let e=new WebSocket(this.#t.url());return this.#t.onClose&&(e.onclose=this.#t.onClose),this.#t.onOpen&&(e.onopen=this.#t.onOpen),this.#t.onError&&(e.onerror=this.#t.onError),this.#t.onMessage&&(e.onmessage=this.#t.onMessage),e}};var wn=t=>!!(t&&t.constructor&&t.call&&t.apply);var ms=t=>!(!t||!t.then||!wn(t.then));var gs=(t,e,r=!1)=>{if(!t)return[];let n=(s,o)=>e(s)-e(o),i=(s,o)=>e(o)-e(s);return t.slice().sort(r===!0?i:n)};function*yn(t,e,r=i=>i,n=1){let i=wn(r)?r:()=>r,s=e?t:0,o=e??t;for(let a=s;a<=o&&(yield i(a),!(a+n>o));a+=n);}var ws=(t,e,r,n)=>Array.from(yn(t,e,r,n));var ys=(t,e)=>t?t.reduce((r,n)=>{let[i,s]=r;return e(n)?[[...i,n],s]:[i,[...s,n]]},[[],[]]):[[],[]];var vn=class extends Error{constructor(e=[]){super();let r=e.find(n=>n.name)?.name??"";this.name=`AggregateError(${r}...)`,this.message=`AggregateError with ${e.length} errors`,this.stack=e.find(n=>n.stack)?.stack??this.stack,this.errors=e}},bn=async(t,e,r)=>{let n=e.map((c,u)=>({index:u,item:c})),i=async c=>{let u=[];for(;;){let h=n.pop();if(!h)return c(u);let[p,g]=await nr(r)(h.item);u.push({error:p,result:g,index:h.index})}},s=ws(1,t).map(()=>new Promise(i)),o=await Promise.all(s),[a,l]=ys(gs(o.flat(),c=>c.index),c=>!!c.error);if(a.length>0)throw new vn(a.map(c=>c.error));return l.map(c=>c.result)};var xn=async(t,e)=>{let r=t?.times??3,n=t?.delay,i=t?.backoff??null;for(let s of yn(1,r)){let[o,a]=await nr(e)(l=>{throw{_exited:l}});if(!o)return a;if(o._exited)throw o._exited;if(s===r)throw o;n&&await He(n),i&&await He(i(s))}},He=t=>new Promise(e=>setTimeout(e,t)),nr=t=>(...e)=>{try{let r=t(...e);return ms(r)?r.then(n=>[void 0,n]).catch(n=>[n,void 0]):[void 0,r]}catch(r){return[r,void 0]}};var ze=({interval:t},e)=>{let r=!0,n,i=(...s)=>{r&&(e(...s),r=!1,n=setTimeout(()=>{r=!0,n=void 0},t))};return i.isThrottled=()=>n!==void 0,i};async function vs(t,e){let r=t?.times??3,n=t?.delay,i=t?.backoff??null,s=o=>{throw{_bailed:o}};for(let o=0;o<r;o++)try{return await e(s,o)}catch(a){if(a&&typeof a=="object"&&"_bailed"in a)throw a._bailed;if(o===r-1)throw a;n&&await He(n),i&&await He(i(o+1))}throw new Error("unreachable")}var dl=!0,kn="Invariant failed";function I(t,e){if(!t){if(dl)throw new Error(kn);var r=typeof e=="function"?e():e,n=r?"".concat(kn,": ").concat(r):kn;throw new Error(n)}}var ir=class{#e;#t;#r=null;isStreaming=!1;typingIndicator;ranOutOfCredits=!1;messages=[];conversationId="";#n=0;#i;isLiveMode=!1;get hasQueuedMessages(){return this.#s.length>0}constructor(e,r){this.#e=e,this.#t=r,this.#t.autoConnect!==!1&&(this.#r=this.initWS()),e.addController(this)}#s=[];#o(e,{expectStreaming:r=!1}={}){return this.ranOutOfCredits?!1:this.#r?this.#r.isConnecting?(console.warn("WebSocket is connecting, message not sent",e),!1):this.#r.isConnected?(r&&!this.isLiveMode&&(this.isStreaming=!0,this.#e.requestUpdate()),this.#r.send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent",e),this.retry(),!1):(console.warn("WebSocket not initialized, message not sent",e),this.connect(),!1)}async enqueueMessage(e,{expectStreaming:r=!1}={}){if(this.#s.length>0){let n=this.#s[this.#s.length-1];if(e.type==="USER_INPUT"&&n.message.type==="USER_INPUT"&&e.value===n.message.value)return!0}return this.#r||this.connect(),this.#r?.isConnected?this.#o(e,{expectStreaming:r}):(this.#s.push({message:e,options:{expectStreaming:r}}),this.#e.requestUpdate(),this.#r&&!this.#r.isConnecting&&!this.#r.isConnected&&this.retry(),await vs({times:5,delay:2e3},async()=>{if(this.#r?.isConnected){let n=[...this.#s];this.#s=[],this.#e.requestUpdate();let i=!1;for(let{message:s,options:o}of n){let a=this.#o(s,o);s===e&&(i=a)}return i}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),this.#s=[],this.#e.requestUpdate(),!1)))}async sendUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1,requestInputResponse:o}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n,requestInputResponse:o},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1,requestInputResponse:o}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n,requestInputResponse:o},{expectStreaming:s})}sendImageDelete(e){I(e,"imageId is required"),this.enqueueMessage({type:"USER_FILE_DELETE",imageId:e}).catch(console.warn)}sendUserCancel(){this.enqueueMessage({type:"USER_CANCEL"}).catch(console.warn)}sendUserTypingStart(){this.#o({type:"USER_TYPING_START"})}sendUserTypingStop(){this.enqueueMessage({type:"USER_TYPING_STOP"}).catch(console.warn)}sendNewChat(){this.enqueueMessage({type:"NEW_CHAT"})}sendUserMeta(e){this.enqueueMessage({type:"USER_META",metadata:e}).catch(console.warn)}reloadConfig(){this.enqueueMessage({type:"RELOAD_CONFIG"}).catch(console.warn)}close(){this.#r?.close(1e3,"closed by user")}retry(){clearTimeout(this.#i),this.#i=setTimeout(()=>{this.#t.onReconnect?.(),this.#r=this.initWS()},1e3*this.#n),this.#n++}initWS(){return new rr(this.#e,{url:()=>this.#t.url(this.conversationId,{}),onOpen:e=>this.#a(e),onMessage:e=>this.#d(JSON.parse(e.data)),onError:e=>this.#c(e),onClose:e=>this.#l(e)})}#a(e){this.#n=0}#d(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,{...e.message,streaming:!0}].filter((r,n,i)=>n===i.findIndex(s=>s.id===r.id)),this.typingIndicator=void 0,this.#e.requestUpdate(),this.#t.onNewMessage?.(e.message),this.#t.persistConversationState?.(this.conversationId,this.messages);break}case"APPEND_MESSAGE":{let r=this.messages.find(n=>n.id===e.message.id);if(r){switch(e.message.content_type){case"text":{let{part:n,delta:i,position:s}=e.message;r.content=r.content.slice(0,s)+i,r.parts||=[],r.parts[n]={text:r.parts[n]&&"text"in r.parts[n]?(r.parts[n].text||"").slice(0,s)+i:i};break}case"html":{let{part:n,delta:i,position:s}=e.message;r.parts||=[],r.parts[n]={html:r.parts[n]&&"html"in r.parts[n]?(r.parts[n].html||"").slice(0,s)+i:i};break}case"data":{let{part:n}=e.message;r.parts||=[],r.parts[n]={tag:e.message.tag,data:r.parts[n]&&"data"in r.parts[n]?Object.assign(r.parts[n].data||{},e.message.data):e.message.data};break}}e.metadata&&(r.metadata=e.metadata),this.#t.onMessageAppend?.(e),this.#e.requestUpdate()}else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let r=this.messages.find(n=>n.id===e.message.id);if(r)Object.assign(r,e.message),r.streaming=!1;else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,this.#e.requestUpdate(),this.#t.onMessageDone?.(e,r),this.#t.persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate();break}case"ERROR":{this.#t.onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,this.#t.onConnect?.(e.conversationId,e.metadata),this.#t.persistConversationState?.(e.conversationId,e.messages),this.isLiveMode=e.metadata.isLiveMode,this.#e.requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},this.#e.requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,this.#e.requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.ranOutOfCredits=!0,this.#e.requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),this.#e.requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}}#c(e){console.error("onError",e),this.#t.onError?.(e)}#l(e){this.#e.isConnected&&this.#r&&!this.#r.isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate(),this.#t.onClose?.()}hostConnected(){this.conversationId=this.#t.restoreConversationState?.()?.conversationId||"",this.messages=this.#t.restoreConversationState?.()?.messages||[]}reset(){this.#t.onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,this.#s=[],this.#e.requestUpdate()}hostDisconnected(){clearTimeout(this.#i)}connect(){this.#r||(this.#r=this.initWS())}reconnectSocket(){this.#r?.close(1e3,"destroy"),this.#r=this.initWS()}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}get isConnected(){return this.#r?.isConnected??!1}};var Kd=Symbol(),hl=Symbol();var bs=Object.getPrototypeOf,Cn=new WeakMap,pl=t=>t&&(Cn.has(t)?Cn.get(t):bs(t)===Object.prototype||bs(t)===Array.prototype);var xs=t=>pl(t)&&t[hl]||null,Sn=(t,e=!0)=>{Cn.set(t,e)};var $n=t=>typeof t=="object"&&t!==null,fl=t=>$n(t)&&!_n.has(t)&&(Array.isArray(t)||!(Symbol.iterator in t))&&!(t instanceof WeakMap)&&!(t instanceof WeakSet)&&!(t instanceof Error)&&!(t instanceof Number)&&!(t instanceof Date)&&!(t instanceof String)&&!(t instanceof RegExp)&&!(t instanceof ArrayBuffer)&&!(t instanceof Promise),Ss=(t,e)=>{let r=ks.get(t);if(r?.[0]===e)return r[1];let n=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return Sn(n,!0),ks.set(t,[e,n]),Reflect.ownKeys(t).forEach(i=>{if(Object.getOwnPropertyDescriptor(n,i))return;let s=Reflect.get(t,i),{enumerable:o}=Reflect.getOwnPropertyDescriptor(t,i),a={value:s,enumerable:o,configurable:!0};if(_n.has(s))Sn(s,!1);else if(Te.has(s)){let[l,c]=Te.get(s);a.value=Ss(l,c())}Object.defineProperty(n,i,a)}),Object.preventExtensions(n)},ml=(t,e,r,n)=>({deleteProperty(i,s){let o=Reflect.get(i,s);r(s);let a=Reflect.deleteProperty(i,s);return a&&n(["delete",[s],o]),a},set(i,s,o,a){let l=!t()&&Reflect.has(i,s),c=Reflect.get(i,s,a);if(l&&(Cs(c,o)||sr.has(o)&&Cs(c,sr.get(o))))return!0;r(s),$n(o)&&(o=xs(o)||o);let u=!Te.has(o)&&wl(o)?Mn(o):o;return e(s,u),Reflect.set(i,s,u,a),n(["set",[s],o,c]),!0}}),Te=new WeakMap,_n=new WeakSet,ks=new WeakMap,En=[1],sr=new WeakMap,Cs=Object.is,gl=(t,e)=>new Proxy(t,e),wl=fl,yl=Ss,vl=ml;function Mn(t={}){if(!$n(t))throw new Error("object required");let e=sr.get(t);if(e)return e;let r=En[0],n=new Set,i=(b,E=++En[0])=>{r!==E&&(s=r=E,n.forEach(y=>y(b,E)))},s=r,o=(b=En[0])=>(s!==b&&(s=b,l.forEach(([E])=>{let y=E[1](b);y>r&&(r=y)})),r),a=b=>(E,y)=>{let x=[...E];x[1]=[b,...x[1]],i(x,y)},l=new Map,c=(b,E)=>{let y=!_n.has(E)&&Te.get(E);if(y){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(b))throw new Error("prop listener already exists");if(n.size){let x=y[2](a(b));l.set(b,[y,x])}else l.set(b,[y])}},u=b=>{var E;let y=l.get(b);y&&(l.delete(b),(E=y[1])==null||E.call(y))},h=b=>(n.add(b),n.size===1&&l.forEach(([y,x],$)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&x)throw new Error("remove already exists");let L=y[2](a($));l.set($,[y,L])}),()=>{n.delete(b),n.size===0&&l.forEach(([y,x],$)=>{x&&(x(),l.set($,[y]))})}),p=!0,g=vl(()=>p,c,u,i),f=gl(t,g);sr.set(t,f);let S=[t,o,h];return Te.set(f,S),Reflect.ownKeys(t).forEach(b=>{let E=Object.getOwnPropertyDescriptor(t,b);"value"in E&&E.writable&&(f[b]=t[b])}),p=!1,f}function or(t,e,r){let n=Te.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i,s=[],o=n[2],a=!1,c=o(u=>{if(s.push(u),r){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,c()}}function We(t){let e=Te.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[r,n]=e;return yl(r,n())}var Ge=class{#e;#t;#r;#n=()=>{};constructor(e,r){this.#e=e,this.#t=r,this.#r=We(r),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#n(),this.#n=or(this.#t,()=>{this.#r=We(this.#t),this.#e.requestUpdate()})}hostDisconnected(){this.#n()}};var ge=class{#e;#t;proxyObject;#r;#n=()=>{};constructor(e,r,n){this.#e=e,this.#t=n,this.proxyObject=Mn(r),this.#r=We(this.proxyObject),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#n(),this.#t?.subscribe&&(this.#n=or(this.proxyObject,()=>{this.#r=We(this.proxyObject),this.#e.requestUpdate()}))}hostDisconnected(){this.#n()}};var ar=class{#e;#t;#r;#n=null;#i=null;constructor(e,{provider:r,tag:n,key:i}){this.#e=e,this.#t=n,this.#r=i,e.addController(this)}get value(){return this.#i?this.#i.value:null}hostConnected(){if(this.#i||(this.#n=bl(this.#e,this.#t),!this.#n))return;let e=this.#n[this.#r]instanceof ge?this.#n[this.#r]:null;e&&(this.#i=new Ge(this.#e,e.proxyObject))}hostDisconnected(){}};function bl(t,e){let r=t;for(;r;){let n=r.closest(e);if(n)return n;let i=r.getRootNode();if(i instanceof ShadowRoot)r=i.host;else break}return null}var kt=sn(Tn(),1);var cr=class{#e;constructor({document:e}){this.#e=e}getCookies(){return kt.parse(this.#e.cookie)||{}}getCookie(e){return this.getCookies()[e]||null}setCookie(e,r,n){if(I(typeof e=="string",`cookie name must be a string, got: ${typeof e}`),I(e,"cookie name must not be empty"),r==null){this.#e.cookie=kt.serialize(e,"",{expires:new Date(0)});return}I(typeof r=="string",`value of cookie \`${e}\` must be a string, got: ${typeof r}`),this.#e.cookie=kt.serialize(e,r,n)}deleteCookie(e){this.setCookie(e,null)}deleteCookies(e){let r=this.getCookies();for(let n in r)e(n)&&this.deleteCookie(n)}};var ur=class{#e;constructor({localStorage:e}){this.#e=e}getItem(e){try{let r=this.#e.getItem(e);return r?JSON.parse(r):null}catch{return null}}setItem(e,r){if(r==null){this.#e.removeItem(e);return}try{let n=JSON.stringify(r);this.#e.setItem(e,n)}catch(n){console.error(`Failed to store ${e} in localStorage:`,n)}}removeItem(e){this.#e.removeItem(e)}removeItems(e){let r=[];for(let n=0;n<this.#e.length;n++){let i=this.#e.key(n);i&&e(i)&&r.push(i)}for(let n of r)this.#e.removeItem(n)}};var Ct=sn(Tn(),1);function Ln({window:t}){let e=t.location.hostname,r=t.document;if(e==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(e)||/^\[.*\]$/.test(e))return;let n=e.split(".");if(n.length<2)return;let i="__molin_domain_test__";for(let s=2;s<=n.length;s++){let o=`.${n.slice(-s).join(".")}`;try{if(r.cookie=Ct.serialize(i,"1",{domain:o,path:"/"}),Ct.parse(r.cookie)[i]==="1")return r.cookie=Ct.serialize(i,"",{domain:o,path:"/",expires:new Date(0)}),o}catch{continue}}return`.${n.slice(-2).join(".")}`}var jn=class{#e;#t;#r;#n;constructor({window:e}){this.#e=e,this.#t=new cr({document:e.document}),this.#r=new ur({localStorage:e.localStorage}),this.#n=e.localStorage}get distinctID(){return this.#t.getCookie("molin_distinct_id")||this.#n.getItem("molin_distinct_id")||this.#r.getItem("molin_shop_assistant_distinct_id")}set distinctID(e){if(this.#r.removeItem("molin_shop_assistant_distinct_id"),!e){this.#t.deleteCookie("molin_distinct_id"),this.#n.removeItem("molin_distinct_id");return}I(typeof e=="string","distinct_id must be a string");try{this.#t.setCookie("molin_distinct_id",e,{path:"/",sameSite:"lax",expires:new Date(Date.now()+1e3*60*60*24*365),domain:Ln({window:this.#e})})}catch(r){console.warn("Could not write distinct_id to cookie:",r)}try{this.#n.setItem("molin_distinct_id",e)}catch(r){console.warn("Could not write distinct_id to localStorage:",r)}}get widgetState(){return this.#r.getItem("molin_widget")||this.#r.getItem("_molin_widget_open_state")}set widgetState(e){this.#r.setItem("molin_widget",e),this.#r.removeItem("_molin_widget_open_state")}get popupState(){return this.#r.getItem("molin_popup")||this.#r.getItem("_molin_popup")}set popupState(e){this.#r.setItem("molin_popup",e),this.#r.removeItem("_molin_popup")}get disclaimerDismissed(){return this.#r.getItem("molin_disclaimer_dismissed")??!1}set disclaimerDismissed(e){this.#r.setItem("molin_disclaimer_dismissed",e)}getConversationId(e){I(typeof e=="string","widgetId must be a string"),I(e,"widgetId must not be empty");let r=`molin_${e}_conversation_id`;return this.#t.getCookie(r)||this.#n.getItem(r)||this.#r.getItem(`_molin_${e}`)?.conversationId}setConversationId(e,r){I(typeof e=="string","widgetId must be a string"),I(e,"widgetId must not be empty");let n=`molin_${e}_conversation_id`;if(!r){this.#t.deleteCookie(n),this.#n.removeItem(n);return}I(typeof r=="string",`conversation ID for widget ${e} must be a string`);try{this.#t.setCookie(n,r,{path:"/",sameSite:"lax",expires:new Date(Date.now()+1e3*60*60*24*365),domain:Ln({window:this.#e})})}catch(i){console.warn(`Could not write ${n} to cookie:`,i)}try{this.#n.setItem(n,r)}catch(i){console.warn(`Could not write ${n} to localStorage:`,i)}}getConversationState(e){I(typeof e=="string","widgetId must be a string"),I(e,"widgetId must not be empty");let r=`molin_${e}_conversation`;return this.#r.getItem(r)||this.#r.getItem(`_molin_${e}`)}setConversationState(e,r){this.#r.removeItem(`_molin_${e}`),I(typeof e=="string","widgetId must be a string"),I(e,"widgetId must not be empty");let n=`molin_${e}_conversation`;this.#r.setItem(n,r)}resetAll(){this.distinctID=null,this.widgetState=null,this.popupState=null,this.disclaimerDismissed=!1,this.#r.removeItems(e=>e.startsWith("_molin_")),this.#t.deleteCookies(e=>e.startsWith("_molin_"))}},U=new jn({window});var Is=()=>{if(window.Shopify)try{return{customerId:Il()}}catch{return null}return null},Il=()=>{try{let t=[()=>window.ShopifyAnalytics?.meta?.page?.customerId,()=>window.meta?.page?.customerId,()=>window._st?.cid,()=>window.ShopifyAnalytics?.lib?.user()?.traits()?.uniqToken];for(let e of t)try{let r=e();if(/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i.test(r))continue;if(r)return r}catch{}}catch{return null}return null},As=async()=>{try{return(await(await fetch(window.Shopify.routes.root+"cart.js")).json()).items.map(n=>({id:n.id,name:n.title,quantity:n.quantity,price:n.price,variantId:n.variant_id,sku:n.sku,url:n.url,description:n.product_description,image:n.featured_image?.url}))}catch{return[]}};function Ts(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function Dn(t){return new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+!*'();@&=,$]*)*(\\?[-a-z\\d%_.~+!*'();@&=,$]*)?(\\#[-a-z\\d%_.~+!*'();@&=,$]*)?$","i").test(t)}function Ls(t,e){let r=t instanceof URL?t:new URL(t);if(e)for(let[n,i]of e)r.searchParams.set(n,i);return r}var js=()=>{if(window.ShopRenter)try{let t=Tl();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},Tl=()=>{try{if(window.ShopRenter){let t=window.ShopRenter.customer;return{customerEmail:t?.email,customerId:t?.userId,customerName:[t?.name?.firstName,t?.name?.lastName].filter(Boolean).join(" ")}}return{customerEmail:null,customerId:null,customerName:null}}catch{return{customerEmail:null,customerId:null,customerName:null}}},Ds=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=Ts(t,"https")+"/cart.json";return(await(await fetch(e)).json()).items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku,image:s.image,url:s.href}))}catch{return[]}};var Os=()=>{if(window.UNAS)try{let t=window.UNAS.customer;return{customerEmail:t?.email,customerId:t?.id}}catch(t){return console.error("Error fetching customer information:",t),null}return null},Us=async()=>new Promise((t,e)=>{try{window.UNAS.getCart(r=>{let i=r.items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku}));t(i)})}catch(r){console.error("Error fetching cart information:",r),e(r)}});var On;function Rs(t){return{lang:t?.lang??On?.lang,message:t?.message,abortEarly:t?.abortEarly??On?.abortEarly,abortPipeEarly:t?.abortPipeEarly??On?.abortPipeEarly}}var Dl;function Ol(t){return Dl?.get(t)}var Ul;function Pl(t){return Ul?.get(t)}var Rl;function Bl(t,e){return Rl?.get(t)?.get(e)}function Bs(t){let e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function H(t,e,r,n,i){let s=i&&"input"in i?i.input:r.value,o=i?.expected??t.expects??null,a=i?.received??Bs(s),l={kind:t.kind,type:t.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},c=t.kind==="schema",u=i?.message??t.message??Bl(t.reference,l.lang)??(c?Pl(l.lang):null)??n.message??Ol(l.lang);u!==void 0&&(l.message=typeof u=="function"?u(l):u),c&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function G(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},Rs())}}}function qs(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Fs(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}function Un(t,e){return{kind:"validation",type:"max_length",reference:Un,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length>this.requirement&&H(this,"length",r,n,{received:`${r.value.length}`}),r}}}function Pn(t,e){return{kind:"validation",type:"min_length",reference:Pn,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length<this.requirement&&H(this,"length",r,n,{received:`${r.value.length}`}),r}}}function St(t){return{kind:"transformation",type:"transform",reference:St,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function Ns(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function Rn(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function Et(){return{kind:"schema",type:"any",reference:Et,expects:"any",async:!1,get"~standard"(){return G(this)},"~run"(t){return t.typed=!0,t}}}function Ze(t,e){return{kind:"schema",type:"array",reference:Ze,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return G(this)},"~run"(r,n){let i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<i.length;s++){let o=i[s],a=this.item["~run"]({value:o},n);if(a.issues){let l={type:"array",origin:"value",input:i,key:s,value:o};for(let c of a.issues)c.path?c.path.unshift(l):c.path=[l],r.issues?.push(c);if(r.issues||(r.issues=a.issues),n.abortEarly){r.typed=!1;break}}a.typed||(r.typed=!1),r.value.push(a.value)}}else H(this,"type",r,n);return r}}}function Bn(t){return{kind:"schema",type:"boolean",reference:Bn,expects:"boolean",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:H(this,"type",e,r),e}}}function qn(t,e){return{kind:"schema",type:"loose_object",reference:qn,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return G(this)},"~run"(r,n){let i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(let s in this.entries){let o=this.entries[s];if(s in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){let a=s in i?i[s]:Rn(o),l=o["~run"]({value:a},n);if(l.issues){let c={type:"object",origin:"value",input:i,key:s,value:a};for(let u of l.issues)u.path?u.path.unshift(c):u.path=[c],r.issues?.push(u);if(r.issues||(r.issues=l.issues),n.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value[s]=l.value}else if(o.fallback!==void 0)r.value[s]=Ns(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(H(this,"key",r,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}if(!r.issues||!n.abortEarly)for(let s in i)qs(i,s)&&!(s in this.entries)&&(r.value[s]=i[s])}else H(this,"type",r,n);return r}}}function Fn(t){return{kind:"schema",type:"null",reference:Fn,expects:"null",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return e.value===null?e.typed=!0:H(this,"type",e,r),e}}}function dr(t){return{kind:"schema",type:"number",reference:dr,expects:"number",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:H(this,"type",e,r),e}}}function se(t,e){return{kind:"schema",type:"object",reference:se,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return G(this)},"~run"(r,n){let i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(let s in this.entries){let o=this.entries[s];if(s in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){let a=s in i?i[s]:Rn(o),l=o["~run"]({value:a},n);if(l.issues){let c={type:"object",origin:"value",input:i,key:s,value:a};for(let u of l.issues)u.path?u.path.unshift(c):u.path=[c],r.issues?.push(u);if(r.issues||(r.issues=l.issues),n.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value[s]=l.value}else if(o.fallback!==void 0)r.value[s]=Ns(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(H(this,"key",r,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}}else H(this,"type",r,n);return r}}}function Je(t,e){return{kind:"schema",type:"optional",reference:Je,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return G(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=Rn(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function Nn(t,e){return{kind:"schema",type:"picklist",reference:Nn,expects:Fs(t.map(Bs),"|"),async:!1,options:t,message:e,get"~standard"(){return G(this)},"~run"(r,n){return this.options.includes(r.value)?r.typed=!0:H(this,"type",r,n),r}}}function hr(t,e,r){return{kind:"schema",type:"record",reference:hr,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return G(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(let o in s)if(qs(s,o)){let a=s[o],l=this.key["~run"]({value:o},i);if(l.issues){let u={type:"object",origin:"key",input:s,key:o,value:a};for(let h of l.issues)h.path=[u],n.issues?.push(h);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}let c=this.value["~run"]({value:a},i);if(c.issues){let u={type:"object",origin:"value",input:s,key:o,value:a};for(let h of c.issues)h.path?h.path.unshift(u):h.path=[u],n.issues?.push(h);if(n.issues||(n.issues=c.issues),i.abortEarly){n.typed=!1;break}}(!l.typed||!c.typed)&&(n.typed=!1),l.typed&&(n.value[l.value]=c.value)}}else H(this,"type",n,i);return n}}}function P(t){return{kind:"schema",type:"string",reference:P,expects:"string",async:!1,message:t,get"~standard"(){return G(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:H(this,"type",e,r),e}}}function Ps(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function pr(t,e){return{kind:"schema",type:"union",reference:pr,expects:Fs(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return G(this)},"~run"(r,n){let i,s,o;for(let a of this.options){let l=a["~run"]({value:r.value},n);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{i=l;break}else o?o.push(l):o=[l]}if(i)return i;if(s){if(s.length===1)return s[0];H(this,"type",r,n,{issues:Ps(s)}),r.typed=!0}else{if(o?.length===1)return o[0];H(this,"type",r,n,{issues:Ps(o)})}return r}}}function Vs(t,e){let r={};for(let n in t.entries)r[n]=!e||e.includes(n)?Je(t.entries[n]):t.entries[n];return{...t,entries:r,get"~standard"(){return G(this)}}}function Ke(...t){return{...t[0],pipe:t,get"~standard"(){return G(this)},"~run"(e,r){for(let n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=n["~run"](e,r))}return e}}}function Le(t,e,r){let n=t["~run"]({value:e},Rs(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var Hs=hr(P(),pr([P(),dr(),Bn(),Fn()])),zs=Ke(P(),Pn(1),Un(5e3)),Ws=()=>{try{return window.UNAS?Os():window.Shopify?Is():window.ShopRenter?js():null}catch{return null}},Gs=async()=>{try{return window.UNAS?await Us():window.Shopify?await As():window.ShopRenter?await Ds():[]}catch{return[]}},Ye={schema:se({conversationId:Je(P()),messages:Je(Ze(se({id:P(),timestamp:dr(),role:Nn(["user","assistant","support"]),content:P(),parts:Je(Ze(pr([se({text:P()}),se({html:P()}),se({tag:P(),data:hr(P(),Et())})])))})))}),persist(t,e,r){U.setConversationState(t,{conversationId:e,messages:r}),U.setConversationId(t,e)},restore(t){try{let e=U.getConversationState(t),r=e?Le(this.schema,e):void 0;return r?.success&&r.output.conversationId?{conversationId:r.output.conversationId,messages:r.output.messages||[]}:{conversationId:U.getConversationId(t)||"",messages:[]}}catch(e){return console.error("Failed to restore conversation state:",e),{conversationId:"",messages:[]}}},reset(t){U.setConversationState(t,null),U.setConversationId(t,null)}};var Xe=class t extends v{static properties={widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object},autoConnect:{type:Boolean}};contextCtrl;constructor(){super(),this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.autoConnect=!1,this.contextCtrl=new ge(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,ranOutOfCredits:!1,isLiveMode:!1,lastMsg:void 0,hasQueuedMessages:!1,isConnected:()=>this.#i.isConnected,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),sendNewChat:this.sendNewChat.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this),sendImageDelete:this.#i.sendImageDelete.bind(this.#i)})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.autoConnect&&this.#i.connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:this.#t,xCustomInstructions:this.#r,conversationId:this.#i.conversationId,messages:this.#e,isStreaming:this.#i.isStreaming,typingIndicator:this.#i.typingIndicator,ranOutOfCredits:this.#i.ranOutOfCredits,isLiveMode:this.#i.isLiveMode,lastMsg:this.#i.lastMsg,hasQueuedMessages:this.#i.hasQueuedMessages,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this),sendImageDelete:this.#i.sendImageDelete.bind(this.#i)}),this.#s()}get#e(){return this.#i?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:this.#i?.messages||[]}#t;#r;#n=null;get#i(){return this.#n||(this.#n=new ir(this,{autoConnect:this.autoConnect,url:e=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("conversationId",e),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:e=>{console.error("ws error",e)},onClose:()=>{},onNewMessage:e=>{e.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:e,conversationId:this.#i.conversationId})},onMessageAppend:e=>{},onMessageDone:(e,r)=>{r.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:r.content??"",message:r,usage_TOKENS_COMPLETION:e.message.usage.TOKENS_COMPLETION,conversationId:this.#i.conversationId})},onMessageError:e=>{console.error("ws message error",e),e.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+e.message})},onReset:()=>{Ye.reset(this.widgetId)},onConnect:(e,r)=>{let n=Ws();this.#i.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:n,language:window.navigator.language,cart:[]}),Gs().then(i=>{i?.length>0&&this.#i.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:n,cart:i,language:window.navigator.language})}).catch(i=>{console.error(i)}),this.dispatchEvent(new t.ConnectedEvent({conversationId:e,metadata:r,widgetId:this.widgetId,pendingImages:r?.pendingImages||[]}))},persistConversationState:(e,r)=>{Ye.persist(this.widgetId,e,r)},restoreConversationState:()=>Ye.restore(this.widgetId)})),this.#n}#s(){function e(n){if(!n)return;let i;try{i=typeof n=="object"?n:JSON.parse(n)}catch(o){console.error("Molin: user-data is not valid JSON",o);return}if(!i||typeof i!="object"||Object.keys(i).length===0)return;let s=Le(Hs,i);if(!s.success){console.error("Molin: user-data does not pass schema validation",s.issues);return}return s.output}function r(n){if(!n)return;let i=Le(zs,n);if(!i.success){console.error("Molin: custom-instructions does not pass schema validation",i.issues);return}return i.output}this.#t=e(this.xUserData),this.#r=r(this.xCustomInstructions)}async sendUserInput(e,r={}){let n={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...r},i=await this.#i.sendUserInput(e,n);return i&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!1,conversationId:this.#i.conversationId}),i}async enqueueUserInput(e,r={}){this.#e.some(s=>s.role==="assistant"&&s.parts?.some(o=>"tag"in o&&o.tag==="request-input-v1"&&"data"in o&&o.data.type==="new-conversation-button"))&&(this.sendNewChat(),this.reset());let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...r};return this.#i.enqueueUserInput(e,i)}sendUserCancel(){this.#i.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){this.#i.sendUserTypingStart()}sendUserTypingStop(){this.#i.sendUserTypingStop()}sendNewChat(){this.#i.sendNewChat()}reset(){this.#i.reset()}reloadConfig(){this.#i.reloadConfig()}connect(){this.#i.connect()}render(){return d`<slot></slot>`}};function Zs(t){let e=new ar(t,{provider:Xe,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,n){if(n==="value")return e.value}})}Xe.ConnectedEvent=class extends CustomEvent{static type="mw-context-widget:connected";constructor(e,r={}){super(Xe.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-context-widget")||customElements.define("mw-context-widget",Xe);function Xn(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function ql(t,e=","){return t.map(Xn).join(e)}var to=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function fr(t){for(var e=9,r=t.length;r--;)e=Math.imul(e^t.charCodeAt(r),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function wr(t,e="@media "){return e+A(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(n=>`(${n}-width:${r[n]})`).join(" and "))).join(",")}function A(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function Js(t){return t}function yr(){}var B={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function ro(t){return t.match(/[-=:;]/g)?.length||0}function Gn(t){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(t)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(ro(t),15)<<18}var Fl=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function Qn({n:t,i:e,v:r=[]},n,i,s){t&&(t=Xn({n:t,i:e,v:r})),s=[...A(s)];for(let a of r){let l=n.theme("screens",a);for(let c of A(l&&wr(l)||n.v(a))){var o;s.push(c),i|=l?67108864|Gn(c):a=="dark"?1073741824:c[0]=="@"?Gn(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~Fl.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:i,r:s,i:e}}var no=new Map;function Zn(t){if(t.d){let e=[],r=Vn(t.r.reduce((n,i)=>i[0]=="@"?(e.push(i),n):i?Vn(n,s=>Vn(i,o=>{let a=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(a){let l=s.indexOf(a[1]);return~l?s.slice(0,l)+a[0]+s.slice(l+a[1].length):Hn(s,o)}return Hn(o,s)})):n,"&"),n=>Hn(n,t.n?"."+to(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((n,i)=>i+"{"+n+"}",t.d)}}function Vn(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,n,i)=>e(n)+i)}function Hn(t,e){return t.replace(/&/g,e)}var Ks=new Intl.Collator("en",{numeric:!0});function io(t,e){for(var r=0,n=t.length;r<n;){let i=n+r>>1;0>=so(t[i],e)?r=i+1:n=i}return n}function so(t,e){let r=t.p&B.o;return r==(e.p&B.o)&&(r==B.b||r==B.o)?0:t.p-e.p||t.o-e.o||Ks.compare(Ys(t.n),Ys(e.n))||Ks.compare(Xs(t.n),Xs(e.n))}function Ys(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function Xs(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function zn(t,e){return Math.round(parseInt(t,16)*e)}function Y(t,e={}){if(typeof t=="function")return t(e);let{opacityValue:r="1",opacityVariable:n}=e,i=n?`var(${n})`:r;if(t.includes("<alpha-value>"))return t.replace("<alpha-value>",i);if(t[0]=="#"&&(t.length==4||t.length==7)){let s=(t.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[zn(t.substr(1,s),o),zn(t.substr(1+s,s),o),zn(t.substr(1+2*s,s),o),i]})`}return i=="1"?t:i=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${i})`)}function oo(t,e,r,n,i=[]){return(function s(o,{n:a,p:l,r:c=[],i:u},h){let p=[],g="",f=0,S=0;for(let y in o||{}){var b,E;let x=o[y];if(y[0]=="@"){if(!x)continue;if(y[1]=="a"){p.push(...ti(a,l,gr(""+x),h,l,c,u,!0));continue}if(y[1]=="l"){for(let $ of A(x))p.push(...s($,{n:a,p:(b=B[y[7]],l&~B.o|b),r:y[7]=="d"?[]:c,i:u},h));continue}if(y[1]=="i"){p.push(...A(x).map($=>({p:-1,o:0,r:[],d:y+" "+$})));continue}if(y[1]=="k"){p.push({p:B.d,o:0,r:[y],d:s(x,{p:B.d},h).map(Zn).join("")});continue}if(y[1]=="f"){p.push(...A(x).map($=>({p:B.d,o:0,r:[y],d:s($,{p:B.d},h).map(Zn).join("")})));continue}}if(typeof x!="object"||Array.isArray(x))y=="label"&&x?a=x+fr(JSON.stringify([l,u,o])):(x||x===0)&&(y=y.replace(/[A-Z]/g,$=>"-"+$.toLowerCase()),S+=1,f=Math.max(f,(E=y)[0]=="-"?0:ro(E)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(E)?+!!RegExp.$1||-!!RegExp.$2:0)+1),g+=(g?";":"")+A(x).map($=>h.s(y,ei(""+$,h.theme)+(u?" !important":""))).join(";"));else if(y[0]=="@"||y.includes("&")){let $=l;y[0]=="@"&&(y=y.replace(/\bscreen\(([^)]+)\)/g,(L,R)=>{let F=h.theme("screens",R);return F?($|=67108864,wr(F,"")):L}),$|=Gn(y)),p.push(...s(x,{n:a,p:$,r:[...c,y],i:u},h))}else p.push(...s(x,{p:l,r:[...c,y]},h))}return p.unshift({n:a,p:l,o:Math.max(0,15-S)+1.5*Math.min(f||15,15),r:c,d:g}),p.sort(so)})(t,Qn(e,r,n,i),r)}function ei(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,n,i,s,o="")=>{let a=e(i,o);return typeof a=="function"&&/color|fill|stroke/i.test(i)?Y(a):""+A(a).filter(l=>Object(l)!==l)})}function ao(t,e){let r,n=[];for(let i of t)i.d&&i.n?r?.p==i.p&&""+r.r==""+i.r?(r.c=[r.c,i.c].filter(Boolean).join(" "),r.d=r.d+";"+i.d):n.push(r={...i,n:i.n&&e}):n.push({...i,n:i.n&&e});return n}function mr(t,e,r=B.u,n,i){let s=[];for(let o of t)for(let a of(function(l,c,u,h,p){l={...l,i:l.i||p};let g=(function(f,S){let b=no.get(f.n);return b?b(f,S):S.r(f.n,f.v[0]=="dark")})(l,c);return g?typeof g=="string"?({r:h,p:u}=Qn(l,c,u,h),ao(mr(gr(g),c,u,h,l.i),l.n)):Array.isArray(g)?g.map(f=>{var S,b;return{o:0,...f,r:[...A(h),...A(f.r)],p:(S=u,b=f.p??u,S&~B.o|b)}}):oo(g,l,c,u,h):[{c:Xn(l),p:0,o:0,r:[]}]})(o,e,r,n,i))s.splice(io(s,a),0,a);return s}function ti(t,e,r,n,i,s,o,a){return ao((a?r.flatMap(l=>mr([l],n,i,s,o)):mr(r,n,i,s,o)).map(l=>l.p&B.o&&(l.n||e==B.b)?{...l,p:l.p&~B.o|e,o:0}:l),t)}function Nl(t,e,r,n){var i;return i=(s,o)=>{let{n:a,p:l,r:c,i:u}=Qn(s,o,e);return r&&ti(a,e,r,o,l,c,u,n)},no.set(t,i),t}function Wn(t,e,r){if(t[t.length-1]!="("){let n=[],i=!1,s=!1,o="";for(let a of t)if(!(a=="("||/[~@]$/.test(a))){if(a[0]=="!"&&(a=a.slice(1),i=!i),a.endsWith(":")){n[a=="dark:"?"unshift":"push"](a.slice(0,-1));continue}a[0]=="-"&&(a=a.slice(1),s=!s),a.endsWith("-")&&(a=a.slice(0,-1)),a&&a!="&"&&(o+=(o&&"-")+a)}o&&(s&&(o="-"+o),e[0].push({n:o,v:n.filter(Vl),i}))}}function Vl(t,e,r){return r.indexOf(t)==e}var Qs=new Map;function gr(t){let e=Qs.get(t);if(!e){let r=[],n=[[]],i=0,s=0,o=null,a=0,l=(c,u=0)=>{i!=a&&(r.push(t.slice(i,a+u)),c&&Wn(r,n)),i=a+1};for(;a<t.length;a++){let c=t[a];if(s)t[a-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)t[a-1]!="\\"&&o.test(t.slice(a))&&(o=null,i=a+RegExp.lastMatch.length);else if(c=="/"&&t[a-1]!="\\"&&(t[a+1]=="*"||t[a+1]=="/"))o=t[a+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")l(),r.push(c);else if(c==":")t[a+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(c)){l(!0);let u=r.lastIndexOf("(");if(c==")"){let h=r[u-1];if(/[~@]$/.test(h)){let p=n.shift();r.length=u,Wn([...r,"#"],n);let{v:g}=n[0].pop();for(let f of p)f.v.splice(+(f.v[0]=="dark")-+(g[0]=="dark"),g.length);Wn([...r,Nl(h.length>1?h.slice(0,-1)+fr(JSON.stringify([h,p])):h+"("+ql(p)+")",B.a,p,/@$/.test(h))],n)}u=r.lastIndexOf("(",u-1)}r.length=u+1}else/[~@]/.test(c)&&t[a+1]=="("&&n.unshift([])}l(!0),Qs.set(t,e=n[0])}return e}function m(t,e,r){return[t,Jn(e,r)]}function Jn(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,n)=>({[t]:e?e(r,n):Kn(r,1)}):r=>t||{[r[1]]:Kn(r,2)}}function Kn(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function w(t,e,r,n){return[t,ri(e,r,n)]}function ri(t,e,r){let n=typeof e=="string"?(i,s)=>({[e]:r?r(i,s):i._}):e||(({1:i,_:s},o,a)=>({[i||a]:s}));return(i,s)=>{let o=lo(t||i[1]),a=s.theme(o,i.$$)??oe(i.$$,o,s);if(a!=null)return i._=Kn(i,0,a),n(i,s,o)}}function q(t,e={},r){return[t,Hl(e,r)]}function Hl(t={},e){return(r,n)=>{let{section:i=lo(r[0]).replace("-","")+"Color"}=t,[s,o]=zl(r.$$);if(!s)return;let a=n.theme(i,s)||oe(s,i,n);if(!a||typeof a=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:c=i.replace("Color","Opacity"),property:u=i,selector:h}=t,p=n.theme(c,o||"DEFAULT")||o&&oe(o,c,n),g=e||(({_:S})=>{let b=_t(u,S);return h?{[h]:b}:b});r._={value:Y(a,{opacityVariable:l||void 0,opacityValue:p||void 0}),color:S=>Y(a,S),opacityVariable:l||void 0,opacityValue:p||void 0};let f=g(r,n);if(!r.dark){let S=n.d(i,s,a);S&&S!==a&&(r._={value:Y(S,{opacityVariable:l||void 0,opacityValue:p||"1"}),color:b=>Y(S,b),opacityVariable:l||void 0,opacityValue:p||void 0},f={"&":f,[n.v("dark")]:g(r,n)})}return f}}function zl(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function _t(t,e){let r={};return typeof e=="string"?r[t]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(r[e.opacityVariable]=e.opacityValue||"1"),r[t]=e.value),r}function oe(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=Qe(ei(t.slice(1,-1),r.theme)),!e)return t;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(t)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(t))||/image/i.test(e)&&!(/^image:/.test(t)||/^[a-z-]+\(/.test(t))||/weight/i.test(e)&&!(/^(number|any):/.test(t)||/^\d+$/.test(t))||/position/i.test(e)&&/^(length|size):/.test(t)))return t.replace(/^[a-z-]+:/,"")}}function lo(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function Qe(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",n,i="")=>Qe(r)+n+Qe(i)):t.replace(/(^|[^\\])_+/g,(e,r)=>r+" ".repeat(e.length-r.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function Mt({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:A(e.variants),rules:A(e.rules),ignorelist:A(e.ignorelist),hash:void 0,stringify:(n,i)=>n+":"+i,finalize:[]};for(let n of A([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&A(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:i,darkMode:s=r.darkMode,darkColor:o=r.darkColor,theme:a,variants:l,rules:c,ignorelist:u,hash:h=r.hash,stringify:p=r.stringify,finalize:g}=typeof n=="function"?n(r):n;r={preflight:r.preflight!==!1&&i!==!1&&[...r.preflight,...A(i)],darkMode:s,darkColor:o,theme:{...r.theme,...a,extend:{...r.theme.extend,...a?.extend}},variants:[...r.variants,...A(l)],rules:[...r.rules,...A(c)],ignorelist:[...r.ignorelist,...A(u)],hash:h,stringify:p,finalize:[...r.finalize,...A(g)]}}return r}function eo(t,e,r,n,i,s){for(let o of e){let a=r.get(o);a||r.set(o,a=n(o));let l=a(t,i,s);if(l)return l}}function Wl(t){var e;return Yn(t[0],typeof(e=t[1])=="function"?e:()=>e)}function Gl(t){var e,r;return Array.isArray(t)?Yn(t[0],Jn(t[1],t[2])):Yn(t,Jn(e,r))}function Yn(t,e){return co(t,(r,n,i,s)=>{let o=n.exec(r);if(o)return o.$$=r.slice(o[0].length),o.dark=s,e(o,i)})}function co(t,e){let r=A(t).map(Zl);return(n,i,s)=>{for(let o of r){let a=e(n,o,i,s);if(a)return a}}}function Zl(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function uo(t,e){let r=Mt(t),n=(function({theme:l,darkMode:c,darkColor:u=yr,variants:h,rules:p,hash:g,stringify:f,ignorelist:S,finalize:b}){let E=new Map,y=new Map,x=new Map,$=new Map,L=co(S,(M,N)=>N.test(M));h.push(["dark",Array.isArray(c)||c=="class"?`${A(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let R=typeof g=="function"?M=>g(M,fr):g?fr:Js;R!==Js&&b.push(M=>({...M,n:M.n&&R(M.n),d:M.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(N,W)=>"--"+R(W).replace("#",""))}));let F={theme:(function({extend:M={},...N}){let W={},nn={get colors(){return Ce("colors")},theme:Ce,negative(){return{}},breakpoints(O){let V={};for(let Z in O)typeof O[Z]=="string"&&(V["screen-"+Z]=O[Z]);return V}};return Ce;function Ce(O,V,Z,pt){if(O){if({1:O,2:pt}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(O)||[,O],/[.[]/.test(O)){let ue=[];O.replace(/\[([^\]]+)\]|([^.[]+)/g,(Ee,mt,za=mt)=>ue.push(za)),O=ue.shift(),Z=V,V=ue.join("-")}let ne=W[O]||Object.assign(Object.assign(W[O]={},zt(N,O)),zt(M,O));if(V==null)return ne;V||(V="DEFAULT");let Se=ne[V]??V.split("-").reduce((ue,Ee)=>ue?.[Ee],ne)??Z;return pt?Y(Se,{opacityValue:ei(pt,Ce)}):Se}let ft={};for(let ne of[...Object.keys(N),...Object.keys(M)])ft[ne]=Ce(ne);return ft}function zt(O,V){let Z=O[V];return typeof Z=="function"&&(Z=Z(nn)),Z&&/color|fill|stroke/i.test(V)?(function pt(ft,ne=[]){let Se={};for(let ue in ft){let Ee=ft[ue],mt=[...ne,ue];Se[mt.join("-")]=Ee,ue=="DEFAULT"&&(mt=ne,Se[ne.join("-")]=Ee),typeof Ee=="object"&&Object.assign(Se,pt(Ee,mt))}return Se})(Z):Z}})(l),e:to,h:R,s(M,N){return f(M,N,F)},d(M,N,W){return u(M,N,F,W)},v(M){return E.has(M)||E.set(M,eo(M,h,y,Wl,F)||"&:"+M),E.get(M)},r(M,N){let W=JSON.stringify([M,N]);return x.has(W)||x.set(W,!L(M,F)&&eo(M,p,$,Gl,F,N)),x.get(W)},f(M){return b.reduce((N,W)=>W(N,F),M)}};return F})(r),i=new Map,s=[],o=new Set;e.resume(l=>i.set(l,l),(l,c)=>{e.insert(l,s.length,c),s.push(c),o.add(l)});function a(l){let c=n.f(l),u=Zn(c);if(u&&!o.has(u)){o.add(u);let h=io(s,l);e.insert(u,h,l),s.splice(h,0,l)}return c.n}return Object.defineProperties(function(c){if(!i.size)for(let h of A(r.preflight))typeof h=="function"&&(h=h(n)),h&&(typeof h=="string"?ti("",B.b,gr(h),n,B.b,[],!1,!0):oo(h,{},n,B.b)).forEach(a);c=""+c;let u=i.get(c);if(!u){let h=new Set;for(let p of mr(gr(c),n))h.add(p.c).add(a(p));u=[...h].filter(Boolean).join(" "),i.set(c,u).set(u,u)}return u},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:n.theme,config:r,snapshot(){let l=e.snapshot(),c=new Set(o),u=new Map(i),h=[...s];return()=>{l(),o=c,i=u,s=h}},clear(){e.clear(),o=new Set,i=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Jl(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function ho(t){let e=new MutationObserver(r);return{observe(i){e.observe(i,{attributeFilter:["class"],subtree:!0,childList:!0}),n(i),r([{target:i,type:""}])},disconnect(){e.disconnect()}};function r(i){for(let{type:s,target:o}of i)if(s[0]=="a")n(o);else for(let a of o.querySelectorAll("[class]"))n(a);e.takeRecords()}function n(i){let s,o=i.getAttribute?.("class");o&&Jl(o,s=t(o))&&i.setAttribute("class",s)}}function Kl(t){let e=document.querySelector(t||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function vr(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:Kl(t)).sheet;return{target:e,snapshot(){let r=Array.from(e.cssRules,n=>n.cssText);return()=>{this.clear(),r.forEach(this.insert)}},clear(){for(let r=e.cssRules.length;r--;)e.deleteRule(r)},destroy(){e.ownerNode?.remove()},insert(r,n){try{e.insertRule(r,n)}catch{e.insertRule(":root{}",n)}},resume:yr}}var Yl=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function po(t){return Yl.get(t)}function fo(t){var e=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(t);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function mo(t,e){var r=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(t);return r?r[1]?/^sti/i.test(e)?1:0:r[2]?/^pat/i.test(e)?1:0:r[3]?/^image-/i.test(e)?1:0:r[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var Xl=[["-webkit-",1],["-moz-",2],["-ms-",4]];function br(){return({stringify:t})=>({stringify(e,r,n){let i="",s=po(e);s&&(i+=t(s,r,n)+";");let o=fo(e),a=mo(e,r);for(let l of Xl)o&l[1]&&(i+=t(l[0]+e,r,n)+";"),a&l[1]&&(i+=t(e,l[0]+r,n)+";");return i+t(e,r,n)}})}function xr(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",ri("lineClamp",({_:t})=>go(t))],["line-clamp-(\\d+)",({1:t})=>go(t)]]}}function go(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var At={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...J(4,"rem",4,.5,.5),...J(12,"rem",4,5),14:"3.5rem",...J(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:_("blur"),backdropBrightness:_("brightness"),backdropContrast:_("contrast"),backdropGrayscale:_("grayscale"),backdropHueRotate:_("hueRotate"),backdropInvert:_("invert"),backdropOpacity:_("opacity"),backdropSaturate:_("saturate"),backdropSepia:_("sepia"),backgroundColor:_("colors"),backgroundImage:{none:"none"},backgroundOpacity:_("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...J(200,"",100,0,50),...J(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:_("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:_("spacing"),borderWidth:{DEFAULT:"1px",...X(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:_("colors"),caretColor:_("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...J(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:_("borderColor"),divideOpacity:_("borderOpacity"),divideWidth:_("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:t})=>({...t("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:t})=>({...t("spacing"),...It(2,6),...It(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:_("spacing"),gradientColorStops:_("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:t})=>({...t("spacing"),...It(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...It(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...J(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:t})=>({auto:"auto",...t("spacing")}),maxHeight:({theme:t})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...t("spacing")}),maxWidth:({theme:t,breakpoints:e})=>({...e(t("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...J(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:_("spacing"),placeholderColor:_("colors"),placeholderOpacity:_("opacity"),outlineColor:_("colors"),outlineOffset:X(8,"px"),outlineWidth:X(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:_("colors"),ringOffsetWidth:X(8,"px"),ringOpacity:({theme:t})=>({...t("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...X(8,"px")},rotate:{...X(2,"deg"),...X(12,"deg",3),...X(180,"deg",45)},saturate:J(200,"",100,0,50),scale:{...J(150,"",100,0,50),...J(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:_("spacing"),scrollPadding:_("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...X(2,"deg"),...X(12,"deg",3)},space:_("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:J(2),textColor:_("colors"),textDecorationColor:_("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...X(8,"px")},textUnderlineOffset:{auto:"auto",...X(8,"px")},textIndent:_("spacing"),textOpacity:_("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:_("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:t})=>({...t("spacing"),...It(2,4),full:"100%"}),width:({theme:t})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...t("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...J(50,"",1,0,10),auto:"auto"}};function It(t,e){let r={};do for(var n=1;n<t;n++)r[`${n}/${t}`]=Number((n/t*100).toFixed(6))+"%";while(++t<=e);return r}function X(t,e,r=0){let n={};for(;r<=t;r=2*r||1)n[r]=r+e;return n}function J(t,e="",r=1,n=0,i=1,s={}){for(;n<=t;n+=i)s[n]=n/r+e;return s}function _(t){return({theme:e})=>e(t)}var wo={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${At.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${At.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var Co=[m("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:oe(`[${e}]`,"",r)}}})),m("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),w("aspect-","aspectRatio"),m("container",(t,{theme:e})=>{let{screens:r=e("screens"),center:n,padding:i}=e("container"),s={width:"100%",marginRight:n&&"auto",marginLeft:n&&"auto",...o("xs")};for(let a in r){let l=r[a];typeof l=="string"&&(s[wr(l)]={"&":{maxWidth:l,...o(a)}})}return s;function o(a){let l=i&&(typeof i=="string"?i:i[a]||i.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),w("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),m("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),m("box-(border|content)","boxSizing",({1:t})=>t+"-box"),m("hidden",{display:"none"}),m("table-(auto|fixed)","tableLayout"),m(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",m("isolate","isolation"),m("object-(contain|cover|fill|none|scale-down)","objectFit"),w("object-","objectPosition"),m("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",kr),m("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),m("(static|fixed|absolute|relative|sticky)","position"),w("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),w("-?(top|bottom|left|right)(?:$|-)","inset"),m("(visible|collapse)","visibility"),m("invisible",{visibility:"hidden"}),w("-?z-","zIndex"),m("flex-((row|col)(-reverse)?)","flexDirection",yo),m("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),w("(flex-(?:grow|shrink))(?:$|-)"),w("(flex)-"),w("grow(?:$|-)","flexGrow"),w("shrink(?:$|-)","flexShrink"),w("basis-","flexBasis"),w("-?(order)-"),"-?(order)-(\\d+)",w("grid-cols-","gridTemplateColumns"),m("grid-cols-(\\d+)","gridTemplateColumns",ko),w("col-","gridColumn"),m("col-(span)-(\\d+)","gridColumn",xo),w("col-start-","gridColumnStart"),m("col-start-(auto|\\d+)","gridColumnStart"),w("col-end-","gridColumnEnd"),m("col-end-(auto|\\d+)","gridColumnEnd"),w("grid-rows-","gridTemplateRows"),m("grid-rows-(\\d+)","gridTemplateRows",ko),w("row-","gridRow"),m("row-(span)-(\\d+)","gridRow",xo),w("row-start-","gridRowStart"),m("row-start-(auto|\\d+)","gridRowStart"),w("row-end-","gridRowEnd"),m("row-end-(auto|\\d+)","gridRowEnd"),m("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>kr(yo(t))),m("grid-flow-(dense)","gridAutoFlow"),w("auto-cols-","gridAutoColumns"),w("auto-rows-","gridAutoRows"),w("gap-x(?:$|-)","gap","columnGap"),w("gap-y(?:$|-)","gap","rowGap"),w("gap(?:$|-)","gap"),"(justify-(?:items|self))-",m("justify-","justifyContent",vo),m("(content|items|self)-",t=>({["align-"+t[1]]:vo(t)})),m("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),w("p([xytrbl])?(?:$|-)","padding",et("padding")),w("-?m([xytrbl])?(?:$|-)","margin",et("margin")),w("-?space-(x|y)(?:$|-)","space",({1:t,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[t]]:`calc(${e} * calc(1 - var(--tw-space-${t}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[t]]:`calc(${e} * var(--tw-space-${t}-reverse))`}})),m("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),w("w-","width"),w("min-w-","minWidth"),w("max-w-","maxWidth"),w("h-","height"),w("min-h-","minHeight"),w("max-h-","maxHeight"),w("font-","fontWeight"),w("font-","fontFamily",({_:t})=>typeof(t=A(t))[1]=="string"?{fontFamily:re(t)}:{fontFamily:re(t[0]),...t[1]}),m("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),m("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),m("italic","fontStyle"),m("not-italic",{fontStyle:"normal"}),m("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:t,2:e="",3:r})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(r?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":t)]:t,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...ye({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),w("tracking-","letterSpacing"),w("leading-","lineHeight"),m("list-(inside|outside)","listStylePosition"),w("list-","listStyleType"),m("list-","listStyleType"),w("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),q("placeholder-",{property:"color",selector:"&::placeholder"}),m("text-(left|center|right|justify|start|end)","textAlign"),m("text-(ellipsis|clip)","textOverflow"),w("text-opacity-","textOpacity","--tw-text-opacity"),q("text-",{property:"color"}),w("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),w("indent-","textIndent"),m("(overline|underline|line-through)","textDecorationLine"),m("no-underline",{textDecorationLine:"none"}),w("underline-offset-","textUnderlineOffset"),q("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),w("decoration-","textDecorationThickness"),m("decoration-","textDecorationStyle"),m("(uppercase|lowercase|capitalize)","textTransform"),m("normal-case",{textTransform:"none"}),m("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),m("align-","verticalAlign"),m("whitespace-","whiteSpace"),m("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),m("break-words",{overflowWrap:"break-word"}),m("break-all",{wordBreak:"break-all"}),m("break-keep",{wordBreak:"keep-all"}),q("caret-",{opacityVariable:!1,opacitySection:"opacity"}),q("accent-",{opacityVariable:!1,opacitySection:"opacity"}),m("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${je(t," ")},var(--tw-gradient-stops))`),q("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-from":t.value,"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),q("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${t.value},var(--tw-gradient-to)`})),q("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),m("bg-(fixed|local|scroll)","backgroundAttachment"),m("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),m(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),m("bg-blend-","backgroundBlendMode"),m("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),w("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),q("bg-",{section:"backgroundColor"}),w("bg-","backgroundImage"),w("bg-","backgroundPosition"),m("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",kr),w("bg-","backgroundSize"),w("rounded(?:$|-)","borderRadius"),w("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:t,_:e})=>{let r={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[t]||[t,t];return{[`border-${je(r[0])}-radius`]:e,[`border-${je(r[1])}-radius`]:e}}),m("border-(collapse|separate)","borderCollapse"),w("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),m("border-(solid|dashed|dotted|double|none)","borderStyle"),w("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...ye({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(t||"-x")]:e,["--tw-border-spacing"+(t||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),q("border-([xytrbl])-",{section:"borderColor"},et("border","Color")),q("border-"),w("border-([xytrbl])(?:$|-)","borderWidth",et("border","Width")),w("border(?:$|-)","borderWidth"),w("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),m("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),m("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),w("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${je(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${je(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),q("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),w("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),q("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),w("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),m("ring-inset",{"--tw-ring-inset":"inset"}),q("ring-",{property:"--tw-ring-color"}),w("ring(?:$|-)","ringWidth",({_:t},{theme:e})=>({...ye({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":Y(e("ringOffsetColor","","#fff")),"--tw-ring-color":Y(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${t} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),q("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),w("shadow(?:$|-)","boxShadow",({_:t})=>({...ye({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":re(t),"--tw-shadow-colored":re(t).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),w("(opacity)-"),m("mix-blend-","mixBlendMode"),...bo(),...bo("backdrop-"),w("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:re(t),transitionTimingFunction:t._=="none"?void 0:re(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:re(e("transitionDuration",""))})),w("duration(?:$|-)","transitionDuration","transitionDuration",re),w("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",re),w("delay(?:$|-)","transitionDelay","transitionDelay",re),w("animate(?:$|-)","animation",(t,{theme:e,h:r,e:n})=>{let i=re(t),s=i.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=n(r(s[0])))]:o,animation:s.join(" ")}:{animation:i}}),"(transform)-(none)",m("transform",ii),m("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":So(t=="gpu")})),w("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...ii()})),w("-?(rotate)-","rotate",ni),w("-?(translate-[xy])-","translate",ni),w("-?(skew-[xy])-","skew",ni),m("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",kr),"(appearance)-",w("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",w("(cursor)-"),"(cursor)-",m("snap-(none)","scroll-snap-type"),m("snap-(x|y|both)",({1:t})=>({...ye({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),m("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),m("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),m("snap-(normal|always)","scroll-snap-stop"),m("scroll-(auto|smooth)","scroll-behavior"),w("scroll-p([xytrbl])?(?:$|-)","padding",et("scroll-padding")),w("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",et("scroll-margin")),m("touch-(auto|none|manipulation)","touch-action"),m("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...ye({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":r?"pan-y":t}`]:t,"touch-action":"var(--tw-touch-action)"})),m("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),m("outline",{outlineStyle:"solid"}),m("outline-(dashed|dotted|double)","outlineStyle"),w("-?(outline-offset)-"),q("outline-",{opacityVariable:!1,opacitySection:"opacity"}),w("outline-","outlineWidth"),"(pointer-events)-",w("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],m("select-(none|text|all|auto)","userSelect"),q("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),q("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),w("stroke-","strokeWidth"),m("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),m("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function kr(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function yo(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function je(t,e="-"){let r=[];for(let n of t)r.push({t:"top",r:"right",b:"bottom",l:"left"}[n]);return r.join(e)}function re(t){return t&&""+(t._||t)}function vo({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function et(t,e=""){return({1:r,_:n})=>{let i={x:"lr",y:"tb"}[r]||r+r;return i?{..._t(t+"-"+je(i[0])+e,n),..._t(t+"-"+je(i[1])+e,n)}:_t(t+e,n)}}function bo(t=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",t&&"opacity","saturate","sepia",!t&&"drop-shadow"].filter(Boolean),r={};for(let n of e)r[`--tw-${t}${n}`]="var(--tw-empty,/*!*/ /*!*/)";return r={...ye(r),[`${t}filter`]:e.map(n=>`var(--tw-${t}${n})`).join(" ")},[`(${t}filter)-(none)`,m(`${t}filter`,r),...e.map(n=>w(`${n[0]=="h"?"-?":""}(${t}${n})(?:$|-)`,n,({1:i,_:s})=>({[`--tw-${i}`]:A(s).map(o=>`${n}(${o})`).join(" "),...r})))]}function ni({1:t,_:e}){return{["--tw-"+t]:e,...ii()}}function ii(){return{...ye({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":So()}),transform:"var(--tw-transform)"}}function So(t){return[t?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function xo({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function ko({1:t}){return`repeat(${t},minmax(0,1fr))`}function ye(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var Eo=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:t})=>`@media (orientation:${t})`],["contrast-(more|less)",({1:t})=>`@media (prefers-contrast:${t})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:t})=>`&::${t}`],["(marker|selection)",({1:t})=>`& *::${t},&::${t}`],["file","&::file-selector-button"],["(first|last|only)",({1:t})=>`&:${t}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:t,$$:e},r)=>e&&`&[${t}-${r.theme(t,e)||oe(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:n="",6:i=e},{e:s,h:o,v:a})=>{let l=Qe(n)||(r[0]=="["?r:a(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(t+i))})`)}${t[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:t})=>`[dir="${t}"] &`],["supports-",({$$:t},e)=>{if(t&&(t=e.theme("supports",t)||oe(t,"",e)),t)return t.includes(":")||(t+=":var(--tw)"),/^\w*\s*\(/.test(t)||(t=`(${t})`),`@supports ${t.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:t},e)=>{if(t&&(t=e.theme("screens",t)||oe(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=oe(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&Qe(t).replace(/[}]+$/,"").split("{")]];function $o({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:wo,theme:{...At,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:Eo,rules:Co,finalize(r){return r.n&&r.d&&r.r.some(n=>/^&::(before|after)$/.test(n))&&!/(^|;)content:/.test(r.d)?{...r,d:"content:var(--tw-content);"+r.d}:r}}}var Ql={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},ec={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},tc={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},rc={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},nc={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},ic={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},sc={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},oc={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},ac={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},lc={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},cc={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},uc={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},dc={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},hc={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},pc={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},fc={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},mc={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},gc={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},wc={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},yc={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},vc={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},bc={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},_o={__proto__:null,slate:Ql,gray:ec,zinc:tc,neutral:rc,stone:nc,red:ic,orange:sc,amber:oc,yellow:ac,lime:lc,green:cc,emerald:uc,teal:dc,cyan:hc,sky:pc,blue:fc,indigo:mc,violet:gc,purple:wc,fuchsia:yc,pink:vc,rose:bc};function Cr({disablePreflight:t}={}){return $o({colors:_o,disablePreflight:t})}function Sr({className:t="prose",defaultColor:e="gray",extend:r={},colors:n={}}={}){return n={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...n,dark:n.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...n.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${t}-${s}`,(a,l)=>Ao(t,o[0]=="."?"."+l.e(l.h(o.slice(1))):o,l,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${t})`,({1:s},{h:o})=>[{c:o(s)}]],[`${t}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[t+"-",({$$:s},o)=>{let a=Io(o.theme("fontSize",s));return a&&{"@layer components":a}}],[t+"-",({$$:s},o)=>i(s,o)],[t,(s,o)=>({...i(e,o),"@layer base":[Mo(t,o,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:k(20,16),marginBottom:k(20,16),paddingLeft:k(26,16)},li:{marginTop:k(8,16),marginBottom:k(8,16)},"ol>li,ul>li":{paddingLeft:k(6,16)},">ul>li p":{marginTop:k(12,16),marginBottom:k(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:k(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:k(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:k(12,16),marginBottom:k(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:k(48,16),marginBottom:k(48,16)},blockquote:{marginTop:k(32,20),marginBottom:k(32,20),paddingLeft:k(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:k(20,16),marginBottom:k(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:k(36,16),marginTop:"0",marginBottom:k(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:k(24,16),marginTop:k(48,24),marginBottom:k(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:k(20,16),marginTop:k(32,20),marginBottom:k(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:k(24,16),marginBottom:k(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:k(32,16),marginBottom:k(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:k(14,16),lineHeight:"1.4",marginTop:k(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:k(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:k(21,24)},"h3 code":{fontSize:k(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:k(14,16),lineHeight:"1.7",marginTop:k(24,14),marginBottom:k(24,14),borderRadius:"0.375rem",paddingTop:k(12,14),paddingRight:k(16,14),paddingBottom:k(12,14),paddingLeft:k(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:k(32,16),marginBottom:k(32,16),fontSize:k(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:k(8,14),paddingBottom:k(8,14),paddingLeft:k(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:k(8,14),paddingRight:k(8,14),paddingBottom:k(8,14),paddingLeft:k(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${o.e(o.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:k(20,16),lineHeight:"1.6",marginTop:k(24,20),marginBottom:k(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Mo(t,o,r)],"@layer components":{...Io(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function i(s,o){let a={},l={},c=(u,h,p)=>{let g=o.theme(`colors.${s}.${h}`,h);p["--tw-prose-"+u]=Y(g);let f=p!=l&&o.d("colors",`${s}-${h}`,g);f&&(l["--tw-prose-"+u]=Y(f))};for(let u in n){let h=n[u];u!="dark"&&h&&c(u,h,a)}for(let u in n.dark||{}){let h=n.dark[u];h&&(n.dark?c("invert-"+u,h,a):c(u,h,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function Mo(t,e,r){let n={};for(let i in r)n[Ao(t,i,e,s=>`.${e.e(e.h(t))}${s}`)]=r[i];return n}function Ao(t,e,{e:r,h:n},i){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",a=s,l="")=>i(`${o}:where(${a}):not(:where(.${r(n("not-"+t))} *))${l}`))}function Io(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function k(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var si=Mt({hash:!1,darkMode:"class",theme:{extend:{colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}},spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]}}},presets:[Cr(),br(),xr(),Sr()]});function Er(t,e=!0){let r=(function(){if(xc)try{let l=vr(new CSSStyleSheet);return l.connect=c=>{let u=oi(c);u.adoptedStyleSheets=[...u.adoptedStyleSheets,l.target]},l.disconnect=yr,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[vr(s)],a=new WeakMap;return{get target(){return o[0].target},snapshot(){let l=o.map(c=>c.snapshot());return()=>l.forEach(c=>c())},clear(){o.forEach(l=>l.clear())},destroy(){o.forEach(l=>l.destroy())},insert(l,c,u){o[0].insert(l,c,u);let h=this.target.cssRules[c];o.forEach((p,g)=>g&&p.target.insertRule(h.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");oi(l).appendChild(c);let u=vr(c),{cssRules:h}=this.target;for(let p=0;p<h.length;p++)u.target.insertRule(h[p].cssText,p);o.push(u),a.set(l,u)},disconnect(l){let c=o.indexOf(a.get(l));c>=0&&o.splice(c,1)}}})(),n=uo({...t,hash:t.hash??e},r),i=ho(n);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),i.observe(oi(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=n}}}}var xc=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function oi(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var C=t=>Er(si)(t);var ai=class extends C(v){static properties={color:{type:String},radius:{type:String},size:{type:String},border:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=j`
130
+ </svg>`};var hl=vs,yi=class extends nr{resolveIcon(e){let r=hl[e];if(!r)throw console.warn("hi-outline: icon not found",e),new Error(`Icon ${e} not found`);return r}render(){super.render();let e=this.shadowRoot?.querySelector("svg");if(!e)throw new Error("svgEl not found "+this.name);e.setAttribute("fill","none"),e.querySelectorAll("[stroke]").forEach(r=>{r.setAttribute("stroke","currentColor")})}};customElements.get("hi-outline")||customElements.define("hi-outline",yi);var sr=class{#e;#t;#r;constructor(e,r){if(!e)throw new Error("host is required");if(!r)throw new Error("config is required");this.#e=e,this.#e.addController(this),this.#t=r}connect(e){this.#t=e,this.#r=this.#i()}hostConnected(){this.#r||setTimeout(()=>{this.#r||(this.#r=this.#i())},0)}hostDisconnected(){this.#r?.close(1e3,"lit_host_disconnected"),this.#r=void 0}send(e){this.#r?.send(e)}close(e,r){this.#r?.close(e,r)}get isConnected(){return this.#r?.readyState===WebSocket.OPEN}get isConnecting(){return this.#r?.readyState===WebSocket.CONNECTING}#i(){let e=new WebSocket(this.#t.url());return this.#t.onClose&&(e.onclose=this.#t.onClose),this.#t.onOpen&&(e.onopen=this.#t.onOpen),this.#t.onError&&(e.onerror=this.#t.onError),this.#t.onMessage&&(e.onmessage=this.#t.onMessage),e}};var vi=t=>!!(t&&t.constructor&&t.call&&t.apply);var bs=t=>!(!t||!t.then||!vi(t.then));var xs=(t,e,r=!1)=>{if(!t)return[];let i=(s,o)=>e(s)-e(o),n=(s,o)=>e(o)-e(s);return t.slice().sort(r===!0?n:i)};function*bi(t,e,r=n=>n,i=1){let n=vi(r)?r:()=>r,s=e?t:0,o=e??t;for(let a=s;a<=o&&(yield n(a),!(a+i>o));a+=i);}var ks=(t,e,r,i)=>Array.from(bi(t,e,r,i));var Cs=(t,e)=>t?t.reduce((r,i)=>{let[n,s]=r;return e(i)?[[...n,i],s]:[n,[...s,i]]},[[],[]]):[[],[]];var xi=class extends Error{constructor(e=[]){super();let r=e.find(i=>i.name)?.name??"";this.name=`AggregateError(${r}...)`,this.message=`AggregateError with ${e.length} errors`,this.stack=e.find(i=>i.stack)?.stack??this.stack,this.errors=e}},ki=async(t,e,r)=>{let i=e.map((c,d)=>({index:d,item:c})),n=async c=>{let d=[];for(;;){let h=i.pop();if(!h)return c(d);let[p,g]=await or(r)(h.item);d.push({error:p,result:g,index:h.index})}},s=ks(1,t).map(()=>new Promise(n)),o=await Promise.all(s),[a,l]=Cs(xs(o.flat(),c=>c.index),c=>!!c.error);if(a.length>0)throw new xi(a.map(c=>c.error));return l.map(c=>c.result)};var Ci=async(t,e)=>{let r=t?.times??3,i=t?.delay,n=t?.backoff??null;for(let s of bi(1,r)){let[o,a]=await or(e)(l=>{throw{_exited:l}});if(!o)return a;if(o._exited)throw o._exited;if(s===r)throw o;i&&await Ge(i),n&&await Ge(n(s))}},Ge=t=>new Promise(e=>setTimeout(e,t)),or=t=>(...e)=>{try{let r=t(...e);return bs(r)?r.then(i=>[void 0,i]).catch(i=>[i,void 0]):[void 0,r]}catch(r){return[r,void 0]}};var Ze=({interval:t},e)=>{let r=!0,i,n=(...s)=>{r&&(e(...s),r=!1,i=setTimeout(()=>{r=!0,i=void 0},t))};return n.isThrottled=()=>i!==void 0,n};async function _s(t,e){let r=t?.times??3,i=t?.delay,n=t?.backoff??null,s=o=>{throw{_bailed:o}};for(let o=0;o<r;o++)try{return await e(s,o)}catch(a){if(a&&typeof a=="object"&&"_bailed"in a)throw a._bailed;if(o===r-1)throw a;i&&await Ge(i),n&&await Ge(n(o+1))}throw new Error("unreachable")}var fl=!0,_i="Invariant failed";function D(t,e){if(!t){if(fl)throw new Error(_i);var r=typeof e=="function"?e():e,i=r?"".concat(_i,": ").concat(r):_i;throw new Error(i)}}var ar=class{#e;#t;#r=null;isStreaming=!1;typingIndicator;ranOutOfCredits=!1;messages=[];conversationId="";#i=0;#n;isLiveMode=!1;get hasQueuedMessages(){return this.#s.length>0}constructor(e,r){this.#e=e,this.#t=r,this.#t.autoConnect!==!1&&(this.#r=this.initWS()),e.addController(this)}#s=[];#o(e,{expectStreaming:r=!1}={}){return this.ranOutOfCredits?!1:this.#r?this.#r.isConnecting?(console.warn("WebSocket is connecting, message not sent",e),!1):this.#r.isConnected?(r&&!this.isLiveMode&&(this.isStreaming=!0,this.#e.requestUpdate()),this.#r.send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent",e),this.retry(),!1):(console.warn("WebSocket not initialized, message not sent",e),this.connect(),!1)}async enqueueMessage(e,{expectStreaming:r=!1}={}){if(this.#s.length>0){let i=this.#s[this.#s.length-1];if(e.type==="USER_INPUT"&&i.message.type==="USER_INPUT"&&e.value===i.message.value)return!0}return this.#r||this.connect(),this.#r?.isConnected?this.#o(e,{expectStreaming:r}):(this.#s.push({message:e,options:{expectStreaming:r}}),this.#e.requestUpdate(),this.#r&&!this.#r.isConnecting&&!this.#r.isConnected&&this.retry(),await _s({times:5,delay:2e3},async()=>{if(this.#r?.isConnected){let i=[...this.#s];this.#s=[],this.#e.requestUpdate();let n=!1;for(let{message:s,options:o}of i){let a=this.#o(s,o);s===e&&(n=a)}return n}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),this.#s=[],this.#e.requestUpdate(),!1)))}async sendUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1,requestInputResponse:o}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i,requestInputResponse:o},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1,requestInputResponse:o}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i,requestInputResponse:o},{expectStreaming:s})}sendImageDelete(e){D(e,"imageId is required"),this.enqueueMessage({type:"USER_FILE_DELETE",imageId:e}).catch(console.warn)}sendUserCancel(){this.enqueueMessage({type:"USER_CANCEL"}).catch(console.warn)}sendUserTypingStart(){this.#o({type:"USER_TYPING_START"})}sendUserTypingStop(){this.enqueueMessage({type:"USER_TYPING_STOP"}).catch(console.warn)}sendNewChat(){this.enqueueMessage({type:"NEW_CHAT"})}sendUserMeta(e){this.enqueueMessage({type:"USER_META",metadata:e}).catch(console.warn)}reloadConfig(){this.enqueueMessage({type:"RELOAD_CONFIG"}).catch(console.warn)}close(){this.#r?.close(1e3,"closed by user")}retry(){clearTimeout(this.#n),this.#n=setTimeout(()=>{this.#t.onReconnect?.(),this.#r=this.initWS()},1e3*this.#i),this.#i++}initWS(){return new sr(this.#e,{url:()=>this.#t.url(this.conversationId,{}),onOpen:e=>this.#a(e),onMessage:e=>this.#d(JSON.parse(e.data)),onError:e=>this.#c(e),onClose:e=>this.#l(e)})}#a(e){this.#i=0}#d(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,{...e.message,streaming:!0}].filter((r,i,n)=>i===n.findIndex(s=>s.id===r.id)),this.typingIndicator=void 0,this.#e.requestUpdate(),this.#t.onNewMessage?.(e.message),this.#t.persistConversationState?.(this.conversationId,this.messages);break}case"APPEND_MESSAGE":{let r=this.messages.find(i=>i.id===e.message.id);if(r){switch(e.message.content_type){case"text":{let{part:i,delta:n,position:s}=e.message;r.content=r.content.slice(0,s)+n,r.parts||=[],r.parts[i]={text:r.parts[i]&&"text"in r.parts[i]?(r.parts[i].text||"").slice(0,s)+n:n};break}case"html":{let{part:i,delta:n,position:s}=e.message;r.parts||=[],r.parts[i]={html:r.parts[i]&&"html"in r.parts[i]?(r.parts[i].html||"").slice(0,s)+n:n};break}case"data":{let{part:i}=e.message;r.parts||=[],r.parts[i]={tag:e.message.tag,data:r.parts[i]&&"data"in r.parts[i]?Object.assign(r.parts[i].data||{},e.message.data):e.message.data};break}}e.metadata&&(r.metadata=e.metadata),this.#t.onMessageAppend?.(e),this.#e.requestUpdate()}else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let r=this.messages.find(i=>i.id===e.message.id);if(r)Object.assign(r,e.message),r.streaming=!1;else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,this.#e.requestUpdate(),this.#t.onMessageDone?.(e,r),this.#t.persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate();break}case"ERROR":{this.#t.onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,this.#t.onConnect?.(e.conversationId,e.metadata),this.#t.persistConversationState?.(e.conversationId,e.messages),this.isLiveMode=e.metadata.isLiveMode,this.#e.requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},this.#e.requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,this.#e.requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.ranOutOfCredits=!0,this.#e.requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),this.#e.requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}}#c(e){console.error("onError",e),this.#t.onError?.(e)}#l(e){this.#e.isConnected&&this.#r&&!this.#r.isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate(),this.#t.onClose?.()}hostConnected(){this.conversationId=this.#t.restoreConversationState?.()?.conversationId||"",this.messages=this.#t.restoreConversationState?.()?.messages||[]}reset(){this.#t.onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,this.#s=[],this.#e.requestUpdate()}hostDisconnected(){clearTimeout(this.#n)}connect(){this.#r||(this.#r=this.initWS())}reconnectSocket(){this.#r?.close(1e3,"destroy"),this.#r=this.initWS()}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}get isConnected(){return this.#r?.isConnected??!1}};var ml=Symbol();var Ss=Object.getPrototypeOf,Si=new WeakMap,gl=t=>t&&(Si.has(t)?Si.get(t):Ss(t)===Object.prototype||Ss(t)===Array.prototype);var $s=t=>gl(t)&&t[ml]||null,$i=(t,e=!0)=>{Si.set(t,e)};var Mi=t=>typeof t=="object"&&t!==null,wl=t=>Mi(t)&&!Ii.has(t)&&(Array.isArray(t)||!(Symbol.iterator in t))&&!(t instanceof WeakMap)&&!(t instanceof WeakSet)&&!(t instanceof Error)&&!(t instanceof Number)&&!(t instanceof Date)&&!(t instanceof String)&&!(t instanceof RegExp)&&!(t instanceof ArrayBuffer)&&!(t instanceof Promise),Is=(t,e)=>{let r=Es.get(t);if(r?.[0]===e)return r[1];let i=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return $i(i,!0),Es.set(t,[e,i]),Reflect.ownKeys(t).forEach(n=>{if(Object.getOwnPropertyDescriptor(i,n))return;let s=Reflect.get(t,n),{enumerable:o}=Reflect.getOwnPropertyDescriptor(t,n),a={value:s,enumerable:o,configurable:!0};if(Ii.has(s))$i(s,!1);else if(Te.has(s)){let[l,c]=Te.get(s);a.value=Is(l,c())}Object.defineProperty(i,n,a)}),Object.preventExtensions(i)},yl=(t,e,r,i)=>({deleteProperty(n,s){let o=Reflect.get(n,s);r(s);let a=Reflect.deleteProperty(n,s);return a&&i(["delete",[s],o]),a},set(n,s,o,a){let l=!t()&&Reflect.has(n,s),c=Reflect.get(n,s,a);if(l&&(Ms(c,o)||lr.has(o)&&Ms(c,lr.get(o))))return!0;r(s),Mi(o)&&(o=$s(o)||o);let d=!Te.has(o)&&bl(o)?Ai(o):o;return e(s,d),Reflect.set(n,s,d,a),i(["set",[s],o,c]),!0}}),Te=new WeakMap,Ii=new WeakSet,Es=new WeakMap,Ei=[1],lr=new WeakMap,Ms=Object.is,vl=(t,e)=>new Proxy(t,e),bl=wl,xl=Is,kl=yl;function Ai(t={}){if(!Mi(t))throw new Error("object required");let e=lr.get(t);if(e)return e;let r=Ei[0],i=new Set,n=(b,S=++Ei[0])=>{r!==S&&(s=r=S,i.forEach(y=>y(b,S)))},s=r,o=(b=Ei[0])=>(s!==b&&(s=b,l.forEach(([S])=>{let y=S[1](b);y>r&&(r=y)})),r),a=b=>(S,y)=>{let x=[...S];x[1]=[b,...x[1]],n(x,y)},l=new Map,c=(b,S)=>{let y=!Ii.has(S)&&Te.get(S);if(y){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(b))throw new Error("prop listener already exists");if(i.size){let x=y[2](a(b));l.set(b,[y,x])}else l.set(b,[y])}},d=b=>{var S;let y=l.get(b);y&&(l.delete(b),(S=y[1])==null||S.call(y))},h=b=>(i.add(b),i.size===1&&l.forEach(([y,x],E)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&x)throw new Error("remove already exists");let T=y[2](a(E));l.set(E,[y,T])}),()=>{i.delete(b),i.size===0&&l.forEach(([y,x],E)=>{x&&(x(),l.set(E,[y]))})}),p=!0,g=kl(()=>p,c,d,n),f=vl(t,g);lr.set(t,f);let $=[t,o,h];return Te.set(f,$),Reflect.ownKeys(t).forEach(b=>{let S=Object.getOwnPropertyDescriptor(t,b);"value"in S&&S.writable&&(f[b]=t[b])}),p=!1,f}function cr(t,e,r){let i=Te.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!i&&console.warn("Please use proxy object");let n,s=[],o=i[2],a=!1,c=o(d=>{if(s.push(d),r){e(s.splice(0));return}n||(n=Promise.resolve().then(()=>{n=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,c()}}function Je(t){let e=Te.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[r,i]=e;return xl(r,i())}var Ke=class{#e;#t;#r;#i=()=>{};constructor(e,r){this.#e=e,this.#t=r,this.#r=Je(r),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#i(),this.#i=cr(this.#t,()=>{this.#r=Je(this.#t),this.#e.requestUpdate()})}hostDisconnected(){this.#i()}};var ve=class{#e;#t;proxyObject;#r;#i=()=>{};constructor(e,r,i){this.#e=e,this.#t=i,this.proxyObject=Ai(r),this.#r=Je(this.proxyObject),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#i(),this.#t?.subscribe&&(this.#i=cr(this.proxyObject,()=>{this.#r=Je(this.proxyObject),this.#e.requestUpdate()}))}hostDisconnected(){this.#i()}};var ur=class{#e;#t;#r;#i=null;#n=null;constructor(e,{provider:r,tag:i,key:n}){this.#e=e,this.#t=i,this.#r=n,e.addController(this)}get value(){return this.#n?this.#n.value:null}hostConnected(){if(this.#n||(this.#i=Cl(this.#e,this.#t),!this.#i))return;let e=this.#i[this.#r]instanceof ve?this.#i[this.#r]:null;e&&(this.#n=new Ke(this.#e,e.proxyObject))}hostDisconnected(){}};function Cl(t,e){let r=t;for(;r;){let i=r.closest(e);if(i)return i;let n=r.getRootNode();if(n instanceof ShadowRoot)r=n.host;else break}return null}function Di(t,e){if(e<=0)return"";if(t=t??"",t.length>e){let r=e-1;return r>0&&t.charCodeAt(r-1)>=55296&&t.charCodeAt(r-1)<=56319&&r--,t.slice(0,r)+"\u2026"}return t}var St=ai(Ti(),1);var hr=class{#e;constructor({document:e}){this.#e=e}getCookies(){return(0,St.parseCookie)(this.#e.cookie)||{}}getCookie(e){return this.getCookies()[e]||null}setCookie(e,r,i){if(D(typeof e=="string",`cookie name must be a string, got: ${typeof e}`),D(e,"cookie name must not be empty"),r==null){this.#e.cookie=(0,St.stringifySetCookie)(e,"",{expires:new Date(0)});return}D(typeof r=="string",`value of cookie \`${e}\` must be a string, got: ${typeof r}`),this.#e.cookie=(0,St.stringifySetCookie)(e,r,i)}deleteCookie(e){this.setCookie(e,null)}deleteCookies(e){let r=this.getCookies();for(let i in r)e(i)&&this.deleteCookie(i)}};var pr=class{#e;constructor({localStorage:e}){this.#e=e}getItem(e){try{let r=this.#e.getItem(e);return r?JSON.parse(r):null}catch{return null}}setItem(e,r){if(r==null){this.#e.removeItem(e);return}try{let i=JSON.stringify(r);this.#e.setItem(e,i)}catch(i){console.error(`Failed to store ${e} in localStorage:`,i)}}removeItem(e){this.#e.removeItem(e)}removeItems(e){let r=[];for(let i=0;i<this.#e.length;i++){let n=this.#e.key(i);n&&e(n)&&r.push(n)}for(let i of r)this.#e.removeItem(i)}};var $t=ai(Ti(),1);function Oi({window:t}){let e=t.location.hostname,r=t.document;if(e==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(e)||/^\[.*\]$/.test(e))return;let i=e.split(".");if(i.length<2)return;let n="__molin_domain_test__";for(let s=2;s<=i.length;s++){let o=`.${i.slice(-s).join(".")}`;try{if(r.cookie=(0,$t.stringifySetCookie)(n,"1",{domain:o,path:"/"}),(0,$t.parseCookie)(r.cookie)[n]==="1")return r.cookie=(0,$t.stringifySetCookie)(n,"",{domain:o,path:"/",expires:new Date(0)}),o}catch{continue}}return`.${i.slice(-2).join(".")}`}var Ui=class{#e;#t;#r;#i;constructor({window:e}){this.#e=e,this.#t=new hr({document:e.document}),this.#r=new pr({localStorage:e.localStorage}),this.#i=e.localStorage}get distinctID(){return this.#t.getCookie("molin_distinct_id")||this.#i.getItem("molin_distinct_id")||this.#r.getItem("molin_shop_assistant_distinct_id")}set distinctID(e){if(this.#r.removeItem("molin_shop_assistant_distinct_id"),this.#t.deleteCookie("molin_shop_assistant_distinct_id"),!e){this.#t.deleteCookie("molin_distinct_id"),this.#i.removeItem("molin_distinct_id");return}D(typeof e=="string","distinct_id must be a string");try{this.#t.setCookie("molin_distinct_id",e,{path:"/",sameSite:"lax",expires:new Date(Date.now()+1e3*60*60*24*365),domain:Oi({window:this.#e})})}catch(r){console.warn("Could not write distinct_id to cookie:",r)}try{this.#i.setItem("molin_distinct_id",e)}catch(r){console.warn("Could not write distinct_id to localStorage:",r)}}get widgetState(){return this.#r.getItem("molin_widget")||this.#r.getItem("_molin_widget_open_state")}set widgetState(e){this.#r.setItem("molin_widget",e),this.#r.removeItem("_molin_widget_open_state")}get popupState(){return this.#r.getItem("molin_popup")||this.#r.getItem("_molin_popup")}set popupState(e){this.#r.setItem("molin_popup",e),this.#r.removeItem("_molin_popup")}get disclaimerDismissed(){return this.#r.getItem("molin_disclaimer_dismissed")??!1}set disclaimerDismissed(e){this.#r.setItem("molin_disclaimer_dismissed",e)}getConversationId(e){D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let r=`molin_${e}_conversation_id`;return this.#t.getCookie(r)||this.#i.getItem(r)||this.#r.getItem(`_molin_${e}`)?.conversationId}setConversationId(e,r){D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let i=`molin_${e}_conversation_id`;if(!r){this.#t.deleteCookie(i),this.#i.removeItem(i);return}D(typeof r=="string",`conversation ID for widget ${e} must be a string`);try{this.#t.setCookie(i,r,{path:"/",sameSite:"lax",expires:new Date(Date.now()+1e3*60*60*24*365),domain:Oi({window:this.#e})})}catch(n){console.warn(`Could not write ${i} to cookie:`,n)}try{this.#i.setItem(i,r)}catch(n){console.warn(`Could not write ${i} to localStorage:`,n)}}getConversationState(e){D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let r=`molin_${e}_conversation`;return this.#r.getItem(r)||this.#r.getItem(`_molin_${e}`)}setConversationState(e,r){this.#r.removeItem(`_molin_${e}`),D(typeof e=="string","widgetId must be a string"),D(e,"widgetId must not be empty");let i=`molin_${e}_conversation`;this.#r.setItem(i,r)}resetAll(){this.distinctID=null,this.widgetState=null,this.popupState=null,this.disclaimerDismissed=!1,this.#r.removeItems(e=>e.startsWith("_molin_")),this.#t.deleteCookies(e=>e.startsWith("_molin_"))}},R=new Ui({window});var Ts=()=>{if(window.Shopify)try{return{customerId:jl()}}catch{return null}return null},jl=()=>{try{let t=[()=>window.ShopifyAnalytics?.meta?.page?.customerId,()=>window.meta?.page?.customerId,()=>window._st?.cid,()=>window.ShopifyAnalytics?.lib?.user()?.traits()?.uniqToken];for(let e of t)try{let r=e();if(/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i.test(r))continue;if(r)return r}catch{}}catch{return null}return null},Os=async()=>{try{return(await(await fetch(window.Shopify.routes.root+"cart.js")).json()).items.map(i=>({id:i.id,name:i.title,quantity:i.quantity,price:i.price,variantId:i.variant_id,sku:i.sku,url:i.url,description:i.product_description,image:i.featured_image?.url}))}catch{return[]}};function Us(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function Xe(t){return new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+!*'();@&=,$]*)*(\\?[-a-z\\d%_.~+!*'();@&=,$]*)?(\\#[-a-z\\d%_.~+!*'();@&=,$]*)?$","i").test(t)}function Ps(t,e){let r=t instanceof URL?t:new URL(t);if(e)for(let[i,n]of e)r.searchParams.set(i,n);return r}var Rs=()=>{if(window.ShopRenter)try{let t=Tl();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},Tl=()=>{try{if(window.ShopRenter){let t=window.ShopRenter.customer;return{customerEmail:t?.email,customerId:t?.userId,customerName:[t?.name?.firstName,t?.name?.lastName].filter(Boolean).join(" ")}}return{customerEmail:null,customerId:null,customerName:null}}catch{return{customerEmail:null,customerId:null,customerName:null}}},Bs=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=Us(t,"https")+"/cart.json";return(await(await fetch(e)).json()).items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku,image:s.image,url:s.href}))}catch{return[]}};var Fs=()=>{if(window.UNAS)try{let t=window.UNAS.customer;return{customerEmail:t?.email,customerId:t?.id}}catch(t){return console.error("Error fetching customer information:",t),null}return null},qs=async()=>new Promise((t,e)=>{try{window.UNAS.getCart(r=>{let n=r.items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku}));t(n)})}catch(r){console.error("Error fetching cart information:",r),e(r)}});var Pi;function Ns(t){return{lang:t?.lang??Pi?.lang,message:t?.message,abortEarly:t?.abortEarly??Pi?.abortEarly,abortPipeEarly:t?.abortPipeEarly??Pi?.abortPipeEarly}}var Pl;function Rl(t){return Pl?.get(t)}var Bl;function Fl(t){return Bl?.get(t)}var ql;function Vl(t,e){return ql?.get(t)?.get(e)}function Hs(t){let e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function G(t,e,r,i,n){let s=n&&"input"in n?n.input:r.value,o=n?.expected??t.expects??null,a=n?.received??Hs(s),l={kind:t.kind,type:t.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:n?.path,issues:n?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},c=t.kind==="schema",d=n?.message??t.message??Vl(t.reference,l.lang)??(c?Fl(l.lang):null)??i.message??Rl(l.lang);d!==void 0&&(l.message=typeof d=="function"?d(l):d),c&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function Z(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},Ns())}}}function Nl(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function zs(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}function Ri(t,e){return{kind:"validation",type:"max_length",reference:Ri,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(r,i){return r.typed&&r.value.length>this.requirement&&G(this,"length",r,i,{received:`${r.value.length}`}),r}}}function Bi(t,e){return{kind:"validation",type:"min_length",reference:Bi,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,i){return r.typed&&r.value.length<this.requirement&&G(this,"length",r,i,{received:`${r.value.length}`}),r}}}function Fi(t){return{kind:"transformation",type:"to_date",reference:Fi,async:!1,message:t,"~run"(e,r){try{e.value=new Date(e.value),isNaN(e.value)&&(G(this,"date",e,r,{received:'"Invalid Date"'}),e.typed=!1)}catch{G(this,"date",e,r),e.typed=!1}return e}}}function qi(t){return{kind:"transformation",type:"transform",reference:qi,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function Ws(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function Y(t,e){return{...t,fallback:e,get"~standard"(){return Z(this)},"~run"(r,i){let n=t["~run"](r,i);return n.issues?{typed:!0,value:Ws(this,n,i)}:n}}}function Vi(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function Et(){return{kind:"schema",type:"any",reference:Et,expects:"any",async:!1,get"~standard"(){return Z(this)},"~run"(t){return t.typed=!0,t}}}function Ye(t,e){return{kind:"schema",type:"array",reference:Ye,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return Z(this)},"~run"(r,i){let n=r.value;if(Array.isArray(n)){r.typed=!0,r.value=[];for(let s=0;s<n.length;s++){let o=n[s],a=this.item["~run"]({value:o},i);if(a.issues){let l={type:"array",origin:"value",input:n,key:s,value:o};for(let c of a.issues)c.path?c.path.unshift(l):c.path=[l],r.issues?.push(c);if(r.issues||(r.issues=a.issues),i.abortEarly){r.typed=!1;break}}a.typed||(r.typed=!1),r.value.push(a.value)}}else G(this,"type",r,i);return r}}}function Ni(t){return{kind:"schema",type:"boolean",reference:Ni,expects:"boolean",async:!1,message:t,get"~standard"(){return Z(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:G(this,"type",e,r),e}}}function Hi(t){return{kind:"schema",type:"null",reference:Hi,expects:"null",async:!1,message:t,get"~standard"(){return Z(this)},"~run"(e,r){return e.value===null?e.typed=!0:G(this,"type",e,r),e}}}function fr(t,e){return{kind:"schema",type:"nullish",reference:fr,expects:`(${t.expects} | null | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return Z(this)},"~run"(r,i){return(r.value===null||r.value===void 0)&&(this.default!==void 0&&(r.value=Vi(this,r,i)),r.value===null||r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function mr(t){return{kind:"schema",type:"number",reference:mr,expects:"number",async:!1,message:t,get"~standard"(){return Z(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:G(this,"type",e,r),e}}}function V(t,e){return{kind:"schema",type:"object",reference:V,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return Z(this)},"~run"(r,i){let n=r.value;if(n&&typeof n=="object"){r.typed=!0,r.value={};for(let s in this.entries){let o=this.entries[s];if(s in n||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){let a=s in n?n[s]:Vi(o),l=o["~run"]({value:a},i);if(l.issues){let c={type:"object",origin:"value",input:n,key:s,value:a};for(let d of l.issues)d.path?d.path.unshift(c):d.path=[c],r.issues?.push(d);if(r.issues||(r.issues=l.issues),i.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value[s]=l.value}else if(o.fallback!==void 0)r.value[s]=Ws(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(G(this,"key",r,i,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:n,key:s,value:n[s]}]}),i.abortEarly))break}}else G(this,"type",r,i);return r}}}function A(t,e){return{kind:"schema",type:"optional",reference:A,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return Z(this)},"~run"(r,i){return r.value===void 0&&(this.default!==void 0&&(r.value=Vi(this,r,i)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function Mt(t,e){return{kind:"schema",type:"picklist",reference:Mt,expects:zs(t.map(Hs),"|"),async:!1,options:t,message:e,get"~standard"(){return Z(this)},"~run"(r,i){return this.options.includes(r.value)?r.typed=!0:G(this,"type",r,i),r}}}function It(t,e,r){return{kind:"schema",type:"record",reference:It,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return Z(this)},"~run"(i,n){let s=i.value;if(s&&typeof s=="object"){i.typed=!0,i.value={};for(let o in s)if(Nl(s,o)){let a=s[o],l=this.key["~run"]({value:o},n);if(l.issues){let d={type:"object",origin:"key",input:s,key:o,value:a};for(let h of l.issues)h.path=[d],i.issues?.push(h);if(i.issues||(i.issues=l.issues),n.abortEarly){i.typed=!1;break}}let c=this.value["~run"]({value:a},n);if(c.issues){let d={type:"object",origin:"value",input:s,key:o,value:a};for(let h of c.issues)h.path?h.path.unshift(d):h.path=[d],i.issues?.push(h);if(i.issues||(i.issues=c.issues),n.abortEarly){i.typed=!1;break}}(!l.typed||!c.typed)&&(i.typed=!1),l.typed&&(i.value[l.value]=c.value)}}else G(this,"type",i,n);return i}}}function _(t){return{kind:"schema",type:"string",reference:_,expects:"string",async:!1,message:t,get"~standard"(){return Z(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:G(this,"type",e,r),e}}}function Vs(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function gr(t,e){return{kind:"schema",type:"union",reference:gr,expects:zs(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return Z(this)},"~run"(r,i){let n,s,o;for(let a of this.options){let l=a["~run"]({value:r.value},i);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{n=l;break}else o?o.push(l):o=[l]}if(n)return n;if(s){if(s.length===1)return s[0];G(this,"type",r,i,{issues:Vs(s)}),r.typed=!0}else{if(o?.length===1)return o[0];G(this,"type",r,i,{issues:Vs(o)})}return r}}}function Gs(t,e){let r={};for(let i in t.entries)r[i]=!e||e.includes(i)?A(t.entries[i]):t.entries[i];return{...t,entries:r,get"~standard"(){return Z(this)}}}function Qe(...t){return{...t[0],pipe:t,get"~standard"(){return Z(this)},"~run"(e,r){for(let i of t)if(i.kind!=="metadata"){if(e.issues&&(i.kind==="schema"||i.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=i["~run"](e,r))}return e}}}function me(t,e,r){let i=t["~run"]({value:e},Ns(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var Zs=It(_(),gr([_(),mr(),Ni(),Hi()])),Js=Qe(_(),Bi(1),Ri(5e3)),Ks=()=>{try{return window.UNAS?Fs():window.Shopify?Ts():window.ShopRenter?Rs():null}catch{return null}},Xs=async()=>{try{return window.UNAS?await qs():window.Shopify?await Os():window.ShopRenter?await Bs():[]}catch{return[]}},et={schema:V({conversationId:A(_()),messages:A(Ye(V({id:_(),timestamp:mr(),role:Mt(["user","assistant","support"]),content:_(),parts:A(Ye(gr([V({text:_()}),V({html:_()}),V({tag:_(),data:It(_(),Et())})])))})))}),persist(t,e,r){R.setConversationState(t,{conversationId:e,messages:r}),R.setConversationId(t,e)},restore(t){try{let e=R.getConversationState(t),r=e?me(this.schema,e):void 0;return r?.success&&r.output.conversationId?{conversationId:r.output.conversationId,messages:r.output.messages||[]}:{conversationId:R.getConversationId(t)||"",messages:[]}}catch(e){return console.error("Failed to restore conversation state:",e),{conversationId:"",messages:[]}}},reset(t){R.setConversationState(t,null),R.setConversationId(t,null)}};var tt=class t extends v{static properties={widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object},autoConnect:{type:Boolean}};contextCtrl;constructor(){super(),this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.autoConnect=!1,this.contextCtrl=new ve(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,ranOutOfCredits:!1,isLiveMode:!1,lastMsg:void 0,hasQueuedMessages:!1,isConnected:()=>this.#n.isConnected,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),sendNewChat:this.sendNewChat.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this),sendImageDelete:this.#n.sendImageDelete.bind(this.#n)})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.autoConnect&&this.#n.connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:this.#t,xCustomInstructions:this.#r,conversationId:this.#n.conversationId,messages:this.#e,isStreaming:this.#n.isStreaming,typingIndicator:this.#n.typingIndicator,ranOutOfCredits:this.#n.ranOutOfCredits,isLiveMode:this.#n.isLiveMode,lastMsg:this.#n.lastMsg,hasQueuedMessages:this.#n.hasQueuedMessages,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this),sendImageDelete:this.#n.sendImageDelete.bind(this.#n)}),this.#s()}get#e(){return this.#n?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:this.#n?.messages||[]}#t;#r;#i=null;get#n(){return this.#i||(this.#i=new ar(this,{autoConnect:this.autoConnect,url:e=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("conversationId",e),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:e=>{console.error("ws error",e)},onClose:()=>{},onNewMessage:e=>{e.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:e,conversationId:this.#n.conversationId})},onMessageAppend:e=>{},onMessageDone:(e,r)=>{r.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:r.content??"",message:r,usage_TOKENS_COMPLETION:e.message.usage.TOKENS_COMPLETION,conversationId:this.#n.conversationId})},onMessageError:e=>{console.error("ws message error",e),e.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+e.message})},onReset:()=>{et.reset(this.widgetId)},onConnect:(e,r)=>{let i=Ks();this.#n.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),Xs().then(n=>{n?.length>0&&this.#n.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,cart:n,language:window.navigator.language})}).catch(n=>{console.error(n)}),this.dispatchEvent(new t.ConnectedEvent({conversationId:e,metadata:r,widgetId:this.widgetId,pendingImages:r?.pendingImages||[]}))},persistConversationState:(e,r)=>{et.persist(this.widgetId,e,r)},restoreConversationState:()=>et.restore(this.widgetId)})),this.#i}#s(){function e(i){if(!i)return;let n;try{n=typeof i=="object"?i:JSON.parse(i)}catch(o){console.error("Molin: user-data is not valid JSON",o);return}if(!n||typeof n!="object"||Object.keys(n).length===0)return;let s=me(Zs,n);if(!s.success){console.error("Molin: user-data does not pass schema validation",s.issues);return}return s.output}function r(i){if(!i)return;let n=me(Js,i);if(!n.success){console.error("Molin: custom-instructions does not pass schema validation",n.issues);return}return n.output}this.#t=e(this.xUserData),this.#r=r(this.xCustomInstructions)}async sendUserInput(e,r={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...r},n=await this.#n.sendUserInput(e,i);return n&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!1,conversationId:this.#n.conversationId}),n}async enqueueUserInput(e,r={}){e.length>1e3&&(console.error("Message exceeds max length of 1000 characters, trimming"),e=Di(e,1e3)),this.#e.some(o=>o.role==="assistant"&&o.parts?.some(a=>"tag"in a&&a.tag==="request-input-v1"&&"data"in a&&a.data.type==="new-conversation-button"))&&(this.sendNewChat(),this.reset());let s={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...r};return this.#n.enqueueUserInput(e,s)}sendUserCancel(){this.#n.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){this.#n.sendUserTypingStart()}sendUserTypingStop(){this.#n.sendUserTypingStop()}sendNewChat(){this.#n.sendNewChat()}reset(){this.#n.reset()}reloadConfig(){this.#n.reloadConfig()}connect(){this.#n.connect()}render(){return u`<slot></slot>`}};function Ys(t){let e=new ur(t,{provider:tt,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,i){if(i==="value")return e.value}})}tt.ConnectedEvent=class extends CustomEvent{static type="mw-context-widget:connected";constructor(e,r={}){super(tt.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-context-widget")||customElements.define("mw-context-widget",tt);function en(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function Hl(t,e=","){return t.map(en).join(e)}var so=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function wr(t){for(var e=9,r=t.length;r--;)e=Math.imul(e^t.charCodeAt(r),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function br(t,e="@media "){return e+j(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(i=>`(${i}-width:${r[i]})`).join(" and "))).join(",")}function j(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function Qs(t){return t}function xr(){}var F={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function oo(t){return t.match(/[-=:;]/g)?.length||0}function Ji(t){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(t)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(oo(t),15)<<18}var zl=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function tn({n:t,i:e,v:r=[]},i,n,s){t&&(t=en({n:t,i:e,v:r})),s=[...j(s)];for(let a of r){let l=i.theme("screens",a);for(let c of j(l&&br(l)||i.v(a))){var o;s.push(c),n|=l?67108864|Ji(c):a=="dark"?1073741824:c[0]=="@"?Ji(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~zl.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:n,r:s,i:e}}var ao=new Map;function Ki(t){if(t.d){let e=[],r=zi(t.r.reduce((i,n)=>n[0]=="@"?(e.push(n),i):n?zi(i,s=>zi(n,o=>{let a=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(a){let l=s.indexOf(a[1]);return~l?s.slice(0,l)+a[0]+s.slice(l+a[1].length):Wi(s,o)}return Wi(o,s)})):i,"&"),i=>Wi(i,t.n?"."+so(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,n)=>n+"{"+i+"}",t.d)}}function zi(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,i,n)=>e(i)+n)}function Wi(t,e){return t.replace(/&/g,e)}var eo=new Intl.Collator("en",{numeric:!0});function lo(t,e){for(var r=0,i=t.length;r<i;){let n=i+r>>1;0>=co(t[n],e)?r=n+1:i=n}return i}function co(t,e){let r=t.p&F.o;return r==(e.p&F.o)&&(r==F.b||r==F.o)?0:t.p-e.p||t.o-e.o||eo.compare(to(t.n),to(e.n))||eo.compare(ro(t.n),ro(e.n))}function to(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function ro(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Gi(t,e){return Math.round(parseInt(t,16)*e)}function te(t,e={}){if(typeof t=="function")return t(e);let{opacityValue:r="1",opacityVariable:i}=e,n=i?`var(${i})`:r;if(t.includes("<alpha-value>"))return t.replace("<alpha-value>",n);if(t[0]=="#"&&(t.length==4||t.length==7)){let s=(t.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Gi(t.substr(1,s),o),Gi(t.substr(1+s,s),o),Gi(t.substr(1+2*s,s),o),n]})`}return n=="1"?t:n=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function uo(t,e,r,i,n=[]){return(function s(o,{n:a,p:l,r:c=[],i:d},h){let p=[],g="",f=0,$=0;for(let y in o||{}){var b,S;let x=o[y];if(y[0]=="@"){if(!x)continue;if(y[1]=="a"){p.push(...nn(a,l,vr(""+x),h,l,c,d,!0));continue}if(y[1]=="l"){for(let E of j(x))p.push(...s(E,{n:a,p:(b=F[y[7]],l&~F.o|b),r:y[7]=="d"?[]:c,i:d},h));continue}if(y[1]=="i"){p.push(...j(x).map(E=>({p:-1,o:0,r:[],d:y+" "+E})));continue}if(y[1]=="k"){p.push({p:F.d,o:0,r:[y],d:s(x,{p:F.d},h).map(Ki).join("")});continue}if(y[1]=="f"){p.push(...j(x).map(E=>({p:F.d,o:0,r:[y],d:s(E,{p:F.d},h).map(Ki).join("")})));continue}}if(typeof x!="object"||Array.isArray(x))y=="label"&&x?a=x+wr(JSON.stringify([l,d,o])):(x||x===0)&&(y=y.replace(/[A-Z]/g,E=>"-"+E.toLowerCase()),$+=1,f=Math.max(f,(S=y)[0]=="-"?0:oo(S)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(S)?+!!RegExp.$1||-!!RegExp.$2:0)+1),g+=(g?";":"")+j(x).map(E=>h.s(y,rn(""+E,h.theme)+(d?" !important":""))).join(";"));else if(y[0]=="@"||y.includes("&")){let E=l;y[0]=="@"&&(y=y.replace(/\bscreen\(([^)]+)\)/g,(T,B)=>{let N=h.theme("screens",B);return N?(E|=67108864,br(N,"")):T}),E|=Ji(y)),p.push(...s(x,{n:a,p:E,r:[...c,y],i:d},h))}else p.push(...s(x,{p:l,r:[...c,y]},h))}return p.unshift({n:a,p:l,o:Math.max(0,15-$)+1.5*Math.min(f||15,15),r:c,d:g}),p.sort(co)})(t,tn(e,r,i,n),r)}function rn(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,i,n,s,o="")=>{let a=e(n,o);return typeof a=="function"&&/color|fill|stroke/i.test(n)?te(a):""+j(a).filter(l=>Object(l)!==l)})}function ho(t,e){let r,i=[];for(let n of t)n.d&&n.n?r?.p==n.p&&""+r.r==""+n.r?(r.c=[r.c,n.c].filter(Boolean).join(" "),r.d=r.d+";"+n.d):i.push(r={...n,n:n.n&&e}):i.push({...n,n:n.n&&e});return i}function yr(t,e,r=F.u,i,n){let s=[];for(let o of t)for(let a of(function(l,c,d,h,p){l={...l,i:l.i||p};let g=(function(f,$){let b=ao.get(f.n);return b?b(f,$):$.r(f.n,f.v[0]=="dark")})(l,c);return g?typeof g=="string"?({r:h,p:d}=tn(l,c,d,h),ho(yr(vr(g),c,d,h,l.i),l.n)):Array.isArray(g)?g.map(f=>{var $,b;return{o:0,...f,r:[...j(h),...j(f.r)],p:($=d,b=f.p??d,$&~F.o|b)}}):uo(g,l,c,d,h):[{c:en(l),p:0,o:0,r:[]}]})(o,e,r,i,n))s.splice(lo(s,a),0,a);return s}function nn(t,e,r,i,n,s,o,a){return ho((a?r.flatMap(l=>yr([l],i,n,s,o)):yr(r,i,n,s,o)).map(l=>l.p&F.o&&(l.n||e==F.b)?{...l,p:l.p&~F.o|e,o:0}:l),t)}function Wl(t,e,r,i){var n;return n=(s,o)=>{let{n:a,p:l,r:c,i:d}=tn(s,o,e);return r&&nn(a,e,r,o,l,c,d,i)},ao.set(t,n),t}function Zi(t,e,r){if(t[t.length-1]!="("){let i=[],n=!1,s=!1,o="";for(let a of t)if(!(a=="("||/[~@]$/.test(a))){if(a[0]=="!"&&(a=a.slice(1),n=!n),a.endsWith(":")){i[a=="dark:"?"unshift":"push"](a.slice(0,-1));continue}a[0]=="-"&&(a=a.slice(1),s=!s),a.endsWith("-")&&(a=a.slice(0,-1)),a&&a!="&"&&(o+=(o&&"-")+a)}o&&(s&&(o="-"+o),e[0].push({n:o,v:i.filter(Gl),i:n}))}}function Gl(t,e,r){return r.indexOf(t)==e}var io=new Map;function vr(t){let e=io.get(t);if(!e){let r=[],i=[[]],n=0,s=0,o=null,a=0,l=(c,d=0)=>{n!=a&&(r.push(t.slice(n,a+d)),c&&Zi(r,i)),n=a+1};for(;a<t.length;a++){let c=t[a];if(s)t[a-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(o)t[a-1]!="\\"&&o.test(t.slice(a))&&(o=null,n=a+RegExp.lastMatch.length);else if(c=="/"&&t[a-1]!="\\"&&(t[a+1]=="*"||t[a+1]=="/"))o=t[a+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")l(),r.push(c);else if(c==":")t[a+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(c)){l(!0);let d=r.lastIndexOf("(");if(c==")"){let h=r[d-1];if(/[~@]$/.test(h)){let p=i.shift();r.length=d,Zi([...r,"#"],i);let{v:g}=i[0].pop();for(let f of p)f.v.splice(+(f.v[0]=="dark")-+(g[0]=="dark"),g.length);Zi([...r,Wl(h.length>1?h.slice(0,-1)+wr(JSON.stringify([h,p])):h+"("+Hl(p)+")",F.a,p,/@$/.test(h))],i)}d=r.lastIndexOf("(",d-1)}r.length=d+1}else/[~@]/.test(c)&&t[a+1]=="("&&i.unshift([])}l(!0),io.set(t,e=i[0])}return e}function m(t,e,r){return[t,Xi(e,r)]}function Xi(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,i)=>({[t]:e?e(r,i):Yi(r,1)}):r=>t||{[r[1]]:Yi(r,2)}}function Yi(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function w(t,e,r,i){return[t,sn(e,r,i)]}function sn(t,e,r){let i=typeof e=="string"?(n,s)=>({[e]:r?r(n,s):n._}):e||(({1:n,_:s},o,a)=>({[n||a]:s}));return(n,s)=>{let o=po(t||n[1]),a=s.theme(o,n.$$)??le(n.$$,o,s);if(a!=null)return n._=Yi(n,0,a),i(n,s,o)}}function q(t,e={},r){return[t,Zl(e,r)]}function Zl(t={},e){return(r,i)=>{let{section:n=po(r[0]).replace("-","")+"Color"}=t,[s,o]=Jl(r.$$);if(!s)return;let a=i.theme(n,s)||le(s,n,i);if(!a||typeof a=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:c=n.replace("Color","Opacity"),property:d=n,selector:h}=t,p=i.theme(c,o||"DEFAULT")||o&&le(o,c,i),g=e||(({_:$})=>{let b=At(d,$);return h?{[h]:b}:b});r._={value:te(a,{opacityVariable:l||void 0,opacityValue:p||void 0}),color:$=>te(a,$),opacityVariable:l||void 0,opacityValue:p||void 0};let f=g(r,i);if(!r.dark){let $=i.d(n,s,a);$&&$!==a&&(r._={value:te($,{opacityVariable:l||void 0,opacityValue:p||"1"}),color:b=>te($,b),opacityVariable:l||void 0,opacityValue:p||void 0},f={"&":f,[i.v("dark")]:g(r,i)})}return f}}function Jl(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function At(t,e){let r={};return typeof e=="string"?r[t]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(r[e.opacityVariable]=e.opacityValue||"1"),r[t]=e.value),r}function le(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=rt(rn(t.slice(1,-1),r.theme)),!e)return t;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(t)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(t))||/image/i.test(e)&&!(/^image:/.test(t)||/^[a-z-]+\(/.test(t))||/weight/i.test(e)&&!(/^(number|any):/.test(t)||/^\d+$/.test(t))||/position/i.test(e)&&/^(length|size):/.test(t)))return t.replace(/^[a-z-]+:/,"")}}function po(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function rt(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",i,n="")=>rt(r)+i+rt(n)):t.replace(/(^|[^\\])_+/g,(e,r)=>r+" ".repeat(e.length-r.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function Dt({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:j(e.variants),rules:j(e.rules),ignorelist:j(e.ignorelist),hash:void 0,stringify:(i,n)=>i+":"+n,finalize:[]};for(let i of j([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&j(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:n,darkMode:s=r.darkMode,darkColor:o=r.darkColor,theme:a,variants:l,rules:c,ignorelist:d,hash:h=r.hash,stringify:p=r.stringify,finalize:g}=typeof i=="function"?i(r):i;r={preflight:r.preflight!==!1&&n!==!1&&[...r.preflight,...j(n)],darkMode:s,darkColor:o,theme:{...r.theme,...a,extend:{...r.theme.extend,...a?.extend}},variants:[...r.variants,...j(l)],rules:[...r.rules,...j(c)],ignorelist:[...r.ignorelist,...j(d)],hash:h,stringify:p,finalize:[...r.finalize,...j(g)]}}return r}function no(t,e,r,i,n,s){for(let o of e){let a=r.get(o);a||r.set(o,a=i(o));let l=a(t,n,s);if(l)return l}}function Kl(t){var e;return Qi(t[0],typeof(e=t[1])=="function"?e:()=>e)}function Xl(t){var e,r;return Array.isArray(t)?Qi(t[0],Xi(t[1],t[2])):Qi(t,Xi(e,r))}function Qi(t,e){return fo(t,(r,i,n,s)=>{let o=i.exec(r);if(o)return o.$$=r.slice(o[0].length),o.dark=s,e(o,n)})}function fo(t,e){let r=j(t).map(Yl);return(i,n,s)=>{for(let o of r){let a=e(i,o,n,s);if(a)return a}}}function Yl(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function mo(t,e){let r=Dt(t),i=(function({theme:l,darkMode:c,darkColor:d=xr,variants:h,rules:p,hash:g,stringify:f,ignorelist:$,finalize:b}){let S=new Map,y=new Map,x=new Map,E=new Map,T=fo($,(I,H)=>H.test(I));h.push(["dark",Array.isArray(c)||c=="class"?`${j(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let B=typeof g=="function"?I=>g(I,wr):g?wr:Qs;B!==Qs&&b.push(I=>({...I,n:I.n&&B(I.n),d:I.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(H,K)=>"--"+B(K).replace("#",""))}));let N={theme:(function({extend:I={},...H}){let K={},oi={get colors(){return $e("colors")},theme:$e,negative(){return{}},breakpoints(P){let z={};for(let X in P)typeof P[X]=="string"&&(z["screen-"+X]=P[X]);return z}};return $e;function $e(P,z,X,gt){if(P){if({1:P,2:gt}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(P)||[,P],/[.[]/.test(P)){let he=[];P.replace(/\[([^\]]+)\]|([^.[]+)/g,(Me,yt,Za=yt)=>he.push(Za)),P=he.shift(),X=z,z=he.join("-")}let oe=K[P]||Object.assign(Object.assign(K[P]={},Zt(H,P)),Zt(I,P));if(z==null)return oe;z||(z="DEFAULT");let Ee=oe[z]??z.split("-").reduce((he,Me)=>he?.[Me],oe)??X;return gt?te(Ee,{opacityValue:rn(gt,$e)}):Ee}let wt={};for(let oe of[...Object.keys(H),...Object.keys(I)])wt[oe]=$e(oe);return wt}function Zt(P,z){let X=P[z];return typeof X=="function"&&(X=X(oi)),X&&/color|fill|stroke/i.test(z)?(function gt(wt,oe=[]){let Ee={};for(let he in wt){let Me=wt[he],yt=[...oe,he];Ee[yt.join("-")]=Me,he=="DEFAULT"&&(yt=oe,Ee[oe.join("-")]=Me),typeof Me=="object"&&Object.assign(Ee,gt(Me,yt))}return Ee})(X):X}})(l),e:so,h:B,s(I,H){return f(I,H,N)},d(I,H,K){return d(I,H,N,K)},v(I){return S.has(I)||S.set(I,no(I,h,y,Kl,N)||"&:"+I),S.get(I)},r(I,H){let K=JSON.stringify([I,H]);return x.has(K)||x.set(K,!T(I,N)&&no(I,p,E,Xl,N,H)),x.get(K)},f(I){return b.reduce((H,K)=>K(H,N),I)}};return N})(r),n=new Map,s=[],o=new Set;e.resume(l=>n.set(l,l),(l,c)=>{e.insert(l,s.length,c),s.push(c),o.add(l)});function a(l){let c=i.f(l),d=Ki(c);if(d&&!o.has(d)){o.add(d);let h=lo(s,l);e.insert(d,h,l),s.splice(h,0,l)}return c.n}return Object.defineProperties(function(c){if(!n.size)for(let h of j(r.preflight))typeof h=="function"&&(h=h(i)),h&&(typeof h=="string"?nn("",F.b,vr(h),i,F.b,[],!1,!0):uo(h,{},i,F.b)).forEach(a);c=""+c;let d=n.get(c);if(!d){let h=new Set;for(let p of yr(vr(c),i))h.add(p.c).add(a(p));d=[...h].filter(Boolean).join(" "),n.set(c,d).set(d,d)}return d},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:i.theme,config:r,snapshot(){let l=e.snapshot(),c=new Set(o),d=new Map(n),h=[...s];return()=>{l(),o=c,n=d,s=h}},clear(){e.clear(),o=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Ql(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function go(t){let e=new MutationObserver(r);return{observe(n){e.observe(n,{attributeFilter:["class"],subtree:!0,childList:!0}),i(n),r([{target:n,type:""}])},disconnect(){e.disconnect()}};function r(n){for(let{type:s,target:o}of n)if(s[0]=="a")i(o);else for(let a of o.querySelectorAll("[class]"))i(a);e.takeRecords()}function i(n){let s,o=n.getAttribute?.("class");o&&Ql(o,s=t(o))&&n.setAttribute("class",s)}}function ec(t){let e=document.querySelector(t||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function kr(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:ec(t)).sheet;return{target:e,snapshot(){let r=Array.from(e.cssRules,i=>i.cssText);return()=>{this.clear(),r.forEach(this.insert)}},clear(){for(let r=e.cssRules.length;r--;)e.deleteRule(r)},destroy(){e.ownerNode?.remove()},insert(r,i){try{e.insertRule(r,i)}catch{e.insertRule(":root{}",i)}},resume:xr}}var tc=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function wo(t){return tc.get(t)}function yo(t){var e=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(t);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function vo(t,e){var r=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(t);return r?r[1]?/^sti/i.test(e)?1:0:r[2]?/^pat/i.test(e)?1:0:r[3]?/^image-/i.test(e)?1:0:r[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var rc=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Cr(){return({stringify:t})=>({stringify(e,r,i){let n="",s=wo(e);s&&(n+=t(s,r,i)+";");let o=yo(e),a=vo(e,r);for(let l of rc)o&l[1]&&(n+=t(l[0]+e,r,i)+";"),a&l[1]&&(n+=t(e,l[0]+r,i)+";");return n+t(e,r,i)}})}function _r(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",sn("lineClamp",({_:t})=>bo(t))],["line-clamp-(\\d+)",({1:t})=>bo(t)]]}}function bo(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var Lt={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...Q(4,"rem",4,.5,.5),...Q(12,"rem",4,5),14:"3.5rem",...Q(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:M("blur"),backdropBrightness:M("brightness"),backdropContrast:M("contrast"),backdropGrayscale:M("grayscale"),backdropHueRotate:M("hueRotate"),backdropInvert:M("invert"),backdropOpacity:M("opacity"),backdropSaturate:M("saturate"),backdropSepia:M("sepia"),backgroundColor:M("colors"),backgroundImage:{none:"none"},backgroundOpacity:M("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...Q(200,"",100,0,50),...Q(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:M("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:M("spacing"),borderWidth:{DEFAULT:"1px",...re(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:M("colors"),caretColor:M("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...Q(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:M("borderColor"),divideOpacity:M("borderOpacity"),divideWidth:M("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:t})=>({...t("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:t})=>({...t("spacing"),...jt(2,6),...jt(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:M("spacing"),gradientColorStops:M("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:t})=>({...t("spacing"),...jt(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...jt(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...Q(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:t})=>({auto:"auto",...t("spacing")}),maxHeight:({theme:t})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...t("spacing")}),maxWidth:({theme:t,breakpoints:e})=>({...e(t("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...Q(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:M("spacing"),placeholderColor:M("colors"),placeholderOpacity:M("opacity"),outlineColor:M("colors"),outlineOffset:re(8,"px"),outlineWidth:re(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:M("colors"),ringOffsetWidth:re(8,"px"),ringOpacity:({theme:t})=>({...t("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...re(8,"px")},rotate:{...re(2,"deg"),...re(12,"deg",3),...re(180,"deg",45)},saturate:Q(200,"",100,0,50),scale:{...Q(150,"",100,0,50),...Q(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:M("spacing"),scrollPadding:M("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...re(2,"deg"),...re(12,"deg",3)},space:M("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:Q(2),textColor:M("colors"),textDecorationColor:M("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...re(8,"px")},textUnderlineOffset:{auto:"auto",...re(8,"px")},textIndent:M("spacing"),textOpacity:M("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:M("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:t})=>({...t("spacing"),...jt(2,4),full:"100%"}),width:({theme:t})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...t("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...Q(50,"",1,0,10),auto:"auto"}};function jt(t,e){let r={};do for(var i=1;i<t;i++)r[`${i}/${t}`]=Number((i/t*100).toFixed(6))+"%";while(++t<=e);return r}function re(t,e,r=0){let i={};for(;r<=t;r=2*r||1)i[r]=r+e;return i}function Q(t,e="",r=1,i=0,n=1,s={}){for(;i<=t;i+=n)s[i]=i/r+e;return s}function M(t){return({theme:e})=>e(t)}var xo={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${Lt.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${Lt.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var Eo=[m("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:le(`[${e}]`,"",r)}}})),m("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),w("aspect-","aspectRatio"),m("container",(t,{theme:e})=>{let{screens:r=e("screens"),center:i,padding:n}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...o("xs")};for(let a in r){let l=r[a];typeof l=="string"&&(s[br(l)]={"&":{maxWidth:l,...o(a)}})}return s;function o(a){let l=n&&(typeof n=="string"?n:n[a]||n.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),w("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),m("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),m("box-(border|content)","boxSizing",({1:t})=>t+"-box"),m("hidden",{display:"none"}),m("table-(auto|fixed)","tableLayout"),m(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",m("isolate","isolation"),m("object-(contain|cover|fill|none|scale-down)","objectFit"),w("object-","objectPosition"),m("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Sr),m("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),m("(static|fixed|absolute|relative|sticky)","position"),w("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),w("-?(top|bottom|left|right)(?:$|-)","inset"),m("(visible|collapse)","visibility"),m("invisible",{visibility:"hidden"}),w("-?z-","zIndex"),m("flex-((row|col)(-reverse)?)","flexDirection",ko),m("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),w("(flex-(?:grow|shrink))(?:$|-)"),w("(flex)-"),w("grow(?:$|-)","flexGrow"),w("shrink(?:$|-)","flexShrink"),w("basis-","flexBasis"),w("-?(order)-"),"-?(order)-(\\d+)",w("grid-cols-","gridTemplateColumns"),m("grid-cols-(\\d+)","gridTemplateColumns",$o),w("col-","gridColumn"),m("col-(span)-(\\d+)","gridColumn",So),w("col-start-","gridColumnStart"),m("col-start-(auto|\\d+)","gridColumnStart"),w("col-end-","gridColumnEnd"),m("col-end-(auto|\\d+)","gridColumnEnd"),w("grid-rows-","gridTemplateRows"),m("grid-rows-(\\d+)","gridTemplateRows",$o),w("row-","gridRow"),m("row-(span)-(\\d+)","gridRow",So),w("row-start-","gridRowStart"),m("row-start-(auto|\\d+)","gridRowStart"),w("row-end-","gridRowEnd"),m("row-end-(auto|\\d+)","gridRowEnd"),m("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>Sr(ko(t))),m("grid-flow-(dense)","gridAutoFlow"),w("auto-cols-","gridAutoColumns"),w("auto-rows-","gridAutoRows"),w("gap-x(?:$|-)","gap","columnGap"),w("gap-y(?:$|-)","gap","rowGap"),w("gap(?:$|-)","gap"),"(justify-(?:items|self))-",m("justify-","justifyContent",Co),m("(content|items|self)-",t=>({["align-"+t[1]]:Co(t)})),m("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),w("p([xytrbl])?(?:$|-)","padding",it("padding")),w("-?m([xytrbl])?(?:$|-)","margin",it("margin")),w("-?space-(x|y)(?:$|-)","space",({1:t,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[t]]:`calc(${e} * calc(1 - var(--tw-space-${t}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[t]]:`calc(${e} * var(--tw-space-${t}-reverse))`}})),m("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),w("w-","width"),w("min-w-","minWidth"),w("max-w-","maxWidth"),w("h-","height"),w("min-h-","minHeight"),w("max-h-","maxHeight"),w("font-","fontWeight"),w("font-","fontFamily",({_:t})=>typeof(t=j(t))[1]=="string"?{fontFamily:se(t)}:{fontFamily:se(t[0]),...t[1]}),m("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),m("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),m("italic","fontStyle"),m("not-italic",{fontStyle:"normal"}),m("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:t,2:e="",3:r})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(r?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":t)]:t,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...xe({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),w("tracking-","letterSpacing"),w("leading-","lineHeight"),m("list-(inside|outside)","listStylePosition"),w("list-","listStyleType"),m("list-","listStyleType"),w("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),q("placeholder-",{property:"color",selector:"&::placeholder"}),m("text-(left|center|right|justify|start|end)","textAlign"),m("text-(ellipsis|clip)","textOverflow"),w("text-opacity-","textOpacity","--tw-text-opacity"),q("text-",{property:"color"}),w("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),w("indent-","textIndent"),m("(overline|underline|line-through)","textDecorationLine"),m("no-underline",{textDecorationLine:"none"}),w("underline-offset-","textUnderlineOffset"),q("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),w("decoration-","textDecorationThickness"),m("decoration-","textDecorationStyle"),m("(uppercase|lowercase|capitalize)","textTransform"),m("normal-case",{textTransform:"none"}),m("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),m("align-","verticalAlign"),m("whitespace-","whiteSpace"),m("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),m("break-words",{overflowWrap:"break-word"}),m("break-all",{wordBreak:"break-all"}),m("break-keep",{wordBreak:"keep-all"}),q("caret-",{opacityVariable:!1,opacitySection:"opacity"}),q("accent-",{opacityVariable:!1,opacitySection:"opacity"}),m("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${Ue(t," ")},var(--tw-gradient-stops))`),q("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-from":t.value,"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),q("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${t.value},var(--tw-gradient-to)`})),q("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),m("bg-(fixed|local|scroll)","backgroundAttachment"),m("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),m(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),m("bg-blend-","backgroundBlendMode"),m("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),w("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),q("bg-",{section:"backgroundColor"}),w("bg-","backgroundImage"),w("bg-","backgroundPosition"),m("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Sr),w("bg-","backgroundSize"),w("rounded(?:$|-)","borderRadius"),w("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:t,_:e})=>{let r={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[t]||[t,t];return{[`border-${Ue(r[0])}-radius`]:e,[`border-${Ue(r[1])}-radius`]:e}}),m("border-(collapse|separate)","borderCollapse"),w("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),m("border-(solid|dashed|dotted|double|none)","borderStyle"),w("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...xe({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(t||"-x")]:e,["--tw-border-spacing"+(t||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),q("border-([xytrbl])-",{section:"borderColor"},it("border","Color")),q("border-"),w("border-([xytrbl])(?:$|-)","borderWidth",it("border","Width")),w("border(?:$|-)","borderWidth"),w("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),m("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),m("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),w("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${Ue(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${Ue(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),q("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),w("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),q("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),w("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),m("ring-inset",{"--tw-ring-inset":"inset"}),q("ring-",{property:"--tw-ring-color"}),w("ring(?:$|-)","ringWidth",({_:t},{theme:e})=>({...xe({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":te(e("ringOffsetColor","","#fff")),"--tw-ring-color":te(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${t} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),q("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),w("shadow(?:$|-)","boxShadow",({_:t})=>({...xe({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":se(t),"--tw-shadow-colored":se(t).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),w("(opacity)-"),m("mix-blend-","mixBlendMode"),..._o(),..._o("backdrop-"),w("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:se(t),transitionTimingFunction:t._=="none"?void 0:se(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:se(e("transitionDuration",""))})),w("duration(?:$|-)","transitionDuration","transitionDuration",se),w("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",se),w("delay(?:$|-)","transitionDelay","transitionDelay",se),w("animate(?:$|-)","animation",(t,{theme:e,h:r,e:i})=>{let n=se(t),s=n.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=i(r(s[0])))]:o,animation:s.join(" ")}:{animation:n}}),"(transform)-(none)",m("transform",an),m("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":Mo(t=="gpu")})),w("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...an()})),w("-?(rotate)-","rotate",on),w("-?(translate-[xy])-","translate",on),w("-?(skew-[xy])-","skew",on),m("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Sr),"(appearance)-",w("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",w("(cursor)-"),"(cursor)-",m("snap-(none)","scroll-snap-type"),m("snap-(x|y|both)",({1:t})=>({...xe({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),m("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),m("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),m("snap-(normal|always)","scroll-snap-stop"),m("scroll-(auto|smooth)","scroll-behavior"),w("scroll-p([xytrbl])?(?:$|-)","padding",it("scroll-padding")),w("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",it("scroll-margin")),m("touch-(auto|none|manipulation)","touch-action"),m("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...xe({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":r?"pan-y":t}`]:t,"touch-action":"var(--tw-touch-action)"})),m("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),m("outline",{outlineStyle:"solid"}),m("outline-(dashed|dotted|double)","outlineStyle"),w("-?(outline-offset)-"),q("outline-",{opacityVariable:!1,opacitySection:"opacity"}),w("outline-","outlineWidth"),"(pointer-events)-",w("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],m("select-(none|text|all|auto)","userSelect"),q("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),q("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),w("stroke-","strokeWidth"),m("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),m("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Sr(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function ko(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function Ue(t,e="-"){let r=[];for(let i of t)r.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return r.join(e)}function se(t){return t&&""+(t._||t)}function Co({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function it(t,e=""){return({1:r,_:i})=>{let n={x:"lr",y:"tb"}[r]||r+r;return n?{...At(t+"-"+Ue(n[0])+e,i),...At(t+"-"+Ue(n[1])+e,i)}:At(t+e,i)}}function _o(t=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",t&&"opacity","saturate","sepia",!t&&"drop-shadow"].filter(Boolean),r={};for(let i of e)r[`--tw-${t}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return r={...xe(r),[`${t}filter`]:e.map(i=>`var(--tw-${t}${i})`).join(" ")},[`(${t}filter)-(none)`,m(`${t}filter`,r),...e.map(i=>w(`${i[0]=="h"?"-?":""}(${t}${i})(?:$|-)`,i,({1:n,_:s})=>({[`--tw-${n}`]:j(s).map(o=>`${i}(${o})`).join(" "),...r})))]}function on({1:t,_:e}){return{["--tw-"+t]:e,...an()}}function an(){return{...xe({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":Mo()}),transform:"var(--tw-transform)"}}function Mo(t){return[t?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function So({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function $o({1:t}){return`repeat(${t},minmax(0,1fr))`}function xe(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var Io=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:t})=>`@media (orientation:${t})`],["contrast-(more|less)",({1:t})=>`@media (prefers-contrast:${t})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:t})=>`&::${t}`],["(marker|selection)",({1:t})=>`& *::${t},&::${t}`],["file","&::file-selector-button"],["(first|last|only)",({1:t})=>`&:${t}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:t,$$:e},r)=>e&&`&[${t}-${r.theme(t,e)||le(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:i="",6:n=e},{e:s,h:o,v:a})=>{let l=rt(i)||(r[0]=="["?r:a(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(t+n))})`)}${t[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:t})=>`[dir="${t}"] &`],["supports-",({$$:t},e)=>{if(t&&(t=e.theme("supports",t)||le(t,"",e)),t)return t.includes(":")||(t+=":var(--tw)"),/^\w*\s*\(/.test(t)||(t=`(${t})`),`@supports ${t.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:t},e)=>{if(t&&(t=e.theme("screens",t)||le(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=le(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&rt(t).replace(/[}]+$/,"").split("{")]];function Ao({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:xo,theme:{...Lt,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:Io,rules:Eo,finalize(r){return r.n&&r.d&&r.r.some(i=>/^&::(before|after)$/.test(i))&&!/(^|;)content:/.test(r.d)?{...r,d:"content:var(--tw-content);"+r.d}:r}}}var ic={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},nc={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},sc={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},oc={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},ac={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},lc={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},cc={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},uc={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},dc={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},hc={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},pc={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},fc={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},mc={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},gc={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},wc={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},yc={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},vc={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},bc={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},xc={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},kc={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},Cc={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},_c={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Do={__proto__:null,slate:ic,gray:nc,zinc:sc,neutral:oc,stone:ac,red:lc,orange:cc,amber:uc,yellow:dc,lime:hc,green:pc,emerald:fc,teal:mc,cyan:gc,sky:wc,blue:yc,indigo:vc,violet:bc,purple:xc,fuchsia:kc,pink:Cc,rose:_c};function $r({disablePreflight:t}={}){return Ao({colors:Do,disablePreflight:t})}function Er({className:t="prose",defaultColor:e="gray",extend:r={},colors:i={}}={}){return i={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...i,dark:i.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...i.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${t}-${s}`,(a,l)=>To(t,o[0]=="."?"."+l.e(l.h(o.slice(1))):o,l,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${t})`,({1:s},{h:o})=>[{c:o(s)}]],[`${t}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[t+"-",({$$:s},o)=>{let a=Lo(o.theme("fontSize",s));return a&&{"@layer components":a}}],[t+"-",({$$:s},o)=>n(s,o)],[t,(s,o)=>({...n(e,o),"@layer base":[jo(t,o,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:C(20,16),marginBottom:C(20,16),paddingLeft:C(26,16)},li:{marginTop:C(8,16),marginBottom:C(8,16)},"ol>li,ul>li":{paddingLeft:C(6,16)},">ul>li p":{marginTop:C(12,16),marginBottom:C(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:C(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:C(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:C(12,16),marginBottom:C(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:C(48,16),marginBottom:C(48,16)},blockquote:{marginTop:C(32,20),marginBottom:C(32,20),paddingLeft:C(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:C(20,16),marginBottom:C(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:C(36,16),marginTop:"0",marginBottom:C(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:C(24,16),marginTop:C(48,24),marginBottom:C(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:C(20,16),marginTop:C(32,20),marginBottom:C(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:C(24,16),marginBottom:C(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:C(32,16),marginBottom:C(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:C(14,16),lineHeight:"1.4",marginTop:C(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:C(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:C(21,24)},"h3 code":{fontSize:C(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:C(14,16),lineHeight:"1.7",marginTop:C(24,14),marginBottom:C(24,14),borderRadius:"0.375rem",paddingTop:C(12,14),paddingRight:C(16,14),paddingBottom:C(12,14),paddingLeft:C(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:C(32,16),marginBottom:C(32,16),fontSize:C(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:C(8,14),paddingBottom:C(8,14),paddingLeft:C(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:C(8,14),paddingRight:C(8,14),paddingBottom:C(8,14),paddingLeft:C(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${o.e(o.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:C(20,16),lineHeight:"1.6",marginTop:C(24,20),marginBottom:C(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),jo(t,o,r)],"@layer components":{...Lo(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,o){let a={},l={},c=(d,h,p)=>{let g=o.theme(`colors.${s}.${h}`,h);p["--tw-prose-"+d]=te(g);let f=p!=l&&o.d("colors",`${s}-${h}`,g);f&&(l["--tw-prose-"+d]=te(f))};for(let d in i){let h=i[d];d!="dark"&&h&&c(d,h,a)}for(let d in i.dark||{}){let h=i.dark[d];h&&(i.dark?c("invert-"+d,h,a):c(d,h,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function jo(t,e,r){let i={};for(let n in r)i[To(t,n,e,s=>`.${e.e(e.h(t))}${s}`)]=r[n];return i}function To(t,e,{e:r,h:i},n){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",a=s,l="")=>n(`${o}:where(${a}):not(:where(.${r(i("not-"+t))} *))${l}`))}function Lo(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function C(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var ln=Dt({hash:!1,darkMode:"class",theme:{extend:{colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}},spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]}}},presets:[$r(),Cr(),_r(),Er()]});function Mr(t,e=!0){let r=(function(){if(Sc)try{let l=kr(new CSSStyleSheet);return l.connect=c=>{let d=cn(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,l.target]},l.disconnect=xr,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[kr(s)],a=new WeakMap;return{get target(){return o[0].target},snapshot(){let l=o.map(c=>c.snapshot());return()=>l.forEach(c=>c())},clear(){o.forEach(l=>l.clear())},destroy(){o.forEach(l=>l.destroy())},insert(l,c,d){o[0].insert(l,c,d);let h=this.target.cssRules[c];o.forEach((p,g)=>g&&p.target.insertRule(h.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");cn(l).appendChild(c);let d=kr(c),{cssRules:h}=this.target;for(let p=0;p<h.length;p++)d.target.insertRule(h[p].cssText,p);o.push(d),a.set(l,d)},disconnect(l){let c=o.indexOf(a.get(l));c>=0&&o.splice(c,1)}}})(),i=mo({...t,hash:t.hash??e},r),n=go(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),n.observe(cn(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var Sc=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function cn(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var k=t=>Mr(ln)(t);var un=class extends k(v){static properties={color:{type:String},radius:{type:String},size:{type:String},border:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=O`
131
131
  :host {
132
132
  display: block;
133
133
  }
@@ -142,7 +142,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
142
142
  transform: rotate(360deg);
143
143
  }
144
144
  }
145
- `;constructor(){super(),this.color="#601feb",this.radius="16.8576px",this.size="320px",this.border="#d1d5db",this.darkMode=!1}render(){return d`
145
+ `;constructor(){super(),this.color="#601feb",this.radius="16.8576px",this.size="320px",this.border="#d1d5db",this.darkMode=!1}render(){return u`
146
146
  <div class="${this.darkMode?"dark":""} flex flex-row flex-wrap gap-0">
147
147
  <div class="relative z-0 flex min-h-9 items-center justify-center overflow-hidden" style="border-radius: ${this.radius};">
148
148
  <!-- Spinning gradient background -->
@@ -154,7 +154,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
154
154
  <slot></slot>
155
155
  </div>
156
156
  </div>
157
- `}};customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",ai);var li=class extends C(v){static properties={state:{type:String},color:{type:String},bubbleStyle:{type:String},src:{type:String},width:{type:String},height:{type:String}};static styles=j`
157
+ `}};customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",un);var dn=class extends k(v){static properties={state:{type:String},color:{type:String},bubbleStyle:{type:String},src:{type:String},width:{type:String},height:{type:String}};static styles=O`
158
158
  .shadow-button {
159
159
  box-shadow:
160
160
  -58.9194px 74.8436px 38.218px rgba(0, 0, 0, 0.01),
@@ -162,7 +162,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
162
162
  -14.3318px 19.109px 23.8863px rgba(0, 0, 0, 0.09),
163
163
  -3.18483px 4.77725px 12.7393px rgba(0, 0, 0, 0.1);
164
164
  }
165
- `;constructor(){super(),this.state="open",this.color="#601feb",this.bubbleStyle="solid",this.src="",this.width="64px",this.height="64px"}get iconColor(){return this.bubbleStyle==="solid"?"#ffffff":this.color}get backgroundColor(){return this.bubbleStyle==="solid"?this.color:"#ffffff"}get svgSize(){let e=parseFloat(this.width),r=parseFloat(this.height),i=Math.min(e,r)*.55,s=i,o=i/1.65;return{width:s,height:o}}get dynamicRadius(){let e=parseFloat(this.width),r=parseFloat(this.height);return`${Math.min(e,r)*.265}px`}render=()=>d`
165
+ `;constructor(){super(),this.state="open",this.color="#601feb",this.bubbleStyle="solid",this.src="",this.width="64px",this.height="64px"}get iconColor(){return this.bubbleStyle==="solid"?"#ffffff":this.color}get backgroundColor(){return this.bubbleStyle==="solid"?this.color:"#ffffff"}get svgSize(){let e=parseFloat(this.width),r=parseFloat(this.height),n=Math.min(e,r)*.55,s=n,o=n/1.65;return{width:s,height:o}}get dynamicRadius(){let e=parseFloat(this.width),r=parseFloat(this.height);return`${Math.min(e,r)*.265}px`}render=()=>u`
166
166
  <div class="shadow-button inline-block transition-transform hover:scale-105 active:scale-90" style="border-radius: ${this.dynamicRadius};">
167
167
  <mw-spinning-border .color="${this.color}" .border="${"#f9fafb"}" .radius="${this.dynamicRadius}">
168
168
  <!-- we want the transform transition on the root element so that both the transform transition and state switch transition are continuous and fluid -->
@@ -173,14 +173,14 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
173
173
  aria-label="Open Molin AI chat window">
174
174
  <!-- the 'open' state invites the user to open (e.g. the chat window) -->
175
175
  <div class="${this.state==="open"?"visible opacity-100":"invisible opacity-0"} absolute top-[1px] right-0 bottom-0 left-[1px] transition-[opacity,visibility]">
176
- ${this.src?d`
176
+ ${this.src?u`
177
177
  <!-- load given source -->
178
178
  <img
179
179
  class="flex items-center justify-center bg-white"
180
180
  style="width: calc(${this.width} - 2px); height: calc(${this.height} - 2px); border-radius: ${this.dynamicRadius};"
181
181
  src="${this.src}"
182
182
  alt="Molin AI chat" />
183
- `:d`
183
+ `:u`
184
184
  <!-- the solid background with AI text -->
185
185
  <div
186
186
  class="flex items-center justify-center bg-[${this.backgroundColor}]"
@@ -219,7 +219,92 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
219
219
  </button>
220
220
  </mw-spinning-border>
221
221
  </div>
222
- `};customElements.get("mw-bubble")||customElements.define("mw-bubble",li);var To={airplay:`<svg
222
+ `};customElements.get("mw-bubble")||customElements.define("mw-bubble",dn);var Ir={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ar=t=>(...e)=>({_$litDirective$:t,values:e}),nt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var{I:$c}=ws;var Oo=()=>document.createComment(""),st=(t,e,r)=>{let i=t._$AA.parentNode,n=e===void 0?t._$AB:e._$AA;if(r===void 0){let s=i.insertBefore(Oo(),n),o=i.insertBefore(Oo(),n);r=new $c(s,o,t,t.options)}else{let s=r._$AB.nextSibling,o=r._$AM,a=o!==t;if(a){let l;r._$AQ?.(t),r._$AM=t,r._$AP!==void 0&&(l=t._$AU)!==o._$AU&&r._$AP(l)}if(s!==n||a){let l=r._$AA;for(;l!==s;){let c=l.nextSibling;i.insertBefore(l,n),l=c}}}return r},ke=(t,e,r=t)=>(t._$AI(e,r),t),Ec={},Uo=(t,e=Ec)=>t._$AH=e,Po=t=>t._$AH,Dr=t=>{t._$AR(),t._$AA.remove()};var Ro=(t,e,r)=>{let i=new Map;for(let n=e;n<=r;n++)i.set(t[n],n);return i},J=Ar(class extends nt{constructor(t){if(super(t),t.type!==Ir.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,r){let i;r===void 0?r=e:e!==void 0&&(i=e);let n=[],s=[],o=0;for(let a of t)n[o]=i?i(a,o):o,s[o]=r(a,o),o++;return{values:s,keys:n}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,i]){let n=Po(t),{values:s,keys:o}=this.dt(e,r,i);if(!Array.isArray(n))return this.ut=o,s;let a=this.ut??=[],l=[],c,d,h=0,p=n.length-1,g=0,f=s.length-1;for(;h<=p&&g<=f;)if(n[h]===null)h++;else if(n[p]===null)p--;else if(a[h]===o[g])l[g]=ke(n[h],s[g]),h++,g++;else if(a[p]===o[f])l[f]=ke(n[p],s[f]),p--,f--;else if(a[h]===o[f])l[f]=ke(n[h],s[f]),st(t,l[f+1],n[h]),h++,f--;else if(a[p]===o[g])l[g]=ke(n[p],s[g]),st(t,n[h],n[p]),p--,g++;else if(c===void 0&&(c=Ro(o,g,f),d=Ro(a,h,p)),c.has(a[h]))if(c.has(a[p])){let $=d.get(o[g]),b=$!==void 0?n[$]:null;if(b===null){let S=st(t,n[h]);ke(S,s[g]),l[g]=S}else l[g]=ke(b,s[g]),st(t,n[h],b),n[$]=null;g++}else Dr(n[p]),p--;else Dr(n[h]),h++;for(;g<=f;){let $=st(t,l[f+1]);ke($,s[g]),l[g++]=$}for(;h<=p;){let $=n[h++];$!==null&&Dr($)}return this.ut=o,Uo(t,l),ne}});var Tt=class t extends k(v){static properties={examples:{type:Object},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.examples={title:"",items:[]},this.color="",this.darkMode=!1}render(){return!this.examples?.title&&!this.examples?.items?.length?null:u`
223
+ <div class="${this.darkMode?"dark":""} flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pt-6 pb-2">
224
+ ${this.examples.title?u`
225
+ <h2 class="mt-14 px-2 pt-9 pb-2 text-left text-3xl leading-tight font-bold tracking-tight text-black dark:text-white">
226
+ <span>${this.examples.title}</span>
227
+ </h2>
228
+ `:null}
229
+ ${this.examples?.items?.length?u`
230
+ <ul class="mt-auto flex flex-wrap justify-end gap-2.5 text-sm leading-6 text-black select-none dark:text-white">
231
+ ${J(this.examples.items,e=>e,e=>u`
232
+ <li
233
+ class="my-auto inline-block cursor-pointer rounded-2xl border-1 border-gray-300 px-4 py-2 text-left transition-all duration-200 hover:-translate-y-0.5 hover:bg-[${this.color}]/[0.08] hover:opacity-80 hover:shadow dark:border-gray-600"
234
+ @click="${()=>this.#e(e)}">
235
+ <span>${e.trim()}</span>
236
+ </li>
237
+ `)}
238
+ </ul>
239
+ `:null}
240
+ </div>
241
+ `}#e(e){this.dispatchEvent(new t.ExampleClickEvent({example:e}))}};Tt.ExampleClickEvent=class extends CustomEvent{static type="mw:example-click";constructor(e,r={}){super(Tt.ExampleClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-background")||customElements.define("mw-chat-background",Tt);var Pe=class t extends k(v){static properties={content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1,this.darkMode=!1}static styles=O`
242
+ /* blurred background */
243
+
244
+ [part='gradient-blur'] {
245
+ /* blur gradient */
246
+ mask-image: linear-gradient(to bottom, white 70%, transparent);
247
+ -webkit-mask-image: linear-gradient(to bottom, white 70%, transparent);
248
+ backdrop-filter: blur(2px);
249
+
250
+ /* bg-color gradient */
251
+ background-image: linear-gradient(to bottom, white 20%, transparent);
252
+ }
253
+
254
+ .dark [part='gradient-blur'] {
255
+ /* bg-color gradient for dark mode */
256
+ background-image: linear-gradient(to bottom, #2b2d31 20%, transparent);
257
+ }
258
+ `;render(){return u`
259
+ <div class="${this.darkMode?"dark":""} relative z-10 h-12">
260
+ <div part="gradient-blur" class="absolute inset-x-0.5 mt-2 h-12"></div>
261
+
262
+ <div class="absolute inset-0 h-12 overflow-hidden rounded-full">
263
+ <svg class="absolute left-1/2 -translate-x-1/2 text-[${this.content.color}]/80" width="1000" height="48" viewBox="0 0 1000 48" fill="none" xmlns="http://www.w3.org/2000/svg">
264
+ <path
265
+ d="M0 0V48H448C459.674 47.8029 468.846 37.4168 476.669 28.559L476.764 28.4508C482.429 22.0372 490.665 18 499.833 18C509.002 18 517.239 22.0372 522.903 28.4508L522.998 28.559C530.895 37.5009 540.167 48 552 48H1000V0H0Z"
266
+ fill="currentColor" />
267
+ </svg>
268
+ </div>
269
+
270
+ <div class="absolute inset-0 px-4 py-3">
271
+ <!-- title + buttons -->
272
+ <!-- h-6 keeps the same height as the right buttons to stop the text jitter when they become visible -->
273
+ <div class="z-10 flex h-6 items-center gap-3">
274
+ <!-- TODO: line-clamp-2 -->
275
+ <h1 class="line-clamp-2 max-w-[40%] leading-tight font-semibold tracking-tight text-white dark:text-black">${this.content.title}</h1>
276
+
277
+ <!-- spacer to push other elements to the sides -->
278
+ <div class="flex-grow"></div>
279
+
280
+ <!-- new chat btn -->
281
+ <button @click=${this.#e} type="button" class="${this.showNewChat?"inline-flex":"hidden"} shrink-0">
282
+ <!-- svg icon of a bubble with a plus -->
283
+ <svg class="h-6 w-6 fill-white dark:fill-black" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 37 36">
284
+ <path
285
+ fill-rule="evenodd"
286
+ d="M36.201 17.62c0 10.996-6.18 17.181-17.17 17.181-3.236 0-6.055-.536-8.422-1.574l-8.084 2.697c-1.136.379-2.206-.722-1.797-1.848l2.823-7.77c-1.113-2.42-1.69-5.33-1.69-8.687C1.862 6.623 8.044.438 19.032.438c10.99 0 17.17 6.185 17.17 17.181Zm-15.88-8.653a1.355 1.355 0 0 0-2.71 0v7.897H9.716a1.355 1.355 0 1 0 0 2.71h7.897v7.896a1.355 1.355 0 1 0 2.71 0v-7.896h7.896a1.355 1.355 0 1 0 0-2.71h-7.896V8.967Z"
287
+ clip-rule="evenodd" />
288
+ </svg>
289
+ </button>
290
+
291
+ <!-- close chat btn -->
292
+ <button @click=${this.#t} class="${this.showClose?"inline-flex":"hidden"} shrink-0">
293
+ <!-- svg icon of an X -->
294
+ <svg class="h-6 w-6 stroke-white dark:stroke-black" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2">
295
+ <path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
296
+ </svg>
297
+ </button>
298
+ </div>
299
+
300
+ <!-- logo -->
301
+ <div class="absolute top-1/2 left-1/2 z-10 -mt-0.5 -translate-x-1/2">
302
+ <!-- when injected from the dashboard, it's a base64 string data:image format -->
303
+ <img class="inline-block h-[52px] w-[52px] rounded-full bg-white object-cover dark:bg-gray-700" src="${this.content.logoUrl}" alt="Logo" />
304
+ </div>
305
+ </div>
306
+ </div>
307
+ `}#e(){this.dispatchEvent(new t.NewChatClickEvent)}#t(){this.dispatchEvent(new t.CloseClickEvent)}};Pe.NewChatClickEvent=class extends CustomEvent{static type="mw:new-chat-click";constructor(e={}){super(Pe.NewChatClickEvent.type,{...e})}};Pe.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(Pe.CloseClickEvent.type,{...e})}};customElements.get("mw-chat-header")||customElements.define("mw-chat-header",Pe);var Bo={airplay:`<svg
223
308
  xmlns="http://www.w3.org/2000/svg"
224
309
  width="24"
225
310
  height="24"
@@ -247,6 +332,22 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
247
332
  <path d="M7 20V4" />
248
333
  <path d="m21 8-4-4-4 4" />
249
334
  <path d="M17 4v16" />
335
+ </svg>`,"arrow-down-wide-narrow":`<svg
336
+ xmlns="http://www.w3.org/2000/svg"
337
+ width="24"
338
+ height="24"
339
+ viewBox="0 0 24 24"
340
+ fill="none"
341
+ stroke="currentColor"
342
+ stroke-width="2"
343
+ stroke-linecap="round"
344
+ stroke-linejoin="round"
345
+ >
346
+ <path d="m3 16 4 4 4-4" />
347
+ <path d="M7 20V4" />
348
+ <path d="M11 4h10" />
349
+ <path d="M11 8h7" />
350
+ <path d="M11 12h4" />
250
351
  </svg>`,"arrow-down":`<svg
251
352
  xmlns="http://www.w3.org/2000/svg"
252
353
  width="24"
@@ -589,7 +690,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
589
690
  <path d="M12 15V3" />
590
691
  <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
591
692
  <path d="m7 10 5 5 5-5" />
592
- </svg>`,edit:"404: Not Found","external-link":`<svg
693
+ </svg>`,"external-link":`<svg
593
694
  xmlns="http://www.w3.org/2000/svg"
594
695
  width="24"
595
696
  height="24"
@@ -661,7 +762,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
661
762
  <path d="M14 2v5a1 1 0 0 0 1 1h5" />
662
763
  <path d="m14.5 12.5-5 5" />
663
764
  <path d="m9.5 12.5 5 5" />
664
- </svg>`,filter:"404: Not Found",folder:`<svg
765
+ </svg>`,folder:`<svg
665
766
  xmlns="http://www.w3.org/2000/svg"
666
767
  width="24"
667
768
  height="24"
@@ -673,6 +774,18 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
673
774
  stroke-linejoin="round"
674
775
  >
675
776
  <path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" />
777
+ </svg>`,funnel:`<svg
778
+ xmlns="http://www.w3.org/2000/svg"
779
+ width="24"
780
+ height="24"
781
+ viewBox="0 0 24 24"
782
+ fill="none"
783
+ stroke="currentColor"
784
+ stroke-width="2"
785
+ stroke-linecap="round"
786
+ stroke-linejoin="round"
787
+ >
788
+ <path d="M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" />
676
789
  </svg>`,globe:`<svg
677
790
  xmlns="http://www.w3.org/2000/svg"
678
791
  width="24"
@@ -702,7 +815,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
702
815
  <line x1="4" x2="20" y1="15" y2="15" />
703
816
  <line x1="10" x2="8" y1="3" y2="21" />
704
817
  <line x1="16" x2="14" y1="3" y2="21" />
705
- </svg>`,"help-circle":"404: Not Found","image-plus":`<svg
818
+ </svg>`,"image-plus":`<svg
706
819
  xmlns="http://www.w3.org/2000/svg"
707
820
  width="24"
708
821
  height="24"
@@ -1003,6 +1116,19 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1003
1116
  >
1004
1117
  <rect x="14" y="3" width="5" height="18" rx="1" />
1005
1118
  <rect x="5" y="3" width="5" height="18" rx="1" />
1119
+ </svg>`,pencil:`<svg
1120
+ xmlns="http://www.w3.org/2000/svg"
1121
+ width="24"
1122
+ height="24"
1123
+ viewBox="0 0 24 24"
1124
+ fill="none"
1125
+ stroke="currentColor"
1126
+ stroke-width="2"
1127
+ stroke-linecap="round"
1128
+ stroke-linejoin="round"
1129
+ >
1130
+ <path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" />
1131
+ <path d="m15 5 4 4" />
1006
1132
  </svg>`,phone:`<svg
1007
1133
  xmlns="http://www.w3.org/2000/svg"
1008
1134
  width="24"
@@ -1272,7 +1398,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1272
1398
  <path d="M20 12h2" />
1273
1399
  <path d="m6.34 17.66-1.41 1.41" />
1274
1400
  <path d="m19.07 4.93-1.41 1.41" />
1275
- </svg>`,telegram:"404: Not Found","thumbs-down":`<svg
1401
+ </svg>`,"thumbs-down":`<svg
1276
1402
  xmlns="http://www.w3.org/2000/svg"
1277
1403
  width="24"
1278
1404
  height="24"
@@ -1283,8 +1409,8 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1283
1409
  stroke-linecap="round"
1284
1410
  stroke-linejoin="round"
1285
1411
  >
1286
- <path d="M17 14V2" />
1287
1412
  <path d="M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z" />
1413
+ <path d="M17 14V2" />
1288
1414
  </svg>`,"thumbs-up":`<svg
1289
1415
  xmlns="http://www.w3.org/2000/svg"
1290
1416
  width="24"
@@ -1296,8 +1422,8 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1296
1422
  stroke-linecap="round"
1297
1423
  stroke-linejoin="round"
1298
1424
  >
1299
- <path d="M7 10v12" />
1300
1425
  <path d="M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z" />
1426
+ <path d="M7 10v12" />
1301
1427
  </svg>`,"trash-2":`<svg
1302
1428
  xmlns="http://www.w3.org/2000/svg"
1303
1429
  width="24"
@@ -1425,7 +1551,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1425
1551
  <path d="m2 2 20 20" />
1426
1552
  <path d="m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11" />
1427
1553
  <path d="M9.828 4.172A.686.686 0 0 1 11 4.657v.686" />
1428
- </svg>`,whatsapp:"404: Not Found",x:`<svg
1554
+ </svg>`,x:`<svg
1429
1555
  xmlns="http://www.w3.org/2000/svg"
1430
1556
  width="24"
1431
1557
  height="24"
@@ -1463,150 +1589,27 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1463
1589
  stroke-linejoin="round"
1464
1590
  >
1465
1591
  <path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z" />
1466
- </svg>`};var $r=class t extends HTMLElement{static observedAttributes=["name","fill","stroke"];constructor(){super(),this.attachShadow({mode:"open"})}attributeChangedCallback(e,r,n){if(r!==n&&t.observedAttributes.includes(e)){switch(e){case"name":this.name=n||"";break;case"fill":this.fill=n||"none";break;case"stroke":this.stroke=n||"currentColor";break}this.render()}}resolveIcon(e){throw new Error("Not implemented")}render(){let e=document.createElement("style");if(e.textContent=`
1592
+ </svg>`};var jr=class t extends HTMLElement{static observedAttributes=["name","fill","stroke"];constructor(){super(),this.attachShadow({mode:"open"})}attributeChangedCallback(e,r,i){if(r!==i&&t.observedAttributes.includes(e)){switch(e){case"name":this.name=i||"";break;case"fill":this.fill=i||"none";break;case"stroke":this.stroke=i||"currentColor";break}this.render()}}resolveIcon(e){throw new Error("Not implemented")}render(){let e=document.createElement("style");if(e.textContent=`
1467
1593
  :host {
1468
1594
  display: inline-block;
1469
1595
  line-height: 0;
1470
1596
  }
1471
- `,this.shadowRoot){for(;this.shadowRoot.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild);this.shadowRoot.appendChild(e)}if(!this.name)return;let r=this.resolveIcon(this.name);if(!r){console.warn(`'${this.name}' not found, please add it to ${t.name}`);return}let s=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;s.setAttribute("fill",this.fill),s.setAttribute("stroke",this.stroke),s.style.width="100%",s.style.height="100%",this.shadowRoot?.appendChild(s)}name="";fill="none";stroke="currentColor"};var kc=To,ci=class extends $r{resolveIcon(e){return kc[e]}};customElements.get("lucide-icon")||customElements.define("lucide-icon",ci);var De=class t extends C(v){static properties={color:{type:String},disabled:{type:Boolean},placeholder:{type:String},dark:{type:Boolean},_inputValue:{type:String,state:!0}};constructor(){super(),this.color="#8B5CF6",this.disabled=!1,this.placeholder="Ask AI...",this.dark=!1,this._inputValue=""}#e=new Date;#t(e){let r=e.target;this._inputValue=r.value,this.dispatchEvent(new t.ChangeEvent({value:this._inputValue}))}render(){return d`
1472
- <mw-spinning-border
1473
- .size=${"420px"}
1474
- .color=${this.color||"#8B5CF6"}
1475
- .radius=${"24px"}
1476
- ?dark-mode="${this.dark}"
1477
- class="${this.dark?"dark":""} rounded-[24px] font-sans text-sm shadow-lg transition-transform duration-500 hover:scale-105">
1478
- <form
1479
- @submit="${this.#r}"
1480
- class="m-[1px] flex w-[250px] items-center rounded-[24px] bg-white px-2 py-2 text-gray-800 transition-all duration-500 focus-within:w-[calc(100vw-2rem)] focus-within:scale-100 active:w-[calc(100vw-2rem)] md:focus-within:w-[350px] md:active:w-[350px] dark:bg-gray-900 dark:text-white">
1481
- <lucide-icon class="h-5 w-5 flex-none text-[${this.color||"#8B5CF6"}]" name="${"sparkles"}"></lucide-icon>
1482
-
1483
- <input
1484
- ?disabled="${this.disabled}"
1485
- @keydown="${this.#s}"
1486
- @input="${this.#t}"
1487
- .value="${this._inputValue}"
1488
- placeholder="${this.placeholder}"
1489
- autocomplete="off"
1490
- name="input"
1491
- class="ml-2 w-full bg-transparent text-gray-800 placeholder:font-light placeholder:text-gray-500 focus:outline-none dark:text-white dark:placeholder:text-gray-400" />
1492
-
1493
- <!-- submit button -->
1494
- <button
1495
- ?disabled="${this.disabled||!this._inputValue.trim()}"
1496
- class="${this.dark?"text-gray-800":"text-white"} relative ml-2 h-8 w-8 flex-none rounded-full bg-[${this.color||"#8B5CF6"}] p-0 hover:opacity-70 disabled:bg-gray-400 disabled:text-gray-300 disabled:hover:opacity-100"
1497
- type="submit">
1498
- <div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2">
1499
- <lucide-icon class="${this.dark?"text-gray-800":"text-white"} block h-5 w-5" name="${"arrow-up"}"></lucide-icon>
1500
- </div>
1501
- </button>
1502
- </form>
1503
- </mw-spinning-border>
1504
- `}#r(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;this.#e=r;let i=this._inputValue.trim();i&&this.dispatchEvent(new t.SubmitInputEvent({text:i}))&&(this._inputValue="")}get#n(){return this.renderRoot.querySelector('input[name="input"]')??null}get#i(){return this.renderRoot.querySelector('button[type="submit"]')??null}#s(e){Cc(e)&&(e.preventDefault(),this.disabled||this.#i?.click())}};De.SubmitInputEvent=class extends CustomEvent{static type="mw-floating-ask-ai:submit";constructor(e,r={}){super(De.SubmitInputEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};De.ChangeEvent=class extends CustomEvent{static type="mw-floating-ask-ai:change";constructor(e,r={}){super(De.ChangeEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};function Cc(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-floating-ask-ai")||customElements.define("mw-floating-ask-ai",De);var _r={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Mr=t=>(...e)=>({_$litDirective$:t,values:e}),tt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var{I:Sc}=hs;var Lo=()=>document.createComment(""),rt=(t,e,r)=>{let n=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(r===void 0){let s=n.insertBefore(Lo(),i),o=n.insertBefore(Lo(),i);r=new Sc(s,o,t,t.options)}else{let s=r._$AB.nextSibling,o=r._$AM,a=o!==t;if(a){let l;r._$AQ?.(t),r._$AM=t,r._$AP!==void 0&&(l=t._$AU)!==o._$AU&&r._$AP(l)}if(s!==i||a){let l=r._$AA;for(;l!==s;){let c=l.nextSibling;n.insertBefore(l,i),l=c}}}return r},ve=(t,e,r=t)=>(t._$AI(e,r),t),Ec={},jo=(t,e=Ec)=>t._$AH=e,Do=t=>t._$AH,Ir=t=>{t._$AR(),t._$AA.remove()};var Oo=(t,e,r)=>{let n=new Map;for(let i=e;i<=r;i++)n.set(t[i],i);return n},Q=Mr(class extends tt{constructor(t){if(super(t),t.type!==_r.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,r){let n;r===void 0?r=e:e!==void 0&&(n=e);let i=[],s=[],o=0;for(let a of t)i[o]=n?n(a,o):o,s[o]=r(a,o),o++;return{values:s,keys:i}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,n]){let i=Do(t),{values:s,keys:o}=this.dt(e,r,n);if(!Array.isArray(i))return this.ut=o,s;let a=this.ut??=[],l=[],c,u,h=0,p=i.length-1,g=0,f=s.length-1;for(;h<=p&&g<=f;)if(i[h]===null)h++;else if(i[p]===null)p--;else if(a[h]===o[g])l[g]=ve(i[h],s[g]),h++,g++;else if(a[p]===o[f])l[f]=ve(i[p],s[f]),p--,f--;else if(a[h]===o[f])l[f]=ve(i[h],s[f]),rt(t,l[f+1],i[h]),h++,f--;else if(a[p]===o[g])l[g]=ve(i[p],s[g]),rt(t,i[h],i[p]),p--,g++;else if(c===void 0&&(c=Oo(o,g,f),u=Oo(a,h,p)),c.has(a[h]))if(c.has(a[p])){let S=u.get(o[g]),b=S!==void 0?i[S]:null;if(b===null){let E=rt(t,i[h]);ve(E,s[g]),l[g]=E}else l[g]=ve(b,s[g]),rt(t,i[h],b),i[S]=null;g++}else Ir(i[p]),p--;else Ir(i[h]),h++;for(;g<=f;){let S=rt(t,l[f+1]);ve(S,s[g]),l[g++]=S}for(;h<=p;){let S=i[h++];S!==null&&Ir(S)}return this.ut=o,jo(t,l),te}});var Tt=class t extends C(v){static properties={examples:{type:Object},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.examples={title:"",items:[]},this.color="",this.darkMode=!1}render(){return!this.examples?.title&&!this.examples?.items?.length?null:d`
1505
- <div class="${this.darkMode?"dark":""} flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pt-6 pb-2">
1506
- ${this.examples.title?d`
1507
- <h2 class="mt-14 px-2 pt-9 pb-2 text-left text-3xl leading-tight font-bold tracking-tight text-black dark:text-white">
1508
- <span>${this.examples.title}</span>
1509
- <svg class="inline-block h-9 w-9 align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 58 61">
1510
- <path
1511
- fill="${this.darkMode?"#6B7280":"#D2D2D2"}"
1512
- d="M23.503 12.319c.298-.925 1.605-.925 1.903 0L29.751 25.8a1 1 0 0 0 .695.66l14.515 3.852c.99.263.99 1.67 0 1.933l-14.515 3.852a1 1 0 0 0-.695.66l-4.345 13.483c-.297.924-1.605.924-1.903 0l-4.345-13.483a1 1 0 0 0-.695-.66L3.949 32.246c-.992-.263-.992-1.67 0-1.933l14.514-3.852a1 1 0 0 0 .695-.66l4.345-13.482ZM45.279 2.115c.134-.492.831-.492.965 0l1.688 6.206a.5.5 0 0 0 .373.357l6.642 1.488c.521.117.521.86 0 .976l-6.642 1.488a.5.5 0 0 0-.373.357l-1.688 6.206c-.134.492-.831.492-.965 0l-1.688-6.206a.5.5 0 0 0-.373-.357l-6.642-1.488c-.521-.117-.521-.86 0-.976l6.642-1.488a.5.5 0 0 0 .373-.357l1.688-6.206ZM45.279 42.077c.134-.492.831-.492.965 0l1.688 6.206a.5.5 0 0 0 .373.357l6.642 1.488c.521.117.521.86 0 .976l-6.642 1.488a.5.5 0 0 0-.373.357l-1.688 6.206c-.134.492-.831.492-.965 0l-1.688-6.206a.5.5 0 0 0-.373-.357l-6.642-1.488c-.521-.117-.521-.86 0-.976l6.642-1.488a.5.5 0 0 0 .373-.357l1.688-6.206Z" />
1513
- </svg>
1514
- </h2>
1515
- `:null}
1516
- ${this.examples?.items?.length?d`
1517
- <ul class="mt-auto flex flex-wrap justify-end gap-2.5 text-sm leading-6 text-black select-none dark:text-white">
1518
- ${Q(this.examples.items,e=>e,e=>d`
1519
- <li
1520
- class="my-auto inline-block cursor-pointer rounded-2xl border-1 border-gray-300 px-4 py-2 text-left transition-all duration-200 hover:-translate-y-0.5 hover:bg-[${this.color}]/[0.08] hover:opacity-80 hover:shadow dark:border-gray-600"
1521
- @click="${()=>this.#e(e)}">
1522
- <span>${e.trim()}</span>
1523
- </li>
1524
- `)}
1525
- </ul>
1526
- `:null}
1527
- </div>
1528
- `}#e(e){this.dispatchEvent(new t.ExampleClickEvent({example:e}))}};Tt.ExampleClickEvent=class extends CustomEvent{static type="mw:example-click";constructor(e,r={}){super(Tt.ExampleClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-background")||customElements.define("mw-chat-background",Tt);var Oe=class t extends C(v){static properties={content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1,this.darkMode=!1}static styles=j`
1529
- /* blurred background */
1530
-
1531
- [part='gradient-blur'] {
1532
- /* blur gradient */
1533
- mask-image: linear-gradient(to bottom, white 70%, transparent);
1534
- -webkit-mask-image: linear-gradient(to bottom, white 70%, transparent);
1535
- backdrop-filter: blur(2px);
1536
-
1537
- /* bg-color gradient */
1538
- background-image: linear-gradient(to bottom, white 20%, transparent);
1539
- }
1540
-
1541
- .dark [part='gradient-blur'] {
1542
- /* bg-color gradient for dark mode */
1543
- background-image: linear-gradient(to bottom, #2b2d31 20%, transparent);
1544
- }
1545
- `;render(){return d`
1546
- <div class="${this.darkMode?"dark":""} relative z-10 h-12">
1547
- <div part="gradient-blur" class="absolute inset-x-0.5 mt-2 h-12"></div>
1548
-
1549
- <div class="absolute inset-0 h-12 overflow-hidden rounded-full">
1550
- <svg class="absolute left-1/2 -translate-x-1/2 text-[${this.content.color}]/80" width="1000" height="48" viewBox="0 0 1000 48" fill="none" xmlns="http://www.w3.org/2000/svg">
1551
- <path
1552
- d="M0 0V48H448C459.674 47.8029 468.846 37.4168 476.669 28.559L476.764 28.4508C482.429 22.0372 490.665 18 499.833 18C509.002 18 517.239 22.0372 522.903 28.4508L522.998 28.559C530.895 37.5009 540.167 48 552 48H1000V0H0Z"
1553
- fill="currentColor" />
1554
- </svg>
1555
- </div>
1556
-
1557
- <div class="absolute inset-0 px-4 py-3">
1558
- <!-- title + buttons -->
1559
- <!-- h-6 keeps the same height as the right buttons to stop the text jitter when they become visible -->
1560
- <div class="z-10 flex h-6 items-center gap-3">
1561
- <!-- TODO: line-clamp-2 -->
1562
- <h1 class="line-clamp-2 max-w-[40%] leading-tight font-semibold tracking-tight text-white dark:text-white">${this.content.title}</h1>
1563
-
1564
- <!-- spacer to push other elements to the sides -->
1565
- <div class="flex-grow"></div>
1566
-
1567
- <!-- new chat btn -->
1568
- <button @click=${this.#e} type="button" class="${this.showNewChat?"inline-flex":"hidden"} shrink-0">
1569
- <!-- svg icon of a bubble with a plus -->
1570
- <svg class="h-6 w-6 fill-white dark:fill-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 37 36">
1571
- <path
1572
- fill-rule="evenodd"
1573
- d="M36.201 17.62c0 10.996-6.18 17.181-17.17 17.181-3.236 0-6.055-.536-8.422-1.574l-8.084 2.697c-1.136.379-2.206-.722-1.797-1.848l2.823-7.77c-1.113-2.42-1.69-5.33-1.69-8.687C1.862 6.623 8.044.438 19.032.438c10.99 0 17.17 6.185 17.17 17.181Zm-15.88-8.653a1.355 1.355 0 0 0-2.71 0v7.897H9.716a1.355 1.355 0 1 0 0 2.71h7.897v7.896a1.355 1.355 0 1 0 2.71 0v-7.896h7.896a1.355 1.355 0 1 0 0-2.71h-7.896V8.967Z"
1574
- clip-rule="evenodd" />
1575
- </svg>
1576
- </button>
1577
-
1578
- <!-- close chat btn -->
1579
- <button @click=${this.#t} class="${this.showClose?"inline-flex":"hidden"} shrink-0">
1580
- <!-- svg icon of an X -->
1581
- <svg class="h-6 w-6 stroke-white dark:stroke-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2">
1582
- <path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
1583
- </svg>
1584
- </button>
1585
- </div>
1586
-
1587
- <!-- logo -->
1588
- <div class="absolute top-1/2 left-1/2 z-10 -mt-0.5 -translate-x-1/2">
1589
- <!-- when injected from the dashboard, it's a base64 string data:image format -->
1590
- <img class="inline-block h-[52px] w-[52px] rounded-full bg-white object-cover dark:bg-gray-700" src="${this.content.logoUrl}" alt="Logo" />
1591
- </div>
1592
- </div>
1593
- </div>
1594
- `}#e(){this.dispatchEvent(new t.NewChatClickEvent)}#t(){this.dispatchEvent(new t.CloseClickEvent)}};Oe.NewChatClickEvent=class extends CustomEvent{static type="mw:new-chat-click";constructor(e={}){super(Oe.NewChatClickEvent.type,{...e})}};Oe.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(Oe.CloseClickEvent.type,{...e})}};customElements.get("mw-chat-header")||customElements.define("mw-chat-header",Oe);var qo=sn(Bo(),1);var le=Object.freeze({PENDING:"pending",READY:"ready",ERROR:"error"}),Lr=class{#e;#t;#r=null;#n=!1;#i=null;#s=[];constructor(e,r){this.#e=e,this.#t={acceptedTypes:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/heic"],maxFileSize:10*1024*1024,maxFiles:3,onError:()=>{},enabled:!0,isConnected:()=>!1,onConnect:()=>{},...r},e.addController(this),this.#l()}hostDisconnected(){this.#a(),this.#c(),this.#r&&this.#r.parentNode&&this.#r.parentNode.removeChild(this.#r)}#o(){this.#t.enabled&&(this.#e.addEventListener("dragover",this.#m),this.#e.addEventListener("dragenter",this.#v),this.#e.addEventListener("dragleave",this.#b),this.#e.addEventListener("drop",this.#x))}#a(){this.#e.removeEventListener("dragover",this.#m),this.#e.removeEventListener("dragenter",this.#v),this.#e.removeEventListener("dragleave",this.#b),this.#e.removeEventListener("drop",this.#x)}#d(){this.#t.enabled&&this.#e.addEventListener("paste",this.#w)}#c(){this.#e.removeEventListener("paste",this.#w)}#l(){this.#r=document.createElement("input"),this.#r.type="file",this.#r.accept=this.#t.acceptedTypes.join(","),this.#r.multiple=this.#t.maxFiles>1,this.#r.style.display="none",this.#r.addEventListener("change",this.#h),document.body.appendChild(this.#r)}#h=e=>{let r=e.target,n=Array.from(r.files||[]);this.#t.isConnected()||this.#t.onConnect?.(),this.#p(n),r.value=""};#m=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")};#v=e=>{e.preventDefault(),e.dataTransfer&&this.#y(e.dataTransfer)&&this.#g(!0)};#b=e=>{e.preventDefault();let r=e.relatedTarget;this.#e.contains(r)||this.#g(!1)};#x=e=>{if(e.preventDefault(),this.#g(!1),e.dataTransfer){let r=Array.from(e.dataTransfer.files||[]);this.#p(r)}};#w=e=>{if(!e.clipboardData)return;let n=Array.from(e.clipboardData.items||[]).filter(s=>s.type.startsWith("image/"));if(n.length===0)return;e.preventDefault();let i=n.map(s=>s.getAsFile()).flatMap(s=>s?[s]:[]);this.#p(i)};#y(e){return e.types&&e.types.includes("Files")}#g(e){this.#n!==e&&(this.#n=e,this.#e.requestUpdate())}#u(e){this.#i=e,this.#t.onError(e),this.#e.requestUpdate(),setTimeout(()=>{this.#k()},6e3)}#k(){this.#i=null,this.#e.requestUpdate()}async#p(e){if(e.length===0)return;this.#k();let r=e.filter(o=>this.#C(o));if(r.length===0)return;let n=this.#s.length,i=this.#t.maxFiles??1/0,s=r.length;if(n+s>i){this.#u(`You can upload a maximum of ${i} files`);return}try{let a=(await Promise.all(r.map(l=>this.#S(l)))).filter(l=>!this.#s.some(c=>c.dataUrl===l.dataUrl));this.#s=[...this.#s,...a],this.#e.requestUpdate(),await xn({times:5,delay:2e3},async()=>{if(this.#t.isConnected())await bn(3,a,async l=>{await this.#f(l)});else throw new Error("Not connected yet")}),this.#e.requestUpdate()}catch(o){console.error("Failed to process and upload images:",o),this.#u("Upload failed")}}#C(e){return this.#t.acceptedTypes.includes(e.type)?e.size>this.#t.maxFileSize?(this.#u(`Max file size: ${this.#t.maxFileSize/(1024*1024)}MB`),!1):!0:(this.#u("Invalid file type"),!1)}async#S(e){try{let r=await(0,qo.fileToBase64)(e);return{id:crypto.randomUUID(),name:e.name,type:e.type,size:e.size,dataUrl:r,file:e,processingState:le.PENDING}}catch(r){let n=r instanceof Error?r:new Error(String(r));throw new Error(`Failed to read file: ${e.name} - ${n.message}`)}}async#f(e){if(!e){console.error("No image provided to upload"),this.#u("No image provided");return}if(!this.#t?.uploadUrl){console.error("Missing uploadUrl in options"),this.#u("Upload URL not configured");return}e.processingState=le.PENDING,this.#e.requestUpdate();let r=new FormData;r.append("file",e.file),r.append("imageId",e.id),r.append("role",this.#t.role||"user"),this.#t.conversationId&&r.append("conversationId",this.#t.conversationId),this.#t.widgetId&&r.append("widgetId",this.#t.widgetId);try{let n=await fetch(this.#t.uploadUrl,{method:"POST",body:r});if(!n.ok)throw new Error(`Upload failed with status: ${n.status}`);let i=await n.json();if(!!!i?.success){let o=i?.error||"Upload failed";throw new Error(o)}i.imageUrl&&i.imageId?(e.imageUrl=i.imageUrl,e.id=i.imageId,e.processingState=le.READY):e.processingState=le.PENDING,this.#e.requestUpdate()}catch(n){let i=n instanceof Error?n:new Error(String(n));console.error("Upload error:",i.message),this.#u(i.message),e.processingState=le.ERROR,this.#e.requestUpdate()}}get isDragging(){return this.#n}get error(){return this.#i}get selectedImages(){return this.#s}get hasPendingImages(){return this.#s.some(e=>e.processingState===le.PENDING)}openImagePicker=()=>{if(!this.#t.enabled||!this.#t.widgetId){console.warn("Image uploads are disabled");return}this.#r&&this.#r.click()};clearError(){this.#k()}updateUploadOptions(e){e.conversationId!==void 0&&(this.#t.conversationId=e.conversationId),e.widgetId!==void 0&&(this.#t.widgetId=e.widgetId),e.enabled!==void 0&&(this.#t.enabled=!!e.enabled),e.isConnected!==void 0&&(this.#t.isConnected=e.isConnected),e.onConnect!==void 0&&(this.#t.onConnect=e.onConnect),this.#t.enabled?(this.#o(),this.#d()):(this.#a(),this.#c())}restoreImages(e){if(!Array.isArray(e)||e.length===0){this.#s=[],this.#e.requestUpdate();return}let r=e.map(n=>{let i=new File([],n.name,{type:n.type});return{id:n.id,name:n.name,type:n.type,size:n.size,dataUrl:n.url,file:i,processingState:le.READY,imageUrl:n.url}});this.#s=r,this.#e.requestUpdate()}clearImages(){this.#s=[],this.clearError(),this.#e.requestUpdate()}onImageDelete=e=>{this.#t.onImageDelete&&this.#t.onImageDelete(e),this.#s=this.#s.filter(r=>r.id!==e),this.#k(),this.#e.requestUpdate()}};var pi={maxHeight:120,initialHeight:32,paddingY:12},K=class t extends C(v){static properties={disabled:{type:Boolean},streaming:{type:Boolean},loading:{type:Boolean},placeholder:{type:String},color:{type:String},enableImageUpload:{type:Boolean},darkMode:{type:Boolean,attribute:"dark-mode"},images:{type:Array}};#e=new Date;constructor(){super(),this.disabled=!1,this.streaming=!1,this.loading=!1,this.placeholder="Type a message...",this.enableImageUpload=!1,this.darkMode=!1,this.images=[],this.color="#8B5CF6"}get value(){return this.#t?.value?.trim()??""}render(){let e=this.streaming||this.loading||!this.value&&(!this.enableImageUpload||this.images.length===0);return d`
1597
+ `,this.shadowRoot){for(;this.shadowRoot.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild);this.shadowRoot.appendChild(e)}if(!this.name)return;let r=this.resolveIcon(this.name);if(!r){console.warn(`'${this.name}' not found, please add it to ${t.name}`);return}let s=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;s.setAttribute("fill",this.fill),s.setAttribute("stroke",this.stroke),s.style.width="100%",s.style.height="100%",this.shadowRoot?.appendChild(s)}name="";fill="none";stroke="currentColor"};var Mc=Bo,hn=class extends jr{resolveIcon(e){return Mc[e]}};customElements.get("lucide-icon")||customElements.define("lucide-icon",hn);var Ho=ai(No(),1);var ue=Object.freeze({PENDING:"pending",READY:"ready",ERROR:"error"}),Or=class{#e;#t;#r=null;#i=!1;#n=null;#s=[];constructor(e,r){this.#e=e,this.#t={acceptedTypes:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/heic"],maxFileSize:10*1024*1024,maxFiles:3,onError:()=>{},enabled:!0,isConnected:()=>!1,onConnect:()=>{},...r},e.addController(this),this.#l()}hostDisconnected(){this.#a(),this.#c(),this.#r&&this.#r.parentNode&&this.#r.parentNode.removeChild(this.#r)}#o(){this.#t.enabled&&(this.#e.addEventListener("dragover",this.#m),this.#e.addEventListener("dragenter",this.#v),this.#e.addEventListener("dragleave",this.#b),this.#e.addEventListener("drop",this.#x))}#a(){this.#e.removeEventListener("dragover",this.#m),this.#e.removeEventListener("dragenter",this.#v),this.#e.removeEventListener("dragleave",this.#b),this.#e.removeEventListener("drop",this.#x)}#d(){this.#t.enabled&&this.#e.addEventListener("paste",this.#w)}#c(){this.#e.removeEventListener("paste",this.#w)}#l(){this.#r=document.createElement("input"),this.#r.type="file",this.#r.accept=this.#t.acceptedTypes.join(","),this.#r.multiple=this.#t.maxFiles>1,this.#r.style.display="none",this.#r.addEventListener("change",this.#h),document.body.appendChild(this.#r)}#h=e=>{let r=e.target,i=Array.from(r.files||[]);this.#t.isConnected()||this.#t.onConnect?.(),this.#p(i),r.value=""};#m=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")};#v=e=>{e.preventDefault(),e.dataTransfer&&this.#y(e.dataTransfer)&&this.#g(!0)};#b=e=>{e.preventDefault();let r=e.relatedTarget;this.#e.contains(r)||this.#g(!1)};#x=e=>{if(e.preventDefault(),this.#g(!1),e.dataTransfer){let r=Array.from(e.dataTransfer.files||[]);this.#p(r)}};#w=e=>{if(!e.clipboardData)return;let i=Array.from(e.clipboardData.items||[]).filter(s=>s.type.startsWith("image/"));if(i.length===0)return;e.preventDefault();let n=i.map(s=>s.getAsFile()).flatMap(s=>s?[s]:[]);this.#p(n)};#y(e){return e.types&&e.types.includes("Files")}#g(e){this.#i!==e&&(this.#i=e,this.#e.requestUpdate())}#u(e){this.#n=e,this.#t.onError(e),this.#e.requestUpdate(),setTimeout(()=>{this.#k()},6e3)}#k(){this.#n=null,this.#e.requestUpdate()}async#p(e){if(e.length===0)return;this.#k();let r=e.filter(o=>this.#C(o));if(r.length===0)return;let i=this.#s.length,n=this.#t.maxFiles??1/0,s=r.length;if(i+s>n){this.#u(`You can upload a maximum of ${n} files`);return}try{let a=(await Promise.all(r.map(l=>this.#_(l)))).filter(l=>!this.#s.some(c=>c.dataUrl===l.dataUrl));this.#s=[...this.#s,...a],this.#e.requestUpdate(),await Ci({times:5,delay:2e3},async()=>{if(this.#t.isConnected())await ki(3,a,async l=>{await this.#f(l)});else throw new Error("Not connected yet")}),this.#e.requestUpdate()}catch(o){console.error("Failed to process and upload images:",o),this.#u("Upload failed")}}#C(e){return this.#t.acceptedTypes.includes(e.type)?e.size>this.#t.maxFileSize?(this.#u(`Max file size: ${this.#t.maxFileSize/(1024*1024)}MB`),!1):!0:(this.#u("Invalid file type"),!1)}async#_(e){try{let r=await(0,Ho.fileToBase64)(e);return{id:crypto.randomUUID(),name:e.name,type:e.type,size:e.size,dataUrl:r,file:e,processingState:ue.PENDING}}catch(r){let i=r instanceof Error?r:new Error(String(r));throw new Error(`Failed to read file: ${e.name} - ${i.message}`)}}async#f(e){if(!e){console.error("No image provided to upload"),this.#u("No image provided");return}if(!this.#t?.uploadUrl){console.error("Missing uploadUrl in options"),this.#u("Upload URL not configured");return}e.processingState=ue.PENDING,this.#e.requestUpdate();let r=new FormData;r.append("file",e.file),r.append("imageId",e.id),r.append("role",this.#t.role||"user"),this.#t.conversationId&&r.append("conversationId",this.#t.conversationId),this.#t.widgetId&&r.append("widgetId",this.#t.widgetId);try{let i=await fetch(this.#t.uploadUrl,{method:"POST",body:r});if(!i.ok)throw new Error(`Upload failed with status: ${i.status}`);let n=await i.json();if(!!!n?.success){let o=n?.error||"Upload failed";throw new Error(o)}n.imageUrl&&n.imageId?(e.imageUrl=n.imageUrl,e.id=n.imageId,e.processingState=ue.READY):e.processingState=ue.PENDING,this.#e.requestUpdate()}catch(i){let n=i instanceof Error?i:new Error(String(i));console.error("Upload error:",n.message),this.#u(n.message),e.processingState=ue.ERROR,this.#e.requestUpdate()}}get isDragging(){return this.#i}get error(){return this.#n}get selectedImages(){return this.#s}get hasPendingImages(){return this.#s.some(e=>e.processingState===ue.PENDING)}openImagePicker=()=>{if(!this.#t.enabled||!this.#t.widgetId){console.warn("Image uploads are disabled");return}this.#r&&this.#r.click()};clearError(){this.#k()}updateUploadOptions(e){e.conversationId!==void 0&&(this.#t.conversationId=e.conversationId),e.widgetId!==void 0&&(this.#t.widgetId=e.widgetId),e.enabled!==void 0&&(this.#t.enabled=!!e.enabled),e.isConnected!==void 0&&(this.#t.isConnected=e.isConnected),e.onConnect!==void 0&&(this.#t.onConnect=e.onConnect),this.#t.enabled?(this.#o(),this.#d()):(this.#a(),this.#c())}restoreImages(e){if(!Array.isArray(e)||e.length===0){this.#s=[],this.#e.requestUpdate();return}let r=e.map(i=>{let n=new File([],i.name,{type:i.type});return{id:i.id,name:i.name,type:i.type,size:i.size,dataUrl:i.url,file:n,processingState:ue.READY,imageUrl:i.url}});this.#s=r,this.#e.requestUpdate()}clearImages(){this.#s=[],this.clearError(),this.#e.requestUpdate()}onImageDelete=e=>{this.#t.onImageDelete&&this.#t.onImageDelete(e),this.#s=this.#s.filter(r=>r.id!==e),this.#k(),this.#e.requestUpdate()}};var gn={maxHeight:120,initialHeight:32,paddingY:12},ee=class t extends k(v){static properties={disabled:{type:Boolean},streaming:{type:Boolean},loading:{type:Boolean},placeholder:{type:String},color:{type:String},enableImageUpload:{type:Boolean},darkMode:{type:Boolean,attribute:"dark-mode"},images:{type:Array}};#e=new Date;constructor(){super(),this.disabled=!1,this.streaming=!1,this.loading=!1,this.placeholder="Type a message...",this.enableImageUpload=!1,this.darkMode=!1,this.images=[],this.color="#8B5CF6"}get value(){return this.#t?.value?.trim()??""}render(){let e=this.streaming||this.loading||!this.value&&(!this.enableImageUpload||this.images.length===0);return u`
1595
1598
  <div
1596
1599
  class="${this.darkMode?"dark bg-[#1E1F23]":"bg-white"} ${this.enableImageUpload&&this.images.length>0?`ring-2 ring-[${this.color}] ring-opacity-50`:""} focus-within:ring-opacity-50 w-full overflow-hidden rounded-[18px] shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)] transition-all duration-200 focus-within:ring-2 focus-within:ring-[${this.color}]">
1597
1600
  <!-- Image preview area -->
1598
- ${this.enableImageUpload&&this.images&&this.images.length>0?d`
1601
+ ${this.enableImageUpload&&this.images&&this.images.length>0?u`
1599
1602
  <div class="mb-2 flex flex-wrap gap-2 rounded-t-[18px] p-2">
1600
- ${this.images.map(r=>d`
1603
+ ${this.images.map(r=>u`
1601
1604
  <div class="relative inline-block">
1602
1605
  <img src="${r.dataUrl}" alt="${r.name}" class="h-[60px] w-[60px] rounded-xl object-cover" />
1603
1606
 
1604
1607
  <!-- Progress/Status overlay -->
1605
- ${r.processingState===le.PENDING?d`
1608
+ ${r.processingState===ue.PENDING?u`
1606
1609
  <div class="absolute inset-0 flex items-center justify-center rounded-xl bg-black/40">
1607
1610
  <lucide-icon name="loader-circle" class="inline-flex h-6 w-6 animate-spin text-white transition-all duration-1000"></lucide-icon>
1608
1611
  </div>
1609
- `:r.processingState===le.ERROR?d`
1612
+ `:r.processingState===ue.ERROR?u`
1610
1613
  <div class="absolute inset-0 flex items-center justify-center rounded-xl bg-red-500/60">
1611
1614
  <lucide-icon name="badge-alert" class="h-6 w-6 text-white"></lucide-icon>
1612
1615
  </div>
@@ -1626,8 +1629,8 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1626
1629
  `:null}
1627
1630
 
1628
1631
  <!-- Input form -->
1629
- <form @submit="${this.#i}" class="flex w-full items-center">
1630
- ${this.enableImageUpload?d`
1632
+ <form @submit="${this.#n}" class="flex w-full items-center">
1633
+ ${this.enableImageUpload?u`
1631
1634
  <button
1632
1635
  data-testid="image-upload-btn"
1633
1636
  type="button"
@@ -1642,11 +1645,12 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1642
1645
  data-testid="mw-chat-input-textarea"
1643
1646
  name="input"
1644
1647
  @input="${this.#s}"
1645
- @keydown="${this.#n}"
1648
+ @keydown="${this.#i}"
1646
1649
  autofocus
1647
1650
  ?disabled="${this.disabled}"
1651
+ maxlength="1000"
1648
1652
  placeholder="${this.placeholder}"
1649
- class="${this.enableImageUpload?"px-1":"pl-3 pr-1"} box-content h-[${pi.initialHeight}px] w-full resize-none place-content-center rounded bg-transparent py-[${pi.paddingY}px] text-base text-gray-800 outline-none placeholder:text-[14px] placeholder:font-light disabled:place-content-baseline dark:text-gray-200"></textarea>
1653
+ class="${this.enableImageUpload?"px-1":"pl-3 pr-1"} box-content h-[${gn.initialHeight}px] w-full resize-none place-content-center rounded bg-transparent py-[${gn.paddingY}px] text-base text-gray-800 outline-none placeholder:text-[14px] placeholder:font-light disabled:place-content-baseline dark:text-gray-200"></textarea>
1650
1654
 
1651
1655
  <button
1652
1656
  type="submit"
@@ -1655,7 +1659,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1655
1659
  class="mx-1 rounded-full px-2 transition-all duration-150 ease-out disabled:cursor-not-allowed disabled:opacity-50">
1656
1660
  <div
1657
1661
  class="${this.streaming||this.loading||!this.value&&(!this.enableImageUpload||this.images.length===0)?"bg-gray-400 dark:bg-gray-600":""} ${this.streaming||this.loading?"scale-100":"scale-95"} flex h-8 w-8 flex-row items-center justify-center rounded-full bg-[${this.color}] p-1.5 transition-all transition-colors duration-200">
1658
- ${this.loading?d`<lucide-icon name="loader-circle" class="${e?"text-white":"text-white dark:text-gray-800"} inline-flex h-5 w-5 animate-spin transition-all"></lucide-icon>`:this.streaming?d`<lucide-icon name="x" class="${e?"text-white":"text-white dark:text-gray-800"} inline-flex h-4 w-4 transition-colors"></lucide-icon>`:d`<lucide-icon name="arrow-up" class="${e?"text-white":"text-white dark:text-gray-800"} inline-flex h-4 w-4 transition-colors"></lucide-icon>`}
1662
+ ${this.loading?u`<lucide-icon name="loader-circle" class="${e?"text-white":"text-white dark:text-gray-800"} inline-flex h-5 w-5 animate-spin transition-all"></lucide-icon>`:this.streaming?u`<lucide-icon name="x" class="${e?"text-white":"text-white dark:text-gray-800"} inline-flex h-4 w-4 transition-colors"></lucide-icon>`:u`<lucide-icon name="arrow-up" class="${e?"text-white":"text-white dark:text-gray-800"} inline-flex h-4 w-4 transition-colors"></lucide-icon>`}
1659
1663
  </div>
1660
1664
  </button>
1661
1665
  </form>
@@ -1664,7 +1668,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1664
1668
  <div class="h-5 w-full"></div>
1665
1669
  </slot>
1666
1670
  </div>
1667
- `}get#t(){return this.renderRoot.querySelector('textarea[name="input"]')??null}get#r(){return this.renderRoot.querySelector('button[type="submit"]')??null}#n(e){qc(e)&&(e.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&this.#r?.click())}#i(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;if(this.#e=r,this.streaming){this.dispatchEvent(new t.CancelEvent);return}let i=this.#t;if(!i)throw new Error("Expected input element to be present");let s=i.value.trim();(s||this.enableImageUpload&&this.images.length>0)&&this.dispatchEvent(new t.SubmitEvent(s))&&(i.value=""),this.#o(),window.requestAnimationFrame(()=>{this.focus()})}#s(e){this.dispatchEvent(new t.ChangeEvent({delta:e.data,full:e.target instanceof HTMLTextAreaElement?e.target.value:""})),this.#o()}#o(){let e=this.#t;if(!e)return;let{maxHeight:r,initialHeight:n,paddingY:i}=pi;e.style.height=`${n}px`;let s=e.scrollHeight,o=i*2,a=Math.min(s-o,r);e.style.height=`${a}px`,this.requestUpdate()}#a(){this.dispatchEvent(new t.ImageUploadClickEvent)}#d(e){this.dispatchEvent(new t.ImageDeleteEvent(e))}setValue(e){let r=this.#t;if(!r){console.warn("input element not found, cannot set value");return}r.value=e,this.#o(),this.dispatchEvent(new t.ChangeEvent({delta:null,full:e}))}focus(){this.#t?.focus()}};K.ChangeEvent=class extends CustomEvent{static type="mw:change";constructor(e,r={}){super(K.ChangeEvent.type,{detail:e,...r})}};K.SubmitEvent=class extends CustomEvent{static type="mw:submit";constructor(e,r={}){super(K.SubmitEvent.type,{detail:e,...r,cancelable:!0})}};K.CancelEvent=class extends CustomEvent{static type="mw:cancel";constructor(e={}){super(K.CancelEvent.type,{...e})}};K.ImageUploadClickEvent=class extends CustomEvent{static type="mw:image-upload-click";constructor(e={}){super(K.ImageUploadClickEvent.type,{...e})}};K.ImageDeleteEvent=class extends CustomEvent{static type="mw:image-delete";constructor(e,r={}){super(K.ImageDeleteEvent.type,{detail:e,...r})}};function qc(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",K);var fi=class extends C(v){static properties={side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl="",this.position="single",this.darkMode=!1}render(){return this.#e()}#e(){let r=this.side==="user"&&this.position==="single"?"rounded-2xl":this.side==="user"&&["single-current","first"].includes(this.position)?"rounded-2xl rounded-br-[4px]":this.side==="user"&&["middle","last-current"].includes(this.position)?"rounded-2xl rounded-r-[4px]":this.side==="user"&&this.position==="last"?"rounded-2xl rounded-tr-[4px]":["support","assistant"].includes(this.side)&&["single","single-current"].includes(this.position)?"rounded-2xl":["support","assistant"].includes(this.side)&&this.position==="first"?"rounded-2xl rounded-bl-[4px]":["support","assistant"].includes(this.side)&&this.position==="middle"?"rounded-2xl rounded-l-[4px]":["support","assistant"].includes(this.side)&&["last","last-current"].includes(this.position)?"rounded-2xl rounded-tl-[4px]":"rounded-2xl";switch(this.side){case"user":return d`
1671
+ `}get#t(){return this.renderRoot.querySelector('textarea[name="input"]')??null}get#r(){return this.renderRoot.querySelector('button[type="submit"]')??null}#i(e){Nc(e)&&(e.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&this.#r?.click())}#n(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;if(this.#e=r,this.streaming){this.dispatchEvent(new t.CancelEvent);return}let n=this.#t;if(!n)throw new Error("Expected input element to be present");let s=n.value.trim();(s||this.enableImageUpload&&this.images.length>0)&&this.dispatchEvent(new t.SubmitEvent(s))&&(n.value=""),this.#o(),window.requestAnimationFrame(()=>{this.focus()})}#s(e){this.dispatchEvent(new t.ChangeEvent({delta:e.data,full:e.target instanceof HTMLTextAreaElement?e.target.value:""})),this.#o()}#o(){let e=this.#t;if(!e)return;let{maxHeight:r,initialHeight:i,paddingY:n}=gn;e.style.height=`${i}px`;let s=e.scrollHeight,o=n*2,a=Math.min(s-o,r);e.style.height=`${a}px`,this.requestUpdate()}#a(){this.dispatchEvent(new t.ImageUploadClickEvent)}#d(e){this.dispatchEvent(new t.ImageDeleteEvent(e))}setValue(e){let r=this.#t;if(!r){console.warn("input element not found, cannot set value");return}r.value=e,this.#o(),this.dispatchEvent(new t.ChangeEvent({delta:null,full:e}))}focus(){this.#t?.focus()}};ee.ChangeEvent=class extends CustomEvent{static type="mw:change";constructor(e,r={}){super(ee.ChangeEvent.type,{detail:e,...r})}};ee.SubmitEvent=class extends CustomEvent{static type="mw:submit";constructor(e,r={}){super(ee.SubmitEvent.type,{detail:e,...r,cancelable:!0})}};ee.CancelEvent=class extends CustomEvent{static type="mw:cancel";constructor(e={}){super(ee.CancelEvent.type,{...e})}};ee.ImageUploadClickEvent=class extends CustomEvent{static type="mw:image-upload-click";constructor(e={}){super(ee.ImageUploadClickEvent.type,{...e})}};ee.ImageDeleteEvent=class extends CustomEvent{static type="mw:image-delete";constructor(e,r={}){super(ee.ImageDeleteEvent.type,{detail:e,...r})}};function Nc(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",ee);var wn=class extends k(v){static properties={side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl="",this.position="single",this.darkMode=!1}render(){return this.#e()}#e(){let r=this.side==="user"&&this.position==="single"?"rounded-2xl":this.side==="user"&&["single-current","first"].includes(this.position)?"rounded-2xl rounded-br-[4px]":this.side==="user"&&["middle","last-current"].includes(this.position)?"rounded-2xl rounded-r-[4px]":this.side==="user"&&this.position==="last"?"rounded-2xl rounded-tr-[4px]":["support","assistant"].includes(this.side)&&["single","single-current"].includes(this.position)?"rounded-2xl":["support","assistant"].includes(this.side)&&this.position==="first"?"rounded-2xl rounded-bl-[4px]":["support","assistant"].includes(this.side)&&this.position==="middle"?"rounded-2xl rounded-l-[4px]":["support","assistant"].includes(this.side)&&["last","last-current"].includes(this.position)?"rounded-2xl rounded-tl-[4px]":"rounded-2xl";switch(this.side){case"user":return u`
1668
1672
  <div class="${this.darkMode?"dark":""} ml-20 flex justify-end font-sans text-base">
1669
1673
  <div class="max-w-full">
1670
1674
  <!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
@@ -1673,7 +1677,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1673
1677
  </div>
1674
1678
 
1675
1679
  <!-- render status (if any) -->
1676
- ${this.status==="sent"?d`
1680
+ ${this.status==="sent"?u`
1677
1681
  <!-- tick mark -->
1678
1682
  <svg class="ml-auto h-3 w-3 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
1679
1683
  <path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
@@ -1681,7 +1685,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1681
1685
  `:null}
1682
1686
  </div>
1683
1687
  </div>
1684
- `;case"assistant":case"support":return d`
1688
+ `;case"assistant":case"support":return u`
1685
1689
  <div class="${this.darkMode?"dark":""} mr-8 flex justify-start font-sans text-base">
1686
1690
  <div class="flex max-w-full space-x-2">
1687
1691
  <!--
@@ -1700,13 +1704,13 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1700
1704
  </div>
1701
1705
  </div>
1702
1706
  </div>
1703
- `;default:throw new Error(`Unknown side: ${this.side}`)}}};customElements.get("mw-chat-message")||customElements.define("mw-chat-message",fi);var pe=class extends C(v){static properties={src:{type:String},alt:{type:String},side:{type:String},position:{type:String},width:{type:String},height:{type:String},clickable:{type:Boolean}};constructor(){super(),this.src="",this.alt="",this.side="right",this.position="single",this.width="300px",this.height="auto",this.clickable=!1}#e=!1;#t=!1;#r=!1;#n=!1;updated(e){e.has("src")&&(this.#e=!1,this.#t=!1)}get#i(){return this.side==="left"||this.side==="assistant"?"flex justify-start ml-[25px]":"flex justify-end"}get#s(){let e="inline-block overflow-hidden shadow-sm";if(this.side==="right"||this.side==="user")switch(this.position){case"first":e+=" rounded-2xl rounded-br-[4px]";break;case"middle":e+=" rounded-2xl rounded-r-[4px]";break;case"last":case"last-current":e+=" rounded-2xl rounded-tr-[4px]";break;default:e+=" rounded-2xl";break}else switch(this.position){case"first":e+=" rounded-2xl rounded-bl-[4px]";break;case"middle":e+=" rounded-2xl rounded-l-[4px]";break;case"last":case"last-current":e+=" rounded-2xl rounded-tl-[4px]";break;default:e+=" rounded-2xl";break}return e}#o(){if(!this.src)return"";try{let e=new URL(this.src);return e.searchParams.set("for","full"),e.href}catch{return this.src}}render(){return this.src?d`
1704
- <div class="${this.#i} mb-2 min-h-[100px]">
1707
+ `;default:throw new Error(`Unknown side: ${this.side}`)}}};customElements.get("mw-chat-message")||customElements.define("mw-chat-message",wn);var ge=class extends k(v){static properties={src:{type:String},alt:{type:String},side:{type:String},position:{type:String},width:{type:String},height:{type:String},clickable:{type:Boolean}};constructor(){super(),this.src="",this.alt="",this.side="right",this.position="single",this.width="300px",this.height="auto",this.clickable=!1}#e=!1;#t=!1;#r=!1;#i=!1;updated(e){e.has("src")&&(this.#e=!1,this.#t=!1)}get#n(){return this.side==="left"||this.side==="assistant"?"flex justify-start ml-[25px]":"flex justify-end"}get#s(){let e="inline-block overflow-hidden shadow-sm";if(this.side==="right"||this.side==="user")switch(this.position){case"first":e+=" rounded-2xl rounded-br-[4px]";break;case"middle":e+=" rounded-2xl rounded-r-[4px]";break;case"last":case"last-current":e+=" rounded-2xl rounded-tr-[4px]";break;default:e+=" rounded-2xl";break}else switch(this.position){case"first":e+=" rounded-2xl rounded-bl-[4px]";break;case"middle":e+=" rounded-2xl rounded-l-[4px]";break;case"last":case"last-current":e+=" rounded-2xl rounded-tl-[4px]";break;default:e+=" rounded-2xl";break}return e}#o(){if(!this.src)return"";try{let e=new URL(this.src);return e.searchParams.set("for","full"),e.href}catch{return this.src}}render(){return this.src?u`
1708
+ <div class="${this.#n} mb-2 min-h-[100px]">
1705
1709
  <div class="${this.#s} relative">
1706
1710
  <!-- Placeholder background that's only shown when loading or error -->
1707
- ${this.#e?null:d`
1711
+ ${this.#e?null:u`
1708
1712
  <div class="flex items-center justify-center bg-gray-100" style="width: ${this.width}; height: 200px;">
1709
- ${this.#t?d`
1713
+ ${this.#t?u`
1710
1714
  <!-- Error icon -->
1711
1715
  <svg class="h-8 w-8 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
1712
1716
  <path
@@ -1714,7 +1718,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1714
1718
  stroke-linejoin="round"
1715
1719
  d="m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
1716
1720
  </svg>
1717
- `:d`
1721
+ `:u`
1718
1722
  <!-- Loading pulse animation -->
1719
1723
  <div class="h-8 w-8 animate-pulse rounded-full bg-gray-300"></div>
1720
1724
  `}
@@ -1735,14 +1739,14 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1735
1739
  </div>
1736
1740
 
1737
1741
  <!-- Full image modal -->
1738
- ${this.#r?d`
1742
+ ${this.#r?u`
1739
1743
  <div
1740
- class="${this.#n?"bg-opacity-0":"bg-opacity-75"} fixed inset-0 z-50 flex items-center justify-center bg-black p-4 transition-opacity duration-300"
1744
+ class="${this.#i?"bg-opacity-0":"bg-opacity-75"} fixed inset-0 z-50 flex items-center justify-center bg-black p-4 transition-opacity duration-300"
1741
1745
  @click="${this.#l}">
1742
1746
  <!-- Close button -->
1743
1747
  <button
1744
1748
  type="button"
1745
- class="bg-opacity-50 ${this.#n?"opacity-0":"opacity-75"} hover:bg-opacity-75 absolute top-8 right-8 z-10 rounded-full bg-black p-2 text-white transition-[colors,opacity] delay-300 focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-transparent focus:outline-none"
1749
+ class="bg-opacity-50 ${this.#i?"opacity-0":"opacity-75"} hover:bg-opacity-75 absolute top-8 right-8 z-10 rounded-full bg-black p-2 text-white transition-[colors,opacity] delay-300 focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-transparent focus:outline-none"
1746
1750
  @click="${this.#l}"
1747
1751
  aria-label="Close full image">
1748
1752
  <!-- X mark icon -->
@@ -1754,20 +1758,20 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1754
1758
  <img
1755
1759
  src="${this.#o()}"
1756
1760
  alt="${this.alt}"
1757
- class="${this.#n?"scale-75 opacity-0":"scale-100 opacity-100"} max-h-full max-w-full transform rounded-lg shadow-2xl transition-all duration-100 ease-out"
1761
+ class="${this.#i?"scale-75 opacity-0":"scale-100 opacity-100"} max-h-full max-w-full transform rounded-lg shadow-2xl transition-all duration-100 ease-out"
1758
1762
  @click="${this.#h}" />
1759
1763
  </div>
1760
1764
  </div>
1761
1765
  `:null}
1762
- `:(console.warn("MwChatImage: No src provided"),null)}#a=e=>{console.error("Failed to load chat image:",this.src),this.#t=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:e},bubbles:!0}))};#d=e=>{this.#e=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:e},bubbles:!0}))};#c=e=>{this.clickable&&(e.preventDefault(),e.stopPropagation(),this.#r=!0,this.requestUpdate(),this.#n=!0,this.requestUpdate(),setTimeout(()=>{this.#n=!1,this.requestUpdate()},500),this.dispatchEvent(new CustomEvent("mw-chat-image:click",{detail:{src:this.src,event:e},bubbles:!0})))};#l=e=>{e.preventDefault(),e.stopPropagation(),this.#r=!1,this.requestUpdate()};#h=e=>{e.preventDefault(),e.stopPropagation()}};pe.ErrorEvent=class extends CustomEvent{static type="mw-chat-image:error";constructor(e,r={}){super(pe.ErrorEvent.type,{detail:e,...r})}};pe.LoadEvent=class extends CustomEvent{static type="mw-chat-image:load";constructor(e,r={}){super(pe.LoadEvent.type,{detail:e,...r})}};pe.ClickEvent=class extends CustomEvent{static type="mw-chat-image:click";constructor(e,r={}){super(pe.ClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-image")||customElements.define("mw-chat-image",pe);var z=t=>t??D;var Fc=["javascript:","data:text/html","vbscript:","data:text/javascript","data:text/vbscript","data:text/css","data:text/plain","data:text/xml"],Lt=class t extends C(v){static properties={text:{type:String},color:{type:String},dismissible:{type:Boolean},ephemeral:{type:Boolean},darkMode:{type:Boolean,attribute:"dark-mode"},_dismissed:{type:Boolean,state:!0}};constructor(){super(),this.text="By chatting with us, you agree to the monitoring and recording of this chat to deliver our services and processing of your personal data in accordance with our [Privacy Policy](https://docs.molin.ai/legal/privacy-policy).",this.color="#3b82f6",this.dismissible=!1,this.ephemeral=!1,this.darkMode=!1,this._dismissed=!1}connectedCallback(){super.connectedCallback(),this.dismissible&&(this._dismissed=this.#e())}#e(){return this.ephemeral?!1:U.disclaimerDismissed}#t(){this.ephemeral||(U.disclaimerDismissed=!0)}#r=e=>{e.preventDefault(),this._dismissed=!0,this.#t(),this.dispatchEvent(new t.DismissEvent)};#n(e){let n=/\[([^\]]+)\]\(([^)]+)\)/g.exec(e);if(n){let i=n[0],s=n[1],o=n[2],a=n.index;return Fc.some(l=>o.toLowerCase().startsWith(l))||!o||!s?e:d`${e.slice(0,a)}<a href="${z(o)}" target="_blank" rel="noopener noreferrer" @click="${this.#i}" class="underline" style="color: ${this.color}"
1766
+ `:(console.warn("MwChatImage: No src provided"),null)}#a=e=>{console.error("Failed to load chat image:",this.src),this.#t=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:e},bubbles:!0}))};#d=e=>{this.#e=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:e},bubbles:!0}))};#c=e=>{this.clickable&&(e.preventDefault(),e.stopPropagation(),this.#r=!0,this.requestUpdate(),this.#i=!0,this.requestUpdate(),setTimeout(()=>{this.#i=!1,this.requestUpdate()},500),this.dispatchEvent(new CustomEvent("mw-chat-image:click",{detail:{src:this.src,event:e},bubbles:!0})))};#l=e=>{e.preventDefault(),e.stopPropagation(),this.#r=!1,this.requestUpdate()};#h=e=>{e.preventDefault(),e.stopPropagation()}};ge.ErrorEvent=class extends CustomEvent{static type="mw-chat-image:error";constructor(e,r={}){super(ge.ErrorEvent.type,{detail:e,...r})}};ge.LoadEvent=class extends CustomEvent{static type="mw-chat-image:load";constructor(e,r={}){super(ge.LoadEvent.type,{detail:e,...r})}};ge.ClickEvent=class extends CustomEvent{static type="mw-chat-image:click";constructor(e,r={}){super(ge.ClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-image")||customElements.define("mw-chat-image",ge);var W=t=>t??U;var Hc=["javascript:","data:text/html","vbscript:","data:text/javascript","data:text/vbscript","data:text/css","data:text/plain","data:text/xml"],Ot=class t extends k(v){static properties={text:{type:String},color:{type:String},dismissible:{type:Boolean},ephemeral:{type:Boolean},darkMode:{type:Boolean,attribute:"dark-mode"},_dismissed:{type:Boolean,state:!0}};constructor(){super(),this.text="By chatting with us, you agree to the monitoring and recording of this chat to deliver our services and processing of your personal data in accordance with our [Privacy Policy](https://docs.molin.ai/legal/privacy-policy).",this.color="#3b82f6",this.dismissible=!1,this.ephemeral=!1,this.darkMode=!1,this._dismissed=!1}connectedCallback(){super.connectedCallback(),this.dismissible&&(this._dismissed=this.#e())}#e(){return this.ephemeral?!1:R.disclaimerDismissed}#t(){this.ephemeral||(R.disclaimerDismissed=!0)}#r=e=>{e.preventDefault(),this._dismissed=!0,this.#t(),this.dispatchEvent(new t.DismissEvent)};#i(e){let i=/\[([^\]]+)\]\(([^)]+)\)/g.exec(e);if(i){let n=i[0],s=i[1],o=i[2],a=i.index;return Hc.some(l=>o.toLowerCase().startsWith(l))||!o||!s?e:u`${e.slice(0,a)}<a href="${W(o)}" target="_blank" rel="noopener noreferrer" @click="${this.#n}" class="underline" style="color: ${this.color}"
1763
1767
  >${s}</a
1764
- >${e.slice(a+i.length)}`}return e}#i=e=>{e.stopPropagation()};render(){if(this._dismissed)return null;let e=this.#n(this.text);return d`
1768
+ >${e.slice(a+n.length)}`}return e}#n=e=>{e.stopPropagation()};render(){if(this._dismissed)return null;let e=this.#i(this.text);return u`
1765
1769
  <div class="${this.darkMode?"dark":""} flex items-center justify-between">
1766
1770
  <div class="flex flex-1 items-center justify-center">
1767
1771
  <span class="px-3 text-center text-xs font-light text-gray-500 dark:text-gray-400">${e}</span>
1768
1772
  </div>
1769
1773
 
1770
- ${this.dismissible?d`
1774
+ ${this.dismissible?u`
1771
1775
  <button
1772
1776
  type="button"
1773
1777
  aria-label="Dismiss"
@@ -1777,12 +1781,12 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1777
1781
  </button>
1778
1782
  `:null}
1779
1783
  </div>
1780
- `}};Lt.DismissEvent=class extends CustomEvent{static type="mw-disclaimer:dismiss";constructor(e={}){super(Lt.DismissEvent.type,{...e})}};customElements.get("mw-disclaimer")||customElements.define("mw-disclaimer",Lt);var mi=class extends C(v){static properties={text:{type:String},variant:{type:String},autoDismissable:{type:Boolean,attribute:"auto-dismissable"},dismissDelay:{type:Number,attribute:"dismiss-delay"},_isVisible:{type:Boolean,state:!0}};constructor(){super(),this.text="I'm still learning!",this.variant="info",this.autoDismissable=!1,this.dismissDelay=5e3,this._isVisible=!0}connectedCallback(){super.connectedCallback(),this.autoDismissable&&this.#e()}#e(){setTimeout(()=>{this._isVisible=!1,this.requestUpdate()},this.dismissDelay)}#t(){switch(this.variant){case"error":return{bg:"bg-red-600",text:"text-white",icon:"badge-alert"};case"warning":return{bg:"bg-yellow-600",text:"text-white",icon:"alert-triangle"};case"success":return{bg:"bg-green-600",text:"text-white",icon:"check-circle"};case"info":default:return{bg:"bg-black",text:"text-white",icon:"info"}}}render(){let e=this.#t();return d`
1784
+ `}};Ot.DismissEvent=class extends CustomEvent{static type="mw-disclaimer:dismiss";constructor(e={}){super(Ot.DismissEvent.type,{...e})}};customElements.get("mw-disclaimer")||customElements.define("mw-disclaimer",Ot);var yn=class extends k(v){static properties={text:{type:String},variant:{type:String},autoDismissable:{type:Boolean,attribute:"auto-dismissable"},dismissDelay:{type:Number,attribute:"dismiss-delay"},_isVisible:{type:Boolean,state:!0}};constructor(){super(),this.text="I'm still learning!",this.variant="info",this.autoDismissable=!1,this.dismissDelay=5e3,this._isVisible=!0}connectedCallback(){super.connectedCallback(),this.autoDismissable&&this.#e()}#e(){setTimeout(()=>{this._isVisible=!1,this.requestUpdate()},this.dismissDelay)}#t(){switch(this.variant){case"error":return{bg:"bg-red-600",text:"text-white",icon:"badge-alert"};case"warning":return{bg:"bg-yellow-600",text:"text-white",icon:"alert-triangle"};case"success":return{bg:"bg-green-600",text:"text-white",icon:"check-circle"};default:return{bg:"bg-black",text:"text-white",icon:"info"}}}render(){let e=this.#t();return u`
1781
1785
  <div
1782
1786
  class="${this._isVisible?"opacity-100 translate-y-0":"opacity-0 translate-y-[50px] pointer-events-none mt-[-40px]"} flex justify-center transition-all transition-discrete duration-[1s] ease-in-out">
1783
1787
  <div class="${e.bg} mb-2 flex max-w-[70%] items-center justify-center rounded-full px-3 py-2 select-none">
1784
1788
  <!-- Icon based on variant -->
1785
- ${this.variant==="info"?d`
1789
+ ${this.variant==="info"?u`
1786
1790
  <!-- (i) symbol for info -->
1787
1791
  <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
1788
1792
  <path
@@ -1791,21 +1795,21 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1791
1795
  d="M2.25 12C2.25 6.61522 6.61522 2.25 12 2.25C17.3848 2.25 21.75 6.61522 21.75 12C21.75 17.3848 17.3848 21.75 12 21.75C6.61522 21.75 2.25 17.3848 2.25 12ZM10.9562 10.5584C12.1025 9.98533 13.3931 11.0206 13.0823 12.2639L12.3733 15.0999L12.4148 15.0792C12.7852 14.894 13.2357 15.0441 13.421 15.4146C13.6062 15.7851 13.4561 16.2356 13.0856 16.4208L13.0441 16.4416C11.8979 17.0147 10.6072 15.9794 10.9181 14.7361L11.6271 11.9001L11.5856 11.9208C11.2151 12.1061 10.7646 11.9559 10.5793 11.5854C10.3941 11.2149 10.5443 10.7644 10.9148 10.5792L10.9562 10.5584ZM12 9C12.4142 9 12.75 8.66421 12.75 8.25C12.75 7.83579 12.4142 7.5 12 7.5C11.5858 7.5 11.25 7.83579 11.25 8.25C11.25 8.66421 11.5858 9 12 9Z"
1792
1796
  fill="white" />
1793
1797
  </svg>
1794
- `:this.variant==="error"?d`
1798
+ `:this.variant==="error"?u`
1795
1799
  <!-- Alert circle for error -->
1796
1800
  <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
1797
1801
  <circle cx="12" cy="12" r="10" stroke="white" stroke-width="2" />
1798
1802
  <line x1="15" y1="9" x2="9" y2="15" stroke="white" stroke-width="2" />
1799
1803
  <line x1="9" y1="9" x2="15" y2="15" stroke="white" stroke-width="2" />
1800
1804
  </svg>
1801
- `:this.variant==="warning"?d`
1805
+ `:this.variant==="warning"?u`
1802
1806
  <!-- Alert triangle for warning -->
1803
1807
  <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
1804
1808
  <path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
1805
1809
  <line x1="12" y1="9" x2="12" y2="13" stroke="white" stroke-width="2" stroke-linecap="round" />
1806
1810
  <path d="M12 17h.01" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
1807
1811
  </svg>
1808
- `:d`
1812
+ `:u`
1809
1813
  <!-- Check circle for success -->
1810
1814
  <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
1811
1815
  <path d="M22 11.08V12a10 10 0 11-5.93-9.14" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
@@ -1816,7 +1820,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1816
1820
  <span class="${e.text} ml-1 text-xs">${this.text}</span>
1817
1821
  </div>
1818
1822
  </div>
1819
- `}};customElements.get("mw-info-banner")||customElements.define("mw-info-banner",mi);var gi=class extends C(v){render=()=>d`
1823
+ `}};customElements.get("mw-info-banner")||customElements.define("mw-info-banner",yn);var vn=class extends k(v){render=()=>u`
1820
1824
  <svg class="inline-block h-full w-full leading-none" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" xml:space="preserve">
1821
1825
  <circle fill="currentColor" stroke="none" cx="27" cy="50" r="6">
1822
1826
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
@@ -1828,11 +1832,11 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1828
1832
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
1829
1833
  </circle>
1830
1834
  </svg>
1831
- `};customElements.get("mw-loading")||customElements.define("mw-loading",gi);var Nc="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",wi=class extends C(v){static properties={darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.darkMode=!1}render(){return d`
1835
+ `};customElements.get("mw-loading")||customElements.define("mw-loading",vn);var zc="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",bn=class extends k(v){static properties={darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.darkMode=!1}render(){return u`
1832
1836
  <p class="${this.darkMode?"dark text-gray-300":"text-gray-600"} flex items-center justify-center text-xs whitespace-nowrap">
1833
1837
  <span>Powered by</span>
1834
1838
 
1835
- <a href="${Nc}" target="_blank" class="${this.darkMode?"text-gray-200":""} inline-flex items-center underline">
1839
+ <a href="${zc}" target="_blank" class="${this.darkMode?"text-gray-200":""} inline-flex items-center underline">
1836
1840
  <svg class="mx-1 inline-block h-4 w-4" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
1837
1841
  <circle cx="10.0361" cy="10.0361" r="10.0361" fill="#242038" />
1838
1842
  <path
@@ -1851,17 +1855,17 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1851
1855
  <span>Molin AI</span>
1852
1856
  </a>
1853
1857
  </p>
1854
- `}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",wi);var Vc=Math.pow(10,8)*24*60*60*1e3,h1=-Vc;var Hc=3600;var Fo=Hc*24,p1=Fo*7,zc=Fo*365.2425,Wc=zc/12,f1=Wc*3,yi=Symbol.for("constructDateFrom");function No(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&yi in t?t[yi](e):t instanceof Date?new t.constructor(e):new Date(e)}function vi(t,e){return No(e||t,t)}function Vo(t){return e=>{let n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function Ho(t,e){return+vi(t)-+vi(e)}function bi(t,e,r){let n=Ho(t,e)/1e3;return Vo(r?.roundingMethod)(n)}var xi=class extends C(v){static properties={question:{type:String},options:{type:Array},heading:{type:String},gameTitle:{type:String},resultPrefix:{type:String},correctButtonText:{type:String},wrongButtonText:{type:String},color:{type:String},apiBaseUrl:{type:String},cdnBaseUrl:{type:String},minutes:{type:String},seconds:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"},_currentQuestion:{type:String,state:!0},_questionHistory:{type:Array,state:!0},_guessedJob:{type:String,state:!0},_isLoadingNextQuestion:{type:Boolean,state:!0},_loadingAnswer:{type:String,state:!0},_guessValidated:{type:Boolean,state:!0},_validatingButton:{type:String,state:!0},_currentAttemptQuestionCount:{type:Number,state:!0}};static styles=j`
1858
+ `}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",bn);var Wc=Math.pow(10,8)*24*60*60*1e3,s1=-Wc;var Gc=3600;var zo=Gc*24,o1=zo*7,Zc=zo*365.2425,Jc=Zc/12,a1=Jc*3,xn=Symbol.for("constructDateFrom");function Wo(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&xn in t?t[xn](e):t instanceof Date?new t.constructor(e):new Date(e)}function kn(t,e){return Wo(e||t,t)}function Go(t){return e=>{let i=(t?Math[t]:Math.trunc)(e);return i===0?0:i}}function Zo(t,e){return+kn(t)-+kn(e)}function Cn(t,e,r){let i=Zo(t,e)/1e3;return Go(r?.roundingMethod)(i)}var _n=class extends k(v){static properties={question:{type:String},options:{type:Array},heading:{type:String},gameTitle:{type:String},resultPrefix:{type:String},correctButtonText:{type:String},wrongButtonText:{type:String},color:{type:String},apiBaseUrl:{type:String},cdnBaseUrl:{type:String},minutes:{type:String},seconds:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"},_currentQuestion:{type:String,state:!0},_questionHistory:{type:Array,state:!0},_guessedJob:{type:String,state:!0},_isLoadingNextQuestion:{type:Boolean,state:!0},_loadingAnswer:{type:String,state:!0},_guessValidated:{type:Boolean,state:!0},_validatingButton:{type:String,state:!0},_currentAttemptQuestionCount:{type:Number,state:!0}};static styles=O`
1855
1859
  :host {
1856
1860
  display: block;
1857
1861
  }
1858
- `;#e=7;constructor(){super(),this.question="",this.options=["No","Yes"],this.heading="",this.gameTitle="",this.resultPrefix="",this.correctButtonText="Correct",this.wrongButtonText="Wrong",this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.minutes="00",this.seconds="00",this.darkMode=!1,this._questionHistory=[],this._currentQuestion="",this._guessedJob="",this._isLoadingNextQuestion=!1,this._loadingAnswer="",this._guessValidated=!1,this._validatingButton="",this._currentAttemptQuestionCount=0}firstUpdated(){this._currentQuestion=this.question}async#t(){if(!this.apiBaseUrl)return console.warn("API base URL not configured, cannot fetch next question"),null;this._isLoadingNextQuestion=!0;try{let e=await fetch(`${this.apiBaseUrl}/preview/wait-game/next-question`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({questionAnswers:this._questionHistory,takeGuess:this._currentAttemptQuestionCount>=this.#e})});return e.ok?await e.json():(console.error("failed to fetch next question",e.status),null)}catch(e){return console.error("error fetching next question",e),null}finally{this._isLoadingNextQuestion=!1}}#r=async e=>{this._loadingAnswer=e,this._questionHistory.push({question:this._currentQuestion,answer:e}),this._currentAttemptQuestionCount++,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:question-answered",{bubbles:!0,composed:!0,detail:{questionIndex:this._questionHistory.length-1,question:this._currentQuestion,answer:e,totalQuestions:this.#e,allAnswers:this._questionHistory.map(n=>n.answer)}}));let r=await this.#t();r&&(r.isComplete&&r.guessedJob?(this._guessedJob=r.guessedJob,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:game-completed",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(n=>n.answer)}}))):r.nextQuestion&&(this._currentQuestion=r.nextQuestion)),this._loadingAnswer=""};#n=async e=>{if(this._validatingButton=e?"correct":"wrong",this.dispatchEvent(new CustomEvent("mw-chat-wait-game:guess-validated",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,isCorrect:e,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(r=>r.answer)}})),e)this._guessValidated=!0,this._validatingButton="";else{let r=await this.#t();r?.nextQuestion&&(this._currentQuestion=r.nextQuestion),this._guessedJob="",this._currentAttemptQuestionCount=0,this._validatingButton=""}};#i(){return Math.round(this._currentAttemptQuestionCount/this.#e*100)}#s(){let e=this.cdnBaseUrl?`${this.cdnBaseUrl}/assets/career-ladder`:"https://widget.molin.ai/assets/career-ladder";return d`
1862
+ `;#e=7;constructor(){super(),this.question="",this.options=["No","Yes"],this.heading="",this.gameTitle="",this.resultPrefix="",this.correctButtonText="Correct",this.wrongButtonText="Wrong",this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.minutes="00",this.seconds="00",this.darkMode=!1,this._questionHistory=[],this._currentQuestion="",this._guessedJob="",this._isLoadingNextQuestion=!1,this._loadingAnswer="",this._guessValidated=!1,this._validatingButton="",this._currentAttemptQuestionCount=0}firstUpdated(){this._currentQuestion=this.question}async#t(){if(!this.apiBaseUrl)return console.warn("API base URL not configured, cannot fetch next question"),null;this._isLoadingNextQuestion=!0;try{let e=await fetch(`${this.apiBaseUrl}/preview/wait-game/next-question`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({questionAnswers:this._questionHistory,takeGuess:this._currentAttemptQuestionCount>=this.#e})});return e.ok?await e.json():(console.error("failed to fetch next question",e.status),null)}catch(e){return console.error("error fetching next question",e),null}finally{this._isLoadingNextQuestion=!1}}#r=async e=>{this._loadingAnswer=e,this._questionHistory.push({question:this._currentQuestion,answer:e}),this._currentAttemptQuestionCount++,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:question-answered",{bubbles:!0,composed:!0,detail:{questionIndex:this._questionHistory.length-1,question:this._currentQuestion,answer:e,totalQuestions:this.#e,allAnswers:this._questionHistory.map(i=>i.answer)}}));let r=await this.#t();r&&(r.isComplete&&r.guessedJob?(this._guessedJob=r.guessedJob,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:game-completed",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(i=>i.answer)}}))):r.nextQuestion&&(this._currentQuestion=r.nextQuestion)),this._loadingAnswer=""};#i=async e=>{if(this._validatingButton=e?"correct":"wrong",this.dispatchEvent(new CustomEvent("mw-chat-wait-game:guess-validated",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,isCorrect:e,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(r=>r.answer)}})),e)this._guessValidated=!0,this._validatingButton="";else{let r=await this.#t();r?.nextQuestion&&(this._currentQuestion=r.nextQuestion),this._guessedJob="",this._currentAttemptQuestionCount=0,this._validatingButton=""}};#n(){return Math.round(this._currentAttemptQuestionCount/this.#e*100)}#s(){let e=this.cdnBaseUrl?`${this.cdnBaseUrl}/assets/career-ladder`:"https://widget.molin.ai/assets/career-ladder";return u`
1859
1863
  <div class="mt-3 flex items-center justify-center gap-1">
1860
1864
  <span class="text-[11px] text-black/40 dark:text-gray-500">Inspired by</span>
1861
1865
 
1862
1866
  <img src="${e}" alt="Career Ladder" class="h-6" />
1863
1867
  </div>
1864
- `}render(){let e=this.#i(),r=this.heading||"Agent joining in",n=this.gameTitle||"\u{1F9E0} I'll guess your job",i=this.resultPrefix||"I'm pretty confident:";return this._guessedJob?d`
1868
+ `}render(){let e=this.#n(),r=this.heading||"Agent joining in",i=this.gameTitle||"\u{1F9E0} I'll guess your job",n=this.resultPrefix||"I'm pretty confident:";return this._guessedJob?u`
1865
1869
  <div class="${this.darkMode?"dark bg-[#1E1F23] ring-white/10":"bg-white/70 ring-black/10"} mx-auto w-full max-w-xs rounded-2xl p-4 shadow-sm ring-1 backdrop-blur">
1866
1870
  <div class="flex items-center justify-between">
1867
1871
  <div class="text-[13px] text-black/60 dark:text-gray-300">${r}</div>
@@ -1874,33 +1878,33 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1874
1878
  </div>
1875
1879
 
1876
1880
  <div class="mt-3 space-y-1.5 text-[13px] text-black dark:text-white">
1877
- <div class="rounded-xl bg-black/[0.04] px-3 py-2 dark:bg-white/10">${i} ${this._guessedJob}.</div>
1881
+ <div class="rounded-xl bg-black/[0.04] px-3 py-2 dark:bg-white/10">${n} ${this._guessedJob}.</div>
1878
1882
  </div>
1879
1883
 
1880
- ${this._guessValidated?"":d`
1884
+ ${this._guessValidated?"":u`
1881
1885
  <div class="mt-3 grid grid-cols-2 gap-2">
1882
1886
  <button
1883
- @click="${()=>this.#n(!1)}"
1887
+ @click="${()=>this.#i(!1)}"
1884
1888
  ?disabled="${!!this._validatingButton}"
1885
- class="flex items-center justify-center gap-1 rounded-xl border border-[${this.color}] bg-white px-4 py-2 text-sm font-medium text-black transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[#2B2D31] dark:text-gray-200">
1886
- ${this._validatingButton==="wrong"?d`<lucide-icon class="h-4 w-4 animate-spin" name="loader-circle"></lucide-icon>`:this.wrongButtonText}
1889
+ class="flex items-center justify-center gap-1 rounded-xl border border-[${this.color}] bg-white px-4 py-2 text-sm font-medium text-black transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[#2B2D31] dark:text-white">
1890
+ ${this._validatingButton==="wrong"?u`<lucide-icon class="h-4 w-4 animate-spin" name="loader-circle"></lucide-icon>`:this.wrongButtonText}
1887
1891
  </button>
1888
1892
  <button
1889
- @click="${()=>this.#n(!0)}"
1893
+ @click="${()=>this.#i(!0)}"
1890
1894
  ?disabled="${!!this._validatingButton}"
1891
- class="flex items-center justify-center gap-1 rounded-xl bg-[${this.color}] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50">
1892
- ${this._validatingButton==="correct"?d`<lucide-icon class="h-4 w-4 animate-spin" name="loader-circle"></lucide-icon>`:this.correctButtonText}
1895
+ class="flex items-center justify-center gap-1 rounded-xl bg-[${this.color}] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50 dark:text-black">
1896
+ ${this._validatingButton==="correct"?u`<lucide-icon class="h-4 w-4 animate-spin" name="loader-circle"></lucide-icon>`:this.correctButtonText}
1893
1897
  </button>
1894
1898
  </div>
1895
1899
  `}
1896
- ${this._guessValidated?"":d`
1900
+ ${this._guessValidated?"":u`
1897
1901
  <div class="mt-3 h-1.5 overflow-hidden rounded-full bg-black/5 dark:bg-white/10">
1898
1902
  <div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: 100%"></div>
1899
1903
  </div>
1900
1904
  `}
1901
1905
  ${this.#s()}
1902
1906
  </div>
1903
- `:this._currentQuestion?d`
1907
+ `:this._currentQuestion?u`
1904
1908
  <div class="${this.darkMode?"dark bg-[#1E1F23] ring-white/10":"bg-white/70 ring-black/10"} mx-auto w-full max-w-xs rounded-2xl p-4 shadow-sm ring-1 backdrop-blur">
1905
1909
  <div class="flex items-center justify-between">
1906
1910
  <div class="text-[13px] text-black/60 dark:text-gray-300">${r}</div>
@@ -1913,19 +1917,19 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1913
1917
  </div>
1914
1918
 
1915
1919
  <div class="mt-2 flex items-center justify-between">
1916
- <h3 class="text-sm font-semibold text-black dark:text-white">${n}</h3>
1920
+ <h3 class="text-sm font-semibold text-black dark:text-white">${i}</h3>
1917
1921
  <div class="text-xs text-black/60 dark:text-gray-300"><span>${this._currentAttemptQuestionCount}</span>/${this.#e}</div>
1918
1922
  </div>
1919
1923
 
1920
1924
  <div class="mt-3 rounded-xl bg-black/[0.04] px-3 py-2 text-[14px] font-medium text-black dark:bg-white/10 dark:text-white">${this._currentQuestion}</div>
1921
1925
 
1922
1926
  <div class="mt-3 grid grid-cols-2 gap-1">
1923
- ${this.options.map((s,o)=>{let a=this._loadingAnswer===s;return d`
1927
+ ${this.options.map((s,o)=>{let a=this._loadingAnswer===s;return u`
1924
1928
  <button
1925
1929
  @click="${()=>this.#r(s)}"
1926
1930
  ?disabled="${this._isLoadingNextQuestion}"
1927
- class="${o===0?`bg-white dark:bg-[#2B2D31] text-black dark:text-gray-200 flex items-center justify-center gap-1 rounded-xl border border-[${this.color}] px-1 py-1.5 max-h-[35px] text-sm transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`:`flex items-center justify-center gap-1 rounded-xl bg-[${this.color}] py-1.5 max-h-[35px] px-1 text-sm text-white transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`}">
1928
- ${a?d`<lucide-icon class="h-3.5 w-3.5 animate-spin" name="loader-circle"></lucide-icon>`:s}
1931
+ class="${o===0?`bg-white dark:bg-[#2B2D31] text-black dark:text-white flex items-center justify-center gap-1 rounded-xl border border-[${this.color}] px-1 py-1.5 max-h-[35px] text-sm transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`:`flex items-center justify-center gap-1 rounded-xl bg-[${this.color}] py-1.5 max-h-[35px] px-1 text-sm text-white dark:text-black transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`}">
1932
+ ${a?u`<lucide-icon class="h-3.5 w-3.5 animate-spin" name="loader-circle"></lucide-icon>`:s}
1929
1933
  </button>
1930
1934
  `})}
1931
1935
  </div>
@@ -1936,26 +1940,26 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1936
1940
 
1937
1941
  ${this.#s()}
1938
1942
  </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`
1943
+ `:u`<p class="text-sm text-black italic dark:text-white">There was a problem loading the game, please refresh the page.</p>`}};customElements.get("mw-chat-wait-game")||customElements.define("mw-chat-wait-game",_n);var Sn=class extends k(v){static styles=O`
1940
1944
  :host {
1941
1945
  display: block;
1942
1946
  }
1943
- `;#e=null;#t=null;#r=0;constructor(){super(),this.heading="",this.message="",this.completeMessage="",this.gameButton="",this.question="",this.options="",this.gameTitle="",this.resultPrefix="",this.correctButtonText="Correct",this.wrongButtonText="Wrong",this.targetEndTime="",this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.soundUrl="",this.darkMode=!1,this._remainingSeconds=480,this._isComplete=!1,this._showGame=!1}connectedCallback(){super.connectedCallback(),this.#n(),this.#s()}disconnectedCallback(){super.disconnectedCallback(),this.#o()}#n(){this.targetEndTime?this.#t=new Date(this.targetEndTime):this.#t=new Date(Date.now()+this._remainingSeconds*1e3),this.#r=Math.max(bi(this.#t,new Date),0),this.#i()}#i(){if(this.#t===null)return;let e=new Date,r=bi(this.#t,e);r>=0?(this._remainingSeconds=r,this._isComplete=!1):(this._remainingSeconds=Math.abs(r),this._isComplete=!0)}#s(){this.#o(),this.#e=setInterval(()=>{this.#i()},1e3)}#o(){this.#e!==null&&(clearInterval(this.#e),this.#e=null)}#a=()=>{this.#l(),this._showGame=!0,this.dispatchEvent(new CustomEvent("mw-chat-wait-timer:game-click",{bubbles:!0,composed:!0}))};#d(){if(!this.question)return!1;try{return localStorage.getItem("_molin_timer_sound_question")===this.question}catch{return!1}}#c(){if(this.question)try{localStorage.setItem("_molin_timer_sound_question",this.question)}catch(e){console.error("Error saving sound state to localStorage:",e,{})}}#l(){if(!this.soundUrl||!this.question||this.#d())return;let e=new Audio(this.soundUrl);e.volume=.5,e.play().then(()=>{this.#c()}).catch(r=>{console.error("Error playing audio:",r,{})})}#h(){let e=Math.floor(this._remainingSeconds/60),r=this._remainingSeconds%60,n=i=>String(i).padStart(2,"0");return{minutes:n(e),seconds:n(r)}}#m(){return this._isComplete?0:this.#t===null||this.#r===0?100:Math.round(this._remainingSeconds/this.#r*100)}render(){let{minutes:e,seconds:r}=this.#h();if(this._showGame)return d`
1947
+ `;static properties={data:{type:Object},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}};#e=null;#t=null;#r=0;constructor(){super(),this.data,this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",this.soundUrl="",this.darkMode=!1,this._remainingSeconds=480,this._isComplete=!1,this._showGame=!1}connectedCallback(){super.connectedCallback(),this.#i(),this.#s()}disconnectedCallback(){super.disconnectedCallback(),this.#o()}#i(){this.data?.expected_join_time?this.#t=new Date(this.data.expected_join_time):this.#t=new Date(Date.now()+this._remainingSeconds*1e3),this.#r=Math.max(Cn(this.#t,new Date),0),this.#n()}#n(){if(this.#t===null)return;let e=new Date,r=Cn(this.#t,e);r>=0?(this._remainingSeconds=r,this._isComplete=!1):(this._remainingSeconds=Math.abs(r),this._isComplete=!0)}#s(){this.#o(),this.#e=setInterval(()=>{this.#n()},1e3)}#o(){this.#e!==null&&(clearInterval(this.#e),this.#e=null)}#a=()=>{this.#l(),this._showGame=!0,this.dispatchEvent(new CustomEvent("mw-chat-wait-timer:game-click",{bubbles:!0,composed:!0}))};#d(){if(!this.data?.game_first_question)return!1;try{return localStorage.getItem("_molin_timer_sound_question")===this.data.game_first_question}catch{return!1}}#c(){if(this.data?.game_first_question)try{localStorage.setItem("_molin_timer_sound_question",this.data.game_first_question)}catch(e){console.error("Error saving sound state to localStorage:",e,{})}}#l(){if(!this.soundUrl||!this.data?.game_first_question||this.#d())return;let e=new Audio(this.soundUrl);e.volume=.5,e.play().then(()=>{this.#c()}).catch(r=>{console.error("Error playing audio:",r,{})})}#h(){let e=Math.floor(this._remainingSeconds/60),r=this._remainingSeconds%60,i=n=>String(n).padStart(2,"0");return{minutes:i(e),seconds:i(r)}}#m(){return this._isComplete?0:this.#t===null||this.#r===0?100:Math.round(this._remainingSeconds/this.#r*100)}render(){let{minutes:e,seconds:r}=this.#h();if(this._showGame)return u`
1944
1948
  <mw-chat-wait-game
1945
- .question="${this.question}"
1946
- .options="${this.options||["No","Yes"]}"
1947
- .gameTitle="${this.gameTitle}"
1948
- .resultPrefix="${this.resultPrefix}"
1949
- .correctButtonText="${this.correctButtonText}"
1950
- .wrongButtonText="${this.wrongButtonText}"
1951
- .heading="${this.heading}"
1949
+ .question="${this.data?.game_first_question}"
1950
+ .options="${[this.data?.game_button_answer_negative||"No",this.data?.game_button_answer_affirmative||"Yes"]}"
1951
+ .gameTitle="${this.data?.game_title}"
1952
+ .resultPrefix="${this.data?.game_result_prefix}"
1953
+ .correctButtonText="${this.data?.game_button_result_correct}"
1954
+ .wrongButtonText="${this.data?.game_button_result_wrong}"
1955
+ .heading="${this.data?.title}"
1952
1956
  .color="${this.color}"
1953
1957
  .apiBaseUrl="${this.apiBaseUrl}"
1954
1958
  .cdnBaseUrl="${this.cdnBaseUrl}"
1955
1959
  .minutes="${e}"
1956
1960
  .seconds="${r}"
1957
1961
  ?dark-mode="${this.darkMode}"></mw-chat-wait-game>
1958
- `;let n=this.#m();return d`
1962
+ `;let i=this.#m();return u`
1959
1963
  <div class="${this.darkMode?"dark bg-[#1E1F23] ring-white/10":"bg-white/70 ring-black/10"} mx-auto w-full max-w-xs rounded-2xl p-4 shadow-sm ring-1 backdrop-blur">
1960
1964
  <!-- Time -->
1961
1965
  <div class="font-[ui-monospace,Menlo,Monaco,Consolas] text-4xl tracking-tight text-black tabular-nums dark:text-white" aria-live="polite">
@@ -1964,44 +1968,249 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
1964
1968
 
1965
1969
  <!-- Progress bar -->
1966
1970
  <div class="mt-3 h-1.5 overflow-hidden rounded-full bg-black/5 dark:bg-white/10">
1967
- <div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: ${n}%"></div>
1971
+ <div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: ${i}%"></div>
1968
1972
  </div>
1969
1973
 
1970
1974
  <!-- Message -->
1971
- <div class="mt-2 text-[12px] leading-tight text-black/50 dark:text-gray-300">${this._isComplete?this.completeMessage:this.message}</div>
1975
+ <div class="mt-2 text-[12px] leading-tight text-black/50 dark:text-gray-300">${this._isComplete?this.data?.subtitle_past_join_time:this.data?.subtitle}</div>
1972
1976
 
1973
1977
  <!-- Play a Game Button -->
1974
1978
  <div class="mt-4">
1975
- <button @click="${this.#a}" class="w-full rounded-xl bg-[${this.color}] px-4 py-2 text-sm font-medium text-white transition hover:opacity-90">${this.gameButton}</button>
1979
+ <button @click="${this.#a}" class="w-full rounded-xl bg-[${this.color}] px-4 py-2 text-sm font-medium text-white transition hover:opacity-90 dark:text-black">
1980
+ ${this.data?.game_button_start}
1981
+ </button>
1976
1982
  </div>
1977
1983
  </div>
1978
- `}};customElements.get("mw-chat-wait-timer")||customElements.define("mw-chat-wait-timer",ki);var Ci=class extends C(v){static properties={product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.product=void 0,this.streaming=!1,this.linksNewTab=!1,this.searchParams=void 0,this.imagesByProductUrl={},this.darkMode=!1}get trackedProductUrl(){let e=this.product?.url,r=this.searchParams;try{if(e&&r)return Ls(e,r).href}catch{}return e}render(){let{name:e,description:r,price:n,url:i}=this.product||{},s=i?this.imagesByProductUrl?.[i]:void 0;return d`
1984
+ `}};customElements.get("mw-chat-wait-timer")||customElements.define("mw-chat-wait-timer",Sn);var at=(t,e,r)=>{for(let i of e)if(i[0]===t)return(0,i[1])();return r?.()};var $n=class extends k(v){static properties={orderDetails:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1,this.color="#601feb",this.darkMode=!1}render(){if(!this.orderDetails)return u`
1985
+ <div class="${this.darkMode?"dark border-white/10 bg-[#1E1F23]":"border-gray-200 bg-white"} flex w-full max-w-md flex-col rounded-3xl border p-4">
1986
+ <div class="mb-2">
1987
+ <div class="h-7 w-full animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
1988
+ </div>
1989
+ </div>
1990
+ `;let e=this.orderDetails.timeline?.step?.flatMap(i=>i.label?[{...i,label:i.label}]:[])||[],r=this.orderDetails.items?.item?.flatMap(i=>i.name?[{...i,name:i.name}]:[])||[];return u`
1991
+ <div class="${this.darkMode?"dark border-white/10 bg-[#1E1F23]":"border-gray-200 bg-white"} flex w-full max-w-md flex-col rounded-3xl border p-4">
1992
+ <!-- Header with order ID -->
1993
+ <div class="mb-2">
1994
+ ${this.orderDetails.order_id_label||!this.streaming?u`<h2 class="text-lg font-semibold text-gray-900 dark:text-white">${this.orderDetails.order_id_label} ${this.orderDetails.order_id_value}</h2>`:u`<div class="h-7 w-full animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>`}
1995
+ </div>
1996
+
1997
+ <!-- Progress timeline -->
1998
+ <div>
1999
+ <ol role="list" class="w-full overflow-hidden">
2000
+ ${J(e,i=>i.label,(i,n)=>{let s=i.status==="completed",o=i.status==="in_progress",a=n===e.length-1;return u`
2001
+ <li class="relative pb-4">
2002
+ ${a?"":u`<div class="${`absolute left-2 top-2 -ml-px mt-0.5 h-full w-0.5 ${s?`bg-[${this.color}]`:"bg-gray-300 dark:bg-gray-600"}`}" aria-hidden="true"></div>`}
2003
+
2004
+ <div class="group relative flex items-start">
2005
+ ${at(i.status,[["completed",()=>u`
2006
+ <span class="flex h-6 items-center">
2007
+ <span class="flex h-4 w-4 items-center justify-center rounded-full bg-[${this.color}]">
2008
+ <hi-outline class="mb-3 block h-3 w-3 text-white dark:text-gray-800" name="check"></hi-outline>
2009
+ </span>
2010
+ </span>
2011
+ `],["in_progress",()=>u`
2012
+ <span class="flex h-6 items-center">
2013
+ <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[${this.color}] bg-white dark:bg-[#1E1F23]">
2014
+ <span class="h-1.5 w-1.5 rounded-full bg-[${this.color}]"></span>
2015
+ </span>
2016
+ </span>
2017
+ `],["pending",()=>u`
2018
+ <span class="flex h-6 items-center">
2019
+ <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]">
2020
+ <span class="h-1.5 w-1.5 rounded-full bg-transparent"></span>
2021
+ </span>
2022
+ </span>
2023
+ `]],()=>u`
2024
+ <span class="flex h-6 items-center">
2025
+ <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[${this.color}] bg-white dark:bg-[#1E1F23]">
2026
+ <span class="h-1.5 w-1.5 rounded-full bg-[${this.color}]"></span>
2027
+ </span>
2028
+ </span>
2029
+ `)}
2030
+
2031
+ <span class="ml-3 flex min-w-0 flex-col">
2032
+ <span class="${`text-sm font-medium ${o?`text-[${this.color}]`:s?"text-gray-900 dark:text-gray-100":"text-gray-500 dark:text-gray-400"}`}">
2033
+ ${i.label}
2034
+ </span>
2035
+ </span>
2036
+ </div>
2037
+ </li>
2038
+ `})}
2039
+ </ol>
2040
+ </div>
2041
+
2042
+ <!-- Products list with order items -->
2043
+ <div class="mb-2 w-full">
2044
+ ${r.length===0&&!this.orderDetails.total_amount&&this.streaming?u`
2045
+ <!-- Loading shimmer for products -->
2046
+ <div class="w-full space-y-4">
2047
+ <div class="flex items-center gap-2">
2048
+ <div class="h-12 w-12 animate-pulse rounded-lg bg-gray-200 dark:bg-gray-600"></div>
2049
+ <div class="flex-1 space-y-2">
2050
+ <div class="h-4 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2051
+ <div class="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2052
+ </div>
2053
+ </div>
2054
+ <div class="flex items-center justify-between">
2055
+ <div class="h-4 w-12 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2056
+ <div class="h-4 w-10 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2057
+ </div>
2058
+ </div>
2059
+ `:u`
2060
+ <div class="divide-y divide-gray-100 dark:divide-gray-600">
2061
+ ${this.streaming&&!r.length?u`
2062
+ <!-- Loading shimmer for individual products -->
2063
+ ${[1,2].map(()=>u`
2064
+ <div class="flex items-center gap-2 py-1.5">
2065
+ <div class="h-12 w-12 animate-pulse rounded-lg bg-gray-200 dark:bg-gray-600"></div>
2066
+ <div class="min-w-0 flex-1">
2067
+ <div class="h-4 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2068
+ </div>
2069
+ <div class="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2070
+ </div>
2071
+ `)}
2072
+ `:J(r,i=>i.name,i=>u`
2073
+ <div class="flex items-center gap-2 py-1.5">
2074
+ <img src="${W(i.image)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
2075
+
2076
+ <div class="min-w-0 flex-1">
2077
+ ${!i.name&&this.streaming?u`<div class="h-4 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>`:u`<h3 class="truncate text-sm font-medium text-gray-900 dark:text-gray-100">${i.name}</h3>`}
2078
+ </div>
2079
+
2080
+ ${!i.price&&this.streaming?u`<div class="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>`:u`<span class="text-sm text-gray-500 dark:text-gray-400">${i.quantity&&Number(i.quantity)>1?"x":""} ${i.price}</span>`}
2081
+ </div>
2082
+ `)}
2083
+ </div>
2084
+
2085
+ <!-- Order total -->
2086
+ <div class="mt-1 border-t border-gray-200 pt-1 dark:border-gray-600">
2087
+ <div class="flex justify-between font-medium text-gray-900 dark:text-gray-100">
2088
+ <span>${this.orderDetails.total_label}</span>
2089
+ <span>${this.orderDetails.total_amount}</span>
2090
+ </div>
2091
+ </div>
2092
+ `}
2093
+ </div>
2094
+
2095
+ <!-- Shipping and payment information -->
2096
+ <div class="mb-2 flex w-full flex-col gap-2 overflow-hidden">
2097
+ ${this.streaming&&!this.orderDetails?u`
2098
+ <!-- Loading shimmer template -->
2099
+ ${[1,2].map(()=>u`
2100
+ <div>
2101
+ <div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2102
+ <div class="space-y-2 overflow-hidden">
2103
+ <div class="h-4 w-40 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2104
+ <div class="h-4 w-36 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2105
+ </div>
2106
+ </div>
2107
+ `)}
2108
+ `:u`
2109
+ <!-- Shipping Section -->
2110
+ <div>
2111
+ ${this.streaming&&!this.orderDetails.shipping_label&&!this.orderDetails.shipping_method?u`
2112
+ <div>
2113
+ <div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2114
+ <div class="space-y-2 overflow-hidden">
2115
+ <div class="h-4 w-40 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2116
+ <div class="h-4 w-36 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2117
+ </div>
2118
+ </div>
2119
+ `:this.orderDetails.shipping_label||this.orderDetails.shipping_method||this.orderDetails.customer_name?u`
2120
+ <h3 class="mb-1 text-sm font-medium text-gray-900 dark:text-gray-100">${this.orderDetails.shipping_label}</h3>
2121
+ <div class="space-y-1">
2122
+ ${this.orderDetails.customer_name?u`<p class="text-xs text-gray-600 dark:text-gray-400">${this.orderDetails.customer_name}</p>`:""}
2123
+ ${this.orderDetails.shipping_method?u`<p class="text-xs text-gray-600 dark:text-gray-400">${this.orderDetails.shipping_method}</p>`:""}
2124
+ </div>
2125
+ `:""}
2126
+ </div>
2127
+
2128
+ <!-- Payment Section -->
2129
+ <div>
2130
+ ${this.streaming&&!this.orderDetails.payment_label?u`
2131
+ <div>
2132
+ <div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2133
+ <div class="space-y-2 overflow-hidden">
2134
+ <div class="h-4 w-40 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2135
+ <div class="h-4 w-36 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2136
+ </div>
2137
+ </div>
2138
+ `:this.orderDetails.payment_label?u`
2139
+ <h3 class="mb-1 text-sm font-medium text-gray-900 dark:text-gray-100">${this.orderDetails.payment_label}</h3>
2140
+ ${this.orderDetails.payment_method_label&&this.orderDetails.payment_method_value?u`
2141
+ <p class="text-xs text-gray-600 dark:text-gray-400">
2142
+ <span class="font-medium">${this.orderDetails.payment_method_label}:</span>
2143
+ ${this.orderDetails.payment_method_value}
2144
+ </p>
2145
+ `:""}
2146
+ ${this.orderDetails.payment_status_label&&this.orderDetails.payment_status_value?u`
2147
+ <p class="text-xs text-gray-600 dark:text-gray-400">
2148
+ <span class="font-medium">${this.orderDetails.payment_status_label}:</span>
2149
+ <span>${this.orderDetails.payment_status_value}</span>
2150
+ </p>
2151
+ `:""}
2152
+ `:""}
2153
+ </div>
2154
+ `}
2155
+ </div>
2156
+
2157
+ <!-- Action buttons section -->
2158
+ <div class="flex w-full flex-col gap-2 overflow-hidden">
2159
+ ${this.streaming&&!this.orderDetails.order_tracking_label&&!Xe(this.orderDetails.order_tracking_url||"")?u`
2160
+ <!-- Loading shimmer for buttons -->
2161
+ <div class="h-10 w-full min-w-[250px] animate-pulse overflow-hidden rounded-xl bg-gray-200 dark:bg-gray-600"></div>
2162
+ `:this.orderDetails.order_tracking_url&&Xe(this.orderDetails.order_tracking_url)?u`
2163
+ <a
2164
+ target="${this.linksNewTab?"_blank":"_self"}"
2165
+ href="${this.orderDetails.order_tracking_url}"
2166
+ class="mt-1 w-full rounded-xl bg-[${this.color}] px-4 py-2 text-center text-sm font-medium text-white hover:opacity-90 dark:text-black">
2167
+ ${this.orderDetails.order_tracking_label}
2168
+ </a>
2169
+ `:null}
2170
+ </div>
2171
+ </div>
2172
+ `}};customElements.get("mw-order-card")||customElements.define("mw-order-card",$n);var En=class extends k(v){static properties={product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.product=void 0,this.streaming=!1,this.linksNewTab=!1,this.searchParams=void 0,this.imagesByProductUrl={},this.darkMode=!1}get trackedProductUrl(){let e=this.product?.url,r=this.searchParams;try{if(e&&r)return Ps(e,r).href}catch{}return e}render(){let{name:e,description:r,price:i,url:n}=this.product||{},s=n?this.imagesByProductUrl?.[n]:void 0;return u`
1979
2173
  <a
1980
- href="${z(this.trackedProductUrl)}"
1981
- title="${z(e)}"
1982
- class="${this.darkMode?"dark":""} group flex w-full max-w-md cursor-pointer gap-[10px] overflow-hidden rounded-lg"
2174
+ href="${W(this.trackedProductUrl)}"
2175
+ title="${W(e)}"
2176
+ class="${this.darkMode?"dark bg-gray-800":"bg-white"} group flex w-full max-w-md cursor-pointer gap-2.5 overflow-hidden rounded-lg"
1983
2177
  target="${this.linksNewTab?"_blank":"_self"}"
1984
2178
  ?disabled="${this.streaming}">
1985
- ${this.streaming?d`
2179
+ ${this.streaming?u`
1986
2180
  <!-- shimmer -->
1987
2181
  <div class="h-[70px] w-[70px] animate-pulse overflow-hidden rounded-lg bg-gray-200 dark:bg-gray-700"></div>
1988
- `:d`<img src="${z(s)}" class="block h-[70px] w-[70px] rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />`}
2182
+ `:s?u`<img src="${s}" class="block h-[70px] w-[70px] rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />`:u`
2183
+ <div class="flex h-[70px] w-[70px] items-center justify-center overflow-hidden rounded-lg bg-gray-100 object-cover dark:bg-gray-700">
2184
+ <svg class="block" viewBox="0 0 100 133" fill="none" xmlns="http://www.w3.org/2000/svg">
2185
+ <rect width="100" height="133" rx="2" class="fill-gray-200 dark:fill-gray-600" transform="matrix(0.9999999999999999, 0, 0, 0.9999999999999999, 0, -7.105427357601002e-15)" />
2186
+ <g transform="matrix(0.6458070278167725, 0, 0, 0.5434090495109558, -19.74715805053711, -14.242161750793464)">
2187
+ <rect x="92" y="135.169" width="32" height="26.831" rx="2" stroke-width="4" class="stroke-gray-400 dark:stroke-white" style="isolation: isolate; fill: none;" />
2188
+ <path
2189
+ fill-rule="evenodd"
2190
+ clip-rule="evenodd"
2191
+ d="M 109.142 156.857 L 104 149 L 94 160 L 108 160 L 114 160 L 122 160 L 115 153 L 109.142 156.857 Z"
2192
+ class="fill-gray-400 dark:fill-white" />
2193
+ <circle cx="110" cy="146" r="3" class="fill-gray-400 dark:fill-white" />
2194
+ </g>
2195
+ </svg>
2196
+ </div>
2197
+ `}
1989
2198
 
1990
2199
  <div class="flex flex-1 flex-col justify-between">
1991
2200
  <div>
1992
- ${e||!this.streaming?d`<h3 class="line-clamp-1 text-sm font-medium text-black group-hover:underline dark:text-white">${e}</h3>`:d`<div class="h-5 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></div>`}
2201
+ ${e||!this.streaming?u`<h3 class="line-clamp-1 text-sm font-medium text-black group-hover:underline dark:text-white">${e}</h3>`:u`<div class="h-5 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></div>`}
1993
2202
 
1994
2203
  <!-- no margin here -->
1995
2204
 
1996
- ${r||!this.streaming?d`<p class="line-clamp-2 text-xs text-gray-500 dark:text-gray-400">${r}</p>`:d`<div class="my-1 h-6 w-3/4 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></div>`}
2205
+ ${r||!this.streaming?u`<p class="line-clamp-2 text-xs text-gray-500 dark:text-gray-400">${r}</p>`:u`<div class="my-1 h-6 w-3/4 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></div>`}
1997
2206
  </div>
1998
2207
 
1999
2208
  <!-- flexbox filled space -->
2000
2209
 
2001
- ${n||!this.streaming?d`<span class="text-xs text-gray-900 dark:text-white">${n}</span>`:d`<div class="h-4 w-14 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></div>`}
2210
+ ${i||!this.streaming?u`<span class="text-xs text-gray-900 dark:text-white">${i}</span>`:u`<div class="h-4 w-14 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></div>`}
2002
2211
  </div>
2003
2212
  </a>
2004
- `}};customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",Ci);function jr(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}var Dr=function(){},it=function(){};var jt=(t,e,r)=>Math.min(Math.max(r,t),e);var Si=.001,Gc=.01,zo=10,Zc=.05,Jc=1;function Wo({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s;Dr(t<=zo*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=jt(Zc,Jc,o),t=jt(Gc,zo,t/1e3),o<1?(i=c=>{let u=c*o,h=u*t,p=u-r,g=Or(c,o),f=Math.exp(-h);return Si-p/g*f},s=c=>{let h=c*o*t,p=h*r+r,g=Math.pow(o,2)*Math.pow(c,2)*t,f=Math.exp(-h),S=Or(Math.pow(c,2),o);return(-i(c)+Si>0?-1:1)*((p-g)*f)/S}):(i=c=>{let u=Math.exp(-c*t),h=(c-r)*t+1;return-Si+u*h},s=c=>{let u=Math.exp(-c*t),h=(r-c)*(t*t);return u*h});let a=5/t,l=Yc(i,s,a);if(t=t*1e3,isNaN(l))return{stiffness:100,damping:10,duration:t};{let c=Math.pow(l,2)*n;return{stiffness:c,damping:o*2*Math.sqrt(n*c),duration:t}}}var Kc=12;function Yc(t,e,r){let n=r;for(let i=1;i<Kc;i++)n=n-t(n)/e(n);return n}function Or(t,e){return t*Math.sqrt(1-e*e)}var Xc=["duration","bounce"],Qc=["stiffness","damping","mass"];function Go(t,e){return e.some(r=>t[r]!==void 0)}function eu(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Go(t,Qc)&&Go(t,Xc)){let r=Wo(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Ur(t){var{from:e=0,to:r=1,restSpeed:n=2,restDelta:i}=t,s=jr(t,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:a,damping:l,mass:c,velocity:u,duration:h,isResolvedFromDuration:p}=eu(s),g=Zo,f=Zo;function S(){let b=u?-(u/1e3):0,E=r-e,y=l/(2*Math.sqrt(a*c)),x=Math.sqrt(a/c)/1e3;if(i===void 0&&(i=Math.min(Math.abs(r-e)/100,.4)),y<1){let $=Or(x,y);g=L=>{let R=Math.exp(-y*x*L);return r-R*((b+y*x*E)/$*Math.sin($*L)+E*Math.cos($*L))},f=L=>{let R=Math.exp(-y*x*L);return y*x*R*(Math.sin($*L)*(b+y*x*E)/$+E*Math.cos($*L))-R*(Math.cos($*L)*(b+y*x*E)-$*E*Math.sin($*L))}}else if(y===1)g=$=>r-Math.exp(-x*$)*(E+(b+x*E)*$);else{let $=x*Math.sqrt(y*y-1);g=L=>{let R=Math.exp(-y*x*L),F=Math.min($*L,300);return r-R*((b+y*x*E)*Math.sinh(F)+$*E*Math.cosh(F))/$}}}return S(),{next:b=>{let E=g(b);if(p)o.done=b>=h;else{let y=f(b)*1e3,x=Math.abs(y)<=n,$=Math.abs(r-E)<=i;o.done=x&&$}return o.value=o.done?r:E,o},flipTarget:()=>{u=-u,[e,r]=[r,e],S()}}}Ur.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var Zo=t=>0;var Ei=(t,e,r)=>{let n=e-t;return n===0?1:(r-t)/n};var st=(t,e,r)=>-r*t+r*e+t;var Pr=(t,e)=>r=>Math.max(Math.min(r,e),t),be=t=>t%1?Number(t.toFixed(5)):t,ot=/(-)?([\d]*\.?[\d])+/g,Rr=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Jo=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function fe(t){return typeof t=="string"}var at={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Br=Object.assign(Object.assign({},at),{transform:Pr(0,1)}),Q1=Object.assign(Object.assign({},at),{default:1});var Dt=t=>({test:e=>fe(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),rf=Dt("deg"),lt=Dt("%"),nf=Dt("px"),sf=Dt("vh"),of=Dt("vw"),af=Object.assign(Object.assign({},lt),{parse:t=>lt.parse(t)/100,transform:t=>lt.transform(t*100)});var ct=(t,e)=>r=>!!(fe(r)&&Jo.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),qr=(t,e,r)=>n=>{if(!fe(n))return n;let[i,s,o,a]=n.match(ot);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var ce={test:ct("hsl","hue"),parse:qr("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+lt.transform(be(e))+", "+lt.transform(be(r))+", "+be(Br.transform(n))+")"};var tu=Pr(0,255),Fr=Object.assign(Object.assign({},at),{transform:t=>Math.round(tu(t))}),ee={test:ct("rgb","red"),parse:qr("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+Fr.transform(t)+", "+Fr.transform(e)+", "+Fr.transform(r)+", "+be(Br.transform(n))+")"};function ru(t){let e="",r="",n="",i="";return t.length>5?(e=t.substr(1,2),r=t.substr(3,2),n=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),r=t.substr(2,1),n=t.substr(3,1),i=t.substr(4,1),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}var ut={test:ct("#"),parse:ru,transform:ee.transform};var xe={test:t=>ee.test(t)||ut.test(t)||ce.test(t),parse:t=>ee.test(t)?ee.parse(t):ce.test(t)?ce.parse(t):ut.parse(t),transform:t=>fe(t)?t:t.hasOwnProperty("red")?ee.transform(t):ce.transform(t)};var Ko="${c}",Yo="${n}";function nu(t){var e,r,n,i;return isNaN(t)&&fe(t)&&((r=(e=t.match(ot))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((i=(n=t.match(Rr))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0)>0}function Xo(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,n=t.match(Rr);n&&(r=n.length,t=t.replace(Rr,Ko),e.push(...n.map(xe.parse)));let i=t.match(ot);return i&&(t=t.replace(ot,Yo),e.push(...i.map(at.parse))),{values:e,numColors:r,tokenised:t}}function Qo(t){return Xo(t).values}function ea(t){let{values:e,numColors:r,tokenised:n}=Xo(t),i=e.length;return s=>{let o=n;for(let a=0;a<i;a++)o=o.replace(a<r?Ko:Yo,a<r?xe.transform(s[a]):be(s[a]));return o}}var iu=t=>typeof t=="number"?0:t;function su(t){let e=Qo(t);return ea(t)(e.map(iu))}var Nr={test:nu,parse:Qo,createTransformer:ea,getAnimatableNone:su};function $i(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function _i({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{let a=r<.5?r*(1+e):r+e-r*e,l=2*r-a;i=$i(l,a,t+1/3),s=$i(l,a,t),o=$i(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}var ou=(t,e,r)=>{let n=t*t,i=e*e;return Math.sqrt(Math.max(0,r*(i-n)+n))},au=[ut,ee,ce],ta=t=>au.find(e=>e.test(t)),ra=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,Vr=(t,e)=>{let r=ta(t),n=ta(e);it(!!r,ra(t)),it(!!n,ra(e));let i=r.parse(t),s=n.parse(e);r===ce&&(i=_i(i),r=ee),n===ce&&(s=_i(s),n=ee);let o=Object.assign({},i);return a=>{for(let l in o)l!=="alpha"&&(o[l]=ou(i[l],s[l],a));return o.alpha=st(i.alpha,s.alpha,a),r.transform(o)}};var na=t=>typeof t=="number";var lu=(t,e)=>r=>e(t(r)),Hr=(...t)=>t.reduce(lu);function sa(t,e){return na(t)?r=>st(t,e,r):xe.test(t)?Vr(t,e):Ii(t,e)}var Mi=(t,e)=>{let r=[...t],n=r.length,i=t.map((s,o)=>sa(s,e[o]));return s=>{for(let o=0;o<n;o++)r[o]=i[o](s);return r}},oa=(t,e)=>{let r=Object.assign(Object.assign({},t),e),n={};for(let i in r)t[i]!==void 0&&e[i]!==void 0&&(n[i]=sa(t[i],e[i]));return i=>{for(let s in n)r[s]=n[s](i);return r}};function ia(t){let e=Nr.parse(t),r=e.length,n=0,i=0,s=0;for(let o=0;o<r;o++)n||typeof e[o]=="number"?n++:e[o].hue!==void 0?s++:i++;return{parsed:e,numNumbers:n,numRGB:i,numHSL:s}}var Ii=(t,e)=>{let r=Nr.createTransformer(e),n=ia(t),i=ia(e);return n.numHSL===i.numHSL&&n.numRGB===i.numRGB&&n.numNumbers>=i.numNumbers?Hr(Mi(n.parsed,i.parsed),r):(Dr(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),o=>`${o>0?e:t}`)};var cu=(t,e)=>r=>st(t,e,r);function uu(t){if(typeof t=="number")return cu;if(typeof t=="string")return xe.test(t)?Vr:Ii;if(Array.isArray(t))return Mi;if(typeof t=="object")return oa}function du(t,e,r){let n=[],i=r||uu(t[0]),s=t.length-1;for(let o=0;o<s;o++){let a=i(t[o],t[o+1]);if(e){let l=Array.isArray(e)?e[o]:e;a=Hr(l,a)}n.push(a)}return n}function hu([t,e],[r]){return n=>r(Ei(t,e,n))}function pu(t,e){let r=t.length,n=r-1;return i=>{let s=0,o=!1;if(i<=t[0]?o=!0:i>=t[n]&&(s=n-1,o=!0),!o){let l=1;for(;l<r&&!(t[l]>i||l===n);l++);s=l-1}let a=Ei(t[s],t[s+1],i);return e[s](a)}}function zr(t,e,{clamp:r=!0,ease:n,mixer:i}={}){let s=t.length;it(s===e.length,"Both input and output ranges must be the same length"),it(!n||!Array.isArray(n)||n.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());let o=du(e,n,i),a=s===2?hu(t,o):pu(t,o);return r?l=>a(jt(t[0],t[s-1],l)):a}var Ot=t=>e=>1-t(1-e),Wr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,aa=t=>e=>Math.pow(e,t),Ai=t=>e=>e*e*((t+1)*e-t),la=t=>{let e=Ai(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var ca=1.525,fu=4/11,mu=8/11,gu=9/10;var ua=aa(2),u2=Ot(ua),da=Wr(ua),wu=t=>1-Math.sin(Math.acos(t)),yu=Ot(wu),d2=Wr(yu),ha=Ai(ca),h2=Ot(ha),p2=Wr(ha),f2=la(ca),vu=4356/361,bu=35442/1805,xu=16061/1805,ku=t=>{if(t===1||t===0)return t;let e=t*t;return t<fu?7.5625*e:t<mu?9.075*e-9.9*t+3.4:t<gu?vu*e-bu*t+xu:10.8*t*t-20.52*t+10.72},m2=Ot(ku);function Cu(t,e){return t.map(()=>e||da).splice(0,t.length-1)}function Su(t){let e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function Eu(t,e){return t.map(r=>r*e)}function Ut({from:t=0,to:e=1,ease:r,offset:n,duration:i=300}){let s={done:!1,value:t},o=Array.isArray(e)?e:[t,e],a=Eu(n&&n.length===o.length?n:Su(o),i);function l(){return zr(a,o,{ease:Array.isArray(r)?r:Cu(o,r)})}let c=l();return{next:u=>(s.value=c(u),s.done=u>=i,s),flipTarget:()=>{o.reverse(),c=l()}}}function pa({velocity:t=0,from:e=0,power:r=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){let o={done:!1,value:e},a=r*t,l=e+a,c=s===void 0?l:s(l);return c!==l&&(a=c-e),{next:u=>{let h=-a*Math.exp(-u/n);return o.done=!(h>i||h<-i),o.value=o.done?c:c+h,o},flipTarget:()=>{}}}var fa={keyframes:Ut,spring:Ur,decay:pa};function ma(t){if(Array.isArray(t.to))return Ut;if(fa[t.type])return fa[t.type];let e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Ut:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Ur:Ut}var Ti=16.666666666666668,$u=typeof performance<"u"?()=>performance.now():()=>Date.now(),Li=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t($u()),Ti);function ga(t){let e=[],r=[],n=0,i=!1,s=!1,o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{let h=u&&i,p=h?e:r;return c&&o.add(l),p.indexOf(l)===-1&&(p.push(l),h&&i&&(n=e.length)),l},cancel:l=>{let c=r.indexOf(l);c!==-1&&r.splice(c,1),o.delete(l)},process:l=>{if(i){s=!0;return}if(i=!0,[e,r]=[r,e],r.length=0,n=e.length,n)for(let c=0;c<n;c++){let u=e[c];u(l),o.has(u)&&(a.schedule(u),t())}i=!1,s&&(s=!1,a.process(l))}};return a}var _u=40,ji=!0,Rt=!1,Di=!1,Pt={delta:0,timestamp:0},Bt=["read","update","preRender","render","postRender"],Gr=Bt.reduce((t,e)=>(t[e]=ga(()=>Rt=!0),t),{}),Mu=Bt.reduce((t,e)=>{let r=Gr[e];return t[e]=(n,i=!1,s=!1)=>(Rt||Au(),r.schedule(n,i,s)),t},{}),wa=Bt.reduce((t,e)=>(t[e]=Gr[e].cancel,t),{}),I2=Bt.reduce((t,e)=>(t[e]=()=>Gr[e].process(Pt),t),{}),Iu=t=>Gr[t].process(Pt),ya=t=>{Rt=!1,Pt.delta=ji?Ti:Math.max(Math.min(t-Pt.timestamp,_u),1),Pt.timestamp=t,Di=!0,Bt.forEach(Iu),Di=!1,Rt&&(ji=!1,Li(ya))},Au=()=>{Rt=!0,ji=!0,Di||Li(ya)};var va=Mu;function Oi(t,e,r=0){return t-e-r}function ba(t,e,r=0,n=!0){return n?Oi(e+-t,e,r):e-(t-e)+r}function xa(t,e,r,n){return n?t>=e+r:t<=-r}var Tu=t=>{let e=({delta:r})=>t(r);return{start:()=>va.update(e,!0),stop:()=>wa.update(e)}};function Ui(t){var e,r,{from:n,autoplay:i=!0,driver:s=Tu,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:u,onStop:h,onComplete:p,onRepeat:g,onUpdate:f}=t,S=jr(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:b}=S,E,y=0,x=S.duration,$,L=!1,R=!0,F,M=ma(S);!((r=(e=M).needsInterpolation)===null||r===void 0)&&r.call(e,n,b)&&(F=zr([0,100],[n,b],{clamp:!1}),n=0,b=100);let N=M(Object.assign(Object.assign({},S),{from:n,to:b}));function W(){y++,l==="reverse"?(R=y%2===0,o=ba(o,x,c,R)):(o=Oi(o,x,c),l==="mirror"&&N.flipTarget()),L=!1,g&&g()}function nn(){E.stop(),p&&p()}function Ce(O){if(R||(O=-O),o+=O,!L){let V=N.next(Math.max(0,o));$=V.value,F&&($=F($)),L=R?V.done:o<=0}f?.($),L&&(y===0&&(x??(x=o)),y<a?xa(o,x,c,R)&&W():nn())}function zt(){u?.(),E=s(Ce),E.start()}return i&&zt(),{stop:()=>{h?.(),E.stop()}}}var qt=class t extends C(v){static properties={product:{type:Object},labels:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}};constructor(){super(),this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this.darkMode=!1,this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(e){e.has("product")&&this.#e()}#e(){if(!this.product?.url){this._isValidUrl=!1;return}try{let e=new URL(this.product.url);this._isValidUrl=e.protocol==="http:"||e.protocol==="https:"}catch{this._isValidUrl=!1}}get images(){return this.product?.images||[]}render(){if(!this.product)return d`
2213
+ `}};customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",En);function Ur(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}var Pr=function(){},lt=function(){};var Ut=(t,e,r)=>Math.min(Math.max(r,t),e);var Mn=.001,Kc=.01,Jo=10,Xc=.05,Yc=1;function Ko({duration:t=800,bounce:e=.25,velocity:r=0,mass:i=1}){let n,s;Pr(t<=Jo*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=Ut(Xc,Yc,o),t=Ut(Kc,Jo,t/1e3),o<1?(n=c=>{let d=c*o,h=d*t,p=d-r,g=Rr(c,o),f=Math.exp(-h);return Mn-p/g*f},s=c=>{let h=c*o*t,p=h*r+r,g=Math.pow(o,2)*Math.pow(c,2)*t,f=Math.exp(-h),$=Rr(Math.pow(c,2),o);return(-n(c)+Mn>0?-1:1)*((p-g)*f)/$}):(n=c=>{let d=Math.exp(-c*t),h=(c-r)*t+1;return-Mn+d*h},s=c=>{let d=Math.exp(-c*t),h=(r-c)*(t*t);return d*h});let a=5/t,l=eu(n,s,a);if(t=t*1e3,isNaN(l))return{stiffness:100,damping:10,duration:t};{let c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:t}}}var Qc=12;function eu(t,e,r){let i=r;for(let n=1;n<Qc;n++)i=i-t(i)/e(i);return i}function Rr(t,e){return t*Math.sqrt(1-e*e)}var tu=["duration","bounce"],ru=["stiffness","damping","mass"];function Xo(t,e){return e.some(r=>t[r]!==void 0)}function iu(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Xo(t,ru)&&Xo(t,tu)){let r=Ko(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Br(t){var{from:e=0,to:r=1,restSpeed:i=2,restDelta:n}=t,s=Ur(t,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:a,damping:l,mass:c,velocity:d,duration:h,isResolvedFromDuration:p}=iu(s),g=Yo,f=Yo;function $(){let b=d?-(d/1e3):0,S=r-e,y=l/(2*Math.sqrt(a*c)),x=Math.sqrt(a/c)/1e3;if(n===void 0&&(n=Math.min(Math.abs(r-e)/100,.4)),y<1){let E=Rr(x,y);g=T=>{let B=Math.exp(-y*x*T);return r-B*((b+y*x*S)/E*Math.sin(E*T)+S*Math.cos(E*T))},f=T=>{let B=Math.exp(-y*x*T);return y*x*B*(Math.sin(E*T)*(b+y*x*S)/E+S*Math.cos(E*T))-B*(Math.cos(E*T)*(b+y*x*S)-E*S*Math.sin(E*T))}}else if(y===1)g=E=>r-Math.exp(-x*E)*(S+(b+x*S)*E);else{let E=x*Math.sqrt(y*y-1);g=T=>{let B=Math.exp(-y*x*T),N=Math.min(E*T,300);return r-B*((b+y*x*S)*Math.sinh(N)+E*S*Math.cosh(N))/E}}}return $(),{next:b=>{let S=g(b);if(p)o.done=b>=h;else{let y=f(b)*1e3,x=Math.abs(y)<=i,E=Math.abs(r-S)<=n;o.done=x&&E}return o.value=o.done?r:S,o},flipTarget:()=>{d=-d,[e,r]=[r,e],$()}}}Br.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var Yo=t=>0;var In=(t,e,r)=>{let i=e-t;return i===0?1:(r-t)/i};var ct=(t,e,r)=>-r*t+r*e+t;var Fr=(t,e)=>r=>Math.max(Math.min(r,e),t),Ce=t=>t%1?Number(t.toFixed(5)):t,ut=/(-)?([\d]*\.?[\d])+/g,qr=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Qo=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function we(t){return typeof t=="string"}var dt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Vr=Object.assign(Object.assign({},dt),{transform:Fr(0,1)}),rf=Object.assign(Object.assign({},dt),{default:1});var Pt=t=>({test:e=>we(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),of=Pt("deg"),ht=Pt("%"),af=Pt("px"),lf=Pt("vh"),cf=Pt("vw"),uf=Object.assign(Object.assign({},ht),{parse:t=>ht.parse(t)/100,transform:t=>ht.transform(t*100)});var pt=(t,e)=>r=>!!(we(r)&&Qo.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),Nr=(t,e,r)=>i=>{if(!we(i))return i;let[n,s,o,a]=i.match(ut);return{[t]:parseFloat(n),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var de={test:pt("hsl","hue"),parse:Nr("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:i=1})=>"hsla("+Math.round(t)+", "+ht.transform(Ce(e))+", "+ht.transform(Ce(r))+", "+Ce(Vr.transform(i))+")"};var nu=Fr(0,255),Hr=Object.assign(Object.assign({},dt),{transform:t=>Math.round(nu(t))}),ie={test:pt("rgb","red"),parse:Nr("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:i=1})=>"rgba("+Hr.transform(t)+", "+Hr.transform(e)+", "+Hr.transform(r)+", "+Ce(Vr.transform(i))+")"};function su(t){let e="",r="",i="",n="";return t.length>5?(e=t.substr(1,2),r=t.substr(3,2),i=t.substr(5,2),n=t.substr(7,2)):(e=t.substr(1,1),r=t.substr(2,1),i=t.substr(3,1),n=t.substr(4,1),e+=e,r+=r,i+=i,n+=n),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(i,16),alpha:n?parseInt(n,16)/255:1}}var ft={test:pt("#"),parse:su,transform:ie.transform};var _e={test:t=>ie.test(t)||ft.test(t)||de.test(t),parse:t=>ie.test(t)?ie.parse(t):de.test(t)?de.parse(t):ft.parse(t),transform:t=>we(t)?t:t.hasOwnProperty("red")?ie.transform(t):de.transform(t)};var ea="${c}",ta="${n}";function ou(t){var e,r,i,n;return isNaN(t)&&we(t)&&((r=(e=t.match(ut))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((n=(i=t.match(qr))===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0)>0}function ra(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,i=t.match(qr);i&&(r=i.length,t=t.replace(qr,ea),e.push(...i.map(_e.parse)));let n=t.match(ut);return n&&(t=t.replace(ut,ta),e.push(...n.map(dt.parse))),{values:e,numColors:r,tokenised:t}}function ia(t){return ra(t).values}function na(t){let{values:e,numColors:r,tokenised:i}=ra(t),n=e.length;return s=>{let o=i;for(let a=0;a<n;a++)o=o.replace(a<r?ea:ta,a<r?_e.transform(s[a]):Ce(s[a]));return o}}var au=t=>typeof t=="number"?0:t;function lu(t){let e=ia(t);return na(t)(e.map(au))}var zr={test:ou,parse:ia,createTransformer:na,getAnimatableNone:lu};function An(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Dn({hue:t,saturation:e,lightness:r,alpha:i}){t/=360,e/=100,r/=100;let n=0,s=0,o=0;if(!e)n=s=o=r;else{let a=r<.5?r*(1+e):r+e-r*e,l=2*r-a;n=An(l,a,t+1/3),s=An(l,a,t),o=An(l,a,t-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}var cu=(t,e,r)=>{let i=t*t,n=e*e;return Math.sqrt(Math.max(0,r*(n-i)+i))},uu=[ft,ie,de],sa=t=>uu.find(e=>e.test(t)),oa=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,Wr=(t,e)=>{let r=sa(t),i=sa(e);lt(!!r,oa(t)),lt(!!i,oa(e));let n=r.parse(t),s=i.parse(e);r===de&&(n=Dn(n),r=ie),i===de&&(s=Dn(s),i=ie);let o=Object.assign({},n);return a=>{for(let l in o)l!=="alpha"&&(o[l]=cu(n[l],s[l],a));return o.alpha=ct(n.alpha,s.alpha,a),r.transform(o)}};var aa=t=>typeof t=="number";var du=(t,e)=>r=>e(t(r)),Gr=(...t)=>t.reduce(du);function ca(t,e){return aa(t)?r=>ct(t,e,r):_e.test(t)?Wr(t,e):Ln(t,e)}var jn=(t,e)=>{let r=[...t],i=r.length,n=t.map((s,o)=>ca(s,e[o]));return s=>{for(let o=0;o<i;o++)r[o]=n[o](s);return r}},ua=(t,e)=>{let r=Object.assign(Object.assign({},t),e),i={};for(let n in r)t[n]!==void 0&&e[n]!==void 0&&(i[n]=ca(t[n],e[n]));return n=>{for(let s in i)r[s]=i[s](n);return r}};function la(t){let e=zr.parse(t),r=e.length,i=0,n=0,s=0;for(let o=0;o<r;o++)i||typeof e[o]=="number"?i++:e[o].hue!==void 0?s++:n++;return{parsed:e,numNumbers:i,numRGB:n,numHSL:s}}var Ln=(t,e)=>{let r=zr.createTransformer(e),i=la(t),n=la(e);return i.numHSL===n.numHSL&&i.numRGB===n.numRGB&&i.numNumbers>=n.numNumbers?Gr(jn(i.parsed,n.parsed),r):(Pr(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),o=>`${o>0?e:t}`)};var hu=(t,e)=>r=>ct(t,e,r);function pu(t){if(typeof t=="number")return hu;if(typeof t=="string")return _e.test(t)?Wr:Ln;if(Array.isArray(t))return jn;if(typeof t=="object")return ua}function fu(t,e,r){let i=[],n=r||pu(t[0]),s=t.length-1;for(let o=0;o<s;o++){let a=n(t[o],t[o+1]);if(e){let l=Array.isArray(e)?e[o]:e;a=Gr(l,a)}i.push(a)}return i}function mu([t,e],[r]){return i=>r(In(t,e,i))}function gu(t,e){let r=t.length,i=r-1;return n=>{let s=0,o=!1;if(n<=t[0]?o=!0:n>=t[i]&&(s=i-1,o=!0),!o){let l=1;for(;l<r&&!(t[l]>n||l===i);l++);s=l-1}let a=In(t[s],t[s+1],n);return e[s](a)}}function Zr(t,e,{clamp:r=!0,ease:i,mixer:n}={}){let s=t.length;lt(s===e.length,"Both input and output ranges must be the same length"),lt(!i||!Array.isArray(i)||i.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());let o=fu(e,i,n),a=s===2?mu(t,o):gu(t,o);return r?l=>a(Ut(t[0],t[s-1],l)):a}var Rt=t=>e=>1-t(1-e),Jr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,da=t=>e=>Math.pow(e,t),Tn=t=>e=>e*e*((t+1)*e-t),ha=t=>{let e=Tn(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var pa=1.525,wu=4/11,yu=8/11,vu=9/10;var fa=da(2),p2=Rt(fa),ma=Jr(fa),bu=t=>1-Math.sin(Math.acos(t)),xu=Rt(bu),f2=Jr(xu),ga=Tn(pa),m2=Rt(ga),g2=Jr(ga),w2=ha(pa),ku=4356/361,Cu=35442/1805,_u=16061/1805,Su=t=>{if(t===1||t===0)return t;let e=t*t;return t<wu?7.5625*e:t<yu?9.075*e-9.9*t+3.4:t<vu?ku*e-Cu*t+_u:10.8*t*t-20.52*t+10.72},y2=Rt(Su);function $u(t,e){return t.map(()=>e||ma).splice(0,t.length-1)}function Eu(t){let e=t.length;return t.map((r,i)=>i!==0?i/(e-1):0)}function Mu(t,e){return t.map(r=>r*e)}function Bt({from:t=0,to:e=1,ease:r,offset:i,duration:n=300}){let s={done:!1,value:t},o=Array.isArray(e)?e:[t,e],a=Mu(i&&i.length===o.length?i:Eu(o),n);function l(){return Zr(a,o,{ease:Array.isArray(r)?r:$u(o,r)})}let c=l();return{next:d=>(s.value=c(d),s.done=d>=n,s),flipTarget:()=>{o.reverse(),c=l()}}}function wa({velocity:t=0,from:e=0,power:r=.8,timeConstant:i=350,restDelta:n=.5,modifyTarget:s}){let o={done:!1,value:e},a=r*t,l=e+a,c=s===void 0?l:s(l);return c!==l&&(a=c-e),{next:d=>{let h=-a*Math.exp(-d/i);return o.done=!(h>n||h<-n),o.value=o.done?c:c+h,o},flipTarget:()=>{}}}var ya={keyframes:Bt,spring:Br,decay:wa};function va(t){if(Array.isArray(t.to))return Bt;if(ya[t.type])return ya[t.type];let e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Bt:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Br:Bt}var On=16.666666666666668,Iu=typeof performance<"u"?()=>performance.now():()=>Date.now(),Un=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Iu()),On);function ba(t){let e=[],r=[],i=0,n=!1,s=!1,o=new WeakSet,a={schedule:(l,c=!1,d=!1)=>{let h=d&&n,p=h?e:r;return c&&o.add(l),p.indexOf(l)===-1&&(p.push(l),h&&n&&(i=e.length)),l},cancel:l=>{let c=r.indexOf(l);c!==-1&&r.splice(c,1),o.delete(l)},process:l=>{if(n){s=!0;return}if(n=!0,[e,r]=[r,e],r.length=0,i=e.length,i)for(let c=0;c<i;c++){let d=e[c];d(l),o.has(d)&&(a.schedule(d),t())}n=!1,s&&(s=!1,a.process(l))}};return a}var Au=40,Pn=!0,qt=!1,Rn=!1,Ft={delta:0,timestamp:0},Vt=["read","update","preRender","render","postRender"],Kr=Vt.reduce((t,e)=>(t[e]=ba(()=>qt=!0),t),{}),Du=Vt.reduce((t,e)=>{let r=Kr[e];return t[e]=(i,n=!1,s=!1)=>(qt||Lu(),r.schedule(i,n,s)),t},{}),xa=Vt.reduce((t,e)=>(t[e]=Kr[e].cancel,t),{}),j2=Vt.reduce((t,e)=>(t[e]=()=>Kr[e].process(Ft),t),{}),ju=t=>Kr[t].process(Ft),ka=t=>{qt=!1,Ft.delta=Pn?On:Math.max(Math.min(t-Ft.timestamp,Au),1),Ft.timestamp=t,Rn=!0,Vt.forEach(ju),Rn=!1,qt&&(Pn=!1,Un(ka))},Lu=()=>{qt=!0,Pn=!0,Rn||Un(ka)};var Ca=Du;function Bn(t,e,r=0){return t-e-r}function _a(t,e,r=0,i=!0){return i?Bn(e+-t,e,r):e-(t-e)+r}function Sa(t,e,r,i){return i?t>=e+r:t<=-r}var Tu=t=>{let e=({delta:r})=>t(r);return{start:()=>Ca.update(e,!0),stop:()=>xa.update(e)}};function Fn(t){var e,r,{from:i,autoplay:n=!0,driver:s=Tu,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:d,onStop:h,onComplete:p,onRepeat:g,onUpdate:f}=t,$=Ur(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:b}=$,S,y=0,x=$.duration,E,T=!1,B=!0,N,I=va($);!((r=(e=I).needsInterpolation)===null||r===void 0)&&r.call(e,i,b)&&(N=Zr([0,100],[i,b],{clamp:!1}),i=0,b=100);let H=I(Object.assign(Object.assign({},$),{from:i,to:b}));function K(){y++,l==="reverse"?(B=y%2===0,o=_a(o,x,c,B)):(o=Bn(o,x,c),l==="mirror"&&H.flipTarget()),T=!1,g&&g()}function oi(){S.stop(),p&&p()}function $e(P){if(B||(P=-P),o+=P,!T){let z=H.next(Math.max(0,o));E=z.value,N&&(E=N(E)),T=B?z.done:o<=0}f?.(E),T&&(y===0&&(x??(x=o)),y<a?Sa(o,x,c,B)&&K():oi())}function Zt(){d?.(),S=s($e),S.start()}return n&&Zt(),{stop:()=>{h?.(),S.stop()}}}var Nt=class t extends k(v){static properties={product:{type:Object},labels:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}};constructor(){super(),this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this.darkMode=!1,this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(e){e.has("product")&&this.#e()}#e(){if(!this.product?.url){this._isValidUrl=!1;return}try{let e=new URL(this.product.url);this._isValidUrl=e.protocol==="http:"||e.protocol==="https:"}catch{this._isValidUrl=!1}}get images(){return this.product?.images||[]}render(){if(!this.product)return u`
2005
2214
  <div class="${this.darkMode?"dark border-gray-600 bg-[#1E1F23]":"border-[#5e5d59]/25 bg-white"} my-2 w-full rounded-3xl border p-4">
2006
2215
  <div class="relative mx-auto mb-4 max-w-[240px]">
2007
2216
  <div class="h-[180px] w-full animate-pulse rounded-2xl bg-gray-200 dark:bg-gray-700"></div>
@@ -2020,15 +2229,15 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2020
2229
  <div class="h-8 flex-auto animate-pulse rounded-xl bg-gray-200 dark:bg-gray-700"></div>
2021
2230
  </div>
2022
2231
  </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`
2232
+ `;if(this.product.layout==="horizontal")return u`<mw-product-card-horizontal product="${JSON.stringify(this.product)}" ?dark-mode="${this.darkMode}"></mw-product-card-horizontal>`;let{name:e,description:r,price:i,category:n}=this.product;return u`
2024
2233
  <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
2234
  <div class="pointer-events-auto mx-auto mb-4">
2026
2235
  <div class="group relative overflow-hidden rounded-2xl">
2027
2236
  <div class="image-slider z-0 flex transition-transform duration-300 ease-in-out" style="transform: translateX(-${this._currentImageIndex*100}%)">
2028
- ${this.images.length>0?Q(this.images,s=>s,(s,o)=>d`
2237
+ ${this.images.length>0?J(this.images,s=>s,(s,o)=>u`
2029
2238
  <!-- TODO: add srcset with 1x/2x variants for high DPI displays -->
2030
2239
  <img src="${s}" alt="image ${o+1}: ${e}" class="h-auto w-full flex-shrink-0 object-scale-down" loading="lazy" />
2031
- `):d`
2240
+ `):u`
2032
2241
  <div class="h-full w-full flex-shrink-0 object-scale-down"></div>
2033
2242
  <svg class="rounded-lg" height="144" viewBox="0 0 100 133" fill="none" xmlns="http://www.w3.org/2000/svg">
2034
2243
  <rect width="100" height="133" rx="2" fill="#EEEEEE" style="" transform="matrix(0.9999999999999999, 0, 0, 0.9999999999999999, 0, -7.105427357601002e-15)" />
@@ -2040,7 +2249,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2040
2249
  </svg>
2041
2250
  `}
2042
2251
  </div>
2043
- ${this.images.length>1?d`
2252
+ ${this.images.length>1?u`
2044
2253
  <div class="absolute inset-0 flex items-center justify-between px-4">
2045
2254
  <button
2046
2255
  @click="${this.#s}"
@@ -2048,15 +2257,15 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2048
2257
  <hi-outline class="block h-6 w-3" name="chevron-left"></hi-outline>
2049
2258
  </button>
2050
2259
  <button
2051
- @click="${this.#i}"
2260
+ @click="${this.#n}"
2052
2261
  class="bg-opacity-80 hover:bg-opacity-100 absolute top-1/2 right-2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-white shadow transition-all dark:bg-gray-700">
2053
2262
  <hi-outline class="block h-6 w-3" name="chevron-right"></hi-outline>
2054
2263
  </button>
2055
2264
  </div>
2056
2265
  `:null}
2057
- ${this.images?.length>1?d`
2266
+ ${this.images?.length>1?u`
2058
2267
  <div class="slider-dots absolute bottom-3 left-1/2 flex -translate-x-1/2 gap-2">
2059
- ${this.images.map((s,o)=>d`
2268
+ ${this.images.map((s,o)=>u`
2060
2269
  <button
2061
2270
  @click="${()=>this.#o(o)}"
2062
2271
  class="${o===this._currentImageIndex?"bg-opacity-100":"bg-opacity-60"} hover:bg-opacity-80 h-1.5 w-1.5 rounded-full bg-white transition-all dark:bg-gray-400"></button>
@@ -2066,17 +2275,19 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2066
2275
  </div>
2067
2276
  </div>
2068
2277
  <div @click="${this.#t}" class="cursor-pointer">
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}
2278
+ ${n?u`
2279
+ <a @click="${this.#t}" class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600 hover:underline dark:text-gray-400">
2280
+ ${n}
2281
+ </a>
2282
+ `:null}
2072
2283
 
2073
2284
  <h3
2074
2285
  @click="${this.#t}"
2075
2286
  class="${this._isValidUrl?"":"pointer-events-none cursor-default"} mb-1 line-clamp-2 cursor-pointer text-lg font-semibold text-black transition-all hover:underline dark:text-gray-200">
2076
- ${e||d`<span class="inline-block h-6 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></span>`}
2287
+ ${e||u`<span class="inline-block h-6 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></span>`}
2077
2288
  </h3>
2078
- ${r?d`<p class="mb-2 line-clamp-2 text-sm text-gray-600 dark:text-gray-400">${r}</p>`:d`<div class="mb-2 h-4 w-3/4 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></div>`}
2079
- <span class="text-lg font-bold text-black dark:text-gray-200"> ${n||d`<span class="inline-block h-6 w-16 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></span>`} </span>
2289
+ ${r?u`<p class="mb-2 line-clamp-2 text-sm text-gray-600 dark:text-gray-400">${r}</p>`:u`<div class="mb-2 h-4 w-3/4 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></div>`}
2290
+ <span class="text-lg font-bold text-black dark:text-gray-200"> ${i||u`<span class="inline-block h-6 w-16 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></span>`} </span>
2080
2291
 
2081
2292
  <!-- <div class="my-4 border-t border-gray-200"></div> -->
2082
2293
 
@@ -2088,21 +2299,21 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2088
2299
  </button> -->
2089
2300
  </div>
2090
2301
  </div>
2091
- `}#t(e){e.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")}#r(e){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new t.AddToCartEvent(this.product)))}#n(e,r){this.#a&&Ui({from:e,to:r,duration:300,onUpdate:n=>{this.#a&&(this.#a.style.transform=`translateX(${n}%)`)}})}#i(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e+1)%this.product.images.length,n=-(e*100),i=-(r*100);this.#n(n,i),this._currentImageIndex=r}#s(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e-1+this.product.images.length)%this.product.images.length,n=-(e*100),i=-(r*100);this.#n(n,i),this._currentImageIndex=r}#o(e){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=Math.max(0,Math.min(e,this.product.images.length-1)),i=-(r*100),s=-(n*100);this.#n(i,s),this._currentImageIndex=n}get#a(){return this.renderRoot.querySelector(".image-slider")}};qt.AddToCartEvent=class extends CustomEvent{static type="mw-product-card:add-to-cart";constructor(e,r={}){super(qt.AddToCartEvent.type,{detail:{product:e},...r})}};customElements.get("mw-product-card")||customElements.define("mw-product-card",qt);function dt(t){return Array.isArray(t)?t:t?[t]:[]}function ka(t,e){let r=new Map;for(let n of t){let i=e(n);r.has(i)||r.set(i,[]),(r.get(i)||[]).push(n)}return r}var Zr=(t,e,r)=>{for(let n of e)if(n[0]===t)return(0,n[1])();return r?.()};var Pi=class extends C(v){static properties={orderDetails:{type:Object,attribute:"order-details"},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1,this.color="#601feb",this.darkMode=!1}render(){let e=dt(this.orderDetails?.order_status?.step||[]),r=dt(this.orderDetails?.items?.item||[]),n=dt(this.orderDetails?.actions||[]);return d`
2302
+ `}#t(e){e.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")}#r(e){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new t.AddToCartEvent(this.product)))}#i(e,r){this.#a&&Fn({from:e,to:r,duration:300,onUpdate:i=>{this.#a&&(this.#a.style.transform=`translateX(${i}%)`)}})}#n(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e+1)%this.product.images.length,i=-(e*100),n=-(r*100);this.#i(i,n),this._currentImageIndex=r}#s(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e-1+this.product.images.length)%this.product.images.length,i=-(e*100),n=-(r*100);this.#i(i,n),this._currentImageIndex=r}#o(e){if(!this.product?.images?.length)return;let r=this._currentImageIndex,i=Math.max(0,Math.min(e,this.product.images.length-1)),n=-(r*100),s=-(i*100);this.#i(n,s),this._currentImageIndex=i}get#a(){return this.renderRoot.querySelector(".image-slider")}};Nt.AddToCartEvent=class extends CustomEvent{static type="mw-product-card:add-to-cart";constructor(e,r={}){super(Nt.AddToCartEvent.type,{detail:{product:e},...r})}};customElements.get("mw-product-card")||customElements.define("mw-product-card",Nt);function Xr(t){return Array.isArray(t)?t:t?[t]:[]}function $a(t,e){let r=new Map;for(let i of t){let n=e(i);r.has(n)||r.set(n,[]),(r.get(n)||[]).push(i)}return r}var qn=class extends k(v){static properties={orderDetails:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1,this.color="#601feb",this.darkMode=!1}render(){let e=Xr(this.orderDetails?.order_status?.step||[]),r=Xr(this.orderDetails?.items?.item||[]),i=Xr(this.orderDetails?.actions||[]);return u`
2092
2303
  <div class="${this.darkMode?"dark border-white/10 bg-[#1E1F23]":"border-gray-200 bg-white"} flex w-full max-w-md flex-col rounded-3xl border p-4">
2093
2304
  <!-- Header with order ID -->
2094
2305
  <div class="mb-2">
2095
- ${this.orderDetails?.order_id?.label||!this.streaming?d`<h2 class="text-lg font-semibold text-gray-900 dark:text-white">${this.orderDetails?.order_id?.label} ${this.orderDetails?.order_id?.value}</h2>`:d`<div class="h-7 w-full animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>`}
2306
+ ${this.orderDetails?.order_id?.label||!this.streaming?u`<h2 class="text-lg font-semibold text-gray-900 dark:text-white">${this.orderDetails?.order_id?.label} ${this.orderDetails?.order_id?.value}</h2>`:u`<div class="h-7 w-full animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>`}
2096
2307
  </div>
2097
2308
 
2098
2309
  <!-- Progress Timeline -->
2099
2310
  <div>
2100
2311
  <ol role="list" class="w-full overflow-hidden">
2101
- ${this.streaming&&!this.orderDetails?d`
2312
+ ${this.streaming&&!this.orderDetails?u`
2102
2313
  <!-- Loading for status timeline -->
2103
- ${[1,2,3].map((i,s)=>d`
2314
+ ${[1,2,3].map((n,s)=>u`
2104
2315
  <li class="w-full pb-8">
2105
- ${s<2?d`<div class="absolute top-2 left-2 mt-0.5 -ml-px h-full w-0.5 animate-pulse bg-gray-200 dark:bg-gray-600" aria-hidden="true"></div>`:""}
2316
+ ${s<2?u`<div class="absolute top-2 left-2 mt-0.5 -ml-px h-full w-0.5 animate-pulse bg-gray-200 dark:bg-gray-600" aria-hidden="true"></div>`:""}
2106
2317
  <div class="group relative flex items-start">
2107
2318
  <span class="flex h-6 items-center">
2108
2319
  <span class="h-4 w-4 animate-pulse rounded-full bg-gray-200 dark:bg-gray-600"></span>
@@ -2113,43 +2324,51 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2113
2324
  </div>
2114
2325
  </li>
2115
2326
  `)}
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>`}
2327
+ `:J(e,n=>n.label,(n,s)=>{let o=n.status==="completed",a=n.status==="in_progress",l=s===e.length-1;return u`
2328
+ <li class="relative pb-4">
2329
+ ${l?"":u`<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>`}
2118
2330
 
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>
2331
+ <div class="group relative flex items-start">
2332
+ ${at(n.status,[["pending",()=>u`
2333
+ <span class="flex h-6 items-center">
2334
+ <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]">
2335
+ <span class="h-1.5 w-1.5 rounded-full bg-transparent"></span>
2336
+ </span>
2123
2337
  </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>
2338
+ `],["in_progress",()=>u`
2339
+ <span class="flex h-6 items-center">
2340
+ <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[${this.color}] bg-white dark:bg-[#1E1F23]">
2341
+ <span class="h-1.5 w-1.5 rounded-full bg-[${this.color}]"></span>
2342
+ </span>
2127
2343
  </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>
2344
+ `],["completed",()=>u`
2345
+ <span class="flex h-6 items-center">
2346
+ <span class="flex h-4 w-4 items-center justify-center rounded-full bg-[${this.color}]">
2347
+ <hi-outline class="mb-3 block h-3 w-3 text-white dark:text-gray-800" name="check"></hi-outline>
2348
+ </span>
2132
2349
  </span>
2350
+ `]],()=>u`
2351
+ <span class="flex h-6 items-center">
2352
+ <span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[${this.color}] bg-white dark:bg-[#1E1F23]">
2353
+ <span class="h-1.5 w-1.5 rounded-full bg-[${this.color}]"></span>
2133
2354
  </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>
2137
2355
  </span>
2138
- </span>`)}
2356
+ `)}
2139
2357
 
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}
2358
+ <span class="ml-3 flex min-w-0 flex-col">
2359
+ <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"}`}">
2360
+ ${n.label}
2361
+ </span>
2143
2362
  </span>
2144
- </span>
2145
- </div>
2146
- </li>`})}
2363
+ </div>
2364
+ </li>
2365
+ `})}
2147
2366
  </ol>
2148
2367
  </div>
2149
2368
 
2150
2369
  <!-- Products list with order items -->
2151
2370
  <div class="mb-2 w-full">
2152
- ${r.length===0&&!this.orderDetails?.total?.amount&&this.streaming?d`
2371
+ ${r.length===0&&!this.orderDetails?.total?.amount&&this.streaming?u`
2153
2372
  <!-- Loading shimmer for products -->
2154
2373
  <div class="w-full space-y-4">
2155
2374
  <div class="flex items-center gap-2">
@@ -2164,11 +2383,11 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2164
2383
  <div class="h-4 w-10 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2165
2384
  </div>
2166
2385
  </div>
2167
- `:d`
2386
+ `:u`
2168
2387
  <div class="divide-y divide-gray-100 dark:divide-gray-600">
2169
- ${this.streaming&&!r.length?d`
2388
+ ${this.streaming&&!r.length?u`
2170
2389
  <!-- Loading shimmer for individual products -->
2171
- ${[1,2].map(()=>d`
2390
+ ${[1,2].map(()=>u`
2172
2391
  <div class="flex items-center gap-2 py-1.5">
2173
2392
  <div class="h-12 w-12 animate-pulse rounded-lg bg-gray-200 dark:bg-gray-600"></div>
2174
2393
  <div class="min-w-0 flex-1">
@@ -2177,14 +2396,14 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2177
2396
  <div class="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2178
2397
  </div>
2179
2398
  `)}
2180
- `:r?.map(i=>{let s=i?.image_url;return d`
2399
+ `:r?.map(n=>{let s=n?.image_url;return u`
2181
2400
  <div class="flex items-center gap-2 py-1.5">
2182
- <img src="${z(s)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
2401
+ <img src="${W(s)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
2183
2402
 
2184
2403
  <div class="min-w-0 flex-1">
2185
- ${!i?.name&&this.streaming?d`<div class="h-4 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>`:d`<h3 class="truncate text-sm font-medium text-gray-900 dark:text-gray-100">${i?.name}</h3>`}
2404
+ ${!n?.name&&this.streaming?u`<div class="h-4 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>`:u`<h3 class="truncate text-sm font-medium text-gray-900 dark:text-gray-100">${n?.name}</h3>`}
2186
2405
  </div>
2187
- ${!i?.price&&this.streaming?d`<div class="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>`:d`<span class="text-sm text-gray-500 dark:text-gray-400">${i?.quantity&&Number(i.quantity)>1?"x":""} ${i?.price}</span>`}
2406
+ ${!n?.price&&this.streaming?u`<div class="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>`:u`<span class="text-sm text-gray-500 dark:text-gray-400">${n?.quantity&&Number(n.quantity)>1?"x":""} ${n?.price}</span>`}
2188
2407
  </div>
2189
2408
  `})}
2190
2409
  </div>
@@ -2200,9 +2419,9 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2200
2419
 
2201
2420
  <!-- Shipping and payment information -->
2202
2421
  <div class="mb-2 flex w-full flex-col gap-2 overflow-hidden">
2203
- ${this.streaming&&!this.orderDetails?d`
2422
+ ${this.streaming&&!this.orderDetails?u`
2204
2423
  <!-- Loading shimmer template -->
2205
- ${[1,2].map(()=>d`
2424
+ ${[1,2].map(()=>u`
2206
2425
  <div>
2207
2426
  <div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2208
2427
  <div class="space-y-2 overflow-hidden">
@@ -2211,10 +2430,10 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2211
2430
  </div>
2212
2431
  </div>
2213
2432
  `)}
2214
- `:d`
2433
+ `:u`
2215
2434
  <!-- Shipping Section -->
2216
2435
  <div>
2217
- ${this.streaming&&!this.orderDetails?.shipping?d`
2436
+ ${this.streaming&&!this.orderDetails?.shipping?u`
2218
2437
  <div>
2219
2438
  <div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2220
2439
  <div class="space-y-2 overflow-hidden">
@@ -2222,18 +2441,18 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2222
2441
  <div class="h-4 w-36 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2223
2442
  </div>
2224
2443
  </div>
2225
- `:this.orderDetails?.shipping?.method||this.orderDetails?.customer?.name?d`
2444
+ `:this.orderDetails?.shipping?.method||this.orderDetails?.customer?.name?u`
2226
2445
  <h3 class="mb-1 text-sm font-medium text-gray-900 dark:text-gray-100">${this.orderDetails?.shipping?.label}</h3>
2227
2446
  <div class="space-y-1">
2228
- ${this.orderDetails.customer?.name?d`<p class="text-xs text-gray-600 dark:text-gray-400">${this.orderDetails.customer.name}</p>`:""}
2229
- ${this.orderDetails.shipping?.method?d`<p class="text-xs text-gray-600 dark:text-gray-400">${this.orderDetails.shipping.method}</p>`:""}
2447
+ ${this.orderDetails.customer?.name?u`<p class="text-xs text-gray-600 dark:text-gray-400">${this.orderDetails.customer.name}</p>`:""}
2448
+ ${this.orderDetails.shipping?.method?u`<p class="text-xs text-gray-600 dark:text-gray-400">${this.orderDetails.shipping.method}</p>`:""}
2230
2449
  </div>
2231
2450
  `:""}
2232
2451
  </div>
2233
2452
 
2234
2453
  <!-- Payment Section -->
2235
2454
  <div>
2236
- ${this.streaming&&!this.orderDetails?.payment?d`
2455
+ ${this.streaming&&!this.orderDetails?.payment?u`
2237
2456
  <div>
2238
2457
  <div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2239
2458
  <div class="space-y-2 overflow-hidden">
@@ -2241,15 +2460,15 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2241
2460
  <div class="h-4 w-36 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
2242
2461
  </div>
2243
2462
  </div>
2244
- `:this.orderDetails?.payment?d`
2463
+ `:this.orderDetails?.payment?u`
2245
2464
  <h3 class="mb-1 text-sm font-medium text-gray-900 dark:text-gray-100">${this.orderDetails.payment.label}</h3>
2246
- ${this.orderDetails.payment?.method?.value?d`
2465
+ ${this.orderDetails.payment?.method?.value?u`
2247
2466
  <p class="text-xs text-gray-600 dark:text-gray-400">
2248
2467
  <span class="font-medium">${this.orderDetails.payment.method.label}:</span>
2249
2468
  ${this.orderDetails.payment.method.value}
2250
2469
  </p>
2251
2470
  `:""}
2252
- ${this.orderDetails.payment.status?.value?d`
2471
+ ${this.orderDetails.payment.status?.value?u`
2253
2472
  <p class="text-xs text-gray-600 dark:text-gray-400">
2254
2473
  <span class="font-medium">${this.orderDetails.payment.status.label}:</span>
2255
2474
  <span>${this.orderDetails.payment.status.value}</span>
@@ -2262,20 +2481,20 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2262
2481
 
2263
2482
  <!-- Action buttons section -->
2264
2483
  <div class="flex w-full flex-col gap-2 overflow-hidden">
2265
- ${this.streaming&&!n[0]?.track_order?.label&&!Dn(n[0]?.track_order?.tracking_url||"")?d`
2484
+ ${this.streaming&&!i[0]?.track_order?.label&&!Xe(i[0]?.track_order?.tracking_url||"")?u`
2266
2485
  <!-- Loading shimmer for buttons -->
2267
2486
  <div class="h-10 w-full min-w-[250px] animate-pulse overflow-hidden rounded-xl bg-gray-200 dark:bg-gray-600"></div>
2268
- `:Q(n,(i,s)=>`action-${s}`,i=>{if(i?.track_order?.label)return d`
2269
- ${Dn(i.track_order?.tracking_url||"")?d` <a
2487
+ `:J(i,(n,s)=>`action-${s}`,n=>{if(n?.track_order?.label)return u`
2488
+ ${Xe(n.track_order?.tracking_url||"")?u` <a
2270
2489
  target="${this.linksNewTab?"_blank":"_self"}"
2271
- href="${i.track_order?.tracking_url}"
2272
- class="mt-1 w-full rounded-xl bg-[${this.color}] px-4 py-2 text-center text-sm font-medium text-white hover:opacity-90"
2273
- >${i.track_order.label}</a
2490
+ href="${n.track_order?.tracking_url}"
2491
+ class="mt-1 w-full rounded-xl bg-[${this.color}] px-4 py-2 text-center text-sm font-medium text-white hover:opacity-90 dark:text-black"
2492
+ >${n.track_order.label}</a
2274
2493
  >`:null}
2275
2494
  `})}
2276
2495
  </div>
2277
2496
  </div>
2278
- `}};customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",Pi);var Lu={".section-spacing":{"@apply":"relative flex justify-center px-[25px] py-16 sm:px-9 sm:py-[45px] lg:px-24 lg:py-[104px]"}},Ri=Mt({preflight:{...Lu},hash:!1,darkMode:"class",theme:{extend:{fontFamily:{display:["Work Sans","sans-serif"],sans:["Inter","sans-serif"]},colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}}}},presets:[Cr(),br(),xr(),Sr()],ignorelist:/^(sb-|css-|sbdocs|docblock|innerZoomElementWrapper|docs-|rejt-)/});var Bi=t=>Er(Ri)(t);var qi=class extends Bi(v){static styles=j`
2497
+ `}};customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",qn);var Ou={".section-spacing":{"@apply":"relative flex justify-center px-[25px] py-16 sm:px-9 sm:py-[45px] lg:px-24 lg:py-[104px]"}},Vn=Dt({preflight:{...Ou},hash:!1,darkMode:"class",theme:{extend:{fontFamily:{display:["Work Sans","sans-serif"],sans:["Inter","sans-serif"]},colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}}}},presets:[$r(),Cr(),_r(),Er()],ignorelist:/^(sb-|css-|sbdocs|docblock|innerZoomElementWrapper|docs-|rejt-)/});var Nn=t=>Mr(Vn)(t);var Hn=class extends Nn(v){static styles=O`
2279
2498
  :host {
2280
2499
  --w-hover-arrow--hovered: 0;
2281
2500
  }
@@ -2289,21 +2508,21 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2289
2508
  transform: translateX(calc(var(--w-hover-arrow--hovered) * 3px));
2290
2509
  transition: transform 0.3s ease-in-out;
2291
2510
  }
2292
- `;render(){return d`
2511
+ `;render(){return u`
2293
2512
  <svg width="10" height="10" viewBox="0 0 10 10" aria-hidden="true">
2294
2513
  <g fill-rule="evenodd">
2295
2514
  <path part="line" stroke="currentColor" fill="currentColor" d="M0 5h7"></path>
2296
2515
  <path part="tip" stroke="currentColor" fill="transparent" d="M1 1l4 4-4 4"></path>
2297
2516
  </g>
2298
2517
  </svg>
2299
- `}};customElements.get("w-hover-arrow")||customElements.define("w-hover-arrow",qi);var Ft=class t extends C(v){static properties={title:{type:String},type:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"},_hoverRating:{type:Number,state:!0}};constructor(){super(),this.title="",this.type="star-rating",this.color="#8B5CF6",this.darkMode=!1,this._hoverRating=0}render(){return d`
2518
+ `}};customElements.get("w-hover-arrow")||customElements.define("w-hover-arrow",Hn);var Ht=class t extends k(v){static properties={title:{type:String},type:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"},_hoverRating:{type:Number,state:!0},_selectedRating:{type:Number,state:!0},_selectedVote:{type:String,state:!0}};constructor(){super(),this.title="",this.type="star-rating",this.color="#8B5CF6",this.darkMode=!1,this._hoverRating=0,this._selectedRating=0,this._selectedVote=""}updated(e){(e.has("type")||e.has("title"))&&(this._selectedRating=0,this._selectedVote="",this._hoverRating=0)}render(){return u`
2300
2519
  <div
2301
2520
  class="${this.darkMode?"dark bg-[#1E1F23]":"bg-white"} focus-within:ring-opacity-50 w-full overflow-hidden rounded-[18px] shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)] transition-all duration-200 focus-within:ring-2 focus-within:ring-[${this.color}]">
2302
2521
  <div class="flex flex-col gap-2 p-4">
2303
- ${Zr(this.type,[["star-rating",()=>this.#t()],["binary-vote",()=>this.#r()],["new-conversation-button",()=>this.#e()]],()=>d`<span class="text-sm text-gray-500">Unsupported input type</span>`)}
2522
+ ${at(this.type,[["star-rating",()=>this.#t()],["binary-vote",()=>this.#r()],["new-conversation-button",()=>this.#e()]],()=>u`<span class="text-sm text-gray-500">Unsupported input type</span>`)}
2304
2523
  </div>
2305
2524
  </div>
2306
- `}#e(){return d`
2525
+ `}#e(){return u`
2307
2526
  <button
2308
2527
  type="button"
2309
2528
  @click="${()=>this.dispatchEvent(new t.SubmitEvent({type:"new-conversation-button"}))}">
@@ -2312,29 +2531,31 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2312
2531
  <w-hover-arrow class="text-[${this.color}] group-hover:[--w-hover-arrow--hovered:1]"></w-hover-arrow>
2313
2532
  </span>
2314
2533
  </button>
2315
- `}#t(){return d`
2316
- ${this.title?d`<p class="text-sm font-medium text-gray-700 dark:text-gray-200">${this.title}</p>`:null}
2534
+ `}#t(){return u`
2535
+ ${this.title?u`<p class="text-sm font-medium text-gray-700 dark:text-gray-200">${this.title}</p>`:null}
2317
2536
  <div class="flex justify-center gap-1">
2318
- ${[1,2,3,4,5].map(e=>d`
2537
+ ${[1,2,3,4,5].map(e=>u`
2319
2538
  <button
2320
2539
  type="button"
2321
- @click="${()=>this.#i(e)}"
2540
+ ?disabled="${this._selectedRating>0}"
2541
+ @click="${()=>this.#n(e)}"
2322
2542
  @mouseenter="${()=>this.#s(e)}"
2323
2543
  @mouseleave="${this.#o}"
2324
- class="p-1 transition-transform hover:scale-110"
2544
+ class="p-1 transition-transform hover:scale-110 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:scale-100"
2325
2545
  aria-label="${e} star${e>1?"s":""}">
2326
- ${this.#n(e)}
2546
+ ${this.#i(e)}
2327
2547
  </button>
2328
2548
  `)}
2329
2549
  </div>
2330
- `}#r(){return d`
2331
- ${this.title?d`<p class="text-sm font-medium text-gray-700 dark:text-gray-200">${this.title}</p>`:null}
2550
+ `}#r(){let e=this._selectedVote==="negative",r=this._selectedVote==="positive";return u`
2551
+ ${this.title?u`<p class="text-sm font-medium text-gray-700 dark:text-gray-200">${this.title}</p>`:null}
2332
2552
  <div class="flex justify-center gap-4">
2333
2553
  <button
2334
2554
  type="button"
2555
+ ?disabled="${this._selectedVote!==""}"
2335
2556
  @click="${()=>this.#a("negative")}"
2336
- class="flex flex-col items-center gap-1 rounded-lg border-2 border-gray-300 p-1 transition-all hover:border-red-400 dark:border-gray-600">
2337
- <svg class="h-6 w-6 text-gray-400 dark:text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
2557
+ class="${e?"border-red-400 bg-red-50 dark:bg-red-900/20":"border-gray-300 hover:border-red-400 dark:border-gray-600"} flex flex-col items-center gap-1 rounded-lg border-2 p-1 transition-all disabled:cursor-not-allowed disabled:opacity-50">
2558
+ <svg class="${e?"text-red-500":"text-gray-400 dark:text-gray-300"} h-6 w-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
2338
2559
  <path
2339
2560
  stroke-linecap="round"
2340
2561
  stroke-linejoin="round"
@@ -2344,9 +2565,10 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2344
2565
  </button>
2345
2566
  <button
2346
2567
  type="button"
2568
+ ?disabled="${this._selectedVote!==""}"
2347
2569
  @click="${()=>this.#a("positive")}"
2348
- class="flex flex-col items-center gap-1 rounded-lg border-2 border-gray-300 p-1 transition-all hover:border-green-400 dark:border-gray-600">
2349
- <svg class="h-6 w-6 text-gray-400 dark:text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
2570
+ class="${r?"border-green-400 bg-green-50 dark:bg-green-900/20":"border-gray-300 hover:border-green-400 dark:border-gray-600"} flex flex-col items-center gap-1 rounded-lg border-2 p-1 transition-all disabled:cursor-not-allowed disabled:opacity-50">
2571
+ <svg class="${r?"text-green-500":"text-gray-400 dark:text-gray-300"} h-6 w-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
2350
2572
  <path
2351
2573
  stroke-linecap="round"
2352
2574
  stroke-linejoin="round"
@@ -2355,51 +2577,67 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2355
2577
  </svg>
2356
2578
  </button>
2357
2579
  </div>
2358
- `}#n(e){let r=e<=this._hoverRating;return d`
2359
- <svg class="${r?"text-yellow-400":"text-gray-300"} h-6 w-6" fill="${r?"currentColor":"none"}" stroke="currentColor" viewBox="0 0 24 24">
2580
+ `}#i(e){let r=this._selectedRating>0?this._selectedRating:this._hoverRating,i=e<=r;return u`
2581
+ <svg class="${i?"text-yellow-400":"text-gray-300"} h-6 w-6" fill="${i?"currentColor":"none"}" stroke="currentColor" viewBox="0 0 24 24">
2360
2582
  <path
2361
2583
  stroke-linecap="round"
2362
2584
  stroke-linejoin="round"
2363
2585
  stroke-width="2"
2364
2586
  d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" />
2365
2587
  </svg>
2366
- `}#i(e){this._hoverRating=0,this.dispatchEvent(new t.SubmitEvent({type:"star-rating",rating:e}))}#s(e){this._hoverRating=e}#o(){this._hoverRating=0}#a(e){this.dispatchEvent(new t.SubmitEvent({type:"binary-vote",vote:e}))}};Ft.SubmitEvent=class extends CustomEvent{static type="mw-request-input:submit";constructor(e,r={}){super(Ft.SubmitEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-request-input")||customElements.define("mw-request-input",Ft);var Nt=class extends tt{constructor(e){if(super(e),this.it=D,e.type!==_r.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===D||e==null)return this._t=void 0,this.it=e;if(e===te)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let r=[e];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}};Nt.directiveName="unsafeHTML",Nt.resultType=1;var Ca=Mr(Nt);var ju=new Map([["amp","&"],["lt","<"],["gt",">"],["quot",'"'],["apos","'"],["nbsp","\xA0"],["ensp","\u2002"],["emsp","\u2003"],["thinsp","\u2009"],["eacute","\xE9"],["Eacute","\xC9"],["ntilde","\xF1"],["uuml","\xFC"],["ccedil","\xE7"],["aacute","\xE1"],["Aacute","\xC1"],["agrave","\xE0"],["Agrave","\xC0"],["acirc","\xE2"],["Acirc","\xC2"],["auml","\xE4"],["Auml","\xC4"],["aring","\xE5"],["Aring","\xC5"],["aelig","\xE6"],["AElig","\xC6"],["egrave","\xE8"],["Egrave","\xC8"],["ecirc","\xEA"],["Ecirc","\xCA"],["euml","\xEB"],["Euml","\xCB"],["iacute","\xED"],["Iacute","\xCD"],["igrave","\xEC"],["Igrave","\xCC"],["icirc","\xEE"],["Icirc","\xCE"],["iuml","\xEF"],["Iuml","\xCF"],["oacute","\xF3"],["Oacute","\xD3"],["ograve","\xF2"],["Ograve","\xD2"],["ocirc","\xF4"],["Ocirc","\xD4"],["ouml","\xF6"],["Ouml","\xD6"],["oslash","\xF8"],["Oslash","\xD8"],["otilde","\xF5"],["Otilde","\xD5"],["uacute","\xFA"],["Uacute","\xDA"],["ugrave","\xF9"],["Ugrave","\xD9"],["ucirc","\xFB"],["Ucirc","\xDB"],["Uuml","\xDC"],["yacute","\xFD"],["Yacute","\xDD"],["yuml","\xFF"],["Yuml","\u0178"],["Ntilde","\xD1"],["Ccedil","\xC7"],["euro","\u20AC"],["pound","\xA3"],["yen","\xA5"],["cent","\xA2"],["copy","\xA9"],["reg","\xAE"],["trade","\u2122"],["curren","\xA4"],["plusmn","\xB1"],["times","\xD7"],["divide","\xF7"],["le","\u2264"],["ge","\u2265"],["ne","\u2260"],["sum","\u2211"],["prod","\u220F"],["int","\u222B"],["infin","\u221E"],["radic","\u221A"],["minus","\u2212"],["sup2","\xB2"],["sup3","\xB3"],["frac14","\xBC"],["frac12","\xBD"],["frac34","\xBE"],["larr","\u2190"],["rarr","\u2192"],["uarr","\u2191"],["darr","\u2193"],["harr","\u2194"],["lArr","\u21D0"],["rArr","\u21D2"],["uArr","\u21D1"],["dArr","\u21D3"],["hArr","\u21D4"],["alpha","\u03B1"],["beta","\u03B2"],["gamma","\u03B3"],["delta","\u03B4"],["epsilon","\u03B5"],["zeta","\u03B6"],["eta","\u03B7"],["theta","\u03B8"],["iota","\u03B9"],["kappa","\u03BA"],["lambda","\u03BB"],["mu","\u03BC"],["nu","\u03BD"],["xi","\u03BE"],["omicron","\u03BF"],["pi","\u03C0"],["rho","\u03C1"],["sigma","\u03C3"],["tau","\u03C4"],["upsilon","\u03C5"],["phi","\u03C6"],["chi","\u03C7"],["psi","\u03C8"],["omega","\u03C9"],["Alpha","\u0391"],["Beta","\u0392"],["Gamma","\u0393"],["Delta","\u0394"],["Epsilon","\u0395"],["Zeta","\u0396"],["Eta","\u0397"],["Theta","\u0398"],["Iota","\u0399"],["Kappa","\u039A"],["Lambda","\u039B"],["Mu","\u039C"],["Nu","\u039D"],["Xi","\u039E"],["Omicron","\u039F"],["Pi","\u03A0"],["Rho","\u03A1"],["Sigma","\u03A3"],["Tau","\u03A4"],["Upsilon","\u03A5"],["Phi","\u03A6"],["Chi","\u03A7"],["Psi","\u03A8"],["Omega","\u03A9"],["clubs","\u2663"],["hearts","\u2665"],["diams","\u2666"],["spades","\u2660"],["iexcl","\xA1"],["iquest","\xBF"],["sect","\xA7"],["para","\xB6"],["deg","\xB0"],["middot","\xB7"],["bull","\u2022"],["hellip","\u2026"],["prime","\u2032"],["Prime","\u2033"],["lsaquo","\u2039"],["rsaquo","\u203A"],["laquo","\xAB"],["raquo","\xBB"],["lsquo","\u2018"],["rsquo","\u2019"],["ldquo","\u201C"],["rdquo","\u201D"],["sbquo","\u201A"],["bdquo","\u201E"],["ndash","\u2013"],["mdash","\u2014"],["macr","\xAF"],["oline","\u203E"],["not","\xAC"],["shy","\xAD"],["ordf","\xAA"],["ordm","\xBA"],["micro","\xB5"],["acute","\xB4"],["cedil","\xB8"],["uml","\xA8"]]),Du=/&(?:(#[xX])([0-9a-fA-F]+)|(#)([0-9]+)|([a-zA-Z]+));/g;function Ou(t,e,r,n,i,s){if(e){let o=Number.parseInt(r,16);return o>=0&&o<=1114111?String.fromCodePoint(o):t}if(n){let o=Number.parseInt(i,10);return o>=0&&o<=1114111?String.fromCodePoint(o):t}if(s){let o=ju.get(s);if(o!==void 0)return o}return t}function Sa(t){return t.replace(Du,Ou)}function Ea(t){if(!t.includes("&"))return t;try{t=Sa(t)}catch{}if(!t.includes("&"))return t;try{t=Sa(t)}catch{}return t}var $a=t=>Ke(Et(),St(e=>Array.isArray(e)?e:[e]),Ze(t)),Rm=Ke(P(),St(Ea));var Bm=Ke(qn({}),St(t=>{function e(r){let n={};for(let[i,s]of Object.entries(r))s!==null&&(typeof s=="object"&&s!==null&&!Array.isArray(s)?n[i]=e(s):n[i]=s);return n}return e(t)}));var _a=Vs(se({name:P(),description:P(),price:P(),image_url:$a(P()),category:P(),url:P()}));function Ma(t,e,r,{imagesByProductUrl:n,linksNewTab:i=!0,searchParams:s,messageIsStreaming:o=!1,isSupportAgent:a,color:l="#601feb",darkMode:c=!1,apiBaseUrl:u="",cdnBaseUrl:h=""}){if(!t)return d``;let p=e>0&&r[e-1]&&"data"in r[e-1],g=e<r.length-1||!o;if("text"in t)return d`<p>${t.text}</p>`;if("html"in t)return d`${Ca(t.html)}`;if("data"in t)switch(t.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let f=Le(_a,t.data);if(f.success){let S={...f.output,images:[]};return S.images=dt(S.image_url),d`
2367
- ${p?d`<div class="my-3 w-full border-t border-gray-200/50"></div>`:null}
2588
+ `}#n(e){this._selectedRating>0||(this._selectedRating=e,this._hoverRating=0,this.dispatchEvent(new t.SubmitEvent({type:"star-rating",rating:e})))}#s(e){this._selectedRating>0||(this._hoverRating=e)}#o(){this._selectedRating>0||(this._hoverRating=0)}#a(e){this._selectedVote||(this._selectedVote=e,this.dispatchEvent(new t.SubmitEvent({type:"binary-vote",vote:e})))}};Ht.SubmitEvent=class extends CustomEvent{static type="mw-request-input:submit";constructor(e,r={}){super(Ht.SubmitEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-request-input")||customElements.define("mw-request-input",Ht);var zt=class extends nt{constructor(e){if(super(e),this.it=U,e.type!==Ir.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===U||e==null)return this._t=void 0,this.it=e;if(e===ne)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let r=[e];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}};zt.directiveName="unsafeHTML",zt.resultType=1;var Ea=Ar(zt);var Ma=V({title:Y(_(),"Agent joining in"),subtitle:Y(_(),"We are finding a human agent to help you."),subtitle_past_join_time:Y(_(),"It is taking a bit longer. A human agent will join any moment now."),expected_join_time:fr(Qe(_(),Fi())),game_title:Y(_(),"\u{1F9E0} I will guess your job"),game_first_question:Y(_(),"Does your job involve computers?"),game_result_prefix:Y(_(),"My guess:"),game_button_start:Y(_(),"\u{1F3AE} Play a game"),game_button_answer_affirmative:Y(_(),"Yes"),game_button_answer_negative:Y(_(),"No"),game_button_result_correct:Y(_(),"Correct"),game_button_result_wrong:Y(_(),"Wrong")});var zn=t=>Qe(Et(),qi(e=>Array.isArray(e)?e:[e]),Ye(t));var Ia=V({order_id_label:A(_()),order_id_value:A(_()),timeline:A(V({step:zn(V({label:A(_()),status:A(Mt(["completed","in_progress","pending"]))}))})),items:A(V({item:zn(V({name:A(_()),quantity:A(_()),price:A(_()),image:A(_())}))})),total_label:A(_()),total_amount:A(_()),customer_name:A(_()),shipping_label:A(_()),shipping_method:A(_()),payment_label:A(_()),payment_method_label:A(_()),payment_method_value:A(_()),payment_status_label:A(_()),payment_status_value:A(_()),order_tracking_label:A(_()),order_tracking_url:A(_())});var Aa=Gs(V({url:_(),name:_(),description:_(),price:_()}));function Da(t,e,r,{imagesByProductUrl:i,linksNewTab:n=!0,searchParams:s,messageIsStreaming:o=!1,isSupportAgent:a,color:l="#601feb",darkMode:c=!1,apiBaseUrl:d="",cdnBaseUrl:h=""}){if(!t)return u``;let p=e>0&&r[e-1]&&"data"in r[e-1],g=e<r.length-1||!o;if("text"in t)return u`<p>${t.text}</p>`;if("html"in t)return u`${Ea(t.html)}`;if("data"in t)switch(t.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let f=me(Aa,t.data);if(f.success)return u`
2589
+ ${p?u`<div class="my-3 w-full border-t border-gray-200/50"></div>`:null}
2368
2590
  <mw-product-card-horizontal
2369
- product="${JSON.stringify(S)}"
2591
+ .product="${f.output}"
2370
2592
  ?streaming="${!g}"
2371
- ?links-new-tab="${i}"
2593
+ ?links-new-tab="${n}"
2372
2594
  ?dark-mode="${c}"
2373
2595
  .searchParams="${s}"
2374
- .imagesByProductUrl="${n}"></mw-product-card-horizontal>
2375
- `}console.warn(f.issues);break}case"order-status-card-v1":return d`<mw-product-order-status-card
2376
- order-details="${JSON.stringify(t.data)}"
2377
- ?streaming="${!g}"
2378
- ?links-new-tab="${i}"
2379
- ?dark-mode="${c}"
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`
2596
+ .imagesByProductUrl="${i}"></mw-product-card-horizontal>
2597
+ `;console.warn(f.issues);break}case"order-status-card-v1":return u`
2598
+ <mw-product-order-status-card
2599
+ .orderDetails="${t.data}"
2600
+ ?streaming="${!g}"
2601
+ ?links-new-tab="${n}"
2602
+ ?dark-mode="${c}"
2603
+ color="${l}"></mw-product-order-status-card>
2604
+ `;case"order-card-v2":{let f=me(Ia,t.data);return f.success||console.warn(f.issues),u`
2605
+ <!-- -->
2606
+ <mw-order-card .orderDetails="${t.data}" ?streaming="${!g}" ?links-new-tab="${n}" ?dark-mode="${c}" color="${l}"></mw-order-card>
2607
+ `}case"live-chat-wait-card-v1":{let f=t.data||{};return a?u`<p><i>${f.message}</i></p>`:u`
2608
+ <mw-chat-wait-timer
2609
+ heading="${f.title||""}"
2610
+ message="${f.message||""}"
2611
+ completeMessage="${f.completemessage||""}"
2612
+ gameButton="${f.gamebutton||""}"
2613
+ target-end-time="${f.targetendtime||""}"
2614
+ question="${f.firstquestion||""}"
2615
+ .options="${f.options?.option||["No","Yes"]}"
2616
+ game-title="${f.gametitle||""}"
2617
+ result-prefix="${f.resultprefix||""}"
2618
+ correct-button-text="${f.correctbuttontext||"Correct"}"
2619
+ wrong-button-text="${f.wrongbuttontext||"Wrong"}"
2620
+ color="${l}"
2621
+ apiBaseUrl="${d}"
2622
+ cdnBaseUrl="${h}"
2623
+ sound="${h?`${h}/assets/game-intro.aac`:""}"
2624
+ ?dark-mode="${c}"></mw-chat-wait-timer>
2625
+ `}case"live-chat-wait-card-v2":{let f=me(Ma,t.data||{});f.success||console.warn(f.issues);let $=f.success?f.output:t.data||{};return a?u`<p><i>${$.subtitle}</i></p>`:u`
2626
+ <mw-chat-wait-timer
2627
+ .data="${$}"
2628
+ color="${l}"
2629
+ apiBaseUrl="${d}"
2630
+ cdnBaseUrl="${h}"
2631
+ sound="${h?`${h}/assets/game-intro.aac`:""}"
2632
+ ?dark-mode="${c}"></mw-chat-wait-timer>
2633
+ `}case"request-input-v1":return u``}return console.warn("could not render part:",t),u`<p><i>data type not supported</i></p>`}var Yr=class{#e;#t;#r;#i=!1;timeoutMs;get isTyping(){return this.#i}constructor(e,r,{timeoutMs:i=2e3}={}){this.#e=e,this.#t=r,this.timeoutMs=i,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.#i||this.#n()}}#n(){this.#i=!0,this.#t.typingStarted()}typingStopped(){clearTimeout(this.#r),this.#i=!1,this.#t.typingStopped()}};function ja(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 La(t){t?.body?.cancel().catch(console.warn)}var Wn=class{#e=[];#t;#r=10;#i=5e3;#n=!1;async add(e,r){if(this.#e.push(Ua(e,r)),this.#e.length>=this.#r)return this.flush();this.#t||(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#i))}async flush(){if(this.#n||this.#e.length===0)return;let e=[...this.#e];try{this.#n=!0,clearTimeout(this.#t),this.#t=void 0,this.#e=[];let r=new AbortController,i=setTimeout(()=>r.abort(),5e3);await Oa(e,{signal:r.signal}),clearTimeout(i)}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 i=e.filter(n=>n.event.includes("error"));this.#e=[...i,...this.#e]}}finally{this.#n=!1,this.#e.length>0&&!this.#t&&(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#i))}}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",Qr()).href,e)}catch(e){console.error("Failed to send final events:",e)}}},Ta=new Wn;window.addEventListener("beforeunload",()=>{Ta.flushBeforeUnload().catch(console.error)});async function L(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 Oa([Ua(t,e)]);return}else return Ta.add(t,e)}catch(i){console.error("Failed to send event:",i)}}async function Oa(t,{signal:e}={}){let r=new FormData;r.set("events",JSON.stringify(t));let i=await fetch(new URL("/widgets/data/collect",Qr()),{method:"POST",body:r,signal:e});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);La(i)}function Ua(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=R.distinctID;if(t&&typeof t=="string")return t;let e=crypto.randomUUID();try{R.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 Qr(){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 Ra(){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 Ba(){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",Fu=["star-rating","binary-vote","new-conversation-button"],Wt=class t extends k(v){static styles=O`
2396
2634
  div.dark::before {
2397
2635
  opacity: 0.8;
2398
2636
  background-color: rgba(20, 22, 26, var(--tw-bg-opacity));
2399
2637
  }
2400
- `;static properties={showClose:{type:Boolean,attribute:"show-close"},_currentRequestInputIndex:{type:Number,state:!0}};#e=Zs(this);#t=[];constructor(){super(),this.showClose=!1,this._currentRequestInputIndex=0}#r=new Jr(this,{typingStarted:()=>this.#e.value?.sendUserTypingStart(),typingStopped:()=>this.#e.value?.sendUserTypingStop()});#n=new Lr(this,{onImageDelete:e=>{if(!this.#e.value){console.warn("widget context not available, cannot delete image");return}this.#e.value.sendImageDelete(e),this.#f?.focus()},uploadUrl:new URL("/v1/uploads",Oa()).href,onConnect:()=>{this.#e.value?.connect()}});get conversationId(){return this.#e.value?.conversationId||""}get messages(){return this.#e.value?.messages||[]}get config(){return this.#e.value?.config}get callbacks(){return this.#e.value?.callbacks||{}}get widgetId(){return this.#e.value?.widgetId||""}get typingIndicator(){return this.#e.value?.typingIndicator}get isStreaming(){return this.#e.value?.isStreaming}get ranOutOfCredits(){return this.#e.value?.ranOutOfCredits}get isLiveMode(){return this.#e.value?.isLiveMode}get lastMsg(){return this.#e.value?.lastMsg}get hasQueuedMessages(){return this.#e.value?.hasQueuedMessages}#i="single";#s=null;firstUpdated(){document.addEventListener("mw-context-widget:connected",this.#o,{once:!0}),this.addEventListener("mw-chat-wait-game:question-answered",this.#a),this.addEventListener("mw-chat-wait-game:game-completed",this.#d),this.addEventListener("mw-chat-wait-game:guess-validated",this.#c)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("mw-chat-wait-game:question-answered",this.#a),this.removeEventListener("mw-chat-wait-game:game-completed",this.#d),this.removeEventListener("mw-chat-wait-game:guess-validated",this.#c)}#o=e=>{let r=e,{pendingImages:n}=r.detail;Array.isArray(n)&&this.#n.restoreImages(n)};#a=e=>{let r=e,{questionIndex:n,question:i,answer:s,totalQuestions:o}=r.detail;this.callbacks.onWaitGameQuestionAnswered?.({widgetId:this.widgetId,conversationId:this.conversationId,questionIndex:n,question:i,answer:s,totalQuestions:o})};#d=e=>{let r=e,{guessedProfession:n,questionCount:i}=r.detail;this.callbacks.onWaitGameCompleted?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:n,questionCount:i})};#c=e=>{let r=e,{guessedProfession:n,isCorrect:i,questionCount:s}=r.detail;this.callbacks.onWaitGameGuessValidated?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:n,isCorrect:i,questionCount:s})};updated(){let e=this.lastMsg?.id;e&&e!==this.#s&&(this.#s=e,this._currentRequestInputIndex=0),this.#e.value?.widgetId&&this.config?.enableImageUpload&&this.#n.updateUploadOptions({conversationId:this.conversationId,widgetId:this.#e.value?.widgetId,enabled:this.config?.enableImageUpload,isConnected:()=>this.#e.value?.isConnected()??!1,onConnect:()=>{this.#e.value?.connect()}})}render(){I(this.config,"config is required");let e=ka(this.messages,s=>{try{let o=new Date(s.timestamp),a=Math.floor(o.getUTCMinutes()/5)*5;return o.setUTCMinutes(a,0,0),o.valueOf().toString()}catch(o){console.error(o)}}),r=Math.max(0,Math.min(this._currentRequestInputIndex,this.#p.length-1)),n=this.#p[r],i=this.config.darkMode;return d`
2638
+ `;static properties={showClose:{type:Boolean,attribute:"show-close"},_currentRequestInputIndex:{type:Number,state:!0}};#e=Ys(this);#t=new Map;constructor(){super(),this.showClose=!1,this._currentRequestInputIndex=0}#r=new Yr(this,{typingStarted:()=>this.#e.value?.sendUserTypingStart(),typingStopped:()=>this.#e.value?.sendUserTypingStop()});#i=new Or(this,{onImageDelete:e=>{if(!this.#e.value){console.warn("widget context not available, cannot delete image");return}this.#e.value.sendImageDelete(e),this.#f?.focus()},uploadUrl:new URL("/v1/uploads",Ra()).href,onConnect:()=>{this.#e.value?.connect()}});get conversationId(){return this.#e.value?.conversationId||""}get messages(){return this.#e.value?.messages||[]}get config(){return this.#e.value?.config}get callbacks(){return this.#e.value?.callbacks||{}}get widgetId(){return this.#e.value?.widgetId||""}get typingIndicator(){return this.#e.value?.typingIndicator}get isStreaming(){return this.#e.value?.isStreaming}get ranOutOfCredits(){return this.#e.value?.ranOutOfCredits}get isLiveMode(){return this.#e.value?.isLiveMode}get lastMsg(){return this.#e.value?.lastMsg}get hasQueuedMessages(){return this.#e.value?.hasQueuedMessages}#n="single";#s=null;firstUpdated(){document.addEventListener("mw-context-widget:connected",this.#o,{once:!0}),this.addEventListener("mw-chat-wait-game:question-answered",this.#a),this.addEventListener("mw-chat-wait-game:game-completed",this.#d),this.addEventListener("mw-chat-wait-game:guess-validated",this.#c)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("mw-chat-wait-game:question-answered",this.#a),this.removeEventListener("mw-chat-wait-game:game-completed",this.#d),this.removeEventListener("mw-chat-wait-game:guess-validated",this.#c)}#o=e=>{let r=e,{pendingImages:i}=r.detail;Array.isArray(i)&&this.#i.restoreImages(i)};#a=e=>{let r=e,{questionIndex:i,question:n,answer:s,totalQuestions:o}=r.detail;this.callbacks.onWaitGameQuestionAnswered?.({widgetId:this.widgetId,conversationId:this.conversationId,questionIndex:i,question:n,answer:s,totalQuestions:o})};#d=e=>{let r=e,{guessedProfession:i,questionCount:n}=r.detail;this.callbacks.onWaitGameCompleted?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:i,questionCount:n})};#c=e=>{let r=e,{guessedProfession:i,isCorrect:n,questionCount:s}=r.detail;this.callbacks.onWaitGameGuessValidated?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:i,isCorrect:n,questionCount:s})};updated(){let e=this.lastMsg?.id;e&&e!==this.#s&&(this.#s=e,this._currentRequestInputIndex=0),this.#e.value?.widgetId&&this.config?.enableImageUpload&&this.#i.updateUploadOptions({conversationId:this.conversationId,widgetId:this.#e.value?.widgetId,enabled:this.config?.enableImageUpload,isConnected:()=>this.#e.value?.isConnected()??!1,onConnect:()=>{this.#e.value?.connect()}})}render(){D(this.config,"config is required");let e=$a(this.messages,s=>{try{let o=new Date(s.timestamp),a=Math.floor(o.getUTCMinutes()/5)*5;return o.setUTCMinutes(a,0,0),o.valueOf().toString()}catch(o){console.error(o)}}),r=Math.max(0,Math.min(this._currentRequestInputIndex,this.#p.length-1)),i=this.#p[r],n=this.config.darkMode;return u`
2401
2639
  <div
2402
- class="${i?"dark":""} relative mx-auto h-full bg-[#FDFDFD] font-sans text-base before:absolute before:inset-0 before:bg-[#8d8d8d] before:opacity-10 sm:rounded-[36px] sm:p-1.5 sm:before:rounded-[36px] dark:bg-[#14161A]">
2640
+ class="${n?"dark":""} relative mx-auto h-full bg-[#FDFDFD] font-sans text-base before:absolute before:inset-0 before:bg-[#8d8d8d] before:opacity-10 sm:rounded-[36px] sm:p-1.5 sm:before:rounded-[36px] dark:bg-[#14161A]">
2403
2641
  <div
2404
2642
  class="relative flex h-full flex-col bg-white shadow-[0px_4px_4px_0px_rgba(0,0,0,0.25),-116px_177px_59px_0px_rgba(0,0,0,0.00),-74px_113px_54px_0px_rgba(0,0,0,0.01),-42px_64px_46px_0px_rgba(0,0,0,0.03),-19px_28px_34px_0px_rgba(0,0,0,0.06)] sm:rounded-[30px] dark:bg-[#2B2D31]">
2405
2643
  <mw-chat-header
@@ -2407,7 +2645,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2407
2645
  .content="${{logoUrl:this.config.logoUrl,title:this.config.title,color:this.config.color}}"
2408
2646
  ?show-new-chat="${!this.isLiveMode&&this.messages.length>0&&!this.#C}"
2409
2647
  ?show-close="${this.showClose}"
2410
- ?dark-mode="${i}"
2648
+ ?dark-mode="${n}"
2411
2649
  @mw:new-chat-click="${this.#y}"
2412
2650
  @mw:close-click="${this.#g}">
2413
2651
  </mw-chat-header>
@@ -2418,7 +2656,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2418
2656
  </div>
2419
2657
 
2420
2658
  <!-- drag overlay -->
2421
- ${this.config.enableImageUpload&&this.#n.isDragging?d`
2659
+ ${this.config.enableImageUpload&&this.#i.isDragging?u`
2422
2660
  <div class="bg-opacity-90 absolute inset-0 z-50 flex items-center justify-center bg-white sm:rounded-[30px] dark:bg-[#2B2D31]">
2423
2661
  <div class="p-8 text-center">
2424
2662
  <lucide-icon name="image-plus" class="mx-auto mb-4 h-12 w-12 text-blue-500"></lucide-icon>
@@ -2430,8 +2668,8 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2430
2668
 
2431
2669
  <!-- this structure of 2 divs is required for the browser native stick/scroll to bottom -->
2432
2670
  <div id="scrollable-content" class="mt-6 flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto">
2433
- ${this.config.enableImageUpload&&this.#n.error?d`<mw-info-banner variant="error" text="${this.#n.error}" auto-dismissable></mw-info-banner> `:null}
2434
- ${this.config?.showStillLearningBanner?d`<mw-info-banner variant="info" text="I'm still learning!"></mw-info-banner>`:d`
2671
+ ${this.config.enableImageUpload&&this.#i.error?u`<mw-info-banner variant="error" text="${this.#i.error}" auto-dismissable></mw-info-banner> `:null}
2672
+ ${this.config?.showStillLearningBanner?u`<mw-info-banner variant="info" text="I'm still learning!"></mw-info-banner>`:u`
2435
2673
  <!-- this makes the chat stick to bottom when the banner is hidden -->
2436
2674
  <div class="flex p-1"></div>
2437
2675
  `}
@@ -2439,45 +2677,47 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2439
2677
  <!-- the padding at the top makes empty room at the top when scrolling and content is hidden behind header -->
2440
2678
  <!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
2441
2679
  <div class="${this.messages.length>0?"pt-20":""}">
2442
- ${Q(Array.from(e),([s])=>s,([s,o])=>d`
2443
- <div class="my-2 text-center text-xs text-gray-500 dark:text-gray-400">${Ia(new Date(Number(s)),window.navigator.language)}</div>
2444
- ${Q(o??[],a=>a.id,(a,l)=>{let u=o[l+1]?.role===a.role,p=(l>0?o[l-1]:void 0)?.role===a.role,f=(o.length>0?o[o.length-1]:void 0)?.id===a.id,S=()=>f&&!p&&!u?"single-current":!p&&!u?"single":!p&&u?"first":f&&p&&!u?"last-current":p&&!u?"last":p&&u?"middle":"single";this.#i=S();let b=this.isLiveMode&&a.role==="user"&&a.id===this.lastMsg?.id?"sent":"",E=(a.content.includes("<request-input-v1>")||!a.content)&&a.parts?.every(y=>"data"in y&&y.tag==="request-input-v1");return d`
2445
- ${a.images?Q(a.images,y=>y,y=>d`
2446
- <div data-id="${a.id}" class="${u?"mb-[1px]":"mb-3"} mr-2 ml-[15px] flex-row">
2680
+ ${J(Array.from(e),([s])=>s,([s,o])=>u`
2681
+ <div class="my-2 text-center text-xs text-gray-500 dark:text-gray-400">${ja(new Date(Number(s)),window.navigator.language)}</div>
2682
+ ${J(o??[],a=>a.id,(a,l)=>{let d=o[l+1]?.role===a.role,p=(l>0?o[l-1]:void 0)?.role===a.role,f=(o.length>0?o[o.length-1]:void 0)?.id===a.id,$=()=>f&&!p&&!d?"single-current":!p&&!d?"single":!p&&d?"first":f&&p&&!d?"last-current":p&&!d?"last":p&&d?"middle":"single";this.#n=$();let b=this.isLiveMode&&a.role==="user"&&a.id===this.lastMsg?.id?"sent":"",S=(a.content.includes("<request-input-v1>")||!a.content)&&a.parts?.every(y=>"data"in y&&y.tag==="request-input-v1");return u`
2683
+ ${a.images?J(a.images,y=>y,y=>u`
2684
+ <div data-id="${a.id}" class="${d?"mb-[1px]":"mb-3"} mr-2 ml-[15px] flex-row">
2447
2685
  <mw-chat-image
2448
2686
  src="${y}"
2449
2687
  alt="User uploaded image"
2450
2688
  .side="${a.role==="user"?"right":"left"}"
2451
- position=${this.#i}
2689
+ position=${this.#n}
2452
2690
  width="300px"></mw-chat-image>
2453
2691
  </div>
2454
2692
  `):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}
2693
+ ${(a.content||a.parts)&&!S?u`
2694
+ <div data-id="${a.id}" class="${d?"mb-[1px]":"mb-3"} mx-2 flex-row">
2695
+ <mw-chat-message
2696
+ .color="${this.config?.color}"
2697
+ status="${b}"
2698
+ logo="${a.metadata?.avatar||this.config?.logoUrl}"
2699
+ side="${a.role}"
2700
+ position=${this.#n}
2701
+ ?dark-mode="${n}"
2702
+ @click="${this.#l}">
2703
+ <div
2704
+ 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">
2705
+ ${a.content===Bu?u`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config?.color}]"></mw-loading>`:a.parts?J(a.parts,(y,x)=>x,(y,x)=>Da(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:n,apiBaseUrl:Qr(),cdnBaseUrl:Ba()})):u`<p>${a.content}</p>`}
2706
+ </div>
2707
+ </mw-chat-message>
2708
+ </div>
2709
+ `:null}
2470
2710
  `})}
2471
2711
  `)}
2472
2712
 
2473
2713
  <!-- show typing indicator if the non-user side is typing -->
2474
- ${["assistant","support"].includes(this.typingIndicator?.role??"")&&this.typingIndicator?.role?d`
2714
+ ${["assistant","support"].includes(this.typingIndicator?.role??"")&&this.typingIndicator?.role?u`
2475
2715
  <mw-chat-message
2476
2716
  class="mx-2 mb-3 block"
2477
2717
  color="${this.config?.color}"
2478
2718
  logo="${this.typingIndicator?.metadata?.avatar||this.config?.logoUrl}"
2479
2719
  side="${this.typingIndicator.role}"
2480
- ?dark-mode="${i}">
2720
+ ?dark-mode="${n}">
2481
2721
  <div
2482
2722
  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 dark:prose-headings:text-white dark:prose-strong:text-white dark:prose-p:text-inherit break-words text-inherit">
2483
2723
  <mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>
@@ -2490,63 +2730,96 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2490
2730
  class="flex-grow"
2491
2731
  .examples="${this.messages.length>0?[]:this.config.examples}"
2492
2732
  color="${this.config.color}"
2493
- ?dark-mode="${i}"
2733
+ ?dark-mode="${n}"
2494
2734
  @mw:example-click="${this.#h}"></mw-chat-background>
2495
2735
  </div>
2496
2736
 
2497
- ${this.messages.length===0&&this.config.disclaimerFloating?d`
2737
+ ${this.messages.length===0&&this.config.disclaimerFloating?u`
2498
2738
  <div class="mx-4 mb-2 rounded-xl bg-[#eeedf1] px-3 py-2 dark:bg-[#1E1F23]">
2499
- <mw-disclaimer .text="${this.config.disclaimerFloating}" .color="${this.config.color}" ?dark-mode="${i}"></mw-disclaimer>
2739
+ <mw-disclaimer .text="${this.config.disclaimerFloating}" .color="${this.config.color}" ?dark-mode="${n}"></mw-disclaimer>
2500
2740
  </div>
2501
2741
  `:null}
2502
2742
 
2503
2743
  <div class="m-1.5 flex-shrink-0 flex-grow-0 space-y-2 rounded-3xl bg-[#eeedf1] p-1.5 dark:bg-[#1E1F23]">
2504
- ${this.config.disclaimer&&!this.config.removePoweredBy?d`
2744
+ ${this.config.disclaimer&&!this.config.removePoweredBy?u`
2505
2745
  <!-- spacing between input box and disclaimer or bottom -->
2506
2746
  <div class="mb-1.5">
2507
- <mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}" ?dark-mode="${i}"></mw-disclaimer>
2747
+ <mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}" ?dark-mode="${n}"></mw-disclaimer>
2508
2748
  </div>
2509
2749
  `:null}
2510
- ${this.#p.length===0?d`
2750
+ ${this.#p.length===0?u`
2511
2751
  <mw-chat-input
2512
2752
  @mw:change="${this.#b}"
2513
2753
  @mw:submit="${this.#v}"
2514
2754
  @mw:cancel="${this.#x}"
2515
- @mw:image-upload-click="${this.config?.enableImageUpload?this.#n.openImagePicker:void 0}"
2755
+ @mw:image-upload-click="${this.config?.enableImageUpload?this.#i.openImagePicker:void 0}"
2516
2756
  @mw:image-delete="${this.config?.enableImageUpload?this.#w:void 0}"
2517
2757
  placeholder="${this.config?.input?.placeholder??""}"
2518
- ?disabled="${this.ranOutOfCredits||this.hasQueuedMessages||this.#n.hasPendingImages}"
2758
+ ?disabled="${this.ranOutOfCredits||this.hasQueuedMessages||this.#i.hasPendingImages}"
2519
2759
  ?streaming="${this.isStreaming??!0}"
2520
- ?loading="${this.hasQueuedMessages||this.#n.hasPendingImages}"
2760
+ ?loading="${this.hasQueuedMessages||this.#i.hasPendingImages}"
2521
2761
  ?enableImageUpload="${this.config?.enableImageUpload&&!this.ranOutOfCredits}"
2522
- ?dark-mode="${i}"
2762
+ ?dark-mode="${n}"
2523
2763
  color="${this.config?.color??""}"
2524
- .images="${this.config?.enableImageUpload?this.#n.selectedImages:[]}">
2764
+ .images="${this.config?.enableImageUpload?this.#i.selectedImages:[]}">
2525
2765
  </mw-chat-input>
2526
- `:d`
2766
+ `:u`
2527
2767
  <mw-request-input
2528
- .title="${n?.title}"
2529
- .type="${n?.type}"
2768
+ .title="${i?.title}"
2769
+ .type="${i?.type}"
2530
2770
  .color="${this.config?.color??"#8B5CF6"}"
2531
- ?dark-mode="${i}"
2771
+ ?dark-mode="${n}"
2532
2772
  @mw-request-input:submit="${this.#u}">
2533
2773
  </mw-request-input>
2534
2774
  `}
2535
- ${this.config.removePoweredBy?this.config.disclaimer?d`
2775
+ ${this.config.removePoweredBy?this.config.disclaimer?u`
2536
2776
  <!-- spacing between input box and disclaimer or bottom -->
2537
2777
  <div class="mt-1.5">
2538
- <mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}" ?dark-mode="${i}"></mw-disclaimer>
2778
+ <mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}" ?dark-mode="${n}"></mw-disclaimer>
2539
2779
  </div>
2540
- `:null:d`
2780
+ `:null:u`
2541
2781
  <!-- spacing between input box and powered-by or bottom -->
2542
2782
  <div class="h-4">
2543
- <mw-powered-by ?dark-mode="${i}"></mw-powered-by>
2783
+ <mw-powered-by ?dark-mode="${n}"></mw-powered-by>
2544
2784
  </div>
2545
2785
  `}
2546
2786
  </div>
2547
2787
  </div>
2548
2788
  </div>
2549
- `}#l(e){let n=e.composedPath().find(i=>i instanceof HTMLAnchorElement);if(n){if(e.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:n.href,conversationId:this.conversationId}),window.self!==window.top){window.open(n.href,"_blank");return}let s=this.config?.linksNewTab?"_blank":"_self";window.open(n.href,n.target||s)}}#h(e){if(this.isStreaming)return;e.preventDefault();let r=e.detail.example;this.#m(r)}#m=ze({interval:200},async e=>{I(this.#e.value,"widget context is required"),await this.#e.value.enqueueUserInput(e,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions})&&(this.#f?.setValue(""),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!0,conversationId:this.conversationId}))});#v(e){if(I(this.#e.value,"widget context is required"),e.preventDefault(),this.config?.enableImageUpload&&this.#n.hasPendingImages)return;let r=e.detail;this.#e.value.enqueueUserInput(r,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions}).then(n=>{n&&(this.#f?.setValue(""),this.#n.clearImages(),this.#r.typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:this.conversationId}),window.requestAnimationFrame(()=>{this.#f?.focus()}))}).catch(console.warn)}#b(e){this.#r.onInput(e.detail.full)}#x(){I(this.#e.value,"widget context is required"),this.#e.value.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}#w(e){this.#n.onImageDelete(e.detail)}#y(){I(this.#e.value,"widget context is required"),this.#e.value.sendNewChat(),this.reset()}#g(){this.dispatchEvent(new t.CloseClickEvent)}#u(e){I(this.#e.value,"widget context is required");let r=this.#p,n=r[this._currentRequestInputIndex];if(!n){console.warn("no current state found for request input");return}switch(e.detail.type){case"star-rating":{let{rating:s,type:o}=e.detail;this.#t.push({type:o,rating:s,key:n.key,title:n.title});break}case"binary-vote":{let{vote:s,type:o}=e.detail;this.#t.push({type:o,vote:s,key:n.key,title:n.title});break}case"new-conversation-button":{this.#y(),this.requestUpdate();return}default:console.warn("unknown request input type",e.detail);return}this._currentRequestInputIndex+=1;let i=r.filter(s=>s.type==="star-rating"||s.type==="binary-vote").length;this.#t.length>=i&&this.#k(),this.requestUpdate()}async#k(){if(I(this.#e.value,"widget context is required"),this.#t.length===0)return;if(!this.#e.value.lastMsg?.id){console.warn("cannot submit request inputs without message ID");return}await this.#e.value.enqueueUserInput("",{role:"user",expectStreaming:!1,requestInputResponse:this.#t})&&(this.#t=[]),this.requestUpdate()}get#p(){I(this.#e.value,"widget context is required");let e=this.messages.findLast(i=>i.role==="assistant"&&i.parts?.some(s=>"tag"in s&&s.tag==="request-input-v1"&&"data"in s&&s.data.type==="new-conversation-button")),r=this.#e.value.lastMsg;if(e&&r?.id!==e.id){let i=e?.parts?.find(s=>"tag"in s&&s.tag==="request-input-v1"&&"data"in s&&s.data.type==="new-conversation-button");if(i&&"data"in i)return[{title:i.data.title,type:i.data.type,key:i.data.key}]}if(r?.role!=="assistant")return[];let n=r.parts?.filter(i=>"tag"in i&&i.tag==="request-input-v1");return!n||n.length===0?[]:n.map(i=>!("data"in i)||!qu.includes(i.data.type)?null:{title:i.data.title,type:i.data.type,key:i.data.key}).filter(i=>i!==null)}get#C(){if(this.#p.length===0)return!1;let r=this.#p.filter(n=>n.type==="star-rating"||n.type==="binary-vote").length;return this.#t.length<r}get#S(){return this.renderRoot.querySelector("#scrollable-content")}get#f(){return this.renderRoot.querySelector("mw-chat-input")}reloadConfig(){this.#e.value?.reloadConfig(),this.requestUpdate()}sendMessage=ze({interval:200},async e=>{if(!e?.trim())return console.warn("sendMessage: Message must be a non-empty string"),!1;I(this.#e.value,"Widget context is required");let{value:r}=this.#e,n=await r.enqueueUserInput(e,{xUserData:r.xUserData,xCustomInstructions:r.xCustomInstructions,role:"user",expectStreaming:!0});return n&&this.#f?.setValue(""),n??!1});setInputValue(e){if(!e||typeof e!="string"){console.warn("setInputValue requires a valid string value");return}let r=this.#f;if(!r){console.warn("input element not found, cannot set value");return}r.setValue?r.setValue(e):console.warn("input element does not have setValue method")}focusInput(){window.requestAnimationFrame(()=>{this.#f?.focus()})}reset(){this.#n.clearImages(),this._currentRequestInputIndex=0,this.#t=[],this.#e.value?.reset()}};Vt.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(Vt.CloseClickEvent.type,{...e})}};customElements.get("mw-chat")||customElements.define("mw-chat",Vt);var Be=class t extends C(v){static properties={text:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=j`
2789
+ `}#l(e){let i=e.composedPath().find(n=>n instanceof HTMLAnchorElement);if(i){if(e.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId}),window.self!==window.top){window.open(i.href,"_blank");return}let s=this.config?.linksNewTab?"_blank":"_self";window.open(i.href,i.target||s)}}#h(e){if(this.isStreaming)return;e.preventDefault();let r=e.detail.example;this.#m(r)}#m=Ze({interval:200},async e=>{D(this.#e.value,"widget context is required"),await this.#e.value.enqueueUserInput(e,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions})&&(this.#f?.setValue(""),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!0,conversationId:this.conversationId}))});#v(e){if(D(this.#e.value,"widget context is required"),e.preventDefault(),this.config?.enableImageUpload&&this.#i.hasPendingImages)return;let r=e.detail;this.#e.value.enqueueUserInput(r,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions}).then(i=>{i&&(this.#f?.setValue(""),this.#i.clearImages(),this.#r.typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:this.conversationId}),window.requestAnimationFrame(()=>{this.#f?.focus()}))}).catch(console.warn)}#b(e){this.#r.onInput(e.detail.full)}#x(){D(this.#e.value,"widget context is required"),this.#e.value.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}#w(e){this.#i.onImageDelete(e.detail)}#y(){D(this.#e.value,"widget context is required"),this.#e.value.sendNewChat(),this.reset()}#g(){this.dispatchEvent(new t.CloseClickEvent)}#u(e){D(this.#e.value,"widget context is required");let r=this.#p,i=r[this._currentRequestInputIndex];if(!i){console.warn("no current state found for request input");return}switch(e.detail.type){case"star-rating":{let{rating:s,type:o}=e.detail;this.#t.set(i.key||i.title,{type:o,rating:s,key:i.key,title:i.title});break}case"binary-vote":{let{vote:s,type:o}=e.detail;this.#t.set(i.key||i.title,{type:o,vote:s,key:i.key,title:i.title});break}case"new-conversation-button":{this.#y(),this.requestUpdate();return}default:console.warn("unknown request input type",e.detail);return}this._currentRequestInputIndex+=1;let n=r.filter(s=>s.type==="star-rating"||s.type==="binary-vote").length;this.#t.size>=n&&this.#k(),this.requestUpdate()}async#k(){if(D(this.#e.value,"widget context is required"),this.#t.size===0)return;if(!this.#e.value.lastMsg?.id){console.warn("cannot submit request inputs without message ID");return}await this.#e.value.enqueueUserInput("",{role:"user",expectStreaming:!1,requestInputResponse:Array.from(this.#t.values())})&&this.#t.clear(),this.requestUpdate()}get#p(){D(this.#e.value,"widget context is required");let e=this.messages.findLast(n=>n.role==="assistant"&&n.parts?.some(s=>"tag"in s&&s.tag==="request-input-v1"&&"data"in s&&s.data.type==="new-conversation-button")),r=this.#e.value.lastMsg;if(e&&r?.id!==e.id){let n=e?.parts?.find(s=>"tag"in s&&s.tag==="request-input-v1"&&"data"in s&&s.data.type==="new-conversation-button");if(n&&"data"in n)return[{title:n.data.title,type:n.data.type,key:n.data.key}]}if(r?.role!=="assistant")return[];let i=r.parts?.filter(n=>"tag"in n&&n.tag==="request-input-v1");return!i||i.length===0?[]:i.map(n=>!("data"in n)||!Fu.includes(n.data.type)?null:{title:n.data.title,type:n.data.type,key:n.data.key}).filter(n=>n!==null)}get#C(){if(this.#p.length===0)return!1;let r=this.#p.filter(i=>i.type==="star-rating"||i.type==="binary-vote").length;return this.#t.size<r}get#_(){return this.renderRoot.querySelector("#scrollable-content")}get#f(){return this.renderRoot.querySelector("mw-chat-input")}reloadConfig(){this.#e.value?.reloadConfig(),this.requestUpdate()}sendMessage=Ze({interval:200},async e=>{if(!e?.trim())return console.warn("sendMessage: Message must be a non-empty string"),!1;D(this.#e.value,"Widget context is required");let{value:r}=this.#e,i=await r.enqueueUserInput(e,{xUserData:r.xUserData,xCustomInstructions:r.xCustomInstructions,role:"user",expectStreaming:!0});return i&&this.#f?.setValue(""),i??!1});setInputValue(e){if(!e||typeof e!="string"){console.warn("setInputValue requires a valid string value");return}let r=this.#f;if(!r){console.warn("input element not found, cannot set value");return}r.setValue?r.setValue(e):console.warn("input element does not have setValue method")}focusInput(){window.requestAnimationFrame(()=>{this.#f?.focus()})}reset(){this.#i.clearImages(),this._currentRequestInputIndex=0,this.#t.clear(),this.#e.value?.reset()}};Wt.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(Wt.CloseClickEvent.type,{...e})}};customElements.get("mw-chat")||customElements.define("mw-chat",Wt);var qe=class t extends k(v){static properties={color:{type:String},disabled:{type:Boolean},placeholder:{type:String},dark:{type:Boolean},_inputValue:{type:String,state:!0}};constructor(){super(),this.color="#8B5CF6",this.disabled=!1,this.placeholder="Ask AI...",this.dark=!1,this._inputValue=""}#e=new Date;#t(e){let r=e.target;this._inputValue=r.value,this.dispatchEvent(new t.ChangeEvent({value:this._inputValue}))}render(){return u`
2790
+ <mw-spinning-border
2791
+ .size=${"420px"}
2792
+ .color=${this.color||"#8B5CF6"}
2793
+ .radius=${"24px"}
2794
+ ?dark-mode="${this.dark}"
2795
+ class="${this.dark?"dark":""} rounded-[24px] font-sans text-sm shadow-lg transition-transform duration-500 hover:scale-105">
2796
+ <form
2797
+ @submit="${this.#r}"
2798
+ class="m-[1px] flex w-[250px] items-center rounded-[24px] bg-white px-2 py-2 text-gray-800 transition-all duration-500 focus-within:w-[calc(100vw-2rem)] focus-within:scale-100 active:w-[calc(100vw-2rem)] md:focus-within:w-[350px] md:active:w-[350px] dark:bg-gray-900 dark:text-white">
2799
+ <lucide-icon class="h-5 w-5 flex-none text-[${this.color||"#8B5CF6"}]" name="${"sparkles"}"></lucide-icon>
2800
+
2801
+ <input
2802
+ ?disabled="${this.disabled}"
2803
+ @keydown="${this.#s}"
2804
+ @input="${this.#t}"
2805
+ .value="${this._inputValue}"
2806
+ placeholder="${this.placeholder}"
2807
+ autocomplete="off"
2808
+ name="input"
2809
+ class="ml-2 w-full bg-transparent text-gray-800 placeholder:font-light placeholder:text-gray-500 focus:outline-none dark:text-white dark:placeholder:text-gray-400" />
2810
+
2811
+ <!-- submit button -->
2812
+ <button
2813
+ ?disabled="${this.disabled||!this._inputValue.trim()}"
2814
+ class="${this.dark?"text-gray-800":"text-white"} relative ml-2 h-8 w-8 flex-none rounded-full bg-[${this.color||"#8B5CF6"}] p-0 hover:opacity-70 disabled:bg-gray-400 disabled:text-gray-300 disabled:hover:opacity-100"
2815
+ type="submit">
2816
+ <div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2">
2817
+ <lucide-icon class="${this.dark?"text-gray-800":"text-white"} block h-5 w-5" name="${"arrow-up"}"></lucide-icon>
2818
+ </div>
2819
+ </button>
2820
+ </form>
2821
+ </mw-spinning-border>
2822
+ `}#r(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;this.#e=r;let n=this._inputValue.trim();n&&this.dispatchEvent(new t.SubmitInputEvent({text:n}))&&(this._inputValue="")}get#i(){return this.renderRoot.querySelector('input[name="input"]')??null}get#n(){return this.renderRoot.querySelector('button[type="submit"]')??null}#s(e){qu(e)&&(e.preventDefault(),this.disabled||this.#n?.click())}};qe.SubmitInputEvent=class extends CustomEvent{static type="mw-floating-ask-ai:submit";constructor(e,r={}){super(qe.SubmitInputEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};qe.ChangeEvent=class extends CustomEvent{static type="mw-floating-ask-ai:change";constructor(e,r={}){super(qe.ChangeEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};function qu(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-floating-ask-ai")||customElements.define("mw-floating-ask-ai",qe);var Ve=class t extends k(v){static properties={text:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=O`
2550
2823
  .popup-desktop:hover button {
2551
2824
  transition-delay: 0s !important;
2552
2825
  }
@@ -2554,7 +2827,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2554
2827
  .popup-desktop button {
2555
2828
  transition-delay: 1s;
2556
2829
  }
2557
- `;constructor(){super(),this.text="Hello there. How can we help?",this.color="#601feb",this.darkMode=!1}render=()=>d`
2830
+ `;constructor(){super(),this.text="Hello there. How can we help?",this.color="#601feb",this.darkMode=!1}render=()=>u`
2558
2831
  <div class="${this.darkMode?"dark":""} popup-desktop group relative w-[300px] cursor-pointer rounded-[17px] shadow-2xl select-none">
2559
2832
  <mw-spinning-border .color="${this.color}" .border="${"transparent"}" .radius="${"17px"}" ?dark-mode="${this.darkMode}">
2560
2833
  <!-- wrapper -->
@@ -2574,7 +2847,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2574
2847
  ×
2575
2848
  </button>
2576
2849
  </div>
2577
- `;#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};Be.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(Be.CloseEvent.type,{...e})}};Be.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Be.ClickEvent.type,{...e})}};customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",Be);var qe=class t extends C(v){static properties={text:{type:String},button:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb",this.darkMode=!1}render(){return d`
2850
+ `;#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};Ve.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(Ve.CloseEvent.type,{...e})}};Ve.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Ve.ClickEvent.type,{...e})}};customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",Ve);var Ne=class t extends k(v){static properties={text:{type:String},button:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb",this.darkMode=!1}render(){return u`
2578
2851
  <!-- wrapper -->
2579
2852
  <div
2580
2853
  class="${this.darkMode?"dark bg-[#2B2D31] text-gray-200":"bg-white text-gray-800"} group relative z-[2147483647] rounded-t-2xl text-left font-sans text-base text-[16px] leading-normal shadow-2xl transition-all select-none">
@@ -2590,7 +2863,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2590
2863
  <div class="p-4 text-gray-800 dark:text-gray-200" @click="${this.#t}">
2591
2864
  <h1 class="font-display mr-8 py-2.5 text-left text-lg font-bold">${this.text}</h1>
2592
2865
  <div class="h-4"></div>
2593
- ${this.button&&this.color?d`
2866
+ ${this.button&&this.color?u`
2594
2867
  <!-- only visible if button text and color are given -->
2595
2868
  <button class="w-full rounded-2xl bg-[${this.color}] px-5 py-2.5 text-center text-sm font-medium text-white dark:text-gray-800" type="button">${this.button}</button>
2596
2869
  `:null}
@@ -2599,7 +2872,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2599
2872
  <!-- can append any other content -->
2600
2873
  <slot name="footer"></slot>
2601
2874
  </div>
2602
- `}#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};qe.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(qe.CloseEvent.type,{...e})}};qe.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(qe.ClickEvent.type,{...e})}};customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",qe);var Yr=class{#e;#t=!1;constructor(e,r){this.#e=r,e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",this.#r),window.addEventListener("keydown",this.#r)}stopListening(){window.removeEventListener("click",this.#r),window.removeEventListener("keydown",this.#r)}#r=()=>{this.#t||(this.#e.userFirstInteracted?.(),this.#t=!0),this.#e.userInteracted?.()}};var Fu=1440*60*1e3,Xr=class{#e;#t;#r;#n;#i=!1;#s=!1;get showing(){return this.#i}constructor(e,r,n=Date){this.#e=e,this.#t=r,this.#r=n,e.addController(this)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!this.#i&&(this.#i=!0,this.#e.requestUpdate(),e)){this.#t.playPopupSound();let r=this.#t.getPersistedState();this.#t.setPersistedState({...r,playedSoundOnce:!0})}}#o(){let e=this.#t.getPersistedState(),r=!!e?.playedSoundOnce;e?.userDismissedAt&&this.#r.now()-e.userDismissedAt<Fu||this.show({sound:!r})}hide(){this.#s=!0,this.abortAutoShowTimer(),this.#i=!1,this.#e.requestUpdate()}abortAutoShowTimer(){clearTimeout(this.#n)}onCloseClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}onContentClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),this.#s||(this.#n=setTimeout(()=>this.#o(),this.#t.getDelayMs()))}};var Ht=class t extends C(v){static properties={positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"}};#e=new Xr(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(e=>{console.error("Error playing audio:",e,{})})},setPersistedState:e=>{U.popupState=e},getPersistedState:()=>U.popupState});#t=new Yr(this,this.#e);constructor(){super(),this.positionClasses="",this.delayMs=0,this.soundUrl="",this.darkMode=!1,this.content={desktop:{text:"",color:""},mobile:{text:"",button:"",color:"",poweredBy:!0}}}render(){let e=this.#e.showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",r=this.content;return d`
2875
+ `}#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};Ne.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(Ne.CloseEvent.type,{...e})}};Ne.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Ne.ClickEvent.type,{...e})}};customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",Ne);var ei=class{#e;#t=!1;constructor(e,r){this.#e=r,e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",this.#r),window.addEventListener("keydown",this.#r)}stopListening(){window.removeEventListener("click",this.#r),window.removeEventListener("keydown",this.#r)}#r=()=>{this.#t||(this.#e.userFirstInteracted?.(),this.#t=!0),this.#e.userInteracted?.()}};var Vu=1440*60*1e3,ti=class{#e;#t;#r;#i;#n=!1;#s=!1;get showing(){return this.#n}constructor(e,r,i=Date){this.#e=e,this.#t=r,this.#r=i,e.addController(this)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!this.#n&&(this.#n=!0,this.#e.requestUpdate(),e)){this.#t.playPopupSound();let r=this.#t.getPersistedState();this.#t.setPersistedState({...r,playedSoundOnce:!0})}}#o(){let e=this.#t.getPersistedState(),r=!!e?.playedSoundOnce;e?.userDismissedAt&&this.#r.now()-e.userDismissedAt<Vu||this.show({sound:!r})}hide(){this.#s=!0,this.abortAutoShowTimer(),this.#n=!1,this.#e.requestUpdate()}abortAutoShowTimer(){clearTimeout(this.#i)}onCloseClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}onContentClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),this.#s||(this.#i=setTimeout(()=>this.#o(),this.#t.getDelayMs()))}};var Gt=class t extends k(v){static properties={positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object},darkMode:{type:Boolean,attribute:"dark-mode"}};#e=new ti(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(e=>{console.error("Error playing audio:",e,{})})},setPersistedState:e=>{R.popupState=e},getPersistedState:()=>R.popupState});#t=new ei(this,this.#e);constructor(){super(),this.positionClasses="",this.delayMs=0,this.soundUrl="",this.darkMode=!1,this.content={desktop:{text:"",color:""},mobile:{text:"",button:"",color:"",poweredBy:!0}}}render(){let e=this.#e.showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",r=this.content;return u`
2603
2876
  <!-- mobile shadow backdrop -->
2604
2877
  <div @click="${this.#r}" class="${e} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
2605
2878
 
@@ -2610,17 +2883,17 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2610
2883
  button="${r.mobile.button}"
2611
2884
  color="${r.mobile.color}"
2612
2885
  ?dark-mode="${this.darkMode}"
2613
- @mw:click="${this.#n}"
2886
+ @mw:click="${this.#i}"
2614
2887
  @mw:close="${this.#r}">
2615
- ${r.mobile.poweredBy?d`<mw-powered-by class="block p-4" slot="footer" ?dark-mode="${this.darkMode}"></mw-powered-by>`:null}
2888
+ ${r.mobile.poweredBy?u`<mw-powered-by class="block p-4" slot="footer" ?dark-mode="${this.darkMode}"></mw-powered-by>`:null}
2616
2889
  </mw-popup-mobile>
2617
2890
  </div>
2618
2891
 
2619
2892
  <!-- desktop -->
2620
2893
  <div class="${e} ${this.positionClasses} fixed z-[2147483647] transition-[opacity,translate,visibility] max-sm:hidden">
2621
- <mw-popup-desktop color="${r.desktop.color}" text="${r.desktop.text}" ?dark-mode="${this.darkMode}" @mw:click="${this.#n}" @mw:close="${this.#r}"></mw-popup-desktop>
2894
+ <mw-popup-desktop color="${r.desktop.color}" text="${r.desktop.text}" ?dark-mode="${this.darkMode}" @mw:click="${this.#i}" @mw:close="${this.#r}"></mw-popup-desktop>
2622
2895
  </div>
2623
- `}#r(){this.#e.onCloseClick()}#n(){this.dispatchEvent(new t.ClickEvent),this.#e.onContentClick()}hide(){this.#e.hide()}};Ht.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Ht.ClickEvent.type,{...e})}};customElements.get("mw-popup")||customElements.define("mw-popup",Ht);var Ni=class extends C(v){static properties={color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}};constructor(){super(),this.color="sky-500",this.position="top-right"}render=()=>d`
2896
+ `}#r(){this.#e.onCloseClick()}#i(){this.dispatchEvent(new t.ClickEvent),this.#e.onContentClick()}hide(){this.#e.hide()}};Gt.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Gt.ClickEvent.type,{...e})}};customElements.get("mw-popup")||customElements.define("mw-popup",Gt);var Gn=class extends k(v){static properties={color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}};constructor(){super(),this.color="sky-500",this.position="top-right"}render=()=>u`
2624
2897
  <span class="relative inline-flex">
2625
2898
  <slot></slot>
2626
2899
  <span class="${this.#e} pointer-events-none absolute z-10 flex h-3 w-3">
@@ -2628,7 +2901,7 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2628
2901
  <span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
2629
2902
  </span>
2630
2903
  </span>
2631
- `;get#e(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:throw new Error(`Invalid position: ${this.position}`)}}};customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",Ni);var Vi=class extends C(v){static properties={positionClasses:{type:String,attribute:"position"},text:{type:String}};constructor(){super(),this.positionClasses="",this.text="Try it out"}render=()=>d`
2904
+ `;get#e(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:throw new Error(`Invalid position: ${this.position}`)}}};customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",Gn);var Zn=class extends k(v){static properties={positionClasses:{type:String,attribute:"position"},text:{type:String}};constructor(){super(),this.positionClasses="",this.text="Try it out"}render=()=>u`
2632
2905
  <div class="${this.positionClasses} fixed right-6 bottom-24 z-10 flex animate-bounce flex-col items-center justify-center font-sans text-base">
2633
2906
  <p class="mb-2 -translate-x-4 -rotate-12 transform text-lg leading-normal font-bold text-gray-800">${this.text}</p>
2634
2907
 
@@ -2641,11 +2914,11 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2641
2914
  stroke-linecap="round"></path>
2642
2915
  </svg>
2643
2916
  </div>
2644
- `};customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",Vi);function ke(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}var Qr=class{#e;#t;#r;#n;isLoading=!1;data=void 0;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n,e.addController(this)}fetch(){if(this.isLoading)return;this.#n?.abort();let e=new AbortController;this.#n=e,this.isLoading=!0,this.data=void 0,this.#e.requestUpdate(),(async()=>{let r=this.#i();return r.signal?.addEventListener("abort",()=>e.abort(),{signal:e.signal}),fetch(r,{signal:e.signal})})().then(async r=>{if(!r.ok)throw new Error(`${r.statusText}: ${await r.text()}`);this.isLoading=!1,this.data=typeof this.#r?.transform=="function"?await this.#r.transform(r):r,this.#e.requestUpdate()}).catch(r=>{this.#r?.onError?.(r),this.isLoading=!1,this.data=void 0,this.#e.requestUpdate()}).finally(()=>{e.abort()})}#i(){let e=this.#t;if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)}hostConnected(){this.isLoading||this.#r?.fetchWhenConnected&&this.fetch()}hostDisconnected(){this.#n?.abort(),this.#n=void 0}};var Hi=class{#e;#t;#r;#n;get data(){return this.#n||this.#r?.data}constructor(e,r){this.#e=e,this.#t=r,e.addController(this)}hostConnected(){if(this.#r||this.#n)return;let e=Pa();e&&e.widgetId===this.#e.widgetId?this.#n=e.config:this.#r=new Qr(this.#e,()=>{if(this.#e.cdn&&this.#e.widgetId)return`${this.#e.cdn}/config?w=${this.#e.widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:async r=>{let n=await r.json();return n&&!e&&window.__INIT_MOLIN_SHOP_AI({cdn:this.#e.cdn,widgetId:this.#e.widgetId,config:n}),n},onError:this.#t?.onError})}},ht=(t,e)=>new Hi(t,{onError:e?.onError||console.error,...e});var Fe=class t extends C(v){static styles=j`
2917
+ `};customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",Zn);function Se(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}var ri=class{#e;#t;#r;#i;isLoading=!1;data=void 0;constructor(e,r,i){this.#e=e,this.#t=r,this.#r=i,e.addController(this)}fetch(){if(this.isLoading)return;this.#i?.abort();let e=new AbortController;this.#i=e,this.isLoading=!0,this.data=void 0,this.#e.requestUpdate(),(async()=>{let r=this.#n();return r.signal?.addEventListener("abort",()=>e.abort(),{signal:e.signal}),fetch(r,{signal:e.signal})})().then(async r=>{if(!r.ok)throw new Error(`${r.statusText}: ${await r.text()}`);this.isLoading=!1,this.data=typeof this.#r?.transform=="function"?await this.#r.transform(r):r,this.#e.requestUpdate()}).catch(r=>{this.#r?.onError?.(r),this.isLoading=!1,this.data=void 0,this.#e.requestUpdate()}).finally(()=>{e.abort()})}#n(){let e=this.#t;if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)}hostConnected(){this.isLoading||this.#r?.fetchWhenConnected&&this.fetch()}hostDisconnected(){this.#i?.abort(),this.#i=void 0}};var Jn=class{#e;#t;#r;#i;get data(){return this.#i||this.#r?.data}constructor(e,r){this.#e=e,this.#t=r,e.addController(this)}hostConnected(){if(this.#r||this.#i)return;let e=Fa();e&&e.widgetId===this.#e.widgetId?this.#i=e.config:this.#r=new ri(this.#e,()=>{if(this.#e.cdn&&this.#e.widgetId)return`${this.#e.cdn}/config?w=${this.#e.widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:async r=>{let i=await r.json();return i&&!e&&window.__INIT_MOLIN_SHOP_AI({cdn:this.#e.cdn,widgetId:this.#e.widgetId,config:i}),i},onError:this.#t?.onError})}},mt=(t,e)=>new Jn(t,{onError:e?.onError||console.error,...e});var He=class t extends k(v){static styles=O`
2645
2918
  :host {
2646
2919
  all: initial; /* reset all properties that can pierce the shadow DOM */
2647
2920
  }
2648
- `;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1}};#e;get config(){return this.#t||this.#e.data}#t;#r={onError:e=>{alert(e.error),console.error(e.widgetId,e.error),T("ShopAssistant: error",{...e},{immediate:!0})},onNewMessageStartedStreaming:e=>{T("ShopAssistant: user received bot message (streaming started)",e)},onMessageEndedStreaming:e=>{T("ShopAssistant: user received bot message (streaming ended)",e)},onUserCanceledStreaming:e=>{T("ShopAssistant: user canceled streaming",e)},onUserClickedLink:e=>{T("ShopAssistant: user clicked link",e)},onUserSentInput:e=>{T("ShopAssistant: user sent input",e)}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.xUserData=ke()?.userData,this.xCustomInstructions=ke()?.customInstructions,this.#e=ht(this)}render(){return this.config?d`
2921
+ `;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1}};#e;get config(){return this.#t||this.#e.data}#t;#r={onError:e=>{alert(e.error),console.error(e.widgetId,e.error),L("ShopAssistant: error",{...e},{immediate:!0})},onNewMessageStartedStreaming:e=>{L("ShopAssistant: user received bot message (streaming started)",e)},onMessageEndedStreaming:e=>{L("ShopAssistant: user received bot message (streaming ended)",e)},onUserCanceledStreaming:e=>{L("ShopAssistant: user canceled streaming",e)},onUserClickedLink:e=>{L("ShopAssistant: user clicked link",e)},onUserSentInput:e=>{L("ShopAssistant: user sent input",e)}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.xUserData=Se()?.userData,this.xCustomInstructions=Se()?.customInstructions,this.#e=mt(this)}render(){return this.config?u`
2649
2922
  <mw-context-widget
2650
2923
  .widgetId="${this.widgetId}"
2651
2924
  .config="${this.config}"
@@ -2654,15 +2927,15 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2654
2927
  .xCustomInstructions="${this.xCustomInstructions}"
2655
2928
  autoConnect>
2656
2929
  <!-- embed our chat component forwarding props -->
2657
- <mw-chat ?show-close="${this.showClose}" @mw:close-click="${this.#n}">
2930
+ <mw-chat ?show-close="${this.showClose}" @mw:close-click="${this.#i}">
2658
2931
  <slot name="banner" slot="banner"></slot>
2659
2932
  </mw-chat>
2660
2933
  </mw-context-widget>
2661
- `:null}#n(){this.dispatchEvent(new t.CloseClickEvent)}injectConfig(e){this.#t=e,this.requestUpdate()}reloadConfig(){this.#i?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",this.#i?.reset(),this.requestUpdate()}get#i(){return this.renderRoot.querySelector("mw-chat")}get conversationId(){return this.#i?.conversationId??""}get messages(){return this.#i?.messages??[]}};customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",Fe);Fe.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(Fe.CloseClickEvent.type,{...e})}};var zi=class{hidden;constructor({hidden:e=!1}){this.hidden=e}setUserData(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data")}setCustomInstructions(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions")}showLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof me&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof me&&e.hideLauncher()}openChat(e){let{message:r,autoSend:n}=e||{};for(let i of document.querySelectorAll("molin-shop-ai"))i instanceof me&&i.openChat({message:r,autoSend:n})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof me&&e.closeChat()}reset(){U.resetAll();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof me&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof Fe&&e.reset()}};function Ra({hidden:t}){let e=new zi({hidden:t});return window.Molin=e,e}function en(){let t=window.Molin;if(!t)throw new Error("window.Molin global not initialized");return t}window.__INIT_MOLIN_SHOP_AI=function(e){Nu(e);let r=ke(),n=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(Ra({hidden:n}),e.auto){let i=document.createElement("molin-shop-ai");i.setAttribute("cdn",e.cdn),i.setAttribute("widget",e.widgetId),document.body.appendChild(i)}};function Nu(t){window.__INIT_MOLIN_SHOP_AI_OPTIONS=t}function Pa(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Wi=class extends C(v){static styles=j`
2934
+ `:null}#i(){this.dispatchEvent(new t.CloseClickEvent)}injectConfig(e){this.#t=e,this.requestUpdate()}reloadConfig(){this.#n?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",this.#n?.reset(),this.requestUpdate()}get#n(){return this.renderRoot.querySelector("mw-chat")}get conversationId(){return this.#n?.conversationId??""}get messages(){return this.#n?.messages??[]}};customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",He);He.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(He.CloseClickEvent.type,{...e})}};var Kn=class{hidden;constructor({hidden:e=!1}){this.hidden=e}setUserData(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data")}setCustomInstructions(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions")}showLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ye&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ye&&e.hideLauncher()}openChat(e){let{message:r,autoSend:i}=e||{};for(let n of document.querySelectorAll("molin-shop-ai"))n instanceof ye&&n.openChat({message:r,autoSend:i})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ye&&e.closeChat()}reset(){R.resetAll();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ye&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof He&&e.reset()}};function qa({hidden:t}){let e=new Kn({hidden:t});return window.Molin=e,e}function ii(){let t=window.Molin;if(!t)throw new Error("window.Molin global not initialized");return t}window.__INIT_MOLIN_SHOP_AI=function(e){Nu(e);let r=Se(),i=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(qa({hidden:i}),e.auto){let n=document.createElement("molin-shop-ai");n.setAttribute("cdn",e.cdn),n.setAttribute("widget",e.widgetId),document.body.appendChild(n)}};function Nu(t){window.__INIT_MOLIN_SHOP_AI_OPTIONS=t}function Fa(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Xn=class extends k(v){static styles=O`
2662
2935
  :host {
2663
2936
  all: initial; /* reset all properties that can pierce the shadow DOM */
2664
2937
  }
2665
- `;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}#e=ht(this);get config(){return this.#e.data}render(){return this.config?d`
2938
+ `;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}#e=mt(this);get config(){return this.#e.data}render(){return this.config?u`
2666
2939
  <!-- embed our bubble component forwarding props -->
2667
2940
  <!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
2668
2941
  <mw-bubble
@@ -2670,20 +2943,20 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2670
2943
  .color="${this.config?.bubble?.color||this.config?.color}"
2671
2944
  .bubbleStyle="${this.config?.bubble?.style}"
2672
2945
  .src="${this.config?.bubble?.bubbleUrl}"
2673
- width="${z(this.config?.bubble?.size?.width)}"
2674
- height="${z(this.config?.bubble?.size?.height)}"></mw-bubble>
2675
- `:null}};customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",Wi);var Cw="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),Sw="navigator"in globalThis&&"share"in navigator,Vu=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function Hu(t){if(typeof window>"u")return!1;let e=Vu[t];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${t}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function Gi(){return Hu("sm")}var tn=class{#e;#t;#r;#n;#i=!1;constructor(e,r,n,i=window.history){this.#e=e,this.#t=r,this.#r=n,this.#n=i,e.addController(this)}hostConnected(){this.#s();let e=this.#n.pushState;this.#n.pushState=(...r)=>{if(e.call(this.#n,...r),!this.#i)try{let n=new URL(r[2],window.location.origin);this.#t.test(n.pathname)&&this.#r.navigated()}catch{}}}hostDisconnected(){this.#i=!0}#s=()=>{this.#t.test(window.location.pathname)&&this.#r.navigated()}};function Ba({minMs:t,maxMs:e}){return Math.random()*(e-t)+t}function rn(t,e=""){return Object.entries(t).filter(([r,n])=>n).map(([r,n])=>`${e}${r}-[${n}]`).join(" ")}function qa(t,e={}){return[rn(t),rn(e,"max-sm:")].join(" ")}function Fa(t){return rn(t)}function Na(t){return Object.entries(t).filter(([e,r])=>r).filter(([e])=>e==="left"||e==="right").map(([e,r])=>{let n=`sm:${e}-[${r}]`;return e==="left"&&(n+=" sm:right-auto"),e==="right"&&(n+=" sm:left-auto"),n}).join(" ")}function Va(t){let e=rn(t),n=`sm:bottom-[${t.bottom?`calc(${t.bottom}+72px)`:"72px"}]`;return[e,n].filter(Boolean).join(" ")}var Zi=class{#e=0;#t=!1;#r;#n;constructor(e,r,{threshold:n=5}={}){this.#r=r,this.#n=n,e.addController(this)}hostConnected(){this.#e=window.scrollY,window.addEventListener("scroll",this.#i,{passive:!0})}hostDisconnected(){window.removeEventListener("scroll",this.#i)}#i=()=>{this.#t||(requestAnimationFrame(this.#s),this.#t=!0)};#s=()=>{let e=window.scrollY,r=e-this.#e;if(Math.abs(r)>=this.#n){let n=r>0?"down":"up";this.#r({scrollY:e,direction:n,deltaY:Math.abs(r)}),this.#e=e}this.#t=!1}};function Ha(t,e,r){return new Zi(t,e,r)}var me=class extends C(v){static styles=j`
2946
+ width="${W(this.config?.bubble?.size?.width)}"
2947
+ height="${W(this.config?.bubble?.size?.height)}"></mw-bubble>
2948
+ `:null}};customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",Xn);var jw="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),Lw="navigator"in globalThis&&"share"in navigator,Hu=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function zu(t){if(typeof window>"u")return!1;let e=Hu[t];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${t}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function Yn(){return zu("sm")}var ni=class{#e;#t;#r;#i;#n=!1;constructor(e,r,i,n=window.history){this.#e=e,this.#t=r,this.#r=i,this.#i=n,e.addController(this)}hostConnected(){this.#s();let e=this.#i.pushState;this.#i.pushState=(...r)=>{if(e.call(this.#i,...r),!this.#n)try{let i=new URL(r[2],window.location.origin);this.#t.test(i.pathname)&&this.#r.navigated()}catch{}}}hostDisconnected(){this.#n=!0}#s=()=>{this.#t.test(window.location.pathname)&&this.#r.navigated()}};function Va({minMs:t,maxMs:e}){return Math.random()*(e-t)+t}function si(t,e=""){return Object.entries(t).filter(([r,i])=>i).map(([r,i])=>`${e}${r}-[${i}]`).join(" ")}function Na(t,e={}){return[si(t),si(e,"max-sm:")].join(" ")}function Ha(t){return si(t)}function za(t){return Object.entries(t).filter(([e,r])=>r).filter(([e])=>e==="left"||e==="right").map(([e,r])=>{let i=`sm:${e}-[${r}]`;return e==="left"&&(i+=" sm:right-auto"),e==="right"&&(i+=" sm:left-auto"),i}).join(" ")}function Wa(t){let e=si(t),i=`sm:bottom-[${t.bottom?`calc(${t.bottom}+72px)`:"72px"}]`;return[e,i].filter(Boolean).join(" ")}var Qn=class{#e=0;#t=!1;#r;#i;constructor(e,r,{threshold:i=5}={}){this.#r=r,this.#i=i,e.addController(this)}hostConnected(){this.#e=window.scrollY,window.addEventListener("scroll",this.#n,{passive:!0})}hostDisconnected(){window.removeEventListener("scroll",this.#n)}#n=()=>{this.#t||(requestAnimationFrame(this.#s),this.#t=!0)};#s=()=>{let e=window.scrollY,r=e-this.#e;if(Math.abs(r)>=this.#i){let i=r>0?"down":"up";this.#r({scrollY:e,direction:i,deltaY:Math.abs(r)}),this.#e=e}this.#t=!1}};function Ga(t,e,r){return new Qn(t,e,r)}var ye=class extends k(v){static styles=O`
2676
2949
  :host {
2677
2950
  all: initial; /* reset all properties that can pierce the shadow DOM */
2678
2951
  }
2679
- `;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1},_floatingInputVisible:{type:Boolean,state:!0},_dialogShown:{type:Boolean,state:!0}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this._floatingInputVisible=!0,this._dialogShown=!1,this.xUserData=ke()?.userData,this.xCustomInstructions=ke()?.customInstructions}#e=ht(this);#t=Ha(this,e=>{this.#a&&!this._dialogShown&&(e.direction==="down"?this._floatingInputVisible=!1:e.direction==="up"&&(this._floatingInputVisible=!0),this.requestUpdate())},{threshold:20});get config(){return this.#r||this.#e.data}#r;#n=new tn(this,/.*/i,{navigated:()=>{if(this.requestUpdate(),!this.widgetId){console.warn("No widgetId set, cannot track page view");return}let e=this.#l?.conversationId,r=Ye.restore(this.widgetId)?.conversationId,n=e||r;n&&T("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:n,url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0,shouldHideForCurrentUrl:this.#d})}});#i=!1;#s={onError:e=>{alert(e.error),console.error(e.widgetId,e.error),T("ShopAssistant: error",{...e},{immediate:!0})},onNewMessageStartedStreaming:e=>{T("ShopAssistant: user received bot message (streaming started)",e)},onMessageEndedStreaming:e=>{T("ShopAssistant: user received bot message (streaming ended)",e)},onUserCanceledStreaming:e=>{T("ShopAssistant: user canceled streaming",e)},onUserClickedLink:e=>{T("ShopAssistant: user clicked link",e)},onUserSentInput:e=>{T("ShopAssistant: user sent input",e)},onWaitGameQuestionAnswered:e=>{T("ShopAssistant: wait game question answered",e)},onWaitGameCompleted:e=>{T("ShopAssistant: wait game completed",e)},onWaitGameGuessValidated:e=>{T("ShopAssistant: wait game guess validated",e)}};get#o(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647}get#a(){return this.config?.floatingAskAI?.enabled||!0}get#d(){if(!this.config?.hideUrls||!Array.isArray(this.config.hideUrls))return!1;let e=window.location.href,r=window.location.pathname;return this.config.hideUrls.some(n=>{if(!n||typeof n!="string")return!1;let i=n.endsWith("*"),s=i?n.slice(0,-1):n;return n.startsWith("http")?i?e.startsWith(s):e===s:i?r.startsWith(s):r===s})}render(){if(!this.config)return null;let e=qa(this.config.bubble.position,this.config.bubble.mobilePosition),r=Fa(this.config.bubble.position),n=Na(this.config.bubble.position),i=Va(this.config.bubble.position);return this.config.hidden||en().hidden||this.#d?null:d`
2952
+ `;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1},_floatingInputVisible:{type:Boolean,state:!0},_dialogShown:{type:Boolean,state:!0}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this._floatingInputVisible=!0,this._dialogShown=!1,this.xUserData=Se()?.userData,this.xCustomInstructions=Se()?.customInstructions}#e=mt(this);#t=Ga(this,e=>{this.#a&&!this._dialogShown&&(e.direction==="down"?this._floatingInputVisible=!1:e.direction==="up"&&(this._floatingInputVisible=!0),this.requestUpdate())},{threshold:20});get config(){return this.#r||this.#e.data}#r;#i=new ni(this,/.*/i,{navigated:()=>{if(this.requestUpdate(),!this.widgetId){console.warn("No widgetId set, cannot track page view");return}let e=this.#l?.conversationId,r=et.restore(this.widgetId)?.conversationId,i=e||r;i&&L("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:i,url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0,shouldHideForCurrentUrl:this.#d})}});#n=!1;#s={onError:e=>{alert(e.error),console.error(e.widgetId,e.error),L("ShopAssistant: error",{...e},{immediate:!0})},onNewMessageStartedStreaming:e=>{L("ShopAssistant: user received bot message (streaming started)",e)},onMessageEndedStreaming:e=>{L("ShopAssistant: user received bot message (streaming ended)",e)},onUserCanceledStreaming:e=>{L("ShopAssistant: user canceled streaming",e)},onUserClickedLink:e=>{L("ShopAssistant: user clicked link",e)},onUserSentInput:e=>{L("ShopAssistant: user sent input",e)},onWaitGameQuestionAnswered:e=>{L("ShopAssistant: wait game question answered",e)},onWaitGameCompleted:e=>{L("ShopAssistant: wait game completed",e)},onWaitGameGuessValidated:e=>{L("ShopAssistant: wait game guess validated",e)}};get#o(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647}get#a(){return this.config?.floatingAskAI?.enabled||!0}get#d(){if(!this.config?.hideUrls||!Array.isArray(this.config.hideUrls))return!1;let e=window.location.href,r=window.location.pathname;return this.config.hideUrls.some(i=>{if(!i||typeof i!="string")return!1;let n=i.endsWith("*"),s=n?i.slice(0,-1):i;return i.startsWith("http")?n?e.startsWith(s):e===s:n?r.startsWith(s):r===s})}render(){if(!this.config)return null;let e=Na(this.config.bubble.position,this.config.bubble.mobilePosition),r=Ha(this.config.bubble.position),i=za(this.config.bubble.position),n=Wa(this.config.bubble.position);return this.config.hidden||ii().hidden||this.#d?null:u`
2680
2953
  <mw-context-widget
2681
2954
  .widgetId="${this.widgetId}"
2682
2955
  .config="${this.config}"
2683
2956
  .callbacks="${this.#s}"
2684
2957
  .xUserData="${this.xUserData}"
2685
2958
  .xCustomInstructions="${this.xCustomInstructions}"
2686
- .autoConnect="${this.#i}">
2959
+ .autoConnect="${this.#n}">
2687
2960
  <mw-bubble
2688
2961
  class="${e} ${this._dialogShown?"opacity-0":"opacity-100"} fixed z-[${this.#o}] transition-opacity"
2689
2962
  @click="${this.#v}"
@@ -2691,14 +2964,14 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2691
2964
  .color="${this.config?.bubble?.color||this.config?.color}"
2692
2965
  .bubbleStyle="${this.config?.bubble?.style}"
2693
2966
  .src="${this.config?.bubble?.bubbleUrl}"
2694
- width="${z(this.config?.bubble?.size?.width)}"
2695
- height="${z(this.config?.bubble?.size?.height)}"></mw-bubble>
2967
+ width="${W(this.config?.bubble?.size?.width)}"
2968
+ height="${W(this.config?.bubble?.size?.height)}"></mw-bubble>
2696
2969
 
2697
2970
  <!-- only load the component if enabled on any platform -->
2698
- ${this.isPopupEnabled?d`
2971
+ ${this.isPopupEnabled?u`
2699
2972
  <mw-popup
2700
- position="${i}"
2701
- delay="${this.config.popup?.delayMs||Ba({minMs:2e3,maxMs:5e3})}"
2973
+ position="${n}"
2974
+ delay="${this.config.popup?.delayMs||Va({minMs:2e3,maxMs:5e3})}"
2702
2975
  sound="${this.config.popup?.muteSounds?"":this.config.popup?.soundUrl||""}"
2703
2976
  ?dark-mode="${this.config?.darkMode}"
2704
2977
  .content="${{desktop:{text:this.config.popup?.text||"Hello there. How can we help?",color:this.config?.bubble?.color||this.config.color},mobile:{text:this.config.popup?.text||"Hello there. How can we help?",button:this.config.popup?.mobileButtonText||`Chat with ${this.config.title}`,color:this.config.color,poweredBy:!this.config.removePoweredBy}}}"
@@ -2706,31 +2979,33 @@ var Wa=Object.create;var Ji=Object.defineProperty;var Ga=Object.getOwnPropertyDe
2706
2979
  `:null}
2707
2980
 
2708
2981
  <!-- show "Try it out" if enabled (even if the chat window is showing) -->
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}
2982
+ ${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?u`
2983
+ <mw-try-it-out
2984
+ class="${this.config?.tryItOut?.mobileEnabled?"visible":"invisible"} ${this.config?.tryItOut?.desktopEnabled?"sm:visible":"sm:invisible"}"
2985
+ position="${r}"
2986
+ text="${this.config.tryItOut?.text||""}"></mw-try-it-out>
2987
+ `:null}
2713
2988
 
2714
2989
  <!-- 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. -->
2715
2990
  <div
2716
- class="${this._dialogShown?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${n} ${this.config?.darkMode?"bg-[#14161A]":"bg-white"} fixed inset-0 z-[2147483647] font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:top-auto sm:bottom-6 sm:h-[92%] sm:max-h-[800px] sm:w-[calc(100dvh*0.50)] sm:max-w-[400px] sm:min-w-[300px] sm:rounded-[36px] 2xl:max-w-[420px]">
2991
+ class="${this._dialogShown?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${i} ${this.config?.darkMode?"bg-[#14161A]":"bg-white"} fixed inset-0 z-[2147483647] font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:top-auto sm:bottom-6 sm:h-[92%] sm:max-h-[800px] sm:w-[calc(100dvh*0.50)] sm:max-w-[400px] sm:min-w-[300px] sm:rounded-[36px] 2xl:max-w-[420px]">
2717
2992
  <mw-chat ?show-close="${!0}" @mw:close-click="${this.#b}">
2718
2993
  <slot name="banner" slot="banner"></slot>
2719
2994
  </mw-chat>
2720
2995
  </div>
2721
2996
 
2722
2997
  <!-- Floating input only visible when enabled, in center, on desktop only -->
2723
- ${this.config?.floatingAskAI?.enabled&&this.#a?d`
2998
+ ${this.config?.floatingAskAI?.enabled&&this.#a?u`
2724
2999
  <mw-floating-ask-ai
2725
3000
  ?dark="${this.config?.floatingAskAI?.darkMode}"
2726
3001
  .color="${this.config.color||this.config?.bubble?.color}"
2727
- placeholder="${z(this.config?.floatingAskAI?.placeholder)}"
3002
+ placeholder="${W(this.config?.floatingAskAI?.placeholder)}"
2728
3003
  class="${!this._dialogShown&&this._floatingInputVisible?"opacity-100 translate-y-0":"opacity-0 translate-y-full"} fixed left-1/2 z-[${this.#o}] hidden -translate-x-1/2 transition-all duration-300 ease-in-out max-md:hidden sm:block"
2729
3004
  style="bottom: ${this.config.bubble.position.bottom||"1.5rem"}"
2730
3005
  @mw-floating-ask-ai:submit="${this.#x}"></mw-floating-ask-ai>
2731
3006
  `:null}
2732
3007
  </mw-context-widget>
2733
- `}get isPopupEnabled(){return Gi()?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){this._dialogShown&&this.#c?.hide(),this._dialogShown&&setTimeout(()=>{this.#l?.focusInput()},0)}firstUpdated(){Gi()&&U.widgetState?.isOpen&&!this._dialogShown&&(this._dialogShown=!0,this.#i=!0,this.requestUpdate())}get#c(){return this.renderRoot.querySelector("mw-popup")}get#l(){return this.renderRoot.querySelector("mw-chat")}get#h(){return this.renderRoot.querySelector("mw-context-widget")}#m(){this._dialogShown=!0,this.#i=!0,this.requestUpdate(),this.#u(!0),T("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:this._dialogShown?"open":"close"})}#v(){this._dialogShown=!this._dialogShown,this.#i=!0,this.requestUpdate(),this.#u(this._dialogShown),this.#c?.hide(),T("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:this._dialogShown?"open":"close"})}#b(){this._dialogShown=!1,this._floatingInputVisible=!0,this.requestUpdate(),this.#u(!1),T("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:this._dialogShown?"open":"close"})}#x=e=>{let r=e.detail.text,n=this.#h;n&&typeof n.connect=="function"&&n.connect(),this._dialogShown=!0,this.#i=!0,this.requestUpdate(),this.#u(!0),setTimeout(()=>{this.#g(r),this.#y(r).catch(console.warn)},100),T("ShopAssistant: user sent input",{widgetId:this.widgetId,text:r,example:!1,conversationId:this.#l?.conversationId||"",source:"ask-ai"})};#w=ze({interval:200},({message:e,autoSend:r=!1}={})=>{if(!e)return;this.#g(e);let n=this.#l?.isLiveMode;n||this.reset(),r&&!n&&this.#y(e).catch(console.warn)});openChat(e){let{message:r,autoSend:n}=e||{};if(this._dialogShown){this.#w({message:r,autoSend:n});return}let i=this.#h;i&&typeof i.connect=="function"&&i.connect(),this._dialogShown=!0,this.#i=!0,this.requestUpdate(),this.#u(!0),this.#c?.hide(),setTimeout(()=>{this.#w({message:r,autoSend:n})},100),T("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:this._dialogShown?"open":"close"})}closeChat(){this._dialogShown&&(this._dialogShown=!1,this._floatingInputVisible=!0,this.requestUpdate(),this.#u(!1),this.#c?.hide(),T("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:this._dialogShown?"open":"close"}))}showLauncher(){let e=en();e.hidden=!1,this.requestUpdate(),T("ShopAssistant: called show launcher",{widgetId:this.widgetId,source:"programmatic-method"})}hideLauncher(){let e=en();e.hidden=!0,this.requestUpdate(),T("ShopAssistant: called hide launcher",{widgetId:this.widgetId,source:"programmatic-method"})}injectConfig(e){this.#r=e,this.requestUpdate()}reset(){this.xUserData={},this.xCustomInstructions="",this.#l?.reset(),this.requestUpdate()}async#y(e){let r=this.#l;if(!r){console.warn("Chat element not found, cannot send message");return}r.sendMessage?await r.sendMessage(e):console.warn("Chat element does not have sendMessage method")}#g(e){let r=this.#l;if(!r){console.warn("Chat element not found, cannot set input value");return}r.setInputValue?r.setInputValue(e):console.warn("Chat element does not have setInputValue method")}#u(e){U.widgetState={isOpen:e}}};customElements.get("molin-shop-ai")||customElements.define("molin-shop-ai",me);export{me as MolinShopAI};
3008
+ `}get isPopupEnabled(){return Yn()?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){this._dialogShown&&this.#c?.hide(),this._dialogShown&&setTimeout(()=>{this.#l?.focusInput()},0)}firstUpdated(){Yn()&&R.widgetState?.isOpen&&!this._dialogShown&&(this._dialogShown=!0,this.#n=!0,this.requestUpdate())}get#c(){return this.renderRoot.querySelector("mw-popup")}get#l(){return this.renderRoot.querySelector("mw-chat")}get#h(){return this.renderRoot.querySelector("mw-context-widget")}#m(){this._dialogShown=!0,this.#n=!0,this.requestUpdate(),this.#u(!0),L("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:this._dialogShown?"open":"close"})}#v(){this._dialogShown=!this._dialogShown,this.#n=!0,this.requestUpdate(),this.#u(this._dialogShown),this.#c?.hide(),L("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:this._dialogShown?"open":"close"})}#b(){this._dialogShown=!1,this._floatingInputVisible=!0,this.requestUpdate(),this.#u(!1),L("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:this._dialogShown?"open":"close"})}#x=e=>{let r=e.detail.text,i=this.#h;i&&typeof i.connect=="function"&&i.connect(),this._dialogShown=!0,this.#n=!0,this.requestUpdate(),this.#u(!0),setTimeout(()=>{this.#g(r),this.#y(r).catch(console.warn)},100),L("ShopAssistant: user sent input",{widgetId:this.widgetId,text:r,example:!1,conversationId:this.#l?.conversationId||"",source:"ask-ai"})};#w=Ze({interval:200},({message:e,autoSend:r=!1}={})=>{if(!e)return;this.#g(e);let i=this.#l?.isLiveMode;i||this.reset(),r&&!i&&this.#y(e).catch(console.warn)});openChat(e){let{message:r,autoSend:i}=e||{};if(this._dialogShown){this.#w({message:r,autoSend:i});return}let n=this.#h;n&&typeof n.connect=="function"&&n.connect(),this._dialogShown=!0,this.#n=!0,this.requestUpdate(),this.#u(!0),this.#c?.hide(),setTimeout(()=>{this.#w({message:r,autoSend:i})},100),L("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:this._dialogShown?"open":"close"})}closeChat(){this._dialogShown&&(this._dialogShown=!1,this._floatingInputVisible=!0,this.requestUpdate(),this.#u(!1),this.#c?.hide(),L("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:this._dialogShown?"open":"close"}))}showLauncher(){let e=ii();e.hidden=!1,this.requestUpdate(),L("ShopAssistant: called show launcher",{widgetId:this.widgetId,source:"programmatic-method"})}hideLauncher(){let e=ii();e.hidden=!0,this.requestUpdate(),L("ShopAssistant: called hide launcher",{widgetId:this.widgetId,source:"programmatic-method"})}injectConfig(e){this.#r=e,this.requestUpdate()}reset(){this.xUserData={},this.xCustomInstructions="",this.#l?.reset(),this.requestUpdate()}async#y(e){let r=this.#l;if(!r){console.warn("Chat element not found, cannot send message");return}r.sendMessage?await r.sendMessage(e):console.warn("Chat element does not have sendMessage method")}#g(e){let r=this.#l;if(!r){console.warn("Chat element not found, cannot set input value");return}r.setInputValue?r.setInputValue(e):console.warn("Chat element does not have setInputValue method")}#u(e){R.widgetState={isOpen:e}}};customElements.get("molin-shop-ai")||customElements.define("molin-shop-ai",ye);export{ye as MolinShopAI};
2734
3009
  /*! Bundled license information:
2735
3010
 
2736
3011
  @lit/reactive-element/css-tag.js: