@molin.ai/shop-ai 0.9.76 → 0.9.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/molin-shop-ai.min.js +46 -46
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDescriptor;var Rl=Object.getOwnPropertyNames;var Ul=Object.getPrototypeOf,Ll=Object.prototype.hasOwnProperty;var Ke=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var jl=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Rl(e))!Ll.call(t,n)&&n!==r&&ws(t,n,{get:()=>e[n],enumerable:!(i=Pl(e,n))||i.enumerable});return t};var vi=(t,e,r)=>(r=t!=null?Ol(Ul(t)):{},jl(e||!t||!t.__esModule?ws(r,"default",{value:t,enumerable:!0}):r,t));var Ki=Ke(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.parseCookie=co;ce.parse=co;ce.stringifyCookie=Ec;ce.stringifySetCookie=Er;ce.serialize=Er;ce.parseSetCookie=Sc;ce.stringifySetCookie=Er;ce.serialize=Er;var ao=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,lo=/^[\u0021-\u003A\u003C-\u007E]*$/,wc=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,xc=/^[\u0020-\u003A\u003D-\u007E]*$/,kc=/^-?\d+$/,_c=Object.prototype.toString,Cc=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function co(t,e){let r=new Cc,i=t.length;if(i<2)return r;let n=e?.decode||uo,s=0;do{let o=Yi(t,s,i);if(o===-1)break;let a=Xi(t,s,i);if(o>a){s=t.lastIndexOf(";",o-1)+1;continue}let l=Ee(t,s,o);r[l]===void 0&&(r[l]=n(Ee(t,o+1,a))),s=a+1}while(s<i);return r}function Ec(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(!ao.test(n))throw new TypeError(`cookie name is invalid: ${n}`);let o=r(s);if(!lo.test(o))throw new TypeError(`cookie val is invalid: ${s}`);i.push(`${n}=${o}`)}return i.join("; ")}function Er(t,e,r){let i=typeof t=="object"?t:{...r,name:t,value:String(e)},s=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!ao.test(i.name))throw new TypeError(`argument name is invalid: ${i.name}`);let o=i.value?s(i.value):"";if(!lo.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(!wc.test(i.domain))throw new TypeError(`option domain is invalid: ${i.domain}`);a+="; Domain="+i.domain}if(i.path){if(!xc.test(i.path))throw new TypeError(`option path is invalid: ${i.path}`);a+="; Path="+i.path}if(i.expires){if(!$c(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 Sc(t,e){let r=e?.decode||uo,i=t.length,n=Xi(t,0,i),s=Yi(t,0,n),o=s===-1?{name:"",value:r(Ee(t,0,n))}:{name:Ee(t,0,s),value:r(Ee(t,s+1,n))},a=n+1;for(;a<i;){let l=Xi(t,a,i),c=Yi(t,a,l),d=c===-1?Ee(t,a,l):Ee(t,a,c),p=c===-1?void 0:Ee(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=p;break;case"path":o.path=p;break;case"max-age":p&&kc.test(p)&&(o.maxAge=Number(p));break;case"expires":if(!p)break;let h=new Date(p);Number.isFinite(h.valueOf())&&(o.expires=h);break;case"priority":if(!p)break;let m=p.toLowerCase();(m==="low"||m==="medium"||m==="high")&&(o.priority=m);break;case"samesite":if(!p)break;let f=p.toLowerCase();(f==="lax"||f==="strict"||f==="none")&&(o.sameSite=f);break}a=l+1}return o}function Xi(t,e,r){let i=t.indexOf(";",e);return i===-1?r:i}function Yi(t,e,r){let i=t.indexOf("=",e);return i<r?i:-1}function Ee(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 uo(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function $c(t){return _c.call(t)==="[object Date]"}});var ha=Ke(Ne=>{"use strict";var bu=Ne&&Ne.__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(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},vu=Ne&&Ne.__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(Ne,"__esModule",{value:!0});Ne.base64ToBlob=wu;function wu(t){return bu(this,void 0,void 0,function(){var e,r,i;return vu(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=ku(t),i&&(r=r.slice(0,r.size,i)),[2,r]}})})}var xu=/^data:(.+);base64,/;function ku(t){var e;return(e=t.match(xu))===null||e===void 0?void 0:e.slice(1,2).pop()}});var fa=Ke(ze=>{"use strict";var _u=ze&&ze.__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(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},Cu=ze&&ze.__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(ze,"__esModule",{value:!0});ze.base64ToFile=Eu;function Eu(t,e,r){return _u(this,void 0,void 0,function(){var i,n;return Cu(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 Sn=Ke(We=>{"use strict";var Cn=We&&We.__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(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},En=We&&We.__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(We,"__esModule",{value:!0});We.blobToBase64=Su;function Su(t){return Cn(this,void 0,void 0,function(){return En(this,function(e){return[2,typeof FileReader=="function"?$u(t):Au(t)]})})}var ut;(function(t){t.error="error",t.loadend="loadend"})(ut||(ut={}));function $u(t){return Cn(this,void 0,void 0,function(){return En(this,function(e){return[2,new Promise(function(r,i){try{var n=new FileReader,s=function(){r(n.result),n.removeEventListener(ut.loadend,s)};n.addEventListener(ut.loadend,s);var o=function(){i(n.error),n.removeEventListener(ut.error,o)};n.addEventListener(ut.error,o),n.readAsDataURL(t)}catch(a){i(a)}})]})})}var Iu="application/octet-stream";function Au(t){return Cn(this,void 0,void 0,function(){var e,r,i,n;return En(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||Iu,[2,"data:".concat(n,";base64,").concat(e.toString("base64"))]}})})}});var ma=Ke(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.fileToBase64=void 0;var Tu=Sn();Object.defineProperty(qr,"fileToBase64",{enumerable:!0,get:function(){return Tu.blobToBase64}})});var ga=Ke(de=>{"use strict";var Mu=de&&de.__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]})),Br=de&&de.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Mu(e,t,r)};Object.defineProperty(de,"__esModule",{value:!0});Br(ha(),de);Br(fa(),de);Br(Sn(),de);Br(ma(),de)});var nr=globalThis,sr=nr.ShadowRoot&&(nr.ShadyCSS===void 0||nr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,wi=Symbol(),xs=new WeakMap,Ct=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==wi)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(sr&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=xs.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&xs.set(r,e))}return e}toString(){return this.cssText}},ks=t=>new Ct(typeof t=="string"?t:t+"",void 0,wi),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 Ct(r,t,wi)},_s=(t,e)=>{if(sr)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),n=nr.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},xi=sr?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return ks(r)})(t):t;var{is:Fl,defineProperty:ql,getOwnPropertyDescriptor:Bl,getOwnPropertyNames:Nl,getOwnPropertySymbols:zl,getPrototypeOf:Wl}=Object,or=globalThis,Cs=or.trustedTypes,Vl=Cs?Cs.emptyScript:"",Hl=or.reactiveElementPolyfillSupport,Et=(t,e)=>t,ki={toAttribute(t,e){switch(e){case Boolean:t=t?Vl: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}},Ss=(t,e)=>!Fl(t,e),Es={attribute:!0,type:String,converter:ki,reflect:!1,useDefault:!1,hasChanged:Ss};Symbol.metadata??=Symbol("metadata"),or.litPropertyMetadata??=new WeakMap;var ge=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 i=Symbol(),n=this.getPropertyDescriptor(e,i,r);n!==void 0&&ql(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){let{get:n,set:s}=Bl(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)??Es}static _$Ei(){if(this.hasOwnProperty(Et("elementProperties")))return;let e=Wl(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Et("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Et("properties"))){let r=this.properties,i=[...Nl(r),...zl(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(xi(n))}else e!==void 0&&r.push(xi(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 _s(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:ki).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:ki;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,n=!1,s){if(e!==void 0){let o=this.constructor;if(n===!1&&(s=this[e]),i??=o.getPropertyOptions(e),!((i.hasChanged??Ss)(s,r)||i.useDefault&&i.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(o._$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){}};ge.elementStyles=[],ge.shadowRootOptions={mode:"open"},ge[Et("elementProperties")]=new Map,ge[Et("finalized")]=new Map,Hl?.({ReactiveElement:ge}),(or.reactiveElementVersions??=[]).push("2.1.2");var Ci=globalThis,$s=t=>t,ar=Ci.trustedTypes,Is=ar?ar.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ei="$lit$",ye=`lit$${Math.random().toFixed(9).slice(2)}$`,Si="?"+ye,Gl=`<${Si}>`,Ue=document,$t=()=>Ue.createComment(""),It=t=>t===null||typeof t!="object"&&typeof t!="function",$i=Array.isArray,Ps=t=>$i(t)||typeof t?.[Symbol.iterator]=="function",_i=`[
|
|
2
|
-
\f\r]`,St=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ms=/'/g,Ds=/"/g,Rs=/^(?:script|style|textarea|title)$/i,Ii=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),u=Ii(1),Vd=Ii(2),Hd=Ii(3),se=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),Os=new WeakMap,Re=Ue.createTreeWalker(Ue,129);function Us(t,e){if(!$i(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Is!==void 0?Is.createHTML(e):e}var Ls=(t,e)=>{let r=t.length-1,i=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=St;for(let a=0;a<r;a++){let l=t[a],c,d,p=-1,h=0;for(;h<l.length&&(o.lastIndex=h,d=o.exec(l),d!==null);)h=o.lastIndex,o===St?d[1]==="!--"?o=As:d[1]!==void 0?o=Ts:d[2]!==void 0?(Rs.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Pe):d[3]!==void 0&&(o=Pe):o===Pe?d[0]===">"?(o=n??St,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?Pe:d[3]==='"'?Ds:Ms):o===Ds||o===Ms?o=Pe:o===As||o===Ts?o=St:(o=Pe,n=void 0);let m=o===Pe&&t[a+1].startsWith("/>")?" ":"";s+=o===St?l+Gl:p>=0?(i.push(c),l.slice(0,p)+Ei+l.slice(p)+ye+m):l+ye+(p===-2?a:m)}return[Us(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},At=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]=Ls(e,r);if(this.el=t.createElement(c,i),Re.currentNode=this.el.content,r===2||r===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=Re.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let p of n.getAttributeNames())if(p.endsWith(Ei)){let h=d[o++],m=n.getAttribute(p).split(ye),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:s,name:f[2],strings:m,ctor:f[1]==="."?cr:f[1]==="?"?ur:f[1]==="@"?dr:je}),n.removeAttribute(p)}else p.startsWith(ye)&&(l.push({type:6,index:s}),n.removeAttribute(p));if(Rs.test(n.tagName)){let p=n.textContent.split(ye),h=p.length-1;if(h>0){n.textContent=ar?ar.emptyScript:"";for(let m=0;m<h;m++)n.append(p[m],$t()),Re.nextNode(),l.push({type:2,index:++s});n.append(p[h],$t())}}}else if(n.nodeType===8)if(n.data===Si)l.push({type:2,index:s});else{let p=-1;for(;(p=n.data.indexOf(ye,p+1))!==-1;)l.push({type:7,index:s}),p+=ye.length-1}s++}}static createElement(e,r){let i=Ue.createElement("template");return i.innerHTML=e,i}};function Le(t,e,r=t,i){if(e===se)return e;let n=i!==void 0?r._$Co?.[i]:r._$Cl,s=It(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=Le(t,n._$AS(t,e.values),n,i)),e}var lr=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??Ue).importNode(r,!0);Re.currentNode=n;let s=Re.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new Qe(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new pr(s,this,e)),this._$AV.push(c),l=i[++a]}o!==l?.index&&(s=Re.nextNode(),o++)}return Re.currentNode=Ue,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++}},Qe=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,i,n){this.type=2,this._$AH=R,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=Le(this,e,r),It(e)?e===R||e==null||e===""?(this._$AH!==R&&this._$AR(),this._$AH=R):e!==this._$AH&&e!==se&&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!==R&&It(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ue.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=At.createElement(Us(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(r);else{let s=new lr(n,this),o=s.u(this.options);s.p(r),this.T(o),this._$AH=s}}_$AC(e){let r=Os.get(e.strings);return r===void 0&&Os.set(e.strings,r=new At(e)),r}k(e){$i(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($t()),this.O($t()),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=$s(e).nextSibling;$s(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},je=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,i,n,s){this.type=1,this._$AH=R,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=R}_$AI(e,r=this,i,n){let s=this.strings,o=!1;if(s===void 0)e=Le(this,e,r,0),o=!It(e)||e!==this._$AH&&e!==se,o&&(this._$AH=e);else{let a=e,l,c;for(e=s[0],l=0;l<s.length-1;l++)c=Le(this,a[i+l],r,l),c===se&&(c=this._$AH[l]),o||=!It(c)||c!==this._$AH[l],c===R?e=R:e!==R&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!n&&this.j(e)}j(e){e===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},cr=class extends je{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===R?void 0:e}},ur=class extends je{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==R)}},dr=class extends je{constructor(e,r,i,n,s){super(e,r,i,n,s),this.type=5}_$AI(e,r=this){if((e=Le(this,e,r,0)??R)===se)return;let i=this._$AH,n=e===R&&i!==R||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==R&&(i===R||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)}},pr=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){Le(this,e)}},js={M:Ei,P:ye,A:Si,C:1,L:Ls,R:lr,D:Ps,V:Le,I:Qe,H:je,N:ur,U:dr,B:cr,F:pr},Jl=Ci.litHtmlPolyfillSupport;Jl?.(At,Qe),(Ci.litHtmlVersions??=[]).push("3.3.2");var Fs=(t,e,r)=>{let i=r?.renderBefore??e,n=i._$litPart$;if(n===void 0){let s=r?.renderBefore??null;i._$litPart$=n=new Qe(e.insertBefore($t(),s),s,void 0,r??{})}return n._$AI(t),n};var Ai=globalThis,v=class extends ge{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=Fs(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return se}};v._$litElement$=!0,v.finalized=!0,Ai.litElementHydrateSupport?.({LitElement:v});var Xl=Ai.litElementPolyfillSupport;Xl?.({LitElement:v});(Ai.litElementVersions??=[]).push("4.2.2");var hr=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}};async function Ti(t){await new Promise(e=>setTimeout(e,t))}async function fr({times:t=3,backoff:e=0},r){let i=n=>{throw{_bailed:n}};for(let n=0;n<t;n++)try{return await r(i,n)}catch(s){if(s&&typeof s=="object"&&"_bailed"in s)throw s._bailed;if(n===t-1)throw s;if(typeof e=="number")await Ti(e);else if(typeof e=="function")await Ti(e(n+1));else throw new TypeError("Invalid backoff option")}throw new Error("unreachable")}var Yl=!0,Mi="Invariant failed";function M(t,e){if(!t){if(Yl)throw new Error(Mi);var r=typeof e=="function"?e():e,i=r?"".concat(Mi,": ").concat(r):Mi;throw new Error(i)}}function Di(t,e,r){return t.slice(0,r)+e}function Kl({content:t,parts:e,appendMessage:r}){let i=[...e],n=t,s=r.part??0;switch(r.content_type){case"text":{let{delta:o,position:a}=r;n=Di(n,o,a);let l=i[s]&&"text"in i[s]?i[s].text:"";i[s]={text:l?Di(l,o,a):o};break}case"html":{let{delta:o,position:a}=r,l=i[s]&&"html"in i[s]?i[s].html:"";i[s]={html:l?Di(l,o,a):o};break}case"data":{let o=i[s]&&"data"in i[s]?i[s].data:{};i[s]={tag:r.tag,data:Object.assign({},o,r.data)};break}}return{content:n,parts:i}}var mr=class{messages=Object.freeze([]);onEvent(e){switch(e.type){case"NEW_MESSAGE":{let r={...e.message,streaming:!0,parts:e.message.parts};return this.messages=Object.freeze([...this.messages.filter(i=>i.id!==r.id),r]),r}case"APPEND_MESSAGE":{let i=this.messages.find(s=>s.id===e.message.id)??(()=>{let s={id:e.message.id,timestamp:Date.now(),role:"assistant",content:"",streaming:!0,parts:[]};return this.messages=Object.freeze([...this.messages,s]),s})(),n=Kl({content:i.content,parts:i.parts||[],appendMessage:e.message});return i.content=n.content,i.parts=n.parts,e.metadata&&(i.metadata=e.metadata),i}case"MESSAGE_DONE":{let r=this.messages.find(i=>i.id===e.message.id);return r?(Object.assign(r,e.message),r.streaming=!1,r):void 0}default:return}}onEvents(e){for(let r of e)this.onEvent(r)}getMessage(e){return this.messages.find(r=>r.id===e)}get lastMessage(){return this.messages.at(-1)}reset(){this.messages=Object.freeze([])}};var gr=class{#e;#t;#r=null;#i=new mr;isStreaming=!1;typingIndicator;toolCallIndicator;ranOutOfCredits=!1;get messages(){return this.#i.messages}set messages(e){this.#i.messages=e}conversationId="";#n=0;#s;isLiveMode=!1;get hasQueuedMessages(){return this.#a.length>0}constructor(e,r){this.#e=e,this.#t=r,this.#t.autoConnect!==!1&&(this.#r=this.initWS()),e.addController(this)}#a=[];#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.#a.length>0){let i=this.#a[this.#a.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.#a.push({message:e,options:{expectStreaming:r}}),this.#e.requestUpdate(),this.#r&&!this.#r.isConnecting&&!this.#r.isConnected&&this.retry(),await fr({times:5,backoff:2e3},async()=>{if(this.#r?.isConnected){let i=[...this.#a];this.#a=[],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.#a=[],this.#e.requestUpdate(),!1)))}async sendUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i},{expectStreaming:s})}async sendUserFeedback(e){return this.enqueueMessage({type:"USER_FEEDBACK",responses:e},{expectStreaming:!0})}sendFileDelete(e){M(e,"fileId is required"),this.enqueueMessage({type:"USER_FILE_DELETE",fileId: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.#s),this.#s=setTimeout(()=>{this.#t.onReconnect?.(),this.#r=this.initWS()},1e3*this.#n),this.#n++}initWS(){return new hr(this.#e,{url:()=>this.#t.url(this.conversationId,{}),onOpen:e=>this.#l(e),onMessage:e=>this.#c(JSON.parse(e.data)),onError:e=>this.#u(e),onClose:e=>this.#d(e)})}#l(e){this.#n=0}#c(e){switch(e.type){case"NEW_MESSAGE":{this.#i.onEvent(e),this.typingIndicator=void 0,this.toolCallIndicator=void 0,this.#t.onNewMessage?.(e.message),this.#t.persistConversationState?.(this.conversationId,this.messages),this.#e.requestUpdate();break}case"APPEND_MESSAGE":{let r=!this.#i.getMessage(e.message.id),i=this.#i.onEvent(e);i&&(this.typingIndicator=void 0,this.toolCallIndicator=void 0,r&&(this.#t.onNewMessage?.({id:i.id,timestamp:i.timestamp,role:i.role,content:i.content}),this.#t.persistConversationState?.(this.conversationId,this.messages)),this.#t.onMessageAppend?.(e),this.#e.requestUpdate());break}case"MESSAGE_DONE":{let r=this.#i.onEvent(e);if(!r)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.#i.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.toolCallIndicator=void 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"TOOL_CALL_START":{this.typingIndicator=void 0,this.toolCallIndicator=e.text,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)}`)}}#u(e){console.error("onError",e),this.#t.onError?.(e)}#d(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.#i.messages=this.#t.restoreConversationState?.()?.messages||[]}reset(){this.#t.onReset?.(),this.#i.reset(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.conversationId="",this.isLiveMode=!1,this.#a=[],this.#e.requestUpdate()}hostDisconnected(){clearTimeout(this.#s)}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 Oi;function Bs(t){return{lang:t?.lang??Oi?.lang,message:t?.message,abortEarly:t?.abortEarly??Oi?.abortEarly,abortPipeEarly:t?.abortPipeEarly??Oi?.abortPipeEarly}}var Ql;function Zl(t){return Ql?.get(t)}var ec;function tc(t){return ec?.get(t)}var rc;function ic(t,e){return rc?.get(t)?.get(e)}function Ns(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??Ns(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??ic(t.reference,l.lang)??(c?tc(l.lang):null)??i.message??Zl(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 J(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},Bs())}}}function nc(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"}var sc=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z|[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u;function Pi(t){return{kind:"validation",type:"iso_timestamp",reference:Pi,async:!1,expects:null,requirement:sc,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&G(this,"timestamp",e,r),e}}}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 Ui(t,e){return{kind:"validation",type:"min_length",reference:Ui,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 Li(t){return{kind:"transformation",type:"to_date",reference:Li,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 ji(t){return{kind:"transformation",type:"transform",reference:ji,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 Q(t,e){return{...t,fallback:e,get"~standard"(){return J(this)},"~run"(r,i){let n=t["~run"](r,i);return n.issues?{typed:!0,value:Ws(this,n,i)}:n}}}function Fi(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function Tt(){return{kind:"schema",type:"any",reference:Tt,expects:"any",async:!1,get"~standard"(){return J(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 J(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 qi(t){return{kind:"schema",type:"boolean",reference:qi,expects:"boolean",async:!1,message:t,get"~standard"(){return J(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:G(this,"type",e,r),e}}}function Bi(t){return{kind:"schema",type:"null",reference:Bi,expects:"null",async:!1,message:t,get"~standard"(){return J(this)},"~run"(e,r){return e.value===null?e.typed=!0:G(this,"type",e,r),e}}}function yr(t,e){return{kind:"schema",type:"nullish",reference:yr,expects:`(${t.expects} | null | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return J(this)},"~run"(r,i){return(r.value===null||r.value===void 0)&&(this.default!==void 0&&(r.value=Fi(this,r,i)),r.value===null||r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function br(t){return{kind:"schema",type:"number",reference:br,expects:"number",async:!1,message:t,get"~standard"(){return J(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:G(this,"type",e,r),e}}}function N(t,e){return{kind:"schema",type:"object",reference:N,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return J(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]:Fi(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 J(this)},"~run"(r,i){return r.value===void 0&&(this.default!==void 0&&(r.value=Fi(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(Ns),"|"),async:!1,options:t,message:e,get"~standard"(){return J(this)},"~run"(r,i){return this.options.includes(r.value)?r.typed=!0:G(this,"type",r,i),r}}}function Dt(t,e,r){return{kind:"schema",type:"record",reference:Dt,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return J(this)},"~run"(i,n){let s=i.value;if(s&&typeof s=="object"){i.typed=!0,i.value={};for(let o in s)if(nc(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 p of l.issues)p.path=[d],i.issues?.push(p);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 p of c.issues)p.path?p.path.unshift(d):p.path=[d],i.issues?.push(p);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 C(t){return{kind:"schema",type:"string",reference:C,expects:"string",async:!1,message:t,get"~standard"(){return J(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:G(this,"type",e,r),e}}}function qs(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function vr(t,e){return{kind:"schema",type:"union",reference:vr,expects:zs(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return J(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:qs(s)}),r.typed=!0}else{if(o?.length===1)return o[0];G(this,"type",r,i,{issues:qs(o)})}return r}}}function Vs(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 J(this)}}}function et(...t){return{...t[0],pipe:t,get"~standard"(){return J(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 oe(t,e,r){let i=t["~run"]({value:e},Bs(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var wr=Vs(N({url:C(),name:C(),description:C(),price:C()}));function Hs(t){return t.flatMap(e=>{if(!("tag"in e))return[];switch(e.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let r=oe(wr,e.data);if(r.success)return[{name:r.output.name??"",price:r.output.price??"0"}];break}case"thought":case"order-status-card-v1":case"order-card-v2":case"live-chat-wait-card-v1":case"live-chat-wait-card-v2":case"request-input-v1":break}return[]})}var oc=Symbol();var Gs=Object.getPrototypeOf,Ni=new WeakMap,ac=t=>t&&(Ni.has(t)?Ni.get(t):Gs(t)===Object.prototype||Gs(t)===Array.prototype);var Js=t=>ac(t)&&t[oc]||null,zi=(t,e=!0)=>{Ni.set(t,e)};var Vi=t=>typeof t=="object"&&t!==null,lc=t=>Vi(t)&&!Hi.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),Ks=(t,e)=>{let r=Xs.get(t);if(r?.[0]===e)return r[1];let i=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return zi(i,!0),Xs.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(Hi.has(s))zi(s,!1);else if(Fe.has(s)){let[l,c]=Fe.get(s);a.value=Ks(l,c())}Object.defineProperty(i,n,a)}),Object.preventExtensions(i)},cc=(t,e,r,i)=>({deleteProperty(n,s){let o=Reflect.get(n,s);r(s);let a=Reflect.deleteProperty(n,s);return a&&i(xr?.("delete",s,o)),a},set(n,s,o,a){let l=!t()&&Reflect.has(n,s),c=Reflect.get(n,s,a);if(l&&(Ys(c,o)||kr.has(o)&&Ys(c,kr.get(o))))return!0;r(s),Vi(o)&&(o=Js(o)||o);let d=!Fe.has(o)&&dc(o)?Gi(o):o;return e(s,d),Reflect.set(n,s,d,a),i(xr?.("set",s,o,c)),!0}});var Fe=new WeakMap,Hi=new WeakSet,Xs=new WeakMap,Wi=[1],kr=new WeakMap,Ys=Object.is,uc=(t,e)=>new Proxy(t,e),dc=lc,pc=Ks,hc=cc,xr;function Gi(t={}){if(!Vi(t))throw new Error("object required");let e=kr.get(t);if(e)return e;let r=Wi[0],i=new Set,n=(x,S=++Wi[0])=>{r!==S&&(s=r=S,i.forEach(b=>b(x,S)))},s=r,o=(x=Wi[0])=>(s!==x&&(s=x,l.forEach(([S])=>{let b=S[1](x);b>r&&(r=b)})),r),a=x=>(S,b)=>{let k;S&&(k=[...S],k[1]=[x,...k[1]]),n(k,b)},l=new Map,c=(x,S)=>{let b=!Hi.has(S)&&Fe.get(S);if(b){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(x))throw new Error("prop listener already exists");if(i.size){let k=b[2](a(x));l.set(x,[b,k])}else l.set(x,[b])}},d=x=>{var S;let b=l.get(x);b&&(l.delete(x),(S=b[1])==null||S.call(b))},p=x=>(i.add(x),i.size===1&&l.forEach(([b,k],$)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&k)throw new Error("remove already exists");let P=b[2](a($));l.set($,[b,P])}),()=>{i.delete(x),i.size===0&&l.forEach(([b,k],$)=>{k&&(k(),l.set($,[b]))})}),h=!0,m=hc(()=>h,c,d,n),f=uc(t,m);kr.set(t,f);let E=[t,o,p];return Fe.set(f,E),Reflect.ownKeys(t).forEach(x=>{let S=Object.getOwnPropertyDescriptor(t,x);"value"in S&&S.writable&&(f[x]=t[x])}),h=!1,f}function _r(t,e,r){let i=Fe.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(d&&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 tt(t){let e=Fe.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[r,i]=e;return pc(r,i())}var rt=class{#e;#t;#r;#i=()=>{};constructor(e,r){this.#e=e,this.#t=r,this.#r=tt(r),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#i(),this.#i=_r(this.#t,()=>{this.#r=tt(this.#t),this.#e.requestUpdate()})}hostDisconnected(){this.#i()}};var Ce=class{#e;#t;proxyObject;#r;#i=()=>{};constructor(e,r,i){this.#e=e,this.#t=i,this.proxyObject=Gi(r),this.#r=tt(this.proxyObject),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#i(),this.#t?.subscribe&&(this.#i=_r(this.proxyObject,()=>{this.#r=tt(this.proxyObject),this.#e.requestUpdate()}))}hostDisconnected(){this.#i()}};var Cr=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=fc(this.#e,this.#t),!this.#i))return;let e=this.#i[this.#r]instanceof Ce?this.#i[this.#r]:null;e&&(this.#n=new rt(this.#e,e.proxyObject))}hostDisconnected(){}};function fc(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 Ji(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 Qs=()=>{if(window.Shopify)try{return{customerId:mc()}}catch{return null}return null},mc=()=>{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},Zs=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 eo(t){if(t instanceof URLSearchParams)return new URLSearchParams(t);let e=new URLSearchParams;for(let[r,i]of Object.entries(t))i!=null&&e.set(r,String(i));return e}function to(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function it(t){let e="[-a-z\\d%_.~!$&'()*+,;=:@]",r="[-a-z\\d%_.~!$&'()*+,;=:@/?]";return new RegExp(`^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/${e}*)*(\\?${r}*)?(\\#${r}*)?$`,"i").test(t)}function ro(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 io=()=>{if(window.ShopRenter)try{let t=yc();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},yc=()=>{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}}},no=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=to(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 so=()=>{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},oo=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 Ot=vi(Ki(),1);var Sr=class{#e;constructor({document:e}){this.#e=e}getCookies(){return(0,Ot.parseCookie)(this.#e.cookie)||{}}getCookie(e){return this.getCookies()[e]||null}setCookie(e,r,i){if(M(typeof e=="string",`cookie name must be a string, got: ${typeof e}`),M(e,"cookie name must not be empty"),r==null){this.#e.cookie=(0,Ot.stringifySetCookie)(e,"",{expires:new Date(0)});return}M(typeof r=="string",`value of cookie \`${e}\` must be a string, got: ${typeof r}`),this.#e.cookie=(0,Ot.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 $r=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 Pt=vi(Ki(),1);function Qi({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,Pt.stringifySetCookie)(n,"1",{domain:o,path:"/"}),(0,Pt.parseCookie)(r.cookie)[n]==="1")return r.cookie=(0,Pt.stringifySetCookie)(n,"",{domain:o,path:"/",expires:new Date(0)}),o}catch{continue}}return`.${i.slice(-2).join(".")}`}var Zi=class{#e;#t;#r;#i;constructor({window:e}){this.#e=e,this.#t=new Sr({document:e.document}),this.#r=new $r({localStorage:e.localStorage}),this.#i=e.localStorage}get distinctID(){return this.#t.getCookie("molin_distinct_id")||this.#i.getItem("molin_distinct_id")}set distinctID(e){if(!e){this.#t.deleteCookie("molin_distinct_id"),this.#i.removeItem("molin_distinct_id");return}M(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:Qi({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")}set widgetState(e){this.#r.setItem("molin_widget",e)}get popupState(){return this.#r.getItem("molin_popup")}set popupState(e){this.#r.setItem("molin_popup",e)}get disclaimerDismissed(){return this.#r.getItem("molin_disclaimer_dismissed")??!1}set disclaimerDismissed(e){this.#r.setItem("molin_disclaimer_dismissed",e)}getConversationId(e){M(typeof e=="string","widgetId must be a string"),M(e,"widgetId must not be empty");let r=`molin_${e}_conversation_id`;return this.#t.getCookie(r)||this.#i.getItem(r)}setConversationId(e,r){M(typeof e=="string","widgetId must be a string"),M(e,"widgetId must not be empty");let i=`molin_${e}_conversation_id`;if(!r){this.#t.deleteCookie(i),this.#i.removeItem(i);return}M(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:Qi({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){M(typeof e=="string","widgetId must be a string"),M(e,"widgetId must not be empty");let r=`molin_${e}_conversation`;return this.#r.getItem(r)}setConversationState(e,r){M(typeof e=="string","widgetId must be a string"),M(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_"))}},po;function L(){return po??=new Zi({window}),po}var ho=Dt(C(),vr([C(),br(),qi(),Bi()])),fo=et(C(),Ui(1),Ri(5e3)),mo=()=>{try{return window.UNAS?so():window.Shopify?Qs():window.ShopRenter?io():null}catch{return null}},go=async()=>{try{return window.UNAS?await oo():window.Shopify?await Zs():window.ShopRenter?await no():[]}catch{return[]}},nt={schema:N({conversationId:A(C()),messages:A(Ze(N({id:C(),timestamp:br(),role:Mt(["user","assistant","support"]),content:C(),parts:A(Ze(vr([N({text:C()}),N({html:C()}),N({tag:C(),data:Dt(C(),Tt())})])))})))}),persist(t,e,r){L().setConversationState(t,{conversationId:e,messages:r}),L().setConversationId(t,e)},restore(t){try{let e=L().getConversationState(t),r=e?oe(this.schema,e):void 0;return r?.success&&r.output.conversationId?{conversationId:r.output.conversationId,messages:r.output.messages||[]}:{conversationId:L().getConversationId(t)||"",messages:[]}}catch(e){return console.error("Failed to restore conversation state:",e),{conversationId:"",messages:[]}}},reset(t){L().setConversationState(t,null),L().setConversationId(t,null)}};var st=class t extends v{static properties={widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object}};contextCtrl;constructor(){super(),this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.contextCtrl=new Ce(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,toolCallIndicator: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),sendUserFeedback:this.sendUserFeedback.bind(this),sendFileDelete:this.#n.sendFileDelete.bind(this.#n)})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){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,toolCallIndicator:this.#n.toolCallIndicator,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),sendUserFeedback:this.sendUserFeedback.bind(this),sendFileDelete:this.#n.sendFileDelete.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 gr(this,{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)=>{if(r.role==="assistant"){let i=Hs(r.parts??[]);this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:r.content??"",message:r,conversationId:this.#n.conversationId,products:i})}},onMessageError:e=>{console.error("ws message error",e),e.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+e.message})},onReset:()=>{nt.reset(this.widgetId)},onConnect:(e,r)=>{let i=mo();this.#n.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),go().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)=>{nt.persist(this.widgetId,e,r)},restoreConversationState:()=>nt.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=oe(ho,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=oe(fo,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=Ji(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)}async sendUserFeedback(e){return this.#n.sendUserFeedback(e)}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()}render(){return u`<slot></slot>`}};function yo(t){let e=new Cr(t,{provider:st,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,i){if(i==="value")return e.value}})}st.ConnectedEvent=class extends CustomEvent{static type="mw-context-widget:connected";constructor(e,r={}){super(st.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-context-widget")||customElements.define("mw-context-widget",st);var Ic=Object.freeze({"lucide:arrow-up":u`
|
|
1
|
+
var Fl=Object.create;var _s=Object.defineProperty;var ql=Object.getOwnPropertyDescriptor;var Bl=Object.getOwnPropertyNames;var Nl=Object.getPrototypeOf,zl=Object.prototype.hasOwnProperty;var Ye=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Wl=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Bl(e))!zl.call(t,n)&&n!==r&&_s(t,n,{get:()=>e[n],enumerable:!(i=ql(e,n))||i.enumerable});return t};var vi=(t,e,r)=>(r=t!=null?Fl(Nl(t)):{},Wl(e||!t||!t.__esModule?_s(r,"default",{value:t,enumerable:!0}):r,t));var Yi=Ye(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.parseCookie=ho;ce.parse=ho;ce.stringifyCookie=Mc;ce.stringifySetCookie=Er;ce.serialize=Er;ce.parseSetCookie=Dc;ce.stringifySetCookie=Er;ce.serialize=Er;var uo=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,po=/^[\u0021-\u003A\u003C-\u007E]*$/,Sc=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,$c=/^[\u0020-\u003A\u003D-\u007E]*$/,Ic=/^-?\d+$/,Ac=Object.prototype.toString,Tc=(()=>{let t=function(){};return t.prototype=Object.create(null),t})();function ho(t,e){let r=new Tc,i=t.length;if(i<2)return r;let n=e?.decode||fo,s=0;do{let o=Ki(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=Ee(t,s,o);r[l]===void 0&&(r[l]=n(Ee(t,o+1,a))),s=a+1}while(s<i);return r}function Mc(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(!uo.test(n))throw new TypeError(`cookie name is invalid: ${n}`);let o=r(s);if(!po.test(o))throw new TypeError(`cookie val is invalid: ${s}`);i.push(`${n}=${o}`)}return i.join("; ")}function Er(t,e,r){let i=typeof t=="object"?t:{...r,name:t,value:String(e)},s=(typeof e=="object"?e:r)?.encode||encodeURIComponent;if(!uo.test(i.name))throw new TypeError(`argument name is invalid: ${i.name}`);let o=i.value?s(i.value):"";if(!po.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(!Sc.test(i.domain))throw new TypeError(`option domain is invalid: ${i.domain}`);a+="; Domain="+i.domain}if(i.path){if(!$c.test(i.path))throw new TypeError(`option path is invalid: ${i.path}`);a+="; Path="+i.path}if(i.expires){if(!Oc(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 Dc(t,e){let r=e?.decode||fo,i=t.length,n=Ji(t,0,i),s=Ki(t,0,n),o=s===-1?{name:"",value:r(Ee(t,0,n))}:{name:Ee(t,0,s),value:r(Ee(t,s+1,n))},a=n+1;for(;a<i;){let l=Ji(t,a,i),c=Ki(t,a,l),d=c===-1?Ee(t,a,l):Ee(t,a,c),p=c===-1?void 0:Ee(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=p;break;case"path":o.path=p;break;case"max-age":p&&Ic.test(p)&&(o.maxAge=Number(p));break;case"expires":if(!p)break;let h=new Date(p);Number.isFinite(h.valueOf())&&(o.expires=h);break;case"priority":if(!p)break;let m=p.toLowerCase();(m==="low"||m==="medium"||m==="high")&&(o.priority=m);break;case"samesite":if(!p)break;let f=p.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 Ki(t,e,r){let i=t.indexOf("=",e);return i<r?i:-1}function Ee(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 fo(t){if(t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function Oc(t){return Ac.call(t)==="[object Date]"}});var ga=Ye(Ne=>{"use strict";var Cu=Ne&&Ne.__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(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},Eu=Ne&&Ne.__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(Ne,"__esModule",{value:!0});Ne.base64ToBlob=Su;function Su(t){return Cu(this,void 0,void 0,function(){var e,r,i;return Eu(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=Iu(t),i&&(r=r.slice(0,r.size,i)),[2,r]}})})}var $u=/^data:(.+);base64,/;function Iu(t){var e;return(e=t.match($u))===null||e===void 0?void 0:e.slice(1,2).pop()}});var ya=Ye(ze=>{"use strict";var Au=ze&&ze.__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(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},Tu=ze&&ze.__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(ze,"__esModule",{value:!0});ze.base64ToFile=Mu;function Mu(t,e,r){return Au(this,void 0,void 0,function(){var i,n;return Tu(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 Sn=Ye(We=>{"use strict";var Cn=We&&We.__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(p){o(p)}}function l(d){try{c(i.throw(d))}catch(p){o(p)}}function c(d){d.done?s(d.value):n(d.value).then(a,l)}c((i=i.apply(t,e||[])).next())})},En=We&&We.__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(We,"__esModule",{value:!0});We.blobToBase64=Du;function Du(t){return Cn(this,void 0,void 0,function(){return En(this,function(e){return[2,typeof FileReader=="function"?Ou(t):Uu(t)]})})}var ut;(function(t){t.error="error",t.loadend="loadend"})(ut||(ut={}));function Ou(t){return Cn(this,void 0,void 0,function(){return En(this,function(e){return[2,new Promise(function(r,i){try{var n=new FileReader,s=function(){r(n.result),n.removeEventListener(ut.loadend,s)};n.addEventListener(ut.loadend,s);var o=function(){i(n.error),n.removeEventListener(ut.error,o)};n.addEventListener(ut.error,o),n.readAsDataURL(t)}catch(a){i(a)}})]})})}var Pu="application/octet-stream";function Uu(t){return Cn(this,void 0,void 0,function(){var e,r,i,n;return En(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||Pu,[2,"data:".concat(n,";base64,").concat(e.toString("base64"))]}})})}});var ba=Ye(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.fileToBase64=void 0;var Ru=Sn();Object.defineProperty(qr,"fileToBase64",{enumerable:!0,get:function(){return Ru.blobToBase64}})});var va=Ye(de=>{"use strict";var Lu=de&&de.__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]})),Br=de&&de.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Lu(e,t,r)};Object.defineProperty(de,"__esModule",{value:!0});Br(ga(),de);Br(ya(),de);Br(Sn(),de);Br(ba(),de)});var nr=globalThis,sr=nr.ShadowRoot&&(nr.ShadyCSS===void 0||nr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,wi=Symbol(),Cs=new WeakMap,Ct=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==wi)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(sr&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=Cs.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Cs.set(r,e))}return e}toString(){return this.cssText}},Es=t=>new Ct(typeof t=="string"?t:t+"",void 0,wi),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 Ct(r,t,wi)},Ss=(t,e)=>{if(sr)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),n=nr.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},xi=sr?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return Es(r)})(t):t;var{is:Vl,defineProperty:Hl,getOwnPropertyDescriptor:Gl,getOwnPropertyNames:Xl,getOwnPropertySymbols:Jl,getPrototypeOf:Kl}=Object,or=globalThis,$s=or.trustedTypes,Yl=$s?$s.emptyScript:"",Ql=or.reactiveElementPolyfillSupport,Et=(t,e)=>t,ki={toAttribute(t,e){switch(e){case Boolean:t=t?Yl: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}},As=(t,e)=>!Vl(t,e),Is={attribute:!0,type:String,converter:ki,reflect:!1,useDefault:!1,hasChanged:As};Symbol.metadata??=Symbol("metadata"),or.litPropertyMetadata??=new WeakMap;var ge=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=Is){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&&Hl(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){let{get:n,set:s}=Gl(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)??Is}static _$Ei(){if(this.hasOwnProperty(Et("elementProperties")))return;let e=Kl(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Et("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Et("properties"))){let r=this.properties,i=[...Xl(r),...Jl(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(xi(n))}else e!==void 0&&r.push(xi(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 Ss(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:ki).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:ki;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,n=!1,s){if(e!==void 0){let o=this.constructor;if(n===!1&&(s=this[e]),i??=o.getPropertyOptions(e),!((i.hasChanged??As)(s,r)||i.useDefault&&i.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(o._$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){}};ge.elementStyles=[],ge.shadowRootOptions={mode:"open"},ge[Et("elementProperties")]=new Map,ge[Et("finalized")]=new Map,Ql?.({ReactiveElement:ge}),(or.reactiveElementVersions??=[]).push("2.1.2");var Ci=globalThis,Ts=t=>t,ar=Ci.trustedTypes,Ms=ar?ar.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ei="$lit$",ye=`lit$${Math.random().toFixed(9).slice(2)}$`,Si="?"+ye,Zl=`<${Si}>`,Re=document,$t=()=>Re.createComment(""),It=t=>t===null||typeof t!="object"&&typeof t!="function",$i=Array.isArray,Ls=t=>$i(t)||typeof t?.[Symbol.iterator]=="function",_i=`[
|
|
2
|
+
\f\r]`,St=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ds=/-->/g,Os=/>/g,Pe=RegExp(`>|${_i}(?:([^\\s"'>=/]+)(${_i}*=${_i}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ps=/'/g,Us=/"/g,js=/^(?:script|style|textarea|title)$/i,Ii=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),u=Ii(1),Yd=Ii(2),Qd=Ii(3),se=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),Rs=new WeakMap,Ue=Re.createTreeWalker(Re,129);function Fs(t,e){if(!$i(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ms!==void 0?Ms.createHTML(e):e}var qs=(t,e)=>{let r=t.length-1,i=[],n,s=e===2?"<svg>":e===3?"<math>":"",o=St;for(let a=0;a<r;a++){let l=t[a],c,d,p=-1,h=0;for(;h<l.length&&(o.lastIndex=h,d=o.exec(l),d!==null);)h=o.lastIndex,o===St?d[1]==="!--"?o=Ds:d[1]!==void 0?o=Os:d[2]!==void 0?(js.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Pe):d[3]!==void 0&&(o=Pe):o===Pe?d[0]===">"?(o=n??St,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?Pe:d[3]==='"'?Us:Ps):o===Us||o===Ps?o=Pe:o===Ds||o===Os?o=St:(o=Pe,n=void 0);let m=o===Pe&&t[a+1].startsWith("/>")?" ":"";s+=o===St?l+Zl:p>=0?(i.push(c),l.slice(0,p)+Ei+l.slice(p)+ye+m):l+ye+(p===-2?a:m)}return[Fs(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]},At=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]=qs(e,r);if(this.el=t.createElement(c,i),Ue.currentNode=this.el.content,r===2||r===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(n=Ue.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let p of n.getAttributeNames())if(p.endsWith(Ei)){let h=d[o++],m=n.getAttribute(p).split(ye),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:s,name:f[2],strings:m,ctor:f[1]==="."?cr:f[1]==="?"?ur:f[1]==="@"?dr:je}),n.removeAttribute(p)}else p.startsWith(ye)&&(l.push({type:6,index:s}),n.removeAttribute(p));if(js.test(n.tagName)){let p=n.textContent.split(ye),h=p.length-1;if(h>0){n.textContent=ar?ar.emptyScript:"";for(let m=0;m<h;m++)n.append(p[m],$t()),Ue.nextNode(),l.push({type:2,index:++s});n.append(p[h],$t())}}}else if(n.nodeType===8)if(n.data===Si)l.push({type:2,index:s});else{let p=-1;for(;(p=n.data.indexOf(ye,p+1))!==-1;)l.push({type:7,index:s}),p+=ye.length-1}s++}}static createElement(e,r){let i=Re.createElement("template");return i.innerHTML=e,i}};function Le(t,e,r=t,i){if(e===se)return e;let n=i!==void 0?r._$Co?.[i]:r._$Cl,s=It(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=Le(t,n._$AS(t,e.values),n,i)),e}var lr=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??Re).importNode(r,!0);Ue.currentNode=n;let s=Ue.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new Qe(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new pr(s,this,e)),this._$AV.push(c),l=i[++a]}o!==l?.index&&(s=Ue.nextNode(),o++)}return Ue.currentNode=Re,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++}},Qe=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=Le(this,e,r),It(e)?e===U||e==null||e===""?(this._$AH!==U&&this._$AR(),this._$AH=U):e!==this._$AH&&e!==se&&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!==U&&It(this._$AH)?this._$AA.nextSibling.data=e:this.T(Re.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=At.createElement(Fs(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(r);else{let s=new lr(n,this),o=s.u(this.options);s.p(r),this.T(o),this._$AH=s}}_$AC(e){let r=Rs.get(e.strings);return r===void 0&&Rs.set(e.strings,r=new At(e)),r}k(e){$i(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($t()),this.O($t()),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=Ts(e).nextSibling;Ts(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},je=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=Le(this,e,r,0),o=!It(e)||e!==this._$AH&&e!==se,o&&(this._$AH=e);else{let a=e,l,c;for(e=s[0],l=0;l<s.length-1;l++)c=Le(this,a[i+l],r,l),c===se&&(c=this._$AH[l]),o||=!It(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??"")}},cr=class extends je{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===U?void 0:e}},ur=class extends je{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==U)}},dr=class extends je{constructor(e,r,i,n,s){super(e,r,i,n,s),this.type=5}_$AI(e,r=this){if((e=Le(this,e,r,0)??U)===se)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)}},pr=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){Le(this,e)}},Bs={M:Ei,P:ye,A:Si,C:1,L:qs,R:lr,D:Ls,V:Le,I:Qe,H:je,N:ur,U:dr,B:cr,F:pr},ec=Ci.litHtmlPolyfillSupport;ec?.(At,Qe),(Ci.litHtmlVersions??=[]).push("3.3.2");var Ns=(t,e,r)=>{let i=r?.renderBefore??e,n=i._$litPart$;if(n===void 0){let s=r?.renderBefore??null;i._$litPart$=n=new Qe(e.insertBefore($t(),s),s,void 0,r??{})}return n._$AI(t),n};var Ai=globalThis,v=class extends ge{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=Ns(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return se}};v._$litElement$=!0,v.finalized=!0,Ai.litElementHydrateSupport?.({LitElement:v});var tc=Ai.litElementPolyfillSupport;tc?.({LitElement:v});(Ai.litElementVersions??=[]).push("4.2.2");var hr=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}};async function Ti(t){await new Promise(e=>setTimeout(e,t))}async function fr({times:t=3,backoff:e=0},r){let i=n=>{throw{_bailed:n}};for(let n=0;n<t;n++)try{return await r(i,n)}catch(s){if(s&&typeof s=="object"&&"_bailed"in s)throw s._bailed;if(n===t-1)throw s;if(typeof e=="number")await Ti(e);else if(typeof e=="function")await Ti(e(n+1));else throw new TypeError("Invalid backoff option")}throw new Error("unreachable")}var rc=!0,Mi="Invariant failed";function M(t,e){if(!t){if(rc)throw new Error(Mi);var r=typeof e=="function"?e():e,i=r?"".concat(Mi,": ").concat(r):Mi;throw new Error(i)}}function Di(t,e,r){return t.slice(0,r)+e}function ic({content:t,parts:e,appendMessage:r}){let i=[...e],n=t,s=r.part??0;switch(r.content_type){case"text":{let{delta:o,position:a}=r;n=Di(n,o,a);let l=i[s]&&"text"in i[s]?i[s].text:"";i[s]={text:l?Di(l,o,a):o};break}case"html":{let{delta:o,position:a}=r,l=i[s]&&"html"in i[s]?i[s].html:"";i[s]={html:l?Di(l,o,a):o};break}case"data":{let o=i[s]&&"data"in i[s]?i[s].data:{};i[s]={tag:r.tag,data:Object.assign({},o,r.data)};break}}return{content:n,parts:i}}var mr=class{messages=Object.freeze([]);onEvent(e){switch(e.type){case"NEW_MESSAGE":{let r={...e.message,streaming:!0,parts:e.message.parts};return this.messages=Object.freeze([...this.messages.filter(i=>i.id!==r.id),r]),r}case"APPEND_MESSAGE":{let i=this.messages.find(s=>s.id===e.message.id)??(()=>{let s={id:e.message.id,timestamp:Date.now(),role:"assistant",content:"",streaming:!0,parts:[]};return this.messages=Object.freeze([...this.messages,s]),s})(),n=ic({content:i.content,parts:i.parts||[],appendMessage:e.message});return i.content=n.content,i.parts=n.parts,e.metadata&&(i.metadata=e.metadata),i}case"MESSAGE_DONE":{let r=this.messages.find(i=>i.id===e.message.id);return r?(Object.assign(r,e.message),r.streaming=!1,r):void 0}default:return}}onEvents(e){for(let r of e)this.onEvent(r)}getMessage(e){return this.messages.find(r=>r.id===e)}get lastMessage(){return this.messages.at(-1)}reset(){this.messages=Object.freeze([])}};var gr=class{#e;#t;#r=null;#i=new mr;isStreaming=!1;typingIndicator;toolCallIndicator;ranOutOfCredits=!1;get messages(){return this.#i.messages}set messages(e){this.#i.messages=e}conversationId="";#n=0;#s;isLiveMode=!1;get hasQueuedMessages(){return this.#a.length>0}constructor(e,r){this.#e=e,this.#t=r,this.#t.autoConnect!==!1&&(this.#r=this.initWS()),e.addController(this)}#a=[];#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.#a.length>0){let i=this.#a[this.#a.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.#a.push({message:e,options:{expectStreaming:r}}),this.#e.requestUpdate(),this.#r&&!this.#r.isConnecting&&!this.#r.isConnected&&this.retry(),await fr({times:5,backoff:2e3},async()=>{if(this.#r?.isConnected){let i=[...this.#a];this.#a=[],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.#a=[],this.#e.requestUpdate(),!1)))}async sendUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:i,role:n="user",expectStreaming:s=!1}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:n,xUserData:r,xCustomInstructions:i},{expectStreaming:s})}async sendUserFeedback(e){return this.enqueueMessage({type:"USER_FEEDBACK",responses:e},{expectStreaming:!0})}sendFileDelete(e){M(e,"fileId is required"),this.enqueueMessage({type:"USER_FILE_DELETE",fileId: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.#s),this.#s=setTimeout(()=>{this.#t.onReconnect?.(),this.#r=this.initWS()},1e3*this.#n),this.#n++}initWS(){return new hr(this.#e,{url:()=>this.#t.url(this.conversationId,{}),onOpen:e=>this.#l(e),onMessage:e=>this.#c(JSON.parse(e.data)),onError:e=>this.#u(e),onClose:e=>this.#d(e)})}#l(e){this.#n=0}#c(e){switch(e.type){case"NEW_MESSAGE":{this.#i.onEvent(e),this.typingIndicator=void 0,this.toolCallIndicator=void 0,this.#t.onNewMessage?.(e.message),this.#t.persistConversationState?.(this.conversationId,this.messages),this.#e.requestUpdate();break}case"APPEND_MESSAGE":{let r=!this.#i.getMessage(e.message.id),i=this.#i.onEvent(e);i&&(this.typingIndicator=void 0,this.toolCallIndicator=void 0,r&&(this.#t.onNewMessage?.({id:i.id,timestamp:i.timestamp,role:i.role,content:i.content}),this.#t.persistConversationState?.(this.conversationId,this.messages)),this.#t.onMessageAppend?.(e),this.#e.requestUpdate());break}case"MESSAGE_DONE":{let r=this.#i.onEvent(e);if(!r)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.#i.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.toolCallIndicator=void 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"TOOL_CALL_START":{this.typingIndicator=void 0,this.toolCallIndicator=e.text,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)}`)}}#u(e){console.error("onError",e),this.#t.onError?.(e)}#d(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.#i.messages=this.#t.restoreConversationState?.()?.messages||[]}reset(){this.#t.onReset?.(),this.#i.reset(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.conversationId="",this.isLiveMode=!1,this.#a=[],this.#e.requestUpdate()}hostDisconnected(){clearTimeout(this.#s)}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 Oi;function Ws(t){return{lang:t?.lang??Oi?.lang,message:t?.message,abortEarly:t?.abortEarly??Oi?.abortEarly,abortPipeEarly:t?.abortPipeEarly??Oi?.abortPipeEarly}}var nc;function sc(t){return nc?.get(t)}var oc;function ac(t){return oc?.get(t)}var lc;function cc(t,e){return lc?.get(t)?.get(e)}function Vs(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??Vs(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??cc(t.reference,l.lang)??(c?ac(l.lang):null)??i.message??sc(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 X(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},Ws())}}}function uc(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Hs(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}var dc=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z|[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u;function Pi(t){return{kind:"validation",type:"iso_timestamp",reference:Pi,async:!1,expects:null,requirement:dc,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&G(this,"timestamp",e,r),e}}}function Ui(t,e){return{kind:"validation",type:"max_length",reference:Ui,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 Ri(t,e){return{kind:"validation",type:"min_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 Li(t){return{kind:"transformation",type:"to_date",reference:Li,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 ji(t){return{kind:"transformation",type:"transform",reference:ji,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function Gs(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function Q(t,e){return{...t,fallback:e,get"~standard"(){return X(this)},"~run"(r,i){let n=t["~run"](r,i);return n.issues?{typed:!0,value:Gs(this,n,i)}:n}}}function Fi(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function Tt(){return{kind:"schema",type:"any",reference:Tt,expects:"any",async:!1,get"~standard"(){return X(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 X(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 qi(t){return{kind:"schema",type:"boolean",reference:qi,expects:"boolean",async:!1,message:t,get"~standard"(){return X(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:G(this,"type",e,r),e}}}function Bi(t){return{kind:"schema",type:"null",reference:Bi,expects:"null",async:!1,message:t,get"~standard"(){return X(this)},"~run"(e,r){return e.value===null?e.typed=!0:G(this,"type",e,r),e}}}function yr(t,e){return{kind:"schema",type:"nullish",reference:yr,expects:`(${t.expects} | null | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return X(this)},"~run"(r,i){return(r.value===null||r.value===void 0)&&(this.default!==void 0&&(r.value=Fi(this,r,i)),r.value===null||r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function br(t){return{kind:"schema",type:"number",reference:br,expects:"number",async:!1,message:t,get"~standard"(){return X(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:G(this,"type",e,r),e}}}function N(t,e){return{kind:"schema",type:"object",reference:N,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return X(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]:Fi(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]=Gs(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 X(this)},"~run"(r,i){return r.value===void 0&&(this.default!==void 0&&(r.value=Fi(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:Hs(t.map(Vs),"|"),async:!1,options:t,message:e,get"~standard"(){return X(this)},"~run"(r,i){return this.options.includes(r.value)?r.typed=!0:G(this,"type",r,i),r}}}function Dt(t,e,r){return{kind:"schema",type:"record",reference:Dt,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return X(this)},"~run"(i,n){let s=i.value;if(s&&typeof s=="object"){i.typed=!0,i.value={};for(let o in s)if(uc(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 p of l.issues)p.path=[d],i.issues?.push(p);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 p of c.issues)p.path?p.path.unshift(d):p.path=[d],i.issues?.push(p);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 C(t){return{kind:"schema",type:"string",reference:C,expects:"string",async:!1,message:t,get"~standard"(){return X(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:G(this,"type",e,r),e}}}function zs(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function vr(t,e){return{kind:"schema",type:"union",reference:vr,expects:Hs(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return X(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:zs(s)}),r.typed=!0}else{if(o?.length===1)return o[0];G(this,"type",r,i,{issues:zs(o)})}return r}}}function Xs(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 X(this)}}}function et(...t){return{...t[0],pipe:t,get"~standard"(){return X(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 oe(t,e,r){let i=t["~run"]({value:e},Ws(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var wr=Xs(N({url:C(),name:C(),description:C(),price:C()}));function Js(t){return t.flatMap(e=>{if(!("tag"in e))return[];switch(e.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let r=oe(wr,e.data);if(r.success)return[{name:r.output.name??"",price:r.output.price??"0"}];break}case"thought":case"order-status-card-v1":case"order-card-v2":case"live-chat-wait-card-v1":case"live-chat-wait-card-v2":case"request-input-v1":break}return[]})}var pc=Symbol();var Ks=Object.getPrototypeOf,Ni=new WeakMap,hc=t=>t&&(Ni.has(t)?Ni.get(t):Ks(t)===Object.prototype||Ks(t)===Array.prototype);var Ys=t=>hc(t)&&t[pc]||null,zi=(t,e=!0)=>{Ni.set(t,e)};var Vi=t=>typeof t=="object"&&t!==null,fc=t=>Vi(t)&&!Hi.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),eo=(t,e)=>{let r=Qs.get(t);if(r?.[0]===e)return r[1];let i=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return zi(i,!0),Qs.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(Hi.has(s))zi(s,!1);else if(Fe.has(s)){let[l,c]=Fe.get(s);a.value=eo(l,c())}Object.defineProperty(i,n,a)}),Object.preventExtensions(i)},mc=(t,e,r,i)=>({deleteProperty(n,s){let o=Reflect.get(n,s);r(s);let a=Reflect.deleteProperty(n,s);return a&&i(xr?.("delete",s,o)),a},set(n,s,o,a){let l=!t()&&Reflect.has(n,s),c=Reflect.get(n,s,a);if(l&&(Zs(c,o)||kr.has(o)&&Zs(c,kr.get(o))))return!0;r(s),Vi(o)&&(o=Ys(o)||o);let d=!Fe.has(o)&&yc(o)?Gi(o):o;return e(s,d),Reflect.set(n,s,d,a),i(xr?.("set",s,o,c)),!0}});var Fe=new WeakMap,Hi=new WeakSet,Qs=new WeakMap,Wi=[1],kr=new WeakMap,Zs=Object.is,gc=(t,e)=>new Proxy(t,e),yc=fc,bc=eo,vc=mc,xr;function Gi(t={}){if(!Vi(t))throw new Error("object required");let e=kr.get(t);if(e)return e;let r=Wi[0],i=new Set,n=(x,S=++Wi[0])=>{r!==S&&(s=r=S,i.forEach(b=>b(x,S)))},s=r,o=(x=Wi[0])=>(s!==x&&(s=x,l.forEach(([S])=>{let b=S[1](x);b>r&&(r=b)})),r),a=x=>(S,b)=>{let k;S&&(k=[...S],k[1]=[x,...k[1]]),n(k,b)},l=new Map,c=(x,S)=>{let b=!Hi.has(S)&&Fe.get(S);if(b){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(x))throw new Error("prop listener already exists");if(i.size){let k=b[2](a(x));l.set(x,[b,k])}else l.set(x,[b])}},d=x=>{var S;let b=l.get(x);b&&(l.delete(x),(S=b[1])==null||S.call(b))},p=x=>(i.add(x),i.size===1&&l.forEach(([b,k],$)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&k)throw new Error("remove already exists");let P=b[2](a($));l.set($,[b,P])}),()=>{i.delete(x),i.size===0&&l.forEach(([b,k],$)=>{k&&(k(),l.set($,[b]))})}),h=!0,m=vc(()=>h,c,d,n),f=gc(t,m);kr.set(t,f);let E=[t,o,p];return Fe.set(f,E),Reflect.ownKeys(t).forEach(x=>{let S=Object.getOwnPropertyDescriptor(t,x);"value"in S&&S.writable&&(f[x]=t[x])}),h=!1,f}function _r(t,e,r){let i=Fe.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(d&&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 tt(t){let e=Fe.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[r,i]=e;return bc(r,i())}var rt=class{#e;#t;#r;#i=()=>{};constructor(e,r){this.#e=e,this.#t=r,this.#r=tt(r),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#i(),this.#i=_r(this.#t,()=>{this.#r=tt(this.#t),this.#e.requestUpdate()})}hostDisconnected(){this.#i()}};var Ce=class{#e;#t;proxyObject;#r;#i=()=>{};constructor(e,r,i){this.#e=e,this.#t=i,this.proxyObject=Gi(r),this.#r=tt(this.proxyObject),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#i(),this.#t?.subscribe&&(this.#i=_r(this.proxyObject,()=>{this.#r=tt(this.proxyObject),this.#e.requestUpdate()}))}hostDisconnected(){this.#i()}};var Cr=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=wc(this.#e,this.#t),!this.#i))return;let e=this.#i[this.#r]instanceof Ce?this.#i[this.#r]:null;e&&(this.#n=new rt(this.#e,e.proxyObject))}hostDisconnected(){}};function wc(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 Xi(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 to=()=>{if(window.Shopify)try{return{customerId:xc()}}catch{return null}return null},xc=()=>{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},ro=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 io(t){if(t instanceof URLSearchParams)return new URLSearchParams(t);let e=new URLSearchParams;for(let[r,i]of Object.entries(t))i!=null&&e.set(r,String(i));return e}function no(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function it(t){let e="[-a-z\\d%_.~!$&'()*+,;=:@]",r="[-a-z\\d%_.~!$&'()*+,;=:@/?]";return new RegExp(`^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/${e}*)*(\\?${r}*)?(\\#${r}*)?$`,"i").test(t)}function so(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 oo=()=>{if(window.ShopRenter)try{let t=_c();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},_c=()=>{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}}},ao=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=no(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 lo=()=>{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},co=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 Ot=vi(Yi(),1);var Sr=class{#e;constructor({document:e}){this.#e=e}getCookies(){return(0,Ot.parseCookie)(this.#e.cookie)||{}}getCookie(e){return this.getCookies()[e]||null}setCookie(e,r,i){if(M(typeof e=="string",`cookie name must be a string, got: ${typeof e}`),M(e,"cookie name must not be empty"),r==null){this.#e.cookie=(0,Ot.stringifySetCookie)(e,"",{expires:new Date(0)});return}M(typeof r=="string",`value of cookie \`${e}\` must be a string, got: ${typeof r}`),this.#e.cookie=(0,Ot.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 $r=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 Pt=vi(Yi(),1);function Qi({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,Pt.stringifySetCookie)(n,"1",{domain:o,path:"/"}),(0,Pt.parseCookie)(r.cookie)[n]==="1")return r.cookie=(0,Pt.stringifySetCookie)(n,"",{domain:o,path:"/",expires:new Date(0)}),o}catch{continue}}return`.${i.slice(-2).join(".")}`}var Zi=class{#e;#t;#r;#i;constructor({window:e}){this.#e=e,this.#t=new Sr({document:e.document}),this.#r=new $r({localStorage:e.localStorage}),this.#i=e.localStorage}get distinctID(){return this.#t.getCookie("molin_distinct_id")||this.#i.getItem("molin_distinct_id")}set distinctID(e){if(!e){this.#t.deleteCookie("molin_distinct_id"),this.#i.removeItem("molin_distinct_id");return}M(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:Qi({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")}set widgetState(e){this.#r.setItem("molin_widget",e)}get popupState(){return this.#r.getItem("molin_popup")}set popupState(e){this.#r.setItem("molin_popup",e)}get disclaimerDismissed(){return this.#r.getItem("molin_disclaimer_dismissed")??!1}set disclaimerDismissed(e){this.#r.setItem("molin_disclaimer_dismissed",e)}getConversationId(e){M(typeof e=="string","widgetId must be a string"),M(e,"widgetId must not be empty");let r=`molin_${e}_conversation_id`;return this.#t.getCookie(r)||this.#i.getItem(r)}setConversationId(e,r){M(typeof e=="string","widgetId must be a string"),M(e,"widgetId must not be empty");let i=`molin_${e}_conversation_id`;if(!r){this.#t.deleteCookie(i),this.#i.removeItem(i);return}M(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:Qi({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){M(typeof e=="string","widgetId must be a string"),M(e,"widgetId must not be empty");let r=`molin_${e}_conversation`;return this.#r.getItem(r)}setConversationState(e,r){M(typeof e=="string","widgetId must be a string"),M(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_"))}},mo;function L(){return mo??=new Zi({window}),mo}var go=Dt(C(),vr([C(),br(),qi(),Bi()])),yo=et(C(),Ri(1),Ui(5e3)),bo=()=>{try{return window.UNAS?lo():window.Shopify?to():window.ShopRenter?oo():null}catch{return null}},vo=async()=>{try{return window.UNAS?await co():window.Shopify?await ro():window.ShopRenter?await ao():[]}catch{return[]}},nt={schema:N({conversationId:A(C()),messages:A(Ze(N({id:C(),timestamp:br(),role:Mt(["user","assistant","support"]),content:C(),parts:A(Ze(vr([N({text:C()}),N({html:C()}),N({tag:C(),data:Dt(C(),Tt())})])))})))}),persist(t,e,r){L().setConversationState(t,{conversationId:e,messages:r}),L().setConversationId(t,e)},restore(t){try{let e=L().getConversationState(t),r=e?oe(this.schema,e):void 0;return r?.success&&r.output.conversationId?{conversationId:r.output.conversationId,messages:r.output.messages||[]}:{conversationId:L().getConversationId(t)||"",messages:[]}}catch(e){return console.error("Failed to restore conversation state:",e),{conversationId:"",messages:[]}}},reset(t){L().setConversationState(t,null),L().setConversationId(t,null)}};var st=class t extends v{static properties={widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object}};contextCtrl;constructor(){super(),this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.contextCtrl=new Ce(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,toolCallIndicator: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),sendUserFeedback:this.sendUserFeedback.bind(this),sendFileDelete:this.#n.sendFileDelete.bind(this.#n)})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){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,toolCallIndicator:this.#n.toolCallIndicator,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),sendUserFeedback:this.sendUserFeedback.bind(this),sendFileDelete:this.#n.sendFileDelete.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 gr(this,{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)=>{if(r.role==="assistant"){let i=Js(r.parts??[]);this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:r.content??"",message:r,conversationId:this.#n.conversationId,products:i})}},onMessageError:e=>{console.error("ws message error",e),e.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+e.message})},onReset:()=>{nt.reset(this.widgetId)},onConnect:(e,r)=>{let i=bo();this.#n.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),vo().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)=>{nt.persist(this.widgetId,e,r)},restoreConversationState:()=>nt.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=oe(go,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=oe(yo,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=Xi(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)}async sendUserFeedback(e){return this.#n.sendUserFeedback(e)}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()}render(){return u`<slot></slot>`}};function wo(t){let e=new Cr(t,{provider:st,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,i){if(i==="value")return e.value}})}st.ConnectedEvent=class extends CustomEvent{static type="mw-context-widget:connected";constructor(e,r={}){super(st.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-context-widget")||customElements.define("mw-context-widget",st);var Pc=Object.freeze({"lucide:arrow-up":u`
|
|
4
4
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
5
5
|
<path d="m5 12 7-7 7 7" />
|
|
6
6
|
<path d="M12 19V5" />
|
|
@@ -145,7 +145,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
145
145
|
:host([fill]) svg {
|
|
146
146
|
fill: currentColor;
|
|
147
147
|
}
|
|
148
|
-
`;constructor(){super(),this.name,this.fill=!1}render(){if(!this.name)return null;let e=Ic[this.name];return e||(console.warn(`mw-icon: '${this.name}' not found`),null)}};customElements.get("mw-icon")||customElements.define("mw-icon",en);function dn(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function Ac(t,e=","){return t.map(dn).join(e)}var Co=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Ir(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 Mr(t,e="@media "){return e+D(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(i=>`(${i}-width:${r[i]})`).join(" and "))).join(",")}function D(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function bo(t){return t}function Dr(){}var q={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function Eo(t){return t.match(/[-=:;]/g)?.length||0}function on(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(Eo(t),15)<<18}var Tc=["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 pn({n:t,i:e,v:r=[]},i,n,s){t&&(t=dn({n:t,i:e,v:r})),s=[...D(s)];for(let a of r){let l=i.theme("screens",a);for(let c of D(l&&Mr(l)||i.v(a))){var o;s.push(c),n|=l?67108864|on(c):a=="dark"?1073741824:c[0]=="@"?on(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~Tc.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:n,r:s,i:e}}var So=new Map;function an(t){if(t.d){let e=[],r=tn(t.r.reduce((i,n)=>n[0]=="@"?(e.push(n),i):n?tn(i,s=>tn(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):rn(s,o)}return rn(o,s)})):i,"&"),i=>rn(i,t.n?"."+Co(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,n)=>n+"{"+i+"}",t.d)}}function tn(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,i,n)=>e(i)+n)}function rn(t,e){return t.replace(/&/g,e)}var vo=new Intl.Collator("en",{numeric:!0});function $o(t,e){for(var r=0,i=t.length;r<i;){let n=i+r>>1;0>=Io(t[n],e)?r=n+1:i=n}return i}function Io(t,e){let r=t.p&q.o;return r==(e.p&q.o)&&(r==q.b||r==q.o)?0:t.p-e.p||t.o-e.o||vo.compare(wo(t.n),wo(e.n))||vo.compare(xo(t.n),xo(e.n))}function wo(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function xo(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function nn(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(${[nn(t.substr(1,s),o),nn(t.substr(1+s,s),o),nn(t.substr(1+2*s,s),o),n]})`}return n=="1"?t:n=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function Ao(t,e,r,i,n=[]){return(function s(o,{n:a,p:l,r:c=[],i:d},p){let h=[],m="",f=0,E=0;for(let b in o||{}){var x,S;let k=o[b];if(b[0]=="@"){if(!k)continue;if(b[1]=="a"){h.push(...fn(a,l,Tr(""+k),p,l,c,d,!0));continue}if(b[1]=="l"){for(let $ of D(k))h.push(...s($,{n:a,p:(x=q[b[7]],l&~q.o|x),r:b[7]=="d"?[]:c,i:d},p));continue}if(b[1]=="i"){h.push(...D(k).map($=>({p:-1,o:0,r:[],d:b+" "+$})));continue}if(b[1]=="k"){h.push({p:q.d,o:0,r:[b],d:s(k,{p:q.d},p).map(an).join("")});continue}if(b[1]=="f"){h.push(...D(k).map($=>({p:q.d,o:0,r:[b],d:s($,{p:q.d},p).map(an).join("")})));continue}}if(typeof k!="object"||Array.isArray(k))b=="label"&&k?a=k+Ir(JSON.stringify([l,d,o])):(k||k===0)&&(b=b.replace(/[A-Z]/g,$=>"-"+$.toLowerCase()),E+=1,f=Math.max(f,(S=b)[0]=="-"?0:Eo(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),m+=(m?";":"")+D(k).map($=>p.s(b,hn(""+$,p.theme)+(d?" !important":""))).join(";"));else if(b[0]=="@"||b.includes("&")){let $=l;b[0]=="@"&&(b=b.replace(/\bscreen\(([^)]+)\)/g,(P,F)=>{let W=p.theme("screens",F);return W?($|=67108864,Mr(W,"")):P}),$|=on(b)),h.push(...s(k,{n:a,p:$,r:[...c,b],i:d},p))}else h.push(...s(k,{p:l,r:[...c,b]},p))}return h.unshift({n:a,p:l,o:Math.max(0,15-E)+1.5*Math.min(f||15,15),r:c,d:m}),h.sort(Io)})(t,pn(e,r,i,n),r)}function hn(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):""+D(a).filter(l=>Object(l)!==l)})}function To(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 Ar(t,e,r=q.u,i,n){let s=[];for(let o of t)for(let a of(function(l,c,d,p,h){l={...l,i:l.i||h};let m=(function(f,E){let x=So.get(f.n);return x?x(f,E):E.r(f.n,f.v[0]=="dark")})(l,c);return m?typeof m=="string"?({r:p,p:d}=pn(l,c,d,p),To(Ar(Tr(m),c,d,p,l.i),l.n)):Array.isArray(m)?m.map(f=>{var E,x;return{o:0,...f,r:[...D(p),...D(f.r)],p:(E=d,x=f.p??d,E&~q.o|x)}}):Ao(m,l,c,d,p):[{c:dn(l),p:0,o:0,r:[]}]})(o,e,r,i,n))s.splice($o(s,a),0,a);return s}function fn(t,e,r,i,n,s,o,a){return To((a?r.flatMap(l=>Ar([l],i,n,s,o)):Ar(r,i,n,s,o)).map(l=>l.p&q.o&&(l.n||e==q.b)?{...l,p:l.p&~q.o|e,o:0}:l),t)}function Mc(t,e,r,i){var n;return n=(s,o)=>{let{n:a,p:l,r:c,i:d}=pn(s,o,e);return r&&fn(a,e,r,o,l,c,d,i)},So.set(t,n),t}function sn(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(Dc),i:n}))}}function Dc(t,e,r){return r.indexOf(t)==e}var ko=new Map;function Tr(t){let e=ko.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&&sn(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 p=r[d-1];if(/[~@]$/.test(p)){let h=i.shift();r.length=d,sn([...r,"#"],i);let{v:m}=i[0].pop();for(let f of h)f.v.splice(+(f.v[0]=="dark")-+(m[0]=="dark"),m.length);sn([...r,Mc(p.length>1?p.slice(0,-1)+Ir(JSON.stringify([p,h])):p+"("+Ac(h)+")",q.a,h,/@$/.test(p))],i)}d=r.lastIndexOf("(",d-1)}r.length=d+1}else/[~@]/.test(c)&&t[a+1]=="("&&i.unshift([])}l(!0),ko.set(t,e=i[0])}return e}function g(t,e,r){return[t,ln(e,r)]}function ln(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,i)=>({[t]:e?e(r,i):cn(r,1)}):r=>t||{[r[1]]:cn(r,2)}}function cn(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function y(t,e,r,i){return[t,mn(e,r,i)]}function mn(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=Mo(t||n[1]),a=s.theme(o,n.$$)??ue(n.$$,o,s);if(a!=null)return n._=cn(n,0,a),i(n,s,o)}}function B(t,e={},r){return[t,Oc(e,r)]}function Oc(t={},e){return(r,i)=>{let{section:n=Mo(r[0]).replace("-","")+"Color"}=t,[s,o]=Pc(r.$$);if(!s)return;let a=i.theme(n,s)||ue(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:p}=t,h=i.theme(c,o||"DEFAULT")||o&&ue(o,c,i),m=e||(({_:E})=>{let x=Rt(d,E);return p?{[p]:x}:x});r._={value:te(a,{opacityVariable:l||void 0,opacityValue:h||void 0}),color:E=>te(a,E),opacityVariable:l||void 0,opacityValue:h||void 0};let f=m(r,i);if(!r.dark){let E=i.d(n,s,a);E&&E!==a&&(r._={value:te(E,{opacityVariable:l||void 0,opacityValue:h||"1"}),color:x=>te(E,x),opacityVariable:l||void 0,opacityValue:h||void 0},f={"&":f,[i.v("dark")]:m(r,i)})}return f}}function Pc(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Rt(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 ue(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=ot(hn(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 Mo(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function ot(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",i,n="")=>ot(r)+i+ot(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 gn({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:D(e.variants),rules:D(e.rules),ignorelist:D(e.ignorelist),hash:void 0,stringify:(i,n)=>i+":"+n,finalize:[]};for(let i of D([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&D(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:p=r.hash,stringify:h=r.stringify,finalize:m}=typeof i=="function"?i(r):i;r={preflight:r.preflight!==!1&&n!==!1&&[...r.preflight,...D(n)],darkMode:s,darkColor:o,theme:{...r.theme,...a,extend:{...r.theme.extend,...a?.extend}},variants:[...r.variants,...D(l)],rules:[...r.rules,...D(c)],ignorelist:[...r.ignorelist,...D(d)],hash:p,stringify:h,finalize:[...r.finalize,...D(m)]}}return r}function _o(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 Rc(t){var e;return un(t[0],typeof(e=t[1])=="function"?e:()=>e)}function Uc(t){var e,r;return Array.isArray(t)?un(t[0],ln(t[1],t[2])):un(t,ln(e,r))}function un(t,e){return Do(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 Do(t,e){let r=D(t).map(Lc);return(i,n,s)=>{for(let o of r){let a=e(i,o,n,s);if(a)return a}}}function Lc(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function Oo(t,e){let r=gn(t),i=(function({theme:l,darkMode:c,darkColor:d=Dr,variants:p,rules:h,hash:m,stringify:f,ignorelist:E,finalize:x}){let S=new Map,b=new Map,k=new Map,$=new Map,P=Do(E,(T,V)=>V.test(T));p.push(["dark",Array.isArray(c)||c=="class"?`${D(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let F=typeof m=="function"?T=>m(T,Ir):m?Ir:bo;F!==bo&&x.push(T=>({...T,n:T.n&&F(T.n),d:T.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(V,Y)=>"--"+F(Y).replace("#",""))}));let W={theme:(function({extend:T={},...V}){let Y={},bi={get colors(){return Me("colors")},theme:Me,negative(){return{}},breakpoints(U){let H={};for(let K in U)typeof U[K]=="string"&&(H["screen-"+K]=U[K]);return H}};return Me;function Me(U,H,K,xt){if(U){if({1:U,2:xt}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(U)||[,U],/[.[]/.test(U)){let me=[];U.replace(/\[([^\]]+)\]|([^.[]+)/g,(Oe,_t,Dl=_t)=>me.push(Dl)),U=me.shift(),K=H,H=me.join("-")}let le=Y[U]||Object.assign(Object.assign(Y[U]={},ir(V,U)),ir(T,U));if(H==null)return le;H||(H="DEFAULT");let De=le[H]??H.split("-").reduce((me,Oe)=>me?.[Oe],le)??K;return xt?te(De,{opacityValue:hn(xt,Me)}):De}let kt={};for(let le of[...Object.keys(V),...Object.keys(T)])kt[le]=Me(le);return kt}function ir(U,H){let K=U[H];return typeof K=="function"&&(K=K(bi)),K&&/color|fill|stroke/i.test(H)?(function xt(kt,le=[]){let De={};for(let me in kt){let Oe=kt[me],_t=[...le,me];De[_t.join("-")]=Oe,me=="DEFAULT"&&(_t=le,De[le.join("-")]=Oe),typeof Oe=="object"&&Object.assign(De,xt(Oe,_t))}return De})(K):K}})(l),e:Co,h:F,s(T,V){return f(T,V,W)},d(T,V,Y){return d(T,V,W,Y)},v(T){return S.has(T)||S.set(T,_o(T,p,b,Rc,W)||"&:"+T),S.get(T)},r(T,V){let Y=JSON.stringify([T,V]);return k.has(Y)||k.set(Y,!P(T,W)&&_o(T,h,$,Uc,W,V)),k.get(Y)},f(T){return x.reduce((V,Y)=>Y(V,W),T)}};return W})(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=an(c);if(d&&!o.has(d)){o.add(d);let p=$o(s,l);e.insert(d,p,l),s.splice(p,0,l)}return c.n}return Object.defineProperties(function(c){if(!n.size)for(let p of D(r.preflight))typeof p=="function"&&(p=p(i)),p&&(typeof p=="string"?fn("",q.b,Tr(p),i,q.b,[],!1,!0):Ao(p,{},i,q.b)).forEach(a);c=""+c;let d=n.get(c);if(!d){let p=new Set;for(let h of Ar(Tr(c),i))p.add(h.c).add(a(h));d=[...p].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),p=[...s];return()=>{l(),o=c,n=d,s=p}},clear(){e.clear(),o=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function jc(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function Po(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&&jc(o,s=t(o))&&n.setAttribute("class",s)}}function Fc(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 Or(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:Fc(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:Dr}}var qc=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 Ro(t){return qc.get(t)}function Uo(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 Lo(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 Bc=[["-webkit-",1],["-moz-",2],["-ms-",4]];function jo(){return({stringify:t})=>({stringify(e,r,i){let n="",s=Ro(e);s&&(n+=t(s,r,i)+";");let o=Uo(e),a=Lo(e,r);for(let l of Bc)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 qo(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",mn("lineClamp",({_:t})=>Fo(t))],["line-clamp-(\\d+)",({1:t})=>Fo(t)]]}}function Fo(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",...Z(4,"rem",4,.5,.5),...Z(12,"rem",4,5),14:"3.5rem",...Z(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:I("blur"),backdropBrightness:I("brightness"),backdropContrast:I("contrast"),backdropGrayscale:I("grayscale"),backdropHueRotate:I("hueRotate"),backdropInvert:I("invert"),backdropOpacity:I("opacity"),backdropSaturate:I("saturate"),backdropSepia:I("sepia"),backgroundColor:I("colors"),backgroundImage:{none:"none"},backgroundOpacity:I("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:{...Z(200,"",100,0,50),...Z(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:I("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:I("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:I("colors"),caretColor:I("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...Z(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:I("borderColor"),divideOpacity:I("borderOpacity"),divideWidth:I("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"),...Ut(2,6),...Ut(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:I("spacing"),gradientColorStops:I("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"),...Ut(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...Ut(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:{...Z(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:{...Z(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:I("spacing"),placeholderColor:I("colors"),placeholderOpacity:I("opacity"),outlineColor:I("colors"),outlineOffset:re(8,"px"),outlineWidth:re(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:I("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:Z(200,"",100,0,50),scale:{...Z(150,"",100,0,50),...Z(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:I("spacing"),scrollPadding:I("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...re(2,"deg"),...re(12,"deg",3)},space:I("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:Z(2),textColor:I("colors"),textDecorationColor:I("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...re(8,"px")},textUnderlineOffset:{auto:"auto",...re(8,"px")},textIndent:I("spacing"),textOpacity:I("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:I("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"),...Ut(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:{...Z(50,"",1,0,10),auto:"auto"}};function Ut(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 Z(t,e="",r=1,i=0,n=1,s={}){for(;i<=t;i+=n)s[i]=i/r+e;return s}function I(t){return({theme:e})=>e(t)}var Bo={"*,::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 Go=[g("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:ue(`[${e}]`,"",r)}}})),g("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),y("aspect-","aspectRatio"),g("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[Mr(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}}}),y("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),g("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),g("box-(border|content)","boxSizing",({1:t})=>t+"-box"),g("hidden",{display:"none"}),g("table-(auto|fixed)","tableLayout"),g(["(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)",g("isolate","isolation"),g("object-(contain|cover|fill|none|scale-down)","objectFit"),y("object-","objectPosition"),g("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Pr),g("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),g("(static|fixed|absolute|relative|sticky)","position"),y("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),y("-?(top|bottom|left|right)(?:$|-)","inset"),g("(visible|collapse)","visibility"),g("invisible",{visibility:"hidden"}),y("-?z-","zIndex"),g("flex-((row|col)(-reverse)?)","flexDirection",No),g("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),y("(flex-(?:grow|shrink))(?:$|-)"),y("(flex)-"),y("grow(?:$|-)","flexGrow"),y("shrink(?:$|-)","flexShrink"),y("basis-","flexBasis"),y("-?(order)-"),"-?(order)-(\\d+)",y("grid-cols-","gridTemplateColumns"),g("grid-cols-(\\d+)","gridTemplateColumns",Ho),y("col-","gridColumn"),g("col-(span)-(\\d+)","gridColumn",Vo),y("col-start-","gridColumnStart"),g("col-start-(auto|\\d+)","gridColumnStart"),y("col-end-","gridColumnEnd"),g("col-end-(auto|\\d+)","gridColumnEnd"),y("grid-rows-","gridTemplateRows"),g("grid-rows-(\\d+)","gridTemplateRows",Ho),y("row-","gridRow"),g("row-(span)-(\\d+)","gridRow",Vo),y("row-start-","gridRowStart"),g("row-start-(auto|\\d+)","gridRowStart"),y("row-end-","gridRowEnd"),g("row-end-(auto|\\d+)","gridRowEnd"),g("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>Pr(No(t))),g("grid-flow-(dense)","gridAutoFlow"),y("auto-cols-","gridAutoColumns"),y("auto-rows-","gridAutoRows"),y("gap-x(?:$|-)","gap","columnGap"),y("gap-y(?:$|-)","gap","rowGap"),y("gap(?:$|-)","gap"),"(justify-(?:items|self))-",g("justify-","justifyContent",zo),g("(content|items|self)-",t=>({["align-"+t[1]]:zo(t)})),g("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),y("p([xytrbl])?(?:$|-)","padding",at("padding")),y("-?m([xytrbl])?(?:$|-)","margin",at("margin")),y("-?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))`}})),g("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),y("w-","width"),y("min-w-","minWidth"),y("max-w-","maxWidth"),y("h-","height"),y("min-h-","minHeight"),y("max-h-","maxHeight"),y("font-","fontWeight"),y("font-","fontFamily",({_:t})=>typeof(t=D(t))[1]=="string"?{fontFamily:ae(t)}:{fontFamily:ae(t[0]),...t[1]}),g("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),g("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),g("italic","fontStyle"),g("not-italic",{fontStyle:"normal"}),g("(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)",...Se({"--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,/*!*/ /*!*/)"})}),y("tracking-","letterSpacing"),y("leading-","lineHeight"),g("list-(inside|outside)","listStylePosition"),y("list-","listStyleType"),g("list-","listStyleType"),y("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),B("placeholder-",{property:"color",selector:"&::placeholder"}),g("text-(left|center|right|justify|start|end)","textAlign"),g("text-(ellipsis|clip)","textOverflow"),y("text-opacity-","textOpacity","--tw-text-opacity"),B("text-",{property:"color"}),y("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),y("indent-","textIndent"),g("(overline|underline|line-through)","textDecorationLine"),g("no-underline",{textDecorationLine:"none"}),y("underline-offset-","textUnderlineOffset"),B("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),y("decoration-","textDecorationThickness"),g("decoration-","textDecorationStyle"),g("(uppercase|lowercase|capitalize)","textTransform"),g("normal-case",{textTransform:"none"}),g("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),g("align-","verticalAlign"),g("whitespace-","whiteSpace"),g("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),g("break-words",{overflowWrap:"break-word"}),g("break-all",{wordBreak:"break-all"}),g("break-keep",{wordBreak:"keep-all"}),B("caret-",{opacityVariable:!1,opacitySection:"opacity"}),B("accent-",{opacityVariable:!1,opacitySection:"opacity"}),g("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${qe(t," ")},var(--tw-gradient-stops))`),B("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)"})),B("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)`})),B("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),g("bg-(fixed|local|scroll)","backgroundAttachment"),g("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),g(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),g("bg-blend-","backgroundBlendMode"),g("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),y("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),B("bg-",{section:"backgroundColor"}),y("bg-","backgroundImage"),y("bg-","backgroundPosition"),g("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Pr),y("bg-","backgroundSize"),y("rounded(?:$|-)","borderRadius"),y("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-${qe(r[0])}-radius`]:e,[`border-${qe(r[1])}-radius`]:e}}),g("border-(collapse|separate)","borderCollapse"),y("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),g("border-(solid|dashed|dotted|double|none)","borderStyle"),y("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...Se({"--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)"})),B("border-([xytrbl])-",{section:"borderColor"},at("border","Color")),B("border-"),y("border-([xytrbl])(?:$|-)","borderWidth",at("border","Width")),y("border(?:$|-)","borderWidth"),y("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),g("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),g("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),y("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${qe(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${qe(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),B("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),y("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),B("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),y("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),g("ring-inset",{"--tw-ring-inset":"inset"}),B("ring-",{property:"--tw-ring-color"}),y("ring(?:$|-)","ringWidth",({_:t},{theme:e})=>({...Se({"--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)"})),B("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),y("shadow(?:$|-)","boxShadow",({_:t})=>({...Se({"--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":ae(t),"--tw-shadow-colored":ae(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)"})),y("(opacity)-"),g("mix-blend-","mixBlendMode"),...Wo(),...Wo("backdrop-"),y("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:ae(t),transitionTimingFunction:t._=="none"?void 0:ae(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:ae(e("transitionDuration",""))})),y("duration(?:$|-)","transitionDuration","transitionDuration",ae),y("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",ae),y("delay(?:$|-)","transitionDelay","transitionDelay",ae),y("animate(?:$|-)","animation",(t,{theme:e,h:r,e:i})=>{let n=ae(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)",g("transform",bn),g("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":Jo(t=="gpu")})),y("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...bn()})),y("-?(rotate)-","rotate",yn),y("-?(translate-[xy])-","translate",yn),y("-?(skew-[xy])-","skew",yn),g("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Pr),"(appearance)-",y("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",y("(cursor)-"),"(cursor)-",g("snap-(none)","scroll-snap-type"),g("snap-(x|y|both)",({1:t})=>({...Se({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),g("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),g("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),g("snap-(normal|always)","scroll-snap-stop"),g("scroll-(auto|smooth)","scroll-behavior"),y("scroll-p([xytrbl])?(?:$|-)","padding",at("scroll-padding")),y("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",at("scroll-margin")),g("touch-(auto|none|manipulation)","touch-action"),g("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...Se({"--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)"})),g("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),g("outline",{outlineStyle:"solid"}),g("outline-(dashed|dotted|double)","outlineStyle"),y("-?(outline-offset)-"),B("outline-",{opacityVariable:!1,opacitySection:"opacity"}),y("outline-","outlineWidth"),"(pointer-events)-",y("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],g("select-(none|text|all|auto)","userSelect"),B("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),B("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),y("stroke-","strokeWidth"),g("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),g("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Pr(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function No(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function qe(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 ae(t){return t&&""+(t._||t)}function zo({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function at(t,e=""){return({1:r,_:i})=>{let n={x:"lr",y:"tb"}[r]||r+r;return n?{...Rt(t+"-"+qe(n[0])+e,i),...Rt(t+"-"+qe(n[1])+e,i)}:Rt(t+e,i)}}function Wo(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={...Se(r),[`${t}filter`]:e.map(i=>`var(--tw-${t}${i})`).join(" ")},[`(${t}filter)-(none)`,g(`${t}filter`,r),...e.map(i=>y(`${i[0]=="h"?"-?":""}(${t}${i})(?:$|-)`,i,({1:n,_:s})=>({[`--tw-${n}`]:D(s).map(o=>`${i}(${o})`).join(" "),...r})))]}function yn({1:t,_:e}){return{["--tw-"+t]:e,...bn()}}function bn(){return{...Se({"--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":Jo()}),transform:"var(--tw-transform)"}}function Jo(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 Vo({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function Ho({1:t}){return`repeat(${t},minmax(0,1fr))`}function Se(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var Xo=[["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)||ue(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=ot(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)||ue(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)||ue(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=ue(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&ot(t).replace(/[}]+$/,"").split("{")]];function Yo({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:Bo,theme:{...Lt,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:Xo,rules:Go,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 Nc={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},zc={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Wc={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Vc={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Hc={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},Gc={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},Jc={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},Xc={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Yc={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Kc={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Qc={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Zc={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},eu={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},tu={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},ru={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},iu={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},nu={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},su={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},ou={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},au={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},lu={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},cu={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Ko={__proto__:null,slate:Nc,gray:zc,zinc:Wc,neutral:Vc,stone:Hc,red:Gc,orange:Jc,amber:Xc,yellow:Yc,lime:Kc,green:Qc,emerald:Zc,teal:eu,cyan:tu,sky:ru,blue:iu,indigo:nu,violet:su,purple:ou,fuchsia:au,pink:lu,rose:cu};function Qo({disablePreflight:t}={}){return Yo({colors:Ko,disablePreflight:t})}function ta({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)=>ra(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=ea(o.theme("fontSize",s));return a&&{"@layer components":a}}],[t+"-",({$$:s},o)=>n(s,o)],[t,(s,o)=>({...n(e,o),"@layer base":[Zo(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:_(20,16),marginBottom:_(20,16),paddingLeft:_(26,16)},li:{marginTop:_(8,16),marginBottom:_(8,16)},"ol>li,ul>li":{paddingLeft:_(6,16)},">ul>li p":{marginTop:_(12,16),marginBottom:_(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:_(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:_(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:_(12,16),marginBottom:_(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:_(48,16),marginBottom:_(48,16)},blockquote:{marginTop:_(32,20),marginBottom:_(32,20),paddingLeft:_(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:_(20,16),marginBottom:_(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:_(36,16),marginTop:"0",marginBottom:_(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:_(24,16),marginTop:_(48,24),marginBottom:_(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:_(20,16),marginTop:_(32,20),marginBottom:_(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:_(24,16),marginBottom:_(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:_(32,16),marginBottom:_(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:_(14,16),lineHeight:"1.4",marginTop:_(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:_(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:_(21,24)},"h3 code":{fontSize:_(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:_(14,16),lineHeight:"1.7",marginTop:_(24,14),marginBottom:_(24,14),borderRadius:"0.375rem",paddingTop:_(12,14),paddingRight:_(16,14),paddingBottom:_(12,14),paddingLeft:_(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:_(32,16),marginBottom:_(32,16),fontSize:_(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:_(8,14),paddingBottom:_(8,14),paddingLeft:_(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:_(8,14),paddingRight:_(8,14),paddingBottom:_(8,14),paddingLeft:_(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:_(20,16),lineHeight:"1.6",marginTop:_(24,20),marginBottom:_(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Zo(t,o,r)],"@layer components":{...ea(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,o){let a={},l={},c=(d,p,h)=>{let m=o.theme(`colors.${s}.${p}`,p);h["--tw-prose-"+d]=te(m);let f=h!=l&&o.d("colors",`${s}-${p}`,m);f&&(l["--tw-prose-"+d]=te(f))};for(let d in i){let p=i[d];d!="dark"&&p&&c(d,p,a)}for(let d in i.dark||{}){let p=i.dark[d];p&&(i.dark?c("invert-"+d,p,a):c(d,p,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function Zo(t,e,r){let i={};for(let n in r)i[ra(t,n,e,s=>`.${e.e(e.h(t))}${s}`)]=r[n];return i}function ra(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 ea(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function _(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var vn=gn({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:[Qo(),jo(),qo(),ta()]});function ia(t,e=!0){let r=(function(){if(uu)try{let l=Or(new CSSStyleSheet);return l.connect=c=>{let d=wn(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,l.target]},l.disconnect=Dr,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Or(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 p=this.target.cssRules[c];o.forEach((h,m)=>m&&h.target.insertRule(p.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");wn(l).appendChild(c);let d=Or(c),{cssRules:p}=this.target;for(let h=0;h<p.length;h++)d.target.insertRule(p[h].cssText,h);o.push(d),a.set(l,d)},disconnect(l){let c=o.indexOf(a.get(l));c>=0&&o.splice(c,1)}}})(),i=Oo({...t,hash:t.hash??e},r),n=Po(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),n.observe(wn(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var uu=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function wn(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var w=t=>ia(vn)(t);var xn=class extends w(v){static properties={color:{type:String},radius:{type:String},size:{type:String},border:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=O`
|
|
148
|
+
`;constructor(){super(),this.name,this.fill=!1}render(){if(!this.name)return null;let e=Pc[this.name];return e||(console.warn(`mw-icon: '${this.name}' not found`),null)}};customElements.get("mw-icon")||customElements.define("mw-icon",en);function dn(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function Uc(t,e=","){return t.map(dn).join(e)}var $o=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Ir(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 Mr(t,e="@media "){return e+D(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(i=>`(${i}-width:${r[i]})`).join(" and "))).join(",")}function D(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function xo(t){return t}function Dr(){}var q={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function Io(t){return t.match(/[-=:;]/g)?.length||0}function on(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(Io(t),15)<<18}var Rc=["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 pn({n:t,i:e,v:r=[]},i,n,s){t&&(t=dn({n:t,i:e,v:r})),s=[...D(s)];for(let a of r){let l=i.theme("screens",a);for(let c of D(l&&Mr(l)||i.v(a))){var o;s.push(c),n|=l?67108864|on(c):a=="dark"?1073741824:c[0]=="@"?on(c):(o=c,1<<~(/:([a-z-]+)/.test(o)&&~Rc.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:n,r:s,i:e}}var Ao=new Map;function an(t){if(t.d){let e=[],r=tn(t.r.reduce((i,n)=>n[0]=="@"?(e.push(n),i):n?tn(i,s=>tn(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):rn(s,o)}return rn(o,s)})):i,"&"),i=>rn(i,t.n?"."+$o(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,n)=>n+"{"+i+"}",t.d)}}function tn(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,i,n)=>e(i)+n)}function rn(t,e){return t.replace(/&/g,e)}var ko=new Intl.Collator("en",{numeric:!0});function To(t,e){for(var r=0,i=t.length;r<i;){let n=i+r>>1;0>=Mo(t[n],e)?r=n+1:i=n}return i}function Mo(t,e){let r=t.p&q.o;return r==(e.p&q.o)&&(r==q.b||r==q.o)?0:t.p-e.p||t.o-e.o||ko.compare(_o(t.n),_o(e.n))||ko.compare(Co(t.n),Co(e.n))}function _o(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function Co(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function nn(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(${[nn(t.substr(1,s),o),nn(t.substr(1+s,s),o),nn(t.substr(1+2*s,s),o),n]})`}return n=="1"?t:n=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function Do(t,e,r,i,n=[]){return(function s(o,{n:a,p:l,r:c=[],i:d},p){let h=[],m="",f=0,E=0;for(let b in o||{}){var x,S;let k=o[b];if(b[0]=="@"){if(!k)continue;if(b[1]=="a"){h.push(...fn(a,l,Tr(""+k),p,l,c,d,!0));continue}if(b[1]=="l"){for(let $ of D(k))h.push(...s($,{n:a,p:(x=q[b[7]],l&~q.o|x),r:b[7]=="d"?[]:c,i:d},p));continue}if(b[1]=="i"){h.push(...D(k).map($=>({p:-1,o:0,r:[],d:b+" "+$})));continue}if(b[1]=="k"){h.push({p:q.d,o:0,r:[b],d:s(k,{p:q.d},p).map(an).join("")});continue}if(b[1]=="f"){h.push(...D(k).map($=>({p:q.d,o:0,r:[b],d:s($,{p:q.d},p).map(an).join("")})));continue}}if(typeof k!="object"||Array.isArray(k))b=="label"&&k?a=k+Ir(JSON.stringify([l,d,o])):(k||k===0)&&(b=b.replace(/[A-Z]/g,$=>"-"+$.toLowerCase()),E+=1,f=Math.max(f,(S=b)[0]=="-"?0:Io(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),m+=(m?";":"")+D(k).map($=>p.s(b,hn(""+$,p.theme)+(d?" !important":""))).join(";"));else if(b[0]=="@"||b.includes("&")){let $=l;b[0]=="@"&&(b=b.replace(/\bscreen\(([^)]+)\)/g,(P,F)=>{let W=p.theme("screens",F);return W?($|=67108864,Mr(W,"")):P}),$|=on(b)),h.push(...s(k,{n:a,p:$,r:[...c,b],i:d},p))}else h.push(...s(k,{p:l,r:[...c,b]},p))}return h.unshift({n:a,p:l,o:Math.max(0,15-E)+1.5*Math.min(f||15,15),r:c,d:m}),h.sort(Mo)})(t,pn(e,r,i,n),r)}function hn(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):""+D(a).filter(l=>Object(l)!==l)})}function Oo(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 Ar(t,e,r=q.u,i,n){let s=[];for(let o of t)for(let a of(function(l,c,d,p,h){l={...l,i:l.i||h};let m=(function(f,E){let x=Ao.get(f.n);return x?x(f,E):E.r(f.n,f.v[0]=="dark")})(l,c);return m?typeof m=="string"?({r:p,p:d}=pn(l,c,d,p),Oo(Ar(Tr(m),c,d,p,l.i),l.n)):Array.isArray(m)?m.map(f=>{var E,x;return{o:0,...f,r:[...D(p),...D(f.r)],p:(E=d,x=f.p??d,E&~q.o|x)}}):Do(m,l,c,d,p):[{c:dn(l),p:0,o:0,r:[]}]})(o,e,r,i,n))s.splice(To(s,a),0,a);return s}function fn(t,e,r,i,n,s,o,a){return Oo((a?r.flatMap(l=>Ar([l],i,n,s,o)):Ar(r,i,n,s,o)).map(l=>l.p&q.o&&(l.n||e==q.b)?{...l,p:l.p&~q.o|e,o:0}:l),t)}function Lc(t,e,r,i){var n;return n=(s,o)=>{let{n:a,p:l,r:c,i:d}=pn(s,o,e);return r&&fn(a,e,r,o,l,c,d,i)},Ao.set(t,n),t}function sn(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(jc),i:n}))}}function jc(t,e,r){return r.indexOf(t)==e}var Eo=new Map;function Tr(t){let e=Eo.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&&sn(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 p=r[d-1];if(/[~@]$/.test(p)){let h=i.shift();r.length=d,sn([...r,"#"],i);let{v:m}=i[0].pop();for(let f of h)f.v.splice(+(f.v[0]=="dark")-+(m[0]=="dark"),m.length);sn([...r,Lc(p.length>1?p.slice(0,-1)+Ir(JSON.stringify([p,h])):p+"("+Uc(h)+")",q.a,h,/@$/.test(p))],i)}d=r.lastIndexOf("(",d-1)}r.length=d+1}else/[~@]/.test(c)&&t[a+1]=="("&&i.unshift([])}l(!0),Eo.set(t,e=i[0])}return e}function g(t,e,r){return[t,ln(e,r)]}function ln(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,i)=>({[t]:e?e(r,i):cn(r,1)}):r=>t||{[r[1]]:cn(r,2)}}function cn(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function y(t,e,r,i){return[t,mn(e,r,i)]}function mn(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.$$)??ue(n.$$,o,s);if(a!=null)return n._=cn(n,0,a),i(n,s,o)}}function B(t,e={},r){return[t,Fc(e,r)]}function Fc(t={},e){return(r,i)=>{let{section:n=Po(r[0]).replace("-","")+"Color"}=t,[s,o]=qc(r.$$);if(!s)return;let a=i.theme(n,s)||ue(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:p}=t,h=i.theme(c,o||"DEFAULT")||o&&ue(o,c,i),m=e||(({_:E})=>{let x=Ut(d,E);return p?{[p]:x}:x});r._={value:te(a,{opacityVariable:l||void 0,opacityValue:h||void 0}),color:E=>te(a,E),opacityVariable:l||void 0,opacityValue:h||void 0};let f=m(r,i);if(!r.dark){let E=i.d(n,s,a);E&&E!==a&&(r._={value:te(E,{opacityVariable:l||void 0,opacityValue:h||"1"}),color:x=>te(E,x),opacityVariable:l||void 0,opacityValue:h||void 0},f={"&":f,[i.v("dark")]:m(r,i)})}return f}}function qc(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Ut(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 ue(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=ot(hn(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 ot(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",i,n="")=>ot(r)+i+ot(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 gn({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:D(e.variants),rules:D(e.rules),ignorelist:D(e.ignorelist),hash:void 0,stringify:(i,n)=>i+":"+n,finalize:[]};for(let i of D([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&D(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:p=r.hash,stringify:h=r.stringify,finalize:m}=typeof i=="function"?i(r):i;r={preflight:r.preflight!==!1&&n!==!1&&[...r.preflight,...D(n)],darkMode:s,darkColor:o,theme:{...r.theme,...a,extend:{...r.theme.extend,...a?.extend}},variants:[...r.variants,...D(l)],rules:[...r.rules,...D(c)],ignorelist:[...r.ignorelist,...D(d)],hash:p,stringify:h,finalize:[...r.finalize,...D(m)]}}return r}function So(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 Bc(t){var e;return un(t[0],typeof(e=t[1])=="function"?e:()=>e)}function Nc(t){var e,r;return Array.isArray(t)?un(t[0],ln(t[1],t[2])):un(t,ln(e,r))}function un(t,e){return Uo(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 Uo(t,e){let r=D(t).map(zc);return(i,n,s)=>{for(let o of r){let a=e(i,o,n,s);if(a)return a}}}function zc(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function Ro(t,e){let r=gn(t),i=(function({theme:l,darkMode:c,darkColor:d=Dr,variants:p,rules:h,hash:m,stringify:f,ignorelist:E,finalize:x}){let S=new Map,b=new Map,k=new Map,$=new Map,P=Uo(E,(T,V)=>V.test(T));p.push(["dark",Array.isArray(c)||c=="class"?`${D(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let F=typeof m=="function"?T=>m(T,Ir):m?Ir:xo;F!==xo&&x.push(T=>({...T,n:T.n&&F(T.n),d:T.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(V,K)=>"--"+F(K).replace("#",""))}));let W={theme:(function({extend:T={},...V}){let K={},bi={get colors(){return Me("colors")},theme:Me,negative(){return{}},breakpoints(R){let H={};for(let Y in R)typeof R[Y]=="string"&&(H["screen-"+Y]=R[Y]);return H}};return Me;function Me(R,H,Y,xt){if(R){if({1:R,2:xt}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(R)||[,R],/[.[]/.test(R)){let me=[];R.replace(/\[([^\]]+)\]|([^.[]+)/g,(Oe,_t,jl=_t)=>me.push(jl)),R=me.shift(),Y=H,H=me.join("-")}let le=K[R]||Object.assign(Object.assign(K[R]={},ir(V,R)),ir(T,R));if(H==null)return le;H||(H="DEFAULT");let De=le[H]??H.split("-").reduce((me,Oe)=>me?.[Oe],le)??Y;return xt?te(De,{opacityValue:hn(xt,Me)}):De}let kt={};for(let le of[...Object.keys(V),...Object.keys(T)])kt[le]=Me(le);return kt}function ir(R,H){let Y=R[H];return typeof Y=="function"&&(Y=Y(bi)),Y&&/color|fill|stroke/i.test(H)?(function xt(kt,le=[]){let De={};for(let me in kt){let Oe=kt[me],_t=[...le,me];De[_t.join("-")]=Oe,me=="DEFAULT"&&(_t=le,De[le.join("-")]=Oe),typeof Oe=="object"&&Object.assign(De,xt(Oe,_t))}return De})(Y):Y}})(l),e:$o,h:F,s(T,V){return f(T,V,W)},d(T,V,K){return d(T,V,W,K)},v(T){return S.has(T)||S.set(T,So(T,p,b,Bc,W)||"&:"+T),S.get(T)},r(T,V){let K=JSON.stringify([T,V]);return k.has(K)||k.set(K,!P(T,W)&&So(T,h,$,Nc,W,V)),k.get(K)},f(T){return x.reduce((V,K)=>K(V,W),T)}};return W})(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=an(c);if(d&&!o.has(d)){o.add(d);let p=To(s,l);e.insert(d,p,l),s.splice(p,0,l)}return c.n}return Object.defineProperties(function(c){if(!n.size)for(let p of D(r.preflight))typeof p=="function"&&(p=p(i)),p&&(typeof p=="string"?fn("",q.b,Tr(p),i,q.b,[],!1,!0):Do(p,{},i,q.b)).forEach(a);c=""+c;let d=n.get(c);if(!d){let p=new Set;for(let h of Ar(Tr(c),i))p.add(h.c).add(a(h));d=[...p].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),p=[...s];return()=>{l(),o=c,n=d,s=p}},clear(){e.clear(),o=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Wc(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function Lo(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&&Wc(o,s=t(o))&&n.setAttribute("class",s)}}function Vc(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 Or(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:Vc(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:Dr}}var Hc=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 jo(t){return Hc.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 qo(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 Gc=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Bo(){return({stringify:t})=>({stringify(e,r,i){let n="",s=jo(e);s&&(n+=t(s,r,i)+";");let o=Fo(e),a=qo(e,r);for(let l of Gc)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 zo(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",mn("lineClamp",({_:t})=>No(t))],["line-clamp-(\\d+)",({1:t})=>No(t)]]}}function No(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",...Z(4,"rem",4,.5,.5),...Z(12,"rem",4,5),14:"3.5rem",...Z(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:I("blur"),backdropBrightness:I("brightness"),backdropContrast:I("contrast"),backdropGrayscale:I("grayscale"),backdropHueRotate:I("hueRotate"),backdropInvert:I("invert"),backdropOpacity:I("opacity"),backdropSaturate:I("saturate"),backdropSepia:I("sepia"),backgroundColor:I("colors"),backgroundImage:{none:"none"},backgroundOpacity:I("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:{...Z(200,"",100,0,50),...Z(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:I("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:I("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:I("colors"),caretColor:I("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...Z(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:I("borderColor"),divideOpacity:I("borderOpacity"),divideWidth:I("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"),...Rt(2,6),...Rt(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:I("spacing"),gradientColorStops:I("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"),...Rt(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...Rt(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:{...Z(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:{...Z(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:I("spacing"),placeholderColor:I("colors"),placeholderOpacity:I("opacity"),outlineColor:I("colors"),outlineOffset:re(8,"px"),outlineWidth:re(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:I("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:Z(200,"",100,0,50),scale:{...Z(150,"",100,0,50),...Z(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:I("spacing"),scrollPadding:I("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...re(2,"deg"),...re(12,"deg",3)},space:I("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:Z(2),textColor:I("colors"),textDecorationColor:I("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...re(8,"px")},textUnderlineOffset:{auto:"auto",...re(8,"px")},textIndent:I("spacing"),textOpacity:I("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:I("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"),...Rt(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:{...Z(50,"",1,0,10),auto:"auto"}};function Rt(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 Z(t,e="",r=1,i=0,n=1,s={}){for(;i<=t;i+=n)s[i]=i/r+e;return s}function I(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, ${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 Ko=[g("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:ue(`[${e}]`,"",r)}}})),g("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),y("aspect-","aspectRatio"),g("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[Mr(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}}}),y("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),g("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),g("box-(border|content)","boxSizing",({1:t})=>t+"-box"),g("hidden",{display:"none"}),g("table-(auto|fixed)","tableLayout"),g(["(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)",g("isolate","isolation"),g("object-(contain|cover|fill|none|scale-down)","objectFit"),y("object-","objectPosition"),g("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Pr),g("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),g("(static|fixed|absolute|relative|sticky)","position"),y("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),y("-?(top|bottom|left|right)(?:$|-)","inset"),g("(visible|collapse)","visibility"),g("invisible",{visibility:"hidden"}),y("-?z-","zIndex"),g("flex-((row|col)(-reverse)?)","flexDirection",Vo),g("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),y("(flex-(?:grow|shrink))(?:$|-)"),y("(flex)-"),y("grow(?:$|-)","flexGrow"),y("shrink(?:$|-)","flexShrink"),y("basis-","flexBasis"),y("-?(order)-"),"-?(order)-(\\d+)",y("grid-cols-","gridTemplateColumns"),g("grid-cols-(\\d+)","gridTemplateColumns",Jo),y("col-","gridColumn"),g("col-(span)-(\\d+)","gridColumn",Xo),y("col-start-","gridColumnStart"),g("col-start-(auto|\\d+)","gridColumnStart"),y("col-end-","gridColumnEnd"),g("col-end-(auto|\\d+)","gridColumnEnd"),y("grid-rows-","gridTemplateRows"),g("grid-rows-(\\d+)","gridTemplateRows",Jo),y("row-","gridRow"),g("row-(span)-(\\d+)","gridRow",Xo),y("row-start-","gridRowStart"),g("row-start-(auto|\\d+)","gridRowStart"),y("row-end-","gridRowEnd"),g("row-end-(auto|\\d+)","gridRowEnd"),g("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>Pr(Vo(t))),g("grid-flow-(dense)","gridAutoFlow"),y("auto-cols-","gridAutoColumns"),y("auto-rows-","gridAutoRows"),y("gap-x(?:$|-)","gap","columnGap"),y("gap-y(?:$|-)","gap","rowGap"),y("gap(?:$|-)","gap"),"(justify-(?:items|self))-",g("justify-","justifyContent",Ho),g("(content|items|self)-",t=>({["align-"+t[1]]:Ho(t)})),g("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),y("p([xytrbl])?(?:$|-)","padding",at("padding")),y("-?m([xytrbl])?(?:$|-)","margin",at("margin")),y("-?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))`}})),g("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),y("w-","width"),y("min-w-","minWidth"),y("max-w-","maxWidth"),y("h-","height"),y("min-h-","minHeight"),y("max-h-","maxHeight"),y("font-","fontWeight"),y("font-","fontFamily",({_:t})=>typeof(t=D(t))[1]=="string"?{fontFamily:ae(t)}:{fontFamily:ae(t[0]),...t[1]}),g("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),g("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),g("italic","fontStyle"),g("not-italic",{fontStyle:"normal"}),g("(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)",...Se({"--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,/*!*/ /*!*/)"})}),y("tracking-","letterSpacing"),y("leading-","lineHeight"),g("list-(inside|outside)","listStylePosition"),y("list-","listStyleType"),g("list-","listStyleType"),y("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),B("placeholder-",{property:"color",selector:"&::placeholder"}),g("text-(left|center|right|justify|start|end)","textAlign"),g("text-(ellipsis|clip)","textOverflow"),y("text-opacity-","textOpacity","--tw-text-opacity"),B("text-",{property:"color"}),y("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),y("indent-","textIndent"),g("(overline|underline|line-through)","textDecorationLine"),g("no-underline",{textDecorationLine:"none"}),y("underline-offset-","textUnderlineOffset"),B("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),y("decoration-","textDecorationThickness"),g("decoration-","textDecorationStyle"),g("(uppercase|lowercase|capitalize)","textTransform"),g("normal-case",{textTransform:"none"}),g("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),g("align-","verticalAlign"),g("whitespace-","whiteSpace"),g("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),g("break-words",{overflowWrap:"break-word"}),g("break-all",{wordBreak:"break-all"}),g("break-keep",{wordBreak:"keep-all"}),B("caret-",{opacityVariable:!1,opacitySection:"opacity"}),B("accent-",{opacityVariable:!1,opacitySection:"opacity"}),g("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${qe(t," ")},var(--tw-gradient-stops))`),B("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)"})),B("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)`})),B("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),g("bg-(fixed|local|scroll)","backgroundAttachment"),g("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),g(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),g("bg-blend-","backgroundBlendMode"),g("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),y("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),B("bg-",{section:"backgroundColor"}),y("bg-","backgroundImage"),y("bg-","backgroundPosition"),g("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Pr),y("bg-","backgroundSize"),y("rounded(?:$|-)","borderRadius"),y("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-${qe(r[0])}-radius`]:e,[`border-${qe(r[1])}-radius`]:e}}),g("border-(collapse|separate)","borderCollapse"),y("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),g("border-(solid|dashed|dotted|double|none)","borderStyle"),y("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...Se({"--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)"})),B("border-([xytrbl])-",{section:"borderColor"},at("border","Color")),B("border-"),y("border-([xytrbl])(?:$|-)","borderWidth",at("border","Width")),y("border(?:$|-)","borderWidth"),y("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),g("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),g("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),y("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${qe(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${qe(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),B("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),y("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),B("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),y("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),g("ring-inset",{"--tw-ring-inset":"inset"}),B("ring-",{property:"--tw-ring-color"}),y("ring(?:$|-)","ringWidth",({_:t},{theme:e})=>({...Se({"--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)"})),B("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),y("shadow(?:$|-)","boxShadow",({_:t})=>({...Se({"--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":ae(t),"--tw-shadow-colored":ae(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)"})),y("(opacity)-"),g("mix-blend-","mixBlendMode"),...Go(),...Go("backdrop-"),y("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:ae(t),transitionTimingFunction:t._=="none"?void 0:ae(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:ae(e("transitionDuration",""))})),y("duration(?:$|-)","transitionDuration","transitionDuration",ae),y("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",ae),y("delay(?:$|-)","transitionDelay","transitionDelay",ae),y("animate(?:$|-)","animation",(t,{theme:e,h:r,e:i})=>{let n=ae(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)",g("transform",bn),g("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":Yo(t=="gpu")})),y("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...bn()})),y("-?(rotate)-","rotate",yn),y("-?(translate-[xy])-","translate",yn),y("-?(skew-[xy])-","skew",yn),g("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Pr),"(appearance)-",y("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",y("(cursor)-"),"(cursor)-",g("snap-(none)","scroll-snap-type"),g("snap-(x|y|both)",({1:t})=>({...Se({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),g("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),g("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),g("snap-(normal|always)","scroll-snap-stop"),g("scroll-(auto|smooth)","scroll-behavior"),y("scroll-p([xytrbl])?(?:$|-)","padding",at("scroll-padding")),y("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",at("scroll-margin")),g("touch-(auto|none|manipulation)","touch-action"),g("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...Se({"--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)"})),g("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),g("outline",{outlineStyle:"solid"}),g("outline-(dashed|dotted|double)","outlineStyle"),y("-?(outline-offset)-"),B("outline-",{opacityVariable:!1,opacitySection:"opacity"}),y("outline-","outlineWidth"),"(pointer-events)-",y("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],g("select-(none|text|all|auto)","userSelect"),B("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),B("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),y("stroke-","strokeWidth"),g("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),g("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Pr(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function Vo(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function qe(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 ae(t){return t&&""+(t._||t)}function Ho({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function at(t,e=""){return({1:r,_:i})=>{let n={x:"lr",y:"tb"}[r]||r+r;return n?{...Ut(t+"-"+qe(n[0])+e,i),...Ut(t+"-"+qe(n[1])+e,i)}:Ut(t+e,i)}}function Go(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={...Se(r),[`${t}filter`]:e.map(i=>`var(--tw-${t}${i})`).join(" ")},[`(${t}filter)-(none)`,g(`${t}filter`,r),...e.map(i=>y(`${i[0]=="h"?"-?":""}(${t}${i})(?:$|-)`,i,({1:n,_:s})=>({[`--tw-${n}`]:D(s).map(o=>`${i}(${o})`).join(" "),...r})))]}function yn({1:t,_:e}){return{["--tw-"+t]:e,...bn()}}function bn(){return{...Se({"--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":Yo()}),transform:"var(--tw-transform)"}}function Yo(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 Jo({1:t}){return`repeat(${t},minmax(0,1fr))`}function Se(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var Qo=[["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)||ue(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=ot(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)||ue(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)||ue(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=ue(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&ot(t).replace(/[}]+$/,"").split("{")]];function Zo({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:Wo,theme:{...Lt,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:Qo,rules:Ko,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 Xc={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Jc={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Kc={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Yc={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Qc={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},Zc={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},eu={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},tu={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},ru={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},iu={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},nu={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},su={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},ou={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},au={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},lu={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},cu={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},uu={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},du={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},pu={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},hu={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},fu={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},mu={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},ea={__proto__:null,slate:Xc,gray:Jc,zinc:Kc,neutral:Yc,stone:Qc,red:Zc,orange:eu,amber:tu,yellow:ru,lime:iu,green:nu,emerald:su,teal:ou,cyan:au,sky:lu,blue:cu,indigo:uu,violet:du,purple:pu,fuchsia:hu,pink:fu,rose:mu};function ta({disablePreflight:t}={}){return Zo({colors:ea,disablePreflight:t})}function na({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)=>sa(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=ia(o.theme("fontSize",s));return a&&{"@layer components":a}}],[t+"-",({$$:s},o)=>n(s,o)],[t,(s,o)=>({...n(e,o),"@layer base":[ra(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:_(20,16),marginBottom:_(20,16),paddingLeft:_(26,16)},li:{marginTop:_(8,16),marginBottom:_(8,16)},"ol>li,ul>li":{paddingLeft:_(6,16)},">ul>li p":{marginTop:_(12,16),marginBottom:_(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:_(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:_(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:_(12,16),marginBottom:_(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:_(48,16),marginBottom:_(48,16)},blockquote:{marginTop:_(32,20),marginBottom:_(32,20),paddingLeft:_(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:_(20,16),marginBottom:_(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:_(36,16),marginTop:"0",marginBottom:_(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:_(24,16),marginTop:_(48,24),marginBottom:_(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:_(20,16),marginTop:_(32,20),marginBottom:_(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:_(24,16),marginBottom:_(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:_(32,16),marginBottom:_(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:_(14,16),lineHeight:"1.4",marginTop:_(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:_(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:_(21,24)},"h3 code":{fontSize:_(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:_(14,16),lineHeight:"1.7",marginTop:_(24,14),marginBottom:_(24,14),borderRadius:"0.375rem",paddingTop:_(12,14),paddingRight:_(16,14),paddingBottom:_(12,14),paddingLeft:_(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:_(32,16),marginBottom:_(32,16),fontSize:_(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:_(8,14),paddingBottom:_(8,14),paddingLeft:_(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:_(8,14),paddingRight:_(8,14),paddingBottom:_(8,14),paddingLeft:_(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:_(20,16),lineHeight:"1.6",marginTop:_(24,20),marginBottom:_(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),ra(t,o,r)],"@layer components":{...ia(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,o){let a={},l={},c=(d,p,h)=>{let m=o.theme(`colors.${s}.${p}`,p);h["--tw-prose-"+d]=te(m);let f=h!=l&&o.d("colors",`${s}-${p}`,m);f&&(l["--tw-prose-"+d]=te(f))};for(let d in i){let p=i[d];d!="dark"&&p&&c(d,p,a)}for(let d in i.dark||{}){let p=i.dark[d];p&&(i.dark?c("invert-"+d,p,a):c(d,p,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function ra(t,e,r){let i={};for(let n in r)i[sa(t,n,e,s=>`.${e.e(e.h(t))}${s}`)]=r[n];return i}function sa(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 ia(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function _(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var vn=gn({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:[ta(),Bo(),zo(),na()]});function oa(t,e=!0){let r=(function(){if(gu)try{let l=Or(new CSSStyleSheet);return l.connect=c=>{let d=wn(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,l.target]},l.disconnect=Dr,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Or(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 p=this.target.cssRules[c];o.forEach((h,m)=>m&&h.target.insertRule(p.cssText,c))},resume(l,c){return o[0].resume(l,c)},connect(l){let c=document.createElement("style");wn(l).appendChild(c);let d=Or(c),{cssRules:p}=this.target;for(let h=0;h<p.length;h++)d.target.insertRule(p[h].cssText,h);o.push(d),a.set(l,d)},disconnect(l){let c=o.indexOf(a.get(l));c>=0&&o.splice(c,1)}}})(),i=Ro({...t,hash:t.hash??e},r),n=Lo(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),n.observe(wn(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var gu=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function wn(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var w=t=>oa(vn)(t);var xn=class extends w(v){static properties={color:{type:String},radius:{type:String},size:{type:String},border:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=O`
|
|
149
149
|
:host {
|
|
150
150
|
display: block;
|
|
151
151
|
}
|
|
@@ -248,7 +248,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
248
248
|
</button>
|
|
249
249
|
</mw-spinning-border>
|
|
250
250
|
</div>
|
|
251
|
-
`};customElements.get("mw-bubble")||customElements.define("mw-bubble",kn);var
|
|
251
|
+
`};customElements.get("mw-bubble")||customElements.define("mw-bubble",kn);var Ur={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Rr=t=>(...e)=>({_$litDirective$:t,values:e}),lt=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:yu}=Bs,aa=t=>t;var la=()=>document.createComment(""),ct=(t,e,r)=>{let i=t._$AA.parentNode,n=e===void 0?t._$AB:e._$AA;if(r===void 0){let s=i.insertBefore(la(),n),o=i.insertBefore(la(),n);r=new yu(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=aa(l).nextSibling;aa(i).insertBefore(l,n),l=c}}}return r},$e=(t,e,r=t)=>(t._$AI(e,r),t),bu={},ca=(t,e=bu)=>t._$AH=e,ua=t=>t._$AH,Lr=t=>{t._$AR(),t._$AA.remove()};var da=(t,e,r)=>{let i=new Map;for(let n=e;n<=r;n++)i.set(t[n],n);return i},J=Rr(class extends lt{constructor(t){if(super(t),t.type!==Ur.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=ua(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,p=0,h=n.length-1,m=0,f=s.length-1;for(;p<=h&&m<=f;)if(n[p]===null)p++;else if(n[h]===null)h--;else if(a[p]===o[m])l[m]=$e(n[p],s[m]),p++,m++;else if(a[h]===o[f])l[f]=$e(n[h],s[f]),h--,f--;else if(a[p]===o[f])l[f]=$e(n[p],s[f]),ct(t,l[f+1],n[p]),p++,f--;else if(a[h]===o[m])l[m]=$e(n[h],s[m]),ct(t,n[p],n[h]),h--,m++;else if(c===void 0&&(c=da(o,m,f),d=da(a,p,h)),c.has(a[p]))if(c.has(a[h])){let E=d.get(o[m]),x=E!==void 0?n[E]:null;if(x===null){let S=ct(t,n[p]);$e(S,s[m]),l[m]=S}else l[m]=$e(x,s[m]),ct(t,n[p],x),n[E]=null;m++}else Lr(n[h]),h--;else Lr(n[p]),p++;for(;m<=f;){let E=ct(t,l[f+1]);$e(E,s[m]),l[m++]=E}for(;p<=h;){let E=n[p++];E!==null&&Lr(E)}return this.ut=o,ca(t,l),se}});var jt=class t extends w(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`
|
|
252
252
|
<div class="${this.darkMode?"dark":""} flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pt-6 pb-2">
|
|
253
253
|
${this.examples.title?u`
|
|
254
254
|
<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">
|
|
@@ -257,7 +257,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
257
257
|
`:null}
|
|
258
258
|
${this.examples?.items?.length?u`
|
|
259
259
|
<ul class="mt-auto flex flex-wrap justify-end gap-2.5 text-sm leading-6 text-black select-none dark:text-white">
|
|
260
|
-
${
|
|
260
|
+
${J(this.examples.items,e=>e,e=>u`
|
|
261
261
|
<li
|
|
262
262
|
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"
|
|
263
263
|
@click="${()=>this.#e(e)}">
|
|
@@ -329,7 +329,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
329
329
|
</div>
|
|
330
330
|
</div>
|
|
331
331
|
</div>
|
|
332
|
-
`}#e(){this.dispatchEvent(new t.NewChatClickEvent)}#t(){this.dispatchEvent(new t.ExpandClickEvent)}#r(){this.dispatchEvent(new t.CloseClickEvent)}};be.NewChatClickEvent=class extends CustomEvent{static type="mw:new-chat-click";constructor(e={}){super(be.NewChatClickEvent.type,{...e})}};be.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(be.ExpandClickEvent.type,{...e})}};be.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(be.CloseClickEvent.type,{...e})}};customElements.get("mw-chat-header")||customElements.define("mw-chat-header",be);var Ft=class{#e;#t;constructor(e,r){this.#t=r,e.addController(this)}request(){this.cancel(),this.#e=requestAnimationFrame(this.#t)}cancel(){this.#e!==void 0&&(cancelAnimationFrame(this.#e),this.#e=void 0)}get pending(){return this.#e!==void 0}hostDisconnected(){this.cancel()}};function
|
|
332
|
+
`}#e(){this.dispatchEvent(new t.NewChatClickEvent)}#t(){this.dispatchEvent(new t.ExpandClickEvent)}#r(){this.dispatchEvent(new t.CloseClickEvent)}};be.NewChatClickEvent=class extends CustomEvent{static type="mw:new-chat-click";constructor(e={}){super(be.NewChatClickEvent.type,{...e})}};be.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(be.ExpandClickEvent.type,{...e})}};be.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(be.CloseClickEvent.type,{...e})}};customElements.get("mw-chat-header")||customElements.define("mw-chat-header",be);var Ft=class{#e;#t;constructor(e,r){this.#t=r,e.addController(this)}request(){this.cancel(),this.#e=requestAnimationFrame(this.#t)}cancel(){this.#e!==void 0&&(cancelAnimationFrame(this.#e),this.#e=void 0)}get pending(){return this.#e!==void 0}hostDisconnected(){this.cancel()}};function pa(t,e){return new Ft(t,e)}var jr=2,vu=2,wu=1.5,xu=30,ku=1e3/xu,Be=class t extends w(v){static properties={color:{type:String},isTranscribing:{type:Boolean,attribute:"is-transcribing"},voiceController:{attribute:!1},_timerText:{type:String,state:!0}};#e=0;#t=[];#r=0;#i=null;#n=e=>{if(this.#s.request(),e-this.#e<ku)return;this.#e=e;let r=this.voiceController?.frequencyBinCount??0;r>0&&(!this.#i||this.#i.length!==r)&&(this.#i=new Uint8Array(r));let i=this.#i,n=r>0&&i!==null&&this.voiceController?.getFrequencyData(i)===!0,s=this.voiceController?.getElapsedMs()??0,o=Math.floor(s/1e3),a=Math.floor(o/60),l=o%60;this._timerText=`${a}:${String(l).padStart(2,"0")}`,this.#l(n?this.#i:null)};#s=new Ft(this,this.#n);constructor(){super(),this.color="#8B5CF6",this.isTranscribing=!1,this.voiceController=null,this._timerText="0:00"}render(){return u`
|
|
333
333
|
<div class="flex w-full items-center gap-2 px-3 py-3">
|
|
334
334
|
<!-- cancel button -->
|
|
335
335
|
<button
|
|
@@ -358,7 +358,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
358
358
|
${this.isTranscribing?u`<mw-icon name="lucide:loader-circle" class="h-4 w-4 animate-spin text-white dark:text-gray-800"></mw-icon>`:u`<mw-icon name="lucide:check" class="h-4 w-4 text-white dark:text-gray-800"></mw-icon>`}
|
|
359
359
|
</button>
|
|
360
360
|
</div>
|
|
361
|
-
`}connectedCallback(){super.connectedCallback(),this.isTranscribing||this.#a()}updated(e){e.has("isTranscribing")&&(this.isTranscribing?(this.#o(),this.#l(null)):this.#a())}#a(){this.#e=0,this.#s.request()}#o(){this.#s.cancel()}#l(e){let r=this.renderRoot.querySelector("canvas");if(!r)return;let i=r.getContext("2d");if(!i)return;let n=r.getBoundingClientRect(),s=window.devicePixelRatio||1;(r.width!==n.width*s||r.height!==n.height*s)&&(r.width=n.width*s,r.height=n.height*s,i.scale(s,s));let o=n.width,a=n.height,l=3;this.#r=Math.floor((o+jr)/(l+jr));let c=0;if(e&&e.length>0){let h=0;for(let m=0;m<e.length;m++){let f=e[m]/255;h+=f*f}c=Math.min(Math.pow(Math.sqrt(h/e.length)*2.5,1.4),1)}this.#t.push(c),this.#t.length>this.#r&&this.#t.splice(0,this.#t.length-this.#r),i.clearRect(0,0,o,a);let d=a-4,p=this.#t.length;for(let h=0;h<p;h++){let m=this.#t[h],f=Math.max(m*d,hu),E=o-(p-h)*(l+jr)+jr,x=(a-f)/2;i.fillStyle=this.isTranscribing?"#9CA3AF":this.color,i.globalAlpha=this.isTranscribing?.4:.6,i.beginPath(),i.roundRect(E,x,l,f,fu),i.fill()}i.globalAlpha=1}#c(){this.dispatchEvent(new t.CancelEvent)}#u(){this.isTranscribing||this.dispatchEvent(new t.ApproveEvent)}};Be.CancelEvent=class extends CustomEvent{static type="mw-voice-waveform-bar:cancel";constructor(e={}){super(Be.CancelEvent.type,{bubbles:!0,composed:!0,...e})}};Be.ApproveEvent=class extends CustomEvent{static type="mw-voice-waveform-bar:approve";constructor(e={}){super(Be.ApproveEvent.type,{bubbles:!0,composed:!0,...e})}};customElements.get("mw-voice-waveform-bar")||customElements.define("mw-voice-waveform-bar",Be);function ua(t){let e=new FormData;for(let[r,i]of Object.entries(t))i!=null&&(i instanceof Blob?e.append(r,i):e.append(r,String(i)));return e}function yu(t){if(!t||typeof t!="string")return{mimeType:"",parameters:{}};let e=t.split(";"),r=e[0].trim().toLowerCase(),i={};for(let n=1;n<e.length;n++){let s=e[n].trim(),o=s.indexOf("=");if(o>0){let a=s.substring(0,o).trim().toLowerCase(),l=s.substring(o+1).trim();(l.startsWith('"')&&l.endsWith('"')||l.startsWith("'")&&l.endsWith("'"))&&(l=l.slice(1,-1)),i[a]=l}}return{mimeType:r,parameters:i}}function da(t){if(!t)return!1;for(let e of t.split(",")){let{mimeType:r}=yu(e);if(r==="text/html"||r==="application/xhtml+xml")return!0}return!1}var qt=class extends Error{constructor(e,r,i,n){super(),this.name=this.constructor.name,this.message=e,this.type=r,this.code=i,this.responseBody=n}},_n=class{#e;#t;constructor(e,r,{fetch:i,headers:n}={}){this.baseUrl=e,this.path=r,this.#e=i,this.#t=n}GET({query:e,params:r,headers:i,signal:n}={}){return this.#i(this.#r(this.path,r),"GET",{query:e,headers:i,signal:n})}POST({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#i(this.#r(this.path,r),"POST",{query:e,body:i,formData:n,headers:s,signal:o})}PUT({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#i(this.#r(this.path,r),"PUT",{query:e,body:i,formData:n,headers:s,signal:o})}PATCH({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#i(this.#r(this.path,r),"PATCH",{query:e,body:i,formData:n,headers:s,signal:o})}DELETE({query:e,params:r,headers:i,signal:n}={}){return this.#i(this.#r(this.path,r),"DELETE",{query:e,headers:i,signal:n})}#r(e,r){if(!r)return e;let i=e;for(let[n,s]of Object.entries(r))i=i.replace(`:${n}`,encodeURIComponent(s.toString()));return i}async#i(e,r,{query:i,body:n,formData:s,headers:o,signal:a}){let l=new URL(e,this.baseUrl);i&&(l.search=eo(i).toString());let c=new Headers(this.#t);if(o)for(let[p,h]of new Headers(o))c.set(p,h);s||n instanceof URLSearchParams||n instanceof FormData||n instanceof Blob||n instanceof ArrayBuffer||n instanceof ReadableStream||c.set("Content-Type","application/json");let d=await(this.#e??fetch)(l,{method:r,headers:c,body:c.get("Content-Type")==="application/json"?JSON.stringify(n):(s?ua(s):null)||n,signal:a});if(!d.ok){let p="";try{p=await d.text().then(h=>h.substring(0,1e3))}catch(h){p=h?.toString()??""}throw da(d.headers.get("Content-Type"))?new qt(`Received HTML instead of JSON (HTTP ${d.status})`,"HTTP",d.status,p):new qt(p,"HTTP",d.status)}if(d.status!==204){if(d.headers.get("Content-Type")?.startsWith("application/json"))return d.json();throw new qt("Response content type is not JSON and we do not handle others yet","HTTP",d.status)}}};function Fr(t,{fetch:e,headers:r}={}){let i={baseUrl:t};return new Proxy(i,{get(s,o){if(typeof o!="string"||!o.startsWith("/"))return;let a=o;return new _n(s.baseUrl,a,{fetch:e,headers:r})}})}async function pa(t,e,r){let i=e.map((c,d)=>({index:d,item:c})),n=async c=>{let d=[];for(;;){let p=i.pop();if(!p)return c(d);try{let h=await r(p.item);d.push({error:null,result:h,index:p.index})}catch(h){d.push({error:h,result:void 0,index:p.index})}}},s=Array.from({length:t},()=>new Promise(n)),a=(await Promise.all(s)).flat().sort((c,d)=>c.index-d.index),l=a.filter(c=>c.error);if(l.length>0)throw new AggregateError(l.map(c=>c.error));return a.map(c=>c.result)}var ya=vi(ga(),1);var $n=(t,e)=>{let r=t.reduce((i,n)=>{let s=e?e(n):n;return i[s]||(i[s]=n),i},{});return Object.values(r)};var In=({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};var pe=Object.freeze({pending_upload:"pending_upload",uploaded:"uploaded",errored:"errored"}),Nr=class{#e;#t;#r=!1;#i=!1;#n=null;#s=null;#a=null;#o=[];constructor(e,{acceptedTypes:r,maxFileSize:i,maxFileCount:n,canAcceptFiles:s,onFilesAdded:o,onFileDelete:a,onFileUpload:l,onError:c}){this.#e=e,this.#t={acceptedTypes:r,maxFileSize:i,maxFileCount:n,canAcceptFiles:s,onFilesAdded:o,onFileDelete:a,onFileUpload:l,onError:c},e.addController(this)}hostConnected(){this.#p()}hostDisconnected(){this.#c(),this.#d(),this.#a&&(clearTimeout(this.#a),this.#a=null),this.#n&&this.#n.parentNode&&this.#n.parentNode.removeChild(this.#n),this.#n=null}#l(){this.#c(),this.#e.addEventListener("dragover",this.#h),this.#e.addEventListener("dragenter",this.#m),this.#e.addEventListener("dragleave",this.#f),this.#e.addEventListener("drop",this.#k)}#c(){this.#e.removeEventListener("dragover",this.#h),this.#e.removeEventListener("dragenter",this.#m),this.#e.removeEventListener("dragleave",this.#f),this.#e.removeEventListener("drop",this.#k)}#u(){this.#d(),this.#e.addEventListener("paste",this.#_)}#d(){this.#e.removeEventListener("paste",this.#_)}#p(){this.#n||(this.#n=document.createElement("input"),this.#n.type="file",this.#n.accept=this.#t.acceptedTypes?.join(",")??"",this.#n.multiple=this.#t.maxFileCount>1,this.#n.style.display="none",this.#n.addEventListener("change",this.#w),document.body.appendChild(this.#n))}#w=e=>{if(e.target instanceof HTMLInputElement){let r=e.target,i=Array.from(r.files||[]);this.#v(i),r.value=""}};#h=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")};#m=e=>{e.preventDefault(),e.dataTransfer&&this.#E(e.dataTransfer)&&this.#x(!0)};#f=e=>{if(e.preventDefault(),e.relatedTarget instanceof Node){let r=e.relatedTarget;this.#e.contains(r)||this.#x(!1)}};#k=e=>{if(e.preventDefault(),this.#x(!1),e.dataTransfer){let r=Array.from(e.dataTransfer.files||[]);this.#v(r)}};#_=e=>{if(!e.clipboardData)return;let i=Array.from(e.clipboardData.items||[]).filter(s=>s.kind==="file");if(i.length===0)return;e.preventDefault();let n=i.map(s=>s.getAsFile()).flatMap(s=>s?[s]:[]);this.#v(n)};#E(e){return e.types&&e.types.includes("Files")}#x(e){this.#i!==e&&(this.#i=e,this.#e.requestUpdate())}#g(e){this.#s=e,this.#t.onError?.(e),this.#e.requestUpdate(),this.#a&&clearTimeout(this.#a),this.#a=setTimeout(()=>{this.#y()},6e3)}#y(){this.#a&&(clearTimeout(this.#a),this.#a=null),this.#s=null,this.#e.requestUpdate()}async#v(e){if(e.length===0||this.#t.canAcceptFiles?.()===!1)return;this.#t.onFilesAdded?.(),this.#y();let r=e.filter(o=>this.#S(o));if(r.length===0)return;let i=this.#o.length,n=this.#t.maxFileCount??1/0,s=r.length;if(i+s>n){this.#g(`You can upload a maximum of ${n} files`);return}try{let o=await Promise.all(r.map(l=>this.#$(l))),a=$n(o,l=>l.dataUrl);this.#o=[...this.#o,...a],this.#e.requestUpdate(),await pa(3,a,l=>fr({times:5,backoff:c=>c*3e3},()=>this.#I(l))),this.#e.requestUpdate()}catch(o){console.error("Failed to process and upload files:",o),this.#g("Upload failed")}}#S(e){return this.#t.acceptedTypes&&!this.#t.acceptedTypes.includes(e.type)?(this.#g("Invalid file type"),!1):e.size>this.#t.maxFileSize?(this.#g(`Max file size: ${this.#t.maxFileSize/(1024*1024)}MB`),!1):!0}async#$(e){try{let r=await(0,ya.fileToBase64)(e);return{id:crypto.randomUUID(),name:e.name,type:e.type,size:e.size,dataUrl:r,file:e,processingState:pe.pending_upload}}catch(r){let i=r instanceof Error?r:new Error(String(r));throw new Error(`Failed to read file: ${e.name} - ${i.message}`)}}async#I(e){if(!e){console.error("No file provided to upload"),this.#g("No file provided");return}e.processingState=pe.pending_upload,this.#e.requestUpdate();try{let r=await this.#t.onFileUpload(e);e.publicUrl=r.publicUrl,e.processingState=pe.uploaded,this.#e.requestUpdate()}catch(r){console.error("Upload error:",r),this.#g("Upload failed"),e.processingState=pe.errored,this.#e.requestUpdate()}}get isDragging(){return this.#i}get error(){return this.#s}get selectedFiles(){return this.#o}get hasPendingFiles(){return this.#o.some(e=>e.processingState===pe.pending_upload)}openFilePicker=()=>{if(!this.#r){console.warn("File uploads are disabled");return}this.#n&&this.#n.click()};clearError(){this.#y()}clearFiles(){this.#o=[],this.clearError(),this.#e.requestUpdate()}setEnabled(e){this.#r!==e&&(this.#r=e,this.#r?(this.#l(),this.#u()):(this.#c(),this.#d()))}restoreFiles(e){this.#o=e,this.#e.requestUpdate()}deleteFile=e=>{this.#t.onFileDelete?.(e),this.#o=this.#o.filter(r=>r.id!==e),this.#y(),this.#e.requestUpdate()}};var zr=class{#e;#t=null;#r=null;#i=null;#n=null;#s=[];#a=0;#o="";isSupported=typeof navigator<"u"&&!!navigator.mediaDevices?.getUserMedia&&typeof MediaRecorder<"u";isRecording=!1;constructor(e){this.#e=e,e.addController(this)}async start(){if(this.isRecording)return;this.#t=await navigator.mediaDevices.getUserMedia({audio:!0}),this.#i=new AudioContext;let e=this.#i.createMediaStreamSource(this.#t);this.#n=this.#i.createAnalyser(),this.#n.fftSize=256,e.connect(this.#n),this.#o=Du(),this.#s=[],this.#r=new MediaRecorder(this.#t,{mimeType:this.#o}),this.#r.ondataavailable=r=>{r.data.size>0&&this.#s.push(r.data)},this.#r.start(),this.#a=performance.now(),this.isRecording=!0,this.#e.requestUpdate()}async stop(){if(!this.#r||this.#r.state!=="recording")throw new Error("not recording");let e=Math.round(performance.now()-this.#a),r=await new Promise(i=>{if(!this.#r)throw new Error("recorder unexpectedly null");this.#r.onstop=()=>{i(new Blob(this.#s,{type:this.#o}))},this.#r.stop()});return this.#l(),{audioBlob:r,durationMs:e,mimeType:this.#o}}cancel(){this.#r&&this.#r.state==="recording"&&this.#r.stop(),this.#l()}get frequencyBinCount(){return this.#n?.frequencyBinCount??0}getFrequencyData(e){return this.#n?(this.#n.getByteFrequencyData(e),!0):!1}getElapsedMs(){return this.isRecording?Math.round(performance.now()-this.#a):0}#l(){if(this.#t){for(let e of this.#t.getTracks())e.stop();this.#t=null}this.#i&&(this.#i.close(),this.#i=null),this.#n=null,this.#r=null,this.#s=[],this.isRecording=!1,this.#e.requestUpdate()}hostDisconnected(){this.cancel()}};function Du(){return MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":MediaRecorder.isTypeSupported("audio/mp4")?"audio/mp4":"audio/webm"}var Ou=500,dt=Object.freeze({PERMISSION_DENIED:"Microphone access denied, check your browser settings",START_FAILED:"Couldn't start recording",TOO_SHORT:"Recording too short",EMPTY_TRANSCRIPTION:"Couldn't catch that, try again",CONNECTION_ERROR:"Connection error, try again",TRANSCRIPTION_FAILED:"Couldn't transcribe, try again"}),ie=class t{#e;#t;#r;isTranscribing=!1;constructor(e,{voiceAPI:r,audioCaptureCtrl:i}){this.#e=e,this.#t=r,this.#r=i??new zr(e),e.addController(this)}get isSupported(){return this.#r.isSupported}get isRecording(){return this.#r.isRecording}async start(){try{await this.#r.start(),this.#e.dispatchEvent(new t.RecordingStartedEvent)}catch(e){let r=e instanceof DOMException&&e.name==="NotAllowedError";this.#e.dispatchEvent(new t.ErrorEvent({message:r?dt.PERMISSION_DENIED:dt.START_FAILED,code:r?"permission_denied":"start_failed"}))}}cancel(){this.#r.cancel(),this.isTranscribing=!1,this.#e.requestUpdate()}async approve(){try{let e=await this.#r.stop();if(this.#e.dispatchEvent(new t.RecordingCompletedEvent({durationMs:e.durationMs})),e.durationMs<Ou){this.#e.dispatchEvent(new t.ErrorEvent({message:dt.TOO_SHORT,code:"too_short"}));return}this.isTranscribing=!0,this.#e.requestUpdate();let r=await this.#i(e.audioBlob,e.mimeType);if(this.isTranscribing=!1,this.#e.requestUpdate(),!r.text){this.#e.dispatchEvent(new t.ErrorEvent({message:dt.EMPTY_TRANSCRIPTION,code:"empty_transcription"}));return}this.#e.dispatchEvent(new t.TranscribedEvent({text:r.text,language:r.language,processingMs:r.processingMs,durationMs:e.durationMs}))}catch(e){this.isTranscribing=!1,this.#e.requestUpdate();let r=e instanceof TypeError;this.#e.dispatchEvent(new t.ErrorEvent({message:r?dt.CONNECTION_ERROR:dt.TRANSCRIPTION_FAILED,code:r?"connection_error":"transcription_failed"}))}}get frequencyBinCount(){return this.#r.frequencyBinCount}getFrequencyData(e){return this.#r.getFrequencyData(e)}getElapsedMs(){return this.#r.getElapsedMs()}async#i(e,r){let i=r.includes("mp4")?"m4a":"webm";return await this.#t["/widgets/voice/transcribe"].POST({formData:{audio:new File([e],`recording.${i}`,{type:e.type}),widgetId:this.#e.widgetId}})}hostDisconnected(){this.#r.cancel(),this.isTranscribing=!1}};ie.RecordingStartedEvent=class extends CustomEvent{static type="mw:voice-recording-started";constructor(e={}){super(ie.RecordingStartedEvent.type,{bubbles:!0,composed:!0,...e})}};ie.RecordingCompletedEvent=class extends CustomEvent{static type="mw:voice-recording-completed";constructor(e,r={}){super(ie.RecordingCompletedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};ie.TranscribedEvent=class extends CustomEvent{static type="mw:voice-transcribed";constructor(e,r={}){super(ie.TranscribedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};ie.ErrorEvent=class extends CustomEvent{static type="mw:voice-error";constructor(e,r={}){super(ie.ErrorEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};var Wr=Object.freeze({maxHeight:120,initialHeight:32,paddingY:12}),ee=class t extends w(v){static properties={disabled:{type:Boolean},streaming:{type:Boolean},loading:{type:Boolean},placeholder:{type:String},color:{type:String},enableFileUpload:{type:Boolean},darkMode:{type:Boolean,attribute:"dark-mode"},widgetId:{type:String,attribute:"widget-id"},cdnBaseUrl:{type:String,attribute:"cdn-base-url"},files:{type:Array}};#e=new Date;constructor(){super(),this.disabled=!1,this.streaming=!1,this.loading=!1,this.placeholder="Type a message...",this.color="#8B5CF6",this.enableFileUpload=!1,this.darkMode=!1,this.widgetId="",this.cdnBaseUrl="",this.files=[]}#t=null;get voiceEnabled(){return this.#t?.isSupported??!1}get value(){return this.#r?.value?.trim()??""}updated(e){(e.has("widgetId")||e.has("cdnBaseUrl"))&&this.widgetId&&this.cdnBaseUrl&&!this.#t&&(this.#t=new ie(this,{voiceAPI:Fr(this.cdnBaseUrl)}))}render(){let e=this.#t?.isRecording??!1,r=this.#t?.isTranscribing??!1,i=this.streaming||this.loading||!this.value&&(!this.enableFileUpload||this.files.length===0),n=this.voiceEnabled&&!this.value&&!this.streaming&&!this.loading&&!e&&!r;return u`
|
|
361
|
+
`}connectedCallback(){super.connectedCallback(),this.isTranscribing||this.#a()}updated(e){e.has("isTranscribing")&&(this.isTranscribing?(this.#o(),this.#l(null)):this.#a())}#a(){this.#e=0,this.#s.request()}#o(){this.#s.cancel()}#l(e){let r=this.renderRoot.querySelector("canvas");if(!r)return;let i=r.getContext("2d");if(!i)return;let n=r.getBoundingClientRect(),s=window.devicePixelRatio||1;(r.width!==n.width*s||r.height!==n.height*s)&&(r.width=n.width*s,r.height=n.height*s,i.scale(s,s));let o=n.width,a=n.height,l=3;this.#r=Math.floor((o+jr)/(l+jr));let c=0;if(e&&e.length>0){let h=0;for(let m=0;m<e.length;m++){let f=e[m]/255;h+=f*f}c=Math.min(Math.pow(Math.sqrt(h/e.length)*2.5,1.4),1)}this.#t.push(c),this.#t.length>this.#r&&this.#t.splice(0,this.#t.length-this.#r),i.clearRect(0,0,o,a);let d=a-4,p=this.#t.length;for(let h=0;h<p;h++){let m=this.#t[h],f=Math.max(m*d,vu),E=o-(p-h)*(l+jr)+jr,x=(a-f)/2;i.fillStyle=this.isTranscribing?"#9CA3AF":this.color,i.globalAlpha=this.isTranscribing?.4:.6,i.beginPath(),i.roundRect(E,x,l,f,wu),i.fill()}i.globalAlpha=1}#c(){this.dispatchEvent(new t.CancelEvent)}#u(){this.isTranscribing||this.dispatchEvent(new t.ApproveEvent)}};Be.CancelEvent=class extends CustomEvent{static type="mw-voice-waveform-bar:cancel";constructor(e={}){super(Be.CancelEvent.type,{bubbles:!0,composed:!0,...e})}};Be.ApproveEvent=class extends CustomEvent{static type="mw-voice-waveform-bar:approve";constructor(e={}){super(Be.ApproveEvent.type,{bubbles:!0,composed:!0,...e})}};customElements.get("mw-voice-waveform-bar")||customElements.define("mw-voice-waveform-bar",Be);function ha(t){let e=new FormData;for(let[r,i]of Object.entries(t))i!=null&&(i instanceof Blob?e.append(r,i):e.append(r,String(i)));return e}function _u(t){if(!t||typeof t!="string")return{mimeType:"",parameters:{}};let e=t.split(";"),r=e[0].trim().toLowerCase(),i={};for(let n=1;n<e.length;n++){let s=e[n].trim(),o=s.indexOf("=");if(o>0){let a=s.substring(0,o).trim().toLowerCase(),l=s.substring(o+1).trim();(l.startsWith('"')&&l.endsWith('"')||l.startsWith("'")&&l.endsWith("'"))&&(l=l.slice(1,-1)),i[a]=l}}return{mimeType:r,parameters:i}}function fa(t){if(!t)return!1;for(let e of t.split(",")){let{mimeType:r}=_u(e);if(r==="text/html"||r==="application/xhtml+xml")return!0}return!1}var qt=class extends Error{constructor(e,r,i,n){super(),this.name=this.constructor.name,this.message=e,this.type=r,this.code=i,this.responseBody=n}},_n=class{#e;#t;constructor(e,r,{fetch:i,headers:n}={}){this.baseUrl=e,this.path=r,this.#e=i,this.#t=n}GET({query:e,params:r,headers:i,signal:n}={}){return this.#i(this.#r(this.path,r),"GET",{query:e,headers:i,signal:n})}POST({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#i(this.#r(this.path,r),"POST",{query:e,body:i,formData:n,headers:s,signal:o})}PUT({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#i(this.#r(this.path,r),"PUT",{query:e,body:i,formData:n,headers:s,signal:o})}PATCH({query:e,params:r,body:i,formData:n,headers:s,signal:o}={}){return this.#i(this.#r(this.path,r),"PATCH",{query:e,body:i,formData:n,headers:s,signal:o})}DELETE({query:e,params:r,headers:i,signal:n}={}){return this.#i(this.#r(this.path,r),"DELETE",{query:e,headers:i,signal:n})}#r(e,r){if(!r)return e;let i=e;for(let[n,s]of Object.entries(r))i=i.replace(`:${n}`,encodeURIComponent(s.toString()));return i}async#i(e,r,{query:i,body:n,formData:s,headers:o,signal:a}){let l=new URL(e,this.baseUrl);i&&(l.search=io(i).toString());let c=new Headers(this.#t);if(o)for(let[p,h]of new Headers(o))c.set(p,h);s||n instanceof URLSearchParams||n instanceof FormData||n instanceof Blob||n instanceof ArrayBuffer||n instanceof ReadableStream||c.set("Content-Type","application/json");let d=await(this.#e??fetch)(l,{method:r,headers:c,body:c.get("Content-Type")==="application/json"?JSON.stringify(n):(s?ha(s):null)||n,signal:a});if(!d.ok){let p="";try{p=await d.text().then(h=>h.substring(0,1e3))}catch(h){p=h?.toString()??""}throw fa(d.headers.get("Content-Type"))?new qt(`Received HTML instead of JSON (HTTP ${d.status})`,"HTTP",d.status,p):new qt(p,"HTTP",d.status)}if(d.status!==204){if(d.headers.get("Content-Type")?.startsWith("application/json"))return d.json();throw new qt("Response content type is not JSON and we do not handle others yet","HTTP",d.status)}}};function Fr(t,{fetch:e,headers:r}={}){let i={baseUrl:t};return new Proxy(i,{get(s,o){if(typeof o!="string"||!o.startsWith("/"))return;let a=o;return new _n(s.baseUrl,a,{fetch:e,headers:r})}})}async function ma(t,e,r){let i=e.map((c,d)=>({index:d,item:c})),n=async c=>{let d=[];for(;;){let p=i.pop();if(!p)return c(d);try{let h=await r(p.item);d.push({error:null,result:h,index:p.index})}catch(h){d.push({error:h,result:void 0,index:p.index})}}},s=Array.from({length:t},()=>new Promise(n)),a=(await Promise.all(s)).flat().sort((c,d)=>c.index-d.index),l=a.filter(c=>c.error);if(l.length>0)throw new AggregateError(l.map(c=>c.error));return a.map(c=>c.result)}var wa=vi(va(),1);var $n=(t,e)=>{let r=t.reduce((i,n)=>{let s=e?e(n):n;return i[s]||(i[s]=n),i},{});return Object.values(r)};var In=({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};var pe=Object.freeze({pending_upload:"pending_upload",uploaded:"uploaded",errored:"errored"}),Nr=class{#e;#t;#r=!1;#i=!1;#n=null;#s=null;#a=null;#o=[];constructor(e,{acceptedTypes:r,maxFileSize:i,maxFileCount:n,canAcceptFiles:s,onFilesAdded:o,onFileDelete:a,onFileUpload:l,onError:c}){this.#e=e,this.#t={acceptedTypes:r,maxFileSize:i,maxFileCount:n,canAcceptFiles:s,onFilesAdded:o,onFileDelete:a,onFileUpload:l,onError:c},e.addController(this)}hostConnected(){this.#p()}hostDisconnected(){this.#c(),this.#d(),this.#a&&(clearTimeout(this.#a),this.#a=null),this.#n&&this.#n.parentNode&&this.#n.parentNode.removeChild(this.#n),this.#n=null}#l(){this.#c(),this.#e.addEventListener("dragover",this.#h),this.#e.addEventListener("dragenter",this.#m),this.#e.addEventListener("dragleave",this.#f),this.#e.addEventListener("drop",this.#k)}#c(){this.#e.removeEventListener("dragover",this.#h),this.#e.removeEventListener("dragenter",this.#m),this.#e.removeEventListener("dragleave",this.#f),this.#e.removeEventListener("drop",this.#k)}#u(){this.#d(),this.#e.addEventListener("paste",this.#_)}#d(){this.#e.removeEventListener("paste",this.#_)}#p(){this.#n||(this.#n=document.createElement("input"),this.#n.type="file",this.#n.accept=this.#t.acceptedTypes?.join(",")??"",this.#n.multiple=this.#t.maxFileCount>1,this.#n.style.display="none",this.#n.addEventListener("change",this.#w),document.body.appendChild(this.#n))}#w=e=>{if(e.target instanceof HTMLInputElement){let r=e.target,i=Array.from(r.files||[]);this.#v(i),r.value=""}};#h=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")};#m=e=>{e.preventDefault(),e.dataTransfer&&this.#E(e.dataTransfer)&&this.#x(!0)};#f=e=>{if(e.preventDefault(),e.relatedTarget instanceof Node){let r=e.relatedTarget;this.#e.contains(r)||this.#x(!1)}};#k=e=>{if(e.preventDefault(),this.#x(!1),e.dataTransfer){let r=Array.from(e.dataTransfer.files||[]);this.#v(r)}};#_=e=>{if(!e.clipboardData)return;let i=Array.from(e.clipboardData.items||[]).filter(s=>s.kind==="file");if(i.length===0)return;e.preventDefault();let n=i.map(s=>s.getAsFile()).flatMap(s=>s?[s]:[]);this.#v(n)};#E(e){return e.types&&e.types.includes("Files")}#x(e){this.#i!==e&&(this.#i=e,this.#e.requestUpdate())}#g(e){this.#s=e,this.#t.onError?.(e),this.#e.requestUpdate(),this.#a&&clearTimeout(this.#a),this.#a=setTimeout(()=>{this.#y()},6e3)}#y(){this.#a&&(clearTimeout(this.#a),this.#a=null),this.#s=null,this.#e.requestUpdate()}async#v(e){if(e.length===0||this.#t.canAcceptFiles?.()===!1)return;this.#t.onFilesAdded?.(),this.#y();let r=e.filter(o=>this.#S(o));if(r.length===0)return;let i=this.#o.length,n=this.#t.maxFileCount??1/0,s=r.length;if(i+s>n){this.#g(`You can upload a maximum of ${n} files`);return}try{let o=await Promise.all(r.map(l=>this.#$(l))),a=$n(o,l=>l.dataUrl);this.#o=[...this.#o,...a],this.#e.requestUpdate(),await ma(3,a,l=>fr({times:5,backoff:c=>c*3e3},()=>this.#I(l))),this.#e.requestUpdate()}catch(o){console.error("Failed to process and upload files:",o),this.#g("Upload failed")}}#S(e){return this.#t.acceptedTypes&&!this.#t.acceptedTypes.includes(e.type)?(this.#g("Invalid file type"),!1):e.size>this.#t.maxFileSize?(this.#g(`Max file size: ${this.#t.maxFileSize/(1024*1024)}MB`),!1):!0}async#$(e){try{let r=await(0,wa.fileToBase64)(e);return{id:crypto.randomUUID(),name:e.name,type:e.type,size:e.size,dataUrl:r,file:e,processingState:pe.pending_upload}}catch(r){let i=r instanceof Error?r:new Error(String(r));throw new Error(`Failed to read file: ${e.name} - ${i.message}`)}}async#I(e){if(!e){console.error("No file provided to upload"),this.#g("No file provided");return}e.processingState=pe.pending_upload,this.#e.requestUpdate();try{let r=await this.#t.onFileUpload(e);e.publicUrl=r.publicUrl,e.processingState=pe.uploaded,this.#e.requestUpdate()}catch(r){console.error("Upload error:",r),this.#g("Upload failed"),e.processingState=pe.errored,this.#e.requestUpdate()}}get isDragging(){return this.#i}get error(){return this.#s}get selectedFiles(){return this.#o}get hasPendingFiles(){return this.#o.some(e=>e.processingState===pe.pending_upload)}openFilePicker=()=>{if(!this.#r){console.warn("File uploads are disabled");return}this.#n&&this.#n.click()};clearError(){this.#y()}clearFiles(){this.#o=[],this.clearError(),this.#e.requestUpdate()}setEnabled(e){this.#r!==e&&(this.#r=e,this.#r?(this.#l(),this.#u()):(this.#c(),this.#d()))}restoreFiles(e){this.#o=e,this.#e.requestUpdate()}deleteFile=e=>{this.#t.onFileDelete?.(e),this.#o=this.#o.filter(r=>r.id!==e),this.#y(),this.#e.requestUpdate()}};var zr=class{#e;#t=null;#r=null;#i=null;#n=null;#s=[];#a=0;#o="";isSupported=typeof navigator<"u"&&!!navigator.mediaDevices?.getUserMedia&&typeof MediaRecorder<"u";isRecording=!1;constructor(e){this.#e=e,e.addController(this)}async start(){if(this.isRecording)return;this.#t=await navigator.mediaDevices.getUserMedia({audio:!0}),this.#i=new AudioContext;let e=this.#i.createMediaStreamSource(this.#t);this.#n=this.#i.createAnalyser(),this.#n.fftSize=256,e.connect(this.#n),this.#o=ju(),this.#s=[],this.#r=new MediaRecorder(this.#t,{mimeType:this.#o}),this.#r.ondataavailable=r=>{r.data.size>0&&this.#s.push(r.data)},this.#r.start(),this.#a=performance.now(),this.isRecording=!0,this.#e.requestUpdate()}async stop(){if(!this.#r||this.#r.state!=="recording")throw new Error("not recording");let e=Math.round(performance.now()-this.#a),r=await new Promise(i=>{if(!this.#r)throw new Error("recorder unexpectedly null");this.#r.onstop=()=>{i(new Blob(this.#s,{type:this.#o}))},this.#r.stop()});return this.#l(),{audioBlob:r,durationMs:e,mimeType:this.#o}}cancel(){this.#r&&this.#r.state==="recording"&&this.#r.stop(),this.#l()}get frequencyBinCount(){return this.#n?.frequencyBinCount??0}getFrequencyData(e){return this.#n?(this.#n.getByteFrequencyData(e),!0):!1}getElapsedMs(){return this.isRecording?Math.round(performance.now()-this.#a):0}#l(){if(this.#t){for(let e of this.#t.getTracks())e.stop();this.#t=null}this.#i&&(this.#i.close(),this.#i=null),this.#n=null,this.#r=null,this.#s=[],this.isRecording=!1,this.#e.requestUpdate()}hostDisconnected(){this.cancel()}};function ju(){return MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":MediaRecorder.isTypeSupported("audio/mp4")?"audio/mp4":"audio/webm"}var Fu=500,dt=Object.freeze({PERMISSION_DENIED:"Microphone access denied, check your browser settings",START_FAILED:"Couldn't start recording",TOO_SHORT:"Recording too short",EMPTY_TRANSCRIPTION:"Couldn't catch that, try again",CONNECTION_ERROR:"Connection error, try again",TRANSCRIPTION_FAILED:"Couldn't transcribe, try again"}),ie=class t{#e;#t;#r;isTranscribing=!1;constructor(e,{voiceAPI:r,audioCaptureCtrl:i}){this.#e=e,this.#t=r,this.#r=i??new zr(e),e.addController(this)}get isSupported(){return this.#r.isSupported}get isRecording(){return this.#r.isRecording}async start(){try{await this.#r.start(),this.#e.dispatchEvent(new t.RecordingStartedEvent)}catch(e){let r=e instanceof DOMException&&e.name==="NotAllowedError";this.#e.dispatchEvent(new t.ErrorEvent({message:r?dt.PERMISSION_DENIED:dt.START_FAILED,code:r?"permission_denied":"start_failed"}))}}cancel(){this.#r.cancel(),this.isTranscribing=!1,this.#e.requestUpdate()}async approve(){try{let e=await this.#r.stop();if(this.#e.dispatchEvent(new t.RecordingCompletedEvent({durationMs:e.durationMs})),e.durationMs<Fu){this.#e.dispatchEvent(new t.ErrorEvent({message:dt.TOO_SHORT,code:"too_short"}));return}this.isTranscribing=!0,this.#e.requestUpdate();let r=await this.#i(e.audioBlob,e.mimeType);if(this.isTranscribing=!1,this.#e.requestUpdate(),!r.text){this.#e.dispatchEvent(new t.ErrorEvent({message:dt.EMPTY_TRANSCRIPTION,code:"empty_transcription"}));return}this.#e.dispatchEvent(new t.TranscribedEvent({text:r.text,language:r.language,processingMs:r.processingMs,durationMs:e.durationMs}))}catch(e){this.isTranscribing=!1,this.#e.requestUpdate();let r=e instanceof TypeError;this.#e.dispatchEvent(new t.ErrorEvent({message:r?dt.CONNECTION_ERROR:dt.TRANSCRIPTION_FAILED,code:r?"connection_error":"transcription_failed"}))}}get frequencyBinCount(){return this.#r.frequencyBinCount}getFrequencyData(e){return this.#r.getFrequencyData(e)}getElapsedMs(){return this.#r.getElapsedMs()}async#i(e,r){let i=r.includes("mp4")?"m4a":"webm";return await this.#t["/widgets/voice/transcribe"].POST({formData:{audio:new File([e],`recording.${i}`,{type:e.type}),widgetId:this.#e.widgetId}})}hostDisconnected(){this.#r.cancel(),this.isTranscribing=!1}};ie.RecordingStartedEvent=class extends CustomEvent{static type="mw:voice-recording-started";constructor(e={}){super(ie.RecordingStartedEvent.type,{bubbles:!0,composed:!0,...e})}};ie.RecordingCompletedEvent=class extends CustomEvent{static type="mw:voice-recording-completed";constructor(e,r={}){super(ie.RecordingCompletedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};ie.TranscribedEvent=class extends CustomEvent{static type="mw:voice-transcribed";constructor(e,r={}){super(ie.TranscribedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};ie.ErrorEvent=class extends CustomEvent{static type="mw:voice-error";constructor(e,r={}){super(ie.ErrorEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};var Wr=Object.freeze({maxHeight:120,initialHeight:32,paddingY:12}),ee=class t extends w(v){static properties={disabled:{type:Boolean},streaming:{type:Boolean},loading:{type:Boolean},placeholder:{type:String},color:{type:String},enableFileUpload:{type:Boolean},darkMode:{type:Boolean,attribute:"dark-mode"},widgetId:{type:String,attribute:"widget-id"},cdnBaseUrl:{type:String,attribute:"cdn-base-url"},files:{type:Array}};#e=new Date;constructor(){super(),this.disabled=!1,this.streaming=!1,this.loading=!1,this.placeholder="Type a message...",this.color="#8B5CF6",this.enableFileUpload=!1,this.darkMode=!1,this.widgetId="",this.cdnBaseUrl="",this.files=[]}#t=null;get voiceEnabled(){return this.#t?.isSupported??!1}get value(){return this.#r?.value?.trim()??""}updated(e){(e.has("widgetId")||e.has("cdnBaseUrl"))&&this.widgetId&&this.cdnBaseUrl&&!this.#t&&(this.#t=new ie(this,{voiceAPI:Fr(this.cdnBaseUrl)}))}render(){let e=this.#t?.isRecording??!1,r=this.#t?.isTranscribing??!1,i=this.streaming||this.loading||!this.value&&(!this.enableFileUpload||this.files.length===0),n=this.voiceEnabled&&!this.value&&!this.streaming&&!this.loading&&!e&&!r;return u`
|
|
362
362
|
<div
|
|
363
363
|
class="${this.darkMode?"dark bg-[#1E1F23]":"bg-white"} ${this.enableFileUpload&&this.files.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}]">
|
|
364
364
|
<!-- File preview area -->
|
|
@@ -471,7 +471,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
471
471
|
<div class="h-5 w-full"></div>
|
|
472
472
|
</slot>
|
|
473
473
|
</div>
|
|
474
|
-
`}get#r(){return this.renderRoot.querySelector('textarea[name="input"]')??null}get#i(){return this.renderRoot.querySelector('button[type="submit"]')??null}#n(e){
|
|
474
|
+
`}get#r(){return this.renderRoot.querySelector('textarea[name="input"]')??null}get#i(){return this.renderRoot.querySelector('button[type="submit"]')??null}#n(e){qu(e)&&(e.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&this.#i?.click())}#s(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.#r;if(!n)throw new Error("Expected input element to be present");let s=n.value.trim();(s||this.enableFileUpload&&this.files.length>0)&&this.dispatchEvent(new t.SubmitEvent(s))&&(n.value=""),this.#o(),this.focus()}#a(e){this.dispatchEvent(new t.ChangeEvent({delta:e.data,full:e.target instanceof HTMLTextAreaElement?e.target.value:""})),this.#o()}#o(){let e=this.#r;if(!e)return;let{maxHeight:r,initialHeight:i,paddingY:n}=Wr;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()}#l(){this.#t?.start()}#c(){this.#t?.cancel()}#u(){this.#t?.approve()}#d(){this.dispatchEvent(new t.FileUploadClickEvent)}#p(e){this.dispatchEvent(new t.FileDeleteEvent(e))}setValue(e){let r=this.#r;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}))}cancelVoice(){this.#t?.cancel()}focus(){window.requestAnimationFrame(()=>{this.#r?.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.FileUploadClickEvent=class extends CustomEvent{static type="mw:file-upload-click";constructor(e={}){super(ee.FileUploadClickEvent.type,{...e})}};ee.FileDeleteEvent=class extends CustomEvent{static type="mw:file-delete";constructor(e,r={}){super(ee.FileDeleteEvent.type,{detail:e,...r})}};function qu(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);function xa({delay:t},e){let r=!0,i;return Object.assign((...n)=>{r?(clearTimeout(i),i=setTimeout(()=>{r&&e(...n),i=void 0},t)):e(...n)},{isPending:()=>i!==void 0,cancel:()=>{r=!1},flush:(...n)=>e(...n)})}var An=class{#e;constructor(e,{delay:r},i){this.#e=xa({delay:r},i),e.addController(this)}get call(){return this.#e}hostDisconnected(){this.#e.cancel()}};function ka(t,e,r){return new An(t,e,r)}function Ca(t){let e=Math.floor(t/3600);t=t%3600;let r=Math.floor(t/60);return t=Math.floor(t%60),e>0?r>0?`${_a(e)} hr ${r} min`:`${_a(e)} hr`:r>0?t>0?`${r} min ${t} sec`:`${r} min`:`${t} sec`}function Ea(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 _a(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}var Tn=class extends w(v){static properties={content:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"},expanded:{type:Boolean,state:!0},_inProgress:{type:Boolean,state:!0}};static styles=O`
|
|
475
475
|
@keyframes ellipsis {
|
|
476
476
|
0% {
|
|
477
477
|
content: '';
|
|
@@ -491,7 +491,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
491
491
|
content: '';
|
|
492
492
|
animation: ellipsis 1.5s infinite;
|
|
493
493
|
}
|
|
494
|
-
`;#e=
|
|
494
|
+
`;#e=ka(this,{delay:1200},()=>{this._inProgress=!1,this.#t&&(this.#r=Date.now()),this.requestUpdate()});#t=null;#r=null;constructor(){super(),this.content="",this.darkMode=!1,this.expanded=!1,this._inProgress=!1}getStreamDuration(){return this.#t?Date.now()-this.#t:null}#i(){if(!this.#t||!this.#r)return null;let e=this.#r-this.#t,r=Math.round(e/1e3);return Math.max(1,r)}#n(){if(this._inProgress)return"Thinking";let e=this.#i();return e?`Thought for ${Ca(e)}`:"Thought"}updated(e){e.has("content")&&(!this.#t&&this.content&&(this.#t=Date.now()),this._inProgress=!0,this.#e.call())}#s=()=>{this.expanded=!this.expanded};render(){return u`
|
|
495
495
|
<div class="${this.darkMode?"dark":""} w-full">
|
|
496
496
|
<button
|
|
497
497
|
@click="${this.#s}"
|
|
@@ -543,7 +543,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
543
543
|
</div>
|
|
544
544
|
</div>
|
|
545
545
|
</div>
|
|
546
|
-
`;default:throw new Error(`Unknown side: ${this.side}`)}}};customElements.get("mw-chat-message")||customElements.define("mw-chat-message",Mn);function
|
|
546
|
+
`;default:throw new Error(`Unknown side: ${this.side}`)}}};customElements.get("mw-chat-message")||customElements.define("mw-chat-message",Mn);function Sa(t){return e=>{let i=(t?Math[t]:Math.trunc)(e);return i===0?0:i}}var Bu=Math.pow(10,8)*24*60*60*1e3,Ng=-Bu;var Nu=3600;var $a=Nu*24,zg=$a*7,zu=$a*365.2425,Wu=zu/12,Wg=Wu*3,Dn=Symbol.for("constructDateFrom");function Ia(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Dn in t?t[Dn](e):t instanceof Date?new t.constructor(e):new Date(e)}function On(t,e){return Ia(e||t,t)}function Aa(t,e){return+On(t)-+On(e)}function Pn(t,e,r){let i=Aa(t,e)/1e3;return Sa(r?.roundingMethod)(i)}var Un=class extends w(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`
|
|
547
547
|
:host {
|
|
548
548
|
display: block;
|
|
549
549
|
}
|
|
@@ -627,7 +627,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
627
627
|
|
|
628
628
|
${this.#s()}
|
|
629
629
|
</div>
|
|
630
|
-
`: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",
|
|
630
|
+
`: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",Un);var Rn=class extends w(v){static styles=O`
|
|
631
631
|
:host {
|
|
632
632
|
display: block;
|
|
633
633
|
}
|
|
@@ -668,7 +668,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
668
668
|
</button>
|
|
669
669
|
</div>
|
|
670
670
|
</div>
|
|
671
|
-
`}};customElements.get("mw-chat-wait-timer")||customElements.define("mw-chat-wait-timer",
|
|
671
|
+
`}};customElements.get("mw-chat-wait-timer")||customElements.define("mw-chat-wait-timer",Rn);var Ln=class{#e=[];#t=[];#r=[];constructor(e){e.addController(this)}hostDisconnected(){this.clearTimeouts(),this.clearIntervals(),this.clearAnimationFrames()}clearTimeouts(){this.#e.forEach(clearTimeout),this.#e=[]}clearIntervals(){this.#t.forEach(clearInterval),this.#t=[]}clearAnimationFrames(){this.#r.forEach(cancelAnimationFrame),this.#r=[]}setTimeout(e,r,...i){let n=setTimeout(e,r,...i);return this.#e.push(n),n}setInterval(e,r,...i){let n=setInterval(e,r,...i);return this.#t.push(n),n}requestAnimationFrame(e){let r=requestAnimationFrame(e);return this.#r.push(r),r}};function Ie(t){return new Ln(t)}var ve=class extends w(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=Ie(this);#t=!1;#r=!1;#i=!1;#n=!1;updated(e){e.has("src")&&(this.#t=!1,this.#r=!1)}#s(){document.addEventListener("keydown",this.#o)}#a(){document.removeEventListener("keydown",this.#o)}#o=e=>{e.key==="Escape"&&this.#h(e)};get#l(){return this.side==="left"||this.side==="assistant"?"flex justify-start ml-[25px]":"flex justify-end"}get#c(){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}#u(){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`
|
|
672
672
|
<div class="${this.#l} mb-2 min-h-[100px]">
|
|
673
673
|
<div class="${this.#c} relative">
|
|
674
674
|
<!-- Placeholder background that's only shown when loading or error -->
|
|
@@ -720,7 +720,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
720
720
|
</div>
|
|
721
721
|
</div>
|
|
722
722
|
`:null}
|
|
723
|
-
`:(console.warn("MwChatImage: No src provided"),null)}#d=e=>{console.error("Failed to load chat image:",this.src),this.#r=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:e},bubbles:!0}))};#p=e=>{this.#t=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:e},bubbles:!0}))};#w=e=>{this.clickable&&(e.preventDefault(),e.stopPropagation(),this.#i=!0,this.#s(),this.requestUpdate(),this.#n=!0,this.requestUpdate(),this.#e.setTimeout(()=>{this.#n=!1,this.requestUpdate()},500),this.dispatchEvent(new CustomEvent("mw-chat-image:click",{detail:{src:this.src,event:e},bubbles:!0})))};#h=e=>{e.preventDefault(),e.stopPropagation(),this.#a(),this.#i=!1,this.requestUpdate()};#m=e=>{e.preventDefault(),e.stopPropagation()}};ve.ErrorEvent=class extends CustomEvent{static type="mw-chat-image:error";constructor(e,r={}){super(ve.ErrorEvent.type,{detail:e,...r})}};ve.LoadEvent=class extends CustomEvent{static type="mw-chat-image:load";constructor(e,r={}){super(ve.LoadEvent.type,{detail:e,...r})}};ve.ClickEvent=class extends CustomEvent{static type="mw-chat-image:click";constructor(e,r={}){super(ve.ClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-image")||customElements.define("mw-chat-image",ve);var z=t=>t??
|
|
723
|
+
`:(console.warn("MwChatImage: No src provided"),null)}#d=e=>{console.error("Failed to load chat image:",this.src),this.#r=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:e},bubbles:!0}))};#p=e=>{this.#t=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:e},bubbles:!0}))};#w=e=>{this.clickable&&(e.preventDefault(),e.stopPropagation(),this.#i=!0,this.#s(),this.requestUpdate(),this.#n=!0,this.requestUpdate(),this.#e.setTimeout(()=>{this.#n=!1,this.requestUpdate()},500),this.dispatchEvent(new CustomEvent("mw-chat-image:click",{detail:{src:this.src,event:e},bubbles:!0})))};#h=e=>{e.preventDefault(),e.stopPropagation(),this.#a(),this.#i=!1,this.requestUpdate()};#m=e=>{e.preventDefault(),e.stopPropagation()}};ve.ErrorEvent=class extends CustomEvent{static type="mw-chat-image:error";constructor(e,r={}){super(ve.ErrorEvent.type,{detail:e,...r})}};ve.LoadEvent=class extends CustomEvent{static type="mw-chat-image:load";constructor(e,r={}){super(ve.LoadEvent.type,{detail:e,...r})}};ve.ClickEvent=class extends CustomEvent{static type="mw-chat-image:click";constructor(e,r={}){super(ve.ClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-image")||customElements.define("mw-chat-image",ve);var z=t=>t??U;var Vu=["javascript:","data:text/html","vbscript:","data:text/javascript","data:text/vbscript","data:text/css","data:text/plain","data:text/xml"],Bt=class t extends w(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:L().disclaimerDismissed}#t(){this.ephemeral||(L().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 Vu.some(l=>o.toLowerCase().startsWith(l))||!o||!s?e:u`${e.slice(0,a)}<a href="${z(o)}" target="_blank" rel="noopener noreferrer" @click="${this.#n}" class="underline" style="color: ${this.color}"
|
|
724
724
|
>${s}</a
|
|
725
725
|
>${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`
|
|
726
726
|
<div class="${this.darkMode?"dark":""} flex items-center justify-between">
|
|
@@ -760,11 +760,11 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
760
760
|
<animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
|
|
761
761
|
</circle>
|
|
762
762
|
</svg>
|
|
763
|
-
`};customElements.get("mw-loading")||customElements.define("mw-loading",Fn);var
|
|
763
|
+
`};customElements.get("mw-loading")||customElements.define("mw-loading",Fn);var Hu="https://molin.ai/?utm_source=molin.ai&utm_medium=widget&utm_campaign=poweredby",qn=class extends w(v){static properties={darkMode:{type:Boolean,attribute:"dark-mode"}};constructor(){super(),this.darkMode=!1}render(){return u`
|
|
764
764
|
<p class="${this.darkMode?"text-gray-300":"text-gray-600"} flex items-center justify-center text-xs whitespace-nowrap">
|
|
765
765
|
<span>Powered by</span>
|
|
766
766
|
|
|
767
|
-
<a href="${
|
|
767
|
+
<a href="${Hu}" target="_blank" class="inline-flex items-center underline">
|
|
768
768
|
<svg class="mx-1 inline-block h-4 w-4" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
769
769
|
<circle cx="10.0361" cy="10.0361" r="10.0361" fill="#242038" />
|
|
770
770
|
<path
|
|
@@ -799,7 +799,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
799
799
|
<!-- Progress timeline -->
|
|
800
800
|
<div>
|
|
801
801
|
<ol role="list" class="w-full overflow-hidden">
|
|
802
|
-
${
|
|
802
|
+
${J(e,i=>i.label,(i,n)=>{let s=i.status==="completed",o=i.status==="in_progress",a=n===e.length-1;return u`
|
|
803
803
|
<li class="relative pb-4">
|
|
804
804
|
${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>`}
|
|
805
805
|
|
|
@@ -871,7 +871,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
871
871
|
<div class="h-4 w-24 animate-pulse rounded bg-gray-200 dark:bg-gray-600"></div>
|
|
872
872
|
</div>
|
|
873
873
|
`)}
|
|
874
|
-
`:
|
|
874
|
+
`:J(r,i=>i.name,i=>u`
|
|
875
875
|
<div class="flex items-center gap-2 py-1.5">
|
|
876
876
|
<img src="${z(i.image)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain dark:bg-gray-700" loading="lazy" />
|
|
877
877
|
|
|
@@ -977,7 +977,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
977
977
|
`:null}
|
|
978
978
|
</div>
|
|
979
979
|
</div>
|
|
980
|
-
`}};customElements.get("mw-order-card")||customElements.define("mw-order-card",Bn);function Vr(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 Hr=function(){},ht=function(){};var Nt=(t,e,r)=>Math.min(Math.max(r,t),e);var Nn=.001,Bu=.01,$a=10,Nu=.05,zu=1;function Ia({duration:t=800,bounce:e=.25,velocity:r=0,mass:i=1}){let n,s;Hr(t<=$a*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=Nt(Nu,zu,o),t=Nt(Bu,$a,t/1e3),o<1?(n=c=>{let d=c*o,p=d*t,h=d-r,m=Gr(c,o),f=Math.exp(-p);return Nn-h/m*f},s=c=>{let p=c*o*t,h=p*r+r,m=Math.pow(o,2)*Math.pow(c,2)*t,f=Math.exp(-p),E=Gr(Math.pow(c,2),o);return(-n(c)+Nn>0?-1:1)*((h-m)*f)/E}):(n=c=>{let d=Math.exp(-c*t),p=(c-r)*t+1;return-Nn+d*p},s=c=>{let d=Math.exp(-c*t),p=(r-c)*(t*t);return d*p});let a=5/t,l=Vu(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 Wu=12;function Vu(t,e,r){let i=r;for(let n=1;n<Wu;n++)i=i-t(i)/e(i);return i}function Gr(t,e){return t*Math.sqrt(1-e*e)}var Hu=["duration","bounce"],Gu=["stiffness","damping","mass"];function Aa(t,e){return e.some(r=>t[r]!==void 0)}function Ju(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Aa(t,Gu)&&Aa(t,Hu)){let r=Ia(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Jr(t){var{from:e=0,to:r=1,restSpeed:i=2,restDelta:n}=t,s=Vr(t,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:a,damping:l,mass:c,velocity:d,duration:p,isResolvedFromDuration:h}=Ju(s),m=Ta,f=Ta;function E(){let x=d?-(d/1e3):0,S=r-e,b=l/(2*Math.sqrt(a*c)),k=Math.sqrt(a/c)/1e3;if(n===void 0&&(n=Math.min(Math.abs(r-e)/100,.4)),b<1){let $=Gr(k,b);m=P=>{let F=Math.exp(-b*k*P);return r-F*((x+b*k*S)/$*Math.sin($*P)+S*Math.cos($*P))},f=P=>{let F=Math.exp(-b*k*P);return b*k*F*(Math.sin($*P)*(x+b*k*S)/$+S*Math.cos($*P))-F*(Math.cos($*P)*(x+b*k*S)-$*S*Math.sin($*P))}}else if(b===1)m=$=>r-Math.exp(-k*$)*(S+(x+k*S)*$);else{let $=k*Math.sqrt(b*b-1);m=P=>{let F=Math.exp(-b*k*P),W=Math.min($*P,300);return r-F*((x+b*k*S)*Math.sinh(W)+$*S*Math.cosh(W))/$}}}return E(),{next:x=>{let S=m(x);if(h)o.done=x>=p;else{let b=f(x)*1e3,k=Math.abs(b)<=i,$=Math.abs(r-S)<=n;o.done=k&&$}return o.value=o.done?r:S,o},flipTarget:()=>{d=-d,[e,r]=[r,e],E()}}}Jr.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var Ta=t=>0;var zn=(t,e,r)=>{let i=e-t;return i===0?1:(r-t)/i};var ft=(t,e,r)=>-r*t+r*e+t;var Xr=(t,e)=>r=>Math.max(Math.min(r,e),t),Ae=t=>t%1?Number(t.toFixed(5)):t,mt=/(-)?([\d]*\.?[\d])+/g,Yr=/(#[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,Ma=/^(#[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 gt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Kr=Object.assign(Object.assign({},gt),{transform:Xr(0,1)}),ay=Object.assign(Object.assign({},gt),{default:1});var zt=t=>({test:e=>we(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),uy=zt("deg"),yt=zt("%"),dy=zt("px"),py=zt("vh"),hy=zt("vw"),fy=Object.assign(Object.assign({},yt),{parse:t=>yt.parse(t)/100,transform:t=>yt.transform(t*100)});var bt=(t,e)=>r=>!!(we(r)&&Ma.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),Qr=(t,e,r)=>i=>{if(!we(i))return i;let[n,s,o,a]=i.match(mt);return{[t]:parseFloat(n),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var he={test:bt("hsl","hue"),parse:Qr("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:i=1})=>"hsla("+Math.round(t)+", "+yt.transform(Ae(e))+", "+yt.transform(Ae(r))+", "+Ae(Kr.transform(i))+")"};var Xu=Xr(0,255),Zr=Object.assign(Object.assign({},gt),{transform:t=>Math.round(Xu(t))}),ne={test:bt("rgb","red"),parse:Qr("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:i=1})=>"rgba("+Zr.transform(t)+", "+Zr.transform(e)+", "+Zr.transform(r)+", "+Ae(Kr.transform(i))+")"};function Yu(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 vt={test:bt("#"),parse:Yu,transform:ne.transform};var Te={test:t=>ne.test(t)||vt.test(t)||he.test(t),parse:t=>ne.test(t)?ne.parse(t):he.test(t)?he.parse(t):vt.parse(t),transform:t=>we(t)?t:t.hasOwnProperty("red")?ne.transform(t):he.transform(t)};var Da="${c}",Oa="${n}";function Ku(t){var e,r,i,n;return isNaN(t)&&we(t)&&((r=(e=t.match(mt))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((n=(i=t.match(Yr))===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0)>0}function Pa(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,i=t.match(Yr);i&&(r=i.length,t=t.replace(Yr,Da),e.push(...i.map(Te.parse)));let n=t.match(mt);return n&&(t=t.replace(mt,Oa),e.push(...n.map(gt.parse))),{values:e,numColors:r,tokenised:t}}function Ra(t){return Pa(t).values}function Ua(t){let{values:e,numColors:r,tokenised:i}=Pa(t),n=e.length;return s=>{let o=i;for(let a=0;a<n;a++)o=o.replace(a<r?Da:Oa,a<r?Te.transform(s[a]):Ae(s[a]));return o}}var Qu=t=>typeof t=="number"?0:t;function Zu(t){let e=Ra(t);return Ua(t)(e.map(Qu))}var ei={test:Ku,parse:Ra,createTransformer:Ua,getAnimatableNone:Zu};function Wn(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 Vn({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=Wn(l,a,t+1/3),s=Wn(l,a,t),o=Wn(l,a,t-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}var ed=(t,e,r)=>{let i=t*t,n=e*e;return Math.sqrt(Math.max(0,r*(n-i)+i))},td=[vt,ne,he],La=t=>td.find(e=>e.test(t)),ja=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,ti=(t,e)=>{let r=La(t),i=La(e);ht(!!r,ja(t)),ht(!!i,ja(e));let n=r.parse(t),s=i.parse(e);r===he&&(n=Vn(n),r=ne),i===he&&(s=Vn(s),i=ne);let o=Object.assign({},n);return a=>{for(let l in o)l!=="alpha"&&(o[l]=ed(n[l],s[l],a));return o.alpha=ft(n.alpha,s.alpha,a),r.transform(o)}};var Fa=t=>typeof t=="number";var rd=(t,e)=>r=>e(t(r)),ri=(...t)=>t.reduce(rd);function Ba(t,e){return Fa(t)?r=>ft(t,e,r):Te.test(t)?ti(t,e):Gn(t,e)}var Hn=(t,e)=>{let r=[...t],i=r.length,n=t.map((s,o)=>Ba(s,e[o]));return s=>{for(let o=0;o<i;o++)r[o]=n[o](s);return r}},Na=(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]=Ba(t[n],e[n]));return n=>{for(let s in i)r[s]=i[s](n);return r}};function qa(t){let e=ei.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 Gn=(t,e)=>{let r=ei.createTransformer(e),i=qa(t),n=qa(e);return i.numHSL===n.numHSL&&i.numRGB===n.numRGB&&i.numNumbers>=n.numNumbers?ri(Hn(i.parsed,n.parsed),r):(Hr(!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 id=(t,e)=>r=>ft(t,e,r);function nd(t){if(typeof t=="number")return id;if(typeof t=="string")return Te.test(t)?ti:Gn;if(Array.isArray(t))return Hn;if(typeof t=="object")return Na}function sd(t,e,r){let i=[],n=r||nd(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=ri(l,a)}i.push(a)}return i}function od([t,e],[r]){return i=>r(zn(t,e,i))}function ad(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=zn(t[s],t[s+1],n);return e[s](a)}}function ii(t,e,{clamp:r=!0,ease:i,mixer:n}={}){let s=t.length;ht(s===e.length,"Both input and output ranges must be the same length"),ht(!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=sd(e,i,n),a=s===2?od(t,o):ad(t,o);return r?l=>a(Nt(t[0],t[s-1],l)):a}var Wt=t=>e=>1-t(1-e),ni=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,za=t=>e=>Math.pow(e,t),Jn=t=>e=>e*e*((t+1)*e-t),Wa=t=>{let e=Jn(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var Va=1.525,ld=4/11,cd=8/11,ud=9/10;var Ha=za(2),yb=Wt(Ha),Ga=ni(Ha),dd=t=>1-Math.sin(Math.acos(t)),pd=Wt(dd),bb=ni(pd),Ja=Jn(Va),vb=Wt(Ja),wb=ni(Ja),xb=Wa(Va),hd=4356/361,fd=35442/1805,md=16061/1805,gd=t=>{if(t===1||t===0)return t;let e=t*t;return t<ld?7.5625*e:t<cd?9.075*e-9.9*t+3.4:t<ud?hd*e-fd*t+md:10.8*t*t-20.52*t+10.72},kb=Wt(gd);function yd(t,e){return t.map(()=>e||Ga).splice(0,t.length-1)}function bd(t){let e=t.length;return t.map((r,i)=>i!==0?i/(e-1):0)}function vd(t,e){return t.map(r=>r*e)}function Vt({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=vd(i&&i.length===o.length?i:bd(o),n);function l(){return ii(a,o,{ease:Array.isArray(r)?r:yd(o,r)})}let c=l();return{next:d=>(s.value=c(d),s.done=d>=n,s),flipTarget:()=>{o.reverse(),c=l()}}}function Xa({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 p=-a*Math.exp(-d/i);return o.done=!(p>n||p<-n),o.value=o.done?c:c+p,o},flipTarget:()=>{}}}var Ya={keyframes:Vt,spring:Jr,decay:Xa};function Ka(t){if(Array.isArray(t.to))return Vt;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")?Vt:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Jr:Vt}var Xn=16.666666666666668,wd=typeof performance<"u"?()=>performance.now():()=>Date.now(),Yn=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(wd()),Xn);function Qa(t){let e=[],r=[],i=0,n=!1,s=!1,o=new WeakSet,a={schedule:(l,c=!1,d=!1)=>{let p=d&&n,h=p?e:r;return c&&o.add(l),h.indexOf(l)===-1&&(h.push(l),p&&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 xd=40,Kn=!0,Gt=!1,Qn=!1,Ht={delta:0,timestamp:0},Jt=["read","update","preRender","render","postRender"],si=Jt.reduce((t,e)=>(t[e]=Qa(()=>Gt=!0),t),{}),kd=Jt.reduce((t,e)=>{let r=si[e];return t[e]=(i,n=!1,s=!1)=>(Gt||Cd(),r.schedule(i,n,s)),t},{}),Za=Jt.reduce((t,e)=>(t[e]=si[e].cancel,t),{}),Ub=Jt.reduce((t,e)=>(t[e]=()=>si[e].process(Ht),t),{}),_d=t=>si[t].process(Ht),el=t=>{Gt=!1,Ht.delta=Kn?Xn:Math.max(Math.min(t-Ht.timestamp,xd),1),Ht.timestamp=t,Qn=!0,Jt.forEach(_d),Qn=!1,Gt&&(Kn=!1,Yn(el))},Cd=()=>{Gt=!0,Kn=!0,Qn||Yn(el)};var tl=kd;function Zn(t,e,r=0){return t-e-r}function rl(t,e,r=0,i=!0){return i?Zn(e+-t,e,r):e-(t-e)+r}function il(t,e,r,i){return i?t>=e+r:t<=-r}var Ed=t=>{let e=({delta:r})=>t(r);return{start:()=>tl.update(e,!0),stop:()=>Za.update(e)}};function es(t){var e,r,{from:i,autoplay:n=!0,driver:s=Ed,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:d,onStop:p,onComplete:h,onRepeat:m,onUpdate:f}=t,E=Vr(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:x}=E,S,b=0,k=E.duration,$,P=!1,F=!0,W,T=Ka(E);!((r=(e=T).needsInterpolation)===null||r===void 0)&&r.call(e,i,x)&&(W=ii([0,100],[i,x],{clamp:!1}),i=0,x=100);let V=T(Object.assign(Object.assign({},E),{from:i,to:x}));function Y(){b++,l==="reverse"?(F=b%2===0,o=rl(o,k,c,F)):(o=Zn(o,k,c),l==="mirror"&&V.flipTarget()),P=!1,m&&m()}function bi(){S.stop(),h&&h()}function Me(U){if(F||(U=-U),o+=U,!P){let H=V.next(Math.max(0,o));$=H.value,W&&($=W($)),P=F?H.done:o<=0}f?.($),P&&(b===0&&(k??(k=o)),b<a?il(o,k,c,F)&&Y():bi())}function ir(){d?.(),S=s(Me),S.start()}return n&&ir(),{stop:()=>{p?.(),S.stop()}}}var Ve=class t extends w(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`
|
|
980
|
+
`}};customElements.get("mw-order-card")||customElements.define("mw-order-card",Bn);function Vr(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 Hr=function(){},ht=function(){};var Nt=(t,e,r)=>Math.min(Math.max(r,t),e);var Nn=.001,Gu=.01,Ta=10,Xu=.05,Ju=1;function Ma({duration:t=800,bounce:e=.25,velocity:r=0,mass:i=1}){let n,s;Hr(t<=Ta*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=Nt(Xu,Ju,o),t=Nt(Gu,Ta,t/1e3),o<1?(n=c=>{let d=c*o,p=d*t,h=d-r,m=Gr(c,o),f=Math.exp(-p);return Nn-h/m*f},s=c=>{let p=c*o*t,h=p*r+r,m=Math.pow(o,2)*Math.pow(c,2)*t,f=Math.exp(-p),E=Gr(Math.pow(c,2),o);return(-n(c)+Nn>0?-1:1)*((h-m)*f)/E}):(n=c=>{let d=Math.exp(-c*t),p=(c-r)*t+1;return-Nn+d*p},s=c=>{let d=Math.exp(-c*t),p=(r-c)*(t*t);return d*p});let a=5/t,l=Yu(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 Ku=12;function Yu(t,e,r){let i=r;for(let n=1;n<Ku;n++)i=i-t(i)/e(i);return i}function Gr(t,e){return t*Math.sqrt(1-e*e)}var Qu=["duration","bounce"],Zu=["stiffness","damping","mass"];function Da(t,e){return e.some(r=>t[r]!==void 0)}function ed(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Da(t,Zu)&&Da(t,Qu)){let r=Ma(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Xr(t){var{from:e=0,to:r=1,restSpeed:i=2,restDelta:n}=t,s=Vr(t,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:a,damping:l,mass:c,velocity:d,duration:p,isResolvedFromDuration:h}=ed(s),m=Oa,f=Oa;function E(){let x=d?-(d/1e3):0,S=r-e,b=l/(2*Math.sqrt(a*c)),k=Math.sqrt(a/c)/1e3;if(n===void 0&&(n=Math.min(Math.abs(r-e)/100,.4)),b<1){let $=Gr(k,b);m=P=>{let F=Math.exp(-b*k*P);return r-F*((x+b*k*S)/$*Math.sin($*P)+S*Math.cos($*P))},f=P=>{let F=Math.exp(-b*k*P);return b*k*F*(Math.sin($*P)*(x+b*k*S)/$+S*Math.cos($*P))-F*(Math.cos($*P)*(x+b*k*S)-$*S*Math.sin($*P))}}else if(b===1)m=$=>r-Math.exp(-k*$)*(S+(x+k*S)*$);else{let $=k*Math.sqrt(b*b-1);m=P=>{let F=Math.exp(-b*k*P),W=Math.min($*P,300);return r-F*((x+b*k*S)*Math.sinh(W)+$*S*Math.cosh(W))/$}}}return E(),{next:x=>{let S=m(x);if(h)o.done=x>=p;else{let b=f(x)*1e3,k=Math.abs(b)<=i,$=Math.abs(r-S)<=n;o.done=k&&$}return o.value=o.done?r:S,o},flipTarget:()=>{d=-d,[e,r]=[r,e],E()}}}Xr.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var Oa=t=>0;var zn=(t,e,r)=>{let i=e-t;return i===0?1:(r-t)/i};var ft=(t,e,r)=>-r*t+r*e+t;var Jr=(t,e)=>r=>Math.max(Math.min(r,e),t),Ae=t=>t%1?Number(t.toFixed(5)):t,mt=/(-)?([\d]*\.?[\d])+/g,Kr=/(#[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,Pa=/^(#[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 gt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Yr=Object.assign(Object.assign({},gt),{transform:Jr(0,1)}),hy=Object.assign(Object.assign({},gt),{default:1});var zt=t=>({test:e=>we(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),gy=zt("deg"),yt=zt("%"),yy=zt("px"),by=zt("vh"),vy=zt("vw"),wy=Object.assign(Object.assign({},yt),{parse:t=>yt.parse(t)/100,transform:t=>yt.transform(t*100)});var bt=(t,e)=>r=>!!(we(r)&&Pa.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),Qr=(t,e,r)=>i=>{if(!we(i))return i;let[n,s,o,a]=i.match(mt);return{[t]:parseFloat(n),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var he={test:bt("hsl","hue"),parse:Qr("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:i=1})=>"hsla("+Math.round(t)+", "+yt.transform(Ae(e))+", "+yt.transform(Ae(r))+", "+Ae(Yr.transform(i))+")"};var td=Jr(0,255),Zr=Object.assign(Object.assign({},gt),{transform:t=>Math.round(td(t))}),ne={test:bt("rgb","red"),parse:Qr("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:i=1})=>"rgba("+Zr.transform(t)+", "+Zr.transform(e)+", "+Zr.transform(r)+", "+Ae(Yr.transform(i))+")"};function rd(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 vt={test:bt("#"),parse:rd,transform:ne.transform};var Te={test:t=>ne.test(t)||vt.test(t)||he.test(t),parse:t=>ne.test(t)?ne.parse(t):he.test(t)?he.parse(t):vt.parse(t),transform:t=>we(t)?t:t.hasOwnProperty("red")?ne.transform(t):he.transform(t)};var Ua="${c}",Ra="${n}";function id(t){var e,r,i,n;return isNaN(t)&&we(t)&&((r=(e=t.match(mt))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((n=(i=t.match(Kr))===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0)>0}function La(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,i=t.match(Kr);i&&(r=i.length,t=t.replace(Kr,Ua),e.push(...i.map(Te.parse)));let n=t.match(mt);return n&&(t=t.replace(mt,Ra),e.push(...n.map(gt.parse))),{values:e,numColors:r,tokenised:t}}function ja(t){return La(t).values}function Fa(t){let{values:e,numColors:r,tokenised:i}=La(t),n=e.length;return s=>{let o=i;for(let a=0;a<n;a++)o=o.replace(a<r?Ua:Ra,a<r?Te.transform(s[a]):Ae(s[a]));return o}}var nd=t=>typeof t=="number"?0:t;function sd(t){let e=ja(t);return Fa(t)(e.map(nd))}var ei={test:id,parse:ja,createTransformer:Fa,getAnimatableNone:sd};function Wn(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 Vn({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=Wn(l,a,t+1/3),s=Wn(l,a,t),o=Wn(l,a,t-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}var od=(t,e,r)=>{let i=t*t,n=e*e;return Math.sqrt(Math.max(0,r*(n-i)+i))},ad=[vt,ne,he],qa=t=>ad.find(e=>e.test(t)),Ba=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,ti=(t,e)=>{let r=qa(t),i=qa(e);ht(!!r,Ba(t)),ht(!!i,Ba(e));let n=r.parse(t),s=i.parse(e);r===he&&(n=Vn(n),r=ne),i===he&&(s=Vn(s),i=ne);let o=Object.assign({},n);return a=>{for(let l in o)l!=="alpha"&&(o[l]=od(n[l],s[l],a));return o.alpha=ft(n.alpha,s.alpha,a),r.transform(o)}};var Na=t=>typeof t=="number";var ld=(t,e)=>r=>e(t(r)),ri=(...t)=>t.reduce(ld);function Wa(t,e){return Na(t)?r=>ft(t,e,r):Te.test(t)?ti(t,e):Gn(t,e)}var Hn=(t,e)=>{let r=[...t],i=r.length,n=t.map((s,o)=>Wa(s,e[o]));return s=>{for(let o=0;o<i;o++)r[o]=n[o](s);return r}},Va=(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]=Wa(t[n],e[n]));return n=>{for(let s in i)r[s]=i[s](n);return r}};function za(t){let e=ei.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 Gn=(t,e)=>{let r=ei.createTransformer(e),i=za(t),n=za(e);return i.numHSL===n.numHSL&&i.numRGB===n.numRGB&&i.numNumbers>=n.numNumbers?ri(Hn(i.parsed,n.parsed),r):(Hr(!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 cd=(t,e)=>r=>ft(t,e,r);function ud(t){if(typeof t=="number")return cd;if(typeof t=="string")return Te.test(t)?ti:Gn;if(Array.isArray(t))return Hn;if(typeof t=="object")return Va}function dd(t,e,r){let i=[],n=r||ud(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=ri(l,a)}i.push(a)}return i}function pd([t,e],[r]){return i=>r(zn(t,e,i))}function hd(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=zn(t[s],t[s+1],n);return e[s](a)}}function ii(t,e,{clamp:r=!0,ease:i,mixer:n}={}){let s=t.length;ht(s===e.length,"Both input and output ranges must be the same length"),ht(!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=dd(e,i,n),a=s===2?pd(t,o):hd(t,o);return r?l=>a(Nt(t[0],t[s-1],l)):a}var Wt=t=>e=>1-t(1-e),ni=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ha=t=>e=>Math.pow(e,t),Xn=t=>e=>e*e*((t+1)*e-t),Ga=t=>{let e=Xn(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var Xa=1.525,fd=4/11,md=8/11,gd=9/10;var Ja=Ha(2),_b=Wt(Ja),Ka=ni(Ja),yd=t=>1-Math.sin(Math.acos(t)),bd=Wt(yd),Cb=ni(bd),Ya=Xn(Xa),Eb=Wt(Ya),Sb=ni(Ya),$b=Ga(Xa),vd=4356/361,wd=35442/1805,xd=16061/1805,kd=t=>{if(t===1||t===0)return t;let e=t*t;return t<fd?7.5625*e:t<md?9.075*e-9.9*t+3.4:t<gd?vd*e-wd*t+xd:10.8*t*t-20.52*t+10.72},Ib=Wt(kd);function _d(t,e){return t.map(()=>e||Ka).splice(0,t.length-1)}function Cd(t){let e=t.length;return t.map((r,i)=>i!==0?i/(e-1):0)}function Ed(t,e){return t.map(r=>r*e)}function Vt({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=Ed(i&&i.length===o.length?i:Cd(o),n);function l(){return ii(a,o,{ease:Array.isArray(r)?r:_d(o,r)})}let c=l();return{next:d=>(s.value=c(d),s.done=d>=n,s),flipTarget:()=>{o.reverse(),c=l()}}}function Qa({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 p=-a*Math.exp(-d/i);return o.done=!(p>n||p<-n),o.value=o.done?c:c+p,o},flipTarget:()=>{}}}var Za={keyframes:Vt,spring:Xr,decay:Qa};function el(t){if(Array.isArray(t.to))return Vt;if(Za[t.type])return Za[t.type];let e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Vt:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Xr:Vt}var Jn=16.666666666666668,Sd=typeof performance<"u"?()=>performance.now():()=>Date.now(),Kn=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Sd()),Jn);function tl(t){let e=[],r=[],i=0,n=!1,s=!1,o=new WeakSet,a={schedule:(l,c=!1,d=!1)=>{let p=d&&n,h=p?e:r;return c&&o.add(l),h.indexOf(l)===-1&&(h.push(l),p&&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 $d=40,Yn=!0,Gt=!1,Qn=!1,Ht={delta:0,timestamp:0},Xt=["read","update","preRender","render","postRender"],si=Xt.reduce((t,e)=>(t[e]=tl(()=>Gt=!0),t),{}),Id=Xt.reduce((t,e)=>{let r=si[e];return t[e]=(i,n=!1,s=!1)=>(Gt||Td(),r.schedule(i,n,s)),t},{}),rl=Xt.reduce((t,e)=>(t[e]=si[e].cancel,t),{}),Nb=Xt.reduce((t,e)=>(t[e]=()=>si[e].process(Ht),t),{}),Ad=t=>si[t].process(Ht),il=t=>{Gt=!1,Ht.delta=Yn?Jn:Math.max(Math.min(t-Ht.timestamp,$d),1),Ht.timestamp=t,Qn=!0,Xt.forEach(Ad),Qn=!1,Gt&&(Yn=!1,Kn(il))},Td=()=>{Gt=!0,Yn=!0,Qn||Kn(il)};var nl=Id;function Zn(t,e,r=0){return t-e-r}function sl(t,e,r=0,i=!0){return i?Zn(e+-t,e,r):e-(t-e)+r}function ol(t,e,r,i){return i?t>=e+r:t<=-r}var Md=t=>{let e=({delta:r})=>t(r);return{start:()=>nl.update(e,!0),stop:()=>rl.update(e)}};function es(t){var e,r,{from:i,autoplay:n=!0,driver:s=Md,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:d,onStop:p,onComplete:h,onRepeat:m,onUpdate:f}=t,E=Vr(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:x}=E,S,b=0,k=E.duration,$,P=!1,F=!0,W,T=el(E);!((r=(e=T).needsInterpolation)===null||r===void 0)&&r.call(e,i,x)&&(W=ii([0,100],[i,x],{clamp:!1}),i=0,x=100);let V=T(Object.assign(Object.assign({},E),{from:i,to:x}));function K(){b++,l==="reverse"?(F=b%2===0,o=sl(o,k,c,F)):(o=Zn(o,k,c),l==="mirror"&&V.flipTarget()),P=!1,m&&m()}function bi(){S.stop(),h&&h()}function Me(R){if(F||(R=-R),o+=R,!P){let H=V.next(Math.max(0,o));$=H.value,W&&($=W($)),P=F?H.done:o<=0}f?.($),P&&(b===0&&(k??(k=o)),b<a?ol(o,k,c,F)&&K():bi())}function ir(){d?.(),S=s(Me),S.start()}return n&&ir(),{stop:()=>{p?.(),S.stop()}}}var Ve=class t extends w(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`
|
|
981
981
|
<div class="${this.darkMode?"dark border-gray-600 bg-[#1E1F23]":"border-[#5e5d59]/25 bg-white"} my-2 w-full rounded-3xl border p-4">
|
|
982
982
|
<div class="relative mx-auto mb-4 max-w-[240px]">
|
|
983
983
|
<div class="h-[180px] w-full animate-pulse rounded-2xl bg-gray-200 dark:bg-gray-700"></div>
|
|
@@ -1001,7 +1001,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1001
1001
|
<div class="pointer-events-auto mx-auto mb-4">
|
|
1002
1002
|
<div class="group relative overflow-hidden rounded-2xl">
|
|
1003
1003
|
<div class="image-slider z-0 flex transition-transform duration-300 ease-in-out" style="transform: translateX(-${this._currentImageIndex*100}%)">
|
|
1004
|
-
${this.images.length>0?
|
|
1004
|
+
${this.images.length>0?J(this.images,s=>s,(s,o)=>u`
|
|
1005
1005
|
<!-- TODO: add srcset with 1x/2x variants for high DPI displays -->
|
|
1006
1006
|
<img src="${s}" alt="image ${o+1}: ${e}" class="h-auto w-full flex-shrink-0 object-scale-down" loading="lazy" />
|
|
1007
1007
|
`):u`
|
|
@@ -1066,7 +1066,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1066
1066
|
</button> -->
|
|
1067
1067
|
</div>
|
|
1068
1068
|
</div>
|
|
1069
|
-
`}#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.#o&&es({from:e,to:r,duration:300,onUpdate:i=>{this.#o&&(this.#o.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}#a(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#o(){return this.renderRoot.querySelector(".image-slider")}};Ve.AddToCartEvent=class extends CustomEvent{static type="mw-product-card:add-to-cart";constructor(e,r={}){super(Ve.AddToCartEvent.type,{detail:{product:e},...r})}};customElements.get("mw-product-card")||customElements.define("mw-product-card",Ve);var ts=class{#e;isLoading=!0;hasError=!1;isLoaded=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){}hostDisconnected(){}handleLoad=()=>{this.isLoading=!1,this.isLoaded=!0,this.hasError=!1,this.#e.requestUpdate()};handleError=()=>{this.isLoading=!1,this.hasError=!0,this.isLoaded=!1,this.#e.requestUpdate()}};function
|
|
1069
|
+
`}#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.#o&&es({from:e,to:r,duration:300,onUpdate:i=>{this.#o&&(this.#o.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}#a(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#o(){return this.renderRoot.querySelector(".image-slider")}};Ve.AddToCartEvent=class extends CustomEvent{static type="mw-product-card:add-to-cart";constructor(e,r={}){super(Ve.AddToCartEvent.type,{detail:{product:e},...r})}};customElements.get("mw-product-card")||customElements.define("mw-product-card",Ve);var ts=class{#e;isLoading=!0;hasError=!1;isLoaded=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){}hostDisconnected(){}handleLoad=()=>{this.isLoading=!1,this.isLoaded=!0,this.hasError=!1,this.#e.requestUpdate()};handleError=()=>{this.isLoading=!1,this.hasError=!0,this.isLoaded=!1,this.#e.requestUpdate()}};function al(t){return new ts(t)}var Jt=class extends w(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"}};#e=al(this);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 so(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`
|
|
1070
1070
|
<a
|
|
1071
1071
|
href="${z(this.trackedProductUrl)}"
|
|
1072
1072
|
title="${z(e)}"
|
|
@@ -1112,7 +1112,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1112
1112
|
${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>`}
|
|
1113
1113
|
</div>
|
|
1114
1114
|
</a>
|
|
1115
|
-
`}};customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",
|
|
1115
|
+
`}};customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",Jt);function oi(t){return Array.isArray(t)?t:t?[t]:[]}function ll(t,e){let r=new Map;for(let i of t){let n=e(i),s=r.get(n);s?s.push(i):r.set(n,[i])}return r}var rs=class extends w(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=oi(this.orderDetails?.order_status?.step||[]),r=oi(this.orderDetails?.items?.item||[]),i=oi(this.orderDetails?.actions||[]);return u`
|
|
1116
1116
|
<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">
|
|
1117
1117
|
<!-- Header with order ID -->
|
|
1118
1118
|
<div class="mb-2">
|
|
@@ -1137,7 +1137,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1137
1137
|
</div>
|
|
1138
1138
|
</li>
|
|
1139
1139
|
`)}
|
|
1140
|
-
`:
|
|
1140
|
+
`:J(e,n=>n.label,(n,s)=>{let o=n.status==="completed",a=n.status==="in_progress",l=s===e.length-1;return u`
|
|
1141
1141
|
<li class="relative pb-4">
|
|
1142
1142
|
${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>`}
|
|
1143
1143
|
|
|
@@ -1297,7 +1297,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1297
1297
|
${this.streaming&&!i[0]?.track_order?.label&&!it(i[0]?.track_order?.tracking_url||"")?u`
|
|
1298
1298
|
<!-- Loading shimmer for buttons -->
|
|
1299
1299
|
<div class="h-10 w-full min-w-[250px] animate-pulse overflow-hidden rounded-xl bg-gray-200 dark:bg-gray-600"></div>
|
|
1300
|
-
`:
|
|
1300
|
+
`:J(i,(n,s)=>`action-${s}`,n=>{if(n?.track_order?.label)return u`
|
|
1301
1301
|
${it(n.track_order?.tracking_url||"")?u` <a
|
|
1302
1302
|
target="${this.linksNewTab?"_blank":"_self"}"
|
|
1303
1303
|
href="${n.track_order?.tracking_url}"
|
|
@@ -1307,7 +1307,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1307
1307
|
`})}
|
|
1308
1308
|
</div>
|
|
1309
1309
|
</div>
|
|
1310
|
-
`}};customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",rs);var
|
|
1310
|
+
`}};customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",rs);var Kt=class t extends w(v){static properties={heading:{type:String},type:{type:String,reflect:!0},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.heading="",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("heading"))&&(this._selectedRating=0,this._selectedVote="",this._hoverRating=0)}render(){return u`
|
|
1311
1311
|
<div
|
|
1312
1312
|
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}]">
|
|
1313
1313
|
<div class="flex flex-col gap-2 p-4">
|
|
@@ -1357,7 +1357,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1357
1357
|
<mw-icon class="${r?"text-green-500":"text-gray-400 dark:text-gray-300"} h-6 w-6" name="lucide:thumbs-up"></mw-icon>
|
|
1358
1358
|
</button>
|
|
1359
1359
|
</div>
|
|
1360
|
-
`}#i(e){let r=this._selectedRating>0?this._selectedRating:this._hoverRating,i=e<=r;return u`<mw-icon class="${i?"text-yellow-400":"text-gray-300"} h-6 w-6" name="lucide:star" ?fill="${i}"></mw-icon>`}#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)}#a(){this._selectedRating>0||(this._hoverRating=0)}#o(e){this._selectedVote||(this._selectedVote=e,this.dispatchEvent(new t.SubmitEvent({type:"binary-vote",vote:e})))}};
|
|
1360
|
+
`}#i(e){let r=this._selectedRating>0?this._selectedRating:this._hoverRating,i=e<=r;return u`<mw-icon class="${i?"text-yellow-400":"text-gray-300"} h-6 w-6" name="lucide:star" ?fill="${i}"></mw-icon>`}#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)}#a(){this._selectedRating>0||(this._hoverRating=0)}#o(e){this._selectedVote||(this._selectedVote=e,this.dispatchEvent(new t.SubmitEvent({type:"binary-vote",vote:e})))}};Kt.SubmitEvent=class extends CustomEvent{static type="mw-request-input:submit";constructor(e,r={}){super(Kt.SubmitEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-request-input")||customElements.define("mw-request-input",Kt);var is=class{#e;#t=0;#r;#i;#n;#s;#a=0;#o;constructor(e,{duration:r,initial:i,easing:n,onFrame:s,onComplete:o}){this.#o=i,this.#t=typeof r=="function"?0:r,this.#r=typeof r=="function"?r:void 0,this.#i=n??(a=>a),this.#n=s,this.#s=o,e.addController(this)}start(e){this.cancel(),this.#o=e,this.#r&&(this.#t=this.#r(e)),this.#a=performance.now(),this.#e=requestAnimationFrame(this.#l)}cancel(){this.#e!==void 0&&(cancelAnimationFrame(this.#e),this.#e=void 0)}get running(){return this.#e!==void 0}#l=e=>{let r=Math.min((e-this.#a)/this.#t,1),i=this.#i(r);this.#n(i,this.#o),r<1?this.#e=requestAnimationFrame(this.#l):(this.#e=void 0,this.#s?.(this.#o))};hostDisconnected(){this.cancel()}};function cl(t,e){return new is(t,e)}var ns=class extends w(v){static properties={text:{type:String},speed:{type:Number},spotlightWidth:{type:Number},loop:{type:Boolean},delay:{type:Number},textColor:{type:String},highlightColor:{type:String},className:{type:String},_position:{type:Number,state:!0},_containerWidth:{type:Number,state:!0}};constructor(){super(),this.text="",this.speed=5,this.spotlightWidth=120,this.loop=!0,this.delay=0,this.textColor="#9CA3AF",this.highlightColor="#000000",this.className="",this._position=-this.spotlightWidth,this._containerWidth=0}#e=Ie(this);#t=cl(this,{duration:({range:e})=>e*10/this.speed,initial:{range:0},onFrame:(e,{range:r})=>{this._position=-this.spotlightWidth+e*r,this.requestUpdate()},onComplete:({range:e})=>{this.loop&&(this._position=-this.spotlightWidth,this.requestUpdate(),this.#e.setTimeout(()=>this.#t.start({range:e}),this.delay))}});firstUpdated(){this.#e.setTimeout(()=>{this._containerWidth=this.#r?.offsetWidth||0;let e=this._containerWidth+this.spotlightWidth*3;this.#t.start({range:e})},this.delay)}render(){let e=this.text.split("");return u`
|
|
1361
1361
|
<div id="text-spotlight-container" class="${this.className} relative inline-block overflow-hidden whitespace-nowrap">
|
|
1362
1362
|
<div class="text-[${this.textColor}]">
|
|
1363
1363
|
${e.map((r,i)=>{let n=i*(this._containerWidth/e.length),o=Math.abs(n-this._position)<this.spotlightWidth/2;return u`<span class="inline text-[${o?this.highlightColor:this.textColor}] transition-colors duration-300">${r}</span>`})}
|
|
@@ -1371,7 +1371,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1371
1371
|
.highlightColor="${this.color||(this.darkMode?"#FFFFFF":"#000000")}"
|
|
1372
1372
|
class="block h-6 leading-6">
|
|
1373
1373
|
</mw-text-spotlight>
|
|
1374
|
-
`}};customElements.get("mw-tool-call-indicator")||customElements.define("mw-tool-call-indicator",ss);var
|
|
1374
|
+
`}};customElements.get("mw-tool-call-indicator")||customElements.define("mw-tool-call-indicator",ss);var ul=["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/heic"];var Yt=class extends lt{constructor(e){if(super(e),this.it=U,e.type!==Ur.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===se)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:[]}}};Yt.directiveName="unsafeHTML",Yt.resultType=1;var dl=Rr(Yt);var pl=N({title:Q(C(),"Agent joining in"),subtitle:Q(C(),"We are finding a human agent to help you."),subtitle_past_join_time:Q(C(),"It is taking a bit longer. A human agent will join any moment now."),expected_join_time:yr(et(C(),Pi(),Li())),game_title:Q(C(),"\u{1F9E0} I will guess your job"),game_first_question:Q(C(),"Does your job involve computers?"),game_result_prefix:Q(C(),"My guess:"),game_button_start:Q(C(),"\u{1F3AE} Play a game"),game_button_answer_affirmative:Q(C(),"Yes"),game_button_answer_negative:Q(C(),"No"),game_button_result_correct:Q(C(),"Correct"),game_button_result_wrong:Q(C(),"Wrong")});var os=t=>et(Tt(),ji(e=>Array.isArray(e)?e:[e]),Ze(t));var hl=N({order_id_label:A(C()),order_id_value:A(C()),timeline:A(N({step:os(N({label:A(C()),status:A(Mt(["completed","in_progress","pending"]))}))})),items:A(N({item:os(N({name:A(C()),quantity:A(C()),price:A(C()),image:A(C())}))})),shipping_cost_label:A(C()),shipping_cost_amount:A(C()),total_label:A(C()),total_amount:A(C()),customer_name:A(C()),shipping_label:A(C()),shipping_method:A(C()),payment_label:A(C()),payment_method_label:A(C()),payment_method_value:A(C()),payment_status_label:A(C()),payment_status_value:A(C()),order_tracking_label:A(C()),order_tracking_url:A(C())});function fl(t,e,r,{imagesByProductUrl:i,linksNewTab:n=!0,searchParams:s,messageIsStreaming:o=!1,isSupportAgent:a,color:l="#601feb",darkMode:c=!1,apiBaseUrl:d="",cdnBaseUrl:p=""}){if(!t)return u``;let h=e>0&&r[e-1]&&"data"in r[e-1],m=e<r.length-1||!o;if("text"in t)return u`<p>${t.text}</p>`;if("html"in t)return u`${dl(t.html)}`;if("data"in t)switch(t.tag){case"thought":{let f=t.data.__TEXT__?String(t.data.__TEXT__):"";return u`<mw-thought-block .content="${f}" ?dark-mode="${c}"></mw-thought-block>`}case"product-card":case"product-card-v1":case"product-card-horizontal":{let f=oe(wr,t.data);if(f.success)return u`
|
|
1375
1375
|
${h?u`<div class="my-3 w-full border-t border-gray-200/50"></div>`:null}
|
|
1376
1376
|
<mw-product-card-horizontal
|
|
1377
1377
|
.product="${f.output}"
|
|
@@ -1387,7 +1387,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1387
1387
|
?links-new-tab="${n}"
|
|
1388
1388
|
?dark-mode="${c}"
|
|
1389
1389
|
color="${l}"></mw-product-order-status-card>
|
|
1390
|
-
`;case"order-card-v2":{let f=oe(
|
|
1390
|
+
`;case"order-card-v2":{let f=oe(hl,t.data);f.success||console.warn("cannot parse order-card-v2",f.issues);let E=f.success?f.output:t.data;return u`
|
|
1391
1391
|
<!-- -->
|
|
1392
1392
|
<mw-order-card .orderDetails="${E}" ?streaming="${!m}" ?links-new-tab="${n}" ?dark-mode="${c}" color="${l}"></mw-order-card>
|
|
1393
1393
|
`}case"live-chat-wait-card-v1":{let f=t.data||{};return a?u`<p><i>${f.message}</i></p>`:u`
|
|
@@ -1408,7 +1408,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1408
1408
|
cdnBaseUrl="${p}"
|
|
1409
1409
|
sound="${p?`${p}/assets/game-intro.aac`:""}"
|
|
1410
1410
|
?dark-mode="${c}"></mw-chat-wait-timer>
|
|
1411
|
-
`}case"live-chat-wait-card-v2":{let f=oe(
|
|
1411
|
+
`}case"live-chat-wait-card-v2":{let f=oe(pl,t.data||{});f.success||console.warn("cannot parse live-chat-wait-card-v2",f.issues);let E=f.success?f.output:t.data||{};return a?u`<p><i>${E.subtitle}</i></p>`:u`
|
|
1412
1412
|
<mw-chat-wait-timer
|
|
1413
1413
|
.data="${E}"
|
|
1414
1414
|
color="${l}"
|
|
@@ -1416,12 +1416,12 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1416
1416
|
cdnBaseUrl="${p}"
|
|
1417
1417
|
sound="${p?`${p}/assets/game-intro.aac`:""}"
|
|
1418
1418
|
?dark-mode="${c}"></mw-chat-wait-timer>
|
|
1419
|
-
`}case"request-input-v1":return u``}return console.warn("could not render part:",t),u`<p><i>data type not supported</i></p>`}var ai=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 as({interval:t},e){let r=!0,i;return Object.assign((...n)=>{r&&(e(...n),r=!1,i=setTimeout(()=>{r=!0,i=void 0},t))},{isThrottled:()=>i!==void 0})}var ls=class{#e;uploadsAPI;constructor(e,r){this.#e=e,this.uploadsAPI=Fr(r),e.addController(this)}hostDisconnected(){}};function
|
|
1419
|
+
`}case"request-input-v1":return u``}return console.warn("could not render part:",t),u`<p><i>data type not supported</i></p>`}var ai=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 as({interval:t},e){let r=!0,i;return Object.assign((...n)=>{r&&(e(...n),r=!1,i=setTimeout(()=>{r=!0,i=void 0},t))},{isThrottled:()=>i!==void 0})}var ls=class{#e;uploadsAPI;constructor(e,r){this.#e=e,this.uploadsAPI=Fr(r),e.addController(this)}hostDisconnected(){}};function ml(t,e){return new ls(t,e).uploadsAPI}var cs="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 prose-blockquote:border-l-4 prose-blockquote:border-gray-300 prose-blockquote:pl-4 prose-blockquote:my-4 prose-blockquote:italic prose-blockquote:text-gray-600 prose-blockquote:whitespace-normal prose-blockquote:before:content-none prose-blockquote:after:content-none dark:prose-headings:text-white dark:prose-strong:text-white dark:prose-p:text-inherit dark:prose-a:text-white dark:prose-blockquote:border-gray-500 dark:prose-blockquote:text-gray-300";function us(){return new URL(import.meta.url).hostname}function li(){let t=Object.freeze({localhost:"http://localhost:8787","molin.localhost":"http://molin.localhost:8787","molin.ai":"https://molin.ai","molin.foo":"https://molin.foo","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai"}),e=us(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinApiBaseUrl.`);return r}function gl(){let t=Object.freeze({localhost:"http://uploads.molin.localhost:8787","molin.localhost":"http://uploads.molin.localhost:8787","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai"}),e=us(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinUploadsBaseUrl.`);return r}function ds(){let t=Object.freeze({localhost:"http://localhost:8702","molin.localhost":"http://localhost:8702","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai"}),e=us(),r=t[e];if(!r)throw new Error(`Unknown JS bundle hostname: ${e}. Please make sure to add it to getMolinCdnBaseUrl.`);return r}var Od=["star-rating","binary-vote","new-conversation-button"],He=class t extends w(v){static styles=O`
|
|
1420
1420
|
div.dark::before {
|
|
1421
1421
|
opacity: 0.8;
|
|
1422
1422
|
background-color: rgba(20, 22, 26, var(--tw-bg-opacity));
|
|
1423
1423
|
}
|
|
1424
|
-
`;static properties={showClose:{type:Boolean,attribute:"show-close"},showExpand:{type:Boolean,attribute:"show-expand"},expanded:{type:Boolean},open:{type:Boolean},_currentRequestInputIndex:{type:Number,state:!0},_voiceError:{type:String,state:!0}};#e=
|
|
1424
|
+
`;static properties={showClose:{type:Boolean,attribute:"show-close"},showExpand:{type:Boolean,attribute:"show-expand"},expanded:{type:Boolean},open:{type:Boolean},_currentRequestInputIndex:{type:Number,state:!0},_voiceError:{type:String,state:!0}};#e=wo(this);#t=ml(this,gl());#r=new Map;constructor(){super(),this.showClose=!1,this.showExpand=!1,this.expanded=!1,this.open=!1,this._currentRequestInputIndex=0,this._voiceError=""}#i=new ai(this,{typingStarted:()=>this.#e.value?.sendUserTypingStart(),typingStopped:()=>this.#e.value?.sendUserTypingStop()});#n=new Nr(this,{acceptedTypes:ul,maxFileSize:10485760,maxFileCount:3,onFileUpload:async e=>{let r=this.#e.value;if(!r?.isConnected())throw new Error("Not connected");return this.#t["/v1/uploads"].POST({formData:{file:e.file,fileId:e.id,conversationId:this.conversationId,widgetId:r.widgetId,role:"user"}})},onFileDelete:e=>{if(!this.#e.value){console.warn("widget context not available, cannot delete file");return}this.#e.value.sendFileDelete(e),this.#b?.focus()},onFilesAdded:()=>{this.focusInput()}});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 toolCallIndicator(){return this.#e.value?.toolCallIndicator}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}#s="single";#a=null;firstUpdated(){document.addEventListener("mw-context-widget:connected",this.#o,{once:!0}),this.addEventListener("mw-chat-wait-game:question-answered",this.#l),this.addEventListener("mw-chat-wait-game:game-completed",this.#c),this.addEventListener("mw-chat-wait-game:guess-validated",this.#u)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("mw-chat-wait-game:question-answered",this.#l),this.removeEventListener("mw-chat-wait-game:game-completed",this.#c),this.removeEventListener("mw-chat-wait-game:guess-validated",this.#u)}#o=e=>{let r=e,{pendingImages:i}=r.detail;Array.isArray(i)&&this.#n.restoreFiles(i.map(n=>({id:n.id,name:n.name,type:n.type,size:n.size,dataUrl:n.url,file:new File([],n.name,{type:n.type}),processingState:pe.uploaded,publicUrl:n.url})))};#l=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})};#c=e=>{let r=e,{guessedProfession:i,questionCount:n}=r.detail;this.callbacks.onWaitGameCompleted?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:i,questionCount:n})};#u=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(e){e.has("open")&&this.open&&this.focusInput();let r=this.lastMsg?.id;r&&r!==this.#a&&(this.#a=r,this._currentRequestInputIndex=0),this.#n.setEnabled(!!this.#e.value?.widgetId)}render(){M(this.config,"config is required");let e=ll(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.#C.length-1)),i=this.#C[r],n=this.config.darkMode;return u`
|
|
1425
1425
|
<div
|
|
1426
1426
|
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]">
|
|
1427
1427
|
<div
|
|
@@ -1467,10 +1467,10 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1467
1467
|
<!-- the padding at the top makes empty room at the top when scrolling and content is hidden behind header -->
|
|
1468
1468
|
<!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
|
|
1469
1469
|
<div class="${this.messages.length>0?"pt-20":""}">
|
|
1470
|
-
${
|
|
1471
|
-
<div class="my-2 text-center text-xs text-gray-500 dark:text-gray-400">${
|
|
1472
|
-
${
|
|
1473
|
-
${a.images?
|
|
1470
|
+
${J(Array.from(e),([s])=>s,([s,o])=>u`
|
|
1471
|
+
<div class="my-2 text-center text-xs text-gray-500 dark:text-gray-400">${Ea(new Date(Number(s)),window.navigator.language)}</div>
|
|
1472
|
+
${J(o??[],a=>a.id,(a,l)=>{let d=o[l+1]?.role===a.role,h=(l>0?o[l-1]:void 0)?.role===a.role,f=(o.length>0?o[o.length-1]:void 0)?.id===a.id,E=()=>f&&!h&&!d?"single-current":!h&&!d?"single":!h&&d?"first":f&&h&&!d?"last-current":h&&!d?"last":h&&d?"middle":"single";this.#s=E();let x=this.isLiveMode&&a.role==="user"&&a.id===this.lastMsg?.id?"sent":"",S=(a.content.includes("<request-input-v1>")||!a.content)&&a.parts?.every(b=>"data"in b&&b.tag==="request-input-v1");return u`
|
|
1473
|
+
${a.images?J(a.images,b=>b,b=>u`
|
|
1474
1474
|
<div data-id="${a.id}" class="${d?"mb-[1px]":"mb-3"} mr-2 ml-[15px] flex-row">
|
|
1475
1475
|
<mw-chat-image
|
|
1476
1476
|
src="${b}"
|
|
@@ -1491,7 +1491,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1491
1491
|
?dark-mode="${n}"
|
|
1492
1492
|
@click="${this.#d}">
|
|
1493
1493
|
<div class="${cs} break-words text-inherit">
|
|
1494
|
-
${a.parts?.length?
|
|
1494
|
+
${a.parts?.length?J(a.parts,(b,k)=>k,(b,k)=>fl(b,k,a.parts??[],{imagesByProductUrl:a.role==="assistant"&&a.metadata&&"imagesByProductUrl"in a.metadata?a.metadata.imagesByProductUrl:void 0,linksNewTab:this.config?.linksNewTab??!0,searchParams:this.config?.disableUtmInjection?void 0:new URLSearchParams({utm_source:"molin.ai"}),messageIsStreaming:a.streaming,color:this.config?.color,darkMode:n,apiBaseUrl:li(),cdnBaseUrl:ds()})):u`<p>${a.content}</p>`}
|
|
1495
1495
|
</div>
|
|
1496
1496
|
</mw-chat-message>
|
|
1497
1497
|
</div>
|
|
@@ -1587,7 +1587,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1587
1587
|
</div>
|
|
1588
1588
|
</div>
|
|
1589
1589
|
</div>
|
|
1590
|
-
`}#d(e){let r=e.composedPath(),i=r.find(n=>n instanceof HTMLAnchorElement);if(i){e.preventDefault();let n=r.find(c=>c instanceof Ve||c instanceof
|
|
1590
|
+
`}#d(e){let r=e.composedPath(),i=r.find(n=>n instanceof HTMLAnchorElement);if(i){e.preventDefault();let n=r.find(c=>c instanceof Ve||c instanceof Jt),s=n?.product,o=0;if(n){let c=n.parentElement?.querySelectorAll("mw-product-card, mw-product-card-horizontal");c&&(o=Array.from(c).indexOf(n))}if(this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId,product:s?.name&&s?.price?{name:s.name,price:s.price,rank:o}:void 0}),window.self!==window.top){window.open(i.href,"_blank");return}let l=this.config?.linksNewTab?"_blank":"_self";window.open(i.href,i.target||l)}}#p(e){if(this.isStreaming)return;e.preventDefault();let r=e.detail.example;this.#w(r)}#w=as({interval:200},async e=>{M(this.#e.value,"widget context is required"),await this.#e.value.enqueueUserInput(e,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions})&&(this.#b?.setValue(""),this.#A(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!0,conversationId:this.conversationId}))});#h(e){if(M(this.#e.value,"widget context is required"),e.preventDefault(),this.#n.hasPendingFiles)return;let r=e.detail;this.#e.value.enqueueUserInput(r,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions}).then(i=>{i&&(this.#b?.setValue(""),this.#n.clearFiles(),this.#i.typingStopped(),this.#A(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:this.conversationId}),window.requestAnimationFrame(()=>{this.#b?.focus()}))}).catch(console.warn)}#m(e){this.#i.onInput(e.detail.full)}#f(){M(this.#e.value,"widget context is required"),this.#e.value.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}#k(e){this.#n.deleteFile(e.detail)}#_(){this._voiceError="",this.callbacks.onVoiceRecordingStarted?.({widgetId:this.widgetId,conversationId:this.conversationId})}#E(e){this.callbacks.onVoiceRecordingCompleted?.({widgetId:this.widgetId,conversationId:this.conversationId,durationMs:e.detail.durationMs})}#x(e){let{text:r,language:i,processingMs:n,durationMs:s}=e.detail;this.callbacks.onVoiceTranscriptionCompleted?.({widgetId:this.widgetId,conversationId:this.conversationId,durationMs:s,processingMs:n,language:i,textLength:r.length}),this.updateComplete.then(()=>{this.#b?.setValue(r),this.focusInput()})}#g(e){let{message:r,code:i}=e.detail;this._voiceError=r,i==="permission_denied"&&this.callbacks.onVoicePermissionDenied?.({widgetId:this.widgetId}),(i==="connection_error"||i==="transcription_failed")&&this.callbacks.onVoiceTranscriptionFailed?.({widgetId:this.widgetId,conversationId:this.conversationId,error:r})}#y(){M(this.#e.value,"widget context is required"),this.#e.value.sendNewChat(),this.reset()}#v(){this.dispatchEvent(new t.ExpandClickEvent)}#S(){this.dispatchEvent(new t.CloseClickEvent)}#$(e){M(this.#e.value,"widget context is required");let r=this.#C,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.#r.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.#r.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.#r.size>=n&&this.#I(),this.requestUpdate()}async#I(){if(M(this.#e.value,"widget context is required"),this.#r.size===0)return;if(!this.#e.value.lastMsg?.id){console.warn("cannot submit request inputs without message ID");return}await this.#e.value.sendUserFeedback([...this.#r.values()])&&this.#r.clear(),this.requestUpdate()}get#C(){M(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&&(n.data.type==="new-conversation-button"||n.data.type==="binary-vote"||n.data.type==="star-rating"))return[{title:String(n.data.title),type:n.data.type,key:String(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)||n.data.type!=="star-rating"&&n.data.type!=="binary-vote"&&n.data.type!=="new-conversation-button"||!Od.includes(n.data.type)?null:{title:String(n.data.title),type:n.data.type,key:String(n.data.key)}).filter(n=>n!==null)}get#T(){if(this.#C.length===0)return!1;let r=this.#C.filter(i=>i.type==="star-rating"||i.type==="binary-vote").length;return this.#r.size<r}get#M(){return this.renderRoot.querySelector("#scrollable-content")}#A(){this.#M?.scrollTo({top:0,behavior:"instant"})}get#b(){return this.renderRoot.querySelector("mw-chat-input")}reloadConfig(){this.#e.value?.reloadConfig(),this.requestUpdate()}sendMessage=as({interval:200},async e=>{if(!e?.trim())return console.warn("sendMessage: Message must be a non-empty string"),!1;M(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.#b?.setValue(""),i??!1});setInputValue(e){if(!e||typeof e!="string"){console.warn("setInputValue requires a valid string value");return}let r=this.#b;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.#b?.focus()})}reset(){this.#n.clearFiles(),this.#b?.cancelVoice(),this._voiceError="",this._currentRequestInputIndex=0,this.#r.clear(),this.#e.value?.reset()}};He.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(He.ExpandClickEvent.type,{...e})}};He.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(He.CloseClickEvent.type,{...e})}};customElements.get("mw-chat")||customElements.define("mw-chat",He);var Ge=class t extends w(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`
|
|
1591
1591
|
<div class="${this.dark?"dark":""} group rounded-[18px] font-sans text-sm shadow-lg transition-transform duration-500 focus-within:scale-100 hover:scale-105">
|
|
1592
1592
|
<mw-spinning-border .size=${"420px"} .color=${this.color||"#8B5CF6"} .radius=${"18px"} ?dark-mode="${this.dark}">
|
|
1593
1593
|
<form
|
|
@@ -1618,7 +1618,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1618
1618
|
</form>
|
|
1619
1619
|
</mw-spinning-border>
|
|
1620
1620
|
</div>
|
|
1621
|
-
`}#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('button[type="submit"]')??null}#n(e){
|
|
1621
|
+
`}#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('button[type="submit"]')??null}#n(e){Pd(e)&&(e.preventDefault(),this.disabled||this.#i?.click())}};Ge.SubmitInputEvent=class extends CustomEvent{static type="mw-floating-ask-ai:submit";constructor(e,r={}){super(Ge.SubmitInputEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};Ge.ChangeEvent=class extends CustomEvent{static type="mw-floating-ask-ai:change";constructor(e,r={}){super(Ge.ChangeEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};function Pd(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",Ge);var Xe=class t extends w(v){static properties={text:{type:String},color:{type:String},darkMode:{type:Boolean,attribute:"dark-mode"}};static styles=O`
|
|
1622
1622
|
.popup-desktop:hover button {
|
|
1623
1623
|
transition-delay: 0s !important;
|
|
1624
1624
|
}
|
|
@@ -1646,7 +1646,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1646
1646
|
×
|
|
1647
1647
|
</button>
|
|
1648
1648
|
</div>
|
|
1649
|
-
`;#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};
|
|
1649
|
+
`;#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};Xe.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(Xe.CloseEvent.type,{...e})}};Xe.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Xe.ClickEvent.type,{...e})}};customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",Xe);var Je=class t extends w(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`
|
|
1650
1650
|
<!-- wrapper -->
|
|
1651
1651
|
<div
|
|
1652
1652
|
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">
|
|
@@ -1671,7 +1671,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1671
1671
|
<!-- can append any other content -->
|
|
1672
1672
|
<slot name="footer"></slot>
|
|
1673
1673
|
</div>
|
|
1674
|
-
`}#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};
|
|
1674
|
+
`}#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};Je.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(Je.CloseEvent.type,{...e})}};Je.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Je.ClickEvent.type,{...e})}};customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",Je);var ci=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 Ud=1440*60*1e3,ui=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})}}#a(){let e=this.#t.getPersistedState(),r=!!e?.playedSoundOnce;e?.userDismissedAt&&this.#r.now()-e.userDismissedAt<Ud||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.#a(),this.#t.getDelayMs()))}};var Qt=class t extends w(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 ui(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(e=>{console.error("Error playing audio:",e,{})})},setPersistedState:e=>{L().popupState=e},getPersistedState:()=>L().popupState});#t=new ci(this,this.#e);constructor(){super(),this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:"",color:""},mobile:{text:"",button:"",color:"",poweredBy:!0}},this.darkMode=!1}render(){let e=this.#e.showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",r=this.content;return u`
|
|
1675
1675
|
<!-- mobile shadow backdrop -->
|
|
1676
1676
|
<div @click="${this.#r}" class="${e} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
|
|
1677
1677
|
|
|
@@ -1713,7 +1713,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1713
1713
|
stroke-linecap="round"></path>
|
|
1714
1714
|
</svg>
|
|
1715
1715
|
</div>
|
|
1716
|
-
`};customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",hs);function fe(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}function
|
|
1716
|
+
`};customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",hs);function fe(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}function Ke(t,e){try{window.dispatchEvent(new CustomEvent(t,{detail:e}))}catch(r){console.error(r)}try{let r=fe();if(!r)return;switch(t){case"molin:ready":r.onReady?.(e);break;case"molin:chat-open":r.onChatOpen?.(e);break;case"molin:chat-close":r.onChatClose?.(e);break;case"molin:message-sent":r.onMessageSent?.(e);break;case"molin:link-click":r.onLinkClick?.(e);break}}catch(r){console.error(r)}}var di=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 fs=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=yl();e&&e.widgetId===this.#e.widgetId?this.#i=e.config:this.#r=new di(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})}},wt=(t,e)=>new fs(t,{onError:e?.onError||console.error,...e});var pi=class{#e=[];#t;#r=!1;#i;#n;#s;#a;#o;constructor({send:e,sendBeacon:r,maxBufferSize:i=10,flushIntervalMs:n=5*1e3,sendTimeoutMs:s=10*1e3}){this.#i=e,this.#n=r,this.#s=i,this.#a=n,this.#o=s}async add(e){if(this.#e.push(e),this.#e.length>=this.#s)return this.flush();this.#l()}async flush(){if(this.#r||this.#e.length===0)return;this.#r=!0,clearTimeout(this.#t),this.#t=void 0;let e=[...this.#e];this.#e=[];let r=new AbortController,i=setTimeout(()=>r.abort(),this.#o);try{await this.#i(e,r.signal)}catch(n){console.error("sending events failed",n),this.#e=[...e,...this.#e]}finally{clearTimeout(i),this.#r=!1,this.#l()}}async flushBeacon(){if(this.#e.length>0)try{this.#n(this.#e)}catch(e){console.error("Failed to send final events:",e)}}#l(){this.#e.length!==0&&(this.#t||(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#a)))}};function bl(t){t?.body?.cancel().catch(console.warn)}var vl="0123456789abcdef",ms=class t{constructor(e){if(e.length!==16)throw new TypeError("not 128-bit length");this.bytes=e}static fromFieldsV7(e,r,i,n){let s=new Uint8Array(16);return s[0]=e/2**40,s[1]=e/2**32,s[2]=e/2**24,s[3]=e/2**16,s[4]=e/2**8,s[5]=e,s[6]=112|r>>>8,s[7]=r,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new t(s)}toString(){let e="";for(let r=0;r<this.bytes.length;r++)e=e+vl.charAt(this.bytes[r]>>>4)+vl.charAt(this.bytes[r]&15),(r===3||r===5||r===7||r===9)&&(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}},gs=class{#e=new Uint32Array(8);#t=1/0;#r;constructor(e=globalThis.window){this.#r=typeof e.crypto<"u"&&typeof e.crypto.getRandomValues<"u"?r=>e.crypto.getRandomValues(r):r=>{for(let i=0;i<r.length;i++)r[i]=Math.trunc(Math.random()*65536)*65536+Math.trunc(Math.random()*65536);return r}}nextUint32(){return this.#t>=this.#e.length&&(this.#r(this.#e),this.#t=0),this.#e[this.#t++]}},ys=class{#e=0;#t=0;#r;constructor(e){this.#r=new gs(e)}generate(){let e=this.#i();if(e!==void 0)return e;this.#e=0;let r=this.#i();if(r===void 0)throw new Error("Could not generate UUID after timestamp reset");return r}#i(){let i=Date.now();if(i>this.#e)this.#e=i,this.#n();else if(i+1e4>this.#e)this.#t++,this.#t>4398046511103&&(this.#e++,this.#n());else return;return ms.fromFieldsV7(this.#e,Math.trunc(this.#t/2**30),this.#t&2**30-1,this.#r.nextUint32())}#n(){this.#t=this.#r.nextUint32()*1024+(this.#r.nextUint32()&1023)}},wl;function xl(t){return wl??=new ys(t),wl.generate().toString()}function _l(){return new URL("/widgets/data/collect",li())}var kl;function Rd(){return kl??=new pi({send:async(t,e)=>Ld(t,{signal:e}),sendBeacon:t=>navigator.sendBeacon(_l(),Cl(t))}),kl}function j(t,e,{flush:r=!1,now:i=new Date,buffer:n=Rd(),storage:s=L(),window:o=globalThis}={}){if(typeof t!="string")throw new TypeError("ClickHouse: event name must be a string");if(!e||typeof e!="object")throw new TypeError("ClickHouse: properties must be an object");try{let a=jd(t,e,{storage:s,window:o,now:i});n.add(a).catch(console.error),r&&n.flush().catch(console.error)}catch(a){console.error("Failed to send event:",a)}}function Cl(t){let e=new FormData;return e.set("events",JSON.stringify(t)),e}async function Ld(t,{signal:e}={}){let r=await fetch(_l(),{method:"POST",body:Cl(t),signal:e});if(bl(r),!r.ok)throw new Error(`HTTP error! status: ${r.status}`)}function jd(t,e,{storage:r,window:i,now:n}){return{event:t,widget_id:e.widgetId,properties:Object.assign({},e,qd({window:i,now:n})),distinct_id:Fd({storage:r}),timestamp:n.toISOString()}}function Fd({storage:t}){let e=t.distinctID;if(e&&typeof e=="string")return e;let r=xl();try{t.distinctID=r}catch(i){console.error("Failed to store distinct_id:",i)}return r}function qd({window:t,now:e}){return{referrer:t.document.referrer,userAgent:t.navigator.userAgent,language:t.navigator.language,screenWidth:t.innerWidth,screenHeight:t.innerHeight,timestamp:e.toISOString(),timezoneOffset:e.getTimezoneOffset(),doNotTrack:t.navigator.doNotTrack??void 0}}function hi(t,e=globalThis){try{(!("dataLayer"in e)||!Array.isArray(e.dataLayer))&&(e.dataLayer=[]),t(e.dataLayer)}catch(r){console.error(r)}}function Zt(t,e){hi(r=>{r.push(t)},e)}function El(t,e){t.items.length&&hi(r=>{r.push({ecommerce:null}),r.push({event:"view_item_list",ecommerce:t})},e)}function Sl(t,e){hi(r=>{r.push({ecommerce:null}),r.push({event:"select_item",ecommerce:t})},e)}function $l(t,e){hi(r=>{r.push({ecommerce:null}),r.push({event:"view_item",ecommerce:t})},e)}function Nd(t,e=globalThis){try{"klaviyo"in e&&e.klaviyo&&typeof e.klaviyo.push=="function"&&t(e.klaviyo)}catch(r){console.error(r)}}function er(t,e){Nd(r=>{r.push(["track",t])},e)}function bs(t,e=globalThis){try{"clarity"in e&&typeof e.clarity=="function"&&t(e.clarity)}catch(r){console.error(r)}}var Il=!1;function tr(t,e){Il||bs(r=>{r("set","molin_widget_id",t),Il=!0},e)}function rr(t,e){bs(r=>{r("event",t)},e)}function Al(t,e){bs(r=>{r("upgrade",t)},e)}function fi(){return{onError:t=>{console.error("Molin","ERROR",t.widgetId,t.error),j("ShopAssistant: error",{...t},{flush:!0}),alert(t.error)},onNewMessageStartedStreaming:t=>{j("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{j("ShopAssistant: user received bot message (streaming ended)",t),t.products.length&&El({item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",items:t.products.map((e,r)=>({item_name:e.name,price:0,index:r,item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",google_business_vertical:"retail"}))})},onUserCanceledStreaming:t=>{j("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{if(j("ShopAssistant: user clicked link",t),Zt({event:"molin_link_click",widget_id:t.widgetId,url:t.url}),t.product){let e={item_name:t.product.name,price:0,index:t.product.rank,item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",google_business_vertical:"retail"};Sl({item_list_id:"molin_ai_chat",item_list_name:"Molin AI chat",items:[e]}),$l({items:[e]})}tr(t.widgetId),rr("molin_link_click"),er("molin_link_click"),Ke("molin:link-click",{widgetId:t.widgetId,url:t.url})},onUserSentInput:t=>{j("ShopAssistant: user sent input",t),Zt({event:"molin_message_sent",widget_id:t.widgetId}),tr(t.widgetId),rr("molin_message_sent"),Al("molin_message_sent"),er("molin_message_sent"),Ke("molin:message-sent",{widgetId:t.widgetId})},onWaitGameQuestionAnswered:t=>{j("ShopAssistant: wait game question answered",t)},onWaitGameCompleted:t=>{j("ShopAssistant: wait game completed",t)},onWaitGameGuessValidated:t=>{j("ShopAssistant: wait game guess validated",t)},onVoiceRecordingStarted:t=>{j("ShopAssistant: voice recording started",t)},onVoiceRecordingCompleted:t=>{j("ShopAssistant: voice recording completed",t)},onVoiceTranscriptionCompleted:t=>{j("ShopAssistant: voice transcription completed",t)},onVoiceTranscriptionFailed:t=>{j("ShopAssistant: voice transcription failed",t)},onVoicePermissionDenied:t=>{j("ShopAssistant: voice permission denied",t)}}}function Tl(){return{onPageview:t=>{j("ShopAssistant: pageview",t)},onChatOpen:({widgetId:t,source:e})=>{j("ShopAssistant: user toggled window",{widgetId:t,source:e,state:"open"}),Zt({event:"molin_chat_open",widget_id:t}),tr(t),rr("molin_chat_open"),er("molin_chat_open"),Ke("molin:chat-open",{widgetId:t})},onChatClose:({widgetId:t,source:e})=>{j("ShopAssistant: user toggled window",{widgetId:t,source:e,state:"close"}),Zt({event:"molin_chat_close",widget_id:t}),tr(t),rr("molin_chat_close"),er("molin_chat_close"),Ke("molin:chat-close",{widgetId:t})},onShowLauncher:({widgetId:t,source:e})=>{j("ShopAssistant: called show launcher",{widgetId:t,source:e})},onHideLauncher:({widgetId:t,source:e})=>{j("ShopAssistant: called hide launcher",{widgetId:t,source:e})}}}var xe=class t extends w(v){static styles=O`
|
|
1717
1717
|
:host {
|
|
1718
1718
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
1719
1719
|
visibility: inherit; /* re-inherit so parent's invisible class propagates */
|
|
@@ -1726,7 +1726,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1726
1726
|
<slot name="banner" slot="banner"></slot>
|
|
1727
1727
|
</mw-chat>
|
|
1728
1728
|
</mw-context-widget>
|
|
1729
|
-
`:null}#i(){this.dispatchEvent(new t.CloseClickEvent)}#n(){this.dispatchEvent(new t.ExpandClickEvent)}injectConfig(e){this.#t=e,this.requestUpdate()}reloadConfig(){this.#s?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",this.#s?.reset(),this.requestUpdate()}get#s(){return this.renderRoot.querySelector("mw-chat")}get conversationId(){return this.#s?.conversationId??""}get messages(){return this.#s?.messages??[]}};xe.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(xe.CloseClickEvent.type,{...e})}};xe.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(xe.ExpandClickEvent.type,{...e})}};customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",xe);var
|
|
1729
|
+
`:null}#i(){this.dispatchEvent(new t.CloseClickEvent)}#n(){this.dispatchEvent(new t.ExpandClickEvent)}injectConfig(e){this.#t=e,this.requestUpdate()}reloadConfig(){this.#s?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",this.#s?.reset(),this.requestUpdate()}get#s(){return this.renderRoot.querySelector("mw-chat")}get conversationId(){return this.#s?.conversationId??""}get messages(){return this.#s?.messages??[]}};xe.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(xe.CloseClickEvent.type,{...e})}};xe.ExpandClickEvent=class extends CustomEvent{static type="mw:expand-click";constructor(e={}){super(xe.ExpandClickEvent.type,{...e})}};customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",xe);var vs=class{#e;#t;get hidden(){return this.#e}get version(){return this.#t}constructor({hidden:e,version:r}){this.#e=e,this.#t=r}setHidden(e){this.#e=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 ke&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ke&&e.hideLauncher()}openChat(e){let{message:r,autoSend:i}=e||{};for(let n of document.querySelectorAll("molin-shop-ai"))n instanceof ke&&n.openChat({message:r,autoSend:i})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ke&&e.closeChat()}reset(){L().resetAll();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof ke&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof xe&&e.reset()}};function Ml({hidden:t,version:e}){let r=new vs({hidden:t,version:e});return window.Molin=r,r}function mi(){let t=window.Molin;if(!t)throw new Error("window.Molin global not initialized");return t}window.__INIT_MOLIN_SHOP_AI=function(e){zd(e);let r=fe(),i=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(Ml({hidden:i,version:e.version}),e.auto){let n=document.createElement("molin-shop-ai");n.setAttribute("cdn",e.cdn),n.setAttribute("widget",e.widgetId),document.body.appendChild(n)}Ke("molin:ready",{widgetId:e.widgetId})};function zd(t){window.__INIT_MOLIN_SHOP_AI_OPTIONS=t}function yl(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var ws=class extends w(v){static styles=O`
|
|
1730
1730
|
:host {
|
|
1731
1731
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
1732
1732
|
}
|
|
@@ -1740,11 +1740,11 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1740
1740
|
.src="${this.config?.bubble?.bubbleUrl}"
|
|
1741
1741
|
width="${z(this.config?.bubble?.size?.width)}"
|
|
1742
1742
|
height="${z(this.config?.bubble?.size?.height)}"></mw-bubble>
|
|
1743
|
-
`:null}};customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",
|
|
1743
|
+
`:null}};customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",ws);var k2="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),_2="navigator"in globalThis&&"share"in navigator,Wd=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function Vd(t){if(typeof window>"u")return!1;let e=Wd[t];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${t}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function xs(){return Vd("sm")}var gi=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 Dl({minMs:t,maxMs:e}){return Math.random()*(e-t)+t}function yi(t,e=""){return Object.entries(t).filter(([r,i])=>i).map(([r,i])=>`${e}${r}-[${i}]`).join(" ")}function Ol(t,e={}){return[yi(t),yi(e,"max-sm:")].join(" ")}function Pl(t){return yi(t)}function Ul(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 Rl(t){let e=yi(t),i=`sm:bottom-[${t.bottom?`calc(${t.bottom}+72px)`:"72px"}]`;return[e,i].filter(Boolean).join(" ")}var ks=class{#e=0;#t;#r;#i;constructor(e,r,{threshold:i=5}={}){this.#t=r,this.#r=i,e.addController(this)}hostConnected(){this.#e=window.scrollY,window.removeEventListener("scroll",this.#n),window.addEventListener("scroll",this.#n,{passive:!0})}hostDisconnected(){window.removeEventListener("scroll",this.#n),this.#i!==void 0&&(cancelAnimationFrame(this.#i),this.#i=void 0)}#n=()=>{this.#i===void 0&&(this.#i=requestAnimationFrame(this.#s))};#s=()=>{this.#i=void 0;let e=window.scrollY,r=e-this.#e;if(Math.abs(r)>=this.#r){let i=r>0?"down":"up";this.#t({scrollY:e,direction:i,deltaY:Math.abs(r)}),this.#e=e}}};function Ll(t,e,r){return new ks(t,e,r)}var ke=class extends w(v){static styles=O`
|
|
1744
1744
|
:host {
|
|
1745
1745
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
1746
1746
|
}
|
|
1747
|
-
`;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},_expanded:{type:Boolean,state:!0}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.xUserData=fe()?.userData,this.xCustomInstructions=fe()?.customInstructions,this._floatingInputVisible=!0,this._dialogShown=!1,this._expanded=!1}#e=wt(this);#t=
|
|
1747
|
+
`;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},_expanded:{type:Boolean,state:!0}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.xUserData=fe()?.userData,this.xCustomInstructions=fe()?.customInstructions,this._floatingInputVisible=!0,this._dialogShown=!1,this._expanded=!1}#e=wt(this);#t=Ll(this,e=>{this.#u&&!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 gi(this,/.*/i,{navigated:()=>{if(this.requestUpdate(),!this.widgetId){console.warn("No widgetId set, cannot track page view");return}let e=this.#f?.conversationId,r=nt.restore(this.widgetId)?.conversationId,i=e||r;i&&this.#o.onPageview({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=pa(this,()=>{this._dialogShown=!0});#a=fi();#o=Tl();#l=Ie(this);get#c(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647}get#u(){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=Ol(this.config.bubble.position,this.config.bubble.mobilePosition),r=Pl(this.config.bubble.position),i=Ul(this.config.bubble.position),n=Rl(this.config.bubble.position);return this.config.hidden||mi().hidden||this.#d?null:u`
|
|
1748
1748
|
<mw-bubble
|
|
1749
1749
|
class="${e} ${this._dialogShown?"opacity-0":"opacity-100"} fixed z-[${this.#c}] transition-opacity"
|
|
1750
1750
|
@click="${this.#_}"
|
|
@@ -1759,7 +1759,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1759
1759
|
${this.isPopupEnabled?u`
|
|
1760
1760
|
<mw-popup
|
|
1761
1761
|
position="${n}"
|
|
1762
|
-
delay="${this.config.popup?.delayMs||
|
|
1762
|
+
delay="${this.config.popup?.delayMs||Dl({minMs:2e3,maxMs:5e3})}"
|
|
1763
1763
|
sound="${this.config.popup?.muteSounds?"":this.config.popup?.soundUrl||""}"
|
|
1764
1764
|
?dark-mode="${this.config?.darkMode}"
|
|
1765
1765
|
.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}}}"
|
|
@@ -1804,7 +1804,7 @@ var Ol=Object.create;var ws=Object.defineProperty;var Pl=Object.getOwnPropertyDe
|
|
|
1804
1804
|
style="bottom: ${this.config.bubble.position.bottom||"1.5rem"}"
|
|
1805
1805
|
@mw-floating-ask-ai:submit="${this.#x}"></mw-floating-ask-ai>
|
|
1806
1806
|
`:null}
|
|
1807
|
-
`}#p({source:e}){this.#n?this._dialogShown=!0:(this.#n=!0,this.requestUpdate(),this.updateComplete.then(()=>{this.#s.request()})),L().widgetState={isOpen:!0},this.#o.onChatOpen({widgetId:this.widgetId,source:e})}#w(){this._expanded=!this._expanded,this.requestUpdate()}#h({source:e}){this._dialogShown=!1,this._expanded=!1,this._floatingInputVisible=!0,L().widgetState={isOpen:!1},this.#o.onChatClose({widgetId:this.widgetId,source:e})}get isPopupEnabled(){return
|
|
1807
|
+
`}#p({source:e}){this.#n?this._dialogShown=!0:(this.#n=!0,this.requestUpdate(),this.updateComplete.then(()=>{this.#s.request()})),L().widgetState={isOpen:!0},this.#o.onChatOpen({widgetId:this.widgetId,source:e})}#w(){this._expanded=!this._expanded,this.requestUpdate()}#h({source:e}){this._dialogShown=!1,this._expanded=!1,this._floatingInputVisible=!0,L().widgetState={isOpen:!1},this.#o.onChatClose({widgetId:this.widgetId,source:e})}get isPopupEnabled(){return xs()?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){this._dialogShown&&this.#m?.hide(),this._dialogShown&&this.#l.setTimeout(()=>this.#f?.focusInput(),0)}firstUpdated(){xs()&&L().widgetState?.isOpen&&!this._dialogShown&&this.#p({source:"page-navigation-restore"})}get#m(){return this.renderRoot.querySelector("mw-popup")}get#f(){return this.renderRoot.querySelector("molin-shop-ai-chat")?.renderRoot.querySelector("mw-chat")??null}#k(){this.#p({source:"popup-click"})}#_(){this._dialogShown?this.#h({source:"bubble-toggle"}):this.#p({source:"bubble-toggle"}),this.#m?.hide()}#E(){this.#h({source:"top-right-close-button"})}#x=e=>{this.#p({source:"ask-ai"});let r=e.detail.text;this.#l.setTimeout(()=>{this.#v(r),this.#y(r)},100),this.#a.onUserSentInput({widgetId:this.widgetId,text:r,example:!1,conversationId:this.#f?.conversationId||""})};#g=In({interval:200},({message:e,autoSend:r=!1}={})=>{if(!e)return;this.#v(e);let i=this.#f?.isLiveMode;i||this.reset(),r&&!i&&this.#y(e)});openChat(e){let{message:r,autoSend:i}=e||{};if(this._dialogShown){this.#g({message:r,autoSend:i});return}this.#p({source:"programmatic-method"}),this.#m?.hide(),this.#l.setTimeout(()=>{this.#g({message:r,autoSend:i})},100)}closeChat(){this._dialogShown&&(this.#h({source:"programmatic-method"}),this.#m?.hide())}showLauncher(){mi().setHidden(!1),this.requestUpdate(),this.#o.onShowLauncher({widgetId:this.widgetId,source:"programmatic-method"})}hideLauncher(){mi().setHidden(!0),this.requestUpdate(),this.#o.onHideLauncher({widgetId:this.widgetId,source:"programmatic-method"})}injectConfig(e){this.#r=e,this.requestUpdate()}reset(){this.xUserData={},this.xCustomInstructions="",this.#f?.reset(),this.requestUpdate()}#y(e){let r=this.#f;if(!r){console.warn("Chat element not found, cannot send message");return}if(!r.sendMessage){console.warn("Chat element does not have sendMessage method, cannot send message");return}r.sendMessage(e)}#v(e){let r=this.#f;if(!r){console.warn("Chat element not found, cannot set input value");return}if(!r.setInputValue){console.warn("Chat element does not have setInputValue method, cannot set input value");return}r.setInputValue(e)}};customElements.get("molin-shop-ai")||customElements.define("molin-shop-ai",ke);export{ke as MolinShopAI};
|
|
1808
1808
|
/*! Bundled license information:
|
|
1809
1809
|
|
|
1810
1810
|
@lit/reactive-element/css-tag.js:
|