'+I+" ");let we=L?L.createHTML(I):I;if(pt===Be)try{te=new m().parseFromString(we,vt)}catch{}if(!te||!te.documentElement){te=O.createDocument(pt,"template",null);try{te.documentElement.innerHTML=or?M:we}catch{}}let He=te.body||te.documentElement;return I&&V&&He.insertBefore(r.createTextNode(V),He.childNodes[0]||null),pt===Be?G.call(te,We?"html":"body")[0]:We?te.documentElement:He},"_initDocument"),xr=l(function(I){return R.call(I.ownerDocument||I,I,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},"_createNodeIterator"),Lr=l(function(I){return I instanceof h&&(typeof I.nodeName!="string"||typeof I.textContent!="string"||typeof I.removeChild!="function"||!(I.attributes instanceof p)||typeof I.removeAttribute!="function"||typeof I.setAttribute!="function"||typeof I.namespaceURI!="string"||typeof I.insertBefore!="function"||typeof I.hasChildNodes!="function")},"_isClobbered"),_r=l(function(I){return typeof i=="function"&&I instanceof i},"_isNode");function kt(I,te,V){Kc(I,we=>{we.call(t,te,V,de)})}l(kt,"_executeHooks");let da=l(function(I){let te=null;if(kt(N.beforeSanitizeElements,I,null),Lr(I))return Le(I),!0;let V=K(I.nodeName);if(kt(N.uponSanitizeElement,I,{tagName:V,allowedTags:Ce}),I.hasChildNodes()&&!_r(I.firstElementChild)&&Gr(/<[/\w!]/g,I.innerHTML)&&Gr(/<[/\w!]/g,I.textContent)||I.nodeType===zi.progressingInstruction||ut&&I.nodeType===zi.comment&&Gr(/<[/\w]/g,I.data))return Le(I),!0;if(!Ce[V]||ht[V]){if(!ht[V]&&Fr(V)&&(ke.tagNameCheck instanceof RegExp&&Gr(ke.tagNameCheck,V)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(V)))return!1;if(Ot&&!Rt[V]){let we=$(I)||I.parentNode,He=A(I)||I.childNodes;if(He&&we){let ze=He.length;for(let Mt=ze-1;Mt>=0;--Mt){let ft=w(He[Mt],!0);ft.__removalCount=(I.__removalCount||0)+1,we.insertBefore(ft,C(I))}}}return Le(I),!0}return I instanceof c&&!lt(I)||(V==="noscript"||V==="noembed"||V==="noframes")&&Gr(/<\/no(script|embed|frames)/i,I.innerHTML)?(Le(I),!0):(Ae&&I.nodeType===zi.text&&(te=I.textContent,Kc([T,U,ae],we=>{te=Ni(te,we," ")}),I.textContent!==te&&(Mi(t.removed,{element:I.cloneNode()}),I.textContent=te)),kt(N.afterSanitizeElements,I,null),!1)},"_sanitizeElements"),Vr=l(function(I,te,V){if(fr&&(te==="id"||te==="name")&&(V in r||V in Ee))return!1;if(!(Fe&&!xe[te]&&Gr(oe,te))&&!(Ge&&Gr(ue,te))){if(!Te[te]||xe[te]){if(!(Fr(I)&&(ke.tagNameCheck instanceof RegExp&&Gr(ke.tagNameCheck,I)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(I))&&(ke.attributeNameCheck instanceof RegExp&&Gr(ke.attributeNameCheck,te)||ke.attributeNameCheck instanceof Function&&ke.attributeNameCheck(te))||te==="is"&&ke.allowCustomizedBuiltInElements&&(ke.tagNameCheck instanceof RegExp&&Gr(ke.tagNameCheck,V)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(V))))return!1}else if(!Gt[te]&&!Gr(gt,Ni(V,fe,""))&&!((te==="src"||te==="xlink:href"||te==="href")&&I!=="script"&&OT(V,"data:")===0&&ar[I])&&!(De&&!Gr(ge,Ni(V,fe,"")))&&V)return!1}return!0},"_isValidAttribute"),Fr=l(function(I){return I!=="annotation-xml"&&iv(I,Ve)},"_isBasicCustomElement"),yr=l(function(I){kt(N.beforeSanitizeAttributes,I,null);let{attributes:te}=I;if(!te||Lr(I))return;let V={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Te,forceKeepAttr:void 0},we=te.length;for(;we--;){let He=te[we],{name:ze,namespaceURI:Mt,value:ft}=He,ct=K(ze),at=ze==="value"?ft:RT(ft);if(V.attrName=ct,V.attrValue=at,V.keepAttr=!0,V.forceKeepAttr=void 0,kt(N.uponSanitizeAttribute,I,V),at=V.attrValue,rr&&(ct==="id"||ct==="name")&&(Ht(ze,I),at=Zt+at),ut&&Gr(/((--!?|])>)|<\/(style|title)/i,at)){Ht(ze,I);continue}if(V.forceKeepAttr||(Ht(ze,I),!V.keepAttr))continue;if(!Ne&&Gr(/\/>/i,at)){Ht(ze,I);continue}Ae&&Kc([T,U,ae],se=>{at=Ni(at,se," ")});let H=K(I.nodeName);if(Vr(H,ct,at)){if(L&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Mt)switch(g.getAttributeType(H,ct)){case"TrustedHTML":{at=L.createHTML(at);break}case"TrustedScriptURL":{at=L.createScriptURL(at);break}}try{Mt?I.setAttributeNS(Mt,ze,at):I.setAttribute(ze,at),Lr(I)?Le(I):sv(t.removed)}catch{}}}kt(N.afterSanitizeAttributes,I,null)},"_sanitizeAttributes"),ua=l(function I(te){let V=null,we=xr(te);for(kt(N.beforeSanitizeShadowDOM,te,null);V=we.nextNode();)kt(N.uponSanitizeShadowNode,V,null),da(V),yr(V),V.content instanceof o&&I(V.content);kt(N.afterSanitizeShadowDOM,te,null)},"_sanitizeShadowDOM");return t.sanitize=function(I){let te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},V=null,we=null,He=null,ze=null;if(or=!I,or&&(I=""),typeof I!="string"&&!_r(I))if(typeof I.toString=="function"){if(I=I.toString(),typeof I!="string")throw Di("dirty is not a string, aborting")}else throw Di("toString is not a function");if(!t.isSupported)return I;if(yt||X(te),t.removed=[],typeof I=="string"&&(jt=!1),jt){if(I.nodeName){let ct=K(I.nodeName);if(!Ce[ct]||ht[ct])throw Di("root node is forbidden and cannot be sanitized in-place")}}else if(I instanceof i)V=Ur(""),we=V.ownerDocument.importNode(I,!0),we.nodeType===zi.element&&we.nodeName==="BODY"||we.nodeName==="HTML"?V=we:V.appendChild(we);else{if(!bt&&!Ae&&!We&&I.indexOf("<")===-1)return L&&tr?L.createHTML(I):I;if(V=Ur(I),!V)return bt?null:tr?M:""}V&&tt&&Le(V.firstChild);let Mt=xr(jt?I:V);for(;He=Mt.nextNode();)da(He),yr(He),He.content instanceof o&&ua(He.content);if(jt)return I;if(bt){if(_t)for(ze=B.call(V.ownerDocument);V.firstChild;)ze.appendChild(V.firstChild);else ze=V;return(Te.shadowroot||Te.shadowrootmode)&&(ze=j.call(a,ze,!0)),ze}let ft=We?V.outerHTML:V.innerHTML;return We&&Ce["!doctype"]&&V.ownerDocument&&V.ownerDocument.doctype&&V.ownerDocument.doctype.name&&Gr(zw,V.ownerDocument.doctype.name)&&(ft=" `+ft),Ae&&Kc([T,U,ae],ct=>{ft=Ni(ft,ct," ")}),L&&tr?L.createHTML(ft):ft},t.setConfig=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};X(I),yt=!0},t.clearConfig=function(){de=null,yt=!1},t.isValidAttribute=function(I,te,V){de||X({});let we=K(I),He=K(te);return Vr(we,He,V)},t.addHook=function(I,te){typeof te=="function"&&Mi(N[I],te)},t.removeHook=function(I,te){if(te!==void 0){let V=$T(N[I],te);return V===-1?void 0:PT(N[I],V,1)[0]}return sv(N[I])},t.removeHooks=function(I){N[I]=[]},t.removeAllHooks=function(){N=pv()},t}function jw(){if(fv)return kp;fv=1;function e(_){return _ instanceof Map?_.clear=_.delete=_.set=function(){throw new Error("map is read-only")}:_ instanceof Set&&(_.add=_.clear=_.delete=function(){throw new Error("set is read-only")}),Object.freeze(_),Object.getOwnPropertyNames(_).forEach(P=>{let K=_[P],de=typeof K;(de==="object"||de==="function")&&!Object.isFrozen(K)&&e(K)}),_}l(e,"deepFreeze");let t=class{static{l(this,"Response")}constructor(_){_.data===void 0&&(_.data={}),this.data=_.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function r(_){return _.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}l(r,"escapeHTML");function a(_,...P){let K=Object.create(null);for(let de in _)K[de]=_[de];return P.forEach(function(de){for(let Ee in de)K[Ee]=de[Ee]}),K}l(a,"inherit$1");let n="",o=l(_=>!!_.scope,"emitsWrappingTags"),s=l((_,{prefix:P})=>{if(_.startsWith("language:"))return _.replace("language:","language-");if(_.includes(".")){let K=_.split(".");return[`${P}${K.shift()}`,...K.map((de,Ee)=>`${de}${"_".repeat(Ee+1)}`)].join(" ")}return`${P}${_}`},"scopeToCSSClass"),i=class{static{l(this,"HTMLRenderer")}constructor(_,P){this.buffer="",this.classPrefix=P.classPrefix,_.walk(this)}addText(_){this.buffer+=r(_)}openNode(_){if(!o(_))return;let P=s(_.scope,{prefix:this.classPrefix});this.span(P)}closeNode(_){o(_)&&(this.buffer+=n)}value(){return this.buffer}span(_){this.buffer+=``}},c=l((_={})=>{let P={children:[]};return Object.assign(P,_),P},"newNode"),u=class Zw{static{l(this,"TokenTree")}constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(P){this.top.children.push(P)}openNode(P){let K=c({scope:P});this.add(K),this.stack.push(K)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(P){return this.constructor._walk(P,this.rootNode)}static _walk(P,K){return typeof K=="string"?P.addText(K):K.children&&(P.openNode(K),K.children.forEach(de=>this._walk(P,de)),P.closeNode(K)),P}static _collapse(P){typeof P!="string"&&P.children&&(P.children.every(K=>typeof K=="string")?P.children=[P.children.join("")]:P.children.forEach(K=>{Zw._collapse(K)}))}},p=class extends u{static{l(this,"TokenTreeEmitter")}constructor(_){super(),this.options=_}addText(_){_!==""&&this.add(_)}startScope(_){this.openNode(_)}endScope(){this.closeNode()}__addSublanguage(_,P){let K=_.root;P&&(K.scope=`language:${P}`),this.add(K)}toHTML(){return new i(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function h(_){return _?typeof _=="string"?_:_.source:null}l(h,"source");function m(_){return w("(?=",_,")")}l(m,"lookahead");function g(_){return w("(?:",_,")*")}l(g,"anyNumberOfTimes");function x(_){return w("(?:",_,")?")}l(x,"optional");function w(..._){return _.map(P=>h(P)).join("")}l(w,"concat");function k(_){let P=_[_.length-1];return typeof P=="object"&&P.constructor===Object?(_.splice(_.length-1,1),P):{}}l(k,"stripOptionsFromArgs");function C(..._){return"("+(k(_).capture?"":"?:")+_.map(P=>h(P)).join("|")+")"}l(C,"either");function A(_){return new RegExp(_.toString()+"|").exec("").length-1}l(A,"countMatchGroups");function $(_,P){let K=_&&_.exec(P);return K&&K.index===0}l($,"startsWith");let L=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function M(_,{joinWith:P}){let K=0;return _.map(de=>{K+=1;let Ee=K,Re=h(de),X="";for(;Re.length>0;){let J=L.exec(Re);if(!J){X+=Re;break}X+=Re.substring(0,J.index),Re=Re.substring(J.index+J[0].length),J[0][0]==="\\"&&J[1]?X+="\\"+String(Number(J[1])+Ee):(X+=J[0],J[0]==="("&&K++)}return X}).map(de=>`(${de})`).join(P)}l(M,"_rewriteBackreferences");let O=/\b\B/,R="[a-zA-Z]\\w*",B="[a-zA-Z_]\\w*",G="\\b\\d+(\\.\\d+)?",j="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",N="\\b(0b[01]+)",T="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",U=l((_={})=>{let P=/^#![ ]*\//;return _.binary&&(_.begin=w(P,/.*\b/,_.binary,/\b.*/)),a({scope:"meta",begin:P,end:/$/,relevance:0,"on:begin":l((K,de)=>{K.index!==0&&de.ignoreMatch()},"on:begin")},_)},"SHEBANG"),ae={begin:"\\\\[\\s\\S]",relevance:0},oe={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ae]},ue={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ae]},ge={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},fe=l(function(_,P,K={}){let de=a({scope:"comment",begin:_,end:P,contains:[]},K);de.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let Ee=C("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return de.contains.push({begin:w(/[ ]+/,"(",Ee,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),de},"COMMENT"),Ve=fe("//","$"),gt=fe("/\\*","\\*/"),Ce=fe("#","$"),pr={scope:"number",begin:G,relevance:0},Te={scope:"number",begin:j,relevance:0},Ct={scope:"number",begin:N,relevance:0},ke={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ae,{begin:/\[/,end:/\]/,relevance:0,contains:[ae]}]},ht={scope:"title",begin:R,relevance:0},xe={scope:"title",begin:B,relevance:0},Ge={begin:"\\.\\s*"+B,relevance:0};var Fe=Object.freeze({__proto__:null,APOS_STRING_MODE:oe,BACKSLASH_ESCAPE:ae,BINARY_NUMBER_MODE:Ct,BINARY_NUMBER_RE:N,COMMENT:fe,C_BLOCK_COMMENT_MODE:gt,C_LINE_COMMENT_MODE:Ve,C_NUMBER_MODE:Te,C_NUMBER_RE:j,END_SAME_AS_BEGIN:l(function(_){return Object.assign(_,{"on:begin":l((P,K)=>{K.data._beginMatch=P[1]},"on:begin"),"on:end":l((P,K)=>{K.data._beginMatch!==P[1]&&K.ignoreMatch()},"on:end")})},"END_SAME_AS_BEGIN"),HASH_COMMENT_MODE:Ce,IDENT_RE:R,MATCH_NOTHING_RE:O,METHOD_GUARD:Ge,NUMBER_MODE:pr,NUMBER_RE:G,PHRASAL_WORDS_MODE:ge,QUOTE_STRING_MODE:ue,REGEXP_MODE:ke,RE_STARTERS_RE:T,SHEBANG:U,TITLE_MODE:ht,UNDERSCORE_IDENT_RE:B,UNDERSCORE_TITLE_MODE:xe});function De(_,P){_.input[_.index-1]==="."&&P.ignoreMatch()}l(De,"skipIfHasPrecedingDot");function Ne(_,P){_.className!==void 0&&(_.scope=_.className,delete _.className)}l(Ne,"scopeClassName");function Ae(_,P){P&&_.beginKeywords&&(_.begin="\\b("+_.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",_.__beforeBegin=De,_.keywords=_.keywords||_.beginKeywords,delete _.beginKeywords,_.relevance===void 0&&(_.relevance=0))}l(Ae,"beginKeywords");function ut(_,P){Array.isArray(_.illegal)&&(_.illegal=C(..._.illegal))}l(ut,"compileIllegal");function We(_,P){if(_.match){if(_.begin||_.end)throw new Error("begin & end are not supported with match");_.begin=_.match,delete _.match}}l(We,"compileMatch");function yt(_,P){_.relevance===void 0&&(_.relevance=1)}l(yt,"compileRelevance");let tt=l((_,P)=>{if(!_.beforeMatch)return;if(_.starts)throw new Error("beforeMatch cannot be used with starts");let K=Object.assign({},_);Object.keys(_).forEach(de=>{delete _[de]}),_.keywords=K.keywords,_.begin=w(K.beforeMatch,m(K.begin)),_.starts={relevance:0,contains:[Object.assign(K,{endsParent:!0})]},_.relevance=0,delete K.beforeMatch},"beforeMatchExt"),bt=["of","and","for","in","not","or","if","then","parent","list","value"],_t="keyword";function tr(_,P,K=_t){let de=Object.create(null);return typeof _=="string"?Ee(K,_.split(" ")):Array.isArray(_)?Ee(K,_):Object.keys(_).forEach(function(Re){Object.assign(de,tr(_[Re],P,Re))}),de;function Ee(Re,X){P&&(X=X.map(J=>J.toLowerCase())),X.forEach(function(J){let pe=J.split("|");de[pe[0]]=[Re,fr(pe[0],pe[1])]})}}l(tr,"compileKeywords");function fr(_,P){return P?Number(P):rr(_)?0:1}l(fr,"scoreForKeyword");function rr(_){return bt.includes(_.toLowerCase())}l(rr,"commonKeyword");let Zt={},Ot=l(_=>{console.error(_)},"error"),jt=l((_,...P)=>{console.log(`WARN: ${_}`,...P)},"warn"),it=l((_,P)=>{Zt[`${_}/${P}`]||(console.log(`Deprecated as of ${_}. ${P}`),Zt[`${_}/${P}`]=!0)},"deprecated"),Rt=new Error;function Kt(_,P,{key:K}){let de=0,Ee=_[K],Re={},X={};for(let J=1;J<=P.length;J++)X[J+de]=Ee[J],Re[J+de]=!0,de+=A(P[J-1]);_[K]=X,_[K]._emit=Re,_[K]._multi=!0}l(Kt,"remapScopeNames");function ar(_){if(Array.isArray(_.begin)){if(_.skip||_.excludeBegin||_.returnBegin)throw Ot("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Rt;if(typeof _.beginScope!="object"||_.beginScope===null)throw Ot("beginScope must be object"),Rt;Kt(_,_.begin,{key:"beginScope"}),_.begin=M(_.begin,{joinWith:""})}}l(ar,"beginMultiClass");function vr(_){if(Array.isArray(_.end)){if(_.skip||_.excludeEnd||_.returnEnd)throw Ot("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Rt;if(typeof _.endScope!="object"||_.endScope===null)throw Ot("endScope must be object"),Rt;Kt(_,_.end,{key:"endScope"}),_.end=M(_.end,{joinWith:""})}}l(vr,"endMultiClass");function Gt(_){_.scope&&typeof _.scope=="object"&&_.scope!==null&&(_.beginScope=_.scope,delete _.scope)}l(Gt,"scopeSugar");function nr(_){Gt(_),typeof _.beginScope=="string"&&(_.beginScope={_wrap:_.beginScope}),typeof _.endScope=="string"&&(_.endScope={_wrap:_.endScope}),ar(_),vr(_)}l(nr,"MultiClass");function Lt(_){function P(X,J){return new RegExp(h(X),"m"+(_.case_insensitive?"i":"")+(_.unicodeRegex?"u":"")+(J?"g":""))}l(P,"langRe");let K=class{static{l(this,"MultiRegex")}constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(X,J){J.position=this.position++,this.matchIndexes[this.matchAt]=J,this.regexes.push([J,X]),this.matchAt+=A(X)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let X=this.regexes.map(J=>J[1]);this.matcherRe=P(M(X,{joinWith:"|"}),!0),this.lastIndex=0}exec(X){this.matcherRe.lastIndex=this.lastIndex;let J=this.matcherRe.exec(X);if(!J)return null;let pe=J.findIndex((Le,Ht)=>Ht>0&&Le!==void 0),lt=this.matchIndexes[pe];return J.splice(0,pe),Object.assign(J,lt)}},de=class{static{l(this,"ResumableMultiRegex")}constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(X){if(this.multiRegexes[X])return this.multiRegexes[X];let J=new K;return this.rules.slice(X).forEach(([pe,lt])=>J.addRule(pe,lt)),J.compile(),this.multiRegexes[X]=J,J}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(X,J){this.rules.push([X,J]),J.type==="begin"&&this.count++}exec(X){let J=this.getMatcher(this.regexIndex);J.lastIndex=this.lastIndex;let pe=J.exec(X);if(this.resumingScanAtSamePosition()&&!(pe&&pe.index===this.lastIndex)){let lt=this.getMatcher(0);lt.lastIndex=this.lastIndex+1,pe=lt.exec(X)}return pe&&(this.regexIndex+=pe.position+1,this.regexIndex===this.count&&this.considerAll()),pe}};function Ee(X){let J=new de;return X.contains.forEach(pe=>J.addRule(pe.begin,{rule:pe,type:"begin"})),X.terminatorEnd&&J.addRule(X.terminatorEnd,{type:"end"}),X.illegal&&J.addRule(X.illegal,{type:"illegal"}),J}l(Ee,"buildModeRegex");function Re(X,J){let pe=X;if(X.isCompiled)return pe;[Ne,We,nr,tt].forEach(Le=>Le(X,J)),_.compilerExtensions.forEach(Le=>Le(X,J)),X.__beforeBegin=null,[Ae,ut,yt].forEach(Le=>Le(X,J)),X.isCompiled=!0;let lt=null;return typeof X.keywords=="object"&&X.keywords.$pattern&&(X.keywords=Object.assign({},X.keywords),lt=X.keywords.$pattern,delete X.keywords.$pattern),lt=lt||/\w+/,X.keywords&&(X.keywords=tr(X.keywords,_.case_insensitive)),pe.keywordPatternRe=P(lt,!0),J&&(X.begin||(X.begin=/\B|\b/),pe.beginRe=P(pe.begin),!X.end&&!X.endsWithParent&&(X.end=/\B|\b/),X.end&&(pe.endRe=P(pe.end)),pe.terminatorEnd=h(pe.end)||"",X.endsWithParent&&J.terminatorEnd&&(pe.terminatorEnd+=(X.end?"|":"")+J.terminatorEnd)),X.illegal&&(pe.illegalRe=P(X.illegal)),X.contains||(X.contains=[]),X.contains=[].concat(...X.contains.map(function(Le){return Be(Le==="self"?X:Le)})),X.contains.forEach(function(Le){Re(Le,pe)}),X.starts&&Re(X.starts,J),pe.matcher=Ee(pe),pe}if(l(Re,"compileMode"),_.compilerExtensions||(_.compilerExtensions=[]),_.contains&&_.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return _.classNameAliases=a(_.classNameAliases||{}),Re(_)}l(Lt,"compileLanguage");function rt(_){return _?_.endsWithParent||rt(_.starts):!1}l(rt,"dependencyOnParent");function Be(_){return _.variants&&!_.cachedVariants&&(_.cachedVariants=_.variants.map(function(P){return a(_,{variants:null},P)})),_.cachedVariants?_.cachedVariants:rt(_)?a(_,{starts:_.starts?a(_.starts):null}):Object.isFrozen(_)?a(_):_}l(Be,"expandOrCloneMode");var pt="11.11.1";let or=class extends Error{static{l(this,"HTMLInjectionError")}constructor(_,P){super(_),this.name="HTMLInjectionError",this.html=P}},Bt=r,wr=a,sr=Symbol("nomatch"),mr=7,gr=l(function(_){let P=Object.create(null),K=Object.create(null),de=[],Ee=!0,Re="Could not find the language '{}', did you forget to load/include a language module?",X={disableAutodetect:!0,name:"Plain text",contains:[]},J={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function pe(H){return J.noHighlightRe.test(H)}l(pe,"shouldNotHighlight");function lt(H){let se=H.className+" ";se+=H.parentNode?H.parentNode.className:"";let ye=J.languageDetectRe.exec(se);if(ye){let $e=V(ye[1]);return $e||(jt(Re.replace("{}",ye[1])),jt("Falling back to no-highlight mode for this block.",H)),$e?ye[1]:"no-highlight"}return se.split(/\s+/).find($e=>pe($e)||V($e))}l(lt,"blockLanguage");function Le(H,se,ye){let $e="",Je="";typeof se=="object"?($e=H,ye=se.ignoreIllegals,Je=se.language):(it("10.7.0","highlight(lang, code, ...args) has been deprecated."),it("10.7.0",`Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277`),Je=H,$e=se),ye===void 0&&(ye=!0);let Ut={code:$e,language:Je};ct("before:highlight",Ut);let ir=Ut.result?Ut.result:Ht(Ut.language,Ut.code,ye);return ir.code=Ut.code,ct("after:highlight",ir),ir}l(Le,"highlight");function Ht(H,se,ye,$e){let Je=Object.create(null);function Ut(re,ie){return re.keywords[ie]}l(Ut,"keywordData");function ir(){if(!he.keywords){mt.addText(Me);return}let re=0;he.keywordPatternRe.lastIndex=0;let ie=he.keywordPatternRe.exec(Me),me="";for(;ie;){me+=Me.substring(re,ie.index);let Pe=Ke.case_insensitive?ie[0].toLowerCase():ie[0],wt=Ut(he,Pe);if(wt){let[kr,bh]=wt;if(mt.addText(me),me="",Je[Pe]=(Je[Pe]||0)+1,Je[Pe]<=mr&&(rn+=bh),kr.startsWith("_"))me+=ie[0];else{let vh=Ke.classNameAliases[kr]||kr;d(ie[0],vh)}}else me+=ie[0];re=he.keywordPatternRe.lastIndex,ie=he.keywordPatternRe.exec(Me)}me+=Me.substring(re),mt.addText(me)}l(ir,"processKeywords");function Wr(){if(Me==="")return;let re=null;if(typeof he.subLanguage=="string"){if(!P[he.subLanguage]){mt.addText(Me);return}re=Ht(he.subLanguage,Me,!0,hi[he.subLanguage]),hi[he.subLanguage]=re._top}else re=xr(Me,he.subLanguage.length?he.subLanguage:null);he.relevance>0&&(rn+=re.relevance),mt.__addSublanguage(re._emitter,re.language)}l(Wr,"processSubLanguage");function y(){he.subLanguage!=null?Wr():ir(),Me=""}l(y,"processBuffer");function d(re,ie){re!==""&&(mt.startScope(ie),mt.addText(re),mt.endScope())}l(d,"emitKeyword");function f(re,ie){let me=1,Pe=ie.length-1;for(;me<=Pe;){if(!re._emit[me]){me++;continue}let wt=Ke.classNameAliases[re[me]]||re[me],kr=ie[me];wt?d(kr,wt):(Me=kr,ir(),Me=""),me++}}l(f,"emitMultiClass");function b(re,ie){return re.scope&&typeof re.scope=="string"&&mt.openNode(Ke.classNameAliases[re.scope]||re.scope),re.beginScope&&(re.beginScope._wrap?(d(Me,Ke.classNameAliases[re.beginScope._wrap]||re.beginScope._wrap),Me=""):re.beginScope._multi&&(f(re.beginScope,ie),Me="")),he=Object.create(re,{parent:{value:he}}),he}l(b,"startNewMode");function v(re,ie,me){let Pe=$(re.endRe,me);if(Pe){if(re["on:end"]){let wt=new t(re);re["on:end"](ie,wt),wt.isMatchIgnored&&(Pe=!1)}if(Pe){for(;re.endsParent&&re.parent;)re=re.parent;return re}}if(re.endsWithParent)return v(re.parent,ie,me)}l(v,"endOfMode");function F(re){return he.matcher.regexIndex===0?(Me+=re[0],1):(So=!0,0)}l(F,"doIgnore");function Z(re){let ie=re[0],me=re.rule,Pe=new t(me),wt=[me.__beforeBegin,me["on:begin"]];for(let kr of wt)if(kr&&(kr(re,Pe),Pe.isMatchIgnored))return F(ie);return me.skip?Me+=ie:(me.excludeBegin&&(Me+=ie),y(),!me.returnBegin&&!me.excludeBegin&&(Me=ie)),b(me,re),me.returnBegin?0:ie.length}l(Z,"doBeginMatch");function Q(re){let ie=re[0],me=se.substring(re.index),Pe=v(he,re,me);if(!Pe)return sr;let wt=he;he.endScope&&he.endScope._wrap?(y(),d(ie,he.endScope._wrap)):he.endScope&&he.endScope._multi?(y(),f(he.endScope,re)):wt.skip?Me+=ie:(wt.returnEnd||wt.excludeEnd||(Me+=ie),y(),wt.excludeEnd&&(Me=ie));do he.scope&&mt.closeNode(),!he.skip&&!he.subLanguage&&(rn+=he.relevance),he=he.parent;while(he!==Pe.parent);return Pe.starts&&b(Pe.starts,re),wt.returnEnd?0:ie.length}l(Q,"doEndMatch");function ee(){let re=[];for(let ie=he;ie!==Ke;ie=ie.parent)ie.scope&&re.unshift(ie.scope);re.forEach(ie=>mt.openNode(ie))}l(ee,"processContinuations");let ne={};function qe(re,ie){let me=ie&&ie[0];if(Me+=re,me==null)return y(),0;if(ne.type==="begin"&&ie.type==="end"&&ne.index===ie.index&&me===""){if(Me+=se.slice(ie.index,ie.index+1),!Ee){let Pe=new Error(`0 width match regex (${H})`);throw Pe.languageName=H,Pe.badRule=ne.rule,Pe}return 1}if(ne=ie,ie.type==="begin")return Z(ie);if(ie.type==="illegal"&&!ye){let Pe=new Error('Illegal lexeme "'+me+'" for mode "'+(he.scope||"")+'"');throw Pe.mode=he,Pe}else if(ie.type==="end"){let Pe=Q(ie);if(Pe!==sr)return Pe}if(ie.type==="illegal"&&me==="")return Me+=` `,1;if(ko>1e5&&ko>ie.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Me+=me,me.length}l(qe,"processLexeme");let Ke=V(H);if(!Ke)throw Ot(Re.replace("{}",H)),new Error('Unknown language: "'+H+'"');let qr=Lt(Ke),_o="",he=$e||qr,hi={},mt=new J.__emitter(J);ee();let Me="",rn=0,Kr=0,ko=0,So=!1;try{if(Ke.__emitTokens)Ke.__emitTokens(se,mt);else{for(he.matcher.considerAll();;){ko++,So?So=!1:he.matcher.considerAll(),he.matcher.lastIndex=Kr;let re=he.matcher.exec(se);if(!re)break;let ie=se.substring(Kr,re.index),me=qe(ie,re);Kr=re.index+me}qe(se.substring(Kr))}return mt.finalize(),_o=mt.toHTML(),{language:H,value:_o,relevance:rn,illegal:!1,_emitter:mt,_top:he}}catch(re){if(re.message&&re.message.includes("Illegal"))return{language:H,value:Bt(se),illegal:!0,relevance:0,_illegalBy:{message:re.message,index:Kr,context:se.slice(Kr-100,Kr+100),mode:re.mode,resultSoFar:_o},_emitter:mt};if(Ee)return{language:H,value:Bt(se),illegal:!1,relevance:0,errorRaised:re,_emitter:mt,_top:he};throw re}}l(Ht,"_highlight");function Ur(H){let se={value:Bt(H),illegal:!1,relevance:0,_top:X,_emitter:new J.__emitter(J)};return se._emitter.addText(H),se}l(Ur,"justTextHighlightResult");function xr(H,se){se=se||J.languages||Object.keys(P);let ye=Ur(H),$e=se.filter(V).filter(He).map(y=>Ht(y,H,!1));$e.unshift(ye);let Je=$e.sort((y,d)=>{if(y.relevance!==d.relevance)return d.relevance-y.relevance;if(y.language&&d.language){if(V(y.language).supersetOf===d.language)return 1;if(V(d.language).supersetOf===y.language)return-1}return 0}),[Ut,ir]=Je,Wr=Ut;return Wr.secondBest=ir,Wr}l(xr,"highlightAuto");function Lr(H,se,ye){let $e=se&&K[se]||ye;H.classList.add("hljs"),H.classList.add(`language-${$e}`)}l(Lr,"updateClassName");function _r(H){let se=null,ye=lt(H);if(pe(ye))return;if(ct("before:highlightElement",{el:H,language:ye}),H.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",H);return}if(H.children.length>0&&(J.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(H)),J.throwUnescapedHTML))throw new or("One of your code blocks includes unescaped HTML.",H.innerHTML);se=H;let $e=se.textContent,Je=ye?Le($e,{language:ye,ignoreIllegals:!0}):xr($e);H.innerHTML=Je.value,H.dataset.highlighted="yes",Lr(H,ye,Je.language),H.result={language:Je.language,re:Je.relevance,relevance:Je.relevance},Je.secondBest&&(H.secondBest={language:Je.secondBest.language,relevance:Je.secondBest.relevance}),ct("after:highlightElement",{el:H,result:Je,text:$e})}l(_r,"highlightElement");function kt(H){J=wr(J,H)}l(kt,"configure");let da=l(()=>{yr(),it("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},"initHighlighting");function Vr(){yr(),it("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}l(Vr,"initHighlightingOnLoad");let Fr=!1;function yr(){function H(){yr()}if(l(H,"boot"),document.readyState==="loading"){Fr||window.addEventListener("DOMContentLoaded",H,!1),Fr=!0;return}document.querySelectorAll(J.cssSelector).forEach(_r)}l(yr,"highlightAll");function ua(H,se){let ye=null;try{ye=se(_)}catch($e){if(Ot("Language definition for '{}' could not be registered.".replace("{}",H)),Ee)Ot($e);else throw $e;ye=X}ye.name||(ye.name=H),P[H]=ye,ye.rawDefinition=se.bind(null,_),ye.aliases&&we(ye.aliases,{languageName:H})}l(ua,"registerLanguage");function I(H){delete P[H];for(let se of Object.keys(K))K[se]===H&&delete K[se]}l(I,"unregisterLanguage");function te(){return Object.keys(P)}l(te,"listLanguages");function V(H){return H=(H||"").toLowerCase(),P[H]||P[K[H]]}l(V,"getLanguage");function we(H,{languageName:se}){typeof H=="string"&&(H=[H]),H.forEach(ye=>{K[ye.toLowerCase()]=se})}l(we,"registerAliases");function He(H){let se=V(H);return se&&!se.disableAutodetect}l(He,"autoDetection");function ze(H){H["before:highlightBlock"]&&!H["before:highlightElement"]&&(H["before:highlightElement"]=se=>{H["before:highlightBlock"](Object.assign({block:se.el},se))}),H["after:highlightBlock"]&&!H["after:highlightElement"]&&(H["after:highlightElement"]=se=>{H["after:highlightBlock"](Object.assign({block:se.el},se))})}l(ze,"upgradePluginAPI");function Mt(H){ze(H),de.push(H)}l(Mt,"addPlugin");function ft(H){let se=de.indexOf(H);se!==-1&&de.splice(se,1)}l(ft,"removePlugin");function ct(H,se){let ye=H;de.forEach(function($e){$e[ye]&&$e[ye](se)})}l(ct,"fire");function at(H){return it("10.7.0","highlightBlock will be removed entirely in v12.0"),it("10.7.0","Please use highlightElement now."),_r(H)}l(at,"deprecateHighlightBlock"),Object.assign(_,{highlight:Le,highlightAuto:xr,highlightAll:yr,highlightElement:_r,highlightBlock:at,configure:kt,initHighlighting:da,initHighlightingOnLoad:Vr,registerLanguage:ua,unregisterLanguage:I,listLanguages:te,getLanguage:V,registerAliases:we,autoDetection:He,inherit:wr,addPlugin:Mt,removePlugin:ft}),_.debugMode=function(){Ee=!1},_.safeMode=function(){Ee=!0},_.versionString=pt,_.regex={concat:w,lookahead:m,either:C,optional:x,anyNumberOfTimes:g};for(let H in Fe)typeof Fe[H]=="object"&&e(Fe[H]);return Object.assign(_,Fe),_},"HLJS"),vt=gr({});return vt.newInstance=()=>gr({}),kp=vt,vt.HighlightJS=vt,vt.default=vt,kp}function Ad(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function zf(e){zo=e}function aa(e,t){if(t){if(Bw.test(e))return e.replace(qT,mv)}else if(Hw.test(e))return e.replace(KT,mv);return e}function Uw(e){return e.replace(YT,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}function Nt(e,t){let r=typeof e=="string"?e:e.source;t=t||"";let a={replace:l((n,o)=>{let s=typeof o=="string"?o:o.source;return s=s.replace(QT,"$1"),r=r.replace(n,s),a},"replace"),getRegex:l(()=>new RegExp(r,t),"getRegex")};return a}function Gp(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}function Yp(e,t){let r=e.replace(/\|/g,(o,s,i)=>{let c=!1,u=s;for(;--u>=0&&i[u]==="\\";)c=!c;return c?"|":" |"}),a=r.split(/ \|/),n=0;if(a[0].trim()||a.shift(),a.length>0&&!a[a.length-1].trim()&&a.pop(),t)if(a.length>t)a.splice(t);else for(;a.length{let o=n.match(/^\s+/);if(o===null)return n;let[s]=o;return s.length>=a.length?n.slice(a.length):n}).join(` `)}function Ft(e,t){return No.parse(e,t)}async function e8(e){let t=Jw[e];if(!t||t.error&&t.retries>=5)return!1;try{let r=await fetch(`https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/languages/${e}.min.js`);if(!r.ok)throw new Error(`Failed to fetch ${e} language: ${r.statusText}`);let a=await r.text();if(await new Function(a)(),!cd.getLanguage(e))throw new Error(`Even after executing grammar script, ${e} language was not registered`);return t.retries=0,t.error=!1,!0}catch{return t.error=!0,t.retries++,!1}}function o8(){if(yv)return Ip;yv=1;var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,n=l((h,m)=>{for(var g in m)e(h,g,{get:m[g],enumerable:!0})},"A"),o=l((h,m,g,x)=>{if(m&&typeof m=="object"||typeof m=="function")for(let w of r(m))!a.call(h,w)&&w!==g&&e(h,w,{get:l(()=>m[w],"get"),enumerable:!(x=t(m,w))||x.enumerable});return h},"d"),s=l(h=>o(e({},"__esModule",{value:!0}),h),"R"),i={};n(i,{Highlight:l(()=>p,"Highlight"),highlightStrategy:l(()=>c,"highlightStrategy")}),Ip=s(i);var c={WHOLE_WORD_MATCH:"wholeWordMatch",PARTIAL_MATCH:"partialMatch",PARTIAL_MATCH_FULL_WORD:"partialMatchFullWord"},u={caseSensitive:!1,strategy:c.PARTIAL_MATCH,HTMLTag:"mark",CSSClass:"orama-highlight"},p=class{static{l(this,"u")}options;_positions=[];_HTML="";_searchTerm="";_originalText="";constructor(h=u){this.options={...u,...h}}highlight(h,m){if(this._searchTerm=m??"",this._originalText=h??"",!this._searchTerm||!this._originalText)return this._positions=[],this._HTML=this._originalText,this;let g=this.options.HTMLTag??u.HTMLTag,x=this.options.CSSClass??u.CSSClass,w=this.options.caseSensitive??u.caseSensitive,k=this.options.strategy??u.strategy,C=w?"g":"gi",A=this.escapeRegExp(w?this._searchTerm:this._searchTerm.toLowerCase()).trim().split(/\s+/).join("|"),$;if(k===c.WHOLE_WORD_MATCH)$=new RegExp(`\\b${A}\\b`,C);else if(k===c.PARTIAL_MATCH)$=new RegExp(A,C);else if(k===c.PARTIAL_MATCH_FULL_WORD)$=new RegExp(`\\b[^\\s]*(${A})[^\\s]*\\b`,C);else throw new Error("Invalid highlighter strategy");let L=[],M=[],O,R=0,B=-1;for(;(O=$.exec(this._originalText))!==null&&$.lastIndex!==B;){B=$.lastIndex;let G=O.index,j=G+O[0].length-1;L.push({start:G,end:j}),M.push(this._originalText.slice(R,G)),M.push(`<${g} class="${x}">${O[0]}`),R=j+1}return M.push(this._originalText.slice(R)),this._positions=L,this._HTML=M.join(""),this}trim(h,m=!0){if(this._positions.length===0)return`${this._HTML.substring(0,h)}${m?"...":""}`;if(this._originalText.length<=h)return this._HTML;let g=this._positions[0].start,x=Math.max(g-Math.floor(h/2),0),w=Math.min(x+h,this._originalText.length),k=`${x===0||!m?"":"..."}${this._originalText.slice(x,w)}${w{E();Ed();Ss();_C=Object.create,vv=Object.defineProperty,kC=Object.getOwnPropertyDescriptor,SC=Object.getOwnPropertyNames,IC=Object.getPrototypeOf,CC=Object.prototype.hasOwnProperty,Do=l((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),"A$1"),AC=l((e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of SC(t))!CC.call(e,n)&&n!==r&&vv(e,n,{get:l(()=>t[n],"get"),enumerable:!(a=kC(t,n))||a.enumerable});return e},"Dt"),af=l((e,t,r)=>(r=e!=null?_C(IC(e)):{},AC(vv(r,"default",{value:e,enumerable:!0}),e)),"Y$1"),wv=Do(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isBytes=a,e.number=t,e.bool=r,e.bytes=n,e.hash=o,e.exists=s,e.output=i;function t(u){if(!Number.isSafeInteger(u)||u<0)throw new Error(`positive integer expected, not ${u}`)}l(t,"R");function r(u){if(typeof u!="boolean")throw new Error(`boolean expected, not ${u}`)}l(r,"me");function a(u){return u instanceof Uint8Array||u!=null&&typeof u=="object"&&u.constructor.name==="Uint8Array"}l(a,"ge");function n(u,...p){if(!a(u))throw new Error("Uint8Array expected");if(p.length>0&&!p.includes(u.length))throw new Error(`Uint8Array expected of length ${p}, not of length=${u.length}`)}l(n,"X");function o(u){if(typeof u!="function"||typeof u.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");t(u.outputLen),t(u.blockLen)}l(o,"ye");function s(u,p=!0){if(u.destroyed)throw new Error("Hash instance has been destroyed");if(p&&u.finished)throw new Error("Hash#digest() has already been called")}l(s,"Se");function i(u,p){n(u);let h=p.outputLen;if(u.length{Object.defineProperty(e,"__esModule",{value:!0}),e.add5L=e.add5H=e.add4H=e.add4L=e.add3H=e.add3L=e.rotlBL=e.rotlBH=e.rotlSL=e.rotlSH=e.rotr32L=e.rotr32H=e.rotrBL=e.rotrBH=e.rotrSL=e.rotrSH=e.shrSL=e.shrSH=e.toBig=void 0,e.fromBig=a,e.split=n,e.add=A;var t=BigInt(2**32-1),r=BigInt(32);function a(j,N=!1){return N?{h:Number(j&t),l:Number(j>>r&t)}:{h:Number(j>>r&t)|0,l:Number(j&t)|0}}l(a,"ee");function n(j,N=!1){let T=new Uint32Array(j.length),U=new Uint32Array(j.length);for(let ae=0;aeBigInt(j>>>0)<>>0),"Te");e.toBig=o;var s=l((j,N,T)=>j>>>T,"we");e.shrSH=s;var i=l((j,N,T)=>j<<32-T|N>>>T,"xe");e.shrSL=i;var c=l((j,N,T)=>j>>>T|N<<32-T,"Ae");e.rotrSH=c;var u=l((j,N,T)=>j<<32-T|N>>>T,"Oe");e.rotrSL=u;var p=l((j,N,T)=>j<<64-T|N>>>T-32,"Ee");e.rotrBH=p;var h=l((j,N,T)=>j>>>T-32|N<<64-T,"Pe");e.rotrBL=h;var m=l((j,N)=>N,"ve");e.rotr32H=m;var g=l((j,N)=>j,"Ce");e.rotr32L=g;var x=l((j,N,T)=>j<>>32-T,"_e");e.rotlSH=x;var w=l((j,N,T)=>N<>>32-T,"Ne");e.rotlSL=w;var k=l((j,N,T)=>N<>>64-T,"De");e.rotlBH=k;var C=l((j,N,T)=>j<>>64-T,"ke");e.rotlBL=C;function A(j,N,T,U){let ae=(N>>>0)+(U>>>0);return{h:j+T+(ae/2**32|0)|0,l:ae|0}}l(A,"Le");var $=l((j,N,T)=>(j>>>0)+(N>>>0)+(T>>>0),"Re");e.add3L=$;var L=l((j,N,T,U)=>N+T+U+(j/2**32|0)|0,"Me");e.add3H=L;var M=l((j,N,T,U)=>(j>>>0)+(N>>>0)+(T>>>0)+(U>>>0),"Be");e.add4L=M;var O=l((j,N,T,U,ae)=>N+T+U+ae+(j/2**32|0)|0,"Ue");e.add4H=O;var R=l((j,N,T,U,ae)=>(j>>>0)+(N>>>0)+(T>>>0)+(U>>>0)+(ae>>>0),"ze");e.add5L=R;var B=l((j,N,T,U,ae,oe)=>N+T+U+ae+oe+(j/2**32|0)|0,"He");e.add5H=B;var G={fromBig:a,split:n,toBig:o,shrSH:s,shrSL:i,rotrSH:c,rotrSL:u,rotrBH:p,rotrBL:h,rotr32H:m,rotr32L:g,rotlSH:x,rotlSL:w,rotlBH:k,rotlBL:C,add:A,add3L:$,add3H:L,add4L:M,add4H:O,add5H:B,add5L:R};e.default=G}),EC=Do(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=void 0,e.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0}),$C=Do(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.nextTick=e.byteSwapIfBE=e.byteSwap=e.isLE=e.rotl=e.rotr=e.createView=e.u32=e.u8=void 0,e.isBytes=a,e.byteSwap32=p,e.bytesToHex=m,e.hexToBytes=w,e.asyncLoop=C,e.utf8ToBytes=A,e.toBytes=$,e.concatBytes=L,e.checkOpts=R,e.wrapConstructor=B,e.wrapConstructorWithOpts=G,e.wrapXOFConstructorWithOpts=j,e.randomBytes=N;var t=EC(),r=wv();function a(T){return T instanceof Uint8Array||T!=null&&typeof T=="object"&&T.constructor.name==="Uint8Array"}l(a,"Rt");var n=l(T=>new Uint8Array(T.buffer,T.byteOffset,T.byteLength),"Mt");e.u8=n;var o=l(T=>new Uint32Array(T.buffer,T.byteOffset,Math.floor(T.byteLength/4)),"Bt");e.u32=o;var s=l(T=>new DataView(T.buffer,T.byteOffset,T.byteLength),"Ut");e.createView=s;var i=l((T,U)=>T<<32-U|T>>>U,"zt");e.rotr=i;var c=l((T,U)=>T<>>32-U>>>0,"Ht");e.rotl=c,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;var u=l(T=>T<<24&4278190080|T<<8&16711680|T>>>8&65280|T>>>24&255,"Ft");e.byteSwap=u,e.byteSwapIfBE=e.isLE?T=>T:T=>(0,e.byteSwap)(T);function p(T){for(let U=0;UU.toString(16).padStart(2,"0"));function m(T){(0,r.bytes)(T);let U="";for(let ae=0;ae=g._0&&T<=g._9)return T-g._0;if(T>=g._A&&T<=g._F)return T-(g._A-10);if(T>=g._a&&T<=g._f)return T-(g._a-10)}l(x,"Ve");function w(T){if(typeof T!="string")throw new Error("hex string expected, got "+typeof T);let U=T.length,ae=U/2;if(U%2)throw new Error("padded hex string expected, got unpadded hex of length "+U);let oe=new Uint8Array(ae);for(let ue=0,ge=0;ue{},"Jt");e.nextTick=k;async function C(T,U,ae){let oe=Date.now();for(let ue=0;ue=0&&geT().update($(oe)).digest(),"e"),ae=T();return U.outputLen=ae.outputLen,U.blockLen=ae.blockLen,U.create=()=>T(),U}l(B,"Xt");function G(T){let U=l((oe,ue)=>T(ue).update($(oe)).digest(),"e"),ae=T({});return U.outputLen=ae.outputLen,U.blockLen=ae.blockLen,U.create=oe=>T(oe),U}l(G,"Qt");function j(T){let U=l((oe,ue)=>T(ue).update($(oe)).digest(),"e"),ae=T({});return U.outputLen=ae.outputLen,U.blockLen=ae.blockLen,U.create=oe=>T(oe),U}l(j,"Zt");function N(T=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(T));if(t.crypto&&typeof t.crypto.randomBytes=="function")return t.crypto.randomBytes(T);throw new Error("crypto.getRandomValues must be defined")}l(N,"en")}),PC=Do(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shake256=e.shake128=e.keccak_512=e.keccak_384=e.keccak_256=e.keccak_224=e.sha3_512=e.sha3_384=e.sha3_256=e.sha3_224=e.Keccak=void 0,e.keccakP=C;var t=wv(),r=TC(),a=$C(),n=[],o=[],s=[],i=BigInt(0),c=BigInt(1),u=BigInt(2),p=BigInt(7),h=BigInt(256),m=BigInt(113);for(let M=0,O=c,R=1,B=0;M<24;M++){[R,B]=[B,(2*R+3*B)%5],n.push(2*(5*B+R)),o.push((M+1)*(M+2)/2%64);let G=i;for(let j=0;j<7;j++)O=(O<>p)*m)%h,O&u&&(G^=c<<(c<R>32?(0,r.rotlBH)(M,O,R):(0,r.rotlSH)(M,O,R),"Je"),k=l((M,O,R)=>R>32?(0,r.rotlBL)(M,O,R):(0,r.rotlSL)(M,O,R),"Ke");function C(M,O=24){let R=new Uint32Array(10);for(let B=24-O;B<24;B++){for(let N=0;N<10;N++)R[N]=M[N]^M[N+10]^M[N+20]^M[N+30]^M[N+40];for(let N=0;N<10;N+=2){let T=(N+8)%10,U=(N+2)%10,ae=R[U],oe=R[U+1],ue=w(ae,oe,1)^R[T],ge=k(ae,oe,1)^R[T+1];for(let fe=0;fe<50;fe+=10)M[N+fe]^=ue,M[N+fe+1]^=ge}let G=M[2],j=M[3];for(let N=0;N<24;N++){let T=o[N],U=w(G,j,T),ae=k(G,j,T),oe=n[N];G=M[oe],j=M[oe+1],M[oe]=U,M[oe+1]=ae}for(let N=0;N<50;N+=10){for(let T=0;T<10;T++)R[T]=M[N+T];for(let T=0;T<10;T++)M[N+T]^=~R[(T+2)%10]&R[(T+4)%10]}M[0]^=g[B],M[1]^=x[B]}R.fill(0)}l(C,"Xe");var A=class xv extends a.Hash{static{l(this,"t")}constructor(O,R,B,G=!1,j=24){if(super(),this.blockLen=O,this.suffix=R,this.outputLen=B,this.enableXOF=G,this.rounds=j,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,t.number)(B),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,a.u32)(this.state)}keccak(){a.isLE||(0,a.byteSwap32)(this.state32),C(this.state32,this.rounds),a.isLE||(0,a.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(O){(0,t.exists)(this);let{blockLen:R,state:B}=this;O=(0,a.toBytes)(O);let G=O.length;for(let j=0;j=B&&this.keccak();let N=Math.min(B-this.posOut,j-G);O.set(R.subarray(this.posOut,this.posOut+N),G),this.posOut+=N,G+=N}return O}xofInto(O){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(O)}xof(O){return(0,t.number)(O),this.xofInto(new Uint8Array(O))}digestInto(O){if((0,t.output)(O,this),this.finished)throw new Error("digest() was already called");return this.writeInto(O),this.destroy(),O}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(O){let{blockLen:R,suffix:B,outputLen:G,rounds:j,enableXOF:N}=this;return O||(O=new xv(R,B,G,N,j)),O.state32.set(this.state32),O.pos=this.pos,O.posOut=this.posOut,O.finished=this.finished,O.rounds=j,O.suffix=B,O.outputLen=G,O.enableXOF=N,O.destroyed=this.destroyed,O}};e.Keccak=A;var $=l((M,O,R)=>(0,a.wrapConstructor)(()=>new A(O,M,R)),"T");e.sha3_224=$(6,144,224/8),e.sha3_256=$(6,136,256/8),e.sha3_384=$(6,104,384/8),e.sha3_512=$(6,72,512/8),e.keccak_224=$(1,144,224/8),e.keccak_256=$(1,136,256/8),e.keccak_384=$(1,104,384/8),e.keccak_512=$(1,72,512/8);var L=l((M,O,R)=>(0,a.wrapXOFConstructorWithOpts)((B={})=>new A(O,M,B.dkLen===void 0?R:B.dkLen,!0)),"Qe");e.shake128=L(31,168,128/8),e.shake256=L(31,136,256/8)}),OC=Do((e,t)=>{var{sha3_512:r}=PC(),a=24,n=32,o=l((k=4,C=Math.random)=>{let A="";for(;A.lengths(r(k)).toString(36).slice(1),"rt"),c=Array.from({length:26},(k,C)=>String.fromCharCode(C+97)),u=l(k=>c[Math.floor(k()*c.length)],"un"),p=l(({globalObj:k=typeof global<"u"?global:typeof window<"u"?window:{},random:C=Math.random}={})=>{let A=Object.keys(k).toString(),$=A.length?A+o(n,C):o(n,C);return i($).substring(0,n)},"st"),h=l(k=>()=>k++,"ot"),m=476782367,g=l(({random:k=Math.random,counter:C=h(Math.floor(k()*m)),length:A=a,fingerprint:$=p({random:k})}={})=>function(){let L=u(k),M=Date.now().toString(36),O=C().toString(36),R=o(A,k),B=`${M+R+O+$}`;return`${L+i(B).substring(1,A)}`},"it"),x=g(),w=l((k,{minLength:C=2,maxLength:A=n}={})=>{let $=k.length,L=/^[a-z][0-9a-z]+$/;try{if(typeof k=="string"&&$>=C&&$<=A&&L.test(k))return!0}finally{}return!1},"fn");t.exports.getConstants=()=>({defaultLength:a,bigLength:n}),t.exports.init=g,t.exports.createId=x,t.exports.bufToBigInt=s,t.exports.createCounter=h,t.exports.createFingerprint=p,t.exports.isCuid=w}),nf=Do((e,t)=>{var{createId:r,init:a,getConstants:n,isCuid:o}=OC();t.exports.createId=r,t.exports.init=a,t.exports.getConstants=n,t.exports.isCuid=o}),RC=af(nf()),LC={arabic:"ar",armenian:"am",bulgarian:"bg",danish:"dk",dutch:"nl",english:"en",finnish:"fi",french:"fr",german:"de",greek:"gr",hungarian:"hu",indian:"in",indonesian:"id",irish:"ie",italian:"it",lithuanian:"lt",nepali:"np",norwegian:"no",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"rs",slovenian:"ru",spanish:"es",swedish:"se",tamil:"ta",turkish:"tr",ukrainian:"uk",sanskrit:"sk"},MC=Object.keys(LC);Date.now().toString().slice(5);lb=BigInt(1e3),cb=BigInt(1e6),db=BigInt(1e9);l(_v,"dt");MC.join(` - `);l(Cp,"oe");kv="2.1.4",NC={version:kv},ub=af(nf()),DC="https://answer.api.orama.com",zC="/v1/indexes",hb="orama_user_id";l(Sv,"bt");l(Ap,"ae");ZC=class{static{l(this,"H")}messages;inferenceType;oramaClient;endpoint;abortController;events;userContext;conversationID;lastInteractionParams;state=[];systemPrompts;constructor(e){let t=e.oramaClient.answersApiBaseURL||DC;this.messages=e.initialMessages||[],this.inferenceType=e.inferenceType,this.oramaClient=e.oramaClient,this.endpoint=`${t}/v1/answer?api-key=${this.oramaClient.api_key}`,this.events=e.events,this.conversationID=(0,ub.createId)(),this.userContext=e.userContext}async askStream(e){return this.messages.push({role:"user",content:e.term??""}),this.fetchAnswer(e)}async ask(e){let t=await this.askStream(e),r="";for await(let a of t)r=a;return this.events?.onMessageChange&&this.events.onMessageChange(this.messages),r}getMessages(){return this.messages}clearSession(){this.messages=[],this.state=[],this.events?.onMessageChange&&this.events.onMessageChange(this.messages),this.events?.onStateChange&&this.events.onStateChange(this.state)}abortAnswer(){if(!this.abortController)throw new Error("AbortController is not ready");this.abortController.abort(),this.abortController=void 0,this.state[this.state.length-1].aborted=!0}async regenerateLast({stream:e=!0}={}){if(this.state.length===0||this.messages.length===0)throw new Error("No messages to regenerate");if(this.messages.at(-1)?.role!=="assistant")throw new Error("Last message is not an assistant message");return this.messages.pop(),this.state.pop(),e?this.askStream(this.lastInteractionParams):this.ask(this.lastInteractionParams)}addNewEmptyAssistantMessage(){this.messages.push({role:"assistant",content:""})}async*fetchAnswer(e){this.abortController=new AbortController,this.lastInteractionParams=e;let t=(0,ub.createId)(),r=null,a=this.state.length;this.state.push({interactionId:t,query:e.term??"",response:"",relatedQueries:null,sources:null,translatedQuery:null,segment:null,trigger:null,aborted:!1,loading:!0,error:!1,errorMessage:null});try{this.events?.onNewInteractionStarted&&this.events.onNewInteractionStarted(t),this.events?.onStateChange&&this.events.onStateChange(this.state);let n=new URLSearchParams;n.append("type",this.inferenceType),n.append("messages",JSON.stringify(this.messages)),n.append("query",e.term??""),n.append("conversationId",this.conversationID),n.append("userId",this.oramaClient.getUserId()),n.append("endpoint",this.oramaClient.endpoint),n.append("searchParams",JSON.stringify(e)),n.append("identity",this.oramaClient.getIdentity()??""),n.append("interactionId",t),n.append("alias",this.oramaClient.getAlias()??"");let o=this.getSystemPromptConfiguration();if(o&&n.append("systemPrompts",JSON.stringify(o)),this.userContext&&n.append("userContext",Ap(this.userContext)),e.userData&&n.append("userData",Ap(e.userData)),e.related){if(e.related?.howMany&&e.related?.howMany>5)throw new Error("Can generate at most 5 related queries");n.append("related",JSON.stringify({enabled:!0,howMany:e.related.howMany??3,format:e.related.format??"question"}))}let s=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString(),signal:this.abortController.signal});if(!s.ok||!s.body)throw new Error(s.statusText);r=s.body.getReader();let i=new TextDecoder,c=[],u="";this.events?.onMessageLoading&&this.events.onMessageLoading(!0),this.addNewEmptyAssistantMessage();let p=this.messages.at(-1);for(;;){let{value:h,done:m}=await r.read();if(m)break;u+=i.decode(h,{stream:!0});let g;for(;(g=u.indexOf(` `))!==-1;){let x=u.slice(0,g);u=u.slice(g+2);try{let w=Sv(x),k=JSON.parse(w.data);if(k.type==="sources")this.state[a].sources=k.message,this.events?.onSourceChange&&this.events.onSourceChange(k.message),this.events?.onStateChange&&this.events.onStateChange(this.state);else if(k.type==="query-translated")this.state[a].translatedQuery=k.message,this.events?.onQueryTranslated&&this.events.onQueryTranslated(k.message),this.events?.onStateChange&&this.events.onStateChange(this.state);else if(k.type==="conversation-metadata"){let{segment:C,trigger:A}=k.message;C&&(this.state[a].segment=C),A&&(this.state[a].trigger=A),this.events?.onStateChange&&this.events.onStateChange(this.state)}else if(k.type==="related-queries")this.state[a].relatedQueries=k.message,this.events?.onRelatedQueries&&this.events.onRelatedQueries(k.message),this.events?.onStateChange&&this.events.onStateChange(this.state);else if(k.type==="text")for(c.push(k.message);c.length>0;)p.content+=c.shift(),this.state[a].response=p.content,this.events?.onStateChange&&this.events.onStateChange(this.state),this.events?.onMessageChange&&this.events.onMessageChange(this.messages),yield p.content}catch(w){console.error("Error parsing SSE event:",w),console.error("Raw message:",x)}}}}catch(n){if(n.name==="AbortError")this.state[a].aborted=!0,this.events?.onAnswerAborted&&this.events.onAnswerAborted(!0);else throw this.state[a].error=!0,this.state[a].errorMessage=n.message??"Unknown error",n}finally{r?.releaseLock(),this.state[a].loading=!1,this.events?.onStateChange&&this.events.onStateChange(this.state),this.events?.onInteractionDone&&this.events.onInteractionDone(this.state[a]),this.events?.onMessageLoading&&this.events.onMessageLoading(!1)}}setSystemPromptConfiguration(e){if(Array.isArray(e.systemPrompts)){if(!e.systemPrompts.every(t=>typeof t=="string"))throw new Error("Invalid system prompt configuration");this.systemPrompts=e.systemPrompts}return this}getSystemPromptConfiguration(){return this.systemPrompts}},jC=class{static{l(this,"F")}cache;config;constructor(e){this.cache=new Map,this.config=e}set(e,t){this.cache.set(e,t)}get(e){return this.cache.get(e)}has(e){return this.cache.has(e)}delete(e){return this.cache.delete(e)}clear(){this.cache.clear()}size(){return this.cache.size}};l(pd,"O$3");BC=class Iv{static{l(this,"t")}data;params;config;profile;constructor(t,r){this.data=[],this.config=t,this.profile=r}setParams(t){this.params=t}static create(t,r){let a=new Iv(t,r);return a.start(),a}add(t){this.data.push({rawSearchString:t.rawSearchString,query:t.query,resultsCount:t.resultsCount,roundTripTime:t.roundTripTime,searchedAt:t.searchedAt,userId:this.profile.getUserId(),identity:this.profile.getIdentity(),alias:this.profile.getAlias(),referer:typeof location<"u"?location.toString():void 0}),this.params!=null&&this.data.length>=this.config.flushSize&&this.flush()}flush(){if(this.params==null||this.data.length===0)return;let t=this.data;this.data=[];let r={source:"fe",deploymentID:this.params.deploymentID,index:this.params.index,oramaId:this.config.id,oramaVersion:NC.version,userAgent:typeof navigator<"u"?navigator.userAgent:void 0,events:t};pd(`${this.params.endpoint}?api-key=${this.config.api_key}`,JSON.stringify(r))?.catch(a=>console.log(a))}start(){let t=setInterval(this.flush.bind(this),this.config.flushInterval);t.unref!=null&&t.unref()}},HC=class{static{l(this,"V")}constructor(e){this.params=e}intervalId;start(){this.stop(),this.intervalId=setInterval(this.beat.bind(this),this.params.frequency)}stop(){this.intervalId!==void 0&&clearInterval(this.intervalId)}beat(){pd(this.params.endpoint)?.catch(e=>console.log(e))}},hp=af(nf()),UC=class{static{l(this,"j")}endpoint;apiKey;userId;identity;userAlias;params;constructor({endpoint:e,apiKey:t}){if(!e||!t)throw new Error("Endpoint and API Key are required to create a Profile");if(typeof e!="string"||typeof t!="string")throw new Error("Endpoint and API Key must be strings");if(typeof localStorage<"u"){let r=localStorage.getItem(hb);r?this.userId=r:(this.userId=(0,hp.createId)(),localStorage.setItem(hb,this.userId))}else this.userId=(0,hp.createId)();this.endpoint=e,this.apiKey=t}setParams(e){let{protocol:t,host:r}=new URL(e.identifyUrl),a=`${t}//${r}/identify`;this.params={identifyUrl:a,index:e.index}}getIdentity(){return this.identity}getUserId(){return this.userId}getAlias(){return this.userAlias}async sendProfileData(e){if(!this.params)throw new Error("Orama Profile is not initialized");let t=JSON.stringify({...e,visitorId:this.getUserId(),index:this.params.index});await pd(`${this.params?.identifyUrl}?api-key=${this.apiKey}`,t)}async identify(e,t){if(typeof t!="string")throw new Error("Identity must be a string");await e,await this.sendProfileData({entity:"identity",id:t}),this.identity=t}async alias(e,t){if(typeof t!="string")throw new Error("Identity must be a string");await e,await this.sendProfileData({entity:"alias",id:t}),this.userAlias=t}reset(){this.userId=(0,hp.createId)(),this.identity=void 0,this.userAlias=void 0}};l(Cv,"vn");pb=class{static{l(this,"It")}id=(0,RC.createId)();api_key;endpoint;multiIndexSearch;mergeResults;multiIndexIndexes;answersApiBaseURL;collector;cache;profile;searchDebounceTimer;searchRequestCounter=0;blockSearchTillAuth=!1;heartbeat;initPromise;constructor(e){if("indexes"in e){this.api_key=e.indexes[0].api_key,this.multiIndexIndexes=e.indexes;let t=new URL(e.indexes[0].endpoint).origin;if(e.indexes.some(r=>new URL(r.endpoint).origin!==t))throw new Error("All indexes must have the same endpoint origin");this.endpoint=t+zC,this.multiIndexSearch=!0,this.mergeResults=e.mergeResults??!0}else this.api_key=e.api_key,this.endpoint=e.endpoint,this.multiIndexSearch=!1,this.mergeResults=!0;if(this.answersApiBaseURL=e.answersApiBaseURL,this.profile=new UC({endpoint:this.endpoint,apiKey:this.api_key}),e.telemetry!==!1){let t={id:this.id,api_key:this.api_key,flushInterval:e.telemetry?.flushInterval??5e3,flushSize:e.telemetry?.flushSize??25};this.collector=BC.create(t,this.profile)}if(e.cache!==!1){let t={};this.cache=new jC(t)}this.init()}customerUserToken=void 0;searchToken=void 0;setAuthToken(e){e===null?(this.customerUserToken=void 0,this.searchToken=void 0):(this.customerUserToken=e,this.searchToken=void 0),this.init()}onAuthTokenExpired;setOnAuthTokenExpired(e){this.onAuthTokenExpired=e}addSearchResultsToCollector(e,t,r,a){if(this.collector)if(Array.isArray(e))for(let n of e)this.collector.add({rawSearchString:r.term,resultsCount:n.hits?.length??0,roundTripTime:t,query:r,cached:a,searchedAt:new Date,userId:this.profile.getUserId()});else this.collector.add({rawSearchString:r.term,resultsCount:e?.hits?.length??0,roundTripTime:t,query:r,cached:a,searchedAt:new Date,userId:this.profile.getUserId()})}async search(e,t){if(await this.initPromise,this.blockSearchTillAuth)return console.warn("Search request blocked until user is authenticated"),null;let r=++this.searchRequestCounter,a=`search-${JSON.stringify(e)}`,n=null,o,s=!1,i=t?.fresh!==!0&&this.cache?.has(a),c=l(async()=>{try{let u=Date.now();this.multiIndexSearch?n=await this.fetch("multi_search","POST",{q:{...e,mergeResults:this.mergeResults},sst:this.searchToken,indexes:this.multiIndexIndexes},t?.abortController):n=await this.fetch("search","POST",{q:e,sst:this.searchToken},t?.abortController);let p=Date.now();o=p-u;let h=await Cp(BigInt(p*1e6-u*1e6));if(!Array.isArray(n))n.elapsed=h;else for(let m of n)m.elapsed=h;this.cache?.set(a,n)}catch(u){if(u.name!=="AbortError")throw console.error("Search request failed",u),u}return this.addSearchResultsToCollector(n,o,e,s),n},"h");if(i&&this.cache)o=0,n=this.cache.get(a),s=!0,this.addSearchResultsToCollector(n,o,e,s);else return t?.debounce?new Promise((u,p)=>{clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=setTimeout(async()=>{try{await c(),u(n)}catch(h){h.name!=="AbortError"&&(console.error("Search request failed",h),p(h))}},t?.debounce||300),"unref"in this.searchDebounceTimer&&this.searchDebounceTimer.unref()}):c();return r===this.searchRequestCounter?n:null}async vectorSearch(e,t){await this.initPromise;let r=`vectorSearch-${JSON.stringify(e)}`,a,n,o=!1;if((t?.fresh!==!0&&this.cache?.has(r))===!0&&this.cache!=null)a=0,n=this.cache.get(r),o=!0;else{let s=Date.now();n=await this.fetch("vector-search2","POST",{q:e},t?.abortSignal??t?.abortController);let i=Date.now();n.elapsed=await Cp(BigInt(i*1e6-s*1e6)),a=i-s,this.cache?.set(r,n)}return this.collector!=null&&this.collector.add({rawSearchString:e.term,resultsCount:n.hits?.length??0,roundTripTime:a,query:e,cached:o,searchedAt:new Date,userId:this.profile.getUserId()}),n}createAnswerSession(e){return new ZC({inferenceType:e?.inferenceType||"documentation",initialMessages:e?.initialMessages||[],oramaClient:this,events:e?.events,userContext:e?.userContext,systemPrompts:e?.systemPrompts??[]})}startHeartBeat(e){this.heartbeat?.stop(),this.heartbeat=new HC({...e,endpoint:`${this.endpoint}/health?api-key=${this.api_key}`}),this.heartbeat.start()}stopHeartBeat(){this.heartbeat?.stop()}async getPop(){return(await this.initPromise)?.pop??""}expirationTimer;init(){let e=["init","GET",void 0,void 0,{token:this.customerUserToken}];this.multiIndexSearch&&(e=["init_multi_search","POST",{indexes:this.multiIndexIndexes},void 0,{token:this.customerUserToken}]),this.initPromise=this.fetch(...e).then(t=>{if(this.collector?.setParams({endpoint:t.collectUrl,deploymentID:t.deploymentID,index:t.index}),this.profile?.setParams({identifyUrl:t.collectUrl,index:t.index}),t.searchSession){if("required"in t.searchSession&&t.searchSession.required===!0)this.blockSearchTillAuth=!0;else if("token"in t.searchSession){let r=t.searchSession.token;this.searchToken=r;let a=t.searchSession.maxAge;this.blockSearchTillAuth=!1,this.expirationTimer&&clearTimeout(this.expirationTimer),this.expirationTimer=setTimeout(()=>{this.searchToken===r&&(this.searchToken=void 0,this.blockSearchTillAuth=!0,this.onAuthTokenExpired?.(r))},a*1e3),"unref"in this.expirationTimer&&this.expirationTimer.unref()}}return t}).catch(t=>(console.log(t),null))}async fetch(e,t,r,a,n){let o=Cv(a)?a?.signal:a;if(o?.aborted===!0)throw new Error("Request aborted");let s={method:t,headers:{"Content-Type":"application/x-www-form-urlencoded"},signal:o};if(t==="POST"&&r!==void 0){let u=r;u.version=kv,u.id=this.id,u.visitorId=this.profile.getUserId(),s.body=Object.entries(u).filter(([p,h])=>!!h).map(([p,h])=>`${p}=${encodeURIComponent(JSON.stringify(h))}`).join("&")}let i=new URL(`${this.endpoint}/${e}`);if(this.multiIndexSearch||i.searchParams.append("api-key",this.api_key),n)for(let[u,p]of Object.entries(n))p&&i.searchParams.append(u,p);let c=await fetch(i,s);if(!c.ok){let u=new Error;throw u.httpResponse=c,u}return await c.json()}getIdentity(){return this.profile.getIdentity()}getUserId(){return this.profile.getUserId()}getAlias(){return this.profile.getAlias()}async identify(e){if(this.initPromise===void 0)throw new Error("OramaClient not initialized");await this.profile.identify(this.initPromise,e)}async alias(e){if(this.initPromise===void 0)throw new Error("OramaClient not initialized");await this.profile.alias(this.initPromise,e)}reset(){this.profile.reset()}};l(Av,"arrowKeysNavigation");l(Tv,"copyToClipboard");l(Gi,"getNonExplicitAttributes");l(of,"validateCloudIndexConfig");l(sf,"initOramaClient");l(fd,"generateRandomID");l(md,"updateThemeClasses");l(gd,"updateCssVariables");VC='.button.sc-orama-button{align-items:center;border:0;border-radius:.75rem;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)));cursor:pointer;display:flex;font-family:font("primary");font-family:var(--font-primary,font("primary"));gap:.5rem;gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));position:relative;text-align:left;transition:all .2s;transition-property:color,background-color,opacity;width:100%}.button__tooltip.sc-orama-button{animation:fadeInOut 1s ease-in-out 1;background-color:#151515;background-color:var(--text-color-primary,#151515);border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)));color:#fbfbfb;color:var(--background-color-primary,#fbfbfb);display:block;font-size:10px;opacity:0;padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));position:absolute;top:-28px;z-index:1}.button--small.sc-orama-button{padding:.25rem;padding:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)))}.button--medium.sc-orama-button{padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}.button--large.sc-orama-button{padding:.75rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}.button__label.sc-orama-button{align-items:center;display:flex;flex-grow:1;gap:.25rem;gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)))}.button--primary.sc-orama-button{background-color:#432d77;background-color:var(--button-background-color-primary,#432d77);color:#fbfbfb;color:var(--button-text-color-primary,#fbfbfb)}.button--primary.sc-orama-button:disabled{background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6);color:var(--text-color-tertiary)}.button--secondary.sc-orama-button{background-color:#fff;background-color:var(--button-background-color-secondary,#fff);border:1px solid #dadada;border:1px solid var(--button-border-color-secondary,#dadada);color:#838289;color:var(--button-text-color-secondary,#838289);transition:all .3s}@media (hover:hover){.button--secondary.sc-orama-button:hover{background-color:#eee9f6;background-color:var(--button-background-color-secondary-hover,#eee9f6)}}.button--secondary.sc-orama-button:focus-visible{border:1px solid #9671b0;outline:none}.button--secondary.sc-orama-button:disabled{background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6);color:var(--text-color-tertiary)}.button--icon.sc-orama-button{align-items:center;background-color:transparent;border-radius:50%;color:#99989d;color:var(--icon-color-tertiary,#99989d);font-family:font("primary");font-family:var(--font-primary,font("primary"));height:-moz-fit-content;height:fit-content;justify-content:center;padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));width:-moz-fit-content;width:fit-content}.button--icon.sc-orama-button:disabled{opacity:.6}.button--icon.sc-orama-button:disabled,.button--icon.sc-orama-button:hover{background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6)}.sc-orama-button-s>*{align-items:center;display:inline-flex}.sc-orama-button-s>[slot=adorment-end],.sc-orama-button-s>[slot=adorment-start]{flex-grow:0}@keyframes fadeInOut{0%{opacity:0}50%{opacity:1}to{opacity:0}}',Ev=class{static{l(this,"OramaButton")}constructor(e){zt(this,e),this.as="button",this.variant="primary",this.size="medium"}render(){let e=this.as,t=["as","class","variant"],r=Gi(this.el,t),a=`button button--${this.variant} button--${this.size} ${this.class||""}`;return D(e,Object.assign({key:"af470570a767787e5e85ec5c0ecc4cfb66e5b142",class:a},r,{disabled:this.disabled}),D("span",{key:"483fb6a261decf60053ec78726912e11ae271e74",class:"button__label"},D("slot",{key:"3d00cc8a7fe04471095f87b9989eebf38c79764a",name:"adorment-start"}),this.withTooltip&&D("span",{key:"bdda78c3dc2e39b53254a5506dcfb53bffdb9ed3",class:"button__tooltip"},this.withTooltip),D("slot",{key:"6582b9e1c0481f18ac91844b0f09ff09b9fa1fbf"})),D("slot",{key:"31d3bcf229c837809ccf3ba74986a179fe028c87",name:"adorment-end"}))}get el(){return Sr(this)}};Ev.style=VC;(function(e){e.idle="idle",e.loading="loading",e.rendering="rendering",e.streaming="streaming",e.error="error",e.aborted="aborted",e.done="done"})(zr||(zr={}));Qc=globalThis,lf=Qc.ShadowRoot&&(Qc.ShadyCSS===void 0||Qc.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,cf=Symbol(),fb=new WeakMap,$v=class{static{l(this,"l")}constructor(e,t,r){if(this._$cssResult$=!0,r!==cf)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(lf&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=fb.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&fb.set(t,e))}return e}toString(){return this.cssText}},FC=l(e=>new $v(typeof e=="string"?e:e+"",void 0,cf),"h$2"),Cr=l((e,...t)=>{let r=e.length===1?e[0]:t.reduce((a,n,o)=>a+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[o+1],e[0]);return new $v(r,e,cf)},"p$3"),WC=l((e,t)=>{if(lf)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of t){let a=document.createElement("style"),n=Qc.litNonce;n!==void 0&&a.setAttribute("nonce",n),a.textContent=r.cssText,e.appendChild(a)}},"d$5"),mb=lf?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(let a of t.cssRules)r+=a.cssText;return FC(r)})(e):e,{is:qC,defineProperty:KC,getOwnPropertyDescriptor:GC,getOwnPropertyNames:YC,getOwnPropertySymbols:QC,getPrototypeOf:XC}=Object,Os=globalThis,gb=Os.trustedTypes,JC=gb?gb.emptyScript:"",e7=Os.reactiveElementPolyfillSupport,Ui=l((e,t)=>e,"l$3"),nd={toAttribute(e,t){switch(t){case Boolean:e=e?JC:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},df=l((e,t)=>!qC(e,t),"y$2"),yb={attribute:!0,type:String,converter:nd,reflect:!1,hasChanged:df};Symbol.metadata!=null||(Symbol.metadata=Symbol("metadata")),Os.litPropertyMetadata!=null||(Os.litPropertyMetadata=new WeakMap);As=class extends HTMLElement{static{l(this,"c")}static addInitializer(e){var t;this._$Ei(),((t=this.l)!=null?t:this.l=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=yb){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),a=this.getPropertyDescriptor(e,r,t);a!==void 0&&KC(this.prototype,e,a)}}static getPropertyDescriptor(e,t,r){var a;let{get:n,set:o}=(a=GC(this.prototype,e))!=null?a:{get(){return this[t]},set(s){this[t]=s}};return{get(){return n?.call(this)},set(s){let i=n?.call(this);o.call(this,s),this.requestUpdate(e,i,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){var t;return(t=this.elementProperties.get(e))!=null?t:yb}static _$Ei(){if(this.hasOwnProperty(Ui("elementProperties")))return;let e=XC(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ui("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ui("properties"))){let t=this.properties,r=[...YC(t),...QC(t)];for(let a of r)this.createProperty(a,t[a])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,a]of t)this.elementProperties.set(r,a)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let a=this._$Eu(t,r);a!==void 0&&this._$Eh.set(a,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let a of r)t.unshift(mb(a))}else e!==void 0&&t.push(mb(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t,r;((t=this._$EO)!=null?t:this._$EO=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return WC(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){var r;let a=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,a);if(n!==void 0&&a.reflect===!0){let o=(((r=a.converter)==null?void 0:r.toAttribute)!==void 0?a.converter:nd).toAttribute(t,a.type);this._$Em=e,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(e,t){var r;let a=this.constructor,n=a._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let o=a.getPropertyOptions(n),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:nd;this._$Em=n,this[n]=s.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,r){var a;if(e!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(e)),!((a=r.hasChanged)!=null?a:df)(this[e],t))return;this.P(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,r){var a;this._$AL.has(e)||this._$AL.set(e,t),r.reflect===!0&&this._$Em!==e&&((a=this._$Ej)!=null?a:this._$Ej=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}let a=this.constructor.elementProperties;if(a.size>0)for(let[n,o]of a)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],o)}let t=!1,r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),(e=this._$EO)==null||e.forEach(a=>{var n;return(n=a.hostUpdate)==null?void 0:n.call(a)}),this.update(r)):this._$EU()}catch(a){throw t=!1,this._$EU(),a}t&&this._$AE(r)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var a;return(a=r.hostUpdated)==null?void 0:a.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}};As.elementStyles=[],As.shadowRootOptions={mode:"open"},As[Ui("elementProperties")]=new Map,As[Ui("finalized")]=new Map,e7?.({ReactiveElement:As}),((bb=Os.reactiveElementVersions)!=null?bb:Os.reactiveElementVersions=[]).push("2.0.4");od=globalThis,sd=od.trustedTypes,vb=sd?sd.createPolicy("lit-html",{createHTML:l(e=>e,"createHTML")}):void 0,Pv="$lit$",io=`lit$${Math.random().toFixed(9).slice(2)}$`,Ov="?"+io,t7=`<${Ov}>`,Ro=document,Wi=l(()=>Ro.createComment(""),"x"),qi=l(e=>e===null||typeof e!="object"&&typeof e!="function","H"),Rv=Array.isArray,r7=l(e=>Rv(e)||typeof e?.[Symbol.iterator]=="function","Z$1"),pp=`[ \f\r]`,Oi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,wb=/-->/g,xb=/>/g,Po=RegExp(`>|${pp}(?:([^\\s"'>=/]+)(${pp}*=${pp}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),_b=/'/g,kb=/"/g,Lv=/^(?:script|style|textarea|title)$/i,Mv=l(e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),"O$1"),Ar=Mv(1),le=Mv(2),Rs=Symbol.for("lit-noChange"),Ir=Symbol.for("lit-nothing"),Sb=new WeakMap,Oo=Ro.createTreeWalker(Ro,129);l(uf,"z");a7=l((e,t)=>{let r=e.length-1,a=[],n,o=t===2?"":"",s=Oi;for(let i=0;i"?(s=n??Oi,h=-1):p[1]===void 0?h=-2:(h=s.lastIndex-p[2].length,u=p[1],s=p[3]===void 0?Po:p[3]==='"'?kb:_b):s===kb||s===_b?s=Po:s===wb||s===xb?s=Oi:(s=Po,n=void 0);let g=s===Po&&e[i+1].startsWith("/>")?" ":"";o+=s===Oi?c+t7:h>=0?(a.push(u),c.slice(0,h)+Pv+c.slice(h)+io+g):c+io+(h===-2?i:g)}return[uf(e,o+(e[r]||"")+(t===2?"":"")),a]},"q"),Tp=class Nv{static{l(this,"T")}constructor({strings:t,_$litType$:r},a){let n;this.parts=[];let o=0,s=0,i=t.length-1,c=this.parts,[u,p]=a7(t,r);if(this.el=Nv.createElement(u,a),Oo.currentNode=this.el.content,r===2){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(n=Oo.nextNode())!==null&&c.length0){n.textContent=sd?sd.emptyScript:"";for(let g=0;g2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Ir}_$AI(e,t=this,r,a){let n=this.strings,o=!1;if(n===void 0)e=Lo(this,e,t,0),o=!qi(e)||e!==this._$AH&&e!==Rs,o&&(this._$AH=e);else{let s=e,i,c;for(e=n[0],i=0;i{var a,n;let o=(a=r?.renderBefore)!=null?a:t,s=o._$litPart$;if(s===void 0){let i=(n=r?.renderBefore)!=null?n:null;o._$litPart$=s=new hf(t.insertBefore(Wi(),i),i,void 0,r??{})}return s._$AI(e),s},"et"),dr=class extends As{static{l(this,"n")}constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;let t=super.createRenderRoot();return(e=this.renderOptions).renderBefore!=null||(e.renderBefore=t.firstChild),t}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=d7(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Rs}};dr._$litElement$=!0,dr.finalized=!0,(Cb=globalThis.litElementHydrateSupport)==null||Cb.call(globalThis,{LitElement:dr});u7=globalThis.litElementPolyfillSupport;u7?.({LitElement:dr});((Ab=globalThis.litElementVersions)!=null?Ab:globalThis.litElementVersions=[]).push("4.0.6");Tr=l(e=>(t,r)=>{r!==void 0?r.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},"s$4"),h7=Object.defineProperty,p7=Object.defineProperties,f7=Object.getOwnPropertyDescriptors,Tb=Object.getOwnPropertySymbols,m7=Object.prototype.hasOwnProperty,g7=Object.prototype.propertyIsEnumerable,Eb=l((e,t,r)=>t in e?h7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"d$3"),y7=l((e,t)=>{for(var r in t||(t={}))m7.call(t,r)&&Eb(e,r,t[r]);if(Tb)for(var r of Tb(t))g7.call(t,r)&&Eb(e,r,t[r]);return e},"l$2"),b7=l((e,t)=>p7(e,f7(t)),"u$b"),v7={attribute:!0,type:String,converter:nd,reflect:!1,hasChanged:df},w7=l((e=v7,t,r)=>{let{kind:a,metadata:n}=r,o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),o.set(r.name,e),a==="accessor"){let{name:s}=r;return{set(i){let c=t.get.call(this);t.set.call(this,i),this.requestUpdate(s,c,e)},init(i){return i!==void 0&&this.P(s,void 0,e),i}}}if(a==="setter"){let{name:s}=r;return function(i){let c=this[s];t.call(this,i),this.requestUpdate(s,c,e)}}throw Error("Unsupported decorator location: "+a)},"w$5");l(be,"O");x7=Object.defineProperty,_7=Object.getOwnPropertyDescriptor,Yi=l((e,t,r,a)=>{for(var n=a>1?void 0:a?_7(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&x7(t,r,n),n},"a$6"),dn=class extends dr{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${dn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};dn.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);dn.styles=Cr` :host { display: contents; } `;Yi([be({type:String,reflect:!0})],dn.prototype,"size",2);Yi([be({type:String,reflect:!0})],dn.prototype,"weight",2);Yi([be({type:String,reflect:!0})],dn.prototype,"color",2);Yi([be({type:Boolean,reflect:!0})],dn.prototype,"mirrored",2);dn=Yi([Tr("ph-paper-plane-tilt")],dn);k7=Object.defineProperty,S7=Object.getOwnPropertyDescriptor,Qi=l((e,t,r,a)=>{for(var n=a>1?void 0:a?S7(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&k7(t,r,n),n},"o$7"),un=class extends dr{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${un.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};un.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);un.styles=Cr` :host { display: contents; } `;Qi([be({type:String,reflect:!0})],un.prototype,"size",2);Qi([be({type:String,reflect:!0})],un.prototype,"weight",2);Qi([be({type:String,reflect:!0})],un.prototype,"color",2);Qi([be({type:Boolean,reflect:!0})],un.prototype,"mirrored",2);un=Qi([Tr("ph-stop-circle")],un);I7=Object.defineProperty,C7=Object.getOwnPropertyDescriptor,Xi=l((e,t,r,a)=>{for(var n=a>1?void 0:a?C7(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&I7(t,r,n),n},"a$5"),hn=class extends dr{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${hn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};hn.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);hn.styles=Cr` :host { display: contents; } `;Xi([be({type:String,reflect:!0})],hn.prototype,"size",2);Xi([be({type:String,reflect:!0})],hn.prototype,"weight",2);Xi([be({type:String,reflect:!0})],hn.prototype,"color",2);Xi([be({type:Boolean,reflect:!0})],hn.prototype,"mirrored",2);hn=Xi([Tr("ph-arrow-down")],hn);A7={chatService:null,interactions:[],sourceBaseURL:"",linksTarget:"_blank",linksRel:"noopener noreferrer",prompt:"",sourcesMap:{title:"title",description:"description",path:"path"}},T7=l((e,t,r)=>{let a=e.get(t);a?a.includes(r)||a.push(r):e.set(t,[r])},"appendToMap"),E7=l((e,t)=>{let r;return(...a)=>{r&&clearTimeout(r),r=setTimeout(()=>{r=0,e(...a)},t)}},"debounce"),$7=l(e=>!("isConnected"in e)||e.isConnected,"isConnected"),$b=E7(e=>{for(let t of e.keys())e.set(t,e.get(t).filter($7))},2e3),P7=l(()=>{if(typeof tf!="function")return{};let e=new Map;return{dispose:l(()=>e.clear(),"dispose"),get:l(t=>{let r=tf();r&&T7(e,t,r)},"get"),set:l(t=>{let r=e.get(t);r&&e.set(t,r.filter(rf)),$b(e)},"set"),reset:l(()=>{e.forEach(t=>t.forEach(rf)),$b(e)},"reset")}},"stencilSubscription"),fp=l(e=>typeof e=="function"?e():e,"unwrap"),O7=l((e,t=(r,a)=>r!==a)=>{let r=fp(e),a=new Map(Object.entries(r??{})),n={dispose:[],get:[],set:[],reset:[]},o=l(()=>{a=new Map(Object.entries(fp(e)??{})),n.reset.forEach(h=>h())},"reset"),s=l(()=>{n.dispose.forEach(h=>h()),o()},"dispose"),i=l(h=>(n.get.forEach(m=>m(h)),a.get(h)),"get"),c=l((h,m)=>{let g=a.get(h);t(m,g,h)&&(a.set(h,m),n.set.forEach(x=>x(h,m,g)))},"set"),u=typeof Proxy>"u"?{}:new Proxy(r,{get(h,m){return i(m)},ownKeys(h){return Array.from(a.keys())},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},has(h,m){return a.has(m)},set(h,m,g){return c(m,g),!0}}),p=l((h,m)=>(n[h].push(m),()=>{R7(n[h],m)}),"on");return{state:u,get:i,set:c,on:p,onChange:l((h,m)=>{let g=p("set",(w,k)=>{w===h&&m(k)}),x=p("reset",()=>m(fp(e)[h]));return()=>{g(),x()}},"onChange"),use:l((...h)=>{let m=h.reduce((g,x)=>(x.set&&g.push(p("set",x.set)),x.get&&g.push(p("get",x.get)),x.reset&&g.push(p("reset",x.reset)),x.dispose&&g.push(p("dispose",x.dispose)),g),[]);return()=>m.forEach(g=>g())},"use"),dispose:s,reset:o,forceUpdate:l(h=>{let m=a.get(h);n.set.forEach(g=>g(h,m,m))},"forceUpdate")}},"createObservableMap"),R7=l((e,t)=>{let r=e.indexOf(t);r>=0&&(e[r]=e[e.length-1],e.length--)},"removeFromArray"),zv=l((e,t)=>{let r=O7(e,t);return r.use(P7()),r},"createStore"),Zv={open:!1,currentTask:"search",currentTerm:""};zv(Zv);L7={count:0,facets:[],facetProperty:"",results:[],resultMap:{},highlightedIndex:-1,loading:!1,error:!1,searchService:null,searchParams:null},M7={global:Zv,search:L7,chat:A7},Vi=new Map,N7=l((e,t)=>{let r=Vi.get(e);if(!r)throw new Error("Invalid parent component Id");let a=r[t];if(!a)throw new Error("Store not initialized");return a},"getParentComponentStore"),Xc=l((e,t)=>{let r=M7[e];if(!r)throw new Error("Invalid store name");let a=zv(r);if(Vi.has(t)){let n=Vi.get(t);n[e]=a}else Vi.set(t,{[e]:a});return a},"initStore"),jv=l(e=>{Vi.delete(e)},"removeAllStores");l(Bv,"getStore");D7=["orama-search-box","orama-chat-box"];l(Hv,"getExternalParentComponentHTMLElement");Vc=Symbol("storeProps"),Pb=Symbol("storeWillLoadPatched");l(Tn,"Store");Ep={searchPlaceholder:"Search...",chatPlaceholder:"Ask me anything",noResultsFound:"No results found",noResultsFoundFor:"No results found for",suggestionsTitle:"Suggestions",seeAll:"See all",addMore:"Add more",clearChat:"Clear chat",errorMessage:"An error occurred while trying to search. Please try again.",disclaimer:"Orama can make mistakes. Please verify the information.",startYourSearch:"Start your search",initErrorSearch:"Unable to initialize search service",initErrorChat:"Unable to initialize chat service",chatButtonLabel:"Get a summary",searchButtonLabel:"Search"};l(Ls,"getText");z7='orama-chat{background:#fbfbfb;background:var(--background-color-primary,#fbfbfb);height:100%;overflow:hidden}.messages-container-wrapper,orama-chat{display:flex;flex-direction:column;flex-grow:1;position:relative}.messages-container-wrapper{overflow:auto;z-index:1}.messages-container-wrapper::-webkit-scrollbar{width:.3em}.messages-container-wrapper::-webkit-scrollbar-track{background:transparent}.messages-container-wrapper::-webkit-scrollbar-thumb{background-color:hsla(0,0%,70%,.522);border-radius:1rem;border-radius:var(--border-radius-l,calc(16rem/var(--orama-base-font-size, 16)))}.messages-container-wrapper.isEmpty{justify-content:flex-end}.messages-container-wrapper-non-scrollable{display:flex;flex-direction:column;flex-grow:1;overflow:hidden;position:relative;z-index:1}.lock-scroll-on-bottom-button-wrapper{align-items:center;background-color:transparent;background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6);border:none;border-radius:.75rem;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)));bottom:0;color:#99989d;color:var(--icon-color-tertiary,#99989d);cursor:pointer;display:flex;font-family:font("primary");font-family:var(--font-primary,font("primary"));height:-moz-fit-content;height:fit-content;justify-content:center;left:50%;margin:.25rem;margin:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));position:absolute;transform:translateX(-50%);width:-moz-fit-content;width:fit-content;z-index:2}.chat-form-wrapper{padding:.75rem 1rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16))) var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}.chat-input{margin-bottom:.5rem;margin-bottom:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}.disclaimer-text{color:#838289;color:var(--text-color-secondary,#838289);margin-top:.25rem;margin-top:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));opacity:.8}.suggestions-wrapper{display:flex;flex-direction:column;flex-grow:1;justify-content:end;overflow-x:auto}orama-logo-icon{position:absolute;right:50%;top:50%;transform:translate(50%,-50%);z-index:-1}',Z7=function(e,t,r,a){var n=arguments.length,o=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(s=e[i])&&(o=(n<3?s(o):n>3?s(t,r,o):s(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o},j7=1,pf=class{static{l(this,"OramaChat")}constructor(e){zt(this,e),this.answerGenerated=qt(this,"answerGenerated"),this.clearChat=qt(this,"clearChat"),this.startConversation=qt(this,"startConversation"),this.placeholder="Ask me anything",this.sourceBaseUrl="",this.showClearChat=!0,this.focusInput=!1,this.disclaimer="Orama can make mistakes. Please verify the information.",this.inputValue="",this.showGoToBottomButton=!1,this.triggerSendQuestion=(t,r)=>{if(this.chatStore.state.chatService===null)throw new Error("Chat Service is not initialized");this.startConversation.emit({userPrompt:t,systemPrompts:this.systemPrompts}),this.chatStore.state.chatService.sendQuestion(t,r,this.systemPrompts,{onAnswerGeneratedCallback:l(a=>this.answerGenerated.emit(a),"onAnswerGeneratedCallback")})},this.isScrolling=!1,this.prevScrollTop=0,this.scrollTarget=0,this.pendingNewInteractionSideEffects=!1,this.lockScrollOnBottom=!1,this.isDisconnecting=!1,this.handleFocus=()=>{if(this.focusInput){let t=this.textareaRef.querySelector("textarea");if(!t)return;requestAnimationFrame(()=>{t.focus()})}},this.calculateIsScrollOnBottom=()=>{let t=this.messagesContainerRef.scrollHeight-this.messagesContainerRef.clientHeight;return this.messagesContainerRef.scrollTop+j7>=t},this.scrollToBottom=(t={animated:!0,onScrollDone:l(()=>{},"onScrollDone")})=>{if(!this.messagesContainerRef)return;if(!t.animated){this.messagesContainerRef.scrollTop=this.messagesContainerRef.scrollHeight,t.onScrollDone();return}this.isScrolling=!0;let r=performance.now(),a=this.messagesContainerRef.scrollTop,n=300,o=l(s=>{if(!this.messagesContainerRef||!this.isScrolling)return;let i=this.messagesContainerRef.scrollHeight-this.messagesContainerRef.clientHeight,c=s-r,u=Math.min(1,c/n),p=this.easeInOutQuad(u),h=a+(i-a)*p;this.messagesContainerRef.scrollTo(0,h),ct<.5?2*t*t:-1+(4-2*t)*t,this.recalculateGoBoToBottomButton=()=>{if(!this.calculateIsContainerOverflowing()){this.showGoToBottomButton=!1;return}this.showGoToBottomButton=!this.calculateIsScrollOnBottom()},this.handleWheel=t=>{if(!this.calculateIsContainerOverflowing()){this.lockScrollOnBottom=!1,this.showGoToBottomButton=!1;return}let r=this.messagesContainerRef.scrollTop;this.showGoToBottomButton=!this.calculateIsScrollOnBottom(),this.lockScrollOnBottom=!this.showGoToBottomButton,this.showGoToBottomButton||(this.isScrolling=!1),this.prevScrollTop=r},this.setSources=()=>{this.chatStore.state.sourceBaseURL=this.sourceBaseUrl,this.chatStore.state.sourcesMap=this.sourcesMap,this.chatStore.state.linksTarget=this.linksTarget,this.chatStore.state.linksRel=this.linksRel},this.handleSubmit=t=>{if(t.preventDefault(),this.chatStore.state.chatService===null)throw new Error("Chat Service is not initialized");this.startConversation.emit({userPrompt:this.inputValue,systemPrompts:this.systemPrompts}),this.chatStore.state.chatService.sendQuestion(this.inputValue,this.relatedQueries,this.systemPrompts,{onAnswerGeneratedCallback:l(r=>this.answerGenerated.emit(r),"onAnswerGeneratedCallback")}),this.chatStore.state.prompt=this.inputValue,this.inputValue=""},this.handleAbortAnswerClick=()=>{this.chatStore.state.chatService.abortAnswer()},this.handleSuggestionClick=(t,r)=>{if(this.chatStore.state.chatService===null)throw new Error("Chat Service is not initialized");this.startConversation.emit({userPrompt:t,systemPrompts:this.systemPrompts}),this.chatStore.state.chatService.sendQuestion(t,r,void 0,{onAnswerGeneratedCallback:l(a=>this.answerGenerated.emit(a),"onAnswerGeneratedCallback")}),this.inputValue=""},this.handleClearChat=()=>{this.chatStore.state.chatService.resetChat(),this.clearChat.emit()},this.calculateIsContainerOverflowing=()=>this.messagesContainerRef?this.messagesContainerRef.scrollHeight>this.messagesContainerRef.clientHeight:!1}handleSourceItemClick(e){}handleDefaultTermChange(){var e;this.defaultTerm&&((e=this.chatStore.state.chatService)===null||e===void 0||e.sendQuestion(this.defaultTerm,this.relatedQueries,this.systemPrompts,{onAnswerGeneratedCallback:l(t=>this.answerGenerated.emit(t),"onAnswerGeneratedCallback")}))}focusInputWatcher(){this.handleFocus()}promptWatcher(e,t){e!==t&&(this.triggerSendQuestion(e,this.relatedQueries),this.chatStore.state.prompt=e)}handleTextDictionaryChange(){var e,t;!((e=this.dictionary)===null||e===void 0)&&e.chatPlaceholder&&(this.placeholder=this.dictionary.chatPlaceholder),!((t=this.dictionary)===null||t===void 0)&&t.disclaimer&&(this.disclaimer=this.dictionary.disclaimer),console.log("Updated from dictionary:",{placeholder:this.placeholder,disclaimer:this.disclaimer,dictionary:this.dictionary})}componentWillLoad(){var e;this.handleTextDictionaryChange(),!this.disclaimer&&!((e=this.dictionary)===null||e===void 0)&&e.disclaimer?this.disclaimer=this.dictionary.disclaimer:this.disclaimer||(this.disclaimer="Orama can make mistakes. Please verify the information."),this.chatStore.on("set",(t,r,a)=>{t==="interactions"&&a?.length{this.recalculateGoBoToBottomButton()}),this.scrollableContainerResizeObserver.observe(this.messagesContainerRef),this.nonScrollableContainerResizeObserver=new ResizeObserver(()=>{if(this.pendingNewInteractionSideEffects){this.pendingNewInteractionSideEffects=!1,this.lockScrollOnBottom=!1,this.scrollToBottom({animated:!0,onScrollDone:l(()=>{this.recalculateGoBoToBottomButton()},"onScrollDone")});return}this.lockScrollOnBottom&&!this.isScrolling&&this.scrollToBottom({animated:!1,onScrollDone:l(()=>{this.recalculateGoBoToBottomButton()},"onScrollDone")}),this.recalculateGoBoToBottomButton()}),this.nonScrollableContainerResizeObserver.observe(this.nonScrollableMessagesContainerRef)}disconnectedCallback(){var e,t,r;this.isDisconnecting=!0,(e=this.messagesContainerRef)===null||e===void 0||e.removeEventListener("wheel",this.handleWheel),(t=this.scrollableContainerResizeObserver)===null||t===void 0||t.disconnect(),(r=this.nonScrollableContainerResizeObserver)===null||r===void 0||r.disconnect(),this.clearChatOnDisconnect&&this.chatStore&&this.chatStore.state&&(this.chatStore.state.interactions=[])}render(){var e,t,r;let a=(e=this.chatStore.state.interactions)===null||e===void 0?void 0:e[this.chatStore.state.interactions.length-1],n=a?.status,o=((t=this.chatStore.state.interactions)===null||t===void 0?void 0:t.length)>0;return D(Er,{key:"d8f4f1eafe32d3302f009099297fa2aa21767105"},this.showClearChat&&o&&D("div",{key:"e8e9a719801cc48f1bd65b99173d2dee1fb0e3f9",class:"header"},D("button",{key:"caba4adf41a26ec35a8380d0b0df2eaa25772dce",type:"button",onClick:this.handleClearChat},D("ph-arrow-clockwise",{key:"42dccc8772a5a5bf6e7e83085a588968bd9774bc",weight:"fill",size:"14"})," ",this.getText("clearChat"))),D("div",{key:"250f3f1abd7448cc9dcfd9e7d26d065f80f01813",class:"messages-container-wrapper-non-scrollable"},D("div",{key:"cbb11338d6347df3e3ef211c39cbfc84366aa765",class:`messages-container-wrapper ${o?"":"isEmpty"}`,ref:l(s=>this.messagesContainerRef=s,"ref")},D("div",{key:"7462c8f6833caa443fe77d6e6a8016cabec50c95",ref:l(s=>this.nonScrollableMessagesContainerRef=s,"ref")},o?D("orama-chat-messages-container",{interactions:this.chatStore.state.interactions,chatMarkdownLinkTitle:this.chatMarkdownLinkTitle,chatMarkdownLinkHref:this.chatMarkdownLinkHref}):null,o?null:D(cn,null,D("slot",{name:"chat-empty-state"}),!!(!((r=this.suggestions)===null||r===void 0)&&r.length)&&D("div",{class:"suggestions-wrapper"},D("orama-suggestions",{suggestions:this.suggestions,suggestionClicked:this.handleSuggestionClick}))))),this.showGoToBottomButton&&D("button",{key:"4ba702c4b2ef9e7d54d344fed97b35feae00ecdf",class:"lock-scroll-on-bottom-button-wrapper",type:"button",onClick:l(()=>{this.lockScrollOnBottom=!0,this.scrollToBottom({animated:!0,onScrollDone:l(()=>this.recalculateGoBoToBottomButton(),"onScrollDone")})},"onClick")},D("ph-arrow-down",{key:"496705c2eeea58d202405e2eb2af9a60fdaca2ee",size:"18px"}))),D("div",{key:"afd6923df9fc9cd80af8efe9ad6fdc483f2f62c1",class:"chat-form-wrapper"},D("form",{key:"2119ea73c971f5c5f7634b7a140fd39b112ad200",onSubmit:this.handleSubmit},D("div",{key:"f28bfa0bd6575504bf4f9eb696b3eb13449afc25",class:"chat-input"},D("orama-textarea",{key:"3a62287fde2cd13bdd6237d7b853f26e2f267686",ref:l(s=>this.textareaRef=s,"ref"),autoFocus:this.focusInput,maxRows:4,value:this.inputValue,onKeyDown:l(s=>{s.key==="Enter"&&!s.shiftKey&&(this.handleSubmit(s),s.preventDefault())},"onKeyDown"),onInput:l(s=>{this.inputValue=s.target.value},"onInput"),placeholder:this.placeholder},D("div",{key:"2437be786888bdcc8b2983cb8a17411a03b3aeab",slot:"adornment-end"},[zr.streaming,zr.rendering,zr.loading].includes(n)?D("orama-button",{type:"submit",onClick:this.handleAbortAnswerClick,onKeyDown:this.handleAbortAnswerClick,disabled:n!==zr.rendering,"aria-label":"Abort answer"},D("ph-stop-circle",{size:16})):D("orama-button",{type:"submit",onClick:this.handleSubmit,onKeyDown:this.handleSubmit,disabled:!this.inputValue,"aria-label":"Send question"},D("ph-paper-plane-tilt",{size:16})))))),this.disclaimer&&D("orama-text",{key:"a65926093bda5820a477545da7ede16fd36d7c74",as:"p",styledAs:"small",align:"center",class:"disclaimer-text"},this.disclaimer)))}static get watchers(){return{defaultTerm:["handleDefaultTermChange"],focusInput:["focusInputWatcher"],prompt:["promptWatcher"],dictionary:["handleTextDictionaryChange"]}}};Z7([Tn("chat")],pf.prototype,"chatStore",void 0);pf.style=z7;B7=Object.defineProperty,H7=Object.getOwnPropertyDescriptor,Ji=l((e,t,r,a)=>{for(var n=a>1?void 0:a?H7(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&B7(t,r,n),n},"o$6"),pn=class extends dr{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${pn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};pn.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);pn.styles=Cr` :host { display: contents; } `;Ji([be({type:String,reflect:!0})],pn.prototype,"size",2);Ji([be({type:String,reflect:!0})],pn.prototype,"weight",2);Ji([be({type:String,reflect:!0})],pn.prototype,"color",2);Ji([be({type:Boolean,reflect:!0})],pn.prototype,"mirrored",2);pn=Ji([Tr("ph-copy")],pn);U7=Object.defineProperty,V7=Object.getOwnPropertyDescriptor,el=l((e,t,r,a)=>{for(var n=a>1?void 0:a?V7(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&U7(t,r,n),n},"o$5"),fn=class extends dr{static{l(this,"a")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${fn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};fn.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);fn.styles=Cr` :host { display: contents; } `;el([be({type:String,reflect:!0})],fn.prototype,"size",2);el([be({type:String,reflect:!0})],fn.prototype,"weight",2);el([be({type:String,reflect:!0})],fn.prototype,"color",2);el([be({type:Boolean,reflect:!0})],fn.prototype,"mirrored",2);fn=el([Tr("ph-arrows-clockwise")],fn);F7=Object.defineProperty,W7=Object.getOwnPropertyDescriptor,tl=l((e,t,r,a)=>{for(var n=a>1?void 0:a?W7(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&F7(t,r,n),n},"l$1"),mn=class extends dr{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${mn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};mn.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);mn.styles=Cr` :host { display: contents; } `;tl([be({type:String,reflect:!0})],mn.prototype,"size",2);tl([be({type:String,reflect:!0})],mn.prototype,"weight",2);tl([be({type:String,reflect:!0})],mn.prototype,"color",2);tl([be({type:Boolean,reflect:!0})],mn.prototype,"mirrored",2);mn=tl([Tr("ph-thumbs-down")],mn);q7=Object.defineProperty,K7=Object.getOwnPropertyDescriptor,rl=l((e,t,r,a)=>{for(var n=a>1?void 0:a?K7(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&q7(t,r,n),n},"o$4"),gn=class extends dr{static{l(this,"a")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${gn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};gn.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);gn.styles=Cr` :host { display: contents; } `;rl([be({type:String,reflect:!0})],gn.prototype,"size",2);rl([be({type:String,reflect:!0})],gn.prototype,"weight",2);rl([be({type:String,reflect:!0})],gn.prototype,"color",2);rl([be({type:Boolean,reflect:!0})],gn.prototype,"mirrored",2);gn=rl([Tr("ph-warning")],gn);G7=".sc-orama-chat-assistent-message-h{color:#838289;color:var(--text-color-secondary,#838289);display:block}.message-wrapper.sc-orama-chat-assistent-message{padding:.75rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}.message-error.sc-orama-chat-assistent-message,.message-wrapper.sc-orama-chat-assistent-message{background:#fff;background:var(--background-color-secondary,#fff);border-radius:.75rem;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)));margin:0 1rem;margin:0 var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}.message-error.sc-orama-chat-assistent-message{padding:1rem .5rem;padding:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16))) var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));text-align:center}.message-error.sc-orama-chat-assistent-message ph-warning.sc-orama-chat-assistent-message{color:#99989d;color:var(--text-color-inactive,#99989d);display:block}.message-actions.sc-orama-chat-assistent-message{display:flex;gap:.5rem;gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));justify-content:end;margin-top:.75rem;margin-top:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));transition:opacity .2s ease-in-out}.hidden.sc-orama-chat-assistent-message{opacity:0;pointer-events:none}.sr-only.sc-orama-chat-assistent-message{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@keyframes rotate360{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}",Y7=function(e,t,r,a){var n=arguments.length,o=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(s=e[i])&&(o=(n<3?s(o):n>3?s(t,r,o):s(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o},ff=class{static{l(this,"OramaChatAssistentMessage")}constructor(e){zt(this,e),this.isCopied=!1,this.handleCopyToClipboard=()=>{this.isCopied=!0,setTimeout(()=>this.isCopied=!1,1e3),Tv(this.interaction.response)},this.isDisliked=!1,this.handleDislikeMessage=()=>{this.isDisliked=!this.isDisliked},this.handleRetryMessage=()=>{var t;(t=this.chatStore.state.chatService)===null||t===void 0||t.regenerateLatest()}}render(){return this.interaction.status==="loading"?D("div",{class:"message-wrapper"},D("orama-dots-loader",null)):this.interaction.status==="error"?D("div",{class:"message-error"},D("ph-warning",{size:16}),D("orama-text",{styledAs:"span",inactive:!0},"An error occurred while trying to search. Please try again.")):D(Er,null,D("orama-sources",{sources:this.interaction.sources,sourceBaseURL:this.chatStore.state.sourceBaseURL,linksRel:this.chatStore.state.linksRel,linksTarget:this.chatStore.state.linksTarget}),D("div",{class:"message-wrapper"},this.interaction.response?D("orama-markdown",{content:this.interaction.response,chatMarkdownLinkTitle:this.chatMarkdownLinkTitle,chatMarkdownLinkHref:this.chatMarkdownLinkHref}):D("orama-dots-loader",null),D("div",{class:{"message-actions":!0,hidden:this.interaction.status!==zr.done}},this.interaction.latest&&D("orama-button",{type:"button",variant:"icon",onClick:this.handleRetryMessage,onKeyDown:this.handleRetryMessage,"aria-label":"Retry message"},D("ph-arrows-clockwise",{size:"16px"})),D("orama-button",{type:"button",variant:"icon",onClick:this.handleCopyToClipboard,onKeyDown:this.handleCopyToClipboard,withTooltip:this.isCopied?"Copied!":void 0,"aria-label":"Copy message"},D("ph-copy",{size:"16px"})),D("orama-button",{type:"button",variant:"icon",onClick:this.handleDislikeMessage,onKeyDown:this.handleDislikeMessage,"aria-label":"Dislike message"},this.isDisliked?D("ph-thumbs-down",{weight:"fill",size:"16px"}):D("ph-thumbs-down",{size:"16px"})))))}get htmlElement(){return Sr(this)}};Y7([Tn("chat")],ff.prototype,"chatStore",void 0);ff.style=G7;Bi=class extends Error{static{l(this,"OramaClientNotInitializedError")}constructor(){super("Orama Client is not initialized")}},Q7={arabic:"ar",armenian:"am",bulgarian:"bg",czech:"cz",danish:"dk",dutch:"nl",english:"en",finnish:"fi",french:"fr",german:"de",greek:"gr",hungarian:"hu",indian:"in",indonesian:"id",irish:"ie",italian:"it",lithuanian:"lt",nepali:"np",norwegian:"no",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"rs",slovenian:"ru",spanish:"es",swedish:"se",tamil:"ta",turkish:"tr",ukrainian:"uk",sanskrit:"sk"},X7=Object.keys(Q7);Date.now().toString().slice(5);Ob=BigInt(1e3),Rb=BigInt(1e6),Lb=BigInt(1e9),mp=65535;l(Uv,"safeArrayPush");l(Vv,"sprintf");l(Fv,"isInsideWebWorker");l(Wv,"isInsideNode");l($p,"getNanosecondTimeViaPerformance");l(mf,"formatNanoseconds");l(Mo,"getNanosecondsTime");l(gf,"sortTokenScorePredicate");l(qv,"intersect");l(Kv,"getDocumentProperties");l(bd,"getNested");l(yf,"removeVectorsFromHits");l(vd,"isAsyncFunction");J7=X7.join(` - `),eA={NO_LANGUAGE_WITH_CUSTOM_TOKENIZER:"Do not pass the language option to create when using a custom tokenizer.",LANGUAGE_NOT_SUPPORTED:`Language "%s" is not supported. Supported languages are: - ${J7}`,INVALID_STEMMER_FUNCTION_TYPE:"config.stemmer property must be a function.",MISSING_STEMMER:'As of version 1.0.0 @orama/orama does not ship non English stemmers by default. To solve this, please explicitly import and specify the "%s" stemmer from the package @orama/stemmers. See https://docs.orama.com/open-source/text-analysis/stemming for more information.',CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY:"Custom stop words array must only contain strings.",UNSUPPORTED_COMPONENT:'Unsupported component "%s".',COMPONENT_MUST_BE_FUNCTION:'The component "%s" must be a function.',COMPONENT_MUST_BE_FUNCTION_OR_ARRAY_FUNCTIONS:'The component "%s" must be a function or an array of functions.',INVALID_SCHEMA_TYPE:'Unsupported schema type "%s" at "%s". Expected "string", "boolean" or "number" or array of them.',DOCUMENT_ID_MUST_BE_STRING:'Document id must be of type "string". Got "%s" instead.',DOCUMENT_ALREADY_EXISTS:'A document with id "%s" already exists.',DOCUMENT_DOES_NOT_EXIST:'A document with id "%s" does not exists.',MISSING_DOCUMENT_PROPERTY:'Missing searchable property "%s".',INVALID_DOCUMENT_PROPERTY:'Invalid document property "%s": expected "%s", got "%s"',UNKNOWN_INDEX:'Invalid property name "%s". Expected a wildcard string ("*") or array containing one of the following properties: %s',INVALID_BOOST_VALUE:"Boost value must be a number greater than, or less than 0.",INVALID_FILTER_OPERATION:"You can only use one operation per filter, you requested %d.",SCHEMA_VALIDATION_FAILURE:'Cannot insert document due schema validation failure on "%s" property.',INVALID_SORT_SCHEMA_TYPE:'Unsupported sort schema type "%s" at "%s". Expected "string" or "number".',CANNOT_SORT_BY_ARRAY:'Cannot configure sort for "%s" because it is an array (%s).',UNABLE_TO_SORT_ON_UNKNOWN_FIELD:'Unable to sort on unknown field "%s". Allowed fields: %s',SORT_DISABLED:"Sort is disabled. Please read the documentation at https://docs.oramasearch for more information.",UNKNOWN_GROUP_BY_PROPERTY:'Unknown groupBy property "%s".',INVALID_GROUP_BY_PROPERTY:'Invalid groupBy property "%s". Allowed types: "%s", but given "%s".',UNKNOWN_FILTER_PROPERTY:'Unknown filter property "%s".',INVALID_VECTOR_SIZE:'Vector size must be a number greater than 0. Got "%s" instead.',INVALID_VECTOR_VALUE:'Vector value must be a number greater than 0. Got "%s" instead.',INVALID_INPUT_VECTOR:`Property "%s" was declared as a %s-dimensional vector, but got a %s-dimensional vector instead. Input vectors must be of the size declared in the schema, as calculating similarity between vectors of different sizes can lead to unexpected results.`,WRONG_SEARCH_PROPERTY_TYPE:'Property "%s" is not searchable. Only "string" properties are searchable.',FACET_NOT_SUPPORTED:`Facet doens't support the type "%s".`,INVALID_DISTANCE_SUFFIX:'Invalid distance suffix "%s". Valid suffixes are: cm, m, km, mi, yd, ft.',INVALID_SEARCH_MODE:'Invalid search mode "%s". Valid modes are: "fulltext", "vector", "hybrid".',MISSING_VECTOR_AND_SECURE_PROXY:"No vector was provided and no secure proxy was configured. Please provide a vector or configure an Orama Secure Proxy to perform hybrid search.",MISSING_TERM:'"term" is a required parameter when performing hybrid search. Please provide a search term.',INVALID_VECTOR_INPUT:'Invalid "vector" property. Expected an object with "value" and "property" properties, but got "%s" instead.',PLUGIN_CRASHED:"A plugin crashed during initialization. Please check the error message for more information:",PLUGIN_SECURE_PROXY_NOT_FOUND:`Could not find '@orama/secure-proxy-plugin' installed in your Orama instance. Please install it before proceeding with creating an answer session. Read more at https://docs.orama.com/open-source/plugins/plugin-secure-proxy#plugin-secure-proxy `,PLUGIN_SECURE_PROXY_MISSING_CHAT_MODEL:`Could not find a chat model defined in the secure proxy plugin configuration. Please provide a chat model before proceeding with creating an answer session. Read more at https://docs.orama.com/open-source/plugins/plugin-secure-proxy#plugin-secure-proxy `,ANSWER_SESSION_LAST_MESSAGE_IS_NOT_ASSISTANT:"The last message in the session is not an assistant message. Cannot regenerate non-assistant messages.",PLUGIN_COMPONENT_CONFLICT:'The component "%s" is already defined. The plugin "%s" is trying to redefine it.'};l(ga,"createError");l(bf,"getInternalDocumentId");l(al,"getDocumentIdFromInternalId");l(wd,"runAfterSearch");l(xd,"runBeforeSearch");tA=.8;l(Gv,"count");Mb="fulltext",rA="hybrid",aA="vector";l(Yv,"sortAsc");l(Qv,"sortDesc");l(Xv,"sortingPredicateBuilder");l(_d,"getFacets");l(Pp,"calculateNumberFacetBuilder");l(Op,"calculateBooleanStringOrEnumFacetBuilder");nA={reducer:l((e,t,r,a)=>(t[a]=r,t),"reducer"),getInitialValue:l(e=>Array.from({length:e}),"getInitialValue")},Nb=["string","number","boolean"];l(kd,"getGroups");l(vf,"calculateCombination");l(wf,"innerFullTextSearch");l(Jv,"fullTextSearch");gp={k:1.2,b:.75,d:.5};l(e2,"applyDefault");l(xf,"innerVectorSearch");l(t2,"searchVector");l(r2,"innerHybridSearch");l(a2,"hybridSearch");l(id,"extractScore");l(n2,"minMaxScoreNormalization");l(Rp,"normalizeScore");l(o2,"hybridScoreBuilder");l(s2,"mergeAndRankResults");l(i2,"getQueryWeights");l(_f,"search");l(l2,"fetchDocumentsWithDistinct");l(kf,"fetchDocuments");oA="orama-secure-proxy",sA=class{static{l(this,"AnswerSession")}db;proxy=null;config;abortController=null;lastInteractionParams=null;chatModel=null;conversationID;messages=[];events;initPromise;state=[];constructor(e,t){this.db=e,this.config=t,this.init(),this.messages=t.initialMessages||[],this.events=t.events||{},this.conversationID=t.conversationID||this.generateRandomID()}async ask(e){await this.initPromise;let t="";for await(let r of await this.askStream(e))t+=r;return t}async askStream(e){return await this.initPromise,this.fetchAnswer(e)}abortAnswer(){this.abortController?.abort(),this.state[this.state.length-1].aborted=!0,this.triggerStateChange()}getMessages(){return this.messages}clearSession(){this.messages=[],this.state=[]}regenerateLast({stream:e=!0}){if(this.state.length===0||this.messages.length===0)throw new Error("No messages to regenerate");if(this.messages.at(-1)?.role!=="assistant")throw ga("ANSWER_SESSION_LAST_MESSAGE_IS_NOT_ASSISTANT");return this.messages.pop(),this.state.pop(),e?this.askStream(this.lastInteractionParams):this.ask(this.lastInteractionParams)}async*fetchAnswer(e){if(!this.chatModel)throw ga("PLUGIN_SECURE_PROXY_MISSING_CHAT_MODEL");this.abortController=new AbortController,this.lastInteractionParams=e;let t=this.generateRandomID();this.messages.push({role:"user",content:e.term??""}),this.state.push({interactionId:t,aborted:!1,loading:!0,query:e.term??"",response:"",sources:null,translatedQuery:null,error:!1,errorMessage:null});let r=this.state.length-1;this.addEmptyAssistantMessage(),this.triggerStateChange();try{let a=await _f(this.db,e);this.state[r].sources=a,this.triggerStateChange();for await(let n of this.proxy.chatStream({model:this.chatModel,messages:this.messages}))yield n,this.state[r].response+=n,this.messages.findLast(o=>o.role==="assistant").content+=n,this.triggerStateChange()}catch(a){a.name==="AbortError"?this.state[r].aborted=!0:(this.state[r].error=!0,this.state[r].errorMessage=a.toString()),this.triggerStateChange()}return this.state[r].loading=!1,this.triggerStateChange(),this.state[r].response}generateRandomID(e=24){return Array.from({length:e},()=>Math.floor(Math.random()*36).toString(36)).join("")}triggerStateChange(){this.events.onStateChange&&this.events.onStateChange(this.state)}async init(){let e=this;async function t(){return await e.db.plugins.find(n=>n.name===oA)}l(t,"getPlugin");let r=await t();if(!r)throw ga("PLUGIN_SECURE_PROXY_NOT_FOUND");let a=r.extra;if(this.proxy=a.proxy,this.config.systemPrompt&&this.messages.push({role:"system",content:this.config.systemPrompt}),a?.pluginParams?.chat?.model)this.chatModel=a.pluginParams.chat.model;else throw ga("PLUGIN_SECURE_PROXY_MISSING_CHAT_MODEL")}addEmptyAssistantMessage(){this.messages.push({role:"assistant",content:""})}},Db=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};l(c2,"getDefaultExportFromCjs");l(d2,"getAugmentedNamespace");Is={},on={},Fc=BigInt(2**32-1),zb=BigInt(32);l(u2,"fromBig");l(h2,"split");iA=l((e,t,r)=>e<>>32-r,"rotlSH"),lA=l((e,t,r)=>t<>>32-r,"rotlSL"),cA=l((e,t,r)=>t<>>64-r,"rotlBH"),dA=l((e,t,r)=>e<>>64-r,"rotlBL");l(p2,"isBytes");l(Lp,"anumber");l(Ki,"abytes");l(Mp,"aexists");l(f2,"aoutput");l(m2,"u32");l(Sf,"clean");uA=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;l(g2,"byteSwap");l(y2,"byteSwap32");Zb=uA?e=>e:y2;l(b2,"utf8ToBytes");l(Sd,"toBytes");hA=class{static{l(this,"Hash")}};l(v2,"createHasher");l(w2,"createXOFer");pA=BigInt(0),Ri=BigInt(1),fA=BigInt(2),mA=BigInt(7),gA=BigInt(256),yA=BigInt(113),x2=[],_2=[],k2=[];for(let e=0,t=Ri,r=1,a=0;e<24;e++){[r,a]=[a,(2*r+3*a)%5],x2.push(2*(5*a+r)),_2.push((e+1)*(e+2)/2%64);let n=pA;for(let o=0;o<7;o++)t=(t<>mA)*yA)%gA,t&fA&&(n^=Ri<<(Ri<r>32?cA(e,t,r):iA(e,t,r),"rotlH"),Bb=l((e,t,r)=>r>32?dA(e,t,r):lA(e,t,r),"rotlL");l(If,"keccakP");Cf=class I2 extends hA{static{l(this,"Keccak")}constructor(t,r,a,n=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=r,this.outputLen=a,this.enableXOF=n,this.rounds=o,Lp(a),!(0=a&&this.keccak();let s=Math.min(a-this.posOut,o-n);t.set(r.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Lp(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(f2(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Sf(this.state)}_cloneInto(t){let{blockLen:r,suffix:a,outputLen:n,rounds:o,enableXOF:s}=this;return t||(t=new I2(r,a,n,s,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=a,t.outputLen=n,t.enableXOF=s,t.destroyed=this.destroyed,t}},co=l((e,t,r)=>v2(()=>new Cf(t,e,r)),"gen"),wA=co(6,144,224/8),xA=co(6,136,256/8),_A=co(6,104,384/8),kA=co(6,72,512/8),SA=co(1,144,224/8),IA=co(1,136,256/8),CA=co(1,104,384/8),AA=co(1,72,512/8),C2=l((e,t,r)=>w2((a={})=>new Cf(t,e,a.dkLen===void 0?r:a.dkLen,!0)),"genShake"),TA=C2(31,168,128/8),EA=C2(31,136,256/8),$A=Object.freeze({__proto__:null,Keccak:Cf,keccakP:If,keccak_224:SA,keccak_256:IA,keccak_384:CA,keccak_512:AA,sha3_224:wA,sha3_256:xA,sha3_384:_A,sha3_512:kA,shake128:TA,shake256:EA}),PA=d2($A);l(A2,"requireSrc");l(T2,"requireCuid2");lo=T2(),OA=class extends TransformStream{static{l(this,"EventsStreamTransformer")}constructor(){let e=new TextDecoder("utf-8",{ignoreBOM:!1}),t,r;super({start(){t="",r={data:""}},transform(a,n){let o=e.decode(a);t+=o;let s;for(;(s=/\r\n|\n|\r/.exec(t))!==null;){let i=t.substring(0,s.index);if(t=t.substring(s.index+s[0].length),i.length===0)n.enqueue(r),r={data:""};else if(!i.startsWith(":")){let c=/:/.exec(i);if(!c){r[i]="";continue}let u=i.substring(0,c.index),p=i.substring(c.index+1);r[u]=p?.replace(/^\u0020/,"")}}}})}};l(Np,"ownKeys");l(Dp,"_objectSpread");l(E2,"_defineProperty");l($2,"_toPropertyKey");l(P2,"_toPrimitive");Vb=Af({});l(Af,"createDedent");Tf=class{static{l(this,"OramaInterface")}constructor(e){Object.defineProperty(this,"baseURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"masterAPIKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"writeAPIKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"readAPIKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.baseURL=e.baseURL,this.masterAPIKey=e.masterAPIKey,this.writeAPIKey=e.writeAPIKey,this.readAPIKey=e.readAPIKey}async request(e){let t=new URL(e.url,this.baseURL),r=new Headers;r.append("Content-Type","application/json");let a={method:e.method,headers:r};e.body&&e.method!=="GET"&&(a.body=JSON.stringify(e.body)),e.body&&e.method==="GET"&&(t.search=new URLSearchParams(e.body).toString());let n=this.getAPIKey(e.securityLevel);switch(!0){case(e.method!=="GET"&&e.securityLevel!=="read-query"):r.append("Authorization",`Bearer ${n}`);break;case(e.method==="GET"&&e.securityLevel==="master"):r.append("Authorization",`Bearer ${n}`);break;case(e.method==="GET"||e.securityLevel==="read-query"):t.searchParams.append("api-key",n);break}let o=await fetch(t.toString(),a);if(!o.ok)throw new Error(Vb(` Request to "${e.url}" failed with status ${o.status}: ${await o.text()} `));return o.json()}async requestStream(e){let t=new URL(e.url,this.baseURL),r=new Headers;r.append("Content-Type","application/json");let a=this.getAPIKey(e.securityLevel);t.searchParams.append("api-key",a);let n=await fetch(t.toString(),{body:JSON.stringify(e.body),headers:r,method:e.method});if(!n.ok)throw new Error(Vb(` Request to "${e.url}" failed with status ${n.status}: ${await n.text()} `));if(n.body===null)throw new Error(`Response body is null for "${e.url}"`);return n.body?.pipeThrough(new OA)}getAPIKey(e){switch(e){case"master":if(!this.masterAPIKey)throw new Error("Master API key is required for this operation");return this.masterAPIKey;case"write":if(!this.writeAPIKey)throw new Error("Write API key is required for this operation");return this.writeAPIKey;case"read":case"read-query":if(!this.readAPIKey)throw new Error("Read API key is required for this operation");return this.readAPIKey}}};l(ln,"safeJSONParse");RA={PERFORM_ORAMA_SEARCH:"PERFORM_ORAMA_SEARCH",OPTIMIZE_QUERY:"OPTIMIZE_QUERY",GENERATE_QUERIES:"GENERATE_QUERIES",ACTION_PLAN:"ACTION_PLAN",ASK_FOLLOWUP:"ASK_FOLLOWUP",GIVE_REPLY:"GIVE_REPLY",GET_SEGMENT:"GET_SEGMENT",GET_TRIGGER:"GET_TRIGGER",SELECT_SEGMENT_PROBABILITY:"SELECT_SEGMENT_PROBABILITY",SELECT_TRIGGER_PROBABILITY:"SELECT_TRIGGER_PROBABILITY"},LA=Object.values(RA),MA={},Fb=O2(globalThis,MA);l(O2,"createMergeProxy");NA=Symbol("Let zodToJsonSchema decide on which parser to use"),DA={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},zA=l(e=>({...DA,name:e}),"getDefaultOptions"),ZA=l(e=>{let t=zA(e),r=[...t.basePath,t.definitionPath,t.name];return{...t,currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([a,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,a],jsonSchema:void 0}]))}},"getRefs");l(Ef,"addErrorMessage");l(Et,"setResponseValueAndErrors");Ya={},Cs={},$a={},Wc={},Wb={};l(nl,"requireUtil");sn={};l(Id,"requireZodError");l($f,"requireEn");l(Cd,"requireErrors");qc={};l(Pf,"requireParseUtil");Xb={};l(M2,"requireTypeAliases");W={},Li={};l(N2,"requireErrorUtil");l(B2,"requireTypes");l(Up,"requireExternal");l(H2,"requireLib");Qe=H2();l(U2,"parseAnyDef");l(V2,"parseArrayDef");l(F2,"parseBigintDef");l(W2,"parseBooleanDef");l(Of,"parseBrandedDef");jA=l((e,t)=>St(e.innerType._def,t),"parseCatchDef");l(Rf,"parseDateDef");BA=l((e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let a of e.checks)switch(a.kind){case"min":Et(r,"minimum",a.value,a.message,t);break;case"max":Et(r,"maximum",a.value,a.message,t);break}return r},"integerDateParser");l(q2,"parseDefaultDef");l(K2,"parseEffectsDef");l(G2,"parseEnumDef");HA=l(e=>"type"in e&&e.type==="string"?!1:"allOf"in e,"isJsonSchema7AllOfType");l(Y2,"parseIntersectionDef");l(Q2,"parseLiteralDef");Pa={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:l(()=>(yp===void 0&&(yp=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),yp),"emoji"),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};l(Lf,"parseStringDef");l(td,"escapeLiteralCheckValue");UA=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");l(X2,"escapeNonAlphaNumeric");l(wa,"addFormat");l(Dr,"addPattern");l(Vp,"stringifyRegExpWithFlags");l(Mf,"parseRecordDef");l(J2,"parseMapDef");l(ew,"parseNativeEnumDef");l(tw,"parseNeverDef");l(rw,"parseNullDef");ld={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};l(aw,"parseUnionDef");nv=l((e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((a,n)=>St(a._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]})).filter(a=>!!a&&(!t.strictUnions||typeof a=="object"&&Object.keys(a).length>0));return r.length?{anyOf:r}:void 0},"asAnyOf");l(nw,"parseNullableDef");l(ow,"parseNumberDef");l(sw,"parseObjectDef");l(iw,"decideAdditionalProperties");l(lw,"safeIsOptional");VA=l((e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return St(e.innerType._def,t);let r=St(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:{}},r]}:{}},"parseOptionalDef"),FA=l((e,t)=>{if(t.pipeStrategy==="input")return St(e.in._def,t);if(t.pipeStrategy==="output")return St(e.out._def,t);let r=St(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),a=St(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,a].filter(n=>n!==void 0)}},"parsePipelineDef");l(cw,"parsePromiseDef");l(dw,"parseSetDef");l(uw,"parseTupleDef");l(hw,"parseUndefinedDef");l(pw,"parseUnknownDef");WA=l((e,t)=>St(e.innerType._def,t),"parseReadonlyDef"),qA=l((e,t,r)=>{switch(t){case Qe.ZodFirstPartyTypeKind.ZodString:return Lf(e,r);case Qe.ZodFirstPartyTypeKind.ZodNumber:return ow(e,r);case Qe.ZodFirstPartyTypeKind.ZodObject:return sw(e,r);case Qe.ZodFirstPartyTypeKind.ZodBigInt:return F2(e,r);case Qe.ZodFirstPartyTypeKind.ZodBoolean:return W2();case Qe.ZodFirstPartyTypeKind.ZodDate:return Rf(e,r);case Qe.ZodFirstPartyTypeKind.ZodUndefined:return hw();case Qe.ZodFirstPartyTypeKind.ZodNull:return rw(r);case Qe.ZodFirstPartyTypeKind.ZodArray:return V2(e,r);case Qe.ZodFirstPartyTypeKind.ZodUnion:case Qe.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return aw(e,r);case Qe.ZodFirstPartyTypeKind.ZodIntersection:return Y2(e,r);case Qe.ZodFirstPartyTypeKind.ZodTuple:return uw(e,r);case Qe.ZodFirstPartyTypeKind.ZodRecord:return Mf(e,r);case Qe.ZodFirstPartyTypeKind.ZodLiteral:return Q2(e,r);case Qe.ZodFirstPartyTypeKind.ZodEnum:return G2(e);case Qe.ZodFirstPartyTypeKind.ZodNativeEnum:return ew(e);case Qe.ZodFirstPartyTypeKind.ZodNullable:return nw(e,r);case Qe.ZodFirstPartyTypeKind.ZodOptional:return VA(e,r);case Qe.ZodFirstPartyTypeKind.ZodMap:return J2(e,r);case Qe.ZodFirstPartyTypeKind.ZodSet:return dw(e,r);case Qe.ZodFirstPartyTypeKind.ZodLazy:return()=>e.getter()._def;case Qe.ZodFirstPartyTypeKind.ZodPromise:return cw(e,r);case Qe.ZodFirstPartyTypeKind.ZodNaN:case Qe.ZodFirstPartyTypeKind.ZodNever:return tw();case Qe.ZodFirstPartyTypeKind.ZodEffects:return K2(e,r);case Qe.ZodFirstPartyTypeKind.ZodAny:return U2();case Qe.ZodFirstPartyTypeKind.ZodUnknown:return pw();case Qe.ZodFirstPartyTypeKind.ZodDefault:return q2(e,r);case Qe.ZodFirstPartyTypeKind.ZodBranded:return Of(e,r);case Qe.ZodFirstPartyTypeKind.ZodReadonly:return WA(e,r);case Qe.ZodFirstPartyTypeKind.ZodCatch:return jA(e,r);case Qe.ZodFirstPartyTypeKind.ZodPipeline:return FA(e,r);case Qe.ZodFirstPartyTypeKind.ZodFunction:case Qe.ZodFirstPartyTypeKind.ZodVoid:case Qe.ZodFirstPartyTypeKind.ZodSymbol:return;default:return(a=>{})()}},"selectParser");l(St,"parseDef");KA=l((e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:GA(t.currentPath,e.path)};case"none":case"seen":return e.path.lengtht.currentPath[a]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):t.$refStrategy==="seen"?{}:void 0}},"get$ref"),GA=l((e,t)=>{let r=0;for(;r(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r),"addMeta"),QA=l((e,t)=>{let r=ZA(t),a,n=t,o=St(e._def,{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??{},s=n===void 0?a?{...o,[r.definitionPath]:a}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,n].join("/"),[r.definitionPath]:{...a,[n]:o}};return r.target==="jsonSchema7"?s.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in s||"oneOf"in s||"allOf"in s||"type"in s&&Array.isArray(s.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),s},"zodToJsonSchema");l(fw,"formatDuration");XA=typeof localStorage<"u";l(mw,"isServerRuntime");l(gw,"flattenZodSchema");Fp="___$orama_user_id$___",JA="ssid",eT=class{static{l(this,"AnswerSession")}constructor(e){Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"readAPIKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"collectionID",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oramaInterface",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"LLMConfig",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sessionID",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lastInteractionParams",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"messages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.url=e.url,this.readAPIKey=e.readAPIKey,this.collectionID=e.collectionID,this.oramaInterface=new Tf({baseURL:this.url,readAPIKey:this.readAPIKey}),this.LLMConfig=e.LLMConfig,this.messages=e.initialMessages||[],this.events=e.events,this.sessionID=e.sessionID||lo.createId()}async*answerStream(e){this.lastInteractionParams={...e,planned:!1},e=this.enrichConfig(e),this.abortController=new AbortController,this.messages.push({role:"user",content:e.query}),this.messages.push({role:"assistant",content:""});let t=e.interactionID||lo.createId();this.state.push({id:t,query:e.query,response:"",sources:null,loading:!0,error:!1,aborted:!1,errorMessage:null,planned:!1,plan:null,planExecution:{},segment:null,related:e.related?.enabled?"":null}),this.pushState();let r=this.state.length-1,a=this.messages.length-1,n={interaction_id:t,query:e.query,visitor_id:e.visitorID,conversation_id:e.sessionID,messages:e.messages||[],llm_config:null,related:e.related};this.LLMConfig&&(n.llm_config=this.LLMConfig);let o=(await this.oramaInterface.requestStream({method:"POST",securityLevel:"read-query",url:`/v1/collections/${this.collectionID}/answer`,body:n})).getReader();for(;;){let{done:s,value:i}=await o.read();if(i!==void 0){let c=ln(i.data);if(c.type==="response"){let{action:u,result:p}=ln(c.message);switch(u){case"GET_SEGMENT":{if(p!==null){let h=ln(p);if(!h)break;this.state[r].segment={id:h.id,name:h.name},this.pushState()}break}case"GET_TRIGGER":{if(p!==null){let h=ln(p);if(!h)break;this.state[r].segment=h,this.pushState()}break}case"OPTIMIZING_QUERY":break;case"SEARCH_RESULTS":{let h=ln(p);this.state[r].sources=h,this.pushState();break}case"ANSWER_RESPONSE":{this.state[r].response+=p,this.messages[a].content=this.state[r].response,yield this.state[r].response,this.pushState();break}case"RELATED_QUERIES":{this.state[r].related+=p,this.pushState();break}}}}if(s){this.state[r].loading=!1,this.pushState();break}}o.releaseLock()}async answer(e){this.lastInteractionParams={...e,planned:!1};let t="";for await(let r of this.answerStream(e))t=r;return t}async*reasonStream(e){this.lastInteractionParams={...e,planned:!0};for await(let t of this.fetchPlannedAnswer(e))yield this.state[this.state.length-1].response}async reason(e){this.lastInteractionParams={...e,planned:!0};for await(let t of this.fetchPlannedAnswer(e));return this.state[this.state.length-1].response}async*fetchPlannedAnswer(e){e=this.enrichConfig(e),this.abortController=new AbortController,this.messages.push({role:"user",content:e.query}),this.messages.push({role:"assistant",content:""});let t=lo.createId();this.state.push({id:t,query:e.query,response:"",sources:null,loading:!0,error:!1,aborted:!1,errorMessage:null,planned:!0,plan:null,planExecution:{},segment:null,related:e.related?.enabled?"":null}),this.pushState();let r=this.state.length-1,a=this.messages.length-1,n=(await this.oramaInterface.requestStream({method:"POST",securityLevel:"read-query",url:`/v1/collections/${this.collectionID}/planned_answer`,body:{interaction_id:e.interactionID,query:e.query,visitor_id:e.visitorID,conversation_id:e.sessionID,messages:e.messages||[],llm_config:this.LLMConfig?this.LLMConfig:null,related:e.related},signal:this.abortController?.signal})).getReader();for(;;){let{done:o,value:s}=await n.read();if(s!==void 0){if(s==="")continue;let i=ln(s.data);if(i.type==="acknowledgement"){yield{action:"ACKNOWLEDGEMENT",message:"acknowledgement"};continue}if(i.type==="response"){if(i.message==="")continue;let c=ln(i.message),u=c.action;if(u==="ACTION_PLAN"){let p=ln(c.result);this.state[r].plan=p;let h={};for(let m of p)h[m.step]={instruction:m.description,result:"",done:!1};this.state[r].planExecution=h,this.pushState(),yield{action:"ACTION_PLAN",message:p};continue}if(u==="PERFORM_ORAMA_SEARCH"){let p=JSON.parse(c.result);this.state[r].sources=p,"PERFORM_ORAMA_SEARCH"in this.state[r].planExecution&&(this.state[r].planExecution.PERFORM_ORAMA_SEARCH.result=p,this.state[r].planExecution.PERFORM_ORAMA_SEARCH.done=!0),this.pushState(),yield{action:"PERFORM_ORAMA_SEARCH",message:p};continue}if(u==="ASK_FOLLOWUP"||u==="GIVE_REPLY"){this.state[r].response+=c.result,this.messages[a].content=this.state[r].response,this.state[r].planExecution[u].result+=c.result,this.state[r].planExecution[u].done=c.done,this.pushState(),yield{action:u,message:c.result};continue}if(u==="GET_SEGMENT"&&(this.state[r].segment={id:c.result.id,name:c.result.name},this.pushState()),u==="SELECT_SEGMENT_PROBABILITY"&&this.state[r].segment){let p=c.result.probability;this.state[r].segment.probability=p,this.pushState()}if(u==="GET_TRIGGER"&&(this.state[r].segment={id:c.result.id,name:c.result.name},this.pushState()),u==="SELECT_TRIGGER_PROBABILITY"&&this.state[r].segment){let p=c.result.probability;this.state[r].segment.probability=p,this.pushState()}if(u==="RELATED_QUERIES"){this.state[r].related+=c.result,this.pushState();break}LA.includes(u)||(this.state[r].planExecution[u].result+=c.result,this.state[r].planExecution[u].done=c.done,this.pushState()),yield c}}if(o)break}n.releaseLock(),this.state[r].loading=!1,this.pushState()}async regenerateLast({stream:e=!0}={}){if(this.state.length===0||this.messages.length===0)throw new Error("No messages to regenerate");if(this.messages.at(-1)?.role!=="assistant")throw new Error("Last message is not an assistant message");return this.messages.pop(),this.state.pop(),this.lastInteractionParams?.planned?e?this.reasonStream(this.lastInteractionParams):this.reason(this.lastInteractionParams):e?this.answerStream(this.lastInteractionParams):this.answer(this.lastInteractionParams)}abort(){if(!this.abortController)throw new Error("AbortController is not available.");if(this.state.length===0)throw new Error("There is no active request to abort.");this.abortController.abort(),this.abortController=void 0,this.state[this.state.length-1].aborted=!0}clearSession(){this.messages=[],this.state=[],this.pushState()}pushState(){this.events?.onStateChange?.(this.state)}enrichConfig(e){return e.visitorID||(e.visitorID=yw()),e.interactionID||(e.interactionID=lo.createId()),e.sessionID||(e.sessionID=this.sessionID),e}};l(yw,"getUserID");l(bw,"sendBeacon");tT=class{static{l(this,"Profile")}constructor({endpoint:e,apiKey:t}){if(Object.defineProperty(this,"endpoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"identity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"userAlias",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!e||!t)throw new Error("Endpoint and API Key are required to create a Profile");if(typeof e!="string"||typeof t!="string")throw new Error("Endpoint and API Key must be strings");if(typeof localStorage<"u"){let r=localStorage.getItem(Fp);r?this.userId=r:(this.userId=lo.createId(),localStorage.setItem(Fp,this.userId))}else this.userId=lo.createId();this.endpoint=e,this.apiKey=t}setParams(e){let{protocol:t,host:r}=new URL(e.identifyUrl),a=`${t}//${r}/identify`;this.params={identifyUrl:a,index:e.index}}getIdentity(){return this.identity}getUserId(){return this.userId}getAlias(){return this.userAlias}async sendProfileData(e){if(!this.params)throw new Error("Orama Profile is not initialized");let t=JSON.stringify({...e,visitorId:this.getUserId(),index:this.params.index});await bw(`${this.params?.identifyUrl}?api-key=${this.apiKey}`,t)}async identify(e){if(typeof e!="string")throw new Error("Identity must be a string");await this.sendProfileData({entity:"identity",id:e}),this.identity=e}async alias(e){if(typeof e!="string")throw new Error("Identity must be a string");await this.sendProfileData({entity:"alias",id:e}),this.userAlias=e}reset(){this.userId=lo.createId(),this.identity=void 0,this.userAlias=void 0}},rT=class{static{l(this,"CollectionManager")}constructor(e){Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"collectionID",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"writeAPIKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"readAPIKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oramaInterface",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"profile",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e.url,this.writeAPIKey=e.writeAPIKey,this.readAPIKey=e.readAPIKey,this.collectionID=e.collectionID,this.oramaInterface=new Tf({baseURL:this.url,writeAPIKey:this.writeAPIKey,readAPIKey:this.readAPIKey}),this.profile=new tT({endpoint:this.url,apiKey:this.readAPIKey})}async search(e){let t=+new Date,{datasourceIDs:r,indexes:a,...n}=e,o=await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/search`,body:{...n,indexes:r||a},method:"POST",securityLevel:"read-query"}),s=+new Date-t;return{...o,elapsed:{raw:s,formatted:fw(s)}}}getStats(e){return this.oramaInterface.request({url:`/v1/collections/${e}/stats`,method:"GET",securityLevel:"read-query"})}async createIndex(e){let t={id:e.id,embedding:e.embeddings};await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/indexes/create`,body:t,method:"POST",securityLevel:"write"})}async deleteIndex(e){await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/indexes/delete`,body:{index_id_to_delete:e},method:"POST",securityLevel:"write"})}setIndex(e){return new aT(this.collectionID,e,this.url,this.writeAPIKey,this.readAPIKey)}getAllDocsInCollection(e){return this.oramaInterface.request({url:"/v1/collections/list",method:"POST",body:{id:e},securityLevel:"write"})}createAnswerSession(e){if(!this.readAPIKey)throw new Error("Read API key is required to create an answer session");return new eT({url:this.url,readAPIKey:this.readAPIKey||"",collectionID:this.collectionID,...e})}async insertHook(e){let t={name:e.name,code:e.code};return await this.oramaInterface.request({url:`/v1/collections/${e.collectionID}/hooks/create`,body:t,method:"POST",securityLevel:"write"}),{hookID:t.name,collectionID:e.collectionID,code:t.code}}insertSegment(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/segments/insert`,body:e,method:"POST",securityLevel:"write"})}getSegment(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/segments/get`,body:{segment_id:e},method:"GET",securityLevel:"read-query"})}getAllSegments(){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/segments/all`,method:"GET",securityLevel:"read-query"})}deleteSegment(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/segments/delete`,body:{id:e},method:"POST",securityLevel:"write"})}updateSegment(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/segments/update`,body:e,method:"POST",securityLevel:"write"})}insertTrigger(e){if(!e.segment_id)throw new Error("You cannot insert a trigger without a segment_id");return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/triggers/insert`,body:e,method:"POST",securityLevel:"write"})}getTrigger(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/triggers/get`,body:{trigger_id:e},method:"GET",securityLevel:"read-query"})}getAllTriggers(){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/triggers/all`,method:"GET",securityLevel:"read-query"})}deleteTrigger(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/triggers/delete`,body:{id:e},method:"POST",securityLevel:"write"})}updateTrigger(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/triggers/update`,body:e,method:"POST",securityLevel:"write"})}insertSystemPrompt(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/system_prompts/insert`,body:e,method:"POST",securityLevel:"write"})}getSystemPrompt(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/system_prompts/get`,body:{system_prompt_id:e},method:"GET",securityLevel:"read"})}getAllSystemPrompts(){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/system_prompts/all`,method:"GET",securityLevel:"read-query"})}deleteSystemPrompt(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/system_prompts/delete`,body:{id:e},method:"POST",securityLevel:"write"})}updateSystemPrompt(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/system_prompts/update`,body:e,method:"POST",securityLevel:"write"})}validateSystemPrompt(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/system_prompts/validate`,body:e,method:"POST",securityLevel:"write"})}insertTool(e){let t;switch(!0){case typeof e.parameters=="string":{t=e.parameters;break}case e.parameters instanceof Qe.ZodType:{let r=gw(e.parameters);t=JSON.stringify(r);break}case typeof e.parameters=="object":{t=JSON.stringify(e.parameters);break}default:throw new Error("Invalid parameters type. Must be string, object or ZodType")}return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/tools/insert`,body:{...e,parameters:t},method:"POST",securityLevel:"write"})}getTool(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/tools/get`,body:{tool_id:e},method:"GET",securityLevel:"read-query"})}getAllTools(){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/tools/all`,method:"GET",securityLevel:"read-query"})}deleteTool(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/tools/delete`,body:{id:e},method:"POST",securityLevel:"write"})}updateTool(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/tools/update`,body:e,method:"POST",securityLevel:"write"})}async executeTools(e){let t=await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/tools/run`,body:e,method:"POST",securityLevel:"read"});return t.results?{results:t.results.map(r=>"functionResult"in r?{functionResult:{tool_id:r.functionResult.tool_id,result:JSON.parse(r.functionResult.result)}}:"functionParameters"in r?{functionParameters:{tool_id:r.functionParameters.tool_id,result:JSON.parse(r.functionParameters.result)}}:r)}:{results:null}}getIdentity(){return this.profile.getIdentity()}getUserId(){return this.profile.getUserId()}getAlias(){return this.profile.getAlias()}async identify(e){await this.profile.identify(e)}async alias(e){await this.profile.alias(e)}reset(){this.profile.reset()}},aT=class{static{l(this,"Index")}constructor(e,t,r,a,n){Object.defineProperty(this,"indexID",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"collectionID",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oramaInterface",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.indexID=t,this.collectionID=e,this.oramaInterface=new Tf({baseURL:r,writeAPIKey:a,readAPIKey:n})}async reindex(){await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/indexes/${this.indexID}/reindex`,method:"POST",securityLevel:"write"})}async insertDocuments(e){await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/indexes/${this.indexID}/insert`,body:e,method:"POST",securityLevel:"write"})}async deleteDocuments(e){await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/indexes/${this.indexID}/delete`,body:e,method:"POST",securityLevel:"write"})}async upsertDocuments(e){await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/indexes/${this.indexID}/insert`,body:e,method:"POST",securityLevel:"write"})}};l(vw,"isOramaClient");l(ww,"isOramaCoreClient");l(xw,"isOramaJSClient");_w=class{static{l(this,"Switch")}invalidClientError="Invalid client. Expected either an OramaClient, CollectionManager, or an Orama JS database.";client;clientType;isCloud=!1;isJS=!1;isCore=!1;constructor(e){switch(this.client=e,!0){case ww(e):this.clientType="core",this.isCore=!0;break;case vw(e):this.clientType="cloud",this.isCloud=!0;break;case xw(e):this.clientType="oss",this.isJS=!0;break;default:throw new Error(this.invalidClientError)}}async search(e,t){switch(!0){case this.isCloud:return this.client.search(e,t);case this.isCore:return await this.client.search(e);case this.isJS:return _f(this.client,e);default:throw new Error(this.invalidClientError)}}createAnswerSession(e){switch(!0){case this.isCloud:{let t=e;return this.client.createAnswerSession(t)}case this.isCore:{let t=e;return this.client.createAnswerSession(t)}case this.isJS:{let t=e;return new sA(this.client,{conversationID:t.conversationID,initialMessages:t.initialMessages,events:t.events,userContext:t.userContext,systemPrompt:t.systemPrompt})}default:throw new Error(this.invalidClientError)}}},nT=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r);function a(o){r[o]=e[o]&&function(s){return new Promise(function(i,c){s=e[o](s),n(i,c,s.done,s.value)})}}function n(o,s,i,c){Promise.resolve(c).then(function(u){o({value:u,done:i})},s)}},oT=l(e=>{try{return JSON.parse(e)}catch{return[]}},"parseRelatedQueries"),kw=class{static{l(this,"ChatService")}constructor(e,t,r){this.getSourcesMapObjectByIndexId=(a,n)=>{let o=Array.isArray(a)?a:[a];return o.length===1?o[0]:o.find(s=>s.datasourceId===n)||{}},this.sendQuestion=async(a,n,o,s)=>{if(!this.client)throw new Bi;let i={term:a};o?.length&&this.answerSession&&"setSystemPromptConfiguration"in this.answerSession&&this.answerSession.setSystemPromptConfiguration(o);let c=this.chatStore.state.interactions;if(!this.answerSession)try{let u=this.chatStore.state.interactions;try{this.answerSession=this.client.createAnswerSession({events:{onStateChange:l(p=>{let h=p.filter(m=>!!m.query);this.chatStore.state.interactions=[...u||[],...h.map((m,g)=>{var x;let w=p.length-1===g,k=zr.loading,C=[];m.aborted?k=zr.aborted:m.loading&&m.sources?k=zr.rendering:m.loading&&m.response?k=zr.streaming:!m.loading&&m.response&&(k=zr.done),m.sources&&(C=(Array.isArray(m.sources)?m.sources:m.sources.hits).map($=>{let L=this.getSourcesMapObjectByIndexId(this.chatStore.state.sourcesMap,$.index_id),M=this.getResultMapValue("title",L,$),O=this.getResultMapValue("description",L,$),R=this.getResultMapValue("path",L,$);return{title:M,description:O,path:R}})),w&&k===zr.done&&((x=s?.onAnswerGeneratedCallback)===null||x===void 0||x.call(s,{askParams:i,query:m.query,sources:m.sources,answer:m.response,segment:m.segment,trigger:m.trigger}));let A=m.related;return{query:m.query,interactionId:m.interactionId||m.id,response:m.response,relatedQueries:oT(A),status:k,latest:w,sources:C}})]},"onStateChange")}})}catch(p){console.error("Client does not support createAnswerSession method:",p),this.chatStore.state.interactions=[...u||[],{query:a,response:"Sorry, this client does not support chat functionality.",status:zr.error,latest:!0,sources:[]}];return}}catch(u){console.error("Error creating answer session:",u),this.chatStore.state.interactions=[...c||[],{query:a,response:"Sorry, there was an error creating the answer session. Please try again later.",status:zr.error,latest:!0,sources:[]}];return}if(!this.answerSession){console.error("Answer session was not created");return}try{this.answerSession.answer?this.askOramaCore(a,n):this.askOramaCloud(a)}catch{let u=this.chatStore.state.interactions[this.chatStore.state.interactions.length-1];u&&(u.status=zr.error,u.response="Sorry, the answer service is not available. Please try again later.",this.chatStore.state.interactions=[...this.chatStore.state.interactions])}},this.askOramaCore=(a,n)=>{console.log("askOramaCore",a,n);let o=Object.assign({query:a},n?{related:{enabled:!0,size:n,format:"query"}}:{}),s=this.answerSession.answerStream(o);l(async()=>{var i,c,u;try{for(var p=!0,h=nT(s),m;m=await h.next(),i=m.done,!i;p=!0)p=!1}catch(g){c={error:g}}finally{try{!p&&!i&&(u=h.return)&&await u.call(h)}finally{if(c)throw c.error}}},"processAsyncGenerator")()},this.askOramaCloud=a=>{let n={term:a,limit:10,threshold:.5};this.answerSession.ask(n)},this.abortAnswer=()=>{if(!this.answerSession)throw new Bi;this.answerSession.abort?this.answerSession.abort():this.answerSession.abortAnswer()},this.regenerateLatest=async()=>{if(!this.answerSession)throw new Bi;this.answerSession.regenerateLast?this.answerSession.regenerateLast({stream:!1}):this.answerSession.regenerateLast({stream:!1})},this.resetChat=async()=>{if(!this.answerSession)throw new Bi;this.chatStore.state.interactions.length<1||(["loading","rendering","streaming"].includes(this.chatStore.state.interactions[this.chatStore.state.interactions.length-1].status)&&this.abortAnswer(),this.answerSession.clearSession(),this.chatStore.state.interactions=[])},this.client=t||new _w(e),this.chatStore=r}getResultMapValue(e,t,r){let a=t?.[e];if(!a)return;if(typeof a=="function")return a(r.document,r.index_id);let n=t[e];return r.document[n]}},sT=Object.defineProperty,iT=Object.getOwnPropertyDescriptor,ol=l((e,t,r,a)=>{for(var n=a>1?void 0:a?iT(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&sT(t,r,n),n},"o$3"),yn=class extends dr{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${yn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};yn.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);yn.styles=Cr` :host { display: contents; } `;ol([be({type:String,reflect:!0})],yn.prototype,"size",2);ol([be({type:String,reflect:!0})],yn.prototype,"weight",2);ol([be({type:String,reflect:!0})],yn.prototype,"color",2);ol([be({type:Boolean,reflect:!0})],yn.prototype,"mirrored",2);yn=ol([Tr("ph-arrow-clockwise")],yn);lT=":host{display:flex;flex-grow:1}.header{background:#fbfbfb;background:var(--background-color-primary,#fbfbfb);padding:.75rem 1rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16))) var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)));text-align:end;transition:opacity .2s}.header.hidden button{opacity:0;pointer-events:none}.header button{align-items:center;background-color:transparent;border:none;border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)));cursor:pointer;display:inline-flex;font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));gap:.25rem;gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));padding:.125rem .25rem;padding:var(--spacing-2xs,calc(2rem/var(--orama-base-font-size, 16))) var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));transition:color .2s;transition:background-color .2s}.header button,.header button:hover{color:#99989d;color:var(--text-color-tertiary,#99989d)}.header button:hover{background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6)}",Sw=class{static{l(this,"ChatBox")}constructor(e){zt(this,e),this.answerGenerated=qt(this,"answerGenerated"),this.clearChat=qt(this,"clearChat"),this.startConversation=qt(this,"startConversation"),this.answerSourceClick=qt(this,"answerSourceClick"),this.chatMarkdownLinkClicked=qt(this,"chatMarkdownLinkClicked"),this.autoFocus=!0,this.clearChatOnDisconnect=!0,this.dictionary={},this.colorScheme="light",this.componentID=fd("chat-box"),this.systemScheme="light",this.onPrefersColorSchemeChange=t=>{this.systemScheme=t.matches?"dark":"light",this.updateTheme()}}getText(e){let t={chatPlaceholder:this.placeholder};return Ls(e,this.dictionary,t)}watchHandler(){this.chatStore&&(this.startChatService(),this.updateTheme())}handleTextDictionaryChange(e){if(typeof e=="string")try{this.dictionary=JSON.parse(e)}catch(t){console.error("Error parsing dictionary:",t)}}componentWillLoad(){this.htmlElement.id=this.componentID,this.schemaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.systemScheme=this.schemaQuery.matches?"dark":"light",this.updateTheme(),this.schemaQuery.addEventListener("change",this.onPrefersColorSchemeChange),this.startChatService()}componentDidLoad(){this.htmlElement.id=this.componentID,this.startChatService()}getOldOramaClient(){if(!this.oramaCoreClientInstance)return this.clientInstance?this.clientInstance:sf(this.index)}startChatService(){if(!this.index&&!this.clientInstance&&!this.oramaCoreClientInstance){console.error("Missing Index, ClientInstance or OramaCoreClientInstance");return}of(this.htmlElement,this.index,this.clientInstance,this.oramaCoreClientInstance);let e=this.getOldOramaClient();this.chatStore.state.chatService=new kw(e,this.oramaCoreClientInstance,this.chatStore),this.chatStore.state.chatService||console.error("Failed to initialize chat service")}updateTheme(){let e=md(this.htmlElement,this.colorScheme,this.systemScheme);gd(this.htmlElement,e,this.themeConfig)}connectedCallback(){this.chatStore=Xc("chat",this.componentID)}disconnectedCallback(){var e;jv(this.componentID),(e=this.schemaQuery)===null||e===void 0||e.removeEventListener("change",this.onPrefersColorSchemeChange)}render(){var e,t;if(!this.chatStore.state.chatService)return null;let r=this.colorScheme==="system"?this.systemScheme:this.colorScheme||"dark";return D(Er,{class:`theme-${r}`},D("orama-chat",{placeholder:this.getText("chatPlaceholder"),sourceBaseUrl:this.sourceBaseUrl,sourcesMap:this.sourcesMap,suggestions:this.suggestions,relatedQueries:this.relatedQueries,focusInput:this.autoFocus,systemPrompts:this.systemPrompts,prompt:this.prompt,clearChatOnDisconnect:this.clearChatOnDisconnect,chatMarkdownLinkTitle:this.chatMarkdownLinkTitle,chatMarkdownLinkHref:this.chatMarkdownLinkHref,dictionary:this.dictionary,disclaimer:this.disclaimer},!!(!((t=(e=this.chatStore.state)===null||e===void 0?void 0:e.interactions)===null||t===void 0)&&t.length)&&D("div",{slot:"chat-empty-state"},D("slot",{name:"empty-state"}))))}get htmlElement(){return Sr(this)}static get watchers(){return{index:["watchHandler"],themeConfig:["watchHandler"],colorScheme:["watchHandler"],oramaCoreClientInstance:["watchHandler"],clientInstance:["watchHandler"],dictionary:["handleTextDictionaryChange"]}}};Sw.style=lT;Iw=l(({name:e,size:t=24,color:r="black"})=>D("div",{innerHTML:l(a=>({star:` `,starFour:` `})[a]||"","getIconSvg")(e),style:{width:`${t}px`,height:`${t}px`,fill:r,display:"inline-block",verticalAlign:"middle"}}),"Icon"),cT=Object.defineProperty,dT=Object.getOwnPropertyDescriptor,sl=l((e,t,r,a)=>{for(var n=a>1?void 0:a?dT(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&cT(t,r,n),n},"a$2"),bn=class extends dr{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${bn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};bn.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);bn.styles=Cr` :host { display: contents; } `;sl([be({type:String,reflect:!0})],bn.prototype,"size",2);sl([be({type:String,reflect:!0})],bn.prototype,"weight",2);sl([be({type:String,reflect:!0})],bn.prototype,"color",2);sl([be({type:Boolean,reflect:!0})],bn.prototype,"mirrored",2);bn=sl([Tr("ph-arrow-bend-down-left")],bn);uT='@keyframes shine{0%{background-position:0 50%}to{background-position:150%;opacity:0}}@keyframes animBg{0%{background:#eee9f6;background:var(--background-color-tertiary,#eee9f6)}70%{background:#eee9f6;background:var(--background-color-tertiary,#eee9f6)}to{background:transparent}}@keyframes steam{0%{background-position:0 50%}50%{background-position:75% 50%}to{background-position:0 50%}}.sc-orama-chat-button-h{border-bottom:1px solid #dadada;border-bottom:1px solid var(--border-color-primary,#dadada);padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}.chat-button.sc-orama-chat-button{align-items:center;background:transparent;border:1px solid transparent;border-radius:.5rem;border-radius:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));color:#151515;color:var(--text-color-primary,#151515);cursor:pointer;display:flex;font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);gap:.5rem;gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));line-height:1.5;line-height:var(--font-line-height-m,1.5);margin:0;padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));position:relative;width:100%}@media (min-width:768.02px){.chat-button.sc-orama-chat-button{font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)))}}@media (hover:hover){.chat-button.sc-orama-chat-button:hover{background:#eee9f6;background:var(--background-color-tertiary,#eee9f6)}}.chat-button.sc-orama-chat-button:focus-visible{border:1px solid #432d77;border:1px solid var(--border-color-accent,#432d77);outline:none}.chat-button.is-active.sc-orama-chat-button{background:#eee9f6;background:var(--background-color-tertiary,#eee9f6)}.chat-button.is-highlighted.sc-orama-chat-button:after,.chat-button.is-highlighted.sc-orama-chat-button:before{animation:shine 1s linear 1 forwards;background:linear-gradient(90deg,transparent 0,transparent 20%,#432d77 40%,#432d77 60%,transparent 80%,transparent);background:linear-gradient(to right,var(--chat-button-border-color-gradientOne,transparent) 0,var(--chat-button-border-color-gradientTwo,transparent) 20%,var(--chat-button-border-color-gradientThree,#432d77) 40%,var(--chat-button-border-color-gradientFour,#432d77) 60%,var(--chat-button-border-color-gradientFive,transparent) 80%,var(--chat-button-border-color-gradientSix,transparent) 100%);background-size:150% auto;border-radius:.5rem;border-radius:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));content:"";display:block;height:calc(100% + 4px);left:-2px;overflow:hidden;position:absolute;top:-2px;width:calc(100% + 4px);z-index:-1}.chat-button.is-highlighted.sc-orama-chat-button:after{filter:blur(3px);height:100%;width:100%}.icon-star.sc-orama-chat-button{align-items:center;background:linear-gradient(79deg,#432d77 -45%,transparent 75%);background:linear-gradient(79deg,var(--chat-button-background-color-gradientOne,#432d77) -45%,var(--chat-button-backgroun-color-gradientTwo,transparent) 75%);background-size:200% auto;border-radius:.375rem;border-radius:var(--radius-xs,calc(6rem/var(--orama-base-font-size, 16)));display:flex;padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}.is-highlighted.sc-orama-chat-button .icon-star.sc-orama-chat-button{animation:steam 1.4s linear 1 forwards}.icon-enter.sc-orama-chat-button{align-items:center;border:.7px solid #dadada;border:.7px solid var(--border-color-primary,#dadada);border-radius:.375rem;border-radius:var(--radius-xs,calc(6rem/var(--orama-base-font-size, 16)));display:flex;justify-self:flex-end;padding:.25rem;padding:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)))}.button-label.sc-orama-chat-button{flex-grow:1;text-align:left}',Cw=class{static{l(this,"OramaChatButton")}constructor(e){zt(this,e),this.active=!1,this.highlight=!1}highlightButton(){this.active&&!this.highlight&&(this.highlight=!0)}render(){let e=["label","onClick","class"],t=Gi(this.el,e);return D(Er,{key:"cc45b1355726ff5bf65b39f4243f6f0d227d0c80",class:this.class},D("button",Object.assign({key:"4a312f0e559412dee000149b4f3cf74cfe858c0e",class:{"chat-button":!0,"is-active":this.active,"is-highlighted":this.highlight}},t,{type:"button"}),D("span",{key:"9a10019c4b275d05978ecad9abcffb058d782943",class:"icon-star"},D(Iw,{key:"82edfc1787227fb15f3fefedecf57e2a0e74d8b3",name:"star",size:16})),D("span",{key:"13e4d54e9296f513735f6081caaf060cc9511905",class:"button-label"},this.label),D("span",{key:"3c98e473b7b88034a316590bae6de3d1c1ca4dd4",class:"icon-enter"},D("ph-arrow-bend-down-left",{key:"36f9ce444b33abaef5cfdf81d0d0d2b199f8590f",size:12}))))}get el(){return Sr(this)}static get watchers(){return{active:["highlightButton"],highlight:["highlightButton"]}}};Cw.style=uT;hT="orama-chat-messages-container.sc-orama-chat-messages-container::-webkit-scrollbar{width:.3em}orama-chat-messages-container.sc-orama-chat-messages-container::-webkit-scrollbar-track{background:transparent}orama-chat-messages-container.sc-orama-chat-messages-container::-webkit-scrollbar-thumb{background-color:hsla(0,0%,70%,.522);border-radius:1rem;border-radius:var(--border-radius-l,calc(16rem/var(--orama-base-font-size, 16)))}.messages-container.sc-orama-chat-messages-container{display:flex;flex-direction:column;gap:1.5rem;gap:var(--spacing-xl,calc(24rem/var(--orama-base-font-size, 16)));margin:1rem 0;margin:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16))) 0;overflow:hidden}.suggestions-wrapper.sc-orama-chat-messages-container{margin-top:1.5rem;margin-top:var(--spacing-xl,calc(24rem/var(--orama-base-font-size, 16)))}",pT=function(e,t,r,a){var n=arguments.length,o=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(s=e[i])&&(o=(n<3?s(o):n>3?s(t,r,o):s(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o},Nf=class{static{l(this,"OramaChatMessagesContainer")}constructor(e){zt(this,e),this.answerGenerated=qt(this,"answerGenerated"),this.latestInteractionMinHeight=0,this.onSuggestionClick=t=>{var r;(r=this.chatStore.state.chatService)===null||r===void 0||r.sendQuestion(t,void 0,void 0,{onAnswerGeneratedCallback:l(a=>this.answerGenerated.emit(a),"onAnswerGeneratedCallback")})},this.resizeObserver=new ResizeObserver(t=>{this.latestInteractionMinHeight=t[0].target.clientHeight-32})}componentDidLoad(){let e=this.el.parentElement.parentElement;this.resizeObserver.observe(e)}render(){return D(Er,{key:"16faa4d865e3c1c475a099c2a537c9fcd356bf7b"},D("div",{key:"4fc29b18a434697d629e1327cffdce84d56a21c2",class:"messages-container"},this.interactions.map((e,t)=>{var r;return D("div",{key:e.interactionId,class:"interaction-wrapper",style:{minHeight:this.interactions.length>1&&t===this.interactions.length-1?`${this.latestInteractionMinHeight}px`:"0px"}},D("orama-chat-user-message",{interaction:Object.assign({},e)}),D("orama-chat-assistent-message",{interaction:Object.assign({},e),chatMarkdownLinkTitle:this.chatMarkdownLinkTitle,chatMarkdownLinkHref:this.chatMarkdownLinkHref}),e.latest&&e.status==="done"&&!!(!((r=e.relatedQueries)===null||r===void 0)&&r.length)&&D("div",{class:"suggestions-wrapper"},D("orama-suggestions",{as:"chips",suggestions:e.relatedQueries,suggestionClicked:this.onSuggestionClick})))})))}get el(){return Sr(this)}};pT([Tn("chat")],Nf.prototype,"chatStore",void 0);Nf.style=hT;fT=".sc-orama-chat-user-message-h{color:#151515;color:var(--text-color-primary,#151515);display:flex;justify-content:end;padding:0 1rem;padding:0 var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}@media (min-width:768.02px){.sc-orama-chat-user-message-h{justify-content:start}}.message-wrapper.sc-orama-chat-user-message{border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)));padding:.5rem .75rem;padding:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16))) var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)))}.chat-question.sc-orama-chat-user-message{font-weight:400}@media (min-width:768.02px){.chat-question.sc-orama-chat-user-message{font-size:1.25rem;font-size:calc(20rem/var(--orama-base-font-size, 16));margin-bottom:1rem;margin-bottom:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}}",Aw=class{static{l(this,"OramaChatUserMessage")}constructor(e){zt(this,e)}render(){return D(Er,{key:"d2c74982926525d2f01c2ced08900984662ed86d"},D("div",{key:"ee3082412dd37c9f04e3fdb2573cf2013a7d4985",class:"message-wrapper"},D("orama-text",{key:"b5da8143c4b840cfd24e1722846f2b24b5b8c433",as:"h2",styledAs:"p",class:"chat-question"},this.interaction.query)))}};Aw.style=fT;mT=".dots-loader.sc-orama-dots-loader{align-items:center;display:inline-flex;justify-content:center;padding:1rem 0;padding:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16))) 0}.dot.sc-orama-dots-loader{animation:dot-slide-up 1.4s infinite both;background-color:#151515;background-color:var(--text-color-primary,#151515);border-radius:50%;height:.25rem;height:calc(4rem/var(--orama-base-font-size, 16));margin:0 .125rem;margin:0 var(--spacing-2xs,calc(2rem/var(--orama-base-font-size, 16)));width:.25rem;width:calc(4rem/var(--orama-base-font-size, 16))}.dot.sc-orama-dots-loader:first-child{animation-delay:-.32s}.dot.sc-orama-dots-loader:nth-child(2){animation-delay:-.16s}@keyframes dot-slide-up{0%,80%,to{opacity:.3;transform:translateZ(0)}40%{opacity:1;transform:translate3d(0,-4px,0)}}",Tw=class{static{l(this,"DotsLoader")}constructor(e){zt(this,e)}render(){return D("div",{key:"8f554124861dff20b05b26410ab7966b5445c930",class:"dots-loader"},D("div",{key:"a2937b6db7c5e79d97e18149107e5eb5bb04a4bd",class:"dot"}),D("div",{key:"083f41f23dc7992e4dc601de5e118a2658a2e81a",class:"dot"}),D("div",{key:"5a5384b83cd6290e36e1ea7a27e084c82ae4316f",class:"dot"}))}};Tw.style=mT;gT=".embed.sc-orama-embed{background-color:#fbfbfb;background-color:var(--background-color-primary,#fbfbfb);border:1px solid #dadada;border:1px solid var(--border-color-primary,#dadada);border-radius:.75rem;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)));box-sizing:border-box;display:flex;flex-direction:column;height:100%;inset:0;margin:0 auto;max-height:100%;min-height:25rem;min-height:calc(400rem/var(--orama-base-font-size, 16));overflow:hidden;padding:0;width:100%}@media (min-width:1024.02px){.embed.sc-orama-embed{background-color:#fff;background-color:var(--background-color-secondary,#fff)}.embed.sc-orama-embed orama-input.sc-orama-embed{border-radius:0;margin:0;padding:0}.embed.sc-orama-embed input[type=search].sc-orama-embed{border-radius:.75rem .75rem 0 0;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16))) var(--radius-m,calc(12rem/var(--orama-base-font-size, 16))) 0 0}}",Ew=class{static{l(this,"OramaEmbed")}constructor(e){zt(this,e)}render(){return D("div",{key:"c4f1a3153fdf088695965527a5a19858b758e352",class:"embed"},D("slot",{key:"59d5f6aba110055ed97309465a5e77192bc5359f"}))}};Ew.style=gT;yT=".facets-list.sc-orama-facets{align-items:center;-moz-column-gap:.5rem;column-gap:.5rem;-moz-column-gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));column-gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));display:flex;list-style:none;margin:0;overflow-x:auto;padding:1rem;padding:var(--radius-l,calc(16rem/var(--orama-base-font-size, 16)));scroll-snap-type:y mandatory}.facets-list.sc-orama-facets::-webkit-scrollbar{background-color:transparent;height:0}@media (min-width:1024.02px){.facets-list.sc-orama-facets{padding:1rem .25rem .5rem;padding:var(--radius-l,calc(16rem/var(--orama-base-font-size, 16))) var(--radius-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)))}}.facet.sc-orama-facets{scroll-snap-align:start}.facet-button.sc-orama-facets{background-color:transparent;border:1px solid #dadada;border:1px solid var(--border-color-primary,#dadada);border-radius:2.5rem;border-radius:var(--radius-3xl,calc(40rem/var(--orama-base-font-size, 16)));color:#151515;color:var(--text-color-primary,#151515);-moz-column-gap:.25rem;column-gap:.25rem;-moz-column-gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));column-gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));cursor:pointer;display:flex;font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.25;line-height:var(--font-line-height-s,1.25);margin:0;padding:.5rem .75rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));width:-moz-max-content;width:max-content}.facet-button--selected.sc-orama-facets{border-color:#432d77;border-color:var(--border-color-accent,#432d77)}@media (min-width:1024.02px){.facet-button.sc-orama-facets{padding:.25rem .75rem;padding:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}}.facet-button.sc-orama-facets:focus{border-color:#432d77;border-color:var(--border-color-accent,#432d77);outline:1px solid #432d77;outline:1px solid var(--border-color-accent,#432d77)}.facet-count.sc-orama-facets{color:#99989d;color:var(--text-color-tertiary,#99989d)}",$w=class{static{l(this,"OramaFacets")}constructor(e){zt(this,e)}handleClick(e){this.selectedFacetChanged(e.name)}getFacetButtonElementId(e){return`${e}-facet-button`}setFocusToFacetElement(e){let t=this.facetListRef.getElementsByTagName("button");for(let r=0;rr.name===this.selectedFacet):0;e.key==="ArrowRight"&&(t1?this.selectedFacetChanged(this.facets[t-1].name):t-1===0?this.selectedFacetChanged(""):this.selectedFacetChanged(this.facets[this.facets.length-1].name))}}render(){var e;return!this.facets||this.facets.every(t=>!t.count)?null:D("ul",{class:"facets-list",ref:l(t=>this.facetListRef=t,"ref")},(e=this.facets)===null||e===void 0?void 0:e.map(t=>{if(t?.count===0)return;let r=this.selectedFacet===t?.name||!this.selectedFacet&&t?.name==="All";return D("li",{key:t.name,class:"facet"},D("button",{id:this.getFacetButtonElementId(t.name),type:"button",class:{"facet-button":!0,"facet-button--selected":r},tabIndex:r?0:-1,onClick:l(()=>this.handleClick(t),"onClick")},t?.name,D("span",{class:"facet-count"},t?.count)))}))}static get watchers(){return{selectedFacet:["handleSelectedFacetChange"]}}};$w.style=yT;bT=Object.defineProperty,vT=Object.getOwnPropertyDescriptor,il=l((e,t,r,a)=>{for(var n=a>1?void 0:a?vT(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&bT(t,r,n),n},"o$2"),vn=class extends dr{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${vn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};vn.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);vn.styles=Cr` :host { display: contents; } `;il([be({type:String,reflect:!0})],vn.prototype,"size",2);il([be({type:String,reflect:!0})],vn.prototype,"weight",2);il([be({type:String,reflect:!0})],vn.prototype,"color",2);il([be({type:Boolean,reflect:!0})],vn.prototype,"mirrored",2);vn=il([Tr("ph-arrow-up")],vn);wT=".sc-orama-footer-h{align-items:center;background-color:#fff;background-color:var(--background-color-secondary,#fff);border-radius:0 0 .75rem .75rem;border-radius:0 0 var(--radius-m,calc(12rem/var(--orama-base-font-size, 16))) var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)));border-top:1px solid #dadada;border-top:1px solid var(--border-color-primary,#dadada);display:flex;justify-content:space-between;padding:.75rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}.keyboard-shortcuts.sc-orama-footer{align-items:center;display:flex;gap:.75rem;gap:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}.shortcut-item.sc-orama-footer{align-items:center;display:flex;font-size:1rem;font-size:calc(16rem/var(--orama-base-font-size, 16));gap:.25rem;gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)))}.shortcut-description.sc-orama-footer,.shortcut-icon.sc-orama-footer{color:#99989d;color:var(--text-color-tertiary,#99989d)}.shortcut-icon.sc-orama-footer{align-items:center;background:#eee9f6;background:var(--background-color-fourth,#eee9f6);border:.7px solid #dadada;border:.7px solid var(--border-color-primary,#dadada);border-radius:.375rem;border-radius:var(--radius-xs,calc(6rem/var(--orama-base-font-size, 16)));display:flex;justify-content:center;justify-self:flex-end;padding:.25rem;padding:calc(4rem/var(--orama-base-font-size, 16))}.arrows-container.sc-orama-footer{align-items:center;display:flex;gap:.25rem;gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)))}.esc-text.sc-orama-footer{font-size:.7rem}.powered-by.sc-orama-footer{align-items:flex-end;display:flex;flex-grow:1;justify-content:right;text-align:right}.logo-link.sc-orama-footer,.powered-by.sc-orama-footer{gap:.5rem;gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}.logo-link.sc-orama-footer{align-items:center;display:inline-flex;justify-content:center;text-decoration:none}.logo-link.sc-orama-footer:focus-visible{border:1px solid #432d77;border:1px solid var(--border-color-accent,#432d77);outline:none}.logo.sc-orama-footer{max-width:3.875rem;max-width:calc(62rem/var(--orama-base-font-size, 16))}@media (max-width:768px){.sc-orama-footer-h{flex-direction:column;gap:.75rem;gap:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}.keyboard-shortcuts.sc-orama-footer{display:none}.powered-by.sc-orama-footer{justify-content:center}}",Pw=class{static{l(this,"OramaFooter")}constructor(e){zt(this,e),this.colorScheme="light",this.showKeyboardShortcuts=!1,this.linkTarget="_blank",this.keyboardShortcuts=[{name:"select",key:"Enter",icon:"arrow-bend-down-left",description:"to select"},{name:"navigate",key:"\u2191 \u2193",icon:"arrows-vertical",description:"to navigate"},{name:"close",key:"Esc",icon:"esc",description:"to close"}]}componentWillLoad(){let e=encodeURIComponent(window.location.hostname);this.poweredByDestinationUrl=`https://www.orama.com/?utm_source=${e}&utm_medium=powered-by`,["localhost","orama.com"].includes(e)&&(this.linkTarget="_parent")}renderIcon(e){if(e.icon==="esc")return D("div",null,D("span",{class:"shortcut-icon"},D("span",{class:"esc-text"},"esc")));switch(e.icon){case"arrow-bend-down-left":return D("span",{class:"shortcut-icon"},D("ph-arrow-bend-down-left",{size:16}));case"arrows-vertical":return D("div",{class:"arrows-container"},D("span",{class:"shortcut-icon"},D("ph-arrow-up",{size:16})),D("span",{class:"shortcut-icon"},D("ph-arrow-down",{size:16})));default:return null}}render(){let e=this.colorScheme==="dark"?"orama-when-dark.svg":"orama-when-light.svg";return D(Er,{key:"b21ad31b55a56c189efdf83b7f745dfc149af388"},this.showKeyboardShortcuts&&D("div",{key:"0af21a82002e38855e83176b7e6dc0f2e8aebe8b",class:"keyboard-shortcuts","aria-label":"Keyboard shortcuts"},this.keyboardShortcuts.map(t=>D("div",{class:"shortcut-item"},this.renderIcon(t),D("orama-text",{as:"small",variant:"tertiary"},D("span",{class:"shortcut-description"},t.description))))),D("div",{key:"67dec2fc22297ff7a7f47eb4e112b14a3801c378",class:"powered-by"},D("a",{key:"ef8d9ea69bb7207ea1279ede9576e4cb03d4cf12",href:this.poweredByDestinationUrl,target:this.linkTarget,rel:"noopener noreferrer",class:"logo-link"},D("orama-text",{key:"49bcbd36198dfd2200d6902f65ea88f573974c4e",as:"small"},"Powered by"),D("img",{key:"f8d46510486a83866fa3b24f5d38f60fe8ce3d6b",src:`https://website-assets.oramasearch.com/${e}`,alt:"Powered by Orama",class:"logo",width:62}))))}get el(){return Sr(this)}};Pw.style=wT;xT=Object.defineProperty,_T=Object.getOwnPropertyDescriptor,ll=l((e,t,r,a)=>{for(var n=a>1?void 0:a?_T(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&xT(t,r,n),n},"o$1"),wn=class extends dr{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${wn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};wn.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);wn.styles=Cr` :host { display: contents; } `;ll([be({type:String,reflect:!0})],wn.prototype,"size",2);ll([be({type:String,reflect:!0})],wn.prototype,"weight",2);ll([be({type:String,reflect:!0})],wn.prototype,"color",2);ll([be({type:Boolean,reflect:!0})],wn.prototype,"mirrored",2);wn=ll([Tr("ph-x")],wn);kT=Object.defineProperty,ST=Object.getOwnPropertyDescriptor,cl=l((e,t,r,a)=>{for(var n=a>1?void 0:a?ST(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&kT(t,r,n),n},"s$3"),xn=class extends dr{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${xn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};xn.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);xn.styles=Cr` :host { display: contents; } `;cl([be({type:String,reflect:!0})],xn.prototype,"size",2);cl([be({type:String,reflect:!0})],xn.prototype,"weight",2);cl([be({type:String,reflect:!0})],xn.prototype,"color",2);cl([be({type:Boolean,reflect:!0})],xn.prototype,"mirrored",2);xn=cl([Tr("ph-magnifying-glass")],xn);IT=".sc-orama-input-h{margin:.5rem 0;margin:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) 0}.input-wrapper.sc-orama-input{position:relative}.input.sc-orama-input{background:#fff;background:var(--background-color-secondary,#fff);border:1px solid #dadada;border:1px solid var(--border-color-primary,#dadada);border-radius:.75rem;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)));color:#151515;color:var(--text-color-primary,#151515);font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.5;line-height:var(--font-line-height-m,1.5);margin:0;padding:0;width:100%}@media (min-width:768.02px){.input.sc-orama-input{font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)))}}.input.sc-orama-input::-moz-placeholder{color:#99989d;color:var(--text-color-inactive,#99989d)}.input.sc-orama-input::placeholder{color:#99989d;color:var(--text-color-inactive,#99989d)}.input[type=search].sc-orama-input{padding-right:2rem;padding-right:var(--spacing-2xl,calc(32rem/var(--orama-base-font-size, 16)))}@media (min-width:1024.02px){.input[type=search].sc-orama-input{border:0;border-bottom:1px solid #dadada;border-bottom:1px solid var(--border-color-primary,#dadada);padding-left:2.5rem;padding-left:var(--spacing-3xl,calc(40rem/var(--orama-base-font-size, 16)))}}.input[type=search].sc-orama-input::-webkit-search-cancel-button,.input[type=search].sc-orama-input::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.input.sc-orama-input:focus{outline:none}.input.sc-orama-input:focus-visibile{border:1px solid #432d77;border:1px solid var(--border-color-accent,#432d77);outline:none}.input--small.sc-orama-input{padding:.25rem .5rem;padding:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}.input--medium.sc-orama-input{padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}.input--large.sc-orama-input{padding:.75rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}.label.sc-orama-input{color:#151515;color:var(--text-color-primary,#151515);display:block;font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.25;line-height:var(--font-line-height-s,1.25);margin:0 0 .25rem;margin-bottom:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));padding:0}.reset-button.sc-orama-input{background-color:transparent;border:0;color:#99989d;color:var(--icon-color-inactive,#99989d);cursor:pointer;display:inline-flex;position:absolute;right:.5rem;right:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));top:50%;transform:translate3d(0,-50%,0)}.reset-button.sc-orama-input:focus{outline:none}.reset-button.sc-orama-input:focus-visible{border:1px solid #432d77;border:1px solid var(--border-color-accent,#432d77)}.search-icon.sc-orama-input{color:#99989d;color:var(--icon-color-inactive,#99989d);display:none;left:1rem;left:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)));position:absolute;top:50%;transform:translate3d(0,-50%,0);z-index:100}@media (min-width:1024.02px){.search-icon.sc-orama-input{display:inline-flex}}.sr-only.sc-orama-input{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}",Ow=class{static{l(this,"Input")}constructor(e){zt(this,e),this.inputChanged=qt(this,"inputChanged"),this.size="medium",this.type="text",this.autoFocus=!1}handleAutoFocusChange(){var e;this.autoFocus&&((e=this.inputRef)===null||e===void 0||e.focus())}ensureFocus(){let e=setInterval(()=>{this.inputRef&&(this.inputRef.focus(),clearInterval(e))},10)}componentDidLoad(){this.autoFocus&&this.ensureFocus()}render(){let e=`input input--${this.size}`,t=`label ${this.labelForScreenReaders?"sr-only":""}`,r=["id","name","type","class","onInput","value","label-for-screen-readers","default-value","placeholder"],a=Gi(this.el,r),n=this.type==="search";return D(Er,{key:"2618def598b4bcffcb974d761937c304f36d70cf"},D("div",{key:"07b0b637d645dfcd43dab6f20256b548f42672bb",class:"wrapper"},D("label",{key:"c8e3e0ee0962064c613ccbfa459873e8e80ee32a",htmlFor:this.name,class:t},this.label||this.labelForScreenReaders),D("div",{key:"7c78f6d5e491b17094d86ef89c4461178e1e620c",class:"input-wrapper"},n&&D("span",{key:"07a43ba5606596d2b2834bb3dc040573d7039a05",class:"search-icon"},D("ph-magnifying-glass",{key:"3097468ab3864e7a29121e5f5978cf6f4a14f006",size:16})),D("input",Object.assign({key:"5ee32af4e927d3f717345a2d2337793ba28d9c43"},a,{ref:l(o=>{this.inputRef=o},"ref"),class:e,id:this.name,type:this.type,value:this.value,onInput:l(o=>{let s=o.target;this.inputChanged.emit(s.value)},"onInput"),placeholder:this.placeholder})),n&&!!this.value&&D("button",{key:"36eb9d184140ee98115527b8470ef60c3a32aae3",type:"button",class:"reset-button",onClick:l(()=>{var o;this.inputRef&&(this.inputRef.value=""),this.inputChanged.emit(""),(o=this.inputRef)===null||o===void 0||o.focus()},"onClick")},D("ph-x",{key:"0a50b53d7cf5e86ed30d72c6e099f1dcc35ed925",size:16})))))}get el(){return Sr(this)}static get watchers(){return{autoFocus:["handleAutoFocusChange"]}}};Ow.style=IT;CT=["1c","abnf","accesslog","ada","arduino","ino","armasm","arm","avrasm","actionscript","as","angelscript","asc","apache","apacheconf","applescript","osascript","arcade","asciidoc","adoc","aspectj","autohotkey","autoit","awk","mawk","nawk","gawk","bash","sh","zsh","basic","bnf","brainfuck","bf","csharp","cs","c","h","cpp","hpp","cc","hh","c++","h++","cxx","hxx","cal","cos","cls","cmake","cmake.in","coq","csp","css","capnproto","capnp","clojure","clj","coffeescript","coffee","cson","iced","crmsh","crm","pcmk","crystal","cr","d","dart","dpr","dfm","pas","pascal","diff","patch","django","jinja","dns","zone","bind","dockerfile","docker","dos","bat","cmd","dsconfig","dts","dust","dst","ebnf","elixir","elm","erlang","erl","excel","xls","xlsx","fsharp","fs","fsx","fsi","fsscript","fix","fortran","f90","f95","gcode","nc","gams","gms","gauss","gss","gherkin","go","golang","golo","gololang","gradle","graphql","gql","groovy","xml","html","xhtml","rss","atom","xjb","xsd","xsl","plist","svg","http","https","haml","handlebars","hbs","html.hbs","html.handlebars","haskell","hs","haxe","hx","hy","hylang","ini","toml","inform7","i7","irpf90","json","jsonc","java","jsp","javascript","js","jsx","julia","jl","julia-repl","kotlin","kt","tex","leaf","lasso","ls","lassoscript","less","ldif","lisp","livecodeserver","livescript","ls","lua","makefile","mk","mak","make","markdown","md","mkdown","mkd","mathematica","mma","wl","matlab","maxima","mel","mercury","mips","mipsasm","mizar","mojolicious","monkey","moonscript","moon","n1ql","nsis","nginx","nginxconf","nim","nimrod","nix","ocaml","ml","objectivec","mm","objc","obj-c","obj-c++","objective-c++","glsl","openscad","scad","ruleslanguage","oxygene","pf","pf.conf","php","parser3","perl","pl","pm","plaintext","txt","text","pony","pgsql","postgres","postgresql","powershell","ps","ps1","processing","prolog","properties","proto","protobuf","puppet","pp","python","py","gyp","profile","python-repl","pycon","k","kdb","qml","r","reasonml","re","rib","rsl","graph","instances","ruby","rb","gemspec","podspec","thor","irb","rust","rs","SAS","sas","scss","sql","p21","step","stp","scala","scheme","scilab","sci","shell","console","smali","smalltalk","st","sml","ml","stan","stanfuncs","stata","stylus","styl","subunit","swift","tcl","tk","tap","thrift","tp","twig","craftcms","typescript","ts","tsx","mts","cts","vbnet","vb","vbscript","vbs","vhdl","vala","verilog","v","vim","axapta","x++","x86asm","xl","tao","xquery","xpath","xq","xqm","yml","yaml","zephir","zep"],{entries:Rw,setPrototypeOf:ov,isFrozen:AT,getPrototypeOf:TT,getOwnPropertyDescriptor:ET}=Object,{freeze:Yr,seal:xa,create:Lw}=Object,{apply:Wp,construct:qp}=typeof Reflect<"u"&&Reflect;Yr||(Yr=l(function(e){return e},"freeze"));xa||(xa=l(function(e){return e},"seal"));Wp||(Wp=l(function(e,t,r){return e.apply(t,r)},"apply"));qp||(qp=l(function(e,t){return new e(...t)},"construct"));Kc=Zr(Array.prototype.forEach),$T=Zr(Array.prototype.lastIndexOf),sv=Zr(Array.prototype.pop),Mi=Zr(Array.prototype.push),PT=Zr(Array.prototype.splice),rd=Zr(String.prototype.toLowerCase),bp=Zr(String.prototype.toString),iv=Zr(String.prototype.match),Ni=Zr(String.prototype.replace),OT=Zr(String.prototype.indexOf),RT=Zr(String.prototype.trim),Ra=Zr(Object.prototype.hasOwnProperty),Gr=Zr(RegExp.prototype.test),Di=Mw(TypeError);l(Zr,"unapply");l(Mw,"unconstruct");l(ot,"addToSet");l(Nw,"cleanArray");l(so,"clone");l(Ts,"lookupGetter");lv=Yr(["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"]),vp=Yr(["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"]),wp=Yr(["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"]),LT=Yr(["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"]),xp=Yr(["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"]),MT=Yr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),cv=Yr(["#text"]),dv=Yr(["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"]),_p=Yr(["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"]),uv=Yr(["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"]),Gc=Yr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),NT=xa(/\{\{[\w\W]*|[\w\W]*\}\}/gm),DT=xa(/<%[\w\W]*|[\w\W]*%>/gm),zT=xa(/\$\{[\w\W]*/gm),ZT=xa(/^data-[\-\w.\u00B7-\uFFFF]+$/),jT=xa(/^aria-[\-\w]+$/),Dw=xa(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),BT=xa(/^(?:\w+script|data):/i),HT=xa(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),zw=xa(/^html$/i),UT=xa(/^[a-z][.\w]*(-[.\w]+)+$/i),hv=Object.freeze({__proto__:null,ARIA_ATTR:jT,ATTR_WHITESPACE:HT,CUSTOM_ELEMENT:UT,DATA_ATTR:ZT,DOCTYPE_NAME:zw,ERB_EXPR:DT,IS_ALLOWED_URI:Dw,IS_SCRIPT_OR_DATA:BT,MUSTACHE_EXPR:NT,TMPLIT_EXPR:zT}),zi={element:1,text:3,progressingInstruction:7,comment:8,document:9},VT=l(function(){return typeof window>"u"?null:window},"getGlobal"),FT=l(function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,a="data-tt-policy-suffix";t&&t.hasAttribute(a)&&(r=t.getAttribute(a));let n="dompurify"+(r?"#"+r:"");try{return e.createPolicy(n,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+n+" could not be created."),null}},"_createTrustedTypesPolicy"),pv=l(function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},"_createHooksMap");l(Df,"createDOMPurify");Kp=Df();l(jw,"requireCore");WT=jw(),cd=c2(WT);l(Ad,"_getDefaults");zo=Ad();l(zf,"changeDefaults");Bw=/[&<>"']/,qT=new RegExp(Bw.source,"g"),Hw=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,KT=new RegExp(Hw.source,"g"),GT={"&":"&","<":"<",">":">",'"':""","'":"'"},mv=l(e=>GT[e],"getEscapeReplacement");l(aa,"escape$1");YT=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;l(Uw,"unescape");QT=/(^|[^\[])\^/g;l(Nt,"edit");l(Gp,"cleanUrl");Fi={exec:l(()=>null,"exec")};l(Yp,"splitCells");l(Es,"rtrim");l(Vw,"findClosingBracket");l(Qp,"outputLink");l(Fw,"indentCodeCompensation");dd=class{static{l(this,"_Tokenizer")}options;rules;lexer;constructor(e){this.options=e||zo}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let r=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Es(r,` `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],a=Fw(r,t[3]||"");return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:a}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(/#$/.test(r)){let a=Es(r,"#");(this.options.pedantic||!a||/ $/.test(a))&&(r=a.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Es(t[0],` `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=Es(t[0],` `).split(` `),a="",n="",o=[];for(;r.length>0;){let s=!1,i=[],c;for(c=0;c/.test(r[c]))i.push(r[c]),s=!0;else if(!s)i.push(r[c]);else break;r=r.slice(c);let u=i.join(` `),p=u.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,` $1`).replace(/^ {0,3}>[ \t]?/gm,"");a=a?`${a} ${u}`:u,n=n?`${n} ${p}`:p;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,o,!0),this.lexer.state.top=h,r.length===0)break;let m=o[o.length-1];if(m?.type==="code")break;if(m?.type==="blockquote"){let g=m,x=g.raw+` `+r.join(` `),w=this.blockquote(x);o[o.length-1]=w,a=a.substring(0,a.length-g.raw.length)+w.raw,n=n.substring(0,n.length-g.text.length)+w.text;break}else if(m?.type==="list"){let g=m,x=g.raw+` `+r.join(` `),w=this.list(x);o[o.length-1]=w,a=a.substring(0,a.length-m.raw.length)+w.raw,n=n.substring(0,n.length-g.raw.length)+w.raw,r=x.substring(o[o.length-1].raw.length).split(` `);continue}}return{type:"blockquote",raw:a,tokens:o,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),a=r.length>1,n={type:"list",raw:"",ordered:a,start:a?+r.slice(0,-1):"",loose:!1,items:[]};r=a?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=a?r:"[*+-]");let o=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),s=!1;for(;e;){let i=!1,c="",u="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let p=t[2].split(` `,1)[0].replace(/^\t+/,k=>" ".repeat(3*k.length)),h=e.split(` `,1)[0],m=!p.trim(),g=0;if(this.options.pedantic?(g=2,u=p.trimStart()):m?g=t[1].length+1:(g=t[2].search(/[^ ]/),g=g>4?1:g,u=p.slice(g),g+=t[1].length),m&&/^ *$/.test(h)&&(c+=h+` `,e=e.substring(h.length+1),i=!0),!i){let k=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),C=new RegExp(`^ {0,${Math.min(3,g-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),A=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:\`\`\`|~~~)`),$=new RegExp(`^ {0,${Math.min(3,g-1)}}#`);for(;e;){let L=e.split(` `,1)[0];if(h=L,this.options.pedantic&&(h=h.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),A.test(h)||$.test(h)||k.test(h)||C.test(e))break;if(h.search(/[^ ]/)>=g||!h.trim())u+=` `+h.slice(g);else{if(m||p.search(/[^ ]/)>=4||A.test(p)||$.test(p)||C.test(p))break;u+=` `+h}!m&&!h.trim()&&(m=!0),c+=L+` `,e=e.substring(L.length+1),p=h.slice(g)}}n.loose||(s?n.loose=!0:/\n *\n *$/.test(c)&&(s=!0));let x=null,w;this.options.gfm&&(x=/^\[[ xX]\] /.exec(u),x&&(w=x[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),n.items.push({type:"list_item",raw:c,task:!!x,checked:w,loose:!1,text:u,tokens:[]}),n.raw+=c}n.items[n.items.length-1].raw=n.items[n.items.length-1].raw.trimEnd(),n.items[n.items.length-1].text=n.items[n.items.length-1].text.trimEnd(),n.raw=n.raw.trimEnd();for(let i=0;ip.type==="space"),u=c.length>0&&c.some(p=>/\n.*\n/.test(p.raw));n.loose=u}if(n.loose)for(let i=0;i$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:a,title:n}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let r=Yp(t[1]),a=t[2].replace(/^\||\| *$/g,"").split("|"),n=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(` `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let s of a)/^ *-+: *$/.test(s)?o.align.push("right"):/^ *:-+: *$/.test(s)?o.align.push("center"):/^ *:-+ *$/.test(s)?o.align.push("left"):o.align.push(null);for(let s=0;s({text:i,tokens:this.lexer.inline(i),header:!1,align:o.align[c]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===` `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:aa(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&/^$/.test(r))return;let o=Es(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=Vw(t[2],"()");if(o>-1){let s=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,s).trim(),t[3]=""}}let a=t[2],n="";if(this.options.pedantic){let o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);o&&(a=o[1],n=o[3])}else n=t[3]?t[3].slice(1,-1):"";return a=a.trim(),/^$/.test(r)?a=a.slice(1):a=a.slice(1,-1)),Qp(t,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let a=(r[2]||r[1]).replace(/\s+/g," "),n=t[a.toLowerCase()];if(!n){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return Qp(r,n,r[0],this.lexer)}}emStrong(e,t,r=""){let a=this.rules.inline.emStrongLDelim.exec(e);if(!(!a||a[3]&&r.match(/[\p{L}\p{N}]/u))&&(!(a[1]||a[2])||!r||this.rules.inline.punctuation.exec(r))){let n=[...a[0]].length-1,o,s,i=n,c=0,u=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+n);(a=u.exec(t))!=null;){if(o=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!o)continue;if(s=[...o].length,a[3]||a[4]){i+=s;continue}else if((a[5]||a[6])&&n%3&&!((n+s)%3)){c+=s;continue}if(i-=s,i>0)continue;s=Math.min(s,s+i+c);let p=[...a[0]][0].length,h=e.slice(0,n+a.index+p+s);if(Math.min(n,s)%2){let g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}let m=h.slice(2,-2);return{type:"strong",raw:h,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(/\n/g," "),a=/[^ ]/.test(r),n=/^ /.test(r)&&/ $/.test(r);return a&&n&&(r=r.substring(1,r.length-1)),r=aa(r,!0),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let r,a;return t[2]==="@"?(r=aa(t[1]),a="mailto:"+r):(r=aa(t[1]),a=r),{type:"link",raw:t[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,a;if(t[2]==="@")r=aa(t[0]),a="mailto:"+r;else{let n;do n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(n!==t[0]);r=aa(t[0]),t[1]==="www."?a="http://"+t[0]:a=t[0]}return{type:"link",raw:t[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let r;return this.lexer.state.inRawBlock?r=t[0]:r=aa(t[0]),{type:"text",raw:t[0],text:r}}}},XT=/^(?: *(?:\n|$))+/,JT=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,eE=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,dl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tE=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ww=/(?:[*+-]|\d{1,9}[.)])/,qw=Nt(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Ww).replace(/blockCode/g,/ {4}/).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/).getRegex(),Zf=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rE=/^[^\n]+/,jf=/(?!\s*\])(?:\\.|[^\[\]\\])+/,aE=Nt(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",jf).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),nE=Nt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ww).getRegex(),Td="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",Bf=/|$))/,oE=Nt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Bf).replace("tag",Td).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kw=Nt(Zf).replace("hr",dl).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",")|<(?:script|pre|style|textarea|!--)").replace("tag",Td).getRegex(),sE=Nt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kw).getRegex(),Hf={blockquote:sE,code:JT,def:aE,fences:eE,heading:tE,hr:dl,html:oE,lheading:qw,list:nE,newline:XT,paragraph:Kw,table:Fi,text:rE},gv=Nt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",dl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Td).getRegex(),iE={...Hf,table:gv,paragraph:Nt(Zf).replace("hr",dl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gv).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Td).getRegex()},lE={...Hf,html:Nt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Bf).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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Fi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Nt(Zf).replace("hr",dl).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",qw).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Gw=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,cE=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Yw=/^( {2,}|\\)\n(?!\s*$)/,dE=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,pE=Nt(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,ul).getRegex(),fE=Nt("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,ul).getRegex(),mE=Nt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,ul).getRegex(),gE=Nt(/\\([punct])/,"gu").replace(/punct/g,ul).getRegex(),yE=Nt(/^<(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(),bE=Nt(Bf).replace("(?:-->|$)","-->").getRegex(),vE=Nt("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",bE).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ud=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,wE=Nt(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ud).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Qw=Nt(/^!?\[(label)\]\[(ref)\]/).replace("label",ud).replace("ref",jf).getRegex(),Xw=Nt(/^!?\[(ref)\](?:\[\])?/).replace("ref",jf).getRegex(),xE=Nt("reflink|nolink(?!\\()","g").replace("reflink",Qw).replace("nolink",Xw).getRegex(),Uf={_backpedal:Fi,anyPunctuation:gE,autolink:yE,blockSkip:hE,br:Yw,code:cE,del:Fi,emStrongLDelim:pE,emStrongRDelimAst:fE,emStrongRDelimUnd:mE,escape:Gw,link:wE,nolink:Xw,punctuation:uE,reflink:Qw,reflinkSearch:xE,tag:vE,text:dE,url:Fi},_E={...Uf,link:Nt(/^!?\[(label)\]\((.*?)\)/).replace("label",ud).getRegex(),reflink:Nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ud).getRegex()},Xp={...Uf,escape:Nt(Gw).replace("])","~|])").getRegex(),url:Nt(/^((?: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\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\c+" ".repeat(u.length));let n,o,s;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(i=>(n=i.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length),n.raw.length===1&&r.length>0?r[r.length-1].raw+=` `:r.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=` `+n.raw,o.text+=` `+n.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=` `+n.raw,o.text+=` `+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(s=t,this.options.extensions&&this.options.extensions.startBlock){let i=1/0,c=t.slice(1),u;this.options.extensions.startBlock.forEach(p=>{u=p.call({lexer:this},c),typeof u=="number"&&u>=0&&(i=Math.min(i,u))}),i<1/0&&i>=0&&(s=t.substring(0,i+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s))){o=r[r.length-1],a&&o?.type==="paragraph"?(o.raw+=` `+n.raw,o.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n),a=s.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&o.type==="text"?(o.raw+=` `+n.raw,o.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(t){let i="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let a,n,o,s=t,i,c,u;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,i.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(c||(u=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(p=>(a=p.call({lexer:this},t,r))?(t=t.substring(a.raw.length),r.push(a),!0):!1))){if(a=this.tokenizer.escape(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.tag(t)){t=t.substring(a.raw.length),n=r[r.length-1],n&&a.type==="text"&&n.type==="text"?(n.raw+=a.raw,n.text+=a.text):r.push(a);continue}if(a=this.tokenizer.link(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(a.raw.length),n=r[r.length-1],n&&a.type==="text"&&n.type==="text"?(n.raw+=a.raw,n.text+=a.text):r.push(a);continue}if(a=this.tokenizer.emStrong(t,s,u)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.codespan(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.br(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.del(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.autolink(t)){t=t.substring(a.raw.length),r.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(t))){t=t.substring(a.raw.length),r.push(a);continue}if(o=t,this.options.extensions&&this.options.extensions.startInline){let p=1/0,h=t.slice(1),m;this.options.extensions.startInline.forEach(g=>{m=g.call({lexer:this},h),typeof m=="number"&&m>=0&&(p=Math.min(p,m))}),p<1/0&&p>=0&&(o=t.substring(0,p+1))}if(a=this.tokenizer.inlineText(o)){t=t.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(u=a.raw.slice(-1)),c=!0,n=r[r.length-1],n&&n.type==="text"?(n.raw+=a.raw,n.text+=a.text):r.push(a);continue}if(t){let p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return r}},hd=class{static{l(this,"_Renderer")}options;parser;constructor(e){this.options=e||zo}space(e){return""}code({text:e,lang:t,escaped:r}){let a=(t||"").match(/^\S*/)?.[0],n=e.replace(/\n$/,"")+` `;return a?'
'+(r?n:aa(n,!0))+`
`:"
"+(r?n:aa(n,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} `}hr(e){return`
`}list(e){let t=e.ordered,r=e.start,a="";for(let s=0;s `+a+" `}listitem(e){let t="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" "}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • `}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    `}table(e){let t="",r="";for(let n=0;n${a}`),` `+t+` `+a+`
    `}tablerow({text:e}){return` ${e} `}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+` `}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${e}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:r}){let a=this.parser.parseInline(r),n=Gp(e);if(n===null)return a;e=n;let o='
    ",o}image({href:e,title:t,text:r}){let a=Gp(e);if(a===null)return r;e=a;let n=`${r}{let s=n[o].flat(1/0);r=r.concat(this.walkTokens(s,t))}):n.tokens&&(r=r.concat(this.walkTokens(n.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let a={...r};if(a.async=this.defaults.async||a.async||!1,r.extensions&&(r.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let o=t.renderers[n.name];o?t.renderers[n.name]=function(...s){let i=n.renderer.apply(this,s);return i===!1&&(i=o.apply(this,s)),i}:t.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[n.level];o?o.unshift(n.tokenizer):t[n.level]=[n.tokenizer],n.start&&(n.level==="block"?t.startBlock?t.startBlock.push(n.start):t.startBlock=[n.start]:n.level==="inline"&&(t.startInline?t.startInline.push(n.start):t.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(t.childTokens[n.name]=n.childTokens)}),a.extensions=t),r.renderer){let n=this.defaults.renderer||new hd(this.defaults);for(let o in r.renderer){if(!(o in n))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let s=o,i=r.renderer[s];r.useNewRenderer||(i=this.#t(i,s,n));let c=n[s];n[s]=(...u)=>{let p=i.apply(n,u);return p===!1&&(p=c.apply(n,u)),p||""}}a.renderer=n}if(r.tokenizer){let n=this.defaults.tokenizer||new dd(this.defaults);for(let o in r.tokenizer){if(!(o in n))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let s=o,i=r.tokenizer[s],c=n[s];n[s]=(...u)=>{let p=i.apply(n,u);return p===!1&&(p=c.apply(n,u)),p}}a.tokenizer=n}if(r.hooks){let n=this.defaults.hooks||new ad;for(let o in r.hooks){if(!(o in n))throw new Error(`hook '${o}' does not exist`);if(o==="options")continue;let s=o,i=r.hooks[s],c=n[s];ad.passThroughHooks.has(o)?n[s]=u=>{if(this.defaults.async)return Promise.resolve(i.call(n,u)).then(h=>c.call(n,h));let p=i.call(n,u);return c.call(n,p)}:n[s]=(...u)=>{let p=i.apply(n,u);return p===!1&&(p=c.apply(n,u)),p}}a.hooks=n}if(r.walkTokens){let n=this.defaults.walkTokens,o=r.walkTokens;a.walkTokens=function(s){let i=[];return i.push(o.call(this,s)),n&&(i=i.concat(n.call(this,s))),i}}this.defaults={...this.defaults,...a}}),this}#t(e,t,r){switch(t){case"heading":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,r.parser.parseInline(a.tokens),a.depth,Uw(r.parser.parseInline(a.tokens,r.parser.textRenderer)))};case"code":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,a.text,a.lang,!!a.escaped)};case"table":return function(a){if(!a.type||a.type!==t)return e.apply(this,arguments);let n="",o="";for(let i=0;i0&&u.tokens[0].type==="paragraph"?(u.tokens[0].text=g+" "+u.tokens[0].text,u.tokens[0].tokens&&u.tokens[0].tokens.length>0&&u.tokens[0].tokens[0].type==="text"&&(u.tokens[0].tokens[0].text=g+" "+u.tokens[0].tokens[0].text)):u.tokens.unshift({type:"text",text:g+" "}):m+=g+" "}m+=this.parser.parse(u.tokens,s),i+=this.listitem({type:"list_item",raw:m,text:m,task:h,checked:!!p,loose:s,tokens:u.tokens})}return e.call(this,i,n,o)};case"html":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,a.text,a.block)};case"paragraph":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,this.parser.parseInline(a.tokens))};case"escape":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,a.text)};case"link":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,a.href,a.title,this.parser.parseInline(a.tokens))};case"image":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,a.href,a.title,a.text)};case"strong":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,this.parser.parseInline(a.tokens))};case"em":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,this.parser.parseInline(a.tokens))};case"codespan":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,a.text)};case"del":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,this.parser.parseInline(a.tokens))};case"text":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,a.text)}}return e}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return $s.lex(e,t??this.defaults)}parser(e,t){return Ps.parse(e,t??this.defaults)}#e(e,t){return(r,a)=>{let n={...a},o={...this.defaults,...n};this.defaults.async===!0&&n.async===!1&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);let s=this.#r(!!o.silent,!!o.async);if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(i=>e(i,o)).then(i=>o.hooks?o.hooks.processAllTokens(i):i).then(i=>o.walkTokens?Promise.all(this.walkTokens(i,o.walkTokens)).then(()=>i):i).then(i=>t(i,o)).then(i=>o.hooks?o.hooks.postprocess(i):i).catch(s);try{o.hooks&&(r=o.hooks.preprocess(r));let i=e(r,o);o.hooks&&(i=o.hooks.processAllTokens(i)),o.walkTokens&&this.walkTokens(i,o.walkTokens);let c=t(i,o);return o.hooks&&(c=o.hooks.postprocess(c)),c}catch(i){return s(i)}}}#r(e,t){return r=>{if(r.message+=` Please report this to https://github.com/markedjs/marked.`,e){let a="

    An error occurred:

    "+aa(r.message+"",!0)+"
    ";return t?Promise.resolve(a):a}if(t)return Promise.reject(r);throw r}}},No=new SE;l(Ft,"marked");Ft.options=Ft.setOptions=function(e){return No.setOptions(e),Ft.defaults=No.defaults,zf(Ft.defaults),Ft};Ft.getDefaults=Ad;Ft.defaults=zo;Ft.use=function(...e){return No.use(...e),Ft.defaults=No.defaults,zf(Ft.defaults),Ft};Ft.walkTokens=function(e,t){return No.walkTokens(e,t)};Ft.parseInline=No.parseInline;Ft.Parser=Ps;Ft.parser=Ps.parse;Ft.Renderer=hd;Ft.TextRenderer=Vf;Ft.Lexer=$s;Ft.lexer=$s.lex;Ft.Tokenizer=dd;Ft.Hooks=ad;Ft.parse=Ft;IE=":host{color:#838289;color:var(--text-color-secondary,#838289)}.orama-markdown-wrapper>:first-child{margin-top:0;padding-top:0}a,li,p{font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)));line-height:1.5;line-height:var(--font-line-height-md,1.5)}blockquote,ol,ul{margin:0 0 .25rem .25rem;margin:0 0 var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));padding:0 0 0 .25rem;padding:0 0 0 var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));padding-inline-start:1rem;padding-inline-start:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}blockquote{border-left:.25rem solid #dadada;border-left:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) solid var(--border-color-primary,#dadada)}p>code{margin:0 .25rem;margin:0 var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)))}pre>code{position:relative}a{color:#151515;color:var(--text-color-primary,#151515);font-weight:700;opacity:.9;text-decoration:underline}a:hover{opacity:1}.orama-markdown-pre{position:relative}.orama-markdown-code{border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)))}.orama-markdown-code-title{color:#151515;color:var(--text-color-primary,#151515);display:block;font-size:.625rem;font-size:var(--font-size-xxs,calc(10rem/var(--orama-base-font-size, 16)));opacity:.5;padding:.5rem 0;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) 0}";window.hljs=cd;Kp.addHook("afterSanitizeAttributes",e=>{"href"in e&&(e.setAttribute("target","_parent"),e.setAttribute("rel","noopener"))});Jw=Object.fromEntries(CT.map(e=>[e,{error:!1,retries:0}])),CE={html:"xml"};l(e8,"loadLanguageAndHighlight");t8=class{static{l(this,"OramaMarkdown")}constructor(e){zt(this,e),this.chatMarkdownLinkClicked=qt(this,"chatMarkdownLinkClicked"),this.parseMarkdown=async()=>{if(!this.content)return;let t=this.content.replace(/^[\u200B\u200C\u200D\u200E\u200F\uFEFF]/,""),r=await Ft.parse(t);this.divElement.innerHTML=Kp.sanitize(r);let a=this.markdownElement.shadowRoot.querySelectorAll(".orama-markdown-code"),n={};for(let o=0;oc.startsWith("language-")).substring(9);n[i]=!0}for(let o of Object.keys(n))e8(o).then(()=>{let s=Ft.parse(t);this.divElement.innerHTML=Kp.sanitize(s)})}}onContentChange(){this.parseMarkdown()}handleMarkdownLinkClicked(e){let t=e.target;if(this.chatMarkdownLinkClicked.emit({text:t.innerText,href:t.href}).defaultPrevented){e.preventDefault();return}}componentDidLoad(){Ft.use({useNewRenderer:!0,renderer:{link:l(e=>{var t,r,a,n,o;let s=document.createElement("a");return s.innerHTML=(r=(t=this.chatMarkdownLinkTitle)===null||t===void 0?void 0:t.call(this,{href:e.href,text:e.text}))!==null&&r!==void 0?r:e.text,s.href=(n=(a=this.chatMarkdownLinkHref)===null||a===void 0?void 0:a.call(this,{href:e.href,text:e.text}))!==null&&n!==void 0?n:e.href,this.chatMarkdownLinkTarget&&(s.target=(o=this.chatMarkdownLinkTarget)===null||o===void 0?void 0:o.call(this,{href:e.href,text:e.text})),s.outerHTML},"link"),code:l(e=>{let t=CE[e.lang]||e.lang,r=Jw[t]?t:"plaintext",a=document.createElement("pre");a.classList.add("orama-markdown-pre");let n=document.createElement("div");n.classList.add("orama-markdown-code-title"),a.appendChild(n);let o=document.createElement("code");o.classList.add("orama-markdown-code"),o.classList.add(`language-${r}`),o.classList.add("hljs"),a.appendChild(o);let s=cd.getLanguage(r);return s?(r==="plaintext"?n.innerHTML="":n.innerHTML=s.name,o.innerHTML=cd.highlight(e.text,{language:r,ignoreIllegals:!0}).value,o.dataset.highlighted="yes"):(n.innerHTML=" ",o.innerHTML=e.text),a.outerHTML},"code"),codespan:l(e=>{let t=document.createElement("code");return t.classList.add("orama-markdown-inline-code"),t.innerHTML=e.text,t.outerHTML},"codespan")}}),this.parseMarkdown()}render(){return D("host",{key:"0d9e85fa6fc920380df442ff1ef91e3fbcc0ea51"},D("link",{key:"10de293b8a30b8071a00c819c6c31968d5f48804",rel:"stylesheet",href:"https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.10.0/build/styles/atom-one-dark.min.css"}),D("div",{key:"610b83aa61a633c732e20331685c9e61cecd1a49",class:"orama-markdown-wrapper",ref:l(e=>{this.divElement=e},"ref"),onClick:l(e=>{e.target.tagName==="A"&&this.handleMarkdownLinkClicked(e)},"onClick")}))}get markdownElement(){return Sr(this)}static get watchers(){return{content:["onContentChange"]}}};t8.style=IE;AE=".modal.sc-orama-modal{background-color:hsla(0,0%,98%,.7);background-color:var(--backdrop-background-color-primary,hsla(0,0%,98%,.7));display:none;height:100%;left:0;position:fixed;top:0;width:100%;z-index:9999}.modal.open.sc-orama-modal{display:block}dialog.sc-orama-modal{border:none}.modal-content.sc-orama-modal{background-color:#fbfbfb;background-color:var(--background-color-primary,#fbfbfb);display:flex;flex-direction:column;inset:0;justify-content:space-between;position:fixed}@media (min-width:1024.02px){.modal-content.sc-orama-modal{background-color:#fff;background-color:var(--background-color-secondary,#fff);border:1px solid #dadada;border:1px solid var(--border-color-primary,#dadada);border-radius:.75rem;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)));bottom:auto;margin:0 auto;max-height:70vh;max-width:45rem;max-width:calc(720rem/var(--orama-base-font-size, 16));min-height:12.5rem;min-height:calc(200rem/var(--orama-base-font-size, 16));padding:0;top:5vh;width:80%}}.modal-close.sc-orama-modal:not(:focus-visible){clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.modal-title.sc-orama-modal{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}",r8=class{static{l(this,"OramaModal")}constructor(e){zt(this,e),this.modalClosed=qt(this,"modalClosed"),this.closeOnEscape=!0,this.closeOnOutsideClick=!0,this.mainTitle="",this.originalBodyOverflowState="scroll"}trapFocus(e){let t=this.el.querySelectorAll('a[href], button, textarea, input, select, [tabindex]:not([tabindex="-1"])'),r=Array.from(t).filter(a=>a.offsetParent!==null);if(r.length>0){this.firstFocusableElement=r[0],this.lastFocusableElement=r[r.length-1];let a=this.el.querySelector(":focus");e.shiftKey&&a===this.firstFocusableElement?(e.preventDefault(),this.lastFocusableElement.focus()):!e.shiftKey&&a===this.lastFocusableElement&&(e.preventDefault(),this.firstFocusableElement.focus())}}handleFocus(){let e=this.el.querySelectorAll('a[href], button, textarea, input, select, [tabindex]:not([tabindex="-1"])'),t=Array.from(e).filter(r=>r.offsetParent!==null);t.length>0&&t[0].focus()}connectedCallback(){this.originalBodyOverflowState=document.body.style.overflow,this.activeElement=document.activeElement,this.handleFocus(),document.body.style.overflow="hidden"}disconnectedCallback(){document.body.style.overflow=this.originalBodyOverflowState}componentDidUpdate(){this.handleFocus(),this.activeElement&&this.activeElement.focus()}render(){return D("dialog",{key:"a3fc3367ed30a5b2c440df67600bf619652b559c",class:"modal open","aria-modal":"true","aria-labelledby":"modalTitle","aria-describedby":"modalContent",onKeyDown:l(e=>{switch(e.key){case"Tab":this.trapFocus(e);break;case"Escape":this.closeOnEscape&&(e.preventDefault(),e.stopPropagation(),this.modalClosed.emit());break}},"onKeyDown"),onClick:l(e=>{this.innerModalRef&&!this.innerModalRef.contains(e.target)&&(e.stopPropagation(),e.preventDefault(),this.modalClosed.emit())},"onClick")},D("div",{key:"4eff2c8624762dc014b85851590abed2cf8f38c3",class:"modal-inner",ref:l(e=>this.innerModalRef=e,"ref")},D("h1",{key:"d4360fef432f56884b54c5bdfac5d8bfa6e530ef",id:"modalTitle",class:"modal-title"},this.mainTitle),D("div",{key:"9e3867727679699c7d31e71b7d637c6d4cb24334",id:"modalContent",class:"modal-content"},D("slot",{key:"deb12898e6327dc99b52ae8d48444c0d09b2320d"})),D("button",{key:"43dfa57f3117c030474c707113208aa954cf68f4",onClick:l(()=>this.modalClosed.emit(),"onClick"),type:"button",class:"modal-close"},"Close")))}get el(){return Sr(this)}};r8.style=AE;TE=Object.defineProperty,EE=Object.getOwnPropertyDescriptor,hl=l((e,t,r,a)=>{for(var n=a>1?void 0:a?EE(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&TE(t,r,n),n},"o"),_n=class extends dr{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${_n.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};_n.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);_n.styles=Cr` :host { display: contents; } `;hl([be({type:String,reflect:!0})],_n.prototype,"size",2);hl([be({type:String,reflect:!0})],_n.prototype,"weight",2);hl([be({type:String,reflect:!0})],_n.prototype,"color",2);hl([be({type:Boolean,reflect:!0})],_n.prototype,"mirrored",2);_n=hl([Tr("ph-clock")],_n);$E=Object.defineProperty,PE=Object.getOwnPropertyDescriptor,pl=l((e,t,r,a)=>{for(var n=a>1?void 0:a?PE(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&$E(t,r,n),n},"s$2"),kn=class extends dr{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${kn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};kn.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);kn.styles=Cr` :host { display: contents; } `;pl([be({type:String,reflect:!0})],kn.prototype,"size",2);pl([be({type:String,reflect:!0})],kn.prototype,"weight",2);pl([be({type:String,reflect:!0})],kn.prototype,"color",2);pl([be({type:Boolean,reflect:!0})],kn.prototype,"mirrored",2);kn=pl([Tr("ph-plus")],kn);OE=Object.defineProperty,RE=Object.getOwnPropertyDescriptor,fl=l((e,t,r,a)=>{for(var n=a>1?void 0:a?RE(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&OE(t,r,n),n},"s$1"),Sn=class extends dr{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${Sn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};Sn.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);Sn.styles=Cr` :host { display: contents; } `;fl([be({type:String,reflect:!0})],Sn.prototype,"size",2);fl([be({type:String,reflect:!0})],Sn.prototype,"weight",2);fl([be({type:String,reflect:!0})],Sn.prototype,"color",2);fl([be({type:Boolean,reflect:!0})],Sn.prototype,"mirrored",2);Sn=fl([Tr("ph-caret-left")],Sn);LE=".sc-orama-navigation-bar-h{align-items:center;background-color:#fbfbfb;background-color:var(--background-color-primary,#fbfbfb);display:flex;padding:1rem 1rem .5rem;padding:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16))) var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16))) var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}@media (min-width:1024.02px){.sc-orama-navigation-bar-h{display:none}}.spacer.sc-orama-navigation-bar{display:block;height:2.25rem;height:calc(36rem/var(--orama-base-font-size, 16));width:2.25rem;width:calc(36rem/var(--orama-base-font-size, 16))}.corner-section.sc-orama-navigation-bar{display:flex;gap:.25rem;gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)))}.corner-section.start.sc-orama-navigation-bar{display:flex;justify-content:flex-start}.corner-section.center.sc-orama-navigation-bar{display:flex;flex:1;justify-content:center}.corner-section.end.sc-orama-navigation-bar{display:flex;justify-content:flex-end}",ME=function(e,t,r,a){var n=arguments.length,o=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(s=e[i])&&(o=(n<3?s(o):n>3?s(t,r,o):s(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o},Ff=class{static{l(this,"OramaNavigationBar")}constructor(e){zt(this,e),this.showBackButton=!0,this.showChatActions=!1,this.handleStartNewChat=()=>{var t;(t=this.chatStore.state.chatService)===null||t===void 0||t.resetChat()}}render(){return D(Er,{key:"676f6e8004de45bc7e70a38534c694c57b2c5068"},D("div",{key:"036c53deef2f5fa0785f677d7aec3cb6fcc47a39",class:"corner-section start"},this.showBackButton?D(cn,null,D("orama-button",{type:"button",variant:"icon","aria-label":"Exit",onClick:this.handleClose,onKeyDown:this.handleClose},D("ph-caret-left",{size:"20px"}))):D("div",{class:"spacer"})),D("div",{key:"2dd271a6f0742652bb3480cb7996f46bd3a64bb5",class:"corner-section center"},D("orama-toggler",{key:"80ecf7005825e985ed5e86a12c5912d6e104c238"})),D("div",{key:"c00c10b04bffa9e7bbae61f27d0fc6e483b66e8a",class:"corner-section end"},this.showChatActions?D(cn,null,D("orama-button",{type:"button",variant:"icon","aria-label":"Start new chat",onClick:this.handleStartNewChat,onKeyDown:this.handleStartNewChat},D("ph-plus",{size:"20px"}))):D("div",{class:"spacer"})))}};ME([Tn("chat")],Ff.prototype,"chatStore",void 0);Ff.style=LE;NE=".sc-orama-search-h{display:flex;flex-direction:column;overflow:hidden;width:100%}@media (max-width:1024px){.sc-orama-search-h orama-input.sc-orama-search{padding:0 1rem;padding:0 var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}}@media (max-width:1024px){.sc-orama-search-h{padding:.5rem 0;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) 0}}.result-wrapper.sc-orama-search{flex-grow:1;overflow-y:auto;padding:0 1rem;padding:0 var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}.result-wrapper.sc-orama-search::-webkit-scrollbar{width:.3em}.result-wrapper.sc-orama-search::-webkit-scrollbar-track{background:transparent}.result-wrapper.sc-orama-search::-webkit-scrollbar-thumb{background-color:hsla(0,0%,70%,.522);border-radius:1rem;border-radius:var(--border-radius-l,calc(16rem/var(--orama-base-font-size, 16)))}@media (min-width:1024.02px){.result-wrapper.sc-orama-search{padding:0 .75rem;padding:0 var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}}.search-form.sc-orama-search{display:flex;flex-direction:column}",Wf=function(e,t,r,a){var n=arguments.length,o=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(s=e[i])&&(o=(n<3?s(o):n>3?s(t,r,o):s(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o},ml=class{static{l(this,"OramaSearch")}constructor(e){zt(this,e),this.searchCompleted=qt(this,"searchCompleted"),this.answerGenerated=qt(this,"answerGenerated"),this.placeholder="Search...",this.focusInput=!1,this.suggestions=[],this.disableChat=!1,this.highlightTitle=!1,this.highlightDescription=!1,this.selectedFacet="",this.handleSubmit=t=>{if(t.preventDefault(),this.disableChat)return;this.el.querySelector("orama-chat-button")?.click()}}getText(e){let t={searchPlaceholder:this.placeholder};return Ls(e,this.dictionary,t)}doSearch(){this.searchStore.state.searchService.search(this.globalStore.state.currentTerm,this.selectedFacet,{onSearchCompletedCallback:l(e=>{this.searchCompleted.emit(e)},"onSearchCompletedCallback")})}render(){var e;return D(Er,{key:"688c8af1ca2951057a901d4e5d93f44877f6e73b"},D("form",{key:"f08750150118e1417d817ead3024011a7dfa6d77",onSubmit:this.handleSubmit,class:"search-form"},D("orama-input",{key:"a173662d45226aa2e36f3ed12f5c3792d1f4aa86","focus-on-arrow-nav":!0,autoFocus:this.focusInput,type:"search",onInput:l(t=>{let r=t.target;this.globalStore.state.currentTerm=r.value,this.doSearch()},"onInput"),value:this.globalStore.state.currentTerm,size:"large",labelForScreenReaders:this.getText("searchPlaceholder"),placeholder:this.getText("searchPlaceholder")}),D("slot",{key:"64b40b9655e4bd2842800d0ca33e6cdaabf019cc",name:"summary"})),D("div",{key:"98f8fd718183e5436a2d42eabf8313d5b071be32",class:"result-wrapper"},D("orama-facets",{key:"6dec4d3f30682444e46a18f3e31a6c77baf42f9c",facets:this.searchStore.state.facets,selectedFacet:this.selectedFacet,selectedFacetChanged:l(t=>{this.selectedFacet=t,this.doSearch()},"selectedFacetChanged")}),D("orama-search-results",{key:"7e8fe4f97b6882d503965c99044a4d5e46e649b7",suggestions:!(!((e=this.globalStore.state.currentTerm)===null||e===void 0)&&e.length)&&!this.disableChat?this.suggestions:[],setChatTerm:l(t=>{var r;this.globalStore.state.currentTask="chat",(r=this.chatStore.state.chatService)===null||r===void 0||r.sendQuestion(t,this.relatedQueries,void 0,{onAnswerGeneratedCallback:l(a=>this.answerGenerated.emit(a),"onAnswerGeneratedCallback")})},"setChatTerm"),sourceBaseUrl:this.sourceBaseUrl,linksTarget:this.linksTarget,linksRel:this.linksRel,sections:this.searchStore.state.results,searchTerm:this.globalStore.state.currentTerm,highlightTitle:this.highlightTitle,highlightDescription:this.highlightDescription,loading:this.searchStore.state.loading,error:this.searchStore.state.error,dictionary:this.dictionary})))}get el(){return Sr(this)}};Wf([Tn("search")],ml.prototype,"searchStore",void 0);Wf([Tn("global")],ml.prototype,"globalStore",void 0);Wf([Tn("chat")],ml.prototype,"chatStore",void 0);ml.style=NE;DE=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n{var s,i,c,u;if(!this.client)throw new Bi;if(this.abortSearch(),!a){this.searchStore.state.results=[],this.searchStore.state.count=0,this.searchStore.state.facets=[],this.searchStore.state.highlightedIndex=-1;return}this.searchStore.state.loading=!0;let p=this.abortController,h=(s=this.searchStore.state.searchParams)!==null&&s!==void 0?s:{},{limit:m,where:g}=h,x=DE(h,["limit","offset","where"]),w=Object.assign(Object.assign(Object.assign(Object.assign({},x),{term:a,limit:m||zE}),g?{where:g}:{}),this.searchStore.state.facetProperty&&Object.assign({facets:{[this.searchStore.state.facetProperty]:{}}},n&&n!=="All"&&{where:Object.assign({[this.searchStore.state.facetProperty]:{eq:n}},g)}));try{let k=await this.client.search(w);if(p.signal.aborted)return;if(k&&!k.hits)throw new Error("This search was made by a OramaClient with property mergeResult set to false. Orama Search Service requires mergeResult to be true.");this.searchStore.state.results=this.parserResults(k?.hits,this.searchStore.state.resultMap),this.searchStore.state.count=k?.count||0,this.searchStore.state.facets=this.parseFacets(k?.facets,this.searchStore.state.facetProperty),this.searchStore.state.highlightedIndex=-1,this.searchStore.state.loading=!1,(i=o?.onSearchCompletedCallback)===null||i===void 0||i.call(o,{clientSearchParams:w,result:{results:this.searchStore.state.results,resultsCount:this.searchStore.state.count,facets:this.searchStore.state.facets}}),(c=o?.onSearchCompletedCallback)===null||c===void 0||c.call(o,{clientSearchParams:w,result:{results:this.searchStore.state.results,resultsCount:this.searchStore.state.count,facets:this.searchStore.state.facets}})}catch(k){if(console.error("Search error:",k),p.signal.aborted)return;this.searchStore.state.loading=!1,(u=o?.onSearchErrorCallback)===null||u===void 0||u.call(o,k)}},this.retry=()=>{throw new Error("Not implemented")},this.getResultMapObjectByForTheHit=(a,n)=>{let o=Array.isArray(a)?a:[a];return o.length===1?o[0]:o.find(s=>s.datasourceId===n.datasource_id)||{}},this.parserResults=(a,n)=>{if(!a)return[];let o=[],s={};for(let i of a){let c=this.getResultMapObjectByForTheHit(n,i),u=this.hitToSearchResultParser(i,c),p=typeof c.section=="function"?c.section(i.document,i.datasource_id):i.document[c.section];if(s[p]===void 0)o.push({section:p,items:[u]}),s[p]=o.length-1;else{let h=s[p];o[h].items.push(u)}}return o},this.hitToSearchResultParser=(a,n)=>{function o(i){if(!a.document)return"";let c=n[i];if(!c){let h=a.document[i];return typeof h=="string"?h:String(h??"")}if(typeof c=="function"){let h=c(a.document,a.datasource_id);return typeof h=="string"?h:String(h??"")}let u=c,p=a.document[u];return typeof p=="string"?p:String(p??"")}l(o,"getResultMapValue");function s(){let i=n.icon;return i?typeof i=="function"?i(a.document,a.datasource_id)??null:n.icon:null}return l(s,"getIcon"),{id:a.id,title:o("title"),description:o("description"),path:o("path"),icon:s()}},this.parseFacets=(a,n)=>{if(!n||!a)return[];let o=a[n];if(!o||!o.values)return[];let s=Object.values(o.values).reduce((c,u)=>c+u,0),i=Object.keys(o.values).map(c=>({name:c,count:o.values[c]}));return i.unshift({name:"All",count:s}),i},this.client=t||new _w(e),this.searchStore=r,this.abortController=new AbortController}abortSearch(){this.abortController.abort(),this.abortController=new AbortController}},jE=class extends EventTarget{static{l(this,"WindowService")}constructor(){super(),this._width=window.innerWidth,this.handleResize=this.handleResize.bind(this),window.addEventListener("resize",this.handleResize)}handleResize(){this._width=window.innerWidth,this.dispatchEvent(new CustomEvent("widthChange",{detail:this._width}))}get width(){return this._width}},Sp=new jE,BE="@keyframes showIn{0%{opacity:0;transform:translateY(-25%)}to{opacity:1;transform:translateY(0)}}@media (min-width:1024.02px){.modal orama-input{border-radius:0;margin:0;padding:0}.modal input[type=search]{border-radius:.75rem .75rem 0 0;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16))) var(--radius-m,calc(12rem/var(--orama-base-font-size, 16))) 0 0}}.main{flex-direction:column;flex-grow:1}.main,.section-active{display:flex;overflow:hidden}.section-inactive{display:none}",a8=class{static{l(this,"SearchBox")}constructor(e){zt(this,e),this.searchCompleted=qt(this,"searchCompleted"),this.searchResultClick=qt(this,"searchResultClick"),this.clearChat=qt(this,"clearChat"),this.startConversation=qt(this,"startConversation"),this.answerGenerated=qt(this,"answerGenerated"),this.answerSourceClick=qt(this,"answerSourceClick"),this.chatMarkdownLinkClicked=qt(this,"chatMarkdownLinkClicked"),this.modalClosed=qt(this,"modalClosed"),this.modalStatusChanged=qt(this,"modalStatusChanged"),this.colorScheme="light",this.open=!1,this.resultMap={},this.disableChat=!1,this.layout="modal",this.highlightTitle=!1,this.highlightDescription=!1,this.clearChatOnDisconnect=!0,this.showKeyboardShortcuts=!0,this.dictionary={},this.componentID=fd("search-box"),this.systemScheme="light",this.closeSearchbox=()=>{this.globalStore.state.open=!1,this.open=!1},this.onChatButtonClick=()=>{this.globalStore.state.currentTask="chat"},this.onPrefersColorSchemeChange=t=>{this.systemScheme=t.matches?"dark":"light",this.updateTheme()},this.updateWindowWidth=t=>{this.windowWidth=t.detail}}handleDictionaryChange(e){let t={};if(typeof e=="string")try{t=JSON.parse(e)}catch(r){console.error("Failed to parse dictionary string:",r)}else t=e||{};this.internalTextDictionary=Object.assign(Object.assign({},Ep),t)}indexChanged(){this.searchStore&&this.bootstrap()}watchHandler(){this.updateTheme()}handleOpenPropChange(e){this.globalStore.state.open=e,this.modalStatusChanged.emit({open:e,id:this.wrapperRef}),e||this.modalClosed.emit()}handleFacetPropertyChange(e){this.searchStore.state.facetProperty=e}handleSearchParamsChange(e){this.searchStore.state.searchParams=e}handleKeyDown(e){var t;((t=this.globalStore)===null||t===void 0?void 0:t.state.currentTask)==="search"&&(this.layout==="modal"&&this.open||this.layout==="embed")&&["ArrowDown","ArrowUp"].includes(e.key)&&Av(this.wrapperRef,e)}updateTheme(){let e=md(this.htmlElement,this.colorScheme,this.systemScheme);gd(this.htmlElement,e,this.themeConfig)}getOldOramaClient(){if(!this.oramaCoreClientInstance)return this.clientInstance?this.clientInstance:sf(this.index)}bootstrap(){this.searchStore.state.facetProperty=this.facetProperty,this.searchStore.state.resultMap=this.resultMap,this.searchStore.state.searchParams=this.searchParams,this.startServices()}startServices(){if(!this.index&&!this.clientInstance&&!this.oramaCoreClientInstance)return;of(this.htmlElement,this.index,this.clientInstance,this.oramaCoreClientInstance);let e=this.getOldOramaClient();this.searchStore.state.searchService=new ZE(e,this.oramaCoreClientInstance,this.searchStore),this.chatStore.state.chatService=new kw(e,this.oramaCoreClientInstance,this.chatStore)}componentWillLoad(){this.htmlElement.id=this.componentID,this.bootstrap(),this.globalStore.state.open=this.open,this.globalStore.onChange("open",()=>{this.globalStore&&(this.open=this.globalStore.state.open,this.globalStore.state.open||(this.globalStore.state.currentTerm="",this.searchStore.state.facets=[],this.searchStore.state.count=0,this.searchStore.state.results=[],this.searchStore.state.highlightedIndex=-1,this.searchStore.state.loading=!1,this.searchStore.state.error=!1,this.chatStore.state.interactions=[],setTimeout(()=>{})))}),this.schemaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.systemScheme=this.schemaQuery.matches?"dark":"light",this.updateTheme(),this.schemaQuery.addEventListener("change",this.onPrefersColorSchemeChange),Sp.addEventListener("widthChange",this.updateWindowWidth);let e={};if(typeof this.dictionary=="string")try{e=JSON.parse(this.dictionary)}catch(t){console.error("Failed to parse initial dictionary string:",t)}else e=this.dictionary||{};this.internalTextDictionary=Object.assign(Object.assign({},Ep),e)}connectedCallback(){this.chatStore=Xc("chat",this.componentID),this.searchStore=Xc("search",this.componentID),this.globalStore=Xc("global",this.componentID),this.windowWidth=Sp.width}disconnectedCallback(){var e;jv(this.componentID),Sp.removeEventListener("widthChange",this.updateWindowWidth),(e=this.schemaQuery)===null||e===void 0||e.removeEventListener("change",this.onPrefersColorSchemeChange)}getText(e){let t={searchPlaceholder:this.searchPlaceholder,chatPlaceholder:this.chatPlaceholder};return Ls(e,this.internalTextDictionary,t)}getSearchBox(){return D("div",{class:`${this.windowWidth>1024||this.globalStore.state.currentTask==="search"?"section-active":"section-inactive"}`},D("orama-search",{placeholder:this.getText("searchPlaceholder"),focusInput:this.globalStore.state.currentTask==="search",sourceBaseUrl:this.sourceBaseUrl,linksTarget:this.linksTarget,linksRel:this.linksRel,highlightTitle:this.highlightTitle,highlightDescription:this.highlightDescription,disableChat:this.disableChat,suggestions:this.suggestions,dictionary:this.internalTextDictionary},this.windowWidth>1024&&!this.disableChat&&D("orama-chat-button",{slot:"summary","focus-on-arrow-nav":!0,active:!!this.globalStore.state.currentTerm,label:`${this.globalStore.state.currentTerm?`${this.globalStore.state.currentTerm} - `:""}${this.getText("chatButtonLabel")}`,onClick:this.onChatButtonClick,onKeyPress:this.onChatButtonClick})))}getChatBox(){return D(cn,null,D("orama-chat",{class:`${this.globalStore.state.currentTask==="chat"?"section-active":"section-inactive"}`,defaultTerm:this.globalStore.state.currentTask==="chat"?this.globalStore.state.currentTerm:"",showClearChat:!1,focusInput:this.globalStore.state.currentTask==="chat",placeholder:this.getText("chatPlaceholder"),sourceBaseUrl:this.sourceBaseUrl,linksTarget:this.linksTarget,linksRel:this.linksRel,sourcesMap:this.sourcesMap,suggestions:this.suggestions,chatMarkdownLinkTitle:this.chatMarkdownLinkTitle,chatMarkdownLinkHref:this.chatMarkdownLinkHref,chatMarkdownLinkTarget:this.chatMarkdownLinkTarget,disclaimer:this.disclaimer,dictionary:this.internalTextDictionary,systemPrompts:this.systemPrompts,prompt:this.prompt,clearChatOnDisconnect:this.clearChatOnDisconnect,relatedQueries:this.relatedQueries}))}getInnerContent(){return D(cn,null,this.disableChat?null:D("orama-navigation-bar",{handleClose:this.closeSearchbox,showBackButton:this.layout!=="embed",showChatActions:this.globalStore.state.currentTask==="chat"}),D("div",{class:"main"},this.getSearchBox(),this.windowWidth<=1024&&this.getChatBox()),D("orama-footer",{colorScheme:this.colorScheme==="system"?this.systemScheme:this.colorScheme,showKeyboardShortcuts:this.showKeyboardShortcuts}))}getOuterContent(){return this.windowWidth>1024?D("orama-sliding-panel",{open:this.globalStore.state.currentTask==="chat",backdrop:this.layout==="embed",closed:l(()=>{this.globalStore.state.currentTask="search"},"closed")},this.getChatBox()):null}getModalLayout(){return D(cn,null,D("orama-modal",{ref:l(e=>this.wrapperRef=e,"ref"),class:"modal",mainTitle:this.getText("startYourSearch"),onModalClosed:l(e=>{this.open=!1,e.stopPropagation()},"onModalClosed"),closeOnEscape:this.globalStore.state.currentTask==="search"||this.windowWidth<=1024},this.getInnerContent()),this.getOuterContent())}getEmbedLayout(){return D(cn,null,D("orama-embed",{ref:l(e=>this.wrapperRef=e,"ref")},this.getInnerContent()),this.getOuterContent())}render(){return this.layout==="modal"&&!this.globalStore.state.open||!this.searchStore.state.searchService||!this.chatStore.state.chatService?null:this.layout==="modal"?this.getModalLayout():this.getEmbedLayout()}get htmlElement(){return Sr(this)}static get watchers(){return{dictionary:["handleDictionaryChange"],index:["indexChanged"],clientInstance:["indexChanged"],oramaCoreClientInstance:["indexChanged"],themeConfig:["watchHandler"],colorScheme:["watchHandler"],open:["handleOpenPropChange"],facetProperty:["handleFacetPropertyChange"],searchParams:["handleSearchParamsChange"]}}};a8.style=BE;HE=":host{display:block}.kyb-shortcut{background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6);border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)));padding:.25rem;padding:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--spacing-s,calc(4rem/var(--orama-base-font-size, 16)))}",n8=class{static{l(this,"OramaSearchButton")}constructor(e){zt(this,e),this.size="medium",this.colorScheme="light",this.dictionary={},this.systemScheme="light",this.shortcutLabel="",this.componentID=fd("search-button"),this.onPrefersColorSchemeChange=t=>{this.systemScheme=t.matches?"dark":"light",this.updateTheme()}}handleTextDictionaryChange(e){if(typeof e=="string")try{this.dictionary=JSON.parse(e)}catch(t){console.error("Error parsing dictionary:",t)}}getText(e){return Ls(e,this.dictionary)}watchHandler(){this.updateTheme()}handleSearchboxClosed(e){this.buttonRef.querySelector("button").focus()}handleKeyDown(e){e.key==="k"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.buttonRef.click())}updateTheme(){let e=md(this.htmlElement,this.colorScheme,this.systemScheme);gd(this.htmlElement,e,this.themeConfig)}handleShortcutLabel(){return navigator.userAgent.includes("Mac")?"\u2318 K":"Ctrl + K"}connectedCallback(){this.htmlElement.id=this.componentID,this.shortcutLabel=this.handleShortcutLabel(),this.schemaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.systemScheme=this.schemaQuery.matches?"dark":"light",this.updateTheme(),this.schemaQuery.addEventListener("change",this.onPrefersColorSchemeChange)}disconnectedCallback(){this.schemaQuery.removeEventListener("change",this.onPrefersColorSchemeChange)}componentWillLoad(){this.updateTheme()}render(){return D(Er,{key:"d784308be3ef8bb2abeaa25bed43f51962ec7586"},D("orama-button",{key:"2dafcd15bb0b5f468e6a91d9651cec22f2670a61",type:"button",variant:"secondary",ref:l(e=>this.buttonRef=e,"ref"),size:this.size,onClick:l(()=>{let e=document.getElementsByTagName("orama-search-box");if(!e.length){console.error("No OramaSearchBox found");return}if(e.length>1){console.error("Multiple instances of OramaSearchBox (orama-search-box) found. Considere to assign an ID to OramaSearchBox, implement onClick on OramaSearchButton and select desired OramaSearchBox on onClick method");return}e[0].open=!0},"onClick")},D("span",{key:"c96898d75e57d546930794c25d04a6cd3cd3f960",slot:"adorment-start"},D("ph-magnifying-glass",{key:"a42c0d765c8bdf1647ebc7d9e85c8ce224397ddf"})),D("slot",{key:"979f16ad8739765dc42ed9cbb46d6b2eb789e000"},this.getText("searchButtonLabel")),D("span",{key:"e211d3ccd39bbe8b628569a4d69ff23c7a0a9935",slot:"adorment-end",class:"kyb-shortcut"},this.shortcutLabel)))}get htmlElement(){return Sr(this)}static get watchers(){return{dictionary:["handleTextDictionaryChange"],themeConfig:["watchHandler"],colorScheme:["watchHandler"]}}};n8.style=HE;l(o8,"requireDist");bv=o8(),UE=Object.defineProperty,VE=Object.getOwnPropertyDescriptor,gl=l((e,t,r,a)=>{for(var n=a>1?void 0:a?VE(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&UE(t,r,n),n},"h"),In=class extends dr{static{l(this,"a")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${In.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};In.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);In.styles=Cr` :host { display: contents; } `;gl([be({type:String,reflect:!0})],In.prototype,"size",2);gl([be({type:String,reflect:!0})],In.prototype,"weight",2);gl([be({type:String,reflect:!0})],In.prototype,"color",2);gl([be({type:Boolean,reflect:!0})],In.prototype,"mirrored",2);In=gl([Tr("ph-files")],In);FE=".list.sc-orama-search-results{list-style:none;margin:0;padding:0}.section-list.sc-orama-search-results{gap:.75rem;gap:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));margin-top:.5rem;margin-top:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));padding-bottom:1rem;padding-bottom:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}.section-item-list.sc-orama-search-results,.section-list.sc-orama-search-results{display:flex;flex-direction:column}.section-wrapper.sc-orama-search-results{border-bottom:1px solid #dadada;border-bottom:1px solid var(--border-color-primary,#dadada);padding-bottom:.75rem;padding-bottom:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}.section-wrapper.sc-orama-search-results:last-of-type{border-bottom:none}.section-title-wrapper.sc-orama-search-results{padding:.5rem .75rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));text-transform:capitalize}.section-title-wrapper.sc-orama-search-results *.sc-orama-search-results{color:#838289;color:var(--text-text-color-secondary,#838289)}.list-item.sc-orama-search-results{cursor:pointer}.list-item-button.sc-orama-search-results{align-items:center;background-color:#fff;background-color:var(--background-color-secondary,#fff);border:1px solid transparent;border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)));cursor:pointer;display:flex;font-family:inherit;gap:.75rem;gap:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));padding:.75rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));position:relative;text-align:left;text-decoration:none;transition:background-color .2s}@media (hover:hover){.list-item-button.sc-orama-search-results:hover{background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6)}}.list-item-button.sc-orama-search-results:focus-visible{border:1px solid #432d77;border:1px solid var(--border-color-accent,#432d77);outline:none}.collapsed.sc-orama-search-results{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.result-title.sc-orama-search-results{color:#151515;color:var(--text-color-primary,#151515)}.result-description.sc-orama-search-results{color:#99989d;color:var(--text-color-tertiary,#99989d)}.results-empty.sc-orama-search-results{margin:2rem auto 2.5rem;margin:calc(32rem/var(--orama-base-font-size, 16)) auto calc(40rem/var(--orama-base-font-size, 16));max-width:25rem;max-width:calc(400rem/var(--orama-base-font-size, 16));text-align:center;width:80%}.suggestions-wrapper.sc-orama-search-results{padding:1rem 0 .75rem;padding:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16))) 0 var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16))) 0}.suggestions-title.sc-orama-search-results{margin-bottom:.25rem;margin-bottom:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));padding:0 .5rem;padding:0 var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));text-transform:uppercase}.textWrapper.sc-orama-search-results{display:flex;flex-direction:column;flex-grow:1;overflow:hidden}ph-files.sc-orama-search-results{color:#151515;color:var(--icon-color-primary,#151515)}.result-item-icon-wrapper.sc-orama-search-results{align-items:center;display:flex;flex-shrink:0;height:20px;justify-content:center;width:20px}.custom-result-item-icon.sc-orama-search-results{max-height:20px;max-width:20px;-o-object-fit:contain;object-fit:contain}",s8=class{static{l(this,"SearchResults")}constructor(e){zt(this,e),this.searchResultClick=qt(this,"searchResultClick"),this.linksTarget="_blank",this.linksRel="noopener noreferrer",this.sections=[],this.suggestions=[],this.loading=!1,this.error=!1,this.highlightTitle=!1,this.highlightDescription=!1,this.handleItemClick=(t,r)=>{if(this.searchResultClick.emit({result:r}).defaultPrevented){t.preventDefault();return}if(!r?.path)throw new Error("No path found")},this.getItemLinkUrl=t=>t?.path?this.sourceBaseUrl?`${this.sourceBaseUrl}${t.path}`:t.path:"#",this.getHighlightedTitleText=t=>this.highlighterTitle.highlight(t,this.searchTerm),this.getHighlightedDescriptionText=t=>this.highlighterDescription.highlight(t,this.searchTerm)}buildUrl(e){if(!e)return"#";if(this.sourceBaseUrl){let t=this.sourceBaseUrl.replace(/\/+$/,""),r=e.replace(/^\/+/,"");return`${t}/${r}`}return e}componentDidLoad(){this.highlightTitle&&(this.highlighterTitle=new bv.Highlight(this.highlightTitle)),this.highlightDescription&&(this.highlighterDescription=new bv.Highlight(this.highlightDescription))}render(){var e,t,r,a,n,o;return this.searchTerm?this.error?D("div",null,((r=this.dictionary)===null||r===void 0?void 0:r.errorMessage)||"An error occurred while trying to search. Please try again."):!this.loading&&!(!((a=this.sections)===null||a===void 0)&&a.some(s=>s.items.length>0))?D("div",{class:"results-empty"},D("orama-text",{as:"h3",styledAs:"span"},`${((n=this.dictionary)===null||n===void 0?void 0:n.noResultsFound)||"No results found"} ${this.searchTerm?`${((o=this.dictionary)===null||o===void 0?void 0:o.noResultsFoundFor)||"for"} "${this.searchTerm}"`:""}`)):D(Er,null,D("ul",{class:"list section-list"},this.sections.map(s=>D("div",{key:s.section,class:"section-wrapper"},s.section&&D("div",{class:"section-title-wrapper"},D("orama-text",{as:"h2",styledAs:"span"},s.section)),D("ul",{class:"list section-item-list"},s.items.map(i=>D("li",{class:"list-item",key:i.id},D("a",{"focus-on-arrow-nav":!0,href:this.buildUrl(i.path),class:"list-item-button",target:this.linksTarget,rel:this.linksRel,id:`search-result-${i.id}`,onClick:l(c=>this.handleItemClick(c,i),"onClick")},D("div",{class:"result-item-icon-wrapper"},i.icon?D("img",{alt:"",class:"custom-result-item-icon",src:i.icon}):D("ph-files",{size:"20px"})),D("div",{class:"textWrapper"},D("orama-text",{as:"h3",styledAs:"p",class:"result-title collapsed"},this.highlightTitle?i.title.length>200?D("span",{innerHTML:this.getHighlightedTitleText(i.title).trim(200)}):D("span",{innerHTML:this.getHighlightedTitleText(i.title).HTML}):D("span",{innerHTML:i.title})),D("orama-text",{as:"p",styledAs:"span",class:"result-description collapsed",variant:"tertiary"},this.highlightDescription?D("span",{innerHTML:this.getHighlightedDescriptionText(i.description).HTML}):D("span",{innerHTML:i.description}))))))))))):D("div",{class:"suggestions-wrapper"},!!(!((e=this.suggestions)===null||e===void 0)&&e.length)&&D("orama-text",{as:"h2",styledAs:"small",class:"suggestions-title",variant:"secondary"},((t=this.dictionary)===null||t===void 0?void 0:t.suggestionsTitle)||"Suggestions"),D("orama-suggestions",{as:"list",suggestions:this.suggestions,icon:D(Iw,{name:"starFour",size:16,color:"var(--text-color-accent, text-color('accent')"}),suggestionClicked:l(s=>{this.setChatTerm(s)},"suggestionClicked")}))}get el(){return Sr(this)}};s8.style=FE;WE=".slide-backdrop.visible.sc-orama-sliding-panel{animation:backdropFadeIn .5s ease-in 1;background-color:hsla(0,0%,98%,.7);background-color:var(--backdrop-background-color-primary,hsla(0,0%,98%,.7));display:none;display:block;height:100vh;left:0;opacity:0;position:fixed;top:0;width:100vw;z-index:10009}@media (min-width:1024.02px){.slide-backdrop.visible.sc-orama-sliding-panel{display:block;opacity:1}}@keyframes backdropFadeIn{0%{opacity:0}50%{opacity:.2}to{opacity:1}}.slide-container.sc-orama-sliding-panel{background-color:#fbfbfb;background-color:var(--background-color-primary,#fbfbfb);border:1px solid #dadada;border:1px solid var(--border-color-primary,#dadada);border-radius:.75rem .75rem 0 0;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16))) var(--radius-m,calc(12rem/var(--orama-base-font-size, 16))) 0 0;bottom:0;box-sizing:border-box;color:#151515;color:var(--text-color-primary,#151515);height:95vh;left:0;position:fixed;transform:translate3d(0,calc(100% + 5vh),0);transition:.4s cubic-bezier(.4,0,.2,1);width:100%;z-index:10019}.slide-container.slide-up.sc-orama-sliding-panel{transform:translateZ(0)}@media (max-width:1024px){.slide-container.sc-orama-sliding-panel{display:none}}.slide-container-inner.sc-orama-sliding-panel{height:95vh;margin:0 auto;max-width:52.5rem;max-width:calc(840rem/var(--orama-base-font-size, 16));width:80%}.slide-container-inner.sc-orama-sliding-panel orama-chat.sc-orama-sliding-panel{height:100%}.slide-container-header.sc-orama-sliding-panel{box-sizing:border-box;display:flex;height:5vh;justify-content:flex-end;padding:0 2.5rem;padding:0 var(--spacing-3xl,calc(40rem/var(--orama-base-font-size, 16)));position:absolute;top:-5vh;width:100%}.close-button.sc-orama-sliding-panel{animation:showIn .3s cubic-bezier(.4,0,.2,1) .1s forwards;background-color:transparent;border:0;color:#151515;color:var(--text-color-primary,#151515);cursor:pointer}",i8=class{static{l(this,"SlideInPanel")}constructor(e){zt(this,e),this.backdrop=!1,this.open=!1,this.isOpen=this.open}openChanged(){this.isOpen=this.open}closePanel(){this.closed&&this.closed(),this.isOpen=!1}trapFocus(e){var t;let r=(t=this.el)===null||t===void 0?void 0:t.querySelectorAll('a[href], button, textarea, input, select, [tabindex]:not([tabindex="-1"])'),a=Array.from(r);if(a=a.filter(n=>n.tabIndex!==-1),a.length>0){this.firstFocusableElement=a[0],this.lastFocusableElement=a[a.length-1];let n=this.el.querySelector(":focus");e.shiftKey&&n===this.firstFocusableElement?(e.preventDefault(),this.lastFocusableElement.focus()):!e.shiftKey&&n===this.lastFocusableElement&&(e.preventDefault(),this.firstFocusableElement.focus())}}handleKeyDown(e){e.stopPropagation(),e.key==="Escape"&&this.closePanel(),e.key==="Tab"&&this.trapFocus(e)}componentDidLoad(){this.isOpen=this.open}render(){return D(cn,{key:"f88b00bf1fc61de9416fcbfe6401ff14d7865fd2"},D("div",{key:"dba8338860b889ca1bed7bf25de95be366f0a2f4",class:{"slide-container":!0,"slide-up":this.isOpen},tabIndex:this.isOpen?0:-1},D("div",{key:"1f7b7c593782897ca63527c93cf775985f3682d2",class:"slide-container-header"},D("button",{key:"08826ac5dc073eba459dd2fd9adbbe34521c48a5",onClick:l(()=>this.closePanel(),"onClick"),"aria-expanded":this.isOpen?"true":"false","aria-label":"Close panel","aria-controls":"panel",class:"close-button",type:"button"},D("ph-x",{key:"e1f618268881eeb161291e7b25accdc9835e453a",size:"18"}))),D("div",{key:"d032def08d136efb85b7dcc203b855c211024537",id:"panel","aria-hidden":!this.isOpen,tabindex:"-1",class:"slide-container-inner"},D("slot",{key:"63db6812e71a0cc1a7fd0bc630a5200632908562"}))),this.backdrop&&D("div",{key:"a1da61d3366e055e2c3bb40cc60dd2ad14a8e9ac",class:{"slide-backdrop":!0,visible:this.isOpen}}))}get el(){return Sr(this)}static get watchers(){return{open:["openChanged"]}}};i8.style=WE;qE=Object.defineProperty,KE=Object.getOwnPropertyDescriptor,yl=l((e,t,r,a)=>{for(var n=a>1?void 0:a?KE(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&qE(t,r,n),n},"s"),Cn=class extends dr{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${Cn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};Cn.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);Cn.styles=Cr` :host { display: contents; } `;yl([be({type:String,reflect:!0})],Cn.prototype,"size",2);yl([be({type:String,reflect:!0})],Cn.prototype,"weight",2);yl([be({type:String,reflect:!0})],Cn.prototype,"color",2);yl([be({type:Boolean,reflect:!0})],Cn.prototype,"mirrored",2);Cn=yl([Tr("ph-caret-right")],Cn);GE=".sources-outer-wrapper{margin:0 .5rem .75rem 1rem;margin:0 var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16))) var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)));overflow:hidden;position:relative}.source-next{left:0}.carousel-arrow,.source-next{bottom:0;position:absolute;top:0}.carousel-arrow{align-items:center;border:none;color:#838289;color:var(--text-color-secondary,#838289);cursor:pointer;display:flex;font-size:1.125rem;font-size:calc(18rem/var(--orama-base-font-size, 16));height:-moz-fit-content;height:fit-content;height:100%;justify-content:center;margin-block:auto;opacity:1;padding:0 .75rem;padding:0 var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));transition:color .2s,opacity .2s;z-index:1}.carousel-arrow.hidden{opacity:0;pointer-events:none}.carousel-arrow:focus:not(.hidden),.carousel-arrow:hover:not(.hidden){color:#151515;color:var(--text-color-primary,#151515)}.carousel-arrow--prev{background:linear-gradient(-90deg,transparent,70%,#fbfbfb);background:linear-gradient(-90deg,transparent,70%,var(--background-color-primary,#fbfbfb));left:0}.carousel-arrow--next{background:linear-gradient(90deg,transparent,30%,#fbfbfb);background:linear-gradient(90deg,transparent,30%,var(--background-color-primary,#fbfbfb));right:0}.sources-wrapper{display:flex;overflow-x:auto;overflow-x:scroll;position:relative;scroll-behavior:smooth;scrollbar-width:none}.source{background:#fff;background:var(--background-color-secondary,#fff);border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)));flex-grow:0;flex-shrink:0;overflow:hidden;padding:.75rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));position:relative;text-decoration:none;width:12.1875rem;width:calc(195rem/var(--orama-base-font-size, 16))}.source .source-subtitle,.source .source-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (hover:hover){.source:hover{background:#eee9f6;background:var(--background-color-tertiary,#eee9f6);transition:background .2s ease-in-out}}.source-inner-wrapper{display:flex;padding-right:.5rem;padding-right:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));position:relative}.source-inner-wrapper:last-of-type{padding-right:1rem;padding-right:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}.sr-only{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}",ji=0,l8=class{static{l(this,"OramaSources")}constructor(e){zt(this,e),this.answerSourceClick=qt(this,"answerSourceClick"),this.sourceBaseURL="",this.linksTarget="_blank",this.linksRel="noopener noreferrer",this.isCarouselScrollAtEnd=!1,this.isCarouselScrollAtStart=!1,this.handleCarouselScroll=()=>{this.computeCarouselArrowsVisibility()},this.handleItemClick=(t,r)=>{if(this.answerSourceClick.emit({source:r}).defaultPrevented){t.preventDefault();return}if(!r?.path)throw new Error("No path found")},this.resizeObserver=new ResizeObserver(()=>{this.computeCarouselArrowsVisibility()})}buildUrl(e){if(!e)return"#";if(this.sourceBaseURL){let t=this.sourceBaseURL.replace(/\/+$/,""),r=e.replace(/^\/+/,"");return`${t}/${r}`}return e}getNextItemCarousel(e,t){for(let r=0;ro.right)return a}return null}getPreviousItemCarousel(e,t){var r;for(let a=0;a=s.left&&o.right-ji<=s.right)return(r=t[a-1])!==null&&r!==void 0?r:null;if(o.left-jis.right)return n}return null}handleCarouselMove(e){let t=this.carouselSourceRef;if(!t)return;let r=t.getElementsByClassName("source-inner-wrapper");if(e==="forward"){let a=this.getNextItemCarousel(t,r);a&&a.scrollIntoView({behavior:"smooth",inline:"end",block:"nearest"})}else{let a=this.getPreviousItemCarousel(t,r);a&&a.scrollIntoView({behavior:"smooth",inline:"start",block:"nearest"})}}computeCarouselArrowsVisibility(){let e=this.carouselSourceRef;if(!e)return;let t=e.getElementsByClassName("source-inner-wrapper");this.isCarouselScrollAtEnd=!this.getNextItemCarousel(e,t),this.isCarouselScrollAtStart=!this.getPreviousItemCarousel(e,t)}componentDidLoad(){var e;(e=this.carouselSourceRef)===null||e===void 0||e.addEventListener("scroll",this.handleCarouselScroll),this.computeCarouselArrowsVisibility(),this.carouselSourceRef&&this.resizeObserver.observe(this.carouselSourceRef)}disconnectedCallback(){var e;(e=this.carouselSourceRef)===null||e===void 0||e.removeEventListener("scroll",this.handleCarouselScroll),this.resizeObserver.disconnect()}hasHorizontalOverflow(e){return e?e.scrollWidth>e.clientWidth:!1}render(){var e;if(!((e=this.sources)===null||e===void 0)&&e.length)return D("host",null,D("div",{class:{"sources-outer-wrapper":!0,"oveflow-decorator":this.hasHorizontalOverflow(this.carouselSourceRef)}},D("h2",{class:"sr-only"},"Sources"),D("button",{class:{"carousel-arrow carousel-arrow--prev":!0,hidden:this.isCarouselScrollAtStart},onClick:l(()=>this.handleCarouselMove("backwards"),"onClick"),type:"button"},D("ph-caret-left",null)),D("button",{class:{"carousel-arrow carousel-arrow--next":!0,hidden:this.isCarouselScrollAtEnd},onClick:l(()=>this.handleCarouselMove("forward"),"onClick"),type:"button"},D("ph-caret-right",null)),D("div",{class:"sources-wrapper",ref:l(t=>{this.carouselSourceRef=t},"ref")},this.sources.map((t,r)=>{if(t.title&&t.path||t.description&&t.path)return D("div",{class:"source-inner-wrapper",key:`source-${r}`,style:{position:"relative",display:"flex"}},D("a",{href:this.buildUrl(t.path),class:"source",target:this.linksTarget,rel:this.linksRel,id:`source-${r}`,onClick:l(a=>this.handleItemClick(a,t),"onClick")},D("orama-text",{as:"h3",styledAs:"span",class:"source-title"},t.title),D("orama-text",{as:"p",styledAs:"span",class:"source-subtitle",variant:"tertiary"},t.description)))}))))}};l8.style=GE;YE=".suggestions-chips.sc-orama-suggestions{align-items:center;display:flex;gap:.75rem;gap:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));list-style:none;margin:0;overflow-x:auto;padding:.5rem 1rem;padding:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16))) var(--radius-l,calc(16rem/var(--orama-base-font-size, 16)))}.suggestions-chips.sc-orama-suggestions::-webkit-scrollbar{background-color:transparent;height:0}@media (min-width:768.02px){.suggestions-chips.sc-orama-suggestions{flex-wrap:wrap;justify-content:center}}.suggestion-button-chips.sc-orama-suggestions{align-items:center;background-color:#fff;background-color:var(--background-color-secondary,#fff);border:1px solid #dadada;border:1px solid var(--border-color-primary,#dadada);border-radius:1rem;border-radius:var(--radius-l,calc(16rem/var(--orama-base-font-size, 16)));color:#151515;color:var(--text-color-primary,#151515);color:#838289;color:var(--text-color-secondary,#838289);-moz-column-gap:.5rem;column-gap:.5rem;-moz-column-gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));column-gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));cursor:pointer;display:flex;font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.25;line-height:var(--font-line-height-s,1.25);margin:0;padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));transition:background-color .2s;width:-moz-max-content;width:max-content}@media (hover:hover){.suggestion-button-chips.sc-orama-suggestions:hover{background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6)}}.suggestion-button-chips.sc-orama-suggestions:focus-visible{border:1px solid #432d77;border:1px solid var(--border-color-accent,#432d77);outline:none}.suggestions-list.sc-orama-suggestions{align-items:center;display:flex;flex-wrap:wrap;list-style:none;margin:0;padding:0}.suggestion-item-list.sc-orama-suggestions{width:100%}.suggestion-button-list.sc-orama-suggestions{align-items:center;background-color:transparent;background:linear-gradient(90deg,#ae8ff7,#151515);background:linear-gradient(90deg,var(--text-color-accent,#ae8ff7) 0,var(--text-color-primary,#151515) 100%);-webkit-background-clip:text;background-clip:text;color:#838289;color:var(--text-color-secondary,#838289);-moz-column-gap:.5rem;column-gap:.5rem;-moz-column-gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));column-gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));cursor:pointer;display:flex;font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));padding:.5rem .75rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));text-align:left;-webkit-text-fill-color:transparent;border:1px solid transparent;font-family:inherit;width:100%}.suggestion-button-list.sc-orama-suggestions:focus-visible{border:1px solid #432d77;border:1px solid var(--border-color-accent,#432d77);border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)));outline:none}",c8=class{static{l(this,"OramaSuggestions")}constructor(e){zt(this,e),this.as="chips"}handleClick(e){this.suggestionClicked&&this.suggestionClicked(e)}render(){var e;let t=this.as==="chips",r=this.as==="list",a=t?"chips":r?"list":"";return!((e=this.suggestions)===null||e===void 0)&&e.length?D("ul",{class:`suggestions-${a}`},this.suggestions.map(n=>D("li",{key:n.split(" ").join("-").toLowerCase(),class:`suggestion-item-${a}`},D("button",{"focus-on-arrow-nav":!0,type:"button",class:`suggestion-button-${a}`,onClick:l(o=>{o.preventDefault(),this.handleClick(n)},"onClick")},this.icon,n)))):null}};c8.style=YE;QE=".p.sc-orama-text{color:#151515;color:var(--text-color-primary,#151515);font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.5;line-height:var(--font-line-height-m,1.5);margin:0;padding:0}@media (min-width:768.02px){.p.sc-orama-text{font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)))}}.p-secondary.sc-orama-text{color:#838289;color:var(--text-color-secondary,#838289);font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.5;line-height:var(--font-line-height-m,1.5);margin:0;padding:0}@media (min-width:768.02px){.p-secondary.sc-orama-text{font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)))}}.p-tertiary.sc-orama-text{color:#99989d;color:var(--text-color-tertiary,#99989d);font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.5;line-height:var(--font-line-height-m,1.5);margin:0;padding:0}@media (min-width:768.02px){.p-tertiary.sc-orama-text{font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)))}}.span.sc-orama-text{color:#151515;color:var(--text-color-primary,#151515)}.span.sc-orama-text,.span-secondary.sc-orama-text{font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.25;line-height:var(--font-line-height-s,1.25);margin:0;padding:0}.span-secondary.sc-orama-text{color:#838289;color:var(--text-color-secondary,#838289)}.span-tertiary.sc-orama-text{color:#99989d;color:var(--text-color-tertiary,#99989d);font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.25;line-height:var(--font-line-height-s,1.25);margin:0;padding:0}.small.sc-orama-text{color:#151515;color:var(--text-color-primary,#151515)}.small.sc-orama-text,.small-secondary.sc-orama-text{font-size:.75rem;font-size:var(--font-size-xs,calc(12rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.25;line-height:var(--font-line-height-s,1.25);margin:0;padding:0}.small-secondary.sc-orama-text{color:#838289;color:var(--text-color-secondary,#838289)}.small-tertiary.sc-orama-text{color:#99989d;color:var(--text-color-tertiary,#99989d);font-size:.75rem;font-size:var(--font-size-xs,calc(12rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.25;line-height:var(--font-line-height-s,1.25);margin:0;padding:0}.text-bold.sc-orama-text{font-weight:600;font-weight:var(--font-weight-semibold,600)}.text-left.sc-orama-text{text-align:left}.text-right.sc-orama-text{text-align:right}.text-center.sc-orama-text{text-align:center}.text-inactive.sc-orama-text{color:#99989d;color:var(--text-color-inactive,#99989d)}",d8=class{static{l(this,"OramaText")}constructor(e){zt(this,e),this.as="p",this.bold=!1,this.variant="primary"}render(){let e=this.styledAs==="span"||this.styledAs==="small"||this.styledAs==="p"?this.styledAs:this.as,t=this.as,r=["as","styled-as","class"],a=Gi(this.el,r);return D(t,Object.assign({key:"a1c41477fc4643a8fd1eba038a39117311e17a20",class:{[e]:!0,[`text-${this.align}`]:!!this.align,[`${e}-${this.variant}`]:!0,"text-inactive":!!this.inactive,"text-bold":!!this.bold,[this.class]:!!this.class}},a),D("slot",{key:"d78c56927befa49cf5f54ab77dd76c9ab3797770"}))}get el(){return Sr(this)}};d8.style=QE;XE=".sc-orama-textarea-h{align-items:center;background:#fff;background:var(--background-color-secondary,#fff);border:1px solid #dadada;border:1px solid var(--border-color-primary,#dadada);border-radius:1rem;border-radius:var(--textarea-radius,var(--radius-l,calc(16rem/var(--orama-base-font-size, 16))));box-shadow:#fff;box-shadow:var(--textarea-shadow,var(--shadow-color-primary,#fff));display:flex;padding:.25rem .25rem .25rem .75rem;padding:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));position:relative}.sc-orama-textarea-s>[slot=adornment-end]{align-items:center;display:flex;justify-content:center}.textarea.sc-orama-textarea{background:none;border:none;color:#151515;color:var(--text-color-primary,#151515);font-family:inherit;font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)));font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);left:0;line-height:1.5;line-height:var(--font-line-height-m,1.5);margin:0;outline:none;padding:0;resize:none;right:0;transition:height .1s;width:100%}@media (min-width:768.02px){.textarea.sc-orama-textarea{font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));padding:.5rem 0;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) 0}}.textarea.sc-orama-textarea::-moz-placeholder{color:#99989d;color:var(--text-color-inactive,#99989d);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:95%}.textarea.sc-orama-textarea::placeholder{color:#99989d;color:var(--text-color-inactive,#99989d);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:95%}.textarea.sc-orama-textarea:focus-visible{border-color:#432d77;border-color:var(--border-color-accent,#432d77);outline:none}.textarea.sc-orama-textarea::-webkit-scrollbar{width:.3em}.textarea.sc-orama-textarea::-webkit-scrollbar-track{background:transparent}.textarea.sc-orama-textarea::-webkit-scrollbar-thumb{background-color:hsla(0,0%,70%,.522);border-radius:1rem;border-radius:var(--border-radius-l,calc(16rem/var(--orama-base-font-size, 16)))}@media (min-width:768.02px){.textarea.sc-orama-textarea{font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)))}}",u8=class{static{l(this,"OramaTextarea")}constructor(e){zt(this,e),this.value="",this.minRows=1,this.autoFocus=!1,this.handleChange=t=>{let r=t.target;this.value||this.syncHeight(),this.value=r.value}}handleAutoFocusChange(){this.autoFocus&&this.textarea.focus()}componetWillLoad(){this.startAdornmentWidth=this.getNamedSlotWidth("adornment-start"),this.endAdornmentWidth=this.getNamedSlotWidth("adornment-end"),this.syncHeight(),this.autoFocus&&this.textarea.focus()}getNamedSlotWidth(e){let t=this.el.querySelector(`slot[name="${e}"]`);if(t){let r=t.assignedElements();if(r.length>0)return r[0].offsetWidth}return 0}handlePropsChange(){this.syncHeight()}getStyleValue(e){return Number.parseInt(e,10)||0}calculateTextareaStyles(){let e=this.textarea,t=window.getComputedStyle(e);if(t.width==="0px")return{outerHeightStyle:0,overflowing:!1};let r=this.shadowTextarea;r.style.width=t.width,r.value=e.value||this.placeholder||"x",r.value.slice(-1)===` `&&(r.value+=" ");let a=t.boxSizing,n=this.getStyleValue(t.paddingBottom)+this.getStyleValue(t.paddingTop),o=this.getStyleValue(t.borderBottomWidth)+this.getStyleValue(t.borderTopWidth),s=r.scrollHeight;r.value="x";let i=r.scrollHeight,c=s;this.minRows&&(c=Math.max(Number(this.minRows)*i,c)),this.maxRows&&(c=Math.min(Number(this.maxRows)*i,c)),c=Math.max(c,i);let u=c+(a==="border-box"?n+o:0),p=Math.abs(c-s)<=1;return{outerHeightStyle:u,overflowing:p}}syncHeight(){let e=this.calculateTextareaStyles();if(!e)return;let t=e.outerHeightStyle;this.height!==t&&(this.height=t,this.textarea.style.height=`${t}px`),this.textarea.style.overflow=e.overflowing?"hidden":""}getAllProps(){let e={};for(let t=0;tthis.textarea=e,"ref"),rows:Number(this.minRows),style:{height:this.height?`${this.height}px`:void 0,paddingLeft:this.startAdornmentWidth?`${this.startAdornmentWidth}px`:void 0,paddingRight:this.endAdornmentWidth?`${this.endAdornmentWidth}px`:void 0},class:"textarea",placeholder:this.placeholder})),D("slot",{key:"515eb08d900f216a6e1a70a45287750fb4eec53f",name:"adornment-end"}),D("textarea",{key:"76d4ec4a7a7ecae613a1dc47beec8716e652acab","aria-hidden":"true",readonly:!0,ref:l(e=>this.shadowTextarea=e,"ref"),tabindex:-1,class:"textarea",style:{visibility:"hidden",position:"absolute",overflow:"hidden",height:"0",top:"0",left:"0",transform:"translateZ(0)",paddingTop:"0",paddingBottom:"0",paddingLeft:this.startAdornmentWidth?`${this.startAdornmentWidth}px`:void 0,paddingRight:this.endAdornmentWidth?`${this.endAdornmentWidth}px`:void 0}}))}get el(){return Sr(this)}static get watchers(){return{autoFocus:["handleAutoFocusChange"],value:["handlePropsChange"],maxRows:["handlePropsChange"],minRows:["handlePropsChange"]}}};u8.style=XE;JE=Object.defineProperty,e$=Object.getOwnPropertyDescriptor,bl=l((e,t,r,a)=>{for(var n=a>1?void 0:a?e$(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&JE(t,r,n),n},"l"),An=class extends dr{static{l(this,"a")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Ar` ${An.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};An.weightsMap=new Map([["thin",le``],["light",le``],["regular",le``],["bold",le``],["fill",le``],["duotone",le``]]);An.styles=Cr` :host { display: contents; } `;bl([be({type:String,reflect:!0})],An.prototype,"size",2);bl([be({type:String,reflect:!0})],An.prototype,"weight",2);bl([be({type:String,reflect:!0})],An.prototype,"color",2);bl([be({type:Boolean,reflect:!0})],An.prototype,"mirrored",2);An=bl([Tr("ph-sparkle")],An);t$='.sc-orama-toggler-h{align-items:center;background:#efefef;background:var(--background-color-fourth,#efefef);border-radius:2.5rem;border-radius:var(--radius-3xl,calc(40rem/var(--orama-base-font-size, 16)));display:inline-flex;overflow:hidden;padding:.125rem;padding:var(--spacing-2xs,calc(2rem/var(--orama-base-font-size, 16)))}.sc-orama-toggler-h button.sc-orama-toggler{align-items:center;background-color:transparent;border:none;color:#151515;color:var(--text-color-primary,#151515);cursor:pointer;display:flex;gap:.25rem;gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));padding:.5rem .75rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));position:relative}.sc-orama-toggler-h button.selected.sc-orama-toggler{color:#fff;color:var(--text-color-reverse,#fff);transition:color .3s ease-in-out;z-index:1}.sc-orama-toggler-h button.selected.sc-orama-toggler:after{background-color:#000;background-color:var(--background-color-reverse,#000);border-radius:2.5rem;border-radius:var(--radius-3xl,calc(40rem/var(--orama-base-font-size, 16)));content:"";inset:0;padding:.5rem .75rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));position:absolute;z-index:-1}.sc-orama-toggler-h button.selected.animate.sc-orama-toggler:after{animation:slideToLeft .3s ease-in-out}.sc-orama-toggler-h button.selected.animate.sc-orama-toggler:first-child:after{animation:slideToRight .3s ease-in-out}@keyframes slideToRight{0%{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideToLeft{0%{transform:translateX(-100%)}to{transform:translateX(0)}}',r$=function(e,t,r,a){var n=arguments.length,o=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(s=e[i])&&(o=(n<3?s(o):n>3?s(t,r,o):s(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o},qf=class{static{l(this,"OramaToggler")}constructor(e){zt(this,e),this.performInitialAnimation=!1,this.firstRender=!0}componentWillLoad(){this.performInitialAnimation&&(this.firstRender=!1)}componentDidLoad(){this.firstRender&&(this.firstRender=!1)}render(){return D(Er,{key:"b5f2e4d25150746ea7d8c8f49ce65810709c62f7"},D("button",{key:"d4216bdf455ca829574dcfd2caab5f0e081da74a",type:"button",class:{selected:this.globalStore.state.currentTask==="search",animate:!this.firstRender||this.performInitialAnimation},onClick:l(()=>this.globalStore.state.currentTask="search","onClick")},D("span",{key:"d8a05a2f1c92c27c3189e4e3682f5d162973af60"},"Search"),D("ph-magnifying-glass",{key:"c2cca7b67b39d6db8edf9a05f18e12c41510c790",size:16})),D("button",{key:"793b326cd3b463bbcc9604cb04b0671418540d04",type:"button",class:{selected:this.globalStore.state.currentTask==="chat",animate:!this.firstRender||this.performInitialAnimation},onClick:l(()=>this.globalStore.state.currentTask="chat","onClick")},D("ph-sparkle",{key:"8d6aaffc7c5984026397228d71fbc4fe7f03a9ea",size:16}),D("span",{key:"3879f5cc81113d6c74b6c9e6f71ed1b6e0ba9500"},"Ask AI")))}};r$([Tn("global")],qf.prototype,"globalStore",void 0);qf.style=t$;});var Yf={};xh(Yf,{orama_logo_icon:()=>h8});var a$,h8,Qf=no(()=>{E();Ed();Ss();a$='.sc-orama-logo-icon-h{align-items:center;color:#fff;color:var(--background-color-secondary,#fff);display:inline-flex;font-family:font("primary");font-family:var(--font-primary,font("primary"));height:-moz-fit-content;height:fit-content;justify-content:center;width:-moz-fit-content;width:fit-content}',h8=class{static{l(this,"OramaLogoIcon")}constructor(e){zt(this,e),this.size=70}render(){return D(Er,{key:"2235bf70720b88feb2f9d3cedefb6979e608fe59"},D("svg",{key:"c67fc33bf404899128f6d3118c2383c936c1ec44",xmlns:"http://www.w3.org/2000/svg",width:this.size,height:this.size,viewBox:"0 0 70 70",fill:"none","aria-label":"Orama Logo",role:"img"},D("g",{key:"5940f52745ad3c98e108cdb63548f1b299248d1f","clip-path":"url(#clip0_283_10066)"},D("path",{key:"1a315205b5d0a1aca164d9ac820cc8838e3a95f4","fill-rule":"evenodd","clip-rule":"evenodd",d:"M68.5351 26.2601C68.5469 26.5629 68.552 26.8675 68.552 27.1737C68.552 36.7741 63.0209 45.0801 54.9771 49.0868C53.9924 50.5351 52.83 51.8819 51.4899 53.0951C51.4527 53.1256 51.4172 53.1577 51.3817 53.1899C41.382 62.132 26.0305 61.2742 17.09 51.2762C8.18674 41.3171 8.99889 26.057 18.8751 17.0996C18.9191 17.0624 18.9614 17.0252 19.0053 16.9879C28.8375 8.19634 44.3125 8.72594 51.9113 17.1944C52.1008 17.4059 52.297 17.6123 52.4933 17.8187C52.5441 17.8729 52.5948 17.927 52.6456 17.9811C52.676 18.0133 52.7048 18.0471 52.7353 18.0793C52.7454 18.0911 52.7573 18.103 52.7674 18.1165C52.7962 18.1487 52.8232 18.1791 52.852 18.2113C52.8622 18.2231 52.874 18.2349 52.8841 18.2468C52.9146 18.2823 52.9468 18.3179 52.9772 18.3534C52.984 18.3618 52.9907 18.3686 52.9975 18.3771C53.0364 18.4228 53.0737 18.4684 53.1126 18.5141C53.1143 18.5158 53.1143 18.5158 53.116 18.5175C53.1515 18.5598 53.187 18.6038 53.2225 18.6478C53.2327 18.6596 53.2429 18.6732 53.253 18.685C53.2801 18.7172 53.3055 18.751 53.3325 18.7831C53.3444 18.7984 53.3562 18.8136 53.3681 18.8288C53.3934 18.861 53.4171 18.8914 53.4425 18.9236C53.4544 18.9388 53.4662 18.954 53.478 18.9693C53.5034 19.0031 53.5305 19.0369 53.5559 19.0708C53.566 19.0843 53.5762 19.0962 53.5846 19.1097C53.6185 19.1554 53.654 19.2011 53.6878 19.2484C53.698 19.262 53.7065 19.2755 53.7166 19.2874C53.967 19.6325 54.2056 19.9895 54.4272 20.355C57.8028 25.4631 57.0126 32.4122 52.3123 36.6151C52.2716 36.6506 52.2327 36.6878 52.1938 36.7234C47.0282 41.2342 39.1756 40.7588 34.5903 35.632C34.5548 35.5914 34.5176 35.5525 34.482 35.5153C29.9712 30.3496 30.4466 22.4971 35.5734 17.9118C35.5869 17.8999 35.5987 17.8881 35.6123 17.8762C38.1655 15.609 41.6967 14.4618 45.1111 14.6192C45.859 14.653 46.5781 14.7494 47.26 14.9C42.6239 12.0389 36.5361 11.1235 30.6852 12.3908C26.3892 13.3231 22.9308 16.5159 21.6973 20.7357C19.5214 28.167 21.1186 36.522 26.6633 42.7181C26.7107 42.7722 26.7614 42.8247 26.8105 42.8755C35.3602 52.2643 49.9062 53.0325 59.3933 44.5421C59.4474 44.493 59.5015 44.4439 59.5523 44.3932C68.8667 35.9095 69.6924 21.5208 61.4084 12.0304C61.1902 11.7343 60.9651 11.4484 60.735 11.1692C48.9604 -3.43781 25.8461 -3.21954 12.0885 8.91883C12.0326 8.96451 11.9768 9.01188 11.921 9.06264C-2.45083 21.915 -3.6843 43.9786 9.16302 58.3521C9.16471 58.3538 9.1664 58.3572 9.16979 58.3589C21.9866 72.6918 43.9656 73.9574 58.3425 61.2217C58.3865 61.1845 58.4288 61.1473 58.4728 61.1101C68.5571 52.0867 71.667 38.4221 68.5351 26.2601Z",fill:"currentColor"})),D("defs",{key:"118481134564a16c0f233c08a9725bddf4433181"},D("clipPath",{key:"86311f5c5fba97ca869c0cf2fc6454250455145f",id:"clip0_283_10066"},D("rect",{key:"5a0f6e869db526deca5a40f2f5662b87efc4dcfe",width:"70",height:"70",fill:"white"})))))}};h8.style=a$});function mm(e){var t,r,a;return(a=(r=(t=e.head)==null?void 0:t.querySelector('meta[name="csp-nonce"]'))==null?void 0:r.getAttribute("content"))!=null?a:void 0}function R8(e,t){if(e.isOk){let r=t(e.value);return r instanceof Promise?r.then(a=>om(a)):om(r)}if(e.isErr){let r=e.value;return O8(r)}throw"should never get here"}function L8(e){return typeof e!="string"||!e.startsWith(rm)?e:I$.fromLocalValue(JSON.parse(atob(e.slice(rm.length))))}function zs(e,t,r){let a=0,n=[],o;for(;afunction(a){let n=[],o=this["s-sn"];a?.flatten&&console.error(` Flattening is not supported for Stencil non-shadow slots. You can use \`.childNodes\` to nested slot fallback content. If you have a particular use case, please open an issue on the Stencil repo. `);let s=this["s-cr"].parentElement;return(s.__childNodes?s.childNodes:wl(s.childNodes)).forEach(i=>{o===Zs(i)&&n.push(i)}),r?n.filter(i=>i.nodeType===1):n}.bind(e),"assignedFactory");e.assignedElements=t(!0),e.assignedNodes=t(!1)}function _l(e){e.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1,composed:!1}))}function Hd(e,t){var r;if(t=t||((r=e["s-ol"])==null?void 0:r.parentElement),!t)return{slotNode:null,slotName:""};let a=e["s-sn"]=Zs(e)||"",n=Qr(t,"childNodes");return{slotNode:zs(n,t.tagName,a)[0],slotName:a}}function La(e,t){let r;W$.includes(e)?r=Object.getOwnPropertyDescriptor(Element.prototype,e):q$.includes(e)&&(r=Object.getOwnPropertyDescriptor(Node.prototype,e)),r||(r=Object.getOwnPropertyDescriptor(t,e)),r&&Object.defineProperty(t,"__"+e,r)}function Qr(e,t){if("__"+t in e){let r=e["__"+t];return typeof r!="function"?r:r.bind(e)}else return typeof e[t]!="function"?e[t]:e[t].bind(e)}function lm(e,t,r,a,n,o,s,i,c){a["s-sr"]=!0,r.$name$=e||null,r.$tag$="slot";let u=n?.$elm$?n.$elm$["s-id"]||n.$elm$.getAttribute("s-id"):"";if(i&&$t.document){let p=r.$elm$=$t.document.createElement(r.$tag$);r.$name$&&r.$elm$.setAttribute("name",e),u&&u!==r.$hostId$?n.$elm$.insertBefore(p,n.$elm$.children[0]):a.parentNode.insertBefore(r.$elm$,a),x8(c,t,e,a,r.$hostId$),a.remove(),r.$depth$==="0"&&(i[r.$index$]=r.$elm$)}else{let p=r.$elm$,h=u&&u!==r.$hostId$&&n.$elm$.shadowRoot;x8(c,t,e,a,h?u:r.$hostId$),ym(a),h&&n.$elm$.insertBefore(p,n.$elm$.children[0]),o.push(r)}s.push(r),n.$children$||(n.$children$=[]),n.$children$[r.$index$]=r}function dm(e){return e.includes("ref")?[...e.filter(t=>t!=="ref"),"ref"]:e}function wm(e,t,r,a){var n,o;let s;if(e&&typeof t["s-sn"]=="string"&&t["s-sr"]&&e.parentNode&&e.parentNode["s-sc"]&&(s=t["s-si"]||e.parentNode["s-sc"])){let i=t["s-sn"],c=t["s-hn"];if((n=r.classList)==null||n.add(s+"-s"),a&&(o=a.classList)!=null&&o.contains(s+"-s")){let u=(a.__childNodes||a.childNodes)[0],p=!1;for(;u;){if(u["s-sn"]!==i&&u["s-hn"]===c&&u["s-sr"]){p=!0;break}u=u.nextSibling}p||a.classList.remove(s+"-s")}}}var n$,o$,Bo,s$,i$,l$,c$,A8,T8,Xf,Jf,rm,_a,zt,d$,p8,Pn,em,u$,Od,h$,p$,f$,m$,g$,vl,Rd,f8,y$,E8,m8,$t,bK,xt,b$,v$,w$,$8,am,g8,P8,x$,y8,nm,pm,_$,k$,fm,S$,I$,C$,om,O8,A$,T$,jd,wl,gm,b8,Bd,Zs,E$,$$,P$,O$,R$,L$,M$,N$,D$,z$,Z$,j$,B$,H$,U$,V$,F$,M8,W$,q$,Qa,K$,D,Ds,Er,G$,Y$,v8,Q$,X$,sm,im,w8,x8,_8,bm,Ld,Sr,qt,N8,Ns,D8,z8,J$,vm,eP,tP,k8,rP,S8,Z8,aP,cm,Pd,Md,jo,Nd,Dd,Ud,na,zd,j8,Zd,B8,H8,nP,$d,xl,Ms,En,U8,V8,On,oP,F8,Vd,sP,I8,iP,lP,um,cP,tf,dP,rf,W8,$n,uP,hP,tm,q8,pP,hm,fP,mP,C8,gP,K8,cn,G8,yP,bP,vP,Ed=no(()=>{E();Ss();n$=ib({"./orama-button_25.entry.js":()=>Promise.resolve().then(()=>(Gf(),Kf)),"./orama-logo-icon.entry.js":()=>Promise.resolve().then(()=>(Qf(),Yf))}),o$="orama-ui",Bo={experimentalSlotFixes:!0,hydratedSelectorName:"hydrated",lazyLoad:!0,shadowDom:!0,slotRelocation:!0,updatable:!0},s$=Object.defineProperty,i$=l((e,t)=>{for(var r in t)s$(e,r,{get:t[r],enumerable:!0})},"__export"),l$="http://www.w3.org/2000/svg",c$="http://www.w3.org/1999/xhtml",A8=(e=>(e.Undefined="undefined",e.Null="null",e.String="string",e.Number="number",e.SpecialNumber="number",e.Boolean="boolean",e.BigInt="bigint",e))(A8||{}),T8=(e=>(e.Array="array",e.Date="date",e.Map="map",e.Object="object",e.RegularExpression="regexp",e.Set="set",e.Channel="channel",e.Symbol="symbol",e))(T8||{}),Xf="type",Jf="value",rm="serialized:",_a=l(e=>{if(e.__stencil__getHostRef)return e.__stencil__getHostRef()},"getHostRef"),zt=l((e,t)=>{e.__stencil__getHostRef=()=>t,t.$lazyInstance$=e},"registerInstance"),d$=l((e,t)=>{let r={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};r.$onReadyPromise$=new Promise(n=>r.$onReadyResolve$=n),e["s-p"]=[],e["s-rc"]=[];let a=r;return e.__stencil__getHostRef=()=>a,a},"registerHost"),p8=l((e,t)=>t in e,"isMemberInElement"),Pn=l((e,t)=>(0,console.error)(e,t),"consoleError"),em=new Map,u$=l((e,t,r)=>{let a=e.$tagName$.replace(/-/g,"_"),n=e.$lazyBundleId$;if(!n)return;let o=em.get(n);if(o)return o[a];if(!r||!Bo.hotModuleReplacement){let s=l(i=>(em.set(n,i),i[a]),"processMod");switch(n){case"orama-button_25":return Promise.resolve().then(()=>(Gf(),Kf)).then(s,Pn);case"orama-logo-icon":return Promise.resolve().then(()=>(Qf(),Yf)).then(s,Pn)}}return n$(`./${n}.entry.js`).then(s=>(em.set(n,s),s[a]),s=>{Pn(s,t.$hostElement$)})},"loadModule"),Od=new Map,h$="r",p$="o",f$="s",m$="t",g$="c",vl="s-id",Rd="sty-id",f8="c-id",y$="{visibility:hidden}.hydrated{visibility:inherit}",E8="slot-fb{display:contents}slot-fb[hidden]{display:none}",m8="http://www.w3.org/1999/xlink",$t=typeof window<"u"?window:{},bK=$t.HTMLElement||class{},xt={$flags$:0,$resourcesUrl$:"",jmp:l(e=>e(),"jmp"),raf:l(e=>requestAnimationFrame(e),"raf"),ael:l((e,t,r,a)=>e.addEventListener(t,r,a),"ael"),rel:l((e,t,r,a)=>e.removeEventListener(t,r,a),"rel"),ce:l((e,t)=>new CustomEvent(e,t),"ce")},b$=Bo.shadowDom,v$=(()=>{var e;let t=!1;try{(e=$t.document)==null||e.addEventListener("e",null,Object.defineProperty({},"passive",{get(){t=!0}}))}catch{}return t})(),w$=l(e=>Promise.resolve(e),"promiseResolve"),$8=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1})(),am=!1,g8=[],P8=[],x$=l((e,t)=>r=>{e.push(r),am||(am=!0,t&&xt.$flags$&4?pm(nm):xt.raf(nm))},"queueTask"),y8=l(e=>{for(let t=0;t{y8(g8),y8(P8),(am=g8.length>0)&&xt.raf(nm)},"flush"),pm=l(e=>w$().then(e),"nextTick"),_$=x$(P8,!0),k$=l(e=>e!=null&&e!==void 0,"isDef"),fm=l(e=>(e=typeof e,e==="object"||e==="function"),"isComplexType");l(mm,"queryNonceMetaTagContent");S$=l(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeRegExpSpecialCharacters"),I$=class Zo{static{l(this,"_RemoteValue")}static fromLocalValue(t){let r=t[Xf],a=Jf in t?t[Jf]:void 0;switch(r){case"string":return a;case"boolean":return a;case"bigint":return BigInt(a);case"undefined":return;case"null":return null;case"number":return a==="NaN"?NaN:a==="-0"?-0:a==="Infinity"?1/0:a==="-Infinity"?-1/0:a;case"array":return a.map(u=>Zo.fromLocalValue(u));case"date":return new Date(a);case"map":let n=new Map;for(let[u,p]of a){let h=typeof u=="object"&&u!==null?Zo.fromLocalValue(u):u,m=Zo.fromLocalValue(p);n.set(h,m)}return n;case"object":let o={};for(let[u,p]of a)o[u]=Zo.fromLocalValue(p);return o;case"regexp":let{pattern:s,flags:i}=a;return new RegExp(s,i);case"set":let c=new Set;for(let u of a)c.add(Zo.fromLocalValue(u));return c;case"symbol":return Symbol(a);default:throw new Error(`Unsupported type: ${r}`)}}static fromLocalValueArray(t){return t.map(r=>Zo.fromLocalValue(r))}static isLocalValueObject(t){if(typeof t!="object"||t===null||!t.hasOwnProperty(Xf))return!1;let r=t[Xf];return Object.values({...A8,...T8}).includes(r)?r!=="null"&&r!=="undefined"?t.hasOwnProperty(Jf):!0:!1}},C$={};i$(C$,{err:l(()=>O8,"err"),map:l(()=>R8,"map"),ok:l(()=>om,"ok"),unwrap:l(()=>A$,"unwrap"),unwrapErr:l(()=>T$,"unwrapErr")});om=l(e=>({isOk:!0,isErr:!1,value:e}),"ok"),O8=l(e=>({isOk:!1,isErr:!0,value:e}),"err");l(R8,"map");A$=l(e=>{if(e.isOk)return e.value;throw e.value},"unwrap"),T$=l(e=>{if(e.isErr)return e.value;throw e.value},"unwrapErr");l(L8,"deserializeProperty");jd=l(e=>{let t=Qr(e,"childNodes");e.tagName&&e.tagName.includes("-")&&e["s-cr"]&&e.tagName!=="SLOT-FB"&&zs(t,e.tagName).forEach(a=>{a.nodeType===1&&a.tagName==="SLOT-FB"&&(gm(a,Zs(a),!1).length?a.hidden=!0:a.hidden=!1)});let r=0;for(r=0;r{let t=[];for(let r=0;r{let a=[];(r&&e["s-sr"]||!e["s-sr"])&&a.push(e);let n=e;for(;n=n.nextSibling;)Zs(n)===t&&(r||!n["s-sr"])&&a.push(n);return a},"getSlotChildSiblings"),b8=l((e,t)=>e.nodeType===1?e.getAttribute("slot")===null&&t===""||e.getAttribute("slot")===t:e["s-sn"]===t?!0:t==="","isNodeLocatedInSlot"),Bd=l((e,t,r,a)=>{if(e["s-ol"]&&e["s-ol"].isConnected)return;let n=document.createTextNode("");if(n["s-nr"]=e,!t["s-cr"]||!t["s-cr"].parentNode)return;let o=t["s-cr"].parentNode,s=r?Qr(o,"prepend"):Qr(o,"appendChild");if(typeof a<"u"){n["s-oo"]=a;let i=Qr(o,"childNodes"),c=[n];i.forEach(u=>{u["s-nr"]&&c.push(u)}),c.sort((u,p)=>!u["s-oo"]||u["s-oo"]<(p["s-oo"]||0)?-1:!p["s-oo"]||p["s-oo"]s.call(o,u))}else s.call(o,n);e["s-ol"]=n,e["s-sh"]=t["s-hn"]},"addSlotRelocateNode"),Zs=l(e=>typeof e["s-sn"]=="string"?e["s-sn"]:e.nodeType===1&&e.getAttribute("slot")||void 0,"getSlotName");l(ym,"patchSlotNode");l(_l,"dispatchSlotChangeEvent");l(Hd,"findSlotFromSlottedNode");E$=l(e=>{$$(e),P$(e),L$(e),R$(e),z$(e),M$(e),N$(e),D$(e),Z$(e),j$(e),O$(e)},"patchPseudoShadowDom"),$$=l(e=>{let t=e.cloneNode;e.cloneNode=function(r){let a=this,n=a.shadowRoot&&b$,o=t.call(a,n?r:!1);if(!n&&r){let s=0,i,c,u=["s-id","s-cr","s-lr","s-rc","s-sc","s-p","s-cn","s-sr","s-sn","s-hn","s-ol","s-nr","s-si","s-rf","s-scs"],p=this.__childNodes||this.childNodes;for(;s!p[s][h]),i&&(o.__appendChild?o.__appendChild(i.cloneNode(!0)):o.appendChild(i.cloneNode(!0))),c&&o.appendChild(p[s].cloneNode(!0))}return o}},"patchCloneNode"),P$=l(e=>{e.__appendChild=e.appendChild,e.appendChild=function(t){let{slotName:r,slotNode:a}=Hd(t,this);if(a){Bd(t,a);let n=gm(a,r),o=n[n.length-1],s=Qr(o,"parentNode"),i=Qr(s,"insertBefore")(t,o.nextSibling);return _l(a),jd(this),i}return this.__appendChild(t)}},"patchSlotAppendChild"),O$=l(e=>{e.__removeChild=e.removeChild,e.removeChild=function(t){if(t&&typeof t["s-sn"]<"u"){let r=this.__childNodes||this.childNodes;if(zs(r,this.tagName,t["s-sn"])&&t.isConnected){t.remove(),jd(this);return}}return this.__removeChild(t)}},"patchSlotRemoveChild"),R$=l(e=>{e.__prepend=e.prepend,e.prepend=function(...t){t.forEach(r=>{typeof r=="string"&&(r=this.ownerDocument.createTextNode(r));let a=(r["s-sn"]=Zs(r))||"",n=Qr(this,"childNodes"),o=zs(n,this.tagName,a)[0];if(o){Bd(r,o,!0);let s=gm(o,a)[0],i=Qr(s,"parentNode"),c=Qr(i,"insertBefore")(r,Qr(s,"nextSibling"));return _l(o),c}return r.nodeType===1&&r.getAttribute("slot")&&(r.hidden=!0),e.__prepend(r)})}},"patchSlotPrepend"),L$=l(e=>{e.__append=e.append,e.append=function(...t){t.forEach(r=>{typeof r=="string"&&(r=this.ownerDocument.createTextNode(r)),this.appendChild(r)})}},"patchSlotAppend"),M$=l(e=>{let t=e.insertAdjacentHTML;e.insertAdjacentHTML=function(r,a){if(r!=="afterbegin"&&r!=="beforeend")return t.call(this,r,a);let n=this.ownerDocument.createElement("_"),o;if(n.innerHTML=a,r==="afterbegin")for(;o=n.firstChild;)this.prepend(o);else if(r==="beforeend")for(;o=n.firstChild;)this.append(o)}},"patchSlotInsertAdjacentHTML"),N$=l(e=>{e.insertAdjacentText=function(t,r){this.insertAdjacentHTML(t,r)}},"patchSlotInsertAdjacentText"),D$=l(e=>{let t=e;t.__insertBefore||(t.__insertBefore=e.insertBefore,e.insertBefore=function(r,a){let{slotName:n,slotNode:o}=Hd(r,this),s=this.__childNodes?this.childNodes:wl(this.childNodes);if(o){let c=!1;if(s.forEach(u=>{if(u===a||a===null){if(c=!0,a===null||n!==a["s-sn"]){this.appendChild(r);return}if(n===a["s-sn"]){Bd(r,o);let p=Qr(a,"parentNode");Qr(p,"insertBefore")(r,a),_l(o)}return}}),c)return r}let i=a?.__parentNode;return i&&!this.isSameNode(i)?this.appendChild(r):this.__insertBefore(r,a)})},"patchInsertBefore"),z$=l(e=>{let t=e.insertAdjacentElement;e.insertAdjacentElement=function(r,a){return r!=="afterbegin"&&r!=="beforeend"?t.call(this,r,a):r==="afterbegin"?(this.prepend(a),a):(r==="beforeend"&&this.append(a),a)}},"patchSlotInsertAdjacentElement"),Z$=l(e=>{La("textContent",e),Object.defineProperty(e,"textContent",{get:l(function(){let t="";return(this.__childNodes?this.childNodes:wl(this.childNodes)).forEach(r=>t+=r.textContent||""),t},"get"),set:l(function(t){(this.__childNodes?this.childNodes:wl(this.childNodes)).forEach(r=>{r["s-ol"]&&r["s-ol"].remove(),r.remove()}),this.insertAdjacentHTML("beforeend",t)},"set")})},"patchTextContent"),j$=l(e=>{let t=class extends Array{static{l(this,"FakeNodeList")}item(r){return this[r]}};La("children",e),Object.defineProperty(e,"children",{get(){return this.childNodes.filter(r=>r.nodeType===1)}}),Object.defineProperty(e,"childElementCount",{get(){return this.children.length}}),La("firstChild",e),Object.defineProperty(e,"firstChild",{get(){return this.childNodes[0]}}),La("lastChild",e),Object.defineProperty(e,"lastChild",{get(){return this.childNodes[this.childNodes.length-1]}}),La("childNodes",e),Object.defineProperty(e,"childNodes",{get(){let r=new t;return r.push(...wl(this.__childNodes)),r}})},"patchChildSlotNodes"),B$=l(e=>{!e||e.__nextSibling!==void 0||!globalThis.Node||(H$(e),V$(e),M8(e),e.nodeType===Node.ELEMENT_NODE&&(U$(e),F$(e)))},"patchSlottedNode"),H$=l(e=>{!e||e.__nextSibling||(La("nextSibling",e),Object.defineProperty(e,"nextSibling",{get:l(function(){var t;let r=(t=this["s-ol"])==null?void 0:t.parentNode.childNodes,a=r?.indexOf(this);return r&&a>-1?r[a+1]:this.__nextSibling},"get")}))},"patchNextSibling"),U$=l(e=>{!e||e.__nextElementSibling||(La("nextElementSibling",e),Object.defineProperty(e,"nextElementSibling",{get:l(function(){var t;let r=(t=this["s-ol"])==null?void 0:t.parentNode.children,a=r?.indexOf(this);return r&&a>-1?r[a+1]:this.__nextElementSibling},"get")}))},"patchNextElementSibling"),V$=l(e=>{!e||e.__previousSibling||(La("previousSibling",e),Object.defineProperty(e,"previousSibling",{get:l(function(){var t;let r=(t=this["s-ol"])==null?void 0:t.parentNode.childNodes,a=r?.indexOf(this);return r&&a>-1?r[a-1]:this.__previousSibling},"get")}))},"patchPreviousSibling"),F$=l(e=>{!e||e.__previousElementSibling||(La("previousElementSibling",e),Object.defineProperty(e,"previousElementSibling",{get:l(function(){var t;let r=(t=this["s-ol"])==null?void 0:t.parentNode.children,a=r?.indexOf(this);return r&&a>-1?r[a-1]:this.__previousElementSibling},"get")}))},"patchPreviousElementSibling"),M8=l(e=>{!e||e.__parentNode||(La("parentNode",e),Object.defineProperty(e,"parentNode",{get:l(function(){var t;return((t=this["s-ol"])==null?void 0:t.parentNode)||this.__parentNode},"get"),set:l(function(t){this.__parentNode=t},"set")}))},"patchParentNode"),W$=["children","nextElementSibling","previousElementSibling"],q$=["childNodes","firstChild","lastChild","nextSibling","previousSibling","textContent","parentNode"];l(La,"patchHostOriginalAccessor");l(Qr,"internalCall");Qa=l((e,t="")=>()=>{},"createTime"),K$=l((e,t)=>()=>{},"uniqueTime"),D=l((e,t,...r)=>{let a=null,n=null,o=null,s=!1,i=!1,c=[],u=l(h=>{for(let m=0;mh[m]).join(" "))}}if(typeof e=="function")return e(t===null?{}:t,c,Y$);let p=Ds(e,null);return p.$attrs$=t,c.length>0&&(p.$children$=c),p.$key$=n,p.$name$=o,p},"h"),Ds=l((e,t)=>{let r={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return r.$attrs$=null,r.$key$=null,r.$name$=null,r},"newVNode"),Er={},G$=l(e=>e&&e.$tag$===Er,"isHost"),Y$={forEach:l((e,t)=>e.map(v8).forEach(t),"forEach"),map:l((e,t)=>e.map(v8).map(t).map(Q$),"map")},v8=l(e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),"convertToPublic"),Q$=l(e=>{if(typeof e.vtag=="function"){let r={...e.vattrs};return e.vkey&&(r.key=e.vkey),e.vname&&(r.name=e.vname),D(e.vtag,r,...e.vchildren||[])}let t=Ds(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},"convertToPrivate"),X$=l((e,t,r,a)=>{var n;let o=Qa("hydrateClient",t),s=e.shadowRoot,i=[],c=[],u=[],p=s?[]:null,h=Ds(t,null);h.$elm$=e,Object.entries(((n=a.$cmpMeta$)==null?void 0:n.$members$)||{}).forEach(([R,[B,G]])=>{var j;if(!(B&31))return;let N=G||R,T=e.getAttribute(N);if(T!==null){let U=Ld(T,B);(j=a?.$instanceValues$)==null||j.set(R,U)}});let m;{let R=a.$cmpMeta$;R&&R.$flags$&10&&e["s-sc"]?(m=e["s-sc"],e.classList.add(m+"-h")):e["s-sc"]&&delete e["s-sc"]}$t.document&&(!xt.$orgLocNodes$||!xt.$orgLocNodes$.size)&&im($t.document.body,xt.$orgLocNodes$=new Map),e[vl]=r,e.removeAttribute(vl),a.$vnode$=sm(h,i,c,p,e,e,r,u);let g=0,x=i.length,w;for(g;g{w.$elm$.appendChild(j.$elm$)})):w.$flags$|=1),B&&B.isConnected&&(s&&B["s-en"]===""&&B.parentNode.insertBefore(G,B.nextSibling),B.parentNode.removeChild(B),s||(G["s-oo"]=parseInt(w.$nodeId$))),xt.$orgLocNodes$.delete(R)}let k=[],C=u.length,A=0,$,L,M,O;for(A;A{R.$elm$.parentElement.classList.add(m+"-s")}),s&&!s.childNodes.length){let R=0,B=p.length;if(B){for(R;R{typeof G["s-sn"]!="string"&&(G.nodeType===1&&G.slot&&G.hidden?G.removeAttribute("hidden"):(G.nodeType===8||G.nodeType===3&&!G.wholeText.trim())&&G.parentNode.removeChild(G))})}}xt.$orgLocNodes$.delete(e["s-id"]),a.$hostElement$=e,o()},"initializeClientHydrate"),sm=l((e,t,r,a,n,o,s,i=[])=>{let c,u,p,h,m=n["s-sc"];if(o.nodeType===1){if(c=o.getAttribute(f8),c&&(u=c.split("."),u[0]===s||u[0]==="0")){p=w8({$flags$:0,$hostId$:u[0],$nodeId$:u[1],$depth$:u[2],$index$:u[3],$tag$:o.tagName.toLowerCase(),$elm$:o,$attrs$:{class:o.className||""}}),t.push(p),o.removeAttribute(f8),e.$children$||(e.$children$=[]),m&&(o["s-si"]=m,p.$attrs$.class+=" "+m);let x=p.$elm$.getAttribute("s-sn");typeof x=="string"&&(p.$tag$==="slot-fb"&&(lm(x,u[2],p,o,e,t,r,a,i),m&&o.classList.add(m)),p.$elm$["s-sn"]=x,p.$elm$.removeAttribute("s-sn")),p.$index$!==void 0&&(e.$children$[p.$index$]=p),e=p,a&&p.$depth$==="0"&&(a[p.$index$]=p.$elm$)}if(o.shadowRoot)for(h=o.shadowRoot.childNodes.length-1;h>=0;h--)sm(e,t,r,a,n,o.shadowRoot.childNodes[h],s,i);let g=o.__childNodes||o.childNodes;for(h=g.length-1;h>=0;h--)sm(e,t,r,a,n,g[h],s,i)}else if(o.nodeType===8){if(u=o.nodeValue.split("."),u[1]===s||u[1]==="0"){if(c=u[0],p=w8({$hostId$:u[1],$nodeId$:u[2],$depth$:u[3],$index$:u[4]||"0",$elm$:o,$attrs$:null,$children$:null,$key$:null,$name$:null,$tag$:null,$text$:null}),c===m$)p.$elm$=_8(o,3),p.$elm$&&p.$elm$.nodeType===3&&(p.$text$=p.$elm$.textContent,t.push(p),o.remove(),s===p.$hostId$&&(e.$children$||(e.$children$=[]),e.$children$[p.$index$]=p),a&&p.$depth$==="0"&&(a[p.$index$]=p.$elm$));else if(c===g$)p.$elm$=_8(o,8),p.$elm$&&p.$elm$.nodeType===8&&(t.push(p),o.remove());else if(p.$hostId$===s)if(c===f$){let g=o["s-sn"]=u[5]||"";lm(g,u[2],p,o,e,t,r,a,i)}else c===h$&&(a?o.remove():(n["s-cr"]=o,o["s-cn"]=!0))}}else if(e&&e.$tag$==="style"){let g=Ds(null,o.textContent);g.$elm$=o,g.$index$="0",e.$children$=[g]}else o.nodeType===3&&!o.wholeText.trim()&&o.remove();return e},"clientHydrate"),im=l((e,t)=>{if(e.nodeType===1){let r=e[vl]||e.getAttribute(vl);r&&t.set(r,e);let a=0;if(e.shadowRoot)for(;a({$flags$:0,$hostId$:null,$nodeId$:null,$depth$:null,$index$:"0",$elm$:null,$attrs$:null,$children$:null,$key$:null,$name$:null,$tag$:null,$text$:null,...e}),"createSimpleVNode");l(lm,"addSlot");x8=l((e,t,r,a,n)=>{let o=a.nextSibling;for(e[t]=e[t]||[];o&&((o.getAttribute&&o.getAttribute("slot")||o["s-sn"])===r||r===""&&!o["s-sn"]&&(o.nodeType===8&&o.nodeValue.indexOf(".")!==1||o.nodeType===3));)o["s-sn"]=r,e[t].push({slot:a,node:o,hostId:n}),o=o.nextSibling},"addSlottedNodes"),_8=l((e,t)=>{let r=e;do r=r.nextSibling;while(r&&(r.nodeType!==t||!r.nodeValue));return r},"findCorrespondingNode"),bm=l(e=>{let t=S$(e);return new RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${t}))(${t}\\b)`,"g")},"createSupportsRuleRe");bm("::slotted");bm(":host");bm(":host-context");Ld=l((e,t)=>{if(typeof e=="string"&&(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")))try{return e=JSON.parse(e),e}catch{}return typeof e=="string"&&e.startsWith(rm)?(e=L8(e),e):e!=null&&!fm(e)?t&4?e==="false"?!1:e===""||!!e:t&2?typeof e=="string"?parseFloat(e):typeof e=="number"?e:NaN:t&1?String(e):e:e},"parsePropertyValue"),Sr=l(e=>_a(e).$hostElement$,"getElement"),qt=l((e,t,r)=>{let a=Sr(e);return{emit:l(n=>N8(a,t,{bubbles:!0,composed:!0,cancelable:!0,detail:n}),"emit")}},"createEvent"),N8=l((e,t,r)=>{let a=xt.ce(t,r);return e.dispatchEvent(a),a},"emitEvent"),Ns=new WeakMap,D8=l((e,t,r)=>{let a=Od.get(e);$8&&r?(a=a||new CSSStyleSheet,typeof a=="string"?a=t:a.replaceSync(t)):a=t,Od.set(e,a)},"registerStyle"),z8=l((e,t,r)=>{var a;let n=vm(t),o=Od.get(n);if(!$t.document)return n;if(e=e.nodeType===11?e:$t.document,o)if(typeof o=="string"){e=e.head||e;let s=Ns.get(e),i;if(s||Ns.set(e,s=new Set),!s.has(n)){if(e.host&&(i=e.querySelector(`[${Rd}="${n}"]`)))i.innerHTML=o;else{i=document.querySelector(`[${Rd}="${n}"]`)||$t.document.createElement("style"),i.innerHTML=o;let c=(a=xt.$nonce$)!=null?a:mm($t.document);if(c!=null&&i.setAttribute("nonce",c),!(t.$flags$&1))if(e.nodeName==="HEAD"){let u=e.querySelectorAll("link[rel=preconnect]"),p=u.length>0?u[u.length-1].nextSibling:e.querySelector("style");e.insertBefore(i,p?.parentNode===e?p:null)}else if("host"in e)if($8){let u=new CSSStyleSheet;u.replaceSync(o),e.adoptedStyleSheets=[u,...e.adoptedStyleSheets]}else{let u=e.querySelector("style");u?u.innerHTML=o+u.innerHTML:e.prepend(i)}else e.append(i);t.$flags$&1&&e.insertBefore(i,null)}t.$flags$&4&&(i.innerHTML+=E8),s&&s.add(n)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return n},"addStyle"),J$=l(e=>{let t=e.$cmpMeta$,r=e.$hostElement$,a=t.$flags$,n=Qa("attachStyles",t.$tagName$),o=z8(r.shadowRoot?r.shadowRoot:r.getRootNode(),t);a&10&&(r["s-sc"]=o,r.classList.add(o+"-h")),n()},"attachStyles"),vm=l((e,t)=>"sc-"+e.$tagName$,"getScopeId"),eP=l(e=>e.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g,"$1{"),"convertScopedToShadow"),tP=l(()=>{if(!$t.document)return;let e=$t.document.querySelectorAll(`[${Rd}]`),t=0;for(;t{if(r===a)return;let i=p8(e,t),c=t.toLowerCase();if(t==="class"){let u=e.classList,p=S8(r),h=S8(a);e["s-si"]&&s?(h.push(e["s-si"]),p.forEach(m=>{m.startsWith(e["s-si"])&&h.push(m)}),h=[...new Set(h)],u.add(...h)):(u.remove(...p.filter(m=>m&&!h.includes(m))),u.add(...h.filter(m=>m&&!p.includes(m))))}else if(t==="style"){for(let u in r)(!a||a[u]==null)&&(u.includes("-")?e.style.removeProperty(u):e.style[u]="");for(let u in a)(!r||a[u]!==r[u])&&(u.includes("-")?e.style.setProperty(u,a[u]):e.style[u]=a[u])}else if(t!=="key")if(t==="ref")a&&a(e);else if(!i&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"?t=t.slice(3):p8($t,c)?t=c.slice(2):t=c[2]+t.slice(3),r||a){let u=t.endsWith(Z8);t=t.replace(aP,""),r&&xt.rel(e,t,r,u),a&&xt.ael(e,t,a,u)}}else{let u=fm(a);if((i||u&&a!==null)&&!n)try{if(e.tagName.includes("-"))e[t]!==a&&(e[t]=a);else{let h=a??"";t==="list"?i=!1:(r==null||e[t]!=h)&&(typeof e.__lookupSetter__(t)=="function"?e[t]=h:e.setAttribute(t,h))}}catch{}let p=!1;c!==(c=c.replace(/^xlink\:?/,""))&&(t=c,p=!0),a==null||a===!1?(a!==!1||e.getAttribute(t)==="")&&(p?e.removeAttributeNS(m8,t):e.removeAttribute(t)):(!i||o&4||n)&&!u&&e.nodeType===1&&(a=a===!0?"":a,p?e.setAttributeNS(m8,t,a):e.setAttribute(t,a))}},"setAccessor"),rP=/\s/,S8=l(e=>(typeof e=="object"&&e&&"baseVal"in e&&(e=e.baseVal),!e||typeof e!="string"?[]:e.split(rP)),"parseClassList"),Z8="Capture",aP=new RegExp(Z8+"$"),cm=l((e,t,r,a)=>{let n=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,o=e&&e.$attrs$||{},s=t.$attrs$||{};for(let i of dm(Object.keys(o)))i in s||k8(n,i,o[i],void 0,r,t.$flags$,a);for(let i of dm(Object.keys(s)))k8(n,i,o[i],s[i],r,t.$flags$,a)},"updateElement");l(dm,"sortedAttrNames");Nd=!1,Dd=!1,Ud=!1,na=!1,zd=l((e,t,r)=>{var a;let n=t.$children$[r],o=0,s,i,c;if(Nd||(Ud=!0,n.$tag$==="slot"&&(n.$flags$|=n.$children$?2:1)),n.$text$!==null)s=n.$elm$=$t.document.createTextNode(n.$text$);else if(n.$flags$&1)s=n.$elm$=$t.document.createTextNode(""),cm(null,n,na);else{if(na||(na=n.$tag$==="svg"),!$t.document)throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.");if(s=n.$elm$=$t.document.createElementNS(na?l$:c$,!Nd&&Bo.slotRelocation&&n.$flags$&2?"slot-fb":n.$tag$),na&&n.$tag$==="foreignObject"&&(na=!1),cm(null,n,na),k$(Pd)&&s["s-si"]!==Pd&&s.classList.add(s["s-si"]=Pd),n.$children$)for(o=0;o{xt.$flags$|=1;let t=e.closest(jo.toLowerCase());if(t!=null){let r=Array.from(t.__childNodes||t.childNodes).find(n=>n["s-cr"]),a=Array.from(e.__childNodes||e.childNodes);for(let n of r?a.reverse():a)n["s-sh"]!=null&&(On(t,n,r??null),n["s-sh"]=void 0,Ud=!0)}xt.$flags$&=-2},"relocateToHostRoot"),Zd=l((e,t)=>{xt.$flags$|=1;let r=Array.from(e.__childNodes||e.childNodes);if(e["s-sr"]&&Bo.experimentalSlotFixes){let a=e;for(;a=a.nextSibling;)a&&a["s-sn"]===e["s-sn"]&&a["s-sh"]===jo&&r.push(a)}for(let a=r.length-1;a>=0;a--){let n=r[a];n["s-hn"]!==jo&&n["s-ol"]&&(On(xl(n).parentNode,n,xl(n)),n["s-ol"].remove(),n["s-ol"]=void 0,n["s-sh"]=void 0,Ud=!0),t&&Zd(n,t)}xt.$flags$&=-2},"putBackInOriginalLocation"),B8=l((e,t,r,a,n,o)=>{let s=e["s-cr"]&&e["s-cr"].parentNode||e,i;for(s.shadowRoot&&s.tagName===jo&&(s=s.shadowRoot);n<=o;++n)a[n]&&(i=zd(null,r,n),i&&(a[n].$elm$=i,On(s,i,xl(t))))},"addVnodes"),H8=l((e,t,r)=>{for(let a=t;a<=r;++a){let n=e[a];if(n){let o=n.$elm$;V8(n),o&&(Dd=!0,o["s-ol"]?o["s-ol"].remove():Zd(o,!0),o.remove())}}},"removeVnodes"),nP=l((e,t,r,a,n=!1)=>{let o=0,s=0,i=0,c=0,u=t.length-1,p=t[0],h=t[u],m=a.length-1,g=a[0],x=a[m],w,k;for(;o<=u&&s<=m;)if(p==null)p=t[++o];else if(h==null)h=t[--u];else if(g==null)g=a[++s];else if(x==null)x=a[--m];else if($d(p,g,n))Ms(p,g,n),p=t[++o],g=a[++s];else if($d(h,x,n))Ms(h,x,n),h=t[--u],x=a[--m];else if($d(p,x,n))(p.$tag$==="slot"||x.$tag$==="slot")&&Zd(p.$elm$.parentNode,!1),Ms(p,x,n),On(e,p.$elm$,h.$elm$.nextSibling),p=t[++o],x=a[--m];else if($d(h,g,n))(p.$tag$==="slot"||x.$tag$==="slot")&&Zd(h.$elm$.parentNode,!1),Ms(h,g,n),On(e,h.$elm$,p.$elm$),h=t[--u],g=a[++s];else{for(i=-1,c=o;c<=u;++c)if(t[c]&&t[c].$key$!==null&&t[c].$key$===g.$key$){i=c;break}i>=0?(k=t[i],k.$tag$!==g.$tag$?w=zd(t&&t[s],r,i):(Ms(k,g,n),t[i]=void 0,w=k.$elm$),g=a[++s]):(w=zd(t&&t[s],r,s),g=a[++s]),w&&On(xl(p.$elm$).parentNode,w,xl(p.$elm$))}o>u?B8(e,a[m+1]==null?null:a[m+1].$elm$,r,a,s,m):s>m&&H8(t,o,u)},"updateChildren"),$d=l((e,t,r=!1)=>e.$tag$===t.$tag$?e.$tag$==="slot"?e.$name$===t.$name$:r?(r&&!e.$key$&&t.$key$&&(e.$key$=t.$key$),!0):e.$key$===t.$key$:!1,"isSameVnode"),xl=l(e=>e&&e["s-ol"]||e,"referenceNode"),Ms=l((e,t,r=!1)=>{let a=t.$elm$=e.$elm$,n=e.$children$,o=t.$children$,s=t.$tag$,i=t.$text$,c;i===null?(na=s==="svg"?!0:s==="foreignObject"?!1:na,s==="slot"&&!Nd&&e.$name$!==t.$name$&&(t.$elm$["s-sn"]=t.$name$||"",j8(t.$elm$.parentElement)),cm(e,t,na,r),n!==null&&o!==null?nP(a,n,t,o,r):o!==null?(e.$text$!==null&&(a.textContent=""),B8(a,null,t,o,0,o.length-1)):!r&&Bo.updatable&&n!==null&&H8(n,0,n.length-1),na&&s==="svg"&&(na=!1)):(c=a["s-cr"])?c.parentNode.textContent=i:e.$text$!==i&&(a.data=i)},"patch"),En=[],U8=l(e=>{let t,r,a,n=e.__childNodes||e.childNodes;for(let o of n){if(o["s-sr"]&&(t=o["s-cr"])&&t.parentNode){r=t.parentNode.__childNodes||t.parentNode.childNodes;let s=o["s-sn"];for(a=r.length-1;a>=0;a--)if(t=r[a],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==o["s-hn"]&&(!t["s-sh"]||t["s-sh"]!==o["s-hn"]))if(b8(t,s)){let i=En.find(c=>c.$nodeToRelocate$===t);Dd=!0,t["s-sn"]=t["s-sn"]||s,i?(i.$nodeToRelocate$["s-sh"]=o["s-hn"],i.$slotRefNode$=o):(t["s-sh"]=o["s-hn"],En.push({$slotRefNode$:o,$nodeToRelocate$:t})),t["s-sr"]&&En.map(c=>{b8(c.$nodeToRelocate$,t["s-sn"])&&(i=En.find(u=>u.$nodeToRelocate$===t),i&&!c.$slotRefNode$&&(c.$slotRefNode$=i.$slotRefNode$))})}else En.some(i=>i.$nodeToRelocate$===t)||En.push({$nodeToRelocate$:t})}o.nodeType===1&&U8(o)}},"markSlotContentForRelocation"),V8=l(e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(V8)},"nullifyVNodeRefs"),On=l((e,t,r)=>{if(typeof t["s-sn"]=="string"&&t["s-sr"]&&t["s-cr"])wm(t["s-cr"],t,e,t.parentElement);else if(typeof t["s-sn"]=="string"){e.getRootNode().nodeType!==11&&M8(t),e.insertBefore(t,r);let{slotNode:a}=Hd(t);return a&&_l(a),t}return e.__insertBefore?e.__insertBefore(t,r):e?.insertBefore(t,r)},"insertBefore");l(wm,"addRemoveSlotScopedClass");oP=l((e,t,r=!1)=>{var a,n,o,s,i;let c=e.$hostElement$,u=e.$cmpMeta$,p=e.$vnode$||Ds(null,null),h=G$(t)?t:D(null,null,t);if(jo=c.tagName,u.$attrsToReflect$&&(h.$attrs$=h.$attrs$||{},u.$attrsToReflect$.map(([m,g])=>h.$attrs$[g]=c[m])),r&&h.$attrs$)for(let m of Object.keys(h.$attrs$))c.hasAttribute(m)&&!["key","ref","style","class"].includes(m)&&(h.$attrs$[m]=c[m]);h.$tag$=null,h.$flags$|=4,e.$vnode$=h,h.$elm$=p.$elm$=c.shadowRoot||c,Pd=c["s-sc"],Nd=!!(u.$flags$&1)&&!(u.$flags$&128),Md=c["s-cr"],Dd=!1,Ms(p,h,r);{if(xt.$flags$|=1,Ud){U8(h.$elm$);for(let m of En){let g=m.$nodeToRelocate$;if(!g["s-ol"]&&$t.document){let x=$t.document.createTextNode("");x["s-nr"]=g,On(g.parentNode,g["s-ol"]=x,g)}}for(let m of En){let g=m.$nodeToRelocate$,x=m.$slotRefNode$;if(x){let w=x.parentNode,k=x.nextSibling;if(k&&k.nodeType===1){let $=(a=g["s-ol"])==null?void 0:a.previousSibling;for(;$;){let L=(n=$["s-nr"])!=null?n:null;if(L&&L["s-sn"]===g["s-sn"]&&w===(L.__parentNode||L.parentNode)){for(L=L.nextSibling;L===g||L?.["s-sr"];)L=L?.nextSibling;if(!L||!L["s-nr"]){k=L;break}}$=$.previousSibling}}let C=g.__parentNode||g.parentNode,A=g.__nextSibling||g.nextSibling;(!k&&w!==C||A!==k)&&g!==k&&(On(w,g,k),g.nodeType===1&&g.tagName!=="SLOT-FB"&&(g.hidden=(o=g["s-ih"])!=null?o:!1)),g&&typeof x["s-rf"]=="function"&&x["s-rf"](x)}else g.nodeType===1&&(r&&(g["s-ih"]=(s=g.hidden)!=null?s:!1),g.hidden=!0)}}Dd&&jd(h.$elm$),xt.$flags$&=-2,En.length=0}if(u.$flags$&2){let m=h.$elm$.__childNodes||h.$elm$.childNodes;for(let g of m)g["s-hn"]!==jo&&!g["s-sh"]&&(r&&g["s-ih"]==null&&(g["s-ih"]=(i=g.hidden)!=null?i:!1),g.hidden=!0)}Md=void 0},"renderVdom"),F8=l((e,t)=>{if(t&&!e.$onRenderResolve$&&t["s-p"]){let r=t["s-p"].push(new Promise(a=>e.$onRenderResolve$=()=>{t["s-p"].splice(r-1,1),a()}))}},"attachToAncestor"),Vd=l((e,t)=>{if(e.$flags$|=16,e.$flags$&4){e.$flags$|=512;return}return F8(e,e.$ancestorComponent$),_$(l(()=>sP(e,t),"dispatch"))},"scheduleUpdate"),sP=l((e,t)=>{let r=e.$hostElement$,a=Qa("scheduleUpdate",e.$cmpMeta$.$tagName$),n=e.$lazyInstance$;if(!n)throw new Error(`Can't render component <${r.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let o;return t?(e.$flags$|=256,e.$queuedListeners$&&(e.$queuedListeners$.map(([s,i])=>$n(n,s,i,r)),e.$queuedListeners$=void 0),o=$n(n,"componentWillLoad",void 0,r)):o=$n(n,"componentWillUpdate",void 0,r),o=I8(o,()=>$n(n,"componentWillRender",void 0,r)),a(),I8(o,()=>lP(e,n,t))},"dispatchHooks"),I8=l((e,t)=>iP(e)?e.then(t).catch(r=>{console.error(r),t()}):t(),"enqueue"),iP=l(e=>e instanceof Promise||e&&e.then&&typeof e.then=="function","isPromisey"),lP=l(async(e,t,r)=>{var a;let n=e.$hostElement$,o=Qa("update",e.$cmpMeta$.$tagName$),s=n["s-rc"];r&&J$(e);let i=Qa("render",e.$cmpMeta$.$tagName$);cP(e,t,n,r),s&&(s.map(c=>c()),n["s-rc"]=void 0),i(),o();{let c=(a=n["s-p"])!=null?a:[],u=l(()=>dP(e),"postUpdate");c.length===0?u():(Promise.all(c).then(u),e.$flags$|=4,c.length=0)}},"updateComponent"),um=null,cP=l((e,t,r,a)=>{try{um=t,t=t.render(),e.$flags$&=-17,e.$flags$|=2,oP(e,t,a)}catch(n){Pn(n,e.$hostElement$)}return um=null,null},"callRender"),tf=l(()=>um,"getRenderingRef"),dP=l(e=>{let t=e.$cmpMeta$.$tagName$,r=e.$hostElement$,a=Qa("postUpdate",t),n=e.$lazyInstance$,o=e.$ancestorComponent$;$n(n,"componentDidRender",void 0,r),e.$flags$&64?($n(n,"componentDidUpdate",void 0,r),a()):(e.$flags$|=64,uP(r),$n(n,"componentDidLoad",void 0,r),a(),e.$onReadyResolve$(r),o||W8()),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),e.$flags$&512&&pm(()=>Vd(e,!1)),e.$flags$&=-517},"postUpdateComponent"),rf=l(e=>{{let t=_a(e),r=t.$hostElement$.isConnected;return r&&(t.$flags$&18)===2&&Vd(t,!1),r}},"forceUpdate"),W8=l(e=>{pm(()=>N8($t,"appload",{detail:{namespace:o$}}))},"appDidLoad"),$n=l((e,t,r,a)=>{if(e&&e[t])try{return e[t](r)}catch(n){Pn(n,a)}},"safeCall"),uP=l(e=>{var t;return e.classList.add((t=Bo.hydratedSelectorName)!=null?t:"hydrated")},"addHydratedFlag"),hP=l((e,t)=>_a(e).$instanceValues$.get(t),"getValue"),tm=l((e,t,r,a)=>{let n=_a(e);if(!n)throw new Error(`Couldn't find host element for "${a.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);let o=n.$hostElement$,s=n.$instanceValues$.get(t),i=n.$flags$,c=n.$lazyInstance$;r=Ld(r,a.$members$[t][0]);let u=Number.isNaN(s)&&Number.isNaN(r),p=r!==s&&!u;if((!(i&8)||s===void 0)&&p&&(n.$instanceValues$.set(t,r),c)){if(a.$watchers$&&i&128){let h=a.$watchers$[t];h&&h.map(m=>{try{c[m](r,s,t)}catch(g){Pn(g,o)}})}if((i&18)===2){if(c.componentShouldUpdate&&c.componentShouldUpdate(r,s,t)===!1)return;Vd(n,!1)}}},"setValue"),q8=l((e,t,r)=>{var a,n;let o=e.prototype;if(t.$members$||t.$watchers$||e.watchers){e.watchers&&!t.$watchers$&&(t.$watchers$=e.watchers);let s=Object.entries((a=t.$members$)!=null?a:{});if(s.map(([i,[c]])=>{if(c&31||r&2&&c&32){let{get:u,set:p}=Object.getOwnPropertyDescriptor(o,i)||{};u&&(t.$members$[i][0]|=2048),p&&(t.$members$[i][0]|=4096),(r&1||!u)&&Object.defineProperty(o,i,{get(){{if((t.$members$[i][0]&2048)===0)return hP(this,i);let h=_a(this),m=h?h.$lazyInstance$:o;return m?m[i]:void 0}},configurable:!0,enumerable:!0}),Object.defineProperty(o,i,{set(h){let m=_a(this);if(p){let g=c&32?this[i]:m.$hostElement$[i];typeof g>"u"&&m.$instanceValues$.get(i)?h=m.$instanceValues$.get(i):!m.$instanceValues$.get(i)&&g&&m.$instanceValues$.set(i,g),p.apply(this,[Ld(h,c)]),h=c&32?this[i]:m.$hostElement$[i],tm(this,i,h,t);return}{if((r&1)===0||(t.$members$[i][0]&4096)===0){tm(this,i,h,t),r&1&&!m.$lazyInstance$&&m.$onReadyPromise$.then(()=>{t.$members$[i][0]&4096&&m.$lazyInstance$[i]!==m.$instanceValues$.get(i)&&(m.$lazyInstance$[i]=h)});return}let g=l(()=>{let x=m.$lazyInstance$[i];!m.$instanceValues$.get(i)&&x&&m.$instanceValues$.set(i,x),m.$lazyInstance$[i]=Ld(h,c),tm(this,i,m.$lazyInstance$[i],t)},"setterSetVal");m.$lazyInstance$?g():m.$onReadyPromise$.then(()=>g())}}})}}),r&1){let i=new Map;o.attributeChangedCallback=function(c,u,p){xt.jmp(()=>{var h;let m=i.get(c);if(this.hasOwnProperty(m)&&Bo.lazyLoad)p=this[m],delete this[m];else{if(o.hasOwnProperty(m)&&typeof this[m]=="number"&&this[m]==p)return;if(m==null){let x=_a(this),w=x?.$flags$;if(w&&!(w&8)&&w&128&&p!==u){let k=x.$lazyInstance$;((h=t.$watchers$)==null?void 0:h[c])?.forEach(A=>{k[A]!=null&&k[A].call(k,p,u,c)})}return}}let g=Object.getOwnPropertyDescriptor(o,m);p=p===null&&typeof this[m]=="boolean"?!1:p,p!==this[m]&&(!g.get||g.set)&&(this[m]=p)})},e.observedAttributes=Array.from(new Set([...Object.keys((n=t.$watchers$)!=null?n:{}),...s.filter(([c,u])=>u[0]&15).map(([c,u])=>{var p;let h=u[1]||c;return i.set(h,c),u[0]&512&&((p=t.$attrsToReflect$)==null||p.push([c,h])),h})]))}}return e},"proxyComponent"),pP=l(async(e,t,r,a)=>{let n;if((t.$flags$&32)===0){if(t.$flags$|=32,r.$lazyBundleId$){let i=u$(r,t);if(i&&"then"in i){let u=K$();n=await i,u()}else n=i;if(!n)throw new Error(`Constructor for "${r.$tagName$}#${t.$modeName$}" was not found`);n.isProxied||(r.$watchers$=n.watchers,q8(n,r,2),n.isProxied=!0);let c=Qa("createInstance",r.$tagName$);t.$flags$|=8;try{new n(t)}catch(u){Pn(u,e)}t.$flags$&=-9,t.$flags$|=128,c(),hm(t.$lazyInstance$,e)}else{n=e.constructor;let i=e.localName;customElements.whenDefined(i).then(()=>t.$flags$|=128)}if(n&&n.style){let i;typeof n.style=="string"&&(i=n.style);let c=vm(r);if(!Od.has(c)){let u=Qa("registerStyles",r.$tagName$);D8(c,i,!!(r.$flags$&1)),u()}}}let o=t.$ancestorComponent$,s=l(()=>Vd(t,!0),"schedule");o&&o["s-rc"]?o["s-rc"].push(s):s()},"initializeComponent"),hm=l((e,t)=>{$n(e,"connectedCallback",void 0,t)},"fireConnectedCallback"),fP=l(e=>{if((xt.$flags$&1)===0){let t=_a(e),r=t.$cmpMeta$,a=Qa("connectedCallback",r.$tagName$);if(t.$flags$&1)G8(e,t,r.$listeners$),t?.$lazyInstance$?hm(t.$lazyInstance$,e):t?.$onReadyPromise$&&t.$onReadyPromise$.then(()=>hm(t.$lazyInstance$,e));else{t.$flags$|=1;let n;if(n=e.getAttribute(vl),n){if(r.$flags$&1){let o=z8(e.shadowRoot,r);e.classList.remove(o+"-h",o+"-s")}else if(r.$flags$&2){let o=vm(r);e["s-sc"]=o}X$(e,r.$tagName$,n,t)}n||r.$flags$&12&&mP(e);{let o=e;for(;o=o.parentNode||o.host;)if(o.nodeType===1&&o.hasAttribute("s-id")&&o["s-p"]||o["s-p"]){F8(t,t.$ancestorComponent$=o);break}}r.$members$&&Object.entries(r.$members$).map(([o,[s]])=>{if(s&31&&e.hasOwnProperty(o)){let i=e[o];delete e[o],e[o]=i}}),pP(e,t,r)}a()}},"connectedCallback"),mP=l(e=>{if(!$t.document)return;let t=e["s-cr"]=$t.document.createComment("");t["s-cn"]=!0,On(e,t,e.firstChild)},"setContentReference"),C8=l((e,t)=>{$n(e,"disconnectedCallback",void 0,t||e)},"disconnectInstance"),gP=l(async e=>{if((xt.$flags$&1)===0){let t=_a(e);t.$rmListeners$&&(t.$rmListeners$.map(r=>r()),t.$rmListeners$=void 0),t?.$lazyInstance$?C8(t.$lazyInstance$,e):t?.$onReadyPromise$&&t.$onReadyPromise$.then(()=>C8(t.$lazyInstance$,e))}Ns.has(e)&&Ns.delete(e),e.shadowRoot&&Ns.has(e.shadowRoot)&&Ns.delete(e.shadowRoot)},"disconnectedCallback"),K8=l((e,t={})=>{var r;if(!$t.document){console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");return}let a=Qa(),n=[],o=t.exclude||[],s=$t.customElements,i=$t.document.head,c=i.querySelector("meta[charset]"),u=$t.document.createElement("style"),p=[],h,m=!0;Object.assign(xt,t),xt.$resourcesUrl$=new URL(t.resourcesUrl||"./",$t.document.baseURI).href,xt.$flags$|=2,tP();let g=!1;if(e.map(x=>{x[1].map(w=>{var k;let C={$flags$:w[0],$tagName$:w[1],$members$:w[2],$listeners$:w[3]};C.$flags$&4&&(g=!0),C.$members$=w[2],C.$listeners$=w[3],C.$attrsToReflect$=[],C.$watchers$=(k=w[4])!=null?k:{};let A=C.$tagName$,$=class extends HTMLElement{static{l(this,"HostElement")}constructor(L){if(super(L),this.hasRegisteredEventListeners=!1,L=this,d$(L,C),C.$flags$&1){if(!L.shadowRoot)L.attachShadow({mode:"open"});else if(L.shadowRoot.mode!=="open")throw new Error(`Unable to re-use existing shadow root for ${C.$tagName$}! Mode is set to ${L.shadowRoot.mode} but Stencil only supports open shadow roots.`)}}connectedCallback(){let L=_a(this);this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,G8(this,L,C.$listeners$)),h&&(clearTimeout(h),h=null),m?p.push(this):xt.jmp(()=>fP(this))}disconnectedCallback(){xt.jmp(()=>gP(this)),xt.raf(()=>{var L;let M=_a(this),O=p.findIndex(R=>R===this);O>-1&&p.splice(O,1),((L=M?.$vnode$)==null?void 0:L.$elm$)instanceof Node&&!M.$vnode$.$elm$.isConnected&&delete M.$vnode$.$elm$})}componentOnReady(){return _a(this).$onReadyPromise$}};C.$flags$&2&&E$($.prototype),C.$lazyBundleId$=x[0],!o.includes(A)&&!s.get(A)&&(n.push(A),s.define(A,q8($,C,1)))})}),n.length>0&&(g&&(u.textContent+=E8),u.textContent+=n.sort()+y$,u.innerHTML.length)){u.setAttribute("data-styles","");let x=(r=xt.$nonce$)!=null?r:mm($t.document);x!=null&&u.setAttribute("nonce",x),i.insertBefore(u,c?c.nextSibling:i.firstChild)}m=!1,p.length?p.map(x=>x.connectedCallback()):xt.jmp(()=>h=setTimeout(W8,30)),a()},"bootstrapLazy"),cn=l((e,t)=>t,"Fragment"),G8=l((e,t,r,a)=>{r&&$t.document&&r.map(([n,o,s])=>{let i=bP($t.document,e,n),c=yP(t,s),u=vP(n);xt.ael(i,o,c,u),(t.$rmListeners$=t.$rmListeners$||[]).push(()=>xt.rel(i,o,c,u))})},"addHostEventListeners"),yP=l((e,t)=>r=>{var a;try{e.$flags$&256?(a=e.$lazyInstance$)==null||a[t](r):(e.$queuedListeners$=e.$queuedListeners$||[]).push([t,r])}catch(n){Pn(n,e.$hostElement$)}},"hostListenerProxy"),bP=l((e,t,r)=>r&4?e:r&16?e.body:t,"getHostListenerTarget"),vP=l(e=>v$?{passive:(e&1)!==0,capture:(e&2)!==0}:(e&2)!==0,"hostListenerOpts")});E();E();E();E();Oe();E();Co();Co();var m9=0,kj=Array.isArray;function S(e,t,r,a,n,o){t||(t={});var s,i,c=t;if("ref"in c)for(i in c={},t)i=="ref"?s=t[i]:c[i]=t[i];var u={type:e,props:c,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--m9,__i:-1,__u:0,__source:n,__self:o};if(typeof e=="function"&&(s=e.defaultProps))for(i in s)c[i]===void 0&&(c[i]=s[i]);return Ye.vnode&&Ye.vnode(u),u}E();var iy=ba(fa()),g9=({className:e,variant:t="default",ariaLabel:r="",...a})=>S("svg",{width:"267",height:"80",viewBox:"0 0 267 80",fill:"none","aria-label":r,xmlns:"http://www.w3.org/2000/svg",className:(0,iy.default)("fill-[#333333] dark:fill-white",e),...a,children:[S("mask",{id:"mask0_1803_3458",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"267",height:"80",children:S("path",{d:"M267 0H0V79.3784H267V0Z",fill:"white"})}),S("g",{mask:"url(#mask0_1803_3458)",children:[S("path",{d:"M234.983 78.7547C234.292 78.7547 233.648 78.5695 233.05 78.2452L226.929 74.5871C226.008 74.0776 226.469 73.8924 226.745 73.7998C227.987 73.3829 228.217 73.2903 229.506 72.5495C229.644 72.4569 229.828 72.5033 229.966 72.5959L234.66 75.4206C234.844 75.5132 235.074 75.5132 235.212 75.4206L253.575 64.7235C253.758 64.6309 253.852 64.4457 253.852 64.2143V42.8665C253.852 42.6351 253.758 42.4499 253.575 42.3573L235.212 31.7067C235.028 31.614 234.798 31.614 234.66 31.7067L216.298 42.3573C216.114 42.4499 216.022 42.6813 216.022 42.8665V64.2143C216.022 64.3995 216.114 64.6309 216.298 64.7235L221.314 67.641C224.029 69.0301 225.732 67.4094 225.732 65.7886V44.7189C225.732 44.4411 225.962 44.1633 226.285 44.1633H228.632C228.908 44.1633 229.184 44.3947 229.184 44.7189V65.7886C229.184 69.447 227.205 71.577 223.753 71.577C222.695 71.577 221.867 71.577 219.519 70.4195L214.687 67.641C213.491 66.9463 212.754 65.6498 212.754 64.2604V42.913C212.754 41.5236 213.491 40.2271 214.687 39.5324L233.05 28.8356C234.2 28.1873 235.765 28.1873 236.915 28.8356L255.278 39.5324C256.474 40.2271 257.21 41.5236 257.21 42.913V64.2604C257.21 65.6498 256.474 66.9463 255.278 67.641L236.915 78.3378C236.363 78.5695 235.673 78.7547 234.983 78.7547Z",fill:"#5FA04E"}),S("path",{d:"M240.69 64.075C232.635 64.075 230.978 60.3704 230.978 57.2215C230.978 56.9437 231.208 56.6658 231.53 56.6658H233.923C234.2 56.6658 234.43 56.8511 234.43 57.1289C234.798 59.5831 235.856 60.7873 240.735 60.7873C244.601 60.7873 246.258 59.9074 246.258 57.8236C246.258 56.6197 245.796 55.7398 239.768 55.1377C234.752 54.6282 231.622 53.5169 231.622 49.4881C231.622 45.7374 234.752 43.5145 239.998 43.5145C245.89 43.5145 248.789 45.5521 249.157 49.9976C249.157 50.1366 249.111 50.2754 249.02 50.4144C248.926 50.507 248.789 50.5997 248.649 50.5997H246.21C245.982 50.5997 245.751 50.4144 245.705 50.1828C245.152 47.6359 243.725 46.8025 239.952 46.8025C235.718 46.8025 235.212 48.2842 235.212 49.3955C235.212 50.7384 235.81 51.1553 241.517 51.8962C247.177 52.637 249.847 53.7021 249.847 57.6845C249.847 61.7595 246.487 64.075 240.69 64.075Z",fill:"#5FA04E"}),S("path",{d:"M267.2 41.6621C267.2 43.6071 265.588 45.2279 263.654 45.2279C261.722 45.2279 260.111 43.6533 260.111 41.6621C260.111 39.6247 261.768 38.0966 263.654 38.0966C265.542 38.0966 267.2 39.6709 267.2 41.6621ZM260.664 41.6621C260.664 43.3293 261.999 44.6722 263.608 44.6722C265.266 44.6722 266.601 43.2829 266.601 41.6621C266.601 39.9951 265.266 38.6986 263.608 38.6986C262.045 38.6986 260.664 39.9951 260.664 41.6621ZM262.321 39.6709H263.702C264.162 39.6709 265.083 39.6709 265.083 40.736C265.083 41.4769 264.621 41.6159 264.344 41.7085C264.898 41.7547 264.943 42.1254 264.989 42.6346C265.035 42.9588 265.083 43.5145 265.174 43.6997H264.344C264.344 43.5145 264.207 42.4958 264.207 42.4494C264.162 42.218 264.07 42.1254 263.794 42.1254H263.103V43.7459H262.321V39.6709ZM263.057 41.4307H263.654C264.162 41.4307 264.253 41.0603 264.253 40.875C264.253 40.3194 263.885 40.3194 263.654 40.3194H263.012V41.4307H263.057Z",fill:"#5FA04E"}),S("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M43.6737 41.9539C43.6737 41.1204 43.2136 40.3334 42.4773 39.9165L23.0104 28.5712C22.6883 28.386 22.3201 28.2934 21.9519 28.2472C21.9059 28.2472 21.7679 28.2472 21.7679 28.2472C21.3997 28.2472 21.0315 28.386 20.7094 28.5712L1.19654 39.8701C0.460209 40.287 0 41.0743 0 41.9539L0.0460209 72.3315C0.0460209 72.7484 0.276126 73.165 0.644293 73.3502C1.01246 73.5819 1.47267 73.5819 1.79482 73.3502L13.3921 66.682C14.1284 66.2653 14.5886 65.4781 14.5886 64.6446V50.4282C14.5886 49.5947 15.0488 48.8074 15.7852 48.3908L20.7094 45.5197C21.0776 45.288 21.4917 45.1954 21.9059 45.1954C22.3201 45.1954 22.7343 45.288 23.0565 45.5197L27.9806 48.3908C28.7169 48.8074 29.1773 49.5947 29.1773 50.4282V64.6446C29.1773 65.4781 29.6375 66.2653 30.3738 66.682L41.8791 73.3502C42.2471 73.5819 42.7073 73.5819 43.0755 73.3502C43.4438 73.165 43.6737 72.7484 43.6737 72.3315V41.9539Z"}),S("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M137.465 0.138922C137.096 -0.0463072 136.636 -0.0463072 136.314 0.138922C135.946 0.370456 135.716 0.740915 135.716 1.15768V31.2573C135.716 31.5351 135.578 31.8129 135.301 31.9984C135.025 32.1372 134.749 32.1372 134.473 31.9984L129.595 29.1735C128.859 28.7569 127.984 28.7569 127.248 29.1735L107.735 40.5188C106.999 40.9357 106.539 41.7227 106.539 42.5562V65.2004C106.539 66.0342 106.999 66.8212 107.735 67.2381L127.248 78.5834C127.984 79 128.859 79 129.595 78.5834L149.108 67.2381C149.844 66.8212 150.304 66.0342 150.304 65.2004V8.75207C150.304 7.87222 149.844 7.085 149.108 6.66824L137.465 0.138922ZM135.67 57.7451C135.67 57.9765 135.578 58.1617 135.394 58.2544L128.72 62.1444C128.536 62.237 128.306 62.237 128.122 62.1444L121.449 58.2544C121.265 58.1617 121.173 57.9303 121.173 57.7451V49.9656C121.173 49.7339 121.265 49.5487 121.449 49.4561L128.122 45.5663C128.306 45.4737 128.536 45.4737 128.72 45.5663L135.394 49.4561C135.578 49.5487 135.67 49.7803 135.67 49.9656V57.7451Z"}),S("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M202.398 49.7801C203.135 49.3632 203.549 48.5762 203.549 47.7425V42.2319C203.549 41.3985 203.089 40.6112 202.398 40.1946L183.023 28.8957C182.287 28.4788 181.413 28.4788 180.676 28.8957L161.164 40.2407C160.427 40.6576 159.967 41.4449 159.967 42.2784V64.9226C159.967 65.7561 160.427 66.5434 161.164 66.96L180.538 78.0737C181.275 78.4905 182.149 78.4905 182.839 78.0737L194.575 71.4983C194.943 71.3131 195.173 70.8962 195.173 70.4793C195.173 70.0627 194.943 69.6459 194.575 69.4606L174.97 58.1153C174.602 57.8839 174.372 57.5135 174.372 57.0966V50.0117C174.372 49.5949 174.602 49.178 174.97 48.9928L181.091 45.4735C181.459 45.2421 181.919 45.2421 182.287 45.4735L188.408 48.9928C188.776 49.2245 189.006 49.5949 189.006 50.0117V55.5685C189.006 55.9853 189.236 56.4019 189.605 56.5872C189.973 56.8188 190.433 56.8188 190.801 56.5872L202.398 49.7801Z"}),S("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M181.551 48.7155C181.689 48.6228 181.874 48.6228 182.012 48.7155L185.739 50.8919C185.877 50.9845 185.969 51.1235 185.969 51.3087V55.6615C185.969 55.8468 185.877 55.9858 185.739 56.0784L182.012 58.2548C181.874 58.3474 181.689 58.3474 181.551 58.2548L177.824 56.0784C177.686 55.9858 177.594 55.8468 177.594 55.6615V51.3087C177.594 51.1235 177.686 50.9845 177.824 50.8919L181.551 48.7155Z",fill:"#5FA04E"}),t==="pride"?S("g",{clipPath:"url(#clip0_1_1661)",children:[S("mask",{id:"mask1_1_1661",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"53",y:"28",width:"44",height:"51",children:S("path",{d:"M76.3478 28.9593C75.9882 28.7545 75.5815 28.6469 75.1677 28.6469C74.7539 28.6469 74.3472 28.7545 73.9876 28.9593L54.5067 40.2057C53.7665 40.6229 53.35 41.4099 53.35 42.2422V64.7816C53.35 65.6147 53.8126 66.4016 54.5067 66.8181L73.9876 78.0645C74.3472 78.2693 74.7539 78.3769 75.1677 78.3769C75.5815 78.3769 75.9882 78.2693 76.3478 78.0645L95.8286 66.8181C96.5689 66.4016 96.9854 65.6139 96.9854 64.7816V42.2422C96.9813 41.8325 96.8729 41.4307 96.6705 41.0745C96.4681 40.7184 96.1784 40.4196 95.8286 40.2064L76.3478 28.9593Z",fill:"url(#paint0_linear_1_1661)"})}),S("g",{mask:"url(#mask1_1_1661)",children:[S("path",{d:"M97.0564 70.1316H53.35V78.39H97.0564V70.1316Z",fill:"#750787"}),S("path",{d:"M97.0564 61.7731H53.35V70.131H97.0564V61.7731Z",fill:"#004DFF"}),S("path",{d:"M97.0564 53.5147H53.35V61.7732H97.0564V53.5147Z",fill:"#008026"}),S("path",{d:"M97.0564 45.2563H53.35V53.5148H97.0564V45.2563Z",fill:"#FFED00"}),S("path",{d:"M97.0564 36.998H53.35V45.2565H97.0564V36.998Z",fill:"#FF8C00"}),S("path",{d:"M97.0564 28.64H53.35V36.998H97.0564V28.64Z",fill:"#E40303"})]}),S("g",{style:{mixBlendMode:"luminosity"},opacity:"0.5",children:[S("path",{d:"M76.3478 28.9593C75.9882 28.7545 75.5815 28.6469 75.1677 28.6469C74.7539 28.6469 74.3472 28.7545 73.9876 28.9593L54.5067 40.2057C53.7665 40.6229 53.35 41.4099 53.35 42.2422V64.7816C53.35 65.6147 53.8126 66.4016 54.5067 66.8181L73.9876 78.0645C74.3472 78.2693 74.7539 78.3769 75.1677 78.3769C75.5815 78.3769 75.9882 78.2693 76.3478 78.0645L95.8286 66.8181C96.5689 66.4016 96.9854 65.6139 96.9854 64.7816V42.2422C96.9813 41.8325 96.8729 41.4307 96.6705 41.0745C96.4681 40.7184 96.1784 40.4196 95.8286 40.2064L76.3478 28.9593Z",fill:"white"}),S("g",{style:{mixBlendMode:"luminosity"},children:[S("mask",{id:"mask2_1_1661",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"53",y:"28",width:"44",height:"51",children:S("path",{d:"M76.3478 28.9593C75.9882 28.7545 75.5815 28.6469 75.1677 28.6469C74.7539 28.6469 74.3472 28.7545 73.9876 28.9593L54.5067 40.2057C53.7665 40.6229 53.35 41.4099 53.35 42.2422V64.7816C53.35 65.6147 53.8126 66.4016 54.5067 66.8181L73.9876 78.0645C74.3472 78.2693 74.7539 78.3769 75.1677 78.3769C75.5815 78.3769 75.9882 78.2693 76.3478 78.0645L95.8286 66.8181C96.5689 66.4016 96.9854 65.6139 96.9854 64.7816V42.2422C96.9813 41.8325 96.8729 41.4307 96.6705 41.0745C96.4681 40.7184 96.1784 40.4196 95.8286 40.2064L76.3478 28.9593Z",fill:"url(#paint1_linear_1_1661)"})}),S("g",{mask:"url(#mask2_1_1661)",children:[S("path",{d:"M76.3478 28.9593C75.9882 28.7545 75.5815 28.6469 75.1677 28.6469C74.7539 28.6469 74.3472 28.7545 73.9876 28.9593L54.5067 40.2057C53.7665 40.6229 53.35 41.4099 53.35 42.2422V64.7816C53.35 65.6147 53.8126 66.4016 54.5067 66.8181L73.9876 78.0645C74.3472 78.2693 74.7539 78.3769 75.1677 78.3769C75.5815 78.3769 75.9882 78.2693 76.3478 78.0645L95.8286 66.8181C96.5689 66.4016 96.9854 65.6139 96.9854 64.7816V42.2422C96.9813 41.8325 96.8729 41.4307 96.6705 41.0745C96.4681 40.7184 96.1784 40.4196 95.8286 40.2064L76.3478 28.9593Z",fill:"url(#paint2_linear_1_1661)"}),S("g",{filter:"url(#filter0_d_1_1661)",children:S("path",{d:"M95.8746 40.2064L76.301 28.9586C76.1087 28.8617 75.9073 28.7843 75.6996 28.7277L53.8153 66.2174C54.0002 66.4491 54.292 66.7869 54.5237 66.9258L73.9875 78.0645C74.5428 78.3882 75.1903 78.481 75.7924 78.2954L96.3832 40.6229C96.2478 40.4469 96.0738 40.3044 95.8746 40.2064Z",fill:"url(#paint3_linear_1_1661)"})}),S("g",{filter:"url(#filter1_d_1_1661)",children:S("path",{d:"M95.8265 66.8181C96.3818 66.4937 96.8826 65.8866 96.8826 65.1549L75.5587 28.6823C75.0033 28.5895 74.4019 28.6356 73.8926 28.9593L54.4585 40.1596L75.4198 78.3882C75.7247 78.3383 76.0207 78.2448 76.2989 78.1105L95.8265 66.8181Z",fill:"url(#paint4_linear_1_1661)"})})]})]})]})]}):S(nt,{children:[S("path",{d:"M76.3012 28.9882C75.5647 28.5716 74.6903 28.5716 73.954 28.9882L54.5792 40.241C53.8429 40.6578 53.4287 41.4449 53.4287 42.2786V64.83C53.4287 65.6637 53.8889 66.4507 54.5792 66.8676L73.954 78.1203C74.6903 78.5369 75.5647 78.5369 76.3012 78.1203L95.6758 66.8676C96.4123 66.4507 96.8263 65.6637 96.8263 64.83V42.2786C96.8263 41.4449 96.3662 40.6578 95.6758 40.241L76.3012 28.9882Z",fill:"url(#paint0_linear_1803_3458)"}),S("path",{d:"M95.7221 40.241L76.2554 28.9882C76.0714 28.8956 75.8412 28.803 75.6572 28.7568L53.8433 66.3119C54.0273 66.5433 54.2575 66.7286 54.4874 66.8676L73.9544 78.1203C74.5067 78.4443 75.1508 78.5369 75.749 78.3517L96.2284 40.6578C96.0904 40.4726 95.9063 40.3336 95.7221 40.241Z",fill:"url(#paint1_linear_1803_3458)"}),S("path",{d:"M95.7224 66.8669C96.2747 66.5427 96.6889 65.9871 96.8729 65.385L75.5651 28.7098C75.013 28.6172 74.4146 28.6633 73.9085 28.9876L54.5796 40.1939L75.427 78.4437C75.7031 78.3973 76.0255 78.3046 76.3016 78.1659L95.7224 66.8669Z",fill:"url(#paint2_linear_1803_3458)"})]})]}),t==="pride"?S("defs",{children:[S("filter",{id:"filter0_d_1_1661",x:"41.8153",y:"16.7277",width:"66.5679",height:"73.6624",filterUnits:"userSpaceOnUse","color-interpolation-filters":"sRGB",children:[S("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),S("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),S("feOffset",{}),S("feGaussianBlur",{stdDeviation:"6"}),S("feComposite",{in2:"hardAlpha",operator:"out"}),S("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.75 0"}),S("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_1_1661"}),S("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_1_1661",result:"shape"})]}),S("filter",{id:"filter1_d_1_1661",x:"42.4585",y:"16.64",width:"66.4241",height:"73.7482",filterUnits:"userSpaceOnUse","color-interpolation-filters":"sRGB",children:[S("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),S("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),S("feOffset",{}),S("feGaussianBlur",{stdDeviation:"6"}),S("feComposite",{in2:"hardAlpha",operator:"out"}),S("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.75 0"}),S("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_1_1661"}),S("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_1_1661",result:"shape"})]}),S("linearGradient",{id:"paint0_linear_1_1661",x1:"83.1011",y1:"37.3355",x2:"65.4825",y2:"73.2718",gradientUnits:"userSpaceOnUse",children:[S("stop",{"stop-color":"#3F873F"}),S("stop",{offset:"0.33","stop-color":"#3F8B3D"}),S("stop",{offset:"0.637","stop-color":"#3E9638"}),S("stop",{offset:"0.934","stop-color":"#3DA92E"}),S("stop",{offset:"1","stop-color":"#3DAE2B"})]}),S("linearGradient",{id:"paint1_linear_1_1661",x1:"83.1011",y1:"37.3355",x2:"65.4825",y2:"73.2718",gradientUnits:"userSpaceOnUse",children:[S("stop",{"stop-color":"#3F873F"}),S("stop",{offset:"0.33","stop-color":"#3F8B3D"}),S("stop",{offset:"0.637","stop-color":"#3E9638"}),S("stop",{offset:"0.934","stop-color":"#3DA92E"}),S("stop",{offset:"1","stop-color":"#3DAE2B"})]}),S("linearGradient",{id:"paint2_linear_1_1661",x1:"83.1011",y1:"37.3355",x2:"65.4825",y2:"73.2718",gradientUnits:"userSpaceOnUse",children:[S("stop",{"stop-color":"#3F873F"}),S("stop",{offset:"0.33","stop-color":"#3F8B3D"}),S("stop",{offset:"0.637","stop-color":"#3E9638"}),S("stop",{offset:"0.934","stop-color":"#3DA92E"}),S("stop",{offset:"1","stop-color":"#3DAE2B"})]}),S("linearGradient",{id:"paint3_linear_1_1661",x1:"72.2067",y1:"56.1434",x2:"121.636",y2:"19.6297",gradientUnits:"userSpaceOnUse",children:[S("stop",{offset:"0.138","stop-color":"#3F873F"}),S("stop",{offset:"0.402","stop-color":"#52A044"}),S("stop",{offset:"0.713","stop-color":"#64B749"}),S("stop",{offset:"0.908","stop-color":"#6ABF4B"})]}),S("linearGradient",{id:"paint4_linear_1_1661",x1:"52.636",y1:"53.5048",x2:"97.7135",y2:"53.5048",gradientUnits:"userSpaceOnUse",children:[S("stop",{offset:"0.092","stop-color":"#6ABF4B"}),S("stop",{offset:"0.287","stop-color":"#64B749"}),S("stop",{offset:"0.598","stop-color":"#52A044"}),S("stop",{offset:"0.862","stop-color":"#3F873F"})]}),S("clipPath",{id:"clip0_1_1661",children:S("rect",{width:"43.7067",height:"49.75",fill:"white",transform:"translate(53.35 28.64)"})})]}):S("defs",{children:[S("linearGradient",{id:"paint0_linear_1803_3458",x1:"83.0183",y1:"37.3689",x2:"65.3246",y2:"73.2407",gradientUnits:"userSpaceOnUse",children:[S("stop",{stopColor:"#3F873F"}),S("stop",{offset:"0.3296",stopColor:"#3F8B3D"}),S("stop",{offset:"0.6367",stopColor:"#3E9638"}),S("stop",{offset:"0.9341",stopColor:"#3DA92E"}),S("stop",{offset:"1",stopColor:"#3DAE2B"})]}),S("linearGradient",{id:"paint1_linear_1803_3458",x1:"72.1833",y1:"56.1876",x2:"121.552",y2:"19.937",gradientUnits:"userSpaceOnUse",children:[S("stop",{offset:"0.1376",stopColor:"#3F873F"}),S("stop",{offset:"0.4016",stopColor:"#52A044"}),S("stop",{offset:"0.7129",stopColor:"#64B749"}),S("stop",{offset:"0.9081",stopColor:"#6ABF4B"})]}),S("linearGradient",{id:"paint2_linear_1803_3458",x1:"52.7188",y1:"53.5463",x2:"97.551",y2:"53.5463",gradientUnits:"userSpaceOnUse",children:[S("stop",{offset:"0.0919165",stopColor:"#6ABF4B"}),S("stop",{offset:"0.2871",stopColor:"#64B749"}),S("stop",{offset:"0.5984",stopColor:"#52A044"}),S("stop",{offset:"0.8624",stopColor:"#3F873F"})]})]})]}),ly=g9;E();var cy={nodejsLogo:"_nodejsLogo_uxecg_2"};var y9=({variant:e="default",ariaLabel:t})=>S(ly,{variant:e,className:cy.nodejsLogo,ariaLabel:t}),dy=y9;E();E();E();Oe();function b9({title:e,titleId:t,...r},a){return Se("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?Se("title",{id:t},e):null,Se("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}var v9=_e(b9),xs=v9;E();Oe();function w9({title:e,titleId:t,...r},a){return Se("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?Se("title",{id:t},e):null,Se("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}var x9=_e(w9),Bh=x9;E();Oe();function _9({title:e,titleId:t,...r},a){return Se("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?Se("title",{id:t},e):null,Se("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}var k9=_e(_9),Hh=k9;E();Oe();function S9({title:e,titleId:t,...r},a){return Se("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?Se("title",{id:t},e):null,Se("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"}))}var I9=_e(S9),Uh=I9;E();Oe();function C9({title:e,titleId:t,...r},a){return Se("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?Se("title",{id:t},e):null,Se("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}var A9=_e(C9),Vh=A9;E();Oe();function T9({title:e,titleId:t,...r},a){return Se("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?Se("title",{id:t},e):null,Se("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"}))}var E9=_e(T9),Fh=E9;E();Oe();function $9({title:e,titleId:t,...r},a){return Se("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?Se("title",{id:t},e):null,Se("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"}))}var P9=_e($9),Wh=P9;E();var uy={themeToggle:"_themeToggle_1rdh8_2"};var O9=e=>S("button",{type:"button",className:uy.themeToggle,...e,children:[S(Fh,{className:"block dark:hidden",height:"20"}),S(Wh,{className:"hidden dark:block",height:"20"})]}),hy=O9;E();E();Oe();function R9({title:e,titleId:t,...r},a){return Se("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?Se("title",{id:t},e):null,Se("path",{fillRule:"evenodd",d:"M3 6.75A.75.75 0 0 1 3.75 6h16.5a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 6.75ZM3 12a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75A.75.75 0 0 1 3 12Zm0 5.25a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75a.75.75 0 0 1-.75-.75Z",clipRule:"evenodd"}))}var L9=_e(R9),py=L9;E();Oe();function M9({title:e,titleId:t,...r},a){return Se("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?Se("title",{id:t},e):null,Se("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}var N9=_e(M9),fy=N9;E();Oe();E();Oe();Oe();E();Oe();E();Oe();function my(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qh(...e){return t=>{let r=!1,a=e.map(n=>{let o=my(n,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let n=0;n{let{children:o,...s}=a,i=Ka.toArray(o),c=i.find(Z9);if(c){let u=c.props.children,p=i.map(h=>h===c?Ka.count(u)>1?Ka.only(null):va(u)?u.props.children:null:h);return S(t,{...s,ref:n,children:va(u)?To(u,void 0,p):null})}return S(t,{...s,ref:n,children:o})});return r.displayName=`${e}.Slot`,r}function D9(e){let t=_e((r,a)=>{let{children:n,...o}=r;if(va(n)){let s=B9(n),i=j9(o,n.props);return n.type!==nt&&(i.ref=a?qh(a,s):s),To(n,i)}return Ka.count(n)>1?Ka.only(null):null});return t.displayName=`${e}.SlotClone`,t}var z9=Symbol("radix.slottable");function Z9(e){return va(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===z9}function j9(e,t){let r={...t};for(let a in t){let n=e[a],o=t[a];/^on[A-Z]/.test(a)?n&&o?r[a]=(...i)=>{let c=o(...i);return n(...i),c}:n&&(r[a]=n):a==="style"?r[a]={...n,...o}:a==="className"&&(r[a]=[n,o].filter(Boolean).join(" "))}return{...e,...r}}function B9(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var H9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Tt=H9.reduce((e,t)=>{let r=Eo(`Primitive.${t}`),a=_e((n,o)=>{let{asChild:s,...i}=n,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S(c,{...i,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function gy(e,t){e&&ws(()=>e.dispatchEvent(t))}var U9="Label",yy=_e((e,t)=>S(Tt.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));yy.displayName=U9;var by=yy;var _y=ba(fa(),1);Oe();E();E();E();Oe();function F9({title:e,titleId:t,...r},a){return Se("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?Se("title",{id:t},e):null,Se("path",{fillRule:"evenodd",d:"M8.25 3.75H19.5a.75.75 0 0 1 .75.75v11.25a.75.75 0 0 1-1.5 0V6.31L5.03 20.03a.75.75 0 0 1-1.06-1.06L17.69 5.25H8.25a.75.75 0 0 1 0-1.5Z",clipRule:"evenodd"}))}var W9=_e(F9),wi=W9;var wy=ba(fa());E();var vy=ba(fa()),q9=({activeClassName:e="active",allowSubPath:t=!1,className:r,href:a="",pathname:n="/",as:o="a",...s})=>{let i=(0,vy.default)(r,{[e]:t?n.startsWith(`/${a.toString().split("/")[1]}`):a.toString()===n});return S(o,{className:i,href:a,...s})},Nc=q9;E();var _s={navItem:"_navItem_i9c80_2",label:"_label_i9c80_14",icon:"_icon_i9c80_24",nav:"_nav_i9c80_2",active:"_active_i9c80_45",footer:"_footer_i9c80_56"};var K9=({href:e="",type:t="nav",children:r,className:a,target:n,...o})=>S(Nc,{target:n,href:e,className:(0,wy.default)(_s.navItem,_s[t],a),activeClassName:_s.active,allowSubPath:e.startsWith("/"),...o,children:[S("span",{className:_s.label,children:r}),n==="_blank"&&S(wi,{className:_s.icon})]}),xy=K9;E();var ma={container:"_container_prspk_2",nodeIconAndMobileItemsToggler:"_nodeIconAndMobileItemsToggler_prspk_34",sidebarItemToggler:"_sidebarItemToggler_prspk_63",nodeIconWrapper:"_nodeIconWrapper_prspk_72",navInteractionIcon:"_navInteractionIcon_prspk_76",sidebarItemTogglerLabel:"_sidebarItemTogglerLabel_prspk_81",main:"_main_prspk_88",navItems:"_navItems_prspk_103",actionsWrapper:"_actionsWrapper_prspk_131",searchButtonSkeleton:"_searchButtonSkeleton_prspk_159",ghIconWrapper:"_ghIconWrapper_prspk_168"};var G9={show:S(py,{className:ma.navInteractionIcon}),close:S(fy,{className:ma.navInteractionIcon})},Y9=({children:e,Logo:t,as:r="a",navItems:a,pathname:n,sidebarItemTogglerAriaLabel:o})=>{let[s,i]=Ie(!1);return S("nav",{className:ma.container,children:[S("div",{className:ma.nodeIconAndMobileItemsToggler,children:[S(r,{className:ma.nodeIconWrapper,href:"/","aria-label":"Home",children:S(t,{})}),S(by,{className:ma.sidebarItemTogglerLabel,htmlFor:"sidebarItemToggler",role:"button","aria-label":o,children:G9[s?"close":"show"]})]}),S("input",{className:(0,_y.default)(["peer",ma.sidebarItemToggler]),id:"sidebarItemToggler",type:"checkbox",onChange:c=>i(()=>c.target.checked),"aria-label":o,tabIndex:-1}),S("div",{className:`${ma.main} hidden peer-checked:flex`,children:[S("div",{className:ma.navItems,children:a.map(({text:c,link:u,target:p})=>S(xy,{pathname:n,as:r,href:u,target:p,children:c},u))}),S("div",{className:ma.actionsWrapper,children:e})]})]})},ky=Y9;E();var Q9=e=>S("svg",{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:S("path",{d:"M10 1.25C5.16562 1.25 1.25 5.16562 1.25 10C1.25 13.8719 3.75469 17.1422 7.23281 18.3016C7.67031 18.3781 7.83437 18.1156 7.83437 17.8859C7.83437 17.6781 7.82344 16.9891 7.82344 16.2563C5.625 16.6609 5.05625 15.7203 4.88125 15.2281C4.78281 14.9766 4.35625 14.2 3.98438 13.9922C3.67812 13.8281 3.24063 13.4234 3.97344 13.4125C4.6625 13.4016 5.15469 14.0469 5.31875 14.3094C6.10625 15.6328 7.36406 15.2609 7.86719 15.0312C7.94375 14.4625 8.17344 14.0797 8.425 13.8609C6.47813 13.6422 4.44375 12.8875 4.44375 9.54062C4.44375 8.58906 4.78281 7.80156 5.34062 7.18906C5.25313 6.97031 4.94687 6.07344 5.42812 4.87031C5.42812 4.87031 6.16094 4.64063 7.83437 5.76719C8.53438 5.57031 9.27813 5.47187 10.0219 5.47187C10.7656 5.47187 11.5094 5.57031 12.2094 5.76719C13.8828 4.62969 14.6156 4.87031 14.6156 4.87031C15.0969 6.07344 14.7906 6.97031 14.7031 7.18906C15.2609 7.80156 15.6 8.57812 15.6 9.54062C15.6 12.8984 13.5547 13.6422 11.6078 13.8609C11.925 14.1344 12.1984 14.6594 12.1984 15.4797C12.1984 16.65 12.1875 17.5906 12.1875 17.8859C12.1875 18.1156 12.3516 18.3891 12.7891 18.3016C14.5261 17.7152 16.0355 16.5988 17.1048 15.1096C18.1741 13.6204 18.7495 11.8333 18.75 10C18.75 5.16562 14.8344 1.25 10 1.25Z"})}),Dc=Q9;E();E();E();E();E();E();var Sy={arabic:"ar",armenian:"am",bulgarian:"bg",czech:"cz",danish:"dk",dutch:"nl",english:"en",finnish:"fi",french:"fr",german:"de",greek:"gr",hungarian:"hu",indian:"in",indonesian:"id",irish:"ie",italian:"it",lithuanian:"lt",nepali:"np",norwegian:"no",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"rs",slovenian:"ru",spanish:"es",swedish:"se",tamil:"ta",turkish:"tr",ukrainian:"uk",sanskrit:"sk"},Iy={dutch:/[^A-Za-zàèéìòóù0-9_'-]+/gim,english:/[^A-Za-zàèéìòóù0-9_'-]+/gim,french:/[^a-z0-9äâàéèëêïîöôùüûœç-]+/gim,italian:/[^A-Za-zàèéìòóù0-9_'-]+/gim,norwegian:/[^a-z0-9_æøåÆØÅäÄöÖüÜ]+/gim,portuguese:/[^a-z0-9à-úÀ-Ú]/gim,russian:/[^a-z0-9а-яА-ЯёЁ]+/gim,spanish:/[^a-z0-9A-Zá-úÁ-ÚñÑüÜ]+/gim,swedish:/[^a-z0-9_åÅäÄöÖüÜ-]+/gim,german:/[^a-z0-9A-ZäöüÄÖÜß]+/gim,finnish:/[^a-z0-9äöÄÖ]+/gim,danish:/[^a-z0-9æøåÆØÅ]+/gim,hungarian:/[^a-z0-9áéíóöőúüűÁÉÍÓÖŐÚÜŰ]+/gim,romanian:/[^a-z0-9ăâîșțĂÂÎȘȚ]+/gim,serbian:/[^a-z0-9čćžšđČĆŽŠĐ]+/gim,turkish:/[^a-z0-9çÇğĞıİöÖşŞüÜ]+/gim,lithuanian:/[^a-z0-9ąčęėįšųūžĄČĘĖĮŠŲŪŽ]+/gim,arabic:/[^a-z0-9أ-ي]+/gim,nepali:/[^a-z0-9अ-ह]+/gim,irish:/[^a-z0-9áéíóúÁÉÍÓÚ]+/gim,indian:/[^a-z0-9अ-ह]+/gim,armenian:/[^a-z0-9ա-ֆ]+/gim,greek:/[^a-z0-9α-ωά-ώ]+/gim,indonesian:/[^a-z0-9]+/gim,ukrainian:/[^a-z0-9а-яА-ЯіїєІЇЄ]+/gim,slovenian:/[^a-z0-9螚ȎŠ]+/gim,bulgarian:/[^a-z0-9а-яА-Я]+/gim,tamil:/[^a-z0-9அ-ஹ]+/gim,sanskrit:/[^a-z0-9A-Zāīūṛḷṃṁḥśṣṭḍṇṅñḻḹṝ]+/gim,czech:/[^A-Z0-9a-zěščřžýáíéúůóťďĚŠČŘŽÝÁÍÉÓÚŮŤĎ-]+/gim},xi=Object.keys(Sy);function Cy(e){return e!==void 0&&xi.includes(e)?Sy[e]:void 0}E();var X9=Date.now().toString().slice(5),J9=0;var Ay=BigInt(1e3),Ty=BigInt(1e6),Ey=BigInt(1e9);var Kh=65535;function zc(e,t){if(t.length\d+)\$)?(?-?\d*\.?\d*)(?[dfs])/g,function(...r){let a=r[r.length-1],{width:n,type:o,position:s}=a,i=s?t[Number.parseInt(s)-1]:t.shift(),c=n===""?0:Number.parseInt(n);switch(o){case"d":return i.toString().padStart(c,"0");case"f":{let u=i,[p,h]=n.split(".").map(m=>Number.parseFloat(m));return typeof h=="number"&&h>=0&&(u=u.toFixed(h)),typeof p=="number"&&p>=0?u.toString().padStart(c,"0"):u.toString()}case"s":return c<0?i.toString().padEnd(-c," "):i.toString().padStart(c," ");default:return i}})}function _i(e){return typeof e=="number"&&(e=BigInt(e)),eks(t)):e?.constructor?.name==="AsyncFunction"}var $y="intersection"in new Set;function Qh(...e){if(e.length===0)return new Set;if(e.length===1)return e[0];if(e.length===2){let a=e[0],n=e[1];if($y)return a.intersection(n);let o=new Set,s=a.size"u")&&!(a==="geopoint"&&typeof n=="object"&&typeof n.lon=="number"&&typeof n.lat=="number")&&!(a==="enum"&&(typeof n=="string"||typeof n=="number"))){if(a==="enum[]"&&Array.isArray(n)){let o=n.length;for(let s=0;se.internalIdToId.length?Nr(e,t.toString()):t}function cI(e,t){return{sharedInternalDocumentStore:t,docs:{},count:0}}function dI(e,t){let r=Nr(e.sharedInternalDocumentStore,t);return e.docs[r]}function uI(e,t){let r=t.length,a=Array.from({length:r});for(let n=0;n"u"?!1:(delete e.docs[r],e.count--,!0)}function mI(e){return e.count}function gI(e,t){let r=t;return{docs:r.docs,count:r.count,sharedInternalDocumentStore:e}}function yI(e){return{docs:e.docs,count:e.count}}function My(){return{create:cI,get:dI,getMultiple:uI,getAll:hI,store:pI,remove:fI,count:mI,load:gI,save:yI}}E();var Ny=["beforeInsert","afterInsert","beforeRemove","afterRemove","beforeUpdate","afterUpdate","beforeSearch","afterSearch","beforeInsertMultiple","afterInsertMultiple","beforeRemoveMultiple","afterRemoveMultiple","beforeUpdateMultiple","afterUpdateMultiple","beforeLoad","afterLoad","afterCreate"];function Dy(e,t){let r=[],a=e.plugins?.length;if(!a)return r;for(let n=0;n{for(let a of e)await a(t)})();for(let a of e)a(t)}E();E();var $o=class e{k;v;l=null;r=null;h=1;constructor(t,r){this.k=t,this.v=new Set(r)}updateHeight(){this.h=Math.max(e.getHeight(this.l),e.getHeight(this.r))+1}static getHeight(t){return t?t.h:0}getBalanceFactor(){return e.getHeight(this.l)-e.getHeight(this.r)}rotateLeft(){let t=this.r;return this.r=t.l,t.l=this,this.updateHeight(),t.updateHeight(),t}rotateRight(){let t=this.l;return this.l=t.r,t.r=this,this.updateHeight(),t.updateHeight(),t}toJSON(){return{k:this.k,v:Array.from(this.v),l:this.l?this.l.toJSON():null,r:this.r?this.r.toJSON():null,h:this.h}}static fromJSON(t){let r=new e(t.k,t.v);return r.l=t.l?e.fromJSON(t.l):null,r.r=t.r?e.fromJSON(t.r):null,r.h=t.h,r}},Ii=class e{root=null;insertCount=0;constructor(t,r){t!==void 0&&r!==void 0&&(this.root=new $o(t,r))}insert(t,r,a=1e3){this.root=this.insertNode(this.root,t,r,a)}insertMultiple(t,r,a=1e3){for(let n of r)this.insert(t,n,a)}rebalance(){this.root&&(this.root=this.rebalanceNode(this.root))}toJSON(){return{root:this.root?this.root.toJSON():null,insertCount:this.insertCount}}static fromJSON(t){let r=new e;return r.root=t.root?$o.fromJSON(t.root):null,r.insertCount=t.insertCount||0,r}insertNode(t,r,a,n){if(t===null)return new $o(r,[a]);let o=[],s=t,i=null;for(;s!==null;)if(o.push({parent:i,node:s}),rs.k)if(s.r===null){s.r=new $o(r,[a]),o.push({parent:s,node:s.r});break}else i=s,s=s.r;else return s.v.add(a),t;let c=!1;this.insertCount++%n===0&&(c=!0);for(let u=o.length-1;u>=0;u--){let{parent:p,node:h}=o[u];if(h.updateHeight(),c){let m=this.rebalanceNode(h);p?p.l===h?p.l=m:p.r===h&&(p.r=m):t=m}}return t}rebalanceNode(t){let r=t.getBalanceFactor();if(r>1){if(t.l&&t.l.getBalanceFactor()>=0)return t.rotateRight();if(t.l)return t.l=t.l.rotateLeft(),t.rotateRight()}if(r<-1){if(t.r&&t.r.getBalanceFactor()<=0)return t.rotateLeft();if(t.r)return t.r=t.r.rotateRight(),t.rotateLeft()}return t}find(t){let r=this.findNodeByKey(t);return r?r.v:null}contains(t){return this.find(t)!==null}getSize(){let t=0,r=[],a=this.root;for(;a||r.length>0;){for(;a;)r.push(a),a=a.l;a=r.pop(),t++,a=a.r}return t}isBalanced(){if(!this.root)return!0;let t=[this.root];for(;t.length>0;){let r=t.pop(),a=r.getBalanceFactor();if(Math.abs(a)>1)return!1;r.l&&t.push(r.l),r.r&&t.push(r.r)}return!0}remove(t){this.root=this.removeNode(this.root,t)}removeDocument(t,r){let a=this.findNodeByKey(t);a&&(a.v.size===1?this.root=this.removeNode(this.root,t):a.v=new Set([...a.v.values()].filter(n=>n!==r)))}findNodeByKey(t){let r=this.root;for(;r;)if(tr.k)r=r.r;else return r;return null}removeNode(t,r){if(t===null)return null;let a=[],n=t;for(;n!==null&&n.k!==r;)a.push(n),r=0;o--){let s=a[o];s.updateHeight();let i=this.rebalanceNode(s);if(o>0){let c=a[o-1];c.l===s?c.l=i:c.r===s&&(c.r=i)}else t=i}return t}rangeSearch(t,r){let a=new Set,n=[],o=this.root;for(;o||n.length>0;){for(;o;)n.push(o),o=o.l;if(o=n.pop(),o.k>=t&&o.k<=r&&(a=nn(a,o.v)),o.k>r)break;o=o.r}return a}greaterThan(t,r=!1){let a=new Set,n=[],o=this.root;for(;o||n.length>0;){for(;o;)n.push(o),o=o.r;if(o=n.pop(),r&&o.k>=t||!r&&o.k>t)a=nn(a,o.v);else if(o.k<=t)break;o=o.l}return a}lessThan(t,r=!1){let a=new Set,n=[],o=this.root;for(;o||n.length>0;){for(;o;)n.push(o),o=o.l;if(o=n.pop(),r&&o.k<=t||!r&&o.kt)break;o=o.r}return a}};E();var Ci=class e{numberToDocumentId;constructor(){this.numberToDocumentId=new Map}insert(t,r){this.numberToDocumentId.has(t)?this.numberToDocumentId.get(t).add(r):this.numberToDocumentId.set(t,new Set([r]))}find(t){let r=this.numberToDocumentId.get(t);return r?Array.from(r):null}remove(t){this.numberToDocumentId.delete(t)}removeDocument(t,r){let a=this.numberToDocumentId.get(r);a&&(a.delete(t),a.size===0&&this.numberToDocumentId.delete(r))}contains(t){return this.numberToDocumentId.has(t)}getSize(){let t=0;for(let r of this.numberToDocumentId.values())t+=r.size;return t}filter(t){let r=Object.keys(t);if(r.length!==1)throw new Error("Invalid operation");let a=r[0];switch(a){case"eq":{let n=t[a],o=this.numberToDocumentId.get(n);return o?Array.from(o):[]}case"in":{let n=t[a],o=new Set;for(let s of n){let i=this.numberToDocumentId.get(s);if(i)for(let c of i)o.add(c)}return Array.from(o)}case"nin":{let n=new Set(t[a]),o=new Set;for(let[s,i]of this.numberToDocumentId.entries())if(!n.has(s))for(let c of i)o.add(c);return Array.from(o)}default:throw new Error("Invalid operation")}}filterArr(t){let r=Object.keys(t);if(r.length!==1)throw new Error("Invalid operation");let a=r[0];switch(a){case"containsAll":{let o=t[a].map(i=>this.numberToDocumentId.get(i)??new Set);if(o.length===0)return[];let s=o.reduce((i,c)=>new Set([...i].filter(u=>c.has(u))));return Array.from(s)}case"containsAny":{let o=t[a].map(i=>this.numberToDocumentId.get(i)??new Set);if(o.length===0)return[];let s=o.reduce((i,c)=>new Set([...i,...c]));return Array.from(s)}default:throw new Error("Invalid operation")}}static fromJSON(t){if(!t.numberToDocumentId)throw new Error("Invalid Flat Tree JSON");let r=new e;for(let[a,n]of t.numberToDocumentId)r.numberToDocumentId.set(a,new Set(n));return r}toJSON(){return{numberToDocumentId:Array.from(this.numberToDocumentId.entries()).map(([t,r])=>[t,Array.from(r)])}}};E();E();function vI(e,t,r){if(r<0)return-1;if(e===t)return 0;let a=e.length,n=t.length;if(a===0)return n<=r?n:-1;if(n===0)return a<=r?a:-1;let o=Math.abs(a-n);if(e.startsWith(t))return o<=r?o:-1;if(t.startsWith(e))return 0;if(o>r)return-1;let s=[];for(let i=0;i<=a;i++){s[i]=[i];for(let c=1;c<=n;c++)s[i][c]=i===0?c:0}for(let i=1;i<=a;i++){let c=1/0;for(let u=1;u<=n;u++)e[i-1]===t[u-1]?s[i][u]=s[i-1][u-1]:s[i][u]=Math.min(s[i-1][u]+1,s[i][u-1]+1,s[i-1][u-1]+1),c=Math.min(c,s[i][u]);if(c>r)return-1}return s[a][n]<=r?s[a][n]:-1}function rp(e,t,r){let a=vI(e,t,r);return{distance:a,isBounded:a>=0}}var jc=class e{k;s;c=new Map;d=new Set;e;w="";constructor(t,r,a){this.k=t,this.s=r,this.e=a}updateParent(t){this.w=t.w+this.s}addDocument(t){this.d.add(t)}removeDocument(t){return this.d.delete(t)}findAllWords(t,r,a,n){let o=[this];for(;o.length>0;){let s=o.pop();if(s.e){let{w:i,d:c}=s;if(a&&i!==r)continue;if(Zc(t,i)!==null)if(n)if(Math.abs(r.length-i.length)<=n&&rp(r,i,n).isBounded)t[i]=[];else continue;else t[i]=[];if(Zc(t,i)!=null&&c.size>0){let u=t[i];for(let p of c)u.includes(p)||u.push(p)}}s.c.size>0&&o.push(...s.c.values())}return t}insert(t,r){let a=this,n=0,o=t.length;for(;n0;){let{node:i,index:c,tolerance:u}=s.pop();if(i.w.startsWith(t)){i.findAllWords(o,t,!1,0);continue}if(u<0)continue;if(i.e){let{w:h,d:m}=i;if(h&&(rp(t,h,n).isBounded&&(o[h]=[]),Zc(o,h)!==void 0&&m.size>0)){let g=new Set(o[h]);for(let x of m)g.add(x);o[h]=Array.from(g)}}if(c>=t.length)continue;let p=t[c];if(i.c.has(p)){let h=i.c.get(p);s.push({node:h,index:c+1,tolerance:u})}s.push({node:i,index:c+1,tolerance:u-1});for(let[h,m]of i.c)s.push({node:m,index:c,tolerance:u-1}),h!==p&&s.push({node:m,index:c+1,tolerance:u-1})}}find(t){let{term:r,exact:a,tolerance:n}=t;if(n&&!a){let o={};return this._findLevenshtein(r,0,n,n,o),o}else{let o=this,s=0,i=r.length;for(;s0&&r.c.size===0&&!r.e&&r.d.size===0;){let{parent:o,character:s}=n.pop();o.c.delete(s),r=o}return!0}removeDocumentByWord(t,r,a=!0){if(!t)return!0;let n=this,o=t.length;for(let s=0;s[t,r.toJSON()])}}static fromJSON(t){let r=new e(t.k,t.s,t.e);return r.w=t.w,r.d=new Set(t.d),r.c=new Map(t?.c?.map(([a,n])=>[a,e.fromJSON(n)])),r}},Ai=class e extends jc{constructor(){super("","",!1)}static fromJSON(t){let r=new e;return r.w=t.w,r.s=t.s,r.e=t.e,r.k=t.k,r.d=new Set(t.d),r.c=new Map(t.c?.map(([a,n])=>[a,jc.fromJSON(n)])),r}toJSON(){return super.toJSON()}};E();var Bc=class e{point;docIDs;left;right;parent;constructor(t,r){this.point=t,this.docIDs=new Set(r),this.left=null,this.right=null,this.parent=null}toJSON(){return{point:this.point,docIDs:Array.from(this.docIDs),left:this.left?this.left.toJSON():null,right:this.right?this.right.toJSON():null}}static fromJSON(t,r=null){let a=new e(t.point,t.docIDs);return a.parent=r,t.left&&(a.left=e.fromJSON(t.left,a)),t.right&&(a.right=e.fromJSON(t.right,a)),a}},Ti=class e{root;nodeMap;constructor(){this.root=null,this.nodeMap=new Map}getPointKey(t){return`${t.lon},${t.lat}`}insert(t,r){let a=this.getPointKey(t),n=this.nodeMap.get(a);if(n){r.forEach(c=>n.docIDs.add(c));return}let o=new Bc(t,r);if(this.nodeMap.set(a,o),this.root==null){this.root=o;return}let s=this.root,i=0;for(;;){if(i%2===0)if(t.lon0;){let{node:u,depth:p}=i.pop();if(u==null)continue;let h=s(t,u.point);(a?h<=r:h>r)&&c.push({point:u.point,docIDs:Array.from(u.docIDs)}),u.left!=null&&i.push({node:u.left,depth:p+1}),u.right!=null&&i.push({node:u.right,depth:p+1})}return n&&c.sort((u,p)=>{let h=s(t,u.point),m=s(t,p.point);return n.toLowerCase()==="asc"?h-m:m-h}),c}searchByPolygon(t,r=!0,a=null,n=!1){let o=[{node:this.root,depth:0}],s=[];for(;o.length>0;){let{node:c,depth:u}=o.pop();if(c==null)continue;c.left!=null&&o.push({node:c.left,depth:u+1}),c.right!=null&&o.push({node:c.right,depth:u+1});let p=e.isPointInPolygon(t,c.point);(p&&r||!p&&!r)&&s.push({point:c.point,docIDs:Array.from(c.docIDs)})}let i=e.calculatePolygonCentroid(t);if(a){let c=n?e.vincentyDistance:e.haversineDistance;s.sort((u,p)=>{let h=c(i,u.point),m=c(i,p.point);return a.toLowerCase()==="asc"?h-m:m-h})}return s}toJSON(){return{root:this.root?this.root.toJSON():null}}static fromJSON(t){let r=new e;return t.root&&(r.root=Bc.fromJSON(t.root),r.buildNodeMap(r.root)),r}buildNodeMap(t){if(t==null)return;let r=this.getPointKey(t.point);this.nodeMap.set(r,t),t.left&&this.buildNodeMap(t.left),t.right&&this.buildNodeMap(t.right)}static calculatePolygonCentroid(t){let r=0,a=0,n=0,o=t.length;for(let i=0,c=o-1;io!=m>o&&n<(h-u)*(o-p)/(m-p)+u&&(a=!a)}return a}static haversineDistance(t,r){let a=Math.PI/180,n=t.lat*a,o=r.lat*a,s=(r.lat-t.lat)*a,i=(r.lon-t.lon)*a,c=Math.sin(s/2)*Math.sin(s/2)+Math.cos(n)*Math.cos(o)*Math.sin(i/2)*Math.sin(i/2);return 6371e3*(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)))}static vincentyDistance(t,r){let n=.0033528106647474805,o=(1-n)*6378137,s=Math.PI/180,i=t.lat*s,c=r.lat*s,u=(r.lon-t.lon)*s,p=Math.atan((1-n)*Math.tan(i)),h=Math.atan((1-n)*Math.tan(c)),m=Math.sin(p),g=Math.cos(p),x=Math.sin(h),w=Math.cos(h),k=u,C,A=1e3,$,L,M,O,R,B;do{let ae=Math.sin(k),oe=Math.cos(k);if($=Math.sqrt(w*ae*(w*ae)+(g*x-m*w*oe)*(g*x-m*w*oe)),$===0)return 0;L=m*x+g*w*oe,M=Math.atan2($,L),O=g*w*ae/$,R=1-O*O,B=L-2*m*x/R,isNaN(B)&&(B=0);let ue=n/16*R*(4+n*(4-3*R));C=k,k=u+(1-ue)*n*O*(M+ue*$*(B+ue*L*(-1+2*B*B)))}while(Math.abs(k-C)>1e-12&&--A>0);if(A===0)return NaN;let G=R*(6378137*6378137-o*o)/(o*o),j=1+G/16384*(4096+G*(-768+G*(320-175*G))),N=G/1024*(256+G*(-128+G*(74-47*G))),T=N*$*(B+N/4*(L*(-1+2*B*B)-N/6*B*(-3+4*$*$)*(-3+4*B*B)));return o*j*(M-T)}};E();var Ei=class e{true;false;constructor(){this.true=new Set,this.false=new Set}insert(t,r){r?this.true.add(t):this.false.add(t)}delete(t,r){r?this.true.delete(t):this.false.delete(t)}getSize(){return this.true.size+this.false.size}toJSON(){return{true:Array.from(this.true),false:Array.from(this.false)}}static fromJSON(t){let r=new e;return r.true=new Set(t.true),r.false=new Set(t.false),r}};E();function jy(e,t,r,a,n,{k:o,b:s,d:i}){return Math.log(1+(r-t+.5)/(t+.5))*(i+e*(o+1))/(e+o*(1-s+s*a/n))}E();var $i=class e{size;vectors=new Map;constructor(t){this.size=t}add(t,r){r instanceof Float32Array||(r=new Float32Array(r));let a=By(r,this.size);this.vectors.set(t,[a,r])}remove(t){this.vectors.delete(t)}find(t,r,a){return t instanceof Float32Array||(t=new Float32Array(t)),wI(t,a,this.vectors,this.size,r)}toJSON(){let t=[];for(let[r,[a,n]]of this.vectors)t.push([r,[a,Array.from(n)]]);return{size:this.size,vectors:t}}static fromJSON(t){let r=t,a=new e(r.size);for(let[n,[o,s]]of r.vectors)a.vectors.set(n,[o,new Float32Array(s)]);return a}};function By(e,t){let r=0;for(let a=0;a=n&&s.push([c,g])}return s}function xI(e,t,r,a,n){let o=Nr(e.sharedInternalDocumentStore,r);e.avgFieldLength[t]=((e.avgFieldLength[t]??0)*(n-1)+a.length)/n,e.fieldLengths[t][o]=a.length,e.frequencies[t][o]={}}function _I(e,t,r,a,n){let o=0;for(let c of a)c===n&&o++;let s=Nr(e.sharedInternalDocumentStore,r),i=o/a.length;e.frequencies[t][s][n]=i,n in e.tokenOccurrences[t]||(e.tokenOccurrences[t][n]=0),e.tokenOccurrences[t][n]=(e.tokenOccurrences[t][n]??0)+1}function kI(e,t,r,a){let n=Nr(e.sharedInternalDocumentStore,r);a>1?e.avgFieldLength[t]=(e.avgFieldLength[t]*a-e.fieldLengths[t][n])/(a-1):e.avgFieldLength[t]=void 0,e.fieldLengths[t][n]=void 0,e.frequencies[t][n]=void 0}function SI(e,t,r){e.tokenOccurrences[t][r]--}function Vy(e,t,r,a,n=""){a||(a={sharedInternalDocumentStore:t,indexes:{},vectorIndexes:{},searchableProperties:[],searchablePropertiesWithTypes:{},frequencies:{},tokenOccurrences:{},avgFieldLength:{},fieldLengths:{}});for(let[o,s]of Object.entries(r)){let i=`${n}${n?".":""}${o}`;if(typeof s=="object"&&!Array.isArray(s)){Vy(e,t,s,a,i);continue}if(oo(s))a.searchableProperties.push(i),a.searchablePropertiesWithTypes[i]=s,a.vectorIndexes[i]={type:"Vector",node:new $i(ep(s)),isArray:!1};else{let c=/\[/.test(s);switch(s){case"boolean":case"boolean[]":a.indexes[i]={type:"Bool",node:new Ei,isArray:c};break;case"number":case"number[]":a.indexes[i]={type:"AVL",node:new Ii(0,[]),isArray:c};break;case"string":case"string[]":a.indexes[i]={type:"Radix",node:new Ai,isArray:c},a.avgFieldLength[i]=0,a.frequencies[i]={},a.tokenOccurrences[i]={},a.fieldLengths[i]={};break;case"enum":case"enum[]":a.indexes[i]={type:"Flat",node:new Ci,isArray:c};break;case"geopoint":a.indexes[i]={type:"BKD",node:new Ti,isArray:c};break;default:throw et("INVALID_SCHEMA_TYPE",Array.isArray(s)?"array":s,i)}a.searchableProperties.push(i),a.searchablePropertiesWithTypes[i]=s}}return a}function II(e,t,r,a,n,o,s,i){return c=>{let{type:u,node:p}=t.indexes[r];switch(u){case"Bool":{p[c?"true":"false"].add(a);break}case"AVL":{let h=i?.avlRebalanceThreshold??1;p.insert(c,a,h);break}case"Radix":{let h=o.tokenize(c,n,r,!1);e.insertDocumentScoreParameters(t,r,a,h,s);for(let m of h)e.insertTokenScoreParameters(t,r,a,h,m),p.insert(m,a);break}case"Flat":{p.insert(c,a);break}case"BKD":{p.insert(c,[a]);break}}}}function CI(e,t,r,a,n,o,s,i,c,u,p){if(oo(s))return AI(t,r,o,a,n);let h=II(e,t,r,n,i,c,u,p);if(!Si(s))return h(o);let m=o,g=m.length;for(let x=0;x0&&w.set(G,!0);let T=N.length;for(let U=0;U[$,L]).sort(($,L)=>L[1]-$[1]);if(C.length===0)return[];if(h===1)return C;if(h===0){if(g===1)return C;for(let L of m)if(!w.get(L))return[];return C.filter(([L])=>{let M=x.get(L);return M?Array.from(M.values()).some(O=>O===g):!1})}let A=C.filter(([$])=>{let L=x.get($);return L?Array.from(L.values()).some(M=>M===g):!1});if(A.length>0){let $=C.filter(([M])=>!A.some(([O])=>O===M)),L=Math.ceil($.length*h);return[...A,...$.slice(0,L)]}return C}function $I(e,t,r,a){let n=Object.keys(r),o=n.reduce((s,i)=>({[i]:new Set,...s}),{});for(let s of n){let i=r[s];if(typeof e.indexes[s]>"u")throw et("UNKNOWN_FILTER_PROPERTY",s);let{node:c,type:u,isArray:p}=e.indexes[s];if(u==="Bool"){let m=c,g=i?m.true:m.false;o[s]=nn(o[s],g);continue}if(u==="BKD"){let m;if("radius"in i)m="radius";else if("polygon"in i)m="polygon";else throw new Error(`Invalid operation ${i}`);if(m==="radius"){let{value:g,coordinates:x,unit:w="m",inside:k=!0,highPrecision:C=!1}=i[m],A=Yh(g,w),$=c.searchByRadius(x,A,k,void 0,C);o[s]=Uy(o[s],$)}else{let{coordinates:g,inside:x=!0,highPrecision:w=!1}=i[m],k=c.searchByPolygon(g,x,void 0,w);o[s]=Uy(o[s],k)}continue}if(u==="Radix"&&(typeof i=="string"||Array.isArray(i))){for(let m of[i].flat()){let g=t.tokenize(m,a,s);for(let x of g){let w=c.find({term:x,exact:!0});o[s]=MI(o[s],w)}}continue}let h=Object.keys(i);if(h.length>1)throw et("INVALID_FILTER_OPERATION",h.length);if(u==="Flat"){let m=new Set(p?c.filterArr(i):c.filter(i));o[s]=nn(o[s],m);continue}if(u==="AVL"){let m=h[0],g=i[m],x;switch(m){case"gt":{x=c.greaterThan(g,!1);break}case"gte":{x=c.greaterThan(g,!0);break}case"lt":{x=c.lessThan(g,!1);break}case"lte":{x=c.lessThan(g,!0);break}case"eq":{x=c.find(g)??new Set;break}case"between":{let[w,k]=g;x=c.rangeSearch(w,k);break}default:throw et("INVALID_FILTER_OPERATION",m)}o[s]=nn(o[s],x)}}return Qh(...Object.values(o))}function PI(e){return e.searchableProperties}function OI(e){return e.searchablePropertiesWithTypes}function RI(e,t){let{indexes:r,vectorIndexes:a,searchableProperties:n,searchablePropertiesWithTypes:o,frequencies:s,tokenOccurrences:i,avgFieldLength:c,fieldLengths:u}=t,p={},h={};for(let m of Object.keys(r)){let{node:g,type:x,isArray:w}=r[m];switch(x){case"Radix":p[m]={type:"Radix",node:Ai.fromJSON(g),isArray:w};break;case"Flat":p[m]={type:"Flat",node:Ci.fromJSON(g),isArray:w};break;case"AVL":p[m]={type:"AVL",node:Ii.fromJSON(g),isArray:w};break;case"BKD":p[m]={type:"BKD",node:Ti.fromJSON(g),isArray:w};break;case"Bool":p[m]={type:"Bool",node:Ei.fromJSON(g),isArray:w};break;default:p[m]=r[m]}}for(let m of Object.keys(a))h[m]={type:"Vector",isArray:!1,node:$i.fromJSON(a[m])};return{sharedInternalDocumentStore:e,indexes:p,vectorIndexes:h,searchableProperties:n,searchablePropertiesWithTypes:o,frequencies:s,tokenOccurrences:i,avgFieldLength:c,fieldLengths:u}}function LI(e){let{indexes:t,vectorIndexes:r,searchableProperties:a,searchablePropertiesWithTypes:n,frequencies:o,tokenOccurrences:s,avgFieldLength:i,fieldLengths:c}=e,u={};for(let h of Object.keys(r))u[h]=r[h].node.toJSON();let p={};for(let h of Object.keys(t)){let{type:m,node:g,isArray:x}=t[h];m==="Flat"||m==="Radix"||m==="AVL"||m==="BKD"||m==="Bool"?p[h]={type:m,node:g.toJSON(),isArray:x}:(p[h]=t[h],p[h].node=p[h].node.toJSON())}return{indexes:p,vectorIndexes:u,searchableProperties:a,searchablePropertiesWithTypes:n,frequencies:o,tokenOccurrences:s,avgFieldLength:i,fieldLengths:c}}function Wy(){return{create:Vy,insert:CI,remove:TI,insertDocumentScoreParameters:xI,insertTokenScoreParameters:_I,removeDocumentScoreParameters:kI,removeTokenScoreParameters:SI,calculateResultScores:Fy,search:EI,searchByWhereClause:$I,getSearchableProperties:PI,getSearchablePropertiesWithTypes:OI,load:RI,save:LI}}function Uy(e,t){e||(e=new Set);let r=t.length;for(let a=0;a!r.orderedDocsToRemove.has(a[0])),r.orderedDocsToRemove.clear())}function VI(e,t,r){if(!e.enabled)return;let a=e.sorts[t],n=Nr(e.sharedInternalDocumentStore,r);a.docs.get(n)&&(a.docs.delete(n),a.orderedDocsToRemove.set(n,!0))}function FI(e,t,r){if(!e.enabled)throw et("SORT_DISABLED");let a=r.property,n=r.order==="DESC",o=e.sorts[a];if(!o)throw et("UNABLE_TO_SORT_ON_UNKNOWN_FIELD",a,e.sortableProperties.join(", "));return ap(e,a),Ky(e),t.sort((s,i)=>{let c=o.docs.get(Nr(e.sharedInternalDocumentStore,s[0])),u=o.docs.get(Nr(e.sharedInternalDocumentStore,i[0])),p=typeof c<"u",h=typeof u<"u";return!p&&!h?0:p?h?n?u-c:c-u:-1:1}),t}function WI(e){return e.enabled?e.sortableProperties:[]}function qI(e){return e.enabled?e.sortablePropertiesWithTypes:{}}function KI(e,t){let r=t;if(!r.enabled)return{enabled:!1};let a=Object.keys(r.sorts).reduce((n,o)=>{let{docs:s,orderedDocs:i,type:c}=r.sorts[o];return n[o]={docs:new Map(Object.entries(s).map(([u,p])=>[+u,p])),orderedDocsToRemove:new Map,orderedDocs:i,type:c},n},{});return{sharedInternalDocumentStore:e,language:r.language,sortableProperties:r.sortableProperties,sortablePropertiesWithTypes:r.sortablePropertiesWithTypes,sorts:a,enabled:!0,isSorted:r.isSorted}}function GI(e){if(!e.enabled)return{enabled:!1};UI(e),Ky(e);let t=Object.keys(e.sorts).reduce((r,a)=>{let{docs:n,orderedDocs:o,type:s}=e.sorts[a];return r[a]={docs:Object.fromEntries(n.entries()),orderedDocs:o,type:s},r},{});return{language:e.language,sortableProperties:e.sortableProperties,sortablePropertiesWithTypes:e.sortablePropertiesWithTypes,sorts:t,enabled:e.enabled,isSorted:e.isSorted}}function Gy(){return{create:DI,insert:zI,remove:VI,save:GI,load:KI,sortBy:FI,getSortableProperties:WI,getSortablePropertiesWithTypes:qI}}E();E();var QI=[65,65,65,65,65,65,65,67,69,69,69,69,73,73,73,73,69,78,79,79,79,79,79,null,79,85,85,85,85,89,80,115,97,97,97,97,97,97,97,99,101,101,101,101,105,105,105,105,101,110,111,111,111,111,111,null,111,117,117,117,117,121,112,121,65,97,65,97,65,97,67,99,67,99,67,99,67,99,68,100,68,100,69,101,69,101,69,101,69,101,69,101,71,103,71,103,71,103,71,103,72,104,72,104,73,105,73,105,73,105,73,105,73,105,73,105,74,106,75,107,107,76,108,76,108,76,108,76,108,76,108,78,110,78,110,78,110,110,78,110,79,111,79,111,79,111,79,111,82,114,82,114,82,114,83,115,83,115,83,115,83,115,84,116,84,116,84,116,85,117,85,117,85,117,85,117,85,117,85,117,87,119,89,121,89,90,122,90,122,90,122,115];function XI(e){return e<192||e>383?e:QI[e-192]||e}function Yy(e){let t=[];for(let r=0;rn(c,a)).filter(Boolean)}let s=aC(o);return this.allowDuplicates?s:Array.from(new Set(s))}function sp(e={}){if(!e.language)e.language="english";else if(!xi.includes(e.language))throw et("LANGUAGE_NOT_SUPPORTED",e.language);let t;if(e.stemming||e.stemmer&&!("stemming"in e))if(e.stemmer){if(typeof e.stemmer!="function")throw et("INVALID_STEMMER_FUNCTION_TYPE");t=e.stemmer}else if(e.language==="english")t=Xy;else throw et("MISSING_STEMMER",e.language);let r;if(e.stopWords!==!1){if(r=[],Array.isArray(e.stopWords))r=e.stopWords;else if(typeof e.stopWords=="function")r=e.stopWords(r);else if(e.stopWords)throw et("CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY");if(!Array.isArray(r))throw et("CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY");for(let n of r)if(typeof n!="string")throw et("CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY")}let a={tokenize:Jy,language:e.language,stemmer:t,stemmerSkipProperties:new Set(e.stemmerSkipProperties?[e.stemmerSkipProperties].flat():[]),tokenizeSkipProperties:new Set(e.tokenizeSkipProperties?[e.tokenizeSkipProperties].flat():[]),stopWords:r,allowDuplicates:!!e.allowDuplicates,normalizeToken:op,normalizationCache:new Map};return a.tokenize=Jy.bind(a),a.normalizeToken=op,a}function oC(e){let t={formatElapsedTime:Oy,getDocumentIndexId:Ry,getDocumentProperties:Gh,validateSchema:Xh};for(let r of tp){let a=r;if(e[a]){if(typeof e[a]!="function")throw et("COMPONENT_MUST_BE_FUNCTION",a)}else e[a]=t[a]}for(let r of Object.keys(e))if(!zy.includes(r)&&!tp.includes(r))throw et("UNSUPPORTED_COMPONENT",r)}function ip({schema:e,sort:t,language:r,components:a,id:n,plugins:o}){a||(a={});for(let C of o??[]){if(!("getComponents"in C)||typeof C.getComponents!="function")continue;let A=C.getComponents(e),$=Object.keys(A);for(let L of $)if(a[L])throw et("PLUGIN_COMPONENT_CONFLICT",L,C.name);a={...a,...A}}n||(n=ki());let s=a.tokenizer,i=a.index,c=a.documentsStore,u=a.sorter;if(s?s.tokenize?s=s:s=sp(s):s=sp({language:r??"english"}),a.tokenizer&&r)throw et("NO_LANGUAGE_WITH_CUSTOM_TOKENIZER");let p=Ly();i||=Wy(),u||=Gy(),c||=My(),oC(a);let{getDocumentProperties:h,getDocumentIndexId:m,validateSchema:g,formatElapsedTime:x}=a,w={data:{},caches:{},schema:e,tokenizer:s,index:i,sorter:u,documentsStore:c,internalDocumentIDStore:p,getDocumentProperties:h,getDocumentIndexId:m,validateSchema:g,beforeInsert:[],afterInsert:[],beforeRemove:[],afterRemove:[],beforeUpdate:[],afterUpdate:[],beforeSearch:[],afterSearch:[],beforeInsertMultiple:[],afterInsertMultiple:[],beforeRemoveMultiple:[],afterRemoveMultiple:[],afterUpdateMultiple:[],beforeUpdateMultiple:[],afterCreate:[],formatElapsedTime:x,id:n,plugins:o,version:sC()};w.data={index:w.index.create(w,p,e),docs:w.documentsStore.create(w,p),sorting:w.sorter.create(w,p,e,t)};for(let C of Ny)w[C]=(w[C]??[]).concat(Dy(w,C));let k=w.afterCreate;return k&&Zy(k,w),w}function sC(){return"{{VERSION}}"}E();E();E();E();E();E();E();E();E();E();E();E();function dp(e,t){e.internalDocumentIDStore.load(e,t.internalDocumentIDStore),e.data.index=e.index.load(e.internalDocumentIDStore,t.index),e.data.docs=e.documentsStore.load(e.internalDocumentIDStore,t.docs),e.data.sorting=e.sorter.load(e.internalDocumentIDStore,t.sorting),e.tokenizer.language=t.language}E();E();E();var $F=Symbol("orama.insertions"),PF=Symbol("orama.removals");E();E();E();Ss();function up(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t==="top"&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}l(up,"styleInject");Ed();Ss();E();E();E();var wP=new Set(["children","localName","ref","style","className"]),Y8=new WeakMap,Q8=(e,t,r,a,n)=>{let o=n?.[t];o===void 0?(e[t]=r,r==null&&t in HTMLElement.prototype&&e.removeAttribute(t)):r!==a&&((s,i,c)=>{let u=Y8.get(s);u===void 0&&Y8.set(s,u=new Map);let p=u.get(i);c!==void 0?p===void 0?(u.set(i,p={handleEvent:c}),s.addEventListener(i,p)):p.handleEvent=c:p!==void 0&&(u.delete(i),s.removeEventListener(i,p))})(e,o,r)},xm=({react:e,tagName:t,elementClass:r,events:a,displayName:n})=>{let o=new Set(Object.keys(a??{})),s=e.forwardRef((i,c)=>{let u=e.useRef(new Map),p=e.useRef(null),h={},m={};for(let[g,x]of Object.entries(i))wP.has(g)?h[g==="className"?"class":g]=x:o.has(g)||g in r.prototype?m[g]=x:h[g]=x;return e.useLayoutEffect(()=>{if(p.current===null)return;let g=new Map;for(let x in m)Q8(p.current,x,i[x],u.current.get(x),a),u.current.delete(x),g.set(x,i[x]);for(let[x,w]of u.current)Q8(p.current,x,void 0,w,a);u.current=g}),e.useLayoutEffect(()=>{p.current?.removeAttribute("defer-hydration")},[]),h.suppressHydrationWarning=!0,e.createElement(t,{...h,ref:e.useCallback(g=>{p.current=g,typeof c=="function"?c(g):c!==null&&(c.current=g)},[c])})});return s.displayName=n??r.name,s};var kl=({defineCustomElement:e,...t})=>(typeof e<"u"&&e(),xm(t));Oe();var xP="orama-ui",Yo={experimentalSlotFixes:!0,hydratedSelectorName:"hydrated",lazyLoad:!1,shadowDom:!0,slotRelocation:!0,updatable:!0},_P=Object.defineProperty,kP=l((e,t)=>{for(var r in t)_P(e,r,{get:t[r],enumerable:!0})},"__export"),SP="http://www.w3.org/2000/svg",IP="http://www.w3.org/1999/xhtml",Cx=(e=>(e.Undefined="undefined",e.Null="null",e.String="string",e.Number="number",e.SpecialNumber="number",e.Boolean="boolean",e.BigInt="bigint",e))(Cx||{}),Ax=(e=>(e.Array="array",e.Date="date",e.Map="map",e.Object="object",e.RegularExpression="regexp",e.Set="set",e.Channel="channel",e.Symbol="symbol",e))(Ax||{}),_m="type",km="value",zm="serialized:",mo=l(e=>{if(e.__stencil__getHostRef)return e.__stencil__getHostRef()},"getHostRef"),CP=l((e,t)=>{let r={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};r.$onReadyPromise$=new Promise(n=>r.$onReadyResolve$=n),e["s-p"]=[],e["s-rc"]=[];let a=r;return e.__stencil__getHostRef=()=>a,a},"registerHost"),X8=l((e,t)=>t in e,"isMemberInElement"),Vl=l((e,t)=>(0,console.error)(e,t),"consoleError"),iu=new Map,AP="r",TP="o",EP="s",$P="t",PP="c",zl="s-id",lu="sty-id",J8="c-id",OP="slot-fb{display:contents}slot-fb[hidden]{display:none}",e6="http://www.w3.org/1999/xlink",er=typeof window<"u"?window:{},Xt=er.HTMLElement||class{},Qt={$flags$:0,$resourcesUrl$:"",jmp:l(e=>e(),"jmp"),raf:l(e=>requestAnimationFrame(e),"raf"),ael:l((e,t,r,a)=>e.addEventListener(t,r,a),"ael"),rel:l((e,t,r,a)=>e.removeEventListener(t,r,a),"rel"),ce:l((e,t)=>new CustomEvent(e,t),"ce")},RP=Yo.shadowDom,LP=(()=>{var e;let t=!1;try{(e=er.document)==null||e.addEventListener("e",null,Object.defineProperty({},"passive",{get(){t=!0}}))}catch{}return t})(),MP=l(e=>Promise.resolve(e),"promiseResolve"),Tx=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1})(),Zm=!1,t6=[],Ex=[],NP=l((e,t)=>r=>{e.push(r),Zm||(Zm=!0,t&&Qt.$flags$&4?ku(jm):Qt.raf(jm))},"queueTask"),r6=l(e=>{for(let t=0;t{r6(t6),r6(Ex),(Zm=t6.length>0)&&Qt.raf(jm)},"flush"),ku=l(e=>MP().then(e),"nextTick"),DP=NP(Ex,!0),zP=l(e=>e!=null&&e!==void 0,"isDef"),k0=l(e=>(e=typeof e,e==="object"||e==="function"),"isComplexType");function $x(e){var t,r,a;return(a=(r=(t=e.head)==null?void 0:t.querySelector('meta[name="csp-nonce"]'))==null?void 0:r.getAttribute("content"))!=null?a:void 0}l($x,"queryNonceMetaTagContent");var ZP=l(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeRegExpSpecialCharacters"),jP=class Uo{static{l(this,"_RemoteValue")}static fromLocalValue(t){let r=t[_m],a=km in t?t[km]:void 0;switch(r){case"string":return a;case"boolean":return a;case"bigint":return BigInt(a);case"undefined":return;case"null":return null;case"number":return a==="NaN"?NaN:a==="-0"?-0:a==="Infinity"?1/0:a==="-Infinity"?-1/0:a;case"array":return a.map(u=>Uo.fromLocalValue(u));case"date":return new Date(a);case"map":let n=new Map;for(let[u,p]of a){let h=typeof u=="object"&&u!==null?Uo.fromLocalValue(u):u,m=Uo.fromLocalValue(p);n.set(h,m)}return n;case"object":let o={};for(let[u,p]of a)o[u]=Uo.fromLocalValue(p);return o;case"regexp":let{pattern:s,flags:i}=a;return new RegExp(s,i);case"set":let c=new Set;for(let u of a)c.add(Uo.fromLocalValue(u));return c;case"symbol":return Symbol(a);default:throw new Error(`Unsupported type: ${r}`)}}static fromLocalValueArray(t){return t.map(r=>Uo.fromLocalValue(r))}static isLocalValueObject(t){if(typeof t!="object"||t===null||!t.hasOwnProperty(_m))return!1;let r=t[_m];return Object.values({...Cx,...Ax}).includes(r)?r!=="null"&&r!=="undefined"?t.hasOwnProperty(km):!0:!1}},BP={};kP(BP,{err:l(()=>Px,"err"),map:l(()=>Ox,"map"),ok:l(()=>Bm,"ok"),unwrap:l(()=>HP,"unwrap"),unwrapErr:l(()=>UP,"unwrapErr")});var Bm=l(e=>({isOk:!0,isErr:!1,value:e}),"ok"),Px=l(e=>({isOk:!1,isErr:!0,value:e}),"err");function Ox(e,t){if(e.isOk){let r=t(e.value);return r instanceof Promise?r.then(a=>Bm(a)):Bm(r)}if(e.isErr){let r=e.value;return Px(r)}throw"should never get here"}l(Ox,"map");var HP=l(e=>{if(e.isOk)return e.value;throw e.value},"unwrap"),UP=l(e=>{if(e.isErr)return e.value;throw e.value},"unwrapErr");function Rx(e){return typeof e!="string"||!e.startsWith(zm)?e:jP.fromLocalValue(JSON.parse(atob(e.slice(zm.length))))}l(Rx,"deserializeProperty");var Su=l(e=>{let t=Jr(e,"childNodes");e.tagName&&e.tagName.includes("-")&&e["s-cr"]&&e.tagName!=="SLOT-FB"&&Js(t,e.tagName).forEach(a=>{a.nodeType===1&&a.tagName==="SLOT-FB"&&(S0(a,ei(a),!1).length?a.hidden=!0:a.hidden=!1)});let r=0;for(r=0;r{let t=[];for(let r=0;r{let a=[];(r&&e["s-sr"]||!e["s-sr"])&&a.push(e);let n=e;for(;n=n.nextSibling;)ei(n)===t&&(r||!n["s-sr"])&&a.push(n);return a},"getSlotChildSiblings"),a6=l((e,t)=>e.nodeType===1?e.getAttribute("slot")===null&&t===""||e.getAttribute("slot")===t:e["s-sn"]===t?!0:t==="","isNodeLocatedInSlot"),Iu=l((e,t,r,a)=>{if(e["s-ol"]&&e["s-ol"].isConnected)return;let n=document.createTextNode("");if(n["s-nr"]=e,!t["s-cr"]||!t["s-cr"].parentNode)return;let o=t["s-cr"].parentNode,s=r?Jr(o,"prepend"):Jr(o,"appendChild");if(typeof a<"u"){n["s-oo"]=a;let i=Jr(o,"childNodes"),c=[n];i.forEach(u=>{u["s-nr"]&&c.push(u)}),c.sort((u,p)=>!u["s-oo"]||u["s-oo"]<(p["s-oo"]||0)?-1:!p["s-oo"]||p["s-oo"]s.call(o,u))}else s.call(o,n);e["s-ol"]=n,e["s-sh"]=t["s-hn"]},"addSlotRelocateNode"),ei=l(e=>typeof e["s-sn"]=="string"?e["s-sn"]:e.nodeType===1&&e.getAttribute("slot")||void 0,"getSlotName");function I0(e){if(e.assignedElements||e.assignedNodes||!e["s-sr"])return;let t=l(r=>function(a){let n=[],o=this["s-sn"];a?.flatten&&console.error(` Flattening is not supported for Stencil non-shadow slots. You can use \`.childNodes\` to nested slot fallback content. If you have a particular use case, please open an issue on the Stencil repo. `);let s=this["s-cr"].parentElement;return(s.__childNodes?s.childNodes:Zl(s.childNodes)).forEach(i=>{o===ei(i)&&n.push(i)}),r?n.filter(i=>i.nodeType===1):n}.bind(e),"assignedFactory");e.assignedElements=t(!0),e.assignedNodes=t(!1)}l(I0,"patchSlotNode");function Fl(e){e.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1,composed:!1}))}l(Fl,"dispatchSlotChangeEvent");function Cu(e,t){var r;if(t=t||((r=e["s-ol"])==null?void 0:r.parentElement),!t)return{slotNode:null,slotName:""};let a=e["s-sn"]=ei(e)||"",n=Jr(t,"childNodes");return{slotNode:Js(n,t.tagName,a)[0],slotName:a}}l(Cu,"findSlotFromSlottedNode");var VP=l(e=>{FP(e),WP(e),GP(e),KP(e),JP(e),YP(e),QP(e),XP(e),eO(e),tO(e),qP(e)},"patchPseudoShadowDom"),FP=l(e=>{let t=e.cloneNode;e.cloneNode=function(r){let a=this,n=a.shadowRoot&&RP,o=t.call(a,n?r:!1);if(!n&&r){let s=0,i,c,u=["s-id","s-cr","s-lr","s-rc","s-sc","s-p","s-cn","s-sr","s-sn","s-hn","s-ol","s-nr","s-si","s-rf","s-scs"],p=this.__childNodes||this.childNodes;for(;s!p[s][h]),i&&(o.__appendChild?o.__appendChild(i.cloneNode(!0)):o.appendChild(i.cloneNode(!0))),c&&o.appendChild(p[s].cloneNode(!0))}return o}},"patchCloneNode"),WP=l(e=>{e.__appendChild=e.appendChild,e.appendChild=function(t){let{slotName:r,slotNode:a}=Cu(t,this);if(a){Iu(t,a);let n=S0(a,r),o=n[n.length-1],s=Jr(o,"parentNode"),i=Jr(s,"insertBefore")(t,o.nextSibling);return Fl(a),Su(this),i}return this.__appendChild(t)}},"patchSlotAppendChild"),qP=l(e=>{e.__removeChild=e.removeChild,e.removeChild=function(t){if(t&&typeof t["s-sn"]<"u"){let r=this.__childNodes||this.childNodes;if(Js(r,this.tagName,t["s-sn"])&&t.isConnected){t.remove(),Su(this);return}}return this.__removeChild(t)}},"patchSlotRemoveChild"),KP=l(e=>{e.__prepend=e.prepend,e.prepend=function(...t){t.forEach(r=>{typeof r=="string"&&(r=this.ownerDocument.createTextNode(r));let a=(r["s-sn"]=ei(r))||"",n=Jr(this,"childNodes"),o=Js(n,this.tagName,a)[0];if(o){Iu(r,o,!0);let s=S0(o,a)[0],i=Jr(s,"parentNode"),c=Jr(i,"insertBefore")(r,Jr(s,"nextSibling"));return Fl(o),c}return r.nodeType===1&&r.getAttribute("slot")&&(r.hidden=!0),e.__prepend(r)})}},"patchSlotPrepend"),GP=l(e=>{e.__append=e.append,e.append=function(...t){t.forEach(r=>{typeof r=="string"&&(r=this.ownerDocument.createTextNode(r)),this.appendChild(r)})}},"patchSlotAppend"),YP=l(e=>{let t=e.insertAdjacentHTML;e.insertAdjacentHTML=function(r,a){if(r!=="afterbegin"&&r!=="beforeend")return t.call(this,r,a);let n=this.ownerDocument.createElement("_"),o;if(n.innerHTML=a,r==="afterbegin")for(;o=n.firstChild;)this.prepend(o);else if(r==="beforeend")for(;o=n.firstChild;)this.append(o)}},"patchSlotInsertAdjacentHTML"),QP=l(e=>{e.insertAdjacentText=function(t,r){this.insertAdjacentHTML(t,r)}},"patchSlotInsertAdjacentText"),XP=l(e=>{let t=e;t.__insertBefore||(t.__insertBefore=e.insertBefore,e.insertBefore=function(r,a){let{slotName:n,slotNode:o}=Cu(r,this),s=this.__childNodes?this.childNodes:Zl(this.childNodes);if(o){let c=!1;if(s.forEach(u=>{if(u===a||a===null){if(c=!0,a===null||n!==a["s-sn"]){this.appendChild(r);return}if(n===a["s-sn"]){Iu(r,o);let p=Jr(a,"parentNode");Jr(p,"insertBefore")(r,a),Fl(o)}return}}),c)return r}let i=a?.__parentNode;return i&&!this.isSameNode(i)?this.appendChild(r):this.__insertBefore(r,a)})},"patchInsertBefore"),JP=l(e=>{let t=e.insertAdjacentElement;e.insertAdjacentElement=function(r,a){return r!=="afterbegin"&&r!=="beforeend"?t.call(this,r,a):r==="afterbegin"?(this.prepend(a),a):(r==="beforeend"&&this.append(a),a)}},"patchSlotInsertAdjacentElement"),eO=l(e=>{Za("textContent",e),Object.defineProperty(e,"textContent",{get:l(function(){let t="";return(this.__childNodes?this.childNodes:Zl(this.childNodes)).forEach(r=>t+=r.textContent||""),t},"get"),set:l(function(t){(this.__childNodes?this.childNodes:Zl(this.childNodes)).forEach(r=>{r["s-ol"]&&r["s-ol"].remove(),r.remove()}),this.insertAdjacentHTML("beforeend",t)},"set")})},"patchTextContent"),tO=l(e=>{let t=class extends Array{static{l(this,"FakeNodeList")}item(r){return this[r]}};Za("children",e),Object.defineProperty(e,"children",{get(){return this.childNodes.filter(r=>r.nodeType===1)}}),Object.defineProperty(e,"childElementCount",{get(){return this.children.length}}),Za("firstChild",e),Object.defineProperty(e,"firstChild",{get(){return this.childNodes[0]}}),Za("lastChild",e),Object.defineProperty(e,"lastChild",{get(){return this.childNodes[this.childNodes.length-1]}}),Za("childNodes",e),Object.defineProperty(e,"childNodes",{get(){let r=new t;return r.push(...Zl(this.__childNodes)),r}})},"patchChildSlotNodes"),rO=l(e=>{!e||e.__nextSibling!==void 0||!globalThis.Node||(aO(e),oO(e),Lx(e),e.nodeType===Node.ELEMENT_NODE&&(nO(e),sO(e)))},"patchSlottedNode"),aO=l(e=>{!e||e.__nextSibling||(Za("nextSibling",e),Object.defineProperty(e,"nextSibling",{get:l(function(){var t;let r=(t=this["s-ol"])==null?void 0:t.parentNode.childNodes,a=r?.indexOf(this);return r&&a>-1?r[a+1]:this.__nextSibling},"get")}))},"patchNextSibling"),nO=l(e=>{!e||e.__nextElementSibling||(Za("nextElementSibling",e),Object.defineProperty(e,"nextElementSibling",{get:l(function(){var t;let r=(t=this["s-ol"])==null?void 0:t.parentNode.children,a=r?.indexOf(this);return r&&a>-1?r[a+1]:this.__nextElementSibling},"get")}))},"patchNextElementSibling"),oO=l(e=>{!e||e.__previousSibling||(Za("previousSibling",e),Object.defineProperty(e,"previousSibling",{get:l(function(){var t;let r=(t=this["s-ol"])==null?void 0:t.parentNode.childNodes,a=r?.indexOf(this);return r&&a>-1?r[a-1]:this.__previousSibling},"get")}))},"patchPreviousSibling"),sO=l(e=>{!e||e.__previousElementSibling||(Za("previousElementSibling",e),Object.defineProperty(e,"previousElementSibling",{get:l(function(){var t;let r=(t=this["s-ol"])==null?void 0:t.parentNode.children,a=r?.indexOf(this);return r&&a>-1?r[a-1]:this.__previousElementSibling},"get")}))},"patchPreviousElementSibling"),Lx=l(e=>{!e||e.__parentNode||(Za("parentNode",e),Object.defineProperty(e,"parentNode",{get:l(function(){var t;return((t=this["s-ol"])==null?void 0:t.parentNode)||this.__parentNode},"get"),set:l(function(t){this.__parentNode=t},"set")}))},"patchParentNode"),iO=["children","nextElementSibling","previousElementSibling"],lO=["childNodes","firstChild","lastChild","nextSibling","previousSibling","textContent","parentNode"];function Za(e,t){let r;iO.includes(e)?r=Object.getOwnPropertyDescriptor(Element.prototype,e):lO.includes(e)&&(r=Object.getOwnPropertyDescriptor(Node.prototype,e)),r||(r=Object.getOwnPropertyDescriptor(t,e)),r&&Object.defineProperty(t,"__"+e,r)}l(Za,"patchHostOriginalAccessor");function Jr(e,t){if("__"+t in e){let r=e["__"+t];return typeof r!="function"?r:r.bind(e)}else return typeof e[t]!="function"?e[t]:e[t].bind(e)}l(Jr,"internalCall");var go=l((e,t="")=>()=>{},"createTime"),z=l((e,t,...r)=>{let a=null,n=null,o=null,s=!1,i=!1,c=[],u=l(h=>{for(let m=0;mh[m]).join(" "))}}if(typeof e=="function")return e(t===null?{}:t,c,dO);let p=Ys(e,null);return p.$attrs$=t,c.length>0&&(p.$children$=c),p.$key$=n,p.$name$=o,p},"h"),Ys=l((e,t)=>{let r={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return r.$attrs$=null,r.$key$=null,r.$name$=null,r},"newVNode"),ta={},cO=l(e=>e&&e.$tag$===ta,"isHost"),dO={forEach:l((e,t)=>e.map(n6).forEach(t),"forEach"),map:l((e,t)=>e.map(n6).map(t).map(uO),"map")},n6=l(e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),"convertToPublic"),uO=l(e=>{if(typeof e.vtag=="function"){let r={...e.vattrs};return e.vkey&&(r.key=e.vkey),e.vname&&(r.name=e.vname),z(e.vtag,r,...e.vchildren||[])}let t=Ys(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},"convertToPrivate"),hO=l((e,t,r,a)=>{var n;let o=go("hydrateClient",t),s=e.shadowRoot,i=[],c=[],u=[],p=s?[]:null,h=Ys(t,null);h.$elm$=e,Object.entries(((n=a.$cmpMeta$)==null?void 0:n.$members$)||{}).forEach(([R,[B,G]])=>{var j;if(!(B&31))return;let N=G||R,T=e.getAttribute(N);if(T!==null){let U=A0(T,B);(j=a?.$instanceValues$)==null||j.set(R,U)}});let m;{let R=a.$cmpMeta$;R&&R.$flags$&10&&e["s-sc"]?(m=e["s-sc"],e.classList.add(m+"-h")):e["s-sc"]&&delete e["s-sc"]}er.document&&(!Qt.$orgLocNodes$||!Qt.$orgLocNodes$.size)&&Um(er.document.body,Qt.$orgLocNodes$=new Map),e[zl]=r,e.removeAttribute(zl),a.$vnode$=Hm(h,i,c,p,e,e,r,u);let g=0,x=i.length,w;for(g;g{w.$elm$.appendChild(j.$elm$)})):w.$flags$|=1),B&&B.isConnected&&(s&&B["s-en"]===""&&B.parentNode.insertBefore(G,B.nextSibling),B.parentNode.removeChild(B),s||(G["s-oo"]=parseInt(w.$nodeId$))),Qt.$orgLocNodes$.delete(R)}let k=[],C=u.length,A=0,$,L,M,O;for(A;A{R.$elm$.parentElement.classList.add(m+"-s")}),s&&!s.childNodes.length){let R=0,B=p.length;if(B){for(R;R{typeof G["s-sn"]!="string"&&(G.nodeType===1&&G.slot&&G.hidden?G.removeAttribute("hidden"):(G.nodeType===8||G.nodeType===3&&!G.wholeText.trim())&&G.parentNode.removeChild(G))})}}Qt.$orgLocNodes$.delete(e["s-id"]),a.$hostElement$=e,o()},"initializeClientHydrate"),Hm=l((e,t,r,a,n,o,s,i=[])=>{let c,u,p,h,m=n["s-sc"];if(o.nodeType===1){if(c=o.getAttribute(J8),c&&(u=c.split("."),u[0]===s||u[0]==="0")){p=o6({$flags$:0,$hostId$:u[0],$nodeId$:u[1],$depth$:u[2],$index$:u[3],$tag$:o.tagName.toLowerCase(),$elm$:o,$attrs$:{class:o.className||""}}),t.push(p),o.removeAttribute(J8),e.$children$||(e.$children$=[]),m&&(o["s-si"]=m,p.$attrs$.class+=" "+m);let x=p.$elm$.getAttribute("s-sn");typeof x=="string"&&(p.$tag$==="slot-fb"&&(Vm(x,u[2],p,o,e,t,r,a,i),m&&o.classList.add(m)),p.$elm$["s-sn"]=x,p.$elm$.removeAttribute("s-sn")),p.$index$!==void 0&&(e.$children$[p.$index$]=p),e=p,a&&p.$depth$==="0"&&(a[p.$index$]=p.$elm$)}if(o.shadowRoot)for(h=o.shadowRoot.childNodes.length-1;h>=0;h--)Hm(e,t,r,a,n,o.shadowRoot.childNodes[h],s,i);let g=o.__childNodes||o.childNodes;for(h=g.length-1;h>=0;h--)Hm(e,t,r,a,n,g[h],s,i)}else if(o.nodeType===8){if(u=o.nodeValue.split("."),u[1]===s||u[1]==="0"){if(c=u[0],p=o6({$hostId$:u[1],$nodeId$:u[2],$depth$:u[3],$index$:u[4]||"0",$elm$:o,$attrs$:null,$children$:null,$key$:null,$name$:null,$tag$:null,$text$:null}),c===$P)p.$elm$=i6(o,3),p.$elm$&&p.$elm$.nodeType===3&&(p.$text$=p.$elm$.textContent,t.push(p),o.remove(),s===p.$hostId$&&(e.$children$||(e.$children$=[]),e.$children$[p.$index$]=p),a&&p.$depth$==="0"&&(a[p.$index$]=p.$elm$));else if(c===PP)p.$elm$=i6(o,8),p.$elm$&&p.$elm$.nodeType===8&&(t.push(p),o.remove());else if(p.$hostId$===s)if(c===EP){let g=o["s-sn"]=u[5]||"";Vm(g,u[2],p,o,e,t,r,a,i)}else c===AP&&(a?o.remove():(n["s-cr"]=o,o["s-cn"]=!0))}}else if(e&&e.$tag$==="style"){let g=Ys(null,o.textContent);g.$elm$=o,g.$index$="0",e.$children$=[g]}else o.nodeType===3&&!o.wholeText.trim()&&o.remove();return e},"clientHydrate"),Um=l((e,t)=>{if(e.nodeType===1){let r=e[zl]||e.getAttribute(zl);r&&t.set(r,e);let a=0;if(e.shadowRoot)for(;a({$flags$:0,$hostId$:null,$nodeId$:null,$depth$:null,$index$:"0",$elm$:null,$attrs$:null,$children$:null,$key$:null,$name$:null,$tag$:null,$text$:null,...e}),"createSimpleVNode");function Vm(e,t,r,a,n,o,s,i,c){a["s-sr"]=!0,r.$name$=e||null,r.$tag$="slot";let u=n?.$elm$?n.$elm$["s-id"]||n.$elm$.getAttribute("s-id"):"";if(i&&er.document){let p=r.$elm$=er.document.createElement(r.$tag$);r.$name$&&r.$elm$.setAttribute("name",e),u&&u!==r.$hostId$?n.$elm$.insertBefore(p,n.$elm$.children[0]):a.parentNode.insertBefore(r.$elm$,a),s6(c,t,e,a,r.$hostId$),a.remove(),r.$depth$==="0"&&(i[r.$index$]=r.$elm$)}else{let p=r.$elm$,h=u&&u!==r.$hostId$&&n.$elm$.shadowRoot;s6(c,t,e,a,h?u:r.$hostId$),I0(a),h&&n.$elm$.insertBefore(p,n.$elm$.children[0]),o.push(r)}s.push(r),n.$children$||(n.$children$=[]),n.$children$[r.$index$]=r}l(Vm,"addSlot");var s6=l((e,t,r,a,n)=>{let o=a.nextSibling;for(e[t]=e[t]||[];o&&((o.getAttribute&&o.getAttribute("slot")||o["s-sn"])===r||r===""&&!o["s-sn"]&&(o.nodeType===8&&o.nodeValue.indexOf(".")!==1||o.nodeType===3));)o["s-sn"]=r,e[t].push({slot:a,node:o,hostId:n}),o=o.nextSibling},"addSlottedNodes"),i6=l((e,t)=>{let r=e;do r=r.nextSibling;while(r&&(r.nodeType!==t||!r.nodeValue));return r},"findCorrespondingNode"),C0=l(e=>{let t=ZP(e);return new RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${t}))(${t}\\b)`,"g")},"createSupportsRuleRe");C0("::slotted");C0(":host");C0(":host-context");var A0=l((e,t)=>{if(typeof e=="string"&&(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")))try{return e=JSON.parse(e),e}catch{}return typeof e=="string"&&e.startsWith(zm)?(e=Rx(e),e):e!=null&&!k0(e)?t&4?e==="false"?!1:e===""||!!e:t&2?typeof e=="string"?parseFloat(e):typeof e=="number"?e:NaN:t&1?String(e):e:e},"parsePropertyValue"),Mx=l(e=>e,"getElement"),Yt=l((e,t,r)=>{let a=Mx(e);return{emit:l(n=>Nx(a,t,{bubbles:!0,composed:!0,cancelable:!0,detail:n}),"emit")}},"createEvent"),Nx=l((e,t,r)=>{let a=Qt.ce(t,r);return e.dispatchEvent(a),a},"emitEvent"),Ws=new WeakMap,Dx=l((e,t,r)=>{let a=iu.get(e);Tx&&r?(a=a||new CSSStyleSheet,typeof a=="string"?a=t:a.replaceSync(t)):a=t,iu.set(e,a)},"registerStyle"),zx=l((e,t,r)=>{var a;let n=T0(t),o=iu.get(n);if(!er.document)return n;if(e=e.nodeType===11?e:er.document,o)if(typeof o=="string"){e=e.head||e;let s=Ws.get(e),i;if(s||Ws.set(e,s=new Set),!s.has(n)){if(e.host&&(i=e.querySelector(`[${lu}="${n}"]`)))i.innerHTML=o;else{i=document.querySelector(`[${lu}="${n}"]`)||er.document.createElement("style"),i.innerHTML=o;let c=(a=Qt.$nonce$)!=null?a:$x(er.document);if(c!=null&&i.setAttribute("nonce",c),!(t.$flags$&1))if(e.nodeName==="HEAD"){let u=e.querySelectorAll("link[rel=preconnect]"),p=u.length>0?u[u.length-1].nextSibling:e.querySelector("style");e.insertBefore(i,p?.parentNode===e?p:null)}else if("host"in e)if(Tx){let u=new CSSStyleSheet;u.replaceSync(o),e.adoptedStyleSheets=[u,...e.adoptedStyleSheets]}else{let u=e.querySelector("style");u?u.innerHTML=o+u.innerHTML:e.prepend(i)}else e.append(i);t.$flags$&1&&e.insertBefore(i,null)}t.$flags$&4&&(i.innerHTML+=OP),s&&s.add(n)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return n},"addStyle"),pO=l(e=>{let t=e.$cmpMeta$,r=e.$hostElement$,a=t.$flags$,n=go("attachStyles",t.$tagName$),o=zx(r.shadowRoot?r.shadowRoot:r.getRootNode(),t);a&10&&(r["s-sc"]=o,r.classList.add(o+"-h")),n()},"attachStyles"),T0=l((e,t)=>"sc-"+e.$tagName$,"getScopeId"),fO=l(e=>e.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g,"$1{"),"convertScopedToShadow"),mO=l(()=>{if(!er.document)return;let e=er.document.querySelectorAll(`[${lu}]`),t=0;for(;t{if(r===a)return;let i=X8(e,t),c=t.toLowerCase();if(t==="class"){let u=e.classList,p=c6(r),h=c6(a);e["s-si"]&&s?(h.push(e["s-si"]),p.forEach(m=>{m.startsWith(e["s-si"])&&h.push(m)}),h=[...new Set(h)],u.add(...h)):(u.remove(...p.filter(m=>m&&!h.includes(m))),u.add(...h.filter(m=>m&&!p.includes(m))))}else if(t==="style"){for(let u in r)(!a||a[u]==null)&&(u.includes("-")?e.style.removeProperty(u):e.style[u]="");for(let u in a)(!r||a[u]!==r[u])&&(u.includes("-")?e.style.setProperty(u,a[u]):e.style[u]=a[u])}else if(t!=="key")if(t==="ref")a&&a(e);else if(!e.__lookupSetter__(t)&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"?t=t.slice(3):X8(er,c)?t=c.slice(2):t=c[2]+t.slice(3),r||a){let u=t.endsWith(Zx);t=t.replace(yO,""),r&&Qt.rel(e,t,r,u),a&&Qt.ael(e,t,a,u)}}else{let u=k0(a);if((i||u&&a!==null)&&!n)try{if(e.tagName.includes("-"))e[t]!==a&&(e[t]=a);else{let h=a??"";t==="list"?i=!1:(r==null||e[t]!=h)&&(typeof e.__lookupSetter__(t)=="function"?e[t]=h:e.setAttribute(t,h))}}catch{}let p=!1;c!==(c=c.replace(/^xlink\:?/,""))&&(t=c,p=!0),a==null||a===!1?(a!==!1||e.getAttribute(t)==="")&&(p?e.removeAttributeNS(e6,t):e.removeAttribute(t)):(!i||o&4||n)&&!u&&e.nodeType===1&&(a=a===!0?"":a,p?e.setAttributeNS(e6,t,a):e.setAttribute(t,a))}},"setAccessor"),gO=/\s/,c6=l(e=>(typeof e=="object"&&e&&"baseVal"in e&&(e=e.baseVal),!e||typeof e!="string"?[]:e.split(gO)),"parseClassList"),Zx="Capture",yO=new RegExp(Zx+"$"),Fm=l((e,t,r,a)=>{let n=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,o=e&&e.$attrs$||{},s=t.$attrs$||{};for(let i of Wm(Object.keys(o)))i in s||l6(n,i,o[i],void 0,r,t.$flags$,a);for(let i of Wm(Object.keys(s)))l6(n,i,o[i],s[i],r,t.$flags$,a)},"updateElement");function Wm(e){return e.includes("ref")?[...e.filter(t=>t!=="ref"),"ref"]:e}l(Wm,"sortedAttrNames");var Jd,cu,Fo,du=!1,uu=!1,Au=!1,oa=!1,hu=l((e,t,r)=>{var a;let n=t.$children$[r],o=0,s,i,c;if(du||(Au=!0,n.$tag$==="slot"&&(n.$flags$|=n.$children$?2:1)),n.$text$!==null)s=n.$elm$=er.document.createTextNode(n.$text$);else if(n.$flags$&1)s=n.$elm$=er.document.createTextNode(""),Fm(null,n,oa);else{if(oa||(oa=n.$tag$==="svg"),!er.document)throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.");if(s=n.$elm$=er.document.createElementNS(oa?SP:IP,!du&&Yo.slotRelocation&&n.$flags$&2?"slot-fb":n.$tag$),oa&&n.$tag$==="foreignObject"&&(oa=!1),Fm(null,n,oa),zP(Jd)&&s["s-si"]!==Jd&&s.classList.add(s["s-si"]=Jd),n.$children$)for(o=0;o{Qt.$flags$|=1;let t=e.closest(Fo.toLowerCase());if(t!=null){let r=Array.from(t.__childNodes||t.childNodes).find(n=>n["s-cr"]),a=Array.from(e.__childNodes||e.childNodes);for(let n of r?a.reverse():a)n["s-sh"]!=null&&(Dn(t,n,r??null),n["s-sh"]=void 0,Au=!0)}Qt.$flags$&=-2},"relocateToHostRoot"),pu=l((e,t)=>{Qt.$flags$|=1;let r=Array.from(e.__childNodes||e.childNodes);if(e["s-sr"]&&Yo.experimentalSlotFixes){let a=e;for(;a=a.nextSibling;)a&&a["s-sn"]===e["s-sn"]&&a["s-sh"]===Fo&&r.push(a)}for(let a=r.length-1;a>=0;a--){let n=r[a];n["s-hn"]!==Fo&&n["s-ol"]&&(Dn(jl(n).parentNode,n,jl(n)),n["s-ol"].remove(),n["s-ol"]=void 0,n["s-sh"]=void 0,Au=!0),t&&pu(n,t)}Qt.$flags$&=-2},"putBackInOriginalLocation"),Bx=l((e,t,r,a,n,o)=>{let s=e["s-cr"]&&e["s-cr"].parentNode||e,i;for(s.shadowRoot&&s.tagName===Fo&&(s=s.shadowRoot);n<=o;++n)a[n]&&(i=hu(null,r,n),i&&(a[n].$elm$=i,Dn(s,i,jl(t))))},"addVnodes"),Hx=l((e,t,r)=>{for(let a=t;a<=r;++a){let n=e[a];if(n){let o=n.$elm$;Vx(n),o&&(uu=!0,o["s-ol"]?o["s-ol"].remove():pu(o,!0),o.remove())}}},"removeVnodes"),bO=l((e,t,r,a,n=!1)=>{let o=0,s=0,i=0,c=0,u=t.length-1,p=t[0],h=t[u],m=a.length-1,g=a[0],x=a[m],w,k;for(;o<=u&&s<=m;)if(p==null)p=t[++o];else if(h==null)h=t[--u];else if(g==null)g=a[++s];else if(x==null)x=a[--m];else if(Fd(p,g,n))Hs(p,g,n),p=t[++o],g=a[++s];else if(Fd(h,x,n))Hs(h,x,n),h=t[--u],x=a[--m];else if(Fd(p,x,n))(p.$tag$==="slot"||x.$tag$==="slot")&&pu(p.$elm$.parentNode,!1),Hs(p,x,n),Dn(e,p.$elm$,h.$elm$.nextSibling),p=t[++o],x=a[--m];else if(Fd(h,g,n))(p.$tag$==="slot"||x.$tag$==="slot")&&pu(h.$elm$.parentNode,!1),Hs(h,g,n),Dn(e,h.$elm$,p.$elm$),h=t[--u],g=a[++s];else{for(i=-1,c=o;c<=u;++c)if(t[c]&&t[c].$key$!==null&&t[c].$key$===g.$key$){i=c;break}i>=0?(k=t[i],k.$tag$!==g.$tag$?w=hu(t&&t[s],r,i):(Hs(k,g,n),t[i]=void 0,w=k.$elm$),g=a[++s]):(w=hu(t&&t[s],r,s),g=a[++s]),w&&Dn(jl(p.$elm$).parentNode,w,jl(p.$elm$))}o>u?Bx(e,a[m+1]==null?null:a[m+1].$elm$,r,a,s,m):s>m&&Hx(t,o,u)},"updateChildren"),Fd=l((e,t,r=!1)=>e.$tag$===t.$tag$?e.$tag$==="slot"?e.$name$===t.$name$:r?(r&&!e.$key$&&t.$key$&&(e.$key$=t.$key$),!0):e.$key$===t.$key$:!1,"isSameVnode"),jl=l(e=>e&&e["s-ol"]||e,"referenceNode"),Hs=l((e,t,r=!1)=>{let a=t.$elm$=e.$elm$,n=e.$children$,o=t.$children$,s=t.$tag$,i=t.$text$,c;i===null?(oa=s==="svg"?!0:s==="foreignObject"?!1:oa,s==="slot"&&!du&&e.$name$!==t.$name$&&(t.$elm$["s-sn"]=t.$name$||"",jx(t.$elm$.parentElement)),Fm(e,t,oa,r),n!==null&&o!==null?bO(a,n,t,o,r):o!==null?(e.$text$!==null&&(a.textContent=""),Bx(a,null,t,o,0,o.length-1)):!r&&Yo.updatable&&n!==null&&Hx(n,0,n.length-1),oa&&s==="svg"&&(oa=!1)):(c=a["s-cr"])?c.parentNode.textContent=i:e.$text$!==i&&(a.data=i)},"patch"),Nn=[],Ux=l(e=>{let t,r,a,n=e.__childNodes||e.childNodes;for(let o of n){if(o["s-sr"]&&(t=o["s-cr"])&&t.parentNode){r=t.parentNode.__childNodes||t.parentNode.childNodes;let s=o["s-sn"];for(a=r.length-1;a>=0;a--)if(t=r[a],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==o["s-hn"]&&(!t["s-sh"]||t["s-sh"]!==o["s-hn"]))if(a6(t,s)){let i=Nn.find(c=>c.$nodeToRelocate$===t);uu=!0,t["s-sn"]=t["s-sn"]||s,i?(i.$nodeToRelocate$["s-sh"]=o["s-hn"],i.$slotRefNode$=o):(t["s-sh"]=o["s-hn"],Nn.push({$slotRefNode$:o,$nodeToRelocate$:t})),t["s-sr"]&&Nn.map(c=>{a6(c.$nodeToRelocate$,t["s-sn"])&&(i=Nn.find(u=>u.$nodeToRelocate$===t),i&&!c.$slotRefNode$&&(c.$slotRefNode$=i.$slotRefNode$))})}else Nn.some(i=>i.$nodeToRelocate$===t)||Nn.push({$nodeToRelocate$:t})}o.nodeType===1&&Ux(o)}},"markSlotContentForRelocation"),Vx=l(e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(Vx)},"nullifyVNodeRefs"),Dn=l((e,t,r)=>{if(typeof t["s-sn"]=="string"&&t["s-sr"]&&t["s-cr"])E0(t["s-cr"],t,e,t.parentElement);else if(typeof t["s-sn"]=="string"){e.getRootNode().nodeType!==11&&Lx(t),e.insertBefore(t,r);let{slotNode:a}=Cu(t);return a&&Fl(a),t}return e.__insertBefore?e.__insertBefore(t,r):e?.insertBefore(t,r)},"insertBefore");function E0(e,t,r,a){var n,o;let s;if(e&&typeof t["s-sn"]=="string"&&t["s-sr"]&&e.parentNode&&e.parentNode["s-sc"]&&(s=t["s-si"]||e.parentNode["s-sc"])){let i=t["s-sn"],c=t["s-hn"];if((n=r.classList)==null||n.add(s+"-s"),a&&(o=a.classList)!=null&&o.contains(s+"-s")){let u=(a.__childNodes||a.childNodes)[0],p=!1;for(;u;){if(u["s-sn"]!==i&&u["s-hn"]===c&&u["s-sr"]){p=!0;break}u=u.nextSibling}p||a.classList.remove(s+"-s")}}}l(E0,"addRemoveSlotScopedClass");var vO=l((e,t,r=!1)=>{var a,n,o,s,i;let c=e.$hostElement$,u=e.$cmpMeta$,p=e.$vnode$||Ys(null,null),h=cO(t)?t:z(null,null,t);if(Fo=c.tagName,u.$attrsToReflect$&&(h.$attrs$=h.$attrs$||{},u.$attrsToReflect$.map(([m,g])=>h.$attrs$[g]=c[m])),r&&h.$attrs$)for(let m of Object.keys(h.$attrs$))c.hasAttribute(m)&&!["key","ref","style","class"].includes(m)&&(h.$attrs$[m]=c[m]);h.$tag$=null,h.$flags$|=4,e.$vnode$=h,h.$elm$=p.$elm$=c.shadowRoot||c,Jd=c["s-sc"],du=!!(u.$flags$&1)&&!(u.$flags$&128),cu=c["s-cr"],uu=!1,Hs(p,h,r);{if(Qt.$flags$|=1,Au){Ux(h.$elm$);for(let m of Nn){let g=m.$nodeToRelocate$;if(!g["s-ol"]&&er.document){let x=er.document.createTextNode("");x["s-nr"]=g,Dn(g.parentNode,g["s-ol"]=x,g)}}for(let m of Nn){let g=m.$nodeToRelocate$,x=m.$slotRefNode$;if(x){let w=x.parentNode,k=x.nextSibling;if(k&&k.nodeType===1){let $=(a=g["s-ol"])==null?void 0:a.previousSibling;for(;$;){let L=(n=$["s-nr"])!=null?n:null;if(L&&L["s-sn"]===g["s-sn"]&&w===(L.__parentNode||L.parentNode)){for(L=L.nextSibling;L===g||L?.["s-sr"];)L=L?.nextSibling;if(!L||!L["s-nr"]){k=L;break}}$=$.previousSibling}}let C=g.__parentNode||g.parentNode,A=g.__nextSibling||g.nextSibling;(!k&&w!==C||A!==k)&&g!==k&&(Dn(w,g,k),g.nodeType===1&&g.tagName!=="SLOT-FB"&&(g.hidden=(o=g["s-ih"])!=null?o:!1)),g&&typeof x["s-rf"]=="function"&&x["s-rf"](x)}else g.nodeType===1&&(r&&(g["s-ih"]=(s=g.hidden)!=null?s:!1),g.hidden=!0)}}uu&&Su(h.$elm$),Qt.$flags$&=-2,Nn.length=0}if(u.$flags$&2){let m=h.$elm$.__childNodes||h.$elm$.childNodes;for(let g of m)g["s-hn"]!==Fo&&!g["s-sh"]&&(r&&g["s-ih"]==null&&(g["s-ih"]=(i=g.hidden)!=null?i:!1),g.hidden=!0)}cu=void 0},"renderVdom"),Fx=l((e,t)=>{if(t&&!e.$onRenderResolve$&&t["s-p"]){let r=t["s-p"].push(new Promise(a=>e.$onRenderResolve$=()=>{t["s-p"].splice(r-1,1),a()}))}},"attachToAncestor"),Tu=l((e,t)=>{if(e.$flags$|=16,e.$flags$&4){e.$flags$|=512;return}return Fx(e,e.$ancestorComponent$),DP(l(()=>wO(e,t),"dispatch"))},"scheduleUpdate"),wO=l((e,t)=>{let r=e.$hostElement$,a=go("scheduleUpdate",e.$cmpMeta$.$tagName$),n=r;if(!n)throw new Error(`Can't render component <${r.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let o;return t?o=Gs(n,"componentWillLoad",void 0,r):o=Gs(n,"componentWillUpdate",void 0,r),o=d6(o,()=>Gs(n,"componentWillRender",void 0,r)),a(),d6(o,()=>_O(e,n,t))},"dispatchHooks"),d6=l((e,t)=>xO(e)?e.then(t).catch(r=>{console.error(r),t()}):t(),"enqueue"),xO=l(e=>e instanceof Promise||e&&e.then&&typeof e.then=="function","isPromisey"),_O=l(async(e,t,r)=>{var a;let n=e.$hostElement$,o=go("update",e.$cmpMeta$.$tagName$),s=n["s-rc"];r&&pO(e);let i=go("render",e.$cmpMeta$.$tagName$);kO(e,t,n,r),s&&(s.map(c=>c()),n["s-rc"]=void 0),i(),o();{let c=(a=n["s-p"])!=null?a:[],u=l(()=>SO(e),"postUpdate");c.length===0?u():(Promise.all(c).then(u),e.$flags$|=4,c.length=0)}},"updateComponent"),qm=null,kO=l((e,t,r,a)=>{try{qm=t,t=t.render(),e.$flags$&=-17,e.$flags$|=2,vO(e,t,a)}catch(n){Vl(n,e.$hostElement$)}return qm=null,null},"callRender"),u6=l(()=>qm,"getRenderingRef"),SO=l(e=>{let t=e.$cmpMeta$.$tagName$,r=e.$hostElement$,a=go("postUpdate",t),n=r,o=e.$ancestorComponent$;Gs(n,"componentDidRender",void 0,r),e.$flags$&64?(Gs(n,"componentDidUpdate",void 0,r),a()):(e.$flags$|=64,CO(r),Gs(n,"componentDidLoad",void 0,r),a(),e.$onReadyResolve$(r),o||IO()),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),e.$flags$&512&&ku(()=>Tu(e,!1)),e.$flags$&=-517},"postUpdateComponent"),h6=l(e=>{{let t=mo(e),r=t.$hostElement$.isConnected;return r&&(t.$flags$&18)===2&&Tu(t,!1),r}},"forceUpdate"),IO=l(e=>{ku(()=>Nx(er,"appload",{detail:{namespace:xP}}))},"appDidLoad"),Gs=l((e,t,r,a)=>{if(e&&e[t])try{return e[t](r)}catch(n){Vl(n,a)}},"safeCall"),CO=l(e=>{var t;return e.classList.add((t=Yo.hydratedSelectorName)!=null?t:"hydrated")},"addHydratedFlag"),AO=l((e,t)=>mo(e).$instanceValues$.get(t),"getValue"),p6=l((e,t,r,a)=>{let n=mo(e),o=e,s=n.$instanceValues$.get(t),i=n.$flags$,c=o;r=A0(r,a.$members$[t][0]);let u=Number.isNaN(s)&&Number.isNaN(r);if(r!==s&&!u){n.$instanceValues$.set(t,r);{if(a.$watchers$&&i&128){let p=a.$watchers$[t];p&&p.map(h=>{try{c[h](r,s,t)}catch(m){Vl(m,o)}})}if((i&18)===2){if(c.componentShouldUpdate&&c.componentShouldUpdate(r,s,t)===!1)return;Tu(n,!1)}}}},"setValue"),TO=l((e,t,r)=>{var a,n;let o=e.prototype;if(t.$members$||t.$watchers$||e.watchers){e.watchers&&!t.$watchers$&&(t.$watchers$=e.watchers);let s=Object.entries((a=t.$members$)!=null?a:{});s.map(([i,[c]])=>{if(c&31||c&32){let{get:u,set:p}=Object.getOwnPropertyDescriptor(o,i)||{};u&&(t.$members$[i][0]|=2048),p&&(t.$members$[i][0]|=4096),Object.defineProperty(o,i,{get(){return u?u.apply(this):AO(this,i)},configurable:!0,enumerable:!0}),Object.defineProperty(o,i,{set(h){let m=mo(this);if(p){let g=c&32?this[i]:m.$hostElement$[i];typeof g>"u"&&m.$instanceValues$.get(i)?h=m.$instanceValues$.get(i):!m.$instanceValues$.get(i)&&g&&m.$instanceValues$.set(i,g),p.apply(this,[A0(h,c)]),h=c&32?this[i]:m.$hostElement$[i],p6(this,i,h,t);return}{p6(this,i,h,t);return}}})}});{let i=new Map;o.attributeChangedCallback=function(c,u,p){Qt.jmp(()=>{var h;let m=i.get(c);if(!(this.hasOwnProperty(m)&&Yo.lazyLoad)){if(o.hasOwnProperty(m)&&typeof this[m]=="number"&&this[m]==p)return;if(m==null){let x=mo(this),w=x?.$flags$;if(w&&!(w&8)&&w&128&&p!==u){let k=this;((h=t.$watchers$)==null?void 0:h[c])?.forEach(A=>{k[A]!=null&&k[A].call(k,p,u,c)})}return}}let g=Object.getOwnPropertyDescriptor(o,m);p=p===null&&typeof this[m]=="boolean"?!1:p,p!==this[m]&&(!g.get||g.set)&&(this[m]=p)})},e.observedAttributes=Array.from(new Set([...Object.keys((n=t.$watchers$)!=null?n:{}),...s.filter(([c,u])=>u[0]&15).map(([c,u])=>{var p;let h=u[1]||c;return i.set(h,c),u[0]&512&&((p=t.$attrsToReflect$)==null||p.push([c,h])),h})]))}}return e},"proxyComponent"),f6=l(async(e,t,r,a)=>{let n;if((t.$flags$&32)===0){t.$flags$|=32;{n=e.constructor;let i=e.localName;customElements.whenDefined(i).then(()=>t.$flags$|=128)}if(n&&n.style){let i;typeof n.style=="string"&&(i=n.style);let c=T0(r);if(!iu.has(c)){let u=go("registerStyles",r.$tagName$);Dx(c,i,!!(r.$flags$&1)),u()}}}let o=t.$ancestorComponent$,s=l(()=>Tu(t,!0),"schedule");o&&o["s-rc"]?o["s-rc"].push(s):s()},"initializeComponent"),EO=l((e,t)=>{},"fireConnectedCallback"),$O=l(e=>{if((Qt.$flags$&1)===0){let t=mo(e),r=t.$cmpMeta$,a=go("connectedCallback",r.$tagName$);if(t.$flags$&1)Wx(e,t,r.$listeners$),t?.$lazyInstance$||t?.$onReadyPromise$&&t.$onReadyPromise$.then(()=>EO());else{t.$flags$|=1;let n;if(n=e.getAttribute(zl),n){if(r.$flags$&1){let o=zx(e.shadowRoot,r);e.classList.remove(o+"-h",o+"-s")}else if(r.$flags$&2){let o=T0(r);e["s-sc"]=o}hO(e,r.$tagName$,n,t)}n||r.$flags$&12&&PO(e);{let o=e;for(;o=o.parentNode||o.host;)if(o.nodeType===1&&o.hasAttribute("s-id")&&o["s-p"]||o["s-p"]){Fx(t,t.$ancestorComponent$=o);break}}r.$members$&&Object.entries(r.$members$).map(([o,[s]])=>{if(s&31&&e.hasOwnProperty(o)){let i=e[o];delete e[o],e[o]=i}}),Yo.initializeNextTick?ku(()=>f6(e,t,r)):f6(e,t,r)}a()}},"connectedCallback"),PO=l(e=>{if(!er.document)return;let t=e["s-cr"]=er.document.createComment("");t["s-cn"]=!0,Dn(e,t,e.firstChild)},"setContentReference"),OO=l(async e=>{if((Qt.$flags$&1)===0){let t=mo(e);t.$rmListeners$&&(t.$rmListeners$.map(r=>r()),t.$rmListeners$=void 0)}Ws.has(e)&&Ws.delete(e),e.shadowRoot&&Ws.has(e.shadowRoot)&&Ws.delete(e.shadowRoot)},"disconnectedCallback"),Jt=l((e,t)=>{let r={$flags$:t[0],$tagName$:t[1]};r.$members$=t[2],r.$listeners$=t[3],r.$watchers$=e.$watchers$,r.$attrsToReflect$=[],r.$flags$&2&&VP(e.prototype),mO();let a=e.prototype.connectedCallback,n=e.prototype.disconnectedCallback;return Object.assign(e.prototype,{__hasHostListenerAttached:!1,__registerHost(){CP(this,r)},connectedCallback(){if(!this.__hasHostListenerAttached){let o=mo(this);Wx(this,o,r.$listeners$),this.__hasHostListenerAttached=!0}$O(this),a&&a.call(this)},disconnectedCallback(){OO(this),n&&n.call(this)},__attachShadow(){if(!this.shadowRoot)this.attachShadow({mode:"open"});else if(this.shadowRoot.mode!=="open")throw new Error(`Unable to re-use existing shadow root for ${r.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}}),e.is=r.$tagName$,TO(e,r)},"proxyCustomElement"),po=l((e,t)=>t,"Fragment"),Wx=l((e,t,r,a)=>{r&&er.document&&r.map(([n,o,s])=>{let i=LO(er.document,e,n),c=RO(t,s),u=MO(n);Qt.ael(i,o,c,u),(t.$rmListeners$=t.$rmListeners$||[]).push(()=>Qt.rel(i,o,c,u))})},"addHostEventListeners"),RO=l((e,t)=>r=>{try{e.$hostElement$[t](r)}catch(a){Vl(a,e.$hostElement$)}},"hostListenerProxy"),LO=l((e,t,r)=>r&4?e:r&16?e.body:t,"getHostListenerTarget"),MO=l(e=>LP?{passive:(e&1)!==0,capture:(e&2)!==0}:(e&2)!==0,"hostListenerOpts"),NO=Object.create,qx=Object.defineProperty,DO=Object.getOwnPropertyDescriptor,zO=Object.getOwnPropertyNames,ZO=Object.getPrototypeOf,jO=Object.prototype.hasOwnProperty,Qo=l((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),"A"),BO=l((e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of zO(t))!jO.call(e,n)&&n!==r&&qx(e,n,{get:l(()=>t[n],"get"),enumerable:!(a=DO(t,n))||a.enumerable});return e},"Dt"),$0=l((e,t,r)=>(r=e!=null?NO(ZO(e)):{},BO(qx(r,"default",{value:e,enumerable:!0}),e)),"Y"),Kx=Qo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isBytes=a,e.number=t,e.bool=r,e.bytes=n,e.hash=o,e.exists=s,e.output=i;function t(u){if(!Number.isSafeInteger(u)||u<0)throw new Error(`positive integer expected, not ${u}`)}l(t,"R");function r(u){if(typeof u!="boolean")throw new Error(`boolean expected, not ${u}`)}l(r,"me");function a(u){return u instanceof Uint8Array||u!=null&&typeof u=="object"&&u.constructor.name==="Uint8Array"}l(a,"ge");function n(u,...p){if(!a(u))throw new Error("Uint8Array expected");if(p.length>0&&!p.includes(u.length))throw new Error(`Uint8Array expected of length ${p}, not of length=${u.length}`)}l(n,"X");function o(u){if(typeof u!="function"||typeof u.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");t(u.outputLen),t(u.blockLen)}l(o,"ye");function s(u,p=!0){if(u.destroyed)throw new Error("Hash instance has been destroyed");if(p&&u.finished)throw new Error("Hash#digest() has already been called")}l(s,"Se");function i(u,p){n(u);let h=p.outputLen;if(u.length{Object.defineProperty(e,"__esModule",{value:!0}),e.add5L=e.add5H=e.add4H=e.add4L=e.add3H=e.add3L=e.rotlBL=e.rotlBH=e.rotlSL=e.rotlSH=e.rotr32L=e.rotr32H=e.rotrBL=e.rotrBH=e.rotrSL=e.rotrSH=e.shrSL=e.shrSH=e.toBig=void 0,e.fromBig=a,e.split=n,e.add=A;var t=BigInt(2**32-1),r=BigInt(32);function a(j,N=!1){return N?{h:Number(j&t),l:Number(j>>r&t)}:{h:Number(j>>r&t)|0,l:Number(j&t)|0}}l(a,"ee");function n(j,N=!1){let T=new Uint32Array(j.length),U=new Uint32Array(j.length);for(let ae=0;aeBigInt(j>>>0)<>>0),"Te");e.toBig=o;var s=l((j,N,T)=>j>>>T,"we");e.shrSH=s;var i=l((j,N,T)=>j<<32-T|N>>>T,"xe");e.shrSL=i;var c=l((j,N,T)=>j>>>T|N<<32-T,"Ae");e.rotrSH=c;var u=l((j,N,T)=>j<<32-T|N>>>T,"Oe");e.rotrSL=u;var p=l((j,N,T)=>j<<64-T|N>>>T-32,"Ee");e.rotrBH=p;var h=l((j,N,T)=>j>>>T-32|N<<64-T,"Pe");e.rotrBL=h;var m=l((j,N)=>N,"ve");e.rotr32H=m;var g=l((j,N)=>j,"Ce");e.rotr32L=g;var x=l((j,N,T)=>j<>>32-T,"_e");e.rotlSH=x;var w=l((j,N,T)=>N<>>32-T,"Ne");e.rotlSL=w;var k=l((j,N,T)=>N<>>64-T,"De");e.rotlBH=k;var C=l((j,N,T)=>j<>>64-T,"ke");e.rotlBL=C;function A(j,N,T,U){let ae=(N>>>0)+(U>>>0);return{h:j+T+(ae/2**32|0)|0,l:ae|0}}l(A,"Le");var $=l((j,N,T)=>(j>>>0)+(N>>>0)+(T>>>0),"Re");e.add3L=$;var L=l((j,N,T,U)=>N+T+U+(j/2**32|0)|0,"Me");e.add3H=L;var M=l((j,N,T,U)=>(j>>>0)+(N>>>0)+(T>>>0)+(U>>>0),"Be");e.add4L=M;var O=l((j,N,T,U,ae)=>N+T+U+ae+(j/2**32|0)|0,"Ue");e.add4H=O;var R=l((j,N,T,U,ae)=>(j>>>0)+(N>>>0)+(T>>>0)+(U>>>0)+(ae>>>0),"ze");e.add5L=R;var B=l((j,N,T,U,ae,oe)=>N+T+U+ae+oe+(j/2**32|0)|0,"He");e.add5H=B;var G={fromBig:a,split:n,toBig:o,shrSH:s,shrSL:i,rotrSH:c,rotrSL:u,rotrBH:p,rotrBL:h,rotr32H:m,rotr32L:g,rotlSH:x,rotlSL:w,rotlBH:k,rotlBL:C,add:A,add3L:$,add3H:L,add4L:M,add4H:O,add5H:B,add5L:R};e.default=G}),UO=Qo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=void 0,e.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0}),VO=Qo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.nextTick=e.byteSwapIfBE=e.byteSwap=e.isLE=e.rotl=e.rotr=e.createView=e.u32=e.u8=void 0,e.isBytes=a,e.byteSwap32=p,e.bytesToHex=m,e.hexToBytes=w,e.asyncLoop=C,e.utf8ToBytes=A,e.toBytes=$,e.concatBytes=L,e.checkOpts=R,e.wrapConstructor=B,e.wrapConstructorWithOpts=G,e.wrapXOFConstructorWithOpts=j,e.randomBytes=N;var t=UO(),r=Kx();function a(T){return T instanceof Uint8Array||T!=null&&typeof T=="object"&&T.constructor.name==="Uint8Array"}l(a,"Rt");var n=l(T=>new Uint8Array(T.buffer,T.byteOffset,T.byteLength),"Mt");e.u8=n;var o=l(T=>new Uint32Array(T.buffer,T.byteOffset,Math.floor(T.byteLength/4)),"Bt");e.u32=o;var s=l(T=>new DataView(T.buffer,T.byteOffset,T.byteLength),"Ut");e.createView=s;var i=l((T,U)=>T<<32-U|T>>>U,"zt");e.rotr=i;var c=l((T,U)=>T<>>32-U>>>0,"Ht");e.rotl=c,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;var u=l(T=>T<<24&4278190080|T<<8&16711680|T>>>8&65280|T>>>24&255,"Ft");e.byteSwap=u,e.byteSwapIfBE=e.isLE?T=>T:T=>(0,e.byteSwap)(T);function p(T){for(let U=0;UU.toString(16).padStart(2,"0"));function m(T){(0,r.bytes)(T);let U="";for(let ae=0;ae=g._0&&T<=g._9)return T-g._0;if(T>=g._A&&T<=g._F)return T-(g._A-10);if(T>=g._a&&T<=g._f)return T-(g._a-10)}l(x,"Ve");function w(T){if(typeof T!="string")throw new Error("hex string expected, got "+typeof T);let U=T.length,ae=U/2;if(U%2)throw new Error("padded hex string expected, got unpadded hex of length "+U);let oe=new Uint8Array(ae);for(let ue=0,ge=0;ue{},"Jt");e.nextTick=k;async function C(T,U,ae){let oe=Date.now();for(let ue=0;ue=0&&geT().update($(oe)).digest(),"e"),ae=T();return U.outputLen=ae.outputLen,U.blockLen=ae.blockLen,U.create=()=>T(),U}l(B,"Xt");function G(T){let U=l((oe,ue)=>T(ue).update($(oe)).digest(),"e"),ae=T({});return U.outputLen=ae.outputLen,U.blockLen=ae.blockLen,U.create=oe=>T(oe),U}l(G,"Qt");function j(T){let U=l((oe,ue)=>T(ue).update($(oe)).digest(),"e"),ae=T({});return U.outputLen=ae.outputLen,U.blockLen=ae.blockLen,U.create=oe=>T(oe),U}l(j,"Zt");function N(T=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(T));if(t.crypto&&typeof t.crypto.randomBytes=="function")return t.crypto.randomBytes(T);throw new Error("crypto.getRandomValues must be defined")}l(N,"en")}),FO=Qo(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shake256=e.shake128=e.keccak_512=e.keccak_384=e.keccak_256=e.keccak_224=e.sha3_512=e.sha3_384=e.sha3_256=e.sha3_224=e.Keccak=void 0,e.keccakP=C;var t=Kx(),r=HO(),a=VO(),n=[],o=[],s=[],i=BigInt(0),c=BigInt(1),u=BigInt(2),p=BigInt(7),h=BigInt(256),m=BigInt(113);for(let M=0,O=c,R=1,B=0;M<24;M++){[R,B]=[B,(2*R+3*B)%5],n.push(2*(5*B+R)),o.push((M+1)*(M+2)/2%64);let G=i;for(let j=0;j<7;j++)O=(O<>p)*m)%h,O&u&&(G^=c<<(c<R>32?(0,r.rotlBH)(M,O,R):(0,r.rotlSH)(M,O,R),"Je"),k=l((M,O,R)=>R>32?(0,r.rotlBL)(M,O,R):(0,r.rotlSL)(M,O,R),"Ke");function C(M,O=24){let R=new Uint32Array(10);for(let B=24-O;B<24;B++){for(let N=0;N<10;N++)R[N]=M[N]^M[N+10]^M[N+20]^M[N+30]^M[N+40];for(let N=0;N<10;N+=2){let T=(N+8)%10,U=(N+2)%10,ae=R[U],oe=R[U+1],ue=w(ae,oe,1)^R[T],ge=k(ae,oe,1)^R[T+1];for(let fe=0;fe<50;fe+=10)M[N+fe]^=ue,M[N+fe+1]^=ge}let G=M[2],j=M[3];for(let N=0;N<24;N++){let T=o[N],U=w(G,j,T),ae=k(G,j,T),oe=n[N];G=M[oe],j=M[oe+1],M[oe]=U,M[oe+1]=ae}for(let N=0;N<50;N+=10){for(let T=0;T<10;T++)R[T]=M[N+T];for(let T=0;T<10;T++)M[N+T]^=~R[(T+2)%10]&R[(T+4)%10]}M[0]^=g[B],M[1]^=x[B]}R.fill(0)}l(C,"Xe");var A=class Gx extends a.Hash{static{l(this,"t")}constructor(O,R,B,G=!1,j=24){if(super(),this.blockLen=O,this.suffix=R,this.outputLen=B,this.enableXOF=G,this.rounds=j,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,t.number)(B),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,a.u32)(this.state)}keccak(){a.isLE||(0,a.byteSwap32)(this.state32),C(this.state32,this.rounds),a.isLE||(0,a.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(O){(0,t.exists)(this);let{blockLen:R,state:B}=this;O=(0,a.toBytes)(O);let G=O.length;for(let j=0;j=B&&this.keccak();let N=Math.min(B-this.posOut,j-G);O.set(R.subarray(this.posOut,this.posOut+N),G),this.posOut+=N,G+=N}return O}xofInto(O){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(O)}xof(O){return(0,t.number)(O),this.xofInto(new Uint8Array(O))}digestInto(O){if((0,t.output)(O,this),this.finished)throw new Error("digest() was already called");return this.writeInto(O),this.destroy(),O}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(O){let{blockLen:R,suffix:B,outputLen:G,rounds:j,enableXOF:N}=this;return O||(O=new Gx(R,B,G,N,j)),O.state32.set(this.state32),O.pos=this.pos,O.posOut=this.posOut,O.finished=this.finished,O.rounds=j,O.suffix=B,O.outputLen=G,O.enableXOF=N,O.destroyed=this.destroyed,O}};e.Keccak=A;var $=l((M,O,R)=>(0,a.wrapConstructor)(()=>new A(O,M,R)),"T");e.sha3_224=$(6,144,224/8),e.sha3_256=$(6,136,256/8),e.sha3_384=$(6,104,384/8),e.sha3_512=$(6,72,512/8),e.keccak_224=$(1,144,224/8),e.keccak_256=$(1,136,256/8),e.keccak_384=$(1,104,384/8),e.keccak_512=$(1,72,512/8);var L=l((M,O,R)=>(0,a.wrapXOFConstructorWithOpts)((B={})=>new A(O,M,B.dkLen===void 0?R:B.dkLen,!0)),"Qe");e.shake128=L(31,168,128/8),e.shake256=L(31,136,256/8)}),WO=Qo((e,t)=>{var{sha3_512:r}=FO(),a=24,n=32,o=l((k=4,C=Math.random)=>{let A="";for(;A.lengths(r(k)).toString(36).slice(1),"rt"),c=Array.from({length:26},(k,C)=>String.fromCharCode(C+97)),u=l(k=>c[Math.floor(k()*c.length)],"un"),p=l(({globalObj:k=typeof global<"u"?global:typeof window<"u"?window:{},random:C=Math.random}={})=>{let A=Object.keys(k).toString(),$=A.length?A+o(n,C):o(n,C);return i($).substring(0,n)},"st"),h=l(k=>()=>k++,"ot"),m=476782367,g=l(({random:k=Math.random,counter:C=h(Math.floor(k()*m)),length:A=a,fingerprint:$=p({random:k})}={})=>function(){let L=u(k),M=Date.now().toString(36),O=C().toString(36),R=o(A,k),B=`${M+R+O+$}`;return`${L+i(B).substring(1,A)}`},"it"),x=g(),w=l((k,{minLength:C=2,maxLength:A=n}={})=>{let $=k.length,L=/^[a-z][0-9a-z]+$/;try{if(typeof k=="string"&&$>=C&&$<=A&&L.test(k))return!0}finally{}return!1},"fn");t.exports.getConstants=()=>({defaultLength:a,bigLength:n}),t.exports.init=g,t.exports.createId=x,t.exports.bufToBigInt=s,t.exports.createCounter=h,t.exports.createFingerprint=p,t.exports.isCuid=w}),P0=Qo((e,t)=>{var{createId:r,init:a,getConstants:n,isCuid:o}=WO();t.exports.createId=r,t.exports.init=a,t.exports.getConstants=n,t.exports.isCuid=o}),qO=$0(P0()),KO={arabic:"ar",armenian:"am",bulgarian:"bg",danish:"dk",dutch:"nl",english:"en",finnish:"fi",french:"fr",german:"de",greek:"gr",hungarian:"hu",indian:"in",indonesian:"id",irish:"ie",italian:"it",lithuanian:"lt",nepali:"np",norwegian:"no",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"rs",slovenian:"ru",spanish:"es",swedish:"se",tamil:"ta",turkish:"tr",ukrainian:"uk",sanskrit:"sk"},GO=Object.keys(KO);Date.now().toString().slice(5);var m6=BigInt(1e3),g6=BigInt(1e6),y6=BigInt(1e9);function Yx(e){return typeof e=="number"&&(e=BigInt(e)),e5)throw new Error("Can generate at most 5 related queries");n.append("related",JSON.stringify({enabled:!0,howMany:e.related.howMany??3,format:e.related.format??"question"}))}let s=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString(),signal:this.abortController.signal});if(!s.ok||!s.body)throw new Error(s.statusText);r=s.body.getReader();let i=new TextDecoder,c=[],u="";this.events?.onMessageLoading&&this.events.onMessageLoading(!0),this.addNewEmptyAssistantMessage();let p=this.messages.at(-1);for(;;){let{value:h,done:m}=await r.read();if(m)break;u+=i.decode(h,{stream:!0});let g;for(;(g=u.indexOf(` `))!==-1;){let x=u.slice(0,g);u=u.slice(g+2);try{let w=Xx(x),k=JSON.parse(w.data);if(k.type==="sources")this.state[a].sources=k.message,this.events?.onSourceChange&&this.events.onSourceChange(k.message),this.events?.onStateChange&&this.events.onStateChange(this.state);else if(k.type==="query-translated")this.state[a].translatedQuery=k.message,this.events?.onQueryTranslated&&this.events.onQueryTranslated(k.message),this.events?.onStateChange&&this.events.onStateChange(this.state);else if(k.type==="conversation-metadata"){let{segment:C,trigger:A}=k.message;C&&(this.state[a].segment=C),A&&(this.state[a].trigger=A),this.events?.onStateChange&&this.events.onStateChange(this.state)}else if(k.type==="related-queries")this.state[a].relatedQueries=k.message,this.events?.onRelatedQueries&&this.events.onRelatedQueries(k.message),this.events?.onStateChange&&this.events.onStateChange(this.state);else if(k.type==="text")for(c.push(k.message);c.length>0;)p.content+=c.shift(),this.state[a].response=p.content,this.events?.onStateChange&&this.events.onStateChange(this.state),this.events?.onMessageChange&&this.events.onMessageChange(this.messages),yield p.content}catch(w){console.error("Error parsing SSE event:",w),console.error("Raw message:",x)}}}}catch(n){if(n.name==="AbortError")this.state[a].aborted=!0,this.events?.onAnswerAborted&&this.events.onAnswerAborted(!0);else throw this.state[a].error=!0,this.state[a].errorMessage=n.message??"Unknown error",n}finally{r?.releaseLock(),this.state[a].loading=!1,this.events?.onStateChange&&this.events.onStateChange(this.state),this.events?.onInteractionDone&&this.events.onInteractionDone(this.state[a]),this.events?.onMessageLoading&&this.events.onMessageLoading(!1)}}setSystemPromptConfiguration(e){if(Array.isArray(e.systemPrompts)){if(!e.systemPrompts.every(t=>typeof t=="string"))throw new Error("Invalid system prompt configuration");this.systemPrompts=e.systemPrompts}return this}getSystemPromptConfiguration(){return this.systemPrompts}},eR=class{static{l(this,"F")}cache;config;constructor(e){this.cache=new Map,this.config=e}set(e,t){this.cache.set(e,t)}get(e){return this.cache.get(e)}has(e){return this.cache.has(e)}delete(e){return this.cache.delete(e)}clear(){this.cache.clear()}size(){return this.cache.size}};function Eu(e,t){if(typeof navigator<"u"){typeof navigator.sendBeacon<"u"&&navigator.sendBeacon(e,t);return}fetch(e,{method:"POST",body:t,headers:{"Content-Type":"application/json"}}).then(()=>{},r=>console.log(r))}l(Eu,"O");var tR=class Jx{static{l(this,"t")}data;params;config;profile;constructor(t,r){this.data=[],this.config=t,this.profile=r}setParams(t){this.params=t}static create(t,r){let a=new Jx(t,r);return a.start(),a}add(t){this.data.push({rawSearchString:t.rawSearchString,query:t.query,resultsCount:t.resultsCount,roundTripTime:t.roundTripTime,searchedAt:t.searchedAt,userId:this.profile.getUserId(),identity:this.profile.getIdentity(),alias:this.profile.getAlias(),referer:typeof location<"u"?location.toString():void 0}),this.params!=null&&this.data.length>=this.config.flushSize&&this.flush()}flush(){if(this.params==null||this.data.length===0)return;let t=this.data;this.data=[];let r={source:"fe",deploymentID:this.params.deploymentID,index:this.params.index,oramaId:this.config.id,oramaVersion:YO.version,userAgent:typeof navigator<"u"?navigator.userAgent:void 0,events:t};Eu(`${this.params.endpoint}?api-key=${this.config.api_key}`,JSON.stringify(r))?.catch(a=>console.log(a))}start(){let t=setInterval(this.flush.bind(this),this.config.flushInterval);t.unref!=null&&t.unref()}},rR=class{static{l(this,"V")}constructor(e){this.params=e}intervalId;start(){this.stop(),this.intervalId=setInterval(this.beat.bind(this),this.params.frequency)}stop(){this.intervalId!==void 0&&clearInterval(this.intervalId)}beat(){Eu(this.params.endpoint)?.catch(e=>console.log(e))}},Sm=$0(P0()),aR=class{static{l(this,"j")}endpoint;apiKey;userId;identity;userAlias;params;constructor({endpoint:e,apiKey:t}){if(!e||!t)throw new Error("Endpoint and API Key are required to create a Profile");if(typeof e!="string"||typeof t!="string")throw new Error("Endpoint and API Key must be strings");if(typeof localStorage<"u"){let r=localStorage.getItem(v6);r?this.userId=r:(this.userId=(0,Sm.createId)(),localStorage.setItem(v6,this.userId))}else this.userId=(0,Sm.createId)();this.endpoint=e,this.apiKey=t}setParams(e){let{protocol:t,host:r}=new URL(e.identifyUrl),a=`${t}//${r}/identify`;this.params={identifyUrl:a,index:e.index}}getIdentity(){return this.identity}getUserId(){return this.userId}getAlias(){return this.userAlias}async sendProfileData(e){if(!this.params)throw new Error("Orama Profile is not initialized");let t=JSON.stringify({...e,visitorId:this.getUserId(),index:this.params.index});await Eu(`${this.params?.identifyUrl}?api-key=${this.apiKey}`,t)}async identify(e,t){if(typeof t!="string")throw new Error("Identity must be a string");await e,await this.sendProfileData({entity:"identity",id:t}),this.identity=t}async alias(e,t){if(typeof t!="string")throw new Error("Identity must be a string");await e,await this.sendProfileData({entity:"alias",id:t}),this.userAlias=t}reset(){this.userId=(0,Sm.createId)(),this.identity=void 0,this.userAlias=void 0}};function e4(e){return e!==void 0&&e?.signal!==void 0}l(e4,"vn");var w6=class{static{l(this,"It")}id=(0,qO.createId)();api_key;endpoint;multiIndexSearch;mergeResults;multiIndexIndexes;answersApiBaseURL;collector;cache;profile;searchDebounceTimer;searchRequestCounter=0;blockSearchTillAuth=!1;heartbeat;initPromise;constructor(e){if("indexes"in e){this.api_key=e.indexes[0].api_key,this.multiIndexIndexes=e.indexes;let t=new URL(e.indexes[0].endpoint).origin;if(e.indexes.some(r=>new URL(r.endpoint).origin!==t))throw new Error("All indexes must have the same endpoint origin");this.endpoint=t+XO,this.multiIndexSearch=!0,this.mergeResults=e.mergeResults??!0}else this.api_key=e.api_key,this.endpoint=e.endpoint,this.multiIndexSearch=!1,this.mergeResults=!0;if(this.answersApiBaseURL=e.answersApiBaseURL,this.profile=new aR({endpoint:this.endpoint,apiKey:this.api_key}),e.telemetry!==!1){let t={id:this.id,api_key:this.api_key,flushInterval:e.telemetry?.flushInterval??5e3,flushSize:e.telemetry?.flushSize??25};this.collector=tR.create(t,this.profile)}if(e.cache!==!1){let t={};this.cache=new eR(t)}this.init()}customerUserToken=void 0;searchToken=void 0;setAuthToken(e){e===null?(this.customerUserToken=void 0,this.searchToken=void 0):(this.customerUserToken=e,this.searchToken=void 0),this.init()}onAuthTokenExpired;setOnAuthTokenExpired(e){this.onAuthTokenExpired=e}addSearchResultsToCollector(e,t,r,a){if(this.collector)if(Array.isArray(e))for(let n of e)this.collector.add({rawSearchString:r.term,resultsCount:n.hits?.length??0,roundTripTime:t,query:r,cached:a,searchedAt:new Date,userId:this.profile.getUserId()});else this.collector.add({rawSearchString:r.term,resultsCount:e?.hits?.length??0,roundTripTime:t,query:r,cached:a,searchedAt:new Date,userId:this.profile.getUserId()})}async search(e,t){if(await this.initPromise,this.blockSearchTillAuth)return console.warn("Search request blocked until user is authenticated"),null;let r=++this.searchRequestCounter,a=`search-${JSON.stringify(e)}`,n=null,o,s=!1,i=t?.fresh!==!0&&this.cache?.has(a),c=l(async()=>{try{let u=Date.now();this.multiIndexSearch?n=await this.fetch("multi_search","POST",{q:{...e,mergeResults:this.mergeResults},sst:this.searchToken,indexes:this.multiIndexIndexes},t?.abortController):n=await this.fetch("search","POST",{q:e,sst:this.searchToken},t?.abortController);let p=Date.now();o=p-u;let h=await Km(BigInt(p*1e6-u*1e6));if(!Array.isArray(n))n.elapsed=h;else for(let m of n)m.elapsed=h;this.cache?.set(a,n)}catch(u){if(u.name!=="AbortError")throw console.error("Search request failed",u),u}return this.addSearchResultsToCollector(n,o,e,s),n},"h");if(i&&this.cache)o=0,n=this.cache.get(a),s=!0,this.addSearchResultsToCollector(n,o,e,s);else return t?.debounce?new Promise((u,p)=>{clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=setTimeout(async()=>{try{await c(),u(n)}catch(h){h.name!=="AbortError"&&(console.error("Search request failed",h),p(h))}},t?.debounce||300),"unref"in this.searchDebounceTimer&&this.searchDebounceTimer.unref()}):c();return r===this.searchRequestCounter?n:null}async vectorSearch(e,t){await this.initPromise;let r=`vectorSearch-${JSON.stringify(e)}`,a,n,o=!1;if((t?.fresh!==!0&&this.cache?.has(r))===!0&&this.cache!=null)a=0,n=this.cache.get(r),o=!0;else{let s=Date.now();n=await this.fetch("vector-search2","POST",{q:e},t?.abortSignal??t?.abortController);let i=Date.now();n.elapsed=await Km(BigInt(i*1e6-s*1e6)),a=i-s,this.cache?.set(r,n)}return this.collector!=null&&this.collector.add({rawSearchString:e.term,resultsCount:n.hits?.length??0,roundTripTime:a,query:e,cached:o,searchedAt:new Date,userId:this.profile.getUserId()}),n}createAnswerSession(e){return new JO({inferenceType:e?.inferenceType||"documentation",initialMessages:e?.initialMessages||[],oramaClient:this,events:e?.events,userContext:e?.userContext,systemPrompts:e?.systemPrompts??[]})}startHeartBeat(e){this.heartbeat?.stop(),this.heartbeat=new rR({...e,endpoint:`${this.endpoint}/health?api-key=${this.api_key}`}),this.heartbeat.start()}stopHeartBeat(){this.heartbeat?.stop()}async getPop(){return(await this.initPromise)?.pop??""}expirationTimer;init(){let e=["init","GET",void 0,void 0,{token:this.customerUserToken}];this.multiIndexSearch&&(e=["init_multi_search","POST",{indexes:this.multiIndexIndexes},void 0,{token:this.customerUserToken}]),this.initPromise=this.fetch(...e).then(t=>{if(this.collector?.setParams({endpoint:t.collectUrl,deploymentID:t.deploymentID,index:t.index}),this.profile?.setParams({identifyUrl:t.collectUrl,index:t.index}),t.searchSession){if("required"in t.searchSession&&t.searchSession.required===!0)this.blockSearchTillAuth=!0;else if("token"in t.searchSession){let r=t.searchSession.token;this.searchToken=r;let a=t.searchSession.maxAge;this.blockSearchTillAuth=!1,this.expirationTimer&&clearTimeout(this.expirationTimer),this.expirationTimer=setTimeout(()=>{this.searchToken===r&&(this.searchToken=void 0,this.blockSearchTillAuth=!0,this.onAuthTokenExpired?.(r))},a*1e3),"unref"in this.expirationTimer&&this.expirationTimer.unref()}}return t}).catch(t=>(console.log(t),null))}async fetch(e,t,r,a,n){let o=e4(a)?a?.signal:a;if(o?.aborted===!0)throw new Error("Request aborted");let s={method:t,headers:{"Content-Type":"application/x-www-form-urlencoded"},signal:o};if(t==="POST"&&r!==void 0){let u=r;u.version=Qx,u.id=this.id,u.visitorId=this.profile.getUserId(),s.body=Object.entries(u).filter(([p,h])=>!!h).map(([p,h])=>`${p}=${encodeURIComponent(JSON.stringify(h))}`).join("&")}let i=new URL(`${this.endpoint}/${e}`);if(this.multiIndexSearch||i.searchParams.append("api-key",this.api_key),n)for(let[u,p]of Object.entries(n))p&&i.searchParams.append(u,p);let c=await fetch(i,s);if(!c.ok){let u=new Error;throw u.httpResponse=c,u}return await c.json()}getIdentity(){return this.profile.getIdentity()}getUserId(){return this.profile.getUserId()}getAlias(){return this.profile.getAlias()}async identify(e){if(this.initPromise===void 0)throw new Error("OramaClient not initialized");await this.profile.identify(this.initPromise,e)}async alias(e){if(this.initPromise===void 0)throw new Error("OramaClient not initialized");await this.profile.alias(this.initPromise,e)}reset(){this.profile.reset()}};function t4(e,t,r="[focus-on-arrow-nav]"){if(t.key!=="ArrowDown"&&t.key!=="ArrowUp")return;t.stopPropagation(),t.preventDefault();let a=e.querySelectorAll(r),n=Array.from(a);n=n.filter(p=>p.tabIndex!==-1);let o=n[0],s=n[n.length-1],i=e.querySelector(":focus"),c=n.indexOf(i),u;t.key==="ArrowDown"?(u=c===n.length-1?o:n[c+1],u?.focus()):t.key==="ArrowUp"&&(u=c===0?s:n[c-1],u?.focus())}l(t4,"arrowKeysNavigation");function r4(e){var t;if(!((t=navigator.clipboard)===null||t===void 0)&&t.writeText)navigator.clipboard.writeText(e).catch(r=>{console.error("Could not copy text: ",r)});else{let r=document.createElement("textarea");r.value=e,r.setAttribute("readonly",""),r.style.position="absolute",r.style.left="-9999px",document.body.appendChild(r),r.select(),document.execCommand("copy"),document.body.removeChild(r)}}l(r4,"copyToClipboard");function Wl(e,t){return Array.from(e.attributes).reduce((r,a)=>(t.includes(a.name)||(r[a.name]=a.value),r),{})}l(Wl,"getNonExplicitAttributes");function O0(e,t,r,a){let n=` Component: ${e.tagName.toLowerCase()} Id: ${e.id} `;if(!t&&!r&&!a)throw new Error(`Invalid component configuration. Please provide a valid index or instance prop. ${n}`);if(t){if(r||a)throw new Error(`Invalid component configuration. Only one of indexOrIndexes, instance, or oramaCoreInstance can be provided. ${n}`);if((Array.isArray(t)?t:[t]).some(o=>!o?.api_key||!o?.endpoint))throw new Error(`Invalid cloud index configuration. Please provide a valid api_key and endpoint ${n}`);return}if(r){if(t||a)throw new Error(`Invalid component configuration. Only one of indexOrIndexes, instance, or oramaCoreInstance can be provided. ${n}`);return}if(a){if(t||r)throw new Error(`Invalid component configuration. Only one of indexOrIndexes, instance, or oramaCoreInstance can be provided. ${n}`);return}throw new Error(`Invalid instance. Expected either an OramaClient, Orama OSS database, or CollectionManager-like object. ${n}`)}l(O0,"validateCloudIndexConfig");function R0(e){if(Array.isArray(e)){let r=e;return new w6({mergeResults:!0,indexes:r})}let t=e;return new w6({api_key:t.api_key,endpoint:t.endpoint})}l(R0,"initOramaClient");function $u(e){return`${`orama-ui-${e}`}-${Math.random().toString(36).substring(2,15)}`}l($u,"generateRandomID");function Pu(e,t,r){let a=t==="system"?r:t;return e&&a&&(e.classList.remove("theme-light","theme-dark"),e.classList.add(`theme-${a}`)),a}l(Pu,"updateThemeClasses");function Ou(e,t,r){var a;if(!(!e||!r||!t))for(let n of Object.keys(r))if(n==="colors"){if(!((a=r[n])===null||a===void 0)&&a[t])for(let o of Object.keys(r[n][t]))e.style.setProperty(`${o}`,r[n][t][o])}else for(let o of Object.keys(r[n]))e.style.setProperty(`${o}`,r[n][o])}l(Ou,"updateCssVariables");var nR='.button.sc-orama-button{align-items:center;border:0;border-radius:.75rem;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)));cursor:pointer;display:flex;font-family:font("primary");font-family:var(--font-primary,font("primary"));gap:.5rem;gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));position:relative;text-align:left;transition:all .2s;transition-property:color,background-color,opacity;width:100%}.button__tooltip.sc-orama-button{animation:fadeInOut 1s ease-in-out 1;background-color:#151515;background-color:var(--text-color-primary,#151515);border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)));color:#fbfbfb;color:var(--background-color-primary,#fbfbfb);display:block;font-size:10px;opacity:0;padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));position:absolute;top:-28px;z-index:1}.button--small.sc-orama-button{padding:.25rem;padding:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)))}.button--medium.sc-orama-button{padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}.button--large.sc-orama-button{padding:.75rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}.button__label.sc-orama-button{align-items:center;display:flex;flex-grow:1;gap:.25rem;gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)))}.button--primary.sc-orama-button{background-color:#432d77;background-color:var(--button-background-color-primary,#432d77);color:#fbfbfb;color:var(--button-text-color-primary,#fbfbfb)}.button--primary.sc-orama-button:disabled{background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6);color:var(--text-color-tertiary)}.button--secondary.sc-orama-button{background-color:#fff;background-color:var(--button-background-color-secondary,#fff);border:1px solid #dadada;border:1px solid var(--button-border-color-secondary,#dadada);color:#838289;color:var(--button-text-color-secondary,#838289);transition:all .3s}@media (hover:hover){.button--secondary.sc-orama-button:hover{background-color:#eee9f6;background-color:var(--button-background-color-secondary-hover,#eee9f6)}}.button--secondary.sc-orama-button:focus-visible{border:1px solid #9671b0;outline:none}.button--secondary.sc-orama-button:disabled{background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6);color:var(--text-color-tertiary)}.button--icon.sc-orama-button{align-items:center;background-color:transparent;border-radius:50%;color:#99989d;color:var(--icon-color-tertiary,#99989d);font-family:font("primary");font-family:var(--font-primary,font("primary"));height:-moz-fit-content;height:fit-content;justify-content:center;padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));width:-moz-fit-content;width:fit-content}.button--icon.sc-orama-button:disabled{opacity:.6}.button--icon.sc-orama-button:disabled,.button--icon.sc-orama-button:hover{background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6)}.sc-orama-button-s>*{align-items:center;display:inline-flex}.sc-orama-button-s>[slot=adorment-end],.sc-orama-button-s>[slot=adorment-start]{flex-grow:0}@keyframes fadeInOut{0%{opacity:0}50%{opacity:1}to{opacity:0}}',oR=Jt(class extends Xt{static{l(this,"OramaButton")}constructor(){super(),this.__registerHost(),this.as="button",this.variant="primary",this.size="medium"}render(){let e=this.as,t=["as","class","variant"],r=Wl(this.el,t),a=`button button--${this.variant} button--${this.size} ${this.class||""}`;return z(e,Object.assign({key:"af470570a767787e5e85ec5c0ecc4cfb66e5b142",class:a},r,{disabled:this.disabled}),z("span",{key:"483fb6a261decf60053ec78726912e11ae271e74",class:"button__label"},z("slot",{key:"3d00cc8a7fe04471095f87b9989eebf38c79764a",name:"adorment-start"}),this.withTooltip&&z("span",{key:"bdda78c3dc2e39b53254a5506dcfb53bffdb9ed3",class:"button__tooltip"},this.withTooltip),z("slot",{key:"6582b9e1c0481f18ac91844b0f09ff09b9fa1fbf"})),z("slot",{key:"31d3bcf229c837809ccf3ba74986a179fe028c87",name:"adorment-end"}))}get el(){return this}static get style(){return nR}},[6,"orama-button",{as:[1],class:[1],variant:[1],size:[1],type:[1],disabled:[4],withTooltip:[1,"with-tooltip"]}]);function yo(){typeof customElements>"u"||["orama-button"].forEach(e=>{switch(e){case"orama-button":customElements.get(e)||customElements.define(e,oR);break}})}l(yo,"defineCustomElement");var eu=globalThis,L0=eu.ShadowRoot&&(eu.ShadyCSS===void 0||eu.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,M0=Symbol(),x6=new WeakMap,a4=class{static{l(this,"l")}constructor(e,t,r){if(this._$cssResult$=!0,r!==M0)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(L0&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=x6.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&x6.set(t,e))}return e}toString(){return this.cssText}},sR=l(e=>new a4(typeof e=="string"?e:e+"",void 0,M0),"h$1"),Pr=l((e,...t)=>{let r=e.length===1?e[0]:t.reduce((a,n,o)=>a+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[o+1],e[0]);return new a4(r,e,M0)},"p$3"),iR=l((e,t)=>{if(L0)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of t){let a=document.createElement("style"),n=eu.litNonce;n!==void 0&&a.setAttribute("nonce",n),a.textContent=r.cssText,e.appendChild(a)}},"d$2"),_6=L0?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(let a of t.cssRules)r+=a.cssText;return sR(r)})(e):e,{is:lR,defineProperty:cR,getOwnPropertyDescriptor:dR,getOwnPropertyNames:uR,getOwnPropertySymbols:hR,getPrototypeOf:pR}=Object,Qs=globalThis,k6=Qs.trustedTypes,fR=k6?k6.emptyScript:"",mR=Qs.reactiveElementPolyfillSupport,Ml=l((e,t)=>e,"l$1"),fu={toAttribute(e,t){switch(t){case Boolean:e=e?fR:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},N0=l((e,t)=>!lR(e,t),"y$2"),S6={attribute:!0,type:String,converter:fu,reflect:!1,hasChanged:N0};Symbol.metadata!=null||(Symbol.metadata=Symbol("metadata")),Qs.litPropertyMetadata!=null||(Qs.litPropertyMetadata=new WeakMap);var Us=class extends HTMLElement{static{l(this,"c")}static addInitializer(e){var t;this._$Ei(),((t=this.l)!=null?t:this.l=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=S6){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),a=this.getPropertyDescriptor(e,r,t);a!==void 0&&cR(this.prototype,e,a)}}static getPropertyDescriptor(e,t,r){var a;let{get:n,set:o}=(a=dR(this.prototype,e))!=null?a:{get(){return this[t]},set(s){this[t]=s}};return{get(){return n?.call(this)},set(s){let i=n?.call(this);o.call(this,s),this.requestUpdate(e,i,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){var t;return(t=this.elementProperties.get(e))!=null?t:S6}static _$Ei(){if(this.hasOwnProperty(Ml("elementProperties")))return;let e=pR(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ml("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ml("properties"))){let t=this.properties,r=[...uR(t),...hR(t)];for(let a of r)this.createProperty(a,t[a])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,a]of t)this.elementProperties.set(r,a)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let a=this._$Eu(t,r);a!==void 0&&this._$Eh.set(a,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let a of r)t.unshift(_6(a))}else e!==void 0&&t.push(_6(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t,r;((t=this._$EO)!=null?t:this._$EO=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return iR(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostConnected)==null?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){var r;let a=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,a);if(n!==void 0&&a.reflect===!0){let o=(((r=a.converter)==null?void 0:r.toAttribute)!==void 0?a.converter:fu).toAttribute(t,a.type);this._$Em=e,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(e,t){var r;let a=this.constructor,n=a._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let o=a.getPropertyOptions(n),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:fu;this._$Em=n,this[n]=s.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,r){var a;if(e!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(e)),!((a=r.hasChanged)!=null?a:N0)(this[e],t))return;this.P(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,r){var a;this._$AL.has(e)||this._$AL.set(e,t),r.reflect===!0&&this._$Em!==e&&((a=this._$Ej)!=null?a:this._$Ej=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}let a=this.constructor.elementProperties;if(a.size>0)for(let[n,o]of a)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],o)}let t=!1,r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),(e=this._$EO)==null||e.forEach(a=>{var n;return(n=a.hostUpdate)==null?void 0:n.call(a)}),this.update(r)):this._$EU()}catch(a){throw t=!1,this._$EU(),a}t&&this._$AE(r)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var a;return(a=r.hostUpdated)==null?void 0:a.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}},I6;Us.elementStyles=[],Us.shadowRootOptions={mode:"open"},Us[Ml("elementProperties")]=new Map,Us[Ml("finalized")]=new Map,mR?.({ReactiveElement:Us}),((I6=Qs.reactiveElementVersions)!=null?I6:Qs.reactiveElementVersions=[]).push("2.0.4");var mu=globalThis,gu=mu.trustedTypes,C6=gu?gu.createPolicy("lit-html",{createHTML:l(e=>e,"createHTML")}):void 0,n4="$lit$",ho=`lit$${Math.random().toFixed(9).slice(2)}$`,o4="?"+ho,gR=`<${o4}>`,Wo=document,Bl=l(()=>Wo.createComment(""),"x"),Hl=l(e=>e===null||typeof e!="object"&&typeof e!="function","H"),s4=Array.isArray,yR=l(e=>s4(e)||typeof e?.[Symbol.iterator]=="function","Z"),Im=`[ \f\r]`,Sl=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,A6=/-->/g,T6=/>/g,Ho=RegExp(`>|${Im}(?:([^\\s"'>=/]+)(${Im}*=${Im}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),E6=/'/g,$6=/"/g,i4=/^(?:script|style|textarea|title)$/i,l4=l(e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),"O$1"),Or=l4(1),ce=l4(2),Xs=Symbol.for("lit-noChange"),$r=Symbol.for("lit-nothing"),P6=new WeakMap,Vo=Wo.createTreeWalker(Wo,129);function D0(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return C6!==void 0?C6.createHTML(t):t}l(D0,"z");var bR=l((e,t)=>{let r=e.length-1,a=[],n,o=t===2?"":"",s=Sl;for(let i=0;i"?(s=n??Sl,h=-1):p[1]===void 0?h=-2:(h=s.lastIndex-p[2].length,u=p[1],s=p[3]===void 0?Ho:p[3]==='"'?$6:E6):s===$6||s===E6?s=Ho:s===A6||s===T6?s=Sl:(s=Ho,n=void 0);let g=s===Ho&&e[i+1].startsWith("/>")?" ":"";o+=s===Sl?c+gR:h>=0?(a.push(u),c.slice(0,h)+n4+c.slice(h)+ho+g):c+ho+(h===-2?i:g)}return[D0(e,o+(e[r]||"")+(t===2?"":"")),a]},"q"),Ym=class c4{static{l(this,"T")}constructor({strings:t,_$litType$:r},a){let n;this.parts=[];let o=0,s=0,i=t.length-1,c=this.parts,[u,p]=bR(t,r);if(this.el=c4.createElement(u,a),Vo.currentNode=this.el.content,r===2){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(n=Vo.nextNode())!==null&&c.length0){n.textContent=gu?gu.emptyScript:"";for(let g=0;g2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=$r}_$AI(e,t=this,r,a){let n=this.strings,o=!1;if(n===void 0)e=qo(this,e,t,0),o=!Hl(e)||e!==this._$AH&&e!==Xs,o&&(this._$AH=e);else{let s=e,i,c;for(e=n[0],i=0;i{var a,n;let o=(a=r?.renderBefore)!=null?a:t,s=o._$litPart$;if(s===void 0){let i=(n=r?.renderBefore)!=null?n:null;o._$litPart$=s=new z0(t.insertBefore(Bl(),i),i,void 0,r??{})}return s._$AI(e),s},"et"),ur=class extends Us{static{l(this,"n")}constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;let t=super.createRenderRoot();return(e=this.renderOptions).renderBefore!=null||(e.renderBefore=t.firstChild),t}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=IR(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Xs}},R6;ur._$litElement$=!0,ur.finalized=!0,(R6=globalThis.litElementHydrateSupport)==null||R6.call(globalThis,{LitElement:ur});var CR=globalThis.litElementPolyfillSupport;CR?.({LitElement:ur});var L6;((L6=globalThis.litElementVersions)!=null?L6:globalThis.litElementVersions=[]).push("4.0.6");var Rr=l(e=>(t,r)=>{r!==void 0?r.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},"s"),AR=Object.defineProperty,TR=Object.defineProperties,ER=Object.getOwnPropertyDescriptors,M6=Object.getOwnPropertySymbols,$R=Object.prototype.hasOwnProperty,PR=Object.prototype.propertyIsEnumerable,N6=l((e,t,r)=>t in e?AR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"d"),OR=l((e,t)=>{for(var r in t||(t={}))$R.call(t,r)&&N6(e,r,t[r]);if(M6)for(var r of M6(t))PR.call(t,r)&&N6(e,r,t[r]);return e},"l"),RR=l((e,t)=>TR(e,ER(t)),"u"),LR={attribute:!0,type:String,converter:fu,reflect:!1,hasChanged:N0},MR=l((e=LR,t,r)=>{let{kind:a,metadata:n}=r,o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),o.set(r.name,e),a==="accessor"){let{name:s}=r;return{set(i){let c=t.get.call(this);t.set.call(this,i),this.requestUpdate(s,c,e)},init(i){return i!==void 0&&this.P(s,void 0,e),i}}}if(a==="setter"){let{name:s}=r;return function(i){let c=this[s];t.call(this,i),this.requestUpdate(s,c,e)}}throw Error("Unsupported decorator location: "+a)},"w");function ve(e){return(t,r)=>typeof r=="object"?MR(e,t,r):((a,n,o)=>{let s=n.hasOwnProperty(o);return n.constructor.createProperty(o,s?RR(OR({},a),{wrapped:!0}):a),s?Object.getOwnPropertyDescriptor(n,o):void 0})(e,t,r)}l(ve,"O");var NR={chatService:null,interactions:[],sourceBaseURL:"",linksTarget:"_blank",linksRel:"noopener noreferrer",prompt:"",sourcesMap:{title:"title",description:"description",path:"path"}},DR=l((e,t,r)=>{let a=e.get(t);a?a.includes(r)||a.push(r):e.set(t,[r])},"appendToMap"),zR=l((e,t)=>{let r;return(...a)=>{r&&clearTimeout(r),r=setTimeout(()=>{r=0,e(...a)},t)}},"debounce"),ZR=l(e=>!("isConnected"in e)||e.isConnected,"isConnected"),D6=zR(e=>{for(let t of e.keys())e.set(t,e.get(t).filter(ZR))},2e3),jR=l(()=>{if(typeof u6!="function")return{};let e=new Map;return{dispose:l(()=>e.clear(),"dispose"),get:l(t=>{let r=u6();r&&DR(e,t,r)},"get"),set:l(t=>{let r=e.get(t);r&&e.set(t,r.filter(h6)),D6(e)},"set"),reset:l(()=>{e.forEach(t=>t.forEach(h6)),D6(e)},"reset")}},"stencilSubscription"),Cm=l(e=>typeof e=="function"?e():e,"unwrap"),BR=l((e,t=(r,a)=>r!==a)=>{let r=Cm(e),a=new Map(Object.entries(r??{})),n={dispose:[],get:[],set:[],reset:[]},o=l(()=>{a=new Map(Object.entries(Cm(e)??{})),n.reset.forEach(h=>h())},"reset"),s=l(()=>{n.dispose.forEach(h=>h()),o()},"dispose"),i=l(h=>(n.get.forEach(m=>m(h)),a.get(h)),"get"),c=l((h,m)=>{let g=a.get(h);t(m,g,h)&&(a.set(h,m),n.set.forEach(x=>x(h,m,g)))},"set"),u=typeof Proxy>"u"?{}:new Proxy(r,{get(h,m){return i(m)},ownKeys(h){return Array.from(a.keys())},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},has(h,m){return a.has(m)},set(h,m,g){return c(m,g),!0}}),p=l((h,m)=>(n[h].push(m),()=>{HR(n[h],m)}),"on");return{state:u,get:i,set:c,on:p,onChange:l((h,m)=>{let g=p("set",(w,k)=>{w===h&&m(k)}),x=p("reset",()=>m(Cm(e)[h]));return()=>{g(),x()}},"onChange"),use:l((...h)=>{let m=h.reduce((g,x)=>(x.set&&g.push(p("set",x.set)),x.get&&g.push(p("get",x.get)),x.reset&&g.push(p("reset",x.reset)),x.dispose&&g.push(p("dispose",x.dispose)),g),[]);return()=>m.forEach(g=>g())},"use"),dispose:s,reset:o,forceUpdate:l(h=>{let m=a.get(h);n.set.forEach(g=>g(h,m,m))},"forceUpdate")}},"createObservableMap"),HR=l((e,t)=>{let r=e.indexOf(t);r>=0&&(e[r]=e[e.length-1],e.length--)},"removeFromArray"),u4=l((e,t)=>{let r=BR(e,t);return r.use(jR()),r},"createStore"),h4={open:!1,currentTask:"search",currentTerm:""};u4(h4);var UR={count:0,facets:[],facetProperty:"",results:[],resultMap:{},highlightedIndex:-1,loading:!1,error:!1,searchService:null,searchParams:null},VR={global:h4,search:UR,chat:NR},Nl=new Map,FR=l((e,t)=>{let r=Nl.get(e);if(!r)throw new Error("Invalid parent component Id");let a=r[t];if(!a)throw new Error("Store not initialized");return a},"getParentComponentStore"),tu=l((e,t)=>{let r=VR[e];if(!r)throw new Error("Invalid store name");let a=u4(r);if(Nl.has(t)){let n=Nl.get(t);n[e]=a}else Nl.set(t,{[e]:a});return a},"initStore"),p4=l(e=>{Nl.delete(e)},"removeAllStores");function f4(e,t){let r=m4(t);if(!r)throw new Error("Failed to get store");return FR(r.id,e)}l(f4,"getStore");var WR=["orama-search-box","orama-chat-box"];function m4(e){var t;let r=e;for(;;){if(!r)return null;if(r instanceof ShadowRoot){let a=r.host;if(WR.includes(a.tagName.toLowerCase()))return a;r=a}else r=(t=r.parentNode)!==null&&t!==void 0?t:null}}l(m4,"getExternalParentComponentHTMLElement");var Wd=Symbol("storeProps"),z6=Symbol("storeWillLoadPatched");function ro(e){return(t,r)=>{let a=t.constructor;if(a[Wd]||(a[Wd]=[]),a[Wd].push({propKey:r,storeName:e}),!a[z6]){a[z6]=!0;let n=t.componentWillLoad;t.componentWillLoad=function(){let o=Mx(this),s=this.constructor[Wd];if(s)for(let{propKey:i,storeName:c}of s){let u=f4(c,o);this[i]=u}typeof n=="function"&&n.apply(this)}}}}l(ro,"Store");var qR=".dots-loader.sc-orama-dots-loader{align-items:center;display:inline-flex;justify-content:center;padding:1rem 0;padding:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16))) 0}.dot.sc-orama-dots-loader{animation:dot-slide-up 1.4s infinite both;background-color:#151515;background-color:var(--text-color-primary,#151515);border-radius:50%;height:.25rem;height:calc(4rem/var(--orama-base-font-size, 16));margin:0 .125rem;margin:0 var(--spacing-2xs,calc(2rem/var(--orama-base-font-size, 16)));width:.25rem;width:calc(4rem/var(--orama-base-font-size, 16))}.dot.sc-orama-dots-loader:first-child{animation-delay:-.32s}.dot.sc-orama-dots-loader:nth-child(2){animation-delay:-.16s}@keyframes dot-slide-up{0%,80%,to{opacity:.3;transform:translateZ(0)}40%{opacity:1;transform:translate3d(0,-4px,0)}}",KR=Jt(class extends Xt{static{l(this,"DotsLoader")}constructor(){super(),this.__registerHost()}render(){return z("div",{key:"8f554124861dff20b05b26410ab7966b5445c930",class:"dots-loader"},z("div",{key:"a2937b6db7c5e79d97e18149107e5eb5bb04a4bd",class:"dot"}),z("div",{key:"083f41f23dc7992e4dc601de5e118a2658a2e81a",class:"dot"}),z("div",{key:"5a5384b83cd6290e36e1ea7a27e084c82ae4316f",class:"dot"}))}static get style(){return qR}},[2,"orama-dots-loader"]);function ti(){typeof customElements>"u"||["orama-dots-loader"].forEach(e=>{switch(e){case"orama-dots-loader":customElements.get(e)||customElements.define(e,KR);break}})}l(ti,"defineCustomElement");var GR=["1c","abnf","accesslog","ada","arduino","ino","armasm","arm","avrasm","actionscript","as","angelscript","asc","apache","apacheconf","applescript","osascript","arcade","asciidoc","adoc","aspectj","autohotkey","autoit","awk","mawk","nawk","gawk","bash","sh","zsh","basic","bnf","brainfuck","bf","csharp","cs","c","h","cpp","hpp","cc","hh","c++","h++","cxx","hxx","cal","cos","cls","cmake","cmake.in","coq","csp","css","capnproto","capnp","clojure","clj","coffeescript","coffee","cson","iced","crmsh","crm","pcmk","crystal","cr","d","dart","dpr","dfm","pas","pascal","diff","patch","django","jinja","dns","zone","bind","dockerfile","docker","dos","bat","cmd","dsconfig","dts","dust","dst","ebnf","elixir","elm","erlang","erl","excel","xls","xlsx","fsharp","fs","fsx","fsi","fsscript","fix","fortran","f90","f95","gcode","nc","gams","gms","gauss","gss","gherkin","go","golang","golo","gololang","gradle","graphql","gql","groovy","xml","html","xhtml","rss","atom","xjb","xsd","xsl","plist","svg","http","https","haml","handlebars","hbs","html.hbs","html.handlebars","haskell","hs","haxe","hx","hy","hylang","ini","toml","inform7","i7","irpf90","json","jsonc","java","jsp","javascript","js","jsx","julia","jl","julia-repl","kotlin","kt","tex","leaf","lasso","ls","lassoscript","less","ldif","lisp","livecodeserver","livescript","ls","lua","makefile","mk","mak","make","markdown","md","mkdown","mkd","mathematica","mma","wl","matlab","maxima","mel","mercury","mips","mipsasm","mizar","mojolicious","monkey","moonscript","moon","n1ql","nsis","nginx","nginxconf","nim","nimrod","nix","ocaml","ml","objectivec","mm","objc","obj-c","obj-c++","objective-c++","glsl","openscad","scad","ruleslanguage","oxygene","pf","pf.conf","php","parser3","perl","pl","pm","plaintext","txt","text","pony","pgsql","postgres","postgresql","powershell","ps","ps1","processing","prolog","properties","proto","protobuf","puppet","pp","python","py","gyp","profile","python-repl","pycon","k","kdb","qml","r","reasonml","re","rib","rsl","graph","instances","ruby","rb","gemspec","podspec","thor","irb","rust","rs","SAS","sas","scss","sql","p21","step","stp","scala","scheme","scilab","sci","shell","console","smali","smalltalk","st","sml","ml","stan","stanfuncs","stata","stylus","styl","subunit","swift","tcl","tk","tap","thrift","tp","twig","craftcms","typescript","ts","tsx","mts","cts","vbnet","vb","vbscript","vbs","vhdl","vala","verilog","v","vim","axapta","x++","x86asm","xl","tao","xquery","xpath","xq","xqm","yml","yaml","zephir","zep"],{entries:g4,setPrototypeOf:Z6,isFrozen:YR,getPrototypeOf:QR,getOwnPropertyDescriptor:XR}=Object,{freeze:ea,seal:Sa,create:y4}=Object,{apply:Qm,construct:Xm}=typeof Reflect<"u"&&Reflect;ea||(ea=l(function(e){return e},"freeze"));Sa||(Sa=l(function(e){return e},"seal"));Qm||(Qm=l(function(e,t,r){return e.apply(t,r)},"apply"));Xm||(Xm=l(function(e,t){return new e(...t)},"construct"));var qd=Hr(Array.prototype.forEach),JR=Hr(Array.prototype.lastIndexOf),j6=Hr(Array.prototype.pop),Il=Hr(Array.prototype.push),eL=Hr(Array.prototype.splice),ru=Hr(String.prototype.toLowerCase),Am=Hr(String.prototype.toString),B6=Hr(String.prototype.match),Cl=Hr(String.prototype.replace),tL=Hr(String.prototype.indexOf),rL=Hr(String.prototype.trim),za=Hr(Object.prototype.hasOwnProperty),Xr=Hr(RegExp.prototype.test),Al=b4(TypeError);function Hr(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,a=new Array(r>1?r-1:0),n=1;n2&&arguments[2]!==void 0?arguments[2]:ru;Z6&&Z6(e,null);let a=t.length;for(;a--;){let n=t[a];if(typeof n=="string"){let o=r(n);o!==n&&(YR(t)||(t[a]=o),n=o)}e[n]=!0}return e}l(st,"addToSet");function v4(e){for(let t=0;t/gm),iL=Sa(/\$\{[\w\W]*/gm),lL=Sa(/^data-[\-\w.\u00B7-\uFFFF]+$/),cL=Sa(/^aria-[\-\w]+$/),w4=Sa(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),dL=Sa(/^(?:\w+script|data):/i),uL=Sa(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),x4=Sa(/^html$/i),hL=Sa(/^[a-z][.\w]*(-[.\w]+)+$/i),W6=Object.freeze({__proto__:null,ARIA_ATTR:cL,ATTR_WHITESPACE:uL,CUSTOM_ELEMENT:hL,DATA_ATTR:lL,DOCTYPE_NAME:x4,ERB_EXPR:sL,IS_ALLOWED_URI:w4,IS_SCRIPT_OR_DATA:dL,MUSTACHE_EXPR:oL,TMPLIT_EXPR:iL}),Tl={element:1,text:3,progressingInstruction:7,comment:8,document:9},pL=l(function(){return typeof window>"u"?null:window},"getGlobal"),fL=l(function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,a="data-tt-policy-suffix";t&&t.hasAttribute(a)&&(r=t.getAttribute(a));let n="dompurify"+(r?"#"+r:"");try{return e.createPolicy(n,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+n+" could not be created."),null}},"_createTrustedTypesPolicy"),q6=l(function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},"_createHooksMap");function Z0(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pL(),t=l(I=>Z0(I),"DOMPurify");if(t.version="3.2.5",t.removed=[],!e||!e.document||e.document.nodeType!==Tl.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e,a=r,n=a.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:i,Element:c,NodeFilter:u,NamedNodeMap:p=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:m,trustedTypes:g}=e,x=c.prototype,w=Vs(x,"cloneNode"),k=Vs(x,"remove"),C=Vs(x,"nextSibling"),A=Vs(x,"childNodes"),$=Vs(x,"parentNode");if(typeof s=="function"){let I=r.createElement("template");I.content&&I.content.ownerDocument&&(r=I.content.ownerDocument)}let L,M="",{implementation:O,createNodeIterator:R,createDocumentFragment:B,getElementsByTagName:G}=r,{importNode:j}=a,N=q6();t.isSupported=typeof g4=="function"&&typeof $=="function"&&O&&O.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:T,ERB_EXPR:U,TMPLIT_EXPR:ae,DATA_ATTR:oe,ARIA_ATTR:ue,IS_SCRIPT_OR_DATA:ge,ATTR_WHITESPACE:fe,CUSTOM_ELEMENT:Ve}=W6,{IS_ALLOWED_URI:gt}=W6,Ce=null,pr=st({},[...H6,...Tm,...Em,...$m,...U6]),Te=null,Ct=st({},[...V6,...Pm,...F6,...Kd]),ke=Object.seal(y4(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}})),ht=null,xe=null,Ge=!0,Fe=!0,De=!1,Ne=!0,Ae=!1,ut=!0,We=!1,yt=!1,tt=!1,bt=!1,_t=!1,tr=!1,fr=!0,rr=!1,Zt="user-content-",Ot=!0,jt=!1,it={},Rt=null,Kt=st({},["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"]),ar=null,vr=st({},["audio","video","img","source","image","track"]),Gt=null,nr=st({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Lt="http://www.w3.org/1998/Math/MathML",rt="http://www.w3.org/2000/svg",Be="http://www.w3.org/1999/xhtml",pt=Be,or=!1,Bt=null,wr=st({},[Lt,rt,Be],Am),sr=st({},["mi","mo","mn","ms","mtext"]),mr=st({},["annotation-xml"]),gr=st({},["title","style","font","a","script"]),vt=null,_=["application/xhtml+xml","text/html"],P="text/html",K=null,de=null,Ee=r.createElement("form"),Re=l(function(I){return I instanceof RegExp||I instanceof Function},"isRegexOrFunction"),X=l(function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(de&&de===I)){if((!I||typeof I!="object")&&(I={}),I=uo(I),vt=_.indexOf(I.PARSER_MEDIA_TYPE)===-1?P:I.PARSER_MEDIA_TYPE,K=vt==="application/xhtml+xml"?Am:ru,Ce=za(I,"ALLOWED_TAGS")?st({},I.ALLOWED_TAGS,K):pr,Te=za(I,"ALLOWED_ATTR")?st({},I.ALLOWED_ATTR,K):Ct,Bt=za(I,"ALLOWED_NAMESPACES")?st({},I.ALLOWED_NAMESPACES,Am):wr,Gt=za(I,"ADD_URI_SAFE_ATTR")?st(uo(nr),I.ADD_URI_SAFE_ATTR,K):nr,ar=za(I,"ADD_DATA_URI_TAGS")?st(uo(vr),I.ADD_DATA_URI_TAGS,K):vr,Rt=za(I,"FORBID_CONTENTS")?st({},I.FORBID_CONTENTS,K):Kt,ht=za(I,"FORBID_TAGS")?st({},I.FORBID_TAGS,K):{},xe=za(I,"FORBID_ATTR")?st({},I.FORBID_ATTR,K):{},it=za(I,"USE_PROFILES")?I.USE_PROFILES:!1,Ge=I.ALLOW_ARIA_ATTR!==!1,Fe=I.ALLOW_DATA_ATTR!==!1,De=I.ALLOW_UNKNOWN_PROTOCOLS||!1,Ne=I.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ae=I.SAFE_FOR_TEMPLATES||!1,ut=I.SAFE_FOR_XML!==!1,We=I.WHOLE_DOCUMENT||!1,bt=I.RETURN_DOM||!1,_t=I.RETURN_DOM_FRAGMENT||!1,tr=I.RETURN_TRUSTED_TYPE||!1,tt=I.FORCE_BODY||!1,fr=I.SANITIZE_DOM!==!1,rr=I.SANITIZE_NAMED_PROPS||!1,Ot=I.KEEP_CONTENT!==!1,jt=I.IN_PLACE||!1,gt=I.ALLOWED_URI_REGEXP||w4,pt=I.NAMESPACE||Be,sr=I.MATHML_TEXT_INTEGRATION_POINTS||sr,mr=I.HTML_INTEGRATION_POINTS||mr,ke=I.CUSTOM_ELEMENT_HANDLING||{},I.CUSTOM_ELEMENT_HANDLING&&Re(I.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ke.tagNameCheck=I.CUSTOM_ELEMENT_HANDLING.tagNameCheck),I.CUSTOM_ELEMENT_HANDLING&&Re(I.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ke.attributeNameCheck=I.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),I.CUSTOM_ELEMENT_HANDLING&&typeof I.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ke.allowCustomizedBuiltInElements=I.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ae&&(Fe=!1),_t&&(bt=!0),it&&(Ce=st({},U6),Te=[],it.html===!0&&(st(Ce,H6),st(Te,V6)),it.svg===!0&&(st(Ce,Tm),st(Te,Pm),st(Te,Kd)),it.svgFilters===!0&&(st(Ce,Em),st(Te,Pm),st(Te,Kd)),it.mathMl===!0&&(st(Ce,$m),st(Te,F6),st(Te,Kd))),I.ADD_TAGS&&(Ce===pr&&(Ce=uo(Ce)),st(Ce,I.ADD_TAGS,K)),I.ADD_ATTR&&(Te===Ct&&(Te=uo(Te)),st(Te,I.ADD_ATTR,K)),I.ADD_URI_SAFE_ATTR&&st(Gt,I.ADD_URI_SAFE_ATTR,K),I.FORBID_CONTENTS&&(Rt===Kt&&(Rt=uo(Rt)),st(Rt,I.FORBID_CONTENTS,K)),Ot&&(Ce["#text"]=!0),We&&st(Ce,["html","head","body"]),Ce.table&&(st(Ce,["tbody"]),delete ht.tbody),I.TRUSTED_TYPES_POLICY){if(typeof I.TRUSTED_TYPES_POLICY.createHTML!="function")throw Al('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof I.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Al('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');L=I.TRUSTED_TYPES_POLICY,M=L.createHTML("")}else L===void 0&&(L=fL(g,n)),L!==null&&typeof M=="string"&&(M=L.createHTML(""));ea&&ea(I),de=I}},"_parseConfig"),J=st({},[...Tm,...Em,...aL]),pe=st({},[...$m,...nL]),lt=l(function(I){let te=$(I);(!te||!te.tagName)&&(te={namespaceURI:pt,tagName:"template"});let V=ru(I.tagName),we=ru(te.tagName);return Bt[I.namespaceURI]?I.namespaceURI===rt?te.namespaceURI===Be?V==="svg":te.namespaceURI===Lt?V==="svg"&&(we==="annotation-xml"||sr[we]):!!J[V]:I.namespaceURI===Lt?te.namespaceURI===Be?V==="math":te.namespaceURI===rt?V==="math"&&mr[we]:!!pe[V]:I.namespaceURI===Be?te.namespaceURI===rt&&!mr[we]||te.namespaceURI===Lt&&!sr[we]?!1:!pe[V]&&(gr[V]||!J[V]):!!(vt==="application/xhtml+xml"&&Bt[I.namespaceURI]):!1},"_checkValidNamespace"),Le=l(function(I){Il(t.removed,{element:I});try{$(I).removeChild(I)}catch{k(I)}},"_forceRemove"),Ht=l(function(I,te){try{Il(t.removed,{attribute:te.getAttributeNode(I),from:te})}catch{Il(t.removed,{attribute:null,from:te})}if(te.removeAttribute(I),I==="is")if(bt||_t)try{Le(te)}catch{}else try{te.setAttribute(I,"")}catch{}},"_removeAttribute"),Ur=l(function(I){let te=null,V=null;if(tt)I=""+I;else{let ze=B6(I,/^[\r\n\t ]+/);V=ze&&ze[0]}vt==="application/xhtml+xml"&&pt===Be&&(I=''+I+"");let we=L?L.createHTML(I):I;if(pt===Be)try{te=new m().parseFromString(we,vt)}catch{}if(!te||!te.documentElement){te=O.createDocument(pt,"template",null);try{te.documentElement.innerHTML=or?M:we}catch{}}let He=te.body||te.documentElement;return I&&V&&He.insertBefore(r.createTextNode(V),He.childNodes[0]||null),pt===Be?G.call(te,We?"html":"body")[0]:We?te.documentElement:He},"_initDocument"),xr=l(function(I){return R.call(I.ownerDocument||I,I,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},"_createNodeIterator"),Lr=l(function(I){return I instanceof h&&(typeof I.nodeName!="string"||typeof I.textContent!="string"||typeof I.removeChild!="function"||!(I.attributes instanceof p)||typeof I.removeAttribute!="function"||typeof I.setAttribute!="function"||typeof I.namespaceURI!="string"||typeof I.insertBefore!="function"||typeof I.hasChildNodes!="function")},"_isClobbered"),_r=l(function(I){return typeof i=="function"&&I instanceof i},"_isNode");function kt(I,te,V){qd(I,we=>{we.call(t,te,V,de)})}l(kt,"_executeHooks");let da=l(function(I){let te=null;if(kt(N.beforeSanitizeElements,I,null),Lr(I))return Le(I),!0;let V=K(I.nodeName);if(kt(N.uponSanitizeElement,I,{tagName:V,allowedTags:Ce}),I.hasChildNodes()&&!_r(I.firstElementChild)&&Xr(/<[/\w!]/g,I.innerHTML)&&Xr(/<[/\w!]/g,I.textContent)||I.nodeType===Tl.progressingInstruction||ut&&I.nodeType===Tl.comment&&Xr(/<[/\w]/g,I.data))return Le(I),!0;if(!Ce[V]||ht[V]){if(!ht[V]&&Fr(V)&&(ke.tagNameCheck instanceof RegExp&&Xr(ke.tagNameCheck,V)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(V)))return!1;if(Ot&&!Rt[V]){let we=$(I)||I.parentNode,He=A(I)||I.childNodes;if(He&&we){let ze=He.length;for(let Mt=ze-1;Mt>=0;--Mt){let ft=w(He[Mt],!0);ft.__removalCount=(I.__removalCount||0)+1,we.insertBefore(ft,C(I))}}}return Le(I),!0}return I instanceof c&&!lt(I)||(V==="noscript"||V==="noembed"||V==="noframes")&&Xr(/<\/no(script|embed|frames)/i,I.innerHTML)?(Le(I),!0):(Ae&&I.nodeType===Tl.text&&(te=I.textContent,qd([T,U,ae],we=>{te=Cl(te,we," ")}),I.textContent!==te&&(Il(t.removed,{element:I.cloneNode()}),I.textContent=te)),kt(N.afterSanitizeElements,I,null),!1)},"_sanitizeElements"),Vr=l(function(I,te,V){if(fr&&(te==="id"||te==="name")&&(V in r||V in Ee))return!1;if(!(Fe&&!xe[te]&&Xr(oe,te))&&!(Ge&&Xr(ue,te))){if(!Te[te]||xe[te]){if(!(Fr(I)&&(ke.tagNameCheck instanceof RegExp&&Xr(ke.tagNameCheck,I)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(I))&&(ke.attributeNameCheck instanceof RegExp&&Xr(ke.attributeNameCheck,te)||ke.attributeNameCheck instanceof Function&&ke.attributeNameCheck(te))||te==="is"&&ke.allowCustomizedBuiltInElements&&(ke.tagNameCheck instanceof RegExp&&Xr(ke.tagNameCheck,V)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(V))))return!1}else if(!Gt[te]&&!Xr(gt,Cl(V,fe,""))&&!((te==="src"||te==="xlink:href"||te==="href")&&I!=="script"&&tL(V,"data:")===0&&ar[I])&&!(De&&!Xr(ge,Cl(V,fe,"")))&&V)return!1}return!0},"_isValidAttribute"),Fr=l(function(I){return I!=="annotation-xml"&&B6(I,Ve)},"_isBasicCustomElement"),yr=l(function(I){kt(N.beforeSanitizeAttributes,I,null);let{attributes:te}=I;if(!te||Lr(I))return;let V={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Te,forceKeepAttr:void 0},we=te.length;for(;we--;){let He=te[we],{name:ze,namespaceURI:Mt,value:ft}=He,ct=K(ze),at=ze==="value"?ft:rL(ft);if(V.attrName=ct,V.attrValue=at,V.keepAttr=!0,V.forceKeepAttr=void 0,kt(N.uponSanitizeAttribute,I,V),at=V.attrValue,rr&&(ct==="id"||ct==="name")&&(Ht(ze,I),at=Zt+at),ut&&Xr(/((--!?|])>)|<\/(style|title)/i,at)){Ht(ze,I);continue}if(V.forceKeepAttr||(Ht(ze,I),!V.keepAttr))continue;if(!Ne&&Xr(/\/>/i,at)){Ht(ze,I);continue}Ae&&qd([T,U,ae],se=>{at=Cl(at,se," ")});let H=K(I.nodeName);if(Vr(H,ct,at)){if(L&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Mt)switch(g.getAttributeType(H,ct)){case"TrustedHTML":{at=L.createHTML(at);break}case"TrustedScriptURL":{at=L.createScriptURL(at);break}}try{Mt?I.setAttributeNS(Mt,ze,at):I.setAttribute(ze,at),Lr(I)?Le(I):j6(t.removed)}catch{}}}kt(N.afterSanitizeAttributes,I,null)},"_sanitizeAttributes"),ua=l(function I(te){let V=null,we=xr(te);for(kt(N.beforeSanitizeShadowDOM,te,null);V=we.nextNode();)kt(N.uponSanitizeShadowNode,V,null),da(V),yr(V),V.content instanceof o&&I(V.content);kt(N.afterSanitizeShadowDOM,te,null)},"_sanitizeShadowDOM");return t.sanitize=function(I){let te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},V=null,we=null,He=null,ze=null;if(or=!I,or&&(I=""),typeof I!="string"&&!_r(I))if(typeof I.toString=="function"){if(I=I.toString(),typeof I!="string")throw Al("dirty is not a string, aborting")}else throw Al("toString is not a function");if(!t.isSupported)return I;if(yt||X(te),t.removed=[],typeof I=="string"&&(jt=!1),jt){if(I.nodeName){let ct=K(I.nodeName);if(!Ce[ct]||ht[ct])throw Al("root node is forbidden and cannot be sanitized in-place")}}else if(I instanceof i)V=Ur(""),we=V.ownerDocument.importNode(I,!0),we.nodeType===Tl.element&&we.nodeName==="BODY"||we.nodeName==="HTML"?V=we:V.appendChild(we);else{if(!bt&&!Ae&&!We&&I.indexOf("<")===-1)return L&&tr?L.createHTML(I):I;if(V=Ur(I),!V)return bt?null:tr?M:""}V&&tt&&Le(V.firstChild);let Mt=xr(jt?I:V);for(;He=Mt.nextNode();)da(He),yr(He),He.content instanceof o&&ua(He.content);if(jt)return I;if(bt){if(_t)for(ze=B.call(V.ownerDocument);V.firstChild;)ze.appendChild(V.firstChild);else ze=V;return(Te.shadowroot||Te.shadowrootmode)&&(ze=j.call(a,ze,!0)),ze}let ft=We?V.outerHTML:V.innerHTML;return We&&Ce["!doctype"]&&V.ownerDocument&&V.ownerDocument.doctype&&V.ownerDocument.doctype.name&&Xr(x4,V.ownerDocument.doctype.name)&&(ft=" `+ft),Ae&&qd([T,U,ae],ct=>{ft=Cl(ft,ct," ")}),L&&tr?L.createHTML(ft):ft},t.setConfig=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};X(I),yt=!0},t.clearConfig=function(){de=null,yt=!1},t.isValidAttribute=function(I,te,V){de||X({});let we=K(I),He=K(te);return Vr(we,He,V)},t.addHook=function(I,te){typeof te=="function"&&Il(N[I],te)},t.removeHook=function(I,te){if(te!==void 0){let V=JR(N[I],te);return V===-1?void 0:eL(N[I],V,1)[0]}return j6(N[I])},t.removeHooks=function(I){N[I]=[]},t.removeAllHooks=function(){N=q6()},t}l(Z0,"createDOMPurify");var Jm=Z0(),K6=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _4(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}l(_4,"getDefaultExportFromCjs");function k4(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=l(function a(){return this instanceof a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"a");r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,n.get?n:{enumerable:!0,get:l(function(){return e[a]},"get")})}),r}l(k4,"getAugmentedNamespace");var Om,G6;function I4(){if(G6)return Om;G6=1;function e(_){return _ instanceof Map?_.clear=_.delete=_.set=function(){throw new Error("map is read-only")}:_ instanceof Set&&(_.add=_.clear=_.delete=function(){throw new Error("set is read-only")}),Object.freeze(_),Object.getOwnPropertyNames(_).forEach(P=>{let K=_[P],de=typeof K;(de==="object"||de==="function")&&!Object.isFrozen(K)&&e(K)}),_}l(e,"deepFreeze");let t=class{static{l(this,"Response")}constructor(_){_.data===void 0&&(_.data={}),this.data=_.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function r(_){return _.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}l(r,"escapeHTML");function a(_,...P){let K=Object.create(null);for(let de in _)K[de]=_[de];return P.forEach(function(de){for(let Ee in de)K[Ee]=de[Ee]}),K}l(a,"inherit$1");let n="
    ",o=l(_=>!!_.scope,"emitsWrappingTags"),s=l((_,{prefix:P})=>{if(_.startsWith("language:"))return _.replace("language:","language-");if(_.includes(".")){let K=_.split(".");return[`${P}${K.shift()}`,...K.map((de,Ee)=>`${de}${"_".repeat(Ee+1)}`)].join(" ")}return`${P}${_}`},"scopeToCSSClass"),i=class{static{l(this,"HTMLRenderer")}constructor(_,P){this.buffer="",this.classPrefix=P.classPrefix,_.walk(this)}addText(_){this.buffer+=r(_)}openNode(_){if(!o(_))return;let P=s(_.scope,{prefix:this.classPrefix});this.span(P)}closeNode(_){o(_)&&(this.buffer+=n)}value(){return this.buffer}span(_){this.buffer+=``}},c=l((_={})=>{let P={children:[]};return Object.assign(P,_),P},"newNode"),u=class S4{static{l(this,"TokenTree")}constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(P){this.top.children.push(P)}openNode(P){let K=c({scope:P});this.add(K),this.stack.push(K)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(P){return this.constructor._walk(P,this.rootNode)}static _walk(P,K){return typeof K=="string"?P.addText(K):K.children&&(P.openNode(K),K.children.forEach(de=>this._walk(P,de)),P.closeNode(K)),P}static _collapse(P){typeof P!="string"&&P.children&&(P.children.every(K=>typeof K=="string")?P.children=[P.children.join("")]:P.children.forEach(K=>{S4._collapse(K)}))}},p=class extends u{static{l(this,"TokenTreeEmitter")}constructor(_){super(),this.options=_}addText(_){_!==""&&this.add(_)}startScope(_){this.openNode(_)}endScope(){this.closeNode()}__addSublanguage(_,P){let K=_.root;P&&(K.scope=`language:${P}`),this.add(K)}toHTML(){return new i(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function h(_){return _?typeof _=="string"?_:_.source:null}l(h,"source");function m(_){return w("(?=",_,")")}l(m,"lookahead");function g(_){return w("(?:",_,")*")}l(g,"anyNumberOfTimes");function x(_){return w("(?:",_,")?")}l(x,"optional");function w(..._){return _.map(P=>h(P)).join("")}l(w,"concat");function k(_){let P=_[_.length-1];return typeof P=="object"&&P.constructor===Object?(_.splice(_.length-1,1),P):{}}l(k,"stripOptionsFromArgs");function C(..._){return"("+(k(_).capture?"":"?:")+_.map(P=>h(P)).join("|")+")"}l(C,"either");function A(_){return new RegExp(_.toString()+"|").exec("").length-1}l(A,"countMatchGroups");function $(_,P){let K=_&&_.exec(P);return K&&K.index===0}l($,"startsWith");let L=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function M(_,{joinWith:P}){let K=0;return _.map(de=>{K+=1;let Ee=K,Re=h(de),X="";for(;Re.length>0;){let J=L.exec(Re);if(!J){X+=Re;break}X+=Re.substring(0,J.index),Re=Re.substring(J.index+J[0].length),J[0][0]==="\\"&&J[1]?X+="\\"+String(Number(J[1])+Ee):(X+=J[0],J[0]==="("&&K++)}return X}).map(de=>`(${de})`).join(P)}l(M,"_rewriteBackreferences");let O=/\b\B/,R="[a-zA-Z]\\w*",B="[a-zA-Z_]\\w*",G="\\b\\d+(\\.\\d+)?",j="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",N="\\b(0b[01]+)",T="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",U=l((_={})=>{let P=/^#![ ]*\//;return _.binary&&(_.begin=w(P,/.*\b/,_.binary,/\b.*/)),a({scope:"meta",begin:P,end:/$/,relevance:0,"on:begin":l((K,de)=>{K.index!==0&&de.ignoreMatch()},"on:begin")},_)},"SHEBANG"),ae={begin:"\\\\[\\s\\S]",relevance:0},oe={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ae]},ue={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ae]},ge={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},fe=l(function(_,P,K={}){let de=a({scope:"comment",begin:_,end:P,contains:[]},K);de.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let Ee=C("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return de.contains.push({begin:w(/[ ]+/,"(",Ee,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),de},"COMMENT"),Ve=fe("//","$"),gt=fe("/\\*","\\*/"),Ce=fe("#","$"),pr={scope:"number",begin:G,relevance:0},Te={scope:"number",begin:j,relevance:0},Ct={scope:"number",begin:N,relevance:0},ke={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ae,{begin:/\[/,end:/\]/,relevance:0,contains:[ae]}]},ht={scope:"title",begin:R,relevance:0},xe={scope:"title",begin:B,relevance:0},Ge={begin:"\\.\\s*"+B,relevance:0};var Fe=Object.freeze({__proto__:null,APOS_STRING_MODE:oe,BACKSLASH_ESCAPE:ae,BINARY_NUMBER_MODE:Ct,BINARY_NUMBER_RE:N,COMMENT:fe,C_BLOCK_COMMENT_MODE:gt,C_LINE_COMMENT_MODE:Ve,C_NUMBER_MODE:Te,C_NUMBER_RE:j,END_SAME_AS_BEGIN:l(function(_){return Object.assign(_,{"on:begin":l((P,K)=>{K.data._beginMatch=P[1]},"on:begin"),"on:end":l((P,K)=>{K.data._beginMatch!==P[1]&&K.ignoreMatch()},"on:end")})},"END_SAME_AS_BEGIN"),HASH_COMMENT_MODE:Ce,IDENT_RE:R,MATCH_NOTHING_RE:O,METHOD_GUARD:Ge,NUMBER_MODE:pr,NUMBER_RE:G,PHRASAL_WORDS_MODE:ge,QUOTE_STRING_MODE:ue,REGEXP_MODE:ke,RE_STARTERS_RE:T,SHEBANG:U,TITLE_MODE:ht,UNDERSCORE_IDENT_RE:B,UNDERSCORE_TITLE_MODE:xe});function De(_,P){_.input[_.index-1]==="."&&P.ignoreMatch()}l(De,"skipIfHasPrecedingDot");function Ne(_,P){_.className!==void 0&&(_.scope=_.className,delete _.className)}l(Ne,"scopeClassName");function Ae(_,P){P&&_.beginKeywords&&(_.begin="\\b("+_.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",_.__beforeBegin=De,_.keywords=_.keywords||_.beginKeywords,delete _.beginKeywords,_.relevance===void 0&&(_.relevance=0))}l(Ae,"beginKeywords");function ut(_,P){Array.isArray(_.illegal)&&(_.illegal=C(..._.illegal))}l(ut,"compileIllegal");function We(_,P){if(_.match){if(_.begin||_.end)throw new Error("begin & end are not supported with match");_.begin=_.match,delete _.match}}l(We,"compileMatch");function yt(_,P){_.relevance===void 0&&(_.relevance=1)}l(yt,"compileRelevance");let tt=l((_,P)=>{if(!_.beforeMatch)return;if(_.starts)throw new Error("beforeMatch cannot be used with starts");let K=Object.assign({},_);Object.keys(_).forEach(de=>{delete _[de]}),_.keywords=K.keywords,_.begin=w(K.beforeMatch,m(K.begin)),_.starts={relevance:0,contains:[Object.assign(K,{endsParent:!0})]},_.relevance=0,delete K.beforeMatch},"beforeMatchExt"),bt=["of","and","for","in","not","or","if","then","parent","list","value"],_t="keyword";function tr(_,P,K=_t){let de=Object.create(null);return typeof _=="string"?Ee(K,_.split(" ")):Array.isArray(_)?Ee(K,_):Object.keys(_).forEach(function(Re){Object.assign(de,tr(_[Re],P,Re))}),de;function Ee(Re,X){P&&(X=X.map(J=>J.toLowerCase())),X.forEach(function(J){let pe=J.split("|");de[pe[0]]=[Re,fr(pe[0],pe[1])]})}}l(tr,"compileKeywords");function fr(_,P){return P?Number(P):rr(_)?0:1}l(fr,"scoreForKeyword");function rr(_){return bt.includes(_.toLowerCase())}l(rr,"commonKeyword");let Zt={},Ot=l(_=>{console.error(_)},"error"),jt=l((_,...P)=>{console.log(`WARN: ${_}`,...P)},"warn"),it=l((_,P)=>{Zt[`${_}/${P}`]||(console.log(`Deprecated as of ${_}. ${P}`),Zt[`${_}/${P}`]=!0)},"deprecated"),Rt=new Error;function Kt(_,P,{key:K}){let de=0,Ee=_[K],Re={},X={};for(let J=1;J<=P.length;J++)X[J+de]=Ee[J],Re[J+de]=!0,de+=A(P[J-1]);_[K]=X,_[K]._emit=Re,_[K]._multi=!0}l(Kt,"remapScopeNames");function ar(_){if(Array.isArray(_.begin)){if(_.skip||_.excludeBegin||_.returnBegin)throw Ot("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Rt;if(typeof _.beginScope!="object"||_.beginScope===null)throw Ot("beginScope must be object"),Rt;Kt(_,_.begin,{key:"beginScope"}),_.begin=M(_.begin,{joinWith:""})}}l(ar,"beginMultiClass");function vr(_){if(Array.isArray(_.end)){if(_.skip||_.excludeEnd||_.returnEnd)throw Ot("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Rt;if(typeof _.endScope!="object"||_.endScope===null)throw Ot("endScope must be object"),Rt;Kt(_,_.end,{key:"endScope"}),_.end=M(_.end,{joinWith:""})}}l(vr,"endMultiClass");function Gt(_){_.scope&&typeof _.scope=="object"&&_.scope!==null&&(_.beginScope=_.scope,delete _.scope)}l(Gt,"scopeSugar");function nr(_){Gt(_),typeof _.beginScope=="string"&&(_.beginScope={_wrap:_.beginScope}),typeof _.endScope=="string"&&(_.endScope={_wrap:_.endScope}),ar(_),vr(_)}l(nr,"MultiClass");function Lt(_){function P(X,J){return new RegExp(h(X),"m"+(_.case_insensitive?"i":"")+(_.unicodeRegex?"u":"")+(J?"g":""))}l(P,"langRe");let K=class{static{l(this,"MultiRegex")}constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(X,J){J.position=this.position++,this.matchIndexes[this.matchAt]=J,this.regexes.push([J,X]),this.matchAt+=A(X)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let X=this.regexes.map(J=>J[1]);this.matcherRe=P(M(X,{joinWith:"|"}),!0),this.lastIndex=0}exec(X){this.matcherRe.lastIndex=this.lastIndex;let J=this.matcherRe.exec(X);if(!J)return null;let pe=J.findIndex((Le,Ht)=>Ht>0&&Le!==void 0),lt=this.matchIndexes[pe];return J.splice(0,pe),Object.assign(J,lt)}},de=class{static{l(this,"ResumableMultiRegex")}constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(X){if(this.multiRegexes[X])return this.multiRegexes[X];let J=new K;return this.rules.slice(X).forEach(([pe,lt])=>J.addRule(pe,lt)),J.compile(),this.multiRegexes[X]=J,J}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(X,J){this.rules.push([X,J]),J.type==="begin"&&this.count++}exec(X){let J=this.getMatcher(this.regexIndex);J.lastIndex=this.lastIndex;let pe=J.exec(X);if(this.resumingScanAtSamePosition()&&!(pe&&pe.index===this.lastIndex)){let lt=this.getMatcher(0);lt.lastIndex=this.lastIndex+1,pe=lt.exec(X)}return pe&&(this.regexIndex+=pe.position+1,this.regexIndex===this.count&&this.considerAll()),pe}};function Ee(X){let J=new de;return X.contains.forEach(pe=>J.addRule(pe.begin,{rule:pe,type:"begin"})),X.terminatorEnd&&J.addRule(X.terminatorEnd,{type:"end"}),X.illegal&&J.addRule(X.illegal,{type:"illegal"}),J}l(Ee,"buildModeRegex");function Re(X,J){let pe=X;if(X.isCompiled)return pe;[Ne,We,nr,tt].forEach(Le=>Le(X,J)),_.compilerExtensions.forEach(Le=>Le(X,J)),X.__beforeBegin=null,[Ae,ut,yt].forEach(Le=>Le(X,J)),X.isCompiled=!0;let lt=null;return typeof X.keywords=="object"&&X.keywords.$pattern&&(X.keywords=Object.assign({},X.keywords),lt=X.keywords.$pattern,delete X.keywords.$pattern),lt=lt||/\w+/,X.keywords&&(X.keywords=tr(X.keywords,_.case_insensitive)),pe.keywordPatternRe=P(lt,!0),J&&(X.begin||(X.begin=/\B|\b/),pe.beginRe=P(pe.begin),!X.end&&!X.endsWithParent&&(X.end=/\B|\b/),X.end&&(pe.endRe=P(pe.end)),pe.terminatorEnd=h(pe.end)||"",X.endsWithParent&&J.terminatorEnd&&(pe.terminatorEnd+=(X.end?"|":"")+J.terminatorEnd)),X.illegal&&(pe.illegalRe=P(X.illegal)),X.contains||(X.contains=[]),X.contains=[].concat(...X.contains.map(function(Le){return Be(Le==="self"?X:Le)})),X.contains.forEach(function(Le){Re(Le,pe)}),X.starts&&Re(X.starts,J),pe.matcher=Ee(pe),pe}if(l(Re,"compileMode"),_.compilerExtensions||(_.compilerExtensions=[]),_.contains&&_.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return _.classNameAliases=a(_.classNameAliases||{}),Re(_)}l(Lt,"compileLanguage");function rt(_){return _?_.endsWithParent||rt(_.starts):!1}l(rt,"dependencyOnParent");function Be(_){return _.variants&&!_.cachedVariants&&(_.cachedVariants=_.variants.map(function(P){return a(_,{variants:null},P)})),_.cachedVariants?_.cachedVariants:rt(_)?a(_,{starts:_.starts?a(_.starts):null}):Object.isFrozen(_)?a(_):_}l(Be,"expandOrCloneMode");var pt="11.11.1";let or=class extends Error{static{l(this,"HTMLInjectionError")}constructor(_,P){super(_),this.name="HTMLInjectionError",this.html=P}},Bt=r,wr=a,sr=Symbol("nomatch"),mr=7,gr=l(function(_){let P=Object.create(null),K=Object.create(null),de=[],Ee=!0,Re="Could not find the language '{}', did you forget to load/include a language module?",X={disableAutodetect:!0,name:"Plain text",contains:[]},J={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function pe(H){return J.noHighlightRe.test(H)}l(pe,"shouldNotHighlight");function lt(H){let se=H.className+" ";se+=H.parentNode?H.parentNode.className:"";let ye=J.languageDetectRe.exec(se);if(ye){let $e=V(ye[1]);return $e||(jt(Re.replace("{}",ye[1])),jt("Falling back to no-highlight mode for this block.",H)),$e?ye[1]:"no-highlight"}return se.split(/\s+/).find($e=>pe($e)||V($e))}l(lt,"blockLanguage");function Le(H,se,ye){let $e="",Je="";typeof se=="object"?($e=H,ye=se.ignoreIllegals,Je=se.language):(it("10.7.0","highlight(lang, code, ...args) has been deprecated."),it("10.7.0",`Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277`),Je=H,$e=se),ye===void 0&&(ye=!0);let Ut={code:$e,language:Je};ct("before:highlight",Ut);let ir=Ut.result?Ut.result:Ht(Ut.language,Ut.code,ye);return ir.code=Ut.code,ct("after:highlight",ir),ir}l(Le,"highlight");function Ht(H,se,ye,$e){let Je=Object.create(null);function Ut(re,ie){return re.keywords[ie]}l(Ut,"keywordData");function ir(){if(!he.keywords){mt.addText(Me);return}let re=0;he.keywordPatternRe.lastIndex=0;let ie=he.keywordPatternRe.exec(Me),me="";for(;ie;){me+=Me.substring(re,ie.index);let Pe=Ke.case_insensitive?ie[0].toLowerCase():ie[0],wt=Ut(he,Pe);if(wt){let[kr,bh]=wt;if(mt.addText(me),me="",Je[Pe]=(Je[Pe]||0)+1,Je[Pe]<=mr&&(rn+=bh),kr.startsWith("_"))me+=ie[0];else{let vh=Ke.classNameAliases[kr]||kr;d(ie[0],vh)}}else me+=ie[0];re=he.keywordPatternRe.lastIndex,ie=he.keywordPatternRe.exec(Me)}me+=Me.substring(re),mt.addText(me)}l(ir,"processKeywords");function Wr(){if(Me==="")return;let re=null;if(typeof he.subLanguage=="string"){if(!P[he.subLanguage]){mt.addText(Me);return}re=Ht(he.subLanguage,Me,!0,hi[he.subLanguage]),hi[he.subLanguage]=re._top}else re=xr(Me,he.subLanguage.length?he.subLanguage:null);he.relevance>0&&(rn+=re.relevance),mt.__addSublanguage(re._emitter,re.language)}l(Wr,"processSubLanguage");function y(){he.subLanguage!=null?Wr():ir(),Me=""}l(y,"processBuffer");function d(re,ie){re!==""&&(mt.startScope(ie),mt.addText(re),mt.endScope())}l(d,"emitKeyword");function f(re,ie){let me=1,Pe=ie.length-1;for(;me<=Pe;){if(!re._emit[me]){me++;continue}let wt=Ke.classNameAliases[re[me]]||re[me],kr=ie[me];wt?d(kr,wt):(Me=kr,ir(),Me=""),me++}}l(f,"emitMultiClass");function b(re,ie){return re.scope&&typeof re.scope=="string"&&mt.openNode(Ke.classNameAliases[re.scope]||re.scope),re.beginScope&&(re.beginScope._wrap?(d(Me,Ke.classNameAliases[re.beginScope._wrap]||re.beginScope._wrap),Me=""):re.beginScope._multi&&(f(re.beginScope,ie),Me="")),he=Object.create(re,{parent:{value:he}}),he}l(b,"startNewMode");function v(re,ie,me){let Pe=$(re.endRe,me);if(Pe){if(re["on:end"]){let wt=new t(re);re["on:end"](ie,wt),wt.isMatchIgnored&&(Pe=!1)}if(Pe){for(;re.endsParent&&re.parent;)re=re.parent;return re}}if(re.endsWithParent)return v(re.parent,ie,me)}l(v,"endOfMode");function F(re){return he.matcher.regexIndex===0?(Me+=re[0],1):(So=!0,0)}l(F,"doIgnore");function Z(re){let ie=re[0],me=re.rule,Pe=new t(me),wt=[me.__beforeBegin,me["on:begin"]];for(let kr of wt)if(kr&&(kr(re,Pe),Pe.isMatchIgnored))return F(ie);return me.skip?Me+=ie:(me.excludeBegin&&(Me+=ie),y(),!me.returnBegin&&!me.excludeBegin&&(Me=ie)),b(me,re),me.returnBegin?0:ie.length}l(Z,"doBeginMatch");function Q(re){let ie=re[0],me=se.substring(re.index),Pe=v(he,re,me);if(!Pe)return sr;let wt=he;he.endScope&&he.endScope._wrap?(y(),d(ie,he.endScope._wrap)):he.endScope&&he.endScope._multi?(y(),f(he.endScope,re)):wt.skip?Me+=ie:(wt.returnEnd||wt.excludeEnd||(Me+=ie),y(),wt.excludeEnd&&(Me=ie));do he.scope&&mt.closeNode(),!he.skip&&!he.subLanguage&&(rn+=he.relevance),he=he.parent;while(he!==Pe.parent);return Pe.starts&&b(Pe.starts,re),wt.returnEnd?0:ie.length}l(Q,"doEndMatch");function ee(){let re=[];for(let ie=he;ie!==Ke;ie=ie.parent)ie.scope&&re.unshift(ie.scope);re.forEach(ie=>mt.openNode(ie))}l(ee,"processContinuations");let ne={};function qe(re,ie){let me=ie&&ie[0];if(Me+=re,me==null)return y(),0;if(ne.type==="begin"&&ie.type==="end"&&ne.index===ie.index&&me===""){if(Me+=se.slice(ie.index,ie.index+1),!Ee){let Pe=new Error(`0 width match regex (${H})`);throw Pe.languageName=H,Pe.badRule=ne.rule,Pe}return 1}if(ne=ie,ie.type==="begin")return Z(ie);if(ie.type==="illegal"&&!ye){let Pe=new Error('Illegal lexeme "'+me+'" for mode "'+(he.scope||"")+'"');throw Pe.mode=he,Pe}else if(ie.type==="end"){let Pe=Q(ie);if(Pe!==sr)return Pe}if(ie.type==="illegal"&&me==="")return Me+=` `,1;if(ko>1e5&&ko>ie.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Me+=me,me.length}l(qe,"processLexeme");let Ke=V(H);if(!Ke)throw Ot(Re.replace("{}",H)),new Error('Unknown language: "'+H+'"');let qr=Lt(Ke),_o="",he=$e||qr,hi={},mt=new J.__emitter(J);ee();let Me="",rn=0,Kr=0,ko=0,So=!1;try{if(Ke.__emitTokens)Ke.__emitTokens(se,mt);else{for(he.matcher.considerAll();;){ko++,So?So=!1:he.matcher.considerAll(),he.matcher.lastIndex=Kr;let re=he.matcher.exec(se);if(!re)break;let ie=se.substring(Kr,re.index),me=qe(ie,re);Kr=re.index+me}qe(se.substring(Kr))}return mt.finalize(),_o=mt.toHTML(),{language:H,value:_o,relevance:rn,illegal:!1,_emitter:mt,_top:he}}catch(re){if(re.message&&re.message.includes("Illegal"))return{language:H,value:Bt(se),illegal:!0,relevance:0,_illegalBy:{message:re.message,index:Kr,context:se.slice(Kr-100,Kr+100),mode:re.mode,resultSoFar:_o},_emitter:mt};if(Ee)return{language:H,value:Bt(se),illegal:!1,relevance:0,errorRaised:re,_emitter:mt,_top:he};throw re}}l(Ht,"_highlight");function Ur(H){let se={value:Bt(H),illegal:!1,relevance:0,_top:X,_emitter:new J.__emitter(J)};return se._emitter.addText(H),se}l(Ur,"justTextHighlightResult");function xr(H,se){se=se||J.languages||Object.keys(P);let ye=Ur(H),$e=se.filter(V).filter(He).map(y=>Ht(y,H,!1));$e.unshift(ye);let Je=$e.sort((y,d)=>{if(y.relevance!==d.relevance)return d.relevance-y.relevance;if(y.language&&d.language){if(V(y.language).supersetOf===d.language)return 1;if(V(d.language).supersetOf===y.language)return-1}return 0}),[Ut,ir]=Je,Wr=Ut;return Wr.secondBest=ir,Wr}l(xr,"highlightAuto");function Lr(H,se,ye){let $e=se&&K[se]||ye;H.classList.add("hljs"),H.classList.add(`language-${$e}`)}l(Lr,"updateClassName");function _r(H){let se=null,ye=lt(H);if(pe(ye))return;if(ct("before:highlightElement",{el:H,language:ye}),H.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",H);return}if(H.children.length>0&&(J.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(H)),J.throwUnescapedHTML))throw new or("One of your code blocks includes unescaped HTML.",H.innerHTML);se=H;let $e=se.textContent,Je=ye?Le($e,{language:ye,ignoreIllegals:!0}):xr($e);H.innerHTML=Je.value,H.dataset.highlighted="yes",Lr(H,ye,Je.language),H.result={language:Je.language,re:Je.relevance,relevance:Je.relevance},Je.secondBest&&(H.secondBest={language:Je.secondBest.language,relevance:Je.secondBest.relevance}),ct("after:highlightElement",{el:H,result:Je,text:$e})}l(_r,"highlightElement");function kt(H){J=wr(J,H)}l(kt,"configure");let da=l(()=>{yr(),it("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},"initHighlighting");function Vr(){yr(),it("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}l(Vr,"initHighlightingOnLoad");let Fr=!1;function yr(){function H(){yr()}if(l(H,"boot"),document.readyState==="loading"){Fr||window.addEventListener("DOMContentLoaded",H,!1),Fr=!0;return}document.querySelectorAll(J.cssSelector).forEach(_r)}l(yr,"highlightAll");function ua(H,se){let ye=null;try{ye=se(_)}catch($e){if(Ot("Language definition for '{}' could not be registered.".replace("{}",H)),Ee)Ot($e);else throw $e;ye=X}ye.name||(ye.name=H),P[H]=ye,ye.rawDefinition=se.bind(null,_),ye.aliases&&we(ye.aliases,{languageName:H})}l(ua,"registerLanguage");function I(H){delete P[H];for(let se of Object.keys(K))K[se]===H&&delete K[se]}l(I,"unregisterLanguage");function te(){return Object.keys(P)}l(te,"listLanguages");function V(H){return H=(H||"").toLowerCase(),P[H]||P[K[H]]}l(V,"getLanguage");function we(H,{languageName:se}){typeof H=="string"&&(H=[H]),H.forEach(ye=>{K[ye.toLowerCase()]=se})}l(we,"registerAliases");function He(H){let se=V(H);return se&&!se.disableAutodetect}l(He,"autoDetection");function ze(H){H["before:highlightBlock"]&&!H["before:highlightElement"]&&(H["before:highlightElement"]=se=>{H["before:highlightBlock"](Object.assign({block:se.el},se))}),H["after:highlightBlock"]&&!H["after:highlightElement"]&&(H["after:highlightElement"]=se=>{H["after:highlightBlock"](Object.assign({block:se.el},se))})}l(ze,"upgradePluginAPI");function Mt(H){ze(H),de.push(H)}l(Mt,"addPlugin");function ft(H){let se=de.indexOf(H);se!==-1&&de.splice(se,1)}l(ft,"removePlugin");function ct(H,se){let ye=H;de.forEach(function($e){$e[ye]&&$e[ye](se)})}l(ct,"fire");function at(H){return it("10.7.0","highlightBlock will be removed entirely in v12.0"),it("10.7.0","Please use highlightElement now."),_r(H)}l(at,"deprecateHighlightBlock"),Object.assign(_,{highlight:Le,highlightAuto:xr,highlightAll:yr,highlightElement:_r,highlightBlock:at,configure:kt,initHighlighting:da,initHighlightingOnLoad:Vr,registerLanguage:ua,unregisterLanguage:I,listLanguages:te,getLanguage:V,registerAliases:we,autoDetection:He,inherit:wr,addPlugin:Mt,removePlugin:ft}),_.debugMode=function(){Ee=!1},_.safeMode=function(){Ee=!0},_.versionString=pt,_.regex={concat:w,lookahead:m,either:C,optional:x,anyNumberOfTimes:g};for(let H in Fe)typeof Fe[H]=="object"&&e(Fe[H]);return Object.assign(_,Fe),_},"HLJS"),vt=gr({});return vt.newInstance=()=>gr({}),Om=vt,vt.HighlightJS=vt,vt.default=vt,Om}l(I4,"requireCore");var mL=I4(),yu=_4(mL);function Lu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}l(Lu,"_getDefaults");var Xo=Lu();function j0(e){Xo=e}l(j0,"changeDefaults");var C4=/[&<>"']/,gL=new RegExp(C4.source,"g"),A4=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,yL=new RegExp(A4.source,"g"),bL={"&":"&","<":"<",">":">",'"':""","'":"'"},Y6=l(e=>bL[e],"getEscapeReplacement");function sa(e,t){if(t){if(C4.test(e))return e.replace(gL,Y6)}else if(A4.test(e))return e.replace(yL,Y6);return e}l(sa,"escape$1");var vL=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function T4(e){return e.replace(vL,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}l(T4,"unescape");var wL=/(^|[^\[])\^/g;function Dt(e,t){let r=typeof e=="string"?e:e.source;t=t||"";let a={replace:l((n,o)=>{let s=typeof o=="string"?o:o.source;return s=s.replace(wL,"$1"),r=r.replace(n,s),a},"replace"),getRegex:l(()=>new RegExp(r,t),"getRegex")};return a}l(Dt,"edit");function e0(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}l(e0,"cleanUrl");var Dl={exec:l(()=>null,"exec")};function t0(e,t){let r=e.replace(/\|/g,(o,s,i)=>{let c=!1,u=s;for(;--u>=0&&i[u]==="\\";)c=!c;return c?"|":" |"}),a=r.split(/ \|/),n=0;if(a[0].trim()||a.shift(),a.length>0&&!a[a.length-1].trim()&&a.pop(),t)if(a.length>t)a.splice(t);else for(;a.length{let o=n.match(/^\s+/);if(o===null)return n;let[s]=o;return s.length>=a.length?n.slice(a.length):n}).join(` `)}l($4,"indentCodeCompensation");var bu=class{static{l(this,"_Tokenizer")}options;rules;lexer;constructor(e){this.options=e||Xo}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let r=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Fs(r,` `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],a=$4(r,t[3]||"");return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:a}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(/#$/.test(r)){let a=Fs(r,"#");(this.options.pedantic||!a||/ $/.test(a))&&(r=a.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Fs(t[0],` `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=Fs(t[0],` `).split(` `),a="",n="",o=[];for(;r.length>0;){let s=!1,i=[],c;for(c=0;c/.test(r[c]))i.push(r[c]),s=!0;else if(!s)i.push(r[c]);else break;r=r.slice(c);let u=i.join(` `),p=u.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,` $1`).replace(/^ {0,3}>[ \t]?/gm,"");a=a?`${a} ${u}`:u,n=n?`${n} ${p}`:p;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,o,!0),this.lexer.state.top=h,r.length===0)break;let m=o[o.length-1];if(m?.type==="code")break;if(m?.type==="blockquote"){let g=m,x=g.raw+` `+r.join(` `),w=this.blockquote(x);o[o.length-1]=w,a=a.substring(0,a.length-g.raw.length)+w.raw,n=n.substring(0,n.length-g.text.length)+w.text;break}else if(m?.type==="list"){let g=m,x=g.raw+` `+r.join(` `),w=this.list(x);o[o.length-1]=w,a=a.substring(0,a.length-m.raw.length)+w.raw,n=n.substring(0,n.length-g.raw.length)+w.raw,r=x.substring(o[o.length-1].raw.length).split(` `);continue}}return{type:"blockquote",raw:a,tokens:o,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),a=r.length>1,n={type:"list",raw:"",ordered:a,start:a?+r.slice(0,-1):"",loose:!1,items:[]};r=a?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=a?r:"[*+-]");let o=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),s=!1;for(;e;){let i=!1,c="",u="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let p=t[2].split(` `,1)[0].replace(/^\t+/,k=>" ".repeat(3*k.length)),h=e.split(` `,1)[0],m=!p.trim(),g=0;if(this.options.pedantic?(g=2,u=p.trimStart()):m?g=t[1].length+1:(g=t[2].search(/[^ ]/),g=g>4?1:g,u=p.slice(g),g+=t[1].length),m&&/^ *$/.test(h)&&(c+=h+` `,e=e.substring(h.length+1),i=!0),!i){let k=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),C=new RegExp(`^ {0,${Math.min(3,g-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),A=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:\`\`\`|~~~)`),$=new RegExp(`^ {0,${Math.min(3,g-1)}}#`);for(;e;){let L=e.split(` `,1)[0];if(h=L,this.options.pedantic&&(h=h.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),A.test(h)||$.test(h)||k.test(h)||C.test(e))break;if(h.search(/[^ ]/)>=g||!h.trim())u+=` `+h.slice(g);else{if(m||p.search(/[^ ]/)>=4||A.test(p)||$.test(p)||C.test(p))break;u+=` `+h}!m&&!h.trim()&&(m=!0),c+=L+` `,e=e.substring(L.length+1),p=h.slice(g)}}n.loose||(s?n.loose=!0:/\n *\n *$/.test(c)&&(s=!0));let x=null,w;this.options.gfm&&(x=/^\[[ xX]\] /.exec(u),x&&(w=x[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),n.items.push({type:"list_item",raw:c,task:!!x,checked:w,loose:!1,text:u,tokens:[]}),n.raw+=c}n.items[n.items.length-1].raw=n.items[n.items.length-1].raw.trimEnd(),n.items[n.items.length-1].text=n.items[n.items.length-1].text.trimEnd(),n.raw=n.raw.trimEnd();for(let i=0;ip.type==="space"),u=c.length>0&&c.some(p=>/\n.*\n/.test(p.raw));n.loose=u}if(n.loose)for(let i=0;i$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:a,title:n}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let r=t0(t[1]),a=t[2].replace(/^\||\| *$/g,"").split("|"),n=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(` `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let s of a)/^ *-+: *$/.test(s)?o.align.push("right"):/^ *:-+: *$/.test(s)?o.align.push("center"):/^ *:-+ *$/.test(s)?o.align.push("left"):o.align.push(null);for(let s=0;s({text:i,tokens:this.lexer.inline(i),header:!1,align:o.align[c]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===` `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:sa(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&/^$/.test(r))return;let o=Fs(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=E4(t[2],"()");if(o>-1){let s=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,s).trim(),t[3]=""}}let a=t[2],n="";if(this.options.pedantic){let o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);o&&(a=o[1],n=o[3])}else n=t[3]?t[3].slice(1,-1):"";return a=a.trim(),/^$/.test(r)?a=a.slice(1):a=a.slice(1,-1)),r0(t,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let a=(r[2]||r[1]).replace(/\s+/g," "),n=t[a.toLowerCase()];if(!n){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return r0(r,n,r[0],this.lexer)}}emStrong(e,t,r=""){let a=this.rules.inline.emStrongLDelim.exec(e);if(!(!a||a[3]&&r.match(/[\p{L}\p{N}]/u))&&(!(a[1]||a[2])||!r||this.rules.inline.punctuation.exec(r))){let n=[...a[0]].length-1,o,s,i=n,c=0,u=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+n);(a=u.exec(t))!=null;){if(o=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!o)continue;if(s=[...o].length,a[3]||a[4]){i+=s;continue}else if((a[5]||a[6])&&n%3&&!((n+s)%3)){c+=s;continue}if(i-=s,i>0)continue;s=Math.min(s,s+i+c);let p=[...a[0]][0].length,h=e.slice(0,n+a.index+p+s);if(Math.min(n,s)%2){let g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}let m=h.slice(2,-2);return{type:"strong",raw:h,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(/\n/g," "),a=/[^ ]/.test(r),n=/^ /.test(r)&&/ $/.test(r);return a&&n&&(r=r.substring(1,r.length-1)),r=sa(r,!0),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let r,a;return t[2]==="@"?(r=sa(t[1]),a="mailto:"+r):(r=sa(t[1]),a=r),{type:"link",raw:t[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,a;if(t[2]==="@")r=sa(t[0]),a="mailto:"+r;else{let n;do n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(n!==t[0]);r=sa(t[0]),t[1]==="www."?a="http://"+t[0]:a=t[0]}return{type:"link",raw:t[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let r;return this.lexer.state.inRawBlock?r=t[0]:r=sa(t[0]),{type:"text",raw:t[0],text:r}}}},xL=/^(?: *(?:\n|$))+/,_L=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,kL=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ql=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,SL=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,P4=/(?:[*+-]|\d{1,9}[.)])/,O4=Dt(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,P4).replace(/blockCode/g,/ {4}/).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/).getRegex(),B0=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,IL=/^[^\n]+/,H0=/(?!\s*\])(?:\\.|[^\[\]\\])+/,CL=Dt(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",H0).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),AL=Dt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,P4).getRegex(),Mu="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",U0=/|$))/,TL=Dt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",U0).replace("tag",Mu).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),R4=Dt(B0).replace("hr",ql).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",")|<(?:script|pre|style|textarea|!--)").replace("tag",Mu).getRegex(),EL=Dt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",R4).getRegex(),V0={blockquote:EL,code:_L,def:CL,fences:kL,heading:SL,hr:ql,html:TL,lheading:O4,list:AL,newline:xL,paragraph:R4,table:Dl,text:IL},Q6=Dt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ql).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Mu).getRegex(),$L={...V0,table:Q6,paragraph:Dt(B0).replace("hr",ql).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Q6).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Mu).getRegex()},PL={...V0,html:Dt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",U0).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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Dl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Dt(B0).replace("hr",ql).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",O4).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},L4=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,OL=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,M4=/^( {2,}|\\)\n(?!\s*$)/,RL=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,NL=Dt(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Kl).getRegex(),DL=Dt("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Kl).getRegex(),zL=Dt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Kl).getRegex(),ZL=Dt(/\\([punct])/,"gu").replace(/punct/g,Kl).getRegex(),jL=Dt(/^<(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(),BL=Dt(U0).replace("(?:-->|$)","-->").getRegex(),HL=Dt("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",BL).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),vu=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,UL=Dt(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",vu).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),N4=Dt(/^!?\[(label)\]\[(ref)\]/).replace("label",vu).replace("ref",H0).getRegex(),D4=Dt(/^!?\[(ref)\](?:\[\])?/).replace("ref",H0).getRegex(),VL=Dt("reflink|nolink(?!\\()","g").replace("reflink",N4).replace("nolink",D4).getRegex(),F0={_backpedal:Dl,anyPunctuation:ZL,autolink:jL,blockSkip:ML,br:M4,code:OL,del:Dl,emStrongLDelim:NL,emStrongRDelimAst:DL,emStrongRDelimUnd:zL,escape:L4,link:UL,nolink:D4,punctuation:LL,reflink:N4,reflinkSearch:VL,tag:HL,text:RL,url:Dl},FL={...F0,link:Dt(/^!?\[(label)\]\((.*?)\)/).replace("label",vu).getRegex(),reflink:Dt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",vu).getRegex()},a0={...F0,escape:Dt(L4).replace("])","~|])").getRegex(),url:Dt(/^((?: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\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\c+" ".repeat(u.length));let n,o,s;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(i=>(n=i.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length),n.raw.length===1&&r.length>0?r[r.length-1].raw+=` `:r.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=` `+n.raw,o.text+=` `+n.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=` `+n.raw,o.text+=` `+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(s=t,this.options.extensions&&this.options.extensions.startBlock){let i=1/0,c=t.slice(1),u;this.options.extensions.startBlock.forEach(p=>{u=p.call({lexer:this},c),typeof u=="number"&&u>=0&&(i=Math.min(i,u))}),i<1/0&&i>=0&&(s=t.substring(0,i+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s))){o=r[r.length-1],a&&o?.type==="paragraph"?(o.raw+=` `+n.raw,o.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n),a=s.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&o.type==="text"?(o.raw+=` `+n.raw,o.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(t){let i="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let a,n,o,s=t,i,c,u;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,i.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(c||(u=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(p=>(a=p.call({lexer:this},t,r))?(t=t.substring(a.raw.length),r.push(a),!0):!1))){if(a=this.tokenizer.escape(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.tag(t)){t=t.substring(a.raw.length),n=r[r.length-1],n&&a.type==="text"&&n.type==="text"?(n.raw+=a.raw,n.text+=a.text):r.push(a);continue}if(a=this.tokenizer.link(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(a.raw.length),n=r[r.length-1],n&&a.type==="text"&&n.type==="text"?(n.raw+=a.raw,n.text+=a.text):r.push(a);continue}if(a=this.tokenizer.emStrong(t,s,u)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.codespan(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.br(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.del(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.autolink(t)){t=t.substring(a.raw.length),r.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(t))){t=t.substring(a.raw.length),r.push(a);continue}if(o=t,this.options.extensions&&this.options.extensions.startInline){let p=1/0,h=t.slice(1),m;this.options.extensions.startInline.forEach(g=>{m=g.call({lexer:this},h),typeof m=="number"&&m>=0&&(p=Math.min(p,m))}),p<1/0&&p>=0&&(o=t.substring(0,p+1))}if(a=this.tokenizer.inlineText(o)){t=t.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(u=a.raw.slice(-1)),c=!0,n=r[r.length-1],n&&n.type==="text"?(n.raw+=a.raw,n.text+=a.text):r.push(a);continue}if(t){let p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return r}},wu=class{static{l(this,"_Renderer")}options;parser;constructor(e){this.options=e||Xo}space(e){return""}code({text:e,lang:t,escaped:r}){let a=(t||"").match(/^\S*/)?.[0],n=e.replace(/\n$/,"")+` `;return a?'
    '+(r?n:sa(n,!0))+`
    `:"
    "+(r?n:sa(n,!0))+`
    `}blockquote({tokens:e}){return`
    ${this.parser.parse(e)}
    `}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} `}hr(e){return`
    `}list(e){let t=e.ordered,r=e.start,a="";for(let s=0;s `+a+" `}listitem(e){let t="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" "}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • `}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    `}table(e){let t="",r="";for(let n=0;n${a}`),` `+t+` `+a+`
    `}tablerow({text:e}){return` ${e} `}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+` `}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${e}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:r}){let a=this.parser.parseInline(r),n=e0(e);if(n===null)return a;e=n;let o='
    ",o}image({href:e,title:t,text:r}){let a=e0(e);if(a===null)return r;e=a;let n=`${r}{let s=n[o].flat(1/0);r=r.concat(this.walkTokens(s,t))}):n.tokens&&(r=r.concat(this.walkTokens(n.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let a={...r};if(a.async=this.defaults.async||a.async||!1,r.extensions&&(r.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let o=t.renderers[n.name];o?t.renderers[n.name]=function(...s){let i=n.renderer.apply(this,s);return i===!1&&(i=o.apply(this,s)),i}:t.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[n.level];o?o.unshift(n.tokenizer):t[n.level]=[n.tokenizer],n.start&&(n.level==="block"?t.startBlock?t.startBlock.push(n.start):t.startBlock=[n.start]:n.level==="inline"&&(t.startInline?t.startInline.push(n.start):t.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(t.childTokens[n.name]=n.childTokens)}),a.extensions=t),r.renderer){let n=this.defaults.renderer||new wu(this.defaults);for(let o in r.renderer){if(!(o in n))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let s=o,i=r.renderer[s];r.useNewRenderer||(i=this.#t(i,s,n));let c=n[s];n[s]=(...u)=>{let p=i.apply(n,u);return p===!1&&(p=c.apply(n,u)),p||""}}a.renderer=n}if(r.tokenizer){let n=this.defaults.tokenizer||new bu(this.defaults);for(let o in r.tokenizer){if(!(o in n))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let s=o,i=r.tokenizer[s],c=n[s];n[s]=(...u)=>{let p=i.apply(n,u);return p===!1&&(p=c.apply(n,u)),p}}a.tokenizer=n}if(r.hooks){let n=this.defaults.hooks||new au;for(let o in r.hooks){if(!(o in n))throw new Error(`hook '${o}' does not exist`);if(o==="options")continue;let s=o,i=r.hooks[s],c=n[s];au.passThroughHooks.has(o)?n[s]=u=>{if(this.defaults.async)return Promise.resolve(i.call(n,u)).then(h=>c.call(n,h));let p=i.call(n,u);return c.call(n,p)}:n[s]=(...u)=>{let p=i.apply(n,u);return p===!1&&(p=c.apply(n,u)),p}}a.hooks=n}if(r.walkTokens){let n=this.defaults.walkTokens,o=r.walkTokens;a.walkTokens=function(s){let i=[];return i.push(o.call(this,s)),n&&(i=i.concat(n.call(this,s))),i}}this.defaults={...this.defaults,...a}}),this}#t(e,t,r){switch(t){case"heading":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,r.parser.parseInline(a.tokens),a.depth,T4(r.parser.parseInline(a.tokens,r.parser.textRenderer)))};case"code":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,a.text,a.lang,!!a.escaped)};case"table":return function(a){if(!a.type||a.type!==t)return e.apply(this,arguments);let n="",o="";for(let i=0;i0&&u.tokens[0].type==="paragraph"?(u.tokens[0].text=g+" "+u.tokens[0].text,u.tokens[0].tokens&&u.tokens[0].tokens.length>0&&u.tokens[0].tokens[0].type==="text"&&(u.tokens[0].tokens[0].text=g+" "+u.tokens[0].tokens[0].text)):u.tokens.unshift({type:"text",text:g+" "}):m+=g+" "}m+=this.parser.parse(u.tokens,s),i+=this.listitem({type:"list_item",raw:m,text:m,task:h,checked:!!p,loose:s,tokens:u.tokens})}return e.call(this,i,n,o)};case"html":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,a.text,a.block)};case"paragraph":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,this.parser.parseInline(a.tokens))};case"escape":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,a.text)};case"link":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,a.href,a.title,this.parser.parseInline(a.tokens))};case"image":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,a.href,a.title,a.text)};case"strong":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,this.parser.parseInline(a.tokens))};case"em":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,this.parser.parseInline(a.tokens))};case"codespan":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,a.text)};case"del":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,this.parser.parseInline(a.tokens))};case"text":return function(a){return!a.type||a.type!==t?e.apply(this,arguments):e.call(this,a.text)}}return e}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return qs.lex(e,t??this.defaults)}parser(e,t){return Ks.parse(e,t??this.defaults)}#e(e,t){return(r,a)=>{let n={...a},o={...this.defaults,...n};this.defaults.async===!0&&n.async===!1&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);let s=this.#r(!!o.silent,!!o.async);if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(i=>e(i,o)).then(i=>o.hooks?o.hooks.processAllTokens(i):i).then(i=>o.walkTokens?Promise.all(this.walkTokens(i,o.walkTokens)).then(()=>i):i).then(i=>t(i,o)).then(i=>o.hooks?o.hooks.postprocess(i):i).catch(s);try{o.hooks&&(r=o.hooks.preprocess(r));let i=e(r,o);o.hooks&&(i=o.hooks.processAllTokens(i)),o.walkTokens&&this.walkTokens(i,o.walkTokens);let c=t(i,o);return o.hooks&&(c=o.hooks.postprocess(c)),c}catch(i){return s(i)}}}#r(e,t){return r=>{if(r.message+=` Please report this to https://github.com/markedjs/marked.`,e){let a="

    An error occurred:

    "+sa(r.message+"",!0)+"
    ";return t?Promise.resolve(a):a}if(t)return Promise.reject(r);throw r}}},Ko=new qL;function Wt(e,t){return Ko.parse(e,t)}l(Wt,"marked");Wt.options=Wt.setOptions=function(e){return Ko.setOptions(e),Wt.defaults=Ko.defaults,j0(Wt.defaults),Wt};Wt.getDefaults=Lu;Wt.defaults=Xo;Wt.use=function(...e){return Ko.use(...e),Wt.defaults=Ko.defaults,j0(Wt.defaults),Wt};Wt.walkTokens=function(e,t){return Ko.walkTokens(e,t)};Wt.parseInline=Ko.parseInline;Wt.Parser=Ks;Wt.parser=Ks.parse;Wt.Renderer=wu;Wt.TextRenderer=W0;Wt.Lexer=qs;Wt.lexer=qs.lex;Wt.Tokenizer=bu;Wt.Hooks=au;Wt.parse=Wt;var KL=":host{color:#838289;color:var(--text-color-secondary,#838289)}.orama-markdown-wrapper>:first-child{margin-top:0;padding-top:0}a,li,p{font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)));line-height:1.5;line-height:var(--font-line-height-md,1.5)}blockquote,ol,ul{margin:0 0 .25rem .25rem;margin:0 0 var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));padding:0 0 0 .25rem;padding:0 0 0 var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));padding-inline-start:1rem;padding-inline-start:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}blockquote{border-left:.25rem solid #dadada;border-left:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) solid var(--border-color-primary,#dadada)}p>code{margin:0 .25rem;margin:0 var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)))}pre>code{position:relative}a{color:#151515;color:var(--text-color-primary,#151515);font-weight:700;opacity:.9;text-decoration:underline}a:hover{opacity:1}.orama-markdown-pre{position:relative}.orama-markdown-code{border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)))}.orama-markdown-code-title{color:#151515;color:var(--text-color-primary,#151515);display:block;font-size:.625rem;font-size:var(--font-size-xxs,calc(10rem/var(--orama-base-font-size, 16)));opacity:.5;padding:.5rem 0;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) 0}";window.hljs=yu;Jm.addHook("afterSanitizeAttributes",e=>{"href"in e&&(e.setAttribute("target","_parent"),e.setAttribute("rel","noopener"))});var z4=Object.fromEntries(GR.map(e=>[e,{error:!1,retries:0}])),GL={html:"xml"};async function Z4(e){let t=z4[e];if(!t||t.error&&t.retries>=5)return!1;try{let r=await fetch(`https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/languages/${e}.min.js`);if(!r.ok)throw new Error(`Failed to fetch ${e} language: ${r.statusText}`);let a=await r.text();if(await new Function(a)(),!yu.getLanguage(e))throw new Error(`Even after executing grammar script, ${e} language was not registered`);return t.retries=0,t.error=!1,!0}catch{return t.error=!0,t.retries++,!1}}l(Z4,"loadLanguageAndHighlight");var j4=Jt(class extends Xt{static{l(this,"OramaMarkdown")}constructor(){super(),this.__registerHost(),this.__attachShadow(),this.chatMarkdownLinkClicked=Yt(this,"chatMarkdownLinkClicked"),this.parseMarkdown=async()=>{if(!this.content)return;let e=this.content.replace(/^[\u200B\u200C\u200D\u200E\u200F\uFEFF]/,""),t=await Wt.parse(e);this.divElement.innerHTML=Jm.sanitize(t);let r=this.markdownElement.shadowRoot.querySelectorAll(".orama-markdown-code"),a={};for(let n=0;ni.startsWith("language-")).substring(9);a[s]=!0}for(let n of Object.keys(a))Z4(n).then(()=>{let o=Wt.parse(e);this.divElement.innerHTML=Jm.sanitize(o)})}}onContentChange(){this.parseMarkdown()}handleMarkdownLinkClicked(e){let t=e.target;if(this.chatMarkdownLinkClicked.emit({text:t.innerText,href:t.href}).defaultPrevented){e.preventDefault();return}}componentDidLoad(){Wt.use({useNewRenderer:!0,renderer:{link:l(e=>{var t,r,a,n,o;let s=document.createElement("a");return s.innerHTML=(r=(t=this.chatMarkdownLinkTitle)===null||t===void 0?void 0:t.call(this,{href:e.href,text:e.text}))!==null&&r!==void 0?r:e.text,s.href=(n=(a=this.chatMarkdownLinkHref)===null||a===void 0?void 0:a.call(this,{href:e.href,text:e.text}))!==null&&n!==void 0?n:e.href,this.chatMarkdownLinkTarget&&(s.target=(o=this.chatMarkdownLinkTarget)===null||o===void 0?void 0:o.call(this,{href:e.href,text:e.text})),s.outerHTML},"link"),code:l(e=>{let t=GL[e.lang]||e.lang,r=z4[t]?t:"plaintext",a=document.createElement("pre");a.classList.add("orama-markdown-pre");let n=document.createElement("div");n.classList.add("orama-markdown-code-title"),a.appendChild(n);let o=document.createElement("code");o.classList.add("orama-markdown-code"),o.classList.add(`language-${r}`),o.classList.add("hljs"),a.appendChild(o);let s=yu.getLanguage(r);return s?(r==="plaintext"?n.innerHTML="":n.innerHTML=s.name,o.innerHTML=yu.highlight(e.text,{language:r,ignoreIllegals:!0}).value,o.dataset.highlighted="yes"):(n.innerHTML=" ",o.innerHTML=e.text),a.outerHTML},"code"),codespan:l(e=>{let t=document.createElement("code");return t.classList.add("orama-markdown-inline-code"),t.innerHTML=e.text,t.outerHTML},"codespan")}}),this.parseMarkdown()}render(){return z("host",{key:"0d9e85fa6fc920380df442ff1ef91e3fbcc0ea51"},z("link",{key:"10de293b8a30b8071a00c819c6c31968d5f48804",rel:"stylesheet",href:"https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.10.0/build/styles/atom-one-dark.min.css"}),z("div",{key:"610b83aa61a633c732e20331685c9e61cecd1a49",class:"orama-markdown-wrapper",ref:l(e=>{this.divElement=e},"ref"),onClick:l(e=>{e.target.tagName==="A"&&this.handleMarkdownLinkClicked(e)},"onClick")}))}get markdownElement(){return this}static get watchers(){return{content:["onContentChange"]}}static get style(){return KL}},[1,"orama-markdown",{content:[1],chatMarkdownLinkTitle:[16,"chat-markdown-link-title"],chatMarkdownLinkHref:[16,"chat-markdown-link-href"],chatMarkdownLinkTarget:[16,"chat-markdown-link-target"]},void 0,{content:["onContentChange"]}]);function Jo(){typeof customElements>"u"||["orama-markdown"].forEach(e=>{switch(e){case"orama-markdown":customElements.get(e)||customElements.define(e,j4);break}})}l(Jo,"defineCustomElement");var YL=Object.defineProperty,QL=Object.getOwnPropertyDescriptor,Gl=l((e,t,r,a)=>{for(var n=a>1?void 0:a?QL(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&YL(t,r,n),n},"s"),zn=class extends ur{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${zn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};zn.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);zn.styles=Pr` :host { display: contents; } `;Gl([ve({type:String,reflect:!0})],zn.prototype,"size",2);Gl([ve({type:String,reflect:!0})],zn.prototype,"weight",2);Gl([ve({type:String,reflect:!0})],zn.prototype,"color",2);Gl([ve({type:Boolean,reflect:!0})],zn.prototype,"mirrored",2);zn=Gl([Rr("ph-caret-left")],zn);var XL=".p.sc-orama-text{color:#151515;color:var(--text-color-primary,#151515);font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.5;line-height:var(--font-line-height-m,1.5);margin:0;padding:0}@media (min-width:768.02px){.p.sc-orama-text{font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)))}}.p-secondary.sc-orama-text{color:#838289;color:var(--text-color-secondary,#838289);font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.5;line-height:var(--font-line-height-m,1.5);margin:0;padding:0}@media (min-width:768.02px){.p-secondary.sc-orama-text{font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)))}}.p-tertiary.sc-orama-text{color:#99989d;color:var(--text-color-tertiary,#99989d);font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.5;line-height:var(--font-line-height-m,1.5);margin:0;padding:0}@media (min-width:768.02px){.p-tertiary.sc-orama-text{font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)))}}.span.sc-orama-text{color:#151515;color:var(--text-color-primary,#151515)}.span.sc-orama-text,.span-secondary.sc-orama-text{font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.25;line-height:var(--font-line-height-s,1.25);margin:0;padding:0}.span-secondary.sc-orama-text{color:#838289;color:var(--text-color-secondary,#838289)}.span-tertiary.sc-orama-text{color:#99989d;color:var(--text-color-tertiary,#99989d);font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.25;line-height:var(--font-line-height-s,1.25);margin:0;padding:0}.small.sc-orama-text{color:#151515;color:var(--text-color-primary,#151515)}.small.sc-orama-text,.small-secondary.sc-orama-text{font-size:.75rem;font-size:var(--font-size-xs,calc(12rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.25;line-height:var(--font-line-height-s,1.25);margin:0;padding:0}.small-secondary.sc-orama-text{color:#838289;color:var(--text-color-secondary,#838289)}.small-tertiary.sc-orama-text{color:#99989d;color:var(--text-color-tertiary,#99989d);font-size:.75rem;font-size:var(--font-size-xs,calc(12rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.25;line-height:var(--font-line-height-s,1.25);margin:0;padding:0}.text-bold.sc-orama-text{font-weight:600;font-weight:var(--font-weight-semibold,600)}.text-left.sc-orama-text{text-align:left}.text-right.sc-orama-text{text-align:right}.text-center.sc-orama-text{text-align:center}.text-inactive.sc-orama-text{color:#99989d;color:var(--text-color-inactive,#99989d)}",JL=Jt(class extends Xt{static{l(this,"OramaText")}constructor(){super(),this.__registerHost(),this.as="p",this.bold=!1,this.variant="primary"}render(){let e=this.styledAs==="span"||this.styledAs==="small"||this.styledAs==="p"?this.styledAs:this.as,t=this.as,r=["as","styled-as","class"],a=Wl(this.el,r);return z(t,Object.assign({key:"a1c41477fc4643a8fd1eba038a39117311e17a20",class:{[e]:!0,[`text-${this.align}`]:!!this.align,[`${e}-${this.variant}`]:!0,"text-inactive":!!this.inactive,"text-bold":!!this.bold,[this.class]:!!this.class}},a),z("slot",{key:"d78c56927befa49cf5f54ab77dd76c9ab3797770"}))}get el(){return this}static get style(){return XL}},[6,"orama-text",{as:[1],styledAs:[1,"styled-as"],bold:[4],class:[1],align:[1],variant:[1],inactive:[4]}]);function ja(){typeof customElements>"u"||["orama-text"].forEach(e=>{switch(e){case"orama-text":customElements.get(e)||customElements.define(e,JL);break}})}l(ja,"defineCustomElement");var eM=Object.defineProperty,tM=Object.getOwnPropertyDescriptor,Yl=l((e,t,r,a)=>{for(var n=a>1?void 0:a?tM(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&eM(t,r,n),n},"s"),Zn=class extends ur{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${Zn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};Zn.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);Zn.styles=Pr` :host { display: contents; } `;Yl([ve({type:String,reflect:!0})],Zn.prototype,"size",2);Yl([ve({type:String,reflect:!0})],Zn.prototype,"weight",2);Yl([ve({type:String,reflect:!0})],Zn.prototype,"color",2);Yl([ve({type:Boolean,reflect:!0})],Zn.prototype,"mirrored",2);Zn=Yl([Rr("ph-caret-right")],Zn);var rM=".sources-outer-wrapper{margin:0 .5rem .75rem 1rem;margin:0 var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16))) var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)));overflow:hidden;position:relative}.source-next{left:0}.carousel-arrow,.source-next{bottom:0;position:absolute;top:0}.carousel-arrow{align-items:center;border:none;color:#838289;color:var(--text-color-secondary,#838289);cursor:pointer;display:flex;font-size:1.125rem;font-size:calc(18rem/var(--orama-base-font-size, 16));height:-moz-fit-content;height:fit-content;height:100%;justify-content:center;margin-block:auto;opacity:1;padding:0 .75rem;padding:0 var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));transition:color .2s,opacity .2s;z-index:1}.carousel-arrow.hidden{opacity:0;pointer-events:none}.carousel-arrow:focus:not(.hidden),.carousel-arrow:hover:not(.hidden){color:#151515;color:var(--text-color-primary,#151515)}.carousel-arrow--prev{background:linear-gradient(-90deg,transparent,70%,#fbfbfb);background:linear-gradient(-90deg,transparent,70%,var(--background-color-primary,#fbfbfb));left:0}.carousel-arrow--next{background:linear-gradient(90deg,transparent,30%,#fbfbfb);background:linear-gradient(90deg,transparent,30%,var(--background-color-primary,#fbfbfb));right:0}.sources-wrapper{display:flex;overflow-x:auto;overflow-x:scroll;position:relative;scroll-behavior:smooth;scrollbar-width:none}.source{background:#fff;background:var(--background-color-secondary,#fff);border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)));flex-grow:0;flex-shrink:0;overflow:hidden;padding:.75rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));position:relative;text-decoration:none;width:12.1875rem;width:calc(195rem/var(--orama-base-font-size, 16))}.source .source-subtitle,.source .source-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (hover:hover){.source:hover{background:#eee9f6;background:var(--background-color-tertiary,#eee9f6);transition:background .2s ease-in-out}}.source-inner-wrapper{display:flex;padding-right:.5rem;padding-right:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));position:relative}.source-inner-wrapper:last-of-type{padding-right:1rem;padding-right:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}.sr-only{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}",$l=0,aM=Jt(class extends Xt{static{l(this,"OramaSources")}constructor(){super(),this.__registerHost(),this.__attachShadow(),this.answerSourceClick=Yt(this,"answerSourceClick"),this.sourceBaseURL="",this.linksTarget="_blank",this.linksRel="noopener noreferrer",this.isCarouselScrollAtEnd=!1,this.isCarouselScrollAtStart=!1,this.handleCarouselScroll=()=>{this.computeCarouselArrowsVisibility()},this.handleItemClick=(e,t)=>{if(this.answerSourceClick.emit({source:t}).defaultPrevented){e.preventDefault();return}if(!t?.path)throw new Error("No path found")},this.resizeObserver=new ResizeObserver(()=>{this.computeCarouselArrowsVisibility()})}buildUrl(e){if(!e)return"#";if(this.sourceBaseURL){let t=this.sourceBaseURL.replace(/\/+$/,""),r=e.replace(/^\/+/,"");return`${t}/${r}`}return e}getNextItemCarousel(e,t){for(let r=0;ro.right)return a}return null}getPreviousItemCarousel(e,t){var r;for(let a=0;a=s.left&&o.right-$l<=s.right)return(r=t[a-1])!==null&&r!==void 0?r:null;if(o.left-$ls.right)return n}return null}handleCarouselMove(e){let t=this.carouselSourceRef;if(!t)return;let r=t.getElementsByClassName("source-inner-wrapper");if(e==="forward"){let a=this.getNextItemCarousel(t,r);a&&a.scrollIntoView({behavior:"smooth",inline:"end",block:"nearest"})}else{let a=this.getPreviousItemCarousel(t,r);a&&a.scrollIntoView({behavior:"smooth",inline:"start",block:"nearest"})}}computeCarouselArrowsVisibility(){let e=this.carouselSourceRef;if(!e)return;let t=e.getElementsByClassName("source-inner-wrapper");this.isCarouselScrollAtEnd=!this.getNextItemCarousel(e,t),this.isCarouselScrollAtStart=!this.getPreviousItemCarousel(e,t)}componentDidLoad(){var e;(e=this.carouselSourceRef)===null||e===void 0||e.addEventListener("scroll",this.handleCarouselScroll),this.computeCarouselArrowsVisibility(),this.carouselSourceRef&&this.resizeObserver.observe(this.carouselSourceRef)}disconnectedCallback(){var e;(e=this.carouselSourceRef)===null||e===void 0||e.removeEventListener("scroll",this.handleCarouselScroll),this.resizeObserver.disconnect()}hasHorizontalOverflow(e){return e?e.scrollWidth>e.clientWidth:!1}render(){var e;if(!((e=this.sources)===null||e===void 0)&&e.length)return z("host",null,z("div",{class:{"sources-outer-wrapper":!0,"oveflow-decorator":this.hasHorizontalOverflow(this.carouselSourceRef)}},z("h2",{class:"sr-only"},"Sources"),z("button",{class:{"carousel-arrow carousel-arrow--prev":!0,hidden:this.isCarouselScrollAtStart},onClick:l(()=>this.handleCarouselMove("backwards"),"onClick"),type:"button"},z("ph-caret-left",null)),z("button",{class:{"carousel-arrow carousel-arrow--next":!0,hidden:this.isCarouselScrollAtEnd},onClick:l(()=>this.handleCarouselMove("forward"),"onClick"),type:"button"},z("ph-caret-right",null)),z("div",{class:"sources-wrapper",ref:l(t=>{this.carouselSourceRef=t},"ref")},this.sources.map((t,r)=>{if(t.title&&t.path||t.description&&t.path)return z("div",{class:"source-inner-wrapper",key:`source-${r}`,style:{position:"relative",display:"flex"}},z("a",{href:this.buildUrl(t.path),class:"source",target:this.linksTarget,rel:this.linksRel,id:`source-${r}`,onClick:l(a=>this.handleItemClick(a,t),"onClick")},z("orama-text",{as:"h3",styledAs:"span",class:"source-title"},t.title),z("orama-text",{as:"p",styledAs:"span",class:"source-subtitle",variant:"tertiary"},t.description)))}))))}static get style(){return rM}},[1,"orama-sources",{sources:[8],sourceBaseURL:[1,"source-base-u-r-l"],linksTarget:[1,"links-target"],linksRel:[1,"links-rel"],isCarouselScrollAtEnd:[32],isCarouselScrollAtStart:[32]}]);function ri(){typeof customElements>"u"||["orama-sources","orama-text"].forEach(e=>{switch(e){case"orama-sources":customElements.get(e)||customElements.define(e,aM);break;case"orama-text":customElements.get(e)||ja();break}})}l(ri,"defineCustomElement");var Br;(function(e){e.idle="idle",e.loading="loading",e.rendering="rendering",e.streaming="streaming",e.error="error",e.aborted="aborted",e.done="done"})(Br||(Br={}));var nM=Object.defineProperty,oM=Object.getOwnPropertyDescriptor,Ql=l((e,t,r,a)=>{for(var n=a>1?void 0:a?oM(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&nM(t,r,n),n},"o$2"),jn=class extends ur{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${jn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};jn.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);jn.styles=Pr` :host { display: contents; } `;Ql([ve({type:String,reflect:!0})],jn.prototype,"size",2);Ql([ve({type:String,reflect:!0})],jn.prototype,"weight",2);Ql([ve({type:String,reflect:!0})],jn.prototype,"color",2);Ql([ve({type:Boolean,reflect:!0})],jn.prototype,"mirrored",2);jn=Ql([Rr("ph-copy")],jn);var sM=Object.defineProperty,iM=Object.getOwnPropertyDescriptor,Xl=l((e,t,r,a)=>{for(var n=a>1?void 0:a?iM(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&sM(t,r,n),n},"o$1"),Bn=class extends ur{static{l(this,"a")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${Bn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};Bn.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);Bn.styles=Pr` :host { display: contents; } `;Xl([ve({type:String,reflect:!0})],Bn.prototype,"size",2);Xl([ve({type:String,reflect:!0})],Bn.prototype,"weight",2);Xl([ve({type:String,reflect:!0})],Bn.prototype,"color",2);Xl([ve({type:Boolean,reflect:!0})],Bn.prototype,"mirrored",2);Bn=Xl([Rr("ph-arrows-clockwise")],Bn);var lM=Object.defineProperty,cM=Object.getOwnPropertyDescriptor,Jl=l((e,t,r,a)=>{for(var n=a>1?void 0:a?cM(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&lM(t,r,n),n},"l"),Hn=class extends ur{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${Hn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};Hn.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);Hn.styles=Pr` :host { display: contents; } `;Jl([ve({type:String,reflect:!0})],Hn.prototype,"size",2);Jl([ve({type:String,reflect:!0})],Hn.prototype,"weight",2);Jl([ve({type:String,reflect:!0})],Hn.prototype,"color",2);Jl([ve({type:Boolean,reflect:!0})],Hn.prototype,"mirrored",2);Hn=Jl([Rr("ph-thumbs-down")],Hn);var dM=Object.defineProperty,uM=Object.getOwnPropertyDescriptor,ec=l((e,t,r,a)=>{for(var n=a>1?void 0:a?uM(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&dM(t,r,n),n},"o"),Un=class extends ur{static{l(this,"a")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${Un.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};Un.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);Un.styles=Pr` :host { display: contents; } `;ec([ve({type:String,reflect:!0})],Un.prototype,"size",2);ec([ve({type:String,reflect:!0})],Un.prototype,"weight",2);ec([ve({type:String,reflect:!0})],Un.prototype,"color",2);ec([ve({type:Boolean,reflect:!0})],Un.prototype,"mirrored",2);Un=ec([Rr("ph-warning")],Un);var hM=".sc-orama-chat-assistent-message-h{color:#838289;color:var(--text-color-secondary,#838289);display:block}.message-wrapper.sc-orama-chat-assistent-message{padding:.75rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}.message-error.sc-orama-chat-assistent-message,.message-wrapper.sc-orama-chat-assistent-message{background:#fff;background:var(--background-color-secondary,#fff);border-radius:.75rem;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)));margin:0 1rem;margin:0 var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}.message-error.sc-orama-chat-assistent-message{padding:1rem .5rem;padding:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16))) var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));text-align:center}.message-error.sc-orama-chat-assistent-message ph-warning.sc-orama-chat-assistent-message{color:#99989d;color:var(--text-color-inactive,#99989d);display:block}.message-actions.sc-orama-chat-assistent-message{display:flex;gap:.5rem;gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));justify-content:end;margin-top:.75rem;margin-top:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));transition:opacity .2s ease-in-out}.hidden.sc-orama-chat-assistent-message{opacity:0;pointer-events:none}.sr-only.sc-orama-chat-assistent-message{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@keyframes rotate360{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}",pM=function(e,t,r,a){var n=arguments.length,o=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(s=e[i])&&(o=(n<3?s(o):n>3?s(t,r,o):s(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o},B4=Jt(class extends Xt{static{l(this,"OramaChatAssistentMessage")}constructor(){super(),this.__registerHost(),this.isCopied=!1,this.handleCopyToClipboard=()=>{this.isCopied=!0,setTimeout(()=>this.isCopied=!1,1e3),r4(this.interaction.response)},this.isDisliked=!1,this.handleDislikeMessage=()=>{this.isDisliked=!this.isDisliked},this.handleRetryMessage=()=>{var e;(e=this.chatStore.state.chatService)===null||e===void 0||e.regenerateLatest()}}render(){return this.interaction.status==="loading"?z("div",{class:"message-wrapper"},z("orama-dots-loader",null)):this.interaction.status==="error"?z("div",{class:"message-error"},z("ph-warning",{size:16}),z("orama-text",{styledAs:"span",inactive:!0},"An error occurred while trying to search. Please try again.")):z(ta,null,z("orama-sources",{sources:this.interaction.sources,sourceBaseURL:this.chatStore.state.sourceBaseURL,linksRel:this.chatStore.state.linksRel,linksTarget:this.chatStore.state.linksTarget}),z("div",{class:"message-wrapper"},this.interaction.response?z("orama-markdown",{content:this.interaction.response,chatMarkdownLinkTitle:this.chatMarkdownLinkTitle,chatMarkdownLinkHref:this.chatMarkdownLinkHref}):z("orama-dots-loader",null),z("div",{class:{"message-actions":!0,hidden:this.interaction.status!==Br.done}},this.interaction.latest&&z("orama-button",{type:"button",variant:"icon",onClick:this.handleRetryMessage,onKeyDown:this.handleRetryMessage,"aria-label":"Retry message"},z("ph-arrows-clockwise",{size:"16px"})),z("orama-button",{type:"button",variant:"icon",onClick:this.handleCopyToClipboard,onKeyDown:this.handleCopyToClipboard,withTooltip:this.isCopied?"Copied!":void 0,"aria-label":"Copy message"},z("ph-copy",{size:"16px"})),z("orama-button",{type:"button",variant:"icon",onClick:this.handleDislikeMessage,onKeyDown:this.handleDislikeMessage,"aria-label":"Dislike message"},this.isDisliked?z("ph-thumbs-down",{weight:"fill",size:"16px"}):z("ph-thumbs-down",{size:"16px"})))))}get htmlElement(){return this}static get style(){return hM}},[2,"orama-chat-assistent-message",{interaction:[16],chatMarkdownLinkTitle:[16,"chat-markdown-link-title"],chatMarkdownLinkHref:[16,"chat-markdown-link-href"],chatMarkdownLinkTarget:[16,"chat-markdown-link-target"],isCopied:[32],isDisliked:[32]}]);pM([ro("chat")],B4.prototype,"chatStore",void 0);function tc(){typeof customElements>"u"||["orama-chat-assistent-message","orama-button","orama-dots-loader","orama-markdown","orama-sources","orama-text"].forEach(e=>{switch(e){case"orama-chat-assistent-message":customElements.get(e)||customElements.define(e,B4);break;case"orama-button":customElements.get(e)||yo();break;case"orama-dots-loader":customElements.get(e)||ti();break;case"orama-markdown":customElements.get(e)||Jo();break;case"orama-sources":customElements.get(e)||ri();break;case"orama-text":customElements.get(e)||ja();break}})}l(tc,"defineCustomElement");var Rl=class extends Error{static{l(this,"OramaClientNotInitializedError")}constructor(){super("Orama Client is not initialized")}},fM={arabic:"ar",armenian:"am",bulgarian:"bg",czech:"cz",danish:"dk",dutch:"nl",english:"en",finnish:"fi",french:"fr",german:"de",greek:"gr",hungarian:"hu",indian:"in",indonesian:"id",irish:"ie",italian:"it",lithuanian:"lt",nepali:"np",norwegian:"no",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"rs",slovenian:"ru",spanish:"es",swedish:"se",tamil:"ta",turkish:"tr",ukrainian:"uk",sanskrit:"sk"},mM=Object.keys(fM);Date.now().toString().slice(5);var X6=BigInt(1e3),J6=BigInt(1e6),ex=BigInt(1e9),Rm=65535;function H4(e,t){if(t.length\d+)\$)?(?-?\d*\.?\d*)(?[dfs])/g,function(...r){let a=r[r.length-1],{width:n,type:o,position:s}=a,i=s?t[Number.parseInt(s)-1]:t.shift(),c=n===""?0:Number.parseInt(n);switch(o){case"d":return i.toString().padStart(c,"0");case"f":{let u=i,[p,h]=n.split(".").map(m=>Number.parseFloat(m));return typeof h=="number"&&h>=0&&(u=u.toFixed(h)),typeof p=="number"&&p>=0?u.toString().padStart(c,"0"):u.toString()}case"s":return c<0?i.toString().padEnd(-c," "):i.toString().padStart(c," ");default:return i}})}l(U4,"sprintf");function V4(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}l(V4,"isInsideWebWorker");function F4(){return typeof process<"u"&&process.release&&process.release.name==="node"}l(F4,"isInsideNode");function s0(){return BigInt(Math.floor(performance.now()*1e6))}l(s0,"getNanosecondTimeViaPerformance");function q0(e){return typeof e=="number"&&(e=BigInt(e)),e{let a=t.get(r);return a!==void 0&&t.set(r,0),a===e.length})}l(W4,"intersect");function q4(e,t){let r={},a=t.length;for(let n=0;n({...r,document:{...r.document,...t.reduce((a,n)=>{let o=n.split("."),s=o.pop(),i=a;for(let c of o)i[c]=i[c]??{},i=i[c];return i[s]=null,a},r.document)}}))}l(G0,"removeVectorsFromHits");function Du(e){return Array.isArray(e)?e.some(t=>Du(t)):e?.constructor?.name==="AsyncFunction"}l(Du,"isAsyncFunction");var gM=mM.join(` - `),yM={NO_LANGUAGE_WITH_CUSTOM_TOKENIZER:"Do not pass the language option to create when using a custom tokenizer.",LANGUAGE_NOT_SUPPORTED:`Language "%s" is not supported. Supported languages are: - ${gM}`,INVALID_STEMMER_FUNCTION_TYPE:"config.stemmer property must be a function.",MISSING_STEMMER:'As of version 1.0.0 @orama/orama does not ship non English stemmers by default. To solve this, please explicitly import and specify the "%s" stemmer from the package @orama/stemmers. See https://docs.orama.com/open-source/text-analysis/stemming for more information.',CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY:"Custom stop words array must only contain strings.",UNSUPPORTED_COMPONENT:'Unsupported component "%s".',COMPONENT_MUST_BE_FUNCTION:'The component "%s" must be a function.',COMPONENT_MUST_BE_FUNCTION_OR_ARRAY_FUNCTIONS:'The component "%s" must be a function or an array of functions.',INVALID_SCHEMA_TYPE:'Unsupported schema type "%s" at "%s". Expected "string", "boolean" or "number" or array of them.',DOCUMENT_ID_MUST_BE_STRING:'Document id must be of type "string". Got "%s" instead.',DOCUMENT_ALREADY_EXISTS:'A document with id "%s" already exists.',DOCUMENT_DOES_NOT_EXIST:'A document with id "%s" does not exists.',MISSING_DOCUMENT_PROPERTY:'Missing searchable property "%s".',INVALID_DOCUMENT_PROPERTY:'Invalid document property "%s": expected "%s", got "%s"',UNKNOWN_INDEX:'Invalid property name "%s". Expected a wildcard string ("*") or array containing one of the following properties: %s',INVALID_BOOST_VALUE:"Boost value must be a number greater than, or less than 0.",INVALID_FILTER_OPERATION:"You can only use one operation per filter, you requested %d.",SCHEMA_VALIDATION_FAILURE:'Cannot insert document due schema validation failure on "%s" property.',INVALID_SORT_SCHEMA_TYPE:'Unsupported sort schema type "%s" at "%s". Expected "string" or "number".',CANNOT_SORT_BY_ARRAY:'Cannot configure sort for "%s" because it is an array (%s).',UNABLE_TO_SORT_ON_UNKNOWN_FIELD:'Unable to sort on unknown field "%s". Allowed fields: %s',SORT_DISABLED:"Sort is disabled. Please read the documentation at https://docs.oramasearch for more information.",UNKNOWN_GROUP_BY_PROPERTY:'Unknown groupBy property "%s".',INVALID_GROUP_BY_PROPERTY:'Invalid groupBy property "%s". Allowed types: "%s", but given "%s".',UNKNOWN_FILTER_PROPERTY:'Unknown filter property "%s".',INVALID_VECTOR_SIZE:'Vector size must be a number greater than 0. Got "%s" instead.',INVALID_VECTOR_VALUE:'Vector value must be a number greater than 0. Got "%s" instead.',INVALID_INPUT_VECTOR:`Property "%s" was declared as a %s-dimensional vector, but got a %s-dimensional vector instead. Input vectors must be of the size declared in the schema, as calculating similarity between vectors of different sizes can lead to unexpected results.`,WRONG_SEARCH_PROPERTY_TYPE:'Property "%s" is not searchable. Only "string" properties are searchable.',FACET_NOT_SUPPORTED:`Facet doens't support the type "%s".`,INVALID_DISTANCE_SUFFIX:'Invalid distance suffix "%s". Valid suffixes are: cm, m, km, mi, yd, ft.',INVALID_SEARCH_MODE:'Invalid search mode "%s". Valid modes are: "fulltext", "vector", "hybrid".',MISSING_VECTOR_AND_SECURE_PROXY:"No vector was provided and no secure proxy was configured. Please provide a vector or configure an Orama Secure Proxy to perform hybrid search.",MISSING_TERM:'"term" is a required parameter when performing hybrid search. Please provide a search term.',INVALID_VECTOR_INPUT:'Invalid "vector" property. Expected an object with "value" and "property" properties, but got "%s" instead.',PLUGIN_CRASHED:"A plugin crashed during initialization. Please check the error message for more information:",PLUGIN_SECURE_PROXY_NOT_FOUND:`Could not find '@orama/secure-proxy-plugin' installed in your Orama instance. Please install it before proceeding with creating an answer session. Read more at https://docs.orama.com/open-source/plugins/plugin-secure-proxy#plugin-secure-proxy `,PLUGIN_SECURE_PROXY_MISSING_CHAT_MODEL:`Could not find a chat model defined in the secure proxy plugin configuration. Please provide a chat model before proceeding with creating an answer session. Read more at https://docs.orama.com/open-source/plugins/plugin-secure-proxy#plugin-secure-proxy `,ANSWER_SESSION_LAST_MESSAGE_IS_NOT_ASSISTANT:"The last message in the session is not an assistant message. Cannot regenerate non-assistant messages.",PLUGIN_COMPONENT_CONFLICT:'The component "%s" is already defined. The plugin "%s" is trying to redefine it.'};function ya(e,...t){let r=new Error(U4(yM[e]??`Unsupported Orama Error code: ${e}`,...t));return r.code=e,"captureStackTrace"in Error.prototype&&Error.captureStackTrace(r),r}l(ya,"createError");function Y0(e,t){if(typeof t=="string"){let r=e.idToInternalId.get(t);if(r)return r;let a=e.idToInternalId.size+1;return e.idToInternalId.set(t,a),e.internalIdToId.push(t),a}return t>e.internalIdToId.length?Y0(e,t.toString()):t}l(Y0,"getInternalDocumentId");function rc(e,t){if(e.internalIdToId.length{for(let o of e)await o(t,r,a,n)})();for(let o of e)o(t,r,a,n)}l(zu,"runAfterSearch");function Zu(e,t,r,a){if(e.some(Du))return(async()=>{for(let n of e)await n(t,r,a)})();for(let n of e)n(t,r,a)}l(Zu,"runBeforeSearch");var bM=.8;function K4(e){return e.documentsStore.count(e.data.docs)}l(K4,"count");var tx="fulltext",vM="hybrid",wM="vector";function G4(e,t){return e[1]-t[1]}l(G4,"sortAsc");function Y4(e,t){return t[1]-e[1]}l(Y4,"sortDesc");function Q4(e="desc"){return e.toLowerCase()==="asc"?G4:Y4}l(Q4,"sortingPredicateBuilder");function ju(e,t,r){let a={},n=t.map(([u])=>u),o=e.documentsStore.getMultiple(e.data.docs,n),s=Object.keys(r),i=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let u of s){let p;if(i[u]==="number"){let{ranges:h}=r[u],m=h.length,g=Array.from({length:m});for(let x=0;x{for(let n of e){let o=`${n.from}-${n.to}`;r?.has(o)||a>=n.from&&a<=n.to&&(t[o]===void 0?t[o]=1:(t[o]++,r?.add(o)))}}}l(i0,"calculateNumberFacetBuilder");function l0(e,t,r){let a=t==="boolean"?"false":"";return n=>{let o=n?.toString()??a;r?.has(o)||(e[o]=(e[o]??0)+1,r?.add(o))}}l(l0,"calculateBooleanStringOrEnumFacetBuilder");var xM={reducer:l((e,t,r,a)=>(t[a]=r,t),"reducer"),getInitialValue:l(e=>Array.from({length:e}),"getInitialValue")},rx=["string","number","boolean"];function Bu(e,t,r){let a=r.properties,n=a.length,o=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let C=0;C"u")throw ya("UNKNOWN_GROUP_BY_PROPERTY",A);if(!rx.includes(o[A]))throw ya("INVALID_GROUP_BY_PROPERTY",A,rx.join(", "),o[A])}let s=t.map(([C])=>rc(e.internalDocumentIDStore,C)),i=e.documentsStore.getMultiple(e.data.docs,s),c=i.length,u=r.maxResult||Number.MAX_SAFE_INTEGER,p=[],h={};for(let C=0;C"u")continue;let B=typeof R!="boolean"?R:""+R,G=$.perValue[B]??{indexes:[],count:0};G.count>=u||(G.indexes.push(M),G.count++,$.perValue[B]=G,L.add(R))}p.push(Array.from(L)),h[A]=$}let m=Q0(p),g=m.length,x=[];for(let C=0;CO-R),L.indexes.length!==0&&x.push(L)}let w=x.length,k=Array.from({length:w});for(let C=0;C({id:s[B],score:t[B][1],document:i[B]})),M=$.reducer.bind(null,A.values),O=$.getInitialValue(A.indexes.length),R=L.reduce(M,O);k[C]={values:A.values,result:R}}return k}l(Bu,"getGroups");function Q0(e,t=0){if(t+1===e.length)return e[t].map(o=>[o]);let r=e[t],a=Q0(e,t+1),n=[];for(let o of r)for(let s of a){let i=[o];H4(i,s),n.push(i)}return n}l(Q0,"calculateCombination");function X0(e,t,r){let{term:a,properties:n}=t,o=e.data.index,s=e.caches.propertiesToSearch;if(!s){let h=e.index.getSearchablePropertiesWithTypes(o);s=e.index.getSearchableProperties(o),s=s.filter(m=>h[m].startsWith("string")),e.caches.propertiesToSearch=s}if(n&&n!=="*"){for(let h of n)if(!s.includes(h))throw ya("UNKNOWN_INDEX",h,s.join(", "));s=s.filter(h=>n.includes(h))}let i=Object.keys(t.where??{}).length>0,c;i&&(c=e.index.searchByWhereClause(o,e.tokenizer,t.where,r));let u,p=t.threshold!==void 0&&t.threshold!==null?t.threshold:1;if(a||n){let h=K4(e);u=e.index.search(o,a||"",e.tokenizer,r,s,t.exact||!1,t.tolerance||0,t.boost||{},J4(t.relevance),h,c,p)}else u=(c?Array.from(c):Object.keys(e.documentsStore.getAll(e.data.docs))).map(h=>[+h,0]);return u}l(X0,"innerFullTextSearch");function X4(e,t,r){let a=Go();function n(){let s=Object.keys(e.data.index.vectorIndexes),i=t.facets&&Object.keys(t.facets).length>0,{limit:c=10,offset:u=0,distinctOn:p,includeVectors:h=!1}=t,m=t.preflight===!0,g=X0(e,t,r);if(t.sortBy)if(typeof t.sortBy=="function"){let k=g.map(([A])=>A),C=e.documentsStore.getMultiple(e.data.docs,k).map((A,$)=>[g[$][0],g[$][1],A]);C.sort(t.sortBy),g=C.map(([A,$])=>[A,$])}else g=e.sorter.sortBy(e.data.sorting,g,t.sortBy).map(([k,C])=>[Y0(e.internalDocumentIDStore,k),C]);else g=g.sort(K0);let x;m||(x=p?i_(e,g,u,c,p):tg(e,g,u,c));let w={elapsed:{formatted:"",raw:0},hits:[],count:g.length};if(typeof x<"u"&&(w.hits=x.filter(Boolean),h||G0(w,s)),i){let k=ju(e,g,t.facets);w.facets=k}return t.groupBy&&(w.groups=Bu(e,g,t.groupBy)),w.elapsed=e.formatElapsedTime(Go()-a),w}l(n,"performSearchLogic");async function o(){e.beforeSearch&&await Zu(e.beforeSearch,e,t,r);let s=n();return e.afterSearch&&await zu(e.afterSearch,e,t,r,s),s}return l(o,"executeSearchAsync"),e.beforeSearch?.length||e.afterSearch?.length?o():n()}l(X4,"fullTextSearch");var Lm={k:1.2,b:.75,d:.5};function J4(e){let t=e??{};return t.k=t.k??Lm.k,t.b=t.b??Lm.b,t.d=t.d??Lm.d,t}l(J4,"applyDefault");function J0(e,t,r){let a=t.vector;if(a&&(!("value"in a)||!("property"in a)))throw ya("INVALID_VECTOR_INPUT",Object.keys(a).join(", "));let n=e.data.index.vectorIndexes[a.property],o=n.node.size;if(a?.value.length!==o)throw a?.property===void 0||a?.value.length===void 0?ya("INVALID_INPUT_VECTOR","undefined",o,"undefined"):ya("INVALID_INPUT_VECTOR",a.property,o,a.value.length);let s=e.data.index,i;return Object.keys(t.where??{}).length>0&&(i=e.index.searchByWhereClause(s,e.tokenizer,t.where,r)),n.node.find(a.value,t.similarity??bM,i)}l(J0,"innerVectorSearch");function e_(e,t,r="english"){let a=Go();function n(){let s=J0(e,t,r).sort(K0),i=[];t.facets&&Object.keys(t.facets).length>0&&(i=ju(e,s,t.facets));let c=t.vector.property,u=t.includeVectors??!1,p=t.limit??10,h=t.offset??0,m=Array.from({length:p});for(let w=0;w0&&(i=ju(e,s,t.facets));let c;t.groupBy&&(c=Bu(e,s,t.groupBy));let u=t.offset??0,p=t.limit??10,h=tg(e,s,u,p).filter(Boolean),m=Go(),g={count:s.length,elapsed:{raw:Number(m-a),formatted:q0(m-a)},hits:h,...i?{facets:i}:{},...c?{groups:c}:{}};if(!(t.includeVectors??!1)){let x=Object.keys(e.data.index.vectorIndexes);G0(g,x)}return g}l(n,"performSearchLogic");async function o(){e.beforeSearch&&await Zu(e.beforeSearch,e,t,r);let s=n();return e.afterSearch&&await zu(e.afterSearch,e,t,r,s),s}return l(o,"executeSearchAsync"),e.beforeSearch?.length||e.afterSearch?.length?o():n()}l(r_,"hybridSearch");function xu(e){return e[1]}l(xu,"extractScore");function a_(e){let t=Math.max.apply(Math,e.map(xu));return e.map(([r,a])=>[r,a/t])}l(a_,"minMaxScoreNormalization");function c0(e,t){return e/t}l(c0,"normalizeScore");function n_(e,t){return(r,a)=>r*e+a*t}l(n_,"hybridScoreBuilder");function o_(e,t,r,a){let n=Math.max.apply(Math,e.map(xu)),o=Math.max.apply(Math,t.map(xu)),s=a&&a.text&&a.vector,{text:i,vector:c}=s?a:s_(),u=new Map,p=e.length,h=n_(i,c);for(let g=0;gx[1]-g[1])}l(o_,"mergeAndRankResults");function s_(e){return{text:.5,vector:.5}}l(s_,"getQueryWeights");function eg(e,t,r){let a=t.mode??tx;if(a===tx)return X4(e,t,r);if(a===wM)return e_(e,t);if(a===vM)return r_(e,t);throw ya("INVALID_SEARCH_MODE",a)}l(eg,"search");function i_(e,t,r,a,n){let o=e.data.docs,s=new Map,i=[],c=new Set,u=t.length,p=0;for(let h=0;h"u")continue;let[g,x]=m;if(c.has(g))continue;let w=e.documentsStore.get(o,g),k=Nu(w,n);if(!(typeof k>"u"||s.has(k))&&(s.set(k,!0),p++,!(p<=r)&&(i.push({id:rc(e.internalDocumentIDStore,g),score:x,document:w}),c.add(g),p>=r+a)))break}return i}l(i_,"fetchDocumentsWithDistinct");function tg(e,t,r,a){let n=e.data.docs,o=Array.from({length:a}),s=new Set;for(let i=r;i"u")break;let[u,p]=c;if(!s.has(u)){let h=e.documentsStore.get(n,u);o[i]={id:rc(e.internalDocumentIDStore,u),score:p,document:h},s.add(u)}}return o}l(tg,"fetchDocuments");var _M="orama-secure-proxy",kM=class{static{l(this,"AnswerSession")}db;proxy=null;config;abortController=null;lastInteractionParams=null;chatModel=null;conversationID;messages=[];events;initPromise;state=[];constructor(e,t){this.db=e,this.config=t,this.init(),this.messages=t.initialMessages||[],this.events=t.events||{},this.conversationID=t.conversationID||this.generateRandomID()}async ask(e){await this.initPromise;let t="";for await(let r of await this.askStream(e))t+=r;return t}async askStream(e){return await this.initPromise,this.fetchAnswer(e)}abortAnswer(){this.abortController?.abort(),this.state[this.state.length-1].aborted=!0,this.triggerStateChange()}getMessages(){return this.messages}clearSession(){this.messages=[],this.state=[]}regenerateLast({stream:e=!0}){if(this.state.length===0||this.messages.length===0)throw new Error("No messages to regenerate");if(this.messages.at(-1)?.role!=="assistant")throw ya("ANSWER_SESSION_LAST_MESSAGE_IS_NOT_ASSISTANT");return this.messages.pop(),this.state.pop(),e?this.askStream(this.lastInteractionParams):this.ask(this.lastInteractionParams)}async*fetchAnswer(e){if(!this.chatModel)throw ya("PLUGIN_SECURE_PROXY_MISSING_CHAT_MODEL");this.abortController=new AbortController,this.lastInteractionParams=e;let t=this.generateRandomID();this.messages.push({role:"user",content:e.term??""}),this.state.push({interactionId:t,aborted:!1,loading:!0,query:e.term??"",response:"",sources:null,translatedQuery:null,error:!1,errorMessage:null});let r=this.state.length-1;this.addEmptyAssistantMessage(),this.triggerStateChange();try{let a=await eg(this.db,e);this.state[r].sources=a,this.triggerStateChange();for await(let n of this.proxy.chatStream({model:this.chatModel,messages:this.messages}))yield n,this.state[r].response+=n,this.messages.findLast(o=>o.role==="assistant").content+=n,this.triggerStateChange()}catch(a){a.name==="AbortError"?this.state[r].aborted=!0:(this.state[r].error=!0,this.state[r].errorMessage=a.toString()),this.triggerStateChange()}return this.state[r].loading=!1,this.triggerStateChange(),this.state[r].response}generateRandomID(e=24){return Array.from({length:e},()=>Math.floor(Math.random()*36).toString(36)).join("")}triggerStateChange(){this.events.onStateChange&&this.events.onStateChange(this.state)}async init(){let e=this;async function t(){return await e.db.plugins.find(n=>n.name===_M)}l(t,"getPlugin");let r=await t();if(!r)throw ya("PLUGIN_SECURE_PROXY_NOT_FOUND");let a=r.extra;if(this.proxy=a.proxy,this.config.systemPrompt&&this.messages.push({role:"system",content:this.config.systemPrompt}),a?.pluginParams?.chat?.model)this.chatModel=a.pluginParams.chat.model;else throw ya("PLUGIN_SECURE_PROXY_MISSING_CHAT_MODEL")}addEmptyAssistantMessage(){this.messages.push({role:"assistant",content:""})}},js={},Rn={},Yd=BigInt(2**32-1),ax=BigInt(32);function l_(e,t=!1){return t?{h:Number(e&Yd),l:Number(e>>ax&Yd)}:{h:Number(e>>ax&Yd)|0,l:Number(e&Yd)|0}}l(l_,"fromBig");function c_(e,t=!1){let r=e.length,a=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;oe<>>32-r,"rotlSH"),IM=l((e,t,r)=>t<>>32-r,"rotlSL"),CM=l((e,t,r)=>t<>>64-r,"rotlBH"),AM=l((e,t,r)=>e<>>64-r,"rotlBL");function d_(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}l(d_,"isBytes");function d0(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}l(d0,"anumber");function Ul(e,...t){if(!d_(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}l(Ul,"abytes");function u0(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}l(u0,"aexists");function u_(e,t){Ul(e);let r=t.outputLen;if(e.length>>8&65280|e>>>24&255}l(p_,"byteSwap");function f_(e){for(let t=0;te:f_;function m_(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}l(m_,"utf8ToBytes");function Hu(e){return typeof e=="string"&&(e=m_(e)),Ul(e),e}l(Hu,"toBytes");var EM=class{static{l(this,"Hash")}};function g_(e){let t=l(a=>e().update(Hu(a)).digest(),"hashC"),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}l(g_,"createHasher");function y_(e){let t=l((a,n)=>e(n).update(Hu(a)).digest(),"hashC"),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=a=>e(a),t}l(y_,"createXOFer");var $M=BigInt(0),Pl=BigInt(1),PM=BigInt(2),OM=BigInt(7),RM=BigInt(256),LM=BigInt(113),b_=[],v_=[],w_=[];for(let e=0,t=Pl,r=1,a=0;e<24;e++){[r,a]=[a,(2*r+3*a)%5],b_.push(2*(5*a+r)),v_.push((e+1)*(e+2)/2%64);let n=$M;for(let o=0;o<7;o++)t=(t<>OM)*LM)%RM,t&PM&&(n^=Pl<<(Pl<r>32?CM(e,t,r):SM(e,t,r),"rotlH"),sx=l((e,t,r)=>r>32?AM(e,t,r):IM(e,t,r),"rotlL");function ag(e,t=24){let r=new Uint32Array(10);for(let a=24-t;a<24;a++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let i=(s+8)%10,c=(s+2)%10,u=r[c],p=r[c+1],h=ox(u,p,1)^r[i],m=sx(u,p,1)^r[i+1];for(let g=0;g<50;g+=10)e[s+g]^=h,e[s+g+1]^=m}let n=e[2],o=e[3];for(let s=0;s<24;s++){let i=v_[s],c=ox(n,o,i),u=sx(n,o,i),p=b_[s];n=e[p],o=e[p+1],e[p]=c,e[p+1]=u}for(let s=0;s<50;s+=10){for(let i=0;i<10;i++)r[i]=e[s+i];for(let i=0;i<10;i++)e[s+i]^=~r[(i+2)%10]&r[(i+4)%10]}e[0]^=MM[a],e[1]^=NM[a]}rg(r)}l(ag,"keccakP");var ng=class __ extends EM{static{l(this,"Keccak")}constructor(t,r,a,n=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=r,this.outputLen=a,this.enableXOF=n,this.rounds=o,d0(a),!(0=a&&this.keccak();let s=Math.min(a-this.posOut,o-n);t.set(r.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return d0(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(u_(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,rg(this.state)}_cloneInto(t){let{blockLen:r,suffix:a,outputLen:n,rounds:o,enableXOF:s}=this;return t||(t=new __(r,a,n,s,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=a,t.outputLen=n,t.enableXOF=s,t.destroyed=this.destroyed,t}},bo=l((e,t,r)=>g_(()=>new ng(t,e,r)),"gen"),DM=bo(6,144,224/8),zM=bo(6,136,256/8),ZM=bo(6,104,384/8),jM=bo(6,72,512/8),BM=bo(1,144,224/8),HM=bo(1,136,256/8),UM=bo(1,104,384/8),VM=bo(1,72,512/8),k_=l((e,t,r)=>y_((a={})=>new ng(t,e,a.dkLen===void 0?r:a.dkLen,!0)),"genShake"),FM=k_(31,168,128/8),WM=k_(31,136,256/8),qM=Object.freeze({__proto__:null,Keccak:ng,keccakP:ag,keccak_224:BM,keccak_256:HM,keccak_384:UM,keccak_512:VM,sha3_224:DM,sha3_256:zM,sha3_384:ZM,sha3_512:jM,shake128:FM,shake256:WM}),KM=k4(qM),ix;function S_(){if(ix)return Rn;ix=1;let{sha3_512:e}=KM,t=24,r=32,a=l((x=4,w=Math.random)=>{let k="";for(;k.lengthn(e(x)).toString(36).slice(1),"hash"),s=Array.from({length:26},(x,w)=>String.fromCharCode(w+97)),i=l(x=>s[Math.floor(x()*s.length)],"randomLetter"),c=l(({globalObj:x=typeof K6<"u"?K6:typeof window<"u"?window:{},random:w=Math.random}={})=>{let k=Object.keys(x).toString(),C=k.length?k+a(r,w):a(r,w);return o(C).substring(0,r)},"createFingerprint"),u=l(x=>()=>x++,"createCounter"),p=476782367,h=l(({random:x=Math.random,counter:w=u(Math.floor(x()*p)),length:k=t,fingerprint:C=c({random:x})}={})=>l(function(){let A=i(x),$=Date.now().toString(36),L=w().toString(36),M=a(k,x),O=`${$+M+L+C}`;return`${A+o(O).substring(1,k)}`},"cuid2"),"init"),m=h(),g=l((x,{minLength:w=2,maxLength:k=r}={})=>{let C=x.length,A=/^[a-z][0-9a-z]+$/;try{if(typeof x=="string"&&C>=w&&C<=k&&A.test(x))return!0}finally{}return!1},"isCuid");return Rn.getConstants=()=>({defaultLength:t,bigLength:r}),Rn.init=h,Rn.createId=m,Rn.bufToBigInt=n,Rn.createCounter=u,Rn.createFingerprint=c,Rn.isCuid=g,Rn}l(S_,"requireSrc");var lx;function I_(){if(lx)return js;lx=1;let{createId:e,init:t,getConstants:r,isCuid:a}=S_();return js.createId=e,js.init=t,js.getConstants=r,js.isCuid=a,js}l(I_,"requireCuid2");var fo=I_(),GM=class extends TransformStream{static{l(this,"EventsStreamTransformer")}constructor(){let e=new TextDecoder("utf-8",{ignoreBOM:!1}),t,r;super({start(){t="",r={data:""}},transform(a,n){let o=e.decode(a);t+=o;let s;for(;(s=/\r\n|\n|\r/.exec(t))!==null;){let i=t.substring(0,s.index);if(t=t.substring(s.index+s[0].length),i.length===0)n.enqueue(r),r={data:""};else if(!i.startsWith(":")){let c=/:/.exec(i);if(!c){r[i]="";continue}let u=i.substring(0,c.index),p=i.substring(c.index+1);r[u]=p?.replace(/^\u0020/,"")}}}})}};function h0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,a)}return r}l(h0,"ownKeys");function p0(e){for(var t=1;tog(p0(p0({},e),r)),t;function t(r,...a){let n=typeof r=="string"?[r]:r.raw,{escapeSpecialCharacters:o=Array.isArray(r)}=e,s="";for(let u=0;up[0]===" "||p[0]===" "?p.slice(u):p).join(` `)}return s=s.trim(),o&&(s=s.replace(/\\n/g,` `)),s}}l(og,"createDedent");var sg=class{static{l(this,"OramaInterface")}constructor(e){Object.defineProperty(this,"baseURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"masterAPIKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"writeAPIKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"readAPIKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.baseURL=e.baseURL,this.masterAPIKey=e.masterAPIKey,this.writeAPIKey=e.writeAPIKey,this.readAPIKey=e.readAPIKey}async request(e){let t=new URL(e.url,this.baseURL),r=new Headers;r.append("Content-Type","application/json");let a={method:e.method,headers:r};e.body&&e.method!=="GET"&&(a.body=JSON.stringify(e.body)),e.body&&e.method==="GET"&&(t.search=new URLSearchParams(e.body).toString());let n=this.getAPIKey(e.securityLevel);switch(!0){case(e.method!=="GET"&&e.securityLevel!=="read-query"):r.append("Authorization",`Bearer ${n}`);break;case(e.method==="GET"&&e.securityLevel==="master"):r.append("Authorization",`Bearer ${n}`);break;case(e.method==="GET"||e.securityLevel==="read-query"):t.searchParams.append("api-key",n);break}let o=await fetch(t.toString(),a);if(!o.ok)throw new Error(cx(` Request to "${e.url}" failed with status ${o.status}: ${await o.text()} `));return o.json()}async requestStream(e){let t=new URL(e.url,this.baseURL),r=new Headers;r.append("Content-Type","application/json");let a=this.getAPIKey(e.securityLevel);t.searchParams.append("api-key",a);let n=await fetch(t.toString(),{body:JSON.stringify(e.body),headers:r,method:e.method});if(!n.ok)throw new Error(cx(` Request to "${e.url}" failed with status ${n.status}: ${await n.text()} `));if(n.body===null)throw new Error(`Response body is null for "${e.url}"`);return n.body?.pipeThrough(new GM)}getAPIKey(e){switch(e){case"master":if(!this.masterAPIKey)throw new Error("Master API key is required for this operation");return this.masterAPIKey;case"write":if(!this.writeAPIKey)throw new Error("Write API key is required for this operation");return this.writeAPIKey;case"read":case"read-query":if(!this.readAPIKey)throw new Error("Read API key is required for this operation");return this.readAPIKey}}};function Mn(e,t=!0){try{return JSON.parse(e)}catch(r){return t||console.warn("Recovered from failed JSON parsing with error:",r),e}}l(Mn,"safeJSONParse");var YM={PERFORM_ORAMA_SEARCH:"PERFORM_ORAMA_SEARCH",OPTIMIZE_QUERY:"OPTIMIZE_QUERY",GENERATE_QUERIES:"GENERATE_QUERIES",ACTION_PLAN:"ACTION_PLAN",ASK_FOLLOWUP:"ASK_FOLLOWUP",GIVE_REPLY:"GIVE_REPLY",GET_SEGMENT:"GET_SEGMENT",GET_TRIGGER:"GET_TRIGGER",SELECT_SEGMENT_PROBABILITY:"SELECT_SEGMENT_PROBABILITY",SELECT_TRIGGER_PROBABILITY:"SELECT_TRIGGER_PROBABILITY"},QM=Object.values(YM),XM={},dx=E_(globalThis,XM);function E_(e,t){return new Proxy(e,{get(r,a,n){return a in t?t[a]:e[a]},set(r,a,n){return a in t&&delete t[a],e[a]=n,!0},deleteProperty(r,a){let n=!1;return a in t&&(delete t[a],n=!0),a in e&&(delete e[a],n=!0),n},ownKeys(r){let a=Reflect.ownKeys(e),n=Reflect.ownKeys(t),o=new Set(n);return[...a.filter(s=>!o.has(s)),...n]},defineProperty(r,a,n){return a in t&&delete t[a],Reflect.defineProperty(e,a,n),!0},getOwnPropertyDescriptor(r,a){return a in t?Reflect.getOwnPropertyDescriptor(t,a):Reflect.getOwnPropertyDescriptor(e,a)},has(r,a){return a in t||a in e}})}l(E_,"createMergeProxy");var JM=Symbol("Let zodToJsonSchema decide on which parser to use"),eN={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},tN=l(e=>({...eN,name:e}),"getDefaultOptions"),rN=l(e=>{let t=tN(e),r=[...t.basePath,t.definitionPath,t.name];return{...t,currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([a,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,a],jsonSchema:void 0}]))}},"getRefs");function ig(e,t,r,a){a?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}l(ig,"addErrorMessage");function Pt(e,t,r,a,n){e[t]=r,ig(e,t,a,n)}l(Pt,"setResponseValueAndErrors");var Xa={},Bs={},Ma={},Qd={},ux={},hx;function ac(){return hx||(hx=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0;var t;(function(n){n.assertEqual=c=>c;function o(c){}l(o,"assertIs"),n.assertIs=o;function s(c){throw new Error}l(s,"assertNever"),n.assertNever=s,n.arrayToEnum=c=>{let u={};for(let p of c)u[p]=p;return u},n.getValidEnumValues=c=>{let u=n.objectKeys(c).filter(h=>typeof c[c[h]]!="number"),p={};for(let h of u)p[h]=c[h];return n.objectValues(p)},n.objectValues=c=>n.objectKeys(c).map(function(u){return c[u]}),n.objectKeys=typeof Object.keys=="function"?c=>Object.keys(c):c=>{let u=[];for(let p in c)Object.prototype.hasOwnProperty.call(c,p)&&u.push(p);return u},n.find=(c,u)=>{for(let p of c)if(u(p))return p},n.isInteger=typeof Number.isInteger=="function"?c=>Number.isInteger(c):c=>typeof c=="number"&&isFinite(c)&&Math.floor(c)===c;function i(c,u=" | "){return c.map(p=>typeof p=="string"?`'${p}'`:p).join(u)}l(i,"joinValues"),n.joinValues=i,n.jsonStringifyReplacer=(c,u)=>typeof u=="bigint"?u.toString():u})(t||(e.util=t={}));var r;(function(n){n.mergeShapes=(o,s)=>({...o,...s})})(r||(e.objectUtil=r={})),e.ZodParsedType=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);let a=l(n=>{switch(typeof n){case"undefined":return e.ZodParsedType.undefined;case"string":return e.ZodParsedType.string;case"number":return isNaN(n)?e.ZodParsedType.nan:e.ZodParsedType.number;case"boolean":return e.ZodParsedType.boolean;case"function":return e.ZodParsedType.function;case"bigint":return e.ZodParsedType.bigint;case"symbol":return e.ZodParsedType.symbol;case"object":return Array.isArray(n)?e.ZodParsedType.array:n===null?e.ZodParsedType.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?e.ZodParsedType.promise:typeof Map<"u"&&n instanceof Map?e.ZodParsedType.map:typeof Set<"u"&&n instanceof Set?e.ZodParsedType.set:typeof Date<"u"&&n instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}},"getParsedType");e.getParsedType=a}(ux)),ux}l(ac,"requireUtil");var Ln={},px;function Uu(){if(px)return Ln;px=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.ZodError=Ln.quotelessJson=Ln.ZodIssueCode=void 0;let e=ac();Ln.ZodIssueCode=e.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);let t=l(a=>JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson");Ln.quotelessJson=t;let r=class $_ extends Error{static{l(this,"ZodError")}get errors(){return this.issues}constructor(n){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let o=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,o):this.__proto__=o,this.name="ZodError",this.issues=n}format(n){let o=n||function(c){return c.message},s={_errors:[]},i=l(c=>{for(let u of c.issues)if(u.code==="invalid_union")u.unionErrors.map(i);else if(u.code==="invalid_return_type")i(u.returnTypeError);else if(u.code==="invalid_arguments")i(u.argumentsError);else if(u.path.length===0)s._errors.push(o(u));else{let p=s,h=0;for(;ho.message){let o={},s=[];for(let i of this.issues)i.path.length>0?(o[i.path[0]]=o[i.path[0]]||[],o[i.path[0]].push(n(i))):s.push(n(i));return{formErrors:s,fieldErrors:o}}get formErrors(){return this.flatten()}};return Ln.ZodError=r,r.create=a=>new r(a),Ln}l(Uu,"requireZodError");var fx;function lg(){if(fx)return Qd;fx=1,Object.defineProperty(Qd,"__esModule",{value:!0});let e=ac(),t=Uu(),r=l((a,n)=>{let o;switch(a.code){case t.ZodIssueCode.invalid_type:a.received===e.ZodParsedType.undefined?o="Required":o=`Expected ${a.expected}, received ${a.received}`;break;case t.ZodIssueCode.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(a.expected,e.util.jsonStringifyReplacer)}`;break;case t.ZodIssueCode.unrecognized_keys:o=`Unrecognized key(s) in object: ${e.util.joinValues(a.keys,", ")}`;break;case t.ZodIssueCode.invalid_union:o="Invalid input";break;case t.ZodIssueCode.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${e.util.joinValues(a.options)}`;break;case t.ZodIssueCode.invalid_enum_value:o=`Invalid enum value. Expected ${e.util.joinValues(a.options)}, received '${a.received}'`;break;case t.ZodIssueCode.invalid_arguments:o="Invalid function arguments";break;case t.ZodIssueCode.invalid_return_type:o="Invalid function return type";break;case t.ZodIssueCode.invalid_date:o="Invalid date";break;case t.ZodIssueCode.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(o=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(o=`${o} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?o=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?o=`Invalid input: must end with "${a.validation.endsWith}"`:e.util.assertNever(a.validation):a.validation!=="regex"?o=`Invalid ${a.validation}`:o="Invalid";break;case t.ZodIssueCode.too_small:a.type==="array"?o=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?o=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?o=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?o=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:o="Invalid input";break;case t.ZodIssueCode.too_big:a.type==="array"?o=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?o=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?o=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?o=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?o=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:o="Invalid input";break;case t.ZodIssueCode.custom:o="Invalid input";break;case t.ZodIssueCode.invalid_intersection_types:o="Intersection results could not be merged";break;case t.ZodIssueCode.not_multiple_of:o=`Number must be a multiple of ${a.multipleOf}`;break;case t.ZodIssueCode.not_finite:o="Number must be finite";break;default:o=n.defaultError,e.util.assertNever(a)}return{message:o}},"errorMap");return Qd.default=r,Qd}l(lg,"requireEn");var mx;function Vu(){if(mx)return Ma;mx=1;var e=Ma&&Ma.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.getErrorMap=Ma.setErrorMap=Ma.defaultErrorMap=void 0;let t=e(lg());Ma.defaultErrorMap=t.default;let r=t.default;function a(o){r=o}l(a,"setErrorMap"),Ma.setErrorMap=a;function n(){return r}return l(n,"getErrorMap"),Ma.getErrorMap=n,Ma}l(Vu,"requireErrors");var Xd={},gx;function cg(){return gx||(gx=1,function(e){var t=Xd&&Xd.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=e.isValid=e.isDirty=e.isAborted=e.OK=e.DIRTY=e.INVALID=e.ParseStatus=e.addIssueToContext=e.EMPTY_PATH=e.makeIssue=void 0;let r=Vu(),a=t(lg()),n=l(g=>{let{data:x,path:w,errorMaps:k,issueData:C}=g,A=[...w,...C.path||[]],$={...C,path:A};if(C.message!==void 0)return{...C,path:A,message:C.message};let L="",M=k.filter(O=>!!O).slice().reverse();for(let O of M)L=O($,{data:x,defaultError:L}).message;return{...C,path:A,message:L}},"makeIssue");e.makeIssue=n,e.EMPTY_PATH=[];function o(g,x){let w=(0,r.getErrorMap)(),k=(0,e.makeIssue)({issueData:x,data:g.data,path:g.path,errorMaps:[g.common.contextualErrorMap,g.schemaErrorMap,w,w===a.default?void 0:a.default].filter(C=>!!C)});g.common.issues.push(k)}l(o,"addIssueToContext"),e.addIssueToContext=o;let s=class P_{static{l(this,"ParseStatus")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(x,w){let k=[];for(let C of w){if(C.status==="aborted")return e.INVALID;C.status==="dirty"&&x.dirty(),k.push(C.value)}return{status:x.value,value:k}}static async mergeObjectAsync(x,w){let k=[];for(let C of w){let A=await C.key,$=await C.value;k.push({key:A,value:$})}return P_.mergeObjectSync(x,k)}static mergeObjectSync(x,w){let k={};for(let C of w){let{key:A,value:$}=C;if(A.status==="aborted"||$.status==="aborted")return e.INVALID;A.status==="dirty"&&x.dirty(),$.status==="dirty"&&x.dirty(),A.value!=="__proto__"&&(typeof $.value<"u"||C.alwaysSet)&&(k[A.value]=$.value)}return{status:x.value,value:k}}};e.ParseStatus=s,e.INVALID=Object.freeze({status:"aborted"});let i=l(g=>({status:"dirty",value:g}),"DIRTY");e.DIRTY=i;let c=l(g=>({status:"valid",value:g}),"OK");e.OK=c;let u=l(g=>g.status==="aborted","isAborted");e.isAborted=u;let p=l(g=>g.status==="dirty","isDirty");e.isDirty=p;let h=l(g=>g.status==="valid","isValid");e.isValid=h;let m=l(g=>typeof Promise<"u"&&g instanceof Promise,"isAsync");e.isAsync=m}(Xd)),Xd}l(cg,"requireParseUtil");var yx={},bx;function O_(){return bx||(bx=1,Object.defineProperty(yx,"__esModule",{value:!0})),yx}l(O_,"requireTypeAliases");var q={},Ol={},vx;function R_(){if(vx)return Ol;vx=1,Object.defineProperty(Ol,"__esModule",{value:!0}),Ol.errorUtil=void 0;var e;return function(t){t.errToObj=r=>typeof r=="string"?{message:r}:r||{},t.toString=r=>typeof r=="string"?r:r?.message}(e||(Ol.errorUtil=e={})),Ol}l(R_,"requireErrorUtil");var wx;function z_(){if(wx)return q;wx=1;var e=q&&q.__classPrivateFieldGet||function(y,d,f,b){if(f==="a"&&!b)throw new TypeError("Private accessor was defined without a getter");if(typeof d=="function"?y!==d||!b:!d.has(y))throw new TypeError("Cannot read private member from an object whose class did not declare it");return f==="m"?b:f==="a"?b.call(y):b?b.value:d.get(y)},t=q&&q.__classPrivateFieldSet||function(y,d,f,b,v){if(b==="m")throw new TypeError("Private method is not writable");if(b==="a"&&!v)throw new TypeError("Private accessor was defined without a setter");if(typeof d=="function"?y!==d||!v:!d.has(y))throw new TypeError("Cannot write private member to an object whose class did not declare it");return b==="a"?v.call(y,f):v?v.value=f:d.set(y,f),f},r,a;Object.defineProperty(q,"__esModule",{value:!0}),q.boolean=q.bigint=q.array=q.any=q.coerce=q.ZodFirstPartyTypeKind=q.late=q.ZodSchema=q.Schema=q.custom=q.ZodReadonly=q.ZodPipeline=q.ZodBranded=q.BRAND=q.ZodNaN=q.ZodCatch=q.ZodDefault=q.ZodNullable=q.ZodOptional=q.ZodTransformer=q.ZodEffects=q.ZodPromise=q.ZodNativeEnum=q.ZodEnum=q.ZodLiteral=q.ZodLazy=q.ZodFunction=q.ZodSet=q.ZodMap=q.ZodRecord=q.ZodTuple=q.ZodIntersection=q.ZodDiscriminatedUnion=q.ZodUnion=q.ZodObject=q.ZodArray=q.ZodVoid=q.ZodNever=q.ZodUnknown=q.ZodAny=q.ZodNull=q.ZodUndefined=q.ZodSymbol=q.ZodDate=q.ZodBoolean=q.ZodBigInt=q.ZodNumber=q.ZodString=q.datetimeRegex=q.ZodType=void 0,q.NEVER=q.void=q.unknown=q.union=q.undefined=q.tuple=q.transformer=q.symbol=q.string=q.strictObject=q.set=q.record=q.promise=q.preprocess=q.pipeline=q.ostring=q.optional=q.onumber=q.oboolean=q.object=q.number=q.nullable=q.null=q.never=q.nativeEnum=q.nan=q.map=q.literal=q.lazy=q.intersection=q.instanceof=q.function=q.enum=q.effect=q.discriminatedUnion=q.date=void 0;let n=Vu(),o=R_(),s=cg(),i=ac(),c=Uu(),u=class{static{l(this,"ParseInputLazyPath")}constructor(y,d,f,b){this._cachedPath=[],this.parent=y,this.data=d,this._path=f,this._key=b}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},p=l((y,d)=>{if((0,s.isValid)(d))return{success:!0,data:d.value};if(!y.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let f=new c.ZodError(y.common.issues);return this._error=f,this._error}}},"handleResult");function h(y){if(!y)return{};let{errorMap:d,invalid_type_error:f,required_error:b,description:v}=y;if(d&&(f||b))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return d?{errorMap:d,description:v}:{errorMap:l((F,Z)=>{var Q,ee;let{message:ne}=y;return F.code==="invalid_enum_value"?{message:ne??Z.defaultError}:typeof Z.data>"u"?{message:(Q=ne??b)!==null&&Q!==void 0?Q:Z.defaultError}:F.code!=="invalid_type"?{message:Z.defaultError}:{message:(ee=ne??f)!==null&&ee!==void 0?ee:Z.defaultError}},"customMap"),description:v}}l(h,"processCreateParams");let m=class{static{l(this,"ZodType")}get description(){return this._def.description}_getType(y){return(0,i.getParsedType)(y.data)}_getOrReturnCtx(y,d){return d||{common:y.parent.common,data:y.data,parsedType:(0,i.getParsedType)(y.data),schemaErrorMap:this._def.errorMap,path:y.path,parent:y.parent}}_processInputParams(y){return{status:new s.ParseStatus,ctx:{common:y.parent.common,data:y.data,parsedType:(0,i.getParsedType)(y.data),schemaErrorMap:this._def.errorMap,path:y.path,parent:y.parent}}}_parseSync(y){let d=this._parse(y);if((0,s.isAsync)(d))throw new Error("Synchronous parse encountered promise.");return d}_parseAsync(y){let d=this._parse(y);return Promise.resolve(d)}parse(y,d){let f=this.safeParse(y,d);if(f.success)return f.data;throw f.error}safeParse(y,d){var f;let b={common:{issues:[],async:(f=d?.async)!==null&&f!==void 0?f:!1,contextualErrorMap:d?.errorMap},path:d?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:y,parsedType:(0,i.getParsedType)(y)},v=this._parseSync({data:y,path:b.path,parent:b});return p(b,v)}"~validate"(y){var d,f;let b={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:y,parsedType:(0,i.getParsedType)(y)};if(!this["~standard"].async)try{let v=this._parseSync({data:y,path:[],parent:b});return(0,s.isValid)(v)?{value:v.value}:{issues:b.common.issues}}catch(v){!((f=(d=v?.message)===null||d===void 0?void 0:d.toLowerCase())===null||f===void 0)&&f.includes("encountered")&&(this["~standard"].async=!0),b.common={issues:[],async:!0}}return this._parseAsync({data:y,path:[],parent:b}).then(v=>(0,s.isValid)(v)?{value:v.value}:{issues:b.common.issues})}async parseAsync(y,d){let f=await this.safeParseAsync(y,d);if(f.success)return f.data;throw f.error}async safeParseAsync(y,d){let f={common:{issues:[],contextualErrorMap:d?.errorMap,async:!0},path:d?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:y,parsedType:(0,i.getParsedType)(y)},b=this._parse({data:y,path:f.path,parent:f}),v=await((0,s.isAsync)(b)?b:Promise.resolve(b));return p(f,v)}refine(y,d){let f=l(b=>typeof d=="string"||typeof d>"u"?{message:d}:typeof d=="function"?d(b):d,"getIssueProperties");return this._refinement((b,v)=>{let F=y(b),Z=l(()=>v.addIssue({code:c.ZodIssueCode.custom,...f(b)}),"setError");return typeof Promise<"u"&&F instanceof Promise?F.then(Q=>Q?!0:(Z(),!1)):F?!0:(Z(),!1)})}refinement(y,d){return this._refinement((f,b)=>y(f)?!0:(b.addIssue(typeof d=="function"?d(f,b):d),!1))}_refinement(y){return new rt({schema:this,typeName:P.ZodEffects,effect:{type:"refinement",refinement:y}})}superRefine(y){return this._refinement(y)}constructor(y){this.spa=this.safeParseAsync,this._def=y,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:l(d=>this["~validate"](d),"validate")}}optional(){return Be.create(this,this._def)}nullable(){return pt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return We.create(this)}promise(){return Lt.create(this,this._def)}or(y){return bt.create([this,y],this._def)}and(y){return rr.create(this,y,this._def)}transform(y){return new rt({...h(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:y}})}default(y){let d=typeof y=="function"?y:()=>y;return new or({...h(this._def),innerType:this,defaultValue:d,typeName:P.ZodDefault})}brand(){return new sr({typeName:P.ZodBranded,type:this,...h(this._def)})}catch(y){let d=typeof y=="function"?y:()=>y;return new Bt({...h(this._def),innerType:this,catchValue:d,typeName:P.ZodCatch})}describe(y){let d=this.constructor;return new d({...this._def,description:y})}pipe(y){return mr.create(this,y)}readonly(){return gr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};q.ZodType=m,q.Schema=m,q.ZodSchema=m;let g=/^c[^\s-]{8,}$/i,x=/^[0-9a-z]+$/,w=/^[0-9A-HJKMNP-TV-Z]{26}$/i,k=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,C=/^[a-z0-9_-]{21}$/i,A=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,L=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,M="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",O,R=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,B=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,G=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,j=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,N=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,T=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,U="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ae=new RegExp(`^${U}$`);function oe(y){let d="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return y.precision?d=`${d}\\.\\d{${y.precision}}`:y.precision==null&&(d=`${d}(\\.\\d+)?`),d}l(oe,"timeRegexSource");function ue(y){return new RegExp(`^${oe(y)}$`)}l(ue,"timeRegex");function ge(y){let d=`${U}T${oe(y)}`,f=[];return f.push(y.local?"Z?":"Z"),y.offset&&f.push("([+-]\\d{2}:?\\d{2})"),d=`${d}(${f.join("|")})`,new RegExp(`^${d}$`)}l(ge,"datetimeRegex"),q.datetimeRegex=ge;function fe(y,d){return!!((d==="v4"||!d)&&R.test(y)||(d==="v6"||!d)&&G.test(y))}l(fe,"isValidIP");function Ve(y,d){if(!A.test(y))return!1;try{let[f]=y.split("."),b=f.replace(/-/g,"+").replace(/_/g,"/").padEnd(f.length+(4-f.length%4)%4,"="),v=JSON.parse(atob(b));return!(typeof v!="object"||v===null||!v.typ||!v.alg||d&&v.alg!==d)}catch{return!1}}l(Ve,"isValidJWT");function gt(y,d){return!!((d==="v4"||!d)&&B.test(y)||(d==="v6"||!d)&&j.test(y))}l(gt,"isValidCidr");let Ce=class Ll extends m{static{l(this,"ZodString")}_parse(d){if(this._def.coerce&&(d.data=String(d.data)),this._getType(d)!==i.ZodParsedType.string){let v=this._getOrReturnCtx(d);return(0,s.addIssueToContext)(v,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.string,received:v.parsedType}),s.INVALID}let f=new s.ParseStatus,b;for(let v of this._def.checks)if(v.kind==="min")d.data.lengthv.value&&(b=this._getOrReturnCtx(d,b),(0,s.addIssueToContext)(b,{code:c.ZodIssueCode.too_big,maximum:v.value,type:"string",inclusive:!0,exact:!1,message:v.message}),f.dirty());else if(v.kind==="length"){let F=d.data.length>v.value,Z=d.data.lengthd.test(v),{validation:f,code:c.ZodIssueCode.invalid_string,...o.errorUtil.errToObj(b)})}_addCheck(d){return new Ll({...this._def,checks:[...this._def.checks,d]})}email(d){return this._addCheck({kind:"email",...o.errorUtil.errToObj(d)})}url(d){return this._addCheck({kind:"url",...o.errorUtil.errToObj(d)})}emoji(d){return this._addCheck({kind:"emoji",...o.errorUtil.errToObj(d)})}uuid(d){return this._addCheck({kind:"uuid",...o.errorUtil.errToObj(d)})}nanoid(d){return this._addCheck({kind:"nanoid",...o.errorUtil.errToObj(d)})}cuid(d){return this._addCheck({kind:"cuid",...o.errorUtil.errToObj(d)})}cuid2(d){return this._addCheck({kind:"cuid2",...o.errorUtil.errToObj(d)})}ulid(d){return this._addCheck({kind:"ulid",...o.errorUtil.errToObj(d)})}base64(d){return this._addCheck({kind:"base64",...o.errorUtil.errToObj(d)})}base64url(d){return this._addCheck({kind:"base64url",...o.errorUtil.errToObj(d)})}jwt(d){return this._addCheck({kind:"jwt",...o.errorUtil.errToObj(d)})}ip(d){return this._addCheck({kind:"ip",...o.errorUtil.errToObj(d)})}cidr(d){return this._addCheck({kind:"cidr",...o.errorUtil.errToObj(d)})}datetime(d){var f,b;return typeof d=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:d}):this._addCheck({kind:"datetime",precision:typeof d?.precision>"u"?null:d?.precision,offset:(f=d?.offset)!==null&&f!==void 0?f:!1,local:(b=d?.local)!==null&&b!==void 0?b:!1,...o.errorUtil.errToObj(d?.message)})}date(d){return this._addCheck({kind:"date",message:d})}time(d){return typeof d=="string"?this._addCheck({kind:"time",precision:null,message:d}):this._addCheck({kind:"time",precision:typeof d?.precision>"u"?null:d?.precision,...o.errorUtil.errToObj(d?.message)})}duration(d){return this._addCheck({kind:"duration",...o.errorUtil.errToObj(d)})}regex(d,f){return this._addCheck({kind:"regex",regex:d,...o.errorUtil.errToObj(f)})}includes(d,f){return this._addCheck({kind:"includes",value:d,position:f?.position,...o.errorUtil.errToObj(f?.message)})}startsWith(d,f){return this._addCheck({kind:"startsWith",value:d,...o.errorUtil.errToObj(f)})}endsWith(d,f){return this._addCheck({kind:"endsWith",value:d,...o.errorUtil.errToObj(f)})}min(d,f){return this._addCheck({kind:"min",value:d,...o.errorUtil.errToObj(f)})}max(d,f){return this._addCheck({kind:"max",value:d,...o.errorUtil.errToObj(f)})}length(d,f){return this._addCheck({kind:"length",value:d,...o.errorUtil.errToObj(f)})}nonempty(d){return this.min(1,o.errorUtil.errToObj(d))}trim(){return new Ll({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ll({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ll({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(d=>d.kind==="datetime")}get isDate(){return!!this._def.checks.find(d=>d.kind==="date")}get isTime(){return!!this._def.checks.find(d=>d.kind==="time")}get isDuration(){return!!this._def.checks.find(d=>d.kind==="duration")}get isEmail(){return!!this._def.checks.find(d=>d.kind==="email")}get isURL(){return!!this._def.checks.find(d=>d.kind==="url")}get isEmoji(){return!!this._def.checks.find(d=>d.kind==="emoji")}get isUUID(){return!!this._def.checks.find(d=>d.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(d=>d.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(d=>d.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(d=>d.kind==="cuid2")}get isULID(){return!!this._def.checks.find(d=>d.kind==="ulid")}get isIP(){return!!this._def.checks.find(d=>d.kind==="ip")}get isCIDR(){return!!this._def.checks.find(d=>d.kind==="cidr")}get isBase64(){return!!this._def.checks.find(d=>d.kind==="base64")}get isBase64url(){return!!this._def.checks.find(d=>d.kind==="base64url")}get minLength(){let d=null;for(let f of this._def.checks)f.kind==="min"&&(d===null||f.value>d)&&(d=f.value);return d}get maxLength(){let d=null;for(let f of this._def.checks)f.kind==="max"&&(d===null||f.value{var d;return new Ce({checks:[],typeName:P.ZodString,coerce:(d=y?.coerce)!==null&&d!==void 0?d:!1,...h(y)})};function pr(y,d){let f=(y.toString().split(".")[1]||"").length,b=(d.toString().split(".")[1]||"").length,v=f>b?f:b,F=parseInt(y.toFixed(v).replace(".","")),Z=parseInt(d.toFixed(v).replace(".",""));return F%Z/Math.pow(10,v)}l(pr,"floatSafeRemainder");let Te=class f0 extends m{static{l(this,"ZodNumber")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(d){if(this._def.coerce&&(d.data=Number(d.data)),this._getType(d)!==i.ZodParsedType.number){let v=this._getOrReturnCtx(d);return(0,s.addIssueToContext)(v,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.number,received:v.parsedType}),s.INVALID}let f,b=new s.ParseStatus;for(let v of this._def.checks)v.kind==="int"?i.util.isInteger(d.data)||(f=this._getOrReturnCtx(d,f),(0,s.addIssueToContext)(f,{code:c.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:v.message}),b.dirty()):v.kind==="min"?(v.inclusive?d.datav.value:d.data>=v.value)&&(f=this._getOrReturnCtx(d,f),(0,s.addIssueToContext)(f,{code:c.ZodIssueCode.too_big,maximum:v.value,type:"number",inclusive:v.inclusive,exact:!1,message:v.message}),b.dirty()):v.kind==="multipleOf"?pr(d.data,v.value)!==0&&(f=this._getOrReturnCtx(d,f),(0,s.addIssueToContext)(f,{code:c.ZodIssueCode.not_multiple_of,multipleOf:v.value,message:v.message}),b.dirty()):v.kind==="finite"?Number.isFinite(d.data)||(f=this._getOrReturnCtx(d,f),(0,s.addIssueToContext)(f,{code:c.ZodIssueCode.not_finite,message:v.message}),b.dirty()):i.util.assertNever(v);return{status:b.value,value:d.data}}gte(d,f){return this.setLimit("min",d,!0,o.errorUtil.toString(f))}gt(d,f){return this.setLimit("min",d,!1,o.errorUtil.toString(f))}lte(d,f){return this.setLimit("max",d,!0,o.errorUtil.toString(f))}lt(d,f){return this.setLimit("max",d,!1,o.errorUtil.toString(f))}setLimit(d,f,b,v){return new f0({...this._def,checks:[...this._def.checks,{kind:d,value:f,inclusive:b,message:o.errorUtil.toString(v)}]})}_addCheck(d){return new f0({...this._def,checks:[...this._def.checks,d]})}int(d){return this._addCheck({kind:"int",message:o.errorUtil.toString(d)})}positive(d){return this._addCheck({kind:"min",value:0,inclusive:!1,message:o.errorUtil.toString(d)})}negative(d){return this._addCheck({kind:"max",value:0,inclusive:!1,message:o.errorUtil.toString(d)})}nonpositive(d){return this._addCheck({kind:"max",value:0,inclusive:!0,message:o.errorUtil.toString(d)})}nonnegative(d){return this._addCheck({kind:"min",value:0,inclusive:!0,message:o.errorUtil.toString(d)})}multipleOf(d,f){return this._addCheck({kind:"multipleOf",value:d,message:o.errorUtil.toString(f)})}finite(d){return this._addCheck({kind:"finite",message:o.errorUtil.toString(d)})}safe(d){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:o.errorUtil.toString(d)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:o.errorUtil.toString(d)})}get minValue(){let d=null;for(let f of this._def.checks)f.kind==="min"&&(d===null||f.value>d)&&(d=f.value);return d}get maxValue(){let d=null;for(let f of this._def.checks)f.kind==="max"&&(d===null||f.valued.kind==="int"||d.kind==="multipleOf"&&i.util.isInteger(d.value))}get isFinite(){let d=null,f=null;for(let b of this._def.checks){if(b.kind==="finite"||b.kind==="int"||b.kind==="multipleOf")return!0;b.kind==="min"?(f===null||b.value>f)&&(f=b.value):b.kind==="max"&&(d===null||b.valuenew Te({checks:[],typeName:P.ZodNumber,coerce:y?.coerce||!1,...h(y)});let Ct=class m0 extends m{static{l(this,"ZodBigInt")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(d){if(this._def.coerce)try{d.data=BigInt(d.data)}catch{return this._getInvalidInput(d)}if(this._getType(d)!==i.ZodParsedType.bigint)return this._getInvalidInput(d);let f,b=new s.ParseStatus;for(let v of this._def.checks)v.kind==="min"?(v.inclusive?d.datav.value:d.data>=v.value)&&(f=this._getOrReturnCtx(d,f),(0,s.addIssueToContext)(f,{code:c.ZodIssueCode.too_big,type:"bigint",maximum:v.value,inclusive:v.inclusive,message:v.message}),b.dirty()):v.kind==="multipleOf"?d.data%v.value!==BigInt(0)&&(f=this._getOrReturnCtx(d,f),(0,s.addIssueToContext)(f,{code:c.ZodIssueCode.not_multiple_of,multipleOf:v.value,message:v.message}),b.dirty()):i.util.assertNever(v);return{status:b.value,value:d.data}}_getInvalidInput(d){let f=this._getOrReturnCtx(d);return(0,s.addIssueToContext)(f,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.bigint,received:f.parsedType}),s.INVALID}gte(d,f){return this.setLimit("min",d,!0,o.errorUtil.toString(f))}gt(d,f){return this.setLimit("min",d,!1,o.errorUtil.toString(f))}lte(d,f){return this.setLimit("max",d,!0,o.errorUtil.toString(f))}lt(d,f){return this.setLimit("max",d,!1,o.errorUtil.toString(f))}setLimit(d,f,b,v){return new m0({...this._def,checks:[...this._def.checks,{kind:d,value:f,inclusive:b,message:o.errorUtil.toString(v)}]})}_addCheck(d){return new m0({...this._def,checks:[...this._def.checks,d]})}positive(d){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:o.errorUtil.toString(d)})}negative(d){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:o.errorUtil.toString(d)})}nonpositive(d){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:o.errorUtil.toString(d)})}nonnegative(d){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:o.errorUtil.toString(d)})}multipleOf(d,f){return this._addCheck({kind:"multipleOf",value:d,message:o.errorUtil.toString(f)})}get minValue(){let d=null;for(let f of this._def.checks)f.kind==="min"&&(d===null||f.value>d)&&(d=f.value);return d}get maxValue(){let d=null;for(let f of this._def.checks)f.kind==="max"&&(d===null||f.value{var d;return new Ct({checks:[],typeName:P.ZodBigInt,coerce:(d=y?.coerce)!==null&&d!==void 0?d:!1,...h(y)})};let ke=class extends m{static{l(this,"ZodBoolean")}_parse(y){if(this._def.coerce&&(y.data=!!y.data),this._getType(y)!==i.ZodParsedType.boolean){let d=this._getOrReturnCtx(y);return(0,s.addIssueToContext)(d,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.boolean,received:d.parsedType}),s.INVALID}return(0,s.OK)(y.data)}};q.ZodBoolean=ke,ke.create=y=>new ke({typeName:P.ZodBoolean,coerce:y?.coerce||!1,...h(y)});let ht=class L_ extends m{static{l(this,"ZodDate")}_parse(d){if(this._def.coerce&&(d.data=new Date(d.data)),this._getType(d)!==i.ZodParsedType.date){let v=this._getOrReturnCtx(d);return(0,s.addIssueToContext)(v,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.date,received:v.parsedType}),s.INVALID}if(isNaN(d.data.getTime())){let v=this._getOrReturnCtx(d);return(0,s.addIssueToContext)(v,{code:c.ZodIssueCode.invalid_date}),s.INVALID}let f=new s.ParseStatus,b;for(let v of this._def.checks)v.kind==="min"?d.data.getTime()v.value&&(b=this._getOrReturnCtx(d,b),(0,s.addIssueToContext)(b,{code:c.ZodIssueCode.too_big,message:v.message,inclusive:!0,exact:!1,maximum:v.value,type:"date"}),f.dirty()):i.util.assertNever(v);return{status:f.value,value:new Date(d.data.getTime())}}_addCheck(d){return new L_({...this._def,checks:[...this._def.checks,d]})}min(d,f){return this._addCheck({kind:"min",value:d.getTime(),message:o.errorUtil.toString(f)})}max(d,f){return this._addCheck({kind:"max",value:d.getTime(),message:o.errorUtil.toString(f)})}get minDate(){let d=null;for(let f of this._def.checks)f.kind==="min"&&(d===null||f.value>d)&&(d=f.value);return d!=null?new Date(d):null}get maxDate(){let d=null;for(let f of this._def.checks)f.kind==="max"&&(d===null||f.valuenew ht({checks:[],coerce:y?.coerce||!1,typeName:P.ZodDate,...h(y)});let xe=class extends m{static{l(this,"ZodSymbol")}_parse(y){if(this._getType(y)!==i.ZodParsedType.symbol){let d=this._getOrReturnCtx(y);return(0,s.addIssueToContext)(d,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.symbol,received:d.parsedType}),s.INVALID}return(0,s.OK)(y.data)}};q.ZodSymbol=xe,xe.create=y=>new xe({typeName:P.ZodSymbol,...h(y)});let Ge=class extends m{static{l(this,"ZodUndefined")}_parse(y){if(this._getType(y)!==i.ZodParsedType.undefined){let d=this._getOrReturnCtx(y);return(0,s.addIssueToContext)(d,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.undefined,received:d.parsedType}),s.INVALID}return(0,s.OK)(y.data)}};q.ZodUndefined=Ge,Ge.create=y=>new Ge({typeName:P.ZodUndefined,...h(y)});let Fe=class extends m{static{l(this,"ZodNull")}_parse(y){if(this._getType(y)!==i.ZodParsedType.null){let d=this._getOrReturnCtx(y);return(0,s.addIssueToContext)(d,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.null,received:d.parsedType}),s.INVALID}return(0,s.OK)(y.data)}};q.ZodNull=Fe,Fe.create=y=>new Fe({typeName:P.ZodNull,...h(y)});let De=class extends m{static{l(this,"ZodAny")}constructor(){super(...arguments),this._any=!0}_parse(y){return(0,s.OK)(y.data)}};q.ZodAny=De,De.create=y=>new De({typeName:P.ZodAny,...h(y)});let Ne=class extends m{static{l(this,"ZodUnknown")}constructor(){super(...arguments),this._unknown=!0}_parse(y){return(0,s.OK)(y.data)}};q.ZodUnknown=Ne,Ne.create=y=>new Ne({typeName:P.ZodUnknown,...h(y)});let Ae=class extends m{static{l(this,"ZodNever")}_parse(y){let d=this._getOrReturnCtx(y);return(0,s.addIssueToContext)(d,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.never,received:d.parsedType}),s.INVALID}};q.ZodNever=Ae,Ae.create=y=>new Ae({typeName:P.ZodNever,...h(y)});let ut=class extends m{static{l(this,"ZodVoid")}_parse(y){if(this._getType(y)!==i.ZodParsedType.undefined){let d=this._getOrReturnCtx(y);return(0,s.addIssueToContext)(d,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.void,received:d.parsedType}),s.INVALID}return(0,s.OK)(y.data)}};q.ZodVoid=ut,ut.create=y=>new ut({typeName:P.ZodVoid,...h(y)});let We=class nu extends m{static{l(this,"ZodArray")}_parse(d){let{ctx:f,status:b}=this._processInputParams(d),v=this._def;if(f.parsedType!==i.ZodParsedType.array)return(0,s.addIssueToContext)(f,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.array,received:f.parsedType}),s.INVALID;if(v.exactLength!==null){let Z=f.data.length>v.exactLength.value,Q=f.data.lengthv.maxLength.value&&((0,s.addIssueToContext)(f,{code:c.ZodIssueCode.too_big,maximum:v.maxLength.value,type:"array",inclusive:!0,exact:!1,message:v.maxLength.message}),b.dirty()),f.common.async)return Promise.all([...f.data].map((Z,Q)=>v.type._parseAsync(new u(f,Z,f.path,Q)))).then(Z=>s.ParseStatus.mergeArray(b,Z));let F=[...f.data].map((Z,Q)=>v.type._parseSync(new u(f,Z,f.path,Q)));return s.ParseStatus.mergeArray(b,F)}get element(){return this._def.type}min(d,f){return new nu({...this._def,minLength:{value:d,message:o.errorUtil.toString(f)}})}max(d,f){return new nu({...this._def,maxLength:{value:d,message:o.errorUtil.toString(f)}})}length(d,f){return new nu({...this._def,exactLength:{value:d,message:o.errorUtil.toString(f)}})}nonempty(d){return this.min(1,d)}};q.ZodArray=We,We.create=(y,d)=>new We({type:y,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...h(d)});function yt(y){if(y instanceof tt){let d={};for(let f in y.shape){let b=y.shape[f];d[f]=Be.create(yt(b))}return new tt({...y._def,shape:l(()=>d,"shape")})}else return y instanceof We?new We({...y._def,type:yt(y.element)}):y instanceof Be?Be.create(yt(y.unwrap())):y instanceof pt?pt.create(yt(y.unwrap())):y instanceof Zt?Zt.create(y.items.map(d=>yt(d))):y}l(yt,"deepPartialify");let tt=class Da extends m{static{l(this,"ZodObject")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let d=this._def.shape(),f=i.util.objectKeys(d);return this._cached={shape:d,keys:f}}_parse(d){if(this._getType(d)!==i.ZodParsedType.object){let ee=this._getOrReturnCtx(d);return(0,s.addIssueToContext)(ee,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.object,received:ee.parsedType}),s.INVALID}let{status:f,ctx:b}=this._processInputParams(d),{shape:v,keys:F}=this._getCached(),Z=[];if(!(this._def.catchall instanceof Ae&&this._def.unknownKeys==="strip"))for(let ee in b.data)F.includes(ee)||Z.push(ee);let Q=[];for(let ee of F){let ne=v[ee],qe=b.data[ee];Q.push({key:{status:"valid",value:ee},value:ne._parse(new u(b,qe,b.path,ee)),alwaysSet:ee in b.data})}if(this._def.catchall instanceof Ae){let ee=this._def.unknownKeys;if(ee==="passthrough")for(let ne of Z)Q.push({key:{status:"valid",value:ne},value:{status:"valid",value:b.data[ne]}});else if(ee==="strict")Z.length>0&&((0,s.addIssueToContext)(b,{code:c.ZodIssueCode.unrecognized_keys,keys:Z}),f.dirty());else if(ee!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let ee=this._def.catchall;for(let ne of Z){let qe=b.data[ne];Q.push({key:{status:"valid",value:ne},value:ee._parse(new u(b,qe,b.path,ne)),alwaysSet:ne in b.data})}}return b.common.async?Promise.resolve().then(async()=>{let ee=[];for(let ne of Q){let qe=await ne.key,Ke=await ne.value;ee.push({key:qe,value:Ke,alwaysSet:ne.alwaysSet})}return ee}).then(ee=>s.ParseStatus.mergeObjectSync(f,ee)):s.ParseStatus.mergeObjectSync(f,Q)}get shape(){return this._def.shape()}strict(d){return new Da({...this._def,unknownKeys:"strict",...d!==void 0?{errorMap:l((f,b)=>{var v,F,Z,Q;let ee=(Z=(F=(v=this._def).errorMap)===null||F===void 0?void 0:F.call(v,f,b).message)!==null&&Z!==void 0?Z:b.defaultError;return f.code==="unrecognized_keys"?{message:(Q=o.errorUtil.errToObj(d).message)!==null&&Q!==void 0?Q:ee}:{message:ee}},"errorMap")}:{}})}strip(){return new Da({...this._def,unknownKeys:"strip"})}passthrough(){return new Da({...this._def,unknownKeys:"passthrough"})}extend(d){return new Da({...this._def,shape:l(()=>({...this._def.shape(),...d}),"shape")})}merge(d){return new Da({unknownKeys:d._def.unknownKeys,catchall:d._def.catchall,shape:l(()=>({...this._def.shape(),...d._def.shape()}),"shape"),typeName:P.ZodObject})}setKey(d,f){return this.augment({[d]:f})}catchall(d){return new Da({...this._def,catchall:d})}pick(d){let f={};return i.util.objectKeys(d).forEach(b=>{d[b]&&this.shape[b]&&(f[b]=this.shape[b])}),new Da({...this._def,shape:l(()=>f,"shape")})}omit(d){let f={};return i.util.objectKeys(this.shape).forEach(b=>{d[b]||(f[b]=this.shape[b])}),new Da({...this._def,shape:l(()=>f,"shape")})}deepPartial(){return yt(this)}partial(d){let f={};return i.util.objectKeys(this.shape).forEach(b=>{let v=this.shape[b];d&&!d[b]?f[b]=v:f[b]=v.optional()}),new Da({...this._def,shape:l(()=>f,"shape")})}required(d){let f={};return i.util.objectKeys(this.shape).forEach(b=>{if(d&&!d[b])f[b]=this.shape[b];else{let v=this.shape[b];for(;v instanceof Be;)v=v._def.innerType;f[b]=v}}),new Da({...this._def,shape:l(()=>f,"shape")})}keyof(){return vr(i.util.objectKeys(this.shape))}};q.ZodObject=tt,tt.create=(y,d)=>new tt({shape:l(()=>y,"shape"),unknownKeys:"strip",catchall:Ae.create(),typeName:P.ZodObject,...h(d)}),tt.strictCreate=(y,d)=>new tt({shape:l(()=>y,"shape"),unknownKeys:"strict",catchall:Ae.create(),typeName:P.ZodObject,...h(d)}),tt.lazycreate=(y,d)=>new tt({shape:y,unknownKeys:"strip",catchall:Ae.create(),typeName:P.ZodObject,...h(d)});let bt=class extends m{static{l(this,"ZodUnion")}_parse(y){let{ctx:d}=this._processInputParams(y),f=this._def.options;function b(v){for(let Z of v)if(Z.result.status==="valid")return Z.result;for(let Z of v)if(Z.result.status==="dirty")return d.common.issues.push(...Z.ctx.common.issues),Z.result;let F=v.map(Z=>new c.ZodError(Z.ctx.common.issues));return(0,s.addIssueToContext)(d,{code:c.ZodIssueCode.invalid_union,unionErrors:F}),s.INVALID}if(l(b,"handleResults"),d.common.async)return Promise.all(f.map(async v=>{let F={...d,common:{...d.common,issues:[]},parent:null};return{result:await v._parseAsync({data:d.data,path:d.path,parent:F}),ctx:F}})).then(b);{let v,F=[];for(let Q of f){let ee={...d,common:{...d.common,issues:[]},parent:null},ne=Q._parseSync({data:d.data,path:d.path,parent:ee});if(ne.status==="valid")return ne;ne.status==="dirty"&&!v&&(v={result:ne,ctx:ee}),ee.common.issues.length&&F.push(ee.common.issues)}if(v)return d.common.issues.push(...v.ctx.common.issues),v.result;let Z=F.map(Q=>new c.ZodError(Q));return(0,s.addIssueToContext)(d,{code:c.ZodIssueCode.invalid_union,unionErrors:Z}),s.INVALID}}get options(){return this._def.options}};q.ZodUnion=bt,bt.create=(y,d)=>new bt({options:y,typeName:P.ZodUnion,...h(d)});let _t=l(y=>y instanceof Kt?_t(y.schema):y instanceof rt?_t(y.innerType()):y instanceof ar?[y.value]:y instanceof Gt?y.options:y instanceof nr?i.util.objectValues(y.enum):y instanceof or?_t(y._def.innerType):y instanceof Ge?[void 0]:y instanceof Fe?[null]:y instanceof Be?[void 0,..._t(y.unwrap())]:y instanceof pt?[null,..._t(y.unwrap())]:y instanceof sr||y instanceof gr?_t(y.unwrap()):y instanceof Bt?_t(y._def.innerType):[],"getDiscriminator"),tr=class M_ extends m{static{l(this,"ZodDiscriminatedUnion")}_parse(d){let{ctx:f}=this._processInputParams(d);if(f.parsedType!==i.ZodParsedType.object)return(0,s.addIssueToContext)(f,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.object,received:f.parsedType}),s.INVALID;let b=this.discriminator,v=f.data[b],F=this.optionsMap.get(v);return F?f.common.async?F._parseAsync({data:f.data,path:f.path,parent:f}):F._parseSync({data:f.data,path:f.path,parent:f}):((0,s.addIssueToContext)(f,{code:c.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[b]}),s.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(d,f,b){let v=new Map;for(let F of f){let Z=_t(F.shape[d]);if(!Z.length)throw new Error(`A discriminator value for key \`${d}\` could not be extracted from all schema options`);for(let Q of Z){if(v.has(Q))throw new Error(`Discriminator property ${String(d)} has duplicate value ${String(Q)}`);v.set(Q,F)}}return new M_({typeName:P.ZodDiscriminatedUnion,discriminator:d,options:f,optionsMap:v,...h(b)})}};q.ZodDiscriminatedUnion=tr;function fr(y,d){let f=(0,i.getParsedType)(y),b=(0,i.getParsedType)(d);if(y===d)return{valid:!0,data:y};if(f===i.ZodParsedType.object&&b===i.ZodParsedType.object){let v=i.util.objectKeys(d),F=i.util.objectKeys(y).filter(Q=>v.indexOf(Q)!==-1),Z={...y,...d};for(let Q of F){let ee=fr(y[Q],d[Q]);if(!ee.valid)return{valid:!1};Z[Q]=ee.data}return{valid:!0,data:Z}}else if(f===i.ZodParsedType.array&&b===i.ZodParsedType.array){if(y.length!==d.length)return{valid:!1};let v=[];for(let F=0;F{if((0,s.isAborted)(v)||(0,s.isAborted)(F))return s.INVALID;let Z=fr(v.value,F.value);return Z.valid?(((0,s.isDirty)(v)||(0,s.isDirty)(F))&&d.dirty(),{status:d.value,value:Z.data}):((0,s.addIssueToContext)(f,{code:c.ZodIssueCode.invalid_intersection_types}),s.INVALID)},"handleParsed");return f.common.async?Promise.all([this._def.left._parseAsync({data:f.data,path:f.path,parent:f}),this._def.right._parseAsync({data:f.data,path:f.path,parent:f})]).then(([v,F])=>b(v,F)):b(this._def.left._parseSync({data:f.data,path:f.path,parent:f}),this._def.right._parseSync({data:f.data,path:f.path,parent:f}))}};q.ZodIntersection=rr,rr.create=(y,d,f)=>new rr({left:y,right:d,typeName:P.ZodIntersection,...h(f)});let Zt=class N_ extends m{static{l(this,"ZodTuple")}_parse(d){let{status:f,ctx:b}=this._processInputParams(d);if(b.parsedType!==i.ZodParsedType.array)return(0,s.addIssueToContext)(b,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.array,received:b.parsedType}),s.INVALID;if(b.data.lengththis._def.items.length&&((0,s.addIssueToContext)(b,{code:c.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),f.dirty());let v=[...b.data].map((F,Z)=>{let Q=this._def.items[Z]||this._def.rest;return Q?Q._parse(new u(b,F,b.path,Z)):null}).filter(F=>!!F);return b.common.async?Promise.all(v).then(F=>s.ParseStatus.mergeArray(f,F)):s.ParseStatus.mergeArray(f,v)}get items(){return this._def.items}rest(d){return new N_({...this._def,rest:d})}};q.ZodTuple=Zt,Zt.create=(y,d)=>{if(!Array.isArray(y))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zt({items:y,typeName:P.ZodTuple,rest:null,...h(d)})};let Ot=class g0 extends m{static{l(this,"ZodRecord")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(d){let{status:f,ctx:b}=this._processInputParams(d);if(b.parsedType!==i.ZodParsedType.object)return(0,s.addIssueToContext)(b,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.object,received:b.parsedType}),s.INVALID;let v=[],F=this._def.keyType,Z=this._def.valueType;for(let Q in b.data)v.push({key:F._parse(new u(b,Q,b.path,Q)),value:Z._parse(new u(b,b.data[Q],b.path,Q)),alwaysSet:Q in b.data});return b.common.async?s.ParseStatus.mergeObjectAsync(f,v):s.ParseStatus.mergeObjectSync(f,v)}get element(){return this._def.valueType}static create(d,f,b){return f instanceof m?new g0({keyType:d,valueType:f,typeName:P.ZodRecord,...h(b)}):new g0({keyType:Ce.create(),valueType:d,typeName:P.ZodRecord,...h(f)})}};q.ZodRecord=Ot;let jt=class extends m{static{l(this,"ZodMap")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(y){let{status:d,ctx:f}=this._processInputParams(y);if(f.parsedType!==i.ZodParsedType.map)return(0,s.addIssueToContext)(f,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.map,received:f.parsedType}),s.INVALID;let b=this._def.keyType,v=this._def.valueType,F=[...f.data.entries()].map(([Z,Q],ee)=>({key:b._parse(new u(f,Z,f.path,[ee,"key"])),value:v._parse(new u(f,Q,f.path,[ee,"value"]))}));if(f.common.async){let Z=new Map;return Promise.resolve().then(async()=>{for(let Q of F){let ee=await Q.key,ne=await Q.value;if(ee.status==="aborted"||ne.status==="aborted")return s.INVALID;(ee.status==="dirty"||ne.status==="dirty")&&d.dirty(),Z.set(ee.value,ne.value)}return{status:d.value,value:Z}})}else{let Z=new Map;for(let Q of F){let ee=Q.key,ne=Q.value;if(ee.status==="aborted"||ne.status==="aborted")return s.INVALID;(ee.status==="dirty"||ne.status==="dirty")&&d.dirty(),Z.set(ee.value,ne.value)}return{status:d.value,value:Z}}}};q.ZodMap=jt,jt.create=(y,d,f)=>new jt({valueType:d,keyType:y,typeName:P.ZodMap,...h(f)});let it=class y0 extends m{static{l(this,"ZodSet")}_parse(d){let{status:f,ctx:b}=this._processInputParams(d);if(b.parsedType!==i.ZodParsedType.set)return(0,s.addIssueToContext)(b,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.set,received:b.parsedType}),s.INVALID;let v=this._def;v.minSize!==null&&b.data.sizev.maxSize.value&&((0,s.addIssueToContext)(b,{code:c.ZodIssueCode.too_big,maximum:v.maxSize.value,type:"set",inclusive:!0,exact:!1,message:v.maxSize.message}),f.dirty());let F=this._def.valueType;function Z(ee){let ne=new Set;for(let qe of ee){if(qe.status==="aborted")return s.INVALID;qe.status==="dirty"&&f.dirty(),ne.add(qe.value)}return{status:f.value,value:ne}}l(Z,"finalizeSet");let Q=[...b.data.values()].map((ee,ne)=>F._parse(new u(b,ee,b.path,ne)));return b.common.async?Promise.all(Q).then(ee=>Z(ee)):Z(Q)}min(d,f){return new y0({...this._def,minSize:{value:d,message:o.errorUtil.toString(f)}})}max(d,f){return new y0({...this._def,maxSize:{value:d,message:o.errorUtil.toString(f)}})}size(d,f){return this.min(d,f).max(d,f)}nonempty(d){return this.min(1,d)}};q.ZodSet=it,it.create=(y,d)=>new it({valueType:y,minSize:null,maxSize:null,typeName:P.ZodSet,...h(d)});let Rt=class ou extends m{static{l(this,"ZodFunction")}constructor(){super(...arguments),this.validate=this.implement}_parse(d){let{ctx:f}=this._processInputParams(d);if(f.parsedType!==i.ZodParsedType.function)return(0,s.addIssueToContext)(f,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.function,received:f.parsedType}),s.INVALID;function b(Q,ee){return(0,s.makeIssue)({data:Q,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,(0,n.getErrorMap)(),n.defaultErrorMap].filter(ne=>!!ne),issueData:{code:c.ZodIssueCode.invalid_arguments,argumentsError:ee}})}l(b,"makeArgsIssue");function v(Q,ee){return(0,s.makeIssue)({data:Q,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,(0,n.getErrorMap)(),n.defaultErrorMap].filter(ne=>!!ne),issueData:{code:c.ZodIssueCode.invalid_return_type,returnTypeError:ee}})}l(v,"makeReturnsIssue");let F={errorMap:f.common.contextualErrorMap},Z=f.data;if(this._def.returns instanceof Lt){let Q=this;return(0,s.OK)(async function(...ee){let ne=new c.ZodError([]),qe=await Q._def.args.parseAsync(ee,F).catch(qr=>{throw ne.addIssue(b(ee,qr)),ne}),Ke=await Reflect.apply(Z,this,qe);return await Q._def.returns._def.type.parseAsync(Ke,F).catch(qr=>{throw ne.addIssue(v(Ke,qr)),ne})})}else{let Q=this;return(0,s.OK)(function(...ee){let ne=Q._def.args.safeParse(ee,F);if(!ne.success)throw new c.ZodError([b(ee,ne.error)]);let qe=Reflect.apply(Z,this,ne.data),Ke=Q._def.returns.safeParse(qe,F);if(!Ke.success)throw new c.ZodError([v(qe,Ke.error)]);return Ke.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...d){return new ou({...this._def,args:Zt.create(d).rest(Ne.create())})}returns(d){return new ou({...this._def,returns:d})}implement(d){return this.parse(d)}strictImplement(d){return this.parse(d)}static create(d,f,b){return new ou({args:d||Zt.create([]).rest(Ne.create()),returns:f||Ne.create(),typeName:P.ZodFunction,...h(b)})}};q.ZodFunction=Rt;let Kt=class extends m{static{l(this,"ZodLazy")}get schema(){return this._def.getter()}_parse(y){let{ctx:d}=this._processInputParams(y);return this._def.getter()._parse({data:d.data,path:d.path,parent:d})}};q.ZodLazy=Kt,Kt.create=(y,d)=>new Kt({getter:y,typeName:P.ZodLazy,...h(d)});let ar=class extends m{static{l(this,"ZodLiteral")}_parse(y){if(y.data!==this._def.value){let d=this._getOrReturnCtx(y);return(0,s.addIssueToContext)(d,{received:d.data,code:c.ZodIssueCode.invalid_literal,expected:this._def.value}),s.INVALID}return{status:"valid",value:y.data}}get value(){return this._def.value}};q.ZodLiteral=ar,ar.create=(y,d)=>new ar({value:y,typeName:P.ZodLiteral,...h(d)});function vr(y,d){return new Gt({values:y,typeName:P.ZodEnum,...h(d)})}l(vr,"createZodEnum");let Gt=class b0 extends m{static{l(this,"ZodEnum")}constructor(){super(...arguments),r.set(this,void 0)}_parse(d){if(typeof d.data!="string"){let f=this._getOrReturnCtx(d),b=this._def.values;return(0,s.addIssueToContext)(f,{expected:i.util.joinValues(b),received:f.parsedType,code:c.ZodIssueCode.invalid_type}),s.INVALID}if(e(this,r,"f")||t(this,r,new Set(this._def.values),"f"),!e(this,r,"f").has(d.data)){let f=this._getOrReturnCtx(d),b=this._def.values;return(0,s.addIssueToContext)(f,{received:f.data,code:c.ZodIssueCode.invalid_enum_value,options:b}),s.INVALID}return(0,s.OK)(d.data)}get options(){return this._def.values}get enum(){let d={};for(let f of this._def.values)d[f]=f;return d}get Values(){let d={};for(let f of this._def.values)d[f]=f;return d}get Enum(){let d={};for(let f of this._def.values)d[f]=f;return d}extract(d,f=this._def){return b0.create(d,{...this._def,...f})}exclude(d,f=this._def){return b0.create(this.options.filter(b=>!d.includes(b)),{...this._def,...f})}};q.ZodEnum=Gt,r=new WeakMap,Gt.create=vr;let nr=class extends m{static{l(this,"ZodNativeEnum")}constructor(){super(...arguments),a.set(this,void 0)}_parse(y){let d=i.util.getValidEnumValues(this._def.values),f=this._getOrReturnCtx(y);if(f.parsedType!==i.ZodParsedType.string&&f.parsedType!==i.ZodParsedType.number){let b=i.util.objectValues(d);return(0,s.addIssueToContext)(f,{expected:i.util.joinValues(b),received:f.parsedType,code:c.ZodIssueCode.invalid_type}),s.INVALID}if(e(this,a,"f")||t(this,a,new Set(i.util.getValidEnumValues(this._def.values)),"f"),!e(this,a,"f").has(y.data)){let b=i.util.objectValues(d);return(0,s.addIssueToContext)(f,{received:f.data,code:c.ZodIssueCode.invalid_enum_value,options:b}),s.INVALID}return(0,s.OK)(y.data)}get enum(){return this._def.values}};q.ZodNativeEnum=nr,a=new WeakMap,nr.create=(y,d)=>new nr({values:y,typeName:P.ZodNativeEnum,...h(d)});let Lt=class extends m{static{l(this,"ZodPromise")}unwrap(){return this._def.type}_parse(y){let{ctx:d}=this._processInputParams(y);if(d.parsedType!==i.ZodParsedType.promise&&d.common.async===!1)return(0,s.addIssueToContext)(d,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.promise,received:d.parsedType}),s.INVALID;let f=d.parsedType===i.ZodParsedType.promise?d.data:Promise.resolve(d.data);return(0,s.OK)(f.then(b=>this._def.type.parseAsync(b,{path:d.path,errorMap:d.common.contextualErrorMap})))}};q.ZodPromise=Lt,Lt.create=(y,d)=>new Lt({type:y,typeName:P.ZodPromise,...h(d)});let rt=class extends m{static{l(this,"ZodEffects")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(y){let{status:d,ctx:f}=this._processInputParams(y),b=this._def.effect||null,v={addIssue:l(F=>{(0,s.addIssueToContext)(f,F),F.fatal?d.abort():d.dirty()},"addIssue"),get path(){return f.path}};if(v.addIssue=v.addIssue.bind(v),b.type==="preprocess"){let F=b.transform(f.data,v);if(f.common.async)return Promise.resolve(F).then(async Z=>{if(d.value==="aborted")return s.INVALID;let Q=await this._def.schema._parseAsync({data:Z,path:f.path,parent:f});return Q.status==="aborted"?s.INVALID:Q.status==="dirty"||d.value==="dirty"?(0,s.DIRTY)(Q.value):Q});{if(d.value==="aborted")return s.INVALID;let Z=this._def.schema._parseSync({data:F,path:f.path,parent:f});return Z.status==="aborted"?s.INVALID:Z.status==="dirty"||d.value==="dirty"?(0,s.DIRTY)(Z.value):Z}}if(b.type==="refinement"){let F=l(Z=>{let Q=b.refinement(Z,v);if(f.common.async)return Promise.resolve(Q);if(Q instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Z},"executeRefinement");if(f.common.async===!1){let Z=this._def.schema._parseSync({data:f.data,path:f.path,parent:f});return Z.status==="aborted"?s.INVALID:(Z.status==="dirty"&&d.dirty(),F(Z.value),{status:d.value,value:Z.value})}else return this._def.schema._parseAsync({data:f.data,path:f.path,parent:f}).then(Z=>Z.status==="aborted"?s.INVALID:(Z.status==="dirty"&&d.dirty(),F(Z.value).then(()=>({status:d.value,value:Z.value}))))}if(b.type==="transform")if(f.common.async===!1){let F=this._def.schema._parseSync({data:f.data,path:f.path,parent:f});if(!(0,s.isValid)(F))return F;let Z=b.transform(F.value,v);if(Z instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:d.value,value:Z}}else return this._def.schema._parseAsync({data:f.data,path:f.path,parent:f}).then(F=>(0,s.isValid)(F)?Promise.resolve(b.transform(F.value,v)).then(Z=>({status:d.value,value:Z})):F);i.util.assertNever(b)}};q.ZodEffects=rt,q.ZodTransformer=rt,rt.create=(y,d,f)=>new rt({schema:y,typeName:P.ZodEffects,effect:d,...h(f)}),rt.createWithPreprocess=(y,d,f)=>new rt({schema:d,effect:{type:"preprocess",transform:y},typeName:P.ZodEffects,...h(f)});let Be=class extends m{static{l(this,"ZodOptional")}_parse(y){return this._getType(y)===i.ZodParsedType.undefined?(0,s.OK)(void 0):this._def.innerType._parse(y)}unwrap(){return this._def.innerType}};q.ZodOptional=Be,Be.create=(y,d)=>new Be({innerType:y,typeName:P.ZodOptional,...h(d)});let pt=class extends m{static{l(this,"ZodNullable")}_parse(y){return this._getType(y)===i.ZodParsedType.null?(0,s.OK)(null):this._def.innerType._parse(y)}unwrap(){return this._def.innerType}};q.ZodNullable=pt,pt.create=(y,d)=>new pt({innerType:y,typeName:P.ZodNullable,...h(d)});let or=class extends m{static{l(this,"ZodDefault")}_parse(y){let{ctx:d}=this._processInputParams(y),f=d.data;return d.parsedType===i.ZodParsedType.undefined&&(f=this._def.defaultValue()),this._def.innerType._parse({data:f,path:d.path,parent:d})}removeDefault(){return this._def.innerType}};q.ZodDefault=or,or.create=(y,d)=>new or({innerType:y,typeName:P.ZodDefault,defaultValue:typeof d.default=="function"?d.default:()=>d.default,...h(d)});let Bt=class extends m{static{l(this,"ZodCatch")}_parse(y){let{ctx:d}=this._processInputParams(y),f={...d,common:{...d.common,issues:[]}},b=this._def.innerType._parse({data:f.data,path:f.path,parent:{...f}});return(0,s.isAsync)(b)?b.then(v=>({status:"valid",value:v.status==="valid"?v.value:this._def.catchValue({get error(){return new c.ZodError(f.common.issues)},input:f.data})})):{status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new c.ZodError(f.common.issues)},input:f.data})}}removeCatch(){return this._def.innerType}};q.ZodCatch=Bt,Bt.create=(y,d)=>new Bt({innerType:y,typeName:P.ZodCatch,catchValue:typeof d.catch=="function"?d.catch:()=>d.catch,...h(d)});let wr=class extends m{static{l(this,"ZodNaN")}_parse(y){if(this._getType(y)!==i.ZodParsedType.nan){let d=this._getOrReturnCtx(y);return(0,s.addIssueToContext)(d,{code:c.ZodIssueCode.invalid_type,expected:i.ZodParsedType.nan,received:d.parsedType}),s.INVALID}return{status:"valid",value:y.data}}};q.ZodNaN=wr,wr.create=y=>new wr({typeName:P.ZodNaN,...h(y)}),q.BRAND=Symbol("zod_brand");let sr=class extends m{static{l(this,"ZodBranded")}_parse(y){let{ctx:d}=this._processInputParams(y),f=d.data;return this._def.type._parse({data:f,path:d.path,parent:d})}unwrap(){return this._def.type}};q.ZodBranded=sr;let mr=class D_ extends m{static{l(this,"ZodPipeline")}_parse(d){let{status:f,ctx:b}=this._processInputParams(d);if(b.common.async)return l(async()=>{let v=await this._def.in._parseAsync({data:b.data,path:b.path,parent:b});return v.status==="aborted"?s.INVALID:v.status==="dirty"?(f.dirty(),(0,s.DIRTY)(v.value)):this._def.out._parseAsync({data:v.value,path:b.path,parent:b})},"handleAsync")();{let v=this._def.in._parseSync({data:b.data,path:b.path,parent:b});return v.status==="aborted"?s.INVALID:v.status==="dirty"?(f.dirty(),{status:"dirty",value:v.value}):this._def.out._parseSync({data:v.value,path:b.path,parent:b})}}static create(d,f){return new D_({in:d,out:f,typeName:P.ZodPipeline})}};q.ZodPipeline=mr;let gr=class extends m{static{l(this,"ZodReadonly")}_parse(y){let d=this._def.innerType._parse(y),f=l(b=>((0,s.isValid)(b)&&(b.value=Object.freeze(b.value)),b),"freeze");return(0,s.isAsync)(d)?d.then(b=>f(b)):f(d)}unwrap(){return this._def.innerType}};q.ZodReadonly=gr,gr.create=(y,d)=>new gr({innerType:y,typeName:P.ZodReadonly,...h(d)});function vt(y,d){let f=typeof y=="function"?y(d):typeof y=="string"?{message:y}:y;return typeof f=="string"?{message:f}:f}l(vt,"cleanParams");function _(y,d={},f){return y?De.create().superRefine((b,v)=>{var F,Z;let Q=y(b);if(Q instanceof Promise)return Q.then(ee=>{var ne,qe;if(!ee){let Ke=vt(d,b),qr=(qe=(ne=Ke.fatal)!==null&&ne!==void 0?ne:f)!==null&&qe!==void 0?qe:!0;v.addIssue({code:"custom",...Ke,fatal:qr})}});if(!Q){let ee=vt(d,b),ne=(Z=(F=ee.fatal)!==null&&F!==void 0?F:f)!==null&&Z!==void 0?Z:!0;v.addIssue({code:"custom",...ee,fatal:ne})}}):De.create()}l(_,"custom"),q.custom=_,q.late={object:tt.lazycreate};var P;(function(y){y.ZodString="ZodString",y.ZodNumber="ZodNumber",y.ZodNaN="ZodNaN",y.ZodBigInt="ZodBigInt",y.ZodBoolean="ZodBoolean",y.ZodDate="ZodDate",y.ZodSymbol="ZodSymbol",y.ZodUndefined="ZodUndefined",y.ZodNull="ZodNull",y.ZodAny="ZodAny",y.ZodUnknown="ZodUnknown",y.ZodNever="ZodNever",y.ZodVoid="ZodVoid",y.ZodArray="ZodArray",y.ZodObject="ZodObject",y.ZodUnion="ZodUnion",y.ZodDiscriminatedUnion="ZodDiscriminatedUnion",y.ZodIntersection="ZodIntersection",y.ZodTuple="ZodTuple",y.ZodRecord="ZodRecord",y.ZodMap="ZodMap",y.ZodSet="ZodSet",y.ZodFunction="ZodFunction",y.ZodLazy="ZodLazy",y.ZodLiteral="ZodLiteral",y.ZodEnum="ZodEnum",y.ZodEffects="ZodEffects",y.ZodNativeEnum="ZodNativeEnum",y.ZodOptional="ZodOptional",y.ZodNullable="ZodNullable",y.ZodDefault="ZodDefault",y.ZodCatch="ZodCatch",y.ZodPromise="ZodPromise",y.ZodBranded="ZodBranded",y.ZodPipeline="ZodPipeline",y.ZodReadonly="ZodReadonly"})(P||(q.ZodFirstPartyTypeKind=P={}));let K=l((y,d={message:`Input not instance of ${y.name}`})=>_(f=>f instanceof y,d),"instanceOfType");q.instanceof=K;let de=Ce.create;q.string=de;let Ee=Te.create;q.number=Ee;let Re=wr.create;q.nan=Re;let X=Ct.create;q.bigint=X;let J=ke.create;q.boolean=J;let pe=ht.create;q.date=pe;let lt=xe.create;q.symbol=lt;let Le=Ge.create;q.undefined=Le;let Ht=Fe.create;q.null=Ht;let Ur=De.create;q.any=Ur;let xr=Ne.create;q.unknown=xr;let Lr=Ae.create;q.never=Lr;let _r=ut.create;q.void=_r;let kt=We.create;q.array=kt;let da=tt.create;q.object=da;let Vr=tt.strictCreate;q.strictObject=Vr;let Fr=bt.create;q.union=Fr;let yr=tr.create;q.discriminatedUnion=yr;let ua=rr.create;q.intersection=ua;let I=Zt.create;q.tuple=I;let te=Ot.create;q.record=te;let V=jt.create;q.map=V;let we=it.create;q.set=we;let He=Rt.create;q.function=He;let ze=Kt.create;q.lazy=ze;let Mt=ar.create;q.literal=Mt;let ft=Gt.create;q.enum=ft;let ct=nr.create;q.nativeEnum=ct;let at=Lt.create;q.promise=at;let H=rt.create;q.effect=H,q.transformer=H;let se=Be.create;q.optional=se;let ye=pt.create;q.nullable=ye;let $e=rt.createWithPreprocess;q.preprocess=$e;let Je=mr.create;q.pipeline=Je;let Ut=l(()=>de().optional(),"ostring");q.ostring=Ut;let ir=l(()=>Ee().optional(),"onumber");q.onumber=ir;let Wr=l(()=>J().optional(),"oboolean");return q.oboolean=Wr,q.coerce={string:l(y=>Ce.create({...y,coerce:!0}),"string"),number:l(y=>Te.create({...y,coerce:!0}),"number"),boolean:l(y=>ke.create({...y,coerce:!0}),"boolean"),bigint:l(y=>Ct.create({...y,coerce:!0}),"bigint"),date:l(y=>ht.create({...y,coerce:!0}),"date")},q.NEVER=s.INVALID,q}l(z_,"requireTypes");var xx;function v0(){return xx||(xx=1,function(e){var t=Bs&&Bs.__createBinding||(Object.create?function(a,n,o,s){s===void 0&&(s=o);var i=Object.getOwnPropertyDescriptor(n,o);(!i||("get"in i?!n.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:l(function(){return n[o]},"get")}),Object.defineProperty(a,s,i)}:function(a,n,o,s){s===void 0&&(s=o),a[s]=n[o]}),r=Bs&&Bs.__exportStar||function(a,n){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(n,o)&&t(n,a,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(Vu(),e),r(cg(),e),r(O_(),e),r(ac(),e),r(z_(),e),r(Uu(),e)}(Bs)),Bs}l(v0,"requireExternal");var _x;function Z_(){return _x||(_x=1,function(e){var t=Xa&&Xa.__createBinding||(Object.create?function(s,i,c,u){u===void 0&&(u=c);var p=Object.getOwnPropertyDescriptor(i,c);(!p||("get"in p?!i.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:l(function(){return i[c]},"get")}),Object.defineProperty(s,u,p)}:function(s,i,c,u){u===void 0&&(u=c),s[u]=i[c]}),r=Xa&&Xa.__setModuleDefault||(Object.create?function(s,i){Object.defineProperty(s,"default",{enumerable:!0,value:i})}:function(s,i){s.default=i}),a=Xa&&Xa.__importStar||function(s){if(s&&s.__esModule)return s;var i={};if(s!=null)for(var c in s)c!=="default"&&Object.prototype.hasOwnProperty.call(s,c)&&t(i,s,c);return r(i,s),i},n=Xa&&Xa.__exportStar||function(s,i){for(var c in s)c!=="default"&&!Object.prototype.hasOwnProperty.call(i,c)&&t(i,s,c)};Object.defineProperty(e,"__esModule",{value:!0}),e.z=void 0;let o=a(v0());e.z=o,n(v0(),e),e.default=o}(Xa)),Xa}l(Z_,"requireLib");var Xe=Z_();function j_(){return{}}l(j_,"parseAnyDef");function B_(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==Xe.ZodFirstPartyTypeKind.ZodAny&&(r.items=It(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&Pt(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&Pt(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(Pt(r,"minItems",e.exactLength.value,e.exactLength.message,t),Pt(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}l(B_,"parseArrayDef");function H_(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let a of e.checks)switch(a.kind){case"min":t.target==="jsonSchema7"?a.inclusive?Pt(r,"minimum",a.value,a.message,t):Pt(r,"exclusiveMinimum",a.value,a.message,t):(a.inclusive||(r.exclusiveMinimum=!0),Pt(r,"minimum",a.value,a.message,t));break;case"max":t.target==="jsonSchema7"?a.inclusive?Pt(r,"maximum",a.value,a.message,t):Pt(r,"exclusiveMaximum",a.value,a.message,t):(a.inclusive||(r.exclusiveMaximum=!0),Pt(r,"maximum",a.value,a.message,t));break;case"multipleOf":Pt(r,"multipleOf",a.value,a.message,t);break}return r}l(H_,"parseBigintDef");function U_(){return{type:"boolean"}}l(U_,"parseBooleanDef");function dg(e,t){return It(e.type._def,t)}l(dg,"parseBrandedDef");var aN=l((e,t)=>It(e.innerType._def,t),"parseCatchDef");function ug(e,t,r){let a=r??t.dateStrategy;if(Array.isArray(a))return{anyOf:a.map((n,o)=>ug(e,t,n))};switch(a){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return nN(e,t)}}l(ug,"parseDateDef");var nN=l((e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let a of e.checks)switch(a.kind){case"min":Pt(r,"minimum",a.value,a.message,t);break;case"max":Pt(r,"maximum",a.value,a.message,t);break}return r},"integerDateParser");function V_(e,t){return{...It(e.innerType._def,t),default:e.defaultValue()}}l(V_,"parseDefaultDef");function F_(e,t){return t.effectStrategy==="input"?It(e.schema._def,t):{}}l(F_,"parseEffectsDef");function W_(e){return{type:"string",enum:Array.from(e.values)}}l(W_,"parseEnumDef");var oN=l(e=>"type"in e&&e.type==="string"?!1:"allOf"in e,"isJsonSchema7AllOfType");function q_(e,t){let r=[It(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),It(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(o=>!!o),a=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,n=[];return r.forEach(o=>{if(oN(o))n.push(...o.allOf),o.unevaluatedProperties===void 0&&(a=void 0);else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:i,...c}=o;s=c}else a=void 0;n.push(s)}}),n.length?{allOf:n,...a}:void 0}l(q_,"parseIntersectionDef");function K_(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}l(K_,"parseLiteralDef");var Mm,Na={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:l(()=>(Mm===void 0&&(Mm=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Mm),"emoji"),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function hg(e,t){let r={type:"string"};if(e.checks)for(let a of e.checks)switch(a.kind){case"min":Pt(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,a.value):a.value,a.message,t);break;case"max":Pt(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,a.value):a.value,a.message,t);break;case"email":switch(t.emailStrategy){case"format:email":ka(r,"email",a.message,t);break;case"format:idn-email":ka(r,"idn-email",a.message,t);break;case"pattern:zod":jr(r,Na.email,a.message,t);break}break;case"url":ka(r,"uri",a.message,t);break;case"uuid":ka(r,"uuid",a.message,t);break;case"regex":jr(r,a.regex,a.message,t);break;case"cuid":jr(r,Na.cuid,a.message,t);break;case"cuid2":jr(r,Na.cuid2,a.message,t);break;case"startsWith":jr(r,RegExp(`^${su(a.value,t)}`),a.message,t);break;case"endsWith":jr(r,RegExp(`${su(a.value,t)}$`),a.message,t);break;case"datetime":ka(r,"date-time",a.message,t);break;case"date":ka(r,"date",a.message,t);break;case"time":ka(r,"time",a.message,t);break;case"duration":ka(r,"duration",a.message,t);break;case"length":Pt(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,a.value):a.value,a.message,t),Pt(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,a.value):a.value,a.message,t);break;case"includes":{jr(r,RegExp(su(a.value,t)),a.message,t);break}case"ip":{a.version!=="v6"&&ka(r,"ipv4",a.message,t),a.version!=="v4"&&ka(r,"ipv6",a.message,t);break}case"base64url":jr(r,Na.base64url,a.message,t);break;case"jwt":jr(r,Na.jwt,a.message,t);break;case"cidr":{a.version!=="v6"&&jr(r,Na.ipv4Cidr,a.message,t),a.version!=="v4"&&jr(r,Na.ipv6Cidr,a.message,t);break}case"emoji":jr(r,Na.emoji(),a.message,t);break;case"ulid":{jr(r,Na.ulid,a.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{ka(r,"binary",a.message,t);break}case"contentEncoding:base64":{Pt(r,"contentEncoding","base64",a.message,t);break}case"pattern:zod":{jr(r,Na.base64,a.message,t);break}}break}case"nanoid":jr(r,Na.nanoid,a.message,t)}return r}l(hg,"parseStringDef");function su(e,t){return t.patternStrategy==="escape"?G_(e):e}l(su,"escapeLiteralCheckValue");var sN=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function G_(e){let t="";for(let r=0;rn.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&a.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&a.errorMessages&&{errorMessage:{format:r}}})):Pt(e,"format",t,r,a)}l(ka,"addFormat");function jr(e,t,r,a){e.pattern||e.allOf?.some(n=>n.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&a.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:w0(t,a),...r&&a.errorMessages&&{errorMessage:{pattern:r}}})):Pt(e,"pattern",w0(t,a),r,a)}l(jr,"addPattern");function w0(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},a=r.i?e.source.toLowerCase():e.source,n="",o=!1,s=!1,i=!1;for(let c=0;c({...a,[n]:It(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",n]})??{}}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:It(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===Xe.ZodFirstPartyTypeKind.ZodString&&e.keyType._def.checks?.length){let{type:a,...n}=hg(e.keyType._def,t);return{...r,propertyNames:n}}else{if(e.keyType?._def.typeName===Xe.ZodFirstPartyTypeKind.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===Xe.ZodFirstPartyTypeKind.ZodBranded&&e.keyType._def.type._def.typeName===Xe.ZodFirstPartyTypeKind.ZodString&&e.keyType._def.type._def.checks?.length){let{type:a,...n}=dg(e.keyType._def,t);return{...r,propertyNames:n}}}return r}l(pg,"parseRecordDef");function Y_(e,t){if(t.mapStrategy==="record")return pg(e,t);let r=It(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},a=It(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[r,a],minItems:2,maxItems:2}}}l(Y_,"parseMapDef");function Q_(e){let t=e.values,r=Object.keys(e.values).filter(n=>typeof t[t[n]]!="number").map(n=>t[n]),a=Array.from(new Set(r.map(n=>typeof n)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:r}}l(Q_,"parseNativeEnumDef");function X_(){return{not:{}}}l(X_,"parseNeverDef");function J_(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}l(J_,"parseNullDef");var _u={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function ek(e,t){if(t.target==="openApi3")return kx(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(a=>a._def.typeName in _u&&(!a._def.checks||!a._def.checks.length))){let a=r.reduce((n,o)=>{let s=_u[o._def.typeName];return s&&!n.includes(s)?[...n,s]:n},[]);return{type:a.length>1?a:a[0]}}else if(r.every(a=>a._def.typeName==="ZodLiteral"&&!a.description)){let a=r.reduce((n,o)=>{let s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...n,s];case"bigint":return[...n,"integer"];case"object":if(o._def.value===null)return[...n,"null"];case"symbol":case"undefined":case"function":default:return n}},[]);if(a.length===r.length){let n=a.filter((o,s,i)=>i.indexOf(o)===s);return{type:n.length>1?n:n[0],enum:r.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(r.every(a=>a._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((a,n)=>[...a,...n._def.values.filter(o=>!a.includes(o))],[])};return kx(e,t)}l(ek,"parseUnionDef");var kx=l((e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((a,n)=>It(a._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]})).filter(a=>!!a&&(!t.strictUnions||typeof a=="object"&&Object.keys(a).length>0));return r.length?{anyOf:r}:void 0},"asAnyOf");function tk(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:_u[e.innerType._def.typeName],nullable:!0}:{type:[_u[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let a=It(e.innerType._def,{...t,currentPath:[...t.currentPath]});return a&&"$ref"in a?{allOf:[a],nullable:!0}:a&&{...a,nullable:!0}}let r=It(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}l(tk,"parseNullableDef");function rk(e,t){let r={type:"number"};if(!e.checks)return r;for(let a of e.checks)switch(a.kind){case"int":r.type="integer",ig(r,"type",a.message,t);break;case"min":t.target==="jsonSchema7"?a.inclusive?Pt(r,"minimum",a.value,a.message,t):Pt(r,"exclusiveMinimum",a.value,a.message,t):(a.inclusive||(r.exclusiveMinimum=!0),Pt(r,"minimum",a.value,a.message,t));break;case"max":t.target==="jsonSchema7"?a.inclusive?Pt(r,"maximum",a.value,a.message,t):Pt(r,"exclusiveMaximum",a.value,a.message,t):(a.inclusive||(r.exclusiveMaximum=!0),Pt(r,"maximum",a.value,a.message,t));break;case"multipleOf":Pt(r,"multipleOf",a.value,a.message,t);break}return r}l(rk,"parseNumberDef");function ak(e,t){let r=t.target==="openAi",a={type:"object",properties:{}},n=[],o=e.shape();for(let i in o){let c=o[i];if(c===void 0||c._def===void 0)continue;let u=ok(c);u&&r&&(c instanceof Xe.ZodOptional&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),u=!1);let p=It(c._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});p!==void 0&&(a.properties[i]=p,u||n.push(i))}n.length&&(a.required=n);let s=nk(e,t);return s!==void 0&&(a.additionalProperties=s),a}l(ak,"parseObjectDef");function nk(e,t){if(e.catchall._def.typeName!=="ZodNever")return It(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}l(nk,"decideAdditionalProperties");function ok(e){try{return e.isOptional()}catch{return!0}}l(ok,"safeIsOptional");var iN=l((e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return It(e.innerType._def,t);let r=It(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:{}},r]}:{}},"parseOptionalDef"),lN=l((e,t)=>{if(t.pipeStrategy==="input")return It(e.in._def,t);if(t.pipeStrategy==="output")return It(e.out._def,t);let r=It(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),a=It(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,a].filter(n=>n!==void 0)}},"parsePipelineDef");function sk(e,t){return It(e.type._def,t)}l(sk,"parsePromiseDef");function ik(e,t){let r={type:"array",uniqueItems:!0,items:It(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&Pt(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&Pt(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}l(ik,"parseSetDef");function lk(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,a)=>It(r._def,{...t,currentPath:[...t.currentPath,"items",`${a}`]})).reduce((r,a)=>a===void 0?r:[...r,a],[]),additionalItems:It(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,a)=>It(r._def,{...t,currentPath:[...t.currentPath,"items",`${a}`]})).reduce((r,a)=>a===void 0?r:[...r,a],[])}}l(lk,"parseTupleDef");function ck(){return{not:{}}}l(ck,"parseUndefinedDef");function dk(){return{}}l(dk,"parseUnknownDef");var cN=l((e,t)=>It(e.innerType._def,t),"parseReadonlyDef"),dN=l((e,t,r)=>{switch(t){case Xe.ZodFirstPartyTypeKind.ZodString:return hg(e,r);case Xe.ZodFirstPartyTypeKind.ZodNumber:return rk(e,r);case Xe.ZodFirstPartyTypeKind.ZodObject:return ak(e,r);case Xe.ZodFirstPartyTypeKind.ZodBigInt:return H_(e,r);case Xe.ZodFirstPartyTypeKind.ZodBoolean:return U_();case Xe.ZodFirstPartyTypeKind.ZodDate:return ug(e,r);case Xe.ZodFirstPartyTypeKind.ZodUndefined:return ck();case Xe.ZodFirstPartyTypeKind.ZodNull:return J_(r);case Xe.ZodFirstPartyTypeKind.ZodArray:return B_(e,r);case Xe.ZodFirstPartyTypeKind.ZodUnion:case Xe.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return ek(e,r);case Xe.ZodFirstPartyTypeKind.ZodIntersection:return q_(e,r);case Xe.ZodFirstPartyTypeKind.ZodTuple:return lk(e,r);case Xe.ZodFirstPartyTypeKind.ZodRecord:return pg(e,r);case Xe.ZodFirstPartyTypeKind.ZodLiteral:return K_(e,r);case Xe.ZodFirstPartyTypeKind.ZodEnum:return W_(e);case Xe.ZodFirstPartyTypeKind.ZodNativeEnum:return Q_(e);case Xe.ZodFirstPartyTypeKind.ZodNullable:return tk(e,r);case Xe.ZodFirstPartyTypeKind.ZodOptional:return iN(e,r);case Xe.ZodFirstPartyTypeKind.ZodMap:return Y_(e,r);case Xe.ZodFirstPartyTypeKind.ZodSet:return ik(e,r);case Xe.ZodFirstPartyTypeKind.ZodLazy:return()=>e.getter()._def;case Xe.ZodFirstPartyTypeKind.ZodPromise:return sk(e,r);case Xe.ZodFirstPartyTypeKind.ZodNaN:case Xe.ZodFirstPartyTypeKind.ZodNever:return X_();case Xe.ZodFirstPartyTypeKind.ZodEffects:return F_(e,r);case Xe.ZodFirstPartyTypeKind.ZodAny:return j_();case Xe.ZodFirstPartyTypeKind.ZodUnknown:return dk();case Xe.ZodFirstPartyTypeKind.ZodDefault:return V_(e,r);case Xe.ZodFirstPartyTypeKind.ZodBranded:return dg(e,r);case Xe.ZodFirstPartyTypeKind.ZodReadonly:return cN(e,r);case Xe.ZodFirstPartyTypeKind.ZodCatch:return aN(e,r);case Xe.ZodFirstPartyTypeKind.ZodPipeline:return lN(e,r);case Xe.ZodFirstPartyTypeKind.ZodFunction:case Xe.ZodFirstPartyTypeKind.ZodVoid:case Xe.ZodFirstPartyTypeKind.ZodSymbol:return;default:return(a=>{})()}},"selectParser");function It(e,t,r=!1){let a=t.seen.get(e);if(t.override){let i=t.override?.(e,t,a,r);if(i!==JM)return i}if(a&&!r){let i=uN(a,t);if(i!==void 0)return i}let n={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,n);let o=dN(e,e.typeName,t),s=typeof o=="function"?It(o(),t):o;if(s&&pN(e,t,s),t.postProcess){let i=t.postProcess(s,e,t);return n.jsonSchema=s,i}return n.jsonSchema=s,s}l(It,"parseDef");var uN=l((e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:hN(t.currentPath,e.path)};case"none":case"seen":return e.path.lengtht.currentPath[a]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):t.$refStrategy==="seen"?{}:void 0}},"get$ref"),hN=l((e,t)=>{let r=0;for(;r(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r),"addMeta"),fN=l((e,t)=>{let r=rN(t),a,n=t,o=It(e._def,{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??{},s=n===void 0?a?{...o,[r.definitionPath]:a}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,n].join("/"),[r.definitionPath]:{...a,[n]:o}};return r.target==="jsonSchema7"?s.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in s||"oneOf"in s||"allOf"in s||"type"in s&&Array.isArray(s.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),s},"zodToJsonSchema");function uk(e){if(e<1e3)return`${e}ms`;{let t=e/1e3;return Number.isInteger(t)?`${t}s`:`${t.toFixed(1)}s`}}l(uk,"formatDuration");var mN=typeof localStorage<"u";function hk(){return typeof dx<"u"||typeof document<"u"?!1:!!(typeof process<"u"&&process.versions?.node||typeof Deno<"u"&&typeof Deno.version<"u"||typeof Bun<"u"&&typeof Bun.version<"u"||typeof dx<"u"&&typeof globalThis.Response=="function"&&typeof globalThis.fetch=="function"&&typeof globalThis.navigator>"u"||typeof process<"u"&&process?.env.AWS_LAMBDA_FUNCTION_NAME)}l(hk,"isServerRuntime");function pk(e){let t=fN(e,"Tool");if(t.$ref&&t.definitions){let r=t.$ref.replace("#/definitions/",""),a=t.definitions[r];if(!a)throw new Error(`Could not resolve definition: ${r}`);return a}return t}l(pk,"flattenZodSchema");var x0="___$orama_user_id$___",gN="ssid",yN=class{static{l(this,"AnswerSession")}constructor(e){Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"readAPIKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"collectionID",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oramaInterface",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"LLMConfig",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sessionID",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lastInteractionParams",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"messages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.url=e.url,this.readAPIKey=e.readAPIKey,this.collectionID=e.collectionID,this.oramaInterface=new sg({baseURL:this.url,readAPIKey:this.readAPIKey}),this.LLMConfig=e.LLMConfig,this.messages=e.initialMessages||[],this.events=e.events,this.sessionID=e.sessionID||fo.createId()}async*answerStream(e){this.lastInteractionParams={...e,planned:!1},e=this.enrichConfig(e),this.abortController=new AbortController,this.messages.push({role:"user",content:e.query}),this.messages.push({role:"assistant",content:""});let t=e.interactionID||fo.createId();this.state.push({id:t,query:e.query,response:"",sources:null,loading:!0,error:!1,aborted:!1,errorMessage:null,planned:!1,plan:null,planExecution:{},segment:null,related:e.related?.enabled?"":null}),this.pushState();let r=this.state.length-1,a=this.messages.length-1,n={interaction_id:t,query:e.query,visitor_id:e.visitorID,conversation_id:e.sessionID,messages:e.messages||[],llm_config:null,related:e.related};this.LLMConfig&&(n.llm_config=this.LLMConfig);let o=(await this.oramaInterface.requestStream({method:"POST",securityLevel:"read-query",url:`/v1/collections/${this.collectionID}/answer`,body:n})).getReader();for(;;){let{done:s,value:i}=await o.read();if(i!==void 0){let c=Mn(i.data);if(c.type==="response"){let{action:u,result:p}=Mn(c.message);switch(u){case"GET_SEGMENT":{if(p!==null){let h=Mn(p);if(!h)break;this.state[r].segment={id:h.id,name:h.name},this.pushState()}break}case"GET_TRIGGER":{if(p!==null){let h=Mn(p);if(!h)break;this.state[r].segment=h,this.pushState()}break}case"OPTIMIZING_QUERY":break;case"SEARCH_RESULTS":{let h=Mn(p);this.state[r].sources=h,this.pushState();break}case"ANSWER_RESPONSE":{this.state[r].response+=p,this.messages[a].content=this.state[r].response,yield this.state[r].response,this.pushState();break}case"RELATED_QUERIES":{this.state[r].related+=p,this.pushState();break}}}}if(s){this.state[r].loading=!1,this.pushState();break}}o.releaseLock()}async answer(e){this.lastInteractionParams={...e,planned:!1};let t="";for await(let r of this.answerStream(e))t=r;return t}async*reasonStream(e){this.lastInteractionParams={...e,planned:!0};for await(let t of this.fetchPlannedAnswer(e))yield this.state[this.state.length-1].response}async reason(e){this.lastInteractionParams={...e,planned:!0};for await(let t of this.fetchPlannedAnswer(e));return this.state[this.state.length-1].response}async*fetchPlannedAnswer(e){e=this.enrichConfig(e),this.abortController=new AbortController,this.messages.push({role:"user",content:e.query}),this.messages.push({role:"assistant",content:""});let t=fo.createId();this.state.push({id:t,query:e.query,response:"",sources:null,loading:!0,error:!1,aborted:!1,errorMessage:null,planned:!0,plan:null,planExecution:{},segment:null,related:e.related?.enabled?"":null}),this.pushState();let r=this.state.length-1,a=this.messages.length-1,n=(await this.oramaInterface.requestStream({method:"POST",securityLevel:"read-query",url:`/v1/collections/${this.collectionID}/planned_answer`,body:{interaction_id:e.interactionID,query:e.query,visitor_id:e.visitorID,conversation_id:e.sessionID,messages:e.messages||[],llm_config:this.LLMConfig?this.LLMConfig:null,related:e.related},signal:this.abortController?.signal})).getReader();for(;;){let{done:o,value:s}=await n.read();if(s!==void 0){if(s==="")continue;let i=Mn(s.data);if(i.type==="acknowledgement"){yield{action:"ACKNOWLEDGEMENT",message:"acknowledgement"};continue}if(i.type==="response"){if(i.message==="")continue;let c=Mn(i.message),u=c.action;if(u==="ACTION_PLAN"){let p=Mn(c.result);this.state[r].plan=p;let h={};for(let m of p)h[m.step]={instruction:m.description,result:"",done:!1};this.state[r].planExecution=h,this.pushState(),yield{action:"ACTION_PLAN",message:p};continue}if(u==="PERFORM_ORAMA_SEARCH"){let p=JSON.parse(c.result);this.state[r].sources=p,"PERFORM_ORAMA_SEARCH"in this.state[r].planExecution&&(this.state[r].planExecution.PERFORM_ORAMA_SEARCH.result=p,this.state[r].planExecution.PERFORM_ORAMA_SEARCH.done=!0),this.pushState(),yield{action:"PERFORM_ORAMA_SEARCH",message:p};continue}if(u==="ASK_FOLLOWUP"||u==="GIVE_REPLY"){this.state[r].response+=c.result,this.messages[a].content=this.state[r].response,this.state[r].planExecution[u].result+=c.result,this.state[r].planExecution[u].done=c.done,this.pushState(),yield{action:u,message:c.result};continue}if(u==="GET_SEGMENT"&&(this.state[r].segment={id:c.result.id,name:c.result.name},this.pushState()),u==="SELECT_SEGMENT_PROBABILITY"&&this.state[r].segment){let p=c.result.probability;this.state[r].segment.probability=p,this.pushState()}if(u==="GET_TRIGGER"&&(this.state[r].segment={id:c.result.id,name:c.result.name},this.pushState()),u==="SELECT_TRIGGER_PROBABILITY"&&this.state[r].segment){let p=c.result.probability;this.state[r].segment.probability=p,this.pushState()}if(u==="RELATED_QUERIES"){this.state[r].related+=c.result,this.pushState();break}QM.includes(u)||(this.state[r].planExecution[u].result+=c.result,this.state[r].planExecution[u].done=c.done,this.pushState()),yield c}}if(o)break}n.releaseLock(),this.state[r].loading=!1,this.pushState()}async regenerateLast({stream:e=!0}={}){if(this.state.length===0||this.messages.length===0)throw new Error("No messages to regenerate");if(this.messages.at(-1)?.role!=="assistant")throw new Error("Last message is not an assistant message");return this.messages.pop(),this.state.pop(),this.lastInteractionParams?.planned?e?this.reasonStream(this.lastInteractionParams):this.reason(this.lastInteractionParams):e?this.answerStream(this.lastInteractionParams):this.answer(this.lastInteractionParams)}abort(){if(!this.abortController)throw new Error("AbortController is not available.");if(this.state.length===0)throw new Error("There is no active request to abort.");this.abortController.abort(),this.abortController=void 0,this.state[this.state.length-1].aborted=!0}clearSession(){this.messages=[],this.state=[],this.pushState()}pushState(){this.events?.onStateChange?.(this.state)}enrichConfig(e){return e.visitorID||(e.visitorID=fk()),e.interactionID||(e.interactionID=fo.createId()),e.sessionID||(e.sessionID=this.sessionID),e}};function fk(){if(hk())return gN;if(mN){let e=localStorage.getItem(x0);if(e)return e}return fo.createId()}l(fk,"getUserID");function mk(e,t){if(typeof navigator<"u"){typeof navigator.sendBeacon<"u"&&navigator.sendBeacon(e,t);return}fetch(e,{method:"POST",body:t,headers:{"Content-Type":"application/json"}}).then(()=>{},r=>console.log(r))}l(mk,"sendBeacon");var bN=class{static{l(this,"Profile")}constructor({endpoint:e,apiKey:t}){if(Object.defineProperty(this,"endpoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"identity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"userAlias",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!e||!t)throw new Error("Endpoint and API Key are required to create a Profile");if(typeof e!="string"||typeof t!="string")throw new Error("Endpoint and API Key must be strings");if(typeof localStorage<"u"){let r=localStorage.getItem(x0);r?this.userId=r:(this.userId=fo.createId(),localStorage.setItem(x0,this.userId))}else this.userId=fo.createId();this.endpoint=e,this.apiKey=t}setParams(e){let{protocol:t,host:r}=new URL(e.identifyUrl),a=`${t}//${r}/identify`;this.params={identifyUrl:a,index:e.index}}getIdentity(){return this.identity}getUserId(){return this.userId}getAlias(){return this.userAlias}async sendProfileData(e){if(!this.params)throw new Error("Orama Profile is not initialized");let t=JSON.stringify({...e,visitorId:this.getUserId(),index:this.params.index});await mk(`${this.params?.identifyUrl}?api-key=${this.apiKey}`,t)}async identify(e){if(typeof e!="string")throw new Error("Identity must be a string");await this.sendProfileData({entity:"identity",id:e}),this.identity=e}async alias(e){if(typeof e!="string")throw new Error("Identity must be a string");await this.sendProfileData({entity:"alias",id:e}),this.userAlias=e}reset(){this.userId=fo.createId(),this.identity=void 0,this.userAlias=void 0}},vN=class{static{l(this,"CollectionManager")}constructor(e){Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"collectionID",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"writeAPIKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"readAPIKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oramaInterface",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"profile",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e.url,this.writeAPIKey=e.writeAPIKey,this.readAPIKey=e.readAPIKey,this.collectionID=e.collectionID,this.oramaInterface=new sg({baseURL:this.url,writeAPIKey:this.writeAPIKey,readAPIKey:this.readAPIKey}),this.profile=new bN({endpoint:this.url,apiKey:this.readAPIKey})}async search(e){let t=+new Date,{datasourceIDs:r,indexes:a,...n}=e,o=await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/search`,body:{...n,indexes:r||a},method:"POST",securityLevel:"read-query"}),s=+new Date-t;return{...o,elapsed:{raw:s,formatted:uk(s)}}}getStats(e){return this.oramaInterface.request({url:`/v1/collections/${e}/stats`,method:"GET",securityLevel:"read-query"})}async createIndex(e){let t={id:e.id,embedding:e.embeddings};await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/indexes/create`,body:t,method:"POST",securityLevel:"write"})}async deleteIndex(e){await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/indexes/delete`,body:{index_id_to_delete:e},method:"POST",securityLevel:"write"})}setIndex(e){return new wN(this.collectionID,e,this.url,this.writeAPIKey,this.readAPIKey)}getAllDocsInCollection(e){return this.oramaInterface.request({url:"/v1/collections/list",method:"POST",body:{id:e},securityLevel:"write"})}createAnswerSession(e){if(!this.readAPIKey)throw new Error("Read API key is required to create an answer session");return new yN({url:this.url,readAPIKey:this.readAPIKey||"",collectionID:this.collectionID,...e})}async insertHook(e){let t={name:e.name,code:e.code};return await this.oramaInterface.request({url:`/v1/collections/${e.collectionID}/hooks/create`,body:t,method:"POST",securityLevel:"write"}),{hookID:t.name,collectionID:e.collectionID,code:t.code}}insertSegment(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/segments/insert`,body:e,method:"POST",securityLevel:"write"})}getSegment(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/segments/get`,body:{segment_id:e},method:"GET",securityLevel:"read-query"})}getAllSegments(){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/segments/all`,method:"GET",securityLevel:"read-query"})}deleteSegment(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/segments/delete`,body:{id:e},method:"POST",securityLevel:"write"})}updateSegment(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/segments/update`,body:e,method:"POST",securityLevel:"write"})}insertTrigger(e){if(!e.segment_id)throw new Error("You cannot insert a trigger without a segment_id");return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/triggers/insert`,body:e,method:"POST",securityLevel:"write"})}getTrigger(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/triggers/get`,body:{trigger_id:e},method:"GET",securityLevel:"read-query"})}getAllTriggers(){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/triggers/all`,method:"GET",securityLevel:"read-query"})}deleteTrigger(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/triggers/delete`,body:{id:e},method:"POST",securityLevel:"write"})}updateTrigger(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/triggers/update`,body:e,method:"POST",securityLevel:"write"})}insertSystemPrompt(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/system_prompts/insert`,body:e,method:"POST",securityLevel:"write"})}getSystemPrompt(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/system_prompts/get`,body:{system_prompt_id:e},method:"GET",securityLevel:"read"})}getAllSystemPrompts(){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/system_prompts/all`,method:"GET",securityLevel:"read-query"})}deleteSystemPrompt(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/system_prompts/delete`,body:{id:e},method:"POST",securityLevel:"write"})}updateSystemPrompt(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/system_prompts/update`,body:e,method:"POST",securityLevel:"write"})}validateSystemPrompt(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/system_prompts/validate`,body:e,method:"POST",securityLevel:"write"})}insertTool(e){let t;switch(!0){case typeof e.parameters=="string":{t=e.parameters;break}case e.parameters instanceof Xe.ZodType:{let r=pk(e.parameters);t=JSON.stringify(r);break}case typeof e.parameters=="object":{t=JSON.stringify(e.parameters);break}default:throw new Error("Invalid parameters type. Must be string, object or ZodType")}return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/tools/insert`,body:{...e,parameters:t},method:"POST",securityLevel:"write"})}getTool(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/tools/get`,body:{tool_id:e},method:"GET",securityLevel:"read-query"})}getAllTools(){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/tools/all`,method:"GET",securityLevel:"read-query"})}deleteTool(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/tools/delete`,body:{id:e},method:"POST",securityLevel:"write"})}updateTool(e){return this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/tools/update`,body:e,method:"POST",securityLevel:"write"})}async executeTools(e){let t=await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/tools/run`,body:e,method:"POST",securityLevel:"read"});return t.results?{results:t.results.map(r=>"functionResult"in r?{functionResult:{tool_id:r.functionResult.tool_id,result:JSON.parse(r.functionResult.result)}}:"functionParameters"in r?{functionParameters:{tool_id:r.functionParameters.tool_id,result:JSON.parse(r.functionParameters.result)}}:r)}:{results:null}}getIdentity(){return this.profile.getIdentity()}getUserId(){return this.profile.getUserId()}getAlias(){return this.profile.getAlias()}async identify(e){await this.profile.identify(e)}async alias(e){await this.profile.alias(e)}reset(){this.profile.reset()}},wN=class{static{l(this,"Index")}constructor(e,t,r,a,n){Object.defineProperty(this,"indexID",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"collectionID",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oramaInterface",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.indexID=t,this.collectionID=e,this.oramaInterface=new sg({baseURL:r,writeAPIKey:a,readAPIKey:n})}async reindex(){await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/indexes/${this.indexID}/reindex`,method:"POST",securityLevel:"write"})}async insertDocuments(e){await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/indexes/${this.indexID}/insert`,body:e,method:"POST",securityLevel:"write"})}async deleteDocuments(e){await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/indexes/${this.indexID}/delete`,body:e,method:"POST",securityLevel:"write"})}async upsertDocuments(e){await this.oramaInterface.request({url:`/v1/collections/${this.collectionID}/indexes/${this.indexID}/insert`,body:e,method:"POST",securityLevel:"write"})}};function gk(e){return e&&typeof e=="object"&&"api_key"in e&&"endpoint"in e}l(gk,"isOramaClient");function yk(e){return e&&(e instanceof vN||e.constructor.name==="CollectionManager")}l(yk,"isOramaCoreClient");function bk(e){return e&&typeof e=="object"&&"id"in e&&"tokenizer"in e}l(bk,"isOramaJSClient");var vk=class{static{l(this,"Switch")}invalidClientError="Invalid client. Expected either an OramaClient, CollectionManager, or an Orama JS database.";client;clientType;isCloud=!1;isJS=!1;isCore=!1;constructor(e){switch(this.client=e,!0){case yk(e):this.clientType="core",this.isCore=!0;break;case gk(e):this.clientType="cloud",this.isCloud=!0;break;case bk(e):this.clientType="oss",this.isJS=!0;break;default:throw new Error(this.invalidClientError)}}async search(e,t){switch(!0){case this.isCloud:return this.client.search(e,t);case this.isCore:return await this.client.search(e);case this.isJS:return eg(this.client,e);default:throw new Error(this.invalidClientError)}}createAnswerSession(e){switch(!0){case this.isCloud:{let t=e;return this.client.createAnswerSession(t)}case this.isCore:{let t=e;return this.client.createAnswerSession(t)}case this.isJS:{let t=e;return new kM(this.client,{conversationID:t.conversationID,initialMessages:t.initialMessages,events:t.events,userContext:t.userContext,systemPrompt:t.systemPrompt})}default:throw new Error(this.invalidClientError)}}},xN=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r);function a(o){r[o]=e[o]&&function(s){return new Promise(function(i,c){s=e[o](s),n(i,c,s.done,s.value)})}}function n(o,s,i,c){Promise.resolve(c).then(function(u){o({value:u,done:i})},s)}},_N=l(e=>{try{return JSON.parse(e)}catch{return[]}},"parseRelatedQueries"),wk=class{static{l(this,"ChatService")}constructor(e,t,r){this.getSourcesMapObjectByIndexId=(a,n)=>{let o=Array.isArray(a)?a:[a];return o.length===1?o[0]:o.find(s=>s.datasourceId===n)||{}},this.sendQuestion=async(a,n,o,s)=>{if(!this.client)throw new Rl;let i={term:a};o?.length&&this.answerSession&&"setSystemPromptConfiguration"in this.answerSession&&this.answerSession.setSystemPromptConfiguration(o);let c=this.chatStore.state.interactions;if(!this.answerSession)try{let u=this.chatStore.state.interactions;try{this.answerSession=this.client.createAnswerSession({events:{onStateChange:l(p=>{let h=p.filter(m=>!!m.query);this.chatStore.state.interactions=[...u||[],...h.map((m,g)=>{var x;let w=p.length-1===g,k=Br.loading,C=[];m.aborted?k=Br.aborted:m.loading&&m.sources?k=Br.rendering:m.loading&&m.response?k=Br.streaming:!m.loading&&m.response&&(k=Br.done),m.sources&&(C=(Array.isArray(m.sources)?m.sources:m.sources.hits).map($=>{let L=this.getSourcesMapObjectByIndexId(this.chatStore.state.sourcesMap,$.index_id),M=this.getResultMapValue("title",L,$),O=this.getResultMapValue("description",L,$),R=this.getResultMapValue("path",L,$);return{title:M,description:O,path:R}})),w&&k===Br.done&&((x=s?.onAnswerGeneratedCallback)===null||x===void 0||x.call(s,{askParams:i,query:m.query,sources:m.sources,answer:m.response,segment:m.segment,trigger:m.trigger}));let A=m.related;return{query:m.query,interactionId:m.interactionId||m.id,response:m.response,relatedQueries:_N(A),status:k,latest:w,sources:C}})]},"onStateChange")}})}catch(p){console.error("Client does not support createAnswerSession method:",p),this.chatStore.state.interactions=[...u||[],{query:a,response:"Sorry, this client does not support chat functionality.",status:Br.error,latest:!0,sources:[]}];return}}catch(u){console.error("Error creating answer session:",u),this.chatStore.state.interactions=[...c||[],{query:a,response:"Sorry, there was an error creating the answer session. Please try again later.",status:Br.error,latest:!0,sources:[]}];return}if(!this.answerSession){console.error("Answer session was not created");return}try{this.answerSession.answer?this.askOramaCore(a,n):this.askOramaCloud(a)}catch{let u=this.chatStore.state.interactions[this.chatStore.state.interactions.length-1];u&&(u.status=Br.error,u.response="Sorry, the answer service is not available. Please try again later.",this.chatStore.state.interactions=[...this.chatStore.state.interactions])}},this.askOramaCore=(a,n)=>{console.log("askOramaCore",a,n);let o=Object.assign({query:a},n?{related:{enabled:!0,size:n,format:"query"}}:{}),s=this.answerSession.answerStream(o);l(async()=>{var i,c,u;try{for(var p=!0,h=xN(s),m;m=await h.next(),i=m.done,!i;p=!0)p=!1}catch(g){c={error:g}}finally{try{!p&&!i&&(u=h.return)&&await u.call(h)}finally{if(c)throw c.error}}},"processAsyncGenerator")()},this.askOramaCloud=a=>{let n={term:a,limit:10,threshold:.5};this.answerSession.ask(n)},this.abortAnswer=()=>{if(!this.answerSession)throw new Rl;this.answerSession.abort?this.answerSession.abort():this.answerSession.abortAnswer()},this.regenerateLatest=async()=>{if(!this.answerSession)throw new Rl;this.answerSession.regenerateLast?this.answerSession.regenerateLast({stream:!1}):this.answerSession.regenerateLast({stream:!1})},this.resetChat=async()=>{if(!this.answerSession)throw new Rl;this.chatStore.state.interactions.length<1||(["loading","rendering","streaming"].includes(this.chatStore.state.interactions[this.chatStore.state.interactions.length-1].status)&&this.abortAnswer(),this.answerSession.clearSession(),this.chatStore.state.interactions=[])},this.client=t||new vk(e),this.chatStore=r}getResultMapValue(e,t,r){let a=t?.[e];if(!a)return;if(typeof a=="function")return a(r.document,r.index_id);let n=t[e];return r.document[n]}},_0={searchPlaceholder:"Search...",chatPlaceholder:"Ask me anything",noResultsFound:"No results found",noResultsFoundFor:"No results found for",suggestionsTitle:"Suggestions",seeAll:"See all",addMore:"Add more",clearChat:"Clear chat",errorMessage:"An error occurred while trying to search. Please try again.",disclaimer:"Orama can make mistakes. Please verify the information.",startYourSearch:"Start your search",initErrorSearch:"Unable to initialize search service",initErrorChat:"Unable to initialize chat service",chatButtonLabel:"Get a summary",searchButtonLabel:"Search"};function ai(e,t={},r={}){return r[e]?r[e]:t[e]||_0[e]}l(ai,"getText");var kN=Object.defineProperty,SN=Object.getOwnPropertyDescriptor,nc=l((e,t,r,a)=>{for(var n=a>1?void 0:a?SN(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&kN(t,r,n),n},"a"),Vn=class extends ur{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${Vn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};Vn.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);Vn.styles=Pr` :host { display: contents; } `;nc([ve({type:String,reflect:!0})],Vn.prototype,"size",2);nc([ve({type:String,reflect:!0})],Vn.prototype,"weight",2);nc([ve({type:String,reflect:!0})],Vn.prototype,"color",2);nc([ve({type:Boolean,reflect:!0})],Vn.prototype,"mirrored",2);Vn=nc([Rr("ph-arrow-down")],Vn);var IN=".sc-orama-chat-user-message-h{color:#151515;color:var(--text-color-primary,#151515);display:flex;justify-content:end;padding:0 1rem;padding:0 var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}@media (min-width:768.02px){.sc-orama-chat-user-message-h{justify-content:start}}.message-wrapper.sc-orama-chat-user-message{border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)));padding:.5rem .75rem;padding:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16))) var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)))}.chat-question.sc-orama-chat-user-message{font-weight:400}@media (min-width:768.02px){.chat-question.sc-orama-chat-user-message{font-size:1.25rem;font-size:calc(20rem/var(--orama-base-font-size, 16));margin-bottom:1rem;margin-bottom:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}}",CN=Jt(class extends Xt{static{l(this,"OramaChatUserMessage")}constructor(){super(),this.__registerHost()}render(){return z(ta,{key:"d2c74982926525d2f01c2ced08900984662ed86d"},z("div",{key:"ee3082412dd37c9f04e3fdb2573cf2013a7d4985",class:"message-wrapper"},z("orama-text",{key:"b5da8143c4b840cfd24e1722846f2b24b5b8c433",as:"h2",styledAs:"p",class:"chat-question"},this.interaction.query)))}static get style(){return IN}},[2,"orama-chat-user-message",{interaction:[16]}]);function oc(){typeof customElements>"u"||["orama-chat-user-message","orama-text"].forEach(e=>{switch(e){case"orama-chat-user-message":customElements.get(e)||customElements.define(e,CN);break;case"orama-text":customElements.get(e)||ja();break}})}l(oc,"defineCustomElement");var AN=".suggestions-chips.sc-orama-suggestions{align-items:center;display:flex;gap:.75rem;gap:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));list-style:none;margin:0;overflow-x:auto;padding:.5rem 1rem;padding:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16))) var(--radius-l,calc(16rem/var(--orama-base-font-size, 16)))}.suggestions-chips.sc-orama-suggestions::-webkit-scrollbar{background-color:transparent;height:0}@media (min-width:768.02px){.suggestions-chips.sc-orama-suggestions{flex-wrap:wrap;justify-content:center}}.suggestion-button-chips.sc-orama-suggestions{align-items:center;background-color:#fff;background-color:var(--background-color-secondary,#fff);border:1px solid #dadada;border:1px solid var(--border-color-primary,#dadada);border-radius:1rem;border-radius:var(--radius-l,calc(16rem/var(--orama-base-font-size, 16)));color:#151515;color:var(--text-color-primary,#151515);color:#838289;color:var(--text-color-secondary,#838289);-moz-column-gap:.5rem;column-gap:.5rem;-moz-column-gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));column-gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));cursor:pointer;display:flex;font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.25;line-height:var(--font-line-height-s,1.25);margin:0;padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));transition:background-color .2s;width:-moz-max-content;width:max-content}@media (hover:hover){.suggestion-button-chips.sc-orama-suggestions:hover{background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6)}}.suggestion-button-chips.sc-orama-suggestions:focus-visible{border:1px solid #432d77;border:1px solid var(--border-color-accent,#432d77);outline:none}.suggestions-list.sc-orama-suggestions{align-items:center;display:flex;flex-wrap:wrap;list-style:none;margin:0;padding:0}.suggestion-item-list.sc-orama-suggestions{width:100%}.suggestion-button-list.sc-orama-suggestions{align-items:center;background-color:transparent;background:linear-gradient(90deg,#ae8ff7,#151515);background:linear-gradient(90deg,var(--text-color-accent,#ae8ff7) 0,var(--text-color-primary,#151515) 100%);-webkit-background-clip:text;background-clip:text;color:#838289;color:var(--text-color-secondary,#838289);-moz-column-gap:.5rem;column-gap:.5rem;-moz-column-gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));column-gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));cursor:pointer;display:flex;font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));padding:.5rem .75rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));text-align:left;-webkit-text-fill-color:transparent;border:1px solid transparent;font-family:inherit;width:100%}.suggestion-button-list.sc-orama-suggestions:focus-visible{border:1px solid #432d77;border:1px solid var(--border-color-accent,#432d77);border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)));outline:none}",TN=Jt(class extends Xt{static{l(this,"OramaSuggestions")}constructor(){super(),this.__registerHost(),this.as="chips"}handleClick(e){this.suggestionClicked&&this.suggestionClicked(e)}render(){var e;let t=this.as==="chips",r=this.as==="list",a=t?"chips":r?"list":"";return!((e=this.suggestions)===null||e===void 0)&&e.length?z("ul",{class:`suggestions-${a}`},this.suggestions.map(n=>z("li",{key:n.split(" ").join("-").toLowerCase(),class:`suggestion-item-${a}`},z("button",{"focus-on-arrow-nav":!0,type:"button",class:`suggestion-button-${a}`,onClick:l(o=>{o.preventDefault(),this.handleClick(n)},"onClick")},this.icon,n)))):null}static get style(){return AN}},[2,"orama-suggestions",{suggestions:[16],as:[1],icon:[16],suggestionClicked:[16,"suggestion-clicked"]}]);function es(){typeof customElements>"u"||["orama-suggestions"].forEach(e=>{switch(e){case"orama-suggestions":customElements.get(e)||customElements.define(e,TN);break}})}l(es,"defineCustomElement");var EN="orama-chat-messages-container.sc-orama-chat-messages-container::-webkit-scrollbar{width:.3em}orama-chat-messages-container.sc-orama-chat-messages-container::-webkit-scrollbar-track{background:transparent}orama-chat-messages-container.sc-orama-chat-messages-container::-webkit-scrollbar-thumb{background-color:hsla(0,0%,70%,.522);border-radius:1rem;border-radius:var(--border-radius-l,calc(16rem/var(--orama-base-font-size, 16)))}.messages-container.sc-orama-chat-messages-container{display:flex;flex-direction:column;gap:1.5rem;gap:var(--spacing-xl,calc(24rem/var(--orama-base-font-size, 16)));margin:1rem 0;margin:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16))) 0;overflow:hidden}.suggestions-wrapper.sc-orama-chat-messages-container{margin-top:1.5rem;margin-top:var(--spacing-xl,calc(24rem/var(--orama-base-font-size, 16)))}",$N=function(e,t,r,a){var n=arguments.length,o=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(s=e[i])&&(o=(n<3?s(o):n>3?s(t,r,o):s(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o},xk=Jt(class extends Xt{static{l(this,"OramaChatMessagesContainer")}constructor(){super(),this.__registerHost(),this.answerGenerated=Yt(this,"answerGenerated"),this.latestInteractionMinHeight=0,this.onSuggestionClick=e=>{var t;(t=this.chatStore.state.chatService)===null||t===void 0||t.sendQuestion(e,void 0,void 0,{onAnswerGeneratedCallback:l(r=>this.answerGenerated.emit(r),"onAnswerGeneratedCallback")})},this.resizeObserver=new ResizeObserver(e=>{this.latestInteractionMinHeight=e[0].target.clientHeight-32})}componentDidLoad(){let e=this.el.parentElement.parentElement;this.resizeObserver.observe(e)}render(){return z(ta,{key:"16faa4d865e3c1c475a099c2a537c9fcd356bf7b"},z("div",{key:"4fc29b18a434697d629e1327cffdce84d56a21c2",class:"messages-container"},this.interactions.map((e,t)=>{var r;return z("div",{key:e.interactionId,class:"interaction-wrapper",style:{minHeight:this.interactions.length>1&&t===this.interactions.length-1?`${this.latestInteractionMinHeight}px`:"0px"}},z("orama-chat-user-message",{interaction:Object.assign({},e)}),z("orama-chat-assistent-message",{interaction:Object.assign({},e),chatMarkdownLinkTitle:this.chatMarkdownLinkTitle,chatMarkdownLinkHref:this.chatMarkdownLinkHref}),e.latest&&e.status==="done"&&!!(!((r=e.relatedQueries)===null||r===void 0)&&r.length)&&z("div",{class:"suggestions-wrapper"},z("orama-suggestions",{as:"chips",suggestions:e.relatedQueries,suggestionClicked:this.onSuggestionClick})))})))}get el(){return this}static get style(){return EN}},[2,"orama-chat-messages-container",{interactions:[16],chatMarkdownLinkTitle:[16,"chat-markdown-link-title"],chatMarkdownLinkHref:[16,"chat-markdown-link-href"],chatMarkdownLinkTarget:[16,"chat-markdown-link-target"],latestInteractionMinHeight:[32]}]);$N([ro("chat")],xk.prototype,"chatStore",void 0);function Fu(){typeof customElements>"u"||["orama-chat-messages-container","orama-button","orama-chat-assistent-message","orama-chat-user-message","orama-dots-loader","orama-markdown","orama-sources","orama-suggestions","orama-text"].forEach(e=>{switch(e){case"orama-chat-messages-container":customElements.get(e)||customElements.define(e,xk);break;case"orama-button":customElements.get(e)||yo();break;case"orama-chat-assistent-message":customElements.get(e)||tc();break;case"orama-chat-user-message":customElements.get(e)||oc();break;case"orama-dots-loader":customElements.get(e)||ti();break;case"orama-markdown":customElements.get(e)||Jo();break;case"orama-sources":customElements.get(e)||ri();break;case"orama-suggestions":customElements.get(e)||es();break;case"orama-text":customElements.get(e)||ja();break}})}l(Fu,"defineCustomElement");var PN=".sc-orama-textarea-h{align-items:center;background:#fff;background:var(--background-color-secondary,#fff);border:1px solid #dadada;border:1px solid var(--border-color-primary,#dadada);border-radius:1rem;border-radius:var(--textarea-radius,var(--radius-l,calc(16rem/var(--orama-base-font-size, 16))));box-shadow:#fff;box-shadow:var(--textarea-shadow,var(--shadow-color-primary,#fff));display:flex;padding:.25rem .25rem .25rem .75rem;padding:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));position:relative}.sc-orama-textarea-s>[slot=adornment-end]{align-items:center;display:flex;justify-content:center}.textarea.sc-orama-textarea{background:none;border:none;color:#151515;color:var(--text-color-primary,#151515);font-family:inherit;font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)));font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);left:0;line-height:1.5;line-height:var(--font-line-height-m,1.5);margin:0;outline:none;padding:0;resize:none;right:0;transition:height .1s;width:100%}@media (min-width:768.02px){.textarea.sc-orama-textarea{font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));padding:.5rem 0;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) 0}}.textarea.sc-orama-textarea::-moz-placeholder{color:#99989d;color:var(--text-color-inactive,#99989d);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:95%}.textarea.sc-orama-textarea::placeholder{color:#99989d;color:var(--text-color-inactive,#99989d);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:95%}.textarea.sc-orama-textarea:focus-visible{border-color:#432d77;border-color:var(--border-color-accent,#432d77);outline:none}.textarea.sc-orama-textarea::-webkit-scrollbar{width:.3em}.textarea.sc-orama-textarea::-webkit-scrollbar-track{background:transparent}.textarea.sc-orama-textarea::-webkit-scrollbar-thumb{background-color:hsla(0,0%,70%,.522);border-radius:1rem;border-radius:var(--border-radius-l,calc(16rem/var(--orama-base-font-size, 16)))}@media (min-width:768.02px){.textarea.sc-orama-textarea{font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)))}}",ON=Jt(class extends Xt{static{l(this,"OramaTextarea")}constructor(){super(),this.__registerHost(),this.value="",this.minRows=1,this.autoFocus=!1,this.handleChange=e=>{let t=e.target;this.value||this.syncHeight(),this.value=t.value}}handleAutoFocusChange(){this.autoFocus&&this.textarea.focus()}componetWillLoad(){this.startAdornmentWidth=this.getNamedSlotWidth("adornment-start"),this.endAdornmentWidth=this.getNamedSlotWidth("adornment-end"),this.syncHeight(),this.autoFocus&&this.textarea.focus()}getNamedSlotWidth(e){let t=this.el.querySelector(`slot[name="${e}"]`);if(t){let r=t.assignedElements();if(r.length>0)return r[0].offsetWidth}return 0}handlePropsChange(){this.syncHeight()}getStyleValue(e){return Number.parseInt(e,10)||0}calculateTextareaStyles(){let e=this.textarea,t=window.getComputedStyle(e);if(t.width==="0px")return{outerHeightStyle:0,overflowing:!1};let r=this.shadowTextarea;r.style.width=t.width,r.value=e.value||this.placeholder||"x",r.value.slice(-1)===` `&&(r.value+=" ");let a=t.boxSizing,n=this.getStyleValue(t.paddingBottom)+this.getStyleValue(t.paddingTop),o=this.getStyleValue(t.borderBottomWidth)+this.getStyleValue(t.borderTopWidth),s=r.scrollHeight;r.value="x";let i=r.scrollHeight,c=s;this.minRows&&(c=Math.max(Number(this.minRows)*i,c)),this.maxRows&&(c=Math.min(Number(this.maxRows)*i,c)),c=Math.max(c,i);let u=c+(a==="border-box"?n+o:0),p=Math.abs(c-s)<=1;return{outerHeightStyle:u,overflowing:p}}syncHeight(){let e=this.calculateTextareaStyles();if(!e)return;let t=e.outerHeightStyle;this.height!==t&&(this.height=t,this.textarea.style.height=`${t}px`),this.textarea.style.overflow=e.overflowing?"hidden":""}getAllProps(){let e={};for(let t=0;tthis.textarea=e,"ref"),rows:Number(this.minRows),style:{height:this.height?`${this.height}px`:void 0,paddingLeft:this.startAdornmentWidth?`${this.startAdornmentWidth}px`:void 0,paddingRight:this.endAdornmentWidth?`${this.endAdornmentWidth}px`:void 0},class:"textarea",placeholder:this.placeholder})),z("slot",{key:"515eb08d900f216a6e1a70a45287750fb4eec53f",name:"adornment-end"}),z("textarea",{key:"76d4ec4a7a7ecae613a1dc47beec8716e652acab","aria-hidden":"true",readonly:!0,ref:l(e=>this.shadowTextarea=e,"ref"),tabindex:-1,class:"textarea",style:{visibility:"hidden",position:"absolute",overflow:"hidden",height:"0",top:"0",left:"0",transform:"translateZ(0)",paddingTop:"0",paddingBottom:"0",paddingLeft:this.startAdornmentWidth?`${this.startAdornmentWidth}px`:void 0,paddingRight:this.endAdornmentWidth?`${this.endAdornmentWidth}px`:void 0}}))}get el(){return this}static get watchers(){return{autoFocus:["handleAutoFocusChange"],value:["handlePropsChange"],maxRows:["handlePropsChange"],minRows:["handlePropsChange"]}}static get style(){return PN}},[6,"orama-textarea",{value:[1],maxRows:[8,"max-rows"],minRows:[8,"min-rows"],placeholder:[1],autoFocus:[4,"auto-focus"],height:[32],startAdornmentWidth:[32],endAdornmentWidth:[32]},void 0,{autoFocus:["handleAutoFocusChange"],value:["handlePropsChange"],maxRows:["handlePropsChange"],minRows:["handlePropsChange"]}]);function Wu(){typeof customElements>"u"||["orama-textarea"].forEach(e=>{switch(e){case"orama-textarea":customElements.get(e)||customElements.define(e,ON);break}})}l(Wu,"defineCustomElement");var RN=Object.defineProperty,LN=Object.getOwnPropertyDescriptor,sc=l((e,t,r,a)=>{for(var n=a>1?void 0:a?LN(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&RN(t,r,n),n},"a"),Fn=class extends ur{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${Fn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};Fn.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);Fn.styles=Pr` :host { display: contents; } `;sc([ve({type:String,reflect:!0})],Fn.prototype,"size",2);sc([ve({type:String,reflect:!0})],Fn.prototype,"weight",2);sc([ve({type:String,reflect:!0})],Fn.prototype,"color",2);sc([ve({type:Boolean,reflect:!0})],Fn.prototype,"mirrored",2);Fn=sc([Rr("ph-paper-plane-tilt")],Fn);var MN=Object.defineProperty,NN=Object.getOwnPropertyDescriptor,ic=l((e,t,r,a)=>{for(var n=a>1?void 0:a?NN(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&MN(t,r,n),n},"o"),Wn=class extends ur{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${Wn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};Wn.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);Wn.styles=Pr` :host { display: contents; } `;ic([ve({type:String,reflect:!0})],Wn.prototype,"size",2);ic([ve({type:String,reflect:!0})],Wn.prototype,"weight",2);ic([ve({type:String,reflect:!0})],Wn.prototype,"color",2);ic([ve({type:Boolean,reflect:!0})],Wn.prototype,"mirrored",2);Wn=ic([Rr("ph-stop-circle")],Wn);var DN='orama-chat{background:#fbfbfb;background:var(--background-color-primary,#fbfbfb);height:100%;overflow:hidden}.messages-container-wrapper,orama-chat{display:flex;flex-direction:column;flex-grow:1;position:relative}.messages-container-wrapper{overflow:auto;z-index:1}.messages-container-wrapper::-webkit-scrollbar{width:.3em}.messages-container-wrapper::-webkit-scrollbar-track{background:transparent}.messages-container-wrapper::-webkit-scrollbar-thumb{background-color:hsla(0,0%,70%,.522);border-radius:1rem;border-radius:var(--border-radius-l,calc(16rem/var(--orama-base-font-size, 16)))}.messages-container-wrapper.isEmpty{justify-content:flex-end}.messages-container-wrapper-non-scrollable{display:flex;flex-direction:column;flex-grow:1;overflow:hidden;position:relative;z-index:1}.lock-scroll-on-bottom-button-wrapper{align-items:center;background-color:transparent;background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6);border:none;border-radius:.75rem;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)));bottom:0;color:#99989d;color:var(--icon-color-tertiary,#99989d);cursor:pointer;display:flex;font-family:font("primary");font-family:var(--font-primary,font("primary"));height:-moz-fit-content;height:fit-content;justify-content:center;left:50%;margin:.25rem;margin:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));position:absolute;transform:translateX(-50%);width:-moz-fit-content;width:fit-content;z-index:2}.chat-form-wrapper{padding:.75rem 1rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16))) var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}.chat-input{margin-bottom:.5rem;margin-bottom:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}.disclaimer-text{color:#838289;color:var(--text-color-secondary,#838289);margin-top:.25rem;margin-top:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));opacity:.8}.suggestions-wrapper{display:flex;flex-direction:column;flex-grow:1;justify-content:end;overflow-x:auto}orama-logo-icon{position:absolute;right:50%;top:50%;transform:translate(50%,-50%);z-index:-1}',zN=function(e,t,r,a){var n=arguments.length,o=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(s=e[i])&&(o=(n<3?s(o):n>3?s(t,r,o):s(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o},ZN=1,_k=Jt(class extends Xt{static{l(this,"OramaChat")}constructor(){super(),this.__registerHost(),this.answerGenerated=Yt(this,"answerGenerated"),this.clearChat=Yt(this,"clearChat"),this.startConversation=Yt(this,"startConversation"),this.placeholder="Ask me anything",this.sourceBaseUrl="",this.showClearChat=!0,this.focusInput=!1,this.disclaimer="Orama can make mistakes. Please verify the information.",this.inputValue="",this.showGoToBottomButton=!1,this.triggerSendQuestion=(e,t)=>{if(this.chatStore.state.chatService===null)throw new Error("Chat Service is not initialized");this.startConversation.emit({userPrompt:e,systemPrompts:this.systemPrompts}),this.chatStore.state.chatService.sendQuestion(e,t,this.systemPrompts,{onAnswerGeneratedCallback:l(r=>this.answerGenerated.emit(r),"onAnswerGeneratedCallback")})},this.isScrolling=!1,this.prevScrollTop=0,this.scrollTarget=0,this.pendingNewInteractionSideEffects=!1,this.lockScrollOnBottom=!1,this.isDisconnecting=!1,this.handleFocus=()=>{if(this.focusInput){let e=this.textareaRef.querySelector("textarea");if(!e)return;requestAnimationFrame(()=>{e.focus()})}},this.calculateIsScrollOnBottom=()=>{let e=this.messagesContainerRef.scrollHeight-this.messagesContainerRef.clientHeight;return this.messagesContainerRef.scrollTop+ZN>=e},this.scrollToBottom=(e={animated:!0,onScrollDone:l(()=>{},"onScrollDone")})=>{if(!this.messagesContainerRef)return;if(!e.animated){this.messagesContainerRef.scrollTop=this.messagesContainerRef.scrollHeight,e.onScrollDone();return}this.isScrolling=!0;let t=performance.now(),r=this.messagesContainerRef.scrollTop,a=300,n=l(o=>{if(!this.messagesContainerRef||!this.isScrolling)return;let s=this.messagesContainerRef.scrollHeight-this.messagesContainerRef.clientHeight,i=o-t,c=Math.min(1,i/a),u=this.easeInOutQuad(c),p=r+(s-r)*u;this.messagesContainerRef.scrollTo(0,p),ie<.5?2*e*e:-1+(4-2*e)*e,this.recalculateGoBoToBottomButton=()=>{if(!this.calculateIsContainerOverflowing()){this.showGoToBottomButton=!1;return}this.showGoToBottomButton=!this.calculateIsScrollOnBottom()},this.handleWheel=e=>{if(!this.calculateIsContainerOverflowing()){this.lockScrollOnBottom=!1,this.showGoToBottomButton=!1;return}let t=this.messagesContainerRef.scrollTop;this.showGoToBottomButton=!this.calculateIsScrollOnBottom(),this.lockScrollOnBottom=!this.showGoToBottomButton,this.showGoToBottomButton||(this.isScrolling=!1),this.prevScrollTop=t},this.setSources=()=>{this.chatStore.state.sourceBaseURL=this.sourceBaseUrl,this.chatStore.state.sourcesMap=this.sourcesMap,this.chatStore.state.linksTarget=this.linksTarget,this.chatStore.state.linksRel=this.linksRel},this.handleSubmit=e=>{if(e.preventDefault(),this.chatStore.state.chatService===null)throw new Error("Chat Service is not initialized");this.startConversation.emit({userPrompt:this.inputValue,systemPrompts:this.systemPrompts}),this.chatStore.state.chatService.sendQuestion(this.inputValue,this.relatedQueries,this.systemPrompts,{onAnswerGeneratedCallback:l(t=>this.answerGenerated.emit(t),"onAnswerGeneratedCallback")}),this.chatStore.state.prompt=this.inputValue,this.inputValue=""},this.handleAbortAnswerClick=()=>{this.chatStore.state.chatService.abortAnswer()},this.handleSuggestionClick=(e,t)=>{if(this.chatStore.state.chatService===null)throw new Error("Chat Service is not initialized");this.startConversation.emit({userPrompt:e,systemPrompts:this.systemPrompts}),this.chatStore.state.chatService.sendQuestion(e,t,void 0,{onAnswerGeneratedCallback:l(r=>this.answerGenerated.emit(r),"onAnswerGeneratedCallback")}),this.inputValue=""},this.handleClearChat=()=>{this.chatStore.state.chatService.resetChat(),this.clearChat.emit()},this.calculateIsContainerOverflowing=()=>this.messagesContainerRef?this.messagesContainerRef.scrollHeight>this.messagesContainerRef.clientHeight:!1}handleSourceItemClick(e){}handleDefaultTermChange(){var e;this.defaultTerm&&((e=this.chatStore.state.chatService)===null||e===void 0||e.sendQuestion(this.defaultTerm,this.relatedQueries,this.systemPrompts,{onAnswerGeneratedCallback:l(t=>this.answerGenerated.emit(t),"onAnswerGeneratedCallback")}))}focusInputWatcher(){this.handleFocus()}promptWatcher(e,t){e!==t&&(this.triggerSendQuestion(e,this.relatedQueries),this.chatStore.state.prompt=e)}handleTextDictionaryChange(){var e,t;!((e=this.dictionary)===null||e===void 0)&&e.chatPlaceholder&&(this.placeholder=this.dictionary.chatPlaceholder),!((t=this.dictionary)===null||t===void 0)&&t.disclaimer&&(this.disclaimer=this.dictionary.disclaimer),console.log("Updated from dictionary:",{placeholder:this.placeholder,disclaimer:this.disclaimer,dictionary:this.dictionary})}componentWillLoad(){var e;this.handleTextDictionaryChange(),!this.disclaimer&&!((e=this.dictionary)===null||e===void 0)&&e.disclaimer?this.disclaimer=this.dictionary.disclaimer:this.disclaimer||(this.disclaimer="Orama can make mistakes. Please verify the information."),this.chatStore.on("set",(t,r,a)=>{t==="interactions"&&a?.length{this.recalculateGoBoToBottomButton()}),this.scrollableContainerResizeObserver.observe(this.messagesContainerRef),this.nonScrollableContainerResizeObserver=new ResizeObserver(()=>{if(this.pendingNewInteractionSideEffects){this.pendingNewInteractionSideEffects=!1,this.lockScrollOnBottom=!1,this.scrollToBottom({animated:!0,onScrollDone:l(()=>{this.recalculateGoBoToBottomButton()},"onScrollDone")});return}this.lockScrollOnBottom&&!this.isScrolling&&this.scrollToBottom({animated:!1,onScrollDone:l(()=>{this.recalculateGoBoToBottomButton()},"onScrollDone")}),this.recalculateGoBoToBottomButton()}),this.nonScrollableContainerResizeObserver.observe(this.nonScrollableMessagesContainerRef)}disconnectedCallback(){var e,t,r;this.isDisconnecting=!0,(e=this.messagesContainerRef)===null||e===void 0||e.removeEventListener("wheel",this.handleWheel),(t=this.scrollableContainerResizeObserver)===null||t===void 0||t.disconnect(),(r=this.nonScrollableContainerResizeObserver)===null||r===void 0||r.disconnect(),this.clearChatOnDisconnect&&this.chatStore&&this.chatStore.state&&(this.chatStore.state.interactions=[])}render(){var e,t,r;let a=(e=this.chatStore.state.interactions)===null||e===void 0?void 0:e[this.chatStore.state.interactions.length-1],n=a?.status,o=((t=this.chatStore.state.interactions)===null||t===void 0?void 0:t.length)>0;return z(ta,{key:"d8f4f1eafe32d3302f009099297fa2aa21767105"},this.showClearChat&&o&&z("div",{key:"e8e9a719801cc48f1bd65b99173d2dee1fb0e3f9",class:"header"},z("button",{key:"caba4adf41a26ec35a8380d0b0df2eaa25772dce",type:"button",onClick:this.handleClearChat},z("ph-arrow-clockwise",{key:"42dccc8772a5a5bf6e7e83085a588968bd9774bc",weight:"fill",size:"14"})," ",this.getText("clearChat"))),z("div",{key:"250f3f1abd7448cc9dcfd9e7d26d065f80f01813",class:"messages-container-wrapper-non-scrollable"},z("div",{key:"cbb11338d6347df3e3ef211c39cbfc84366aa765",class:`messages-container-wrapper ${o?"":"isEmpty"}`,ref:l(s=>this.messagesContainerRef=s,"ref")},z("div",{key:"7462c8f6833caa443fe77d6e6a8016cabec50c95",ref:l(s=>this.nonScrollableMessagesContainerRef=s,"ref")},o?z("orama-chat-messages-container",{interactions:this.chatStore.state.interactions,chatMarkdownLinkTitle:this.chatMarkdownLinkTitle,chatMarkdownLinkHref:this.chatMarkdownLinkHref}):null,o?null:z(po,null,z("slot",{name:"chat-empty-state"}),!!(!((r=this.suggestions)===null||r===void 0)&&r.length)&&z("div",{class:"suggestions-wrapper"},z("orama-suggestions",{suggestions:this.suggestions,suggestionClicked:this.handleSuggestionClick}))))),this.showGoToBottomButton&&z("button",{key:"4ba702c4b2ef9e7d54d344fed97b35feae00ecdf",class:"lock-scroll-on-bottom-button-wrapper",type:"button",onClick:l(()=>{this.lockScrollOnBottom=!0,this.scrollToBottom({animated:!0,onScrollDone:l(()=>this.recalculateGoBoToBottomButton(),"onScrollDone")})},"onClick")},z("ph-arrow-down",{key:"496705c2eeea58d202405e2eb2af9a60fdaca2ee",size:"18px"}))),z("div",{key:"afd6923df9fc9cd80af8efe9ad6fdc483f2f62c1",class:"chat-form-wrapper"},z("form",{key:"2119ea73c971f5c5f7634b7a140fd39b112ad200",onSubmit:this.handleSubmit},z("div",{key:"f28bfa0bd6575504bf4f9eb696b3eb13449afc25",class:"chat-input"},z("orama-textarea",{key:"3a62287fde2cd13bdd6237d7b853f26e2f267686",ref:l(s=>this.textareaRef=s,"ref"),autoFocus:this.focusInput,maxRows:4,value:this.inputValue,onKeyDown:l(s=>{s.key==="Enter"&&!s.shiftKey&&(this.handleSubmit(s),s.preventDefault())},"onKeyDown"),onInput:l(s=>{this.inputValue=s.target.value},"onInput"),placeholder:this.placeholder},z("div",{key:"2437be786888bdcc8b2983cb8a17411a03b3aeab",slot:"adornment-end"},[Br.streaming,Br.rendering,Br.loading].includes(n)?z("orama-button",{type:"submit",onClick:this.handleAbortAnswerClick,onKeyDown:this.handleAbortAnswerClick,disabled:n!==Br.rendering,"aria-label":"Abort answer"},z("ph-stop-circle",{size:16})):z("orama-button",{type:"submit",onClick:this.handleSubmit,onKeyDown:this.handleSubmit,disabled:!this.inputValue,"aria-label":"Send question"},z("ph-paper-plane-tilt",{size:16})))))),this.disclaimer&&z("orama-text",{key:"a65926093bda5820a477545da7ede16fd36d7c74",as:"p",styledAs:"small",align:"center",class:"disclaimer-text"},this.disclaimer)))}static get watchers(){return{defaultTerm:["handleDefaultTermChange"],focusInput:["focusInputWatcher"],prompt:["promptWatcher"],dictionary:["handleTextDictionaryChange"]}}static get style(){return DN}},[4,"orama-chat",{placeholder:[1],sourceBaseUrl:[1,"source-base-url"],linksTarget:[1,"links-target"],linksRel:[1,"links-rel"],sourcesMap:[16,"sources-map"],showClearChat:[4,"show-clear-chat"],defaultTerm:[1,"default-term"],focusInput:[4,"focus-input"],suggestions:[16],relatedQueries:[2,"related-queries"],prompt:[1],systemPrompts:[16,"system-prompts"],clearChatOnDisconnect:[4,"clear-chat-on-disconnect"],dictionary:[16],disclaimer:[1],chatMarkdownLinkTitle:[16,"chat-markdown-link-title"],chatMarkdownLinkHref:[16,"chat-markdown-link-href"],chatMarkdownLinkTarget:[16,"chat-markdown-link-target"],inputValue:[32],showGoToBottomButton:[32]},[[0,"sourceItemClick","handleSourceItemClick"]],{defaultTerm:["handleDefaultTermChange"],focusInput:["focusInputWatcher"],prompt:["promptWatcher"],dictionary:["handleTextDictionaryChange"]}]);zN([ro("chat")],_k.prototype,"chatStore",void 0);function fg(){typeof customElements>"u"||["orama-chat","orama-button","orama-chat-assistent-message","orama-chat-messages-container","orama-chat-user-message","orama-dots-loader","orama-markdown","orama-sources","orama-suggestions","orama-text","orama-textarea"].forEach(e=>{switch(e){case"orama-chat":customElements.get(e)||customElements.define(e,_k);break;case"orama-button":customElements.get(e)||yo();break;case"orama-chat-assistent-message":customElements.get(e)||tc();break;case"orama-chat-messages-container":customElements.get(e)||Fu();break;case"orama-chat-user-message":customElements.get(e)||oc();break;case"orama-dots-loader":customElements.get(e)||ti();break;case"orama-markdown":customElements.get(e)||Jo();break;case"orama-sources":customElements.get(e)||ri();break;case"orama-suggestions":customElements.get(e)||es();break;case"orama-text":customElements.get(e)||ja();break;case"orama-textarea":customElements.get(e)||Wu();break}})}l(fg,"defineCustomElement");var jN=Object.defineProperty,BN=Object.getOwnPropertyDescriptor,lc=l((e,t,r,a)=>{for(var n=a>1?void 0:a?BN(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&jN(t,r,n),n},"o"),qn=class extends ur{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${qn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};qn.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);qn.styles=Pr` :host { display: contents; } `;lc([ve({type:String,reflect:!0})],qn.prototype,"size",2);lc([ve({type:String,reflect:!0})],qn.prototype,"weight",2);lc([ve({type:String,reflect:!0})],qn.prototype,"color",2);lc([ve({type:Boolean,reflect:!0})],qn.prototype,"mirrored",2);qn=lc([Rr("ph-arrow-clockwise")],qn);var HN=":host{display:flex;flex-grow:1}.header{background:#fbfbfb;background:var(--background-color-primary,#fbfbfb);padding:.75rem 1rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16))) var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)));text-align:end;transition:opacity .2s}.header.hidden button{opacity:0;pointer-events:none}.header button{align-items:center;background-color:transparent;border:none;border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)));cursor:pointer;display:inline-flex;font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));gap:.25rem;gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));padding:.125rem .25rem;padding:var(--spacing-2xs,calc(2rem/var(--orama-base-font-size, 16))) var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));transition:color .2s;transition:background-color .2s}.header button,.header button:hover{color:#99989d;color:var(--text-color-tertiary,#99989d)}.header button:hover{background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6)}",kk=Jt(class extends Xt{static{l(this,"ChatBox")}constructor(){super(),this.__registerHost(),this.__attachShadow(),this.answerGenerated=Yt(this,"answerGenerated"),this.clearChat=Yt(this,"clearChat"),this.startConversation=Yt(this,"startConversation"),this.answerSourceClick=Yt(this,"answerSourceClick"),this.chatMarkdownLinkClicked=Yt(this,"chatMarkdownLinkClicked"),this.autoFocus=!0,this.clearChatOnDisconnect=!0,this.dictionary={},this.colorScheme="light",this.componentID=$u("chat-box"),this.systemScheme="light",this.onPrefersColorSchemeChange=e=>{this.systemScheme=e.matches?"dark":"light",this.updateTheme()}}getText(e){let t={chatPlaceholder:this.placeholder};return ai(e,this.dictionary,t)}watchHandler(){this.chatStore&&(this.startChatService(),this.updateTheme())}handleTextDictionaryChange(e){if(typeof e=="string")try{this.dictionary=JSON.parse(e)}catch(t){console.error("Error parsing dictionary:",t)}}componentWillLoad(){this.htmlElement.id=this.componentID,this.schemaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.systemScheme=this.schemaQuery.matches?"dark":"light",this.updateTheme(),this.schemaQuery.addEventListener("change",this.onPrefersColorSchemeChange),this.startChatService()}componentDidLoad(){this.htmlElement.id=this.componentID,this.startChatService()}getOldOramaClient(){if(!this.oramaCoreClientInstance)return this.clientInstance?this.clientInstance:R0(this.index)}startChatService(){if(!this.index&&!this.clientInstance&&!this.oramaCoreClientInstance){console.error("Missing Index, ClientInstance or OramaCoreClientInstance");return}O0(this.htmlElement,this.index,this.clientInstance,this.oramaCoreClientInstance);let e=this.getOldOramaClient();this.chatStore.state.chatService=new wk(e,this.oramaCoreClientInstance,this.chatStore),this.chatStore.state.chatService||console.error("Failed to initialize chat service")}updateTheme(){let e=Pu(this.htmlElement,this.colorScheme,this.systemScheme);Ou(this.htmlElement,e,this.themeConfig)}connectedCallback(){this.chatStore=tu("chat",this.componentID)}disconnectedCallback(){var e;p4(this.componentID),(e=this.schemaQuery)===null||e===void 0||e.removeEventListener("change",this.onPrefersColorSchemeChange)}render(){var e,t;if(!this.chatStore.state.chatService)return null;let r=this.colorScheme==="system"?this.systemScheme:this.colorScheme||"dark";return z(ta,{class:`theme-${r}`},z("orama-chat",{placeholder:this.getText("chatPlaceholder"),sourceBaseUrl:this.sourceBaseUrl,sourcesMap:this.sourcesMap,suggestions:this.suggestions,relatedQueries:this.relatedQueries,focusInput:this.autoFocus,systemPrompts:this.systemPrompts,prompt:this.prompt,clearChatOnDisconnect:this.clearChatOnDisconnect,chatMarkdownLinkTitle:this.chatMarkdownLinkTitle,chatMarkdownLinkHref:this.chatMarkdownLinkHref,dictionary:this.dictionary,disclaimer:this.disclaimer},!!(!((t=(e=this.chatStore.state)===null||e===void 0?void 0:e.interactions)===null||t===void 0)&&t.length)&&z("div",{slot:"chat-empty-state"},z("slot",{name:"empty-state"}))))}get htmlElement(){return this}static get watchers(){return{index:["watchHandler"],themeConfig:["watchHandler"],colorScheme:["watchHandler"],oramaCoreClientInstance:["watchHandler"],clientInstance:["watchHandler"],dictionary:["handleTextDictionaryChange"]}}static get style(){return HN}},[1,"orama-chat-box",{index:[16],clientInstance:[16,"client-instance"],oramaCoreClientInstance:[16,"orama-core-client-instance"],sourceBaseUrl:[1,"source-base-url"],linksTarget:[1,"links-target"],linksRel:[1,"links-rel"],placeholder:[1],sourcesMap:[16,"sources-map"],suggestions:[16],relatedQueries:[2,"related-queries"],autoFocus:[4,"auto-focus"],systemPrompts:[16,"system-prompts"],prompt:[1],clearChatOnDisconnect:[4,"clear-chat-on-disconnect"],chatMarkdownLinkTitle:[16,"chat-markdown-link-title"],chatMarkdownLinkHref:[16,"chat-markdown-link-href"],chatMarkdownLinkTarget:[16,"chat-markdown-link-target"],dictionary:[16],disclaimer:[1],themeConfig:[16,"theme-config"],colorScheme:[1,"color-scheme"],componentID:[32],systemScheme:[32]},void 0,{index:["watchHandler"],themeConfig:["watchHandler"],colorScheme:["watchHandler"],oramaCoreClientInstance:["watchHandler"],clientInstance:["watchHandler"],dictionary:["handleTextDictionaryChange"]}]);function Sk(){typeof customElements>"u"||["orama-chat-box","orama-button","orama-chat","orama-chat-assistent-message","orama-chat-messages-container","orama-chat-user-message","orama-dots-loader","orama-markdown","orama-sources","orama-suggestions","orama-text","orama-textarea"].forEach(e=>{switch(e){case"orama-chat-box":customElements.get(e)||customElements.define(e,kk);break;case"orama-button":customElements.get(e)||yo();break;case"orama-chat":customElements.get(e)||fg();break;case"orama-chat-assistent-message":customElements.get(e)||tc();break;case"orama-chat-messages-container":customElements.get(e)||Fu();break;case"orama-chat-user-message":customElements.get(e)||oc();break;case"orama-dots-loader":customElements.get(e)||ti();break;case"orama-markdown":customElements.get(e)||Jo();break;case"orama-sources":customElements.get(e)||ri();break;case"orama-suggestions":customElements.get(e)||es();break;case"orama-text":customElements.get(e)||ja();break;case"orama-textarea":customElements.get(e)||Wu();break}})}l(Sk,"defineCustomElement$1");var UN=kk,VN=Sk,Ik=l(({name:e,size:t=24,color:r="black"})=>z("div",{innerHTML:l(a=>({star:` `,starFour:` `})[a]||"","getIconSvg")(e),style:{width:`${t}px`,height:`${t}px`,fill:r,display:"inline-block",verticalAlign:"middle"}}),"Icon"),FN=Object.defineProperty,WN=Object.getOwnPropertyDescriptor,cc=l((e,t,r,a)=>{for(var n=a>1?void 0:a?WN(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&FN(t,r,n),n},"a"),Kn=class extends ur{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${Kn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};Kn.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);Kn.styles=Pr` :host { display: contents; } `;cc([ve({type:String,reflect:!0})],Kn.prototype,"size",2);cc([ve({type:String,reflect:!0})],Kn.prototype,"weight",2);cc([ve({type:String,reflect:!0})],Kn.prototype,"color",2);cc([ve({type:Boolean,reflect:!0})],Kn.prototype,"mirrored",2);Kn=cc([Rr("ph-arrow-bend-down-left")],Kn);var qN='@keyframes shine{0%{background-position:0 50%}to{background-position:150%;opacity:0}}@keyframes animBg{0%{background:#eee9f6;background:var(--background-color-tertiary,#eee9f6)}70%{background:#eee9f6;background:var(--background-color-tertiary,#eee9f6)}to{background:transparent}}@keyframes steam{0%{background-position:0 50%}50%{background-position:75% 50%}to{background-position:0 50%}}.sc-orama-chat-button-h{border-bottom:1px solid #dadada;border-bottom:1px solid var(--border-color-primary,#dadada);padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}.chat-button.sc-orama-chat-button{align-items:center;background:transparent;border:1px solid transparent;border-radius:.5rem;border-radius:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));color:#151515;color:var(--text-color-primary,#151515);cursor:pointer;display:flex;font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);gap:.5rem;gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));line-height:1.5;line-height:var(--font-line-height-m,1.5);margin:0;padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));position:relative;width:100%}@media (min-width:768.02px){.chat-button.sc-orama-chat-button{font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)))}}@media (hover:hover){.chat-button.sc-orama-chat-button:hover{background:#eee9f6;background:var(--background-color-tertiary,#eee9f6)}}.chat-button.sc-orama-chat-button:focus-visible{border:1px solid #432d77;border:1px solid var(--border-color-accent,#432d77);outline:none}.chat-button.is-active.sc-orama-chat-button{background:#eee9f6;background:var(--background-color-tertiary,#eee9f6)}.chat-button.is-highlighted.sc-orama-chat-button:after,.chat-button.is-highlighted.sc-orama-chat-button:before{animation:shine 1s linear 1 forwards;background:linear-gradient(90deg,transparent 0,transparent 20%,#432d77 40%,#432d77 60%,transparent 80%,transparent);background:linear-gradient(to right,var(--chat-button-border-color-gradientOne,transparent) 0,var(--chat-button-border-color-gradientTwo,transparent) 20%,var(--chat-button-border-color-gradientThree,#432d77) 40%,var(--chat-button-border-color-gradientFour,#432d77) 60%,var(--chat-button-border-color-gradientFive,transparent) 80%,var(--chat-button-border-color-gradientSix,transparent) 100%);background-size:150% auto;border-radius:.5rem;border-radius:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));content:"";display:block;height:calc(100% + 4px);left:-2px;overflow:hidden;position:absolute;top:-2px;width:calc(100% + 4px);z-index:-1}.chat-button.is-highlighted.sc-orama-chat-button:after{filter:blur(3px);height:100%;width:100%}.icon-star.sc-orama-chat-button{align-items:center;background:linear-gradient(79deg,#432d77 -45%,transparent 75%);background:linear-gradient(79deg,var(--chat-button-background-color-gradientOne,#432d77) -45%,var(--chat-button-backgroun-color-gradientTwo,transparent) 75%);background-size:200% auto;border-radius:.375rem;border-radius:var(--radius-xs,calc(6rem/var(--orama-base-font-size, 16)));display:flex;padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}.is-highlighted.sc-orama-chat-button .icon-star.sc-orama-chat-button{animation:steam 1.4s linear 1 forwards}.icon-enter.sc-orama-chat-button{align-items:center;border:.7px solid #dadada;border:.7px solid var(--border-color-primary,#dadada);border-radius:.375rem;border-radius:var(--radius-xs,calc(6rem/var(--orama-base-font-size, 16)));display:flex;justify-self:flex-end;padding:.25rem;padding:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)))}.button-label.sc-orama-chat-button{flex-grow:1;text-align:left}',KN=Jt(class extends Xt{static{l(this,"OramaChatButton")}constructor(){super(),this.__registerHost(),this.active=!1,this.highlight=!1}highlightButton(){this.active&&!this.highlight&&(this.highlight=!0)}render(){let e=["label","onClick","class"],t=Wl(this.el,e);return z(ta,{key:"cc45b1355726ff5bf65b39f4243f6f0d227d0c80",class:this.class},z("button",Object.assign({key:"4a312f0e559412dee000149b4f3cf74cfe858c0e",class:{"chat-button":!0,"is-active":this.active,"is-highlighted":this.highlight}},t,{type:"button"}),z("span",{key:"9a10019c4b275d05978ecad9abcffb058d782943",class:"icon-star"},z(Ik,{key:"82edfc1787227fb15f3fefedecf57e2a0e74d8b3",name:"star",size:16})),z("span",{key:"13e4d54e9296f513735f6081caaf060cc9511905",class:"button-label"},this.label),z("span",{key:"3c98e473b7b88034a316590bae6de3d1c1ca4dd4",class:"icon-enter"},z("ph-arrow-bend-down-left",{key:"36f9ce444b33abaef5cfdf81d0d0d2b199f8590f",size:12}))))}get el(){return this}static get watchers(){return{active:["highlightButton"],highlight:["highlightButton"]}}static get style(){return qN}},[2,"orama-chat-button",{label:[1],active:[4],highlight:[1028],class:[1]},void 0,{active:["highlightButton"],highlight:["highlightButton"]}]);function Ck(){typeof customElements>"u"||["orama-chat-button"].forEach(e=>{switch(e){case"orama-chat-button":customElements.get(e)||customElements.define(e,KN);break}})}l(Ck,"defineCustomElement");var GN=".embed.sc-orama-embed{background-color:#fbfbfb;background-color:var(--background-color-primary,#fbfbfb);border:1px solid #dadada;border:1px solid var(--border-color-primary,#dadada);border-radius:.75rem;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)));box-sizing:border-box;display:flex;flex-direction:column;height:100%;inset:0;margin:0 auto;max-height:100%;min-height:25rem;min-height:calc(400rem/var(--orama-base-font-size, 16));overflow:hidden;padding:0;width:100%}@media (min-width:1024.02px){.embed.sc-orama-embed{background-color:#fff;background-color:var(--background-color-secondary,#fff)}.embed.sc-orama-embed orama-input.sc-orama-embed{border-radius:0;margin:0;padding:0}.embed.sc-orama-embed input[type=search].sc-orama-embed{border-radius:.75rem .75rem 0 0;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16))) var(--radius-m,calc(12rem/var(--orama-base-font-size, 16))) 0 0}}",YN=Jt(class extends Xt{static{l(this,"OramaEmbed")}constructor(){super(),this.__registerHost()}render(){return z("div",{key:"c4f1a3153fdf088695965527a5a19858b758e352",class:"embed"},z("slot",{key:"59d5f6aba110055ed97309465a5e77192bc5359f"}))}static get style(){return GN}},[6,"orama-embed"]);function Ak(){typeof customElements>"u"||["orama-embed"].forEach(e=>{switch(e){case"orama-embed":customElements.get(e)||customElements.define(e,YN);break}})}l(Ak,"defineCustomElement");var QN=".facets-list.sc-orama-facets{align-items:center;-moz-column-gap:.5rem;column-gap:.5rem;-moz-column-gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));column-gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));display:flex;list-style:none;margin:0;overflow-x:auto;padding:1rem;padding:var(--radius-l,calc(16rem/var(--orama-base-font-size, 16)));scroll-snap-type:y mandatory}.facets-list.sc-orama-facets::-webkit-scrollbar{background-color:transparent;height:0}@media (min-width:1024.02px){.facets-list.sc-orama-facets{padding:1rem .25rem .5rem;padding:var(--radius-l,calc(16rem/var(--orama-base-font-size, 16))) var(--radius-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)))}}.facet.sc-orama-facets{scroll-snap-align:start}.facet-button.sc-orama-facets{background-color:transparent;border:1px solid #dadada;border:1px solid var(--border-color-primary,#dadada);border-radius:2.5rem;border-radius:var(--radius-3xl,calc(40rem/var(--orama-base-font-size, 16)));color:#151515;color:var(--text-color-primary,#151515);-moz-column-gap:.25rem;column-gap:.25rem;-moz-column-gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));column-gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));cursor:pointer;display:flex;font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.25;line-height:var(--font-line-height-s,1.25);margin:0;padding:.5rem .75rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));width:-moz-max-content;width:max-content}.facet-button--selected.sc-orama-facets{border-color:#432d77;border-color:var(--border-color-accent,#432d77)}@media (min-width:1024.02px){.facet-button.sc-orama-facets{padding:.25rem .75rem;padding:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}}.facet-button.sc-orama-facets:focus{border-color:#432d77;border-color:var(--border-color-accent,#432d77);outline:1px solid #432d77;outline:1px solid var(--border-color-accent,#432d77)}.facet-count.sc-orama-facets{color:#99989d;color:var(--text-color-tertiary,#99989d)}",XN=Jt(class extends Xt{static{l(this,"OramaFacets")}constructor(){super(),this.__registerHost()}handleClick(e){this.selectedFacetChanged(e.name)}getFacetButtonElementId(e){return`${e}-facet-button`}setFocusToFacetElement(e){let t=this.facetListRef.getElementsByTagName("button");for(let r=0;rr.name===this.selectedFacet):0;e.key==="ArrowRight"&&(t1?this.selectedFacetChanged(this.facets[t-1].name):t-1===0?this.selectedFacetChanged(""):this.selectedFacetChanged(this.facets[this.facets.length-1].name))}}render(){var e;return!this.facets||this.facets.every(t=>!t.count)?null:z("ul",{class:"facets-list",ref:l(t=>this.facetListRef=t,"ref")},(e=this.facets)===null||e===void 0?void 0:e.map(t=>{if(t?.count===0)return;let r=this.selectedFacet===t?.name||!this.selectedFacet&&t?.name==="All";return z("li",{key:t.name,class:"facet"},z("button",{id:this.getFacetButtonElementId(t.name),type:"button",class:{"facet-button":!0,"facet-button--selected":r},tabIndex:r?0:-1,onClick:l(()=>this.handleClick(t),"onClick")},t?.name,z("span",{class:"facet-count"},t?.count)))}))}static get watchers(){return{selectedFacet:["handleSelectedFacetChange"]}}static get style(){return QN}},[2,"orama-facets",{facets:[16],selectedFacet:[1,"selected-facet"],selectedFacetChanged:[16,"selected-facet-changed"]},[[0,"keydown","handleKeyDown"]],{selectedFacet:["handleSelectedFacetChange"]}]);function mg(){typeof customElements>"u"||["orama-facets"].forEach(e=>{switch(e){case"orama-facets":customElements.get(e)||customElements.define(e,XN);break}})}l(mg,"defineCustomElement");var JN=Object.defineProperty,eD=Object.getOwnPropertyDescriptor,dc=l((e,t,r,a)=>{for(var n=a>1?void 0:a?eD(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&JN(t,r,n),n},"o"),Gn=class extends ur{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${Gn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};Gn.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);Gn.styles=Pr` :host { display: contents; } `;dc([ve({type:String,reflect:!0})],Gn.prototype,"size",2);dc([ve({type:String,reflect:!0})],Gn.prototype,"weight",2);dc([ve({type:String,reflect:!0})],Gn.prototype,"color",2);dc([ve({type:Boolean,reflect:!0})],Gn.prototype,"mirrored",2);Gn=dc([Rr("ph-arrow-up")],Gn);var tD=".sc-orama-footer-h{align-items:center;background-color:#fff;background-color:var(--background-color-secondary,#fff);border-radius:0 0 .75rem .75rem;border-radius:0 0 var(--radius-m,calc(12rem/var(--orama-base-font-size, 16))) var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)));border-top:1px solid #dadada;border-top:1px solid var(--border-color-primary,#dadada);display:flex;justify-content:space-between;padding:.75rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}.keyboard-shortcuts.sc-orama-footer{align-items:center;display:flex;gap:.75rem;gap:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}.shortcut-item.sc-orama-footer{align-items:center;display:flex;font-size:1rem;font-size:calc(16rem/var(--orama-base-font-size, 16));gap:.25rem;gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)))}.shortcut-description.sc-orama-footer,.shortcut-icon.sc-orama-footer{color:#99989d;color:var(--text-color-tertiary,#99989d)}.shortcut-icon.sc-orama-footer{align-items:center;background:#eee9f6;background:var(--background-color-fourth,#eee9f6);border:.7px solid #dadada;border:.7px solid var(--border-color-primary,#dadada);border-radius:.375rem;border-radius:var(--radius-xs,calc(6rem/var(--orama-base-font-size, 16)));display:flex;justify-content:center;justify-self:flex-end;padding:.25rem;padding:calc(4rem/var(--orama-base-font-size, 16))}.arrows-container.sc-orama-footer{align-items:center;display:flex;gap:.25rem;gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)))}.esc-text.sc-orama-footer{font-size:.7rem}.powered-by.sc-orama-footer{align-items:flex-end;display:flex;flex-grow:1;justify-content:right;text-align:right}.logo-link.sc-orama-footer,.powered-by.sc-orama-footer{gap:.5rem;gap:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}.logo-link.sc-orama-footer{align-items:center;display:inline-flex;justify-content:center;text-decoration:none}.logo-link.sc-orama-footer:focus-visible{border:1px solid #432d77;border:1px solid var(--border-color-accent,#432d77);outline:none}.logo.sc-orama-footer{max-width:3.875rem;max-width:calc(62rem/var(--orama-base-font-size, 16))}@media (max-width:768px){.sc-orama-footer-h{flex-direction:column;gap:.75rem;gap:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}.keyboard-shortcuts.sc-orama-footer{display:none}.powered-by.sc-orama-footer{justify-content:center}}",rD=Jt(class extends Xt{static{l(this,"OramaFooter")}constructor(){super(),this.__registerHost(),this.colorScheme="light",this.showKeyboardShortcuts=!1,this.linkTarget="_blank",this.keyboardShortcuts=[{name:"select",key:"Enter",icon:"arrow-bend-down-left",description:"to select"},{name:"navigate",key:"\u2191 \u2193",icon:"arrows-vertical",description:"to navigate"},{name:"close",key:"Esc",icon:"esc",description:"to close"}]}componentWillLoad(){let e=encodeURIComponent(window.location.hostname);this.poweredByDestinationUrl=`https://www.orama.com/?utm_source=${e}&utm_medium=powered-by`,["localhost","orama.com"].includes(e)&&(this.linkTarget="_parent")}renderIcon(e){if(e.icon==="esc")return z("div",null,z("span",{class:"shortcut-icon"},z("span",{class:"esc-text"},"esc")));switch(e.icon){case"arrow-bend-down-left":return z("span",{class:"shortcut-icon"},z("ph-arrow-bend-down-left",{size:16}));case"arrows-vertical":return z("div",{class:"arrows-container"},z("span",{class:"shortcut-icon"},z("ph-arrow-up",{size:16})),z("span",{class:"shortcut-icon"},z("ph-arrow-down",{size:16})));default:return null}}render(){let e=this.colorScheme==="dark"?"orama-when-dark.svg":"orama-when-light.svg";return z(ta,{key:"b21ad31b55a56c189efdf83b7f745dfc149af388"},this.showKeyboardShortcuts&&z("div",{key:"0af21a82002e38855e83176b7e6dc0f2e8aebe8b",class:"keyboard-shortcuts","aria-label":"Keyboard shortcuts"},this.keyboardShortcuts.map(t=>z("div",{class:"shortcut-item"},this.renderIcon(t),z("orama-text",{as:"small",variant:"tertiary"},z("span",{class:"shortcut-description"},t.description))))),z("div",{key:"67dec2fc22297ff7a7f47eb4e112b14a3801c378",class:"powered-by"},z("a",{key:"ef8d9ea69bb7207ea1279ede9576e4cb03d4cf12",href:this.poweredByDestinationUrl,target:this.linkTarget,rel:"noopener noreferrer",class:"logo-link"},z("orama-text",{key:"49bcbd36198dfd2200d6902f65ea88f573974c4e",as:"small"},"Powered by"),z("img",{key:"f8d46510486a83866fa3b24f5d38f60fe8ce3d6b",src:`https://website-assets.oramasearch.com/${e}`,alt:"Powered by Orama",class:"logo",width:62}))))}get el(){return this}static get style(){return tD}},[2,"orama-footer",{class:[1],colorScheme:[16,"color-scheme"],showKeyboardShortcuts:[4,"show-keyboard-shortcuts"]}]);function Tk(){typeof customElements>"u"||["orama-footer","orama-text"].forEach(e=>{switch(e){case"orama-footer":customElements.get(e)||customElements.define(e,rD);break;case"orama-text":customElements.get(e)||ja();break}})}l(Tk,"defineCustomElement");var aD=Object.defineProperty,nD=Object.getOwnPropertyDescriptor,uc=l((e,t,r,a)=>{for(var n=a>1?void 0:a?nD(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&aD(t,r,n),n},"o"),Yn=class extends ur{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${Yn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};Yn.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);Yn.styles=Pr` :host { display: contents; } `;uc([ve({type:String,reflect:!0})],Yn.prototype,"size",2);uc([ve({type:String,reflect:!0})],Yn.prototype,"weight",2);uc([ve({type:String,reflect:!0})],Yn.prototype,"color",2);uc([ve({type:Boolean,reflect:!0})],Yn.prototype,"mirrored",2);Yn=uc([Rr("ph-x")],Yn);var oD=Object.defineProperty,sD=Object.getOwnPropertyDescriptor,hc=l((e,t,r,a)=>{for(var n=a>1?void 0:a?sD(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&oD(t,r,n),n},"s"),Qn=class extends ur{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${Qn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};Qn.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);Qn.styles=Pr` :host { display: contents; } `;hc([ve({type:String,reflect:!0})],Qn.prototype,"size",2);hc([ve({type:String,reflect:!0})],Qn.prototype,"weight",2);hc([ve({type:String,reflect:!0})],Qn.prototype,"color",2);hc([ve({type:Boolean,reflect:!0})],Qn.prototype,"mirrored",2);Qn=hc([Rr("ph-magnifying-glass")],Qn);var iD=".sc-orama-input-h{margin:.5rem 0;margin:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) 0}.input-wrapper.sc-orama-input{position:relative}.input.sc-orama-input{background:#fff;background:var(--background-color-secondary,#fff);border:1px solid #dadada;border:1px solid var(--border-color-primary,#dadada);border-radius:.75rem;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)));color:#151515;color:var(--text-color-primary,#151515);font-size:1rem;font-size:var(--font-size-md,calc(16rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.5;line-height:var(--font-line-height-m,1.5);margin:0;padding:0;width:100%}@media (min-width:768.02px){.input.sc-orama-input{font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)))}}.input.sc-orama-input::-moz-placeholder{color:#99989d;color:var(--text-color-inactive,#99989d)}.input.sc-orama-input::placeholder{color:#99989d;color:var(--text-color-inactive,#99989d)}.input[type=search].sc-orama-input{padding-right:2rem;padding-right:var(--spacing-2xl,calc(32rem/var(--orama-base-font-size, 16)))}@media (min-width:1024.02px){.input[type=search].sc-orama-input{border:0;border-bottom:1px solid #dadada;border-bottom:1px solid var(--border-color-primary,#dadada);padding-left:2.5rem;padding-left:var(--spacing-3xl,calc(40rem/var(--orama-base-font-size, 16)))}}.input[type=search].sc-orama-input::-webkit-search-cancel-button,.input[type=search].sc-orama-input::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.input.sc-orama-input:focus{outline:none}.input.sc-orama-input:focus-visibile{border:1px solid #432d77;border:1px solid var(--border-color-accent,#432d77);outline:none}.input--small.sc-orama-input{padding:.25rem .5rem;padding:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}.input--medium.sc-orama-input{padding:.5rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}.input--large.sc-orama-input{padding:.75rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}.label.sc-orama-input{color:#151515;color:var(--text-color-primary,#151515);display:block;font-size:.875rem;font-size:var(--font-size-sm,calc(14rem/var(--orama-base-font-size, 16)));font-weight:400;font-weight:var(--font-weight-normal,400);line-height:1.25;line-height:var(--font-line-height-s,1.25);margin:0 0 .25rem;margin-bottom:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));padding:0}.reset-button.sc-orama-input{background-color:transparent;border:0;color:#99989d;color:var(--icon-color-inactive,#99989d);cursor:pointer;display:inline-flex;position:absolute;right:.5rem;right:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));top:50%;transform:translate3d(0,-50%,0)}.reset-button.sc-orama-input:focus{outline:none}.reset-button.sc-orama-input:focus-visible{border:1px solid #432d77;border:1px solid var(--border-color-accent,#432d77)}.search-icon.sc-orama-input{color:#99989d;color:var(--icon-color-inactive,#99989d);display:none;left:1rem;left:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)));position:absolute;top:50%;transform:translate3d(0,-50%,0);z-index:100}@media (min-width:1024.02px){.search-icon.sc-orama-input{display:inline-flex}}.sr-only.sc-orama-input{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}",lD=Jt(class extends Xt{static{l(this,"Input")}constructor(){super(),this.__registerHost(),this.inputChanged=Yt(this,"inputChanged"),this.size="medium",this.type="text",this.autoFocus=!1}handleAutoFocusChange(){var e;this.autoFocus&&((e=this.inputRef)===null||e===void 0||e.focus())}ensureFocus(){let e=setInterval(()=>{this.inputRef&&(this.inputRef.focus(),clearInterval(e))},10)}componentDidLoad(){this.autoFocus&&this.ensureFocus()}render(){let e=`input input--${this.size}`,t=`label ${this.labelForScreenReaders?"sr-only":""}`,r=["id","name","type","class","onInput","value","label-for-screen-readers","default-value","placeholder"],a=Wl(this.el,r),n=this.type==="search";return z(ta,{key:"2618def598b4bcffcb974d761937c304f36d70cf"},z("div",{key:"07b0b637d645dfcd43dab6f20256b548f42672bb",class:"wrapper"},z("label",{key:"c8e3e0ee0962064c613ccbfa459873e8e80ee32a",htmlFor:this.name,class:t},this.label||this.labelForScreenReaders),z("div",{key:"7c78f6d5e491b17094d86ef89c4461178e1e620c",class:"input-wrapper"},n&&z("span",{key:"07a43ba5606596d2b2834bb3dc040573d7039a05",class:"search-icon"},z("ph-magnifying-glass",{key:"3097468ab3864e7a29121e5f5978cf6f4a14f006",size:16})),z("input",Object.assign({key:"5ee32af4e927d3f717345a2d2337793ba28d9c43"},a,{ref:l(o=>{this.inputRef=o},"ref"),class:e,id:this.name,type:this.type,value:this.value,onInput:l(o=>{let s=o.target;this.inputChanged.emit(s.value)},"onInput"),placeholder:this.placeholder})),n&&!!this.value&&z("button",{key:"36eb9d184140ee98115527b8470ef60c3a32aae3",type:"button",class:"reset-button",onClick:l(()=>{var o;this.inputRef&&(this.inputRef.value=""),this.inputChanged.emit(""),(o=this.inputRef)===null||o===void 0||o.focus()},"onClick")},z("ph-x",{key:"0a50b53d7cf5e86ed30d72c6e099f1dcc35ed925",size:16})))))}get el(){return this}static get watchers(){return{autoFocus:["handleAutoFocusChange"]}}static get style(){return iD}},[2,"orama-input",{name:[1],size:[1],label:[1],type:[1],placeholder:[1],labelForScreenReaders:[1,"label-for-screen-readers"],defaultValue:[1,"default-value"],autoFocus:[4,"auto-focus"],value:[1]},void 0,{autoFocus:["handleAutoFocusChange"]}]);function gg(){typeof customElements>"u"||["orama-input"].forEach(e=>{switch(e){case"orama-input":customElements.get(e)||customElements.define(e,lD);break}})}l(gg,"defineCustomElement");var cD=j4,dD=Jo,uD=".modal.sc-orama-modal{background-color:hsla(0,0%,98%,.7);background-color:var(--backdrop-background-color-primary,hsla(0,0%,98%,.7));display:none;height:100%;left:0;position:fixed;top:0;width:100%;z-index:9999}.modal.open.sc-orama-modal{display:block}dialog.sc-orama-modal{border:none}.modal-content.sc-orama-modal{background-color:#fbfbfb;background-color:var(--background-color-primary,#fbfbfb);display:flex;flex-direction:column;inset:0;justify-content:space-between;position:fixed}@media (min-width:1024.02px){.modal-content.sc-orama-modal{background-color:#fff;background-color:var(--background-color-secondary,#fff);border:1px solid #dadada;border:1px solid var(--border-color-primary,#dadada);border-radius:.75rem;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16)));bottom:auto;margin:0 auto;max-height:70vh;max-width:45rem;max-width:calc(720rem/var(--orama-base-font-size, 16));min-height:12.5rem;min-height:calc(200rem/var(--orama-base-font-size, 16));padding:0;top:5vh;width:80%}}.modal-close.sc-orama-modal:not(:focus-visible){clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.modal-title.sc-orama-modal{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}",hD=Jt(class extends Xt{static{l(this,"OramaModal")}constructor(){super(),this.__registerHost(),this.modalClosed=Yt(this,"modalClosed"),this.closeOnEscape=!0,this.closeOnOutsideClick=!0,this.mainTitle="",this.originalBodyOverflowState="scroll"}trapFocus(e){let t=this.el.querySelectorAll('a[href], button, textarea, input, select, [tabindex]:not([tabindex="-1"])'),r=Array.from(t).filter(a=>a.offsetParent!==null);if(r.length>0){this.firstFocusableElement=r[0],this.lastFocusableElement=r[r.length-1];let a=this.el.querySelector(":focus");e.shiftKey&&a===this.firstFocusableElement?(e.preventDefault(),this.lastFocusableElement.focus()):!e.shiftKey&&a===this.lastFocusableElement&&(e.preventDefault(),this.firstFocusableElement.focus())}}handleFocus(){let e=this.el.querySelectorAll('a[href], button, textarea, input, select, [tabindex]:not([tabindex="-1"])'),t=Array.from(e).filter(r=>r.offsetParent!==null);t.length>0&&t[0].focus()}connectedCallback(){this.originalBodyOverflowState=document.body.style.overflow,this.activeElement=document.activeElement,this.handleFocus(),document.body.style.overflow="hidden"}disconnectedCallback(){document.body.style.overflow=this.originalBodyOverflowState}componentDidUpdate(){this.handleFocus(),this.activeElement&&this.activeElement.focus()}render(){return z("dialog",{key:"a3fc3367ed30a5b2c440df67600bf619652b559c",class:"modal open","aria-modal":"true","aria-labelledby":"modalTitle","aria-describedby":"modalContent",onKeyDown:l(e=>{switch(e.key){case"Tab":this.trapFocus(e);break;case"Escape":this.closeOnEscape&&(e.preventDefault(),e.stopPropagation(),this.modalClosed.emit());break}},"onKeyDown"),onClick:l(e=>{this.innerModalRef&&!this.innerModalRef.contains(e.target)&&(e.stopPropagation(),e.preventDefault(),this.modalClosed.emit())},"onClick")},z("div",{key:"4eff2c8624762dc014b85851590abed2cf8f38c3",class:"modal-inner",ref:l(e=>this.innerModalRef=e,"ref")},z("h1",{key:"d4360fef432f56884b54c5bdfac5d8bfa6e530ef",id:"modalTitle",class:"modal-title"},this.mainTitle),z("div",{key:"9e3867727679699c7d31e71b7d637c6d4cb24334",id:"modalContent",class:"modal-content"},z("slot",{key:"deb12898e6327dc99b52ae8d48444c0d09b2320d"})),z("button",{key:"43dfa57f3117c030474c707113208aa954cf68f4",onClick:l(()=>this.modalClosed.emit(),"onClick"),type:"button",class:"modal-close"},"Close")))}get el(){return this}static get style(){return uD}},[6,"orama-modal",{closeOnEscape:[4,"close-on-escape"],closeOnOutsideClick:[4,"close-on-outside-click"],mainTitle:[1,"main-title"],activeElement:[32]}]);function Ek(){typeof customElements>"u"||["orama-modal"].forEach(e=>{switch(e){case"orama-modal":customElements.get(e)||customElements.define(e,hD);break}})}l(Ek,"defineCustomElement");var pD=Object.defineProperty,fD=Object.getOwnPropertyDescriptor,pc=l((e,t,r,a)=>{for(var n=a>1?void 0:a?fD(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&pD(t,r,n),n},"l"),Xn=class extends ur{static{l(this,"a")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${Xn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};Xn.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);Xn.styles=Pr` :host { display: contents; } `;pc([ve({type:String,reflect:!0})],Xn.prototype,"size",2);pc([ve({type:String,reflect:!0})],Xn.prototype,"weight",2);pc([ve({type:String,reflect:!0})],Xn.prototype,"color",2);pc([ve({type:Boolean,reflect:!0})],Xn.prototype,"mirrored",2);Xn=pc([Rr("ph-sparkle")],Xn);var mD='.sc-orama-toggler-h{align-items:center;background:#efefef;background:var(--background-color-fourth,#efefef);border-radius:2.5rem;border-radius:var(--radius-3xl,calc(40rem/var(--orama-base-font-size, 16)));display:inline-flex;overflow:hidden;padding:.125rem;padding:var(--spacing-2xs,calc(2rem/var(--orama-base-font-size, 16)))}.sc-orama-toggler-h button.sc-orama-toggler{align-items:center;background-color:transparent;border:none;color:#151515;color:var(--text-color-primary,#151515);cursor:pointer;display:flex;gap:.25rem;gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));padding:.5rem .75rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));position:relative}.sc-orama-toggler-h button.selected.sc-orama-toggler{color:#fff;color:var(--text-color-reverse,#fff);transition:color .3s ease-in-out;z-index:1}.sc-orama-toggler-h button.selected.sc-orama-toggler:after{background-color:#000;background-color:var(--background-color-reverse,#000);border-radius:2.5rem;border-radius:var(--radius-3xl,calc(40rem/var(--orama-base-font-size, 16)));content:"";inset:0;padding:.5rem .75rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));position:absolute;z-index:-1}.sc-orama-toggler-h button.selected.animate.sc-orama-toggler:after{animation:slideToLeft .3s ease-in-out}.sc-orama-toggler-h button.selected.animate.sc-orama-toggler:first-child:after{animation:slideToRight .3s ease-in-out}@keyframes slideToRight{0%{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideToLeft{0%{transform:translateX(-100%)}to{transform:translateX(0)}}',gD=function(e,t,r,a){var n=arguments.length,o=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(s=e[i])&&(o=(n<3?s(o):n>3?s(t,r,o):s(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o},$k=Jt(class extends Xt{static{l(this,"OramaToggler")}constructor(){super(),this.__registerHost(),this.performInitialAnimation=!1,this.firstRender=!0}componentWillLoad(){this.performInitialAnimation&&(this.firstRender=!1)}componentDidLoad(){this.firstRender&&(this.firstRender=!1)}render(){return z(ta,{key:"b5f2e4d25150746ea7d8c8f49ce65810709c62f7"},z("button",{key:"d4216bdf455ca829574dcfd2caab5f0e081da74a",type:"button",class:{selected:this.globalStore.state.currentTask==="search",animate:!this.firstRender||this.performInitialAnimation},onClick:l(()=>this.globalStore.state.currentTask="search","onClick")},z("span",{key:"d8a05a2f1c92c27c3189e4e3682f5d162973af60"},"Search"),z("ph-magnifying-glass",{key:"c2cca7b67b39d6db8edf9a05f18e12c41510c790",size:16})),z("button",{key:"793b326cd3b463bbcc9604cb04b0671418540d04",type:"button",class:{selected:this.globalStore.state.currentTask==="chat",animate:!this.firstRender||this.performInitialAnimation},onClick:l(()=>this.globalStore.state.currentTask="chat","onClick")},z("ph-sparkle",{key:"8d6aaffc7c5984026397228d71fbc4fe7f03a9ea",size:16}),z("span",{key:"3879f5cc81113d6c74b6c9e6f71ed1b6e0ba9500"},"Ask AI")))}static get style(){return mD}},[2,"orama-toggler",{performInitialAnimation:[4,"perform-initial-animation"]}]);gD([ro("global")],$k.prototype,"globalStore",void 0);function yg(){typeof customElements>"u"||["orama-toggler"].forEach(e=>{switch(e){case"orama-toggler":customElements.get(e)||customElements.define(e,$k);break}})}l(yg,"defineCustomElement");var yD=Object.defineProperty,bD=Object.getOwnPropertyDescriptor,fc=l((e,t,r,a)=>{for(var n=a>1?void 0:a?bD(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&yD(t,r,n),n},"o"),Jn=class extends ur{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${Jn.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};Jn.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);Jn.styles=Pr` :host { display: contents; } `;fc([ve({type:String,reflect:!0})],Jn.prototype,"size",2);fc([ve({type:String,reflect:!0})],Jn.prototype,"weight",2);fc([ve({type:String,reflect:!0})],Jn.prototype,"color",2);fc([ve({type:Boolean,reflect:!0})],Jn.prototype,"mirrored",2);Jn=fc([Rr("ph-clock")],Jn);var vD=Object.defineProperty,wD=Object.getOwnPropertyDescriptor,mc=l((e,t,r,a)=>{for(var n=a>1?void 0:a?wD(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&vD(t,r,n),n},"s"),eo=class extends ur{static{l(this,"t")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${eo.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};eo.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);eo.styles=Pr` :host { display: contents; } `;mc([ve({type:String,reflect:!0})],eo.prototype,"size",2);mc([ve({type:String,reflect:!0})],eo.prototype,"weight",2);mc([ve({type:String,reflect:!0})],eo.prototype,"color",2);mc([ve({type:Boolean,reflect:!0})],eo.prototype,"mirrored",2);eo=mc([Rr("ph-plus")],eo);var xD=".sc-orama-navigation-bar-h{align-items:center;background-color:#fbfbfb;background-color:var(--background-color-primary,#fbfbfb);display:flex;padding:1rem 1rem .5rem;padding:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16))) var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16))) var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)))}@media (min-width:1024.02px){.sc-orama-navigation-bar-h{display:none}}.spacer.sc-orama-navigation-bar{display:block;height:2.25rem;height:calc(36rem/var(--orama-base-font-size, 16));width:2.25rem;width:calc(36rem/var(--orama-base-font-size, 16))}.corner-section.sc-orama-navigation-bar{display:flex;gap:.25rem;gap:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)))}.corner-section.start.sc-orama-navigation-bar{display:flex;justify-content:flex-start}.corner-section.center.sc-orama-navigation-bar{display:flex;flex:1;justify-content:center}.corner-section.end.sc-orama-navigation-bar{display:flex;justify-content:flex-end}",_D=function(e,t,r,a){var n=arguments.length,o=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(s=e[i])&&(o=(n<3?s(o):n>3?s(t,r,o):s(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o},Pk=Jt(class extends Xt{static{l(this,"OramaNavigationBar")}constructor(){super(),this.__registerHost(),this.showBackButton=!0,this.showChatActions=!1,this.handleStartNewChat=()=>{var e;(e=this.chatStore.state.chatService)===null||e===void 0||e.resetChat()}}render(){return z(ta,{key:"676f6e8004de45bc7e70a38534c694c57b2c5068"},z("div",{key:"036c53deef2f5fa0785f677d7aec3cb6fcc47a39",class:"corner-section start"},this.showBackButton?z(po,null,z("orama-button",{type:"button",variant:"icon","aria-label":"Exit",onClick:this.handleClose,onKeyDown:this.handleClose},z("ph-caret-left",{size:"20px"}))):z("div",{class:"spacer"})),z("div",{key:"2dd271a6f0742652bb3480cb7996f46bd3a64bb5",class:"corner-section center"},z("orama-toggler",{key:"80ecf7005825e985ed5e86a12c5912d6e104c238"})),z("div",{key:"c00c10b04bffa9e7bbae61f27d0fc6e483b66e8a",class:"corner-section end"},this.showChatActions?z(po,null,z("orama-button",{type:"button",variant:"icon","aria-label":"Start new chat",onClick:this.handleStartNewChat,onKeyDown:this.handleStartNewChat},z("ph-plus",{size:"20px"}))):z("div",{class:"spacer"})))}static get style(){return xD}},[2,"orama-navigation-bar",{handleClose:[16,"handle-close"],showBackButton:[4,"show-back-button"],showChatActions:[4,"show-chat-actions"]}]);_D([ro("chat")],Pk.prototype,"chatStore",void 0);function Ok(){typeof customElements>"u"||["orama-navigation-bar","orama-button","orama-toggler"].forEach(e=>{switch(e){case"orama-navigation-bar":customElements.get(e)||customElements.define(e,Pk);break;case"orama-button":customElements.get(e)||yo();break;case"orama-toggler":customElements.get(e)||yg();break}})}l(Ok,"defineCustomElement");var Nm,Sx;function Rk(){if(Sx)return Nm;Sx=1;var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,n=l((h,m)=>{for(var g in m)e(h,g,{get:m[g],enumerable:!0})},"A"),o=l((h,m,g,x)=>{if(m&&typeof m=="object"||typeof m=="function")for(let w of r(m))!a.call(h,w)&&w!==g&&e(h,w,{get:l(()=>m[w],"get"),enumerable:!(x=t(m,w))||x.enumerable});return h},"d"),s=l(h=>o(e({},"__esModule",{value:!0}),h),"R"),i={};n(i,{Highlight:l(()=>p,"Highlight"),highlightStrategy:l(()=>c,"highlightStrategy")}),Nm=s(i);var c={WHOLE_WORD_MATCH:"wholeWordMatch",PARTIAL_MATCH:"partialMatch",PARTIAL_MATCH_FULL_WORD:"partialMatchFullWord"},u={caseSensitive:!1,strategy:c.PARTIAL_MATCH,HTMLTag:"mark",CSSClass:"orama-highlight"},p=class{static{l(this,"u")}options;_positions=[];_HTML="";_searchTerm="";_originalText="";constructor(h=u){this.options={...u,...h}}highlight(h,m){if(this._searchTerm=m??"",this._originalText=h??"",!this._searchTerm||!this._originalText)return this._positions=[],this._HTML=this._originalText,this;let g=this.options.HTMLTag??u.HTMLTag,x=this.options.CSSClass??u.CSSClass,w=this.options.caseSensitive??u.caseSensitive,k=this.options.strategy??u.strategy,C=w?"g":"gi",A=this.escapeRegExp(w?this._searchTerm:this._searchTerm.toLowerCase()).trim().split(/\s+/).join("|"),$;if(k===c.WHOLE_WORD_MATCH)$=new RegExp(`\\b${A}\\b`,C);else if(k===c.PARTIAL_MATCH)$=new RegExp(A,C);else if(k===c.PARTIAL_MATCH_FULL_WORD)$=new RegExp(`\\b[^\\s]*(${A})[^\\s]*\\b`,C);else throw new Error("Invalid highlighter strategy");let L=[],M=[],O,R=0,B=-1;for(;(O=$.exec(this._originalText))!==null&&$.lastIndex!==B;){B=$.lastIndex;let G=O.index,j=G+O[0].length-1;L.push({start:G,end:j}),M.push(this._originalText.slice(R,G)),M.push(`<${g} class="${x}">${O[0]}`),R=j+1}return M.push(this._originalText.slice(R)),this._positions=L,this._HTML=M.join(""),this}trim(h,m=!0){if(this._positions.length===0)return`${this._HTML.substring(0,h)}${m?"...":""}`;if(this._originalText.length<=h)return this._HTML;let g=this._positions[0].start,x=Math.max(g-Math.floor(h/2),0),w=Math.min(x+h,this._originalText.length),k=`${x===0||!m?"":"..."}${this._originalText.slice(x,w)}${w{for(var n=a>1?void 0:a?SD(t,r):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(n=(a?s(t,r,n):s(n))||n);return a&&n&&kD(t,r,n),n},"h"),to=class extends ur{static{l(this,"a")}constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return Or` ${to.weightsMap.get((e=this.weight)!=null?e:"regular")} `}};to.weightsMap=new Map([["thin",ce``],["light",ce``],["regular",ce``],["bold",ce``],["fill",ce``],["duotone",ce``]]);to.styles=Pr` :host { display: contents; } `;gc([ve({type:String,reflect:!0})],to.prototype,"size",2);gc([ve({type:String,reflect:!0})],to.prototype,"weight",2);gc([ve({type:String,reflect:!0})],to.prototype,"color",2);gc([ve({type:Boolean,reflect:!0})],to.prototype,"mirrored",2);to=gc([Rr("ph-files")],to);var ID=".list.sc-orama-search-results{list-style:none;margin:0;padding:0}.section-list.sc-orama-search-results{gap:.75rem;gap:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));margin-top:.5rem;margin-top:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));padding-bottom:1rem;padding-bottom:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}.section-item-list.sc-orama-search-results,.section-list.sc-orama-search-results{display:flex;flex-direction:column}.section-wrapper.sc-orama-search-results{border-bottom:1px solid #dadada;border-bottom:1px solid var(--border-color-primary,#dadada);padding-bottom:.75rem;padding-bottom:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}.section-wrapper.sc-orama-search-results:last-of-type{border-bottom:none}.section-title-wrapper.sc-orama-search-results{padding:.5rem .75rem;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));text-transform:capitalize}.section-title-wrapper.sc-orama-search-results *.sc-orama-search-results{color:#838289;color:var(--text-text-color-secondary,#838289)}.list-item.sc-orama-search-results{cursor:pointer}.list-item-button.sc-orama-search-results{align-items:center;background-color:#fff;background-color:var(--background-color-secondary,#fff);border:1px solid transparent;border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)));cursor:pointer;display:flex;font-family:inherit;gap:.75rem;gap:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));padding:.75rem;padding:var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)));position:relative;text-align:left;text-decoration:none;transition:background-color .2s}@media (hover:hover){.list-item-button.sc-orama-search-results:hover{background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6)}}.list-item-button.sc-orama-search-results:focus-visible{border:1px solid #432d77;border:1px solid var(--border-color-accent,#432d77);outline:none}.collapsed.sc-orama-search-results{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.result-title.sc-orama-search-results{color:#151515;color:var(--text-color-primary,#151515)}.result-description.sc-orama-search-results{color:#99989d;color:var(--text-color-tertiary,#99989d)}.results-empty.sc-orama-search-results{margin:2rem auto 2.5rem;margin:calc(32rem/var(--orama-base-font-size, 16)) auto calc(40rem/var(--orama-base-font-size, 16));max-width:25rem;max-width:calc(400rem/var(--orama-base-font-size, 16));text-align:center;width:80%}.suggestions-wrapper.sc-orama-search-results{padding:1rem 0 .75rem;padding:var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16))) 0 var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16))) 0}.suggestions-title.sc-orama-search-results{margin-bottom:.25rem;margin-bottom:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16)));padding:0 .5rem;padding:0 var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16)));text-transform:uppercase}.textWrapper.sc-orama-search-results{display:flex;flex-direction:column;flex-grow:1;overflow:hidden}ph-files.sc-orama-search-results{color:#151515;color:var(--icon-color-primary,#151515)}.result-item-icon-wrapper.sc-orama-search-results{align-items:center;display:flex;flex-shrink:0;height:20px;justify-content:center;width:20px}.custom-result-item-icon.sc-orama-search-results{max-height:20px;max-width:20px;-o-object-fit:contain;object-fit:contain}",CD=Jt(class extends Xt{static{l(this,"SearchResults")}constructor(){super(),this.__registerHost(),this.searchResultClick=Yt(this,"searchResultClick"),this.linksTarget="_blank",this.linksRel="noopener noreferrer",this.sections=[],this.suggestions=[],this.loading=!1,this.error=!1,this.highlightTitle=!1,this.highlightDescription=!1,this.handleItemClick=(e,t)=>{if(this.searchResultClick.emit({result:t}).defaultPrevented){e.preventDefault();return}if(!t?.path)throw new Error("No path found")},this.getItemLinkUrl=e=>e?.path?this.sourceBaseUrl?`${this.sourceBaseUrl}${e.path}`:e.path:"#",this.getHighlightedTitleText=e=>this.highlighterTitle.highlight(e,this.searchTerm),this.getHighlightedDescriptionText=e=>this.highlighterDescription.highlight(e,this.searchTerm)}buildUrl(e){if(!e)return"#";if(this.sourceBaseUrl){let t=this.sourceBaseUrl.replace(/\/+$/,""),r=e.replace(/^\/+/,"");return`${t}/${r}`}return e}componentDidLoad(){this.highlightTitle&&(this.highlighterTitle=new Ix.Highlight(this.highlightTitle)),this.highlightDescription&&(this.highlighterDescription=new Ix.Highlight(this.highlightDescription))}render(){var e,t,r,a,n,o;return this.searchTerm?this.error?z("div",null,((r=this.dictionary)===null||r===void 0?void 0:r.errorMessage)||"An error occurred while trying to search. Please try again."):!this.loading&&!(!((a=this.sections)===null||a===void 0)&&a.some(s=>s.items.length>0))?z("div",{class:"results-empty"},z("orama-text",{as:"h3",styledAs:"span"},`${((n=this.dictionary)===null||n===void 0?void 0:n.noResultsFound)||"No results found"} ${this.searchTerm?`${((o=this.dictionary)===null||o===void 0?void 0:o.noResultsFoundFor)||"for"} "${this.searchTerm}"`:""}`)):z(ta,null,z("ul",{class:"list section-list"},this.sections.map(s=>z("div",{key:s.section,class:"section-wrapper"},s.section&&z("div",{class:"section-title-wrapper"},z("orama-text",{as:"h2",styledAs:"span"},s.section)),z("ul",{class:"list section-item-list"},s.items.map(i=>z("li",{class:"list-item",key:i.id},z("a",{"focus-on-arrow-nav":!0,href:this.buildUrl(i.path),class:"list-item-button",target:this.linksTarget,rel:this.linksRel,id:`search-result-${i.id}`,onClick:l(c=>this.handleItemClick(c,i),"onClick")},z("div",{class:"result-item-icon-wrapper"},i.icon?z("img",{alt:"",class:"custom-result-item-icon",src:i.icon}):z("ph-files",{size:"20px"})),z("div",{class:"textWrapper"},z("orama-text",{as:"h3",styledAs:"p",class:"result-title collapsed"},this.highlightTitle?i.title.length>200?z("span",{innerHTML:this.getHighlightedTitleText(i.title).trim(200)}):z("span",{innerHTML:this.getHighlightedTitleText(i.title).HTML}):z("span",{innerHTML:i.title})),z("orama-text",{as:"p",styledAs:"span",class:"result-description collapsed",variant:"tertiary"},this.highlightDescription?z("span",{innerHTML:this.getHighlightedDescriptionText(i.description).HTML}):z("span",{innerHTML:i.description}))))))))))):z("div",{class:"suggestions-wrapper"},!!(!((e=this.suggestions)===null||e===void 0)&&e.length)&&z("orama-text",{as:"h2",styledAs:"small",class:"suggestions-title",variant:"secondary"},((t=this.dictionary)===null||t===void 0?void 0:t.suggestionsTitle)||"Suggestions"),z("orama-suggestions",{as:"list",suggestions:this.suggestions,icon:z(Ik,{name:"starFour",size:16,color:"var(--text-color-accent, text-color('accent')"}),suggestionClicked:l(s=>{this.setChatTerm(s)},"suggestionClicked")}))}get el(){return this}static get style(){return ID}},[2,"orama-search-results",{sourceBaseUrl:[1,"source-base-url"],linksTarget:[1,"links-target"],linksRel:[1,"links-rel"],sections:[16],suggestions:[16],searchTerm:[1,"search-term"],setChatTerm:[16,"set-chat-term"],loading:[4],error:[4],highlightTitle:[4,"highlight-title"],highlightDescription:[4,"highlight-description"],dictionary:[16]}]);function bg(){typeof customElements>"u"||["orama-search-results","orama-suggestions","orama-text"].forEach(e=>{switch(e){case"orama-search-results":customElements.get(e)||customElements.define(e,CD);break;case"orama-suggestions":customElements.get(e)||es();break;case"orama-text":customElements.get(e)||ja();break}})}l(bg,"defineCustomElement");var AD=".sc-orama-search-h{display:flex;flex-direction:column;overflow:hidden;width:100%}@media (max-width:1024px){.sc-orama-search-h orama-input.sc-orama-search{padding:0 1rem;padding:0 var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}}@media (max-width:1024px){.sc-orama-search-h{padding:.5rem 0;padding:var(--spacing-s,calc(8rem/var(--orama-base-font-size, 16))) 0}}.result-wrapper.sc-orama-search{flex-grow:1;overflow-y:auto;padding:0 1rem;padding:0 var(--spacing-l,calc(16rem/var(--orama-base-font-size, 16)))}.result-wrapper.sc-orama-search::-webkit-scrollbar{width:.3em}.result-wrapper.sc-orama-search::-webkit-scrollbar-track{background:transparent}.result-wrapper.sc-orama-search::-webkit-scrollbar-thumb{background-color:hsla(0,0%,70%,.522);border-radius:1rem;border-radius:var(--border-radius-l,calc(16rem/var(--orama-base-font-size, 16)))}@media (min-width:1024.02px){.result-wrapper.sc-orama-search{padding:0 .75rem;padding:0 var(--spacing-m,calc(12rem/var(--orama-base-font-size, 16)))}}.search-form.sc-orama-search{display:flex;flex-direction:column}",vg=function(e,t,r,a){var n=arguments.length,o=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,r):a,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,a);else for(var i=e.length-1;i>=0;i--)(s=e[i])&&(o=(n<3?s(o):n>3?s(t,r,o):s(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o},qu=Jt(class extends Xt{static{l(this,"OramaSearch")}constructor(){super(),this.__registerHost(),this.searchCompleted=Yt(this,"searchCompleted"),this.answerGenerated=Yt(this,"answerGenerated"),this.placeholder="Search...",this.focusInput=!1,this.suggestions=[],this.disableChat=!1,this.highlightTitle=!1,this.highlightDescription=!1,this.selectedFacet="",this.handleSubmit=e=>{if(e.preventDefault(),this.disableChat)return;this.el.querySelector("orama-chat-button")?.click()}}getText(e){let t={searchPlaceholder:this.placeholder};return ai(e,this.dictionary,t)}doSearch(){this.searchStore.state.searchService.search(this.globalStore.state.currentTerm,this.selectedFacet,{onSearchCompletedCallback:l(e=>{this.searchCompleted.emit(e)},"onSearchCompletedCallback")})}render(){var e;return z(ta,{key:"688c8af1ca2951057a901d4e5d93f44877f6e73b"},z("form",{key:"f08750150118e1417d817ead3024011a7dfa6d77",onSubmit:this.handleSubmit,class:"search-form"},z("orama-input",{key:"a173662d45226aa2e36f3ed12f5c3792d1f4aa86","focus-on-arrow-nav":!0,autoFocus:this.focusInput,type:"search",onInput:l(t=>{let r=t.target;this.globalStore.state.currentTerm=r.value,this.doSearch()},"onInput"),value:this.globalStore.state.currentTerm,size:"large",labelForScreenReaders:this.getText("searchPlaceholder"),placeholder:this.getText("searchPlaceholder")}),z("slot",{key:"64b40b9655e4bd2842800d0ca33e6cdaabf019cc",name:"summary"})),z("div",{key:"98f8fd718183e5436a2d42eabf8313d5b071be32",class:"result-wrapper"},z("orama-facets",{key:"6dec4d3f30682444e46a18f3e31a6c77baf42f9c",facets:this.searchStore.state.facets,selectedFacet:this.selectedFacet,selectedFacetChanged:l(t=>{this.selectedFacet=t,this.doSearch()},"selectedFacetChanged")}),z("orama-search-results",{key:"7e8fe4f97b6882d503965c99044a4d5e46e649b7",suggestions:!(!((e=this.globalStore.state.currentTerm)===null||e===void 0)&&e.length)&&!this.disableChat?this.suggestions:[],setChatTerm:l(t=>{var r;this.globalStore.state.currentTask="chat",(r=this.chatStore.state.chatService)===null||r===void 0||r.sendQuestion(t,this.relatedQueries,void 0,{onAnswerGeneratedCallback:l(a=>this.answerGenerated.emit(a),"onAnswerGeneratedCallback")})},"setChatTerm"),sourceBaseUrl:this.sourceBaseUrl,linksTarget:this.linksTarget,linksRel:this.linksRel,sections:this.searchStore.state.results,searchTerm:this.globalStore.state.currentTerm,highlightTitle:this.highlightTitle,highlightDescription:this.highlightDescription,loading:this.searchStore.state.loading,error:this.searchStore.state.error,dictionary:this.dictionary})))}get el(){return this}static get style(){return AD}},[6,"orama-search",{placeholder:[1],focusInput:[4,"focus-input"],suggestions:[16],sourceBaseUrl:[1,"source-base-url"],linksTarget:[1,"links-target"],linksRel:[1,"links-rel"],disableChat:[4,"disable-chat"],relatedQueries:[2,"related-queries"],highlightTitle:[4,"highlight-title"],highlightDescription:[4,"highlight-description"],dictionary:[16],selectedFacet:[32]}]);vg([ro("search")],qu.prototype,"searchStore",void 0);vg([ro("global")],qu.prototype,"globalStore",void 0);vg([ro("chat")],qu.prototype,"chatStore",void 0);function Lk(){typeof customElements>"u"||["orama-search","orama-facets","orama-input","orama-search-results","orama-suggestions","orama-text"].forEach(e=>{switch(e){case"orama-search":customElements.get(e)||customElements.define(e,qu);break;case"orama-facets":customElements.get(e)||mg();break;case"orama-input":customElements.get(e)||gg();break;case"orama-search-results":customElements.get(e)||bg();break;case"orama-suggestions":customElements.get(e)||es();break;case"orama-text":customElements.get(e)||ja();break}})}l(Lk,"defineCustomElement");var TD=".slide-backdrop.visible.sc-orama-sliding-panel{animation:backdropFadeIn .5s ease-in 1;background-color:hsla(0,0%,98%,.7);background-color:var(--backdrop-background-color-primary,hsla(0,0%,98%,.7));display:none;display:block;height:100vh;left:0;opacity:0;position:fixed;top:0;width:100vw;z-index:10009}@media (min-width:1024.02px){.slide-backdrop.visible.sc-orama-sliding-panel{display:block;opacity:1}}@keyframes backdropFadeIn{0%{opacity:0}50%{opacity:.2}to{opacity:1}}.slide-container.sc-orama-sliding-panel{background-color:#fbfbfb;background-color:var(--background-color-primary,#fbfbfb);border:1px solid #dadada;border:1px solid var(--border-color-primary,#dadada);border-radius:.75rem .75rem 0 0;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16))) var(--radius-m,calc(12rem/var(--orama-base-font-size, 16))) 0 0;bottom:0;box-sizing:border-box;color:#151515;color:var(--text-color-primary,#151515);height:95vh;left:0;position:fixed;transform:translate3d(0,calc(100% + 5vh),0);transition:.4s cubic-bezier(.4,0,.2,1);width:100%;z-index:10019}.slide-container.slide-up.sc-orama-sliding-panel{transform:translateZ(0)}@media (max-width:1024px){.slide-container.sc-orama-sliding-panel{display:none}}.slide-container-inner.sc-orama-sliding-panel{height:95vh;margin:0 auto;max-width:52.5rem;max-width:calc(840rem/var(--orama-base-font-size, 16));width:80%}.slide-container-inner.sc-orama-sliding-panel orama-chat.sc-orama-sliding-panel{height:100%}.slide-container-header.sc-orama-sliding-panel{box-sizing:border-box;display:flex;height:5vh;justify-content:flex-end;padding:0 2.5rem;padding:0 var(--spacing-3xl,calc(40rem/var(--orama-base-font-size, 16)));position:absolute;top:-5vh;width:100%}.close-button.sc-orama-sliding-panel{animation:showIn .3s cubic-bezier(.4,0,.2,1) .1s forwards;background-color:transparent;border:0;color:#151515;color:var(--text-color-primary,#151515);cursor:pointer}",ED=Jt(class extends Xt{static{l(this,"SlideInPanel")}constructor(){super(),this.__registerHost(),this.backdrop=!1,this.open=!1,this.isOpen=this.open}openChanged(){this.isOpen=this.open}closePanel(){this.closed&&this.closed(),this.isOpen=!1}trapFocus(e){var t;let r=(t=this.el)===null||t===void 0?void 0:t.querySelectorAll('a[href], button, textarea, input, select, [tabindex]:not([tabindex="-1"])'),a=Array.from(r);if(a=a.filter(n=>n.tabIndex!==-1),a.length>0){this.firstFocusableElement=a[0],this.lastFocusableElement=a[a.length-1];let n=this.el.querySelector(":focus");e.shiftKey&&n===this.firstFocusableElement?(e.preventDefault(),this.lastFocusableElement.focus()):!e.shiftKey&&n===this.lastFocusableElement&&(e.preventDefault(),this.firstFocusableElement.focus())}}handleKeyDown(e){e.stopPropagation(),e.key==="Escape"&&this.closePanel(),e.key==="Tab"&&this.trapFocus(e)}componentDidLoad(){this.isOpen=this.open}render(){return z(po,{key:"f88b00bf1fc61de9416fcbfe6401ff14d7865fd2"},z("div",{key:"dba8338860b889ca1bed7bf25de95be366f0a2f4",class:{"slide-container":!0,"slide-up":this.isOpen},tabIndex:this.isOpen?0:-1},z("div",{key:"1f7b7c593782897ca63527c93cf775985f3682d2",class:"slide-container-header"},z("button",{key:"08826ac5dc073eba459dd2fd9adbbe34521c48a5",onClick:l(()=>this.closePanel(),"onClick"),"aria-expanded":this.isOpen?"true":"false","aria-label":"Close panel","aria-controls":"panel",class:"close-button",type:"button"},z("ph-x",{key:"e1f618268881eeb161291e7b25accdc9835e453a",size:"18"}))),z("div",{key:"d032def08d136efb85b7dcc203b855c211024537",id:"panel","aria-hidden":!this.isOpen,tabindex:"-1",class:"slide-container-inner"},z("slot",{key:"63db6812e71a0cc1a7fd0bc630a5200632908562"}))),this.backdrop&&z("div",{key:"a1da61d3366e055e2c3bb40cc60dd2ad14a8e9ac",class:{"slide-backdrop":!0,visible:this.isOpen}}))}get el(){return this}static get watchers(){return{open:["openChanged"]}}static get style(){return TD}},[6,"orama-sliding-panel",{backdrop:[4],open:[4],closed:[16],isOpen:[32]},[[4,"keydown","handleKeyDown"]],{open:["openChanged"]}]);function Mk(){typeof customElements>"u"||["orama-sliding-panel"].forEach(e=>{switch(e){case"orama-sliding-panel":customElements.get(e)||customElements.define(e,ED);break}})}l(Mk,"defineCustomElement");var $D=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n{var s,i,c,u;if(!this.client)throw new Rl;if(this.abortSearch(),!a){this.searchStore.state.results=[],this.searchStore.state.count=0,this.searchStore.state.facets=[],this.searchStore.state.highlightedIndex=-1;return}this.searchStore.state.loading=!0;let p=this.abortController,h=(s=this.searchStore.state.searchParams)!==null&&s!==void 0?s:{},{limit:m,where:g}=h,x=$D(h,["limit","offset","where"]),w=Object.assign(Object.assign(Object.assign(Object.assign({},x),{term:a,limit:m||PD}),g?{where:g}:{}),this.searchStore.state.facetProperty&&Object.assign({facets:{[this.searchStore.state.facetProperty]:{}}},n&&n!=="All"&&{where:Object.assign({[this.searchStore.state.facetProperty]:{eq:n}},g)}));try{let k=await this.client.search(w);if(p.signal.aborted)return;if(k&&!k.hits)throw new Error("This search was made by a OramaClient with property mergeResult set to false. Orama Search Service requires mergeResult to be true.");this.searchStore.state.results=this.parserResults(k?.hits,this.searchStore.state.resultMap),this.searchStore.state.count=k?.count||0,this.searchStore.state.facets=this.parseFacets(k?.facets,this.searchStore.state.facetProperty),this.searchStore.state.highlightedIndex=-1,this.searchStore.state.loading=!1,(i=o?.onSearchCompletedCallback)===null||i===void 0||i.call(o,{clientSearchParams:w,result:{results:this.searchStore.state.results,resultsCount:this.searchStore.state.count,facets:this.searchStore.state.facets}}),(c=o?.onSearchCompletedCallback)===null||c===void 0||c.call(o,{clientSearchParams:w,result:{results:this.searchStore.state.results,resultsCount:this.searchStore.state.count,facets:this.searchStore.state.facets}})}catch(k){if(console.error("Search error:",k),p.signal.aborted)return;this.searchStore.state.loading=!1,(u=o?.onSearchErrorCallback)===null||u===void 0||u.call(o,k)}},this.retry=()=>{throw new Error("Not implemented")},this.getResultMapObjectByForTheHit=(a,n)=>{let o=Array.isArray(a)?a:[a];return o.length===1?o[0]:o.find(s=>s.datasourceId===n.datasource_id)||{}},this.parserResults=(a,n)=>{if(!a)return[];let o=[],s={};for(let i of a){let c=this.getResultMapObjectByForTheHit(n,i),u=this.hitToSearchResultParser(i,c),p=typeof c.section=="function"?c.section(i.document,i.datasource_id):i.document[c.section];if(s[p]===void 0)o.push({section:p,items:[u]}),s[p]=o.length-1;else{let h=s[p];o[h].items.push(u)}}return o},this.hitToSearchResultParser=(a,n)=>{function o(i){if(!a.document)return"";let c=n[i];if(!c){let h=a.document[i];return typeof h=="string"?h:String(h??"")}if(typeof c=="function"){let h=c(a.document,a.datasource_id);return typeof h=="string"?h:String(h??"")}let u=c,p=a.document[u];return typeof p=="string"?p:String(p??"")}l(o,"getResultMapValue");function s(){let i=n.icon;return i?typeof i=="function"?i(a.document,a.datasource_id)??null:n.icon:null}return l(s,"getIcon"),{id:a.id,title:o("title"),description:o("description"),path:o("path"),icon:s()}},this.parseFacets=(a,n)=>{if(!n||!a)return[];let o=a[n];if(!o||!o.values)return[];let s=Object.values(o.values).reduce((c,u)=>c+u,0),i=Object.keys(o.values).map(c=>({name:c,count:o.values[c]}));return i.unshift({name:"All",count:s}),i},this.client=t||new vk(e),this.searchStore=r,this.abortController=new AbortController}abortSearch(){this.abortController.abort(),this.abortController=new AbortController}},RD=class extends EventTarget{static{l(this,"WindowService")}constructor(){super(),this._width=window.innerWidth,this.handleResize=this.handleResize.bind(this),window.addEventListener("resize",this.handleResize)}handleResize(){this._width=window.innerWidth,this.dispatchEvent(new CustomEvent("widthChange",{detail:this._width}))}get width(){return this._width}},Dm=new RD,LD="@keyframes showIn{0%{opacity:0;transform:translateY(-25%)}to{opacity:1;transform:translateY(0)}}@media (min-width:1024.02px){.modal orama-input{border-radius:0;margin:0;padding:0}.modal input[type=search]{border-radius:.75rem .75rem 0 0;border-radius:var(--radius-m,calc(12rem/var(--orama-base-font-size, 16))) var(--radius-m,calc(12rem/var(--orama-base-font-size, 16))) 0 0}}.main{flex-direction:column;flex-grow:1}.main,.section-active{display:flex;overflow:hidden}.section-inactive{display:none}",Nk=Jt(class extends Xt{static{l(this,"SearchBox")}constructor(){super(),this.__registerHost(),this.__attachShadow(),this.searchCompleted=Yt(this,"searchCompleted"),this.searchResultClick=Yt(this,"searchResultClick"),this.clearChat=Yt(this,"clearChat"),this.startConversation=Yt(this,"startConversation"),this.answerGenerated=Yt(this,"answerGenerated"),this.answerSourceClick=Yt(this,"answerSourceClick"),this.chatMarkdownLinkClicked=Yt(this,"chatMarkdownLinkClicked"),this.modalClosed=Yt(this,"modalClosed"),this.modalStatusChanged=Yt(this,"modalStatusChanged"),this.colorScheme="light",this.open=!1,this.resultMap={},this.disableChat=!1,this.layout="modal",this.highlightTitle=!1,this.highlightDescription=!1,this.clearChatOnDisconnect=!0,this.showKeyboardShortcuts=!0,this.dictionary={},this.componentID=$u("search-box"),this.systemScheme="light",this.closeSearchbox=()=>{this.globalStore.state.open=!1,this.open=!1},this.onChatButtonClick=()=>{this.globalStore.state.currentTask="chat"},this.onPrefersColorSchemeChange=e=>{this.systemScheme=e.matches?"dark":"light",this.updateTheme()},this.updateWindowWidth=e=>{this.windowWidth=e.detail}}handleDictionaryChange(e){let t={};if(typeof e=="string")try{t=JSON.parse(e)}catch(r){console.error("Failed to parse dictionary string:",r)}else t=e||{};this.internalTextDictionary=Object.assign(Object.assign({},_0),t)}indexChanged(){this.searchStore&&this.bootstrap()}watchHandler(){this.updateTheme()}handleOpenPropChange(e){this.globalStore.state.open=e,this.modalStatusChanged.emit({open:e,id:this.wrapperRef}),e||this.modalClosed.emit()}handleFacetPropertyChange(e){this.searchStore.state.facetProperty=e}handleSearchParamsChange(e){this.searchStore.state.searchParams=e}handleKeyDown(e){var t;((t=this.globalStore)===null||t===void 0?void 0:t.state.currentTask)==="search"&&(this.layout==="modal"&&this.open||this.layout==="embed")&&["ArrowDown","ArrowUp"].includes(e.key)&&t4(this.wrapperRef,e)}updateTheme(){let e=Pu(this.htmlElement,this.colorScheme,this.systemScheme);Ou(this.htmlElement,e,this.themeConfig)}getOldOramaClient(){if(!this.oramaCoreClientInstance)return this.clientInstance?this.clientInstance:R0(this.index)}bootstrap(){this.searchStore.state.facetProperty=this.facetProperty,this.searchStore.state.resultMap=this.resultMap,this.searchStore.state.searchParams=this.searchParams,this.startServices()}startServices(){if(!this.index&&!this.clientInstance&&!this.oramaCoreClientInstance)return;O0(this.htmlElement,this.index,this.clientInstance,this.oramaCoreClientInstance);let e=this.getOldOramaClient();this.searchStore.state.searchService=new OD(e,this.oramaCoreClientInstance,this.searchStore),this.chatStore.state.chatService=new wk(e,this.oramaCoreClientInstance,this.chatStore)}componentWillLoad(){this.htmlElement.id=this.componentID,this.bootstrap(),this.globalStore.state.open=this.open,this.globalStore.onChange("open",()=>{this.globalStore&&(this.open=this.globalStore.state.open,this.globalStore.state.open||(this.globalStore.state.currentTerm="",this.searchStore.state.facets=[],this.searchStore.state.count=0,this.searchStore.state.results=[],this.searchStore.state.highlightedIndex=-1,this.searchStore.state.loading=!1,this.searchStore.state.error=!1,this.chatStore.state.interactions=[],setTimeout(()=>{})))}),this.schemaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.systemScheme=this.schemaQuery.matches?"dark":"light",this.updateTheme(),this.schemaQuery.addEventListener("change",this.onPrefersColorSchemeChange),Dm.addEventListener("widthChange",this.updateWindowWidth);let e={};if(typeof this.dictionary=="string")try{e=JSON.parse(this.dictionary)}catch(t){console.error("Failed to parse initial dictionary string:",t)}else e=this.dictionary||{};this.internalTextDictionary=Object.assign(Object.assign({},_0),e)}connectedCallback(){this.chatStore=tu("chat",this.componentID),this.searchStore=tu("search",this.componentID),this.globalStore=tu("global",this.componentID),this.windowWidth=Dm.width}disconnectedCallback(){var e;p4(this.componentID),Dm.removeEventListener("widthChange",this.updateWindowWidth),(e=this.schemaQuery)===null||e===void 0||e.removeEventListener("change",this.onPrefersColorSchemeChange)}getText(e){let t={searchPlaceholder:this.searchPlaceholder,chatPlaceholder:this.chatPlaceholder};return ai(e,this.internalTextDictionary,t)}getSearchBox(){return z("div",{class:`${this.windowWidth>1024||this.globalStore.state.currentTask==="search"?"section-active":"section-inactive"}`},z("orama-search",{placeholder:this.getText("searchPlaceholder"),focusInput:this.globalStore.state.currentTask==="search",sourceBaseUrl:this.sourceBaseUrl,linksTarget:this.linksTarget,linksRel:this.linksRel,highlightTitle:this.highlightTitle,highlightDescription:this.highlightDescription,disableChat:this.disableChat,suggestions:this.suggestions,dictionary:this.internalTextDictionary},this.windowWidth>1024&&!this.disableChat&&z("orama-chat-button",{slot:"summary","focus-on-arrow-nav":!0,active:!!this.globalStore.state.currentTerm,label:`${this.globalStore.state.currentTerm?`${this.globalStore.state.currentTerm} - `:""}${this.getText("chatButtonLabel")}`,onClick:this.onChatButtonClick,onKeyPress:this.onChatButtonClick})))}getChatBox(){return z(po,null,z("orama-chat",{class:`${this.globalStore.state.currentTask==="chat"?"section-active":"section-inactive"}`,defaultTerm:this.globalStore.state.currentTask==="chat"?this.globalStore.state.currentTerm:"",showClearChat:!1,focusInput:this.globalStore.state.currentTask==="chat",placeholder:this.getText("chatPlaceholder"),sourceBaseUrl:this.sourceBaseUrl,linksTarget:this.linksTarget,linksRel:this.linksRel,sourcesMap:this.sourcesMap,suggestions:this.suggestions,chatMarkdownLinkTitle:this.chatMarkdownLinkTitle,chatMarkdownLinkHref:this.chatMarkdownLinkHref,chatMarkdownLinkTarget:this.chatMarkdownLinkTarget,disclaimer:this.disclaimer,dictionary:this.internalTextDictionary,systemPrompts:this.systemPrompts,prompt:this.prompt,clearChatOnDisconnect:this.clearChatOnDisconnect,relatedQueries:this.relatedQueries}))}getInnerContent(){return z(po,null,this.disableChat?null:z("orama-navigation-bar",{handleClose:this.closeSearchbox,showBackButton:this.layout!=="embed",showChatActions:this.globalStore.state.currentTask==="chat"}),z("div",{class:"main"},this.getSearchBox(),this.windowWidth<=1024&&this.getChatBox()),z("orama-footer",{colorScheme:this.colorScheme==="system"?this.systemScheme:this.colorScheme,showKeyboardShortcuts:this.showKeyboardShortcuts}))}getOuterContent(){return this.windowWidth>1024?z("orama-sliding-panel",{open:this.globalStore.state.currentTask==="chat",backdrop:this.layout==="embed",closed:l(()=>{this.globalStore.state.currentTask="search"},"closed")},this.getChatBox()):null}getModalLayout(){return z(po,null,z("orama-modal",{ref:l(e=>this.wrapperRef=e,"ref"),class:"modal",mainTitle:this.getText("startYourSearch"),onModalClosed:l(e=>{this.open=!1,e.stopPropagation()},"onModalClosed"),closeOnEscape:this.globalStore.state.currentTask==="search"||this.windowWidth<=1024},this.getInnerContent()),this.getOuterContent())}getEmbedLayout(){return z(po,null,z("orama-embed",{ref:l(e=>this.wrapperRef=e,"ref")},this.getInnerContent()),this.getOuterContent())}render(){return this.layout==="modal"&&!this.globalStore.state.open||!this.searchStore.state.searchService||!this.chatStore.state.chatService?null:this.layout==="modal"?this.getModalLayout():this.getEmbedLayout()}get htmlElement(){return this}static get watchers(){return{dictionary:["handleDictionaryChange"],index:["indexChanged"],clientInstance:["indexChanged"],oramaCoreClientInstance:["indexChanged"],themeConfig:["watchHandler"],colorScheme:["watchHandler"],open:["handleOpenPropChange"],facetProperty:["handleFacetPropertyChange"],searchParams:["handleSearchParamsChange"]}}static get style(){return LD}},[1,"orama-search-box",{themeConfig:[16,"theme-config"],colorScheme:[1,"color-scheme"],index:[16],clientInstance:[16,"client-instance"],oramaCoreClientInstance:[16,"orama-core-client-instance"],open:[1540],facetProperty:[1,"facet-property"],resultMap:[16,"result-map"],resultItemRender:[16,"result-item-render"],sourceBaseUrl:[1,"source-base-url"],linksTarget:[1,"links-target"],linksRel:[1,"links-rel"],sourcesMap:[16,"sources-map"],disableChat:[4,"disable-chat"],layout:[1],highlightTitle:[4,"highlight-title"],highlightDescription:[4,"highlight-description"],prompt:[1],chatPlaceholder:[1,"chat-placeholder"],searchPlaceholder:[1,"search-placeholder"],suggestions:[16],searchParams:[16,"search-params"],chatMarkdownLinkTitle:[16,"chat-markdown-link-title"],chatMarkdownLinkHref:[16,"chat-markdown-link-href"],clearChatOnDisconnect:[4,"clear-chat-on-disconnect"],systemPrompts:[16,"system-prompts"],chatMarkdownLinkTarget:[16,"chat-markdown-link-target"],showKeyboardShortcuts:[4,"show-keyboard-shortcuts"],disclaimer:[1],dictionary:[16],relatedQueries:[2,"related-queries"],internalTextDictionary:[32],componentID:[32],systemScheme:[32],windowWidth:[32]},[[4,"keydown","handleKeyDown"]],{dictionary:["handleDictionaryChange"],index:["indexChanged"],clientInstance:["indexChanged"],oramaCoreClientInstance:["indexChanged"],themeConfig:["watchHandler"],colorScheme:["watchHandler"],open:["handleOpenPropChange"],facetProperty:["handleFacetPropertyChange"],searchParams:["handleSearchParamsChange"]}]);function Dk(){typeof customElements>"u"||["orama-search-box","orama-button","orama-chat","orama-chat-assistent-message","orama-chat-button","orama-chat-messages-container","orama-chat-user-message","orama-dots-loader","orama-embed","orama-facets","orama-footer","orama-input","orama-markdown","orama-modal","orama-navigation-bar","orama-search","orama-search-results","orama-sliding-panel","orama-sources","orama-suggestions","orama-text","orama-textarea","orama-toggler"].forEach(e=>{switch(e){case"orama-search-box":customElements.get(e)||customElements.define(e,Nk);break;case"orama-button":customElements.get(e)||yo();break;case"orama-chat":customElements.get(e)||fg();break;case"orama-chat-assistent-message":customElements.get(e)||tc();break;case"orama-chat-button":customElements.get(e)||Ck();break;case"orama-chat-messages-container":customElements.get(e)||Fu();break;case"orama-chat-user-message":customElements.get(e)||oc();break;case"orama-dots-loader":customElements.get(e)||ti();break;case"orama-embed":customElements.get(e)||Ak();break;case"orama-facets":customElements.get(e)||mg();break;case"orama-footer":customElements.get(e)||Tk();break;case"orama-input":customElements.get(e)||gg();break;case"orama-markdown":customElements.get(e)||Jo();break;case"orama-modal":customElements.get(e)||Ek();break;case"orama-navigation-bar":customElements.get(e)||Ok();break;case"orama-search":customElements.get(e)||Lk();break;case"orama-search-results":customElements.get(e)||bg();break;case"orama-sliding-panel":customElements.get(e)||Mk();break;case"orama-sources":customElements.get(e)||ri();break;case"orama-suggestions":customElements.get(e)||es();break;case"orama-text":customElements.get(e)||ja();break;case"orama-textarea":customElements.get(e)||Wu();break;case"orama-toggler":customElements.get(e)||yg();break}})}l(Dk,"defineCustomElement$1");var MD=Nk,ND=Dk,DD=":host{display:block}.kyb-shortcut{background-color:#eee9f6;background-color:var(--background-color-tertiary,#eee9f6);border-radius:.5rem;border-radius:var(--radius-s,calc(8rem/var(--orama-base-font-size, 16)));padding:.25rem;padding:var(--spacing-xs,calc(4rem/var(--orama-base-font-size, 16))) var(--spacing-s,calc(4rem/var(--orama-base-font-size, 16)))}",zk=Jt(class extends Xt{static{l(this,"OramaSearchButton")}constructor(){super(),this.__registerHost(),this.__attachShadow(),this.size="medium",this.colorScheme="light",this.dictionary={},this.systemScheme="light",this.shortcutLabel="",this.componentID=$u("search-button"),this.onPrefersColorSchemeChange=e=>{this.systemScheme=e.matches?"dark":"light",this.updateTheme()}}handleTextDictionaryChange(e){if(typeof e=="string")try{this.dictionary=JSON.parse(e)}catch(t){console.error("Error parsing dictionary:",t)}}getText(e){return ai(e,this.dictionary)}watchHandler(){this.updateTheme()}handleSearchboxClosed(e){this.buttonRef.querySelector("button").focus()}handleKeyDown(e){e.key==="k"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.buttonRef.click())}updateTheme(){let e=Pu(this.htmlElement,this.colorScheme,this.systemScheme);Ou(this.htmlElement,e,this.themeConfig)}handleShortcutLabel(){return navigator.userAgent.includes("Mac")?"\u2318 K":"Ctrl + K"}connectedCallback(){this.htmlElement.id=this.componentID,this.shortcutLabel=this.handleShortcutLabel(),this.schemaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.systemScheme=this.schemaQuery.matches?"dark":"light",this.updateTheme(),this.schemaQuery.addEventListener("change",this.onPrefersColorSchemeChange)}disconnectedCallback(){this.schemaQuery.removeEventListener("change",this.onPrefersColorSchemeChange)}componentWillLoad(){this.updateTheme()}render(){return z(ta,{key:"d784308be3ef8bb2abeaa25bed43f51962ec7586"},z("orama-button",{key:"2dafcd15bb0b5f468e6a91d9651cec22f2670a61",type:"button",variant:"secondary",ref:l(e=>this.buttonRef=e,"ref"),size:this.size,onClick:l(()=>{let e=document.getElementsByTagName("orama-search-box");if(!e.length){console.error("No OramaSearchBox found");return}if(e.length>1){console.error("Multiple instances of OramaSearchBox (orama-search-box) found. Considere to assign an ID to OramaSearchBox, implement onClick on OramaSearchButton and select desired OramaSearchBox on onClick method");return}e[0].open=!0},"onClick")},z("span",{key:"c96898d75e57d546930794c25d04a6cd3cd3f960",slot:"adorment-start"},z("ph-magnifying-glass",{key:"a42c0d765c8bdf1647ebc7d9e85c8ce224397ddf"})),z("slot",{key:"979f16ad8739765dc42ed9cbb46d6b2eb789e000"},this.getText("searchButtonLabel")),z("span",{key:"e211d3ccd39bbe8b628569a4d69ff23c7a0a9935",slot:"adorment-end",class:"kyb-shortcut"},this.shortcutLabel)))}get htmlElement(){return this}static get watchers(){return{dictionary:["handleTextDictionaryChange"],themeConfig:["watchHandler"],colorScheme:["watchHandler"]}}static get style(){return DD}},[1,"orama-search-button",{size:[1],themeConfig:[16,"theme-config"],colorScheme:[1,"color-scheme"],dictionary:[16],systemScheme:[32],shortcutLabel:[32],componentID:[32]},[[16,"searchboxClosed","handleSearchboxClosed"],[4,"keydown","handleKeyDown"]],{dictionary:["handleTextDictionaryChange"],themeConfig:["watchHandler"],colorScheme:["watchHandler"]}]);function Zk(){typeof customElements>"u"||["orama-search-button","orama-button"].forEach(e=>{switch(e){case"orama-search-button":customElements.get(e)||customElements.define(e,zk);break;case"orama-button":customElements.get(e)||yo();break}})}l(Zk,"defineCustomElement$1");var zD=zk,ZD=Zk,DK=kl({tagName:"orama-chat-box",elementClass:UN,react:Mr,events:{onAnswerGenerated:"answerGenerated",onClearChat:"clearChat",onStartConversation:"startConversation",onAnswerSourceClick:"answerSourceClick",onChatMarkdownLinkClicked:"chatMarkdownLinkClicked"},defineCustomElement:VN}),zK=kl({tagName:"orama-markdown",elementClass:cD,react:Mr,events:{onChatMarkdownLinkClicked:"chatMarkdownLinkClicked"},defineCustomElement:dD}),jk=kl({tagName:"orama-search-box",elementClass:MD,react:Mr,events:{onSearchCompleted:"searchCompleted",onSearchResultClick:"searchResultClick",onClearChat:"clearChat",onStartConversation:"startConversation",onAnswerGenerated:"answerGenerated",onAnswerSourceClick:"answerSourceClick",onChatMarkdownLinkClicked:"chatMarkdownLinkClicked",onModalClosed:"modalClosed",onModalStatusChanged:"modalStatusChanged"},defineCustomElement:ND}),Bk=kl({tagName:"orama-search-button",elementClass:zD,react:Mr,events:{},defineCustomElement:ZD}),jD=l(()=>{},"globalScripts"),ZK=l(async(e,t)=>{if(!(typeof window>"u"))return await jD(),K8([["orama-logo-icon",[[2,"orama-logo-icon",{size:[2]}]]],["orama-button_25",[[1,"orama-search-box",{themeConfig:[16,"theme-config"],colorScheme:[1,"color-scheme"],index:[16],clientInstance:[16,"client-instance"],oramaCoreClientInstance:[16,"orama-core-client-instance"],open:[1540],facetProperty:[1,"facet-property"],resultMap:[16,"result-map"],resultItemRender:[16,"result-item-render"],sourceBaseUrl:[1,"source-base-url"],linksTarget:[1,"links-target"],linksRel:[1,"links-rel"],sourcesMap:[16,"sources-map"],disableChat:[4,"disable-chat"],layout:[1],highlightTitle:[4,"highlight-title"],highlightDescription:[4,"highlight-description"],prompt:[1],chatPlaceholder:[1,"chat-placeholder"],searchPlaceholder:[1,"search-placeholder"],suggestions:[16],searchParams:[16,"search-params"],chatMarkdownLinkTitle:[16,"chat-markdown-link-title"],chatMarkdownLinkHref:[16,"chat-markdown-link-href"],clearChatOnDisconnect:[4,"clear-chat-on-disconnect"],systemPrompts:[16,"system-prompts"],chatMarkdownLinkTarget:[16,"chat-markdown-link-target"],showKeyboardShortcuts:[4,"show-keyboard-shortcuts"],disclaimer:[1],dictionary:[16],relatedQueries:[2,"related-queries"],internalTextDictionary:[32],componentID:[32],systemScheme:[32],windowWidth:[32]},[[4,"keydown","handleKeyDown"]],{dictionary:["handleDictionaryChange"],index:["indexChanged"],clientInstance:["indexChanged"],oramaCoreClientInstance:["indexChanged"],themeConfig:["watchHandler"],colorScheme:["watchHandler"],open:["handleOpenPropChange"],facetProperty:["handleFacetPropertyChange"],searchParams:["handleSearchParamsChange"]}],[1,"orama-chat-box",{index:[16],clientInstance:[16,"client-instance"],oramaCoreClientInstance:[16,"orama-core-client-instance"],sourceBaseUrl:[1,"source-base-url"],linksTarget:[1,"links-target"],linksRel:[1,"links-rel"],placeholder:[1],sourcesMap:[16,"sources-map"],suggestions:[16],relatedQueries:[2,"related-queries"],autoFocus:[4,"auto-focus"],systemPrompts:[16,"system-prompts"],prompt:[1],clearChatOnDisconnect:[4,"clear-chat-on-disconnect"],chatMarkdownLinkTitle:[16,"chat-markdown-link-title"],chatMarkdownLinkHref:[16,"chat-markdown-link-href"],chatMarkdownLinkTarget:[16,"chat-markdown-link-target"],dictionary:[16],disclaimer:[1],themeConfig:[16,"theme-config"],colorScheme:[1,"color-scheme"],componentID:[32],systemScheme:[32]},null,{index:["watchHandler"],themeConfig:["watchHandler"],colorScheme:["watchHandler"],oramaCoreClientInstance:["watchHandler"],clientInstance:["watchHandler"],dictionary:["handleTextDictionaryChange"]}],[1,"orama-search-button",{size:[1],themeConfig:[16,"theme-config"],colorScheme:[1,"color-scheme"],dictionary:[16],systemScheme:[32],shortcutLabel:[32],componentID:[32]},[[16,"searchboxClosed","handleSearchboxClosed"],[4,"keydown","handleKeyDown"]],{dictionary:["handleTextDictionaryChange"],themeConfig:["watchHandler"],colorScheme:["watchHandler"]}],[6,"orama-search",{placeholder:[1],focusInput:[4,"focus-input"],suggestions:[16],sourceBaseUrl:[1,"source-base-url"],linksTarget:[1,"links-target"],linksRel:[1,"links-rel"],disableChat:[4,"disable-chat"],relatedQueries:[2,"related-queries"],highlightTitle:[4,"highlight-title"],highlightDescription:[4,"highlight-description"],dictionary:[16],selectedFacet:[32]}],[2,"orama-navigation-bar",{handleClose:[16,"handle-close"],showBackButton:[4,"show-back-button"],showChatActions:[4,"show-chat-actions"]}],[2,"orama-footer",{class:[1],colorScheme:[16,"color-scheme"],showKeyboardShortcuts:[4,"show-keyboard-shortcuts"]}],[2,"orama-chat-button",{label:[1],active:[4],highlight:[1028],class:[1]},null,{active:["highlightButton"],highlight:["highlightButton"]}],[6,"orama-embed"],[6,"orama-modal",{closeOnEscape:[4,"close-on-escape"],closeOnOutsideClick:[4,"close-on-outside-click"],mainTitle:[1,"main-title"],activeElement:[32]}],[6,"orama-sliding-panel",{backdrop:[4],open:[4],closed:[16],isOpen:[32]},[[4,"keydown","handleKeyDown"]],{open:["openChanged"]}],[4,"orama-chat",{placeholder:[1],sourceBaseUrl:[1,"source-base-url"],linksTarget:[1,"links-target"],linksRel:[1,"links-rel"],sourcesMap:[16,"sources-map"],showClearChat:[4,"show-clear-chat"],defaultTerm:[1,"default-term"],focusInput:[4,"focus-input"],suggestions:[16],relatedQueries:[2,"related-queries"],prompt:[1],systemPrompts:[16,"system-prompts"],clearChatOnDisconnect:[4,"clear-chat-on-disconnect"],dictionary:[16],disclaimer:[1],chatMarkdownLinkTitle:[16,"chat-markdown-link-title"],chatMarkdownLinkHref:[16,"chat-markdown-link-href"],chatMarkdownLinkTarget:[16,"chat-markdown-link-target"],inputValue:[32],showGoToBottomButton:[32]},[[0,"sourceItemClick","handleSourceItemClick"]],{defaultTerm:["handleDefaultTermChange"],focusInput:["focusInputWatcher"],prompt:["promptWatcher"],dictionary:["handleTextDictionaryChange"]}],[2,"orama-search-results",{sourceBaseUrl:[1,"source-base-url"],linksTarget:[1,"links-target"],linksRel:[1,"links-rel"],sections:[16],suggestions:[16],searchTerm:[1,"search-term"],setChatTerm:[16,"set-chat-term"],loading:[4],error:[4],highlightTitle:[4,"highlight-title"],highlightDescription:[4,"highlight-description"],dictionary:[16]}],[2,"orama-facets",{facets:[16],selectedFacet:[1,"selected-facet"],selectedFacetChanged:[16,"selected-facet-changed"]},[[0,"keydown","handleKeyDown"]],{selectedFacet:["handleSelectedFacetChange"]}],[2,"orama-input",{name:[1],size:[1],label:[1],type:[1],placeholder:[1],labelForScreenReaders:[1,"label-for-screen-readers"],defaultValue:[1,"default-value"],autoFocus:[4,"auto-focus"],value:[1]},null,{autoFocus:["handleAutoFocusChange"]}],[2,"orama-toggler",{performInitialAnimation:[4,"perform-initial-animation"]}],[2,"orama-chat-messages-container",{interactions:[16],chatMarkdownLinkTitle:[16,"chat-markdown-link-title"],chatMarkdownLinkHref:[16,"chat-markdown-link-href"],chatMarkdownLinkTarget:[16,"chat-markdown-link-target"],latestInteractionMinHeight:[32]}],[6,"orama-textarea",{value:[1],maxRows:[8,"max-rows"],minRows:[8,"min-rows"],placeholder:[1],autoFocus:[4,"auto-focus"],height:[32],startAdornmentWidth:[32],endAdornmentWidth:[32]},null,{autoFocus:["handleAutoFocusChange"],value:["handlePropsChange"],maxRows:["handlePropsChange"],minRows:["handlePropsChange"]}],[2,"orama-chat-assistent-message",{interaction:[16],chatMarkdownLinkTitle:[16,"chat-markdown-link-title"],chatMarkdownLinkHref:[16,"chat-markdown-link-href"],chatMarkdownLinkTarget:[16,"chat-markdown-link-target"],isCopied:[32],isDisliked:[32]}],[2,"orama-chat-user-message",{interaction:[16]}],[1,"orama-sources",{sources:[8],sourceBaseURL:[1,"source-base-u-r-l"],linksTarget:[1,"links-target"],linksRel:[1,"links-rel"],isCarouselScrollAtEnd:[32],isCarouselScrollAtStart:[32]}],[2,"orama-dots-loader"],[1,"orama-markdown",{content:[1],chatMarkdownLinkTitle:[16,"chat-markdown-link-title"],chatMarkdownLinkHref:[16,"chat-markdown-link-href"],chatMarkdownLinkTarget:[16,"chat-markdown-link-target"]},null,{content:["onContentChange"]}],[2,"orama-suggestions",{suggestions:[16],as:[1],icon:[16],suggestionClicked:[16,"suggestion-clicked"]}],[6,"orama-button",{as:[1],class:[1],variant:[1],size:[1],type:[1],disabled:[4],withTooltip:[1,"with-tooltip"]}],[6,"orama-text",{as:[1],styledAs:[1,"styled-as"],bold:[4],class:[1],align:[1],variant:[1],inactive:[4]}]]]],t)},"defineCustomElements");(function(){if(typeof window<"u"&&window.Reflect!==void 0&&window.customElements!==void 0){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}})();up(`@import"https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400..700;1,400..700&display=swap";[id^=orama-ui]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Instrument Sans,sans-serif;font-family:var(--font-primary,"Instrument Sans",sans-serif);font-weight:400;text-rendering:optimizeLegibility;vertical-align:baseline;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;--text-color-primary:#151515;--text-color-secondary:#838289;--text-color-tertiary:#99989d;--text-color-accent:#ae8ff7;--text-color-inactive:#99989d;--text-color-reverse:#fff;--background-color-primary:#fbfbfb;--background-color-secondary:#fff;--background-color-tertiary:#eee9f6;--background-color-fourth:#efefef;--background-color-reverse:#000;--background-color-accent:#432d77;--border-color-primary:#dadada;--border-color-secondary:#efefef;--border-color-tertiary:#151515;--border-color-accent:#432d77;--icon-color-primary:#151515;--icon-color-secondary:#dadada;--icon-color-tertiary:#838289;--icon-color-inactive:#99989d;--icon-color-reverse:#fbfbfb;--shadow-color-primary:#fff;--button-text-color-primary:#fbfbfb;--button-text-color-secondary:#838289;--button-background-color-primary:#432d77;--button-background-color-secondary:#fff;--button-background-color-secondary-hover:#eee9f6;--button-border-color-secondary:#dadada;--backdrop-background-color-primary:hsla(0,0%,98%,.7);--chat-button-border-color-gradientOne:transparent;--chat-button-border-color-gradientTwo:transparent;--chat-button-border-color-gradientThree:#432d77;--chat-button-border-color-gradientFour:#432d77;--chat-button-border-color-gradientFive:transparent;--chat-button-border-color-gradientSix:transparent;--chat-button-background-color-gradientOne:#432d77;--chat-button-background-color-gradientTwo:transparent;--font-primary:"Instrument Sans",sans-serif;--font-size-xxs:calc(10rem/var(--orama-base-font-size, 16));--font-size-xs:calc(12rem/var(--orama-base-font-size, 16));--font-size-sm:calc(14rem/var(--orama-base-font-size, 16));--font-size-md:calc(16rem/var(--orama-base-font-size, 16));--font-size-lg:calc(20rem/var(--orama-base-font-size, 16));--font-weight-normal:400;--font-weight-semibold:600;--font-line-height-s:1.25;--font-line-height-m:1.5;--radius-xs:calc(6rem/var(--orama-base-font-size, 16));--radius-s:calc(8rem/var(--orama-base-font-size, 16));--radius-m:calc(12rem/var(--orama-base-font-size, 16));--radius-l:calc(16rem/var(--orama-base-font-size, 16));--radius-3xl:calc(40rem/var(--orama-base-font-size, 16));--textarea-radius:calc(16rem/var(--orama-base-font-size, 16));--spacing-2xs:calc(2rem/var(--orama-base-font-size, 16));--spacing-xs:calc(4rem/var(--orama-base-font-size, 16));--spacing-s:calc(8rem/var(--orama-base-font-size, 16));--spacing-m:calc(12rem/var(--orama-base-font-size, 16));--spacing-l:calc(16rem/var(--orama-base-font-size, 16));--spacing-xl:calc(24rem/var(--orama-base-font-size, 16));--spacing-2xl:calc(32rem/var(--orama-base-font-size, 16));--spacing-3xl:calc(40rem/var(--orama-base-font-size, 16));--textarea-shadow:0px 4px 24px 0px var(--shadow-color-primary,#fff)}[id^=orama-ui] *,[id^=orama-ui] :after,[id^=orama-ui] :before{box-sizing:border-box}[id^=orama-ui].theme-dark{--text-color-primary:#fbfbfb;--text-color-secondary:#dadada;--text-color-tertiary:#838289;--text-color-accent:#ae8ff7;--text-color-inactive:#99989d;--text-color-reverse:#000;--background-color-primary:#050505;--background-color-secondary:#151515;--background-color-tertiary:#212121;--background-color-fourth:#2e2e2e;--background-color-reverse:#fff;--background-color-accent:#8152ee;--border-color-primary:#2e2e2e;--border-color-secondary:#151515;--border-color-tertiary:#afafb1;--border-color-accent:#8152ee;--icon-color-primary:#fbfbfb;--icon-color-secondary:#dadada;--icon-color-tertiary:#838289;--icon-color-inactive:#99989d;--icon-color-reverse:#050505;--shadow-color-primary:#000;--button-text-color-primary:#fbfbfb;--button-text-color-secondary:#99989d;--button-background-color-primary:#8152ee;--button-background-color-secondary:#151515;--button-background-color-secondary-hover:#212121;--button-border-color-secondary:#2e2e2e;--backdrop-background-color-primary:rgba(5,5,5,.7);--chat-button-border-color-gradientOne:transparent;--chat-button-border-color-gradientTwo:transparent;--chat-button-border-color-gradientThree:#8152ee;--chat-button-border-color-gradientFour:#8152ee;--chat-button-border-color-gradientFive:transparent;--chat-button-border-color-gradientSix:transparent;--chat-button-background-color-gradientOne:#8152ee;--chat-button-background-color-gradientTwo:transparent} `);Oe();E();var wg={colors:{light:{"--text-color-primary":"var(--color-neutral-900)","--text-color-accent":"var(--color-green-600)","--background-color-secondary":"var(--color-neutral-100)","--background-color-tertiary":"var(--color-neutral-300)","--border-color-accent":"var(--color-green-600)","--border-color-primary":"var(--color-neutral-200)","--border-color-tertiary":"var(--color-green-700)","--button-background-color-primary":"var(--color-green-600)","--button-background-color-secondary":"var(--color-white)","--button-background-color-secondary-hover":"var(--color-neutral-100)","--button-border-color-secondary":"var(--color-neutral-300)","--button-text-color-secondary":"var(--color-neutral-900)"},dark:{"--text-color-primary":"var(--color-neutral-100)","--text-color-accent":"var(--color-green-400)","--background-color-secondary":"var(--color-neutral-950)","--background-color-tertiary":"var(--color-neutral-900)","--border-color-accent":"var(--color-green-400)","--border-color-primary":"var(--color-neutral-900)","--border-color-tertiary":"var(--color-green-300)","--button-background-color-primary":"var(--color-green-400)","--button-background-color-secondary":"var(--color-neutral-950)","--button-background-color-secondary-hover":"var(--color-neutral-900)","--button-border-color-secondary":"var(--color-neutral-900)","--button-text-color-secondary":"var(--color-neutral-200)"}}};var BD=({theme:e})=>{let[t,r]=Ie(null),[a,n]=Ie(!0);return Ze(()=>{(async()=>{try{let s=ip({schema:{}});r(s);let i=await fetch("orama-db.json");i.ok&&dp(s,await i.json())}finally{n(!1)}})()},[]),S(nt,{children:[S(Bk,{"aria-disabled":!t||a,style:{flexGrow:1},colorScheme:e,themeConfig:wg,"aria-label":"Search documentation",children:"Search documentation"}),S(jk,{"aria-disabled":!t||a,disableChat:!0,linksTarget:"_self",clientInstance:t,colorScheme:e,themeConfig:wg})]})},Hk=BD;E();Oe();var Uk=e=>{document.documentElement.setAttribute("data-theme",e),localStorage.setItem("theme",e)},Vk=()=>{let[e,t]=Ie("light");Ze(()=>{let a=localStorage.getItem("theme")||document.documentElement.getAttribute("data-theme")||"light";Uk(a),t(a)},[]);let r=dt(()=>{t(a=>{let n=a==="light"?"dark":"light";return Uk(n),n})},[]);return[e,r]};var Fk=()=>{let[e,t]=Vk();return S(ky,{Logo:dy,sidebarItemTogglerAriaLabel:"Toggle navigation menu",navItems:[],children:[S(Hk,{theme:e}),S(hy,{onClick:t,"aria-label":`Switch to ${e==="light"?"dark":"light"} theme`}),S("a",{href:"https://github.com/nodejs/node","aria-label":"Node.js Github",className:ma.ghIconWrapper,children:S(Dc,{})})]})};E();E();E();Oe();Oe();E();function xg(e,[t,r]){return Math.min(r,Math.max(t,e))}E();function hr(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),r===!1||!n.defaultPrevented)return t?.(n)}}E();Oe();E();Oe();function ni(e,t=[]){let r=[];function a(o,s){let i=Ta(s),c=r.length;r=[...r,s];let u=h=>{let{scope:m,children:g,...x}=h,w=m?.[e]?.[c]||i,k=At(()=>x,Object.values(x));return S(w.Provider,{value:k,children:g})};u.displayName=o+"Provider";function p(h,m){let g=m?.[e]?.[c]||i,x=Ea(g);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[u,p]}let n=()=>{let o=r.map(s=>Ta(s));return function(i){let c=i?.[e]||o;return At(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])}};return n.scopeName=e,[a,HD(n,...t)]}function HD(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let a=e.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(o){let s=a.reduce((i,{useScope:c,scopeName:u})=>{let h=c(o)[`__scope${u}`];return{...i,...h}},{});return At(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}Oe();function Wk(e){let t=e+"CollectionProvider",[r,a]=ni(t),[n,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=w=>{let{scope:k,children:C}=w,A=Mr.useRef(null),$=Mr.useRef(new Map).current;return S(n,{scope:k,itemMap:$,collectionRef:A,children:C})};s.displayName=t;let i=e+"CollectionSlot",c=Eo(i),u=Mr.forwardRef((w,k)=>{let{scope:C,children:A}=w,$=o(i,C),L=cr(k,$.collectionRef);return S(c,{ref:L,children:A})});u.displayName=i;let p=e+"CollectionItemSlot",h="data-radix-collection-item",m=Eo(p),g=Mr.forwardRef((w,k)=>{let{scope:C,children:A,...$}=w,L=Mr.useRef(null),M=cr(k,L),O=o(p,C);return Mr.useEffect(()=>(O.itemMap.set(L,{ref:L,...$}),()=>void O.itemMap.delete(L))),S(m,{[h]:"",ref:M,children:A})});g.displayName=p;function x(w){let k=o(e+"CollectionConsumer",w);return Mr.useCallback(()=>{let A=k.collectionRef.current;if(!A)return[];let $=Array.from(A.querySelectorAll(`[${h}]`));return Array.from(k.itemMap.values()).sort((O,R)=>$.indexOf(O.ref.current)-$.indexOf(R.ref.current))},[k.collectionRef,k.itemMap])}return[{Provider:s,Slot:u,ItemSlot:g},x,a]}E();Oe();var UD=Ta(void 0);function qk(e){let t=Ea(UD);return e||t||"ltr"}E();Oe();E();Oe();function Ia(e){let t=je(e);return Ze(()=>{t.current=e}),At(()=>(...r)=>t.current?.(...r),[])}E();Oe();function Kk(e,t=globalThis?.document){let r=Ia(e);Ze(()=>{let a=n=>{n.key==="Escape"&&r(n)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[r,t])}var VD="DismissableLayer",_g="dismissableLayer.update",FD="dismissableLayer.pointerDownOutside",WD="dismissableLayer.focusOutside",Gk,Qk=Ta({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kg=_e((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:a,onPointerDownOutside:n,onFocusOutside:o,onInteractOutside:s,onDismiss:i,...c}=e,u=Ea(Qk),[p,h]=Ie(null),m=p?.ownerDocument??globalThis?.document,[,g]=Ie({}),x=cr(t,R=>h(R)),w=Array.from(u.layers),[k]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),C=w.indexOf(k),A=p?w.indexOf(p):-1,$=u.layersWithOutsidePointerEventsDisabled.size>0,L=A>=C,M=GD(R=>{let B=R.target,G=[...u.branches].some(j=>j.contains(B));!L||G||(n?.(R),s?.(R),R.defaultPrevented||i?.())},m),O=YD(R=>{let B=R.target;[...u.branches].some(j=>j.contains(B))||(o?.(R),s?.(R),R.defaultPrevented||i?.())},m);return Kk(R=>{A===u.layers.size-1&&(a?.(R),!R.defaultPrevented&&i&&(R.preventDefault(),i()))},m),Ze(()=>{if(p)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Gk=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),Yk(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Gk)}},[p,m,r,u]),Ze(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),Yk())},[p,u]),Ze(()=>{let R=()=>g({});return document.addEventListener(_g,R),()=>document.removeEventListener(_g,R)},[]),S(Tt.div,{...c,ref:x,style:{pointerEvents:$?L?"auto":"none":void 0,...e.style},onFocusCapture:hr(e.onFocusCapture,O.onFocusCapture),onBlurCapture:hr(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:hr(e.onPointerDownCapture,M.onPointerDownCapture)})});kg.displayName=VD;var qD="DismissableLayerBranch",KD=_e((e,t)=>{let r=Ea(Qk),a=je(null),n=cr(t,a);return Ze(()=>{let o=a.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),S(Tt.div,{...e,ref:n})});KD.displayName=qD;function GD(e,t=globalThis?.document){let r=Ia(e),a=je(!1),n=je(()=>{});return Ze(()=>{let o=i=>{if(i.target&&!a.current){let u=function(){Xk(FD,r,p,{discrete:!0})};var c=u;let p={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",n.current),n.current=u,t.addEventListener("click",n.current,{once:!0})):u()}else t.removeEventListener("click",n.current);a.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",n.current)}},[t,r]),{onPointerDownCapture:()=>a.current=!0}}function YD(e,t=globalThis?.document){let r=Ia(e),a=je(!1);return Ze(()=>{let n=o=>{o.target&&!a.current&&Xk(WD,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",n),()=>t.removeEventListener("focusin",n)},[t,r]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Yk(){let e=new CustomEvent(_g);document.dispatchEvent(e)}function Xk(e,t,r,{discrete:a}){let n=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),a?gy(n,o):n.dispatchEvent(o)}E();Oe();var Sg=0;function e5(){Ze(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Jk()),document.body.insertAdjacentElement("beforeend",e[1]??Jk()),Sg++,()=>{Sg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Sg--}},[])}function Jk(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}E();Oe();var Ig="focusScope.autoFocusOnMount",Cg="focusScope.autoFocusOnUnmount",t5={bubbles:!1,cancelable:!0},QD="FocusScope",Ag=_e((e,t)=>{let{loop:r=!1,trapped:a=!1,onMountAutoFocus:n,onUnmountAutoFocus:o,...s}=e,[i,c]=Ie(null),u=Ia(n),p=Ia(o),h=je(null),m=cr(t,w=>c(w)),g=je({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Ze(()=>{if(a){let A=function(O){if(g.paused||!i)return;let R=O.target;i.contains(R)?h.current=R:vo(h.current,{select:!0})},$=function(O){if(g.paused||!i)return;let R=O.relatedTarget;R!==null&&(i.contains(R)||vo(h.current,{select:!0}))},L=function(O){if(document.activeElement===document.body)for(let B of O)B.removedNodes.length>0&&vo(i)};var w=A,k=$,C=L;document.addEventListener("focusin",A),document.addEventListener("focusout",$);let M=new MutationObserver(L);return i&&M.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",A),document.removeEventListener("focusout",$),M.disconnect()}}},[a,i,g.paused]),Ze(()=>{if(i){a5.add(g);let w=document.activeElement;if(!i.contains(w)){let C=new CustomEvent(Ig,t5);i.addEventListener(Ig,u),i.dispatchEvent(C),C.defaultPrevented||(XD(az(o5(i)),{select:!0}),document.activeElement===w&&vo(i))}return()=>{i.removeEventListener(Ig,u),setTimeout(()=>{let C=new CustomEvent(Cg,t5);i.addEventListener(Cg,p),i.dispatchEvent(C),C.defaultPrevented||vo(w??document.body,{select:!0}),i.removeEventListener(Cg,p),a5.remove(g)},0)}}},[i,u,p,g]);let x=dt(w=>{if(!r&&!a||g.paused)return;let k=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,C=document.activeElement;if(k&&C){let A=w.currentTarget,[$,L]=JD(A);$&&L?!w.shiftKey&&C===L?(w.preventDefault(),r&&vo($,{select:!0})):w.shiftKey&&C===$&&(w.preventDefault(),r&&vo(L,{select:!0})):C===A&&w.preventDefault()}},[r,a,g.paused]);return S(Tt.div,{tabIndex:-1,...s,ref:m,onKeyDown:x})});Ag.displayName=QD;function XD(e,{select:t=!1}={}){let r=document.activeElement;for(let a of e)if(vo(a,{select:t}),document.activeElement!==r)return}function JD(e){let t=o5(e),r=r5(t,e),a=r5(t.reverse(),e);return[r,a]}function o5(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{let n=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||n?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function r5(e,t){for(let r of e)if(!ez(r,{upTo:t}))return r}function ez(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function tz(e){return e instanceof HTMLInputElement&&"select"in e}function vo(e,{select:t=!1}={}){if(e&&e.focus){let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&tz(e)&&t&&e.select()}}var a5=rz();function rz(){let e=[];return{add(t){let r=e[0];t!==r&&r?.pause(),e=n5(e,t),e.unshift(t)},remove(t){e=n5(e,t),e[0]?.resume()}}}function n5(e,t){let r=[...e],a=r.indexOf(t);return a!==-1&&r.splice(a,1),r}function az(e){return e.filter(t=>t.tagName!=="A")}E();Oe();E();Oe();var br=globalThis?.document?pa:()=>{};var nz=Ue[" useId ".trim().toString()]||(()=>{}),oz=0;function Ku(e){let[t,r]=Ie(nz());return br(()=>{e||r(a=>a??String(oz++))},[e]),e||(t?`radix-${t}`:"")}E();Oe();E();E();E();E();var l5=["top","right","bottom","left"];var Ja=Math.min,ra=Math.max,bc=Math.round,vc=Math.floor,Ba=e=>({x:e,y:e}),sz={left:"right",right:"left",bottom:"top",top:"bottom"},iz={start:"end",end:"start"};function Yu(e,t,r){return ra(e,Ja(t,r))}function en(e,t){return typeof e=="function"?e(t):e}function tn(e){return e.split("-")[0]}function ts(e){return e.split("-")[1]}function Qu(e){return e==="x"?"y":"x"}function Xu(e){return e==="y"?"height":"width"}var lz=new Set(["top","bottom"]);function Ha(e){return lz.has(tn(e))?"y":"x"}function Ju(e){return Qu(Ha(e))}function c5(e,t,r){r===void 0&&(r=!1);let a=ts(e),n=Ju(e),o=Xu(n),s=n==="x"?a===(r?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=yc(s)),[s,yc(s)]}function d5(e){let t=yc(e);return[Gu(e),t,Gu(t)]}function Gu(e){return e.replace(/start|end/g,t=>iz[t])}var s5=["left","right"],i5=["right","left"],cz=["top","bottom"],dz=["bottom","top"];function uz(e,t,r){switch(e){case"top":case"bottom":return r?t?i5:s5:t?s5:i5;case"left":case"right":return t?cz:dz;default:return[]}}function u5(e,t,r,a){let n=ts(e),o=uz(tn(e),r==="start",a);return n&&(o=o.map(s=>s+"-"+n),t&&(o=o.concat(o.map(Gu)))),o}function yc(e){return e.replace(/left|right|bottom|top/g,t=>sz[t])}function hz(e){return{top:0,right:0,bottom:0,left:0,...e}}function Tg(e){return typeof e!="number"?hz(e):{top:e,right:e,bottom:e,left:e}}function rs(e){let{x:t,y:r,width:a,height:n}=e;return{width:a,height:n,top:r,left:t,right:t+a,bottom:r+n,x:t,y:r}}function h5(e,t,r){let{reference:a,floating:n}=e,o=Ha(t),s=Ju(t),i=Xu(s),c=tn(t),u=o==="y",p=a.x+a.width/2-n.width/2,h=a.y+a.height/2-n.height/2,m=a[i]/2-n[i]/2,g;switch(c){case"top":g={x:p,y:a.y-n.height};break;case"bottom":g={x:p,y:a.y+a.height};break;case"right":g={x:a.x+a.width,y:h};break;case"left":g={x:a.x-n.width,y:h};break;default:g={x:a.x,y:a.y}}switch(ts(t)){case"start":g[s]-=m*(r&&u?-1:1);break;case"end":g[s]+=m*(r&&u?-1:1);break}return g}var m5=async(e,t,r)=>{let{placement:a="bottom",strategy:n="absolute",middleware:o=[],platform:s}=r,i=o.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:p,y:h}=h5(u,a,c),m=a,g={},x=0;for(let w=0;w({name:"arrow",options:e,async fn(t){let{x:r,y:a,placement:n,rects:o,platform:s,elements:i,middlewareData:c}=t,{element:u,padding:p=0}=en(e,t)||{};if(u==null)return{};let h=Tg(p),m={x:r,y:a},g=Ju(n),x=Xu(g),w=await s.getDimensions(u),k=g==="y",C=k?"top":"left",A=k?"bottom":"right",$=k?"clientHeight":"clientWidth",L=o.reference[x]+o.reference[g]-m[g]-o.floating[x],M=m[g]-o.reference[g],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u)),R=O?O[$]:0;(!R||!await(s.isElement==null?void 0:s.isElement(O)))&&(R=i.floating[$]||o.floating[x]);let B=L/2-M/2,G=R/2-w[x]/2-1,j=Ja(h[C],G),N=Ja(h[A],G),T=j,U=R-w[x]-N,ae=R/2-w[x]/2+B,oe=Yu(T,ae,U),ue=!c.arrow&&ts(n)!=null&&ae!==oe&&o.reference[x]/2-(aeae<=0)){var N,T;let ae=(((N=o.flip)==null?void 0:N.index)||0)+1,oe=R[ae];if(oe&&(!(h==="alignment"?A!==Ha(oe):!1)||j.every(fe=>fe.overflows[0]>0&&Ha(fe.placement)===A)))return{data:{index:ae,overflows:j},reset:{placement:oe}};let ue=(T=j.filter(ge=>ge.overflows[0]<=0).sort((ge,fe)=>ge.overflows[1]-fe.overflows[1])[0])==null?void 0:T.placement;if(!ue)switch(g){case"bestFit":{var U;let ge=(U=j.filter(fe=>{if(O){let Ve=Ha(fe.placement);return Ve===A||Ve==="y"}return!0}).map(fe=>[fe.placement,fe.overflows.filter(Ve=>Ve>0).reduce((Ve,gt)=>Ve+gt,0)]).sort((fe,Ve)=>fe[1]-Ve[1])[0])==null?void 0:U[0];ge&&(ue=ge);break}case"initialPlacement":ue=i;break}if(n!==ue)return{reset:{placement:ue}}}return{}}}};function p5(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function f5(e){return l5.some(t=>e[t]>=0)}var b5=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r}=t,{strategy:a="referenceHidden",...n}=en(e,t);switch(a){case"referenceHidden":{let o=await oi(t,{...n,elementContext:"reference"}),s=p5(o,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:f5(s)}}}case"escaped":{let o=await oi(t,{...n,altBoundary:!0}),s=p5(o,r.floating);return{data:{escapedOffsets:s,escaped:f5(s)}}}default:return{}}}}};var v5=new Set(["left","top"]);async function pz(e,t){let{placement:r,platform:a,elements:n}=e,o=await(a.isRTL==null?void 0:a.isRTL(n.floating)),s=tn(r),i=ts(r),c=Ha(r)==="y",u=v5.has(s)?-1:1,p=o&&c?-1:1,h=en(t,e),{mainAxis:m,crossAxis:g,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return i&&typeof x=="number"&&(g=i==="end"?x*-1:x),c?{x:g*p,y:m*u}:{x:m*u,y:g*p}}var w5=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,a;let{x:n,y:o,placement:s,middlewareData:i}=t,c=await pz(t,e);return s===((r=i.offset)==null?void 0:r.placement)&&(a=i.arrow)!=null&&a.alignmentOffset?{}:{x:n+c.x,y:o+c.y,data:{...c,placement:s}}}}},x5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:a,placement:n}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:i={fn:k=>{let{x:C,y:A}=k;return{x:C,y:A}}},...c}=en(e,t),u={x:r,y:a},p=await oi(t,c),h=Ha(tn(n)),m=Qu(h),g=u[m],x=u[h];if(o){let k=m==="y"?"top":"left",C=m==="y"?"bottom":"right",A=g+p[k],$=g-p[C];g=Yu(A,g,$)}if(s){let k=h==="y"?"top":"left",C=h==="y"?"bottom":"right",A=x+p[k],$=x-p[C];x=Yu(A,x,$)}let w=i.fn({...t,[m]:g,[h]:x});return{...w,data:{x:w.x-r,y:w.y-a,enabled:{[m]:o,[h]:s}}}}}},_5=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:r,y:a,placement:n,rects:o,middlewareData:s}=t,{offset:i=0,mainAxis:c=!0,crossAxis:u=!0}=en(e,t),p={x:r,y:a},h=Ha(n),m=Qu(h),g=p[m],x=p[h],w=en(i,t),k=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){let $=m==="y"?"height":"width",L=o.reference[m]-o.floating[$]+k.mainAxis,M=o.reference[m]+o.reference[$]-k.mainAxis;gM&&(g=M)}if(u){var C,A;let $=m==="y"?"width":"height",L=v5.has(tn(n)),M=o.reference[h]-o.floating[$]+(L&&((C=s.offset)==null?void 0:C[h])||0)+(L?0:k.crossAxis),O=o.reference[h]+o.reference[$]+(L?0:((A=s.offset)==null?void 0:A[h])||0)-(L?k.crossAxis:0);xO&&(x=O)}return{[m]:g,[h]:x}}}},k5=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,a;let{placement:n,rects:o,platform:s,elements:i}=t,{apply:c=()=>{},...u}=en(e,t),p=await oi(t,u),h=tn(n),m=ts(n),g=Ha(n)==="y",{width:x,height:w}=o.floating,k,C;h==="top"||h==="bottom"?(k=h,C=m===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(C=h,k=m==="end"?"top":"bottom");let A=w-p.top-p.bottom,$=x-p.left-p.right,L=Ja(w-p[k],A),M=Ja(x-p[C],$),O=!t.middlewareData.shift,R=L,B=M;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(B=$),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(R=A),O&&!m){let j=ra(p.left,0),N=ra(p.right,0),T=ra(p.top,0),U=ra(p.bottom,0);g?B=x-2*(j!==0||N!==0?j+N:ra(p.left,p.right)):R=w-2*(T!==0||U!==0?T+U:ra(p.top,p.bottom))}await c({...t,availableWidth:B,availableHeight:R});let G=await s.getDimensions(i.floating);return x!==G.width||w!==G.height?{reset:{rects:!0}}:{}}}};E();function eh(){return typeof window<"u"}function ns(e){return I5(e)?(e.nodeName||"").toLowerCase():"#document"}function ia(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ua(e){var t;return(t=(I5(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function I5(e){return eh()?e instanceof Node||e instanceof ia(e).Node:!1}function Ca(e){return eh()?e instanceof Element||e instanceof ia(e).Element:!1}function Va(e){return eh()?e instanceof HTMLElement||e instanceof ia(e).HTMLElement:!1}function S5(e){return!eh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ia(e).ShadowRoot}var fz=new Set(["inline","contents"]);function si(e){let{overflow:t,overflowX:r,overflowY:a,display:n}=Aa(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+r)&&!fz.has(n)}var mz=new Set(["table","td","th"]);function C5(e){return mz.has(ns(e))}var gz=[":popover-open",":modal"];function wc(e){return gz.some(t=>{try{return e.matches(t)}catch{return!1}})}var yz=["transform","translate","scale","rotate","perspective"],bz=["transform","translate","scale","rotate","perspective","filter"],vz=["paint","layout","strict","content"];function th(e){let t=rh(),r=Ca(e)?Aa(e):e;return yz.some(a=>r[a]?r[a]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||bz.some(a=>(r.willChange||"").includes(a))||vz.some(a=>(r.contain||"").includes(a))}function A5(e){let t=ao(e);for(;Va(t)&&!os(t);){if(th(t))return t;if(wc(t))return null;t=ao(t)}return null}function rh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var wz=new Set(["html","body","#document"]);function os(e){return wz.has(ns(e))}function Aa(e){return ia(e).getComputedStyle(e)}function xc(e){return Ca(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ao(e){if(ns(e)==="html")return e;let t=e.assignedSlot||e.parentNode||S5(e)&&e.host||Ua(e);return S5(t)?t.host:t}function T5(e){let t=ao(e);return os(t)?e.ownerDocument?e.ownerDocument.body:e.body:Va(t)&&si(t)?t:T5(t)}function as(e,t,r){var a;t===void 0&&(t=[]),r===void 0&&(r=!0);let n=T5(e),o=n===((a=e.ownerDocument)==null?void 0:a.body),s=ia(n);if(o){let i=ah(s);return t.concat(s,s.visualViewport||[],si(n)?n:[],i&&r?as(i):[])}return t.concat(n,as(n,[],r))}function ah(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function P5(e){let t=Aa(e),r=parseFloat(t.width)||0,a=parseFloat(t.height)||0,n=Va(e),o=n?e.offsetWidth:r,s=n?e.offsetHeight:a,i=bc(r)!==o||bc(a)!==s;return i&&(r=o,a=s),{width:r,height:a,$:i}}function $g(e){return Ca(e)?e:e.contextElement}function ii(e){let t=$g(e);if(!Va(t))return Ba(1);let r=t.getBoundingClientRect(),{width:a,height:n,$:o}=P5(t),s=(o?bc(r.width):r.width)/a,i=(o?bc(r.height):r.height)/n;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}var xz=Ba(0);function O5(e){let t=ia(e);return!rh()||!t.visualViewport?xz:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _z(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==ia(e)?!1:t}function ss(e,t,r,a){t===void 0&&(t=!1),r===void 0&&(r=!1);let n=e.getBoundingClientRect(),o=$g(e),s=Ba(1);t&&(a?Ca(a)&&(s=ii(a)):s=ii(e));let i=_z(o,r,a)?O5(o):Ba(0),c=(n.left+i.x)/s.x,u=(n.top+i.y)/s.y,p=n.width/s.x,h=n.height/s.y;if(o){let m=ia(o),g=a&&Ca(a)?ia(a):a,x=m,w=ah(x);for(;w&&a&&g!==x;){let k=ii(w),C=w.getBoundingClientRect(),A=Aa(w),$=C.left+(w.clientLeft+parseFloat(A.paddingLeft))*k.x,L=C.top+(w.clientTop+parseFloat(A.paddingTop))*k.y;c*=k.x,u*=k.y,p*=k.x,h*=k.y,c+=$,u+=L,x=ia(w),w=ah(x)}}return rs({width:p,height:h,x:c,y:u})}function Pg(e,t){let r=xc(e).scrollLeft;return t?t.left+r:ss(Ua(e)).left+r}function R5(e,t,r){r===void 0&&(r=!1);let a=e.getBoundingClientRect(),n=a.left+t.scrollLeft-(r?0:Pg(e,a)),o=a.top+t.scrollTop;return{x:n,y:o}}function kz(e){let{elements:t,rect:r,offsetParent:a,strategy:n}=e,o=n==="fixed",s=Ua(a),i=t?wc(t.floating):!1;if(a===s||i&&o)return r;let c={scrollLeft:0,scrollTop:0},u=Ba(1),p=Ba(0),h=Va(a);if((h||!h&&!o)&&((ns(a)!=="body"||si(s))&&(c=xc(a)),Va(a))){let g=ss(a);u=ii(a),p.x=g.x+a.clientLeft,p.y=g.y+a.clientTop}let m=s&&!h&&!o?R5(s,c,!0):Ba(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+p.x+m.x,y:r.y*u.y-c.scrollTop*u.y+p.y+m.y}}function Sz(e){return Array.from(e.getClientRects())}function Iz(e){let t=Ua(e),r=xc(e),a=e.ownerDocument.body,n=ra(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),o=ra(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight),s=-r.scrollLeft+Pg(e),i=-r.scrollTop;return Aa(a).direction==="rtl"&&(s+=ra(t.clientWidth,a.clientWidth)-n),{width:n,height:o,x:s,y:i}}function Cz(e,t){let r=ia(e),a=Ua(e),n=r.visualViewport,o=a.clientWidth,s=a.clientHeight,i=0,c=0;if(n){o=n.width,s=n.height;let u=rh();(!u||u&&t==="fixed")&&(i=n.offsetLeft,c=n.offsetTop)}return{width:o,height:s,x:i,y:c}}var Az=new Set(["absolute","fixed"]);function Tz(e,t){let r=ss(e,!0,t==="fixed"),a=r.top+e.clientTop,n=r.left+e.clientLeft,o=Va(e)?ii(e):Ba(1),s=e.clientWidth*o.x,i=e.clientHeight*o.y,c=n*o.x,u=a*o.y;return{width:s,height:i,x:c,y:u}}function E5(e,t,r){let a;if(t==="viewport")a=Cz(e,r);else if(t==="document")a=Iz(Ua(e));else if(Ca(t))a=Tz(t,r);else{let n=O5(e);a={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return rs(a)}function L5(e,t){let r=ao(e);return r===t||!Ca(r)||os(r)?!1:Aa(r).position==="fixed"||L5(r,t)}function Ez(e,t){let r=t.get(e);if(r)return r;let a=as(e,[],!1).filter(i=>Ca(i)&&ns(i)!=="body"),n=null,o=Aa(e).position==="fixed",s=o?ao(e):e;for(;Ca(s)&&!os(s);){let i=Aa(s),c=th(s);!c&&i.position==="fixed"&&(n=null),(o?!c&&!n:!c&&i.position==="static"&&!!n&&Az.has(n.position)||si(s)&&!c&&L5(e,s))?a=a.filter(p=>p!==s):n=i,s=ao(s)}return t.set(e,a),a}function $z(e){let{element:t,boundary:r,rootBoundary:a,strategy:n}=e,s=[...r==="clippingAncestors"?wc(t)?[]:Ez(t,this._c):[].concat(r),a],i=s[0],c=s.reduce((u,p)=>{let h=E5(t,p,n);return u.top=ra(h.top,u.top),u.right=Ja(h.right,u.right),u.bottom=Ja(h.bottom,u.bottom),u.left=ra(h.left,u.left),u},E5(t,i,n));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Pz(e){let{width:t,height:r}=P5(e);return{width:t,height:r}}function Oz(e,t,r){let a=Va(t),n=Ua(t),o=r==="fixed",s=ss(e,!0,o,t),i={scrollLeft:0,scrollTop:0},c=Ba(0);function u(){c.x=Pg(n)}if(a||!a&&!o)if((ns(t)!=="body"||si(n))&&(i=xc(t)),a){let g=ss(t,!0,o,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else n&&u();o&&!a&&n&&u();let p=n&&!a&&!o?R5(n,i):Ba(0),h=s.left+i.scrollLeft-c.x-p.x,m=s.top+i.scrollTop-c.y-p.y;return{x:h,y:m,width:s.width,height:s.height}}function Eg(e){return Aa(e).position==="static"}function $5(e,t){if(!Va(e)||Aa(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ua(e)===r&&(r=r.ownerDocument.body),r}function M5(e,t){let r=ia(e);if(wc(e))return r;if(!Va(e)){let n=ao(e);for(;n&&!os(n);){if(Ca(n)&&!Eg(n))return n;n=ao(n)}return r}let a=$5(e,t);for(;a&&C5(a)&&Eg(a);)a=$5(a,t);return a&&os(a)&&Eg(a)&&!th(a)?r:a||A5(e)||r}var Rz=async function(e){let t=this.getOffsetParent||M5,r=this.getDimensions,a=await r(e.floating);return{reference:Oz(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Lz(e){return Aa(e).direction==="rtl"}var N5={convertOffsetParentRelativeRectToViewportRelativeRect:kz,getDocumentElement:Ua,getClippingRect:$z,getOffsetParent:M5,getElementRects:Rz,getClientRects:Sz,getDimensions:Pz,getScale:ii,isElement:Ca,isRTL:Lz};function D5(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Mz(e,t){let r=null,a,n=Ua(e);function o(){var i;clearTimeout(a),(i=r)==null||i.disconnect(),r=null}function s(i,c){i===void 0&&(i=!1),c===void 0&&(c=1),o();let u=e.getBoundingClientRect(),{left:p,top:h,width:m,height:g}=u;if(i||t(),!m||!g)return;let x=vc(h),w=vc(n.clientWidth-(p+m)),k=vc(n.clientHeight-(h+g)),C=vc(p),$={rootMargin:-x+"px "+-w+"px "+-k+"px "+-C+"px",threshold:ra(0,Ja(1,c))||1},L=!0;function M(O){let R=O[0].intersectionRatio;if(R!==c){if(!L)return s();R?s(!1,R):a=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!D5(u,e.getBoundingClientRect())&&s(),L=!1}try{r=new IntersectionObserver(M,{...$,root:n.ownerDocument})}catch{r=new IntersectionObserver(M,$)}r.observe(e)}return s(!0),o}function Og(e,t,r,a){a===void 0&&(a={});let{ancestorScroll:n=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=a,u=$g(e),p=n||o?[...u?as(u):[],...as(t)]:[];p.forEach(C=>{n&&C.addEventListener("scroll",r,{passive:!0}),o&&C.addEventListener("resize",r)});let h=u&&i?Mz(u,r):null,m=-1,g=null;s&&(g=new ResizeObserver(C=>{let[A]=C;A&&A.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var $;($=g)==null||$.observe(t)})),r()}),u&&!c&&g.observe(u),g.observe(t));let x,w=c?ss(e):null;c&&k();function k(){let C=ss(e);w&&!D5(w,C)&&r(),w=C,x=requestAnimationFrame(k)}return r(),()=>{var C;p.forEach(A=>{n&&A.removeEventListener("scroll",r),o&&A.removeEventListener("resize",r)}),h?.(),(C=g)==null||C.disconnect(),g=null,c&&cancelAnimationFrame(x)}}var z5=w5;var Z5=x5,j5=y5,B5=k5,H5=b5,Rg=g5;var U5=_5,Lg=(e,t,r)=>{let a=new Map,n={platform:N5,...r},o={...n.platform,_c:a};return m5(e,t,{...n,platform:o})};Oe();Oe();Oe();var Nz=typeof document<"u",Dz=function(){},nh=Nz?pa:Dz;function oh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,a,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(a=r;a--!==0;)if(!oh(e[a],t[a]))return!1;return!0}if(n=Object.keys(e),r=n.length,r!==Object.keys(t).length)return!1;for(a=r;a--!==0;)if(!{}.hasOwnProperty.call(t,n[a]))return!1;for(a=r;a--!==0;){let o=n[a];if(!(o==="_owner"&&e.$$typeof)&&!oh(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function F5(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function V5(e,t){let r=F5(e);return Math.round(t*r)/r}function Mg(e){let t=je(e);return nh(()=>{t.current=e}),t}function W5(e){e===void 0&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:a=[],platform:n,elements:{reference:o,floating:s}={},transform:i=!0,whileElementsMounted:c,open:u}=e,[p,h]=Ie({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=Ie(a);oh(m,a)||g(a);let[x,w]=Ie(null),[k,C]=Ie(null),A=dt(fe=>{fe!==O.current&&(O.current=fe,w(fe))},[]),$=dt(fe=>{fe!==R.current&&(R.current=fe,C(fe))},[]),L=o||x,M=s||k,O=je(null),R=je(null),B=je(p),G=c!=null,j=Mg(c),N=Mg(n),T=Mg(u),U=dt(()=>{if(!O.current||!R.current)return;let fe={placement:t,strategy:r,middleware:m};N.current&&(fe.platform=N.current),Lg(O.current,R.current,fe).then(Ve=>{let gt={...Ve,isPositioned:T.current!==!1};ae.current&&!oh(B.current,gt)&&(B.current=gt,ws(()=>{h(gt)}))})},[m,t,r,N,T]);nh(()=>{u===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,h(fe=>({...fe,isPositioned:!1})))},[u]);let ae=je(!1);nh(()=>(ae.current=!0,()=>{ae.current=!1}),[]),nh(()=>{if(L&&(O.current=L),M&&(R.current=M),L&&M){if(j.current)return j.current(L,M,U);U()}},[L,M,U,j,G]);let oe=At(()=>({reference:O,floating:R,setReference:A,setFloating:$}),[A,$]),ue=At(()=>({reference:L,floating:M}),[L,M]),ge=At(()=>{let fe={position:r,left:0,top:0};if(!ue.floating)return fe;let Ve=V5(ue.floating,p.x),gt=V5(ue.floating,p.y);return i?{...fe,transform:"translate("+Ve+"px, "+gt+"px)",...F5(ue.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Ve,top:gt}},[r,i,ue.floating,p.x,p.y]);return At(()=>({...p,update:U,refs:oe,elements:ue,floatingStyles:ge}),[p,U,oe,ue,ge])}var zz=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){let{element:a,padding:n}=typeof e=="function"?e(r):e;return a&&t(a)?a.current!=null?Rg({element:a.current,padding:n}).fn(r):{}:a?Rg({element:a,padding:n}).fn(r):{}}}},q5=(e,t)=>({...z5(e),options:[e,t]}),K5=(e,t)=>({...Z5(e),options:[e,t]}),G5=(e,t)=>({...U5(e),options:[e,t]}),Y5=(e,t)=>({...j5(e),options:[e,t]}),Q5=(e,t)=>({...B5(e),options:[e,t]});var X5=(e,t)=>({...H5(e),options:[e,t]});var J5=(e,t)=>({...zz(e),options:[e,t]});E();Oe();var Zz="Arrow",eS=_e((e,t)=>{let{children:r,width:a=10,height:n=5,...o}=e;return S(Tt.svg,{...o,ref:t,width:a,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:S("polygon",{points:"0,0 30,0 15,10"})})});eS.displayName=Zz;var tS=eS;E();Oe();function rS(e){let[t,r]=Ie(void 0);return br(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let a=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;let o=n[0],s,i;if("borderBoxSize"in o){let c=o.borderBoxSize,u=Array.isArray(c)?c[0]:c;s=u.inlineSize,i=u.blockSize}else s=e.offsetWidth,i=e.offsetHeight;r({width:s,height:i})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else r(void 0)},[e]),t}var Ng="Popper",[aS,Dg]=ni(Ng),[Bz,nS]=aS(Ng),oS=e=>{let{__scopePopper:t,children:r}=e,[a,n]=Ie(null);return S(Bz,{scope:t,anchor:a,onAnchorChange:n,children:r})};oS.displayName=Ng;var sS="PopperAnchor",iS=_e((e,t)=>{let{__scopePopper:r,virtualRef:a,...n}=e,o=nS(sS,r),s=je(null),i=cr(t,s);return Ze(()=>{o.onAnchorChange(a?.current||s.current)}),a?null:S(Tt.div,{...n,ref:i})});iS.displayName=sS;var zg="PopperContent",[Hz,Uz]=aS(zg),lS=_e((e,t)=>{let{__scopePopper:r,side:a="bottom",sideOffset:n=0,align:o="center",alignOffset:s=0,arrowPadding:i=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:x,...w}=e,k=nS(zg,r),[C,A]=Ie(null),$=cr(t,xe=>A(xe)),[L,M]=Ie(null),O=rS(L),R=O?.width??0,B=O?.height??0,G=a+(o!=="center"?"-"+o:""),j=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},N=Array.isArray(u)?u:[u],T=N.length>0,U={padding:j,boundary:N.filter(Fz),altBoundary:T},{refs:ae,floatingStyles:oe,placement:ue,isPositioned:ge,middlewareData:fe}=W5({strategy:"fixed",placement:G,whileElementsMounted:(...xe)=>Og(...xe,{animationFrame:g==="always"}),elements:{reference:k.anchor},middleware:[q5({mainAxis:n+B,alignmentAxis:s}),c&&K5({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?G5():void 0,...U}),c&&Y5({...U}),Q5({...U,apply:({elements:xe,rects:Ge,availableWidth:Fe,availableHeight:De})=>{let{width:Ne,height:Ae}=Ge.reference,ut=xe.floating.style;ut.setProperty("--radix-popper-available-width",`${Fe}px`),ut.setProperty("--radix-popper-available-height",`${De}px`),ut.setProperty("--radix-popper-anchor-width",`${Ne}px`),ut.setProperty("--radix-popper-anchor-height",`${Ae}px`)}}),L&&J5({element:L,padding:i}),Wz({arrowWidth:R,arrowHeight:B}),m&&X5({strategy:"referenceHidden",...U})]}),[Ve,gt]=uS(ue),Ce=Ia(x);br(()=>{ge&&Ce?.()},[ge,Ce]);let pr=fe.arrow?.x,Te=fe.arrow?.y,Ct=fe.arrow?.centerOffset!==0,[ke,ht]=Ie();return br(()=>{C&&ht(window.getComputedStyle(C).zIndex)},[C]),S("div",{ref:ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...oe,transform:ge?oe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ke,"--radix-popper-transform-origin":[fe.transformOrigin?.x,fe.transformOrigin?.y].join(" "),...fe.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S(Hz,{scope:r,placedSide:Ve,onArrowChange:M,arrowX:pr,arrowY:Te,shouldHideArrow:Ct,children:S(Tt.div,{"data-side":Ve,"data-align":gt,...w,ref:$,style:{...w.style,animation:ge?void 0:"none"}})})})});lS.displayName=zg;var cS="PopperArrow",Vz={top:"bottom",right:"left",bottom:"top",left:"right"},dS=_e(function(t,r){let{__scopePopper:a,...n}=t,o=Uz(cS,a),s=Vz[o.placedSide];return S("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:S(tS,{...n,ref:r,style:{...n.style,display:"block"}})})});dS.displayName=cS;function Fz(e){return e!==null}var Wz=e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:a,middlewareData:n}=t,s=n.arrow?.centerOffset!==0,i=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[u,p]=uS(r),h={start:"0%",center:"50%",end:"100%"}[p],m=(n.arrow?.x??0)+i/2,g=(n.arrow?.y??0)+c/2,x="",w="";return u==="bottom"?(x=s?h:`${m}px`,w=`${-c}px`):u==="top"?(x=s?h:`${m}px`,w=`${a.floating.height+c}px`):u==="right"?(x=`${-c}px`,w=s?h:`${g}px`):u==="left"&&(x=`${a.floating.width+c}px`,w=s?h:`${g}px`),{data:{x,y:w}}}});function uS(e){let[t,r="center"]=e.split("-");return[t,r]}var hS=oS,pS=iS,fS=lS,mS=dS;E();Oe();Oe();var Kz="Portal",Zg=_e((e,t)=>{let{container:r,...a}=e,[n,o]=Ie(!1);br(()=>o(!0),[]);let s=r||n&&globalThis?.document?.body;return s?Mr.createPortal(S(Tt.div,{...a,ref:t}),s):null});Zg.displayName=Kz;E();Oe();Oe();var Gz=Ue[" useInsertionEffect ".trim().toString()]||br;function jg({prop:e,defaultProp:t,onChange:r=()=>{},caller:a}){let[n,o,s]=Yz({defaultProp:t,onChange:r}),i=e!==void 0,c=i?e:n;{let p=je(e!==void 0);Ze(()=>{let h=p.current;h!==i&&console.warn(`${a} is changing from ${h?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=i},[i,a])}let u=dt(p=>{if(i){let h=Qz(p)?p(e):p;h!==e&&s.current?.(h)}else o(p)},[i,e,o,s]);return[c,u]}function Yz({defaultProp:e,onChange:t}){let[r,a]=Ie(e),n=je(r),o=je(t);return Gz(()=>{o.current=t},[t]),Ze(()=>{n.current!==r&&(o.current?.(r),n.current=r)},[r,n]),[r,a,o]}function Qz(e){return typeof e=="function"}var GX=Symbol("RADIX:SYNC_STATE");E();Oe();function gS(e){let t=je({value:e,previous:e});return At(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}E();Oe();var Bg=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Xz="VisuallyHidden",Jz=_e((e,t)=>S(Tt.span,{...e,ref:t,style:{...Bg,...e.style}}));Jz.displayName=Xz;E();var eZ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},li=new WeakMap,sh=new WeakMap,ih={},Hg=0,yS=function(e){return e&&(e.host||yS(e.parentNode))},tZ=function(e,t){return t.map(function(r){if(e.contains(r))return r;var a=yS(r);return a&&e.contains(a)?a:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},rZ=function(e,t,r,a){var n=tZ(t,Array.isArray(e)?e:[e]);ih[r]||(ih[r]=new WeakMap);var o=ih[r],s=[],i=new Set,c=new Set(n),u=function(h){!h||i.has(h)||(i.add(h),u(h.parentNode))};n.forEach(u);var p=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(m){if(i.has(m))p(m);else try{var g=m.getAttribute(a),x=g!==null&&g!=="false",w=(li.get(m)||0)+1,k=(o.get(m)||0)+1;li.set(m,w),o.set(m,k),s.push(m),w===1&&x&&sh.set(m,!0),k===1&&m.setAttribute(r,"true"),x||m.setAttribute(a,"true")}catch(C){console.error("aria-hidden: cannot operate on ",m,C)}})};return p(t),i.clear(),Hg++,function(){s.forEach(function(h){var m=li.get(h)-1,g=o.get(h)-1;li.set(h,m),o.set(h,g),m||(sh.has(h)||h.removeAttribute(a),sh.delete(h)),g||h.removeAttribute(r)}),Hg--,Hg||(li=new WeakMap,li=new WeakMap,sh=new WeakMap,ih={})}},bS=function(e,t,r){r===void 0&&(r="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),n=t||eZ(e);return n?(a.push.apply(a,Array.from(n.querySelectorAll("[aria-live], script"))),rZ(a,n,r,"aria-hidden")):function(){return null}};E();E();E();var la=function(){return la=Object.assign||function(t){for(var r,a=1,n=arguments.length;a"u")return cZ;var t=dZ(e),r=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-r+t[2]-t[0])}};var uZ=kc(),ci="data-scroll-locked",hZ=function(e,t,r,a){var n=e.left,o=e.top,s=e.right,i=e.gap;return r===void 0&&(r="margin"),` .`.concat(Ug,` { overflow: hidden `).concat(a,`; padding-right: `).concat(i,"px ").concat(a,`; } body[`).concat(ci,`] { overflow: hidden `).concat(a,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(a,";"),r==="margin"&&` padding-left: `.concat(n,`px; padding-top: `).concat(o,`px; padding-right: `).concat(s,`px; margin-left:0; margin-top:0; margin-right: `).concat(i,"px ").concat(a,`; `),r==="padding"&&"padding-right: ".concat(i,"px ").concat(a,";")].filter(Boolean).join(""),` } .`).concat(is,` { right: `).concat(i,"px ").concat(a,`; } .`).concat(ls,` { margin-right: `).concat(i,"px ").concat(a,`; } .`).concat(is," .").concat(is,` { right: 0 `).concat(a,`; } .`).concat(ls," .").concat(ls,` { margin-right: 0 `).concat(a,`; } body[`).concat(ci,`] { `).concat(Vg,": ").concat(i,`px; } `)},IS=function(){var e=parseInt(document.body.getAttribute(ci)||"0",10);return isFinite(e)?e:0},pZ=function(){Ze(function(){return document.body.setAttribute(ci,(IS()+1).toString()),function(){var e=IS()-1;e<=0?document.body.removeAttribute(ci):document.body.setAttribute(ci,e.toString())}},[])},Jg=function(e){var t=e.noRelative,r=e.noImportant,a=e.gapMode,n=a===void 0?"margin":a;pZ();var o=At(function(){return Xg(n)},[n]);return Se(uZ,{styles:hZ(o,!t,n,r?"":"!important")})};E();var e1=!1;if(typeof window<"u")try{Sc=Object.defineProperty({},"passive",{get:function(){return e1=!0,!0}}),window.addEventListener("test",Sc,Sc),window.removeEventListener("test",Sc,Sc)}catch{e1=!1}var Sc,cs=e1?{passive:!1}:!1;E();var fZ=function(e){return e.tagName==="TEXTAREA"},CS=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!fZ(e)&&r[t]==="visible")},mZ=function(e){return CS(e,"overflowY")},gZ=function(e){return CS(e,"overflowX")},t1=function(e,t){var r=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var n=AS(e,a);if(n){var o=TS(e,a),s=o[1],i=o[2];if(s>i)return!0}a=a.parentNode}while(a&&a!==r.body);return!1},yZ=function(e){var t=e.scrollTop,r=e.scrollHeight,a=e.clientHeight;return[t,r,a]},bZ=function(e){var t=e.scrollLeft,r=e.scrollWidth,a=e.clientWidth;return[t,r,a]},AS=function(e,t){return e==="v"?mZ(t):gZ(t)},TS=function(e,t){return e==="v"?yZ(t):bZ(t)},vZ=function(e,t){return e==="h"&&t==="rtl"?-1:1},ES=function(e,t,r,a,n){var o=vZ(e,window.getComputedStyle(t).direction),s=o*a,i=r.target,c=t.contains(i),u=!1,p=s>0,h=0,m=0;do{if(!i)break;var g=TS(e,i),x=g[0],w=g[1],k=g[2],C=w-k-o*x;(x||C)&&AS(e,i)&&(h+=C,m+=x);var A=i.parentNode;i=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(p&&(n&&Math.abs(h)<1||!n&&s>h)||!p&&(n&&Math.abs(m)<1||!n&&-s>m))&&(u=!0),u};var uh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$S=function(e){return[e.deltaX,e.deltaY]},PS=function(e){return e&&"current"in e?e.current:e},wZ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},xZ=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},_Z=0,di=[];function OS(e){var t=je([]),r=je([0,0]),a=je(),n=Ie(_Z++)[0],o=Ie(kc)[0],s=je(e);Ze(function(){s.current=e},[e]),Ze(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(n));var w=vS([e.lockRef.current],(e.shards||[]).map(PS),!0).filter(Boolean);return w.forEach(function(k){return k.classList.add("allow-interactivity-".concat(n))}),function(){document.body.classList.remove("block-interactivity-".concat(n)),w.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(n))})}}},[e.inert,e.lockRef.current,e.shards]);var i=dt(function(w,k){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!s.current.allowPinchZoom;var C=uh(w),A=r.current,$="deltaX"in w?w.deltaX:A[0]-C[0],L="deltaY"in w?w.deltaY:A[1]-C[1],M,O=w.target,R=Math.abs($)>Math.abs(L)?"h":"v";if("touches"in w&&R==="h"&&O.type==="range")return!1;var B=t1(R,O);if(!B)return!0;if(B?M=R:(M=R==="v"?"h":"v",B=t1(R,O)),!B)return!1;if(!a.current&&"changedTouches"in w&&($||L)&&(a.current=M),!M)return!0;var G=a.current||M;return ES(G,k,w,G==="h"?$:L,!0)},[]),c=dt(function(w){var k=w;if(!(!di.length||di[di.length-1]!==o)){var C="deltaY"in k?$S(k):uh(k),A=t.current.filter(function(M){return M.name===k.type&&(M.target===k.target||k.target===M.shadowParent)&&wZ(M.delta,C)})[0];if(A&&A.should){k.cancelable&&k.preventDefault();return}if(!A){var $=(s.current.shards||[]).map(PS).filter(Boolean).filter(function(M){return M.contains(k.target)}),L=$.length>0?i(k,$[0]):!s.current.noIsolation;L&&k.cancelable&&k.preventDefault()}}},[]),u=dt(function(w,k,C,A){var $={name:w,delta:k,target:C,should:A,shadowParent:kZ(C)};t.current.push($),setTimeout(function(){t.current=t.current.filter(function(L){return L!==$})},1)},[]),p=dt(function(w){r.current=uh(w),a.current=void 0},[]),h=dt(function(w){u(w.type,$S(w),w.target,i(w,e.lockRef.current))},[]),m=dt(function(w){u(w.type,uh(w),w.target,i(w,e.lockRef.current))},[]);Ze(function(){return di.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",c,cs),document.addEventListener("touchmove",c,cs),document.addEventListener("touchstart",p,cs),function(){di=di.filter(function(w){return w!==o}),document.removeEventListener("wheel",c,cs),document.removeEventListener("touchmove",c,cs),document.removeEventListener("touchstart",p,cs)}},[]);var g=e.removeScrollBar,x=e.inert;return Se(nt,null,x?Se(o,{styles:xZ(n)}):null,g?Se(Jg,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function kZ(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var RS=qg(dh,OS);var LS=_e(function(e,t){return Se(_c,la({},e,{ref:t,sideCar:RS}))});LS.classNames=_c.classNames;var r1=LS;var SZ=[" ","Enter","ArrowUp","ArrowDown"],IZ=[" ","Enter"],ds="Select",[ph,fh,CZ]=Wk(ds),[ui,lte]=ni(ds,[CZ,Dg]),mh=Dg(),[AZ,wo]=ui(ds),[TZ,EZ]=ui(ds),MS=e=>{let{__scopeSelect:t,children:r,open:a,defaultOpen:n,onOpenChange:o,value:s,defaultValue:i,onValueChange:c,dir:u,name:p,autoComplete:h,disabled:m,required:g,form:x}=e,w=mh(t),[k,C]=Ie(null),[A,$]=Ie(null),[L,M]=Ie(!1),O=qk(u),[R,B]=jg({prop:a,defaultProp:n??!1,onChange:o,caller:ds}),[G,j]=jg({prop:s,defaultProp:i,onChange:c,caller:ds}),N=je(null),T=k?x||!!k.closest("form"):!0,[U,ae]=Ie(new Set),oe=Array.from(U).map(ue=>ue.props.value).join(";");return S(hS,{...w,children:S(AZ,{required:g,scope:t,trigger:k,onTriggerChange:C,valueNode:A,onValueNodeChange:$,valueNodeHasChildren:L,onValueNodeHasChildrenChange:M,contentId:Ku(),value:G,onValueChange:j,open:R,onOpenChange:B,dir:O,triggerPointerDownPosRef:N,disabled:m,children:[S(ph.Provider,{scope:t,children:S(TZ,{scope:e.__scopeSelect,onNativeOptionAdd:dt(ue=>{ae(ge=>new Set(ge).add(ue))},[]),onNativeOptionRemove:dt(ue=>{ae(ge=>{let fe=new Set(ge);return fe.delete(ue),fe})},[]),children:r})}),T?S(a3,{"aria-hidden":!0,required:g,tabIndex:-1,name:p,autoComplete:h,value:G,onChange:ue=>j(ue.target.value),disabled:m,form:x,children:[G===void 0?S("option",{value:""}):null,Array.from(U)]},oe):null]})})};MS.displayName=ds;var NS="SelectTrigger",DS=_e((e,t)=>{let{__scopeSelect:r,disabled:a=!1,...n}=e,o=mh(r),s=wo(NS,r),i=s.disabled||a,c=cr(t,s.onTriggerChange),u=fh(r),p=je("touch"),[h,m,g]=o3(w=>{let k=u().filter($=>!$.disabled),C=k.find($=>$.value===s.value),A=s3(k,w,C);A!==void 0&&s.onValueChange(A.value)}),x=w=>{i||(s.onOpenChange(!0),g()),w&&(s.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return S(pS,{asChild:!0,...o,children:S(Tt.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":n3(s.value)?"":void 0,...n,ref:c,onClick:hr(n.onClick,w=>{w.currentTarget.focus(),p.current!=="mouse"&&x(w)}),onPointerDown:hr(n.onPointerDown,w=>{p.current=w.pointerType;let k=w.target;k.hasPointerCapture(w.pointerId)&&k.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(x(w),w.preventDefault())}),onKeyDown:hr(n.onKeyDown,w=>{let k=h.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&m(w.key),!(k&&w.key===" ")&&SZ.includes(w.key)&&(x(),w.preventDefault())})})})});DS.displayName=NS;var zS="SelectValue",ZS=_e((e,t)=>{let{__scopeSelect:r,className:a,style:n,children:o,placeholder:s="",...i}=e,c=wo(zS,r),{onValueNodeHasChildrenChange:u}=c,p=o!==void 0,h=cr(t,c.onValueNodeChange);return br(()=>{u(p)},[u,p]),S(Tt.span,{...i,ref:h,style:{pointerEvents:"none"},children:n3(c.value)?S(nt,{children:s}):o})});ZS.displayName=zS;var $Z="SelectIcon",PZ=_e((e,t)=>{let{__scopeSelect:r,children:a,...n}=e;return S(Tt.span,{"aria-hidden":!0,...n,ref:t,children:a||"\u25BC"})});PZ.displayName=$Z;var OZ="SelectPortal",jS=e=>S(Zg,{asChild:!0,...e});jS.displayName=OZ;var us="SelectContent",BS=_e((e,t)=>{let r=wo(us,e.__scopeSelect),[a,n]=Ie();if(br(()=>{n(new DocumentFragment)},[]),!r.open){let o=a;return o?vi(S(HS,{scope:e.__scopeSelect,children:S(ph.Slot,{scope:e.__scopeSelect,children:S("div",{children:e.children})})}),o):null}return S(US,{...e,ref:t})});BS.displayName=us;var Fa=10,[HS,xo]=ui(us),RZ="SelectContentImpl",LZ=Eo("SelectContent.RemoveScroll"),US=_e((e,t)=>{let{__scopeSelect:r,position:a="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:o,onPointerDownOutside:s,side:i,sideOffset:c,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:x,hideWhenDetached:w,avoidCollisions:k,...C}=e,A=wo(us,r),[$,L]=Ie(null),[M,O]=Ie(null),R=cr(t,xe=>L(xe)),[B,G]=Ie(null),[j,N]=Ie(null),T=fh(r),[U,ae]=Ie(!1),oe=je(!1);Ze(()=>{if($)return bS($)},[$]),e5();let ue=dt(xe=>{let[Ge,...Fe]=T().map(Ae=>Ae.ref.current),[De]=Fe.slice(-1),Ne=document.activeElement;for(let Ae of xe)if(Ae===Ne||(Ae?.scrollIntoView({block:"nearest"}),Ae===Ge&&M&&(M.scrollTop=0),Ae===De&&M&&(M.scrollTop=M.scrollHeight),Ae?.focus(),document.activeElement!==Ne))return},[T,M]),ge=dt(()=>ue([B,$]),[ue,B,$]);Ze(()=>{U&&ge()},[U,ge]);let{onOpenChange:fe,triggerPointerDownPosRef:Ve}=A;Ze(()=>{if($){let xe={x:0,y:0},Ge=De=>{xe={x:Math.abs(Math.round(De.pageX)-(Ve.current?.x??0)),y:Math.abs(Math.round(De.pageY)-(Ve.current?.y??0))}},Fe=De=>{xe.x<=10&&xe.y<=10?De.preventDefault():$.contains(De.target)||fe(!1),document.removeEventListener("pointermove",Ge),Ve.current=null};return Ve.current!==null&&(document.addEventListener("pointermove",Ge),document.addEventListener("pointerup",Fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ge),document.removeEventListener("pointerup",Fe,{capture:!0})}}},[$,fe,Ve]),Ze(()=>{let xe=()=>fe(!1);return window.addEventListener("blur",xe),window.addEventListener("resize",xe),()=>{window.removeEventListener("blur",xe),window.removeEventListener("resize",xe)}},[fe]);let[gt,Ce]=o3(xe=>{let Ge=T().filter(Ne=>!Ne.disabled),Fe=Ge.find(Ne=>Ne.ref.current===document.activeElement),De=s3(Ge,xe,Fe);De&&setTimeout(()=>De.ref.current.focus())}),pr=dt((xe,Ge,Fe)=>{let De=!oe.current&&!Fe;(A.value!==void 0&&A.value===Ge||De)&&(G(xe),De&&(oe.current=!0))},[A.value]),Te=dt(()=>$?.focus(),[$]),Ct=dt((xe,Ge,Fe)=>{let De=!oe.current&&!Fe;(A.value!==void 0&&A.value===Ge||De)&&N(xe)},[A.value]),ke=a==="popper"?a1:VS,ht=ke===a1?{side:i,sideOffset:c,align:u,alignOffset:p,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:x,hideWhenDetached:w,avoidCollisions:k}:{};return S(HS,{scope:r,content:$,viewport:M,onViewportChange:O,itemRefCallback:pr,selectedItem:B,onItemLeave:Te,itemTextRefCallback:Ct,focusSelectedItem:ge,selectedItemText:j,position:a,isPositioned:U,searchRef:gt,children:S(r1,{as:LZ,allowPinchZoom:!0,children:S(Ag,{asChild:!0,trapped:A.open,onMountAutoFocus:xe=>{xe.preventDefault()},onUnmountAutoFocus:hr(n,xe=>{A.trigger?.focus({preventScroll:!0}),xe.preventDefault()}),children:S(kg,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:xe=>xe.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:S(ke,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:xe=>xe.preventDefault(),...C,...ht,onPlaced:()=>ae(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:hr(C.onKeyDown,xe=>{let Ge=xe.ctrlKey||xe.altKey||xe.metaKey;if(xe.key==="Tab"&&xe.preventDefault(),!Ge&&xe.key.length===1&&Ce(xe.key),["ArrowUp","ArrowDown","Home","End"].includes(xe.key)){let De=T().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes(xe.key)&&(De=De.slice().reverse()),["ArrowUp","ArrowDown"].includes(xe.key)){let Ne=xe.target,Ae=De.indexOf(Ne);De=De.slice(Ae+1)}setTimeout(()=>ue(De)),xe.preventDefault()}})})})})})})});US.displayName=RZ;var MZ="SelectItemAlignedPosition",VS=_e((e,t)=>{let{__scopeSelect:r,onPlaced:a,...n}=e,o=wo(us,r),s=xo(us,r),[i,c]=Ie(null),[u,p]=Ie(null),h=cr(t,R=>p(R)),m=fh(r),g=je(!1),x=je(!0),{viewport:w,selectedItem:k,selectedItemText:C,focusSelectedItem:A}=s,$=dt(()=>{if(o.trigger&&o.valueNode&&i&&u&&w&&k&&C){let R=o.trigger.getBoundingClientRect(),B=u.getBoundingClientRect(),G=o.valueNode.getBoundingClientRect(),j=C.getBoundingClientRect();if(o.dir!=="rtl"){let Ne=j.left-B.left,Ae=G.left-Ne,ut=R.left-Ae,We=R.width+ut,yt=Math.max(We,B.width),tt=window.innerWidth-Fa,bt=xg(Ae,[Fa,Math.max(Fa,tt-yt)]);i.style.minWidth=We+"px",i.style.left=bt+"px"}else{let Ne=B.right-j.right,Ae=window.innerWidth-G.right-Ne,ut=window.innerWidth-R.right-Ae,We=R.width+ut,yt=Math.max(We,B.width),tt=window.innerWidth-Fa,bt=xg(Ae,[Fa,Math.max(Fa,tt-yt)]);i.style.minWidth=We+"px",i.style.right=bt+"px"}let N=m(),T=window.innerHeight-Fa*2,U=w.scrollHeight,ae=window.getComputedStyle(u),oe=parseInt(ae.borderTopWidth,10),ue=parseInt(ae.paddingTop,10),ge=parseInt(ae.borderBottomWidth,10),fe=parseInt(ae.paddingBottom,10),Ve=oe+ue+U+fe+ge,gt=Math.min(k.offsetHeight*5,Ve),Ce=window.getComputedStyle(w),pr=parseInt(Ce.paddingTop,10),Te=parseInt(Ce.paddingBottom,10),Ct=R.top+R.height/2-Fa,ke=T-Ct,ht=k.offsetHeight/2,xe=k.offsetTop+ht,Ge=oe+ue+xe,Fe=Ve-Ge;if(Ge<=Ct){let Ne=N.length>0&&k===N[N.length-1].ref.current;i.style.bottom="0px";let Ae=u.clientHeight-w.offsetTop-w.offsetHeight,ut=Math.max(ke,ht+(Ne?Te:0)+Ae+ge),We=Ge+ut;i.style.height=We+"px"}else{let Ne=N.length>0&&k===N[0].ref.current;i.style.top="0px";let ut=Math.max(Ct,oe+w.offsetTop+(Ne?pr:0)+ht)+Fe;i.style.height=ut+"px",w.scrollTop=Ge-Ct+w.offsetTop}i.style.margin=`${Fa}px 0`,i.style.minHeight=gt+"px",i.style.maxHeight=T+"px",a?.(),requestAnimationFrame(()=>g.current=!0)}},[m,o.trigger,o.valueNode,i,u,w,k,C,o.dir,a]);br(()=>$(),[$]);let[L,M]=Ie();br(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);let O=dt(R=>{R&&x.current===!0&&($(),A?.(),x.current=!1)},[$,A]);return S(DZ,{scope:r,contentWrapper:i,shouldExpandOnScrollRef:g,onScrollButtonChange:O,children:S("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:L},children:S(Tt.div,{...n,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});VS.displayName=MZ;var NZ="SelectPopperPosition",a1=_e((e,t)=>{let{__scopeSelect:r,align:a="start",collisionPadding:n=Fa,...o}=e,s=mh(r);return S(fS,{...s,...o,ref:t,align:a,collisionPadding:n,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});a1.displayName=NZ;var[DZ,l1]=ui(us,{}),n1="SelectViewport",FS=_e((e,t)=>{let{__scopeSelect:r,nonce:a,...n}=e,o=xo(n1,r),s=l1(n1,r),i=cr(t,o.onViewportChange),c=je(0);return S(nt,{children:[S("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),S(ph.Slot,{scope:r,children:S(Tt.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:hr(n.onScroll,u=>{let p=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=s;if(m?.current&&h){let g=Math.abs(c.current-p.scrollTop);if(g>0){let x=window.innerHeight-Fa*2,w=parseFloat(h.style.minHeight),k=parseFloat(h.style.height),C=Math.max(w,k);if(C0?L:0,h.style.justifyContent="flex-end")}}}c.current=p.scrollTop})})})]})});FS.displayName=n1;var WS="SelectGroup",[zZ,ZZ]=ui(WS),qS=_e((e,t)=>{let{__scopeSelect:r,...a}=e,n=Ku();return S(zZ,{scope:r,id:n,children:S(Tt.div,{role:"group","aria-labelledby":n,...a,ref:t})})});qS.displayName=WS;var KS="SelectLabel",GS=_e((e,t)=>{let{__scopeSelect:r,...a}=e,n=ZZ(KS,r);return S(Tt.div,{id:n.id,...a,ref:t})});GS.displayName=KS;var hh="SelectItem",[jZ,YS]=ui(hh),QS=_e((e,t)=>{let{__scopeSelect:r,value:a,disabled:n=!1,textValue:o,...s}=e,i=wo(hh,r),c=xo(hh,r),u=i.value===a,[p,h]=Ie(o??""),[m,g]=Ie(!1),x=cr(t,A=>c.itemRefCallback?.(A,a,n)),w=Ku(),k=je("touch"),C=()=>{n||(i.onValueChange(a),i.onOpenChange(!1))};if(a==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return S(jZ,{scope:r,value:a,disabled:n,textId:w,isSelected:u,onItemTextChange:dt(A=>{h($=>$||(A?.textContent??"").trim())},[]),children:S(ph.ItemSlot,{scope:r,value:a,disabled:n,textValue:p,children:S(Tt.div,{role:"option","aria-labelledby":w,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:x,onFocus:hr(s.onFocus,()=>g(!0)),onBlur:hr(s.onBlur,()=>g(!1)),onClick:hr(s.onClick,()=>{k.current!=="mouse"&&C()}),onPointerUp:hr(s.onPointerUp,()=>{k.current==="mouse"&&C()}),onPointerDown:hr(s.onPointerDown,A=>{k.current=A.pointerType}),onPointerMove:hr(s.onPointerMove,A=>{k.current=A.pointerType,n?c.onItemLeave?.():k.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:hr(s.onPointerLeave,A=>{A.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:hr(s.onKeyDown,A=>{c.searchRef?.current!==""&&A.key===" "||(IZ.includes(A.key)&&C(),A.key===" "&&A.preventDefault())})})})})});QS.displayName=hh;var Ic="SelectItemText",XS=_e((e,t)=>{let{__scopeSelect:r,className:a,style:n,...o}=e,s=wo(Ic,r),i=xo(Ic,r),c=YS(Ic,r),u=EZ(Ic,r),[p,h]=Ie(null),m=cr(t,C=>h(C),c.onItemTextChange,C=>i.itemTextRefCallback?.(C,c.value,c.disabled)),g=p?.textContent,x=At(()=>S("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:w,onNativeOptionRemove:k}=u;return br(()=>(w(x),()=>k(x)),[w,k,x]),S(nt,{children:[S(Tt.span,{id:c.textId,...o,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?vi(o.children,s.valueNode):null]})});XS.displayName=Ic;var JS="SelectItemIndicator",BZ=_e((e,t)=>{let{__scopeSelect:r,...a}=e;return YS(JS,r).isSelected?S(Tt.span,{"aria-hidden":!0,...a,ref:t}):null});BZ.displayName=JS;var o1="SelectScrollUpButton",e3=_e((e,t)=>{let r=xo(o1,e.__scopeSelect),a=l1(o1,e.__scopeSelect),[n,o]=Ie(!1),s=cr(t,a.onScrollButtonChange);return br(()=>{if(r.viewport&&r.isPositioned){let c=function(){let p=u.scrollTop>0;o(p)};var i=c;let u=r.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[r.viewport,r.isPositioned]),n?S(r3,{...e,ref:s,onAutoScroll:()=>{let{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});e3.displayName=o1;var s1="SelectScrollDownButton",t3=_e((e,t)=>{let r=xo(s1,e.__scopeSelect),a=l1(s1,e.__scopeSelect),[n,o]=Ie(!1),s=cr(t,a.onScrollButtonChange);return br(()=>{if(r.viewport&&r.isPositioned){let c=function(){let p=u.scrollHeight-u.clientHeight,h=Math.ceil(u.scrollTop)u.removeEventListener("scroll",c)}},[r.viewport,r.isPositioned]),n?S(r3,{...e,ref:s,onAutoScroll:()=>{let{viewport:i,selectedItem:c}=r;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});t3.displayName=s1;var r3=_e((e,t)=>{let{__scopeSelect:r,onAutoScroll:a,...n}=e,o=xo("SelectScrollButton",r),s=je(null),i=fh(r),c=dt(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return Ze(()=>()=>c(),[c]),br(()=>{i().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),S(Tt.div,{"aria-hidden":!0,...n,ref:t,style:{flexShrink:0,...n.style},onPointerDown:hr(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(a,50))}),onPointerMove:hr(n.onPointerMove,()=>{o.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(a,50))}),onPointerLeave:hr(n.onPointerLeave,()=>{c()})})}),HZ="SelectSeparator",UZ=_e((e,t)=>{let{__scopeSelect:r,...a}=e;return S(Tt.div,{"aria-hidden":!0,...a,ref:t})});UZ.displayName=HZ;var i1="SelectArrow",VZ=_e((e,t)=>{let{__scopeSelect:r,...a}=e,n=mh(r),o=wo(i1,r),s=xo(i1,r);return o.open&&s.position==="popper"?S(mS,{...n,...a,ref:t}):null});VZ.displayName=i1;var FZ="SelectBubbleInput",a3=_e(({__scopeSelect:e,value:t,...r},a)=>{let n=je(null),o=cr(a,n),s=gS(t);return Ze(()=>{let i=n.current;if(!i)return;let c=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&p){let h=new Event("change",{bubbles:!0});p.call(i,t),i.dispatchEvent(h)}},[s,t]),S(Tt.select,{...r,style:{...Bg,...r.style},ref:o,defaultValue:t})});a3.displayName=FZ;function n3(e){return e===""||e===void 0}function o3(e){let t=Ia(e),r=je(""),a=je(0),n=dt(s=>{let i=r.current+s;t(i),function c(u){r.current=u,window.clearTimeout(a.current),u!==""&&(a.current=window.setTimeout(()=>c(""),1e3))}(i)},[t]),o=dt(()=>{r.current="",window.clearTimeout(a.current)},[]);return Ze(()=>()=>window.clearTimeout(a.current),[]),[r,n,o]}function s3(e,t,r){let n=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1,s=WZ(e,Math.max(o,0));n.length===1&&(s=s.filter(u=>u!==r));let c=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==r?c:void 0}function WZ(e,t){return e.map((r,a)=>e[(t+a)%e.length])}var i3=MS,l3=DS,c3=ZS;var d3=jS,u3=BS,h3=FS,p3=qS,f3=GS,m3=QS,g3=XS;var y3=e3,b3=t3;var Cc=ba(fa(),1);Oe();E();var w3=ba(fa());Oe();E();var v3={skeleton:"_skeleton_1wftm_2",pulse:"_pulse_1wftm_1","pulse-dark":"_pulse-dark_1wftm_1"};var KZ=({children:e,className:t,hide:r=!1,loading:a=!0})=>!a&&r?null:a?S("span",{tabIndex:-1,"aria-hidden":"true",className:(0,w3.default)(v3.skeleton,t),"data-inline-skeleton":va(e)?void 0:!0,children:e}):e,x3=KZ;E();var ca={select:"_select_1h6ox_2",label:"_label_1h6ox_6",trigger:"_trigger_1h6ox_18",icon:"_icon_1h6ox_94",dropdown:"_dropdown_1h6ox_103",item:"_item_1h6ox_124",text:"_text_1h6ox_137",inline:"_inline_1h6ox_194",scrollIcon:"_scrollIcon_1h6ox_245"};var GZ=e=>!!(e[0]&&typeof e[0]=="string"),YZ=e=>!!(e[0]&&typeof e[0]=="object"&&"value"in e[0]),QZ=({values:e=[],defaultValue:t,placeholder:r,label:a,inline:n,onChange:o,className:s,ariaLabel:i,loading:c=!1,disabled:u=!1})=>{let p=bs(),[h,m]=Ie(t);Ze(()=>m(t),[t]);let g=At(()=>{let C=e;return GZ(C)&&(C=C.map(A=>({label:A,value:A}))),YZ(C)?[{items:C}]:C},[e]),x=At(()=>g.flatMap(({items:C})=>C).find(C=>C.value===h),[g,h]),w=At(()=>g.map(({label:C,items:A},$)=>S(p3,{children:[C&&S(f3,{className:(0,Cc.default)(ca.item,ca.label),children:C}),A.map(({value:L,label:M,iconImage:O,disabled:R})=>S(m3,{value:L,disabled:R,className:(0,Cc.default)(ca.item,ca.text),children:S(g3,{children:[O,S("span",{children:M})]})},L))]},C?.toString()??$)),[JSON.stringify(e)]),k=C=>{m(C),typeof o=="function"&&o(C)};return S(x3,{loading:c,children:S("span",{className:(0,Cc.default)(ca.select,{[ca.inline]:n},s),children:[a&&S("label",{className:ca.label,htmlFor:p,children:a}),S(i3,{value:x!==void 0?h:void 0,onValueChange:k,disabled:u,children:[S(l3,{className:ca.trigger,"aria-label":i,id:p,children:[S(c3,{placeholder:r,children:x!==void 0&&S(nt,{children:[x.iconImage,S("span",{children:x.label})]})}),S(xs,{className:ca.icon})]}),S(d3,{children:S(u3,{position:n?"popper":"item-aligned",className:(0,Cc.default)(ca.dropdown,{[ca.inline]:n}),children:[S(y3,{children:S(Bh,{className:ca.scrollIcon})}),S(h3,{children:w}),S(b3,{children:S(xs,{className:ca.scrollIcon})})]})})]})]})})},gh=QZ;E();E();var I3=ba(fa());E();var k3=ba(fa());E();var hs={item:"_item_1pzo6_2",label:"_label_1pzo6_17",progressionIcon:"_progressionIcon_1pzo6_24",icon:"_icon_1pzo6_36",progression:"_progression_1pzo6_24",active:"_active_1pzo6_49"};E();var XZ=e=>S("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"18",viewBox:"0 0 16 18",fill:"none",...e,children:S("path",{d:"M9 3.26795L8 2.6906L7 3.26795L3.5359 5.26795L2.5359 5.8453V7V11V12.1547L3.5359 12.7321L7 14.7321L8 15.3094L9 14.7321L12.4641 12.7321L13.4641 12.1547V11V7V5.8453L12.4641 5.26795L9 3.26795Z"})}),_3=XZ;var JZ=({label:e,link:t,showProgressionIcons:r=!1,...a})=>S(Nc,{className:(0,k3.default)({[hs.item]:!0,[hs.progression]:r}),href:t,activeClassName:hs.active,...a,children:[r&&S(_3,{className:hs.progressionIcon}),S("span",{className:hs.label,children:e}),/^https?:/.test(t)&&S(wi,{className:hs.icon})]}),S3=JZ;E();var Ac={group:"_group_68sov_2",progression:"_progression_68sov_7",groupName:"_groupName_68sov_8",itemList:"_itemList_68sov_33"};var ej=({groupName:e,items:t,showProgressionIcons:r,className:a,...n})=>S("section",{className:(0,I3.default)({[Ac.group]:!0,[Ac.progression]:r},a),children:[S("label",{className:Ac.groupName,children:e}),S("ul",{className:Ac.itemList,children:t.map(({label:o,link:s})=>S(S3,{label:o,link:s,showProgressionIcons:r,...n},s))})]}),C3=ej;E();var yh={wrapper:"_wrapper_1fu1w_2",navigation:"_navigation_1fu1w_30",mobileSelect:"_mobileSelect_1fu1w_36"};var tj=({groups:e,pathname:t,title:r,onSelect:a,as:n,showProgressionIcons:o=!1,children:s,placeholder:i})=>{let c=e.map(({items:p,groupName:h})=>({label:h,items:p.map(({label:m,link:g})=>({value:g,label:m}))})),u=c.flatMap(p=>p.items).find(p=>t===p.value);return S("aside",{className:yh.wrapper,children:[s,c.length>0&&S(gh,{label:r,values:c,defaultValue:u?.value,placeholder:i,onChange:a,className:yh.mobileSelect}),e.map(({groupName:p,items:h})=>S(C3,{groupName:p,items:h,pathname:t,as:n,showProgressionIcons:o,className:yh.navigation},p.toString()))]})},A3=tj;E();var T3={select:"_select_1hpof_1"};var E3=e=>window.location.href=e,$3=({versions:e,pathname:t,currentVersion:r,docPages:a})=>S(A3,{pathname:t,groups:[{groupName:"API Documentation",items:a.map(([n,o])=>({label:n,link:o}))}],onSelect:E3,children:S("div",{children:S(gh,{label:"Node.js version",values:e,inline:!0,className:T3.select,placeholder:r,onChange:E3})})});E();E();Oe();E();var P3={wrapper:"_wrapper_133pc_2"};var rj=({items:e,headings:t,as:r="a",heading:a})=>{let{minDepth:n=2,items:o=[]}=t||{},s=At(()=>o.filter(({depth:i})=>i>=n&&i<=4),[n,o]);return S("div",{className:P3.wrapper,children:S("dl",{children:[Object.entries(e).filter(([,i])=>!!i).map(([i,c])=>S(nt,{children:[S("dt",{children:i}),S("dd",{children:c})]},i)),s.length>0&&S(nt,{children:[S("dt",{children:a}),S("dd",{children:S("ol",{children:s.map(i=>S("li",{className:i.depth===3?"pl-2":i.depth===4?"pl-4":"",children:S(r,{href:`#${i?.data?.id}`,children:[" ",i.value]})},i.value))})})]})]})})},O3=rj;E();var R3={icon:"_icon_cyy06_1"};var aj={JSON:Uh,MD:Vh},L3=({headings:e=[],addedIn:t,readingTime:r,viewAs:a=[],editThisPage:n})=>S(O3,{heading:"Table of Contents",headings:{items:e.map(({slug:o,...s})=>({...s,data:{id:o}}))},items:{"Reading Time":r,"Added In":t,"View As":S("ol",{children:a.map(([o,s])=>{let i=aj[o];return S("li",{children:S("a",{href:s,children:[i&&S(i,{className:R3.icon}),o]})},o)})}),Contribute:S(nt,{children:[S(Dc,{className:"fill-neutral-700 dark:fill-neutral-100"}),S("a",{href:n,children:"Edit this page"})]})}});E();E();E();var nj=ba(fa());E();E();E();var M3=ba(fa(),1);E();var ps={summary:"_summary_189d0_2",dropdownContentWrapper:"_dropdownContentWrapper_189d0_43",dropdownContentInner:"_dropdownContentInner_189d0_69",dropdownItem:"_dropdownItem_189d0_74",dropdownLabel:"_dropdownLabel_189d0_104",dropdownVersions:"_dropdownVersions_189d0_113"};var oj=({label:e="History",changes:t=[],className:r,as:a="a","aria-label":n=e,...o})=>S("div",{className:(0,M3.default)("relative","inline-block",r),...o,children:S("details",{className:"group",children:[S("summary",{className:ps.summary,role:"button","aria-haspopup":"menu",children:[S(Hh,{className:"size-4"}),S("span",{children:e}),S(xs,{className:"size-3 group-open:rotate-180 motion-safe:transition-transform"})]}),S("div",{className:ps.dropdownContentWrapper,role:"menu","aria-label":n,children:S("div",{className:ps.dropdownContentInner,children:t.map((s,i)=>{let c=s.url?a:"div";return S(c,{className:ps.dropdownItem,role:"menuitem",tabIndex:0,"aria-label":`${s.label}: ${s.versions.join(", ")}`,href:s.url,children:[S("div",{className:ps.dropdownLabel,children:s.label}),S("div",{className:ps.dropdownVersions,children:s.versions.join(", ")})]},i)})})})]})}),N3=oj;E();var sj=ba(fa(),1);E();E();E();var D3={articleLayout:"_articleLayout_1iee6_2"};var ij=({children:e})=>S("div",{className:D3.articleLayout,children:e}),z3=ij;E();E();E();var lj=ba(fa(),1);E();E();Co();yi(S(nt,{children:[S(Fk,{}),` `,S(z3,{children:[S($3,{versions:[{value:"https://nodejs.org/docs/latest-v24.x/api/index.html",label:"v24.x"},{value:"https://nodejs.org/docs/latest-v23.x/api/index.html",label:"v23.x"},{value:"https://nodejs.org/docs/latest-v22.x/api/index.html",label:"v22.x (LTS)"},{value:"https://nodejs.org/docs/latest-v21.x/api/index.html",label:"v21.x"},{value:"https://nodejs.org/docs/latest-v20.x/api/index.html",label:"v20.x (LTS)"},{value:"https://nodejs.org/docs/latest-v19.x/api/index.html",label:"v19.x"},{value:"https://nodejs.org/docs/latest-v18.x/api/index.html",label:"v18.x"},{value:"https://nodejs.org/docs/latest-v17.x/api/index.html",label:"v17.x"},{value:"https://nodejs.org/docs/latest-v16.x/api/index.html",label:"v16.x"},{value:"https://nodejs.org/docs/latest-v15.x/api/index.html",label:"v15.x"},{value:"https://nodejs.org/docs/latest-v14.x/api/index.html",label:"v14.x"},{value:"https://nodejs.org/docs/latest-v13.x/api/index.html",label:"v13.x"},{value:"https://nodejs.org/docs/latest-v12.x/api/index.html",label:"v12.x"},{value:"https://nodejs.org/docs/latest-v11.x/api/index.html",label:"v11.x"},{value:"https://nodejs.org/docs/latest-v10.x/api/index.html",label:"v10.x"},{value:"https://nodejs.org/docs/latest-v9.x/api/index.html",label:"v9.x"},{value:"https://nodejs.org/docs/latest-v8.x/api/index.html",label:"v8.x"},{value:"https://nodejs.org/docs/latest-v7.x/api/index.html",label:"v7.x"},{value:"https://nodejs.org/docs/latest-v6.x/api/index.html",label:"v6.x"},{value:"https://nodejs.org/docs/latest-v5.x/api/index.html",label:"v5.x"},{value:"https://nodejs.org/docs/latest-v4.x/api/index.html",label:"v4.x"},{value:"https://nodejs.org/docs/latest-v0.12.x/api/index.html",label:"v0.12.x"},{value:"https://nodejs.org/docs/latest-v0.10.x/api/index.html",label:"v0.10.x"}],currentVersion:"v22.17.0",pathname:"index.html",docPages:[["About this documentation","documentation.html"],["Usage and example","synopsis.html"],["Assertion testing","assert.html"],["Asynchronous context tracking","async_context.html"],["Async hooks","async_hooks.html"],["Buffer","buffer.html"],["C++ addons","addons.html"],["C/C++ addons with Node-API","n-api.html"],["C++ embedder API","embedding.html"],["Child processes","child_process.html"],["Cluster","cluster.html"],["Command-line options","cli.html"],["Console","console.html"],["Crypto","crypto.html"],["Debugger","debugger.html"],["Deprecated APIs","deprecations.html"],["Diagnostics Channel","diagnostics_channel.html"],["DNS","dns.html"],["Domain","domain.html"],["Errors","errors.html"],["Events","events.html"],["File system","fs.html"],["Globals","globals.html"],["HTTP","http.html"],["HTTP/2","http2.html"],["HTTPS","https.html"],["Inspector","inspector.html"],["Internationalization","intl.html"],["Modules: CommonJS modules","modules.html"],["Modules: ECMAScript modules","esm.html"],["Modules: `node:module` API","module.html"],["Modules: Packages","packages.html"],["Modules: TypeScript","typescript.html"],["Net","net.html"],["OS","os.html"],["Path","path.html"],["Performance hooks","perf_hooks.html"],["Permissions","permissions.html"],["Process","process.html"],["Punycode","punycode.html"],["Query strings","querystring.html"],["Readline","readline.html"],["REPL","repl.html"],["Report","report.html"],["Single executable applications","single-executable-applications.html"],["SQLite","sqlite.html"],["Stream","stream.html"],["String decoder","string_decoder.html"],["Test runner","test.html"],["Timers","timers.html"],["TLS/SSL","tls.html"],["Trace events","tracing.html"],["TTY","tty.html"],["UDP/datagram","dgram.html"],["URL","url.html"],["Utilities","util.html"],["V8","v8.html"],["VM","vm.html"],["WASI","wasi.html"],["Web Crypto API","webcrypto.html"],["Web Streams API","webstreams.html"],["Worker threads","worker_threads.html"],["Zlib","zlib.html"]]}),S("div",{children:[S("main",{children:[S("div",{children:[S("h1",{children:S("a",{href:"#"})}),S(N3,{changes:[{versions:["v0.10.0"],label:"Introduced in: v0.10.0"}],className:"change-history"})]}),S("ul",{children:[` `,S("li",{children:S("a",{href:"documentation.html",children:"About this documentation"})}),` `,S("li",{children:S("a",{href:"synopsis.html",children:"Usage and example"})}),` `]}),S("hr",{className:"line"}),S("ul",{children:[` `,S("li",{children:S("a",{href:"assert.html",children:"Assertion testing"})}),` `,S("li",{children:S("a",{href:"async_context.html",children:"Asynchronous context tracking"})}),` `,S("li",{children:S("a",{href:"async_hooks.html",children:"Async hooks"})}),` `,S("li",{children:S("a",{href:"buffer.html",children:"Buffer"})}),` `,S("li",{children:S("a",{href:"addons.html",children:"C++ addons"})}),` `,S("li",{children:S("a",{href:"n-api.html",children:"C/C++ addons with Node-API"})}),` `,S("li",{children:S("a",{href:"embedding.html",children:"C++ embedder API"})}),` `,S("li",{children:S("a",{href:"child_process.html",children:"Child processes"})}),` `,S("li",{children:S("a",{href:"cluster.html",children:"Cluster"})}),` `,S("li",{children:S("a",{href:"cli.html",children:"Command-line options"})}),` `,S("li",{children:S("a",{href:"console.html",children:"Console"})}),` `,S("li",{children:S("a",{href:"crypto.html",children:"Crypto"})}),` `,S("li",{children:S("a",{href:"debugger.html",children:"Debugger"})}),` `,S("li",{children:S("a",{href:"deprecations.html",children:"Deprecated APIs"})}),` `,S("li",{children:S("a",{href:"diagnostics_channel.html",children:"Diagnostics Channel"})}),` `,S("li",{children:S("a",{href:"dns.html",children:"DNS"})}),` `,S("li",{children:S("a",{href:"domain.html",children:"Domain"})}),` `,S("li",{children:S("a",{href:"errors.html",children:"Errors"})}),` `,S("li",{children:S("a",{href:"events.html",children:"Events"})}),` `,S("li",{children:S("a",{href:"fs.html",children:"File system"})}),` `,S("li",{children:S("a",{href:"globals.html",children:"Globals"})}),` `,S("li",{children:S("a",{href:"http.html",children:"HTTP"})}),` `,S("li",{children:S("a",{href:"http2.html",children:"HTTP/2"})}),` `,S("li",{children:S("a",{href:"https.html",children:"HTTPS"})}),` `,S("li",{children:S("a",{href:"inspector.html",children:"Inspector"})}),` `,S("li",{children:S("a",{href:"intl.html",children:"Internationalization"})}),` `,S("li",{children:S("a",{href:"modules.html",children:"Modules: CommonJS modules"})}),` `,S("li",{children:S("a",{href:"esm.html",children:"Modules: ECMAScript modules"})}),` `,S("li",{children:S("a",{href:"module.html",children:["Modules: ",S("code",{children:"node:module"})," API"]})}),` `,S("li",{children:S("a",{href:"packages.html",children:"Modules: Packages"})}),` `,S("li",{children:S("a",{href:"typescript.html",children:"Modules: TypeScript"})}),` `,S("li",{children:S("a",{href:"net.html",children:"Net"})}),` `,S("li",{children:S("a",{href:"os.html",children:"OS"})}),` `,S("li",{children:S("a",{href:"path.html",children:"Path"})}),` `,S("li",{children:S("a",{href:"perf_hooks.html",children:"Performance hooks"})}),` `,S("li",{children:S("a",{href:"permissions.html",children:"Permissions"})}),` `,S("li",{children:S("a",{href:"process.html",children:"Process"})}),` `,S("li",{children:S("a",{href:"punycode.html",children:"Punycode"})}),` `,S("li",{children:S("a",{href:"querystring.html",children:"Query strings"})}),` `,S("li",{children:S("a",{href:"readline.html",children:"Readline"})}),` `,S("li",{children:S("a",{href:"repl.html",children:"REPL"})}),` `,S("li",{children:S("a",{href:"report.html",children:"Report"})}),` `,S("li",{children:S("a",{href:"single-executable-applications.html",children:"Single executable applications"})}),` `,S("li",{children:S("a",{href:"sqlite.html",children:"SQLite"})}),` `,S("li",{children:S("a",{href:"stream.html",children:"Stream"})}),` `,S("li",{children:S("a",{href:"string_decoder.html",children:"String decoder"})}),` `,S("li",{children:S("a",{href:"test.html",children:"Test runner"})}),` `,S("li",{children:S("a",{href:"timers.html",children:"Timers"})}),` `,S("li",{children:S("a",{href:"tls.html",children:"TLS/SSL"})}),` `,S("li",{children:S("a",{href:"tracing.html",children:"Trace events"})}),` `,S("li",{children:S("a",{href:"tty.html",children:"TTY"})}),` `,S("li",{children:S("a",{href:"dgram.html",children:"UDP/datagram"})}),` `,S("li",{children:S("a",{href:"url.html",children:"URL"})}),` `,S("li",{children:S("a",{href:"util.html",children:"Utilities"})}),` `,S("li",{children:S("a",{href:"v8.html",children:"V8"})}),` `,S("li",{children:S("a",{href:"vm.html",children:"VM"})}),` `,S("li",{children:S("a",{href:"wasi.html",children:"WASI"})}),` `,S("li",{children:S("a",{href:"webcrypto.html",children:"Web Crypto API"})}),` `,S("li",{children:S("a",{href:"webstreams.html",children:"Web Streams API"})}),` `,S("li",{children:S("a",{href:"worker_threads.html",children:"Worker threads"})}),` `,S("li",{children:S("a",{href:"zlib.html",children:"Zlib"})}),` `]}),S("hr",{className:"line"}),S("ul",{children:[` `,S("li",{children:S("a",{href:"https://github.com/nodejs/node",children:"Code repository and issue tracker"})}),` `]})]}),S(L3,{headings:[],addedIn:"v0.10.0",readingTime:"1 min read",viewAs:[["JSON","index.json"],["MD","index.md"]],editThisPage:"https://github.com/nodejs/node/edit/main/doc/api/index.md"})]})]})]}),document.getElementById("root"));})(); /*! Bundled license information: classnames/index.js: (*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames *) @orama/react-components/dist/orama-button_25.entry-HR7XE4SX.mjs: (*! Bundled license information: @noble/hashes/utils.js: (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) *) (** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) (** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) (*! @license DOMPurify 3.2.5 | (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.5/LICENSE *) @lit/react/create-component.js: (** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) @orama/react-components/dist/index.mjs: (*! Bundled license information: @noble/hashes/utils.js: (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) *) (** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) (** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause *) (*! @license DOMPurify 3.2.5 | (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.5/LICENSE *) (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) */