@liip/liipgpt 2.5.0 → 2.5.2
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 +1 -1
- package/chat/liipgpt-chat.iife.js +2 -2
- package/config/index.cjs +1 -1
- package/config/index.d.ts +5049 -3239
- package/config/index.js +1 -1
- package/configurator/_app/env.js +1 -1
- package/configurator/_app/immutable/chunks/{BomA0xkn.js → BZmjFxFg.js} +1 -1
- package/configurator/_app/immutable/chunks/{Dk65hsuc.js → DALBk6Bm.js} +3 -3
- package/configurator/_app/immutable/chunks/{DkjsutUp.js → DX0doXAz.js} +1 -1
- package/configurator/_app/immutable/chunks/{g33UHIPf.js → DkPBl_Gh.js} +1 -1
- package/configurator/_app/immutable/chunks/{BgEp-IXK.js → FNScWilK.js} +1 -1
- package/configurator/_app/immutable/chunks/{FW73PcT5.js → hR06g7Jk.js} +1 -1
- package/configurator/_app/immutable/chunks/luKwPOta.js +3 -0
- package/configurator/_app/immutable/chunks/{CXdK-dRV.js → n4x4MhaA.js} +1 -1
- package/configurator/_app/immutable/chunks/{CGt_7eBt.js → u7HOvwmD.js} +1 -1
- package/configurator/_app/immutable/entry/{app.EbRNj2Ex.js → app.C0dyfdgB.js} +2 -2
- package/configurator/_app/immutable/entry/start.YHMf4y74.js +1 -0
- package/configurator/_app/immutable/nodes/{0.DQoGmNN3.js → 0.ClfhFPXe.js} +1 -1
- package/configurator/_app/immutable/nodes/{1.DxaWpt7I.js → 1.QkGgSBCX.js} +1 -1
- package/configurator/_app/immutable/nodes/{2.CgyaBcKr.js → 2.GXBh08PQ.js} +3 -3
- package/configurator/_app/immutable/nodes/{3.BEwp3oml.js → 3.BQtMBo6-.js} +1 -1
- package/configurator/_app/version.json +1 -1
- package/configurator/index.html +6 -6
- package/configurator/sidebar.html +6 -6
- package/index.cjs +1 -1
- package/index.d.ts +19 -9
- package/index.js +1 -1
- package/package.json +1 -1
- package/configurator/_app/immutable/chunks/CVGFiFDF.js +0 -3
- package/configurator/_app/immutable/entry/start.DEh3tu3P.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./NZTpNUN0.js";import{k as Ki,aP as hl,aQ as zu,aR as fl,aC as pl,aS as Bu,aT as gl,ae as zn,ag as Po,ah as Mr,ai as Nr,ak as ml,aj as Uu,an as Oe,ao as zr,am as Gi,au as Zt,G as u,Z as fr,aU as vl,aE as Za,P as De,_ as mi,al as Yi,aV as Oo,aW as Zo,aX as nn,aY as Io,aZ as Hu,a_ as bl,a$ as qu,b0 as Vu,b1 as Wu,as as en,b2 as $r,U as Bn,ap as ju,aq as Ku,ar as Ja,at as wr,b3 as wl,b4 as Gu,ax as Rn,b5 as yl,b6 as Yu,t as ge,b7 as Qu,b8 as Xu,b9 as Zu,ba as vi,bb as Ju,af as xl,bc as $u,bd as ed,be as $a,bf as td,av as Ro,o as fe,aw as Qi,aA as ee,bg as rd,bh as _l,S as kl,bi as nd,bj as od,bk as id,bl as ad,bm as sd,M as jt,bn as ld,bo as cd,bp as ud,bq as dd,aF as es,a0 as ts,i as hd,br as fd,bs as pd,bt as gd,bu as md,bv as vd,bw as bd,bx as Sl,a2 as wd,F as Ce,by as yd,bz as xd,bA as Tl,bB as El,c as ce,p as ue,I as Y,a as V,b as A,d as de,v as f,bC as Un,f as X,e as z,r as N,R as rs,bD as He,bE as Al,s as ne,aI as ht,O,D as Xi,g as Ee,ac as ho,H as D,K as he,Y as Fr,u as Ue,aO as _d,aL as kd,bF as lt,bG as ns,bH as bn,bI as Cl,y as Sd,x as os,B as Td,ab as Pl,L as we,aN as _r,w as Ed,A as Ad,E as Cd,bJ as Pd,N as Od}from"./DC-s52-u.js";import{p,l as bi,a as On,b as Ol,c as Id,s as Ft,r as at}from"./M-YrVFI7.js";import{i as J,b as Br,c as tt,_ as Rd}from"./Buwjqn5O.js";import{i as Do}from"./
|
|
1
|
+
import"./NZTpNUN0.js";import{k as Ki,aP as hl,aQ as zu,aR as fl,aC as pl,aS as Bu,aT as gl,ae as zn,ag as Po,ah as Mr,ai as Nr,ak as ml,aj as Uu,an as Oe,ao as zr,am as Gi,au as Zt,G as u,Z as fr,aU as vl,aE as Za,P as De,_ as mi,al as Yi,aV as Oo,aW as Zo,aX as nn,aY as Io,aZ as Hu,a_ as bl,a$ as qu,b0 as Vu,b1 as Wu,as as en,b2 as $r,U as Bn,ap as ju,aq as Ku,ar as Ja,at as wr,b3 as wl,b4 as Gu,ax as Rn,b5 as yl,b6 as Yu,t as ge,b7 as Qu,b8 as Xu,b9 as Zu,ba as vi,bb as Ju,af as xl,bc as $u,bd as ed,be as $a,bf as td,av as Ro,o as fe,aw as Qi,aA as ee,bg as rd,bh as _l,S as kl,bi as nd,bj as od,bk as id,bl as ad,bm as sd,M as jt,bn as ld,bo as cd,bp as ud,bq as dd,aF as es,a0 as ts,i as hd,br as fd,bs as pd,bt as gd,bu as md,bv as vd,bw as bd,bx as Sl,a2 as wd,F as Ce,by as yd,bz as xd,bA as Tl,bB as El,c as ce,p as ue,I as Y,a as V,b as A,d as de,v as f,bC as Un,f as X,e as z,r as N,R as rs,bD as He,bE as Al,s as ne,aI as ht,O,D as Xi,g as Ee,ac as ho,H as D,K as he,Y as Fr,u as Ue,aO as _d,aL as kd,bF as lt,bG as ns,bH as bn,bI as Cl,y as Sd,x as os,B as Td,ab as Pl,L as we,aN as _r,w as Ed,A as Ad,E as Cd,bJ as Pd,N as Od}from"./DC-s52-u.js";import{p,l as bi,a as On,b as Ol,c as Id,s as Ft,r as at}from"./M-YrVFI7.js";import{i as J,b as Br,c as tt,_ as Rd}from"./Buwjqn5O.js";import{i as Do}from"./hR06g7Jk.js";import{o as qe,s as q,e as Lo,r as ln,a as qt,n as gr,u as Il,l as Dd,b as _t,c as Ld,t as fo,m as wi,d as Qn,f as Nd,g as Rl,i as Fd}from"./n4x4MhaA.js";import{o as No,a as Md}from"./Bu5Euvdy.js";const zd=[];function Bd(t,e=!1){return oo(t,new Map,"",zd)}function oo(t,e,r,n,o=null){if(typeof t=="object"&&t!==null){var i=e.get(t);if(i!==void 0)return i;if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);if(Ki(t)){var a=Array(t.length);e.set(t,a),o!==null&&e.set(o,a);for(var s=0;s<t.length;s+=1){var c=t[s];s in t&&(a[s]=oo(c,e,r,n))}return a}if(hl(t)===zu){a={},e.set(t,a),o!==null&&e.set(o,a);for(var l in t)a[l]=oo(t[l],e,r,n);return a}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function")return oo(t.toJSON(),e,r,n,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return t}}function Ud(){return Symbol(fl)}function Hd(t,e,r){Oe&&zr();var n=t,o=Uu,i,a,s=null,c=pl()?Bu:gl;function l(){i&&Gi(i),s!==null&&(s.lastChild.remove(),n.before(s),s=null),i=a}zn(()=>{if(c(o,o=e())){var d=n,h=ml();h&&(s=document.createDocumentFragment(),s.append(d=Po())),a=Mr(()=>r(d)),h?Nr.add_callback(l):l()}}),Oe&&(n=Zt)}function Cr(t,e){return e}function qd(t,e,r){for(var n=t.items,o=[],i=e.length,a=0;a<i;a++)qu(e[a].e,o,!0);var s=i>0&&o.length===0&&r!==null;if(s){var c=r.parentNode;Vu(c),c.append(r),n.clear(),rr(t,e[0].prev,e[i-1].next)}Wu(o,()=>{for(var l=0;l<i;l++){var d=e[l];s||(n.delete(d.k),rr(t,d.prev,d.next)),nn(d.e,!s)}})}function Jt(t,e,r,n,o,i=null){var a=t,s={flags:e,items:new Map,first:null},c=(e&yl)!==0;if(c){var l=t;a=Oe?en($r(l)):l.appendChild(Po())}Oe&&zr();var d=null,h=!1,g=new Map,b=fr(()=>{var w=r();return Ki(w)?w:w==null?[]:vl(w)}),v,m;function y(){Vd(m,v,s,g,a,o,e,n,r),i!==null&&(v.length===0?d?Yi(d):d=Mr(()=>i(a)):d!==null&&Gi(d,()=>{d=null}))}zn(()=>{m??=Bn,v=u(b);var w=v.length;if(h&&w===0)return;h=w===0;let _=!1;if(Oe){var x=ju(a)===Ku;x!==(w===0)&&(a=Ja(),en(a),wr(!1),_=!0)}if(Oe){for(var k=null,E,P=0;P<w;P++){if(Zt.nodeType===wl&&Zt.data===Gu){a=Zt,_=!0,wr(!1);break}var S=v[P],U=n(S,P);E=yi(Zt,s,k,null,S,U,P,o,e,r),s.items.set(U,E),k=E}w>0&&en(Ja())}if(Oe)w===0&&i&&(d=Mr(()=>i(a)));else if(ml()){var j=new Set,G=Nr;for(P=0;P<w;P+=1){S=v[P],U=n(S,P);var I=s.items.get(U)??g.get(U);I?(e&(Io|Oo))!==0&&Dl(I,S,P,e):(E=yi(null,s,null,null,S,U,P,o,e,r,!0),g.set(U,E)),j.add(U)}for(const[B,W]of s.items)j.has(B)||G.skipped_effects.add(W.e);G.add_callback(y)}else y();_&&wr(!0),u(b)}),Oe&&(a=Zt)}function Vd(t,e,r,n,o,i,a,s,c){var l=(a&Yu)!==0,d=(a&(Io|Oo))!==0,h=e.length,g=r.items,b=r.first,v=b,m,y=null,w,_=[],x=[],k,E,P,S;if(l)for(S=0;S<h;S+=1)k=e[S],E=s(k,S),P=g.get(E),P!==void 0&&(P.a?.measure(),(w??=new Set).add(P));for(S=0;S<h;S+=1){if(k=e[S],E=s(k,S),P=g.get(E),P===void 0){var U=n.get(E);if(U!==void 0){n.delete(E),g.set(E,U);var j=y?y.next:v;rr(r,y,U),rr(r,U,j),Jo(U,j,o),y=U}else{var G=v?v.e.nodes_start:o;y=yi(G,r,y,y===null?r.first:y.next,k,E,S,i,a,c)}g.set(E,y),_=[],x=[],v=y.next;continue}if(d&&Dl(P,k,S,a),(P.e.f&Zo)!==0&&(Yi(P.e),l&&(P.a?.unfix(),(w??=new Set).delete(P))),P!==v){if(m!==void 0&&m.has(P)){if(_.length<x.length){var I=x[0],B;y=I.prev;var W=_[0],M=_[_.length-1];for(B=0;B<_.length;B+=1)Jo(_[B],I,o);for(B=0;B<x.length;B+=1)m.delete(x[B]);rr(r,W.prev,M.next),rr(r,y,W),rr(r,M,I),v=I,y=M,S-=1,_=[],x=[]}else m.delete(P),Jo(P,v,o),rr(r,P.prev,P.next),rr(r,P,y===null?r.first:y.next),rr(r,y,P),y=P;continue}for(_=[],x=[];v!==null&&v.k!==E;)(v.e.f&Zo)===0&&(m??=new Set).add(v),x.push(v),v=v.next;if(v===null)continue;P=v}_.push(P),y=P,v=P.next}if(v!==null||m!==void 0){for(var C=m===void 0?[]:vl(m);v!==null;)(v.e.f&Zo)===0&&C.push(v),v=v.next;var te=C.length;if(te>0){var le=(a&yl)!==0&&h===0?o:null;if(l){for(S=0;S<te;S+=1)C[S].a?.measure();for(S=0;S<te;S+=1)C[S].a?.fix()}qd(r,C,le)}}l&&Rn(()=>{if(w!==void 0)for(P of w)P.a?.apply()}),t.first=r.first&&r.first.e,t.last=y&&y.e;for(var oe of n.values())nn(oe.e);n.clear()}function Dl(t,e,r,n){(n&Io)!==0&&Za(t.v,e),(n&Oo)!==0?Za(t.i,r):t.i=r}function yi(t,e,r,n,o,i,a,s,c,l,d){var h=(c&Io)!==0,g=(c&Hu)===0,b=h?g?De(o,!1,!1):mi(o):o,v=(c&Oo)===0?a:mi(a),m={i:v,v:b,k:i,a:null,e:null,prev:r,next:n};try{if(t===null){var y=document.createDocumentFragment();y.append(t=Po())}return m.e=Mr(()=>s(t,b,v,l),Oe),m.e.prev=r&&r.e,m.e.next=n&&n.e,r===null?d||(e.first=m):(r.next=m,r.e.next=m.e),n!==null&&(n.prev=m,n.e.prev=m.e),m}finally{}}function Jo(t,e,r){for(var n=t.next?t.next.e.nodes_start:r,o=e?e.e.nodes_start:r,i=t.e.nodes_start;i!==null&&i!==n;){var a=bl(i);o.before(i),i=a}}function rr(t,e,r){e===null?t.first=r:(e.next=r,e.e.next=r&&r.e),r!==null&&(r.prev=e,r.e.prev=e&&e.e)}function Pr(t,e,r=!1,n=!1,o=!1){var i=t,a="";ge(()=>{var s=Bn;if(a===(a=e()??"")){Oe&&zr();return}if(s.nodes_start!==null&&(Qu(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),a!==""){if(Oe){Zt.data;for(var c=zr(),l=c;c!==null&&(c.nodeType!==wl||c.data!=="");)l=c,c=bl(c);if(c===null)throw Xu(),Zu;vi(Zt,l),i=en(c);return}var d=a+"";r?d=`<svg>${d}</svg>`:n&&(d=`<math>${d}</math>`);var h=Ju(d);if((r||n)&&(h=$r(h)),vi($r(h),h.lastChild),r||n)for(;$r(h);)i.before($r(h));else i.before(h)}})}function nr(t,e,r,n,o){Oe&&zr();var i=e.$$slots?.[r],a=!1;i===!0&&(i=e[r==="default"?"children":r],a=!0),i===void 0?o!==null&&o(t):i(t,a?()=>n:n)}function Ll(t,e,r,n,o,i){let a=Oe;Oe&&zr();var s,c,l=null;Oe&&Zt.nodeType===ed&&(l=Zt,zr());var d=Oe?Zt:t,h;zn(()=>{const g=e()||null;var b=g==="svg"?$u:null;g!==s&&(h&&(g===null?Gi(h,()=>{h=null,c=null}):g===c?Yi(h):(nn(h),$a(!1))),g&&g!==c&&(h=Mr(()=>{if(l=Oe?l:b?document.createElementNS(b,g):document.createElement(g),vi(l,l),n){Oe&&td(g)&&l.append(document.createComment(""));var v=Oe?$r(l):l.appendChild(Po());Oe&&(v===null?wr(!1):en(v)),n(l,v)}Bn.nodes_end=l,d.before(l)})),s=g,s&&(c=s),$a(!0))},xl),a&&(wr(!0),en(d))}function Fo(t,e){Rn(()=>{var r=t.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+e.hash)){const o=document.createElement("style");o.id=e.hash,o.textContent=e.code,n.appendChild(o)}})}function St(t,e,r){Ro(()=>{var n=fe(()=>e(t,r?.())||{});if(r&&n?.update){var o=!1,i={};Qi(()=>{var a=r();ee(a),o&&gl(i,a)&&(i=a,n.update(a))}),o=!0}if(n?.destroy)return()=>n.destroy()})}function Wd(t,e){var r=void 0,n;zn(()=>{r!==(r=e())&&(n&&(nn(n),n=null),r&&(n=Mr(()=>{Ro(()=>r(t))})))})}function Nl(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(r=Nl(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function io(){for(var t,e,r=0,n="",o=arguments.length;r<o;r++)(t=arguments[r])&&(e=Nl(t))&&(n&&(n+=" "),n+=e);return n}function Ar(t){return typeof t=="object"?io(t):t??""}const is=[...`
|
|
2
2
|
\r\f \v\uFEFF`];function jd(t,e,r){var n=t==null?"":""+t;if(e&&(n=n?n+" "+e:e),r){for(var o in 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||is.includes(n[a-1]))&&(s===n.length||is.includes(n[s]))?n=(a===0?"":n.substring(0,a))+n.substring(s+1):a=s}}return n===""?null:n}function as(t,e=!1){var r=e?" !important;":";",n="";for(var o in t){var i=t[o];i!=null&&i!==""&&(n+=" "+o+": "+i+r)}return n}function $o(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Kd(t,e){if(e){var r="",n,o;if(Array.isArray(e)?(n=e[0],o=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,a=0,s=!1,c=[];n&&c.push(...Object.keys(n).map($o)),o&&c.push(...Object.keys(o).map($o));var l=0,d=-1;const m=t.length;for(var h=0;h<m;h++){var g=t[h];if(s?g==="/"&&t[h-1]==="*"&&(s=!1):i?i===g&&(i=!1):g==="/"&&t[h+1]==="*"?s=!0:g==='"'||g==="'"?i=g:g==="("?a++:g===")"&&a--,!s&&i===!1&&a===0){if(g===":"&&d===-1)d=h;else if(g===";"||h===m-1){if(d!==-1){var b=$o(t.substring(l,d).trim());if(!c.includes(b)){g!==";"&&h++;var v=t.substring(l,h).trim();r+=" "+v+";"}}l=h+1,d=-1}}}}return n&&(r+=as(n)),o&&(r+=as(o,!0)),r=r.trim(),r===""?null:r}return t==null?null:String(t)}function rt(t,e,r,n,o,i){var a=t.__className;if(Oe||a!==r||a===void 0){var s=jd(r,n,i);(!Oe||s!==t.getAttribute("class"))&&(s==null?t.removeAttribute("class"):e?t.className=s:t.setAttribute("class",s)),t.__className=r}else if(i&&o!==i)for(var c in i){var l=!!i[c];(o==null||l!==!!o[c])&&t.classList.toggle(c,l)}return i}function ei(t,e={},r,n){for(var o in r){var i=r[o];e[o]!==i&&(r[o]==null?t.style.removeProperty(o):t.style.setProperty(o,i,n))}}function ao(t,e,r,n){var o=t.__style;if(Oe||o!==e){var i=Kd(e,n);(!Oe||i!==t.getAttribute("style"))&&(i==null?t.removeAttribute("style"):t.style.cssText=i),t.__style=e}else n&&(Array.isArray(n)?(ei(t,r?.[0],n[0]),ei(t,r?.[1],n[1],"important")):ei(t,r,n));return n}function xi(t,e,r=!1){if(t.multiple){if(e==null)return;if(!Ki(e))return rd();for(var n of t.options)n.selected=e.includes(ss(n));return}for(n of t.options){var o=ss(n);if(_l(o,e)){n.selected=!0;return}}(!r||e!==void 0)&&(t.selectedIndex=-1)}function Gd(t){var e=new MutationObserver(()=>{xi(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),kl(()=>{e.disconnect()})}function ss(t){return"__value"in t?t.__value:t.value}const Xr=Symbol("class"),Zr=Symbol("style"),Fl=Symbol("is custom element"),Ml=Symbol("is html");function Dn(t){if(Oe){var e=!1,r=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var n=t.value;pe(t,"value",null),t.value=n}if(t.hasAttribute("checked")){var o=t.checked;pe(t,"checked",null),t.checked=o}}};t.__on_r=r,ud(r),dd()}}function Yd(t,e){var r=Mo(t);r.value===(r.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!=="PROGRESS")||(t.value=e??"")}function Tw(t,e){var r=Mo(t);r.checked!==(r.checked=e??void 0)&&(t.checked=e)}function Qd(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function pe(t,e,r,n){var o=Mo(t);Oe&&(o[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||o[e]!==(o[e]=r)&&(e==="loading"&&(t[nd]=r),r==null?t.removeAttribute(e):typeof r!="string"&&Zi(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function Ew(t,e,r){var n=hd,o=Bn;let i=Oe;Oe&&wr(!1),es(null),ts(null);try{e!=="style"&&(_i.has(t.nodeName)||!customElements||customElements.get(t.tagName.toLowerCase())?Zi(t).includes(e):r&&typeof r=="object")?t[e]=r:pe(t,e,r==null?r:String(r))}finally{es(n),ts(o),i&&wr(!0)}}function Xd(t,e,r,n,o=!1){var i=Mo(t),a=i[Fl],s=!i[Ml];let c=Oe&&a;c&&wr(!1);var l=e||{},d=t.tagName==="OPTION";for(var h in e)h in r||(r[h]=null);r.class?r.class=Ar(r.class):(n||r[Xr])&&(r.class=null),r[Zr]&&(r.style??=null);var g=Zi(t);for(const x in r){let k=r[x];if(d&&x==="value"&&k==null){t.value=t.__value="",l[x]=k;continue}if(x==="class"){var b=t.namespaceURI==="http://www.w3.org/1999/xhtml";rt(t,b,k,n,e?.[Xr],r[Xr]),l[x]=k,l[Xr]=r[Xr];continue}if(x==="style"){ao(t,k,e?.[Zr],r[Zr]),l[x]=k,l[Zr]=r[Zr];continue}var v=l[x];if(!(k===v&&!(k===void 0&&t.hasAttribute(x)))){l[x]=k;var m=x[0]+x[1];if(m!=="$$")if(m==="on"){const E={},P="$$"+x;let S=x.slice(2);var y=fd(S);if(ad(S)&&(S=S.slice(0,-7),E.capture=!0),!y&&v){if(k!=null)continue;t.removeEventListener(S,l[P],E),l[P]=null}if(k!=null)if(y)t[`__${S}`]=k,jt([S]);else{let U=function(j){l[x].call(this,j)};l[P]=sd(S,t,U,E)}else y&&(t[`__${S}`]=void 0)}else if(x==="style")pe(t,x,k);else if(x==="autofocus")ld(t,!!k);else if(!a&&(x==="__value"||x==="value"&&k!=null))t.value=t.__value=k;else if(x==="selected"&&d)Qd(t,k);else{var w=x;s||(w=cd(w));var _=w==="defaultValue"||w==="defaultChecked";if(k==null&&!a&&!_)if(i[x]=null,w==="value"||w==="checked"){let E=t;const P=e===void 0;if(w==="value"){let S=E.defaultValue;E.removeAttribute(w),E.defaultValue=S,E.value=E.__value=P?S:null}else{let S=E.defaultChecked;E.removeAttribute(w),E.defaultChecked=S,E.checked=P?S:!1}}else t.removeAttribute(x);else _||g.includes(w)&&(a||typeof k!="string")?t[w]=k:typeof k!="function"&&pe(t,w,k)}}}return c&&wr(!0),l}function We(t,e,r=[],n=[],o,i=!1){id(r,n,a=>{var s=void 0,c={},l=t.nodeName==="SELECT",d=!1;if(zn(()=>{var g=e(...a.map(u)),b=Xd(t,s,g,o,i);d&&l&&"value"in g&&xi(t,g.value);for(let m of Object.getOwnPropertySymbols(c))g[m]||nn(c[m]);for(let m of Object.getOwnPropertySymbols(g)){var v=g[m];m.description===fl&&(!s||v!==s[m])&&(c[m]&&nn(c[m]),c[m]=Mr(()=>Wd(t,()=>v))),b[m]=v}s=b}),l){var h=t;Ro(()=>{xi(h,s.value,!0),Gd(h)})}d=!0})}function Mo(t){return t.__attributes??={[Fl]:t.nodeName.includes("-"),[Ml]:t.namespaceURI===od}}var _i=new Map;function Zi(t){var e=_i.get(t.nodeName);if(e)return e;_i.set(t.nodeName,e=[]);for(var r,n=t,o=Element.prototype;o!==n;){r=pd(n);for(var i in r)r[i].set&&e.push(i);n=hl(n)}return e}const Zd=()=>performance.now(),mr={tick:t=>requestAnimationFrame(t),now:()=>Zd(),tasks:new Set};function zl(){const t=mr.now();mr.tasks.forEach(e=>{e.c(t)||(mr.tasks.delete(e),e.f())}),mr.tasks.size!==0&&mr.tick(zl)}function Jd(t){let e;return mr.tasks.size===0&&mr.tick(zl),{promise:new Promise(r=>{mr.tasks.add(e={c:t,f:r})}),abort(){mr.tasks.delete(e)}}}function Xn(t,e){Sl(()=>{t.dispatchEvent(new CustomEvent(e))})}function $d(t){if(t==="float")return"cssFloat";if(t==="offset")return"cssOffset";if(t.startsWith("--"))return t;const e=t.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("")}function ls(t){const e={},r=t.split(";");for(const n of r){const[o,i]=n.split(":");if(!o||i===void 0)break;const a=$d(o.trim());e[a]=i.trim()}return e}const eh=t=>t;function It(t,e,r,n){var o=(t&yd)!==0,i=(t&xd)!==0,a=o&&i,s=(t&bd)!==0,c=a?"both":o?"in":"out",l,d=e.inert,h=e.style.overflow,g,b;function v(){return Sl(()=>l??=r()(e,n?.()??{},{direction:c}))}var m={is_global:s,in(){if(e.inert=d,!o){b?.abort(),b?.reset?.();return}i||g?.abort(),Xn(e,"introstart"),g=ki(e,v(),b,1,()=>{Xn(e,"introend"),g?.abort(),g=l=void 0,e.style.overflow=h})},out(x){if(!i){x?.(),l=void 0;return}e.inert=!0,Xn(e,"outrostart"),b=ki(e,v(),g,0,()=>{Xn(e,"outroend"),x?.()})},stop:()=>{g?.abort(),b?.abort()}},y=Bn;if((y.transitions??=[]).push(m),o&&gd){var w=s;if(!w){for(var _=y.parent;_&&(_.f&xl)!==0;)for(;(_=_.parent)&&(_.f&md)===0;);w=!_||(_.f&vd)!==0}w&&Ro(()=>{fe(()=>m.in())})}}function ki(t,e,r,n,o){var i=n===1;if(wd(e)){var a,s=!1;return Rn(()=>{if(!s){var y=e({direction:i?"in":"out"});a=ki(t,y,r,n,o)}}),{abort:()=>{s=!0,a?.abort()},deactivate:()=>a.deactivate(),reset:()=>a.reset(),t:()=>a.t()}}if(r?.deactivate(),!e?.duration)return o(),{abort:Ce,deactivate:Ce,reset:Ce,t:()=>n};const{delay:c=0,css:l,tick:d,easing:h=eh}=e;var g=[];if(i&&r===void 0&&(d&&d(0,1),l)){var b=ls(l(0,1));g.push(b,b)}var v=()=>1-n,m=t.animate(g,{duration:c,fill:"forwards"});return m.onfinish=()=>{m.cancel();var y=r?.t()??1-n;r?.abort();var w=n-y,_=e.duration*Math.abs(w),x=[];if(_>0){var k=!1;if(l)for(var E=Math.ceil(_/16.666666666666668),P=0;P<=E;P+=1){var S=y+w*h(P/E),U=ls(l(S,1-S));x.push(U),k||=U.overflow==="hidden"}k&&(t.style.overflow="hidden"),v=()=>{var j=m.currentTime;return y+w*h(j/_)},d&&Jd(()=>{if(m.playState!=="running")return!1;var j=v();return d(j,1-j),!0})}m=t.animate(x,{duration:_,fill:"forwards"}),m.onfinish=()=>{v=()=>n,d?.(n,1-n),o()}},{abort:()=>{m&&(m.cancel(),m.effect=null,m.onfinish=Ce)},deactivate:()=>{o=Ce},reset:()=>{n===0&&d?.(1,0)},t:()=>v()}}function th(t,e,r=e){var n=pl(),o=new WeakSet;Tl(t,"input",i=>{var a=i?t.defaultValue:t.value;if(a=ri(t)?ni(a):a,r(a),Nr!==null&&o.add(Nr),n&&a!==(a=e())){var s=t.selectionStart,c=t.selectionEnd;t.value=a??"",c!==null&&(t.selectionStart=s,t.selectionEnd=Math.min(c,t.value.length))}}),(Oe&&t.defaultValue!==t.value||fe(e)==null&&t.value)&&(r(ri(t)?ni(t.value):t.value),Nr!==null&&o.add(Nr)),Qi(()=>{var i=e();t===document.activeElement&&o.has(Nr)||ri(t)&&i===ni(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i??"")})}const ti=new Set;function cs(t,e,r,n,o=n){var i=r.getAttribute("type")==="checkbox",a=t;let s=!1;if(e!==null)for(var c of e)a=a[c]??=[];a.push(r),Tl(r,"change",()=>{var l=r.__value;i&&(l=us(a,l,r.checked)),o(l)},()=>o(i?[]:null)),Qi(()=>{var l=n();if(Oe&&r.defaultChecked!==r.checked){s=!0;return}i?(l=l||[],r.checked=l.includes(r.__value)):r.checked=_l(r.__value,l)}),kl(()=>{var l=a.indexOf(r);l!==-1&&a.splice(l,1)}),ti.has(a)||(ti.add(a),Rn(()=>{a.sort((l,d)=>l.compareDocumentPosition(d)===4?-1:1),ti.delete(a)})),Rn(()=>{if(s){var l;if(i)l=us(a,l,r.checked);else{var d=a.find(h=>h.checked);l=d?.__value}o(l)}})}function us(t,e,r){for(var n=new Set,o=0;o<t.length;o+=1)t[o].checked&&n.add(t[o].__value);return r||n.delete(e),Array.from(n)}function ri(t){var e=t.type;return e==="number"||e==="range"}function ni(t){return t===""?null:+t}var Si={inherit:"inherit",current:"currentcolor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"oklch(98.4% 0.003 247.858)",100:"oklch(96.8% 0.007 247.896)",200:"oklch(92.9% 0.013 255.508)",300:"oklch(86.9% 0.022 252.894)",400:"oklch(70.4% 0.04 256.788)",500:"oklch(55.4% 0.046 257.417)",600:"oklch(44.6% 0.043 257.281)",700:"oklch(37.2% 0.044 257.287)",800:"oklch(27.9% 0.041 260.031)",900:"oklch(20.8% 0.042 265.755)",950:"oklch(12.9% 0.042 264.695)"},gray:{50:"oklch(98.5% 0.002 247.839)",100:"oklch(96.7% 0.003 264.542)",200:"oklch(92.8% 0.006 264.531)",300:"oklch(87.2% 0.01 258.338)",400:"oklch(70.7% 0.022 261.325)",500:"oklch(55.1% 0.027 264.364)",600:"oklch(44.6% 0.03 256.802)",700:"oklch(37.3% 0.034 259.733)",800:"oklch(27.8% 0.033 256.848)",900:"oklch(21% 0.034 264.665)",950:"oklch(13% 0.028 261.692)"},zinc:{50:"oklch(98.5% 0 0)",100:"oklch(96.7% 0.001 286.375)",200:"oklch(92% 0.004 286.32)",300:"oklch(87.1% 0.006 286.286)",400:"oklch(70.5% 0.015 286.067)",500:"oklch(55.2% 0.016 285.938)",600:"oklch(44.2% 0.017 285.786)",700:"oklch(37% 0.013 285.805)",800:"oklch(27.4% 0.006 286.033)",900:"oklch(21% 0.006 285.885)",950:"oklch(14.1% 0.005 285.823)"},neutral:{50:"oklch(98.5% 0 0)",100:"oklch(97% 0 0)",200:"oklch(92.2% 0 0)",300:"oklch(87% 0 0)",400:"oklch(70.8% 0 0)",500:"oklch(55.6% 0 0)",600:"oklch(43.9% 0 0)",700:"oklch(37.1% 0 0)",800:"oklch(26.9% 0 0)",900:"oklch(20.5% 0 0)",950:"oklch(14.5% 0 0)"},stone:{50:"oklch(98.5% 0.001 106.423)",100:"oklch(97% 0.001 106.424)",200:"oklch(92.3% 0.003 48.717)",300:"oklch(86.9% 0.005 56.366)",400:"oklch(70.9% 0.01 56.259)",500:"oklch(55.3% 0.013 58.071)",600:"oklch(44.4% 0.011 73.639)",700:"oklch(37.4% 0.01 67.558)",800:"oklch(26.8% 0.007 34.298)",900:"oklch(21.6% 0.006 56.043)",950:"oklch(14.7% 0.004 49.25)"},red:{50:"oklch(97.1% 0.013 17.38)",100:"oklch(93.6% 0.032 17.717)",200:"oklch(88.5% 0.062 18.334)",300:"oklch(80.8% 0.114 19.571)",400:"oklch(70.4% 0.191 22.216)",500:"oklch(63.7% 0.237 25.331)",600:"oklch(57.7% 0.245 27.325)",700:"oklch(50.5% 0.213 27.518)",800:"oklch(44.4% 0.177 26.899)",900:"oklch(39.6% 0.141 25.723)",950:"oklch(25.8% 0.092 26.042)"},orange:{50:"oklch(98% 0.016 73.684)",100:"oklch(95.4% 0.038 75.164)",200:"oklch(90.1% 0.076 70.697)",300:"oklch(83.7% 0.128 66.29)",400:"oklch(75% 0.183 55.934)",500:"oklch(70.5% 0.213 47.604)",600:"oklch(64.6% 0.222 41.116)",700:"oklch(55.3% 0.195 38.402)",800:"oklch(47% 0.157 37.304)",900:"oklch(40.8% 0.123 38.172)",950:"oklch(26.6% 0.079 36.259)"},amber:{50:"oklch(98.7% 0.022 95.277)",100:"oklch(96.2% 0.059 95.617)",200:"oklch(92.4% 0.12 95.746)",300:"oklch(87.9% 0.169 91.605)",400:"oklch(82.8% 0.189 84.429)",500:"oklch(76.9% 0.188 70.08)",600:"oklch(66.6% 0.179 58.318)",700:"oklch(55.5% 0.163 48.998)",800:"oklch(47.3% 0.137 46.201)",900:"oklch(41.4% 0.112 45.904)",950:"oklch(27.9% 0.077 45.635)"},yellow:{50:"oklch(98.7% 0.026 102.212)",100:"oklch(97.3% 0.071 103.193)",200:"oklch(94.5% 0.129 101.54)",300:"oklch(90.5% 0.182 98.111)",400:"oklch(85.2% 0.199 91.936)",500:"oklch(79.5% 0.184 86.047)",600:"oklch(68.1% 0.162 75.834)",700:"oklch(55.4% 0.135 66.442)",800:"oklch(47.6% 0.114 61.907)",900:"oklch(42.1% 0.095 57.708)",950:"oklch(28.6% 0.066 53.813)"},lime:{50:"oklch(98.6% 0.031 120.757)",100:"oklch(96.7% 0.067 122.328)",200:"oklch(93.8% 0.127 124.321)",300:"oklch(89.7% 0.196 126.665)",400:"oklch(84.1% 0.238 128.85)",500:"oklch(76.8% 0.233 130.85)",600:"oklch(64.8% 0.2 131.684)",700:"oklch(53.2% 0.157 131.589)",800:"oklch(45.3% 0.124 130.933)",900:"oklch(40.5% 0.101 131.063)",950:"oklch(27.4% 0.072 132.109)"},green:{50:"oklch(98.2% 0.018 155.826)",100:"oklch(96.2% 0.044 156.743)",200:"oklch(92.5% 0.084 155.995)",300:"oklch(87.1% 0.15 154.449)",400:"oklch(79.2% 0.209 151.711)",500:"oklch(72.3% 0.219 149.579)",600:"oklch(62.7% 0.194 149.214)",700:"oklch(52.7% 0.154 150.069)",800:"oklch(44.8% 0.119 151.328)",900:"oklch(39.3% 0.095 152.535)",950:"oklch(26.6% 0.065 152.934)"},emerald:{50:"oklch(97.9% 0.021 166.113)",100:"oklch(95% 0.052 163.051)",200:"oklch(90.5% 0.093 164.15)",300:"oklch(84.5% 0.143 164.978)",400:"oklch(76.5% 0.177 163.223)",500:"oklch(69.6% 0.17 162.48)",600:"oklch(59.6% 0.145 163.225)",700:"oklch(50.8% 0.118 165.612)",800:"oklch(43.2% 0.095 166.913)",900:"oklch(37.8% 0.077 168.94)",950:"oklch(26.2% 0.051 172.552)"},teal:{50:"oklch(98.4% 0.014 180.72)",100:"oklch(95.3% 0.051 180.801)",200:"oklch(91% 0.096 180.426)",300:"oklch(85.5% 0.138 181.071)",400:"oklch(77.7% 0.152 181.912)",500:"oklch(70.4% 0.14 182.503)",600:"oklch(60% 0.118 184.704)",700:"oklch(51.1% 0.096 186.391)",800:"oklch(43.7% 0.078 188.216)",900:"oklch(38.6% 0.063 188.416)",950:"oklch(27.7% 0.046 192.524)"},cyan:{50:"oklch(98.4% 0.019 200.873)",100:"oklch(95.6% 0.045 203.388)",200:"oklch(91.7% 0.08 205.041)",300:"oklch(86.5% 0.127 207.078)",400:"oklch(78.9% 0.154 211.53)",500:"oklch(71.5% 0.143 215.221)",600:"oklch(60.9% 0.126 221.723)",700:"oklch(52% 0.105 223.128)",800:"oklch(45% 0.085 224.283)",900:"oklch(39.8% 0.07 227.392)",950:"oklch(30.2% 0.056 229.695)"},sky:{50:"oklch(97.7% 0.013 236.62)",100:"oklch(95.1% 0.026 236.824)",200:"oklch(90.1% 0.058 230.902)",300:"oklch(82.8% 0.111 230.318)",400:"oklch(74.6% 0.16 232.661)",500:"oklch(68.5% 0.169 237.323)",600:"oklch(58.8% 0.158 241.966)",700:"oklch(50% 0.134 242.749)",800:"oklch(44.3% 0.11 240.79)",900:"oklch(39.1% 0.09 240.876)",950:"oklch(29.3% 0.066 243.157)"},blue:{50:"oklch(97% 0.014 254.604)",100:"oklch(93.2% 0.032 255.585)",200:"oklch(88.2% 0.059 254.128)",300:"oklch(80.9% 0.105 251.813)",400:"oklch(70.7% 0.165 254.624)",500:"oklch(62.3% 0.214 259.815)",600:"oklch(54.6% 0.245 262.881)",700:"oklch(48.8% 0.243 264.376)",800:"oklch(42.4% 0.199 265.638)",900:"oklch(37.9% 0.146 265.522)",950:"oklch(28.2% 0.091 267.935)"},indigo:{50:"oklch(96.2% 0.018 272.314)",100:"oklch(93% 0.034 272.788)",200:"oklch(87% 0.065 274.039)",300:"oklch(78.5% 0.115 274.713)",400:"oklch(67.3% 0.182 276.935)",500:"oklch(58.5% 0.233 277.117)",600:"oklch(51.1% 0.262 276.966)",700:"oklch(45.7% 0.24 277.023)",800:"oklch(39.8% 0.195 277.366)",900:"oklch(35.9% 0.144 278.697)",950:"oklch(25.7% 0.09 281.288)"},violet:{50:"oklch(96.9% 0.016 293.756)",100:"oklch(94.3% 0.029 294.588)",200:"oklch(89.4% 0.057 293.283)",300:"oklch(81.1% 0.111 293.571)",400:"oklch(70.2% 0.183 293.541)",500:"oklch(60.6% 0.25 292.717)",600:"oklch(54.1% 0.281 293.009)",700:"oklch(49.1% 0.27 292.581)",800:"oklch(43.2% 0.232 292.759)",900:"oklch(38% 0.189 293.745)",950:"oklch(28.3% 0.141 291.089)"},purple:{50:"oklch(97.7% 0.014 308.299)",100:"oklch(94.6% 0.033 307.174)",200:"oklch(90.2% 0.063 306.703)",300:"oklch(82.7% 0.119 306.383)",400:"oklch(71.4% 0.203 305.504)",500:"oklch(62.7% 0.265 303.9)",600:"oklch(55.8% 0.288 302.321)",700:"oklch(49.6% 0.265 301.924)",800:"oklch(43.8% 0.218 303.724)",900:"oklch(38.1% 0.176 304.987)",950:"oklch(29.1% 0.149 302.717)"},fuchsia:{50:"oklch(97.7% 0.017 320.058)",100:"oklch(95.2% 0.037 318.852)",200:"oklch(90.3% 0.076 319.62)",300:"oklch(83.3% 0.145 321.434)",400:"oklch(74% 0.238 322.16)",500:"oklch(66.7% 0.295 322.15)",600:"oklch(59.1% 0.293 322.896)",700:"oklch(51.8% 0.253 323.949)",800:"oklch(45.2% 0.211 324.591)",900:"oklch(40.1% 0.17 325.612)",950:"oklch(29.3% 0.136 325.661)"},pink:{50:"oklch(97.1% 0.014 343.198)",100:"oklch(94.8% 0.028 342.258)",200:"oklch(89.9% 0.061 343.231)",300:"oklch(82.3% 0.12 346.018)",400:"oklch(71.8% 0.202 349.761)",500:"oklch(65.6% 0.241 354.308)",600:"oklch(59.2% 0.249 0.584)",700:"oklch(52.5% 0.223 3.958)",800:"oklch(45.9% 0.187 3.815)",900:"oklch(40.8% 0.153 2.432)",950:"oklch(28.4% 0.109 3.907)"},rose:{50:"oklch(96.9% 0.015 12.422)",100:"oklch(94.1% 0.03 12.58)",200:"oklch(89.2% 0.058 10.001)",300:"oklch(81% 0.117 11.638)",400:"oklch(71.2% 0.194 13.428)",500:"oklch(64.5% 0.246 16.439)",600:"oklch(58.6% 0.253 17.585)",700:"oklch(51.4% 0.222 16.935)",800:"oklch(45.5% 0.188 13.697)",900:"oklch(41% 0.159 10.272)",950:"oklch(27.1% 0.105 12.094)"}};/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:Bl,setPrototypeOf:ds,isFrozen:rh,getPrototypeOf:nh,getOwnPropertyDescriptor:oh}=Object;let{freeze:Tt,seal:Vt,create:Ul}=Object,{apply:Ti,construct:Ei}=typeof Reflect<"u"&&Reflect;Tt||(Tt=function(e){return e});Vt||(Vt=function(e){return e});Ti||(Ti=function(e,r,n){return e.apply(r,n)});Ei||(Ei=function(e,r){return new e(...r)});const Zn=Et(Array.prototype.forEach),ih=Et(Array.prototype.lastIndexOf),hs=Et(Array.prototype.pop),wn=Et(Array.prototype.push),ah=Et(Array.prototype.splice),so=Et(String.prototype.toLowerCase),oi=Et(String.prototype.toString),fs=Et(String.prototype.match),yn=Et(String.prototype.replace),sh=Et(String.prototype.indexOf),lh=Et(String.prototype.trim),Qt=Et(Object.prototype.hasOwnProperty),xt=Et(RegExp.prototype.test),xn=ch(TypeError);function Et(t){return function(e){e instanceof RegExp&&(e.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 Ti(t,e,n)}}function ch(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return Ei(t,r)}}function ke(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:so;ds&&ds(t,null);let n=e.length;for(;n--;){let o=e[n];if(typeof o=="string"){const i=r(o);i!==o&&(rh(e)||(e[n]=i),o=i)}t[o]=!0}return t}function uh(t){for(let e=0;e<t.length;e++)Qt(t,e)||(t[e]=null);return t}function pr(t){const e=Ul(null);for(const[r,n]of Bl(t))Qt(t,r)&&(Array.isArray(n)?e[r]=uh(n):n&&typeof n=="object"&&n.constructor===Object?e[r]=pr(n):e[r]=n);return e}function _n(t,e){for(;t!==null;){const n=oh(t,e);if(n){if(n.get)return Et(n.get);if(typeof n.value=="function")return Et(n.value)}t=nh(t)}function r(){return null}return r}const ps=Tt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ii=Tt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ai=Tt(["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"]),dh=Tt(["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"]),si=Tt(["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"]),hh=Tt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),gs=Tt(["#text"]),ms=Tt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),li=Tt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),vs=Tt(["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"]),Jn=Tt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),fh=Vt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ph=Vt(/<%[\w\W]*|[\w\W]*%>/gm),gh=Vt(/\$\{[\w\W]*/gm),mh=Vt(/^data-[\-\w.\u00B7-\uFFFF]+$/),vh=Vt(/^aria-[\-\w]+$/),Hl=Vt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bh=Vt(/^(?:\w+script|data):/i),wh=Vt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ql=Vt(/^html$/i),yh=Vt(/^[a-z][.\w]*(-[.\w]+)+$/i);var bs=Object.freeze({__proto__:null,ARIA_ATTR:vh,ATTR_WHITESPACE:wh,CUSTOM_ELEMENT:yh,DATA_ATTR:mh,DOCTYPE_NAME:ql,ERB_EXPR:ph,IS_ALLOWED_URI:Hl,IS_SCRIPT_OR_DATA:bh,MUSTACHE_EXPR:fh,TMPLIT_EXPR:gh});const kn={element:1,text:3,progressingInstruction:7,comment:8,document:9},xh=function(){return typeof window>"u"?null:window},_h=function(e,r){if(typeof e!="object"||typeof e.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 e.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},ws=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Vl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xh();const e=se=>Vl(se);if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==kn.document||!t.Element)return e.isSupported=!1,e;let{document:r}=t;const n=r,o=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:s,Element:c,NodeFilter:l,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:g,trustedTypes:b}=t,v=c.prototype,m=_n(v,"cloneNode"),y=_n(v,"remove"),w=_n(v,"nextSibling"),_=_n(v,"childNodes"),x=_n(v,"parentNode");if(typeof a=="function"){const se=r.createElement("template");se.content&&se.content.ownerDocument&&(r=se.content.ownerDocument)}let k,E="";const{implementation:P,createNodeIterator:S,createDocumentFragment:U,getElementsByTagName:j}=r,{importNode:G}=n;let I=ws();e.isSupported=typeof Bl=="function"&&typeof x=="function"&&P&&P.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:B,ERB_EXPR:W,TMPLIT_EXPR:M,DATA_ATTR:C,ARIA_ATTR:te,IS_SCRIPT_OR_DATA:le,ATTR_WHITESPACE:oe,CUSTOM_ELEMENT:ie}=bs;let{IS_ALLOWED_URI:L}=bs,Z=null;const H=ke({},[...ps,...ii,...ai,...si,...gs]);let R=null;const K=ke({},[...ms,...li,...vs,...Jn]);let be=Object.seal(Ul(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}})),Ie=null,Je=null,Se=!0,Ge=!0,$=!1,Te=!0,ze=!1,Re=!0,Ae=!1,Ye=!1,ye=!1,Ne=!1,Qe=!1,At=!1,ft=!0,lr=!1;const pt="user-content-";let Dt=!0,Ct=!1,Kt={},Pt=null;const cr=ke({},["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 gt=null;const ur=ke({},["audio","video","img","source","image","track"]);let nt=null;const xe=ke({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ut="http://www.w3.org/1998/Math/MathML",dr="http://www.w3.org/2000/svg",Gt="http://www.w3.org/1999/xhtml";let kr=Gt,pn=!1,gn=null;const Qo=ke({},[ut,dr,Gt],oi);let re=ke({},["mi","mo","mn","ms","mtext"]),Fe=ke({},["annotation-xml"]);const st=ke({},["title","style","font","a","script"]);let bt=null;const Ot=["application/xhtml+xml","text/html"],Dr="text/html";let $e=null,Sr=null;const Xo=r.createElement("form"),mn=function(T){return T instanceof RegExp||T instanceof Function},vn=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Sr&&Sr===T)){if((!T||typeof T!="object")&&(T={}),T=pr(T),bt=Ot.indexOf(T.PARSER_MEDIA_TYPE)===-1?Dr:T.PARSER_MEDIA_TYPE,$e=bt==="application/xhtml+xml"?oi:so,Z=Qt(T,"ALLOWED_TAGS")?ke({},T.ALLOWED_TAGS,$e):H,R=Qt(T,"ALLOWED_ATTR")?ke({},T.ALLOWED_ATTR,$e):K,gn=Qt(T,"ALLOWED_NAMESPACES")?ke({},T.ALLOWED_NAMESPACES,oi):Qo,nt=Qt(T,"ADD_URI_SAFE_ATTR")?ke(pr(xe),T.ADD_URI_SAFE_ATTR,$e):xe,gt=Qt(T,"ADD_DATA_URI_TAGS")?ke(pr(ur),T.ADD_DATA_URI_TAGS,$e):ur,Pt=Qt(T,"FORBID_CONTENTS")?ke({},T.FORBID_CONTENTS,$e):cr,Ie=Qt(T,"FORBID_TAGS")?ke({},T.FORBID_TAGS,$e):pr({}),Je=Qt(T,"FORBID_ATTR")?ke({},T.FORBID_ATTR,$e):pr({}),Kt=Qt(T,"USE_PROFILES")?T.USE_PROFILES:!1,Se=T.ALLOW_ARIA_ATTR!==!1,Ge=T.ALLOW_DATA_ATTR!==!1,$=T.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ze=T.SAFE_FOR_TEMPLATES||!1,Re=T.SAFE_FOR_XML!==!1,Ae=T.WHOLE_DOCUMENT||!1,Ne=T.RETURN_DOM||!1,Qe=T.RETURN_DOM_FRAGMENT||!1,At=T.RETURN_TRUSTED_TYPE||!1,ye=T.FORCE_BODY||!1,ft=T.SANITIZE_DOM!==!1,lr=T.SANITIZE_NAMED_PROPS||!1,Dt=T.KEEP_CONTENT!==!1,Ct=T.IN_PLACE||!1,L=T.ALLOWED_URI_REGEXP||Hl,kr=T.NAMESPACE||Gt,re=T.MATHML_TEXT_INTEGRATION_POINTS||re,Fe=T.HTML_INTEGRATION_POINTS||Fe,be=T.CUSTOM_ELEMENT_HANDLING||{},T.CUSTOM_ELEMENT_HANDLING&&mn(T.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=T.CUSTOM_ELEMENT_HANDLING.tagNameCheck),T.CUSTOM_ELEMENT_HANDLING&&mn(T.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=T.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),T.CUSTOM_ELEMENT_HANDLING&&typeof T.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(be.allowCustomizedBuiltInElements=T.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ze&&(Ge=!1),Qe&&(Ne=!0),Kt&&(Z=ke({},gs),R=[],Kt.html===!0&&(ke(Z,ps),ke(R,ms)),Kt.svg===!0&&(ke(Z,ii),ke(R,li),ke(R,Jn)),Kt.svgFilters===!0&&(ke(Z,ai),ke(R,li),ke(R,Jn)),Kt.mathMl===!0&&(ke(Z,si),ke(R,vs),ke(R,Jn))),T.ADD_TAGS&&(Z===H&&(Z=pr(Z)),ke(Z,T.ADD_TAGS,$e)),T.ADD_ATTR&&(R===K&&(R=pr(R)),ke(R,T.ADD_ATTR,$e)),T.ADD_URI_SAFE_ATTR&&ke(nt,T.ADD_URI_SAFE_ATTR,$e),T.FORBID_CONTENTS&&(Pt===cr&&(Pt=pr(Pt)),ke(Pt,T.FORBID_CONTENTS,$e)),Dt&&(Z["#text"]=!0),Ae&&ke(Z,["html","head","body"]),Z.table&&(ke(Z,["tbody"]),delete Ie.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw xn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=T.TRUSTED_TYPES_POLICY,E=k.createHTML("")}else k===void 0&&(k=_h(b,o)),k!==null&&typeof E=="string"&&(E=k.createHTML(""));Tt&&Tt(T),Sr=T}},Kn=ke({},[...ii,...ai,...dh]),Gn=ke({},[...si,...hh]),et=function(T){let Q=x(T);(!Q||!Q.tagName)&&(Q={namespaceURI:kr,tagName:"template"});const ae=so(T.tagName),Pe=so(Q.tagName);return gn[T.namespaceURI]?T.namespaceURI===dr?Q.namespaceURI===Gt?ae==="svg":Q.namespaceURI===ut?ae==="svg"&&(Pe==="annotation-xml"||re[Pe]):!!Kn[ae]:T.namespaceURI===ut?Q.namespaceURI===Gt?ae==="math":Q.namespaceURI===dr?ae==="math"&&Fe[Pe]:!!Gn[ae]:T.namespaceURI===Gt?Q.namespaceURI===dr&&!Fe[Pe]||Q.namespaceURI===ut&&!re[Pe]?!1:!Gn[ae]&&(st[ae]||!Kn[ae]):!!(bt==="application/xhtml+xml"&&gn[T.namespaceURI]):!1},_e=function(T){wn(e.removed,{element:T});try{x(T).removeChild(T)}catch{y(T)}},dt=function(T,Q){try{wn(e.removed,{attribute:Q.getAttributeNode(T),from:Q})}catch{wn(e.removed,{attribute:null,from:Q})}if(Q.removeAttribute(T),T==="is")if(Ne||Qe)try{_e(Q)}catch{}else try{Q.setAttribute(T,"")}catch{}},wt=function(T){let Q=null,ae=null;if(ye)T="<remove></remove>"+T;else{const Ke=fs(T,/^[\r\n\t ]+/);ae=Ke&&Ke[0]}bt==="application/xhtml+xml"&&kr===Gt&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");const Pe=k?k.createHTML(T):T;if(kr===Gt)try{Q=new g().parseFromString(Pe,bt)}catch{}if(!Q||!Q.documentElement){Q=P.createDocument(kr,"template",null);try{Q.documentElement.innerHTML=pn?E:Pe}catch{}}const Xe=Q.body||Q.documentElement;return T&&ae&&Xe.insertBefore(r.createTextNode(ae),Xe.childNodes[0]||null),kr===Gt?j.call(Q,Ae?"html":"body")[0]:Ae?Q.documentElement:Xe},Tr=function(T){return S.call(T.ownerDocument||T,T,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},je=function(T){return T instanceof h&&(typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||!(T.attributes instanceof d)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function")},mt=function(T){return typeof s=="function"&&T instanceof s};function Ve(se,T,Q){Zn(se,ae=>{ae.call(e,T,Q,Sr)})}const yt=function(T){let Q=null;if(Ve(I.beforeSanitizeElements,T,null),je(T))return _e(T),!0;const ae=$e(T.nodeName);if(Ve(I.uponSanitizeElement,T,{tagName:ae,allowedTags:Z}),Re&&T.hasChildNodes()&&!mt(T.firstElementChild)&&xt(/<[/\w!]/g,T.innerHTML)&&xt(/<[/\w!]/g,T.textContent)||T.nodeType===kn.progressingInstruction||Re&&T.nodeType===kn.comment&&xt(/<[/\w]/g,T.data))return _e(T),!0;if(!Z[ae]||Ie[ae]){if(!Ie[ae]&&jr(ae)&&(be.tagNameCheck instanceof RegExp&&xt(be.tagNameCheck,ae)||be.tagNameCheck instanceof Function&&be.tagNameCheck(ae)))return!1;if(Dt&&!Pt[ae]){const Pe=x(T)||T.parentNode,Xe=_(T)||T.childNodes;if(Xe&&Pe){const Ke=Xe.length;for(let vt=Ke-1;vt>=0;--vt){const Yt=m(Xe[vt],!0);Yt.__removalCount=(T.__removalCount||0)+1,Pe.insertBefore(Yt,w(T))}}}return _e(T),!0}return T instanceof c&&!et(T)||(ae==="noscript"||ae==="noembed"||ae==="noframes")&&xt(/<\/no(script|embed|frames)/i,T.innerHTML)?(_e(T),!0):(ze&&T.nodeType===kn.text&&(Q=T.textContent,Zn([B,W,M],Pe=>{Q=yn(Q,Pe," ")}),T.textContent!==Q&&(wn(e.removed,{element:T.cloneNode()}),T.textContent=Q)),Ve(I.afterSanitizeElements,T,null),!1)},zt=function(T,Q,ae){if(ft&&(Q==="id"||Q==="name")&&(ae in r||ae in Xo))return!1;if(!(Ge&&!Je[Q]&&xt(C,Q))){if(!(Se&&xt(te,Q))){if(!R[Q]||Je[Q]){if(!(jr(T)&&(be.tagNameCheck instanceof RegExp&&xt(be.tagNameCheck,T)||be.tagNameCheck instanceof Function&&be.tagNameCheck(T))&&(be.attributeNameCheck instanceof RegExp&&xt(be.attributeNameCheck,Q)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(Q))||Q==="is"&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&xt(be.tagNameCheck,ae)||be.tagNameCheck instanceof Function&&be.tagNameCheck(ae))))return!1}else if(!nt[Q]){if(!xt(L,yn(ae,oe,""))){if(!((Q==="src"||Q==="xlink:href"||Q==="href")&&T!=="script"&&sh(ae,"data:")===0&>[T])){if(!($&&!xt(le,yn(ae,oe,"")))){if(ae)return!1}}}}}}return!0},jr=function(T){return T!=="annotation-xml"&&fs(T,ie)},Kr=function(T){Ve(I.beforeSanitizeAttributes,T,null);const{attributes:Q}=T;if(!Q||je(T))return;const ae={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:R,forceKeepAttr:void 0};let Pe=Q.length;for(;Pe--;){const Xe=Q[Pe],{name:Ke,namespaceURI:vt,value:Yt}=Xe,Bt=$e(Ke),hr=Yt;let ot=Ke==="value"?hr:lh(hr);if(ae.attrName=Bt,ae.attrValue=ot,ae.keepAttr=!0,ae.forceKeepAttr=void 0,Ve(I.uponSanitizeAttribute,T,ae),ot=ae.attrValue,lr&&(Bt==="id"||Bt==="name")&&(dt(Ke,T),ot=pt+ot),Re&&xt(/((--!?|])>)|<\/(style|title)/i,ot)){dt(Ke,T);continue}if(ae.forceKeepAttr)continue;if(!ae.keepAttr){dt(Ke,T);continue}if(!Te&&xt(/\/>/i,ot)){dt(Ke,T);continue}ze&&Zn([B,W,M],Gr=>{ot=yn(ot,Gr," ")});const Yn=$e(T.nodeName);if(!zt(Yn,Bt,ot)){dt(Ke,T);continue}if(k&&typeof b=="object"&&typeof b.getAttributeType=="function"&&!vt)switch(b.getAttributeType(Yn,Bt)){case"TrustedHTML":{ot=k.createHTML(ot);break}case"TrustedScriptURL":{ot=k.createScriptURL(ot);break}}if(ot!==hr)try{vt?T.setAttributeNS(vt,Ke,ot):T.setAttribute(Ke,ot),je(T)?_e(T):hs(e.removed)}catch{dt(Ke,T)}}Ve(I.afterSanitizeAttributes,T,null)},Er=function se(T){let Q=null;const ae=Tr(T);for(Ve(I.beforeSanitizeShadowDOM,T,null);Q=ae.nextNode();)Ve(I.uponSanitizeShadowNode,Q,null),yt(Q),Kr(Q),Q.content instanceof i&&se(Q.content);Ve(I.afterSanitizeShadowDOM,T,null)};return e.sanitize=function(se){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Q=null,ae=null,Pe=null,Xe=null;if(pn=!se,pn&&(se="<!-->"),typeof se!="string"&&!mt(se))if(typeof se.toString=="function"){if(se=se.toString(),typeof se!="string")throw xn("dirty is not a string, aborting")}else throw xn("toString is not a function");if(!e.isSupported)return se;if(Ye||vn(T),e.removed=[],typeof se=="string"&&(Ct=!1),Ct){if(se.nodeName){const Yt=$e(se.nodeName);if(!Z[Yt]||Ie[Yt])throw xn("root node is forbidden and cannot be sanitized in-place")}}else if(se instanceof s)Q=wt("<!---->"),ae=Q.ownerDocument.importNode(se,!0),ae.nodeType===kn.element&&ae.nodeName==="BODY"||ae.nodeName==="HTML"?Q=ae:Q.appendChild(ae);else{if(!Ne&&!ze&&!Ae&&se.indexOf("<")===-1)return k&&At?k.createHTML(se):se;if(Q=wt(se),!Q)return Ne?null:At?E:""}Q&&ye&&_e(Q.firstChild);const Ke=Tr(Ct?se:Q);for(;Pe=Ke.nextNode();)yt(Pe),Kr(Pe),Pe.content instanceof i&&Er(Pe.content);if(Ct)return se;if(Ne){if(Qe)for(Xe=U.call(Q.ownerDocument);Q.firstChild;)Xe.appendChild(Q.firstChild);else Xe=Q;return(R.shadowroot||R.shadowrootmode)&&(Xe=G.call(n,Xe,!0)),Xe}let vt=Ae?Q.outerHTML:Q.innerHTML;return Ae&&Z["!doctype"]&&Q.ownerDocument&&Q.ownerDocument.doctype&&Q.ownerDocument.doctype.name&&xt(ql,Q.ownerDocument.doctype.name)&&(vt="<!DOCTYPE "+Q.ownerDocument.doctype.name+`>
|
|
3
3
|
`+vt),ze&&Zn([B,W,M],Yt=>{vt=yn(vt,Yt," ")}),k&&At?k.createHTML(vt):vt},e.setConfig=function(){let se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vn(se),Ye=!0},e.clearConfig=function(){Sr=null,Ye=!1},e.isValidAttribute=function(se,T,Q){Sr||vn({});const ae=$e(se),Pe=$e(T);return zt(ae,Pe,Q)},e.addHook=function(se,T){typeof T=="function"&&wn(I[se],T)},e.removeHook=function(se,T){if(T!==void 0){const Q=ih(I[se],T);return Q===-1?void 0:ah(I[se],Q,1)[0]}return hs(I[se])},e.removeHooks=function(se){I[se]=[]},e.removeAllHooks=function(){I=ws()},e}var kh=Vl();function Ji(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var qr=Ji();function Wl(t){qr=t}var In={exec:()=>null};function Le(t,e=""){let r=typeof t=="string"?t:t.source;const n={replace:(o,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(kt.caret,"$1"),r=r.replace(o,a),n},getRegex:()=>new RegExp(r,e)};return n}var kt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Sh=/^(?:[ \t]*(?:\n|$))+/,Th=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Eh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Hn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ah=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,$i=/(?:[*+-]|\d{1,9}[.)])/,jl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Kl=Le(jl).replace(/bull/g,$i).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ch=Le(jl).replace(/bull/g,$i).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ea=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ph=/^[^\n]+/,ta=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Oh=Le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ta).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ih=Le(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,$i).getRegex(),zo="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",ra=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Rh=Le("^ {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",ra).replace("tag",zo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Gl=Le(ea).replace("hr",Hn).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",zo).getRegex(),Dh=Le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Gl).getRegex(),na={blockquote:Dh,code:Th,def:Oh,fences:Eh,heading:Ah,hr:Hn,html:Rh,lheading:Kl,list:Ih,newline:Sh,paragraph:Gl,table:In,text:Ph},ys=Le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Hn).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",zo).getRegex(),Lh={...na,lheading:Ch,table:ys,paragraph:Le(ea).replace("hr",Hn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ys).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",zo).getRegex()},Nh={...na,html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ra).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:In,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Le(ea).replace("hr",Hn).replace("heading",` *#{1,6} *[^
|
|
4
4
|
]`).replace("lheading",Kl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Fh=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Mh=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Yl=/^( {2,}|\\)\n(?!\s*$)/,zh=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Bo=/[\p{P}\p{S}]/u,oa=/[\s\p{P}\p{S}]/u,Ql=/[^\s\p{P}\p{S}]/u,Bh=Le(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,oa).getRegex(),Xl=/(?!~)[\p{P}\p{S}]/u,Uh=/(?!~)[\s\p{P}\p{S}]/u,Hh=/(?:[^\s\p{P}\p{S}]|~)/u,qh=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Zl=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Vh=Le(Zl,"u").replace(/punct/g,Bo).getRegex(),Wh=Le(Zl,"u").replace(/punct/g,Xl).getRegex(),Jl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",jh=Le(Jl,"gu").replace(/notPunctSpace/g,Ql).replace(/punctSpace/g,oa).replace(/punct/g,Bo).getRegex(),Kh=Le(Jl,"gu").replace(/notPunctSpace/g,Hh).replace(/punctSpace/g,Uh).replace(/punct/g,Xl).getRegex(),Gh=Le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ql).replace(/punctSpace/g,oa).replace(/punct/g,Bo).getRegex(),Yh=Le(/\\(punct)/,"gu").replace(/punct/g,Bo).getRegex(),Qh=Le(/^<(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(),Xh=Le(ra).replace("(?:-->|$)","-->").getRegex(),Zh=Le("^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",Xh).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),po=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Jh=Le(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",po).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),$l=Le(/^!?\[(label)\]\[(ref)\]/).replace("label",po).replace("ref",ta).getRegex(),ec=Le(/^!?\[(ref)\](?:\[\])?/).replace("ref",ta).getRegex(),$h=Le("reflink|nolink(?!\\()","g").replace("reflink",$l).replace("nolink",ec).getRegex(),ia={_backpedal:In,anyPunctuation:Yh,autolink:Qh,blockSkip:qh,br:Yl,code:Mh,del:In,emStrongLDelim:Vh,emStrongRDelimAst:jh,emStrongRDelimUnd:Gh,escape:Fh,link:Jh,nolink:ec,punctuation:Bh,reflink:$l,reflinkSearch:$h,tag:Zh,text:zh,url:In},ef={...ia,link:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",po).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",po).getRegex()},Ai={...ia,emStrongRDelimAst:Kh,emStrongLDelim:Wh,url:Le(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},tf={...Ai,br:Le(Yl).replace("{2,}","*").getRegex(),text:Le(Ai.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},$n={normal:na,gfm:Lh,pedantic:Nh},Sn={normal:ia,gfm:Ai,breaks:tf,pedantic:ef},rf={"&":"&","<":"<",">":">",'"':""","'":"'"},xs=t=>rf[t];function tr(t,e){if(e){if(kt.escapeTest.test(t))return t.replace(kt.escapeReplace,xs)}else if(kt.escapeTestNoEncode.test(t))return t.replace(kt.escapeReplaceNoEncode,xs);return t}function _s(t){try{t=encodeURI(t).replace(kt.percentDecode,"%")}catch{return null}return t}function ks(t,e){const r=t.replace(kt.findPipe,(i,a,s)=>{let c=!1,l=a;for(;--l>=0&&s[l]==="\\";)c=!c;return c?"|":" |"}),n=r.split(kt.splitPipe);let o=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(kt.slashPipe,"|");return n}function Tn(t,e,r){const n=t.length;if(n===0)return"";let o=0;for(;o<n&&t.charAt(n-o-1)===e;)o++;return t.slice(0,n-o)}function nf(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function Ss(t,e,r,n,o){const i=e.href,a=e.title||null,s=t[1].replace(o.other.outputLinkReplace,"$1");n.state.inLink=!0;const c={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:a,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,c}function of(t,e,r){const n=t.match(r.other.indentCodeCompensation);if(n===null)return e;const o=n[1];return e.split(`
|
|
@@ -55,7 +55,7 @@ ${t}</tr>
|
|
|
55
55
|
`}tablecell(t){const e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
|
|
56
56
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${tr(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){const n=this.parser.parseInline(r),o=_s(t);if(o===null)return n;t=o;let i='<a href="'+t+'"';return e&&(i+=' title="'+tr(e)+'"'),i+=">"+n+"</a>",i}image({href:t,title:e,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));const o=_s(t);if(o===null)return tr(r);t=o;let i=`<img src="${t}" alt="${r}"`;return e&&(i+=` title="${tr(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:tr(t.text)}},aa=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},br=class Pi{options;renderer;textRenderer;constructor(e){this.options=e||qr,this.options.renderer=this.options.renderer||new mo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new aa}static parse(e,r){return new Pi(r).parse(e)}static parseInline(e,r){return new Pi(r).parseInline(e)}parse(e,r=!0){let n="";for(let o=0;o<e.length;o++){const i=e[o];if(this.options.extensions?.renderers?.[i.type]){const s=i,c=this.options.extensions.renderers[s.type].call({parser:this},s);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){n+=c||"";continue}}const a=i;switch(a.type){case"space":{n+=this.renderer.space(a);continue}case"hr":{n+=this.renderer.hr(a);continue}case"heading":{n+=this.renderer.heading(a);continue}case"code":{n+=this.renderer.code(a);continue}case"table":{n+=this.renderer.table(a);continue}case"blockquote":{n+=this.renderer.blockquote(a);continue}case"list":{n+=this.renderer.list(a);continue}case"html":{n+=this.renderer.html(a);continue}case"paragraph":{n+=this.renderer.paragraph(a);continue}case"text":{let s=a,c=this.renderer.text(s);for(;o+1<e.length&&e[o+1].type==="text";)s=e[++o],c+=`
|
|
57
57
|
`+this.renderer.text(s);r?n+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):n+=c;continue}default:{const s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(e,r=this.renderer){let n="";for(let o=0;o<e.length;o++){const i=e[o];if(this.options.extensions?.renderers?.[i.type]){const s=this.options.extensions.renderers[i.type].call({parser:this},i);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=s||"";continue}}const a=i;switch(a.type){case"escape":{n+=r.text(a);break}case"html":{n+=r.html(a);break}case"link":{n+=r.link(a);break}case"image":{n+=r.image(a);break}case"strong":{n+=r.strong(a);break}case"em":{n+=r.em(a);break}case"codespan":{n+=r.codespan(a);break}case"br":{n+=r.br(a);break}case"del":{n+=r.del(a);break}case"text":{n+=r.text(a);break}default:{const s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}},lo=class{options;block;constructor(t){this.options=t||qr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?vr.lex:vr.lexInline}provideParser(){return this.block?br.parse:br.parseInline}},tc=class{defaults=Ji();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=br;Renderer=mo;TextRenderer=aa;Lexer=vr;Tokenizer=go;Hooks=lo;constructor(...t){this.use(...t)}walkTokens(t,e){let r=[];for(const n of t)switch(r=r.concat(e.call(this,n)),n.type){case"table":{const o=n;for(const i of o.header)r=r.concat(this.walkTokens(i.tokens,e));for(const i of o.rows)for(const a of i)r=r.concat(this.walkTokens(a.tokens,e));break}case"list":{const o=n;r=r.concat(this.walkTokens(o.items,e));break}default:{const o=n;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(i=>{const a=o[i].flat(1/0);r=r.concat(this.walkTokens(a,e))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,e)))}}return r}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const i=e.renderers[o.name];i?e.renderers[o.name]=function(...a){let s=o.renderer.apply(this,a);return s===!1&&(s=i.apply(this,a)),s}:e.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=e[o.level];i?i.unshift(o.tokenizer):e[o.level]=[o.tokenizer],o.start&&(o.level==="block"?e.startBlock?e.startBlock.push(o.start):e.startBlock=[o.start]:o.level==="inline"&&(e.startInline?e.startInline.push(o.start):e.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(e.childTokens[o.name]=o.childTokens)}),n.extensions=e),r.renderer){const o=this.defaults.renderer||new mo(this.defaults);for(const i in r.renderer){if(!(i in o))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=i,s=r.renderer[a],c=o[a];o[a]=(...l)=>{let d=s.apply(o,l);return d===!1&&(d=c.apply(o,l)),d||""}}n.renderer=o}if(r.tokenizer){const o=this.defaults.tokenizer||new go(this.defaults);for(const i in r.tokenizer){if(!(i in o))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=i,s=r.tokenizer[a],c=o[a];o[a]=(...l)=>{let d=s.apply(o,l);return d===!1&&(d=c.apply(o,l)),d}}n.tokenizer=o}if(r.hooks){const o=this.defaults.hooks||new lo;for(const i in r.hooks){if(!(i in o))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=i,s=r.hooks[a],c=o[a];lo.passThroughHooks.has(i)?o[a]=l=>{if(this.defaults.async)return Promise.resolve(s.call(o,l)).then(h=>c.call(o,h));const d=s.call(o,l);return c.call(o,d)}:o[a]=(...l)=>{let d=s.apply(o,l);return d===!1&&(d=c.apply(o,l)),d}}n.hooks=o}if(r.walkTokens){const o=this.defaults.walkTokens,i=r.walkTokens;n.walkTokens=function(a){let s=[];return s.push(i.call(this,a)),o&&(s=s.concat(o.call(this,a))),s}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return vr.lex(t,e??this.defaults)}parser(t,e){return br.parse(t,e??this.defaults)}parseMarkdown(t){return(r,n)=>{const o={...n},i={...this.defaults,...o},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&o.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=t);const s=i.hooks?i.hooks.provideLexer():t?vr.lex:vr.lexInline,c=i.hooks?i.hooks.provideParser():t?br.parse:br.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(r):r).then(l=>s(l,i)).then(l=>i.hooks?i.hooks.processAllTokens(l):l).then(l=>i.walkTokens?Promise.all(this.walkTokens(l,i.walkTokens)).then(()=>l):l).then(l=>c(l,i)).then(l=>i.hooks?i.hooks.postprocess(l):l).catch(a);try{i.hooks&&(r=i.hooks.preprocess(r));let l=s(r,i);i.hooks&&(l=i.hooks.processAllTokens(l)),i.walkTokens&&this.walkTokens(l,i.walkTokens);let d=c(l,i);return i.hooks&&(d=i.hooks.postprocess(d)),d}catch(l){return a(l)}}}onError(t,e){return r=>{if(r.message+=`
|
|
58
|
-
Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An error occurred:</p><pre>"+tr(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Ur=new tc;function Me(t,e){return Ur.parse(t,e)}Me.options=Me.setOptions=function(t){return Ur.setOptions(t),Me.defaults=Ur.defaults,Wl(Me.defaults),Me};Me.getDefaults=Ji;Me.defaults=qr;Me.use=function(...t){return Ur.use(...t),Me.defaults=Ur.defaults,Wl(Me.defaults),Me};Me.walkTokens=function(t,e){return Ur.walkTokens(t,e)};Me.parseInline=Ur.parseInline;Me.Parser=br;Me.parser=br.parse;Me.Renderer=mo;Me.TextRenderer=aa;Me.Lexer=vr;Me.lexer=vr.lex;Me.Tokenizer=go;Me.Hooks=lo;Me.parse=Me;Me.options;Me.setOptions;Me.use;Me.walkTokens;Me.parseInline;br.parse;vr.lex;const rc=t=>(Object.getOwnPropertyNames(t).forEach(e=>{const r=t[e];r&&typeof r=="object"&&rc(r)}),Object.freeze(t)),Ts=rc({all:[],used:[],unused:[]}),af=t=>{const e=kh(t);return e.addHook("uponSanitizeElement",function(r,n){const o=n.tagName||r.nodeName.toLowerCase();o.startsWith("liipgpt-")&&(n.allowedTags[o]=!0)}),e};class Es{marked;currentReferences=Ts;lastUsedIndex=0;DomPurity;constructor(e={}){this.marked=new tc({async:!1,breaks:!0}).use(this.createFootnoteExtension(),...e.extensions??[]),this.DomPurity=af(e.window)}createFootnoteExtension=()=>{const e=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=e.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:(e.currentReferences.used.push(o),e.lastUsedIndex++,i=e.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(e){return this.DomPurity.sanitize(this.marked.parse(e),{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0,mathMl:!0},FORBID_TAGS:["hr"]})}toHTML(e,r){this.currentReferences=r;const n=this.parse(e);return this.currentReferences=Ts,n}}function sf(){let t,e;return{promise:new Promise((n,o)=>{e=n,t=o}),reject:t,resolve:e}}class nc{promise;resolve;reject;constructor(){const{promise:e,resolve:r,reject:n}=sf();this.promise=e,this.resolve=r,this.reject=n}then(e,r){return this.promise.then(e,r)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}toPromise(){return this.promise}[Symbol.toStringTag]="Flag"}class Oi{hasValue=new nc;currentValue;setValue(e){this.currentValue=e,this.hasValue.resolve()}cleanup(e){this.hasValue.reject(e)}getCurrentValue(){return this.currentValue}async toPromise(){return await this.hasValue,this.currentValue}then(e,r){return this.toPromise().then(e,r)}catch(e){return this.toPromise().catch(e)}finally(e){return this.toPromise().finally(e)}[Symbol.toStringTag]="FutureValue"}const lf=t=>{try{return new URL(t).hostname}catch{return t}},cf=({url:t,considered:e,title:r,description:n,summary:o})=>{const i=lf(t);return{url:t,considered:e,referenceIndex:{},score:0,metadata:{},display:{card:{title:r,description:n||o,badge:t},listItem:{title:r,badge:i}}}};class uf{constructor(e){this.options=e,this.store=El({id:e.id,state:"loading",errors:[],type:"bot",time:new Date().toISOString(),message:{markdown:"",html:""},references:{all:[],used:[],unused:[]}})}store;content=new Oi;backendSendsMappedRefs=!1;pushError(e){this.options.onError?.(e),this.store.update(r=>({...r,errors:[...r.errors,e]}))}updateRequestId(e){this.store.update(r=>({...r,id:e}))}updateText(e){this.store.update(r=>{const n=r.message.markdown+e,o=this.options.markdownRenderer.toHTML(n,r.references);return{...r,state:"streaming",message:{markdown:n,html:o}}})}finishMessage(){this.store.update(e=>{const r={...e,state:"done"};return r.references.unused=r.references.all.filter(n=>n.referenceIndex.used===void 0),this.options?.onFinish?.(r),this.content.setValue(r),r})}addReference(e){this.store.update(r=>{const n=r.references.all,o=n.length,i=[...n,{...e,referenceIndex:{all:o}}];return{...r,references:{used:r.references.used,all:i}}})}addMappedReference(e){this.backendSendsMappedRefs=!0,this.addReference(e)}addOldReference(e){this.backendSendsMappedRefs||this.addReference(cf(e))}getReadableStore(){return{subscribe:this.store.subscribe}}getPromise(){return this.content.toPromise()}}const df=qe({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()}),hf=qe({email:q(),creditCard:q(),ahv:q(),phoneSwiss:q(),phoneInternational:q(),swissPassport:q(),longNumber:q()}),oc=qe({predefinedQuestions:q(),introductionTitle:q(),introductionDisclaimer:q().optional(),chatInputPlaceholder:q(),chatInputPlaceholderListening:q().optional(),chatInputSubmit: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(),answerGood:q(),answerBad:q(),classificationSubmit:q(),classificationThankYou:q(),classificationTitle:q(),selectLanguage:q(),lightMode:q(),darkMode:q()}),ff=["en","de","fr","it"],on=Lo(ff),ic=ln(on,oc.partial());ln(on,df);ln(on,hf);const As=qe({label:q(),options:qt(qe({label:q(),value:gr()}))}),pf=qe({label:q(),icon:q(),url:q(),target:Lo(["_blank","_self"]).optional()}),gf=qe({label:q().nullable(),question:q()}),ac=qe({impact:As.optional(),quality:As.optional()});qe({classification:ac.optional()});const mf=qe({predefinedQuestions:qt(gf)}),Cs=Il([qe({maintenance:Dd(!0)}),qe({id:q(),cID:q()})]);ln(on,oc);const vf=qe({showPredefinedQuestions:_t(),showOverallFeedbackButton:_t(),showCloseChatButton:_t(),showContextMenu:_t(),showContextInfo:_t(),allowAudioInput:_t(),blockPII:_t(),questionPrefix:q(),menu:ln(on,qt(pf)).optional(),supportedLanguages:qt(on),classification:ac.optional(),showTextFeedback:_t(),theme:Ld,translations:ic,buttonHref:q().optional(),addQueryToUrlParams:_t().optional(),renderKatex:_t().optional(),reflectLanguageInPath:_t().optional(),sendReferrer:Lo(["all","own","none"]).optional()}),bf=vf.partial(),wf=bf.and(qe({theme:qe({name:q().optional()}).optional()}));class yf{constructor(e){this.chatResponseData=e,this.id=this.chatResponseData.id}id;async isReadyForFeedback(){return await this.chatResponseData.readyForFeedback.toPromise(),!0}subscribe(e,r){return this.chatResponseData.readableStore.subscribe(e,r)}getContent(){return this.chatResponseData.content.toPromise()}abort(){return this.chatResponseData.abort()}async thumbsUp(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsUp(this.id,this.chatResponseData.question)}async thumbsDown(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsDown(this.id,this.chatResponseData.question)}async feedback(e){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.feedback(this.id,this.chatResponseData.question,e)}}const Yr=new Map;class xf{get length(){return Yr.size}clear(){Yr.clear()}getItem(e){return Yr.get(e)||null}key(e){return Array.from(Yr.keys())[e]||null}removeItem(e){Yr.delete(e)}setItem(e,r){Yr.set(e,String(r))}}const Ps=globalThis.localStorage??new xf,_f=async t=>{try{const e=Ps.getItem("uID"),r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({referrer:globalThis?.document?.referrer||null,uID:e})},n=await t.fetchData("/login",Cs,{},r).catch(o=>(console.log("Failed to /login use /log",o),t.fetchData("/log",Cs,{},r)));if("maintenance"in n&&n.maintenance)return{mode:"maintenance"};if(!("id"in n))throw new Error("Invalid response format: missing user id");return Ps.setItem("uID",n.id),{mode:"ready",userId:n.id}}catch(e){throw console.error("Failed to fetch user data:",e),e}};var Lt=function(t,e){if(!(this instanceof Lt))return new Lt(t,e);this.url=t,e=e||{},this.headers=e.headers||{},this.payload=e.payload!==void 0?e.payload:"",this.method=e.method||this.payload&&"POST"||"GET",this.withCredentials=!!e.withCredentials,this.debug=!!e.debug,this.autoReconnect=e.autoReconnect!==void 0?e.autoReconnect:!1,this.reconnectDelay=e.reconnectDelay!==void 0?e.reconnectDelay:3e3,this.maxRetries=e.maxRetries!==void 0?e.maxRetries:null,this.retryCount=0,this.reconnectTimer=null,this.useLastEventId=e.useLastEventId!==void 0?e.useLastEventId:!0,this.FIELD_SEPARATOR=":",this.listeners={},this.xhr=null,this.readyState=Lt.INITIALIZING,this.progress=0,this.chunk="",this.lastEventId="",this.addEventListener=function(r,n){this.listeners[r]===void 0&&(this.listeners[r]=[]),this.listeners[r].indexOf(n)===-1&&this.listeners[r].push(n)},this.removeEventListener=function(r,n){if(this.listeners[r]===void 0)return;const 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(Lt.CLOSED),this.autoReconnect){if(this.maxRetries!==null&&this.retryCount>=this.maxRetries){this.debug&&console.debug(`SSE max retries (${this.maxRetries}) reached, stopping reconnection attempts`),this.autoReconnect=!1,this.close();return}this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.debug&&console.debug(`SSE will attempt to reconnect in ${this.reconnectDelay}ms (attempt ${this.retryCount+1}${this.maxRetries?"/"+this.maxRetries:""})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.retryCount++,this.stream()},this.reconnectDelay)}},this._setReadyState=function(r){const n=new CustomEvent("readystatechange");n.readyState=r,this.readyState=r,this.dispatchEvent(n)},this._onStreamFailure=function(r){const n=new CustomEvent("error");n.responseCode=r.currentTarget.status,n.data=r.currentTarget.response,this.dispatchEvent(n),this._markClosed()},this._onStreamAbort=function(){this.dispatchEvent(new CustomEvent("abort")),this._markClosed()},this._onStreamProgress=function(r){if(!this.xhr)return;if(this.xhr.status<200||this.xhr.status>=300){this._onStreamFailure(r);return}this.retryCount=0;const n=this.xhr.responseText.substring(this.progress);this.progress+=n.length;const 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,c;if(a>0){const l=i[a+1]===" "?2:1;s=i.substring(0,a),c=i.substring(a+l)}else if(a<0)s=i,c="";else return;s in n&&(s==="data"&&n[s]!==null?n.data+=`
|
|
58
|
+
Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An error occurred:</p><pre>"+tr(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Ur=new tc;function Me(t,e){return Ur.parse(t,e)}Me.options=Me.setOptions=function(t){return Ur.setOptions(t),Me.defaults=Ur.defaults,Wl(Me.defaults),Me};Me.getDefaults=Ji;Me.defaults=qr;Me.use=function(...t){return Ur.use(...t),Me.defaults=Ur.defaults,Wl(Me.defaults),Me};Me.walkTokens=function(t,e){return Ur.walkTokens(t,e)};Me.parseInline=Ur.parseInline;Me.Parser=br;Me.parser=br.parse;Me.Renderer=mo;Me.TextRenderer=aa;Me.Lexer=vr;Me.lexer=vr.lex;Me.Tokenizer=go;Me.Hooks=lo;Me.parse=Me;Me.options;Me.setOptions;Me.use;Me.walkTokens;Me.parseInline;br.parse;vr.lex;const rc=t=>(Object.getOwnPropertyNames(t).forEach(e=>{const r=t[e];r&&typeof r=="object"&&rc(r)}),Object.freeze(t)),Ts=rc({all:[],used:[],unused:[]}),af=t=>{const e=kh(t);return e.addHook("uponSanitizeElement",function(r,n){const o=n.tagName||r.nodeName.toLowerCase();o.startsWith("liipgpt-")&&(n.allowedTags[o]=!0)}),e};class Es{marked;currentReferences=Ts;lastUsedIndex=0;DomPurity;constructor(e={}){this.marked=new tc({async:!1,breaks:!0}).use(this.createFootnoteExtension(),...e.extensions??[]),this.DomPurity=af(e.window)}createFootnoteExtension=()=>{const e=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=e.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:(e.currentReferences.used.push(o),e.lastUsedIndex++,i=e.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(e){return this.DomPurity.sanitize(this.marked.parse(e),{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0,mathMl:!0},FORBID_TAGS:["hr"]})}toHTML(e,r){this.currentReferences=r;const n=this.parse(e);return this.currentReferences=Ts,n}}function sf(){let t,e;return{promise:new Promise((n,o)=>{e=n,t=o}),reject:t,resolve:e}}class nc{promise;resolve;reject;constructor(){const{promise:e,resolve:r,reject:n}=sf();this.promise=e,this.resolve=r,this.reject=n}then(e,r){return this.promise.then(e,r)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}toPromise(){return this.promise}[Symbol.toStringTag]="Flag"}class Oi{hasValue=new nc;currentValue;setValue(e){this.currentValue=e,this.hasValue.resolve()}cleanup(e){this.hasValue.reject(e)}getCurrentValue(){return this.currentValue}async toPromise(){return await this.hasValue,this.currentValue}then(e,r){return this.toPromise().then(e,r)}catch(e){return this.toPromise().catch(e)}finally(e){return this.toPromise().finally(e)}[Symbol.toStringTag]="FutureValue"}const lf=t=>{try{return new URL(t).hostname}catch{return t}},cf=({url:t,considered:e,title:r,description:n,summary:o})=>{const i=lf(t);return{url:t,considered:e,referenceIndex:{},score:0,metadata:{},display:{card:{title:r,description:n||o,badge:t},listItem:{title:r,badge:i}}}};class uf{constructor(e){this.options=e,this.store=El({id:e.id,state:"loading",errors:[],type:"bot",time:new Date().toISOString(),message:{markdown:"",html:""},references:{all:[],used:[],unused:[]}})}store;content=new Oi;backendSendsMappedRefs=!1;pushError(e){this.options.onError?.(e),this.store.update(r=>({...r,errors:[...r.errors,e]}))}updateRequestId(e){this.store.update(r=>({...r,id:e}))}updateText(e){this.store.update(r=>{const n=r.message.markdown+e,o=this.options.markdownRenderer.toHTML(n,r.references);return{...r,state:"streaming",message:{markdown:n,html:o}}})}finishMessage(){this.store.update(e=>{const r={...e,state:"done"};return r.references.unused=r.references.all.filter(n=>n.referenceIndex.used===void 0),this.options?.onFinish?.(r),this.content.setValue(r),r})}addReference(e){this.store.update(r=>{const n=r.references.all,o=n.length,i=[...n,{...e,referenceIndex:{all:o}}];return{...r,references:{used:r.references.used,all:i}}})}addMappedReference(e){this.backendSendsMappedRefs=!0,this.addReference(e)}addOldReference(e){this.backendSendsMappedRefs||this.addReference(cf(e))}getReadableStore(){return{subscribe:this.store.subscribe}}getPromise(){return this.content.toPromise()}}const df=qe({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()}),hf=qe({email:q(),creditCard:q(),ahv:q(),phoneSwiss:q(),phoneInternational:q(),swissPassport:q(),longNumber:q()}),oc=qe({predefinedQuestions:q(),introductionTitle:q(),introductionDisclaimer:q().optional(),chatInputPlaceholder:q(),chatInputPlaceholderListening:q().optional(),chatInputSubmit: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(),answerGood:q(),answerBad:q(),classificationSubmit:q(),classificationThankYou:q(),classificationTitle:q(),selectLanguage:q(),lightMode:q(),darkMode:q()}),ff=["en","de","fr","it"],on=Lo(ff),ic=ln(on,oc.partial());ln(on,df);ln(on,hf);const As=qe({label:q(),options:qt(qe({label:q(),value:gr()}))}),pf=qe({label:q(),icon:q(),url:q(),target:Lo(["_blank","_self"]).optional()}),gf=qe({label:q().nullable(),question:q()}),ac=qe({impact:As.optional(),quality:As.optional()});qe({classification:ac.optional()});const mf=qe({predefinedQuestions:qt(gf)}),Cs=Il([qe({maintenance:Dd(!0)}),qe({id:q(),cID:q()})]);ln(on,oc);const vf=qe({showPredefinedQuestions:_t(),showOverallFeedbackButton:_t(),showCloseChatButton:_t(),showContextMenu:_t(),showContextInfo:_t(),allowAudioInput:_t(),blockPII:_t(),questionPrefix:q(),menu:ln(on,qt(pf)).optional(),supportedLanguages:qt(on),classification:ac.optional(),showTextFeedback:_t(),theme:Ld,translations:ic,buttonHref:q().optional(),addQueryToUrlParams:_t().optional(),renderKatex:_t().optional(),reflectLanguageInPath:_t().optional(),sendReferrer:Lo(["all","own","none","location"]).optional()}),bf=vf.partial(),wf=bf.and(qe({theme:qe({name:q().optional()}).optional()}));class yf{constructor(e){this.chatResponseData=e,this.id=this.chatResponseData.id}id;async isReadyForFeedback(){return await this.chatResponseData.readyForFeedback.toPromise(),!0}subscribe(e,r){return this.chatResponseData.readableStore.subscribe(e,r)}getContent(){return this.chatResponseData.content.toPromise()}abort(){return this.chatResponseData.abort()}async thumbsUp(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsUp(this.id,this.chatResponseData.question)}async thumbsDown(){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.thumbsDown(this.id,this.chatResponseData.question)}async feedback(e){await this.isReadyForFeedback(),await this.chatResponseData.liipgptClientPrimitive.feedback(this.id,this.chatResponseData.question,e)}}const Yr=new Map;class xf{get length(){return Yr.size}clear(){Yr.clear()}getItem(e){return Yr.get(e)||null}key(e){return Array.from(Yr.keys())[e]||null}removeItem(e){Yr.delete(e)}setItem(e,r){Yr.set(e,String(r))}}const Ps=globalThis.localStorage??new xf,_f=async t=>{try{const e=Ps.getItem("uID"),r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({referrer:globalThis?.document?.referrer||null,uID:e})},n=await t.fetchData("/login",Cs,{},r).catch(o=>(console.log("Failed to /login use /log",o),t.fetchData("/log",Cs,{},r)));if("maintenance"in n&&n.maintenance)return{mode:"maintenance"};if(!("id"in n))throw new Error("Invalid response format: missing user id");return Ps.setItem("uID",n.id),{mode:"ready",userId:n.id}}catch(e){throw console.error("Failed to fetch user data:",e),e}};var Lt=function(t,e){if(!(this instanceof Lt))return new Lt(t,e);this.url=t,e=e||{},this.headers=e.headers||{},this.payload=e.payload!==void 0?e.payload:"",this.method=e.method||this.payload&&"POST"||"GET",this.withCredentials=!!e.withCredentials,this.debug=!!e.debug,this.autoReconnect=e.autoReconnect!==void 0?e.autoReconnect:!1,this.reconnectDelay=e.reconnectDelay!==void 0?e.reconnectDelay:3e3,this.maxRetries=e.maxRetries!==void 0?e.maxRetries:null,this.retryCount=0,this.reconnectTimer=null,this.useLastEventId=e.useLastEventId!==void 0?e.useLastEventId:!0,this.FIELD_SEPARATOR=":",this.listeners={},this.xhr=null,this.readyState=Lt.INITIALIZING,this.progress=0,this.chunk="",this.lastEventId="",this.addEventListener=function(r,n){this.listeners[r]===void 0&&(this.listeners[r]=[]),this.listeners[r].indexOf(n)===-1&&this.listeners[r].push(n)},this.removeEventListener=function(r,n){if(this.listeners[r]===void 0)return;const 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(Lt.CLOSED),this.autoReconnect){if(this.maxRetries!==null&&this.retryCount>=this.maxRetries){this.debug&&console.debug(`SSE max retries (${this.maxRetries}) reached, stopping reconnection attempts`),this.autoReconnect=!1,this.close();return}this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.debug&&console.debug(`SSE will attempt to reconnect in ${this.reconnectDelay}ms (attempt ${this.retryCount+1}${this.maxRetries?"/"+this.maxRetries:""})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.retryCount++,this.stream()},this.reconnectDelay)}},this._setReadyState=function(r){const n=new CustomEvent("readystatechange");n.readyState=r,this.readyState=r,this.dispatchEvent(n)},this._onStreamFailure=function(r){const n=new CustomEvent("error");n.responseCode=r.currentTarget.status,n.data=r.currentTarget.response,this.dispatchEvent(n),this._markClosed()},this._onStreamAbort=function(){this.dispatchEvent(new CustomEvent("abort")),this._markClosed()},this._onStreamProgress=function(r){if(!this.xhr)return;if(this.xhr.status<200||this.xhr.status>=300){this._onStreamFailure(r);return}this.retryCount=0;const n=this.xhr.responseText.substring(this.progress);this.progress+=n.length;const 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,c;if(a>0){const l=i[a+1]===" "?2:1;s=i.substring(0,a),c=i.substring(a+l)}else if(a<0)s=i,c="";else return;s in n&&(s==="data"&&n[s]!==null?n.data+=`
|
|
59
59
|
`+c:n[s]=c)}).bind(this)),n.data===null)return null;n.id!==null&&(this.lastEventId=n.id);const o=new CustomEvent(n.event||"message");return o.id=n.id,o.data=n.data||"",o.lastEventId=this.lastEventId,o},this._onReadyStateChange=function(){if(this.xhr&&this.xhr.readyState===XMLHttpRequest.HEADERS_RECEIVED){const r={},n=this.xhr.getAllResponseHeaders().trim().split(`\r
|
|
60
60
|
`);for(const i of n){const[a,...s]=i.split(":"),c=s.join(":").trim();r[a.trim().toLowerCase()]=r[a.trim().toLowerCase()]||[],r[a.trim().toLowerCase()].push(c)}const o=new CustomEvent("open");o.responseCode=this.xhr.status,o.headers=r,this.dispatchEvent(o),this._setReadyState(Lt.OPEN)}},this.stream=function(){if(!this.xhr){this._setReadyState(Lt.CONNECTING),this.xhr=new XMLHttpRequest,this.xhr.addEventListener("progress",this._onStreamProgress.bind(this)),this.xhr.addEventListener("load",this._onStreamLoaded.bind(this)),this.xhr.addEventListener("readystatechange",this._onReadyStateChange.bind(this)),this.xhr.addEventListener("error",this._onStreamFailure.bind(this)),this.xhr.addEventListener("abort",this._onStreamAbort.bind(this)),this.xhr.open(this.method,this.url);for(let r in this.headers)this.xhr.setRequestHeader(r,this.headers[r]);this.useLastEventId&&this.lastEventId.length>0&&this.xhr.setRequestHeader("Last-Event-ID",this.lastEventId),this.xhr.withCredentials=this.withCredentials,this.xhr.send(this.payload)}},this.close=function(){this.readyState!==Lt.CLOSED&&(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.autoReconnect=!1,this.xhr.abort())},(e.start===void 0||e.start)&&this.stream()};Lt.INITIALIZING=-1;Lt.CONNECTING=0;Lt.OPEN=1;Lt.CLOSED=2;typeof exports<"u"&&(exports.SSE=Lt);class kf{constructor(e,r,n){this.options=r,this.payload=n;const o={headers:{"content-type":"application/json"}};n&&(o.payload=JSON.stringify(n)),r.apiKey&&(o.headers["api-key"]=r.apiKey),this.eventSource=new(r.EventSource??Lt)(e,o),this.eventSource.onmessage=i=>{try{const a=JSON.parse(i.data);r.onMessage(a)}catch(a){r.onError(new CustomEvent("parse-error",{detail:a}))}},this.eventSource.onerror=i=>{r.onError(i),this.isClosed()&&this.close()}}eventSource;triggeredOnClose=!1;isClosed(){return this.eventSource.readyState===EventSource.CLOSED}close(){this.isClosed()||this.eventSource.close(),this.triggeredOnClose||(this.triggeredOnClose=!0,this.options.onClose())}}const Os=t=>Object.fromEntries(Object.entries(t).filter(([e,r])=>r!=null));class Sf{constructor(e){this.options=e}getDefaultHeaders(e={}){const r={"Content-Type":"application/json",...e};return this.options.apiKey&&(r["api-key"]=this.options.apiKey),r}get speechRecognitionApiKey(){return this.options.speechRecognitionApiKey}async subscribeSse(e,r={},n){const o=Os(r);return this.options.apiKey&&(n.apiKey=this.options.apiKey),new kf(`${this.options.apiUrl}${e}`,n,o)}async fetchData(e,r,n={},o={}){const i=`${this.options.apiUrl}${e}?${new URLSearchParams(Os(n)).toString()}`,a={...o,headers:this.getDefaultHeaders(o?.headers)},s=await fetch(i,a);if(!s.ok){const g=await s.text();throw new Error(`API request failed: ${s.status} - ${g}`)}const c=await s.json(),{success:l,data:d,error:h}=r.safeParse(c);if(this.options.strict){if(!l)throw console.error(`Server response has wrong type:
|
|
61
61
|
`,{error:h,url:i,opts:a,data:c}),new Error(`Server response has wrong type: ${h.message}`);return d}else return l||console.warn(`Server response has wrong type:
|
|
@@ -191,7 +191,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An err
|
|
|
191
191
|
.sonner-loading-bar {transition:none !important;
|
|
192
192
|
animation: none !important;}
|
|
193
193
|
}.sonner-loader {position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);transform-origin:center;transition:opacity 200ms,
|
|
194
|
-
transform 200ms;}.sonner-loader[data-visible='false'] {opacity:0;transform:scale(0.8) translate(-50%, -50%);}`};function gp(t,e){const r=bi(e,["children","$$slots","$$events","$$legacy","$$host"]),n=bi(r,["invert","theme","position","hotkey","containerAriaLabel","richColors","expand","duration","visibleToasts","closeButton","toastOptions","offset","dir"]);ue(e,!1),Fo(t,pp);const[o,i]=Ol(),a=()=>On(C,"$toasts",o),s=()=>On(te,"$heights",o),c=De(),l=De(),d=3,h="32px",g=356,b=14,v="dark",m="light";function y($){return $!=="system"?$:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?v:m}function w(){if(typeof window>"u"||typeof document>"u")return"ltr";const $=document.documentElement.getAttribute("dir");return $==="auto"||!$?window.getComputedStyle(document.documentElement).direction:$}let _=p(e,"invert",12,!1),x=p(e,"theme",12,"light"),k=p(e,"position",12,"bottom-right"),E=p(e,"hotkey",28,()=>["altKey","KeyT"]),P=p(e,"containerAriaLabel",12,"Notifications"),S=p(e,"richColors",12,!1),U=p(e,"expand",12,!1),j=p(e,"duration",12,4e3),G=p(e,"visibleToasts",12,d),I=p(e,"closeButton",12,!1),B=p(e,"toastOptions",28,()=>({})),W=p(e,"offset",12,null),M=p(e,"dir",28,w);const{toasts:C,heights:te,reset:le}=Ht;let oe=De(!1),ie=De(!1),L=De(y(x())),Z=De(),H=null,R=!1;Md(()=>{u(Z)&&H&&(H.focus({preventScroll:!0}),H=null,R=!1)}),No(()=>{le();const $=Te=>{E().every(Re=>Te[Re]||Te.code===Re)&&(O(oe,!0),u(Z)?.focus()),Te.code==="Escape"&&(document.activeElement===u(Z)||u(Z)?.contains(document.activeElement))&&O(oe,!1)};return document.addEventListener("keydown",$),()=>{document.removeEventListener("keydown",$)}});function K($){R&&!$.currentTarget.contains($.relatedTarget)&&(R=!1,H&&(H.focus({preventScroll:!0}),H=null))}function be($){R||(R=!0,H=$.relatedTarget)}He(()=>(ee(k()),a()),()=>{O(c,Array.from(new Set([k(),...a().filter($=>$.position).map($=>$.position)].filter(Boolean))))}),He(()=>ee(E()),()=>{O(l,E().join("+").replace(/Key/g,"").replace(/Digit/g,""))}),He(()=>a(),()=>{a().length<=1&&O(oe,!1)}),He(()=>a(),()=>{const $=a().filter(Te=>Te.dismiss&&!Te.delete);if($.length>0){const Te=a().map(ze=>$.find(Ae=>Ae.id===ze.id)?{...ze,delete:!0}:ze);C.set(Te)}}),He(()=>ee(x()),()=>{if(x()!=="system"&&O(L,x()),typeof window<"u"){x()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O(L,v):O(L,m));const $=window.matchMedia("(prefers-color-scheme: dark)"),Te=({matches:ze})=>{O(L,ze?v:m)};"addEventListener"in $?$.addEventListener("change",Te):$.addListener(Te)}}),Al(),Do();var Ie=Y(),Je=V(Ie);{var Se=$=>{var Te=fp();pe(Te,"tabindex",-1),Jt(Te,5,()=>u(c),Cr,(ze,Re,Ae,Ye)=>{var ye=hp();We(ye,(Ne,Qe,At,ft)=>({tabIndex:-1,class:(ee(r),fe(()=>r.class)),"data-sonner-toaster":!0,"data-theme":u(L),"data-rich-colors":S(),dir:Ne,"data-y-position":Qe,"data-x-position":At,style:(ee(r),fe(()=>r.style)),...n,[Zr]:ft}),[()=>(ee(M()),fe(()=>M()==="auto"?w():M())),()=>(u(Re),fe(()=>u(Re).split("-")[0])),()=>(u(Re),fe(()=>u(Re).split("-")[1])),()=>({"--front-toast-height":(s(),fe(()=>`${s()[0]?.height}px`)),"--offset":typeof W()=="number"?`${W()}px`:W()||h,"--width":`${g}px`,"--gap":`${b}px`})],void 0,"svelte-1fo5d1m"),Jt(ye,7,()=>(a(),u(Re),fe(()=>a().filter(Ne=>!Ne.position&&Ae===0||Ne.position===u(Re)))),Ne=>Ne.id,(Ne,Qe,At,ft)=>{{let lr=fr(()=>(ee(B()),fe(()=>B()?.actionButtonStyle||""))),pt=fr(()=>(ee(B()),fe(()=>B()?.cancelButtonStyle||""))),Dt=fr(()=>(ee(B()),fe(()=>B()?.class||""))),Ct=fr(()=>(ee(B()),fe(()=>B()?.descriptionClass||""))),Kt=fr(()=>(ee(B()),fe(()=>B().classes||{}))),Pt=fr(()=>(ee(B()),ee(j()),fe(()=>B()?.duration??j()))),cr=fr(()=>(ee(B()),fe(()=>B().unstyled||!1)));cc(Ne,{get index(){return u(At)},get toast(){return u(Qe)},get invert(){return _()},get visibleToasts(){return G()},get closeButton(){return I()},get interacting(){return u(ie)},get position(){return u(Re)},get expandByDefault(){return U()},get expanded(){return u(oe)},get actionButtonStyle(){return u(lr)},get cancelButtonStyle(){return u(pt)},get class(){return u(Dt)},get descriptionClass(){return u(Ct)},get classes(){return u(Kt)},get duration(){return u(Pt)},get unstyled(){return u(cr)},$$slots:{"loading-icon":(gt,ur)=>{var nt=Y(),xe=V(nt);nr(xe,e,"loading-icon",{},ut=>{{let dr=fr(()=>(u(Qe),fe(()=>u(Qe).type==="loading")));lc(ut,{get visible(){return u(dr)}})}}),A(gt,nt)},"success-icon":(gt,ur)=>{var nt=Y(),xe=V(nt);nr(xe,e,"success-icon",{},ut=>{An(ut,{type:"success"})}),A(gt,nt)},"error-icon":(gt,ur)=>{var nt=Y(),xe=V(nt);nr(xe,e,"error-icon",{},ut=>{An(ut,{type:"error"})}),A(gt,nt)},"warning-icon":(gt,ur)=>{var nt=Y(),xe=V(nt);nr(xe,e,"warning-icon",{},ut=>{An(ut,{type:"warning"})}),A(gt,nt)},"info-icon":(gt,ur)=>{var nt=Y(),xe=V(nt);nr(xe,e,"info-icon",{},ut=>{An(ut,{type:"info"})}),A(gt,nt)}}})}}),N(ye),Br(ye,Ne=>O(Z,Ne),()=>u(Z)),ge(()=>ye.dir=ye.dir),ht("blur",ye,K),ht("focus",ye,be),ht("mouseenter",ye,()=>O(oe,!0)),ht("mousemove",ye,()=>O(oe,!0)),ht("mouseleave",ye,()=>{u(ie)||O(oe,!1)}),ht("pointerdown",ye,()=>O(ie,!0)),ht("pointerup",ye,()=>O(ie,!1)),A(ze,ye)}),N(Te),ge(()=>pe(Te,"aria-label",`${P()} ${u(l)}`)),A($,Te)};J(Je,$=>{a(),fe(()=>a().length>0)&&$(Se)})}A(t,Ie);var Ge=de({get invert(){return _()},set invert($){_($),f()},get theme(){return x()},set theme($){x($),f()},get position(){return k()},set position($){k($),f()},get hotkey(){return E()},set hotkey($){E($),f()},get containerAriaLabel(){return P()},set containerAriaLabel($){P($),f()},get richColors(){return S()},set richColors($){S($),f()},get expand(){return U()},set expand($){U($),f()},get duration(){return j()},set duration($){j($),f()},get visibleToasts(){return G()},set visibleToasts($){G($),f()},get closeButton(){return I()},set closeButton($){I($),f()},get toastOptions(){return B()},set toastOptions($){B($),f()},get offset(){return W()},set offset($){W($),f()},get dir(){return M()},set dir($){M($),f()}});return i(),Ge}ce(gp,{invert:{},theme:{},position:{},hotkey:{},containerAriaLabel:{},richColors:{},expand:{},duration:{},visibleToasts:{},closeButton:{},toastOptions:{},offset:{},dir:{}},["loading-icon","success-icon","error-icon","warning-icon","info-icon"],[],!0);const mp=console.warn,vp=()=>{},Ri=t=>{console.warn=vp;const e=Bd(t);return console.warn=mp,e},uc=Symbol("uninitialized"),bp={[uc]:!0},wp=t=>typeof t=="object"&&t!==null&&uc in t,yp=t=>t&&Object.prototype.toString.call(t)==="[object Promise]",xp=t=>{let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+((e<<5)-e);let r="#";for(let n=0;n<3;n++){let o=e>>n*8&255;o=Math.min(o,180),r+=o.toString(16).padStart(2,"0")}return r};function dc(t,e){const r={};for(const n of e){const o=Object.getOwnPropertyDescriptor(t,n)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),n);try{(o?.get||typeof t[n]!="function")&&(r[n]=t[n])}catch(i){console.error(i)}}return r}const En=({start:t,args:e,prop:r,target:n,error:o,meta:i,allPropertyNames:a})=>{const s=t?"┏":"┗",c=o?console.error:console.log,l=o?console.group:console.groupCollapsed,d=String(r);l(`%c${s} ${d}`,`color: white; font-size: 0.9em; font-weight: 400; letter-spacing: 3px; background: ${xp(String(d))}; border-radius: 2px; padding: 1px 2px;`,...e),console.log("%cSTATE:","color: gray; font-size: 0.8em; letter-spacing: 3px;"),console.log(Ri(dc(n,a))),i&&(console.log(`%c${i.label.toUpperCase()}:`,"color: gray; font-size: 0.8em; letter-spacing: 3px;"),c(i.data)),console.groupEnd()},_p=t=>{const e=new Set;Object.getOwnPropertyNames(t).forEach(n=>e.add(n));let r=Object.getPrototypeOf(t);for(;r&&r!==Object.prototype;)Object.getOwnPropertyNames(r).forEach(n=>e.add(n)),r=Object.getPrototypeOf(r);return Array.from(e)},kp=Symbol("raw"),hc=(t,e)=>{const r=_p(t);let n=D(()=>Ri(dc(t,r)));return new Proxy(t,{get(o,i,a){if(i===kp)return o;const s=Reflect.get(o,i);return typeof s=="function"?function(...c){let l;e.logging&&(l=Ri(c),En({start:!0,args:l,target:o,prop:i,allPropertyNames:r}));let d;try{const h=e.enforceImmutableData?hc(o,{...e,enforceImmutableData:!1}):a;d=s.apply(h,c)}catch(h){throw e.logging&&En({start:!1,args:l,target:o,allPropertyNames:r,prop:i,error:!0,meta:{label:"threw",data:h}}),h}return e.logging&&(yp(d)?d.then(h=>{En({start:!1,args:l,target:o,allPropertyNames:r,prop:i,meta:{label:"resolved",data:h}})},h=>{En({start:!1,args:l,target:o,allPropertyNames:r,prop:i,error:!0,meta:{label:"rejected",data:h}})}):En({start:!1,args:l,target:o,allPropertyNames:r,prop:i,meta:{label:"returned",data:d}})),d}:(wp(s)&&console.error(`Accessed "${String(i)}" before initializing it.`),e.enforceImmutableData?Reflect.get(u(n),i):s)},set(o,i,a){return e.enforceImmutableData?console.error(`Tried to set field "${String(i)}" from outside the ${e.className} class to:`,a):Reflect.set(o,i,a),!0}})},Sp=(t,e={})=>{const r=new t,n=t.name||"<unnamed class>",o={logging:!1,enforceImmutableData:!0,...e,className:n};return hc(r,o)};async function Tp(){if(typeof navigator>"u"||!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return!1;try{return(await navigator.mediaDevices.enumerateDevices()).some(e=>e.kind==="audioinput")}catch(t){return console.error("Error checking for microphone:",t),!1}}function Di(){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 zs(){return typeof window>"u"?!1:!!(window.MediaRecorder&&Di())}class Li{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(!zs()||!navigator.mediaDevices){const e=new Error("MediaRecorder not supported or no microphone access");throw this.options.onError?.(e),e}try{if(this.starting=!0,this.stream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1}),!this.starting){this.stopStream(this.stream);return}this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&(console.warn("AudioRecorder: MediaRecorder already active, stopping previous recording"),this.mediaRecorder.stop(),this.cleanup()),this.started=!0,this.starting=!1;const e=Di();if(!e)throw new Error("No supported media type found");const r={mimeType:e};this.mediaRecorder=new MediaRecorder(this.stream,r),this.audioChunks=[],this.mediaRecorder.ondataavailable=n=>{n.data.size>0&&this.audioChunks.push(n.data)},this.mediaRecorder.onstop=async()=>{const n=this.audioChunks.length>0?new Blob(this.audioChunks,{type:e}):null;await this.options.onDataAvailable?.(n),this.options.onStop?.(),this.cleanup()},this.mediaRecorder.onerror=n=>{const o=new Error(`MediaRecorder error: ${n}`);this.options.onError?.(o),this.cleanup()},this.mediaRecorder.start(),this.setupVolumeAnalysis(this.stream),this.options.onStart?.()}catch(e){this.started=!1,this.starting=!1;const r=e instanceof Error?e:new Error(String(e));throw this.options.onError?.(r),r}}stop(){this.started=!1,this.starting=!1,this.volumeUpdateInterval&&(clearInterval(this.volumeUpdateInterval),this.volumeUpdateInterval=null),this.mediaRecorder&&this.mediaRecorder.state!=="inactive"?this.mediaRecorder.stop():(this.stream&&this.stopStream(this.stream),this.cleanup())}setupVolumeAnalysis(e){if(this.options.onVolumeChange)try{this.audioContext=new AudioContext,this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=256,this.analyser.smoothingTimeConstant=.8;const r=this.analyser.frequencyBinCount;this.dataArray=new Uint8Array(r),this.audioContext.createMediaStreamSource(e).connect(this.analyser),this.startVolumeMonitoring()}catch(r){console.warn("Failed to set up volume analysis:",r)}}startVolumeMonitoring(){!this.analyser||!this.dataArray||!this.options.onVolumeChange||(this.volumeUpdateInterval=window.setInterval(()=>{if(!this.analyser||!this.dataArray||!this.started)return;this.analyser.getByteFrequencyData(this.dataArray);let e=0;for(let i=0;i<this.dataArray.length;i++)e+=this.dataArray[i]*this.dataArray[i];let n=Math.sqrt(e/this.dataArray.length)/255;n=Math.pow(n*3,.7);const 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(e){e.getTracks().forEach(r=>r.stop())}cleanup(){this.volumeUpdateInterval&&(clearInterval(this.volumeUpdateInterval),this.volumeUpdateInterval=null),this.audioContext&&(this.audioContext.close().catch(console.warn),this.audioContext=null),this.analyser=null,this.dataArray=null,this.stream&&(this.stopStream(this.stream),this.stream=null),this.mediaRecorder=null,this.audioChunks=[],this.started=!1,this.starting=!1}static isSupported(){return zs()}static getSupportedMediaType(){return Di()}}const Ep=t=>(localStorage.setItem("liipgpt-color-scheme",t),pc(["light","dark"])),fc=()=>{const t=localStorage.getItem("liipgpt-color-scheme");return t==="light"||t==="dark"?t:"system"},pc=t=>{let e=fc();return e==="system"&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),t.includes(e)?e:t[0]??"light"},Ap=[{type:"email",check:t=>/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/.test(t)},{type:"creditCard",check:t=>/\b(?:\d[ -]*?){13,16}\b/.test(t)},{type:"ahv",check:t=>/\b756\.\d{4}\.\d{4}\.\d{2}\b/.test(t)},{type:"phoneSwiss",check:t=>/\b0(?:\s*\d){2}(?:\s*\/\s*)?(?:\s*\d){7,}\b/.test(t)},{type:"phoneInternational",check:t=>/(?:\+|00)(?:\s*\d){10,}\b/.test(t)},{type:"swissPassport",check:t=>/\b[A-HJ-NP-Z](?=.*\d)[A-HJ-NP-Z0-9]{7}\b/.test(t)},{type:"longNumber",check:t=>/\b\d{9,}\b/.test(t)}],Bs=t=>{for(const e of Ap)if(e.check(t))return e.type};class Cp extends Error{constructor(e){super(e),this.name="UnreachableError"}}const Pp=()=>{const e=new URLSearchParams(window.location.search).get("q");return e?{name:"chat-page",query:e}:{name:"start-page"}};class Op{#e=he(Fr(bp));get data(){return u(this.#e)}set data(e){O(this.#e,e,!0)}#t=he(Fr({}));get targets(){return u(this.#t)}set targets(e){O(this.#t,e,!0)}#r=he(!1);get initialized(){return u(this.#r)}set initialized(e){O(this.#r,e,!0)}#n=he(0);get currentAudioVolume(){return u(this.#n)}set currentAudioVolume(e){O(this.#n,e,!0)}client;props;#o=he(null);get currentAudioRecorder(){return u(this.#o)}set currentAudioRecorder(e){O(this.#o,e,!0)}#i=he(!1);get isTranscribing(){return u(this.#i)}set isTranscribing(e){O(this.#i,e,!0)}lastChatResponse;async init(e){this.props=e;const r=e.speechRecognitionApiKey||void 0;this.client=new Df({apiUrl:e.apiUrl,apiKey:e.apiKey,speechRecognitionApiKey:r,strict:!0});try{const n=await this.client.getChatConfig();window.CHAT_CONFIG_OVERRIDE&&Object.assign(n,window.CHAT_CONFIG_OVERRIDE);const i=(await this.client.getMetadata()).mode==="maintenance";i&&this.showErrorToast("maintenance");const a=Bf(n);let s;e.lang?s=Ii(e.lang,a.supportedLanguages):s=Wf(a.supportedLanguages);const c=await this.getPredefinedQuestions(s),l=[];if(a.renderKatex){const g=await Rd(()=>import("https://esm.sh/marked-katex-extension@5.1.5"),[],import.meta.url).catch(b=>{console.error("Couldn't load marked-katex-extension:",b)});g&&(this.client.setMarkedExtensions(g.default({nonStandard:!0,output:"mathml"})),l.push("https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css"))}const d=Object.keys(a.fullTheme);this.data={currentConverstionState:"idle",chatConfig:a,language:s,predefinedQuestions:c,isInMaintenance:i,history:[],selectedColorScheme:fc(),has2ColorSchemes:d.length===2,currentColorScheme:pc(d),feedbackOpenedId:void 0,feedbackOpenedConversation:!1,props:e,flyoutIsOpen:!1,questionHasPii:void 0,chatInputValue:"",currentReferencesAsideId:void 0,route:{name:"start-page"},additionalStylesheets:l},window.LIIPGPT_LISTENERS?.route?.(this.data.route),window.LIIPGPT_LISTENERS?.conversation?.(this.data.currentConverstionState),this.initialized=!0,this.goto(Pp())}catch(n){throw di.error(n instanceof Error?n.message:"Failed to load the chatbot. Please reload the page.",{duration:1e4,unstyled:!0,classes:{toast:"toast"}}),n}}setTarget(e,r){this.targets[e]=r}goto(e){if(!Gf(this.data.route,e))switch(this.data.route=e,window.LIIPGPT_LISTENERS?.route?.(e),e.name){case"start-page":e.prefill&&(this.data.chatInputValue=e.prefill);break;case"chat-page":if(this.data.chatInputValue=e.query,this.onSubmit(),this.data.chatConfig.addQueryToUrlParams){const r=new URLSearchParams(window.location.search);r.set("q",e.query),history.pushState(null,"",`?${r.toString()}`)}break}}#s=D(()=>{if(!this.initialized)return[];const e=this.data.chatConfig.menu;return e?e[this.data.language]??[]:[]});get menu(){return u(this.#s)}set menu(e){O(this.#s,e)}#a=D(()=>this.initialized?this.data.chatConfig.translations[this.data.language]??{}:{});get t(){return u(this.#a)}set t(e){O(this.#a,e)}#l=D(()=>this.initialized?Is[this.data.language]??{}:Is.en??{});get errorTranslations(){return u(this.#l)}set errorTranslations(e){O(this.#l,e)}#c=D(()=>this.initialized?Rs[this.data.language]??{}:Rs.en??{});get piiTranslations(){return u(this.#c)}set piiTranslations(e){O(this.#c,e)}#d=D(()=>this.initialized?this.data.currentColorScheme:"light");get colorScheme(){return u(this.#d)}set colorScheme(e){O(this.#d,e)}#u=D(()=>this.initialized?this.data.chatConfig.fullTheme[this.data.currentColorScheme]:{});get themeBase(){return u(this.#u)}set themeBase(e){O(this.#u,e)}#h=D(()=>this.themeBase.tokens);get theme(){return u(this.#h)}set theme(e){O(this.#h,e)}async getPredefinedQuestions(e){try{return this.client.getPredefinedQuestions({url:window.location.href.replace(window.location.origin,""),language:e})}catch(r){return console.warn("Failed to load predefined questions:",r),[]}}setColorScheme(e){this.data.selectedColorScheme=e,this.data.currentColorScheme=Ep(e)}async abort(){await this.lastChatResponse?.abort()}changeConversationState(e){this.data.currentConverstionState=e,window.LIIPGPT_LISTENERS?.conversation?.(e)}onInput(e){this.data.chatConfig.blockPII&&(this.data.questionHasPii=Bs(e)),this.data.chatInputValue=e}onSubmit(){if(this.data.questionHasPii){console.warn("Question contains PII, not submitting:",this.data.questionHasPii);return}const e=this.data.chatConfig.questionPrefix?`${this.data.chatConfig.questionPrefix} ${this.data.chatInputValue}`:this.data.chatInputValue,r=this.data.history.push({type:"user",time:new Date().toISOString(),message:this.data.chatInputValue});this.data.history.push({id:"UNRESOLVED",state:"loading",errors:[],type:"bot",time:new Date().toISOString(),message:{markdown:"",html:""},references:{all:[],used:[],unused:[]}});const n={features:this.props.features?this.props.features.trim().split(","):["formatting"],onError:s=>{this.showErrorToast(s),window.LIIPGPT_LISTENERS?.error?.(s),(s==="pii-detected"||s==="blocked")&&this.editLatestQuestion()},lang:this.data.language},o=this.data.chatConfig.sendReferrer??"all";(o==="all"||o==="own")&&(n.referrer=this.data.props.flyout?`${window.location.protocol}//${window.location.host}${window.location.pathname}`:document.referrer,(!n.referrer||!this.data.props.flyout&&o==="own"&&!n.referrer.startsWith(window.location.origin))&&(n.referrer=void 0)),this.data.currentConversationId||(this.data.currentConversationId=this.client.createConversationId());const i=this.client.chat(this.data.currentConversationId,e,n);this.lastChatResponse=i,this.data.lastChatResponseId=i.id,this.changeConversationState("searching");let a;i.subscribe(s=>{this.data.history[r]&&(this.data.history[r]={question:this.data.chatInputValue,...s}),s.state==="streaming"&&this.changeConversationState("answering"),s.state==="done"&&(this.changeConversationState("idle"),this.data.currentReferencesAsideId&&this.data.history[r].references.used.length>0?(clearTimeout(a),a=setTimeout(()=>{this.openReferencesAside(s.id)},100)):this.closeReferencesAside())}),this.data.chatInputValue=""}async onStartSpeechRecognition(){try{if(!await Tp()){this.showErrorToast("speech-not-supported");return}if(await navigator.mediaDevices.getUserMedia({audio:!0}),Li.isSupported())this.data.chatInputValue="",this.currentAudioRecorder=new Li({onDataAvailable:async r=>{this.isTranscribing=!0,await this.handleTranscription(r)},onError:()=>{this.showErrorToast("speech-microphone-access-denied"),this.currentAudioRecorder=null,this.isTranscribing=!1},onVolumeChange:r=>{this.currentAudioVolume=r}}),this.currentAudioRecorder.start();else{this.showErrorToast("speech-not-supported");return}}catch(e){throw this.showErrorToast("speech-microphone-access-denied"),this.currentAudioRecorder=null,this.isTranscribing=!1,e}}editLatestQuestion(){const e=this.data.history.findLastIndex(n=>n?.type==="user");if(e===-1){console.error("No last user question, available");return}const r=this.data.history.splice(e)[0];console.log(r),this.data.chatInputValue=r.message}onStopSpeechRecognition(){if(this.currentAudioRecorder){const e=this.currentAudioRecorder;this.currentAudioRecorder=null,e.stop()}this.currentAudioVolume=0}async handleTranscription(e){if(!e){console.warn("No audio data received");return}try{const r=await this.client.transcribeAudio(e,{lang:this.data.language});if(r.error){this.showErrorToast("speech-transcription-failed");return}if(r.transcript.trim()){if(this.data.chatConfig.blockPII&&(this.data.questionHasPii=Bs(r.transcript.trim()),this.data.questionHasPii))return;this.data.chatInputValue=r.transcript.trim()}else this.showErrorToast("speech-no-text-detected")}catch(r){console.error("Speech transcription error:",r),this.showErrorToast("speech-transcription-failed")}finally{this.currentAudioRecorder=null,this.isTranscribing=!1,this.currentAudioVolume=0}}async onStartConversation(e){await this.abort(),this.data.history=[],this.data.currentConversationId=this.client.createConversationId(),this.goto({name:"chat-page",query:e})}async onNewConversation(){await this.abort(),this.data.currentConversationId=void 0,this.data.currentReferencesAsideId=void 0,this.data.history=[],this.goto({name:"start-page"})}showSuccessToast(e){di.success(this.t[e],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})}showErrorToast(e){di.error(this.errorTranslations[e],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})}async submitFeedback(e){try{const r=this.data.feedbackOpenedId||this.data.lastChatResponseId;if(!r)throw new Cp("Tried to give feedback with no id.");const n=this.data.history.find(o=>o.type==="bot"&&o.id===r);await this.client.feedback(r,n?.question??"",e),this.showSuccessToast("thankYouForFeedback")}catch(r){console.error("Feedback failed:",r),this.showErrorToast("feedback-failed")}}toggleReferencesAside=e=>{this.data.currentReferencesAsideId=this.data.currentReferencesAsideId===e?void 0:e};openReferencesAside=e=>{this.data.currentReferencesAsideId=e};closeReferencesAside=()=>{this.data.currentReferencesAsideId=void 0};openFlyout(){this.data.flyoutIsOpen=!0}closeFlyout(){this.data.flyoutIsOpen=!1}openConverstionFeedback(){this.data.feedbackOpenedConversation=!0}openMessageFeedback(e){this.data.feedbackOpenedId=e}closeFeedback(){this.data.feedbackOpenedConversation=!1,this.data.feedbackOpenedId=void 0}async thumbs(e,r){try{const n=this.data.history.find(o=>o.type==="bot"&&o.id===e);r==="up"?await this.client.thumbsUp(e,n?.question??""):await this.client.thumbsDown(e,n?.question??""),this.showSuccessToast("thankYouForFeedback")}catch(n){console.error("Feedback failed:",n),this.showErrorToast("feedback-failed")}}async onLanguageChange(e){if(this.data.language=Ii(e,this.data.chatConfig.supportedLanguages),Vf(this.data.language),this.data.predefinedQuestions=await this.getPredefinedQuestions(this.data.language),this.data.chatConfig.reflectLanguageInPath){const r=new URL(window.location.href);r.pathname=`/${this.data.language}`,window.history.replaceState({},"",r.toString())}}}const me=Sp(Op),sa=(t,e)=>{const r=window.LIIPGPT_LISTENERS?.elements?.[e];if(!r)return;const n=Object.entries(r).filter(([o,i])=>typeof i=="function"&&!["init","destroy"].includes(o));Ue(()=>(r.init?.(t),n.forEach(([o,i])=>{t.addEventListener(o,i)}),()=>{n.forEach(([o,i])=>{t.addEventListener(o,i)}),r.destroy?.(t)}))},Ip=(t,e)=>{e&&me.setTarget(e,t)};var Rp=X('<div aria-hidden="true"><!></div>');function Ze(t,e){ue(e,!0);let r=p(e,"name",7),n=p(e,"class",7);var o=Rp(),i=z(o);return Pr(i,()=>me.theme.svgs[r()]),N(o),ge(()=>rt(o,1,`svg svg--${r()??""} ${n()??""}`)),A(t,o),de({get name(){return r()},set name(a){r(a),f()},get class(){return n()},set class(a){n(a),f()}})}ce(Ze,{name:{},class:{}},[],[],!0);function cn(t,e){let r=null,n;function o(){e.text&&(r||(r=document.createElement("span"),r.textContent=e.text,r.className=`tooltip tooltip-${e.position||"top"} tooltip-hidden`,t.appendChild(r),r.getBoundingClientRect()),r.classList.remove("tooltip-hidden"),i())}function i(){if(!r)return;const c=t.getBoundingClientRect(),l=r.getBoundingClientRect();let d,h;switch(e.position){case"bottom":d=c.height+5,h=c.width/2-l.width/2;break;case"bottom-right":d=c.height+5,h=c.width-l.width;break;case"bottom-left":d=c.height+5,h=0;break;case"left":d=c.height/2-l.height/2,h=-l.width-5;break;case"right":d=c.height/2-l.height/2,h=c.width+5;break;case"top":default:d=-l.height-5,h=c.width/2-l.width/2;break}r.style.top=`${d}px`,r.style.left=`${h}px`}function a(){n=window.setTimeout(()=>{o()},e.delay||200)}function s(){clearTimeout(n),r&&(r.classList.add("tooltip-hidden"),r.addEventListener("transitionend",()=>{r?.remove(),r=null},{once:!0}))}return t.classList.add("tooltip-container"),t.setAttribute("tabindex","0"),t.addEventListener("mouseenter",a),t.addEventListener("focus",a),t.addEventListener("mouseleave",s),t.addEventListener("blur",s),t.addEventListener("click",s),{update(c){e=c},destroy(){s(),t.classList.remove("tooltip-container"),t.removeEventListener("mouseenter",a),t.removeEventListener("focus",a),t.removeEventListener("mouseleave",s),t.removeEventListener("blur",s),t.removeEventListener("click",s)}}}var Dp=X('<div class="btn-wrapper chat-close"><button class="btn btn--tertiary btn--square"><span class="sr-only"> </span> <!></button></div>');function Lp(t,e){ue(e,!0);let r=D(()=>me.t),n=p(e,"onclick",7);var o=Dp(),i=z(o);i.__click=function(...l){n()?.apply(this,l)};var a=z(i),s=z(a,!0);N(a);var c=ne(a,2);return Ze(c,{name:"dismiss"}),N(i),St(i,(l,d)=>cn?.(l,d),()=>({text:u(r).closeChat,position:"bottom-right",delay:600})),N(o),ge(()=>{pe(i,"aria-label",u(r).closeChat),Ee(s,u(r).closeChat)}),A(t,o),de({get onclick(){return n()},set onclick(l){n(l),f()}})}jt(["click"]);ce(Lp,{onclick:{}},[],[],!0);var Np=Un('<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><defs><linearGradient x1="0" y1="1" x2="0" y2="0"><stop></stop><stop></stop></linearGradient><mask maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24"><g stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"><path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path><path d="M19 10v2a7 7 0 0 1-14 0v-2"></path><path d="M12 19v4"></path><path d="M8 23h8"></path></g></mask></defs><rect width="24" height="24"></rect></svg>');function gc(t,e){ue(e,!0);let r=p(e,"level",7),n=p(e,"class",7,""),o=p(e,"baseColor",7,"var(--mic-base-color)"),i=p(e,"accentColor",7,"var(--mic-accent-color)");const a=Math.random().toString(36).substring(2),s=`audio-level-gradient-${a}`,c=`audio-level-mask-${a}`;var l=Np(),d=z(l),h=z(d),g=z(h),b=ne(g);N(h);var v=ne(h);N(d);var m=ne(d);return N(l),ge(()=>{rt(l,0,`audio-level-mic-svg ${n()??""}`),pe(h,"id",s),pe(g,"offset",r()/100),pe(g,"stop-color",i()),pe(b,"offset",r()/100),pe(b,"stop-color",o()),pe(v,"id",c),pe(m,"fill",`url(#${s})`),pe(m,"mask",`url(#${c})`)}),A(t,l),de({get level(){return r()},set level(y){r(y),f()},get class(){return n()},set class(y=""){n(y),f()},get baseColor(){return o()},set baseColor(y="var(--mic-base-color)"){o(y),f()},get accentColor(){return i()},set accentColor(y="var(--mic-accent-color)"){i(y),f()}})}ce(gc,{level:{},class:{},baseColor:{},accentColor:{}},[],[],!0);const Fp=async(t,e,r)=>{try{u(e)?me.onStopSpeechRecognition():await me.onStartSpeechRecognition(),O(r,!1)}catch(n){console.error("Speech recognition error:",n),O(r,!0)}};var Mp=X('<button type="button"><div class="mic-icon" aria-hidden="true"><!></div></button>');function mc(t,e){ue(e,!0);const r=typeof window<"u";let n=D(()=>me.t),o=p(e,"class",7),i=D(()=>!!me.currentAudioRecorder),a=D(()=>r&&Li.isSupported()),s=D(()=>me.currentAudioVolume||0),c=he(!1);Ue(()=>()=>{u(i)&&me.onStopSpeechRecognition()});var l=Y(),d=V(l);{var h=g=>{var b=Mp();let v;b.__click=[Fp,i,c];var m=z(b),y=z(m);gc(y,{get level(){return u(s)}}),N(m),N(b),ge(w=>{pe(b,"aria-label",u(i)?u(n).chatInputStopListening:u(n).chatInputStartListening),v=rt(b,1,`chat-input__mic-button transition-colors ${o()??""}`,null,v,w)},[()=>({"chat-input__mic-button--listening":u(i),"chat-input__mic-button--error":u(c)})]),A(g,b)};J(d,g=>{u(a)&&g(h)})}return A(t,l),de({get class(){return o()},set class(g){o(g),f()}})}jt(["click"]);ce(mc,{class:{}},[],[],!0);const zp=t=>t;function Bp(t){const e=t-1;return e*e*e+1}function Us(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function Hs(t,{delay:e=0,duration:r=400,easing:n=zp}={}){const o=+getComputedStyle(t).opacity;return{delay:e,duration:r,easing:n,css:i=>`opacity: ${i*o}`}}function Wt(t,{delay:e=0,duration:r=400,easing:n=Bp,x:o=0,y:i=0,opacity:a=0}={}){const s=getComputedStyle(t),c=+s.opacity,l=s.transform==="none"?"":s.transform,d=c*(1-a),[h,g]=Us(o),[b,v]=Us(i);return{delay:e,duration:r,easing:n,css:(m,y)=>`
|
|
194
|
+
transform 200ms;}.sonner-loader[data-visible='false'] {opacity:0;transform:scale(0.8) translate(-50%, -50%);}`};function gp(t,e){const r=bi(e,["children","$$slots","$$events","$$legacy","$$host"]),n=bi(r,["invert","theme","position","hotkey","containerAriaLabel","richColors","expand","duration","visibleToasts","closeButton","toastOptions","offset","dir"]);ue(e,!1),Fo(t,pp);const[o,i]=Ol(),a=()=>On(C,"$toasts",o),s=()=>On(te,"$heights",o),c=De(),l=De(),d=3,h="32px",g=356,b=14,v="dark",m="light";function y($){return $!=="system"?$:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?v:m}function w(){if(typeof window>"u"||typeof document>"u")return"ltr";const $=document.documentElement.getAttribute("dir");return $==="auto"||!$?window.getComputedStyle(document.documentElement).direction:$}let _=p(e,"invert",12,!1),x=p(e,"theme",12,"light"),k=p(e,"position",12,"bottom-right"),E=p(e,"hotkey",28,()=>["altKey","KeyT"]),P=p(e,"containerAriaLabel",12,"Notifications"),S=p(e,"richColors",12,!1),U=p(e,"expand",12,!1),j=p(e,"duration",12,4e3),G=p(e,"visibleToasts",12,d),I=p(e,"closeButton",12,!1),B=p(e,"toastOptions",28,()=>({})),W=p(e,"offset",12,null),M=p(e,"dir",28,w);const{toasts:C,heights:te,reset:le}=Ht;let oe=De(!1),ie=De(!1),L=De(y(x())),Z=De(),H=null,R=!1;Md(()=>{u(Z)&&H&&(H.focus({preventScroll:!0}),H=null,R=!1)}),No(()=>{le();const $=Te=>{E().every(Re=>Te[Re]||Te.code===Re)&&(O(oe,!0),u(Z)?.focus()),Te.code==="Escape"&&(document.activeElement===u(Z)||u(Z)?.contains(document.activeElement))&&O(oe,!1)};return document.addEventListener("keydown",$),()=>{document.removeEventListener("keydown",$)}});function K($){R&&!$.currentTarget.contains($.relatedTarget)&&(R=!1,H&&(H.focus({preventScroll:!0}),H=null))}function be($){R||(R=!0,H=$.relatedTarget)}He(()=>(ee(k()),a()),()=>{O(c,Array.from(new Set([k(),...a().filter($=>$.position).map($=>$.position)].filter(Boolean))))}),He(()=>ee(E()),()=>{O(l,E().join("+").replace(/Key/g,"").replace(/Digit/g,""))}),He(()=>a(),()=>{a().length<=1&&O(oe,!1)}),He(()=>a(),()=>{const $=a().filter(Te=>Te.dismiss&&!Te.delete);if($.length>0){const Te=a().map(ze=>$.find(Ae=>Ae.id===ze.id)?{...ze,delete:!0}:ze);C.set(Te)}}),He(()=>ee(x()),()=>{if(x()!=="system"&&O(L,x()),typeof window<"u"){x()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O(L,v):O(L,m));const $=window.matchMedia("(prefers-color-scheme: dark)"),Te=({matches:ze})=>{O(L,ze?v:m)};"addEventListener"in $?$.addEventListener("change",Te):$.addListener(Te)}}),Al(),Do();var Ie=Y(),Je=V(Ie);{var Se=$=>{var Te=fp();pe(Te,"tabindex",-1),Jt(Te,5,()=>u(c),Cr,(ze,Re,Ae,Ye)=>{var ye=hp();We(ye,(Ne,Qe,At,ft)=>({tabIndex:-1,class:(ee(r),fe(()=>r.class)),"data-sonner-toaster":!0,"data-theme":u(L),"data-rich-colors":S(),dir:Ne,"data-y-position":Qe,"data-x-position":At,style:(ee(r),fe(()=>r.style)),...n,[Zr]:ft}),[()=>(ee(M()),fe(()=>M()==="auto"?w():M())),()=>(u(Re),fe(()=>u(Re).split("-")[0])),()=>(u(Re),fe(()=>u(Re).split("-")[1])),()=>({"--front-toast-height":(s(),fe(()=>`${s()[0]?.height}px`)),"--offset":typeof W()=="number"?`${W()}px`:W()||h,"--width":`${g}px`,"--gap":`${b}px`})],void 0,"svelte-1fo5d1m"),Jt(ye,7,()=>(a(),u(Re),fe(()=>a().filter(Ne=>!Ne.position&&Ae===0||Ne.position===u(Re)))),Ne=>Ne.id,(Ne,Qe,At,ft)=>{{let lr=fr(()=>(ee(B()),fe(()=>B()?.actionButtonStyle||""))),pt=fr(()=>(ee(B()),fe(()=>B()?.cancelButtonStyle||""))),Dt=fr(()=>(ee(B()),fe(()=>B()?.class||""))),Ct=fr(()=>(ee(B()),fe(()=>B()?.descriptionClass||""))),Kt=fr(()=>(ee(B()),fe(()=>B().classes||{}))),Pt=fr(()=>(ee(B()),ee(j()),fe(()=>B()?.duration??j()))),cr=fr(()=>(ee(B()),fe(()=>B().unstyled||!1)));cc(Ne,{get index(){return u(At)},get toast(){return u(Qe)},get invert(){return _()},get visibleToasts(){return G()},get closeButton(){return I()},get interacting(){return u(ie)},get position(){return u(Re)},get expandByDefault(){return U()},get expanded(){return u(oe)},get actionButtonStyle(){return u(lr)},get cancelButtonStyle(){return u(pt)},get class(){return u(Dt)},get descriptionClass(){return u(Ct)},get classes(){return u(Kt)},get duration(){return u(Pt)},get unstyled(){return u(cr)},$$slots:{"loading-icon":(gt,ur)=>{var nt=Y(),xe=V(nt);nr(xe,e,"loading-icon",{},ut=>{{let dr=fr(()=>(u(Qe),fe(()=>u(Qe).type==="loading")));lc(ut,{get visible(){return u(dr)}})}}),A(gt,nt)},"success-icon":(gt,ur)=>{var nt=Y(),xe=V(nt);nr(xe,e,"success-icon",{},ut=>{An(ut,{type:"success"})}),A(gt,nt)},"error-icon":(gt,ur)=>{var nt=Y(),xe=V(nt);nr(xe,e,"error-icon",{},ut=>{An(ut,{type:"error"})}),A(gt,nt)},"warning-icon":(gt,ur)=>{var nt=Y(),xe=V(nt);nr(xe,e,"warning-icon",{},ut=>{An(ut,{type:"warning"})}),A(gt,nt)},"info-icon":(gt,ur)=>{var nt=Y(),xe=V(nt);nr(xe,e,"info-icon",{},ut=>{An(ut,{type:"info"})}),A(gt,nt)}}})}}),N(ye),Br(ye,Ne=>O(Z,Ne),()=>u(Z)),ge(()=>ye.dir=ye.dir),ht("blur",ye,K),ht("focus",ye,be),ht("mouseenter",ye,()=>O(oe,!0)),ht("mousemove",ye,()=>O(oe,!0)),ht("mouseleave",ye,()=>{u(ie)||O(oe,!1)}),ht("pointerdown",ye,()=>O(ie,!0)),ht("pointerup",ye,()=>O(ie,!1)),A(ze,ye)}),N(Te),ge(()=>pe(Te,"aria-label",`${P()} ${u(l)}`)),A($,Te)};J(Je,$=>{a(),fe(()=>a().length>0)&&$(Se)})}A(t,Ie);var Ge=de({get invert(){return _()},set invert($){_($),f()},get theme(){return x()},set theme($){x($),f()},get position(){return k()},set position($){k($),f()},get hotkey(){return E()},set hotkey($){E($),f()},get containerAriaLabel(){return P()},set containerAriaLabel($){P($),f()},get richColors(){return S()},set richColors($){S($),f()},get expand(){return U()},set expand($){U($),f()},get duration(){return j()},set duration($){j($),f()},get visibleToasts(){return G()},set visibleToasts($){G($),f()},get closeButton(){return I()},set closeButton($){I($),f()},get toastOptions(){return B()},set toastOptions($){B($),f()},get offset(){return W()},set offset($){W($),f()},get dir(){return M()},set dir($){M($),f()}});return i(),Ge}ce(gp,{invert:{},theme:{},position:{},hotkey:{},containerAriaLabel:{},richColors:{},expand:{},duration:{},visibleToasts:{},closeButton:{},toastOptions:{},offset:{},dir:{}},["loading-icon","success-icon","error-icon","warning-icon","info-icon"],[],!0);const mp=console.warn,vp=()=>{},Ri=t=>{console.warn=vp;const e=Bd(t);return console.warn=mp,e},uc=Symbol("uninitialized"),bp={[uc]:!0},wp=t=>typeof t=="object"&&t!==null&&uc in t,yp=t=>t&&Object.prototype.toString.call(t)==="[object Promise]",xp=t=>{let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+((e<<5)-e);let r="#";for(let n=0;n<3;n++){let o=e>>n*8&255;o=Math.min(o,180),r+=o.toString(16).padStart(2,"0")}return r};function dc(t,e){const r={};for(const n of e){const o=Object.getOwnPropertyDescriptor(t,n)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),n);try{(o?.get||typeof t[n]!="function")&&(r[n]=t[n])}catch(i){console.error(i)}}return r}const En=({start:t,args:e,prop:r,target:n,error:o,meta:i,allPropertyNames:a})=>{const s=t?"┏":"┗",c=o?console.error:console.log,l=o?console.group:console.groupCollapsed,d=String(r);l(`%c${s} ${d}`,`color: white; font-size: 0.9em; font-weight: 400; letter-spacing: 3px; background: ${xp(String(d))}; border-radius: 2px; padding: 1px 2px;`,...e),console.log("%cSTATE:","color: gray; font-size: 0.8em; letter-spacing: 3px;"),console.log(Ri(dc(n,a))),i&&(console.log(`%c${i.label.toUpperCase()}:`,"color: gray; font-size: 0.8em; letter-spacing: 3px;"),c(i.data)),console.groupEnd()},_p=t=>{const e=new Set;Object.getOwnPropertyNames(t).forEach(n=>e.add(n));let r=Object.getPrototypeOf(t);for(;r&&r!==Object.prototype;)Object.getOwnPropertyNames(r).forEach(n=>e.add(n)),r=Object.getPrototypeOf(r);return Array.from(e)},kp=Symbol("raw"),hc=(t,e)=>{const r=_p(t);let n=D(()=>Ri(dc(t,r)));return new Proxy(t,{get(o,i,a){if(i===kp)return o;const s=Reflect.get(o,i);return typeof s=="function"?function(...c){let l;e.logging&&(l=Ri(c),En({start:!0,args:l,target:o,prop:i,allPropertyNames:r}));let d;try{const h=e.enforceImmutableData?hc(o,{...e,enforceImmutableData:!1}):a;d=s.apply(h,c)}catch(h){throw e.logging&&En({start:!1,args:l,target:o,allPropertyNames:r,prop:i,error:!0,meta:{label:"threw",data:h}}),h}return e.logging&&(yp(d)?d.then(h=>{En({start:!1,args:l,target:o,allPropertyNames:r,prop:i,meta:{label:"resolved",data:h}})},h=>{En({start:!1,args:l,target:o,allPropertyNames:r,prop:i,error:!0,meta:{label:"rejected",data:h}})}):En({start:!1,args:l,target:o,allPropertyNames:r,prop:i,meta:{label:"returned",data:d}})),d}:(wp(s)&&console.error(`Accessed "${String(i)}" before initializing it.`),e.enforceImmutableData?Reflect.get(u(n),i):s)},set(o,i,a){return e.enforceImmutableData?console.error(`Tried to set field "${String(i)}" from outside the ${e.className} class to:`,a):Reflect.set(o,i,a),!0}})},Sp=(t,e={})=>{const r=new t,n=t.name||"<unnamed class>",o={logging:!1,enforceImmutableData:!0,...e,className:n};return hc(r,o)};async function Tp(){if(typeof navigator>"u"||!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return!1;try{return(await navigator.mediaDevices.enumerateDevices()).some(e=>e.kind==="audioinput")}catch(t){return console.error("Error checking for microphone:",t),!1}}function Di(){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 zs(){return typeof window>"u"?!1:!!(window.MediaRecorder&&Di())}class Li{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(!zs()||!navigator.mediaDevices){const e=new Error("MediaRecorder not supported or no microphone access");throw this.options.onError?.(e),e}try{if(this.starting=!0,this.stream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},video:!1}),!this.starting){this.stopStream(this.stream);return}this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&(console.warn("AudioRecorder: MediaRecorder already active, stopping previous recording"),this.mediaRecorder.stop(),this.cleanup()),this.started=!0,this.starting=!1;const e=Di();if(!e)throw new Error("No supported media type found");const r={mimeType:e};this.mediaRecorder=new MediaRecorder(this.stream,r),this.audioChunks=[],this.mediaRecorder.ondataavailable=n=>{n.data.size>0&&this.audioChunks.push(n.data)},this.mediaRecorder.onstop=async()=>{const n=this.audioChunks.length>0?new Blob(this.audioChunks,{type:e}):null;await this.options.onDataAvailable?.(n),this.options.onStop?.(),this.cleanup()},this.mediaRecorder.onerror=n=>{const o=new Error(`MediaRecorder error: ${n}`);this.options.onError?.(o),this.cleanup()},this.mediaRecorder.start(),this.setupVolumeAnalysis(this.stream),this.options.onStart?.()}catch(e){this.started=!1,this.starting=!1;const r=e instanceof Error?e:new Error(String(e));throw this.options.onError?.(r),r}}stop(){this.started=!1,this.starting=!1,this.volumeUpdateInterval&&(clearInterval(this.volumeUpdateInterval),this.volumeUpdateInterval=null),this.mediaRecorder&&this.mediaRecorder.state!=="inactive"?this.mediaRecorder.stop():(this.stream&&this.stopStream(this.stream),this.cleanup())}setupVolumeAnalysis(e){if(this.options.onVolumeChange)try{this.audioContext=new AudioContext,this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=256,this.analyser.smoothingTimeConstant=.8;const r=this.analyser.frequencyBinCount;this.dataArray=new Uint8Array(r),this.audioContext.createMediaStreamSource(e).connect(this.analyser),this.startVolumeMonitoring()}catch(r){console.warn("Failed to set up volume analysis:",r)}}startVolumeMonitoring(){!this.analyser||!this.dataArray||!this.options.onVolumeChange||(this.volumeUpdateInterval=window.setInterval(()=>{if(!this.analyser||!this.dataArray||!this.started)return;this.analyser.getByteFrequencyData(this.dataArray);let e=0;for(let i=0;i<this.dataArray.length;i++)e+=this.dataArray[i]*this.dataArray[i];let n=Math.sqrt(e/this.dataArray.length)/255;n=Math.pow(n*3,.7);const 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(e){e.getTracks().forEach(r=>r.stop())}cleanup(){this.volumeUpdateInterval&&(clearInterval(this.volumeUpdateInterval),this.volumeUpdateInterval=null),this.audioContext&&(this.audioContext.close().catch(console.warn),this.audioContext=null),this.analyser=null,this.dataArray=null,this.stream&&(this.stopStream(this.stream),this.stream=null),this.mediaRecorder=null,this.audioChunks=[],this.started=!1,this.starting=!1}static isSupported(){return zs()}static getSupportedMediaType(){return Di()}}const Ep=t=>(localStorage.setItem("liipgpt-color-scheme",t),pc(["light","dark"])),fc=()=>{const t=localStorage.getItem("liipgpt-color-scheme");return t==="light"||t==="dark"?t:"system"},pc=t=>{let e=fc();return e==="system"&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),t.includes(e)?e:t[0]??"light"},Ap=[{type:"email",check:t=>/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/.test(t)},{type:"creditCard",check:t=>/\b(?:\d[ -]*?){13,16}\b/.test(t)},{type:"ahv",check:t=>/\b756\.\d{4}\.\d{4}\.\d{2}\b/.test(t)},{type:"phoneSwiss",check:t=>/\b0(?:\s*\d){2}(?:\s*\/\s*)?(?:\s*\d){7,}\b/.test(t)},{type:"phoneInternational",check:t=>/(?:\+|00)(?:\s*\d){10,}\b/.test(t)},{type:"swissPassport",check:t=>/\b[A-HJ-NP-Z](?=.*\d)[A-HJ-NP-Z0-9]{7}\b/.test(t)},{type:"longNumber",check:t=>/\b\d{9,}\b/.test(t)}],Bs=t=>{for(const e of Ap)if(e.check(t))return e.type};class Cp extends Error{constructor(e){super(e),this.name="UnreachableError"}}const Pp=()=>{const e=new URLSearchParams(window.location.search).get("q");return e?{name:"chat-page",query:e}:{name:"start-page"}};class Op{#e=he(Fr(bp));get data(){return u(this.#e)}set data(e){O(this.#e,e,!0)}#t=he(Fr({}));get targets(){return u(this.#t)}set targets(e){O(this.#t,e,!0)}#r=he(!1);get initialized(){return u(this.#r)}set initialized(e){O(this.#r,e,!0)}#n=he(0);get currentAudioVolume(){return u(this.#n)}set currentAudioVolume(e){O(this.#n,e,!0)}client;props;#o=he(null);get currentAudioRecorder(){return u(this.#o)}set currentAudioRecorder(e){O(this.#o,e,!0)}#i=he(!1);get isTranscribing(){return u(this.#i)}set isTranscribing(e){O(this.#i,e,!0)}lastChatResponse;async init(e){this.props=e;const r=e.speechRecognitionApiKey||void 0;this.client=new Df({apiUrl:e.apiUrl,apiKey:e.apiKey,speechRecognitionApiKey:r,strict:!0});try{const n=await this.client.getChatConfig();window.CHAT_CONFIG_OVERRIDE&&Object.assign(n,window.CHAT_CONFIG_OVERRIDE);const i=(await this.client.getMetadata()).mode==="maintenance";i&&this.showErrorToast("maintenance");const a=Bf(n);let s;e.lang?s=Ii(e.lang,a.supportedLanguages):s=Wf(a.supportedLanguages);const c=await this.getPredefinedQuestions(s),l=[];if(a.renderKatex){const g=await Rd(()=>import("https://esm.sh/marked-katex-extension@5.1.5"),[],import.meta.url).catch(b=>{console.error("Couldn't load marked-katex-extension:",b)});g&&(this.client.setMarkedExtensions(g.default({nonStandard:!0,output:"mathml"})),l.push("https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css"))}const d=Object.keys(a.fullTheme);this.data={currentConverstionState:"idle",chatConfig:a,language:s,predefinedQuestions:c,isInMaintenance:i,history:[],selectedColorScheme:fc(),has2ColorSchemes:d.length===2,currentColorScheme:pc(d),feedbackOpenedId:void 0,feedbackOpenedConversation:!1,props:e,flyoutIsOpen:!1,questionHasPii:void 0,chatInputValue:"",currentReferencesAsideId:void 0,route:{name:"start-page"},additionalStylesheets:l},window.LIIPGPT_LISTENERS?.route?.(this.data.route),window.LIIPGPT_LISTENERS?.conversation?.(this.data.currentConverstionState),this.initialized=!0,this.goto(Pp())}catch(n){throw di.error(n instanceof Error?n.message:"Failed to load the chatbot. Please reload the page.",{duration:1e4,unstyled:!0,classes:{toast:"toast"}}),n}}setTarget(e,r){this.targets[e]=r}goto(e){if(!Gf(this.data.route,e))switch(this.data.route=e,window.LIIPGPT_LISTENERS?.route?.(e),e.name){case"start-page":e.prefill&&(this.data.chatInputValue=e.prefill);break;case"chat-page":if(this.data.chatInputValue=e.query,this.onSubmit(),this.data.chatConfig.addQueryToUrlParams){const r=new URLSearchParams(window.location.search);r.set("q",e.query),history.pushState(null,"",`?${r.toString()}`)}break}}#s=D(()=>{if(!this.initialized)return[];const e=this.data.chatConfig.menu;return e?e[this.data.language]??[]:[]});get menu(){return u(this.#s)}set menu(e){O(this.#s,e)}#a=D(()=>this.initialized?this.data.chatConfig.translations[this.data.language]??{}:{});get t(){return u(this.#a)}set t(e){O(this.#a,e)}#l=D(()=>this.initialized?Is[this.data.language]??{}:Is.en??{});get errorTranslations(){return u(this.#l)}set errorTranslations(e){O(this.#l,e)}#c=D(()=>this.initialized?Rs[this.data.language]??{}:Rs.en??{});get piiTranslations(){return u(this.#c)}set piiTranslations(e){O(this.#c,e)}#d=D(()=>this.initialized?this.data.currentColorScheme:"light");get colorScheme(){return u(this.#d)}set colorScheme(e){O(this.#d,e)}#u=D(()=>this.initialized?this.data.chatConfig.fullTheme[this.data.currentColorScheme]:{});get themeBase(){return u(this.#u)}set themeBase(e){O(this.#u,e)}#h=D(()=>this.themeBase.tokens);get theme(){return u(this.#h)}set theme(e){O(this.#h,e)}async getPredefinedQuestions(e){try{return this.client.getPredefinedQuestions({url:window.location.href.replace(window.location.origin,""),language:e})}catch(r){return console.warn("Failed to load predefined questions:",r),[]}}setColorScheme(e){this.data.selectedColorScheme=e,this.data.currentColorScheme=Ep(e)}async abort(){await this.lastChatResponse?.abort()}changeConversationState(e){this.data.currentConverstionState=e,window.LIIPGPT_LISTENERS?.conversation?.(e)}onInput(e){this.data.chatConfig.blockPII&&(this.data.questionHasPii=Bs(e)),this.data.chatInputValue=e}onSubmit(){if(this.data.questionHasPii){console.warn("Question contains PII, not submitting:",this.data.questionHasPii);return}const e=this.data.chatConfig.questionPrefix?`${this.data.chatConfig.questionPrefix} ${this.data.chatInputValue}`:this.data.chatInputValue,r=this.data.history.push({type:"user",time:new Date().toISOString(),message:this.data.chatInputValue});this.data.history.push({id:"UNRESOLVED",state:"loading",errors:[],type:"bot",time:new Date().toISOString(),message:{markdown:"",html:""},references:{all:[],used:[],unused:[]}});const n={features:this.props.features?this.props.features.trim().split(","):["formatting"],onError:s=>{this.showErrorToast(s),window.LIIPGPT_LISTENERS?.error?.(s),(s==="pii-detected"||s==="blocked")&&this.editLatestQuestion()},lang:this.data.language},o=this.data.chatConfig.sendReferrer??"all";(o==="all"||o==="own"||o==="location")&&(n.referrer=o==="location"||this.data.props.flyout?`${window.location.protocol}//${window.location.host}${window.location.pathname}`:document.referrer,(!n.referrer||!this.data.props.flyout&&o==="own"&&!n.referrer.startsWith(window.location.origin))&&(n.referrer=void 0)),this.data.currentConversationId||(this.data.currentConversationId=this.client.createConversationId());const i=this.client.chat(this.data.currentConversationId,e,n);this.lastChatResponse=i,this.data.lastChatResponseId=i.id,this.changeConversationState("searching");let a;i.subscribe(s=>{this.data.history[r]&&(this.data.history[r]={question:this.data.chatInputValue,...s}),s.state==="streaming"&&this.changeConversationState("answering"),s.state==="done"&&(this.changeConversationState("idle"),this.data.currentReferencesAsideId&&this.data.history[r].references.used.length>0?(clearTimeout(a),a=setTimeout(()=>{this.openReferencesAside(s.id)},100)):this.closeReferencesAside())}),this.data.chatInputValue=""}async onStartSpeechRecognition(){try{if(!await Tp()){this.showErrorToast("speech-not-supported");return}if(await navigator.mediaDevices.getUserMedia({audio:!0}),Li.isSupported())this.data.chatInputValue="",this.currentAudioRecorder=new Li({onDataAvailable:async r=>{this.isTranscribing=!0,await this.handleTranscription(r)},onError:()=>{this.showErrorToast("speech-microphone-access-denied"),this.currentAudioRecorder=null,this.isTranscribing=!1},onVolumeChange:r=>{this.currentAudioVolume=r}}),this.currentAudioRecorder.start();else{this.showErrorToast("speech-not-supported");return}}catch(e){throw this.showErrorToast("speech-microphone-access-denied"),this.currentAudioRecorder=null,this.isTranscribing=!1,e}}editLatestQuestion(){const e=this.data.history.findLastIndex(n=>n?.type==="user");if(e===-1){console.error("No last user question, available");return}const r=this.data.history.splice(e)[0];console.log(r),this.data.chatInputValue=r.message}onStopSpeechRecognition(){if(this.currentAudioRecorder){const e=this.currentAudioRecorder;this.currentAudioRecorder=null,e.stop()}this.currentAudioVolume=0}async handleTranscription(e){if(!e){console.warn("No audio data received");return}try{const r=await this.client.transcribeAudio(e,{lang:this.data.language});if(r.error){this.showErrorToast("speech-transcription-failed");return}if(r.transcript.trim()){if(this.data.chatConfig.blockPII&&(this.data.questionHasPii=Bs(r.transcript.trim()),this.data.questionHasPii))return;this.data.chatInputValue=r.transcript.trim()}else this.showErrorToast("speech-no-text-detected")}catch(r){console.error("Speech transcription error:",r),this.showErrorToast("speech-transcription-failed")}finally{this.currentAudioRecorder=null,this.isTranscribing=!1,this.currentAudioVolume=0}}async onStartConversation(e){await this.abort(),this.data.history=[],this.data.currentConversationId=this.client.createConversationId(),this.goto({name:"chat-page",query:e})}async onNewConversation(){await this.abort(),this.data.currentConversationId=void 0,this.data.currentReferencesAsideId=void 0,this.data.history=[],this.goto({name:"start-page"})}showSuccessToast(e){di.success(this.t[e],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})}showErrorToast(e){di.error(this.errorTranslations[e],{unstyled:!0,duration:3e3,classes:{toast:"toast"}})}async submitFeedback(e){try{const r=this.data.feedbackOpenedId||this.data.lastChatResponseId;if(!r)throw new Cp("Tried to give feedback with no id.");const n=this.data.history.find(o=>o.type==="bot"&&o.id===r);await this.client.feedback(r,n?.question??"",e),this.showSuccessToast("thankYouForFeedback")}catch(r){console.error("Feedback failed:",r),this.showErrorToast("feedback-failed")}}toggleReferencesAside=e=>{this.data.currentReferencesAsideId=this.data.currentReferencesAsideId===e?void 0:e};openReferencesAside=e=>{this.data.currentReferencesAsideId=e};closeReferencesAside=()=>{this.data.currentReferencesAsideId=void 0};openFlyout(){this.data.flyoutIsOpen=!0}closeFlyout(){this.data.flyoutIsOpen=!1}openConverstionFeedback(){this.data.feedbackOpenedConversation=!0}openMessageFeedback(e){this.data.feedbackOpenedId=e}closeFeedback(){this.data.feedbackOpenedConversation=!1,this.data.feedbackOpenedId=void 0}async thumbs(e,r){try{const n=this.data.history.find(o=>o.type==="bot"&&o.id===e);r==="up"?await this.client.thumbsUp(e,n?.question??""):await this.client.thumbsDown(e,n?.question??""),this.showSuccessToast("thankYouForFeedback")}catch(n){console.error("Feedback failed:",n),this.showErrorToast("feedback-failed")}}async onLanguageChange(e){if(this.data.language=Ii(e,this.data.chatConfig.supportedLanguages),Vf(this.data.language),this.data.predefinedQuestions=await this.getPredefinedQuestions(this.data.language),this.data.chatConfig.reflectLanguageInPath){const r=new URL(window.location.href);r.pathname=`/${this.data.language}`,window.history.replaceState({},"",r.toString())}}}const me=Sp(Op),sa=(t,e)=>{const r=window.LIIPGPT_LISTENERS?.elements?.[e];if(!r)return;const n=Object.entries(r).filter(([o,i])=>typeof i=="function"&&!["init","destroy"].includes(o));Ue(()=>(r.init?.(t),n.forEach(([o,i])=>{t.addEventListener(o,i)}),()=>{n.forEach(([o,i])=>{t.addEventListener(o,i)}),r.destroy?.(t)}))},Ip=(t,e)=>{e&&me.setTarget(e,t)};var Rp=X('<div aria-hidden="true"><!></div>');function Ze(t,e){ue(e,!0);let r=p(e,"name",7),n=p(e,"class",7);var o=Rp(),i=z(o);return Pr(i,()=>me.theme.svgs[r()]),N(o),ge(()=>rt(o,1,`svg svg--${r()??""} ${n()??""}`)),A(t,o),de({get name(){return r()},set name(a){r(a),f()},get class(){return n()},set class(a){n(a),f()}})}ce(Ze,{name:{},class:{}},[],[],!0);function cn(t,e){let r=null,n;function o(){e.text&&(r||(r=document.createElement("span"),r.textContent=e.text,r.className=`tooltip tooltip-${e.position||"top"} tooltip-hidden`,t.appendChild(r),r.getBoundingClientRect()),r.classList.remove("tooltip-hidden"),i())}function i(){if(!r)return;const c=t.getBoundingClientRect(),l=r.getBoundingClientRect();let d,h;switch(e.position){case"bottom":d=c.height+5,h=c.width/2-l.width/2;break;case"bottom-right":d=c.height+5,h=c.width-l.width;break;case"bottom-left":d=c.height+5,h=0;break;case"left":d=c.height/2-l.height/2,h=-l.width-5;break;case"right":d=c.height/2-l.height/2,h=c.width+5;break;case"top":default:d=-l.height-5,h=c.width/2-l.width/2;break}r.style.top=`${d}px`,r.style.left=`${h}px`}function a(){n=window.setTimeout(()=>{o()},e.delay||200)}function s(){clearTimeout(n),r&&(r.classList.add("tooltip-hidden"),r.addEventListener("transitionend",()=>{r?.remove(),r=null},{once:!0}))}return t.classList.add("tooltip-container"),t.setAttribute("tabindex","0"),t.addEventListener("mouseenter",a),t.addEventListener("focus",a),t.addEventListener("mouseleave",s),t.addEventListener("blur",s),t.addEventListener("click",s),{update(c){e=c},destroy(){s(),t.classList.remove("tooltip-container"),t.removeEventListener("mouseenter",a),t.removeEventListener("focus",a),t.removeEventListener("mouseleave",s),t.removeEventListener("blur",s),t.removeEventListener("click",s)}}}var Dp=X('<div class="btn-wrapper chat-close"><button class="btn btn--tertiary btn--square"><span class="sr-only"> </span> <!></button></div>');function Lp(t,e){ue(e,!0);let r=D(()=>me.t),n=p(e,"onclick",7);var o=Dp(),i=z(o);i.__click=function(...l){n()?.apply(this,l)};var a=z(i),s=z(a,!0);N(a);var c=ne(a,2);return Ze(c,{name:"dismiss"}),N(i),St(i,(l,d)=>cn?.(l,d),()=>({text:u(r).closeChat,position:"bottom-right",delay:600})),N(o),ge(()=>{pe(i,"aria-label",u(r).closeChat),Ee(s,u(r).closeChat)}),A(t,o),de({get onclick(){return n()},set onclick(l){n(l),f()}})}jt(["click"]);ce(Lp,{onclick:{}},[],[],!0);var Np=Un('<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><defs><linearGradient x1="0" y1="1" x2="0" y2="0"><stop></stop><stop></stop></linearGradient><mask maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24"><g stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"><path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path><path d="M19 10v2a7 7 0 0 1-14 0v-2"></path><path d="M12 19v4"></path><path d="M8 23h8"></path></g></mask></defs><rect width="24" height="24"></rect></svg>');function gc(t,e){ue(e,!0);let r=p(e,"level",7),n=p(e,"class",7,""),o=p(e,"baseColor",7,"var(--mic-base-color)"),i=p(e,"accentColor",7,"var(--mic-accent-color)");const a=Math.random().toString(36).substring(2),s=`audio-level-gradient-${a}`,c=`audio-level-mask-${a}`;var l=Np(),d=z(l),h=z(d),g=z(h),b=ne(g);N(h);var v=ne(h);N(d);var m=ne(d);return N(l),ge(()=>{rt(l,0,`audio-level-mic-svg ${n()??""}`),pe(h,"id",s),pe(g,"offset",r()/100),pe(g,"stop-color",i()),pe(b,"offset",r()/100),pe(b,"stop-color",o()),pe(v,"id",c),pe(m,"fill",`url(#${s})`),pe(m,"mask",`url(#${c})`)}),A(t,l),de({get level(){return r()},set level(y){r(y),f()},get class(){return n()},set class(y=""){n(y),f()},get baseColor(){return o()},set baseColor(y="var(--mic-base-color)"){o(y),f()},get accentColor(){return i()},set accentColor(y="var(--mic-accent-color)"){i(y),f()}})}ce(gc,{level:{},class:{},baseColor:{},accentColor:{}},[],[],!0);const Fp=async(t,e,r)=>{try{u(e)?me.onStopSpeechRecognition():await me.onStartSpeechRecognition(),O(r,!1)}catch(n){console.error("Speech recognition error:",n),O(r,!0)}};var Mp=X('<button type="button"><div class="mic-icon" aria-hidden="true"><!></div></button>');function mc(t,e){ue(e,!0);const r=typeof window<"u";let n=D(()=>me.t),o=p(e,"class",7),i=D(()=>!!me.currentAudioRecorder),a=D(()=>r&&Li.isSupported()),s=D(()=>me.currentAudioVolume||0),c=he(!1);Ue(()=>()=>{u(i)&&me.onStopSpeechRecognition()});var l=Y(),d=V(l);{var h=g=>{var b=Mp();let v;b.__click=[Fp,i,c];var m=z(b),y=z(m);gc(y,{get level(){return u(s)}}),N(m),N(b),ge(w=>{pe(b,"aria-label",u(i)?u(n).chatInputStopListening:u(n).chatInputStartListening),v=rt(b,1,`chat-input__mic-button transition-colors ${o()??""}`,null,v,w)},[()=>({"chat-input__mic-button--listening":u(i),"chat-input__mic-button--error":u(c)})]),A(g,b)};J(d,g=>{u(a)&&g(h)})}return A(t,l),de({get class(){return o()},set class(g){o(g),f()}})}jt(["click"]);ce(mc,{class:{}},[],[],!0);const zp=t=>t;function Bp(t){const e=t-1;return e*e*e+1}function Us(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function Hs(t,{delay:e=0,duration:r=400,easing:n=zp}={}){const o=+getComputedStyle(t).opacity;return{delay:e,duration:r,easing:n,css:i=>`opacity: ${i*o}`}}function Wt(t,{delay:e=0,duration:r=400,easing:n=Bp,x:o=0,y:i=0,opacity:a=0}={}){const s=getComputedStyle(t),c=+s.opacity,l=s.transform==="none"?"":s.transform,d=c*(1-a),[h,g]=Us(o),[b,v]=Us(i);return{delay:e,duration:r,easing:n,css:(m,y)=>`
|
|
195
195
|
transform: ${l} translate(${(1-m)*h}${g}, ${(1-m)*b}${v});
|
|
196
196
|
opacity: ${c-d*y}`}}const Up=(t,e)=>{e(),me.onInput(t.currentTarget.value)};var Hp=X('<div><div class="chat-input__notification" data-type="error"> </div></div>'),qp=X('<form><!> <div class="chat-input__textarea-wrapper svelte-1mhsoop"><textarea name="chat-input-value" class="chat-input__textarea"></textarea> <div class="chat-input__buttons"><!> <button type="submit"><!></button></div></div></form>');const Vp={hash:"svelte-1mhsoop",code:".chat-input__textarea-wrapper.svelte-1mhsoop {display:block;position:relative;width:100%;}"};function Wp(t,e){ue(e,!0),Fo(t,Vp);let r=D(()=>me.t),n=p(e,"class",7),o=p(e,"isStartPage",7),i=p(e,"onSubmit",7),a=at(e,["$$slots","$$events","$$legacy","$$host","class","isStartPage","onSubmit"]),s=D(()=>me.data.chatInputValue),c=D(()=>u(s)&&!me.data.questionHasPii),l=D(()=>me.data.currentConverstionState==="answering"||me.data.currentConverstionState==="searching"),d=D(()=>!u(c)&&!u(l)),h,g,b=D(()=>me.data?.chatConfig?.allowAudioInput??!0),v=D(()=>!!me.currentAudioRecorder),m=D(()=>me.isTranscribing),y=D(()=>()=>u(m)?u(r).messageBotLoading:u(v)&&u(r).chatInputPlaceholderListening?u(r).chatInputPlaceholderListening:u(r).chatInputPlaceholder);const w=()=>{u(l)?me.abort():(i()(u(s)),E())},_=L=>{L.preventDefault(),w()},x=L=>{L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),w())},k=L=>{if(!L.value){L.value=L.placeholder;const Z=Math.ceil(L.scrollHeight);return L.value="",Z}return L.scrollHeight},E=()=>{Xi().then(()=>{h.style.height="auto";const L=parseInt(getComputedStyle(h).borderWidth)*2,Z=k(h);h.style.height=`${Z+L+2}px`})};Ue(()=>{u(s)&&E()});const P=L=>{Ue(()=>{L.focus()})};Ue(()=>{if(h)return g=new ResizeObserver(()=>{E()}),g.observe(h),()=>{g.disconnect()}}),Ue(()=>{const L=new URLSearchParams(window.location.search),Z=L.get("prefill");Z&&(O(s,Z),L.delete("prefill"),history.replaceState(null,"",`${location.pathname}?${L.toString()}`))});var S=qp();ht("resize",_d,E),We(S,()=>({name:"chat-input",onsubmit:_,class:`chat-input ${n()??""}`,...a}),void 0,void 0,"svelte-1mhsoop");var U=z(S);{var j=L=>{var Z=Hp();let H;var R=z(Z),K=z(R,!0);N(R),N(Z),ge(be=>{H=rt(Z,1,"chat-input__notification-wrapper",null,H,be),Ee(K,me.piiTranslations[me.data.questionHasPii])},[()=>({"chat-input__notification-wrapper--start-page":o()})]),It(1,R,()=>Wt,()=>({y:o()?-20:20,duration:300,delay:250})),It(2,R,()=>Wt,()=>({y:o()?-20:20,duration:150})),A(L,Z)};J(U,L=>{me.data.questionHasPii&&L(j)})}var G=ne(U,2),I=z(G);kd(I),I.__input=[Up,E],pe(I,"rows",1),Br(I,L=>h=L,()=>h),St(I,L=>P?.(L)),St(I,(L,Z)=>sa?.(L,Z),()=>"chatInput");var B=ne(I,2),W=z(B);{var M=L=>{mc(L,{})};J(W,L=>{u(b)&&L(M)})}var C=ne(W,2);let te;var le=z(C);{var oe=L=>{Ze(L,{name:"abort",class:"chat-input__submit-icon"})},ie=L=>{Ze(L,{name:"submit",class:"chat-input__submit-icon"})};J(le,L=>{u(l)?L(oe):L(ie,!1)})}return N(C),N(B),N(G),N(S),ge((L,Z)=>{Yd(I,u(s)),pe(I,"placeholder",L),pe(C,"aria-label",u(r).chatInputSubmit),C.disabled=u(d),te=rt(C,1,"chat-input__submit-button transition-colors",null,te,Z)},[()=>u(y)(),()=>({"chat-input__submit-button--deactivated":u(d)})]),ht("keypress",I,x),A(t,S),de({get class(){return n()},set class(L){n(L),f()},get isStartPage(){return o()},set isStartPage(L){o(L),f()},get onSubmit(){return i()},set onSubmit(L){i(L),f()}})}jt(["input"]);ce(Wp,{class:{},isStartPage:{},onSubmit:{}},[],[],!0);var jp=X('<label class="classification-feedback__option btn btn--secondary svelte-1alkxgd"><input type="radio" name="quality" class="svelte-1alkxgd"/> </label>'),Kp=X('<fieldset class="classification-feedback__item svelte-1alkxgd"><legend class="classification-feedback__label svelte-1alkxgd"> </legend> <!></fieldset>'),Gp=X('<label class="classification-feedback__option btn btn--secondary svelte-1alkxgd"><input type="radio" name="impact" class="svelte-1alkxgd"/> </label>'),Yp=X('<fieldset class="classification-feedback__item svelte-1alkxgd"><legend class="classification-feedback__label svelte-1alkxgd"> </legend> <!></fieldset>'),Qp=X('<div class="classification-feedback svelte-1alkxgd"><div class="classification-feedback__title svelte-1alkxgd"> </div> <!> <!></div>');const Xp={hash:"svelte-1alkxgd",code:".classification-feedback.svelte-1alkxgd {display:flex;flex-direction:column;padding:var(--spacer-r-20) var(--spacer-r-24) var(--spacer-r-32) var(--spacer-r-24);gap:var(--spacer-32);border-width:var(--message-user-border-width);border-radius:var(--message-user-border-radius);border-color:var(--message-user-border-color);background:var(--message-user-background);box-shadow:var(--message-user-box-shadow);color:var(--message-user-color);}.classification-feedback__item.svelte-1alkxgd {display:flex;flex-direction:column;margin:0;padding:0;gap:var(--spacer-4);border:none;}.classification-feedback__title.svelte-1alkxgd {margin-bottom:-1rem;font-weight:bold;}.classification-feedback__label.svelte-1alkxgd {margin-bottom:var(--spacer-8);font-weight:bold;}.classification-feedback__option.svelte-1alkxgd {display:flex;align-items:center;padding-left:var(--spacer-16);gap:var(--spacer-12);&:has(input:where(.svelte-1alkxgd):checked) {background:var(--btn-secondary-hover-background);color:var(--btn-secondary-hover-color);}&:has(input:where(.svelte-1alkxgd):focus-visible) {border-radius:var(--spacer-8);outline-color:var(--body-focus-color);outline-style:solid;outline-width:var(--spacer-3);}&:has(input:where(.svelte-1alkxgd):focus-visible) input:where(.svelte-1alkxgd) {outline:none;}}"};function Zp(t,e){ue(e,!0),Fo(t,Xp);const r=[],n=[];let o=D(()=>me.t),i=p(e,"impact",15),a=p(e,"quality",15),s=p(e,"classificationConfig",7);var c=Y(),l=V(c);{var d=h=>{var g=Qp(),b=z(g),v=z(b,!0);N(b);var m=ne(b,2);{var y=x=>{var k=Kp(),E=z(k),P=z(E,!0);N(E);var S=ne(E,2);Jt(S,17,()=>s().quality.options,Cr,(U,j)=>{var G=jp(),I=z(G);Dn(I);var B,W=ne(I);N(G),ge(()=>{B!==(B=u(j).value)&&(I.value=(I.__value=u(j).value)??""),Ee(W,` ${u(j).label??""}`)}),cs(r,[],I,()=>(u(j).value,a()),a),A(U,G)}),N(k),ge(()=>Ee(P,s().quality.label)),A(x,k)};J(m,x=>{s().quality&&s().quality.options.length!==0&&x(y)})}var w=ne(m,2);{var _=x=>{var k=Yp(),E=z(k),P=z(E,!0);N(E);var S=ne(E,2);Jt(S,17,()=>s().impact.options,Cr,(U,j)=>{var G=Gp(),I=z(G);Dn(I);var B,W=ne(I);N(G),ge(()=>{B!==(B=u(j).value)&&(I.value=(I.__value=u(j).value)??""),Ee(W,` ${u(j).label??""}`)}),cs(n,[],I,()=>(u(j).value,i()),i),A(U,G)}),N(k),ge(()=>Ee(P,s().impact.label)),A(x,k)};J(w,x=>{s().impact&&s().impact.options.length!==0&&x(_)})}N(g),ge(()=>Ee(v,u(o).classificationTitle)),A(h,g)};J(l,h=>{s()&&(s().quality||s().impact)&&h(d)})}return A(t,c),de({get impact(){return i()},set impact(h){i(h),f()},get quality(){return a()},set quality(h){a(h),f()},get classificationConfig(){return s()},set classificationConfig(h){s(h),f()}})}ce(Zp,{impact:{},quality:{},classificationConfig:{}},[],[],!0);const Jp=["top","right","bottom","left"],Or=Math.min,Nt=Math.max,vo=Math.round,eo=Math.floor,ir=t=>({x:t,y:t}),$p={left:"right",right:"left",bottom:"top",top:"bottom"},eg={start:"end",end:"start"};function Ni(t,e,r){return Nt(t,Or(e,r))}function yr(t,e){return typeof t=="function"?t(e):t}function xr(t){return t.split("-")[0]}function un(t){return t.split("-")[1]}function la(t){return t==="x"?"y":"x"}function ca(t){return t==="y"?"height":"width"}const tg=new Set(["top","bottom"]);function or(t){return tg.has(xr(t))?"y":"x"}function ua(t){return la(or(t))}function rg(t,e,r){r===void 0&&(r=!1);const n=un(t),o=ua(t),i=ca(o);let a=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=bo(a)),[a,bo(a)]}function ng(t){const e=bo(t);return[Fi(t),e,Fi(e)]}function Fi(t){return t.replace(/start|end/g,e=>eg[e])}const qs=["left","right"],Vs=["right","left"],og=["top","bottom"],ig=["bottom","top"];function ag(t,e,r){switch(t){case"top":case"bottom":return r?e?Vs:qs:e?qs:Vs;case"left":case"right":return e?og:ig;default:return[]}}function sg(t,e,r,n){const o=un(t);let i=ag(xr(t),r==="start",n);return o&&(i=i.map(a=>a+"-"+o),e&&(i=i.concat(i.map(Fi)))),i}function bo(t){return t.replace(/left|right|bottom|top/g,e=>$p[e])}function lg(t){return{top:0,right:0,bottom:0,left:0,...t}}function vc(t){return typeof t!="number"?lg(t):{top:t,right:t,bottom:t,left:t}}function wo(t){const{x:e,y:r,width:n,height:o}=t;return{width:n,height:o,top:r,left:e,right:e+n,bottom:r+o,x:e,y:r}}function Ws(t,e,r){let{reference:n,floating:o}=t;const i=or(e),a=ua(e),s=ca(a),c=xr(e),l=i==="y",d=n.x+n.width/2-o.width/2,h=n.y+n.height/2-o.height/2,g=n[s]/2-o[s]/2;let b;switch(c){case"top":b={x:d,y:n.y-o.height};break;case"bottom":b={x:d,y:n.y+n.height};break;case"right":b={x:n.x+n.width,y:h};break;case"left":b={x:n.x-o.width,y:h};break;default:b={x:n.x,y:n.y}}switch(un(e)){case"start":b[a]-=g*(r&&l?-1:1);break;case"end":b[a]+=g*(r&&l?-1:1);break}return b}const cg=async(t,e,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,s=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(e));let l=await a.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:h}=Ws(l,n,c),g=n,b={},v=0;for(let m=0;m<s.length;m++){const{name:y,fn:w}=s[m],{x:_,y:x,data:k,reset:E}=await w({x:d,y:h,initialPlacement:n,placement:g,strategy:o,middlewareData:b,rects:l,platform:a,elements:{reference:t,floating:e}});d=_??d,h=x??h,b={...b,[y]:{...b[y],...k}},E&&v<=50&&(v++,typeof E=="object"&&(E.placement&&(g=E.placement),E.rects&&(l=E.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:o}):E.rects),{x:d,y:h}=Ws(l,g,c)),m=-1)}return{x:d,y:h,placement:g,strategy:o,middlewareData:b}};async function Ln(t,e){var r;e===void 0&&(e={});const{x:n,y:o,platform:i,rects:a,elements:s,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:g=!1,padding:b=0}=yr(e,t),v=vc(b),y=s[g?h==="floating"?"reference":"floating":h],w=wo(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(y)))==null||r?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:d,strategy:c})),_=h==="floating"?{x:n,y:o,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),k=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},E=wo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:_,offsetParent:x,strategy:c}):_);return{top:(w.top-E.top+v.top)/k.y,bottom:(E.bottom-w.bottom+v.bottom)/k.y,left:(w.left-E.left+v.left)/k.x,right:(E.right-w.right+v.right)/k.x}}const ug=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:o,rects:i,platform:a,elements:s,middlewareData:c}=e,{element:l,padding:d=0}=yr(t,e)||{};if(l==null)return{};const h=vc(d),g={x:r,y:n},b=ua(o),v=ca(b),m=await a.getDimensions(l),y=b==="y",w=y?"top":"left",_=y?"bottom":"right",x=y?"clientHeight":"clientWidth",k=i.reference[v]+i.reference[b]-g[b]-i.floating[v],E=g[b]-i.reference[b],P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let S=P?P[x]:0;(!S||!await(a.isElement==null?void 0:a.isElement(P)))&&(S=s.floating[x]||i.floating[v]);const U=k/2-E/2,j=S/2-m[v]/2-1,G=Or(h[w],j),I=Or(h[_],j),B=G,W=S-m[v]-I,M=S/2-m[v]/2+U,C=Ni(B,M,W),te=!c.arrow&&un(o)!=null&&M!==C&&i.reference[v]/2-(M<B?G:I)-m[v]/2<0,le=te?M<B?M-B:M-W:0;return{[b]:g[b]+le,data:{[b]:C,centerOffset:M-C-le,...te&&{alignmentOffset:le}},reset:te}}}),dg=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:l}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...y}=yr(t,e);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const w=xr(o),_=or(s),x=xr(s)===s,k=await(c.isRTL==null?void 0:c.isRTL(l.floating)),E=g||(x||!m?[bo(s)]:ng(s)),P=v!=="none";!g&&P&&E.push(...sg(s,m,v,k));const S=[s,...E],U=await Ln(e,y),j=[];let G=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&j.push(U[w]),h){const M=rg(o,a,k);j.push(U[M[0]],U[M[1]])}if(G=[...G,{placement:o,overflows:j}],!j.every(M=>M<=0)){var I,B;const M=(((I=i.flip)==null?void 0:I.index)||0)+1,C=S[M];if(C&&(!(h==="alignment"?_!==or(C):!1)||G.every(oe=>oe.overflows[0]>0&&or(oe.placement)===_)))return{data:{index:M,overflows:G},reset:{placement:C}};let te=(B=G.filter(le=>le.overflows[0]<=0).sort((le,oe)=>le.overflows[1]-oe.overflows[1])[0])==null?void 0:B.placement;if(!te)switch(b){case"bestFit":{var W;const le=(W=G.filter(oe=>{if(P){const ie=or(oe.placement);return ie===_||ie==="y"}return!0}).map(oe=>[oe.placement,oe.overflows.filter(ie=>ie>0).reduce((ie,L)=>ie+L,0)]).sort((oe,ie)=>oe[1]-ie[1])[0])==null?void 0:W[0];le&&(te=le);break}case"initialPlacement":te=s;break}if(o!==te)return{reset:{placement:te}}}return{}}}};function js(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ks(t){return Jp.some(e=>t[e]>=0)}const hg=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...o}=yr(t,e);switch(n){case"referenceHidden":{const i=await Ln(e,{...o,elementContext:"reference"}),a=js(i,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ks(a)}}}case"escaped":{const i=await Ln(e,{...o,altBoundary:!0}),a=js(i,r.floating);return{data:{escapedOffsets:a,escaped:Ks(a)}}}default:return{}}}}},bc=new Set(["left","top"]);async function fg(t,e){const{placement:r,platform:n,elements:o}=t,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),a=xr(r),s=un(r),c=or(r)==="y",l=bc.has(a)?-1:1,d=i&&c?-1:1,h=yr(e,t);let{mainAxis:g,crossAxis:b,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return s&&typeof v=="number"&&(b=s==="end"?v*-1:v),c?{x:b*d,y:g*l}:{x:g*l,y:b*d}}const pg=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:o,y:i,placement:a,middlewareData:s}=e,c=await fg(e,t);return a===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},gg=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:o}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:y=>{let{x:w,y:_}=y;return{x:w,y:_}}},...c}=yr(t,e),l={x:r,y:n},d=await Ln(e,c),h=or(xr(o)),g=la(h);let b=l[g],v=l[h];if(i){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",_=b+d[y],x=b-d[w];b=Ni(_,b,x)}if(a){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",_=v+d[y],x=v-d[w];v=Ni(_,v,x)}const m=s.fn({...e,[g]:b,[h]:v});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[g]:i,[h]:a}}}}}},mg=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:o,rects:i,middlewareData:a}=e,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=yr(t,e),d={x:r,y:n},h=or(o),g=la(h);let b=d[g],v=d[h];const m=yr(s,e),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const x=g==="y"?"height":"width",k=i.reference[g]-i.floating[x]+y.mainAxis,E=i.reference[g]+i.reference[x]-y.mainAxis;b<k?b=k:b>E&&(b=E)}if(l){var w,_;const x=g==="y"?"width":"height",k=bc.has(xr(o)),E=i.reference[h]-i.floating[x]+(k&&((w=a.offset)==null?void 0:w[h])||0)+(k?0:y.crossAxis),P=i.reference[h]+i.reference[x]+(k?0:((_=a.offset)==null?void 0:_[h])||0)-(k?y.crossAxis:0);v<E?v=E:v>P&&(v=P)}return{[g]:b,[h]:v}}}},vg=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:o,rects:i,platform:a,elements:s}=e,{apply:c=()=>{},...l}=yr(t,e),d=await Ln(e,l),h=xr(o),g=un(o),b=or(o)==="y",{width:v,height:m}=i.floating;let y,w;h==="top"||h==="bottom"?(y=h,w=g===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(w=h,y=g==="end"?"top":"bottom");const _=m-d.top-d.bottom,x=v-d.left-d.right,k=Or(m-d[y],_),E=Or(v-d[w],x),P=!e.middlewareData.shift;let S=k,U=E;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(U=x),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(S=_),P&&!g){const G=Nt(d.left,0),I=Nt(d.right,0),B=Nt(d.top,0),W=Nt(d.bottom,0);b?U=v-2*(G!==0||I!==0?G+I:Nt(d.left,d.right)):S=m-2*(B!==0||W!==0?B+W:Nt(d.top,d.bottom))}await c({...e,availableWidth:U,availableHeight:S});const j=await a.getDimensions(s.floating);return v!==j.width||m!==j.height?{reset:{rects:!0}}:{}}}};function Uo(){return typeof window<"u"}function dn(t){return wc(t)?(t.nodeName||"").toLowerCase():"#document"}function Mt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function sr(t){var e;return(e=(wc(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function wc(t){return Uo()?t instanceof Node||t instanceof Mt(t).Node:!1}function $t(t){return Uo()?t instanceof Element||t instanceof Mt(t).Element:!1}function ar(t){return Uo()?t instanceof HTMLElement||t instanceof Mt(t).HTMLElement:!1}function Gs(t){return!Uo()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Mt(t).ShadowRoot}const bg=new Set(["inline","contents"]);function qn(t){const{overflow:e,overflowX:r,overflowY:n,display:o}=er(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!bg.has(o)}const wg=new Set(["table","td","th"]);function yg(t){return wg.has(dn(t))}const xg=[":popover-open",":modal"];function Ho(t){return xg.some(e=>{try{return t.matches(e)}catch{return!1}})}const _g=["transform","translate","scale","rotate","perspective"],kg=["transform","translate","scale","rotate","perspective","filter"],Sg=["paint","layout","strict","content"];function da(t){const e=ha(),r=$t(t)?er(t):t;return _g.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||kg.some(n=>(r.willChange||"").includes(n))||Sg.some(n=>(r.contain||"").includes(n))}function Tg(t){let e=Ir(t);for(;ar(e)&&!an(e);){if(da(e))return e;if(Ho(e))return null;e=Ir(e)}return null}function ha(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Eg=new Set(["html","body","#document"]);function an(t){return Eg.has(dn(t))}function er(t){return Mt(t).getComputedStyle(t)}function qo(t){return $t(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ir(t){if(dn(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Gs(t)&&t.host||sr(t);return Gs(e)?e.host:e}function yc(t){const e=Ir(t);return an(e)?t.ownerDocument?t.ownerDocument.body:t.body:ar(e)&&qn(e)?e:yc(e)}function Nn(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const o=yc(t),i=o===((n=t.ownerDocument)==null?void 0:n.body),a=Mt(o);if(i){const s=Mi(a);return e.concat(a,a.visualViewport||[],qn(o)?o:[],s&&r?Nn(s):[])}return e.concat(o,Nn(o,[],r))}function Mi(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function xc(t){const e=er(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const o=ar(t),i=o?t.offsetWidth:r,a=o?t.offsetHeight:n,s=vo(r)!==i||vo(n)!==a;return s&&(r=i,n=a),{width:r,height:n,$:s}}function fa(t){return $t(t)?t:t.contextElement}function tn(t){const e=fa(t);if(!ar(e))return ir(1);const r=e.getBoundingClientRect(),{width:n,height:o,$:i}=xc(e);let a=(i?vo(r.width):r.width)/n,s=(i?vo(r.height):r.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Ag=ir(0);function _c(t){const e=Mt(t);return!ha()||!e.visualViewport?Ag:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Cg(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Mt(t)?!1:e}function Hr(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const o=t.getBoundingClientRect(),i=fa(t);let a=ir(1);e&&(n?$t(n)&&(a=tn(n)):a=tn(t));const s=Cg(i,r,n)?_c(i):ir(0);let c=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,d=o.width/a.x,h=o.height/a.y;if(i){const g=Mt(i),b=n&&$t(n)?Mt(n):n;let v=g,m=Mi(v);for(;m&&n&&b!==v;){const y=tn(m),w=m.getBoundingClientRect(),_=er(m),x=w.left+(m.clientLeft+parseFloat(_.paddingLeft))*y.x,k=w.top+(m.clientTop+parseFloat(_.paddingTop))*y.y;c*=y.x,l*=y.y,d*=y.x,h*=y.y,c+=x,l+=k,v=Mt(m),m=Mi(v)}}return wo({width:d,height:h,x:c,y:l})}function pa(t,e){const r=qo(t).scrollLeft;return e?e.left+r:Hr(sr(t)).left+r}function kc(t,e,r){r===void 0&&(r=!1);const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-(r?0:pa(t,n)),i=n.top+e.scrollTop;return{x:o,y:i}}function Pg(t){let{elements:e,rect:r,offsetParent:n,strategy:o}=t;const i=o==="fixed",a=sr(n),s=e?Ho(e.floating):!1;if(n===a||s&&i)return r;let c={scrollLeft:0,scrollTop:0},l=ir(1);const d=ir(0),h=ar(n);if((h||!h&&!i)&&((dn(n)!=="body"||qn(a))&&(c=qo(n)),ar(n))){const b=Hr(n);l=tn(n),d.x=b.x+n.clientLeft,d.y=b.y+n.clientTop}const g=a&&!h&&!i?kc(a,c,!0):ir(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+d.x+g.x,y:r.y*l.y-c.scrollTop*l.y+d.y+g.y}}function Og(t){return Array.from(t.getClientRects())}function Ig(t){const e=sr(t),r=qo(t),n=t.ownerDocument.body,o=Nt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Nt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+pa(t);const s=-r.scrollTop;return er(n).direction==="rtl"&&(a+=Nt(e.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:s}}function Rg(t,e){const r=Mt(t),n=sr(t),o=r.visualViewport;let i=n.clientWidth,a=n.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;const l=ha();(!l||l&&e==="fixed")&&(s=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:s,y:c}}const Dg=new Set(["absolute","fixed"]);function Lg(t,e){const r=Hr(t,!0,e==="fixed"),n=r.top+t.clientTop,o=r.left+t.clientLeft,i=ar(t)?tn(t):ir(1),a=t.clientWidth*i.x,s=t.clientHeight*i.y,c=o*i.x,l=n*i.y;return{width:a,height:s,x:c,y:l}}function Ys(t,e,r){let n;if(e==="viewport")n=Rg(t,r);else if(e==="document")n=Ig(sr(t));else if($t(e))n=Lg(e,r);else{const o=_c(t);n={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return wo(n)}function Sc(t,e){const r=Ir(t);return r===e||!$t(r)||an(r)?!1:er(r).position==="fixed"||Sc(r,e)}function Ng(t,e){const r=e.get(t);if(r)return r;let n=Nn(t,[],!1).filter(s=>$t(s)&&dn(s)!=="body"),o=null;const i=er(t).position==="fixed";let a=i?Ir(t):t;for(;$t(a)&&!an(a);){const s=er(a),c=da(a);!c&&s.position==="fixed"&&(o=null),(i?!c&&!o:!c&&s.position==="static"&&!!o&&Dg.has(o.position)||qn(a)&&!c&&Sc(t,a))?n=n.filter(d=>d!==a):o=s,a=Ir(a)}return e.set(t,n),n}function Fg(t){let{element:e,boundary:r,rootBoundary:n,strategy:o}=t;const a=[...r==="clippingAncestors"?Ho(e)?[]:Ng(e,this._c):[].concat(r),n],s=a[0],c=a.reduce((l,d)=>{const h=Ys(e,d,o);return l.top=Nt(h.top,l.top),l.right=Or(h.right,l.right),l.bottom=Or(h.bottom,l.bottom),l.left=Nt(h.left,l.left),l},Ys(e,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Mg(t){const{width:e,height:r}=xc(t);return{width:e,height:r}}function zg(t,e,r){const n=ar(e),o=sr(e),i=r==="fixed",a=Hr(t,!0,i,e);let s={scrollLeft:0,scrollTop:0};const c=ir(0);function l(){c.x=pa(o)}if(n||!n&&!i)if((dn(e)!=="body"||qn(o))&&(s=qo(e)),n){const b=Hr(e,!0,i,e);c.x=b.x+e.clientLeft,c.y=b.y+e.clientTop}else o&&l();i&&!n&&o&&l();const d=o&&!n&&!i?kc(o,s):ir(0),h=a.left+s.scrollLeft-c.x-d.x,g=a.top+s.scrollTop-c.y-d.y;return{x:h,y:g,width:a.width,height:a.height}}function hi(t){return er(t).position==="static"}function Qs(t,e){if(!ar(t)||er(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return sr(t)===r&&(r=r.ownerDocument.body),r}function Tc(t,e){const r=Mt(t);if(Ho(t))return r;if(!ar(t)){let o=Ir(t);for(;o&&!an(o);){if($t(o)&&!hi(o))return o;o=Ir(o)}return r}let n=Qs(t,e);for(;n&&yg(n)&&hi(n);)n=Qs(n,e);return n&&an(n)&&hi(n)&&!da(n)?r:n||Tg(t)||r}const Bg=async function(t){const e=this.getOffsetParent||Tc,r=this.getDimensions,n=await r(t.floating);return{reference:zg(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Ug(t){return er(t).direction==="rtl"}const Hg={convertOffsetParentRelativeRectToViewportRelativeRect:Pg,getDocumentElement:sr,getClippingRect:Fg,getOffsetParent:Tc,getElementRects:Bg,getClientRects:Og,getDimensions:Mg,getScale:tn,isElement:$t,isRTL:Ug};function Ec(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function qg(t,e){let r=null,n;const o=sr(t);function i(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function a(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),i();const l=t.getBoundingClientRect(),{left:d,top:h,width:g,height:b}=l;if(s||e(),!g||!b)return;const v=eo(h),m=eo(o.clientWidth-(d+g)),y=eo(o.clientHeight-(h+b)),w=eo(d),x={rootMargin:-v+"px "+-m+"px "+-y+"px "+-w+"px",threshold:Nt(0,Or(1,c))||1};let k=!0;function E(P){const S=P[0].intersectionRatio;if(S!==c){if(!k)return a();S?a(!1,S):n=setTimeout(()=>{a(!1,1e-7)},1e3)}S===1&&!Ec(l,t.getBoundingClientRect())&&a(),k=!1}try{r=new IntersectionObserver(E,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(E,x)}r.observe(t)}return a(!0),i}function Vg(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=fa(t),d=o||i?[...l?Nn(l):[],...Nn(e)]:[];d.forEach(w=>{o&&w.addEventListener("scroll",r,{passive:!0}),i&&w.addEventListener("resize",r)});const h=l&&s?qg(l,r):null;let g=-1,b=null;a&&(b=new ResizeObserver(w=>{let[_]=w;_&&_.target===l&&b&&(b.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=b)==null||x.observe(e)})),r()}),l&&!c&&b.observe(l),b.observe(e));let v,m=c?Hr(t):null;c&&y();function y(){const w=Hr(t);m&&!Ec(m,w)&&r(),m=w,v=requestAnimationFrame(y)}return r(),()=>{var w;d.forEach(_=>{o&&_.removeEventListener("scroll",r),i&&_.removeEventListener("resize",r)}),h?.(),(w=b)==null||w.disconnect(),b=null,c&&cancelAnimationFrame(v)}}const ga=pg,ma=gg,Wg=dg,jg=vg,Kg=hg,Gg=ug,Yg=mg,va=(t,e,r)=>{const n=new Map,o={platform:Hg,...r},i={...o.platform,_c:n};return cg(t,e,{...o,platform:i})};function Ac(t,e={enabled:!0}){let{enabled:r,eventType:n,nodeForEvent:o,options:i}=Xs(e);function a(c){c.target&&t&&!t.contains(c.target)&&!c.defaultPrevented&&t.dispatchEvent(new CustomEvent("clickoutside",{detail:c}))}let s;return e.enabled!==!1&&(s=lt(o,n,a,i)),{update(c){s?.(),{enabled:r,eventType:n,nodeForEvent:o,options:i}=Xs(c),r&&(s=lt(o,n,a,i))},destroy(){s?.()}}}function Xs(t={}){return{enabled:t.enabled??!0,nodeForEvent:t.limit?.parent??document,eventType:t.event??"click",options:typeof t.options=="boolean"?{capture:t.options}:t.options}}var Qg=(t,e)=>(t.stopPropagation(),O(e,!u(e))),Xg=X('<div class="context-box__content text-container"><!></div>'),Zg=X('<div><button class="btn btn--tertiary btn--square"><span class="sr-only"> </span> <!></button> <!></div>');function Jg(t,e){ue(e,!0);let r=D(()=>me.t),n=he(!1),o,i=he(void 0),a=p(e,"logic",7);const s={duration:Number(a().theme.components.referenceNumberContent.custom?.transitionDuration)||200,delay:Number(a().theme.components.referenceNumberContent.custom?.transitionDelay)||0,y:Number(a().theme.components.referenceNumberContent.custom?.transitionY)||10},c=async()=>{if(!o||!u(i))return;const{x:w,y:_}=await va(o,u(i),{placement:"bottom-end",middleware:[ga(8),ma({padding:8})]});Object.assign(u(i).style,{left:`${w}px`,top:`${_}px`})};Ue(()=>{u(n)&&c()});var l=Zg();let d;var h=z(l);h.__click=[Qg,n];var g=z(h),b=z(g,!0);N(g);var v=ne(g,2);{let w=D(()=>u(n)?"menuClose":"info");Ze(v,{get name(){return u(w)}})}N(h),Br(h,w=>o=w,()=>o),St(h,w=>Ac?.(w)),St(h,(w,_)=>cn?.(w,_),()=>({text:u(r).openInfo,position:"bottom-right",delay:0}));var m=ne(h,2);{var y=w=>{var _=Xg(),x=z(_);Pr(x,()=>u(r).aboutThisChat),N(_),Br(_,k=>O(i,k),()=>u(i)),It(3,_,()=>Wt,()=>s),A(w,_)};J(m,w=>{u(n)&&w(y)})}return N(l),ge(w=>{d=rt(l,1,"context-box context-box--info",null,d,w),pe(h,"aria-label",u(n)?u(r).close:u(r).openInfo),Ee(b,u(n)?u(r).close:u(r).openInfo)},[()=>({open:u(n)})]),ht("clickoutside",h,()=>O(n,!1)),A(t,l),de({get logic(){return a()},set logic(w){a(w),f()}})}jt(["click"]);ce(Jg,{logic:{}},[],[],!0);const $g=t=>t.charAt(0).toUpperCase()+t.slice(1);var em=(t,e)=>e("light"),tm=(t,e)=>e("dark"),rm=X('<div class="color-scheme-selector"><button><!> <span> </span></button> <hr class="color-scheme-selector__separator"/> <button><!> <span> </span></button></div>');function Cc(t,e){ue(e,!1);const r=v=>{me.data.selectedColorScheme===v?me.setColorScheme("system"):me.setColorScheme(v)};Do();var n=rm(),o=z(n);let i;o.__click=[em,r];var a=z(o);Ze(a,{name:"lightMode"});var s=ne(a,2),c=z(s,!0);N(s),N(o);var l=ne(o,4);let d;l.__click=[tm,r];var h=z(l);Ze(h,{name:"darkMode"});var g=ne(h,2),b=z(g,!0);N(g),N(l),N(n),ge((v,m)=>{i=rt(o,1,"color-scheme-selector__button transition-colors",null,i,v),Ee(c,me.t.lightMode),d=rt(l,1,"color-scheme-selector__button transition-colors",null,d,m),Ee(b,me.t.darkMode)},[()=>({"color-scheme-selector__button--active":me.data.selectedColorScheme==="light"}),()=>({"color-scheme-selector__button--active":me.data.selectedColorScheme==="dark"})]),A(t,n),de()}jt(["click"]);ce(Cc,{},[],[],!0);var nm=(t,e)=>(t.stopPropagation(),O(e,!u(e))),om=X('<li><a class="context-box__menu-item transition-colors"><!> <span> </span></a></li>'),im=(t,e,r)=>e(u(r)),am=X("<li><button><!> <span> </span></button></li>"),sm=X('<hr class="context-box__separator"/> <div class="context-box__title"> </div> <ul class="context-box__menu"></ul>',1),lm=X('<hr class="context-box__separator"/> <!>',1),cm=X('<div class="context-box__content"><ul class="context-box__menu"></ul> <!> <!></div>'),um=X('<div><button class="btn btn--tertiary btn--square"><span class="sr-only"> </span> <!></button> <!></div>');function dm(t,e){ue(e,!0);let r=D(()=>me.t),n=p(e,"chatLogic",7),o=he(!1),i,a=he(void 0);const s={duration:Number(me.theme.components.referenceNumberContent.custom?.transitionDuration)||200,delay:Number(me.theme.components.referenceNumberContent.custom?.transitionDelay)||0,y:Number(me.theme.components.referenceNumberContent.custom?.transitionY)||10},c=async()=>{if(!i||!u(a))return;const{x,y:k}=await va(i,u(a),{placement:"bottom-end",middleware:[ga(8),ma({padding:8})]});Object.assign(u(a).style,{left:`${x}px`,top:`${k}px`})};Ue(()=>{u(o)&&c()});const l=x=>{n().onLanguageChange(x),O(o,!1)},d=x=>{if("Intl"in globalThis&&Intl.DisplayNames){const k=new Intl.DisplayNames([x],{type:"language"});return $g(k.of(x)??x.toUpperCase())}return x.toUpperCase()};var h=um();let g;var b=z(h);b.__click=[nm,o];var v=z(b),m=z(v,!0);N(v);var y=ne(v,2);{let x=D(()=>u(o)?"menuClose":"menu");Ze(y,{get name(){return u(x)}})}N(b),Br(b,x=>i=x,()=>i),St(b,x=>Ac?.(x)),St(b,(x,k)=>cn?.(x,k),()=>({text:u(r).openMenu,position:"bottom-right",delay:0}));var w=ne(b,2);{var _=x=>{var k=cm(),E=z(k);Jt(E,21,()=>n().menu,Cr,(G,I)=>{var B=om(),W=z(B),M=z(W);Ze(M,{get name(){return u(I).icon},class:"context-box__menu-item__icon"});var C=ne(M,2),te=z(C,!0);N(C),N(W),N(B),ge(()=>{pe(W,"href",u(I).url),pe(W,"target",u(I).target),Ee(te,u(I).label)}),A(G,B)}),N(E);var P=ne(E,2);{var S=G=>{var I=sm(),B=ne(V(I),2),W=z(B,!0);N(B);var M=ne(B,2);Jt(M,21,()=>n().data.chatConfig.supportedLanguages,Cr,(C,te)=>{var le=am(),oe=z(le);let ie;oe.__click=[im,l,te];var L=z(oe);Ze(L,{name:"internalLink",class:"context-box__menu-item__icon"});var Z=ne(L,2),H=z(Z,!0);N(Z),N(oe),N(le),ge((R,K)=>{ie=rt(oe,1,"context-box__menu-item transition-colors",null,ie,R),Ee(H,K)},[()=>({active:me.data.language===u(te)}),()=>d(u(te))]),A(C,le)}),N(M),ge(()=>Ee(W,u(r).selectLanguage)),A(G,I)};J(P,G=>{n().data.chatConfig.supportedLanguages.length>0&&G(S)})}var U=ne(P,2);{var j=G=>{var I=lm(),B=ne(V(I),2);Cc(B,{}),A(G,I)};J(U,G=>{me.data.has2ColorSchemes&&G(j)})}N(k),Br(k,G=>O(a,G),()=>u(a)),It(3,k,()=>Wt,()=>s),A(x,k)};J(w,x=>{u(o)&&x(_)})}return N(h),ge(x=>{g=rt(h,1,"context-box",null,g,x),pe(b,"aria-label",u(o)?u(r).closeMenu:u(r).openMenu),Ee(m,u(o)?u(r).closeMenu:u(r).openMenu)},[()=>({open:u(o)})]),ht("clickoutside",b,()=>O(o,!1)),A(t,h),de({get chatLogic(){return n()},set chatLogic(x){n(x),f()}})}jt(["click"]);ce(dm,{chatLogic:{}},[],[],!0);function hm(t,e){ue(e,!0);let r=p(e,"css",7),n=at(e,["$$slots","$$events","$$legacy","$$host","css"]);const o=c=>{Ue(()=>{r()&&(c.innerHTML=r())})};var i=Y(),a=V(i);{var s=c=>{var l=Y(),d=V(l);Ll(d,()=>"style",!1,(h,g)=>{St(h,b=>o?.(b)),We(h,()=>({...n}))}),A(c,l)};J(a,c=>{r()&&c(s)})}return A(t,i),de({get css(){return r()},set css(c){r(c),f()}})}ce(hm,{css:{}},[],[],!0);const Zs=t=>Array.from(t.querySelectorAll('a[href], button, input:not([type="hidden"]), textarea, select, details,[tabindex]:not([tabindex="-1"])')).filter(r=>!r.hasAttribute("disabled")&&!r.getAttribute("aria-hidden")),fi=t=>{const e=t.getRootNode();return"activeElement"in e?e.activeElement:document.activeElement};function fm(t,e){const r=fi(t);let n=Zs(t),o;const i=new MutationObserver(()=>{n=Zs(t)}),a=s=>{n&&t.dataset.disabled!=="true"&&s.key==="Tab"&&(s.shiftKey?fi(t)===n[0]&&(s.preventDefault(),n[n.length-1].focus()):fi(t)===n[n.length-1]&&(s.preventDefault(),n[0].focus()))};return n&&n.length>0&&(o=n[0],requestAnimationFrame(()=>{o?.focus({preventScroll:!0})}),t.addEventListener("keydown",a),i.observe(t,{childList:!0,subtree:!0})),{destroy(){n&&n.length>0&&(n=null,o=null,t.removeEventListener("keydown",a),i.disconnect(),e?.resetFocusOnDestroy&&r&&requestAnimationFrame(()=>{r.focus({preventScroll:!0})}))}}}function pm(t){return typeof t=="function"}function Vn(t){return t!==null&&typeof t=="object"}const gm=["string","number","bigint","boolean"];function zi(t){return t==null||gm.includes(typeof t)?!0:Array.isArray(t)?t.every(e=>zi(e)):typeof t=="object"?Object.getPrototypeOf(t)===Object.prototype:!1}const Fn=Symbol("box"),ba=Symbol("is-writable");function mm(t){return Vn(t)&&Fn in t}function vm(t){return F.isBox(t)&&ba in t}function F(t){let e=he(Fr(t));return{[Fn]:!0,[ba]:!0,get current(){return u(e)},set current(r){O(e,r,!0)}}}function bm(t,e){const r=D(t);return e?{[Fn]:!0,[ba]:!0,get current(){return u(r)},set current(n){e(n)}}:{[Fn]:!0,get current(){return t()}}}function wm(t){return F.isBox(t)?t:pm(t)?F.with(t):F(t)}function ym(t){return Object.entries(t).reduce((e,[r,n])=>F.isBox(n)?(F.isWritableBox(n)?Object.defineProperty(e,r,{get(){return n.current},set(o){n.current=o}}):Object.defineProperty(e,r,{get(){return n.current}}),e):Object.assign(e,{[r]:n}),{})}function xm(t){return F.isWritableBox(t)?{[Fn]:!0,get current(){return t.current}}:t}F.from=wm;F.with=bm;F.flatten=ym;F.readonly=xm;F.isBox=mm;F.isWritableBox=vm;function Pc(...t){return function(e){for(const r of t)if(r){if(e.defaultPrevented)return;typeof r=="function"?r.call(this,e):r.current?.call(this,e)}}}var Qr={},pi,Js;function _m(){if(Js)return pi;Js=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,c=`
|
|
197
197
|
`,l="/",d="*",h="",g="comment",b="declaration";pi=function(m,y){if(typeof m!="string")throw new TypeError("First argument must be a string");if(!m)return[];y=y||{};var w=1,_=1;function x(W){var M=W.match(e);M&&(w+=M.length);var C=W.lastIndexOf(c);_=~C?W.length-C:_+W.length}function k(){var W={line:w,column:_};return function(M){return M.position=new E(W),U(),M}}function E(W){this.start=W,this.end={line:w,column:_},this.source=y.source}E.prototype.content=m;function P(W){var M=new Error(y.source+":"+w+":"+_+": "+W);if(M.reason=W,M.filename=y.source,M.line=w,M.column=_,M.source=m,!y.silent)throw M}function S(W){var M=W.exec(m);if(M){var C=M[0];return x(C),m=m.slice(C.length),M}}function U(){S(r)}function j(W){var M;for(W=W||[];M=G();)M!==!1&&W.push(M);return W}function G(){var W=k();if(!(l!=m.charAt(0)||d!=m.charAt(1))){for(var M=2;h!=m.charAt(M)&&(d!=m.charAt(M)||l!=m.charAt(M+1));)++M;if(M+=2,h===m.charAt(M-1))return P("End of comment missing");var C=m.slice(2,M-2);return _+=2,x(C),m=m.slice(M),_+=2,W({type:g,comment:C})}}function I(){var W=k(),M=S(n);if(M){if(G(),!S(o))return P("property missing ':'");var C=S(i),te=W({type:b,property:v(M[0].replace(t,h)),value:C?v(C[0].replace(t,h)):h});return S(a),te}}function B(){var W=[];j(W);for(var M;M=I();)M!==!1&&(W.push(M),j(W));return W}return U(),B()};function v(m){return m?m.replace(s,h):h}return pi}var $s;function km(){if($s)return Qr;$s=1;var t=Qr&&Qr.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.default=r;var e=t(_m());function r(n,o){var i=null;if(!n||typeof n!="string")return i;var a=(0,e.default)(n),s=typeof o=="function";return a.forEach(function(c){if(c.type==="declaration"){var l=c.property,d=c.value;s?o(l,d,c):d&&(i=i||{},i[l]=d)}}),i}return Qr}var Sm=km();const el=Rl(Sm),Tm=el.default||el,Em=/\d/,Am=["-","_","/","."];function Cm(t=""){if(!Em.test(t))return t!==t.toLowerCase()}function Pm(t){const e=[];let r="",n,o;for(const i of t){const a=Am.includes(i);if(a===!0){e.push(r),r="",n=void 0;continue}const s=Cm(i);if(o===!1){if(n===!1&&s===!0){e.push(r),r=i,n=s;continue}if(n===!0&&s===!1&&r.length>1){const c=r.at(-1);e.push(r.slice(0,Math.max(0,r.length-1))),r=c+i,n=s;continue}}r+=i,n=s,o=a}return e.push(r),e}function Oc(t){return t?Pm(t).map(e=>Im(e)).join(""):""}function Om(t){return Rm(Oc(t||""))}function Im(t){return t?t[0].toUpperCase()+t.slice(1):""}function Rm(t){return t?t[0].toLowerCase()+t.slice(1):""}function Cn(t){if(!t)return{};const e={};function r(n,o){if(n.startsWith("-moz-")||n.startsWith("-webkit-")||n.startsWith("-ms-")||n.startsWith("-o-")){e[Oc(n)]=o;return}if(n.startsWith("--")){e[n]=o;return}e[Om(n)]=o}return Tm(t,r),e}function rn(...t){return(...e)=>{for(const r of t)typeof r=="function"&&r(...e)}}function Dm(t,e){const r=RegExp(t,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(r)?n.replace(r,e):n}}const Lm=Dm(/[A-Z]/,t=>`-${t.toLowerCase()}`);function Nm(t){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected an argument of type object, but got ${typeof t}`);return Object.keys(t).map(e=>`${Lm(e)}: ${t[e]};`).join(`
|