tia-gpc-widget 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -202,5 +202,5 @@ to {
|
|
|
202
202
|
> * {
|
|
203
203
|
pointer-events: auto;
|
|
204
204
|
}
|
|
205
|
-
`,it=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:o,toasterId:i,containerStyle:a,containerClassName:s})=>{let{toasts:u,handlers:c}=De(n,i);return l.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...a},className:s,onMouseEnter:c.startPause,onMouseLeave:c.endPause},u.map(n=>{let i=n.position||t,a=((e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:we()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...o}})(i,c.calculateOffset(n,{reverseOrder:e,gutter:r,defaultPosition:t}));return l.createElement(rt,{id:n.id,key:n.id,onHeightUpdate:c.updateHeight,className:n.visible?ot:"",style:a},"custom"===n.type?be(n.message,n):o?o(n):l.createElement(nt,{toast:n,position:i}))}))},at=Re;const st=({theme:e,onToggle:t})=>{const{t:n}=V();return N.jsx("button",{onClick:t,className:"gpc-header-button gpc-focus-visible gpc-transition","aria-label":n("theme.toggle"),title:n("theme.toggle"),children:"light"===e?N.jsx(ne,{className:"gpc-icon"}):N.jsx(oe,{className:"gpc-icon"})})},lt=[{code:"en",label:"English",flag:"🇬🇧"},{code:"es",label:"Español",flag:"🇪🇸"},{code:"fr",label:"Français",flag:"🇫🇷"}],ut=()=>{const{i18n:e}=V(),[t,n]=l.useState(!1),r=l.useRef(null),o=lt.find(t=>t.code===e.language)||lt[0];return l.useEffect(()=>{const e=e=>{r.current&&!r.current.contains(e.target)&&n(!1)};return t&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[t]),N.jsxs("div",{className:"gpc-language-selector",ref:r,children:[N.jsx("button",{onClick:()=>n(!t),className:"gpc-header-button gpc-focus-visible gpc-transition","aria-label":"Cambiar idioma",title:"Cambiar idioma",children:N.jsx(Z,{className:"gpc-icon"})}),t&&N.jsx("div",{className:"gpc-language-dropdown",children:lt.map(t=>N.jsxs("button",{onClick:()=>{return r=t.code,e.changeLanguage(r),void n(!1);var r},className:"gpc-language-option "+(t.code===o.code?"gpc-language-option-active":""),children:[N.jsx("span",{className:"gpc-language-flag",children:t.flag}),N.jsx("span",{className:"gpc-language-label",children:t.label})]},t.code))})]})},ct=({onClose:e,theme:t,onToggleTheme:n,showBranding:r=!0,widgetConfig:o=null})=>{const{t:i}=V(),a=o?.company_name||i("widget.title"),s=o?.company_logo_base64,l=s?.startsWith("data:")?s:s?`data:image/png;base64,${s}`:null;return N.jsxs("div",{className:"gpc-chat-header",children:[N.jsxs("div",{className:"gpc-header-content",children:[l&&N.jsx("div",{className:"gpc-header-logo",children:N.jsx("img",{src:l,alt:a,className:"gpc-company-logo"})}),N.jsx("div",{className:"gpc-header-text",children:N.jsx("h2",{className:"gpc-header-title",children:a})})]}),N.jsxs("div",{className:"gpc-header-actions",children:[N.jsx(ut,{}),N.jsx(st,{theme:t,onToggle:n}),N.jsx("button",{onClick:e,className:"gpc-header-button gpc-focus-visible gpc-transition","aria-label":i("chat.close"),title:i("chat.close"),children:N.jsx(G,{className:"gpc-icon"})})]})]})};function dt(){}function ft(){}const pt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ht=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gt={};function mt(e,t){return(gt.jsx?ht:pt).test(e)}const yt=/[ \t\n\f\r]/g;function vt(e){return""===e.replace(yt,"")}class bt{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function kt(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new bt(n,r,t)}function wt(e){return e.toLowerCase()}bt.prototype.normal={},bt.prototype.property={},bt.prototype.space=void 0;class xt{constructor(e,t){this.attribute=t,this.property=e}}xt.prototype.attribute="",xt.prototype.booleanish=!1,xt.prototype.boolean=!1,xt.prototype.commaOrSpaceSeparated=!1,xt.prototype.commaSeparated=!1,xt.prototype.defined=!1,xt.prototype.mustUseProperty=!1,xt.prototype.number=!1,xt.prototype.overloadedBoolean=!1,xt.prototype.property="",xt.prototype.spaceSeparated=!1,xt.prototype.space=void 0;let St=0;const Et=_t(),Ct=_t(),Tt=_t(),Nt=_t(),Ot=_t(),Pt=_t(),Lt=_t();function _t(){return 2**++St}const Rt=Object.freeze(Object.defineProperty({__proto__:null,boolean:Et,booleanish:Ct,commaOrSpaceSeparated:Lt,commaSeparated:Pt,number:Nt,overloadedBoolean:Tt,spaceSeparated:Ot},Symbol.toStringTag,{value:"Module"})),It=Object.keys(Rt);class At extends xt{constructor(e,t,n,r){let o=-1;if(super(e,t),zt(this,"space",r),"number"==typeof n)for(;++o<It.length;){const e=It[o];zt(this,It[o],(n&Rt[e])===Rt[e])}}}function zt(e,t,n){n&&(e[t]=n)}function jt(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new At(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[wt(r)]=r,n[wt(i.attribute)]=r}return new bt(t,n,e.space)}At.prototype.defined=!0;const Dt=jt({properties:{ariaActiveDescendant:null,ariaAtomic:Ct,ariaAutoComplete:null,ariaBusy:Ct,ariaChecked:Ct,ariaColCount:Nt,ariaColIndex:Nt,ariaColSpan:Nt,ariaControls:Ot,ariaCurrent:null,ariaDescribedBy:Ot,ariaDetails:null,ariaDisabled:Ct,ariaDropEffect:Ot,ariaErrorMessage:null,ariaExpanded:Ct,ariaFlowTo:Ot,ariaGrabbed:Ct,ariaHasPopup:null,ariaHidden:Ct,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ot,ariaLevel:Nt,ariaLive:null,ariaModal:Ct,ariaMultiLine:Ct,ariaMultiSelectable:Ct,ariaOrientation:null,ariaOwns:Ot,ariaPlaceholder:null,ariaPosInSet:Nt,ariaPressed:Ct,ariaReadOnly:Ct,ariaRelevant:null,ariaRequired:Ct,ariaRoleDescription:Ot,ariaRowCount:Nt,ariaRowIndex:Nt,ariaRowSpan:Nt,ariaSelected:Ct,ariaSetSize:Nt,ariaSort:null,ariaValueMax:Nt,ariaValueMin:Nt,ariaValueNow:Nt,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function Ft(e,t){return t in e?e[t]:t}function Mt(e,t){return Ft(e,t.toLowerCase())}const Ut=jt({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Pt,acceptCharset:Ot,accessKey:Ot,action:null,allow:null,allowFullScreen:Et,allowPaymentRequest:Et,allowUserMedia:Et,alt:null,as:null,async:Et,autoCapitalize:null,autoComplete:Ot,autoFocus:Et,autoPlay:Et,blocking:Ot,capture:null,charSet:null,checked:Et,cite:null,className:Ot,cols:Nt,colSpan:null,content:null,contentEditable:Ct,controls:Et,controlsList:Ot,coords:Nt|Pt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Et,defer:Et,dir:null,dirName:null,disabled:Et,download:Tt,draggable:Ct,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Et,formTarget:null,headers:Ot,height:Nt,hidden:Tt,high:Nt,href:null,hrefLang:null,htmlFor:Ot,httpEquiv:Ot,id:null,imageSizes:null,imageSrcSet:null,inert:Et,inputMode:null,integrity:null,is:null,isMap:Et,itemId:null,itemProp:Ot,itemRef:Ot,itemScope:Et,itemType:Ot,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Et,low:Nt,manifest:null,max:null,maxLength:Nt,media:null,method:null,min:null,minLength:Nt,multiple:Et,muted:Et,name:null,nonce:null,noModule:Et,noValidate:Et,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Et,optimum:Nt,pattern:null,ping:Ot,placeholder:null,playsInline:Et,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Et,referrerPolicy:null,rel:Ot,required:Et,reversed:Et,rows:Nt,rowSpan:Nt,sandbox:Ot,scope:null,scoped:Et,seamless:Et,selected:Et,shadowRootClonable:Et,shadowRootDelegatesFocus:Et,shadowRootMode:null,shape:null,size:Nt,sizes:null,slot:null,span:Nt,spellCheck:Ct,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Nt,step:null,style:null,tabIndex:Nt,target:null,title:null,translate:null,type:null,typeMustMatch:Et,useMap:null,value:Ct,width:Nt,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ot,axis:null,background:null,bgColor:null,border:Nt,borderColor:null,bottomMargin:Nt,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Et,declare:Et,event:null,face:null,frame:null,frameBorder:null,hSpace:Nt,leftMargin:Nt,link:null,longDesc:null,lowSrc:null,marginHeight:Nt,marginWidth:Nt,noResize:Et,noHref:Et,noShade:Et,noWrap:Et,object:null,profile:null,prompt:null,rev:null,rightMargin:Nt,rules:null,scheme:null,scrolling:Ct,standby:null,summary:null,text:null,topMargin:Nt,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Nt,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Et,disableRemotePlayback:Et,prefix:null,property:null,results:Nt,security:null,unselectable:null},space:"html",transform:Mt}),Bt=jt({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Lt,accentHeight:Nt,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Nt,amplitude:Nt,arabicForm:null,ascent:Nt,attributeName:null,attributeType:null,azimuth:Nt,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Nt,by:null,calcMode:null,capHeight:Nt,className:Ot,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Nt,diffuseConstant:Nt,direction:null,display:null,dur:null,divisor:Nt,dominantBaseline:null,download:Et,dx:null,dy:null,edgeMode:null,editable:null,elevation:Nt,enableBackground:null,end:null,event:null,exponent:Nt,externalResourcesRequired:null,fill:null,fillOpacity:Nt,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Pt,g2:Pt,glyphName:Pt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Nt,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Nt,horizOriginX:Nt,horizOriginY:Nt,id:null,ideographic:Nt,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Nt,k:Nt,k1:Nt,k2:Nt,k3:Nt,k4:Nt,kernelMatrix:Lt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Nt,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Nt,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Nt,overlineThickness:Nt,paintOrder:null,panose1:null,path:null,pathLength:Nt,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ot,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Nt,pointsAtY:Nt,pointsAtZ:Nt,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Lt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Lt,rev:Lt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Lt,requiredFeatures:Lt,requiredFonts:Lt,requiredFormats:Lt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Nt,specularExponent:Nt,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Nt,strikethroughThickness:Nt,string:null,stroke:null,strokeDashArray:Lt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Nt,strokeOpacity:Nt,strokeWidth:null,style:null,surfaceScale:Nt,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Lt,tabIndex:Nt,tableValues:null,target:null,targetX:Nt,targetY:Nt,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Lt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Nt,underlineThickness:Nt,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Nt,values:null,vAlphabetic:Nt,vMathematical:Nt,vectorEffect:null,vHanging:Nt,vIdeographic:Nt,version:null,vertAdvY:Nt,vertOriginX:Nt,vertOriginY:Nt,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Nt,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ft}),$t=jt({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),Vt=jt({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Mt}),Ht=jt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),qt={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Wt=/[A-Z]/g,Kt=/-[a-z]/g,Qt=/^data[-\w.:]+$/i;function Jt(e){return"-"+e.toLowerCase()}function Yt(e){return e.charAt(1).toUpperCase()}const Gt=kt([Dt,Ut,$t,Vt,Ht],"html"),Xt=kt([Dt,Bt,$t,Vt,Ht],"svg");var Zt,en,tn,nn={};function rn(){if(tn)return nn;tn=1;var e=nn&&nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nn,"__esModule",{value:!0}),nn.default=function(e,n){let r=null;if(!e||"string"!=typeof e)return r;const o=(0,t.default)(e),i="function"==typeof n;return o.forEach(e=>{if("declaration"!==e.type)return;const{property:t,value:o}=e;i?n(t,o,e):o&&(r=r||{},r[t]=o)}),r};const t=e(function(){if(en)return Zt;en=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l="";function u(e){return e?e.replace(s,l):l}return Zt=function(s,c){if("string"!=typeof s)throw new TypeError("First argument must be a string");if(!s)return[];c=c||{};var d=1,f=1;function p(e){var n=e.match(t);n&&(d+=n.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function h(){var e={line:d,column:f};return function(t){return t.position=new g(e),v(),t}}function g(e){this.start=e,this.end={line:d,column:f},this.source=c.source}function m(e){var t=new Error(c.source+":"+d+":"+f+": "+e);if(t.reason=e,t.filename=c.source,t.line=d,t.column=f,t.source=s,!c.silent)throw t}function y(e){var t=e.exec(s);if(t){var n=t[0];return p(n),s=s.slice(n.length),t}}function v(){y(n)}function b(e){var t;for(e=e||[];t=k();)!1!==t&&e.push(t);return e}function k(){var e=h();if("/"==s.charAt(0)&&"*"==s.charAt(1)){for(var t=2;l!=s.charAt(t)&&("*"!=s.charAt(t)||"/"!=s.charAt(t+1));)++t;if(t+=2,l===s.charAt(t-1))return m("End of comment missing");var n=s.slice(2,t-2);return f+=2,p(n),s=s.slice(t),f+=2,e({type:"comment",comment:n})}}function w(){var t=h(),n=y(r);if(n){if(k(),!y(o))return m("property missing ':'");var s=y(i),c=t({type:"declaration",property:u(n[0].replace(e,l)),value:s?u(s[0].replace(e,l)):l});return y(a),c}}return g.prototype.content=s,v(),function(){var e,t=[];for(b(t);e=w();)!1!==e&&(t.push(e),b(t));return t}()}}());return nn}var on,an,sn,ln={};function un(){if(on)return ln;on=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(e,t){return t.toUpperCase()},a=function(e,t){return"".concat(t,"-")};return ln.camelCase=function(s,l){return void 0===l&&(l={}),function(t){return!t||n.test(t)||e.test(t)}(s)?s:(s=s.toLowerCase(),(s=l.reactCompat?s.replace(o,a):s.replace(r,a)).replace(t,i))},ln}const cn=t(function(){if(sn)return an;sn=1;var e=(an&&an.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(rn()),t=un();function n(n,r){var o={};return n&&"string"==typeof n?((0,e.default)(n,function(e,n){e&&n&&(o[(0,t.camelCase)(e,r)]=n)}),o):o}return n.default=n,an=n}()),dn=pn("end"),fn=pn("start");function pn(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function hn(e){return e&&"object"==typeof e?"position"in e||"type"in e?mn(e.position):"start"in e||"end"in e?mn(e):"line"in e||"column"in e?gn(e):"":""}function gn(e){return yn(e&&e.line)+":"+yn(e&&e.column)}function mn(e){return gn(e&&e.start)+"-"+gn(e&&e.end)}function yn(e){return e&&"number"==typeof e?e:1}class vn extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},i=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(i=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=hn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vn.prototype.file="",vn.prototype.name="",vn.prototype.reason="",vn.prototype.message="",vn.prototype.stack="",vn.prototype.column=void 0,vn.prototype.line=void 0,vn.prototype.ancestors=void 0,vn.prototype.cause=void 0,vn.prototype.fatal=void 0,vn.prototype.place=void 0,vn.prototype.ruleId=void 0,vn.prototype.source=void 0;const bn={}.hasOwnProperty,kn=new Map,wn=/[A-Z]/g,xn=new Set(["table","tbody","thead","tfoot","tr"]),Sn=new Set(["td","th"]),En="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Cn(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,i){const a=Array.isArray(o.children),s=fn(n);return t(r,o,i,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,i){const a=Array.isArray(o.children)?n:t;return i?a(r,o,i):a(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?Xt:Gt,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},i=Tn(o,e,void 0);return i&&"string"!=typeof i?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Tn(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=Xt,e.schema=o);e.ancestors.push(t);const i=_n(e,t.tagName,!1),a=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&bn.call(t.properties,o)){const i=Ln(e,o,t.properties[o]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof a&&Sn.has(t.tagName)?r=a:n[o]=a}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=Pn(e,t);xn.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&vt(t.value):vt(t));var t}));return Nn(e,a,i,t),On(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Rn(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=Xt,e.schema=o);e.ancestors.push(t);const i=null===t.name?e.Fragment:_n(e,t.name,!0),a=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];dt(t.type);const o=t.expression;dt(o.type);const i=o.properties[0];dt(i.type),Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else Rn(e,t.position);else{const o=r.name;let i;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];dt(t.type),i=e.evaluater.evaluateExpression(t.expression)}else Rn(e,t.position);else i=null===r.value||r.value;n[o]=i}return n}(e,t),s=Pn(e,t);return Nn(e,a,i,t),On(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rn(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return On(r,Pn(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Nn(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function On(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Pn(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:kn;for(;++r<t.children.length;){const i=t.children[r];let a;if(e.passKeys){const e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){const t=o.get(e)||0;a=e+"-"+t,o.set(e,t+1)}}const s=Tn(e,i,a);void 0!==s&&n.push(s)}return n}function Ln(e,t,n){const r=function(e,t){const n=wt(t);let r=t,o=xt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Qt.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(Kt,Yt);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!Kt.test(e)){let n=e.replace(Wt,Jt);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=At}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return cn(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const t=n,r=new vn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:t,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=En+"#cannot-parse-style-attribute",r}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)bn.call(e,n)&&(t[In(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?qt[r.property]||r.property:r.attribute,n]}}function _n(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=mt(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(o&&"Literal"===t.type),optional:!1}:t}r=n}else r=mt(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return bn.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rn(e)}function Rn(e,t){const n=new vn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=En+"#cannot-handle-mdx-estrees-without-createevaluater",n}function In(e){let t=e.replace(wn,An);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function An(e){return"-"+e.toLowerCase()}const zn={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},jn={};function Dn(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Fn(e.children,t,n)}return Array.isArray(e)?Fn(e,t,n):""}function Fn(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Dn(e[o],t,n);return r.join("")}const Mn=document.createElement("i");function Un(e){const t="&"+e+";";Mn.innerHTML=t;const n=Mn.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}function Bn(e,t,n,r){const o=e.length;let i,a=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<r.length;)i=r.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function $n(e,t){return e.length>0?(Bn(e,e.length,0,t),e):t}const Vn={}.hasOwnProperty;function Hn(e,t){let n;for(n in t){const r=(Vn.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){Vn.call(r,i)||(r[i]=[]);const e=o[i];qn(r[i],Array.isArray(e)?e:e?[e]:[])}}}function qn(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);Bn(e,0,0,r)}function Wn(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function Kn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Qn=ar(/[A-Za-z]/),Jn=ar(/[\dA-Za-z]/),Yn=ar(/[#-'*+\--9=?A-Z^-~]/);function Gn(e){return null!==e&&(e<32||127===e)}const Xn=ar(/\d/),Zn=ar(/[\dA-Fa-f]/),er=ar(/[!-/:-@[-`{-~]/);function tr(e){return null!==e&&e<-2}function nr(e){return null!==e&&(e<0||32===e)}function rr(e){return-2===e||-1===e||32===e}const or=ar(new RegExp("\\p{P}|\\p{S}","u")),ir=ar(/\s/);function ar(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function sr(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(37===i&&Jn(e.charCodeAt(n+1))&&Jn(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(a=String.fromCharCode(i,t),o=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function lr(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){if(rr(r))return e.enter(n),a(r);return t(r)};function a(r){return rr(r)&&i++<o?(e.consume(r),a):(e.exit(n),t(r))}}const ur={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),lr(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):tr(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const cr={tokenize:function(e){const t=this,n=[];let r,o,i,a=0;return s;function s(r){if(a<n.length){const o=n[a];return t.containerState=o[1],e.attempt(o[0].continuation,l,u)(r)}return u(r)}function l(e){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}y(a);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Bn(t.events,i+1,0,t.events.slice(n)),t.events.length=s,u(e)}return s(e)}function u(o){if(a===n.length){if(!r)return f(o);if(r.currentConstruct&&r.currentConstruct.concrete)return h(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dr,c,d)(o)}function c(e){return r&&v(),y(a),f(e)}function d(e){return t.parser.lazy[t.now().line]=a!==n.length,i=t.now().offset,h(e)}function f(n){return t.containerState={},e.attempt(dr,p,h)(n)}function p(e){return a++,n.push([t.currentConstruct,t.containerState]),f(e)}function h(n){return null===n?(r&&v(),y(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),g(n))}function g(n){return null===n?(m(e.exit("chunkFlow"),!0),y(0),void e.consume(n)):tr(n)?(e.consume(n),m(e.exit("chunkFlow")),a=0,t.interrupt=void 0,s):(e.consume(n),g)}function m(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){s=t.events[l][1].end;break}o=!0}for(y(a),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;Bn(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function y(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},dr={tokenize:function(e,t,n){return lr(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function fr(e){return null===e||nr(e)||ir(e)?1:or(e)?2:void 0}function pr(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const hr={name:"attention",resolveAll:function(e,t){let n,r,o,i,a,s,l,u,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close)for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;const d={...e[n][1].end},f={...e[c][1].start};gr(d,-s),gr(f,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:f},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[c][1].start={...a.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=$n(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=$n(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=$n(l,pr(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),l=$n(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(u=2,l=$n(l,[["enter",e[c][1],t],["exit",e[c][1],t]])):u=0,Bn(e,n-1,c-n+3,l),c=n+l.length-u-2;break}c=-1;for(;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=fr(r);let i;return function(t){return i=t,e.enter("attentionSequence"),a(t)};function a(s){if(s===i)return e.consume(s),a;const l=e.exit("attentionSequence"),u=fr(s),c=!u||2===u&&o||n.includes(s),d=!o||2===o&&u||n.includes(r);return l._open=Boolean(42===i?c:c&&(o||!d)),l._close=Boolean(42===i?d:d&&(u||!c)),t(s)}}};function gr(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const mr={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return Qn(t)?(e.consume(t),i):64===t?n(t):l(t)}function i(e){return 43===e||45===e||46===e||Jn(e)?(r=1,a(e)):l(e)}function a(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||Jn(t))&&r++<32?(e.consume(t),a):(r=0,l(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||Gn(r)?n(r):(e.consume(r),s)}function l(t){return 64===t?(e.consume(t),u):Yn(t)?(e.consume(t),l):n(t)}function u(e){return Jn(e)?c(e):n(e)}function c(n){return 46===n?(e.consume(n),r=0,u):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||Jn(t))&&r++<63){const n=45===t?d:c;return e.consume(t),n}return n(t)}}};const yr={partial:!0,tokenize:function(e,t,n){return function(t){return rr(t)?lr(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||tr(e)?t(e):n(e)}}};const vr={continuation:{tokenize:function(e,t,n){const r=this;return function(t){if(rr(t))return lr(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return o(t)};function o(r){return e.attempt(vr,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return rr(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const br={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return er(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const kr={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,i,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,i=Jn,u(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=Zn,u):(e.enter("characterReferenceValue"),o=7,i=Xn,u(t))}function u(s){if(59===s&&a){const o=e.exit("characterReferenceValue");return i!==Jn||Un(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&a++<o?(e.consume(s),u):n(s)}}};const wr={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},xr={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return a;function a(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l}function l(t){return e.enter("codeFencedFence"),rr(t)?lr(e,u,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):u(t)}function u(t){return t===i?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===i?(o++,e.consume(t),c):o>=s?(e.exit("codeFencedFenceSequence"),rr(t)?lr(e,d,"whitespace")(t):d(t)):n(t)}function d(r){return null===r||tr(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let i,a=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===i?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),rr(t)?lr(e,u,"whitespace")(t):u(t))}function u(n){return null===n||tr(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(wr,p,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),c(n))}function c(t){return null===t||tr(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(t)):rr(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),lr(e,d,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),c)}function d(t){return null===t||tr(t)?u(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(t))}function f(t){return null===t||tr(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(t)):96===t&&t===i?n(t):(e.consume(t),f)}function p(t){return e.attempt(o,v,h)(t)}function h(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),g}function g(t){return a>0&&rr(t)?lr(e,m,"linePrefix",a+1)(t):m(t)}function m(t){return null===t||tr(t)?e.check(wr,p,v)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||tr(t)?(e.exit("codeFlowValue"),m(t)):(e.consume(t),y)}function v(n){return e.exit("codeFenced"),t(n)}}};const Sr={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),lr(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?s(t):tr(t)?e.attempt(Er,i,s)(t):(e.enter("codeFlowValue"),a(t))}function a(t){return null===t||tr(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),a)}function s(n){return e.exit("codeIndented"),t(n)}}},Er={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):tr(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):lr(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):tr(e)?o(e):n(e)}}};const Cr={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}t=o-1,r++;for(;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),a(t)};function a(t){return 96===t?(e.consume(t),i++,a):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(o=e.enter("codeTextSequence"),r=0,u(t)):tr(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||tr(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),l)}function u(n){return 96===n?(e.consume(n),r++,u):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",l(n))}}};class Tr{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Nr(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Nr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Nr(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);Nr(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Nr(this.left,t.reverse())}}}function Nr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Or(e){const t={};let n,r,o,i,a,s,l,u=-1;const c=new Tr(e);for(;++u<c.length;){for(;u in t;)u=t[u];if(n=c.get(u),u&&"chunkFlow"===n[1].type&&"listItemPrefix"===c.get(u-1)[1].type&&(s=n[1]._tokenizer.events,o=0,o<s.length&&"lineEndingBlank"===s[o][1].type&&(o+=2),o<s.length&&"content"===s[o][1].type))for(;++o<s.length&&"content"!==s[o][1].type;)"chunkText"===s[o][1].type&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Pr(c,u)),u=t[u],l=!0);else if(n[1]._container){for(o=u,r=void 0;o--;)if(i=c.get(o),"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(r&&(c.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if("linePrefix"!==i[1].type&&"listItemIndent"!==i[1].type)break;r&&(n[1].end={...c.get(r)[1].start},a=c.slice(r,u),a.unshift(n),c.splice(r,u-r+1,a))}}return Bn(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function Pr(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],u={};let c,d,f=-1,p=n,h=0,g=0;const m=[g];for(;p;){for(;e.get(++o)[1]!==p;);i.push(o),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),d&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(c),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)"exit"===s[f][0]&&"enter"===s[f-1][0]&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(g=f+1,m.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):m.pop(),f=m.length;f--;){const t=s.slice(m[f],m[f+1]),n=i.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),f=-1;++f<l.length;)u[h+l[f][0]]=h+l[f][1],h+=l[f][1]-l[f][0]-1;return u}const Lr={resolve:function(e){return Or(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):tr(t)?e.check(_r,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},_r={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),lr(e,o,"linePrefix")};function o(o){if(null===o||tr(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function Rr(e,t,n,r,o,i,a,s,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return function(t){if(60===t)return e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),d;if(null===t||32===t||41===t||Gn(t))return n(t);return e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(t)};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),f(n))}function f(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||tr(t)?n(t):(e.consume(t),92===t?p:f)}function p(t){return 60===t||62===t||92===t?(e.consume(t),f):f(t)}function h(o){return c||null!==o&&41!==o&&!nr(o)?c<u&&40===o?(e.consume(o),c++,h):41===o?(e.consume(o),c--,h):null===o||32===o||40===o||Gn(o)?n(o):(e.consume(o),92===o?g:h):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o))}function g(t){return 40===t||41===t||92===t?(e.consume(t),h):h(t)}}function Ir(e,t,n,r,o,i){const a=this;let s,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),u};function u(d){return l>999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):tr(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(t){return null===t||91===t||93===t||tr(t)||l++>999?(e.exit("chunkString"),u(t)):(e.consume(t),s||(s=!rr(t)),92===t?d:c)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}}function Ar(e,t,n,r,o,i){let a;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(o),e.consume(t),e.exit(o),a=40===t?41:t,s;return n(t)};function s(n){return n===a?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===a?(e.exit(i),s(a)):null===t?n(t):tr(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),lr(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===a||null===t||tr(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?c:u)}function c(t){return t===a||92===t?(e.consume(t),u):u(t)}}function zr(e,t){let n;return function r(o){if(tr(o))return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r;if(rr(o))return lr(e,r,n?"linePrefix":"lineSuffix")(o);return t(o)}}const jr={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return Ir.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=Kn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return nr(t)?zr(e,s)(t):s(t)}function s(t){return Rr(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(Dr,u,u)(t)}function u(t){return rr(t)?lr(e,c,"whitespace")(t):c(t)}function c(i){return null===i||tr(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}},Dr={partial:!0,tokenize:function(e,t,n){return function(t){return nr(t)?zr(e,r)(t):n(t)};function r(t){return Ar(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return rr(t)?lr(e,i,"whitespace")(t):i(t)}function i(e){return null===e||tr(e)?t(e):n(e)}}};const Fr={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return tr(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const Mr={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,i=3;"whitespace"===e[i][1].type&&(i+=2);o-2>i&&"whitespace"===e[o][1].type&&(o-=2);"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4);o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},Bn(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||nr(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||tr(n)?(e.exit("atxHeading"),t(n)):rr(n)?lr(e,i,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),i(t))}function s(t){return null===t||35===t||nr(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),s)}}};const Ur=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Br=["pre","script","style","textarea"],$r={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},tokenize:function(e,t,n){const r=this;let o,i,a,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),u}(t)};function u(s){return 33===s?(e.consume(s),c):47===s?(e.consume(s),i=!0,p):63===s?(e.consume(s),o=3,r.interrupt?t:A):Qn(s)?(e.consume(s),a=String.fromCharCode(s),h):n(s)}function c(i){return 45===i?(e.consume(i),o=2,d):91===i?(e.consume(i),o=5,s=0,f):Qn(i)?(e.consume(i),o=4,r.interrupt?t:A):n(i)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:A):n(o)}function f(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:T:f):n(o)}function p(t){return Qn(t)?(e.consume(t),a=String.fromCharCode(t),h):n(t)}function h(s){if(null===s||47===s||62===s||nr(s)){const l=47===s,u=a.toLowerCase();return l||i||!Br.includes(u)?Ur.includes(a.toLowerCase())?(o=6,l?(e.consume(s),g):r.interrupt?t(s):T(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?m(s):y(s)):(o=1,r.interrupt?t(s):T(s))}return 45===s||Jn(s)?(e.consume(s),a+=String.fromCharCode(s),h):n(s)}function g(o){return 62===o?(e.consume(o),r.interrupt?t:T):n(o)}function m(t){return rr(t)?(e.consume(t),m):E(t)}function y(t){return 47===t?(e.consume(t),E):58===t||95===t||Qn(t)?(e.consume(t),v):rr(t)?(e.consume(t),y):E(t)}function v(t){return 45===t||46===t||58===t||95===t||Jn(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),k):rr(t)?(e.consume(t),b):y(t)}function k(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,w):rr(t)?(e.consume(t),k):x(t)}function w(t){return t===l?(e.consume(t),l=null,S):null===t||tr(t)?n(t):(e.consume(t),w)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||nr(t)?b(t):(e.consume(t),x)}function S(e){return 47===e||62===e||rr(e)?y(e):n(e)}function E(t){return 62===t?(e.consume(t),C):n(t)}function C(t){return null===t||tr(t)?T(t):rr(t)?(e.consume(t),C):n(t)}function T(t){return 45===t&&2===o?(e.consume(t),L):60===t&&1===o?(e.consume(t),_):62===t&&4===o?(e.consume(t),z):63===t&&3===o?(e.consume(t),A):93===t&&5===o?(e.consume(t),I):!tr(t)||6!==o&&7!==o?null===t||tr(t)?(e.exit("htmlFlowData"),N(t)):(e.consume(t),T):(e.exit("htmlFlowData"),e.check(Vr,j,N)(t))}function N(t){return e.check(Hr,O,j)(t)}function O(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),P}function P(t){return null===t||tr(t)?N(t):(e.enter("htmlFlowData"),T(t))}function L(t){return 45===t?(e.consume(t),A):T(t)}function _(t){return 47===t?(e.consume(t),a="",R):T(t)}function R(t){if(62===t){const n=a.toLowerCase();return Br.includes(n)?(e.consume(t),z):T(t)}return Qn(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),R):T(t)}function I(t){return 93===t?(e.consume(t),A):T(t)}function A(t){return 62===t?(e.consume(t),z):45===t&&2===o?(e.consume(t),A):T(t)}function z(t){return null===t||tr(t)?(e.exit("htmlFlowData"),j(t)):(e.consume(t),z)}function j(n){return e.exit("htmlFlow"),t(n)}}},Vr={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(yr,t,n)}}},Hr={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(tr(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o;return n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const qr={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,i,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),k):63===t?(e.consume(t),v):Qn(t)?(e.consume(t),S):n(t)}function l(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),i=0,p):Qn(t)?(e.consume(t),y):n(t)}function u(t){return 45===t?(e.consume(t),f):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),d):tr(t)?(a=c,R(t)):(e.consume(t),c)}function d(t){return 45===t?(e.consume(t),f):c(t)}function f(e){return 62===e?_(e):45===e?d(e):c(e)}function p(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?h:p):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),g):tr(t)?(a=h,R(t)):(e.consume(t),h)}function g(t){return 93===t?(e.consume(t),m):h(t)}function m(t){return 62===t?_(t):93===t?(e.consume(t),m):h(t)}function y(t){return null===t||62===t?_(t):tr(t)?(a=y,R(t)):(e.consume(t),y)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):tr(t)?(a=v,R(t)):(e.consume(t),v)}function b(e){return 62===e?_(e):v(e)}function k(t){return Qn(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||Jn(t)?(e.consume(t),w):x(t)}function x(t){return tr(t)?(a=x,R(t)):rr(t)?(e.consume(t),x):_(t)}function S(t){return 45===t||Jn(t)?(e.consume(t),S):47===t||62===t||nr(t)?E(t):n(t)}function E(t){return 47===t?(e.consume(t),_):58===t||95===t||Qn(t)?(e.consume(t),C):tr(t)?(a=E,R(t)):rr(t)?(e.consume(t),E):_(t)}function C(t){return 45===t||46===t||58===t||95===t||Jn(t)?(e.consume(t),C):T(t)}function T(t){return 61===t?(e.consume(t),N):tr(t)?(a=T,R(t)):rr(t)?(e.consume(t),T):E(t)}function N(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,O):tr(t)?(a=N,R(t)):rr(t)?(e.consume(t),N):(e.consume(t),P)}function O(t){return t===o?(e.consume(t),o=void 0,L):null===t?n(t):tr(t)?(a=O,R(t)):(e.consume(t),O)}function P(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||nr(t)?E(t):(e.consume(t),P)}function L(e){return 47===e||62===e||nr(e)?E(e):n(e)}function _(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function R(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),I}function I(t){return rr(t)?lr(e,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):A(t)}function A(t){return e.enter("htmlTextData"),a(t)}}};const Wr={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}e.length!==n.length&&Bn(e,0,e.length,n);return e},resolveTo:function(e,t){let n,r,o,i,a=e.length,s=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(o=a);const l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",l,t],["enter",u,t]],i=$n(i,e.slice(r+1,r+s+3)),i=$n(i,[["enter",c,t]]),i=$n(i,pr(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=$n(i,[["exit",c,t],e[o-2],e[o-1],["exit",u,t]]),i=$n(i,e.slice(o+1)),i=$n(i,[["exit",l,t]]),Bn(e,r,e.length,i),e},tokenize:function(e,t,n){const r=this;let o,i,a=r.events.length;for(;a--;)if(("labelImage"===r.events[a][1].type||"labelLink"===r.events[a][1].type)&&!r.events[a][1]._balanced){o=r.events[a][1];break}return function(t){if(!o)return n(t);if(o._inactive)return c(t);return i=r.parser.defined.includes(Kn(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s};function s(t){return 40===t?e.attempt(Kr,u,i?u:c)(t):91===t?e.attempt(Qr,u,i?l:c)(t):i?u(t):c(t)}function l(t){return e.attempt(Jr,u,c)(t)}function u(e){return t(e)}function c(e){return o._balanced=!0,n(e)}}},Kr={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return nr(t)?zr(e,o)(t):o(t)}function o(t){return 41===t?u(t):Rr(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return nr(t)?zr(e,s)(t):u(t)}function a(e){return n(e)}function s(t){return 34===t||39===t||40===t?Ar(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):u(t)}function l(t){return nr(t)?zr(e,u)(t):u(t)}function u(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},Qr={tokenize:function(e,t,n){const r=this;return function(t){return Ir.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(Kn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},Jr={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const Yr={name:"labelStartImage",resolveAll:Wr.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const Gr={name:"labelStartLink",resolveAll:Wr.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const Xr={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),lr(e,t,"linePrefix")}}};const Zr={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),a(i)):o>=3&&(null===i||tr(i))?(e.exit("thematicBreak"),t(i)):n(i)}function a(t){return t===r?(e.consume(t),o++,a):(e.exit("thematicBreakSequence"),rr(t)?lr(e,i,"whitespace")(t):i(t))}}};const eo={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yr,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,lr(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){if(r.containerState.furtherBlankLines||!rr(n))return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n);return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(no,t,o)(n)});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,lr(e,e.attempt(eo,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,a=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:Xn(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(Zr,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return Xn(t)&&++a<10?(e.consume(t),s):(!r.interrupt||a<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(yr,r.interrupt?n:u,e.attempt(to,d,c))}function u(e){return r.containerState.initialBlankLine=!0,i++,d(e)}function c(t){return rr(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},to={partial:!0,tokenize:function(e,t,n){const r=this;return lr(e,function(e){const o=r.events[r.events.length-1];return!rr(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},no={partial:!0,tokenize:function(e,t,n){const r=this;return lr(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const ro={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);const a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",a,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=a;return e.push(["exit",a,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let a,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){a="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||a))return e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t);return n(t)};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),rr(t)?lr(e,a,"lineSuffix")(t):a(t))}function a(r){return null===r||tr(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const oo={tokenize:function(e){const t=this,n=e.attempt(yr,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,lr(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Lr,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const io={resolveAll:uo()},ao=lo("string"),so=lo("text");function lo(e){return{resolveAll:uo("text"===e?co:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,a);return i;function i(e){return l(e)?o(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function uo(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function co(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,a=o.length,s=-1,l=0;for(;a--;){const e=o[a];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)l++,s--;if(s)break;s=-1}else if(-2===e)i=!0,l++;else if(-1!==e){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const o={type:n===e.length||i||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const fo={42:eo,43:eo,45:eo,48:eo,49:eo,50:eo,51:eo,52:eo,53:eo,54:eo,55:eo,56:eo,57:eo,62:vr},po={91:jr},ho={[-2]:Sr,[-1]:Sr,32:Sr},go={35:Mr,42:Zr,45:[ro,Zr],60:$r,61:ro,95:Zr,96:xr,126:xr},mo={38:kr,92:br},yo={[-5]:Xr,[-4]:Xr,[-3]:Xr,33:Yr,38:kr,42:hr,60:[mr,qr],91:Gr,92:[Fr,br],93:Wr,95:hr,96:Cr},vo={null:[hr,io]},bo=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:po,disable:{null:[]},document:fo,flow:go,flowInitial:ho,insideSpan:vo,string:mo,text:yo},Symbol.toStringTag,{value:"Module"}));function ko(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let a=[],s=[];const l={attempt:m(function(e,t){y(e,t.from)}),check:m(g),consume:function(e){tr(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,v()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++));u.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=f(),u.events.push(["enter",n,u]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=f(),u.events.push(["exit",t,u]),t},interrupt:m(g,{interrupt:!0})},u={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,v()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if("string"==typeof i)a=i;else switch(i){case-5:a="\r";break;case-4:a="\n";break;case-3:a="\r\n";break;case-2:a=t?" ":"\t";break;case-1:if(!t&&o)continue;a=" ";break;default:a=String.fromCharCode(i)}o=-2===i,r.push(a)}return r.join("")}(d(e),t)},sliceStream:d,write:function(e){if(a=$n(a,e),p(),null!==a[a.length-1])return[];return y(t,0),u.events=pr(i,u.events,u),u.events}};let c=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function d(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const e=a[0];"string"==typeof e?a[0]=e.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}(a,e)}function f(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function p(){let e;for(;r._index<a.length;){const t=a[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)h(t.charCodeAt(r._bufferIndex));else h(t)}}function h(e){c=c(e)}function g(e,t){t.restore()}function m(e,t){return function(n,o,i){let a,c,d,p;return Array.isArray(n)?h(n):"tokenize"in n?h([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return h([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function h(e){return a=e,c=0,0===e.length?i:g(e[c])}function g(e){return function(n){p=function(){const e=f(),t=u.previous,n=u.currentConstruct,o=u.events.length,i=Array.from(s);return{from:o,restore:a};function a(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=o,s=i,v()}}(),d=e,e.partial||(u.currentConstruct=e);if(e.name&&u.parser.constructs.disable.null.includes(e.name))return y();return e.tokenize.call(t?Object.assign(Object.create(u),t):u,l,m,y)(n)}}function m(t){return e(d,p),o}function y(e){return p.restore(),++c<a.length?g(a[c]):i}}}function y(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&Bn(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function v(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function wo(e){const t={constructs:function(e){const t={};let n=-1;for(;++n<e.length;)Hn(t,e[n]);return t}([bo,...(e||{}).extensions||[]]),content:n(ur),defined:[],document:n(cr),flow:n(oo),lazy:{},string:n(ao),text:n(so)};return t;function n(e){return function(n){return ko(t,e,n)}}}const xo=/[\0\t\n\r]/g;const So=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Eo(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return Wn(n.slice(t?2:1),t?16:10)}return Un(n)||e}const Co={}.hasOwnProperty;function To(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(te),autolinkProtocol:C,autolinkEmail:C,atxHeading:i(G),blockQuote:i(W),characterEscape:C,characterReference:C,codeFenced:i(K),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(K,a),codeText:i(Q,a),codeTextData:C,data:C,codeFlowValue:C,definition:i(J),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(Y),hardBreakEscape:i(X),hardBreakTrailing:i(X),htmlFlow:i(Z,a),htmlFlowData:C,htmlText:i(Z,a),htmlTextData:C,image:i(ee),label:a,link:i(te),listItem:i(re),listItemValue:f,listOrdered:i(ne,d),listUnordered:i(ne),paragraph:i(oe),reference:M,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(G),strong:i(ie),thematicBreak:i(se)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:q,autolinkProtocol:H,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:B,characterReferenceMarkerNumeric:B,characterReferenceValue:$,characterReference:V,codeFenced:l(m),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:h,codeFlowValue:T,codeIndented:l(y),codeText:l(_),codeTextData:T,data:T,definition:l(),definitionDestinationString:k,definitionLabelString:v,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(O),hardBreakTrailing:l(O),htmlFlow:l(P),htmlFlowData:T,htmlText:l(L),htmlTextData:T,image:l(I),label:z,labelText:A,lineEnding:N,link:l(R),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:U,resourceDestinationString:j,resourceTitleString:D,resource:F,setextHeading:l(E),setextHeadingLineSequence:S,setextHeadingText:x,strong:l(),thematicBreak:l()}};Oo(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const i={stack:[r],tokenStack:[],config:t,enter:s,exit:u,buffer:a,resume:c,data:n},l=[];let d=-1;for(;++d<e.length;)if("listOrdered"===e[d][1].type||"listUnordered"===e[d][1].type)if("enter"===e[d][0])l.push(d);else{d=o(e,l.pop(),d)}for(d=-1;++d<e.length;){const n=t[e[d][0]];Co.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},i),e[d][1])}if(i.tokenStack.length>0){const e=i.tokenStack[i.tokenStack.length-1];(e[1]||Lo).call(i,void 0,e[0])}for(r.position={start:No(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:No(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function o(e,t,n){let r,o,i,a,s=t-1,l=-1,u=!1;for(;++s<=n;){const t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||l||i||(i=s),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=s;for(o=void 0;a--;){const t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",u=!0),t[1].type="lineEnding",o=a}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(s,0,["enter",o,t[2]]),s++,n++,i=void 0,a=!0}}}return e[t][1]._spread=u,n}function i(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:No(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+hn({start:e.start,end:e.end})+"): it’s not open");if(r[0].type!==e.type)if(t)t.call(this,e,r[0]);else{(r[1]||Lo).call(this,e,r[0])}n.position.end=No(e.end)}function c(){return function(e){return Dn(e,"boolean"!=typeof jn.includeImageAlt||jn.includeImageAlt,"boolean"!=typeof jn.includeHtml||jn.includeHtml)}(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function h(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function m(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function v(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Kn(this.sliceSerialize(e)).toLowerCase()}function b(){const e=this.resume();this.stack[this.stack.length-1].title=e}function k(){const e=this.resume();this.stack[this.stack.length-1].url=e}function w(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function S(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function C(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n=ae(),n.position={start:No(e.start),end:void 0},t.push(n)),this.stack.push(n)}function T(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=No(e.end)}function N(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=No(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(C.call(this,e),T.call(this,e))}function O(){this.data.atHardBreak=!0}function P(){const e=this.resume();this.stack[this.stack.length-1].value=e}function L(){const e=this.resume();this.stack[this.stack.length-1].value=e}function _(){const e=this.resume();this.stack[this.stack.length-1].value=e}function R(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function I(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function A(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(So,Eo)}(t),n.identifier=Kn(t).toLowerCase()}function z(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function j(){const e=this.resume();this.stack[this.stack.length-1].url=e}function D(){const e=this.resume();this.stack[this.stack.length-1].title=e}function F(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function U(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Kn(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function B(e){this.data.characterReferenceType=e.type}function $(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;if(n)r=Wn(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0;else{r=Un(t)}this.stack[this.stack.length-1].value+=r}function V(e){this.stack.pop().position.end=No(e.end)}function H(e){T.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function q(e){T.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function W(){return{type:"blockquote",children:[]}}function K(){return{type:"code",lang:null,meta:null,value:""}}function Q(){return{type:"inlineCode",value:""}}function J(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Y(){return{type:"emphasis",children:[]}}function G(){return{type:"heading",depth:0,children:[]}}function X(){return{type:"break"}}function Z(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function ae(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}(n)(function(e){for(;!Or(e););return e}(wo(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,i,a){const s=[];let l,u,c,d,f;for(o=n+("string"==typeof o?o.toString():new TextDecoder(i||void 0).decode(o)),c=0,n="",r&&(65279===o.charCodeAt(0)&&c++,r=void 0);c<o.length;){if(xo.lastIndex=c,l=xo.exec(o),d=l&&void 0!==l.index?l.index:o.length,f=o.charCodeAt(d),!l){n=o.slice(c);break}if(10===f&&c===d&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),c<d&&(s.push(o.slice(c,d)),t+=d-c),f){case 0:s.push(65533),t++;break;case 9:for(u=4*Math.ceil(t/4),s.push(-2);t++<u;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}c=d+1}return a&&(e&&s.push(-5),n&&s.push(n),s.push(null)),s}}()(e,t,!0))))}function No(e){return{line:e.line,column:e.column,offset:e.offset}}function Oo(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Oo(e,r):Po(e,r)}}function Po(e,t){let n;for(n in t)if(Co.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Lo(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+hn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+hn({start:t.start,end:t.end})+") is still open")}function _o(e){const t=this;t.parser=function(n){return To(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Ro(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&"text"===i.type?i.value="["+i.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&"text"===a.type?a.value+=r:o.push({type:"text",value:r}),o}function Io(e){const t=e.spread;return null==t?e.children.length>1:t}function Ao(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(zo(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(zo(t.slice(o),o>0,!1)),i.join("")}function zo(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const jo={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=sr(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ro(e,t);const o={src:sr(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){const n={src:sr(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ro(e,t);const o={href:sr(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){const n={href:sr(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Io(n[r])}return t}(n):Io(t),i={},a=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const e=r[s];(o||0!==s||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?a.push(e):a.push(...e.children)}const l=r[r.length-1];l&&(o||"element"!==l.type||"p"!==l.tagName)&&a.push({type:"text",value:"\n"});const u={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,u),e.applyData(t,u)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=fn(t.children[1]),a=dn(t.children[t.children.length-1]);i&&a&&(r.position={start:i,end:a}),o.push(r)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,a=i?i.length:t.children.length;let s=-1;const l=[];for(;++s<a;){const n=t.children[s],r={},a=i?i[s]:void 0;a&&(r.align=a);let u={type:"element",tagName:o,properties:r,children:[]};n&&(u.children=e.all(n),e.patch(n,u),u=e.applyData(n,u)),l.push(u)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,u),e.applyData(t,u)},text:function(e,t){const n={type:"text",value:Ao(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:Do,yaml:Do,definition:Do,footnoteDefinition:Do};function Do(){}const Fo="object"==typeof self?self:globalThis,Mo=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[i,a]=t[o];switch(i){case 0:case-1:return n(a,o);case 1:{const e=n([],o);for(const t of a)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),o);case 4:{const{source:e,flags:t}=a;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of a)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of a)e.add(r(t));return e}case 7:{const{name:e,message:t}=a;return n(new Fo[e](t),o)}case 8:return n(BigInt(a),o);case"BigInt":return n(Object(BigInt(a)),o);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new Fo[i](a),o)};return r})(new Map,e)(0),Uo="",{toString:Bo}={},{keys:$o}=Object,Vo=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=Bo.call(e).slice(8,-1);switch(n){case"Array":return[1,Uo];case"Object":return[2,Uo];case"Date":return[3,Uo];case"RegExp":return[4,Uo];case"Map":return[5,Uo];case"Set":return[6,Uo];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},Ho=([e,t])=>0===e&&("function"===t||"symbol"===t),qo=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const o=(e,t)=>{const o=r.push(e)-1;return n.set(t,o),o},i=r=>{if(n.has(r))return n.get(r);let[a,s]=Vo(r);switch(a){case 0:{let t=r;switch(s){case"bigint":a=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return o([-1],r)}return o([a,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),o([s,[...e]],r)}const e=[],t=o([a,e],r);for(const n of r)e.push(i(n));return t}case 2:{if(s)switch(s){case"BigInt":return o([s,r.toString()],r);case"Boolean":case"Number":case"String":return o([s,r.valueOf()],r)}if(t&&"toJSON"in r)return i(r.toJSON());const n=[],l=o([a,n],r);for(const t of $o(r))!e&&Ho(Vo(r[t]))||n.push([i(t),i(r[t])]);return l}case 3:return o([a,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([a,{source:e,flags:t}],r)}case 5:{const t=[],n=o([a,t],r);for(const[o,a]of r)(e||!Ho(Vo(o))&&!Ho(Vo(a)))&&t.push([i(o),i(a)]);return n}case 6:{const t=[],n=o([a,t],r);for(const o of r)!e&&Ho(Vo(o))||t.push(i(o));return n}}const{message:l}=r;return o([a,{name:s,message:l}],r)};return i})(!(t||n),!!t,new Map,r)(e),r},Wo="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Mo(qo(e,t)):structuredClone(e):(e,t)=>Mo(qo(e,t));function Ko(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Qo(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const Jo=function(e){if(null==e)return Go;if("function"==typeof e)return Yo(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Jo(e[n]);return Yo(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return Yo(n);function n(n){const r=n;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}(e);if("string"==typeof e)return function(e){return Yo(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function Yo(e){return function(t,n,r){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function Go(){return!0}const Xo=[],Zo=!0,ei=!1;function ti(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const i=Jo(o),a=r?-1:1;!function e(o,s,l){const u=o&&"object"==typeof o?o:{};if("string"==typeof u.type){const e="string"==typeof u.tagName?u.tagName:"string"==typeof u.name?u.name:void 0;Object.defineProperty(c,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return c;function c(){let u,c,d,f=Xo;if((!t||i(o,s,l[l.length-1]||void 0))&&(f=function(e){if(Array.isArray(e))return e;if("number"==typeof e)return[Zo,e];return null==e?Xo:[e]}(n(o,l)),f[0]===ei))return f;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==f[0])for(c=(r?t.children.length:-1)+a,d=l.concat(t);c>-1&&c<t.children.length;){const n=t.children[c];if(u=e(n,c,d)(),u[0]===ei)return u;c="number"==typeof u[1]?u[1]:c+a}}return f}}(e,void 0,[])()}function ni(e,t,n,r){let o,i,a;"function"==typeof t&&"function"!=typeof n?(i=void 0,a=t,o=n):(i=t,a=n,o=r),ti(e,i,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return a(e,r,n)},o)}const ri={}.hasOwnProperty,oi={};function ii(e,t){e.position&&(t.position=function(e){const t=fn(e),n=dn(e);if(t&&n)return{start:t,end:n}}(e))}function ai(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&o&&Object.assign(n.properties,Wo(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function si(e,t){const n=t.data||{},r=!("value"in t)||ri.call(n,"hProperties")||ri.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function li(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function ui(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function ci(e,t){const n=function(e,t){const n=t||oi,r=new Map,o=new Map,i=new Map,a={...jo,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=s.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(Array.isArray(o)||"text"!==o.type||(o.value=ui(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=ui(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:ai,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:a,one:function(e,t){const n=e.type,r=s.handlers[n];if(ri.call(s.handlers,n)&&r)return r(s,e,t);if(s.options.passThrough&&s.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=Wo(n);return r.children=s.all(e),r}return Wo(e)}return(s.options.unknownHandler||si)(s,e,t)},options:n,patch:ii,wrap:li};return ni(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),s}(e,t),r=n.one(e,void 0),o=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Ko,r=e.options.footnoteBackLabel||Qo,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[l]);if(!o)continue;const i=e.all(o),a=String(o.identifier).toUpperCase(),u=sr(a.toLowerCase());let c=0;const d=[],f=e.footnoteCounts.get(a);for(;void 0!==f&&++c<=f;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,c);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+u+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=i[i.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...d)}else i.push(...d);const h={type:"element",tagName:"li",properties:{id:t+"fn-"+u},children:e.wrap(i,!0)};e.patch(o,h),s.push(h)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Wo(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:"\n"},o),i}function di(e,t){return e&&"run"in e?async function(n,r){const o=ci(n,{file:r,...t});await e.run(o,r)}:function(n,r){return ci(n,{file:r,...e||t})}}function fi(e){if(e)throw e}var pi,hi;var gi=function(){if(hi)return pi;hi=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},i=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,o=e.call(n,"constructor"),i=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!i)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return pi=function e(){var t,n,r,l,u,c,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(h&&l&&(i(l)||(u=o(l)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&i(r)?r:{},a(d,{name:n,newValue:e(h,c,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},pi}();const mi=t(gi);function yi(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function vi(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(i,...a){const s=e[++n];let l=-1;if(i)r(i);else{for(;++l<t.length;)null!==a[l]&&void 0!==a[l]||(a[l]=t[l]);t=a,s?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let s;r&&t.push(o);try{s=e.apply(this,t)}catch(i){if(r&&n)throw i;return o(i)}r||(s&&s.then&&"function"==typeof s.then?s.then(a,o):s instanceof Error?o(s):a(s))}function o(e,...r){n||(n=!0,t(e,...r))}function a(e){o(null,e)}}(s,o)(...a):r(null,...a)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const bi={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');ki(e);let n,r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else a<0&&(n=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(o=i):(s=-1,o=a));r===o?o=a:o<0&&(o=e.length);return e.slice(r,o)},dirname:function(e){if(ki(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){ki(e);let t,n=e.length,r=-1,o=0,i=-1,a=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?i<0?i=n:1!==a&&(a=1):i>-1&&(a=-1);else if(t){o=n+1;break}}if(i<0||r<0||0===a||1===a&&i===r-1&&i===o+1)return"";return e.slice(i,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)ki(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){ki(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",i=0,a=-1,s=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(a===l-1||1===s);else if(a!==l-1&&2===s){if(o.length<2||2!==i||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",i=0):(o=o.slice(0,r),i=o.length-1-o.lastIndexOf("/")),a=l,s=0;continue}}else if(o.length>0){o="",i=0,a=l,s=0;continue}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(a+1,l):o=e.slice(a+1,l),i=l-a-1;a=l,s=0}else 46===n&&s>-1?s++:s=-1}return o}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function ki(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const wi={cwd:function(){return"/"}};function xi(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function Si(e){if("string"==typeof e)e=new URL(e);else if(!xi(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const Ei=["history","path","basename","stem","extname","dirname"];class Ci{constructor(e){let t;t=e?xi(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":wi.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<Ei.length;){const e=Ei[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)Ei.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?bi.basename(this.path):void 0}set basename(e){Ni(e,"basename"),Ti(e,"basename"),this.path=bi.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?bi.dirname(this.path):void 0}set dirname(e){Oi(this.basename,"dirname"),this.path=bi.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?bi.extname(this.path):void 0}set extname(e){if(Ti(e,"extname"),Oi(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=bi.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){xi(e)&&(e=Si(e)),Ni(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?bi.basename(this.path,this.extname):void 0}set stem(e){Ni(e,"stem"),Ti(e,"stem"),this.path=bi.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new vn(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function Ti(e,t){if(e&&e.includes(bi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+bi.sep+"`")}function Ni(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Oi(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Pi=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Li={}.hasOwnProperty;class _i extends Pi{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=vi()}copy(){const e=new _i;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(mi(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(zi("data",this.frozen),this.namespace[e]=t,this):Li.call(this.namespace,e)&&this.namespace[e]||void 0:e?(zi("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=Fi(e),n=this.parser||this.Parser;return Ii("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),Ii("process",this.parser||this.Parser),Ai("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const i=Fi(e),a=n.parse(i);function s(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(a,i,function(e,t,r){if(e||!t||!r)return s(e);const o=t,i=n.stringify(o,r);var a;"string"==typeof(a=i)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(a)?r.value=i:r.result=i,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),Ii("processSync",this.parser||this.Parser),Ai("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,fi(e),t=r}),Di("processSync","process",n),t}run(e,t,n){ji(e),this.freeze();const r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,i){const a=Fi(t);r.run(e,a,function(t,r,a){const s=r||e;t?i(t):o?o(s):n(void 0,s,a)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){fi(e),n=t,r=!0}),Di("runSync","run",r),n}stringify(e,t){this.freeze();const n=Fi(t),r=this.compiler||this.Compiler;return Ai("stringify",r),ji(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(zi("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?a(e):i(e)}return this;function o(e){if("function"==typeof e)s(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,n)}else i(e)}}function i(e){if(!("plugins"in e)&&!("settings"in e))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=mi(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function s(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...i]=t;const a=n[o][1];yi(a)&&yi(r)&&(r=mi(!0,a,r)),n[o]=[e,r,...i]}}}}const Ri=(new _i).freeze();function Ii(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function Ai(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function zi(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ji(e){if(!yi(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function Di(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Fi(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new Ci(e)}const Mi=[],Ui={allowDangerousHtml:!0},Bi=/^(https?|ircs?|mailto|xmpp)$/i,$i=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Vi(e){const t=function(e){const t=e.rehypePlugins||Mi,n=e.remarkPlugins||Mi,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ui}:Ui,o=Ri().use(_o).use(n).use(di,r).use(t);return o}(e),n=function(e){const t=e.children||"",n=new Ci;"string"==typeof t&&(n.value=t);return n}(e);return function(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||Hi;for(const c of $i)Object.hasOwn(t,c.from)&&ft((c.from,c.to&&c.to,c.id));return ni(e,u),Cn(e,{Fragment:N.Fragment,components:o,ignoreInvalidStyle:!0,jsx:N.jsx,jsxs:N.jsxs,passKeys:!0,passNode:!0});function u(e,t,o){if("raw"===e.type&&o&&"number"==typeof t)return a?o.children.splice(t,1):o.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in zn)if(Object.hasOwn(zn,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=zn[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let a=n?!n.includes(e.tagName):!!i&&i.includes(e.tagName);if(!a&&r&&"number"==typeof t&&(a=!r(e,t,o)),a&&o&&"number"==typeof t)return s&&e.children?o.children.splice(t,1,...e.children):o.children.splice(t,1),t}}}(t.runSync(t.parse(n),n),e)}function Hi(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return-1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||Bi.test(e.slice(0,t))?e:""}const qi="http://localhost:8002",Wi={BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left",TOP_RIGHT:"top-right",TOP_LEFT:"top-left"},Ki={LIGHT:"light",DARK:"dark",AUTO:"auto"},Qi={SPANISH:"es",ENGLISH:"en",FRANCES:"fr"},Ji=640,Yi=Ki.AUTO,Gi=Wi.BOTTOM_RIGHT,Xi=Qi.ENGLISH,Zi="400px",ea="600px",ta=!1,na=!0,ra=!0,oa=3e4,ia=2e3,aa=e=>{try{return new Date(e).toLocaleTimeString("es-ES",{hour:"2-digit",minute:"2-digit"})}catch{return""}},sa=()=>crypto.randomUUID(),la=({size:e="md",className:t=""})=>N.jsx("div",{className:`gpc-spinner ${{sm:"w-4 h-4 border-2",md:"w-6 h-6 border-2",lg:"w-8 h-8 border-3"}[e]} ${t}`,role:"status","aria-label":"Cargando",children:N.jsx("span",{className:"sr-only",children:"Cargando..."})}),ua=()=>N.jsxs("div",{className:"gpc-typing-indicator",role:"status","aria-label":"Escribiendo",children:[N.jsx("span",{className:"gpc-typing-dot"}),N.jsx("span",{className:"gpc-typing-dot"}),N.jsx("span",{className:"gpc-typing-dot"})]}),ca=({message:e,showMetadata:t=!1,messageRef:n=null})=>{const{t:r}=V(),o="user"===e.role,i=!o&&e.isStreaming&&!e.content;return N.jsxs("div",{ref:n,className:"gpc-message "+(o?"gpc-message-user":"gpc-message-assistant"),role:"article","aria-label":o?"Mensaje del usuario":"Mensaje del asistente",children:[N.jsx("div",{className:"gpc-message-content",children:i?N.jsx(ua,{}):o?e.content.trim():N.jsx(Vi,{children:e.content})}),N.jsx("div",{className:"gpc-message-timestamp "+(o?"gpc-message-timestamp-user":""),children:aa(e.timestamp)}),!o&&t&&e.metadata&&N.jsxs("div",{className:"gpc-message-metadata",children:[e.metadata.tokensUsed&&N.jsxs("div",{className:"gpc-metadata-item",children:[N.jsxs("strong",{children:[r("metadata.tokensUsed"),":"]})," ",e.metadata.tokensUsed]}),e.metadata.responseTimeMs&&N.jsxs("div",{className:"gpc-metadata-item",children:[N.jsxs("strong",{children:[r("metadata.responseTime"),":"]})," ",(a=e.metadata.responseTimeMs,a>=1e3?`${(a/1e3).toFixed(1)}s`:`${Math.round(a)}ms`)]}),e.metadata.model&&N.jsxs("div",{className:"gpc-metadata-item",children:[N.jsxs("strong",{children:[r("metadata.model"),":"]})," ",e.metadata.model]})]})]});var a},da=({messages:e,isLoading:t,showMetadata:n=!1,widgetConfig:r=null})=>{const{t:o}=V(),i=l.useRef(null),a=l.useRef(null),s=l.useRef(e.length);l.useEffect(()=>{const t=e.length>s.current,n=e[e.length-1];t&&n&&("user"===n.role?i.current?.scrollIntoView({behavior:"smooth"}):"assistant"===n.role&&n.isStreaming&&setTimeout(()=>{a.current?.scrollIntoView({behavior:"smooth",block:"start"})},100)),s.current=e.length},[e]);const u=r?.company_name||"TIA GPC",c=r?.company_logo_base64,d=c?.startsWith("data:")?c:c?`data:image/png;base64,${c}`:null;return 0!==e.length||t?N.jsxs("div",{className:"gpc-messages-container gpc-scrollbar gpc-smooth-scroll",children:[e.map((t,r)=>N.jsx(ca,{message:t,showMetadata:n,messageRef:r===e.length-1?a:null},t.id)),N.jsx("div",{ref:i})]}):N.jsx("div",{className:"gpc-messages-container",children:N.jsxs("div",{className:"gpc-empty-state",children:[d?N.jsx("div",{className:"gpc-welcome-logo",children:N.jsx("img",{src:d,alt:u,className:"gpc-welcome-company-logo"})}):N.jsx(te,{className:"gpc-empty-icon"}),N.jsx("h3",{className:"gpc-empty-title",children:o("chat.welcome",{companyName:u})}),N.jsx("p",{className:"gpc-empty-text",children:o("chat.emptyState")})]})})},fa=({onSendMessage:e,isLoading:t,disabled:n})=>{const{t:r}=V(),[o,i]=l.useState(""),a=l.useRef(null);l.useEffect(()=>{n||t||a.current?.focus()},[n,t]);const s=async r=>{r.preventDefault();const a=(e=>e.trim().slice(0,2e3))(o);if(a&&!t&&!n)try{await e(a),i("")}catch(s){}},u=o.trim().length>0&&!t&&!n;return N.jsxs("form",{onSubmit:s,className:"gpc-input-container",children:[N.jsx("input",{ref:a,type:"text",value:o,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),s(e))},placeholder:r("chat.placeholder"),disabled:t||n,maxLength:ia,className:"gpc-input","aria-label":r("chat.placeholder"),"aria-describedby":"chat-input-help"}),N.jsx("button",{type:"submit",disabled:!u,className:"gpc-send-button","aria-label":r("chat.send"),title:r("chat.send"),children:t?N.jsx("span",{className:"gpc-spinner"}):N.jsx(re,{className:"gpc-icon"})}),N.jsxs("span",{id:"chat-input-help",className:"gpc-sr-only",children:[r("chat.placeholder"),". Máximo ",ia," caracteres."]})]})};var pa=l.forwardRef(({as:e="div",...t},n)=>N.jsx(e,{...t,ref:n})),ha="cf-turnstile-script",ga="onloadTurnstileCallback",ma=e=>!!document.getElementById(e),ya={normal:{width:300,height:65},compact:{width:150,height:140},invisible:{width:0,height:0,overflow:"hidden"},flexible:{minWidth:300,width:"100%",height:65},interactionOnly:{width:"fit-content",height:"auto",display:"flex"}};function va(e){if("invisible"!==e&&"interactionOnly"!==e)return e}var ba,ka="unloaded",wa=new Promise((e,t)=>{ba={resolve:e,reject:t},"ready"===ka&&e(void 0)}),xa=l.forwardRef((e,t)=>{let{scriptOptions:n,options:r={},siteKey:o,onWidgetLoad:i,onSuccess:a,onExpire:s,onError:u,onBeforeInteractive:c,onAfterInteractive:d,onUnsupported:f,onTimeout:p,onLoadScript:h,id:g,style:m,as:y="div",injectScript:v=!0,rerenderOnCallbackChange:b=!1,...k}=e,w=r.size,x=l.useCallback(()=>typeof w>"u"?{}:"execute"===r.execution?ya.invisible:"interaction-only"===r.appearance?ya.interactionOnly:ya[w],[r.execution,w,r.appearance]),[S,E]=l.useState(x()),C=l.useRef(null),[T,O]=l.useState(!1),P=l.useRef(),L=l.useRef(!1),_=g||"cf-turnstile",R=l.useRef({onSuccess:a,onError:u,onExpire:s,onBeforeInteractive:c,onAfterInteractive:d,onUnsupported:f,onTimeout:p});l.useEffect(()=>{b||(R.current={onSuccess:a,onError:u,onExpire:s,onBeforeInteractive:c,onAfterInteractive:d,onUnsupported:f,onTimeout:p})});let I=n?.id||ha,A=function(e=ha){let[t,n]=l.useState(!1);return l.useEffect(()=>{let t=()=>{ma(e)&&n(!0)},r=new MutationObserver(t);return r.observe(document,{childList:!0,subtree:!0}),t(),()=>{r.disconnect()}},[e]),t}(I),z=n?.onLoadCallbackName||ga,j=r.appearance||"always",D=l.useMemo(()=>({sitekey:o,action:r.action,cData:r.cData,theme:r.theme||"auto",language:r.language||"auto",tabindex:r.tabIndex,"response-field":r.responseField,"response-field-name":r.responseFieldName,size:va(w),retry:r.retry||"auto","retry-interval":r.retryInterval||8e3,"refresh-expired":r.refreshExpired||"auto","refresh-timeout":r.refreshTimeout||"auto",execution:r.execution||"render",appearance:r.appearance||"always","feedback-enabled":r.feedbackEnabled||!0,callback:e=>{L.current=!0,b?a?.(e):R.current.onSuccess?.(e)},"error-callback":b?u:(...e)=>R.current.onError?.(...e),"expired-callback":b?s:(...e)=>R.current.onExpire?.(...e),"before-interactive-callback":b?c:(...e)=>R.current.onBeforeInteractive?.(...e),"after-interactive-callback":b?d:(...e)=>R.current.onAfterInteractive?.(...e),"unsupported-callback":b?f:(...e)=>R.current.onUnsupported?.(...e),"timeout-callback":b?p:(...e)=>R.current.onTimeout?.(...e)}),[r.action,r.appearance,r.cData,r.execution,r.language,r.refreshExpired,r.responseField,r.responseFieldName,r.retry,r.retryInterval,r.tabIndex,r.theme,r.feedbackEnabled,r.refreshTimeout,o,w,b,b?a:null,b?u:null,b?s:null,b?c:null,b?d:null,b?f:null,b?p:null]),F=l.useCallback(()=>typeof window<"u"&&!!window.turnstile,[]);return l.useEffect(function(){v&&!T&&(({render:e="explicit",onLoadCallbackName:t=ga,scriptOptions:{nonce:n="",defer:r=!0,async:o=!0,id:i="",appendTo:a,onError:s,crossOrigin:l=""}={}})=>{let u=i||ha;if(ma(u))return;let c=document.createElement("script");c.id=u,c.src=`https://challenges.cloudflare.com/turnstile/v0/api.js?onload=${t}&render=${e}`,document.querySelector(`script[src="${c.src}"]`)||(c.defer=!!r,c.async=!!o,n&&(c.nonce=n),l&&(c.crossOrigin=l),s&&(c.onerror=s,delete window[t]),("body"===a?document.body:document.getElementsByTagName("head")[0]).appendChild(c))})({onLoadCallbackName:z,scriptOptions:{...n,id:I}})},[v,T,n,I]),l.useEffect(function(){"ready"!==ka&&((e=ga)=>("unloaded"===ka&&(ka="loading",window[e]=()=>{ba.resolve(),ka="ready",delete window[e]}),wa))(z).then(()=>O(!0)).catch(console.error)},[]),l.useEffect(function(){if(!C.current||!T)return;let e=!1;return(async()=>{if(e||!C.current)return;let t=window.turnstile.render(C.current,D);P.current=t,P.current&&i?.(P.current)})(),()=>{e=!0,P.current&&(window.turnstile.remove(P.current),L.current=!1)}},[_,T,D]),l.useImperativeHandle(t,()=>{let{turnstile:e}=window;return{getResponse(){if(e?.getResponse&&P.current&&F())return e.getResponse(P.current)},getResponsePromise:async(e=3e4,t=100)=>new Promise((n,r)=>{let o,i=async()=>{if(L.current&&window.turnstile&&P.current)try{let e=window.turnstile.getResponse(P.current);return o&&clearTimeout(o),e?n(e):r(new Error("No response received"))}catch(a){return o&&clearTimeout(o),r(new Error("Failed to get response"))}o||(o=setTimeout(()=>{o&&clearTimeout(o),r(new Error("Timeout"))},e)),await new Promise(e=>setTimeout(e,t)),await i()};i()}),reset(){if(e?.reset&&P.current&&F()){"execute"===r.execution&&E(ya.invisible);try{L.current=!1,e.reset(P.current)}catch(je){}}},remove(){e?.remove&&P.current&&F()&&(E(ya.invisible),L.current=!1,e.remove(P.current),P.current=null)},render(){if(!e?.render||!C.current||!F()||P.current)return;let t=e.render(C.current,D);return P.current=t,P.current&&i?.(P.current),"execute"!==r.execution&&E(w?ya[w]:{}),t},execute(){"execute"===r.execution&&e?.execute&&C.current&&P.current&&F()&&(e.execute(C.current,D),E(w?ya[w]:{}))},isExpired:()=>!!(e?.isExpired&&P.current&&F())&&e.isExpired(P.current)}},[P,r.execution,w,D,C,F,T,i]),l.useEffect(()=>{A&&!T&&window.turnstile&&O(!0)},[T,A]),l.useEffect(()=>{E(x())},[r.execution,w,j]),l.useEffect(()=>{!A||"function"!=typeof h||h()},[A]),N.jsx(pa,{ref:C,as:y,id:_,style:{...S,...m},...k})});xa.displayName="Turnstile";const Sa=({siteKey:e,onSuccess:t,onError:n})=>{const{t:r}=V(),[o,i]=l.useState(!1),[a,s]=l.useState(null);return N.jsxs("div",{className:"gpc-validator-container",children:[N.jsxs("div",{className:"gpc-validator-header",children:[N.jsx("h3",{className:"gpc-validator-title",children:r("chat.validation")}),N.jsx("p",{className:"gpc-validator-subtitle",children:r("turnstile.verifying")})]}),!a&&N.jsx("div",{className:"gpc-animate-fade-in",children:N.jsx(xa,{siteKey:e,onSuccess:async e=>{i(!0),s(null);try{await t(e)}catch(o){s(r("turnstile.error")),n?.(o)}finally{i(!1)}},onError:e=>{s(r("turnstile.error")),n?.(new Error(r("turnstile.error")))},options:{theme:"light",size:"normal"}})}),o&&N.jsxs("div",{className:"gpc-validator-loading",children:[N.jsx(la,{size:"md"}),N.jsx("p",{className:"gpc-validator-text",children:r("chat.validation")})]}),a&&N.jsxs("div",{className:"gpc-validator-error",children:[N.jsx(X,{className:"gpc-error-icon"}),N.jsxs("div",{className:"gpc-error-content",children:[N.jsx("p",{className:"gpc-error-title",children:r("errors.validation")}),N.jsx("p",{className:"gpc-error-message",children:a}),N.jsx("button",{onClick:()=>window.location.reload(),className:"gpc-error-button",children:r("chat.retry")})]})]})]})},Ea=(e="auto")=>{const[t,n]=l.useState(e),[r,o]=l.useState("light");l.useEffect(()=>{if(o("auto"===t?window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t),"auto"===t){const e=window.matchMedia("(prefers-color-scheme: dark)"),t=e=>{o(e.matches?"dark":"light")};return e.addEventListener("change",t),()=>{e.removeEventListener("change",t)}}},[t]);return{theme:r,themeMode:t,setThemeMode:n,toggleTheme:()=>{n(e=>"auto"===e?"light"===r?"dark":"light":"light"===e?"dark":"light")}}},Ca=({gpcService:e,licenseToken:t,widgetConfig:n,turnstileSiteKey:r,onClose:o,themeMode:i,showBranding:a=!0,showMetadata:s=!1,onError:u})=>{const{t:c}=V(),[d,f]=l.useState(null),[p,h]=l.useState(!1),{theme:g,toggleTheme:m}=Ea(i),y=l.useCallback(()=>{h(!1),f(null),e&&e.renewSessionToken()},[e]),{messages:v,isLoading:b,sendMessage:k}=((e,t,n)=>{const{t:r}=V(),[o,i]=l.useState([]),[a,s]=l.useState(!1),[u,c]=l.useState(null),d=l.useCallback(async o=>{if(!o.trim()||a)return;if(!t)return void at.error("Validación anti-bot pendiente");const l={id:sa(),role:"user",content:o.trim(),timestamp:(new Date).toISOString()};i(e=>[...e,l]),s(!0),c(null);const u=sa(),d={id:u,role:"assistant",content:"",timestamp:(new Date).toISOString(),isStreaming:!0};i(e=>[...e,d]);try{const n=await e.sendMessage(o,t,e=>{i(t=>t.map(t=>t.id===u?{...t,content:t.content+e}:t))});i(e=>e.map(e=>e.id===u?{id:n.data.message_id,role:"assistant",content:n.data.response,timestamp:n.data.created_at,isStreaming:!1,metadata:{costUsd:n.data.cost_usd,creditBalanceUsd:n.data.credit_balance_usd,inputTokens:n.data.input_tokens,outputTokens:n.data.output_tokens,responseTimeMs:n.data.response_time_ms,modelUsed:n.data.model_used}}:e))}catch(f){let e,t;i(e=>e.filter(e=>e.id!==u));try{e=JSON.parse(f.message)}catch{e={statusCode:500,message:f.message}}const o=e.statusCode||500,a=e.errorCode||"";switch(401===o&&"SESSION_EXPIRED"===a&&(t=r("errors.sessionExpired","Session expired, please verify again"),n&&n()),o){case 401:t||(t=r("errors.unauthorized"));break;case 402:t=r("errors.insufficientCredits");break;case 403:t=a.includes("DOMAIN")||a.includes("UNAUTHORIZED")?r("errors.domainUnauthorized"):r("errors.validation");break;case 429:t=r("errors.rateLimit");break;case 503:case 502:case 504:t=r("errors.aiServiceUnavailable");break;case 500:t=r("errors.serverError");break;default:t=r("errors.generic")}c(t),at.error(t,{duration:4e3,position:"top-center"});const s={id:sa(),role:"assistant",content:t,timestamp:(new Date).toISOString()};i(e=>[...e,s])}finally{s(!1)}},[e,t,a,r,n]),f=l.useCallback(()=>{i([]),c(null)},[]),p=l.useCallback(()=>{c(null)},[]);return{messages:o,isLoading:a,error:u,sendMessage:d,clearMessages:f,clearError:p}})(e,d,y);l.useEffect(()=>{e&&e.hasValidCachedSession()&&(h(!0),f("CACHED_SESSION"))},[e]);return l.useEffect(()=>()=>{e&&e.releaseSession().catch(e=>{})},[e]),N.jsxs("div",{className:"gpc-chat-window gpc-animate-fade-in "+("dark"===g?"gpc-dark":""),children:[N.jsx(ct,{onClose:o,theme:g,onToggleTheme:m,showBranding:a,widgetConfig:n}),p?N.jsxs(N.Fragment,{children:[N.jsx(da,{messages:v,isLoading:b,showMetadata:s,widgetConfig:n}),N.jsx(fa,{onSendMessage:k,isLoading:b,disabled:!1})]}):N.jsx(Sa,{siteKey:r,onSuccess:t=>{f(t),h(!0),e&&e.validateSession()},onError:u}),a&&N.jsx("div",{className:"gpc-footer",children:N.jsx("span",{className:"gpc-footer-text",children:c("widget.poweredBy")})}),N.jsx(it,{position:"top-center"})]})};function Ta(e,t){return function(){return e.apply(t,arguments)}}const{toString:Na}=Object.prototype,{getPrototypeOf:Oa}=Object,{iterator:Pa,toStringTag:La}=Symbol,_a=(e=>t=>{const n=Na.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ra=e=>(e=e.toLowerCase(),t=>_a(t)===e),Ia=e=>t=>typeof t===e,{isArray:Aa}=Array,za=Ia("undefined");function ja(e){return null!==e&&!za(e)&&null!==e.constructor&&!za(e.constructor)&&Ma(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Da=Ra("ArrayBuffer");const Fa=Ia("string"),Ma=Ia("function"),Ua=Ia("number"),Ba=e=>null!==e&&"object"==typeof e,$a=e=>{if("object"!==_a(e))return!1;const t=Oa(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||La in e||Pa in e)},Va=Ra("Date"),Ha=Ra("File"),qa=Ra("Blob"),Wa=Ra("FileList"),Ka=Ra("URLSearchParams"),[Qa,Ja,Ya,Ga]=["ReadableStream","Request","Response","Headers"].map(Ra);function Xa(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),Aa(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(ja(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function Za(e,t){if(ja(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const es="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ts=e=>!za(e)&&e!==es;const ns=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&Oa(Uint8Array)),rs=Ra("HTMLFormElement"),os=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),is=Ra("RegExp"),as=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Xa(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const ss=Ra("AsyncFunction"),ls=(us="function"==typeof setImmediate,cs=Ma(es.postMessage),us?setImmediate:cs?(ds=`axios@${Math.random()}`,fs=[],es.addEventListener("message",({source:e,data:t})=>{e===es&&t===ds&&fs.length&&fs.shift()()},!1),e=>{fs.push(e),es.postMessage(ds,"*")}):e=>setTimeout(e));var us,cs,ds,fs;const ps="undefined"!=typeof queueMicrotask?queueMicrotask.bind(es):"undefined"!=typeof process&&process.nextTick||ls,hs={isArray:Aa,isArrayBuffer:Da,isBuffer:ja,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Ma(e.append)&&("formdata"===(t=_a(e))||"object"===t&&Ma(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Da(e.buffer),t},isString:Fa,isNumber:Ua,isBoolean:e=>!0===e||!1===e,isObject:Ba,isPlainObject:$a,isEmptyObject:e=>{if(!Ba(e)||ja(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(Ie){return!1}},isReadableStream:Qa,isRequest:Ja,isResponse:Ya,isHeaders:Ga,isUndefined:za,isDate:Va,isFile:Ha,isBlob:qa,isRegExp:is,isFunction:Ma,isStream:e=>Ba(e)&&Ma(e.pipe),isURLSearchParams:Ka,isTypedArray:ns,isFileList:Wa,forEach:Xa,merge:function e(){const{caseless:t,skipUndefined:n}=ts(this)&&this||{},r={},o=(o,i)=>{const a=t&&Za(r,i)||i;$a(r[a])&&$a(o)?r[a]=e(r[a],o):$a(o)?r[a]=e({},o):Aa(o)?r[a]=o.slice():n&&za(o)||(r[a]=o)};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&Xa(arguments[i],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(Xa(t,(t,r)=>{n&&Ma(t)?e[r]=Ta(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&Oa(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:_a,kindOfTest:Ra,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Aa(e))return e;let t=e.length;if(!Ua(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Pa]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:rs,hasOwnProperty:os,hasOwnProp:os,reduceDescriptors:as,freezeMethods:e=>{as(e,(t,n)=>{if(Ma(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Ma(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Aa(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Za,global:es,isContextDefined:ts,isSpecCompliantForm:function(e){return!!(e&&Ma(e.append)&&"FormData"===e[La]&&e[Pa])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Ba(e)){if(t.indexOf(e)>=0)return;if(ja(e))return e;if(!("toJSON"in e)){t[r]=e;const o=Aa(e)?[]:{};return Xa(e,(e,t)=>{const i=n(e,r+1);!za(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:ss,isThenable:e=>e&&(Ba(e)||Ma(e))&&Ma(e.then)&&Ma(e.catch),setImmediate:ls,asap:ps,isIterable:e=>null!=e&&Ma(e[Pa])};function gs(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}hs.inherits(gs,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:hs.toJSONObject(this.config),code:this.code,status:this.status}}});const ms=gs.prototype,ys={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ys[e]={value:e}}),Object.defineProperties(gs,ys),Object.defineProperty(ms,"isAxiosError",{value:!0}),gs.from=(e,t,n,r,o,i)=>{const a=Object.create(ms);hs.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",l=null==t&&e?e.code:t;return gs.call(a,s,l,n,r,o),e&&null==a.cause&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",i&&Object.assign(a,i),a};function vs(e){return hs.isPlainObject(e)||hs.isArray(e)}function bs(e){return hs.endsWith(e,"[]")?e.slice(0,-2):e}function ks(e,t,n){return e?e.concat(t).map(function(e,t){return e=bs(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ws=hs.toFlatObject(hs,{},null,function(e){return/^is[A-Z]/.test(e)});function xs(e,t,n){if(!hs.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=hs.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!hs.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&hs.isSpecCompliantForm(t);if(!hs.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(hs.isDate(e))return e.toISOString();if(hs.isBoolean(e))return e.toString();if(!s&&hs.isBlob(e))throw new gs("Blob is not supported. Use a Buffer instead.");return hs.isArrayBuffer(e)||hs.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(hs.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(hs.isArray(e)&&function(e){return hs.isArray(e)&&!e.some(vs)}(e)||(hs.isFileList(e)||hs.endsWith(n,"[]"))&&(s=hs.toArray(e)))return n=bs(n),s.forEach(function(e,r){!hs.isUndefined(e)&&null!==e&&t.append(!0===a?ks([n],r,i):null===a?n:n+"[]",l(e))}),!1;return!!vs(e)||(t.append(ks(o,n,i),l(e)),!1)}const c=[],d=Object.assign(ws,{defaultVisitor:u,convertValue:l,isVisitable:vs});if(!hs.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!hs.isUndefined(n)){if(-1!==c.indexOf(n))throw Error("Circular reference detected in "+r.join("."));c.push(n),hs.forEach(n,function(n,i){!0===(!(hs.isUndefined(n)||null===n)&&o.call(t,n,hs.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),c.pop()}}(e),t}function Ss(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Es(e,t){this._pairs=[],e&&xs(e,this,t)}const Cs=Es.prototype;function Ts(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ns(e,t,n){if(!t)return e;const r=n&&n.encode||Ts;hs.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):hs.isURLSearchParams(t)?t.toString():new Es(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Cs.append=function(e,t){this._pairs.push([e,t])},Cs.toString=function(e){const t=e?function(t){return e.call(this,t,Ss)}:Ss;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class Os{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){hs.forEach(this.handlers,function(t){null!==t&&e(t)})}}const Ps={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ls={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Es,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},_s="undefined"!=typeof window&&"undefined"!=typeof document,Rs="object"==typeof navigator&&navigator||void 0,Is=_s&&(!Rs||["ReactNative","NativeScript","NS"].indexOf(Rs.product)<0),As="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,zs=_s&&window.location.href||"http://localhost",js={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:_s,hasStandardBrowserEnv:Is,hasStandardBrowserWebWorkerEnv:As,navigator:Rs,origin:zs},Symbol.toStringTag,{value:"Module"})),...Ls};function Ds(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;if(i=!i&&hs.isArray(r)?r.length:i,s)return hs.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&hs.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&hs.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!a}if(hs.isFormData(e)&&hs.isFunction(e.entries)){const n={};return hs.forEachEntry(e,(e,r)=>{t(function(e){return hs.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const Fs={transitional:Ps,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=hs.isObject(e);o&&hs.isHTMLForm(e)&&(e=new FormData(e));if(hs.isFormData(e))return r?JSON.stringify(Ds(e)):e;if(hs.isArrayBuffer(e)||hs.isBuffer(e)||hs.isStream(e)||hs.isFile(e)||hs.isBlob(e)||hs.isReadableStream(e))return e;if(hs.isArrayBufferView(e))return e.buffer;if(hs.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return xs(e,new js.classes.URLSearchParams,{visitor:function(e,t,n,r){return js.isNode&&hs.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=hs.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return xs(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(hs.isString(e))try{return(t||JSON.parse)(e),hs.trim(e)}catch(Ie){if("SyntaxError"!==Ie.name)throw Ie}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Fs.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(hs.isResponse(e)||hs.isReadableStream(e))return e;if(e&&hs.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(Ie){if(n){if("SyntaxError"===Ie.name)throw gs.from(Ie,gs.ERR_BAD_RESPONSE,this,null,this.response);throw Ie}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:js.classes.FormData,Blob:js.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};hs.forEach(["delete","get","head","post","put","patch"],e=>{Fs.headers[e]={}});const Ms=hs.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Us=Symbol("internals");function Bs(e){return e&&String(e).trim().toLowerCase()}function $s(e){return!1===e||null==e?e:hs.isArray(e)?e.map($s):String(e)}function Vs(e,t,n,r,o){return hs.isFunction(r)?r.call(this,t,n):(o&&(t=n),hs.isString(t)?hs.isString(r)?-1!==t.indexOf(r):hs.isRegExp(r)?r.test(t):void 0:void 0)}let Hs=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Bs(t);if(!o)throw new Error("header name must be a non-empty string");const i=hs.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=$s(e))}const i=(e,t)=>hs.forEach(e,(e,n)=>o(e,n,t));if(hs.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(hs.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Ms[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(hs.isObject(e)&&hs.isIterable(e)){let n,r,o={};for(const t of e){if(!hs.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?hs.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Bs(e)){const n=hs.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(hs.isFunction(t))return t.call(this,e,n);if(hs.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Bs(e)){const n=hs.findKey(this,e);return!(!n||void 0===this[n]||t&&!Vs(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Bs(e)){const o=hs.findKey(n,e);!o||t&&!Vs(0,n[o],o,t)||(delete n[o],r=!0)}}return hs.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Vs(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return hs.forEach(this,(r,o)=>{const i=hs.findKey(n,o);if(i)return t[i]=$s(r),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();a!==o&&delete t[o],t[a]=$s(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return hs.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&hs.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Us]=this[Us]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Bs(e);t[r]||(!function(e,t){const n=hs.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return hs.isArray(e)?e.forEach(r):r(e),this}};function qs(e,t){const n=this||Fs,r=t||n,o=Hs.from(r.headers);let i=r.data;return hs.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ws(e){return!(!e||!e.__CANCEL__)}function Ks(e,t,n){gs.call(this,null==e?"canceled":e,gs.ERR_CANCELED,t,n),this.name="CanceledError"}function Qs(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new gs("Request failed with status code "+n.status,[gs.ERR_BAD_REQUEST,gs.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Hs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),hs.reduceDescriptors(Hs.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),hs.freezeMethods(Hs),hs.inherits(Ks,gs,{__CANCEL__:!0});const Js=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),u=r[a];o||(o=l),n[i]=s,r[i]=l;let c=a,d=0;for(;c!==i;)d+=n[c++],c%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),l-o<t)return;const f=u&&l-u;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const a=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(n=e,r||(r=setTimeout(()=>{r=null,a(n)},i-s)))},()=>n&&a(n)]}(n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,l=o(s);r=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&i<=a?(a-i)/l:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},Ys=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Gs=e=>(...t)=>hs.asap(()=>e(...t)),Xs=js.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,js.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(js.origin),js.navigator&&/(msie|trident)/i.test(js.navigator.userAgent)):()=>!0,Zs=js.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const a=[e+"="+encodeURIComponent(t)];hs.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),hs.isString(r)&&a.push("path="+r),hs.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function el(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const tl=e=>e instanceof Hs?{...e}:e;function nl(e,t){t=t||{};const n={};function r(e,t,n,r){return hs.isPlainObject(e)&&hs.isPlainObject(t)?hs.merge.call({caseless:r},e,t):hs.isPlainObject(t)?hs.merge({},t):hs.isArray(t)?t.slice():t}function o(e,t,n,o){return hs.isUndefined(t)?hs.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!hs.isUndefined(t))return r(void 0,t)}function a(e,t){return hs.isUndefined(t)?hs.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>o(tl(e),tl(t),0,!0)};return hs.forEach(Object.keys({...e,...t}),function(r){const i=l[r]||o,a=i(e[r],t[r],r);hs.isUndefined(a)&&i!==s||(n[r]=a)}),n}const rl=e=>{const t=nl({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=Hs.from(a),t.url=Ns(el(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),hs.isFormData(n))if(js.hasStandardBrowserEnv||js.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(hs.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&a.set(e,n)})}if(js.hasStandardBrowserEnv&&(r&&hs.isFunction(r)&&(r=r(t)),r||!1!==r&&Xs(t.url))){const e=o&&i&&Zs.read(i);e&&a.set(o,e)}return t},ol="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=rl(e);let o=r.data;const i=Hs.from(r.headers).normalize();let a,s,l,u,c,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=r;function h(){u&&u(),c&&c(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let g=new XMLHttpRequest;function m(){if(!g)return;const r=Hs.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());Qs(function(e){t(e),h()},function(e){n(e),h()},{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(m)},g.onabort=function(){g&&(n(new gs("Request aborted",gs.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=new gs(t&&t.message?t.message:"Network Error",gs.ERR_NETWORK,e,g);r.event=t||null,n(r),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Ps;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new gs(t,o.clarifyTimeoutError?gs.ETIMEDOUT:gs.ECONNABORTED,e,g)),g=null},void 0===o&&i.setContentType(null),"setRequestHeader"in g&&hs.forEach(i.toJSON(),function(e,t){g.setRequestHeader(t,e)}),hs.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),p&&([l,c]=Js(p,!0),g.addEventListener("progress",l)),f&&g.upload&&([s,u]=Js(f),g.upload.addEventListener("progress",s),g.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=t=>{g&&(n(!t||t.type?new Ks(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===js.protocols.indexOf(y)?n(new gs("Unsupported protocol "+y+":",gs.ERR_BAD_REQUEST,e)):g.send(o||null)})},il=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof gs?t:new Ks(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new gs(`timeout ${t} of ms exceeded`,gs.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>hs.asap(a),s}},al=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},sl=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ll=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of sl(e))yield*al(n,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw s(t),t}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:ul}=hs,cl=(({Request:e,Response:t})=>({Request:e,Response:t}))(hs.global),{ReadableStream:dl,TextEncoder:fl}=hs.global,pl=(e,...t)=>{try{return!!e(...t)}catch(Ie){return!1}},hl=e=>{e=hs.merge.call({skipUndefined:!0},cl,e);const{fetch:t,Request:n,Response:r}=e,o=t?ul(t):"function"==typeof fetch,i=ul(n),a=ul(r);if(!o)return!1;const s=o&&ul(dl),l=o&&("function"==typeof fl?(e=>t=>e.encode(t))(new fl):async e=>new Uint8Array(await new n(e).arrayBuffer())),u=i&&s&&pl(()=>{let e=!1;const t=new n(js.origin,{body:new dl,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),c=a&&s&&pl(()=>hs.isReadableStream(new r("").body)),d={stream:c&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new gs(`Response type '${e}' is not supported`,gs.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=hs.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(hs.isBlob(e))return e.size;if(hs.isSpecCompliantForm(e)){const t=new n(js.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return hs.isArrayBufferView(e)||hs.isArrayBuffer(e)?e.byteLength:(hs.isURLSearchParams(e)&&(e+=""),hs.isString(e)?(await l(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:a,data:s,signal:l,cancelToken:p,timeout:h,onDownloadProgress:g,onUploadProgress:m,responseType:y,headers:v,withCredentials:b="same-origin",fetchOptions:k}=rl(e),w=t||fetch;y=y?(y+"").toLowerCase():"text";let x=il([l,p&&p.toAbortSignal()],h),S=null;const E=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let C;try{if(m&&u&&"get"!==a&&"head"!==a&&0!==(C=await f(v,s))){let e,t=new n(o,{method:"POST",body:s,duplex:"half"});if(hs.isFormData(s)&&(e=t.headers.get("content-type"))&&v.setContentType(e),t.body){const[e,n]=Ys(C,Js(Gs(m)));s=ll(t.body,65536,e,n)}}hs.isString(b)||(b=b?"include":"omit");const t=i&&"credentials"in n.prototype,l={...k,signal:x,method:a.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:"half",credentials:t?b:void 0};S=i&&new n(o,l);let p=await(i?w(S,k):w(o,l));const h=c&&("stream"===y||"response"===y);if(c&&(g||h&&E)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=p[t]});const t=hs.toFiniteNumber(p.headers.get("content-length")),[n,o]=g&&Ys(t,Js(Gs(g),!0))||[];p=new r(ll(p.body,65536,n,()=>{o&&o(),E&&E()}),e)}y=y||"text";let T=await d[hs.findKey(d,y)||"text"](p,e);return!h&&E&&E(),await new Promise((t,n)=>{Qs(t,n,{data:T,headers:Hs.from(p.headers),status:p.status,statusText:p.statusText,config:e,request:S})})}catch(T){if(E&&E(),T&&"TypeError"===T.name&&/Load failed|fetch/i.test(T.message))throw Object.assign(new gs("Network Error",gs.ERR_NETWORK,e,S),{cause:T.cause||T});throw gs.from(T,T&&T.code,e,S)}}},gl=new Map,ml=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let a,s,l=i.length,u=gl;for(;l--;)a=i[l],s=u.get(a),void 0===s&&u.set(a,s=l?new Map:hl(t)),u=s;return s};ml();const yl={http:null,xhr:ol,fetch:{get:ml}};hs.forEach(yl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(Ie){}Object.defineProperty(e,"adapterName",{value:t})}});const vl=e=>`- ${e}`,bl=e=>hs.isFunction(e)||null===e||!1===e,kl=(e,t)=>{e=hs.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let a=0;a<n;a++){let n;if(r=e[a],o=r,!bl(r)&&(o=yl[(n=String(r)).toLowerCase()],void 0===o))throw new gs(`Unknown adapter '${n}'`);if(o&&(hs.isFunction(o)||(o=o.get(t))))break;i[n||"#"+a]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new gs("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(vl).join("\n"):" "+vl(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function wl(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ks(null,e)}function xl(e){wl(e),e.headers=Hs.from(e.headers),e.data=qs.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return kl(e.adapter||Fs.adapter,e)(e).then(function(t){return wl(e),t.data=qs.call(e,e.transformResponse,t),t.headers=Hs.from(t.headers),t},function(t){return Ws(t)||(wl(e),t&&t.response&&(t.response.data=qs.call(e,e.transformResponse,t.response),t.response.headers=Hs.from(t.response.headers))),Promise.reject(t)})}const Sl="1.12.2",El={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{El[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Cl={};El.transitional=function(e,t,n){return(r,o,i)=>{if(!1===e)throw new gs(function(e,t){return"[Axios v"+Sl+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}(o," has been removed"+(t?" in "+t:"")),gs.ERR_DEPRECATED);return t&&!Cl[o]&&(Cl[o]=!0),!e||e(r,o,i)}},El.spelling=function(e){return(e,t)=>!0};const Tl={assertOptions:function(e,t,n){if("object"!=typeof e)throw new gs("options must be an object",gs.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new gs("option "+i+" must be "+n,gs.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new gs("Unknown option "+i,gs.ERR_BAD_OPTION)}},validators:El},Nl=Tl.validators;let Ol=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Os,response:new Os}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(Ie){}}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=nl(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Tl.assertOptions(n,{silentJSONParsing:Nl.transitional(Nl.boolean),forcedJSONParsing:Nl.transitional(Nl.boolean),clarifyTimeoutError:Nl.transitional(Nl.boolean)},!1),null!=r&&(hs.isFunction(r)?t.paramsSerializer={serialize:r}:Tl.assertOptions(r,{encode:Nl.function,serialize:Nl.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Tl.assertOptions(t,{baseUrl:Nl.spelling("baseURL"),withXsrfToken:Nl.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&hs.merge(o.common,o[t.method]);o&&hs.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Hs.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))});const l=[];let u;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let c,d=0;if(!s){const e=[xl.bind(this),void 0];for(e.unshift(...a),e.push(...l),c=e.length,u=Promise.resolve(t);d<c;)u=u.then(e[d++],e[d++]);return u}c=a.length;let f=t;for(;d<c;){const e=a[d++],t=a[d++];try{f=e(f)}catch(p){t.call(this,p);break}}try{u=xl.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,c=l.length;d<c;)u=u.then(l[d++],l[d++]);return u}getUri(e){return Ns(el((e=nl(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};hs.forEach(["delete","get","head","options"],function(e){Ol.prototype[e]=function(t,n){return this.request(nl(n||{},{method:e,url:t,data:(n||{}).data}))}}),hs.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(nl(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ol.prototype[e]=t(),Ol.prototype[e+"Form"]=t(!0)});const Pl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pl).forEach(([e,t])=>{Pl[t]=e});const Ll=function e(t){const n=new Ol(t),r=Ta(Ol.prototype.request,n);return hs.extend(r,Ol.prototype,n,{allOwnKeys:!0}),hs.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(nl(t,n))},r}(Fs);Ll.Axios=Ol,Ll.CanceledError=Ks,Ll.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Ks(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},Ll.isCancel=Ws,Ll.VERSION=Sl,Ll.toFormData=xs,Ll.AxiosError=gs,Ll.Cancel=Ll.CanceledError,Ll.all=function(e){return Promise.all(e)},Ll.spread=function(e){return function(t){return e.apply(null,t)}},Ll.isAxiosError=function(e){return hs.isObject(e)&&!0===e.isAxiosError},Ll.mergeConfig=nl,Ll.AxiosHeaders=Hs,Ll.formToJSON=e=>Ds(hs.isHTMLForm(e)?new FormData(e):e),Ll.getAdapter=kl,Ll.HttpStatusCode=Pl,Ll.default=Ll;const{Axios:_l,AxiosError:Rl,CanceledError:Il,isCancel:Al,CancelToken:zl,VERSION:jl,all:Dl,Cancel:Fl,isAxiosError:Ml,spread:Ul,toFormData:Bl,AxiosHeaders:$l,HttpStatusCode:Vl,formToJSON:Hl,getAdapter:ql,mergeConfig:Wl}=Ll;class Kl{constructor(e,t){this.licenseToken=t,this.sessionToken=this._getOrCreateSessionToken(t),this.api=Ll.create({baseURL:e||qi,timeout:oa,headers:{"Content-Type":"application/json"}}),this.api.interceptors.request.use(e=>(this.licenseToken&&(e.headers.Authorization=`Bearer ${this.licenseToken}`),e))}_generateSessionToken(){return"session_"+Array.from(crypto.getRandomValues(new Uint8Array(28))).map(e=>e.toString(16).padStart(2,"0")).join("")}_getStorageKey(e){return`tiagpc_session_${e.substring(0,16)}`}_getOrCreateSessionToken(e){const t=this._getStorageKey(e);try{const e=localStorage.getItem(t);if(e){const{sessionToken:n,timestamp:r,validated:o}=JSON.parse(e),i=Date.now();if(o&&i-r<864e5)return n;localStorage.removeItem(t)}}catch(n){}return this._generateSessionToken()}hasValidCachedSession(){const e=this._getStorageKey(this.licenseToken);try{const t=localStorage.getItem(e);if(t){const{sessionToken:e,timestamp:n,validated:r}=JSON.parse(t),o=Date.now();return r&&o-n<864e5}}catch(t){}return!1}_saveSessionToken(e,t,n=!1){const r=this._getStorageKey(e);try{const e={sessionToken:t,timestamp:Date.now(),validated:n};localStorage.setItem(r,JSON.stringify(e))}catch(o){}}_clearSessionToken(e){const t=this._getStorageKey(e);try{localStorage.removeItem(t)}catch(n){}}async sendMessage(e,t,n){if(!this.licenseToken)throw new Error("License token is required.");const r=this.hasValidCachedSession();if(!t&&!r)throw new Error("Turnstile token is required for anti-bot validation.");const o=`${this.api.defaults.baseURL}/ask`;try{const r=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.licenseToken}`},body:JSON.stringify({message:e,turnstile_token:t||"CACHED_SESSION",session_token:this.sessionToken})});if(!r.ok){const e=await r.json().catch(()=>({}));throw new Error(JSON.stringify({statusCode:r.status,errorCode:e.error_code||"UNKNOWN_ERROR",message:e.message||"Request failed",retryAfter:e.retry_after_seconds||null}))}const a=r.body.getReader(),s=new TextDecoder;let l="",u="",c=null,d=null;for(;;){const{done:e,value:t}=await a.read();if(e)break;l+=s.decode(t,{stream:!0});const r=l.split("\n");l=r.pop();for(const o of r){if(!o.trim()||!o.startsWith("data: "))continue;const e=o.replace("data: ","").trim();if("[DONE]"!==e)try{const t=JSON.parse(e);if("content"===t.type)u+=t.text,n&&n(t.text);else if("metadata"===t.type)c=t;else if("summary"===t.type)d=t;else if("error"===t.type)throw new Error(JSON.stringify({statusCode:t.status_code||500,errorCode:t.error_code,message:t.message,retryAfter:null}))}catch(i){if(i.message&&i.message.startsWith("{"))throw i}}}if(!d)throw new Error("No summary received from server");return{success:!0,data:{message_id:d.message_id,response:u,cost_usd:d.cost_usd,credit_balance_usd:d.credit_balance_usd,input_tokens:d.input_tokens,output_tokens:d.output_tokens,response_time_ms:d.response_time_ms,model_used:d.model_used,created_at:d.created_at}}}catch(a){if(a.message.startsWith("{"))throw a;throw new Error(JSON.stringify({statusCode:500,errorCode:"NETWORK_ERROR",message:a.message,retryAfter:null}))}}async releaseSession(){if(this.licenseToken)try{return(await this.api.post("/release-session",{session_token:this.sessionToken})).data}catch(e){}}async getInitConfig(){if(!this.licenseToken)throw new Error("License token is required.");try{return(await this.api.get("/init")).data}catch(e){this._handleError(e)}}async checkHealth(){try{return(await this.api.get("/health")).data}catch(e){return{status:"unhealthy",error:e.message}}}getSessionToken(){return this.sessionToken}renewSessionToken(){const e=this._generateSessionToken();this.sessionToken=e,this._saveSessionToken(this.licenseToken,e)}validateSession(){this._saveSessionToken(this.licenseToken,this.sessionToken,!0)}_handleError(e){if(e.response){const t=e.response.data,n={statusCode:e.response.status,errorCode:t.error_code||"UNKNOWN_ERROR",message:t.message||"Request failed",retryAfter:t.retry_after_seconds||null};throw new Error(JSON.stringify(n))}throw e.request?new Error(JSON.stringify({statusCode:503,errorCode:"NETWORK_ERROR",message:"No response from server",retryAfter:null})):new Error(JSON.stringify({statusCode:500,errorCode:"INTERNAL_ERROR",message:e.message,retryAfter:null}))}}const Ql=e=>"string"==typeof e,Jl=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Yl=e=>null==e?"":""+e,Gl=/###/g,Xl=e=>e&&e.indexOf("###")>-1?e.replace(Gl,"."):e,Zl=e=>!e||Ql(e),eu=(e,t,n)=>{const r=Ql(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(Zl(e))return{};const t=Xl(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return Zl(e)?{}:{obj:e,k:Xl(r[o])}},tu=(e,t,n)=>{const{obj:r,k:o}=eu(e,t,Object);if(void 0!==r||1===t.length)return void(r[o]=n);let i=t[t.length-1],a=t.slice(0,t.length-1),s=eu(e,a,Object);for(;void 0===s.obj&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),s=eu(e,a,Object),s?.obj&&void 0!==s.obj[`${s.k}.${i}`]&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=n},nu=(e,t)=>{const{obj:n,k:r}=eu(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},ru=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?Ql(e[r])||e[r]instanceof String||Ql(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):ru(e[r],t[r],n):e[r]=t[r]);return e},ou=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var iu={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const au=e=>Ql(e)?e.replace(/[&<>"'\/]/g,e=>iu[e]):e;const su=[" ",",","?","!",";"],lu=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),uu=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const r=t.split(n);let o=e;for(let i=0;i<r.length;){if(!o||"object"!=typeof o)return;let e,t="";for(let a=i;a<r.length;++a)if(a!==i&&(t+=n),t+=r[a],e=o[t],void 0!==e){if(["string","number","boolean"].indexOf(typeof e)>-1&&a<r.length-1)continue;i+=a-i+1;break}o=e}return o},cu=e=>e?.replace("_","-"),du={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){}};class fu{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||du,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(Ql(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new fu(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new fu(this.logger,e)}}var pu=new fu;class hu{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let o=0;o<r;o++)n.apply(n,[e,...t])})}}}class gu extends hu{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):Ql(n)&&o?a.push(...n.split(o)):a.push(n)));const s=nu(this.data,a);return!s&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!s&&i&&Ql(n)?uu(this.data?.[e]?.[t],n,o):s}addResource(e,t,n,r,o={silent:!1}){const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),tu(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(const o in n)(Ql(n[o])||Array.isArray(n[o]))&&this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o,i={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let s=nu(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?ru(s,n,o):s={...s,...n},tu(this.data,a,s),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var mu={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,o)??t}),t}};const yu=Symbol("i18next/PATH_KEY");function vu(e,t){const{[yu]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(r,o)=>(n?.revoke?.(),o===yu?e:(e.push(o),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return n.join(t?.keySeparator??".")}const bu={},ku=e=>!Ql(e)&&"boolean"!=typeof e&&"number"!=typeof e;class wu extends hu{constructor(e,t={}){super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=pu.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const r=this.resolve(e,n);if(void 0===r?.res)return!1;const o=ku(r.res);return!1!==n.returnObjects||!o}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=su.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const o=lu.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r));if(i&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Ql(o)?[o]:o};const i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:Ql(o)?[o]:o}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=vu(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]);const o=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],r),l=s[s.length-1];let u=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");const c=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===c?.toLowerCase())return d?o?{res:`${l}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${u}${a}`:o?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:a;const f=this.resolve(e,r);let p=f?.res;const h=f?.usedKey||a,g=f?.exactUsedKey||a,m=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==r.count&&!Ql(r.count),b=wu.hasDefaultValue(r),k=v?this.pluralResolver.getSuffix(c,r.count,r):"",w=r.ordinal&&v?this.pluralResolver.getSuffix(c,r.count,{ordinal:!1}):"",x=v&&!r.ordinal&&0===r.count,S=x&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${k}`]||r[`defaultValue${w}`]||r.defaultValue;let E=p;y&&!p&&b&&(E=S);const C=ku(E),T=Object.prototype.toString.apply(E);if(!(y&&E&&C&&["[object Number]","[object Function]","[object RegExp]"].indexOf(T)<0)||Ql(m)&&Array.isArray(E))if(y&&Ql(m)&&Array.isArray(p))p=p.join(m),p&&(p=this.extendTranslation(p,e,r,n));else{let t=!1,o=!1;!this.isValidLookup(p)&&b&&(t=!0,p=S),this.isValidLookup(p)||(o=!0,p=a);const s=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:p,d=b&&S!==p&&this.options.updateMissing;if(o||t||d){if(this.logger.log(d?"updateKey":"missingKey",c,l,a,d?S:p),i){const e=this.resolve(a,{...r,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let r=0;r<t.length;r++)e.push(t[r]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);const n=(e,t,n)=>{const o=b&&n!==p?n:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,o,d,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,o,d,r),this.emit("missingKey",e,l,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,r);x&&r[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],a+t,r[`defaultValue${t}`]||S)})}):n(e,a,S))}p=this.extendTranslation(p,e,r,f,n),o&&p===a&&this.options.appendNamespaceToMissingKey&&(p=`${l}${u}${a}`),(o||t)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${a}`:a,t?p:void 0,r))}else{if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...r,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return o?(f.res=e,f.usedParams=this.getUsedParamsDetails(r),f):e}if(i){const e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(const o in E)if(Object.prototype.hasOwnProperty.call(E,o)){const e=`${n}${i}${o}`;t[o]=b&&!p?this.translate(e,{...r,defaultValue:ku(S)?S[o]:void 0,joinArrays:!1,ns:s}):this.translate(e,{...r,joinArrays:!1,ns:s}),t[o]===e&&(t[o]=E[o])}p=t}}return o?(f.res=p,f.usedParams=this.getUsedParamsDetails(r),f):p}extendTranslation(e,t,n,r,o){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const i=Ql(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(i){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=n.replace&&!Ql(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),i){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>o?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,a=Ql(i)?[i]:i;return null!=e&&a?.length&&!1!==n.applyPostProcessor&&(e=mu.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,o,i,a;return Ql(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;const s=this.extractFromKey(e,t),l=s.key;r=l;let u=s.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const c=void 0!==t.count&&!Ql(t.count),d=c&&!t.ordinal&&0===t.count,f=void 0!==t.context&&(Ql(t.context)||"number"==typeof t.context)&&""!==t.context,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(e=>{this.isValidLookup(n)||(a=e,bu[`${p[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(a)||(bu[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(r=>{if(this.isValidLookup(n))return;i=r;const a=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,r,e,t);else{let e;c&&(e=this.pluralResolver.getSuffix(r,t.count,t));const n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(t.ordinal&&0===e.indexOf(o)&&a.push(l+e.replace(o,this.options.pluralSeparator)),a.push(l+e),d&&a.push(l+n)),f){const r=`${l}${this.options.contextSeparator||"_"}${t.context}`;a.push(r),c&&(t.ordinal&&0===e.indexOf(o)&&a.push(r+e.replace(o,this.options.pluralSeparator)),a.push(r+e),d&&a.push(r+n))}}let s;for(;s=a.pop();)this.isValidLookup(n)||(o=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:o,usedLng:i,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Ql(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}class xu{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=pu.create("languageUtils")}getScriptPartFromCode(e){if(!(e=cu(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=cu(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Ql(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(Ie){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?e:e.indexOf("-")<0&&r.indexOf("-")<0?void 0:e.indexOf("-")>0&&r.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Ql(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Ql(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):Ql(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))}),r}}const Su={zero:0,one:1,two:2,few:3,many:4,other:5},Eu={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Cu{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=pu.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=cu("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(n,{type:r})}catch(a){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Eu;if(!e.match(/-|_/))return Eu;const n=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(n,t)}return this.pluralRulesCache[o]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Su[e]-Su[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){const r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const Tu=(e,t,n,r=".",o=!0)=>{let i=((e,t,n)=>{const r=nu(e,n);return void 0!==r?r:nu(t,n)})(e,t,n);return!i&&o&&Ql(n)&&(i=uu(e,n,r),void 0===i&&(i=uu(t,n,r))),i},Nu=e=>e.replace(/\$/g,"$$$$");class Ou{constructor(e={}){this.logger=pu.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:au,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?ou(o):i||"{{",this.suffix=a?ou(a):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?ou(d):f||ou("$t("),this.nestingSuffix=p?ou(p):h||ou(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let o,i,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const o=Tu(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(Tu(t,s,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const u=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=void 0!==r?.interpolation?.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Nu(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Nu(this.escape(e)):Nu(e)}].forEach(t=>{for(a=0;o=t.regex.exec(e);){const n=o[1].trim();if(i=l(n),void 0===i)if("function"==typeof u){const t=u(e,o,r);i=Ql(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(c){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else Ql(i)||this.useRawValueToEscape||(i=Yl(i));const s=t.safeValue(i);if(e=e.replace(o[0],s),c?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,o,i;const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let o=`{${r[1]}`;e=r[0],o=this.interpolate(o,i);const a=o.match(/'/g),s=o.match(/"/g);((a?.length??0)%2==0&&!s||s.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(Ie){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,Ie),`${e}${n}${o}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];i={...n},i=i.replace&&!Ql(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;const l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(s=r[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),o=t(a.call(this,r[1].trim(),i),i),o&&r[0]===e&&!Ql(o))return o;Ql(o)||(o=Yl(o)),o||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),o=""),s.length&&(o=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),o.trim())),e=e.replace(r[0],o),this.regexp.lastIndex=0}return e}}const Pu=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const a=r+JSON.stringify(i);let s=t[a];return s||(s=e(cu(r),o),t[a]=s),s(n)}},Lu=e=>(t,n,r)=>e(cu(n),r)(t);class _u{constructor(e={}){this.logger=pu.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?Pu:Lu;this.formats={number:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Pu(t)}format(e,t,n,r={}){const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(e=>e.indexOf(")")>-1)){const e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}const i=o.reduce((e,t)=>{const{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{const a=r?.formatParams?.[r.interpolationkey]||{},s=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,s,{...i,...r,...a})}catch(a){this.logger.warn(a)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class Ru extends hu{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=pu.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){const o={},i={},a={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:o}=eu(e,t,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,o=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*o,i)},o):i(a,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,a);try{const n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(l){a(l)}}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Ql(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Ql(t)&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o,i={},a=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const l={...i,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let o;o=5===u.length?u(e,t,n,r,l):u(e,t,n,r),o&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(s){a(s)}else u(e,t,n,r,a,l)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Iu=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Ql(e[1])&&(t.defaultValue=e[1]),Ql(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Au=e=>(Ql(e.ns)&&(e.ns=[e.ns]),Ql(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ql(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),zu=()=>{};class ju extends hu{constructor(e={},t){var n;if(super(),this.options=Au(e),this.services={},this.logger=pu,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(Ql(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=Iu();this.options={...n,...this.options,...Au(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);const r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?pu.init(r(this.modules.logger),this.options):pu.init(null,this.options),e=this.modules.formatter?this.modules.formatter:_u;const t=new xu(this.options);this.store=new gu(this.options.resources,this.options);const o=this.services;o.logger=pu,o.resourceStore=this.store,o.languageUtils=t,o.pluralResolver=new Cu(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(o.formatter=r(e),o.formatter.init&&o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new Ou(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new Ru(r(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(o.languageDetector=r(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=r(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new wu(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=zu),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const o=Jl(),i=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?i():setTimeout(i,0),o}loadResources(e,t=zu){let n=t;const r=Ql(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===r?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(r)t(r);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){const r=Jl();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=zu),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&mu.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Jl();this.emit("languageChanging",e);const r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,i)=>{i?this.isLanguageChangingTo===e&&(r(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(o,(...e)=>this.t(...e))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Ql(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Ql(t)?[t]:t);i&&(this.language||r(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector?.cacheUserLanguage?.(i)),this.loadResources(i,e=>{o(e,i)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const r=(e,t,...o)=>{let i;i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(o)):{...t},i.lng=i.lng||r.lng,i.lngs=i.lngs||r.lngs,i.ns=i.ns||r.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||r.keyPrefix);const a=this.options.keySeparator||".";let s;return i.keyPrefix&&Array.isArray(e)?s=e.map(e=>("function"==typeof e&&(e=vu(e,{...this.options,...t})),`${i.keyPrefix}${a}${e}`)):("function"==typeof e&&(e=vu(e,{...this.options,...t})),s=i.keyPrefix?`${i.keyPrefix}${a}${e}`:e),this.t(s,i)};return Ql(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,e)||r&&!i(o,e)))}loadNamespaces(e,t){const n=Jl();return this.options.ns?(Ql(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Jl();Ql(e)&&(e=[e]);const r=this.options.preload||[],o=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(Ie){}const t=this.services?.languageUtils||new xu(Iu());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new ju(e,t)}cloneInstance(e={},t=zu){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new ju(r);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));if(["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{});o.store=new gu(e,r),o.services.resourceStore=o.store}return o.translator=new wu(o.services,r),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Du=ju.createInstance();Du.createInstance=ju.createInstance,Du.createInstance,Du.dir,Du.init,Du.loadResources,Du.reloadResources,Du.use,Du.changeLanguage,Du.getFixedT,Du.t,Du.exists,Du.setDefaultNamespace,Du.hasLoadedNamespace,Du.loadNamespaces,Du.loadLanguages;const{slice:Fu,forEach:Mu}=[];const Uu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Bu={create(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*n*1e3)),r&&(o.domain=r),document.cookie=function(e,t){const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let r=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){const e=n.maxAge-0;if(Number.isNaN(e))throw new Error("maxAge should be a Number");r+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!Uu.test(n.domain))throw new TypeError("option domain is invalid");r+=`; Domain=${n.domain}`}if(n.path){if(!Uu.test(n.path))throw new TypeError("option path is invalid");r+=`; Path=${n.path}`}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw new TypeError("option expires is invalid");r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return n.partitioned&&(r+="; Partitioned"),r}(e,t,o)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let e=n[r];for(;" "===e.charAt(0);)e=e.substring(1,e.length);if(0===e.indexOf(t))return e.substring(t.length,e.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var $u={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!=typeof document)return Bu.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:i}=t;n&&"undefined"!=typeof document&&Bu.create(n,e,r,o,i)}},Vu={name:"querystring",lookup(e){let t,{lookupQuerystring:n}=e;if("undefined"!=typeof window){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));const r=e.substring(1).split("&");for(let o=0;o<r.length;o++){const e=r[o].indexOf("=");if(e>0){r[o].substring(0,e)===n&&(t=r[o].substring(e+1))}}}return t}},Hu={name:"hash",lookup(e){let t,{lookupHash:n,lookupFromHashIndex:r}=e;if("undefined"!=typeof window){const{hash:e}=window.location;if(e&&e.length>2){const o=e.substring(1);if(n){const e=o.split("&");for(let r=0;r<e.length;r++){const o=e[r].indexOf("=");if(o>0){e[r].substring(0,o)===n&&(t=e[r].substring(o+1))}}}if(t)return t;if(!t&&r>-1){const t=e.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(t))return;const n="number"==typeof r?r:0;return t[n]?.replace("/","")}}}return t}};let qu=null;const Wu=()=>{if(null!==qu)return qu;try{if(qu="undefined"!=typeof window&&null!==window.localStorage,!qu)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(Ie){qu=!1}return qu};var Ku={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&Wu())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Wu()&&window.localStorage.setItem(n,e)}};let Qu=null;const Ju=()=>{if(null!==Qu)return Qu;try{if(Qu="undefined"!=typeof window&&null!==window.sessionStorage,!Qu)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(Ie){Qu=!1}return Qu};var Yu={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Ju())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Ju()&&window.sessionStorage.setItem(n,e)}},Gu={name:"navigator",lookup(e){const t=[];if("undefined"!=typeof navigator){const{languages:e,userLanguage:n,language:r}=navigator;if(e)for(let o=0;o<e.length;o++)t.push(e[o]);n&&t.push(n),r&&t.push(r)}return t.length>0?t:void 0}},Xu={name:"htmlTag",lookup(e){let t,{htmlTag:n}=e;const r=n||("undefined"!=typeof document?document.documentElement:null);return r&&"function"==typeof r.getAttribute&&(t=r.getAttribute("lang")),t}},Zu={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if("undefined"==typeof window)return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(n))return;const r="number"==typeof t?t:0;return n[r]?.replace("/","")}},ec={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n="number"==typeof t?t+1:1,r="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let tc=!1;try{document.cookie,tc=!0}catch(Ie){}const nc=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];tc||nc.splice(1,1);class rc{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=function(e){return Mu.call(Fu.call(arguments,1),t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])}),e}(t,this.options||{},{order:nc,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector($u),this.addDetector(Vu),this.addDetector(Ku),this.addDetector(Yu),this.addDetector(Gu),this.addDetector(Xu),this.addDetector(Zu),this.addDetector(ec),this.addDetector(Hu)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order,t=[];return e.forEach(e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&"string"==typeof n&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(e=>{return null!=e&&!("string"==typeof(t=e)&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(e=>e.test(t)));var t}).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)}))}}rc.type="languageDetector";const oc={widget:{title:"TIA GPC",poweredBy:"Desarrollado por TIA GPC",questionsTo:"Preguntas a"},chat:{title:"Asistente",placeholder:"Escribe tu pregunta...",send:"Enviar",close:"Cerrar",welcome:"¡Hola! Bienvenido a {{companyName}}. ¿En qué puedo ayudarte hoy?",emptyState:"Inicia una conversación escribiendo tu pregunta",validation:"Verificando seguridad...",retry:"Reintentar"},theme:{light:"Claro",dark:"Oscuro",toggle:"Cambiar tema"},errors:{unauthorized:"Autenticación fallida. Por favor, verifica tu token de licencia e intenta nuevamente.",validation:"Verificación anti-bot fallida. Por favor, recarga la página e intenta nuevamente.",network:"No se pudo conectar al servidor. Verifica tu conexión a internet.",rateLimit:"Has realizado demasiadas consultas o se alcanzó el límite de usuarios concurrentes. Por favor, espera un momento antes de continuar.",session:"Tu sesión ha expirado por inactividad. Por favor, recarga la página para continuar.",insufficientCredits:"Créditos insuficientes. Por favor, recarga créditos desde tu panel de administración para continuar usando TIA GPC.",generic:"Ha ocurrido un error inesperado. Por favor, intenta nuevamente.",aiServiceUnavailable:"El asistente está temporalmente no disponible. Por favor, intenta de nuevo en unos momentos.",serverError:"El servidor encontró un problema. Por favor, intenta de nuevo más tarde.",domainUnauthorized:"Este dominio no está autorizado para usar este widget. Por favor, contacta a tu administrador."},turnstile:{verifying:"Verificando que eres humano...",error:"No se pudo completar la verificación de seguridad. Por favor, recarga la página e intenta nuevamente."},metadata:{tokensUsed:"Tokens usados",responseTime:"Tiempo de respuesta",model:"Modelo"}},ic={widget:{title:"TIA GPC",poweredBy:"Powered by TIA GPC",questionsTo:"Questions to"},chat:{title:"Assistant",placeholder:"Type your question...",send:"Send",close:"Close",welcome:"Hello! Welcome to {{companyName}}. How can I help you today?",emptyState:"Start a conversation by typing your question",validation:"Verifying security...",retry:"Retry"},theme:{light:"Light",dark:"Dark",toggle:"Toggle theme"},errors:{unauthorized:"Authentication failed. Please check your license token and try again.",validation:"Bot verification failed. Please reload the page and try again.",network:"Unable to connect to the server. Please check your internet connection.",rateLimit:"You've made too many requests or the concurrent user limit has been reached. Please wait a moment before continuing.",session:"Your session has expired due to inactivity. Please reload the page to continue.",insufficientCredits:"Insufficient credits. Please reload credits from your admin panel to continue using TIA GPC.",generic:"An unexpected error has occurred. Please try again.",aiServiceUnavailable:"The assistant is temporarily unavailable. Please try again in a few moments.",serverError:"The server encountered a problem. Please try again later.",domainUnauthorized:"This domain is not authorized to use this widget. Please contact your administrator."},turnstile:{verifying:"Verifying you're human...",error:"Security verification could not be completed. Please reload the page and try again."},metadata:{tokensUsed:"Tokens used",responseTime:"Response time",model:"Model"}},ac={widget:{title:"TIA GPC",poweredBy:"Propulsé par TIA GPC",questionsTo:"Questions à"},chat:{title:"Assistant",placeholder:"Tapez votre question...",send:"Envoyer",close:"Fermer",welcome:"Bonjour ! Bienvenue à {{companyName}}. Comment puis-je vous aider aujourd'hui ?",emptyState:"Commencez une conversation en tapant votre question",validation:"Vérification de sécurité...",retry:"Réessayer"},theme:{light:"Clair",dark:"Sombre",toggle:"Changer de thème"},errors:{unauthorized:"Échec de l'authentification. Veuillez vérifier votre jeton de licence et réessayer.",validation:"La vérification anti-bot a échoué. Veuillez recharger la page et réessayer.",network:"Impossible de se connecter au serveur. Veuillez vérifier votre connexion internet.",rateLimit:"Vous avez fait trop de demandes ou la limite d'utilisateurs concurrents a été atteinte. Veuillez patienter un moment avant de continuer.",session:"Votre session a expiré en raison d'inactivité. Veuillez recharger la page pour continuer.",insufficientCredits:"Crédits insuffisants. Veuillez recharger des crédits depuis votre panneau d'administration pour continuer à utiliser TIA GPC.",generic:"Une erreur inattendue s'est produite. Veuillez réessayer.",aiServiceUnavailable:"L'assistant est temporairement indisponible. Veuillez réessayer dans quelques instants.",serverError:"Le serveur a rencontré un problème. Veuillez réessayer plus tard.",domainUnauthorized:"Ce domaine n'est pas autorisé à utiliser ce widget. Veuillez contacter votre administrateur."},turnstile:{verifying:"Vérification que vous êtes humain...",error:"La vérification de sécurité n'a pas pu être complétée. Veuillez recharger la page et réessayer."},metadata:{tokensUsed:"Tokens utilisés",responseTime:"Temps de réponse",model:"Modèle"}};Du.use(rc).use(M).init({resources:{en:{translation:ic},es:{translation:oc},fr:{translation:ac}},fallbackLng:"en",supportedLngs:["en","es","fr"],interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],caches:["localStorage"]}});const sc=({token:e,turnstileSiteKey:t="0x4AAAAAAB9XB2TsB-P7vbJM",theme:n=Yi,position:r=Gi,language:o=Xi,primaryColor:i,width:a=Zi,height:s=ea,apiUrl:u=qi,onReady:c,onError:d,onClose:f,autoOpen:p=ta,showBranding:h=na,mobileFullscreen:g=ra,...m})=>{const[y,v]=l.useState(p),[b,k]=l.useState(!1),[w,x]=l.useState(null),[S,E]=l.useState(!0),C=l.useMemo(()=>new Kl(u,e),[u,e]);if(l.useEffect(()=>{const e=()=>{k(window.innerWidth<Ji)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),l.useEffect(()=>{o&&Du.changeLanguage&&Du.changeLanguage(o)},[o]),l.useEffect(()=>{(async()=>{if(e)try{const e=await C.getInitConfig();e.success&&(x(e.data),c&&c(e.data))}catch(t){d&&d(t)}finally{E(!1)}else E(!1)})()},[e,C,c,d]),!e)return null;return N.jsx(H,{i18n:Du,children:N.jsxs("div",{className:`gpc-widget gpc-widget-container ${b&&g?"gpc-position-bottom-right":`gpc-position-${r}`} ${"dark"===n?"gpc-dark":""}`,style:(()=>{const e={};return i&&(e["--gpc-color-primary"]=i),b&&g||(a&&(e["--gpc-widget-width"]=a),s&&(e["--gpc-widget-height"]=s)),e})(),children:[!y&&N.jsx(ie,{onClick:()=>v(!0),widgetConfig:w}),y&&!S&&N.jsx(Ca,{gpcService:C,licenseToken:e,widgetConfig:w,turnstileSiteKey:t,onClose:()=>{v(!1),f?.()},themeMode:n,showBranding:h,showMetadata:m.showMetadata||!1,onError:d})]})})};sc.defaultProps={theme:"auto",position:"bottom-right",language:"en",width:"400px",height:"600px",autoOpen:!1,showBranding:!0,mobileFullscreen:!0};class lc extends HTMLElement{constructor(){super(),this.root=null,this.mountPoint=null}static get observedAttributes(){return["token","theme","position","language","primary-color","width","height","api-url","turnstile-site-key","auto-open","show-branding","mobile-fullscreen"]}connectedCallback(){this.mountPoint=document.createElement("div"),this.mountPoint.className="tia-gpc-mount",this.appendChild(this.mountPoint),this.root=E.createRoot(this.mountPoint),this.render()}disconnectedCallback(){this.root&&(this.root.unmount(),this.root=null)}attributeChangedCallback(e,t,n){t!==n&&this.root&&this.render()}getProps(){const e={},t=this.getAttribute("token");t&&(e.token=t);const n=this.getAttribute("theme");n&&(e.theme=n);const r=this.getAttribute("position");r&&(e.position=r);const o=this.getAttribute("language");o&&(e.language=o);const i=this.getAttribute("primary-color");i&&(e.primaryColor=i);const a=this.getAttribute("width");a&&(e.width=a);const s=this.getAttribute("height");s&&(e.height=s);const l=this.getAttribute("api-url");l&&(e.apiUrl=l);const u=this.getAttribute("turnstile-site-key");u&&(e.turnstileSiteKey=u);const c=this.getAttribute("auto-open");null!==c&&(e.autoOpen="false"!==c);const d=this.getAttribute("show-branding");null!==d&&(e.showBranding="false"!==d);const f=this.getAttribute("mobile-fullscreen");return null!==f&&(e.mobileFullscreen="false"!==f),e.onReady=()=>{this.dispatchEvent(new CustomEvent("ready",{bubbles:!0,composed:!0}))},e.onError=e=>{this.dispatchEvent(new CustomEvent("error",{bubbles:!0,composed:!0,detail:e}))},e.onClose=()=>{this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))},e}render(){if(!this.root)return;const e=this.getProps();this.root.render(u.createElement(sc,e))}open(){this.dispatchEvent(new CustomEvent("open-widget",{bubbles:!0,composed:!0}))}close(){this.dispatchEvent(new CustomEvent("close-widget",{bubbles:!0,composed:!0}))}}"undefined"==typeof window||customElements.get("tia-gpc-widget")||customElements.define("tia-gpc-widget",lc),window.TiaGPC={version:"1.0.0",POSITIONS:Wi,THEMES:Ki,LANGUAGES:Qi,create(e){if(!e||!e.token)throw new Error('TiaGPC.create(): El parámetro "token" es requerido');const t=document.createElement("tia-gpc-widget");t.setAttribute("token",e.token),e.theme&&t.setAttribute("theme",e.theme),e.position&&t.setAttribute("position",e.position),e.language&&t.setAttribute("language",e.language),e.primaryColor&&t.setAttribute("primary-color",e.primaryColor),e.width&&t.setAttribute("width",e.width),e.height&&t.setAttribute("height",e.height),e.apiUrl&&t.setAttribute("api-url",e.apiUrl),e.turnstileSiteKey&&t.setAttribute("turnstile-site-key",e.turnstileSiteKey),void 0!==e.autoOpen&&t.setAttribute("auto-open",String(e.autoOpen)),void 0!==e.showBranding&&t.setAttribute("show-branding",String(e.showBranding)),void 0!==e.mobileFullscreen&&t.setAttribute("mobile-fullscreen",String(e.mobileFullscreen)),e.onReady&&t.addEventListener("ready",e.onReady),e.onError&&t.addEventListener("error",t=>e.onError(t.detail)),e.onClose&&t.addEventListener("close",e.onClose);return(e.container||document.body).appendChild(t),t},info(){return{version:this.version,positions:this.POSITIONS,themes:this.THEMES,languages:this.LANGUAGES}}};const uc=window.TiaGPC;return e.TiaGPCWebComponent=lc,e.default=uc,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),e}({});
|
|
205
|
+
`,it=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:o,toasterId:i,containerStyle:a,containerClassName:s})=>{let{toasts:u,handlers:c}=De(n,i);return l.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...a},className:s,onMouseEnter:c.startPause,onMouseLeave:c.endPause},u.map(n=>{let i=n.position||t,a=((e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:we()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...o}})(i,c.calculateOffset(n,{reverseOrder:e,gutter:r,defaultPosition:t}));return l.createElement(rt,{id:n.id,key:n.id,onHeightUpdate:c.updateHeight,className:n.visible?ot:"",style:a},"custom"===n.type?be(n.message,n):o?o(n):l.createElement(nt,{toast:n,position:i}))}))},at=Re;const st=({theme:e,onToggle:t})=>{const{t:n}=V();return N.jsx("button",{onClick:t,className:"gpc-header-button gpc-focus-visible gpc-transition","aria-label":n("theme.toggle"),title:n("theme.toggle"),children:"light"===e?N.jsx(ne,{className:"gpc-icon"}):N.jsx(oe,{className:"gpc-icon"})})},lt=[{code:"en",label:"English",flag:"🇬🇧"},{code:"es",label:"Español",flag:"🇪🇸"},{code:"fr",label:"Français",flag:"🇫🇷"}],ut=()=>{const{i18n:e}=V(),[t,n]=l.useState(!1),r=l.useRef(null),o=lt.find(t=>t.code===e.language)||lt[0];return l.useEffect(()=>{const e=e=>{r.current&&!r.current.contains(e.target)&&n(!1)};return t&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[t]),N.jsxs("div",{className:"gpc-language-selector",ref:r,children:[N.jsx("button",{onClick:()=>n(!t),className:"gpc-header-button gpc-focus-visible gpc-transition","aria-label":"Cambiar idioma",title:"Cambiar idioma",children:N.jsx(Z,{className:"gpc-icon"})}),t&&N.jsx("div",{className:"gpc-language-dropdown",children:lt.map(t=>N.jsxs("button",{onClick:()=>{return r=t.code,e.changeLanguage(r),void n(!1);var r},className:"gpc-language-option "+(t.code===o.code?"gpc-language-option-active":""),children:[N.jsx("span",{className:"gpc-language-flag",children:t.flag}),N.jsx("span",{className:"gpc-language-label",children:t.label})]},t.code))})]})},ct=({onClose:e,theme:t,onToggleTheme:n,showBranding:r=!0,widgetConfig:o=null})=>{const{t:i}=V(),a=o?.company_name||i("widget.title"),s=o?.company_logo_base64,l=s?.startsWith("data:")?s:s?`data:image/png;base64,${s}`:null;return N.jsxs("div",{className:"gpc-chat-header",children:[N.jsxs("div",{className:"gpc-header-content",children:[l&&N.jsx("div",{className:"gpc-header-logo",children:N.jsx("img",{src:l,alt:a,className:"gpc-company-logo"})}),N.jsx("div",{className:"gpc-header-text",children:N.jsx("h2",{className:"gpc-header-title",children:a})})]}),N.jsxs("div",{className:"gpc-header-actions",children:[N.jsx(ut,{}),N.jsx(st,{theme:t,onToggle:n}),N.jsx("button",{onClick:e,className:"gpc-header-button gpc-focus-visible gpc-transition","aria-label":i("chat.close"),title:i("chat.close"),children:N.jsx(G,{className:"gpc-icon"})})]})]})};function dt(){}function ft(){}const pt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ht=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gt={};function mt(e,t){return(gt.jsx?ht:pt).test(e)}const yt=/[ \t\n\f\r]/g;function vt(e){return""===e.replace(yt,"")}class bt{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function kt(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new bt(n,r,t)}function wt(e){return e.toLowerCase()}bt.prototype.normal={},bt.prototype.property={},bt.prototype.space=void 0;class xt{constructor(e,t){this.attribute=t,this.property=e}}xt.prototype.attribute="",xt.prototype.booleanish=!1,xt.prototype.boolean=!1,xt.prototype.commaOrSpaceSeparated=!1,xt.prototype.commaSeparated=!1,xt.prototype.defined=!1,xt.prototype.mustUseProperty=!1,xt.prototype.number=!1,xt.prototype.overloadedBoolean=!1,xt.prototype.property="",xt.prototype.spaceSeparated=!1,xt.prototype.space=void 0;let St=0;const Et=_t(),Ct=_t(),Tt=_t(),Nt=_t(),Ot=_t(),Pt=_t(),Lt=_t();function _t(){return 2**++St}const Rt=Object.freeze(Object.defineProperty({__proto__:null,boolean:Et,booleanish:Ct,commaOrSpaceSeparated:Lt,commaSeparated:Pt,number:Nt,overloadedBoolean:Tt,spaceSeparated:Ot},Symbol.toStringTag,{value:"Module"})),It=Object.keys(Rt);class At extends xt{constructor(e,t,n,r){let o=-1;if(super(e,t),zt(this,"space",r),"number"==typeof n)for(;++o<It.length;){const e=It[o];zt(this,It[o],(n&Rt[e])===Rt[e])}}}function zt(e,t,n){n&&(e[t]=n)}function jt(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new At(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[wt(r)]=r,n[wt(i.attribute)]=r}return new bt(t,n,e.space)}At.prototype.defined=!0;const Dt=jt({properties:{ariaActiveDescendant:null,ariaAtomic:Ct,ariaAutoComplete:null,ariaBusy:Ct,ariaChecked:Ct,ariaColCount:Nt,ariaColIndex:Nt,ariaColSpan:Nt,ariaControls:Ot,ariaCurrent:null,ariaDescribedBy:Ot,ariaDetails:null,ariaDisabled:Ct,ariaDropEffect:Ot,ariaErrorMessage:null,ariaExpanded:Ct,ariaFlowTo:Ot,ariaGrabbed:Ct,ariaHasPopup:null,ariaHidden:Ct,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ot,ariaLevel:Nt,ariaLive:null,ariaModal:Ct,ariaMultiLine:Ct,ariaMultiSelectable:Ct,ariaOrientation:null,ariaOwns:Ot,ariaPlaceholder:null,ariaPosInSet:Nt,ariaPressed:Ct,ariaReadOnly:Ct,ariaRelevant:null,ariaRequired:Ct,ariaRoleDescription:Ot,ariaRowCount:Nt,ariaRowIndex:Nt,ariaRowSpan:Nt,ariaSelected:Ct,ariaSetSize:Nt,ariaSort:null,ariaValueMax:Nt,ariaValueMin:Nt,ariaValueNow:Nt,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function Ft(e,t){return t in e?e[t]:t}function Mt(e,t){return Ft(e,t.toLowerCase())}const Ut=jt({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Pt,acceptCharset:Ot,accessKey:Ot,action:null,allow:null,allowFullScreen:Et,allowPaymentRequest:Et,allowUserMedia:Et,alt:null,as:null,async:Et,autoCapitalize:null,autoComplete:Ot,autoFocus:Et,autoPlay:Et,blocking:Ot,capture:null,charSet:null,checked:Et,cite:null,className:Ot,cols:Nt,colSpan:null,content:null,contentEditable:Ct,controls:Et,controlsList:Ot,coords:Nt|Pt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Et,defer:Et,dir:null,dirName:null,disabled:Et,download:Tt,draggable:Ct,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Et,formTarget:null,headers:Ot,height:Nt,hidden:Tt,high:Nt,href:null,hrefLang:null,htmlFor:Ot,httpEquiv:Ot,id:null,imageSizes:null,imageSrcSet:null,inert:Et,inputMode:null,integrity:null,is:null,isMap:Et,itemId:null,itemProp:Ot,itemRef:Ot,itemScope:Et,itemType:Ot,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Et,low:Nt,manifest:null,max:null,maxLength:Nt,media:null,method:null,min:null,minLength:Nt,multiple:Et,muted:Et,name:null,nonce:null,noModule:Et,noValidate:Et,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Et,optimum:Nt,pattern:null,ping:Ot,placeholder:null,playsInline:Et,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Et,referrerPolicy:null,rel:Ot,required:Et,reversed:Et,rows:Nt,rowSpan:Nt,sandbox:Ot,scope:null,scoped:Et,seamless:Et,selected:Et,shadowRootClonable:Et,shadowRootDelegatesFocus:Et,shadowRootMode:null,shape:null,size:Nt,sizes:null,slot:null,span:Nt,spellCheck:Ct,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Nt,step:null,style:null,tabIndex:Nt,target:null,title:null,translate:null,type:null,typeMustMatch:Et,useMap:null,value:Ct,width:Nt,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ot,axis:null,background:null,bgColor:null,border:Nt,borderColor:null,bottomMargin:Nt,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Et,declare:Et,event:null,face:null,frame:null,frameBorder:null,hSpace:Nt,leftMargin:Nt,link:null,longDesc:null,lowSrc:null,marginHeight:Nt,marginWidth:Nt,noResize:Et,noHref:Et,noShade:Et,noWrap:Et,object:null,profile:null,prompt:null,rev:null,rightMargin:Nt,rules:null,scheme:null,scrolling:Ct,standby:null,summary:null,text:null,topMargin:Nt,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Nt,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Et,disableRemotePlayback:Et,prefix:null,property:null,results:Nt,security:null,unselectable:null},space:"html",transform:Mt}),Bt=jt({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Lt,accentHeight:Nt,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Nt,amplitude:Nt,arabicForm:null,ascent:Nt,attributeName:null,attributeType:null,azimuth:Nt,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Nt,by:null,calcMode:null,capHeight:Nt,className:Ot,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Nt,diffuseConstant:Nt,direction:null,display:null,dur:null,divisor:Nt,dominantBaseline:null,download:Et,dx:null,dy:null,edgeMode:null,editable:null,elevation:Nt,enableBackground:null,end:null,event:null,exponent:Nt,externalResourcesRequired:null,fill:null,fillOpacity:Nt,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Pt,g2:Pt,glyphName:Pt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Nt,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Nt,horizOriginX:Nt,horizOriginY:Nt,id:null,ideographic:Nt,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Nt,k:Nt,k1:Nt,k2:Nt,k3:Nt,k4:Nt,kernelMatrix:Lt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Nt,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Nt,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Nt,overlineThickness:Nt,paintOrder:null,panose1:null,path:null,pathLength:Nt,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ot,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Nt,pointsAtY:Nt,pointsAtZ:Nt,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Lt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Lt,rev:Lt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Lt,requiredFeatures:Lt,requiredFonts:Lt,requiredFormats:Lt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Nt,specularExponent:Nt,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Nt,strikethroughThickness:Nt,string:null,stroke:null,strokeDashArray:Lt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Nt,strokeOpacity:Nt,strokeWidth:null,style:null,surfaceScale:Nt,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Lt,tabIndex:Nt,tableValues:null,target:null,targetX:Nt,targetY:Nt,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Lt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Nt,underlineThickness:Nt,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Nt,values:null,vAlphabetic:Nt,vMathematical:Nt,vectorEffect:null,vHanging:Nt,vIdeographic:Nt,version:null,vertAdvY:Nt,vertOriginX:Nt,vertOriginY:Nt,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Nt,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ft}),$t=jt({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),Vt=jt({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Mt}),Ht=jt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),qt={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Wt=/[A-Z]/g,Kt=/-[a-z]/g,Qt=/^data[-\w.:]+$/i;function Jt(e){return"-"+e.toLowerCase()}function Yt(e){return e.charAt(1).toUpperCase()}const Gt=kt([Dt,Ut,$t,Vt,Ht],"html"),Xt=kt([Dt,Bt,$t,Vt,Ht],"svg");var Zt,en,tn,nn={};function rn(){if(tn)return nn;tn=1;var e=nn&&nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nn,"__esModule",{value:!0}),nn.default=function(e,n){let r=null;if(!e||"string"!=typeof e)return r;const o=(0,t.default)(e),i="function"==typeof n;return o.forEach(e=>{if("declaration"!==e.type)return;const{property:t,value:o}=e;i?n(t,o,e):o&&(r=r||{},r[t]=o)}),r};const t=e(function(){if(en)return Zt;en=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l="";function u(e){return e?e.replace(s,l):l}return Zt=function(s,c){if("string"!=typeof s)throw new TypeError("First argument must be a string");if(!s)return[];c=c||{};var d=1,f=1;function p(e){var n=e.match(t);n&&(d+=n.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function h(){var e={line:d,column:f};return function(t){return t.position=new g(e),v(),t}}function g(e){this.start=e,this.end={line:d,column:f},this.source=c.source}function m(e){var t=new Error(c.source+":"+d+":"+f+": "+e);if(t.reason=e,t.filename=c.source,t.line=d,t.column=f,t.source=s,!c.silent)throw t}function y(e){var t=e.exec(s);if(t){var n=t[0];return p(n),s=s.slice(n.length),t}}function v(){y(n)}function b(e){var t;for(e=e||[];t=k();)!1!==t&&e.push(t);return e}function k(){var e=h();if("/"==s.charAt(0)&&"*"==s.charAt(1)){for(var t=2;l!=s.charAt(t)&&("*"!=s.charAt(t)||"/"!=s.charAt(t+1));)++t;if(t+=2,l===s.charAt(t-1))return m("End of comment missing");var n=s.slice(2,t-2);return f+=2,p(n),s=s.slice(t),f+=2,e({type:"comment",comment:n})}}function w(){var t=h(),n=y(r);if(n){if(k(),!y(o))return m("property missing ':'");var s=y(i),c=t({type:"declaration",property:u(n[0].replace(e,l)),value:s?u(s[0].replace(e,l)):l});return y(a),c}}return g.prototype.content=s,v(),function(){var e,t=[];for(b(t);e=w();)!1!==e&&(t.push(e),b(t));return t}()}}());return nn}var on,an,sn,ln={};function un(){if(on)return ln;on=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(e,t){return t.toUpperCase()},a=function(e,t){return"".concat(t,"-")};return ln.camelCase=function(s,l){return void 0===l&&(l={}),function(t){return!t||n.test(t)||e.test(t)}(s)?s:(s=s.toLowerCase(),(s=l.reactCompat?s.replace(o,a):s.replace(r,a)).replace(t,i))},ln}const cn=t(function(){if(sn)return an;sn=1;var e=(an&&an.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(rn()),t=un();function n(n,r){var o={};return n&&"string"==typeof n?((0,e.default)(n,function(e,n){e&&n&&(o[(0,t.camelCase)(e,r)]=n)}),o):o}return n.default=n,an=n}()),dn=pn("end"),fn=pn("start");function pn(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function hn(e){return e&&"object"==typeof e?"position"in e||"type"in e?mn(e.position):"start"in e||"end"in e?mn(e):"line"in e||"column"in e?gn(e):"":""}function gn(e){return yn(e&&e.line)+":"+yn(e&&e.column)}function mn(e){return gn(e&&e.start)+"-"+gn(e&&e.end)}function yn(e){return e&&"number"==typeof e?e:1}class vn extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},i=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(i=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=hn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vn.prototype.file="",vn.prototype.name="",vn.prototype.reason="",vn.prototype.message="",vn.prototype.stack="",vn.prototype.column=void 0,vn.prototype.line=void 0,vn.prototype.ancestors=void 0,vn.prototype.cause=void 0,vn.prototype.fatal=void 0,vn.prototype.place=void 0,vn.prototype.ruleId=void 0,vn.prototype.source=void 0;const bn={}.hasOwnProperty,kn=new Map,wn=/[A-Z]/g,xn=new Set(["table","tbody","thead","tfoot","tr"]),Sn=new Set(["td","th"]),En="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Cn(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,i){const a=Array.isArray(o.children),s=fn(n);return t(r,o,i,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,i){const a=Array.isArray(o.children)?n:t;return i?a(r,o,i):a(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?Xt:Gt,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},i=Tn(o,e,void 0);return i&&"string"!=typeof i?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Tn(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=Xt,e.schema=o);e.ancestors.push(t);const i=_n(e,t.tagName,!1),a=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&bn.call(t.properties,o)){const i=Ln(e,o,t.properties[o]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof a&&Sn.has(t.tagName)?r=a:n[o]=a}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=Pn(e,t);xn.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&vt(t.value):vt(t));var t}));return Nn(e,a,i,t),On(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Rn(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=Xt,e.schema=o);e.ancestors.push(t);const i=null===t.name?e.Fragment:_n(e,t.name,!0),a=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];dt(t.type);const o=t.expression;dt(o.type);const i=o.properties[0];dt(i.type),Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else Rn(e,t.position);else{const o=r.name;let i;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];dt(t.type),i=e.evaluater.evaluateExpression(t.expression)}else Rn(e,t.position);else i=null===r.value||r.value;n[o]=i}return n}(e,t),s=Pn(e,t);return Nn(e,a,i,t),On(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rn(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return On(r,Pn(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Nn(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function On(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Pn(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:kn;for(;++r<t.children.length;){const i=t.children[r];let a;if(e.passKeys){const e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){const t=o.get(e)||0;a=e+"-"+t,o.set(e,t+1)}}const s=Tn(e,i,a);void 0!==s&&n.push(s)}return n}function Ln(e,t,n){const r=function(e,t){const n=wt(t);let r=t,o=xt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Qt.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(Kt,Yt);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!Kt.test(e)){let n=e.replace(Wt,Jt);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=At}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return cn(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const t=n,r=new vn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:t,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=En+"#cannot-parse-style-attribute",r}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)bn.call(e,n)&&(t[In(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?qt[r.property]||r.property:r.attribute,n]}}function _n(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=mt(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(o&&"Literal"===t.type),optional:!1}:t}r=n}else r=mt(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return bn.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rn(e)}function Rn(e,t){const n=new vn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=En+"#cannot-handle-mdx-estrees-without-createevaluater",n}function In(e){let t=e.replace(wn,An);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function An(e){return"-"+e.toLowerCase()}const zn={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},jn={};function Dn(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Fn(e.children,t,n)}return Array.isArray(e)?Fn(e,t,n):""}function Fn(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Dn(e[o],t,n);return r.join("")}const Mn=document.createElement("i");function Un(e){const t="&"+e+";";Mn.innerHTML=t;const n=Mn.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}function Bn(e,t,n,r){const o=e.length;let i,a=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<r.length;)i=r.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function $n(e,t){return e.length>0?(Bn(e,e.length,0,t),e):t}const Vn={}.hasOwnProperty;function Hn(e,t){let n;for(n in t){const r=(Vn.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){Vn.call(r,i)||(r[i]=[]);const e=o[i];qn(r[i],Array.isArray(e)?e:e?[e]:[])}}}function qn(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);Bn(e,0,0,r)}function Wn(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function Kn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Qn=ar(/[A-Za-z]/),Jn=ar(/[\dA-Za-z]/),Yn=ar(/[#-'*+\--9=?A-Z^-~]/);function Gn(e){return null!==e&&(e<32||127===e)}const Xn=ar(/\d/),Zn=ar(/[\dA-Fa-f]/),er=ar(/[!-/:-@[-`{-~]/);function tr(e){return null!==e&&e<-2}function nr(e){return null!==e&&(e<0||32===e)}function rr(e){return-2===e||-1===e||32===e}const or=ar(new RegExp("\\p{P}|\\p{S}","u")),ir=ar(/\s/);function ar(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function sr(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(37===i&&Jn(e.charCodeAt(n+1))&&Jn(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(a=String.fromCharCode(i,t),o=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function lr(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){if(rr(r))return e.enter(n),a(r);return t(r)};function a(r){return rr(r)&&i++<o?(e.consume(r),a):(e.exit(n),t(r))}}const ur={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),lr(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):tr(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const cr={tokenize:function(e){const t=this,n=[];let r,o,i,a=0;return s;function s(r){if(a<n.length){const o=n[a];return t.containerState=o[1],e.attempt(o[0].continuation,l,u)(r)}return u(r)}function l(e){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}y(a);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Bn(t.events,i+1,0,t.events.slice(n)),t.events.length=s,u(e)}return s(e)}function u(o){if(a===n.length){if(!r)return f(o);if(r.currentConstruct&&r.currentConstruct.concrete)return h(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dr,c,d)(o)}function c(e){return r&&v(),y(a),f(e)}function d(e){return t.parser.lazy[t.now().line]=a!==n.length,i=t.now().offset,h(e)}function f(n){return t.containerState={},e.attempt(dr,p,h)(n)}function p(e){return a++,n.push([t.currentConstruct,t.containerState]),f(e)}function h(n){return null===n?(r&&v(),y(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),g(n))}function g(n){return null===n?(m(e.exit("chunkFlow"),!0),y(0),void e.consume(n)):tr(n)?(e.consume(n),m(e.exit("chunkFlow")),a=0,t.interrupt=void 0,s):(e.consume(n),g)}function m(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){s=t.events[l][1].end;break}o=!0}for(y(a),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;Bn(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function y(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},dr={tokenize:function(e,t,n){return lr(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function fr(e){return null===e||nr(e)||ir(e)?1:or(e)?2:void 0}function pr(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const hr={name:"attention",resolveAll:function(e,t){let n,r,o,i,a,s,l,u,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close)for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;const d={...e[n][1].end},f={...e[c][1].start};gr(d,-s),gr(f,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:f},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[c][1].start={...a.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=$n(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=$n(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=$n(l,pr(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),l=$n(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(u=2,l=$n(l,[["enter",e[c][1],t],["exit",e[c][1],t]])):u=0,Bn(e,n-1,c-n+3,l),c=n+l.length-u-2;break}c=-1;for(;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=fr(r);let i;return function(t){return i=t,e.enter("attentionSequence"),a(t)};function a(s){if(s===i)return e.consume(s),a;const l=e.exit("attentionSequence"),u=fr(s),c=!u||2===u&&o||n.includes(s),d=!o||2===o&&u||n.includes(r);return l._open=Boolean(42===i?c:c&&(o||!d)),l._close=Boolean(42===i?d:d&&(u||!c)),t(s)}}};function gr(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const mr={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return Qn(t)?(e.consume(t),i):64===t?n(t):l(t)}function i(e){return 43===e||45===e||46===e||Jn(e)?(r=1,a(e)):l(e)}function a(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||Jn(t))&&r++<32?(e.consume(t),a):(r=0,l(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||Gn(r)?n(r):(e.consume(r),s)}function l(t){return 64===t?(e.consume(t),u):Yn(t)?(e.consume(t),l):n(t)}function u(e){return Jn(e)?c(e):n(e)}function c(n){return 46===n?(e.consume(n),r=0,u):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||Jn(t))&&r++<63){const n=45===t?d:c;return e.consume(t),n}return n(t)}}};const yr={partial:!0,tokenize:function(e,t,n){return function(t){return rr(t)?lr(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||tr(e)?t(e):n(e)}}};const vr={continuation:{tokenize:function(e,t,n){const r=this;return function(t){if(rr(t))return lr(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return o(t)};function o(r){return e.attempt(vr,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return rr(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const br={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return er(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const kr={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,i,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,i=Jn,u(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=Zn,u):(e.enter("characterReferenceValue"),o=7,i=Xn,u(t))}function u(s){if(59===s&&a){const o=e.exit("characterReferenceValue");return i!==Jn||Un(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&a++<o?(e.consume(s),u):n(s)}}};const wr={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},xr={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return a;function a(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l}function l(t){return e.enter("codeFencedFence"),rr(t)?lr(e,u,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):u(t)}function u(t){return t===i?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===i?(o++,e.consume(t),c):o>=s?(e.exit("codeFencedFenceSequence"),rr(t)?lr(e,d,"whitespace")(t):d(t)):n(t)}function d(r){return null===r||tr(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let i,a=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===i?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),rr(t)?lr(e,u,"whitespace")(t):u(t))}function u(n){return null===n||tr(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(wr,p,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),c(n))}function c(t){return null===t||tr(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(t)):rr(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),lr(e,d,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),c)}function d(t){return null===t||tr(t)?u(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(t))}function f(t){return null===t||tr(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(t)):96===t&&t===i?n(t):(e.consume(t),f)}function p(t){return e.attempt(o,v,h)(t)}function h(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),g}function g(t){return a>0&&rr(t)?lr(e,m,"linePrefix",a+1)(t):m(t)}function m(t){return null===t||tr(t)?e.check(wr,p,v)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||tr(t)?(e.exit("codeFlowValue"),m(t)):(e.consume(t),y)}function v(n){return e.exit("codeFenced"),t(n)}}};const Sr={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),lr(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?s(t):tr(t)?e.attempt(Er,i,s)(t):(e.enter("codeFlowValue"),a(t))}function a(t){return null===t||tr(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),a)}function s(n){return e.exit("codeIndented"),t(n)}}},Er={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):tr(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):lr(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):tr(e)?o(e):n(e)}}};const Cr={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}t=o-1,r++;for(;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),a(t)};function a(t){return 96===t?(e.consume(t),i++,a):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(o=e.enter("codeTextSequence"),r=0,u(t)):tr(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||tr(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),l)}function u(n){return 96===n?(e.consume(n),r++,u):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",l(n))}}};class Tr{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&Nr(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Nr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Nr(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);Nr(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Nr(this.left,t.reverse())}}}function Nr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Or(e){const t={};let n,r,o,i,a,s,l,u=-1;const c=new Tr(e);for(;++u<c.length;){for(;u in t;)u=t[u];if(n=c.get(u),u&&"chunkFlow"===n[1].type&&"listItemPrefix"===c.get(u-1)[1].type&&(s=n[1]._tokenizer.events,o=0,o<s.length&&"lineEndingBlank"===s[o][1].type&&(o+=2),o<s.length&&"content"===s[o][1].type))for(;++o<s.length&&"content"!==s[o][1].type;)"chunkText"===s[o][1].type&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Pr(c,u)),u=t[u],l=!0);else if(n[1]._container){for(o=u,r=void 0;o--;)if(i=c.get(o),"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(r&&(c.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if("linePrefix"!==i[1].type&&"listItemIndent"!==i[1].type)break;r&&(n[1].end={...c.get(r)[1].start},a=c.slice(r,u),a.unshift(n),c.splice(r,u-r+1,a))}}return Bn(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function Pr(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],u={};let c,d,f=-1,p=n,h=0,g=0;const m=[g];for(;p;){for(;e.get(++o)[1]!==p;);i.push(o),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),d&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(c),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)"exit"===s[f][0]&&"enter"===s[f-1][0]&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(g=f+1,m.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):m.pop(),f=m.length;f--;){const t=s.slice(m[f],m[f+1]),n=i.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),f=-1;++f<l.length;)u[h+l[f][0]]=h+l[f][1],h+=l[f][1]-l[f][0]-1;return u}const Lr={resolve:function(e){return Or(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):tr(t)?e.check(_r,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},_r={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),lr(e,o,"linePrefix")};function o(o){if(null===o||tr(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function Rr(e,t,n,r,o,i,a,s,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return function(t){if(60===t)return e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),d;if(null===t||32===t||41===t||Gn(t))return n(t);return e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(t)};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),f(n))}function f(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||tr(t)?n(t):(e.consume(t),92===t?p:f)}function p(t){return 60===t||62===t||92===t?(e.consume(t),f):f(t)}function h(o){return c||null!==o&&41!==o&&!nr(o)?c<u&&40===o?(e.consume(o),c++,h):41===o?(e.consume(o),c--,h):null===o||32===o||40===o||Gn(o)?n(o):(e.consume(o),92===o?g:h):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o))}function g(t){return 40===t||41===t||92===t?(e.consume(t),h):h(t)}}function Ir(e,t,n,r,o,i){const a=this;let s,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),u};function u(d){return l>999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):tr(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(t){return null===t||91===t||93===t||tr(t)||l++>999?(e.exit("chunkString"),u(t)):(e.consume(t),s||(s=!rr(t)),92===t?d:c)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}}function Ar(e,t,n,r,o,i){let a;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(o),e.consume(t),e.exit(o),a=40===t?41:t,s;return n(t)};function s(n){return n===a?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===a?(e.exit(i),s(a)):null===t?n(t):tr(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),lr(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===a||null===t||tr(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?c:u)}function c(t){return t===a||92===t?(e.consume(t),u):u(t)}}function zr(e,t){let n;return function r(o){if(tr(o))return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r;if(rr(o))return lr(e,r,n?"linePrefix":"lineSuffix")(o);return t(o)}}const jr={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return Ir.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=Kn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return nr(t)?zr(e,s)(t):s(t)}function s(t){return Rr(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(Dr,u,u)(t)}function u(t){return rr(t)?lr(e,c,"whitespace")(t):c(t)}function c(i){return null===i||tr(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}},Dr={partial:!0,tokenize:function(e,t,n){return function(t){return nr(t)?zr(e,r)(t):n(t)};function r(t){return Ar(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return rr(t)?lr(e,i,"whitespace")(t):i(t)}function i(e){return null===e||tr(e)?t(e):n(e)}}};const Fr={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return tr(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const Mr={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,i=3;"whitespace"===e[i][1].type&&(i+=2);o-2>i&&"whitespace"===e[o][1].type&&(o-=2);"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4);o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},Bn(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||nr(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||tr(n)?(e.exit("atxHeading"),t(n)):rr(n)?lr(e,i,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),i(t))}function s(t){return null===t||35===t||nr(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),s)}}};const Ur=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Br=["pre","script","style","textarea"],$r={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},tokenize:function(e,t,n){const r=this;let o,i,a,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),u}(t)};function u(s){return 33===s?(e.consume(s),c):47===s?(e.consume(s),i=!0,p):63===s?(e.consume(s),o=3,r.interrupt?t:A):Qn(s)?(e.consume(s),a=String.fromCharCode(s),h):n(s)}function c(i){return 45===i?(e.consume(i),o=2,d):91===i?(e.consume(i),o=5,s=0,f):Qn(i)?(e.consume(i),o=4,r.interrupt?t:A):n(i)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:A):n(o)}function f(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:T:f):n(o)}function p(t){return Qn(t)?(e.consume(t),a=String.fromCharCode(t),h):n(t)}function h(s){if(null===s||47===s||62===s||nr(s)){const l=47===s,u=a.toLowerCase();return l||i||!Br.includes(u)?Ur.includes(a.toLowerCase())?(o=6,l?(e.consume(s),g):r.interrupt?t(s):T(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?m(s):y(s)):(o=1,r.interrupt?t(s):T(s))}return 45===s||Jn(s)?(e.consume(s),a+=String.fromCharCode(s),h):n(s)}function g(o){return 62===o?(e.consume(o),r.interrupt?t:T):n(o)}function m(t){return rr(t)?(e.consume(t),m):E(t)}function y(t){return 47===t?(e.consume(t),E):58===t||95===t||Qn(t)?(e.consume(t),v):rr(t)?(e.consume(t),y):E(t)}function v(t){return 45===t||46===t||58===t||95===t||Jn(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),k):rr(t)?(e.consume(t),b):y(t)}function k(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,w):rr(t)?(e.consume(t),k):x(t)}function w(t){return t===l?(e.consume(t),l=null,S):null===t||tr(t)?n(t):(e.consume(t),w)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||nr(t)?b(t):(e.consume(t),x)}function S(e){return 47===e||62===e||rr(e)?y(e):n(e)}function E(t){return 62===t?(e.consume(t),C):n(t)}function C(t){return null===t||tr(t)?T(t):rr(t)?(e.consume(t),C):n(t)}function T(t){return 45===t&&2===o?(e.consume(t),L):60===t&&1===o?(e.consume(t),_):62===t&&4===o?(e.consume(t),z):63===t&&3===o?(e.consume(t),A):93===t&&5===o?(e.consume(t),I):!tr(t)||6!==o&&7!==o?null===t||tr(t)?(e.exit("htmlFlowData"),N(t)):(e.consume(t),T):(e.exit("htmlFlowData"),e.check(Vr,j,N)(t))}function N(t){return e.check(Hr,O,j)(t)}function O(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),P}function P(t){return null===t||tr(t)?N(t):(e.enter("htmlFlowData"),T(t))}function L(t){return 45===t?(e.consume(t),A):T(t)}function _(t){return 47===t?(e.consume(t),a="",R):T(t)}function R(t){if(62===t){const n=a.toLowerCase();return Br.includes(n)?(e.consume(t),z):T(t)}return Qn(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),R):T(t)}function I(t){return 93===t?(e.consume(t),A):T(t)}function A(t){return 62===t?(e.consume(t),z):45===t&&2===o?(e.consume(t),A):T(t)}function z(t){return null===t||tr(t)?(e.exit("htmlFlowData"),j(t)):(e.consume(t),z)}function j(n){return e.exit("htmlFlow"),t(n)}}},Vr={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(yr,t,n)}}},Hr={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(tr(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o;return n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const qr={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,i,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),k):63===t?(e.consume(t),v):Qn(t)?(e.consume(t),S):n(t)}function l(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),i=0,p):Qn(t)?(e.consume(t),y):n(t)}function u(t){return 45===t?(e.consume(t),f):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),d):tr(t)?(a=c,R(t)):(e.consume(t),c)}function d(t){return 45===t?(e.consume(t),f):c(t)}function f(e){return 62===e?_(e):45===e?d(e):c(e)}function p(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?h:p):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),g):tr(t)?(a=h,R(t)):(e.consume(t),h)}function g(t){return 93===t?(e.consume(t),m):h(t)}function m(t){return 62===t?_(t):93===t?(e.consume(t),m):h(t)}function y(t){return null===t||62===t?_(t):tr(t)?(a=y,R(t)):(e.consume(t),y)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):tr(t)?(a=v,R(t)):(e.consume(t),v)}function b(e){return 62===e?_(e):v(e)}function k(t){return Qn(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||Jn(t)?(e.consume(t),w):x(t)}function x(t){return tr(t)?(a=x,R(t)):rr(t)?(e.consume(t),x):_(t)}function S(t){return 45===t||Jn(t)?(e.consume(t),S):47===t||62===t||nr(t)?E(t):n(t)}function E(t){return 47===t?(e.consume(t),_):58===t||95===t||Qn(t)?(e.consume(t),C):tr(t)?(a=E,R(t)):rr(t)?(e.consume(t),E):_(t)}function C(t){return 45===t||46===t||58===t||95===t||Jn(t)?(e.consume(t),C):T(t)}function T(t){return 61===t?(e.consume(t),N):tr(t)?(a=T,R(t)):rr(t)?(e.consume(t),T):E(t)}function N(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,O):tr(t)?(a=N,R(t)):rr(t)?(e.consume(t),N):(e.consume(t),P)}function O(t){return t===o?(e.consume(t),o=void 0,L):null===t?n(t):tr(t)?(a=O,R(t)):(e.consume(t),O)}function P(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||nr(t)?E(t):(e.consume(t),P)}function L(e){return 47===e||62===e||nr(e)?E(e):n(e)}function _(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function R(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),I}function I(t){return rr(t)?lr(e,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):A(t)}function A(t){return e.enter("htmlTextData"),a(t)}}};const Wr={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}e.length!==n.length&&Bn(e,0,e.length,n);return e},resolveTo:function(e,t){let n,r,o,i,a=e.length,s=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(o=a);const l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",l,t],["enter",u,t]],i=$n(i,e.slice(r+1,r+s+3)),i=$n(i,[["enter",c,t]]),i=$n(i,pr(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=$n(i,[["exit",c,t],e[o-2],e[o-1],["exit",u,t]]),i=$n(i,e.slice(o+1)),i=$n(i,[["exit",l,t]]),Bn(e,r,e.length,i),e},tokenize:function(e,t,n){const r=this;let o,i,a=r.events.length;for(;a--;)if(("labelImage"===r.events[a][1].type||"labelLink"===r.events[a][1].type)&&!r.events[a][1]._balanced){o=r.events[a][1];break}return function(t){if(!o)return n(t);if(o._inactive)return c(t);return i=r.parser.defined.includes(Kn(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s};function s(t){return 40===t?e.attempt(Kr,u,i?u:c)(t):91===t?e.attempt(Qr,u,i?l:c)(t):i?u(t):c(t)}function l(t){return e.attempt(Jr,u,c)(t)}function u(e){return t(e)}function c(e){return o._balanced=!0,n(e)}}},Kr={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return nr(t)?zr(e,o)(t):o(t)}function o(t){return 41===t?u(t):Rr(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return nr(t)?zr(e,s)(t):u(t)}function a(e){return n(e)}function s(t){return 34===t||39===t||40===t?Ar(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):u(t)}function l(t){return nr(t)?zr(e,u)(t):u(t)}function u(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},Qr={tokenize:function(e,t,n){const r=this;return function(t){return Ir.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(Kn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},Jr={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const Yr={name:"labelStartImage",resolveAll:Wr.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const Gr={name:"labelStartLink",resolveAll:Wr.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const Xr={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),lr(e,t,"linePrefix")}}};const Zr={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),a(i)):o>=3&&(null===i||tr(i))?(e.exit("thematicBreak"),t(i)):n(i)}function a(t){return t===r?(e.consume(t),o++,a):(e.exit("thematicBreakSequence"),rr(t)?lr(e,i,"whitespace")(t):i(t))}}};const eo={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yr,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,lr(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){if(r.containerState.furtherBlankLines||!rr(n))return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n);return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(no,t,o)(n)});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,lr(e,e.attempt(eo,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,a=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:Xn(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(Zr,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return Xn(t)&&++a<10?(e.consume(t),s):(!r.interrupt||a<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(yr,r.interrupt?n:u,e.attempt(to,d,c))}function u(e){return r.containerState.initialBlankLine=!0,i++,d(e)}function c(t){return rr(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},to={partial:!0,tokenize:function(e,t,n){const r=this;return lr(e,function(e){const o=r.events[r.events.length-1];return!rr(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},no={partial:!0,tokenize:function(e,t,n){const r=this;return lr(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const ro={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);const a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",a,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=a;return e.push(["exit",a,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let a,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){a="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||a))return e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t);return n(t)};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),rr(t)?lr(e,a,"lineSuffix")(t):a(t))}function a(r){return null===r||tr(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const oo={tokenize:function(e){const t=this,n=e.attempt(yr,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,lr(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Lr,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const io={resolveAll:uo()},ao=lo("string"),so=lo("text");function lo(e){return{resolveAll:uo("text"===e?co:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,a);return i;function i(e){return l(e)?o(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function uo(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function co(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,a=o.length,s=-1,l=0;for(;a--;){const e=o[a];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)l++,s--;if(s)break;s=-1}else if(-2===e)i=!0,l++;else if(-1!==e){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const o={type:n===e.length||i||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const fo={42:eo,43:eo,45:eo,48:eo,49:eo,50:eo,51:eo,52:eo,53:eo,54:eo,55:eo,56:eo,57:eo,62:vr},po={91:jr},ho={[-2]:Sr,[-1]:Sr,32:Sr},go={35:Mr,42:Zr,45:[ro,Zr],60:$r,61:ro,95:Zr,96:xr,126:xr},mo={38:kr,92:br},yo={[-5]:Xr,[-4]:Xr,[-3]:Xr,33:Yr,38:kr,42:hr,60:[mr,qr],91:Gr,92:[Fr,br],93:Wr,95:hr,96:Cr},vo={null:[hr,io]},bo=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:po,disable:{null:[]},document:fo,flow:go,flowInitial:ho,insideSpan:vo,string:mo,text:yo},Symbol.toStringTag,{value:"Module"}));function ko(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let a=[],s=[];const l={attempt:m(function(e,t){y(e,t.from)}),check:m(g),consume:function(e){tr(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,v()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++));u.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=f(),u.events.push(["enter",n,u]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=f(),u.events.push(["exit",t,u]),t},interrupt:m(g,{interrupt:!0})},u={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,v()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if("string"==typeof i)a=i;else switch(i){case-5:a="\r";break;case-4:a="\n";break;case-3:a="\r\n";break;case-2:a=t?" ":"\t";break;case-1:if(!t&&o)continue;a=" ";break;default:a=String.fromCharCode(i)}o=-2===i,r.push(a)}return r.join("")}(d(e),t)},sliceStream:d,write:function(e){if(a=$n(a,e),p(),null!==a[a.length-1])return[];return y(t,0),u.events=pr(i,u.events,u),u.events}};let c=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function d(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const e=a[0];"string"==typeof e?a[0]=e.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}(a,e)}function f(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function p(){let e;for(;r._index<a.length;){const t=a[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)h(t.charCodeAt(r._bufferIndex));else h(t)}}function h(e){c=c(e)}function g(e,t){t.restore()}function m(e,t){return function(n,o,i){let a,c,d,p;return Array.isArray(n)?h(n):"tokenize"in n?h([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return h([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function h(e){return a=e,c=0,0===e.length?i:g(e[c])}function g(e){return function(n){p=function(){const e=f(),t=u.previous,n=u.currentConstruct,o=u.events.length,i=Array.from(s);return{from:o,restore:a};function a(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=o,s=i,v()}}(),d=e,e.partial||(u.currentConstruct=e);if(e.name&&u.parser.constructs.disable.null.includes(e.name))return y();return e.tokenize.call(t?Object.assign(Object.create(u),t):u,l,m,y)(n)}}function m(t){return e(d,p),o}function y(e){return p.restore(),++c<a.length?g(a[c]):i}}}function y(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&Bn(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function v(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function wo(e){const t={constructs:function(e){const t={};let n=-1;for(;++n<e.length;)Hn(t,e[n]);return t}([bo,...(e||{}).extensions||[]]),content:n(ur),defined:[],document:n(cr),flow:n(oo),lazy:{},string:n(ao),text:n(so)};return t;function n(e){return function(n){return ko(t,e,n)}}}const xo=/[\0\t\n\r]/g;const So=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Eo(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return Wn(n.slice(t?2:1),t?16:10)}return Un(n)||e}const Co={}.hasOwnProperty;function To(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(te),autolinkProtocol:C,autolinkEmail:C,atxHeading:i(G),blockQuote:i(W),characterEscape:C,characterReference:C,codeFenced:i(K),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(K,a),codeText:i(Q,a),codeTextData:C,data:C,codeFlowValue:C,definition:i(J),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(Y),hardBreakEscape:i(X),hardBreakTrailing:i(X),htmlFlow:i(Z,a),htmlFlowData:C,htmlText:i(Z,a),htmlTextData:C,image:i(ee),label:a,link:i(te),listItem:i(re),listItemValue:f,listOrdered:i(ne,d),listUnordered:i(ne),paragraph:i(oe),reference:M,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(G),strong:i(ie),thematicBreak:i(se)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:q,autolinkProtocol:H,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:B,characterReferenceMarkerNumeric:B,characterReferenceValue:$,characterReference:V,codeFenced:l(m),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:h,codeFlowValue:T,codeIndented:l(y),codeText:l(_),codeTextData:T,data:T,definition:l(),definitionDestinationString:k,definitionLabelString:v,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(O),hardBreakTrailing:l(O),htmlFlow:l(P),htmlFlowData:T,htmlText:l(L),htmlTextData:T,image:l(I),label:z,labelText:A,lineEnding:N,link:l(R),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:U,resourceDestinationString:j,resourceTitleString:D,resource:F,setextHeading:l(E),setextHeadingLineSequence:S,setextHeadingText:x,strong:l(),thematicBreak:l()}};Oo(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const i={stack:[r],tokenStack:[],config:t,enter:s,exit:u,buffer:a,resume:c,data:n},l=[];let d=-1;for(;++d<e.length;)if("listOrdered"===e[d][1].type||"listUnordered"===e[d][1].type)if("enter"===e[d][0])l.push(d);else{d=o(e,l.pop(),d)}for(d=-1;++d<e.length;){const n=t[e[d][0]];Co.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},i),e[d][1])}if(i.tokenStack.length>0){const e=i.tokenStack[i.tokenStack.length-1];(e[1]||Lo).call(i,void 0,e[0])}for(r.position={start:No(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:No(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function o(e,t,n){let r,o,i,a,s=t-1,l=-1,u=!1;for(;++s<=n;){const t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||l||i||(i=s),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=s;for(o=void 0;a--;){const t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",u=!0),t[1].type="lineEnding",o=a}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(s,0,["enter",o,t[2]]),s++,n++,i=void 0,a=!0}}}return e[t][1]._spread=u,n}function i(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:No(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+hn({start:e.start,end:e.end})+"): it’s not open");if(r[0].type!==e.type)if(t)t.call(this,e,r[0]);else{(r[1]||Lo).call(this,e,r[0])}n.position.end=No(e.end)}function c(){return function(e){return Dn(e,"boolean"!=typeof jn.includeImageAlt||jn.includeImageAlt,"boolean"!=typeof jn.includeHtml||jn.includeHtml)}(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function h(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function m(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function v(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Kn(this.sliceSerialize(e)).toLowerCase()}function b(){const e=this.resume();this.stack[this.stack.length-1].title=e}function k(){const e=this.resume();this.stack[this.stack.length-1].url=e}function w(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function S(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function C(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n=ae(),n.position={start:No(e.start),end:void 0},t.push(n)),this.stack.push(n)}function T(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=No(e.end)}function N(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=No(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(C.call(this,e),T.call(this,e))}function O(){this.data.atHardBreak=!0}function P(){const e=this.resume();this.stack[this.stack.length-1].value=e}function L(){const e=this.resume();this.stack[this.stack.length-1].value=e}function _(){const e=this.resume();this.stack[this.stack.length-1].value=e}function R(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function I(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function A(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(So,Eo)}(t),n.identifier=Kn(t).toLowerCase()}function z(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function j(){const e=this.resume();this.stack[this.stack.length-1].url=e}function D(){const e=this.resume();this.stack[this.stack.length-1].title=e}function F(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function U(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Kn(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function B(e){this.data.characterReferenceType=e.type}function $(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;if(n)r=Wn(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0;else{r=Un(t)}this.stack[this.stack.length-1].value+=r}function V(e){this.stack.pop().position.end=No(e.end)}function H(e){T.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function q(e){T.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function W(){return{type:"blockquote",children:[]}}function K(){return{type:"code",lang:null,meta:null,value:""}}function Q(){return{type:"inlineCode",value:""}}function J(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Y(){return{type:"emphasis",children:[]}}function G(){return{type:"heading",depth:0,children:[]}}function X(){return{type:"break"}}function Z(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function ae(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}(n)(function(e){for(;!Or(e););return e}(wo(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,i,a){const s=[];let l,u,c,d,f;for(o=n+("string"==typeof o?o.toString():new TextDecoder(i||void 0).decode(o)),c=0,n="",r&&(65279===o.charCodeAt(0)&&c++,r=void 0);c<o.length;){if(xo.lastIndex=c,l=xo.exec(o),d=l&&void 0!==l.index?l.index:o.length,f=o.charCodeAt(d),!l){n=o.slice(c);break}if(10===f&&c===d&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),c<d&&(s.push(o.slice(c,d)),t+=d-c),f){case 0:s.push(65533),t++;break;case 9:for(u=4*Math.ceil(t/4),s.push(-2);t++<u;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}c=d+1}return a&&(e&&s.push(-5),n&&s.push(n),s.push(null)),s}}()(e,t,!0))))}function No(e){return{line:e.line,column:e.column,offset:e.offset}}function Oo(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Oo(e,r):Po(e,r)}}function Po(e,t){let n;for(n in t)if(Co.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Lo(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+hn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+hn({start:t.start,end:t.end})+") is still open")}function _o(e){const t=this;t.parser=function(n){return To(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Ro(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&"text"===i.type?i.value="["+i.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&"text"===a.type?a.value+=r:o.push({type:"text",value:r}),o}function Io(e){const t=e.spread;return null==t?e.children.length>1:t}function Ao(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(zo(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(zo(t.slice(o),o>0,!1)),i.join("")}function zo(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const jo={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=sr(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ro(e,t);const o={src:sr(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){const n={src:sr(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ro(e,t);const o={href:sr(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){const n={href:sr(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Io(n[r])}return t}(n):Io(t),i={},a=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const e=r[s];(o||0!==s||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?a.push(e):a.push(...e.children)}const l=r[r.length-1];l&&(o||"element"!==l.type||"p"!==l.tagName)&&a.push({type:"text",value:"\n"});const u={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,u),e.applyData(t,u)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=fn(t.children[1]),a=dn(t.children[t.children.length-1]);i&&a&&(r.position={start:i,end:a}),o.push(r)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,a=i?i.length:t.children.length;let s=-1;const l=[];for(;++s<a;){const n=t.children[s],r={},a=i?i[s]:void 0;a&&(r.align=a);let u={type:"element",tagName:o,properties:r,children:[]};n&&(u.children=e.all(n),e.patch(n,u),u=e.applyData(n,u)),l.push(u)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,u),e.applyData(t,u)},text:function(e,t){const n={type:"text",value:Ao(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:Do,yaml:Do,definition:Do,footnoteDefinition:Do};function Do(){}const Fo="object"==typeof self?self:globalThis,Mo=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[i,a]=t[o];switch(i){case 0:case-1:return n(a,o);case 1:{const e=n([],o);for(const t of a)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),o);case 4:{const{source:e,flags:t}=a;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of a)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of a)e.add(r(t));return e}case 7:{const{name:e,message:t}=a;return n(new Fo[e](t),o)}case 8:return n(BigInt(a),o);case"BigInt":return n(Object(BigInt(a)),o);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new Fo[i](a),o)};return r})(new Map,e)(0),Uo="",{toString:Bo}={},{keys:$o}=Object,Vo=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=Bo.call(e).slice(8,-1);switch(n){case"Array":return[1,Uo];case"Object":return[2,Uo];case"Date":return[3,Uo];case"RegExp":return[4,Uo];case"Map":return[5,Uo];case"Set":return[6,Uo];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},Ho=([e,t])=>0===e&&("function"===t||"symbol"===t),qo=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const o=(e,t)=>{const o=r.push(e)-1;return n.set(t,o),o},i=r=>{if(n.has(r))return n.get(r);let[a,s]=Vo(r);switch(a){case 0:{let t=r;switch(s){case"bigint":a=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return o([-1],r)}return o([a,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),o([s,[...e]],r)}const e=[],t=o([a,e],r);for(const n of r)e.push(i(n));return t}case 2:{if(s)switch(s){case"BigInt":return o([s,r.toString()],r);case"Boolean":case"Number":case"String":return o([s,r.valueOf()],r)}if(t&&"toJSON"in r)return i(r.toJSON());const n=[],l=o([a,n],r);for(const t of $o(r))!e&&Ho(Vo(r[t]))||n.push([i(t),i(r[t])]);return l}case 3:return o([a,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([a,{source:e,flags:t}],r)}case 5:{const t=[],n=o([a,t],r);for(const[o,a]of r)(e||!Ho(Vo(o))&&!Ho(Vo(a)))&&t.push([i(o),i(a)]);return n}case 6:{const t=[],n=o([a,t],r);for(const o of r)!e&&Ho(Vo(o))||t.push(i(o));return n}}const{message:l}=r;return o([a,{name:s,message:l}],r)};return i})(!(t||n),!!t,new Map,r)(e),r},Wo="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Mo(qo(e,t)):structuredClone(e):(e,t)=>Mo(qo(e,t));function Ko(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Qo(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const Jo=function(e){if(null==e)return Go;if("function"==typeof e)return Yo(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Jo(e[n]);return Yo(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return Yo(n);function n(n){const r=n;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}(e);if("string"==typeof e)return function(e){return Yo(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function Yo(e){return function(t,n,r){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function Go(){return!0}const Xo=[],Zo=!0,ei=!1;function ti(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const i=Jo(o),a=r?-1:1;!function e(o,s,l){const u=o&&"object"==typeof o?o:{};if("string"==typeof u.type){const e="string"==typeof u.tagName?u.tagName:"string"==typeof u.name?u.name:void 0;Object.defineProperty(c,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return c;function c(){let u,c,d,f=Xo;if((!t||i(o,s,l[l.length-1]||void 0))&&(f=function(e){if(Array.isArray(e))return e;if("number"==typeof e)return[Zo,e];return null==e?Xo:[e]}(n(o,l)),f[0]===ei))return f;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==f[0])for(c=(r?t.children.length:-1)+a,d=l.concat(t);c>-1&&c<t.children.length;){const n=t.children[c];if(u=e(n,c,d)(),u[0]===ei)return u;c="number"==typeof u[1]?u[1]:c+a}}return f}}(e,void 0,[])()}function ni(e,t,n,r){let o,i,a;"function"==typeof t&&"function"!=typeof n?(i=void 0,a=t,o=n):(i=t,a=n,o=r),ti(e,i,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return a(e,r,n)},o)}const ri={}.hasOwnProperty,oi={};function ii(e,t){e.position&&(t.position=function(e){const t=fn(e),n=dn(e);if(t&&n)return{start:t,end:n}}(e))}function ai(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&o&&Object.assign(n.properties,Wo(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function si(e,t){const n=t.data||{},r=!("value"in t)||ri.call(n,"hProperties")||ri.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function li(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function ui(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function ci(e,t){const n=function(e,t){const n=t||oi,r=new Map,o=new Map,i=new Map,a={...jo,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=s.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(Array.isArray(o)||"text"!==o.type||(o.value=ui(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=ui(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:ai,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:a,one:function(e,t){const n=e.type,r=s.handlers[n];if(ri.call(s.handlers,n)&&r)return r(s,e,t);if(s.options.passThrough&&s.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=Wo(n);return r.children=s.all(e),r}return Wo(e)}return(s.options.unknownHandler||si)(s,e,t)},options:n,patch:ii,wrap:li};return ni(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),s}(e,t),r=n.one(e,void 0),o=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Ko,r=e.options.footnoteBackLabel||Qo,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[l]);if(!o)continue;const i=e.all(o),a=String(o.identifier).toUpperCase(),u=sr(a.toLowerCase());let c=0;const d=[],f=e.footnoteCounts.get(a);for(;void 0!==f&&++c<=f;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,c);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+u+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=i[i.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...d)}else i.push(...d);const h={type:"element",tagName:"li",properties:{id:t+"fn-"+u},children:e.wrap(i,!0)};e.patch(o,h),s.push(h)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Wo(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:"\n"},o),i}function di(e,t){return e&&"run"in e?async function(n,r){const o=ci(n,{file:r,...t});await e.run(o,r)}:function(n,r){return ci(n,{file:r,...e||t})}}function fi(e){if(e)throw e}var pi,hi;var gi=function(){if(hi)return pi;hi=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},i=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,o=e.call(n,"constructor"),i=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!i)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return pi=function e(){var t,n,r,l,u,c,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(h&&l&&(i(l)||(u=o(l)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&i(r)?r:{},a(d,{name:n,newValue:e(h,c,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},pi}();const mi=t(gi);function yi(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function vi(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(i,...a){const s=e[++n];let l=-1;if(i)r(i);else{for(;++l<t.length;)null!==a[l]&&void 0!==a[l]||(a[l]=t[l]);t=a,s?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let s;r&&t.push(o);try{s=e.apply(this,t)}catch(i){if(r&&n)throw i;return o(i)}r||(s&&s.then&&"function"==typeof s.then?s.then(a,o):s instanceof Error?o(s):a(s))}function o(e,...r){n||(n=!0,t(e,...r))}function a(e){o(null,e)}}(s,o)(...a):r(null,...a)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const bi={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');ki(e);let n,r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else a<0&&(n=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(o=i):(s=-1,o=a));r===o?o=a:o<0&&(o=e.length);return e.slice(r,o)},dirname:function(e){if(ki(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){ki(e);let t,n=e.length,r=-1,o=0,i=-1,a=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?i<0?i=n:1!==a&&(a=1):i>-1&&(a=-1);else if(t){o=n+1;break}}if(i<0||r<0||0===a||1===a&&i===r-1&&i===o+1)return"";return e.slice(i,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)ki(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){ki(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",i=0,a=-1,s=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(a===l-1||1===s);else if(a!==l-1&&2===s){if(o.length<2||2!==i||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",i=0):(o=o.slice(0,r),i=o.length-1-o.lastIndexOf("/")),a=l,s=0;continue}}else if(o.length>0){o="",i=0,a=l,s=0;continue}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(a+1,l):o=e.slice(a+1,l),i=l-a-1;a=l,s=0}else 46===n&&s>-1?s++:s=-1}return o}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function ki(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const wi={cwd:function(){return"/"}};function xi(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function Si(e){if("string"==typeof e)e=new URL(e);else if(!xi(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const Ei=["history","path","basename","stem","extname","dirname"];class Ci{constructor(e){let t;t=e?xi(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":wi.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<Ei.length;){const e=Ei[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)Ei.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?bi.basename(this.path):void 0}set basename(e){Ni(e,"basename"),Ti(e,"basename"),this.path=bi.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?bi.dirname(this.path):void 0}set dirname(e){Oi(this.basename,"dirname"),this.path=bi.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?bi.extname(this.path):void 0}set extname(e){if(Ti(e,"extname"),Oi(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=bi.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){xi(e)&&(e=Si(e)),Ni(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?bi.basename(this.path,this.extname):void 0}set stem(e){Ni(e,"stem"),Ti(e,"stem"),this.path=bi.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new vn(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function Ti(e,t){if(e&&e.includes(bi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+bi.sep+"`")}function Ni(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Oi(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Pi=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Li={}.hasOwnProperty;class _i extends Pi{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=vi()}copy(){const e=new _i;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(mi(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(zi("data",this.frozen),this.namespace[e]=t,this):Li.call(this.namespace,e)&&this.namespace[e]||void 0:e?(zi("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=Fi(e),n=this.parser||this.Parser;return Ii("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),Ii("process",this.parser||this.Parser),Ai("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const i=Fi(e),a=n.parse(i);function s(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(a,i,function(e,t,r){if(e||!t||!r)return s(e);const o=t,i=n.stringify(o,r);var a;"string"==typeof(a=i)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(a)?r.value=i:r.result=i,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),Ii("processSync",this.parser||this.Parser),Ai("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,fi(e),t=r}),Di("processSync","process",n),t}run(e,t,n){ji(e),this.freeze();const r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,i){const a=Fi(t);r.run(e,a,function(t,r,a){const s=r||e;t?i(t):o?o(s):n(void 0,s,a)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){fi(e),n=t,r=!0}),Di("runSync","run",r),n}stringify(e,t){this.freeze();const n=Fi(t),r=this.compiler||this.Compiler;return Ai("stringify",r),ji(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(zi("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?a(e):i(e)}return this;function o(e){if("function"==typeof e)s(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,n)}else i(e)}}function i(e){if(!("plugins"in e)&&!("settings"in e))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=mi(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function s(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...i]=t;const a=n[o][1];yi(a)&&yi(r)&&(r=mi(!0,a,r)),n[o]=[e,r,...i]}}}}const Ri=(new _i).freeze();function Ii(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function Ai(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function zi(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ji(e){if(!yi(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function Di(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Fi(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new Ci(e)}const Mi=[],Ui={allowDangerousHtml:!0},Bi=/^(https?|ircs?|mailto|xmpp)$/i,$i=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Vi(e){const t=function(e){const t=e.rehypePlugins||Mi,n=e.remarkPlugins||Mi,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ui}:Ui,o=Ri().use(_o).use(n).use(di,r).use(t);return o}(e),n=function(e){const t=e.children||"",n=new Ci;"string"==typeof t&&(n.value=t);return n}(e);return function(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||Hi;for(const c of $i)Object.hasOwn(t,c.from)&&ft((c.from,c.to&&c.to,c.id));return ni(e,u),Cn(e,{Fragment:N.Fragment,components:o,ignoreInvalidStyle:!0,jsx:N.jsx,jsxs:N.jsxs,passKeys:!0,passNode:!0});function u(e,t,o){if("raw"===e.type&&o&&"number"==typeof t)return a?o.children.splice(t,1):o.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in zn)if(Object.hasOwn(zn,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=zn[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let a=n?!n.includes(e.tagName):!!i&&i.includes(e.tagName);if(!a&&r&&"number"==typeof t&&(a=!r(e,t,o)),a&&o&&"number"==typeof t)return s&&e.children?o.children.splice(t,1,...e.children):o.children.splice(t,1),t}}}(t.runSync(t.parse(n),n),e)}function Hi(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return-1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||Bi.test(e.slice(0,t))?e:""}const qi="https://www.tiagpctest.softiabot.com",Wi={BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left",TOP_RIGHT:"top-right",TOP_LEFT:"top-left"},Ki={LIGHT:"light",DARK:"dark",AUTO:"auto"},Qi={SPANISH:"es",ENGLISH:"en",FRANCES:"fr"},Ji=640,Yi=Ki.AUTO,Gi=Wi.BOTTOM_RIGHT,Xi=Qi.ENGLISH,Zi="400px",ea="600px",ta=!1,na=!0,ra=!0,oa=3e4,ia=2e3,aa=e=>{try{return new Date(e).toLocaleTimeString("es-ES",{hour:"2-digit",minute:"2-digit"})}catch{return""}},sa=()=>crypto.randomUUID(),la=({size:e="md",className:t=""})=>N.jsx("div",{className:`gpc-spinner ${{sm:"w-4 h-4 border-2",md:"w-6 h-6 border-2",lg:"w-8 h-8 border-3"}[e]} ${t}`,role:"status","aria-label":"Cargando",children:N.jsx("span",{className:"sr-only",children:"Cargando..."})}),ua=()=>N.jsxs("div",{className:"gpc-typing-indicator",role:"status","aria-label":"Escribiendo",children:[N.jsx("span",{className:"gpc-typing-dot"}),N.jsx("span",{className:"gpc-typing-dot"}),N.jsx("span",{className:"gpc-typing-dot"})]}),ca=({message:e,showMetadata:t=!1,messageRef:n=null})=>{const{t:r}=V(),o="user"===e.role,i=!o&&e.isStreaming&&!e.content;return N.jsxs("div",{ref:n,className:"gpc-message "+(o?"gpc-message-user":"gpc-message-assistant"),role:"article","aria-label":o?"Mensaje del usuario":"Mensaje del asistente",children:[N.jsx("div",{className:"gpc-message-content",children:i?N.jsx(ua,{}):o?e.content.trim():N.jsx(Vi,{children:e.content})}),N.jsx("div",{className:"gpc-message-timestamp "+(o?"gpc-message-timestamp-user":""),children:aa(e.timestamp)}),!o&&t&&e.metadata&&N.jsxs("div",{className:"gpc-message-metadata",children:[e.metadata.tokensUsed&&N.jsxs("div",{className:"gpc-metadata-item",children:[N.jsxs("strong",{children:[r("metadata.tokensUsed"),":"]})," ",e.metadata.tokensUsed]}),e.metadata.responseTimeMs&&N.jsxs("div",{className:"gpc-metadata-item",children:[N.jsxs("strong",{children:[r("metadata.responseTime"),":"]})," ",(a=e.metadata.responseTimeMs,a>=1e3?`${(a/1e3).toFixed(1)}s`:`${Math.round(a)}ms`)]}),e.metadata.model&&N.jsxs("div",{className:"gpc-metadata-item",children:[N.jsxs("strong",{children:[r("metadata.model"),":"]})," ",e.metadata.model]})]})]});var a},da=({messages:e,isLoading:t,showMetadata:n=!1,widgetConfig:r=null})=>{const{t:o}=V(),i=l.useRef(null),a=l.useRef(null),s=l.useRef(e.length);l.useEffect(()=>{const t=e.length>s.current,n=e[e.length-1];t&&n&&("user"===n.role?i.current?.scrollIntoView({behavior:"smooth"}):"assistant"===n.role&&n.isStreaming&&setTimeout(()=>{a.current?.scrollIntoView({behavior:"smooth",block:"start"})},100)),s.current=e.length},[e]);const u=r?.company_name||"TIA GPC",c=r?.company_logo_base64,d=c?.startsWith("data:")?c:c?`data:image/png;base64,${c}`:null;return 0!==e.length||t?N.jsxs("div",{className:"gpc-messages-container gpc-scrollbar gpc-smooth-scroll",children:[e.map((t,r)=>N.jsx(ca,{message:t,showMetadata:n,messageRef:r===e.length-1?a:null},t.id)),N.jsx("div",{ref:i})]}):N.jsx("div",{className:"gpc-messages-container",children:N.jsxs("div",{className:"gpc-empty-state",children:[d?N.jsx("div",{className:"gpc-welcome-logo",children:N.jsx("img",{src:d,alt:u,className:"gpc-welcome-company-logo"})}):N.jsx(te,{className:"gpc-empty-icon"}),N.jsx("h3",{className:"gpc-empty-title",children:o("chat.welcome",{companyName:u})}),N.jsx("p",{className:"gpc-empty-text",children:o("chat.emptyState")})]})})},fa=({onSendMessage:e,isLoading:t,disabled:n})=>{const{t:r}=V(),[o,i]=l.useState(""),a=l.useRef(null);l.useEffect(()=>{n||t||a.current?.focus()},[n,t]);const s=async r=>{r.preventDefault();const a=(e=>e.trim().slice(0,2e3))(o);if(a&&!t&&!n)try{await e(a),i("")}catch(s){}},u=o.trim().length>0&&!t&&!n;return N.jsxs("form",{onSubmit:s,className:"gpc-input-container",children:[N.jsx("input",{ref:a,type:"text",value:o,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),s(e))},placeholder:r("chat.placeholder"),disabled:t||n,maxLength:ia,className:"gpc-input","aria-label":r("chat.placeholder"),"aria-describedby":"chat-input-help"}),N.jsx("button",{type:"submit",disabled:!u,className:"gpc-send-button","aria-label":r("chat.send"),title:r("chat.send"),children:t?N.jsx("span",{className:"gpc-spinner"}):N.jsx(re,{className:"gpc-icon"})}),N.jsxs("span",{id:"chat-input-help",className:"gpc-sr-only",children:[r("chat.placeholder"),". Máximo ",ia," caracteres."]})]})};var pa=l.forwardRef(({as:e="div",...t},n)=>N.jsx(e,{...t,ref:n})),ha="cf-turnstile-script",ga="onloadTurnstileCallback",ma=e=>!!document.getElementById(e),ya={normal:{width:300,height:65},compact:{width:150,height:140},invisible:{width:0,height:0,overflow:"hidden"},flexible:{minWidth:300,width:"100%",height:65},interactionOnly:{width:"fit-content",height:"auto",display:"flex"}};function va(e){if("invisible"!==e&&"interactionOnly"!==e)return e}var ba,ka="unloaded",wa=new Promise((e,t)=>{ba={resolve:e,reject:t},"ready"===ka&&e(void 0)}),xa=l.forwardRef((e,t)=>{let{scriptOptions:n,options:r={},siteKey:o,onWidgetLoad:i,onSuccess:a,onExpire:s,onError:u,onBeforeInteractive:c,onAfterInteractive:d,onUnsupported:f,onTimeout:p,onLoadScript:h,id:g,style:m,as:y="div",injectScript:v=!0,rerenderOnCallbackChange:b=!1,...k}=e,w=r.size,x=l.useCallback(()=>typeof w>"u"?{}:"execute"===r.execution?ya.invisible:"interaction-only"===r.appearance?ya.interactionOnly:ya[w],[r.execution,w,r.appearance]),[S,E]=l.useState(x()),C=l.useRef(null),[T,O]=l.useState(!1),P=l.useRef(),L=l.useRef(!1),_=g||"cf-turnstile",R=l.useRef({onSuccess:a,onError:u,onExpire:s,onBeforeInteractive:c,onAfterInteractive:d,onUnsupported:f,onTimeout:p});l.useEffect(()=>{b||(R.current={onSuccess:a,onError:u,onExpire:s,onBeforeInteractive:c,onAfterInteractive:d,onUnsupported:f,onTimeout:p})});let I=n?.id||ha,A=function(e=ha){let[t,n]=l.useState(!1);return l.useEffect(()=>{let t=()=>{ma(e)&&n(!0)},r=new MutationObserver(t);return r.observe(document,{childList:!0,subtree:!0}),t(),()=>{r.disconnect()}},[e]),t}(I),z=n?.onLoadCallbackName||ga,j=r.appearance||"always",D=l.useMemo(()=>({sitekey:o,action:r.action,cData:r.cData,theme:r.theme||"auto",language:r.language||"auto",tabindex:r.tabIndex,"response-field":r.responseField,"response-field-name":r.responseFieldName,size:va(w),retry:r.retry||"auto","retry-interval":r.retryInterval||8e3,"refresh-expired":r.refreshExpired||"auto","refresh-timeout":r.refreshTimeout||"auto",execution:r.execution||"render",appearance:r.appearance||"always","feedback-enabled":r.feedbackEnabled||!0,callback:e=>{L.current=!0,b?a?.(e):R.current.onSuccess?.(e)},"error-callback":b?u:(...e)=>R.current.onError?.(...e),"expired-callback":b?s:(...e)=>R.current.onExpire?.(...e),"before-interactive-callback":b?c:(...e)=>R.current.onBeforeInteractive?.(...e),"after-interactive-callback":b?d:(...e)=>R.current.onAfterInteractive?.(...e),"unsupported-callback":b?f:(...e)=>R.current.onUnsupported?.(...e),"timeout-callback":b?p:(...e)=>R.current.onTimeout?.(...e)}),[r.action,r.appearance,r.cData,r.execution,r.language,r.refreshExpired,r.responseField,r.responseFieldName,r.retry,r.retryInterval,r.tabIndex,r.theme,r.feedbackEnabled,r.refreshTimeout,o,w,b,b?a:null,b?u:null,b?s:null,b?c:null,b?d:null,b?f:null,b?p:null]),F=l.useCallback(()=>typeof window<"u"&&!!window.turnstile,[]);return l.useEffect(function(){v&&!T&&(({render:e="explicit",onLoadCallbackName:t=ga,scriptOptions:{nonce:n="",defer:r=!0,async:o=!0,id:i="",appendTo:a,onError:s,crossOrigin:l=""}={}})=>{let u=i||ha;if(ma(u))return;let c=document.createElement("script");c.id=u,c.src=`https://challenges.cloudflare.com/turnstile/v0/api.js?onload=${t}&render=${e}`,document.querySelector(`script[src="${c.src}"]`)||(c.defer=!!r,c.async=!!o,n&&(c.nonce=n),l&&(c.crossOrigin=l),s&&(c.onerror=s,delete window[t]),("body"===a?document.body:document.getElementsByTagName("head")[0]).appendChild(c))})({onLoadCallbackName:z,scriptOptions:{...n,id:I}})},[v,T,n,I]),l.useEffect(function(){"ready"!==ka&&((e=ga)=>("unloaded"===ka&&(ka="loading",window[e]=()=>{ba.resolve(),ka="ready",delete window[e]}),wa))(z).then(()=>O(!0)).catch(console.error)},[]),l.useEffect(function(){if(!C.current||!T)return;let e=!1;return(async()=>{if(e||!C.current)return;let t=window.turnstile.render(C.current,D);P.current=t,P.current&&i?.(P.current)})(),()=>{e=!0,P.current&&(window.turnstile.remove(P.current),L.current=!1)}},[_,T,D]),l.useImperativeHandle(t,()=>{let{turnstile:e}=window;return{getResponse(){if(e?.getResponse&&P.current&&F())return e.getResponse(P.current)},getResponsePromise:async(e=3e4,t=100)=>new Promise((n,r)=>{let o,i=async()=>{if(L.current&&window.turnstile&&P.current)try{let e=window.turnstile.getResponse(P.current);return o&&clearTimeout(o),e?n(e):r(new Error("No response received"))}catch(a){return o&&clearTimeout(o),r(new Error("Failed to get response"))}o||(o=setTimeout(()=>{o&&clearTimeout(o),r(new Error("Timeout"))},e)),await new Promise(e=>setTimeout(e,t)),await i()};i()}),reset(){if(e?.reset&&P.current&&F()){"execute"===r.execution&&E(ya.invisible);try{L.current=!1,e.reset(P.current)}catch(je){}}},remove(){e?.remove&&P.current&&F()&&(E(ya.invisible),L.current=!1,e.remove(P.current),P.current=null)},render(){if(!e?.render||!C.current||!F()||P.current)return;let t=e.render(C.current,D);return P.current=t,P.current&&i?.(P.current),"execute"!==r.execution&&E(w?ya[w]:{}),t},execute(){"execute"===r.execution&&e?.execute&&C.current&&P.current&&F()&&(e.execute(C.current,D),E(w?ya[w]:{}))},isExpired:()=>!!(e?.isExpired&&P.current&&F())&&e.isExpired(P.current)}},[P,r.execution,w,D,C,F,T,i]),l.useEffect(()=>{A&&!T&&window.turnstile&&O(!0)},[T,A]),l.useEffect(()=>{E(x())},[r.execution,w,j]),l.useEffect(()=>{!A||"function"!=typeof h||h()},[A]),N.jsx(pa,{ref:C,as:y,id:_,style:{...S,...m},...k})});xa.displayName="Turnstile";const Sa=({siteKey:e,onSuccess:t,onError:n})=>{const{t:r}=V(),[o,i]=l.useState(!1),[a,s]=l.useState(null);return N.jsxs("div",{className:"gpc-validator-container",children:[N.jsxs("div",{className:"gpc-validator-header",children:[N.jsx("h3",{className:"gpc-validator-title",children:r("chat.validation")}),N.jsx("p",{className:"gpc-validator-subtitle",children:r("turnstile.verifying")})]}),!a&&N.jsx("div",{className:"gpc-animate-fade-in",children:N.jsx(xa,{siteKey:e,onSuccess:async e=>{i(!0),s(null);try{await t(e)}catch(o){s(r("turnstile.error")),n?.(o)}finally{i(!1)}},onError:e=>{s(r("turnstile.error")),n?.(new Error(r("turnstile.error")))},options:{theme:"light",size:"normal"}})}),o&&N.jsxs("div",{className:"gpc-validator-loading",children:[N.jsx(la,{size:"md"}),N.jsx("p",{className:"gpc-validator-text",children:r("chat.validation")})]}),a&&N.jsxs("div",{className:"gpc-validator-error",children:[N.jsx(X,{className:"gpc-error-icon"}),N.jsxs("div",{className:"gpc-error-content",children:[N.jsx("p",{className:"gpc-error-title",children:r("errors.validation")}),N.jsx("p",{className:"gpc-error-message",children:a}),N.jsx("button",{onClick:()=>window.location.reload(),className:"gpc-error-button",children:r("chat.retry")})]})]})]})},Ea=(e="auto")=>{const[t,n]=l.useState(e),[r,o]=l.useState("light");l.useEffect(()=>{if(o("auto"===t?window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t),"auto"===t){const e=window.matchMedia("(prefers-color-scheme: dark)"),t=e=>{o(e.matches?"dark":"light")};return e.addEventListener("change",t),()=>{e.removeEventListener("change",t)}}},[t]);return{theme:r,themeMode:t,setThemeMode:n,toggleTheme:()=>{n(e=>"auto"===e?"light"===r?"dark":"light":"light"===e?"dark":"light")}}},Ca=({gpcService:e,licenseToken:t,widgetConfig:n,turnstileSiteKey:r,onClose:o,themeMode:i,showBranding:a=!0,showMetadata:s=!1,onError:u})=>{const{t:c}=V(),[d,f]=l.useState(null),[p,h]=l.useState(!1),{theme:g,toggleTheme:m}=Ea(i),y=l.useCallback(()=>{h(!1),f(null),e&&e.renewSessionToken()},[e]),{messages:v,isLoading:b,sendMessage:k}=((e,t,n)=>{const{t:r}=V(),[o,i]=l.useState([]),[a,s]=l.useState(!1),[u,c]=l.useState(null),d=l.useCallback(async o=>{if(!o.trim()||a)return;if(!t)return void at.error("Validación anti-bot pendiente");const l={id:sa(),role:"user",content:o.trim(),timestamp:(new Date).toISOString()};i(e=>[...e,l]),s(!0),c(null);const u=sa(),d={id:u,role:"assistant",content:"",timestamp:(new Date).toISOString(),isStreaming:!0};i(e=>[...e,d]);try{const n=await e.sendMessage(o,t,e=>{i(t=>t.map(t=>t.id===u?{...t,content:t.content+e}:t))});i(e=>e.map(e=>e.id===u?{id:n.data.message_id,role:"assistant",content:n.data.response,timestamp:n.data.created_at,isStreaming:!1,metadata:{costUsd:n.data.cost_usd,creditBalanceUsd:n.data.credit_balance_usd,inputTokens:n.data.input_tokens,outputTokens:n.data.output_tokens,responseTimeMs:n.data.response_time_ms,modelUsed:n.data.model_used}}:e))}catch(f){let e,t;i(e=>e.filter(e=>e.id!==u));try{e=JSON.parse(f.message)}catch{e={statusCode:500,message:f.message}}const o=e.statusCode||500,a=e.errorCode||"";switch(401===o&&"SESSION_EXPIRED"===a&&(t=r("errors.sessionExpired","Session expired, please verify again"),n&&n()),o){case 401:t||(t=r("errors.unauthorized"));break;case 402:t=r("errors.insufficientCredits");break;case 403:t=a.includes("DOMAIN")||a.includes("UNAUTHORIZED")?r("errors.domainUnauthorized"):r("errors.validation");break;case 429:t=r("errors.rateLimit");break;case 503:case 502:case 504:t=r("errors.aiServiceUnavailable");break;case 500:t=r("errors.serverError");break;default:t=r("errors.generic")}c(t),at.error(t,{duration:4e3,position:"top-center"});const s={id:sa(),role:"assistant",content:t,timestamp:(new Date).toISOString()};i(e=>[...e,s])}finally{s(!1)}},[e,t,a,r,n]),f=l.useCallback(()=>{i([]),c(null)},[]),p=l.useCallback(()=>{c(null)},[]);return{messages:o,isLoading:a,error:u,sendMessage:d,clearMessages:f,clearError:p}})(e,d,y);l.useEffect(()=>{e&&e.hasValidCachedSession()&&(h(!0),f("CACHED_SESSION"))},[e]);return l.useEffect(()=>()=>{e&&e.releaseSession().catch(e=>{})},[e]),N.jsxs("div",{className:"gpc-chat-window gpc-animate-fade-in "+("dark"===g?"gpc-dark":""),children:[N.jsx(ct,{onClose:o,theme:g,onToggleTheme:m,showBranding:a,widgetConfig:n}),p?N.jsxs(N.Fragment,{children:[N.jsx(da,{messages:v,isLoading:b,showMetadata:s,widgetConfig:n}),N.jsx(fa,{onSendMessage:k,isLoading:b,disabled:!1})]}):N.jsx(Sa,{siteKey:r,onSuccess:t=>{f(t),h(!0),e&&e.validateSession()},onError:u}),a&&N.jsx("div",{className:"gpc-footer",children:N.jsx("span",{className:"gpc-footer-text",children:c("widget.poweredBy")})}),N.jsx(it,{position:"top-center"})]})};function Ta(e,t){return function(){return e.apply(t,arguments)}}const{toString:Na}=Object.prototype,{getPrototypeOf:Oa}=Object,{iterator:Pa,toStringTag:La}=Symbol,_a=(e=>t=>{const n=Na.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ra=e=>(e=e.toLowerCase(),t=>_a(t)===e),Ia=e=>t=>typeof t===e,{isArray:Aa}=Array,za=Ia("undefined");function ja(e){return null!==e&&!za(e)&&null!==e.constructor&&!za(e.constructor)&&Ma(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Da=Ra("ArrayBuffer");const Fa=Ia("string"),Ma=Ia("function"),Ua=Ia("number"),Ba=e=>null!==e&&"object"==typeof e,$a=e=>{if("object"!==_a(e))return!1;const t=Oa(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||La in e||Pa in e)},Va=Ra("Date"),Ha=Ra("File"),qa=Ra("Blob"),Wa=Ra("FileList"),Ka=Ra("URLSearchParams"),[Qa,Ja,Ya,Ga]=["ReadableStream","Request","Response","Headers"].map(Ra);function Xa(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),Aa(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(ja(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function Za(e,t){if(ja(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const es="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ts=e=>!za(e)&&e!==es;const ns=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&Oa(Uint8Array)),rs=Ra("HTMLFormElement"),os=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),is=Ra("RegExp"),as=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Xa(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const ss=Ra("AsyncFunction"),ls=(us="function"==typeof setImmediate,cs=Ma(es.postMessage),us?setImmediate:cs?(ds=`axios@${Math.random()}`,fs=[],es.addEventListener("message",({source:e,data:t})=>{e===es&&t===ds&&fs.length&&fs.shift()()},!1),e=>{fs.push(e),es.postMessage(ds,"*")}):e=>setTimeout(e));var us,cs,ds,fs;const ps="undefined"!=typeof queueMicrotask?queueMicrotask.bind(es):"undefined"!=typeof process&&process.nextTick||ls,hs={isArray:Aa,isArrayBuffer:Da,isBuffer:ja,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Ma(e.append)&&("formdata"===(t=_a(e))||"object"===t&&Ma(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Da(e.buffer),t},isString:Fa,isNumber:Ua,isBoolean:e=>!0===e||!1===e,isObject:Ba,isPlainObject:$a,isEmptyObject:e=>{if(!Ba(e)||ja(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(Ie){return!1}},isReadableStream:Qa,isRequest:Ja,isResponse:Ya,isHeaders:Ga,isUndefined:za,isDate:Va,isFile:Ha,isBlob:qa,isRegExp:is,isFunction:Ma,isStream:e=>Ba(e)&&Ma(e.pipe),isURLSearchParams:Ka,isTypedArray:ns,isFileList:Wa,forEach:Xa,merge:function e(){const{caseless:t,skipUndefined:n}=ts(this)&&this||{},r={},o=(o,i)=>{const a=t&&Za(r,i)||i;$a(r[a])&&$a(o)?r[a]=e(r[a],o):$a(o)?r[a]=e({},o):Aa(o)?r[a]=o.slice():n&&za(o)||(r[a]=o)};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&Xa(arguments[i],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(Xa(t,(t,r)=>{n&&Ma(t)?e[r]=Ta(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&Oa(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:_a,kindOfTest:Ra,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Aa(e))return e;let t=e.length;if(!Ua(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Pa]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:rs,hasOwnProperty:os,hasOwnProp:os,reduceDescriptors:as,freezeMethods:e=>{as(e,(t,n)=>{if(Ma(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Ma(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Aa(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Za,global:es,isContextDefined:ts,isSpecCompliantForm:function(e){return!!(e&&Ma(e.append)&&"FormData"===e[La]&&e[Pa])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Ba(e)){if(t.indexOf(e)>=0)return;if(ja(e))return e;if(!("toJSON"in e)){t[r]=e;const o=Aa(e)?[]:{};return Xa(e,(e,t)=>{const i=n(e,r+1);!za(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:ss,isThenable:e=>e&&(Ba(e)||Ma(e))&&Ma(e.then)&&Ma(e.catch),setImmediate:ls,asap:ps,isIterable:e=>null!=e&&Ma(e[Pa])};function gs(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}hs.inherits(gs,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:hs.toJSONObject(this.config),code:this.code,status:this.status}}});const ms=gs.prototype,ys={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ys[e]={value:e}}),Object.defineProperties(gs,ys),Object.defineProperty(ms,"isAxiosError",{value:!0}),gs.from=(e,t,n,r,o,i)=>{const a=Object.create(ms);hs.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",l=null==t&&e?e.code:t;return gs.call(a,s,l,n,r,o),e&&null==a.cause&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",i&&Object.assign(a,i),a};function vs(e){return hs.isPlainObject(e)||hs.isArray(e)}function bs(e){return hs.endsWith(e,"[]")?e.slice(0,-2):e}function ks(e,t,n){return e?e.concat(t).map(function(e,t){return e=bs(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ws=hs.toFlatObject(hs,{},null,function(e){return/^is[A-Z]/.test(e)});function xs(e,t,n){if(!hs.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=hs.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!hs.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&hs.isSpecCompliantForm(t);if(!hs.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(hs.isDate(e))return e.toISOString();if(hs.isBoolean(e))return e.toString();if(!s&&hs.isBlob(e))throw new gs("Blob is not supported. Use a Buffer instead.");return hs.isArrayBuffer(e)||hs.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(hs.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(hs.isArray(e)&&function(e){return hs.isArray(e)&&!e.some(vs)}(e)||(hs.isFileList(e)||hs.endsWith(n,"[]"))&&(s=hs.toArray(e)))return n=bs(n),s.forEach(function(e,r){!hs.isUndefined(e)&&null!==e&&t.append(!0===a?ks([n],r,i):null===a?n:n+"[]",l(e))}),!1;return!!vs(e)||(t.append(ks(o,n,i),l(e)),!1)}const c=[],d=Object.assign(ws,{defaultVisitor:u,convertValue:l,isVisitable:vs});if(!hs.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!hs.isUndefined(n)){if(-1!==c.indexOf(n))throw Error("Circular reference detected in "+r.join("."));c.push(n),hs.forEach(n,function(n,i){!0===(!(hs.isUndefined(n)||null===n)&&o.call(t,n,hs.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),c.pop()}}(e),t}function Ss(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Es(e,t){this._pairs=[],e&&xs(e,this,t)}const Cs=Es.prototype;function Ts(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ns(e,t,n){if(!t)return e;const r=n&&n.encode||Ts;hs.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):hs.isURLSearchParams(t)?t.toString():new Es(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Cs.append=function(e,t){this._pairs.push([e,t])},Cs.toString=function(e){const t=e?function(t){return e.call(this,t,Ss)}:Ss;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class Os{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){hs.forEach(this.handlers,function(t){null!==t&&e(t)})}}const Ps={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ls={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Es,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},_s="undefined"!=typeof window&&"undefined"!=typeof document,Rs="object"==typeof navigator&&navigator||void 0,Is=_s&&(!Rs||["ReactNative","NativeScript","NS"].indexOf(Rs.product)<0),As="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,zs=_s&&window.location.href||"http://localhost",js={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:_s,hasStandardBrowserEnv:Is,hasStandardBrowserWebWorkerEnv:As,navigator:Rs,origin:zs},Symbol.toStringTag,{value:"Module"})),...Ls};function Ds(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;if(i=!i&&hs.isArray(r)?r.length:i,s)return hs.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&hs.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&hs.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!a}if(hs.isFormData(e)&&hs.isFunction(e.entries)){const n={};return hs.forEachEntry(e,(e,r)=>{t(function(e){return hs.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const Fs={transitional:Ps,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=hs.isObject(e);o&&hs.isHTMLForm(e)&&(e=new FormData(e));if(hs.isFormData(e))return r?JSON.stringify(Ds(e)):e;if(hs.isArrayBuffer(e)||hs.isBuffer(e)||hs.isStream(e)||hs.isFile(e)||hs.isBlob(e)||hs.isReadableStream(e))return e;if(hs.isArrayBufferView(e))return e.buffer;if(hs.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return xs(e,new js.classes.URLSearchParams,{visitor:function(e,t,n,r){return js.isNode&&hs.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=hs.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return xs(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(hs.isString(e))try{return(t||JSON.parse)(e),hs.trim(e)}catch(Ie){if("SyntaxError"!==Ie.name)throw Ie}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Fs.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(hs.isResponse(e)||hs.isReadableStream(e))return e;if(e&&hs.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(Ie){if(n){if("SyntaxError"===Ie.name)throw gs.from(Ie,gs.ERR_BAD_RESPONSE,this,null,this.response);throw Ie}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:js.classes.FormData,Blob:js.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};hs.forEach(["delete","get","head","post","put","patch"],e=>{Fs.headers[e]={}});const Ms=hs.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Us=Symbol("internals");function Bs(e){return e&&String(e).trim().toLowerCase()}function $s(e){return!1===e||null==e?e:hs.isArray(e)?e.map($s):String(e)}function Vs(e,t,n,r,o){return hs.isFunction(r)?r.call(this,t,n):(o&&(t=n),hs.isString(t)?hs.isString(r)?-1!==t.indexOf(r):hs.isRegExp(r)?r.test(t):void 0:void 0)}let Hs=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Bs(t);if(!o)throw new Error("header name must be a non-empty string");const i=hs.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=$s(e))}const i=(e,t)=>hs.forEach(e,(e,n)=>o(e,n,t));if(hs.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(hs.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Ms[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(hs.isObject(e)&&hs.isIterable(e)){let n,r,o={};for(const t of e){if(!hs.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?hs.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Bs(e)){const n=hs.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(hs.isFunction(t))return t.call(this,e,n);if(hs.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Bs(e)){const n=hs.findKey(this,e);return!(!n||void 0===this[n]||t&&!Vs(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Bs(e)){const o=hs.findKey(n,e);!o||t&&!Vs(0,n[o],o,t)||(delete n[o],r=!0)}}return hs.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Vs(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return hs.forEach(this,(r,o)=>{const i=hs.findKey(n,o);if(i)return t[i]=$s(r),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();a!==o&&delete t[o],t[a]=$s(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return hs.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&hs.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Us]=this[Us]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Bs(e);t[r]||(!function(e,t){const n=hs.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return hs.isArray(e)?e.forEach(r):r(e),this}};function qs(e,t){const n=this||Fs,r=t||n,o=Hs.from(r.headers);let i=r.data;return hs.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ws(e){return!(!e||!e.__CANCEL__)}function Ks(e,t,n){gs.call(this,null==e?"canceled":e,gs.ERR_CANCELED,t,n),this.name="CanceledError"}function Qs(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new gs("Request failed with status code "+n.status,[gs.ERR_BAD_REQUEST,gs.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Hs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),hs.reduceDescriptors(Hs.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),hs.freezeMethods(Hs),hs.inherits(Ks,gs,{__CANCEL__:!0});const Js=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),u=r[a];o||(o=l),n[i]=s,r[i]=l;let c=a,d=0;for(;c!==i;)d+=n[c++],c%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),l-o<t)return;const f=u&&l-u;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const a=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(n=e,r||(r=setTimeout(()=>{r=null,a(n)},i-s)))},()=>n&&a(n)]}(n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,l=o(s);r=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&i<=a?(a-i)/l:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},Ys=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Gs=e=>(...t)=>hs.asap(()=>e(...t)),Xs=js.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,js.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(js.origin),js.navigator&&/(msie|trident)/i.test(js.navigator.userAgent)):()=>!0,Zs=js.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const a=[e+"="+encodeURIComponent(t)];hs.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),hs.isString(r)&&a.push("path="+r),hs.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function el(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const tl=e=>e instanceof Hs?{...e}:e;function nl(e,t){t=t||{};const n={};function r(e,t,n,r){return hs.isPlainObject(e)&&hs.isPlainObject(t)?hs.merge.call({caseless:r},e,t):hs.isPlainObject(t)?hs.merge({},t):hs.isArray(t)?t.slice():t}function o(e,t,n,o){return hs.isUndefined(t)?hs.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!hs.isUndefined(t))return r(void 0,t)}function a(e,t){return hs.isUndefined(t)?hs.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>o(tl(e),tl(t),0,!0)};return hs.forEach(Object.keys({...e,...t}),function(r){const i=l[r]||o,a=i(e[r],t[r],r);hs.isUndefined(a)&&i!==s||(n[r]=a)}),n}const rl=e=>{const t=nl({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=Hs.from(a),t.url=Ns(el(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),hs.isFormData(n))if(js.hasStandardBrowserEnv||js.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(hs.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&a.set(e,n)})}if(js.hasStandardBrowserEnv&&(r&&hs.isFunction(r)&&(r=r(t)),r||!1!==r&&Xs(t.url))){const e=o&&i&&Zs.read(i);e&&a.set(o,e)}return t},ol="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=rl(e);let o=r.data;const i=Hs.from(r.headers).normalize();let a,s,l,u,c,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=r;function h(){u&&u(),c&&c(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let g=new XMLHttpRequest;function m(){if(!g)return;const r=Hs.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());Qs(function(e){t(e),h()},function(e){n(e),h()},{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(m)},g.onabort=function(){g&&(n(new gs("Request aborted",gs.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=new gs(t&&t.message?t.message:"Network Error",gs.ERR_NETWORK,e,g);r.event=t||null,n(r),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Ps;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new gs(t,o.clarifyTimeoutError?gs.ETIMEDOUT:gs.ECONNABORTED,e,g)),g=null},void 0===o&&i.setContentType(null),"setRequestHeader"in g&&hs.forEach(i.toJSON(),function(e,t){g.setRequestHeader(t,e)}),hs.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),p&&([l,c]=Js(p,!0),g.addEventListener("progress",l)),f&&g.upload&&([s,u]=Js(f),g.upload.addEventListener("progress",s),g.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=t=>{g&&(n(!t||t.type?new Ks(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===js.protocols.indexOf(y)?n(new gs("Unsupported protocol "+y+":",gs.ERR_BAD_REQUEST,e)):g.send(o||null)})},il=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof gs?t:new Ks(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new gs(`timeout ${t} of ms exceeded`,gs.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>hs.asap(a),s}},al=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},sl=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ll=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of sl(e))yield*al(n,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw s(t),t}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:ul}=hs,cl=(({Request:e,Response:t})=>({Request:e,Response:t}))(hs.global),{ReadableStream:dl,TextEncoder:fl}=hs.global,pl=(e,...t)=>{try{return!!e(...t)}catch(Ie){return!1}},hl=e=>{e=hs.merge.call({skipUndefined:!0},cl,e);const{fetch:t,Request:n,Response:r}=e,o=t?ul(t):"function"==typeof fetch,i=ul(n),a=ul(r);if(!o)return!1;const s=o&&ul(dl),l=o&&("function"==typeof fl?(e=>t=>e.encode(t))(new fl):async e=>new Uint8Array(await new n(e).arrayBuffer())),u=i&&s&&pl(()=>{let e=!1;const t=new n(js.origin,{body:new dl,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),c=a&&s&&pl(()=>hs.isReadableStream(new r("").body)),d={stream:c&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new gs(`Response type '${e}' is not supported`,gs.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=hs.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(hs.isBlob(e))return e.size;if(hs.isSpecCompliantForm(e)){const t=new n(js.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return hs.isArrayBufferView(e)||hs.isArrayBuffer(e)?e.byteLength:(hs.isURLSearchParams(e)&&(e+=""),hs.isString(e)?(await l(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:a,data:s,signal:l,cancelToken:p,timeout:h,onDownloadProgress:g,onUploadProgress:m,responseType:y,headers:v,withCredentials:b="same-origin",fetchOptions:k}=rl(e),w=t||fetch;y=y?(y+"").toLowerCase():"text";let x=il([l,p&&p.toAbortSignal()],h),S=null;const E=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let C;try{if(m&&u&&"get"!==a&&"head"!==a&&0!==(C=await f(v,s))){let e,t=new n(o,{method:"POST",body:s,duplex:"half"});if(hs.isFormData(s)&&(e=t.headers.get("content-type"))&&v.setContentType(e),t.body){const[e,n]=Ys(C,Js(Gs(m)));s=ll(t.body,65536,e,n)}}hs.isString(b)||(b=b?"include":"omit");const t=i&&"credentials"in n.prototype,l={...k,signal:x,method:a.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:"half",credentials:t?b:void 0};S=i&&new n(o,l);let p=await(i?w(S,k):w(o,l));const h=c&&("stream"===y||"response"===y);if(c&&(g||h&&E)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=p[t]});const t=hs.toFiniteNumber(p.headers.get("content-length")),[n,o]=g&&Ys(t,Js(Gs(g),!0))||[];p=new r(ll(p.body,65536,n,()=>{o&&o(),E&&E()}),e)}y=y||"text";let T=await d[hs.findKey(d,y)||"text"](p,e);return!h&&E&&E(),await new Promise((t,n)=>{Qs(t,n,{data:T,headers:Hs.from(p.headers),status:p.status,statusText:p.statusText,config:e,request:S})})}catch(T){if(E&&E(),T&&"TypeError"===T.name&&/Load failed|fetch/i.test(T.message))throw Object.assign(new gs("Network Error",gs.ERR_NETWORK,e,S),{cause:T.cause||T});throw gs.from(T,T&&T.code,e,S)}}},gl=new Map,ml=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let a,s,l=i.length,u=gl;for(;l--;)a=i[l],s=u.get(a),void 0===s&&u.set(a,s=l?new Map:hl(t)),u=s;return s};ml();const yl={http:null,xhr:ol,fetch:{get:ml}};hs.forEach(yl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(Ie){}Object.defineProperty(e,"adapterName",{value:t})}});const vl=e=>`- ${e}`,bl=e=>hs.isFunction(e)||null===e||!1===e,kl=(e,t)=>{e=hs.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let a=0;a<n;a++){let n;if(r=e[a],o=r,!bl(r)&&(o=yl[(n=String(r)).toLowerCase()],void 0===o))throw new gs(`Unknown adapter '${n}'`);if(o&&(hs.isFunction(o)||(o=o.get(t))))break;i[n||"#"+a]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new gs("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(vl).join("\n"):" "+vl(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function wl(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ks(null,e)}function xl(e){wl(e),e.headers=Hs.from(e.headers),e.data=qs.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return kl(e.adapter||Fs.adapter,e)(e).then(function(t){return wl(e),t.data=qs.call(e,e.transformResponse,t),t.headers=Hs.from(t.headers),t},function(t){return Ws(t)||(wl(e),t&&t.response&&(t.response.data=qs.call(e,e.transformResponse,t.response),t.response.headers=Hs.from(t.response.headers))),Promise.reject(t)})}const Sl="1.12.2",El={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{El[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Cl={};El.transitional=function(e,t,n){return(r,o,i)=>{if(!1===e)throw new gs(function(e,t){return"[Axios v"+Sl+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}(o," has been removed"+(t?" in "+t:"")),gs.ERR_DEPRECATED);return t&&!Cl[o]&&(Cl[o]=!0),!e||e(r,o,i)}},El.spelling=function(e){return(e,t)=>!0};const Tl={assertOptions:function(e,t,n){if("object"!=typeof e)throw new gs("options must be an object",gs.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new gs("option "+i+" must be "+n,gs.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new gs("Unknown option "+i,gs.ERR_BAD_OPTION)}},validators:El},Nl=Tl.validators;let Ol=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Os,response:new Os}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(Ie){}}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=nl(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Tl.assertOptions(n,{silentJSONParsing:Nl.transitional(Nl.boolean),forcedJSONParsing:Nl.transitional(Nl.boolean),clarifyTimeoutError:Nl.transitional(Nl.boolean)},!1),null!=r&&(hs.isFunction(r)?t.paramsSerializer={serialize:r}:Tl.assertOptions(r,{encode:Nl.function,serialize:Nl.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Tl.assertOptions(t,{baseUrl:Nl.spelling("baseURL"),withXsrfToken:Nl.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&hs.merge(o.common,o[t.method]);o&&hs.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Hs.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))});const l=[];let u;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let c,d=0;if(!s){const e=[xl.bind(this),void 0];for(e.unshift(...a),e.push(...l),c=e.length,u=Promise.resolve(t);d<c;)u=u.then(e[d++],e[d++]);return u}c=a.length;let f=t;for(;d<c;){const e=a[d++],t=a[d++];try{f=e(f)}catch(p){t.call(this,p);break}}try{u=xl.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,c=l.length;d<c;)u=u.then(l[d++],l[d++]);return u}getUri(e){return Ns(el((e=nl(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};hs.forEach(["delete","get","head","options"],function(e){Ol.prototype[e]=function(t,n){return this.request(nl(n||{},{method:e,url:t,data:(n||{}).data}))}}),hs.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(nl(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ol.prototype[e]=t(),Ol.prototype[e+"Form"]=t(!0)});const Pl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pl).forEach(([e,t])=>{Pl[t]=e});const Ll=function e(t){const n=new Ol(t),r=Ta(Ol.prototype.request,n);return hs.extend(r,Ol.prototype,n,{allOwnKeys:!0}),hs.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(nl(t,n))},r}(Fs);Ll.Axios=Ol,Ll.CanceledError=Ks,Ll.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Ks(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},Ll.isCancel=Ws,Ll.VERSION=Sl,Ll.toFormData=xs,Ll.AxiosError=gs,Ll.Cancel=Ll.CanceledError,Ll.all=function(e){return Promise.all(e)},Ll.spread=function(e){return function(t){return e.apply(null,t)}},Ll.isAxiosError=function(e){return hs.isObject(e)&&!0===e.isAxiosError},Ll.mergeConfig=nl,Ll.AxiosHeaders=Hs,Ll.formToJSON=e=>Ds(hs.isHTMLForm(e)?new FormData(e):e),Ll.getAdapter=kl,Ll.HttpStatusCode=Pl,Ll.default=Ll;const{Axios:_l,AxiosError:Rl,CanceledError:Il,isCancel:Al,CancelToken:zl,VERSION:jl,all:Dl,Cancel:Fl,isAxiosError:Ml,spread:Ul,toFormData:Bl,AxiosHeaders:$l,HttpStatusCode:Vl,formToJSON:Hl,getAdapter:ql,mergeConfig:Wl}=Ll;class Kl{constructor(e,t){this.licenseToken=t,this.sessionToken=this._getOrCreateSessionToken(t),this.api=Ll.create({baseURL:e||qi,timeout:oa,headers:{"Content-Type":"application/json"}}),this.api.interceptors.request.use(e=>(this.licenseToken&&(e.headers.Authorization=`Bearer ${this.licenseToken}`),e))}_generateSessionToken(){return"session_"+Array.from(crypto.getRandomValues(new Uint8Array(28))).map(e=>e.toString(16).padStart(2,"0")).join("")}_getStorageKey(e){return`tiagpc_session_${e.substring(0,16)}`}_getOrCreateSessionToken(e){const t=this._getStorageKey(e);try{const e=localStorage.getItem(t);if(e){const{sessionToken:n,timestamp:r,validated:o}=JSON.parse(e),i=Date.now();if(o&&i-r<864e5)return n;localStorage.removeItem(t)}}catch(n){}return this._generateSessionToken()}hasValidCachedSession(){const e=this._getStorageKey(this.licenseToken);try{const t=localStorage.getItem(e);if(t){const{sessionToken:e,timestamp:n,validated:r}=JSON.parse(t),o=Date.now();return r&&o-n<864e5}}catch(t){}return!1}_saveSessionToken(e,t,n=!1){const r=this._getStorageKey(e);try{const e={sessionToken:t,timestamp:Date.now(),validated:n};localStorage.setItem(r,JSON.stringify(e))}catch(o){}}_clearSessionToken(e){const t=this._getStorageKey(e);try{localStorage.removeItem(t)}catch(n){}}async sendMessage(e,t,n){if(!this.licenseToken)throw new Error("License token is required.");const r=this.hasValidCachedSession();if(!t&&!r)throw new Error("Turnstile token is required for anti-bot validation.");const o=`${this.api.defaults.baseURL}/ask`;try{const r=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.licenseToken}`},body:JSON.stringify({message:e,turnstile_token:t||"CACHED_SESSION",session_token:this.sessionToken})});if(!r.ok){const e=await r.json().catch(()=>({}));throw new Error(JSON.stringify({statusCode:r.status,errorCode:e.error_code||"UNKNOWN_ERROR",message:e.message||"Request failed",retryAfter:e.retry_after_seconds||null}))}const a=r.body.getReader(),s=new TextDecoder;let l="",u="",c=null,d=null;for(;;){const{done:e,value:t}=await a.read();if(e)break;l+=s.decode(t,{stream:!0});const r=l.split("\n");l=r.pop();for(const o of r){if(!o.trim()||!o.startsWith("data: "))continue;const e=o.replace("data: ","").trim();if("[DONE]"!==e)try{const t=JSON.parse(e);if("content"===t.type)u+=t.text,n&&n(t.text);else if("metadata"===t.type)c=t;else if("summary"===t.type)d=t;else if("error"===t.type)throw new Error(JSON.stringify({statusCode:t.status_code||500,errorCode:t.error_code,message:t.message,retryAfter:null}))}catch(i){if(i.message&&i.message.startsWith("{"))throw i}}}if(!d)throw new Error("No summary received from server");return{success:!0,data:{message_id:d.message_id,response:u,cost_usd:d.cost_usd,credit_balance_usd:d.credit_balance_usd,input_tokens:d.input_tokens,output_tokens:d.output_tokens,response_time_ms:d.response_time_ms,model_used:d.model_used,created_at:d.created_at}}}catch(a){if(a.message.startsWith("{"))throw a;throw new Error(JSON.stringify({statusCode:500,errorCode:"NETWORK_ERROR",message:a.message,retryAfter:null}))}}async releaseSession(){if(this.licenseToken)try{return(await this.api.post("/release-session",{session_token:this.sessionToken})).data}catch(e){}}async getInitConfig(){if(!this.licenseToken)throw new Error("License token is required.");try{return(await this.api.get("/init")).data}catch(e){this._handleError(e)}}async checkHealth(){try{return(await this.api.get("/health")).data}catch(e){return{status:"unhealthy",error:e.message}}}getSessionToken(){return this.sessionToken}renewSessionToken(){const e=this._generateSessionToken();this.sessionToken=e,this._saveSessionToken(this.licenseToken,e)}validateSession(){this._saveSessionToken(this.licenseToken,this.sessionToken,!0)}_handleError(e){if(e.response){const t=e.response.data,n={statusCode:e.response.status,errorCode:t.error_code||"UNKNOWN_ERROR",message:t.message||"Request failed",retryAfter:t.retry_after_seconds||null};throw new Error(JSON.stringify(n))}throw e.request?new Error(JSON.stringify({statusCode:503,errorCode:"NETWORK_ERROR",message:"No response from server",retryAfter:null})):new Error(JSON.stringify({statusCode:500,errorCode:"INTERNAL_ERROR",message:e.message,retryAfter:null}))}}const Ql=e=>"string"==typeof e,Jl=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Yl=e=>null==e?"":""+e,Gl=/###/g,Xl=e=>e&&e.indexOf("###")>-1?e.replace(Gl,"."):e,Zl=e=>!e||Ql(e),eu=(e,t,n)=>{const r=Ql(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(Zl(e))return{};const t=Xl(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return Zl(e)?{}:{obj:e,k:Xl(r[o])}},tu=(e,t,n)=>{const{obj:r,k:o}=eu(e,t,Object);if(void 0!==r||1===t.length)return void(r[o]=n);let i=t[t.length-1],a=t.slice(0,t.length-1),s=eu(e,a,Object);for(;void 0===s.obj&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),s=eu(e,a,Object),s?.obj&&void 0!==s.obj[`${s.k}.${i}`]&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=n},nu=(e,t)=>{const{obj:n,k:r}=eu(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},ru=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?Ql(e[r])||e[r]instanceof String||Ql(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):ru(e[r],t[r],n):e[r]=t[r]);return e},ou=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var iu={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const au=e=>Ql(e)?e.replace(/[&<>"'\/]/g,e=>iu[e]):e;const su=[" ",",","?","!",";"],lu=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),uu=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const r=t.split(n);let o=e;for(let i=0;i<r.length;){if(!o||"object"!=typeof o)return;let e,t="";for(let a=i;a<r.length;++a)if(a!==i&&(t+=n),t+=r[a],e=o[t],void 0!==e){if(["string","number","boolean"].indexOf(typeof e)>-1&&a<r.length-1)continue;i+=a-i+1;break}o=e}return o},cu=e=>e?.replace("_","-"),du={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){}};class fu{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||du,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(Ql(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new fu(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new fu(this.logger,e)}}var pu=new fu;class hu{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let o=0;o<r;o++)n.apply(n,[e,...t])})}}}class gu extends hu{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):Ql(n)&&o?a.push(...n.split(o)):a.push(n)));const s=nu(this.data,a);return!s&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!s&&i&&Ql(n)?uu(this.data?.[e]?.[t],n,o):s}addResource(e,t,n,r,o={silent:!1}){const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),tu(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(const o in n)(Ql(n[o])||Array.isArray(n[o]))&&this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o,i={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let s=nu(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?ru(s,n,o):s={...s,...n},tu(this.data,a,s),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var mu={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,o)??t}),t}};const yu=Symbol("i18next/PATH_KEY");function vu(e,t){const{[yu]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(r,o)=>(n?.revoke?.(),o===yu?e:(e.push(o),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return n.join(t?.keySeparator??".")}const bu={},ku=e=>!Ql(e)&&"boolean"!=typeof e&&"number"!=typeof e;class wu extends hu{constructor(e,t={}){super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=pu.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const r=this.resolve(e,n);if(void 0===r?.res)return!1;const o=ku(r.res);return!1!==n.returnObjects||!o}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=su.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const o=lu.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r));if(i&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Ql(o)?[o]:o};const i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:Ql(o)?[o]:o}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=vu(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]);const o=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],r),l=s[s.length-1];let u=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");const c=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===c?.toLowerCase())return d?o?{res:`${l}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${u}${a}`:o?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:a;const f=this.resolve(e,r);let p=f?.res;const h=f?.usedKey||a,g=f?.exactUsedKey||a,m=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==r.count&&!Ql(r.count),b=wu.hasDefaultValue(r),k=v?this.pluralResolver.getSuffix(c,r.count,r):"",w=r.ordinal&&v?this.pluralResolver.getSuffix(c,r.count,{ordinal:!1}):"",x=v&&!r.ordinal&&0===r.count,S=x&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${k}`]||r[`defaultValue${w}`]||r.defaultValue;let E=p;y&&!p&&b&&(E=S);const C=ku(E),T=Object.prototype.toString.apply(E);if(!(y&&E&&C&&["[object Number]","[object Function]","[object RegExp]"].indexOf(T)<0)||Ql(m)&&Array.isArray(E))if(y&&Ql(m)&&Array.isArray(p))p=p.join(m),p&&(p=this.extendTranslation(p,e,r,n));else{let t=!1,o=!1;!this.isValidLookup(p)&&b&&(t=!0,p=S),this.isValidLookup(p)||(o=!0,p=a);const s=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:p,d=b&&S!==p&&this.options.updateMissing;if(o||t||d){if(this.logger.log(d?"updateKey":"missingKey",c,l,a,d?S:p),i){const e=this.resolve(a,{...r,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let r=0;r<t.length;r++)e.push(t[r]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);const n=(e,t,n)=>{const o=b&&n!==p?n:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,o,d,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,o,d,r),this.emit("missingKey",e,l,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,r);x&&r[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],a+t,r[`defaultValue${t}`]||S)})}):n(e,a,S))}p=this.extendTranslation(p,e,r,f,n),o&&p===a&&this.options.appendNamespaceToMissingKey&&(p=`${l}${u}${a}`),(o||t)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${a}`:a,t?p:void 0,r))}else{if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...r,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return o?(f.res=e,f.usedParams=this.getUsedParamsDetails(r),f):e}if(i){const e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(const o in E)if(Object.prototype.hasOwnProperty.call(E,o)){const e=`${n}${i}${o}`;t[o]=b&&!p?this.translate(e,{...r,defaultValue:ku(S)?S[o]:void 0,joinArrays:!1,ns:s}):this.translate(e,{...r,joinArrays:!1,ns:s}),t[o]===e&&(t[o]=E[o])}p=t}}return o?(f.res=p,f.usedParams=this.getUsedParamsDetails(r),f):p}extendTranslation(e,t,n,r,o){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const i=Ql(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(i){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=n.replace&&!Ql(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),i){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>o?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,a=Ql(i)?[i]:i;return null!=e&&a?.length&&!1!==n.applyPostProcessor&&(e=mu.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,o,i,a;return Ql(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;const s=this.extractFromKey(e,t),l=s.key;r=l;let u=s.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const c=void 0!==t.count&&!Ql(t.count),d=c&&!t.ordinal&&0===t.count,f=void 0!==t.context&&(Ql(t.context)||"number"==typeof t.context)&&""!==t.context,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(e=>{this.isValidLookup(n)||(a=e,bu[`${p[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(a)||(bu[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(r=>{if(this.isValidLookup(n))return;i=r;const a=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,r,e,t);else{let e;c&&(e=this.pluralResolver.getSuffix(r,t.count,t));const n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(t.ordinal&&0===e.indexOf(o)&&a.push(l+e.replace(o,this.options.pluralSeparator)),a.push(l+e),d&&a.push(l+n)),f){const r=`${l}${this.options.contextSeparator||"_"}${t.context}`;a.push(r),c&&(t.ordinal&&0===e.indexOf(o)&&a.push(r+e.replace(o,this.options.pluralSeparator)),a.push(r+e),d&&a.push(r+n))}}let s;for(;s=a.pop();)this.isValidLookup(n)||(o=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:o,usedLng:i,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Ql(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}class xu{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=pu.create("languageUtils")}getScriptPartFromCode(e){if(!(e=cu(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=cu(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Ql(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(Ie){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?e:e.indexOf("-")<0&&r.indexOf("-")<0?void 0:e.indexOf("-")>0&&r.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Ql(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Ql(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):Ql(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))}),r}}const Su={zero:0,one:1,two:2,few:3,many:4,other:5},Eu={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Cu{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=pu.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=cu("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(n,{type:r})}catch(a){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Eu;if(!e.match(/-|_/))return Eu;const n=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(n,t)}return this.pluralRulesCache[o]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Su[e]-Su[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){const r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const Tu=(e,t,n,r=".",o=!0)=>{let i=((e,t,n)=>{const r=nu(e,n);return void 0!==r?r:nu(t,n)})(e,t,n);return!i&&o&&Ql(n)&&(i=uu(e,n,r),void 0===i&&(i=uu(t,n,r))),i},Nu=e=>e.replace(/\$/g,"$$$$");class Ou{constructor(e={}){this.logger=pu.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:au,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?ou(o):i||"{{",this.suffix=a?ou(a):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?ou(d):f||ou("$t("),this.nestingSuffix=p?ou(p):h||ou(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let o,i,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const o=Tu(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(Tu(t,s,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const u=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=void 0!==r?.interpolation?.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Nu(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Nu(this.escape(e)):Nu(e)}].forEach(t=>{for(a=0;o=t.regex.exec(e);){const n=o[1].trim();if(i=l(n),void 0===i)if("function"==typeof u){const t=u(e,o,r);i=Ql(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(c){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else Ql(i)||this.useRawValueToEscape||(i=Yl(i));const s=t.safeValue(i);if(e=e.replace(o[0],s),c?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,o,i;const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let o=`{${r[1]}`;e=r[0],o=this.interpolate(o,i);const a=o.match(/'/g),s=o.match(/"/g);((a?.length??0)%2==0&&!s||s.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(Ie){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,Ie),`${e}${n}${o}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];i={...n},i=i.replace&&!Ql(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;const l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(s=r[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),o=t(a.call(this,r[1].trim(),i),i),o&&r[0]===e&&!Ql(o))return o;Ql(o)||(o=Yl(o)),o||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),o=""),s.length&&(o=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),o.trim())),e=e.replace(r[0],o),this.regexp.lastIndex=0}return e}}const Pu=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const a=r+JSON.stringify(i);let s=t[a];return s||(s=e(cu(r),o),t[a]=s),s(n)}},Lu=e=>(t,n,r)=>e(cu(n),r)(t);class _u{constructor(e={}){this.logger=pu.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?Pu:Lu;this.formats={number:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Pu(t)}format(e,t,n,r={}){const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(e=>e.indexOf(")")>-1)){const e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}const i=o.reduce((e,t)=>{const{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{const a=r?.formatParams?.[r.interpolationkey]||{},s=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,s,{...i,...r,...a})}catch(a){this.logger.warn(a)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class Ru extends hu{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=pu.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){const o={},i={},a={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:o}=eu(e,t,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,o=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*o,i)},o):i(a,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,a);try{const n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(l){a(l)}}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Ql(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Ql(t)&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o,i={},a=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const l={...i,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let o;o=5===u.length?u(e,t,n,r,l):u(e,t,n,r),o&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(s){a(s)}else u(e,t,n,r,a,l)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Iu=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Ql(e[1])&&(t.defaultValue=e[1]),Ql(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Au=e=>(Ql(e.ns)&&(e.ns=[e.ns]),Ql(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ql(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),zu=()=>{};class ju extends hu{constructor(e={},t){var n;if(super(),this.options=Au(e),this.services={},this.logger=pu,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(Ql(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=Iu();this.options={...n,...this.options,...Au(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);const r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?pu.init(r(this.modules.logger),this.options):pu.init(null,this.options),e=this.modules.formatter?this.modules.formatter:_u;const t=new xu(this.options);this.store=new gu(this.options.resources,this.options);const o=this.services;o.logger=pu,o.resourceStore=this.store,o.languageUtils=t,o.pluralResolver=new Cu(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(o.formatter=r(e),o.formatter.init&&o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new Ou(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new Ru(r(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(o.languageDetector=r(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=r(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new wu(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=zu),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const o=Jl(),i=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?i():setTimeout(i,0),o}loadResources(e,t=zu){let n=t;const r=Ql(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===r?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(r)t(r);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){const r=Jl();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=zu),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&mu.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Jl();this.emit("languageChanging",e);const r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,i)=>{i?this.isLanguageChangingTo===e&&(r(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(o,(...e)=>this.t(...e))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Ql(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Ql(t)?[t]:t);i&&(this.language||r(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector?.cacheUserLanguage?.(i)),this.loadResources(i,e=>{o(e,i)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const r=(e,t,...o)=>{let i;i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(o)):{...t},i.lng=i.lng||r.lng,i.lngs=i.lngs||r.lngs,i.ns=i.ns||r.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||r.keyPrefix);const a=this.options.keySeparator||".";let s;return i.keyPrefix&&Array.isArray(e)?s=e.map(e=>("function"==typeof e&&(e=vu(e,{...this.options,...t})),`${i.keyPrefix}${a}${e}`)):("function"==typeof e&&(e=vu(e,{...this.options,...t})),s=i.keyPrefix?`${i.keyPrefix}${a}${e}`:e),this.t(s,i)};return Ql(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,e)||r&&!i(o,e)))}loadNamespaces(e,t){const n=Jl();return this.options.ns?(Ql(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Jl();Ql(e)&&(e=[e]);const r=this.options.preload||[],o=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(Ie){}const t=this.services?.languageUtils||new xu(Iu());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new ju(e,t)}cloneInstance(e={},t=zu){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new ju(r);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));if(["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{});o.store=new gu(e,r),o.services.resourceStore=o.store}return o.translator=new wu(o.services,r),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Du=ju.createInstance();Du.createInstance=ju.createInstance,Du.createInstance,Du.dir,Du.init,Du.loadResources,Du.reloadResources,Du.use,Du.changeLanguage,Du.getFixedT,Du.t,Du.exists,Du.setDefaultNamespace,Du.hasLoadedNamespace,Du.loadNamespaces,Du.loadLanguages;const{slice:Fu,forEach:Mu}=[];const Uu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Bu={create(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*n*1e3)),r&&(o.domain=r),document.cookie=function(e,t){const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let r=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){const e=n.maxAge-0;if(Number.isNaN(e))throw new Error("maxAge should be a Number");r+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!Uu.test(n.domain))throw new TypeError("option domain is invalid");r+=`; Domain=${n.domain}`}if(n.path){if(!Uu.test(n.path))throw new TypeError("option path is invalid");r+=`; Path=${n.path}`}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw new TypeError("option expires is invalid");r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return n.partitioned&&(r+="; Partitioned"),r}(e,t,o)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let e=n[r];for(;" "===e.charAt(0);)e=e.substring(1,e.length);if(0===e.indexOf(t))return e.substring(t.length,e.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var $u={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!=typeof document)return Bu.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:i}=t;n&&"undefined"!=typeof document&&Bu.create(n,e,r,o,i)}},Vu={name:"querystring",lookup(e){let t,{lookupQuerystring:n}=e;if("undefined"!=typeof window){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(e=window.location.hash.substring(window.location.hash.indexOf("?")));const r=e.substring(1).split("&");for(let o=0;o<r.length;o++){const e=r[o].indexOf("=");if(e>0){r[o].substring(0,e)===n&&(t=r[o].substring(e+1))}}}return t}},Hu={name:"hash",lookup(e){let t,{lookupHash:n,lookupFromHashIndex:r}=e;if("undefined"!=typeof window){const{hash:e}=window.location;if(e&&e.length>2){const o=e.substring(1);if(n){const e=o.split("&");for(let r=0;r<e.length;r++){const o=e[r].indexOf("=");if(o>0){e[r].substring(0,o)===n&&(t=e[r].substring(o+1))}}}if(t)return t;if(!t&&r>-1){const t=e.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(t))return;const n="number"==typeof r?r:0;return t[n]?.replace("/","")}}}return t}};let qu=null;const Wu=()=>{if(null!==qu)return qu;try{if(qu="undefined"!=typeof window&&null!==window.localStorage,!qu)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(Ie){qu=!1}return qu};var Ku={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&Wu())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Wu()&&window.localStorage.setItem(n,e)}};let Qu=null;const Ju=()=>{if(null!==Qu)return Qu;try{if(Qu="undefined"!=typeof window&&null!==window.sessionStorage,!Qu)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(Ie){Qu=!1}return Qu};var Yu={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Ju())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Ju()&&window.sessionStorage.setItem(n,e)}},Gu={name:"navigator",lookup(e){const t=[];if("undefined"!=typeof navigator){const{languages:e,userLanguage:n,language:r}=navigator;if(e)for(let o=0;o<e.length;o++)t.push(e[o]);n&&t.push(n),r&&t.push(r)}return t.length>0?t:void 0}},Xu={name:"htmlTag",lookup(e){let t,{htmlTag:n}=e;const r=n||("undefined"!=typeof document?document.documentElement:null);return r&&"function"==typeof r.getAttribute&&(t=r.getAttribute("lang")),t}},Zu={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if("undefined"==typeof window)return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(n))return;const r="number"==typeof t?t:0;return n[r]?.replace("/","")}},ec={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n="number"==typeof t?t+1:1,r="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let tc=!1;try{document.cookie,tc=!0}catch(Ie){}const nc=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];tc||nc.splice(1,1);class rc{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=function(e){return Mu.call(Fu.call(arguments,1),t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])}),e}(t,this.options||{},{order:nc,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector($u),this.addDetector(Vu),this.addDetector(Ku),this.addDetector(Yu),this.addDetector(Gu),this.addDetector(Xu),this.addDetector(Zu),this.addDetector(ec),this.addDetector(Hu)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order,t=[];return e.forEach(e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&"string"==typeof n&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(e=>{return null!=e&&!("string"==typeof(t=e)&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(e=>e.test(t)));var t}).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)}))}}rc.type="languageDetector";const oc={widget:{title:"TIA GPC",poweredBy:"Desarrollado por TIA GPC",questionsTo:"Preguntas a"},chat:{title:"Asistente",placeholder:"Escribe tu pregunta...",send:"Enviar",close:"Cerrar",welcome:"¡Hola! Bienvenido a {{companyName}}. ¿En qué puedo ayudarte hoy?",emptyState:"Inicia una conversación escribiendo tu pregunta",validation:"Verificando seguridad...",retry:"Reintentar"},theme:{light:"Claro",dark:"Oscuro",toggle:"Cambiar tema"},errors:{unauthorized:"Autenticación fallida. Por favor, verifica tu token de licencia e intenta nuevamente.",validation:"Verificación anti-bot fallida. Por favor, recarga la página e intenta nuevamente.",network:"No se pudo conectar al servidor. Verifica tu conexión a internet.",rateLimit:"Has realizado demasiadas consultas o se alcanzó el límite de usuarios concurrentes. Por favor, espera un momento antes de continuar.",session:"Tu sesión ha expirado por inactividad. Por favor, recarga la página para continuar.",insufficientCredits:"Créditos insuficientes. Por favor, recarga créditos desde tu panel de administración para continuar usando TIA GPC.",generic:"Ha ocurrido un error inesperado. Por favor, intenta nuevamente.",aiServiceUnavailable:"El asistente está temporalmente no disponible. Por favor, intenta de nuevo en unos momentos.",serverError:"El servidor encontró un problema. Por favor, intenta de nuevo más tarde.",domainUnauthorized:"Este dominio no está autorizado para usar este widget. Por favor, contacta a tu administrador."},turnstile:{verifying:"Verificando que eres humano...",error:"No se pudo completar la verificación de seguridad. Por favor, recarga la página e intenta nuevamente."},metadata:{tokensUsed:"Tokens usados",responseTime:"Tiempo de respuesta",model:"Modelo"}},ic={widget:{title:"TIA GPC",poweredBy:"Powered by TIA GPC",questionsTo:"Questions to"},chat:{title:"Assistant",placeholder:"Type your question...",send:"Send",close:"Close",welcome:"Hello! Welcome to {{companyName}}. How can I help you today?",emptyState:"Start a conversation by typing your question",validation:"Verifying security...",retry:"Retry"},theme:{light:"Light",dark:"Dark",toggle:"Toggle theme"},errors:{unauthorized:"Authentication failed. Please check your license token and try again.",validation:"Bot verification failed. Please reload the page and try again.",network:"Unable to connect to the server. Please check your internet connection.",rateLimit:"You've made too many requests or the concurrent user limit has been reached. Please wait a moment before continuing.",session:"Your session has expired due to inactivity. Please reload the page to continue.",insufficientCredits:"Insufficient credits. Please reload credits from your admin panel to continue using TIA GPC.",generic:"An unexpected error has occurred. Please try again.",aiServiceUnavailable:"The assistant is temporarily unavailable. Please try again in a few moments.",serverError:"The server encountered a problem. Please try again later.",domainUnauthorized:"This domain is not authorized to use this widget. Please contact your administrator."},turnstile:{verifying:"Verifying you're human...",error:"Security verification could not be completed. Please reload the page and try again."},metadata:{tokensUsed:"Tokens used",responseTime:"Response time",model:"Model"}},ac={widget:{title:"TIA GPC",poweredBy:"Propulsé par TIA GPC",questionsTo:"Questions à"},chat:{title:"Assistant",placeholder:"Tapez votre question...",send:"Envoyer",close:"Fermer",welcome:"Bonjour ! Bienvenue à {{companyName}}. Comment puis-je vous aider aujourd'hui ?",emptyState:"Commencez une conversation en tapant votre question",validation:"Vérification de sécurité...",retry:"Réessayer"},theme:{light:"Clair",dark:"Sombre",toggle:"Changer de thème"},errors:{unauthorized:"Échec de l'authentification. Veuillez vérifier votre jeton de licence et réessayer.",validation:"La vérification anti-bot a échoué. Veuillez recharger la page et réessayer.",network:"Impossible de se connecter au serveur. Veuillez vérifier votre connexion internet.",rateLimit:"Vous avez fait trop de demandes ou la limite d'utilisateurs concurrents a été atteinte. Veuillez patienter un moment avant de continuer.",session:"Votre session a expiré en raison d'inactivité. Veuillez recharger la page pour continuer.",insufficientCredits:"Crédits insuffisants. Veuillez recharger des crédits depuis votre panneau d'administration pour continuer à utiliser TIA GPC.",generic:"Une erreur inattendue s'est produite. Veuillez réessayer.",aiServiceUnavailable:"L'assistant est temporairement indisponible. Veuillez réessayer dans quelques instants.",serverError:"Le serveur a rencontré un problème. Veuillez réessayer plus tard.",domainUnauthorized:"Ce domaine n'est pas autorisé à utiliser ce widget. Veuillez contacter votre administrateur."},turnstile:{verifying:"Vérification que vous êtes humain...",error:"La vérification de sécurité n'a pas pu être complétée. Veuillez recharger la page et réessayer."},metadata:{tokensUsed:"Tokens utilisés",responseTime:"Temps de réponse",model:"Modèle"}};Du.use(rc).use(M).init({resources:{en:{translation:ic},es:{translation:oc},fr:{translation:ac}},fallbackLng:"en",supportedLngs:["en","es","fr"],interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],caches:["localStorage"]}});const sc=({token:e,turnstileSiteKey:t="0x4AAAAAAB-BKyDZcYYqCbid",theme:n=Yi,position:r=Gi,language:o=Xi,primaryColor:i,width:a=Zi,height:s=ea,apiUrl:u=qi,onReady:c,onError:d,onClose:f,autoOpen:p=ta,showBranding:h=na,mobileFullscreen:g=ra,...m})=>{const[y,v]=l.useState(p),[b,k]=l.useState(!1),[w,x]=l.useState(null),[S,E]=l.useState(!0),C=l.useMemo(()=>new Kl(u,e),[u,e]);if(l.useEffect(()=>{const e=()=>{k(window.innerWidth<Ji)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),l.useEffect(()=>{o&&Du.changeLanguage&&Du.changeLanguage(o)},[o]),l.useEffect(()=>{(async()=>{if(e)try{const e=await C.getInitConfig();e.success&&(x(e.data),c&&c(e.data))}catch(t){d&&d(t)}finally{E(!1)}else E(!1)})()},[e,C,c,d]),!e)return null;return N.jsx(H,{i18n:Du,children:N.jsxs("div",{className:`gpc-widget gpc-widget-container ${b&&g?"gpc-position-bottom-right":`gpc-position-${r}`} ${"dark"===n?"gpc-dark":""}`,style:(()=>{const e={};return i&&(e["--gpc-color-primary"]=i),b&&g||(a&&(e["--gpc-widget-width"]=a),s&&(e["--gpc-widget-height"]=s)),e})(),children:[!y&&N.jsx(ie,{onClick:()=>v(!0),widgetConfig:w}),y&&!S&&N.jsx(Ca,{gpcService:C,licenseToken:e,widgetConfig:w,turnstileSiteKey:t,onClose:()=>{v(!1),f?.()},themeMode:n,showBranding:h,showMetadata:m.showMetadata||!1,onError:d})]})})};sc.defaultProps={theme:"auto",position:"bottom-right",language:"en",width:"400px",height:"600px",autoOpen:!1,showBranding:!0,mobileFullscreen:!0};class lc extends HTMLElement{constructor(){super(),this.root=null,this.mountPoint=null}static get observedAttributes(){return["token","theme","position","language","primary-color","width","height","api-url","turnstile-site-key","auto-open","show-branding","mobile-fullscreen"]}connectedCallback(){this.mountPoint=document.createElement("div"),this.mountPoint.className="tia-gpc-mount",this.appendChild(this.mountPoint),this.root=E.createRoot(this.mountPoint),this.render()}disconnectedCallback(){this.root&&(this.root.unmount(),this.root=null)}attributeChangedCallback(e,t,n){t!==n&&this.root&&this.render()}getProps(){const e={},t=this.getAttribute("token");t&&(e.token=t);const n=this.getAttribute("theme");n&&(e.theme=n);const r=this.getAttribute("position");r&&(e.position=r);const o=this.getAttribute("language");o&&(e.language=o);const i=this.getAttribute("primary-color");i&&(e.primaryColor=i);const a=this.getAttribute("width");a&&(e.width=a);const s=this.getAttribute("height");s&&(e.height=s);const l=this.getAttribute("api-url");l&&(e.apiUrl=l);const u=this.getAttribute("turnstile-site-key");u&&(e.turnstileSiteKey=u);const c=this.getAttribute("auto-open");null!==c&&(e.autoOpen="false"!==c);const d=this.getAttribute("show-branding");null!==d&&(e.showBranding="false"!==d);const f=this.getAttribute("mobile-fullscreen");return null!==f&&(e.mobileFullscreen="false"!==f),e.onReady=()=>{this.dispatchEvent(new CustomEvent("ready",{bubbles:!0,composed:!0}))},e.onError=e=>{this.dispatchEvent(new CustomEvent("error",{bubbles:!0,composed:!0,detail:e}))},e.onClose=()=>{this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))},e}render(){if(!this.root)return;const e=this.getProps();this.root.render(u.createElement(sc,e))}open(){this.dispatchEvent(new CustomEvent("open-widget",{bubbles:!0,composed:!0}))}close(){this.dispatchEvent(new CustomEvent("close-widget",{bubbles:!0,composed:!0}))}}"undefined"==typeof window||customElements.get("tia-gpc-widget")||customElements.define("tia-gpc-widget",lc),window.TiaGPC={version:"1.0.0",POSITIONS:Wi,THEMES:Ki,LANGUAGES:Qi,create(e){if(!e||!e.token)throw new Error('TiaGPC.create(): El parámetro "token" es requerido');const t=document.createElement("tia-gpc-widget");t.setAttribute("token",e.token),e.theme&&t.setAttribute("theme",e.theme),e.position&&t.setAttribute("position",e.position),e.language&&t.setAttribute("language",e.language),e.primaryColor&&t.setAttribute("primary-color",e.primaryColor),e.width&&t.setAttribute("width",e.width),e.height&&t.setAttribute("height",e.height),e.apiUrl&&t.setAttribute("api-url",e.apiUrl),e.turnstileSiteKey&&t.setAttribute("turnstile-site-key",e.turnstileSiteKey),void 0!==e.autoOpen&&t.setAttribute("auto-open",String(e.autoOpen)),void 0!==e.showBranding&&t.setAttribute("show-branding",String(e.showBranding)),void 0!==e.mobileFullscreen&&t.setAttribute("mobile-fullscreen",String(e.mobileFullscreen)),e.onReady&&t.addEventListener("ready",e.onReady),e.onError&&t.addEventListener("error",t=>e.onError(t.detail)),e.onClose&&t.addEventListener("close",e.onClose);return(e.container||document.body).appendChild(t),t},info(){return{version:this.version,positions:this.POSITIONS,themes:this.THEMES,languages:this.LANGUAGES}}};const uc=window.TiaGPC;return e.TiaGPCWebComponent=lc,e.default=uc,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),e}({});
|
|
206
206
|
//# sourceMappingURL=tia-gpc-widget.standalone.js.map
|