@liip/liipgpt 3.3.3 → 3.3.4
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/button/liipgpt-button.iife.js +100 -61
- package/chat/liipgpt-chat.iife.js +102 -66
- package/config/index.cjs +13289 -3693
- package/config/index.d.ts +5246 -26814
- package/config/index.js +13253 -3657
- package/configurator/_app/env.js +1 -1
- package/configurator/_app/immutable/chunks/6gGOJNBB.js +1 -0
- package/configurator/_app/immutable/chunks/B9KqQVWK.js +1 -0
- package/configurator/_app/immutable/chunks/BR4Ri1mV.js +15 -0
- package/configurator/_app/immutable/chunks/BXCiGO5D.js +1 -0
- package/configurator/_app/immutable/chunks/BXvq-tJR.js +1 -0
- package/configurator/_app/immutable/chunks/Bg7q39r6.js +1 -0
- package/configurator/_app/immutable/chunks/{CUA2mQrz.js → CR5-hwU3.js} +1 -1
- package/configurator/_app/immutable/chunks/CfJtR48A.js +2 -0
- package/configurator/_app/immutable/chunks/DDdNR6B9.js +1 -0
- package/configurator/_app/immutable/chunks/DP18hDNz.js +324 -0
- package/configurator/_app/immutable/chunks/DZ0jooU7.js +1 -0
- package/configurator/_app/immutable/chunks/DoVxcdSh.js +143 -0
- package/configurator/_app/immutable/chunks/DsnmJJEf.js +1 -0
- package/configurator/_app/immutable/chunks/NTlCU5wx.js +113 -0
- package/configurator/_app/immutable/chunks/hrZ0qwUL.js +1 -0
- package/configurator/_app/immutable/entry/app.DX1BO32c.js +2 -0
- package/configurator/_app/immutable/entry/start.DU4iEglC.js +1 -0
- package/configurator/_app/immutable/nodes/{0.DMFk0iPH.js → 0.DFZ7OBkw.js} +3 -3
- package/configurator/_app/immutable/nodes/1.RVsOXI4d.js +1 -0
- package/configurator/_app/immutable/nodes/2.gxyeht7h.js +31 -0
- package/configurator/_app/immutable/nodes/3.BbSVwn6I.js +954 -0
- package/configurator/_app/version.json +1 -1
- package/configurator/index.html +12 -12
- package/configurator/sidebar.html +12 -12
- package/index.cjs +16233 -6041
- package/index.d.ts +6952 -70037
- package/index.js +16233 -6041
- package/package.json +4 -4
- package/configurator/_app/immutable/chunks/3Jx_2Hd6.js +0 -1
- package/configurator/_app/immutable/chunks/B6FwuxF-.js +0 -286
- package/configurator/_app/immutable/chunks/BXEdQL9F.js +0 -3
- package/configurator/_app/immutable/chunks/Bjule0iI.js +0 -1
- package/configurator/_app/immutable/chunks/C7PQ7vvk.js +0 -1
- package/configurator/_app/immutable/chunks/CCVb_64a.js +0 -15
- package/configurator/_app/immutable/chunks/CKh0DCID.js +0 -116
- package/configurator/_app/immutable/chunks/Cg1M8nhR.js +0 -1
- package/configurator/_app/immutable/chunks/CjlIFGQR.js +0 -1
- package/configurator/_app/immutable/chunks/DzvSdHYT.js +0 -1
- package/configurator/_app/immutable/chunks/NZTpNUN0.js +0 -1
- package/configurator/_app/immutable/chunks/PaGpozZ3.js +0 -1
- package/configurator/_app/immutable/chunks/UUVzZ2eQ.js +0 -1
- package/configurator/_app/immutable/chunks/w58EqJ4L.js +0 -143
- package/configurator/_app/immutable/entry/app.DaWMcPqV.js +0 -2
- package/configurator/_app/immutable/entry/start.B28NnTz6.js +0 -1
- package/configurator/_app/immutable/nodes/1.Dc_xA0Gn.js +0 -1
- package/configurator/_app/immutable/nodes/2.DlerhEWH.js +0 -31
- package/configurator/_app/immutable/nodes/3.BMx6bP8s.js +0 -897
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
var LiipGPTButton=function(sn){"use strict";const Gc="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Gc);const Wc=1,Qc=2,Yc=16,Kc=1,Xc=4,Jc=8,eu=16,tu=1,ru=2,Da="[",zn="[!",$a="]",vr={},he=Symbol(),nu="http://www.w3.org/1999/xhtml",au="http://www.w3.org/2000/svg",iu="@attach",wo=!1;var ln=Array.isArray,ou=Array.prototype.indexOf,za=Array.from,Fn=Object.keys,Fr=Object.defineProperty,$t=Object.getOwnPropertyDescriptor,su=Object.getOwnPropertyDescriptors,_o=Object.prototype,lu=Array.prototype,Fa=Object.getPrototypeOf,xo=Object.isExtensible;function cn(t){return typeof t=="function"}const br=()=>{};function So(t){return typeof t?.then=="function"}function To(t){for(var e=0;e<t.length;e++)t[e]()}function cu(){var t,e,r=new Promise((n,a)=>{t=n,e=a});return{promise:r,resolve:t,reject:e}}const We=2,Ba=4,ja=8,un=16,zt=32,kr=64,Ua=128,Qe=256,Bn=512,ve=1024,Ye=2048,yr=4096,pt=8192,wr=16384,qa=32768,Br=65536,Eo=1<<17,Co=1<<18,jn=1<<19,Ao=1<<20,Va=1<<21,Ha=1<<22,_r=1<<23,ar=Symbol("$state"),Za=Symbol("legacy props"),uu=Symbol(""),Ga=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},du=1,Ro=3,xr=8;function hu(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function Io(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function fu(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function pu(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function gu(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function mu(t){throw new Error("https://svelte.dev/e/effect_orphan")}function vu(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function bu(){throw new Error("https://svelte.dev/e/hydration_failed")}function ku(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function yu(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function wu(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function _u(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function dn(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function xu(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}let N=!1;function Te(t){N=t}let q;function be(t){if(t===null)throw dn(),vr;return q=t}function xt(){return be(Ke(q))}function Ft(t){if(N){if(Ke(q)!==null)throw dn(),vr;q=t}}function Lo(t=1){if(N){for(var e=t,r=q;e--;)r=Ke(r);q=r}}function hn(){for(var t=0,e=q;;){if(e.nodeType===xr){var r=e.data;if(r===$a){if(t===0)return e;t-=1}else(r===Da||r===zn)&&(t+=1)}var n=Ke(e);e.remove(),e=n}}function Oo(t){if(!t||t.nodeType!==xr)throw dn(),vr;return t.data}function Mo(t){return t===this.v}function No(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Po(t){return!No(t,this.v)}let Su=!1;const Tu=[];function Eu(t,e=!1){return Un(t,new Map,"",Tu)}function Un(t,e,r,n,a=null){if(typeof t=="object"&&t!==null){var i=e.get(t);if(i!==void 0)return i;if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);if(ln(t)){var o=Array(t.length);e.set(t,o),a!==null&&e.set(a,o);for(var s=0;s<t.length;s+=1){var c=t[s];s in t&&(o[s]=Un(c,e,r,n))}return o}if(Fa(t)===_o){o={},e.set(t,o),a!==null&&e.set(a,o);for(var l in t)o[l]=Un(t[l],e,r,n);return o}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function")return Un(t.toJSON(),e,r,n,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return t}}let Le=null;function ir(t){Le=t}function jr(t,e=!1,r){Le={p:Le,c:null,e:null,s:t,x:null,l:null}}function Ur(t){var e=Le,r=e.e;if(r!==null){e.e=null;for(var n of r)ts(n)}return t!==void 0&&(e.x=t),Le=e.p,t??{}}function Do(){return!0}const Cu=new WeakMap;function Au(t){var e=j;if(e===null)return H.f|=_r,t;if((e.f&qa)===0){if((e.f&Ua)===0)throw!e.parent&&t instanceof Error&&$o(t),t;e.b.error(t)}else qn(t,e)}function qn(t,e){for(;e!==null;){if((e.f&Ua)!==0)try{e.b.error(t);return}catch{}e=e.parent}throw t instanceof Error&&$o(t),t}function $o(t){const e=Cu.get(t);e&&(Fr(t,"message",{value:e.message}),Fr(t,"stack",{value:e.stack}))}let fn=[],Wa=[];function zo(){var t=fn;fn=[],To(t)}function Ru(){var t=Wa;Wa=[],To(t)}function Sr(t){fn.length===0&&queueMicrotask(zo),fn.push(t)}function Iu(){fn.length>0&&zo(),Wa.length>0&&Ru()}function Lu(t){let e=0,r=Bt(0),n;return()=>{Vu()&&(_(r),ei(()=>(e===0&&(n=mt(()=>t(()=>Gn(r)))),e+=1,()=>{Sr(()=>{e-=1,e===0&&(n?.(),n=void 0)})})))}}var Ou=Br|jn|Ua;function Mu(t,e,r){new Nu(t,e,r)}class Nu{pending=!1;parent;#e;#t;#a;#l;#u;#i=null;#r=null;#o=null;#s=null;#n=0;#c=!1;#d=null;#f=()=>{this.#d&&sr(this.#d,this.#n)};#h=Lu(()=>(this.#d=Bt(this.#n),()=>{this.#d=null}));constructor(e,r,n){this.#e=e,this.#a=r,this.#l=n,this.#t=q,this.parent=j.b,this.pending=!!this.#a.pending,this.#u=qt(()=>{j.b=this,N&&xt();const a=this.#a.pending;if(N&&a)this.#r=fe(()=>a(this.#e)),queueMicrotask(()=>{this.#i=this.#p(()=>(Tr.ensure(),fe(()=>this.#l(this.#e)))),this.#n>0?this.#g():(Et(this.#r,()=>{this.#r=null}),this.pending=!1)});else{try{this.#i=fe(()=>n(this.#e))}catch(i){this.error(i)}this.#n>0?this.#g():this.pending=!1}},Ou),N&&(this.#e=q)}has_pending_snippet(){return!!this.#a.pending}#p(e){var r=j,n=H,a=Le;ot(this.#u),Ae(this.#u),ir(this.#u.ctx);try{return e()}finally{ot(r),Ae(n),ir(a)}}#g(){const e=this.#a.pending;this.#i!==null&&(this.#s=document.createDocumentFragment(),Pu(this.#i,this.#s)),this.#r===null&&(this.#r=fe(()=>e(this.#e)))}#m(e){this.#n+=e,this.#n===0&&(this.pending=!1,this.#r&&Et(this.#r,()=>{this.#r=null}),this.#s&&(this.#e.before(this.#s),this.#s=null))}update_pending_count(e){this.has_pending_snippet()?this.#m(e):this.parent&&this.parent.#m(e),Ya.add(this.#f)}get_effect_pending(){return this.#h(),_(this.#d)}error(e){var r=this.#a.onerror;let n=this.#a.failed;const a=()=>{this.#n=0,this.#o!==null&&Et(this.#o,()=>{this.#o=null}),this.pending=!0,this.#i=this.#p(()=>(this.#c=!1,fe(()=>this.#l(this.#e)))),this.#n>0?this.#g():this.pending=!1};if(this.#c||!r&&!n)throw e;var i=H;try{Ae(null),r?.(e,a)}finally{Ae(i)}this.#i&&(ke(this.#i),this.#i=null),this.#r&&(ke(this.#r),this.#r=null),this.#o&&(ke(this.#o),this.#o=null),N&&(be(this.#t),Lo(),be(hn())),n&&Sr(()=>{this.#o=this.#p(()=>{this.#c=!0;try{return fe(()=>{n(this.#e,()=>e,()=>a)})}catch(o){return qn(o,this.#u.parent),null}finally{this.#c=!1}})})}}function Pu(t,e){for(var r=t.nodes_start,n=t.nodes_end;r!==null;){var a=r===n?null:Ke(r);e.append(r),r=a}}function Du(){for(var t=j.b;t!==null&&!t.has_pending_snippet();)t=t.parent;return t===null&&hu(),t}function Vn(t){var e=We|Ye,r=H!==null&&(H.f&We)!==0?H:null;return j===null||r!==null&&(r.f&Qe)!==0?e|=Qe:j.f|=jn,{ctx:Le,deps:null,effects:null,equals:Mo,f:e,fn:t,reactions:null,rv:0,v:he,wv:0,parent:r??j,ac:null}}function $u(t,e){let r=j;r===null&&fu();var n=r.b,a=void 0,i=Bt(he),o=null,s=!H;return Gu(()=>{try{var c=t()}catch(v){c=Promise.reject(v)}var l=()=>c;a=o?.then(l,l)??Promise.resolve(c),o=a;var d=He,p=n.pending;s&&(n.update_pending_count(1),p||d.increment());const h=(v,m=void 0)=>{o=null,p||d.activate(),m?m!==Ga&&(i.f|=_r,sr(i,m)):((i.f&_r)!==0&&(i.f^=_r),sr(i,v)),s&&(n.update_pending_count(-1),p||d.decrement()),qo()};if(a.then(h,v=>h(null,v||"unknown")),d)return()=>{queueMicrotask(()=>d.neuter())}}),new Promise(c=>{function l(d){function p(){d===a?c(i):l(a)}d.then(p,p)}l(a)})}function ee(t){const e=Vn(t);return us(e),e}function Fo(t){const e=Vn(t);return e.equals=Po,e}function Bo(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)ke(e[r])}}function zu(t){for(var e=t.parent;e!==null;){if((e.f&We)===0)return e;e=e.parent}return null}function Qa(t){var e,r=j;ot(zu(t));try{Bo(t),e=ps(t)}finally{ot(r)}return e}function jo(t){var e=Qa(t);if(t.equals(e)||(t.v=e,t.wv=hs()),!Cr)if(qr!==null)qr.set(t,t.v);else{var r=(cr||(t.f&Qe)!==0)&&t.deps!==null?yr:ve;Ee(t,r)}}function Uo(t,e,r){const n=Vn;if(e.length===0){r(t.map(n));return}var a=He,i=j,o=Fu(),s=Du();Promise.all(e.map(c=>$u(c))).then(c=>{a?.activate(),o();try{r([...t.map(n),...c])}catch(l){(i.f&wr)===0&&qn(l,i)}a?.deactivate(),qo()}).catch(c=>{s.error(c)})}function Fu(){var t=j,e=H,r=Le;return function(){ot(t),Ae(e),ir(r)}}function qo(){ot(null),Ae(null),ir(null)}const Hn=new Set;let He=null,qr=null,Ya=new Set,Vr=[],Zn=null,Ka=!1;class Tr{#e=new Map;#t=new Map;#a=new Set;#l=0;#u=null;#i=!1;#r=[];#o=[];#s=[];#n=[];#c=[];skipped_effects=new Set;#d(e){Vr=[];var r=null;if(Hn.size>1){r=new Map,qr=new Map;for(const[i,o]of this.#e)r.set(i,{v:i.v,wv:i.wv}),i.v=o;for(const i of Hn)if(i!==this)for(const[o,s]of i.#t)r.has(o)||(r.set(o,{v:o.v,wv:o.wv}),o.v=s)}for(const i of e)this.#f(i);if(this.#r.length===0&&this.#l===0){var n=this.#s,a=this.#n;this.#s=[],this.#n=[],this.#c=[],this.#h(),Vo(n),Vo(a),this.#u?.resolve()}else{for(const i of this.#s)Ee(i,ve);for(const i of this.#n)Ee(i,ve);for(const i of this.#c)Ee(i,ve)}if(r){for(const[i,{v:o,wv:s}]of r)i.wv<=s&&(i.v=o);qr=null}for(const i of this.#r)gn(i);for(const i of this.#o)gn(i);this.#r=[],this.#o=[]}#f(e){e.f^=ve;for(var r=e.first;r!==null;){var n=r.f,a=(n&(zt|kr))!==0,i=a&&(n&ve)!==0,o=i||(n&pt)!==0||this.skipped_effects.has(r);if(!o&&r.fn!==null){if(a)r.f^=ve;else if((n&Ba)!==0)this.#n.push(r);else if(Kn(r))if((n&Ha)!==0){var s=r.b?.pending?this.#o:this.#r;s.push(r)}else(r.f&un)!==0&&this.#c.push(r),gn(r);var c=r.first;if(c!==null){r=c;continue}}var l=r.parent;for(r=r.next;r===null&&l!==null;)r=l.next,l=l.parent}}capture(e,r){this.#t.has(e)||this.#t.set(e,r),this.#e.set(e,e.v)}activate(){He=this}deactivate(){He=null;for(const e of Ya)if(Ya.delete(e),e(),He!==null)break}neuter(){this.#i=!0}flush(){Vr.length>0?this.flush_effects():this.#h(),He===this&&(this.#l===0&&Hn.delete(this),this.deactivate())}flush_effects(){var e=Zr;Ka=!0;try{var r=0;for(ls(!0);Vr.length>0;){if(r++>1e3){var n,a;Bu()}this.#d(Vr),Er.clear()}}finally{Ka=!1,ls(e),Zn=null}}#h(){if(!this.#i)for(const e of this.#a)e();this.#a.clear()}increment(){this.#l+=1}decrement(){if(this.#l-=1,this.#l===0){for(const e of this.#s)Ee(e,Ye),or(e);for(const e of this.#n)Ee(e,Ye),or(e);for(const e of this.#c)Ee(e,Ye),or(e);this.#s=[],this.#n=[],this.flush()}else this.deactivate()}add_callback(e){this.#a.add(e)}settled(){return(this.#u??=cu()).promise}static ensure(e=!0){if(He===null){const r=He=new Tr;Hn.add(He),e&&queueMicrotask(()=>{He===r&&r.flush()})}return He}}function re(t){var e;const r=Tr.ensure(!1);for(;;){if(Iu(),Vr.length===0)return r===He&&r.flush(),Zn=null,e;r.flush_effects()}}function Bu(){try{vu()}catch(t){qn(t,Zn)}}function Vo(t){var e=t.length;if(e!==0){for(var r=0;r<e;r++){var n=t[r];if((n.f&(wr|pt))===0&&Kn(n)){var a=Yn;if(gn(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?is(n):n.fn=null),Yn>a&&(n.f&Ao)!==0)break}}for(;r<e;r+=1)or(t[r])}}function or(t){for(var e=Zn=t;e.parent!==null;){e=e.parent;var r=e.f;if(Ka&&e===j&&(r&un)!==0)return;if((r&(kr|zt))!==0){if((r&ve)===0)return;e.f^=ve}}Vr.push(e)}const Er=new Map;function Bt(t,e){var r={f:0,v:t,reactions:null,equals:Mo,rv:0,wv:0};return r}function te(t,e){const r=Bt(t);return us(r),r}function Ho(t,e=!1,r=!0){const n=Bt(t);return e||(n.equals=Po),n}function $(t,e,r=!1){H!==null&&(!gt||(H.f&Eo)!==0)&&Do()&&(H.f&(We|un|Ha|Eo))!==0&&!Vt?.includes(t)&&_u();let n=r?St(e):e;return sr(t,n)}function sr(t,e){if(!t.equals(e)){var r=t.v;Cr?Er.set(t,e):Er.set(t,r),t.v=e,Tr.ensure().capture(t,r),(t.f&We)!==0&&((t.f&Ye)!==0&&Qa(t),Ee(t,(t.f&Qe)===0?ve:yr)),t.wv=hs(),Zo(t,Ye),j!==null&&(j.f&ve)!==0&&(j.f&(zt|kr))===0&&(st===null?Qu([t]):st.push(t))}return e}function Gn(t){$(t,t.v+1)}function Zo(t,e){var r=t.reactions;if(r!==null)for(var n=r.length,a=0;a<n;a++){var i=r[a],o=i.f;(o&Ye)===0&&(Ee(i,e),(o&(ve|Qe))!==0&&((o&We)!==0?Zo(i,yr):or(i)))}}function St(t){if(typeof t!="object"||t===null||ar in t)return t;const e=Fa(t);if(e!==_o&&e!==lu)return t;var r=new Map,n=ln(t),a=te(0),i=Ar,o=s=>{if(Ar===i)return s();var c=H,l=Ar;Ae(null),ds(i);var d=s();return Ae(c),ds(l),d};return n&&r.set("length",te(t.length)),new Proxy(t,{defineProperty(s,c,l){(!("value"in l)||l.configurable===!1||l.enumerable===!1||l.writable===!1)&&yu();var d=r.get(c);return d===void 0?d=o(()=>{var p=te(l.value);return r.set(c,p),p}):$(d,l.value,!0),!0},deleteProperty(s,c){var l=r.get(c);if(l===void 0){if(c in s){const d=o(()=>te(he));r.set(c,d),Gn(a)}}else $(l,he),Gn(a);return!0},get(s,c,l){if(c===ar)return t;var d=r.get(c),p=c in s;if(d===void 0&&(!p||$t(s,c)?.writable)&&(d=o(()=>{var v=St(p?s[c]:he),m=te(v);return m}),r.set(c,d)),d!==void 0){var h=_(d);return h===he?void 0:h}return Reflect.get(s,c,l)},getOwnPropertyDescriptor(s,c){var l=Reflect.getOwnPropertyDescriptor(s,c);if(l&&"value"in l){var d=r.get(c);d&&(l.value=_(d))}else if(l===void 0){var p=r.get(c),h=p?.v;if(p!==void 0&&h!==he)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return l},has(s,c){if(c===ar)return!0;var l=r.get(c),d=l!==void 0&&l.v!==he||Reflect.has(s,c);if(l!==void 0||j!==null&&(!d||$t(s,c)?.writable)){l===void 0&&(l=o(()=>{var h=d?St(s[c]):he,v=te(h);return v}),r.set(c,l));var p=_(l);if(p===he)return!1}return d},set(s,c,l,d){var p=r.get(c),h=c in s;if(n&&c==="length")for(var v=l;v<p.v;v+=1){var m=r.get(v+"");m!==void 0?$(m,he):v in s&&(m=o(()=>te(he)),r.set(v+"",m))}if(p===void 0)(!h||$t(s,c)?.writable)&&(p=o(()=>te(void 0)),$(p,St(l)),r.set(c,p));else{h=p.v!==he;var b=o(()=>St(l));$(p,b)}var A=Reflect.getOwnPropertyDescriptor(s,c);if(A?.set&&A.set.call(d,l),!h){if(n&&typeof c=="string"){var y=r.get("length"),k=Number(c);Number.isInteger(k)&&k>=y.v&&$(y,k+1)}Gn(a)}return!0},ownKeys(s){_(a);var c=Reflect.ownKeys(s).filter(p=>{var h=r.get(p);return h===void 0||h.v!==he});for(var[l,d]of r)d.v!==he&&!(l in s)&&c.push(l);return c},setPrototypeOf(){wu()}})}function Go(t){try{if(t!==null&&typeof t=="object"&&ar in t)return t[ar]}catch{}return t}function ju(t,e){return Object.is(Go(t),Go(e))}var Xa,Wo,Qo,Yo;function Ja(){if(Xa===void 0){Xa=window,Wo=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;Qo=$t(e,"firstChild").get,Yo=$t(e,"nextSibling").get,xo(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),xo(r)&&(r.__t=void 0)}}function jt(t=""){return document.createTextNode(t)}function it(t){return Qo.call(t)}function Ke(t){return Yo.call(t)}function Ut(t,e){if(!N)return it(t);var r=it(q);if(r===null)r=q.appendChild(jt());else if(e&&r.nodeType!==Ro){var n=jt();return r?.before(n),be(n),n}return be(r),r}function Oe(t,e){if(!N){var r=it(t);return r instanceof Comment&&r.data===""?Ke(r):r}return q}function lr(t,e=1,r=!1){let n=N?q:t;for(var a;e--;)a=n,n=Ke(n);if(!N)return n;if(r&&n?.nodeType!==Ro){var i=jt();return n===null?a?.after(i):n.before(i),be(i),i}return be(n),n}function Ko(t){t.textContent=""}function Xo(){return!1}function Uu(t){j===null&&H===null&&mu(),H!==null&&(H.f&Qe)!==0&&j===null&&gu(),Cr&&pu()}function qu(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function Tt(t,e,r,n=!0){var a=j;a!==null&&(a.f&pt)!==0&&(t|=pt);var i={ctx:Le,deps:null,nodes_start:null,nodes_end:null,f:t|Ye,first:null,fn:e,last:null,next:null,parent:a,b:a&&a.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(r)try{gn(i),i.f|=qa}catch(c){throw ke(i),c}else e!==null&&or(i);var o=r&&i.deps===null&&i.first===null&&i.nodes_start===null&&i.teardown===null&&(i.f&jn)===0;if(!o&&n&&(a!==null&&qu(i,a),H!==null&&(H.f&We)!==0)){var s=H;(s.effects??=[]).push(i)}return i}function Vu(){return H!==null&&!gt}function Jo(t){const e=Tt(ja,null,!1);return Ee(e,ve),e.teardown=t,e}function es(t){Uu();var e=j.f,r=!H&&(e&zt)!==0&&(e&qa)===0;if(r){var n=Le;(n.e??=[]).push(t)}else return ts(t)}function ts(t){return Tt(Ba|Ao,t,!1)}function Hu(t){Tr.ensure();const e=Tt(kr,t,!0);return()=>{ke(e)}}function Zu(t){Tr.ensure();const e=Tt(kr,t,!0);return(r={})=>new Promise(n=>{r.outro?Et(e,()=>{ke(e),n(void 0)}):(ke(e),n(void 0))})}function Wn(t){return Tt(Ba,t,!1)}function Gu(t){return Tt(Ha|jn,t,!0)}function ei(t,e=0){return Tt(ja|e,t,!0)}function Qn(t,e=[],r=[]){Uo(e,r,n=>{Tt(ja,()=>t(...n.map(_)),!0)})}function qt(t,e=0){var r=Tt(un|e,t,!0);return r}function fe(t,e=!0){return Tt(zt,t,!0,e)}function rs(t){var e=t.teardown;if(e!==null){const r=Cr,n=H;cs(!0),Ae(null);try{e.call(null)}finally{cs(r),Ae(n)}}}function ns(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){r.ac?.abort(Ga);var n=r.next;(r.f&kr)!==0?r.parent=null:ke(r,e),r=n}}function Wu(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&zt)===0&&ke(e),e=r}}function ke(t,e=!0){var r=!1;(e||(t.f&Co)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(as(t.nodes_start,t.nodes_end),r=!0),ns(t,e&&!r),Xn(t,0),Ee(t,wr);var n=t.transitions;if(n!==null)for(const i of n)i.stop();rs(t);var a=t.parent;a!==null&&a.first!==null&&is(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function as(t,e){for(;t!==null;){var r=t===e?null:Ke(t);t.remove(),t=r}}function is(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function Et(t,e){var r=[];ti(t,r,!0),os(r,()=>{ke(t),e&&e()})}function os(t,e){var r=t.length;if(r>0){var n=()=>--r||e();for(var a of t)a.out(n)}else e()}function ti(t,e,r){if((t.f&pt)===0){if(t.f^=pt,t.transitions!==null)for(const o of t.transitions)(o.is_global||r)&&e.push(o);for(var n=t.first;n!==null;){var a=n.next,i=(n.f&Br)!==0||(n.f&zt)!==0;ti(n,e,i?r:!1),n=a}}}function Hr(t){ss(t,!0)}function ss(t,e){if((t.f&pt)!==0){t.f^=pt,(t.f&ve)===0&&(Ee(t,Ye),or(t));for(var r=t.first;r!==null;){var n=r.next,a=(r.f&Br)!==0||(r.f&zt)!==0;ss(r,a?e:!1),r=n}if(t.transitions!==null)for(const i of t.transitions)(i.is_global||e)&&i.in()}}let Zr=!1;function ls(t){Zr=t}let Cr=!1;function cs(t){Cr=t}let H=null,gt=!1;function Ae(t){H=t}let j=null;function ot(t){j=t}let Vt=null;function us(t){H!==null&&(Vt===null?Vt=[t]:Vt.push(t))}let Me=null,Xe=0,st=null;function Qu(t){st=t}let Yn=1,pn=0,Ar=pn;function ds(t){Ar=t}let cr=!1;function hs(){return++Yn}function Kn(t){var e=t.f;if((e&Ye)!==0)return!0;if((e&yr)!==0){var r=t.deps,n=(e&Qe)!==0;if(r!==null){var a,i,o=(e&Bn)!==0,s=n&&j!==null&&!cr,c=r.length;if((o||s)&&(j===null||(j.f&wr)===0)){var l=t,d=l.parent;for(a=0;a<c;a++)i=r[a],(o||!i?.reactions?.includes(l))&&(i.reactions??=[]).push(l);o&&(l.f^=Bn),s&&d!==null&&(d.f&Qe)===0&&(l.f^=Qe)}for(a=0;a<c;a++)if(i=r[a],Kn(i)&&jo(i),i.wv>t.wv)return!0}(!n||j!==null&&!cr)&&Ee(t,ve)}return!1}function fs(t,e,r=!0){var n=t.reactions;if(n!==null&&!Vt?.includes(t))for(var a=0;a<n.length;a++){var i=n[a];(i.f&We)!==0?fs(i,e,!1):e===i&&(r?Ee(i,Ye):(i.f&ve)!==0&&Ee(i,yr),or(i))}}function ps(t){var e=Me,r=Xe,n=st,a=H,i=cr,o=Vt,s=Le,c=gt,l=Ar,d=t.f;Me=null,Xe=0,st=null,cr=(d&Qe)!==0&&(gt||!Zr||H===null),H=(d&(zt|kr))===0?t:null,Vt=null,ir(t.ctx),gt=!1,Ar=++pn,t.ac!==null&&(t.ac.abort(Ga),t.ac=null);try{t.f|=Va;var p=(0,t.fn)(),h=t.deps;if(Me!==null){var v;if(Xn(t,Xe),h!==null&&Xe>0)for(h.length=Xe+Me.length,v=0;v<Me.length;v++)h[Xe+v]=Me[v];else t.deps=h=Me;if(!cr||(d&We)!==0&&t.reactions!==null)for(v=Xe;v<h.length;v++)(h[v].reactions??=[]).push(t)}else h!==null&&Xe<h.length&&(Xn(t,Xe),h.length=Xe);if(Do()&&st!==null&&!gt&&h!==null&&(t.f&(We|yr|Ye))===0)for(v=0;v<st.length;v++)fs(st[v],t);return a!==null&&a!==t&&(pn++,st!==null&&(n===null?n=st:n.push(...st))),(t.f&_r)!==0&&(t.f^=_r),p}catch(m){return Au(m)}finally{t.f^=Va,Me=e,Xe=r,st=n,H=a,cr=i,Vt=o,ir(s),gt=c,Ar=l}}function Yu(t,e){let r=e.reactions;if(r!==null){var n=ou.call(r,t);if(n!==-1){var a=r.length-1;a===0?r=e.reactions=null:(r[n]=r[a],r.pop())}}r===null&&(e.f&We)!==0&&(Me===null||!Me.includes(e))&&(Ee(e,yr),(e.f&(Qe|Bn))===0&&(e.f^=Bn),Bo(e),Xn(e,0))}function Xn(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)Yu(t,r[n])}function gn(t){var e=t.f;if((e&wr)===0){Ee(t,ve);var r=j,n=Zr;j=t,Zr=!0;try{(e&un)!==0?Wu(t):ns(t),rs(t);var a=ps(t);t.teardown=typeof a=="function"?a:null,t.wv=Yn;var i;wo&&Su&&(t.f&Ye)!==0&&t.deps}finally{Zr=n,j=r}}}async function gs(){await Promise.resolve(),re()}function _(t){var e=t.f,r=(e&We)!==0;if(H!==null&&!gt){var n=j!==null&&(j.f&wr)!==0;if(!n&&!Vt?.includes(t)){var a=H.deps;if((H.f&Va)!==0)t.rv<pn&&(t.rv=pn,Me===null&&a!==null&&a[Xe]===t?Xe++:Me===null?Me=[t]:(!cr||!Me.includes(t))&&Me.push(t));else{(H.deps??=[]).push(t);var i=t.reactions;i===null?t.reactions=[H]:i.includes(H)||i.push(H)}}}else if(r&&t.deps===null&&t.effects===null){var o=t,s=o.parent;s!==null&&(s.f&Qe)===0&&(o.f^=Qe)}if(Cr){if(Er.has(t))return Er.get(t);if(r){o=t;var c=o.v;return((o.f&ve)!==0||ms(o))&&(c=Qa(o)),Er.set(o,c),c}}else if(r){if(o=t,qr?.has(o))return qr.get(o);Kn(o)&&jo(o)}if((t.f&_r)!==0)throw t.v;return t.v}function ms(t){if(t.v===he)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Er.has(e)||(e.f&We)!==0&&ms(e))return!0;return!1}function mt(t){var e=gt;try{return gt=!0,t()}finally{gt=e}}const Ku=-7169;function Ee(t,e){t.f=t.f&Ku|e}function Xu(t,e){if(e){const r=document.body;t.autofocus=!0,Sr(()=>{document.activeElement===r&&t.focus()})}}function Ju(t){var e=H,r=j;Ae(null),ot(null);try{return t()}finally{Ae(e),ot(r)}}const vs=new Set,ri=new Set;function bs(t,e,r,n={}){function a(i){if(n.capture||mn.call(e,i),!i.cancelBubble)return Ju(()=>r?.call(this,i))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Sr(()=>{e.addEventListener(t,a,n)}):e.addEventListener(t,a,n),a}function ed(t,e,r,n,a){var i={capture:n,passive:a},o=bs(t,e,r,i);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Jo(()=>{e.removeEventListener(t,o,i)})}function ks(t){for(var e=0;e<t.length;e++)vs.add(t[e]);for(var r of ri)r(t)}function mn(t){var e=this,r=e.ownerDocument,n=t.type,a=t.composedPath?.()||[],i=a[0]||t.target,o=0,s=t.__root;if(s){var c=a.indexOf(s);if(c!==-1&&(e===document||e===window)){t.__root=e;return}var l=a.indexOf(e);if(l===-1)return;c<=l&&(o=c)}if(i=a[o]||t.target,i!==e){Fr(t,"currentTarget",{configurable:!0,get(){return i||r}});var d=H,p=j;Ae(null),ot(null);try{for(var h,v=[];i!==null;){var m=i.assignedSlot||i.parentNode||i.host||null;try{var b=i["__"+n];if(b!=null&&(!i.disabled||t.target===i))if(ln(b)){var[A,...y]=b;A.apply(i,[t,...y])}else b.call(i,t)}catch(k){h?v.push(k):h=k}if(t.cancelBubble||m===e||m===null)break;i=m}if(h){for(let k of v)queueMicrotask(()=>{throw k});throw h}}finally{t.__root=e,delete t.currentTarget,Ae(d),ot(p)}}}let lt;function td(){lt=void 0}function rd(t){let e=null,r=N;var n;if(N){for(e=q,lt===void 0&&(lt=it(document.head));lt!==null&&(lt.nodeType!==xr||lt.data!==Da);)lt=Ke(lt);lt===null?Te(!1):lt=be(Ke(lt))}N||(n=document.head.appendChild(jt()));try{qt(()=>t(n),Co)}finally{r&&(Te(!0),lt=q,be(e))}}function ys(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Ht(t,e){var r=j;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function Ct(t,e){var r=(e&tu)!==0,n=(e&ru)!==0,a,i=!t.startsWith("<!>");return()=>{if(N)return Ht(q,null),q;a===void 0&&(a=ys(i?t:"<!>"+t),r||(a=it(a)));var o=n||Wo?document.importNode(a,!0):a.cloneNode(!0);if(r){var s=it(o),c=o.lastChild;Ht(s,c)}else Ht(o,o);return o}}function vt(){if(N)return Ht(q,null),q;var t=document.createDocumentFragment(),e=document.createComment(""),r=jt();return t.append(e,r),Ht(e,r),t}function oe(t,e){if(N){j.nodes_end=q,xt();return}t!==null&&t.before(e)}function nd(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const ad=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function id(t){return ad.includes(t)}const od={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function sd(t){return t=t.toLowerCase(),od[t]??t}const ld=["touchstart","touchmove"];function cd(t){return ld.includes(t)}const ud=["textarea","script","style","title"];function dd(t){return ud.includes(t)}function ws(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??=t.nodeValue)&&(t.__t=r,t.nodeValue=r+"")}function _s(t,e){return xs(t,e)}function hd(t,e){Ja(),e.intro=e.intro??!1;const r=e.target,n=N,a=q;try{for(var i=it(r);i&&(i.nodeType!==xr||i.data!==Da);)i=Ke(i);if(!i)throw vr;Te(!0),be(i),xt();const o=xs(t,{...e,anchor:i});if(q===null||q.nodeType!==xr||q.data!==$a)throw dn(),vr;return Te(!1),o}catch(o){if(o===vr)return e.recover===!1&&bu(),Ja(),Ko(r),Te(!1),_s(t,e);throw o}finally{Te(n),be(a),td()}}const Gr=new Map;function xs(t,{target:e,anchor:r,props:n={},events:a,context:i,intro:o=!0}){Ja();var s=new Set,c=p=>{for(var h=0;h<p.length;h++){var v=p[h];if(!s.has(v)){s.add(v);var m=cd(v);e.addEventListener(v,mn,{passive:m});var b=Gr.get(v);b===void 0?(document.addEventListener(v,mn,{passive:m}),Gr.set(v,1)):Gr.set(v,b+1)}}};c(za(vs)),ri.add(c);var l=void 0,d=Zu(()=>{var p=r??e.appendChild(jt());return fe(()=>{if(i){jr({});var h=Le;h.c=i}a&&(n.$$events=a),N&&Ht(p,null),l=t(p,n)||{},N&&(j.nodes_end=q),i&&Ur()}),()=>{for(var h of s){e.removeEventListener(h,mn);var v=Gr.get(h);--v===0?(document.removeEventListener(h,mn),Gr.delete(h)):Gr.set(h,v)}ri.delete(c),p!==r&&p.parentNode?.removeChild(p)}});return ni.set(l,d),l}let ni=new WeakMap;function fd(t,e){const r=ni.get(t);return r?(ni.delete(t),r(e)):Promise.resolve()}function Ss(t,e,...r){var n=t,a=br,i;qt(()=>{a!==(a=e())&&(i&&(ke(i),i=null),i=fe(()=>a(n,...r)))},Br),N&&(n=q)}function pd(t){Le===null&&Io(),es(()=>{const e=mt(t);if(typeof e=="function")return e})}function gd(t){Le===null&&Io(),pd(()=>()=>mt(t))}const ai=0,Jn=1,ii=2;function Ts(t,e,r,n,a){N&&xt();var i=t,o=Le,s=he,c,l,d,p=Bt(void 0),h=Bt(void 0),v=!1;function m(A,y){v=!0,y&&(ot(b),Ae(b),ir(o));try{A===ai&&r&&(c?Hr(c):c=fe(()=>r(i))),A===Jn&&n&&(l?Hr(l):l=fe(()=>n(i,p))),A!==ai&&c&&Et(c,()=>c=null),A!==Jn&&l&&Et(l,()=>l=null),A!==ii&&d&&Et(d,()=>d=null)}finally{y&&(ir(null),Ae(null),ot(null),re())}}var b=qt(()=>{if(s===(s=e()))return;let A=N&&So(s)===(i.data===zn);if(A&&(i=hn(),be(i),Te(!1),A=!0),So(s)){var y=s;v=!1,y.then(k=>{y===s&&(sr(p,k),m(Jn,!0))},k=>{if(y===s)throw sr(h,k),m(ii,!0),h.v}),N?r&&(c=fe(()=>r(i))):Sr(()=>{v||m(ai,!0)})}else sr(p,s),m(Jn,!1);return A&&Te(!0),()=>s=he});N&&(i=q)}function ur(t,e,r=!1){N&&xt();var n=t,a=null,i=null,o=he,s=r?Br:0,c=!1;const l=(v,m=!0)=>{c=!0,h(m,v)};var d=null;function p(){d!==null&&(d.lastChild.remove(),n.before(d),d=null);var v=o?a:i,m=o?i:a;v&&Hr(v),m&&Et(m,()=>{o?i=null:a=null})}const h=(v,m)=>{if(o===(o=v))return;let b=!1;if(N){const I=Oo(n)===zn;!!o===I&&(n=hn(),be(n),Te(!1),b=!0)}var A=Xo(),y=n;if(A&&(d=document.createDocumentFragment(),d.append(y=jt())),o?a??=m&&fe(()=>m(y)):i??=m&&fe(()=>m(y)),A){var k=He,w=o?a:i,T=o?i:a;w&&k.skipped_effects.delete(w),T&&k.skipped_effects.add(T),k.add_callback(p)}else p();b&&Te(!0)};qt(()=>{c=!1,e(l),c||h(null,null)},s),N&&(n=q)}function md(t,e){return e}function vd(t,e,r){for(var n=t.items,a=[],i=e.length,o=0;o<i;o++)ti(e[o].e,a,!0);var s=i>0&&a.length===0&&r!==null;if(s){var c=r.parentNode;Ko(c),c.append(r),n.clear(),At(t,e[0].prev,e[i-1].next)}os(a,()=>{for(var l=0;l<i;l++){var d=e[l];s||(n.delete(d.k),At(t,d.prev,d.next)),ke(d.e,!s)}})}function bd(t,e,r,n,a,i=null){var o=t,s={flags:e,items:new Map,first:null};N&&xt();var c=null,l=!1,d=new Map,p=Fo(()=>{var b=r();return ln(b)?b:b==null?[]:za(b)}),h,v;function m(){kd(v,h,s,d,o,a,e,n,r),i!==null&&(h.length===0?c?Hr(c):c=fe(()=>i(o)):c!==null&&Et(c,()=>{c=null}))}qt(()=>{v??=j,h=_(p);var b=h.length;if(l&&b===0)return;l=b===0;let A=!1;if(N){var y=Oo(o)===zn;y!==(b===0)&&(o=hn(),be(o),Te(!1),A=!0)}if(N){for(var k=null,w,T=0;T<b;T++){if(q.nodeType===xr&&q.data===$a){o=q,A=!0,Te(!1);break}var I=h[T],U=n(I,T);w=oi(q,s,k,null,I,U,T,a,e,r),s.items.set(U,w),k=w}b>0&&be(hn())}if(N)b===0&&i&&(c=fe(()=>i(o)));else if(Xo()){var Q=new Set,je=He;for(T=0;T<b;T+=1){I=h[T],U=n(I,T);var ce=s.items.get(U)??d.get(U);ce?Es(ce,I,T):(w=oi(null,s,null,null,I,U,T,a,e,r,!0),d.set(U,w)),Q.add(U)}for(const[pr,ae]of s.items)Q.has(pr)||je.skipped_effects.add(ae.e);je.add_callback(m)}else m();A&&Te(!0),_(p)}),N&&(o=q)}function kd(t,e,r,n,a,i,o,s,c){var l=e.length,d=r.items,p=r.first,h=p,v,m=null,b=[],A=[],y,k,w,T;for(T=0;T<l;T+=1){if(y=e[T],k=s(y,T),w=d.get(k),w===void 0){var I=n.get(k);if(I!==void 0){n.delete(k),d.set(k,I);var U=m?m.next:h;At(r,m,I),At(r,I,U),si(I,U,a),m=I}else{var Q=h?h.e.nodes_start:a;m=oi(Q,r,m,m===null?r.first:m.next,y,k,T,i,o,c)}d.set(k,m),b=[],A=[],h=m.next;continue}if(Es(w,y,T),(w.e.f&pt)!==0&&Hr(w.e),w!==h){if(v!==void 0&&v.has(w)){if(b.length<A.length){var je=A[0],ce;m=je.prev;var pr=b[0],ae=b[b.length-1];for(ce=0;ce<b.length;ce+=1)si(b[ce],je,a);for(ce=0;ce<A.length;ce+=1)v.delete(A[ce]);At(r,pr.prev,ae.next),At(r,m,pr),At(r,ae,je),h=je,m=ae,T-=1,b=[],A=[]}else v.delete(w),si(w,h,a),At(r,w.prev,w.next),At(r,w,m===null?r.first:m.next),At(r,m,w),m=w;continue}for(b=[],A=[];h!==null&&h.k!==k;)(h.e.f&pt)===0&&(v??=new Set).add(h),A.push(h),h=h.next;if(h===null)continue;w=h}b.push(w),m=w,h=w.next}if(h!==null||v!==void 0){for(var er=v===void 0?[]:za(v);h!==null;)(h.e.f&pt)===0&&er.push(h),h=h.next;var gr=er.length;if(gr>0){var mr=null;vd(r,er,mr)}}t.first=r.first&&r.first.e,t.last=m&&m.e;for(var rn of n.values())ke(rn.e);n.clear()}function Es(t,e,r,n){sr(t.v,e),t.i=r}function oi(t,e,r,n,a,i,o,s,c,l,d){var p=(c&Wc)!==0,h=(c&Yc)===0,v=p?h?Ho(a,!1,!1):Bt(a):a,m=(c&Qc)===0?o:Bt(o),b={i:m,v,k:i,a:null,e:null,prev:r,next:n};try{if(t===null){var A=document.createDocumentFragment();A.append(t=jt())}return b.e=fe(()=>s(t,v,m,l),N),b.e.prev=r&&r.e,b.e.next=n&&n.e,r===null?d||(e.first=b):(r.next=b,r.e.next=b.e),n!==null&&(n.prev=b,n.e.prev=b.e),b}finally{}}function si(t,e,r){for(var n=t.next?t.next.e.nodes_start:r,a=e?e.e.nodes_start:r,i=t.e.nodes_start;i!==null&&i!==n;){var o=Ke(i);a.before(i),i=o}}function At(t,e,r){e===null?t.first=r:(e.next=r,e.e.next=r&&r.e),r!==null&&(r.prev=e,r.e.prev=e&&e.e)}function li(t,e,r=!1,n=!1,a=!1){var i=t,o="";Qn(()=>{var s=j;if(o===(o=e()??"")){N&&xt();return}if(s.nodes_start!==null&&(as(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),o!==""){if(N){q.data;for(var c=xt(),l=c;c!==null&&(c.nodeType!==xr||c.data!=="");)l=c,c=Ke(c);if(c===null)throw dn(),vr;Ht(q,l),i=be(c);return}var d=o+"";r?d=`<svg>${d}</svg>`:n&&(d=`<math>${d}</math>`);var p=ys(d);if((r||n)&&(p=it(p)),Ht(it(p),p.lastChild),r||n)for(;it(p);)i.before(it(p));else i.before(p)}})}function Cs(t,e,r,n,a,i){let o=N;N&&xt();var s,c,l=null;N&&q.nodeType===du&&(l=q,xt());var d=N?q:t,p;qt(()=>{const h=e()||null;var v=h==="svg"?au:null;h!==s&&(p&&(h===null?Et(p,()=>{p=null,c=null}):h===c?Hr(p):ke(p)),h&&h!==c&&(p=fe(()=>{if(l=N?l:v?document.createElementNS(v,h):document.createElement(h),Ht(l,l),n){N&&dd(h)&&l.append(document.createComment(""));var m=N?it(l):l.appendChild(jt());N&&(m===null?Te(!1):be(m)),n(l,m)}j.nodes_end=l,d.before(l)})),s=h,s&&(c=s))},Br),o&&(Te(!0),be(d))}function yd(t,e){Sr(()=>{var r=t.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+e.hash)){const a=document.createElement("style");a.id=e.hash,a.textContent=e.code,n.appendChild(a)}})}function As(t,e,r){Wn(()=>{var n=mt(()=>e(t,r?.())||{});if(n?.destroy)return()=>n.destroy()})}function wd(t,e){var r=void 0,n;qt(()=>{r!==(r=e())&&(n&&(ke(n),n=null),r&&(n=fe(()=>{Wn(()=>r(t))})))})}function Rs(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=Rs(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function _d(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=Rs(t))&&(n&&(n+=" "),n+=e);return n}function xd(t){return typeof t=="object"?_d(t):t??""}const Is=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function Sd(t,e,r){var n=t==null?"":""+t;if(r){for(var a in r)if(r[a])n=n?n+" "+a:a;else if(n.length)for(var i=a.length,o=0;(o=n.indexOf(a,o))>=0;){var s=o+i;(o===0||Is.includes(n[o-1]))&&(s===n.length||Is.includes(n[s]))?n=(o===0?"":n.substring(0,o))+n.substring(s+1):o=s}}return n===""?null:n}function Ls(t,e=!1){var r=e?" !important;":";",n="";for(var a in t){var i=t[a];i!=null&&i!==""&&(n+=" "+a+": "+i+r)}return n}function ci(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Td(t,e){if(e){var r="",n,a;if(Array.isArray(e)?(n=e[0],a=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,o=0,s=!1,c=[];n&&c.push(...Object.keys(n).map(ci)),a&&c.push(...Object.keys(a).map(ci));var l=0,d=-1;const b=t.length;for(var p=0;p<b;p++){var h=t[p];if(s?h==="/"&&t[p-1]==="*"&&(s=!1):i?i===h&&(i=!1):h==="/"&&t[p+1]==="*"?s=!0:h==='"'||h==="'"?i=h:h==="("?o++:h===")"&&o--,!s&&i===!1&&o===0){if(h===":"&&d===-1)d=p;else if(h===";"||p===b-1){if(d!==-1){var v=ci(t.substring(l,d).trim());if(!c.includes(v)){h!==";"&&p++;var m=t.substring(l,p).trim();r+=" "+m+";"}}l=p+1,d=-1}}}}return n&&(r+=Ls(n)),a&&(r+=Ls(a,!0)),r=r.trim(),r===""?null:r}return t==null?null:String(t)}function Ed(t,e,r,n,a,i){var o=t.__className;if(N||o!==r||o===void 0){var s=Sd(r,n,i);(!N||s!==t.getAttribute("class"))&&(s==null?t.removeAttribute("class"):e?t.className=s:t.setAttribute("class",s)),t.__className=r}else if(i&&a!==i)for(var c in i){var l=!!i[c];(a==null||l!==!!a[c])&&t.classList.toggle(c,l)}return i}function ui(t,e={},r,n){for(var a in r){var i=r[a];e[a]!==i&&(r[a]==null?t.style.removeProperty(a):t.style.setProperty(a,i,n))}}function Cd(t,e,r,n){var a=t.__style;if(N||a!==e){var i=Td(e,n);(!N||i!==t.getAttribute("style"))&&(i==null?t.removeAttribute("style"):t.style.cssText=i),t.__style=e}else n&&(Array.isArray(n)?(ui(t,r?.[0],n[0]),ui(t,r?.[1],n[1],"important")):ui(t,r,n));return n}function di(t,e,r=!1){if(t.multiple){if(e==null)return;if(!ln(e))return xu();for(var n of t.options)n.selected=e.includes(Os(n));return}for(n of t.options){var a=Os(n);if(ju(a,e)){n.selected=!0;return}}(!r||e!==void 0)&&(t.selectedIndex=-1)}function Ad(t){var e=new MutationObserver(()=>{di(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Jo(()=>{e.disconnect()})}function Os(t){return"__value"in t?t.__value:t.value}const Wr=Symbol("class"),vn=Symbol("style"),Ms=Symbol("is custom element"),Ns=Symbol("is html");function Rd(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function hi(t,e,r,n){var a=Ds(t);N&&(a[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||a[e]!==(a[e]=r)&&(e==="loading"&&(t[uu]=r),r==null?t.removeAttribute(e):typeof r!="string"&&zs(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function Id(t,e,r,n,a=!1){var i=Ds(t),o=i[Ms],s=!i[Ns];let c=N&&o;c&&Te(!1);var l=e||{},d=t.tagName==="OPTION";for(var p in e)p in r||(r[p]=null);r.class?r.class=xd(r.class):r[Wr]&&(r.class=null),r[vn]&&(r.style??=null);var h=zs(t);for(const w in r){let T=r[w];if(d&&w==="value"&&T==null){t.value=t.__value="",l[w]=T;continue}if(w==="class"){var v=t.namespaceURI==="http://www.w3.org/1999/xhtml";Ed(t,v,T,n,e?.[Wr],r[Wr]),l[w]=T,l[Wr]=r[Wr];continue}if(w==="style"){Cd(t,T,e?.[vn],r[vn]),l[w]=T,l[vn]=r[vn];continue}var m=l[w];if(!(T===m&&!(T===void 0&&t.hasAttribute(w)))){l[w]=T;var b=w[0]+w[1];if(b!=="$$")if(b==="on"){const I={},U="$$"+w;let Q=w.slice(2);var A=id(Q);if(nd(Q)&&(Q=Q.slice(0,-7),I.capture=!0),!A&&m){if(T!=null)continue;t.removeEventListener(Q,l[U],I),l[U]=null}if(T!=null)if(A)t[`__${Q}`]=T,ks([Q]);else{let je=function(ce){l[w].call(this,ce)};l[U]=bs(Q,t,je,I)}else A&&(t[`__${Q}`]=void 0)}else if(w==="style")hi(t,w,T);else if(w==="autofocus")Xu(t,!!T);else if(!o&&(w==="__value"||w==="value"&&T!=null))t.value=t.__value=T;else if(w==="selected"&&d)Rd(t,T);else{var y=w;s||(y=sd(y));var k=y==="defaultValue"||y==="defaultChecked";if(T==null&&!o&&!k)if(i[w]=null,y==="value"||y==="checked"){let I=t;const U=e===void 0;if(y==="value"){let Q=I.defaultValue;I.removeAttribute(y),I.defaultValue=Q,I.value=I.__value=U?Q:null}else{let Q=I.defaultChecked;I.removeAttribute(y),I.defaultChecked=Q,I.checked=U?Q:!1}}else t.removeAttribute(w);else k||h.includes(y)&&(o||typeof T!="string")?t[y]=T:typeof T!="function"&&hi(t,y,T)}}}return c&&Te(!0),l}function Ps(t,e,r=[],n=[],a,i=!1){Uo(r,n,o=>{var s=void 0,c={},l=t.nodeName==="SELECT",d=!1;if(qt(()=>{var h=e(...o.map(_)),v=Id(t,s,h,a,i);d&&l&&"value"in h&&di(t,h.value);for(let b of Object.getOwnPropertySymbols(c))h[b]||ke(c[b]);for(let b of Object.getOwnPropertySymbols(h)){var m=h[b];b.description===iu&&(!s||m!==s[b])&&(c[b]&&ke(c[b]),c[b]=fe(()=>wd(t,()=>m))),v[b]=m}s=v}),l){var p=t;Wn(()=>{di(p,s.value,!0),Ad(p)})}d=!0})}function Ds(t){return t.__attributes??={[Ms]:t.nodeName.includes("-"),[Ns]:t.namespaceURI===nu}}var $s=new Map;function zs(t){var e=$s.get(t.nodeName);if(e)return e;$s.set(t.nodeName,e=[]);for(var r,n=t,a=Element.prototype;a!==n;){r=su(n);for(var i in r)r[i].set&&e.push(i);n=Fa(n)}return e}function Fs(t,e){return t===e||t?.[ar]===e}function Bs(t={},e,r,n){return Wn(()=>{var a,i;return ei(()=>{a=i,i=[],mt(()=>{t!==r(...i)&&(e(t,...i),a&&Fs(r(...a),t)&&e(null,...a))})}),()=>{Sr(()=>{i&&Fs(r(...i),t)&&e(null,...i)})}}),t}const Qr=[];function Ld(t,e=br){let r=null;const n=new Set;function a(s){if(No(t,s)&&(t=s,r)){const c=!Qr.length;for(const l of n)l[1](),Qr.push(l,t);if(c){for(let l=0;l<Qr.length;l+=2)Qr[l][0](Qr[l+1]);Qr.length=0}}}function i(s){a(s(t))}function o(s,c=br){const l=[s,c];return n.add(l),n.size===1&&(r=e(a,i)||br),s(t),()=>{n.delete(l),n.size===0&&r&&(r(),r=null)}}return{set:a,update:i,subscribe:o}}let ea=!1;function Od(t){var e=ea;try{return ea=!1,[t(),ea]}finally{ea=e}}const Md={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function fi(t,e,r){return new Proxy({props:t,exclude:e},Md)}const Nd={get(t,e){let r=t.props.length;for(;r--;){let n=t.props[r];if(cn(n)&&(n=n()),typeof n=="object"&&n!==null&&e in n)return n[e]}},set(t,e,r){let n=t.props.length;for(;n--;){let a=t.props[n];cn(a)&&(a=a());const i=$t(a,e);if(i&&i.set)return i.set(r),!0}return!1},getOwnPropertyDescriptor(t,e){let r=t.props.length;for(;r--;){let n=t.props[r];if(cn(n)&&(n=n()),typeof n=="object"&&n!==null&&e in n){const a=$t(n,e);return a&&!a.configurable&&(a.configurable=!0),a}}},has(t,e){if(e===ar||e===Za)return!1;for(let r of t.props)if(cn(r)&&(r=r()),r!=null&&e in r)return!0;return!1},ownKeys(t){const e=[];for(let r of t.props)if(cn(r)&&(r=r()),!!r){for(const n in r)e.includes(n)||e.push(n);for(const n of Object.getOwnPropertySymbols(r))e.includes(n)||e.push(n)}return e}};function Pd(...t){return new Proxy({props:t},Nd)}function se(t,e,r,n){var a=(r&Jc)!==0,i=(r&eu)!==0,o=n,s=!0,c=()=>(s&&(s=!1,o=i?mt(n):n),o),l;if(a){var d=ar in t||Za in t;l=$t(t,e)?.set??(d&&e in t?k=>t[e]=k:void 0)}var p,h=!1;a?[p,h]=Od(()=>t[e]):p=t[e],p===void 0&&n!==void 0&&(p=c(),l&&(ku(),l(p)));var v;if(v=()=>{var k=t[e];return k===void 0?c():(s=!0,k)},(r&Xc)===0)return v;if(l){var m=t.$$legacy;return function(k,w){return arguments.length>0?((!w||m||h)&&l(w?v():k),k):v()}}var b=!1,A=((r&Kc)!==0?Vn:Fo)(()=>(b=!1,v()));a&&_(A);var y=j;return function(k,w){if(arguments.length>0){const T=w?_(A):a?St(k):k;return $(A,T),b=!0,o!==void 0&&(o=T),k}return Cr&&b||(y.f&wr)!==0?A.v:_(A)}}function Dd(t){return new $d(t)}class $d{#e;#t;constructor(e){var r=new Map,n=(i,o)=>{var s=Ho(o,!1,!1);return r.set(i,s),s};const a=new Proxy({...e.props||{},$$events:{}},{get(i,o){return _(r.get(o)??n(o,Reflect.get(i,o)))},has(i,o){return o===Za?!0:(_(r.get(o)??n(o,Reflect.get(i,o))),Reflect.has(i,o))},set(i,o,s){return $(r.get(o)??n(o,s),s),Reflect.set(i,o,s)}});this.#t=(e.hydrate?hd:_s)(e.component,{target:e.target,anchor:e.anchor,props:a,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&re(),this.#e=a.$$events;for(const i of Object.keys(this.#t))i==="$set"||i==="$destroy"||i==="$on"||Fr(this,i,{get(){return this.#t[i]},set(o){this.#t[i]=o},enumerable:!0});this.#t.$set=i=>{Object.assign(a,i)},this.#t.$destroy=()=>{fd(this.#t)}}$set(e){this.#t.$set(e)}$on(e,r){this.#e[e]=this.#e[e]||[];const n=(...a)=>r.call(this,...a);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(a=>a!==n)}}$destroy(){this.#t.$destroy()}}let js;typeof HTMLElement=="function"&&(js=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(t,e,r){super(),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const n=this.$$l_u.get(e);n&&(n(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(n){return a=>{const i=document.createElement("slot");n!=="default"&&(i.name=n),oe(a,i)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},r=zd(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=t(n),e.default=!0):e[n]=t(n));for(const n of this.attributes){const a=this.$$g_p(n.name);a in this.$$d||(this.$$d[a]=ta(a,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Dd({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=Hu(()=>{ei(()=>{this.$$r=!0;for(const n of Fn(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const a=ta(n,this.$$d[n],this.$$p_d,"toAttribute");a==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,a)}this.$$r=!1})});for(const n in this.$$l)for(const a of this.$$l[n]){const i=this.$$c.$on(n,a);this.$$l_u.set(a,i)}this.$$l={}}}attributeChangedCallback(t,e,r){this.$$r||(t=this.$$g_p(t),this.$$d[t]=ta(t,r,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Fn(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function ta(t,e,r,n){const a=r[t]?.type;if(e=a==="Boolean"&&typeof e!="boolean"?e!=null:e,!n||!r[t])return e;if(n==="toAttribute")switch(a){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(a){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function zd(t){const e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}function bn(t,e,r,n,a,i){let o=class extends js{constructor(){super(t,r,a),this.$$p_d=e}static get observedAttributes(){return Fn(e).map(s=>(e[s].attribute||s).toLowerCase())}};return Fn(e).forEach(s=>{Fr(o.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){c=ta(s,c,e),this.$$d[s]=c;var l=this.$$c;if(l){var d=$t(l,s)?.get;d?l[s]=c:l.$set({[s]:c})}}})}),n.forEach(s=>{Fr(o.prototype,s,{get(){return this.$$c?.[s]}})}),t.element=o,o}var Fd=(t,e)=>e()(),Bd=Ct('<div class="chat-app__container"><div class="error-message svelte-4thrqu">Server is unreachable, please try later... <button class="error-message__retry-button svelte-4thrqu">Retry</button></div></div>'),jd=Ct(" <!>",1);const Ud={hash:"svelte-4thrqu",code:`
|
|
3
|
-
/* These styles are inline, because at this point theme loading has failed. */.error-message.svelte-4thrqu {display:table;z-index:1000;width:auto;margin:2rem auto;padding:2rem;border-radius:2px;background:white;color:oklch(27.8% 0.033 256.848);font-family:-apple-system,
|
|
1
|
+
var LiipGPTButton=(function(Go){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");const ed=1,td=2,rd=16,nd=1,od=4,id=8,ad=16,sd=1,ld=2,Wo="[",un="[!",Ra="[?",Qo="]",yr={},me=Symbol(),za="http://www.w3.org/1999/xhtml",Ia="http://www.w3.org/2000/svg",cd="http://www.w3.org/1998/Math/MathML",ud="@attach",Yo=!1;var Vn=Array.isArray,dd=Array.prototype.indexOf,Fr=Array.prototype.includes,Hn=Array.from,Gn=Object.keys,Wn=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,hd=Object.getOwnPropertyDescriptors,Oa=Object.prototype,fd=Array.prototype,Jo=Object.getPrototypeOf,$a=Object.isExtensible;function dn(e){return typeof e=="function"}const _r=()=>{};function Pa(e){return typeof e?.then=="function"}function pd(e){for(var t=0;t<e.length;t++)e[t]()}function La(){var e,t,r=new Promise((n,o)=>{e=n,t=o});return{promise:r,resolve:e,reject:t}}const Re=2,jr=4,hn=8,Ko=1<<24,nr=16,ft=32,or=64,Xo=128,it=512,we=1024,ze=2048,pt=4096,Ye=8192,Ut=16384,Sr=32768,ir=65536,Da=1<<17,Na=1<<18,ar=1<<19,gd=1<<20,sr=1<<25,xr=65536,ei=1<<21,ti=1<<22,lr=1<<23,cr=Symbol("$state"),ri=Symbol("legacy props"),md=Symbol(""),Tr=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Qn=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml"),vd=1,Yn=3,Er=8;function Ma(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function bd(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function kd(e,t,r){throw new Error("https://svelte.dev/e/each_key_duplicate")}function wd(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function yd(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function _d(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Sd(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function xd(){throw new Error("https://svelte.dev/e/hydration_failed")}function Td(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Ed(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ad(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Cd(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Rd(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function fn(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function zd(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Id(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let $=!1;function ye(e){$=e}let N;function de(e){if(e===null)throw fn(),yr;return N=e}function qt(){return de(Ke(N))}function Vt(e){if($){if(Ke(N)!==null)throw fn(),yr;N=e}}function Fa(e=1){if($){for(var t=e,r=N;t--;)r=Ke(r);N=r}}function pn(e=!0){for(var t=0,r=N;;){if(r.nodeType===Er){var n=r.data;if(n===Qo){if(t===0)return r;t-=1}else(n===Wo||n===un||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(t+=1)}var o=Ke(r);e&&r.remove(),r=o}}function ja(e){if(!e||e.nodeType!==Er)throw fn(),yr;return e.data}function Ba(e){return e===this.v}function Za(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Ua(e){return!Za(e,this.v)}let Od=!1;const $d=[];function Pd(e,t=!1,r=!1){return Jn(e,new Map,"",$d,null,r)}function Jn(e,t,r,n,o=null,i=!1){if(typeof e=="object"&&e!==null){var a=t.get(e);if(a!==void 0)return a;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(Vn(e)){var s=Array(e.length);t.set(e,s),o!==null&&t.set(o,s);for(var l=0;l<e.length;l+=1){var c=e[l];l in e&&(s[l]=Jn(c,t,r,n,null,i))}return s}if(Jo(e)===Oa){s={},t.set(e,s),o!==null&&t.set(o,s);for(var u of Object.keys(e))s[u]=Jn(e[u],t,r,n,null,i);return s}if(e instanceof Date)return structuredClone(e);if(typeof e.toJSON=="function"&&!i)return Jn(e.toJSON(),t,r,n,e)}if(e instanceof EventTarget)return e;try{return structuredClone(e)}catch{return e}}let qe=null;function Br(e){qe=e}function Zr(e,t=!1,r){qe={p:qe,i:!1,c:null,e:null,s:e,x:null,l:null}}function Ur(e){var t=qe,r=t.e;if(r!==null){t.e=null;for(var n of r)vs(n)}return e!==void 0&&(t.x=e),t.i=!0,qe=t.p,e??{}}function qa(){return!0}let Ar=[];function Va(){var e=Ar;Ar=[],pd(e)}function gt(e){if(Ar.length===0&&!qr){var t=Ar;queueMicrotask(()=>{t===Ar&&Va()})}Ar.push(e)}function Ld(){for(;Ar.length>0;)Va()}function Ha(e){var t=j;if(t===null)return B.f|=lr,e;if((t.f&Sr)===0&&(t.f&jr)===0)throw e;ur(e,t)}function ur(e,t){for(;t!==null;){if((t.f&Xo)!==0){if((t.f&Sr)===0)throw e;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throw e}const Dd=-7169;function ce(e,t){e.f=e.f&Dd|t}function ni(e){(e.f&it)!==0||e.deps===null?ce(e,we):ce(e,pt)}function Ga(e){if(e!==null)for(const t of e)(t.f&Re)===0||(t.f&xr)===0||(t.f^=xr,Ga(t.deps))}function Wa(e,t,r){(e.f&ze)!==0?t.add(e):(e.f&pt)!==0&&r.add(e),Ga(e.deps),ce(e,we)}const Kn=new Set;let ee=null,mt=null,Ve=[],Xn=null,qr=!1,Vr=null;class Rt{current=new Map;previous=new Map;#e=new Set;#t=new Set;#r=0;#s=0;#n=null;#a=new Set;#o=new Set;#i=new Map;is_fork=!1;#l=!1;#u(){return this.is_fork||this.#s>0}skip_effect(t){this.#i.has(t)||this.#i.set(t,{d:[],m:[]})}unskip_effect(t){var r=this.#i.get(t);if(r){this.#i.delete(t);for(var n of r.d)ce(n,ze),vt(n);for(n of r.m)ce(n,pt),vt(n)}}process(t){Ve=[],this.apply();var r=Vr=[],n=[];for(const o of t)this.#c(o,r,n);if(Vr=null,this.#u()){this.#d(n),this.#d(r);for(const[o,i]of this.#i)Xa(o,i)}else{ee=null;for(const o of this.#e)o(this);this.#e.clear(),this.#r===0&&this.#h(),Ya(n),Ya(r),this.#a.clear(),this.#o.clear(),this.#n?.resolve()}mt=null}#c(t,r,n){t.f^=we;for(var o=t.first;o!==null;){var i=o.f,a=(i&(ft|or))!==0,s=a&&(i&we)!==0,l=s||(i&Ye)!==0||this.#i.has(o);if(!l&&o.fn!==null){a?o.f^=we:(i&jr)!==0?r.push(o):bn(o)&&((i&nr)!==0&&this.#o.add(o),Hr(o));var c=o.first;if(c!==null){o=c;continue}}for(;o!==null;){var u=o.next;if(u!==null){o=u;break}o=o.parent}}}#d(t){for(var r=0;r<t.length;r+=1)Wa(t[r],this.#a,this.#o)}capture(t,r){r!==me&&!this.previous.has(t)&&this.previous.set(t,r),(t.f&lr)===0&&(this.current.set(t,t.v),mt?.set(t,t.v))}activate(){ee=this,this.apply()}deactivate(){ee===this&&(ee=null,mt=null)}flush(){if(Ve.length>0)ee=this,Qa();else if(this.#r===0&&!this.is_fork){for(const t of this.#e)t(this);this.#e.clear(),this.#h(),this.#n?.resolve()}this.deactivate()}discard(){for(const t of this.#t)t(this);this.#t.clear()}#h(){if(Kn.size>1){this.previous.clear();var t=ee,r=mt,n=!0;for(const i of Kn){if(i===this){n=!1;continue}const a=[];for(const[l,c]of this.current){if(i.current.has(l))if(n&&c!==i.current.get(l))i.current.set(l,c);else continue;a.push(l)}if(a.length===0)continue;const s=[...i.current.keys()].filter(l=>!this.current.has(l));if(s.length>0){var o=Ve;Ve=[];const l=new Set,c=new Map;for(const u of a)Ja(u,s,l,c);if(Ve.length>0){ee=i,i.apply();for(const u of Ve)i.#c(u,[],[]);i.deactivate()}Ve=o}}ee=t,mt=r}this.#i.clear(),Kn.delete(this)}increment(t){this.#r+=1,t&&(this.#s+=1)}decrement(t){this.#r-=1,t&&(this.#s-=1),!this.#l&&(this.#l=!0,gt(()=>{this.#l=!1,this.#u()?Ve.length>0&&this.flush():this.revive()}))}revive(){for(const t of this.#a)this.#o.delete(t),ce(t,ze),vt(t);for(const t of this.#o)ce(t,pt),vt(t);this.flush()}oncommit(t){this.#e.add(t)}ondiscard(t){this.#t.add(t)}settled(){return(this.#n??=La()).promise}static ensure(){if(ee===null){const t=ee=new Rt;Kn.add(ee),qr||gt(()=>{ee===t&&t.flush()})}return ee}apply(){}}function J(e){var t=qr;qr=!0;try{for(var r;;){if(Ld(),Ve.length===0&&(ee?.flush(),Ve.length===0))return Xn=null,r;Qa()}}finally{qr=t}}function Qa(){var e=null;try{for(var t=0;Ve.length>0;){var r=Rt.ensure();if(t++>1e3){var n,o;Nd()}r.process(Ve),dr.clear()}}finally{Ve=[],Xn=null,Vr=null}}function Nd(){try{Sd()}catch(e){ur(e,Xn)}}let Ht=null;function Ya(e){var t=e.length;if(t!==0){for(var r=0;r<t;){var n=e[r++];if((n.f&(Ut|Ye))===0&&bn(n)&&(Ht=new Set,Hr(n),n.deps===null&&n.first===null&&n.nodes===null&&n.teardown===null&&n.ac===null&&ys(n),Ht?.size>0)){dr.clear();for(const o of Ht){if((o.f&(Ut|Ye))!==0)continue;const i=[o];let a=o.parent;for(;a!==null;)Ht.has(a)&&(Ht.delete(a),i.push(a)),a=a.parent;for(let s=i.length-1;s>=0;s--){const l=i[s];(l.f&(Ut|Ye))===0&&Hr(l)}}Ht.clear()}}Ht=null}}function Ja(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const o of e.reactions){const i=o.f;(i&Re)!==0?Ja(o,t,r,n):(i&(ti|nr))!==0&&(i&ze)===0&&Ka(o,t,n)&&(ce(o,ze),vt(o))}}function Ka(e,t,r){const n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(const o of e.deps){if(Fr.call(t,o))return!0;if((o.f&Re)!==0&&Ka(o,t,r))return r.set(o,!0),!0}return r.set(e,!1),!1}function vt(e){var t=Xn=e,r=t.b;if(r?.is_pending&&(e.f&(jr|hn|Ko))!==0&&(e.f&Sr)===0){r.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var n=t.f;if(Vr!==null&&t===j&&(e.f&hn)===0)return;if((n&(or|ft))!==0){if((n&we)===0)return;t.f^=we}}Ve.push(t)}function Xa(e,t){if(!((e.f&ft)!==0&&(e.f&we)!==0)){(e.f&ze)!==0?t.d.push(e):(e.f&pt)!==0&&t.m.push(e),ce(e,we);for(var r=e.first;r!==null;)Xa(r,t),r=r.next}}function Md(e){let t=0,r=Gt(0),n;return()=>{ui()&&(y(r),di(()=>(t===0&&(n=yt(()=>e(()=>gn(r)))),t+=1,()=>{gt(()=>{t-=1,t===0&&(n?.(),n=void 0,gn(r))})})))}}var Fd=ir|ar;function es(e,t,r,n){new jd(e,t,r,n)}class jd{parent;is_pending=!1;transform_error;#e;#t=$?N:null;#r;#s;#n;#a=null;#o=null;#i=null;#l=null;#u=0;#c=0;#d=!1;#h=new Set;#f=new Set;#p=null;#k=Md(()=>(this.#p=Gt(this.#u),()=>{this.#p=null}));constructor(t,r,n,o){this.#e=t,this.#r=r,this.#s=i=>{var a=j;a.b=this,a.f|=Xo,n(i)},this.parent=j.b,this.transform_error=o??this.parent?.transform_error??(i=>i),this.#n=Cr(()=>{if($){const i=this.#t;qt();const a=i.data===un;if(i.data.startsWith(Ra)){const l=JSON.parse(i.data.slice(Ra.length));this.#y(l)}else a?this.#_():this.#w()}else this.#v()},Fd),$&&(this.#e=N)}#w(){try{this.#a=He(()=>this.#s(this.#e))}catch(t){this.error(t)}}#y(t){const r=this.#r.failed;r&&(this.#i=He(()=>{r(this.#e,()=>t,()=>()=>{})}))}#_(){const t=this.#r.pending;t&&(this.is_pending=!0,this.#o=He(()=>t(this.#e)),gt(()=>{var r=this.#l=document.createDocumentFragment(),n=Je();r.append(n),this.#a=this.#m(()=>(Rt.ensure(),He(()=>this.#s(n)))),this.#c===0&&(this.#e.before(r),this.#l=null,Rr(this.#o,()=>{this.#o=null}),this.#g())}))}#v(){try{if(this.is_pending=this.has_pending_snippet(),this.#c=0,this.#u=0,this.#a=He(()=>{this.#s(this.#e)}),this.#c>0){var t=this.#l=document.createDocumentFragment();xs(this.#a,t);const r=this.#r.pending;this.#o=He(()=>r(this.#e))}else this.#g()}catch(r){this.error(r)}}#g(){this.is_pending=!1;for(const t of this.#h)ce(t,ze),vt(t);for(const t of this.#f)ce(t,pt),vt(t);this.#h.clear(),this.#f.clear()}defer_effect(t){Wa(t,this.#h,this.#f)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#r.pending}#m(t){var r=j,n=B,o=qe;It(this.#n),at(this.#n),Br(this.#n.ctx);try{return t()}catch(i){return Ha(i),null}finally{It(r),at(n),Br(o)}}#b(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#b(t);return}this.#c+=t,this.#c===0&&(this.#g(),this.#o&&Rr(this.#o,()=>{this.#o=null}),this.#l&&(this.#e.before(this.#l),this.#l=null))}update_pending_count(t){this.#b(t),this.#u+=t,!(!this.#p||this.#d)&&(this.#d=!0,gt(()=>{this.#d=!1,this.#p&&Wt(this.#p,this.#u)}))}get_effect_pending(){return this.#k(),y(this.#p)}error(t){var r=this.#r.onerror;let n=this.#r.failed;if(!r&&!n)throw t;this.#a&&(_e(this.#a),this.#a=null),this.#o&&(_e(this.#o),this.#o=null),this.#i&&(_e(this.#i),this.#i=null),$&&(de(this.#t),Fa(),de(pn()));var o=!1,i=!1;const a=()=>{if(o){Id();return}o=!0,i&&Rd(),this.#i!==null&&Rr(this.#i,()=>{this.#i=null}),this.#m(()=>{Rt.ensure(),this.#v()})},s=l=>{try{i=!0,r?.(l,a),i=!1}catch(c){ur(c,this.#n&&this.#n.parent)}n&&(this.#i=this.#m(()=>{Rt.ensure();try{return He(()=>{var c=j;c.b=this,c.f|=Xo,n(this.#e,()=>l,()=>a)})}catch(c){return ur(c,this.#n.parent),null}}))};gt(()=>{var l;try{l=this.transform_error(t)}catch(c){ur(c,this.#n&&this.#n.parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(s,c=>ur(c,this.#n&&this.#n.parent)):s(l)})}}function ts(e,t,r,n){const o=to;var i=e.filter(h=>!h.settled);if(r.length===0&&i.length===0){n(t.map(o));return}var a=j,s=rs(),l=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(h=>h.promise)):null;function c(h){s();try{n(h)}catch(f){(a.f&Ut)===0&&ur(f,a)}eo()}if(r.length===0){l.then(()=>c(t.map(o)));return}function u(){s(),Promise.all(r.map(h=>Zd(h))).then(h=>c([...t.map(o),...h])).catch(h=>ur(h,a))}l?l.then(u):u()}function rs(){var e=j,t=B,r=qe,n=ee;return function(i=!0){It(e),at(t),Br(r),i&&n?.activate()}}function eo(e=!0){It(null),at(null),Br(null),e&&ee?.deactivate()}function Bd(){var e=j.b,t=ee,r=e.is_rendered();return e.update_pending_count(1),t.increment(r),()=>{e.update_pending_count(-1),t.decrement(r)}}function to(e){var t=Re|ze,r=B!==null&&(B.f&Re)!==0?B:null;return j!==null&&(j.f|=ar),{ctx:qe,deps:null,effects:null,equals:Ba,f:t,fn:e,reactions:null,rv:0,v:me,wv:0,parent:r??j,ac:null}}function Zd(e,t,r){j===null&&bd();var o=void 0,i=Gt(me),a=!B,s=new Map;return eh(()=>{var l=La();o=l.promise;try{Promise.resolve(e()).then(l.resolve,l.reject).finally(eo)}catch(f){l.reject(f),eo()}var c=ee;if(a){var u=Bd();s.get(c)?.reject(Tr),s.delete(c),s.set(c,l)}const h=(f,v=void 0)=>{if(c.activate(),v)v!==Tr&&(i.f|=lr,Wt(i,v));else{(i.f&lr)!==0&&(i.f^=lr),Wt(i,f);for(const[g,b]of s){if(s.delete(g),g===c)break;b.reject(Tr)}}u&&u()};l.promise.then(h,f=>h(null,f||"unknown"))}),ro(()=>{for(const l of s.values())l.reject(Tr)}),new Promise(l=>{function c(u){function h(){u===o?l(i):c(o)}u.then(h,h)}c(o)})}function W(e){const t=to(e);return Es(t),t}function ns(e){const t=to(e);return t.equals=Ua,t}function Ud(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)_e(t[r])}}function qd(e){for(var t=e.parent;t!==null;){if((t.f&Re)===0)return(t.f&Ut)===0?t:null;t=t.parent}return null}function oi(e){var t,r=j;It(qd(e));try{e.f&=~xr,Ud(e),t=Is(e)}finally{It(r)}return t}function os(e){var t=oi(e);if(!e.equals(t)&&(e.wv=Rs(),(!ee?.is_fork||e.deps===null)&&(e.v=t,e.deps===null))){ce(e,we);return}fr||(mt!==null?(ui()||ee?.is_fork)&&mt.set(e,t):ni(e))}function Vd(e){if(e.effects!==null)for(const t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(Tr),t.teardown=_r,t.ac=null,kn(t,0),hi(t))}function is(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&Hr(t)}let ii=new Set;const dr=new Map;let as=!1;function Gt(e,t){var r={f:0,v:e,reactions:null,equals:Ba,rv:0,wv:0};return r}function Q(e,t){const r=Gt(e);return Es(r),r}function ss(e,t=!1,r=!0){const n=Gt(e);return t||(n.equals=Ua),n}function L(e,t,r=!1){B!==null&&(!wt||(B.f&Da)!==0)&&qa()&&(B.f&(Re|nr|ti|Da))!==0&&(st===null||!Fr.call(st,e))&&Cd();let n=r?zt(t):t;return Wt(e,n)}function Wt(e,t){if(!e.equals(t)){var r=e.v;fr?dr.set(e,t):dr.set(e,r),e.v=t;var n=Rt.ensure();if(n.capture(e,r),(e.f&Re)!==0){const o=e;(e.f&ze)!==0&&oi(o),ni(o)}e.wv=Rs(),ls(e,ze),j!==null&&(j.f&we)!==0&&(j.f&(ft|or))===0&&(lt===null?rh([e]):lt.push(e)),!n.is_fork&&ii.size>0&&!as&&Hd()}return t}function Hd(){as=!1;for(const e of ii)(e.f&we)!==0&&ce(e,pt),bn(e)&&Hr(e);ii.clear()}function gn(e){L(e,e.v+1)}function ls(e,t){var r=e.reactions;if(r!==null)for(var n=r.length,o=0;o<n;o++){var i=r[o],a=i.f,s=(a&ze)===0;if(s&&ce(i,t),(a&Re)!==0){var l=i;mt?.delete(l),(a&xr)===0&&(a&it&&(i.f|=xr),ls(l,pt))}else s&&((a&nr)!==0&&Ht!==null&&Ht.add(i),vt(i))}}function zt(e){if(typeof e!="object"||e===null||cr in e)return e;const t=Jo(e);if(t!==Oa&&t!==fd)return e;var r=new Map,n=Vn(e),o=Q(0),i=Ir,a=s=>{if(Ir===i)return s();var l=B,c=Ir;at(null),Cs(i);var u=s();return at(l),Cs(c),u};return n&&r.set("length",Q(e.length)),new Proxy(e,{defineProperty(s,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&Ed();var u=r.get(l);return u===void 0?a(()=>{var h=Q(c.value);return r.set(l,h),h}):L(u,c.value,!0),!0},deleteProperty(s,l){var c=r.get(l);if(c===void 0){if(l in s){const u=a(()=>Q(me));r.set(l,u),gn(o)}}else L(c,me),gn(o);return!0},get(s,l,c){if(l===cr)return e;var u=r.get(l),h=l in s;if(u===void 0&&(!h||Zt(s,l)?.writable)&&(u=a(()=>{var v=zt(h?s[l]:me),g=Q(v);return g}),r.set(l,u)),u!==void 0){var f=y(u);return f===me?void 0:f}return Reflect.get(s,l,c)},getOwnPropertyDescriptor(s,l){var c=Reflect.getOwnPropertyDescriptor(s,l);if(c&&"value"in c){var u=r.get(l);u&&(c.value=y(u))}else if(c===void 0){var h=r.get(l),f=h?.v;if(h!==void 0&&f!==me)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return c},has(s,l){if(l===cr)return!0;var c=r.get(l),u=c!==void 0&&c.v!==me||Reflect.has(s,l);if(c!==void 0||j!==null&&(!u||Zt(s,l)?.writable)){c===void 0&&(c=a(()=>{var f=u?zt(s[l]):me,v=Q(f);return v}),r.set(l,c));var h=y(c);if(h===me)return!1}return u},set(s,l,c,u){var h=r.get(l),f=l in s;if(n&&l==="length")for(var v=c;v<h.v;v+=1){var g=r.get(v+"");g!==void 0?L(g,me):v in s&&(g=a(()=>Q(me)),r.set(v+"",g))}if(h===void 0)(!f||Zt(s,l)?.writable)&&(h=a(()=>Q(void 0)),L(h,zt(c)),r.set(l,h));else{f=h.v!==me;var b=a(()=>zt(c));L(h,b)}var A=Reflect.getOwnPropertyDescriptor(s,l);if(A?.set&&A.set.call(u,c),!f){if(n&&typeof l=="string"){var w=r.get("length"),_=Number(l);Number.isInteger(_)&&_>=w.v&&L(w,_+1)}gn(o)}return!0},ownKeys(s){y(o);var l=Reflect.ownKeys(s).filter(h=>{var f=r.get(h);return f===void 0||f.v!==me});for(var[c,u]of r)u.v!==me&&!(c in s)&&l.push(c);return l},setPrototypeOf(){Ad()}})}function cs(e){try{if(e!==null&&typeof e=="object"&&cr in e)return e[cr]}catch{}return e}function Gd(e,t){return Object.is(cs(e),cs(t))}var ai,us,ds,hs;function si(){if(ai===void 0){ai=window,us=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;ds=Zt(t,"firstChild").get,hs=Zt(t,"nextSibling").get,$a(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),$a(r)&&(r.__t=void 0)}}function Je(e=""){return document.createTextNode(e)}function bt(e){return ds.call(e)}function Ke(e){return hs.call(e)}function Qt(e,t){if(!$)return bt(e);var r=bt(N);if(r===null)r=N.appendChild(Je());else if(t&&r.nodeType!==Yn){var n=Je();return r?.before(n),de(n),n}return t&&li(r),de(r),r}function Le(e,t=!1){if(!$){var r=bt(e);return r instanceof Comment&&r.data===""?Ke(r):r}if(t){if(N?.nodeType!==Yn){var n=Je();return N?.before(n),de(n),n}li(N)}return N}function hr(e,t=1,r=!1){let n=$?N:e;for(var o;t--;)o=n,n=Ke(n);if(!$)return n;if(r){if(n?.nodeType!==Yn){var i=Je();return n===null?o?.after(i):n.before(i),de(i),i}li(n)}return de(n),n}function fs(e){e.textContent=""}function ps(){return!1}function mn(e,t,r){return document.createElementNS(t??za,e,void 0)}function li(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Yn;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Wd(e,t){if(t){const r=document.body;e.autofocus=!0,gt(()=>{document.activeElement===r&&e.focus()})}}let gs=!1;function Qd(){gs||(gs=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function ci(e){var t=B,r=j;at(null),It(null);try{return e()}finally{at(t),It(r)}}function Yd(e){j===null&&(B===null&&_d(),yd()),fr&&wd()}function Jd(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function kt(e,t){var r=j;r!==null&&(r.f&Ye)!==0&&(e|=Ye);var n={ctx:qe,deps:null,nodes:null,f:e|ze|it,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null},o=n;if((e&jr)!==0)Vr!==null?Vr.push(n):vt(n);else if(t!==null){try{Hr(n)}catch(a){throw _e(n),a}o.deps===null&&o.teardown===null&&o.nodes===null&&o.first===o.last&&(o.f&ar)===0&&(o=o.first,(e&nr)!==0&&(e&ir)!==0&&o!==null&&(o.f|=ir))}if(o!==null&&(o.parent=r,r!==null&&Jd(o,r),B!==null&&(B.f&Re)!==0&&(e&or)===0)){var i=B;(i.effects??=[]).push(o)}return n}function ui(){return B!==null&&!wt}function ro(e){const t=kt(hn,null);return ce(t,we),t.teardown=e,t}function ms(e){Yd();var t=j.f,r=!B&&(t&ft)!==0&&(t&Sr)===0;if(r){var n=qe;(n.e??=[]).push(e)}else return vs(e)}function vs(e){return kt(jr|gd,e)}function Kd(e){Rt.ensure();const t=kt(or|ar,e);return()=>{_e(t)}}function Xd(e){Rt.ensure();const t=kt(or|ar,e);return(r={})=>new Promise(n=>{r.outro?Rr(t,()=>{_e(t),n(void 0)}):(_e(t),n(void 0))})}function vn(e){return kt(jr,e)}function eh(e){return kt(ti|ar,e)}function di(e,t=0){return kt(hn|t,e)}function no(e,t=[],r=[],n=[]){ts(n,t,r,o=>{kt(hn,()=>e(...o.map(y)))})}function Cr(e,t=0){var r=kt(nr|t,e);return r}function bs(e,t=0){var r=kt(Ko|t,e);return r}function He(e){return kt(ft|ar,e)}function ks(e){var t=e.teardown;if(t!==null){const r=fr,n=B;Ts(!0),at(null);try{t.call(null)}finally{Ts(r),at(n)}}}function hi(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const o=r.ac;o!==null&&ci(()=>{o.abort(Tr)});var n=r.next;(r.f&or)!==0?r.parent=null:_e(r,t),r=n}}function th(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&ft)===0&&_e(t),t=r}}function _e(e,t=!0){var r=!1;(t||(e.f&Na)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(ws(e.nodes.start,e.nodes.end),r=!0),hi(e,t&&!r),kn(e,0),ce(e,Ut);var n=e.nodes&&e.nodes.t;if(n!==null)for(const i of n)i.stop();ks(e);var o=e.parent;o!==null&&o.first!==null&&ys(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function ws(e,t){for(;e!==null;){var r=e===t?null:Ke(e);e.remove(),e=r}}function ys(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function Rr(e,t,r=!0){var n=[];_s(e,n,!0);var o=()=>{r&&_e(e),t&&t()},i=n.length;if(i>0){var a=()=>--i||o();for(var s of n)s.out(a)}else o()}function _s(e,t,r){if((e.f&Ye)===0){e.f^=Ye;var n=e.nodes&&e.nodes.t;if(n!==null)for(const s of n)(s.is_global||r)&&t.push(s);for(var o=e.first;o!==null;){var i=o.next,a=(o.f&ir)!==0||(o.f&ft)!==0&&(e.f&nr)!==0;_s(o,t,a?r:!1),o=i}}}function fi(e){Ss(e,!0)}function Ss(e,t){if((e.f&Ye)!==0){e.f^=Ye,(e.f&we)===0&&(ce(e,ze),vt(e));for(var r=e.first;r!==null;){var n=r.next,o=(r.f&ir)!==0||(r.f&ft)!==0;Ss(r,o?t:!1),r=n}var i=e.nodes&&e.nodes.t;if(i!==null)for(const a of i)(a.is_global||t)&&a.in()}}function xs(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var o=r===n?null:Ke(r);t.append(r),r=o}}let oo=!1,fr=!1;function Ts(e){fr=e}let B=null,wt=!1;function at(e){B=e}let j=null;function It(e){j=e}let st=null;function Es(e){B!==null&&(st===null?st=[e]:st.push(e))}let Ge=null,Xe=0,lt=null;function rh(e){lt=e}let As=1,zr=0,Ir=zr;function Cs(e){Ir=e}function Rs(){return++As}function bn(e){var t=e.f;if((t&ze)!==0)return!0;if(t&Re&&(e.f&=~xr),(t&pt)!==0){for(var r=e.deps,n=r.length,o=0;o<n;o++){var i=r[o];if(bn(i)&&os(i),i.wv>e.wv)return!0}(t&it)!==0&&mt===null&&ce(e,we)}return!1}function zs(e,t,r=!0){var n=e.reactions;if(n!==null&&!(st!==null&&Fr.call(st,e)))for(var o=0;o<n.length;o++){var i=n[o];(i.f&Re)!==0?zs(i,t,!1):t===i&&(r?ce(i,ze):(i.f&we)!==0&&ce(i,pt),vt(i))}}function Is(e){var t=Ge,r=Xe,n=lt,o=B,i=st,a=qe,s=wt,l=Ir,c=e.f;Ge=null,Xe=0,lt=null,B=(c&(ft|or))===0?e:null,st=null,Br(e.ctx),wt=!1,Ir=++zr,e.ac!==null&&(ci(()=>{e.ac.abort(Tr)}),e.ac=null);try{e.f|=ei;var u=e.fn,h=u();e.f|=Sr;var f=e.deps,v=ee?.is_fork;if(Ge!==null){var g;if(v||kn(e,Xe),f!==null&&Xe>0)for(f.length=Xe+Ge.length,g=0;g<Ge.length;g++)f[Xe+g]=Ge[g];else e.deps=f=Ge;if(ui()&&(e.f&it)!==0)for(g=Xe;g<f.length;g++)(f[g].reactions??=[]).push(e)}else!v&&f!==null&&Xe<f.length&&(kn(e,Xe),f.length=Xe);if(qa()&<!==null&&!wt&&f!==null&&(e.f&(Re|pt|ze))===0)for(g=0;g<lt.length;g++)zs(lt[g],e);if(o!==null&&o!==e){if(zr++,o.deps!==null)for(let b=0;b<r;b+=1)o.deps[b].rv=zr;if(t!==null)for(const b of t)b.rv=zr;lt!==null&&(n===null?n=lt:n.push(...lt))}return(e.f&lr)!==0&&(e.f^=lr),h}catch(b){return Ha(b)}finally{e.f^=ei,Ge=t,Xe=r,lt=n,B=o,st=i,Br(a),wt=s,Ir=l}}function nh(e,t){let r=t.reactions;if(r!==null){var n=dd.call(r,e);if(n!==-1){var o=r.length-1;o===0?r=t.reactions=null:(r[n]=r[o],r.pop())}}if(r===null&&(t.f&Re)!==0&&(Ge===null||!Fr.call(Ge,t))){var i=t;(i.f&it)!==0&&(i.f^=it,i.f&=~xr),ni(i),Vd(i),kn(i,0)}}function kn(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)nh(e,r[n])}function Hr(e){var t=e.f;if((t&Ut)===0){ce(e,we);var r=j,n=oo;j=e,oo=!0;try{(t&(nr|Ko))!==0?th(e):hi(e),ks(e);var o=Is(e);e.teardown=typeof o=="function"?o:null,e.wv=As;var i;Yo&&Od&&(e.f&ze)!==0&&e.deps}finally{oo=n,j=r}}}async function Os(){await Promise.resolve(),J()}function y(e){var t=e.f,r=(t&Re)!==0;if(B!==null&&!wt){var n=j!==null&&(j.f&Ut)!==0;if(!n&&(st===null||!Fr.call(st,e))){var o=B.deps;if((B.f&ei)!==0)e.rv<zr&&(e.rv=zr,Ge===null&&o!==null&&o[Xe]===e?Xe++:Ge===null?Ge=[e]:Ge.push(e));else{(B.deps??=[]).push(e);var i=e.reactions;i===null?e.reactions=[B]:Fr.call(i,B)||i.push(B)}}}if(fr&&dr.has(e))return dr.get(e);if(r){var a=e;if(fr){var s=a.v;return((a.f&we)===0&&a.reactions!==null||Ps(a))&&(s=oi(a)),dr.set(a,s),s}var l=(a.f&it)===0&&!wt&&B!==null&&(oo||(B.f&it)!==0),c=(a.f&Sr)===0;bn(a)&&(l&&(a.f|=it),os(a)),l&&!c&&(is(a),$s(a))}if(mt?.has(e))return mt.get(e);if((e.f&lr)!==0)throw e.v;return e.v}function $s(e){if(e.f|=it,e.deps!==null)for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&Re)!==0&&(t.f&it)===0&&(is(t),$s(t))}function Ps(e){if(e.v===me)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(dr.has(t)||(t.f&Re)!==0&&Ps(t))return!0;return!1}function yt(e){var t=wt;try{return wt=!0,e()}finally{wt=t}}const wn=Symbol("events"),Ls=new Set,pi=new Set;function Ds(e,t,r,n={}){function o(i){if(n.capture||gi.call(t,i),!i.cancelBubble)return ci(()=>r?.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?gt(()=>{t.addEventListener(e,o,n)}):t.addEventListener(e,o,n),o}function oh(e,t,r,n,o){var i={capture:n,passive:o},a=Ds(e,t,r,i);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&ro(()=>{t.removeEventListener(e,a,i)})}function Ns(e,t,r){(t[wn]??={})[e]=r}function Ms(e){for(var t=0;t<e.length;t++)Ls.add(e[t]);for(var r of pi)r(e)}let Fs=null;function gi(e){var t=this,r=t.ownerDocument,n=e.type,o=e.composedPath?.()||[],i=o[0]||e.target;Fs=e;var a=0,s=Fs===e&&e[wn];if(s){var l=o.indexOf(s);if(l!==-1&&(t===document||t===window)){e[wn]=t;return}var c=o.indexOf(t);if(c===-1)return;l<=c&&(a=l)}if(i=o[a]||e.target,i!==t){Wn(e,"currentTarget",{configurable:!0,get(){return i||r}});var u=B,h=j;at(null),It(null);try{for(var f,v=[];i!==null;){var g=i.assignedSlot||i.parentNode||i.host||null;try{var b=i[wn]?.[n];b!=null&&(!i.disabled||e.target===i)&&b.call(i,e)}catch(A){f?v.push(A):f=A}if(e.cancelBubble||g===t||g===null)break;i=g}if(f){for(let A of v)queueMicrotask(()=>{throw A});throw f}}finally{e[wn]=t,delete e.currentTarget,at(u),It(h)}}}const ih=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function ah(e){return ih?.createHTML(e)??e}function sh(e){var t=mn("template");return t.innerHTML=ah(e.replaceAll("<!>","<!---->")),t.content}function Yt(e,t){var r=j;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function Ot(e,t){var r=(t&sd)!==0,n=(t&ld)!==0,o,i=!e.startsWith("<!>");return()=>{if($)return Yt(N,null),N;o===void 0&&(o=sh(i?e:"<!>"+e),r||(o=bt(o)));var a=n||us?document.importNode(o,!0):o.cloneNode(!0);if(r){var s=bt(a),l=a.lastChild;Yt(s,l)}else Yt(a,a);return a}}function _t(){if($)return Yt(N,null),N;var e=document.createDocumentFragment(),t=document.createComment(""),r=Je();return e.append(t,r),Yt(t,r),e}function ie(e,t){if($){var r=j;((r.f&Sr)===0||r.nodes.end===null)&&(r.nodes.end=N),qt();return}e!==null&&e.before(t)}function lh(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const ch=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function uh(e){return ch.includes(e)}const dh={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function hh(e){return e=e.toLowerCase(),dh[e]??e}const fh=["touchstart","touchmove"];function ph(e){return fh.includes(e)}const gh=["textarea","script","style","title"];function mh(e){return gh.includes(e)}function js(e,t){var r=t==null?"":typeof t=="object"?`${t}`:t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=`${r}`)}function Bs(e,t){return Zs(e,t)}function vh(e,t){si(),t.intro=t.intro??!1;const r=t.target,n=$,o=N;try{for(var i=bt(r);i&&(i.nodeType!==Er||i.data!==Wo);)i=Ke(i);if(!i)throw yr;ye(!0),de(i);const a=Zs(e,{...t,anchor:i});return ye(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
|
|
2
|
+
`).some(s=>s.startsWith("https://svelte.dev/e/")))throw a;return a!==yr&&console.warn("Failed to hydrate: ",a),t.recover===!1&&xd(),si(),fs(r),ye(!1),Bs(e,t)}finally{ye(n),de(o)}}const io=new Map;function Zs(e,{target:t,anchor:r,props:n={},events:o,context:i,intro:a=!0,transformError:s}){si();var l=void 0,c=Xd(()=>{var u=r??t.appendChild(Je());es(u,{pending:()=>{}},v=>{Zr({});var g=qe;if(i&&(g.c=i),o&&(n.$$events=o),$&&Yt(v,null),l=e(v,n)||{},$&&(j.nodes.end=N,N===null||N.nodeType!==Er||N.data!==Qo))throw fn(),yr;Ur()},s);var h=new Set,f=v=>{for(var g=0;g<v.length;g++){var b=v[g];if(!h.has(b)){h.add(b);var A=ph(b);for(const S of[t,document]){var w=io.get(S);w===void 0&&(w=new Map,io.set(S,w));var _=w.get(b);_===void 0?(S.addEventListener(b,gi,{passive:A}),w.set(b,1)):w.set(b,_+1)}}}};return f(Hn(Ls)),pi.add(f),()=>{for(var v of h)for(const A of[t,document]){var g=io.get(A),b=g.get(v);--b==0?(A.removeEventListener(v,gi),g.delete(v),g.size===0&&io.delete(A)):g.set(v,b)}pi.delete(f),u!==r&&u.parentNode?.removeChild(u)}});return mi.set(l,c),l}let mi=new WeakMap;function bh(e,t){const r=mi.get(e);return r?(mi.delete(e),r(t)):Promise.resolve()}class ao{anchor;#e=new Map;#t=new Map;#r=new Map;#s=new Set;#n=!0;constructor(t,r=!0){this.anchor=t,this.#n=r}#a=t=>{if(this.#e.has(t)){var r=this.#e.get(t),n=this.#t.get(r);if(n)fi(n),this.#s.delete(r);else{var o=this.#r.get(r);o&&(this.#t.set(r,o.effect),this.#r.delete(r),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),n=o.effect)}for(const[i,a]of this.#e){if(this.#e.delete(i),i===t)break;const s=this.#r.get(a);s&&(_e(s.effect),this.#r.delete(a))}for(const[i,a]of this.#t){if(i===r||this.#s.has(i))continue;const s=()=>{if(Array.from(this.#e.values()).includes(i)){var c=document.createDocumentFragment();xs(a,c),c.append(Je()),this.#r.set(i,{effect:a,fragment:c})}else _e(a);this.#s.delete(i),this.#t.delete(i)};this.#n||!n?(this.#s.add(i),Rr(a,s,!1)):s()}}};#o=t=>{this.#e.delete(t);const r=Array.from(this.#e.values());for(const[n,o]of this.#r)r.includes(n)||(_e(o.effect),this.#r.delete(n))};ensure(t,r){var n=ee,o=ps();if(r&&!this.#t.has(t)&&!this.#r.has(t))if(o){var i=document.createDocumentFragment(),a=Je();i.append(a),this.#r.set(t,{effect:He(()=>r(a)),fragment:i})}else this.#t.set(t,He(()=>r(this.anchor)));if(this.#e.set(n,t),o){for(const[s,l]of this.#t)s===t?n.unskip_effect(l):n.skip_effect(l);for(const[s,l]of this.#r)s===t?n.unskip_effect(l.effect):n.skip_effect(l.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else $&&(this.anchor=N),this.#a(n)}}function Us(e,t,...r){var n=new ao(e);Cr(()=>{const o=t()??null;n.ensure(o,o&&(i=>o(i,...r)))},ir)}function kh(e){qe===null&&Ma(),ms(()=>{const t=yt(e);if(typeof t=="function")return t})}function wh(e){qe===null&&Ma(),kh(()=>()=>yt(e))}const qs=0,Vs=1,yh=2;function Hs(e,t,r,n,o){$&&qt();var i=me,a=Gt(i),s=Gt(i),l=new ao(e);Cr(()=>{var c=t(),u=!1;let h=$&&Pa(c)===(e.data===un);if(h&&(de(pn()),ye(!1)),Pa(c)){var f=rs(),v=!1;const g=b=>{if(!u){v=!0,f(!1),Rt.ensure(),$&&ye(!1);try{b()}finally{eo(!1),qr||J()}}};c.then(b=>{g(()=>{Wt(a,b),l.ensure(Vs,n&&(A=>n(A,a)))})},b=>{g(()=>{if(Wt(s,b),l.ensure(yh,o&&(A=>o(A,s))),!o)throw s.v})}),$?l.ensure(qs,r):gt(()=>{v||g(()=>{l.ensure(qs,r)})})}else Wt(a,c),l.ensure(Vs,n&&(g=>n(g,a)));return h&&ye(!0),()=>{u=!0}})}function pr(e,t,r=!1){var n;$&&(n=N,qt());var o=new ao(e),i=r?ir:0;function a(s,l){if($){var c=ja(n),u;if(c===Wo?u=0:c===un?u=!1:u=parseInt(c.substring(1)),s!==u){var h=pn();de(h),o.anchor=h,ye(!1),o.ensure(s,l),ye(!0);return}}o.ensure(s,l)}Cr(()=>{var s=!1;t((l,c=0)=>{s=!0,a(c,l)}),s||a(!1,null)},i)}function _h(e,t){return t}function Sh(e,t,r){for(var n=[],o=t.length,i,a=t.length,s=0;s<o;s++){let h=t[s];Rr(h,()=>{if(i){if(i.pending.delete(h),i.done.add(h),i.pending.size===0){var f=e.outrogroups;vi(Hn(i.done)),f.delete(i),f.size===0&&(e.outrogroups=null)}}else a-=1},!1)}if(a===0){var l=n.length===0&&r!==null;if(l){var c=r,u=c.parentNode;fs(u),u.append(c),e.items.clear()}vi(t,!l)}else i={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(i)}function vi(e,t=!0){for(var r=0;r<e.length;r++)_e(e[r],t)}var Gs;function xh(e,t,r,n,o,i=null){var a=e,s=new Map;$&&qt();var l=null,c=ns(()=>{var b=r();return Vn(b)?b:b==null?[]:Hn(b)}),u,h=!0;function f(){g.fallback=l,Th(g,u,a,t,n),l!==null&&(u.length===0?(l.f&sr)===0?fi(l):(l.f^=sr,_n(l,null,a)):Rr(l,()=>{l=null}))}var v=Cr(()=>{u=y(c);var b=u.length;let A=!1;if($){var w=ja(a)===un;w!==(b===0)&&(a=pn(),de(a),ye(!1),A=!0)}for(var _=new Set,S=ee,T=ps(),C=0;C<b;C+=1){$&&N.nodeType===Er&&N.data===Qo&&(a=N,A=!0,ye(!1));var P=u[C],D=n(P,C),F=h?null:s.get(D);F?(F.v&&Wt(F.v,P),F.i&&Wt(F.i,C),T&&S.unskip_effect(F.e)):(F=Eh(s,h?a:Gs??=Je(),P,D,C,o,t,r),h||(F.e.f|=sr),s.set(D,F)),_.add(D)}if(b===0&&i&&!l&&(h?l=He(()=>i(a)):(l=He(()=>i(Gs??=Je())),l.f|=sr)),b>_.size&&kd(),$&&b>0&&de(pn()),!h)if(T){for(const[$e,fe]of s)_.has($e)||S.skip_effect(fe.e);S.oncommit(f),S.ondiscard(()=>{})}else f();A&&ye(!0),y(c)}),g={effect:v,items:s,outrogroups:null,fallback:l};h=!1,$&&(a=N)}function yn(e){for(;e!==null&&(e.f&ft)===0;)e=e.next;return e}function Th(e,t,r,n,o){var i=t.length,a=e.items,s=yn(e.effect.first),l,c=null,u=[],h=[],f,v,g,b;for(b=0;b<i;b+=1){if(f=t[b],v=o(f,b),g=a.get(v).e,e.outrogroups!==null)for(const F of e.outrogroups)F.pending.delete(g),F.done.delete(g);if((g.f&sr)!==0)if(g.f^=sr,g===s)_n(g,null,r);else{var A=c?c.next:s;g===e.effect.last&&(e.effect.last=g.prev),g.prev&&(g.prev.next=g.next),g.next&&(g.next.prev=g.prev),gr(e,c,g),gr(e,g,A),_n(g,A,r),c=g,u=[],h=[],s=yn(c.next);continue}if((g.f&Ye)!==0&&fi(g),g!==s){if(l!==void 0&&l.has(g)){if(u.length<h.length){var w=h[0],_;c=w.prev;var S=u[0],T=u[u.length-1];for(_=0;_<u.length;_+=1)_n(u[_],w,r);for(_=0;_<h.length;_+=1)l.delete(h[_]);gr(e,S.prev,T.next),gr(e,c,S),gr(e,T,w),s=w,c=T,b-=1,u=[],h=[]}else l.delete(g),_n(g,s,r),gr(e,g.prev,g.next),gr(e,g,c===null?e.effect.first:c.next),gr(e,c,g),c=g;continue}for(u=[],h=[];s!==null&&s!==g;)(l??=new Set).add(s),h.push(s),s=yn(s.next);if(s===null)continue}(g.f&sr)===0&&u.push(g),c=g,s=yn(g.next)}if(e.outrogroups!==null){for(const F of e.outrogroups)F.pending.size===0&&(vi(Hn(F.done)),e.outrogroups?.delete(F));e.outrogroups.size===0&&(e.outrogroups=null)}if(s!==null||l!==void 0){var C=[];if(l!==void 0)for(g of l)(g.f&Ye)===0&&C.push(g);for(;s!==null;)(s.f&Ye)===0&&s!==e.fallback&&C.push(s),s=yn(s.next);var P=C.length;if(P>0){var D=null;Sh(e,C,D)}}}function Eh(e,t,r,n,o,i,a,s){var l=(a&ed)!==0?(a&rd)===0?ss(r,!1,!1):Gt(r):null,c=(a&td)!==0?Gt(o):null;return{v:l,i:c,e:He(()=>(i(t,l??r,c??o,s),()=>{e.delete(n)}))}}function _n(e,t,r){if(e.nodes)for(var n=e.nodes.start,o=e.nodes.end,i=t&&(t.f&sr)===0?t.nodes.start:r;n!==null;){var a=Ke(n);if(i.before(n),n===o)return;n=a}}function gr(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function bi(e,t,r=!1,n=!1,o=!1){var i=e,a="";no(()=>{var s=j;if(a===(a=t()??"")){$&&qt();return}if(s.nodes!==null&&(ws(s.nodes.start,s.nodes.end),s.nodes=null),a!==""){if($){N.data;for(var l=qt(),c=l;l!==null&&(l.nodeType!==Er||l.data!=="");)c=l,l=Ke(l);if(l===null)throw fn(),yr;Yt(N,c),i=de(l);return}var u=r?Ia:n?cd:void 0,h=mn(r?"svg":n?"math":"template",u);h.innerHTML=a;var f=r||n?h:h.content;if(Yt(bt(f),f.lastChild),r||n)for(;bt(f);)i.before(bt(f));else i.before(f)}})}function Ws(e,t,r,n,o,i){let a=$;$&&qt();var s=null;$&&N.nodeType===vd&&(s=N,qt());var l=$?N:e,c=new ao(l,!1);Cr(()=>{const u=t()||null;var h=u==="svg"?Ia:void 0;if(u===null){c.ensure(null,null);return}return c.ensure(u,f=>{if(u){if(s=$?s:mn(u,h),Yt(s,s),n){$&&mh(u)&&s.append(document.createComment(""));var v=$?bt(s):s.appendChild(Je());$&&(v===null?ye(!1):de(v)),n(s,v)}j.nodes.end=s,f.before(s)}$&&de(f)}),()=>{}},ir),ro(()=>{}),a&&(ye(!0),de(l))}function Ah(e,t){let r=null,n=$;var o;if($){r=N;for(var i=bt(document.head);i!==null&&(i.nodeType!==Er||i.data!==e);)i=Ke(i);if(i===null)ye(!1);else{var a=Ke(i);i.remove(),de(a)}}$||(o=document.head.appendChild(Je()));try{Cr(()=>t(o),Na|ar)}finally{n&&(ye(!0),de(r))}}function Ch(e,t){vn(()=>{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){const o=mn("style");o.id=t.hash,o.textContent=t.code,n.appendChild(o)}})}function Qs(e,t,r){vn(()=>{var n=yt(()=>t(e,r?.())||{});if(n?.destroy)return()=>n.destroy()})}function Rh(e,t){var r=void 0,n;bs(()=>{r!==(r=t())&&(n&&(_e(n),n=null),r&&(n=He(()=>{vn(()=>r(e))})))})}function Ys(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Ys(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function zh(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Ys(e))&&(n&&(n+=" "),n+=t);return n}function Ih(e){return typeof e=="object"?zh(e):e??""}const Js=[...`
|
|
3
|
+
\r\f \v\uFEFF`];function Oh(e,t,r){var n=e==null?"":""+e;if(r){for(var o of Object.keys(r))if(r[o])n=n?n+" "+o:o;else if(n.length)for(var i=o.length,a=0;(a=n.indexOf(o,a))>=0;){var s=a+i;(a===0||Js.includes(n[a-1]))&&(s===n.length||Js.includes(n[s]))?n=(a===0?"":n.substring(0,a))+n.substring(s+1):a=s}}return n===""?null:n}function Ks(e,t=!1){var r=t?" !important;":";",n="";for(var o of Object.keys(e)){var i=e[o];i!=null&&i!==""&&(n+=" "+o+": "+i+r)}return n}function ki(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function $h(e,t){if(t){var r="",n,o;if(Array.isArray(t)?(n=t[0],o=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,a=0,s=!1,l=[];n&&l.push(...Object.keys(n).map(ki)),o&&l.push(...Object.keys(o).map(ki));var c=0,u=-1;const b=e.length;for(var h=0;h<b;h++){var f=e[h];if(s?f==="/"&&e[h-1]==="*"&&(s=!1):i?i===f&&(i=!1):f==="/"&&e[h+1]==="*"?s=!0:f==='"'||f==="'"?i=f:f==="("?a++:f===")"&&a--,!s&&i===!1&&a===0){if(f===":"&&u===-1)u=h;else if(f===";"||h===b-1){if(u!==-1){var v=ki(e.substring(c,u).trim());if(!l.includes(v)){f!==";"&&h++;var g=e.substring(c,h).trim();r+=" "+g+";"}}c=h+1,u=-1}}}}return n&&(r+=Ks(n)),o&&(r+=Ks(o,!0)),r=r.trim(),r===""?null:r}return e==null?null:String(e)}function Ph(e,t,r,n,o,i){var a=e.__className;if($||a!==r||a===void 0){var s=Oh(r,n,i);(!$||s!==e.getAttribute("class"))&&(s==null?e.removeAttribute("class"):t?e.className=s:e.setAttribute("class",s)),e.__className=r}else if(i&&o!==i)for(var l in i){var c=!!i[l];(o==null||c!==!!o[l])&&e.classList.toggle(l,c)}return i}function wi(e,t={},r,n){for(var o in r){var i=r[o];t[o]!==i&&(r[o]==null?e.style.removeProperty(o):e.style.setProperty(o,i,n))}}function Lh(e,t,r,n){var o=e.__style;if($||o!==t){var i=$h(t,n);(!$||i!==e.getAttribute("style"))&&(i==null?e.removeAttribute("style"):e.style.cssText=i),e.__style=t}else n&&(Array.isArray(n)?(wi(e,r?.[0],n[0]),wi(e,r?.[1],n[1],"important")):wi(e,r,n));return n}function yi(e,t,r=!1){if(e.multiple){if(t==null)return;if(!Vn(t))return zd();for(var n of e.options)n.selected=t.includes(Xs(n));return}for(n of e.options){var o=Xs(n);if(Gd(o,t)){n.selected=!0;return}}(!r||t!==void 0)&&(e.selectedIndex=-1)}function Dh(e){var t=new MutationObserver(()=>{yi(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),ro(()=>{t.disconnect()})}function Xs(e){return"__value"in e?e.__value:e.value}const Gr=Symbol("class"),Sn=Symbol("style"),el=Symbol("is custom element"),tl=Symbol("is html"),Nh=Qn?"link":"LINK",Mh=Qn?"input":"INPUT",Fh=Qn?"option":"OPTION",jh=Qn?"select":"SELECT";function Bh(e){if($){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var n=e.value;xn(e,"value",null),e.value=n}if(e.hasAttribute("checked")){var o=e.checked;xn(e,"checked",null),e.checked=o}}};e.__on_r=r,gt(r),Qd()}}function Zh(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function xn(e,t,r,n){var o=nl(e);$&&(o[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName===Nh)||o[t]!==(o[t]=r)&&(t==="loading"&&(e[md]=r),r==null?e.removeAttribute(t):typeof r!="string"&&il(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Uh(e,t,r,n,o=!1,i=!1){if($&&o&&e.nodeName===Mh){var a=e,s=a.type==="checkbox"?"defaultChecked":"defaultValue";s in r||Bh(a)}var l=nl(e),c=l[el],u=!l[tl];let h=$&&c;h&&ye(!1);var f=t||{},v=e.nodeName===Fh;for(var g in t)g in r||(r[g]=null);r.class?r.class=Ih(r.class):r[Gr]&&(r.class=null),r[Sn]&&(r.style??=null);var b=il(e);for(const P in r){let D=r[P];if(v&&P==="value"&&D==null){e.value=e.__value="",f[P]=D;continue}if(P==="class"){var A=e.namespaceURI==="http://www.w3.org/1999/xhtml";Ph(e,A,D,n,t?.[Gr],r[Gr]),f[P]=D,f[Gr]=r[Gr];continue}if(P==="style"){Lh(e,D,t?.[Sn],r[Sn]),f[P]=D,f[Sn]=r[Sn];continue}var w=f[P];if(!(D===w&&!(D===void 0&&e.hasAttribute(P)))){f[P]=D;var _=P[0]+P[1];if(_!=="$$")if(_==="on"){const F={},$e="$$"+P;let fe=P.slice(2);var S=uh(fe);if(lh(fe)&&(fe=fe.slice(0,-7),F.capture=!0),!S&&w){if(D!=null)continue;e.removeEventListener(fe,f[$e],F),f[$e]=null}if(S)Ns(fe,e,D),Ms([fe]);else if(D!=null){let be=function(Dr){f[P].call(this,Dr)};f[$e]=Ds(fe,e,be,F)}}else if(P==="style")xn(e,P,D);else if(P==="autofocus")Wd(e,!!D);else if(!c&&(P==="__value"||P==="value"&&D!=null))e.value=e.__value=D;else if(P==="selected"&&v)Zh(e,D);else{var T=P;u||(T=hh(T));var C=T==="defaultValue"||T==="defaultChecked";if(D==null&&!c&&!C)if(l[P]=null,T==="value"||T==="checked"){let F=e;const $e=t===void 0;if(T==="value"){let fe=F.defaultValue;F.removeAttribute(T),F.defaultValue=fe,F.value=F.__value=$e?fe:null}else{let fe=F.defaultChecked;F.removeAttribute(T),F.defaultChecked=fe,F.checked=$e?fe:!1}}else e.removeAttribute(P);else C||b.includes(T)&&(c||typeof D!="string")?(e[T]=D,T in l&&(l[T]=me)):typeof D!="function"&&xn(e,T,D)}}}return h&&ye(!0),f}function rl(e,t,r=[],n=[],o=[],i,a=!1,s=!1){ts(o,r,n,l=>{var c=void 0,u={},h=e.nodeName===jh,f=!1;if(bs(()=>{var g=t(...l.map(y)),b=Uh(e,c,g,i,a,s);f&&h&&"value"in g&&yi(e,g.value);for(let w of Object.getOwnPropertySymbols(u))g[w]||_e(u[w]);for(let w of Object.getOwnPropertySymbols(g)){var A=g[w];w.description===ud&&(!c||A!==c[w])&&(u[w]&&_e(u[w]),u[w]=He(()=>Rh(e,()=>A))),b[w]=A}c=b}),h){var v=e;vn(()=>{yi(v,c.value,!0),Dh(v)})}f=!0})}function nl(e){return e.__attributes??={[el]:e.nodeName.includes("-"),[tl]:e.namespaceURI===za}}var ol=new Map;function il(e){var t=e.getAttribute("is")||e.nodeName,r=ol.get(t);if(r)return r;ol.set(t,r=[]);for(var n,o=e,i=Element.prototype;i!==o;){n=hd(o);for(var a in n)n[a].set&&r.push(a);o=Jo(o)}return r}function al(e,t){return e===t||e?.[cr]===t}function sl(e={},t,r,n){return vn(()=>{var o,i;return di(()=>{o=i,i=[],yt(()=>{e!==r(...i)&&(t(e,...i),o&&al(r(...o),e)&&t(null,...o))})}),()=>{gt(()=>{i&&al(r(...i),e)&&t(null,...i)})}}),e}const Wr=[];function qh(e,t=_r){let r=null;const n=new Set;function o(s){if(Za(e,s)&&(e=s,r)){const l=!Wr.length;for(const c of n)c[1](),Wr.push(c,e);if(l){for(let c=0;c<Wr.length;c+=2)Wr[c][0](Wr[c+1]);Wr.length=0}}}function i(s){o(s(e))}function a(s,l=_r){const c=[s,l];return n.add(c),n.size===1&&(r=t(o,i)||_r),s(e),()=>{n.delete(c),n.size===0&&r&&(r(),r=null)}}return{set:o,update:i,subscribe:a}}let so=!1;function Vh(e){var t=so;try{return so=!1,[e(),so]}finally{so=t}}const Hh={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function _i(e,t,r){return new Proxy({props:e,exclude:t},Hh)}const Gh={get(e,t){let r=e.props.length;for(;r--;){let n=e.props[r];if(dn(n)&&(n=n()),typeof n=="object"&&n!==null&&t in n)return n[t]}},set(e,t,r){let n=e.props.length;for(;n--;){let o=e.props[n];dn(o)&&(o=o());const i=Zt(o,t);if(i&&i.set)return i.set(r),!0}return!1},getOwnPropertyDescriptor(e,t){let r=e.props.length;for(;r--;){let n=e.props[r];if(dn(n)&&(n=n()),typeof n=="object"&&n!==null&&t in n){const o=Zt(n,t);return o&&!o.configurable&&(o.configurable=!0),o}}},has(e,t){if(t===cr||t===ri)return!1;for(let r of e.props)if(dn(r)&&(r=r()),r!=null&&t in r)return!0;return!1},ownKeys(e){const t=[];for(let r of e.props)if(dn(r)&&(r=r()),!!r){for(const n in r)t.includes(n)||t.push(n);for(const n of Object.getOwnPropertySymbols(r))t.includes(n)||t.push(n)}return t}};function Wh(...e){return new Proxy({props:e},Gh)}function ae(e,t,r,n){var o=(r&id)!==0,i=(r&ad)!==0,a=n,s=!0,l=()=>(s&&(s=!1,a=i?yt(n):n),a),c;if(o){var u=cr in e||ri in e;c=Zt(e,t)?.set??(u&&t in e?_=>e[t]=_:void 0)}var h,f=!1;o?[h,f]=Vh(()=>e[t]):h=e[t],h===void 0&&n!==void 0&&(h=l(),c&&(Td(),c(h)));var v;if(v=()=>{var _=e[t];return _===void 0?l():(s=!0,_)},(r&od)===0)return v;if(c){var g=e.$$legacy;return(function(_,S){return arguments.length>0?((!S||g||f)&&c(S?v():_),_):v()})}var b=!1,A=((r&nd)!==0?to:ns)(()=>(b=!1,v()));o&&y(A);var w=j;return(function(_,S){if(arguments.length>0){const T=S?y(A):o?zt(_):_;return L(A,T),b=!0,a!==void 0&&(a=T),_}return fr&&b||(w.f&Ut)!==0?A.v:y(A)})}function Qh(e){return new Yh(e)}class Yh{#e;#t;constructor(t){var r=new Map,n=(i,a)=>{var s=ss(a,!1,!1);return r.set(i,s),s};const o=new Proxy({...t.props||{},$$events:{}},{get(i,a){return y(r.get(a)??n(a,Reflect.get(i,a)))},has(i,a){return a===ri?!0:(y(r.get(a)??n(a,Reflect.get(i,a))),Reflect.has(i,a))},set(i,a,s){return L(r.get(a)??n(a,s),s),Reflect.set(i,a,s)}});this.#t=(t.hydrate?vh:Bs)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&J(),this.#e=o.$$events;for(const i of Object.keys(this.#t))i==="$set"||i==="$destroy"||i==="$on"||Wn(this,i,{get(){return this.#t[i]},set(a){this.#t[i]=a},enumerable:!0});this.#t.$set=i=>{Object.assign(o,i)},this.#t.$destroy=()=>{bh(this.#t)}}$set(t){this.#t.$set(t)}$on(t,r){this.#e[t]=this.#e[t]||[];const n=(...o)=>r.call(this,...o);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(o=>o!==n)}}$destroy(){this.#t.$destroy()}}let ll;typeof HTMLElement=="function"&&(ll=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&(this.$$shadowRoot=this.attachShadow(r))}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){const n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return o=>{const i=mn("slot");n!=="default"&&(i.name=n),ie(o,i)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},r=Jh(this);for(const n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(const n of this.attributes){const o=this.$$g_p(n.name);o in this.$$d||(this.$$d[o]=lo(o,n.value,this.$$p_d,"toProp"))}for(const n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Qh({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=Kd(()=>{di(()=>{this.$$r=!0;for(const n of Gn(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];const o=lo(n,this.$$d[n],this.$$p_d,"toAttribute");o==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,o)}this.$$r=!1})});for(const n in this.$$l)for(const o of this.$$l[n]){const i=this.$$c.$on(n,o);this.$$l_u.set(o,i)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=lo(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Gn(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function lo(e,t,r,n){const o=r[e]?.type;if(t=o==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(o){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(o){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function Jh(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function Tn(e,t,r,n,o,i){let a=class extends ll{constructor(){super(e,r,o),this.$$p_d=t}static get observedAttributes(){return Gn(t).map(s=>(t[s].attribute||s).toLowerCase())}};return Gn(t).forEach(s=>{Wn(a.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(l){l=lo(s,l,t),this.$$d[s]=l;var c=this.$$c;if(c){var u=Zt(c,s)?.get;u?c[s]=l:c.$set({[s]:l})}}})}),n.forEach(s=>{Wn(a.prototype,s,{get(){return this.$$c?.[s]}})}),e.element=a,a}var Kh=Ot('<div class="chat-app__container"><div class="error-message svelte-14mj70v">Server is unreachable, please try later... <button class="error-message__retry-button svelte-14mj70v">Retry</button></div></div>'),Xh=Ot(" <!>",1);const ef={hash:"svelte-14mj70v",code:`
|
|
4
|
+
/* These styles are inline, because at this point theme loading has failed. */.error-message.svelte-14mj70v {display:table;z-index:1000;width:auto;margin:2rem auto;padding:2rem;border-radius:2px;background:white;color:oklch(27.8% 0.033 256.848);font-family:-apple-system,
|
|
4
5
|
BlinkMacSystemFont,
|
|
5
6
|
avenir next,
|
|
6
7
|
avenir,
|
|
@@ -12,68 +13,106 @@ var LiipGPTButton=function(sn){"use strict";const Gc="5";typeof window<"u"&&((wi
|
|
|
12
13
|
roboto,
|
|
13
14
|
noto,
|
|
14
15
|
arial,
|
|
15
|
-
sans-serif;}.error-message__retry-button.svelte-
|
|
16
|
-
`,d())??""]),oe(l,h)};let n=se(e,"body",7),a=se(e,"silent",7),i=te(void 0);const o=l=>{$(i,{error:l},!0)};var s=vt(),c=Oe(s);return Mu(c,{get failed(){return r}},l=>{var d=vt(),p=Oe(d);{var h=m=>{r(m,()=>_(i).error,()=>()=>{$(i,void 0)})},v=m=>{var b=vt(),A=Oe(b);Ss(A,n,()=>o),oe(m,b)};ur(p,m=>{_(i)?m(h):m(v,!1)})}oe(l,d)}),oe(t,s),Ur({get body(){return n()},set body(l){n(l),re()},get silent(){return a()},set silent(l){a(l),re()}})}ks(["click"]),bn(Us,{body:{},silent:{}},[],[],!0);/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:qs,setPrototypeOf:Vs,isFrozen:qd,getPrototypeOf:Vd,getOwnPropertyDescriptor:Hd}=Object;let{freeze:Ne,seal:ct,create:Hs}=Object,{apply:pi,construct:gi}=typeof Reflect<"u"&&Reflect;Ne||(Ne=function(e){return e}),ct||(ct=function(e){return e}),pi||(pi=function(e,r,n){return e.apply(r,n)}),gi||(gi=function(e,r){return new e(...r)});const ra=De(Array.prototype.forEach),Zd=De(Array.prototype.lastIndexOf),Zs=De(Array.prototype.pop),kn=De(Array.prototype.push),Gd=De(Array.prototype.splice),na=De(String.prototype.toLowerCase),mi=De(String.prototype.toString),Gs=De(String.prototype.match),yn=De(String.prototype.replace),Wd=De(String.prototype.indexOf),Qd=De(String.prototype.trim),bt=De(Object.prototype.hasOwnProperty),Pe=De(RegExp.prototype.test),wn=Yd(TypeError);function De(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return pi(t,e,n)}}function Yd(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return gi(t,r)}}function V(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:na;Vs&&Vs(t,null);let n=e.length;for(;n--;){let a=e[n];if(typeof a=="string"){const i=r(a);i!==a&&(qd(e)||(e[n]=i),a=i)}t[a]=!0}return t}function Kd(t){for(let e=0;e<t.length;e++)bt(t,e)||(t[e]=null);return t}function Zt(t){const e=Hs(null);for(const[r,n]of qs(t))bt(t,r)&&(Array.isArray(n)?e[r]=Kd(n):n&&typeof n=="object"&&n.constructor===Object?e[r]=Zt(n):e[r]=n);return e}function _n(t,e){for(;t!==null;){const n=Hd(t,e);if(n){if(n.get)return De(n.get);if(typeof n.value=="function")return De(n.value)}t=Vd(t)}function r(){return null}return r}const Ws=Ne(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),vi=Ne(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),bi=Ne(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Xd=Ne(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ki=Ne(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Jd=Ne(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Qs=Ne(["#text"]),Ys=Ne(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),yi=Ne(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ks=Ne(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),aa=Ne(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),eh=ct(/\{\{[\w\W]*|[\w\W]*\}\}/gm),th=ct(/<%[\w\W]*|[\w\W]*%>/gm),rh=ct(/\$\{[\w\W]*/gm),nh=ct(/^data-[\-\w.\u00B7-\uFFFF]+$/),ah=ct(/^aria-[\-\w]+$/),Xs=ct(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ih=ct(/^(?:\w+script|data):/i),oh=ct(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Js=ct(/^html$/i),sh=ct(/^[a-z][.\w]*(-[.\w]+)+$/i);var el=Object.freeze({__proto__:null,ARIA_ATTR:ah,ATTR_WHITESPACE:oh,CUSTOM_ELEMENT:sh,DATA_ATTR:nh,DOCTYPE_NAME:Js,ERB_EXPR:th,IS_ALLOWED_URI:Xs,IS_SCRIPT_OR_DATA:ih,MUSTACHE_EXPR:eh,TMPLIT_EXPR:rh});const xn={element:1,text:3,progressingInstruction:7,comment:8,document:9},lh=function(){return typeof window>"u"?null:window},ch=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(n=r.getAttribute(a));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},tl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function rl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lh();const e=M=>rl(M);if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==xn.document||!t.Element)return e.isSupported=!1,e;let{document:r}=t;const n=r,a=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:h,trustedTypes:v}=t,m=c.prototype,b=_n(m,"cloneNode"),A=_n(m,"remove"),y=_n(m,"nextSibling"),k=_n(m,"childNodes"),w=_n(m,"parentNode");if(typeof o=="function"){const M=r.createElement("template");M.content&&M.content.ownerDocument&&(r=M.content.ownerDocument)}let T,I="";const{implementation:U,createNodeIterator:Q,createDocumentFragment:je,getElementsByTagName:ce}=r,{importNode:pr}=n;let ae=tl();e.isSupported=typeof qs=="function"&&typeof w=="function"&&U&&U.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:er,ERB_EXPR:gr,TMPLIT_EXPR:mr,DATA_ATTR:rn,ARIA_ATTR:co,IS_SCRIPT_OR_DATA:uo,ATTR_WHITESPACE:Ra,CUSTOM_ELEMENT:ho}=el;let{IS_ALLOWED_URI:Ia}=el,ue=null;const Mn=V({},[...Ws,...vi,...bi,...ki,...Qs]);let ge=null;const B=V({},[...Ys,...yi,...Ks,...aa]);let z=Object.seal(Hs(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),G=null,Ue=null,ye=!0,le=!0,qe=!1,we=!0,_e=!1,xe=!0,ie=!1,rt=!1,Ve=!1,ft=!1,tr=!1,Ot=!1,Nn=!0,La=!1;const fo="user-content-";let nn=!0,$r=!1,nt={},Ze=null;const zr=V({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Oa=null;const Ma=V({},["audio","video","img","source","image","track"]);let Pn=null;const Mt=V({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),at="http://www.w3.org/1998/Math/MathML",Nt="http://www.w3.org/2000/svg",_t="http://www.w3.org/1999/xhtml";let Pt=_t,po=!1,go=null;const $0=V({},[at,Nt,_t],mi);let Na=V({},["mi","mo","mn","ms","mtext"]),Pa=V({},["annotation-xml"]);const z0=V({},["title","style","font","a","script"]);let Dn=null;const F0=["application/xhtml+xml","text/html"],B0="text/html";let Se=null,an=null;const j0=r.createElement("form"),Pc=function(f){return f instanceof RegExp||f instanceof Function},mo=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(an&&an===f)){if((!f||typeof f!="object")&&(f={}),f=Zt(f),Dn=F0.indexOf(f.PARSER_MEDIA_TYPE)===-1?B0:f.PARSER_MEDIA_TYPE,Se=Dn==="application/xhtml+xml"?mi:na,ue=bt(f,"ALLOWED_TAGS")?V({},f.ALLOWED_TAGS,Se):Mn,ge=bt(f,"ALLOWED_ATTR")?V({},f.ALLOWED_ATTR,Se):B,go=bt(f,"ALLOWED_NAMESPACES")?V({},f.ALLOWED_NAMESPACES,mi):$0,Pn=bt(f,"ADD_URI_SAFE_ATTR")?V(Zt(Mt),f.ADD_URI_SAFE_ATTR,Se):Mt,Oa=bt(f,"ADD_DATA_URI_TAGS")?V(Zt(Ma),f.ADD_DATA_URI_TAGS,Se):Ma,Ze=bt(f,"FORBID_CONTENTS")?V({},f.FORBID_CONTENTS,Se):zr,G=bt(f,"FORBID_TAGS")?V({},f.FORBID_TAGS,Se):Zt({}),Ue=bt(f,"FORBID_ATTR")?V({},f.FORBID_ATTR,Se):Zt({}),nt=bt(f,"USE_PROFILES")?f.USE_PROFILES:!1,ye=f.ALLOW_ARIA_ATTR!==!1,le=f.ALLOW_DATA_ATTR!==!1,qe=f.ALLOW_UNKNOWN_PROTOCOLS||!1,we=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,_e=f.SAFE_FOR_TEMPLATES||!1,xe=f.SAFE_FOR_XML!==!1,ie=f.WHOLE_DOCUMENT||!1,ft=f.RETURN_DOM||!1,tr=f.RETURN_DOM_FRAGMENT||!1,Ot=f.RETURN_TRUSTED_TYPE||!1,Ve=f.FORCE_BODY||!1,Nn=f.SANITIZE_DOM!==!1,La=f.SANITIZE_NAMED_PROPS||!1,nn=f.KEEP_CONTENT!==!1,$r=f.IN_PLACE||!1,Ia=f.ALLOWED_URI_REGEXP||Xs,Pt=f.NAMESPACE||_t,Na=f.MATHML_TEXT_INTEGRATION_POINTS||Na,Pa=f.HTML_INTEGRATION_POINTS||Pa,z=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&Pc(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&Pc(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(z.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),_e&&(le=!1),tr&&(ft=!0),nt&&(ue=V({},Qs),ge=[],nt.html===!0&&(V(ue,Ws),V(ge,Ys)),nt.svg===!0&&(V(ue,vi),V(ge,yi),V(ge,aa)),nt.svgFilters===!0&&(V(ue,bi),V(ge,yi),V(ge,aa)),nt.mathMl===!0&&(V(ue,ki),V(ge,Ks),V(ge,aa))),f.ADD_TAGS&&(ue===Mn&&(ue=Zt(ue)),V(ue,f.ADD_TAGS,Se)),f.ADD_ATTR&&(ge===B&&(ge=Zt(ge)),V(ge,f.ADD_ATTR,Se)),f.ADD_URI_SAFE_ATTR&&V(Pn,f.ADD_URI_SAFE_ATTR,Se),f.FORBID_CONTENTS&&(Ze===zr&&(Ze=Zt(Ze)),V(Ze,f.FORBID_CONTENTS,Se)),nn&&(ue["#text"]=!0),ie&&V(ue,["html","head","body"]),ue.table&&(V(ue,["tbody"]),delete G.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw wn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw wn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=f.TRUSTED_TYPES_POLICY,I=T.createHTML("")}else T===void 0&&(T=ch(v,a)),T!==null&&typeof I=="string"&&(I=T.createHTML(""));Ne&&Ne(f),an=f}},Dc=V({},[...vi,...bi,...Xd]),$c=V({},[...ki,...Jd]),U0=function(f){let S=w(f);(!S||!S.tagName)&&(S={namespaceURI:Pt,tagName:"template"});const O=na(f.tagName),ne=na(S.tagName);return go[f.namespaceURI]?f.namespaceURI===Nt?S.namespaceURI===_t?O==="svg":S.namespaceURI===at?O==="svg"&&(ne==="annotation-xml"||Na[ne]):!!Dc[O]:f.namespaceURI===at?S.namespaceURI===_t?O==="math":S.namespaceURI===Nt?O==="math"&&Pa[ne]:!!$c[O]:f.namespaceURI===_t?S.namespaceURI===Nt&&!Pa[ne]||S.namespaceURI===at&&!Na[ne]?!1:!$c[O]&&(z0[O]||!Dc[O]):!!(Dn==="application/xhtml+xml"&&go[f.namespaceURI]):!1},Dt=function(f){kn(e.removed,{element:f});try{w(f).removeChild(f)}catch{A(f)}},on=function(f,S){try{kn(e.removed,{attribute:S.getAttributeNode(f),from:S})}catch{kn(e.removed,{attribute:null,from:S})}if(S.removeAttribute(f),f==="is")if(ft||tr)try{Dt(S)}catch{}else try{S.setAttribute(f,"")}catch{}},zc=function(f){let S=null,O=null;if(Ve)f="<remove></remove>"+f;else{const me=Gs(f,/^[\r\n\t ]+/);O=me&&me[0]}Dn==="application/xhtml+xml"&&Pt===_t&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const ne=T?T.createHTML(f):f;if(Pt===_t)try{S=new h().parseFromString(ne,Dn)}catch{}if(!S||!S.documentElement){S=U.createDocument(Pt,"template",null);try{S.documentElement.innerHTML=po?I:ne}catch{}}const Re=S.body||S.documentElement;return f&&O&&Re.insertBefore(r.createTextNode(O),Re.childNodes[0]||null),Pt===_t?ce.call(S,ie?"html":"body")[0]:ie?S.documentElement:Re},Fc=function(f){return Q.call(f.ownerDocument||f,f,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},vo=function(f){return f instanceof p&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof d)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},Bc=function(f){return typeof s=="function"&&f instanceof s};function rr(M,f,S){ra(M,O=>{O.call(e,f,S,an)})}const jc=function(f){let S=null;if(rr(ae.beforeSanitizeElements,f,null),vo(f))return Dt(f),!0;const O=Se(f.nodeName);if(rr(ae.uponSanitizeElement,f,{tagName:O,allowedTags:ue}),xe&&f.hasChildNodes()&&!Bc(f.firstElementChild)&&Pe(/<[/\w!]/g,f.innerHTML)&&Pe(/<[/\w!]/g,f.textContent)||f.nodeType===xn.progressingInstruction||xe&&f.nodeType===xn.comment&&Pe(/<[/\w]/g,f.data))return Dt(f),!0;if(!ue[O]||G[O]){if(!G[O]&&qc(O)&&(z.tagNameCheck instanceof RegExp&&Pe(z.tagNameCheck,O)||z.tagNameCheck instanceof Function&&z.tagNameCheck(O)))return!1;if(nn&&!Ze[O]){const ne=w(f)||f.parentNode,Re=k(f)||f.childNodes;if(Re&&ne){const me=Re.length;for(let Ge=me-1;Ge>=0;--Ge){const nr=b(Re[Ge],!0);nr.__removalCount=(f.__removalCount||0)+1,ne.insertBefore(nr,y(f))}}}return Dt(f),!0}return f instanceof c&&!U0(f)||(O==="noscript"||O==="noembed"||O==="noframes")&&Pe(/<\/no(script|embed|frames)/i,f.innerHTML)?(Dt(f),!0):(_e&&f.nodeType===xn.text&&(S=f.textContent,ra([er,gr,mr],ne=>{S=yn(S,ne," ")}),f.textContent!==S&&(kn(e.removed,{element:f.cloneNode()}),f.textContent=S)),rr(ae.afterSanitizeElements,f,null),!1)},Uc=function(f,S,O){if(Nn&&(S==="id"||S==="name")&&(O in r||O in j0))return!1;if(!(le&&!Ue[S]&&Pe(rn,S))){if(!(ye&&Pe(co,S))){if(!ge[S]||Ue[S]){if(!(qc(f)&&(z.tagNameCheck instanceof RegExp&&Pe(z.tagNameCheck,f)||z.tagNameCheck instanceof Function&&z.tagNameCheck(f))&&(z.attributeNameCheck instanceof RegExp&&Pe(z.attributeNameCheck,S)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(S))||S==="is"&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&Pe(z.tagNameCheck,O)||z.tagNameCheck instanceof Function&&z.tagNameCheck(O))))return!1}else if(!Pn[S]){if(!Pe(Ia,yn(O,Ra,""))){if(!((S==="src"||S==="xlink:href"||S==="href")&&f!=="script"&&Wd(O,"data:")===0&&Oa[f])){if(!(qe&&!Pe(uo,yn(O,Ra,"")))){if(O)return!1}}}}}}return!0},qc=function(f){return f!=="annotation-xml"&&Gs(f,ho)},Vc=function(f){rr(ae.beforeSanitizeAttributes,f,null);const{attributes:S}=f;if(!S||vo(f))return;const O={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ge,forceKeepAttr:void 0};let ne=S.length;for(;ne--;){const Re=S[ne],{name:me,namespaceURI:Ge,value:nr}=Re,$n=Se(me),bo=nr;let Ie=me==="value"?bo:Qd(bo);if(O.attrName=$n,O.attrValue=Ie,O.keepAttr=!0,O.forceKeepAttr=void 0,rr(ae.uponSanitizeAttribute,f,O),Ie=O.attrValue,La&&($n==="id"||$n==="name")&&(on(me,f),Ie=fo+Ie),xe&&Pe(/((--!?|])>)|<\/(style|title)/i,Ie)){on(me,f);continue}if(O.forceKeepAttr)continue;if(!O.keepAttr){on(me,f);continue}if(!we&&Pe(/\/>/i,Ie)){on(me,f);continue}_e&&ra([er,gr,mr],Zc=>{Ie=yn(Ie,Zc," ")});const Hc=Se(f.nodeName);if(!Uc(Hc,$n,Ie)){on(me,f);continue}if(T&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!Ge)switch(v.getAttributeType(Hc,$n)){case"TrustedHTML":{Ie=T.createHTML(Ie);break}case"TrustedScriptURL":{Ie=T.createScriptURL(Ie);break}}if(Ie!==bo)try{Ge?f.setAttributeNS(Ge,me,Ie):f.setAttribute(me,Ie),vo(f)?Dt(f):Zs(e.removed)}catch{on(me,f)}}rr(ae.afterSanitizeAttributes,f,null)},q0=function M(f){let S=null;const O=Fc(f);for(rr(ae.beforeSanitizeShadowDOM,f,null);S=O.nextNode();)rr(ae.uponSanitizeShadowNode,S,null),jc(S),Vc(S),S.content instanceof i&&M(S.content);rr(ae.afterSanitizeShadowDOM,f,null)};return e.sanitize=function(M){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=null,O=null,ne=null,Re=null;if(po=!M,po&&(M="<!-->"),typeof M!="string"&&!Bc(M))if(typeof M.toString=="function"){if(M=M.toString(),typeof M!="string")throw wn("dirty is not a string, aborting")}else throw wn("toString is not a function");if(!e.isSupported)return M;if(rt||mo(f),e.removed=[],typeof M=="string"&&($r=!1),$r){if(M.nodeName){const nr=Se(M.nodeName);if(!ue[nr]||G[nr])throw wn("root node is forbidden and cannot be sanitized in-place")}}else if(M instanceof s)S=zc("<!---->"),O=S.ownerDocument.importNode(M,!0),O.nodeType===xn.element&&O.nodeName==="BODY"||O.nodeName==="HTML"?S=O:S.appendChild(O);else{if(!ft&&!_e&&!ie&&M.indexOf("<")===-1)return T&&Ot?T.createHTML(M):M;if(S=zc(M),!S)return ft?null:Ot?I:""}S&&Ve&&Dt(S.firstChild);const me=Fc($r?M:S);for(;ne=me.nextNode();)jc(ne),Vc(ne),ne.content instanceof i&&q0(ne.content);if($r)return M;if(ft){if(tr)for(Re=je.call(S.ownerDocument);S.firstChild;)Re.appendChild(S.firstChild);else Re=S;return(ge.shadowroot||ge.shadowrootmode)&&(Re=pr.call(n,Re,!0)),Re}let Ge=ie?S.outerHTML:S.innerHTML;return ie&&ue["!doctype"]&&S.ownerDocument&&S.ownerDocument.doctype&&S.ownerDocument.doctype.name&&Pe(Js,S.ownerDocument.doctype.name)&&(Ge="<!DOCTYPE "+S.ownerDocument.doctype.name+`>
|
|
17
|
-
`+
|
|
18
|
-
]`).replace("lheading",
|
|
19
|
-
`).map(i=>{const
|
|
20
|
-
`)}var
|
|
21
|
-
`)}}}fences(
|
|
22
|
-
`)}}blockquote(
|
|
16
|
+
sans-serif;}.error-message__retry-button.svelte-14mj70v {border:none;outline:none;background:none;font-size:1rem;text-decoration:underline;&:active {outline:none;}}`};function cl(e,t){Zr(t,!0),Ch(e,ef);const r=(u,h=_r,f=_r)=>{Fa();var v=Xh(),g=Le(v),b=hr(g);{var A=_=>{},w=_=>{var S=Kh(),T=Qt(S),C=hr(Qt(T));Vt(T),Vt(S),Ns("click",C,()=>f()()),ie(_,S)};pr(b,_=>{o()?_(A):_(w,!1)})}no(_=>js(g,`${_??""} `),[()=>console.error(`Panic, uncaught error:
|
|
17
|
+
`,h())??""]),ie(u,v)};let n=ae(t,"body",7),o=ae(t,"silent",7),i=Q(void 0);const a=u=>{L(i,{error:u},!0)};var s={get body(){return n()},set body(u){n(u),J()},get silent(){return o()},set silent(u){o(u),J()}},l=_t(),c=Le(l);return es(c,{get failed(){return r}},u=>{var h=_t(),f=Le(h);{var v=b=>{r(b,()=>y(i).error,()=>()=>{L(i,void 0)})},g=b=>{var A=_t(),w=Le(A);Us(w,n,()=>a),ie(b,A)};pr(f,b=>{y(i)?b(v):b(g,!1)})}ie(u,h)}),ie(e,l),Ur(s)}Ms(["click"]),Tn(cl,{body:{},silent:{}},[],[],{mode:"open"});const{entries:ul,setPrototypeOf:dl,isFrozen:tf,getPrototypeOf:rf,getOwnPropertyDescriptor:nf}=Object;let{freeze:De,seal:ct,create:Si}=Object,{apply:xi,construct:Ti}=typeof Reflect<"u"&&Reflect;De||(De=function(t){return t}),ct||(ct=function(t){return t}),xi||(xi=function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];return t.apply(r,o)}),Ti||(Ti=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return new t(...n)});const co=Me(Array.prototype.forEach),of=Me(Array.prototype.lastIndexOf),hl=Me(Array.prototype.pop),En=Me(Array.prototype.push),af=Me(Array.prototype.splice),uo=Me(String.prototype.toLowerCase),Ei=Me(String.prototype.toString),Ai=Me(String.prototype.match),An=Me(String.prototype.replace),sf=Me(String.prototype.indexOf),lf=Me(String.prototype.trim),St=Me(Object.prototype.hasOwnProperty),Ne=Me(RegExp.prototype.test),Cn=cf(TypeError);function Me(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return xi(e,t,n)}}function cf(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Ti(e,r)}}function M(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:uo;dl&&dl(e,null);let n=t.length;for(;n--;){let o=t[n];if(typeof o=="string"){const i=r(o);i!==o&&(tf(t)||(t[n]=i),o=i)}e[o]=!0}return e}function uf(e){for(let t=0;t<e.length;t++)St(e,t)||(e[t]=null);return e}function $t(e){const t=Si(null);for(const[r,n]of ul(e))St(e,r)&&(Array.isArray(n)?t[r]=uf(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=$t(n):t[r]=n);return t}function Rn(e,t){for(;e!==null;){const n=nf(e,t);if(n){if(n.get)return Me(n.get);if(typeof n.value=="function")return Me(n.value)}e=rf(e)}function r(){return null}return r}const fl=De(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ci=De(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ri=De(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),df=De(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),zi=De(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),hf=De(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pl=De(["#text"]),gl=De(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ii=De(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ml=De(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ho=De(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ff=ct(/\{\{[\w\W]*|[\w\W]*\}\}/gm),pf=ct(/<%[\w\W]*|[\w\W]*%>/gm),gf=ct(/\$\{[\w\W]*/gm),mf=ct(/^data-[\-\w.\u00B7-\uFFFF]+$/),vf=ct(/^aria-[\-\w]+$/),vl=ct(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bf=ct(/^(?:\w+script|data):/i),kf=ct(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bl=ct(/^html$/i),wf=ct(/^[a-z][.\w]*(-[.\w]+)+$/i);var kl=Object.freeze({__proto__:null,ARIA_ATTR:vf,ATTR_WHITESPACE:kf,CUSTOM_ELEMENT:wf,DATA_ATTR:mf,DOCTYPE_NAME:bl,ERB_EXPR:pf,IS_ALLOWED_URI:vl,IS_SCRIPT_OR_DATA:bf,MUSTACHE_EXPR:ff,TMPLIT_EXPR:gf});const zn={element:1,text:3,progressingInstruction:7,comment:8,document:9},yf=function(){return typeof window>"u"?null:window},_f=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(n=r.getAttribute(o));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},wl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function yl(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yf();const t=O=>yl(O);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==zn.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const n=r,o=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:s,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:f,trustedTypes:v}=e,g=l.prototype,b=Rn(g,"cloneNode"),A=Rn(g,"remove"),w=Rn(g,"nextSibling"),_=Rn(g,"childNodes"),S=Rn(g,"parentNode");if(typeof a=="function"){const O=r.createElement("template");O.content&&O.content.ownerDocument&&(r=O.content.ownerDocument)}let T,C="";const{implementation:P,createNodeIterator:D,createDocumentFragment:F,getElementsByTagName:$e}=r,{importNode:fe}=n;let be=wl();t.isSupported=typeof ul=="function"&&typeof S=="function"&&P&&P.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Dr,ERB_EXPR:on,TMPLIT_EXPR:an,DATA_ATTR:No,ARIA_ATTR:ba,IS_SCRIPT_OR_DATA:ka,ATTR_WHITESPACE:Mo,CUSTOM_ELEMENT:wa}=kl;let{IS_ALLOWED_URI:Fo}=kl,ue=null;const jo=M({},[...fl,...Ci,...Ri,...zi,...pl]);let pe=null;const Bo=M({},[...gl,...Ii,...ml,...ho]);let z=Object.seal(Si(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Y=null,Z=null;const Se=Object.seal(Si(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let xe=!0,le=!0,Ze=!1,Te=!0,Ee=!1,Ae=!0,oe=!1,rt=!1,Ue=!1,ht=!1,er=!1,Nt=!1,Zn=!0,Zo=!1;const ya="user-content-";let sn=!0,Nr=!1,nt={},Ce=null;const wr=M({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Uo=null;const qo=M({},["audio","video","img","source","image","track"]);let Un=null;const Mt=M({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ot="http://www.w3.org/1998/Math/MathML",Ft="http://www.w3.org/2000/svg",Ct="http://www.w3.org/1999/xhtml";let jt=Ct,_a=!1,Sa=null;const K1=M({},[ot,Ft,Ct],Ei);let Vo=M({},["mi","mo","mn","ms","mtext"]),Ho=M({},["annotation-xml"]);const X1=M({},["title","style","font","a","script"]);let qn=null;const ek=["application/xhtml+xml","text/html"],tk="text/html";let ke=null,ln=null;const rk=r.createElement("form"),Zu=function(p){return p instanceof RegExp||p instanceof Function},xa=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ln&&ln===p)){if((!p||typeof p!="object")&&(p={}),p=$t(p),qn=ek.indexOf(p.PARSER_MEDIA_TYPE)===-1?tk:p.PARSER_MEDIA_TYPE,ke=qn==="application/xhtml+xml"?Ei:uo,ue=St(p,"ALLOWED_TAGS")?M({},p.ALLOWED_TAGS,ke):jo,pe=St(p,"ALLOWED_ATTR")?M({},p.ALLOWED_ATTR,ke):Bo,Sa=St(p,"ALLOWED_NAMESPACES")?M({},p.ALLOWED_NAMESPACES,Ei):K1,Un=St(p,"ADD_URI_SAFE_ATTR")?M($t(Mt),p.ADD_URI_SAFE_ATTR,ke):Mt,Uo=St(p,"ADD_DATA_URI_TAGS")?M($t(qo),p.ADD_DATA_URI_TAGS,ke):qo,Ce=St(p,"FORBID_CONTENTS")?M({},p.FORBID_CONTENTS,ke):wr,Y=St(p,"FORBID_TAGS")?M({},p.FORBID_TAGS,ke):$t({}),Z=St(p,"FORBID_ATTR")?M({},p.FORBID_ATTR,ke):$t({}),nt=St(p,"USE_PROFILES")?p.USE_PROFILES:!1,xe=p.ALLOW_ARIA_ATTR!==!1,le=p.ALLOW_DATA_ATTR!==!1,Ze=p.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=p.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ee=p.SAFE_FOR_TEMPLATES||!1,Ae=p.SAFE_FOR_XML!==!1,oe=p.WHOLE_DOCUMENT||!1,ht=p.RETURN_DOM||!1,er=p.RETURN_DOM_FRAGMENT||!1,Nt=p.RETURN_TRUSTED_TYPE||!1,Ue=p.FORCE_BODY||!1,Zn=p.SANITIZE_DOM!==!1,Zo=p.SANITIZE_NAMED_PROPS||!1,sn=p.KEEP_CONTENT!==!1,Nr=p.IN_PLACE||!1,Fo=p.ALLOWED_URI_REGEXP||vl,jt=p.NAMESPACE||Ct,Vo=p.MATHML_TEXT_INTEGRATION_POINTS||Vo,Ho=p.HTML_INTEGRATION_POINTS||Ho,z=p.CUSTOM_ELEMENT_HANDLING||{},p.CUSTOM_ELEMENT_HANDLING&&Zu(p.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=p.CUSTOM_ELEMENT_HANDLING.tagNameCheck),p.CUSTOM_ELEMENT_HANDLING&&Zu(p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),p.CUSTOM_ELEMENT_HANDLING&&typeof p.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(z.allowCustomizedBuiltInElements=p.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&(le=!1),er&&(ht=!0),nt&&(ue=M({},pl),pe=[],nt.html===!0&&(M(ue,fl),M(pe,gl)),nt.svg===!0&&(M(ue,Ci),M(pe,Ii),M(pe,ho)),nt.svgFilters===!0&&(M(ue,Ri),M(pe,Ii),M(pe,ho)),nt.mathMl===!0&&(M(ue,zi),M(pe,ml),M(pe,ho))),p.ADD_TAGS&&(typeof p.ADD_TAGS=="function"?Se.tagCheck=p.ADD_TAGS:(ue===jo&&(ue=$t(ue)),M(ue,p.ADD_TAGS,ke))),p.ADD_ATTR&&(typeof p.ADD_ATTR=="function"?Se.attributeCheck=p.ADD_ATTR:(pe===Bo&&(pe=$t(pe)),M(pe,p.ADD_ATTR,ke))),p.ADD_URI_SAFE_ATTR&&M(Un,p.ADD_URI_SAFE_ATTR,ke),p.FORBID_CONTENTS&&(Ce===wr&&(Ce=$t(Ce)),M(Ce,p.FORBID_CONTENTS,ke)),p.ADD_FORBID_CONTENTS&&(Ce===wr&&(Ce=$t(Ce)),M(Ce,p.ADD_FORBID_CONTENTS,ke)),sn&&(ue["#text"]=!0),oe&&M(ue,["html","head","body"]),ue.table&&(M(ue,["tbody"]),delete Y.tbody),p.TRUSTED_TYPES_POLICY){if(typeof p.TRUSTED_TYPES_POLICY.createHTML!="function")throw Cn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof p.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Cn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=p.TRUSTED_TYPES_POLICY,C=T.createHTML("")}else T===void 0&&(T=_f(v,o)),T!==null&&typeof C=="string"&&(C=T.createHTML(""));De&&De(p),ln=p}},Uu=M({},[...Ci,...Ri,...df]),qu=M({},[...zi,...hf]),nk=function(p){let x=S(p);(!x||!x.tagName)&&(x={namespaceURI:jt,tagName:"template"});const R=uo(p.tagName),X=uo(x.tagName);return Sa[p.namespaceURI]?p.namespaceURI===Ft?x.namespaceURI===Ct?R==="svg":x.namespaceURI===ot?R==="svg"&&(X==="annotation-xml"||Vo[X]):!!Uu[R]:p.namespaceURI===ot?x.namespaceURI===Ct?R==="math":x.namespaceURI===Ft?R==="math"&&Ho[X]:!!qu[R]:p.namespaceURI===Ct?x.namespaceURI===Ft&&!Ho[X]||x.namespaceURI===ot&&!Vo[X]?!1:!qu[R]&&(X1[R]||!Uu[R]):!!(qn==="application/xhtml+xml"&&Sa[p.namespaceURI]):!1},Bt=function(p){En(t.removed,{element:p});try{S(p).removeChild(p)}catch{A(p)}},Mr=function(p,x){try{En(t.removed,{attribute:x.getAttributeNode(p),from:x})}catch{En(t.removed,{attribute:null,from:x})}if(x.removeAttribute(p),p==="is")if(ht||er)try{Bt(x)}catch{}else try{x.setAttribute(p,"")}catch{}},Vu=function(p){let x=null,R=null;if(Ue)p="<remove></remove>"+p;else{const ge=Ai(p,/^[\r\n\t ]+/);R=ge&&ge[0]}qn==="application/xhtml+xml"&&jt===Ct&&(p='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+p+"</body></html>");const X=T?T.createHTML(p):p;if(jt===Ct)try{x=new f().parseFromString(X,qn)}catch{}if(!x||!x.documentElement){x=P.createDocument(jt,"template",null);try{x.documentElement.innerHTML=_a?C:X}catch{}}const Pe=x.body||x.documentElement;return p&&R&&Pe.insertBefore(r.createTextNode(R),Pe.childNodes[0]||null),jt===Ct?$e.call(x,oe?"html":"body")[0]:oe?x.documentElement:Pe},Hu=function(p){return D.call(p.ownerDocument||p,p,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ta=function(p){return p instanceof h&&(typeof p.nodeName!="string"||typeof p.textContent!="string"||typeof p.removeChild!="function"||!(p.attributes instanceof u)||typeof p.removeAttribute!="function"||typeof p.setAttribute!="function"||typeof p.namespaceURI!="string"||typeof p.insertBefore!="function"||typeof p.hasChildNodes!="function")},Gu=function(p){return typeof s=="function"&&p instanceof s};function tr(O,p,x){co(O,R=>{R.call(t,p,x,ln)})}const Wu=function(p){let x=null;if(tr(be.beforeSanitizeElements,p,null),Ta(p))return Bt(p),!0;const R=ke(p.nodeName);if(tr(be.uponSanitizeElement,p,{tagName:R,allowedTags:ue}),Ae&&p.hasChildNodes()&&!Gu(p.firstElementChild)&&Ne(/<[/\w!]/g,p.innerHTML)&&Ne(/<[/\w!]/g,p.textContent)||p.nodeType===zn.progressingInstruction||Ae&&p.nodeType===zn.comment&&Ne(/<[/\w]/g,p.data))return Bt(p),!0;if(!(Se.tagCheck instanceof Function&&Se.tagCheck(R))&&(!ue[R]||Y[R])){if(!Y[R]&&Yu(R)&&(z.tagNameCheck instanceof RegExp&&Ne(z.tagNameCheck,R)||z.tagNameCheck instanceof Function&&z.tagNameCheck(R)))return!1;if(sn&&!Ce[R]){const X=S(p)||p.parentNode,Pe=_(p)||p.childNodes;if(Pe&&X){const ge=Pe.length;for(let Qe=ge-1;Qe>=0;--Qe){const rr=b(Pe[Qe],!0);rr.__removalCount=(p.__removalCount||0)+1,X.insertBefore(rr,w(p))}}}return Bt(p),!0}return p instanceof l&&!nk(p)||(R==="noscript"||R==="noembed"||R==="noframes")&&Ne(/<\/no(script|embed|frames)/i,p.innerHTML)?(Bt(p),!0):(Ee&&p.nodeType===zn.text&&(x=p.textContent,co([Dr,on,an],X=>{x=An(x,X," ")}),p.textContent!==x&&(En(t.removed,{element:p.cloneNode()}),p.textContent=x)),tr(be.afterSanitizeElements,p,null),!1)},Qu=function(p,x,R){if(Zn&&(x==="id"||x==="name")&&(R in r||R in rk))return!1;if(!(le&&!Z[x]&&Ne(No,x))){if(!(xe&&Ne(ba,x))){if(!(Se.attributeCheck instanceof Function&&Se.attributeCheck(x,p))){if(!pe[x]||Z[x]){if(!(Yu(p)&&(z.tagNameCheck instanceof RegExp&&Ne(z.tagNameCheck,p)||z.tagNameCheck instanceof Function&&z.tagNameCheck(p))&&(z.attributeNameCheck instanceof RegExp&&Ne(z.attributeNameCheck,x)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(x,p))||x==="is"&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&Ne(z.tagNameCheck,R)||z.tagNameCheck instanceof Function&&z.tagNameCheck(R))))return!1}else if(!Un[x]){if(!Ne(Fo,An(R,Mo,""))){if(!((x==="src"||x==="xlink:href"||x==="href")&&p!=="script"&&sf(R,"data:")===0&&Uo[p])){if(!(Ze&&!Ne(ka,An(R,Mo,"")))){if(R)return!1}}}}}}}return!0},Yu=function(p){return p!=="annotation-xml"&&Ai(p,wa)},Ju=function(p){tr(be.beforeSanitizeAttributes,p,null);const{attributes:x}=p;if(!x||Ta(p))return;const R={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:pe,forceKeepAttr:void 0};let X=x.length;for(;X--;){const Pe=x[X],{name:ge,namespaceURI:Qe,value:rr}=Pe,cn=ke(ge),Ea=rr;let Oe=ge==="value"?Ea:lf(Ea);if(R.attrName=cn,R.attrValue=Oe,R.keepAttr=!0,R.forceKeepAttr=void 0,tr(be.uponSanitizeAttribute,p,R),Oe=R.attrValue,Zo&&(cn==="id"||cn==="name")&&(Mr(ge,p),Oe=ya+Oe),Ae&&Ne(/((--!?|])>)|<\/(style|title|textarea)/i,Oe)){Mr(ge,p);continue}if(cn==="attributename"&&Ai(Oe,"href")){Mr(ge,p);continue}if(R.forceKeepAttr)continue;if(!R.keepAttr){Mr(ge,p);continue}if(!Te&&Ne(/\/>/i,Oe)){Mr(ge,p);continue}Ee&&co([Dr,on,an],Xu=>{Oe=An(Oe,Xu," ")});const Ku=ke(p.nodeName);if(!Qu(Ku,cn,Oe)){Mr(ge,p);continue}if(T&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!Qe)switch(v.getAttributeType(Ku,cn)){case"TrustedHTML":{Oe=T.createHTML(Oe);break}case"TrustedScriptURL":{Oe=T.createScriptURL(Oe);break}}if(Oe!==Ea)try{Qe?p.setAttributeNS(Qe,ge,Oe):p.setAttribute(ge,Oe),Ta(p)?Bt(p):hl(t.removed)}catch{Mr(ge,p)}}tr(be.afterSanitizeAttributes,p,null)},ok=function O(p){let x=null;const R=Hu(p);for(tr(be.beforeSanitizeShadowDOM,p,null);x=R.nextNode();)tr(be.uponSanitizeShadowNode,x,null),Wu(x),Ju(x),x.content instanceof i&&O(x.content);tr(be.afterSanitizeShadowDOM,p,null)};return t.sanitize=function(O){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=null,R=null,X=null,Pe=null;if(_a=!O,_a&&(O="<!-->"),typeof O!="string"&&!Gu(O))if(typeof O.toString=="function"){if(O=O.toString(),typeof O!="string")throw Cn("dirty is not a string, aborting")}else throw Cn("toString is not a function");if(!t.isSupported)return O;if(rt||xa(p),t.removed=[],typeof O=="string"&&(Nr=!1),Nr){if(O.nodeName){const rr=ke(O.nodeName);if(!ue[rr]||Y[rr])throw Cn("root node is forbidden and cannot be sanitized in-place")}}else if(O instanceof s)x=Vu("<!---->"),R=x.ownerDocument.importNode(O,!0),R.nodeType===zn.element&&R.nodeName==="BODY"||R.nodeName==="HTML"?x=R:x.appendChild(R);else{if(!ht&&!Ee&&!oe&&O.indexOf("<")===-1)return T&&Nt?T.createHTML(O):O;if(x=Vu(O),!x)return ht?null:Nt?C:""}x&&Ue&&Bt(x.firstChild);const ge=Hu(Nr?O:x);for(;X=ge.nextNode();)Wu(X),Ju(X),X.content instanceof i&&ok(X.content);if(Nr)return O;if(ht){if(er)for(Pe=F.call(x.ownerDocument);x.firstChild;)Pe.appendChild(x.firstChild);else Pe=x;return(pe.shadowroot||pe.shadowrootmode)&&(Pe=fe.call(n,Pe,!0)),Pe}let Qe=oe?x.outerHTML:x.innerHTML;return oe&&ue["!doctype"]&&x.ownerDocument&&x.ownerDocument.doctype&&x.ownerDocument.doctype.name&&Ne(bl,x.ownerDocument.doctype.name)&&(Qe="<!DOCTYPE "+x.ownerDocument.doctype.name+`>
|
|
18
|
+
`+Qe),Ee&&co([Dr,on,an],rr=>{Qe=An(Qe,rr," ")}),T&&Nt?T.createHTML(Qe):Qe},t.setConfig=function(){let O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xa(O),rt=!0},t.clearConfig=function(){ln=null,rt=!1},t.isValidAttribute=function(O,p,x){ln||xa({});const R=ke(O),X=ke(p);return Qu(R,X,x)},t.addHook=function(O,p){typeof p=="function"&&En(be[O],p)},t.removeHook=function(O,p){if(p!==void 0){const x=of(be[O],p);return x===-1?void 0:af(be[O],x,1)[0]}return hl(be[O])},t.removeHooks=function(O){be[O]=[]},t.removeAllHooks=function(){be=wl()},t}var Sf=yl();function Oi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Or=Oi();function _l(e){Or=e}var In={exec:()=>null};function U(e,t=""){let r=typeof e=="string"?e:e.source;const n={replace:(o,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Fe.caret,"$1"),r=r.replace(o,a),n},getRegex:()=>new RegExp(r,t)};return n}var Fe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},xf=/^(?:[ \t]*(?:\n|$))+/,Tf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ef=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,On=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Af=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,$i=/(?:[*+-]|\d{1,9}[.)])/,Sl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,xl=U(Sl).replace(/bull/g,$i).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Cf=U(Sl).replace(/bull/g,$i).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Pi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Rf=/^[^\n]+/,Li=/(?!\s*\])(?:\\.|[^\[\]\\])+/,zf=U(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Li).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),If=U(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,$i).getRegex(),fo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Di=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Of=U("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Di).replace("tag",fo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Tl=U(Pi).replace("hr",On).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fo).getRegex(),$f=U(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Tl).getRegex(),Ni={blockquote:$f,code:Tf,def:zf,fences:Ef,heading:Af,hr:On,html:Of,lheading:xl,list:If,newline:xf,paragraph:Tl,table:In,text:Rf},El=U("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",On).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fo).getRegex(),Pf={...Ni,lheading:Cf,table:El,paragraph:U(Pi).replace("hr",On).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",El).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fo).getRegex()},Lf={...Ni,html:U(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Di).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:In,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:U(Pi).replace("hr",On).replace("heading",` *#{1,6} *[^
|
|
19
|
+
]`).replace("lheading",xl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Df=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Nf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Al=/^( {2,}|\\)\n(?!\s*$)/,Mf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,po=/[\p{P}\p{S}]/u,Mi=/[\s\p{P}\p{S}]/u,Cl=/[^\s\p{P}\p{S}]/u,Ff=U(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Mi).getRegex(),Rl=/(?!~)[\p{P}\p{S}]/u,jf=/(?!~)[\s\p{P}\p{S}]/u,Bf=/(?:[^\s\p{P}\p{S}]|~)/u,Zf=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,zl=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Uf=U(zl,"u").replace(/punct/g,po).getRegex(),qf=U(zl,"u").replace(/punct/g,Rl).getRegex(),Il="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Vf=U(Il,"gu").replace(/notPunctSpace/g,Cl).replace(/punctSpace/g,Mi).replace(/punct/g,po).getRegex(),Hf=U(Il,"gu").replace(/notPunctSpace/g,Bf).replace(/punctSpace/g,jf).replace(/punct/g,Rl).getRegex(),Gf=U("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Cl).replace(/punctSpace/g,Mi).replace(/punct/g,po).getRegex(),Wf=U(/\\(punct)/,"gu").replace(/punct/g,po).getRegex(),Qf=U(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Yf=U(Di).replace("(?:-->|$)","-->").getRegex(),Jf=U("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Yf).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),go=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Kf=U(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",go).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ol=U(/^!?\[(label)\]\[(ref)\]/).replace("label",go).replace("ref",Li).getRegex(),$l=U(/^!?\[(ref)\](?:\[\])?/).replace("ref",Li).getRegex(),Xf=U("reflink|nolink(?!\\()","g").replace("reflink",Ol).replace("nolink",$l).getRegex(),Fi={_backpedal:In,anyPunctuation:Wf,autolink:Qf,blockSkip:Zf,br:Al,code:Nf,del:In,emStrongLDelim:Uf,emStrongRDelimAst:Vf,emStrongRDelimUnd:Gf,escape:Df,link:Kf,nolink:$l,punctuation:Ff,reflink:Ol,reflinkSearch:Xf,tag:Jf,text:Mf,url:In},ep={...Fi,link:U(/^!?\[(label)\]\((.*?)\)/).replace("label",go).getRegex(),reflink:U(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",go).getRegex()},ji={...Fi,emStrongRDelimAst:Hf,emStrongLDelim:qf,url:U(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},tp={...ji,br:U(Al).replace("{2,}","*").getRegex(),text:U(ji.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},mo={normal:Ni,gfm:Pf,pedantic:Lf},$n={normal:Fi,gfm:ji,breaks:tp,pedantic:ep},rp={"&":"&","<":"<",">":">",'"':""","'":"'"},Pl=e=>rp[e];function Pt(e,t){if(t){if(Fe.escapeTest.test(e))return e.replace(Fe.escapeReplace,Pl)}else if(Fe.escapeTestNoEncode.test(e))return e.replace(Fe.escapeReplaceNoEncode,Pl);return e}function Ll(e){try{e=encodeURI(e).replace(Fe.percentDecode,"%")}catch{return null}return e}function Dl(e,t){const r=e.replace(Fe.findPipe,(i,a,s)=>{let l=!1,c=a;for(;--c>=0&&s[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(Fe.splitPipe);let o=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(Fe.slashPipe,"|");return n}function Pn(e,t,r){const n=e.length;if(n===0)return"";let o=0;for(;o<n&&e.charAt(n-o-1)===t;)o++;return e.slice(0,n-o)}function np(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function Nl(e,t,r,n,o){const i=t.href,a=t.title||null,s=e[1].replace(o.other.outputLinkReplace,"$1");n.state.inLink=!0;const l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:a,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,l}function op(e,t,r){const n=e.match(r.other.indentCodeCompensation);if(n===null)return t;const o=n[1];return t.split(`
|
|
20
|
+
`).map(i=>{const a=i.match(r.other.beginningSpace);if(a===null)return i;const[s]=a;return s.length>=o.length?i.slice(o.length):i}).join(`
|
|
21
|
+
`)}var vo=class{options;rules;lexer;constructor(e){this.options=e||Or}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Pn(r,`
|
|
22
|
+
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],n=op(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){const n=Pn(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Pn(t[0],`
|
|
23
|
+
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let r=Pn(t[0],`
|
|
23
24
|
`).split(`
|
|
24
|
-
`),n="",
|
|
25
|
-
`),
|
|
25
|
+
`),n="",o="";const i=[];for(;r.length>0;){let a=!1;const s=[];let l;for(l=0;l<r.length;l++)if(this.rules.other.blockquoteStart.test(r[l]))s.push(r[l]),a=!0;else if(!a)s.push(r[l]);else break;r=r.slice(l);const c=s.join(`
|
|
26
|
+
`),u=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
26
27
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
27
|
-
${
|
|
28
|
-
${
|
|
28
|
+
${c}`:c,o=o?`${o}
|
|
29
|
+
${u}`:u;const h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=h,r.length===0)break;const f=i.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){const v=f,g=v.raw+`
|
|
29
30
|
`+r.join(`
|
|
30
|
-
`),b=this.blockquote(
|
|
31
|
+
`),b=this.blockquote(g);i[i.length-1]=b,n=n.substring(0,n.length-v.raw.length)+b.raw,o=o.substring(0,o.length-v.text.length)+b.text;break}else if(f?.type==="list"){const v=f,g=v.raw+`
|
|
31
32
|
`+r.join(`
|
|
32
|
-
`),b=this.list(
|
|
33
|
-
`);continue}}return{type:"blockquote",raw:n,tokens:i,text:
|
|
34
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,
|
|
35
|
-
`,1)[0],v=!
|
|
36
|
-
`,
|
|
37
|
-
`,1)[0];let
|
|
38
|
-
`+
|
|
39
|
-
`+
|
|
40
|
-
`,
|
|
41
|
-
`):[],i={type:"table",raw:
|
|
42
|
-
`?
|
|
43
|
-
`),this.blockTokens(
|
|
44
|
-
`:r.push(
|
|
45
|
-
`+
|
|
46
|
-
`+
|
|
47
|
-
`+
|
|
48
|
-
`+
|
|
49
|
-
`+
|
|
50
|
-
`+
|
|
51
|
-
`+
|
|
52
|
-
`+
|
|
53
|
-
`;return n?'<pre><code class="language-'+
|
|
54
|
-
`:"<pre><code>"+(r?
|
|
55
|
-
`}blockquote({tokens:
|
|
56
|
-
${this.parser.parse(
|
|
57
|
-
`}html({text:
|
|
58
|
-
`}hr(
|
|
59
|
-
`}list(
|
|
60
|
-
`+n+"</"+
|
|
61
|
-
`}listitem(
|
|
62
|
-
`}checkbox({checked:
|
|
63
|
-
`}table(
|
|
33
|
+
`),b=this.list(g);i[i.length-1]=b,n=n.substring(0,n.length-f.raw.length)+b.raw,o=o.substring(0,o.length-v.raw.length)+b.raw,r=g.substring(i.at(-1).raw.length).split(`
|
|
34
|
+
`);continue}}return{type:"blockquote",raw:n,tokens:i,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const n=r.length>1,o={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const i=this.rules.other.listItemRegex(r);let a=!1;for(;e;){let l=!1,c="",u="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let h=t[2].split(`
|
|
35
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,w=>" ".repeat(3*w.length)),f=e.split(`
|
|
36
|
+
`,1)[0],v=!h.trim(),g=0;if(this.options.pedantic?(g=2,u=h.trimStart()):v?g=t[1].length+1:(g=t[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,u=h.slice(g),g+=t[1].length),v&&this.rules.other.blankLine.test(f)&&(c+=f+`
|
|
37
|
+
`,e=e.substring(f.length+1),l=!0),!l){const w=this.rules.other.nextBulletRegex(g),_=this.rules.other.hrRegex(g),S=this.rules.other.fencesBeginRegex(g),T=this.rules.other.headingBeginRegex(g),C=this.rules.other.htmlBeginRegex(g);for(;e;){const P=e.split(`
|
|
38
|
+
`,1)[0];let D;if(f=P,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),D=f):D=f.replace(this.rules.other.tabCharGlobal," "),S.test(f)||T.test(f)||C.test(f)||w.test(f)||_.test(f))break;if(D.search(this.rules.other.nonSpaceChar)>=g||!f.trim())u+=`
|
|
39
|
+
`+D.slice(g);else{if(v||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(h)||T.test(h)||_.test(h))break;u+=`
|
|
40
|
+
`+f}!v&&!f.trim()&&(v=!0),c+=P+`
|
|
41
|
+
`,e=e.substring(P.length+1),h=D.slice(g)}}o.loose||(a?o.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0));let b=null,A;this.options.gfm&&(b=this.rules.other.listIsTask.exec(u),b&&(A=b[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:c,task:!!b,checked:A,loose:!1,text:u,tokens:[]}),o.raw+=c}const s=o.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let l=0;l<o.items.length;l++)if(this.lexer.state.top=!1,o.items[l].tokens=this.lexer.blockTokens(o.items[l].text,[]),!o.loose){const c=o.items[l].tokens.filter(h=>h.type==="space"),u=c.length>0&&c.some(h=>this.rules.other.anyLine.test(h.raw));o.loose=u}if(o.loose)for(let l=0;l<o.items.length;l++)o.items[l].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:o}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const r=Dl(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
42
|
+
`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(const a of n)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<r.length;a++)i.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:i.align[a]});for(const a of o)i.rows.push(Dl(a,i.header.length).map((s,l)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:i.align[l]})));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const r=t[1].charAt(t[1].length-1)===`
|
|
43
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const i=Pn(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{const i=np(t[2],"()");if(i===-2)return;if(i>-1){const s=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,s).trim(),t[3]=""}}let n=t[2],o="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],o=i[3])}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),Nl(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){const n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[n.toLowerCase()];if(!o){const i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return Nl(r,o,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(n[1]||n[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const i=[...n[0]].length-1;let a,s,l=i,c=0;const u=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+i);(n=u.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(s=[...a].length,n[3]||n[4]){l+=s;continue}else if((n[5]||n[6])&&i%3&&!((i+s)%3)){c+=s;continue}if(l-=s,l>0)continue;s=Math.min(s,s+l+c);const h=[...n[0]][0].length,f=e.slice(0,i+n.index+h+s);if(Math.min(i,s)%2){const g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}const v=f.slice(2,-2);return{type:"strong",raw:f,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=t[1],n="mailto:"+r):(r=t[1],n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,n;if(t[2]==="@")r=t[0],n="mailto:"+r;else{let o;do o=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(o!==t[0]);r=t[0],t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},Jt=class Aa{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Or,this.options.tokenizer=this.options.tokenizer||new vo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={other:Fe,block:mo.normal,inline:$n.normal};this.options.pedantic?(r.block=mo.pedantic,r.inline=$n.pedantic):this.options.gfm&&(r.block=mo.gfm,this.options.breaks?r.inline=$n.breaks:r.inline=$n.gfm),this.tokenizer.rules=r}static get rules(){return{block:mo,inline:$n}}static lex(t,r){return new Aa(r).lex(t)}static lexInline(t,r){return new Aa(r).inlineTokens(t)}lex(t){t=t.replace(Fe.carriageReturn,`
|
|
44
|
+
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],n=!1){for(this.options.pedantic&&(t=t.replace(Fe.tabCharGlobal," ").replace(Fe.spaceLine,""));t;){let o;if(this.options.extensions?.block?.some(a=>(o=a.call({lexer:this},t,r))?(t=t.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);const a=r.at(-1);o.raw.length===1&&a!==void 0?a.raw+=`
|
|
45
|
+
`:r.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);const a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
|
|
46
|
+
`+o.raw,a.text+=`
|
|
47
|
+
`+o.text,this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);const a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
|
|
48
|
+
`+o.raw,a.text+=`
|
|
49
|
+
`+o.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),r.push(o);continue}let i=t;if(this.options.extensions?.startBlock){let a=1/0;const s=t.slice(1);let l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},s),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(i=t.substring(0,a+1))}if(this.state.top&&(o=this.tokenizer.paragraph(i))){const a=r.at(-1);n&&a?.type==="paragraph"?(a.raw+=`
|
|
50
|
+
`+o.raw,a.text+=`
|
|
51
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o),n=i.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);const a=r.at(-1);a?.type==="text"?(a.raw+=`
|
|
52
|
+
`+o.raw,a.text+=`
|
|
53
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n=t,o=null;if(this.tokens.links){const s=Object.keys(this.tokens.links);if(s.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)s.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,o.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(o=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;t;){i||(a=""),i=!1;let s;if(this.options.extensions?.inline?.some(c=>(s=c.call({lexer:this},t,r))?(t=t.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.escape(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.tag(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.link(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(s.raw.length);const c=r.at(-1);s.type==="text"&&c?.type==="text"?(c.raw+=s.raw,c.text+=s.text):r.push(s);continue}if(s=this.tokenizer.emStrong(t,n,a)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.codespan(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.br(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.del(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.autolink(t)){t=t.substring(s.raw.length),r.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(t))){t=t.substring(s.raw.length),r.push(s);continue}let l=t;if(this.options.extensions?.startInline){let c=1/0;const u=t.slice(1);let h;this.options.extensions.startInline.forEach(f=>{h=f.call({lexer:this},u),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(l=t.substring(0,c+1))}if(s=this.tokenizer.inlineText(l)){t=t.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(a=s.raw.slice(-1)),i=!0;const c=r.at(-1);c?.type==="text"?(c.raw+=s.raw,c.text+=s.text):r.push(s);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return r}},bo=class{options;parser;constructor(e){this.options=e||Or}space(e){return""}code({text:e,lang:t,escaped:r}){const n=(t||"").match(Fe.notSpaceStart)?.[0],o=e.replace(Fe.endingNewline,"")+`
|
|
54
|
+
`;return n?'<pre><code class="language-'+Pt(n)+'">'+(r?o:Pt(o,!0))+`</code></pre>
|
|
55
|
+
`:"<pre><code>"+(r?o:Pt(o,!0))+`</code></pre>
|
|
56
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
57
|
+
${this.parser.parse(e)}</blockquote>
|
|
58
|
+
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
59
|
+
`}hr(e){return`<hr>
|
|
60
|
+
`}list(e){const t=e.ordered,r=e.start;let n="";for(let a=0;a<e.items.length;a++){const s=e.items[a];n+=this.listitem(s)}const o=t?"ol":"ul",i=t&&r!==1?' start="'+r+'"':"";return"<"+o+i+`>
|
|
61
|
+
`+n+"</"+o+`>
|
|
62
|
+
`}listitem(e){let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+Pt(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
63
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
64
|
+
`}table(e){let t="",r="";for(let o=0;o<e.header.length;o++)r+=this.tablecell(e.header[o]);t+=this.tablerow({text:r});let n="";for(let o=0;o<e.rows.length;o++){const i=e.rows[o];r="";for(let a=0;a<i.length;a++)r+=this.tablecell(i[a]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
64
65
|
<thead>
|
|
65
|
-
`+
|
|
66
|
+
`+t+`</thead>
|
|
66
67
|
`+n+`</table>
|
|
67
|
-
`}tablerow({text:
|
|
68
|
-
${
|
|
69
|
-
`}tablecell(
|
|
70
|
-
`}strong({tokens:
|
|
71
|
-
`+this.renderer.text(s);r?n+=this.renderer.paragraph({type:"paragraph",raw:
|
|
72
|
-
Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An error occurred:</p><pre>"+Rt(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Ir=new kl;function X(t,e){return Ir.parse(t,e)}X.options=X.setOptions=function(t){return Ir.setOptions(t),X.defaults=Ir.defaults,nl(X.defaults),X},X.getDefaults=wi,X.defaults=Rr,X.use=function(...t){return Ir.use(...t),X.defaults=Ir.defaults,nl(X.defaults),X},X.walkTokens=function(t,e){return Ir.walkTokens(t,e)},X.parseInline=Ir.parseInline,X.Parser=Wt,X.parser=Wt.parse,X.Renderer=ua,X.TextRenderer=Ii,X.Lexer=Gt,X.lexer=Gt.lex,X.Tokenizer=ca,X.Hooks=da,X.parse=X,X.options,X.setOptions,X.use,X.walkTokens,X.parseInline,Wt.parse,Gt.lex;const yl=t=>(Object.getOwnPropertyNames(t).forEach(e=>{const r=t[e];r&&typeof r=="object"&&yl(r)}),Object.freeze(t)),wl=yl({all:[],used:[],unused:[]}),Zh=(t,e)=>{const r=uh(t);return r.addHook("uponSanitizeElement",function(n,a){const i=a.tagName||n.nodeName.toLowerCase();i.startsWith("liipgpt-")&&(a.allowedTags[i]=!0)}),r.addHook("afterSanitizeAttributes",function(n){if(n.tagName!=="A"||!n.getAttribute("href")?.startsWith("http")||(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"),!e||n.querySelector(".sr-only")))return;const a=n.ownerDocument.createElement("span");a.className="sr-only",a.textContent=` ${e}`,n.appendChild(a)}),r};class _l{marked;currentReferences=wl;lastUsedIndex=0;DomPurity;constructor(e={}){this.marked=new kl({async:!1,breaks:!0}).use(this.createFootnoteExtension(),...e.extensions??[]),this.DomPurity=Zh(e.window,e.newTabSrText)}createFootnoteExtension=()=>{const e=this;return{extensions:[{name:"footnote",level:"inline",start(r){return r.match(/\[\^(\d+)\]/)?.index},tokenizer(r){const a=/^\[\^(\d+)\]/.exec(r);if(a){const[i,o]=a;return{type:"footnote",raw:i,refNumber:o}}},renderer(r){if(r.type==="footnote"){const n=parseInt(r.refNumber)-1,a=e.currentReferences.all[n];if(!a)return console.error("Could not find ref with index:",n),"";let i;return a?.referenceIndex.used?i=a.referenceIndex.used:(e.currentReferences.used.push(a),e.lastUsedIndex++,i=e.lastUsedIndex,a.referenceIndex.used=i),` <liipgpt-reference-number data-all-index="${n}" data-used-index="${i}" data-source="${JSON.stringify(a).replace(/"/g,""")}"></liipgpt-reference-number>`}}}]}};parse(e){return this.DomPurity.sanitize(this.marked.parse(e),{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0,mathMl:!0},FORBID_TAGS:["hr"],ADD_ATTR:["target"]})}toHTML(e,r){this.currentReferences=r;const n=this.parse(e);return this.currentReferences=wl,n}}function Gh(){let t,e;return{promise:new Promise((n,a)=>{e=n,t=a}),reject:t,resolve:e}}class xl{promise;resolve;reject;constructor(){const{promise:e,resolve:r,reject:n}=Gh();this.promise=e,this.resolve=r,this.reject=n}then(e,r){return this.promise.then(e,r)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}toPromise(){return this.promise}[Symbol.toStringTag]="Flag"}class Li{hasValue=new xl;currentValue;setValue(e){this.currentValue=e,this.hasValue.resolve()}cleanup(e){this.hasValue.reject(e)}getCurrentValue(){return this.currentValue}async toPromise(){return await this.hasValue,this.currentValue}then(e,r){return this.toPromise().then(e,r)}catch(e){return this.toPromise().catch(e)}finally(e){return this.toPromise().finally(e)}[Symbol.toStringTag]="FutureValue"}const Wh=t=>{try{return new URL(t).hostname}catch{return t}};function Qh(t){return t.replace(/<[^>]*>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}const Yh=({url:t,considered:e,title:r,description:n,summary:a})=>{const i=Wh(t);return{url:t,considered:e,referenceIndex:{},score:0,metadata:{},display:{card:{title:r,description:n||a,badge:t},listItem:{title:r,badge:i}}}};class Kh{constructor(e){this.options=e,this.store=Ld({id:e.id,state:"loading",errors:[],type:"bot",time:new Date().toISOString(),message:{markdown:"",html:"",text:""},references:{all:[],used:[],unused:[]},retrievalQuestion:e.userQuestion})}store;content=new Li;backendSendsMappedRefs=!1;pushError(e){this.options.onError?.(e),this.store.update(r=>({...r,errors:[...r.errors,e]}))}updateRequestId(e){this.store.update(r=>({...r,id:e}))}updateText(e){this.store.update(r=>{const n=r.message.markdown+e,a=this.options.markdownRenderer.toHTML(n,r.references);return{...r,state:"streaming",message:{markdown:n,html:a,text:""}}})}finishMessage(){this.store.update(e=>{const r={...e,state:"done"};return r.references.unused=r.references.all.filter(n=>n.referenceIndex.used===void 0),r.message.text=Qh(r.message.html),this.options?.onFinish?.(r),this.content.setValue(r),r})}addReference(e){this.store.update(r=>{const n=r.references.all,a=n.length,i=[...n,{...e,referenceIndex:{all:a}}];return{...r,references:{used:r.references.used,all:i}}})}addMappedReference(e){this.backendSendsMappedRefs=!0,this.addReference(e)}addOldReference(e){this.backendSendsMappedRefs||this.addReference(Yh(e))}updateRetrievalQuestion(e){this.store.update(r=>({...r,retrievalQuestion:e}))}getReadableStore(){return{subscribe:this.store.subscribe}}getPromise(){return this.content.toPromise()}}var W;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function r(a){throw new Error}t.assertNever=r,t.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},t.getValidEnumValues=a=>{const i=t.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(const s of i)o[s]=a[s];return t.objectValues(o)},t.objectValues=a=>t.objectKeys(a).map(function(i){return a[i]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},t.find=(a,i)=>{for(const o of a)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(W||(W={}));var Sl;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Sl||(Sl={}));const C=W.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),dr=t=>{switch(typeof t){case"undefined":return C.undefined;case"string":return C.string;case"number":return Number.isNaN(t)?C.nan:C.number;case"boolean":return C.boolean;case"function":return C.function;case"bigint":return C.bigint;case"symbol":return C.symbol;case"object":return Array.isArray(t)?C.array:t===null?C.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?C.promise:typeof Map<"u"&&t instanceof Map?C.map:typeof Set<"u"&&t instanceof Set?C.set:typeof Date<"u"&&t instanceof Date?C.date:C.object;default:return C.unknown}},x=W.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Qt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(i){return i.message},n={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,c=0;for(;c<o.path.length;){const l=o.path[c];c===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(r(o))):s[l]=s[l]||{_errors:[]},s=s[l],c++}}};return a(this),n}static assert(e){if(!(e instanceof Qt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,W.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];r[i]=r[i]||[],r[i].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Qt.create=t=>new Qt(t);const Oi=(t,e)=>{let r;switch(t.code){case x.invalid_type:t.received===C.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case x.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,W.jsonStringifyReplacer)}`;break;case x.unrecognized_keys:r=`Unrecognized key(s) in object: ${W.joinValues(t.keys,", ")}`;break;case x.invalid_union:r="Invalid input";break;case x.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${W.joinValues(t.options)}`;break;case x.invalid_enum_value:r=`Invalid enum value. Expected ${W.joinValues(t.options)}, received '${t.received}'`;break;case x.invalid_arguments:r="Invalid function arguments";break;case x.invalid_return_type:r="Invalid function return type";break;case x.invalid_date:r="Invalid date";break;case x.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:W.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case x.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case x.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case x.custom:r="Invalid input";break;case x.invalid_intersection_types:r="Intersection results could not be merged";break;case x.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case x.not_finite:r="Number must be finite";break;default:r=e.defaultError,W.assertNever(t)}return{message:r}};let Xh=Oi;function Jh(){return Xh}const ef=t=>{const{data:e,path:r,errorMaps:n,issueData:a}=t,i=[...r,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="";const c=n.filter(l=>!!l).slice().reverse();for(const l of c)s=l(o,{data:e,defaultError:s}).message;return{...a,path:i,message:s}};function E(t,e){const r=Jh(),n=ef({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Oi?void 0:Oi].filter(a=>!!a)});t.common.issues.push(n)}class ze{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const a of r){if(a.status==="aborted")return P;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const a of r){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return ze.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const a of r){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return P;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}}const P=Object.freeze({status:"aborted"}),An=t=>({status:"dirty",value:t}),ut=t=>({status:"valid",value:t}),Tl=t=>t.status==="aborted",El=t=>t.status==="dirty",Yr=t=>t.status==="valid",ha=t=>typeof Promise<"u"&&t instanceof Promise;var L;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(L||(L={}));class It{constructor(e,r,n,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Cl=(t,e)=>{if(Yr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Qt(t.common.issues);return this._error=r,this._error}}};function F(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:a}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,s)=>{const{message:c}=t;return o.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:a}}class Z{get description(){return this._def.description}_getType(e){return dr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:dr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ze,ctx:{common:e.parent.common,data:e.data,parsedType:dr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(ha(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:dr(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Cl(n,a)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:dr(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:r});return Yr(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>Yr(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:dr(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(ha(a)?a:Promise.resolve(a));return Cl(n,i)}refine(e,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,i)=>{const o=e(a),s=()=>i.addIssue({code:x.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,r){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(e){return new Mr({schema:this,typeName:D.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Xt.create(this,this._def)}nullable(){return Nr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Lt.create(this)}promise(){return ba.create(this,this._def)}or(e){return pa.create([this,e],this._def)}and(e){return ga.create(this,e,this._def)}transform(e){return new Mr({...F(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new ka({...F(this._def),innerType:this,defaultValue:r,typeName:D.ZodDefault})}brand(){return new $l({typeName:D.ZodBranded,type:this,...F(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new ya({...F(this._def),innerType:this,catchValue:r,typeName:D.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ji.create(this,e)}readonly(){return wa.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const tf=/^c[^\s-]{8,}$/i,rf=/^[0-9a-z]+$/,nf=/^[0-9A-HJKMNP-TV-Z]{26}$/i,af=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,of=/^[a-z0-9_-]{21}$/i,sf=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,lf=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cf=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,uf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Mi;const df=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,hf=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ff=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,pf=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gf=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,mf=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Al="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",vf=new RegExp(`^${Al}$`);function Rl(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function bf(t){return new RegExp(`^${Rl(t)}$`)}function kf(t){let e=`${Al}T${Rl(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function yf(t,e){return!!((e==="v4"||!e)&&df.test(t)||(e==="v6"||!e)&&ff.test(t))}function wf(t,e){if(!sf.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function _f(t,e){return!!((e==="v4"||!e)&&hf.test(t)||(e==="v6"||!e)&&pf.test(t))}class Yt extends Z{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==C.string){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_type,expected:C.string,received:i.parsedType}),P}const n=new ze;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:x.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:x.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,s=e.data.length<i.value;(o||s)&&(a=this._getOrReturnCtx(e,a),o?E(a,{code:x.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&E(a,{code:x.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")cf.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"email",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Mi||(Mi=new RegExp(uf,"u")),Mi.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"emoji",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")af.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"uuid",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")of.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"nanoid",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")tf.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"cuid",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")rf.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"cuid2",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")nf.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"ulid",code:x.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),E(a,{validation:"url",code:x.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"regex",code:x.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?kf(i).test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?vf.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?bf(i).test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{code:x.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?lf.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"duration",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?yf(e.data,i.version)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"ip",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?wf(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"jwt",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?_f(e.data,i.version)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"cidr",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?gf.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"base64",code:x.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?mf.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"base64url",code:x.invalid_string,message:i.message}),n.dirty()):W.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),{validation:r,code:x.invalid_string,...L.errToObj(n)})}_addCheck(e){return new Yt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...L.errToObj(e)})}url(e){return this._addCheck({kind:"url",...L.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...L.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...L.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...L.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...L.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...L.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...L.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...L.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...L.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...L.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...L.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...L.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...L.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...L.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...L.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...L.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...L.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...L.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...L.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...L.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...L.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...L.errToObj(r)})}nonempty(e){return this.min(1,L.errToObj(e))}trim(){return new Yt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Yt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Yt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Yt.create=t=>new Yt({checks:[],typeName:D.ZodString,coerce:t?.coerce??!1,...F(t)});function xf(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,i=Number.parseInt(t.toFixed(a).replace(".","")),o=Number.parseInt(e.toFixed(a).replace(".",""));return i%o/10**a}class Kr extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==C.number){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_type,expected:C.number,received:i.parsedType}),P}let n;const a=new ze;for(const i of this._def.checks)i.kind==="int"?W.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),E(n,{code:x.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?xf(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),E(n,{code:x.not_finite,message:i.message}),a.dirty()):W.assertNever(i);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,L.toString(r))}gt(e,r){return this.setLimit("min",e,!1,L.toString(r))}lte(e,r){return this.setLimit("max",e,!0,L.toString(r))}lt(e,r){return this.setLimit("max",e,!1,L.toString(r))}setLimit(e,r,n,a){return new Kr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:L.toString(a)}]})}_addCheck(e){return new Kr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:L.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:L.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:L.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:L.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:L.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:L.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&W.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}Kr.create=t=>new Kr({checks:[],typeName:D.ZodNumber,coerce:t?.coerce||!1,...F(t)});class Rn extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==C.bigint)return this._getInvalidInput(e);let n;const a=new ze;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),E(n,{code:x.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):W.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return E(r,{code:x.invalid_type,expected:C.bigint,received:r.parsedType}),P}gte(e,r){return this.setLimit("min",e,!0,L.toString(r))}gt(e,r){return this.setLimit("min",e,!1,L.toString(r))}lte(e,r){return this.setLimit("max",e,!0,L.toString(r))}lt(e,r){return this.setLimit("max",e,!1,L.toString(r))}setLimit(e,r,n,a){return new Rn({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:L.toString(a)}]})}_addCheck(e){return new Rn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:L.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:L.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Rn.create=t=>new Rn({checks:[],typeName:D.ZodBigInt,coerce:t?.coerce??!1,...F(t)});class Ni extends Z{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==C.boolean){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:C.boolean,received:n.parsedType}),P}return ut(e.data)}}Ni.create=t=>new Ni({typeName:D.ZodBoolean,coerce:t?.coerce||!1,...F(t)});class fa extends Z{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==C.date){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_type,expected:C.date,received:i.parsedType}),P}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return E(i,{code:x.invalid_date}),P}const n=new ze;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:x.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:x.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):W.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new fa({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:L.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:L.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}fa.create=t=>new fa({checks:[],coerce:t?.coerce||!1,typeName:D.ZodDate,...F(t)});class Il extends Z{_parse(e){if(this._getType(e)!==C.symbol){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:C.symbol,received:n.parsedType}),P}return ut(e.data)}}Il.create=t=>new Il({typeName:D.ZodSymbol,...F(t)});class Pi extends Z{_parse(e){if(this._getType(e)!==C.undefined){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:C.undefined,received:n.parsedType}),P}return ut(e.data)}}Pi.create=t=>new Pi({typeName:D.ZodUndefined,...F(t)});class Di extends Z{_parse(e){if(this._getType(e)!==C.null){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:C.null,received:n.parsedType}),P}return ut(e.data)}}Di.create=t=>new Di({typeName:D.ZodNull,...F(t)});class Ll extends Z{constructor(){super(...arguments),this._any=!0}_parse(e){return ut(e.data)}}Ll.create=t=>new Ll({typeName:D.ZodAny,...F(t)});class Ol extends Z{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ut(e.data)}}Ol.create=t=>new Ol({typeName:D.ZodUnknown,...F(t)});class hr extends Z{_parse(e){const r=this._getOrReturnCtx(e);return E(r,{code:x.invalid_type,expected:C.never,received:r.parsedType}),P}}hr.create=t=>new hr({typeName:D.ZodNever,...F(t)});class Ml extends Z{_parse(e){if(this._getType(e)!==C.undefined){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:C.void,received:n.parsedType}),P}return ut(e.data)}}Ml.create=t=>new Ml({typeName:D.ZodVoid,...F(t)});class Lt extends Z{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==C.array)return E(r,{code:x.invalid_type,expected:C.array,received:r.parsedType}),P;if(a.exactLength!==null){const o=r.data.length>a.exactLength.value,s=r.data.length<a.exactLength.value;(o||s)&&(E(r,{code:o?x.too_big:x.too_small,minimum:s?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(E(r,{code:x.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(E(r,{code:x.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>a.type._parseAsync(new It(r,o,r.path,s)))).then(o=>ze.mergeArray(n,o));const i=[...r.data].map((o,s)=>a.type._parseSync(new It(r,o,r.path,s)));return ze.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new Lt({...this._def,minLength:{value:e,message:L.toString(r)}})}max(e,r){return new Lt({...this._def,maxLength:{value:e,message:L.toString(r)}})}length(e,r){return new Lt({...this._def,exactLength:{value:e,message:L.toString(r)}})}nonempty(e){return this.min(1,e)}}Lt.create=(t,e)=>new Lt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...F(e)});function Xr(t){if(t instanceof de){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Xt.create(Xr(n))}return new de({...t._def,shape:()=>e})}else return t instanceof Lt?new Lt({...t._def,type:Xr(t.element)}):t instanceof Xt?Xt.create(Xr(t.unwrap())):t instanceof Nr?Nr.create(Xr(t.unwrap())):t instanceof Lr?Lr.create(t.items.map(e=>Xr(e))):t}class de extends Z{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=W.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==C.object){const l=this._getOrReturnCtx(e);return E(l,{code:x.invalid_type,expected:C.object,received:l.parsedType}),P}const{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof hr&&this._def.unknownKeys==="strip"))for(const l in a.data)o.includes(l)||s.push(l);const c=[];for(const l of o){const d=i[l],p=a.data[l];c.push({key:{status:"valid",value:l},value:d._parse(new It(a,p,a.path,l)),alwaysSet:l in a.data})}if(this._def.catchall instanceof hr){const l=this._def.unknownKeys;if(l==="passthrough")for(const d of s)c.push({key:{status:"valid",value:d},value:{status:"valid",value:a.data[d]}});else if(l==="strict")s.length>0&&(E(a,{code:x.unrecognized_keys,keys:s}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const d of s){const p=a.data[d];c.push({key:{status:"valid",value:d},value:l._parse(new It(a,p,a.path,d)),alwaysSet:d in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const l=[];for(const d of c){const p=await d.key,h=await d.value;l.push({key:p,value:h,alwaysSet:d.alwaysSet})}return l}).then(l=>ze.mergeObjectSync(n,l)):ze.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return L.errToObj,new de({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{const a=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:L.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new de({...this._def,unknownKeys:"strip"})}passthrough(){return new de({...this._def,unknownKeys:"passthrough"})}extend(e){return new de({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new de({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:D.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new de({...this._def,catchall:e})}pick(e){const r={};for(const n of W.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new de({...this._def,shape:()=>r})}omit(e){const r={};for(const n of W.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new de({...this._def,shape:()=>r})}deepPartial(){return Xr(this)}partial(e){const r={};for(const n of W.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a.optional()}return new de({...this._def,shape:()=>r})}required(e){const r={};for(const n of W.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Xt;)i=i._def.innerType;r[n]=i}return new de({...this._def,shape:()=>r})}keyof(){return Pl(W.objectKeys(this.shape))}}de.create=(t,e)=>new de({shape:()=>t,unknownKeys:"strip",catchall:hr.create(),typeName:D.ZodObject,...F(e)}),de.strictCreate=(t,e)=>new de({shape:()=>t,unknownKeys:"strict",catchall:hr.create(),typeName:D.ZodObject,...F(e)}),de.lazycreate=(t,e)=>new de({shape:t,unknownKeys:"strip",catchall:hr.create(),typeName:D.ZodObject,...F(e)});class pa extends Z{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function a(i){for(const s of i)if(s.result.status==="valid")return s.result;for(const s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(s=>new Qt(s.ctx.common.issues));return E(r,{code:x.invalid_union,unionErrors:o}),P}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of n){const l={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:l});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(c=>new Qt(c));return E(r,{code:x.invalid_union,unionErrors:s}),P}}get options(){return this._def.options}}pa.create=(t,e)=>new pa({options:t,typeName:D.ZodUnion,...F(e)});const Kt=t=>t instanceof Fi?Kt(t.schema):t instanceof Mr?Kt(t.innerType()):t instanceof va?[t.value]:t instanceof Or?t.options:t instanceof Bi?W.objectValues(t.enum):t instanceof ka?Kt(t._def.innerType):t instanceof Pi?[void 0]:t instanceof Di?[null]:t instanceof Xt?[void 0,...Kt(t.unwrap())]:t instanceof Nr?[null,...Kt(t.unwrap())]:t instanceof $l||t instanceof wa?Kt(t.unwrap()):t instanceof ya?Kt(t._def.innerType):[];class $i extends Z{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==C.object)return E(r,{code:x.invalid_type,expected:C.object,received:r.parsedType}),P;const n=this.discriminator,a=r.data[n],i=this.optionsMap.get(a);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(E(r,{code:x.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),P)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const a=new Map;for(const i of r){const o=Kt(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of o){if(a.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);a.set(s,i)}}return new $i({typeName:D.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:a,...F(n)})}}function zi(t,e){const r=dr(t),n=dr(e);if(t===e)return{valid:!0,data:t};if(r===C.object&&n===C.object){const a=W.objectKeys(e),i=W.objectKeys(t).filter(s=>a.indexOf(s)!==-1),o={...t,...e};for(const s of i){const c=zi(t[s],e[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(r===C.array&&n===C.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<t.length;i++){const o=t[i],s=e[i],c=zi(o,s);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return r===C.date&&n===C.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ga extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=(i,o)=>{if(Tl(i)||Tl(o))return P;const s=zi(i.value,o.value);return s.valid?((El(i)||El(o))&&r.dirty(),{status:r.value,value:s.data}):(E(n,{code:x.invalid_intersection_types}),P)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ga.create=(t,e,r)=>new ga({left:t,right:e,typeName:D.ZodIntersection,...F(r)});class Lr extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==C.array)return E(n,{code:x.invalid_type,expected:C.array,received:n.parsedType}),P;if(n.data.length<this._def.items.length)return E(n,{code:x.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),P;!this._def.rest&&n.data.length>this._def.items.length&&(E(n,{code:x.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,s)=>{const c=this._def.items[s]||this._def.rest;return c?c._parse(new It(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>ze.mergeArray(r,o)):ze.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new Lr({...this._def,rest:e})}}Lr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Lr({items:t,typeName:D.ZodTuple,rest:null,...F(e)})};class ma extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==C.object)return E(n,{code:x.invalid_type,expected:C.object,received:n.parsedType}),P;const a=[],i=this._def.keyType,o=this._def.valueType;for(const s in n.data)a.push({key:i._parse(new It(n,s,n.path,s)),value:o._parse(new It(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?ze.mergeObjectAsync(r,a):ze.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Z?new ma({keyType:e,valueType:r,typeName:D.ZodRecord,...F(n)}):new ma({keyType:Yt.create(),valueType:e,typeName:D.ZodRecord,...F(r)})}}class Nl extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==C.map)return E(n,{code:x.invalid_type,expected:C.map,received:n.parsedType}),P;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([s,c],l)=>({key:a._parse(new It(n,s,n.path,[l,"key"])),value:i._parse(new It(n,c,n.path,[l,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const c of o){const l=await c.key,d=await c.value;if(l.status==="aborted"||d.status==="aborted")return P;(l.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(l.value,d.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const c of o){const l=c.key,d=c.value;if(l.status==="aborted"||d.status==="aborted")return P;(l.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(l.value,d.value)}return{status:r.value,value:s}}}}Nl.create=(t,e,r)=>new Nl({valueType:e,keyType:t,typeName:D.ZodMap,...F(r)});class In extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==C.set)return E(n,{code:x.invalid_type,expected:C.set,received:n.parsedType}),P;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(E(n,{code:x.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(E(n,{code:x.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function o(c){const l=new Set;for(const d of c){if(d.status==="aborted")return P;d.status==="dirty"&&r.dirty(),l.add(d.value)}return{status:r.value,value:l}}const s=[...n.data.values()].map((c,l)=>i._parse(new It(n,c,n.path,l)));return n.common.async?Promise.all(s).then(c=>o(c)):o(s)}min(e,r){return new In({...this._def,minSize:{value:e,message:L.toString(r)}})}max(e,r){return new In({...this._def,maxSize:{value:e,message:L.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}In.create=(t,e)=>new In({valueType:t,minSize:null,maxSize:null,typeName:D.ZodSet,...F(e)});class Fi extends Z{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Fi.create=(t,e)=>new Fi({getter:t,typeName:D.ZodLazy,...F(e)});class va extends Z{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return E(r,{received:r.data,code:x.invalid_literal,expected:this._def.value}),P}return{status:"valid",value:e.data}}get value(){return this._def.value}}va.create=(t,e)=>new va({value:t,typeName:D.ZodLiteral,...F(e)});function Pl(t,e){return new Or({values:t,typeName:D.ZodEnum,...F(e)})}class Or extends Z{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return E(r,{expected:W.joinValues(n),received:r.parsedType,code:x.invalid_type}),P}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return E(r,{received:r.data,code:x.invalid_enum_value,options:n}),P}return ut(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Or.create(e,{...this._def,...r})}exclude(e,r=this._def){return Or.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}Or.create=Pl;class Bi extends Z{_parse(e){const r=W.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==C.string&&n.parsedType!==C.number){const a=W.objectValues(r);return E(n,{expected:W.joinValues(a),received:n.parsedType,code:x.invalid_type}),P}if(this._cache||(this._cache=new Set(W.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=W.objectValues(r);return E(n,{received:n.data,code:x.invalid_enum_value,options:a}),P}return ut(e.data)}get enum(){return this._def.values}}Bi.create=(t,e)=>new Bi({values:t,typeName:D.ZodNativeEnum,...F(e)});class ba extends Z{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==C.promise&&r.common.async===!1)return E(r,{code:x.invalid_type,expected:C.promise,received:r.parsedType}),P;const n=r.parsedType===C.promise?r.data:Promise.resolve(r.data);return ut(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ba.create=(t,e)=>new ba({type:t,typeName:D.ZodPromise,...F(e)});class Mr extends Z{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:o=>{E(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return P;const c=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?P:c.status==="dirty"||r.value==="dirty"?An(c.value):c});{if(r.value==="aborted")return P;const s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?P:s.status==="dirty"||r.value==="dirty"?An(s.value):s}}if(a.type==="refinement"){const o=s=>{const c=a.refinement(s,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?P:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?P:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Yr(o))return P;const s=a.transform(o.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Yr(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:r.value,value:s})):P);W.assertNever(a)}}Mr.create=(t,e,r)=>new Mr({schema:t,typeName:D.ZodEffects,effect:e,...F(r)}),Mr.createWithPreprocess=(t,e,r)=>new Mr({schema:e,effect:{type:"preprocess",transform:t},typeName:D.ZodEffects,...F(r)});class Xt extends Z{_parse(e){return this._getType(e)===C.undefined?ut(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Xt.create=(t,e)=>new Xt({innerType:t,typeName:D.ZodOptional,...F(e)});class Nr extends Z{_parse(e){return this._getType(e)===C.null?ut(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nr.create=(t,e)=>new Nr({innerType:t,typeName:D.ZodNullable,...F(e)});class ka extends Z{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===C.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ka.create=(t,e)=>new ka({innerType:t,typeName:D.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...F(e)});class ya extends Z{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ha(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Qt(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Qt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ya.create=(t,e)=>new ya({innerType:t,typeName:D.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...F(e)});class Dl extends Z{_parse(e){if(this._getType(e)!==C.nan){const n=this._getOrReturnCtx(e);return E(n,{code:x.invalid_type,expected:C.nan,received:n.parsedType}),P}return{status:"valid",value:e.data}}}Dl.create=t=>new Dl({typeName:D.ZodNaN,...F(t)});class $l extends Z{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class ji extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?P:i.status==="dirty"?(r.dirty(),An(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?P:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,r){return new ji({in:e,out:r,typeName:D.ZodPipeline})}}class wa extends Z{_parse(e){const r=this._def.innerType._parse(e),n=a=>(Yr(a)&&(a.value=Object.freeze(a.value)),a);return ha(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}wa.create=(t,e)=>new wa({innerType:t,typeName:D.ZodReadonly,...F(e)});var D;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(D||(D={}));const u=Yt.create,pe=Kr.create,K=Ni.create;hr.create;const J=Lt.create,R=de.create,Jt=pa.create,zl=$i.create;ga.create,Lr.create;const Je=ma.create,Fe=va.create,dt=Or.create;ba.create,Xt.create,Nr.create;const Sf=Jt([u(),pe(),K(),J(u()),J(pe()),J(K())]),Ui=R({title:u(),description:u().optional(),badge:u().optional(),breadcrumbs:J(u()).optional(),previewImage:u().optional(),date:u().datetime().optional()}),Tf=R({url:u().url(),score:pe(),metadata:Je(u(),Sf),language:u().optional()}).merge(Ui),Ef=R({componentName:Fe("buttons"),data:R({caption:u().optional(),buttons:J(R({label:u(),href:u().url().optional(),value:u(),variant:dt(["primary","secondary","tertiary"]).optional(),icon:u().optional(),target:u().optional()}))})}),Cf=R({componentName:Fe("combobox"),data:R({caption:u().optional(),placeholder:u(),values:J(R({label:u(),value:u()}))})}),Af=R({componentName:Fe("alva-init"),data:R({})}),Rf=R({componentName:Fe("alva-score-survey"),data:R({})}),If=R({type:Fe("component"),id:u().optional(),time:u().optional(),hideAvatar:K().optional(),noSectionPadding:K().optional()}),Lf=zl("componentName",[Ef,Cf,Af,Rf]).and(If);dt(["start","chat"]),zl("name",[R({name:Fe("start-page"),prefill:u().optional()}),R({name:Fe("consent-page")}),R({name:Fe("chat-page"),query:u()})]);const Of=R({type:Fe("user"),time:u(),message:u(),id:u().optional()});dt(["idle","searching","answering"]);const Mf=Jt([u(),pe(),K(),J(u()),J(pe()),J(K())]),qi=R({url:u(),score:pe(),metadata:Je(u(),Mf),considered:K(),display:R({card:Ui,listItem:Ui})}).extend({referenceIndex:R({all:pe(),used:pe().optional()})}),Nf=R({all:J(qi),used:J(qi),unused:J(qi)}),Pf=dt(["pii-detected","blocked","maintenance","rate-limit","server-error","too-short","too-long","quota-reached","aborted"]),Df=Jt([Pf,Fe("sse-error"),Fe("client-error"),Fe("unexpected-call")]),Fl=R({type:Fe("bot"),time:u(),id:u(),message:R({markdown:u(),html:u(),text:u()}),references:Nf,errors:J(Df),retrievalQuestion:u().optional()}),$f=Fl.extend({state:dt(["streaming","done"])}),zf=Fl.extend({state:Fe("loading")}),Ff=Jt([zf,$f]),Vi=Jt([Ff,Of,Lf]);var Hi={inherit:"inherit",current:"currentcolor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"oklch(98.4% 0.003 247.858)",100:"oklch(96.8% 0.007 247.896)",200:"oklch(92.9% 0.013 255.508)",300:"oklch(86.9% 0.022 252.894)",400:"oklch(70.4% 0.04 256.788)",500:"oklch(55.4% 0.046 257.417)",600:"oklch(44.6% 0.043 257.281)",700:"oklch(37.2% 0.044 257.287)",800:"oklch(27.9% 0.041 260.031)",900:"oklch(20.8% 0.042 265.755)",950:"oklch(12.9% 0.042 264.695)"},gray:{50:"oklch(98.5% 0.002 247.839)",100:"oklch(96.7% 0.003 264.542)",200:"oklch(92.8% 0.006 264.531)",300:"oklch(87.2% 0.01 258.338)",400:"oklch(70.7% 0.022 261.325)",500:"oklch(55.1% 0.027 264.364)",600:"oklch(44.6% 0.03 256.802)",700:"oklch(37.3% 0.034 259.733)",800:"oklch(27.8% 0.033 256.848)",900:"oklch(21% 0.034 264.665)",950:"oklch(13% 0.028 261.692)"},zinc:{50:"oklch(98.5% 0 0)",100:"oklch(96.7% 0.001 286.375)",200:"oklch(92% 0.004 286.32)",300:"oklch(87.1% 0.006 286.286)",400:"oklch(70.5% 0.015 286.067)",500:"oklch(55.2% 0.016 285.938)",600:"oklch(44.2% 0.017 285.786)",700:"oklch(37% 0.013 285.805)",800:"oklch(27.4% 0.006 286.033)",900:"oklch(21% 0.006 285.885)",950:"oklch(14.1% 0.005 285.823)"},neutral:{50:"oklch(98.5% 0 0)",100:"oklch(97% 0 0)",200:"oklch(92.2% 0 0)",300:"oklch(87% 0 0)",400:"oklch(70.8% 0 0)",500:"oklch(55.6% 0 0)",600:"oklch(43.9% 0 0)",700:"oklch(37.1% 0 0)",800:"oklch(26.9% 0 0)",900:"oklch(20.5% 0 0)",950:"oklch(14.5% 0 0)"},stone:{50:"oklch(98.5% 0.001 106.423)",100:"oklch(97% 0.001 106.424)",200:"oklch(92.3% 0.003 48.717)",300:"oklch(86.9% 0.005 56.366)",400:"oklch(70.9% 0.01 56.259)",500:"oklch(55.3% 0.013 58.071)",600:"oklch(44.4% 0.011 73.639)",700:"oklch(37.4% 0.01 67.558)",800:"oklch(26.8% 0.007 34.298)",900:"oklch(21.6% 0.006 56.043)",950:"oklch(14.7% 0.004 49.25)"},red:{50:"oklch(97.1% 0.013 17.38)",100:"oklch(93.6% 0.032 17.717)",200:"oklch(88.5% 0.062 18.334)",300:"oklch(80.8% 0.114 19.571)",400:"oklch(70.4% 0.191 22.216)",500:"oklch(63.7% 0.237 25.331)",600:"oklch(57.7% 0.245 27.325)",700:"oklch(50.5% 0.213 27.518)",800:"oklch(44.4% 0.177 26.899)",900:"oklch(39.6% 0.141 25.723)",950:"oklch(25.8% 0.092 26.042)"},orange:{50:"oklch(98% 0.016 73.684)",100:"oklch(95.4% 0.038 75.164)",200:"oklch(90.1% 0.076 70.697)",300:"oklch(83.7% 0.128 66.29)",400:"oklch(75% 0.183 55.934)",500:"oklch(70.5% 0.213 47.604)",600:"oklch(64.6% 0.222 41.116)",700:"oklch(55.3% 0.195 38.402)",800:"oklch(47% 0.157 37.304)",900:"oklch(40.8% 0.123 38.172)",950:"oklch(26.6% 0.079 36.259)"},amber:{50:"oklch(98.7% 0.022 95.277)",100:"oklch(96.2% 0.059 95.617)",200:"oklch(92.4% 0.12 95.746)",300:"oklch(87.9% 0.169 91.605)",400:"oklch(82.8% 0.189 84.429)",500:"oklch(76.9% 0.188 70.08)",600:"oklch(66.6% 0.179 58.318)",700:"oklch(55.5% 0.163 48.998)",800:"oklch(47.3% 0.137 46.201)",900:"oklch(41.4% 0.112 45.904)",950:"oklch(27.9% 0.077 45.635)"},yellow:{50:"oklch(98.7% 0.026 102.212)",100:"oklch(97.3% 0.071 103.193)",200:"oklch(94.5% 0.129 101.54)",300:"oklch(90.5% 0.182 98.111)",400:"oklch(85.2% 0.199 91.936)",500:"oklch(79.5% 0.184 86.047)",600:"oklch(68.1% 0.162 75.834)",700:"oklch(55.4% 0.135 66.442)",800:"oklch(47.6% 0.114 61.907)",900:"oklch(42.1% 0.095 57.708)",950:"oklch(28.6% 0.066 53.813)"},lime:{50:"oklch(98.6% 0.031 120.757)",100:"oklch(96.7% 0.067 122.328)",200:"oklch(93.8% 0.127 124.321)",300:"oklch(89.7% 0.196 126.665)",400:"oklch(84.1% 0.238 128.85)",500:"oklch(76.8% 0.233 130.85)",600:"oklch(64.8% 0.2 131.684)",700:"oklch(53.2% 0.157 131.589)",800:"oklch(45.3% 0.124 130.933)",900:"oklch(40.5% 0.101 131.063)",950:"oklch(27.4% 0.072 132.109)"},green:{50:"oklch(98.2% 0.018 155.826)",100:"oklch(96.2% 0.044 156.743)",200:"oklch(92.5% 0.084 155.995)",300:"oklch(87.1% 0.15 154.449)",400:"oklch(79.2% 0.209 151.711)",500:"oklch(72.3% 0.219 149.579)",600:"oklch(62.7% 0.194 149.214)",700:"oklch(52.7% 0.154 150.069)",800:"oklch(44.8% 0.119 151.328)",900:"oklch(39.3% 0.095 152.535)",950:"oklch(26.6% 0.065 152.934)"},emerald:{50:"oklch(97.9% 0.021 166.113)",100:"oklch(95% 0.052 163.051)",200:"oklch(90.5% 0.093 164.15)",300:"oklch(84.5% 0.143 164.978)",400:"oklch(76.5% 0.177 163.223)",500:"oklch(69.6% 0.17 162.48)",600:"oklch(59.6% 0.145 163.225)",700:"oklch(50.8% 0.118 165.612)",800:"oklch(43.2% 0.095 166.913)",900:"oklch(37.8% 0.077 168.94)",950:"oklch(26.2% 0.051 172.552)"},teal:{50:"oklch(98.4% 0.014 180.72)",100:"oklch(95.3% 0.051 180.801)",200:"oklch(91% 0.096 180.426)",300:"oklch(85.5% 0.138 181.071)",400:"oklch(77.7% 0.152 181.912)",500:"oklch(70.4% 0.14 182.503)",600:"oklch(60% 0.118 184.704)",700:"oklch(51.1% 0.096 186.391)",800:"oklch(43.7% 0.078 188.216)",900:"oklch(38.6% 0.063 188.416)",950:"oklch(27.7% 0.046 192.524)"},cyan:{50:"oklch(98.4% 0.019 200.873)",100:"oklch(95.6% 0.045 203.388)",200:"oklch(91.7% 0.08 205.041)",300:"oklch(86.5% 0.127 207.078)",400:"oklch(78.9% 0.154 211.53)",500:"oklch(71.5% 0.143 215.221)",600:"oklch(60.9% 0.126 221.723)",700:"oklch(52% 0.105 223.128)",800:"oklch(45% 0.085 224.283)",900:"oklch(39.8% 0.07 227.392)",950:"oklch(30.2% 0.056 229.695)"},sky:{50:"oklch(97.7% 0.013 236.62)",100:"oklch(95.1% 0.026 236.824)",200:"oklch(90.1% 0.058 230.902)",300:"oklch(82.8% 0.111 230.318)",400:"oklch(74.6% 0.16 232.661)",500:"oklch(68.5% 0.169 237.323)",600:"oklch(58.8% 0.158 241.966)",700:"oklch(50% 0.134 242.749)",800:"oklch(44.3% 0.11 240.79)",900:"oklch(39.1% 0.09 240.876)",950:"oklch(29.3% 0.066 243.157)"},blue:{50:"oklch(97% 0.014 254.604)",100:"oklch(93.2% 0.032 255.585)",200:"oklch(88.2% 0.059 254.128)",300:"oklch(80.9% 0.105 251.813)",400:"oklch(70.7% 0.165 254.624)",500:"oklch(62.3% 0.214 259.815)",600:"oklch(54.6% 0.245 262.881)",700:"oklch(48.8% 0.243 264.376)",800:"oklch(42.4% 0.199 265.638)",900:"oklch(37.9% 0.146 265.522)",950:"oklch(28.2% 0.091 267.935)"},indigo:{50:"oklch(96.2% 0.018 272.314)",100:"oklch(93% 0.034 272.788)",200:"oklch(87% 0.065 274.039)",300:"oklch(78.5% 0.115 274.713)",400:"oklch(67.3% 0.182 276.935)",500:"oklch(58.5% 0.233 277.117)",600:"oklch(51.1% 0.262 276.966)",700:"oklch(45.7% 0.24 277.023)",800:"oklch(39.8% 0.195 277.366)",900:"oklch(35.9% 0.144 278.697)",950:"oklch(25.7% 0.09 281.288)"},violet:{50:"oklch(96.9% 0.016 293.756)",100:"oklch(94.3% 0.029 294.588)",200:"oklch(89.4% 0.057 293.283)",300:"oklch(81.1% 0.111 293.571)",400:"oklch(70.2% 0.183 293.541)",500:"oklch(60.6% 0.25 292.717)",600:"oklch(54.1% 0.281 293.009)",700:"oklch(49.1% 0.27 292.581)",800:"oklch(43.2% 0.232 292.759)",900:"oklch(38% 0.189 293.745)",950:"oklch(28.3% 0.141 291.089)"},purple:{50:"oklch(97.7% 0.014 308.299)",100:"oklch(94.6% 0.033 307.174)",200:"oklch(90.2% 0.063 306.703)",300:"oklch(82.7% 0.119 306.383)",400:"oklch(71.4% 0.203 305.504)",500:"oklch(62.7% 0.265 303.9)",600:"oklch(55.8% 0.288 302.321)",700:"oklch(49.6% 0.265 301.924)",800:"oklch(43.8% 0.218 303.724)",900:"oklch(38.1% 0.176 304.987)",950:"oklch(29.1% 0.149 302.717)"},fuchsia:{50:"oklch(97.7% 0.017 320.058)",100:"oklch(95.2% 0.037 318.852)",200:"oklch(90.3% 0.076 319.62)",300:"oklch(83.3% 0.145 321.434)",400:"oklch(74% 0.238 322.16)",500:"oklch(66.7% 0.295 322.15)",600:"oklch(59.1% 0.293 322.896)",700:"oklch(51.8% 0.253 323.949)",800:"oklch(45.2% 0.211 324.591)",900:"oklch(40.1% 0.17 325.612)",950:"oklch(29.3% 0.136 325.661)"},pink:{50:"oklch(97.1% 0.014 343.198)",100:"oklch(94.8% 0.028 342.258)",200:"oklch(89.9% 0.061 343.231)",300:"oklch(82.3% 0.12 346.018)",400:"oklch(71.8% 0.202 349.761)",500:"oklch(65.6% 0.241 354.308)",600:"oklch(59.2% 0.249 0.584)",700:"oklch(52.5% 0.223 3.958)",800:"oklch(45.9% 0.187 3.815)",900:"oklch(40.8% 0.153 2.432)",950:"oklch(28.4% 0.109 3.907)"},rose:{50:"oklch(96.9% 0.015 12.422)",100:"oklch(94.1% 0.03 12.58)",200:"oklch(89.2% 0.058 10.001)",300:"oklch(81% 0.117 11.638)",400:"oklch(71.2% 0.194 13.428)",500:"oklch(64.5% 0.246 16.439)",600:"oklch(58.6% 0.253 17.585)",700:"oklch(51.4% 0.222 16.935)",800:"oklch(45.5% 0.188 13.697)",900:"oklch(41% 0.159 10.272)",950:"oklch(27.1% 0.105 12.094)"}};const Be=R({minRem:pe(),maxRem:pe()}).or(u()),_a=R({0:u().optional(),50:u(),100:u(),200:u(),300:u(),400:u(),500:u(),600:u(),700:u(),800:u(),900:u(),950:u(),1e3:u().optional()}),Zi=R({color:u().optional(),background:u().optional(),borderWidth:u().optional(),borderColor:u().optional(),boxShadow:u().optional()}),Bf=R({borderRadius:Be.optional(),custom:Je(u(),Jt([u(),pe()])).optional(),hover:Zi.optional(),focus:Zi.optional()}).and(Zi),jf=R({family:u().optional()}),Uf=Je(dt(["predefinedQuestion","edit","newConversation","voteUp","voteDown","retry","message","messageLoading","thread","submit","abort","expand","help","attach","record","reward","share","audio","copy","dismiss","menu","info","menuClose","chevronDown","chevronUp","chevronTopDown","chevronDownSmall","internalLink","externalLink","liip","avatar","avatarLarge","openChat","speechInput","listUnordered","lightMode","darkMode","avatarLarge","settings","settingsClose","sources","model","checkbox","warning","headerLogo","embedAvatar"]),u()),qf=R({font:jf.optional(),colors:R({brand:_a,accent:_a.optional(),highlight:_a,grey:_a}),base:R({fontSizeXs:Be.optional(),fontSizeSm:Be.optional(),fontSizeBody:Be.optional(),fontSizeH3:Be.optional(),fontSizeH2:Be.optional(),fontSizeH1:Be.optional(),fontWeightNormal:u().optional(),fontWeightBold:u().optional(),fontWeightTitle:u().optional(),lineHeightDefault:u().optional(),lineHeightSnug:u().optional(),lineHeightTight:u().optional(),borderRadius:Be.optional(),lineColor:u().optional(),boxShadow:u().optional()}),components:Je(u(),Bf),svgs:Uf}),xa=R({customCSS:u().optional(),fontCSS:u().optional(),fontURLs:u().array().optional(),tokens:qf});R({light:xa,dark:xa});const Vf=R({light:xa,dark:xa}).deepPartial(),Bl=R({50:u(),100:u(),200:u(),300:u(),400:u(),500:u(),600:u(),700:u(),800:u(),900:u(),950:u()}),jl=dt(["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]),Ul=Jt([Bl,jl]),Hf=Jt([Bl.and(R({0:u(),1e3:u()})),jl]),ql=R({avatarImageUrl:u().optional(),colors:R({brand:Ul.optional(),highlight:Ul.optional(),grey:Hf.optional(),background:u().optional(),text:u().optional(),anchor:R({default:u().optional(),hover:u().optional()}).optional()}).optional(),font:R({family:u().optional(),urls:J(u()).optional(),sizeXs:Be.optional(),sizeSm:Be.optional(),sizeBody:Be.optional(),sizeH3:Be.optional(),sizeH2:Be.optional(),sizeH1:Be.optional(),weightNormal:u().optional(),weightBold:u().optional(),weightTitle:u().optional()}).optional(),borderRadius:Be.optional(),fineGrained:Vf.optional()}),Zf=R({blocked:u(),maintenance:u(),"rate-limit":u(),"server-error":u(),"too-short":u(),"too-long":u(),"quota-reached":u(),aborted:u(),"sse-error":u(),"client-error":u(),"unexpected-call":u(),"incomplete-error":u(),"feedback-failed":u(),"speech-not-supported":u(),"speech-transcription-failed":u(),"speech-no-text-detected":u(),"speech-microphone-access-denied":u(),"pii-detected":u()}),Gf=R({email:u(),creditCard:u(),ahv:u(),phoneSwiss:u(),phoneInternational:u(),swissPassport:u(),longNumber:u()}),Vl=R({name:u(),namePlural:u().optional(),intro:u().optional(),placeholder:u(),values:Je(u(),u())}),Wf=R({action:u(),label:u(),type:dt(["primary","secondary"]).optional()}),Qf=R({hash:u(),title:u(),content:u(),actions:J(Wf).optional()}),Hl=R({introductionTitle:u(),introductionDisclaimer:u().optional(),termsInvitationToConsent:u().optional(),chatInputPlaceholder:u(),chatInputPlaceholderListening:u().optional(),chatInputSubmit:u(),chatInputAbort:u(),chatInputStartListening:u(),chatInputStopListening:u(),referenceLink:u(),referencesDisplay:u(),referencesHide:u(),referencesTitle:u(),referencesFurtherTitle:u(),newChat:u(),maintenanceModeError:u(),messageBotLoading:u(),messageBotError:u(),messageBotDefaultError:u(),noResultsFound:u(),chatFooterText:u().optional(),scrollToBottom:u(),openButtonTitle:u().optional(),openButtonDescription:u().optional(),openMenu:u(),openInfo:u(),aboutThisChat:u().optional(),closeMenu:u(),closeChat:u(),close:u(),send:u(),thankYouForFeedback:u(),giveFeedback:u(),sendFeedback:u(),feedbackFormTitle:u(),feedbackFormMessage:u(),feedbackFormMessagePlaceholder:u(),feedbackFormEmail:u(),feedbackFormEmailPlaceholder:u(),askQuestionAgain:u(),answerGood:u(),answerBad:u(),classificationSubmit:u(),classificationThankYou:u(),classificationTitle:u(),selectLanguage:u(),languageChanged:u(),selectColorTheme:u(),lightMode:u(),darkMode:u(),ariaMainNavigation:u(),ariaMainNavigationRegion:u(),ariaGotoMainNavigation:u(),ariaAskQuestion:u(),ariaAskQuestionRegion:u(),ariaNotifications:u(),ariaPredefinedQuestions:u(),ariaPredefinedQuestionsRegion:u(),ariaChatHistory:u(),ariaOpenChat:u(),ariaQuestionFromYou:u(),ariaAnswerFromBot:u(),ariaLastAnswerNavigation:u(),ariaQuestionSent:u(),ariaAnswerReady:u(),ariaAnswerFinished:u(),ariaAskQuestionAgain:u(),ariaAnswerGood:u(),ariaAnswerBad:u(),ariaReferenceSource:u(),ariaGiveFeedback:u(),ariaLanguageChanged:u(),ariaLightSelected:u(),ariaDarkSelected:u(),ariaSettings:u(),ariaSettingsRegion:u(),ariaReferencesRegion:u(),ariaOpensInNewTab:u(),ariaFlyoutRegion:u(),ariaSelected:u(),ariaUnselected:u(),ariaAllSelected:u(),ariaAllUnselected:u(),ariaAllReseted:u(),popups:J(Qf).optional(),termsAcceptButton:u().optional(),termsReadButton:u().optional(),selectors:Je(u(),Vl).optional(),hideSettings:u(),showSettings:u(),chooseAtLeastOneOption:u(),selectAll:u(),selectNone:u(),resetToDefaults:u(),messageTooLong:u()}),Jr=dt(["en","de","fr","it"]),Zl=Je(Jr,Hl.partial().extend({selectors:Je(u(),Vl).optional()}));Je(Jr,Zf),Je(Jr,Gf);const Gl=R({label:u(),options:J(R({label:u(),value:pe()}))}),Yf=R({label:u(),icon:u(),url:u(),target:dt(["_blank","_self"]).optional()}),Kf=R({label:u().nullable(),question:u()}),Wl=R({impact:Gl.optional(),quality:Gl.optional()});R({classification:Wl.optional()});const Xf=R({predefinedQuestions:J(Kf)}),Ql=Jt([R({maintenance:Fe(!0)}),R({id:u(),cID:u()})]);Je(Jr,Hl);const Jf=R({settingName:u(),iconName:u(),settingIntro:u().optional(),type:dt(["single-select","multi-select"]),allowEmpty:K(),values:J(u()),defaultValues:J(u()).optional()}),Yl=R({before:J(Vi).optional(),after:J(Vi).optional()}),ep=R({init:J(Vi).optional(),bot:Yl.optional(),user:Yl.optional()}),Kl=R({showPredefinedQuestions:K(),showOverallFeedbackButton:K(),showOverallFeedbackEmail:K(),showCloseChatButton:K(),showContextMenu:K(),showContextInfo:K(),showReferencesByDefault:K(),showExpandedSelectors:K(),showTextFeedback:K(),inlineLayout:K(),allowAudioInput:K(),blockPII:K(),questionPrefix:u(),menu:Je(Jr,J(Yf)).optional(),supportedLanguages:J(Jr),classification:Wl.optional(),theme:ql,translations:Zl,buttonHref:u().optional(),addQueryToUrlParams:K().optional(),addRetrievalQuestionToUrlParams:K().optional(),renderKatex:K().optional(),reflectLanguageInPath:K().optional(),sendReferrer:dt(["all","own","none","location"]).optional(),selectorsConfig:J(Jf).default([]),questionLengthLimit:pe().optional(),forceConsent:K().optional(),askQuestionAgain:K(),enableBackdrop:K().optional(),messageAdditions:ep.optional(),contextVersion:pe().optional()}).partial().and(R({theme:R({name:u().optional()}).optional()}));class tp{constructor(e){this.chatResponseData=e,this.id=this.chatResponseData.id}id;async isReadyForFeedback(){return await this.chatResponseData.readyForFeedback.toPromise(),!0}subscribe(e,r){return this.chatResponseData.readableStore.subscribe(e,r)}getContent(){return this.chatResponseData.content.toPromise()}abort(){return this.chatResponseData.abort()}async thumbsUp(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsUp(this.id,this.chatResponseData.question)}async thumbsDown(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsDown(this.id,this.chatResponseData.question)}async feedback(e){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.feedback(this.id,this.chatResponseData.question,e)}}const Ce=[];for(let t=0;t<256;++t)Ce.push((t+256).toString(16).slice(1));function Xl(t,e=0){return(Ce[t[e+0]]+Ce[t[e+1]]+Ce[t[e+2]]+Ce[t[e+3]]+"-"+Ce[t[e+4]]+Ce[t[e+5]]+"-"+Ce[t[e+6]]+Ce[t[e+7]]+"-"+Ce[t[e+8]]+Ce[t[e+9]]+"-"+Ce[t[e+10]]+Ce[t[e+11]]+Ce[t[e+12]]+Ce[t[e+13]]+Ce[t[e+14]]+Ce[t[e+15]]).toLowerCase()}let Gi;const rp=new Uint8Array(16);function Jl(){if(!Gi){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Gi=crypto.getRandomValues.bind(crypto)}return Gi(rp)}const ec={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function np(t,e,r){t=t||{};const n=t.random??t.rng?.()??Jl();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Xl(n)}function ap(t,e,r){return ec.randomUUID&&!t?ec.randomUUID():np(t)}const Wi={};function tc(t,e,r){let n;{const a=Date.now(),i=Jl();ip(Wi,a,i),n=op(i,Wi.msecs,Wi.seq,e,r)}return e??Xl(n)}function ip(t,e,r){return t.msecs??=-1/0,t.seq??=0,e>t.msecs?(t.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],t.msecs=e):(t.seq=t.seq+1|0,t.seq===0&&t.msecs++),t}function op(t,e,r,n,a=0){if(t.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),a=0;else if(a<0||a+16>n.length)throw new RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);return e??=Date.now(),r??=t[6]*127<<24|t[7]<<16|t[8]<<8|t[9],n[a++]=e/1099511627776&255,n[a++]=e/4294967296&255,n[a++]=e/16777216&255,n[a++]=e/65536&255,n[a++]=e/256&255,n[a++]=e&255,n[a++]=112|r>>>28&15,n[a++]=r>>>20&255,n[a++]=128|r>>>14&63,n[a++]=r>>>6&255,n[a++]=r<<2&255|t[10]&3,n[a++]=t[11],n[a++]=t[12],n[a++]=t[13],n[a++]=t[14],n[a++]=t[15],n}const en=new Map;class sp{get length(){return en.size}clear(){en.clear()}getItem(e){return en.get(e)||null}key(e){return Array.from(en.keys())[e]||null}removeItem(e){en.delete(e)}setItem(e,r){en.set(e,String(r))}}const kt=globalThis.localStorage??new sp,lp=async t=>{try{const e=kt.getItem("liipgpt:uID")||kt.getItem("uID"),r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({referrer:globalThis?.document?.referrer||null,uID:e})},n=await t.fetchData("/login",Ql,{},r).catch(a=>(console.log("Failed to /login use /log",a),t.fetchData("/log",Ql,{},r)));if("maintenance"in n&&n.maintenance)return{mode:"maintenance"};if(!("id"in n))throw new Error("Invalid response format: missing user id");return kt.setItem("liipgpt:uID",n.id),{mode:"ready",userId:n.id}}catch(e){throw console.error("Failed to fetch user data:",e),e}};var et=function(t,e){if(!(this instanceof et))return new et(t,e);this.url=t,e=e||{},this.headers=e.headers||{},this.payload=e.payload!==void 0?e.payload:"",this.method=e.method||this.payload&&"POST"||"GET",this.withCredentials=!!e.withCredentials,this.debug=!!e.debug,this.autoReconnect=e.autoReconnect!==void 0?e.autoReconnect:!1,this.reconnectDelay=e.reconnectDelay!==void 0?e.reconnectDelay:3e3,this.maxRetries=e.maxRetries!==void 0?e.maxRetries:null,this.retryCount=0,this.reconnectTimer=null,this.useLastEventId=e.useLastEventId!==void 0?e.useLastEventId:!0,this.FIELD_SEPARATOR=":",this.listeners={},this.xhr=null,this.readyState=et.INITIALIZING,this.progress=0,this.chunk="",this.lastEventId="",this.addEventListener=function(r,n){this.listeners[r]===void 0&&(this.listeners[r]=[]),this.listeners[r].indexOf(n)===-1&&this.listeners[r].push(n)},this.removeEventListener=function(r,n){if(this.listeners[r]===void 0)return;const a=[];this.listeners[r].forEach(function(i){i!==n&&a.push(i)}),a.length===0?delete this.listeners[r]:this.listeners[r]=a},this.dispatchEvent=function(r){if(!r)return!0;this.debug&&console.debug(r),r.source=this;const n="on"+r.type;return this.hasOwnProperty(n)&&(this[n].call(this,r),r.defaultPrevented)?!1:this.listeners[r.type]?this.listeners[r.type].every(function(a){return a(r),!r.defaultPrevented}):!0},this._markClosed=function(){if(this.xhr=null,this.progress=0,this.chunk="",this._setReadyState(et.CLOSED),this.autoReconnect){if(this.maxRetries!==null&&this.retryCount>=this.maxRetries){this.debug&&console.debug(`SSE max retries (${this.maxRetries}) reached, stopping reconnection attempts`),this.autoReconnect=!1,this.close();return}this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.debug&&console.debug(`SSE will attempt to reconnect in ${this.reconnectDelay}ms (attempt ${this.retryCount+1}${this.maxRetries?"/"+this.maxRetries:""})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.retryCount++,this.stream()},this.reconnectDelay)}},this._setReadyState=function(r){const n=new CustomEvent("readystatechange");n.readyState=r,this.readyState=r,this.dispatchEvent(n)},this._onStreamFailure=function(r){const n=new CustomEvent("error");n.responseCode=r.currentTarget.status,n.data=r.currentTarget.response,this.dispatchEvent(n),this._markClosed()},this._onStreamAbort=function(){this.dispatchEvent(new CustomEvent("abort")),this._markClosed()},this._onStreamProgress=function(r){if(!this.xhr)return;if(this.xhr.status<200||this.xhr.status>=300){this._onStreamFailure(r);return}this.retryCount=0;const n=this.xhr.responseText.substring(this.progress);this.progress+=n.length;const a=(this.chunk+n).split(/(\r\n\r\n|\r\r|\n\n)/g),i=a.pop();a.forEach((function(o){o.trim().length>0&&this.dispatchEvent(this._parseEventChunk(o))}).bind(this)),this.chunk=i},this._onStreamLoaded=function(r){this._onStreamProgress(r),this.dispatchEvent(this._parseEventChunk(this.chunk)),this.chunk="",this._markClosed()},this._parseEventChunk=function(r){if(!r||r.length===0)return null;this.debug&&console.debug(r);const n={id:null,retry:null,data:null,event:null};if(r.split(/\n|\r\n|\r/).forEach((function(i){const o=i.indexOf(this.FIELD_SEPARATOR);let s,c;if(o>0){const l=i[o+1]===" "?2:1;s=i.substring(0,o),c=i.substring(o+l)}else if(o<0)s=i,c="";else return;s in n&&(s==="data"&&n[s]!==null?n.data+=`
|
|
73
|
-
|
|
74
|
-
`);for(const i of n){const
|
|
75
|
-
|
|
76
|
-
`,{error:p,url:i,opts:o,data:c}),c}async postData(e,r){const n=await fetch(`${this.options.apiUrl}${e}`,{method:"POST",headers:this.getDefaultHeaders(),body:JSON.stringify(r)});if(!n.ok){const a=await n.text();throw new Error(`${n.status} - ${a}`)}return n}async postFormData(e,r){const n=await fetch(`${this.options.apiUrl}${e}`,{method:"POST",body:r});if(!n.ok){const a=await n.text();throw new Error(`${n.status} - ${a}`)}return n}}const dp=R({url:u().url(),title:u(),considered:K(),orgMetadata:R({authors:J(u())}),type:u(),date:u().datetime(),similarity:pe(),content:u(),fromFullTextSearch:K(),rerank:R({index:pe().int(),adjustment:pe(),score:pe(),similarityOld:pe()})}).deepPartial().or(Tf),hp=R({links:J(dp)}),fp=t=>{if("metadata"in t)return t;console.warn("Please upgrade your backend you are currently using an old api feature.");const e=t.orgMetadata??{};t?.fromFullTextSearch&&(e.fromFullTextSearch=t?.fromFullTextSearch),t?.rerank&&(e.rerank=t?.rerank);let r=[],n=t.title??"";if(t.title&&t.title.includes(" > ")){const a=t.title.split(" > ");n=a.pop()??"",r=a}return{url:t.url??"",title:n,score:t.similarity||0,breadcrumbs:r,metadata:e,description:t.content,date:t.date}};class pp{constructor(e){this.results=e}}class gp{internalData;renderers=new Map;markedExtensions=[];_newTabSrText;constructor(e){const r={apiUrl:e.apiUrl,apiKey:e.apiKey,speechRecognitionApiKey:e.speechRecognitionApiKey,strict:e.strict??!1,EventSource:e.EventSource??EventSource},n=new up(r);this.internalData={restClient:n,metadata:lp(n),searchResponseMap:new Map,chatResponseMap:new Map,conversationMap:new Map}}setMarkedExtensions(...e){this.markedExtensions=e}setNewTabSrText(e){this._newTabSrText=e}getMetadata(){return this.internalData.metadata}createConversationId(){const e=tc();return this.renderers.set(e,new _l({extensions:this.markedExtensions,newTabSrText:this._newTabSrText})),e}chat(e,r,n={}){const a=new Li,i=tc(),o=new xl,s=this.renderers.get(e)??new _l({extensions:this.markedExtensions,newTabSrText:this._newTabSrText}),c=new Kh({id:i,onError:h=>{n.onError?.(h)},onFinish:h=>{a.setValue(h)},markdownRenderer:s,userQuestion:r}),l=async()=>{await o,(await d).close()},d=new Li;(async()=>{const h=await this.internalData.metadata;if(h.mode==="maintenance")throw new Error("Can not chat in maintenance mode");const v=await this.internalData.restClient.subscribeSse("/assistant/sse",{query:r,uID:h.userId,cID:e,rID:i,lang:n.lang,feature:n.features?.join(","),referrer:n.referrer,...n.selectorValues??{},chat:"true",version:"2"},{onClose:()=>{c.finishMessage(),o.resolve(),a.cleanup()},onMessage:m=>{const b=m;switch(b.type){case"error":c.pushError(b.error);break;case"id":b.for==="request"&&i!==b.id&&console.warn(`Unexpected request id "${b.id}" expected "${i}"`),b.for==="conversation"&&e!==b.id&&console.warn(`Unexpected conversation id "${b.id}" expected "${e}"`);break;case"state":b.state==="history-entry-initialized"&&o.resolve();break;case"text":c.updateText(b.text);break;case"done":case"answer-done":c.finishMessage(),o.resolve(),d.then(A=>A.close());break;case"unexpected-call":console.error("unexpected-call:",b),c.pushError("unexpected-call");break;case"mapped-reference":c.addMappedReference(b.reference);break;case"reference":c.addOldReference(b.reference);break;case"retrieval-question":c.updateRetrievalQuestion(b.question);break}n.onMessage?.(b)},onError:m=>{console.error(" sse-error:",m),!("data"in m&&!m.data&&"responseCode"in m&&m.responseCode===0)&&c.pushError("sse-error")}});d.setValue(v)})();const p=new tp({question:r,id:i,content:a,readableStore:c.getReadableStore(),readyForFeedback:o,abort:l,liipgptClientPrimitive:this});return this.internalData.chatResponseMap.set(p.id,p),p}async thumbs(e,r,n){if((await this.internalData.metadata).mode!=="ready")throw new Error("Can not post feedback unless we are in ready mode");const i={feedback:n,rID:e,query:r};await this.internalData.restClient.postData("/quickfeedback",i)}thumbsUp(e,r){return this.thumbs(e,r,"positive")}thumbsDown(e,r){return this.thumbs(e,r,"negative")}async feedback(e,r,n){const a=await this.internalData.metadata;if(a.mode!=="ready")throw new Error("Can not post feedback unless we are in ready mode");if(n.message){const i={body:n.message,email:n.email,rID:e,uID:a.userId,query:r};await this.internalData.restClient.postData("/feedback",i)}n.classification&&await this.internalData.restClient.postData("/classification",{impact:n.classification.impact,quality:n.classification.quality,rID:e})}async search(e,r={}){const n=await this.internalData.metadata,a=n.mode==="ready"?n.userId:void 0,{links:i}=await this.internalData.restClient.fetchData("/assistant/search",hp,{modelId:r.model,lang:r.language,query:e,mapResults:"true",uID:a}),o=i.map(fp);return new pp(o)}async getChatConfig(){return this.internalData.restClient.fetchData("/chatconfig",Kl)}async getPredefinedQuestions(e){return(await this.internalData.restClient.fetchData("/topics/questions",Xf,e)).predefinedQuestions}async transcribeAudio(e,r={}){const n=await this.internalData.metadata,a=r.lang||"de-CH";if(n.mode==="maintenance")throw new Error("Can not transcribe audio in maintenance mode");try{const o=(d=>d.includes("mp4")?"mp4":d.includes("webm")?"webm":(d.includes("wav"),"wav"))(e.type),s=new FormData;return s.append("file",e,`audio.${o}`),s.append("lang",a),s.append("type",e.type),{transcript:await(await this.internalData.restClient.postFormData(`/speech?key=${this.internalData.restClient.speechRecognitionApiKey||""}&lang=${a}`,s)).text()||"",error:void 0}}catch(i){return console.error("Error transcribing audio:",i),{transcript:"",error:i instanceof Error?i.message:"Unknown error"}}}}const mp=600;function nc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Qi,ac;function vp(){if(ac)return Qi;ac=1;var t=function(k){return e(k)&&!r(k)};function e(y){return!!y&&typeof y=="object"}function r(y){var k=Object.prototype.toString.call(y);return k==="[object RegExp]"||k==="[object Date]"||i(y)}var n=typeof Symbol=="function"&&Symbol.for,a=n?Symbol.for("react.element"):60103;function i(y){return y.$$typeof===a}function o(y){return Array.isArray(y)?[]:{}}function s(y,k){return k.clone!==!1&&k.isMergeableObject(y)?b(o(y),y,k):y}function c(y,k,w){return y.concat(k).map(function(T){return s(T,w)})}function l(y,k){if(!k.customMerge)return b;var w=k.customMerge(y);return typeof w=="function"?w:b}function d(y){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(y).filter(function(k){return Object.propertyIsEnumerable.call(y,k)}):[]}function p(y){return Object.keys(y).concat(d(y))}function h(y,k){try{return k in y}catch{return!1}}function v(y,k){return h(y,k)&&!(Object.hasOwnProperty.call(y,k)&&Object.propertyIsEnumerable.call(y,k))}function m(y,k,w){var T={};return w.isMergeableObject(y)&&p(y).forEach(function(I){T[I]=s(y[I],w)}),p(k).forEach(function(I){v(y,I)||(h(y,I)&&w.isMergeableObject(k[I])?T[I]=l(I,w)(y[I],k[I],w):T[I]=s(k[I],w))}),T}function b(y,k,w){w=w||{},w.arrayMerge=w.arrayMerge||c,w.isMergeableObject=w.isMergeableObject||t,w.cloneUnlessOtherwiseSpecified=s;var T=Array.isArray(k),I=Array.isArray(y),U=T===I;return U?T?w.arrayMerge(y,k,w):m(y,k,w):s(k,w)}b.all=function(k,w){if(!Array.isArray(k))throw new Error("first argument should be an array");return k.reduce(function(T,I){return b(T,I,w)},{})};var A=b;return Qi=A,Qi}var bp=vp();const Ln=nc(bp),kp=t=>t===null||typeof t!="object",Yi=t=>{if(kp(t))return t;if(Array.isArray(t))return t.map(Yi);const e=Object.entries(t).filter(([r,n])=>n!==void 0).map(([r,n])=>[r,Yi(n)]);return Object.fromEntries(e)},Sa=(t,e)=>{const r=Yi(e);return Ln(t,r)},ic={tokens:{font:{family:"-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif"},colors:{brand:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#2d3748",900:"#1a202c",950:"#171923"},highlight:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#2d3748",900:"#1a202c",950:"#171923"},grey:{0:"#ffffff",50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#2d3748",900:"#1a202c",950:"#171923",1e3:"#000000"}},base:{fontSizeXs:{minRem:.75,maxRem:.875},fontSizeSm:{minRem:1,maxRem:1},fontSizeBody:{minRem:1,maxRem:1.25},fontSizeH3:{minRem:1.125,maxRem:1.5},fontSizeH2:{minRem:1.25,maxRem:1.75},fontSizeH1:{minRem:1.5,maxRem:2},fontWeightNormal:"400",fontWeightBold:"700",fontWeightTitle:"700",lineHeightDefault:"1.5",lineHeightSnug:"1.375",lineHeightTight:"1.25",borderRadius:{minRem:.5,maxRem:.75},lineColor:"color-mix(in srgb, var(--color-brand-950) 20%, transparent)",boxShadow:"0px 0px 2px rgba(0, 0, 0, 0.15), 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)"},components:{body:{background:"var(--color-grey-0)",color:"var(--color-grey-900)",focus:{color:"var(--color-highlight-500)"},custom:{selectionColor:"var(--color-grey-0)",selectionBackground:"var(--color-brand-700)",focusWidth:"var(--spacer-3)",focusOffset:"var(--spacer-2)",focusStyle:"solid"}},container:{custom:{maxWidth:"1024px"}},avatar:{color:"var(--color-brand-400)",background:"var(--color-grey-100)"},anchor:{color:"var(--color-brand-700)",hover:{color:"var(--color-brand-950)"}},btnPrimary:{color:"var(--color-grey-0)",background:"var(--color-brand-700)",borderRadius:"var(--base-border-radius)",hover:{background:"var(--color-brand-900)"}},btnSecondary:{color:"var(--color-brand-700)",background:"var(--color-brand-100)",borderRadius:"var(--base-border-radius)",hover:{color:"var(--color-grey-1000)",background:"var(--color-brand-200)"}},btnTertiary:{color:"var(--anchor-color)",background:"transparent",borderRadius:"var(--base-border-radius)",hover:{color:"var(--anchor-hover-color)"}},card:{color:"var(--color-grey-900)",background:"var(--color-grey-100)",borderRadius:"var(--base-border-radius)",boxShadow:"none",hover:{color:"var(--color-grey-1000)",background:"var(--color-brand-100)"},custom:{iconColor:"var(--anchor-color)",iconHoverColor:"var(--anchor-hover-color)"}},input:{background:"var(--color-grey-0)",borderColor:"var(--color-grey-300)",borderWidth:"1px",borderRadius:"var(--base-border-radius)",custom:{padding:"var(--spacer-r-16) var(--spacer-r-20)",placeholderColor:"var(--color-grey-500)",placeholderOpacity:"1"}},label:{color:"var(--color-grey-600)"},hr:{color:"var(--base-line-color)"},checkbox:{color:"transparent",background:"var(--color-grey-0)",borderColor:"var(--color-grey-300)",borderWidth:"1px",borderRadius:"0.2em",custom:{checkedColor:"var(--btn-primary-color)",checkedBorderColor:"var(--color-brand-700)",checkedBackground:"var(--color-brand-700)"}},radio:{color:"transparent",background:"var(--color-grey-0)",borderColor:"var(--color-grey-300)",borderWidth:"1px",custom:{checkedColor:"var(--btn-primary-color)",checkedBorderColor:"var(--color-brand-700)",checkedBackground:"var(--color-brand-700)"}},contextBox:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",boxShadow:"var(--base-box-shadow)",custom:{transitionDuration:200,transitionDelay:200,transitionY:8,titleColor:"var(--color-grey-1000)",titleFontWeight:"var(--base-font-weight-bold)",separatorColor:"var(--base-line-color)",errorColor:"var(--message-error-color)"}},contextBoxMenuItem:{background:"transparent",color:"var(--body-color)",borderRadius:"calc(var(--base-border-radius) / 2)",hover:{color:"var(--btn-secondary-hover-color)",background:"var(--btn-secondary-hover-background)"},custom:{activeColor:"var(--btn-secondary-hover-color)",activeBackground:"var(--btn-secondary-hover-background)"}},chatFooter:{color:"var(--color-grey-400)",background:"var(--body-background)",borderRadius:"var(--base-border-radius)",boxShadow:"0px -10px 20px 5px color-mix(in srgb, var(--body-background) 90%, transparent)"},chatInput:{color:"var(--color-grey-700)",background:"var(--card-background)",borderRadius:"var(--base-border-radius)",borderColor:"transparent",borderWidth:"3px",hover:{background:"var(--card-hover-background)"},focus:{borderColor:"var(--body-focus-color)"}},chatInputSubmit:{color:"var(--btn-primary-color)",background:"var(--btn-primary-background)",borderRadius:"calc(var(--base-border-radius) / 1.25)",hover:{color:"var(--btn-primary-hover-color)",background:"var(--btn-primary-hover-background)"},custom:{strokeWidth:"2",deactivatedBackground:"var(--color-grey-500)",deactivatedOpacity:"0.25",deactivatedScale:"0.8",deactivatedBorderColor:"var(--color-grey-500)"}},chatInputNotification:{background:"#DD135A",color:"var(--color-grey-0)",borderColor:"#DD135A",borderWidth:"1px",borderRadius:"var(--chat-input-border-radius)"},dialog:{background:"var(--card-background)",color:"var(--body-color)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",boxShadow:"var(--base-box-shadow)",custom:{transitionDuration:200,transitionDelay:0,transitionY:30,backgroundOverlay:"rgba(0, 0, 0, 0.25)",headerBorderBottomColor:"var(--base-line-color)"}},aside:{background:"var(--card-background)",custom:{width:"400px",containerWidthForMobileLayout:1024,backgroundOverlay:"rgba(0, 0, 0, 0.4)",headerColor:"var(--card-color)",headerBorderColor:"var(--base-line-color)",headerBorderWidth:"1px"}},message:{color:"var(--body-color)",custom:{errorColor:"#C91658",transitionDuration:300,transitionDelay:0,transitionY:30,transitionBotLoadingDelay:300}},messageOptions:{borderColor:"var(--base-line-color)",borderWidth:"1px",custom:{transitionDuration:300,transitionDelay:0,transitionY:30}},messageUser:{color:"var(--body-color)",background:"var(--card-background)",boxShadow:"var(--card-box-shadow)",borderRadius:"var(--card-border-radius)"},openButton:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-background)",borderWidth:"0",borderRadius:"calc(var(--base-border-radius) / 2)",hover:{color:"var(--card-hover-color)",background:"var(--card-hover-background)"},custom:{hideTitleWhenCollapsed:0,autoExpandScrollThreshold:0,autoCollapseDelay:0,autoExpandOnce:0}},referencesToggle:{color:"var(--color-brand-700)",hover:{color:"var(--anchor-hover-color)"}},referenceNumberTrigger:{color:"var(--btn-secondary-color)",background:"var(--btn-secondary-background)",borderRadius:"calc(var(--base-border-radius) / 2)",hover:{color:"var(--btn-secondary-hover-color)",background:"var(--btn-secondary-hover-background)"},custom:{padding:"0.25em"}},referenceDomain:{color:"var(--color-brand-700)",hover:{color:"var(--color-brand-800)"},custom:{padding:"0px"}},referenceNumberContent:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",hover:{color:"var(--card-hover-color)",background:"var(--card-hover-background)",borderColor:"var(--card-hover-border-color)",borderWidth:"var(--card-hover-border-width)"},boxShadow:"var(--base-box-shadow)",custom:{width:"95cqi",maxWidth:"450px",transitionDuration:200,transitionDelay:200,transitionY:8}},reference:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",hover:{color:"var(--card-hover-color)",background:"var(--body-background)",borderColor:"var(--card-hover-border-color)",borderWidth:"var(--card-hover-border-width)"}},referenceDescription:{color:"var(--reference-color)",hover:{color:"var(--reference-hover-color)"}},referenceNumber:{color:"var(--reference-number-trigger-color)",background:"var(--body-background)",borderColor:"var(--reference-number-trigger-border-color)",borderWidth:"var(--reference-number-trigger-border-width)",borderRadius:"var(--reference-number-trigger-border-radius)",hover:{color:"var(--reference-number-trigger-color)",background:"var(--reference-number-trigger-background)",borderColor:"var(--reference-number-trigger-border-color)",borderWidth:"var(--reference-number-trigger-border-width)"},custom:{padding:"var(--reference-number-trigger-padding)"}},toast:{background:"var(--card-background)",color:"var(--body-color)",boxShadow:"var(--base-box-shadow)",borderRadius:"var(--card-border-radius)",custom:{iconSuccessColor:"#22c55e",iconErrorColor:"#ef4444",iconWarningColor:"#f97316",iconInfoColor:"#3b82f6"}},tooltip:{background:"var(--color-grey-200)",color:"var(--body-color)",borderRadius:"calc(var(--base-border-radius) / 2)"},flyout:{custom:{backdropColor:"var(--color-brand-800)",backdropOpacity:"0.4",backdropDelayIn:"0",backdropDurationIn:"200",backdropDelayOut:"0",backdropDurationOut:"150",backdropBaseScaleIn:"1",backdropBaseScaleOut:"1",backdropTransformOrigin:"center",backdropScaleDirection:"scale"}}},svgs:{predefinedQuestion:`
|
|
68
|
+
`}tablerow({text:e}){return`<tr>
|
|
69
|
+
${e}</tr>
|
|
70
|
+
`}tablecell(e){const t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
|
|
71
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Pt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){const n=this.parser.parseInline(r),o=Ll(e);if(o===null)return n;e=o;let i='<a href="'+e+'"';return t&&(i+=' title="'+Pt(t)+'"'),i+=">"+n+"</a>",i}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));const o=Ll(e);if(o===null)return Pt(r);e=o;let i=`<img src="${e}" alt="${r}"`;return t&&(i+=` title="${Pt(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Pt(e.text)}},Bi=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Kt=class Ca{options;renderer;textRenderer;constructor(t){this.options=t||Or,this.options.renderer=this.options.renderer||new bo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Bi}static parse(t,r){return new Ca(r).parse(t)}static parseInline(t,r){return new Ca(r).parseInline(t)}parse(t,r=!0){let n="";for(let o=0;o<t.length;o++){const i=t[o];if(this.options.extensions?.renderers?.[i.type]){const s=i,l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){n+=l||"";continue}}const a=i;switch(a.type){case"space":{n+=this.renderer.space(a);continue}case"hr":{n+=this.renderer.hr(a);continue}case"heading":{n+=this.renderer.heading(a);continue}case"code":{n+=this.renderer.code(a);continue}case"table":{n+=this.renderer.table(a);continue}case"blockquote":{n+=this.renderer.blockquote(a);continue}case"list":{n+=this.renderer.list(a);continue}case"html":{n+=this.renderer.html(a);continue}case"paragraph":{n+=this.renderer.paragraph(a);continue}case"text":{let s=a,l=this.renderer.text(s);for(;o+1<t.length&&t[o+1].type==="text";)s=t[++o],l+=`
|
|
72
|
+
`+this.renderer.text(s);r?n+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):n+=l;continue}default:{const s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(t,r=this.renderer){let n="";for(let o=0;o<t.length;o++){const i=t[o];if(this.options.extensions?.renderers?.[i.type]){const s=this.options.extensions.renderers[i.type].call({parser:this},i);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=s||"";continue}}const a=i;switch(a.type){case"escape":{n+=r.text(a);break}case"html":{n+=r.html(a);break}case"link":{n+=r.link(a);break}case"image":{n+=r.image(a);break}case"strong":{n+=r.strong(a);break}case"em":{n+=r.em(a);break}case"codespan":{n+=r.codespan(a);break}case"br":{n+=r.br(a);break}case"del":{n+=r.del(a);break}case"text":{n+=r.text(a);break}default:{const s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}},ko=class{options;block;constructor(e){this.options=e||Or}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Jt.lex:Jt.lexInline}provideParser(){return this.block?Kt.parse:Kt.parseInline}},Ml=class{defaults=Oi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Kt;Renderer=bo;TextRenderer=Bi;Lexer=Jt;Tokenizer=vo;Hooks=ko;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(const n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":{const o=n;for(const i of o.header)r=r.concat(this.walkTokens(i.tokens,t));for(const i of o.rows)for(const a of i)r=r.concat(this.walkTokens(a.tokens,t));break}case"list":{const o=n;r=r.concat(this.walkTokens(o.items,t));break}default:{const o=n;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(i=>{const a=o[i].flat(1/0);r=r.concat(this.walkTokens(a,t))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{const n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const i=t.renderers[o.name];i?t.renderers[o.name]=function(...a){let s=o.renderer.apply(this,a);return s===!1&&(s=i.apply(this,a)),s}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=t[o.level];i?i.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),n.extensions=t),r.renderer){const o=this.defaults.renderer||new bo(this.defaults);for(const i in r.renderer){if(!(i in o))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=i,s=r.renderer[a],l=o[a];o[a]=(...c)=>{let u=s.apply(o,c);return u===!1&&(u=l.apply(o,c)),u||""}}n.renderer=o}if(r.tokenizer){const o=this.defaults.tokenizer||new vo(this.defaults);for(const i in r.tokenizer){if(!(i in o))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=i,s=r.tokenizer[a],l=o[a];o[a]=(...c)=>{let u=s.apply(o,c);return u===!1&&(u=l.apply(o,c)),u}}n.tokenizer=o}if(r.hooks){const o=this.defaults.hooks||new ko;for(const i in r.hooks){if(!(i in o))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=i,s=r.hooks[a],l=o[a];ko.passThroughHooks.has(i)?o[a]=c=>{if(this.defaults.async)return Promise.resolve(s.call(o,c)).then(h=>l.call(o,h));const u=s.call(o,c);return l.call(o,u)}:o[a]=(...c)=>{let u=s.apply(o,c);return u===!1&&(u=l.apply(o,c)),u}}n.hooks=o}if(r.walkTokens){const o=this.defaults.walkTokens,i=r.walkTokens;n.walkTokens=function(a){let s=[];return s.push(i.call(this,a)),o&&(s=s.concat(o.call(this,a))),s}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Jt.lex(e,t??this.defaults)}parser(e,t){return Kt.parse(e,t??this.defaults)}parseMarkdown(e){return(r,n)=>{const o={...n},i={...this.defaults,...o},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&o.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);const s=i.hooks?i.hooks.provideLexer():e?Jt.lex:Jt.lexInline,l=i.hooks?i.hooks.provideParser():e?Kt.parse:Kt.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(r):r).then(c=>s(c,i)).then(c=>i.hooks?i.hooks.processAllTokens(c):c).then(c=>i.walkTokens?Promise.all(this.walkTokens(c,i.walkTokens)).then(()=>c):c).then(c=>l(c,i)).then(c=>i.hooks?i.hooks.postprocess(c):c).catch(a);try{i.hooks&&(r=i.hooks.preprocess(r));let c=s(r,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let u=l(c,i);return i.hooks&&(u=i.hooks.postprocess(u)),u}catch(c){return a(c)}}}onError(e,t){return r=>{if(r.message+=`
|
|
73
|
+
Please report this to https://github.com/markedjs/marked.`,e){const n="<p>An error occurred:</p><pre>"+Pt(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},$r=new Ml;function G(e,t){return $r.parse(e,t)}G.options=G.setOptions=function(e){return $r.setOptions(e),G.defaults=$r.defaults,_l(G.defaults),G},G.getDefaults=Oi,G.defaults=Or,G.use=function(...e){return $r.use(...e),G.defaults=$r.defaults,_l(G.defaults),G},G.walkTokens=function(e,t){return $r.walkTokens(e,t)},G.parseInline=$r.parseInline,G.Parser=Kt,G.parser=Kt.parse,G.Renderer=bo,G.TextRenderer=Bi,G.Lexer=Jt,G.lexer=Jt.lex,G.Tokenizer=vo,G.Hooks=ko,G.parse=G,G.options,G.setOptions,G.use,G.walkTokens,G.parseInline,Kt.parse,Jt.lex;const Fl=e=>(Object.getOwnPropertyNames(e).forEach(t=>{const r=e[t];r&&typeof r=="object"&&Fl(r)}),Object.freeze(e)),jl=Fl({all:[],used:[],unused:[]}),ip=(e,t)=>{const r=Sf(e);return r.addHook("uponSanitizeElement",function(n,o){const i=o.tagName||n.nodeName.toLowerCase();i.startsWith("liipgpt-")&&(o.allowedTags[i]=!0)}),r.addHook("afterSanitizeAttributes",function(n){if(n.tagName!=="A"||!n.getAttribute("href")?.startsWith("http")||(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"),!t||n.querySelector(".sr-only")))return;const o=n.ownerDocument.createElement("span");o.className="sr-only",o.textContent=` ${t}`,n.appendChild(o)}),r};class Bl{marked;currentReferences=jl;lastUsedIndex=0;DomPurity;constructor(t={}){this.marked=new Ml({async:!1,breaks:!0}).use(this.createFootnoteExtension(),...t.extensions??[]),this.DomPurity=ip(t.window,t.newTabSrText)}createFootnoteExtension=()=>{const t=this;return{extensions:[{name:"footnote",level:"inline",start(r){return r.match(/\[\^(\d+)\]/)?.index},tokenizer(r){const o=/^\[\^(\d+)\]/.exec(r);if(o){const[i,a]=o;return{type:"footnote",raw:i,refNumber:a}}},renderer(r){if(r.type==="footnote"){const n=parseInt(r.refNumber)-1,o=t.currentReferences.all[n];if(!o)return console.error("Could not find ref with index:",n),"";let i;return o?.referenceIndex.used?i=o.referenceIndex.used:(t.currentReferences.used.push(o),t.lastUsedIndex++,i=t.lastUsedIndex,o.referenceIndex.used=i),` <liipgpt-reference-number data-all-index="${n}" data-used-index="${i}" data-source="${JSON.stringify(o).replace(/"/g,""")}"></liipgpt-reference-number>`}}}]}};parse(t){return this.DomPurity.sanitize(this.marked.parse(t),{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0,mathMl:!0},FORBID_TAGS:["hr"],ADD_ATTR:["target"]})}toHTML(t,r){this.currentReferences=r;const n=this.parse(t);return this.currentReferences=jl,n}}function ap(){let e,t;return{promise:new Promise((n,o)=>{t=n,e=o}),reject:e,resolve:t}}class Zl{promise;resolve;reject;constructor(){const{promise:t,resolve:r,reject:n}=ap();this.promise=t,this.resolve=r,this.reject=n}then(t,r){return this.promise.then(t,r)}catch(t){return this.promise.catch(t)}finally(t){return this.promise.finally(t)}toPromise(){return this.promise}[Symbol.toStringTag]="Flag"}class Zi{hasValue=new Zl;currentValue;setValue(t){this.currentValue=t,this.hasValue.resolve()}cleanup(t){this.hasValue.reject(t)}getCurrentValue(){return this.currentValue}async toPromise(){return await this.hasValue,this.currentValue}then(t,r){return this.toPromise().then(t,r)}catch(t){return this.toPromise().catch(t)}finally(t){return this.toPromise().finally(t)}[Symbol.toStringTag]="FutureValue"}const sp=e=>{try{return new URL(e).hostname}catch{return e}};function lp(e){return e.replace(/<[^>]*>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')}const cp=({url:e,considered:t,title:r,description:n,summary:o})=>{const i=sp(e);return{url:e,considered:t,referenceIndex:{},score:0,metadata:{},display:{card:{title:r,description:n||o,badge:e},listItem:{title:r,badge:i}}}};class up{constructor(t){this.options=t,this.store=qh({id:t.id,state:"loading",errors:[],type:"bot",time:new Date().toISOString(),message:{markdown:"",html:"",text:""},references:{all:[],used:[],unused:[]},retrievalQuestion:t.userQuestion})}store;content=new Zi;backendSendsMappedRefs=!1;pushError(t){this.options.onError?.(t),this.store.update(r=>({...r,errors:[...r.errors,t]}))}updateRequestId(t){this.store.update(r=>({...r,id:t}))}updateText(t){this.store.update(r=>{const n=r.message.markdown+t,o=this.options.markdownRenderer.toHTML(n,r.references);return{...r,state:"streaming",message:{markdown:n,html:o,text:""}}})}finishMessage(){this.store.update(t=>{const r={...t,state:"done"};return r.references.unused=r.references.all.filter(n=>n.referenceIndex.used===void 0),r.message.text=lp(r.message.html),this.options?.onFinish?.(r),this.content.setValue(r),r})}addReference(t){this.store.update(r=>{const n=r.references.all,o=n.length,i=[...n,{...t,referenceIndex:{all:o}}];return{...r,references:{used:r.references.used,all:i}}})}addMappedReference(t){this.backendSendsMappedRefs=!0,this.addReference(t)}addOldReference(t){this.backendSendsMappedRefs||this.addReference(cp(t))}updateRetrievalQuestion(t){this.store.update(r=>({...r,retrievalQuestion:t}))}getReadableStore(){return{subscribe:this.store.subscribe}}getPromise(){return this.content.toPromise()}}function k(e,t,r){function n(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,l);const c=a.prototype,u=Object.keys(c);for(let h=0;h<u.length;h++){const f=u[h];f in s||(s[f]=c[f].bind(s))}}const o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function a(s){var l;const c=r?.Parent?new i:this;n(c,s),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class Qr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ul extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const ql={};function mr(e){return ql}function Vl(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Ui(e,t){return typeof t=="bigint"?t.toString():t}function wo(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function qi(e){return e==null}function Vi(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function dp(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let o=(n.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(n)){const l=n.match(/\d?e-(\d?)/);l?.[1]&&(o=Number.parseInt(l[1]))}const i=r>o?r:o,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return a%s/10**i}const Hl=Symbol("evaluating");function q(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Hl)return n===void 0&&(n=Hl,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Pr(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function vr(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Gl(e){return JSON.stringify(e)}function hp(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Wl="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ln(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const fp=wo(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Yr(e){if(Ln(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(Ln(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ql(e){return Yr(e)?{...e}:Array.isArray(e)?[...e]:e}const pp=new Set(["string","number","symbol"]);function Jr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xt(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function I(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function gp(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const mp={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function vp(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=vr(e._zod.def,{get shape(){const a={};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return Pr(this,"shape",a),a},checks:[]});return Xt(e,i)}function bp(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=vr(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return Pr(this,"shape",a),a},checks:[]});return Xt(e,i)}function kp(e,t){if(!Yr(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const i=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=vr(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Pr(this,"shape",i),i}});return Xt(e,o)}function wp(e,t){if(!Yr(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=vr(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Pr(this,"shape",n),n}});return Xt(e,r)}function yp(e,t){const r=vr(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Pr(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Xt(e,r)}function _p(e,t,r){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=vr(t._zod.def,{get shape(){const s=t._zod.def.shape,l={...s};if(r)for(const c in r){if(!(c in s))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(l[c]=e?new e({type:"optional",innerType:s[c]}):s[c])}else for(const c in s)l[c]=e?new e({type:"optional",innerType:s[c]}):s[c];return Pr(this,"shape",l),l},checks:[]});return Xt(t,a)}function Sp(e,t,r){const n=vr(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(r)for(const a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a in o)i[a]=new e({type:"nonoptional",innerType:o[a]});return Pr(this,"shape",i),i}});return Xt(t,n)}function Kr(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Xr(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function yo(e){return typeof e=="string"?e:e?.message}function br(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const o=yo(e.inst?._zod.def?.error?.(e))??yo(t?.error?.(e))??yo(r.customError?.(e))??yo(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Hi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Dn(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const Yl=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ui,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Jl=k("$ZodError",Yl),Kl=k("$ZodError",Yl,{Parent:Error});function xp(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function Tp(e,t=r=>r.message){const r={_errors:[]},n=o=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>n({issues:a}));else if(i.code==="invalid_key")n({issues:i.issues});else if(i.code==="invalid_element")n({issues:i.issues});else if(i.path.length===0)r._errors.push(t(i));else{let a=r,s=0;for(;s<i.path.length;){const l=i.path[s];s===i.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(i))):a[l]=a[l]||{_errors:[]},a=a[l],s++}}};return n(e),r}const Gi=e=>(t,r,n,o)=>{const i=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Qr;if(a.issues.length){const s=new(o?.Err??e)(a.issues.map(l=>br(l,i,mr())));throw Wl(s,o?.callee),s}return a.value},Wi=e=>async(t,r,n,o)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const s=new(o?.Err??e)(a.issues.map(l=>br(l,i,mr())));throw Wl(s,o?.callee),s}return a.value},_o=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Qr;return i.issues.length?{success:!1,error:new(e??Jl)(i.issues.map(a=>br(a,o,mr())))}:{success:!0,data:i.value}},Ep=_o(Kl),So=e=>async(t,r,n)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>br(a,o,mr())))}:{success:!0,data:i.value}},Ap=So(Kl),Cp=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Gi(e)(t,r,o)},Rp=e=>(t,r,n)=>Gi(e)(t,r,n),zp=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Wi(e)(t,r,o)},Ip=e=>async(t,r,n)=>Wi(e)(t,r,n),Op=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return _o(e)(t,r,o)},$p=e=>(t,r,n)=>_o(e)(t,r,n),Pp=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return So(e)(t,r,o)},Lp=e=>async(t,r,n)=>So(e)(t,r,n),Dp=/^[cC][^\s-]{8,}$/,Np=/^[0-9a-z]+$/,Mp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Fp=/^[0-9a-vA-V]{20}$/,jp=/^[A-Za-z0-9]{27}$/,Bp=/^[a-zA-Z0-9_-]{21}$/,Zp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Up=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Xl=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,qp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Vp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Hp(){return new RegExp(Vp,"u")}const Gp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Wp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Qp=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Yp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Jp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ec=/^[A-Za-z0-9_-]*$/,Kp=/^\+[1-9]\d{6,14}$/,tc="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Xp=new RegExp(`^${tc}$`);function rc(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function e0(e){return new RegExp(`^${rc(e)}$`)}function t0(e){const t=rc({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${tc}T(?:${n})$`)}const r0=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},n0=/^-?\d+$/,nc=/^-?\d+(?:\.\d+)?$/,o0=/^(?:true|false)$/i,i0=/^[^A-Z]*$/,a0=/^[^a-z]*$/,We=k("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),oc={number:"number",bigint:"bigint",object:"date"},ic=k("$ZodCheckLessThan",(e,t)=>{We.init(e,t);const r=oc[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ac=k("$ZodCheckGreaterThan",(e,t)=>{We.init(e,t);const r=oc[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),s0=k("$ZodCheckMultipleOf",(e,t)=>{We.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):dp(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),l0=k("$ZodCheckNumberFormat",(e,t)=>{We.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[o,i]=mp[t.format];e._zod.onattach.push(a=>{const s=a._zod.bag;s.format=t.format,s.minimum=o,s.maximum=i,r&&(s.pattern=n0)}),e._zod.check=a=>{const s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}s<o&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),c0=k("$ZodCheckMaxLength",(e,t)=>{var r;We.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!qi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const o=n.value;if(o.length<=t.maximum)return;const a=Hi(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),u0=k("$ZodCheckMinLength",(e,t)=>{var r;We.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!qi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const a=Hi(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),d0=k("$ZodCheckLengthEquals",(e,t)=>{var r;We.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!qi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,i=o.length;if(i===t.length)return;const a=Hi(o),s=i>t.length;n.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),xo=k("$ZodCheckStringFormat",(e,t)=>{var r,n;We.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),h0=k("$ZodCheckRegex",(e,t)=>{xo.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),f0=k("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=i0),xo.init(e,t)}),p0=k("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=a0),xo.init(e,t)}),g0=k("$ZodCheckIncludes",(e,t)=>{We.init(e,t);const r=Jr(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),m0=k("$ZodCheckStartsWith",(e,t)=>{We.init(e,t);const r=new RegExp(`^${Jr(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),v0=k("$ZodCheckEndsWith",(e,t)=>{We.init(e,t);const r=new RegExp(`.*${Jr(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),b0=k("$ZodCheckOverwrite",(e,t)=>{We.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class k0{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
|
|
74
|
+
`).filter(a=>a),o=Math.min(...n.map(a=>a.length-a.trimStart().length)),i=n.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(const a of i)this.content.push(a)}compile(){const t=Function,r=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,o.join(`
|
|
75
|
+
`))}}const w0={major:4,minor:3,patch:6},te=k("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=w0;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const o of n)for(const i of o._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(a,s,l)=>{let c=Kr(a),u;for(const h of s){if(h._zod.def.when){if(!h._zod.def.when(a))continue}else if(c)continue;const f=a.issues.length,v=h._zod.check(a);if(v instanceof Promise&&l?.async===!1)throw new Qr;if(u||v instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await v,a.issues.length!==f&&(c||(c=Kr(a,f)))});else{if(a.issues.length===f)continue;c||(c=Kr(a,f))}}return u?u.then(()=>a):a},i=(a,s,l)=>{if(Kr(a))return a.aborted=!0,a;const c=o(s,n,l);if(c instanceof Promise){if(l.async===!1)throw new Qr;return c.then(u=>e._zod.parse(u,l))}return e._zod.parse(c,l)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){const c=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return c instanceof Promise?c.then(u=>i(u,a,s)):i(c,a,s)}const l=e._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new Qr;return l.then(c=>o(c,n,s))}return o(l,n,s)}}q(e,"~standard",()=>({validate:o=>{try{const i=Ep(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Ap(e,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Qi=k("$ZodString",(e,t)=>{te.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??r0(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),K=k("$ZodStringFormat",(e,t)=>{xo.init(e,t),Qi.init(e,t)}),y0=k("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Up),K.init(e,t)}),_0=k("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Xl(n))}else t.pattern??(t.pattern=Xl());K.init(e,t)}),S0=k("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=qp),K.init(e,t)}),x0=k("$ZodURL",(e,t)=>{K.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),T0=k("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Hp()),K.init(e,t)}),E0=k("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Bp),K.init(e,t)}),A0=k("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Dp),K.init(e,t)}),C0=k("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Np),K.init(e,t)}),R0=k("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Mp),K.init(e,t)}),z0=k("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Fp),K.init(e,t)}),I0=k("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=jp),K.init(e,t)}),O0=k("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=t0(t)),K.init(e,t)}),$0=k("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Xp),K.init(e,t)}),P0=k("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=e0(t)),K.init(e,t)}),L0=k("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Zp),K.init(e,t)}),D0=k("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Gp),K.init(e,t),e._zod.bag.format="ipv4"}),N0=k("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Wp),K.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),M0=k("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Qp),K.init(e,t)}),F0=k("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yp),K.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[o,i]=n;if(!i)throw new Error;const a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function sc(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const j0=k("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Jp),K.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{sc(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function B0(e){if(!ec.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return sc(r)}const Z0=k("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ec),K.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{B0(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),U0=k("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Kp),K.init(e,t)});function q0(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const V0=k("$ZodJWT",(e,t)=>{K.init(e,t),e._zod.check=r=>{q0(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),lc=k("$ZodNumber",(e,t)=>{te.init(e,t),e._zod.pattern=e._zod.bag.pattern??nc,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),H0=k("$ZodNumberFormat",(e,t)=>{l0.init(e,t),lc.init(e,t)}),G0=k("$ZodBoolean",(e,t)=>{te.init(e,t),e._zod.pattern=o0,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),W0=k("$ZodUnknown",(e,t)=>{te.init(e,t),e._zod.parse=r=>r}),Q0=k("$ZodNever",(e,t)=>{te.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function cc(e,t,r){e.issues.length&&t.issues.push(...Xr(r,e.issues)),t.value[r]=e.value}const Y0=k("$ZodArray",(e,t)=>{te.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const i=[];for(let a=0;a<o.length;a++){const s=o[a],l=t.element._zod.run({value:s,issues:[]},n);l instanceof Promise?i.push(l.then(c=>cc(c,r,a))):cc(l,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function To(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Xr(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function uc(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const r=gp(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function dc(e,t,r,n,o,i){const a=[],s=o.keySet,l=o.catchall._zod,c=l.def.type,u=l.optout==="optional";for(const h in t){if(s.has(h))continue;if(c==="never"){a.push(h);continue}const f=l.run({value:t[h],issues:[]},n);f instanceof Promise?e.push(f.then(v=>To(v,r,h,t,u))):To(f,r,h,t,u)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}const J0=k("$ZodObject",(e,t)=>{if(te.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const s=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...s};return Object.defineProperty(t,"shape",{value:l}),l}})}const n=wo(()=>uc(t));q(e._zod,"propValues",()=>{const s=t.shape,l={};for(const c in s){const u=s[c]._zod;if(u.values){l[c]??(l[c]=new Set);for(const h of u.values)l[c].add(h)}}return l});const o=Ln,i=t.catchall;let a;e._zod.parse=(s,l)=>{a??(a=n.value);const c=s.value;if(!o(c))return s.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),s;s.value={};const u=[],h=a.shape;for(const f of a.keys){const v=h[f],g=v._zod.optout==="optional",b=v._zod.run({value:c[f],issues:[]},l);b instanceof Promise?u.push(b.then(A=>To(A,s,f,c,g))):To(b,s,f,c,g)}return i?dc(u,c,s,l,n.value,e):u.length?Promise.all(u).then(()=>s):s}}),K0=k("$ZodObjectJIT",(e,t)=>{J0.init(e,t);const r=e._zod.parse,n=wo(()=>uc(t)),o=f=>{const v=new k0(["shape","payload","ctx"]),g=n.value,b=S=>{const T=Gl(S);return`shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`};v.write("const input = payload.value;");const A=Object.create(null);let w=0;for(const S of g.keys)A[S]=`key_${w++}`;v.write("const newResult = {};");for(const S of g.keys){const T=A[S],C=Gl(S),D=f[S]?._zod?.optout==="optional";v.write(`const ${T} = ${b(S)};`),D?v.write(`
|
|
76
|
+
if (${T}.issues.length) {
|
|
77
|
+
if (${C} in input) {
|
|
78
|
+
payload.issues = payload.issues.concat(${T}.issues.map(iss => ({
|
|
79
|
+
...iss,
|
|
80
|
+
path: iss.path ? [${C}, ...iss.path] : [${C}]
|
|
81
|
+
})));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (${T}.value === undefined) {
|
|
86
|
+
if (${C} in input) {
|
|
87
|
+
newResult[${C}] = undefined;
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
newResult[${C}] = ${T}.value;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
`):v.write(`
|
|
94
|
+
if (${T}.issues.length) {
|
|
95
|
+
payload.issues = payload.issues.concat(${T}.issues.map(iss => ({
|
|
96
|
+
...iss,
|
|
97
|
+
path: iss.path ? [${C}, ...iss.path] : [${C}]
|
|
98
|
+
})));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (${T}.value === undefined) {
|
|
102
|
+
if (${C} in input) {
|
|
103
|
+
newResult[${C}] = undefined;
|
|
104
|
+
}
|
|
105
|
+
} else {
|
|
106
|
+
newResult[${C}] = ${T}.value;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");const _=v.compile();return(S,T)=>_(f,S,T)};let i;const a=Ln,s=!ql.jitless,c=s&&fp.value,u=t.catchall;let h;e._zod.parse=(f,v)=>{h??(h=n.value);const g=f.value;return a(g)?s&&c&&v?.async===!1&&v.jitless!==!0?(i||(i=o(t.shape)),f=i(f,v),u?dc([],g,f,v,h,e):f):r(f,v):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),f)}});function hc(e,t,r,n){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!Kr(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>br(a,n,mr())))}),t)}const fc=k("$ZodUnion",(e,t)=>{te.init(e,t),q(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),q(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),q(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),q(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Vi(i.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(r)return n(o,i);let a=!1;const s=[];for(const l of t.options){const c=l._zod.run({value:o.value,issues:[]},i);if(c instanceof Promise)s.push(c),a=!0;else{if(c.issues.length===0)return c;s.push(c)}}return a?Promise.all(s).then(l=>hc(l,o,e,i)):hc(s,o,e,i)}}),X0=k("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,fc.init(e,t);const r=e._zod.parse;q(e._zod,"propValues",()=>{const o={};for(const i of t.options){const a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[s,l]of Object.entries(a)){o[s]||(o[s]=new Set);for(const c of l)o[s].add(c)}}return o});const n=wo(()=>{const o=t.options,i=new Map;for(const a of o){const s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const l of s){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,a)}}return i});e._zod.parse=(o,i)=>{const a=o.value;if(!Ln(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),o;const s=n.value.get(a?.[t.discriminator]);return s?s._zod.run(o,i):t.unionFallback?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),o)}}),eg=k("$ZodIntersection",(e,t)=>{te.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,i=t.left._zod.run({value:o,issues:[]},n),a=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,c])=>pc(r,l,c)):pc(r,i,a)}});function Yi(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Yr(e)&&Yr(t)){const r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};for(const i of n){const a=Yi(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],i=t[n],a=Yi(o,i);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function pc(e,t,r){const n=new Map;let o;for(const s of t.issues)if(s.code==="unrecognized_keys"){o??(o=s);for(const l of s.keys)n.has(l)||n.set(l,{}),n.get(l).l=!0}else e.issues.push(s);for(const s of r.issues)if(s.code==="unrecognized_keys")for(const l of s.keys)n.has(l)||n.set(l,{}),n.get(l).r=!0;else e.issues.push(s);const i=[...n].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&o&&e.issues.push({...o,keys:i}),Kr(e))return e;const a=Yi(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const tg=k("$ZodRecord",(e,t)=>{te.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Yr(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;const i=[],a=t.keyType._zod.values;if(a){r.value={};const s=new Set;for(const c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){s.add(typeof c=="number"?c.toString():c);const u=t.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?i.push(u.then(h=>{h.issues.length&&r.issues.push(...Xr(c,h.issues)),r.value[c]=h.value})):(u.issues.length&&r.issues.push(...Xr(c,u.issues)),r.value[c]=u.value)}let l;for(const c in o)s.has(c)||(l=l??[],l.push(c));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{r.value={};for(const s of Reflect.ownKeys(o)){if(s==="__proto__")continue;let l=t.keyType._zod.run({value:s,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&nc.test(s)&&l.issues.length){const h=t.keyType._zod.run({value:Number(s),issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h)}if(l.issues.length){t.mode==="loose"?r.value[s]=o[s]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>br(h,n,mr())),input:s,path:[s],inst:e});continue}const u=t.valueType._zod.run({value:o[s],issues:[]},n);u instanceof Promise?i.push(u.then(h=>{h.issues.length&&r.issues.push(...Xr(s,h.issues)),r.value[l.value]=h.value})):(u.issues.length&&r.issues.push(...Xr(s,u.issues)),r.value[l.value]=u.value)}}return i.length?Promise.all(i).then(()=>r):r}}),rg=k("$ZodEnum",(e,t)=>{te.init(e,t);const r=Vl(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>pp.has(typeof o)).map(o=>typeof o=="string"?Jr(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const a=o.value;return n.has(a)||o.issues.push({code:"invalid_value",values:r,input:a,inst:e}),o}}),ng=k("$ZodLiteral",(e,t)=>{if(te.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Jr(n):n?Jr(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{const i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),og=k("$ZodTransform",(e,t)=>{te.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ul(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(r.value=a,r));if(o instanceof Promise)throw new Qr;return r.value=o,r}});function gc(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const mc=k("$ZodOptional",(e,t)=>{te.init(e,t),e._zod.optin="optional",e._zod.optout="optional",q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Vi(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>gc(i,r.value)):gc(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),ig=k("$ZodExactOptional",(e,t)=>{mc.init(e,t),q(e._zod,"values",()=>t.innerType._zod.values),q(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),ag=k("$ZodNullable",(e,t)=>{te.init(e,t),q(e._zod,"optin",()=>t.innerType._zod.optin),q(e._zod,"optout",()=>t.innerType._zod.optout),q(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Vi(r.source)}|null)$`):void 0}),q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),sg=k("$ZodDefault",(e,t)=>{te.init(e,t),e._zod.optin="optional",q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>vc(i,t)):vc(o,t)}});function vc(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const lg=k("$ZodPrefault",(e,t)=>{te.init(e,t),e._zod.optin="optional",q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),cg=k("$ZodNonOptional",(e,t)=>{te.init(e,t),q(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>bc(i,e)):bc(o,e)}});function bc(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ug=k("$ZodCatch",(e,t)=>{te.init(e,t),q(e._zod,"optin",()=>t.innerType._zod.optin),q(e._zod,"optout",()=>t.innerType._zod.optout),q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>br(a,n,mr()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>br(i,n,mr()))},input:r.value}),r.issues=[]),r)}}),dg=k("$ZodPipe",(e,t)=>{te.init(e,t),q(e._zod,"values",()=>t.in._zod.values),q(e._zod,"optin",()=>t.in._zod.optin),q(e._zod,"optout",()=>t.out._zod.optout),q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const i=t.out._zod.run(r,n);return i instanceof Promise?i.then(a=>Eo(a,t.in,n)):Eo(i,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Eo(i,t.out,n)):Eo(o,t.out,n)}});function Eo(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const hg=k("$ZodReadonly",(e,t)=>{te.init(e,t),q(e._zod,"propValues",()=>t.innerType._zod.propValues),q(e._zod,"values",()=>t.innerType._zod.values),q(e._zod,"optin",()=>t.innerType?._zod?.optin),q(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(kc):kc(o)}});function kc(e){return e.value=Object.freeze(e.value),e}const fg=k("$ZodCustom",(e,t)=>{We.init(e,t),te.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>wc(i,r,n,e));wc(o,r,n,e)}});function wc(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Dn(o))}}var yc;class pg{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function gg(){return new pg}(yc=globalThis).__zod_globalRegistry??(yc.__zod_globalRegistry=gg());const Nn=globalThis.__zod_globalRegistry;function mg(e,t){return new e({type:"string",...I(t)})}function vg(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...I(t)})}function _c(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...I(t)})}function bg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...I(t)})}function kg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...I(t)})}function wg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...I(t)})}function yg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...I(t)})}function _g(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...I(t)})}function Sg(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...I(t)})}function xg(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...I(t)})}function Tg(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...I(t)})}function Eg(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...I(t)})}function Ag(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...I(t)})}function Cg(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...I(t)})}function Rg(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...I(t)})}function zg(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...I(t)})}function Ig(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...I(t)})}function Og(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...I(t)})}function $g(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...I(t)})}function Pg(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...I(t)})}function Lg(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...I(t)})}function Dg(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...I(t)})}function Ng(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...I(t)})}function Mg(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...I(t)})}function Fg(e,t){return new e({type:"string",format:"date",check:"string_format",...I(t)})}function jg(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...I(t)})}function Bg(e,t){return new e({type:"string",format:"duration",check:"string_format",...I(t)})}function Zg(e,t){return new e({type:"number",checks:[],...I(t)})}function Ug(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...I(t)})}function qg(e,t){return new e({type:"boolean",...I(t)})}function Vg(e){return new e({type:"unknown"})}function Hg(e,t){return new e({type:"never",...I(t)})}function Sc(e,t){return new ic({check:"less_than",...I(t),value:e,inclusive:!1})}function Ji(e,t){return new ic({check:"less_than",...I(t),value:e,inclusive:!0})}function xc(e,t){return new ac({check:"greater_than",...I(t),value:e,inclusive:!1})}function Ki(e,t){return new ac({check:"greater_than",...I(t),value:e,inclusive:!0})}function Tc(e,t){return new s0({check:"multiple_of",...I(t),value:e})}function Ec(e,t){return new c0({check:"max_length",...I(t),maximum:e})}function Ao(e,t){return new u0({check:"min_length",...I(t),minimum:e})}function Ac(e,t){return new d0({check:"length_equals",...I(t),length:e})}function Gg(e,t){return new h0({check:"string_format",format:"regex",...I(t),pattern:e})}function Wg(e){return new f0({check:"string_format",format:"lowercase",...I(e)})}function Qg(e){return new p0({check:"string_format",format:"uppercase",...I(e)})}function Yg(e,t){return new g0({check:"string_format",format:"includes",...I(t),includes:e})}function Jg(e,t){return new m0({check:"string_format",format:"starts_with",...I(t),prefix:e})}function Kg(e,t){return new v0({check:"string_format",format:"ends_with",...I(t),suffix:e})}function en(e){return new b0({check:"overwrite",tx:e})}function Xg(e){return en(t=>t.normalize(e))}function em(){return en(e=>e.trim())}function tm(){return en(e=>e.toLowerCase())}function rm(){return en(e=>e.toUpperCase())}function nm(){return en(e=>hp(e))}function om(e,t,r){return new e({type:"array",element:t,...I(r)})}function im(e,t,r){return new e({type:"custom",check:"custom",fn:t,...I(r)})}function am(e){const t=sm(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Dn(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(Dn(o))}},e(r.value,r)));return t}function sm(e,t){const r=new We({check:"custom",...I(t)});return r._zod.check=e,r}function Cc(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Nn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function he(e,t,r={path:[],schemaPath:[]}){var n;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);const s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{const u={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,u);else{const f=a.schema,v=t.processors[o.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);v(e,t,f,u)}const h=e._zod.parent;h&&(a.ref||(a.ref=h),he(h,t,u),t.seen.get(h).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&je(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Rc(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const a of e.seen.entries()){const s=e.metadataRegistry.get(a[0])?.id;if(s){const l=n.get(s);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(s,a[0])}}const o=a=>{const s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(a[0])?.id,f=e.external.uri??(g=>g);if(h)return{ref:f(h)};const v=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=v,{defId:v,ref:`${f("__shared")}#/${s}/${v}`}}if(a[1]===r)return{ref:"#"};const c=`#/${s}/`,u=a[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:c+u}},i=a=>{if(a[1].schema.$ref)return;const s=a[1],{ref:l,defId:c}=o(a);s.def={...s.schema},c&&(s.defId=c);const u=s.schema;for(const h in u)delete u[h];u.$ref=l};if(e.cycles==="throw")for(const a of e.seen.entries()){const s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
110
|
+
|
|
111
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const s=a[1];if(t===a[0]){i(a);continue}if(e.external){const c=e.external.registry.get(a[0])?.id;if(t!==a[0]&&c){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function zc(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=a=>{const s=e.seen.get(a);if(s.ref===null)return;const l=s.def??s.schema,c={...l},u=s.ref;if(s.ref=null,u){n(u);const f=e.seen.get(u),v=f.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(v)):Object.assign(l,v),Object.assign(l,c),a._zod.parent===u)for(const b in l)b==="$ref"||b==="allOf"||b in c||delete l[b];if(v.$ref&&f.def)for(const b in l)b==="$ref"||b==="allOf"||b in f.def&&JSON.stringify(l[b])===JSON.stringify(f.def[b])&&delete l[b]}const h=a._zod.parent;if(h&&h!==u){n(h);const f=e.seen.get(h);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(const v in l)v==="$ref"||v==="allOf"||v in f.def&&JSON.stringify(l[v])===JSON.stringify(f.def[v])&&delete l[v]}e.override({zodSchema:a,jsonSchema:l,path:s.path??[]})};for(const a of[...e.seen.entries()].reverse())n(a[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Object.assign(o,r.def??r.schema);const i=e.external?.defs??{};for(const a of e.seen.entries()){const s=a[1];s.def&&s.defId&&(i[s.defId]=s.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Co(t,"input",e.processors),output:Co(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function je(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return je(n.element,r);if(n.type==="set")return je(n.valueType,r);if(n.type==="lazy")return je(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return je(n.innerType,r);if(n.type==="intersection")return je(n.left,r)||je(n.right,r);if(n.type==="record"||n.type==="map")return je(n.keyType,r)||je(n.valueType,r);if(n.type==="pipe")return je(n.in,r)||je(n.out,r);if(n.type==="object"){for(const o in n.shape)if(je(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(const o of n.options)if(je(o,r))return!0;return!1}if(n.type==="tuple"){for(const o of n.items)if(je(o,r))return!0;return!!(n.rest&&je(n.rest,r))}return!1}const lm=(e,t={})=>r=>{const n=Cc({...r,processors:t});return he(e,n),Rc(n,e),zc(n,e)},Co=(e,t,r={})=>n=>{const{libraryOptions:o,target:i}=n??{},a=Cc({...o??{},target:i,io:t,processors:r});return he(e,a),Rc(a,e),zc(a,e)},cm={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},um=(e,t,r,n)=>{const o=r;o.type="string";const{minimum:i,maximum:a,format:s,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof a=="number"&&(o.maxLength=a),s&&(o.format=cm[s]??s,o.format===""&&delete o.format,s==="time"&&delete o.format),c&&(o.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},dm=(e,t,r,n)=>{const o=r,{minimum:i,maximum:a,format:s,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof s=="string"&&s.includes("int")?o.type="integer":o.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u),typeof i=="number"&&(o.minimum=i,typeof u=="number"&&t.target!=="draft-04"&&(u>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c),typeof a=="number"&&(o.maximum=a,typeof c=="number"&&t.target!=="draft-04"&&(c<=a?delete o.maximum:delete o.exclusiveMaximum)),typeof l=="number"&&(o.multipleOf=l)},hm=(e,t,r,n)=>{r.type="boolean"},fm=(e,t,r,n)=>{r.not={}},pm=(e,t,r,n)=>{},gm=(e,t,r,n)=>{const o=e._zod.def,i=Vl(o.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},mm=(e,t,r,n)=>{const o=e._zod.def,i=[];for(const a of o.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){const a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},vm=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},bm=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},km=(e,t,r,n)=>{const o=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(o.minItems=a),typeof s=="number"&&(o.maxItems=s),o.type="array",o.items=he(i.element,t,{...n,path:[...n.path,"items"]})},wm=(e,t,r,n)=>{const o=r,i=e._zod.def;o.type="object",o.properties={};const a=i.shape;for(const c in a)o.properties[c]=he(a[c],t,{...n,path:[...n.path,"properties",c]});const s=new Set(Object.keys(a)),l=new Set([...s].filter(c=>{const u=i.shape[c]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));l.size>0&&(o.required=Array.from(l)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=he(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},ym=(e,t,r,n)=>{const o=e._zod.def,i=o.inclusive===!1,a=o.options.map((s,l)=>he(s,t,{...n,path:[...n.path,i?"oneOf":"anyOf",l]}));i?r.oneOf=a:r.anyOf=a},_m=(e,t,r,n)=>{const o=e._zod.def,i=he(o.left,t,{...n,path:[...n.path,"allOf",0]}),a=he(o.right,t,{...n,path:[...n.path,"allOf",1]}),s=c=>"allOf"in c&&Object.keys(c).length===1,l=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=l},Sm=(e,t,r,n)=>{const o=r,i=e._zod.def;o.type="object";const a=i.keyType,l=a._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){const u=he(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(const h of l)o.patternProperties[h.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=he(i.keyType,t,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=he(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const c=a._zod.values;if(c){const u=[...c].filter(h=>typeof h=="string"||typeof h=="number");u.length>0&&(o.required=u)}},xm=(e,t,r,n)=>{const o=e._zod.def,i=he(o.innerType,t,n),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},Tm=(e,t,r,n)=>{const o=e._zod.def;he(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},Em=(e,t,r,n)=>{const o=e._zod.def;he(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},Am=(e,t,r,n)=>{const o=e._zod.def;he(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},Cm=(e,t,r,n)=>{const o=e._zod.def;he(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Rm=(e,t,r,n)=>{const o=e._zod.def,i=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;he(i,t,n);const a=t.seen.get(e);a.ref=i},zm=(e,t,r,n)=>{const o=e._zod.def;he(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0},Ic=(e,t,r,n)=>{const o=e._zod.def;he(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},Im=k("ZodISODateTime",(e,t)=>{O0.init(e,t),ne.init(e,t)});function Om(e){return Mg(Im,e)}const $m=k("ZodISODate",(e,t)=>{$0.init(e,t),ne.init(e,t)});function Pm(e){return Fg($m,e)}const Lm=k("ZodISOTime",(e,t)=>{P0.init(e,t),ne.init(e,t)});function Dm(e){return jg(Lm,e)}const Nm=k("ZodISODuration",(e,t)=>{L0.init(e,t),ne.init(e,t)});function Mm(e){return Bg(Nm,e)}const ut=k("ZodError",(e,t)=>{Jl.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Tp(e,r)},flatten:{value:r=>xp(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ui,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ui,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Fm=Gi(ut),jm=Wi(ut),Bm=_o(ut),Zm=So(ut),Um=Cp(ut),qm=Rp(ut),Vm=zp(ut),Hm=Ip(ut),Gm=Op(ut),Wm=$p(ut),Qm=Pp(ut),Ym=Lp(ut),re=k("ZodType",(e,t)=>(te.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Co(e,"input"),output:Co(e,"output")}}),e.toJSONSchema=lm(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(vr(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>Xt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>Fm(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Bm(e,r,n),e.parseAsync=async(r,n)=>jm(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Zm(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Um(e,r,n),e.decode=(r,n)=>qm(e,r,n),e.encodeAsync=async(r,n)=>Vm(e,r,n),e.decodeAsync=async(r,n)=>Hm(e,r,n),e.safeEncode=(r,n)=>Gm(e,r,n),e.safeDecode=(r,n)=>Wm(e,r,n),e.safeEncodeAsync=async(r,n)=>Qm(e,r,n),e.safeDecodeAsync=async(r,n)=>Ym(e,r,n),e.refine=(r,n)=>e.check(Bv(r,n)),e.superRefine=r=>e.check(Zv(r)),e.overwrite=r=>e.check(en(r)),e.optional=()=>Bc(e),e.exactOptional=()=>Cv(e),e.nullable=()=>Zc(e),e.nullish=()=>Bc(Zc(e)),e.nonoptional=r=>Pv(e,r),e.array=()=>H(e),e.or=r=>Lt([e,r]),e.and=r=>Mn(e,r),e.transform=r=>qc(e,Ev(r)),e.default=r=>Iv(e,r),e.prefault=r=>$v(e,r),e.catch=r=>Dv(e,r),e.pipe=r=>qc(e,r),e.readonly=()=>Fv(e),e.describe=r=>{const n=e.clone();return Nn.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Nn.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Nn.get(e);const n=e.clone();return Nn.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),Oc=k("_ZodString",(e,t)=>{Qi.init(e,t),re.init(e,t),e._zod.processJSONSchema=(n,o,i)=>um(e,n,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Gg(...n)),e.includes=(...n)=>e.check(Yg(...n)),e.startsWith=(...n)=>e.check(Jg(...n)),e.endsWith=(...n)=>e.check(Kg(...n)),e.min=(...n)=>e.check(Ao(...n)),e.max=(...n)=>e.check(Ec(...n)),e.length=(...n)=>e.check(Ac(...n)),e.nonempty=(...n)=>e.check(Ao(1,...n)),e.lowercase=n=>e.check(Wg(n)),e.uppercase=n=>e.check(Qg(n)),e.trim=()=>e.check(em()),e.normalize=(...n)=>e.check(Xg(...n)),e.toLowerCase=()=>e.check(tm()),e.toUpperCase=()=>e.check(rm()),e.slugify=()=>e.check(nm())}),Jm=k("ZodString",(e,t)=>{Qi.init(e,t),Oc.init(e,t),e.email=r=>e.check(vg(Km,r)),e.url=r=>e.check(_g(Xm,r)),e.jwt=r=>e.check(Ng(pv,r)),e.emoji=r=>e.check(Sg(ev,r)),e.guid=r=>e.check(_c($c,r)),e.uuid=r=>e.check(bg(Ro,r)),e.uuidv4=r=>e.check(kg(Ro,r)),e.uuidv6=r=>e.check(wg(Ro,r)),e.uuidv7=r=>e.check(yg(Ro,r)),e.nanoid=r=>e.check(xg(tv,r)),e.guid=r=>e.check(_c($c,r)),e.cuid=r=>e.check(Tg(rv,r)),e.cuid2=r=>e.check(Eg(nv,r)),e.ulid=r=>e.check(Ag(ov,r)),e.base64=r=>e.check(Pg(dv,r)),e.base64url=r=>e.check(Lg(hv,r)),e.xid=r=>e.check(Cg(iv,r)),e.ksuid=r=>e.check(Rg(av,r)),e.ipv4=r=>e.check(zg(sv,r)),e.ipv6=r=>e.check(Ig(lv,r)),e.cidrv4=r=>e.check(Og(cv,r)),e.cidrv6=r=>e.check($g(uv,r)),e.e164=r=>e.check(Dg(fv,r)),e.datetime=r=>e.check(Om(r)),e.date=r=>e.check(Pm(r)),e.time=r=>e.check(Dm(r)),e.duration=r=>e.check(Mm(r))});function d(e){return mg(Jm,e)}const ne=k("ZodStringFormat",(e,t)=>{K.init(e,t),Oc.init(e,t)}),Km=k("ZodEmail",(e,t)=>{S0.init(e,t),ne.init(e,t)}),$c=k("ZodGUID",(e,t)=>{y0.init(e,t),ne.init(e,t)}),Ro=k("ZodUUID",(e,t)=>{_0.init(e,t),ne.init(e,t)}),Xm=k("ZodURL",(e,t)=>{x0.init(e,t),ne.init(e,t)}),ev=k("ZodEmoji",(e,t)=>{T0.init(e,t),ne.init(e,t)}),tv=k("ZodNanoID",(e,t)=>{E0.init(e,t),ne.init(e,t)}),rv=k("ZodCUID",(e,t)=>{A0.init(e,t),ne.init(e,t)}),nv=k("ZodCUID2",(e,t)=>{C0.init(e,t),ne.init(e,t)}),ov=k("ZodULID",(e,t)=>{R0.init(e,t),ne.init(e,t)}),iv=k("ZodXID",(e,t)=>{z0.init(e,t),ne.init(e,t)}),av=k("ZodKSUID",(e,t)=>{I0.init(e,t),ne.init(e,t)}),sv=k("ZodIPv4",(e,t)=>{D0.init(e,t),ne.init(e,t)}),lv=k("ZodIPv6",(e,t)=>{N0.init(e,t),ne.init(e,t)}),cv=k("ZodCIDRv4",(e,t)=>{M0.init(e,t),ne.init(e,t)}),uv=k("ZodCIDRv6",(e,t)=>{F0.init(e,t),ne.init(e,t)}),dv=k("ZodBase64",(e,t)=>{j0.init(e,t),ne.init(e,t)}),hv=k("ZodBase64URL",(e,t)=>{Z0.init(e,t),ne.init(e,t)}),fv=k("ZodE164",(e,t)=>{U0.init(e,t),ne.init(e,t)}),pv=k("ZodJWT",(e,t)=>{V0.init(e,t),ne.init(e,t)}),Pc=k("ZodNumber",(e,t)=>{lc.init(e,t),re.init(e,t),e._zod.processJSONSchema=(n,o,i)=>dm(e,n,o),e.gt=(n,o)=>e.check(xc(n,o)),e.gte=(n,o)=>e.check(Ki(n,o)),e.min=(n,o)=>e.check(Ki(n,o)),e.lt=(n,o)=>e.check(Sc(n,o)),e.lte=(n,o)=>e.check(Ji(n,o)),e.max=(n,o)=>e.check(Ji(n,o)),e.int=n=>e.check(Lc(n)),e.safe=n=>e.check(Lc(n)),e.positive=n=>e.check(xc(0,n)),e.nonnegative=n=>e.check(Ki(0,n)),e.negative=n=>e.check(Sc(0,n)),e.nonpositive=n=>e.check(Ji(0,n)),e.multipleOf=(n,o)=>e.check(Tc(n,o)),e.step=(n,o)=>e.check(Tc(n,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function ve(e){return Zg(Pc,e)}const gv=k("ZodNumberFormat",(e,t)=>{H0.init(e,t),Pc.init(e,t)});function Lc(e){return Ug(gv,e)}const mv=k("ZodBoolean",(e,t)=>{G0.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>hm(e,r,n)});function V(e){return qg(mv,e)}const vv=k("ZodUnknown",(e,t)=>{W0.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>pm()});function Dc(){return Vg(vv)}const bv=k("ZodNever",(e,t)=>{Q0.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fm(e,r,n)});function kv(e){return Hg(bv,e)}const wv=k("ZodArray",(e,t)=>{Y0.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>km(e,r,n,o),e.element=t.element,e.min=(r,n)=>e.check(Ao(r,n)),e.nonempty=r=>e.check(Ao(1,r)),e.max=(r,n)=>e.check(Ec(r,n)),e.length=(r,n)=>e.check(Ac(r,n)),e.unwrap=()=>e.element});function H(e,t){return om(wv,e,t)}const yv=k("ZodObject",(e,t)=>{K0.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wm(e,r,n,o),q(e,"shape",()=>t.shape),e.keyof=()=>et(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Dc()}),e.loose=()=>e.clone({...e._zod.def,catchall:Dc()}),e.strict=()=>e.clone({...e._zod.def,catchall:kv()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>kp(e,r),e.safeExtend=r=>wp(e,r),e.merge=r=>yp(e,r),e.pick=r=>vp(e,r),e.omit=r=>bp(e,r),e.partial=(...r)=>_p(jc,e,r[0]),e.required=(...r)=>Sp(Uc,e,r[0])});function E(e,t){const r={type:"object",shape:e??{},...I(t)};return new yv(r)}const Nc=k("ZodUnion",(e,t)=>{fc.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ym(e,r,n,o),e.options=t.options});function Lt(e,t){return new Nc({type:"union",options:e,...I(t)})}const _v=k("ZodDiscriminatedUnion",(e,t)=>{Nc.init(e,t),X0.init(e,t)});function Mc(e,t,r){return new _v({type:"union",options:t,discriminator:e,...I(r)})}const Sv=k("ZodIntersection",(e,t)=>{eg.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_m(e,r,n,o)});function Mn(e,t){return new Sv({type:"intersection",left:e,right:t})}const Fc=k("ZodRecord",(e,t)=>{tg.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Sm(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function Dt(e,t,r){return new Fc({type:"record",keyType:e,valueType:t,...I(r)})}function zo(e,t,r){const n=Xt(e);return n._zod.values=void 0,new Fc({type:"record",keyType:n,valueType:t,...I(r)})}const Xi=k("ZodEnum",(e,t)=>{rg.init(e,t),re.init(e,t),e._zod.processJSONSchema=(n,o,i)=>gm(e,n,o),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const i={};for(const a of n)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Xi({...t,checks:[],...I(o),entries:i})},e.exclude=(n,o)=>{const i={...t.entries};for(const a of n)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new Xi({...t,checks:[],...I(o),entries:i})}});function et(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Xi({type:"enum",entries:r,...I(t)})}const xv=k("ZodLiteral",(e,t)=>{ng.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>mm(e,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Be(e,t){return new xv({type:"literal",values:Array.isArray(e)?e:[e],...I(t)})}const Tv=k("ZodTransform",(e,t)=>{og.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>bm(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ul(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(Dn(i,r.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(Dn(a))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function Ev(e){return new Tv({type:"transform",transform:e})}const jc=k("ZodOptional",(e,t)=>{mc.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ic(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Bc(e){return new jc({type:"optional",innerType:e})}const Av=k("ZodExactOptional",(e,t)=>{ig.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ic(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Cv(e){return new Av({type:"optional",innerType:e})}const Rv=k("ZodNullable",(e,t)=>{ag.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>xm(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Zc(e){return new Rv({type:"nullable",innerType:e})}const zv=k("ZodDefault",(e,t)=>{sg.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Em(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Iv(e,t){return new zv({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Ql(t)}})}const Ov=k("ZodPrefault",(e,t)=>{lg.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Am(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function $v(e,t){return new Ov({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Ql(t)}})}const Uc=k("ZodNonOptional",(e,t)=>{cg.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Tm(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Pv(e,t){return new Uc({type:"nonoptional",innerType:e,...I(t)})}const Lv=k("ZodCatch",(e,t)=>{ug.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Cm(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Dv(e,t){return new Lv({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Nv=k("ZodPipe",(e,t)=>{dg.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Rm(e,r,n,o),e.in=t.in,e.out=t.out});function qc(e,t){return new Nv({type:"pipe",in:e,out:t})}const Mv=k("ZodReadonly",(e,t)=>{hg.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zm(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Fv(e){return new Mv({type:"readonly",innerType:e})}const jv=k("ZodCustom",(e,t)=>{fg.init(e,t),re.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vm(e,r)});function Bv(e,t={}){return im(jv,e,t)}function Zv(e){return am(e)}const Uv=Lt([d(),ve(),V(),H(d()),H(ve()),H(V())]),ea=E({title:d(),description:d().optional(),badge:d().optional(),breadcrumbs:H(d()).optional(),previewImage:d().optional(),date:d().datetime().optional()}),qv=E({url:d().url(),score:ve(),metadata:Dt(d(),Uv),language:d().optional()}).extend(ea.shape),Vv=E({componentName:Be("buttons"),data:E({caption:d().optional(),buttons:H(E({label:d(),href:d().url().optional(),value:d(),variant:et(["primary","secondary","tertiary"]).optional(),icon:d().optional(),target:d().optional()}))})}),Hv=E({componentName:Be("combobox"),data:E({caption:d().optional(),placeholder:d(),values:H(E({label:d(),value:d()}))})}),Gv=E({componentName:Be("alva-init"),data:E({})}),Wv=E({componentName:Be("alva-score-survey"),data:E({})}),Qv=E({type:Be("component"),id:d().optional(),time:d().optional(),hideAvatar:V().optional(),noSectionPadding:V().optional()}),Yv=Mn(Mc("componentName",[Vv,Hv,Gv,Wv]),Qv);et(["start","chat"]),Mc("name",[E({name:Be("start-page"),prefill:d().optional()}),E({name:Be("consent-page")}),E({name:Be("chat-page"),query:d()})]);const Jv=E({type:Be("user"),time:d(),message:d(),id:d().optional()});et(["idle","searching","answering"]);const Kv=Lt([d(),ve(),V(),H(d()),H(ve()),H(V())]),ta=E({url:d(),score:ve(),metadata:Dt(d(),Kv),considered:V(),display:E({card:ea,listItem:ea})}).extend({referenceIndex:E({all:ve(),used:ve().optional()})}),Xv=E({all:H(ta),used:H(ta),unused:H(ta)}),eb=et(["pii-detected","blocked","maintenance","rate-limit","server-error","too-short","too-long","quota-reached","aborted"]),tb=Lt([eb,Be("sse-error"),Be("client-error"),Be("unexpected-call")]),Vc=E({type:Be("bot"),time:d(),id:d(),message:E({markdown:d(),html:d(),text:d()}),references:Xv,errors:H(tb),retrievalQuestion:d().optional()}),rb=Vc.extend({state:et(["streaming","done"])}),nb=Vc.extend({state:Be("loading")}),ob=Lt([nb,rb]),ra=Lt([ob,Jv,Yv]);var na={inherit:"inherit",current:"currentcolor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"oklch(98.4% 0.003 247.858)",100:"oklch(96.8% 0.007 247.896)",200:"oklch(92.9% 0.013 255.508)",300:"oklch(86.9% 0.022 252.894)",400:"oklch(70.4% 0.04 256.788)",500:"oklch(55.4% 0.046 257.417)",600:"oklch(44.6% 0.043 257.281)",700:"oklch(37.2% 0.044 257.287)",800:"oklch(27.9% 0.041 260.031)",900:"oklch(20.8% 0.042 265.755)",950:"oklch(12.9% 0.042 264.695)"},gray:{50:"oklch(98.5% 0.002 247.839)",100:"oklch(96.7% 0.003 264.542)",200:"oklch(92.8% 0.006 264.531)",300:"oklch(87.2% 0.01 258.338)",400:"oklch(70.7% 0.022 261.325)",500:"oklch(55.1% 0.027 264.364)",600:"oklch(44.6% 0.03 256.802)",700:"oklch(37.3% 0.034 259.733)",800:"oklch(27.8% 0.033 256.848)",900:"oklch(21% 0.034 264.665)",950:"oklch(13% 0.028 261.692)"},zinc:{50:"oklch(98.5% 0 0)",100:"oklch(96.7% 0.001 286.375)",200:"oklch(92% 0.004 286.32)",300:"oklch(87.1% 0.006 286.286)",400:"oklch(70.5% 0.015 286.067)",500:"oklch(55.2% 0.016 285.938)",600:"oklch(44.2% 0.017 285.786)",700:"oklch(37% 0.013 285.805)",800:"oklch(27.4% 0.006 286.033)",900:"oklch(21% 0.006 285.885)",950:"oklch(14.1% 0.005 285.823)"},neutral:{50:"oklch(98.5% 0 0)",100:"oklch(97% 0 0)",200:"oklch(92.2% 0 0)",300:"oklch(87% 0 0)",400:"oklch(70.8% 0 0)",500:"oklch(55.6% 0 0)",600:"oklch(43.9% 0 0)",700:"oklch(37.1% 0 0)",800:"oklch(26.9% 0 0)",900:"oklch(20.5% 0 0)",950:"oklch(14.5% 0 0)"},stone:{50:"oklch(98.5% 0.001 106.423)",100:"oklch(97% 0.001 106.424)",200:"oklch(92.3% 0.003 48.717)",300:"oklch(86.9% 0.005 56.366)",400:"oklch(70.9% 0.01 56.259)",500:"oklch(55.3% 0.013 58.071)",600:"oklch(44.4% 0.011 73.639)",700:"oklch(37.4% 0.01 67.558)",800:"oklch(26.8% 0.007 34.298)",900:"oklch(21.6% 0.006 56.043)",950:"oklch(14.7% 0.004 49.25)"},mauve:{50:"oklch(98.5% 0 0)",100:"oklch(96% 0.003 325.6)",200:"oklch(92.2% 0.005 325.62)",300:"oklch(86.5% 0.012 325.68)",400:"oklch(71.1% 0.019 323.02)",500:"oklch(54.2% 0.034 322.5)",600:"oklch(43.5% 0.029 321.78)",700:"oklch(36.4% 0.029 323.89)",800:"oklch(26.3% 0.024 320.12)",900:"oklch(21.2% 0.019 322.12)",950:"oklch(14.5% 0.008 326)"},olive:{50:"oklch(98.8% 0.003 106.5)",100:"oklch(96.6% 0.005 106.5)",200:"oklch(93% 0.007 106.5)",300:"oklch(88% 0.011 106.6)",400:"oklch(73.7% 0.021 106.9)",500:"oklch(58% 0.031 107.3)",600:"oklch(46.6% 0.025 107.3)",700:"oklch(39.4% 0.023 107.4)",800:"oklch(28.6% 0.016 107.4)",900:"oklch(22.8% 0.013 107.4)",950:"oklch(15.3% 0.006 107.1)"},mist:{50:"oklch(98.7% 0.002 197.1)",100:"oklch(96.3% 0.002 197.1)",200:"oklch(92.5% 0.005 214.3)",300:"oklch(87.2% 0.007 219.6)",400:"oklch(72.3% 0.014 214.4)",500:"oklch(56% 0.021 213.5)",600:"oklch(45% 0.017 213.2)",700:"oklch(37.8% 0.015 216)",800:"oklch(27.5% 0.011 216.9)",900:"oklch(21.8% 0.008 223.9)",950:"oklch(14.8% 0.004 228.8)"},taupe:{50:"oklch(98.6% 0.002 67.8)",100:"oklch(96% 0.002 17.2)",200:"oklch(92.2% 0.005 34.3)",300:"oklch(86.8% 0.007 39.5)",400:"oklch(71.4% 0.014 41.2)",500:"oklch(54.7% 0.021 43.1)",600:"oklch(43.8% 0.017 39.3)",700:"oklch(36.7% 0.016 35.7)",800:"oklch(26.8% 0.011 36.5)",900:"oklch(21.4% 0.009 43.1)",950:"oklch(14.7% 0.004 49.3)"},red:{50:"oklch(97.1% 0.013 17.38)",100:"oklch(93.6% 0.032 17.717)",200:"oklch(88.5% 0.062 18.334)",300:"oklch(80.8% 0.114 19.571)",400:"oklch(70.4% 0.191 22.216)",500:"oklch(63.7% 0.237 25.331)",600:"oklch(57.7% 0.245 27.325)",700:"oklch(50.5% 0.213 27.518)",800:"oklch(44.4% 0.177 26.899)",900:"oklch(39.6% 0.141 25.723)",950:"oklch(25.8% 0.092 26.042)"},orange:{50:"oklch(98% 0.016 73.684)",100:"oklch(95.4% 0.038 75.164)",200:"oklch(90.1% 0.076 70.697)",300:"oklch(83.7% 0.128 66.29)",400:"oklch(75% 0.183 55.934)",500:"oklch(70.5% 0.213 47.604)",600:"oklch(64.6% 0.222 41.116)",700:"oklch(55.3% 0.195 38.402)",800:"oklch(47% 0.157 37.304)",900:"oklch(40.8% 0.123 38.172)",950:"oklch(26.6% 0.079 36.259)"},amber:{50:"oklch(98.7% 0.022 95.277)",100:"oklch(96.2% 0.059 95.617)",200:"oklch(92.4% 0.12 95.746)",300:"oklch(87.9% 0.169 91.605)",400:"oklch(82.8% 0.189 84.429)",500:"oklch(76.9% 0.188 70.08)",600:"oklch(66.6% 0.179 58.318)",700:"oklch(55.5% 0.163 48.998)",800:"oklch(47.3% 0.137 46.201)",900:"oklch(41.4% 0.112 45.904)",950:"oklch(27.9% 0.077 45.635)"},yellow:{50:"oklch(98.7% 0.026 102.212)",100:"oklch(97.3% 0.071 103.193)",200:"oklch(94.5% 0.129 101.54)",300:"oklch(90.5% 0.182 98.111)",400:"oklch(85.2% 0.199 91.936)",500:"oklch(79.5% 0.184 86.047)",600:"oklch(68.1% 0.162 75.834)",700:"oklch(55.4% 0.135 66.442)",800:"oklch(47.6% 0.114 61.907)",900:"oklch(42.1% 0.095 57.708)",950:"oklch(28.6% 0.066 53.813)"},lime:{50:"oklch(98.6% 0.031 120.757)",100:"oklch(96.7% 0.067 122.328)",200:"oklch(93.8% 0.127 124.321)",300:"oklch(89.7% 0.196 126.665)",400:"oklch(84.1% 0.238 128.85)",500:"oklch(76.8% 0.233 130.85)",600:"oklch(64.8% 0.2 131.684)",700:"oklch(53.2% 0.157 131.589)",800:"oklch(45.3% 0.124 130.933)",900:"oklch(40.5% 0.101 131.063)",950:"oklch(27.4% 0.072 132.109)"},green:{50:"oklch(98.2% 0.018 155.826)",100:"oklch(96.2% 0.044 156.743)",200:"oklch(92.5% 0.084 155.995)",300:"oklch(87.1% 0.15 154.449)",400:"oklch(79.2% 0.209 151.711)",500:"oklch(72.3% 0.219 149.579)",600:"oklch(62.7% 0.194 149.214)",700:"oklch(52.7% 0.154 150.069)",800:"oklch(44.8% 0.119 151.328)",900:"oklch(39.3% 0.095 152.535)",950:"oklch(26.6% 0.065 152.934)"},emerald:{50:"oklch(97.9% 0.021 166.113)",100:"oklch(95% 0.052 163.051)",200:"oklch(90.5% 0.093 164.15)",300:"oklch(84.5% 0.143 164.978)",400:"oklch(76.5% 0.177 163.223)",500:"oklch(69.6% 0.17 162.48)",600:"oklch(59.6% 0.145 163.225)",700:"oklch(50.8% 0.118 165.612)",800:"oklch(43.2% 0.095 166.913)",900:"oklch(37.8% 0.077 168.94)",950:"oklch(26.2% 0.051 172.552)"},teal:{50:"oklch(98.4% 0.014 180.72)",100:"oklch(95.3% 0.051 180.801)",200:"oklch(91% 0.096 180.426)",300:"oklch(85.5% 0.138 181.071)",400:"oklch(77.7% 0.152 181.912)",500:"oklch(70.4% 0.14 182.503)",600:"oklch(60% 0.118 184.704)",700:"oklch(51.1% 0.096 186.391)",800:"oklch(43.7% 0.078 188.216)",900:"oklch(38.6% 0.063 188.416)",950:"oklch(27.7% 0.046 192.524)"},cyan:{50:"oklch(98.4% 0.019 200.873)",100:"oklch(95.6% 0.045 203.388)",200:"oklch(91.7% 0.08 205.041)",300:"oklch(86.5% 0.127 207.078)",400:"oklch(78.9% 0.154 211.53)",500:"oklch(71.5% 0.143 215.221)",600:"oklch(60.9% 0.126 221.723)",700:"oklch(52% 0.105 223.128)",800:"oklch(45% 0.085 224.283)",900:"oklch(39.8% 0.07 227.392)",950:"oklch(30.2% 0.056 229.695)"},sky:{50:"oklch(97.7% 0.013 236.62)",100:"oklch(95.1% 0.026 236.824)",200:"oklch(90.1% 0.058 230.902)",300:"oklch(82.8% 0.111 230.318)",400:"oklch(74.6% 0.16 232.661)",500:"oklch(68.5% 0.169 237.323)",600:"oklch(58.8% 0.158 241.966)",700:"oklch(50% 0.134 242.749)",800:"oklch(44.3% 0.11 240.79)",900:"oklch(39.1% 0.09 240.876)",950:"oklch(29.3% 0.066 243.157)"},blue:{50:"oklch(97% 0.014 254.604)",100:"oklch(93.2% 0.032 255.585)",200:"oklch(88.2% 0.059 254.128)",300:"oklch(80.9% 0.105 251.813)",400:"oklch(70.7% 0.165 254.624)",500:"oklch(62.3% 0.214 259.815)",600:"oklch(54.6% 0.245 262.881)",700:"oklch(48.8% 0.243 264.376)",800:"oklch(42.4% 0.199 265.638)",900:"oklch(37.9% 0.146 265.522)",950:"oklch(28.2% 0.091 267.935)"},indigo:{50:"oklch(96.2% 0.018 272.314)",100:"oklch(93% 0.034 272.788)",200:"oklch(87% 0.065 274.039)",300:"oklch(78.5% 0.115 274.713)",400:"oklch(67.3% 0.182 276.935)",500:"oklch(58.5% 0.233 277.117)",600:"oklch(51.1% 0.262 276.966)",700:"oklch(45.7% 0.24 277.023)",800:"oklch(39.8% 0.195 277.366)",900:"oklch(35.9% 0.144 278.697)",950:"oklch(25.7% 0.09 281.288)"},violet:{50:"oklch(96.9% 0.016 293.756)",100:"oklch(94.3% 0.029 294.588)",200:"oklch(89.4% 0.057 293.283)",300:"oklch(81.1% 0.111 293.571)",400:"oklch(70.2% 0.183 293.541)",500:"oklch(60.6% 0.25 292.717)",600:"oklch(54.1% 0.281 293.009)",700:"oklch(49.1% 0.27 292.581)",800:"oklch(43.2% 0.232 292.759)",900:"oklch(38% 0.189 293.745)",950:"oklch(28.3% 0.141 291.089)"},purple:{50:"oklch(97.7% 0.014 308.299)",100:"oklch(94.6% 0.033 307.174)",200:"oklch(90.2% 0.063 306.703)",300:"oklch(82.7% 0.119 306.383)",400:"oklch(71.4% 0.203 305.504)",500:"oklch(62.7% 0.265 303.9)",600:"oklch(55.8% 0.288 302.321)",700:"oklch(49.6% 0.265 301.924)",800:"oklch(43.8% 0.218 303.724)",900:"oklch(38.1% 0.176 304.987)",950:"oklch(29.1% 0.149 302.717)"},fuchsia:{50:"oklch(97.7% 0.017 320.058)",100:"oklch(95.2% 0.037 318.852)",200:"oklch(90.3% 0.076 319.62)",300:"oklch(83.3% 0.145 321.434)",400:"oklch(74% 0.238 322.16)",500:"oklch(66.7% 0.295 322.15)",600:"oklch(59.1% 0.293 322.896)",700:"oklch(51.8% 0.253 323.949)",800:"oklch(45.2% 0.211 324.591)",900:"oklch(40.1% 0.17 325.612)",950:"oklch(29.3% 0.136 325.661)"},pink:{50:"oklch(97.1% 0.014 343.198)",100:"oklch(94.8% 0.028 342.258)",200:"oklch(89.9% 0.061 343.231)",300:"oklch(82.3% 0.12 346.018)",400:"oklch(71.8% 0.202 349.761)",500:"oklch(65.6% 0.241 354.308)",600:"oklch(59.2% 0.249 0.584)",700:"oklch(52.5% 0.223 3.958)",800:"oklch(45.9% 0.187 3.815)",900:"oklch(40.8% 0.153 2.432)",950:"oklch(28.4% 0.109 3.907)"},rose:{50:"oklch(96.9% 0.015 12.422)",100:"oklch(94.1% 0.03 12.58)",200:"oklch(89.2% 0.058 10.001)",300:"oklch(81% 0.117 11.638)",400:"oklch(71.2% 0.194 13.428)",500:"oklch(64.5% 0.246 16.439)",600:"oklch(58.6% 0.253 17.585)",700:"oklch(51.4% 0.222 16.935)",800:"oklch(45.5% 0.188 13.697)",900:"oklch(41% 0.159 10.272)",950:"oklch(27.1% 0.105 12.094)"}};const se=E({minRem:ve(),maxRem:ve()}).or(d()),kr=E({0:d().optional(),50:d(),100:d(),200:d(),300:d(),400:d(),500:d(),600:d(),700:d(),800:d(),900:d(),950:d(),1e3:d().optional()}),oa=E({color:d().optional(),background:d().optional(),borderWidth:d().optional(),borderColor:d().optional(),boxShadow:d().optional()}),Hc=Mn(E({borderRadius:se.optional(),custom:Dt(d(),Lt([d(),ve()])).optional(),hover:oa.optional(),focus:oa.optional()}),oa),Gc=E({family:d().optional()}),Wc=zo(et(["predefinedQuestion","edit","newConversation","voteUp","voteDown","retry","message","messageLoading","thread","submit","abort","expand","help","attach","record","reward","share","audio","copy","dismiss","menu","info","menuClose","chevronDown","chevronUp","chevronTopDown","chevronDownSmall","internalLink","externalLink","liip","avatar","avatarLarge","openChat","speechInput","listUnordered","lightMode","darkMode","avatarLarge","settings","settingsClose","sources","model","checkbox","warning","headerLogo","embedAvatar"]),d()),ib=E({font:Gc.optional(),colors:E({brand:kr,accent:kr.optional(),highlight:kr,grey:kr}),base:E({fontSizeXs:se.optional(),fontSizeSm:se.optional(),fontSizeBody:se.optional(),fontSizeH3:se.optional(),fontSizeH2:se.optional(),fontSizeH1:se.optional(),fontWeightNormal:d().optional(),fontWeightBold:d().optional(),fontWeightTitle:d().optional(),lineHeightDefault:d().optional(),lineHeightSnug:d().optional(),lineHeightTight:d().optional(),borderRadius:se.optional(),lineColor:d().optional(),boxShadow:d().optional()}),components:Dt(d(),Hc),svgs:Wc}),Qc=E({customCSS:d().optional(),fontCSS:d().optional(),fontURLs:d().array().optional(),tokens:ib});E({light:Qc,dark:Qc});const ab=E({font:Gc.optional(),colors:E({brand:kr.partial().optional(),accent:kr.partial().optional(),highlight:kr.partial().optional(),grey:kr.partial().optional()}).optional(),base:E({fontSizeXs:se.optional(),fontSizeSm:se.optional(),fontSizeBody:se.optional(),fontSizeH3:se.optional(),fontSizeH2:se.optional(),fontSizeH1:se.optional(),fontWeightNormal:d().optional(),fontWeightBold:d().optional(),fontWeightTitle:d().optional(),lineHeightDefault:d().optional(),lineHeightSnug:d().optional(),lineHeightTight:d().optional(),borderRadius:se.optional(),lineColor:d().optional(),boxShadow:d().optional()}).optional(),components:Dt(d(),Hc).optional(),svgs:Wc.optional()}),Yc=E({customCSS:d().optional(),fontCSS:d().optional(),fontURLs:d().array().optional(),tokens:ab.optional()}),sb=E({light:Yc.optional(),dark:Yc.optional()}),Jc=E({50:d(),100:d(),200:d(),300:d(),400:d(),500:d(),600:d(),700:d(),800:d(),900:d(),950:d()}),Kc=et(["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]),Xc=Lt([Jc,Kc]),lb=Lt([Mn(Jc,E({0:d(),1e3:d()})),Kc]),cb=E({avatarImageUrl:d().optional(),colors:E({brand:Xc.optional(),highlight:Xc.optional(),grey:lb.optional(),background:d().optional(),text:d().optional(),anchor:E({default:d().optional(),hover:d().optional()}).optional()}).optional(),font:E({family:d().optional(),urls:H(d()).optional(),sizeXs:se.optional(),sizeSm:se.optional(),sizeBody:se.optional(),sizeH3:se.optional(),sizeH2:se.optional(),sizeH1:se.optional(),weightNormal:d().optional(),weightBold:d().optional(),weightTitle:d().optional()}).optional(),borderRadius:se.optional(),fineGrained:sb.optional()}),ub=E({blocked:d(),maintenance:d(),"rate-limit":d(),"server-error":d(),"too-short":d(),"too-long":d(),"quota-reached":d(),aborted:d(),"sse-error":d(),"client-error":d(),"unexpected-call":d(),"incomplete-error":d(),"feedback-failed":d(),"speech-not-supported":d(),"speech-transcription-failed":d(),"speech-no-text-detected":d(),"speech-microphone-access-denied":d(),"pii-detected":d()}),db=E({email:d(),creditCard:d(),ahv:d(),phoneSwiss:d(),phoneInternational:d(),swissPassport:d(),longNumber:d()}),eu=E({name:d(),namePlural:d().optional(),intro:d().optional(),placeholder:d(),values:Dt(d(),d())}),hb=E({action:d(),label:d(),type:et(["primary","secondary"]).optional()}),fb=E({hash:d(),title:d(),content:d(),actions:H(hb).optional()}),tu=E({introductionTitle:d(),introductionDisclaimer:d().optional(),termsInvitationToConsent:d().optional(),chatInputPlaceholder:d(),chatInputPlaceholderListening:d().optional(),chatInputSubmit:d(),chatInputAbort:d(),chatInputStartListening:d(),chatInputStopListening:d(),referenceLink:d(),referencesDisplay:d(),referencesHide:d(),referencesTitle:d(),referencesFurtherTitle:d(),newChat:d(),maintenanceModeError:d(),messageBotLoading:d(),messageBotError:d(),messageBotDefaultError:d(),noResultsFound:d(),chatFooterText:d().optional(),scrollToBottom:d(),openButtonTitle:d().optional(),openButtonDescription:d().optional(),openMenu:d(),openInfo:d(),aboutThisChat:d().optional(),closeMenu:d(),closeChat:d(),close:d(),send:d(),thankYouForFeedback:d(),giveFeedback:d(),sendFeedback:d(),feedbackFormTitle:d(),feedbackFormMessage:d(),feedbackFormMessagePlaceholder:d(),feedbackFormEmail:d(),feedbackFormEmailPlaceholder:d(),askQuestionAgain:d(),answerGood:d(),answerBad:d(),classificationSubmit:d(),classificationThankYou:d(),classificationTitle:d(),selectLanguage:d(),languageChanged:d(),selectColorTheme:d(),lightMode:d(),darkMode:d(),ariaMainNavigation:d(),ariaMainNavigationRegion:d(),ariaGotoMainNavigation:d(),ariaAskQuestion:d(),ariaAskQuestionRegion:d(),ariaNotifications:d(),ariaPredefinedQuestions:d(),ariaPredefinedQuestionsRegion:d(),ariaChatHistory:d(),ariaOpenChat:d(),ariaQuestionFromYou:d(),ariaAnswerFromBot:d(),ariaLastAnswerNavigation:d(),ariaQuestionSent:d(),ariaAnswerReady:d(),ariaAnswerFinished:d(),ariaAskQuestionAgain:d(),ariaAnswerGood:d(),ariaAnswerBad:d(),ariaReferenceSource:d(),ariaGiveFeedback:d(),ariaLanguageChanged:d(),ariaLightSelected:d(),ariaDarkSelected:d(),ariaSettings:d(),ariaSettingsRegion:d(),ariaReferencesRegion:d(),ariaOpensInNewTab:d(),ariaFlyoutRegion:d(),ariaSelected:d(),ariaUnselected:d(),ariaAllSelected:d(),ariaAllUnselected:d(),ariaAllReseted:d(),popups:H(fb).optional(),termsAcceptButton:d().optional(),termsReadButton:d().optional(),selectors:Dt(d(),eu).optional(),hideSettings:d(),showSettings:d(),chooseAtLeastOneOption:d(),selectAll:d(),selectNone:d(),resetToDefaults:d(),messageTooLong:d()}),tn=et(["en","de","fr","it"]),pb=zo(tn,tu.partial().extend({selectors:Dt(d(),eu).optional()}));Dt(tn,ub),Dt(tn,db);const ru=E({label:d(),options:H(E({label:d(),value:ve()}))}),gb=E({label:d(),icon:d(),url:d(),target:et(["_blank","_self"]).optional()}),mb=E({label:d().nullable(),question:d()}),nu=E({impact:ru.optional(),quality:ru.optional()});E({classification:nu.optional()});const vb=E({predefinedQuestions:H(mb)}),ou=Lt([E({maintenance:Be(!0)}),E({id:d(),cID:d()})]);zo(tn,tu);const bb=E({settingName:d(),iconName:d(),settingIntro:d().optional(),type:et(["single-select","multi-select"]),allowEmpty:V(),values:H(d()),defaultValues:H(d()).optional()}),iu=E({before:H(ra).optional(),after:H(ra).optional()}),kb=E({init:H(ra).optional(),bot:iu.optional(),user:iu.optional()}),wb=E({showPredefinedQuestions:V(),showOverallFeedbackButton:V(),showOverallFeedbackEmail:V(),showCloseChatButton:V(),showContextMenu:V(),showContextInfo:V(),showReferencesByDefault:V(),showExpandedSelectors:V(),showTextFeedback:V(),inlineLayout:V(),allowAudioInput:V(),blockPII:V(),questionPrefix:d(),menu:zo(tn,H(gb)).optional(),supportedLanguages:H(tn),classification:nu.optional(),theme:cb,translations:pb,buttonHref:d().optional(),addQueryToUrlParams:V().optional(),addRetrievalQuestionToUrlParams:V().optional(),renderKatex:V().optional(),reflectLanguageInPath:V().optional(),sendReferrer:et(["all","own","none","location"]).optional(),selectorsConfig:H(bb).default([]),questionLengthLimit:ve().optional(),forceConsent:V().optional(),askQuestionAgain:V(),enableBackdrop:V().optional(),messageAdditions:kb.optional(),contextVersion:ve().optional()}).partial(),au=Mn(wb,E({theme:E({name:d().optional()}).optional()}));class yb{constructor(t){this.chatResponseData=t,this.id=this.chatResponseData.id}id;async isReadyForFeedback(){return await this.chatResponseData.readyForFeedback.toPromise(),!0}subscribe(t,r){return this.chatResponseData.readableStore.subscribe(t,r)}getContent(){return this.chatResponseData.content.toPromise()}abort(){return this.chatResponseData.abort()}async thumbsUp(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsUp(this.id,this.chatResponseData.question)}async thumbsDown(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsDown(this.id,this.chatResponseData.question)}async feedback(t){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.feedback(this.id,this.chatResponseData.question,t)}}const Ie=[];for(let e=0;e<256;++e)Ie.push((e+256).toString(16).slice(1));function su(e,t=0){return(Ie[e[t+0]]+Ie[e[t+1]]+Ie[e[t+2]]+Ie[e[t+3]]+"-"+Ie[e[t+4]]+Ie[e[t+5]]+"-"+Ie[e[t+6]]+Ie[e[t+7]]+"-"+Ie[e[t+8]]+Ie[e[t+9]]+"-"+Ie[e[t+10]]+Ie[e[t+11]]+Ie[e[t+12]]+Ie[e[t+13]]+Ie[e[t+14]]+Ie[e[t+15]]).toLowerCase()}let ia;const _b=new Uint8Array(16);function lu(){if(!ia){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ia=crypto.getRandomValues.bind(crypto)}return ia(_b)}const cu={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Sb(e,t,r){e=e||{};const n=e.random??e.rng?.()??lu();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,su(n)}function xb(e,t,r){return cu.randomUUID&&!e?cu.randomUUID():Sb(e)}const aa={};function uu(e,t,r){let n;{const o=Date.now(),i=lu();Tb(aa,o,i),n=Eb(i,aa.msecs,aa.seq,t,r)}return t??su(n)}function Tb(e,t,r){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function Eb(e,t,r,n,o=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),o=0;else if(o<0||o+16>n.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);return t??=Date.now(),r??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],n[o++]=t/1099511627776&255,n[o++]=t/4294967296&255,n[o++]=t/16777216&255,n[o++]=t/65536&255,n[o++]=t/256&255,n[o++]=t&255,n[o++]=112|r>>>28&15,n[o++]=r>>>20&255,n[o++]=128|r>>>14&63,n[o++]=r>>>6&255,n[o++]=r<<2&255|e[10]&3,n[o++]=e[11],n[o++]=e[12],n[o++]=e[13],n[o++]=e[14],n[o++]=e[15],n}const rn=new Map;class Ab{get length(){return rn.size}clear(){rn.clear()}getItem(t){return rn.get(t)||null}key(t){return Array.from(rn.keys())[t]||null}removeItem(t){rn.delete(t)}setItem(t,r){rn.set(t,String(r))}}const xt=globalThis.localStorage??new Ab,Cb=async e=>{try{const t=xt.getItem("liipgpt:uID")||xt.getItem("uID"),r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({referrer:globalThis?.document?.referrer||null,uID:t})},n=await e.fetchData("/login",ou,{},r).catch(o=>(console.log("Failed to /login use /log",o),e.fetchData("/log",ou,{},r)));if("maintenance"in n&&n.maintenance)return{mode:"maintenance"};if(!("id"in n))throw new Error("Invalid response format: missing user id");return xt.setItem("liipgpt:uID",n.id),{mode:"ready",userId:n.id}}catch(t){throw console.error("Failed to fetch user data:",t),t}};var Tt=function(e,t){if(!(this instanceof Tt))return new Tt(e,t);this.url=e,t=t||{},this.headers=t.headers||{},this.payload=t.payload!==void 0?t.payload:"",this.method=t.method||this.payload&&"POST"||"GET",this.withCredentials=!!t.withCredentials,this.debug=!!t.debug,this.autoReconnect=t.autoReconnect!==void 0?t.autoReconnect:!1,this.reconnectDelay=t.reconnectDelay!==void 0?t.reconnectDelay:3e3,this.maxRetries=t.maxRetries!==void 0?t.maxRetries:null,this.retryCount=0,this.reconnectTimer=null,this.useLastEventId=t.useLastEventId!==void 0?t.useLastEventId:!0,this.FIELD_SEPARATOR=":",this.listeners={},this.xhr=null,this.readyState=Tt.INITIALIZING,this.progress=0,this.chunk="",this.lastEventId="",this._hasParsedBom=!1,this.addEventListener=function(r,n){this.listeners[r]===void 0&&(this.listeners[r]=[]),this.listeners[r].indexOf(n)===-1&&this.listeners[r].push(n)},this.removeEventListener=function(r,n){if(this.listeners[r]===void 0)return;const o=[];this.listeners[r].forEach(function(i){i!==n&&o.push(i)}),o.length===0?delete this.listeners[r]:this.listeners[r]=o},this.dispatchEvent=function(r){if(!r)return!0;this.debug&&console.debug(r),r.source=this;const n="on"+r.type;return this.hasOwnProperty(n)&&(this[n].call(this,r),r.defaultPrevented)?!1:this.listeners[r.type]?this.listeners[r.type].every(function(o){return o(r),!r.defaultPrevented}):!0},this._markClosed=function(){if(this.xhr=null,this.progress=0,this.chunk="",this._setReadyState(Tt.CLOSED),this.autoReconnect){if(this.maxRetries!==null&&this.retryCount>=this.maxRetries){this.debug&&console.debug(`SSE max retries (${this.maxRetries}) reached, stopping reconnection attempts`),this.autoReconnect=!1,this.close();return}this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.debug&&console.debug(`SSE will attempt to reconnect in ${this.reconnectDelay}ms (attempt ${this.retryCount+1}${this.maxRetries?"/"+this.maxRetries:""})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.retryCount++,this.stream()},this.reconnectDelay)}},this._setReadyState=function(r){const n=new CustomEvent("readystatechange");n.readyState=r,this.readyState=r,this.dispatchEvent(n)},this._onStreamFailure=function(r){const n=new CustomEvent("error");n.responseCode=r.currentTarget.status,n.data=r.currentTarget.response,this.dispatchEvent(n),this._markClosed()},this._onStreamAbort=function(){this.dispatchEvent(new CustomEvent("abort")),this._markClosed()},this._onStreamProgress=function(r){if(!this.xhr)return;if(this.xhr.status<200||this.xhr.status>=300){this._onStreamFailure(r);return}this.retryCount=0;let n=this.xhr.responseText.substring(this.progress);this.progress+=n.length,!this._hasParsedBom&&this.chunk.length===0&&(n.charCodeAt(0)===65279&&(n=n.substring(1)),this._hasParsedBom=!0);const o=(this.chunk+n).split(/(\r\n\r\n|\r\r|\n\n)/g),i=o.pop();o.forEach((function(a){a.trim().length>0&&this.dispatchEvent(this._parseEventChunk(a))}).bind(this)),this.chunk=i},this._onStreamLoaded=function(r){this._onStreamProgress(r),this.dispatchEvent(this._parseEventChunk(this.chunk)),this.chunk="",this._markClosed()},this._parseEventChunk=function(r){if(!r||r.length===0)return null;this.debug&&console.debug(r);const n={id:null,retry:null,data:null,event:null};if(r.split(/\n|\r\n|\r/).forEach((function(i){const a=i.indexOf(this.FIELD_SEPARATOR);let s,l;if(a>0){const c=i[a+1]===" "?2:1;s=i.substring(0,a),l=i.substring(a+c)}else if(a<0)s=i,l="";else return;s in n&&(s==="data"&&n[s]!==null?n.data+=`
|
|
112
|
+
`+l:n[s]=l)}).bind(this)),n.id!==null&&n.id.indexOf("\0")===-1&&(this.lastEventId=n.id),n.retry!==null&&/^[0-9]+$/.test(n.retry)&&(this.reconnectDelay=parseInt(n.retry,10)),n.data===null)return null;const o=new CustomEvent(n.event||"message");return o.id=n.id,o.data=n.data||"",o.lastEventId=this.lastEventId,o},this._onReadyStateChange=function(){if(this.xhr&&this.xhr.readyState===XMLHttpRequest.HEADERS_RECEIVED){const r={},n=this.xhr.getAllResponseHeaders().trim().split(`\r
|
|
113
|
+
`);for(const i of n){const[a,...s]=i.split(":"),l=s.join(":").trim();r[a.trim().toLowerCase()]=r[a.trim().toLowerCase()]||[],r[a.trim().toLowerCase()].push(l)}const o=new CustomEvent("open");o.responseCode=this.xhr.status,o.headers=r,this.dispatchEvent(o),this._setReadyState(Tt.OPEN)}},this.stream=function(){if(!this.xhr){this._setReadyState(Tt.CONNECTING),this.xhr=new XMLHttpRequest,this.xhr.addEventListener("progress",this._onStreamProgress.bind(this)),this.xhr.addEventListener("load",this._onStreamLoaded.bind(this)),this.xhr.addEventListener("readystatechange",this._onReadyStateChange.bind(this)),this.xhr.addEventListener("error",this._onStreamFailure.bind(this)),this.xhr.addEventListener("abort",this._onStreamAbort.bind(this)),this.xhr.open(this.method,this.url);for(let r in this.headers)this.xhr.setRequestHeader(r,this.headers[r]);this.useLastEventId&&this.lastEventId.length>0&&this.xhr.setRequestHeader("Last-Event-ID",this.lastEventId),this.xhr.withCredentials=this.withCredentials,this.xhr.send(this.payload)}},this.close=function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.autoReconnect=!1,this.xhr&&this.xhr.abort()},(t.start===void 0||t.start)&&this.stream()};Tt.INITIALIZING=-1,Tt.CONNECTING=0,Tt.OPEN=1,Tt.CLOSED=2;class Rb{constructor(t,r,n){this.options=r,this.payload=n;const o={headers:{"content-type":"application/json"}};n&&(o.payload=JSON.stringify(n)),r.apiKey&&(o.headers["api-key"]=r.apiKey),this.eventSource=new(r.EventSource??Tt)(t,o),this.eventSource.onmessage=i=>{try{const a=JSON.parse(i.data);r.onMessage(a)}catch(a){r.onError(new CustomEvent("parse-error",{detail:a}))}},this.eventSource.onerror=i=>{r.onError(i),this.isClosed()&&this.close()}}eventSource;triggeredOnClose=!1;isClosed(){return this.eventSource.readyState===EventSource.CLOSED}close(){this.isClosed()||this.eventSource.close(),this.triggeredOnClose||(this.triggeredOnClose=!0,this.options.onClose())}}const du=e=>Object.fromEntries(Object.entries(e).filter(([t,r])=>r!=null));class zb{constructor(t){this.options=t}getDefaultHeaders(t={}){const r={"Content-Type":"application/json",...t};return this.options.apiKey&&(r["api-key"]=this.options.apiKey),r}get speechRecognitionApiKey(){return this.options.speechRecognitionApiKey}async subscribeSse(t,r={},n){const o=du(r);return this.options.apiKey&&(n.apiKey=this.options.apiKey),new Rb(`${this.options.apiUrl}${t}`,n,o)}async fetchData(t,r,n={},o={}){const i=`${this.options.apiUrl}${t}?${new URLSearchParams(du(n)).toString()}`,a={...o,headers:this.getDefaultHeaders(o?.headers)},s=await fetch(i,a);if(!s.ok){const f=await s.text();throw new Error(`API request failed: ${s.status} - ${f}`)}const l=await s.json(),{success:c,data:u,error:h}=r.safeParse(l);if(this.options.strict){if(!c)throw console.error(`Server response has wrong type:
|
|
114
|
+
`,{error:h,url:i,opts:a,data:l}),new Error(`Server response has wrong type: ${h.message}`);return u}else return c||console.warn(`Server response has wrong type:
|
|
115
|
+
`,{error:h,url:i,opts:a,data:l}),l}async postData(t,r){const n=await fetch(`${this.options.apiUrl}${t}`,{method:"POST",headers:this.getDefaultHeaders(),body:JSON.stringify(r)});if(!n.ok){const o=await n.text();throw new Error(`${n.status} - ${o}`)}return n}async postFormData(t,r){const n=await fetch(`${this.options.apiUrl}${t}`,{method:"POST",body:r});if(!n.ok){const o=await n.text();throw new Error(`${n.status} - ${o}`)}return n}}const Ib=E({url:d().url().optional(),title:d().optional(),considered:V().optional(),orgMetadata:E({authors:H(d()).optional()}).optional(),type:d().optional(),date:d().datetime().optional(),similarity:ve().optional(),content:d().optional(),fromFullTextSearch:V().optional(),rerank:E({index:ve().int().optional(),adjustment:ve().optional(),score:ve().optional(),similarityOld:ve().optional()}).optional()}).or(qv),Ob=E({links:H(Ib)}),$b=e=>{if("metadata"in e)return e;console.warn("Please upgrade your backend you are currently using an old api feature.");const t=e.orgMetadata??{};e?.fromFullTextSearch&&(t.fromFullTextSearch=e?.fromFullTextSearch),e?.rerank&&(t.rerank=e?.rerank);let r=[],n=e.title??"";if(e.title&&e.title.includes(" > ")){const o=e.title.split(" > ");n=o.pop()??"",r=o}return{url:e.url??"",title:n,score:e.similarity||0,breadcrumbs:r,metadata:t,description:e.content,date:e.date}};class Pb{constructor(t){this.results=t}}class Lb{internalData;renderers=new Map;markedExtensions=[];_newTabSrText;constructor(t){const r={apiUrl:t.apiUrl,apiKey:t.apiKey,speechRecognitionApiKey:t.speechRecognitionApiKey,strict:t.strict??!1,EventSource:t.EventSource??EventSource},n=new zb(r);this.internalData={restClient:n,metadata:Cb(n),searchResponseMap:new Map,chatResponseMap:new Map,conversationMap:new Map}}setMarkedExtensions(...t){this.markedExtensions=t}setNewTabSrText(t){this._newTabSrText=t}getMetadata(){return this.internalData.metadata}createConversationId(){const t=uu();return this.renderers.set(t,new Bl({extensions:this.markedExtensions,newTabSrText:this._newTabSrText})),t}chat(t,r,n={}){const o=new Zi,i=uu(),a=new Zl,s=this.renderers.get(t)??new Bl({extensions:this.markedExtensions,newTabSrText:this._newTabSrText}),l=new up({id:i,onError:f=>{n.onError?.(f)},onFinish:f=>{o.setValue(f)},markdownRenderer:s,userQuestion:r}),c=async()=>{await a,(await u).close()},u=new Zi;(async()=>{const f=await this.internalData.metadata;if(f.mode==="maintenance")throw new Error("Can not chat in maintenance mode");const v=await this.internalData.restClient.subscribeSse("/assistant/sse",{query:r,uID:f.userId,cID:t,rID:i,lang:n.lang,feature:n.features?.join(","),referrer:n.referrer,...n.selectorValues??{},chat:"true",version:"2"},{onClose:()=>{l.finishMessage(),a.resolve(),o.cleanup()},onMessage:g=>{const b=g;switch(b.type){case"error":l.pushError(b.error);break;case"id":b.for==="request"&&i!==b.id&&console.warn(`Unexpected request id "${b.id}" expected "${i}"`),b.for==="conversation"&&t!==b.id&&console.warn(`Unexpected conversation id "${b.id}" expected "${t}"`);break;case"state":b.state==="history-entry-initialized"&&a.resolve();break;case"text":l.updateText(b.text);break;case"done":case"answer-done":l.finishMessage(),a.resolve(),u.then(A=>A.close());break;case"unexpected-call":console.error("unexpected-call:",b),l.pushError("unexpected-call");break;case"mapped-reference":l.addMappedReference(b.reference);break;case"reference":l.addOldReference(b.reference);break;case"retrieval-question":l.updateRetrievalQuestion(b.question);break}n.onMessage?.(b)},onError:g=>{console.error(" sse-error:",g),!("data"in g&&!g.data&&"responseCode"in g&&g.responseCode===0)&&l.pushError("sse-error")}});u.setValue(v)})();const h=new yb({question:r,id:i,content:o,readableStore:l.getReadableStore(),readyForFeedback:a,abort:c,liipgptClientPrimitive:this});return this.internalData.chatResponseMap.set(h.id,h),h}async thumbs(t,r,n){if((await this.internalData.metadata).mode!=="ready")throw new Error("Can not post feedback unless we are in ready mode");const i={feedback:n,rID:t,query:r};await this.internalData.restClient.postData("/quickfeedback",i)}thumbsUp(t,r){return this.thumbs(t,r,"positive")}thumbsDown(t,r){return this.thumbs(t,r,"negative")}async feedback(t,r,n){const o=await this.internalData.metadata;if(o.mode!=="ready")throw new Error("Can not post feedback unless we are in ready mode");if(n.message){const i={body:n.message,email:n.email,rID:t,uID:o.userId,query:r};await this.internalData.restClient.postData("/feedback",i)}n.classification&&await this.internalData.restClient.postData("/classification",{impact:n.classification.impact,quality:n.classification.quality,rID:t})}async search(t,r={}){const n=await this.internalData.metadata,o=n.mode==="ready"?n.userId:void 0,{links:i}=await this.internalData.restClient.fetchData("/assistant/search",Ob,{modelId:r.model,lang:r.language,query:t,mapResults:"true",uID:o}),a=i.map($b);return new Pb(a)}async getChatConfig(){return this.internalData.restClient.fetchData("/chatconfig",au)}async getPredefinedQuestions(t){return(await this.internalData.restClient.fetchData("/topics/questions",vb,t)).predefinedQuestions}async transcribeAudio(t,r={}){const n=await this.internalData.metadata,o=r.lang||"de-CH";if(n.mode==="maintenance")throw new Error("Can not transcribe audio in maintenance mode");try{const a=(u=>u.includes("mp4")?"mp4":u.includes("webm")?"webm":(u.includes("wav"),"wav"))(t.type),s=new FormData;return s.append("file",t,`audio.${a}`),s.append("lang",o),s.append("type",t.type),{transcript:await(await this.internalData.restClient.postFormData(`/speech?key=${this.internalData.restClient.speechRecognitionApiKey||""}&lang=${o}`,s)).text()||"",error:void 0}}catch(i){return console.error("Error transcribing audio:",i),{transcript:"",error:i instanceof Error?i.message:"Unknown error"}}}}const Db=600;function hu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var sa,fu;function Nb(){if(fu)return sa;fu=1;var e=function(_){return t(_)&&!r(_)};function t(w){return!!w&&typeof w=="object"}function r(w){var _=Object.prototype.toString.call(w);return _==="[object RegExp]"||_==="[object Date]"||i(w)}var n=typeof Symbol=="function"&&Symbol.for,o=n?Symbol.for("react.element"):60103;function i(w){return w.$$typeof===o}function a(w){return Array.isArray(w)?[]:{}}function s(w,_){return _.clone!==!1&&_.isMergeableObject(w)?b(a(w),w,_):w}function l(w,_,S){return w.concat(_).map(function(T){return s(T,S)})}function c(w,_){if(!_.customMerge)return b;var S=_.customMerge(w);return typeof S=="function"?S:b}function u(w){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(w).filter(function(_){return Object.propertyIsEnumerable.call(w,_)}):[]}function h(w){return Object.keys(w).concat(u(w))}function f(w,_){try{return _ in w}catch{return!1}}function v(w,_){return f(w,_)&&!(Object.hasOwnProperty.call(w,_)&&Object.propertyIsEnumerable.call(w,_))}function g(w,_,S){var T={};return S.isMergeableObject(w)&&h(w).forEach(function(C){T[C]=s(w[C],S)}),h(_).forEach(function(C){v(w,C)||(f(w,C)&&S.isMergeableObject(_[C])?T[C]=c(C,S)(w[C],_[C],S):T[C]=s(_[C],S))}),T}function b(w,_,S){S=S||{},S.arrayMerge=S.arrayMerge||l,S.isMergeableObject=S.isMergeableObject||e,S.cloneUnlessOtherwiseSpecified=s;var T=Array.isArray(_),C=Array.isArray(w),P=T===C;return P?T?S.arrayMerge(w,_,S):g(w,_,S):s(_,S)}b.all=function(_,S){if(!Array.isArray(_))throw new Error("first argument should be an array");return _.reduce(function(T,C){return b(T,C,S)},{})};var A=b;return sa=A,sa}var Mb=Nb();const Fn=hu(Mb),Fb=e=>e===null||typeof e!="object",la=e=>{if(Fb(e))return e;if(Array.isArray(e))return e.map(la);const t=Object.entries(e).filter(([r,n])=>n!==void 0).map(([r,n])=>[r,la(n)]);return Object.fromEntries(t)},Io=(e,t)=>{const r=la(t);return Fn(e,r)},pu={tokens:{font:{family:"-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif"},colors:{brand:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#2d3748",900:"#1a202c",950:"#171923"},highlight:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#2d3748",900:"#1a202c",950:"#171923"},grey:{0:"#ffffff",50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#2d3748",900:"#1a202c",950:"#171923",1e3:"#000000"}},base:{fontSizeXs:{minRem:.75,maxRem:.875},fontSizeSm:{minRem:1,maxRem:1},fontSizeBody:{minRem:1,maxRem:1.25},fontSizeH3:{minRem:1.125,maxRem:1.5},fontSizeH2:{minRem:1.25,maxRem:1.75},fontSizeH1:{minRem:1.5,maxRem:2},fontWeightNormal:"400",fontWeightBold:"700",fontWeightTitle:"700",lineHeightDefault:"1.5",lineHeightSnug:"1.375",lineHeightTight:"1.25",borderRadius:{minRem:.5,maxRem:.75},lineColor:"color-mix(in srgb, var(--color-brand-950) 20%, transparent)",boxShadow:"0px 0px 2px rgba(0, 0, 0, 0.15), 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)"},components:{body:{background:"var(--color-grey-0)",color:"var(--color-grey-900)",focus:{color:"var(--color-highlight-500)"},custom:{selectionColor:"var(--color-grey-0)",selectionBackground:"var(--color-brand-700)",focusWidth:"var(--spacer-3)",focusOffset:"var(--spacer-2)",focusStyle:"solid"}},container:{custom:{maxWidth:"1024px"}},avatar:{color:"var(--color-brand-400)",background:"var(--color-grey-100)"},anchor:{color:"var(--color-brand-700)",hover:{color:"var(--color-brand-950)"}},btnPrimary:{color:"var(--color-grey-0)",background:"var(--color-brand-700)",borderRadius:"var(--base-border-radius)",hover:{background:"var(--color-brand-900)"}},btnSecondary:{color:"var(--color-brand-700)",background:"var(--color-brand-100)",borderRadius:"var(--base-border-radius)",hover:{color:"var(--color-grey-1000)",background:"var(--color-brand-200)"}},btnTertiary:{color:"var(--anchor-color)",background:"transparent",borderRadius:"var(--base-border-radius)",hover:{color:"var(--anchor-hover-color)"}},card:{color:"var(--color-grey-900)",background:"var(--color-grey-100)",borderRadius:"var(--base-border-radius)",boxShadow:"none",hover:{color:"var(--color-grey-1000)",background:"var(--color-brand-100)"},custom:{iconColor:"var(--anchor-color)",iconHoverColor:"var(--anchor-hover-color)"}},input:{background:"var(--color-grey-0)",borderColor:"var(--color-grey-300)",borderWidth:"1px",borderRadius:"var(--base-border-radius)",custom:{padding:"var(--spacer-r-16) var(--spacer-r-20)",placeholderColor:"var(--color-grey-500)",placeholderOpacity:"1"}},label:{color:"var(--color-grey-600)"},hr:{color:"var(--base-line-color)"},checkbox:{color:"transparent",background:"var(--color-grey-0)",borderColor:"var(--color-grey-300)",borderWidth:"1px",borderRadius:"0.2em",custom:{checkedColor:"var(--btn-primary-color)",checkedBorderColor:"var(--color-brand-700)",checkedBackground:"var(--color-brand-700)"}},radio:{color:"transparent",background:"var(--color-grey-0)",borderColor:"var(--color-grey-300)",borderWidth:"1px",custom:{checkedColor:"var(--btn-primary-color)",checkedBorderColor:"var(--color-brand-700)",checkedBackground:"var(--color-brand-700)"}},contextBox:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",boxShadow:"var(--base-box-shadow)",custom:{transitionDuration:200,transitionDelay:200,transitionY:8,titleColor:"var(--color-grey-1000)",titleFontWeight:"var(--base-font-weight-bold)",separatorColor:"var(--base-line-color)",errorColor:"var(--message-error-color)"}},contextBoxMenuItem:{background:"transparent",color:"var(--body-color)",borderRadius:"calc(var(--base-border-radius) / 2)",hover:{color:"var(--btn-secondary-hover-color)",background:"var(--btn-secondary-hover-background)"},custom:{activeColor:"var(--btn-secondary-hover-color)",activeBackground:"var(--btn-secondary-hover-background)"}},chatFooter:{color:"var(--color-grey-400)",background:"var(--body-background)",borderRadius:"var(--base-border-radius)",boxShadow:"0px -10px 20px 5px color-mix(in srgb, var(--body-background) 90%, transparent)"},chatInput:{color:"var(--color-grey-700)",background:"var(--card-background)",borderRadius:"var(--base-border-radius)",borderColor:"transparent",borderWidth:"3px",hover:{background:"var(--card-hover-background)"},focus:{borderColor:"var(--body-focus-color)"}},chatInputSubmit:{color:"var(--btn-primary-color)",background:"var(--btn-primary-background)",borderRadius:"calc(var(--base-border-radius) / 1.25)",hover:{color:"var(--btn-primary-hover-color)",background:"var(--btn-primary-hover-background)"},custom:{strokeWidth:"2",deactivatedBackground:"var(--color-grey-500)",deactivatedOpacity:"0.25",deactivatedScale:"0.8",deactivatedBorderColor:"var(--color-grey-500)"}},chatInputNotification:{background:"#DD135A",color:"var(--color-grey-0)",borderColor:"#DD135A",borderWidth:"1px",borderRadius:"var(--chat-input-border-radius)"},dialog:{background:"var(--card-background)",color:"var(--body-color)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",boxShadow:"var(--base-box-shadow)",custom:{transitionDuration:200,transitionDelay:0,transitionY:30,backgroundOverlay:"rgba(0, 0, 0, 0.25)",headerBorderBottomColor:"var(--base-line-color)"}},aside:{background:"var(--card-background)",custom:{width:"400px",containerWidthForMobileLayout:1024,backgroundOverlay:"rgba(0, 0, 0, 0.4)",headerColor:"var(--card-color)",headerBorderColor:"var(--base-line-color)",headerBorderWidth:"1px"}},message:{color:"var(--body-color)",custom:{errorColor:"#C91658",transitionDuration:300,transitionDelay:0,transitionY:30,transitionBotLoadingDelay:300}},messageOptions:{borderColor:"var(--base-line-color)",borderWidth:"1px",custom:{transitionDuration:300,transitionDelay:0,transitionY:30}},messageUser:{color:"var(--body-color)",background:"var(--card-background)",boxShadow:"var(--card-box-shadow)",borderRadius:"var(--card-border-radius)"},openButton:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-background)",borderWidth:"0",borderRadius:"calc(var(--base-border-radius) / 2)",hover:{color:"var(--card-hover-color)",background:"var(--card-hover-background)"},custom:{hideTitleWhenCollapsed:0,autoExpandScrollThreshold:0,autoCollapseDelay:0,autoExpandOnce:0}},referencesToggle:{color:"var(--color-brand-700)",hover:{color:"var(--anchor-hover-color)"}},referenceNumberTrigger:{color:"var(--btn-secondary-color)",background:"var(--btn-secondary-background)",borderRadius:"calc(var(--base-border-radius) / 2)",hover:{color:"var(--btn-secondary-hover-color)",background:"var(--btn-secondary-hover-background)"},custom:{padding:"0.25em"}},referenceDomain:{color:"var(--color-brand-700)",hover:{color:"var(--color-brand-800)"},custom:{padding:"0px"}},referenceNumberContent:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",hover:{color:"var(--card-hover-color)",background:"var(--card-hover-background)",borderColor:"var(--card-hover-border-color)",borderWidth:"var(--card-hover-border-width)"},boxShadow:"var(--base-box-shadow)",custom:{width:"95cqi",maxWidth:"450px",transitionDuration:200,transitionDelay:200,transitionY:8}},reference:{color:"var(--card-color)",background:"var(--card-background)",borderColor:"var(--card-border-color)",borderWidth:"var(--card-border-width)",borderRadius:"var(--card-border-radius)",hover:{color:"var(--card-hover-color)",background:"var(--body-background)",borderColor:"var(--card-hover-border-color)",borderWidth:"var(--card-hover-border-width)"}},referenceDescription:{color:"var(--reference-color)",hover:{color:"var(--reference-hover-color)"}},referenceNumber:{color:"var(--reference-number-trigger-color)",background:"var(--body-background)",borderColor:"var(--reference-number-trigger-border-color)",borderWidth:"var(--reference-number-trigger-border-width)",borderRadius:"var(--reference-number-trigger-border-radius)",hover:{color:"var(--reference-number-trigger-color)",background:"var(--reference-number-trigger-background)",borderColor:"var(--reference-number-trigger-border-color)",borderWidth:"var(--reference-number-trigger-border-width)"},custom:{padding:"var(--reference-number-trigger-padding)"}},toast:{background:"var(--card-background)",color:"var(--body-color)",boxShadow:"var(--base-box-shadow)",borderRadius:"var(--card-border-radius)",custom:{iconSuccessColor:"#22c55e",iconErrorColor:"#ef4444",iconWarningColor:"#f97316",iconInfoColor:"#3b82f6"}},tooltip:{background:"var(--color-grey-200)",color:"var(--body-color)",borderRadius:"calc(var(--base-border-radius) / 2)"},flyout:{custom:{backdropColor:"var(--color-brand-800)",backdropOpacity:"0.4",backdropDelayIn:"0",backdropDurationIn:"200",backdropDelayOut:"0",backdropDurationOut:"150",backdropBaseScaleIn:"1",backdropBaseScaleOut:"1",backdropTransformOrigin:"center",backdropScaleDirection:"scale"}}},svgs:{predefinedQuestion:`
|
|
77
116
|
<svg viewBox="0 0 24 24" >
|
|
78
117
|
<path d="M11 3.5A10.5 10.5 0 0 0 0.5 14v1.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
|
|
79
118
|
<path d="M0.5 15.498a5 5 0 1 0 10 0 5 5 0 1 0 -10 0" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
|
|
@@ -358,7 +397,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An err
|
|
|
358
397
|
<path stroke="currentColor" d="M11.998 16.0161c-0.138 0 -0.25 -0.1119 -0.25 -0.25s0.112 -0.25 0.25 -0.25" stroke-width="2"></path>
|
|
359
398
|
<path stroke="currentColor" d="M11.998 16.0161c0.1381 0 0.25 -0.1119 0.25 -0.25s-0.1119 -0.25 -0.25 -0.25" stroke-width="2"></path>
|
|
360
399
|
</svg>
|
|
361
|
-
`,embedAvatar:""}}},
|
|
400
|
+
`,embedAvatar:""}}},jb=Io(pu,{tokens:{base:{lineColor:"color-mix(in srgb, var(--color-brand-100) 20%, transparent)"},components:{body:{background:"var(--color-grey-900)",color:"var(--color-grey-100)",focus:{color:"var(--color-highlight-400)"},custom:{selectionColor:"var(--color-grey-1000)",selectionBackground:"var(--color-brand-400)"}},avatar:{color:"var(--color-brand-200)",background:"var(--color-grey-800)"},anchor:{color:"var(--color-brand-300)",hover:{color:"var(--color-brand-50)"}},btnPrimary:{color:"var(--color-grey-1000)",background:"var(--color-brand-300)",hover:{background:"var(--color-brand-100)"}},btnSecondary:{color:"var(--color-brand-100)",background:"var(--color-brand-900)",hover:{color:"var(--color-grey-0)",background:"var(--color-brand-800)"}},btnTertiary:{color:"var(--anchor-color)",background:"transparent",borderRadius:"var(--base-border-radius)",hover:{color:"var(--anchor-hover-color)"}},card:{color:"var(--body-color)",background:"var(--color-grey-800)",hover:{color:"var(--color-grey-0)",background:"var(--color-brand-900)"}},input:{background:"var(--color-grey-900)",borderColor:"var(--color-grey-700)",custom:{placeholderColor:"var(--color-grey-400)"}},label:{color:"var(--color-grey-50)"},checkbox:{background:"var(--color-grey-700)",borderColor:"var(--color-grey-500)",custom:{checkedColor:"var(--color-grey-900)",checkedBorderColor:"var(--color-brand-300)",checkedBackground:"var(--color-brand-300)"}},radio:{background:"var(--color-grey-700)",borderColor:"var(--color-grey-500)",custom:{checkedColor:"var(--color-grey-900)",checkedBorderColor:"var(--color-brand-300)",checkedBackground:"var(--color-brand-300)"}},contextBox:{custom:{titleColor:"var(--color-grey-50)"}},referenceDescription:{color:"var(--color-grey-300)",hover:{color:"var(--color-grey-300)"}},chatFooter:{color:"var(--color-grey-500)"},chatInput:{color:"var(--color-grey-100)"},chatInputSubmit:{custom:{deactivatedBackground:"var(--color-grey-400)",deactivatedBorderColor:"var(--color-grey-400)"}},dialog:{custom:{backgroundOverlay:"rgba(0, 0, 0, 0.5)"}},tooltip:{background:"var(--color-grey-1000)"}}}}),Oo={fineGrained:{light:pu,dark:jb}},ca=e=>typeof e=="string"?na[e]:e,Bb=e=>{const t=ca(e?.colors?.brand||na.gray),r=ca(e?.colors?.highlight||t),n={0:"#ffffff",1e3:"#000000",...ca(e?.colors?.grey||na.gray)};let o;return e.avatarImageUrl?o=`<img src="${e.avatarImageUrl}" alt="Avatar" style="width: 100%; height: 100%; object-fit: cover; border-radius: 50%; aspect-ratio: 1 / 1; display: block; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.1));" />`:o=Oo.fineGrained.light.tokens.svgs.avatar,{fontURLs:e.font?.urls,tokens:{font:{family:e.font?.family},colors:{brand:t,highlight:r,grey:n},base:{fontSizeXs:e.font?.sizeXs,fontSizeSm:e.font?.sizeSm,fontSizeBody:e.font?.sizeBody,fontSizeH3:e.font?.sizeH3,fontSizeH2:e.font?.sizeH2,fontSizeH1:e.font?.sizeH1,fontWeightNormal:e.font?.weightBold,fontWeightBold:e.font?.weightNormal,fontWeightTitle:e.font?.weightTitle,borderRadius:e.borderRadius},components:{body:{background:e.colors?.background,color:e.colors?.text},anchor:{color:e.colors?.anchor?.default,hover:{color:e.colors?.anchor?.hover}}},svgs:{avatar:o}}}},Zb=e=>{const t=Bb(e);return{light:Io(Oo.fineGrained.light,t)}},Ub=e=>{const t={};return e.dark&&(t.dark=Io(Oo.fineGrained.dark,e.dark)),e.light&&(t.light=Io(Oo.fineGrained.light,e.light)),!e.dark&&!e.light&&(t.light=e.light),t},jn={de:{askQuestionAgain:"Frage erneut stellen",answerGood:"Gute Antwort",answerBad:"Schlechte Antwort",chatInputPlaceholder:"Fragen Sie mich etwas",chatInputPlaceholderListening:"Ich höre zu...",chatInputSubmit:"Aufforderung senden",chatInputAbort:"Antwort unterbrechen",chatInputStartListening:"Spracherkennung starten",chatInputStopListening:"Spracherkennung beenden",introductionTitle:'Ich bin <span class="liipgpt-gradient-text">LiipGPT</span>. Wie kann ich Ihnen heute helfen?',newChat:"Neuer Chat",maintenanceModeError:"Der Chat ist derzeit nicht verfügbar. Bitte versuchen Sie es später erneut.",messageBotLoading:"Lass mich nachdenken",messageBotError:"Es ist ein Fehler aufgetreten:",messageBotDefaultError:"Unbekannter Fehler",referenceLink:"Link zur Referenz",referencesDisplay:"Referenzen anzeigen",referencesHide:"Referenzen ausblenden",referencesTitle:"Referenzen",referencesFurtherTitle:"Weitere Referenzen",chatFooterText:"",scrollToBottom:"Nach unten scrollen",openMenu:"Menü öffnen",closeMenu:"Menü schließen",closeChat:"Chat schließen",close:"Schließen",openInfo:"Info öffnen",send:"Abschicken",thankYouForFeedback:"Danke für Dein Feedback!",giveFeedback:"Feedback geben",sendFeedback:"Feedback senden",feedbackFormTitle:"Feedback geben, um unseren Chatbot zu verbessern",feedbackFormMessage:"Ihre Nachricht",feedbackFormMessagePlaceholder:"Schreiben Sie hier Ihre Nachricht...",feedbackFormEmail:"E-Mail",feedbackFormEmailPlaceholder:"Ihre E-Mail eingeben...",classificationSubmit:"Abschicken",classificationThankYou:"Danke für Dein Feedback!",classificationTitle:"Bitte bewerten Sie den Einfluss und die Qualität der Antwort",selectLanguage:"Sprache auswählen",languageChanged:"Sprache auf Deutsch geändert.",selectColorTheme:"Farbmodus wählen",lightMode:"Hell",darkMode:"Dunkel",noResultsFound:"Keine Ergebnisse gefunden",aboutThisChat:`
|
|
362
401
|
<p>
|
|
363
402
|
<strong>Dies ist ein Platzhaltertext, um dem Chatbot Kontext zu geben</strong>
|
|
364
403
|
</p>
|
|
@@ -386,4 +425,4 @@ Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An err
|
|
|
386
425
|
<p>
|
|
387
426
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec mauris diam, vestibulum vitae cursus et, hendrerit sed dolor. Sed quis nisl quis ipsum tempus hendrerit. <a href="https://www.liipgpt.ch/" target="_blank">Plus d'informations</a>
|
|
388
427
|
</p>
|
|
389
|
-
`,ariaMainNavigation:"Navigation principale",ariaMainNavigationRegion:"Navigation principale: liens, changement de langue, mode couleur",ariaGotoMainNavigation:"Aller à la navigation principale",ariaAskQuestion:"Saisie texte",ariaAskQuestionRegion:"Poser une question",ariaNotifications:"Notifications",ariaPredefinedQuestions:"Questions prédéfinies",ariaPredefinedQuestionsRegion:"Essayez nos questions d'exemple",ariaChatHistory:"Historique du chat",ariaOpenChat:"Ouvrir le chat",ariaQuestionFromYou:"Votre question:",ariaAnswerFromBot:"Réponse de l'Assistant:",ariaLastAnswerNavigation:"Navigation et options pour la dernière réponse",ariaQuestionSent:"Question envoyée. Génération de la réponse en cours...",ariaAnswerReady:"Réponse prête.",ariaAnswerFinished:"Réponse terminée. Posez une autre question ou naviguez en arrière pour consulter l'historique du chat, donner un avis ou voir les références liées à la réponse.",ariaAskQuestionAgain:"Copier la dernière question dans le champ de saisie pour la reposer",ariaAnswerGood:"Évaluer cette réponse comme bonne",ariaAnswerBad:"Évaluer cette réponse comme mauvaise",ariaReferenceSource:"Source:",ariaGiveFeedback:"Donner un feedback détaillé sur la réponse",ariaLanguageChanged:"Langue française sélectionnée.",ariaLightSelected:"Mode clair activé.",ariaDarkSelected:"Mode sombre activé.",ariaSettings:"Paramètres du chat",ariaSettingsRegion:"Ajustez vos préférences de chat",ariaReferencesRegion:"Références pour la question actuelle",ariaOpensInNewTab:"(ouvre dans un nouvel onglet)",ariaFlyoutRegion:"Chatbot",ariaSelected:"sélectionné",ariaUnselected:"non sélectionné",ariaAllSelected:"Tous les éléments sélectionnés",ariaAllUnselected:"Tous les éléments non sélectionnés",ariaAllReseted:"Éléments par défaut sélectionnés",hideSettings:"Masquer les paramètres",showSettings:"Paramètres",chooseAtLeastOneOption:"Veuillez choisir au moins une option",selectAll:"Tout sélectionner",selectNone:"Tout désélectionner",resetToDefaults:"Réinitialiser",messageTooLong:"Votre message doit être plus court que {questionLengthLimit} caractères. Actuellement, il fait {questionLength} caractères"}},Tp=Object.freeze(Object.defineProperty({__proto__:null,translations:Pr},Symbol.toStringTag,{value:"Module"})),Ep=t=>{t=t??Pr;const e={};return t.de&&(e.de=Ln(Pr.de,t.de)),t.en&&(e.en=Ln(Pr.en,t.en)),t.fr&&(e.fr=Ln(Pr.fr,t.fr)),t.it&&(e.it=Ln(Pr.it,t.it)),e},Cp=t=>({init:t?.init??[],bot:{before:t?.bot?.before??[],after:t?.bot?.after??[]},user:{before:t?.user?.before??[],after:t?.user?.after??[]}}),oc=t=>{let e;t.theme?.fineGrained?e=Sp(t.theme?.fineGrained):e=xp(t?.theme??{});const r=Ep(t?.translations),n={...t,showPredefinedQuestions:t.showPredefinedQuestions??!0,showOverallFeedbackButton:t.showOverallFeedbackButton??!1,showOverallFeedbackEmail:t.showOverallFeedbackEmail??!0,showCloseChatButton:t.showCloseChatButton??!1,showContextInfo:t.showContextInfo??!1,showContextMenu:t.showContextMenu??!1,showReferencesByDefault:t.showReferencesByDefault??!1,showTextFeedback:t.showTextFeedback??!0,showExpandedSelectors:t.showExpandedSelectors??!1,inlineLayout:t.inlineLayout??!1,questionPrefix:t.questionPrefix??"",blockPII:t.blockPII??!1,allowAudioInput:t.allowAudioInput??!1,supportedLanguages:t.supportedLanguages??Object.keys(r),fullTheme:e,translations:r,buttonHref:t.buttonHref,addQueryToUrlParams:t.addQueryToUrlParams??!0,addRetrievalQuestionToUrlParams:t.addRetrievalQuestionToUrlParams??!1,renderKatex:t.renderKatex??!1,sendReferrer:t.sendReferrer??"all",selectorsConfig:t.selectorsConfig??[],questionLengthLimit:t.questionLengthLimit??mp,forceConsent:t.forceConsent??!1,askQuestionAgain:t.askQuestionAgain??!1,enableBackdrop:t.enableBackdrop??!1,messageAdditions:Cp(t.messageAdditions??{}),contextVersion:t.contextVersion??0};return t.classification&&(n.classification=t.classification),t.menu&&(n.menu=t.menu),n},sc={de:{aborted:"Verbindung zum Server wurde unerwartet unterbrochen. Bitte versuchen Sie es erneut.","client-error":"Ein unbekannter Fehler ist aufgetreten. Bitte versuchen Sie es erneut.","server-error":"Ein unbekannter Fehler ist aufgetreten. Bitte versuchen Sie es erneut.","sse-error":"Ein unbekannter Fehler ist aufgetreten. Bitte versuchen Sie es erneut.",blocked:"Ihre Anfrage wurde blockiert.","pii-detected":"Es wurden persönliche Daten erkannt. Bitte entfernen Sie diese und versuchen Sie es erneut.","incomplete-error":"Ein unbekannter Fehler ist aufgetreten. Die Antwort könnte unvollständig sein.","unexpected-call":"Ein unbekannter Fehler ist aufgetreten. Die Antwort könnte unvollständig sein.","quota-reached":"Kontingent überschritten. Bitte versuchen Sie es später erneut.","rate-limit":"Kontingent überschritten. Bitte versuchen Sie es später erneut.",maintenance:"Der Chat ist derzeit nicht verfügbar. Bitte versuchen Sie es später erneut.","too-long":"Ihre Frage war zu lang, versuchen Sie es mit einer Kürzeren.","too-short":"Ihre Frage war zu kurz, versuchen Sie es mit einer Längeren.","feedback-failed":"Feedback senden fehlgeschlagen. Bitte versuchen Sie es erneut.","speech-not-supported":"Spracherkennung wird nicht unterstützt.","speech-transcription-failed":"Sprachtranskription fehlgeschlagen.","speech-no-text-detected":"Kein Text in der Spracheingabe erkannt.","speech-microphone-access-denied":"Mikrofonzugriff verweigert."},en:{aborted:"Connection to the server was unexpectedly interrupted. Please try again.","client-error":"An unknown error has occurred. Please try again.","server-error":"An unknown error has occurred. Please try again.","sse-error":"An unknown error has occurred. Please try again.",blocked:"Your request has been blocked.","pii-detected":"Personal data has been detected. Please remove it and try again.","incomplete-error":"An unknown error has occurred. The response might be incomplete.","unexpected-call":"An unknown error has occurred. The response might be incomplete.","quota-reached":"Quota exceeded. Please try again later.","rate-limit":"Quota exceeded. Please try again later.",maintenance:"The chat is currently unavailable. Please try again later.","too-long":"Your question was too long, try a shorter one.","too-short":"Your question was too short, try a longer one.","feedback-failed":"Failed to send feedback. Please try again.","speech-not-supported":"Speech recognition is not supported.","speech-transcription-failed":"Speech transcription failed.","speech-no-text-detected":"No text detected in speech input.","speech-microphone-access-denied":"Microphone access denied."},it:{aborted:"La connessione al server è stata interrotta inaspettatamente. Si prega di riprovare.","client-error":"Si è verificato un errore sconosciuto. Si prega di riprovare.","server-error":"Si è verificato un errore sconosciuto. Si prega di riprovare.","sse-error":"Si è verificato un errore sconosciuto. Si prega di riprovare.",blocked:"La tua richiesta è stata bloccata.","pii-detected":"Sono stati rilevati dati personali. Si prega di rimuoverli e riprovare.","incomplete-error":"Si è verificato un errore sconosciuto. La risposta potrebbe essere incompleta.","unexpected-call":"Si è verificato un errore sconosciuto. La risposta potrebbe essere incompleta.","quota-reached":"Quota superata. Si prega di riprovare più tardi.","rate-limit":"Quota superata. Si prega di riprovare più tardi.",maintenance:"La chat non è attualmente disponibile. Si prega di riprovare più tardi.","too-long":"La tua domanda era troppo lunga, prova con una più breve.","too-short":"La tua domanda era troppo breve, prova con una più lunga.","feedback-failed":"Invio del feedback non riuscito. Si prega di riprovare.","speech-not-supported":"Il riconoscimento vocale non è supportato.","speech-transcription-failed":"Trascrizione vocale fallita.","speech-no-text-detected":"Nessun testo rilevato nell'input vocale.","speech-microphone-access-denied":"Accesso al microfono negato."},fr:{aborted:"La connexion au serveur a été interrompue de façon inattendue. Veuillez réessayer.","client-error":"Une erreur inconnue s'est produite. Veuillez réessayer.","server-error":"Une erreur inconnue s'est produite. Veuillez réessayer.","sse-error":"Une erreur inconnue s'est produite. Veuillez réessayer.","pii-detected":"Des données personnelles ont été détectées. Veuillez les supprimer et réessayer.",blocked:"Votre demande a été bloquée.","incomplete-error":"Une erreur inconnue s'est produite. La réponse pourrait être incomplète.","unexpected-call":"Une erreur inconnue s'est produite. La réponse pourrait être incomplète.","quota-reached":"Quota dépassé. Veuillez réessayer plus tard.","rate-limit":"Quota dépassé. Veuillez réessayer plus tard.",maintenance:"Le chat est actuellement indisponible. Veuillez réessayer plus tard.","too-long":"Votre question était trop longue, essayez d'en poser une plus courte.","too-short":"Votre question était trop courte, essayez d'en poser une plus longue.","feedback-failed":"Échec de l'envoi du feedback. Veuillez réessayer.","speech-not-supported":"La reconnaissance vocale n'est pas prise en charge.","speech-transcription-failed":"Échec de la transcription vocale.","speech-no-text-detected":"Aucun texte détecté dans l'entrée vocale.","speech-microphone-access-denied":"Accès au microphone refusé."}},lc={de:{email:"Bitte keine E-Mail Adressen eingeben",creditCard:"Bitte keine Kreditkarteninformationen eingeben",ahv:"Bitte keine AHV-Nummern eingeben",phoneSwiss:"Bitte keine Telefonnummern eingeben",phoneInternational:"Bitte keine Telefonnummern eingeben",swissPassport:"Bitte keine Passinformationen eingeben",longNumber:"Bitte keine langen Nummern eingeben"},en:{email:"Please do not enter email addresses",creditCard:"Please do not enter credit card information",ahv:"Please do not enter AHV numbers",phoneSwiss:"Please do not enter phone numbers",phoneInternational:"Please do not enter phone numbers",swissPassport:"Please do not enter passport information",longNumber:"Please do not enter long numbers"},it:{email:"Si prega di non inserire indirizzi email",creditCard:"Si prega di non inserire informazioni sulla carta di credito",ahv:"Si prega di non inserire numeri AVS",phoneSwiss:"Si prega di non inserire numeri di telefono",phoneInternational:"Si prega di non inserire numeri di telefono",swissPassport:"Si prega di non inserire informazioni sul passaporto",longNumber:"Si prega di non inserire numeri lunghi"},fr:{email:"Veuillez ne pas saisir d'adresses e-mail",creditCard:"Veuillez ne pas saisir d'informations de carte de crédit",ahv:"Veuillez ne pas saisir de numéros AVS",phoneSwiss:"Veuillez ne pas saisir de numéros de téléphone",phoneInternational:"Veuillez ne pas saisir de numéros de téléphone",swissPassport:"Veuillez ne pas saisir d'informations de passeport",longNumber:"Veuillez ne pas saisir de longs numéros"}},Xi=structuredClone(fr.fineGrained.light);Xi.tokens.colors={brand:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#037ABA",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},highlight:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},grey:{0:"#ffffff",50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#2d3748",900:"#1a202c",950:"#171923",1e3:"#000000"}};const cc=structuredClone(fr.fineGrained.dark);cc.tokens.colors=Xi.tokens.colors;const Ap=Object.freeze(Object.defineProperty({__proto__:null,theme:{fineGrained:{light:Xi,dark:cc}}},Symbol.toStringTag,{value:"Module"})),uc=t=>t.split("/").pop().split(".")[0],Rp=Object.assign({"./default/fallback-dev.theme.ts":Ap,"./default/fallback.theme.ts":wp}),Ji=new Map;Object.entries(Rp).forEach(([t,e])=>{const{error:r,data:n}=ql.safeParse(e?.theme);if(r){console.error(`Invalid theme in ${t}:`,r);return}Ji.set(uc(t),n)});const X0=t=>{const e=Ji.get(t);return e||(console.error(`Theme ${t} not found`),fr)};Array.from(Ji.keys());const Ip=Object.assign({"./default/fallback.translations.ts":Tp}),eo=new Map;Object.entries(Ip).forEach(([t,e])=>{const{error:r,data:n}=Zl.safeParse(e?.translations);if(r){console.error(`Invalid translations in ${t}:`,r);return}eo.set(uc(t),n)});const J0=t=>{const e=eo.get(t);return e||(console.error(`Theme ${t} not found`),Pr)};Array.from(eo.keys());const Lp="en",dc=(t,e)=>e.includes(t),Ta=(t,e)=>{if(dc(t,e))return t;const r=Op();return dc(r,e)?r:Lp},Op=()=>navigator.language.split("-")[0],hc=(t,e)=>{localStorage.setItem("liipgpt:selectedLanguage",t),e&&(e.lang=t)},fc=t=>Ta(localStorage.getItem("liipgpt:selectedLanguage"),t);var to,pc;function Mp(){return pc||(pc=1,to=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,a,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(a=n;a--!==0;)if(!t(e[a],r[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=n;a--!==0;){var o=i[a];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}),to}var Np=Mp();const Pp=nc(Np),Dp=typeof document<"u";let gc=0;class $p{#e=te(St([]));get toasts(){return _(this.#e)}set toasts(e){$(this.#e,e,!0)}#t=te(St([]));get heights(){return _(this.#t)}set heights(e){$(this.#t,e,!0)}#a=e=>{const r=this.toasts.findIndex(n=>n.id===e);return r===-1?null:r};addToast=e=>{Dp&&this.toasts.unshift(e)};updateToast=({id:e,data:r,type:n,message:a})=>{const i=this.toasts.findIndex(s=>s.id===e),o=this.toasts[i];this.toasts[i]={...o,...r,id:e,title:a,type:n,updated:!0}};create=e=>{const{message:r,...n}=e,a=typeof e?.id=="number"||e.id&&e.id?.length>0?e.id:gc++,i=e.dismissable===void 0?!0:e.dismissable,o=e.type===void 0?"default":e.type;return mt(()=>{this.toasts.find(c=>c.id===a)?this.updateToast({id:a,data:e,type:o,message:r,dismissable:i}):this.addToast({...n,id:a,title:r,dismissable:i,type:o})}),a};dismiss=e=>(mt(()=>{if(e===void 0){this.toasts=this.toasts.map(n=>({...n,dismiss:!0}));return}const r=this.toasts.findIndex(n=>n.id===e);this.toasts[r]&&(this.toasts[r]={...this.toasts[r],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}const r=this.#a(e);if(r!==null)return this.toasts.splice(r,1),e};message=(e,r)=>this.create({...r,type:"default",message:e});error=(e,r)=>this.create({...r,type:"error",message:e});success=(e,r)=>this.create({...r,type:"success",message:e});info=(e,r)=>this.create({...r,type:"info",message:e});warning=(e,r)=>this.create({...r,type:"warning",message:e});loading=(e,r)=>this.create({...r,type:"loading",message:e});promise=(e,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:e,type:"loading",message:typeof r.loading=="string"?r.loading:r.loading()}));const a=e instanceof Promise?e:e();let i=n!==void 0;return a.then(o=>{if(typeof o=="object"&&o&&"ok"in o&&typeof o.ok=="boolean"&&!o.ok){i=!1;const s=zp(o);this.create({id:n,type:"error",message:s})}else if(r.success!==void 0){i=!1;const s=typeof r.success=="function"?r.success(o):r.success;this.create({id:n,type:"success",message:s})}}).catch(o=>{if(r.error!==void 0){i=!1;const s=typeof r.error=="function"?r.error(o):r.error;this.create({id:n,type:"error",message:s})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),r.finally?.()}),n};custom=(e,r)=>{const n=r?.id||gc++;return this.create({component:e,id:n,...r}),n};removeHeight=e=>{this.heights=this.heights.filter(r=>r.toastId!==e)};setHeight=e=>{const r=this.#a(e.toastId);if(r===null){this.heights.push(e);return}this.heights[r]=e};reset=()=>{this.toasts=[],this.heights=[]}}function zp(t){return t&&typeof t=="object"&&"status"in t?`HTTP error! Status: ${t.status}`:`Error! ${t}`}const yt=new $p;function Fp(t,e){return yt.create({message:t,...e})}const ro=Object.assign(Fp,{success:yt.success,info:yt.info,warning:yt.warning,error:yt.error,custom:yt.custom,message:yt.message,promise:yt.promise,dismiss:yt.dismiss,loading:yt.loading,getActiveToasts:()=>yt.toasts.filter(t=>!t.dismiss)}),Bp=t=>{const e=new Set;Object.getOwnPropertyNames(t).forEach(n=>e.add(n));let r=Object.getPrototypeOf(t);for(;r&&r!==Object.prototype;)Object.getOwnPropertyNames(r).forEach(n=>e.add(n)),r=Object.getPrototypeOf(r);return Array.from(e)},jp=(t,e)=>{const r={};return e.forEach(n=>{r[n]=t[n]}),r},Up=console.warn,qp=()=>{},mc=(t,e)=>mt(()=>{console.warn=qp;const r=e?jp(t,e):t,n=Eu(r);return console.warn=Up,n}),Vp=t=>t&&typeof t.then=="function";class Hp{config;self;devtools;stateKeys;constructor(e,r){this.config=e,this.self=r,typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&(this.stateKeys=Bp(this.config.state),this.devtools=window.__REDUX_DEVTOOLS_EXTENSION__.connect({name:this.config.name??"updatelogic"}),this.devtools.init(this.createStateSnapshot()),this.devtools.subscribe(n=>{n.type==="DISPATCH"&&n.state}))}createStateSnapshot(){return mc(this.config.state,this.stateKeys)}sendStart(e,r){this.devtools.send({type:`→ ${e}`,args:r},this.createStateSnapshot())}sendError(e,r,n){this.devtools.send({type:`❌ ${e}`,args:r,error:n},this.createStateSnapshot())}sendSuccess(e,r,n){this.devtools.send({type:`✓ ${e}`,args:r,return:n},this.createStateSnapshot())}isIncluded(e){return this.config.excludeInDevTools?!this.config.excludeInDevTools.includes(e):!0}createProxyFunction(e,r){const n=this.devtools&&this.isIncluded(e);return typeof r=="function"?(...a)=>{if(!n)return mt(()=>r.call(this.self,...a));const i=mc(a);this.sendStart(e,i);try{const o=mt(()=>r.call(this.self,...a));return Vp(o)?o.then(s=>(this.sendSuccess(e,i,s),s),s=>{throw this.sendError(e,i,s),s}):(this.sendSuccess(e,i,o),o)}catch(o){throw this.sendError(e,i,o),o}}:r}}const Zp=(t,e)=>{const r={},n=new Hp(t,r);return Object.keys(e).forEach(a=>{if(a==="state"||a==="name")return;const i=e[a];r[a]=n.createProxyFunction(a,i)}),r};async function Gp(){if(typeof navigator>"u"||!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return!1;try{return(await navigator.mediaDevices.enumerateDevices()).some(e=>e.kind==="audioinput")}catch(t){return console.error("Error checking for microphone:",t),!1}}function no(){return typeof window>"u"||!window.MediaRecorder?null:MediaRecorder.isTypeSupported("audio/mp4")?"audio/mp4":MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":MediaRecorder.isTypeSupported("audio/wav")?"audio/wav":null}function vc(){return typeof window>"u"?!1:!!(window.MediaRecorder&&no())}class bc{mediaRecorder=null;audioChunks=[];started=!1;starting=!1;stream=null;options;audioContext=null;analyser=null;dataArray=null;volumeUpdateInterval=null;constructor(e={}){this.options=e}async start(){if(this.started||this.starting){console.warn("AudioRecorder: Start already in progress or already started");return}if(!vc()||!navigator.mediaDevices){const e=new Error("MediaRecorder not supported or no microphone access");throw this.options.onError?.(e),e}try{if(this.starting=!0,this.stream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1}),!this.starting){this.stopStream(this.stream);return}this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&(console.warn("AudioRecorder: MediaRecorder already active, stopping previous recording"),this.mediaRecorder.stop(),this.cleanup()),this.started=!0,this.starting=!1;const e=no();if(!e)throw new Error("No supported media type found");const r={mimeType:e};this.mediaRecorder=new MediaRecorder(this.stream,r),this.audioChunks=[],this.mediaRecorder.ondataavailable=n=>{n.data.size>0&&this.audioChunks.push(n.data)},this.mediaRecorder.onstop=async()=>{const n=this.audioChunks.length>0?new Blob(this.audioChunks,{type:e}):null;await this.options.onDataAvailable?.(n),this.options.onStop?.(),this.cleanup()},this.mediaRecorder.onerror=n=>{const a=new Error(`MediaRecorder error: ${n}`);this.options.onError?.(a),this.cleanup()},this.mediaRecorder.start(),this.setupVolumeAnalysis(this.stream),this.options.onStart?.()}catch(e){this.started=!1,this.starting=!1;const r=e instanceof Error?e:new Error(String(e));throw this.options.onError?.(r),r}}stop(){this.started=!1,this.starting=!1,this.volumeUpdateInterval&&(clearInterval(this.volumeUpdateInterval),this.volumeUpdateInterval=null),this.mediaRecorder&&this.mediaRecorder.state!=="inactive"?this.mediaRecorder.stop():(this.stream&&this.stopStream(this.stream),this.cleanup())}setupVolumeAnalysis(e){if(this.options.onVolumeChange)try{this.audioContext=new AudioContext,this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=256,this.analyser.smoothingTimeConstant=.8;const r=this.analyser.frequencyBinCount;this.dataArray=new Uint8Array(r),this.audioContext.createMediaStreamSource(e).connect(this.analyser),this.startVolumeMonitoring()}catch(r){console.warn("Failed to set up volume analysis:",r)}}startVolumeMonitoring(){!this.analyser||!this.dataArray||!this.options.onVolumeChange||(this.volumeUpdateInterval=window.setInterval(()=>{if(!this.analyser||!this.dataArray||!this.started)return;this.analyser.getByteFrequencyData(this.dataArray);let e=0;for(let i=0;i<this.dataArray.length;i++)e+=this.dataArray[i]*this.dataArray[i];let n=Math.sqrt(e/this.dataArray.length)/255;n=Math.pow(n*3,.7);const a=Math.min(100,Math.max(0,Math.round(n*100)));this.options.onVolumeChange?.(a)},100))}get recording(){return this.started&&this.mediaRecorder?.state==="recording"}get isStarting(){return this.starting}stopStream(e){e.getTracks().forEach(r=>r.stop())}cleanup(){this.volumeUpdateInterval&&(clearInterval(this.volumeUpdateInterval),this.volumeUpdateInterval=null),this.audioContext&&(this.audioContext.close().catch(console.warn),this.audioContext=null),this.analyser=null,this.dataArray=null,this.stream&&(this.stopStream(this.stream),this.stream=null),this.mediaRecorder=null,this.audioChunks=[],this.started=!1,this.starting=!1}static isSupported(){return vc()}static getSupportedMediaType(){return no()}}const Wp=t=>(localStorage.setItem("liipgpt-color-scheme",t),ao(["light","dark"])),kc=()=>{const t=localStorage.getItem("liipgpt-color-scheme");return t==="light"||t==="dark"?t:"system"},ao=t=>{let e=kc();return e==="system"&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),t.includes(e)?e:t[0]??"light"},Qp="liipgpt:context",Yp=()=>localStorage.getItem(Qp),Kp=[{type:"email",check:t=>/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/.test(t)},{type:"creditCard",check:t=>/\b(?:\d[ -]*?){13,16}\b/.test(t)},{type:"ahv",check:t=>/\b756\.\d{4}\.\d{4}\.\d{2}\b/.test(t)},{type:"phoneSwiss",check:t=>/\b0(?:\s*\d){2}(?:\s*\/\s*)?(?:\s*\d){7,}\b/.test(t)},{type:"phoneInternational",check:t=>/(?:\+|00)(?:\s*\d){10,}\b/.test(t)},{type:"swissPassport",check:t=>/\b[A-HJ-NP-Z](?=.*\d)[A-HJ-NP-Z0-9]{7}\b/.test(t)},{type:"longNumber",check:t=>/\b\d{9,}\b/.test(t)}],yc=t=>{for(const e of Kp)if(e.check(t))return e.type},io="liipgpt:selectorValues",oo="liipgpt:selectorKnownDefaults",wc=()=>{try{const t=kt.getItem(io),e=kt.getItem(oo);return t?{values:JSON.parse(t),knownDefaults:e?JSON.parse(e):{}}:null}catch{return null}},Xp=t=>{const e={};for(const r of t)e[r.settingName]=r.defaultValues??(r.allowEmpty?[]:[r.values[0]]).filter(Boolean);return e},_c=(t,e)=>{try{const r=Xp(e);kt.setItem(io,JSON.stringify(t)),kt.setItem(oo,JSON.stringify(r))}catch(r){console.error("Failed to save selector values:",r)}},Jp=t=>{try{const e=wc();if(!e)return;delete e.values[t],delete e.knownDefaults[t],kt.setItem(io,JSON.stringify(e.values)),kt.setItem(oo,JSON.stringify(e.knownDefaults))}catch(e){console.error("Failed to clear selector saved state:",e)}},e0=t=>{const e=wc(),r=t.map(n=>{const a=n.defaultValues??(n.allowEmpty?[]:[n.values[0]]).filter(Boolean);if(!e?.values[n.settingName])return[n.settingName,a];const i=e.values[n.settingName],o=e.knownDefaults[n.settingName]||[],s=i.filter(h=>n.values.includes(h)),c=o.filter(h=>!a.includes(h)),l=s.filter(h=>!c.includes(h)),d=a.filter(h=>!o.includes(h)&&!l.includes(h)),p=[...l,...d];return p.length===0&&!n.allowEmpty?[n.settingName,a]:[n.settingName,p]});return Object.fromEntries(r)};class t0 extends Error{constructor(e){super(e),this.name="UnreachableError"}}const xc=(t,e)=>{const n=new URLSearchParams(window.location.search).get("q");return n?{name:"chat-page",query:n}:t&&!e?{name:"consent-page"}:{name:"start-page"}},Dr=t=>t?t.map(e=>({id:ap(),...e})):[];class r0{#e=te(St({}));get data(){return _(this.#e)}set data(e){$(this.#e,e,!0)}#t=te(St({}));get targets(){return _(this.#t)}set targets(e){$(this.#t,e,!0)}#a=te(!1);get initialized(){return _(this.#a)}set initialized(e){$(this.#a,e,!0)}#l=te(0);get currentAudioVolume(){return _(this.#l)}set currentAudioVolume(e){$(this.#l,e,!0)}ariaLiveMessagesClearingTimeoutDuration=350;#u=te(null);get currentAudioRecorder(){return _(this.#u)}set currentAudioRecorder(e){$(this.#u,e,!0)}#i=te(!1);get isTranscribing(){return _(this.#i)}set isTranscribing(e){$(this.#i,e,!0)}#r=ee(()=>{if(!this.initialized)return[];const e=this.data.chatConfig.menu;return e?e[this.data.language]??[]:[]});get menu(){return _(this.#r)}set menu(e){$(this.#r,e)}#o=ee(()=>this.initialized?this.data.chatConfig.translations[this.data.language]??{}:{});get t(){return _(this.#o)}set t(e){$(this.#o,e)}#s=ee(()=>this.initialized?sc[this.data.language]??{}:sc.en??{});get errorTranslations(){return _(this.#s)}set errorTranslations(e){$(this.#s,e)}#n=ee(()=>this.initialized?lc[this.data.language]??{}:lc.en??{});get piiTranslations(){return _(this.#n)}set piiTranslations(e){$(this.#n,e)}#c=ee(()=>this.initialized?this.data.currentColorScheme:"light");get colorScheme(){return _(this.#c)}set colorScheme(e){$(this.#c,e)}#d=ee(()=>this.initialized?this.data.chatConfig.fullTheme[this.data.currentColorScheme]:{});get themeBase(){return _(this.#d)}set themeBase(e){$(this.#d,e)}#f=ee(()=>this.themeBase.tokens);get theme(){return _(this.#f)}set theme(e){$(this.#f,e)}#h=ee(()=>{if(!this.initialized)return[];const e=[];for(const r of this.data.chatConfig.selectorsConfig){if(r.allowEmpty)continue;(this.data.selectorValues[r.settingName]||[]).length===0&&e.push(r.settingName)}return e});get selectorsWithErrors(){return _(this.#h)}set selectorsWithErrors(e){$(this.#h,e)}}const g=new r0;let tt,wt,Sc;Zp({name:"chat-logic",state:g,excludeInDevTools:["onInput"]},{async init(t){wt=t;const e=wt.speechRecognitionApiKey||void 0;tt=new gp({apiUrl:wt.apiUrl,apiKey:wt.apiKey,speechRecognitionApiKey:e,strict:!0});try{const r=await tt.getChatConfig();window.CHAT_CONFIG_OVERRIDE&&Object.assign(r,window.CHAT_CONFIG_OVERRIDE);const a=(await tt.getMetadata()).mode==="maintenance";a&&this.showErrorToast("maintenance");const i=oc(r);wt.inlineLayout!==void 0&&(i.inlineLayout=wt.inlineLayout);let o;wt.lang?o=Ta(wt.lang,i.supportedLanguages):o=fc(i.supportedLanguages),hc(o,g.targets.mainElement);const s=await this.getPredefinedQuestions(o),c=i.translations[o]?.ariaOpensInNewTab;c&&tt.setNewTabSrText(c);const l=[];if(i.renderKatex){const v=await import("https://esm.sh/marked-katex-extension@5.1.5").catch(m=>{console.error("Couldn't load marked-katex-extension:",m)});v&&(tt.setMarkedExtensions(v.default({nonStandard:!0,output:"mathml"})),l.push("https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css"))}const d=Object.keys(i.fullTheme);let p=!1;if(i.forceConsent)try{p=kt.getItem("liipgpt:termsAccepted")==="true"}catch(v){console.warn("Failed to load terms acceptance from storage:",v)}g.data={currentConversationState:"idle",chatConfig:i,language:o,predefinedQuestions:s,isInMaintenance:a,history:Dr(i.messageAdditions.init),selectedColorScheme:kc(),has2ColorSchemes:d.length===2,currentColorScheme:ao(d),conversationFeedbackId:void 0,conversationFeedbackIsOpen:!1,openedPopup:void 0,props:wt,flyoutIsOpen:!1,questionHasPii:void 0,chatInputValue:"",selectorValues:e0(i.selectorsConfig),selectorsIsOpen:!1,currentReferencesAsideId:void 0,ariaLiveStatusMessage:void 0,ariaLiveStatusMessageClearingTimeout:void 0,wasReferencesAsideClosed:!1,isAsideMobile:!0,route:xc(i.forceConsent??!1,p),additionalStylesheets:l,hasOpenedOverlays:!1,isInlineLayoutContained:!1,termsAccepted:p},window.LIIPGPT_LISTENERS?.route?.(g.data.route),window.LIIPGPT_LISTENERS?.conversation?.(g.data.currentConversationState),g.data.selectorsIsOpen=g.data.chatConfig.showExpandedSelectors??!1,g.initialized=!0,this.checkForOpenedPopup(),window.addEventListener("hashchange",()=>{this.checkForOpenedPopup()}),this.goto(xc(i.forceConsent??!1,p),!0)}catch(r){throw ro.error(r instanceof Error?r.message:"Failed to load the chatbot. Please reload the page.",{duration:1e4,unstyled:!0,classes:{toast:"toast"}}),r}},setTarget(t,e){g.targets[t]=e},goto(t,e=!1){if(!(!e&&Pp(g.data.route,t)))switch(g.data.route=t,window.LIIPGPT_LISTENERS?.route?.(t),t.name){case"consent-page":break;case"start-page":t.prefill&&(g.data.chatInputValue=t.prefill);break;case"chat-page":if(g.data.chatInputValue=t.query,this.onSubmit(),g.data.chatConfig.addQueryToUrlParams){const r=new URLSearchParams(window.location.search);r.set("q",t.query),history.pushState(null,"",`?${r.toString()}`)}break}},getSelectorConfig(t){const e=g.data.chatConfig.selectorsConfig.find(r=>r.settingName===t);if(!e)throw new Error(`Setting ${t} not found`);return e},getPrettifiedSelectorValues(){const t=Object.entries(g.data.selectorValues).map(([e,r])=>{let n;try{n=this.getSelectorConfig(e)}catch(a){console.error(`Error getting selector config for ${e}: ${a}`);return}return n.type==="single-select"?[e,r[0]]:[e,r]}).filter(e=>!!e);return Object.fromEntries(t)},setSelectorValue(t,e){const r=this.getSelectorConfig(t);if(!r){console.warn(`Trying to set setting ${t} but it is not defined in the chat config`);return}if(r.type==="single-select"&&e.length>1){console.warn(`Trying to set multiple values for single-select setting ${t}`);return}g.data.selectorValues[t]=e,_c(g.data.selectorValues,g.data.chatConfig.selectorsConfig)},resetSelectorToDefaults(t){const e=this.getSelectorConfig(t);if(!e){console.warn(`Trying to reset setting ${t} but it is not defined in the chat config`);return}const r=e.defaultValues??(e.allowEmpty?[]:[e.values[0]]).filter(Boolean);return Jp(t),g.data.selectorValues[t]=r,_c(g.data.selectorValues,g.data.chatConfig.selectorsConfig),r},async getPredefinedQuestions(t){try{return tt.getPredefinedQuestions({url:window.location.origin+window.location.pathname,language:t})}catch(e){return console.warn("Failed to load predefined questions:",e),[]}},setColorScheme(t){g.data.selectedColorScheme=t,g.data.currentColorScheme=Wp(t),this.setAriaLiveStatusMessage(t==="dark"?g.t.ariaDarkSelected:g.t.ariaLightSelected)},async abort(){await Sc?.abort()},changeConversationState(t){g.data.currentConversationState=t,window.LIIPGPT_LISTENERS?.conversation?.(t)},onInput(t){g.data.chatConfig.blockPII&&(g.data.questionHasPii=yc(t)),g.data.chatInputValue=t},onSubmit(t=!1){if(g.data.questionHasPii){console.warn("Question contains PII, not submitting:",g.data.questionHasPii);return}const e=g.data.chatConfig.questionPrefix?`${g.data.chatConfig.questionPrefix} ${g.data.chatInputValue}`:g.data.chatInputValue;g.data.history.push(...Dr(g.data.chatConfig.messageAdditions.user.before)),g.data.history.push({type:"user",time:new Date().toISOString(),message:g.data.chatInputValue}),g.data.history.push(...Dr(g.data.chatConfig.messageAdditions.user.after));const r=g.data.history.push(...Dr(g.data.chatConfig.messageAdditions.bot.before));g.data.history.push({id:"UNRESOLVED",state:"loading",errors:[],type:"bot",time:new Date().toISOString(),message:{markdown:"",html:"",text:""},references:{all:[],used:[],unused:[]}});const n={features:wt.features?wt.features.trim().split(","):["formatting"],onError:d=>{this.showErrorToast(d),window.LIIPGPT_LISTENERS?.error?.(d),(d==="pii-detected"||d==="blocked")&&this.editLatestQuestion()},lang:g.data.language,selectorValues:{...this.getPrettifiedSelectorValues(),context:Yp()}},a=(d,p)=>{try{const h=new URL(d),v=new URL(p);return h.origin===v.origin&&h.pathname===v.pathname}catch{return!1}},i=g.data.chatConfig.sendReferrer??"all";if(["all","own","location"].includes(i)){const d=i==="location"||g.data.props.flyout;let p;d?p=`${window.location.protocol}//${window.location.host}${window.location.pathname}`:p=a(document.referrer,window.location.href)?null:document.referrer;const h=i==="own"&&!g.data.props.flyout&&p&&!p.startsWith(window.location.origin);n.referrer=p&&!h?p:void 0}g.data.currentConversationId||(g.data.currentConversationId=tt.createConversationId());const o=tt.chat(g.data.currentConversationId,e,n);Sc=o,g.data.lastChatResponseId=o.id,g.data.currentConversationState!=="searching"&&this.changeConversationState("searching"),this.setAriaLiveStatusMessage(g.t.ariaQuestionSent);let s=!1,c;const l=!!g.data.currentReferencesAsideId;(t&&l||!t&&g.data.chatConfig.showReferencesByDefault)&&(g.data.isAsideMobile||this.openReferencesAside(o.id)),o.subscribe(d=>{if(g.data.history[r]&&(g.data.history[r]={question:g.data.chatInputValue,...d}),g.data.chatConfig.addRetrievalQuestionToUrlParams&&d.retrievalQuestion){const p=new URLSearchParams(window.location.search);p.get("search")!==d.retrievalQuestion&&(p.set("search",d.retrievalQuestion),history.replaceState(null,"",`?${p.toString()}`))}g.data.chatConfig.showReferencesByDefault&&!g.data.wasReferencesAsideClosed&&g.data.currentReferencesAsideId!==d.id&&!g.data.isAsideMobile&&this.openReferencesAside(d.id),d.state==="streaming"&&g.data.currentConversationState!=="answering"&&this.changeConversationState("answering"),d.state==="done"&&(this.changeConversationState("idle"),s||(s=!0,this.setAriaLiveStatusMessage(`${g.t.ariaAnswerReady} ... ${d.message.text} ... ${g.t.ariaAnswerFinished}`),g.data.history.push(...Dr(g.data.chatConfig.messageAdditions.bot.after))),g.data.currentReferencesAsideId&&g.data.history[r].references.used.length>0?(clearTimeout(c),c=setTimeout(()=>{this.openReferencesAside(d.id)},100)):this.closeReferencesAside())}),g.data.chatInputValue=""},async onStartSpeechRecognition(){try{if(!await Gp()){this.showErrorToast("speech-not-supported");return}if(await navigator.mediaDevices.getUserMedia({audio:!0}),bc.isSupported())g.data.chatInputValue="",g.currentAudioRecorder=new bc({onDataAvailable:async e=>{g.isTranscribing=!0,await this.handleTranscription(e)},onError:()=>{this.showErrorToast("speech-microphone-access-denied"),g.currentAudioRecorder=null,g.isTranscribing=!1},onVolumeChange:e=>{g.currentAudioVolume=e}}),g.currentAudioRecorder.start();else{this.showErrorToast("speech-not-supported");return}}catch(t){throw this.showErrorToast("speech-microphone-access-denied"),g.currentAudioRecorder=null,g.isTranscribing=!1,t}},editLatestQuestion(){const t=g.data.history.findLastIndex(r=>r?.type==="user");if(t===-1){console.error("No last user question, available");return}const e=g.data.history.splice(t)[0];g.data.chatInputValue=e.message},onStopSpeechRecognition(){if(g.currentAudioRecorder){const t=g.currentAudioRecorder;g.currentAudioRecorder=null,t.stop()}g.currentAudioVolume=0},async handleTranscription(t){if(!t){console.warn("No audio data received");return}try{const e=await tt.transcribeAudio(t,{lang:g.data.language});if(e.error){this.showErrorToast("speech-transcription-failed");return}if(e.transcript.trim()){if(g.data.chatConfig.blockPII&&(g.data.questionHasPii=yc(e.transcript.trim()),g.data.questionHasPii))return;g.data.chatInputValue=e.transcript.trim()}else this.showErrorToast("speech-no-text-detected")}catch(e){console.error("Speech transcription error:",e),this.showErrorToast("speech-transcription-failed")}finally{g.currentAudioRecorder=null,g.isTranscribing=!1,g.currentAudioVolume=0}},async onStartConversation(t){await this.abort(),g.data.history=Dr(g.data.chatConfig.messageAdditions.init),g.data.currentConversationId=tt.createConversationId(),this.goto({name:"chat-page",query:t})},async onNewConversation(){if(await this.abort(),g.data.currentConversationId=void 0,g.data.currentReferencesAsideId=void 0,g.data.history=Dr(g.data.chatConfig.messageAdditions.init),g.data.chatConfig.addQueryToUrlParams){const t=new URLSearchParams(window.location.search);t.delete("q"),history.pushState(null,"",`?${t.toString()}`)}this.goto({name:"start-page"})},showSuccessToast(t){ro.success(g.t[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},showErrorToast(t){ro.error(g.errorTranslations[t],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},async submitFeedback(t){try{const e=g.data.conversationFeedbackId||g.data.lastChatResponseId;if(!e)throw new t0("Tried to give feedback with no id.");const r=g.data.history.find(n=>n.type==="bot"&&n.id===e);await tt.feedback(e,r?.question??"",t),setTimeout(()=>{this.showSuccessToast("thankYouForFeedback")},500)}catch(e){console.error("Feedback failed:",e),this.showErrorToast("feedback-failed")}},toggleReferencesAside(t){g.data.currentReferencesAsideId===t?this.closeReferencesAside():this.openReferencesAside(t)},openReferencesAside(t){g.data.currentReferencesAsideId=t,this.setOpenOverlay(!0)},closeReferencesAside(){g.data.currentReferencesAsideId=void 0,g.data.wasReferencesAsideClosed=!0,this.setOpenOverlay(!1)},setAsideMobile(t){g.data.isAsideMobile=t},openFlyout(){g.data.flyoutIsOpen=!0},closeFlyout(){g.data.flyoutIsOpen=!1},openConversationFeedback(){g.data.conversationFeedbackIsOpen=!0,this.setOpenOverlay(!0)},openMessageFeedback(t){g.data.conversationFeedbackId=t},closeFeedback(){g.data.conversationFeedbackIsOpen=!1,g.data.conversationFeedbackId=void 0,this.setOpenOverlay(!1)},setOpenOverlay(t){g.data.hasOpenedOverlays=t},setAriaLiveStatusMessage(t){g.data.ariaLiveStatusMessage=t,clearTimeout(g.data.ariaLiveStatusMessageClearingTimeout),g.data.ariaLiveStatusMessageClearingTimeout=setTimeout(()=>{g.data.ariaLiveStatusMessage=""},g.ariaLiveMessagesClearingTimeoutDuration)},closePopup(){window.location.hash=""},checkForOpenedPopup(){const t=window.location.hash.slice(1),e=g.t.popups?.find(r=>r.hash===t);e?g.data.openedPopup=e:g.data.openedPopup=void 0},async thumbs(t,e){try{const r=g.data.history.find(n=>n.type==="bot"&&n.id===t);e==="up"?await tt.thumbsUp(t,r?.question??""):await tt.thumbsDown(t,r?.question??""),this.showSuccessToast("thankYouForFeedback")}catch(r){console.error("Feedback failed:",r),this.showErrorToast("feedback-failed")}},async onLanguageChange(t){if(g.data.language=Ta(t,g.data.chatConfig.supportedLanguages),hc(g.data.language,g.targets.mainElement),g.data.predefinedQuestions=await this.getPredefinedQuestions(g.data.language),this.setAriaLiveStatusMessage(g.t.ariaLanguageChanged),g.data.chatConfig.reflectLanguageInPath){const e=new URL(window.location.href);e.pathname=`/${g.data.language}`,window.history.replaceState({},"",e.toString())}},async acceptTerms(){g.data.termsAccepted=!0;try{kt.setItem("liipgpt:termsAccepted","true")}catch(t){console.warn("Failed to save terms acceptance to storage:",t)}this.closePopup(),await gs(),this.goto({name:"start-page"})},updateChatInput(t){g.data.chatInputValue=t}});const n0='@layer base,utilities,components;/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::-moz-placeholder{color:currentcolor}@supports (color: color-mix(in lab,red,red)){{color:color-mix(in oklab,currentcolor 50%,transparent)}}::placeholder{color:currentcolor}@supports (color: color-mix(in lab,red,red)){{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer base{.chat-app{--spacer-1: .0625rem;--spacer-2: .125rem;--spacer-3: .1875rem;--spacer-4: .25rem;--spacer-5: .3125rem;--spacer-6: .375rem;--spacer-8: .5rem;--spacer-10: .625rem;--spacer-12: .75rem;--spacer-16: 1rem;--spacer-20: 1.25rem;--spacer-24: 1.5rem;--spacer-28: 1.75rem;--spacer-32: 2rem;--spacer-40: 2.5rem;--spacer-48: 3rem;--spacer-56: 3.5rem;--spacer-64: 4rem;--spacer-72: 4.5rem;--spacer-80: 5rem;--spacer-120: 7.5rem;--spacer-r-8: clamp(.375rem, .3182rem + .2841cqw, .5rem);--spacer-r-12: clamp(.625rem, .5682rem + .2841cqw, .75rem);--spacer-r-16: clamp(.75rem, .6364rem + .5682cqw, 1rem);--spacer-r-20: clamp(.875rem, .7045rem + .8523cqw, 1.25rem);--spacer-r-24: clamp(1rem, .7727rem + 1.1364cqw, 1.5rem);--spacer-r-28: clamp(1.125rem, .8409rem + 1.4205cqw, 1.75rem);--spacer-r-32: clamp(1.25rem, .9091rem + 1.7045cqw, 2rem);--spacer-r-40: clamp(1.5rem, 1.0455rem + 2.2727cqw, 2.5rem);--spacer-r-48: clamp(1.625rem, 1rem + 3.125cqw, 3rem);--spacer-r-56: clamp(1.75rem, .9545rem + 3.9773cqw, 3.5rem);--spacer-r-64: clamp(2rem, 1.0909rem + 4.5455cqw, 4rem);--spacer-r-80: clamp(3rem, 2.0909rem + 4.5455cqw, 5rem);--spacer-r-96: clamp(3.5rem, 2.3636rem + 5.6818cqw, 6rem);--spacer-r-120: clamp(4rem, 2.4091rem + 7.9545cqw, 7.5rem);--default-transition-duration: .2s;--default-transition-timing-function: ease-in-out;--z-index-flyout: 10000;--z-index-dialog: 600;--z-index-loader: 500;--z-index-reference-number: 400;--z-index-footer: 300;--z-index-header: 200;--z-index-tooltip: 100;--z-index-tooltip-hover: 101;--z-index-local-overlay: 10;--ease-out-quart: cubic-bezier(.165, .84, .44, 1);--ease-in-quart: cubic-bezier(.895, .03, .685, .22);--ease-in-out-quart: cubic-bezier(.77, 0, .175, 1);--fly-in-id: 0;--btn-padding-x: var(--spacer-r-20);--btn-padding-y: var(--spacer-r-8);--btn-icon-size: var(--spacer-24);--btn-submit-size: 2.5em;--last-bot-message-min-height: 0}}@value container-xs,container-sm,container-md,container-lg,container-inner-xs,container-inner-sm,container-inner-md,container-inner-lg from "./viewports.css";@layer base{.chat-app :where(h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){font-weight:var(--base-font-weight-title);line-height:var(--base-line-height-tight)}.chat-app :where(b,strong){font-weight:var(--base-font-weight-bold)}.chat-app :where(button){cursor:pointer}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea){width:100%;padding:var(--input-padding);border-width:var(--input-border-width);border-radius:var(--input-border-radius);border-color:var(--input-border-color);background:var(--input-background);box-shadow:var(--input-box-shadow, none);color:var(--input-color)}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea)::-moz-placeholder{color:var(--input-placeholder-color);opacity:var(--input-placeholder-opacity)}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea)::placeholder{color:var(--input-placeholder-color);opacity:var(--input-placeholder-opacity)}.chat-app :where(input[type=radio],input[type=checkbox]){margin:0}.chat-app :where(*:focus-visible){border-radius:var(--btn-primary-border-radius);outline-color:var(--body-focus-color);outline-style:var(--body-focus-style);outline-width:var(--body-focus-width);outline-offset:var(--body-focus-offset)}.chat-app *::-moz-selection{background:var(--body-selection-background);color:var(--body-selection-color)}.chat-app *::selection{background:var(--body-selection-background);color:var(--body-selection-color)}.chat-app ::-webkit-scrollbar{width:8px;height:8px}.chat-app ::-webkit-scrollbar-track{background:transparent}.chat-app ::-webkit-scrollbar-thumb{border-radius:4px;background-color:#0000004d;-webkit-transition:background-color .2s;transition:background-color .2s}.chat-app ::-webkit-scrollbar-thumb:hover{background-color:#00000080}.chat-app *{scrollbar-color:rgba(0,0,0,.3) transparent;scrollbar-width:thin}.chat-app ::-webkit-scrollbar-thumb{visibility:hidden}.chat-app *:hover::-webkit-scrollbar-thumb,.chat-app *:active::-webkit-scrollbar-thumb,.chat-app *:focus::-webkit-scrollbar-thumb{visibility:visible}}@layer utilities{.chat-app :where(.expand-interaction){position:relative}.chat-app :where(.expand-interaction):after{position:absolute;inset:0;background-color:transparent;content:""}.chat-app :where(.sr-only){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.chat-app :where(.transition-colors){transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color,box-shadow;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.transition){transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.skip-link){position:absolute;width:0px;height:0px;overflow:hidden;color:var(--anchor-color);font-weight:700;font-size:var(--base-font-size-xs)}.chat-app :where(.skip-link):focus-visible{position:static;width:auto;height:auto}.chat-app :where(.fly-in){--fly-in-id: 0;--fly-in-duration: .4s;--fly-out-duration: .2s;--fly-in-delay: .3s;--fly-in-delay-additional: .1s;--fly-in-y: var(--spacer-r-64);transform:translateY(var(--fly-in-y));opacity:0;transition-delay:0s,1s;transition-duration:var(--fly-out-duration);transition-property:opacity,transform;transition-timing-function:ease,var(--ease-out-quart)}.chat-app :where(.mounted .fly-in){transform:translateY(0);opacity:1;transition-delay:calc(var(--fly-in-delay) + var(--fly-in-id) * var(--fly-in-delay-additional));transition-duration:var(--fly-in-duration)}.chat-app :where(.truncate){display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-app :where(.line-clamp){display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat-app :where(.line-clamp--2){-webkit-line-clamp:2}.chat-app :where(.line-clamp--6){-webkit-line-clamp:6}.chat-app :where(.container){width:100%;max-width:var(--container-max-width, 1024px);margin:0 auto;padding-right:var(--spacer-16);padding-left:var(--spacer-16)}@container chat-container (min-width: 640px){.chat-app :where(.container){padding-right:var(--spacer-32);padding-left:var(--spacer-32)}}@container chat-container (min-width: 768px){.chat-app :where(.container){padding-right:var(--spacer-48);padding-left:var(--spacer-48)}}.chat-app :where(h1){font-size:var(--base-font-size-h1)}.chat-app :where(h2){font-size:var(--base-font-size-h2)}.chat-app :where(h3){font-size:var(--base-font-size-h3)}.chat-app :where(h4,h5,h6){font-size:var(--body-font-size)}.chat-app :where(.h1){font-size:var(--base-font-size-h1)}.chat-app :where(.h2){font-size:var(--base-font-size-h2)}.chat-app :where(.h3){font-size:var(--base-font-size-h3)}.chat-app :where(.h4,.h5,.h6){font-size:var(--body-font-size)}.chat-app :where(.text-container)>:where(p,ul,ol,img,table){display:block;margin-bottom:var(--spacer-r-24)}.chat-app :where(.text-container)>:where(div){margin:var(--spacer-r-40) 0}.chat-app :where(.text-container)>:where(h1,.h1){margin-bottom:var(--spacer-r-28)}.chat-app :where(.text-container)>:where(h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){margin-bottom:var(--spacer-r-20)}.chat-app :where(.text-container)>:where(h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){margin-top:var(--spacer-r-40)}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling),ol:not(.no-list-styling))>:where(li){margin-bottom:var(--spacer-12)}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling),ol:not(.no-list-styling))>:where(li):last-child{margin-bottom:0}.chat-app :where(.text-container)>:where(ol){padding-left:1.5em;list-style-position:outside;list-style-type:decimal}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li){position:relative;padding-left:1em}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li):before{position:absolute;top:0;left:0;content:"•";font-size:.9em}.chat-app :where(.text-container)>:where(hr){height:1px;margin:var(--spacer-r-40) 0;border:none;background-color:var(--color-grey-700);background-color:var(--hr-color)}.chat-app :where(.text-container) :where(a:not(.button,.no-link-styling,.reference)){color:var(--anchor-color);font-weight:var(--anchor-font-weight, var(--base-font-weight-normal));-webkit-text-decoration:var(--anchor-text-decoration, underline);text-decoration:var(--anchor-text-decoration, underline);text-underline-offset:var(--anchor-text-underline-offset, .15em);transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.text-container) :where(a:not(.button,.no-link-styling,.reference)):hover{color:var(--anchor-hover-color)}.chat-app :where(.text-container) :where(table){display:block;width:100%;overflow-x:auto;border-collapse:collapse;border-spacing:0;-webkit-overflow-scrolling:touch}.chat-app :where(.text-container) :where(th){width:1000px;padding:var(--spacer-12) var(--spacer-16) var(--spacer-12) 0;border-bottom:1px solid var(--color-grey-300);line-height:var(--base-line-height-tight);text-align:left;vertical-align:bottom}.chat-app :where(.text-container) :where(td){padding:var(--spacer-12) var(--spacer-16) var(--spacer-12) 0;border-bottom:1px solid var(--color-grey-300);vertical-align:top}.chat-app :where(.text-container) :where(tr:last-child td){border-bottom:none}.chat-app :where(.text-container) :where(*:first-child){margin-top:0}.chat-app :where(.text-container) :where(*:last-child){margin-bottom:0}.chat-app :where(.animated-height){transition:height .5s var(--ease-in-out-quart)}.chat-app :where(.display-contents){display:contents}.chat-app :where(.absolute){position:absolute!important}}@layer base{.svg{width:var(--spacer-r-24);height:auto}.svg svg{display:block;width:100%;height:auto;overflow:visible}}@layer components{.chat-app{display:contents}.chat-app__container{container-name:chat-container;container-type:inline-size;display:flex;height:100%;overflow:hidden;transform:translateZ(0)}.chat-app__container>:where(*){color:var(--body-color);font-style:normal;font-weight:var(--base-font-weight-normal);font-size:var(--base-font-size-body);line-height:var(--base-line-height-default);font-family:var(--font-family);font-optical-sizing:auto}.chat-app__container.chat-app__container--inline-layout-contained{height:90svh;scroll-margin-top:10svh}@media (min-width: 768px){.chat-app__container.chat-app__container--inline-layout-contained{height:100svh;scroll-margin-top:0}}.chat-app__main{container-name:chat-inner-container;container-type:inline-size;display:flex;flex-direction:column;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior-x:none;overscroll-behavior-y:contain;background:var(--body-background);scrollbar-gutter:stable;touch-action:pan-y}.chat-app__container--inline-layout .chat-app__main{overscroll-behavior-y:auto}.chat-app__loader-container{display:flex;z-index:var(--z-index-loader);position:relative;align-items:center;justify-content:center;width:100%;height:100%}.chat-app__portals{display:contents}.chat-app__header{z-index:var(--z-index-header);position:sticky;top:0;background:var(--body-background)}.chat-app__header--unsticked{position:relative}.chat-app__header-content{--btn-padding-x: var(--btn-padding-y);display:flex;position:relative;-moz-column-gap:var(--spacer-r-12);column-gap:var(--spacer-r-12);flex-wrap:wrap;align-items:center;justify-content:flex-end;margin-right:calc(var(--btn-padding-x) * -1);margin-left:calc(var(--btn-padding-x) * -1);padding-top:var(--spacer-10);padding-bottom:var(--spacer-10)}.chat-app__header-content>:where(*){z-index:0;position:relative;pointer-events:auto}.chat-app__header-content:after{position:absolute;right:var(--btn-padding-x);bottom:0;left:var(--btn-padding-x);border-bottom:1px solid transparent;content:"";transition:border-color .1s ease-in-out}.chat-app__header-content.has-border:after{border-color:var(--base-line-color)}.chat-app__header-new-conversation{position:relative;margin-right:auto}@container chat-container (min-width: 640px){.chat-app__header-new-conversation .tooltip{display:none}}.chat-app__header--with-logo :where(.chat-app__header-content){margin-left:0}.chat-app__header--with-logo :where(.chat-app__header-new-conversation){margin-right:unset;margin-left:auto}.chat-app__header-logo{margin-right:auto}.chat-app__header-logo :where(svg){width:auto;height:var(--spacer-28)}.chat-app__body{display:flex;position:relative;flex-grow:1;flex-direction:column;width:100%}.chat-app__page-transition{display:flex;flex-grow:1;flex-direction:column;width:100%;height:100%}.chat-app__aside{--duration-in: .65s;--duration-out: .5s;visibility:hidden;position:relative;top:0;bottom:0;flex-grow:1;width:0;transition-delay:0s,var(--duration-out);transition-duration:var(--duration-out),0s;transition-property:width,visibility;transition-timing-function:var(--ease-in-out-quart),linear}.chat-app__aside.open{visibility:visible;width:var(--aside-width);transition-delay:0s;transition-duration:var(--duration-in),0s;transition-timing-function:var(--ease-out-quart),linear}.chat-app__aside .tooltip{--background-color: var(--btn-secondary-hover-background)}.chat-app__aside-container{position:relative;width:var(--aside-width);height:100%;overflow-y:auto;overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable}.chat-app__container--inline-layout .chat-app__aside-container{overscroll-behavior-y:auto}.chat-app__aside-header,.chat-app__sheet-header{display:flex;z-index:var(--z-index-header);position:sticky;top:0;flex-wrap:no-wrap;align-items:center;justify-content:space-between;padding:var(--spacer-12) var(--spacer-12) var(--spacer-12) var(--spacer-24);gap:var(--spacer-24);border-bottom-width:var(--aside-header-border-width);border-color:var(--aside-header-border-color);background:var(--aside-background);color:var(--aside-header-color)}.chat-app__sheet-close{position:relative}.chat-app__sheet-overlay{z-index:var(--z-index-dialog);position:fixed;inset:0;background:var(--aside-background-overlay)}.chat-app__sheet-content{z-index:var(--z-index-flyout);position:fixed;top:0;right:0;width:100%;max-width:var(--aside-width);height:100%;overflow-y:auto;overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable}.chat-app__container--inline-layout .chat-app__sheet-content{overscroll-behavior-y:auto}:is(.chat-app__aside-close,.chat-app__sheet-close) :where(.btn){background-color:transparent}.chat-app__aside-title,.chat-app__sheet-title{font-size:var(--base-font-size-sm)}.chat-app__close-button{z-index:var(--z-index-flyout)}}@layer components{.open-button{--open-button-avatar-height: var(--spacer-r-80);--open-button-avatar-width: var(--spacer-r-80);--open-button-duration: .4s;--open-button-delay: .3s;--open-button-ease: ease-in-out;display:flex;flex-direction:row;align-items:flex-end;cursor:pointer;transition:opacity .15s ease-out}.open-button--expanded{opacity:0;pointer-events:none}.open-button__text{display:flex;position:absolute;right:100%;bottom:50%;flex-direction:column;align-items:flex-start;justify-content:center;margin-right:calc(var(--open-button-avatar-width) * -.5);padding-top:var(--spacer-r-12);padding-right:0;padding-bottom:var(--spacer-r-12);padding-left:0;overflow:hidden;transform:translateY(50%);border-width:var(--open-button-border-width);border-radius:var(--open-button-border-radius);border-color:var(--open-button-border-color);background:var(--open-button-background);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;color:var(--open-button-color);text-align:left;transition:transform var(--open-button-duration) var(--open-button-ease),padding-right var(--open-button-duration) var(--open-button-delay) var(--open-button-ease)}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__text{transform:translateY(0);background:var(--open-button-hover-background, var(--open-button-background));color:var(--open-button-hover-color, var(--open-button-color));opacity:1;transition:transform var(--open-button-duration) var(--open-button-delay) var(--open-button-ease)}.open-button__title{max-width:240px;padding:0 calc(var(--open-button-avatar-width) * .5 + var(--spacer-r-12)) 0 var(--spacer-r-12);font-weight:700;white-space:pre}.open-button__mask{width:0;height:0;overflow:hidden;transition:width var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),height var(--open-button-duration) var(--open-button-ease)}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__mask{transition:width var(--open-button-duration) var(--open-button-ease),height var(--open-button-duration) var(--open-button-delay) var(--open-button-ease)}.open-button__description{position:relative;width:50cqw;max-width:260px;padding:0 calc(var(--open-button-avatar-width) * .5 + var(--spacer-r-12)) 0 var(--spacer-r-12);text-wrap:balance}.open-button__avatar{z-index:var(--z-index-local-overlay);position:relative;width:var(--open-button-avatar-width);height:var(--open-button-avatar-height);overflow:clip;border-radius:var(--spacer-r-80);filter:drop-shadow(0 4px 6px rgba(0,0,0,.15));transition:transform .2s var(--open-button-ease)}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__avatar{transform:scale(1.05)}.open-button__link-icon{display:none;position:absolute;right:0;width:var(--spacer-r-80);height:var(--spacer-r-80);padding:var(--spacer-r-20);color:var(--open-button-color)}:where(.open-button--standalone){position:fixed;right:var(--spacer-r-16);bottom:var(--spacer-r-16)}@media (prefers-reduced-motion: reduce){.open-button__text,.open-button__mask,.open-button:hover .open-button__text,.open-button:hover .open-button__mask{transition:none!important}.open-button__avatar,.open-button:hover .open-button__avatar{filter:none!important;transition:none!important}}.open-button--hide-title-when-collapsed .open-button__text{visibility:hidden;opacity:0;transition:transform var(--open-button-duration) var(--open-button-ease),padding-right var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),opacity var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),visibility 0s linear calc(var(--open-button-duration) + var(--open-button-delay))}.open-button--hide-title-when-collapsed:is(:hover,.open-button--programmatic-expand) .open-button__text{visibility:visible;transform:translateY(0);background:var(--open-button-hover-background, var(--open-button-background));color:var(--open-button-hover-color, var(--open-button-color));opacity:1;transition:transform var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),opacity var(--open-button-duration) var(--open-button-ease),visibility 0s linear 0s}}',a0=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),i0=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),o0=new RegExp("(\\d)(\\p{Ll})","gu"),s0=new RegExp("(\\p{L})(\\d)","gu"),l0=/[^\p{L}\d]+/giu,Ea="$1\0$2",c0="";function u0(t,e){let r=t.trim();r=r.replace(a0,Ea).replace(i0,Ea),e?.separateNumbers&&(r=r.replace(o0,Ea).replace(s0,Ea)),r=r.replace(l0,"\0");let n=0,a=r.length;for(;r.charAt(n)==="\0";)n++;if(n===a)return[];for(;r.charAt(a-1)==="\0";)a--;return r.slice(n,a).split(/\0/g)}function d0(t,e){return p0(t,e?.prefixCharacters)+u0(t,e).map(f0(e?.locale)).join(e?.delimiter??" ")}function h0(t,e){return d0(t,{delimiter:"-",...e})}function f0(t){return t===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(t)}function p0(t,e=c0){let r="";for(let n=0;n<t.length;n++){const a=t.charAt(n);if(e.includes(a))r+=a;else break}return r}const Ca=h0,g0=640,m0=1024;let Aa=null;const v0=()=>{if(Aa)return Aa;if(!globalThis.document)return 16;const t=globalThis.document.querySelector(":root");return Aa=Number(getComputedStyle(t).fontSize.slice(0,-2)),Aa},b0=({minRem:t,maxRem:e})=>{const r=v0(),n=g0/r,a=m0/r,i=(e-t)/(a-n),o=-n*i+t;return`clamp( ${t}rem, ${o}rem + ${i*100}cqw, ${e}rem )`},Tc=t=>typeof t=="string"?t:typeof t=="number"?String(t):typeof t=="object"?t.minRem===t.maxRem?`${t.minRem}rem`:b0(t):"",so=(t,e,r,n=!1)=>{let a="";return r.forEach(i=>{let o=e[i];n&&!o&&i==="borderWidth"&&(o="0px"),n&&!o&&i==="borderColor"&&(o="transparent"),o&&(a+=`--${Ca(t)}-${Ca(i)}:${Tc(o)}; `)}),a},Ec=(t,e)=>Object.entries(e).map(([r,n])=>`--${t}-${Ca(r)}:${Tc(n)}`).join("; ")+"; ",k0=(t,e)=>{let r="";return r+=so(t,e,["background","borderWidth","borderColor","boxShadow","borderRadius","color"],!0),e.hover&&(r+=so(`${t}-hover`,e.hover,["background","borderWidth","borderColor","boxShadow","color"])),e.focus&&(r+=so(`${t}-focus`,e.focus,["background","borderWidth","borderColor","boxShadow","color"])),e.custom&&(r+=Ec(t,e.custom)),r},y0=(t,e)=>Object.entries(e).map(([r,n])=>`--color-${t}-${r}:${n}`).join("; ")+"; ",w0=t=>`--font-family: ${t?.family||"inherit"};`,_0=t=>{const e=w0(t.font),r=Object.entries(t.colors).map(([i,o])=>y0(i,o)).join(""),n=Ec("base",t.base),a=Object.entries(t.components).map(([i,o])=>k0(Ca(i),o)).join("");return`.chat-app {${e} ${r} ${n} ${a}};`};var ht=typeof window<"u"?window:{screen:{},navigator:{}},tn=(ht.matchMedia||function(){return{matches:!1}}).bind(ht),x0={get passive(){return!0}},Cc=function(){};ht.addEventListener&&ht.addEventListener("p",Cc,x0),ht.removeEventListener&&ht.removeEventListener("p",Cc,!1);var lo="ontouchstart"in ht,S0="TouchEvent"in ht,T0=lo||S0&&tn("(any-pointer: coarse)").matches,Ac=(ht.navigator.maxTouchPoints||0)>0||T0,Rc=ht.navigator.userAgent||"",E0=tn("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Rc)&&Math.min(ht.screen.width||0,ht.screen.height||0)>=768,Ic=(tn("(pointer: coarse)").matches||!tn("(pointer: fine)").matches&&lo)&&!/Windows.*Firefox/.test(Rc),C0=tn("(any-pointer: fine)").matches||tn("(any-hover: hover)").matches||E0||!lo,Lc=Ac&&(C0||!Ic)?"hybrid":Ac?"touchOnly":"mouseOnly",A0=Lc==="mouseOnly"?"mouse":Lc==="touchOnly"||Ic?"touch":"mouse";function Oc(t,e){jr(e,!0);let r=se(e,"href",7),n=se(e,"target",7),a=se(e,"onclick",7),i=se(e,"className",23,()=>[]),o=se(e,"isStandalone",7,!1),s=se(e,"children",7),c=se(e,"type",7,"button"),l=se(e,"use",7),d=se(e,"class",7),p=fi(e,["$$slots","$$events","$$legacy","$$host","href","target","onclick","className","isStandalone","children","type","use","class"]);const h=ee(()=>r()?"a":"button"),v=ee(()=>[...Array.isArray(i())?i():i()?[i()]:[],...d()?[d()]:[]]),m=()=>({}),b=ee(()=>l()??m);var A=vt(),y=Oe(A);return Cs(y,()=>_(h),!1,(k,w)=>{As(k,U=>_(b)?.(U)),Ps(k,U=>({...p,onclick:r()?void 0:a(),type:r()?void 0:c(),href:r(),role:r()?"link":"button",target:r()?n():void 0,class:_(v),[Wr]:U}),[()=>({"open-button--standalone":o()})]);var T=vt(),I=Oe(T);Ss(I,s),oe(w,T)}),oe(t,A),Ur({get href(){return r()},set href(k){r(k),re()},get target(){return n()},set target(k){n(k),re()},get onclick(){return a()},set onclick(k){a(k),re()},get className(){return i()},set className(k=[]){i(k),re()},get isStandalone(){return o()},set isStandalone(k=!1){o(k),re()},get children(){return s()},set children(k){s(k),re()},get type(){return c()},set type(k="button"){c(k),re()},get use(){return l()},set use(k){l(k),re()},get class(){return d()},set class(k){d(k),re()}})}bn(Oc,{href:{},target:{},onclick:{},className:{},isStandalone:{},children:{},type:{},use:{},class:{}},[],[],!0);function On(t,e){jr(e,!0);let r=se(e,"css",7),n=fi(e,["$$slots","$$events","$$legacy","$$host","css"]);const a=c=>{es(()=>{r()&&(c.innerHTML=r())})};var i=vt(),o=Oe(i);{var s=c=>{var l=vt(),d=Oe(l);Cs(d,()=>"style",!1,(p,h)=>{As(p,v=>a?.(v)),Ps(p,()=>({...n}))}),oe(c,l)};ur(o,c=>{r()&&c(s)})}return oe(t,i),Ur({get css(){return r()},set css(c){r(c),re()}})}bn(On,{css:{}},[],[],!0);var R0=Ct('<div class="open-button__title"><!></div>'),I0=Ct('<div class="open-button__mask"><div class="open-button__description"><!></div></div>'),L0=Ct('<div class="open-button__text"><!> <!></div>'),O0=Ct('<div class="sr-only"> </div>'),M0=Ct('<!> <div class="svg svg--avatar open-button__avatar" aria-hidden="true"><!></div>',1),N0=Ct('<link rel="stylesheet"/>'),P0=Ct("<!> <!>",1),D0=Ct('<!> <!> <!> <main class="chat-app"><!></main>',1);function Mc(t,e){jr(e,!0);const r=(B,z)=>{let G=()=>z?.().chatConfig,Ue=()=>z?.().language,ye=()=>z?.().colorScheme;const le=ee(()=>{const{openButtonTitle:xe,openButtonDescription:ie}=G().translations[Ue()];return{openButtonTitle:xe,openButtonDescription:ie}}),qe=ee(()=>G().fullTheme[ye()].tokens.svgs),we=ee(()=>G().fullTheme[ye()]?.tokens.components.openButton?.custom),_e=ee(()=>!!_(we)?.hideTitleWhenCollapsed);{let xe=ee(()=>G().buttonHref?void 0:s()?"true":"false"),ie=ee(()=>G().buttonHref?void 0:"true"),rt=ee(()=>G().buttonHref?void 0:o()),Ve=ee(()=>["open-button",e.buttonClass,g.data.flyoutIsOpen?"open-button--expanded":void 0,_(_e)?"open-button--hide-title-when-collapsed":void 0]);Oc(B,{get href(){return G().buttonHref},onclick:Ia,onmouseenter:Ra,onmouseleave:ho,use:er,get"aria-expanded"(){return _(xe)},get"aria-haspopup"(){return _(ie)},get"aria-controls"(){return _(rt)},get style(){return e.buttonStyle},get className(){return _(Ve)},get isStandalone(){return _(h)},children:(ft,tr)=>{var Ot=M0(),Nn=Oe(Ot);{var La=nt=>{var Ze=L0(),zr=Ut(Ze);{var Oa=Mt=>{var at=R0(),Nt=Ut(at);li(Nt,()=>_(le).openButtonTitle),Ft(at),oe(Mt,at)};ur(zr,Mt=>{_(le).openButtonTitle&&Mt(Oa)})}var Ma=lr(zr,2);{var Pn=Mt=>{var at=I0(),Nt=Ut(at),_t=Ut(Nt);li(_t,()=>_(le).openButtonDescription),Ft(Nt),Bs(Nt,Pt=>$(k,Pt),()=>_(k)),Ft(at),Bs(at,Pt=>$(y,Pt),()=>_(y)),oe(Mt,at)};ur(Ma,Mt=>{_(le).openButtonDescription&&A0==="mouse"&&Mt(Pn)})}Ft(Ze),oe(nt,Ze)},fo=nt=>{var Ze=O0(),zr=Ut(Ze,!0);Ft(Ze),Qn(()=>ws(zr,g.t.ariaOpenChat)),oe(nt,Ze)};ur(Nn,nt=>{_(le).openButtonTitle||_(le).openButtonDescription?nt(La):nt(fo,!1)})}var nn=lr(Nn,2),$r=Ut(nn);li($r,()=>_(qe).avatar),Ft(nn),oe(ft,Ot)},$$slots:{default:!0}})}};let n=te("light"),a=se(e,"host",7),i=se(e,"onError",7),o=se(e,"flyoutId",7),s=se(e,"flyoutIsOpen",7),c=fi(e,["$$slots","$$events","$$legacy","$$host","host","onError","flyoutId","flyoutIsOpen"]);const l=async B=>{const G=await(await fetch(`${B}/chatconfig`)).json();return Kl.parse(G)},d=async({forceTheme:B,lang:z,apiUrl:G})=>{const Ue=window.CHAT_CONFIG_OVERRIDE?window.CHAT_CONFIG_OVERRIDE:await l(G),ye=oc(Ue);let le;z?le=Ta(z,ye.supportedLanguages):le=fc(ye.supportedLanguages);const qe=Object.keys(ye.fullTheme),we=ao(qe);return{chatConfig:ye,language:le,colorScheme:we}},p=(B,z)=>{if(B==null)return z;if(typeof B=="string"){const G=B.trim().toLowerCase();return!(G===""||G==="0"||G==="false"||G==="no")}return typeof B=="number"?B!==0:typeof B=="boolean"?B:z};let h=ee(()=>!!a()),v=te(!1),m=te(!1),b=te(!1),A=te(void 0),y=te(void 0),k=te(void 0),w=ee(()=>_(k)?.offsetWidth??0),T=ee(()=>_(k)?.offsetHeight??0),I=te(void 0),U=te(!1),Q,je=te(!0);function ce(){return _(I)?(clearTimeout(_(I)),$(I,void 0),!0):!1}async function pr(B){$(n,B.colorScheme,!0),Q?.(),ce(),$(U,!1);const z=B.chatConfig.fullTheme[_(n)]?.tokens.components.openButton?.custom??{},G=z.autoExpandScrollThreshold,Ue=Number(z.autoCollapseDelay??0),ye=Number.isNaN(Ue)?0:Math.max(0,Ue),le=p(z.autoExpandOnce,!1),qe=(()=>{if(G==null)return 100;if(typeof G=="string"){if(G.trim().toLowerCase()==="none")return 0;const Ve=Number(G);return Number.isNaN(Ve)?100:Ve}const ie=Number(G);return Number.isNaN(ie)?100:ie})();if(Number.isNaN(qe)||qe<=0)return;const we=`liipgpt-auto-expand-${e.apiUrl}`;let _e=!1;if(typeof window<"u")try{_e=window.localStorage.getItem(we)==="true"}catch(ie){console.warn("LiipGPT: unable to read auto-expand flag",ie)}$(b,_e,!0);const xe=()=>{if(!(window.scrollY/window.innerHeight*100>=qe)){$(je,!0);return}if(!(_(m)||s())&&!(le&&(_e||_(b)))&&_(je)){if($(je,!1),$(m,!0),$(b,!0),co(),le&&typeof window<"u")try{window.localStorage.setItem(we,"true")}catch(Ve){console.warn("LiipGPT: unable to persist auto-expand flag",Ve)}$(I,setTimeout(()=>{_(U)||(uo(),$(m,!1)),$(I,void 0)},ye),!0)}};window.addEventListener("scroll",xe,{passive:!0}),qe===0&&(await gs(),xe()),Q=()=>{window.removeEventListener("scroll",xe)}}function ae(){ce(),$(m,!1),$(U,!1)}function er(B){$(A,B,!0)}function gr(){Q?.(),ce()}gd(gr);function mr(){!_(k)||!_(y)||(_(y).style.width=`${_(w)}px`,_(y).style.height=`${_(T)}px`)}function rn(){_(y)&&(_(y).style.width="0",_(y).style.height="0")}function co(){_(A)&&(_(A).classList.add("open-button--programmatic-expand"),mr())}function uo(){_(A)&&(_(A).classList.remove("open-button--programmatic-expand"),rn())}function Ra(){ce()&&$(U,!0),mr()}function ho(){ce(),_(U)&&($(m,!1),$(U,!1),_(A)?.classList.remove("open-button--programmatic-expand")),_(v)||rn()}function Ia(B){ae(),e.onclick?.(B)}let ue=ee(()=>d(c).then(async B=>(await pr(B),B)).catch(B=>i()(B)));var Mn=vt();ed("beforeunload",Xa,gr),rd(B=>{var z=vt(),G=Oe(z);{var Ue=ye=>{var le=vt(),qe=Oe(le);Ts(qe,()=>_(ue),null,(we,_e)=>{var xe=P0();const ie=ee(()=>_(_e).chatConfig.fullTheme[_(_e).colorScheme]);var rt=Oe(xe);bd(rt,17,()=>_(ie).fontURLs??[],md,(ft,tr)=>{var Ot=N0();Qn(()=>hi(Ot,"href",_(tr))),oe(ft,Ot)});var Ve=lr(rt,2);On(Ve,{id:"font-css",get css(){return _(ie).fontCSS}}),oe(we,xe)}),oe(ye,le)};ur(G,ye=>{_(h)&&ye(Ue)})}oe(B,z)});var ge=Oe(Mn);return Ts(ge,()=>_(ue),B=>{},(B,z)=>{var G=vt();const Ue=ee(()=>_(z).chatConfig.fullTheme[_(n)]);var ye=Oe(G);{var le=we=>{var _e=D0(),xe=Oe(_e);{let tr=ee(()=>_0(_(Ue).tokens));On(xe,{id:"theme-css",get css(){return _(tr)}})}var ie=lr(xe,2);On(ie,{id:"app-css",get css(){return n0}});var rt=lr(ie,2);On(rt,{id:"custom-css",get css(){return _(Ue).customCSS}});var Ve=lr(rt,2),ft=Ut(Ve);r(ft,()=>_(z)),Ft(Ve),oe(we,_e)},qe=we=>{r(we,()=>_(z))};ur(ye,we=>{_(h)?we(le):we(qe,!1)})}oe(B,G)}),oe(t,Mn),Ur({get host(){return a()},set host(B){a(B),re()},get onError(){return i()},set onError(B){i(B),re()},get flyoutId(){return o()},set flyoutId(B){o(B),re()},get flyoutIsOpen(){return s()},set flyoutIsOpen(B){s(B),re()}})}bn(Mc,{host:{},onError:{},flyoutId:{},flyoutIsOpen:{}},[],[],!0);function Nc(t,e){jr(e,!0);let r=se(e,"onclick",7),n=se(e,"buttonClass",7),a=se(e,"buttonStyle",7),i=se(e,"apiUrl",7),o=se(e,"forceTheme",7),s=se(e,"lang",7),c=ee(()=>({onclick:r(),buttonClass:n(),buttonStyle:a(),apiUrl:i(),forceTheme:o(),lang:s()}));return Us(t,{silent:!0,body:(d,p=br)=>{Mc(d,Pd({host:e.$$host,get onError(){return p()}},()=>_(c)))},$$slots:{body:!0}}),Ur({get onclick(){return r()},set onclick(l){r(l),re()},get buttonClass(){return n()},set buttonClass(l){n(l),re()},get buttonStyle(){return a()},set buttonStyle(l){a(l),re()},get apiUrl(){return i()},set apiUrl(l){i(l),re()},get forceTheme(){return o()},set forceTheme(l){o(l),re()},get lang(){return s()},set lang(l){s(l),re()}})}return customElements.define("liipgpt-button",bn(Nc,{forceTheme:{attribute:"force-theme",type:"String"},buttonClass:{attribute:"button-class",type:"String"},buttonStyle:{attribute:"button-style",type:"String"},apiUrl:{attribute:"api-url",type:"String"},lang:{attribute:"lang",type:"String"},onclick:{}},[],[],!0)),sn.LiipGPTButton=Nc,Object.defineProperty(sn,Symbol.toStringTag,{value:"Module"}),sn}({});
|
|
428
|
+
`,ariaMainNavigation:"Navigation principale",ariaMainNavigationRegion:"Navigation principale: liens, changement de langue, mode couleur",ariaGotoMainNavigation:"Aller à la navigation principale",ariaAskQuestion:"Saisie texte",ariaAskQuestionRegion:"Poser une question",ariaNotifications:"Notifications",ariaPredefinedQuestions:"Questions prédéfinies",ariaPredefinedQuestionsRegion:"Essayez nos questions d'exemple",ariaChatHistory:"Historique du chat",ariaOpenChat:"Ouvrir le chat",ariaQuestionFromYou:"Votre question:",ariaAnswerFromBot:"Réponse de l'Assistant:",ariaLastAnswerNavigation:"Navigation et options pour la dernière réponse",ariaQuestionSent:"Question envoyée. Génération de la réponse en cours...",ariaAnswerReady:"Réponse prête.",ariaAnswerFinished:"Réponse terminée. Posez une autre question ou naviguez en arrière pour consulter l'historique du chat, donner un avis ou voir les références liées à la réponse.",ariaAskQuestionAgain:"Copier la dernière question dans le champ de saisie pour la reposer",ariaAnswerGood:"Évaluer cette réponse comme bonne",ariaAnswerBad:"Évaluer cette réponse comme mauvaise",ariaReferenceSource:"Source:",ariaGiveFeedback:"Donner un feedback détaillé sur la réponse",ariaLanguageChanged:"Langue française sélectionnée.",ariaLightSelected:"Mode clair activé.",ariaDarkSelected:"Mode sombre activé.",ariaSettings:"Paramètres du chat",ariaSettingsRegion:"Ajustez vos préférences de chat",ariaReferencesRegion:"Références pour la question actuelle",ariaOpensInNewTab:"(ouvre dans un nouvel onglet)",ariaFlyoutRegion:"Chatbot",ariaSelected:"sélectionné",ariaUnselected:"non sélectionné",ariaAllSelected:"Tous les éléments sélectionnés",ariaAllUnselected:"Tous les éléments non sélectionnés",ariaAllReseted:"Éléments par défaut sélectionnés",hideSettings:"Masquer les paramètres",showSettings:"Paramètres",chooseAtLeastOneOption:"Veuillez choisir au moins une option",selectAll:"Tout sélectionner",selectNone:"Tout désélectionner",resetToDefaults:"Réinitialiser",messageTooLong:"Votre message doit être plus court que {questionLengthLimit} caractères. Actuellement, il fait {questionLength} caractères"}},qb=e=>{e=e??jn;const t={};return e.de&&(t.de=Fn(jn.de,e.de)),e.en&&(t.en=Fn(jn.en,e.en)),e.fr&&(t.fr=Fn(jn.fr,e.fr)),e.it&&(t.it=Fn(jn.it,e.it)),t},Vb=e=>({init:e?.init??[],bot:{before:e?.bot?.before??[],after:e?.bot?.after??[]},user:{before:e?.user?.before??[],after:e?.user?.after??[]}}),gu=e=>{let t;e.theme?.fineGrained?t=Ub(e.theme?.fineGrained):t=Zb(e?.theme??{});const r=qb(e?.translations),n={...e,showPredefinedQuestions:e.showPredefinedQuestions??!0,showOverallFeedbackButton:e.showOverallFeedbackButton??!1,showOverallFeedbackEmail:e.showOverallFeedbackEmail??!0,showCloseChatButton:e.showCloseChatButton??!1,showContextInfo:e.showContextInfo??!1,showContextMenu:e.showContextMenu??!1,showReferencesByDefault:e.showReferencesByDefault??!1,showTextFeedback:e.showTextFeedback??!0,showExpandedSelectors:e.showExpandedSelectors??!1,inlineLayout:e.inlineLayout??!1,questionPrefix:e.questionPrefix??"",blockPII:e.blockPII??!1,allowAudioInput:e.allowAudioInput??!1,supportedLanguages:e.supportedLanguages??Object.keys(r),fullTheme:t,translations:r,buttonHref:e.buttonHref,addQueryToUrlParams:e.addQueryToUrlParams??!0,addRetrievalQuestionToUrlParams:e.addRetrievalQuestionToUrlParams??!1,renderKatex:e.renderKatex??!1,sendReferrer:e.sendReferrer??"all",selectorsConfig:e.selectorsConfig??[],questionLengthLimit:e.questionLengthLimit??Db,forceConsent:e.forceConsent??!1,askQuestionAgain:e.askQuestionAgain??!1,enableBackdrop:e.enableBackdrop??!1,messageAdditions:Vb(e.messageAdditions??{}),contextVersion:e.contextVersion??0};return e.classification&&(n.classification=e.classification),e.menu&&(n.menu=e.menu),n},mu={de:{aborted:"Verbindung zum Server wurde unerwartet unterbrochen. Bitte versuchen Sie es erneut.","client-error":"Ein unbekannter Fehler ist aufgetreten. Bitte versuchen Sie es erneut.","server-error":"Ein unbekannter Fehler ist aufgetreten. Bitte versuchen Sie es erneut.","sse-error":"Ein unbekannter Fehler ist aufgetreten. Bitte versuchen Sie es erneut.",blocked:"Ihre Anfrage wurde blockiert.","pii-detected":"Es wurden persönliche Daten erkannt. Bitte entfernen Sie diese und versuchen Sie es erneut.","incomplete-error":"Ein unbekannter Fehler ist aufgetreten. Die Antwort könnte unvollständig sein.","unexpected-call":"Ein unbekannter Fehler ist aufgetreten. Die Antwort könnte unvollständig sein.","quota-reached":"Kontingent überschritten. Bitte versuchen Sie es später erneut.","rate-limit":"Kontingent überschritten. Bitte versuchen Sie es später erneut.",maintenance:"Der Chat ist derzeit nicht verfügbar. Bitte versuchen Sie es später erneut.","too-long":"Ihre Frage war zu lang, versuchen Sie es mit einer Kürzeren.","too-short":"Ihre Frage war zu kurz, versuchen Sie es mit einer Längeren.","feedback-failed":"Feedback senden fehlgeschlagen. Bitte versuchen Sie es erneut.","speech-not-supported":"Spracherkennung wird nicht unterstützt.","speech-transcription-failed":"Sprachtranskription fehlgeschlagen.","speech-no-text-detected":"Kein Text in der Spracheingabe erkannt.","speech-microphone-access-denied":"Mikrofonzugriff verweigert."},en:{aborted:"Connection to the server was unexpectedly interrupted. Please try again.","client-error":"An unknown error has occurred. Please try again.","server-error":"An unknown error has occurred. Please try again.","sse-error":"An unknown error has occurred. Please try again.",blocked:"Your request has been blocked.","pii-detected":"Personal data has been detected. Please remove it and try again.","incomplete-error":"An unknown error has occurred. The response might be incomplete.","unexpected-call":"An unknown error has occurred. The response might be incomplete.","quota-reached":"Quota exceeded. Please try again later.","rate-limit":"Quota exceeded. Please try again later.",maintenance:"The chat is currently unavailable. Please try again later.","too-long":"Your question was too long, try a shorter one.","too-short":"Your question was too short, try a longer one.","feedback-failed":"Failed to send feedback. Please try again.","speech-not-supported":"Speech recognition is not supported.","speech-transcription-failed":"Speech transcription failed.","speech-no-text-detected":"No text detected in speech input.","speech-microphone-access-denied":"Microphone access denied."},it:{aborted:"La connessione al server è stata interrotta inaspettatamente. Si prega di riprovare.","client-error":"Si è verificato un errore sconosciuto. Si prega di riprovare.","server-error":"Si è verificato un errore sconosciuto. Si prega di riprovare.","sse-error":"Si è verificato un errore sconosciuto. Si prega di riprovare.",blocked:"La tua richiesta è stata bloccata.","pii-detected":"Sono stati rilevati dati personali. Si prega di rimuoverli e riprovare.","incomplete-error":"Si è verificato un errore sconosciuto. La risposta potrebbe essere incompleta.","unexpected-call":"Si è verificato un errore sconosciuto. La risposta potrebbe essere incompleta.","quota-reached":"Quota superata. Si prega di riprovare più tardi.","rate-limit":"Quota superata. Si prega di riprovare più tardi.",maintenance:"La chat non è attualmente disponibile. Si prega di riprovare più tardi.","too-long":"La tua domanda era troppo lunga, prova con una più breve.","too-short":"La tua domanda era troppo breve, prova con una più lunga.","feedback-failed":"Invio del feedback non riuscito. Si prega di riprovare.","speech-not-supported":"Il riconoscimento vocale non è supportato.","speech-transcription-failed":"Trascrizione vocale fallita.","speech-no-text-detected":"Nessun testo rilevato nell'input vocale.","speech-microphone-access-denied":"Accesso al microfono negato."},fr:{aborted:"La connexion au serveur a été interrompue de façon inattendue. Veuillez réessayer.","client-error":"Une erreur inconnue s'est produite. Veuillez réessayer.","server-error":"Une erreur inconnue s'est produite. Veuillez réessayer.","sse-error":"Une erreur inconnue s'est produite. Veuillez réessayer.","pii-detected":"Des données personnelles ont été détectées. Veuillez les supprimer et réessayer.",blocked:"Votre demande a été bloquée.","incomplete-error":"Une erreur inconnue s'est produite. La réponse pourrait être incomplète.","unexpected-call":"Une erreur inconnue s'est produite. La réponse pourrait être incomplète.","quota-reached":"Quota dépassé. Veuillez réessayer plus tard.","rate-limit":"Quota dépassé. Veuillez réessayer plus tard.",maintenance:"Le chat est actuellement indisponible. Veuillez réessayer plus tard.","too-long":"Votre question était trop longue, essayez d'en poser une plus courte.","too-short":"Votre question était trop courte, essayez d'en poser une plus longue.","feedback-failed":"Échec de l'envoi du feedback. Veuillez réessayer.","speech-not-supported":"La reconnaissance vocale n'est pas prise en charge.","speech-transcription-failed":"Échec de la transcription vocale.","speech-no-text-detected":"Aucun texte détecté dans l'entrée vocale.","speech-microphone-access-denied":"Accès au microphone refusé."}},vu={de:{email:"Bitte keine E-Mail Adressen eingeben",creditCard:"Bitte keine Kreditkarteninformationen eingeben",ahv:"Bitte keine AHV-Nummern eingeben",phoneSwiss:"Bitte keine Telefonnummern eingeben",phoneInternational:"Bitte keine Telefonnummern eingeben",swissPassport:"Bitte keine Passinformationen eingeben",longNumber:"Bitte keine langen Nummern eingeben"},en:{email:"Please do not enter email addresses",creditCard:"Please do not enter credit card information",ahv:"Please do not enter AHV numbers",phoneSwiss:"Please do not enter phone numbers",phoneInternational:"Please do not enter phone numbers",swissPassport:"Please do not enter passport information",longNumber:"Please do not enter long numbers"},it:{email:"Si prega di non inserire indirizzi email",creditCard:"Si prega di non inserire informazioni sulla carta di credito",ahv:"Si prega di non inserire numeri AVS",phoneSwiss:"Si prega di non inserire numeri di telefono",phoneInternational:"Si prega di non inserire numeri di telefono",swissPassport:"Si prega di non inserire informazioni sul passaporto",longNumber:"Si prega di non inserire numeri lunghi"},fr:{email:"Veuillez ne pas saisir d'adresses e-mail",creditCard:"Veuillez ne pas saisir d'informations de carte de crédit",ahv:"Veuillez ne pas saisir de numéros AVS",phoneSwiss:"Veuillez ne pas saisir de numéros de téléphone",phoneInternational:"Veuillez ne pas saisir de numéros de téléphone",swissPassport:"Veuillez ne pas saisir d'informations de passeport",longNumber:"Veuillez ne pas saisir de longs numéros"}},fk=e=>({}),pk=e=>({}),Hb="en",bu=(e,t)=>t.includes(e),$o=(e,t)=>{if(bu(e,t))return e;const r=Gb();return bu(r,t)?r:Hb},Gb=()=>navigator.language.split("-")[0],ku=(e,t)=>{localStorage.setItem("liipgpt:selectedLanguage",e),t&&(t.lang=e)},wu=e=>$o(localStorage.getItem("liipgpt:selectedLanguage"),e);var ua,yu;function Wb(){return yu||(yu=1,ua=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var a=i[o];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),ua}var Qb=Wb();const Yb=hu(Qb),Jb=typeof document<"u";let _u=0;class Kb{#e=Q(zt([]));get toasts(){return y(this.#e)}set toasts(t){L(this.#e,t,!0)}#t=Q(zt([]));get heights(){return y(this.#t)}set heights(t){L(this.#t,t,!0)}#r=t=>{const r=this.toasts.findIndex(n=>n.id===t);return r===-1?null:r};addToast=t=>{Jb&&this.toasts.unshift(t)};updateToast=({id:t,data:r,type:n,message:o})=>{const i=this.toasts.findIndex(s=>s.id===t),a=this.toasts[i];this.toasts[i]={...a,...r,id:t,title:o,type:n,updated:!0}};create=t=>{const{message:r,...n}=t,o=typeof t?.id=="number"||t.id&&t.id?.length>0?t.id:_u++,i=t.dismissable===void 0?!0:t.dismissable,a=t.type===void 0?"default":t.type;return yt(()=>{this.toasts.find(l=>l.id===o)?this.updateToast({id:o,data:t,type:a,message:r,dismissable:i}):this.addToast({...n,id:o,title:r,dismissable:i,type:a})}),o};dismiss=t=>(yt(()=>{if(t===void 0){this.toasts=this.toasts.map(n=>({...n,dismiss:!0}));return}const r=this.toasts.findIndex(n=>n.id===t);this.toasts[r]&&(this.toasts[r]={...this.toasts[r],dismiss:!0})}),t);remove=t=>{if(t===void 0){this.toasts=[];return}const r=this.#r(t);if(r!==null)return this.toasts.splice(r,1),t};message=(t,r)=>this.create({...r,type:"default",message:t});error=(t,r)=>this.create({...r,type:"error",message:t});success=(t,r)=>this.create({...r,type:"success",message:t});info=(t,r)=>this.create({...r,type:"info",message:t});warning=(t,r)=>this.create({...r,type:"warning",message:t});loading=(t,r)=>this.create({...r,type:"loading",message:t});promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:typeof r.loading=="string"?r.loading:r.loading()}));const o=t instanceof Promise?t:t();let i=n!==void 0;return o.then(a=>{if(typeof a=="object"&&a&&"ok"in a&&typeof a.ok=="boolean"&&!a.ok){i=!1;const s=Xb(a);this.create({id:n,type:"error",message:s})}else if(r.success!==void 0){i=!1;const s=typeof r.success=="function"?r.success(a):r.success;this.create({id:n,type:"success",message:s})}}).catch(a=>{if(r.error!==void 0){i=!1;const s=typeof r.error=="function"?r.error(a):r.error;this.create({id:n,type:"error",message:s})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),r.finally?.()}),n};custom=(t,r)=>{const n=r?.id||_u++;return this.create({component:t,id:n,...r}),n};removeHeight=t=>{this.heights=this.heights.filter(r=>r.toastId!==t)};setHeight=t=>{const r=this.#r(t.toastId);if(r===null){this.heights.push(t);return}this.heights[r]=t};reset=()=>{this.toasts=[],this.heights=[]}}function Xb(e){return e&&typeof e=="object"&&"status"in e?`HTTP error! Status: ${e.status}`:`Error! ${e}`}const Et=new Kb;function e1(e,t){return Et.create({message:e,...t})}const da=Object.assign(e1,{success:Et.success,info:Et.info,warning:Et.warning,error:Et.error,custom:Et.custom,message:Et.message,promise:Et.promise,dismiss:Et.dismiss,loading:Et.loading,getActiveToasts:()=>Et.toasts.filter(e=>!e.dismiss)}),t1=e=>{const t=new Set;Object.getOwnPropertyNames(e).forEach(n=>t.add(n));let r=Object.getPrototypeOf(e);for(;r&&r!==Object.prototype;)Object.getOwnPropertyNames(r).forEach(n=>t.add(n)),r=Object.getPrototypeOf(r);return Array.from(t)},r1=(e,t)=>{const r={};return t.forEach(n=>{r[n]=e[n]}),r},n1=console.warn,o1=()=>{},Su=(e,t)=>yt(()=>{console.warn=o1;const r=t?r1(e,t):e,n=Pd(r);return console.warn=n1,n}),i1=e=>e&&typeof e.then=="function";class a1{config;self;devtools;stateKeys;constructor(t,r){this.config=t,this.self=r,typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&(this.stateKeys=t1(this.config.state),this.devtools=window.__REDUX_DEVTOOLS_EXTENSION__.connect({name:this.config.name??"updatelogic"}),this.devtools.init(this.createStateSnapshot()),this.devtools.subscribe(n=>{n.type==="DISPATCH"&&n.state}))}createStateSnapshot(){return Su(this.config.state,this.stateKeys)}sendStart(t,r){this.devtools.send({type:`→ ${t}`,args:r},this.createStateSnapshot())}sendError(t,r,n){this.devtools.send({type:`❌ ${t}`,args:r,error:n},this.createStateSnapshot())}sendSuccess(t,r,n){this.devtools.send({type:`✓ ${t}`,args:r,return:n},this.createStateSnapshot())}isIncluded(t){return this.config.excludeInDevTools?!this.config.excludeInDevTools.includes(t):!0}createProxyFunction(t,r){const n=this.devtools&&this.isIncluded(t);return typeof r=="function"?(...o)=>{if(!n)return yt(()=>r.call(this.self,...o));const i=Su(o);this.sendStart(t,i);try{const a=yt(()=>r.call(this.self,...o));return i1(a)?a.then(s=>(this.sendSuccess(t,i,s),s),s=>{throw this.sendError(t,i,s),s}):(this.sendSuccess(t,i,a),a)}catch(a){throw this.sendError(t,i,a),a}}:r}}const s1=(e,t)=>{const r={},n=new a1(e,r);return Object.keys(t).forEach(o=>{if(o==="state"||o==="name")return;const i=t[o];r[o]=n.createProxyFunction(o,i)}),r};async function l1(){if(typeof navigator>"u"||!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return!1;try{return(await navigator.mediaDevices.enumerateDevices()).some(t=>t.kind==="audioinput")}catch(e){return console.error("Error checking for microphone:",e),!1}}function ha(){return typeof window>"u"||!window.MediaRecorder?null:MediaRecorder.isTypeSupported("audio/mp4")?"audio/mp4":MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":MediaRecorder.isTypeSupported("audio/wav")?"audio/wav":null}function xu(){return typeof window>"u"?!1:!!(window.MediaRecorder&&ha())}class Tu{mediaRecorder=null;audioChunks=[];started=!1;starting=!1;stream=null;options;audioContext=null;analyser=null;dataArray=null;volumeUpdateInterval=null;constructor(t={}){this.options=t}async start(){if(this.started||this.starting){console.warn("AudioRecorder: Start already in progress or already started");return}if(!xu()||!navigator.mediaDevices){const t=new Error("MediaRecorder not supported or no microphone access");throw this.options.onError?.(t),t}try{if(this.starting=!0,this.stream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1}),!this.starting){this.stopStream(this.stream);return}this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&(console.warn("AudioRecorder: MediaRecorder already active, stopping previous recording"),this.mediaRecorder.stop(),this.cleanup()),this.started=!0,this.starting=!1;const t=ha();if(!t)throw new Error("No supported media type found");const r={mimeType:t};this.mediaRecorder=new MediaRecorder(this.stream,r),this.audioChunks=[],this.mediaRecorder.ondataavailable=n=>{n.data.size>0&&this.audioChunks.push(n.data)},this.mediaRecorder.onstop=async()=>{const n=this.audioChunks.length>0?new Blob(this.audioChunks,{type:t}):null;await this.options.onDataAvailable?.(n),this.options.onStop?.(),this.cleanup()},this.mediaRecorder.onerror=n=>{const o=new Error(`MediaRecorder error: ${n}`);this.options.onError?.(o),this.cleanup()},this.mediaRecorder.start(),this.setupVolumeAnalysis(this.stream),this.options.onStart?.()}catch(t){this.started=!1,this.starting=!1;const r=t instanceof Error?t:new Error(String(t));throw this.options.onError?.(r),r}}stop(){this.started=!1,this.starting=!1,this.volumeUpdateInterval&&(clearInterval(this.volumeUpdateInterval),this.volumeUpdateInterval=null),this.mediaRecorder&&this.mediaRecorder.state!=="inactive"?this.mediaRecorder.stop():(this.stream&&this.stopStream(this.stream),this.cleanup())}setupVolumeAnalysis(t){if(this.options.onVolumeChange)try{this.audioContext=new AudioContext,this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=256,this.analyser.smoothingTimeConstant=.8;const r=this.analyser.frequencyBinCount;this.dataArray=new Uint8Array(r),this.audioContext.createMediaStreamSource(t).connect(this.analyser),this.startVolumeMonitoring()}catch(r){console.warn("Failed to set up volume analysis:",r)}}startVolumeMonitoring(){!this.analyser||!this.dataArray||!this.options.onVolumeChange||(this.volumeUpdateInterval=window.setInterval(()=>{if(!this.analyser||!this.dataArray||!this.started)return;this.analyser.getByteFrequencyData(this.dataArray);let t=0;for(let i=0;i<this.dataArray.length;i++)t+=this.dataArray[i]*this.dataArray[i];let n=Math.sqrt(t/this.dataArray.length)/255;n=Math.pow(n*3,.7);const o=Math.min(100,Math.max(0,Math.round(n*100)));this.options.onVolumeChange?.(o)},100))}get recording(){return this.started&&this.mediaRecorder?.state==="recording"}get isStarting(){return this.starting}stopStream(t){t.getTracks().forEach(r=>r.stop())}cleanup(){this.volumeUpdateInterval&&(clearInterval(this.volumeUpdateInterval),this.volumeUpdateInterval=null),this.audioContext&&(this.audioContext.close().catch(console.warn),this.audioContext=null),this.analyser=null,this.dataArray=null,this.stream&&(this.stopStream(this.stream),this.stream=null),this.mediaRecorder=null,this.audioChunks=[],this.started=!1,this.starting=!1}static isSupported(){return xu()}static getSupportedMediaType(){return ha()}}const c1=e=>(localStorage.setItem("liipgpt-color-scheme",e),fa(["light","dark"])),Eu=()=>{const e=localStorage.getItem("liipgpt-color-scheme");return e==="light"||e==="dark"?e:"system"},fa=e=>{let t=Eu();return t==="system"&&(t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),e.includes(t)?t:e[0]??"light"},u1="liipgpt:context",d1=()=>localStorage.getItem(u1),h1=[{type:"email",check:e=>/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/.test(e)},{type:"creditCard",check:e=>/\b(?:\d[ -]*?){13,16}\b/.test(e)},{type:"ahv",check:e=>/\b756\.\d{4}\.\d{4}\.\d{2}\b/.test(e)},{type:"phoneSwiss",check:e=>/\b0(?:\s*\d){2}(?:\s*\/\s*)?(?:\s*\d){7,}\b/.test(e)},{type:"phoneInternational",check:e=>/(?:\+|00)(?:\s*\d){10,}\b/.test(e)},{type:"swissPassport",check:e=>/\b[A-HJ-NP-Z](?=.*\d)[A-HJ-NP-Z0-9]{7}\b/.test(e)},{type:"longNumber",check:e=>/\b\d{9,}\b/.test(e)}],Au=e=>{for(const t of h1)if(t.check(e))return t.type},pa="liipgpt:selectorValues",ga="liipgpt:selectorKnownDefaults",Cu=()=>{try{const e=xt.getItem(pa),t=xt.getItem(ga);return e?{values:JSON.parse(e),knownDefaults:t?JSON.parse(t):{}}:null}catch{return null}},f1=e=>{const t={};for(const r of e)t[r.settingName]=r.defaultValues??(r.allowEmpty?[]:[r.values[0]]).filter(Boolean);return t},Ru=(e,t)=>{try{const r=f1(t);xt.setItem(pa,JSON.stringify(e)),xt.setItem(ga,JSON.stringify(r))}catch(r){console.error("Failed to save selector values:",r)}},p1=e=>{try{const t=Cu();if(!t)return;delete t.values[e],delete t.knownDefaults[e],xt.setItem(pa,JSON.stringify(t.values)),xt.setItem(ga,JSON.stringify(t.knownDefaults))}catch(t){console.error("Failed to clear selector saved state:",t)}},g1=e=>{const t=Cu(),r=e.map(n=>{const o=n.defaultValues??(n.allowEmpty?[]:[n.values[0]]).filter(Boolean);if(!t?.values[n.settingName])return[n.settingName,o];const i=t.values[n.settingName],a=t.knownDefaults[n.settingName]||[],s=i.filter(f=>n.values.includes(f)),l=a.filter(f=>!o.includes(f)),c=s.filter(f=>!l.includes(f)),u=o.filter(f=>!a.includes(f)&&!c.includes(f)),h=[...c,...u];return h.length===0&&!n.allowEmpty?[n.settingName,o]:[n.settingName,h]});return Object.fromEntries(r)};class m1 extends Error{constructor(t){super(t),this.name="UnreachableError"}}const zu=(e,t)=>{const n=new URLSearchParams(window.location.search).get("q");return n?{name:"chat-page",query:n}:e&&!t?{name:"consent-page"}:{name:"start-page"}},Lr=e=>e?e.map(t=>({id:xb(),...t})):[];class v1{#e=Q(zt({}));get data(){return y(this.#e)}set data(t){L(this.#e,t,!0)}#t=Q(zt({}));get targets(){return y(this.#t)}set targets(t){L(this.#t,t,!0)}#r=Q(!1);get initialized(){return y(this.#r)}set initialized(t){L(this.#r,t,!0)}#s=Q(0);get currentAudioVolume(){return y(this.#s)}set currentAudioVolume(t){L(this.#s,t,!0)}ariaLiveMessagesClearingTimeoutDuration=350;#n=Q(null);get currentAudioRecorder(){return y(this.#n)}set currentAudioRecorder(t){L(this.#n,t,!0)}#a=Q(!1);get isTranscribing(){return y(this.#a)}set isTranscribing(t){L(this.#a,t,!0)}#o=W(()=>{if(!this.initialized)return[];const t=this.data.chatConfig.menu;return t?t[this.data.language]??[]:[]});get menu(){return y(this.#o)}set menu(t){L(this.#o,t)}#i=W(()=>this.initialized?this.data.chatConfig.translations[this.data.language]??{}:{});get t(){return y(this.#i)}set t(t){L(this.#i,t)}#l=W(()=>this.initialized?mu[this.data.language]??{}:mu.en??{});get errorTranslations(){return y(this.#l)}set errorTranslations(t){L(this.#l,t)}#u=W(()=>this.initialized?vu[this.data.language]??{}:vu.en??{});get piiTranslations(){return y(this.#u)}set piiTranslations(t){L(this.#u,t)}#c=W(()=>this.initialized?this.data.currentColorScheme:"light");get colorScheme(){return y(this.#c)}set colorScheme(t){L(this.#c,t)}#d=W(()=>this.initialized?this.data.chatConfig.fullTheme[this.data.currentColorScheme]:{});get themeBase(){return y(this.#d)}set themeBase(t){L(this.#d,t)}#h=W(()=>this.themeBase.tokens);get theme(){return y(this.#h)}set theme(t){L(this.#h,t)}#f=W(()=>{if(!this.initialized)return[];const t=[];for(const r of this.data.chatConfig.selectorsConfig){if(r.allowEmpty)continue;(this.data.selectorValues[r.settingName]||[]).length===0&&t.push(r.settingName)}return t});get selectorsWithErrors(){return y(this.#f)}set selectorsWithErrors(t){L(this.#f,t)}}const m=new v1;let tt,At,Iu;s1({name:"chat-logic",state:m,excludeInDevTools:["onInput"]},{async init(e){At=e;const t=At.speechRecognitionApiKey||void 0;tt=new Lb({apiUrl:At.apiUrl,apiKey:At.apiKey,speechRecognitionApiKey:t,strict:!0});try{const r=await tt.getChatConfig();window.CHAT_CONFIG_OVERRIDE&&Object.assign(r,window.CHAT_CONFIG_OVERRIDE);const o=(await tt.getMetadata()).mode==="maintenance";o&&this.showErrorToast("maintenance");const i=gu(r);At.inlineLayout!==void 0&&(i.inlineLayout=At.inlineLayout);let a;At.lang?a=$o(At.lang,i.supportedLanguages):a=wu(i.supportedLanguages),ku(a,m.targets.mainElement);const s=await this.getPredefinedQuestions(a),l=i.translations[a]?.ariaOpensInNewTab;l&&tt.setNewTabSrText(l);const c=[];if(i.renderKatex){const v=await import("https://esm.sh/marked-katex-extension@5.1.5").catch(g=>{console.error("Couldn't load marked-katex-extension:",g)});v&&(tt.setMarkedExtensions(v.default({nonStandard:!0,output:"mathml"})),c.push("https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css"))}const u=Object.keys(i.fullTheme);let h=!1;if(i.forceConsent)try{h=xt.getItem("liipgpt:termsAccepted")==="true"}catch(v){console.warn("Failed to load terms acceptance from storage:",v)}m.data={currentConversationState:"idle",chatConfig:i,language:a,predefinedQuestions:s,isInMaintenance:o,history:Lr(i.messageAdditions.init),selectedColorScheme:Eu(),has2ColorSchemes:u.length===2,currentColorScheme:fa(u),conversationFeedbackId:void 0,conversationFeedbackIsOpen:!1,openedPopup:void 0,props:At,flyoutIsOpen:!1,questionHasPii:void 0,chatInputValue:"",selectorValues:g1(i.selectorsConfig),selectorsIsOpen:!1,currentReferencesAsideId:void 0,ariaLiveStatusMessage:void 0,ariaLiveStatusMessageClearingTimeout:void 0,wasReferencesAsideClosed:!1,isAsideMobile:!0,route:zu(i.forceConsent??!1,h),additionalStylesheets:c,hasOpenedOverlays:!1,isInlineLayoutContained:!1,termsAccepted:h},window.LIIPGPT_LISTENERS?.route?.(m.data.route),window.LIIPGPT_LISTENERS?.conversation?.(m.data.currentConversationState),m.data.selectorsIsOpen=m.data.chatConfig.showExpandedSelectors??!1,m.initialized=!0,this.checkForOpenedPopup(),window.addEventListener("hashchange",()=>{this.checkForOpenedPopup()}),this.goto(zu(i.forceConsent??!1,h),!0)}catch(r){throw da.error(r instanceof Error?r.message:"Failed to load the chatbot. Please reload the page.",{duration:1e4,unstyled:!0,classes:{toast:"toast"}}),r}},setTarget(e,t){m.targets[e]=t},goto(e,t=!1){if(!(!t&&Yb(m.data.route,e)))switch(m.data.route=e,window.LIIPGPT_LISTENERS?.route?.(e),e.name){case"consent-page":break;case"start-page":e.prefill&&(m.data.chatInputValue=e.prefill);break;case"chat-page":if(m.data.chatInputValue=e.query,this.onSubmit(),m.data.chatConfig.addQueryToUrlParams){const r=new URLSearchParams(window.location.search);r.set("q",e.query),history.pushState(null,"",`?${r.toString()}`)}break}},getSelectorConfig(e){const t=m.data.chatConfig.selectorsConfig.find(r=>r.settingName===e);if(!t)throw new Error(`Setting ${e} not found`);return t},getPrettifiedSelectorValues(){const e=Object.entries(m.data.selectorValues).map(([t,r])=>{let n;try{n=this.getSelectorConfig(t)}catch(o){console.error(`Error getting selector config for ${t}: ${o}`);return}return n.type==="single-select"?[t,r[0]]:[t,r]}).filter(t=>!!t);return Object.fromEntries(e)},setSelectorValue(e,t){const r=this.getSelectorConfig(e);if(!r){console.warn(`Trying to set setting ${e} but it is not defined in the chat config`);return}if(r.type==="single-select"&&t.length>1){console.warn(`Trying to set multiple values for single-select setting ${e}`);return}m.data.selectorValues[e]=t,Ru(m.data.selectorValues,m.data.chatConfig.selectorsConfig)},resetSelectorToDefaults(e){const t=this.getSelectorConfig(e);if(!t){console.warn(`Trying to reset setting ${e} but it is not defined in the chat config`);return}const r=t.defaultValues??(t.allowEmpty?[]:[t.values[0]]).filter(Boolean);return p1(e),m.data.selectorValues[e]=r,Ru(m.data.selectorValues,m.data.chatConfig.selectorsConfig),r},async getPredefinedQuestions(e){try{return tt.getPredefinedQuestions({url:window.location.origin+window.location.pathname,language:e})}catch(t){return console.warn("Failed to load predefined questions:",t),[]}},setColorScheme(e){m.data.selectedColorScheme=e,m.data.currentColorScheme=c1(e),this.setAriaLiveStatusMessage(e==="dark"?m.t.ariaDarkSelected:m.t.ariaLightSelected)},async abort(){await Iu?.abort()},changeConversationState(e){m.data.currentConversationState=e,window.LIIPGPT_LISTENERS?.conversation?.(e)},onInput(e){m.data.chatConfig.blockPII&&(m.data.questionHasPii=Au(e)),m.data.chatInputValue=e},onSubmit(e=!1){if(m.data.questionHasPii){console.warn("Question contains PII, not submitting:",m.data.questionHasPii);return}const t=m.data.chatConfig.questionPrefix?`${m.data.chatConfig.questionPrefix} ${m.data.chatInputValue}`:m.data.chatInputValue;m.data.history.push(...Lr(m.data.chatConfig.messageAdditions.user.before)),m.data.history.push({type:"user",time:new Date().toISOString(),message:m.data.chatInputValue}),m.data.history.push(...Lr(m.data.chatConfig.messageAdditions.user.after));const r=m.data.history.push(...Lr(m.data.chatConfig.messageAdditions.bot.before));m.data.history.push({id:"UNRESOLVED",state:"loading",errors:[],type:"bot",time:new Date().toISOString(),message:{markdown:"",html:"",text:""},references:{all:[],used:[],unused:[]}});const n={features:At.features?At.features.trim().split(","):["formatting"],onError:u=>{this.showErrorToast(u),window.LIIPGPT_LISTENERS?.error?.(u),(u==="pii-detected"||u==="blocked")&&this.editLatestQuestion()},lang:m.data.language,selectorValues:{...this.getPrettifiedSelectorValues(),context:d1()}},o=(u,h)=>{try{const f=new URL(u),v=new URL(h);return f.origin===v.origin&&f.pathname===v.pathname}catch{return!1}},i=m.data.chatConfig.sendReferrer??"all";if(["all","own","location"].includes(i)){const u=i==="location"||m.data.props.flyout;let h;u?h=`${window.location.protocol}//${window.location.host}${window.location.pathname}`:h=o(document.referrer,window.location.href)?null:document.referrer;const f=i==="own"&&!m.data.props.flyout&&h&&!h.startsWith(window.location.origin);n.referrer=h&&!f?h:void 0}m.data.currentConversationId||(m.data.currentConversationId=tt.createConversationId());const a=tt.chat(m.data.currentConversationId,t,n);Iu=a,m.data.lastChatResponseId=a.id,m.data.currentConversationState!=="searching"&&this.changeConversationState("searching"),this.setAriaLiveStatusMessage(m.t.ariaQuestionSent);let s=!1,l;const c=!!m.data.currentReferencesAsideId;(e&&c||!e&&m.data.chatConfig.showReferencesByDefault)&&(m.data.isAsideMobile||this.openReferencesAside(a.id)),a.subscribe(u=>{if(m.data.history[r]&&(m.data.history[r]={question:m.data.chatInputValue,...u}),m.data.chatConfig.addRetrievalQuestionToUrlParams&&u.retrievalQuestion){const h=new URLSearchParams(window.location.search);h.get("search")!==u.retrievalQuestion&&(h.set("search",u.retrievalQuestion),history.replaceState(null,"",`?${h.toString()}`))}m.data.chatConfig.showReferencesByDefault&&!m.data.wasReferencesAsideClosed&&m.data.currentReferencesAsideId!==u.id&&!m.data.isAsideMobile&&this.openReferencesAside(u.id),u.state==="streaming"&&m.data.currentConversationState!=="answering"&&this.changeConversationState("answering"),u.state==="done"&&(this.changeConversationState("idle"),s||(s=!0,this.setAriaLiveStatusMessage(`${m.t.ariaAnswerReady} ... ${u.message.text} ... ${m.t.ariaAnswerFinished}`),m.data.history.push(...Lr(m.data.chatConfig.messageAdditions.bot.after))),m.data.currentReferencesAsideId&&m.data.history[r].references.used.length>0?(clearTimeout(l),l=setTimeout(()=>{this.openReferencesAside(u.id)},100)):this.closeReferencesAside())}),m.data.chatInputValue=""},async onStartSpeechRecognition(){try{if(!await l1()){this.showErrorToast("speech-not-supported");return}if(await navigator.mediaDevices.getUserMedia({audio:!0}),Tu.isSupported())m.data.chatInputValue="",m.currentAudioRecorder=new Tu({onDataAvailable:async t=>{m.isTranscribing=!0,await this.handleTranscription(t)},onError:()=>{this.showErrorToast("speech-microphone-access-denied"),m.currentAudioRecorder=null,m.isTranscribing=!1},onVolumeChange:t=>{m.currentAudioVolume=t}}),m.currentAudioRecorder.start();else{this.showErrorToast("speech-not-supported");return}}catch(e){throw this.showErrorToast("speech-microphone-access-denied"),m.currentAudioRecorder=null,m.isTranscribing=!1,e}},editLatestQuestion(){const e=m.data.history.findLastIndex(r=>r?.type==="user");if(e===-1){console.error("No last user question, available");return}const t=m.data.history.splice(e)[0];m.data.chatInputValue=t.message},onStopSpeechRecognition(){if(m.currentAudioRecorder){const e=m.currentAudioRecorder;m.currentAudioRecorder=null,e.stop()}m.currentAudioVolume=0},async handleTranscription(e){if(!e){console.warn("No audio data received");return}try{const t=await tt.transcribeAudio(e,{lang:m.data.language});if(t.error){this.showErrorToast("speech-transcription-failed");return}if(t.transcript.trim()){if(m.data.chatConfig.blockPII&&(m.data.questionHasPii=Au(t.transcript.trim()),m.data.questionHasPii))return;m.data.chatInputValue=t.transcript.trim()}else this.showErrorToast("speech-no-text-detected")}catch(t){console.error("Speech transcription error:",t),this.showErrorToast("speech-transcription-failed")}finally{m.currentAudioRecorder=null,m.isTranscribing=!1,m.currentAudioVolume=0}},async onStartConversation(e){await this.abort(),m.data.history=Lr(m.data.chatConfig.messageAdditions.init),m.data.currentConversationId=tt.createConversationId(),this.goto({name:"chat-page",query:e})},async onNewConversation(){if(await this.abort(),m.data.currentConversationId=void 0,m.data.currentReferencesAsideId=void 0,m.data.history=Lr(m.data.chatConfig.messageAdditions.init),m.data.chatConfig.addQueryToUrlParams){const e=new URLSearchParams(window.location.search);e.delete("q"),history.pushState(null,"",`?${e.toString()}`)}this.goto({name:"start-page"})},showSuccessToast(e){da.success(m.t[e],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},showErrorToast(e){da.error(m.errorTranslations[e],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})},async submitFeedback(e){try{const t=m.data.conversationFeedbackId||m.data.lastChatResponseId;if(!t)throw new m1("Tried to give feedback with no id.");const r=m.data.history.find(n=>n.type==="bot"&&n.id===t);await tt.feedback(t,r?.question??"",e),setTimeout(()=>{this.showSuccessToast("thankYouForFeedback")},500)}catch(t){console.error("Feedback failed:",t),this.showErrorToast("feedback-failed")}},toggleReferencesAside(e){m.data.currentReferencesAsideId===e?this.closeReferencesAside():this.openReferencesAside(e)},openReferencesAside(e){m.data.currentReferencesAsideId=e,this.setOpenOverlay(!0)},closeReferencesAside(){m.data.currentReferencesAsideId=void 0,m.data.wasReferencesAsideClosed=!0,this.setOpenOverlay(!1)},setAsideMobile(e){m.data.isAsideMobile=e},openFlyout(){m.data.flyoutIsOpen=!0},closeFlyout(){m.data.flyoutIsOpen=!1},openConversationFeedback(){m.data.conversationFeedbackIsOpen=!0,this.setOpenOverlay(!0)},openMessageFeedback(e){m.data.conversationFeedbackId=e},closeFeedback(){m.data.conversationFeedbackIsOpen=!1,m.data.conversationFeedbackId=void 0,this.setOpenOverlay(!1)},setOpenOverlay(e){m.data.hasOpenedOverlays=e},setAriaLiveStatusMessage(e){m.data.ariaLiveStatusMessage=e,clearTimeout(m.data.ariaLiveStatusMessageClearingTimeout),m.data.ariaLiveStatusMessageClearingTimeout=setTimeout(()=>{m.data.ariaLiveStatusMessage=""},m.ariaLiveMessagesClearingTimeoutDuration)},closePopup(){window.location.hash=""},checkForOpenedPopup(){const e=window.location.hash.slice(1),t=m.t.popups?.find(r=>r.hash===e);t?m.data.openedPopup=t:m.data.openedPopup=void 0},async thumbs(e,t){try{const r=m.data.history.find(n=>n.type==="bot"&&n.id===e);t==="up"?await tt.thumbsUp(e,r?.question??""):await tt.thumbsDown(e,r?.question??""),this.showSuccessToast("thankYouForFeedback")}catch(r){console.error("Feedback failed:",r),this.showErrorToast("feedback-failed")}},async onLanguageChange(e){if(m.data.language=$o(e,m.data.chatConfig.supportedLanguages),ku(m.data.language,m.targets.mainElement),m.data.predefinedQuestions=await this.getPredefinedQuestions(m.data.language),this.setAriaLiveStatusMessage(m.t.ariaLanguageChanged),m.data.chatConfig.reflectLanguageInPath){const t=new URL(window.location.href);t.pathname=`/${m.data.language}`,window.history.replaceState({},"",t.toString())}},async acceptTerms(){m.data.termsAccepted=!0;try{xt.setItem("liipgpt:termsAccepted","true")}catch(e){console.warn("Failed to save terms acceptance to storage:",e)}this.closePopup(),await Os(),this.goto({name:"start-page"})},updateChatInput(e){m.data.chatInputValue=e}});const b1='@layer base,utilities,components;@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::-moz-placeholder{color:currentcolor}@supports (color: color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}::placeholder{color:currentcolor}@supports (color: color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer base{.chat-app{--spacer-1: .0625rem;--spacer-2: .125rem;--spacer-3: .1875rem;--spacer-4: .25rem;--spacer-5: .3125rem;--spacer-6: .375rem;--spacer-8: .5rem;--spacer-10: .625rem;--spacer-12: .75rem;--spacer-16: 1rem;--spacer-20: 1.25rem;--spacer-24: 1.5rem;--spacer-28: 1.75rem;--spacer-32: 2rem;--spacer-40: 2.5rem;--spacer-48: 3rem;--spacer-56: 3.5rem;--spacer-64: 4rem;--spacer-72: 4.5rem;--spacer-80: 5rem;--spacer-120: 7.5rem;--spacer-r-8: clamp(.375rem, .3182rem + .2841cqw, .5rem);--spacer-r-12: clamp(.625rem, .5682rem + .2841cqw, .75rem);--spacer-r-16: clamp(.75rem, .6364rem + .5682cqw, 1rem);--spacer-r-20: clamp(.875rem, .7045rem + .8523cqw, 1.25rem);--spacer-r-24: clamp(1rem, .7727rem + 1.1364cqw, 1.5rem);--spacer-r-28: clamp(1.125rem, .8409rem + 1.4205cqw, 1.75rem);--spacer-r-32: clamp(1.25rem, .9091rem + 1.7045cqw, 2rem);--spacer-r-40: clamp(1.5rem, 1.0455rem + 2.2727cqw, 2.5rem);--spacer-r-48: clamp(1.625rem, 1rem + 3.125cqw, 3rem);--spacer-r-56: clamp(1.75rem, .9545rem + 3.9773cqw, 3.5rem);--spacer-r-64: clamp(2rem, 1.0909rem + 4.5455cqw, 4rem);--spacer-r-80: clamp(3rem, 2.0909rem + 4.5455cqw, 5rem);--spacer-r-96: clamp(3.5rem, 2.3636rem + 5.6818cqw, 6rem);--spacer-r-120: clamp(4rem, 2.4091rem + 7.9545cqw, 7.5rem);--default-transition-duration: .2s;--default-transition-timing-function: ease-in-out;--z-index-flyout: 10000;--z-index-dialog: 600;--z-index-loader: 500;--z-index-reference-number: 400;--z-index-footer: 300;--z-index-header: 200;--z-index-tooltip: 100;--z-index-tooltip-hover: 101;--z-index-local-overlay: 10;--ease-out-quart: cubic-bezier(.165, .84, .44, 1);--ease-in-quart: cubic-bezier(.895, .03, .685, .22);--ease-in-out-quart: cubic-bezier(.77, 0, .175, 1);--fly-in-id: 0;--btn-padding-x: var(--spacer-r-20);--btn-padding-y: var(--spacer-r-8);--btn-icon-size: var(--spacer-24);--btn-submit-size: 2.5em;--last-bot-message-min-height: 0}}@value container-xs,container-sm,container-md,container-lg,container-inner-xs,container-inner-sm,container-inner-md,container-inner-lg from "./viewports.css";@layer base{.chat-app :where(h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){font-weight:var(--base-font-weight-title);line-height:var(--base-line-height-tight)}.chat-app :where(b,strong){font-weight:var(--base-font-weight-bold)}.chat-app :where(button){cursor:pointer}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea){width:100%;padding:var(--input-padding);border-width:var(--input-border-width);border-radius:var(--input-border-radius);border-color:var(--input-border-color);background:var(--input-background);box-shadow:var(--input-box-shadow, none);color:var(--input-color)}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea)::-moz-placeholder{color:var(--input-placeholder-color);opacity:var(--input-placeholder-opacity)}.chat-app :where(input[type=text],input[type=email],input[type=search],input[type=password],textarea)::placeholder{color:var(--input-placeholder-color);opacity:var(--input-placeholder-opacity)}.chat-app :where(input[type=radio],input[type=checkbox]){margin:0}.chat-app :where(*:focus-visible){border-radius:var(--btn-primary-border-radius);outline-color:var(--body-focus-color);outline-style:var(--body-focus-style);outline-width:var(--body-focus-width);outline-offset:var(--body-focus-offset)}.chat-app *::-moz-selection{background:var(--body-selection-background);color:var(--body-selection-color)}.chat-app *::selection{background:var(--body-selection-background);color:var(--body-selection-color)}.chat-app ::-webkit-scrollbar{width:8px;height:8px}.chat-app ::-webkit-scrollbar-track{background:transparent}.chat-app ::-webkit-scrollbar-thumb{border-radius:4px;background-color:#0000004d;-webkit-transition:background-color .2s;transition:background-color .2s}.chat-app ::-webkit-scrollbar-thumb:hover{background-color:#00000080}.chat-app *{scrollbar-color:rgba(0,0,0,.3) transparent;scrollbar-width:thin}.chat-app ::-webkit-scrollbar-thumb{visibility:hidden}.chat-app *:hover::-webkit-scrollbar-thumb,.chat-app *:active::-webkit-scrollbar-thumb,.chat-app *:focus::-webkit-scrollbar-thumb{visibility:visible}}@layer utilities{.chat-app :where(.expand-interaction){position:relative}.chat-app :where(.expand-interaction):after{position:absolute;inset:0;background-color:transparent;content:""}.chat-app :where(.sr-only){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.chat-app :where(.transition-colors){transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color,box-shadow;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.transition){transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.skip-link){position:absolute;width:0px;height:0px;overflow:hidden;color:var(--anchor-color);font-weight:700;font-size:var(--base-font-size-xs)}.chat-app :where(.skip-link):focus-visible{position:static;width:auto;height:auto}.chat-app :where(.fly-in){--fly-in-id: 0;--fly-in-duration: .4s;--fly-out-duration: .2s;--fly-in-delay: .3s;--fly-in-delay-additional: .1s;--fly-in-y: var(--spacer-r-64);transform:translateY(var(--fly-in-y));opacity:0;transition-delay:0s,1s;transition-duration:var(--fly-out-duration);transition-property:opacity,transform;transition-timing-function:ease,var(--ease-out-quart)}.chat-app :where(.mounted .fly-in){transform:translateY(0);opacity:1;transition-delay:calc(var(--fly-in-delay) + var(--fly-in-id) * var(--fly-in-delay-additional));transition-duration:var(--fly-in-duration)}.chat-app :where(.truncate){display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-app :where(.line-clamp){display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat-app :where(.line-clamp--2){-webkit-line-clamp:2}.chat-app :where(.line-clamp--6){-webkit-line-clamp:6}.chat-app :where(.container){width:100%;max-width:var(--container-max-width, 1024px);margin:0 auto;padding-right:var(--spacer-16);padding-left:var(--spacer-16)}@container chat-container (min-width: 640px){.chat-app :where(.container){padding-right:var(--spacer-32);padding-left:var(--spacer-32)}}@container chat-container (min-width: 768px){.chat-app :where(.container){padding-right:var(--spacer-48);padding-left:var(--spacer-48)}}.chat-app :where(h1){font-size:var(--base-font-size-h1)}.chat-app :where(h2){font-size:var(--base-font-size-h2)}.chat-app :where(h3){font-size:var(--base-font-size-h3)}.chat-app :where(h4,h5,h6){font-size:var(--body-font-size)}.chat-app :where(.h1){font-size:var(--base-font-size-h1)}.chat-app :where(.h2){font-size:var(--base-font-size-h2)}.chat-app :where(.h3){font-size:var(--base-font-size-h3)}.chat-app :where(.h4,.h5,.h6){font-size:var(--body-font-size)}.chat-app :where(.text-container)>:where(p,ul,ol,img,table){display:block;margin-bottom:var(--spacer-r-24)}.chat-app :where(.text-container)>:where(div){margin:var(--spacer-r-40) 0}.chat-app :where(.text-container)>:where(h1,.h1){margin-bottom:var(--spacer-r-28)}.chat-app :where(.text-container)>:where(h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){margin-bottom:var(--spacer-r-20)}.chat-app :where(.text-container)>:where(h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6){margin-top:var(--spacer-r-40)}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling),ol:not(.no-list-styling))>:where(li){margin-bottom:var(--spacer-12)}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling),ol:not(.no-list-styling))>:where(li):last-child{margin-bottom:0}.chat-app :where(.text-container)>:where(ol){padding-left:1.5em;list-style-position:outside;list-style-type:decimal}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li){position:relative;padding-left:1em}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li):before{position:absolute;top:0;left:0;content:"•";font-size:.9em}.chat-app :where(.text-container)>:where(hr){height:1px;margin:var(--spacer-r-40) 0;border:none;background-color:var(--color-grey-700);background-color:var(--hr-color)}.chat-app :where(.text-container) :where(a:not(.button,.no-link-styling,.reference)){color:var(--anchor-color);font-weight:var(--anchor-font-weight, var(--base-font-weight-normal));-webkit-text-decoration:var(--anchor-text-decoration, underline);text-decoration:var(--anchor-text-decoration, underline);text-underline-offset:var(--anchor-text-underline-offset, .15em);transition-duration:var(--default-transition-duration);transition-property:color,background-color,border-color;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.text-container) :where(a:not(.button,.no-link-styling,.reference)):hover{color:var(--anchor-hover-color)}.chat-app :where(.text-container) :where(table){display:block;width:100%;overflow-x:auto;border-collapse:collapse;border-spacing:0;-webkit-overflow-scrolling:touch}.chat-app :where(.text-container) :where(th){width:1000px;padding:var(--spacer-12) var(--spacer-16) var(--spacer-12) 0;border-bottom:1px solid var(--color-grey-300);line-height:var(--base-line-height-tight);text-align:left;vertical-align:bottom}.chat-app :where(.text-container) :where(td){padding:var(--spacer-12) var(--spacer-16) var(--spacer-12) 0;border-bottom:1px solid var(--color-grey-300);vertical-align:top}.chat-app :where(.text-container) :where(tr:last-child td){border-bottom:none}.chat-app :where(.text-container) :where(*:first-child){margin-top:0}.chat-app :where(.text-container) :where(*:last-child){margin-bottom:0}.chat-app :where(.animated-height){transition:height .5s var(--ease-in-out-quart)}.chat-app :where(.display-contents){display:contents}.chat-app :where(.absolute){position:absolute!important}}@layer base{.svg{width:var(--spacer-r-24);height:auto}.svg svg{display:block;width:100%;height:auto;overflow:visible}}@layer components{.chat-app{display:contents}.chat-app__container{container-name:chat-container;container-type:inline-size;display:flex;height:100%;overflow:hidden;transform:translateZ(0)}.chat-app__container>:where(*){color:var(--body-color);font-style:normal;font-weight:var(--base-font-weight-normal);font-size:var(--base-font-size-body);line-height:var(--base-line-height-default);font-family:var(--font-family);font-optical-sizing:auto}.chat-app__container.chat-app__container--inline-layout-contained{height:90svh;scroll-margin-top:10svh}@media(min-width:768px){.chat-app__container.chat-app__container--inline-layout-contained{height:100svh;scroll-margin-top:0}}.chat-app__main{container-name:chat-inner-container;container-type:inline-size;display:flex;flex-direction:column;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior-x:none;overscroll-behavior-y:contain;background:var(--body-background);scrollbar-gutter:stable;touch-action:pan-y}.chat-app__container--inline-layout .chat-app__main{overscroll-behavior-y:auto}.chat-app__loader-container{display:flex;z-index:var(--z-index-loader);position:relative;align-items:center;justify-content:center;width:100%;height:100%}.chat-app__portals{display:contents}.chat-app__header{z-index:var(--z-index-header);position:sticky;top:0;background:var(--body-background)}.chat-app__header--unsticked{position:relative}.chat-app__header-content{--btn-padding-x: var(--btn-padding-y);display:flex;position:relative;-moz-column-gap:var(--spacer-r-12);column-gap:var(--spacer-r-12);flex-wrap:wrap;align-items:center;justify-content:flex-end;margin-right:calc(var(--btn-padding-x) * -1);margin-left:calc(var(--btn-padding-x) * -1);padding-top:var(--spacer-10);padding-bottom:var(--spacer-10)}.chat-app__header-content>:where(*){z-index:0;position:relative;pointer-events:auto}.chat-app__header-content:after{position:absolute;right:var(--btn-padding-x);bottom:0;left:var(--btn-padding-x);border-bottom:1px solid transparent;content:"";transition:border-color .1s ease-in-out}.chat-app__header-content.has-border:after{border-color:var(--base-line-color)}.chat-app__header-new-conversation{position:relative;margin-right:auto}@container chat-container (min-width: 640px){.chat-app__header-new-conversation .tooltip{display:none}}.chat-app__header--with-logo :where(.chat-app__header-content){margin-left:0}.chat-app__header--with-logo :where(.chat-app__header-new-conversation){margin-right:unset;margin-left:auto}.chat-app__header-logo{margin-right:auto}.chat-app__header-logo :where(svg){width:auto;height:var(--spacer-28)}.chat-app__body{display:flex;position:relative;flex-grow:1;flex-direction:column;width:100%}.chat-app__page-transition{display:flex;flex-grow:1;flex-direction:column;width:100%;height:100%}.chat-app__aside{--duration-in: .65s;--duration-out: .5s;visibility:hidden;position:relative;top:0;bottom:0;flex-grow:1;width:0;transition-delay:0s,var(--duration-out);transition-duration:var(--duration-out),0s;transition-property:width,visibility;transition-timing-function:var(--ease-in-out-quart),linear}.chat-app__aside.open{visibility:visible;width:var(--aside-width);transition-delay:0s;transition-duration:var(--duration-in),0s;transition-timing-function:var(--ease-out-quart),linear}.chat-app__aside .tooltip{--background-color: var(--btn-secondary-hover-background)}.chat-app__aside-container{position:relative;width:var(--aside-width);height:100%;overflow-y:auto;overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable}.chat-app__container--inline-layout .chat-app__aside-container{overscroll-behavior-y:auto}.chat-app__aside-header,.chat-app__sheet-header{display:flex;z-index:var(--z-index-header);position:sticky;top:0;flex-wrap:no-wrap;align-items:center;justify-content:space-between;padding:var(--spacer-12) var(--spacer-12) var(--spacer-12) var(--spacer-24);gap:var(--spacer-24);border-bottom-width:var(--aside-header-border-width);border-color:var(--aside-header-border-color);background:var(--aside-background);color:var(--aside-header-color)}.chat-app__sheet-close{position:relative}.chat-app__sheet-overlay{z-index:var(--z-index-dialog);position:fixed;inset:0;background:var(--aside-background-overlay)}.chat-app__sheet-content{z-index:var(--z-index-flyout);position:fixed;top:0;right:0;width:100%;max-width:var(--aside-width);height:100%;overflow-y:auto;overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable}.chat-app__container--inline-layout .chat-app__sheet-content{overscroll-behavior-y:auto}:is(.chat-app__aside-close,.chat-app__sheet-close) :where(.btn){background-color:transparent}.chat-app__aside-title,.chat-app__sheet-title{font-size:var(--base-font-size-sm)}.chat-app__close-button{z-index:var(--z-index-flyout)}}@layer components{.open-button{--open-button-avatar-height: var(--spacer-r-80);--open-button-avatar-width: var(--spacer-r-80);--open-button-duration: .4s;--open-button-delay: .3s;--open-button-ease: ease-in-out;display:flex;flex-direction:row;align-items:flex-end;cursor:pointer;transition:opacity .15s ease-out}.open-button--expanded{opacity:0;pointer-events:none}.open-button__text{display:flex;position:absolute;right:100%;bottom:50%;flex-direction:column;align-items:flex-start;justify-content:center;margin-right:calc(var(--open-button-avatar-width) * -.5);padding-top:var(--spacer-r-12);padding-right:0;padding-bottom:var(--spacer-r-12);padding-left:0;overflow:hidden;transform:translateY(50%);border-width:var(--open-button-border-width);border-radius:var(--open-button-border-radius);border-color:var(--open-button-border-color);background:var(--open-button-background);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;color:var(--open-button-color);text-align:left;transition:transform var(--open-button-duration) var(--open-button-ease),padding-right var(--open-button-duration) var(--open-button-delay) var(--open-button-ease)}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__text{transform:translateY(0);background:var(--open-button-hover-background, var(--open-button-background));color:var(--open-button-hover-color, var(--open-button-color));opacity:1;transition:transform var(--open-button-duration) var(--open-button-delay) var(--open-button-ease)}.open-button__title{max-width:240px;padding:0 calc(var(--open-button-avatar-width) * .5 + var(--spacer-r-12)) 0 var(--spacer-r-12);font-weight:700;white-space:pre}.open-button__mask{width:0;height:0;overflow:hidden;transition:width var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),height var(--open-button-duration) var(--open-button-ease)}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__mask{transition:width var(--open-button-duration) var(--open-button-ease),height var(--open-button-duration) var(--open-button-delay) var(--open-button-ease)}.open-button__description{position:relative;width:50cqw;max-width:260px;padding:0 calc(var(--open-button-avatar-width) * .5 + var(--spacer-r-12)) 0 var(--spacer-r-12);text-wrap:balance}.open-button__avatar{z-index:var(--z-index-local-overlay);position:relative;width:var(--open-button-avatar-width);height:var(--open-button-avatar-height);overflow:clip;border-radius:var(--spacer-r-80);filter:drop-shadow(0 4px 6px rgba(0,0,0,.15));transition:transform .2s var(--open-button-ease)}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__avatar{transform:scale(1.05)}.open-button__link-icon{display:none;position:absolute;right:0;width:var(--spacer-r-80);height:var(--spacer-r-80);padding:var(--spacer-r-20);color:var(--open-button-color)}:where(.open-button--standalone){position:fixed;right:var(--spacer-r-16);bottom:var(--spacer-r-16)}@media(prefers-reduced-motion:reduce){.open-button__text,.open-button__mask,.open-button:hover .open-button__text,.open-button:hover .open-button__mask{transition:none!important}.open-button__avatar,.open-button:hover .open-button__avatar{filter:none!important;transition:none!important}}.open-button--hide-title-when-collapsed .open-button__text{visibility:hidden;opacity:0;transition:transform var(--open-button-duration) var(--open-button-ease),padding-right var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),opacity var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),visibility 0s linear calc(var(--open-button-duration) + var(--open-button-delay))}.open-button--hide-title-when-collapsed:is(:hover,.open-button--programmatic-expand) .open-button__text{visibility:visible;transform:translateY(0);background:var(--open-button-hover-background, var(--open-button-background));color:var(--open-button-hover-color, var(--open-button-color));opacity:1;transition:transform var(--open-button-duration) var(--open-button-delay) var(--open-button-ease),opacity var(--open-button-duration) var(--open-button-ease),visibility 0s linear 0s}}',k1=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),w1=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),y1=new RegExp("(\\d)(\\p{Ll})","gu"),_1=new RegExp("(\\p{L})(\\d)","gu"),S1=/[^\p{L}\d]+/giu,Po="$1\0$2",x1="";function T1(e,t){let r=e.trim();r=r.replace(k1,Po).replace(w1,Po),t?.separateNumbers&&(r=r.replace(y1,Po).replace(_1,Po)),r=r.replace(S1,"\0");let n=0,o=r.length;for(;r.charAt(n)==="\0";)n++;if(n===o)return[];for(;r.charAt(o-1)==="\0";)o--;return r.slice(n,o).split(/\0/g)}function E1(e,t){return R1(e,t?.prefixCharacters)+T1(e,t).map(C1(t?.locale)).join(t?.delimiter??" ")}function A1(e,t){return E1(e,{delimiter:"-",...t})}function C1(e){return e===!1?t=>t.toLowerCase():t=>t.toLocaleLowerCase(e)}function R1(e,t=x1){let r="";for(let n=0;n<e.length;n++){const o=e.charAt(n);if(t.includes(o))r+=o;else break}return r}const Lo=A1,z1=640,I1=1024;let Do=null;const O1=()=>{if(Do)return Do;if(!globalThis.document)return 16;const e=globalThis.document.querySelector(":root");return Do=Number(getComputedStyle(e).fontSize.slice(0,-2)),Do},$1=({minRem:e,maxRem:t})=>{const r=O1(),n=z1/r,o=I1/r,i=(t-e)/(o-n),a=-n*i+e;return`clamp( ${e}rem, ${a}rem + ${i*100}cqw, ${t}rem )`},Ou=e=>typeof e=="string"?e:typeof e=="number"?String(e):typeof e=="object"?e.minRem===e.maxRem?`${e.minRem}rem`:$1(e):"",ma=(e,t,r,n=!1)=>{let o="";return r.forEach(i=>{let a=t[i];n&&!a&&i==="borderWidth"&&(a="0px"),n&&!a&&i==="borderColor"&&(a="transparent"),a&&(o+=`--${Lo(e)}-${Lo(i)}:${Ou(a)}; `)}),o},$u=(e,t)=>Object.entries(t).map(([r,n])=>`--${e}-${Lo(r)}:${Ou(n)}`).join("; ")+"; ",P1=(e,t)=>{let r="";return r+=ma(e,t,["background","borderWidth","borderColor","boxShadow","borderRadius","color"],!0),t.hover&&(r+=ma(`${e}-hover`,t.hover,["background","borderWidth","borderColor","boxShadow","color"])),t.focus&&(r+=ma(`${e}-focus`,t.focus,["background","borderWidth","borderColor","boxShadow","color"])),t.custom&&(r+=$u(e,t.custom)),r},L1=(e,t)=>Object.entries(t).map(([r,n])=>`--color-${e}-${r}:${n}`).join("; ")+"; ",D1=e=>`--font-family: ${e?.family||"inherit"};`,N1=e=>{const t=D1(e.font),r=Object.entries(e.colors).map(([i,a])=>L1(i,a)).join(""),n=$u("base",e.base),o=Object.entries(e.components).map(([i,a])=>P1(Lo(i),a)).join("");return`.chat-app {${t} ${r} ${n} ${o}};`};var dt=typeof window<"u"?window:{screen:{},navigator:{}},nn=(dt.matchMedia||(function(){return{matches:!1}})).bind(dt),M1={get passive(){return!0}},Pu=function(){};dt.addEventListener&&dt.addEventListener("p",Pu,M1),dt.removeEventListener&&dt.removeEventListener("p",Pu,!1);var va="ontouchstart"in dt,F1="TouchEvent"in dt,j1=va||F1&&nn("(any-pointer: coarse)").matches,Lu=(dt.navigator.maxTouchPoints||0)>0||j1,Du=dt.navigator.userAgent||"",B1=nn("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Du)&&Math.min(dt.screen.width||0,dt.screen.height||0)>=768,Nu=(nn("(pointer: coarse)").matches||!nn("(pointer: fine)").matches&&va)&&!/Windows.*Firefox/.test(Du),Z1=nn("(any-pointer: fine)").matches||nn("(any-hover: hover)").matches||B1||!va,Mu=Lu&&(Z1||!Nu)?"hybrid":Lu?"touchOnly":"mouseOnly",U1=Mu==="mouseOnly"?"mouse":Mu==="touchOnly"||Nu?"touch":"mouse";function Fu(e,t){Zr(t,!0);let r=ae(t,"href",7),n=ae(t,"target",7),o=ae(t,"onclick",7),i=ae(t,"className",23,()=>[]),a=ae(t,"isStandalone",7,!1),s=ae(t,"children",7),l=ae(t,"type",7,"button"),c=ae(t,"use",7),u=ae(t,"class",7),h=_i(t,["$$slots","$$events","$$legacy","$$host","href","target","onclick","className","isStandalone","children","type","use","class"]);const f=W(()=>r()?"a":"button"),v=W(()=>[...Array.isArray(i())?i():i()?[i()]:[],...u()?[u()]:[]]),g=()=>({}),b=W(()=>c()??g);var A={get href(){return r()},set href(S){r(S),J()},get target(){return n()},set target(S){n(S),J()},get onclick(){return o()},set onclick(S){o(S),J()},get className(){return i()},set className(S=[]){i(S),J()},get isStandalone(){return a()},set isStandalone(S=!1){a(S),J()},get children(){return s()},set children(S){s(S),J()},get type(){return l()},set type(S="button"){l(S),J()},get use(){return c()},set use(S){c(S),J()},get class(){return u()},set class(S){u(S),J()}},w=_t(),_=Le(w);return Ws(_,()=>y(f),!1,(S,T)=>{Qs(S,D=>y(b)?.(D)),rl(S,()=>({...h,onclick:r()?void 0:o(),type:r()?void 0:l(),href:r(),role:r()?"link":"button",target:r()?n():void 0,class:y(v),[Gr]:{"open-button--standalone":a()}}));var C=_t(),P=Le(C);Us(P,s),ie(T,C)}),ie(e,w),Ur(A)}Tn(Fu,{href:{},target:{},onclick:{},className:{},isStandalone:{},children:{},type:{},use:{},class:{}},[],[],{mode:"open"});function Bn(e,t){Zr(t,!0);let r=ae(t,"css",7),n=_i(t,["$$slots","$$events","$$legacy","$$host","css"]);const o=c=>{ms(()=>{r()&&(c.innerHTML=r())})};var i={get css(){return r()},set css(c){r(c),J()}},a=_t(),s=Le(a);{var l=c=>{var u=_t(),h=Le(u);Ws(h,()=>"style",!1,(f,v)=>{Qs(f,g=>o?.(g)),rl(f,()=>({...n}))}),ie(c,u)};pr(s,c=>{r()&&c(l)})}return ie(e,a),Ur(i)}Tn(Bn,{css:{}},[],[],{mode:"open"});var q1=Ot('<div class="open-button__title"><!></div>'),V1=Ot('<div class="open-button__mask"><div class="open-button__description"><!></div></div>'),H1=Ot('<div class="open-button__text"><!> <!></div>'),G1=Ot('<div class="sr-only"> </div>'),W1=Ot('<!> <div class="svg svg--avatar open-button__avatar" aria-hidden="true"><!></div>',1),Q1=Ot('<link rel="stylesheet"/>'),Y1=Ot("<!> <!>",1),J1=Ot('<!> <!> <!> <main class="chat-app"><!></main>',1);function ju(e,t){Zr(t,!0);const r=(z,Y)=>{let Z=()=>Y?.().chatConfig,Se=()=>Y?.().language,xe=()=>Y?.().colorScheme;const le=W(()=>{const{openButtonTitle:Ae,openButtonDescription:oe}=Z().translations[Se()];return{openButtonTitle:Ae,openButtonDescription:oe}}),Ze=W(()=>Z().fullTheme[xe()].tokens.svgs),Te=W(()=>Z().fullTheme[xe()]?.tokens.components.openButton?.custom),Ee=W(()=>!!y(Te)?.hideTitleWhenCollapsed);{let Ae=W(()=>Z().buttonHref?void 0:s()?"true":"false"),oe=W(()=>Z().buttonHref?void 0:"true"),rt=W(()=>Z().buttonHref?void 0:a()),Ue=W(()=>["open-button",t.buttonClass,m.data.flyoutIsOpen?"open-button--expanded":void 0,y(Ee)?"open-button--hide-title-when-collapsed":void 0]);Fu(z,{get href(){return Z().buttonHref},onclick:Fo,onmouseenter:Mo,onmouseleave:wa,use:Dr,get"aria-expanded"(){return y(Ae)},get"aria-haspopup"(){return y(oe)},get"aria-controls"(){return y(rt)},get style(){return t.buttonStyle},get className(){return y(Ue)},get isStandalone(){return y(f)},children:(ht,er)=>{var Nt=W1(),Zn=Le(Nt);{var Zo=nt=>{var Ce=H1(),wr=Qt(Ce);{var Uo=Mt=>{var ot=q1(),Ft=Qt(ot);bi(Ft,()=>y(le).openButtonTitle),Vt(ot),ie(Mt,ot)};pr(wr,Mt=>{y(le).openButtonTitle&&Mt(Uo)})}var qo=hr(wr,2);{var Un=Mt=>{var ot=V1(),Ft=Qt(ot),Ct=Qt(Ft);bi(Ct,()=>y(le).openButtonDescription),Vt(Ft),sl(Ft,jt=>L(_,jt),()=>y(_)),Vt(ot),sl(ot,jt=>L(w,jt),()=>y(w)),ie(Mt,ot)};pr(qo,Mt=>{y(le).openButtonDescription&&U1==="mouse"&&Mt(Un)})}Vt(Ce),ie(nt,Ce)},ya=nt=>{var Ce=G1(),wr=Qt(Ce,!0);Vt(Ce),no(()=>js(wr,m.t.ariaOpenChat)),ie(nt,Ce)};pr(Zn,nt=>{y(le).openButtonTitle||y(le).openButtonDescription?nt(Zo):nt(ya,!1)})}var sn=hr(Zn,2),Nr=Qt(sn);bi(Nr,()=>y(Ze).avatar),Vt(sn),ie(ht,Nt)},$$slots:{default:!0}})}};let n=Q("light"),o=ae(t,"host",7),i=ae(t,"onError",7),a=ae(t,"flyoutId",7),s=ae(t,"flyoutIsOpen",7),l=_i(t,["$$slots","$$events","$$legacy","$$host","host","onError","flyoutId","flyoutIsOpen"]);const c=async z=>{const Z=await(await fetch(`${z}/chatconfig`)).json();return au.parse(Z)},u=async({forceTheme:z,lang:Y,apiUrl:Z})=>{const Se=window.CHAT_CONFIG_OVERRIDE?window.CHAT_CONFIG_OVERRIDE:await c(Z),xe=gu(Se);let le;Y?le=$o(Y,xe.supportedLanguages):le=wu(xe.supportedLanguages);const Ze=Object.keys(xe.fullTheme),Te=fa(Ze);return{chatConfig:xe,language:le,colorScheme:Te}},h=(z,Y)=>{if(z==null)return Y;if(typeof z=="string"){const Z=z.trim().toLowerCase();return!(Z===""||Z==="0"||Z==="false"||Z==="no")}return typeof z=="number"?z!==0:typeof z=="boolean"?z:Y};let f=W(()=>!!o()),v=Q(!1),g=Q(!1),b=Q(!1),A=Q(void 0),w=Q(void 0),_=Q(void 0),S=W(()=>y(_)?.offsetWidth??0),T=W(()=>y(_)?.offsetHeight??0),C=Q(void 0),P=Q(!1),D,F=Q(!0);function $e(){return y(C)?(clearTimeout(y(C)),L(C,void 0),!0):!1}async function fe(z){L(n,z.colorScheme,!0),D?.(),$e(),L(P,!1);const Y=z.chatConfig.fullTheme[y(n)]?.tokens.components.openButton?.custom??{},Z=Y.autoExpandScrollThreshold,Se=Number(Y.autoCollapseDelay??0),xe=Number.isNaN(Se)?0:Math.max(0,Se),le=h(Y.autoExpandOnce,!1),Ze=(()=>{if(Z==null)return 100;if(typeof Z=="string"){if(Z.trim().toLowerCase()==="none")return 0;const Ue=Number(Z);return Number.isNaN(Ue)?100:Ue}const oe=Number(Z);return Number.isNaN(oe)?100:oe})();if(Number.isNaN(Ze)||Ze<=0)return;const Te=`liipgpt-auto-expand-${t.apiUrl}`;let Ee=!1;if(typeof window<"u")try{Ee=window.localStorage.getItem(Te)==="true"}catch(oe){console.warn("LiipGPT: unable to read auto-expand flag",oe)}L(b,Ee,!0);const Ae=()=>{if(!(window.scrollY/window.innerHeight*100>=Ze)){L(F,!0);return}if(!(y(g)||s())&&!(le&&(Ee||y(b)))&&y(F)){if(L(F,!1),L(g,!0),L(b,!0),ba(),le&&typeof window<"u")try{window.localStorage.setItem(Te,"true")}catch(Ue){console.warn("LiipGPT: unable to persist auto-expand flag",Ue)}L(C,setTimeout(()=>{y(P)||(ka(),L(g,!1)),L(C,void 0)},xe),!0)}};window.addEventListener("scroll",Ae,{passive:!0}),Ze===0&&(await Os(),Ae()),D=()=>{window.removeEventListener("scroll",Ae)}}function be(){$e(),L(g,!1),L(P,!1)}function Dr(z){L(A,z,!0)}function on(){D?.(),$e()}wh(on);function an(){!y(_)||!y(w)||(y(w).style.width=`${y(S)}px`,y(w).style.height=`${y(T)}px`)}function No(){y(w)&&(y(w).style.width="0",y(w).style.height="0")}function ba(){y(A)&&(y(A).classList.add("open-button--programmatic-expand"),an())}function ka(){y(A)&&(y(A).classList.remove("open-button--programmatic-expand"),No())}function Mo(){$e()&&L(P,!0),an()}function wa(){$e(),y(P)&&(L(g,!1),L(P,!1),y(A)?.classList.remove("open-button--programmatic-expand")),y(v)||No()}function Fo(z){be(),t.onclick?.(z)}let ue=W(()=>u(l).then(async z=>(await fe(z),z)).catch(z=>i()(z)));var jo={get host(){return o()},set host(z){o(z),J()},get onError(){return i()},set onError(z){i(z),J()},get flyoutId(){return a()},set flyoutId(z){a(z),J()},get flyoutIsOpen(){return s()},set flyoutIsOpen(z){s(z),J()}},pe=_t();oh("beforeunload",ai,on),Ah("1k415fq",z=>{var Y=_t(),Z=Le(Y);{var Se=xe=>{var le=_t(),Ze=Le(le);Hs(Ze,()=>y(ue),null,(Te,Ee)=>{const Ae=W(()=>y(Ee).chatConfig.fullTheme[y(Ee).colorScheme]);var oe=Y1(),rt=Le(oe);xh(rt,17,()=>y(Ae).fontURLs??[],_h,(ht,er)=>{var Nt=Q1();no(()=>xn(Nt,"href",y(er))),ie(ht,Nt)});var Ue=hr(rt,2);Bn(Ue,{id:"font-css",get css(){return y(Ae).fontCSS}}),ie(Te,oe)}),ie(xe,le)};pr(Z,xe=>{y(f)&&xe(Se)})}ie(z,Y)});var Bo=Le(pe);return Hs(Bo,()=>y(ue),z=>{},(z,Y)=>{const Z=W(()=>y(Y).chatConfig.fullTheme[y(n)]);var Se=_t(),xe=Le(Se);{var le=Te=>{var Ee=J1(),Ae=Le(Ee);{let er=W(()=>N1(y(Z).tokens));Bn(Ae,{id:"theme-css",get css(){return y(er)}})}var oe=hr(Ae,2);Bn(oe,{id:"app-css",get css(){return b1}});var rt=hr(oe,2);Bn(rt,{id:"custom-css",get css(){return y(Z).customCSS}});var Ue=hr(rt,2),ht=Qt(Ue);r(ht,()=>y(Y)),Vt(Ue),ie(Te,Ee)},Ze=Te=>{r(Te,()=>y(Y))};pr(xe,Te=>{y(f)?Te(le):Te(Ze,!1)})}ie(z,Se)}),ie(e,pe),Ur(jo)}Tn(ju,{host:{},onError:{},flyoutId:{},flyoutIsOpen:{}},[],[],{mode:"open"});function Bu(e,t){Zr(t,!0);let r=ae(t,"onclick",7),n=ae(t,"buttonClass",7),o=ae(t,"buttonStyle",7),i=ae(t,"apiUrl",7),a=ae(t,"forceTheme",7),s=ae(t,"lang",7),l=W(()=>({onclick:r(),buttonClass:n(),buttonStyle:o(),apiUrl:i(),forceTheme:a(),lang:s()}));var c={get onclick(){return r()},set onclick(u){r(u),J()},get buttonClass(){return n()},set buttonClass(u){n(u),J()},get buttonStyle(){return o()},set buttonStyle(u){o(u),J()},get apiUrl(){return i()},set apiUrl(u){i(u),J()},get forceTheme(){return a()},set forceTheme(u){a(u),J()},get lang(){return s()},set lang(u){s(u),J()}};return cl(e,{silent:!0,body:(h,f=_r)=>{ju(h,Wh({host:t.$$host,get onError(){return f()}},()=>y(l)))},$$slots:{body:!0}}),Ur(c)}return customElements.define("liipgpt-button",Tn(Bu,{forceTheme:{attribute:"force-theme",type:"String"},buttonClass:{attribute:"button-class",type:"String"},buttonStyle:{attribute:"button-style",type:"String"},apiUrl:{attribute:"api-url",type:"String"},lang:{attribute:"lang",type:"String"},onclick:{}},[],[],{mode:"open"})),Go.LiipGPTButton=Bu,Object.defineProperty(Go,Symbol.toStringTag,{value:"Module"}),Go})({});
|