var Ph=Object.defineProperty;var sf=le=>{throw TypeError(le)};var Nh=(le,q,pe)=>q in le?Ph(le,q,{enumerable:!0,configurable:!0,writable:!0,value:pe}):le[q]=pe;var H=(le,q,pe)=>Nh(le,typeof q!="symbol"?q+"":q,pe),Rh=(le,q,pe)=>q.has(le)||sf("Cannot "+pe);var uf=(le,q,pe)=>q.has(le)?sf("Cannot add the same private member more than once"):q instanceof WeakSet?q.add(le):q.set(le,pe);var Ql=(le,q,pe)=>(Rh(le,q,"access private method"),pe);(function(){"use strict";var Qt,vs,af;function le(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var q={exports:{}},pe={},ks={exports:{}},P={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var _n=Symbol.for("react.element"),cf=Symbol.for("react.portal"),ff=Symbol.for("react.fragment"),df=Symbol.for("react.strict_mode"),pf=Symbol.for("react.profiler"),hf=Symbol.for("react.provider"),mf=Symbol.for("react.context"),gf=Symbol.for("react.forward_ref"),yf=Symbol.for("react.suspense"),vf=Symbol.for("react.memo"),kf=Symbol.for("react.lazy"),ws=Symbol.iterator;function wf(e){return e===null||typeof e!="object"?null:(e=ws&&e[ws]||e["@@iterator"],typeof e=="function"?e:null)}var xs={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ss=Object.assign,Es={};function Zt(e,t,n){this.props=e,this.context=t,this.refs=Es,this.updater=n||xs}Zt.prototype.isReactComponent={},Zt.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},Zt.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Cs(){}Cs.prototype=Zt.prototype;function Wl(e,t,n){this.props=e,this.context=t,this.refs=Es,this.updater=n||xs}var Kl=Wl.prototype=new Cs;Kl.constructor=Wl,Ss(Kl,Zt.prototype),Kl.isPureReactComponent=!0;var _s=Array.isArray,zs=Object.prototype.hasOwnProperty,Zl={current:null},Ts={key:!0,ref:!0,__self:!0,__source:!0};function Ls(e,t,n){var r,l={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)zs.call(t,r)&&!Ts.hasOwnProperty(r)&&(l[r]=t[r]);var s=arguments.length-2;if(s===1)l.children=n;else if(1>>1,re=E[G];if(0>>1;Gl(ys,L))Ktl(Hl,ys)?(E[G]=Hl,E[Kt]=L,G=Kt):(E[G]=ys,E[Wt]=L,G=Wt);else if(Ktl(Hl,L))E[G]=Hl,E[Kt]=L,G=Kt;else break e}}return T}function l(E,T){var L=E.sortIndex-T.sortIndex;return L!==0?L:E.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var u=[],a=[],h=1,m=null,d=3,y=!1,k=!1,w=!1,$=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(E){for(var T=n(a);T!==null;){if(T.callback===null)r(a);else if(T.startTime<=E)r(a),T.sortIndex=T.expirationTime,t(u,T);else break;T=n(a)}}function g(E){if(w=!1,p(E),!k)if(n(u)!==null)k=!0,ms(x);else{var T=n(a);T!==null&&gs(g,T.startTime-E)}}function x(E,T){k=!1,w&&(w=!1,f(z),z=-1),y=!0;var L=d;try{for(p(T),m=n(u);m!==null&&(!(m.expirationTime>T)||E&&!Ee());){var G=m.callback;if(typeof G=="function"){m.callback=null,d=m.priorityLevel;var re=G(m.expirationTime<=T);T=e.unstable_now(),typeof re=="function"?m.callback=re:m===n(u)&&r(u),p(T)}else r(u);m=n(u)}if(m!==null)var Vl=!0;else{var Wt=n(a);Wt!==null&&gs(g,Wt.startTime-T),Vl=!1}return Vl}finally{m=null,d=L,y=!1}}var C=!1,_=null,z=-1,V=5,R=-1;function Ee(){return!(e.unstable_now()-RE||125G?(E.sortIndex=L,t(a,E),n(u)===null&&E===n(a)&&(w?(f(z),z=-1):w=!0,gs(g,L-G))):(E.sortIndex=re,t(u,E),k||y||(k=!0,ms(x))),E},e.unstable_shouldYield=Ee,e.unstable_wrapCallback=function(E){var T=d;return function(){var L=d;d=T;try{return E.apply(this,arguments)}finally{d=L}}}})(js),Is.exports=js;var Rf=Is.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var $f=F,_e=Rf;function v(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ql=Object.prototype.hasOwnProperty,If=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Os={},Ds={};function jf(e){return ql.call(Ds,e)?!0:ql.call(Os,e)?!1:If.test(e)?Ds[e]=!0:(Os[e]=!0,!1)}function Mf(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Of(e,t,n,r){if(t===null||typeof t>"u"||Mf(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function me(e,t,n,r,l,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var ie={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ie[e]=new me(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ie[t]=new me(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){ie[e]=new me(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ie[e]=new me(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ie[e]=new me(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){ie[e]=new me(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){ie[e]=new me(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){ie[e]=new me(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){ie[e]=new me(e,5,!1,e.toLowerCase(),null,!1,!1)});var bl=/[\-:]([a-z])/g;function ei(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(bl,ei);ie[t]=new me(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(bl,ei);ie[t]=new me(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(bl,ei);ie[t]=new me(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){ie[e]=new me(e,1,!1,e.toLowerCase(),null,!1,!1)}),ie.xlinkHref=new me("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){ie[e]=new me(e,1,!1,e.toLowerCase(),null,!0,!0)});function ti(e,t,n,r){var l=ie.hasOwnProperty(t)?ie[t]:null;(l!==null?l.type!==0:r||!(2s||l[o]!==i[s]){var u=` `+l[o].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=o&&0<=s);break}}}finally{ai=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ln(e):""}function Df(e){switch(e.tag){case 5:return Ln(e.type);case 16:return Ln("Lazy");case 13:return Ln("Suspense");case 19:return Ln("SuspenseList");case 0:case 2:case 15:return e=ci(e.type,!1),e;case 11:return e=ci(e.type.render,!1),e;case 1:return e=ci(e.type,!0),e;default:return""}}function fi(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Gt:return"Fragment";case Yt:return"Portal";case ri:return"Profiler";case ni:return"StrictMode";case ii:return"Suspense";case oi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case As:return(e.displayName||"Context")+".Consumer";case Fs:return(e._context.displayName||"Context")+".Provider";case li:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case si:return t=e.displayName||null,t!==null?t:fi(e.type)||"Memo";case ut:t=e._payload,e=e._init;try{return fi(e(t))}catch{}}return null}function Ff(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fi(t);case 8:return t===ni?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function at(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Vs(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Af(e){var t=Vs(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Cr(e){e._valueTracker||(e._valueTracker=Af(e))}function Hs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Vs(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function _r(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function di(e,t){var n=t.checked;return W({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Qs(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=at(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ws(e,t){t=t.checked,t!=null&&ti(e,"checked",t,!1)}function pi(e,t){Ws(e,t);var n=at(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?hi(e,t.type,n):t.hasOwnProperty("defaultValue")&&hi(e,t.type,at(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ks(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function hi(e,t,n){(t!=="number"||_r(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Pn=Array.isArray;function Jt(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=zr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Nn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Rn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Uf=["Webkit","ms","Moz","O"];Object.keys(Rn).forEach(function(e){Uf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Rn[t]=Rn[e]})});function qs(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Rn.hasOwnProperty(e)&&Rn[e]?(""+t).trim():t+"px"}function bs(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=qs(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Bf=W({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yi(e,t){if(t){if(Bf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(v(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(v(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(v(61))}if(t.style!=null&&typeof t.style!="object")throw Error(v(62))}}function vi(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ki=null;function wi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xi=null,qt=null,bt=null;function eu(e){if(e=bn(e)){if(typeof xi!="function")throw Error(v(280));var t=e.stateNode;t&&(t=Yr(t),xi(e.stateNode,e.type,t))}}function tu(e){qt?bt?bt.push(e):bt=[e]:qt=e}function nu(){if(qt){var e=qt,t=bt;if(bt=qt=null,eu(e),t)for(e=0;e>>=0,e===0?32:31-(qf(e)/bf|0)|0}var Rr=64,$r=4194304;function Mn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ir(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~l;s!==0?r=Mn(s):(i&=o,i!==0&&(r=Mn(i)))}else o=n&~l,o!==0?r=Mn(o):i!==0&&(r=Mn(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function On(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-De(t),e[t]=n}function rd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Qn),Nu=" ",Ru=!1;function $u(e,t){switch(e){case"keyup":return Rd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Iu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var nn=!1;function Id(e,t){switch(e){case"compositionend":return Iu(t);case"keypress":return t.which!==32?null:(Ru=!0,Nu);case"textInput":return e=t.data,e===Nu&&Ru?null:e;default:return null}}function jd(e,t){if(nn)return e==="compositionend"||!Ai&&$u(e,t)?(e=Cu(),Fr=Ii=ht=null,nn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Uu(n)}}function Vu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hu(){for(var e=window,t=_r();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=_r(e.document)}return t}function Vi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Hd(e){var t=Hu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Vu(n.ownerDocument.documentElement,n)){if(r!==null&&Vi(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=Bu(n,i);var o=Bu(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,rn=null,Hi=null,Xn=null,Qi=!1;function Qu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qi||rn==null||rn!==_r(r)||(r=rn,"selectionStart"in r&&Vi(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Xn&&Zn(Xn,r)||(Xn=r,r=Kr(Hi,"onSelect"),0an||(e.current=no[an],no[an]=null,an--)}function A(e,t){an++,no[an]=e.current,e.current=t}var vt={},ae=yt(vt),ve=yt(!1),Rt=vt;function cn(e,t){var n=e.type.contextTypes;if(!n)return vt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function ke(e){return e=e.childContextTypes,e!=null}function Gr(){B(ve),B(ae)}function ia(e,t,n){if(ae.current!==vt)throw Error(v(168));A(ae,t),A(ve,n)}function oa(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(v(108,Ff(e)||"Unknown",l));return W({},n,r)}function Jr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vt,Rt=ae.current,A(ae,e),A(ve,ve.current),!0}function sa(e,t,n){var r=e.stateNode;if(!r)throw Error(v(169));n?(e=oa(e,t,Rt),r.__reactInternalMemoizedMergedChildContext=e,B(ve),B(ae),A(ae,e)):B(ve),A(ve,n)}var et=null,qr=!1,ro=!1;function ua(e){et===null?et=[e]:et.push(e)}function tp(e){qr=!0,ua(e)}function kt(){if(!ro&&et!==null){ro=!0;var e=0,t=j;try{var n=et;for(j=1;e>=o,l-=o,tt=1<<32-De(t)+l|n<z?(V=_,_=null):V=_.sibling;var R=d(f,_,p[z],g);if(R===null){_===null&&(_=V);break}e&&_&&R.alternate===null&&t(f,_),c=i(R,c,z),C===null?x=R:C.sibling=R,C=R,_=V}if(z===p.length)return n(f,_),Q&&It(f,z),x;if(_===null){for(;zz?(V=_,_=null):V=_.sibling;var Ee=d(f,_,R.value,g);if(Ee===null){_===null&&(_=V);break}e&&_&&Ee.alternate===null&&t(f,_),c=i(Ee,c,z),C===null?x=Ee:C.sibling=Ee,C=Ee,_=V}if(R.done)return n(f,_),Q&&It(f,z),x;if(_===null){for(;!R.done;z++,R=p.next())R=m(f,R.value,g),R!==null&&(c=i(R,c,z),C===null?x=R:C.sibling=R,C=R);return Q&&It(f,z),x}for(_=r(f,_);!R.done;z++,R=p.next())R=y(_,f,z,R.value,g),R!==null&&(e&&R.alternate!==null&&_.delete(R.key===null?z:R.key),c=i(R,c,z),C===null?x=R:C.sibling=R,C=R);return e&&_.forEach(function(st){return t(f,st)}),Q&&It(f,z),x}function $(f,c,p,g){if(typeof p=="object"&&p!==null&&p.type===Gt&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case Er:e:{for(var x=p.key,C=c;C!==null;){if(C.key===x){if(x=p.type,x===Gt){if(C.tag===7){n(f,C.sibling),c=l(C,p.props.children),c.return=f,f=c;break e}}else if(C.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===ut&&ha(x)===C.type){n(f,C.sibling),c=l(C,p.props),c.ref=er(f,C,p),c.return=f,f=c;break e}n(f,C);break}else t(f,C);C=C.sibling}p.type===Gt?(c=Bt(p.props.children,f.mode,g,p.key),c.return=f,f=c):(g=zl(p.type,p.key,p.props,null,f.mode,g),g.ref=er(f,c,p),g.return=f,f=g)}return o(f);case Yt:e:{for(C=p.key;c!==null;){if(c.key===C)if(c.tag===4&&c.stateNode.containerInfo===p.containerInfo&&c.stateNode.implementation===p.implementation){n(f,c.sibling),c=l(c,p.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=ts(p,f.mode,g),c.return=f,f=c}return o(f);case ut:return C=p._init,$(f,c,C(p._payload),g)}if(Pn(p))return k(f,c,p,g);if(Tn(p))return w(f,c,p,g);nl(f,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,c!==null&&c.tag===6?(n(f,c.sibling),c=l(c,p),c.return=f,f=c):(n(f,c),c=es(p,f.mode,g),c.return=f,f=c),o(f)):n(f,c)}return $}var hn=ma(!0),ga=ma(!1),rl=yt(null),ll=null,mn=null,ao=null;function co(){ao=mn=ll=null}function fo(e){var t=rl.current;B(rl),e._currentValue=t}function po(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function gn(e,t){ll=e,ao=mn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(we=!0),e.firstContext=null)}function Ie(e){var t=e._currentValue;if(ao!==e)if(e={context:e,memoizedValue:t,next:null},mn===null){if(ll===null)throw Error(v(308));mn=e,ll.dependencies={lanes:0,firstContext:e}}else mn=mn.next=e;return t}var jt=null;function ho(e){jt===null?jt=[e]:jt.push(e)}function ya(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,ho(t)):(n.next=l.next,l.next=n),t.interleaved=n,rt(e,r)}function rt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var wt=!1;function mo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function va(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function lt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function xt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,I&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,rt(e,n)}return l=r.interleaved,l===null?(t.next=t,ho(r)):(t.next=l.next,l.next=t),r.interleaved=t,rt(e,n)}function il(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Li(e,n)}}function ka(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ol(e,t,n,r){var l=e.updateQueue;wt=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,s=l.shared.pending;if(s!==null){l.shared.pending=null;var u=s,a=u.next;u.next=null,o===null?i=a:o.next=a,o=u;var h=e.alternate;h!==null&&(h=h.updateQueue,s=h.lastBaseUpdate,s!==o&&(s===null?h.firstBaseUpdate=a:s.next=a,h.lastBaseUpdate=u))}if(i!==null){var m=l.baseState;o=0,h=a=u=null,s=i;do{var d=s.lane,y=s.eventTime;if((r&d)===d){h!==null&&(h=h.next={eventTime:y,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var k=e,w=s;switch(d=t,y=n,w.tag){case 1:if(k=w.payload,typeof k=="function"){m=k.call(y,m,d);break e}m=k;break e;case 3:k.flags=k.flags&-65537|128;case 0:if(k=w.payload,d=typeof k=="function"?k.call(y,m,d):k,d==null)break e;m=W({},m,d);break e;case 2:wt=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,d=l.effects,d===null?l.effects=[s]:d.push(s))}else y={eventTime:y,lane:d,tag:s.tag,payload:s.payload,callback:s.callback,next:null},h===null?(a=h=y,u=m):h=h.next=y,o|=d;if(s=s.next,s===null){if(s=l.shared.pending,s===null)break;d=s,s=d.next,d.next=null,l.lastBaseUpdate=d,l.shared.pending=null}}while(!0);if(h===null&&(u=m),l.baseState=u,l.firstBaseUpdate=a,l.lastBaseUpdate=h,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Dt|=o,e.lanes=o,e.memoizedState=m}}function wa(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=wo.transition;wo.transition={};try{e(!1),t()}finally{j=n,wo.transition=r}}function Aa(){return je().memoizedState}function ip(e,t,n){var r=_t(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ua(e))Ba(t,n);else if(n=ya(e,t,n,r),n!==null){var l=ye();He(n,e,r,l),Va(n,t,r)}}function op(e,t,n){var r=_t(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ua(e))Ba(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,s=i(o,n);if(l.hasEagerState=!0,l.eagerState=s,Fe(s,o)){var u=t.interleaved;u===null?(l.next=l,ho(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=ya(e,t,l,r),n!==null&&(l=ye(),He(n,e,r,l),Va(n,t,r))}}function Ua(e){var t=e.alternate;return e===Z||t!==null&&t===Z}function Ba(e,t){lr=al=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Va(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Li(e,n)}}var dl={readContext:Ie,useCallback:ce,useContext:ce,useEffect:ce,useImperativeHandle:ce,useInsertionEffect:ce,useLayoutEffect:ce,useMemo:ce,useReducer:ce,useRef:ce,useState:ce,useDebugValue:ce,useDeferredValue:ce,useTransition:ce,useMutableSource:ce,useSyncExternalStore:ce,useId:ce,unstable_isNewReconciler:!1},sp={readContext:Ie,useCallback:function(e,t){return Ze().memoizedState=[e,t===void 0?null:t],e},useContext:Ie,useEffect:Ra,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,cl(4194308,4,ja.bind(null,t,e),n)},useLayoutEffect:function(e,t){return cl(4194308,4,e,t)},useInsertionEffect:function(e,t){return cl(4,2,e,t)},useMemo:function(e,t){var n=Ze();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ze();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ip.bind(null,Z,e),[r.memoizedState,e]},useRef:function(e){var t=Ze();return e={current:e},t.memoizedState=e},useState:Pa,useDebugValue:To,useDeferredValue:function(e){return Ze().memoizedState=e},useTransition:function(){var e=Pa(!1),t=e[0];return e=lp.bind(null,e[1]),Ze().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Z,l=Ze();if(Q){if(n===void 0)throw Error(v(407));n=n()}else{if(n=t(),ne===null)throw Error(v(349));Ot&30||Ca(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Ra(za.bind(null,r,i,e),[e]),r.flags|=2048,sr(9,_a.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ze(),t=ne.identifierPrefix;if(Q){var n=nt,r=tt;n=(r&~(1<<32-De(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ir++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[We]=t,e[qn]=r,uc(e,t,!1,!1),t.stateNode=e;e:{switch(o=vi(n,r),n){case"dialog":U("cancel",e),U("close",e),l=r;break;case"iframe":case"object":case"embed":U("load",e),l=r;break;case"video":case"audio":for(l=0;lxn&&(t.flags|=128,r=!0,ur(i,!1),t.lanes=4194304)}else{if(!r)if(e=sl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ur(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Q)return fe(t),null}else 2*Y()-i.renderingStartTime>xn&&n!==1073741824&&(t.flags|=128,r=!0,ur(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Y(),t.sibling=null,n=K.current,A(K,r?n&1|2:n&1),t):(fe(t),null);case 22:case 23:return Jo(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Pe&1073741824&&(fe(t),t.subtreeFlags&6&&(t.flags|=8192)):fe(t),null;case 24:return null;case 25:return null}throw Error(v(156,t.tag))}function mp(e,t){switch(io(t),t.tag){case 1:return ke(t.type)&&Gr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yn(),B(ve),B(ae),ko(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yo(t),null;case 13:if(B(K),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(v(340));pn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(K),null;case 4:return yn(),null;case 10:return fo(t.type._context),null;case 22:case 23:return Jo(),null;case 24:return null;default:return null}}var gl=!1,de=!1,gp=typeof WeakSet=="function"?WeakSet:Set,S=null;function kn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){X(e,t,r)}else n.current=null}function Ao(e,t,n){try{n()}catch(r){X(e,t,r)}}var fc=!1;function yp(e,t){if(Gi=Or,e=Hu(),Vi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,s=-1,u=-1,a=0,h=0,m=e,d=null;t:for(;;){for(var y;m!==n||l!==0&&m.nodeType!==3||(s=o+l),m!==i||r!==0&&m.nodeType!==3||(u=o+r),m.nodeType===3&&(o+=m.nodeValue.length),(y=m.firstChild)!==null;)d=m,m=y;for(;;){if(m===e)break t;if(d===n&&++a===l&&(s=o),d===i&&++h===r&&(u=o),(y=m.nextSibling)!==null)break;m=d,d=m.parentNode}m=y}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ji={focusedElem:e,selectionRange:n},Or=!1,S=t;S!==null;)if(t=S,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,S=e;else for(;S!==null;){t=S;try{var k=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var w=k.memoizedProps,$=k.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?w:Ue(t.type,w),$);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(v(163))}}catch(g){X(t,t.return,g)}if(e=t.sibling,e!==null){e.return=t.return,S=e;break}S=t.return}return k=fc,fc=!1,k}function ar(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&Ao(t,n,i)}l=l.next}while(l!==r)}}function yl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Uo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function dc(e){var t=e.alternate;t!==null&&(e.alternate=null,dc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[We],delete t[qn],delete t[to],delete t[bd],delete t[ep])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function pc(e){return e.tag===5||e.tag===3||e.tag===4}function hc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||pc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Bo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xr));else if(r!==4&&(e=e.child,e!==null))for(Bo(e,t,n),e=e.sibling;e!==null;)Bo(e,t,n),e=e.sibling}function Vo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Vo(e,t,n),e=e.sibling;e!==null;)Vo(e,t,n),e=e.sibling}var oe=null,Be=!1;function St(e,t,n){for(n=n.child;n!==null;)mc(e,t,n),n=n.sibling}function mc(e,t,n){if(Qe&&typeof Qe.onCommitFiberUnmount=="function")try{Qe.onCommitFiberUnmount(Nr,n)}catch{}switch(n.tag){case 5:de||kn(n,t);case 6:var r=oe,l=Be;oe=null,St(e,t,n),oe=r,Be=l,oe!==null&&(Be?(e=oe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):oe.removeChild(n.stateNode));break;case 18:oe!==null&&(Be?(e=oe,n=n.stateNode,e.nodeType===8?eo(e.parentNode,n):e.nodeType===1&&eo(e,n),Bn(e)):eo(oe,n.stateNode));break;case 4:r=oe,l=Be,oe=n.stateNode.containerInfo,Be=!0,St(e,t,n),oe=r,Be=l;break;case 0:case 11:case 14:case 15:if(!de&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Ao(n,t,o),l=l.next}while(l!==r)}St(e,t,n);break;case 1:if(!de&&(kn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){X(n,t,s)}St(e,t,n);break;case 21:St(e,t,n);break;case 22:n.mode&1?(de=(r=de)||n.memoizedState!==null,St(e,t,n),de=r):St(e,t,n);break;default:St(e,t,n)}}function gc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new gp),t.forEach(function(r){var l=zp.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Ve(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~i}if(r=l,r=Y()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*kp(r/1960))-r,10e?16:e,Ct===null)var r=!1;else{if(e=Ct,Ct=null,Sl=0,I&6)throw Error(v(331));var l=I;for(I|=4,S=e.current;S!==null;){var i=S,o=i.child;if(S.flags&16){var s=i.deletions;if(s!==null){for(var u=0;uY()-Wo?At(e,0):Qo|=n),Se(e,t)}function Pc(e,t){t===0&&(e.mode&1?(t=$r,$r<<=1,!($r&130023424)&&($r=4194304)):t=1);var n=ye();e=rt(e,t),e!==null&&(On(e,t,n),Se(e,n))}function _p(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Pc(e,n)}function zp(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(v(314))}r!==null&&r.delete(t),Pc(e,n)}var Nc;Nc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ve.current)we=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return we=!1,pp(e,t,n);we=!!(e.flags&131072)}else we=!1,Q&&t.flags&1048576&&aa(t,el,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ml(e,t),e=t.pendingProps;var l=cn(t,ae.current);gn(t,n),l=So(null,t,r,e,l,n);var i=Eo();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ke(r)?(i=!0,Jr(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,mo(t),l.updater=pl,t.stateNode=l,l._reactInternals=t,Po(t,r,e,n),t=Io(null,t,r,!0,i,n)):(t.tag=0,Q&&i&&lo(t),ge(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ml(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Lp(r),e=Ue(r,e),l){case 0:t=$o(null,t,r,e,n);break e;case 1:t=nc(null,t,r,e,n);break e;case 11:t=Ja(null,t,r,e,n);break e;case 14:t=qa(null,t,r,Ue(r.type,e),n);break e}throw Error(v(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),$o(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),nc(e,t,r,l,n);case 3:e:{if(rc(t),e===null)throw Error(v(387));r=t.pendingProps,i=t.memoizedState,l=i.element,va(e,t),ol(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=vn(Error(v(423)),t),t=lc(e,t,r,n,l);break e}else if(r!==l){l=vn(Error(v(424)),t),t=lc(e,t,r,n,l);break e}else for(Le=gt(t.stateNode.containerInfo.firstChild),Te=t,Q=!0,Ae=null,n=ga(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(pn(),r===l){t=it(e,t,n);break e}ge(e,t,r,n)}t=t.child}return t;case 5:return xa(t),e===null&&so(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,qi(r,l)?o=null:i!==null&&qi(r,i)&&(t.flags|=32),tc(e,t),ge(e,t,o,n),t.child;case 6:return e===null&&so(t),null;case 13:return ic(e,t,n);case 4:return go(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=hn(t,null,r,n):ge(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),Ja(e,t,r,l,n);case 7:return ge(e,t,t.pendingProps,n),t.child;case 8:return ge(e,t,t.pendingProps.children,n),t.child;case 12:return ge(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,o=l.value,A(rl,r._currentValue),r._currentValue=o,i!==null)if(Fe(i.value,o)){if(i.children===l.children&&!ve.current){t=it(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){o=i.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=lt(-1,n&-n),u.tag=2;var a=i.updateQueue;if(a!==null){a=a.shared;var h=a.pending;h===null?u.next=u:(u.next=h.next,h.next=u),a.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),po(i.return,n,t),s.lanes|=n;break}u=u.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(v(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),po(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}ge(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,gn(t,n),l=Ie(l),r=r(l),t.flags|=1,ge(e,t,r,n),t.child;case 14:return r=t.type,l=Ue(r,t.pendingProps),l=Ue(r.type,l),qa(e,t,r,l,n);case 15:return ba(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),ml(e,t),t.tag=1,ke(r)?(e=!0,Jr(t)):e=!1,gn(t,n),Qa(t,r,l),Po(t,r,l,n),Io(null,t,r,!0,e,n);case 19:return sc(e,t,n);case 22:return ec(e,t,n)}throw Error(v(156,t.tag))};function Rc(e,t){return cu(e,t)}function Tp(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Oe(e,t,n,r){return new Tp(e,t,n,r)}function bo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Lp(e){if(typeof e=="function")return bo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===li)return 11;if(e===si)return 14}return 2}function Tt(e,t){var n=e.alternate;return n===null?(n=Oe(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function zl(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")bo(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Gt:return Bt(n.children,l,i,t);case ni:o=8,l|=8;break;case ri:return e=Oe(12,n,t,l|2),e.elementType=ri,e.lanes=i,e;case ii:return e=Oe(13,n,t,l),e.elementType=ii,e.lanes=i,e;case oi:return e=Oe(19,n,t,l),e.elementType=oi,e.lanes=i,e;case Us:return Tl(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Fs:o=10;break e;case As:o=9;break e;case li:o=11;break e;case si:o=14;break e;case ut:o=16,r=null;break e}throw Error(v(130,e==null?e:typeof e,""))}return t=Oe(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function Bt(e,t,n,r){return e=Oe(7,e,r,t),e.lanes=n,e}function Tl(e,t,n,r){return e=Oe(22,e,r,t),e.elementType=Us,e.lanes=n,e.stateNode={isHidden:!1},e}function es(e,t,n){return e=Oe(6,e,null,t),e.lanes=n,e}function ts(e,t,n){return t=Oe(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Pp(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ti(0),this.expirationTimes=Ti(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ti(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function ns(e,t,n,r,l,i,o,s,u){return e=new Pp(e,t,n,s,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Oe(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},mo(i),e}function Np(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Dc)}catch(e){console.error(e)}}Dc(),$s.exports=Ce;var Mp=$s.exports,Fc=Mp;Jl.createRoot=Fc.createRoot,Jl.hydrateRoot=Fc.hydrateRoot;let jl;const Op=new Uint8Array(16);function Dp(){if(!jl&&(jl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!jl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return jl(Op)}const ue=[];for(let e=0;e<256;++e)ue.push((e+256).toString(16).slice(1));function Fp(e,t=0){return ue[e[t+0]]+ue[e[t+1]]+ue[e[t+2]]+ue[e[t+3]]+"-"+ue[e[t+4]]+ue[e[t+5]]+"-"+ue[e[t+6]]+ue[e[t+7]]+"-"+ue[e[t+8]]+ue[e[t+9]]+"-"+ue[e[t+10]]+ue[e[t+11]]+ue[e[t+12]]+ue[e[t+13]]+ue[e[t+14]]+ue[e[t+15]]}const Ac={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function En(e,t,n){if(Ac.randomUUID&&!e)return Ac.randomUUID();e=e||{};const r=e.random||(e.rng||Dp)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Fp(r)}const M={black:"#000000",white:"#ffffff",bubbleGrey:"#E0E0E0",grey:"#757575",inputBorder:"#E0E0E0",iconGrey:"#9E9E9E"},Ml={"mobile-portrait":"@media (max-width: 599.95px)"},Uc=` @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap'); .chat-button, .chatbot-container { font-family: 'Roboto', sans-serif; } .chatbot-container { position: fixed; bottom: 100px; right: 24px; z-index: 110; width: 380px; height: 500px; background-color: ${M.white}; border-radius: 12px; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15); display: flex; flex-direction: column; overflow: hidden; } ${Ml["mobile-portrait"]} { .chatbot-container.is-open { position: static !important; inset: auto !important; z-index: auto !important; flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; max-height: calc(100vh - 150px); border-radius: 0; display: flex; flex-direction: column; } .chatbot-container { width: calc(100vw - 48px); right: 24px; left: 24px; height: calc(100vh - 150px); max-height: 500px; } .text-input-form { border-radius: 0; } .chatbot-container.is-open ~ main, .chatbot-container.is-open ~ footer { display: none !important; } } .chat-button { position: fixed; bottom: 24px; right: 24px; min-width: auto; height: 48px; padding-left: 20px; padding-right: 20px; background-color: ${M.black}; color: ${M.white}; border-radius: 24px; border: none; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; z-index: 110; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; } .chat-button .chat-button-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; } .chat-button .chat-button-icon svg { width: 24px; height: 24px; } ${Ml["mobile-portrait"]} { .chat-button { bottom: 16px; right: 16px; } } .chat-header { background-color: ${M.black}; color: ${M.white}; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-top-left-radius: 12px; border-top-right-radius: 12px; } ${Ml["mobile-portrait"]} { .chat-header { border-radius: 0; } } .chat-header-title { font-size: 18px; font-weight: 700; margin: 0; color: ${M.white}; } .header-controls { display: flex; align-items: center; } .control-button { cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; background: none; border: none; color: inherit; } .control-button.close-button { margin-left: auto; } .message-list { flex-grow: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; background-color: ${M.white}; } ${Ml["mobile-portrait"]} { .message-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; } } .message-bubble { padding: 10px 14px; max-width: 75%; word-wrap: break-word; font-size: 14px; font-weight: 400; line-height: 1.4; border-radius: 18px; } .message-bubble.bot p { font-size: 14px; font-weight: 400; line-height: 1.4; margin: 0; } .message-bubble.bot, .message-bubble.bot li { margin-bottom: 6px; background-color: ${M.bubbleGrey}; color: ${M.black}; align-self: flex-start; border: none; } .message-bubble.bot.typing { color: ${M.grey}; font-style: italic; } .message-bubble.bot ul { list-style-type: disc; list-style-position: outside; padding-left: 1.25rem; } .message-bubble.bot a { color: ${M.black}; text-decoration: underline; } .message-bubble.suggestion { margin-bottom: 6px; border-radius: 18px; background-color: ${M.bubbleGrey}; color: ${M.black}; align-self: flex-start; cursor: pointer; border: none; font-family: inherit; text-align: left; } button.message-bubble { appearance: none; margin: 0 0 6px 0; } .message-bubble.user { align-self: flex-end; background-color: ${M.black}; color: ${M.white}; border-radius: 18px; margin-bottom: 6px; border: none; } .text-input-form { padding: 12px 16px; display: flex; gap: 8px; align-items: center; background-color: ${M.white}; border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; } .text-input-form input { flex: 1; background-color: ${M.white}; border-radius: 8px; padding: 10px 14px; font-size: 14px; font-weight: 400; color: ${M.black}; border: 1px solid ${M.inputBorder}; outline: none; } .text-input-form input::placeholder { color: ${M.grey}; } .send-button { border: none; padding: 0; background: transparent; border-radius: 50%; width: 40px; height: 40px; min-width: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: ${M.iconGrey}; } .send-button:not(:disabled):hover { color: ${M.black}; } .send-button:disabled { cursor: default; opacity: 0.7; } .send-button svg { height: 24px; width: 24px; } .welcome-screen { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 33px 18px 0px; text-align: center; background-color: ${M.white}; } .welcome-icon { width: 64px; height: 64px; background-color: ${M.black}; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; } .welcome-icon svg { color: ${M.white}; } .welcome-text { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 0px 27px; margin-bottom: 20px; } .welcome-screen p { font-size: 14px; font-weight: 400; line-height: 1.6; margin-bottom: 0px; color: ${M.black}; } .welcome-screen a { color: ${M.black}; font-weight: 600; } .welcome-screen a:hover { text-decoration: underline; } .start-button { background-color: ${M.black}; color: ${M.white}; border: none; padding: 10px 32px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; } `,Cn={},Bc="http://localhost:4003/api";let os={apiKey:null,backendUrl:(Cn==null?void 0:Cn.VITE_CHATBOT_BACKEND_URL)??Bc};function Vc(e,t){os={apiKey:e,backendUrl:t??(Cn==null?void 0:Cn.VITE_CHATBOT_BACKEND_URL)??Bc}}function Ap(){return os.backendUrl}const Up=async(e,t,n)=>{const r=os.apiKey;if(!r)throw new Error("Chatbot widget not configured: apiKey is required. Call init({ apiKey, ... }) or setConfig(apiKey, backendUrl).");const l=`${Ap()}/chat`,i=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":r},body:JSON.stringify({message:e,clientSessionId:t,aiSessionId:n})});if(!i.ok){const o=await i.text(),s=o?` - ${o}`:"";throw new Error(`API Error: ${i.status} ${i.statusText}${s}`)}return i.json()};function ss(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Vt=ss();function Hc(e){Vt=e}const Qc=/[&<>"']/,Bp=new RegExp(Qc.source,"g"),Wc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Vp=new RegExp(Wc.source,"g"),Hp={"&":"&","<":"<",">":">",'"':""","'":"'"},Kc=e=>Hp[e];function Ne(e,t){if(t){if(Qc.test(e))return e.replace(Bp,Kc)}else if(Wc.test(e))return e.replace(Vp,Kc);return e}const Qp=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Wp(e){return e.replace(Qp,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const Kp=/(^|[^\[])\^/g;function D(e,t){let n=typeof e=="string"?e:e.source;t=t||"";const r={replace:(l,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(Kp,"$1"),n=n.replace(l,o),r},getRegex:()=>new RegExp(n,t)};return r}function Zc(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const hr={exec:()=>null};function Xc(e,t){const n=e.replace(/\|/g,(i,o,s)=>{let u=!1,a=o;for(;--a>=0&&s[a]==="\\";)u=!u;return u?"|":" |"}),r=n.split(/ \|/);let l=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length{const i=l.match(/^\s+/);if(i===null)return l;const[o]=i;return o.length>=r.length?l.slice(r.length):l}).join(` `)}class Dl{constructor(t){H(this,"options");H(this,"rules");H(this,"lexer");this.options=t||Vt}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Ol(r,` `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],l=Xp(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:l}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const l=Ol(r,"#");(this.options.pedantic||!l||/ $/.test(l))&&(r=l.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){let r=n[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,` $1`);r=Ol(r.replace(/^ *>[ \t]?/gm,""),` `);const l=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(r);return this.lexer.state.top=l,{type:"blockquote",raw:n[0],tokens:i,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r=n[1].trim();const l=r.length>1,i={type:"list",raw:"",ordered:l,start:l?+r.slice(0,-1):"",loose:!1,items:[]};r=l?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=l?r:"[*+-]");const o=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`);let s="",u="",a=!1;for(;t;){let h=!1;if(!(n=o.exec(t))||this.rules.block.hr.test(t))break;s=n[0],t=t.substring(s.length);let m=n[2].split(` `,1)[0].replace(/^\t+/,f=>" ".repeat(3*f.length)),d=t.split(` `,1)[0],y=0;this.options.pedantic?(y=2,u=m.trimStart()):(y=n[2].search(/[^ ]/),y=y>4?1:y,u=m.slice(y),y+=n[1].length);let k=!1;if(!m&&/^ *$/.test(d)&&(s+=d+` `,t=t.substring(d.length+1),h=!0),!h){const f=new RegExp(`^ {0,${Math.min(3,y-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),c=new RegExp(`^ {0,${Math.min(3,y-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),p=new RegExp(`^ {0,${Math.min(3,y-1)}}(?:\`\`\`|~~~)`),g=new RegExp(`^ {0,${Math.min(3,y-1)}}#`);for(;t;){const x=t.split(` `,1)[0];if(d=x,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),p.test(d)||g.test(d)||f.test(d)||c.test(t))break;if(d.search(/[^ ]/)>=y||!d.trim())u+=` `+d.slice(y);else{if(k||m.search(/[^ ]/)>=4||p.test(m)||g.test(m)||c.test(m))break;u+=` `+d}!k&&!d.trim()&&(k=!0),s+=x+` `,t=t.substring(x.length+1),m=d.slice(y)}}i.loose||(a?i.loose=!0:/\n *\n *$/.test(s)&&(a=!0));let w=null,$;this.options.gfm&&(w=/^\[[ xX]\] /.exec(u),w&&($=w[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:s,task:!!w,checked:$,loose:!1,text:u,tokens:[]}),i.raw+=s}i.items[i.items.length-1].raw=s.trimEnd(),i.items[i.items.length-1].text=u.trimEnd(),i.raw=i.raw.trimEnd();for(let h=0;hy.type==="space"),d=m.length>0&&m.some(y=>/\n.*\n/.test(y.raw));i.loose=d}if(i.loose)for(let h=0;h$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:l,title:i}}}table(t){const n=this.rules.block.table.exec(t);if(!n||!/[:|]/.test(n[2]))return;const r=Xc(n[1]),l=n[2].replace(/^\||\| *$/g,"").split("|"),i=n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(` `):[],o={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===l.length){for(const s of l)/^ *-+: *$/.test(s)?o.align.push("right"):/^ *:-+: *$/.test(s)?o.align.push("center"):/^ *:-+ *$/.test(s)?o.align.push("left"):o.align.push(null);for(const s of r)o.header.push({text:s,tokens:this.lexer.inline(s)});for(const s of i)o.rows.push(Xc(s,o.header.length).map(u=>({text:u,tokens:this.lexer.inline(u)})));return o}}lheading(t){const n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){const n=this.rules.block.paragraph.exec(t);if(n){const r=n[1].charAt(n[1].length-1)===` `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:Ne(n[1])}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const r=n[2].trim();if(!this.options.pedantic&&/^$/.test(r))return;const o=Ol(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{const o=Zp(n[2],"()");if(o>-1){const u=(n[0].indexOf("!")===0?5:4)+n[1].length+o;n[2]=n[2].substring(0,o),n[0]=n[0].substring(0,u).trim(),n[3]=""}}let l=n[2],i="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(l);o&&(l=o[1],i=o[3])}else i=n[3]?n[3].slice(1,-1):"";return l=l.trim(),/^$/.test(r)?l=l.slice(1):l=l.slice(1,-1)),Yc(n,{href:l&&l.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer)}}reflink(t,n){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const l=(r[2]||r[1]).replace(/\s+/g," "),i=n[l.toLowerCase()];if(!i){const o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return Yc(r,i,r[0],this.lexer)}}emStrong(t,n,r=""){let l=this.rules.inline.emStrongLDelim.exec(t);if(!l||l[3]&&r.match(/[\p{L}\p{N}]/u))return;if(!(l[1]||l[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const o=[...l[0]].length-1;let s,u,a=o,h=0;const m=l[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,n=n.slice(-1*t.length+o);(l=m.exec(n))!=null;){if(s=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!s)continue;if(u=[...s].length,l[3]||l[4]){a+=u;continue}else if((l[5]||l[6])&&o%3&&!((o+u)%3)){h+=u;continue}if(a-=u,a>0)continue;u=Math.min(u,u+a+h);const d=[...l[0]][0].length,y=t.slice(0,o+l.index+d+u);if(Math.min(o,u)%2){const w=y.slice(1,-1);return{type:"em",raw:y,text:w,tokens:this.lexer.inlineTokens(w)}}const k=y.slice(2,-2);return{type:"strong",raw:y,text:k,tokens:this.lexer.inlineTokens(k)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," ");const l=/[^ ]/.test(r),i=/^ /.test(r)&&/ $/.test(r);return l&&i&&(r=r.substring(1,r.length-1)),r=Ne(r,!0),{type:"codespan",raw:n[0],text:r}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t){const n=this.rules.inline.autolink.exec(t);if(n){let r,l;return n[2]==="@"?(r=Ne(n[1]),l="mailto:"+r):(r=Ne(n[1]),l=r),{type:"link",raw:n[0],text:r,href:l,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let n;if(n=this.rules.inline.url.exec(t)){let l,i;if(n[2]==="@")l=Ne(n[0]),i="mailto:"+l;else{let o;do o=n[0],n[0]=((r=this.rules.inline._backpedal.exec(n[0]))==null?void 0:r[0])??"";while(o!==n[0]);l=Ne(n[0]),n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:l,href:i,tokens:[{type:"text",raw:l,text:l}]}}}inlineText(t){const n=this.rules.inline.text.exec(t);if(n){let r;return this.lexer.state.inRawBlock?r=n[0]:r=Ne(n[0]),{type:"text",raw:n[0],text:r}}}}const Yp=/^(?: *(?:\n|$))+/,Gp=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,Jp=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,mr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qp=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Gc=/(?:[*+-]|\d{1,9}[.)])/,Jc=D(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Gc).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),us=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,bp=/^[^\n]+/,as=/(?!\s*\])(?:\\.|[^\[\]\\])+/,eh=D(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",as).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),th=D(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Gc).getRegex(),Fl="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",cs=/|$))/,nh=D("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",cs).replace("tag",Fl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),qc=D(us).replace("hr",mr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Fl).getRegex(),fs={blockquote:D(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",qc).getRegex(),code:Gp,def:eh,fences:Jp,heading:qp,hr:mr,html:nh,lheading:Jc,list:th,newline:Yp,paragraph:qc,table:hr,text:bp},bc=D("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",mr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Fl).getRegex(),rh={...fs,table:bc,paragraph:D(us).replace("hr",mr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",bc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Fl).getRegex()},lh={...fs,html:D(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",cs).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:hr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:D(us).replace("hr",mr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Jc).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ef=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ih=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,tf=/^( {2,}|\\)\n(?!\s*$)/,oh=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,ah=D(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,gr).getRegex(),ch=D("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,gr).getRegex(),fh=D("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,gr).getRegex(),dh=D(/\\([punct])/,"gu").replace(/punct/g,gr).getRegex(),ph=D(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),hh=D(cs).replace("(?:-->|$)","-->").getRegex(),mh=D("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",hh).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Al=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,gh=D(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Al).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),nf=D(/^!?\[(label)\]\[(ref)\]/).replace("label",Al).replace("ref",as).getRegex(),rf=D(/^!?\[(ref)\](?:\[\])?/).replace("ref",as).getRegex(),yh=D("reflink|nolink(?!\\()","g").replace("reflink",nf).replace("nolink",rf).getRegex(),ds={_backpedal:hr,anyPunctuation:dh,autolink:ph,blockSkip:uh,br:tf,code:ih,del:hr,emStrongLDelim:ah,emStrongRDelimAst:ch,emStrongRDelimUnd:fh,escape:ef,link:gh,nolink:rf,punctuation:sh,reflink:nf,reflinkSearch:yh,tag:mh,text:oh,url:hr},vh={...ds,link:D(/^!?\[(label)\]\((.*?)\)/).replace("label",Al).getRegex(),reflink:D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Al).getRegex()},ps={...ds,escape:D(ef).replace("])","~|])").getRegex(),url:D(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\u+" ".repeat(a.length));let r,l,i,o;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(s=>(r=s.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=` `:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),l=n[n.length-1],l&&(l.type==="paragraph"||l.type==="text")?(l.raw+=` `+r.raw,l.text+=` `+r.text,this.inlineQueue[this.inlineQueue.length-1].src=l.text):n.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length),l=n[n.length-1],l&&(l.type==="paragraph"||l.type==="text")?(l.raw+=` `+r.raw,l.text+=` `+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=l.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startBlock){let s=1/0;const u=t.slice(1);let a;this.options.extensions.startBlock.forEach(h=>{a=h.call({lexer:this},u),typeof a=="number"&&a>=0&&(s=Math.min(s,a))}),s<1/0&&s>=0&&(i=t.substring(0,s+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){l=n[n.length-1],o&&l.type==="paragraph"?(l.raw+=` `+r.raw,l.text+=` `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=l.text):n.push(r),o=i.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),l=n[n.length-1],l&&l.type==="text"?(l.raw+=` `+r.raw,l.text+=` `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=l.text):n.push(r);continue}if(t){const s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,l,i,o=t,s,u,a;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)h.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,s.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(u||(a=""),u=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(h=>(r=h.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),l=n[n.length-1],l&&r.type==="text"&&l.type==="text"?(l.raw+=r.raw,l.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length),l=n[n.length-1],l&&r.type==="text"&&l.type==="text"?(l.raw+=r.raw,l.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,o,a)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(t)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t))){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let h=1/0;const m=t.slice(1);let d;this.options.extensions.startInline.forEach(y=>{d=y.call({lexer:this},m),typeof d=="number"&&d>=0&&(h=Math.min(h,d))}),h<1/0&&h>=0&&(i=t.substring(0,h+1))}if(r=this.tokenizer.inlineText(i)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(a=r.raw.slice(-1)),u=!0,l=n[n.length-1],l&&l.type==="text"?(l.raw+=r.raw,l.text+=r.text):n.push(r);continue}if(t){const h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return n}}class Bl{constructor(t){H(this,"options");this.options=t||Vt}code(t,n,r){var i;const l=(i=(n||"").match(/^\S*/))==null?void 0:i[0];return t=t.replace(/\n$/,"")+` `,l?'
'+(r?t:Ne(t,!0))+`
`:"
"+(r?t:Ne(t,!0))+`
`}blockquote(t){return`
${t}
`}html(t,n){return t}heading(t,n,r){return`${t} `}hr(){return`
`}list(t,n,r){const l=n?"ol":"ul",i=n&&r!==1?' start="'+r+'"':"";return"<"+l+i+`> `+t+" `}listitem(t,n,r){return`
  • ${t}
  • `}checkbox(t){return"'}paragraph(t){return`

    ${t}

    `}table(t,n){return n&&(n=`${n}`),` `+t+` `+n+`
    `}tablerow(t){return` ${t} `}tablecell(t,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+t+` `}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return"
    "}del(t){return`${t}`}link(t,n,r){const l=Zc(t);if(l===null)return r;t=l;let i='
    ",i}image(t,n,r){const l=Zc(t);if(l===null)return r;t=l;let i=`${r}0&&d.tokens[0].type==="paragraph"?(d.tokens[0].text=$+" "+d.tokens[0].text,d.tokens[0].tokens&&d.tokens[0].tokens.length>0&&d.tokens[0].tokens[0].type==="text"&&(d.tokens[0].tokens[0].text=$+" "+d.tokens[0].tokens[0].text)):d.tokens.unshift({type:"text",text:$+" "}):w+=$+" "}w+=this.parse(d.tokens,a),h+=this.renderer.listitem(w,k,!!y)}r+=this.renderer.list(h,s,u);continue}case"html":{const o=i;r+=this.renderer.html(o.text,o.block);continue}case"paragraph":{const o=i;r+=this.renderer.paragraph(this.parseInline(o.tokens));continue}case"text":{let o=i,s=o.tokens?this.parseInline(o.tokens):o.text;for(;l+1{const a=s[u].flat(1/0);r=r.concat(this.walkTokens(a,n))}):s.tokens&&(r=r.concat(this.walkTokens(s.tokens,n)))}}return r}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const l={...r};if(l.async=this.defaults.async||l.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const o=n.renderers[i.name];o?n.renderers[i.name]=function(...s){let u=i.renderer.apply(this,s);return u===!1&&(u=o.apply(this,s)),u}:n.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=n[i.level];o?o.unshift(i.tokenizer):n[i.level]=[i.tokenizer],i.start&&(i.level==="block"?n.startBlock?n.startBlock.push(i.start):n.startBlock=[i.start]:i.level==="inline"&&(n.startInline?n.startInline.push(i.start):n.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(n.childTokens[i.name]=i.childTokens)}),l.extensions=n),r.renderer){const i=this.defaults.renderer||new Bl(this.defaults);for(const o in r.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(o==="options")continue;const s=o,u=r.renderer[s],a=i[s];i[s]=(...h)=>{let m=u.apply(i,h);return m===!1&&(m=a.apply(i,h)),m||""}}l.renderer=i}if(r.tokenizer){const i=this.defaults.tokenizer||new Dl(this.defaults);for(const o in r.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const s=o,u=r.tokenizer[s],a=i[s];i[s]=(...h)=>{let m=u.apply(i,h);return m===!1&&(m=a.apply(i,h)),m}}l.tokenizer=i}if(r.hooks){const i=this.defaults.hooks||new vr;for(const o in r.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(o==="options")continue;const s=o,u=r.hooks[s],a=i[s];vr.passThroughHooks.has(o)?i[s]=h=>{if(this.defaults.async)return Promise.resolve(u.call(i,h)).then(d=>a.call(i,d));const m=u.call(i,h);return a.call(i,m)}:i[s]=(...h)=>{let m=u.apply(i,h);return m===!1&&(m=a.apply(i,h)),m}}l.hooks=i}if(r.walkTokens){const i=this.defaults.walkTokens,o=r.walkTokens;l.walkTokens=function(s){let u=[];return u.push(o.call(this,s)),i&&(u=u.concat(i.call(this,s))),u}}this.defaults={...this.defaults,...l}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return Ye.lex(t,n??this.defaults)}parser(t,n){return Ge.parse(t,n??this.defaults)}}Qt=new WeakSet,vs=function(t,n){return(r,l)=>{const i={...l},o={...this.defaults,...i};this.defaults.async===!0&&i.async===!1&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const s=Ql(this,Qt,af).call(this,!!o.silent,!!o.async);if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(u=>t(u,o)).then(u=>o.hooks?o.hooks.processAllTokens(u):u).then(u=>o.walkTokens?Promise.all(this.walkTokens(u,o.walkTokens)).then(()=>u):u).then(u=>n(u,o)).then(u=>o.hooks?o.hooks.postprocess(u):u).catch(s);try{o.hooks&&(r=o.hooks.preprocess(r));let u=t(r,o);o.hooks&&(u=o.hooks.processAllTokens(u)),o.walkTokens&&this.walkTokens(u,o.walkTokens);let a=n(u,o);return o.hooks&&(a=o.hooks.postprocess(a)),a}catch(u){return s(u)}}},af=function(t,n){return r=>{if(r.message+=` Please report this to https://github.com/markedjs/marked.`,t){const l="

    An error occurred:

    "+Ne(r.message+"",!0)+"
    ";return n?Promise.resolve(l):l}if(n)return Promise.reject(r);throw r}};const Ht=new wh;function O(e,t){return Ht.parse(e,t)}O.options=O.setOptions=function(e){return Ht.setOptions(e),O.defaults=Ht.defaults,Hc(O.defaults),O},O.getDefaults=ss,O.defaults=Vt,O.use=function(...e){return Ht.use(...e),O.defaults=Ht.defaults,Hc(O.defaults),O},O.walkTokens=function(e,t){return Ht.walkTokens(e,t)},O.parseInline=Ht.parseInline,O.Parser=Ge,O.parser=Ge.parse,O.Renderer=Bl,O.TextRenderer=hs,O.Lexer=Ye,O.lexer=Ye.lex,O.Tokenizer=Dl,O.Hooks=vr,O.parse=O,O.options,O.setOptions,O.use,O.walkTokens,O.parseInline;const xh=O;Ge.parse,Ye.lex;const Sh=e=>F.createElement("svg",{width:24,height:22,viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},F.createElement("path",{d:"M20 7.61143L18.3886 6L12 12.3886L5.61143 6L4 7.61143L10.3886 14L4 20.3886L5.61143 22L12 15.6114L18.3886 22L20 20.3886L13.6114 14L20 7.61143Z",fill:"white"})),Eh=e=>F.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},F.createElement("g",{clipPath:"url(#clip0_5871_8460)"},F.createElement("path",{d:"M21.4376 10.9901L5.26957 3.10245C5.11419 3.02674 4.94211 2.9918 4.76951 3.00093C4.59692 3.01007 4.42948 3.06297 4.28297 3.15465C4.13645 3.24634 4.01567 3.3738 3.932 3.52504C3.84833 3.67627 3.80452 3.84631 3.80469 4.01915V4.0484C3.80477 4.18504 3.82161 4.32115 3.85483 4.45368L5.40578 10.6575C5.42657 10.7401 5.47213 10.8144 5.53636 10.8705C5.60058 10.9265 5.6804 10.9615 5.7651 10.9709L12.5814 11.7288C12.6948 11.7424 12.7993 11.7971 12.8751 11.8826C12.9509 11.9681 12.9928 12.0783 12.9928 12.1926C12.9928 12.3068 12.9509 12.4171 12.8751 12.5025C12.7993 12.588 12.6948 12.6427 12.5814 12.6563L5.7651 13.4143C5.6804 13.4236 5.60058 13.4587 5.53636 13.5147C5.47213 13.5707 5.42657 13.645 5.40578 13.7276L3.85483 19.9306C3.82161 20.0631 3.80477 20.1992 3.80469 20.3359V20.3651C3.80466 20.5379 3.84858 20.7078 3.93231 20.859C4.01604 21.0101 4.13683 21.1374 4.28332 21.229C4.42981 21.3206 4.59719 21.3734 4.76972 21.3825C4.94225 21.3916 5.11426 21.3567 5.26957 21.281L21.4367 13.3934C21.6619 13.2835 21.8516 13.1126 21.9844 12.9002C22.1171 12.6877 22.1875 12.4422 22.1875 12.1917C22.1875 11.9412 22.1171 11.6957 21.9844 11.4833C21.8516 11.2708 21.6627 11.0999 21.4376 10.9901Z",fill:"currentColor"})),F.createElement("defs",null,F.createElement("clipPath",{id:"clip0_5871_8460"},F.createElement("rect",{width:24,height:24,fill:"white"})))),Ch=e=>F.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},F.createElement("path",{d:"M23.6136 -0.000244141L25.9489 5.1289L31.0865 7.46033L25.9489 9.79176L23.6136 14.9209L21.2783 9.79176L16.1406 7.46033L21.2783 5.1289L23.6136 -0.000244141Z",fill:"white"}),F.createElement("path",{d:"M24.9099 23.6255V17.4084C24.2871 17.4084 23.6644 17.4084 22.4189 17.4084V23.6255H2.49099V8.70439H13.6488C13.6488 8.08267 13.6488 7.88372 13.6488 7.46096C13.6488 7.03819 13.6488 6.66037 13.6488 6.21753H2.49099C1.12094 6.21753 0 7.33662 0 8.70439V31.0861L4.98197 26.1124H22.4189C23.7889 26.1124 24.9099 24.9933 24.9099 23.6255Z",fill:"white"})),_h=e=>F.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},F.createElement("path",{d:"M19 9l1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25L19 9z",fill:"currentColor"}),F.createElement("path",{d:"M19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25L19 15z",fill:"currentColor"}),F.createElement("path",{d:"M9.5 9.5L7 4L4.5 9.5L0 12l4.5 2.5L7 20l2.5-5.5L14 12l-4.5-2.5z",fill:"currentColor"})),lf=()=>{const[e,t]=F.useState(!1),[n,r]=F.useState(!1),[l,i]=F.useState([]),[o,s]=F.useState(""),[u,a]=F.useState(""),[h,m]=F.useState(null),[d,y]=F.useState(!1),k=F.useRef(null);F.useEffect(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},[l,d]);const w=()=>{t(!e),e&&(r(!1),i([]),a(""),m(null))},$=()=>{r(!0),a(En()),i([{id:En(),sender:"bot",text:"Hello! How can I help you today?"}])},f=async g=>{if(!g.trim())return;const x={id:En(),sender:"user",text:g};i(C=>[...C,x]),s(""),y(!0);try{const C=await Up(g,u,h),{reply:_,aiSessionId:z,relatedQuestions:V}=C,R={id:En(),sender:"bot",text:_};m(z||null);let Ee=[R];V&&V.length>0&&Ee.push(...V.map(st=>({id:En(),sender:"suggestion",text:st}))),i(st=>[...st,...Ee])}catch(C){console.error("Error getting chatbot response:",C);const _={id:En(),sender:"bot",text:"Sorry, an error occurred. Please try again later."};i(z=>[...z,_])}finally{y(!1)}},c=g=>{f(g)},p=N.jsxs("button",{className:"chat-button",onClick:w,children:[N.jsx("span",{className:"chat-button-icon",children:N.jsx(_h,{})}),N.jsx("span",{children:"ASK AI"})]});return e?N.jsxs(N.Fragment,{children:[N.jsx("style",{children:Uc}),N.jsxs("div",{className:`chatbot-container ${e?"is-open":""}`,children:[N.jsxs("div",{className:"chat-header",children:[N.jsx("h2",{className:"chat-header-title",children:"AI Assistant"}),N.jsx("div",{className:"header-controls",children:N.jsx("button",{type:"button",className:"control-button close-button",onClick:w,"aria-label":"Close",children:N.jsx(Sh,{})})})]}),n?N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"message-list",ref:k,children:[l.map(g=>g.sender==="suggestion"?N.jsx("button",{type:"button",className:`message-bubble ${g.sender}`,onClick:()=>c(g.text),children:g.text},g.id):N.jsx("div",{className:`message-bubble ${g.sender}`,dangerouslySetInnerHTML:{__html:g.sender==="bot"?xh(g.text):g.text}},g.id)),d&&N.jsx("div",{className:"message-bubble bot typing",children:"..."})]}),N.jsxs("form",{className:"text-input-form",onSubmit:g=>{g.preventDefault(),f(o)},children:[N.jsx("input",{type:"text",placeholder:"Type your message...",value:o,onChange:g=>s(g.target.value),disabled:d}),N.jsx("button",{type:"submit",className:"send-button",disabled:d,children:N.jsx(Eh,{})})]})]}):N.jsxs("div",{className:"welcome-screen",children:[N.jsx("div",{className:"welcome-icon",children:N.jsx(Ch,{})}),N.jsx("div",{className:"welcome-text",children:N.jsx("p",{children:"The AI assistant answers based on the uploaded knowledge base."})}),N.jsx("button",{className:"start-button",onClick:$,children:"Start conversation"})]})]}),p]}):N.jsxs(N.Fragment,{children:[N.jsx("style",{children:Uc}),p]})},zh=e=>{var l;if(!(e!=null&&e.apiKey)||typeof e.apiKey!="string"||!e.apiKey.trim()){console.error("[ChatbotWidget] init() requires apiKey.");return}Vc(e.apiKey.trim(),(l=e.backendUrl)==null?void 0:l.trim());const t=e.containerId||"white-label-chatbot-root";let n=document.getElementById(t);n||(n=document.createElement("div"),n.id=t,document.body.appendChild(n)),Jl.createRoot(n).render(N.jsx(Gl.StrictMode,{children:N.jsx(lf,{})}))},Th=({apiKey:e,backendUrl:t,containerId:n="white-label-chatbot-root"})=>(Gl.useEffect(()=>{e!=null&&e.trim()&&Vc(e.trim(),t==null?void 0:t.trim())},[e,t]),e!=null&&e.trim()?N.jsx("div",{id:n,children:N.jsx(Gl.StrictMode,{children:N.jsx(lf,{})})}):null);globalThis.WhiteLabelChatbot={init:zh,Chatbot:Th}})();