@liip/liipgpt 3.4.1 → 3.4.3
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 +85 -85
- package/chat/liipgpt-chat.iife.js +103 -103
- package/config/index.cjs +95 -85
- package/config/index.js +82 -78
- package/configurator/_app/env.js +1 -1
- package/configurator/_app/immutable/chunks/BVVGjklr.js +89 -0
- package/configurator/_app/immutable/chunks/BdP-K7KO.js +3 -0
- package/configurator/_app/immutable/chunks/BmMr_umq.js +1 -0
- package/configurator/_app/immutable/chunks/BmcNmQ0G.js +16 -0
- package/configurator/_app/immutable/chunks/C8mohMXa.js +1 -0
- package/configurator/_app/immutable/chunks/C9x8pbMb.js +1 -0
- package/configurator/_app/immutable/chunks/CNhGYG1q.js +0 -0
- package/configurator/_app/immutable/chunks/CaZV0epm.js +1 -0
- package/configurator/_app/immutable/chunks/D1hYfEew.js +1 -0
- package/configurator/_app/immutable/chunks/DEv5Ueqk.js +324 -0
- package/configurator/_app/immutable/chunks/DUJlwB59.js +15 -0
- package/configurator/_app/immutable/chunks/DZRiPmqv.js +1 -0
- package/configurator/_app/immutable/chunks/DgwBOIN4.js +1 -0
- package/configurator/_app/immutable/chunks/LefYBeig.js +1 -0
- package/configurator/_app/immutable/chunks/cW2jcUnz.js +1 -0
- package/configurator/_app/immutable/chunks/d60TgpyX.js +143 -0
- package/configurator/_app/immutable/chunks/fdiCLIK5.js +1 -0
- package/configurator/_app/immutable/entry/app.BaP_xlDn.js +2 -0
- package/configurator/_app/immutable/entry/start.ldC4tf9d.js +1 -0
- package/configurator/_app/immutable/nodes/{0.B_XTb0XA.js → 0.BrejL_Vm.js} +3 -3
- package/configurator/_app/immutable/nodes/1.D4HRly7L.js +1 -0
- package/configurator/_app/immutable/nodes/2.D6YEON3L.js +31 -0
- package/configurator/_app/immutable/nodes/3.D8XDqzVq.js +954 -0
- package/configurator/_app/version.json +1 -1
- package/configurator/index.html +10 -11
- package/configurator/sidebar.html +10 -11
- package/index.cjs +866 -1838
- package/index.js +830 -1832
- package/package.json +36 -36
- package/configurator/_app/immutable/chunks/3EFJgnry.js +0 -1
- package/configurator/_app/immutable/chunks/6gGOJNBB.js +0 -1
- package/configurator/_app/immutable/chunks/B_3wCAsM.js +0 -1
- package/configurator/_app/immutable/chunks/Bg7q39r6.js +0 -1
- package/configurator/_app/immutable/chunks/C7VUtzlA.js +0 -1
- package/configurator/_app/immutable/chunks/CJpr6qk2.js +0 -324
- package/configurator/_app/immutable/chunks/CR5-hwU3.js +0 -1
- package/configurator/_app/immutable/chunks/CRJbnnWi.js +0 -15
- package/configurator/_app/immutable/chunks/CfJtR48A.js +0 -2
- package/configurator/_app/immutable/chunks/D-P6dqQf.js +0 -1
- package/configurator/_app/immutable/chunks/DPeXO3aA.js +0 -1
- package/configurator/_app/immutable/chunks/DorsiQA9.js +0 -113
- package/configurator/_app/immutable/chunks/DsnmJJEf.js +0 -1
- package/configurator/_app/immutable/chunks/DvaUWHif.js +0 -143
- package/configurator/_app/immutable/chunks/hrZ0qwUL.js +0 -1
- package/configurator/_app/immutable/entry/app.B_XWKku_.js +0 -2
- package/configurator/_app/immutable/entry/start.Cu60dKF7.js +0 -1
- package/configurator/_app/immutable/nodes/1.DrYuOv_f.js +0 -1
- package/configurator/_app/immutable/nodes/2.KIpK6Gup.js +0 -31
- package/configurator/_app/immutable/nodes/3.DLNSyQFh.js +0 -954
|
@@ -1,6 +1,6 @@
|
|
|
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(),Ia="http://www.w3.org/1999/xhtml",za="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,Ie=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 Id(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function zd(){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&Ie)!==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,Ie),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,Ie),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&Ie)===0&&Ka(o,t,n)&&(ce(o,Ie),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&Ie)!==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,Ie),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;zt(this.#n),at(this.#n),Br(this.#n.ctx);try{return t()}catch(i){return Ha(i),null}finally{zt(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){zd();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){zt(e),at(t),Br(r),i&&n?.activate()}}function eo(e=!0){zt(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|Ie,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;zt(qd(e));try{e.f&=~xr,Ud(e),t=zs(e)}finally{zt(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?It(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&Ie)!==0&&oi(o),ni(o)}e.wv=Rs(),ls(e,Ie),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&Ie)===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 It(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=zr,a=s=>{if(zr===i)return s();var l=B,c=zr;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=It(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?It(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,It(c)),r.set(l,h));else{f=h.v!==me;var b=a(()=>It(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??Ia,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),zt(null);try{return e()}finally{at(t),zt(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|Ie|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,Ie),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 zt(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,Ir=0,zr=Ir;function Cs(e){zr=e}function Rs(){return++As}function bn(e){var t=e.f;if((t&Ie)!==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 Is(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?Is(i,t,!1):t===i&&(r?ce(i,Ie):(i.f&we)!==0&&ce(i,pt),vt(i))}}function zs(e){var t=Ge,r=Xe,n=lt,o=B,i=st,a=qe,s=wt,l=zr,c=e.f;Ge=null,Xe=0,lt=null,B=(c&(ft|or))===0?e:null,st=null,Br(e.ctx),wt=!1,zr=++Ir,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|Ie))===0)for(g=0;g<lt.length;g++)Is(lt[g],e);if(o!==null&&o!==e){if(Ir++,o.deps!==null)for(let b=0;b<r;b+=1)o.deps[b].rv=Ir;if(t!==null)for(const b of t)b.rv=Ir;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,zr=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=zs(e);e.teardown=typeof o=="function"?o:null,e.wv=As;var i;Yo&&Od&&(e.f&Ie)!==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<Ir&&(e.rv=Ir,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),zt(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),zt(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(
|
|
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 Id();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=zh(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===Ia}}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?It(_):_;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:`
|
|
1
|
+
var LiipGPTButton=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},l=(e,r,i)=>(i=e==null?{}:t(a(e)),c(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e));typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var u={},d=Symbol(),f=`http://www.w3.org/1999/xhtml`,p=`http://www.w3.org/2000/svg`,m=`http://www.w3.org/1998/Math/MathML`,h=Array.isArray,g=Array.prototype.indexOf,_=Array.prototype.includes,ee=Array.from,v=Object.keys,y=Object.defineProperty,b=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyDescriptors,te=Object.prototype,ne=Array.prototype,re=Object.getPrototypeOf,ie=Object.isExtensible;function ae(e){return typeof e==`function`}var oe=()=>{};function se(e){return typeof e?.then==`function`}function ce(e){for(var t=0;t<e.length;t++)e[t]()}function le(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var ue=1<<24,de=1024,fe=2048,pe=4096,me=8192,he=16384,ge=32768,_e=1<<25,ve=65536,S=1<<18,ye=1<<19,be=1<<20,xe=1<<25,Se=65536,Ce=1<<21,we=1<<22,Te=1<<23,Ee=Symbol(`$state`),De=Symbol(`legacy props`),Oe=Symbol(``),ke=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Ae=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function je(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function Me(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Ne(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Pe(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Fe(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Ie(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Le(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Re(){throw Error(`https://svelte.dev/e/hydration_failed`)}function ze(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Be(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Ve(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function He(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Ue(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}function We(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Ge(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function Ke(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var C=!1;function w(e){C=e}var T;function E(e){if(e===null)throw We(),u;return T=e}function qe(){return E(Dn(T))}function Je(e){if(C){if(Dn(T)!==null)throw We(),u;T=e}}function Ye(e=1){if(C){for(var t=e,n=T;t--;)n=Dn(n);T=n}}function Xe(e=!0){for(var t=0,n=T;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Dn(n);e&&n.remove(),n=i}}function Ze(e){if(!e||e.nodeType!==8)throw We(),u;return e.data}function Qe(e){return e===this.v}function $e(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function et(e){return!$e(e,this.v)}var tt=!1,nt=!1,rt=[];function it(e,t=!1,n=!1){return at(e,new Map,``,rt,null,n)}function at(e,t,n,r,i=null,a=!1){if(typeof e==`object`&&e){var o=t.get(e);if(o!==void 0)return o;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(h(e)){var s=Array(e.length);t.set(e,s),i!==null&&t.set(i,s);for(var c=0;c<e.length;c+=1){var l=e[c];c in e&&(s[c]=at(l,t,n,r,null,a))}return s}if(re(e)===te){s={},t.set(e,s),i!==null&&t.set(i,s);for(var u of Object.keys(e))s[u]=at(e[u],t,n,r,null,a);return s}if(e instanceof Date)return structuredClone(e);if(typeof e.toJSON==`function`&&!a)return at(e.toJSON(),t,n,r,e)}if(e instanceof EventTarget)return e;try{return structuredClone(e)}catch{return e}}var D=null;function ot(e){D=e}function st(e,t=!1,n){D={p:D,i:!1,c:null,e:null,s:e,x:null,r:P,l:nt&&!t?{s:null,u:null,$:[]}:null}}function ct(e){var t=D,n=t.e;if(n!==null){t.e=null;for(var r of n)Gn(r)}return e!==void 0&&(t.x=e),t.i=!0,D=t.p,e??{}}function lt(){return!nt||D!==null&&D.l===null}var ut=[];function dt(){var e=ut;ut=[],ce(e)}function ft(e){if(ut.length===0&&!kt){var t=ut;queueMicrotask(()=>{t===ut&&dt()})}ut.push(e)}function pt(){for(;ut.length>0;)dt()}function mt(e){var t=P;if(t===null)return N.f|=Te,e;if(!(t.f&32768)&&!(t.f&4))throw e;ht(e,t)}function ht(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var gt=~(fe|pe|de);function _t(e,t){e.f=e.f>|t}function vt(e){e.f&512||e.deps===null?_t(e,de):_t(e,pe)}function yt(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=Se,yt(t.deps))}function bt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),yt(e.deps),_t(e,de)}var xt=[];function St(e,t=oe){let n=null,r=new Set;function i(t){if($e(e,t)&&(e=t,n)){let t=!xt.length;for(let t of r)t[1](),xt.push(t,e);if(t){for(let e=0;e<xt.length;e+=2)xt[e][0](xt[e+1]);xt.length=0}}}function a(t){i(t(e))}function o(o,s=oe){let c=[o,s];return r.add(c),r.size===1&&(n=t(i,a)||oe),o(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:i,update:a,subscribe:o}}var Ct=!1,wt=!1;function Tt(e){var t=wt;try{return wt=!1,[e(),wt]}finally{wt=t}}var Et=new Set,O=null,Dt=null,Ot=null,kt=!1,At=!1,jt=null,Mt=null,Nt=0,Pt=1,Ft=class e{id=Pt++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=0;#r=0;#i=null;#a=[];#o=new Set;#s=new Set;#c=new Map;is_fork=!1;#l=!1;#u(){return this.is_fork||this.#r>0}skip_effect(e){this.#c.has(e)||this.#c.set(e,{d:[],m:[]})}unskip_effect(e){var t=this.#c.get(e);if(t){this.#c.delete(e);for(var n of t.d)_t(n,fe),this.schedule(n);for(n of t.m)_t(n,pe),this.schedule(n)}}#d(){if(Nt++>1e3&&(Et.delete(this),It()),!this.#u()){for(let e of this.#o)this.#s.delete(e),_t(e,fe),this.schedule(e);for(let e of this.#s)_t(e,pe),this.schedule(e)}let t=this.#a;this.#a=[],this.apply();var n=jt=[],r=[],i=Mt=[];for(let e of t)try{this.#f(e,n,r)}catch(t){throw Ut(e),t}if(O=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(jt=null,Mt=null,this.#u()){this.#p(r),this.#p(n);for(let[e,t]of this.#c)Ht(e,t)}else{this.#n===0&&Et.delete(this),this.#o.clear(),this.#s.clear();for(let e of this.#e)e(this);this.#e.clear(),Rt(r),Rt(n),this.#i?.resolve()}var o=O;if(this.#a.length>0){let e=o??=this;e.#a.push(...this.#a.filter(t=>!e.#a.includes(t)))}o!==null&&(Et.add(o),o.#d()),Et.has(this)||this.#m()}#f(e,t,n){e.f^=de;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#c.has(r))&&r.fn!==null){a?r.f^=de:i&4?t.push(r):tt&&i&16777224?n.push(r):Ar(r)&&(i&16&&this.#s.add(r),Fr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#p(e){for(var t=0;t<e.length;t+=1)bt(e[t],this.#o,this.#s)}capture(e,t){t!==d&&!this.previous.has(e)&&this.previous.set(e,t),e.f&8388608||(this.current.set(e,e.v),Dt?.set(e,e.v))}activate(){O=this}deactivate(){O=null,Dt=null}flush(){try{At=!0,O=this,this.#d()}finally{Nt=0,Ot=null,jt=null,Mt=null,At=!1,O=null,Dt=null,ln.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear(),Et.delete(this)}#m(){for(let s of Et){var e=s.id<this.id,t=[];for(let[n,r]of this.current){if(s.current.has(n))if(e&&r!==s.current.get(n))s.current.set(n,r);else continue;t.push(n)}var n=[...s.current.keys()].filter(e=>!this.current.has(e));if(n.length===0)e&&s.discard();else if(t.length>0){s.activate();var r=new Set,i=new Map;for(var a of t)zt(a,n,r,i);if(s.#a.length>0){s.apply();for(var o of s.#a)s.#f(o,[],[]);s.#a=[]}s.deactivate()}}}increment(e){this.#n+=1,e&&(this.#r+=1)}decrement(e,t){--this.#n,e&&--this.#r,!(this.#l||t)&&(this.#l=!0,ft(()=>{this.#l=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#o.add(t);for(let e of t)this.#s.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=le()).promise}static ensure(){if(O===null){let t=O=new e;At||(Et.add(O),kt||ft(()=>{O===t&&t.flush()}))}return O}apply(){if(!tt||!this.is_fork&&Et.size===1){Dt=null;return}Dt=new Map(this.current);for(let e of Et)if(!(e===this||e.is_fork))for(let[t,n]of e.previous)Dt.has(t)||Dt.set(t,n)}schedule(e){if(Ot=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(jt!==null&&t===P&&(tt||(N===null||!(N.f&2))&&!Ct))return;if(n&96){if(!(n&1024))return;t.f^=de}}this.#a.push(t)}};function k(e){var t=kt;kt=!0;try{var n;for(e&&(O!==null&&!O.is_fork&&O.flush(),n=e());;){if(pt(),O===null)return n;O.flush()}}finally{kt=t}}function It(){try{Le()}catch(e){ht(e,Ot)}}var Lt=null;function Rt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Ar(r)&&(Lt=new Set,Fr(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&or(r),Lt?.size>0)){ln.clear();for(let e of Lt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Lt.has(n)&&(Lt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Fr(n)}}Lt.clear()}}Lt=null}}function zt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?zt(i,t,n,r):e&4194320&&!(e&2048)&&Bt(i,t,r)&&(_t(i,fe),Vt(i))}}function Bt(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(_.call(t,r))return!0;if(r.f&2&&Bt(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function Vt(e){O.schedule(e)}function Ht(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),_t(e,de);for(var n=e.first;n!==null;)Ht(n,t),n=n.next}}function Ut(e){_t(e,de);for(var t=e.first;t!==null;)Ut(t),t=t.next}function Wt(e){let t=0,n=dn(0),r;return()=>{Hn()&&(F(n),Xn(()=>(t===0&&(r=zr(()=>e(()=>hn(n)))),t+=1,()=>{ft(()=>{--t,t===0&&(r?.(),r=void 0,hn(n))})})))}}var Gt=ve|ye;function Kt(e,t,n,r){new qt(e,t,n,r)}var qt=class{parent;is_pending=!1;transform_error;#e;#t=C?T:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Wt(()=>(this.#m=dn(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=P;t.b=this,t.f|=128,n(e)},this.parent=P.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=Qn(()=>{if(C){let e=this.#t;qe();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},Gt),C&&(this.#e=T)}#g(){try{this.#a=er(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=er(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=er(()=>e(this.#e)),ft(()=>{var e=this.#c=document.createDocumentFragment(),t=Tn();e.append(t),this.#a=this.#x(()=>er(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,sr(this.#o,()=>{this.#o=null}),this.#b(O))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=er(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();dr(this.#a,e);let t=this.#n.pending;this.#o=er(()=>t(this.#e))}else this.#b(O)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){bt(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=P,n=N,r=D;vr(this.#i),_r(this.#i),ot(this.#i.ctx);try{return Ft.ensure(),e()}catch(e){return mt(e),null}finally{vr(t),_r(n),ot(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&sr(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,ft(()=>{this.#d=!1,this.#m&&pn(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),F(this.#m)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(!t&&!n)throw e;this.#a&&=(ir(this.#a),null),this.#o&&=(ir(this.#o),null),this.#s&&=(ir(this.#s),null),C&&(E(this.#t),Ye(),E(Xe()));var r=!1,i=!1;let a=()=>{if(r){Ke();return}r=!0,i&&Ue(),this.#s!==null&&sr(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){ht(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return er(()=>{var t=P;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return ht(e,this.#i.parent),null}}))};ft(()=>{var t;try{t=this.transform_error(e)}catch(e){ht(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>ht(e,this.#i&&this.#i.parent)):o(t)})}};function Jt(e,t,n,r){let i=lt()?Qt:en;var a=e.filter(e=>!e.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=P,s=Yt(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function l(e){s();try{r(e)}catch(e){o.f&16384||ht(e,o)}Xt()}if(n.length===0){c.then(()=>l(t.map(i)));return}var u=Zt();function d(){Promise.all(n.map(e=>$t(e))).then(e=>l([...t.map(i),...e])).catch(e=>ht(e,o)).finally(()=>u())}c?c.then(()=>{s(),d(),Xt()}):d()}function Yt(){var e=P,t=N,n=D,r=O;return function(i=!0){vr(e),_r(t),ot(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Xt(e=!0){vr(null),_r(null),ot(null),e&&O?.deactivate()}function Zt(){var e=P.b,t=O,n=e.is_rendered();return e.update_pending_count(1,t),t.increment(n),(r=!1)=>{e.update_pending_count(-1,t),t.decrement(n,r)}}function Qt(e){var t=2|fe,n=N!==null&&N.f&2?N:null;return P!==null&&(P.f|=ye),{ctx:D,deps:null,effects:null,equals:Qe,f:t,fn:e,reactions:null,rv:0,v:d,wv:0,parent:n??P,ac:null}}function $t(e,t,n){let r=P;r===null&&Me();var i=void 0,a=dn(d),o=!N,s=new Map;return Yn(()=>{var t=P,n=le();i=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(Xt)}catch(e){n.reject(e),Xt()}var c=O;if(o){if(t.f&32768)var l=Zt();if(r.b.is_rendered())s.get(c)?.reject(ke),s.delete(c);else{for(let e of s.values())e.reject(ke);s.clear()}s.set(c,n)}let u=(e,n=void 0)=>{if(l&&l(n===ke),!(n===ke||t.f&16384)){if(c.activate(),n)a.f|=Te,pn(a,n);else{a.f&8388608&&(a.f^=Te),pn(a,e);for(let[e,t]of s){if(s.delete(e),e===c)break;t.reject(ke)}}c.deactivate()}};n.promise.then(u,e=>u(null,e||`unknown`))}),Un(()=>{for(let e of s.values())e.reject(ke)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function A(e){let t=Qt(e);return tt||br(t),t}function en(e){let t=Qt(e);return t.equals=et,t}function tn(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)ir(t[n])}}function nn(e){for(var t=e.parent;t!==null;){if(!(t.f&2))return t.f&16384?null:t;t=t.parent}return null}function rn(e){var t,n=P;vr(nn(e));try{e.f&=~Se,tn(e),t=Mr(e)}finally{vr(n)}return t}function an(e){var t=e.v,n=rn(e);if(!e.equals(n)&&(e.wv=kr(),(!O?.is_fork||e.deps===null)&&(e.v=n,O?.capture(e,t),e.deps===null))){_t(e,de);return}mr||(Dt===null?vt(e):(Hn()||O?.is_fork)&&Dt.set(e,n))}function on(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(ke),t.teardown=oe,t.ac=null,Pr(t,0),nr(t))}function sn(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&Fr(t)}var cn=new Set,ln=new Map,un=!1;function dn(e,t){return{f:0,v:e,reactions:null,equals:Qe,rv:0,wv:0}}function j(e,t){let n=dn(e,t);return br(n),n}function fn(e,t=!1,n=!0){let r=dn(e);return t||(r.equals=et),nt&&n&&D!==null&&D.l!==null&&(D.l.s??=[]).push(r),r}function M(e,t,n=!1){return N!==null&&(!gr||N.f&131072)&<()&&N.f&4325394&&(yr===null||!_.call(yr,e))&&He(),pn(e,n?_n(t):t,Mt)}function pn(e,t,n=null){if(!e.equals(t)){var r=e.v;mr?ln.set(e,t):ln.set(e,r),e.v=t;var i=Ft.ensure();if(i.capture(e,r),e.f&2){let t=e;e.f&2048&&rn(t),Dt===null&&vt(t)}e.wv=kr(),gn(e,fe,n),lt()&&P!==null&&P.f&1024&&!(P.f&96)&&(Cr===null?wr([e]):Cr.push(e)),!i.is_fork&&cn.size>0&&!un&&mn()}return t}function mn(){un=!1;for(let e of cn)e.f&1024&&_t(e,pe),Ar(e)&&Fr(e);cn.clear()}function hn(e){M(e,e.v+1)}function gn(e,t,n){var r=e.reactions;if(r!==null)for(var i=lt(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===P)){var l=(c&fe)===0;if(l&&_t(s,t),c&2){var u=s;Dt?.delete(u),c&65536||(c&512&&(s.f|=Se),gn(u,pe,n))}else if(l){var d=s;c&16&&Lt!==null&&Lt.add(d),n===null?Vt(d):n.push(d)}}}}function _n(e){if(typeof e!=`object`||!e||Ee in e)return e;let t=re(e);if(t!==te&&t!==ne)return e;var n=new Map,r=h(e),i=j(0),a=null,o=Dr,s=e=>{if(Dr===o)return e();var t=N,n=Dr;_r(null),Or(o);var r=e();return _r(t),Or(n),r};return r&&n.set(`length`,j(e.length,a)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&Be();var i=n.get(t);return i===void 0?s(()=>{var e=j(r.value,a);return n.set(t,e),e}):M(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>j(d,a));n.set(t,e),hn(i)}}else M(r,d),hn(i);return!0},get(t,r,i){if(r===Ee)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||b(t,r)?.writable)&&(o=s(()=>j(_n(c?t[r]:d),a)),n.set(r,o)),o!==void 0){var l=F(o);return l===d?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var i=n.get(t);i&&(r.value=F(i))}else if(r===void 0){var a=n.get(t),o=a?.v;if(a!==void 0&&o!==d)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,t){if(t===Ee)return!0;var r=n.get(t),i=r!==void 0&&r.v!==d||Reflect.has(e,t);return(r!==void 0||P!==null&&(!i||b(e,t)?.writable))&&(r===void 0&&(r=s(()=>j(i?_n(e[t]):d,a)),n.set(t,r)),F(r)===d)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var f=o;f<l.v;f+=1){var p=n.get(f+``);p===void 0?f in e&&(p=s(()=>j(d,a)),n.set(f+``,p)):M(p,d)}if(l===void 0)(!u||b(e,t)?.writable)&&(l=s(()=>j(void 0,a)),M(l,_n(o)),n.set(t,l));else{u=l.v!==d;var m=s(()=>_n(o));M(l,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(c,o),!u){if(r&&typeof t==`string`){var g=n.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&M(g,_+1)}hn(i)}return!0},ownKeys(e){F(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==d});for(var[r,a]of n)a.v!==d&&!(r in e)&&t.push(r);return t},setPrototypeOf(){Ve()}})}function vn(e){try{if(typeof e==`object`&&e&&Ee in e)return e[Ee]}catch{}return e}function yn(e,t){return Object.is(vn(e),vn(t))}var bn,xn,Sn,Cn;function wn(){if(bn===void 0){bn=window,xn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Sn=b(t,`firstChild`).get,Cn=b(t,`nextSibling`).get,ie(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),ie(n)&&(n.__t=void 0)}}function Tn(e=``){return document.createTextNode(e)}function En(e){return Sn.call(e)}function Dn(e){return Cn.call(e)}function On(e,t){if(!C)return En(e);var n=En(T);if(n===null)n=T.appendChild(Tn());else if(t&&n.nodeType!==3){var r=Tn();return n?.before(r),E(r),r}return t&&Pn(n),E(n),n}function kn(e,t=!1){if(!C){var n=En(e);return n instanceof Comment&&n.data===``?Dn(n):n}if(t){if(T?.nodeType!==3){var r=Tn();return T?.before(r),E(r),r}Pn(T)}return T}function An(e,t=1,n=!1){let r=C?T:e;for(var i;t--;)i=r,r=Dn(r);if(!C)return r;if(n){if(r?.nodeType!==3){var a=Tn();return r===null?i?.after(a):r.before(a),E(a),a}Pn(r)}return E(r),r}function jn(e){e.textContent=``}function Mn(){return!tt||Lt!==null?!1:(P.f&ge)!==0}function Nn(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function Pn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Fn(e,t){if(t){let t=document.body;e.autofocus=!0,ft(()=>{document.activeElement===t&&e.focus()})}}var In=!1;function Ln(){In||(In=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Rn(e){var t=N,n=P;_r(null),vr(null);try{return e()}finally{_r(t),vr(n)}}function zn(e){P===null&&(N===null&&Ie(e),Fe()),mr&&Pe(e)}function Bn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Vn(e,t){var n=P;n!==null&&n.f&8192&&(e|=me);var r={ctx:D,deps:null,nodes:null,f:e|fe|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},i=r;if(e&4)jt===null?Ft.ensure().schedule(r):jt.push(r);else if(t!==null){try{Fr(r)}catch(e){throw ir(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ve))}if(i!==null&&(i.parent=n,n!==null&&Bn(i,n),N!==null&&N.f&2&&!(e&64))){var a=N;(a.effects??=[]).push(i)}return r}function Hn(){return N!==null&&!gr}function Un(e){let t=Vn(8,null);return _t(t,de),t.teardown=e,t}function Wn(e){zn(`$effect`);var t=P.f;if(!N&&t&32&&!(t&32768)){var n=D;(n.e??=[]).push(e)}else return Gn(e)}function Gn(e){return Vn(4|be,e)}function Kn(e){Ft.ensure();let t=Vn(64|ye,e);return()=>{ir(t)}}function qn(e){Ft.ensure();let t=Vn(64|ye,e);return(e={})=>new Promise(n=>{e.outro?sr(t,()=>{ir(t),n(void 0)}):(ir(t),n(void 0))})}function Jn(e){return Vn(4,e)}function Yn(e){return Vn(we|ye,e)}function Xn(e,t=0){return Vn(8|t,e)}function Zn(e,t=[],n=[],r=[]){Jt(r,t,n,t=>{Vn(8,()=>e(...t.map(F)))})}function Qn(e,t=0){return Vn(16|t,e)}function $n(e,t=0){return Vn(ue|t,e)}function er(e){return Vn(32|ye,e)}function tr(e){var t=e.teardown;if(t!==null){let e=mr,n=N;hr(!0),_r(null);try{t.call(null)}finally{hr(e),_r(n)}}}function nr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&Rn(()=>{e.abort(ke)});var r=n.next;n.f&64?n.parent=null:ir(n,t),n=r}}function rr(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||ir(t),t=n}}function ir(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(ar(e.nodes.start,e.nodes.end),n=!0),_t(e,_e),nr(e,t&&!n),Pr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();tr(e),e.f^=_e,e.f|=he;var i=e.parent;i!==null&&i.first!==null&&or(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function ar(e,t){for(;e!==null;){var n=e===t?null:Dn(e);e.remove(),e=n}}function or(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function sr(e,t,n=!0){var r=[];cr(e,r,!0);var i=()=>{n&&ir(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function cr(e,t,n){if(!(e.f&8192)){e.f^=me;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;cr(i,t,o?n:!1),i=a}}}function lr(e){ur(e,!0)}function ur(e,t){if(e.f&8192){e.f^=me,e.f&1024||(_t(e,fe),Ft.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;ur(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function dr(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Dn(n);t.append(n),n=i}}var fr=null,pr=!1,mr=!1;function hr(e){mr=e}var N=null,gr=!1;function _r(e){N=e}var P=null;function vr(e){P=e}var yr=null;function br(e){N!==null&&(!tt||N.f&2)&&(yr===null?yr=[e]:yr.push(e))}var xr=null,Sr=0,Cr=null;function wr(e){Cr=e}var Tr=1,Er=0,Dr=Er;function Or(e){Dr=e}function kr(){return++Tr}function Ar(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~Se),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Ar(a)&&an(a),a.wv>e.wv)return!0}t&512&&Dt===null&&_t(e,de)}return!1}function jr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!tt&&yr!==null&&_.call(yr,e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?jr(a,t,!1):t===a&&(n?_t(a,fe):a.f&1024&&_t(a,pe),Vt(a))}}function Mr(e){var t=xr,n=Sr,r=Cr,i=N,a=yr,o=D,s=gr,c=Dr,l=e.f;xr=null,Sr=0,Cr=null,N=l&96?null:e,yr=null,ot(e.ctx),gr=!1,Dr=++Er,e.ac!==null&&(Rn(()=>{e.ac.abort(ke)}),e.ac=null);try{e.f|=Ce;var u=e.fn,d=u();e.f|=ge;var f=e.deps,p=O?.is_fork;if(xr!==null){var m;if(p||Pr(e,Sr),f!==null&&Sr>0)for(f.length=Sr+xr.length,m=0;m<xr.length;m++)f[Sr+m]=xr[m];else e.deps=f=xr;if(Hn()&&e.f&512)for(m=Sr;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&Sr<f.length&&(Pr(e,Sr),f.length=Sr);if(lt()&&Cr!==null&&!gr&&f!==null&&!(e.f&6146))for(m=0;m<Cr.length;m++)jr(Cr[m],e);if(i!==null&&i!==e){if(Er++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Er;if(t!==null)for(let e of t)e.rv=Er;Cr!==null&&(r===null?r=Cr:r.push(...Cr))}return e.f&8388608&&(e.f^=Te),d}catch(e){return mt(e)}finally{e.f^=Ce,xr=t,Sr=n,Cr=r,N=i,yr=a,ot(o),gr=s,Dr=c}}function Nr(e,t){let n=t.reactions;if(n!==null){var r=g.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(xr===null||!_.call(xr,t))){var a=t;a.f&512&&(a.f^=512,a.f&=~Se),vt(a),on(a),Pr(a,0)}}function Pr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Nr(e,n[r])}function Fr(e){var t=e.f;if(!(t&16384)){_t(e,de);var n=P,r=pr;P=e,pr=!0;try{t&16777232?rr(e):nr(e),tr(e);var i=Mr(e);e.teardown=typeof i==`function`?i:null,e.wv=Tr}finally{pr=r,P=n}}}async function Ir(){if(tt)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),k()}function F(e){var t=(e.f&2)!=0;if(fr?.add(e),N!==null&&!gr&&!(P!==null&&P.f&16384)&&(yr===null||!_.call(yr,e))){var n=N.deps;if(N.f&2097152)e.rv<Er&&(e.rv=Er,xr===null&&n!==null&&n[Sr]===e?Sr++:xr===null?xr=[e]:xr.push(e));else{(N.deps??=[]).push(e);var r=e.reactions;r===null?e.reactions=[N]:_.call(r,N)||r.push(N)}}if(mr&&ln.has(e))return ln.get(e);if(t){var i=e;if(mr){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||Rr(i))&&(a=rn(i)),ln.set(i,a),a}var o=(i.f&512)==0&&!gr&&N!==null&&(pr||(N.f&512)!=0),s=(i.f&ge)===0;Ar(i)&&(o&&(i.f|=512),an(i)),o&&!s&&(sn(i),Lr(i))}if(Dt?.has(e))return Dt.get(e);if(e.f&8388608)throw e.v;return e.v}function Lr(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(sn(t),Lr(t))}function Rr(e){if(e.v===d)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(ln.has(t)||t.f&2&&Rr(t))return!0;return!1}function zr(e){var t=gr;try{return gr=!0,e()}finally{gr=t}}function Br(e){if(!(typeof e!=`object`||!e||e instanceof EventTarget)){if(Ee in e)Vr(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n==`object`&&n&&Ee in n&&Vr(n)}}}function Vr(e,t=new Set){if(typeof e==`object`&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{Vr(e[n],t)}catch{}let n=re(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let t=x(n);for(let n in t){let r=t[n].get;if(r)try{r.call(e)}catch{}}}}}var Hr=Symbol(`events`),Ur=new Set,Wr=new Set;function Gr(e,t,n,r={}){function i(e){if(r.capture||Xr.call(t,e),!e.cancelBubble)return Rn(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?ft(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Kr(e,t,n,r,i){var a={capture:r,passive:i},o=Gr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Un(()=>{t.removeEventListener(e,o,a)})}function qr(e,t,n){(t[Hr]??={})[e]=n}function Jr(e){for(var t=0;t<e.length;t++)Ur.add(e[t]);for(var n of Wr)n(e)}var Yr=null;function Xr(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;Yr=e;var o=0,s=Yr===e&&e[Hr];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[Hr]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){y(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=N,d=P;_r(null),vr(null);try{for(var f,p=[];a!==null;){var m=a.assignedSlot||a.parentNode||a.host||null;try{var h=a[Hr]?.[r];h!=null&&(!a.disabled||e.target===a)&&h.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble||m===t||m===null)break;a=m}if(f){for(let e of p)queueMicrotask(()=>{throw e});throw f}}finally{e[Hr]=t,delete e.currentTarget,_r(u),vr(d)}}}var Zr=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Qr(e){return Zr?.createHTML(e)??e}function $r(e){var t=Nn(`template`);return t.innerHTML=Qr(e.replaceAll(`<!>`,`<!---->`)),t.content}function ei(e,t){var n=P;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function ti(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(C)return ei(T,null),T;i===void 0&&(i=$r(a?e:`<!>`+e),n||(i=En(i)));var t=r||xn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=En(t),s=t.lastChild;ei(o,s)}else ei(t,t);return t}}function ni(){if(C)return ei(T,null),T;var e=document.createDocumentFragment(),t=document.createComment(``),n=Tn();return e.append(t,n),ei(t,n),e}function I(e,t){if(C){var n=P;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=T),qe();return}e!==null&&e.before(t)}function ri(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var ii=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function ai(e){return ii.includes(e)}var oi=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),si={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 ci(e){return e=e.toLowerCase(),si[e]??e}[...oi];var li=[`touchstart`,`touchmove`];function ui(e){return li.includes(e)}var di=[`textarea`,`script`,`style`,`title`];function fi(e){return di.includes(e)}function pi(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function mi(e,t){return _i(e,t)}function hi(e,t){wn(),t.intro=t.intro??!1;let n=t.target,r=C,i=T;try{for(var a=En(n);a&&(a.nodeType!==8||a.data!==`[`);)a=Dn(a);if(!a)throw u;w(!0),E(a);let r=_i(e,{...t,anchor:a});return w(!1),r}catch(r){if(r instanceof Error&&r.message.split(`
|
|
2
|
+
`).some(e=>e.startsWith(`https://svelte.dev/e/`)))throw r;return r!==u&&console.warn(`Failed to hydrate: `,r),t.recover===!1&&Re(),wn(),jn(n),w(!1),mi(e,t)}finally{w(r),E(i)}}var gi=new Map;function _i(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){wn();var c=void 0,l=qn(()=>{var o=n??t.appendChild(Tn());Kt(o,{pending:()=>{}},t=>{st({});var n=D;if(a&&(n.c=a),i&&(r.$$events=i),C&&ei(t,null),c=e(t,r)||{},C&&(P.nodes.end=T,T===null||T.nodeType!==8||T.data!==`]`))throw We(),u;ct()},s);var l=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!l.has(r)){l.add(r);var i=ui(r);for(let e of[t,document]){var a=gi.get(e);a===void 0&&(a=new Map,gi.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Xr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(ee(Ur)),Wr.add(d),()=>{for(var e of l)for(let n of[t,document]){var r=gi.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Xr),r.delete(e),r.size===0&&gi.delete(n)):r.set(e,i)}Wr.delete(d),o!==n&&o.parentNode?.removeChild(o)}});return vi.set(c,l),c}var vi=new WeakMap;function yi(e,t){let n=vi.get(e);return n?(vi.delete(e),n(t)):Promise.resolve()}var bi=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)lr(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(ir(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();dr(r,t),t.append(Tn()),this.#n.set(e,{effect:r,fragment:t})}else ir(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),sr(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(ir(n.effect),this.#n.delete(e))};ensure(e,t){var n=O,r=Mn();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=Tn();i.append(a),this.#n.set(e,{effect:er(()=>t(a)),fragment:i})}else this.#t.set(e,er(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else C&&(this.anchor=T),this.#a(n)}};function xi(e,t,...n){var r=new bi(e);Qn(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},ve)}function Si(e){D===null&&je(`onMount`),nt&&D.l!==null?wi(D).m.push(e):Wn(()=>{let t=zr(e);if(typeof t==`function`)return t})}function Ci(e){D===null&&je(`onDestroy`),Si(()=>()=>zr(e))}function wi(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}var Ti=0,Ei=1,Di=2;function Oi(e,t,n,r,i){C&&qe();var a=lt(),o=d,s=a?dn(o):fn(o,!1,!1),c=a?dn(o):fn(o,!1,!1),l=new bi(e);Qn(()=>{var a=O;a.deactivate();var o=t();a.activate();var u=!1;let d=C&&se(o)===(e.data===`[!`);if(d&&(E(Xe()),w(!1)),se(o)){var f=Yt(),p=!1;let e=e=>{if(!u){p=!0,f(!1),Ft.ensure(),C&&w(!1);try{e()}finally{Xt(!1),kt||k()}}};o.then(t=>{e(()=>{pn(s,t),l.ensure(Ei,r&&(e=>r(e,s)))})},t=>{e(()=>{if(pn(c,t),l.ensure(Di,i&&(e=>i(e,c))),!i)throw c.v})}),C?l.ensure(Ti,n):ft(()=>{p||e(()=>{l.ensure(Ti,n)})})}else pn(s,o),l.ensure(Ei,r&&(e=>r(e,s)));return d&&w(!0),()=>{u=!0}})}function ki(e,t,n=!1){var r;C&&(r=T,qe());var i=new bi(e),a=n?ve:0;function o(e,t){if(C){var n=Ze(r);if(e!==parseInt(n.substring(1))){var a=Xe();E(a),i.anchor=a,w(!1),i.ensure(e,t),w(!0);return}}i.ensure(e,t)}Qn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Ai(e,t){return t}function ji(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];sr(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Mi(e,ee(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else --o},!1)}if(o===0){var c=r.length===0&&n!==null;if(c){var l=n,u=l.parentNode;jn(u),u.append(l),e.items.clear()}Mi(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Mi(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=xe,dr(a,document.createDocumentFragment())):ir(t[i],n)}}var Ni;function Pi(e,t,n,r,i,a=null){var o=e,s=new Map;if(t&4){var c=e;o=C?E(En(c)):c.appendChild(Tn())}C&&qe();var l=null,u=en(()=>{var e=n();return h(e)?e:e==null?[]:ee(e)}),d,f=new Map,p=!0;function m(e){_.effect.f&16384||(_.pending.delete(e),_.fallback=l,Ii(_,d,o,t,r),l!==null&&(d.length===0?l.f&33554432?(l.f^=xe,Ri(l,null,o)):lr(l):sr(l,()=>{l=null})))}function g(e){_.pending.delete(e)}var _={effect:Qn(()=>{d=F(u);var e=d.length;let c=!1;C&&Ze(o)===`[!`!=(e===0)&&(o=Xe(),E(o),w(!1),c=!0);for(var h=new Set,_=O,ee=Mn(),v=0;v<e;v+=1){C&&T.nodeType===8&&T.data===`]`&&(o=T,c=!0,w(!1));var y=d[v],b=r(y,v),x=p?null:s.get(b);x?(x.v&&pn(x.v,y),x.i&&pn(x.i,v),ee&&_.unskip_effect(x.e)):(x=Li(s,p?o:Ni??=Tn(),y,b,v,i,t,n),p||(x.e.f|=xe),s.set(b,x)),h.add(b)}if(e===0&&a&&!l&&(p?l=er(()=>a(o)):(l=er(()=>a(Ni??=Tn())),l.f|=xe)),e>h.size&&Ne(``,``,``),C&&e>0&&E(Xe()),!p)if(f.set(_,h),ee){for(let[e,t]of s)h.has(e)||_.skip_effect(t.e);_.oncommit(m),_.ondiscard(g)}else m(_);c&&w(!0),F(u)}),flags:t,items:s,pending:f,outrogroups:null,fallback:l};p=!1,C&&(o=T)}function Fi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Ii(e,t,n,r,i){var a=(r&8)!=0,o=t.length,s=e.items,c=Fi(e.effect.first),l,u=null,d,f=[],p=[],m,h,g,_;if(a)for(_=0;_<o;_+=1)m=t[_],h=i(m,_),g=s.get(h).e,g.f&33554432||(g.nodes?.a?.measure(),(d??=new Set).add(g));for(_=0;_<o;_+=1){if(m=t[_],h=i(m,_),g=s.get(h).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(g),t.done.delete(g);if(g.f&8192&&(lr(g),a&&(g.nodes?.a?.unfix(),(d??=new Set).delete(g))),g.f&33554432)if(g.f^=xe,g===c)Ri(g,null,n);else{var v=u?u.next:c;g===e.effect.last&&(e.effect.last=g.prev),g.prev&&(g.prev.next=g.next),g.next&&(g.next.prev=g.prev),zi(e,u,g),zi(e,g,v),Ri(g,v,n),u=g,f=[],p=[],c=Fi(u.next);continue}if(g!==c){if(l!==void 0&&l.has(g)){if(f.length<p.length){var y=p[0],b;u=y.prev;var x=f[0],te=f[f.length-1];for(b=0;b<f.length;b+=1)Ri(f[b],y,n);for(b=0;b<p.length;b+=1)l.delete(p[b]);zi(e,x.prev,te.next),zi(e,u,x),zi(e,te,y),c=y,u=te,--_,f=[],p=[]}else l.delete(g),Ri(g,c,n),zi(e,g.prev,g.next),zi(e,g,u===null?e.effect.first:u.next),zi(e,u,g),u=g;continue}for(f=[],p=[];c!==null&&c!==g;)(l??=new Set).add(c),p.push(c),c=Fi(c.next);if(c===null)continue}g.f&33554432||f.push(g),u=g,c=Fi(g.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Mi(e,ee(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||l!==void 0){var ne=[];if(l!==void 0)for(g of l)g.f&8192||ne.push(g);for(;c!==null;)!(c.f&8192)&&c!==e.fallback&&ne.push(c),c=Fi(c.next);var re=ne.length;if(re>0){var ie=r&4&&o===0?n:null;if(a){for(_=0;_<re;_+=1)ne[_].nodes?.a?.measure();for(_=0;_<re;_+=1)ne[_].nodes?.a?.fix()}ji(e,ne,ie)}}a&&ft(()=>{if(d!==void 0)for(g of d)g.nodes?.a?.apply()})}function Li(e,t,n,r,i,a,o,s){var c=o&1?o&16?dn(n):fn(n,!1,!1):null,l=o&2?dn(i):null;return{v:c,i:l,e:er(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Ri(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=Dn(r);if(a.before(r),r===i)return;r=o}}function zi(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Bi(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;C&&(o=E(En(c)))}Zn(()=>{var e=P;if(s===(s=t()??``)){C&&qe();return}if(n&&!C){e.nodes=null,c.innerHTML=s,s!==``&&ei(En(c),c.lastChild);return}if(e.nodes!==null&&(ar(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(C){for(var a=T.data,l=qe(),d=l;l!==null&&(l.nodeType!==8||l.data!==``);)d=l,l=Dn(l);if(l===null)throw We(),u;ei(T,d),o=E(l);return}var f=Nn(r?`svg`:i?`math`:`template`,r?p:i?m:void 0);f.innerHTML=s;var h=r||i?f:f.content;if(ei(En(h),h.lastChild),r||i)for(;En(h);)o.before(En(h));else o.before(h)}})}function Vi(e,t,n,r,i,a){let o=C;C&&qe();var s=null;C&&T.nodeType===1&&(s=T,qe());var c=C?T:e,l=new bi(c,!1);Qn(()=>{let e=t()||null;var a=i?i():n||e===`svg`?p:void 0;if(e===null){l.ensure(null,null);return}return l.ensure(e,t=>{if(e){if(s=C?s:Nn(e,a),ei(s,s),r){C&&fi(e)&&s.append(document.createComment(``));var n=C?En(s):s.appendChild(Tn());C&&(n===null?w(!1):E(n)),r(s,n)}P.nodes.end=s,t.before(s)}C&&E(t)}),()=>{}},ve),Un(()=>{}),o&&(w(!0),E(c))}function Hi(e,t){let n=null,r=C;var i;if(C){n=T;for(var a=En(document.head);a!==null&&(a.nodeType!==8||a.data!==e);)a=Dn(a);if(a===null)w(!1);else{var o=Dn(a);a.remove(),E(o)}}C||(i=document.head.appendChild(Tn()));try{Qn(()=>t(i),S|ye)}finally{r&&(w(!0),E(n))}}function Ui(e,t){Jn(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=Nn(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}function Wi(e,t,n){Jn(()=>{var r=zr(()=>t(e,n?.())||{});if(n&&r?.update){var i=!1,a={};Xn(()=>{var e=n();Br(e),i&&$e(a,e)&&(a=e,r.update(e))}),i=!0}if(r?.destroy)return()=>r.destroy()})}function Gi(e,t){var n=void 0,r;$n(()=>{n!==(n=t())&&(r&&=(ir(r),null),n&&(r=er(()=>{Jn(()=>n(e))})))})}function Ki(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ki(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function qi(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ki(e))&&(r&&(r+=` `),r+=t);return r}function Ji(e){return typeof e==`object`?qi(e):e??``}var Yi=[...`
|
|
3
|
+
\r\f\xA0\v`];function Xi(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Yi.includes(r[o-1]))&&(s===r.length||Yi.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Zi(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Qi(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function $i(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Qi)),i&&c.push(...Object.keys(i).map(Qi));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Qi(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Zi(r)),i&&(n+=Zi(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function ea(e,t,n,r,i,a){var o=e.__className;if(C||o!==n||o===void 0){var s=Xi(n,r,a);(!C||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function ta(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function na(e,t,n,r){var i=e.__style;if(C||i!==t){var a=$i(t,r);(!C||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e.__style=t}else r&&(Array.isArray(r)?(ta(e,n?.[0],r[0]),ta(e,n?.[1],r[1],`important`)):ta(e,n,r));return r}function ra(e,t,n=!1){if(e.multiple){if(t==null)return;if(!h(t))return Ge();for(var r of e.options)r.selected=t.includes(aa(r));return}for(r of e.options)if(yn(aa(r),t)){r.selected=!0;return}(!n||t!==void 0)&&(e.selectedIndex=-1)}function ia(e){var t=new MutationObserver(()=>{ra(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),Un(()=>{t.disconnect()})}function aa(e){return`__value`in e?e.__value:e.value}var oa=Symbol(`class`),sa=Symbol(`style`),ca=Symbol(`is custom element`),la=Symbol(`is html`),ua=Ae?`link`:`LINK`,da=Ae?`input`:`INPUT`,fa=Ae?`option`:`OPTION`,pa=Ae?`select`:`SELECT`;function ma(e){if(C){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;ga(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;ga(e,`checked`,null),e.checked=r}}};e.__on_r=n,ft(n),Ln()}}function ha(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function ga(e,t,n,r){var i=ya(e);C&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===ua)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[Oe]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&xa(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function _a(e,t,n,r,i=!1,a=!1){if(C&&i&&e.nodeName===da){var o=e;(o.type===`checkbox`?`defaultChecked`:`defaultValue`)in n||ma(o)}var s=ya(e),c=s[ca],l=!s[la];let u=C&&c;u&&w(!1);var f=t||{},p=e.nodeName===fa;for(var m in t)m in n||(n[m]=null);n.class?n.class=Ji(n.class):(r||n[oa])&&(n.class=null),n[sa]&&(n.style??=null);var h=xa(e);for(let i in n){let o=n[i];if(p&&i===`value`&&o==null){e.value=e.__value=``,f[i]=o;continue}if(i===`class`){ea(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,o,r,t?.[oa],n[oa]),f[i]=o,f[oa]=n[oa];continue}if(i===`style`){na(e,o,t?.[sa],n[sa]),f[i]=o,f[sa]=n[sa];continue}var g=f[i];if(!(o===g&&!(o===void 0&&e.hasAttribute(i)))){f[i]=o;var _=i[0]+i[1];if(_!==`$$`)if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var ee=ai(r);if(ri(r)&&(r=r.slice(0,-7),t.capture=!0),!ee&&g){if(o!=null)continue;e.removeEventListener(r,f[n],t),f[n]=null}if(ee)qr(r,e,o),Jr([r]);else if(o!=null){function a(e){f[i].call(this,e)}f[n]=Gr(r,e,a,t)}}else if(i===`style`)ga(e,i,o);else if(i===`autofocus`)Fn(e,!!o);else if(!c&&(i===`__value`||i===`value`&&o!=null))e.value=e.__value=o;else if(i===`selected`&&p)ha(e,o);else{var v=i;l||(v=ci(v));var y=v===`defaultValue`||v===`defaultChecked`;if(o==null&&!c&&!y)if(s[i]=null,v===`value`||v===`checked`){let n=e,r=t===void 0;if(v===`value`){let e=n.defaultValue;n.removeAttribute(v),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(v),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i);else y||h.includes(v)&&(c||typeof o!=`string`)?(e[v]=o,v in s&&(s[v]=d)):typeof o!=`function`&&ga(e,v,o,a)}}}return u&&w(!0),f}function va(e,t,n=[],r=[],i=[],a,o=!1,s=!1){Jt(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===pa,l=!1;if($n(()=>{var u=t(...n.map(F)),d=_a(e,r,u,a,o,s);l&&c&&`value`in u&&ra(e,u.value);for(let e of Object.getOwnPropertySymbols(i))u[e]||ir(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var f=u[t];t.description===`@attach`&&(!r||f!==r[t])&&(i[t]&&ir(i[t]),i[t]=er(()=>Gi(e,()=>f))),d[t]=f}r=d}),c){var u=e;Jn(()=>{ra(u,r.value,!0),ia(u)})}l=!0})}function ya(e){return e.__attributes??={[ca]:e.nodeName.includes(`-`),[la]:e.namespaceURI===f}}var ba=new Map;function xa(e){var t=e.getAttribute(`is`)||e.nodeName,n=ba.get(t);if(n)return n;ba.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=x(i),r)r[o].set&&n.push(o);i=re(i)}return n}function Sa(e,t){return e===t||e?.[Ee]===t}function Ca(e={},t,n,r){var i=D.r,a=P;return Jn(()=>{var o,s;return Xn(()=>{o=s,s=r?.()||[],zr(()=>{e!==n(...s)&&(t(e,...s),o&&Sa(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&Sa(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}var wa={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 Ta(e,t,n){return new Proxy({props:e,exclude:t},wa)}var Ea={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(ae(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];ae(i)&&(i=i());let a=b(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(ae(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=b(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===Ee||t===De)return!1;for(let n of e.props)if(ae(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(ae(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function Da(...e){return new Proxy({props:e},Ea)}function L(e,t,n,r){var i=!nt||(n&2)!=0,a=(n&8)!=0,o=(n&16)!=0,s=r,c=!0,l=()=>(c&&(c=!1,s=o?zr(r):r),s);let u;if(a){var d=Ee in e||De in e;u=b(e,t)?.set??(d&&t in e?n=>e[t]=n:void 0)}var f,p=!1;a?[f,p]=Tt(()=>e[t]):f=e[t],f===void 0&&r!==void 0&&(f=l(),u&&(i&&ze(t),u(f)));var m=i?()=>{var n=e[t];return n===void 0?l():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return m;if(u){var h=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||h||p)&&u(t?m():e),e):m()})}var g=!1,_=(n&1?Qt:en)(()=>(g=!1,m()));a&&F(_);var ee=P;return(function(e,t){if(arguments.length>0){let n=t?F(_):i&&a?_n(e):e;return M(_,n),g=!0,s!==void 0&&(s=n),e}return mr&&g||ee.f&16384?_.v:F(_)})}function Oa(e){return new ka(e)}var ka=class{#e;#t;constructor(e){var t=new Map,n=(e,n)=>{var r=fn(n,!1,!1);return t.set(e,r),r};let r=new Proxy({...e.props||{},$$events:{}},{get(e,r){return F(t.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===De?!0:(F(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,i){return M(t.get(r)??n(r,i),i),Reflect.set(e,r,i)}});this.#t=(e.hydrate?hi:mi)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),!tt&&(!e?.props?.$$host||e.sync===!1)&&k(),this.#e=r.$$events;for(let e of Object.keys(this.#t))e===`$set`||e===`$destroy`||e===`$on`||y(this,e,{get(){return this.#t[e]},set(t){this.#t[e]=t},enumerable:!0});this.#t.$set=e=>{Object.assign(r,e)},this.#t.$destroy=()=>{yi(this.#t)}}$set(e){this.#t.$set(e)}$on(e,t){this.#e[e]=this.#e[e]||[];let n=(...e)=>t.call(this,...e);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(e=>e!==n)}}$destroy(){this.#t.$destroy()}},Aa;typeof HTMLElement==`function`&&(Aa=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn||this.$$c)return;function e(e){return t=>{let n=Nn(`slot`);e!==`default`&&(n.name=e),I(t,n)}}let t={},n=Ma(this);for(let r of this.$$s)r in n&&(r===`default`&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(let e of this.attributes){let t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=ja(t,e.value,this.$$p_d,`toProp`))}for(let e in this.$$p_d)!(e in this.$$d)&&this[e]!==void 0&&(this.$$d[e]=this[e],delete this[e]);this.$$c=Oa({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=Kn(()=>{Xn(()=>{this.$$r=!0;for(let e of v(this.$$c)){if(!this.$$p_d[e]?.reflect)continue;this.$$d[e]=this.$$c[e];let t=ja(e,this.$$d[e],this.$$p_d,`toAttribute`);t==null?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1})});for(let e in this.$$l)for(let t of this.$$l[e]){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=ja(e,n,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 v(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function ja(e,t,n,r){let i=n[e]?.type;if(t=i===`Boolean`&&typeof t!=`boolean`?t!=null:t,!r||!n[e])return t;if(r===`toAttribute`)switch(i){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(i){case`Object`:case`Array`:return t&&JSON.parse(t);case`Boolean`:return t;case`Number`:return t==null?t:+t;default:return t}}function Ma(e){let t={};return e.childNodes.forEach(e=>{t[e.slot||`default`]=!0}),t}function Na(e,t,n,r,i,a){let o=class extends Aa{constructor(){super(e,n,i),this.$$p_d=t}static get observedAttributes(){return v(t).map(e=>(t[e].attribute||e).toLowerCase())}};return v(t).forEach(e=>{y(o.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){n=ja(e,n,t),this.$$d[e]=n;var r=this.$$c;r&&(b(r,e)?.get?r[e]=n:r.$set({[e]:n}))}})}),r.forEach(e=>{y(o.prototype,e,{get(){return this.$$c?.[e]}})}),a&&(o=a(o)),e.element=o,o}var Pa=ti(`<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>`),Fa=ti(` <!>`,1),Ia={hash:`svelte-14mj70v`,code:`
|
|
4
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,
|
|
5
5
|
BlinkMacSystemFont,
|
|
6
6
|
avenir next,
|
|
@@ -13,120 +13,120 @@ var LiipGPTButton=(function(Go){"use strict";typeof window<"u"&&((window.__svelt
|
|
|
13
13
|
roboto,
|
|
14
14
|
noto,
|
|
15
15
|
arial,
|
|
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
|
|
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"]),Ii=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"]),zi=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 In={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!==In.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,...Ii,...pl]);let pe=null;const Bo=M({},[...gl,...zi,...ml,...ho]);let I=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,I=p.CUSTOM_ELEMENT_HANDLING||{},p.CUSTOM_ELEMENT_HANDLING&&Zu(p.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(I.tagNameCheck=p.CUSTOM_ELEMENT_HANDLING.tagNameCheck),p.CUSTOM_ELEMENT_HANDLING&&Zu(p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(I.attributeNameCheck=p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),p.CUSTOM_ELEMENT_HANDLING&&typeof p.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(I.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,zi),M(pe,ho)),nt.svgFilters===!0&&(M(ue,Ri),M(pe,zi),M(pe,ho)),nt.mathMl===!0&&(M(ue,Ii),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({},[...Ii,...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===In.progressingInstruction||Ae&&p.nodeType===In.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)&&(I.tagNameCheck instanceof RegExp&&Ne(I.tagNameCheck,R)||I.tagNameCheck instanceof Function&&I.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===In.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)&&(I.tagNameCheck instanceof RegExp&&Ne(I.tagNameCheck,p)||I.tagNameCheck instanceof Function&&I.tagNameCheck(p))&&(I.attributeNameCheck instanceof RegExp&&Ne(I.attributeNameCheck,x)||I.attributeNameCheck instanceof Function&&I.attributeNameCheck(x,p))||x==="is"&&I.allowCustomizedBuiltInElements&&(I.tagNameCheck instanceof RegExp&&Ne(I.tagNameCheck,R)||I.tagNameCheck instanceof Function&&I.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===In.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
|
-
`+
|
|
19
|
-
]`).replace(
|
|
20
|
-
`).map(
|
|
21
|
-
`)}var
|
|
22
|
-
`)}}}fences(e){
|
|
23
|
-
`)}}blockquote(e){
|
|
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 La(e,t){st(t,!0),Ui(e,Ia);let n=(e,t=oe,n=oe)=>{Ye();var r=Fa(),a=kn(r),o=An(a),s=e=>{},c=e=>{var t=Pa(),r=On(t),i=An(On(r));Je(r),Je(t),qr(`click`,i,()=>n()()),I(e,t)};ki(o,e=>{i()?e(s):e(c,-1)}),Zn(e=>pi(a,`${e??``} `),[()=>console.error(`Panic, uncaught error:
|
|
17
|
+
`,t())??``]),I(e,r)},r=L(t,`body`,7),i=L(t,`silent`,7),a=j(void 0),o=e=>{M(a,{error:e},!0)};var s={get body(){return r()},set body(e){r(e),k()},get silent(){return i()},set silent(e){i(e),k()}},c=ni();return Kt(kn(c),{get failed(){return n}},e=>{var t=ni(),i=kn(t),s=e=>{n(e,()=>F(a).error,()=>()=>{M(a,void 0)})},c=e=>{var t=ni();xi(kn(t),r,()=>o),I(e,t)};ki(i,e=>{F(a)?e(s):e(c,-1)}),I(e,t)}),I(e,c),ct(s)}Jr([`click`]),Na(La,{body:{},silent:{}},[],[],{mode:`open`});var{entries:Ra,setPrototypeOf:za,isFrozen:Ba,getPrototypeOf:Va,getOwnPropertyDescriptor:Ha}=Object,{freeze:Ua,seal:Wa,create:Ga}=Object,{apply:Ka,construct:qa}=typeof Reflect<`u`&&Reflect;Ua||=function(e){return e},Wa||=function(e){return e},Ka||=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)},qa||=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)};var Ja=co(Array.prototype.forEach),Ya=co(Array.prototype.lastIndexOf),Xa=co(Array.prototype.pop),Za=co(Array.prototype.push),Qa=co(Array.prototype.splice),$a=co(String.prototype.toLowerCase),eo=co(String.prototype.toString),to=co(String.prototype.match),no=co(String.prototype.replace),ro=co(String.prototype.indexOf),io=co(String.prototype.trim),ao=co(Object.prototype.hasOwnProperty),oo=co(RegExp.prototype.test),so=lo(TypeError);function co(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Ka(e,t,r)}}function lo(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return qa(e,n)}}function R(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$a;za&&za(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Ba(t)||(t[r]=e),i=e)}e[i]=!0}return e}function uo(e){for(let t=0;t<e.length;t++)ao(e,t)||(e[t]=null);return e}function fo(e){let t=Ga(null);for(let[n,r]of Ra(e))ao(e,n)&&(Array.isArray(r)?t[n]=uo(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=fo(r):t[n]=r);return t}function po(e,t){for(;e!==null;){let n=Ha(e,t);if(n){if(n.get)return co(n.get);if(typeof n.value==`function`)return co(n.value)}e=Va(e)}function n(){return null}return n}var mo=Ua(`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`.split(`.`)),ho=Ua(`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`.split(`.`)),go=Ua([`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`]),_o=Ua([`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`]),vo=Ua(`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`.split(`.`)),yo=Ua([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),bo=Ua([`#text`]),xo=Ua(`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`.split(`.`)),So=Ua(`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`.split(`.`)),Co=Ua(`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`.split(`.`)),wo=Ua([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),To=Wa(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Eo=Wa(/<%[\w\W]*|[\w\W]*%>/gm),Do=Wa(/\$\{[\w\W]*/gm),Oo=Wa(/^data-[\-\w.\u00B7-\uFFFF]+$/),ko=Wa(/^aria-[\-\w]+$/),Ao=Wa(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jo=Wa(/^(?:\w+script|data):/i),Mo=Wa(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),No=Wa(/^html$/i),Po=Wa(/^[a-z][.\w]*(-[.\w]+)+$/i),Fo=Object.freeze({__proto__:null,ARIA_ATTR:ko,ATTR_WHITESPACE:Mo,CUSTOM_ELEMENT:Po,DATA_ATTR:Oo,DOCTYPE_NAME:No,ERB_EXPR:Eo,IS_ALLOWED_URI:Ao,IS_SCRIPT_OR_DATA:jo,MUSTACHE_EXPR:To,TMPLIT_EXPR:Do}),Io={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Lo=function(){return typeof window>`u`?null:window},Ro=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},zo=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Bo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Lo(),t=e=>Bo(e);if(t.version=`3.3.3`,t.removed=[],!e||!e.document||e.document.nodeType!==Io.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=po(m,`cloneNode`),g=po(m,`remove`),_=po(m,`nextSibling`),ee=po(m,`childNodes`),v=po(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let y,b=``,{implementation:x,createNodeIterator:te,createDocumentFragment:ne,getElementsByTagName:re}=n,{importNode:ie}=r,ae=zo();t.isSupported=typeof Ra==`function`&&typeof v==`function`&&x&&x.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:oe,ERB_EXPR:se,TMPLIT_EXPR:ce,DATA_ATTR:le,ARIA_ATTR:ue,IS_SCRIPT_OR_DATA:de,ATTR_WHITESPACE:fe,CUSTOM_ELEMENT:pe}=Fo,{IS_ALLOWED_URI:me}=Fo,he=null,ge=R({},[...mo,...ho,...go,...vo,...bo]),_e=null,ve=R({},[...xo,...So,...Co,...wo]),S=Object.seal(Ga(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}})),ye=null,be=null,xe=Object.seal(Ga(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Se=!0,Ce=!0,we=!1,Te=!0,Ee=!1,De=!0,Oe=!1,ke=!1,Ae=!1,je=!1,Me=!1,Ne=!1,Pe=!0,Fe=!1,Ie=!0,Le=!1,Re={},ze=null,Be=R({},[`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`]),Ve=null,He=R({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ue=null,We=R({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ge=`http://www.w3.org/1998/Math/MathML`,Ke=`http://www.w3.org/2000/svg`,C=`http://www.w3.org/1999/xhtml`,w=C,T=!1,E=null,qe=R({},[Ge,Ke,C],eo),Je=R({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ye=R({},[`annotation-xml`]),Xe=R({},[`title`,`style`,`font`,`a`,`script`]),Ze=null,Qe=[`application/xhtml+xml`,`text/html`],$e=null,et=null,tt=n.createElement(`form`),nt=function(e){return e instanceof RegExp||e instanceof Function},rt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(et&&et===e)){if((!e||typeof e!=`object`)&&(e={}),e=fo(e),Ze=Qe.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,$e=Ze===`application/xhtml+xml`?eo:$a,he=ao(e,`ALLOWED_TAGS`)?R({},e.ALLOWED_TAGS,$e):ge,_e=ao(e,`ALLOWED_ATTR`)?R({},e.ALLOWED_ATTR,$e):ve,E=ao(e,`ALLOWED_NAMESPACES`)?R({},e.ALLOWED_NAMESPACES,eo):qe,Ue=ao(e,`ADD_URI_SAFE_ATTR`)?R(fo(We),e.ADD_URI_SAFE_ATTR,$e):We,Ve=ao(e,`ADD_DATA_URI_TAGS`)?R(fo(He),e.ADD_DATA_URI_TAGS,$e):He,ze=ao(e,`FORBID_CONTENTS`)?R({},e.FORBID_CONTENTS,$e):Be,ye=ao(e,`FORBID_TAGS`)?R({},e.FORBID_TAGS,$e):fo({}),be=ao(e,`FORBID_ATTR`)?R({},e.FORBID_ATTR,$e):fo({}),Re=ao(e,`USE_PROFILES`)?e.USE_PROFILES:!1,Se=e.ALLOW_ARIA_ATTR!==!1,Ce=e.ALLOW_DATA_ATTR!==!1,we=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ee=e.SAFE_FOR_TEMPLATES||!1,De=e.SAFE_FOR_XML!==!1,Oe=e.WHOLE_DOCUMENT||!1,je=e.RETURN_DOM||!1,Me=e.RETURN_DOM_FRAGMENT||!1,Ne=e.RETURN_TRUSTED_TYPE||!1,Ae=e.FORCE_BODY||!1,Pe=e.SANITIZE_DOM!==!1,Fe=e.SANITIZE_NAMED_PROPS||!1,Ie=e.KEEP_CONTENT!==!1,Le=e.IN_PLACE||!1,me=e.ALLOWED_URI_REGEXP||Ao,w=e.NAMESPACE||C,Je=e.MATHML_TEXT_INTEGRATION_POINTS||Je,Ye=e.HTML_INTEGRATION_POINTS||Ye,S=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&nt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(S.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&nt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(S.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==`boolean`&&(S.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&(Ce=!1),Me&&(je=!0),Re&&(he=R({},bo),_e=Ga(null),Re.html===!0&&(R(he,mo),R(_e,xo)),Re.svg===!0&&(R(he,ho),R(_e,So),R(_e,wo)),Re.svgFilters===!0&&(R(he,go),R(_e,So),R(_e,wo)),Re.mathMl===!0&&(R(he,vo),R(_e,Co),R(_e,wo))),ao(e,`ADD_TAGS`)||(xe.tagCheck=null),ao(e,`ADD_ATTR`)||(xe.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS==`function`?xe.tagCheck=e.ADD_TAGS:(he===ge&&(he=fo(he)),R(he,e.ADD_TAGS,$e))),e.ADD_ATTR&&(typeof e.ADD_ATTR==`function`?xe.attributeCheck=e.ADD_ATTR:(_e===ve&&(_e=fo(_e)),R(_e,e.ADD_ATTR,$e))),e.ADD_URI_SAFE_ATTR&&R(Ue,e.ADD_URI_SAFE_ATTR,$e),e.FORBID_CONTENTS&&(ze===Be&&(ze=fo(ze)),R(ze,e.FORBID_CONTENTS,$e)),e.ADD_FORBID_CONTENTS&&(ze===Be&&(ze=fo(ze)),R(ze,e.ADD_FORBID_CONTENTS,$e)),Ie&&(he[`#text`]=!0),Oe&&R(he,[`html`,`head`,`body`]),he.table&&(R(he,[`tbody`]),delete ye.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw so(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw so(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);y=e.TRUSTED_TYPES_POLICY,b=y.createHTML(``)}else y===void 0&&(y=Ro(p,i)),y!==null&&typeof b==`string`&&(b=y.createHTML(``));Ua&&Ua(e),et=e}},it=R({},[...ho,...go,..._o]),at=R({},[...vo,...yo]),D=function(e){let t=v(e);(!t||!t.tagName)&&(t={namespaceURI:w,tagName:`template`});let n=$a(e.tagName),r=$a(t.tagName);return E[e.namespaceURI]?e.namespaceURI===Ke?t.namespaceURI===C?n===`svg`:t.namespaceURI===Ge?n===`svg`&&(r===`annotation-xml`||Je[r]):!!it[n]:e.namespaceURI===Ge?t.namespaceURI===C?n===`math`:t.namespaceURI===Ke?n===`math`&&Ye[r]:!!at[n]:e.namespaceURI===C?t.namespaceURI===Ke&&!Ye[r]||t.namespaceURI===Ge&&!Je[r]?!1:!at[n]&&(Xe[n]||!it[n]):!!(Ze===`application/xhtml+xml`&&E[e.namespaceURI]):!1},ot=function(e){Za(t.removed,{element:e});try{v(e).removeChild(e)}catch{g(e)}},st=function(e,n){try{Za(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Za(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(je||Me)try{ot(n)}catch{}else try{n.setAttribute(e,``)}catch{}},ct=function(e){let t=null,r=null;if(Ae)e=`<remove></remove>`+e;else{let t=to(e,/^[\r\n\t ]+/);r=t&&t[0]}Ze===`application/xhtml+xml`&&w===C&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=y?y.createHTML(e):e;if(w===C)try{t=new f().parseFromString(i,Ze)}catch{}if(!t||!t.documentElement){t=x.createDocument(w,`template`,null);try{t.documentElement.innerHTML=T?b:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),w===C?re.call(t,Oe?`html`:`body`)[0]:Oe?t.documentElement:a},lt=function(e){return te.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ut=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},dt=function(e){return typeof s==`function`&&e instanceof s};function ft(e,n,r){Ja(e,e=>{e.call(t,n,r,et)})}let pt=function(e){let n=null;if(ft(ae.beforeSanitizeElements,e,null),ut(e))return ot(e),!0;let r=$e(e.nodeName);if(ft(ae.uponSanitizeElement,e,{tagName:r,allowedTags:he}),De&&e.hasChildNodes()&&!dt(e.firstElementChild)&&oo(/<[/\w!]/g,e.innerHTML)&&oo(/<[/\w!]/g,e.textContent)||e.nodeType===Io.progressingInstruction||De&&e.nodeType===Io.comment&&oo(/<[/\w]/g,e.data))return ot(e),!0;if(!(xe.tagCheck instanceof Function&&xe.tagCheck(r))&&(!he[r]||ye[r])){if(!ye[r]&&ht(r)&&(S.tagNameCheck instanceof RegExp&&oo(S.tagNameCheck,r)||S.tagNameCheck instanceof Function&&S.tagNameCheck(r)))return!1;if(Ie&&!ze[r]){let t=v(e)||e.parentNode,n=ee(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,_(e))}}}return ot(e),!0}return e instanceof c&&!D(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&oo(/<\/no(script|embed|frames)/i,e.innerHTML)?(ot(e),!0):(Ee&&e.nodeType===Io.text&&(n=e.textContent,Ja([oe,se,ce],e=>{n=no(n,e,` `)}),e.textContent!==n&&(Za(t.removed,{element:e.cloneNode()}),e.textContent=n)),ft(ae.afterSanitizeElements,e,null),!1)},mt=function(e,t,r){if(be[t]||Pe&&(t===`id`||t===`name`)&&(r in n||r in tt))return!1;if(!(Ce&&!be[t]&&oo(le,t))&&!(Se&&oo(ue,t))&&!(xe.attributeCheck instanceof Function&&xe.attributeCheck(t,e))){if(!_e[t]||be[t]){if(!(ht(e)&&(S.tagNameCheck instanceof RegExp&&oo(S.tagNameCheck,e)||S.tagNameCheck instanceof Function&&S.tagNameCheck(e))&&(S.attributeNameCheck instanceof RegExp&&oo(S.attributeNameCheck,t)||S.attributeNameCheck instanceof Function&&S.attributeNameCheck(t,e))||t===`is`&&S.allowCustomizedBuiltInElements&&(S.tagNameCheck instanceof RegExp&&oo(S.tagNameCheck,r)||S.tagNameCheck instanceof Function&&S.tagNameCheck(r))))return!1}else if(!Ue[t]&&!oo(me,no(r,fe,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ro(r,`data:`)===0&&Ve[e])&&!(we&&!oo(de,no(r,fe,``)))&&r)return!1}return!0},ht=function(e){return e!==`annotation-xml`&&to(e,pe)},gt=function(e){ft(ae.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||ut(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:_e,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=$e(a),l=s,u=a===`value`?l:io(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,ft(ae.uponSanitizeAttribute,e,r),u=r.attrValue,Fe&&(c===`id`||c===`name`)&&(st(a,e),u=`user-content-`+u),De&&oo(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){st(a,e);continue}if(c===`attributename`&&to(u,`href`)){st(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){st(a,e);continue}if(!Te&&oo(/\/>/i,u)){st(a,e);continue}Ee&&Ja([oe,se,ce],e=>{u=no(u,e,` `)});let d=$e(e.nodeName);if(!mt(d,c,u)){st(a,e);continue}if(y&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=y.createHTML(u);break;case`TrustedScriptURL`:u=y.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),ut(e)?ot(e):Xa(t.removed)}catch{st(a,e)}}ft(ae.afterSanitizeAttributes,e,null)},_t=function e(t){let n=null,r=lt(t);for(ft(ae.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)ft(ae.uponSanitizeShadowNode,n,null),pt(n),gt(n),n.content instanceof a&&e(n.content);ft(ae.afterSanitizeShadowDOM,t,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(T=!e,T&&(e=`<!-->`),typeof e!=`string`&&!dt(e))if(typeof e.toString==`function`){if(e=e.toString(),typeof e!=`string`)throw so(`dirty is not a string, aborting`)}else throw so(`toString is not a function`);if(!t.isSupported)return e;if(ke||rt(n),t.removed=[],typeof e==`string`&&(Le=!1),Le){if(e.nodeName){let t=$e(e.nodeName);if(!he[t]||ye[t])throw so(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=ct(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===Io.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!je&&!Ee&&!Oe&&e.indexOf(`<`)===-1)return y&&Ne?y.createHTML(e):e;if(i=ct(e),!i)return je?null:Ne?b:``}i&&Ae&&ot(i.firstChild);let u=lt(Le?e:i);for(;c=u.nextNode();)pt(c),gt(c),c.content instanceof a&&_t(c.content);if(Le)return e;if(je){if(Me)for(l=ne.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(_e.shadowroot||_e.shadowrootmode)&&(l=ie.call(r,l,!0)),l}let d=Oe?i.outerHTML:i.innerHTML;return Oe&&he[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&oo(No,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
18
|
+
`+d),Ee&&Ja([oe,se,ce],e=>{d=no(d,e,` `)}),y&&Ne?y.createHTML(d):d},t.setConfig=function(){rt(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),ke=!0},t.clearConfig=function(){et=null,ke=!1},t.isValidAttribute=function(e,t,n){return et||rt({}),mt($e(e),$e(t),n)},t.addHook=function(e,t){typeof t==`function`&&Za(ae[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=Ya(ae[e],t);return n===-1?void 0:Qa(ae[e],n,1)[0]}return Xa(ae[e])},t.removeHooks=function(e){ae[e]=[]},t.removeAllHooks=function(){ae=zo()},t}var Vo=Bo();function Ho(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Uo=Ho();function Wo(e){Uo=e}var Go={exec:()=>null};function z(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Ko.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Ko={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+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},qo=/^(?:[ \t]*(?:\n|$))+/,Jo=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Yo=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Xo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Zo=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Qo=/(?:[*+-]|\d{1,9}[.)])/,$o=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,es=z($o).replace(/bull/g,Qo).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(),ts=z($o).replace(/bull/g,Qo).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(),ns=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rs=/^[^\n]+/,is=/(?!\s*\])(?:\\.|[^\[\]\\])+/,as=z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,is).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),os=z(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Qo).getRegex(),ss=`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`,cs=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ls=z(`^ {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`,cs).replace(`tag`,ss).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),us=z(ns).replace(`hr`,Xo).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`,ss).getRegex(),ds={blockquote:z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,us).getRegex(),code:Jo,def:as,fences:Yo,heading:Zo,hr:Xo,html:ls,lheading:es,list:os,newline:qo,paragraph:us,table:Go,text:rs},fs=z(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Xo).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`,ss).getRegex(),ps={...ds,lheading:ts,table:fs,paragraph:z(ns).replace(`hr`,Xo).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,fs).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`,ss).getRegex()},ms={...ds,html:z(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,cs).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:Go,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:z(ns).replace(`hr`,Xo).replace(`heading`,` *#{1,6} *[^
|
|
19
|
+
]`).replace(`lheading`,es).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},hs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,gs=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,_s=/^( {2,}|\\)\n(?!\s*$)/,vs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ys=/[\p{P}\p{S}]/u,bs=/[\s\p{P}\p{S}]/u,xs=/[^\s\p{P}\p{S}]/u,Ss=z(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,bs).getRegex(),Cs=/(?!~)[\p{P}\p{S}]/u,ws=/(?!~)[\s\p{P}\p{S}]/u,Ts=/(?:[^\s\p{P}\p{S}]|~)/u,Es=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Ds=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Os=z(Ds,`u`).replace(/punct/g,ys).getRegex(),ks=z(Ds,`u`).replace(/punct/g,Cs).getRegex(),As=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,js=z(As,`gu`).replace(/notPunctSpace/g,xs).replace(/punctSpace/g,bs).replace(/punct/g,ys).getRegex(),Ms=z(As,`gu`).replace(/notPunctSpace/g,Ts).replace(/punctSpace/g,ws).replace(/punct/g,Cs).getRegex(),Ns=z(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,xs).replace(/punctSpace/g,bs).replace(/punct/g,ys).getRegex(),Ps=z(/\\(punct)/,`gu`).replace(/punct/g,ys).getRegex(),Fs=z(/^<(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(),Is=z(cs).replace(`(?:-->|$)`,`-->`).getRegex(),Ls=z(`^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`,Is).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Rs=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,zs=z(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,Rs).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Bs=z(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Rs).replace(`ref`,is).getRegex(),Vs=z(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,is).getRegex(),Hs={_backpedal:Go,anyPunctuation:Ps,autolink:Fs,blockSkip:Es,br:_s,code:gs,del:Go,emStrongLDelim:Os,emStrongRDelimAst:js,emStrongRDelimUnd:Ns,escape:hs,link:zs,nolink:Vs,punctuation:Ss,reflink:Bs,reflinkSearch:z(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Bs).replace(`nolink`,Vs).getRegex(),tag:Ls,text:vs,url:Go},Us={...Hs,link:z(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Rs).getRegex(),reflink:z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Rs).getRegex()},Ws={...Hs,emStrongRDelimAst:Ms,emStrongLDelim:ks,url:z(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Gs={...Ws,br:z(_s).replace(`{2,}`,`*`).getRegex(),text:z(Ws.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Ks={normal:ds,gfm:ps,pedantic:ms},qs={normal:Hs,gfm:Ws,breaks:Gs,pedantic:Us},Js={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Ys=e=>Js[e];function Xs(e,t){if(t){if(Ko.escapeTest.test(e))return e.replace(Ko.escapeReplace,Ys)}else if(Ko.escapeTestNoEncode.test(e))return e.replace(Ko.escapeReplaceNoEncode,Ys);return e}function Zs(e){try{e=encodeURI(e).replace(Ko.percentDecode,`%`)}catch{return null}return e}function Qs(e,t){let n=e.replace(Ko.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Ko.splitPipe),r=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(;r<n.length;r++)n[r]=n[r].trim().replace(Ko.slashPipe,`|`);return n}function $s(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function ec(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function tc(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function nc(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
20
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
21
|
+
`)}var rc=class{options;rules;lexer;constructor(e){this.options=e||Uo}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:$s(e,`
|
|
22
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=nc(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=$s(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:$s(t[0],`
|
|
23
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=$s(t[0],`
|
|
24
24
|
`).split(`
|
|
25
|
-
`),n
|
|
26
|
-
`),
|
|
27
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2
|
|
28
|
-
${
|
|
29
|
-
${
|
|
30
|
-
`+
|
|
31
|
-
`),
|
|
32
|
-
`+
|
|
33
|
-
`),
|
|
34
|
-
`);continue}}return{type
|
|
35
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,
|
|
36
|
-
`,1)[0],
|
|
37
|
-
`,e=e.substring(
|
|
38
|
-
`,1)[0];
|
|
39
|
-
`+
|
|
40
|
-
`+
|
|
41
|
-
`,e=e.substring(
|
|
42
|
-
`):[],
|
|
43
|
-
`?t[1].slice(0,-1):t[1];return{type
|
|
44
|
-
`),this.blockTokens(
|
|
45
|
-
`:
|
|
46
|
-
`+
|
|
47
|
-
`+
|
|
48
|
-
`+
|
|
49
|
-
`+
|
|
50
|
-
`+
|
|
51
|
-
`+
|
|
52
|
-
`+
|
|
53
|
-
`+
|
|
54
|
-
`;return
|
|
55
|
-
|
|
25
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
26
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
27
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
28
|
+
${s}`:s,r=r?`${r}
|
|
29
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
30
|
+
`+e.join(`
|
|
31
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
32
|
+
`+e.join(`
|
|
33
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
34
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
|
|
35
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),l=e.split(`
|
|
36
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
37
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let f=e.split(`
|
|
38
|
+
`,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),p=l):p=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
39
|
+
`+p.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
40
|
+
`+l}!u&&!l.trim()&&(u=!0),r+=f+`
|
|
41
|
+
`,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let f=null,p;this.options.gfm&&(f=this.rules.other.listIsTask.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(this.rules.other.listReplaceTask,``))),i.items.push({type:`list_item`,raw:r,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let 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){let t=this.rules.block.def.exec(e);if(t){let e=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`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Qs(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
42
|
+
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Qs(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let 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){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
43
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let 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){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let 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){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=$s(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=ec(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),tc(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return tc(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&!(r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let 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){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},ic=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Uo,this.options.tokenizer=this.options.tokenizer||new rc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Ko,block:Ks.normal,inline:qs.normal};this.options.pedantic?(t.block=Ks.pedantic,t.inline=qs.pedantic):this.options.gfm&&(t.block=Ks.gfm,this.options.breaks?t.inline=qs.breaks:t.inline=qs.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ks,inline:qs}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Ko.carriageReturn,`
|
|
44
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(Ko.tabCharGlobal,` `).replace(Ko.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
45
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=`
|
|
46
|
+
`+r.raw,n.text+=`
|
|
47
|
+
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=`
|
|
48
|
+
`+r.raw,n.text+=`
|
|
49
|
+
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=`
|
|
50
|
+
`+r.raw,a.text+=`
|
|
51
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=`
|
|
52
|
+
`+r.raw,n.text+=`
|
|
53
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a=``;for(;e;){i||(a=``),i=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,a)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(a=r.raw.slice(-1)),i=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},ac=class{options;parser;constructor(e){this.options=e||Uo}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Ko.notSpaceStart)?.[0],i=e.replace(Ko.endingNewline,``)+`
|
|
54
|
+
`;return r?`<pre><code class="language-`+Xs(r)+`">`+(n?i:Xs(i,!0))+`</code></pre>
|
|
55
|
+
`:`<pre><code>`+(n?i:Xs(i,!0))+`</code></pre>
|
|
56
56
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
57
57
|
${this.parser.parse(e)}</blockquote>
|
|
58
58
|
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
59
59
|
`}hr(e){return`<hr>
|
|
60
|
-
`}list(e){
|
|
61
|
-
`+
|
|
62
|
-
`}listitem(e){let t
|
|
63
|
-
`}checkbox({checked:e}){return
|
|
64
|
-
`}table(e){let t
|
|
60
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
61
|
+
`+r+`</`+i+`>
|
|
62
|
+
`}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type===`paragraph`?(e.tokens[0].text=n+` `+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=n+` `+Xs(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `,escaped:!0}):t+=n+` `}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=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
65
65
|
<thead>
|
|
66
66
|
`+t+`</thead>
|
|
67
|
-
`+
|
|
67
|
+
`+r+`</table>
|
|
68
68
|
`}tablerow({text:e}){return`<tr>
|
|
69
69
|
${e}</tr>
|
|
70
|
-
`}tablecell(e){
|
|
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>${
|
|
72
|
-
`+this.renderer.text(
|
|
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 z(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),Ip=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Wi(e)(t,r,o)},zp=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(
|
|
75
|
-
`))}}
|
|
76
|
-
if (${
|
|
77
|
-
if (${
|
|
78
|
-
payload.issues = payload.issues.concat(${
|
|
70
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
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>${Xs(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Zs(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+Xs(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Zs(e);if(i===null)return Xs(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${Xs(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Xs(e.text)}},oc=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``}},sc=class e{options;renderer;textRenderer;constructor(e){this.options=e||Uo,this.options.renderer=this.options.renderer||new ac,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new oc}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let 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 i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`
|
|
72
|
+
`+this.renderer.text(i);t?n+=this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o,escaped:!0}]}):n+=o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},cc=class{options;block;constructor(e){this.options=e||Uo}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?ic.lex:ic.lexInline}provideParser(){return this.block?sc.parse:sc.parseInline}},lc=class{defaults=Ho();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=sc;Renderer=ac;TextRenderer=oc;Lexer=ic;Tokenizer=rc;Hooks=cc;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ac(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new rc(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new cc;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];cc.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));let n=i.call(t,e);return a.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ic.lex(e,t??this.defaults)}parser(e,t){return sc.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(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(t==null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let o=i.hooks?i.hooks.provideLexer():e?ic.lex:ic.lexInline,s=i.hooks?i.hooks.provideParser():e?sc.parse:sc.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(e=>o(e,i)).then(e=>i.hooks?i.hooks.processAllTokens(e):e).then(e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then(()=>e):e).then(e=>s(e,i)).then(e=>i.hooks?i.hooks.postprocess(e):e).catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=s(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
73
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Xs(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},uc=new lc;function B(e,t){return uc.parse(e,t)}B.options=B.setOptions=function(e){return uc.setOptions(e),B.defaults=uc.defaults,Wo(B.defaults),B},B.getDefaults=Ho,B.defaults=Uo,B.use=function(...e){return uc.use(...e),B.defaults=uc.defaults,Wo(B.defaults),B},B.walkTokens=function(e,t){return uc.walkTokens(e,t)},B.parseInline=uc.parseInline,B.Parser=sc,B.parser=sc.parse,B.Renderer=ac,B.TextRenderer=oc,B.Lexer=ic,B.lexer=ic.lex,B.Tokenizer=rc,B.Hooks=cc,B.parse=B,B.options,B.setOptions,B.use,B.walkTokens,B.parseInline,sc.parse,ic.lex;var dc=e=>(Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t];n&&typeof n==`object`&&dc(n)}),Object.freeze(e)),fc=dc({all:[],used:[],unused:[]}),pc=(e,t)=>{let n=Vo(e);return n.addHook(`uponSanitizeElement`,function(e,t){let n=t.tagName||e.nodeName.toLowerCase();n.startsWith(`liipgpt-`)&&(t.allowedTags[n]=!0)}),n.addHook(`afterSanitizeAttributes`,function(e){if(e.tagName!==`A`||!e.getAttribute(`href`)?.startsWith(`http`)||(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`),!t||e.querySelector(`.sr-only`)))return;let n=e.ownerDocument.createElement(`span`);n.className=`sr-only`,n.textContent=` ${t}`,e.appendChild(n)}),n},mc=class{marked;currentReferences=fc;lastUsedIndex=0;DomPurity;constructor(e={}){this.marked=new lc({async:!1,breaks:!0}).use(this.createFootnoteExtension(),...e.extensions??[]),this.DomPurity=pc(e.window,e.newTabSrText)}createFootnoteExtension=()=>{let e=this;return{extensions:[{name:`footnote`,level:`inline`,start(e){return e.match(/\[\^(\d+)\]/)?.index},tokenizer(e){let t=/^\[\^(\d+)\]/.exec(e);if(t){let[e,n]=t;return{type:`footnote`,raw:e,refNumber:n}}},renderer(t){if(t.type===`footnote`){let n=parseInt(t.refNumber)-1,r=e.currentReferences.all[n];if(!r)return console.error(`Could not find ref with index:`,n),``;let i;return r?.referenceIndex.used?i=r.referenceIndex.used:(e.currentReferences.used.push(r),e.lastUsedIndex++,i=e.lastUsedIndex,r.referenceIndex.used=i),` <liipgpt-reference-number data-all-index="${n}" data-used-index="${i}" data-source="${JSON.stringify(r).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,t){this.currentReferences=t;let n=this.parse(e);return this.currentReferences=fc,n}};function hc(){let e,t;return{promise:new Promise((n,r)=>{t=n,e=r}),reject:e,resolve:t}}var gc=class{promise;resolve;reject;constructor(){let{promise:e,resolve:t,reject:n}=hc();this.promise=e,this.resolve=t,this.reject=n}then(e,t){return this.promise.then(e,t)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}toPromise(){return this.promise}[Symbol.toStringTag]=`Flag`},_c=class{hasValue=new gc;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,t){return this.toPromise().then(e,t)}catch(e){return this.toPromise().catch(e)}finally(e){return this.toPromise().finally(e)}[Symbol.toStringTag]=`FutureValue`},vc=e=>{try{return new URL(e).hostname}catch{return e}};function yc(e){return e.replace(/<[^>]*>/g,``).replace(/ /g,` `).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var bc=({url:e,considered:t,title:n,description:r,summary:i})=>{let a=vc(e);return{url:e,considered:t,referenceIndex:{},score:0,metadata:{},display:{card:{title:n,description:r||i,badge:e},listItem:{title:n,badge:a}}}},xc=class{store;content=new _c;backendSendsMappedRefs=!1;constructor(e){this.options=e,this.store=St({id:e.id,state:`loading`,errors:[],type:`bot`,time:new Date().toISOString(),message:{markdown:``,html:``,text:``},references:{all:[],used:[],unused:[]},retrievalQuestion:e.userQuestion})}pushError(e){this.options.onError?.(e),this.store.update(t=>({...t,errors:[...t.errors,e]}))}updateRequestId(e){this.store.update(t=>({...t,id:e}))}updateText(e){this.store.update(t=>{let n=t.message.markdown+e,r=this.options.markdownRenderer.toHTML(n,t.references);return{...t,state:`streaming`,message:{markdown:n,html:r,text:``}}})}finishMessage(){this.store.update(e=>{let t={...e,state:`done`};return t.references.unused=t.references.all.filter(e=>e.referenceIndex.used===void 0),t.message.text=yc(t.message.html),this.options?.onFinish?.(t),this.content.setValue(t),t})}addReference(e){this.store.update(t=>{let n=t.references.all,r=n.length,i=[...n,{...e,referenceIndex:{all:r}}];return{...t,references:{used:t.references.used,all:i}}})}addMappedReference(e){this.backendSendsMappedRefs=!0,this.addReference(e)}addOldReference(e){this.backendSendsMappedRefs||this.addReference(bc(e))}updateRetrievalQuestion(e){this.store.update(t=>({...t,retrievalQuestion:e}))}getReadableStore(){return{subscribe:this.store.subscribe}}getPromise(){return this.content.toPromise()}};Object.freeze({status:`aborted`});function V(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var Sc=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Cc=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},wc={};function Tc(e){return e&&Object.assign(wc,e),wc}function Ec(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Dc(e,t){return typeof t==`bigint`?t.toString():t}function Oc(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function kc(e){return e==null}function Ac(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function jc(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var Mc=Symbol(`evaluating`);function H(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Mc)return r===void 0&&(r=Mc,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Nc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Pc(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Fc(e){return JSON.stringify(e)}function Ic(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Lc=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Rc(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var zc=Oc(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Bc(e){if(Rc(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Rc(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Vc(e){return Bc(e)?{...e}:Array.isArray(e)?[...e]:e}var Hc=new Set([`string`,`number`,`symbol`]);function Uc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Wc(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function U(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw 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 Gc(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Kc={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function qc(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Wc(e,Pc(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Nc(this,`shape`,e),e},checks:[]}))}function Jc(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Wc(e,Pc(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Nc(this,`shape`,r),r},checks:[]}))}function Yc(e,t){if(!Bc(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Wc(e,Pc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Nc(this,`shape`,n),n}}))}function Xc(e,t){if(!Bc(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Wc(e,Pc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Nc(this,`shape`,n),n}}))}function Zc(e,t){return Wc(e,Pc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Nc(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Qc(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Wc(t,Pc(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Nc(this,`shape`,i),i},checks:[]}))}function $c(e,t,n){return Wc(t,Pc(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Nc(this,`shape`,i),i}}))}function el(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function tl(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function nl(e){return typeof e==`string`?e:e?.message}function rl(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=nl(e.inst?._zod.def?.error?.(e))??nl(t?.error?.(e))??nl(n.customError?.(e))??nl(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function il(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function al(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var ol=(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,Dc,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},sl=V(`$ZodError`,ol),cl=V(`$ZodError`,ol,{Parent:Error});function ll(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ul(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var dl=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Sc;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>rl(e,a,Tc())));throw Lc(t,i?.callee),t}return o.value},fl=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>rl(e,a,Tc())));throw Lc(t,i?.callee),t}return o.value},pl=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Sc;return a.issues.length?{success:!1,error:new(e??sl)(a.issues.map(e=>rl(e,i,Tc())))}:{success:!0,data:a.value}},ml=pl(cl),hl=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>rl(e,i,Tc())))}:{success:!0,data:a.value}},gl=hl(cl),_l=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return dl(e)(t,n,i)},vl=e=>(t,n,r)=>dl(e)(t,n,r),yl=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return fl(e)(t,n,i)},bl=e=>async(t,n,r)=>fl(e)(t,n,r),xl=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return pl(e)(t,n,i)},Sl=e=>(t,n,r)=>pl(e)(t,n,r),Cl=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return hl(e)(t,n,i)},wl=e=>async(t,n,r)=>hl(e)(t,n,r),Tl=/^[cC][^\s-]{8,}$/,El=/^[0-9a-z]+$/,Dl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ol=/^[0-9a-vA-V]{20}$/,kl=/^[A-Za-z0-9]{27}$/,Al=/^[a-zA-Z0-9_-]{21}$/,jl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ml=/^([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})$/,Nl=e=>e?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)$/,Pl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Fl=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Il(){return new RegExp(Fl,`u`)}var Ll=/^(?:(?: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])$/,Rl=/^(([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}|:))$/,zl=/^((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])$/,Bl=/^(([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])$/,Vl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Hl=/^[A-Za-z0-9_-]*$/,Ul=/^\+[1-9]\d{6,14}$/,Wl=`(?:(?:\\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])))`,Gl=RegExp(`^${Wl}$`);function Kl(e){let 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 ql(e){return RegExp(`^${Kl(e)}$`)}function Jl(e){let t=Kl({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Wl}T(?:${r})$`)}var Yl=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Xl=/^-?\d+$/,Zl=/^-?\d+(?:\.\d+)?$/,Ql=/^(?:true|false)$/i,$l=/^[^A-Z]*$/,eu=/^[^a-z]*$/,tu=V(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),nu={number:`number`,bigint:`bigint`,object:`date`},ru=V(`$ZodCheckLessThan`,(e,t)=>{tu.init(e,t);let n=nu[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),iu=V(`$ZodCheckGreaterThan`,(e,t)=>{tu.init(e,t);let n=nu[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),au=V(`$ZodCheckMultipleOf`,(e,t)=>{tu.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):jc(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ou=V(`$ZodCheckNumberFormat`,(e,t)=>{tu.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Kc[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Xl)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),su=V(`$ZodCheckMaxLength`,(e,t)=>{var n;tu.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!kc(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=il(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),cu=V(`$ZodCheckMinLength`,(e,t)=>{var n;tu.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!kc(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=il(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),lu=V(`$ZodCheckLengthEquals`,(e,t)=>{var n;tu.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!kc(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=il(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),uu=V(`$ZodCheckStringFormat`,(e,t)=>{var n,r;tu.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),du=V(`$ZodCheckRegex`,(e,t)=>{uu.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),fu=V(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=$l,uu.init(e,t)}),pu=V(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=eu,uu.init(e,t)}),mu=V(`$ZodCheckIncludes`,(e,t)=>{tu.init(e,t);let n=Uc(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),hu=V(`$ZodCheckStartsWith`,(e,t)=>{tu.init(e,t);let n=RegExp(`^${Uc(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),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})}}),gu=V(`$ZodCheckEndsWith`,(e,t)=>{tu.init(e,t);let n=RegExp(`.*${Uc(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),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})}}),_u=V(`$ZodCheckOverwrite`,(e,t)=>{tu.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),vu=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
74
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
75
|
+
`))}},yu={major:4,minor:3,patch:6},W=V(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=yu;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=el(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Sc;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=el(e,t))});else{if(e.issues.length===t)continue;r||=el(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(el(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Sc;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Sc;return o.then(e=>t(e,r,a))}return t(o,r,a)}}H(e,`~standard`,()=>({validate:t=>{try{let n=ml(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return gl(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),bu=V(`$ZodString`,(e,t)=>{W.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Yl(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),G=V(`$ZodStringFormat`,(e,t)=>{uu.init(e,t),bu.init(e,t)}),xu=V(`$ZodGUID`,(e,t)=>{t.pattern??=Ml,G.init(e,t)}),Su=V(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Nl(e)}else t.pattern??=Nl();G.init(e,t)}),Cu=V(`$ZodEmail`,(e,t)=>{t.pattern??=Pl,G.init(e,t)}),wu=V(`$ZodURL`,(e,t)=>{G.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Tu=V(`$ZodEmoji`,(e,t)=>{t.pattern??=Il(),G.init(e,t)}),Eu=V(`$ZodNanoID`,(e,t)=>{t.pattern??=Al,G.init(e,t)}),Du=V(`$ZodCUID`,(e,t)=>{t.pattern??=Tl,G.init(e,t)}),Ou=V(`$ZodCUID2`,(e,t)=>{t.pattern??=El,G.init(e,t)}),ku=V(`$ZodULID`,(e,t)=>{t.pattern??=Dl,G.init(e,t)}),Au=V(`$ZodXID`,(e,t)=>{t.pattern??=Ol,G.init(e,t)}),ju=V(`$ZodKSUID`,(e,t)=>{t.pattern??=kl,G.init(e,t)}),Mu=V(`$ZodISODateTime`,(e,t)=>{t.pattern??=Jl(t),G.init(e,t)}),Nu=V(`$ZodISODate`,(e,t)=>{t.pattern??=Gl,G.init(e,t)}),Pu=V(`$ZodISOTime`,(e,t)=>{t.pattern??=ql(t),G.init(e,t)}),Fu=V(`$ZodISODuration`,(e,t)=>{t.pattern??=jl,G.init(e,t)}),Iu=V(`$ZodIPv4`,(e,t)=>{t.pattern??=Ll,G.init(e,t),e._zod.bag.format=`ipv4`}),Lu=V(`$ZodIPv6`,(e,t)=>{t.pattern??=Rl,G.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Ru=V(`$ZodCIDRv4`,(e,t)=>{t.pattern??=zl,G.init(e,t)}),zu=V(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Bl,G.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Bu(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Vu=V(`$ZodBase64`,(e,t)=>{t.pattern??=Vl,G.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Bu(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Hu(e){if(!Hl.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Bu(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Uu=V(`$ZodBase64URL`,(e,t)=>{t.pattern??=Hl,G.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Hu(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Wu=V(`$ZodE164`,(e,t)=>{t.pattern??=Ul,G.init(e,t)});function Gu(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Ku=V(`$ZodJWT`,(e,t)=>{G.init(e,t),e._zod.check=n=>{Gu(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),qu=V(`$ZodNumber`,(e,t)=>{W.init(e,t),e._zod.pattern=e._zod.bag.pattern??Zl,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Ju=V(`$ZodNumberFormat`,(e,t)=>{ou.init(e,t),qu.init(e,t)}),Yu=V(`$ZodBoolean`,(e,t)=>{W.init(e,t),e._zod.pattern=Ql,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Xu=V(`$ZodUnknown`,(e,t)=>{W.init(e,t),e._zod.parse=e=>e}),Zu=V(`$ZodNever`,(e,t)=>{W.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Qu(e,t,n){e.issues.length&&t.issues.push(...tl(n,e.issues)),t.value[n]=e.value}var $u=V(`$ZodArray`,(e,t)=>{W.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Qu(t,n,e))):Qu(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function ed(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...tl(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function td(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Gc(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function nd(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>ed(e,n,i,t,u))):ed(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var rd=V(`$ZodObject`,(e,t)=>{if(W.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=Oc(()=>td(t));H(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Rc,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>ed(n,t,e,s,r))):ed(i,t,e,s,r)}return i?nd(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),id=V(`$ZodObjectJIT`,(e,t)=>{rd.init(e,t);let n=e._zod.parse,r=Oc(()=>td(t)),i=e=>{let t=new vu([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Fc(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Fc(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|
|
76
|
+
if (${n}.issues.length) {
|
|
77
|
+
if (${o} in input) {
|
|
78
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
79
79
|
...iss,
|
|
80
|
-
path: iss.path ? [${
|
|
80
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
81
81
|
})));
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
if (${
|
|
86
|
-
if (${
|
|
87
|
-
newResult[${
|
|
85
|
+
if (${n}.value === undefined) {
|
|
86
|
+
if (${o} in input) {
|
|
87
|
+
newResult[${o}] = undefined;
|
|
88
88
|
}
|
|
89
89
|
} else {
|
|
90
|
-
newResult[${
|
|
90
|
+
newResult[${o}] = ${n}.value;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
`):
|
|
94
|
-
if (${
|
|
95
|
-
payload.issues = payload.issues.concat(${
|
|
93
|
+
`):t.write(`
|
|
94
|
+
if (${n}.issues.length) {
|
|
95
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
96
96
|
...iss,
|
|
97
|
-
path: iss.path ? [${
|
|
97
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
98
98
|
})));
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
if (${
|
|
102
|
-
if (${
|
|
103
|
-
newResult[${
|
|
101
|
+
if (${n}.value === undefined) {
|
|
102
|
+
if (${o} in input) {
|
|
103
|
+
newResult[${o}] = undefined;
|
|
104
104
|
}
|
|
105
105
|
} else {
|
|
106
|
-
newResult[${
|
|
106
|
+
newResult[${o}] = ${n}.value;
|
|
107
107
|
}
|
|
108
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",...z(t)})}function vg(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...z(t)})}function _c(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...z(t)})}function bg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...z(t)})}function kg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(t)})}function wg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(t)})}function yg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(t)})}function _g(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...z(t)})}function Sg(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...z(t)})}function xg(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(t)})}function Tg(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...z(t)})}function Eg(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(t)})}function Ag(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...z(t)})}function Cg(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...z(t)})}function Rg(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(t)})}function Ig(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(t)})}function zg(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(t)})}function Og(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(t)})}function $g(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(t)})}function Pg(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...z(t)})}function Lg(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...z(t)})}function Dg(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...z(t)})}function Ng(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...z(t)})}function Mg(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(t)})}function Fg(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function jg(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function Bg(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function Zg(e,t){return new e({type:"number",checks:[],...z(t)})}function Ug(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...z(t)})}function qg(e,t){return new e({type:"boolean",...z(t)})}function Vg(e){return new e({type:"unknown"})}function Hg(e,t){return new e({type:"never",...z(t)})}function Sc(e,t){return new ic({check:"less_than",...z(t),value:e,inclusive:!1})}function Ji(e,t){return new ic({check:"less_than",...z(t),value:e,inclusive:!0})}function xc(e,t){return new ac({check:"greater_than",...z(t),value:e,inclusive:!1})}function Ki(e,t){return new ac({check:"greater_than",...z(t),value:e,inclusive:!0})}function Tc(e,t){return new s0({check:"multiple_of",...z(t),value:e})}function Ec(e,t){return new c0({check:"max_length",...z(t),maximum:e})}function Ao(e,t){return new u0({check:"min_length",...z(t),minimum:e})}function Ac(e,t){return new d0({check:"length_equals",...z(t),length:e})}function Gg(e,t){return new h0({check:"string_format",format:"regex",...z(t),pattern:e})}function Wg(e){return new f0({check:"string_format",format:"lowercase",...z(e)})}function Qg(e){return new p0({check:"string_format",format:"uppercase",...z(e)})}function Yg(e,t){return new g0({check:"string_format",format:"includes",...z(t),includes:e})}function Jg(e,t){return new m0({check:"string_format",format:"starts_with",...z(t),prefix:e})}function Kg(e,t){return new v0({check:"string_format",format:"ends_with",...z(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,...z(r)})}function im(e,t,r){return new e({type:"custom",check:"custom",fn:t,...z(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",...z(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>
|
|
109
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Rc,s=!wc.jitless,c=s&&zc.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?nd([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function ad(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!el(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>rl(e,r,Tc())))}),t)}var od=V(`$ZodUnion`,(e,t)=>{W.init(e,t),H(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),H(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),H(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),H(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Ac(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>ad(t,i,e,a)):ad(s,i,e,a)}}),sd=V(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,od.init(e,t);let n=e._zod.parse;H(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=Oc(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!Rc(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),cd=V(`$ZodIntersection`,(e,t)=>{W.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>ud(e,t,n)):ud(e,i,a)}});function ld(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Bc(e)&&Bc(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=ld(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=ld(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ud(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),el(e))return e;let o=ld(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var dd=V(`$ZodRecord`,(e,t)=>{W.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Bc(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...tl(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...tl(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&Zl.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>rl(e,r,Tc())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...tl(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...tl(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),fd=V(`$ZodEnum`,(e,t)=>{W.init(e,t);let n=Ec(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Hc.has(typeof e)).map(e=>typeof e==`string`?Uc(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),pd=V(`$ZodLiteral`,(e,t)=>{if(W.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Uc(e):e?Uc(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),md=V(`$ZodTransform`,(e,t)=>{W.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Cc(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Sc;return n.value=i,n}});function hd(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var gd=V(`$ZodOptional`,(e,t)=>{W.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,H(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),H(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ac(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>hd(t,e.value)):hd(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),_d=V(`$ZodExactOptional`,(e,t)=>{gd.init(e,t),H(e._zod,`values`,()=>t.innerType._zod.values),H(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),vd=V(`$ZodNullable`,(e,t)=>{W.init(e,t),H(e._zod,`optin`,()=>t.innerType._zod.optin),H(e._zod,`optout`,()=>t.innerType._zod.optout),H(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ac(e.source)}|null)$`):void 0}),H(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),yd=V(`$ZodDefault`,(e,t)=>{W.init(e,t),e._zod.optin=`optional`,H(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>bd(e,t)):bd(r,t)}});function bd(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var xd=V(`$ZodPrefault`,(e,t)=>{W.init(e,t),e._zod.optin=`optional`,H(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Sd=V(`$ZodNonOptional`,(e,t)=>{W.init(e,t),H(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Cd(t,e)):Cd(i,e)}});function Cd(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var wd=V(`$ZodCatch`,(e,t)=>{W.init(e,t),H(e._zod,`optin`,()=>t.innerType._zod.optin),H(e._zod,`optout`,()=>t.innerType._zod.optout),H(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>rl(e,n,Tc()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>rl(e,n,Tc()))},input:e.value}),e.issues=[]),e)}}),Td=V(`$ZodPipe`,(e,t)=>{W.init(e,t),H(e._zod,`values`,()=>t.in._zod.values),H(e._zod,`optin`,()=>t.in._zod.optin),H(e._zod,`optout`,()=>t.out._zod.optout),H(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ed(e,t.in,n)):Ed(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ed(e,t.out,n)):Ed(r,t.out,n)}});function Ed(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Dd=V(`$ZodReadonly`,(e,t)=>{W.init(e,t),H(e._zod,`propValues`,()=>t.innerType._zod.propValues),H(e._zod,`values`,()=>t.innerType._zod.values),H(e._zod,`optin`,()=>t.innerType?._zod?.optin),H(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Od):Od(r)}});function Od(e){return e.value=Object.freeze(e.value),e}var kd=V(`$ZodCustom`,(e,t)=>{tu.init(e,t),W.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Ad(t,n,r,e));Ad(i,n,r,e)}});function Ad(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(al(e))}}var jd,Md=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Nd(){return new Md}(jd=globalThis).__zod_globalRegistry??(jd.__zod_globalRegistry=Nd());var Pd=globalThis.__zod_globalRegistry;function Fd(e,t){return new e({type:`string`,...U(t)})}function Id(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...U(t)})}function Ld(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...U(t)})}function Rd(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...U(t)})}function zd(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...U(t)})}function Bd(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...U(t)})}function Vd(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...U(t)})}function Hd(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...U(t)})}function Ud(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...U(t)})}function Wd(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...U(t)})}function Gd(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...U(t)})}function Kd(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...U(t)})}function qd(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...U(t)})}function Jd(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...U(t)})}function Yd(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...U(t)})}function Xd(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...U(t)})}function Zd(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...U(t)})}function Qd(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...U(t)})}function $d(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...U(t)})}function ef(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...U(t)})}function tf(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...U(t)})}function nf(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...U(t)})}function rf(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...U(t)})}function af(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...U(t)})}function of(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...U(t)})}function sf(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...U(t)})}function cf(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...U(t)})}function lf(e,t){return new e({type:`number`,checks:[],...U(t)})}function uf(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...U(t)})}function df(e,t){return new e({type:`boolean`,...U(t)})}function ff(e){return new e({type:`unknown`})}function pf(e,t){return new e({type:`never`,...U(t)})}function mf(e,t){return new ru({check:`less_than`,...U(t),value:e,inclusive:!1})}function hf(e,t){return new ru({check:`less_than`,...U(t),value:e,inclusive:!0})}function gf(e,t){return new iu({check:`greater_than`,...U(t),value:e,inclusive:!1})}function _f(e,t){return new iu({check:`greater_than`,...U(t),value:e,inclusive:!0})}function vf(e,t){return new au({check:`multiple_of`,...U(t),value:e})}function yf(e,t){return new su({check:`max_length`,...U(t),maximum:e})}function bf(e,t){return new cu({check:`min_length`,...U(t),minimum:e})}function xf(e,t){return new lu({check:`length_equals`,...U(t),length:e})}function Sf(e,t){return new du({check:`string_format`,format:`regex`,...U(t),pattern:e})}function Cf(e){return new fu({check:`string_format`,format:`lowercase`,...U(e)})}function wf(e){return new pu({check:`string_format`,format:`uppercase`,...U(e)})}function Tf(e,t){return new mu({check:`string_format`,format:`includes`,...U(t),includes:e})}function Ef(e,t){return new hu({check:`string_format`,format:`starts_with`,...U(t),prefix:e})}function Df(e,t){return new gu({check:`string_format`,format:`ends_with`,...U(t),suffix:e})}function Of(e){return new _u({check:`overwrite`,tx:e})}function kf(e){return Of(t=>t.normalize(e))}function Af(){return Of(e=>e.trim())}function jf(){return Of(e=>e.toLowerCase())}function Mf(){return Of(e=>e.toUpperCase())}function Nf(){return Of(e=>Ic(e))}function Pf(e,t,n){return new e({type:`array`,element:t,...U(n)})}function Ff(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...U(n)})}function If(e){let t=Lf(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(al(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(al(r))}},e(n.value,n)));return t}function Lf(e,t){let n=new tu({check:`custom`,...U(t)});return n._zod.check=e,n}function Rf(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??Pd,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 zf(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,zf(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&Hf(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Bf(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
110
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 Ic(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),Ic(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),Ic(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},Im=(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},zc=(e,t,r,n)=>{const o=e._zod.def;he(o.innerType,t,n);const i=t.seen.get(e);i.ref=o.innerType},zm=k("ZodISODateTime",(e,t)=>{O0.init(e,t),ne.init(e,t)});function Om(e){return Mg(zm,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=Ip(ut),Hm=zp(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=>zv(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(Ig(sv,r)),e.ipv6=r=>e.check(zg(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)=>{I0.init(e,t),ne.init(e,t)}),av=k("ZodKSUID",(e,t)=>{z0.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??{},...z(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,...z(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,...z(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,...z(r)})}function Io(e,t,r){const n=Xt(e);return n._zod.values=void 0,new Fc({type:"record",keyType:n,valueType:t,...z(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:[],...z(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:[],...z(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,...z(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],...z(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)=>zc(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)=>zc(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 Iv=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 zv(e,t){return new Iv({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,...z(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)=>Im(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=Io(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(),ariaPageTitle:d(),ariaCloseWithEsc:d(),ariaInfoTitle: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=Io(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()})]);Io(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:Io(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 ze=[];for(let e=0;e<256;++e)ze.push((e+256).toString(16).slice(1));function su(e,t=0){return(ze[e[t+0]]+ze[e[t+1]]+ze[e[t+2]]+ze[e[t+3]]+"-"+ze[e[t+4]]+ze[e[t+5]]+"-"+ze[e[t+6]]+ze[e[t+7]]+"-"+ze[e[t+8]]+ze[e[t+9]]+"-"+ze[e[t+10]]+ze[e[t+11]]+ze[e[t+12]]+ze[e[t+13]]+ze[e[t+14]]+ze[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
|
-
`+
|
|
113
|
-
`);for(
|
|
114
|
-
`,{error:
|
|
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 zb=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(zb)}),$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 Ib(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)},zo=(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:`
|
|
111
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Vf(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Wf(t,`input`,e.processors),output:Wf(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Hf(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Hf(r.element,n);if(r.type===`set`)return Hf(r.valueType,n);if(r.type===`lazy`)return Hf(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return Hf(r.innerType,n);if(r.type===`intersection`)return Hf(r.left,n)||Hf(r.right,n);if(r.type===`record`||r.type===`map`)return Hf(r.keyType,n)||Hf(r.valueType,n);if(r.type===`pipe`)return Hf(r.in,n)||Hf(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Hf(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Hf(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Hf(e,n))return!0;return!!(r.rest&&Hf(r.rest,n))}return!1}var Uf=(e,t={})=>n=>{let r=Rf({...n,processors:t});return zf(e,r),Bf(r,e),Vf(r,e)},Wf=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Rf({...i??{},target:a,io:t,processors:n});return zf(e,o),Bf(o,e),Vf(o,e)},Gf={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Kf=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Gf[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},qf=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},Jf=(e,t,n,r)=>{n.type=`boolean`},Yf=(e,t,n,r)=>{n.not={}},Xf=(e,t,n,r)=>{let i=e._zod.def,a=Ec(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Zf=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Qf=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},$f=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},ep=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=zf(a.element,t,{...r,path:[...r.path,`items`]})},tp=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=zf(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=zf(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},np=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>zf(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},rp=(e,t,n,r)=>{let i=e._zod.def,a=zf(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=zf(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},ip=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=zf(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=zf(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=zf(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},ap=(e,t,n,r)=>{let i=e._zod.def,a=zf(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},op=(e,t,n,r)=>{let i=e._zod.def;zf(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},sp=(e,t,n,r)=>{let i=e._zod.def;zf(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},cp=(e,t,n,r)=>{let i=e._zod.def;zf(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},lp=(e,t,n,r)=>{let i=e._zod.def;zf(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},up=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;zf(a,t,r);let o=t.seen.get(e);o.ref=a},dp=(e,t,n,r)=>{let i=e._zod.def;zf(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},fp=(e,t,n,r)=>{let i=e._zod.def;zf(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},pp=V(`ZodISODateTime`,(e,t)=>{Mu.init(e,t),J.init(e,t)});function mp(e){return af(pp,e)}var hp=V(`ZodISODate`,(e,t)=>{Nu.init(e,t),J.init(e,t)});function gp(e){return of(hp,e)}var _p=V(`ZodISOTime`,(e,t)=>{Pu.init(e,t),J.init(e,t)});function vp(e){return sf(_p,e)}var yp=V(`ZodISODuration`,(e,t)=>{Fu.init(e,t),J.init(e,t)});function bp(e){return cf(yp,e)}var xp=(e,t)=>{sl.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ul(e,t)},flatten:{value:t=>ll(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Dc,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Dc,2)}},isEmpty:{get(){return e.issues.length===0}}})};V(`ZodError`,xp);var Sp=V(`ZodError`,xp,{Parent:Error}),Cp=dl(Sp),wp=fl(Sp),Tp=pl(Sp),Ep=hl(Sp),Dp=_l(Sp),Op=vl(Sp),kp=yl(Sp),Ap=bl(Sp),jp=xl(Sp),Mp=Sl(Sp),Np=Cl(Sp),Pp=wl(Sp),K=V(`ZodType`,(e,t)=>(W.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Wf(e,`input`),output:Wf(e,`output`)}}),e.toJSONSchema=Uf(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(Pc(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Wc(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Cp(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Tp(e,t,n),e.parseAsync=async(t,n)=>wp(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ep(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Dp(e,t,n),e.decode=(t,n)=>Op(e,t,n),e.encodeAsync=async(t,n)=>kp(e,t,n),e.decodeAsync=async(t,n)=>Ap(e,t,n),e.safeEncode=(t,n)=>jp(e,t,n),e.safeDecode=(t,n)=>Mp(e,t,n),e.safeEncodeAsync=async(t,n)=>Np(e,t,n),e.safeDecodeAsync=async(t,n)=>Pp(e,t,n),e.refine=(t,n)=>e.check(qm(t,n)),e.superRefine=t=>e.check(Jm(t)),e.overwrite=t=>e.check(Of(t)),e.optional=()=>km(e),e.exactOptional=()=>jm(e),e.nullable=()=>Nm(e),e.nullish=()=>km(Nm(e)),e.nonoptional=t=>zm(e,t),e.array=()=>X(e),e.or=t=>mm([e,t]),e.and=t=>vm(e,t),e.transform=t=>Um(e,Dm(t)),e.default=t=>Fm(e,t),e.prefault=t=>Lm(e,t),e.catch=t=>Vm(e,t),e.pipe=t=>Um(e,t),e.readonly=()=>Gm(e),e.describe=t=>{let n=e.clone();return Pd.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Pd.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Pd.get(e);let n=e.clone();return Pd.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Fp=V(`_ZodString`,(e,t)=>{bu.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kf(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Sf(...t)),e.includes=(...t)=>e.check(Tf(...t)),e.startsWith=(...t)=>e.check(Ef(...t)),e.endsWith=(...t)=>e.check(Df(...t)),e.min=(...t)=>e.check(bf(...t)),e.max=(...t)=>e.check(yf(...t)),e.length=(...t)=>e.check(xf(...t)),e.nonempty=(...t)=>e.check(bf(1,...t)),e.lowercase=t=>e.check(Cf(t)),e.uppercase=t=>e.check(wf(t)),e.trim=()=>e.check(Af()),e.normalize=(...t)=>e.check(kf(...t)),e.toLowerCase=()=>e.check(jf()),e.toUpperCase=()=>e.check(Mf()),e.slugify=()=>e.check(Nf())}),Ip=V(`ZodString`,(e,t)=>{bu.init(e,t),Fp.init(e,t),e.email=t=>e.check(Id(Lp,t)),e.url=t=>e.check(Hd(Bp,t)),e.jwt=t=>e.check(rf(tm,t)),e.emoji=t=>e.check(Ud(Vp,t)),e.guid=t=>e.check(Ld(Rp,t)),e.uuid=t=>e.check(Rd(zp,t)),e.uuidv4=t=>e.check(zd(zp,t)),e.uuidv6=t=>e.check(Bd(zp,t)),e.uuidv7=t=>e.check(Vd(zp,t)),e.nanoid=t=>e.check(Wd(Hp,t)),e.guid=t=>e.check(Ld(Rp,t)),e.cuid=t=>e.check(Gd(Up,t)),e.cuid2=t=>e.check(Kd(Wp,t)),e.ulid=t=>e.check(qd(Gp,t)),e.base64=t=>e.check(ef(Qp,t)),e.base64url=t=>e.check(tf($p,t)),e.xid=t=>e.check(Jd(Kp,t)),e.ksuid=t=>e.check(Yd(qp,t)),e.ipv4=t=>e.check(Xd(Jp,t)),e.ipv6=t=>e.check(Zd(Yp,t)),e.cidrv4=t=>e.check(Qd(Xp,t)),e.cidrv6=t=>e.check($d(Zp,t)),e.e164=t=>e.check(nf(em,t)),e.datetime=t=>e.check(mp(t)),e.date=t=>e.check(gp(t)),e.time=t=>e.check(vp(t)),e.duration=t=>e.check(bp(t))});function q(e){return Fd(Ip,e)}var J=V(`ZodStringFormat`,(e,t)=>{G.init(e,t),Fp.init(e,t)}),Lp=V(`ZodEmail`,(e,t)=>{Cu.init(e,t),J.init(e,t)}),Rp=V(`ZodGUID`,(e,t)=>{xu.init(e,t),J.init(e,t)}),zp=V(`ZodUUID`,(e,t)=>{Su.init(e,t),J.init(e,t)}),Bp=V(`ZodURL`,(e,t)=>{wu.init(e,t),J.init(e,t)}),Vp=V(`ZodEmoji`,(e,t)=>{Tu.init(e,t),J.init(e,t)}),Hp=V(`ZodNanoID`,(e,t)=>{Eu.init(e,t),J.init(e,t)}),Up=V(`ZodCUID`,(e,t)=>{Du.init(e,t),J.init(e,t)}),Wp=V(`ZodCUID2`,(e,t)=>{Ou.init(e,t),J.init(e,t)}),Gp=V(`ZodULID`,(e,t)=>{ku.init(e,t),J.init(e,t)}),Kp=V(`ZodXID`,(e,t)=>{Au.init(e,t),J.init(e,t)}),qp=V(`ZodKSUID`,(e,t)=>{ju.init(e,t),J.init(e,t)}),Jp=V(`ZodIPv4`,(e,t)=>{Iu.init(e,t),J.init(e,t)}),Yp=V(`ZodIPv6`,(e,t)=>{Lu.init(e,t),J.init(e,t)}),Xp=V(`ZodCIDRv4`,(e,t)=>{Ru.init(e,t),J.init(e,t)}),Zp=V(`ZodCIDRv6`,(e,t)=>{zu.init(e,t),J.init(e,t)}),Qp=V(`ZodBase64`,(e,t)=>{Vu.init(e,t),J.init(e,t)}),$p=V(`ZodBase64URL`,(e,t)=>{Uu.init(e,t),J.init(e,t)}),em=V(`ZodE164`,(e,t)=>{Wu.init(e,t),J.init(e,t)}),tm=V(`ZodJWT`,(e,t)=>{Ku.init(e,t),J.init(e,t)}),nm=V(`ZodNumber`,(e,t)=>{qu.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qf(e,t,n,r),e.gt=(t,n)=>e.check(gf(t,n)),e.gte=(t,n)=>e.check(_f(t,n)),e.min=(t,n)=>e.check(_f(t,n)),e.lt=(t,n)=>e.check(mf(t,n)),e.lte=(t,n)=>e.check(hf(t,n)),e.max=(t,n)=>e.check(hf(t,n)),e.int=t=>e.check(am(t)),e.safe=t=>e.check(am(t)),e.positive=t=>e.check(gf(0,t)),e.nonnegative=t=>e.check(_f(0,t)),e.negative=t=>e.check(mf(0,t)),e.nonpositive=t=>e.check(hf(0,t)),e.multipleOf=(t,n)=>e.check(vf(t,n)),e.step=(t,n)=>e.check(vf(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function rm(e){return lf(nm,e)}var im=V(`ZodNumberFormat`,(e,t)=>{Ju.init(e,t),nm.init(e,t)});function am(e){return uf(im,e)}var om=V(`ZodBoolean`,(e,t)=>{Yu.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jf(e,t,n,r)});function Y(e){return df(om,e)}var sm=V(`ZodUnknown`,(e,t)=>{Xu.init(e,t),K.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function cm(){return ff(sm)}var lm=V(`ZodNever`,(e,t)=>{Zu.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yf(e,t,n,r)});function um(e){return pf(lm,e)}var dm=V(`ZodArray`,(e,t)=>{$u.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ep(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(bf(t,n)),e.nonempty=t=>e.check(bf(1,t)),e.max=(t,n)=>e.check(yf(t,n)),e.length=(t,n)=>e.check(xf(t,n)),e.unwrap=()=>e.element});function X(e,t){return Pf(dm,e,t)}var fm=V(`ZodObject`,(e,t)=>{id.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tp(e,t,n,r),H(e,`shape`,()=>t.shape),e.keyof=()=>Cm(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:cm()}),e.loose=()=>e.clone({...e._zod.def,catchall:cm()}),e.strict=()=>e.clone({...e._zod.def,catchall:um()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Yc(e,t),e.safeExtend=t=>Xc(e,t),e.merge=t=>Zc(e,t),e.pick=t=>qc(e,t),e.omit=t=>Jc(e,t),e.partial=(...t)=>Qc(Om,e,t[0]),e.required=(...t)=>$c(Rm,e,t[0])});function Z(e,t){return new fm({type:`object`,shape:e??{},...U(t)})}var pm=V(`ZodUnion`,(e,t)=>{od.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>np(e,t,n,r),e.options=t.options});function mm(e,t){return new pm({type:`union`,options:e,...U(t)})}var hm=V(`ZodDiscriminatedUnion`,(e,t)=>{pm.init(e,t),sd.init(e,t)});function gm(e,t,n){return new hm({type:`union`,options:t,discriminator:e,...U(n)})}var _m=V(`ZodIntersection`,(e,t)=>{cd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rp(e,t,n,r)});function vm(e,t){return new _m({type:`intersection`,left:e,right:t})}var ym=V(`ZodRecord`,(e,t)=>{dd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ip(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function bm(e,t,n){return new ym({type:`record`,keyType:e,valueType:t,...U(n)})}function xm(e,t,n){let r=Wc(e);return r._zod.values=void 0,new ym({type:`record`,keyType:r,valueType:t,...U(n)})}var Sm=V(`ZodEnum`,(e,t)=>{fd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xf(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Sm({...t,checks:[],...U(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Sm({...t,checks:[],...U(r),entries:i})}});function Cm(e,t){return new Sm({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...U(t)})}var wm=V(`ZodLiteral`,(e,t)=>{pd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zf(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Tm(e,t){return new wm({type:`literal`,values:Array.isArray(e)?e:[e],...U(t)})}var Em=V(`ZodTransform`,(e,t)=>{md.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$f(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Cc(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(al(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(al(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Dm(e){return new Em({type:`transform`,transform:e})}var Om=V(`ZodOptional`,(e,t)=>{gd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function km(e){return new Om({type:`optional`,innerType:e})}var Am=V(`ZodExactOptional`,(e,t)=>{_d.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jm(e){return new Am({type:`optional`,innerType:e})}var Mm=V(`ZodNullable`,(e,t)=>{vd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ap(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Nm(e){return new Mm({type:`nullable`,innerType:e})}var Pm=V(`ZodDefault`,(e,t)=>{yd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Fm(e,t){return new Pm({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Vc(t)}})}var Im=V(`ZodPrefault`,(e,t)=>{xd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Lm(e,t){return new Im({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Vc(t)}})}var Rm=V(`ZodNonOptional`,(e,t)=>{Sd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>op(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zm(e,t){return new Rm({type:`nonoptional`,innerType:e,...U(t)})}var Bm=V(`ZodCatch`,(e,t)=>{wd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Vm(e,t){return new Bm({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Hm=V(`ZodPipe`,(e,t)=>{Td.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>up(e,t,n,r),e.in=t.in,e.out=t.out});function Um(e,t){return new Hm({type:`pipe`,in:e,out:t})}var Wm=V(`ZodReadonly`,(e,t)=>{Dd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dp(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Gm(e){return new Wm({type:`readonly`,innerType:e})}var Km=V(`ZodCustom`,(e,t)=>{kd.init(e,t),K.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qf(e,t,n,r)});function qm(e,t={}){return Ff(Km,e,t)}function Jm(e){return If(e)}var Ym=mm([q(),rm(),Y(),X(q()),X(rm()),X(Y())]),Xm=Z({title:q(),description:q().optional(),badge:q().optional(),breadcrumbs:X(q()).optional(),previewImage:q().optional(),date:q().datetime().optional()}),Zm=Z({url:q().url(),score:rm(),metadata:bm(q(),Ym),language:q().optional()}).extend(Xm.shape),Qm=Z({componentName:Tm(`buttons`),data:Z({caption:q().optional(),buttons:X(Z({label:q(),href:q().url().optional(),value:q(),variant:Cm([`primary`,`secondary`,`tertiary`]).optional(),icon:q().optional(),target:q().optional()}))})}),$m=Z({componentName:Tm(`combobox`),data:Z({caption:q().optional(),placeholder:q(),values:X(Z({label:q(),value:q()}))})}),eh=Z({componentName:Tm(`alva-init`),data:Z({})}),th=Z({componentName:Tm(`alva-score-survey`),data:Z({})}),nh=Z({type:Tm(`component`),id:q().optional(),time:q().optional(),hideAvatar:Y().optional(),noSectionPadding:Y().optional()}),rh=vm(gm(`componentName`,[Qm,$m,eh,th]),nh);Cm([`start`,`chat`]),gm(`name`,[Z({name:Tm(`start-page`),prefill:q().optional()}),Z({name:Tm(`consent-page`)}),Z({name:Tm(`chat-page`),query:q()})]);var ih=Z({type:Tm(`user`),time:q(),message:q(),id:q().optional()});Cm([`idle`,`searching`,`answering`]);var ah=mm([q(),rm(),Y(),X(q()),X(rm()),X(Y())]),oh=Z({url:q(),score:rm(),metadata:bm(q(),ah),considered:Y(),display:Z({card:Xm,listItem:Xm})}).extend({referenceIndex:Z({all:rm(),used:rm().optional()})}),sh=Z({all:X(oh),used:X(oh),unused:X(oh)}),ch=mm([Cm([`pii-detected`,`blocked`,`maintenance`,`rate-limit`,`server-error`,`too-short`,`too-long`,`quota-reached`,`aborted`]),Tm(`sse-error`),Tm(`client-error`),Tm(`unexpected-call`)]),lh=Z({type:Tm(`bot`),time:q(),id:q(),message:Z({markdown:q(),html:q(),text:q()}),references:sh,errors:X(ch),retrievalQuestion:q().optional()}),uh=lh.extend({state:Cm([`streaming`,`done`])}),dh=mm([mm([lh.extend({state:Tm(`loading`)}),uh]),ih,rh]),fh={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)`}},ph=Z({minRem:rm(),maxRem:rm()}).or(q()),mh=Z({0:q().optional(),50:q(),100:q(),200:q(),300:q(),400:q(),500:q(),600:q(),700:q(),800:q(),900:q(),950:q(),1e3:q().optional()}),hh=Z({color:q().optional(),background:q().optional(),borderWidth:q().optional(),borderColor:q().optional(),boxShadow:q().optional()}),gh=vm(Z({borderRadius:ph.optional(),custom:bm(q(),mm([q(),rm()])).optional(),hover:hh.optional(),focus:hh.optional()}),hh),_h=Z({family:q().optional()}),vh=xm(Cm(`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`.split(`.`)),q()),yh=Z({font:_h.optional(),colors:Z({brand:mh,accent:mh.optional(),highlight:mh,grey:mh}),base:Z({fontSizeXs:ph.optional(),fontSizeSm:ph.optional(),fontSizeBody:ph.optional(),fontSizeH3:ph.optional(),fontSizeH2:ph.optional(),fontSizeH1:ph.optional(),fontWeightNormal:q().optional(),fontWeightBold:q().optional(),fontWeightTitle:q().optional(),lineHeightDefault:q().optional(),lineHeightSnug:q().optional(),lineHeightTight:q().optional(),borderRadius:ph.optional(),lineColor:q().optional(),boxShadow:q().optional()}),components:bm(q(),gh),svgs:vh}),bh=Z({customCSS:q().optional(),fontCSS:q().optional(),fontURLs:q().array().optional(),tokens:yh});Z({light:bh,dark:bh});var xh=Z({font:_h.optional(),colors:Z({brand:mh.partial().optional(),accent:mh.partial().optional(),highlight:mh.partial().optional(),grey:mh.partial().optional()}).optional(),base:Z({fontSizeXs:ph.optional(),fontSizeSm:ph.optional(),fontSizeBody:ph.optional(),fontSizeH3:ph.optional(),fontSizeH2:ph.optional(),fontSizeH1:ph.optional(),fontWeightNormal:q().optional(),fontWeightBold:q().optional(),fontWeightTitle:q().optional(),lineHeightDefault:q().optional(),lineHeightSnug:q().optional(),lineHeightTight:q().optional(),borderRadius:ph.optional(),lineColor:q().optional(),boxShadow:q().optional()}).optional(),components:bm(q(),gh).optional(),svgs:vh.optional()}),Sh=Z({customCSS:q().optional(),fontCSS:q().optional(),fontURLs:q().array().optional(),tokens:xh.optional()}),Ch=Z({light:Sh.optional(),dark:Sh.optional()}),wh=Z({50:q(),100:q(),200:q(),300:q(),400:q(),500:q(),600:q(),700:q(),800:q(),900:q(),950:q()}),Th=Cm([`slate`,`gray`,`zinc`,`neutral`,`stone`,`red`,`orange`,`amber`,`yellow`,`lime`,`green`,`emerald`,`teal`,`cyan`,`sky`,`blue`,`indigo`,`violet`,`purple`,`fuchsia`,`pink`,`rose`]),Eh=mm([wh,Th]),Dh=mm([vm(wh,Z({0:q(),1e3:q()})),Th]),Oh=Z({avatarImageUrl:q().optional(),colors:Z({brand:Eh.optional(),highlight:Eh.optional(),grey:Dh.optional(),background:q().optional(),text:q().optional(),anchor:Z({default:q().optional(),hover:q().optional()}).optional()}).optional(),font:Z({family:q().optional(),urls:X(q()).optional(),sizeXs:ph.optional(),sizeSm:ph.optional(),sizeBody:ph.optional(),sizeH3:ph.optional(),sizeH2:ph.optional(),sizeH1:ph.optional(),weightNormal:q().optional(),weightBold:q().optional(),weightTitle:q().optional()}).optional(),borderRadius:ph.optional(),fineGrained:Ch.optional()}),kh=Z({blocked:q(),maintenance:q(),"rate-limit":q(),"server-error":q(),"too-short":q(),"too-long":q(),"quota-reached":q(),aborted:q(),"sse-error":q(),"client-error":q(),"unexpected-call":q(),"incomplete-error":q(),"feedback-failed":q(),"speech-not-supported":q(),"speech-transcription-failed":q(),"speech-no-text-detected":q(),"speech-microphone-access-denied":q(),"pii-detected":q()}),Ah=Z({email:q(),creditCard:q(),ahv:q(),phoneSwiss:q(),phoneInternational:q(),swissPassport:q(),longNumber:q()}),jh=Z({name:q(),namePlural:q().optional(),intro:q().optional(),placeholder:q(),values:bm(q(),q())}),Mh=Z({action:q(),label:q(),type:Cm([`primary`,`secondary`]).optional()}),Nh=Z({hash:q(),title:q(),content:q(),actions:X(Mh).optional()}),Ph=Z({introductionTitle:q(),introductionDisclaimer:q().optional(),termsInvitationToConsent:q().optional(),chatInputPlaceholder:q(),chatInputPlaceholderListening:q().optional(),chatInputSubmit:q(),chatInputAbort:q(),chatInputStartListening:q(),chatInputStopListening:q(),referenceLink:q(),referencesDisplay:q(),referencesHide:q(),referencesTitle:q(),referencesFurtherTitle:q(),newChat:q(),maintenanceModeError:q(),messageBotLoading:q(),messageBotError:q(),messageBotDefaultError:q(),noResultsFound:q(),chatFooterText:q().optional(),scrollToBottom:q(),openButtonTitle:q().optional(),openButtonDescription:q().optional(),openMenu:q(),openInfo:q(),aboutThisChat:q().optional(),closeMenu:q(),closeChat:q(),close:q(),send:q(),thankYouForFeedback:q(),giveFeedback:q(),sendFeedback:q(),feedbackFormTitle:q(),feedbackFormMessage:q(),feedbackFormMessagePlaceholder:q(),feedbackFormEmail:q(),feedbackFormEmailPlaceholder:q(),askQuestionAgain:q(),answerGood:q(),answerBad:q(),classificationSubmit:q(),classificationThankYou:q(),classificationTitle:q(),selectLanguage:q(),languageChanged:q(),selectColorTheme:q(),lightMode:q(),darkMode:q(),ariaMainNavigation:q(),ariaMainNavigationRegion:q(),ariaGotoMainNavigation:q(),ariaAskQuestion:q(),ariaAskQuestionRegion:q(),ariaNotifications:q(),ariaPredefinedQuestions:q(),ariaPredefinedQuestionsRegion:q(),ariaChatHistory:q(),ariaOpenChat:q(),ariaQuestionFromYou:q(),ariaAnswerFromBot:q(),ariaLastAnswerNavigation:q(),ariaQuestionSent:q(),ariaAnswerReady:q(),ariaAnswerFinished:q(),ariaAskQuestionAgain:q(),ariaAnswerGood:q(),ariaAnswerBad:q(),ariaReferenceSource:q(),ariaGiveFeedback:q(),ariaLanguageChanged:q(),ariaLightSelected:q(),ariaDarkSelected:q(),ariaSettings:q(),ariaSettingsRegion:q(),ariaReferencesRegion:q(),ariaOpensInNewTab:q(),ariaPageTitle:q(),ariaCloseWithEsc:q(),ariaInfoTitle:q(),ariaFlyoutRegion:q(),ariaSelected:q(),ariaUnselected:q(),ariaAllSelected:q(),ariaAllUnselected:q(),ariaAllReseted:q(),popups:X(Nh).optional(),termsAcceptButton:q().optional(),termsReadButton:q().optional(),selectors:bm(q(),jh).optional(),hideSettings:q(),showSettings:q(),chooseAtLeastOneOption:q(),selectAll:q(),selectNone:q(),resetToDefaults:q(),messageTooLong:q()}),Fh=Cm([`en`,`de`,`fr`,`it`]),Ih=xm(Fh,Ph.partial().extend({selectors:bm(q(),jh).optional()}));bm(Fh,kh),bm(Fh,Ah);var Lh=Z({label:q(),options:X(Z({label:q(),value:rm()}))}),Rh=Z({label:q(),icon:q(),url:q(),target:Cm([`_blank`,`_self`]).optional()}),zh=Z({label:q().nullable(),question:q()}),Bh=Z({impact:Lh.optional(),quality:Lh.optional()});Z({classification:Bh.optional()});var Vh=Z({predefinedQuestions:X(zh)}),Hh=mm([Z({maintenance:Tm(!0)}),Z({id:q(),cID:q()})]);xm(Fh,Ph);var Uh=Z({settingName:q(),iconName:q(),settingIntro:q().optional(),type:Cm([`single-select`,`multi-select`]),allowEmpty:Y(),values:X(q()),defaultValues:X(q()).optional()}),Wh=Z({before:X(dh).optional(),after:X(dh).optional()}),Gh=Z({init:X(dh).optional(),bot:Wh.optional(),user:Wh.optional()}),Kh=vm(Z({showPredefinedQuestions:Y(),showOverallFeedbackButton:Y(),showOverallFeedbackEmail:Y(),showCloseChatButton:Y(),showContextMenu:Y(),showContextInfo:Y(),showReferencesByDefault:Y(),showExpandedSelectors:Y(),showTextFeedback:Y(),inlineLayout:Y(),allowAudioInput:Y(),blockPII:Y(),questionPrefix:q(),menu:xm(Fh,X(Rh)).optional(),supportedLanguages:X(Fh),classification:Bh.optional(),theme:Oh,translations:Ih,buttonHref:q().optional(),addQueryToUrlParams:Y().optional(),addRetrievalQuestionToUrlParams:Y().optional(),renderKatex:Y().optional(),reflectLanguageInPath:Y().optional(),sendReferrer:Cm([`all`,`own`,`none`,`location`]).optional(),selectorsConfig:X(Uh).default([]),questionLengthLimit:rm().optional(),forceConsent:Y().optional(),askQuestionAgain:Y(),enableBackdrop:Y().optional(),messageAdditions:Gh.optional(),contextVersion:rm().optional()}).partial(),Z({theme:Z({name:q().optional()}).optional()})),qh=class{id;constructor(e){this.chatResponseData=e,this.id=this.chatResponseData.id}async isReadyForFeedback(){return await this.chatResponseData.readyForFeedback.toPromise(),!0}subscribe(e,t){return this.chatResponseData.readableStore.subscribe(e,t)}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)}},Jh=[];for(let e=0;e<256;++e)Jh.push((e+256).toString(16).slice(1));function Yh(e,t=0){return(Jh[e[t+0]]+Jh[e[t+1]]+Jh[e[t+2]]+Jh[e[t+3]]+`-`+Jh[e[t+4]]+Jh[e[t+5]]+`-`+Jh[e[t+6]]+Jh[e[t+7]]+`-`+Jh[e[t+8]]+Jh[e[t+9]]+`-`+Jh[e[t+10]]+Jh[e[t+11]]+Jh[e[t+12]]+Jh[e[t+13]]+Jh[e[t+14]]+Jh[e[t+15]]).toLowerCase()}var Xh,Zh=new Uint8Array(16);function Qh(){if(!Xh){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Xh=crypto.getRandomValues.bind(crypto)}return Xh(Zh)}var $h={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function eg(e,t,n){e||={};let r=e.random??e.rng?.()??Qh();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Yh(r)}function tg(e,t,n){return $h.randomUUID&&!t&&!e?$h.randomUUID():eg(e,t,n)}var ng={};function rg(e,t,n){let r;if(e)r=ag(e.random??e.rng?.()??Qh(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=Qh();ig(ng,e,i),r=ag(i,ng.msecs,ng.seq,t,n)}return t??Yh(r)}function ig(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=n[6]<<23|n[7]<<16|n[8]<<8|n[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function ag(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}var og=new Map,sg=class{get length(){return og.size}clear(){og.clear()}getItem(e){return og.get(e)||null}key(e){return Array.from(og.keys())[e]||null}removeItem(e){og.delete(e)}setItem(e,t){og.set(e,String(t))}},cg=globalThis.localStorage??new sg,lg=async e=>{try{let t=cg.getItem(`liipgpt:uID`)||cg.getItem(`uID`),n={method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify({referrer:globalThis?.document?.referrer||null,uID:t})},r=await e.fetchData(`/login`,Hh,{},n).catch(t=>(console.log(`Failed to /login use /log`,t),e.fetchData(`/log`,Hh,{},n)));if(`maintenance`in r&&r.maintenance)return{mode:`maintenance`};if(!(`id`in r))throw Error(`Invalid response format: missing user id`);return cg.setItem(`liipgpt:uID`,r.id),{mode:`ready`,userId:r.id}}catch(e){throw console.error(`Failed to fetch user data:`,e),e}},ug=function(e,t){if(!(this instanceof ug))return new ug(e,t);this.url=e,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?!1:t.autoReconnect,this.reconnectDelay=t.reconnectDelay===void 0?3e3:t.reconnectDelay,this.maxRetries=t.maxRetries===void 0?null:t.maxRetries,this.retryCount=0,this.reconnectTimer=null,this.useLastEventId=t.useLastEventId===void 0?!0:t.useLastEventId,this.FIELD_SEPARATOR=`:`,this.listeners={},this.xhr=null,this.readyState=ug.INITIALIZING,this.progress=0,this.chunk=``,this.lastEventId=``,this._hasParsedBom=!1,this.addEventListener=function(e,t){this.listeners[e]===void 0&&(this.listeners[e]=[]),this.listeners[e].indexOf(t)===-1&&this.listeners[e].push(t)},this.removeEventListener=function(e,t){if(this.listeners[e]===void 0)return;let n=[];this.listeners[e].forEach(function(e){e!==t&&n.push(e)}),n.length===0?delete this.listeners[e]:this.listeners[e]=n},this.dispatchEvent=function(e){if(!e)return!0;this.debug&&console.debug(e),e.source=this;let t=`on`+e.type;return this.hasOwnProperty(t)&&(this[t].call(this,e),e.defaultPrevented)?!1:this.listeners[e.type]?this.listeners[e.type].every(function(t){return t(e),!e.defaultPrevented}):!0},this._markClosed=function(){if(this.xhr=null,this.progress=0,this.chunk=``,this._setReadyState(ug.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(e){let t=new CustomEvent(`readystatechange`);t.readyState=e,this.readyState=e,this.dispatchEvent(t)},this._onStreamFailure=function(e){let t=new CustomEvent(`error`);t.responseCode=e.currentTarget.status,t.data=e.currentTarget.response,this.dispatchEvent(t),this._markClosed()},this._onStreamAbort=function(){this.dispatchEvent(new CustomEvent(`abort`)),this._markClosed()},this._onStreamProgress=function(e){if(!this.xhr)return;if(this.xhr.status<200||this.xhr.status>=300){this._onStreamFailure(e);return}this.retryCount=0;let t=this.xhr.responseText.substring(this.progress);this.progress+=t.length,!this._hasParsedBom&&this.chunk.length===0&&(t.charCodeAt(0)===65279&&(t=t.substring(1)),this._hasParsedBom=!0);let n=(this.chunk+t).split(/(\r\n\r\n|\r\r|\n\n)/g),r=n.pop();n.forEach(function(e){e.trim().length>0&&this.dispatchEvent(this._parseEventChunk(e))}.bind(this)),this.chunk=r},this._onStreamLoaded=function(e){this._onStreamProgress(e),this.dispatchEvent(this._parseEventChunk(this.chunk)),this.chunk=``,this._markClosed()},this._parseEventChunk=function(e){if(!e||e.length===0)return null;this.debug&&console.debug(e);let t={id:null,retry:null,data:null,event:null};if(e.split(/\n|\r\n|\r/).forEach(function(e){let n=e.indexOf(this.FIELD_SEPARATOR),r,i;if(n>0){let t=e[n+1]===` `?2:1;r=e.substring(0,n),i=e.substring(n+t)}else if(n<0)r=e,i=``;else return;r in t&&(r===`data`&&t[r]!==null?t.data+=`
|
|
112
|
+
`+i:t[r]=i)}.bind(this)),t.id!==null&&t.id.indexOf(`\0`)===-1&&(this.lastEventId=t.id),t.retry!==null&&/^[0-9]+$/.test(t.retry)&&(this.reconnectDelay=parseInt(t.retry,10)),t.data===null)return null;let n=new CustomEvent(t.event||`message`);return n.id=t.id,n.data=t.data||``,n.lastEventId=this.lastEventId,n},this._onReadyStateChange=function(){if(this.xhr&&this.xhr.readyState===XMLHttpRequest.HEADERS_RECEIVED){let e={},t=this.xhr.getAllResponseHeaders().trim().split(`\r
|
|
113
|
+
`);for(let n of t){let[t,...r]=n.split(`:`),i=r.join(`:`).trim();e[t.trim().toLowerCase()]=e[t.trim().toLowerCase()]||[],e[t.trim().toLowerCase()].push(i)}let n=new CustomEvent(`open`);n.responseCode=this.xhr.status,n.headers=e,this.dispatchEvent(n),this._setReadyState(ug.OPEN)}},this.stream=function(){if(!this.xhr){this._setReadyState(ug.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 e in this.headers)this.xhr.setRequestHeader(e,this.headers[e]);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),null),this.autoReconnect=!1,this.xhr&&this.xhr.abort()},(t.start===void 0||t.start)&&this.stream()};ug.INITIALIZING=-1,ug.CONNECTING=0,ug.OPEN=1,ug.CLOSED=2;var dg=class{eventSource;triggeredOnClose=!1;constructor(e,t,n){this.options=t,this.payload=n;let r={headers:{"content-type":`application/json`}};n&&(r.payload=JSON.stringify(n)),t.apiKey&&(r.headers[`api-key`]=t.apiKey),this.eventSource=new(t.EventSource??ug)(e,r),this.eventSource.onmessage=e=>{try{let n=JSON.parse(e.data);t.onMessage(n)}catch(e){t.onError(new CustomEvent(`parse-error`,{detail:e}))}},this.eventSource.onerror=e=>{t.onError(e),this.isClosed()&&this.close()}}isClosed(){return this.eventSource.readyState===EventSource.CLOSED}close(){this.isClosed()||this.eventSource.close(),this.triggeredOnClose||(this.triggeredOnClose=!0,this.options.onClose())}},fg=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>t!=null)),pg=class{constructor(e){this.options=e}getDefaultHeaders(e={}){let t={"Content-Type":`application/json`,...e};return this.options.apiKey&&(t[`api-key`]=this.options.apiKey),t}get speechRecognitionApiKey(){return this.options.speechRecognitionApiKey}async subscribeSse(e,t={},n){let r=fg(t);return this.options.apiKey&&(n.apiKey=this.options.apiKey),new dg(`${this.options.apiUrl}${e}`,n,r)}async fetchData(e,t,n={},r={}){let i=`${this.options.apiUrl}${e}?${new URLSearchParams(fg(n)).toString()}`,a={...r,headers:this.getDefaultHeaders(r?.headers)},o=await fetch(i,a);if(!o.ok){let e=await o.text();throw Error(`API request failed: ${o.status} - ${e}`)}let s=await o.json(),{success:c,data:l,error:u}=t.safeParse(s);if(this.options.strict){if(!c)throw console.error(`Server response has wrong type:
|
|
114
|
+
`,{error:u,url:i,opts:a,data:s}),Error(`Server response has wrong type: ${u.message}`);return l}else return c||console.warn(`Server response has wrong type:
|
|
115
|
+
`,{error:u,url:i,opts:a,data:s}),s}async postData(e,t){let n=await fetch(`${this.options.apiUrl}${e}`,{method:`POST`,headers:this.getDefaultHeaders(),body:JSON.stringify(t)});if(!n.ok){let e=await n.text();throw Error(`${n.status} - ${e}`)}return n}async postFormData(e,t){let n=await fetch(`${this.options.apiUrl}${e}`,{method:`POST`,body:t});if(!n.ok){let e=await n.text();throw Error(`${n.status} - ${e}`)}return n}},mg=Z({links:X(Z({url:q().url().optional(),title:q().optional(),considered:Y().optional(),orgMetadata:Z({authors:X(q()).optional()}).optional(),type:q().optional(),date:q().datetime().optional(),similarity:rm().optional(),content:q().optional(),fromFullTextSearch:Y().optional(),rerank:Z({index:rm().int().optional(),adjustment:rm().optional(),score:rm().optional(),similarityOld:rm().optional()}).optional()}).or(Zm))}),hg=e=>{if(`metadata`in e)return e;console.warn(`Please upgrade your backend you are currently using an old api feature.`);let t=e.orgMetadata??{};e?.fromFullTextSearch&&(t.fromFullTextSearch=e?.fromFullTextSearch),e?.rerank&&(t.rerank=e?.rerank);let n=[],r=e.title??``;if(e.title&&e.title.includes(` > `)){let t=e.title.split(` > `);r=t.pop()??``,n=t}return{url:e.url??``,title:r,score:e.similarity||0,breadcrumbs:n,metadata:t,description:e.content,date:e.date}},gg=class{constructor(e){this.results=e}},_g=class{internalData;renderers=new Map;markedExtensions=[];_newTabSrText;constructor(e){let t=new pg({apiUrl:e.apiUrl,apiKey:e.apiKey,speechRecognitionApiKey:e.speechRecognitionApiKey,strict:e.strict??!1,EventSource:e.EventSource??EventSource});this.internalData={restClient:t,metadata:lg(t),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(){let e=rg();return this.renderers.set(e,new mc({extensions:this.markedExtensions,newTabSrText:this._newTabSrText})),e}chat(e,t,n={}){let r=new _c,i=rg(),a=new gc,o=new xc({id:i,onError:e=>{n.onError?.(e)},onFinish:e=>{r.setValue(e)},markdownRenderer:this.renderers.get(e)??new mc({extensions:this.markedExtensions,newTabSrText:this._newTabSrText}),userQuestion:t}),s=async()=>{await a,(await c).close()},c=new _c;(async()=>{let s=await this.internalData.metadata;if(s.mode===`maintenance`)throw Error(`Can not chat in maintenance mode`);let l=await this.internalData.restClient.subscribeSse(`/assistant/sse`,{query:t,uID:s.userId,cID:e,rID:i,lang:n.lang,feature:n.features?.join(`,`),referrer:n.referrer,...n.selectorValues??{},chat:`true`,version:`2`},{onClose:()=>{o.finishMessage(),a.resolve(),r.cleanup()},onMessage:t=>{let r=t;switch(r.type){case`error`:o.pushError(r.error);break;case`id`:r.for===`request`&&i!==r.id&&console.warn(`Unexpected request id "${r.id}" expected "${i}"`),r.for===`conversation`&&e!==r.id&&console.warn(`Unexpected conversation id "${r.id}" expected "${e}"`);break;case`state`:r.state===`history-entry-initialized`&&a.resolve();break;case`text`:o.updateText(r.text);break;case`done`:case`answer-done`:o.finishMessage(),a.resolve(),c.then(e=>e.close());break;case`unexpected-call`:console.error(`unexpected-call:`,r),o.pushError(`unexpected-call`);break;case`mapped-reference`:o.addMappedReference(r.reference);break;case`reference`:o.addOldReference(r.reference);break;case`retrieval-question`:o.updateRetrievalQuestion(r.question);break}n.onMessage?.(r)},onError:e=>{console.error(` sse-error:`,e),!(`data`in e&&!e.data&&`responseCode`in e&&e.responseCode===0)&&o.pushError(`sse-error`)}});c.setValue(l)})();let l=new qh({question:t,id:i,content:r,readableStore:o.getReadableStore(),readyForFeedback:a,abort:s,liipgptClientPrimitive:this});return this.internalData.chatResponseMap.set(l.id,l),l}async thumbs(e,t,n){if((await this.internalData.metadata).mode!==`ready`)throw Error(`Can not post feedback unless we are in ready mode`);let r={feedback:n,rID:e,query:t};await this.internalData.restClient.postData(`/quickfeedback`,r)}thumbsUp(e,t){return this.thumbs(e,t,`positive`)}thumbsDown(e,t){return this.thumbs(e,t,`negative`)}async feedback(e,t,n){let r=await this.internalData.metadata;if(r.mode!==`ready`)throw Error(`Can not post feedback unless we are in ready mode`);if(n.message){let i={body:n.message,email:n.email,rID:e,uID:r.userId,query:t};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,t={}){let n=await this.internalData.metadata,r=n.mode===`ready`?n.userId:void 0,{links:i}=await this.internalData.restClient.fetchData(`/assistant/search`,mg,{modelId:t.model,lang:t.language,query:e,mapResults:`true`,uID:r});return new gg(i.map(hg))}async getChatConfig(){return this.internalData.restClient.fetchData(`/chatconfig`,Kh)}async getPredefinedQuestions(e){return(await this.internalData.restClient.fetchData(`/topics/questions`,Vh,e)).predefinedQuestions}async transcribeAudio(e,t={}){let n=await this.internalData.metadata,r=t.lang||`de-CH`;if(n.mode===`maintenance`)throw Error(`Can not transcribe audio in maintenance mode`);try{let t=(e=>e.includes(`mp4`)?`mp4`:e.includes(`webm`)?`webm`:(e.includes(`wav`),`wav`))(e.type),n=new FormData;return n.append(`file`,e,`audio.${t}`),n.append(`lang`,r),n.append(`type`,e.type),{transcript:await(await this.internalData.restClient.postFormData(`/speech?key=${this.internalData.restClient.speechRecognitionApiKey||``}&lang=${r}`,n)).text()||``,error:void 0}}catch(e){return console.error(`Error transcribing audio:`,e),{transcript:``,error:e instanceof Error?e.message:`Unknown error`}}}},vg=l(s(((e,t)=>{var n=function(e){return r(e)&&!i(e)};function r(e){return!!e&&typeof e==`object`}function i(e){var t=Object.prototype.toString.call(e);return t===`[object RegExp]`||t===`[object Date]`||o(e)}var a=typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.element`):60103;function o(e){return e.$$typeof===a}function s(e){return Array.isArray(e)?[]:{}}function c(e,t){return t.clone!==!1&&t.isMergeableObject(e)?g(s(e),e,t):e}function l(e,t,n){return e.concat(t).map(function(e){return c(e,n)})}function u(e,t){if(!t.customMerge)return g;var n=t.customMerge(e);return typeof n==`function`?n:g}function d(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function f(e){return Object.keys(e).concat(d(e))}function p(e,t){try{return t in e}catch{return!1}}function m(e,t){return p(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function h(e,t,n){var r={};return n.isMergeableObject(e)&&f(e).forEach(function(t){r[t]=c(e[t],n)}),f(t).forEach(function(i){m(e,i)||(p(e,i)&&n.isMergeableObject(t[i])?r[i]=u(i,n)(e[i],t[i],n):r[i]=c(t[i],n))}),r}function g(e,t,r){r||={},r.arrayMerge=r.arrayMerge||l,r.isMergeableObject=r.isMergeableObject||n,r.cloneUnlessOtherwiseSpecified=c;var i=Array.isArray(t);return i===Array.isArray(e)?i?r.arrayMerge(e,t,r):h(e,t,r):c(t,r)}g.all=function(e,t){if(!Array.isArray(e))throw Error(`first argument should be an array`);return e.reduce(function(e,n){return g(e,n,t)},{})},t.exports=g}))(),1),yg=e=>typeof e!=`object`||!e,bg=e=>{if(yg(e))return e;if(Array.isArray(e))return e.map(bg);let t=Object.entries(e).filter(([e,t])=>t!==void 0).map(([e,t])=>[e,bg(t)]);return Object.fromEntries(t)},xg=(e,t)=>(0,vg.default)(e,bg(t)),Sg={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:`
|
|
116
116
|
<svg viewBox="0 0 24 24" >
|
|
117
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>
|
|
118
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>
|
|
119
119
|
<path d="M23.5 3.5A10.5 10.5 0 0 0 13 14v1.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
|
|
120
120
|
<path d="M13 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>
|
|
121
121
|
</svg>
|
|
122
|
-
`,edit
|
|
122
|
+
`,edit:`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="m15.9 4.7 3.5 3.5-10.8 10.8-3.5-3.5z"/><path d="m5.1 15.4-1.7 5.3 5.3-1.7-3.5-3.5z"/><path d="m19.3 8.1-3.5-3.5.6-.6c1-1 2.6-.9 3.5 0 .9 1 .9 2.5 0 3.5z"/></g></svg>`,newConversation:`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="m12.6 15.3-4.7 1.6 1.5-4.8 7.6-7.6c.6-.6 1.5-.6 2.1 0l1.1 1.1c.6.6.6 1.5 0 2.1l-7.7 7.7z"/><path d="m12.8 15.1-3.3-3.3"/><path d="m20.2 12.1v7.4c0 .8-.7 1.5-1.5 1.5h-13.8c-.8 0-1.5-.7-1.5-1.5v-14.5c0-.8.7-1.5 1.5-1.5h8.4"/></g></svg>`,voteUp:`<svg viewBox="0 0 24 24"><path d="M0.5 8.372h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M3.5 19.372c7.339 3.726 6.981 3.235 13.265 3.235 2.632 0 3.958 -1.715 4.732 -4.228l0 -0.016 1.907 -6.4 0 -0.012A2 2 0 0 0 21.5 9.372h-4.9a2 2 0 0 1 -1.934 -2.51l0.882 -3.344a1.713 1.713 0 0 0 -3.06 -1.418L7.6 9.025a2 2 0 0 1 -1.634 0.847H3.5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg>`,voteDown:`<svg viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m.5 2.5h2c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1h-2"/><path d="m3.5 15h2.5c.6 0 1.3.3 1.6.8l4.9 6.9c.4.6 1.1.9 1.8.7.9-.2 1.5-1.2 1.2-2.1l-.9-3.3c0-.2 0-.3 0-.5 0-1.1.9-2 2-2h4.9.6c1.1-.3 1.7-1.4 1.3-2.5s-1.9-6.4-1.9-6.4c-.8-2.5-2.1-4.2-4.7-4.2-6.3 0-5.9-.5-13.3 3.2"/></g></svg>`,retry:`
|
|
123
123
|
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
124
124
|
<g stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
125
125
|
<path d="M19.701 5.488a10.063 10.063 0 0 0-7.7-3.573C6.43 1.915 1.914 6.43 1.914 12c0 1.17.2 2.293.565 3.338m1.84 3.199A10.063 10.063 0 0 0 12 22.085c5.57 0 10.085-4.515 10.085-10.085 0-1.224-.218-2.397-.617-3.482" stroke-miterlimit="10"/>
|
|
126
126
|
<path d="M16.802 5.784h3.16v-3.16M7.198 18.216h-3.16v3.16"/>
|
|
127
127
|
</g>
|
|
128
128
|
</svg>
|
|
129
|
-
`,message
|
|
129
|
+
`,message:`<svg viewBox="0 0 24 24"><path d="m12 1.6c-6 0-10.9 4-10.9 9 0 2.5 1.2 4.8 3.2 6.4l-2.3 5.4 6-3.4c1.3.4 2.6.6 3.9.6 6 0 10.9-4 10.9-9s-4.8-9-10.8-9z" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,messageLoading:`<svg viewBox="0 0 24 24" width="24" height="24">
|
|
130
130
|
<circle cx="6" cy="23" r="1.75" fill="currentColor">
|
|
131
131
|
<animate attributeName="opacity" dur="1s" values="0.2;0.8;0.2" repeatCount="indefinite" begin="0s"/>
|
|
132
132
|
</circle>
|
|
@@ -136,7 +136,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
136
136
|
<circle cx="18" cy="23" r="1.75" fill="currentColor">
|
|
137
137
|
<animate attributeName="opacity" dur="1s" values="0.2;0.8;0.2" repeatCount="indefinite" begin="0.6s"/>
|
|
138
138
|
</circle>
|
|
139
|
-
</svg>`,thread
|
|
139
|
+
</svg>`,thread:`<svg viewBox="0 0 24 24"><path d="M9.5 16.5c0 4.288 5 7.5 9.5 5.5l4 1.5 -1.5 -3a4.994 4.994 0 0 0 2 -4c0 -3.154 -3.134 -6 -7 -6s-7 2.846 -7 6Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M17.4 8.5a5.822 5.822 0 0 0 0.1 -1c0 -3.866 -3.8 -7 -8.5 -7S0.5 3.634 0.5 7.5a6.434 6.434 0 0 0 2.517 4.97L1 16l4.939 -1.976a9.993 9.993 0 0 0 1.561 0.361" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg>`,submit:`<svg viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="m12 1v22"/><path d="m4 9 8-8 8 8"/></g></svg>`,abort:`<svg viewBox="0 0 24 24"><g fill="currentColor" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 5h14v14H5z"/></g></svg>`,expand:`<svg viewBox="0 0 24 24"><path d="m22 7-10 10-10-10" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg>`,help:`<svg fill="none" viewBox="0 0 12 12"><path d="M5.04 7.955v-.161c.004-.555.053-.998.148-1.328.099-.33.241-.596.429-.799.187-.203.412-.387.675-.552.197-.127.373-.258.528-.395a1.71 1.71 0 0 0 .371-.452 1.15 1.15 0 0 0 .138-.561c0-.219-.052-.41-.157-.576a1.045 1.045 0 0 0-.423-.38 1.26 1.26 0 0 0-.58-.133c-.207 0-.402.046-.586.138a1.117 1.117 0 0 0-.452.4c-.117.174-.18.39-.19.65H3c.016-.633.168-1.157.457-1.569.288-.416.67-.725 1.146-.928.476-.206 1-.309 1.575-.309.631 0 1.19.105 1.675.314.485.206.865.506 1.141.9.276.392.414.867.414 1.422 0 .37-.062.7-.185.99-.12.285-.29.538-.51.76a3.943 3.943 0 0 1-.775.595c-.25.15-.457.304-.618.466a1.584 1.584 0 0 0-.357.562 2.42 2.42 0 0 0-.119.785v.161H5.041ZM5.984 11c-.317 0-.588-.111-.814-.333a1.095 1.095 0 0 1-.328-.809c-.003-.31.106-.577.328-.799.226-.222.497-.333.814-.333.301 0 .566.111.794.333a1.092 1.092 0 0 1 .181 1.375 1.23 1.23 0 0 1-.414.414 1.081 1.081 0 0 1-.561.152Z" fill="currentColor"/></svg>`,attach:`<svg viewBox="0 0 24 24"><path d="m7.618 15.345 8.666 -8.666a2.039 2.039 0 1 1 2.883 2.883L7.461 21.305a4.078 4.078 0 0 1 -5.767 -5.768L13.928 3.305a5.606 5.606 0 0 1 7.929 7.928L13.192 19.9" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg>`,record:`<svg viewBox="0 0 24 24"><path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" fill="currentColor"/><path d="M19 10v2a7 7 0 0 1-14 0v-2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 19v4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M8 23h8" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>`,reward:`<svg viewBox="0 0 24 24"><path d="M23.5 10.5a1 1 0 0 1 -1 1h-21a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1h21a1 1 0 0 1 1 1Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M21.5 22.5a1 1 0 0 1 -1 1h-17a1 1 0 0 1 -1 -1v-11h19Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="m8.5 7.5 0 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="m15.5 23.5 0 -16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M17.427 3.84C16.663 4.605 13 5.5 13 5.5s0.9 -3.663 1.66 -4.427a1.957 1.957 0 1 1 2.767 2.767Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M6.573 3.84C7.337 4.605 11 5.5 11 5.5s-0.9 -3.663 -1.66 -4.427A1.957 1.957 0 0 0 6.573 3.84Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg>`,share:`<svg viewBox="0 0 24 24"><g><path d="M14.8 12.56a2.25 2.25 0 0 0 3.27 0.1l4.45 -4.45a3.37 3.37 0 0 0 0 -4.76l-2 -2a3.37 3.37 0 0 0 -4.76 0l-4.42 4.48a2.24 2.24 0 0 0 0.1 3.26" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M9.2 11.44a2.26 2.26 0 0 0 -3.27 -0.1l-4.45 4.45a3.37 3.37 0 0 0 0 4.76l2 2a3.37 3.37 0 0 0 4.76 0l4.45 -4.45a2.25 2.25 0 0 0 -0.1 -3.27" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="m7.64 16.36 8.72 -8.72" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></g></svg>`,audio:`<svg viewBox="0 0 24 24"><path d="M5.5 9H2a1.5 1.5 0 0 0 -1.5 1.5v3A1.5 1.5 0 0 0 2 15h3.5l6.147 6.146a0.5 0.5 0 0 0 0.853 -0.353V3.207a0.5 0.5 0 0 0 -0.853 -0.353Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M20 4a10.893 10.893 0 0 1 0 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M17.5 6a7.535 7.535 0 0 1 0 12" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M15.5 8.5c2.677 1.947 2.669 5.06 0 7" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></svg>`,copy:`<svg viewBox="0 0 24 24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M16.4999 5.5V1.50049c0 -0.552286 -0.4477 -1.000002 -1 -1.000002H1.49988C0.947593 0.500488 0.499878 0.948203 0.499878 1.50049V15.5005c0 0.5523 0.447715 1 1.000002 1H5.5" stroke-width="1.5"></path><path stroke="currentColor" stroke-linejoin="round" d="M7.4999 8.49951c0 -0.55228 0.44772 -1 1 -1h14c0.5523 0 1 0.44772 1 1V22.4995c0 0.5523 -0.4477 1 -1 1h-14c-0.55228 0 -1 -0.4477 -1 -1V8.49951Z" stroke-width="1.5"></path></svg>`,dismiss:`<svg viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.5"><path d="m5.743 5.742 12.514 12.514"/><path d="m18.257 5.742-12.514 12.514"/></g></svg>`,menu:`<svg viewBox="0 0 24 24"><g stroke="currentColor" stroke-linecap="round" stroke-width="1.5"><path d="m4 6h16"/><path d="m4 12h16"/><path d="m4 18h16"/></g></svg>`,menuClose:`<svg viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.5"><path d="m5.743 5.742 12.514 12.514"/><path d="m18.257 5.742-12.514 12.514"/></g></svg>`,externalLink:`<svg viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="2"><path d="m18 6-12 12"/><path d="m18 17v-11h-11"/></g></svg>`,internalLink:`<svg viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="2"><path d="m20 12h-17"/><path d="m13 19 7-7-7-7"/></g></svg>`,chevronDown:`<svg viewBox="0 0 24 24"><path d="m20 8-8 8-8-8" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/></svg>`,chevronUp:`<svg viewBox="0 0 24 24"><path d="m20 16-8-8-8 8" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/></svg>`,chevronTopDown:`<svg viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="m19 9-7-7-7 7"/><path d="m19 15-7 7-7-7"/></g></svg>`,chevronDownSmall:`<svg viewBox="0 0 10 10" fill="none"><path d="M8.75 3.75C7.25 5.25 5 7.5 5 7.50L1.25 3.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`,liip:`<svg viewBox="0 0 199 72"><path d="m125.352941.70588235 14.588235 7.05882353-32.705882 63.29411762-14.5882352-7.0588235zm-37.6470586 0 14.3529416 7.05882353-32.7058828 63.29411762-14.5882353-7.0588235zm78.8235296 45.17647055v23.0588236h-16.235294v-64.9411765h26.117647c14.588235 0 22.588235 10.3529412 22.588235 20.9411765 0 10.8235294-7.764706 20.9411764-22.588235 20.9411764zm0-27.5294117v13.1764706h9.17647c4.470589 0 7.058824-3.2941177 7.058824-6.5882353 0-3.2941177-2.588235-6.5882353-7.058824-6.5882353zm-166.11764729-14.3529412h16.23529409v50.8235294h27.7647059v14.1176471h-43.99999999z" fill="currentColor" fill-rule="evenodd"/></svg>`,avatar:`
|
|
140
140
|
<div style="border-radius: 9999px; overflow: hidden;">
|
|
141
141
|
<svg viewBox="0 0 100 100" width="100" height="100" shape-rendering="geometricPrecision" text-rendering="geometricPrecision">
|
|
142
142
|
<style>
|
|
@@ -298,7 +298,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
298
298
|
<circle cx="50" cy="50" r="46" fill="url(#centerGradient)" />
|
|
299
299
|
</svg>
|
|
300
300
|
</div>
|
|
301
|
-
`,avatarLarge
|
|
301
|
+
`,avatarLarge:``,info:`<svg viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.5"><path d="m6.7 8.5c-.1-4.2 5.1-6.6 8.2-4 3.3 2.5 2 8.1-2.1 8.9-.6.1-1.1.7-1.1 1.3v2.2" stroke-linecap="round" stroke-linejoin="round"/><circle cx="11.8" cy="20.6" r=".4"/></g></svg>`,openChat:`<svg viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="2"><path d="m12 4v17"/><path d="m19 11-7-7-7 7"/></g></svg>`,speechInput:`
|
|
302
302
|
<svg width="0" height="0">
|
|
303
303
|
<defs>
|
|
304
304
|
<mask id="microphone-mask" maskUnits="objectBoundingBox" maskContentUnits="objectBoundingBox">
|
|
@@ -397,32 +397,32 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
397
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>
|
|
398
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>
|
|
399
399
|
</svg>
|
|
400
|
-
`,embedAvatar
|
|
400
|
+
`,embedAvatar:``}}},Cg={fineGrained:{light:Sg,dark:xg(Sg,{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)`}}}})}},wg=e=>typeof e==`string`?fh[e]:e,Tg=e=>{let t=wg(e?.colors?.brand||fh.gray),n=wg(e?.colors?.highlight||t),r={0:`#ffffff`,1e3:`#000000`,...wg(e?.colors?.grey||fh.gray)},i;return i=e.avatarImageUrl?`<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));" />`:Cg.fineGrained.light.tokens.svgs.avatar,{fontURLs:e.font?.urls,tokens:{font:{family:e.font?.family},colors:{brand:t,highlight:n,grey:r},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:i}}}},Eg=e=>{let t=Tg(e);return{light:xg(Cg.fineGrained.light,t)}},Dg=e=>{let t={};return e.dark&&(t.dark=xg(Cg.fineGrained.dark,e.dark)),e.light&&(t.light=xg(Cg.fineGrained.light,e.light)),!e.dark&&!e.light&&(t.light=e.light),t},Og={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:`
|
|
401
401
|
<p>
|
|
402
402
|
<strong>Dies ist ein Platzhaltertext, um dem Chatbot Kontext zu geben</strong>
|
|
403
403
|
</p>
|
|
404
404
|
<p>
|
|
405
405
|
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">Weitere Informationen <span class="sr-only">, (öffnet in einem neuen Tab)</span></a>
|
|
406
406
|
</p>
|
|
407
|
-
`,ariaMainNavigation
|
|
407
|
+
`,ariaMainNavigation:`Hauptnavigation`,ariaMainNavigationRegion:`Hauptnavigation: Links, Sprachwechsel, Farbmodus`,ariaGotoMainNavigation:`Zur Hauptnavigation springen`,ariaAskQuestion:`Texteingabe`,ariaAskQuestionRegion:`Stellen Sie eine Frage`,ariaNotifications:`Benachrichtigungen`,ariaPredefinedQuestions:`Vordefinierte Fragen`,ariaPredefinedQuestionsRegion:`Probieren Sie unsere Beispielfragen`,ariaChatHistory:`Chatverlauf`,ariaOpenChat:`Chat öffnen`,ariaQuestionFromYou:`Ihre Frage:`,ariaAnswerFromBot:`Antwort vom Assistenten: `,ariaLastAnswerNavigation:`Navigation und Optionen für die letzte Antwort`,ariaQuestionSent:`Frage gesendet. Antwort wird generiert.`,ariaAnswerReady:`Antwort bereit.`,ariaAnswerFinished:`Antwort abgeschlossen. Stellen Sie eine weitere Frage oder navigieren Sie zurück, um den Chat-Verlauf zu überprüfen, Feedback zu geben oder Referenzen zur Antwort anzuzeigen.`,ariaAskQuestionAgain:`Letzte Frage in das Chat-Eingabefeld kopieren, um sie erneut zu stellen`,ariaAnswerGood:`Diese Antwort als gut bewerten`,ariaAnswerBad:`Diese Antwort als schlecht bewerten`,ariaReferenceSource:`Quelle:`,ariaGiveFeedback:`Detailliertes Feedback zur Antwort geben`,ariaLanguageChanged:`Sprache auf Deutsch geändert.`,ariaLightSelected:`Hellmodus aktiviert.`,ariaDarkSelected:`Dunkelmodus aktiviert.`,ariaSettings:`Chateinstellungen`,ariaSettingsRegion:`Passen Sie Ihre Chat-Präferenzen an`,ariaReferencesRegion:`Referenzen zur aktuellen Frage`,ariaOpensInNewTab:`(öffnet in neuem Tab)`,ariaPageTitle:`Chatbot`,ariaCloseWithEsc:`Diesen Inhalt mit der Escape-Taste schließen`,ariaInfoTitle:`Über diesen Chatbot`,ariaFlyoutRegion:`Chatbot`,ariaSelected:`ausgewählt`,ariaUnselected:`nicht ausgewählt`,ariaAllSelected:`Alle Elemente ausgewählt`,ariaAllUnselected:`Alle Elemente nicht ausgewählt`,ariaAllReseted:`Standardelemente ausgewählt`,hideSettings:`Einstellungen ausblenden`,showSettings:`Einstellungen`,chooseAtLeastOneOption:`Wählen Sie mindestens eine Option`,selectAll:`Alle auswählen`,selectNone:`Alle abwählen`,resetToDefaults:`Zurücksetzen`,messageTooLong:`Ihre Nachricht muss kürzer als {questionLengthLimit} Zeichen sein. Aktuell ist sie {questionLength} Zeichen lang`},en:{askQuestionAgain:`Ask question again`,answerGood:`Good answer`,answerBad:`Bad answer`,chatInputPlaceholder:`Ask me something`,chatInputPlaceholderListening:`I'm listening...`,chatInputSubmit:`Send prompt`,chatInputAbort:`Stop response`,chatInputStartListening:`Start speech recognition`,chatInputStopListening:`Stop speech recognition`,introductionTitle:`I am <span class="liipgpt-gradient-text">LiipGPT</span>. How can I help you out today?`,newChat:`New discussion`,maintenanceModeError:`The chat is currently not available. Please try again later.`,messageBotLoading:`Let me think`,messageBotError:`An error occurred:`,messageBotDefaultError:`Unknown error`,referenceLink:`Link to reference`,referencesDisplay:`Show references`,referencesHide:`Hide references`,referencesTitle:`References`,referencesFurtherTitle:`More references`,chatFooterText:``,scrollToBottom:`Scroll to bottom`,openMenu:`Open menu`,closeMenu:`Close menu`,closeChat:`Close chat`,openInfo:`Open info`,close:`Close`,send:`Send`,thankYouForFeedback:`Thank you for your feedback!`,giveFeedback:`Give feedback`,sendFeedback:`Send feedback`,feedbackFormTitle:`Give feedback to improve our Chatbot`,feedbackFormMessage:`Your message`,feedbackFormMessagePlaceholder:`Write your message here...`,feedbackFormEmail:`E-Mail`,feedbackFormEmailPlaceholder:`Enter your E-Mail`,classificationSubmit:`Submit`,classificationThankYou:`Thank you for your feedback!`,classificationTitle:`Please rate the impact and quality of the answer`,selectLanguage:`Select language`,languageChanged:`Language changed to English.`,selectColorTheme:`Choose color mode`,lightMode:`Light`,darkMode:`Dark`,noResultsFound:`No results found`,aboutThisChat:`
|
|
408
408
|
<p>
|
|
409
409
|
<strong>This is a placeholder text to give context to the chat-bot</strong>
|
|
410
410
|
</p>
|
|
411
411
|
<p>
|
|
412
412
|
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">More information <span class="sr-only">, (opens in a new tab)</span></a>
|
|
413
413
|
</p>
|
|
414
|
-
`,ariaMainNavigation
|
|
414
|
+
`,ariaMainNavigation:`Main navigation`,ariaMainNavigationRegion:`Main navigation: links, language switch, color mode`,ariaGotoMainNavigation:`Go to main navigation`,ariaAskQuestion:`Text input`,ariaAskQuestionRegion:`Ask a question`,ariaNotifications:`Notifications`,ariaPredefinedQuestions:`Predefined Questions`,ariaPredefinedQuestionsRegion:`Try our sample questions`,ariaChatHistory:`Chat history`,ariaOpenChat:`Open chat`,ariaQuestionFromYou:`Your question:`,ariaAnswerFromBot:`Answer from Assistant:`,ariaLastAnswerNavigation:`Navigation and options for the last answer`,ariaQuestionSent:`Question sent. Generating answer...`,ariaAnswerReady:`Answer ready.`,ariaAnswerFinished:`Answer complete. Ask a further question or navigate back to review the chat history, provide feedback, or view references linked to the answer.`,ariaAskQuestionAgain:`Copy the last question into the chat-input to ask it again`,ariaAnswerGood:`Rate this answer as good`,ariaAnswerBad:`Rate this answer as bad`,ariaReferenceSource:`Source:`,ariaGiveFeedback:`Give detailed feedback on the answer`,ariaLanguageChanged:`Language changed to English.`,ariaLightSelected:`Light mode activated.`,ariaDarkSelected:`Dark mode activated.`,ariaSettings:`Chat settings`,ariaSettingsRegion:`Adjust your chat preferences`,ariaReferencesRegion:`References for the current question`,ariaOpensInNewTab:`(opens in new tab)`,ariaPageTitle:`Chatbot`,ariaCloseWithEsc:`Close this content by pressing the Escape key`,ariaInfoTitle:`About this chatbot`,ariaFlyoutRegion:`Chatbot`,ariaSelected:`selected`,ariaUnselected:`unselected`,ariaAllSelected:`All items selected`,ariaAllUnselected:`All items unselected`,ariaAllReseted:`Default items selected`,hideSettings:`Hide settings`,showSettings:`Show settings`,chooseAtLeastOneOption:`Select at least one option`,selectAll:`Select all`,selectNone:`Deselect all`,resetToDefaults:`Reset to defaults`,messageTooLong:`Your message has to be shorter than {questionLengthLimit} characters. Currently it is {questionLength} characters long`},it:{askQuestionAgain:`Chiedi di nuovo`,answerGood:`Risposta buona`,answerBad:`Risposta cattiva`,openButtonTitle:`Hai una domanda?`,openButtonDescription:`Sono LiipGPT. Posso aiutarti con i contenuti di questo sito.`,chatInputPlaceholder:`Chiedimi qualcosa`,chatInputPlaceholderListening:`Sto ascoltando...`,chatInputSubmit:`Invia richiesta`,chatInputAbort:`Interrompi risposta`,chatInputStartListening:`Avvia il riconoscimento vocale`,chatInputStopListening:`Ferma il riconoscimento vocale`,introductionTitle:`Sono <span class="liipgpt-gradient-text">LiipGPT</span>. Come posso aiutarti oggi?`,newChat:`Nuova discussione`,maintenanceModeError:`Il chat è attualmente non disponibile. Per favore riprova più tardi.`,messageBotLoading:`Fammi pensare`,messageBotError:`Si è verificato un errore:`,messageBotDefaultError:`Errore sconosciuto`,referenceLink:`Link alla referenza`,referencesDisplay:`Mostra riferimenti`,referencesHide:`Nascondi riferimenti`,referencesTitle:`Riferimenti`,referencesFurtherTitle:`Più riferimenti`,chatFooterText:``,scrollToBottom:`Scorri verso il basso`,openMenu:`Apri menu`,closeMenu:`Chiudi menu`,closeChat:`Chiudi chat`,openInfo:`Apri info`,close:`Chiudi`,send:`Invia`,thankYouForFeedback:`Grazie per il tuo feedback!`,giveFeedback:`Invia feedback`,sendFeedback:`Invia feedback`,feedbackFormTitle:`Invia feedback per migliorare il nostro Chatbot`,feedbackFormMessage:`Il tuo messaggio`,feedbackFormMessagePlaceholder:`Scrivi qui il tuo messaggio...`,feedbackFormEmail:`E-Mail`,feedbackFormEmailPlaceholder:`Inserisci il tuo E-Mail`,classificationSubmit:`Invia`,classificationThankYou:`Grazie per il tuo feedback!`,classificationTitle:`Valuta l'impatto e la qualità della risposta`,selectLanguage:`Selezionare la lingua`,languageChanged:`Lingua cambiata in italiano.`,selectColorTheme:`Scegli modalità colore`,lightMode:`Chiaro`,darkMode:`Scuro`,noResultsFound:`Nessun risultato trovato`,aboutThisChat:`
|
|
415
415
|
<p>
|
|
416
416
|
<strong>Questo è un testo segnaposto per dare contesto al chatbot</strong>
|
|
417
417
|
</p>
|
|
418
418
|
<p>
|
|
419
419
|
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">Ulteriori informazioni <span class="sr-only">, (apre in una nuova scheda)</span></a>
|
|
420
420
|
</p>
|
|
421
|
-
`,ariaMainNavigation
|
|
421
|
+
`,ariaMainNavigation:`Navigazione principale`,ariaMainNavigationRegion:`Navigazione principale: link, cambio lingua, modalità colore`,ariaGotoMainNavigation:`Vai alla navigazione principale`,ariaAskQuestion:`Input testo`,ariaAskQuestionRegion:`Fai una domanda`,ariaNotifications:`Notifiche`,ariaPredefinedQuestions:`Domande predefinite`,ariaPredefinedQuestionsRegion:`Prova le nostre domande di esempio`,ariaChatHistory:`Cronologia chat`,ariaOpenChat:`Apri chat`,ariaQuestionFromYou:`La tua domanda:`,ariaAnswerFromBot:`Risposta dall'Assistente:`,ariaLastAnswerNavigation:`Navigazione e opzioni per l'ultima risposta`,ariaQuestionSent:`Domanda inviata. Generazione risposta in corso...`,ariaAnswerReady:`Risposta pronta.`,ariaAnswerFinished:`Risposta completata. Fai un'altra domanda o naviga indietro per rivedere la cronologia della chat, fornire feedback o visualizzare i riferimenti collegati alla risposta.`,ariaAskQuestionAgain:`Copia l'ultima domanda nel campo di input della chat per ripeterla`,ariaAnswerGood:`Valuta questa risposta come buona`,ariaAnswerBad:`Valuta questa risposta come cattiva`,ariaReferenceSource:`Fonte:`,ariaGiveFeedback:`Invia feedback dettagliato sulla risposta`,ariaLanguageChanged:`Lingua cambiata in italiano.`,ariaLightSelected:`Modalità chiara attivata.`,ariaDarkSelected:`Modalità scura attivata.`,ariaSettings:`Impostazioni chat`,ariaSettingsRegion:`Personalizza le tue preferenze di chat`,ariaReferencesRegion:`Riferimenti alla domanda corrente`,ariaOpensInNewTab:`(apre in una nuova scheda)`,ariaPageTitle:`Chatbot`,ariaCloseWithEsc:`Chiudere questo contenuto premendo il tasto Escape`,ariaInfoTitle:`Informazioni su questo chatbot`,ariaFlyoutRegion:`Chatbot`,ariaSelected:`selezionato`,ariaUnselected:`non selezionato`,ariaAllSelected:`Tutti gli elementi selezionati`,ariaAllUnselected:`Tutti gli elementi non selezionati`,ariaAllReseted:`Elementi predefiniti selezionati`,hideSettings:`Nascondi impostazioni`,showSettings:`Impostazioni`,chooseAtLeastOneOption:`Seleziona almeno una opzione`,selectAll:`Seleziona tutto`,selectNone:`Deseleziona tutto`,resetToDefaults:`Ripristina predefiniti`,messageTooLong:`Il tuo messaggio deve essere più corto di {questionLengthLimit} caratteri. Attualmente è lungo {questionLength} caratteri`},fr:{askQuestionAgain:`Reposer la question`,answerGood:`Bonne réponse`,answerBad:`Mauvaise réponse`,chatInputPlaceholder:`Posez-moi une question`,chatInputPlaceholderListening:`J'écoute...`,chatInputSubmit:`Envoyer la demande`,chatInputAbort:`Interrompre la réponse`,chatInputStartListening:`Démarrer la reconnaissance vocale`,chatInputStopListening:`Arrêter la reconnaissance vocale`,introductionTitle:`Je suis <span class='liipgpt-gradient-text'>LiipGPT</span>. Comment puis-je vous aider aujourd'hui?`,newChat:`Nouvelle discussion`,maintenanceModeError:`Le chat est actuellement indisponible. Veuillez réessayer plus tard.`,messageBotLoading:`Laissez-moi réfléchir`,messageBotError:`Une erreur est survenue:`,messageBotDefaultError:`Erreur inconnue`,referenceLink:`Lien vers la référence`,referencesDisplay:`Afficher les références`,referencesHide:`Masquer les références`,referencesTitle:`Références`,referencesFurtherTitle:`Plus de références`,chatFooterText:``,scrollToBottom:`Scroller vers le bas`,openMenu:`Ouvrir le menu`,closeMenu:`Fermer le menu`,closeChat:`Fermer le chat`,openInfo:`Ouvrir info`,close:`Fermer`,send:`Envoyer`,thankYouForFeedback:`Merci pour votre feedback!`,giveFeedback:`Donner un feedback`,sendFeedback:`Envoyer un feedback`,feedbackFormTitle:`Donnez un feedback pour améliorer notre Chatbot`,feedbackFormMessage:`Votre message`,feedbackFormMessagePlaceholder:`Écrivez votre message ici...`,feedbackFormEmail:`E-Mail`,feedbackFormEmailPlaceholder:`Entrez votre E-Mail`,classificationSubmit:`Envoyer`,classificationThankYou:`Merci pour votre feedback!`,classificationTitle:`Veuillez évaluer l'impact et la qualité de la réponse`,selectLanguage:`Choisir la langue`,languageChanged:`Langue française sélectionnée.`,selectColorTheme:`Choisir le mode couleur`,lightMode:`Clair`,darkMode:`Sombre`,noResultsFound:`Aucun résultat trouvé`,aboutThisChat:`
|
|
422
422
|
<p>
|
|
423
423
|
<strong>Ceci est un texte d'espace réservé pour donner du contexte au chatbot</strong>
|
|
424
424
|
</p>
|
|
425
425
|
<p>
|
|
426
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 <span class="sr-only">, (ouvre dans un nouvel onglet)</span></a>
|
|
427
427
|
</p>
|
|
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)",ariaPageTitle:"Chatbot",ariaCloseWithEsc:"Fermer ce contenu en appuyant sur la touche Échap",ariaInfoTitle:"À propos de ce chatbot",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(It([]));get toasts(){return y(this.#e)}set toasts(t){L(this.#e,t,!0)}#t=Q(It([]));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 Iu=(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(It({}));get data(){return y(this.#e)}set data(t){L(this.#e,t,!0)}#t=Q(It({}));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,zu;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:Iu(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(Iu(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 zu?.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);zu=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,I1=640,z1=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=I1/r,o=z1/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=(I,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(I,{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 I=>{const Z=await(await fetch(`${I}/chatconfig`)).json();return au.parse(Z)},u=async({forceTheme:I,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=(I,Y)=>{if(I==null)return Y;if(typeof I=="string"){const Z=I.trim().toLowerCase();return!(Z===""||Z==="0"||Z==="false"||Z==="no")}return typeof I=="number"?I!==0:typeof I=="boolean"?I: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(I){L(n,I.colorScheme,!0),D?.(),$e(),L(P,!1);const Y=I.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(I){L(A,I,!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(I){be(),t.onclick?.(I)}let ue=W(()=>u(l).then(async I=>(await fe(I),I)).catch(I=>i()(I)));var jo={get host(){return o()},set host(I){o(I),J()},get onError(){return i()},set onError(I){i(I),J()},get flyoutId(){return a()},set flyoutId(I){a(I),J()},get flyoutIsOpen(){return s()},set flyoutIsOpen(I){s(I),J()}},pe=_t();oh("beforeunload",ai,on),Ah("1k415fq",I=>{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(I,Y)});var Bo=Le(pe);return Hs(Bo,()=>y(ue),I=>{},(I,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(I,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})({});
|
|
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)`,ariaPageTitle:`Chatbot`,ariaCloseWithEsc:`Fermer ce contenu en appuyant sur la touche Échap`,ariaInfoTitle:`À propos de ce chatbot`,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`}},kg=e=>{e??=Og;let t={};return e.de&&(t.de=(0,vg.default)(Og.de,e.de)),e.en&&(t.en=(0,vg.default)(Og.en,e.en)),e.fr&&(t.fr=(0,vg.default)(Og.fr,e.fr)),e.it&&(t.it=(0,vg.default)(Og.it,e.it)),t},Ag=e=>({init:e?.init??[],bot:{before:e?.bot?.before??[],after:e?.bot?.after??[]},user:{before:e?.user?.before??[],after:e?.user?.after??[]}}),jg=e=>{let t;t=e.theme?.fineGrained?Dg(e.theme?.fineGrained):Eg(e?.theme??{});let n=kg(e?.translations),r={...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(n),fullTheme:t,translations:n,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??600,forceConsent:e.forceConsent??!1,askQuestionAgain:e.askQuestionAgain??!1,enableBackdrop:e.enableBackdrop??!1,messageAdditions:Ag(e.messageAdditions??{}),contextVersion:e.contextVersion??0};return e.classification&&(r.classification=e.classification),e.menu&&(r.menu=e.menu),r},Mg={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é.`}},Ng={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`}},Pg=(e,t)=>t.includes(e),Fg=(e,t)=>{if(Pg(e,t))return e;let n=Ig();return Pg(n,t)?n:`en`},Ig=()=>navigator.language.split(`-`)[0],Lg=(e,t)=>{localStorage.setItem(`liipgpt:selectedLanguage`,e),t&&(t.lang=e)},Rg=e=>Fg(localStorage.getItem(`liipgpt:selectedLanguage`),e),zg=s(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),Bg=typeof document<`u`,Vg=0,Hg=class{#e=j(_n([]));get toasts(){return F(this.#e)}set toasts(e){M(this.#e,e,!0)}#t=j(_n([]));get heights(){return F(this.#t)}set heights(e){M(this.#t,e,!0)}#n=e=>{let t=this.toasts.findIndex(t=>t.id===e);return t===-1?null:t};addToast=e=>{Bg&&this.toasts.unshift(e)};updateToast=({id:e,data:t,type:n,message:r})=>{let i=this.toasts.findIndex(t=>t.id===e),a=this.toasts[i];this.toasts[i]={...a,...t,id:e,title:r,type:n,updated:!0}};create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id&&e.id?.length>0?e.id:Vg++,i=e.dismissible===void 0?e.dismissable===void 0?!0:e.dismissable:e.dismissible,a=e.type===void 0?`default`:e.type;return zr(()=>{this.toasts.find(e=>e.id===r)?this.updateToast({id:r,data:e,type:a,message:t,dismissible:i}):this.addToast({...n,id:r,title:t,dismissible:i,type:a})}),r};dismiss=e=>(zr(()=>{if(e===void 0){this.toasts=this.toasts.map(e=>({...e,dismiss:!0}));return}let t=this.toasts.findIndex(t=>t.id===e);this.toasts[t]&&(this.toasts[t]={...this.toasts[t],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}let t=this.#n(e);if(t!==null)return this.toasts.splice(t,1),e};message=(e,t)=>this.create({...t,type:`default`,message:e});error=(e,t)=>this.create({...t,type:`error`,message:e});success=(e,t)=>this.create({...t,type:`success`,message:e});info=(e,t)=>this.create({...t,type:`info`,message:e});warning=(e,t)=>this.create({...t,type:`warning`,message:e});loading=(e,t)=>this.create({...t,type:`loading`,message:e});promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:typeof t.loading==`string`?t.loading:t.loading()}));let r=e instanceof Promise?e:e(),i=n!==void 0;return r.then(e=>{if(typeof e==`object`&&e&&`ok`in e&&typeof e.ok==`boolean`&&!e.ok){i=!1;let t=Ug(e);this.create({id:n,type:`error`,message:t})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?t.success(e):t.success;this.create({id:n,type:`success`,message:r})}}).catch(e=>{if(t.error!==void 0){i=!1;let r=typeof t.error==`function`?t.error(e):t.error;this.create({id:n,type:`error`,message:r})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally?.()}),n};custom=(e,t)=>{let n=t?.id||Vg++;return this.create({component:e,id:n,...t}),n};removeHeight=e=>{this.heights=this.heights.filter(t=>t.toastId!==e)};setHeight=e=>{let t=this.#n(e.toastId);if(t===null){this.heights.push(e);return}this.heights[t]=e};reset=()=>{this.toasts=[],this.heights=[]}};function Ug(e){return e&&typeof e==`object`&&`status`in e?`HTTP error! Status: ${e.status}`:`Error! ${e}`}var Wg=new Hg;function Gg(e,t){return Wg.create({message:e,...t})}var Kg=Object.assign(Gg,{success:Wg.success,info:Wg.info,warning:Wg.warning,error:Wg.error,custom:Wg.custom,message:Wg.message,promise:Wg.promise,dismiss:Wg.dismiss,loading:Wg.loading,getActiveToasts:()=>Wg.toasts.filter(e=>!e.dismiss)}),qg=e=>{let t=new Set;Object.getOwnPropertyNames(e).forEach(e=>t.add(e));let n=Object.getPrototypeOf(e);for(;n&&n!==Object.prototype;)Object.getOwnPropertyNames(n).forEach(e=>t.add(e)),n=Object.getPrototypeOf(n);return Array.from(t)},Jg=(e,t)=>{let n={};return t.forEach(t=>{n[t]=e[t]}),n},Yg=console.warn,Xg=()=>{},Zg=(e,t)=>zr(()=>{console.warn=Xg;let n=it(t?Jg(e,t):e);return console.warn=Yg,n}),Qg=e=>e&&typeof e.then==`function`,$g=class{config;self;devtools;stateKeys;constructor(e,t){this.config=e,this.self=t,typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&(this.stateKeys=qg(this.config.state),this.devtools=window.__REDUX_DEVTOOLS_EXTENSION__.connect({name:this.config.name??`updatelogic`}),this.devtools.init(this.createStateSnapshot()),this.devtools.subscribe(e=>{e.type===`DISPATCH`&&e.state}))}createStateSnapshot(){return Zg(this.config.state,this.stateKeys)}sendStart(e,t){this.devtools.send({type:`→ ${e}`,args:t},this.createStateSnapshot())}sendError(e,t,n){this.devtools.send({type:`❌ ${e}`,args:t,error:n},this.createStateSnapshot())}sendSuccess(e,t,n){this.devtools.send({type:`✓ ${e}`,args:t,return:n},this.createStateSnapshot())}isIncluded(e){return this.config.excludeInDevTools?!this.config.excludeInDevTools.includes(e):!0}createProxyFunction(e,t){let n=this.devtools&&this.isIncluded(e);return typeof t==`function`?(...r)=>{if(!n)return zr(()=>t.call(this.self,...r));let i=Zg(r);this.sendStart(e,i);try{let n=zr(()=>t.call(this.self,...r));return Qg(n)?n.then(t=>(this.sendSuccess(e,i,t),t),t=>{throw this.sendError(e,i,t),t}):(this.sendSuccess(e,i,n),n)}catch(t){throw this.sendError(e,i,t),t}}:t}},e_=(e,t)=>{let n={},r=new $g(e,n);return Object.keys(t).forEach(e=>{if(e===`state`||e===`name`)return;let i=t[e];n[e]=r.createProxyFunction(e,i)}),n},t_=l(zg(),1);async function n_(){if(typeof navigator>`u`||!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return!1;try{return(await navigator.mediaDevices.enumerateDevices()).some(e=>e.kind===`audioinput`)}catch(e){return console.error(`Error checking for microphone:`,e),!1}}function r_(){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 i_(){return typeof window>`u`?!1:!!(window.MediaRecorder&&r_())}var a_=class{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(!i_()||!navigator.mediaDevices){let e=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;let e=r_();if(!e)throw Error(`No supported media type found`);let t={mimeType:e};this.mediaRecorder=new MediaRecorder(this.stream,t),this.audioChunks=[],this.mediaRecorder.ondataavailable=e=>{e.data.size>0&&this.audioChunks.push(e.data)},this.mediaRecorder.onstop=async()=>{let t=this.audioChunks.length>0?new Blob(this.audioChunks,{type:e}):null;await this.options.onDataAvailable?.(t),this.options.onStop?.(),this.cleanup()},this.mediaRecorder.onerror=e=>{let t=Error(`MediaRecorder error: ${e}`);this.options.onError?.(t),this.cleanup()},this.mediaRecorder.start(),this.setupVolumeAnalysis(this.stream),this.options.onStart?.()}catch(e){this.started=!1,this.starting=!1;let t=e instanceof Error?e:Error(String(e));throw this.options.onError?.(t),t}}stop(){this.started=!1,this.starting=!1,this.volumeUpdateInterval&&=(clearInterval(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;let t=this.analyser.frequencyBinCount;this.dataArray=new Uint8Array(t),this.audioContext.createMediaStreamSource(e).connect(this.analyser),this.startVolumeMonitoring()}catch(e){console.warn(`Failed to set up volume analysis:`,e)}}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 t=0;t<this.dataArray.length;t++)e+=this.dataArray[t]*this.dataArray[t];let t=Math.sqrt(e/this.dataArray.length)/255;t=(t*3)**.7;let n=Math.min(100,Math.max(0,Math.round(t*100)));this.options.onVolumeChange?.(n)},100))}get recording(){return this.started&&this.mediaRecorder?.state===`recording`}get isStarting(){return this.starting}stopStream(e){e.getTracks().forEach(e=>e.stop())}cleanup(){this.volumeUpdateInterval&&=(clearInterval(this.volumeUpdateInterval),null),this.audioContext&&=(this.audioContext.close().catch(console.warn),null),this.analyser=null,this.dataArray=null,this.stream&&=(this.stopStream(this.stream),null),this.mediaRecorder=null,this.audioChunks=[],this.started=!1,this.starting=!1}static isSupported(){return i_()}static getSupportedMediaType(){return r_()}},o_=e=>(localStorage.setItem(`liipgpt-color-scheme`,e),c_([`light`,`dark`])),s_=()=>{let e=localStorage.getItem(`liipgpt-color-scheme`);return e===`light`||e===`dark`?e:`system`},c_=e=>{let t=s_();return t===`system`&&(t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`),e.includes(t)?t:e[0]??`light`},l_=`liipgpt:context`,u_=()=>localStorage.getItem(l_),d_=[{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)}],f_=e=>{for(let t of d_)if(t.check(e))return t.type},p_=`liipgpt:selectorValues`,m_=`liipgpt:selectorKnownDefaults`,h_=()=>{try{let e=cg.getItem(p_),t=cg.getItem(m_);return e?{values:JSON.parse(e),knownDefaults:t?JSON.parse(t):{}}:null}catch{return null}},g_=e=>{let t={};for(let n of e)t[n.settingName]=n.defaultValues??(n.allowEmpty?[]:[n.values[0]]).filter(Boolean);return t},__=(e,t)=>{try{let n=g_(t);cg.setItem(p_,JSON.stringify(e)),cg.setItem(m_,JSON.stringify(n))}catch(e){console.error(`Failed to save selector values:`,e)}},v_=e=>{try{let t=h_();if(!t)return;delete t.values[e],delete t.knownDefaults[e],cg.setItem(p_,JSON.stringify(t.values)),cg.setItem(m_,JSON.stringify(t.knownDefaults))}catch(e){console.error(`Failed to clear selector saved state:`,e)}},y_=e=>{let t=h_(),n=e.map(e=>{let n=e.defaultValues??(e.allowEmpty?[]:[e.values[0]]).filter(Boolean);if(!t?.values[e.settingName])return[e.settingName,n];let r=t.values[e.settingName],i=t.knownDefaults[e.settingName]||[],a=r.filter(t=>e.values.includes(t)),o=i.filter(e=>!n.includes(e)),s=a.filter(e=>!o.includes(e)),c=n.filter(e=>!i.includes(e)&&!s.includes(e)),l=[...s,...c];return l.length===0&&!e.allowEmpty?[e.settingName,n]:[e.settingName,l]});return Object.fromEntries(n)},b_=class extends Error{constructor(e){super(e),this.name=`UnreachableError`}},x_=(e,t)=>{let n=new URLSearchParams(window.location.search).get(`q`);return n?{name:`chat-page`,query:n}:e&&!t?{name:`consent-page`}:{name:`start-page`}},S_=e=>e?e.map(e=>({id:tg(),...e})):[],Q=new class{#e=j(_n({}));get data(){return F(this.#e)}set data(e){M(this.#e,e,!0)}#t=j(_n({}));get targets(){return F(this.#t)}set targets(e){M(this.#t,e,!0)}#n=j(!1);get initialized(){return F(this.#n)}set initialized(e){M(this.#n,e,!0)}#r=j(0);get currentAudioVolume(){return F(this.#r)}set currentAudioVolume(e){M(this.#r,e,!0)}ariaLiveMessagesClearingTimeoutDuration=350;#i=j(null);get currentAudioRecorder(){return F(this.#i)}set currentAudioRecorder(e){M(this.#i,e,!0)}#a=j(!1);get isTranscribing(){return F(this.#a)}set isTranscribing(e){M(this.#a,e,!0)}#o=A(()=>{if(!this.initialized)return[];let e=this.data.chatConfig.menu;return e?e[this.data.language]??[]:[]});get menu(){return F(this.#o)}set menu(e){M(this.#o,e)}#s=A(()=>this.initialized?this.data.chatConfig.translations[this.data.language]??{}:{});get t(){return F(this.#s)}set t(e){M(this.#s,e)}#c=A(()=>this.initialized?Mg[this.data.language]??{}:Mg.en??{});get errorTranslations(){return F(this.#c)}set errorTranslations(e){M(this.#c,e)}#l=A(()=>this.initialized?Ng[this.data.language]??{}:Ng.en??{});get piiTranslations(){return F(this.#l)}set piiTranslations(e){M(this.#l,e)}#u=A(()=>this.initialized?this.data.currentColorScheme:`light`);get colorScheme(){return F(this.#u)}set colorScheme(e){M(this.#u,e)}#d=A(()=>this.initialized?this.data.chatConfig.fullTheme[this.data.currentColorScheme]:{});get themeBase(){return F(this.#d)}set themeBase(e){M(this.#d,e)}#f=A(()=>this.themeBase.tokens);get theme(){return F(this.#f)}set theme(e){M(this.#f,e)}#p=A(()=>{if(!this.initialized)return[];let e=[];for(let t of this.data.chatConfig.selectorsConfig)t.allowEmpty||(this.data.selectorValues[t.settingName]||[]).length===0&&e.push(t.settingName);return e});get selectorsWithErrors(){return F(this.#p)}set selectorsWithErrors(e){M(this.#p,e)}},C_,w_,T_;e_({name:`chat-logic`,state:Q,excludeInDevTools:[`onInput`]},{async init(e){w_=e;let t=w_.speechRecognitionApiKey||void 0;C_=new _g({apiUrl:w_.apiUrl,apiKey:w_.apiKey,speechRecognitionApiKey:t,strict:!0});try{let e=await C_.getChatConfig();window.CHAT_CONFIG_OVERRIDE&&Object.assign(e,window.CHAT_CONFIG_OVERRIDE);let t=(await C_.getMetadata()).mode===`maintenance`;t&&this.showErrorToast(`maintenance`);let n=jg(e);w_.inlineLayout!==void 0&&(n.inlineLayout=w_.inlineLayout);let r;r=w_.lang?Fg(w_.lang,n.supportedLanguages):Rg(n.supportedLanguages),Lg(r,Q.targets.mainElement);let i=await this.getPredefinedQuestions(r),a=n.translations[r]?.ariaOpensInNewTab;a&&C_.setNewTabSrText(a);let o=[];if(n.renderKatex){let e=await import(`https://esm.sh/marked-katex-extension@5.1.5`).catch(e=>{console.error(`Couldn't load marked-katex-extension:`,e)});e&&(C_.setMarkedExtensions(e.default({nonStandard:!0,output:`mathml`})),o.push(`https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css`))}let s=Object.keys(n.fullTheme),c=!1;if(n.forceConsent)try{c=cg.getItem(`liipgpt:termsAccepted`)===`true`}catch(e){console.warn(`Failed to load terms acceptance from storage:`,e)}Q.data={currentConversationState:`idle`,chatConfig:n,language:r,predefinedQuestions:i,isInMaintenance:t,history:S_(n.messageAdditions.init),selectedColorScheme:s_(),has2ColorSchemes:s.length===2,currentColorScheme:c_(s),conversationFeedbackId:void 0,conversationFeedbackIsOpen:!1,openedPopup:void 0,props:w_,flyoutIsOpen:!1,questionHasPii:void 0,chatInputValue:``,selectorValues:y_(n.selectorsConfig),selectorsIsOpen:!1,currentReferencesAsideId:void 0,ariaLiveStatusMessage:void 0,ariaLiveStatusMessageClearingTimeout:void 0,wasReferencesAsideClosed:!1,isAsideMobile:!0,route:x_(n.forceConsent??!1,c),additionalStylesheets:o,hasOpenedOverlays:!1,isInlineLayoutContained:!1,termsAccepted:c},window.LIIPGPT_LISTENERS?.route?.(Q.data.route),window.LIIPGPT_LISTENERS?.conversation?.(Q.data.currentConversationState),Q.data.selectorsIsOpen=Q.data.chatConfig.showExpandedSelectors??!1,Q.initialized=!0,this.checkForOpenedPopup(),window.addEventListener(`hashchange`,()=>{this.checkForOpenedPopup()}),this.goto(x_(n.forceConsent??!1,c),!0)}catch(e){throw Kg.error(e instanceof Error?e.message:`Failed to load the chatbot. Please reload the page.`,{duration:1e4,unstyled:!0,classes:{toast:`toast`}}),e}},setTarget(e,t){Q.targets[e]=t},goto(e,t=!1){if(!(!t&&(0,t_.default)(Q.data.route,e)))switch(Q.data.route=e,window.LIIPGPT_LISTENERS?.route?.(e),e.name){case`consent-page`:break;case`start-page`:e.prefill&&(Q.data.chatInputValue=e.prefill);break;case`chat-page`:if(Q.data.chatInputValue=e.query,this.onSubmit(),Q.data.chatConfig.addQueryToUrlParams){let t=new URLSearchParams(window.location.search);t.set(`q`,e.query),history.pushState(null,``,`?${t.toString()}`)}break}},getSelectorConfig(e){let t=Q.data.chatConfig.selectorsConfig.find(t=>t.settingName===e);if(!t)throw Error(`Setting ${e} not found`);return t},getPrettifiedSelectorValues(){let e=Object.entries(Q.data.selectorValues).map(([e,t])=>{let n;try{n=this.getSelectorConfig(e)}catch(t){console.error(`Error getting selector config for ${e}: ${t}`);return}return n.type===`single-select`?[e,t[0]]:[e,t]}).filter(e=>!!e);return Object.fromEntries(e)},setSelectorValue(e,t){let n=this.getSelectorConfig(e);if(!n){console.warn(`Trying to set setting ${e} but it is not defined in the chat config`);return}if(n.type===`single-select`&&t.length>1){console.warn(`Trying to set multiple values for single-select setting ${e}`);return}Q.data.selectorValues[e]=t,__(Q.data.selectorValues,Q.data.chatConfig.selectorsConfig)},resetSelectorToDefaults(e){let t=this.getSelectorConfig(e);if(!t){console.warn(`Trying to reset setting ${e} but it is not defined in the chat config`);return}let n=t.defaultValues??(t.allowEmpty?[]:[t.values[0]]).filter(Boolean);return v_(e),Q.data.selectorValues[e]=n,__(Q.data.selectorValues,Q.data.chatConfig.selectorsConfig),n},async getPredefinedQuestions(e){try{return C_.getPredefinedQuestions({url:window.location.origin+window.location.pathname,language:e})}catch(e){return console.warn(`Failed to load predefined questions:`,e),[]}},setColorScheme(e){Q.data.selectedColorScheme=e,Q.data.currentColorScheme=o_(e),this.setAriaLiveStatusMessage(e===`dark`?Q.t.ariaDarkSelected:Q.t.ariaLightSelected)},async abort(){await T_?.abort()},changeConversationState(e){Q.data.currentConversationState=e,window.LIIPGPT_LISTENERS?.conversation?.(e)},onInput(e){Q.data.chatConfig.blockPII&&(Q.data.questionHasPii=f_(e)),Q.data.chatInputValue=e},onSubmit(e=!1){if(Q.data.questionHasPii){console.warn(`Question contains PII, not submitting:`,Q.data.questionHasPii);return}let t=Q.data.chatConfig.questionPrefix?`${Q.data.chatConfig.questionPrefix} ${Q.data.chatInputValue}`:Q.data.chatInputValue;Q.data.history.push(...S_(Q.data.chatConfig.messageAdditions.user.before)),Q.data.history.push({type:`user`,time:new Date().toISOString(),message:Q.data.chatInputValue}),Q.data.history.push(...S_(Q.data.chatConfig.messageAdditions.user.after));let n=Q.data.history.push(...S_(Q.data.chatConfig.messageAdditions.bot.before));Q.data.history.push({id:`UNRESOLVED`,state:`loading`,errors:[],type:`bot`,time:new Date().toISOString(),message:{markdown:``,html:``,text:``},references:{all:[],used:[],unused:[]}});let r={features:w_.features?w_.features.trim().split(`,`):[`formatting`],onError:e=>{this.showErrorToast(e),window.LIIPGPT_LISTENERS?.error?.(e),(e===`pii-detected`||e===`blocked`)&&this.editLatestQuestion()},lang:Q.data.language,selectorValues:{...this.getPrettifiedSelectorValues(),context:u_()}},i=(e,t)=>{try{let n=new URL(e),r=new URL(t);return n.origin===r.origin&&n.pathname===r.pathname}catch{return!1}},a=Q.data.chatConfig.sendReferrer??`all`;if([`all`,`own`,`location`].includes(a)){let e=a===`location`||Q.data.props.flyout,t;t=e?`${window.location.protocol}//${window.location.host}${window.location.pathname}`:i(document.referrer,window.location.href)?null:document.referrer;let n=a===`own`&&!Q.data.props.flyout&&t&&!t.startsWith(window.location.origin);r.referrer=t&&!n?t:void 0}Q.data.currentConversationId||(Q.data.currentConversationId=C_.createConversationId());let o=C_.chat(Q.data.currentConversationId,t,r);T_=o,Q.data.lastChatResponseId=o.id,Q.data.currentConversationState!==`searching`&&this.changeConversationState(`searching`),this.setAriaLiveStatusMessage(Q.t.ariaQuestionSent);let s=!1,c,l=!!Q.data.currentReferencesAsideId;(e&&l||!e&&Q.data.chatConfig.showReferencesByDefault)&&(Q.data.isAsideMobile||this.openReferencesAside(o.id)),o.subscribe(e=>{if(Q.data.history[n]&&(Q.data.history[n]={question:Q.data.chatInputValue,...e}),Q.data.chatConfig.addRetrievalQuestionToUrlParams&&e.retrievalQuestion){let t=new URLSearchParams(window.location.search);t.get(`search`)!==e.retrievalQuestion&&(t.set(`search`,e.retrievalQuestion),history.replaceState(null,``,`?${t.toString()}`))}Q.data.chatConfig.showReferencesByDefault&&!Q.data.wasReferencesAsideClosed&&Q.data.currentReferencesAsideId!==e.id&&!Q.data.isAsideMobile&&this.openReferencesAside(e.id),e.state===`streaming`&&Q.data.currentConversationState!==`answering`&&this.changeConversationState(`answering`),e.state===`done`&&(this.changeConversationState(`idle`),s||(s=!0,this.setAriaLiveStatusMessage(`${Q.t.ariaAnswerReady} ... ${e.message.text} ... ${Q.t.ariaAnswerFinished}`),Q.data.history.push(...S_(Q.data.chatConfig.messageAdditions.bot.after))),Q.data.currentReferencesAsideId&&Q.data.history[n].references.used.length>0?(clearTimeout(c),c=setTimeout(()=>{this.openReferencesAside(e.id)},100)):this.closeReferencesAside())}),Q.data.chatInputValue=``},async onStartSpeechRecognition(){try{if(!await n_()){this.showErrorToast(`speech-not-supported`);return}if(await navigator.mediaDevices.getUserMedia({audio:!0}),a_.isSupported())Q.data.chatInputValue=``,Q.currentAudioRecorder=new a_({onDataAvailable:async e=>{Q.isTranscribing=!0,await this.handleTranscription(e)},onError:()=>{this.showErrorToast(`speech-microphone-access-denied`),Q.currentAudioRecorder=null,Q.isTranscribing=!1},onVolumeChange:e=>{Q.currentAudioVolume=e}}),Q.currentAudioRecorder.start();else{this.showErrorToast(`speech-not-supported`);return}}catch(e){throw this.showErrorToast(`speech-microphone-access-denied`),Q.currentAudioRecorder=null,Q.isTranscribing=!1,e}},editLatestQuestion(){let e=Q.data.history.findLastIndex(e=>e?.type===`user`);if(e===-1){console.error(`No last user question, available`);return}let t=Q.data.history.splice(e)[0];Q.data.chatInputValue=t.message},onStopSpeechRecognition(){if(Q.currentAudioRecorder){let e=Q.currentAudioRecorder;Q.currentAudioRecorder=null,e.stop()}Q.currentAudioVolume=0},async handleTranscription(e){if(!e){console.warn(`No audio data received`);return}try{let t=await C_.transcribeAudio(e,{lang:Q.data.language});if(t.error){this.showErrorToast(`speech-transcription-failed`);return}if(t.transcript.trim()){if(Q.data.chatConfig.blockPII&&(Q.data.questionHasPii=f_(t.transcript.trim()),Q.data.questionHasPii))return;Q.data.chatInputValue=t.transcript.trim()}else this.showErrorToast(`speech-no-text-detected`)}catch(e){console.error(`Speech transcription error:`,e),this.showErrorToast(`speech-transcription-failed`)}finally{Q.currentAudioRecorder=null,Q.isTranscribing=!1,Q.currentAudioVolume=0}},async onStartConversation(e){await this.abort(),Q.data.history=S_(Q.data.chatConfig.messageAdditions.init),Q.data.currentConversationId=C_.createConversationId(),this.goto({name:`chat-page`,query:e})},async onNewConversation(){if(await this.abort(),Q.data.currentConversationId=void 0,Q.data.currentReferencesAsideId=void 0,Q.data.history=S_(Q.data.chatConfig.messageAdditions.init),Q.data.chatConfig.addQueryToUrlParams){let e=new URLSearchParams(window.location.search);e.delete(`q`),history.pushState(null,``,`?${e.toString()}`)}this.goto({name:`start-page`})},showSuccessToast(e){Kg.success(Q.t[e],{unstyled:!0,duration:3e3,classes:{toast:`toast`}})},showErrorToast(e){Kg.error(Q.errorTranslations[e],{unstyled:!0,duration:3e3,classes:{toast:`toast`}})},async submitFeedback(e){try{let t=Q.data.conversationFeedbackId||Q.data.lastChatResponseId;if(!t)throw new b_(`Tried to give feedback with no id.`);let n=Q.data.history.find(e=>e.type===`bot`&&e.id===t);await C_.feedback(t,n?.question??``,e),setTimeout(()=>{this.showSuccessToast(`thankYouForFeedback`)},500)}catch(e){console.error(`Feedback failed:`,e),this.showErrorToast(`feedback-failed`)}},toggleReferencesAside(e){Q.data.currentReferencesAsideId===e?this.closeReferencesAside():this.openReferencesAside(e)},openReferencesAside(e){Q.data.currentReferencesAsideId=e,this.setOpenOverlay(!0)},closeReferencesAside(){Q.data.currentReferencesAsideId=void 0,Q.data.wasReferencesAsideClosed=!0,this.setOpenOverlay(!1)},setAsideMobile(e){Q.data.isAsideMobile=e},openFlyout(){Q.data.flyoutIsOpen=!0},closeFlyout(){Q.data.flyoutIsOpen=!1},openConversationFeedback(){Q.data.conversationFeedbackIsOpen=!0,this.setOpenOverlay(!0)},openMessageFeedback(e){Q.data.conversationFeedbackId=e},closeFeedback(){Q.data.conversationFeedbackIsOpen=!1,Q.data.conversationFeedbackId=void 0,this.setOpenOverlay(!1)},setOpenOverlay(e){Q.data.hasOpenedOverlays=e},setAriaLiveStatusMessage(e){Q.data.ariaLiveStatusMessage=e,clearTimeout(Q.data.ariaLiveStatusMessageClearingTimeout),Q.data.ariaLiveStatusMessageClearingTimeout=setTimeout(()=>{Q.data.ariaLiveStatusMessage=``},Q.ariaLiveMessagesClearingTimeoutDuration)},closePopup(){window.location.hash=``},checkForOpenedPopup(){let e=window.location.hash.slice(1),t=Q.t.popups?.find(t=>t.hash===e);t?Q.data.openedPopup=t:Q.data.openedPopup=void 0},async thumbs(e,t){try{let n=Q.data.history.find(t=>t.type===`bot`&&t.id===e);t===`up`?await C_.thumbsUp(e,n?.question??``):await C_.thumbsDown(e,n?.question??``),this.showSuccessToast(`thankYouForFeedback`)}catch(e){console.error(`Feedback failed:`,e),this.showErrorToast(`feedback-failed`)}},async onLanguageChange(e){if(Q.data.language=Fg(e,Q.data.chatConfig.supportedLanguages),Lg(Q.data.language,Q.targets.mainElement),Q.data.predefinedQuestions=await this.getPredefinedQuestions(Q.data.language),this.setAriaLiveStatusMessage(Q.t.ariaLanguageChanged),Q.data.chatConfig.reflectLanguageInPath){let e=new URL(window.location.href);e.pathname=`/${Q.data.language}`,window.history.replaceState({},``,e.toString())}},async acceptTerms(){Q.data.termsAccepted=!0;try{cg.setItem(`liipgpt:termsAccepted`,`true`)}catch(e){console.warn(`Failed to save terms acceptance to storage:`,e)}this.closePopup(),await Ir(),this.goto({name:`start-page`})},updateChatInput(e){Q.data.chatInputValue=e}});var E_=`@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}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;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}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{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}: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}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::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{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-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]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}.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}.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)::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 ::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:0 0}.chat-app ::-webkit-scrollbar-thumb{background-color:#0000004d;border-radius:4px;transition:background-color .2s}.chat-app ::-webkit-scrollbar-thumb:hover{background-color:#00000080}.chat-app *{scrollbar-color:#0000004d transparent;scrollbar-width:thin}.chat-app ::-webkit-scrollbar-thumb{visibility:hidden}.chat-app :hover::-webkit-scrollbar-thumb{visibility:visible}.chat-app :active::-webkit-scrollbar-thumb{visibility:visible}.chat-app :focus::-webkit-scrollbar-thumb{visibility:visible}.svg{width:var(--spacer-r-24);height:auto}.svg svg{width:100%;height:auto;display:block;overflow:visible}}@layer utilities{.chat-app :where(.expand-interaction){position:relative}.chat-app :where(.expand-interaction):after{content:"";background-color:#0000;position:absolute;inset:0}.chat-app :where(.sr-only){clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.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,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--default-transition-timing-function)}.chat-app :where(.skip-link){width:0;height:0;color:var(--anchor-color);font-weight:700;font-size:var(--base-font-size-xs);position:absolute;overflow:hidden}.chat-app :where(.skip-link):focus-visible{width:auto;height:auto;position:static}.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){opacity:1;transition-delay:calc(var(--fly-in-delay) + var(--fly-in-id) * var(--fly-in-delay-additional));transition-duration:var(--fly-in-duration);transform:translateY(0)}.chat-app :where(.truncate){text-overflow:ellipsis;white-space:nowrap;display:inline-block;overflow:hidden}.chat-app :where(.line-clamp){-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.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);padding-right:var(--spacer-16);padding-left:var(--spacer-16);margin:0 auto}@container chat-container (width>=640px){.chat-app :where(.container){padding-right:var(--spacer-32);padding-left:var(--spacer-32)}}@container chat-container (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){margin-bottom:var(--spacer-r-24);display:block}.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-type:decimal;list-style-position:outside}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li){padding-left:1em;position:relative}.chat-app :where(.text-container)>:where(ul:not(.no-list-styling))>:where(li):before{content:"•";font-size:.9em;position:absolute;top:0;left:0}.chat-app :where(.text-container)>:where(hr){height:1px;margin:var(--spacer-r-40) 0;background-color:var(--color-grey-700);background-color:var(--hr-color);border:none}.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){border-collapse:collapse;border-spacing:0;-webkit-overflow-scrolling:touch;width:100%;display:block;overflow-x:auto}.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 components{.chat-app{display:contents}.chat-app__container{height:100%;display:flex;overflow:hidden;transform:translateZ(0);container:chat-container/inline-size}.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 (width>=768px){.chat-app__container.chat-app__container--inline-layout-contained{height:100svh;scroll-margin-top:0}}.chat-app__main{overscroll-behavior-x:none;overscroll-behavior-y:contain;background:var(--body-background);scrollbar-gutter:stable;touch-action:pan-y;flex-direction:column;width:100%;height:100%;display:flex;overflow:hidden auto;container:chat-inner-container/inline-size}.chat-app__container--inline-layout .chat-app__main{overscroll-behavior-y:auto}.chat-app__loader-container{z-index:var(--z-index-loader);justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:relative}.chat-app__portals{display:contents}.chat-app__header{z-index:var(--z-index-header);background:var(--body-background);position:sticky;top:0}.chat-app__header--unsticked{position:relative}.chat-app__header-content{--btn-padding-x:var(--btn-padding-y);column-gap:var(--spacer-r-12);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);flex-wrap:wrap;justify-content:flex-end;align-items:center;display:flex;position:relative}.chat-app__header-content>:where(*){z-index:0;pointer-events:auto;position:relative}.chat-app__header-content:after{right:var(--btn-padding-x);bottom:0;left:var(--btn-padding-x);content:"";border-bottom:1px solid #0000;transition:border-color .1s ease-in-out;position:absolute}.chat-app__header-content.has-border:after{border-color:var(--base-line-color)}.chat-app__header-new-conversation{margin-right:auto;position:relative}@container chat-container (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{flex-direction:column;flex-grow:1;width:100%;display:flex;position:relative}.chat-app__page-transition{flex-direction:column;flex-grow:1;width:100%;height:100%;display:flex}.chat-app__aside{--duration-in:.65s;--duration-out:.5s;visibility:hidden;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;flex-grow:1;position:relative;top:0;bottom:0}.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{width:var(--aside-width);overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable;height:100%;position:relative;overflow-y:auto}.chat-app__container--inline-layout .chat-app__aside-container{overscroll-behavior-y:auto}.chat-app__aside-header,.chat-app__sheet-header{z-index:var(--z-index-header);flex-wrap:no-wrap;padding:var(--spacer-12) var(--spacer-12) var(--spacer-12) var(--spacer-24);justify-content:space-between;align-items:center;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);display:flex;position:sticky;top:0}.chat-app__sheet-close{position:relative}.chat-app__sheet-overlay{z-index:var(--z-index-dialog);background:var(--aside-background-overlay);position:fixed;inset:0}.chat-app__sheet-content{z-index:var(--z-index-flyout);width:100%;max-width:var(--aside-width);overscroll-behavior:contain;border-left-width:var(--aside-border-width);border-color:var(--aside-border-color);background:var(--aside-background);scrollbar-gutter:stable;height:100%;position:fixed;top:0;right:0;overflow-y:auto}.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:#0000}.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)}.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;cursor:pointer;flex-direction:row;align-items:flex-end;transition:opacity .15s ease-out;display:flex}.open-button--expanded{opacity:0;pointer-events:none}.open-button__text{margin-right:calc(var(--open-button-avatar-width) * -.5);padding-top:var(--spacer-r-12);padding-right:0;padding-bottom:var(--spacer-r-12);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);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);flex-direction:column;justify-content:center;align-items:flex-start;padding-left:0;display:flex;position:absolute;bottom:50%;right:100%;overflow:hidden;transform:translateY(50%);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__text{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);transform:translateY(0)}.open-button__title{max-width:240px;padding:0 calc(var(--open-button-avatar-width) * .5 + var(--spacer-r-12)) 0 var(--spacer-r-12);white-space:pre;font-weight:700}.open-button__mask{width:0;height:0;transition:width var(--open-button-duration) var(--open-button-delay) var(--open-button-ease), height var(--open-button-duration) var(--open-button-ease);overflow:hidden}.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{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;position:relative}.open-button__avatar{z-index:var(--z-index-local-overlay);width:var(--open-button-avatar-width);height:var(--open-button-avatar-height);border-radius:var(--spacer-r-80);filter:drop-shadow(0 4px 6px #00000026);transition:transform .2s var(--open-button-ease);position:relative;overflow:clip}.open-button:is(:hover,.open-button--programmatic-expand) .open-button__avatar{transform:scale(1.05)}.open-button__link-icon{width:var(--spacer-r-80);height:var(--spacer-r-80);padding:var(--spacer-r-20);color:var(--open-button-color);display:none;position:absolute;right:0}:where(.open-button--standalone){right:var(--spacer-r-16);bottom:var(--spacer-r-16);position:fixed}@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;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;transform:translateY(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";`,D_=RegExp(`([\\p{Ll}\\d])(\\p{Lu})`,`gu`),O_=RegExp(`(\\p{Lu})([\\p{Lu}][\\p{Ll}])`,`gu`),k_=RegExp(`(\\d)(\\p{Ll})`,`gu`),A_=RegExp(`(\\p{L})(\\d)`,`gu`),j_=/[^\p{L}\d]+/giu,M_=`$1\0$2`,N_=``;function P_(e,t){let n=e.trim();n=n.replace(D_,M_).replace(O_,M_),t?.separateNumbers&&(n=n.replace(k_,M_).replace(A_,M_)),n=n.replace(j_,`\0`);let r=0,i=n.length;for(;n.charAt(r)===`\0`;)r++;if(r===i)return[];for(;n.charAt(i-1)===`\0`;)i--;return n.slice(r,i).split(/\0/g)}function F_(e,t){return X_(e,t?.prefixCharacters)+P_(e,t).map(K_(t?.locale)).join(t?.delimiter??` `)}function I_(e,t){let n=X_(e,t?.prefixCharacters),r=K_(t?.locale),i=q_(t?.locale),a=t?.mergeAmbiguousCharacters?J_(r,i):Y_(r,i);return n+P_(e,t).map((e,t)=>t===0?r(e):a(e,t)).join(t?.delimiter??``)}function L_(e,t){let n=X_(e,t?.prefixCharacters),r=K_(t?.locale),i=q_(t?.locale),a=t?.mergeAmbiguousCharacters?J_(r,i):Y_(r,i);return n+P_(e,t).map(a).join(t?.delimiter??``)}function R_(e,t){let n=X_(e,t?.prefixCharacters),r=K_(t?.locale),i=q_(t?.locale);return n+P_(e,t).map(J_(r,i)).join(t?.delimiter??` `)}function z_(e,t){return X_(e,t?.prefixCharacters)+P_(e,t).map(q_(t?.locale)).join(t?.delimiter??`_`)}function B_(e,t){return F_(e,{delimiter:`.`,...t})}function V_(e,t){return F_(e,{delimiter:`-`,...t})}function H_(e,t){return F_(e,{delimiter:`/`,...t})}function U_(e,t){let n=X_(e,t?.prefixCharacters),r=K_(t?.locale),i=J_(r,q_(t?.locale));return n+P_(e,t).map((e,t)=>t===0?i(e):r(e)).join(t?.delimiter??` `)}function W_(e,t){return F_(e,{delimiter:`_`,...t})}function G_(e,t){return R_(e,{delimiter:`-`,...t})}function K_(e){return e===!1?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function q_(e){return e===!1?e=>e.toUpperCase():t=>t.toLocaleUpperCase(e)}function J_(e,t){return n=>`${t(n[0])}${e(n.slice(1))}`}function Y_(e,t){return(n,r)=>{let i=n[0];return(r>0&&i>=`0`&&i<=`9`?`_`+i:t(i))+e(n.slice(1))}}function X_(e,t=N_){let n=``;for(let r=0;r<e.length;r++){let i=e.charAt(r);if(t.includes(i))n+=i;else break}return n}function Z_(e,t){let n=``;for(let r of e)n+=Math.random()>.5?r.toLocaleUpperCase(t):r.toLocaleLowerCase(t);return n}function Q_(e,t){let n=``;for(let r of e){let e=r.toLocaleLowerCase(t);n+=r===e?r.toLocaleUpperCase(t):e}return n}var $_=/\b(?:an?d?|a[st]|because|but|by|en|for|i[fn]|neither|nor|o[fnr]|only|over|per|so|some|tha[tn]|the|to|up|upon|vs?\.?|versus|via|when|with|without|yet)\b/i,ev=/[^\s:–—-]+|./g,tv=/\s/,nv=/.(?=[A-Z]|\..)/,rv=/[A-Za-z0-9\u00C0-\u00FF]/;function iv(e){for(var t=``,n;(n=ev.exec(e))!==null;){var r=n[0],i=n.index;if(!nv.test(r)&&(!$_.test(r)||i===0||i+r.length===e.length)&&(e.charAt(i+r.length)!==`:`||tv.test(e.charAt(i+r.length+1)))){t+=r.replace(rv,function(e){return e.toUpperCase()});continue}t+=r}return t}var av=I_,ov=R_,sv=z_,cv=B_,lv=F_,uv=L_,dv=H_,fv=U_,pv=W_,mv=G_,hv=V_,gv=Z_,_v=Q_,vv=iv,yv=e=>e.toUpperCase(),bv=(e,t)=>e.toLocaleUpperCase(t),xv=e=>e.toLowerCase(),Sv=(e,t)=>e.toLocaleLowerCase(t),Cv=e=>e.charAt(0).toLowerCase()+e.slice(1),wv=e=>e.charAt(0).toUpperCase()+e.slice(1),Tv=e=>e===e.toUpperCase(),Ev=e=>e===e.toLowerCase(),$=class{};$.camel=av,$.capital=ov,$.constant=sv,$.dot=cv,$.kebab=hv,$.lower=xv,$.lowerFirst=Cv,$.localeLower=Sv,$.localeUpper=bv,$.no=lv,$.pascal=uv,$.path=dv,$.sentence=fv,$.snake=pv,$.sponge=gv,$.swap=_v,$.title=vv,$.train=mv,$.upper=yv,$.upperFirst=wv,$.isUpper=Tv,$.isLower=Ev;var Dv=640,Ov=1024,kv=null,Av=()=>{if(kv)return kv;if(!globalThis.document)return 16;let e=globalThis.document.querySelector(`:root`);return kv=Number(getComputedStyle(e).fontSize.slice(0,-2)),kv},jv=({minRem:e,maxRem:t})=>{let n=Av(),r=Dv/n,i=Ov/n,a=(t-e)/(i-r);return`clamp( ${e}rem, ${-r*a+e}rem + ${a*100}cqw, ${t}rem )`},Mv=e=>typeof e==`string`?e:typeof e==`number`?String(e):typeof e==`object`?e.minRem===e.maxRem?`${e.minRem}rem`:jv(e):``,Nv=(e,t,n,r=!1)=>{let i=``;return n.forEach(n=>{let a=t[n];r&&!a&&n===`borderWidth`&&(a=`0px`),r&&!a&&n===`borderColor`&&(a=`transparent`),a&&(i+=`--${hv(e)}-${hv(n)}:${Mv(a)}; `)}),i},Pv=(e,t)=>Object.entries(t).map(([t,n])=>`--${e}-${hv(t)}:${Mv(n)}`).join(`; `)+`; `,Fv=(e,t)=>{let n=``;return n+=Nv(e,t,[`background`,`borderWidth`,`borderColor`,`boxShadow`,`borderRadius`,`color`],!0),t.hover&&(n+=Nv(`${e}-hover`,t.hover,[`background`,`borderWidth`,`borderColor`,`boxShadow`,`color`])),t.focus&&(n+=Nv(`${e}-focus`,t.focus,[`background`,`borderWidth`,`borderColor`,`boxShadow`,`color`])),t.custom&&(n+=Pv(e,t.custom)),n},Iv=(e,t)=>Object.entries(t).map(([t,n])=>`--color-${e}-${t}:${n}`).join(`; `)+`; `,Lv=e=>`--font-family: ${e?.family||`inherit`};`,Rv=e=>`.chat-app {${Lv(e.font)} ${Object.entries(e.colors).map(([e,t])=>Iv(e,t)).join(``)} ${Pv(`base`,e.base)} ${Object.entries(e.components).map(([e,t])=>Fv(hv(e),t)).join(``)}};`,zv=typeof window<`u`?window:{screen:{},navigator:{}},Bv=(zv.matchMedia||(function(){return{matches:!1}})).bind(zv),Vv={get passive(){return!0}},Hv=function(){};zv.addEventListener&&zv.addEventListener(`p`,Hv,Vv),zv.removeEventListener&&zv.removeEventListener(`p`,Hv,!1),`PointerEvent`in zv;var Uv=`ontouchstart`in zv,Wv=`TouchEvent`in zv,Gv=Uv||Wv&&Bv(`(any-pointer: coarse)`).matches,Kv=(zv.navigator.maxTouchPoints||0)>0||Gv,qv=zv.navigator.userAgent||``,Jv=Bv(`(pointer: coarse)`).matches&&/iPad|Macintosh/.test(qv)&&Math.min(zv.screen.width||0,zv.screen.height||0)>=768,Yv=(Bv(`(pointer: coarse)`).matches||!Bv(`(pointer: fine)`).matches&&Uv)&&!/Windows.*Firefox/.test(qv),Xv=Bv(`(any-pointer: fine)`).matches||Bv(`(any-hover: hover)`).matches||Jv||!Uv,Zv=Kv&&(Xv||!Yv)?`hybrid`:Kv?`touchOnly`:`mouseOnly`,Qv=Zv===`mouseOnly`?`mouse`:Zv===`touchOnly`||Yv?`touch`:`mouse`;function $v(e,t){st(t,!0);let n=L(t,`href`,7),r=L(t,`target`,7),i=L(t,`onclick`,7),a=L(t,`className`,23,()=>[]),o=L(t,`isStandalone`,7,!1),s=L(t,`children`,7),c=L(t,`type`,7,`button`),l=L(t,`use`,7),u=L(t,`class`,7),d=Ta(t,[`$$slots`,`$$events`,`$$legacy`,`$$host`,`href`,`target`,`onclick`,`className`,`isStandalone`,`children`,`type`,`use`,`class`]),f=A(()=>n()?`a`:`button`),p=A(()=>[...Array.isArray(a())?a():a()?[a()]:[],...u()?[u()]:[]]),m=()=>({}),h=A(()=>l()??m);var g={get href(){return n()},set href(e){n(e),k()},get target(){return r()},set target(e){r(e),k()},get onclick(){return i()},set onclick(e){i(e),k()},get className(){return a()},set className(e=[]){a(e),k()},get isStandalone(){return o()},set isStandalone(e=!1){o(e),k()},get children(){return s()},set children(e){s(e),k()},get type(){return c()},set type(e=`button`){c(e),k()},get use(){return l()},set use(e){l(e),k()},get class(){return u()},set class(e){u(e),k()}},_=ni();return Vi(kn(_),()=>F(f),!1,(e,t)=>{Wi(e,e=>F(h)?.(e)),va(e,()=>({...d,onclick:n()?void 0:i(),type:n()?void 0:c(),href:n(),role:n()?`link`:`button`,target:n()?r():void 0,class:F(p),[oa]:{"open-button--standalone":o()}}));var a=ni();xi(kn(a),s),I(t,a)}),I(e,_),ct(g)}Na($v,{href:{},target:{},onclick:{},className:{},isStandalone:{},children:{},type:{},use:{},class:{}},[],[],{mode:`open`});function ey(e,t){st(t,!0);let n=L(t,`css`,7),r=Ta(t,[`$$slots`,`$$events`,`$$legacy`,`$$host`,`css`]),i=e=>{Wn(()=>{n()&&(e.innerHTML=n())})};var a={get css(){return n()},set css(e){n(e),k()}},o=ni(),s=kn(o),c=e=>{var t=ni();Vi(kn(t),()=>`style`,!1,(e,t)=>{Wi(e,e=>i?.(e)),va(e,()=>({...r}))}),I(e,t)};return ki(s,e=>{n()&&e(c)}),I(e,o),ct(a)}Na(ey,{css:{}},[],[],{mode:`open`});var ty=ti(`<div class="open-button__title"></div>`),ny=ti(`<div class="open-button__mask"><div class="open-button__description"></div></div>`),ry=ti(`<div class="open-button__text"><!> <!></div>`),iy=ti(`<div class="sr-only"> </div>`),ay=ti(`<!> <div class="svg svg--avatar open-button__avatar" aria-hidden="true"></div>`,1),oy=ti(`<link rel="stylesheet"/>`),sy=ti(`<!> <!>`,1),cy=ti(`<!> <!> <!> <main class="chat-app"><!></main>`,1);function ly(e,t){st(t,!0);let n=(e,n)=>{let r=()=>n?.().chatConfig,i=()=>n?.().language,a=()=>n?.().colorScheme,c=A(()=>{let{openButtonTitle:e,openButtonDescription:t}=r().translations[i()];return{openButtonTitle:e,openButtonDescription:t}}),l=A(()=>r().fullTheme[a()].tokens.svgs),u=A(()=>r().fullTheme[a()]?.tokens.components.openButton?.custom),d=A(()=>!!F(u)?.hideTitleWhenCollapsed);{let n=A(()=>r().buttonHref?void 0:s()?`true`:`false`),i=A(()=>r().buttonHref?void 0:`true`),a=A(()=>r().buttonHref?void 0:o()),u=A(()=>[`open-button`,t.buttonClass,Q.data.flyoutIsOpen?`open-button--expanded`:void 0,F(d)?`open-button--hide-title-when-collapsed`:void 0]);$v(e,{get href(){return r().buttonHref},onclick:me,onmouseenter:fe,onmouseleave:pe,use:oe,get"aria-expanded"(){return F(n)},get"aria-haspopup"(){return F(i)},get"aria-controls"(){return F(a)},get style(){return t.buttonStyle},get className(){return F(u)},get isStandalone(){return F(f)},children:(e,t)=>{var n=ay(),r=kn(n),i=e=>{var t=ry(),n=On(t),r=e=>{var t=ty();Bi(t,()=>F(c).openButtonTitle,!0),Je(t),I(e,t)};ki(n,e=>{F(c).openButtonTitle&&e(r)});var i=An(n,2),a=e=>{var t=ny(),n=On(t);Bi(n,()=>F(c).openButtonDescription,!0),Je(n),Ca(n,e=>M(ee,e),()=>F(ee)),Je(t),Ca(t,e=>M(_,e),()=>F(_)),I(e,t)};ki(i,e=>{F(c).openButtonDescription&&Qv===`mouse`&&e(a)}),Je(t),I(e,t)},a=e=>{var t=iy(),n=On(t,!0);Je(t),Zn(()=>pi(n,Q.t.ariaOpenChat)),I(e,t)};ki(r,e=>{F(c).openButtonTitle||F(c).openButtonDescription?e(i):e(a,-1)});var o=An(r,2);Bi(o,()=>F(l).avatar,!0),Je(o),I(e,n)},$$slots:{default:!0}})}},r=j(`light`),i=L(t,`host`,7),a=L(t,`onError`,7),o=L(t,`flyoutId`,7),s=L(t,`flyoutIsOpen`,7),c=Ta(t,[`$$slots`,`$$events`,`$$legacy`,`$$host`,`host`,`onError`,`flyoutId`,`flyoutIsOpen`]),l=async e=>{let t=await(await fetch(`${e}/chatconfig`)).json();return Kh.parse(t)},u=async({forceTheme:e,lang:t,apiUrl:n})=>{let r=jg(window.CHAT_CONFIG_OVERRIDE?window.CHAT_CONFIG_OVERRIDE:await l(n)),i;i=t?Fg(t,r.supportedLanguages):Rg(r.supportedLanguages);let a=c_(Object.keys(r.fullTheme));return{chatConfig:r,language:i,colorScheme:a}},d=(e,t)=>{if(e==null)return t;if(typeof e==`string`){let t=e.trim().toLowerCase();return!(t===``||t===`0`||t===`false`||t===`no`)}return typeof e==`number`?e!==0:typeof e==`boolean`?e:t},f=A(()=>!!i()),p=j(!1),m=j(!1),h=j(!1),g=j(void 0),_=j(void 0),ee=j(void 0),v=A(()=>F(ee)?.offsetWidth??0),y=A(()=>F(ee)?.offsetHeight??0),b=j(void 0),x=j(!1),te,ne=j(!0);function re(){return F(b)?(clearTimeout(F(b)),M(b,void 0),!0):!1}async function ie(e){M(r,e.colorScheme,!0),te?.(),re(),M(x,!1);let n=e.chatConfig.fullTheme[F(r)]?.tokens.components.openButton?.custom??{},i=n.autoExpandScrollThreshold,a=Number(n.autoCollapseDelay??0),o=Number.isNaN(a)?0:Math.max(0,a),c=d(n.autoExpandOnce,!1),l=(()=>{if(i==null)return 100;if(typeof i==`string`){if(i.trim().toLowerCase()===`none`)return 0;let e=Number(i);return Number.isNaN(e)?100:e}let e=Number(i);return Number.isNaN(e)?100:e})();if(Number.isNaN(l)||l<=0)return;let u=`liipgpt-auto-expand-${t.apiUrl}`,f=!1;if(typeof window<`u`)try{f=window.localStorage.getItem(u)===`true`}catch(e){console.warn(`LiipGPT: unable to read auto-expand flag`,e)}M(h,f,!0);let p=()=>{if(!(window.scrollY/window.innerHeight*100>=l)){M(ne,!0);return}if(!(F(m)||s())&&!(c&&(f||F(h)))&&F(ne)){if(M(ne,!1),M(m,!0),M(h,!0),ue(),c&&typeof window<`u`)try{window.localStorage.setItem(u,`true`)}catch(e){console.warn(`LiipGPT: unable to persist auto-expand flag`,e)}M(b,setTimeout(()=>{F(x)||(de(),M(m,!1)),M(b,void 0)},o),!0)}};window.addEventListener(`scroll`,p,{passive:!0}),l===0&&(await Ir(),p()),te=()=>{window.removeEventListener(`scroll`,p)}}function ae(){re(),M(m,!1),M(x,!1)}function oe(e){M(g,e,!0)}function se(){te?.(),re()}Ci(se);function ce(){!F(ee)||!F(_)||(F(_).style.width=`${F(v)}px`,F(_).style.height=`${F(y)}px`)}function le(){F(_)&&(F(_).style.width=`0`,F(_).style.height=`0`)}function ue(){F(g)&&(F(g).classList.add(`open-button--programmatic-expand`),ce())}function de(){F(g)&&(F(g).classList.remove(`open-button--programmatic-expand`),le())}function fe(){re()&&M(x,!0),ce()}function pe(){re(),F(x)&&(M(m,!1),M(x,!1),F(g)?.classList.remove(`open-button--programmatic-expand`)),F(p)||le()}function me(e){ae(),t.onclick?.(e)}let he=A(()=>u(c).then(async e=>(await ie(e),e)).catch(e=>a()(e)));var ge={get host(){return i()},set host(e){i(e),k()},get onError(){return a()},set onError(e){a(e),k()},get flyoutId(){return o()},set flyoutId(e){o(e),k()},get flyoutIsOpen(){return s()},set flyoutIsOpen(e){s(e),k()}},_e=ni();return Kr(`beforeunload`,bn,se),Hi(`1k415fq`,e=>{var t=ni(),n=kn(t),r=e=>{var t=ni();Oi(kn(t),()=>F(he),null,(e,t)=>{let n=A(()=>F(t).chatConfig.fullTheme[F(t).colorScheme]);var r=sy(),i=kn(r);Pi(i,17,()=>F(n).fontURLs??[],Ai,(e,t)=>{var n=oy();Zn(()=>ga(n,`href`,F(t))),I(e,n)}),ey(An(i,2),{id:`font-css`,get css(){return F(n).fontCSS}}),I(e,r)}),I(e,t)};ki(n,e=>{F(f)&&e(r)}),I(e,t)}),Oi(kn(_e),()=>F(he),e=>{},(e,t)=>{let i=A(()=>F(t).chatConfig.fullTheme[F(r)]);var a=ni(),o=kn(a),s=e=>{var r=cy(),a=kn(r);{let e=A(()=>Rv(F(i).tokens));ey(a,{id:`theme-css`,get css(){return F(e)}})}var o=An(a,2);ey(o,{id:`app-css`,get css(){return E_}});var s=An(o,2);ey(s,{id:`custom-css`,get css(){return F(i).customCSS}});var c=An(s,2);n(On(c),()=>F(t)),Je(c),I(e,r)},c=e=>{n(e,()=>F(t))};ki(o,e=>{F(f)?e(s):e(c,-1)}),I(e,a)}),I(e,_e),ct(ge)}Na(ly,{host:{},onError:{},flyoutId:{},flyoutIsOpen:{}},[],[],{mode:`open`});function uy(e,t){st(t,!0);let n=L(t,`onclick`,7),r=L(t,`buttonClass`,7),i=L(t,`buttonStyle`,7),a=L(t,`apiUrl`,7),o=L(t,`forceTheme`,7),s=L(t,`lang`,7),c=A(()=>({onclick:n(),buttonClass:r(),buttonStyle:i(),apiUrl:a(),forceTheme:o(),lang:s()}));return La(e,{silent:!0,body:(e,n=oe)=>{ly(e,Da({host:t.$$host,get onError(){return n()}},()=>F(c)))},$$slots:{body:!0}}),ct({get onclick(){return n()},set onclick(e){n(e),k()},get buttonClass(){return r()},set buttonClass(e){r(e),k()},get buttonStyle(){return i()},set buttonStyle(e){i(e),k()},get apiUrl(){return a()},set apiUrl(e){a(e),k()},get forceTheme(){return o()},set forceTheme(e){o(e),k()},get lang(){return s()},set lang(e){s(e),k()}})}return customElements.define(`liipgpt-button`,Na(uy,{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`})),e.LiipGPTButton=uy,e})({});
|