botschat 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -15
- package/migrations/0012_push_tokens.sql +11 -0
- package/package.json +7 -1
- package/packages/api/src/do/connection-do.ts +90 -1
- package/packages/api/src/env.ts +2 -0
- package/packages/api/src/index.ts +4 -1
- package/packages/api/src/routes/auth.ts +39 -6
- package/packages/api/src/routes/push.ts +52 -0
- package/packages/api/src/utils/fcm.ts +167 -0
- package/packages/api/src/utils/firebase.ts +89 -1
- package/packages/plugin/package.json +1 -1
- package/packages/web/dist/assets/index-B9qN5gs6.js +1 -0
- package/packages/web/dist/assets/index-BQNMGVyU.js +2 -0
- package/packages/web/dist/assets/{index-CCBhODDo.css → index-Bd_RDcgO.css} +1 -1
- package/packages/web/dist/assets/{index-CCFgKLX_.js → index-Civeg2lm.js} +1 -1
- package/packages/web/dist/assets/index-Dk33VSnY.js +2 -0
- package/packages/web/dist/assets/index-Kr85Nj_-.js +1516 -0
- package/packages/web/dist/assets/{index-Dx64BDkP.js → index-lVB82JKU.js} +1 -1
- package/packages/web/dist/assets/index.esm-CtMkqqqb.js +599 -0
- package/packages/web/dist/assets/{web-DJQW-VLX.js → web-CUXjh_UA.js} +1 -1
- package/packages/web/dist/assets/web-vKLTVUul.js +1 -0
- package/packages/web/dist/index.html +6 -4
- package/packages/web/dist/sw.js +158 -1
- package/packages/web/index.html +4 -2
- package/packages/web/src/App.tsx +42 -2
- package/packages/web/src/api.ts +10 -0
- package/packages/web/src/components/AccountSettings.tsx +131 -0
- package/packages/web/src/components/DataConsentModal.tsx +249 -0
- package/packages/web/src/components/LoginPage.tsx +49 -9
- package/packages/web/src/firebase.ts +89 -2
- package/packages/web/src/foreground.ts +51 -0
- package/packages/web/src/main.tsx +2 -1
- package/packages/web/src/push.ts +205 -0
- package/scripts/dev.sh +139 -13
- package/scripts/mock-openclaw.mjs +382 -0
- package/packages/web/dist/assets/index-D8mBAwjS.js +0 -1516
- package/packages/web/dist/assets/index-E-nzPZl8.js +0 -2
|
@@ -1,1516 +0,0 @@
|
|
|
1
|
-
var pw=Object.defineProperty;var Ny=e=>{throw TypeError(e)};var mw=(e,t,r)=>t in e?pw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var fs=(e,t,r)=>mw(e,typeof t!="symbol"?t+"":t,r),Cy=(e,t,r)=>t.has(e)||Ny("Cannot "+r);var jo=(e,t,r)=>(Cy(e,t,"read from private field"),r?r.call(e):t.get(e)),Ay=(e,t,r)=>t.has(e)?Ny("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Oy=(e,t,r,a)=>(Cy(e,t,"write to private field"),a?a.call(e,r):t.set(e,r),r);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(o){if(o.ep)return;o.ep=!0;const c=r(o);fetch(o.href,c)}})();const gw="modulepreload",bw=function(e){return"/"+e},Ry={},Rs=function(t,r,a){let o=Promise.resolve();if(r&&r.length>0){let u=function(m){return Promise.all(m.map(b=>Promise.resolve(b).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),h=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=u(r.map(m=>{if(m=bw(m),m in Ry)return;Ry[m]=!0;const b=m.endsWith(".css"),y=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${y}`))return;const v=document.createElement("link");if(v.rel=b?"stylesheet":gw,b||(v.as="script"),v.crossOrigin="",v.href=m,h&&v.setAttribute("nonce",h),document.head.appendChild(v),b)return new Promise((x,_)=>{v.addEventListener("load",x),v.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return o.then(u=>{for(const d of u||[])d.status==="rejected"&&c(d.reason);return t().catch(c)})};function gl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ff={exports:{}},zo={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var My;function yw(){if(My)return zo;My=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var d in o)d!=="key"&&(c[d]=o[d])}else c=o;return o=c.ref,{$$typeof:e,type:a,key:u,ref:o!==void 0?o:null,props:c}}return zo.Fragment=t,zo.jsx=r,zo.jsxs=r,zo}var Iy;function vw(){return Iy||(Iy=1,Ff.exports=yw()),Ff.exports}var p=vw(),$f={exports:{}},Be={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Dy;function xw(){if(Dy)return Be;Dy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function x(R){return R===null||typeof R!="object"?null:(R=v&&R[v]||R["@@iterator"],typeof R=="function"?R:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,O={};function k(R,q,C){this.props=R,this.context=q,this.refs=O,this.updater=C||_}k.prototype.isReactComponent={},k.prototype.setState=function(R,q){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,q,"setState")},k.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function D(){}D.prototype=k.prototype;function w(R,q,C){this.props=R,this.context=q,this.refs=O,this.updater=C||_}var A=w.prototype=new D;A.constructor=w,S(A,k.prototype),A.isPureReactComponent=!0;var L=Array.isArray;function M(){}var $={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function ee(R,q,C){var de=C.ref;return{$$typeof:e,type:R,key:q,ref:de!==void 0?de:null,props:C}}function U(R,q){return ee(R.type,q,R.props)}function F(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function Y(R){var q={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(C){return q[C]})}var ue=/\/+/g;function ie(R,q){return typeof R=="object"&&R!==null&&R.key!=null?Y(""+R.key):q.toString(36)}function K(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(M,M):(R.status="pending",R.then(function(q){R.status==="pending"&&(R.status="fulfilled",R.value=q)},function(q){R.status==="pending"&&(R.status="rejected",R.reason=q)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function B(R,q,C,de,fe){var he=typeof R;(he==="undefined"||he==="boolean")&&(R=null);var Te=!1;if(R===null)Te=!0;else switch(he){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(R.$$typeof){case e:case t:Te=!0;break;case b:return Te=R._init,B(Te(R._payload),q,C,de,fe)}}if(Te)return fe=fe(R),Te=de===""?"."+ie(R,0):de,L(fe)?(C="",Te!=null&&(C=Te.replace(ue,"$&/")+"/"),B(fe,q,C,"",function(Rt){return Rt})):fe!=null&&(F(fe)&&(fe=U(fe,C+(fe.key==null||R&&R.key===fe.key?"":(""+fe.key).replace(ue,"$&/")+"/")+Te)),q.push(fe)),1;Te=0;var Le=de===""?".":de+":";if(L(R))for(var et=0;et<R.length;et++)de=R[et],he=Le+ie(de,et),Te+=B(de,q,C,he,fe);else if(et=x(R),typeof et=="function")for(R=et.call(R),et=0;!(de=R.next()).done;)de=de.value,he=Le+ie(de,et++),Te+=B(de,q,C,he,fe);else if(he==="object"){if(typeof R.then=="function")return B(K(R),q,C,de,fe);throw q=String(R),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Te}function Q(R,q,C){if(R==null)return R;var de=[],fe=0;return B(R,de,"","",function(he){return q.call(C,he,fe++)}),de}function ae(R){if(R._status===-1){var q=R._result;q=q(),q.then(function(C){(R._status===0||R._status===-1)&&(R._status=1,R._result=C)},function(C){(R._status===0||R._status===-1)&&(R._status=2,R._result=C)}),R._status===-1&&(R._status=0,R._result=q)}if(R._status===1)return R._result.default;throw R._result}var P=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},T={map:Q,forEach:function(R,q,C){Q(R,function(){q.apply(this,arguments)},C)},count:function(R){var q=0;return Q(R,function(){q++}),q},toArray:function(R){return Q(R,function(q){return q})||[]},only:function(R){if(!F(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Be.Activity=y,Be.Children=T,Be.Component=k,Be.Fragment=r,Be.Profiler=o,Be.PureComponent=w,Be.StrictMode=a,Be.Suspense=h,Be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,Be.__COMPILER_RUNTIME={__proto__:null,c:function(R){return $.H.useMemoCache(R)}},Be.cache=function(R){return function(){return R.apply(null,arguments)}},Be.cacheSignal=function(){return null},Be.cloneElement=function(R,q,C){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var de=S({},R.props),fe=R.key;if(q!=null)for(he in q.key!==void 0&&(fe=""+q.key),q)!V.call(q,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&q.ref===void 0||(de[he]=q[he]);var he=arguments.length-2;if(he===1)de.children=C;else if(1<he){for(var Te=Array(he),Le=0;Le<he;Le++)Te[Le]=arguments[Le+2];de.children=Te}return ee(R.type,fe,de)},Be.createContext=function(R){return R={$$typeof:u,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:c,_context:R},R},Be.createElement=function(R,q,C){var de,fe={},he=null;if(q!=null)for(de in q.key!==void 0&&(he=""+q.key),q)V.call(q,de)&&de!=="key"&&de!=="__self"&&de!=="__source"&&(fe[de]=q[de]);var Te=arguments.length-2;if(Te===1)fe.children=C;else if(1<Te){for(var Le=Array(Te),et=0;et<Te;et++)Le[et]=arguments[et+2];fe.children=Le}if(R&&R.defaultProps)for(de in Te=R.defaultProps,Te)fe[de]===void 0&&(fe[de]=Te[de]);return ee(R,he,fe)},Be.createRef=function(){return{current:null}},Be.forwardRef=function(R){return{$$typeof:d,render:R}},Be.isValidElement=F,Be.lazy=function(R){return{$$typeof:b,_payload:{_status:-1,_result:R},_init:ae}},Be.memo=function(R,q){return{$$typeof:m,type:R,compare:q===void 0?null:q}},Be.startTransition=function(R){var q=$.T,C={};$.T=C;try{var de=R(),fe=$.S;fe!==null&&fe(C,de),typeof de=="object"&&de!==null&&typeof de.then=="function"&&de.then(M,P)}catch(he){P(he)}finally{q!==null&&C.types!==null&&(q.types=C.types),$.T=q}},Be.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},Be.use=function(R){return $.H.use(R)},Be.useActionState=function(R,q,C){return $.H.useActionState(R,q,C)},Be.useCallback=function(R,q){return $.H.useCallback(R,q)},Be.useContext=function(R){return $.H.useContext(R)},Be.useDebugValue=function(){},Be.useDeferredValue=function(R,q){return $.H.useDeferredValue(R,q)},Be.useEffect=function(R,q){return $.H.useEffect(R,q)},Be.useEffectEvent=function(R){return $.H.useEffectEvent(R)},Be.useId=function(){return $.H.useId()},Be.useImperativeHandle=function(R,q,C){return $.H.useImperativeHandle(R,q,C)},Be.useInsertionEffect=function(R,q){return $.H.useInsertionEffect(R,q)},Be.useLayoutEffect=function(R,q){return $.H.useLayoutEffect(R,q)},Be.useMemo=function(R,q){return $.H.useMemo(R,q)},Be.useOptimistic=function(R,q){return $.H.useOptimistic(R,q)},Be.useReducer=function(R,q,C){return $.H.useReducer(R,q,C)},Be.useRef=function(R){return $.H.useRef(R)},Be.useState=function(R){return $.H.useState(R)},Be.useSyncExternalStore=function(R,q,C){return $.H.useSyncExternalStore(R,q,C)},Be.useTransition=function(){return $.H.useTransition()},Be.version="19.2.4",Be}var Ly;function cp(){return Ly||(Ly=1,$f.exports=xw()),$f.exports}var I=cp();const al=gl(I);var Gf={exports:{}},Bo={},Kf={exports:{}},qf={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var jy;function Ew(){return jy||(jy=1,(function(e){function t(B,Q){var ae=B.length;B.push(Q);e:for(;0<ae;){var P=ae-1>>>1,T=B[P];if(0<o(T,Q))B[P]=Q,B[ae]=T,ae=P;else break e}}function r(B){return B.length===0?null:B[0]}function a(B){if(B.length===0)return null;var Q=B[0],ae=B.pop();if(ae!==Q){B[0]=ae;e:for(var P=0,T=B.length,R=T>>>1;P<R;){var q=2*(P+1)-1,C=B[q],de=q+1,fe=B[de];if(0>o(C,ae))de<T&&0>o(fe,C)?(B[P]=fe,B[de]=ae,P=de):(B[P]=C,B[q]=ae,P=q);else if(de<T&&0>o(fe,ae))B[P]=fe,B[de]=ae,P=de;else break e}}return Q}function o(B,Q){var ae=B.sortIndex-Q.sortIndex;return ae!==0?ae:B.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var h=[],m=[],b=1,y=null,v=3,x=!1,_=!1,S=!1,O=!1,k=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function A(B){for(var Q=r(m);Q!==null;){if(Q.callback===null)a(m);else if(Q.startTime<=B)a(m),Q.sortIndex=Q.expirationTime,t(h,Q);else break;Q=r(m)}}function L(B){if(S=!1,A(B),!_)if(r(h)!==null)_=!0,M||(M=!0,Y());else{var Q=r(m);Q!==null&&K(L,Q.startTime-B)}}var M=!1,$=-1,V=5,ee=-1;function U(){return O?!0:!(e.unstable_now()-ee<V)}function F(){if(O=!1,M){var B=e.unstable_now();ee=B;var Q=!0;try{e:{_=!1,S&&(S=!1,D($),$=-1),x=!0;var ae=v;try{t:{for(A(B),y=r(h);y!==null&&!(y.expirationTime>B&&U());){var P=y.callback;if(typeof P=="function"){y.callback=null,v=y.priorityLevel;var T=P(y.expirationTime<=B);if(B=e.unstable_now(),typeof T=="function"){y.callback=T,A(B),Q=!0;break t}y===r(h)&&a(h),A(B)}else a(h);y=r(h)}if(y!==null)Q=!0;else{var R=r(m);R!==null&&K(L,R.startTime-B),Q=!1}}break e}finally{y=null,v=ae,x=!1}Q=void 0}}finally{Q?Y():M=!1}}}var Y;if(typeof w=="function")Y=function(){w(F)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,ie=ue.port2;ue.port1.onmessage=F,Y=function(){ie.postMessage(null)}}else Y=function(){k(F,0)};function K(B,Q){$=k(function(){B(e.unstable_now())},Q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(B){switch(v){case 1:case 2:case 3:var Q=3;break;default:Q=v}var ae=v;v=Q;try{return B()}finally{v=ae}},e.unstable_requestPaint=function(){O=!0},e.unstable_runWithPriority=function(B,Q){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var ae=v;v=B;try{return Q()}finally{v=ae}},e.unstable_scheduleCallback=function(B,Q,ae){var P=e.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?P+ae:P):ae=P,B){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=ae+T,B={id:b++,callback:Q,priorityLevel:B,startTime:ae,expirationTime:T,sortIndex:-1},ae>P?(B.sortIndex=ae,t(m,B),r(h)===null&&B===r(m)&&(S?(D($),$=-1):S=!0,K(L,ae-P))):(B.sortIndex=T,t(h,B),_||x||(_=!0,M||(M=!0,Y()))),B},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(B){var Q=v;return function(){var ae=v;v=Q;try{return B.apply(this,arguments)}finally{v=ae}}}})(qf)),qf}var zy;function Sw(){return zy||(zy=1,Kf.exports=Ew()),Kf.exports}var Vf={exports:{}},cn={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var By;function _w(){if(By)return cn;By=1;var e=cp();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(h,m,b){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:h,containerInfo:m,implementation:b}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,cn.createPortal=function(h,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return c(h,m,null,b)},cn.flushSync=function(h){var m=u.T,b=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=m,a.p=b,a.d.f()}},cn.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(h,m))},cn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},cn.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var b=m.as,y=d(b,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,x=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?a.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:x}):b==="script"&&a.d.X(h,{crossOrigin:y,integrity:v,fetchPriority:x,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},cn.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=d(m.as,m.crossOrigin);a.d.M(h,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(h)},cn.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,y=d(b,m.crossOrigin);a.d.L(h,b,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},cn.preloadModule=function(h,m){if(typeof h=="string")if(m){var b=d(m.as,m.crossOrigin);a.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(h)},cn.requestFormReset=function(h){a.d.r(h)},cn.unstable_batchedUpdates=function(h,m){return h(m)},cn.useFormState=function(h,m,b){return u.H.useFormState(h,m,b)},cn.useFormStatus=function(){return u.H.useHostTransitionStatus()},cn.version="19.2.4",cn}var Uy;function ww(){if(Uy)return Vf.exports;Uy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Vf.exports=_w(),Vf.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var Py;function kw(){if(Py)return Bo;Py=1;var e=Sw(),t=cp(),r=ww();function a(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var i=n,s=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(s=i.return),n=i.return;while(n)}return i.tag===3?s:null}function u(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function d(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function h(n){if(c(n)!==n)throw Error(a(188))}function m(n){var i=n.alternate;if(!i){if(i=c(n),i===null)throw Error(a(188));return i!==n?null:n}for(var s=n,l=i;;){var f=s.return;if(f===null)break;var g=f.alternate;if(g===null){if(l=f.return,l!==null){s=l;continue}break}if(f.child===g.child){for(g=f.child;g;){if(g===s)return h(f),n;if(g===l)return h(f),i;g=g.sibling}throw Error(a(188))}if(s.return!==l.return)s=f,l=g;else{for(var E=!1,N=f.child;N;){if(N===s){E=!0,s=f,l=g;break}if(N===l){E=!0,l=f,s=g;break}N=N.sibling}if(!E){for(N=g.child;N;){if(N===s){E=!0,s=g,l=f;break}if(N===l){E=!0,l=g,s=f;break}N=N.sibling}if(!E)throw Error(a(189))}}if(s.alternate!==l)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?n:i}function b(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=b(n),i!==null)return i;n=n.sibling}return null}var y=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),w=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function Y(n){return n===null||typeof n!="object"?null:(n=F&&n[F]||n["@@iterator"],typeof n=="function"?n:null)}var ue=Symbol.for("react.client.reference");function ie(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===ue?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case k:return"Profiler";case O:return"StrictMode";case L:return"Suspense";case M:return"SuspenseList";case ee:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case _:return"Portal";case w:return n.displayName||"Context";case D:return(n._context.displayName||"Context")+".Consumer";case A:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case $:return i=n.displayName||null,i!==null?i:ie(n.type)||"Memo";case V:i=n._payload,n=n._init;try{return ie(n(i))}catch{}}return null}var K=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},P=[],T=-1;function R(n){return{current:n}}function q(n){0>T||(n.current=P[T],P[T]=null,T--)}function C(n,i){T++,P[T]=n.current,n.current=i}var de=R(null),fe=R(null),he=R(null),Te=R(null);function Le(n,i){switch(C(he,i),C(fe,n),C(de,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?Xb(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=Xb(i),n=Zb(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}q(de),C(de,n)}function et(){q(de),q(fe),q(he)}function Rt(n){n.memoizedState!==null&&C(Te,n);var i=de.current,s=Zb(i,n.type);i!==s&&(C(fe,n),C(de,s))}function an(n){fe.current===n&&(q(de),q(fe)),Te.current===n&&(q(Te),Mo._currentValue=ae)}var qn,ar;function ce(n){if(qn===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);qn=i&&i[1]||"",ar=-1<s.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+qn+n+ar}var be=!1;function ve(n,i){if(!n||be)return"";be=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(i){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(J){var Z=J}Reflect.construct(n,[],le)}else{try{le.call()}catch(J){Z=J}n.call(le.prototype)}}else{try{throw Error()}catch(J){Z=J}(le=n())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(J){if(J&&Z&&typeof J.stack=="string")return[J.stack,Z.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=l.DetermineComponentFrameRoot(),E=g[0],N=g[1];if(E&&N){var j=E.split(`
|
|
44
|
-
`),X=N.split(`
|
|
45
|
-
`);for(f=l=0;l<j.length&&!j[l].includes("DetermineComponentFrameRoot");)l++;for(;f<X.length&&!X[f].includes("DetermineComponentFrameRoot");)f++;if(l===j.length||f===X.length)for(l=j.length-1,f=X.length-1;1<=l&&0<=f&&j[l]!==X[f];)f--;for(;1<=l&&0<=f;l--,f--)if(j[l]!==X[f]){if(l!==1||f!==1)do if(l--,f--,0>f||j[l]!==X[f]){var re=`
|
|
46
|
-
`+j[l].replace(" at new "," at ");return n.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",n.displayName)),re}while(1<=l&&0<=f);break}}}finally{be=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?ce(s):""}function Ne(n,i){switch(n.tag){case 26:case 27:case 5:return ce(n.type);case 16:return ce("Lazy");case 13:return n.child!==i&&i!==null?ce("Suspense Fallback"):ce("Suspense");case 19:return ce("SuspenseList");case 0:case 15:return ve(n.type,!1);case 11:return ve(n.type.render,!1);case 1:return ve(n.type,!0);case 31:return ce("Activity");default:return""}}function $e(n){try{var i="",s=null;do i+=Ne(n,s),s=n,n=n.return;while(n);return i}catch(l){return`
|
|
47
|
-
Error generating stack: `+l.message+`
|
|
48
|
-
`+l.stack}}var bt=Object.prototype.hasOwnProperty,Vt=e.unstable_scheduleCallback,sr=e.unstable_cancelCallback,Xt=e.unstable_shouldYield,Rr=e.unstable_requestPaint,wt=e.unstable_now,Ca=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,ge=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,Ge=e.unstable_LowPriority,tt=e.unstable_IdlePriority,fn=e.log,or=e.unstable_setDisableYieldValue,Zt=null,Mt=null;function sn(n){if(typeof fn=="function"&&or(n),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode(Zt,n)}catch{}}var ot=Math.clz32?Math.clz32:Nl,br=Math.log,hn=Math.LN2;function Nl(n){return n>>>=0,n===0?32:31-(br(n)/hn|0)|0}var qi=256,Aa=262144,Vi=4194304;function Sn(n){var i=n&42;if(i!==0)return i;switch(n&-n){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function z(n,i,s){var l=n.pendingLanes;if(l===0)return 0;var f=0,g=n.suspendedLanes,E=n.pingedLanes;n=n.warmLanes;var N=l&134217727;return N!==0?(l=N&~g,l!==0?f=Sn(l):(E&=N,E!==0?f=Sn(E):s||(s=N&~n,s!==0&&(f=Sn(s))))):(N=l&~g,N!==0?f=Sn(N):E!==0?f=Sn(E):s||(s=l&~n,s!==0&&(f=Sn(s)))),f===0?0:i!==0&&i!==f&&(i&g)===0&&(g=f&-f,s=i&-i,g>=s||g===32&&(s&4194048)!==0)?i:f}function se(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function xe(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32: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 i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function je(){var n=Vi;return Vi<<=1,(Vi&62914560)===0&&(Vi=4194304),n}function kt(n){for(var i=[],s=0;31>s;s++)i.push(n);return i}function yt(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function _e(n,i,s,l,f,g){var E=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var N=n.entanglements,j=n.expirationTimes,X=n.hiddenUpdates;for(s=E&~s;0<s;){var re=31-ot(s),le=1<<re;N[re]=0,j[re]=-1;var Z=X[re];if(Z!==null)for(X[re]=null,re=0;re<Z.length;re++){var J=Z[re];J!==null&&(J.lane&=-536870913)}s&=~le}l!==0&&Ee(n,l,0),g!==0&&f===0&&n.tag!==0&&(n.suspendedLanes|=g&~(E&~i))}function Ee(n,i,s){n.pendingLanes|=i,n.suspendedLanes&=~i;var l=31-ot(i);n.entangledLanes|=i,n.entanglements[l]=n.entanglements[l]|1073741824|s&261930}function De(n,i){var s=n.entangledLanes|=i;for(n=n.entanglements;s;){var l=31-ot(s),f=1<<l;f&i|n[l]&i&&(n[l]|=i),s&=~f}}function Lt(n,i){var s=i&-i;return s=(s&42)!==0?1:Ct(s),(s&(n.suspendedLanes|i))!==0?0:s}function Ct(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Mr(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Oa(){var n=Q.p;return n!==0?n:(n=window.event,n===void 0?32:xy(n.type))}function Ra(n,i){var s=Q.p;try{return Q.p=n,i()}finally{Q.p=s}}var yr=Math.random().toString(36).slice(2),jt="__reactFiber$"+yr,on="__reactProps$"+yr,oi="__reactContainer$"+yr,Fs="__reactEvents$"+yr,Cl="__reactListeners$"+yr,Ma="__reactHandles$"+yr,Al="__reactResources$"+yr,Yi="__reactMarker$"+yr;function $s(n){delete n[jt],delete n[on],delete n[Fs],delete n[Cl],delete n[Ma]}function pn(n){var i=n[jt];if(i)return i;for(var s=n.parentNode;s;){if(i=s[oi]||s[jt]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(n=iy(n);n!==null;){if(s=n[jt])return s;n=iy(n)}return i}n=s,s=n.parentNode}return null}function Ir(n){if(n=n[jt]||n[oi]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function li(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function ci(n){var i=n[Al];return i||(i=n[Al]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Pt(n){n[Yi]=!0}var Ol=new Set,Wi={};function Dr(n,i){pe(n,i),pe(n+"Capture",i)}function pe(n,i){for(Wi[n]=i,n=0;n<i.length;n++)Ol.add(i[n])}var Ce=RegExp("^[: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]*$"),Ke={},lt={};function zt(n){return bt.call(lt,n)?!0:bt.call(Ke,n)?!1:Ce.test(n)?lt[n]=!0:(Ke[n]=!0,!1)}function ln(n,i,s){if(zt(i))if(s===null)n.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var l=i.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+s)}}function Dn(n,i,s){if(s===null)n.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+s)}}function _n(n,i,s,l){if(l===null)n.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttributeNS(i,s,""+l)}}function St(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Ln(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Rl(n,i,s){var l=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var f=l.get,g=l.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return f.call(this)},set:function(E){s=""+E,g.call(this,E)}}),Object.defineProperty(n,i,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(E){s=""+E},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function Ia(n){if(!n._valueTracker){var i=Ln(n)?"checked":"value";n._valueTracker=Rl(n,i,""+n[i])}}function Gs(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var s=i.getValue(),l="";return n&&(l=Ln(n)?n.checked?"true":"false":n.value),n=l,n!==s?(i.setValue(n),!0):!1}function Da(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var Pu=/[\n"\\]/g;function wn(n){return n.replace(Pu,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Ks(n,i,s,l,f,g,E,N){n.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?n.type=E:n.removeAttribute("type"),i!=null?E==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+St(i)):n.value!==""+St(i)&&(n.value=""+St(i)):E!=="submit"&&E!=="reset"||n.removeAttribute("value"),i!=null?La(n,E,St(i)):s!=null?La(n,E,St(s)):l!=null&&n.removeAttribute("value"),f==null&&g!=null&&(n.defaultChecked=!!g),f!=null&&(n.checked=f&&typeof f!="function"&&typeof f!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?n.name=""+St(N):n.removeAttribute("name")}function Xi(n,i,s,l,f,g,E,N){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),i!=null||s!=null){if(!(g!=="submit"&&g!=="reset"||i!=null)){Ia(n);return}s=s!=null?""+St(s):"",i=i!=null?""+St(i):s,N||i===n.value||(n.value=i),n.defaultValue=i}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,n.checked=N?n.checked:!!l,n.defaultChecked=!!l,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(n.name=E),Ia(n)}function La(n,i,s){i==="number"&&Da(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function Jt(n,i,s,l){if(n=n.options,i){i={};for(var f=0;f<s.length;f++)i["$"+s[f]]=!0;for(s=0;s<n.length;s++)f=i.hasOwnProperty("$"+n[s].value),n[s].selected!==f&&(n[s].selected=f),f&&l&&(n[s].defaultSelected=!0)}else{for(s=""+St(s),i=null,f=0;f<n.length;f++){if(n[f].value===s){n[f].selected=!0,l&&(n[f].defaultSelected=!0);return}i!==null||n[f].disabled||(i=n[f])}i!==null&&(i.selected=!0)}}function Ml(n,i,s){if(i!=null&&(i=""+St(i),i!==n.value&&(n.value=i),s==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=s!=null?""+St(s):""}function ja(n,i,s,l){if(i==null){if(l!=null){if(s!=null)throw Error(a(92));if(K(l)){if(1<l.length)throw Error(a(93));l=l[0]}s=l}s==null&&(s=""),i=s}s=St(i),n.defaultValue=s,l=n.textContent,l===s&&l!==""&&l!==null&&(n.value=l),Ia(n)}function Ie(n,i){if(i){var s=n.firstChild;if(s&&s===n.lastChild&&s.nodeType===3){s.nodeValue=i;return}}n.textContent=i}var Il=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ht(n,i,s){var l=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":l?n.setProperty(i,s):typeof s!="number"||s===0||Il.has(i)?i==="float"?n.cssFloat=s:n[i]=(""+s).trim():n[i]=s+"px"}function ct(n,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||i!=null&&i.hasOwnProperty(l)||(l.indexOf("--")===0?n.setProperty(l,""):l==="float"?n.cssFloat="":n[l]="");for(var f in i)l=i[f],i.hasOwnProperty(f)&&s[f]!==l&&Ht(n,f,l)}else for(var g in i)i.hasOwnProperty(g)&&Ht(n,g,i[g])}function ui(n){if(n.indexOf("-")===-1)return!1;switch(n){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 Lr=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),qs=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function di(n){return qs.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ye(){}var we=null;function Ue(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var We=null,Ot=null;function Vn(n){var i=Ir(n);if(i&&(n=i.stateNode)){var s=n[on]||null;e:switch(n=i.stateNode,i.type){case"input":if(Ks(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=n;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+wn(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var l=s[i];if(l!==n&&l.form===n.form){var f=l[on]||null;if(!f)throw Error(a(90));Ks(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(i=0;i<s.length;i++)l=s[i],l.form===n.form&&Gs(l)}break e;case"textarea":Ml(n,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Jt(n,!!s.multiple,i,!1)}}}var Vs=!1;function Dl(n,i,s){if(Vs)return n(i,s);Vs=!0;try{var l=n(i);return l}finally{if(Vs=!1,(We!==null||Ot!==null)&&(Ec(),We&&(i=We,n=Ot,Ot=We=null,Vn(i),n)))for(i=0;i<n.length;i++)Vn(n[i])}}function Ys(n,i){var s=n.stateNode;if(s===null)return null;var l=s[on]||null;if(l===null)return null;s=l[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(n=n.type,l=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!l;break e;default:n=!1}if(n)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var jr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hu=!1;if(jr)try{var Ws={};Object.defineProperty(Ws,"passive",{get:function(){Hu=!0}}),window.addEventListener("test",Ws,Ws),window.removeEventListener("test",Ws,Ws)}catch{Hu=!1}var fi=null,Fu=null,Ll=null;function Zp(){if(Ll)return Ll;var n,i=Fu,s=i.length,l,f="value"in fi?fi.value:fi.textContent,g=f.length;for(n=0;n<s&&i[n]===f[n];n++);var E=s-n;for(l=1;l<=E&&i[s-l]===f[g-l];l++);return Ll=f.slice(n,1<l?1-l:void 0)}function jl(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function zl(){return!0}function Jp(){return!1}function kn(n){function i(s,l,f,g,E){this._reactName=s,this._targetInst=f,this.type=l,this.nativeEvent=g,this.target=E,this.currentTarget=null;for(var N in n)n.hasOwnProperty(N)&&(s=n[N],this[N]=s?s(g):g[N]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?zl:Jp,this.isPropagationStopped=Jp,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=zl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=zl)},persist:function(){},isPersistent:zl}),i}var Zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bl=kn(Zi),Xs=y({},Zi,{view:0,detail:0}),fS=kn(Xs),$u,Gu,Zs,Ul=y({},Xs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qu,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Zs&&(Zs&&n.type==="mousemove"?($u=n.screenX-Zs.screenX,Gu=n.screenY-Zs.screenY):Gu=$u=0,Zs=n),$u)},movementY:function(n){return"movementY"in n?n.movementY:Gu}}),Qp=kn(Ul),hS=y({},Ul,{dataTransfer:0}),pS=kn(hS),mS=y({},Xs,{relatedTarget:0}),Ku=kn(mS),gS=y({},Zi,{animationName:0,elapsedTime:0,pseudoElement:0}),bS=kn(gS),yS=y({},Zi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),vS=kn(yS),xS=y({},Zi,{data:0}),em=kn(xS),ES={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},SS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},_S={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wS(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=_S[n])?!!i[n]:!1}function qu(){return wS}var kS=y({},Xs,{key:function(n){if(n.key){var i=ES[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=jl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?SS[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qu,charCode:function(n){return n.type==="keypress"?jl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?jl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),TS=kn(kS),NS=y({},Ul,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tm=kn(NS),CS=y({},Xs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qu}),AS=kn(CS),OS=y({},Zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),RS=kn(OS),MS=y({},Ul,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),IS=kn(MS),DS=y({},Zi,{newState:0,oldState:0}),LS=kn(DS),jS=[9,13,27,32],Vu=jr&&"CompositionEvent"in window,Js=null;jr&&"documentMode"in document&&(Js=document.documentMode);var zS=jr&&"TextEvent"in window&&!Js,nm=jr&&(!Vu||Js&&8<Js&&11>=Js),rm=" ",im=!1;function am(n,i){switch(n){case"keyup":return jS.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sm(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var za=!1;function BS(n,i){switch(n){case"compositionend":return sm(i);case"keypress":return i.which!==32?null:(im=!0,rm);case"textInput":return n=i.data,n===rm&&im?null:n;default:return null}}function US(n,i){if(za)return n==="compositionend"||!Vu&&am(n,i)?(n=Zp(),Ll=Fu=fi=null,za=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return nm&&i.locale!=="ko"?null:i.data;default:return null}}var PS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function om(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!PS[n.type]:i==="textarea"}function lm(n,i,s,l){We?Ot?Ot.push(l):Ot=[l]:We=l,i=Cc(i,"onChange"),0<i.length&&(s=new Bl("onChange","change",null,s,l),n.push({event:s,listeners:i}))}var Qs=null,eo=null;function HS(n){Gb(n,0)}function Pl(n){var i=li(n);if(Gs(i))return n}function cm(n,i){if(n==="change")return i}var um=!1;if(jr){var Yu;if(jr){var Wu="oninput"in document;if(!Wu){var dm=document.createElement("div");dm.setAttribute("oninput","return;"),Wu=typeof dm.oninput=="function"}Yu=Wu}else Yu=!1;um=Yu&&(!document.documentMode||9<document.documentMode)}function fm(){Qs&&(Qs.detachEvent("onpropertychange",hm),eo=Qs=null)}function hm(n){if(n.propertyName==="value"&&Pl(eo)){var i=[];lm(i,eo,n,Ue(n)),Dl(HS,i)}}function FS(n,i,s){n==="focusin"?(fm(),Qs=i,eo=s,Qs.attachEvent("onpropertychange",hm)):n==="focusout"&&fm()}function $S(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Pl(eo)}function GS(n,i){if(n==="click")return Pl(i)}function KS(n,i){if(n==="input"||n==="change")return Pl(i)}function qS(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var jn=typeof Object.is=="function"?Object.is:qS;function to(n,i){if(jn(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var s=Object.keys(n),l=Object.keys(i);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var f=s[l];if(!bt.call(i,f)||!jn(n[f],i[f]))return!1}return!0}function pm(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function mm(n,i){var s=pm(n);n=0;for(var l;s;){if(s.nodeType===3){if(l=n+s.textContent.length,n<=i&&l>=i)return{node:s,offset:i-n};n=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=pm(s)}}function gm(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?gm(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function bm(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=Da(n.document);i instanceof n.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)n=i.contentWindow;else break;i=Da(n.document)}return i}function Xu(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var VS=jr&&"documentMode"in document&&11>=document.documentMode,Ba=null,Zu=null,no=null,Ju=!1;function ym(n,i,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Ju||Ba==null||Ba!==Da(l)||(l=Ba,"selectionStart"in l&&Xu(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),no&&to(no,l)||(no=l,l=Cc(Zu,"onSelect"),0<l.length&&(i=new Bl("onSelect","select",null,i,s),n.push({event:i,listeners:l}),i.target=Ba)))}function Ji(n,i){var s={};return s[n.toLowerCase()]=i.toLowerCase(),s["Webkit"+n]="webkit"+i,s["Moz"+n]="moz"+i,s}var Ua={animationend:Ji("Animation","AnimationEnd"),animationiteration:Ji("Animation","AnimationIteration"),animationstart:Ji("Animation","AnimationStart"),transitionrun:Ji("Transition","TransitionRun"),transitionstart:Ji("Transition","TransitionStart"),transitioncancel:Ji("Transition","TransitionCancel"),transitionend:Ji("Transition","TransitionEnd")},Qu={},vm={};jr&&(vm=document.createElement("div").style,"AnimationEvent"in window||(delete Ua.animationend.animation,delete Ua.animationiteration.animation,delete Ua.animationstart.animation),"TransitionEvent"in window||delete Ua.transitionend.transition);function Qi(n){if(Qu[n])return Qu[n];if(!Ua[n])return n;var i=Ua[n],s;for(s in i)if(i.hasOwnProperty(s)&&s in vm)return Qu[n]=i[s];return n}var xm=Qi("animationend"),Em=Qi("animationiteration"),Sm=Qi("animationstart"),YS=Qi("transitionrun"),WS=Qi("transitionstart"),XS=Qi("transitioncancel"),_m=Qi("transitionend"),wm=new Map,ed="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ed.push("scrollEnd");function lr(n,i){wm.set(n,i),Dr(i,[n])}var Hl=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Yn=[],Pa=0,td=0;function Fl(){for(var n=Pa,i=td=Pa=0;i<n;){var s=Yn[i];Yn[i++]=null;var l=Yn[i];Yn[i++]=null;var f=Yn[i];Yn[i++]=null;var g=Yn[i];if(Yn[i++]=null,l!==null&&f!==null){var E=l.pending;E===null?f.next=f:(f.next=E.next,E.next=f),l.pending=f}g!==0&&km(s,f,g)}}function $l(n,i,s,l){Yn[Pa++]=n,Yn[Pa++]=i,Yn[Pa++]=s,Yn[Pa++]=l,td|=l,n.lanes|=l,n=n.alternate,n!==null&&(n.lanes|=l)}function nd(n,i,s,l){return $l(n,i,s,l),Gl(n)}function ea(n,i){return $l(n,null,null,i),Gl(n)}function km(n,i,s){n.lanes|=s;var l=n.alternate;l!==null&&(l.lanes|=s);for(var f=!1,g=n.return;g!==null;)g.childLanes|=s,l=g.alternate,l!==null&&(l.childLanes|=s),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(f=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,f&&i!==null&&(f=31-ot(s),n=g.hiddenUpdates,l=n[f],l===null?n[f]=[i]:l.push(i),i.lane=s|536870912),g):null}function Gl(n){if(50<ko)throw ko=0,ff=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Ha={};function ZS(n,i,s,l){this.tag=n,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zn(n,i,s,l){return new ZS(n,i,s,l)}function rd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function zr(n,i){var s=n.alternate;return s===null?(s=zn(n.tag,i,n.key,n.mode),s.elementType=n.elementType,s.type=n.type,s.stateNode=n.stateNode,s.alternate=n,n.alternate=s):(s.pendingProps=i,s.type=n.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=n.flags&65011712,s.childLanes=n.childLanes,s.lanes=n.lanes,s.child=n.child,s.memoizedProps=n.memoizedProps,s.memoizedState=n.memoizedState,s.updateQueue=n.updateQueue,i=n.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=n.sibling,s.index=n.index,s.ref=n.ref,s.refCleanup=n.refCleanup,s}function Tm(n,i){n.flags&=65011714;var s=n.alternate;return s===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,i=s.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Kl(n,i,s,l,f,g){var E=0;if(l=n,typeof n=="function")rd(n)&&(E=1);else if(typeof n=="string")E=nw(n,s,de.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case ee:return n=zn(31,s,i,f),n.elementType=ee,n.lanes=g,n;case S:return ta(s.children,f,g,i);case O:E=8,f|=24;break;case k:return n=zn(12,s,i,f|2),n.elementType=k,n.lanes=g,n;case L:return n=zn(13,s,i,f),n.elementType=L,n.lanes=g,n;case M:return n=zn(19,s,i,f),n.elementType=M,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case w:E=10;break e;case D:E=9;break e;case A:E=11;break e;case $:E=14;break e;case V:E=16,l=null;break e}E=29,s=Error(a(130,n===null?"null":typeof n,"")),l=null}return i=zn(E,s,i,f),i.elementType=n,i.type=l,i.lanes=g,i}function ta(n,i,s,l){return n=zn(7,n,l,i),n.lanes=s,n}function id(n,i,s){return n=zn(6,n,null,i),n.lanes=s,n}function Nm(n){var i=zn(18,null,null,0);return i.stateNode=n,i}function ad(n,i,s){return i=zn(4,n.children!==null?n.children:[],n.key,i),i.lanes=s,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Cm=new WeakMap;function Wn(n,i){if(typeof n=="object"&&n!==null){var s=Cm.get(n);return s!==void 0?s:(i={value:n,source:i,stack:$e(i)},Cm.set(n,i),i)}return{value:n,source:i,stack:$e(i)}}var Fa=[],$a=0,ql=null,ro=0,Xn=[],Zn=0,hi=null,vr=1,xr="";function Br(n,i){Fa[$a++]=ro,Fa[$a++]=ql,ql=n,ro=i}function Am(n,i,s){Xn[Zn++]=vr,Xn[Zn++]=xr,Xn[Zn++]=hi,hi=n;var l=vr;n=xr;var f=32-ot(l)-1;l&=~(1<<f),s+=1;var g=32-ot(i)+f;if(30<g){var E=f-f%5;g=(l&(1<<E)-1).toString(32),l>>=E,f-=E,vr=1<<32-ot(i)+f|s<<f|l,xr=g+n}else vr=1<<g|s<<f|l,xr=n}function sd(n){n.return!==null&&(Br(n,1),Am(n,1,0))}function od(n){for(;n===ql;)ql=Fa[--$a],Fa[$a]=null,ro=Fa[--$a],Fa[$a]=null;for(;n===hi;)hi=Xn[--Zn],Xn[Zn]=null,xr=Xn[--Zn],Xn[Zn]=null,vr=Xn[--Zn],Xn[Zn]=null}function Om(n,i){Xn[Zn++]=vr,Xn[Zn++]=xr,Xn[Zn++]=hi,vr=i.id,xr=i.overflow,hi=n}var Qt=null,Tt=null,Je=!1,pi=null,Jn=!1,ld=Error(a(519));function mi(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw io(Wn(i,n)),ld}function Rm(n){var i=n.stateNode,s=n.type,l=n.memoizedProps;switch(i[jt]=n,i[on]=l,s){case"dialog":Ve("cancel",i),Ve("close",i);break;case"iframe":case"object":case"embed":Ve("load",i);break;case"video":case"audio":for(s=0;s<No.length;s++)Ve(No[s],i);break;case"source":Ve("error",i);break;case"img":case"image":case"link":Ve("error",i),Ve("load",i);break;case"details":Ve("toggle",i);break;case"input":Ve("invalid",i),Xi(i,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ve("invalid",i);break;case"textarea":Ve("invalid",i),ja(i,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||l.suppressHydrationWarning===!0||Yb(i.textContent,s)?(l.popover!=null&&(Ve("beforetoggle",i),Ve("toggle",i)),l.onScroll!=null&&Ve("scroll",i),l.onScrollEnd!=null&&Ve("scrollend",i),l.onClick!=null&&(i.onclick=ye),i=!0):i=!1,i||mi(n,!0)}function Mm(n){for(Qt=n.return;Qt;)switch(Qt.tag){case 5:case 31:case 13:Jn=!1;return;case 27:case 3:Jn=!0;return;default:Qt=Qt.return}}function Ga(n){if(n!==Qt)return!1;if(!Je)return Mm(n),Je=!0,!1;var i=n.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=n.type,s=!(s!=="form"&&s!=="button")||Nf(n.type,n.memoizedProps)),s=!s),s&&Tt&&mi(n),Mm(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));Tt=ry(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));Tt=ry(n)}else i===27?(i=Tt,Ai(n.type)?(n=Mf,Mf=null,Tt=n):Tt=i):Tt=Qt?er(n.stateNode.nextSibling):null;return!0}function na(){Tt=Qt=null,Je=!1}function cd(){var n=pi;return n!==null&&(An===null?An=n:An.push.apply(An,n),pi=null),n}function io(n){pi===null?pi=[n]:pi.push(n)}var ud=R(null),ra=null,Ur=null;function gi(n,i,s){C(ud,i._currentValue),i._currentValue=s}function Pr(n){n._currentValue=ud.current,q(ud)}function dd(n,i,s){for(;n!==null;){var l=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,l!==null&&(l.childLanes|=i)):l!==null&&(l.childLanes&i)!==i&&(l.childLanes|=i),n===s)break;n=n.return}}function fd(n,i,s,l){var f=n.child;for(f!==null&&(f.return=n);f!==null;){var g=f.dependencies;if(g!==null){var E=f.child;g=g.firstContext;e:for(;g!==null;){var N=g;g=f;for(var j=0;j<i.length;j++)if(N.context===i[j]){g.lanes|=s,N=g.alternate,N!==null&&(N.lanes|=s),dd(g.return,s,n),l||(E=null);break e}g=N.next}}else if(f.tag===18){if(E=f.return,E===null)throw Error(a(341));E.lanes|=s,g=E.alternate,g!==null&&(g.lanes|=s),dd(E,s,n),E=null}else E=f.child;if(E!==null)E.return=f;else for(E=f;E!==null;){if(E===n){E=null;break}if(f=E.sibling,f!==null){f.return=E.return,E=f;break}E=E.return}f=E}}function Ka(n,i,s,l){n=null;for(var f=i,g=!1;f!==null;){if(!g){if((f.flags&524288)!==0)g=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var E=f.alternate;if(E===null)throw Error(a(387));if(E=E.memoizedProps,E!==null){var N=f.type;jn(f.pendingProps.value,E.value)||(n!==null?n.push(N):n=[N])}}else if(f===Te.current){if(E=f.alternate,E===null)throw Error(a(387));E.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(n!==null?n.push(Mo):n=[Mo])}f=f.return}n!==null&&fd(i,n,s,l),i.flags|=262144}function Vl(n){for(n=n.firstContext;n!==null;){if(!jn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function ia(n){ra=n,Ur=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function en(n){return Im(ra,n)}function Yl(n,i){return ra===null&&ia(n),Im(n,i)}function Im(n,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},Ur===null){if(n===null)throw Error(a(308));Ur=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Ur=Ur.next=i;return s}var JS=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(s,l){n.push(l)}};this.abort=function(){i.aborted=!0,n.forEach(function(s){return s()})}},QS=e.unstable_scheduleCallback,e_=e.unstable_NormalPriority,Ft={$$typeof:w,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hd(){return{controller:new JS,data:new Map,refCount:0}}function ao(n){n.refCount--,n.refCount===0&&QS(e_,function(){n.controller.abort()})}var so=null,pd=0,qa=0,Va=null;function t_(n,i){if(so===null){var s=so=[];pd=0,qa=yf(),Va={status:"pending",value:void 0,then:function(l){s.push(l)}}}return pd++,i.then(Dm,Dm),i}function Dm(){if(--pd===0&&so!==null){Va!==null&&(Va.status="fulfilled");var n=so;so=null,qa=0,Va=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function n_(n,i){var s=[],l={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return n.then(function(){l.status="fulfilled",l.value=i;for(var f=0;f<s.length;f++)(0,s[f])(i)},function(f){for(l.status="rejected",l.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),l}var Lm=B.S;B.S=function(n,i){yb=wt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&t_(n,i),Lm!==null&&Lm(n,i)};var aa=R(null);function md(){var n=aa.current;return n!==null?n:vt.pooledCache}function Wl(n,i){i===null?C(aa,aa.current):C(aa,i.pool)}function jm(){var n=md();return n===null?null:{parent:Ft._currentValue,pool:n}}var Ya=Error(a(460)),gd=Error(a(474)),Xl=Error(a(542)),Zl={then:function(){}};function zm(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Bm(n,i,s){switch(s=n[s],s===void 0?n.push(i):s!==i&&(i.then(ye,ye),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Pm(n),n;default:if(typeof i.status=="string")i.then(ye,ye);else{if(n=vt,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=i,n.status="pending",n.then(function(l){if(i.status==="pending"){var f=i;f.status="fulfilled",f.value=l}},function(l){if(i.status==="pending"){var f=i;f.status="rejected",f.reason=l}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Pm(n),n}throw oa=i,Ya}}function sa(n){try{var i=n._init;return i(n._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(oa=s,Ya):s}}var oa=null;function Um(){if(oa===null)throw Error(a(459));var n=oa;return oa=null,n}function Pm(n){if(n===Ya||n===Xl)throw Error(a(483))}var Wa=null,oo=0;function Jl(n){var i=oo;return oo+=1,Wa===null&&(Wa=[]),Bm(Wa,n,i)}function lo(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function Ql(n,i){throw i.$$typeof===v?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function Hm(n){function i(G,H){if(n){var W=G.deletions;W===null?(G.deletions=[H],G.flags|=16):W.push(H)}}function s(G,H){if(!n)return null;for(;H!==null;)i(G,H),H=H.sibling;return null}function l(G){for(var H=new Map;G!==null;)G.key!==null?H.set(G.key,G):H.set(G.index,G),G=G.sibling;return H}function f(G,H){return G=zr(G,H),G.index=0,G.sibling=null,G}function g(G,H,W){return G.index=W,n?(W=G.alternate,W!==null?(W=W.index,W<H?(G.flags|=67108866,H):W):(G.flags|=67108866,H)):(G.flags|=1048576,H)}function E(G){return n&&G.alternate===null&&(G.flags|=67108866),G}function N(G,H,W,oe){return H===null||H.tag!==6?(H=id(W,G.mode,oe),H.return=G,H):(H=f(H,W),H.return=G,H)}function j(G,H,W,oe){var Ae=W.type;return Ae===S?re(G,H,W.props.children,oe,W.key):H!==null&&(H.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===V&&sa(Ae)===H.type)?(H=f(H,W.props),lo(H,W),H.return=G,H):(H=Kl(W.type,W.key,W.props,null,G.mode,oe),lo(H,W),H.return=G,H)}function X(G,H,W,oe){return H===null||H.tag!==4||H.stateNode.containerInfo!==W.containerInfo||H.stateNode.implementation!==W.implementation?(H=ad(W,G.mode,oe),H.return=G,H):(H=f(H,W.children||[]),H.return=G,H)}function re(G,H,W,oe,Ae){return H===null||H.tag!==7?(H=ta(W,G.mode,oe,Ae),H.return=G,H):(H=f(H,W),H.return=G,H)}function le(G,H,W){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=id(""+H,G.mode,W),H.return=G,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case x:return W=Kl(H.type,H.key,H.props,null,G.mode,W),lo(W,H),W.return=G,W;case _:return H=ad(H,G.mode,W),H.return=G,H;case V:return H=sa(H),le(G,H,W)}if(K(H)||Y(H))return H=ta(H,G.mode,W,null),H.return=G,H;if(typeof H.then=="function")return le(G,Jl(H),W);if(H.$$typeof===w)return le(G,Yl(G,H),W);Ql(G,H)}return null}function Z(G,H,W,oe){var Ae=H!==null?H.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return Ae!==null?null:N(G,H,""+W,oe);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case x:return W.key===Ae?j(G,H,W,oe):null;case _:return W.key===Ae?X(G,H,W,oe):null;case V:return W=sa(W),Z(G,H,W,oe)}if(K(W)||Y(W))return Ae!==null?null:re(G,H,W,oe,null);if(typeof W.then=="function")return Z(G,H,Jl(W),oe);if(W.$$typeof===w)return Z(G,H,Yl(G,W),oe);Ql(G,W)}return null}function J(G,H,W,oe,Ae){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return G=G.get(W)||null,N(H,G,""+oe,Ae);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:return G=G.get(oe.key===null?W:oe.key)||null,j(H,G,oe,Ae);case _:return G=G.get(oe.key===null?W:oe.key)||null,X(H,G,oe,Ae);case V:return oe=sa(oe),J(G,H,W,oe,Ae)}if(K(oe)||Y(oe))return G=G.get(W)||null,re(H,G,oe,Ae,null);if(typeof oe.then=="function")return J(G,H,W,Jl(oe),Ae);if(oe.$$typeof===w)return J(G,H,W,Yl(H,oe),Ae);Ql(H,oe)}return null}function Se(G,H,W,oe){for(var Ae=null,nt=null,ke=H,He=H=0,Ze=null;ke!==null&&He<W.length;He++){ke.index>He?(Ze=ke,ke=null):Ze=ke.sibling;var rt=Z(G,ke,W[He],oe);if(rt===null){ke===null&&(ke=Ze);break}n&&ke&&rt.alternate===null&&i(G,ke),H=g(rt,H,He),nt===null?Ae=rt:nt.sibling=rt,nt=rt,ke=Ze}if(He===W.length)return s(G,ke),Je&&Br(G,He),Ae;if(ke===null){for(;He<W.length;He++)ke=le(G,W[He],oe),ke!==null&&(H=g(ke,H,He),nt===null?Ae=ke:nt.sibling=ke,nt=ke);return Je&&Br(G,He),Ae}for(ke=l(ke);He<W.length;He++)Ze=J(ke,G,He,W[He],oe),Ze!==null&&(n&&Ze.alternate!==null&&ke.delete(Ze.key===null?He:Ze.key),H=g(Ze,H,He),nt===null?Ae=Ze:nt.sibling=Ze,nt=Ze);return n&&ke.forEach(function(Di){return i(G,Di)}),Je&&Br(G,He),Ae}function Me(G,H,W,oe){if(W==null)throw Error(a(151));for(var Ae=null,nt=null,ke=H,He=H=0,Ze=null,rt=W.next();ke!==null&&!rt.done;He++,rt=W.next()){ke.index>He?(Ze=ke,ke=null):Ze=ke.sibling;var Di=Z(G,ke,rt.value,oe);if(Di===null){ke===null&&(ke=Ze);break}n&&ke&&Di.alternate===null&&i(G,ke),H=g(Di,H,He),nt===null?Ae=Di:nt.sibling=Di,nt=Di,ke=Ze}if(rt.done)return s(G,ke),Je&&Br(G,He),Ae;if(ke===null){for(;!rt.done;He++,rt=W.next())rt=le(G,rt.value,oe),rt!==null&&(H=g(rt,H,He),nt===null?Ae=rt:nt.sibling=rt,nt=rt);return Je&&Br(G,He),Ae}for(ke=l(ke);!rt.done;He++,rt=W.next())rt=J(ke,G,He,rt.value,oe),rt!==null&&(n&&rt.alternate!==null&&ke.delete(rt.key===null?He:rt.key),H=g(rt,H,He),nt===null?Ae=rt:nt.sibling=rt,nt=rt);return n&&ke.forEach(function(hw){return i(G,hw)}),Je&&Br(G,He),Ae}function mt(G,H,W,oe){if(typeof W=="object"&&W!==null&&W.type===S&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case x:e:{for(var Ae=W.key;H!==null;){if(H.key===Ae){if(Ae=W.type,Ae===S){if(H.tag===7){s(G,H.sibling),oe=f(H,W.props.children),oe.return=G,G=oe;break e}}else if(H.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===V&&sa(Ae)===H.type){s(G,H.sibling),oe=f(H,W.props),lo(oe,W),oe.return=G,G=oe;break e}s(G,H);break}else i(G,H);H=H.sibling}W.type===S?(oe=ta(W.props.children,G.mode,oe,W.key),oe.return=G,G=oe):(oe=Kl(W.type,W.key,W.props,null,G.mode,oe),lo(oe,W),oe.return=G,G=oe)}return E(G);case _:e:{for(Ae=W.key;H!==null;){if(H.key===Ae)if(H.tag===4&&H.stateNode.containerInfo===W.containerInfo&&H.stateNode.implementation===W.implementation){s(G,H.sibling),oe=f(H,W.children||[]),oe.return=G,G=oe;break e}else{s(G,H);break}else i(G,H);H=H.sibling}oe=ad(W,G.mode,oe),oe.return=G,G=oe}return E(G);case V:return W=sa(W),mt(G,H,W,oe)}if(K(W))return Se(G,H,W,oe);if(Y(W)){if(Ae=Y(W),typeof Ae!="function")throw Error(a(150));return W=Ae.call(W),Me(G,H,W,oe)}if(typeof W.then=="function")return mt(G,H,Jl(W),oe);if(W.$$typeof===w)return mt(G,H,Yl(G,W),oe);Ql(G,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,H!==null&&H.tag===6?(s(G,H.sibling),oe=f(H,W),oe.return=G,G=oe):(s(G,H),oe=id(W,G.mode,oe),oe.return=G,G=oe),E(G)):s(G,H)}return function(G,H,W,oe){try{oo=0;var Ae=mt(G,H,W,oe);return Wa=null,Ae}catch(ke){if(ke===Ya||ke===Xl)throw ke;var nt=zn(29,ke,null,G.mode);return nt.lanes=oe,nt.return=G,nt}finally{}}}var la=Hm(!0),Fm=Hm(!1),bi=!1;function bd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yd(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function yi(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function vi(n,i,s){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,(at&2)!==0){var f=l.pending;return f===null?i.next=i:(i.next=f.next,f.next=i),l.pending=i,i=Gl(n),km(n,null,s),i}return $l(n,l,i,s),Gl(n)}function co(n,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var l=i.lanes;l&=n.pendingLanes,s|=l,i.lanes=s,De(n,s)}}function vd(n,i){var s=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var f=null,g=null;if(s=s.firstBaseUpdate,s!==null){do{var E={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};g===null?f=g=E:g=g.next=E,s=s.next}while(s!==null);g===null?f=g=i:g=g.next=i}else f=g=i;s={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:g,shared:l.shared,callbacks:l.callbacks},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=i:n.next=i,s.lastBaseUpdate=i}var xd=!1;function uo(){if(xd){var n=Va;if(n!==null)throw n}}function fo(n,i,s,l){xd=!1;var f=n.updateQueue;bi=!1;var g=f.firstBaseUpdate,E=f.lastBaseUpdate,N=f.shared.pending;if(N!==null){f.shared.pending=null;var j=N,X=j.next;j.next=null,E===null?g=X:E.next=X,E=j;var re=n.alternate;re!==null&&(re=re.updateQueue,N=re.lastBaseUpdate,N!==E&&(N===null?re.firstBaseUpdate=X:N.next=X,re.lastBaseUpdate=j))}if(g!==null){var le=f.baseState;E=0,re=X=j=null,N=g;do{var Z=N.lane&-536870913,J=Z!==N.lane;if(J?(Xe&Z)===Z:(l&Z)===Z){Z!==0&&Z===qa&&(xd=!0),re!==null&&(re=re.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Se=n,Me=N;Z=i;var mt=s;switch(Me.tag){case 1:if(Se=Me.payload,typeof Se=="function"){le=Se.call(mt,le,Z);break e}le=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Me.payload,Z=typeof Se=="function"?Se.call(mt,le,Z):Se,Z==null)break e;le=y({},le,Z);break e;case 2:bi=!0}}Z=N.callback,Z!==null&&(n.flags|=64,J&&(n.flags|=8192),J=f.callbacks,J===null?f.callbacks=[Z]:J.push(Z))}else J={lane:Z,tag:N.tag,payload:N.payload,callback:N.callback,next:null},re===null?(X=re=J,j=le):re=re.next=J,E|=Z;if(N=N.next,N===null){if(N=f.shared.pending,N===null)break;J=N,N=J.next,J.next=null,f.lastBaseUpdate=J,f.shared.pending=null}}while(!0);re===null&&(j=le),f.baseState=j,f.firstBaseUpdate=X,f.lastBaseUpdate=re,g===null&&(f.shared.lanes=0),wi|=E,n.lanes=E,n.memoizedState=le}}function $m(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function Gm(n,i){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;n<s.length;n++)$m(s[n],i)}var Xa=R(null),ec=R(0);function Km(n,i){n=Wr,C(ec,n),C(Xa,i),Wr=n|i.baseLanes}function Ed(){C(ec,Wr),C(Xa,Xa.current)}function Sd(){Wr=ec.current,q(Xa),q(ec)}var Bn=R(null),Qn=null;function xi(n){var i=n.alternate;C(Bt,Bt.current&1),C(Bn,n),Qn===null&&(i===null||Xa.current!==null||i.memoizedState!==null)&&(Qn=n)}function _d(n){C(Bt,Bt.current),C(Bn,n),Qn===null&&(Qn=n)}function qm(n){n.tag===22?(C(Bt,Bt.current),C(Bn,n),Qn===null&&(Qn=n)):Ei()}function Ei(){C(Bt,Bt.current),C(Bn,Bn.current)}function Un(n){q(Bn),Qn===n&&(Qn=null),q(Bt)}var Bt=R(0);function tc(n){for(var i=n;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Of(s)||Rf(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Hr=0,Pe=null,ht=null,$t=null,nc=!1,Za=!1,ca=!1,rc=0,ho=0,Ja=null,r_=0;function It(){throw Error(a(321))}function wd(n,i){if(i===null)return!1;for(var s=0;s<i.length&&s<n.length;s++)if(!jn(n[s],i[s]))return!1;return!0}function kd(n,i,s,l,f,g){return Hr=g,Pe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,B.H=n===null||n.memoizedState===null?Ag:Pd,ca=!1,g=s(l,f),ca=!1,Za&&(g=Ym(i,s,l,f)),Vm(n),g}function Vm(n){B.H=go;var i=ht!==null&&ht.next!==null;if(Hr=0,$t=ht=Pe=null,nc=!1,ho=0,Ja=null,i)throw Error(a(300));n===null||Gt||(n=n.dependencies,n!==null&&Vl(n)&&(Gt=!0))}function Ym(n,i,s,l){Pe=n;var f=0;do{if(Za&&(Ja=null),ho=0,Za=!1,25<=f)throw Error(a(301));if(f+=1,$t=ht=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}B.H=Og,g=i(s,l)}while(Za);return g}function i_(){var n=B.H,i=n.useState()[0];return i=typeof i.then=="function"?po(i):i,n=n.useState()[0],(ht!==null?ht.memoizedState:null)!==n&&(Pe.flags|=1024),i}function Td(){var n=rc!==0;return rc=0,n}function Nd(n,i,s){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~s}function Cd(n){if(nc){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}nc=!1}Hr=0,$t=ht=Pe=null,Za=!1,ho=rc=0,Ja=null}function mn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Pe.memoizedState=$t=n:$t=$t.next=n,$t}function Ut(){if(ht===null){var n=Pe.alternate;n=n!==null?n.memoizedState:null}else n=ht.next;var i=$t===null?Pe.memoizedState:$t.next;if(i!==null)$t=i,ht=n;else{if(n===null)throw Pe.alternate===null?Error(a(467)):Error(a(310));ht=n,n={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},$t===null?Pe.memoizedState=$t=n:$t=$t.next=n}return $t}function ic(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function po(n){var i=ho;return ho+=1,Ja===null&&(Ja=[]),n=Bm(Ja,n,i),i=Pe,($t===null?i.memoizedState:$t.next)===null&&(i=i.alternate,B.H=i===null||i.memoizedState===null?Ag:Pd),n}function ac(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return po(n);if(n.$$typeof===w)return en(n)}throw Error(a(438,String(n)))}function Ad(n){var i=null,s=Pe.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var l=Pe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(i={data:l.data.map(function(f){return f.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=ic(),Pe.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(n),l=0;l<n;l++)s[l]=U;return i.index++,s}function Fr(n,i){return typeof i=="function"?i(n):i}function sc(n){var i=Ut();return Od(i,ht,n)}function Od(n,i,s){var l=n.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=s;var f=n.baseQueue,g=l.pending;if(g!==null){if(f!==null){var E=f.next;f.next=g.next,g.next=E}i.baseQueue=f=g,l.pending=null}if(g=n.baseState,f===null)n.memoizedState=g;else{i=f.next;var N=E=null,j=null,X=i,re=!1;do{var le=X.lane&-536870913;if(le!==X.lane?(Xe&le)===le:(Hr&le)===le){var Z=X.revertLane;if(Z===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),le===qa&&(re=!0);else if((Hr&Z)===Z){X=X.next,Z===qa&&(re=!0);continue}else le={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},j===null?(N=j=le,E=g):j=j.next=le,Pe.lanes|=Z,wi|=Z;le=X.action,ca&&s(g,le),g=X.hasEagerState?X.eagerState:s(g,le)}else Z={lane:le,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},j===null?(N=j=Z,E=g):j=j.next=Z,Pe.lanes|=le,wi|=le;X=X.next}while(X!==null&&X!==i);if(j===null?E=g:j.next=N,!jn(g,n.memoizedState)&&(Gt=!0,re&&(s=Va,s!==null)))throw s;n.memoizedState=g,n.baseState=E,n.baseQueue=j,l.lastRenderedState=g}return f===null&&(l.lanes=0),[n.memoizedState,l.dispatch]}function Rd(n){var i=Ut(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=n;var l=s.dispatch,f=s.pending,g=i.memoizedState;if(f!==null){s.pending=null;var E=f=f.next;do g=n(g,E.action),E=E.next;while(E!==f);jn(g,i.memoizedState)||(Gt=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),s.lastRenderedState=g}return[g,l]}function Wm(n,i,s){var l=Pe,f=Ut(),g=Je;if(g){if(s===void 0)throw Error(a(407));s=s()}else s=i();var E=!jn((ht||f).memoizedState,s);if(E&&(f.memoizedState=s,Gt=!0),f=f.queue,Dd(Jm.bind(null,l,f,n),[n]),f.getSnapshot!==i||E||$t!==null&&$t.memoizedState.tag&1){if(l.flags|=2048,Qa(9,{destroy:void 0},Zm.bind(null,l,f,s,i),null),vt===null)throw Error(a(349));g||(Hr&127)!==0||Xm(l,i,s)}return s}function Xm(n,i,s){n.flags|=16384,n={getSnapshot:i,value:s},i=Pe.updateQueue,i===null?(i=ic(),Pe.updateQueue=i,i.stores=[n]):(s=i.stores,s===null?i.stores=[n]:s.push(n))}function Zm(n,i,s,l){i.value=s,i.getSnapshot=l,Qm(i)&&eg(n)}function Jm(n,i,s){return s(function(){Qm(i)&&eg(n)})}function Qm(n){var i=n.getSnapshot;n=n.value;try{var s=i();return!jn(n,s)}catch{return!0}}function eg(n){var i=ea(n,2);i!==null&&On(i,n,2)}function Md(n){var i=mn();if(typeof n=="function"){var s=n;if(n=s(),ca){sn(!0);try{s()}finally{sn(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:n},i}function tg(n,i,s,l){return n.baseState=s,Od(n,ht,typeof l=="function"?l:Fr)}function a_(n,i,s,l,f){if(cc(n))throw Error(a(485));if(n=i.action,n!==null){var g={payload:f,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){g.listeners.push(E)}};B.T!==null?s(!0):g.isTransition=!1,l(g),s=i.pending,s===null?(g.next=i.pending=g,ng(i,g)):(g.next=s.next,i.pending=s.next=g)}}function ng(n,i){var s=i.action,l=i.payload,f=n.state;if(i.isTransition){var g=B.T,E={};B.T=E;try{var N=s(f,l),j=B.S;j!==null&&j(E,N),rg(n,i,N)}catch(X){Id(n,i,X)}finally{g!==null&&E.types!==null&&(g.types=E.types),B.T=g}}else try{g=s(f,l),rg(n,i,g)}catch(X){Id(n,i,X)}}function rg(n,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){ig(n,i,l)},function(l){return Id(n,i,l)}):ig(n,i,s)}function ig(n,i,s){i.status="fulfilled",i.value=s,ag(i),n.state=s,i=n.pending,i!==null&&(s=i.next,s===i?n.pending=null:(s=s.next,i.next=s,ng(n,s)))}function Id(n,i,s){var l=n.pending;if(n.pending=null,l!==null){l=l.next;do i.status="rejected",i.reason=s,ag(i),i=i.next;while(i!==l)}n.action=null}function ag(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function sg(n,i){return i}function og(n,i){if(Je){var s=vt.formState;if(s!==null){e:{var l=Pe;if(Je){if(Tt){t:{for(var f=Tt,g=Jn;f.nodeType!==8;){if(!g){f=null;break t}if(f=er(f.nextSibling),f===null){f=null;break t}}g=f.data,f=g==="F!"||g==="F"?f:null}if(f){Tt=er(f.nextSibling),l=f.data==="F!";break e}}mi(l)}l=!1}l&&(i=s[0])}}return s=mn(),s.memoizedState=s.baseState=i,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sg,lastRenderedState:i},s.queue=l,s=Tg.bind(null,Pe,l),l.dispatch=s,l=Md(!1),g=Ud.bind(null,Pe,!1,l.queue),l=mn(),f={state:i,dispatch:null,action:n,pending:null},l.queue=f,s=a_.bind(null,Pe,f,g,s),f.dispatch=s,l.memoizedState=n,[i,s,!1]}function lg(n){var i=Ut();return cg(i,ht,n)}function cg(n,i,s){if(i=Od(n,i,sg)[0],n=sc(Fr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var l=po(i)}catch(E){throw E===Ya?Xl:E}else l=i;i=Ut();var f=i.queue,g=f.dispatch;return s!==i.memoizedState&&(Pe.flags|=2048,Qa(9,{destroy:void 0},s_.bind(null,f,s),null)),[l,g,n]}function s_(n,i){n.action=i}function ug(n){var i=Ut(),s=ht;if(s!==null)return cg(i,s,n);Ut(),i=i.memoizedState,s=Ut();var l=s.queue.dispatch;return s.memoizedState=n,[i,l,!1]}function Qa(n,i,s,l){return n={tag:n,create:s,deps:l,inst:i,next:null},i=Pe.updateQueue,i===null&&(i=ic(),Pe.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=n.next=n:(l=s.next,s.next=n,n.next=l,i.lastEffect=n),n}function dg(){return Ut().memoizedState}function oc(n,i,s,l){var f=mn();Pe.flags|=n,f.memoizedState=Qa(1|i,{destroy:void 0},s,l===void 0?null:l)}function lc(n,i,s,l){var f=Ut();l=l===void 0?null:l;var g=f.memoizedState.inst;ht!==null&&l!==null&&wd(l,ht.memoizedState.deps)?f.memoizedState=Qa(i,g,s,l):(Pe.flags|=n,f.memoizedState=Qa(1|i,g,s,l))}function fg(n,i){oc(8390656,8,n,i)}function Dd(n,i){lc(2048,8,n,i)}function o_(n){Pe.flags|=4;var i=Pe.updateQueue;if(i===null)i=ic(),Pe.updateQueue=i,i.events=[n];else{var s=i.events;s===null?i.events=[n]:s.push(n)}}function hg(n){var i=Ut().memoizedState;return o_({ref:i,nextImpl:n}),function(){if((at&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function pg(n,i){return lc(4,2,n,i)}function mg(n,i){return lc(4,4,n,i)}function gg(n,i){if(typeof i=="function"){n=n();var s=i(n);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function bg(n,i,s){s=s!=null?s.concat([n]):null,lc(4,4,gg.bind(null,i,n),s)}function Ld(){}function yg(n,i){var s=Ut();i=i===void 0?null:i;var l=s.memoizedState;return i!==null&&wd(i,l[1])?l[0]:(s.memoizedState=[n,i],n)}function vg(n,i){var s=Ut();i=i===void 0?null:i;var l=s.memoizedState;if(i!==null&&wd(i,l[1]))return l[0];if(l=n(),ca){sn(!0);try{n()}finally{sn(!1)}}return s.memoizedState=[l,i],l}function jd(n,i,s){return s===void 0||(Hr&1073741824)!==0&&(Xe&261930)===0?n.memoizedState=i:(n.memoizedState=s,n=xb(),Pe.lanes|=n,wi|=n,s)}function xg(n,i,s,l){return jn(s,i)?s:Xa.current!==null?(n=jd(n,s,l),jn(n,i)||(Gt=!0),n):(Hr&42)===0||(Hr&1073741824)!==0&&(Xe&261930)===0?(Gt=!0,n.memoizedState=s):(n=xb(),Pe.lanes|=n,wi|=n,i)}function Eg(n,i,s,l,f){var g=Q.p;Q.p=g!==0&&8>g?g:8;var E=B.T,N={};B.T=N,Ud(n,!1,i,s);try{var j=f(),X=B.S;if(X!==null&&X(N,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var re=n_(j,l);mo(n,i,re,Fn(n))}else mo(n,i,l,Fn(n))}catch(le){mo(n,i,{then:function(){},status:"rejected",reason:le},Fn())}finally{Q.p=g,E!==null&&N.types!==null&&(E.types=N.types),B.T=E}}function l_(){}function zd(n,i,s,l){if(n.tag!==5)throw Error(a(476));var f=Sg(n).queue;Eg(n,f,i,ae,s===null?l_:function(){return _g(n),s(l)})}function Sg(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:ae},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:s},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function _g(n){var i=Sg(n);i.next===null&&(i=n.alternate.memoizedState),mo(n,i.next.queue,{},Fn())}function Bd(){return en(Mo)}function wg(){return Ut().memoizedState}function kg(){return Ut().memoizedState}function c_(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var s=Fn();n=yi(s);var l=vi(i,n,s);l!==null&&(On(l,i,s),co(l,i,s)),i={cache:hd()},n.payload=i;return}i=i.return}}function u_(n,i,s){var l=Fn();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},cc(n)?Ng(i,s):(s=nd(n,i,s,l),s!==null&&(On(s,n,l),Cg(s,i,l)))}function Tg(n,i,s){var l=Fn();mo(n,i,s,l)}function mo(n,i,s,l){var f={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(cc(n))Ng(i,f);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var E=i.lastRenderedState,N=g(E,s);if(f.hasEagerState=!0,f.eagerState=N,jn(N,E))return $l(n,i,f,0),vt===null&&Fl(),!1}catch{}finally{}if(s=nd(n,i,f,l),s!==null)return On(s,n,l),Cg(s,i,l),!0}return!1}function Ud(n,i,s,l){if(l={lane:2,revertLane:yf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},cc(n)){if(i)throw Error(a(479))}else i=nd(n,s,l,2),i!==null&&On(i,n,2)}function cc(n){var i=n.alternate;return n===Pe||i!==null&&i===Pe}function Ng(n,i){Za=nc=!0;var s=n.pending;s===null?i.next=i:(i.next=s.next,s.next=i),n.pending=i}function Cg(n,i,s){if((s&4194048)!==0){var l=i.lanes;l&=n.pendingLanes,s|=l,i.lanes=s,De(n,s)}}var go={readContext:en,use:ac,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};go.useEffectEvent=It;var Ag={readContext:en,use:ac,useCallback:function(n,i){return mn().memoizedState=[n,i===void 0?null:i],n},useContext:en,useEffect:fg,useImperativeHandle:function(n,i,s){s=s!=null?s.concat([n]):null,oc(4194308,4,gg.bind(null,i,n),s)},useLayoutEffect:function(n,i){return oc(4194308,4,n,i)},useInsertionEffect:function(n,i){oc(4,2,n,i)},useMemo:function(n,i){var s=mn();i=i===void 0?null:i;var l=n();if(ca){sn(!0);try{n()}finally{sn(!1)}}return s.memoizedState=[l,i],l},useReducer:function(n,i,s){var l=mn();if(s!==void 0){var f=s(i);if(ca){sn(!0);try{s(i)}finally{sn(!1)}}}else f=i;return l.memoizedState=l.baseState=f,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:f},l.queue=n,n=n.dispatch=u_.bind(null,Pe,n),[l.memoizedState,n]},useRef:function(n){var i=mn();return n={current:n},i.memoizedState=n},useState:function(n){n=Md(n);var i=n.queue,s=Tg.bind(null,Pe,i);return i.dispatch=s,[n.memoizedState,s]},useDebugValue:Ld,useDeferredValue:function(n,i){var s=mn();return jd(s,n,i)},useTransition:function(){var n=Md(!1);return n=Eg.bind(null,Pe,n.queue,!0,!1),mn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,s){var l=Pe,f=mn();if(Je){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),vt===null)throw Error(a(349));(Xe&127)!==0||Xm(l,i,s)}f.memoizedState=s;var g={value:s,getSnapshot:i};return f.queue=g,fg(Jm.bind(null,l,g,n),[n]),l.flags|=2048,Qa(9,{destroy:void 0},Zm.bind(null,l,g,s,i),null),s},useId:function(){var n=mn(),i=vt.identifierPrefix;if(Je){var s=xr,l=vr;s=(l&~(1<<32-ot(l)-1)).toString(32)+s,i="_"+i+"R_"+s,s=rc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=r_++,i="_"+i+"r_"+s.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:Bd,useFormState:og,useActionState:og,useOptimistic:function(n){var i=mn();i.memoizedState=i.baseState=n;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Ud.bind(null,Pe,!0,s),s.dispatch=i,[n,i]},useMemoCache:Ad,useCacheRefresh:function(){return mn().memoizedState=c_.bind(null,Pe)},useEffectEvent:function(n){var i=mn(),s={impl:n};return i.memoizedState=s,function(){if((at&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Pd={readContext:en,use:ac,useCallback:yg,useContext:en,useEffect:Dd,useImperativeHandle:bg,useInsertionEffect:pg,useLayoutEffect:mg,useMemo:vg,useReducer:sc,useRef:dg,useState:function(){return sc(Fr)},useDebugValue:Ld,useDeferredValue:function(n,i){var s=Ut();return xg(s,ht.memoizedState,n,i)},useTransition:function(){var n=sc(Fr)[0],i=Ut().memoizedState;return[typeof n=="boolean"?n:po(n),i]},useSyncExternalStore:Wm,useId:wg,useHostTransitionStatus:Bd,useFormState:lg,useActionState:lg,useOptimistic:function(n,i){var s=Ut();return tg(s,ht,n,i)},useMemoCache:Ad,useCacheRefresh:kg};Pd.useEffectEvent=hg;var Og={readContext:en,use:ac,useCallback:yg,useContext:en,useEffect:Dd,useImperativeHandle:bg,useInsertionEffect:pg,useLayoutEffect:mg,useMemo:vg,useReducer:Rd,useRef:dg,useState:function(){return Rd(Fr)},useDebugValue:Ld,useDeferredValue:function(n,i){var s=Ut();return ht===null?jd(s,n,i):xg(s,ht.memoizedState,n,i)},useTransition:function(){var n=Rd(Fr)[0],i=Ut().memoizedState;return[typeof n=="boolean"?n:po(n),i]},useSyncExternalStore:Wm,useId:wg,useHostTransitionStatus:Bd,useFormState:ug,useActionState:ug,useOptimistic:function(n,i){var s=Ut();return ht!==null?tg(s,ht,n,i):(s.baseState=n,[n,s.queue.dispatch])},useMemoCache:Ad,useCacheRefresh:kg};Og.useEffectEvent=hg;function Hd(n,i,s,l){i=n.memoizedState,s=s(l,i),s=s==null?i:y({},i,s),n.memoizedState=s,n.lanes===0&&(n.updateQueue.baseState=s)}var Fd={enqueueSetState:function(n,i,s){n=n._reactInternals;var l=Fn(),f=yi(l);f.payload=i,s!=null&&(f.callback=s),i=vi(n,f,l),i!==null&&(On(i,n,l),co(i,n,l))},enqueueReplaceState:function(n,i,s){n=n._reactInternals;var l=Fn(),f=yi(l);f.tag=1,f.payload=i,s!=null&&(f.callback=s),i=vi(n,f,l),i!==null&&(On(i,n,l),co(i,n,l))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var s=Fn(),l=yi(s);l.tag=2,i!=null&&(l.callback=i),i=vi(n,l,s),i!==null&&(On(i,n,s),co(i,n,s))}};function Rg(n,i,s,l,f,g,E){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(l,g,E):i.prototype&&i.prototype.isPureReactComponent?!to(s,l)||!to(f,g):!0}function Mg(n,i,s,l){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,l),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,l),i.state!==n&&Fd.enqueueReplaceState(i,i.state,null)}function ua(n,i){var s=i;if("ref"in i){s={};for(var l in i)l!=="ref"&&(s[l]=i[l])}if(n=n.defaultProps){s===i&&(s=y({},s));for(var f in n)s[f]===void 0&&(s[f]=n[f])}return s}function Ig(n){Hl(n)}function Dg(n){console.error(n)}function Lg(n){Hl(n)}function uc(n,i){try{var s=n.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(l){setTimeout(function(){throw l})}}function jg(n,i,s){try{var l=n.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function $d(n,i,s){return s=yi(s),s.tag=3,s.payload={element:null},s.callback=function(){uc(n,i)},s}function zg(n){return n=yi(n),n.tag=3,n}function Bg(n,i,s,l){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var g=l.value;n.payload=function(){return f(g)},n.callback=function(){jg(i,s,l)}}var E=s.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(n.callback=function(){jg(i,s,l),typeof f!="function"&&(ki===null?ki=new Set([this]):ki.add(this));var N=l.stack;this.componentDidCatch(l.value,{componentStack:N!==null?N:""})})}function d_(n,i,s,l,f){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(i=s.alternate,i!==null&&Ka(i,s,f,!0),s=Bn.current,s!==null){switch(s.tag){case 31:case 13:return Qn===null?Sc():s.alternate===null&&Dt===0&&(Dt=3),s.flags&=-257,s.flags|=65536,s.lanes=f,l===Zl?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([l]):i.add(l),mf(n,l,f)),!1;case 22:return s.flags|=65536,l===Zl?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([l]):s.add(l)),mf(n,l,f)),!1}throw Error(a(435,s.tag))}return mf(n,l,f),Sc(),!1}if(Je)return i=Bn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=f,l!==ld&&(n=Error(a(422),{cause:l}),io(Wn(n,s)))):(l!==ld&&(i=Error(a(423),{cause:l}),io(Wn(i,s))),n=n.current.alternate,n.flags|=65536,f&=-f,n.lanes|=f,l=Wn(l,s),f=$d(n.stateNode,l,f),vd(n,f),Dt!==4&&(Dt=2)),!1;var g=Error(a(520),{cause:l});if(g=Wn(g,s),wo===null?wo=[g]:wo.push(g),Dt!==4&&(Dt=2),i===null)return!0;l=Wn(l,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,n=f&-f,s.lanes|=n,n=$d(s.stateNode,l,n),vd(s,n),!1;case 1:if(i=s.type,g=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(ki===null||!ki.has(g))))return s.flags|=65536,f&=-f,s.lanes|=f,f=zg(f),Bg(f,n,s,l),vd(s,f),!1}s=s.return}while(s!==null);return!1}var Gd=Error(a(461)),Gt=!1;function tn(n,i,s,l){i.child=n===null?Fm(i,null,s,l):la(i,n.child,s,l)}function Ug(n,i,s,l,f){s=s.render;var g=i.ref;if("ref"in l){var E={};for(var N in l)N!=="ref"&&(E[N]=l[N])}else E=l;return ia(i),l=kd(n,i,s,E,g,f),N=Td(),n!==null&&!Gt?(Nd(n,i,f),$r(n,i,f)):(Je&&N&&sd(i),i.flags|=1,tn(n,i,l,f),i.child)}function Pg(n,i,s,l,f){if(n===null){var g=s.type;return typeof g=="function"&&!rd(g)&&g.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=g,Hg(n,i,g,l,f)):(n=Kl(s.type,null,l,i,i.mode,f),n.ref=i.ref,n.return=i,i.child=n)}if(g=n.child,!Jd(n,f)){var E=g.memoizedProps;if(s=s.compare,s=s!==null?s:to,s(E,l)&&n.ref===i.ref)return $r(n,i,f)}return i.flags|=1,n=zr(g,l),n.ref=i.ref,n.return=i,i.child=n}function Hg(n,i,s,l,f){if(n!==null){var g=n.memoizedProps;if(to(g,l)&&n.ref===i.ref)if(Gt=!1,i.pendingProps=l=g,Jd(n,f))(n.flags&131072)!==0&&(Gt=!0);else return i.lanes=n.lanes,$r(n,i,f)}return Kd(n,i,s,l,f)}function Fg(n,i,s,l){var f=l.children,g=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((i.flags&128)!==0){if(g=g!==null?g.baseLanes|s:s,n!==null){for(l=i.child=n.child,f=0;l!==null;)f=f|l.lanes|l.childLanes,l=l.sibling;l=f&~g}else l=0,i.child=null;return $g(n,i,g,s,l)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Wl(i,g!==null?g.cachePool:null),g!==null?Km(i,g):Ed(),qm(i);else return l=i.lanes=536870912,$g(n,i,g!==null?g.baseLanes|s:s,s,l)}else g!==null?(Wl(i,g.cachePool),Km(i,g),Ei(),i.memoizedState=null):(n!==null&&Wl(i,null),Ed(),Ei());return tn(n,i,f,s),i.child}function bo(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function $g(n,i,s,l,f){var g=md();return g=g===null?null:{parent:Ft._currentValue,pool:g},i.memoizedState={baseLanes:s,cachePool:g},n!==null&&Wl(i,null),Ed(),qm(i),n!==null&&Ka(n,i,l,!0),i.childLanes=f,null}function dc(n,i){return i=hc({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function Gg(n,i,s){return la(i,n.child,null,s),n=dc(i,i.pendingProps),n.flags|=2,Un(i),i.memoizedState=null,n}function f_(n,i,s){var l=i.pendingProps,f=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Je){if(l.mode==="hidden")return n=dc(i,l),i.lanes=536870912,bo(null,n);if(_d(i),(n=Tt)?(n=ny(n,Jn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:hi!==null?{id:vr,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},s=Nm(n),s.return=i,i.child=s,Qt=i,Tt=null)):n=null,n===null)throw mi(i);return i.lanes=536870912,null}return dc(i,l)}var g=n.memoizedState;if(g!==null){var E=g.dehydrated;if(_d(i),f)if(i.flags&256)i.flags&=-257,i=Gg(n,i,s);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(Gt||Ka(n,i,s,!1),f=(s&n.childLanes)!==0,Gt||f){if(l=vt,l!==null&&(E=Lt(l,s),E!==0&&E!==g.retryLane))throw g.retryLane=E,ea(n,E),On(l,n,E),Gd;Sc(),i=Gg(n,i,s)}else n=g.treeContext,Tt=er(E.nextSibling),Qt=i,Je=!0,pi=null,Jn=!1,n!==null&&Om(i,n),i=dc(i,l),i.flags|=4096;return i}return n=zr(n.child,{mode:l.mode,children:l.children}),n.ref=i.ref,i.child=n,n.return=i,n}function fc(n,i){var s=i.ref;if(s===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(n===null||n.ref!==s)&&(i.flags|=4194816)}}function Kd(n,i,s,l,f){return ia(i),s=kd(n,i,s,l,void 0,f),l=Td(),n!==null&&!Gt?(Nd(n,i,f),$r(n,i,f)):(Je&&l&&sd(i),i.flags|=1,tn(n,i,s,f),i.child)}function Kg(n,i,s,l,f,g){return ia(i),i.updateQueue=null,s=Ym(i,l,s,f),Vm(n),l=Td(),n!==null&&!Gt?(Nd(n,i,g),$r(n,i,g)):(Je&&l&&sd(i),i.flags|=1,tn(n,i,s,g),i.child)}function qg(n,i,s,l,f){if(ia(i),i.stateNode===null){var g=Ha,E=s.contextType;typeof E=="object"&&E!==null&&(g=en(E)),g=new s(l,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Fd,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=l,g.state=i.memoizedState,g.refs={},bd(i),E=s.contextType,g.context=typeof E=="object"&&E!==null?en(E):Ha,g.state=i.memoizedState,E=s.getDerivedStateFromProps,typeof E=="function"&&(Hd(i,s,E,l),g.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(E=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),E!==g.state&&Fd.enqueueReplaceState(g,g.state,null),fo(i,l,g,f),uo(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),l=!0}else if(n===null){g=i.stateNode;var N=i.memoizedProps,j=ua(s,N);g.props=j;var X=g.context,re=s.contextType;E=Ha,typeof re=="object"&&re!==null&&(E=en(re));var le=s.getDerivedStateFromProps;re=typeof le=="function"||typeof g.getSnapshotBeforeUpdate=="function",N=i.pendingProps!==N,re||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(N||X!==E)&&Mg(i,g,l,E),bi=!1;var Z=i.memoizedState;g.state=Z,fo(i,l,g,f),uo(),X=i.memoizedState,N||Z!==X||bi?(typeof le=="function"&&(Hd(i,s,le,l),X=i.memoizedState),(j=bi||Rg(i,s,j,l,Z,X,E))?(re||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(i.flags|=4194308)):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=l,i.memoizedState=X),g.props=l,g.state=X,g.context=E,l=j):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),l=!1)}else{g=i.stateNode,yd(n,i),E=i.memoizedProps,re=ua(s,E),g.props=re,le=i.pendingProps,Z=g.context,X=s.contextType,j=Ha,typeof X=="object"&&X!==null&&(j=en(X)),N=s.getDerivedStateFromProps,(X=typeof N=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(E!==le||Z!==j)&&Mg(i,g,l,j),bi=!1,Z=i.memoizedState,g.state=Z,fo(i,l,g,f),uo();var J=i.memoizedState;E!==le||Z!==J||bi||n!==null&&n.dependencies!==null&&Vl(n.dependencies)?(typeof N=="function"&&(Hd(i,s,N,l),J=i.memoizedState),(re=bi||Rg(i,s,re,l,Z,J,j)||n!==null&&n.dependencies!==null&&Vl(n.dependencies))?(X||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(l,J,j),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(l,J,j)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||E===n.memoizedProps&&Z===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&Z===n.memoizedState||(i.flags|=1024),i.memoizedProps=l,i.memoizedState=J),g.props=l,g.state=J,g.context=j,l=re):(typeof g.componentDidUpdate!="function"||E===n.memoizedProps&&Z===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&Z===n.memoizedState||(i.flags|=1024),l=!1)}return g=l,fc(n,i),l=(i.flags&128)!==0,g||l?(g=i.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,n!==null&&l?(i.child=la(i,n.child,null,f),i.child=la(i,null,s,f)):tn(n,i,s,f),i.memoizedState=g.state,n=i.child):n=$r(n,i,f),n}function Vg(n,i,s,l){return na(),i.flags|=256,tn(n,i,s,l),i.child}var qd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vd(n){return{baseLanes:n,cachePool:jm()}}function Yd(n,i,s){return n=n!==null?n.childLanes&~s:0,i&&(n|=Hn),n}function Yg(n,i,s){var l=i.pendingProps,f=!1,g=(i.flags&128)!==0,E;if((E=g)||(E=n!==null&&n.memoizedState===null?!1:(Bt.current&2)!==0),E&&(f=!0,i.flags&=-129),E=(i.flags&32)!==0,i.flags&=-33,n===null){if(Je){if(f?xi(i):Ei(),(n=Tt)?(n=ny(n,Jn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:hi!==null?{id:vr,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},s=Nm(n),s.return=i,i.child=s,Qt=i,Tt=null)):n=null,n===null)throw mi(i);return Rf(n)?i.lanes=32:i.lanes=536870912,null}var N=l.children;return l=l.fallback,f?(Ei(),f=i.mode,N=hc({mode:"hidden",children:N},f),l=ta(l,f,s,null),N.return=i,l.return=i,N.sibling=l,i.child=N,l=i.child,l.memoizedState=Vd(s),l.childLanes=Yd(n,E,s),i.memoizedState=qd,bo(null,l)):(xi(i),Wd(i,N))}var j=n.memoizedState;if(j!==null&&(N=j.dehydrated,N!==null)){if(g)i.flags&256?(xi(i),i.flags&=-257,i=Xd(n,i,s)):i.memoizedState!==null?(Ei(),i.child=n.child,i.flags|=128,i=null):(Ei(),N=l.fallback,f=i.mode,l=hc({mode:"visible",children:l.children},f),N=ta(N,f,s,null),N.flags|=2,l.return=i,N.return=i,l.sibling=N,i.child=l,la(i,n.child,null,s),l=i.child,l.memoizedState=Vd(s),l.childLanes=Yd(n,E,s),i.memoizedState=qd,i=bo(null,l));else if(xi(i),Rf(N)){if(E=N.nextSibling&&N.nextSibling.dataset,E)var X=E.dgst;E=X,l=Error(a(419)),l.stack="",l.digest=E,io({value:l,source:null,stack:null}),i=Xd(n,i,s)}else if(Gt||Ka(n,i,s,!1),E=(s&n.childLanes)!==0,Gt||E){if(E=vt,E!==null&&(l=Lt(E,s),l!==0&&l!==j.retryLane))throw j.retryLane=l,ea(n,l),On(E,n,l),Gd;Of(N)||Sc(),i=Xd(n,i,s)}else Of(N)?(i.flags|=192,i.child=n.child,i=null):(n=j.treeContext,Tt=er(N.nextSibling),Qt=i,Je=!0,pi=null,Jn=!1,n!==null&&Om(i,n),i=Wd(i,l.children),i.flags|=4096);return i}return f?(Ei(),N=l.fallback,f=i.mode,j=n.child,X=j.sibling,l=zr(j,{mode:"hidden",children:l.children}),l.subtreeFlags=j.subtreeFlags&65011712,X!==null?N=zr(X,N):(N=ta(N,f,s,null),N.flags|=2),N.return=i,l.return=i,l.sibling=N,i.child=l,bo(null,l),l=i.child,N=n.child.memoizedState,N===null?N=Vd(s):(f=N.cachePool,f!==null?(j=Ft._currentValue,f=f.parent!==j?{parent:j,pool:j}:f):f=jm(),N={baseLanes:N.baseLanes|s,cachePool:f}),l.memoizedState=N,l.childLanes=Yd(n,E,s),i.memoizedState=qd,bo(n.child,l)):(xi(i),s=n.child,n=s.sibling,s=zr(s,{mode:"visible",children:l.children}),s.return=i,s.sibling=null,n!==null&&(E=i.deletions,E===null?(i.deletions=[n],i.flags|=16):E.push(n)),i.child=s,i.memoizedState=null,s)}function Wd(n,i){return i=hc({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function hc(n,i){return n=zn(22,n,null,i),n.lanes=0,n}function Xd(n,i,s){return la(i,n.child,null,s),n=Wd(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function Wg(n,i,s){n.lanes|=i;var l=n.alternate;l!==null&&(l.lanes|=i),dd(n.return,i,s)}function Zd(n,i,s,l,f,g){var E=n.memoizedState;E===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:f,treeForkCount:g}:(E.isBackwards=i,E.rendering=null,E.renderingStartTime=0,E.last=l,E.tail=s,E.tailMode=f,E.treeForkCount=g)}function Xg(n,i,s){var l=i.pendingProps,f=l.revealOrder,g=l.tail;l=l.children;var E=Bt.current,N=(E&2)!==0;if(N?(E=E&1|2,i.flags|=128):E&=1,C(Bt,E),tn(n,i,l,s),l=Je?ro:0,!N&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Wg(n,s,i);else if(n.tag===19)Wg(n,s,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(f){case"forwards":for(s=i.child,f=null;s!==null;)n=s.alternate,n!==null&&tc(n)===null&&(f=s),s=s.sibling;s=f,s===null?(f=i.child,i.child=null):(f=s.sibling,s.sibling=null),Zd(i,!1,f,s,g,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,f=i.child,i.child=null;f!==null;){if(n=f.alternate,n!==null&&tc(n)===null){i.child=f;break}n=f.sibling,f.sibling=s,s=f,f=n}Zd(i,!0,s,null,g,l);break;case"together":Zd(i,!1,null,null,void 0,l);break;default:i.memoizedState=null}return i.child}function $r(n,i,s){if(n!==null&&(i.dependencies=n.dependencies),wi|=i.lanes,(s&i.childLanes)===0)if(n!==null){if(Ka(n,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,s=zr(n,n.pendingProps),i.child=s,s.return=i;n.sibling!==null;)n=n.sibling,s=s.sibling=zr(n,n.pendingProps),s.return=i;s.sibling=null}return i.child}function Jd(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Vl(n)))}function h_(n,i,s){switch(i.tag){case 3:Le(i,i.stateNode.containerInfo),gi(i,Ft,n.memoizedState.cache),na();break;case 27:case 5:Rt(i);break;case 4:Le(i,i.stateNode.containerInfo);break;case 10:gi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,_d(i),null;break;case 13:var l=i.memoizedState;if(l!==null)return l.dehydrated!==null?(xi(i),i.flags|=128,null):(s&i.child.childLanes)!==0?Yg(n,i,s):(xi(i),n=$r(n,i,s),n!==null?n.sibling:null);xi(i);break;case 19:var f=(n.flags&128)!==0;if(l=(s&i.childLanes)!==0,l||(Ka(n,i,s,!1),l=(s&i.childLanes)!==0),f){if(l)return Xg(n,i,s);i.flags|=128}if(f=i.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),C(Bt,Bt.current),l)break;return null;case 22:return i.lanes=0,Fg(n,i,s,i.pendingProps);case 24:gi(i,Ft,n.memoizedState.cache)}return $r(n,i,s)}function Zg(n,i,s){if(n!==null)if(n.memoizedProps!==i.pendingProps)Gt=!0;else{if(!Jd(n,s)&&(i.flags&128)===0)return Gt=!1,h_(n,i,s);Gt=(n.flags&131072)!==0}else Gt=!1,Je&&(i.flags&1048576)!==0&&Am(i,ro,i.index);switch(i.lanes=0,i.tag){case 16:e:{var l=i.pendingProps;if(n=sa(i.elementType),i.type=n,typeof n=="function")rd(n)?(l=ua(n,l),i.tag=1,i=qg(null,i,n,l,s)):(i.tag=0,i=Kd(null,i,n,l,s));else{if(n!=null){var f=n.$$typeof;if(f===A){i.tag=11,i=Ug(null,i,n,l,s);break e}else if(f===$){i.tag=14,i=Pg(null,i,n,l,s);break e}}throw i=ie(n)||n,Error(a(306,i,""))}}return i;case 0:return Kd(n,i,i.type,i.pendingProps,s);case 1:return l=i.type,f=ua(l,i.pendingProps),qg(n,i,l,f,s);case 3:e:{if(Le(i,i.stateNode.containerInfo),n===null)throw Error(a(387));l=i.pendingProps;var g=i.memoizedState;f=g.element,yd(n,i),fo(i,l,null,s);var E=i.memoizedState;if(l=E.cache,gi(i,Ft,l),l!==g.cache&&fd(i,[Ft],s,!0),uo(),l=E.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:E.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=Vg(n,i,l,s);break e}else if(l!==f){f=Wn(Error(a(424)),i),io(f),i=Vg(n,i,l,s);break e}else{switch(n=i.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(Tt=er(n.firstChild),Qt=i,Je=!0,pi=null,Jn=!0,s=Fm(i,null,l,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(na(),l===f){i=$r(n,i,s);break e}tn(n,i,l,s)}i=i.child}return i;case 26:return fc(n,i),n===null?(s=ly(i.type,null,i.pendingProps,null))?i.memoizedState=s:Je||(s=i.type,n=i.pendingProps,l=Ac(he.current).createElement(s),l[jt]=i,l[on]=n,nn(l,s,n),Pt(l),i.stateNode=l):i.memoizedState=ly(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Rt(i),n===null&&Je&&(l=i.stateNode=ay(i.type,i.pendingProps,he.current),Qt=i,Jn=!0,f=Tt,Ai(i.type)?(Mf=f,Tt=er(l.firstChild)):Tt=f),tn(n,i,i.pendingProps.children,s),fc(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Je&&((f=l=Tt)&&(l=$_(l,i.type,i.pendingProps,Jn),l!==null?(i.stateNode=l,Qt=i,Tt=er(l.firstChild),Jn=!1,f=!0):f=!1),f||mi(i)),Rt(i),f=i.type,g=i.pendingProps,E=n!==null?n.memoizedProps:null,l=g.children,Nf(f,g)?l=null:E!==null&&Nf(f,E)&&(i.flags|=32),i.memoizedState!==null&&(f=kd(n,i,i_,null,null,s),Mo._currentValue=f),fc(n,i),tn(n,i,l,s),i.child;case 6:return n===null&&Je&&((n=s=Tt)&&(s=G_(s,i.pendingProps,Jn),s!==null?(i.stateNode=s,Qt=i,Tt=null,n=!0):n=!1),n||mi(i)),null;case 13:return Yg(n,i,s);case 4:return Le(i,i.stateNode.containerInfo),l=i.pendingProps,n===null?i.child=la(i,null,l,s):tn(n,i,l,s),i.child;case 11:return Ug(n,i,i.type,i.pendingProps,s);case 7:return tn(n,i,i.pendingProps,s),i.child;case 8:return tn(n,i,i.pendingProps.children,s),i.child;case 12:return tn(n,i,i.pendingProps.children,s),i.child;case 10:return l=i.pendingProps,gi(i,i.type,l.value),tn(n,i,l.children,s),i.child;case 9:return f=i.type._context,l=i.pendingProps.children,ia(i),f=en(f),l=l(f),i.flags|=1,tn(n,i,l,s),i.child;case 14:return Pg(n,i,i.type,i.pendingProps,s);case 15:return Hg(n,i,i.type,i.pendingProps,s);case 19:return Xg(n,i,s);case 31:return f_(n,i,s);case 22:return Fg(n,i,s,i.pendingProps);case 24:return ia(i),l=en(Ft),n===null?(f=md(),f===null&&(f=vt,g=hd(),f.pooledCache=g,g.refCount++,g!==null&&(f.pooledCacheLanes|=s),f=g),i.memoizedState={parent:l,cache:f},bd(i),gi(i,Ft,f)):((n.lanes&s)!==0&&(yd(n,i),fo(i,null,null,s),uo()),f=n.memoizedState,g=i.memoizedState,f.parent!==l?(f={parent:l,cache:l},i.memoizedState=f,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=f),gi(i,Ft,l)):(l=g.cache,gi(i,Ft,l),l!==f.cache&&fd(i,[Ft],s,!0))),tn(n,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Gr(n){n.flags|=4}function Qd(n,i,s,l,f){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(f&335544128)===f)if(n.stateNode.complete)n.flags|=8192;else if(wb())n.flags|=8192;else throw oa=Zl,gd}else n.flags&=-16777217}function Jg(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!hy(i))if(wb())n.flags|=8192;else throw oa=Zl,gd}function pc(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?je():536870912,n.lanes|=i,rs|=i)}function yo(n,i){if(!Je)switch(n.tailMode){case"hidden":i=n.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?n.tail=null:s.sibling=null;break;case"collapsed":s=n.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:l.sibling=null}}function Nt(n){var i=n.alternate!==null&&n.alternate.child===n.child,s=0,l=0;if(i)for(var f=n.child;f!==null;)s|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=n,f=f.sibling;else for(f=n.child;f!==null;)s|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=n,f=f.sibling;return n.subtreeFlags|=l,n.childLanes=s,i}function p_(n,i,s){var l=i.pendingProps;switch(od(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(i),null;case 1:return Nt(i),null;case 3:return s=i.stateNode,l=null,n!==null&&(l=n.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Pr(Ft),et(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(n===null||n.child===null)&&(Ga(i)?Gr(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,cd())),Nt(i),null;case 26:var f=i.type,g=i.memoizedState;return n===null?(Gr(i),g!==null?(Nt(i),Jg(i,g)):(Nt(i),Qd(i,f,null,l,s))):g?g!==n.memoizedState?(Gr(i),Nt(i),Jg(i,g)):(Nt(i),i.flags&=-16777217):(n=n.memoizedProps,n!==l&&Gr(i),Nt(i),Qd(i,f,n,l,s)),null;case 27:if(an(i),s=he.current,f=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==l&&Gr(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}n=de.current,Ga(i)?Rm(i):(n=ay(f,l,s),i.stateNode=n,Gr(i))}return Nt(i),null;case 5:if(an(i),f=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==l&&Gr(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}if(g=de.current,Ga(i))Rm(i);else{var E=Ac(he.current);switch(g){case 1:g=E.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:g=E.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":g=E.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":g=E.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":g=E.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof l.is=="string"?E.createElement("select",{is:l.is}):E.createElement("select"),l.multiple?g.multiple=!0:l.size&&(g.size=l.size);break;default:g=typeof l.is=="string"?E.createElement(f,{is:l.is}):E.createElement(f)}}g[jt]=i,g[on]=l;e:for(E=i.child;E!==null;){if(E.tag===5||E.tag===6)g.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===i)break e;for(;E.sibling===null;){if(E.return===null||E.return===i)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}i.stateNode=g;e:switch(nn(g,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Gr(i)}}return Nt(i),Qd(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,s),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==l&&Gr(i);else{if(typeof l!="string"&&i.stateNode===null)throw Error(a(166));if(n=he.current,Ga(i)){if(n=i.stateNode,s=i.memoizedProps,l=null,f=Qt,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}n[jt]=i,n=!!(n.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||Yb(n.nodeValue,s)),n||mi(i,!0)}else n=Ac(n).createTextNode(l),n[jt]=i,i.stateNode=n}return Nt(i),null;case 31:if(s=i.memoizedState,n===null||n.memoizedState!==null){if(l=Ga(i),s!==null){if(n===null){if(!l)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[jt]=i}else na(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),n=!1}else s=cd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=s),n=!0;if(!n)return i.flags&256?(Un(i),i):(Un(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Nt(i),null;case 13:if(l=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(f=Ga(i),l!==null&&l.dehydrated!==null){if(n===null){if(!f)throw Error(a(318));if(f=i.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));f[jt]=i}else na(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),f=!1}else f=cd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=f),f=!0;if(!f)return i.flags&256?(Un(i),i):(Un(i),null)}return Un(i),(i.flags&128)!==0?(i.lanes=s,i):(s=l!==null,n=n!==null&&n.memoizedState!==null,s&&(l=i.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==f&&(l.flags|=2048)),s!==n&&s&&(i.child.flags|=8192),pc(i,i.updateQueue),Nt(i),null);case 4:return et(),n===null&&Sf(i.stateNode.containerInfo),Nt(i),null;case 10:return Pr(i.type),Nt(i),null;case 19:if(q(Bt),l=i.memoizedState,l===null)return Nt(i),null;if(f=(i.flags&128)!==0,g=l.rendering,g===null)if(f)yo(l,!1);else{if(Dt!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=tc(n),g!==null){for(i.flags|=128,yo(l,!1),n=g.updateQueue,i.updateQueue=n,pc(i,n),i.subtreeFlags=0,n=s,s=i.child;s!==null;)Tm(s,n),s=s.sibling;return C(Bt,Bt.current&1|2),Je&&Br(i,l.treeForkCount),i.child}n=n.sibling}l.tail!==null&&wt()>vc&&(i.flags|=128,f=!0,yo(l,!1),i.lanes=4194304)}else{if(!f)if(n=tc(g),n!==null){if(i.flags|=128,f=!0,n=n.updateQueue,i.updateQueue=n,pc(i,n),yo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!g.alternate&&!Je)return Nt(i),null}else 2*wt()-l.renderingStartTime>vc&&s!==536870912&&(i.flags|=128,f=!0,yo(l,!1),i.lanes=4194304);l.isBackwards?(g.sibling=i.child,i.child=g):(n=l.last,n!==null?n.sibling=g:i.child=g,l.last=g)}return l.tail!==null?(n=l.tail,l.rendering=n,l.tail=n.sibling,l.renderingStartTime=wt(),n.sibling=null,s=Bt.current,C(Bt,f?s&1|2:s&1),Je&&Br(i,l.treeForkCount),n):(Nt(i),null);case 22:case 23:return Un(i),Sd(),l=i.memoizedState!==null,n!==null?n.memoizedState!==null!==l&&(i.flags|=8192):l&&(i.flags|=8192),l?(s&536870912)!==0&&(i.flags&128)===0&&(Nt(i),i.subtreeFlags&6&&(i.flags|=8192)):Nt(i),s=i.updateQueue,s!==null&&pc(i,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),l=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),l!==s&&(i.flags|=2048),n!==null&&q(aa),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),Pr(Ft),Nt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function m_(n,i){switch(od(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Pr(Ft),et(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return an(i),null;case 31:if(i.memoizedState!==null){if(Un(i),i.alternate===null)throw Error(a(340));na()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(Un(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));na()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return q(Bt),null;case 4:return et(),null;case 10:return Pr(i.type),null;case 22:case 23:return Un(i),Sd(),n!==null&&q(aa),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Pr(Ft),null;case 25:return null;default:return null}}function Qg(n,i){switch(od(i),i.tag){case 3:Pr(Ft),et();break;case 26:case 27:case 5:an(i);break;case 4:et();break;case 31:i.memoizedState!==null&&Un(i);break;case 13:Un(i);break;case 19:q(Bt);break;case 10:Pr(i.type);break;case 22:case 23:Un(i),Sd(),n!==null&&q(aa);break;case 24:Pr(Ft)}}function vo(n,i){try{var s=i.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var f=l.next;s=f;do{if((s.tag&n)===n){l=void 0;var g=s.create,E=s.inst;l=g(),E.destroy=l}s=s.next}while(s!==f)}}catch(N){dt(i,i.return,N)}}function Si(n,i,s){try{var l=i.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var g=f.next;l=g;do{if((l.tag&n)===n){var E=l.inst,N=E.destroy;if(N!==void 0){E.destroy=void 0,f=i;var j=s,X=N;try{X()}catch(re){dt(f,j,re)}}}l=l.next}while(l!==g)}}catch(re){dt(i,i.return,re)}}function eb(n){var i=n.updateQueue;if(i!==null){var s=n.stateNode;try{Gm(i,s)}catch(l){dt(n,n.return,l)}}}function tb(n,i,s){s.props=ua(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(l){dt(n,i,l)}}function xo(n,i){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var l=n.stateNode;break;case 30:l=n.stateNode;break;default:l=n.stateNode}typeof s=="function"?n.refCleanup=s(l):s.current=l}}catch(f){dt(n,i,f)}}function Er(n,i){var s=n.ref,l=n.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(f){dt(n,i,f)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(f){dt(n,i,f)}else s.current=null}function nb(n){var i=n.type,s=n.memoizedProps,l=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(f){dt(n,n.return,f)}}function ef(n,i,s){try{var l=n.stateNode;z_(l,n.type,s,i),l[on]=i}catch(f){dt(n,n.return,f)}}function rb(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Ai(n.type)||n.tag===4}function tf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||rb(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Ai(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function nf(n,i,s){var l=n.tag;if(l===5||l===6)n=n.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(n),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=ye));else if(l!==4&&(l===27&&Ai(n.type)&&(s=n.stateNode,i=null),n=n.child,n!==null))for(nf(n,i,s),n=n.sibling;n!==null;)nf(n,i,s),n=n.sibling}function mc(n,i,s){var l=n.tag;if(l===5||l===6)n=n.stateNode,i?s.insertBefore(n,i):s.appendChild(n);else if(l!==4&&(l===27&&Ai(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(mc(n,i,s),n=n.sibling;n!==null;)mc(n,i,s),n=n.sibling}function ib(n){var i=n.stateNode,s=n.memoizedProps;try{for(var l=n.type,f=i.attributes;f.length;)i.removeAttributeNode(f[0]);nn(i,l,s),i[jt]=n,i[on]=s}catch(g){dt(n,n.return,g)}}var Kr=!1,Kt=!1,rf=!1,ab=typeof WeakSet=="function"?WeakSet:Set,Wt=null;function g_(n,i){if(n=n.containerInfo,kf=jc,n=bm(n),Xu(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var f=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{s.nodeType,g.nodeType}catch{s=null;break e}var E=0,N=-1,j=-1,X=0,re=0,le=n,Z=null;t:for(;;){for(var J;le!==s||f!==0&&le.nodeType!==3||(N=E+f),le!==g||l!==0&&le.nodeType!==3||(j=E+l),le.nodeType===3&&(E+=le.nodeValue.length),(J=le.firstChild)!==null;)Z=le,le=J;for(;;){if(le===n)break t;if(Z===s&&++X===f&&(N=E),Z===g&&++re===l&&(j=E),(J=le.nextSibling)!==null)break;le=Z,Z=le.parentNode}le=J}s=N===-1||j===-1?null:{start:N,end:j}}else s=null}s=s||{start:0,end:0}}else s=null;for(Tf={focusedElem:n,selectionRange:s},jc=!1,Wt=i;Wt!==null;)if(i=Wt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Wt=n;else for(;Wt!==null;){switch(i=Wt,g=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(s=0;s<n.length;s++)f=n[s],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,s=i,f=g.memoizedProps,g=g.memoizedState,l=s.stateNode;try{var Se=ua(s.type,f);n=l.getSnapshotBeforeUpdate(Se,g),l.__reactInternalSnapshotBeforeUpdate=n}catch(Me){dt(s,s.return,Me)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,s=n.nodeType,s===9)Af(n);else if(s===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Af(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=i.sibling,n!==null){n.return=i.return,Wt=n;break}Wt=i.return}}function sb(n,i,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:Vr(n,s),l&4&&vo(5,s);break;case 1:if(Vr(n,s),l&4)if(n=s.stateNode,i===null)try{n.componentDidMount()}catch(E){dt(s,s.return,E)}else{var f=ua(s.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(f,i,n.__reactInternalSnapshotBeforeUpdate)}catch(E){dt(s,s.return,E)}}l&64&&eb(s),l&512&&xo(s,s.return);break;case 3:if(Vr(n,s),l&64&&(n=s.updateQueue,n!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{Gm(n,i)}catch(E){dt(s,s.return,E)}}break;case 27:i===null&&l&4&&ib(s);case 26:case 5:Vr(n,s),i===null&&l&4&&nb(s),l&512&&xo(s,s.return);break;case 12:Vr(n,s);break;case 31:Vr(n,s),l&4&&cb(n,s);break;case 13:Vr(n,s),l&4&&ub(n,s),l&64&&(n=s.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(s=k_.bind(null,s),K_(n,s))));break;case 22:if(l=s.memoizedState!==null||Kr,!l){i=i!==null&&i.memoizedState!==null||Kt,f=Kr;var g=Kt;Kr=l,(Kt=i)&&!g?Yr(n,s,(s.subtreeFlags&8772)!==0):Vr(n,s),Kr=f,Kt=g}break;case 30:break;default:Vr(n,s)}}function ob(n){var i=n.alternate;i!==null&&(n.alternate=null,ob(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&$s(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var At=null,Tn=!1;function qr(n,i,s){for(s=s.child;s!==null;)lb(n,i,s),s=s.sibling}function lb(n,i,s){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(Zt,s)}catch{}switch(s.tag){case 26:Kt||Er(s,i),qr(n,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Kt||Er(s,i);var l=At,f=Tn;Ai(s.type)&&(At=s.stateNode,Tn=!1),qr(n,i,s),Ao(s.stateNode),At=l,Tn=f;break;case 5:Kt||Er(s,i);case 6:if(l=At,f=Tn,At=null,qr(n,i,s),At=l,Tn=f,At!==null)if(Tn)try{(At.nodeType===9?At.body:At.nodeName==="HTML"?At.ownerDocument.body:At).removeChild(s.stateNode)}catch(g){dt(s,i,g)}else try{At.removeChild(s.stateNode)}catch(g){dt(s,i,g)}break;case 18:At!==null&&(Tn?(n=At,ey(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,s.stateNode),ds(n)):ey(At,s.stateNode));break;case 4:l=At,f=Tn,At=s.stateNode.containerInfo,Tn=!0,qr(n,i,s),At=l,Tn=f;break;case 0:case 11:case 14:case 15:Si(2,s,i),Kt||Si(4,s,i),qr(n,i,s);break;case 1:Kt||(Er(s,i),l=s.stateNode,typeof l.componentWillUnmount=="function"&&tb(s,i,l)),qr(n,i,s);break;case 21:qr(n,i,s);break;case 22:Kt=(l=Kt)||s.memoizedState!==null,qr(n,i,s),Kt=l;break;default:qr(n,i,s)}}function cb(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{ds(n)}catch(s){dt(i,i.return,s)}}}function ub(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{ds(n)}catch(s){dt(i,i.return,s)}}function b_(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new ab),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new ab),i;default:throw Error(a(435,n.tag))}}function gc(n,i){var s=b_(n);i.forEach(function(l){if(!s.has(l)){s.add(l);var f=T_.bind(null,n,l);l.then(f,f)}})}function Nn(n,i){var s=i.deletions;if(s!==null)for(var l=0;l<s.length;l++){var f=s[l],g=n,E=i,N=E;e:for(;N!==null;){switch(N.tag){case 27:if(Ai(N.type)){At=N.stateNode,Tn=!1;break e}break;case 5:At=N.stateNode,Tn=!1;break e;case 3:case 4:At=N.stateNode.containerInfo,Tn=!0;break e}N=N.return}if(At===null)throw Error(a(160));lb(g,E,f),At=null,Tn=!1,g=f.alternate,g!==null&&(g.return=null),f.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)db(i,n),i=i.sibling}var cr=null;function db(n,i){var s=n.alternate,l=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Nn(i,n),Cn(n),l&4&&(Si(3,n,n.return),vo(3,n),Si(5,n,n.return));break;case 1:Nn(i,n),Cn(n),l&512&&(Kt||s===null||Er(s,s.return)),l&64&&Kr&&(n=n.updateQueue,n!==null&&(l=n.callbacks,l!==null&&(s=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var f=cr;if(Nn(i,n),Cn(n),l&512&&(Kt||s===null||Er(s,s.return)),l&4){var g=s!==null?s.memoizedState:null;if(l=n.memoizedState,s===null)if(l===null)if(n.stateNode===null){e:{l=n.type,s=n.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":g=f.getElementsByTagName("title")[0],(!g||g[Yi]||g[jt]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=f.createElement(l),f.head.insertBefore(g,f.querySelector("head > title"))),nn(g,l,s),g[jt]=n,Pt(g),l=g;break e;case"link":var E=dy("link","href",f).get(l+(s.href||""));if(E){for(var N=0;N<E.length;N++)if(g=E[N],g.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&g.getAttribute("rel")===(s.rel==null?null:s.rel)&&g.getAttribute("title")===(s.title==null?null:s.title)&&g.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){E.splice(N,1);break t}}g=f.createElement(l),nn(g,l,s),f.head.appendChild(g);break;case"meta":if(E=dy("meta","content",f).get(l+(s.content||""))){for(N=0;N<E.length;N++)if(g=E[N],g.getAttribute("content")===(s.content==null?null:""+s.content)&&g.getAttribute("name")===(s.name==null?null:s.name)&&g.getAttribute("property")===(s.property==null?null:s.property)&&g.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&g.getAttribute("charset")===(s.charSet==null?null:s.charSet)){E.splice(N,1);break t}}g=f.createElement(l),nn(g,l,s),f.head.appendChild(g);break;default:throw Error(a(468,l))}g[jt]=n,Pt(g),l=g}n.stateNode=l}else fy(f,n.type,n.stateNode);else n.stateNode=uy(f,l,n.memoizedProps);else g!==l?(g===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):g.count--,l===null?fy(f,n.type,n.stateNode):uy(f,l,n.memoizedProps)):l===null&&n.stateNode!==null&&ef(n,n.memoizedProps,s.memoizedProps)}break;case 27:Nn(i,n),Cn(n),l&512&&(Kt||s===null||Er(s,s.return)),s!==null&&l&4&&ef(n,n.memoizedProps,s.memoizedProps);break;case 5:if(Nn(i,n),Cn(n),l&512&&(Kt||s===null||Er(s,s.return)),n.flags&32){f=n.stateNode;try{Ie(f,"")}catch(Se){dt(n,n.return,Se)}}l&4&&n.stateNode!=null&&(f=n.memoizedProps,ef(n,f,s!==null?s.memoizedProps:f)),l&1024&&(rf=!0);break;case 6:if(Nn(i,n),Cn(n),l&4){if(n.stateNode===null)throw Error(a(162));l=n.memoizedProps,s=n.stateNode;try{s.nodeValue=l}catch(Se){dt(n,n.return,Se)}}break;case 3:if(Mc=null,f=cr,cr=Oc(i.containerInfo),Nn(i,n),cr=f,Cn(n),l&4&&s!==null&&s.memoizedState.isDehydrated)try{ds(i.containerInfo)}catch(Se){dt(n,n.return,Se)}rf&&(rf=!1,fb(n));break;case 4:l=cr,cr=Oc(n.stateNode.containerInfo),Nn(i,n),Cn(n),cr=l;break;case 12:Nn(i,n),Cn(n);break;case 31:Nn(i,n),Cn(n),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,gc(n,l)));break;case 13:Nn(i,n),Cn(n),n.child.flags&8192&&n.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(yc=wt()),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,gc(n,l)));break;case 22:f=n.memoizedState!==null;var j=s!==null&&s.memoizedState!==null,X=Kr,re=Kt;if(Kr=X||f,Kt=re||j,Nn(i,n),Kt=re,Kr=X,Cn(n),l&8192)e:for(i=n.stateNode,i._visibility=f?i._visibility&-2:i._visibility|1,f&&(s===null||j||Kr||Kt||da(n)),s=null,i=n;;){if(i.tag===5||i.tag===26){if(s===null){j=s=i;try{if(g=j.stateNode,f)E=g.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{N=j.stateNode;var le=j.memoizedProps.style,Z=le!=null&&le.hasOwnProperty("display")?le.display:null;N.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(Se){dt(j,j.return,Se)}}}else if(i.tag===6){if(s===null){j=i;try{j.stateNode.nodeValue=f?"":j.memoizedProps}catch(Se){dt(j,j.return,Se)}}}else if(i.tag===18){if(s===null){j=i;try{var J=j.stateNode;f?ty(J,!0):ty(j.stateNode,!1)}catch(Se){dt(j,j.return,Se)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}l&4&&(l=n.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,gc(n,s))));break;case 19:Nn(i,n),Cn(n),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,gc(n,l)));break;case 30:break;case 21:break;default:Nn(i,n),Cn(n)}}function Cn(n){var i=n.flags;if(i&2){try{for(var s,l=n.return;l!==null;){if(rb(l)){s=l;break}l=l.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var f=s.stateNode,g=tf(n);mc(n,g,f);break;case 5:var E=s.stateNode;s.flags&32&&(Ie(E,""),s.flags&=-33);var N=tf(n);mc(n,N,E);break;case 3:case 4:var j=s.stateNode.containerInfo,X=tf(n);nf(n,X,j);break;default:throw Error(a(161))}}catch(re){dt(n,n.return,re)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function fb(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;fb(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Vr(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)sb(n,i.alternate,i),i=i.sibling}function da(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:Si(4,i,i.return),da(i);break;case 1:Er(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&tb(i,i.return,s),da(i);break;case 27:Ao(i.stateNode);case 26:case 5:Er(i,i.return),da(i);break;case 22:i.memoizedState===null&&da(i);break;case 30:da(i);break;default:da(i)}n=n.sibling}}function Yr(n,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var l=i.alternate,f=n,g=i,E=g.flags;switch(g.tag){case 0:case 11:case 15:Yr(f,g,s),vo(4,g);break;case 1:if(Yr(f,g,s),l=g,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(X){dt(l,l.return,X)}if(l=g,f=l.updateQueue,f!==null){var N=l.stateNode;try{var j=f.shared.hiddenCallbacks;if(j!==null)for(f.shared.hiddenCallbacks=null,f=0;f<j.length;f++)$m(j[f],N)}catch(X){dt(l,l.return,X)}}s&&E&64&&eb(g),xo(g,g.return);break;case 27:ib(g);case 26:case 5:Yr(f,g,s),s&&l===null&&E&4&&nb(g),xo(g,g.return);break;case 12:Yr(f,g,s);break;case 31:Yr(f,g,s),s&&E&4&&cb(f,g);break;case 13:Yr(f,g,s),s&&E&4&&ub(f,g);break;case 22:g.memoizedState===null&&Yr(f,g,s),xo(g,g.return);break;case 30:break;default:Yr(f,g,s)}i=i.sibling}}function af(n,i){var s=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==s&&(n!=null&&n.refCount++,s!=null&&ao(s))}function sf(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&ao(n))}function ur(n,i,s,l){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)hb(n,i,s,l),i=i.sibling}function hb(n,i,s,l){var f=i.flags;switch(i.tag){case 0:case 11:case 15:ur(n,i,s,l),f&2048&&vo(9,i);break;case 1:ur(n,i,s,l);break;case 3:ur(n,i,s,l),f&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&ao(n)));break;case 12:if(f&2048){ur(n,i,s,l),n=i.stateNode;try{var g=i.memoizedProps,E=g.id,N=g.onPostCommit;typeof N=="function"&&N(E,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(j){dt(i,i.return,j)}}else ur(n,i,s,l);break;case 31:ur(n,i,s,l);break;case 13:ur(n,i,s,l);break;case 23:break;case 22:g=i.stateNode,E=i.alternate,i.memoizedState!==null?g._visibility&2?ur(n,i,s,l):Eo(n,i):g._visibility&2?ur(n,i,s,l):(g._visibility|=2,es(n,i,s,l,(i.subtreeFlags&10256)!==0||!1)),f&2048&&af(E,i);break;case 24:ur(n,i,s,l),f&2048&&sf(i.alternate,i);break;default:ur(n,i,s,l)}}function es(n,i,s,l,f){for(f=f&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=n,E=i,N=s,j=l,X=E.flags;switch(E.tag){case 0:case 11:case 15:es(g,E,N,j,f),vo(8,E);break;case 23:break;case 22:var re=E.stateNode;E.memoizedState!==null?re._visibility&2?es(g,E,N,j,f):Eo(g,E):(re._visibility|=2,es(g,E,N,j,f)),f&&X&2048&&af(E.alternate,E);break;case 24:es(g,E,N,j,f),f&&X&2048&&sf(E.alternate,E);break;default:es(g,E,N,j,f)}i=i.sibling}}function Eo(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=n,l=i,f=l.flags;switch(l.tag){case 22:Eo(s,l),f&2048&&af(l.alternate,l);break;case 24:Eo(s,l),f&2048&&sf(l.alternate,l);break;default:Eo(s,l)}i=i.sibling}}var So=8192;function ts(n,i,s){if(n.subtreeFlags&So)for(n=n.child;n!==null;)pb(n,i,s),n=n.sibling}function pb(n,i,s){switch(n.tag){case 26:ts(n,i,s),n.flags&So&&n.memoizedState!==null&&rw(s,cr,n.memoizedState,n.memoizedProps);break;case 5:ts(n,i,s);break;case 3:case 4:var l=cr;cr=Oc(n.stateNode.containerInfo),ts(n,i,s),cr=l;break;case 22:n.memoizedState===null&&(l=n.alternate,l!==null&&l.memoizedState!==null?(l=So,So=16777216,ts(n,i,s),So=l):ts(n,i,s));break;default:ts(n,i,s)}}function mb(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function _o(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var l=i[s];Wt=l,bb(l,n)}mb(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)gb(n),n=n.sibling}function gb(n){switch(n.tag){case 0:case 11:case 15:_o(n),n.flags&2048&&Si(9,n,n.return);break;case 3:_o(n);break;case 12:_o(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,bc(n)):_o(n);break;default:_o(n)}}function bc(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var l=i[s];Wt=l,bb(l,n)}mb(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:Si(8,i,i.return),bc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,bc(i));break;default:bc(i)}n=n.sibling}}function bb(n,i){for(;Wt!==null;){var s=Wt;switch(s.tag){case 0:case 11:case 15:Si(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ao(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,Wt=l;else e:for(s=n;Wt!==null;){l=Wt;var f=l.sibling,g=l.return;if(ob(l),l===s){Wt=null;break e}if(f!==null){f.return=g,Wt=f;break e}Wt=g}}}var y_={getCacheForType:function(n){var i=en(Ft),s=i.data.get(n);return s===void 0&&(s=n(),i.data.set(n,s)),s},cacheSignal:function(){return en(Ft).controller.signal}},v_=typeof WeakMap=="function"?WeakMap:Map,at=0,vt=null,qe=null,Xe=0,ut=0,Pn=null,_i=!1,ns=!1,of=!1,Wr=0,Dt=0,wi=0,fa=0,lf=0,Hn=0,rs=0,wo=null,An=null,cf=!1,yc=0,yb=0,vc=1/0,xc=null,ki=null,Yt=0,Ti=null,is=null,Xr=0,uf=0,df=null,vb=null,ko=0,ff=null;function Fn(){return(at&2)!==0&&Xe!==0?Xe&-Xe:B.T!==null?yf():Oa()}function xb(){if(Hn===0)if((Xe&536870912)===0||Je){var n=Aa;Aa<<=1,(Aa&3932160)===0&&(Aa=262144),Hn=n}else Hn=536870912;return n=Bn.current,n!==null&&(n.flags|=32),Hn}function On(n,i,s){(n===vt&&(ut===2||ut===9)||n.cancelPendingCommit!==null)&&(as(n,0),Ni(n,Xe,Hn,!1)),yt(n,s),((at&2)===0||n!==vt)&&(n===vt&&((at&2)===0&&(fa|=s),Dt===4&&Ni(n,Xe,Hn,!1)),Sr(n))}function Eb(n,i,s){if((at&6)!==0)throw Error(a(327));var l=!s&&(i&127)===0&&(i&n.expiredLanes)===0||se(n,i),f=l?S_(n,i):pf(n,i,!0),g=l;do{if(f===0){ns&&!l&&Ni(n,i,0,!1);break}else{if(s=n.current.alternate,g&&!x_(s)){f=pf(n,i,!1),g=!1;continue}if(f===2){if(g=i,n.errorRecoveryDisabledLanes&g)var E=0;else E=n.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){i=E;e:{var N=n;f=wo;var j=N.current.memoizedState.isDehydrated;if(j&&(as(N,E).flags|=256),E=pf(N,E,!1),E!==2){if(of&&!j){N.errorRecoveryDisabledLanes|=g,fa|=g,f=4;break e}g=An,An=f,g!==null&&(An===null?An=g:An.push.apply(An,g))}f=E}if(g=!1,f!==2)continue}}if(f===1){as(n,0),Ni(n,i,0,!0);break}e:{switch(l=n,g=f,g){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Ni(l,i,Hn,!_i);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(f=yc+300-wt(),10<f)){if(Ni(l,i,Hn,!_i),z(l,0,!0)!==0)break e;Xr=i,l.timeoutHandle=Jb(Sb.bind(null,l,s,An,xc,cf,i,Hn,fa,rs,_i,g,"Throttled",-0,0),f);break e}Sb(l,s,An,xc,cf,i,Hn,fa,rs,_i,g,null,-0,0)}}break}while(!0);Sr(n)}function Sb(n,i,s,l,f,g,E,N,j,X,re,le,Z,J){if(n.timeoutHandle=-1,le=i.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ye},pb(i,g,le);var Se=(g&62914560)===g?yc-wt():(g&4194048)===g?yb-wt():0;if(Se=iw(le,Se),Se!==null){Xr=g,n.cancelPendingCommit=Se(Ob.bind(null,n,i,g,s,l,f,E,N,j,re,le,null,Z,J)),Ni(n,g,E,!X);return}}Ob(n,i,g,s,l,f,E,N,j)}function x_(n){for(var i=n;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var f=s[l],g=f.getSnapshot;f=f.value;try{if(!jn(g(),f))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Ni(n,i,s,l){i&=~lf,i&=~fa,n.suspendedLanes|=i,n.pingedLanes&=~i,l&&(n.warmLanes|=i),l=n.expirationTimes;for(var f=i;0<f;){var g=31-ot(f),E=1<<g;l[g]=-1,f&=~E}s!==0&&Ee(n,s,i)}function Ec(){return(at&6)===0?(To(0),!1):!0}function hf(){if(qe!==null){if(ut===0)var n=qe.return;else n=qe,Ur=ra=null,Cd(n),Wa=null,oo=0,n=qe;for(;n!==null;)Qg(n.alternate,n),n=n.return;qe=null}}function as(n,i){var s=n.timeoutHandle;s!==-1&&(n.timeoutHandle=-1,P_(s)),s=n.cancelPendingCommit,s!==null&&(n.cancelPendingCommit=null,s()),Xr=0,hf(),vt=n,qe=s=zr(n.current,null),Xe=i,ut=0,Pn=null,_i=!1,ns=se(n,i),of=!1,rs=Hn=lf=fa=wi=Dt=0,An=wo=null,cf=!1,(i&8)!==0&&(i|=i&32);var l=n.entangledLanes;if(l!==0)for(n=n.entanglements,l&=i;0<l;){var f=31-ot(l),g=1<<f;i|=n[f],l&=~g}return Wr=i,Fl(),s}function _b(n,i){Pe=null,B.H=go,i===Ya||i===Xl?(i=Um(),ut=3):i===gd?(i=Um(),ut=4):ut=i===Gd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Pn=i,qe===null&&(Dt=1,uc(n,Wn(i,n.current)))}function wb(){var n=Bn.current;return n===null?!0:(Xe&4194048)===Xe?Qn===null:(Xe&62914560)===Xe||(Xe&536870912)!==0?n===Qn:!1}function kb(){var n=B.H;return B.H=go,n===null?go:n}function Tb(){var n=B.A;return B.A=y_,n}function Sc(){Dt=4,_i||(Xe&4194048)!==Xe&&Bn.current!==null||(ns=!0),(wi&134217727)===0&&(fa&134217727)===0||vt===null||Ni(vt,Xe,Hn,!1)}function pf(n,i,s){var l=at;at|=2;var f=kb(),g=Tb();(vt!==n||Xe!==i)&&(xc=null,as(n,i)),i=!1;var E=Dt;e:do try{if(ut!==0&&qe!==null){var N=qe,j=Pn;switch(ut){case 8:hf(),E=6;break e;case 3:case 2:case 9:case 6:Bn.current===null&&(i=!0);var X=ut;if(ut=0,Pn=null,ss(n,N,j,X),s&&ns){E=0;break e}break;default:X=ut,ut=0,Pn=null,ss(n,N,j,X)}}E_(),E=Dt;break}catch(re){_b(n,re)}while(!0);return i&&n.shellSuspendCounter++,Ur=ra=null,at=l,B.H=f,B.A=g,qe===null&&(vt=null,Xe=0,Fl()),E}function E_(){for(;qe!==null;)Nb(qe)}function S_(n,i){var s=at;at|=2;var l=kb(),f=Tb();vt!==n||Xe!==i?(xc=null,vc=wt()+500,as(n,i)):ns=se(n,i);e:do try{if(ut!==0&&qe!==null){i=qe;var g=Pn;t:switch(ut){case 1:ut=0,Pn=null,ss(n,i,g,1);break;case 2:case 9:if(zm(g)){ut=0,Pn=null,Cb(i);break}i=function(){ut!==2&&ut!==9||vt!==n||(ut=7),Sr(n)},g.then(i,i);break e;case 3:ut=7;break e;case 4:ut=5;break e;case 7:zm(g)?(ut=0,Pn=null,Cb(i)):(ut=0,Pn=null,ss(n,i,g,7));break;case 5:var E=null;switch(qe.tag){case 26:E=qe.memoizedState;case 5:case 27:var N=qe;if(E?hy(E):N.stateNode.complete){ut=0,Pn=null;var j=N.sibling;if(j!==null)qe=j;else{var X=N.return;X!==null?(qe=X,_c(X)):qe=null}break t}}ut=0,Pn=null,ss(n,i,g,5);break;case 6:ut=0,Pn=null,ss(n,i,g,6);break;case 8:hf(),Dt=6;break e;default:throw Error(a(462))}}__();break}catch(re){_b(n,re)}while(!0);return Ur=ra=null,B.H=l,B.A=f,at=s,qe!==null?0:(vt=null,Xe=0,Fl(),Dt)}function __(){for(;qe!==null&&!Xt();)Nb(qe)}function Nb(n){var i=Zg(n.alternate,n,Wr);n.memoizedProps=n.pendingProps,i===null?_c(n):qe=i}function Cb(n){var i=n,s=i.alternate;switch(i.tag){case 15:case 0:i=Kg(s,i,i.pendingProps,i.type,void 0,Xe);break;case 11:i=Kg(s,i,i.pendingProps,i.type.render,i.ref,Xe);break;case 5:Cd(i);default:Qg(s,i),i=qe=Tm(i,Wr),i=Zg(s,i,Wr)}n.memoizedProps=n.pendingProps,i===null?_c(n):qe=i}function ss(n,i,s,l){Ur=ra=null,Cd(i),Wa=null,oo=0;var f=i.return;try{if(d_(n,f,i,s,Xe)){Dt=1,uc(n,Wn(s,n.current)),qe=null;return}}catch(g){if(f!==null)throw qe=f,g;Dt=1,uc(n,Wn(s,n.current)),qe=null;return}i.flags&32768?(Je||l===1?n=!0:ns||(Xe&536870912)!==0?n=!1:(_i=n=!0,(l===2||l===9||l===3||l===6)&&(l=Bn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Ab(i,n)):_c(i)}function _c(n){var i=n;do{if((i.flags&32768)!==0){Ab(i,_i);return}n=i.return;var s=p_(i.alternate,i,Wr);if(s!==null){qe=s;return}if(i=i.sibling,i!==null){qe=i;return}qe=i=n}while(i!==null);Dt===0&&(Dt=5)}function Ab(n,i){do{var s=m_(n.alternate,n);if(s!==null){s.flags&=32767,qe=s;return}if(s=n.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(n=n.sibling,n!==null)){qe=n;return}qe=n=s}while(n!==null);Dt=6,qe=null}function Ob(n,i,s,l,f,g,E,N,j){n.cancelPendingCommit=null;do wc();while(Yt!==0);if((at&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=td,_e(n,s,g,E,N,j),n===vt&&(qe=vt=null,Xe=0),is=i,Ti=n,Xr=s,uf=g,df=f,vb=l,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,N_(Re,function(){return Lb(),null})):(n.callbackNode=null,n.callbackPriority=0),l=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||l){l=B.T,B.T=null,f=Q.p,Q.p=2,E=at,at|=4;try{g_(n,i,s)}finally{at=E,Q.p=f,B.T=l}}Yt=1,Rb(),Mb(),Ib()}}function Rb(){if(Yt===1){Yt=0;var n=Ti,i=is,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=B.T,B.T=null;var l=Q.p;Q.p=2;var f=at;at|=4;try{db(i,n);var g=Tf,E=bm(n.containerInfo),N=g.focusedElem,j=g.selectionRange;if(E!==N&&N&&N.ownerDocument&&gm(N.ownerDocument.documentElement,N)){if(j!==null&&Xu(N)){var X=j.start,re=j.end;if(re===void 0&&(re=X),"selectionStart"in N)N.selectionStart=X,N.selectionEnd=Math.min(re,N.value.length);else{var le=N.ownerDocument||document,Z=le&&le.defaultView||window;if(Z.getSelection){var J=Z.getSelection(),Se=N.textContent.length,Me=Math.min(j.start,Se),mt=j.end===void 0?Me:Math.min(j.end,Se);!J.extend&&Me>mt&&(E=mt,mt=Me,Me=E);var G=mm(N,Me),H=mm(N,mt);if(G&&H&&(J.rangeCount!==1||J.anchorNode!==G.node||J.anchorOffset!==G.offset||J.focusNode!==H.node||J.focusOffset!==H.offset)){var W=le.createRange();W.setStart(G.node,G.offset),J.removeAllRanges(),Me>mt?(J.addRange(W),J.extend(H.node,H.offset)):(W.setEnd(H.node,H.offset),J.addRange(W))}}}}for(le=[],J=N;J=J.parentNode;)J.nodeType===1&&le.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<le.length;N++){var oe=le[N];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}jc=!!kf,Tf=kf=null}finally{at=f,Q.p=l,B.T=s}}n.current=i,Yt=2}}function Mb(){if(Yt===2){Yt=0;var n=Ti,i=is,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=B.T,B.T=null;var l=Q.p;Q.p=2;var f=at;at|=4;try{sb(n,i.alternate,i)}finally{at=f,Q.p=l,B.T=s}}Yt=3}}function Ib(){if(Yt===4||Yt===3){Yt=0,Rr();var n=Ti,i=is,s=Xr,l=vb;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Yt=5:(Yt=0,is=Ti=null,Db(n,n.pendingLanes));var f=n.pendingLanes;if(f===0&&(ki=null),Mr(s),i=i.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(Zt,i,void 0,(i.current.flags&128)===128)}catch{}if(l!==null){i=B.T,f=Q.p,Q.p=2,B.T=null;try{for(var g=n.onRecoverableError,E=0;E<l.length;E++){var N=l[E];g(N.value,{componentStack:N.stack})}}finally{B.T=i,Q.p=f}}(Xr&3)!==0&&wc(),Sr(n),f=n.pendingLanes,(s&261930)!==0&&(f&42)!==0?n===ff?ko++:(ko=0,ff=n):ko=0,To(0)}}function Db(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,ao(i)))}function wc(){return Rb(),Mb(),Ib(),Lb()}function Lb(){if(Yt!==5)return!1;var n=Ti,i=uf;uf=0;var s=Mr(Xr),l=B.T,f=Q.p;try{Q.p=32>s?32:s,B.T=null,s=df,df=null;var g=Ti,E=Xr;if(Yt=0,is=Ti=null,Xr=0,(at&6)!==0)throw Error(a(331));var N=at;if(at|=4,gb(g.current),hb(g,g.current,E,s),at=N,To(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(Zt,g)}catch{}return!0}finally{Q.p=f,B.T=l,Db(n,i)}}function jb(n,i,s){i=Wn(s,i),i=$d(n.stateNode,i,2),n=vi(n,i,2),n!==null&&(yt(n,2),Sr(n))}function dt(n,i,s){if(n.tag===3)jb(n,n,s);else for(;i!==null;){if(i.tag===3){jb(i,n,s);break}else if(i.tag===1){var l=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ki===null||!ki.has(l))){n=Wn(s,n),s=zg(2),l=vi(i,s,2),l!==null&&(Bg(s,l,i,n),yt(l,2),Sr(l));break}}i=i.return}}function mf(n,i,s){var l=n.pingCache;if(l===null){l=n.pingCache=new v_;var f=new Set;l.set(i,f)}else f=l.get(i),f===void 0&&(f=new Set,l.set(i,f));f.has(s)||(of=!0,f.add(s),n=w_.bind(null,n,i,s),i.then(n,n))}function w_(n,i,s){var l=n.pingCache;l!==null&&l.delete(i),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,vt===n&&(Xe&s)===s&&(Dt===4||Dt===3&&(Xe&62914560)===Xe&&300>wt()-yc?(at&2)===0&&as(n,0):lf|=s,rs===Xe&&(rs=0)),Sr(n)}function zb(n,i){i===0&&(i=je()),n=ea(n,i),n!==null&&(yt(n,i),Sr(n))}function k_(n){var i=n.memoizedState,s=0;i!==null&&(s=i.retryLane),zb(n,s)}function T_(n,i){var s=0;switch(n.tag){case 31:case 13:var l=n.stateNode,f=n.memoizedState;f!==null&&(s=f.retryLane);break;case 19:l=n.stateNode;break;case 22:l=n.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(i),zb(n,s)}function N_(n,i){return Vt(n,i)}var kc=null,os=null,gf=!1,Tc=!1,bf=!1,Ci=0;function Sr(n){n!==os&&n.next===null&&(os===null?kc=os=n:os=os.next=n),Tc=!0,gf||(gf=!0,A_())}function To(n,i){if(!bf&&Tc){bf=!0;do for(var s=!1,l=kc;l!==null;){if(n!==0){var f=l.pendingLanes;if(f===0)var g=0;else{var E=l.suspendedLanes,N=l.pingedLanes;g=(1<<31-ot(42|n)+1)-1,g&=f&~(E&~N),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(s=!0,Hb(l,g))}else g=Xe,g=z(l,l===vt?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(g&3)===0||se(l,g)||(s=!0,Hb(l,g));l=l.next}while(s);bf=!1}}function C_(){Bb()}function Bb(){Tc=gf=!1;var n=0;Ci!==0&&U_()&&(n=Ci);for(var i=wt(),s=null,l=kc;l!==null;){var f=l.next,g=Ub(l,i);g===0?(l.next=null,s===null?kc=f:s.next=f,f===null&&(os=s)):(s=l,(n!==0||(g&3)!==0)&&(Tc=!0)),l=f}Yt!==0&&Yt!==5||To(n),Ci!==0&&(Ci=0)}function Ub(n,i){for(var s=n.suspendedLanes,l=n.pingedLanes,f=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var E=31-ot(g),N=1<<E,j=f[E];j===-1?((N&s)===0||(N&l)!==0)&&(f[E]=xe(N,i)):j<=i&&(n.expiredLanes|=N),g&=~N}if(i=vt,s=Xe,s=z(n,n===i?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l=n.callbackNode,s===0||n===i&&(ut===2||ut===9)||n.cancelPendingCommit!==null)return l!==null&&l!==null&&sr(l),n.callbackNode=null,n.callbackPriority=0;if((s&3)===0||se(n,s)){if(i=s&-s,i===n.callbackPriority)return i;switch(l!==null&&sr(l),Mr(s)){case 2:case 8:s=ge;break;case 32:s=Re;break;case 268435456:s=tt;break;default:s=Re}return l=Pb.bind(null,n),s=Vt(s,l),n.callbackPriority=i,n.callbackNode=s,i}return l!==null&&l!==null&&sr(l),n.callbackPriority=2,n.callbackNode=null,2}function Pb(n,i){if(Yt!==0&&Yt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var s=n.callbackNode;if(wc()&&n.callbackNode!==s)return null;var l=Xe;return l=z(n,n===vt?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l===0?null:(Eb(n,l,i),Ub(n,wt()),n.callbackNode!=null&&n.callbackNode===s?Pb.bind(null,n):null)}function Hb(n,i){if(wc())return null;Eb(n,i,!0)}function A_(){H_(function(){(at&6)!==0?Vt(te,C_):Bb()})}function yf(){if(Ci===0){var n=qa;n===0&&(n=qi,qi<<=1,(qi&261888)===0&&(qi=256)),Ci=n}return Ci}function Fb(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:di(""+n)}function $b(n,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,n.id&&s.setAttribute("form",n.id),i.parentNode.insertBefore(s,i),n=new FormData(n),s.parentNode.removeChild(s),n}function O_(n,i,s,l,f){if(i==="submit"&&s&&s.stateNode===f){var g=Fb((f[on]||null).action),E=l.submitter;E&&(i=(i=E[on]||null)?Fb(i.formAction):E.getAttribute("formAction"),i!==null&&(g=i,E=null));var N=new Bl("action","action",null,l,f);n.push({event:N,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ci!==0){var j=E?$b(f,E):new FormData(f);zd(s,{pending:!0,data:j,method:f.method,action:g},null,j)}}else typeof g=="function"&&(N.preventDefault(),j=E?$b(f,E):new FormData(f),zd(s,{pending:!0,data:j,method:f.method,action:g},g,j))},currentTarget:f}]})}}for(var vf=0;vf<ed.length;vf++){var xf=ed[vf],R_=xf.toLowerCase(),M_=xf[0].toUpperCase()+xf.slice(1);lr(R_,"on"+M_)}lr(xm,"onAnimationEnd"),lr(Em,"onAnimationIteration"),lr(Sm,"onAnimationStart"),lr("dblclick","onDoubleClick"),lr("focusin","onFocus"),lr("focusout","onBlur"),lr(YS,"onTransitionRun"),lr(WS,"onTransitionStart"),lr(XS,"onTransitionCancel"),lr(_m,"onTransitionEnd"),pe("onMouseEnter",["mouseout","mouseover"]),pe("onMouseLeave",["mouseout","mouseover"]),pe("onPointerEnter",["pointerout","pointerover"]),pe("onPointerLeave",["pointerout","pointerover"]),Dr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Dr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Dr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Dr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Dr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Dr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var No="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),I_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(No));function Gb(n,i){i=(i&4)!==0;for(var s=0;s<n.length;s++){var l=n[s],f=l.event;l=l.listeners;e:{var g=void 0;if(i)for(var E=l.length-1;0<=E;E--){var N=l[E],j=N.instance,X=N.currentTarget;if(N=N.listener,j!==g&&f.isPropagationStopped())break e;g=N,f.currentTarget=X;try{g(f)}catch(re){Hl(re)}f.currentTarget=null,g=j}else for(E=0;E<l.length;E++){if(N=l[E],j=N.instance,X=N.currentTarget,N=N.listener,j!==g&&f.isPropagationStopped())break e;g=N,f.currentTarget=X;try{g(f)}catch(re){Hl(re)}f.currentTarget=null,g=j}}}}function Ve(n,i){var s=i[Fs];s===void 0&&(s=i[Fs]=new Set);var l=n+"__bubble";s.has(l)||(Kb(i,n,2,!1),s.add(l))}function Ef(n,i,s){var l=0;i&&(l|=4),Kb(s,n,l,i)}var Nc="_reactListening"+Math.random().toString(36).slice(2);function Sf(n){if(!n[Nc]){n[Nc]=!0,Ol.forEach(function(s){s!=="selectionchange"&&(I_.has(s)||Ef(s,!1,n),Ef(s,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[Nc]||(i[Nc]=!0,Ef("selectionchange",!1,i))}}function Kb(n,i,s,l){switch(xy(i)){case 2:var f=ow;break;case 8:f=lw;break;default:f=zf}s=f.bind(null,i,s,n),f=void 0,!Hu||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(f=!0),l?f!==void 0?n.addEventListener(i,s,{capture:!0,passive:f}):n.addEventListener(i,s,!0):f!==void 0?n.addEventListener(i,s,{passive:f}):n.addEventListener(i,s,!1)}function _f(n,i,s,l,f){var g=l;if((i&1)===0&&(i&2)===0&&l!==null)e:for(;;){if(l===null)return;var E=l.tag;if(E===3||E===4){var N=l.stateNode.containerInfo;if(N===f)break;if(E===4)for(E=l.return;E!==null;){var j=E.tag;if((j===3||j===4)&&E.stateNode.containerInfo===f)return;E=E.return}for(;N!==null;){if(E=pn(N),E===null)return;if(j=E.tag,j===5||j===6||j===26||j===27){l=g=E;continue e}N=N.parentNode}}l=l.return}Dl(function(){var X=g,re=Ue(s),le=[];e:{var Z=wm.get(n);if(Z!==void 0){var J=Bl,Se=n;switch(n){case"keypress":if(jl(s)===0)break e;case"keydown":case"keyup":J=TS;break;case"focusin":Se="focus",J=Ku;break;case"focusout":Se="blur",J=Ku;break;case"beforeblur":case"afterblur":J=Ku;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=Qp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=pS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=AS;break;case xm:case Em:case Sm:J=bS;break;case _m:J=RS;break;case"scroll":case"scrollend":J=fS;break;case"wheel":J=IS;break;case"copy":case"cut":case"paste":J=vS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=tm;break;case"toggle":case"beforetoggle":J=LS}var Me=(i&4)!==0,mt=!Me&&(n==="scroll"||n==="scrollend"),G=Me?Z!==null?Z+"Capture":null:Z;Me=[];for(var H=X,W;H!==null;){var oe=H;if(W=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||W===null||G===null||(oe=Ys(H,G),oe!=null&&Me.push(Co(H,oe,W))),mt)break;H=H.return}0<Me.length&&(Z=new J(Z,Se,null,s,re),le.push({event:Z,listeners:Me}))}}if((i&7)===0){e:{if(Z=n==="mouseover"||n==="pointerover",J=n==="mouseout"||n==="pointerout",Z&&s!==we&&(Se=s.relatedTarget||s.fromElement)&&(pn(Se)||Se[oi]))break e;if((J||Z)&&(Z=re.window===re?re:(Z=re.ownerDocument)?Z.defaultView||Z.parentWindow:window,J?(Se=s.relatedTarget||s.toElement,J=X,Se=Se?pn(Se):null,Se!==null&&(mt=c(Se),Me=Se.tag,Se!==mt||Me!==5&&Me!==27&&Me!==6)&&(Se=null)):(J=null,Se=X),J!==Se)){if(Me=Qp,oe="onMouseLeave",G="onMouseEnter",H="mouse",(n==="pointerout"||n==="pointerover")&&(Me=tm,oe="onPointerLeave",G="onPointerEnter",H="pointer"),mt=J==null?Z:li(J),W=Se==null?Z:li(Se),Z=new Me(oe,H+"leave",J,s,re),Z.target=mt,Z.relatedTarget=W,oe=null,pn(re)===X&&(Me=new Me(G,H+"enter",Se,s,re),Me.target=W,Me.relatedTarget=mt,oe=Me),mt=oe,J&&Se)t:{for(Me=D_,G=J,H=Se,W=0,oe=G;oe;oe=Me(oe))W++;oe=0;for(var Ae=H;Ae;Ae=Me(Ae))oe++;for(;0<W-oe;)G=Me(G),W--;for(;0<oe-W;)H=Me(H),oe--;for(;W--;){if(G===H||H!==null&&G===H.alternate){Me=G;break t}G=Me(G),H=Me(H)}Me=null}else Me=null;J!==null&&qb(le,Z,J,Me,!1),Se!==null&&mt!==null&&qb(le,mt,Se,Me,!0)}}e:{if(Z=X?li(X):window,J=Z.nodeName&&Z.nodeName.toLowerCase(),J==="select"||J==="input"&&Z.type==="file")var nt=cm;else if(om(Z))if(um)nt=KS;else{nt=$S;var ke=FS}else J=Z.nodeName,!J||J.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?X&&ui(X.elementType)&&(nt=cm):nt=GS;if(nt&&(nt=nt(n,X))){lm(le,nt,s,re);break e}ke&&ke(n,Z,X),n==="focusout"&&X&&Z.type==="number"&&X.memoizedProps.value!=null&&La(Z,"number",Z.value)}switch(ke=X?li(X):window,n){case"focusin":(om(ke)||ke.contentEditable==="true")&&(Ba=ke,Zu=X,no=null);break;case"focusout":no=Zu=Ba=null;break;case"mousedown":Ju=!0;break;case"contextmenu":case"mouseup":case"dragend":Ju=!1,ym(le,s,re);break;case"selectionchange":if(VS)break;case"keydown":case"keyup":ym(le,s,re)}var He;if(Vu)e:{switch(n){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else za?am(n,s)&&(Ze="onCompositionEnd"):n==="keydown"&&s.keyCode===229&&(Ze="onCompositionStart");Ze&&(nm&&s.locale!=="ko"&&(za||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&za&&(He=Zp()):(fi=re,Fu="value"in fi?fi.value:fi.textContent,za=!0)),ke=Cc(X,Ze),0<ke.length&&(Ze=new em(Ze,n,null,s,re),le.push({event:Ze,listeners:ke}),He?Ze.data=He:(He=sm(s),He!==null&&(Ze.data=He)))),(He=zS?BS(n,s):US(n,s))&&(Ze=Cc(X,"onBeforeInput"),0<Ze.length&&(ke=new em("onBeforeInput","beforeinput",null,s,re),le.push({event:ke,listeners:Ze}),ke.data=He)),O_(le,n,X,s,re)}Gb(le,i)})}function Co(n,i,s){return{instance:n,listener:i,currentTarget:s}}function Cc(n,i){for(var s=i+"Capture",l=[];n!==null;){var f=n,g=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||g===null||(f=Ys(n,s),f!=null&&l.unshift(Co(n,f,g)),f=Ys(n,i),f!=null&&l.push(Co(n,f,g))),n.tag===3)return l;n=n.return}return[]}function D_(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function qb(n,i,s,l,f){for(var g=i._reactName,E=[];s!==null&&s!==l;){var N=s,j=N.alternate,X=N.stateNode;if(N=N.tag,j!==null&&j===l)break;N!==5&&N!==26&&N!==27||X===null||(j=X,f?(X=Ys(s,g),X!=null&&E.unshift(Co(s,X,j))):f||(X=Ys(s,g),X!=null&&E.push(Co(s,X,j)))),s=s.return}E.length!==0&&n.push({event:i,listeners:E})}var L_=/\r\n?/g,j_=/\u0000|\uFFFD/g;function Vb(n){return(typeof n=="string"?n:""+n).replace(L_,`
|
|
49
|
-
`).replace(j_,"")}function Yb(n,i){return i=Vb(i),Vb(n)===i}function pt(n,i,s,l,f,g){switch(s){case"children":typeof l=="string"?i==="body"||i==="textarea"&&l===""||Ie(n,l):(typeof l=="number"||typeof l=="bigint")&&i!=="body"&&Ie(n,""+l);break;case"className":Dn(n,"class",l);break;case"tabIndex":Dn(n,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Dn(n,s,l);break;case"style":ct(n,l,g);break;case"data":if(i!=="object"){Dn(n,"data",l);break}case"src":case"href":if(l===""&&(i!=="a"||s!=="href")){n.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(s);break}l=di(""+l),n.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){n.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(s==="formAction"?(i!=="input"&&pt(n,i,"name",f.name,f,null),pt(n,i,"formEncType",f.formEncType,f,null),pt(n,i,"formMethod",f.formMethod,f,null),pt(n,i,"formTarget",f.formTarget,f,null)):(pt(n,i,"encType",f.encType,f,null),pt(n,i,"method",f.method,f,null),pt(n,i,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(s);break}l=di(""+l),n.setAttribute(s,l);break;case"onClick":l!=null&&(n.onclick=ye);break;case"onScroll":l!=null&&Ve("scroll",n);break;case"onScrollEnd":l!=null&&Ve("scrollend",n);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(s=l.__html,s!=null){if(f.children!=null)throw Error(a(60));n.innerHTML=s}}break;case"multiple":n.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":n.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){n.removeAttribute("xlink:href");break}s=di(""+l),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(s,""+l):n.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(s,""):n.removeAttribute(s);break;case"capture":case"download":l===!0?n.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(s,l):n.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?n.setAttribute(s,l):n.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?n.removeAttribute(s):n.setAttribute(s,l);break;case"popover":Ve("beforetoggle",n),Ve("toggle",n),ln(n,"popover",l);break;case"xlinkActuate":_n(n,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":_n(n,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":_n(n,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":_n(n,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":_n(n,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":_n(n,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":_n(n,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":_n(n,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":_n(n,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":ln(n,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Lr.get(s)||s,ln(n,s,l))}}function wf(n,i,s,l,f,g){switch(s){case"style":ct(n,l,g);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(s=l.__html,s!=null){if(f.children!=null)throw Error(a(60));n.innerHTML=s}}break;case"children":typeof l=="string"?Ie(n,l):(typeof l=="number"||typeof l=="bigint")&&Ie(n,""+l);break;case"onScroll":l!=null&&Ve("scroll",n);break;case"onScrollEnd":l!=null&&Ve("scrollend",n);break;case"onClick":l!=null&&(n.onclick=ye);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wi.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(f=s.endsWith("Capture"),i=s.slice(2,f?s.length-7:void 0),g=n[on]||null,g=g!=null?g[s]:null,typeof g=="function"&&n.removeEventListener(i,g,f),typeof l=="function")){typeof g!="function"&&g!==null&&(s in n?n[s]=null:n.hasAttribute(s)&&n.removeAttribute(s)),n.addEventListener(i,l,f);break e}s in n?n[s]=l:l===!0?n.setAttribute(s,""):ln(n,s,l)}}}function nn(n,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",n),Ve("load",n);var l=!1,f=!1,g;for(g in s)if(s.hasOwnProperty(g)){var E=s[g];if(E!=null)switch(g){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:pt(n,i,g,E,s,null)}}f&&pt(n,i,"srcSet",s.srcSet,s,null),l&&pt(n,i,"src",s.src,s,null);return;case"input":Ve("invalid",n);var N=g=E=f=null,j=null,X=null;for(l in s)if(s.hasOwnProperty(l)){var re=s[l];if(re!=null)switch(l){case"name":f=re;break;case"type":E=re;break;case"checked":j=re;break;case"defaultChecked":X=re;break;case"value":g=re;break;case"defaultValue":N=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,i));break;default:pt(n,i,l,re,s,null)}}Xi(n,g,N,j,X,E,f,!1);return;case"select":Ve("invalid",n),l=E=g=null;for(f in s)if(s.hasOwnProperty(f)&&(N=s[f],N!=null))switch(f){case"value":g=N;break;case"defaultValue":E=N;break;case"multiple":l=N;default:pt(n,i,f,N,s,null)}i=g,s=E,n.multiple=!!l,i!=null?Jt(n,!!l,i,!1):s!=null&&Jt(n,!!l,s,!0);return;case"textarea":Ve("invalid",n),g=f=l=null;for(E in s)if(s.hasOwnProperty(E)&&(N=s[E],N!=null))switch(E){case"value":l=N;break;case"defaultValue":f=N;break;case"children":g=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(a(91));break;default:pt(n,i,E,N,s,null)}ja(n,l,f,g);return;case"option":for(j in s)if(s.hasOwnProperty(j)&&(l=s[j],l!=null))switch(j){case"selected":n.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:pt(n,i,j,l,s,null)}return;case"dialog":Ve("beforetoggle",n),Ve("toggle",n),Ve("cancel",n),Ve("close",n);break;case"iframe":case"object":Ve("load",n);break;case"video":case"audio":for(l=0;l<No.length;l++)Ve(No[l],n);break;case"image":Ve("error",n),Ve("load",n);break;case"details":Ve("toggle",n);break;case"embed":case"source":case"link":Ve("error",n),Ve("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(X in s)if(s.hasOwnProperty(X)&&(l=s[X],l!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:pt(n,i,X,l,s,null)}return;default:if(ui(i)){for(re in s)s.hasOwnProperty(re)&&(l=s[re],l!==void 0&&wf(n,i,re,l,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(l=s[N],l!=null&&pt(n,i,N,l,s,null))}function z_(n,i,s,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,g=null,E=null,N=null,j=null,X=null,re=null;for(J in s){var le=s[J];if(s.hasOwnProperty(J)&&le!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":j=le;default:l.hasOwnProperty(J)||pt(n,i,J,null,l,le)}}for(var Z in l){var J=l[Z];if(le=s[Z],l.hasOwnProperty(Z)&&(J!=null||le!=null))switch(Z){case"type":g=J;break;case"name":f=J;break;case"checked":X=J;break;case"defaultChecked":re=J;break;case"value":E=J;break;case"defaultValue":N=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,i));break;default:J!==le&&pt(n,i,Z,J,l,le)}}Ks(n,E,N,j,X,re,g,f);return;case"select":J=E=N=Z=null;for(g in s)if(j=s[g],s.hasOwnProperty(g)&&j!=null)switch(g){case"value":break;case"multiple":J=j;default:l.hasOwnProperty(g)||pt(n,i,g,null,l,j)}for(f in l)if(g=l[f],j=s[f],l.hasOwnProperty(f)&&(g!=null||j!=null))switch(f){case"value":Z=g;break;case"defaultValue":N=g;break;case"multiple":E=g;default:g!==j&&pt(n,i,f,g,l,j)}i=N,s=E,l=J,Z!=null?Jt(n,!!s,Z,!1):!!l!=!!s&&(i!=null?Jt(n,!!s,i,!0):Jt(n,!!s,s?[]:"",!1));return;case"textarea":J=Z=null;for(N in s)if(f=s[N],s.hasOwnProperty(N)&&f!=null&&!l.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:pt(n,i,N,null,l,f)}for(E in l)if(f=l[E],g=s[E],l.hasOwnProperty(E)&&(f!=null||g!=null))switch(E){case"value":Z=f;break;case"defaultValue":J=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==g&&pt(n,i,E,f,l,g)}Ml(n,Z,J);return;case"option":for(var Se in s)if(Z=s[Se],s.hasOwnProperty(Se)&&Z!=null&&!l.hasOwnProperty(Se))switch(Se){case"selected":n.selected=!1;break;default:pt(n,i,Se,null,l,Z)}for(j in l)if(Z=l[j],J=s[j],l.hasOwnProperty(j)&&Z!==J&&(Z!=null||J!=null))switch(j){case"selected":n.selected=Z&&typeof Z!="function"&&typeof Z!="symbol";break;default:pt(n,i,j,Z,l,J)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Me in s)Z=s[Me],s.hasOwnProperty(Me)&&Z!=null&&!l.hasOwnProperty(Me)&&pt(n,i,Me,null,l,Z);for(X in l)if(Z=l[X],J=s[X],l.hasOwnProperty(X)&&Z!==J&&(Z!=null||J!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(a(137,i));break;default:pt(n,i,X,Z,l,J)}return;default:if(ui(i)){for(var mt in s)Z=s[mt],s.hasOwnProperty(mt)&&Z!==void 0&&!l.hasOwnProperty(mt)&&wf(n,i,mt,void 0,l,Z);for(re in l)Z=l[re],J=s[re],!l.hasOwnProperty(re)||Z===J||Z===void 0&&J===void 0||wf(n,i,re,Z,l,J);return}}for(var G in s)Z=s[G],s.hasOwnProperty(G)&&Z!=null&&!l.hasOwnProperty(G)&&pt(n,i,G,null,l,Z);for(le in l)Z=l[le],J=s[le],!l.hasOwnProperty(le)||Z===J||Z==null&&J==null||pt(n,i,le,Z,l,J)}function Wb(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function B_(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var f=s[l],g=f.transferSize,E=f.initiatorType,N=f.duration;if(g&&N&&Wb(E)){for(E=0,N=f.responseEnd,l+=1;l<s.length;l++){var j=s[l],X=j.startTime;if(X>N)break;var re=j.transferSize,le=j.initiatorType;re&&Wb(le)&&(j=j.responseEnd,E+=re*(j<N?1:(N-X)/(j-X)))}if(--l,i+=8*(g+E)/(f.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var kf=null,Tf=null;function Ac(n){return n.nodeType===9?n:n.ownerDocument}function Xb(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Zb(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function Nf(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Cf=null;function U_(){var n=window.event;return n&&n.type==="popstate"?n===Cf?!1:(Cf=n,!0):(Cf=null,!1)}var Jb=typeof setTimeout=="function"?setTimeout:void 0,P_=typeof clearTimeout=="function"?clearTimeout:void 0,Qb=typeof Promise=="function"?Promise:void 0,H_=typeof queueMicrotask=="function"?queueMicrotask:typeof Qb<"u"?function(n){return Qb.resolve(null).then(n).catch(F_)}:Jb;function F_(n){setTimeout(function(){throw n})}function Ai(n){return n==="head"}function ey(n,i){var s=i,l=0;do{var f=s.nextSibling;if(n.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(l===0){n.removeChild(f),ds(i);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Ao(n.ownerDocument.documentElement);else if(s==="head"){s=n.ownerDocument.head,Ao(s);for(var g=s.firstChild;g;){var E=g.nextSibling,N=g.nodeName;g[Yi]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&g.rel.toLowerCase()==="stylesheet"||s.removeChild(g),g=E}}else s==="body"&&Ao(n.ownerDocument.body);s=f}while(s);ds(i)}function ty(n,i){var s=n;n=0;do{var l=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(n===0)break;n--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||n++;s=l}while(s)}function Af(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Af(s),$s(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}n.removeChild(s)}}function $_(n,i,s,l){for(;n.nodeType===1;){var f=s;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!l&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(l){if(!n[Yi])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(g=n.getAttribute("rel"),g==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(g!==f.rel||n.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||n.getAttribute("title")!==(f.title==null?null:f.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(f.src==null?null:f.src)||n.getAttribute("type")!==(f.type==null?null:f.type)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var g=f.name==null?null:""+f.name;if(f.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=er(n.nextSibling),n===null)break}return null}function G_(n,i,s){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=er(n.nextSibling),n===null))return null;return n}function ny(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=er(n.nextSibling),n===null))return null;return n}function Of(n){return n.data==="$?"||n.data==="$~"}function Rf(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function K_(n,i){var s=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||s.readyState!=="loading")i();else{var l=function(){i(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),n._reactRetry=l}}function er(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var Mf=null;function ry(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var s=n.data;if(s==="/$"||s==="/&"){if(i===0)return er(n.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}n=n.nextSibling}return null}function iy(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var s=n.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return n;i--}else s!=="/$"&&s!=="/&"||i++}n=n.previousSibling}return null}function ay(n,i,s){switch(i=Ac(s),n){case"html":if(n=i.documentElement,!n)throw Error(a(452));return n;case"head":if(n=i.head,!n)throw Error(a(453));return n;case"body":if(n=i.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function Ao(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);$s(n)}var tr=new Map,sy=new Set;function Oc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Zr=Q.d;Q.d={f:q_,r:V_,D:Y_,C:W_,L:X_,m:Z_,X:Q_,S:J_,M:ew};function q_(){var n=Zr.f(),i=Ec();return n||i}function V_(n){var i=Ir(n);i!==null&&i.tag===5&&i.type==="form"?_g(i):Zr.r(n)}var ls=typeof document>"u"?null:document;function oy(n,i,s){var l=ls;if(l&&typeof i=="string"&&i){var f=wn(i);f='link[rel="'+n+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),sy.has(f)||(sy.add(f),n={rel:n,crossOrigin:s,href:i},l.querySelector(f)===null&&(i=l.createElement("link"),nn(i,"link",n),Pt(i),l.head.appendChild(i)))}}function Y_(n){Zr.D(n),oy("dns-prefetch",n,null)}function W_(n,i){Zr.C(n,i),oy("preconnect",n,i)}function X_(n,i,s){Zr.L(n,i,s);var l=ls;if(l&&n&&i){var f='link[rel="preload"][as="'+wn(i)+'"]';i==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+wn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+wn(s.imageSizes)+'"]')):f+='[href="'+wn(n)+'"]';var g=f;switch(i){case"style":g=cs(n);break;case"script":g=us(n)}tr.has(g)||(n=y({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:n,as:i},s),tr.set(g,n),l.querySelector(f)!==null||i==="style"&&l.querySelector(Oo(g))||i==="script"&&l.querySelector(Ro(g))||(i=l.createElement("link"),nn(i,"link",n),Pt(i),l.head.appendChild(i)))}}function Z_(n,i){Zr.m(n,i);var s=ls;if(s&&n){var l=i&&typeof i.as=="string"?i.as:"script",f='link[rel="modulepreload"][as="'+wn(l)+'"][href="'+wn(n)+'"]',g=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=us(n)}if(!tr.has(g)&&(n=y({rel:"modulepreload",href:n},i),tr.set(g,n),s.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Ro(g)))return}l=s.createElement("link"),nn(l,"link",n),Pt(l),s.head.appendChild(l)}}}function J_(n,i,s){Zr.S(n,i,s);var l=ls;if(l&&n){var f=ci(l).hoistableStyles,g=cs(n);i=i||"default";var E=f.get(g);if(!E){var N={loading:0,preload:null};if(E=l.querySelector(Oo(g)))N.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},s),(s=tr.get(g))&&If(n,s);var j=E=l.createElement("link");Pt(j),nn(j,"link",n),j._p=new Promise(function(X,re){j.onload=X,j.onerror=re}),j.addEventListener("load",function(){N.loading|=1}),j.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Rc(E,i,l)}E={type:"stylesheet",instance:E,count:1,state:N},f.set(g,E)}}}function Q_(n,i){Zr.X(n,i);var s=ls;if(s&&n){var l=ci(s).hoistableScripts,f=us(n),g=l.get(f);g||(g=s.querySelector(Ro(f)),g||(n=y({src:n,async:!0},i),(i=tr.get(f))&&Df(n,i),g=s.createElement("script"),Pt(g),nn(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(f,g))}}function ew(n,i){Zr.M(n,i);var s=ls;if(s&&n){var l=ci(s).hoistableScripts,f=us(n),g=l.get(f);g||(g=s.querySelector(Ro(f)),g||(n=y({src:n,async:!0,type:"module"},i),(i=tr.get(f))&&Df(n,i),g=s.createElement("script"),Pt(g),nn(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(f,g))}}function ly(n,i,s,l){var f=(f=he.current)?Oc(f):null;if(!f)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=cs(s.href),s=ci(f).hoistableStyles,l=s.get(i),l||(l={type:"style",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=cs(s.href);var g=ci(f).hoistableStyles,E=g.get(n);if(E||(f=f.ownerDocument||f,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,E),(g=f.querySelector(Oo(n)))&&!g._p&&(E.instance=g,E.state.loading=5),tr.has(n)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},tr.set(n,s),g||tw(f,n,s,E.state))),i&&l===null)throw Error(a(528,""));return E}if(i&&l!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=us(s),s=ci(f).hoistableScripts,l=s.get(i),l||(l={type:"script",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function cs(n){return'href="'+wn(n)+'"'}function Oo(n){return'link[rel="stylesheet"]['+n+"]"}function cy(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function tw(n,i,s,l){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?l.loading=1:(i=n.createElement("link"),l.preload=i,i.addEventListener("load",function(){return l.loading|=1}),i.addEventListener("error",function(){return l.loading|=2}),nn(i,"link",s),Pt(i),n.head.appendChild(i))}function us(n){return'[src="'+wn(n)+'"]'}function Ro(n){return"script[async]"+n}function uy(n,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var l=n.querySelector('style[data-href~="'+wn(s.href)+'"]');if(l)return i.instance=l,Pt(l),l;var f=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(n.ownerDocument||n).createElement("style"),Pt(l),nn(l,"style",f),Rc(l,s.precedence,n),i.instance=l;case"stylesheet":f=cs(s.href);var g=n.querySelector(Oo(f));if(g)return i.state.loading|=4,i.instance=g,Pt(g),g;l=cy(s),(f=tr.get(f))&&If(l,f),g=(n.ownerDocument||n).createElement("link"),Pt(g);var E=g;return E._p=new Promise(function(N,j){E.onload=N,E.onerror=j}),nn(g,"link",l),i.state.loading|=4,Rc(g,s.precedence,n),i.instance=g;case"script":return g=us(s.src),(f=n.querySelector(Ro(g)))?(i.instance=f,Pt(f),f):(l=s,(f=tr.get(g))&&(l=y({},s),Df(l,f)),n=n.ownerDocument||n,f=n.createElement("script"),Pt(f),nn(f,"link",l),n.head.appendChild(f),i.instance=f);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(l=i.instance,i.state.loading|=4,Rc(l,s.precedence,n));return i.instance}function Rc(n,i,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,g=f,E=0;E<l.length;E++){var N=l[E];if(N.dataset.precedence===i)g=N;else if(g!==f)break}g?g.parentNode.insertBefore(n,g.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(n,i.firstChild))}function If(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function Df(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var Mc=null;function dy(n,i,s){if(Mc===null){var l=new Map,f=Mc=new Map;f.set(s,l)}else f=Mc,l=f.get(s),l||(l=new Map,f.set(s,l));if(l.has(n))return l;for(l.set(n,null),s=s.getElementsByTagName(n),f=0;f<s.length;f++){var g=s[f];if(!(g[Yi]||g[jt]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var E=g.getAttribute(i)||"";E=n+E;var N=l.get(E);N?N.push(g):l.set(E,[g])}}return l}function fy(n,i,s){n=n.ownerDocument||n,n.head.insertBefore(s,i==="title"?n.querySelector("head > title"):null)}function nw(n,i,s){if(s===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return n=i.disabled,typeof i.precedence=="string"&&n==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function hy(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function rw(n,i,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=cs(l.href),g=i.querySelector(Oo(f));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=Ic.bind(n),i.then(n,n)),s.state.loading|=4,s.instance=g,Pt(g);return}g=i.ownerDocument||i,l=cy(l),(f=tr.get(f))&&If(l,f),g=g.createElement("link"),Pt(g);var E=g;E._p=new Promise(function(N,j){E.onload=N,E.onerror=j}),nn(g,"link",l),s.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(n.count++,s=Ic.bind(n),i.addEventListener("load",s),i.addEventListener("error",s))}}var Lf=0;function iw(n,i){return n.stylesheets&&n.count===0&&Lc(n,n.stylesheets),0<n.count||0<n.imgCount?function(s){var l=setTimeout(function(){if(n.stylesheets&&Lc(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+i);0<n.imgBytes&&Lf===0&&(Lf=62500*B_());var f=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Lc(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>Lf?50:800)+i);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function Ic(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Dc=null;function Lc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Dc=new Map,i.forEach(aw,n),Dc=null,Ic.call(n))}function aw(n,i){if(!(i.state.loading&4)){var s=Dc.get(n);if(s)var l=s.get(null);else{s=new Map,Dc.set(n,s);for(var f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<f.length;g++){var E=f[g];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(s.set(E.dataset.precedence,E),l=E)}l&&s.set(null,l)}f=i.instance,E=f.getAttribute("data-precedence"),g=s.get(E)||l,g===l&&s.set(null,f),s.set(E,f),this.count++,l=Ic.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),g?g.parentNode.insertBefore(f,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(f,n.firstChild)),i.state.loading|=4}}var Mo={$$typeof:w,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function sw(n,i,s,l,f,g,E,N,j){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=kt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kt(0),this.hiddenUpdates=kt(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=g,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function py(n,i,s,l,f,g,E,N,j,X,re,le){return n=new sw(n,i,s,E,j,X,re,le,N),i=1,g===!0&&(i|=24),g=zn(3,null,null,i),n.current=g,g.stateNode=n,i=hd(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:l,isDehydrated:s,cache:i},bd(g),n}function my(n){return n?(n=Ha,n):Ha}function gy(n,i,s,l,f,g){f=my(f),l.context===null?l.context=f:l.pendingContext=f,l=yi(i),l.payload={element:s},g=g===void 0?null:g,g!==null&&(l.callback=g),s=vi(n,l,i),s!==null&&(On(s,n,i),co(s,n,i))}function by(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var s=n.retryLane;n.retryLane=s!==0&&s<i?s:i}}function jf(n,i){by(n,i),(n=n.alternate)&&by(n,i)}function yy(n){if(n.tag===13||n.tag===31){var i=ea(n,67108864);i!==null&&On(i,n,67108864),jf(n,67108864)}}function vy(n){if(n.tag===13||n.tag===31){var i=Fn();i=Ct(i);var s=ea(n,i);s!==null&&On(s,n,i),jf(n,i)}}var jc=!0;function ow(n,i,s,l){var f=B.T;B.T=null;var g=Q.p;try{Q.p=2,zf(n,i,s,l)}finally{Q.p=g,B.T=f}}function lw(n,i,s,l){var f=B.T;B.T=null;var g=Q.p;try{Q.p=8,zf(n,i,s,l)}finally{Q.p=g,B.T=f}}function zf(n,i,s,l){if(jc){var f=Bf(l);if(f===null)_f(n,i,l,zc,s),Ey(n,l);else if(uw(f,n,i,s,l))l.stopPropagation();else if(Ey(n,l),i&4&&-1<cw.indexOf(n)){for(;f!==null;){var g=Ir(f);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var E=Sn(g.pendingLanes);if(E!==0){var N=g;for(N.pendingLanes|=2,N.entangledLanes|=2;E;){var j=1<<31-ot(E);N.entanglements[1]|=j,E&=~j}Sr(g),(at&6)===0&&(vc=wt()+500,To(0))}}break;case 31:case 13:N=ea(g,2),N!==null&&On(N,g,2),Ec(),jf(g,2)}if(g=Bf(l),g===null&&_f(n,i,l,zc,s),g===f)break;f=g}f!==null&&l.stopPropagation()}else _f(n,i,l,null,s)}}function Bf(n){return n=Ue(n),Uf(n)}var zc=null;function Uf(n){if(zc=null,n=pn(n),n!==null){var i=c(n);if(i===null)n=null;else{var s=i.tag;if(s===13){if(n=u(i),n!==null)return n;n=null}else if(s===31){if(n=d(i),n!==null)return n;n=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return zc=n,null}function xy(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ca()){case te:return 2;case ge:return 8;case Re:case Ge:return 32;case tt:return 268435456;default:return 32}default:return 32}}var Pf=!1,Oi=null,Ri=null,Mi=null,Io=new Map,Do=new Map,Ii=[],cw="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Ey(n,i){switch(n){case"focusin":case"focusout":Oi=null;break;case"dragenter":case"dragleave":Ri=null;break;case"mouseover":case"mouseout":Mi=null;break;case"pointerover":case"pointerout":Io.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Do.delete(i.pointerId)}}function Lo(n,i,s,l,f,g){return n===null||n.nativeEvent!==g?(n={blockedOn:i,domEventName:s,eventSystemFlags:l,nativeEvent:g,targetContainers:[f]},i!==null&&(i=Ir(i),i!==null&&yy(i)),n):(n.eventSystemFlags|=l,i=n.targetContainers,f!==null&&i.indexOf(f)===-1&&i.push(f),n)}function uw(n,i,s,l,f){switch(i){case"focusin":return Oi=Lo(Oi,n,i,s,l,f),!0;case"dragenter":return Ri=Lo(Ri,n,i,s,l,f),!0;case"mouseover":return Mi=Lo(Mi,n,i,s,l,f),!0;case"pointerover":var g=f.pointerId;return Io.set(g,Lo(Io.get(g)||null,n,i,s,l,f)),!0;case"gotpointercapture":return g=f.pointerId,Do.set(g,Lo(Do.get(g)||null,n,i,s,l,f)),!0}return!1}function Sy(n){var i=pn(n.target);if(i!==null){var s=c(i);if(s!==null){if(i=s.tag,i===13){if(i=u(s),i!==null){n.blockedOn=i,Ra(n.priority,function(){vy(s)});return}}else if(i===31){if(i=d(s),i!==null){n.blockedOn=i,Ra(n.priority,function(){vy(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){n.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Bc(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var s=Bf(n.nativeEvent);if(s===null){s=n.nativeEvent;var l=new s.constructor(s.type,s);we=l,s.target.dispatchEvent(l),we=null}else return i=Ir(s),i!==null&&yy(i),n.blockedOn=s,!1;i.shift()}return!0}function _y(n,i,s){Bc(n)&&s.delete(i)}function dw(){Pf=!1,Oi!==null&&Bc(Oi)&&(Oi=null),Ri!==null&&Bc(Ri)&&(Ri=null),Mi!==null&&Bc(Mi)&&(Mi=null),Io.forEach(_y),Do.forEach(_y)}function Uc(n,i){n.blockedOn===i&&(n.blockedOn=null,Pf||(Pf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,dw)))}var Pc=null;function wy(n){Pc!==n&&(Pc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Pc===n&&(Pc=null);for(var i=0;i<n.length;i+=3){var s=n[i],l=n[i+1],f=n[i+2];if(typeof l!="function"){if(Uf(l||s)===null)continue;break}var g=Ir(s);g!==null&&(n.splice(i,3),i-=3,zd(g,{pending:!0,data:f,method:s.method,action:l},l,f))}}))}function ds(n){function i(j){return Uc(j,n)}Oi!==null&&Uc(Oi,n),Ri!==null&&Uc(Ri,n),Mi!==null&&Uc(Mi,n),Io.forEach(i),Do.forEach(i);for(var s=0;s<Ii.length;s++){var l=Ii[s];l.blockedOn===n&&(l.blockedOn=null)}for(;0<Ii.length&&(s=Ii[0],s.blockedOn===null);)Sy(s),s.blockedOn===null&&Ii.shift();if(s=(n.ownerDocument||n).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var f=s[l],g=s[l+1],E=f[on]||null;if(typeof g=="function")E||wy(s);else if(E){var N=null;if(g&&g.hasAttribute("formAction")){if(f=g,E=g[on]||null)N=E.formAction;else if(Uf(f)!==null)continue}else N=E.action;typeof N=="function"?s[l+1]=N:(s.splice(l,3),l-=3),wy(s)}}}function ky(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(E){return f=E})},focusReset:"manual",scroll:"manual"})}function i(){f!==null&&(f(),f=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,f=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),f!==null&&(f(),f=null)}}}function Hf(n){this._internalRoot=n}Hc.prototype.render=Hf.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,l=Fn();gy(s,l,n,i,null,null)},Hc.prototype.unmount=Hf.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;gy(n.current,2,null,n,null,null),Ec(),i[oi]=null}};function Hc(n){this._internalRoot=n}Hc.prototype.unstable_scheduleHydration=function(n){if(n){var i=Oa();n={blockedOn:null,target:n,priority:i};for(var s=0;s<Ii.length&&i!==0&&i<Ii[s].priority;s++);Ii.splice(s,0,n),s===0&&Sy(n)}};var Ty=t.version;if(Ty!=="19.2.4")throw Error(a(527,Ty,"19.2.4"));Q.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=m(i),n=n!==null?b(n):null,n=n===null?null:n.stateNode,n};var fw={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fc.isDisabled&&Fc.supportsFiber)try{Zt=Fc.inject(fw),Mt=Fc}catch{}}return Bo.createRoot=function(n,i){if(!o(n))throw Error(a(299));var s=!1,l="",f=Ig,g=Dg,E=Lg;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(l=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(E=i.onRecoverableError)),i=py(n,1,!1,null,null,s,l,null,f,g,E,ky),n[oi]=i.current,Sf(n),new Hf(i)},Bo.hydrateRoot=function(n,i,s){if(!o(n))throw Error(a(299));var l=!1,f="",g=Ig,E=Dg,N=Lg,j=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(g=s.onUncaughtError),s.onCaughtError!==void 0&&(E=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(j=s.formState)),i=py(n,1,!0,i,s??null,l,f,j,g,E,N,ky),i.context=my(null),s=i.current,l=Fn(),l=Ct(l),f=yi(l),f.callback=null,vi(s,f,l),s=l,i.current.lanes=s,yt(i,s),Sr(i),n[oi]=i.current,Sf(n),new Hc(i)},Bo.version="19.2.4",Bo}var Hy;function Tw(){if(Hy)return Gf.exports;Hy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Gf.exports=kw(),Gf.exports}var Nw=Tw();const Cw=gl(Nw);/*! Capacitor: https://capacitorjs.com/ - MIT License */var Ms;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(Ms||(Ms={}));class Yf extends Error{constructor(t,r,a){super(t),this.message=t,this.code=r,this.data=a}}const Aw=e=>{var t,r;return e!=null&&e.androidBridge?"android":!((r=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||r===void 0)&&r.bridge?"ios":"web"},Ow=e=>{const t=e.CapacitorCustomPlatform||null,r=e.Capacitor||{},a=r.Plugins=r.Plugins||{},o=()=>t!==null?t.name:Aw(e),c=()=>o()!=="web",u=y=>{const v=m.get(y);return!!(v!=null&&v.platforms.has(o())||d(y))},d=y=>{var v;return(v=r.PluginHeaders)===null||v===void 0?void 0:v.find(x=>x.name===y)},h=y=>e.console.error(y),m=new Map,b=(y,v={})=>{const x=m.get(y);if(x)return console.warn(`Capacitor plugin "${y}" already registered. Cannot register plugins twice.`),x.proxy;const _=o(),S=d(y);let O;const k=async()=>(!O&&_ in v?O=typeof v[_]=="function"?O=await v[_]():O=v[_]:t!==null&&!O&&"web"in v&&(O=typeof v.web=="function"?O=await v.web():O=v.web),O),D=(V,ee)=>{var U,F;if(S){const Y=S==null?void 0:S.methods.find(ue=>ee===ue.name);if(Y)return Y.rtype==="promise"?ue=>r.nativePromise(y,ee.toString(),ue):(ue,ie)=>r.nativeCallback(y,ee.toString(),ue,ie);if(V)return(U=V[ee])===null||U===void 0?void 0:U.bind(V)}else{if(V)return(F=V[ee])===null||F===void 0?void 0:F.bind(V);throw new Yf(`"${y}" plugin is not implemented on ${_}`,Ms.Unimplemented)}},w=V=>{let ee;const U=(...F)=>{const Y=k().then(ue=>{const ie=D(ue,V);if(ie){const K=ie(...F);return ee=K==null?void 0:K.remove,K}else throw new Yf(`"${y}.${V}()" is not implemented on ${_}`,Ms.Unimplemented)});return V==="addListener"&&(Y.remove=async()=>ee()),Y};return U.toString=()=>`${V.toString()}() { [capacitor code] }`,Object.defineProperty(U,"name",{value:V,writable:!1,configurable:!1}),U},A=w("addListener"),L=w("removeListener"),M=(V,ee)=>{const U=A({eventName:V},ee),F=async()=>{const ue=await U;L({eventName:V,callbackId:ue},ee)},Y=new Promise(ue=>U.then(()=>ue({remove:F})));return Y.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await F()},Y},$=new Proxy({},{get(V,ee){switch(ee){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return S?M:A;case"removeListener":return L;default:return w(ee)}}});return a[y]=$,m.set(y,{name:y,proxy:$,platforms:new Set([...Object.keys(v),...S?[_]:[]])}),$};return r.convertFileSrc||(r.convertFileSrc=y=>y),r.getPlatform=o,r.handleError=h,r.isNativePlatform=c,r.isPluginAvailable=u,r.registerPlugin=b,r.Exception=Yf,r.DEBUG=!!r.DEBUG,r.isLoggingEnabled=!!r.isLoggingEnabled,r},Rw=e=>e.Capacitor=Ow(e),mr=Rw(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),up=mr.registerPlugin;class dp{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,r){let a=!1;this.listeners[t]||(this.listeners[t]=[],a=!0),this.listeners[t].push(r);const c=this.windowListeners[t];c&&!c.registered&&this.addWindowListener(c),a&&this.sendRetainedArgumentsForEvent(t);const u=async()=>this.removeListener(t,r);return Promise.resolve({remove:u})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,r,a){const o=this.listeners[t];if(!o){if(a){let c=this.retainedEventArguments[t];c||(c=[]),c.push(r),this.retainedEventArguments[t]=c}return}o.forEach(c=>c(r))}hasListeners(t){var r;return!!(!((r=this.listeners[t])===null||r===void 0)&&r.length)}registerWindowListener(t,r){this.windowListeners[r]={registered:!1,windowEventName:t,pluginEventName:r,handler:a=>{this.notifyListeners(r,a)}}}unimplemented(t="not implemented"){return new mr.Exception(t,Ms.Unimplemented)}unavailable(t="not available"){return new mr.Exception(t,Ms.Unavailable)}async removeListener(t,r){const a=this.listeners[t];if(!a)return;const o=a.indexOf(r);this.listeners[t].splice(o,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const r=this.retainedEventArguments[t];r&&(delete this.retainedEventArguments[t],r.forEach(a=>{this.notifyListeners(t,a)}))}}const Fy=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),$y=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Mw extends dp{async getCookies(){const t=document.cookie,r={};return t.split(";").forEach(a=>{if(a.length<=0)return;let[o,c]=a.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=$y(o).trim(),c=$y(c).trim(),r[o]=c}),r}async setCookie(t){try{const r=Fy(t.key),a=Fy(t.value),o=t.expires?`; expires=${t.expires.replace("expires=","")}`:"",c=(t.path||"/").replace("path=",""),u=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${r}=${a||""}${o}; path=${c}; ${u};`}catch(r){return Promise.reject(r)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const r of t)document.cookie=r.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}up("CapacitorCookies",{web:()=>new Mw});const Iw=async e=>new Promise((t,r)=>{const a=new FileReader;a.onload=()=>{const o=a.result;t(o.indexOf(",")>=0?o.split(",")[1]:o)},a.onerror=o=>r(o),a.readAsDataURL(e)}),Dw=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,c,u)=>(o[c]=e[t[u]],o),{})},Lw=(e,t=!0)=>e?Object.entries(e).reduce((a,o)=>{const[c,u]=o;let d,h;return Array.isArray(u)?(h="",u.forEach(m=>{d=t?encodeURIComponent(m):m,h+=`${c}=${d}&`}),h.slice(0,-1)):(d=t?encodeURIComponent(u):u,h=`${c}=${d}`),`${a}&${h}`},"").substr(1):null,jw=(e,t={})=>{const r=Object.assign({method:e.method||"GET",headers:e.headers},t),o=Dw(e.headers)["content-type"]||"";if(typeof e.data=="string")r.body=e.data;else if(o.includes("application/x-www-form-urlencoded")){const c=new URLSearchParams;for(const[u,d]of Object.entries(e.data||{}))c.set(u,d);r.body=c.toString()}else if(o.includes("multipart/form-data")||e.data instanceof FormData){const c=new FormData;if(e.data instanceof FormData)e.data.forEach((d,h)=>{c.append(h,d)});else for(const d of Object.keys(e.data))c.append(d,e.data[d]);r.body=c;const u=new Headers(r.headers);u.delete("content-type"),r.headers=u}else(o.includes("application/json")||typeof e.data=="object")&&(r.body=JSON.stringify(e.data));return r};class zw extends dp{async request(t){const r=jw(t,t.webFetchExtra),a=Lw(t.params,t.shouldEncodeUrlParams),o=a?`${t.url}?${a}`:t.url,c=await fetch(o,r),u=c.headers.get("content-type")||"";let{responseType:d="text"}=c.ok?t:{};u.includes("application/json")&&(d="json");let h,m;switch(d){case"arraybuffer":case"blob":m=await c.blob(),h=await Iw(m);break;case"json":h=await c.json();break;case"document":case"text":default:h=await c.text()}const b={};return c.headers.forEach((y,v)=>{b[v]=y}),{data:h,headers:b,status:c.status,url:c.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}up("CapacitorHttp",{web:()=>new zw});var Gy;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(Gy||(Gy={}));var Ky;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(Ky||(Ky={}));class Bw extends dp{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}up("SystemBars",{web:()=>new Bw});function Uw(e,t){const r=getComputedStyle(e),a=parseFloat(r.fontSize);return t*a}function Pw(e,t){const r=getComputedStyle(e.ownerDocument.body),a=parseFloat(r.fontSize);return t*a}function Hw(e){return e/100*window.innerHeight}function Fw(e){return e/100*window.innerWidth}function $w(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function $c({groupSize:e,panelElement:t,styleProp:r}){let a;const[o,c]=$w(r);switch(c){case"%":{a=o/100*e;break}case"px":{a=o;break}case"rem":{a=Pw(t,o);break}case"em":{a=Uw(t,o);break}case"vh":{a=Hw(o);break}case"vw":{a=Fw(o);break}}return a}function dr(e){return parseFloat(e.toFixed(3))}function Is({group:e}){const{orientation:t,panels:r}=e;return r.reduce((a,o)=>(a+=t==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,a),0)}function Dh(e){const{panels:t}=e,r=Is({group:e});return r===0?t.map(a=>({collapsedSize:0,collapsible:a.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:a.panelConstraints.disabled,minSize:0,maxSize:100,panelId:a.id})):t.map(a=>{const{element:o,panelConstraints:c}=a;let u=0;if(c.collapsedSize!==void 0){const b=$c({groupSize:r,panelElement:o,styleProp:c.collapsedSize});u=dr(b/r*100)}let d;if(c.defaultSize!==void 0){const b=$c({groupSize:r,panelElement:o,styleProp:c.defaultSize});d=dr(b/r*100)}let h=0;if(c.minSize!==void 0){const b=$c({groupSize:r,panelElement:o,styleProp:c.minSize});h=dr(b/r*100)}let m=100;if(c.maxSize!==void 0){const b=$c({groupSize:r,panelElement:o,styleProp:c.maxSize});m=dr(b/r*100)}return{collapsedSize:u,collapsible:c.collapsible===!0,defaultSize:d,disabled:c.disabled,minSize:h,maxSize:m,panelId:a.id}})}function ft(e,t="Assertion error"){if(!e)throw Error(t)}function Lh(e,t){return Array.from(t).sort(e==="horizontal"?Gw:Kw)}function Gw(e,t){const r=e.element.offsetLeft-t.element.offsetLeft;return r!==0?r:e.element.offsetWidth-t.element.offsetWidth}function Kw(e,t){const r=e.element.offsetTop-t.element.offsetTop;return r!==0?r:e.element.offsetHeight-t.element.offsetHeight}function tx(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function nx(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function qw({orientation:e,rects:t,targetRect:r}){const a={x:r.x+r.width/2,y:r.y+r.height/2};let o,c=Number.MAX_VALUE;for(const u of t){const{x:d,y:h}=nx(a,u),m=e==="horizontal"?d:h;m<c&&(c=m,o=u)}return ft(o,"No rect found"),o}let Gc;function Vw(){return Gc===void 0&&(typeof matchMedia=="function"?Gc=!!matchMedia("(pointer:coarse)").matches:Gc=!1),Gc}function rx(e){const{element:t,orientation:r,panels:a,separators:o}=e,c=Lh(r,Array.from(t.children).filter(tx).map(_=>({element:_}))).map(({element:_})=>_),u=[];let d=!1,h=!1,m=-1,b=-1,y=0,v,x=[];{let _=-1;for(const S of c)S.hasAttribute("data-panel")&&(_++,S.ariaDisabled===null&&(y++,m===-1&&(m=_),b=_))}if(y>1){let _=-1;for(const S of c)if(S.hasAttribute("data-panel")){_++;const O=a.find(k=>k.element===S);if(O){if(v){const k=v.element.getBoundingClientRect(),D=S.getBoundingClientRect();let w;if(h){const A=r==="horizontal"?new DOMRect(k.right,k.top,0,k.height):new DOMRect(k.left,k.bottom,k.width,0),L=r==="horizontal"?new DOMRect(D.left,D.top,0,D.height):new DOMRect(D.left,D.top,D.width,0);switch(x.length){case 0:{w=[A,L];break}case 1:{const M=x[0],$=qw({orientation:r,rects:[k,D],targetRect:M.element.getBoundingClientRect()});w=[M,$===k?L:A];break}default:{w=x;break}}}else x.length?w=x:w=[r==="horizontal"?new DOMRect(k.right,D.top,D.left-k.right,D.height):new DOMRect(D.left,k.bottom,D.width,D.top-k.bottom)];for(const A of w){let L="width"in A?A:A.element.getBoundingClientRect();const M=Vw()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(L.width<M){const V=M-L.width;L=new DOMRect(L.x-V/2,L.y,L.width+V,L.height)}if(L.height<M){const V=M-L.height;L=new DOMRect(L.x,L.y-V/2,L.width,L.height+V)}const $=_<=m||_>b;!d&&!$&&u.push({group:e,groupSize:Is({group:e}),panels:[v,O],separator:"width"in A?void 0:A,rect:L}),d=!1}}h=!1,v=O,x=[]}}else if(S.hasAttribute("data-separator")){S.ariaDisabled!==null&&(d=!0);const O=o.find(k=>k.element===S);O?x.push(O):(v=void 0,x=[])}else h=!0}return u}var Pi;class Yw{constructor(){Ay(this,Pi,{})}addListener(t,r){const a=jo(this,Pi)[t];return a===void 0?jo(this,Pi)[t]=[r]:a.includes(r)||a.push(r),()=>{this.removeListener(t,r)}}emit(t,r){const a=jo(this,Pi)[t];if(a!==void 0)if(a.length===1)a[0].call(null,r);else{let o=!1,c=null;const u=Array.from(a);for(let d=0;d<u.length;d++){const h=u[d];try{h.call(null,r)}catch(m){c===null&&(o=!0,c=m)}}if(o)throw c}}removeAllListeners(){Oy(this,Pi,{})}removeListener(t,r){const a=jo(this,Pi)[t];if(a!==void 0){const o=a.indexOf(r);o>=0&&a.splice(o,1)}}}Pi=new WeakMap;function bn(e,t,r=0){return Math.abs(dr(e)-dr(t))<=r}let nr={cursorFlags:0,interactionState:{state:"inactive"},mountedGroups:new Map};const ni=new Yw;function vn(){return nr}function xn(e){const t=typeof e=="function"?e(nr):e;if(nr===t)return nr;const r=nr;return nr={...nr,...t},t.cursorFlags!==void 0&&ni.emit("cursorFlagsChange",nr.cursorFlags),t.interactionState!==void 0&&ni.emit("interactionStateChange",nr.interactionState),t.mountedGroups!==void 0&&(nr.mountedGroups.forEach((a,o)=>{a.derivedPanelConstraints.forEach(c=>{if(c.collapsible){const{layout:u}=r.mountedGroups.get(o)??{};if(u){const d=bn(c.collapsedSize,a.layout[c.panelId]),h=bn(c.collapsedSize,u[c.panelId]);d&&!h&&(o.inMemoryLastExpandedPanelSizes[c.panelId]=u[c.panelId])}}})}),ni.emit("mountedGroupsChange",nr.mountedGroups)),nr}function Ww(e,t,r){let a,o={x:1/0,y:1/0};for(const c of t){const u=nx(r,c.rect);switch(e){case"horizontal":{u.x<=o.x&&(a=c,o=u);break}case"vertical":{u.y<=o.y&&(a=c,o=u);break}}}return a?{distance:o,hitRegion:a}:void 0}function Xw(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Zw(e,t){if(e===t)throw new Error("Cannot compare node with itself");const r={a:Yy(e),b:Yy(t)};let a;for(;r.a.at(-1)===r.b.at(-1);)a=r.a.pop(),r.b.pop();ft(a,"Stacking order can only be calculated for elements with a common ancestor");const o={a:Vy(qy(r.a)),b:Vy(qy(r.b))};if(o.a===o.b){const c=a.childNodes,u={a:r.a.at(-1),b:r.b.at(-1)};let d=c.length;for(;d--;){const h=c[d];if(h===u.a)return 1;if(h===u.b)return-1}}return Math.sign(o.a-o.b)}const Jw=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Qw(e){const t=getComputedStyle(ix(e)??e).display;return t==="flex"||t==="inline-flex"}function ek(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Qw(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Jw.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function qy(e){let t=e.length;for(;t--;){const r=e[t];if(ft(r,"Missing node"),ek(r))return r}return null}function Vy(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Yy(e){const t=[];for(;e;)t.push(e),e=ix(e);return t}function ix(e){const{parentNode:t}=e;return Xw(t)?t.host:t}function tk(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function nk({groupElement:e,hitRegion:t,pointerEventTarget:r}){if(!tx(r)||r.contains(e)||e.contains(r))return!0;if(Zw(r,e)>0){let a=r;for(;a;){if(a.contains(e))return!0;if(tk(a.getBoundingClientRect(),t))return!1;a=a.parentElement}}return!0}function fp(e,t){const r=[];return t.forEach((a,o)=>{if(o.disabled)return;const c=rx(o),u=Ww(o.orientation,c,{x:e.clientX,y:e.clientY});u&&u.distance.x<=0&&u.distance.y<=0&&nk({groupElement:o.element,hitRegion:u.hitRegion.rect,pointerEventTarget:e.target})&&r.push(u.hitRegion)}),r}function rk(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function kr(e,t){return bn(e,t)?0:e>t?1:-1}function Es({overrideDisabledPanels:e,panelConstraints:t,prevSize:r,size:a}){const{collapsedSize:o=0,collapsible:c,disabled:u,maxSize:d=100,minSize:h=0}=t;if(u&&!e)return r;if(kr(a,h)<0)if(c){const m=(o+h)/2;kr(a,m)<0?a=o:a=h}else a=h;return a=Math.min(d,a),a=dr(a),a}function sl({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:a,prevLayout:o,trigger:c}){if(bn(e,0))return t;const u=c==="imperative-api",d=Object.values(t),h=Object.values(o),m=[...d],[b,y]=a;ft(b!=null,"Invalid first pivot index"),ft(y!=null,"Invalid second pivot index");let v=0;switch(c){case"keyboard":{{const S=e<0?y:b,O=r[S];ft(O,`Panel constraints not found for index ${S}`);const{collapsedSize:k=0,collapsible:D,minSize:w=0}=O;if(D){const A=d[S];if(ft(A!=null,`Previous layout not found for panel index ${S}`),bn(A,k)){const L=w-A;kr(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}{const S=e<0?b:y,O=r[S];ft(O,`No panel constraints found for index ${S}`);const{collapsedSize:k=0,collapsible:D,minSize:w=0}=O;if(D){const A=d[S];if(ft(A!=null,`Previous layout not found for panel index ${S}`),bn(A,w)){const L=A-k;kr(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}break}default:{const S=e<0?y:b,O=r[S];ft(O,`Panel constraints not found for index ${S}`);const k=d[S],{collapsible:D,collapsedSize:w,minSize:A}=O;if(D&&kr(k,A)<0)if(e>0){const L=A-w,M=L/2,$=k+e;kr($,A)<0&&(e=kr(e,M)<=0?0:L)}else{const L=A-w,M=100-L/2,$=k-e;kr($,A)<0&&(e=kr(100+e,M)>0?0:-L)}break}}{const S=e<0?1:-1;let O=e<0?y:b,k=0;for(;;){const w=d[O];ft(w!=null,`Previous layout not found for panel index ${O}`);const A=Es({overrideDisabledPanels:u,panelConstraints:r[O],prevSize:w,size:100})-w;if(k+=A,O+=S,O<0||O>=r.length)break}const D=Math.min(Math.abs(e),Math.abs(k));e=e<0?0-D:D}{let S=e<0?b:y;for(;S>=0&&S<r.length;){const O=Math.abs(e)-Math.abs(v),k=d[S];ft(k!=null,`Previous layout not found for panel index ${S}`);const D=k-O,w=Es({overrideDisabledPanels:u,panelConstraints:r[S],prevSize:k,size:D});if(!bn(k,w)&&(v+=k-w,m[S]=w,v.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?S--:S++}}if(rk(h,m))return o;{const S=e<0?y:b,O=d[S];ft(O!=null,`Previous layout not found for panel index ${S}`);const k=O+v,D=Es({overrideDisabledPanels:u,panelConstraints:r[S],prevSize:O,size:k});if(m[S]=D,!bn(D,k)){let w=k-D,A=e<0?y:b;for(;A>=0&&A<r.length;){const L=m[A];ft(L!=null,`Previous layout not found for panel index ${A}`);const M=L+w,$=Es({overrideDisabledPanels:u,panelConstraints:r[A],prevSize:L,size:M});if(bn(L,$)||(w-=$-L,m[A]=$),bn(w,0))break;e>0?A--:A++}}}const x=Object.values(m).reduce((S,O)=>O+S,0);if(!bn(x,100,.1))return o;const _=Object.keys(o);return m.reduce((S,O,k)=>(S[_[k]]=O,S),{})}function xa(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(t[r]===void 0||kr(e[r],t[r])!==0)return!1;return!0}function Ea({layout:e,panelConstraints:t}){const r=Object.values(e),a=[...r],o=a.reduce((d,h)=>d+h,0);if(a.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${a.map(d=>`${d}%`).join(", ")}`);if(!bn(o,100)&&a.length>0)for(let d=0;d<t.length;d++){const h=a[d];ft(h!=null,`No layout data found for index ${d}`);const m=100/o*h;a[d]=m}let c=0;for(let d=0;d<t.length;d++){const h=r[d];ft(h!=null,`No layout data found for index ${d}`);const m=a[d];ft(m!=null,`No layout data found for index ${d}`);const b=Es({overrideDisabledPanels:!0,panelConstraints:t[d],prevSize:h,size:m});m!=b&&(c+=m-b,a[d]=b)}if(!bn(c,0))for(let d=0;d<t.length;d++){const h=a[d];ft(h!=null,`No layout data found for index ${d}`);const m=h+c,b=Es({overrideDisabledPanels:!0,panelConstraints:t[d],prevSize:h,size:m});if(h!==b&&(c-=b-h,a[d]=b,bn(c,0)))break}const u=Object.keys(e);return a.reduce((d,h,m)=>(d[u[m]]=h,d),{})}function ax({groupId:e,panelId:t}){const r=()=>{const{mountedGroups:d}=vn();for(const[h,{defaultLayoutDeferred:m,derivedPanelConstraints:b,layout:y,separatorToPanels:v}]of d)if(h.id===e)return{defaultLayoutDeferred:m,derivedPanelConstraints:b,group:h,layout:y,separatorToPanels:v};throw Error(`Group ${e} not found`)},a=()=>{const d=r().derivedPanelConstraints.find(h=>h.panelId===t);if(d!==void 0)return d;throw Error(`Panel constraints not found for Panel ${t}`)},o=()=>{const d=r().group.panels.find(h=>h.id===t);if(d!==void 0)return d;throw Error(`Layout not found for Panel ${t}`)},c=()=>{const d=r().layout[t];if(d!==void 0)return d;throw Error(`Layout not found for Panel ${t}`)},u=d=>{const h=c();if(d===h)return;const{defaultLayoutDeferred:m,derivedPanelConstraints:b,group:y,layout:v,separatorToPanels:x}=r(),_=y.panels.findIndex(D=>D.id===t),S=_===y.panels.length-1,O=sl({delta:S?h-d:d-h,initialLayout:v,panelConstraints:b,pivotIndices:S?[_-1,_]:[_,_+1],prevLayout:v,trigger:"imperative-api"}),k=Ea({layout:O,panelConstraints:b});xa(v,k)||xn(D=>({mountedGroups:new Map(D.mountedGroups).set(y,{defaultLayoutDeferred:m,derivedPanelConstraints:b,layout:k,separatorToPanels:x})}))};return{collapse:()=>{const{collapsible:d,collapsedSize:h}=a(),{mutableValues:m}=o(),b=c();d&&b!==h&&(m.expandToSize=b,u(h))},expand:()=>{const{collapsible:d,collapsedSize:h,minSize:m}=a(),{mutableValues:b}=o(),y=c();if(d&&y===h){let v=b.expandToSize??m;v===0&&(v=1),u(v)}},getSize:()=>{const{group:d}=r(),h=c(),{element:m}=o(),b=d.orientation==="horizontal"?m.offsetWidth:m.offsetHeight;return{asPercentage:h,inPixels:b}},isCollapsed:()=>{const{collapsible:d,collapsedSize:h}=a(),m=c();return d&&bn(h,m)},resize:d=>{if(c()!==d){let h;switch(typeof d){case"number":{const{group:m}=r(),b=Is({group:m});h=dr(d/b*100);break}case"string":{h=parseFloat(d);break}}u(h)}}}}function Wy(e){if(e.defaultPrevented)return;const{mountedGroups:t}=vn();fp(e,t).forEach(r=>{if(r.separator){const a=r.panels.find(o=>o.panelConstraints.defaultSize!==void 0);if(a){const o=a.panelConstraints.defaultSize,c=ax({groupId:r.group.id,panelId:a.id});c&&o!==void 0&&(c.resize(o),e.preventDefault())}}})}function su(e){const{mountedGroups:t}=vn();for(const[r]of t)if(r.separators.some(a=>a.element===e))return r;throw Error("Could not find parent Group for separator element")}function sx({groupId:e}){const t=()=>{const{mountedGroups:r}=vn();for(const[a,o]of r)if(a.id===e)return{group:a,...o};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:r,layout:a}=t();return r?{}:a},setLayout(r){const{defaultLayoutDeferred:a,derivedPanelConstraints:o,group:c,layout:u,separatorToPanels:d}=t(),h=Ea({layout:r,panelConstraints:o});if(a)return u;if(!xa(u,h)){xn(b=>({mountedGroups:new Map(b.mountedGroups).set(c,{defaultLayoutDeferred:a,derivedPanelConstraints:o,layout:h,separatorToPanels:d})}));const m=c.panels.map(({id:b})=>b).join(",");c.inMemoryLayouts[m]=h}return h}}}function ox(e){const{mountedGroups:t}=vn(),r=t.get(e);return ft(r,`Mounted Group ${e.id} not found`),r}function ha(e,t){const r=su(e),a=ox(r),o=r.separators.find(b=>b.element===e);ft(o,"Matching separator not found");const c=a.separatorToPanels.get(o);ft(c,"Matching panels not found");const u=c.map(b=>r.panels.indexOf(b)),d=sx({groupId:r.id}).getLayout(),h=sl({delta:t,initialLayout:d,panelConstraints:a.derivedPanelConstraints,pivotIndices:u,prevLayout:d,trigger:"keyboard"}),m=Ea({layout:h,panelConstraints:a.derivedPanelConstraints});xa(d,m)||xn(b=>({mountedGroups:new Map(b.mountedGroups).set(r,{defaultLayoutDeferred:a.defaultLayoutDeferred,derivedPanelConstraints:a.derivedPanelConstraints,layout:m,separatorToPanels:a.separatorToPanels})}))}function Xy(e){if(e.defaultPrevented)return;const t=e.currentTarget,r=su(t);if(!r.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),r.orientation==="vertical"&&ha(t,5);break}case"ArrowLeft":{e.preventDefault(),r.orientation==="horizontal"&&ha(t,-5);break}case"ArrowRight":{e.preventDefault(),r.orientation==="horizontal"&&ha(t,5);break}case"ArrowUp":{e.preventDefault(),r.orientation==="vertical"&&ha(t,-5);break}case"End":{e.preventDefault(),ha(t,100);break}case"Enter":{e.preventDefault();const a=su(t),{derivedPanelConstraints:o,layout:c,separatorToPanels:u}=ox(a),d=a.separators.find(y=>y.element===t);ft(d,"Matching separator not found");const h=u.get(d);ft(h,"Matching panels not found");const m=h[0],b=o.find(y=>y.panelId===m.id);if(ft(b,"Panel metadata not found"),b.collapsible){const y=c[m.id],v=b.collapsedSize===y?a.inMemoryLastExpandedPanelSizes[m.id]??b.minSize:b.collapsedSize;ha(t,v-y)}break}case"F6":{e.preventDefault();const a=su(t).separators.map(u=>u.element),o=Array.from(a).findIndex(u=>u===e.currentTarget);ft(o!==null,"Index not found");const c=e.shiftKey?o>0?o-1:a.length-1:o+1<a.length?o+1:0;a[c].focus();break}case"Home":{e.preventDefault(),ha(t,-100);break}}}function Zy(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const{mountedGroups:t}=vn(),r=fp(e,t),a=new Map;let o=!1;r.forEach(c=>{c.separator&&(o||(o=!0,c.separator.element.focus()));const u=t.get(c.group);u&&a.set(c.group,u.layout)}),xn({interactionState:{hitRegions:r,initialLayoutMap:a,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}}),r.length&&e.preventDefault()}const ik=e=>e,Wf=()=>{},lx=1,cx=2,ux=4,dx=8,Jy=3,Qy=12;let Kc;function ev(){return Kc===void 0&&(Kc=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Kc=!0)),Kc}function ak({cursorFlags:e,groups:t,state:r}){let a=0,o=0;switch(r){case"active":case"hover":t.forEach(c=>{if(!c.disableCursor)switch(c.orientation){case"horizontal":{a++;break}case"vertical":{o++;break}}})}if(!(a===0&&o===0)){switch(r){case"active":{if(e&&ev()){const c=(e&lx)!==0,u=(e&cx)!==0,d=(e&ux)!==0,h=(e&dx)!==0;if(c)return d?"se-resize":h?"ne-resize":"e-resize";if(u)return d?"sw-resize":h?"nw-resize":"w-resize";if(d)return"s-resize";if(h)return"n-resize"}break}}return ev()?a>0&&o>0?"move":a>0?"ew-resize":"ns-resize":a>0&&o>0?"grab":a>0?"col-resize":"row-resize"}}const tv=new WeakMap;function hp(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:r}=tv.get(e)??{};r===void 0&&(r=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets.push(r));const{cursorFlags:a,interactionState:o}=vn();switch(o.state){case"active":case"hover":{const c=ak({cursorFlags:a,groups:o.hitRegions.map(d=>d.group),state:o.state}),u=`*, *:hover {cursor: ${c} !important; ${o.state==="active"?"touch-action: none;":""} }`;if(t===u)return;t=u,c?r.cssRules.length===0?r.insertRule(u):r.replaceSync(u):r.cssRules.length===1&&r.deleteRule(0);break}case"inactive":{t=void 0,r.cssRules.length===1&&r.deleteRule(0);break}}tv.set(e,{prevStyle:t,styleSheet:r})}function fx({document:e,event:t,hitRegions:r,initialLayoutMap:a,mountedGroups:o,pointerDownAtPoint:c,prevCursorFlags:u}){let d=0;const h=new Map(o);r.forEach(b=>{const{group:y,groupSize:v}=b,{disableCursor:x,orientation:_,panels:S}=y;let O=0;c?_==="horizontal"?O=(t.clientX-c.x)/v*100:O=(t.clientY-c.y)/v*100:_==="horizontal"?O=t.clientX<0?-100:100:O=t.clientY<0?-100:100;const k=a.get(y),{defaultLayoutDeferred:D,derivedPanelConstraints:w,layout:A,separatorToPanels:L}=o.get(y)??{defaultLayoutDeferred:!1};if(w&&k&&A&&L){const M=sl({delta:O,initialLayout:k,panelConstraints:w,pivotIndices:b.panels.map($=>S.indexOf($)),prevLayout:A,trigger:"mouse-or-touch"});if(xa(M,A)){if(O!==0&&!x)switch(_){case"horizontal":{d|=O<0?lx:cx;break}case"vertical":{d|=O<0?ux:dx;break}}}else{h.set(b.group,{defaultLayoutDeferred:D,derivedPanelConstraints:w,layout:M,separatorToPanels:L});const $=b.group.panels.map(({id:V})=>V).join(",");b.group.inMemoryLayouts[$]=M}}});let m=0;t.movementX===0?m|=u&Jy:m|=d&Jy,t.movementY===0?m|=u&Qy:m|=d&Qy,xn({cursorFlags:m,mountedGroups:h}),hp(e)}function nv(e){const{cursorFlags:t,interactionState:r,mountedGroups:a}=vn();switch(r.state){case"active":fx({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:a,prevCursorFlags:t})}}function rv(e){if(e.defaultPrevented)return;const{cursorFlags:t,interactionState:r,mountedGroups:a}=vn();switch(r.state){case"active":{if(e.buttons===0){xn(o=>o.interactionState.state==="inactive"?o:{cursorFlags:0,interactionState:{state:"inactive"}}),xn(o=>({mountedGroups:new Map(o.mountedGroups)}));return}fx({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:a,pointerDownAtPoint:r.pointerDownAtPoint,prevCursorFlags:t});break}default:{const o=fp(e,a);o.length===0?r.state!=="inactive"&&xn({interactionState:{state:"inactive"}}):xn({interactionState:{hitRegions:o,state:"hover"}}),hp(e.currentTarget);break}}}function iv(e){if(e.relatedTarget instanceof HTMLIFrameElement){const{interactionState:t}=vn();switch(t.state){case"hover":xn({interactionState:{state:"inactive"}})}}}function av(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const{interactionState:t}=vn();switch(t.state){case"active":xn({cursorFlags:0,interactionState:{state:"inactive"}}),t.hitRegions.length>0&&(hp(e.currentTarget),xn(r=>({mountedGroups:new Map(r.mountedGroups)})),e.preventDefault())}}function sv(e){let t=0,r=0;const a={};for(const c of e)if(c.defaultSize!==void 0){t++;const u=dr(c.defaultSize);r+=u,a[c.panelId]=u}else a[c.panelId]=void 0;const o=e.length-t;if(o!==0){const c=dr((100-r)/o);for(const u of e)u.defaultSize===void 0&&(a[u.panelId]=c)}return a}function sk(e,t,r){if(!r[0])return;const a=e.panels.find(h=>h.element===t);if(!a||!a.onResize)return;const o=Is({group:e}),c=e.orientation==="horizontal"?a.element.offsetWidth:a.element.offsetHeight,u=a.mutableValues.prevSize,d={asPercentage:dr(c/o*100),inPixels:c};a.mutableValues.prevSize=d,a.onResize(d,a.id,u)}function ok(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function lk(e,t){const r=e.map(o=>o.id),a=Object.keys(t);if(r.length!==a.length)return!1;for(const o of r)if(!a.includes(o))return!1;return!0}const hs=new Map;function ck(e){let t=!0;ft(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const r=e.element.ownerDocument.defaultView.ResizeObserver,a=new Set,o=new Set,c=new r(_=>{for(const S of _){const{borderBoxSize:O,target:k}=S;if(k===e.element){if(t){if(Is({group:e})===0)return;xn(D=>{const w=D.mountedGroups.get(e);if(w){const A=Dh(e),L=w.defaultLayoutDeferred?sv(A):w.layout,M=Ea({layout:L,panelConstraints:A});return!w.defaultLayoutDeferred&&xa(L,M)&&ok(w.derivedPanelConstraints,A)?D:{mountedGroups:new Map(D.mountedGroups).set(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:A,layout:M,separatorToPanels:w.separatorToPanels})}}return D})}}else sk(e,k,O)}});c.observe(e.element),e.panels.forEach(_=>{ft(!a.has(_.id),`Panel ids must be unique; id "${_.id}" was used more than once`),a.add(_.id),_.onResize&&c.observe(_.element)});const u=Is({group:e}),d=Dh(e),h=e.panels.map(({id:_})=>_).join(",");let m=e.defaultLayout;m&&(lk(e.panels,m)||(m=void 0));const b=e.inMemoryLayouts[h]??m??sv(d),y=Ea({layout:b,panelConstraints:d}),v=rx(e),x=e.element.ownerDocument;return xn(_=>{const S=new Map;return hs.set(x,(hs.get(x)??0)+1),v.forEach(O=>{O.separator&&S.set(O.separator,O.panels)}),{mountedGroups:new Map(_.mountedGroups).set(e,{defaultLayoutDeferred:u===0,derivedPanelConstraints:d,layout:y,separatorToPanels:S})}}),e.separators.forEach(_=>{ft(!o.has(_.id),`Separator ids must be unique; id "${_.id}" was used more than once`),o.add(_.id),_.element.addEventListener("keydown",Xy)}),hs.get(x)===1&&(x.addEventListener("dblclick",Wy,!0),x.addEventListener("pointerdown",Zy,!0),x.addEventListener("pointerleave",nv),x.addEventListener("pointermove",rv),x.addEventListener("pointerout",iv),x.addEventListener("pointerup",av,!0)),function(){t=!1,hs.set(x,Math.max(0,(hs.get(x)??0)-1)),xn(_=>{const S=new Map(_.mountedGroups);return S.delete(e),{mountedGroups:S}}),e.separators.forEach(_=>{_.element.removeEventListener("keydown",Xy)}),hs.get(x)||(x.removeEventListener("dblclick",Wy,!0),x.removeEventListener("pointerdown",Zy,!0),x.removeEventListener("pointerleave",nv),x.removeEventListener("pointermove",rv),x.removeEventListener("pointerout",iv),x.removeEventListener("pointerup",av,!0)),c.disconnect()}}function uk(){const[e,t]=I.useState({}),r=I.useCallback(()=>t({}),[]);return[e,r]}function pp(e){const t=I.useId();return`${e??t}`}const wa=typeof window<"u"?I.useLayoutEffect:I.useEffect;function Wo(e){const t=I.useRef(e);return wa(()=>{t.current=e},[e]),I.useCallback((...r)=>{var a;return(a=t.current)==null?void 0:a.call(t,...r)},[t])}function mp(...e){return Wo(t=>{e.forEach(r=>{if(r)switch(typeof r){case"function":{r(t);break}case"object":{r.current=t;break}}})})}function gp(e){const t=I.useRef({...e});return wa(()=>{for(const r in e)t.current[r]=e[r]},[e]),t.current}const hx=I.createContext(null);function dk(e,t){const r=I.useRef({getLayout:()=>({}),setLayout:ik});I.useImperativeHandle(t,()=>r.current,[]),wa(()=>{Object.assign(r.current,sx({groupId:e}))})}function ol({children:e,className:t,defaultLayout:r,disableCursor:a,disabled:o,elementRef:c,groupRef:u,id:d,onLayoutChange:h,onLayoutChanged:m,orientation:b="horizontal",resizeTargetMinimumSize:y={coarse:20,fine:10},style:v,...x}){const _=I.useRef({onLayoutChange:{},onLayoutChanged:{}}),S=Wo(F=>{xa(_.current.onLayoutChange,F)||(_.current.onLayoutChange=F,h==null||h(F))}),O=Wo(F=>{xa(_.current.onLayoutChanged,F)||(_.current.onLayoutChanged=F,m==null||m(F))}),k=pp(d),D=I.useRef(null),[w,A]=uk(),L=I.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:y,separators:[]}),M=mp(D,c);dk(k,u);const $=Wo((F,Y)=>{const{interactionState:ue,mountedGroups:ie}=vn();for(const K of ie.keys())if(K.id===F){const B=ie.get(K);if(B){let Q=!1;switch(ue.state){case"active":{Q=ue.hitRegions.some(ae=>ae.group===K);break}}return{flexGrow:B.layout[Y]??1,pointerEvents:Q?"none":void 0}}}return{flexGrow:(r==null?void 0:r[Y])??1}}),V=gp({defaultLayout:r,disableCursor:a}),ee=I.useMemo(()=>({get disableCursor(){return!!V.disableCursor},getPanelStyles:$,id:k,orientation:b,registerPanel:F=>{const Y=L.current;return Y.panels=Lh(b,[...Y.panels,F]),A(),()=>{Y.panels=Y.panels.filter(ue=>ue!==F),A()}},registerSeparator:F=>{const Y=L.current;return Y.separators=Lh(b,[...Y.separators,F]),A(),()=>{Y.separators=Y.separators.filter(ue=>ue!==F),A()}},togglePanelDisabled:(F,Y)=>{const ue=L.current.panels.find(K=>K.id===F);ue&&(ue.panelConstraints.disabled=Y);const{mountedGroups:ie}=vn();for(const K of ie.keys())if(K.id===k){const B=ie.get(K);B&&(B.derivedPanelConstraints=Dh(K))}},toggleSeparatorDisabled:(F,Y)=>{const ue=L.current.separators.find(ie=>ie.id===F);ue&&(ue.disabled=Y)}}),[$,k,A,b,V]),U=I.useRef(null);return wa(()=>{const F=D.current;if(F===null)return;const Y=L.current;let ue;if(V.defaultLayout!==void 0&&Object.keys(V.defaultLayout).length===Y.panels.length){ue={};for(const P of Y.panels){const T=V.defaultLayout[P.id];T!==void 0&&(ue[P.id]=T)}}const ie={defaultLayout:ue,disableCursor:!!V.disableCursor,disabled:!!o,element:F,id:k,inMemoryLastExpandedPanelSizes:L.current.lastExpandedPanelSizes,inMemoryLayouts:L.current.layouts,orientation:b,panels:Y.panels,resizeTargetMinimumSize:Y.resizeTargetMinimumSize,separators:Y.separators};U.current=ie;const K=ck(ie),B=vn().mountedGroups.get(ie);if(B){const{defaultLayoutDeferred:P,derivedPanelConstraints:T,layout:R}=B;!P&&T.length>0&&(S(R),O(R))}const Q=ni.addListener("interactionStateChange",P=>{P.state}),ae=ni.addListener("mountedGroupsChange",P=>{const T=P.get(ie);if(T){const{defaultLayoutDeferred:R,derivedPanelConstraints:q,layout:C}=T;if(R||q.length===0)return;const{interactionState:de}=vn(),fe=de.state!=="active";S(C),fe&&O(C)}});return()=>{U.current=null,K(),Q(),ae()}},[o,k,O,S,b,w,V]),I.useEffect(()=>{const F=U.current;F&&(F.defaultLayout=r,F.disableCursor=!!a)}),p.jsx(hx.Provider,{value:ee,children:p.jsx("div",{...x,className:t,"data-group":!0,"data-testid":k,id:k,ref:M,style:{height:"100%",width:"100%",overflow:"hidden",...v,display:"flex",flexDirection:b==="horizontal"?"row":"column",flexWrap:"nowrap"},children:e})})}ol.displayName="Group";function Xf(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function hu({debounceSaveMs:e=100,panelIds:t,storage:r=localStorage,...a}){const o=t!==void 0,c="id"in a?a.id:a.groupId,u=Xf(c,t??[]),d=I.useSyncExternalStore(fk,()=>r.getItem(u),()=>r.getItem(u)),h=I.useMemo(()=>d?JSON.parse(d):void 0,[d]),m=I.useRef(null),b=I.useCallback(()=>{const x=m.current;x&&(m.current=null,clearTimeout(x))},[]);I.useLayoutEffect(()=>()=>{b()},[b]);const y=I.useCallback(x=>{b();let _;o?_=Xf(c,Object.keys(x)):_=Xf(c,[]);try{r.setItem(_,JSON.stringify(x))}catch(S){console.error(S)}},[b,o,c,r]),v=I.useCallback(x=>{b(),e===0?y(x):m.current=setTimeout(()=>{y(x)},e)},[b,e,y]);return{defaultLayout:h,onLayoutChange:v,onLayoutChanged:y}}function fk(){return function(){}}function bp(){const e=I.useContext(hx);return ft(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function hk(e,t){const{id:r}=bp(),a=I.useRef({collapse:Wf,expand:Wf,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Wf});I.useImperativeHandle(t,()=>a.current,[]),wa(()=>{Object.assign(a.current,ax({groupId:r,panelId:e}))})}function Tr({children:e,className:t,collapsedSize:r="0%",collapsible:a=!1,defaultSize:o,disabled:c,elementRef:u,id:d,maxSize:h="100%",minSize:m="0%",onResize:b,panelRef:y,style:v,...x}){const _=!!d,S=pp(d),O=gp({disabled:c}),k=I.useRef(null),D=mp(k,u),{getPanelStyles:w,id:A,registerPanel:L,togglePanelDisabled:M}=bp(),$=b!==null,V=Wo((U,F,Y)=>{b==null||b(U,d,Y)});wa(()=>{const U=k.current;if(U!==null){const F={element:U,id:S,idIsStable:_,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:$?V:void 0,panelConstraints:{collapsedSize:r,collapsible:a,defaultSize:o,disabled:O.disabled,maxSize:h,minSize:m}};return L(F)}},[r,a,o,$,S,_,h,m,V,L,O]),I.useEffect(()=>{M(S,!!c)},[c,S,M]),hk(S,y);const ee=I.useSyncExternalStore(U=>(ni.addListener("mountedGroupsChange",U),()=>{ni.removeListener("mountedGroupsChange",U)}),()=>JSON.stringify(w(A,S)),()=>JSON.stringify(w(A,S)));return p.jsx("div",{...x,"aria-disabled":c||void 0,"data-panel":!0,"data-testid":S,id:S,ref:D,style:{...pk,display:"flex",flexBasis:0,flexShrink:1,overflow:"hidden",...JSON.parse(ee)},children:p.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,...v},children:e})})}Tr.displayName="Panel";const pk={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function mk({layout:e,panelConstraints:t,panelId:r,panelIndex:a}){let o,c;const u=e[r],d=t.find(h=>h.panelId===r);if(d){const h=d.maxSize,m=d.collapsible?d.collapsedSize:d.minSize,b=[a,a+1];c=Ea({layout:sl({delta:m-u,initialLayout:e,panelConstraints:t,pivotIndices:b,prevLayout:e}),panelConstraints:t})[r],o=Ea({layout:sl({delta:h-u,initialLayout:e,panelConstraints:t,pivotIndices:b,prevLayout:e}),panelConstraints:t})[r]}return{valueControls:r,valueMax:o,valueMin:c,valueNow:u}}function px({children:e,className:t,disabled:r,elementRef:a,id:o,style:c,...u}){const d=pp(o),h=gp({disabled:r}),[m,b]=I.useState({}),[y,v]=I.useState("inactive"),x=I.useRef(null),_=mp(x,a),{disableCursor:S,id:O,orientation:k,registerSeparator:D,toggleSeparatorDisabled:w}=bp(),A=k==="horizontal"?"vertical":"horizontal";wa(()=>{const M=x.current;if(M!==null){const $={disabled:h.disabled,element:M,id:d},V=D($),ee=ni.addListener("interactionStateChange",F=>{v(F.state!=="inactive"&&F.hitRegions.some(Y=>Y.separator===$)?F.state:"inactive")}),U=ni.addListener("mountedGroupsChange",F=>{F.forEach(({derivedPanelConstraints:Y,layout:ue,separatorToPanels:ie},K)=>{if(K.id===O){const B=ie.get($);if(B){const Q=B[0],ae=K.panels.indexOf(Q);b(mk({layout:ue,panelConstraints:Y,panelId:Q.id,panelIndex:ae}))}}})});return()=>{ee(),U(),V()}}},[O,d,D,h]),I.useEffect(()=>{w(d,!!r)},[r,d,w]);let L;return r&&!S&&(L="not-allowed"),p.jsx("div",{...u,"aria-controls":m.valueControls,"aria-disabled":r||void 0,"aria-orientation":A,"aria-valuemax":m.valueMax,"aria-valuemin":m.valueMin,"aria-valuenow":m.valueNow,children:e,className:t,"data-separator":r?"disabled":y,"data-testid":d,id:d,ref:_,role:"separator",style:{flexBasis:"auto",cursor:L,...c,flexGrow:0,flexShrink:0},tabIndex:r?void 0:0})}px.displayName="Separator";const yp={user:null,activeView:"messages",agents:[],selectedAgentId:null,selectedSessionKey:null,channels:[],selectedChannelId:null,sessions:[],selectedSessionId:null,tasks:[],selectedTaskId:null,jobs:[],selectedJobId:null,messages:[],threadMessages:[],activeThreadId:null,threadReplyCounts:{},openclawConnected:!1,sessionModel:null,wsConnected:!1,models:[],defaultModel:null,streamingRunId:null,streamingSessionKey:null,streamingThreadId:null,cronTasks:[],selectedCronTaskId:null,cronJobs:[],selectedCronJobId:null};function gk(e,t){switch(t.type){case"SET_USER":return{...e,user:t.user};case"SET_ACTIVE_VIEW":return{...e,activeView:t.view};case"SET_AGENTS":return{...e,agents:t.agents};case"SELECT_AGENT":return{...e,selectedAgentId:t.agentId,selectedSessionKey:t.sessionKey,sessions:[],selectedSessionId:null,messages:[],jobs:[],selectedJobId:null,activeThreadId:null,threadMessages:[]};case"SET_CHANNELS":return{...e,channels:t.channels};case"SELECT_CHANNEL":return{...e,selectedChannelId:t.channelId,sessions:[],selectedSessionId:null,tasks:[],selectedTaskId:null,jobs:[],selectedJobId:null,messages:[]};case"SET_SESSIONS":return{...e,sessions:t.sessions};case"SELECT_SESSION":{const r=t.sessionKey??e.selectedSessionKey,a=r!==e.selectedSessionKey;return{...e,selectedSessionId:t.sessionId,selectedSessionKey:r,messages:a?[]:e.messages,activeThreadId:a?null:e.activeThreadId,threadMessages:a?[]:e.threadMessages}}case"ADD_SESSION":return{...e,sessions:[...e.sessions,t.session]};case"REMOVE_SESSION":return{...e,sessions:e.sessions.filter(r=>r.id!==t.sessionId),...e.selectedSessionId===t.sessionId?{selectedSessionId:null,selectedSessionKey:null,messages:[]}:{}};case"RENAME_SESSION":return{...e,sessions:e.sessions.map(r=>r.id===t.sessionId?{...r,name:t.name}:r)};case"SET_TASKS":return{...e,tasks:t.tasks};case"SELECT_TASK":{const r=t.sessionKey??e.selectedSessionKey,a=r!==e.selectedSessionKey;return{...e,selectedTaskId:t.taskId,selectedSessionKey:r,messages:a?[]:e.messages,jobs:[],selectedJobId:null}}case"SET_JOBS":return{...e,jobs:t.jobs};case"SELECT_JOB":return{...e,selectedJobId:t.jobId,selectedSessionKey:t.sessionKey??e.selectedSessionKey,messages:[]};case"ADD_JOB":return{...e,jobs:[t.job,...e.jobs]};case"ADD_MESSAGE":{const r=e.messages[e.messages.length-1];return t.message.sender==="agent"&&(r!=null&&r.isStreaming)?{...e,streamingRunId:null,streamingSessionKey:null,messages:[...e.messages.slice(0,-1),{...t.message,isStreaming:!1}]}:{...e,messages:[...e.messages,t.message]}}case"SET_MESSAGES":return{...e,messages:t.messages,...t.replyCounts?{threadReplyCounts:{...e.threadReplyCounts,...t.replyCounts}}:{}};case"OPEN_THREAD":return{...e,activeThreadId:t.threadId,threadMessages:t.messages,threadReplyCounts:{...e.threadReplyCounts,...t.messages.length>0?{[t.threadId]:t.messages.length}:{}}};case"CLOSE_THREAD":return{...e,activeThreadId:null,threadMessages:[]};case"ADD_THREAD_MESSAGE":{const r=t.message.threadId??e.activeThreadId,a=!!(r&&r===e.activeThreadId);let o=e.threadMessages,c={};if(a){const d=e.threadMessages[e.threadMessages.length-1];t.message.sender==="agent"&&(d!=null&&d.isStreaming)?(o=[...e.threadMessages.slice(0,-1),{...t.message,isStreaming:!1}],c={streamingRunId:null,streamingSessionKey:null,streamingThreadId:null}):o=[...e.threadMessages,t.message]}const u={...e.threadReplyCounts};return r&&(a?u[r]=o.length:u[r]=(u[r]??0)+1),{...e,...c,threadMessages:o,threadReplyCounts:u}}case"SET_OPENCLAW_CONNECTED":return{...e,openclawConnected:t.connected,defaultModel:e.defaultModel??t.defaultModel??null};case"SET_SESSION_MODEL":return{...e,sessionModel:t.model};case"SET_WS_CONNECTED":return{...e,wsConnected:t.connected};case"SET_MODELS":return{...e,models:t.models};case"SET_DEFAULT_MODEL":return{...e,defaultModel:t.model};case"RESOLVE_ACTION":return{...e,messages:e.messages.map(r=>r.id===t.messageId?{...r,resolvedActions:{...r.resolvedActions,[t.promptHash]:{value:t.value,label:t.label}}}:r)};case"STREAM_START":{const r={id:`stream_${t.runId}`,sender:"agent",text:"",timestamp:Date.now(),isStreaming:!0},a=!!t.threadId;return{...e,streamingRunId:t.runId,streamingSessionKey:t.sessionKey,streamingThreadId:t.threadId??null,...a?{threadMessages:[...e.threadMessages,r]}:{messages:[...e.messages,r]}}}case"STREAM_CHUNK":{if(e.streamingRunId!==t.runId)return e;const r=`stream_${t.runId}`;return e.streamingThreadId?{...e,threadMessages:e.threadMessages.map(a=>a.id===r?{...a,text:t.text}:a)}:{...e,messages:e.messages.map(a=>a.id===r?{...a,text:t.text}:a)}}case"STREAM_END":return e.streamingRunId&&e.streamingRunId!==t.runId?e:{...e,streamingRunId:null,streamingSessionKey:null,streamingThreadId:null};case"SET_CRON_TASKS":return{...e,cronTasks:t.cronTasks};case"MERGE_SCAN_DATA":{const r=new Map(t.scanTasks.map(c=>[c.cronJobId,c])),a=e.cronTasks.map(c=>{const u=c.openclawCronJobId?r.get(c.openclawCronJobId):null;return u?{...c,schedule:u.schedule||null,instructions:u.instructions||null,model:u.model||null,enabled:u.enabled}:c}),o=e.tasks.map(c=>{const u=c.openclawCronJobId?r.get(c.openclawCronJobId):null;return u?{...c,schedule:u.schedule||null,instructions:u.instructions||null,model:u.model||null,enabled:u.enabled}:c});return{...e,cronTasks:a,tasks:o}}case"UPDATE_CRON_TASK":return{...e,cronTasks:e.cronTasks.map(r=>r.id===t.taskId?{...r,...t.updates}:r),tasks:e.tasks.map(r=>r.id===t.taskId?{...r,...t.updates}:r)};case"SELECT_CRON_TASK":return e.selectedCronTaskId===t.taskId?e:{...e,selectedCronTaskId:t.taskId,cronJobs:[],selectedCronJobId:null,messages:[],selectedSessionKey:null};case"SET_CRON_JOBS":return{...e,cronJobs:t.cronJobs};case"SELECT_CRON_JOB":return{...e,selectedCronJobId:t.jobId,selectedSessionKey:t.sessionKey??e.selectedSessionKey,messages:[]};case"ADD_CRON_JOB":return{...e,cronJobs:[t.job,...e.cronJobs]};case"UPDATE_CRON_JOB":return e.cronJobs.some(a=>a.id===t.job.id)?{...e,cronJobs:e.cronJobs.map(a=>{var c;if(a.id!==t.job.id)return a;const o=a.summary&&a.summary.length>(((c=t.job.summary)==null?void 0:c.length)||0)?a.summary:t.job.summary;return{...a,...t.job,summary:o}})}:{...e,cronJobs:[t.job,...e.cronJobs]};case"APPEND_JOB_OUTPUT":{const r=a=>a.map(o=>o.id===t.jobId?{...o,summary:t.text}:o);return{...e,jobs:r(e.jobs),cronJobs:r(e.cronJobs)}}case"LOGOUT":return{...yp};default:return e}}const Ss=I.createContext(yp),Go=I.createContext(()=>{});function gr(){return I.useContext(Ss)}function ai(){return I.useContext(Go)}const ov=500;let bk=1;const _s=[],pu=new Set;function ps(e,t,r,a){const o={id:bk++,ts:Date.now(),level:e,tag:t,message:r,detail:a!==void 0?typeof a=="string"?a:JSON.stringify(a,null,2):void 0};_s.push(o),_s.length>ov&&_s.splice(0,_s.length-ov);for(const c of pu)c()}function yk(){return _s}function vk(){_s.length=0;for(const e of pu)e()}function xk(e){return pu.add(e),()=>pu.delete(e)}const ne={info:(e,t,r)=>ps("info",e,t,r),warn:(e,t,r)=>ps("warn",e,t,r),error:(e,t,r)=>ps("error",e,t,r),wsIn:(e,t,r)=>ps("ws-in",e,t,r),wsOut:(e,t,r)=>ps("ws-out",e,t,r),api:(e,t,r)=>ps("api",e,t,r)},Ek=mr.isNativePlatform()?"https://console.botschat.app":"",jh=`${Ek}/api`;let Xo=localStorage.getItem("botschat_token"),mu=localStorage.getItem("botschat_refresh_token");function ya(e){Xo=e,e?localStorage.setItem("botschat_token",e):localStorage.removeItem("botschat_token")}function ll(e){mu=e,e?localStorage.setItem("botschat_refresh_token",e):localStorage.removeItem("botschat_refresh_token")}function Zf(){return Xo}async function mx(){if(!mu)return!1;try{const e=await fetch(`${jh}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:mu})});if(!e.ok)return!1;const t=await e.json();return ya(t.token),ne.info("API","Access token refreshed successfully"),!0}catch{return!1}}async function st(e,t,r){const a=`${e} ${t}`;ne.api("API",`→ ${a}`,r);const o={"Content-Type":"application/json"};Xo&&(o.Authorization=`Bearer ${Xo}`);const c=performance.now();let u;try{u=await fetch(`${jh}${t}`,{method:e,headers:o,body:r?JSON.stringify(r):void 0,cache:"no-store"})}catch(m){const b=Math.round(performance.now()-c);throw ne.error("API",`✗ ${a} — network error (${b}ms)`,String(m)),m}if(u.status===401&&mu&&!t.includes("/auth/refresh")&&await mx()){o.Authorization=`Bearer ${Xo}`;try{u=await fetch(`${jh}${t}`,{method:e,headers:o,body:r?JSON.stringify(r):void 0,cache:"no-store"})}catch(b){const y=Math.round(performance.now()-c);throw ne.error("API",`✗ ${a} — network error on retry (${y}ms)`,String(b)),b}}const d=Math.round(performance.now()-c);if(!u.ok){const b=(await u.json().catch(()=>({error:u.statusText}))).error??`HTTP ${u.status}`;throw ne.error("API",`✗ ${a} — ${u.status} (${d}ms): ${b}`),new Error(b)}const h=await u.json();return ne.api("API",`✓ ${a} — ${u.status} (${d}ms)`,h),h}const zh={config:()=>st("GET","/auth/config"),register:(e,t,r)=>st("POST","/auth/register",{email:e,password:t,displayName:r}),login:(e,t)=>st("POST","/auth/login",{email:e,password:t}),firebase:e=>st("POST","/auth/firebase",{idToken:e}),me:()=>st("GET","/me")},Sk={updateSettings:e=>st("PATCH","/me",e)},_k={list:()=>st("GET","/models")},ks={list:()=>st("GET","/agents")},ir={list:()=>st("GET","/channels"),get:e=>st("GET",`/channels/${e}`),create:e=>st("POST","/channels",e),update:(e,t)=>st("PATCH",`/channels/${e}`,t),delete:e=>st("DELETE",`/channels/${e}`)},ws={list:e=>st("GET",`/channels/${e}/sessions`),create:(e,t)=>st("POST",`/channels/${e}/sessions`,{name:t}),rename:(e,t,r)=>st("PATCH",`/channels/${e}/sessions/${t}`,{name:r}),delete:(e,t)=>st("DELETE",`/channels/${e}/sessions/${t}`)},Mn={list:e=>st("GET",`/channels/${e}/tasks`),listAll:(e="background")=>st("GET",`/tasks?kind=${e}`),scanData:()=>st("GET","/task-scan"),create:(e,t)=>st("POST",`/channels/${e}/tasks`,t),update:(e,t,r)=>st("PATCH",`/channels/${e}/tasks/${t}`,r),delete:(e,t)=>st("DELETE",`/channels/${e}/tasks/${t}`),run:(e,t)=>st("POST",`/channels/${e}/tasks/${t}/run`)},Bh={list:(e,t)=>st("GET",`/channels/${e}/tasks/${t}/jobs`),listByTask:e=>st("GET",`/tasks/${e}/jobs`)},gx={list:(e,t,r)=>st("GET",`/messages/${e}?sessionKey=${encodeURIComponent(t)}${r?`&threadId=${encodeURIComponent(r)}`:""}`)},Ko={list:()=>st("GET","/pairing-tokens"),create:e=>st("POST","/pairing-tokens",{label:e}),delete:e=>st("DELETE",`/pairing-tokens/${e}`)},bx={cloudUrl:()=>st("GET","/setup/cloud-url")};function Au({value:e,onChange:t,models:r,disabled:a,placeholder:o="Select model...",compact:c}){const d=!r.find(S=>S.id===e)&&e?r.find(S=>S.name===e):null,h=d?d.id:e,m=!h||r.some(S=>S.id===h);I.useEffect(()=>{d&&e!==d.id&&t(d.id)},[d,e,t]);const b=I.useRef(null),[y,v]=I.useState(void 0),x=h||o,_=I.useCallback(()=>{if(!c||!b.current)return;const S=getComputedStyle(b.current),k=document.createElement("canvas").getContext("2d");if(!k)return;k.font=`${S.fontSize} ${S.fontFamily}`;const D=k.measureText(x).width,w=parseFloat(S.paddingLeft)||6,A=parseFloat(S.paddingRight)||6;v(Math.ceil(D)+w+A+22)},[c,x]);return I.useEffect(()=>{_()},[_]),p.jsxs("select",{ref:b,value:h,onChange:S=>t(S.target.value),disabled:a,className:`rounded-sm focus:outline-none ${c?"text-caption py-0.5 px-1.5":"text-body py-1.5 px-2.5"}`,style:{background:c?"transparent":"var(--bg-hover)",color:h?"var(--text-primary)":"var(--text-muted)",border:c?"1px solid transparent":"1px solid var(--border)",cursor:a?"not-allowed":"pointer",opacity:a?.5:1,width:c&&y?y:void 0,maxWidth:"100%",fontFamily:"var(--font-mono)",textOverflow:"ellipsis",overflow:"hidden"},children:[!h&&p.jsx("option",{value:"",children:o}),h&&!m&&p.jsx("option",{value:h,children:h}),r.map(S=>p.jsx("option",{value:S.id,children:S.id},S.id))]})}var ex;const Bs=typeof globalThis.process<"u"&&typeof((ex=globalThis.process.versions)==null?void 0:ex.node)=="string",yx=31e4,vx=32,xx=16,Ex="botschat-e2e:";function cl(e){return new TextEncoder().encode(e)}function wk(e){return new TextDecoder().decode(e)}async function kk(e,t){const r=cl(e),a=cl(Ex+t),o=await crypto.subtle.importKey("raw",r.buffer,"PBKDF2",!1,["deriveBits"]),c=new ArrayBuffer(a.byteLength);new Uint8Array(c).set(a);const u=await crypto.subtle.deriveBits({name:"PBKDF2",salt:c,iterations:yx,hash:"SHA-256"},o,vx*8);return new Uint8Array(u)}async function Sx(e,t){const r=await crypto.subtle.importKey("raw",e.buffer,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),a=cl("nonce-"+t),o=new Uint8Array(a.length+1);o.set(a),o[a.length]=1;const c=await crypto.subtle.sign("HMAC",r,o.buffer);return new Uint8Array(c).slice(0,xx)}async function _x(e,t,r){const a=await Sx(e,r),o=await crypto.subtle.importKey("raw",e.buffer,{name:"AES-CTR"},!1,["encrypt"]),c=await crypto.subtle.encrypt({name:"AES-CTR",counter:new Uint8Array(a).buffer,length:128},o,t.buffer);return new Uint8Array(c)}async function wx(e,t,r){const a=await Sx(e,r),o=await crypto.subtle.importKey("raw",e.buffer,{name:"AES-CTR"},!1,["decrypt"]),c=await crypto.subtle.decrypt({name:"AES-CTR",counter:new Uint8Array(a).buffer,length:128},o,t.buffer);return new Uint8Array(c)}let Hi=null,Zo=null;const Jo=globalThis;Bs&&Jo.__e2e_nodeCrypto&&(Hi=Jo.__e2e_nodeCrypto,Zo=Jo.__e2e_nodeUtil);async function Ou(){Hi&&Zo||(Hi=await Rs(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]),Zo=await Rs(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]),Jo.__e2e_nodeCrypto=Hi,Jo.__e2e_nodeUtil=Zo)}async function Tk(e,t){await Ou();const r=Zo.promisify(Hi.pbkdf2),a=Ex+t,o=await r(e,a,yx,vx,"sha256");return new Uint8Array(o)}async function kx(e,t){await Ou();const r=cl("nonce-"+t),a=new Uint8Array(r.length+1);a.set(r),a[r.length]=1;const o=Hi.createHmac("sha256",Buffer.from(e));o.update(Buffer.from(a));const c=o.digest();return new Uint8Array(c.buffer,c.byteOffset,xx)}async function Tx(e,t,r){await Ou();const a=await kx(e,r),o=Hi.createCipheriv("aes-256-ctr",Buffer.from(e),Buffer.from(a)),c=Buffer.concat([o.update(Buffer.from(t)),o.final()]);return new Uint8Array(c)}async function Nx(e,t,r){await Ou();const a=await kx(e,r),o=Hi.createDecipheriv("aes-256-ctr",Buffer.from(e),Buffer.from(a)),c=Buffer.concat([o.update(Buffer.from(t)),o.final()]);return new Uint8Array(c)}async function Nk(e,t){return Bs?Tk(e,t):kk(e,t)}async function Ck(e,t,r){const a=cl(t);return Bs?Tx(e,a,r):_x(e,a,r)}async function lv(e,t,r){const a=Bs?await Nx(e,t,r):await wx(e,t,r);return wk(a)}async function Ak(e,t,r){return Bs?Tx(e,t,r):_x(e,t,r)}async function Ok(e,t,r){return Bs?await Nx(e,t,r):await wx(e,t,r)}function cv(e){if(typeof Buffer<"u")return Buffer.from(e).toString("base64");let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Uh(e){if(typeof Buffer<"u"){const a=Buffer.from(e,"base64");return new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}const t=atob(e),r=new Uint8Array(t.length);for(let a=0;a<t.length;a++)r[a]=t.charCodeAt(a);return r}const ma="botschat_e2e_pwd_cache",qo="botschat_e2e_key_cache";let rn=null,Vo=null;const Jf=new Set;try{const e=localStorage.getItem(qo);e&&(rn=Uh(e),Vo=localStorage.getItem(ma))}catch{}const it={subscribe(e){return Jf.add(e),()=>Jf.delete(e)},notify(){Jf.forEach(e=>e())},async setPassword(e,t,r){if(!e){rn=null,Vo=null,localStorage.removeItem(ma),localStorage.removeItem(qo),this.notify();return}try{rn=await Nk(e,t),Vo=e,r?(localStorage.setItem(ma,e),localStorage.setItem(qo,cv(rn))):(localStorage.removeItem(ma),localStorage.removeItem(qo)),this.notify()}catch(a){throw console.error("Failed to derive E2E key:",a),a}},clear(){rn=null,Vo=null,localStorage.removeItem(ma),localStorage.removeItem(qo),this.notify()},hasKey(){return!!rn},hasSavedPassword(){return!!localStorage.getItem(ma)},async loadSavedPassword(e){if(rn)return!0;const t=localStorage.getItem(ma);if(!t)return!1;try{return await this.setPassword(t,e,!0),!0}catch{return!1}},async encrypt(e,t){if(!rn)throw new Error("E2E key not set");const r=t||crypto.randomUUID(),a=await Ck(rn,e,r);return{ciphertext:cv(a),messageId:r}},async decrypt(e,t){if(!rn)throw new Error("E2E key not set");const r=Uh(e);return lv(rn,r,t)},getPassword(){return Vo},async encryptMedia(e,t){if(!rn)throw new Error("E2E key not set");const r=t||crypto.randomUUID();return{encrypted:await Ak(rn,e,r),contextId:r}},async decryptMedia(e,t){if(!rn)throw new Error("E2E key not set");return Ok(rn,e,t)},async decryptBytesLegacy(e,t){if(!rn)throw new Error("E2E key not set");const r=Uh(e),a=await lv(rn,r,t);return new TextEncoder().encode(a)}};class Rk{constructor(t){fs(this,"ws",null);fs(this,"reconnectTimer",null);fs(this,"backoffMs",1e3);fs(this,"intentionalClose",!1);fs(this,"_connected",!1);this.opts=t}get connected(){return this._connected}connect(){this.intentionalClose=!1;let t;mr.isNativePlatform()?t=`wss://console.botschat.app/api/ws/${this.opts.userId}/${this.opts.sessionId}`:t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws/${this.opts.userId}/${this.opts.sessionId}`,ne.info("WS",`Connecting to ${t}`),this.ws=new WebSocket(t),this.ws.onopen=()=>{var a;ne.info("WS","Socket opened, sending auth");const r=this.opts.getToken();if(!r){ne.error("WS","No access token available, closing"),(a=this.ws)==null||a.close();return}this.ws.send(JSON.stringify({type:"auth",token:r}))},this.ws.onmessage=async r=>{try{const a=JSON.parse(r.data);if(console.log(`[E2E-WS] msg.type=${a.type} encrypted=${a.encrypted} hasKey=${it.hasKey()} messageId=${a.messageId}`),a.encrypted&&it.hasKey())try{if(a.type==="agent.text"||a.type==="agent.media"){const o=a.text,c=a.caption,u=a.messageId;o&&u&&(a.text=await it.decrypt(o,u),a.encrypted=!1),c&&u&&(a.caption=await it.decrypt(c,u),a.encrypted=!1)}else if(a.type==="job.update"){const o=a.summary,c=a.jobId;o&&c&&(a.summary=await it.decrypt(o,c),a.encrypted=!1)}}catch(o){ne.warn("E2E","Decryption failed",o),a.decryptionError=!0}if(a.type==="task.scan.result"&&Array.isArray(a.tasks)&&it.hasKey()){for(const o of a.tasks)if(o.encrypted&&o.iv)try{o.schedule&&(o.schedule=await it.decrypt(o.schedule,o.iv)),o.instructions&&(o.instructions=await it.decrypt(o.instructions,o.iv)),o.encrypted=!1}catch(c){ne.warn("E2E",`Task decryption failed for ${o.cronJobId}`,c),o.decryptionError=!0}}if(a.type==="auth.ok"){ne.info("WS","Auth OK — connected");const o=a.userId;if(console.log(`[E2E-WS] auth.ok userId=${o}, hasSavedPwd=${it.hasSavedPassword()}`),o&&it.hasSavedPassword()){const c=await it.loadSavedPassword(o);console.log(`[E2E-WS] loadSavedPassword result=${c}, hasKey=${it.hasKey()}`)}this.backoffMs=1e3,this._connected=!0,this.opts.onStatusChange(!0)}else this.opts.onMessage(a)}catch(a){ne.warn("WS","Failed to process incoming message",a)}},this.ws.onclose=r=>{if(this._connected=!1,this.opts.onStatusChange(!1),this.intentionalClose)ne.info("WS","Connection closed (intentional)");else{const a=r.code===4001;ne.warn("WS",`Connection closed (code=${r.code}), reconnecting in ${this.backoffMs}ms${a?" (will refresh token)":""}`),this.reconnectTimer=setTimeout(async()=>{this.backoffMs=Math.min(this.backoffMs*2,3e4),a&&(ne.info("WS","Refreshing access token before reconnect..."),await mx()?(ne.info("WS","Token refreshed, reconnecting"),this.backoffMs=1e3):ne.error("WS","Token refresh failed — will retry on next cycle")),this.connect()},this.backoffMs)}},this.ws.onerror=()=>{ne.error("WS","WebSocket error (close event will follow)")}}async send(t){var r,a;if(((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN){if(t.type==="user.message"&&it.hasKey()&&typeof t.text=="string")try{const o=t.messageId||void 0,{ciphertext:c,messageId:u}=await it.encrypt(t.text,o);t.text=c,o||(t.messageId=u),t.encrypted=!0}catch(o){ne.error("E2E","Encryption failed",o);return}this.ws.send(JSON.stringify(t))}else ne.warn("WS",`Cannot send — socket not open (readyState=${(a=this.ws)==null?void 0:a.readyState})`,t)}disconnect(){var t;this.intentionalClose=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(t=this.ws)==null||t.close(),this.ws=null,this._connected=!1,this.opts.onStatusChange(!1)}}function Mk({onToggleTheme:e,onOpenSettings:t,theme:r}){var b,y,v,x,_,S,O,k,D,w;const a=gr(),o=ai(),[c,u]=al.useState(!1),d=()=>{var A;ne.info("Auth",`Logout — user ${(A=a.user)==null?void 0:A.email}`),ya(null),ll(null),o({type:"LOGOUT"})},h=A=>{ne.info("Nav",`Switch view → ${A}`),o({type:"SET_ACTIVE_VIEW",view:A})},m=((v=(y=(b=a.user)==null?void 0:b.displayName)==null?void 0:y[0])==null?void 0:v.toUpperCase())??((S=(_=(x=a.user)==null?void 0:x.email)==null?void 0:_[0])==null?void 0:S.toUpperCase())??"?";return p.jsxs("div",{className:"flex flex-col items-center py-3 gap-2 h-full",style:{width:48,background:"var(--bg-primary)",borderRight:"1px solid var(--border)"},children:[p.jsx("button",{className:"w-8 h-8 rounded-lg flex items-center justify-center overflow-hidden hover:rounded-xl transition-all",title:"BotsChat",children:p.jsx("img",{src:"/botschat-logo.png",alt:"BotsChat",className:`w-8 h-8 ${r==="dark"?"invert":""}`})}),p.jsx("div",{className:"w-7 border-t my-1",style:{borderColor:"var(--sidebar-divider)"}}),p.jsx(qc,{label:"Messages",active:a.activeView==="messages",onClick:()=>h("messages"),icon:p.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334a2.126 2.126 0 00-.476-.095 48.64 48.64 0 00-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})})}),p.jsx(qc,{label:"Automations",active:a.activeView==="automations",onClick:()=>h("automations"),icon:p.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})})}),p.jsx("div",{className:"flex-1"}),p.jsx(qc,{label:"Settings",active:!1,onClick:t,icon:p.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),p.jsx(qc,{label:r==="dark"?"Light mode":"Dark mode",active:!1,onClick:e,icon:r==="dark"?p.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"})}):p.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"})})}),p.jsxs("div",{className:"relative",children:[p.jsx("button",{onClick:()=>u(!c),className:"w-6 h-6 rounded flex items-center justify-center text-[10px] font-bold text-white mt-1 cursor-pointer",style:{background:"#9B59B6"},title:((O=a.user)==null?void 0:O.displayName)??((k=a.user)==null?void 0:k.email)??"User",children:m}),c&&p.jsx("div",{className:"fixed inset-0 z-50",onClick:()=>u(!1),children:p.jsxs("div",{className:"absolute rounded-lg py-1 min-w-[200px]",style:{bottom:12,left:56,background:"var(--bg-surface)",border:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},onClick:A=>A.stopPropagation(),children:[p.jsxs("div",{className:"px-4 py-2.5",style:{borderBottom:"1px solid var(--border)"},children:[p.jsx("div",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:((D=a.user)==null?void 0:D.displayName)??"User"}),p.jsx("div",{className:"text-caption",style:{color:"var(--text-muted)"},children:(w=a.user)==null?void 0:w.email})]}),p.jsxs("button",{className:"w-full text-left px-4 py-2.5 text-body flex items-center gap-2.5",style:{color:"var(--accent-red)"},onClick:()=>{d(),u(!1)},onMouseEnter:A=>{A.currentTarget.style.background="var(--sidebar-hover)"},onMouseLeave:A=>{A.currentTarget.style.background=""},children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})}),"Logout"]})]})})]})]})}function qc({label:e,active:t,icon:r,onClick:a}){return p.jsxs("div",{className:"relative flex items-center justify-center",children:[t&&p.jsx("div",{className:"absolute left-0 w-[3px] h-5 rounded-r-sm",style:{left:-4,background:"var(--text-sidebar-active)"}}),p.jsx("button",{onClick:a,className:`w-8 h-8 rounded-lg flex items-center justify-center transition-colors ${t?"text-[--text-sidebar-active]":"text-[--text-sidebar] hover:text-[--text-sidebar-active]"}`,style:t?{background:"var(--sidebar-hover)"}:void 0,onMouseEnter:o=>{t||(o.currentTarget.style.background="var(--sidebar-hover)")},onMouseLeave:o=>{t||(o.currentTarget.style.background="")},title:e,"aria-label":e,children:r})]})}function Cx({onOpenSettings:e,onNavigate:t}={}){const r=gr(),a=ai(),[o,c]=I.useState(!1),[u,d]=I.useState(""),[h,m]=I.useState(""),[b,y]=I.useState(!0),v=async()=>{if(u.trim()){ne.info("Channel",`Creating channel: "${u}"${h?` (${h})`:""}`);try{await ir.create({name:u,description:h});const{agents:w}=await ks.list(),{channels:A}=await ir.list();a({type:"SET_AGENTS",agents:w}),a({type:"SET_CHANNELS",channels:A});const L=w.find(M=>M.name===u.trim());if(L){ne.info("Channel",`Channel created → agent ${L.id}, auto-selected`),a({type:"SELECT_AGENT",agentId:L.id,sessionKey:L.sessionKey});try{localStorage.setItem("botschat_last_agent",L.id)}catch{}t==null||t()}c(!1),d(""),m("")}catch(w){ne.error("Channel",`Failed to create channel: ${w}`)}}},[x,_]=I.useState(null),S=(w,A)=>{if(r.activeView!=="messages"&&a({type:"SET_ACTIVE_VIEW",view:"messages"}),r.selectedAgentId===w){t==null||t();return}const L=r.agents.find(M=>M.id===w);ne.info("Channel",`Selected channel: ${(L==null?void 0:L.name)??w} (session=${A})`),a({type:"SELECT_AGENT",agentId:w,sessionKey:A}),t==null||t();try{localStorage.setItem("botschat_last_agent",w)}catch{}},O=async w=>{const A=r.channels.find(L=>L.id===w);ne.info("Channel",`Deleting channel: ${(A==null?void 0:A.name)??w}`);try{await ir.delete(w),ne.info("Channel",`Channel deleted: ${(A==null?void 0:A.name)??w}`);const L=r.agents.find(V=>V.channelId===w);L&&r.selectedAgentId===L.id&&a({type:"SELECT_AGENT",agentId:null,sessionKey:null});const{agents:M}=await ks.list(),{channels:$}=await ir.list();a({type:"SET_AGENTS",agents:M}),a({type:"SET_CHANNELS",channels:$})}catch(L){ne.error("Channel",`Failed to delete channel: ${L}`)}finally{_(null)}},k=r.agents.filter(w=>w.isDefault),D=r.agents.filter(w=>!w.isDefault&&w.name!=="Default");return p.jsxs("div",{className:"flex flex-col",style:{background:"var(--bg-secondary)"},children:[p.jsxs("div",{className:"px-4 py-3 flex items-center gap-2",children:[p.jsx("span",{className:"text-[--text-sidebar-active] font-bold text-h2 truncate flex-1",children:"BotsChat"}),e&&p.jsx("button",{onClick:e,className:"p-1 rounded transition-colors hover:bg-[--sidebar-hover]",style:{color:"var(--text-sidebar)"},title:"Settings",children:p.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),p.jsx("svg",{className:"w-3 h-3 text-[--text-sidebar]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),p.jsx("div",{className:"px-4 pb-2",children:p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:r.openclawConnected?"var(--accent-green)":"var(--accent-red)"}}),p.jsx("span",{className:"text-tiny text-[--text-muted]",children:r.openclawConnected?"OpenClaw connected":"OpenClaw offline"})]})}),p.jsxs("div",{className:"flex-1 overflow-y-auto sidebar-scroll",children:[p.jsx(Ik,{label:"Channels",expanded:b,onToggle:()=>y(!b),onAdd:w=>{w.stopPropagation(),b||y(!0),c(!o)}}),b&&p.jsxs("div",{children:[k.map(w=>p.jsx(uv,{label:`# ${w.name}`,active:r.selectedAgentId===w.id,onClick:()=>S(w.id,w.sessionKey)},w.id)),D.map(w=>p.jsx(uv,{label:`# ${w.name}`,active:r.selectedAgentId===w.id,onClick:()=>S(w.id,w.sessionKey),showDelete:!0,confirmDelete:x===w.channelId,onDeleteClick:A=>{A.stopPropagation(),_(w.channelId)},onDeleteConfirm:A=>{A.stopPropagation(),w.channelId&&O(w.channelId)},onDeleteCancel:A=>{A.stopPropagation(),_(null)}},w.id)),D.length===0&&k.length===0&&p.jsx("div",{className:"px-8 py-2 text-tiny text-[--text-muted]",children:"Loading channels…"}),o&&p.jsxs("div",{className:"px-4 py-2 space-y-2",children:[p.jsx("input",{type:"text",placeholder:"Channel name",value:u,onChange:w=>d(w.target.value),onKeyDown:w=>w.key==="Enter"&&!w.nativeEvent.isComposing&&v(),className:"w-full px-2 py-1.5 text-caption text-[--text-sidebar] rounded-sm focus:outline-none placeholder:text-[--text-muted]",style:{background:"var(--sidebar-hover)",border:"1px solid var(--sidebar-border)"},autoFocus:!0}),p.jsx("input",{type:"text",placeholder:"Description (optional)",value:h,onChange:w=>m(w.target.value),onKeyDown:w=>w.key==="Enter"&&!w.nativeEvent.isComposing&&v(),className:"w-full px-2 py-1.5 text-caption text-[--text-sidebar] rounded-sm focus:outline-none placeholder:text-[--text-muted]",style:{background:"var(--sidebar-hover)",border:"1px solid var(--sidebar-border)"}}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("button",{onClick:v,className:"flex-1 px-3 py-1.5 text-caption bg-[--bg-active] text-white rounded-sm font-bold hover:brightness-110",children:"Create"}),p.jsx("button",{onClick:()=>c(!1),className:"px-3 py-1.5 text-caption text-[--text-muted] hover:text-[--text-sidebar]",children:"Cancel"})]})]})]})]})]})}function Ik({label:e,expanded:t,onToggle:r,onAdd:a}){return p.jsxs("div",{className:"w-full flex items-center px-4 py-1.5",children:[p.jsxs("button",{onClick:r,className:"flex items-center gap-1 text-tiny uppercase tracking-wider text-[--text-sidebar] hover:text-[--text-sidebar-active] transition-colors",children:[p.jsx("svg",{className:`w-3 h-3 transition-transform ${t?"rotate-0":"-rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})}),e]}),a&&p.jsx("button",{onClick:a,className:"ml-auto p-0.5 rounded transition-colors text-[--text-sidebar] hover:text-[--text-sidebar-active] hover:bg-[--sidebar-hover]",title:`New ${e.toLowerCase().replace(/s$/,"")}`,children:p.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})})})]})}function uv({label:e,active:t,onClick:r,showDelete:a,confirmDelete:o,onDeleteClick:c,onDeleteConfirm:u,onDeleteCancel:d}){const[h,m]=I.useState(!1),b=I.useRef(null);return I.useEffect(()=>{if(!o)return;const y=v=>{b.current&&!b.current.contains(v.target)&&(d==null||d(v))};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[o,d]),o?p.jsxs("div",{ref:b,className:"px-4 py-1.5 flex items-center gap-1.5",style:{paddingLeft:32,background:"var(--sidebar-hover)"},children:[p.jsx("span",{className:"text-caption text-[--text-sidebar] truncate flex-1",children:"Delete?"}),p.jsx("button",{onClick:u,className:"px-1.5 py-0.5 text-tiny rounded-sm font-bold text-white",style:{background:"var(--accent-red, #e53935)"},children:"Yes"}),p.jsx("button",{onClick:d,className:"px-1.5 py-0.5 text-tiny rounded-sm text-[--text-muted] hover:text-[--text-sidebar]",children:"No"})]}):p.jsxs("div",{className:"relative group",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),children:[p.jsx("button",{onClick:r,className:"w-full text-left py-[5px] text-body truncate transition-colors",onMouseEnter:y=>{t||(y.currentTarget.style.background="var(--sidebar-hover)")},onMouseLeave:y=>{t||(y.currentTarget.style.background=t?"var(--bg-hover)":"")},style:{paddingLeft:t?29:32,paddingRight:a?28:void 0,background:t?"var(--bg-hover)":void 0,borderLeft:t?"3px solid var(--bg-active)":"3px solid transparent",color:t?"var(--text-sidebar-active)":"var(--text-sidebar)",fontWeight:t?700:void 0},children:e}),a&&h&&p.jsx("button",{onClick:c,className:"absolute right-2 top-1/2 -translate-y-1/2 w-5 h-5 flex items-center justify-center rounded-sm text-[--text-muted] hover:text-[--accent-red] hover:bg-[--sidebar-hover] transition-colors",title:"Delete channel",children:p.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})}function Dk(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Lk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zk={};function dv(e,t){return(zk.jsx?jk:Lk).test(e)}const Bk=/[ \t\n\f\r]/g;function Uk(e){return typeof e=="object"?e.type==="text"?fv(e.value):!1:fv(e)}function fv(e){return e.replace(Bk,"")===""}class bl{constructor(t,r,a){this.normal=r,this.property=t,a&&(this.space=a)}}bl.prototype.normal={};bl.prototype.property={};bl.prototype.space=void 0;function Ax(e,t){const r={},a={};for(const o of e)Object.assign(r,o.property),Object.assign(a,o.normal);return new bl(r,a,t)}function Ph(e){return e.toLowerCase()}class In{constructor(t,r){this.attribute=r,this.property=t}}In.prototype.attribute="";In.prototype.booleanish=!1;In.prototype.boolean=!1;In.prototype.commaOrSpaceSeparated=!1;In.prototype.commaSeparated=!1;In.prototype.defined=!1;In.prototype.mustUseProperty=!1;In.prototype.number=!1;In.prototype.overloadedBoolean=!1;In.prototype.property="";In.prototype.spaceSeparated=!1;In.prototype.space=void 0;let Pk=0;const Fe=ka(),qt=ka(),Hh=ka(),me=ka(),_t=ka(),Ts=ka(),$n=ka();function ka(){return 2**++Pk}const Fh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Fe,booleanish:qt,commaOrSpaceSeparated:$n,commaSeparated:Ts,number:me,overloadedBoolean:Hh,spaceSeparated:_t},Symbol.toStringTag,{value:"Module"})),Qf=Object.keys(Fh);class vp extends In{constructor(t,r,a,o){let c=-1;if(super(t,r),hv(this,"space",o),typeof a=="number")for(;++c<Qf.length;){const u=Qf[c];hv(this,Qf[c],(a&Fh[u])===Fh[u])}}}vp.prototype.defined=!0;function hv(e,t,r){r&&(e[t]=r)}function Us(e){const t={},r={};for(const[a,o]of Object.entries(e.properties)){const c=new vp(a,e.transform(e.attributes||{},a),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(c.mustUseProperty=!0),t[a]=c,r[Ph(a)]=a,r[Ph(c.attribute)]=a}return new bl(t,r,e.space)}const Ox=Us({properties:{ariaActiveDescendant:null,ariaAtomic:qt,ariaAutoComplete:null,ariaBusy:qt,ariaChecked:qt,ariaColCount:me,ariaColIndex:me,ariaColSpan:me,ariaControls:_t,ariaCurrent:null,ariaDescribedBy:_t,ariaDetails:null,ariaDisabled:qt,ariaDropEffect:_t,ariaErrorMessage:null,ariaExpanded:qt,ariaFlowTo:_t,ariaGrabbed:qt,ariaHasPopup:null,ariaHidden:qt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_t,ariaLevel:me,ariaLive:null,ariaModal:qt,ariaMultiLine:qt,ariaMultiSelectable:qt,ariaOrientation:null,ariaOwns:_t,ariaPlaceholder:null,ariaPosInSet:me,ariaPressed:qt,ariaReadOnly:qt,ariaRelevant:null,ariaRequired:qt,ariaRoleDescription:_t,ariaRowCount:me,ariaRowIndex:me,ariaRowSpan:me,ariaSelected:qt,ariaSetSize:me,ariaSort:null,ariaValueMax:me,ariaValueMin:me,ariaValueNow:me,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Rx(e,t){return t in e?e[t]:t}function Mx(e,t){return Rx(e,t.toLowerCase())}const Hk=Us({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ts,acceptCharset:_t,accessKey:_t,action:null,allow:null,allowFullScreen:Fe,allowPaymentRequest:Fe,allowUserMedia:Fe,alt:null,as:null,async:Fe,autoCapitalize:null,autoComplete:_t,autoFocus:Fe,autoPlay:Fe,blocking:_t,capture:null,charSet:null,checked:Fe,cite:null,className:_t,cols:me,colSpan:null,content:null,contentEditable:qt,controls:Fe,controlsList:_t,coords:me|Ts,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Fe,defer:Fe,dir:null,dirName:null,disabled:Fe,download:Hh,draggable:qt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Fe,formTarget:null,headers:_t,height:me,hidden:Hh,high:me,href:null,hrefLang:null,htmlFor:_t,httpEquiv:_t,id:null,imageSizes:null,imageSrcSet:null,inert:Fe,inputMode:null,integrity:null,is:null,isMap:Fe,itemId:null,itemProp:_t,itemRef:_t,itemScope:Fe,itemType:_t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Fe,low:me,manifest:null,max:null,maxLength:me,media:null,method:null,min:null,minLength:me,multiple:Fe,muted:Fe,name:null,nonce:null,noModule:Fe,noValidate:Fe,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:Fe,optimum:me,pattern:null,ping:_t,placeholder:null,playsInline:Fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Fe,referrerPolicy:null,rel:_t,required:Fe,reversed:Fe,rows:me,rowSpan:me,sandbox:_t,scope:null,scoped:Fe,seamless:Fe,selected:Fe,shadowRootClonable:Fe,shadowRootDelegatesFocus:Fe,shadowRootMode:null,shape:null,size:me,sizes:null,slot:null,span:me,spellCheck:qt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:me,step:null,style:null,tabIndex:me,target:null,title:null,translate:null,type:null,typeMustMatch:Fe,useMap:null,value:qt,width:me,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_t,axis:null,background:null,bgColor:null,border:me,borderColor:null,bottomMargin:me,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Fe,declare:Fe,event:null,face:null,frame:null,frameBorder:null,hSpace:me,leftMargin:me,link:null,longDesc:null,lowSrc:null,marginHeight:me,marginWidth:me,noResize:Fe,noHref:Fe,noShade:Fe,noWrap:Fe,object:null,profile:null,prompt:null,rev:null,rightMargin:me,rules:null,scheme:null,scrolling:qt,standby:null,summary:null,text:null,topMargin:me,valueType:null,version:null,vAlign:null,vLink:null,vSpace:me,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Fe,disableRemotePlayback:Fe,prefix:null,property:null,results:me,security:null,unselectable:null},space:"html",transform:Mx}),Fk=Us({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:$n,accentHeight:me,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:me,amplitude:me,arabicForm:null,ascent:me,attributeName:null,attributeType:null,azimuth:me,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:me,by:null,calcMode:null,capHeight:me,className:_t,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:me,diffuseConstant:me,direction:null,display:null,dur:null,divisor:me,dominantBaseline:null,download:Fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:me,enableBackground:null,end:null,event:null,exponent:me,externalResourcesRequired:null,fill:null,fillOpacity:me,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:Ts,g2:Ts,glyphName:Ts,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:me,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:me,horizOriginX:me,horizOriginY:me,id:null,ideographic:me,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:me,k:me,k1:me,k2:me,k3:me,k4:me,kernelMatrix:$n,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:me,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:me,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:me,overlineThickness:me,paintOrder:null,panose1:null,path:null,pathLength:me,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:me,pointsAtY:me,pointsAtZ:me,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:$n,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:$n,rev:$n,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:$n,requiredFeatures:$n,requiredFonts:$n,requiredFormats:$n,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:me,specularExponent:me,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:me,strikethroughThickness:me,string:null,stroke:null,strokeDashArray:$n,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:me,strokeOpacity:me,strokeWidth:null,style:null,surfaceScale:me,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:$n,tabIndex:me,tableValues:null,target:null,targetX:me,targetY:me,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:$n,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:me,underlineThickness:me,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:me,values:null,vAlphabetic:me,vMathematical:me,vectorEffect:null,vHanging:me,vIdeographic:me,version:null,vertAdvY:me,vertOriginX:me,vertOriginY:me,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:me,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Rx}),Ix=Us({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Dx=Us({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Mx}),Lx=Us({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),$k={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"},Gk=/[A-Z]/g,pv=/-[a-z]/g,Kk=/^data[-\w.:]+$/i;function qk(e,t){const r=Ph(t);let a=t,o=In;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&Kk.test(t)){if(t.charAt(4)==="-"){const c=t.slice(5).replace(pv,Yk);a="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=t.slice(4);if(!pv.test(c)){let u=c.replace(Gk,Vk);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}o=vp}return new o(a,t)}function Vk(e){return"-"+e.toLowerCase()}function Yk(e){return e.charAt(1).toUpperCase()}const Wk=Ax([Ox,Hk,Ix,Dx,Lx],"html"),xp=Ax([Ox,Fk,Ix,Dx,Lx],"svg");function Xk(e){return e.join(" ").trim()}var ms={},eh,mv;function Zk(){if(mv)return eh;mv=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,d=/^\s+|\s+$/g,h=`
|
|
50
|
-
`,m="/",b="*",y="",v="comment",x="declaration";function _(O,k){if(typeof O!="string")throw new TypeError("First argument must be a string");if(!O)return[];k=k||{};var D=1,w=1;function A(ie){var K=ie.match(t);K&&(D+=K.length);var B=ie.lastIndexOf(h);w=~B?ie.length-B:w+ie.length}function L(){var ie={line:D,column:w};return function(K){return K.position=new M(ie),ee(),K}}function M(ie){this.start=ie,this.end={line:D,column:w},this.source=k.source}M.prototype.content=O;function $(ie){var K=new Error(k.source+":"+D+":"+w+": "+ie);if(K.reason=ie,K.filename=k.source,K.line=D,K.column=w,K.source=O,!k.silent)throw K}function V(ie){var K=ie.exec(O);if(K){var B=K[0];return A(B),O=O.slice(B.length),K}}function ee(){V(r)}function U(ie){var K;for(ie=ie||[];K=F();)K!==!1&&ie.push(K);return ie}function F(){var ie=L();if(!(m!=O.charAt(0)||b!=O.charAt(1))){for(var K=2;y!=O.charAt(K)&&(b!=O.charAt(K)||m!=O.charAt(K+1));)++K;if(K+=2,y===O.charAt(K-1))return $("End of comment missing");var B=O.slice(2,K-2);return w+=2,A(B),O=O.slice(K),w+=2,ie({type:v,comment:B})}}function Y(){var ie=L(),K=V(a);if(K){if(F(),!V(o))return $("property missing ':'");var B=V(c),Q=ie({type:x,property:S(K[0].replace(e,y)),value:B?S(B[0].replace(e,y)):y});return V(u),Q}}function ue(){var ie=[];U(ie);for(var K;K=Y();)K!==!1&&(ie.push(K),U(ie));return ie}return ee(),ue()}function S(O){return O?O.replace(d,y):y}return eh=_,eh}var gv;function Jk(){if(gv)return ms;gv=1;var e=ms&&ms.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(ms,"__esModule",{value:!0}),ms.default=r;const t=e(Zk());function r(a,o){let c=null;if(!a||typeof a!="string")return c;const u=(0,t.default)(a),d=typeof o=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:b}=h;d?o(m,b,h):b&&(c=c||{},c[m]=b)}),c}return ms}var Uo={},bv;function Qk(){if(bv)return Uo;bv=1,Object.defineProperty(Uo,"__esModule",{value:!0}),Uo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,c=function(m){return!m||r.test(m)||e.test(m)},u=function(m,b){return b.toUpperCase()},d=function(m,b){return"".concat(b,"-")},h=function(m,b){return b===void 0&&(b={}),c(m)?m:(m=m.toLowerCase(),b.reactCompat?m=m.replace(o,d):m=m.replace(a,d),m.replace(t,u))};return Uo.camelCase=h,Uo}var Po,yv;function e2(){if(yv)return Po;yv=1;var e=Po&&Po.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(Jk()),r=Qk();function a(o,c){var u={};return!o||typeof o!="string"||(0,t.default)(o,function(d,h){d&&h&&(u[(0,r.camelCase)(d,c)]=h)}),u}return a.default=a,Po=a,Po}var t2=e2();const n2=gl(t2),jx=zx("end"),Ep=zx("start");function zx(e){return t;function t(r){const a=r&&r.position&&r.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function r2(e){const t=Ep(e),r=jx(e);if(t&&r)return{start:t,end:r}}function Qo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?vv(e.position):"start"in e||"end"in e?vv(e):"line"in e||"column"in e?$h(e):""}function $h(e){return xv(e&&e.line)+":"+xv(e&&e.column)}function vv(e){return $h(e&&e.start)+"-"+$h(e&&e.end)}function xv(e){return e&&typeof e=="number"?e:1}class dn extends Error{constructor(t,r,a){super(),typeof r=="string"&&(a=r,r=void 0);let o="",c={},u=!1;if(r&&("line"in r&&"column"in r?c={place:r}:"start"in r&&"end"in r?c={place:r}:"type"in r?c={ancestors:[r],place:r.position}:c={...r}),typeof t=="string"?o=t:!c.cause&&t&&(u=!0,o=t.message,c.cause=t),!c.ruleId&&!c.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?c.ruleId=a:(c.source=a.slice(0,h),c.ruleId=a.slice(h+1))}if(!c.place&&c.ancestors&&c.ancestors){const h=c.ancestors[c.ancestors.length-1];h&&(c.place=h.position)}const d=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=d?d.line:void 0,this.name=Qo(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=u&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}dn.prototype.file="";dn.prototype.name="";dn.prototype.reason="";dn.prototype.message="";dn.prototype.stack="";dn.prototype.column=void 0;dn.prototype.line=void 0;dn.prototype.ancestors=void 0;dn.prototype.cause=void 0;dn.prototype.fatal=void 0;dn.prototype.place=void 0;dn.prototype.ruleId=void 0;dn.prototype.source=void 0;const Sp={}.hasOwnProperty,i2=new Map,a2=/[A-Z]/g,s2=new Set(["table","tbody","thead","tfoot","tr"]),o2=new Set(["td","th"]),Bx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function l2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=g2(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=m2(r,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?xp:Wk,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},c=Ux(o,e,void 0);return c&&typeof c!="string"?c:o.create(e,o.Fragment,{children:c||void 0},void 0)}function Ux(e,t,r){if(t.type==="element")return c2(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return u2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return f2(e,t,r);if(t.type==="mdxjsEsm")return d2(e,t);if(t.type==="root")return h2(e,t,r);if(t.type==="text")return p2(e,t)}function c2(e,t,r){const a=e.schema;let o=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=xp,e.schema=o),e.ancestors.push(t);const c=Hx(e,t.tagName,!1),u=b2(e,t);let d=wp(e,t);return s2.has(t.tagName)&&(d=d.filter(function(h){return typeof h=="string"?!Uk(h):!0})),Px(e,u,c,t),_p(u,d),e.ancestors.pop(),e.schema=a,e.create(t,c,u,r)}function u2(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}ul(e,t.position)}function d2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ul(e,t.position)}function f2(e,t,r){const a=e.schema;let o=a;t.name==="svg"&&a.space==="html"&&(o=xp,e.schema=o),e.ancestors.push(t);const c=t.name===null?e.Fragment:Hx(e,t.name,!0),u=y2(e,t),d=wp(e,t);return Px(e,u,c,t),_p(u,d),e.ancestors.pop(),e.schema=a,e.create(t,c,u,r)}function h2(e,t,r){const a={};return _p(a,wp(e,t)),e.create(t,e.Fragment,a,r)}function p2(e,t){return t.value}function Px(e,t,r,a){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=a)}function _p(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function m2(e,t,r){return a;function a(o,c,u,d){const m=Array.isArray(u.children)?r:t;return d?m(c,u,d):m(c,u)}}function g2(e,t){return r;function r(a,o,c,u){const d=Array.isArray(c.children),h=Ep(a);return t(o,c,u,d,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function b2(e,t){const r={};let a,o;for(o in t.properties)if(o!=="children"&&Sp.call(t.properties,o)){const c=v2(e,o,t.properties[o]);if(c){const[u,d]=c;e.tableCellAlignToStyle&&u==="align"&&typeof d=="string"&&o2.has(t.tagName)?a=d:r[u]=d}}if(a){const c=r.style||(r.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return r}function y2(e,t){const r={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const c=a.data.estree.body[0];c.type;const u=c.expression;u.type;const d=u.properties[0];d.type,Object.assign(r,e.evaluater.evaluateExpression(d.argument))}else ul(e,t.position);else{const o=a.name;let c;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,c=e.evaluater.evaluateExpression(d.expression)}else ul(e,t.position);else c=a.value===null?!0:a.value;r[o]=c}return r}function wp(e,t){const r=[];let a=-1;const o=e.passKeys?new Map:i2;for(;++a<t.children.length;){const c=t.children[a];let u;if(e.passKeys){const h=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(h){const m=o.get(h)||0;u=h+"-"+m,o.set(h,m+1)}}const d=Ux(e,c,u);d!==void 0&&r.push(d)}return r}function v2(e,t,r){const a=qk(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=a.commaSeparated?Dk(r):Xk(r)),a.property==="style"){let o=typeof r=="object"?r:x2(e,String(r));return e.stylePropertyNameCase==="css"&&(o=E2(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&a.space?$k[a.property]||a.property:a.attribute,r]}}function x2(e,t){try{return n2(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const a=r,o=new dn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Bx+"#cannot-parse-style-attribute",o}}function Hx(e,t,r){let a;if(!r)a={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let c=-1,u;for(;++c<o.length;){const d=dv(o[c])?{type:"Identifier",name:o[c]}:{type:"Literal",value:o[c]};u=u?{type:"MemberExpression",object:u,property:d,computed:!!(c&&d.type==="Literal"),optional:!1}:d}a=u}else a=dv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const o=a.value;return Sp.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(a);ul(e)}function ul(e,t){const r=new dn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Bx+"#cannot-handle-mdx-estrees-without-createevaluater",r}function E2(e){const t={};let r;for(r in e)Sp.call(e,r)&&(t[S2(r)]=e[r]);return t}function S2(e){let t=e.replace(a2,_2);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function _2(e){return"-"+e.toLowerCase()}const th={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"]},w2={};function kp(e,t){const r=w2,a=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Fx(e,a,o)}function Fx(e,t,r){if(k2(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ev(e.children,t,r)}return Array.isArray(e)?Ev(e,t,r):""}function Ev(e,t,r){const a=[];let o=-1;for(;++o<e.length;)a[o]=Fx(e[o],t,r);return a.join("")}function k2(e){return!!(e&&typeof e=="object")}const Sv=document.createElement("i");function Tp(e){const t="&"+e+";";Sv.innerHTML=t;const r=Sv.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function Kn(e,t,r,a){const o=e.length;let c=0,u;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,r=r>0?r:0,a.length<1e4)u=Array.from(a),u.unshift(t,r),e.splice(...u);else for(r&&e.splice(t,r);c<a.length;)u=a.slice(c,c+1e4),u.unshift(t,0),e.splice(...u),c+=1e4,t+=1e4}function rr(e,t){return e.length>0?(Kn(e,e.length,0,t),e):t}const _v={}.hasOwnProperty;function $x(e){const t={};let r=-1;for(;++r<e.length;)T2(t,e[r]);return t}function T2(e,t){let r;for(r in t){const o=(_v.call(e,r)?e[r]:void 0)||(e[r]={}),c=t[r];let u;if(c)for(u in c){_v.call(o,u)||(o[u]=[]);const d=c[u];N2(o[u],Array.isArray(d)?d:d?[d]:[])}}}function N2(e,t){let r=-1;const a=[];for(;++r<t.length;)(t[r].add==="after"?e:a).push(t[r]);Kn(e,0,0,a)}function Gx(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function hr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yn=Gi(/[A-Za-z]/),un=Gi(/[\dA-Za-z]/),C2=Gi(/[#-'*+\--9=?A-Z^-~]/);function gu(e){return e!==null&&(e<32||e===127)}const Gh=Gi(/\d/),A2=Gi(/[\dA-Fa-f]/),O2=Gi(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function Et(e){return e!==null&&(e<0||e===32)}function Ye(e){return e===-2||e===-1||e===32}const Ru=Gi(new RegExp("\\p{P}|\\p{S}","u")),Sa=Gi(/\s/);function Gi(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Ps(e){const t=[];let r=-1,a=0,o=0;for(;++r<e.length;){const c=e.charCodeAt(r);let u="";if(c===37&&un(e.charCodeAt(r+1))&&un(e.charCodeAt(r+2)))o=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(u=String.fromCharCode(c));else if(c>55295&&c<57344){const d=e.charCodeAt(r+1);c<56320&&d>56319&&d<57344?(u=String.fromCharCode(c,d),o=1):u="�"}else u=String.fromCharCode(c);u&&(t.push(e.slice(a,r),encodeURIComponent(u)),a=r+o+1,u=""),o&&(r+=o,o=0)}return t.join("")+e.slice(a)}function Qe(e,t,r,a){const o=a?a-1:Number.POSITIVE_INFINITY;let c=0;return u;function u(h){return Ye(h)?(e.enter(r),d(h)):t(h)}function d(h){return Ye(h)&&c++<o?(e.consume(h),d):(e.exit(r),t(h))}}const R2={tokenize:M2};function M2(e){const t=e.attempt(this.parser.constructs.contentInitial,a,o);let r;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Qe(e,t,"linePrefix")}function o(d){return e.enter("paragraph"),c(d)}function c(d){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,u(d)}function u(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Oe(d)?(e.consume(d),e.exit("chunkText"),c):(e.consume(d),u)}}const I2={tokenize:D2},wv={tokenize:L2};function D2(e){const t=this,r=[];let a=0,o,c,u;return d;function d(w){if(a<r.length){const A=r[a];return t.containerState=A[1],e.attempt(A[0].continuation,h,m)(w)}return m(w)}function h(w){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&D();const A=t.events.length;let L=A,M;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){M=t.events[L][1].end;break}k(a);let $=A;for(;$<t.events.length;)t.events[$][1].end={...M},$++;return Kn(t.events,L+1,0,t.events.slice(A)),t.events.length=$,m(w)}return d(w)}function m(w){if(a===r.length){if(!o)return v(w);if(o.currentConstruct&&o.currentConstruct.concrete)return _(w);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(wv,b,y)(w)}function b(w){return o&&D(),k(a),v(w)}function y(w){return t.parser.lazy[t.now().line]=a!==r.length,u=t.now().offset,_(w)}function v(w){return t.containerState={},e.attempt(wv,x,_)(w)}function x(w){return a++,r.push([t.currentConstruct,t.containerState]),v(w)}function _(w){if(w===null){o&&D(),k(0),e.consume(w);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:c}),S(w)}function S(w){if(w===null){O(e.exit("chunkFlow"),!0),k(0),e.consume(w);return}return Oe(w)?(e.consume(w),O(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(w),S)}function O(w,A){const L=t.sliceStream(w);if(A&&L.push(null),w.previous=c,c&&(c.next=w),c=w,o.defineSkip(w.start),o.write(L),t.parser.lazy[w.start.line]){let M=o.events.length;for(;M--;)if(o.events[M][1].start.offset<u&&(!o.events[M][1].end||o.events[M][1].end.offset>u))return;const $=t.events.length;let V=$,ee,U;for(;V--;)if(t.events[V][0]==="exit"&&t.events[V][1].type==="chunkFlow"){if(ee){U=t.events[V][1].end;break}ee=!0}for(k(a),M=$;M<t.events.length;)t.events[M][1].end={...U},M++;Kn(t.events,V+1,0,t.events.slice($)),t.events.length=M}}function k(w){let A=r.length;for(;A-- >w;){const L=r[A];t.containerState=L[1],L[0].exit.call(t,e)}r.length=w}function D(){o.write([null]),c=void 0,o=void 0,t.containerState._closeFlow=void 0}}function L2(e,t,r){return Qe(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ds(e){if(e===null||Et(e)||Sa(e))return 1;if(Ru(e))return 2}function Mu(e,t,r){const a=[];let o=-1;for(;++o<e.length;){const c=e[o].resolveAll;c&&!a.includes(c)&&(t=c(t,r),a.push(c))}return t}const Kh={name:"attention",resolveAll:j2,tokenize:z2};function j2(e,t){let r=-1,a,o,c,u,d,h,m,b;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(a=r;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[a][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const y={...e[a][1].end},v={...e[r][1].start};kv(y,-h),kv(v,h),u={type:h>1?"strongSequence":"emphasisSequence",start:y,end:{...e[a][1].end}},d={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:v},c={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[r][1].start}},o={type:h>1?"strong":"emphasis",start:{...u.start},end:{...d.end}},e[a][1].end={...u.start},e[r][1].start={...d.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=rr(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=rr(m,[["enter",o,t],["enter",u,t],["exit",u,t],["enter",c,t]]),m=rr(m,Mu(t.parser.constructs.insideSpan.null,e.slice(a+1,r),t)),m=rr(m,[["exit",c,t],["enter",d,t],["exit",d,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(b=2,m=rr(m,[["enter",e[r][1],t],["exit",e[r][1],t]])):b=0,Kn(e,a-1,r-a+3,m),r=a+m.length-b-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function z2(e,t){const r=this.parser.constructs.attentionMarkers.null,a=this.previous,o=Ds(a);let c;return u;function u(h){return c=h,e.enter("attentionSequence"),d(h)}function d(h){if(h===c)return e.consume(h),d;const m=e.exit("attentionSequence"),b=Ds(h),y=!b||b===2&&o||r.includes(h),v=!o||o===2&&b||r.includes(a);return m._open=!!(c===42?y:y&&(o||!v)),m._close=!!(c===42?v:v&&(b||!y)),t(h)}}function kv(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const B2={name:"autolink",tokenize:U2};function U2(e,t,r){let a=0;return o;function o(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(x){return yn(x)?(e.consume(x),u):x===64?r(x):m(x)}function u(x){return x===43||x===45||x===46||un(x)?(a=1,d(x)):m(x)}function d(x){return x===58?(e.consume(x),a=0,h):(x===43||x===45||x===46||un(x))&&a++<32?(e.consume(x),d):(a=0,m(x))}function h(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||gu(x)?r(x):(e.consume(x),h)}function m(x){return x===64?(e.consume(x),b):C2(x)?(e.consume(x),m):r(x)}function b(x){return un(x)?y(x):r(x)}function y(x){return x===46?(e.consume(x),a=0,b):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):v(x)}function v(x){if((x===45||un(x))&&a++<63){const _=x===45?v:y;return e.consume(x),_}return r(x)}}const yl={partial:!0,tokenize:P2};function P2(e,t,r){return a;function a(c){return Ye(c)?Qe(e,o,"linePrefix")(c):o(c)}function o(c){return c===null||Oe(c)?t(c):r(c)}}const Kx={continuation:{tokenize:F2},exit:$2,name:"blockQuote",tokenize:H2};function H2(e,t,r){const a=this;return o;function o(u){if(u===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),c}return r(u)}function c(u){return Ye(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function F2(e,t,r){const a=this;return o;function o(u){return Ye(u)?Qe(e,c,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):c(u)}function c(u){return e.attempt(Kx,t,r)(u)}}function $2(e){e.exit("blockQuote")}const qx={name:"characterEscape",tokenize:G2};function G2(e,t,r){return a;function a(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),o}function o(c){return O2(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(c)}}const Vx={name:"characterReference",tokenize:K2};function K2(e,t,r){const a=this;let o=0,c,u;return d;function d(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),h}function h(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,u=un,b(y))}function m(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,u=A2,b):(e.enter("characterReferenceValue"),c=7,u=Gh,b(y))}function b(y){if(y===59&&o){const v=e.exit("characterReferenceValue");return u===un&&!Tp(a.sliceSerialize(v))?r(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(y)&&o++<c?(e.consume(y),b):r(y)}}const Tv={partial:!0,tokenize:V2},Nv={concrete:!0,name:"codeFenced",tokenize:q2};function q2(e,t,r){const a=this,o={partial:!0,tokenize:L};let c=0,u=0,d;return h;function h(M){return m(M)}function m(M){const $=a.events[a.events.length-1];return c=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,d=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(M)}function b(M){return M===d?(u++,e.consume(M),b):u<3?r(M):(e.exit("codeFencedFenceSequence"),Ye(M)?Qe(e,y,"whitespace")(M):y(M))}function y(M){return M===null||Oe(M)?(e.exit("codeFencedFence"),a.interrupt?t(M):e.check(Tv,S,A)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(M))}function v(M){return M===null||Oe(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(M)):Ye(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Qe(e,x,"whitespace")(M)):M===96&&M===d?r(M):(e.consume(M),v)}function x(M){return M===null||Oe(M)?y(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_(M))}function _(M){return M===null||Oe(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(M)):M===96&&M===d?r(M):(e.consume(M),_)}function S(M){return e.attempt(o,A,O)(M)}function O(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),k}function k(M){return c>0&&Ye(M)?Qe(e,D,"linePrefix",c+1)(M):D(M)}function D(M){return M===null||Oe(M)?e.check(Tv,S,A)(M):(e.enter("codeFlowValue"),w(M))}function w(M){return M===null||Oe(M)?(e.exit("codeFlowValue"),D(M)):(e.consume(M),w)}function A(M){return e.exit("codeFenced"),t(M)}function L(M,$,V){let ee=0;return U;function U(K){return M.enter("lineEnding"),M.consume(K),M.exit("lineEnding"),F}function F(K){return M.enter("codeFencedFence"),Ye(K)?Qe(M,Y,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):Y(K)}function Y(K){return K===d?(M.enter("codeFencedFenceSequence"),ue(K)):V(K)}function ue(K){return K===d?(ee++,M.consume(K),ue):ee>=u?(M.exit("codeFencedFenceSequence"),Ye(K)?Qe(M,ie,"whitespace")(K):ie(K)):V(K)}function ie(K){return K===null||Oe(K)?(M.exit("codeFencedFence"),$(K)):V(K)}}}function V2(e,t,r){const a=this;return o;function o(u){return u===null?r(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c)}function c(u){return a.parser.lazy[a.now().line]?r(u):t(u)}}const nh={name:"codeIndented",tokenize:W2},Y2={partial:!0,tokenize:X2};function W2(e,t,r){const a=this;return o;function o(m){return e.enter("codeIndented"),Qe(e,c,"linePrefix",5)(m)}function c(m){const b=a.events[a.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?u(m):r(m)}function u(m){return m===null?h(m):Oe(m)?e.attempt(Y2,u,h)(m):(e.enter("codeFlowValue"),d(m))}function d(m){return m===null||Oe(m)?(e.exit("codeFlowValue"),u(m)):(e.consume(m),d)}function h(m){return e.exit("codeIndented"),t(m)}}function X2(e,t,r){const a=this;return o;function o(u){return a.parser.lazy[a.now().line]?r(u):Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):Qe(e,c,"linePrefix",5)(u)}function c(u){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(u):Oe(u)?o(u):r(u)}}const Z2={name:"codeText",previous:Q2,resolve:J2,tokenize:eT};function J2(e){let t=e.length-4,r=3,a,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=r;++a<t;)if(e[a][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(a=r-1,t++;++a<=t;)o===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(o=a):(a===t||e[a][1].type==="lineEnding")&&(e[o][1].type="codeTextData",a!==o+2&&(e[o][1].end=e[a-1][1].end,e.splice(o+2,a-o-2),t-=a-o-2,a=o+2),o=void 0);return e}function Q2(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function eT(e,t,r){let a=0,o,c;return u;function u(y){return e.enter("codeText"),e.enter("codeTextSequence"),d(y)}function d(y){return y===96?(e.consume(y),a++,d):(e.exit("codeTextSequence"),h(y))}function h(y){return y===null?r(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),h):y===96?(c=e.enter("codeTextSequence"),o=0,b(y)):Oe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(y))}function m(y){return y===null||y===32||y===96||Oe(y)?(e.exit("codeTextData"),h(y)):(e.consume(y),m)}function b(y){return y===96?(e.consume(y),o++,b):o===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(y)):(c.type="codeTextData",m(y))}}class tT{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const a=r??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,r,a){const o=r||0;this.setCursor(Math.trunc(t));const c=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return a&&Ho(this.left,a),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ho(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ho(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);Ho(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ho(this.left,r.reverse())}}}function Ho(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function Yx(e){const t={};let r=-1,a,o,c,u,d,h,m;const b=new tT(e);for(;++r<b.length;){for(;r in t;)r=t[r];if(a=b.get(r),r&&a[1].type==="chunkFlow"&&b.get(r-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,c=0,c<h.length&&h[c][1].type==="lineEndingBlank"&&(c+=2),c<h.length&&h[c][1].type==="content"))for(;++c<h.length&&h[c][1].type!=="content";)h[c][1].type==="chunkText"&&(h[c][1]._isInFirstContentOfListItem=!0,c++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,nT(b,r)),r=t[r],m=!0);else if(a[1]._container){for(c=r,o=void 0;c--;)if(u=b.get(c),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(o&&(b.get(o)[1].type="lineEndingBlank"),u[1].type="lineEnding",o=c);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;o&&(a[1].end={...b.get(o)[1].start},d=b.slice(o,r),d.unshift(a),b.splice(o,r-o+1,d))}}return Kn(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function nT(e,t){const r=e.get(t)[1],a=e.get(t)[2];let o=t-1;const c=[];let u=r._tokenizer;u||(u=a.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const d=u.events,h=[],m={};let b,y,v=-1,x=r,_=0,S=0;const O=[S];for(;x;){for(;e.get(++o)[1]!==x;);c.push(o),x._tokenizer||(b=a.sliceStream(x),x.next||b.push(null),y&&u.defineSkip(x.start),x._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(b),x._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),y=x,x=x.next}for(x=r;++v<d.length;)d[v][0]==="exit"&&d[v-1][0]==="enter"&&d[v][1].type===d[v-1][1].type&&d[v][1].start.line!==d[v][1].end.line&&(S=v+1,O.push(S),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(u.events=[],x?(x._tokenizer=void 0,x.previous=void 0):O.pop(),v=O.length;v--;){const k=d.slice(O[v],O[v+1]),D=c.pop();h.push([D,D+k.length-1]),e.splice(D,2,k)}for(h.reverse(),v=-1;++v<h.length;)m[_+h[v][0]]=_+h[v][1],_+=h[v][1]-h[v][0]-1;return m}const rT={resolve:aT,tokenize:sT},iT={partial:!0,tokenize:oT};function aT(e){return Yx(e),e}function sT(e,t){let r;return a;function a(d){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(d)}function o(d){return d===null?c(d):Oe(d)?e.check(iT,u,c)(d):(e.consume(d),o)}function c(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function u(d){return e.consume(d),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function oT(e,t,r){const a=this;return o;function o(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Qe(e,c,"linePrefix")}function c(u){if(u===null||Oe(u))return r(u);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(u):e.interrupt(a.parser.constructs.flow,r,t)(u)}}function Wx(e,t,r,a,o,c,u,d,h){const m=h||Number.POSITIVE_INFINITY;let b=0;return y;function y(k){return k===60?(e.enter(a),e.enter(o),e.enter(c),e.consume(k),e.exit(c),v):k===null||k===32||k===41||gu(k)?r(k):(e.enter(a),e.enter(u),e.enter(d),e.enter("chunkString",{contentType:"string"}),S(k))}function v(k){return k===62?(e.enter(c),e.consume(k),e.exit(c),e.exit(o),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),x(k))}function x(k){return k===62?(e.exit("chunkString"),e.exit(d),v(k)):k===null||k===60||Oe(k)?r(k):(e.consume(k),k===92?_:x)}function _(k){return k===60||k===62||k===92?(e.consume(k),x):x(k)}function S(k){return!b&&(k===null||k===41||Et(k))?(e.exit("chunkString"),e.exit(d),e.exit(u),e.exit(a),t(k)):b<m&&k===40?(e.consume(k),b++,S):k===41?(e.consume(k),b--,S):k===null||k===32||k===40||gu(k)?r(k):(e.consume(k),k===92?O:S)}function O(k){return k===40||k===41||k===92?(e.consume(k),S):S(k)}}function Xx(e,t,r,a,o,c){const u=this;let d=0,h;return m;function m(x){return e.enter(a),e.enter(o),e.consume(x),e.exit(o),e.enter(c),b}function b(x){return d>999||x===null||x===91||x===93&&!h||x===94&&!d&&"_hiddenFootnoteSupport"in u.parser.constructs?r(x):x===93?(e.exit(c),e.enter(o),e.consume(x),e.exit(o),e.exit(a),t):Oe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===null||x===91||x===93||Oe(x)||d++>999?(e.exit("chunkString"),b(x)):(e.consume(x),h||(h=!Ye(x)),x===92?v:y)}function v(x){return x===91||x===92||x===93?(e.consume(x),d++,y):y(x)}}function Zx(e,t,r,a,o,c){let u;return d;function d(v){return v===34||v===39||v===40?(e.enter(a),e.enter(o),e.consume(v),e.exit(o),u=v===40?41:v,h):r(v)}function h(v){return v===u?(e.enter(o),e.consume(v),e.exit(o),e.exit(a),t):(e.enter(c),m(v))}function m(v){return v===u?(e.exit(c),h(u)):v===null?r(v):Oe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Qe(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(v))}function b(v){return v===u||v===null||Oe(v)?(e.exit("chunkString"),m(v)):(e.consume(v),v===92?y:b)}function y(v){return v===u||v===92?(e.consume(v),b):b(v)}}function el(e,t){let r;return a;function a(o){return Oe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,a):Ye(o)?Qe(e,a,r?"linePrefix":"lineSuffix")(o):t(o)}}const lT={name:"definition",tokenize:uT},cT={partial:!0,tokenize:dT};function uT(e,t,r){const a=this;let o;return c;function c(x){return e.enter("definition"),u(x)}function u(x){return Xx.call(a,e,d,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function d(x){return o=hr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),h):r(x)}function h(x){return Et(x)?el(e,m)(x):m(x)}function m(x){return Wx(e,b,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function b(x){return e.attempt(cT,y,y)(x)}function y(x){return Ye(x)?Qe(e,v,"whitespace")(x):v(x)}function v(x){return x===null||Oe(x)?(e.exit("definition"),a.parser.defined.push(o),t(x)):r(x)}}function dT(e,t,r){return a;function a(d){return Et(d)?el(e,o)(d):r(d)}function o(d){return Zx(e,c,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function c(d){return Ye(d)?Qe(e,u,"whitespace")(d):u(d)}function u(d){return d===null||Oe(d)?t(d):r(d)}}const fT={name:"hardBreakEscape",tokenize:hT};function hT(e,t,r){return a;function a(c){return e.enter("hardBreakEscape"),e.consume(c),o}function o(c){return Oe(c)?(e.exit("hardBreakEscape"),t(c)):r(c)}}const pT={name:"headingAtx",resolve:mT,tokenize:gT};function mT(e,t){let r=e.length-2,a=3,o,c;return e[a][1].type==="whitespace"&&(a+=2),r-2>a&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(a===r-1||r-4>a&&e[r-2][1].type==="whitespace")&&(r-=a+1===r?2:4),r>a&&(o={type:"atxHeadingText",start:e[a][1].start,end:e[r][1].end},c={type:"chunkText",start:e[a][1].start,end:e[r][1].end,contentType:"text"},Kn(e,a,r-a+1,[["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t]])),e}function gT(e,t,r){let a=0;return o;function o(b){return e.enter("atxHeading"),c(b)}function c(b){return e.enter("atxHeadingSequence"),u(b)}function u(b){return b===35&&a++<6?(e.consume(b),u):b===null||Et(b)?(e.exit("atxHeadingSequence"),d(b)):r(b)}function d(b){return b===35?(e.enter("atxHeadingSequence"),h(b)):b===null||Oe(b)?(e.exit("atxHeading"),t(b)):Ye(b)?Qe(e,d,"whitespace")(b):(e.enter("atxHeadingText"),m(b))}function h(b){return b===35?(e.consume(b),h):(e.exit("atxHeadingSequence"),d(b))}function m(b){return b===null||b===35||Et(b)?(e.exit("atxHeadingText"),d(b)):(e.consume(b),m)}}const bT=["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"],Cv=["pre","script","style","textarea"],yT={concrete:!0,name:"htmlFlow",resolveTo:ET,tokenize:ST},vT={partial:!0,tokenize:wT},xT={partial:!0,tokenize:_T};function ET(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function ST(e,t,r){const a=this;let o,c,u,d,h;return m;function m(C){return b(C)}function b(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),y}function y(C){return C===33?(e.consume(C),v):C===47?(e.consume(C),c=!0,S):C===63?(e.consume(C),o=3,a.interrupt?t:T):yn(C)?(e.consume(C),u=String.fromCharCode(C),O):r(C)}function v(C){return C===45?(e.consume(C),o=2,x):C===91?(e.consume(C),o=5,d=0,_):yn(C)?(e.consume(C),o=4,a.interrupt?t:T):r(C)}function x(C){return C===45?(e.consume(C),a.interrupt?t:T):r(C)}function _(C){const de="CDATA[";return C===de.charCodeAt(d++)?(e.consume(C),d===de.length?a.interrupt?t:Y:_):r(C)}function S(C){return yn(C)?(e.consume(C),u=String.fromCharCode(C),O):r(C)}function O(C){if(C===null||C===47||C===62||Et(C)){const de=C===47,fe=u.toLowerCase();return!de&&!c&&Cv.includes(fe)?(o=1,a.interrupt?t(C):Y(C)):bT.includes(u.toLowerCase())?(o=6,de?(e.consume(C),k):a.interrupt?t(C):Y(C)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?r(C):c?D(C):w(C))}return C===45||un(C)?(e.consume(C),u+=String.fromCharCode(C),O):r(C)}function k(C){return C===62?(e.consume(C),a.interrupt?t:Y):r(C)}function D(C){return Ye(C)?(e.consume(C),D):U(C)}function w(C){return C===47?(e.consume(C),U):C===58||C===95||yn(C)?(e.consume(C),A):Ye(C)?(e.consume(C),w):U(C)}function A(C){return C===45||C===46||C===58||C===95||un(C)?(e.consume(C),A):L(C)}function L(C){return C===61?(e.consume(C),M):Ye(C)?(e.consume(C),L):w(C)}function M(C){return C===null||C===60||C===61||C===62||C===96?r(C):C===34||C===39?(e.consume(C),h=C,$):Ye(C)?(e.consume(C),M):V(C)}function $(C){return C===h?(e.consume(C),h=null,ee):C===null||Oe(C)?r(C):(e.consume(C),$)}function V(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||Et(C)?L(C):(e.consume(C),V)}function ee(C){return C===47||C===62||Ye(C)?w(C):r(C)}function U(C){return C===62?(e.consume(C),F):r(C)}function F(C){return C===null||Oe(C)?Y(C):Ye(C)?(e.consume(C),F):r(C)}function Y(C){return C===45&&o===2?(e.consume(C),B):C===60&&o===1?(e.consume(C),Q):C===62&&o===4?(e.consume(C),R):C===63&&o===3?(e.consume(C),T):C===93&&o===5?(e.consume(C),P):Oe(C)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(vT,q,ue)(C)):C===null||Oe(C)?(e.exit("htmlFlowData"),ue(C)):(e.consume(C),Y)}function ue(C){return e.check(xT,ie,q)(C)}function ie(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),K}function K(C){return C===null||Oe(C)?ue(C):(e.enter("htmlFlowData"),Y(C))}function B(C){return C===45?(e.consume(C),T):Y(C)}function Q(C){return C===47?(e.consume(C),u="",ae):Y(C)}function ae(C){if(C===62){const de=u.toLowerCase();return Cv.includes(de)?(e.consume(C),R):Y(C)}return yn(C)&&u.length<8?(e.consume(C),u+=String.fromCharCode(C),ae):Y(C)}function P(C){return C===93?(e.consume(C),T):Y(C)}function T(C){return C===62?(e.consume(C),R):C===45&&o===2?(e.consume(C),T):Y(C)}function R(C){return C===null||Oe(C)?(e.exit("htmlFlowData"),q(C)):(e.consume(C),R)}function q(C){return e.exit("htmlFlow"),t(C)}}function _T(e,t,r){const a=this;return o;function o(u){return Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c):r(u)}function c(u){return a.parser.lazy[a.now().line]?r(u):t(u)}}function wT(e,t,r){return a;function a(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(yl,t,r)}}const kT={name:"htmlText",tokenize:TT};function TT(e,t,r){const a=this;let o,c,u;return d;function d(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),h}function h(T){return T===33?(e.consume(T),m):T===47?(e.consume(T),L):T===63?(e.consume(T),w):yn(T)?(e.consume(T),V):r(T)}function m(T){return T===45?(e.consume(T),b):T===91?(e.consume(T),c=0,_):yn(T)?(e.consume(T),D):r(T)}function b(T){return T===45?(e.consume(T),x):r(T)}function y(T){return T===null?r(T):T===45?(e.consume(T),v):Oe(T)?(u=y,Q(T)):(e.consume(T),y)}function v(T){return T===45?(e.consume(T),x):y(T)}function x(T){return T===62?B(T):T===45?v(T):y(T)}function _(T){const R="CDATA[";return T===R.charCodeAt(c++)?(e.consume(T),c===R.length?S:_):r(T)}function S(T){return T===null?r(T):T===93?(e.consume(T),O):Oe(T)?(u=S,Q(T)):(e.consume(T),S)}function O(T){return T===93?(e.consume(T),k):S(T)}function k(T){return T===62?B(T):T===93?(e.consume(T),k):S(T)}function D(T){return T===null||T===62?B(T):Oe(T)?(u=D,Q(T)):(e.consume(T),D)}function w(T){return T===null?r(T):T===63?(e.consume(T),A):Oe(T)?(u=w,Q(T)):(e.consume(T),w)}function A(T){return T===62?B(T):w(T)}function L(T){return yn(T)?(e.consume(T),M):r(T)}function M(T){return T===45||un(T)?(e.consume(T),M):$(T)}function $(T){return Oe(T)?(u=$,Q(T)):Ye(T)?(e.consume(T),$):B(T)}function V(T){return T===45||un(T)?(e.consume(T),V):T===47||T===62||Et(T)?ee(T):r(T)}function ee(T){return T===47?(e.consume(T),B):T===58||T===95||yn(T)?(e.consume(T),U):Oe(T)?(u=ee,Q(T)):Ye(T)?(e.consume(T),ee):B(T)}function U(T){return T===45||T===46||T===58||T===95||un(T)?(e.consume(T),U):F(T)}function F(T){return T===61?(e.consume(T),Y):Oe(T)?(u=F,Q(T)):Ye(T)?(e.consume(T),F):ee(T)}function Y(T){return T===null||T===60||T===61||T===62||T===96?r(T):T===34||T===39?(e.consume(T),o=T,ue):Oe(T)?(u=Y,Q(T)):Ye(T)?(e.consume(T),Y):(e.consume(T),ie)}function ue(T){return T===o?(e.consume(T),o=void 0,K):T===null?r(T):Oe(T)?(u=ue,Q(T)):(e.consume(T),ue)}function ie(T){return T===null||T===34||T===39||T===60||T===61||T===96?r(T):T===47||T===62||Et(T)?ee(T):(e.consume(T),ie)}function K(T){return T===47||T===62||Et(T)?ee(T):r(T)}function B(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):r(T)}function Q(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),ae}function ae(T){return Ye(T)?Qe(e,P,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):P(T)}function P(T){return e.enter("htmlTextData"),u(T)}}const Np={name:"labelEnd",resolveAll:OT,resolveTo:RT,tokenize:MT},NT={tokenize:IT},CT={tokenize:DT},AT={tokenize:LT};function OT(e){let t=-1;const r=[];for(;++t<e.length;){const a=e[t][1];if(r.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const o=a.type==="labelImage"?4:2;a.type="data",t+=o}}return e.length!==r.length&&Kn(e,0,e.length,r),e}function RT(e,t){let r=e.length,a=0,o,c,u,d;for(;r--;)if(o=e[r][1],c){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(u){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(c=r,o.type!=="labelLink")){a=2;break}}else o.type==="labelEnd"&&(u=r);const h={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[c][1].start},end:{...e[u][1].end}},b={type:"labelText",start:{...e[c+a+2][1].end},end:{...e[u-2][1].start}};return d=[["enter",h,t],["enter",m,t]],d=rr(d,e.slice(c+1,c+a+3)),d=rr(d,[["enter",b,t]]),d=rr(d,Mu(t.parser.constructs.insideSpan.null,e.slice(c+a+4,u-3),t)),d=rr(d,[["exit",b,t],e[u-2],e[u-1],["exit",m,t]]),d=rr(d,e.slice(u+1)),d=rr(d,[["exit",h,t]]),Kn(e,c,e.length,d),e}function MT(e,t,r){const a=this;let o=a.events.length,c,u;for(;o--;)if((a.events[o][1].type==="labelImage"||a.events[o][1].type==="labelLink")&&!a.events[o][1]._balanced){c=a.events[o][1];break}return d;function d(v){return c?c._inactive?y(v):(u=a.parser.defined.includes(hr(a.sliceSerialize({start:c.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):r(v)}function h(v){return v===40?e.attempt(NT,b,u?b:y)(v):v===91?e.attempt(CT,b,u?m:y)(v):u?b(v):y(v)}function m(v){return e.attempt(AT,b,y)(v)}function b(v){return t(v)}function y(v){return c._balanced=!0,r(v)}}function IT(e,t,r){return a;function a(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),o}function o(y){return Et(y)?el(e,c)(y):c(y)}function c(y){return y===41?b(y):Wx(e,u,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function u(y){return Et(y)?el(e,h)(y):b(y)}function d(y){return r(y)}function h(y){return y===34||y===39||y===40?Zx(e,m,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):b(y)}function m(y){return Et(y)?el(e,b)(y):b(y)}function b(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),t):r(y)}}function DT(e,t,r){const a=this;return o;function o(d){return Xx.call(a,e,c,u,"reference","referenceMarker","referenceString")(d)}function c(d){return a.parser.defined.includes(hr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):r(d)}function u(d){return r(d)}}function LT(e,t,r){return a;function a(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),o}function o(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),t):r(c)}}const jT={name:"labelStartImage",resolveAll:Np.resolveAll,tokenize:zT};function zT(e,t,r){const a=this;return o;function o(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),c}function c(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),u):r(d)}function u(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(d):t(d)}}const BT={name:"labelStartLink",resolveAll:Np.resolveAll,tokenize:UT};function UT(e,t,r){const a=this;return o;function o(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),c}function c(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(u):t(u)}}const rh={name:"lineEnding",tokenize:PT};function PT(e,t){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Qe(e,t,"linePrefix")}}const ou={name:"thematicBreak",tokenize:HT};function HT(e,t,r){let a=0,o;return c;function c(m){return e.enter("thematicBreak"),u(m)}function u(m){return o=m,d(m)}function d(m){return m===o?(e.enter("thematicBreakSequence"),h(m)):a>=3&&(m===null||Oe(m))?(e.exit("thematicBreak"),t(m)):r(m)}function h(m){return m===o?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),Ye(m)?Qe(e,d,"whitespace")(m):d(m))}}const Rn={continuation:{tokenize:KT},exit:VT,name:"list",tokenize:GT},FT={partial:!0,tokenize:YT},$T={partial:!0,tokenize:qT};function GT(e,t,r){const a=this,o=a.events[a.events.length-1];let c=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,u=0;return d;function d(x){const _=a.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!a.containerState.marker||x===a.containerState.marker:Gh(x)){if(a.containerState.type||(a.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(ou,r,m)(x):m(x);if(!a.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(x)}return r(x)}function h(x){return Gh(x)&&++u<10?(e.consume(x),h):(!a.interrupt||u<2)&&(a.containerState.marker?x===a.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),m(x)):r(x)}function m(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||x,e.check(yl,a.interrupt?r:b,e.attempt(FT,v,y))}function b(x){return a.containerState.initialBlankLine=!0,c++,v(x)}function y(x){return Ye(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),v):r(x)}function v(x){return a.containerState.size=c+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function KT(e,t,r){const a=this;return a.containerState._closeFlow=void 0,e.check(yl,o,c);function o(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Qe(e,t,"listItemIndent",a.containerState.size+1)(d)}function c(d){return a.containerState.furtherBlankLines||!Ye(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt($T,t,u)(d))}function u(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,Qe(e,e.attempt(Rn,t,r),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function qT(e,t,r){const a=this;return Qe(e,o,"listItemIndent",a.containerState.size+1);function o(c){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?t(c):r(c)}}function VT(e){e.exit(this.containerState.type)}function YT(e,t,r){const a=this;return Qe(e,o,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(c){const u=a.events[a.events.length-1];return!Ye(c)&&u&&u[1].type==="listItemPrefixWhitespace"?t(c):r(c)}}const Av={name:"setextUnderline",resolveTo:WT,tokenize:XT};function WT(e,t){let r=e.length,a,o,c;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){a=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!c&&e[r][1].type==="definition"&&(c=r);const u={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",c?(e.splice(o,0,["enter",u,t]),e.splice(c+1,0,["exit",e[a][1],t]),e[a][1].end={...e[c][1].end}):e[a][1]=u,e.push(["exit",u,t]),e}function XT(e,t,r){const a=this;let o;return c;function c(m){let b=a.events.length,y;for(;b--;)if(a.events[b][1].type!=="lineEnding"&&a.events[b][1].type!=="linePrefix"&&a.events[b][1].type!=="content"){y=a.events[b][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||y)?(e.enter("setextHeadingLine"),o=m,u(m)):r(m)}function u(m){return e.enter("setextHeadingLineSequence"),d(m)}function d(m){return m===o?(e.consume(m),d):(e.exit("setextHeadingLineSequence"),Ye(m)?Qe(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||Oe(m)?(e.exit("setextHeadingLine"),t(m)):r(m)}}const ZT={tokenize:JT};function JT(e){const t=this,r=e.attempt(yl,a,e.attempt(this.parser.constructs.flowInitial,o,Qe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(rT,o)),"linePrefix")));return r;function a(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const QT={resolveAll:Qx()},eN=Jx("string"),tN=Jx("text");function Jx(e){return{resolveAll:Qx(e==="text"?nN:void 0),tokenize:t};function t(r){const a=this,o=this.parser.constructs[e],c=r.attempt(o,u,d);return u;function u(b){return m(b)?c(b):d(b)}function d(b){if(b===null){r.consume(b);return}return r.enter("data"),r.consume(b),h}function h(b){return m(b)?(r.exit("data"),c(b)):(r.consume(b),h)}function m(b){if(b===null)return!0;const y=o[b];let v=-1;if(y)for(;++v<y.length;){const x=y[v];if(!x.previous||x.previous.call(a,a.previous))return!0}return!1}}}function Qx(e){return t;function t(r,a){let o=-1,c;for(;++o<=r.length;)c===void 0?r[o]&&r[o][1].type==="data"&&(c=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==c+2&&(r[c][1].end=r[o-1][1].end,r.splice(c+2,o-c-2),o=c+2),c=void 0);return e?e(r,a):r}}function nN(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const a=e[r-1][1],o=t.sliceStream(a);let c=o.length,u=-1,d=0,h;for(;c--;){const m=o[c];if(typeof m=="string"){for(u=m.length;m.charCodeAt(u-1)===32;)d++,u--;if(u)break;u=-1}else if(m===-2)h=!0,d++;else if(m!==-1){c++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(d=0),d){const m={type:r===e.length||h||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?u:a.start._bufferIndex+u,_index:a.start._index+c,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...m.start},a.start.offset===a.end.offset?Object.assign(a,m):(e.splice(r,0,["enter",m,t],["exit",m,t]),r+=2)}r++}return e}const rN={42:Rn,43:Rn,45:Rn,48:Rn,49:Rn,50:Rn,51:Rn,52:Rn,53:Rn,54:Rn,55:Rn,56:Rn,57:Rn,62:Kx},iN={91:lT},aN={[-2]:nh,[-1]:nh,32:nh},sN={35:pT,42:ou,45:[Av,ou],60:yT,61:Av,95:ou,96:Nv,126:Nv},oN={38:Vx,92:qx},lN={[-5]:rh,[-4]:rh,[-3]:rh,33:jT,38:Vx,42:Kh,60:[B2,kT],91:BT,92:[fT,qx],93:Np,95:Kh,96:Z2},cN={null:[Kh,QT]},uN={null:[42,95]},dN={null:[]},fN=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:uN,contentInitial:iN,disable:dN,document:rN,flow:sN,flowInitial:aN,insideSpan:cN,string:oN,text:lN},Symbol.toStringTag,{value:"Module"}));function hN(e,t,r){let a={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},c=[];let u=[],d=[];const h={attempt:$(L),check:$(M),consume:D,enter:w,exit:A,interrupt:$(M,{interrupt:!0})},m={code:null,containerState:{},defineSkip:S,events:[],now:_,parser:e,previous:null,sliceSerialize:v,sliceStream:x,write:y};let b=t.tokenize.call(m,h);return t.resolveAll&&c.push(t),m;function y(F){return u=rr(u,F),O(),u[u.length-1]!==null?[]:(V(t,0),m.events=Mu(c,m.events,m),m.events)}function v(F,Y){return mN(x(F),Y)}function x(F){return pN(u,F)}function _(){const{_bufferIndex:F,_index:Y,line:ue,column:ie,offset:K}=a;return{_bufferIndex:F,_index:Y,line:ue,column:ie,offset:K}}function S(F){o[F.line]=F.column,U()}function O(){let F;for(;a._index<u.length;){const Y=u[a._index];if(typeof Y=="string")for(F=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===F&&a._bufferIndex<Y.length;)k(Y.charCodeAt(a._bufferIndex));else k(Y)}}function k(F){b=b(F)}function D(F){Oe(F)?(a.line++,a.column=1,a.offset+=F===-3?2:1,U()):F!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),m.previous=F}function w(F,Y){const ue=Y||{};return ue.type=F,ue.start=_(),m.events.push(["enter",ue,m]),d.push(ue),ue}function A(F){const Y=d.pop();return Y.end=_(),m.events.push(["exit",Y,m]),Y}function L(F,Y){V(F,Y.from)}function M(F,Y){Y.restore()}function $(F,Y){return ue;function ue(ie,K,B){let Q,ae,P,T;return Array.isArray(ie)?q(ie):"tokenize"in ie?q([ie]):R(ie);function R(he){return Te;function Te(Le){const et=Le!==null&&he[Le],Rt=Le!==null&&he.null,an=[...Array.isArray(et)?et:et?[et]:[],...Array.isArray(Rt)?Rt:Rt?[Rt]:[]];return q(an)(Le)}}function q(he){return Q=he,ae=0,he.length===0?B:C(he[ae])}function C(he){return Te;function Te(Le){return T=ee(),P=he,he.partial||(m.currentConstruct=he),he.name&&m.parser.constructs.disable.null.includes(he.name)?fe():he.tokenize.call(Y?Object.assign(Object.create(m),Y):m,h,de,fe)(Le)}}function de(he){return F(P,T),K}function fe(he){return T.restore(),++ae<Q.length?C(Q[ae]):B}}}function V(F,Y){F.resolveAll&&!c.includes(F)&&c.push(F),F.resolve&&Kn(m.events,Y,m.events.length-Y,F.resolve(m.events.slice(Y),m)),F.resolveTo&&(m.events=F.resolveTo(m.events,m))}function ee(){const F=_(),Y=m.previous,ue=m.currentConstruct,ie=m.events.length,K=Array.from(d);return{from:ie,restore:B};function B(){a=F,m.previous=Y,m.currentConstruct=ue,m.events.length=ie,d=K,U()}}function U(){a.line in o&&a.column<2&&(a.column=o[a.line],a.offset+=o[a.line]-1)}}function pN(e,t){const r=t.start._index,a=t.start._bufferIndex,o=t.end._index,c=t.end._bufferIndex;let u;if(r===o)u=[e[r].slice(a,c)];else{if(u=e.slice(r,o),a>-1){const d=u[0];typeof d=="string"?u[0]=d.slice(a):u.shift()}c>0&&u.push(e[o].slice(0,c))}return u}function mN(e,t){let r=-1;const a=[];let o;for(;++r<e.length;){const c=e[r];let u;if(typeof c=="string")u=c;else switch(c){case-5:{u="\r";break}case-4:{u=`
|
|
51
|
-
`;break}case-3:{u=`\r
|
|
52
|
-
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&o)continue;u=" ";break}default:u=String.fromCharCode(c)}o=c===-2,a.push(u)}return a.join("")}function gN(e){const a={constructs:$x([fN,...(e||{}).extensions||[]]),content:o(R2),defined:[],document:o(I2),flow:o(ZT),lazy:{},string:o(eN),text:o(tN)};return a;function o(c){return u;function u(d){return hN(a,c,d)}}}function bN(e){for(;!Yx(e););return e}const Ov=/[\0\t\n\r]/g;function yN(){let e=1,t="",r=!0,a;return o;function o(c,u,d){const h=[];let m,b,y,v,x;for(c=t+(typeof c=="string"?c.toString():new TextDecoder(u||void 0).decode(c)),y=0,t="",r&&(c.charCodeAt(0)===65279&&y++,r=void 0);y<c.length;){if(Ov.lastIndex=y,m=Ov.exec(c),v=m&&m.index!==void 0?m.index:c.length,x=c.charCodeAt(v),!m){t=c.slice(y);break}if(x===10&&y===v&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),y<v&&(h.push(c.slice(y,v)),e+=v-y),x){case 0:{h.push(65533),e++;break}case 9:{for(b=Math.ceil(e/4)*4,h.push(-2);e++<b;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}y=v+1}return d&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const vN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function xN(e){return e.replace(vN,EN)}function EN(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),c=o===120||o===88;return Gx(r.slice(c?2:1),c?16:10)}return Tp(r)||e}const e0={}.hasOwnProperty;function SN(e,t,r){return typeof t!="string"&&(r=t,t=void 0),_N(r)(bN(gN(r).document().write(yN()(e,t,!0))))}function _N(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(bt),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:c(be),blockQuote:c(Rt),characterEscape:ee,characterReference:ee,codeFenced:c(an),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:c(an,u),codeText:c(qn,u),codeTextData:ee,data:ee,codeFlowValue:ee,definition:c(ar),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:c(ce),hardBreakEscape:c(ve),hardBreakTrailing:c(ve),htmlFlow:c(Ne,u),htmlFlowData:ee,htmlText:c(Ne,u),htmlTextData:ee,image:c($e),label:u,link:c(bt),listItem:c(sr),listItemValue:v,listOrdered:c(Vt,y),listUnordered:c(Vt),paragraph:c(Xt),reference:C,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:c(be),strong:c(Rr),thematicBreak:c(Ca)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:et,autolinkProtocol:Le,blockQuote:h(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:he,characterReference:Te,codeFenced:h(O),codeFencedFence:S,codeFencedFenceInfo:x,codeFencedFenceMeta:_,codeFlowValue:U,codeIndented:h(k),codeText:h(K),codeTextData:U,data:U,definition:h(),definitionDestinationString:A,definitionLabelString:D,definitionTitleString:w,emphasis:h(),hardBreakEscape:h(Y),hardBreakTrailing:h(Y),htmlFlow:h(ue),htmlFlowData:U,htmlText:h(ie),htmlTextData:U,image:h(Q),label:P,labelText:ae,lineEnding:F,link:h(B),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:de,resourceDestinationString:T,resourceTitleString:R,resource:q,setextHeading:h(V),setextHeadingLineSequence:$,setextHeadingText:M,strong:h(),thematicBreak:h()}};t0(t,(e||{}).mdastExtensions||[]);const r={};return a;function a(te){let ge={type:"root",children:[]};const Re={stack:[ge],tokenStack:[],config:t,enter:d,exit:m,buffer:u,resume:b,data:r},Ge=[];let tt=-1;for(;++tt<te.length;)if(te[tt][1].type==="listOrdered"||te[tt][1].type==="listUnordered")if(te[tt][0]==="enter")Ge.push(tt);else{const fn=Ge.pop();tt=o(te,fn,tt)}for(tt=-1;++tt<te.length;){const fn=t[te[tt][0]];e0.call(fn,te[tt][1].type)&&fn[te[tt][1].type].call(Object.assign({sliceSerialize:te[tt][2].sliceSerialize},Re),te[tt][1])}if(Re.tokenStack.length>0){const fn=Re.tokenStack[Re.tokenStack.length-1];(fn[1]||Rv).call(Re,void 0,fn[0])}for(ge.position={start:Li(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:Li(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},tt=-1;++tt<t.transforms.length;)ge=t.transforms[tt](ge)||ge;return ge}function o(te,ge,Re){let Ge=ge-1,tt=-1,fn=!1,or,Zt,Mt,sn;for(;++Ge<=Re;){const ot=te[Ge];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?tt++:tt--,sn=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(or&&!sn&&!tt&&!Mt&&(Mt=Ge),sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:sn=void 0}if(!tt&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||tt===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(or){let br=Ge;for(Zt=void 0;br--;){const hn=te[br];if(hn[1].type==="lineEnding"||hn[1].type==="lineEndingBlank"){if(hn[0]==="exit")continue;Zt&&(te[Zt][1].type="lineEndingBlank",fn=!0),hn[1].type="lineEnding",Zt=br}else if(!(hn[1].type==="linePrefix"||hn[1].type==="blockQuotePrefix"||hn[1].type==="blockQuotePrefixWhitespace"||hn[1].type==="blockQuoteMarker"||hn[1].type==="listItemIndent"))break}Mt&&(!Zt||Mt<Zt)&&(or._spread=!0),or.end=Object.assign({},Zt?te[Zt][1].start:ot[1].end),te.splice(Zt||Ge,0,["exit",or,ot[2]]),Ge++,Re++}if(ot[1].type==="listItemPrefix"){const br={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};or=br,te.splice(Ge,0,["enter",br,ot[2]]),Ge++,Re++,Mt=void 0,sn=!0}}}return te[ge][1]._spread=fn,Re}function c(te,ge){return Re;function Re(Ge){d.call(this,te(Ge),Ge),ge&&ge.call(this,Ge)}}function u(){this.stack.push({type:"fragment",children:[]})}function d(te,ge,Re){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([ge,Re||void 0]),te.position={start:Li(ge.start),end:void 0}}function h(te){return ge;function ge(Re){te&&te.call(this,Re),m.call(this,Re)}}function m(te,ge){const Re=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==te.type&&(ge?ge.call(this,te,Ge[0]):(Ge[1]||Rv).call(this,te,Ge[0]));else throw new Error("Cannot close `"+te.type+"` ("+Qo({start:te.start,end:te.end})+"): it’s not open");Re.position.end=Li(te.end)}function b(){return kp(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function v(te){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function x(){const te=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=te}function _(){const te=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=te}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function O(){const te=this.resume(),ge=this.stack[this.stack.length-1];ge.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const te=this.resume(),ge=this.stack[this.stack.length-1];ge.value=te.replace(/(\r?\n|\r)$/g,"")}function D(te){const ge=this.resume(),Re=this.stack[this.stack.length-1];Re.label=ge,Re.identifier=hr(this.sliceSerialize(te)).toLowerCase()}function w(){const te=this.resume(),ge=this.stack[this.stack.length-1];ge.title=te}function A(){const te=this.resume(),ge=this.stack[this.stack.length-1];ge.url=te}function L(te){const ge=this.stack[this.stack.length-1];if(!ge.depth){const Re=this.sliceSerialize(te).length;ge.depth=Re}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function $(te){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function V(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(te){const Re=this.stack[this.stack.length-1].children;let Ge=Re[Re.length-1];(!Ge||Ge.type!=="text")&&(Ge=wt(),Ge.position={start:Li(te.start),end:void 0},Re.push(Ge)),this.stack.push(Ge)}function U(te){const ge=this.stack.pop();ge.value+=this.sliceSerialize(te),ge.position.end=Li(te.end)}function F(te){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=ge.children[ge.children.length-1];Re.position.end=Li(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ge.type)&&(ee.call(this,te),U.call(this,te))}function Y(){this.data.atHardBreak=!0}function ue(){const te=this.resume(),ge=this.stack[this.stack.length-1];ge.value=te}function ie(){const te=this.resume(),ge=this.stack[this.stack.length-1];ge.value=te}function K(){const te=this.resume(),ge=this.stack[this.stack.length-1];ge.value=te}function B(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=ge,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function Q(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=ge,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function ae(te){const ge=this.sliceSerialize(te),Re=this.stack[this.stack.length-2];Re.label=xN(ge),Re.identifier=hr(ge).toLowerCase()}function P(){const te=this.stack[this.stack.length-1],ge=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const Ge=te.children;Re.children=Ge}else Re.alt=ge}function T(){const te=this.resume(),ge=this.stack[this.stack.length-1];ge.url=te}function R(){const te=this.resume(),ge=this.stack[this.stack.length-1];ge.title=te}function q(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function de(te){const ge=this.resume(),Re=this.stack[this.stack.length-1];Re.label=ge,Re.identifier=hr(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function fe(te){this.data.characterReferenceType=te.type}function he(te){const ge=this.sliceSerialize(te),Re=this.data.characterReferenceType;let Ge;Re?(Ge=Gx(ge,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=Tp(ge);const tt=this.stack[this.stack.length-1];tt.value+=Ge}function Te(te){const ge=this.stack.pop();ge.position.end=Li(te.end)}function Le(te){U.call(this,te);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(te)}function et(te){U.call(this,te);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(te)}function Rt(){return{type:"blockquote",children:[]}}function an(){return{type:"code",lang:null,meta:null,value:""}}function qn(){return{type:"inlineCode",value:""}}function ar(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ce(){return{type:"emphasis",children:[]}}function be(){return{type:"heading",depth:0,children:[]}}function ve(){return{type:"break"}}function Ne(){return{type:"html",value:""}}function $e(){return{type:"image",title:null,url:"",alt:null}}function bt(){return{type:"link",title:null,url:"",children:[]}}function Vt(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function sr(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function Xt(){return{type:"paragraph",children:[]}}function Rr(){return{type:"strong",children:[]}}function wt(){return{type:"text",value:""}}function Ca(){return{type:"thematicBreak"}}}function Li(e){return{line:e.line,column:e.column,offset:e.offset}}function t0(e,t){let r=-1;for(;++r<t.length;){const a=t[r];Array.isArray(a)?t0(e,a):wN(e,a)}}function wN(e,t){let r;for(r in t)if(e0.call(t,r))switch(r){case"canContainEols":{const a=t[r];a&&e[r].push(...a);break}case"transforms":{const a=t[r];a&&e[r].push(...a);break}case"enter":case"exit":{const a=t[r];a&&Object.assign(e[r],a);break}}}function Rv(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Qo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Qo({start:t.start,end:t.end})+") is still open")}function kN(e){const t=this;t.parser=r;function r(a){return SN(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function TN(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function NN(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
53
|
-
`}]}function CN(e,t){const r=t.value?t.value+`
|
|
54
|
-
`:"",a={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(a.className=["language-"+o[0]]);let c={type:"element",tagName:"code",properties:a,children:[{type:"text",value:r}]};return t.meta&&(c.data={meta:t.meta}),e.patch(t,c),c=e.applyData(t,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(t,c),c}function AN(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ON(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function RN(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),o=Ps(a.toLowerCase()),c=e.footnoteOrder.indexOf(a);let u,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=c+1,d+=1,e.footnoteCounts.set(a,d);const h={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,m),e.applyData(t,m)}function MN(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function IN(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function n0(e,t){const r=t.referenceType;let a="]";if(r==="collapsed"?a+="[]":r==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const o=e.all(t),c=o[0];c&&c.type==="text"?c.value="["+c.value:o.unshift({type:"text",value:"["});const u=o[o.length-1];return u&&u.type==="text"?u.value+=a:o.push({type:"text",value:a}),o}function DN(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return n0(e,t);const o={src:Ps(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(o.title=a.title);const c={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,c),e.applyData(t,c)}function LN(e,t){const r={src:Ps(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const a={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,a),e.applyData(t,a)}function jN(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const a={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,a),e.applyData(t,a)}function zN(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return n0(e,t);const o={href:Ps(a.url||"")};a.title!==null&&a.title!==void 0&&(o.title=a.title);const c={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,c),e.applyData(t,c)}function BN(e,t){const r={href:Ps(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const a={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function UN(e,t,r){const a=e.all(t),o=r?PN(r):r0(t),c={},u=[];if(typeof t.checked=="boolean"){const b=a[0];let y;b&&b.type==="element"&&b.tagName==="p"?y=b:(y={type:"element",tagName:"p",properties:{},children:[]},a.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let d=-1;for(;++d<a.length;){const b=a[d];(o||d!==0||b.type!=="element"||b.tagName!=="p")&&u.push({type:"text",value:`
|
|
55
|
-
`}),b.type==="element"&&b.tagName==="p"&&!o?u.push(...b.children):u.push(b)}const h=a[a.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
|
|
56
|
-
`});const m={type:"element",tagName:"li",properties:c,children:u};return e.patch(t,m),e.applyData(t,m)}function PN(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let a=-1;for(;!t&&++a<r.length;)t=r0(r[a])}return t}function r0(e){const t=e.spread;return t??e.children.length>1}function HN(e,t){const r={},a=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++o<a.length;){const u=a[o];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const c={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(a,!0)};return e.patch(t,c),e.applyData(t,c)}function FN(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function $N(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function GN(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function KN(e,t){const r=e.all(t),a=r.shift(),o=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),o.push(u)}if(r.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},d=Ep(t.children[1]),h=jx(t.children[t.children.length-1]);d&&h&&(u.position={start:d,end:h}),o.push(u)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,c),e.applyData(t,c)}function qN(e,t,r){const a=r?r.children:void 0,c=(a?a.indexOf(t):1)===0?"th":"td",u=r&&r.type==="table"?r.align:void 0,d=u?u.length:t.children.length;let h=-1;const m=[];for(;++h<d;){const y=t.children[h],v={},x=u?u[h]:void 0;x&&(v.align=x);let _={type:"element",tagName:c,properties:v,children:[]};y&&(_.children=e.all(y),e.patch(y,_),_=e.applyData(y,_)),m.push(_)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,b),e.applyData(t,b)}function VN(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const Mv=9,Iv=32;function YN(e){const t=String(e),r=/\r?\n|\r/g;let a=r.exec(t),o=0;const c=[];for(;a;)c.push(Dv(t.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=r.exec(t);return c.push(Dv(t.slice(o),o>0,!1)),c.join("")}function Dv(e,t,r){let a=0,o=e.length;if(t){let c=e.codePointAt(a);for(;c===Mv||c===Iv;)a++,c=e.codePointAt(a)}if(r){let c=e.codePointAt(o-1);for(;c===Mv||c===Iv;)o--,c=e.codePointAt(o-1)}return o>a?e.slice(a,o):""}function WN(e,t){const r={type:"text",value:YN(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function XN(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const ZN={blockquote:TN,break:NN,code:CN,delete:AN,emphasis:ON,footnoteReference:RN,heading:MN,html:IN,imageReference:DN,image:LN,inlineCode:jN,linkReference:zN,link:BN,listItem:UN,list:HN,paragraph:FN,root:$N,strong:GN,table:KN,tableCell:VN,tableRow:qN,text:WN,thematicBreak:XN,toml:Vc,yaml:Vc,definition:Vc,footnoteDefinition:Vc};function Vc(){}const i0=-1,Iu=0,tl=1,bu=2,Cp=3,Ap=4,Op=5,Rp=6,a0=7,s0=8,Lv=typeof self=="object"?self:globalThis,JN=(e,t)=>{const r=(o,c)=>(e.set(c,o),o),a=o=>{if(e.has(o))return e.get(o);const[c,u]=t[o];switch(c){case Iu:case i0:return r(u,o);case tl:{const d=r([],o);for(const h of u)d.push(a(h));return d}case bu:{const d=r({},o);for(const[h,m]of u)d[a(h)]=a(m);return d}case Cp:return r(new Date(u),o);case Ap:{const{source:d,flags:h}=u;return r(new RegExp(d,h),o)}case Op:{const d=r(new Map,o);for(const[h,m]of u)d.set(a(h),a(m));return d}case Rp:{const d=r(new Set,o);for(const h of u)d.add(a(h));return d}case a0:{const{name:d,message:h}=u;return r(new Lv[d](h),o)}case s0:return r(BigInt(u),o);case"BigInt":return r(Object(BigInt(u)),o);case"ArrayBuffer":return r(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:d}=new Uint8Array(u);return r(new DataView(d),u)}}return r(new Lv[c](u),o)};return a},jv=e=>JN(new Map,e)(0),gs="",{toString:QN}={},{keys:eC}=Object,Fo=e=>{const t=typeof e;if(t!=="object"||!e)return[Iu,t];const r=QN.call(e).slice(8,-1);switch(r){case"Array":return[tl,gs];case"Object":return[bu,gs];case"Date":return[Cp,gs];case"RegExp":return[Ap,gs];case"Map":return[Op,gs];case"Set":return[Rp,gs];case"DataView":return[tl,r]}return r.includes("Array")?[tl,r]:r.includes("Error")?[a0,r]:[bu,r]},Yc=([e,t])=>e===Iu&&(t==="function"||t==="symbol"),tC=(e,t,r,a)=>{const o=(u,d)=>{const h=a.push(u)-1;return r.set(d,h),h},c=u=>{if(r.has(u))return r.get(u);let[d,h]=Fo(u);switch(d){case Iu:{let b=u;switch(h){case"bigint":d=s0,b=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);b=null;break;case"undefined":return o([i0],u)}return o([d,b],u)}case tl:{if(h){let v=u;return h==="DataView"?v=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(u)),o([h,[...v]],u)}const b=[],y=o([d,b],u);for(const v of u)b.push(c(v));return y}case bu:{if(h)switch(h){case"BigInt":return o([h,u.toString()],u);case"Boolean":case"Number":case"String":return o([h,u.valueOf()],u)}if(t&&"toJSON"in u)return c(u.toJSON());const b=[],y=o([d,b],u);for(const v of eC(u))(e||!Yc(Fo(u[v])))&&b.push([c(v),c(u[v])]);return y}case Cp:return o([d,u.toISOString()],u);case Ap:{const{source:b,flags:y}=u;return o([d,{source:b,flags:y}],u)}case Op:{const b=[],y=o([d,b],u);for(const[v,x]of u)(e||!(Yc(Fo(v))||Yc(Fo(x))))&&b.push([c(v),c(x)]);return y}case Rp:{const b=[],y=o([d,b],u);for(const v of u)(e||!Yc(Fo(v)))&&b.push(c(v));return y}}const{message:m}=u;return o([d,{name:h,message:m}],u)};return c},zv=(e,{json:t,lossy:r}={})=>{const a=[];return tC(!(t||r),!!t,new Map,a)(e),a},yu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?jv(zv(e,t)):structuredClone(e):(e,t)=>jv(zv(e,t));function nC(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function rC(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function iC(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||nC,a=e.options.footnoteBackLabel||rC,o=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const b=e.all(m),y=String(m.identifier).toUpperCase(),v=Ps(y.toLowerCase());let x=0;const _=[],S=e.footnoteCounts.get(y);for(;S!==void 0&&++x<=S;){_.length>0&&_.push({type:"text",value:" "});let D=typeof r=="string"?r:r(h,x);typeof D=="string"&&(D={type:"text",value:D}),_.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,x),className:["data-footnote-backref"]},children:Array.isArray(D)?D:[D]})}const O=b[b.length-1];if(O&&O.type==="element"&&O.tagName==="p"){const D=O.children[O.children.length-1];D&&D.type==="text"?D.value+=" ":O.children.push({type:"text",value:" "}),O.children.push(..._)}else b.push(..._);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(b,!0)};e.patch(m,k),d.push(k)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...yu(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
57
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
58
|
-
`}]}}const vl=(function(e){if(e==null)return lC;if(typeof e=="function")return Du(e);if(typeof e=="object")return Array.isArray(e)?aC(e):sC(e);if(typeof e=="string")return oC(e);throw new Error("Expected function, string, or object as test")});function aC(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=vl(e[r]);return Du(a);function a(...o){let c=-1;for(;++c<t.length;)if(t[c].apply(this,o))return!0;return!1}}function sC(e){const t=e;return Du(r);function r(a){const o=a;let c;for(c in e)if(o[c]!==t[c])return!1;return!0}}function oC(e){return Du(t);function t(r){return r&&r.type===e}}function Du(e){return t;function t(r,a,o){return!!(cC(r)&&e.call(this,r,typeof a=="number"?a:void 0,o||void 0))}}function lC(){return!0}function cC(e){return e!==null&&typeof e=="object"&&"type"in e}const o0=[],uC=!0,qh=!1,dC="skip";function l0(e,t,r,a){let o;typeof t=="function"&&typeof r!="function"?(a=r,r=t):o=t;const c=vl(o),u=a?-1:1;d(e,void 0,[])();function d(h,m,b){const y=h&&typeof h=="object"?h:{};if(typeof y.type=="string"){const x=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(x?"<"+x+">":""))+")"})}return v;function v(){let x=o0,_,S,O;if((!t||c(h,m,b[b.length-1]||void 0))&&(x=fC(r(h,b)),x[0]===qh))return x;if("children"in h&&h.children){const k=h;if(k.children&&x[0]!==dC)for(S=(a?k.children.length:-1)+u,O=b.concat(k);S>-1&&S<k.children.length;){const D=k.children[S];if(_=d(D,S,O)(),_[0]===qh)return _;S=typeof _[1]=="number"?_[1]:S+u}}return x}}}function fC(e){return Array.isArray(e)?e:typeof e=="number"?[uC,e]:e==null?o0:[e]}function Lu(e,t,r,a){let o,c,u;typeof t=="function"&&typeof r!="function"?(c=void 0,u=t,o=r):(c=t,u=r,o=a),l0(e,c,d,o);function d(h,m){const b=m[m.length-1],y=b?b.children.indexOf(h):void 0;return u(h,y,b)}}const Vh={}.hasOwnProperty,hC={};function pC(e,t){const r=t||hC,a=new Map,o=new Map,c=new Map,u={...ZN,...r.handlers},d={all:m,applyData:gC,definitionById:a,footnoteById:o,footnoteCounts:c,footnoteOrder:[],handlers:u,one:h,options:r,patch:mC,wrap:yC};return Lu(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const y=b.type==="definition"?a:o,v=String(b.identifier).toUpperCase();y.has(v)||y.set(v,b)}}),d;function h(b,y){const v=b.type,x=d.handlers[v];if(Vh.call(d.handlers,v)&&x)return x(d,b,y);if(d.options.passThrough&&d.options.passThrough.includes(v)){if("children"in b){const{children:S,...O}=b,k=yu(O);return k.children=d.all(b),k}return yu(b)}return(d.options.unknownHandler||bC)(d,b,y)}function m(b){const y=[];if("children"in b){const v=b.children;let x=-1;for(;++x<v.length;){const _=d.one(v[x],b);if(_){if(x&&v[x-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=Bv(_.value)),!Array.isArray(_)&&_.type==="element")){const S=_.children[0];S&&S.type==="text"&&(S.value=Bv(S.value))}Array.isArray(_)?y.push(..._):y.push(_)}}}return y}}function mC(e,t){e.position&&(t.position=r2(e))}function gC(e,t){let r=t;if(e&&e.data){const a=e.data.hName,o=e.data.hChildren,c=e.data.hProperties;if(typeof a=="string")if(r.type==="element")r.tagName=a;else{const u="children"in r?r.children:[r];r={type:"element",tagName:a,properties:{},children:u}}r.type==="element"&&c&&Object.assign(r.properties,yu(c)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function bC(e,t){const r=t.data||{},a="value"in t&&!(Vh.call(r,"hProperties")||Vh.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function yC(e,t){const r=[];let a=-1;for(t&&r.push({type:"text",value:`
|
|
59
|
-
`});++a<e.length;)a&&r.push({type:"text",value:`
|
|
60
|
-
`}),r.push(e[a]);return t&&e.length>0&&r.push({type:"text",value:`
|
|
61
|
-
`}),r}function Bv(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function Uv(e,t){const r=pC(e,t),a=r.one(e,void 0),o=iC(r),c=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&c.children.push({type:"text",value:`
|
|
62
|
-
`},o),c}function vC(e,t){return e&&"run"in e?async function(r,a){const o=Uv(r,{file:a,...t});await e.run(o,a)}:function(r,a){return Uv(r,{file:a,...e||t})}}function Pv(e){if(e)throw e}var ih,Hv;function xC(){if(Hv)return ih;Hv=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},c=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var b=e.call(m,"constructor"),y=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!b&&!y)return!1;var v;for(v in m);return typeof v>"u"||e.call(m,v)},u=function(m,b){r&&b.name==="__proto__"?r(m,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):m[b.name]=b.newValue},d=function(m,b){if(b==="__proto__")if(e.call(m,b)){if(a)return a(m,b).value}else return;return m[b]};return ih=function h(){var m,b,y,v,x,_,S=arguments[0],O=1,k=arguments.length,D=!1;for(typeof S=="boolean"&&(D=S,S=arguments[1]||{},O=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});O<k;++O)if(m=arguments[O],m!=null)for(b in m)y=d(S,b),v=d(m,b),S!==v&&(D&&v&&(c(v)||(x=o(v)))?(x?(x=!1,_=y&&o(y)?y:[]):_=y&&c(y)?y:{},u(S,{name:b,newValue:h(D,_,v)})):typeof v<"u"&&u(S,{name:b,newValue:v}));return S},ih}var EC=xC();const ah=gl(EC);function Yh(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function SC(){const e=[],t={run:r,use:a};return t;function r(...o){let c=-1;const u=o.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);d(null,...o);function d(h,...m){const b=e[++c];let y=-1;if(h){u(h);return}for(;++y<o.length;)(m[y]===null||m[y]===void 0)&&(m[y]=o[y]);o=m,b?_C(b,d)(...m):u(null,...m)}}function a(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function _C(e,t){let r;return a;function a(...u){const d=e.length>u.length;let h;d&&u.push(o);try{h=e.apply(this,u)}catch(m){const b=m;if(d&&r)throw b;return o(b)}d||(h&&h.then&&typeof h.then=="function"?h.then(c,o):h instanceof Error?o(h):c(h))}function o(u,...d){r||(r=!0,t(u,...d))}function c(u){o(null,u)}}const wr={basename:wC,dirname:kC,extname:TC,join:NC,sep:"/"};function wC(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');xl(e);let r=0,a=-1,o=e.length,c;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(c){r=o+1;break}}else a<0&&(c=!0,a=o+1);return a<0?"":e.slice(r,a)}if(t===e)return"";let u=-1,d=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(c){r=o+1;break}}else u<0&&(c=!0,u=o+1),d>-1&&(e.codePointAt(o)===t.codePointAt(d--)?d<0&&(a=o):(d=-1,a=u));return r===a?a=u:a<0&&(a=e.length),e.slice(r,a)}function kC(e){if(xl(e),e.length===0)return".";let t=-1,r=e.length,a;for(;--r;)if(e.codePointAt(r)===47){if(a){t=r;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function TC(e){xl(e);let t=e.length,r=-1,a=0,o=-1,c=0,u;for(;t--;){const d=e.codePointAt(t);if(d===47){if(u){a=t+1;break}continue}r<0&&(u=!0,r=t+1),d===46?o<0?o=t:c!==1&&(c=1):o>-1&&(c=-1)}return o<0||r<0||c===0||c===1&&o===r-1&&o===a+1?"":e.slice(o,r)}function NC(...e){let t=-1,r;for(;++t<e.length;)xl(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":CC(r)}function CC(e){xl(e);const t=e.codePointAt(0)===47;let r=AC(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function AC(e,t){let r="",a=0,o=-1,c=0,u=-1,d,h;for(;++u<=e.length;){if(u<e.length)d=e.codePointAt(u);else{if(d===47)break;d=47}if(d===47){if(!(o===u-1||c===1))if(o!==u-1&&c===2){if(r.length<2||a!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",a=0):(r=r.slice(0,h),a=r.length-1-r.lastIndexOf("/")),o=u,c=0;continue}}else if(r.length>0){r="",a=0,o=u,c=0;continue}}t&&(r=r.length>0?r+"/..":"..",a=2)}else r.length>0?r+="/"+e.slice(o+1,u):r=e.slice(o+1,u),a=u-o-1;o=u,c=0}else d===46&&c>-1?c++:c=-1}return r}function xl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const OC={cwd:RC};function RC(){return"/"}function Wh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function MC(e){if(typeof e=="string")e=new URL(e);else if(!Wh(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(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return IC(e)}function IC(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const a=t.codePointAt(r+2);if(a===70||a===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const sh=["history","path","basename","stem","extname","dirname"];class c0{constructor(t){let r;t?Wh(t)?r={path:t}:typeof t=="string"||DC(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":OC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<sh.length;){const c=sh[a];c in r&&r[c]!==void 0&&r[c]!==null&&(this[c]=c==="history"?[...r[c]]:r[c])}let o;for(o in r)sh.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?wr.basename(this.path):void 0}set basename(t){lh(t,"basename"),oh(t,"basename"),this.path=wr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?wr.dirname(this.path):void 0}set dirname(t){Fv(this.basename,"dirname"),this.path=wr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?wr.extname(this.path):void 0}set extname(t){if(oh(t,"extname"),Fv(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=wr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Wh(t)&&(t=MC(t)),lh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?wr.basename(this.path,this.extname):void 0}set stem(t){lh(t,"stem"),oh(t,"stem"),this.path=wr.join(this.dirname||"",t+(this.extname||""))}fail(t,r,a){const o=this.message(t,r,a);throw o.fatal=!0,o}info(t,r,a){const o=this.message(t,r,a);return o.fatal=void 0,o}message(t,r,a){const o=new dn(t,r,a);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function oh(e,t){if(e&&e.includes(wr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+wr.sep+"`")}function lh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Fv(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function DC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const LC=(function(e){const a=this.constructor.prototype,o=a[e],c=function(){return o.apply(c,arguments)};return Object.setPrototypeOf(c,a),c}),jC={}.hasOwnProperty;class Mp extends LC{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=SC()}copy(){const t=new Mp;let r=-1;for(;++r<this.attachers.length;){const a=this.attachers[r];t.use(...a)}return t.data(ah(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(dh("data",this.frozen),this.namespace[t]=r,this):jC.call(this.namespace,t)&&this.namespace[t]||void 0:t?(dh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const o=r.call(t,...a);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=Wc(t),a=this.parser||this.Parser;return ch("parse",a),a(String(r),r)}process(t,r){const a=this;return this.freeze(),ch("process",this.parser||this.Parser),uh("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(c,u){const d=Wc(t),h=a.parse(d);a.run(h,d,function(b,y,v){if(b||!y||!v)return m(b);const x=y,_=a.stringify(x,v);UC(_)?v.value=_:v.result=_,m(b,v)});function m(b,y){b||!y?u(b):c?c(y):r(void 0,y)}}}processSync(t){let r=!1,a;return this.freeze(),ch("processSync",this.parser||this.Parser),uh("processSync",this.compiler||this.Compiler),this.process(t,o),Gv("processSync","process",r),a;function o(c,u){r=!0,Pv(c),a=u}}run(t,r,a){$v(t),this.freeze();const o=this.transformers;return!a&&typeof r=="function"&&(a=r,r=void 0),a?c(void 0,a):new Promise(c);function c(u,d){const h=Wc(r);o.run(t,h,m);function m(b,y,v){const x=y||t;b?d(b):u?u(x):a(void 0,x,v)}}}runSync(t,r){let a=!1,o;return this.run(t,r,c),Gv("runSync","run",a),o;function c(u,d){Pv(u),o=d,a=!0}}stringify(t,r){this.freeze();const a=Wc(r),o=this.compiler||this.Compiler;return uh("stringify",o),$v(t),o(t,a)}use(t,...r){const a=this.attachers,o=this.namespace;if(dh("use",this.frozen),t!=null)if(typeof t=="function")h(t,r);else if(typeof t=="object")Array.isArray(t)?d(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function c(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[b,...y]=m;h(b,y)}else u(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function u(m){if(!("plugins"in m)&&!("settings"in m))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");d(m.plugins),m.settings&&(o.settings=ah(!0,o.settings,m.settings))}function d(m){let b=-1;if(m!=null)if(Array.isArray(m))for(;++b<m.length;){const y=m[b];c(y)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,b){let y=-1,v=-1;for(;++y<a.length;)if(a[y][0]===m){v=y;break}if(v===-1)a.push([m,...b]);else if(b.length>0){let[x,..._]=b;const S=a[v][1];Yh(S)&&Yh(x)&&(x=ah(!0,S,x)),a[v]=[m,x,..._]}}}}const zC=new Mp().freeze();function ch(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function uh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function dh(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 $v(e){if(!Yh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Gv(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Wc(e){return BC(e)?e:new c0(e)}function BC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function UC(e){return typeof e=="string"||PC(e)}function PC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const HC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Kv=[],qv={allowDangerousHtml:!0},FC=/^(https?|ircs?|mailto|xmpp)$/i,$C=[{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 u0(e){const t=GC(e),r=KC(e);return qC(t.runSync(t.parse(r),r),e)}function GC(e){const t=e.rehypePlugins||Kv,r=e.remarkPlugins||Kv,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...qv}:qv;return zC().use(kN).use(r).use(vC,a).use(t)}function KC(e){const t=e.children||"",r=new c0;return typeof t=="string"&&(r.value=t),r}function qC(e,t){const r=t.allowedElements,a=t.allowElement,o=t.components,c=t.disallowedElements,u=t.skipHtml,d=t.unwrapDisallowed,h=t.urlTransform||VC;for(const b of $C)Object.hasOwn(t,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+HC+b.id,void 0);return Lu(e,m),l2(e,{Fragment:p.Fragment,components:o,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function m(b,y,v){if(b.type==="raw"&&v&&typeof y=="number")return u?v.children.splice(y,1):v.children[y]={type:"text",value:b.value},y;if(b.type==="element"){let x;for(x in th)if(Object.hasOwn(th,x)&&Object.hasOwn(b.properties,x)){const _=b.properties[x],S=th[x];(S===null||S.includes(b.tagName))&&(b.properties[x]=h(String(_||""),x,b))}}if(b.type==="element"){let x=r?!r.includes(b.tagName):c?c.includes(b.tagName):!1;if(!x&&a&&typeof y=="number"&&(x=!a(b,y,v)),x&&v&&typeof y=="number")return d&&b.children?v.children.splice(y,1,...b.children):v.children.splice(y,1),y}}}function VC(e){const t=e.indexOf(":"),r=e.indexOf("?"),a=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||r!==-1&&t>r||a!==-1&&t>a||FC.test(e.slice(0,t))?e:""}function Vv(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,o=r.indexOf(t);for(;o!==-1;)a++,o=r.indexOf(t,o+t.length);return a}function YC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function WC(e,t,r){const o=vl((r||{}).ignore||[]),c=XC(t);let u=-1;for(;++u<c.length;)l0(e,"text",d);function d(m,b){let y=-1,v;for(;++y<b.length;){const x=b[y],_=v?v.children:void 0;if(o(x,_?_.indexOf(x):void 0,v))return;v=x}if(v)return h(m,b)}function h(m,b){const y=b[b.length-1],v=c[u][0],x=c[u][1];let _=0;const O=y.children.indexOf(m);let k=!1,D=[];v.lastIndex=0;let w=v.exec(m.value);for(;w;){const A=w.index,L={index:w.index,input:w.input,stack:[...b,m]};let M=x(...w,L);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?v.lastIndex=A+1:(_!==A&&D.push({type:"text",value:m.value.slice(_,A)}),Array.isArray(M)?D.push(...M):M&&D.push(M),_=A+w[0].length,k=!0),!v.global)break;w=v.exec(m.value)}return k?(_<m.value.length&&D.push({type:"text",value:m.value.slice(_)}),y.children.splice(O,1,...D)):D=[m],O+D.length}}function XC(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<r.length;){const o=r[a];t.push([ZC(o[0]),JC(o[1])])}return t}function ZC(e){return typeof e=="string"?new RegExp(YC(e),"g"):e}function JC(e){return typeof e=="function"?e:function(){return e}}const fh="phrasing",hh=["autolink","link","image","label"];function QC(){return{transforms:[sA],enter:{literalAutolink:tA,literalAutolinkEmail:ph,literalAutolinkHttp:ph,literalAutolinkWww:ph},exit:{literalAutolink:aA,literalAutolinkEmail:iA,literalAutolinkHttp:nA,literalAutolinkWww:rA}}}function eA(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:fh,notInConstruct:hh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:fh,notInConstruct:hh},{character:":",before:"[ps]",after:"\\/",inConstruct:fh,notInConstruct:hh}]}}function tA(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ph(e){this.config.enter.autolinkProtocol.call(this,e)}function nA(e){this.config.exit.autolinkProtocol.call(this,e)}function rA(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function iA(e){this.config.exit.autolinkEmail.call(this,e)}function aA(e){this.exit(e)}function sA(e){WC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,oA],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),lA]],{ignore:["link","linkReference"]})}function oA(e,t,r,a,o){let c="";if(!d0(o)||(/^w/i.test(t)&&(r=t+r,t="",c="http://"),!cA(r)))return!1;const u=uA(r+a);if(!u[0])return!1;const d={type:"link",title:null,url:c+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[d,{type:"text",value:u[1]}]:d}function lA(e,t,r,a){return!d0(a,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function cA(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function uA(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],a=r.indexOf(")");const o=Vv(e,"(");let c=Vv(e,")");for(;a!==-1&&o>c;)e+=r.slice(0,a+1),r=r.slice(a+1),a=r.indexOf(")"),c++;return[e,r]}function d0(e,t){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Sa(r)||Ru(r))&&(!t||r!==47)}f0.peek=vA;function dA(){this.buffer()}function fA(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function hA(){this.buffer()}function pA(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mA(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=hr(this.sliceSerialize(e)).toLowerCase(),r.label=t}function gA(e){this.exit(e)}function bA(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=hr(this.sliceSerialize(e)).toLowerCase(),r.label=t}function yA(e){this.exit(e)}function vA(){return"["}function f0(e,t,r,a){const o=r.createTracker(a);let c=o.move("[^");const u=r.enter("footnoteReference"),d=r.enter("reference");return c+=o.move(r.safe(r.associationId(e),{after:"]",before:c})),d(),u(),c+=o.move("]"),c}function xA(){return{enter:{gfmFootnoteCallString:dA,gfmFootnoteCall:fA,gfmFootnoteDefinitionLabelString:hA,gfmFootnoteDefinition:pA},exit:{gfmFootnoteCallString:mA,gfmFootnoteCall:gA,gfmFootnoteDefinitionLabelString:bA,gfmFootnoteDefinition:yA}}}function EA(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:f0},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(a,o,c,u){const d=c.createTracker(u);let h=d.move("[^");const m=c.enter("footnoteDefinition"),b=c.enter("label");return h+=d.move(c.safe(c.associationId(a),{before:h,after:"]"})),b(),h+=d.move("]:"),a.children&&a.children.length>0&&(d.shift(4),h+=d.move((t?`
|
|
63
|
-
`:" ")+c.indentLines(c.containerFlow(a,d.current()),t?h0:SA))),m(),h}}function SA(e,t,r){return t===0?e:h0(e,t,r)}function h0(e,t,r){return(r?"":" ")+e}const _A=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];p0.peek=CA;function wA(){return{canContainEols:["delete"],enter:{strikethrough:TA},exit:{strikethrough:NA}}}function kA(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:_A}],handlers:{delete:p0}}}function TA(e){this.enter({type:"delete",children:[]},e)}function NA(e){this.exit(e)}function p0(e,t,r,a){const o=r.createTracker(a),c=r.enter("strikethrough");let u=o.move("~~");return u+=r.containerPhrasing(e,{...o.current(),before:u,after:"~"}),u+=o.move("~~"),c(),u}function CA(){return"~"}function AA(e){return e.length}function OA(e,t){const r=t||{},a=(r.align||[]).concat(),o=r.stringLength||AA,c=[],u=[],d=[],h=[];let m=0,b=-1;for(;++b<e.length;){const S=[],O=[];let k=-1;for(e[b].length>m&&(m=e[b].length);++k<e[b].length;){const D=RA(e[b][k]);if(r.alignDelimiters!==!1){const w=o(D);O[k]=w,(h[k]===void 0||w>h[k])&&(h[k]=w)}S.push(D)}u[b]=S,d[b]=O}let y=-1;if(typeof a=="object"&&"length"in a)for(;++y<m;)c[y]=Yv(a[y]);else{const S=Yv(a);for(;++y<m;)c[y]=S}y=-1;const v=[],x=[];for(;++y<m;){const S=c[y];let O="",k="";S===99?(O=":",k=":"):S===108?O=":":S===114&&(k=":");let D=r.alignDelimiters===!1?1:Math.max(1,h[y]-O.length-k.length);const w=O+"-".repeat(D)+k;r.alignDelimiters!==!1&&(D=O.length+D+k.length,D>h[y]&&(h[y]=D),x[y]=D),v[y]=w}u.splice(1,0,v),d.splice(1,0,x),b=-1;const _=[];for(;++b<u.length;){const S=u[b],O=d[b];y=-1;const k=[];for(;++y<m;){const D=S[y]||"";let w="",A="";if(r.alignDelimiters!==!1){const L=h[y]-(O[y]||0),M=c[y];M===114?w=" ".repeat(L):M===99?L%2?(w=" ".repeat(L/2+.5),A=" ".repeat(L/2-.5)):(w=" ".repeat(L/2),A=w):A=" ".repeat(L)}r.delimiterStart!==!1&&!y&&k.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&D==="")&&(r.delimiterStart!==!1||y)&&k.push(" "),r.alignDelimiters!==!1&&k.push(w),k.push(D),r.alignDelimiters!==!1&&k.push(A),r.padding!==!1&&k.push(" "),(r.delimiterEnd!==!1||y!==m-1)&&k.push("|")}_.push(r.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return _.join(`
|
|
64
|
-
`)}function RA(e){return e==null?"":String(e)}function Yv(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function MA(e,t,r,a){const o=r.enter("blockquote"),c=r.createTracker(a);c.move("> "),c.shift(2);const u=r.indentLines(r.containerFlow(e,c.current()),IA);return o(),u}function IA(e,t,r){return">"+(r?"":" ")+e}function DA(e,t){return Wv(e,t.inConstruct,!0)&&!Wv(e,t.notInConstruct,!1)}function Wv(e,t,r){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return r;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function Xv(e,t,r,a){let o=-1;for(;++o<r.unsafe.length;)if(r.unsafe[o].character===`
|
|
65
|
-
`&&DA(r.stack,r.unsafe[o]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
66
|
-
`}function LA(e,t){const r=String(e);let a=r.indexOf(t),o=a,c=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===o?++c>u&&(u=c):c=1,o=a+t.length,a=r.indexOf(t,o);return u}function jA(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function zA(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function BA(e,t,r,a){const o=zA(r),c=e.value||"",u=o==="`"?"GraveAccent":"Tilde";if(jA(e,r)){const y=r.enter("codeIndented"),v=r.indentLines(c,UA);return y(),v}const d=r.createTracker(a),h=o.repeat(Math.max(LA(c,o)+1,3)),m=r.enter("codeFenced");let b=d.move(h);if(e.lang){const y=r.enter(`codeFencedLang${u}`);b+=d.move(r.safe(e.lang,{before:b,after:" ",encode:["`"],...d.current()})),y()}if(e.lang&&e.meta){const y=r.enter(`codeFencedMeta${u}`);b+=d.move(" "),b+=d.move(r.safe(e.meta,{before:b,after:`
|
|
67
|
-
`,encode:["`"],...d.current()})),y()}return b+=d.move(`
|
|
68
|
-
`),c&&(b+=d.move(c+`
|
|
69
|
-
`)),b+=d.move(h),m(),b}function UA(e,t,r){return(r?"":" ")+e}function Ip(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function PA(e,t,r,a){const o=Ip(r),c=o==='"'?"Quote":"Apostrophe",u=r.enter("definition");let d=r.enter("label");const h=r.createTracker(a);let m=h.move("[");return m+=h.move(r.safe(r.associationId(e),{before:m,after:"]",...h.current()})),m+=h.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=r.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(r.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(d=r.enter("destinationRaw"),m+=h.move(r.safe(e.url,{before:m,after:e.title?" ":`
|
|
70
|
-
`,...h.current()}))),d(),e.title&&(d=r.enter(`title${c}`),m+=h.move(" "+o),m+=h.move(r.safe(e.title,{before:m,after:o,...h.current()})),m+=h.move(o),d()),u(),m}function HA(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function dl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function vu(e,t,r){const a=Ds(e),o=Ds(t);return a===void 0?o===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}m0.peek=FA;function m0(e,t,r,a){const o=HA(r),c=r.enter("emphasis"),u=r.createTracker(a),d=u.move(o);let h=u.move(r.containerPhrasing(e,{after:o,before:d,...u.current()}));const m=h.charCodeAt(0),b=vu(a.before.charCodeAt(a.before.length-1),m,o);b.inside&&(h=dl(m)+h.slice(1));const y=h.charCodeAt(h.length-1),v=vu(a.after.charCodeAt(0),y,o);v.inside&&(h=h.slice(0,-1)+dl(y));const x=u.move(o);return c(),r.attentionEncodeSurroundingInfo={after:v.outside,before:b.outside},d+h+x}function FA(e,t,r){return r.options.emphasis||"*"}function $A(e,t){let r=!1;return Lu(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return r=!0,qh}),!!((!e.depth||e.depth<3)&&kp(e)&&(t.options.setext||r))}function GA(e,t,r,a){const o=Math.max(Math.min(6,e.depth||1),1),c=r.createTracker(a);if($A(e,r)){const b=r.enter("headingSetext"),y=r.enter("phrasing"),v=r.containerPhrasing(e,{...c.current(),before:`
|
|
71
|
-
`,after:`
|
|
72
|
-
`});return y(),b(),v+`
|
|
73
|
-
`+(o===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
|
74
|
-
`))+1))}const u="#".repeat(o),d=r.enter("headingAtx"),h=r.enter("phrasing");c.move(u+" ");let m=r.containerPhrasing(e,{before:"# ",after:`
|
|
75
|
-
`,...c.current()});return/^[\t ]/.test(m)&&(m=dl(m.charCodeAt(0))+m.slice(1)),m=m?u+" "+m:u,r.options.closeAtx&&(m+=" "+u),h(),d(),m}g0.peek=KA;function g0(e){return e.value||""}function KA(){return"<"}b0.peek=qA;function b0(e,t,r,a){const o=Ip(r),c=o==='"'?"Quote":"Apostrophe",u=r.enter("image");let d=r.enter("label");const h=r.createTracker(a);let m=h.move("![");return m+=h.move(r.safe(e.alt,{before:m,after:"]",...h.current()})),m+=h.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=r.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(r.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(d=r.enter("destinationRaw"),m+=h.move(r.safe(e.url,{before:m,after:e.title?" ":")",...h.current()}))),d(),e.title&&(d=r.enter(`title${c}`),m+=h.move(" "+o),m+=h.move(r.safe(e.title,{before:m,after:o,...h.current()})),m+=h.move(o),d()),m+=h.move(")"),u(),m}function qA(){return"!"}y0.peek=VA;function y0(e,t,r,a){const o=e.referenceType,c=r.enter("imageReference");let u=r.enter("label");const d=r.createTracker(a);let h=d.move("![");const m=r.safe(e.alt,{before:h,after:"]",...d.current()});h+=d.move(m+"]["),u();const b=r.stack;r.stack=[],u=r.enter("reference");const y=r.safe(r.associationId(e),{before:h,after:"]",...d.current()});return u(),r.stack=b,c(),o==="full"||!m||m!==y?h+=d.move(y+"]"):o==="shortcut"?h=h.slice(0,-1):h+=d.move("]"),h}function VA(){return"!"}v0.peek=YA;function v0(e,t,r){let a=e.value||"",o="`",c=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(a);)o+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++c<r.unsafe.length;){const u=r.unsafe[c],d=r.compilePattern(u);let h;if(u.atBreak)for(;h=d.exec(a);){let m=h.index;a.charCodeAt(m)===10&&a.charCodeAt(m-1)===13&&m--,a=a.slice(0,m)+" "+a.slice(h.index+1)}}return o+a+o}function YA(){return"`"}function x0(e,t){const r=kp(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}E0.peek=WA;function E0(e,t,r,a){const o=Ip(r),c=o==='"'?"Quote":"Apostrophe",u=r.createTracker(a);let d,h;if(x0(e,r)){const b=r.stack;r.stack=[],d=r.enter("autolink");let y=u.move("<");return y+=u.move(r.containerPhrasing(e,{before:y,after:">",...u.current()})),y+=u.move(">"),d(),r.stack=b,y}d=r.enter("link"),h=r.enter("label");let m=u.move("[");return m+=u.move(r.containerPhrasing(e,{before:m,after:"](",...u.current()})),m+=u.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=r.enter("destinationLiteral"),m+=u.move("<"),m+=u.move(r.safe(e.url,{before:m,after:">",...u.current()})),m+=u.move(">")):(h=r.enter("destinationRaw"),m+=u.move(r.safe(e.url,{before:m,after:e.title?" ":")",...u.current()}))),h(),e.title&&(h=r.enter(`title${c}`),m+=u.move(" "+o),m+=u.move(r.safe(e.title,{before:m,after:o,...u.current()})),m+=u.move(o),h()),m+=u.move(")"),d(),m}function WA(e,t,r){return x0(e,r)?"<":"["}S0.peek=XA;function S0(e,t,r,a){const o=e.referenceType,c=r.enter("linkReference");let u=r.enter("label");const d=r.createTracker(a);let h=d.move("[");const m=r.containerPhrasing(e,{before:h,after:"]",...d.current()});h+=d.move(m+"]["),u();const b=r.stack;r.stack=[],u=r.enter("reference");const y=r.safe(r.associationId(e),{before:h,after:"]",...d.current()});return u(),r.stack=b,c(),o==="full"||!m||m!==y?h+=d.move(y+"]"):o==="shortcut"?h=h.slice(0,-1):h+=d.move("]"),h}function XA(){return"["}function Dp(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function ZA(e){const t=Dp(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}function JA(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function _0(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function QA(e,t,r,a){const o=r.enter("list"),c=r.bulletCurrent;let u=e.ordered?JA(r):Dp(r);const d=e.ordered?u==="."?")":".":ZA(r);let h=t&&r.bulletLastUsed?u===r.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&b&&(!b.children||!b.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(h=!0),_0(r)===u&&b){let y=-1;for(;++y<e.children.length;){const v=e.children[y];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(u=d),r.bulletCurrent=u;const m=r.containerFlow(e,a);return r.bulletLastUsed=u,r.bulletCurrent=c,o(),m}function eO(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function tO(e,t,r,a){const o=eO(r);let c=r.bulletCurrent||Dp(r);t&&t.type==="list"&&t.ordered&&(c=(typeof t.start=="number"&&t.start>-1?t.start:1)+(r.options.incrementListMarker===!1?0:t.children.indexOf(e))+c);let u=c.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const d=r.createTracker(a);d.move(c+" ".repeat(u-c.length)),d.shift(u);const h=r.enter("listItem"),m=r.indentLines(r.containerFlow(e,d.current()),b);return h(),m;function b(y,v,x){return v?(x?"":" ".repeat(u))+y:(x?c:c+" ".repeat(u-c.length))+y}}function nO(e,t,r,a){const o=r.enter("paragraph"),c=r.enter("phrasing"),u=r.containerPhrasing(e,a);return c(),o(),u}const rO=vl(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function iO(e,t,r,a){return(e.children.some(function(u){return rO(u)})?r.containerPhrasing:r.containerFlow).call(r,e,a)}function aO(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}w0.peek=sO;function w0(e,t,r,a){const o=aO(r),c=r.enter("strong"),u=r.createTracker(a),d=u.move(o+o);let h=u.move(r.containerPhrasing(e,{after:o,before:d,...u.current()}));const m=h.charCodeAt(0),b=vu(a.before.charCodeAt(a.before.length-1),m,o);b.inside&&(h=dl(m)+h.slice(1));const y=h.charCodeAt(h.length-1),v=vu(a.after.charCodeAt(0),y,o);v.inside&&(h=h.slice(0,-1)+dl(y));const x=u.move(o+o);return c(),r.attentionEncodeSurroundingInfo={after:v.outside,before:b.outside},d+h+x}function sO(e,t,r){return r.options.strong||"*"}function oO(e,t,r,a){return r.safe(e.value,a)}function lO(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function cO(e,t,r){const a=(_0(r)+(r.options.ruleSpaces?" ":"")).repeat(lO(r));return r.options.ruleSpaces?a.slice(0,-1):a}const k0={blockquote:MA,break:Xv,code:BA,definition:PA,emphasis:m0,hardBreak:Xv,heading:GA,html:g0,image:b0,imageReference:y0,inlineCode:v0,link:E0,linkReference:S0,list:QA,listItem:tO,paragraph:nO,root:iO,strong:w0,text:oO,thematicBreak:cO};function uO(){return{enter:{table:dO,tableData:Zv,tableHeader:Zv,tableRow:hO},exit:{codeText:pO,table:fO,tableData:mh,tableHeader:mh,tableRow:mh}}}function dO(e){const t=e._align;this.enter({type:"table",align:t.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function fO(e){this.exit(e),this.data.inTable=void 0}function hO(e){this.enter({type:"tableRow",children:[]},e)}function mh(e){this.exit(e)}function Zv(e){this.enter({type:"tableCell",children:[]},e)}function pO(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,mO));const r=this.stack[this.stack.length-1];r.type,r.value=t,this.exit(e)}function mO(e,t){return t==="|"?t:e}function gO(e){const t=e||{},r=t.tableCellPadding,a=t.tablePipeAlign,o=t.stringLength,c=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
76
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:u,tableCell:h,tableRow:d}};function u(x,_,S,O){return m(b(x,S,O),x.align)}function d(x,_,S,O){const k=y(x,S,O),D=m([k]);return D.slice(0,D.indexOf(`
|
|
77
|
-
`))}function h(x,_,S,O){const k=S.enter("tableCell"),D=S.enter("phrasing"),w=S.containerPhrasing(x,{...O,before:c,after:c});return D(),k(),w}function m(x,_){return OA(x,{align:_,alignDelimiters:a,padding:r,stringLength:o})}function b(x,_,S){const O=x.children;let k=-1;const D=[],w=_.enter("table");for(;++k<O.length;)D[k]=y(O[k],_,S);return w(),D}function y(x,_,S){const O=x.children;let k=-1;const D=[],w=_.enter("tableRow");for(;++k<O.length;)D[k]=h(O[k],x,_,S);return w(),D}function v(x,_,S){let O=k0.inlineCode(x,_,S);return S.stack.includes("tableCell")&&(O=O.replace(/\|/g,"\\$&")),O}}function bO(){return{exit:{taskListCheckValueChecked:Jv,taskListCheckValueUnchecked:Jv,paragraph:vO}}}function yO(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:xO}}}function Jv(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function vO(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const a=r.children[0];if(a&&a.type==="text"){const o=t.children;let c=-1,u;for(;++c<o.length;){const d=o[c];if(d.type==="paragraph"){u=d;break}}u===r&&(a.value=a.value.slice(1),a.value.length===0?r.children.shift():r.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,r.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function xO(e,t,r,a){const o=e.children[0],c=typeof e.checked=="boolean"&&o&&o.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",d=r.createTracker(a);c&&d.move(u);let h=k0.listItem(e,t,r,{...a,...d.current()});return c&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),h;function m(b){return b+u}}function EO(){return[QC(),xA(),wA(),uO(),bO()]}function SO(e){return{extensions:[eA(),EA(e),kA(),gO(e),yO()]}}const _O={tokenize:AO,partial:!0},T0={tokenize:OO,partial:!0},N0={tokenize:RO,partial:!0},C0={tokenize:MO,partial:!0},wO={tokenize:IO,partial:!0},A0={name:"wwwAutolink",tokenize:NO,previous:R0},O0={name:"protocolAutolink",tokenize:CO,previous:M0},si={name:"emailAutolink",tokenize:TO,previous:I0},Or={};function kO(){return{text:Or}}let pa=48;for(;pa<123;)Or[pa]=si,pa++,pa===58?pa=65:pa===91&&(pa=97);Or[43]=si;Or[45]=si;Or[46]=si;Or[95]=si;Or[72]=[si,O0];Or[104]=[si,O0];Or[87]=[si,A0];Or[119]=[si,A0];function TO(e,t,r){const a=this;let o,c;return u;function u(y){return!Xh(y)||!I0.call(a,a.previous)||Lp(a.events)?r(y):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(y))}function d(y){return Xh(y)?(e.consume(y),d):y===64?(e.consume(y),h):r(y)}function h(y){return y===46?e.check(wO,b,m)(y):y===45||y===95||un(y)?(c=!0,e.consume(y),h):b(y)}function m(y){return e.consume(y),o=!0,h}function b(y){return c&&o&&yn(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(y)):r(y)}}function NO(e,t,r){const a=this;return o;function o(u){return u!==87&&u!==119||!R0.call(a,a.previous)||Lp(a.events)?r(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(_O,e.attempt(T0,e.attempt(N0,c),r),r)(u))}function c(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function CO(e,t,r){const a=this;let o="",c=!1;return u;function u(y){return(y===72||y===104)&&M0.call(a,a.previous)&&!Lp(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(y),e.consume(y),d):r(y)}function d(y){if(yn(y)&&o.length<5)return o+=String.fromCodePoint(y),e.consume(y),d;if(y===58){const v=o.toLowerCase();if(v==="http"||v==="https")return e.consume(y),h}return r(y)}function h(y){return y===47?(e.consume(y),c?m:(c=!0,h)):r(y)}function m(y){return y===null||gu(y)||Et(y)||Sa(y)||Ru(y)?r(y):e.attempt(T0,e.attempt(N0,b),r)(y)}function b(y){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(y)}}function AO(e,t,r){let a=0;return o;function o(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),o):u===46&&a===3?(e.consume(u),c):r(u)}function c(u){return u===null?r(u):t(u)}}function OO(e,t,r){let a,o,c;return u;function u(m){return m===46||m===95?e.check(C0,h,d)(m):m===null||Et(m)||Sa(m)||m!==45&&Ru(m)?h(m):(c=!0,e.consume(m),u)}function d(m){return m===95?a=!0:(o=a,a=void 0),e.consume(m),u}function h(m){return o||a||!c?r(m):t(m)}}function RO(e,t){let r=0,a=0;return o;function o(u){return u===40?(r++,e.consume(u),o):u===41&&a<r?c(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(C0,t,c)(u):u===null||Et(u)||Sa(u)?t(u):(e.consume(u),o)}function c(u){return u===41&&a++,e.consume(u),o}}function MO(e,t,r){return a;function a(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),a):d===38?(e.consume(d),c):d===93?(e.consume(d),o):d===60||d===null||Et(d)||Sa(d)?t(d):r(d)}function o(d){return d===null||d===40||d===91||Et(d)||Sa(d)?t(d):a(d)}function c(d){return yn(d)?u(d):r(d)}function u(d){return d===59?(e.consume(d),a):yn(d)?(e.consume(d),u):r(d)}}function IO(e,t,r){return a;function a(c){return e.consume(c),o}function o(c){return un(c)?r(c):t(c)}}function R0(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Et(e)}function M0(e){return!yn(e)}function I0(e){return!(e===47||Xh(e))}function Xh(e){return e===43||e===45||e===46||e===95||un(e)}function Lp(e){let t=e.length,r=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){r=!0;break}if(a._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const DO={tokenize:FO,partial:!0};function LO(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:UO,continuation:{tokenize:PO},exit:HO}},text:{91:{name:"gfmFootnoteCall",tokenize:BO},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:jO,resolveTo:zO}}}}function jO(e,t,r){const a=this;let o=a.events.length;const c=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;o--;){const h=a.events[o][1];if(h.type==="labelImage"){u=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return d;function d(h){if(!u||!u._balanced)return r(h);const m=hr(a.sliceSerialize({start:u.end,end:a.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?r(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function zO(e,t){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},d=[e[r+1],e[r+2],["enter",a,t],e[r+3],e[r+4],["enter",o,t],["exit",o,t],["enter",c,t],["enter",u,t],["exit",u,t],["exit",c,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(r,e.length-r+1,...d),e}function BO(e,t,r){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c=0,u;return d;function d(y){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),h}function h(y){return y!==94?r(y):(e.enter("gfmFootnoteCallMarker"),e.consume(y),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(y){if(c>999||y===93&&!u||y===null||y===91||Et(y))return r(y);if(y===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return o.includes(hr(a.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(y)}return Et(y)||(u=!0),c++,e.consume(y),y===92?b:m}function b(y){return y===91||y===92||y===93?(e.consume(y),c++,m):m(y)}}function UO(e,t,r){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c,u=0,d;return h;function h(_){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(_){return _===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):r(_)}function b(_){if(u>999||_===93&&!d||_===null||_===91||Et(_))return r(_);if(_===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return c=hr(a.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return Et(_)||(d=!0),u++,e.consume(_),_===92?y:b}function y(_){return _===91||_===92||_===93?(e.consume(_),u++,b):b(_)}function v(_){return _===58?(e.enter("definitionMarker"),e.consume(_),e.exit("definitionMarker"),o.includes(c)||o.push(c),Qe(e,x,"gfmFootnoteDefinitionWhitespace")):r(_)}function x(_){return t(_)}}function PO(e,t,r){return e.check(yl,t,e.attempt(DO,t,r))}function HO(e){e.exit("gfmFootnoteDefinition")}function FO(e,t,r){const a=this;return Qe(e,o,"gfmFootnoteDefinitionIndent",5);function o(c){const u=a.events[a.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(c):r(c)}}function $O(e){let r=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:c,resolveAll:o};return r==null&&(r=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function o(u,d){let h=-1;for(;++h<u.length;)if(u[h][0]==="enter"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._close){let m=h;for(;m--;)if(u[m][0]==="exit"&&u[m][1].type==="strikethroughSequenceTemporary"&&u[m][1]._open&&u[h][1].end.offset-u[h][1].start.offset===u[m][1].end.offset-u[m][1].start.offset){u[h][1].type="strikethroughSequence",u[m][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},u[m][1].start),end:Object.assign({},u[h][1].end)},y={type:"strikethroughText",start:Object.assign({},u[m][1].end),end:Object.assign({},u[h][1].start)},v=[["enter",b,d],["enter",u[m][1],d],["exit",u[m][1],d],["enter",y,d]],x=d.parser.constructs.insideSpan.null;x&&Kn(v,v.length,0,Mu(x,u.slice(m+1,h),d)),Kn(v,v.length,0,[["exit",y,d],["enter",u[h][1],d],["exit",u[h][1],d],["exit",b,d]]),Kn(u,m-1,h-m+3,v),h=m+v.length-2;break}}for(h=-1;++h<u.length;)u[h][1].type==="strikethroughSequenceTemporary"&&(u[h][1].type="data");return u}function c(u,d,h){const m=this.previous,b=this.events;let y=0;return v;function v(_){return m===126&&b[b.length-1][1].type!=="characterEscape"?h(_):(u.enter("strikethroughSequenceTemporary"),x(_))}function x(_){const S=Ds(m);if(_===126)return y>1?h(_):(u.consume(_),y++,x);if(y<2&&!r)return h(_);const O=u.exit("strikethroughSequenceTemporary"),k=Ds(_);return O._open=!k||k===2&&!!S,O._close=!S||S===2&&!!k,d(_)}}}class GO{constructor(){this.map=[]}add(t,r,a){KO(this,t,r,a)}consume(t){if(this.map.sort(function(c,u){return c[0]-u[0]}),this.map.length===0)return;let r=this.map.length;const a=[];for(;r>0;)r-=1,a.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];a.push(t.slice()),t.length=0;let o=a.pop();for(;o;){for(const c of o)t.push(c);o=a.pop()}this.map.length=0}}function KO(e,t,r,a){let o=0;if(!(r===0&&a.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=r,e.map[o][2].push(...a);return}o+=1}e.map.push([t,r,a])}}function qO(e,t){let r=!1;const a=[];for(;t<e.length;){const o=e[t];if(r){if(o[0]==="enter")o[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const c=a.length-1;a[c]=a[c]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(r=!0);t+=1}return a}function VO(){return{flow:{null:{name:"table",tokenize:YO,resolveAll:WO}}}}function YO(e,t,r){const a=this;let o=0,c=0,u;return d;function d(U){let F=a.events.length-1;for(;F>-1;){const ie=a.events[F][1].type;if(ie==="lineEnding"||ie==="linePrefix")F--;else break}const Y=F>-1?a.events[F][1].type:null,ue=Y==="tableHead"||Y==="tableRow"?M:h;return ue===M&&a.parser.lazy[a.now().line]?r(U):ue(U)}function h(U){return e.enter("tableHead"),e.enter("tableRow"),m(U)}function m(U){return U===124||(u=!0,c+=1),b(U)}function b(U){return U===null?r(U):Oe(U)?c>1?(c=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),x):r(U):Ye(U)?Qe(e,b,"whitespace")(U):(c+=1,u&&(u=!1,o+=1),U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),u=!0,b):(e.enter("data"),y(U)))}function y(U){return U===null||U===124||Et(U)?(e.exit("data"),b(U)):(e.consume(U),U===92?v:y)}function v(U){return U===92||U===124?(e.consume(U),y):y(U)}function x(U){return a.interrupt=!1,a.parser.lazy[a.now().line]?r(U):(e.enter("tableDelimiterRow"),u=!1,Ye(U)?Qe(e,_,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):_(U))}function _(U){return U===45||U===58?O(U):U===124?(u=!0,e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),S):L(U)}function S(U){return Ye(U)?Qe(e,O,"whitespace")(U):O(U)}function O(U){return U===58?(c+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),k):U===45?(c+=1,k(U)):U===null||Oe(U)?A(U):L(U)}function k(U){return U===45?(e.enter("tableDelimiterFiller"),D(U)):L(U)}function D(U){return U===45?(e.consume(U),D):U===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(U))}function w(U){return Ye(U)?Qe(e,A,"whitespace")(U):A(U)}function A(U){return U===124?_(U):U===null||Oe(U)?!u||o!==c?L(U):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(U)):L(U)}function L(U){return r(U)}function M(U){return e.enter("tableRow"),$(U)}function $(U){return U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),$):U===null||Oe(U)?(e.exit("tableRow"),t(U)):Ye(U)?Qe(e,$,"whitespace")(U):(e.enter("data"),V(U))}function V(U){return U===null||U===124||Et(U)?(e.exit("data"),$(U)):(e.consume(U),U===92?ee:V)}function ee(U){return U===92||U===124?(e.consume(U),V):V(U)}}function WO(e,t){let r=-1,a=!0,o=0,c=[0,0,0,0],u=[0,0,0,0],d=!1,h=0,m,b,y;const v=new GO;for(;++r<e.length;){const x=e[r],_=x[1];x[0]==="enter"?_.type==="tableHead"?(d=!1,h!==0&&(Qv(v,t,h,m,b),b=void 0,h=0),m={type:"table",start:Object.assign({},_.start),end:Object.assign({},_.end)},v.add(r,0,[["enter",m,t]])):_.type==="tableRow"||_.type==="tableDelimiterRow"?(a=!0,y=void 0,c=[0,0,0,0],u=[0,r+1,0,0],d&&(d=!1,b={type:"tableBody",start:Object.assign({},_.start),end:Object.assign({},_.end)},v.add(r,0,[["enter",b,t]])),o=_.type==="tableDelimiterRow"?2:b?3:1):o&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")?(a=!1,u[2]===0&&(c[1]!==0&&(u[0]=u[1],y=Xc(v,t,c,o,void 0,y),c=[0,0,0,0]),u[2]=r)):_.type==="tableCellDivider"&&(a?a=!1:(c[1]!==0&&(u[0]=u[1],y=Xc(v,t,c,o,void 0,y)),c=u,u=[c[1],r,0,0])):_.type==="tableHead"?(d=!0,h=r):_.type==="tableRow"||_.type==="tableDelimiterRow"?(h=r,c[1]!==0?(u[0]=u[1],y=Xc(v,t,c,o,r,y)):u[1]!==0&&(y=Xc(v,t,u,o,r,y)),o=0):o&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(u[3]=r)}for(h!==0&&Qv(v,t,h,m,b),v.consume(t.events),r=-1;++r<t.events.length;){const x=t.events[r];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=qO(t.events,r))}return e}function Xc(e,t,r,a,o,c){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",d="tableContent";r[0]!==0&&(c.end=Object.assign({},ys(t.events,r[0])),e.add(r[0],0,[["exit",c,t]]));const h=ys(t.events,r[1]);if(c={type:u,start:Object.assign({},h),end:Object.assign({},h)},e.add(r[1],0,[["enter",c,t]]),r[2]!==0){const m=ys(t.events,r[2]),b=ys(t.events,r[3]),y={type:d,start:Object.assign({},m),end:Object.assign({},b)};if(e.add(r[2],0,[["enter",y,t]]),a!==2){const v=t.events[r[2]],x=t.events[r[3]];if(v[1].end=Object.assign({},x[1].end),v[1].type="chunkText",v[1].contentType="text",r[3]>r[2]+1){const _=r[2]+1,S=r[3]-r[2]-1;e.add(_,S,[])}}e.add(r[3]+1,0,[["exit",y,t]])}return o!==void 0&&(c.end=Object.assign({},ys(t.events,o)),e.add(o,0,[["exit",c,t]]),c=void 0),c}function Qv(e,t,r,a,o){const c=[],u=ys(t.events,r);o&&(o.end=Object.assign({},u),c.push(["exit",o,t])),a.end=Object.assign({},u),c.push(["exit",a,t]),e.add(r+1,0,c)}function ys(e,t){const r=e[t],a=r[0]==="enter"?"start":"end";return r[1][a]}const XO={name:"tasklistCheck",tokenize:JO};function ZO(){return{text:{91:XO}}}function JO(e,t,r){const a=this;return o;function o(h){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?r(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),c)}function c(h){return Et(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),u):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),u):r(h)}function u(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):r(h)}function d(h){return Oe(h)?t(h):Ye(h)?e.check({tokenize:QO},t,r)(h):r(h)}}function QO(e,t,r){return Qe(e,a,"whitespace");function a(o){return o===null?r(o):t(o)}}function eR(e){return $x([kO(),LO(),$O(e),VO(),ZO()])}const tR={};function D0(e){const t=this,r=e||tR,a=t.data(),o=a.micromarkExtensions||(a.micromarkExtensions=[]),c=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);o.push(eR(r)),c.push(EO()),u.push(SO(r))}const e1=(function(e,t,r){const a=vl(r);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(a(e.children[t],t,e))return e.children[t]}),Ta=(function(e){if(e==null)return iR;if(typeof e=="string")return rR(e);if(typeof e=="object")return nR(e);if(typeof e=="function")return jp(e);throw new Error("Expected function, string, or array as `test`")});function nR(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=Ta(e[r]);return jp(a);function a(...o){let c=-1;for(;++c<t.length;)if(t[c].apply(this,o))return!0;return!1}}function rR(e){return jp(t);function t(r){return r.tagName===e}}function jp(e){return t;function t(r,a,o){return!!(aR(r)&&e.call(this,r,typeof a=="number"?a:void 0,o||void 0))}}function iR(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function aR(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const t1=/\n/g,n1=/[\t ]+/g,Zh=Ta("br"),r1=Ta(hR),sR=Ta("p"),i1=Ta("tr"),oR=Ta(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",fR,pR]),L0=Ta(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function lR(e,t){const r=t||{},a="children"in e?e.children:[],o=L0(e),c=B0(e,{whitespace:r.whitespace||"normal"}),u=[];(e.type==="text"||e.type==="comment")&&u.push(...z0(e,{breakBefore:!0,breakAfter:!0}));let d=-1;for(;++d<a.length;)u.push(...j0(a[d],e,{whitespace:c,breakBefore:d?void 0:o,breakAfter:d<a.length-1?Zh(a[d+1]):o}));const h=[];let m;for(d=-1;++d<u.length;){const b=u[d];typeof b=="number"?m!==void 0&&b>m&&(m=b):b&&(m!==void 0&&m>-1&&h.push(`
|
|
78
|
-
`.repeat(m)||" "),m=-1,h.push(b))}return h.join("")}function j0(e,t,r){return e.type==="element"?cR(e,t,r):e.type==="text"?r.whitespace==="normal"?z0(e,r):uR(e):[]}function cR(e,t,r){const a=B0(e,r),o=e.children||[];let c=-1,u=[];if(oR(e))return u;let d,h;for(Zh(e)||i1(e)&&e1(t,e,i1)?h=`
|
|
79
|
-
`:sR(e)?(d=2,h=2):L0(e)&&(d=1,h=1);++c<o.length;)u=u.concat(j0(o[c],e,{whitespace:a,breakBefore:c?void 0:d,breakAfter:c<o.length-1?Zh(o[c+1]):h}));return r1(e)&&e1(t,e,r1)&&u.push(" "),d&&u.unshift(d),h&&u.push(h),u}function z0(e,t){const r=String(e.value),a=[],o=[];let c=0;for(;c<=r.length;){t1.lastIndex=c;const h=t1.exec(r),m=h&&"index"in h?h.index:r.length;a.push(dR(r.slice(c,m).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),c===0?t.breakBefore:!0,m===r.length?t.breakAfter:!0)),c=m+1}let u=-1,d;for(;++u<a.length;)a[u].charCodeAt(a[u].length-1)===8203||u<a.length-1&&a[u+1].charCodeAt(0)===8203?(o.push(a[u]),d=void 0):a[u]?(typeof d=="number"&&o.push(d),o.push(a[u]),d=0):(u===0||u===a.length-1)&&o.push(0);return o}function uR(e){return[String(e.value)]}function dR(e,t,r){const a=[];let o=0,c;for(;o<e.length;){n1.lastIndex=o;const u=n1.exec(e);c=u?u.index:e.length,!o&&!c&&u&&!t&&a.push(""),o!==c&&a.push(e.slice(o,c)),o=u?c+u[0].length:c}return o!==c&&!r&&a.push(""),a.join(" ")}function B0(e,t){if(e.type==="element"){const r=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return r.wrap?"pre-wrap":"pre";case"td":case"th":return r.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function fR(e){return!!(e.properties||{}).hidden}function hR(e){return e.tagName==="td"||e.tagName==="th"}function pR(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function mR(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",u="(?!struct)("+a+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",d={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},m={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(m,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},x=t.optional(o)+e.IDENT_RE+"\\s*\\(",_=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],O=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],k=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],A={type:S,keyword:_,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:O},L={className:"function.dispatch",relevance:0,keywords:{_hint:k},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},M=[L,y,d,r,e.C_BLOCK_COMMENT_MODE,b,m],$={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:M.concat([{begin:/\(/,end:/\)/,keywords:A,contains:M.concat(["self"]),relevance:0}]),relevance:0},V={className:"function",begin:"("+u+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:A,relevance:0},{begin:x,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[m,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,m,b,d,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,m,b,d]}]},d,r,e.C_BLOCK_COMMENT_MODE,y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat($,V,L,M,[y,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:A,contains:["self",d]},{begin:e.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function gR(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},r=mR(e),a=r.keywords;return a.type=[...a.type,...t.type],a.literal=[...a.literal,...t.literal],a.built_in=[...a.built_in,...t.built_in],a._hints=t._hints,r.name="Arduino",r.aliases=["ino"],r.supersetOf="cpp",r}function bR(e){const t=e.regex,r={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},c=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),u={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},d={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,o]};o.contains.push(d);const h={match:/\\"/},m={className:"string",begin:/'/,end:/'/},b={match:/\\'/},y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},v=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],x=e.SHEBANG({binary:`(${v.join("|")})`,relevance:10}),_={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},S=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],O=["true","false"],k={match:/(\/[a-z._-]+)+/},D=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],w=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],L=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:S,literal:O,built_in:[...D,...w,"set","shopt",...A,...L]},contains:[x,e.SHEBANG(),_,y,c,u,k,d,h,m,b,r]}}function yR(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",u="("+a+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",d={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},m={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(m,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},x=t.optional(o)+e.IDENT_RE+"\\s*\\(",O={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},k=[y,d,r,e.C_BLOCK_COMMENT_MODE,b,m],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:k.concat([{begin:/\(/,end:/\)/,keywords:O,contains:k.concat(["self"]),relevance:0}]),relevance:0},w={begin:"("+u+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:O,relevance:0},{begin:x,returnBegin:!0,contains:[e.inherit(v,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,m,b,d,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,m,b,d]}]},d,r,e.C_BLOCK_COMMENT_MODE,y]};return{name:"C",aliases:["h"],keywords:O,disableAutodetect:!0,illegal:"</",contains:[].concat(D,w,k,[y,{begin:e.IDENT_RE+"::",keywords:O},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:y,strings:m,keywords:O}}}function vR(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",u="(?!struct)("+a+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",d={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},m={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},y={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(m,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},x=t.optional(o)+e.IDENT_RE+"\\s*\\(",_=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],O=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],k=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],A={type:S,keyword:_,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:O},L={className:"function.dispatch",relevance:0,keywords:{_hint:k},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},M=[L,y,d,r,e.C_BLOCK_COMMENT_MODE,b,m],$={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:M.concat([{begin:/\(/,end:/\)/,keywords:A,contains:M.concat(["self"]),relevance:0}]),relevance:0},V={className:"function",begin:"("+u+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:A,relevance:0},{begin:x,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[m,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,m,b,d,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,m,b,d]}]},d,r,e.C_BLOCK_COMMENT_MODE,y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat($,V,L,M,[y,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:A,contains:["self",d]},{begin:e.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function xR(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],r=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],a=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],c=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],u={keyword:o.concat(c),built_in:t,literal:a},d=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),h={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},m={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},b={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},y=e.inherit(b,{illegal:/\n/}),v={className:"subst",begin:/\{/,end:/\}/,keywords:u},x=e.inherit(v,{illegal:/\n/}),_={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,x]},S={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]},O=e.inherit(S,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]});v.contains=[S,_,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,e.C_BLOCK_COMMENT_MODE],x.contains=[O,_,y,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const k={variants:[m,S,_,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},D={begin:"<",end:">",contains:[{beginKeywords:"in out"},d]},w=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",A={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:u,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},k,h,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},d,D,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[d,D,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+w+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:u,contains:[{beginKeywords:r.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,D],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,relevance:0,contains:[k,h,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},A]}}const ER=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),SR=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],_R=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],wR=[...SR,..._R],kR=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),TR=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),NR=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),CR=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function AR(e){const t=e.regex,r=ER(e),a={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",c=/@-?\w[\w]*(-\w+)*/,u="[a-zA-Z-][a-zA-Z0-9_-]*",d=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,a,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+u,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+TR.join("|")+")"},{begin:":(:)?("+NR.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+CR.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...d,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...d,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:kR.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...d,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+wR.join("|")+")\\b"}]}}function OR(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function RR(e){const c={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:c,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,illegal:/["']/}]}]}}function MR(e){const t=e.regex,r=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(r,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function IR(e){const t=e.regex,r={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},a=e.COMMENT();a.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},c={className:"literal",begin:/\bon|off|true|false|yes|no\b/},u={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},d={begin:/\[/,end:/\]/,contains:[a,c,o,u,r,"self"],relevance:0},h=/[A-Za-z0-9_-]+/,m=/"(\\"|[^"])*"/,b=/'[^']*'/,y=t.either(h,m,b),v=t.concat(y,"(\\s*\\.\\s*",y,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{begin:v,className:"attr",starts:{end:/$/,contains:[a,d,c,o,u,r]}}]}}var vs="[0-9](_*[0-9])*",Zc=`\\.(${vs})`,Jc="[0-9a-fA-F](_*[0-9a-fA-F])*",a1={className:"number",variants:[{begin:`(\\b(${vs})((${Zc})|\\.)?|(${Zc}))[eE][+-]?(${vs})[fFdD]?\\b`},{begin:`\\b(${vs})((${Zc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Zc})[fFdD]?\\b`},{begin:`\\b(${vs})[fFdD]\\b`},{begin:`\\b0[xX]((${Jc})\\.?|(${Jc})?\\.(${Jc}))[pP][+-]?(${vs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Jc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function U0(e,t,r){return r===-1?"":e.replace(t,a=>U0(e,t,r-1))}function DR(e){const t=e.regex,r="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",a=r+U0("(?:<"+r+"~~~(?:\\s*,\\s*"+r+"~~~)*>)?",/~~~/g,2),h={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},m={className:"meta",begin:"@"+r,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},b={className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:h,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,r),/\s+/,r,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,r],className:{1:"keyword",3:"title.class"},contains:[b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+a+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:h,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[m,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a1,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},a1,m]}}const s1="[A-Za-z$_][0-9A-Za-z$_]*",LR=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],jR=["true","false","null","undefined","NaN","Infinity"],P0=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],H0=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],F0=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],zR=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],BR=[].concat(F0,P0,H0);function UR(e){const t=e.regex,r=(ae,{after:P})=>{const T="</"+ae[0].slice(1);return ae.input.indexOf(T,P)!==-1},a=s1,o={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ae,P)=>{const T=ae[0].length+ae.index,R=ae.input[T];if(R==="<"||R===","){P.ignoreMatch();return}R===">"&&(r(ae,{after:T})||P.ignoreMatch());let q;const C=ae.input.substring(T);if(q=C.match(/^\s*=/)){P.ignoreMatch();return}if((q=C.match(/^\s+extends\s+/))&&q.index===0){P.ignoreMatch();return}}},d={$pattern:s1,keyword:LR,literal:jR,built_in:BR,"variable.language":zR},h="[0-9](_?[0-9])*",m=`\\.(${h})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${b})((${m})|\\.)?|(${m}))[eE][+-]?(${h})\\b`},{begin:`\\b(${b})\\b((${m})\\b|\\.)?|(${m})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},v={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},O={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},D={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,_,S,O,{match:/\$\d+/},y];v.contains=w.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(w)});const A=[].concat(D,v.contains),L=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(A)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:L},$={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,t.concat(a,"(",t.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},V={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...P0,...H0]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},U={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(ae){return t.concat("(?!",ae.join("|"),")")}const ue={match:t.concat(/\b/,Y([...F0,"super","import"].map(ae=>`${ae}\\s*\\(`)),a,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:t.concat(/\./,t.lookahead(t.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},K={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},B="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Q={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(B)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:V},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,_,S,O,D,{match:/\$\d+/},y,V,{scope:"attr",match:a+t.lookahead(":"),relevance:0},Q,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,e.REGEXP_MODE,{className:"function",begin:B,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:c},{begin:u.begin,"on:begin":u.isTrulyOpeningTag,end:u.end}],subLanguage:"xml",contains:[{begin:u.begin,end:u.end,skip:!0,contains:["self"]}]}]},U,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},ue,F,$,K,{match:/\$[(.]/}]}}function PR(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],o={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[t,r,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var xs="[0-9](_*[0-9])*",Qc=`\\.(${xs})`,eu="[0-9a-fA-F](_*[0-9a-fA-F])*",HR={className:"number",variants:[{begin:`(\\b(${xs})((${Qc})|\\.)?|(${Qc}))[eE][+-]?(${xs})[fFdD]?\\b`},{begin:`\\b(${xs})((${Qc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Qc})[fFdD]?\\b`},{begin:`\\b(${xs})[fFdD]\\b`},{begin:`\\b0[xX]((${eu})\\.?|(${eu})?\\.(${eu}))[pP][+-]?(${xs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${eu})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function FR(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},r={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},a={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},o={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},c={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},u={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[c,o]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,c,o]}]};o.contains.push(u);const d={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},h={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(u,{className:"string"}),"self"]}]},m=HR,b=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),y={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},v=y;return v.variants[1].contains=[y],y.variants[1].contains=[v],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,b,r,a,d,h,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[y,e.C_LINE_COMMENT_MODE,b],relevance:0},e.C_LINE_COMMENT_MODE,b,d,h,u,e.C_NUMBER_MODE]},b]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},d,h]},u,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
80
|
-
`},m]}}const $R=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),GR=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],KR=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],qR=[...GR,...KR],VR=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),$0=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),G0=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),YR=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),WR=$0.concat(G0).sort().reverse();function XR(e){const t=$R(e),r=WR,a="and or not only",o="[\\w-]+",c="("+o+"|@\\{"+o+"\\})",u=[],d=[],h=function(w){return{className:"string",begin:"~?"+w+".*?"+w}},m=function(w,A,L){return{className:w,begin:A,relevance:L}},b={$pattern:/[a-z-]+/,keyword:a,attribute:VR.join(" ")},y={begin:"\\(",end:"\\)",contains:d,keywords:b,relevance:0};d.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h("'"),h('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,y,m("variable","@@?"+o,10),m("variable","@\\{"+o+"\\}"),m("built_in","~?`[^`]*?`"),{className:"attribute",begin:o+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const v=d.concat({begin:/\{/,end:/\}/,contains:u}),x={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(d)},_={begin:c+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+YR.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:d}}]},S={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:b,returnEnd:!0,contains:d,relevance:0}},O={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:v}},k={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:c,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,x,m("keyword","all\\b"),m("variable","@\\{"+o+"\\}"),{begin:"\\b("+qR.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,m("selector-tag",c,0),m("selector-id","#"+c),m("selector-class","\\."+c,0),m("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+$0.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+G0.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:v},{begin:"!important"},t.FUNCTION_DISPATCH]},D={begin:o+`:(:)?(${r.join("|")})`,returnBegin:!0,contains:[k]};return u.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,S,O,D,_,k,x,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:u}}function ZR(e){const t="\\[=*\\[",r="\\]=*\\]",a={begin:t,end:r,contains:["self"]},o=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,r,{contains:[a],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:r,contains:[a],relevance:5}])}}function JR(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},r={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},a={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,r]},o={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},c={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},u={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,r,a,o,c,u]}}function QR(e){const t=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},u={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},d=/[A-Za-z][A-Za-z0-9+.-]*/,h={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,d,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},m={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},y=e.inherit(m,{contains:[]}),v=e.inherit(b,{contains:[]});m.contains.push(v),b.contains.push(y);let x=[r,h];return[m,b,y,v].forEach(k=>{k.contains=k.contains.concat(x)}),x=x.concat(m,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:x},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:x}]}]},r,c,m,b,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},o,a,h,u,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function eM(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,d={"variable.language":["this","super"],$pattern:r,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},h={$pattern:r,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:d,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+h.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:h,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function tM(e){const t=e.regex,r=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],a=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:r.join(" ")},c={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},u={begin:/->\{/,end:/\}/},d={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},h={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[d]},m={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},b=[e.BACKSLASH_ESCAPE,c,h],y=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],v=(S,O,k="\\1")=>{const D=k==="\\1"?k:t.concat(k,O);return t.concat(t.concat("(?:",S,")"),O,/(?:\\.|[^\\\/])*?/,D,/(?:\\.|[^\\\/])*?/,k,a)},x=(S,O,k)=>t.concat(t.concat("(?:",S,")"),O,/(?:\\.|[^\\\/])*?/,k,a),_=[h,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),u,{className:"string",contains:b,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},m,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:v("s|tr|y",t.either(...y,{capture:!0}))},{begin:v("s|tr|y","\\(","\\)")},{begin:v("s|tr|y","\\[","\\]")},{begin:v("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:x("(?:m|qr)?",/\//,/\//)},{begin:x("m|qr",t.either(...y,{capture:!0}),/\1/)},{begin:x("m|qr",/\(/,/\)/)},{begin:x("m|qr",/\[/,/\]/)},{begin:x("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,d]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,d,m]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return c.contains=_,u.contains=_,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:_}}function nM(e){const t=e.regex,r=/(?![A-Za-z0-9])(?![$])/,a=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),o=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),c=t.concat(/[A-Z]+/,r),u={scope:"variable",match:"\\$+"+a},d={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},h={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},m=e.inherit(e.APOS_STRING_MODE,{illegal:null}),b=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(h)}),y={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(h),"on:begin":(ie,K)=>{K.data._beginMatch=ie[1]||ie[2]},"on:end":(ie,K)=>{K.data._beginMatch!==ie[1]&&K.ignoreMatch()}},v=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),x=`[
|
|
81
|
-
]`,_={scope:"string",variants:[b,m,y,v]},S={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},O=["false","null","true"],k=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],D=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],A={keyword:k,literal:(ie=>{const K=[];return ie.forEach(B=>{K.push(B),B.toLowerCase()===B?K.push(B.toUpperCase()):K.push(B.toLowerCase())}),K})(O),built_in:D},L=ie=>ie.map(K=>K.replace(/\|\d+$/,"")),M={variants:[{match:[/new/,t.concat(x,"+"),t.concat("(?!",L(D).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},$=t.concat(a,"\\b(?!\\()"),V={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),$],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,t.concat(/::/,t.lookahead(/(?!class\b)/)),$],scope:{1:"title.class",3:"variable.constant"}},{match:[o,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},ee={scope:"attr",match:t.concat(a,t.lookahead(":"),t.lookahead(/(?!::)/))},U={relevance:0,begin:/\(/,end:/\)/,keywords:A,contains:[ee,u,V,e.C_BLOCK_COMMENT_MODE,_,S,M]},F={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",L(k).join("\\b|"),"|",L(D).join("\\b|"),"\\b)"),a,t.concat(x,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[U]};U.contains.push(F);const Y=[ee,V,e.C_BLOCK_COMMENT_MODE,_,S,M],ue={begin:t.concat(/#\[\s*\\?/,t.either(o,c)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:O,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:O,keyword:["new","array"]},contains:["self",...Y]},...Y,{scope:"meta",variants:[{match:o},{match:c}]}]};return{case_insensitive:!1,keywords:A,contains:[ue,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},d,{scope:"variable.language",match:/\$this\b/},u,F,V,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},M,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:A,contains:["self",ue,u,V,e.C_BLOCK_COMMENT_MODE,_,S]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},_,S]}}function rM(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function iM(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function aM(e){const t=e.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],d={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},h={className:"meta",begin:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:d,illegal:/#/},b={begin:/\{\{/,relevance:0},y={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,h,b,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h,b,m]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,b,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,b,m]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},v="[0-9](_?[0-9])*",x=`(\\b(${v}))?\\.(${v})|\\b(${v})\\.`,_=`\\b|${a.join("|")}`,S={className:"number",relevance:0,variants:[{begin:`(\\b(${v})|(${x}))[eE][+-]?(${v})[jJ]?(?=${_})`},{begin:`(${x})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${_})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${_})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${_})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${_})`},{begin:`\\b(${v})[jJ](?=${_})`}]},O={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:d,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},k={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:["self",h,S,y,e.HASH_COMMENT_MODE]}]};return m.contains=[y,S,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:d,illegal:/(<\/|\?)|=>/,contains:[h,S,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},y,O,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[k]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[S,k,y]}]}}function sM(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function oM(e){const t=e.regex,r=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,c=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:r,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:r},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,a]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[c,a]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"},match:[r,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:c},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function lM(e){const t=e.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=t.concat(a,/(::\w+)*/),u={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},d={className:"doctag",begin:"@[A-Za-z]+"},h={begin:"#<",end:">"},m=[e.COMMENT("#","$",{contains:[d]}),e.COMMENT("^=begin","^=end",{contains:[d],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],b={className:"subst",begin:/#\{/,end:/\}/,keywords:u},y={className:"string",contains:[e.BACKSLASH_ESCAPE,b],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,b]})]}]},v="[1-9](_?[0-9])*|0",x="[0-9](_?[0-9])*",_={className:"number",relevance:0,variants:[{begin:`\\b(${v})(\\.(${x}))?([eE][+-]?(${x})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},S={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:u}]},M=[y,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:u},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:u},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:a,scope:"title.class"},{match:[/def/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[S]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[y,{begin:r}],relevance:0},_,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:u},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,b],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(h,m),relevance:0}].concat(h,m);b.contains=M,S.contains=M;const U=[{begin:/^\s*=>/,starts:{end:"$",contains:M}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:u,contains:M}}];return m.unshift(h),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:u,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(U).concat(m).concat(M)}}function cM(e){const t=e.regex,r=/(r#)?/,a=t.concat(r,e.UNDERSCORE_IDENT_RE),o=t.concat(r,e.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,t.lookahead(/\s*\(/))},u="([ui](8|16|32|64|128|size)|f(32|64))?",d=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],h=["true","false","Some","None","Ok","Err"],m=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],b=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:b,keyword:d,literal:h,built_in:m},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+u},{begin:"\\b0o([0-7_]+)"+u},{begin:"\\b0x([A-Fa-f0-9_]+)"+u},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+u}],relevance:0},{begin:[/fn/,/\s+/,a],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,a],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,a,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:m,type:b}},{className:"punctuation",begin:"->"},c]}}const uM=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),dM=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],fM=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],hM=[...dM,...fM],pM=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),mM=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),gM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),bM=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function yM(e){const t=uM(e),r=gM,a=mM,o="@[a-z-]+",c="and or not only",d={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+hM.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+a.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},d,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+bM.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,d,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:c,attribute:pM.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},d,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function vM(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function xM(e){const t=e.regex,r=e.COMMENT("--","$"),a={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],u=["double precision","large object","with timezone","without timezone"],d=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],h=["add","asc","collation","desc","final","first","last","view"],m=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],b=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],y=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],v=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],x=b,_=[...m,...h].filter(L=>!b.includes(L)),S={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},O={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},k={match:t.concat(/\b/,t.either(...x),/\s*\(/),relevance:0,keywords:{built_in:x}};function D(L){return t.concat(/\b/,t.either(...L.map(M=>M.replace(/\s+/,"\\s+"))),/\b/)}const w={scope:"keyword",match:D(v),relevance:0};function A(L,{exceptions:M,when:$}={}){const V=$;return M=M||[],L.map(ee=>ee.match(/\|\d+$/)||M.includes(ee)?ee:V(ee)?`${ee}|0`:ee)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(_,{when:L=>L.length<3}),literal:c,type:d,built_in:y},contains:[{scope:"type",match:D(u)},w,k,S,a,o,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,r,O]}}function K0(e){return e?typeof e=="string"?e:e.source:null}function $o(e){return gt("(?=",e,")")}function gt(...e){return e.map(r=>K0(r)).join("")}function EM(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function gn(...e){return"("+(EM(e).capture?"":"?:")+e.map(a=>K0(a)).join("|")+")"}const zp=e=>gt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),SM=["Protocol","Type"].map(zp),o1=["init","self"].map(zp),_M=["Any","Self"],gh=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],l1=["false","nil","true"],wM=["assignment","associativity","higherThan","left","lowerThan","none","right"],kM=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],c1=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],q0=gn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),V0=gn(q0,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),bh=gt(q0,V0,"*"),Y0=gn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),xu=gn(Y0,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),_r=gt(Y0,xu,"*"),tu=gt(/[A-Z]/,xu,"*"),TM=["attached","autoclosure",gt(/convention\(/,gn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",gt(/objc\(/,_r,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],NM=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function CM(e){const t={match:/\s+/,relevance:0},r=e.COMMENT("/\\*","\\*/",{contains:["self"]}),a=[e.C_LINE_COMMENT_MODE,r],o={match:[/\./,gn(...SM,...o1)],className:{2:"keyword"}},c={match:gt(/\./,gn(...gh)),relevance:0},u=gh.filter(ve=>typeof ve=="string").concat(["_|0"]),d=gh.filter(ve=>typeof ve!="string").concat(_M).map(zp),h={variants:[{className:"keyword",match:gn(...d,...o1)}]},m={$pattern:gn(/\b\w+/,/#\w+/),keyword:u.concat(kM),literal:l1},b=[o,c,h],y={match:gt(/\./,gn(...c1)),relevance:0},v={className:"built_in",match:gt(/\b/,gn(...c1),/(?=\()/)},x=[y,v],_={match:/->/,relevance:0},S={className:"operator",relevance:0,variants:[{match:bh},{match:`\\.(\\.|${V0})+`}]},O=[_,S],k="([0-9]_*)+",D="([0-9a-fA-F]_*)+",w={className:"number",relevance:0,variants:[{match:`\\b(${k})(\\.(${k}))?([eE][+-]?(${k}))?\\b`},{match:`\\b0x(${D})(\\.(${D}))?([pP][+-]?(${k}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},A=(ve="")=>({className:"subst",variants:[{match:gt(/\\/,ve,/[0\\tnr"']/)},{match:gt(/\\/,ve,/u\{[0-9a-fA-F]{1,8}\}/)}]}),L=(ve="")=>({className:"subst",match:gt(/\\/,ve,/[\t ]*(?:[\r\n]|\r\n)/)}),M=(ve="")=>({className:"subst",label:"interpol",begin:gt(/\\/,ve,/\(/),end:/\)/}),$=(ve="")=>({begin:gt(ve,/"""/),end:gt(/"""/,ve),contains:[A(ve),L(ve),M(ve)]}),V=(ve="")=>({begin:gt(ve,/"/),end:gt(/"/,ve),contains:[A(ve),M(ve)]}),ee={className:"string",variants:[$(),$("#"),$("##"),$("###"),V(),V("#"),V("##"),V("###")]},U=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],F={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:U},Y=ve=>{const Ne=gt(ve,/\//),$e=gt(/\//,ve);return{begin:Ne,end:$e,contains:[...U,{scope:"comment",begin:`#(?!.*${$e})`,end:/$/}]}},ue={scope:"regexp",variants:[Y("###"),Y("##"),Y("#"),F]},ie={match:gt(/`/,_r,/`/)},K={className:"variable",match:/\$\d+/},B={className:"variable",match:`\\$${xu}+`},Q=[ie,K,B],ae={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:NM,contains:[...O,w,ee]}]}},P={scope:"keyword",match:gt(/@/,gn(...TM),$o(gn(/\(/,/\s+/)))},T={scope:"meta",match:gt(/@/,_r)},R=[ae,P,T],q={match:$o(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:gt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,xu,"+")},{className:"type",match:tu,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:gt(/\s+&\s+/,$o(tu)),relevance:0}]},C={begin:/</,end:/>/,keywords:m,contains:[...a,...b,...R,_,q]};q.contains.push(C);const de={match:gt(_r,/\s*:/),keywords:"_|0",relevance:0},fe={begin:/\(/,end:/\)/,relevance:0,keywords:m,contains:["self",de,...a,ue,...b,...x,...O,w,ee,...Q,...R,q]},he={begin:/</,end:/>/,keywords:"repeat each",contains:[...a,q]},Te={begin:gn($o(gt(_r,/\s*:/)),$o(gt(_r,/\s+/,_r,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:_r}]},Le={begin:/\(/,end:/\)/,keywords:m,contains:[Te,...a,...b,...O,w,ee,...R,q,fe],endsParent:!0,illegal:/["']/},et={match:[/(func|macro)/,/\s+/,gn(ie.match,_r,bh)],className:{1:"keyword",3:"title.function"},contains:[he,Le,t],illegal:[/\[/,/%/]},Rt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[he,Le,t],illegal:/\[|%/},an={match:[/operator/,/\s+/,bh],className:{1:"keyword",3:"title"}},qn={begin:[/precedencegroup/,/\s+/,tu],className:{1:"keyword",3:"title"},contains:[q],keywords:[...wM,...l1],end:/}/},ar={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ce={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},be={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,_r,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:m,contains:[he,...b,{begin:/:/,end:/\{/,keywords:m,contains:[{scope:"title.class.inherited",match:tu},...b],relevance:0}]};for(const ve of ee.variants){const Ne=ve.contains.find(bt=>bt.label==="interpol");Ne.keywords=m;const $e=[...b,...x,...O,w,ee,...Q];Ne.contains=[...$e,{begin:/\(/,end:/\)/,contains:["self",...$e]}]}return{name:"Swift",keywords:m,contains:[...a,et,Rt,ar,ce,be,an,qn,{beginKeywords:"import",end:/$/,contains:[...a],relevance:0},ue,...b,...x,...O,w,ee,...Q,...R,q,fe]}}const Eu="[A-Za-z$_][0-9A-Za-z$_]*",W0=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],X0=["true","false","null","undefined","NaN","Infinity"],Z0=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],J0=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Q0=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],eE=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],tE=[].concat(Q0,Z0,J0);function AM(e){const t=e.regex,r=(ae,{after:P})=>{const T="</"+ae[0].slice(1);return ae.input.indexOf(T,P)!==-1},a=Eu,o={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ae,P)=>{const T=ae[0].length+ae.index,R=ae.input[T];if(R==="<"||R===","){P.ignoreMatch();return}R===">"&&(r(ae,{after:T})||P.ignoreMatch());let q;const C=ae.input.substring(T);if(q=C.match(/^\s*=/)){P.ignoreMatch();return}if((q=C.match(/^\s+extends\s+/))&&q.index===0){P.ignoreMatch();return}}},d={$pattern:Eu,keyword:W0,literal:X0,built_in:tE,"variable.language":eE},h="[0-9](_?[0-9])*",m=`\\.(${h})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${b})((${m})|\\.)?|(${m}))[eE][+-]?(${h})\\b`},{begin:`\\b(${b})\\b((${m})\\b|\\.)?|(${m})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},v={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},O={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},D={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,_,S,O,{match:/\$\d+/},y];v.contains=w.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(w)});const A=[].concat(D,v.contains),L=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(A)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:L},$={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,t.concat(a,"(",t.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},V={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Z0,...J0]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},U={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(ae){return t.concat("(?!",ae.join("|"),")")}const ue={match:t.concat(/\b/,Y([...Q0,"super","import"].map(ae=>`${ae}\\s*\\(`)),a,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:t.concat(/\./,t.lookahead(t.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},K={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},B="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Q={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(B)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:V},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,_,S,O,D,{match:/\$\d+/},y,V,{scope:"attr",match:a+t.lookahead(":"),relevance:0},Q,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,e.REGEXP_MODE,{className:"function",begin:B,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:c},{begin:u.begin,"on:begin":u.isTrulyOpeningTag,end:u.end}],subLanguage:"xml",contains:[{begin:u.begin,end:u.end,skip:!0,contains:["self"]}]}]},U,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},ue,F,$,K,{match:/\$[(.]/}]}}function OM(e){const t=e.regex,r=AM(e),a=Eu,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},u={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[r.exports.CLASS_REFERENCE]},d={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},h=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],m={$pattern:Eu,keyword:W0.concat(h),literal:X0,built_in:tE.concat(o),"variable.language":eE},b={className:"meta",begin:"@"+a},y=(S,O,k)=>{const D=S.contains.findIndex(w=>w.label===O);if(D===-1)throw new Error("can not find mode to replace");S.contains.splice(D,1,k)};Object.assign(r.keywords,m),r.exports.PARAMS_CONTAINS.push(b);const v=r.contains.find(S=>S.scope==="attr"),x=Object.assign({},v,{match:t.concat(a,t.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,v,x]),r.contains=r.contains.concat([b,c,u,x]),y(r,"shebang",e.SHEBANG()),y(r,"use_strict",d);const _=r.contains.find(S=>S.label==="func.def");return _.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}function RM(e){const t=e.regex,r={className:"string",begin:/"(""|[^/n])"C\b/},a={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,c=/\d{4}-\d{1,2}-\d{1,2}/,u=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,d=/\d{1,2}(:\d{1,2}){1,2}/,h={className:"literal",variants:[{begin:t.concat(/# */,t.either(c,o),/ *#/)},{begin:t.concat(/# */,d,/ *#/)},{begin:t.concat(/# */,u,/ *#/)},{begin:t.concat(/# */,t.either(c,o),/ +/,t.either(u,d),/ *#/)}]},m={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},b={className:"label",begin:/^\w+:/},y=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),v=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[r,a,h,m,b,y,v,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[v]}]}}function MM(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const r=e.COMMENT(/;;/,/$/),a=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},c={className:"variable",begin:/\$[\w_]+/},u={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},d={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},h={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},m={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:a},contains:[r,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},c,u,o,e.QUOTE_STRING_MODE,h,m,d]}}function IM(e){const t=e.regex,r=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},u=e.inherit(c,{begin:/\(/,end:/\)/}),d=e.inherit(e.APOS_STRING_MODE,{className:"string"}),h=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),m={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:a,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[c,h,d,u,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,u,h,d]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[h]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[m],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[m],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(r,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:m}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function DM(e){const t="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},u={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,o]},d=e.inherit(u,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),v={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},x={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},_={begin:/\{/,end:/\}/,contains:[x],illegal:"\\n",relevance:0},S={begin:"\\[",end:"\\]",contains:[x],illegal:"\\n",relevance:0},O=[a,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},v,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},_,S,c,u],k=[...O];return k.pop(),k.push(d),x.contains=k,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:O}}const LM={arduino:gR,bash:bR,c:yR,cpp:vR,csharp:xR,css:AR,diff:OR,go:RR,graphql:MR,ini:IR,java:DR,javascript:UR,json:PR,kotlin:FR,less:XR,lua:ZR,makefile:JR,markdown:QR,objectivec:eM,perl:tM,php:nM,"php-template":rM,plaintext:iM,python:aM,"python-repl":sM,r:oM,ruby:lM,rust:cM,scss:yM,shell:vM,sql:xM,swift:CM,typescript:OM,vbnet:RM,wasm:MM,xml:IM,yaml:DM};var yh,u1;function jM(){if(u1)return yh;u1=1;function e(z){return z instanceof Map?z.clear=z.delete=z.set=function(){throw new Error("map is read-only")}:z instanceof Set&&(z.add=z.clear=z.delete=function(){throw new Error("set is read-only")}),Object.freeze(z),Object.getOwnPropertyNames(z).forEach(se=>{const xe=z[se],je=typeof xe;(je==="object"||je==="function")&&!Object.isFrozen(xe)&&e(xe)}),z}class t{constructor(se){se.data===void 0&&(se.data={}),this.data=se.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(z){return z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(z,...se){const xe=Object.create(null);for(const je in z)xe[je]=z[je];return se.forEach(function(je){for(const kt in je)xe[kt]=je[kt]}),xe}const o="</span>",c=z=>!!z.scope,u=(z,{prefix:se})=>{if(z.startsWith("language:"))return z.replace("language:","language-");if(z.includes(".")){const xe=z.split(".");return[`${se}${xe.shift()}`,...xe.map((je,kt)=>`${je}${"_".repeat(kt+1)}`)].join(" ")}return`${se}${z}`};class d{constructor(se,xe){this.buffer="",this.classPrefix=xe.classPrefix,se.walk(this)}addText(se){this.buffer+=r(se)}openNode(se){if(!c(se))return;const xe=u(se.scope,{prefix:this.classPrefix});this.span(xe)}closeNode(se){c(se)&&(this.buffer+=o)}value(){return this.buffer}span(se){this.buffer+=`<span class="${se}">`}}const h=(z={})=>{const se={children:[]};return Object.assign(se,z),se};class m{constructor(){this.rootNode=h(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(se){this.top.children.push(se)}openNode(se){const xe=h({scope:se});this.add(xe),this.stack.push(xe)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(se){return this.constructor._walk(se,this.rootNode)}static _walk(se,xe){return typeof xe=="string"?se.addText(xe):xe.children&&(se.openNode(xe),xe.children.forEach(je=>this._walk(se,je)),se.closeNode(xe)),se}static _collapse(se){typeof se!="string"&&se.children&&(se.children.every(xe=>typeof xe=="string")?se.children=[se.children.join("")]:se.children.forEach(xe=>{m._collapse(xe)}))}}class b extends m{constructor(se){super(),this.options=se}addText(se){se!==""&&this.add(se)}startScope(se){this.openNode(se)}endScope(){this.closeNode()}__addSublanguage(se,xe){const je=se.root;xe&&(je.scope=`language:${xe}`),this.add(je)}toHTML(){return new d(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function y(z){return z?typeof z=="string"?z:z.source:null}function v(z){return S("(?=",z,")")}function x(z){return S("(?:",z,")*")}function _(z){return S("(?:",z,")?")}function S(...z){return z.map(xe=>y(xe)).join("")}function O(z){const se=z[z.length-1];return typeof se=="object"&&se.constructor===Object?(z.splice(z.length-1,1),se):{}}function k(...z){return"("+(O(z).capture?"":"?:")+z.map(je=>y(je)).join("|")+")"}function D(z){return new RegExp(z.toString()+"|").exec("").length-1}function w(z,se){const xe=z&&z.exec(se);return xe&&xe.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(z,{joinWith:se}){let xe=0;return z.map(je=>{xe+=1;const kt=xe;let yt=y(je),_e="";for(;yt.length>0;){const Ee=A.exec(yt);if(!Ee){_e+=yt;break}_e+=yt.substring(0,Ee.index),yt=yt.substring(Ee.index+Ee[0].length),Ee[0][0]==="\\"&&Ee[1]?_e+="\\"+String(Number(Ee[1])+kt):(_e+=Ee[0],Ee[0]==="("&&xe++)}return _e}).map(je=>`(${je})`).join(se)}const M=/\b\B/,$="[a-zA-Z]\\w*",V="[a-zA-Z_]\\w*",ee="\\b\\d+(\\.\\d+)?",U="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",Y="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ue=(z={})=>{const se=/^#![ ]*\//;return z.binary&&(z.begin=S(se,/.*\b/,z.binary,/\b.*/)),a({scope:"meta",begin:se,end:/$/,relevance:0,"on:begin":(xe,je)=>{xe.index!==0&&je.ignoreMatch()}},z)},ie={begin:"\\\\[\\s\\S]",relevance:0},K={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ie]},B={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ie]},Q={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ae=function(z,se,xe={}){const je=a({scope:"comment",begin:z,end:se,contains:[]},xe);je.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const kt=k("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return je.contains.push({begin:S(/[ ]+/,"(",kt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),je},P=ae("//","$"),T=ae("/\\*","\\*/"),R=ae("#","$"),q={scope:"number",begin:ee,relevance:0},C={scope:"number",begin:U,relevance:0},de={scope:"number",begin:F,relevance:0},fe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ie,{begin:/\[/,end:/\]/,relevance:0,contains:[ie]}]},he={scope:"title",begin:$,relevance:0},Te={scope:"title",begin:V,relevance:0},Le={begin:"\\.\\s*"+V,relevance:0};var Rt=Object.freeze({__proto__:null,APOS_STRING_MODE:K,BACKSLASH_ESCAPE:ie,BINARY_NUMBER_MODE:de,BINARY_NUMBER_RE:F,COMMENT:ae,C_BLOCK_COMMENT_MODE:T,C_LINE_COMMENT_MODE:P,C_NUMBER_MODE:C,C_NUMBER_RE:U,END_SAME_AS_BEGIN:function(z){return Object.assign(z,{"on:begin":(se,xe)=>{xe.data._beginMatch=se[1]},"on:end":(se,xe)=>{xe.data._beginMatch!==se[1]&&xe.ignoreMatch()}})},HASH_COMMENT_MODE:R,IDENT_RE:$,MATCH_NOTHING_RE:M,METHOD_GUARD:Le,NUMBER_MODE:q,NUMBER_RE:ee,PHRASAL_WORDS_MODE:Q,QUOTE_STRING_MODE:B,REGEXP_MODE:fe,RE_STARTERS_RE:Y,SHEBANG:ue,TITLE_MODE:he,UNDERSCORE_IDENT_RE:V,UNDERSCORE_TITLE_MODE:Te});function an(z,se){z.input[z.index-1]==="."&&se.ignoreMatch()}function qn(z,se){z.className!==void 0&&(z.scope=z.className,delete z.className)}function ar(z,se){se&&z.beginKeywords&&(z.begin="\\b("+z.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",z.__beforeBegin=an,z.keywords=z.keywords||z.beginKeywords,delete z.beginKeywords,z.relevance===void 0&&(z.relevance=0))}function ce(z,se){Array.isArray(z.illegal)&&(z.illegal=k(...z.illegal))}function be(z,se){if(z.match){if(z.begin||z.end)throw new Error("begin & end are not supported with match");z.begin=z.match,delete z.match}}function ve(z,se){z.relevance===void 0&&(z.relevance=1)}const Ne=(z,se)=>{if(!z.beforeMatch)return;if(z.starts)throw new Error("beforeMatch cannot be used with starts");const xe=Object.assign({},z);Object.keys(z).forEach(je=>{delete z[je]}),z.keywords=xe.keywords,z.begin=S(xe.beforeMatch,v(xe.begin)),z.starts={relevance:0,contains:[Object.assign(xe,{endsParent:!0})]},z.relevance=0,delete xe.beforeMatch},$e=["of","and","for","in","not","or","if","then","parent","list","value"],bt="keyword";function Vt(z,se,xe=bt){const je=Object.create(null);return typeof z=="string"?kt(xe,z.split(" ")):Array.isArray(z)?kt(xe,z):Object.keys(z).forEach(function(yt){Object.assign(je,Vt(z[yt],se,yt))}),je;function kt(yt,_e){se&&(_e=_e.map(Ee=>Ee.toLowerCase())),_e.forEach(function(Ee){const De=Ee.split("|");je[De[0]]=[yt,sr(De[0],De[1])]})}}function sr(z,se){return se?Number(se):Xt(z)?0:1}function Xt(z){return $e.includes(z.toLowerCase())}const Rr={},wt=z=>{console.error(z)},Ca=(z,...se)=>{console.log(`WARN: ${z}`,...se)},te=(z,se)=>{Rr[`${z}/${se}`]||(console.log(`Deprecated as of ${z}. ${se}`),Rr[`${z}/${se}`]=!0)},ge=new Error;function Re(z,se,{key:xe}){let je=0;const kt=z[xe],yt={},_e={};for(let Ee=1;Ee<=se.length;Ee++)_e[Ee+je]=kt[Ee],yt[Ee+je]=!0,je+=D(se[Ee-1]);z[xe]=_e,z[xe]._emit=yt,z[xe]._multi=!0}function Ge(z){if(Array.isArray(z.begin)){if(z.skip||z.excludeBegin||z.returnBegin)throw wt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ge;if(typeof z.beginScope!="object"||z.beginScope===null)throw wt("beginScope must be object"),ge;Re(z,z.begin,{key:"beginScope"}),z.begin=L(z.begin,{joinWith:""})}}function tt(z){if(Array.isArray(z.end)){if(z.skip||z.excludeEnd||z.returnEnd)throw wt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ge;if(typeof z.endScope!="object"||z.endScope===null)throw wt("endScope must be object"),ge;Re(z,z.end,{key:"endScope"}),z.end=L(z.end,{joinWith:""})}}function fn(z){z.scope&&typeof z.scope=="object"&&z.scope!==null&&(z.beginScope=z.scope,delete z.scope)}function or(z){fn(z),typeof z.beginScope=="string"&&(z.beginScope={_wrap:z.beginScope}),typeof z.endScope=="string"&&(z.endScope={_wrap:z.endScope}),Ge(z),tt(z)}function Zt(z){function se(_e,Ee){return new RegExp(y(_e),"m"+(z.case_insensitive?"i":"")+(z.unicodeRegex?"u":"")+(Ee?"g":""))}class xe{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ee,De){De.position=this.position++,this.matchIndexes[this.matchAt]=De,this.regexes.push([De,Ee]),this.matchAt+=D(Ee)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ee=this.regexes.map(De=>De[1]);this.matcherRe=se(L(Ee,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ee){this.matcherRe.lastIndex=this.lastIndex;const De=this.matcherRe.exec(Ee);if(!De)return null;const Lt=De.findIndex((Mr,Oa)=>Oa>0&&Mr!==void 0),Ct=this.matchIndexes[Lt];return De.splice(0,Lt),Object.assign(De,Ct)}}class je{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ee){if(this.multiRegexes[Ee])return this.multiRegexes[Ee];const De=new xe;return this.rules.slice(Ee).forEach(([Lt,Ct])=>De.addRule(Lt,Ct)),De.compile(),this.multiRegexes[Ee]=De,De}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ee,De){this.rules.push([Ee,De]),De.type==="begin"&&this.count++}exec(Ee){const De=this.getMatcher(this.regexIndex);De.lastIndex=this.lastIndex;let Lt=De.exec(Ee);if(this.resumingScanAtSamePosition()&&!(Lt&&Lt.index===this.lastIndex)){const Ct=this.getMatcher(0);Ct.lastIndex=this.lastIndex+1,Lt=Ct.exec(Ee)}return Lt&&(this.regexIndex+=Lt.position+1,this.regexIndex===this.count&&this.considerAll()),Lt}}function kt(_e){const Ee=new je;return _e.contains.forEach(De=>Ee.addRule(De.begin,{rule:De,type:"begin"})),_e.terminatorEnd&&Ee.addRule(_e.terminatorEnd,{type:"end"}),_e.illegal&&Ee.addRule(_e.illegal,{type:"illegal"}),Ee}function yt(_e,Ee){const De=_e;if(_e.isCompiled)return De;[qn,be,or,Ne].forEach(Ct=>Ct(_e,Ee)),z.compilerExtensions.forEach(Ct=>Ct(_e,Ee)),_e.__beforeBegin=null,[ar,ce,ve].forEach(Ct=>Ct(_e,Ee)),_e.isCompiled=!0;let Lt=null;return typeof _e.keywords=="object"&&_e.keywords.$pattern&&(_e.keywords=Object.assign({},_e.keywords),Lt=_e.keywords.$pattern,delete _e.keywords.$pattern),Lt=Lt||/\w+/,_e.keywords&&(_e.keywords=Vt(_e.keywords,z.case_insensitive)),De.keywordPatternRe=se(Lt,!0),Ee&&(_e.begin||(_e.begin=/\B|\b/),De.beginRe=se(De.begin),!_e.end&&!_e.endsWithParent&&(_e.end=/\B|\b/),_e.end&&(De.endRe=se(De.end)),De.terminatorEnd=y(De.end)||"",_e.endsWithParent&&Ee.terminatorEnd&&(De.terminatorEnd+=(_e.end?"|":"")+Ee.terminatorEnd)),_e.illegal&&(De.illegalRe=se(_e.illegal)),_e.contains||(_e.contains=[]),_e.contains=[].concat(..._e.contains.map(function(Ct){return sn(Ct==="self"?_e:Ct)})),_e.contains.forEach(function(Ct){yt(Ct,De)}),_e.starts&&yt(_e.starts,Ee),De.matcher=kt(De),De}if(z.compilerExtensions||(z.compilerExtensions=[]),z.contains&&z.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return z.classNameAliases=a(z.classNameAliases||{}),yt(z)}function Mt(z){return z?z.endsWithParent||Mt(z.starts):!1}function sn(z){return z.variants&&!z.cachedVariants&&(z.cachedVariants=z.variants.map(function(se){return a(z,{variants:null},se)})),z.cachedVariants?z.cachedVariants:Mt(z)?a(z,{starts:z.starts?a(z.starts):null}):Object.isFrozen(z)?a(z):z}var ot="11.11.1";class br extends Error{constructor(se,xe){super(se),this.name="HTMLInjectionError",this.html=xe}}const hn=r,Nl=a,qi=Symbol("nomatch"),Aa=7,Vi=function(z){const se=Object.create(null),xe=Object.create(null),je=[];let kt=!0;const yt="Could not find the language '{}', did you forget to load/include a language module?",_e={disableAutodetect:!0,name:"Plain text",contains:[]};let Ee={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:b};function De(pe){return Ee.noHighlightRe.test(pe)}function Lt(pe){let Ce=pe.className+" ";Ce+=pe.parentNode?pe.parentNode.className:"";const Ke=Ee.languageDetectRe.exec(Ce);if(Ke){const lt=pn(Ke[1]);return lt||(Ca(yt.replace("{}",Ke[1])),Ca("Falling back to no-highlight mode for this block.",pe)),lt?Ke[1]:"no-highlight"}return Ce.split(/\s+/).find(lt=>De(lt)||pn(lt))}function Ct(pe,Ce,Ke){let lt="",zt="";typeof Ce=="object"?(lt=pe,Ke=Ce.ignoreIllegals,zt=Ce.language):(te("10.7.0","highlight(lang, code, ...args) has been deprecated."),te("10.7.0",`Please use highlight(code, options) instead.
|
|
82
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),zt=pe,lt=Ce),Ke===void 0&&(Ke=!0);const ln={code:lt,language:zt};Wi("before:highlight",ln);const Dn=ln.result?ln.result:Mr(ln.language,ln.code,Ke);return Dn.code=ln.code,Wi("after:highlight",Dn),Dn}function Mr(pe,Ce,Ke,lt){const zt=Object.create(null);function ln(ye,we){return ye.keywords[we]}function Dn(){if(!Ie.keywords){Ht.addText(ct);return}let ye=0;Ie.keywordPatternRe.lastIndex=0;let we=Ie.keywordPatternRe.exec(ct),Ue="";for(;we;){Ue+=ct.substring(ye,we.index);const We=Jt.case_insensitive?we[0].toLowerCase():we[0],Ot=ln(Ie,We);if(Ot){const[Vn,Vs]=Ot;if(Ht.addText(Ue),Ue="",zt[We]=(zt[We]||0)+1,zt[We]<=Aa&&(ui+=Vs),Vn.startsWith("_"))Ue+=we[0];else{const Dl=Jt.classNameAliases[Vn]||Vn;Ln(we[0],Dl)}}else Ue+=we[0];ye=Ie.keywordPatternRe.lastIndex,we=Ie.keywordPatternRe.exec(ct)}Ue+=ct.substring(ye),Ht.addText(Ue)}function _n(){if(ct==="")return;let ye=null;if(typeof Ie.subLanguage=="string"){if(!se[Ie.subLanguage]){Ht.addText(ct);return}ye=Mr(Ie.subLanguage,ct,!0,Il[Ie.subLanguage]),Il[Ie.subLanguage]=ye._top}else ye=Ra(ct,Ie.subLanguage.length?Ie.subLanguage:null);Ie.relevance>0&&(ui+=ye.relevance),Ht.__addSublanguage(ye._emitter,ye.language)}function St(){Ie.subLanguage!=null?_n():Dn(),ct=""}function Ln(ye,we){ye!==""&&(Ht.startScope(we),Ht.addText(ye),Ht.endScope())}function Rl(ye,we){let Ue=1;const We=we.length-1;for(;Ue<=We;){if(!ye._emit[Ue]){Ue++;continue}const Ot=Jt.classNameAliases[ye[Ue]]||ye[Ue],Vn=we[Ue];Ot?Ln(Vn,Ot):(ct=Vn,Dn(),ct=""),Ue++}}function Ia(ye,we){return ye.scope&&typeof ye.scope=="string"&&Ht.openNode(Jt.classNameAliases[ye.scope]||ye.scope),ye.beginScope&&(ye.beginScope._wrap?(Ln(ct,Jt.classNameAliases[ye.beginScope._wrap]||ye.beginScope._wrap),ct=""):ye.beginScope._multi&&(Rl(ye.beginScope,we),ct="")),Ie=Object.create(ye,{parent:{value:Ie}}),Ie}function Gs(ye,we,Ue){let We=w(ye.endRe,Ue);if(We){if(ye["on:end"]){const Ot=new t(ye);ye["on:end"](we,Ot),Ot.isMatchIgnored&&(We=!1)}if(We){for(;ye.endsParent&&ye.parent;)ye=ye.parent;return ye}}if(ye.endsWithParent)return Gs(ye.parent,we,Ue)}function Da(ye){return Ie.matcher.regexIndex===0?(ct+=ye[0],1):(di=!0,0)}function Pu(ye){const we=ye[0],Ue=ye.rule,We=new t(Ue),Ot=[Ue.__beforeBegin,Ue["on:begin"]];for(const Vn of Ot)if(Vn&&(Vn(ye,We),We.isMatchIgnored))return Da(we);return Ue.skip?ct+=we:(Ue.excludeBegin&&(ct+=we),St(),!Ue.returnBegin&&!Ue.excludeBegin&&(ct=we)),Ia(Ue,ye),Ue.returnBegin?0:we.length}function wn(ye){const we=ye[0],Ue=Ce.substring(ye.index),We=Gs(Ie,ye,Ue);if(!We)return qi;const Ot=Ie;Ie.endScope&&Ie.endScope._wrap?(St(),Ln(we,Ie.endScope._wrap)):Ie.endScope&&Ie.endScope._multi?(St(),Rl(Ie.endScope,ye)):Ot.skip?ct+=we:(Ot.returnEnd||Ot.excludeEnd||(ct+=we),St(),Ot.excludeEnd&&(ct=we));do Ie.scope&&Ht.closeNode(),!Ie.skip&&!Ie.subLanguage&&(ui+=Ie.relevance),Ie=Ie.parent;while(Ie!==We.parent);return We.starts&&Ia(We.starts,ye),Ot.returnEnd?0:we.length}function Ks(){const ye=[];for(let we=Ie;we!==Jt;we=we.parent)we.scope&&ye.unshift(we.scope);ye.forEach(we=>Ht.openNode(we))}let Xi={};function La(ye,we){const Ue=we&&we[0];if(ct+=ye,Ue==null)return St(),0;if(Xi.type==="begin"&&we.type==="end"&&Xi.index===we.index&&Ue===""){if(ct+=Ce.slice(we.index,we.index+1),!kt){const We=new Error(`0 width match regex (${pe})`);throw We.languageName=pe,We.badRule=Xi.rule,We}return 1}if(Xi=we,we.type==="begin")return Pu(we);if(we.type==="illegal"&&!Ke){const We=new Error('Illegal lexeme "'+Ue+'" for mode "'+(Ie.scope||"<unnamed>")+'"');throw We.mode=Ie,We}else if(we.type==="end"){const We=wn(we);if(We!==qi)return We}if(we.type==="illegal"&&Ue==="")return ct+=`
|
|
83
|
-
`,1;if(qs>1e5&&qs>we.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ct+=Ue,Ue.length}const Jt=pn(pe);if(!Jt)throw wt(yt.replace("{}",pe)),new Error('Unknown language: "'+pe+'"');const Ml=Zt(Jt);let ja="",Ie=lt||Ml;const Il={},Ht=new Ee.__emitter(Ee);Ks();let ct="",ui=0,Lr=0,qs=0,di=!1;try{if(Jt.__emitTokens)Jt.__emitTokens(Ce,Ht);else{for(Ie.matcher.considerAll();;){qs++,di?di=!1:Ie.matcher.considerAll(),Ie.matcher.lastIndex=Lr;const ye=Ie.matcher.exec(Ce);if(!ye)break;const we=Ce.substring(Lr,ye.index),Ue=La(we,ye);Lr=ye.index+Ue}La(Ce.substring(Lr))}return Ht.finalize(),ja=Ht.toHTML(),{language:pe,value:ja,relevance:ui,illegal:!1,_emitter:Ht,_top:Ie}}catch(ye){if(ye.message&&ye.message.includes("Illegal"))return{language:pe,value:hn(Ce),illegal:!0,relevance:0,_illegalBy:{message:ye.message,index:Lr,context:Ce.slice(Lr-100,Lr+100),mode:ye.mode,resultSoFar:ja},_emitter:Ht};if(kt)return{language:pe,value:hn(Ce),illegal:!1,relevance:0,errorRaised:ye,_emitter:Ht,_top:Ie};throw ye}}function Oa(pe){const Ce={value:hn(pe),illegal:!1,relevance:0,_top:_e,_emitter:new Ee.__emitter(Ee)};return Ce._emitter.addText(pe),Ce}function Ra(pe,Ce){Ce=Ce||Ee.languages||Object.keys(se);const Ke=Oa(pe),lt=Ce.filter(pn).filter(li).map(St=>Mr(St,pe,!1));lt.unshift(Ke);const zt=lt.sort((St,Ln)=>{if(St.relevance!==Ln.relevance)return Ln.relevance-St.relevance;if(St.language&&Ln.language){if(pn(St.language).supersetOf===Ln.language)return 1;if(pn(Ln.language).supersetOf===St.language)return-1}return 0}),[ln,Dn]=zt,_n=ln;return _n.secondBest=Dn,_n}function yr(pe,Ce,Ke){const lt=Ce&&xe[Ce]||Ke;pe.classList.add("hljs"),pe.classList.add(`language-${lt}`)}function jt(pe){let Ce=null;const Ke=Lt(pe);if(De(Ke))return;if(Wi("before:highlightElement",{el:pe,language:Ke}),pe.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",pe);return}if(pe.children.length>0&&(Ee.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(pe)),Ee.throwUnescapedHTML))throw new br("One of your code blocks includes unescaped HTML.",pe.innerHTML);Ce=pe;const lt=Ce.textContent,zt=Ke?Ct(lt,{language:Ke,ignoreIllegals:!0}):Ra(lt);pe.innerHTML=zt.value,pe.dataset.highlighted="yes",yr(pe,Ke,zt.language),pe.result={language:zt.language,re:zt.relevance,relevance:zt.relevance},zt.secondBest&&(pe.secondBest={language:zt.secondBest.language,relevance:zt.secondBest.relevance}),Wi("after:highlightElement",{el:pe,result:zt,text:lt})}function on(pe){Ee=Nl(Ee,pe)}const oi=()=>{Ma(),te("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Fs(){Ma(),te("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Cl=!1;function Ma(){function pe(){Ma()}if(document.readyState==="loading"){Cl||window.addEventListener("DOMContentLoaded",pe,!1),Cl=!0;return}document.querySelectorAll(Ee.cssSelector).forEach(jt)}function Al(pe,Ce){let Ke=null;try{Ke=Ce(z)}catch(lt){if(wt("Language definition for '{}' could not be registered.".replace("{}",pe)),kt)wt(lt);else throw lt;Ke=_e}Ke.name||(Ke.name=pe),se[pe]=Ke,Ke.rawDefinition=Ce.bind(null,z),Ke.aliases&&Ir(Ke.aliases,{languageName:pe})}function Yi(pe){delete se[pe];for(const Ce of Object.keys(xe))xe[Ce]===pe&&delete xe[Ce]}function $s(){return Object.keys(se)}function pn(pe){return pe=(pe||"").toLowerCase(),se[pe]||se[xe[pe]]}function Ir(pe,{languageName:Ce}){typeof pe=="string"&&(pe=[pe]),pe.forEach(Ke=>{xe[Ke.toLowerCase()]=Ce})}function li(pe){const Ce=pn(pe);return Ce&&!Ce.disableAutodetect}function ci(pe){pe["before:highlightBlock"]&&!pe["before:highlightElement"]&&(pe["before:highlightElement"]=Ce=>{pe["before:highlightBlock"](Object.assign({block:Ce.el},Ce))}),pe["after:highlightBlock"]&&!pe["after:highlightElement"]&&(pe["after:highlightElement"]=Ce=>{pe["after:highlightBlock"](Object.assign({block:Ce.el},Ce))})}function Pt(pe){ci(pe),je.push(pe)}function Ol(pe){const Ce=je.indexOf(pe);Ce!==-1&&je.splice(Ce,1)}function Wi(pe,Ce){const Ke=pe;je.forEach(function(lt){lt[Ke]&<[Ke](Ce)})}function Dr(pe){return te("10.7.0","highlightBlock will be removed entirely in v12.0"),te("10.7.0","Please use highlightElement now."),jt(pe)}Object.assign(z,{highlight:Ct,highlightAuto:Ra,highlightAll:Ma,highlightElement:jt,highlightBlock:Dr,configure:on,initHighlighting:oi,initHighlightingOnLoad:Fs,registerLanguage:Al,unregisterLanguage:Yi,listLanguages:$s,getLanguage:pn,registerAliases:Ir,autoDetection:li,inherit:Nl,addPlugin:Pt,removePlugin:Ol}),z.debugMode=function(){kt=!1},z.safeMode=function(){kt=!0},z.versionString=ot,z.regex={concat:S,lookahead:v,either:k,optional:_,anyNumberOfTimes:x};for(const pe in Rt)typeof Rt[pe]=="object"&&e(Rt[pe]);return Object.assign(z,Rt),z},Sn=Vi({});return Sn.newInstance=()=>Vi({}),yh=Sn,Sn.HighlightJS=Sn,Sn.default=Sn,yh}var zM=jM();const BM=gl(zM),d1={},UM="hljs-";function PM(e){const t=BM.newInstance();return e&&c(e),{highlight:r,highlightAuto:a,listLanguages:o,register:c,registerAlias:u,registered:d};function r(h,m,b){const y=b||d1,v=typeof y.prefix=="string"?y.prefix:UM;if(!t.getLanguage(h))throw new Error("Unknown language: `"+h+"` is not registered");t.configure({__emitter:HM,classPrefix:v});const x=t.highlight(m,{ignoreIllegals:!0,language:h});if(x.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:x.errorRaised});const _=x._emitter.root,S=_.data;return S.language=x.language,S.relevance=x.relevance,_}function a(h,m){const y=(m||d1).subset||o();let v=-1,x=0,_;for(;++v<y.length;){const S=y[v];if(!t.getLanguage(S))continue;const O=r(S,h,m);O.data&&O.data.relevance!==void 0&&O.data.relevance>x&&(x=O.data.relevance,_=O)}return _||{type:"root",children:[],data:{language:void 0,relevance:x}}}function o(){return t.listLanguages()}function c(h,m){if(typeof h=="string")t.registerLanguage(h,m);else{let b;for(b in h)Object.hasOwn(h,b)&&t.registerLanguage(b,h[b])}}function u(h,m){if(typeof h=="string")t.registerAliases(typeof m=="string"?m:[...m],{languageName:h});else{let b;for(b in h)if(Object.hasOwn(h,b)){const y=h[b];t.registerAliases(typeof y=="string"?y:[...y],{languageName:b})}}}function d(h){return!!t.getLanguage(h)}}class HM{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const r=this.stack[this.stack.length-1],a=r.children[r.children.length-1];a&&a.type==="text"?a.value+=t:r.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,r){const a=this.stack[this.stack.length-1],o=t.root.children;r?a.children.push({type:"element",tagName:"span",properties:{className:[r]},children:o}):a.children.push(...o)}openNode(t){const r=this,a=t.split(".").map(function(u,d){return d?u+"_".repeat(d):r.options.classPrefix+u}),o=this.stack[this.stack.length-1],c={type:"element",tagName:"span",properties:{className:a},children:[]};o.children.push(c),this.stack.push(c)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const FM={};function $M(e){const t=e||FM,r=t.aliases,a=t.detect||!1,o=t.languages||LM,c=t.plainText,u=t.prefix,d=t.subset;let h="hljs";const m=PM(o);if(r&&m.registerAlias(r),u){const b=u.indexOf("-");h=b===-1?u:u.slice(0,b)}return function(b,y){Lu(b,"element",function(v,x,_){if(v.tagName!=="code"||!_||_.type!=="element"||_.tagName!=="pre")return;const S=GM(v);if(S===!1||!S&&!a||S&&c&&c.includes(S))return;Array.isArray(v.properties.className)||(v.properties.className=[]),v.properties.className.includes(h)||v.properties.className.unshift(h);const O=lR(v,{whitespace:"pre"});let k;try{k=S?m.highlight(S,O,{prefix:u}):m.highlightAuto(O,{prefix:u,subset:d})}catch(D){const w=D;if(S&&/Unknown language/.test(w.message)){y.message("Cannot highlight as `"+S+"`, it’s not registered",{ancestors:[_,v],cause:w,place:v.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw w}!S&&k.data&&k.data.language&&v.properties.className.push("language-"+k.data.language),k.children.length>0&&(v.children=k.children)})}}function GM(e){const t=e.properties.className;let r=-1;if(!Array.isArray(t))return;let a;for(;++r<t.length;){const o=String(t[r]);if(o==="no-highlight"||o==="nohighlight")return!1;!a&&o.slice(0,5)==="lang-"&&(a=o.slice(5)),!a&&o.slice(0,9)==="language-"&&(a=o.slice(9))}return a}function bs(e){return e?typeof e=="string"?e:"literalString"in e?e.literalString:"dataPath"in e?`{{${e.dataPath}}}`:"":""}function nu(e){return e?Array.isArray(e)?e:"explicitList"in e?e.explicitList:[]:[]}function KM({className:e,children:t}){const[r,a]=I.useState(!1),o=String(t).replace(/\n$/,""),c=(e==null?void 0:e.replace(/^language-/,""))??"",u=I.useCallback(()=>{navigator.clipboard.writeText(o).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},[o]);return p.jsxs("div",{className:"group/code relative my-2 rounded-md overflow-hidden",style:{border:"1px solid var(--border)"},children:[p.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",style:{background:"var(--bg-hover)",borderBottom:"1px solid var(--border)"},children:[p.jsx("span",{className:"text-tiny font-mono uppercase",style:{color:"var(--text-muted)"},children:c||"code"}),p.jsx("button",{onClick:u,className:"flex items-center gap-1 px-2 py-0.5 rounded text-tiny transition-colors",style:{color:r?"var(--accent-green)":"var(--text-muted)",background:"transparent"},title:"Copy code",children:r?p.jsxs(p.Fragment,{children:[p.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),"Copied"]}):p.jsxs(p.Fragment,{children:[p.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9.75a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184"})}),"Copy"]})})]}),p.jsx("pre",{className:"overflow-x-auto p-3 text-[13px] leading-[1.5]",style:{background:"var(--code-bg)",color:"var(--text-primary)",margin:0},children:p.jsx("code",{className:e,style:{fontFamily:"var(--font-mono)"},children:t})})]})}function qM({children:e}){return p.jsx("div",{className:"my-2 overflow-x-auto rounded-md",style:{border:"1px solid var(--border)"},children:p.jsx("table",{className:"min-w-full text-[13px]",style:{borderCollapse:"collapse"},children:e})})}function VM({children:e}){return p.jsx("thead",{style:{background:"var(--bg-hover)"},children:e})}function YM({children:e,...t}){return p.jsx("tr",{...t,style:{borderBottom:"1px solid var(--border)"},className:"hover:bg-[--bg-hover] transition-colors",children:e})}function f1({children:e,isHeader:t=!1,style:r}){const a=t?"th":"td";return p.jsx(a,{className:`px-3 py-2 text-left ${t?"font-bold":""}`,style:{color:t?"var(--text-primary)":"var(--text-secondary)",whiteSpace:"nowrap",...r},children:e})}function WM({jsonl:e,onAction:t}){const r=I.useMemo(()=>XM(e),[e]);return r?p.jsx("div",{className:"mt-1",children:Yo(r.rootId,r.components,t)}):p.jsxs("div",{className:"mt-2 px-2 py-1.5 rounded-sm text-caption",style:{background:"var(--code-bg)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:[p.jsx("span",{className:"font-bold text-tiny",style:{color:"var(--text-muted)"},children:"A2UI"}),p.jsx("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap break-words max-h-32",style:{fontFamily:"var(--font-mono)",fontSize:12},children:e})]})}function XM(e){try{const t=e.trim().split(`
|
|
84
|
-
`).filter(Boolean),r=new Map;let a="";for(const o of t){const c=JSON.parse(o);if("surfaceUpdate"in c)for(const u of c.surfaceUpdate.components)r.set(u.id,u.component);"beginRendering"in c&&(a=c.beginRendering.root)}return!a||r.size===0?null:{rootId:a,components:r}}catch{return null}}function Yo(e,t,r){const a=t.get(e);if(!a)return null;if("Text"in a){const{text:o,usageHint:c}=a.Text,u=bs(o),d=c??"body",h={h1:"text-h1 font-bold",h2:"text-h2 font-bold",h3:"text-[14px] font-bold",h4:"text-caption font-bold",h5:"text-tiny font-bold uppercase tracking-wide",caption:"text-caption",body:"text-body"};return p.jsx("p",{className:`${h[d]??"text-body"} my-0.5`,style:{color:d.startsWith("h")?"var(--text-primary)":"var(--text-secondary)"},children:u},e)}if("Button"in a){const{label:o,action:c,style:u}=a.Button,d=bs(o),h=u==="primary"||u==="filled";return p.jsx("button",{onClick:()=>{c!=null&&c.sendMessage&&r&&r(c.sendMessage,c)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-sm text-caption font-bold transition-colors ${h?"text-white":"hover:bg-[--bg-hover]"}`,style:{background:h?"var(--bg-active)":"transparent",color:h?"#fff":"var(--text-link)",border:h?"none":"1px solid var(--border)"},children:d},e)}if("Column"in a){const o=nu(a.Column.children),c=a.Column.gap??4;return p.jsx("div",{className:"flex flex-col",style:{gap:c},children:o.map(u=>Yo(u,t,r))},e)}if("Row"in a){const o=nu(a.Row.children),c=a.Row.gap??8;return p.jsx("div",{className:"flex flex-row flex-wrap items-center",style:{gap:c},children:o.map(u=>Yo(u,t,r))},e)}if("Card"in a){const o=nu(a.Card.children),c=a.Card.title?bs(a.Card.title):null;return p.jsxs("div",{className:"rounded-md p-3 my-1",style:{background:"var(--bg-hover)",border:"1px solid var(--border)"},children:[c&&p.jsx("p",{className:"text-h2 font-bold mb-2",style:{color:"var(--text-primary)"},children:c}),p.jsx("div",{className:"flex flex-col gap-1",children:o.map(u=>Yo(u,t,r))})]},e)}if("List"in a){const o=nu(a.List.children);return p.jsx("div",{className:"flex flex-col gap-0.5 my-1",children:o.map(c=>p.jsxs("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded hover:bg-[--bg-hover] transition-colors",children:[p.jsx("span",{className:"text-tiny mt-1",style:{color:"var(--text-muted)"},children:"•"}),Yo(c,t,r)]},c))},e)}if("Image"in a){const o=bs(a.Image.url),c=a.Image.alt?bs(a.Image.alt):"";return p.jsx("img",{src:o,alt:c,className:"max-w-[360px] max-h-64 rounded-md object-contain my-1",style:{border:"1px solid var(--border)"}},e)}if("Divider"in a)return p.jsx("hr",{className:"my-2",style:{border:"none",borderTop:"1px solid var(--border)"}},e);if("Icon"in a){const o=bs(a.Icon.name);return p.jsxs("span",{className:"text-body",style:{color:"var(--text-secondary)"},children:["[",o,"]"]},e)}return null}function ZM(e,t){return{pre({children:r,node:a}){var c,u,d,h;const o=(c=a==null?void 0:a.children)==null?void 0:c[0];if((o==null?void 0:o.tagName)==="code"){const m=(u=o.properties)!=null&&u.className?Array.isArray(o.properties.className)?o.properties.className.join(" "):String(o.properties.className):void 0;if(m!=null&&m.includes("language-action")){const b=String(((d=r==null?void 0:r.props)==null?void 0:d.children)??r).trim();try{const y=JSON.parse(b);if(y&&typeof y=="object"&&y.kind){const v=JM(y.prompt??b),x=t==null?void 0:t[v];return p.jsx(t5,{action:y,resolved:x,onResolve:e?(_,S)=>e(_,S):void 0})}}catch{}}return p.jsx(KM,{className:m,children:((h=r==null?void 0:r.props)==null?void 0:h.children)??r})}return p.jsx("pre",{children:r})},code({className:r,children:a,...o}){return p.jsx("code",{className:"px-1 py-0.5 rounded text-[0.85em]",style:{background:"var(--code-bg)",color:"var(--code-text)",fontFamily:"var(--font-mono)"},...o,children:a})},table({children:r}){return p.jsx(qM,{children:r})},thead({children:r}){return p.jsx(VM,{children:r})},tr({children:r,...a}){return p.jsx(YM,{...a,children:r})},th({children:r,style:a}){return p.jsx(f1,{isHeader:!0,style:a,children:r})},td({children:r,style:a}){return p.jsx(f1,{style:a,children:r})},a({href:r,children:a,...o}){return p.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--text-link)"},className:"underline underline-offset-2 hover:opacity-80 transition-opacity",...o,children:a})},blockquote({children:r}){return p.jsx("blockquote",{className:"my-2 pl-3 py-0.5",style:{borderLeft:"3px solid var(--bg-active)",color:"var(--text-secondary)"},children:r})}}}function JM(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return t.toString(36)}function QM(e,t){if(!e.includes("```action"))return e;const r=[];let a=e;const o=/```action\s*\n[\s\S]*?```/g;let c=0,u;for(;(u=o.exec(a))!==null;)u.index>c&&r.push(a.slice(c,u.index)),r.push(u[0]),c=u.index+u[0].length;const d=a.slice(c),h=d.indexOf("```action");return h!==-1&&t?r.push(d.slice(0,h)):r.push(d),r.join("")}function e5(e){return e.includes("```action")?e.replace(/```action\s*\n[\s\S]*?```/g,"").includes("```action"):!1}function t5({action:e,resolved:t,onResolve:r}){var b,y;const[a,o]=I.useState(""),[c,u]=I.useState(null);if(t)return p.jsxs("div",{className:"mt-2 rounded-lg px-4 py-3 flex items-center gap-2",style:{background:"var(--bg-hover)",border:"1px solid var(--border)",opacity:.85},children:[p.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,style:{color:"var(--accent-green, #34d399)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),p.jsxs("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:["Selected: ",p.jsx("strong",{style:{color:"var(--text-primary)"},children:t.label??t.value})]})]});const d=v=>{r&&r(v.value,v.label)},h=()=>{const v=a.trim();v&&r&&r(v,v)},m=(v,x)=>{const _=c===x;return v.style==="primary"?{background:"var(--bg-active)",color:"#fff",border:"none",opacity:_?.9:1}:v.style==="danger"?{background:_?"rgba(239,68,68,0.15)":"transparent",color:"var(--accent-red, #ef4444)",border:"1px solid var(--accent-red, #ef4444)"}:{background:_?"var(--bg-hover)":"transparent",color:"var(--text-link)",border:"1px solid var(--border)"}};if(e.kind==="confirm"){const v=((b=e.items)==null?void 0:b[0])??{label:"Yes",value:"yes"},x=((y=e.items)==null?void 0:y[1])??{label:"No",value:"no"};return p.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden",style:{border:"1px solid var(--border)",background:"var(--bg-secondary, var(--bg-hover))"},children:[e.prompt&&p.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:p.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),p.jsxs("div",{className:"flex",children:[p.jsx("button",{onClick:()=>d(x),onMouseEnter:()=>u(0),onMouseLeave:()=>u(null),className:"flex-1 px-4 py-2.5 text-caption font-bold transition-all cursor-pointer",style:{background:c===0?"var(--bg-hover)":"transparent",color:"var(--text-secondary)",borderRight:"1px solid var(--border)",border:"none",borderRightWidth:1,borderRightStyle:"solid",borderRightColor:"var(--border)"},children:x.label}),p.jsx("button",{onClick:()=>d(v),onMouseEnter:()=>u(1),onMouseLeave:()=>u(null),className:"flex-1 px-4 py-2.5 text-caption font-bold transition-all cursor-pointer",style:{background:"var(--bg-active)",color:"#fff",border:"none",opacity:c===1?.9:1},children:v.label})]})]})}return e.kind==="buttons"&&e.items?p.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden",style:{border:"1px solid var(--border)",background:"var(--bg-secondary, var(--bg-hover))"},children:[e.prompt&&p.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:p.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),p.jsx("div",{className:"flex flex-wrap gap-2 px-4 py-3",children:e.items.map((v,x)=>p.jsx("button",{onClick:()=>d(v),onMouseEnter:()=>u(x),onMouseLeave:()=>u(null),className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-md text-caption font-bold transition-all cursor-pointer",style:m(v,x),children:v.label},v.value))})]}):e.kind==="select"&&e.items?p.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden",style:{border:"1px solid var(--border)",background:"var(--bg-secondary, var(--bg-hover))"},children:[e.prompt&&p.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:p.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),p.jsx("div",{className:"flex flex-col",children:e.items.map((v,x)=>p.jsxs("button",{onClick:()=>d(v),onMouseEnter:()=>u(x),onMouseLeave:()=>u(null),className:"flex items-center gap-3 px-4 py-2.5 text-left transition-all cursor-pointer",style:{background:c===x?"var(--bg-hover)":"transparent",color:"var(--text-primary)",borderBottom:x<e.items.length-1?"1px solid var(--border)":"none",border:"none",borderBottomWidth:x<e.items.length-1?1:0,borderBottomStyle:"solid",borderBottomColor:"var(--border)"},children:[p.jsx("span",{className:"w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0",style:{border:"2px solid var(--border)",background:c===x?"var(--bg-active)":"transparent"},children:c===x&&p.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"#fff"}})}),p.jsx("span",{className:"text-caption",children:v.label})]},v.value))})]}):e.kind==="input"?p.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden",style:{border:"1px solid var(--border)",background:"var(--bg-secondary, var(--bg-hover))"},children:[e.prompt&&p.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:p.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),p.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[p.jsx("input",{type:"text",value:a,onChange:v=>o(v.target.value),onKeyDown:v=>{v.key==="Enter"&&h()},placeholder:e.placeholder??"Type your answer...",className:"flex-1 px-3 py-2 rounded-md text-caption outline-none",style:{background:"var(--bg-primary, var(--bg))",color:"var(--text-primary)",border:"1px solid var(--border)"}}),p.jsx("button",{onClick:h,disabled:!a.trim(),className:"px-4 py-2 rounded-md text-caption font-bold transition-all cursor-pointer",style:{background:a.trim()?"var(--bg-active)":"var(--bg-hover)",color:a.trim()?"#fff":"var(--text-muted)",border:"none"},children:"Submit"})]})]}):null}function n5(){return p.jsxs("div",{className:"mt-2 rounded-lg px-4 py-3 flex items-center gap-3",style:{background:"var(--bg-secondary, var(--bg-hover))",border:"1px solid var(--border)"},children:[p.jsx("span",{className:"inline-block w-2 h-2 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),p.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:"Preparing options..."})]})}function Jh({text:e,mediaUrl:t,messageId:r,encrypted:a,a2ui:o,className:c="",isStreaming:u,onAction:d,onResolveAction:h,resolvedActions:m}){const b=I.useMemo(()=>ZM(h,m),[h,m]),y=I.useMemo(()=>QM(e,u),[e,u]),v=u&&e5(e);return p.jsxs("div",{className:c,children:[t&&p.jsx("div",{className:"mb-2",children:p.jsx(r5,{url:t,mediaContextId:a&&r?`${r}:media`:void 0})}),y?p.jsx("div",{className:"prose prose-sm max-w-none overflow-hidden prose-p:my-1 prose-ul:my-1 prose-ol:my-1 prose-pre:my-0 prose-code:before:content-none prose-code:after:content-none prose-headings:my-2",style:{color:"var(--text-primary)",overflowWrap:"break-word",wordBreak:"break-word","--tw-prose-headings":"var(--text-primary)","--tw-prose-bold":"var(--text-primary)","--tw-prose-code":"var(--code-text)","--tw-prose-pre-code":"var(--text-primary)","--tw-prose-pre-bg":"var(--code-bg)","--tw-prose-bullets":"var(--text-muted)","--tw-prose-counters":"var(--text-muted)"},children:p.jsx(u0,{remarkPlugins:[D0],rehypePlugins:[$M],components:b,children:y})}):null,v&&p.jsx(n5,{}),o&&p.jsx(WM,{jsonl:o,onAction:d})]})}function r5({url:e,mediaContextId:t}){var h,m;const[r,a]=I.useState(null),[o,c]=I.useState(!1);I.useEffect(()=>{if(!t||!it.hasKey()){a(null);return}let b=!1;return c(!0),(async()=>{try{const y=await fetch(e);if(!y.ok)throw new Error(`HTTP ${y.status}`);const v=new Uint8Array(await y.arrayBuffer()),x=await it.decryptMedia(v,t);if(!b){const _=new Blob([x.buffer.slice(0)]);a(URL.createObjectURL(_))}}catch(y){console.warn("[E2E] Media decryption failed, falling back to direct URL:",y),b||a(null)}finally{b||c(!1)}})(),()=>{b=!0,r&&URL.revokeObjectURL(r)}},[e,t]);const u=r||e,d=((h=e.split(".").pop())==null?void 0:h.toLowerCase().split("?")[0])??"";if(o)return p.jsx("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md max-w-[360px]",style:{background:"var(--bg-hover)",border:"1px solid var(--border)"},children:p.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:"Decrypting media..."})});if(["mp3","wav","ogg","m4a","aac","webm"].includes(d))return p.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-md max-w-[360px]",style:{background:"var(--bg-hover)",border:"1px solid var(--border)"},children:[p.jsx("svg",{className:"w-8 h-8 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-link)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})}),p.jsx("audio",{controls:!0,className:"flex-1 h-8",style:{maxWidth:280},children:p.jsx("source",{src:u})})]});if(["mp4","mov","avi","mkv"].includes(d))return p.jsx("video",{controls:!0,className:"max-w-[360px] max-h-64 rounded-md",style:{border:"1px solid var(--border)"},children:p.jsx("source",{src:u})});if(["pdf","zip","tar","gz","doc","docx","xls","xlsx","csv"].includes(d)){const b=((m=e.split("/").pop())==null?void 0:m.split("?")[0])??"file";return p.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 px-3 py-2.5 rounded-md max-w-[360px] hover:opacity-90 transition-opacity",style:{background:"var(--bg-hover)",border:"1px solid var(--border)",textDecoration:"none"},children:[p.jsx("svg",{className:"w-8 h-8 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-link)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("p",{className:"text-caption font-bold truncate",style:{color:"var(--text-primary)"},children:b}),p.jsxs("p",{className:"text-tiny",style:{color:"var(--text-muted)"},children:[d.toUpperCase()," — Click to open"]})]}),p.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,style:{color:"var(--text-muted)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})})]})}return p.jsx("img",{src:u,alt:"",className:"max-w-[360px] max-h-64 rounded-md object-contain cursor-pointer hover:opacity-90 transition-opacity",style:{border:"1px solid var(--border)"},onClick:()=>window.open(u,"_blank")})}const fl="botschat:sessionHistory",vh="botschat:sessionCounter";function i5(e){try{const t=JSON.parse(localStorage.getItem(fl)||"{}");return Array.isArray(t[e])?t[e]:[]}catch{return[]}}function h1(e,t){try{const r=JSON.parse(localStorage.getItem(fl)||"{}"),o=(Array.isArray(r[e])?r[e]:[]).filter(c=>c!==t);o.unshift(t),r[e]=o.slice(0,50),localStorage.setItem(fl,JSON.stringify(r))}catch{}}function a5(e){const t=e.match(/^Session\s+(\d+)$/);return t?parseInt(t[1],10):0}function s5(e,t){let r=0;try{const c=JSON.parse(localStorage.getItem(vh)||"{}");r=typeof c[e]=="number"?c[e]:0}catch{}const a=t.reduce((c,u)=>Math.max(c,a5(u.name)),0),o=Math.max(r,a)+1;try{const c=JSON.parse(localStorage.getItem(vh)||"{}");c[e]=o,localStorage.setItem(vh,JSON.stringify(c))}catch{}return o}function o5(e,t){try{const r=JSON.parse(localStorage.getItem(fl)||"{}"),a=Array.isArray(r[e])?r[e]:[];r[e]=a.filter(o=>o!==t),localStorage.setItem(fl,JSON.stringify(r))}catch{}}function l5({channelId:e}){const t=gr(),r=ai(),[a,o]=I.useState(null),[c,u]=I.useState(""),[d,h]=I.useState(null),m=I.useRef(null),b=I.useRef(null),y=I.useRef(null),v=t.sessions,x=t.selectedSessionId;I.useEffect(()=>{a&&m.current&&(m.current.focus(),m.current.select())},[a]),I.useEffect(()=>{if(!d)return;const w=A=>{y.current&&!y.current.contains(A.target)&&h(null)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[d]);const _=I.useCallback(w=>{if(w===x)return;const A=v.find(L=>L.id===w);A&&(ne.info("Session",`Switched to session: ${A.name} (${A.id})`),e&&h1(e,A.id),r({type:"SELECT_SESSION",sessionId:A.id,sessionKey:A.sessionKey}))},[x,v,e,r]),S=I.useCallback(async()=>{try{let w=e;if(!w){ne.info("Session","No channel for default agent — auto-creating General channel"),w=(await ir.create({name:"General",openclawAgentId:"main"})).id;const[{agents:$},{channels:V}]=await Promise.all([ks.list(),ir.list()]);r({type:"SET_AGENTS",agents:$}),r({type:"SET_CHANNELS",channels:V});const{sessions:ee}=await ws.list(w);r({type:"SET_SESSIONS",sessions:ee}),ee.length>0&&r({type:"SELECT_SESSION",sessionId:ee[0].id,sessionKey:ee[0].sessionKey});return}const A=s5(w,v),L=await ws.create(w,`Session ${A}`);ne.info("Session",`Created session: ${L.name} (${L.id})`),r({type:"ADD_SESSION",session:L}),h1(w,L.id),r({type:"SELECT_SESSION",sessionId:L.id,sessionKey:L.sessionKey}),requestAnimationFrame(()=>{b.current&&(b.current.scrollLeft=b.current.scrollWidth)})}catch(w){ne.error("Session",`Failed to create session: ${w}`)}},[e,v,r]),O=I.useCallback(async w=>{if(!(v.length<=1||!e))try{if(await ws.delete(e,w),ne.info("Session",`Deleted session: ${w}`),r({type:"REMOVE_SESSION",sessionId:w}),o5(e,w),h(null),x===w){const A=v.filter(L=>L.id!==w);if(A.length>0){const M=i5(e).map($=>A.find(V=>V.id===$)).find(Boolean)??A[0];r({type:"SELECT_SESSION",sessionId:M.id,sessionKey:M.sessionKey})}}}catch(A){ne.error("Session",`Failed to delete session: ${A}`)}},[e,v,x,r]),k=I.useCallback((w,A)=>{o(w),u(A)},[]),D=I.useCallback(async()=>{if(!a||!c.trim()||!e){o(null);return}try{await ws.rename(e,a,c.trim()),ne.info("Session",`Renamed session ${a} to: ${c.trim()}`),r({type:"RENAME_SESSION",sessionId:a,name:c.trim()})}catch(w){ne.error("Session",`Failed to rename session: ${w}`)}o(null)},[e,a,c,r]);return p.jsxs("div",{className:"flex items-center gap-0 px-3",style:{height:36,borderBottom:"1px solid var(--border)",background:"var(--bg-surface)"},children:[p.jsxs("div",{ref:b,className:"flex items-center gap-0.5 overflow-x-auto no-scrollbar",children:[v.map(w=>{const A=w.id===x,L=w.id===a;return p.jsx("div",{className:"group relative flex items-center shrink-0",children:L?p.jsx("input",{ref:m,value:c,onChange:M=>u(M.target.value),onBlur:D,onKeyDown:M=>{M.key==="Enter"&&!M.nativeEvent.isComposing&&(M.preventDefault(),D()),M.key==="Escape"&&o(null)},className:"px-2.5 py-1 text-caption rounded-t-md focus:outline-none",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)",borderBottom:"none",minWidth:60,maxWidth:140}}):p.jsx("button",{onClick:()=>_(w.id),onDoubleClick:()=>k(w.id,w.name),className:"flex items-center gap-1 px-2.5 py-1 text-caption rounded-t-md transition-colors whitespace-nowrap",style:{background:A?"var(--bg-hover)":"transparent",color:A?"var(--text-primary)":"var(--text-secondary)",fontWeight:A?700:400,borderBottom:A?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:-1},title:`${w.name} (double-click to rename)`,children:p.jsx("span",{className:"max-w-[120px] truncate",children:w.name})})},w.id)}),p.jsx("button",{onClick:S,className:"shrink-0 w-7 h-7 flex items-center justify-center rounded-md transition-colors ml-0.5",style:{color:"var(--text-muted)"},title:"New session","aria-label":"New session",onMouseEnter:w=>{w.currentTarget.style.background="var(--bg-hover)",w.currentTarget.style.color="var(--text-primary)"},onMouseLeave:w=>{w.currentTarget.style.background="",w.currentTarget.style.color="var(--text-muted)"},children:p.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})})})]}),v.length>1&&x&&p.jsxs("div",{className:"relative ml-auto pl-2 flex-shrink-0",children:[p.jsx("button",{onClick:()=>h(x),className:"w-7 h-7 flex items-center justify-center rounded-md transition-colors",style:{color:"var(--text-muted)"},title:"Close current session","aria-label":"Close current session",onMouseEnter:w=>{w.currentTarget.style.background="var(--bg-hover)",w.currentTarget.style.color="var(--text-primary)"},onMouseLeave:w=>{w.currentTarget.style.background="",w.currentTarget.style.color="var(--text-muted)"},children:p.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),d&&p.jsxs("div",{ref:y,className:"absolute right-0 top-full mt-1 z-50 rounded-md shadow-lg py-2 px-3 min-w-[180px]",style:{background:"var(--bg-surface)",border:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},children:[p.jsx("p",{className:"text-caption mb-2",style:{color:"var(--text-primary)"},children:"Close this session?"}),p.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[p.jsx("button",{onClick:()=>h(null),className:"px-2.5 py-1 text-caption rounded-md transition-colors",style:{color:"var(--text-secondary)"},onMouseEnter:w=>{w.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:w=>{w.currentTarget.style.background=""},children:"Cancel"}),p.jsx("button",{onClick:()=>O(d),className:"px-2.5 py-1 text-caption font-bold rounded-md text-white transition-colors",style:{background:"#e74c3c"},onMouseEnter:w=>{w.currentTarget.style.background="#c0392b"},onMouseLeave:w=>{w.currentTarget.style.background="#e74c3c"},children:"Close"})]})]})]})]})}const p1=768;function Bp(){const[e,t]=I.useState(()=>typeof window>"u"?!1:window.innerWidth<p1);return I.useEffect(()=>{const r=window.matchMedia(`(max-width: ${p1-1}px)`),a=o=>t(o.matches);return t(r.matches),r.addEventListener("change",a),()=>r.removeEventListener("change",a)},[]),e}function Gn(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=new Uint8Array(16);if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(let r=0;r<16;r++)e[r]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e,r=>r.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function c5(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return t.toString(36)}const m1=[{cmd:"/help",label:"Help",icon:"?"},{cmd:"/status",label:"Status",icon:"i"},{cmd:"/model",label:"Model",icon:"M"},{cmd:"/clear",label:"Clear",icon:"C"},{cmd:"/think",label:"Think",icon:"T"},{cmd:"/image",label:"Image",icon:"I"},{cmd:"/search",label:"Search",icon:"S"},{cmd:"/summarize",label:"Summarize",icon:"Σ"},{cmd:"/translate",label:"Translate",icon:"翻"},{cmd:"/reset",label:"Reset",icon:"R"}],nE="botschat_skill_freq_v2",g1="botschat_skill_freq",u5=2,d5=14;function rE(e=new Date){return e.toISOString().slice(0,10)}function iE(e){const t=Date.now()-d5*864e5;for(const r of Object.values(e))for(const a of Object.keys(r.daily))new Date(a).getTime()<t&&delete r.daily[a]}function aE(){try{const e=localStorage.getItem(nE);if(e){const r=JSON.parse(e);return iE(r),r}const t=localStorage.getItem(g1);if(t){const r=JSON.parse(t),a=rE(),o={};for(const[c,u]of Object.entries(r))o[c]={total:u,daily:{[a]:u}};return sE(o),localStorage.removeItem(g1),o}return{}}catch{return{}}}function sE(e){iE(e),localStorage.setItem(nE,JSON.stringify(e))}function xh(e){const t=e.match(/^\/(\S+)/);if(!t)return null;const r=`/${t[1]}`,a=aE(),o=rE();return a[r]||(a[r]={total:0,daily:{}}),a[r].total+=1,a[r].daily[o]=(a[r].daily[o]??0)+1,sE(a),r}function oE(e){const t=Date.now()-u5*864e5;let r=0;for(const[a,o]of Object.entries(e.daily))new Date(a).getTime()>=t&&(r+=o);return r}function b1(e){return oE(e)*5+e.total}function f5(){const e=aE(),t=new Set(m1.map(o=>o.cmd)),r=Object.keys(e).filter(o=>!t.has(o)&&o.startsWith("/")).map(o=>({cmd:o,label:o.slice(1).charAt(0).toUpperCase()+o.slice(2),icon:o.slice(1).charAt(0).toUpperCase()}));return{skills:[...m1,...r].sort((o,c)=>{const u=e[o.cmd]?b1(e[o.cmd]):0;return(e[c.cmd]?b1(e[c.cmd]):0)-u}),store:e}}function lE({sendMessage:e}){var Rt,an,qn,ar;const t=gr(),r=ai(),a=Bp(),[o,c]=I.useState(""),[u,d]=I.useState(0),[h,m]=I.useState(null),[b,y]=I.useState(!1),[v,x]=I.useState(!1),[_,S]=I.useState(null),O=I.useRef(null),k=I.useRef(null),D=I.useRef(null),w=I.useRef(null),A=t.selectedSessionKey,{skills:L,store:M}=I.useMemo(()=>f5(),[u]);I.useEffect(()=>{var ce;(ce=O.current)==null||ce.scrollIntoView({behavior:"smooth"})},[t.messages]),I.useEffect(()=>{k.current&&(k.current.style.height="auto",k.current.style.height=Math.min(k.current.scrollHeight,160)+"px")},[o]),I.useEffect(()=>{a||A&&k.current&&requestAnimationFrame(()=>{var ce;(ce=k.current)==null||ce.focus()})},[A,a]),I.useEffect(()=>{if(A)try{const be=JSON.parse(localStorage.getItem("botschat:sessionModels")||"{}")[A];be&&be!==t.sessionModel?r({type:"SET_SESSION_MODEL",model:be}):!be&&t.sessionModel&&r({type:"SET_SESSION_MODEL",model:null})}catch{}},[A]);const $=t.sessionModel??t.defaultModel,V=I.useCallback(ce=>{var ve;if(!ce||!A||ce===$)return;ne.info("Chat",`Model change: ${$??"none"} → ${ce}`),r({type:"SET_SESSION_MODEL",model:ce});try{const Ne=JSON.parse(localStorage.getItem("botschat:sessionModels")||"{}");Ne[A]=ce,localStorage.setItem("botschat:sessionModels",JSON.stringify(Ne))}catch{}xh("/model"),d(Ne=>Ne+1);const be={id:Gn(),sender:"user",text:`/model ${ce}`,timestamp:Date.now()};r({type:"ADD_MESSAGE",message:be}),e({type:"user.message",sessionKey:A,text:`/model ${ce}`,userId:((ve=t.user)==null?void 0:ve.id)??"",messageId:be.id}),requestAnimationFrame(()=>{var Ne;(Ne=O.current)==null||Ne.scrollIntoView({behavior:"smooth"})})},[A,$,(Rt=t.user)==null?void 0:Rt.id,e,r]),ee=I.useCallback(ce=>{var be;ne.info("Skill",`Skill button clicked: ${ce}`),c(ve=>ve.startsWith(ce+" ")||ve===ce?ve:ce+" "),(be=k.current)==null||be.focus()},[]),U=I.useCallback(ce=>{var Ne,$e;const be=(Ne=ce.target.files)==null?void 0:Ne[0];if(!be)return;const ve=be.type.startsWith("image/")?URL.createObjectURL(be):"";m({file:be,preview:ve}),ce.target.value="",($e=k.current)==null||$e.focus()},[]),F=I.useCallback(()=>{h&&(URL.revokeObjectURL(h.preview),m(null))},[h]),Y=I.useCallback(async(ce,be)=>{const ve=localStorage.getItem("botschat_token");try{let Ne=ce;if(it.hasKey()&&be){const Xt=await ce.arrayBuffer(),Rr=new Uint8Array(Xt),{encrypted:wt}=await it.encryptMedia(Rr,be);Ne=new Blob([wt.buffer.slice(0)],{type:ce.type}),ne.info("E2E",`Encrypted media (${Rr.length} bytes, ctx=${be.slice(0,8)}…)`)}const $e=new FormData;$e.append("file",Ne,ce.name);const bt=await fetch("/api/upload",{method:"POST",headers:ve?{Authorization:`Bearer ${ve}`}:{},body:$e});if(!bt.ok){const Xt=await bt.json().catch(()=>({error:"Upload failed"}));throw new Error(Xt.error??`HTTP ${bt.status}`)}const Vt=await bt.json();return{url:Vt.url.startsWith("/")?`${window.location.origin}${Vt.url}`:Vt.url}}catch(Ne){return ne.error("Upload",`File upload failed: ${Ne}`),null}},[]),ue=I.useCallback(ce=>{ce.preventDefault(),ce.stopPropagation(),ce.dataTransfer.types.includes("Files")&&x(!0)},[]),ie=I.useCallback(ce=>{var ve;ce.preventDefault(),ce.stopPropagation();const be=(ve=w.current)==null?void 0:ve.getBoundingClientRect();if(be){const{clientX:Ne,clientY:$e}=ce;(Ne<be.left||Ne>be.right||$e<be.top||$e>be.bottom)&&x(!1)}},[]),K=I.useCallback(ce=>{ce.preventDefault(),ce.stopPropagation()},[]),B=I.useCallback(ce=>{var ve,Ne;ce.preventDefault(),ce.stopPropagation(),x(!1);const be=(ve=ce.dataTransfer.files)==null?void 0:ve[0];if(be){const $e=be.type.startsWith("image/")?URL.createObjectURL(be):"";m({file:be,preview:$e}),(Ne=k.current)==null||Ne.focus()}},[]),Q=I.useCallback(ce=>{var ve;const be=(ve=ce.clipboardData)==null?void 0:ve.items;if(be){for(let Ne=0;Ne<be.length;Ne++)if(be[Ne].type.startsWith("image/")){ce.preventDefault();const $e=be[Ne].getAsFile();if($e){const bt=URL.createObjectURL($e);m({file:$e,preview:bt})}return}}},[]),ae=async()=>{var sr;if(!o.trim()&&!h||!A)return;t.openclawConnected||ne.warn("Chat","Sending while OpenClaw appears offline — message will be delivered when reconnected");const ce=o.trim(),be=_?`> ${_.text.split(`
|
|
85
|
-
`).slice(0,3).join(`
|
|
86
|
-
> `)}
|
|
87
|
-
|
|
88
|
-
${ce}`:ce;S(null);const ve=be.length>0,Ne=ve&&be.startsWith("/");ne.info("Chat",`Send message${Ne?" (skill)":""}${h?" +image":""}: ${be.length>120?be.slice(0,120)+"…":be}`,{sessionKey:A,isSkill:Ne}),ve&&(xh(be),d(Xt=>Xt+1));const $e=Gn();let bt;if(h){y(!0);const Xt=await Y(h.file,`${$e}:media`);if(y(!1),!Xt)return;bt=Xt.url,F()}const Vt={id:$e,sender:"user",text:be,timestamp:Date.now(),mediaUrl:bt};r({type:"ADD_MESSAGE",message:Vt}),e({type:"user.message",sessionKey:A,text:be,userId:((sr=t.user)==null?void 0:sr.id)??"",messageId:Vt.id,...bt?{mediaUrl:bt}:{}}),c(""),requestAnimationFrame(()=>{var Xt;(Xt=O.current)==null||Xt.scrollIntoView({behavior:"smooth"})})},P=ce=>{ne.info("Thread",`Open thread for message: ${ce}`),r({type:"OPEN_THREAD",threadId:ce,messages:[]})},T=I.useCallback(ce=>{var be;S(ce),a||(be=k.current)==null||be.focus()},[a]),R=I.useCallback(async ce=>{try{await navigator.clipboard.writeText(ce)}catch{const be=document.createElement("textarea");be.value=ce,be.style.position="fixed",be.style.left="-9999px",document.body.appendChild(be),be.select(),document.execCommand("copy"),document.body.removeChild(be)}},[]),q=I.useCallback(ce=>{var ve;if(!A)return;ne.info("A2UI",`Action triggered: ${ce}`);const be={id:Gn(),sender:"user",text:ce,timestamp:Date.now()};r({type:"ADD_MESSAGE",message:be}),e({type:"user.message",sessionKey:A,text:ce,userId:((ve=t.user)==null?void 0:ve.id)??"",messageId:be.id}),requestAnimationFrame(()=>{var Ne;(Ne=O.current)==null||Ne.scrollIntoView({behavior:"smooth"})})},[A,(an=t.user)==null?void 0:an.id,e,r]),C=I.useCallback((ce,be,ve)=>{var bt;if(!A)return;ne.info("ActionCard",`Resolved: "${ve}" (value="${be}")`);const Ne=c5(ve+be);r({type:"RESOLVE_ACTION",messageId:ce,promptHash:Ne,value:be,label:ve});const $e={id:Gn(),sender:"user",text:ve,timestamp:Date.now()};r({type:"ADD_MESSAGE",message:$e}),e({type:"user.message",sessionKey:A,text:ve,userId:((bt=t.user)==null?void 0:bt.id)??"",messageId:$e.id}),requestAnimationFrame(()=>{var Vt;(Vt=O.current)==null||Vt.scrollIntoView({behavior:"smooth"})})},[A,(qn=t.user)==null?void 0:qn.id,e,r]),de=I.useCallback(()=>{var ve;if(!A||!t.streamingRunId)return;ne.info("Chat","Stop streaming requested");const ce=t.streamingThreadId?`${A}:thread:${t.streamingThreadId}`:A,be={id:Gn(),sender:"user",text:"/stop",timestamp:Date.now()};t.streamingThreadId?r({type:"ADD_THREAD_MESSAGE",message:be}):r({type:"ADD_MESSAGE",message:be}),e({type:"user.message",sessionKey:ce,text:"/stop",userId:((ve=t.user)==null?void 0:ve.id)??"",messageId:be.id}),xh("/stop"),d(Ne=>Ne+1),requestAnimationFrame(()=>{var Ne;(Ne=O.current)==null||Ne.scrollIntoView({behavior:"smooth"})})},[A,t.streamingRunId,t.streamingThreadId,(ar=t.user)==null?void 0:ar.id,e,r]),fe=!!t.streamingRunId&&!t.streamingThreadId,he=t.agents.find(ce=>ce.id===t.selectedAgentId),Te=(he==null?void 0:he.name)??"channel",Le=(he==null?void 0:he.channelId)??null,et=!!he;return A?p.jsxs("div",{ref:w,className:"flex-1 flex flex-col min-w-0 h-full relative",style:{background:"var(--bg-surface)"},onDragEnter:ue,onDragLeave:ie,onDragOver:K,onDrop:B,children:[v&&p.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0,0,0,0.4)",pointerEvents:"none"},children:p.jsxs("div",{className:"flex flex-col items-center gap-3 p-8 rounded-lg",style:{background:"var(--bg-surface)",border:"2px dashed var(--text-link)"},children:[p.jsx("svg",{className:"w-12 h-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-link)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909M3.75 21h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v13.5A1.5 1.5 0 003.75 21z"})}),p.jsx("span",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:"Drop image here"})]})}),!a&&p.jsxs("div",{className:"flex items-center justify-between px-3 sm:px-5 gap-2 flex-shrink-0",style:{height:44,borderBottom:"1px solid var(--border)"},children:[p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[p.jsxs("span",{className:"text-h1 truncate",style:{color:"var(--text-primary)"},children:["# ",Te]}),he&&!he.isDefault&&p.jsx("span",{className:"text-caption hidden sm:inline flex-shrink-0",style:{color:"var(--text-secondary)"},children:"— custom channel"})]}),p.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[p.jsx("svg",{className:"w-3.5 h-3.5 hidden sm:block",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-muted)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456z"})}),p.jsx(Au,{value:$??"",onChange:V,models:t.models,disabled:!t.openclawConnected,placeholder:"No model",compact:!0})]})]}),et&&p.jsx(l5,{channelId:Le}),p.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto overflow-x-hidden",children:[t.messages.length===0&&p.jsx("div",{className:"py-12 px-5 text-center",children:p.jsx("p",{className:"text-caption",style:{color:"var(--text-muted)"},children:"No messages yet. Start a conversation."})}),t.messages.map((ce,be)=>{const ve=be>0?t.messages[be-1]:null,Ne=(ve==null?void 0:ve.sender)===ce.sender&&ce.timestamp-ve.timestamp<3e5;return p.jsx(h5,{msg:ce,grouped:Ne,onOpenThread:()=>P(ce.id),onQuote:()=>T(ce),onCopy:()=>R(ce.text),onAction:q,onResolveAction:($e,bt)=>C(ce.id,$e,bt),onStop:de},ce.id)}),p.jsx("div",{ref:O})]}),p.jsxs("div",{className:"flex-shrink-0 px-3 sm:px-5 pb-3 sm:pb-4 pt-2",children:[p.jsx("div",{className:"flex items-center gap-1.5 pb-1.5 overflow-x-auto no-scrollbar",children:L.map(ce=>{const be=M[ce.cmd],ve=(be==null?void 0:be.total)??0,Ne=be?oE(be):0,$e=o.startsWith(ce.cmd+" ")||o===ce.cmd;return p.jsxs("button",{onClick:()=>ee(ce.cmd),className:"flex items-center gap-1 px-2 py-1 rounded-md text-xs whitespace-nowrap transition-colors shrink-0",style:{background:$e?"var(--bg-active)":"var(--bg-hover)",color:$e?"#fff":"var(--text-secondary)",border:"1px solid transparent"},title:`${ce.cmd}${ve>0?` (total ${ve}x${Ne>0?`, recent ${Ne}x`:""})`:""}`,children:[p.jsx("span",{className:"font-mono text-[10px] opacity-70",children:ce.cmd}),ve>0&&p.jsx("span",{className:"ml-0.5 px-1 rounded-sm text-[10px] font-bold",style:{background:$e?"rgba(255,255,255,0.2)":"var(--bg-surface)",color:$e?"#fff":"var(--text-muted)"},children:ve})]},ce.cmd)})}),_&&p.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 mb-1 rounded-md text-caption",style:{background:"var(--bg-hover)",borderLeft:"3px solid var(--text-link)",color:"var(--text-secondary)"},children:[p.jsx("svg",{className:"w-3.5 h-3.5 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 15L3 9m0 0l6-6M3 9h12a6 6 0 010 12h-3"})}),p.jsxs("span",{className:"truncate flex-1",children:[_.sender==="user"?"You":"Agent",": ",_.text.slice(0,80),_.text.length>80?"...":""]}),p.jsx("button",{onClick:()=>S(null),className:"p-0.5 rounded hover:bg-[--bg-surface] shrink-0",style:{color:"var(--text-muted)"},children:p.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),p.jsxs("div",{className:"rounded-md",style:{border:"1px solid var(--border)",background:"var(--bg-surface)"},children:[h&&p.jsxs("div",{className:"px-3 pt-2 flex items-start gap-2",children:[p.jsxs("div",{className:"relative",children:[h.preview?p.jsx("img",{src:h.preview,alt:"Preview",className:"max-w-[120px] max-h-[80px] rounded-md object-contain",style:{border:"1px solid var(--border)"}}):p.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-2 rounded-md text-caption",style:{border:"1px solid var(--border)",background:"var(--bg-hover)"},children:[p.jsx("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-muted)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),p.jsx("span",{className:"truncate max-w-[100px]",style:{color:"var(--text-secondary)"},children:h.file.name})]}),p.jsx("button",{onClick:F,className:"absolute -top-1.5 -right-1.5 w-5 h-5 rounded-full flex items-center justify-center text-white opacity-80 hover:opacity-100 transition-opacity",style:{background:"#e74c3c",fontSize:11},title:"Remove file",children:"✕"})]}),b&&p.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:"Uploading…"})]}),p.jsx("textarea",{ref:k,value:o,onChange:ce=>c(ce.target.value),onKeyDown:ce=>{ce.key==="Enter"&&!ce.shiftKey&&!ce.nativeEvent.isComposing&&(ce.preventDefault(),ae())},onPaste:Q,placeholder:t.openclawConnected?`Message #${Te}`:"OpenClaw is offline…",disabled:!t.openclawConnected,rows:1,className:"w-full px-3 py-2.5 text-body bg-transparent resize-none focus:outline-none disabled:opacity-50 placeholder:text-[--text-muted]",style:{color:"var(--text-primary)",minHeight:40}}),p.jsxs("div",{className:"flex items-center justify-between px-3 pb-2",children:[p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("input",{ref:D,type:"file",accept:"image/*,application/pdf,.txt,.csv,.md,.json,.zip,.gz,.mp3,.wav,.mp4,.mov",className:"hidden",onChange:U}),p.jsx("button",{onClick:()=>{var ce;return(ce=D.current)==null?void 0:ce.click()},className:"p-1.5 rounded hover:bg-[--bg-hover] transition-colors flex items-center gap-1",style:{color:"var(--text-secondary)"},title:"Attach file","aria-label":"Attach file",disabled:!t.openclawConnected,children:p.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.375 12.739l-7.693 7.693a4.5 4.5 0 01-6.364-6.364l10.94-10.94A3 3 0 1119.5 7.372L8.552 18.32m.009-.01l-.01.01m5.699-9.941l-7.81 7.81a1.5 1.5 0 002.112 2.13"})})})]}),fe?p.jsx("button",{onClick:de,className:"px-3 py-1.5 rounded-sm text-caption font-bold text-white transition-colors",style:{background:"#e74c3c"},onMouseEnter:ce=>{ce.currentTarget.style.background="#c0392b"},onMouseLeave:ce=>{ce.currentTarget.style.background="#e74c3c"},title:"Stop generating",children:p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:p.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),"Stop"]})}):p.jsx("button",{onClick:ae,disabled:!o.trim()&&!h,className:"px-3 py-1.5 rounded-sm text-caption font-bold text-white disabled:opacity-40 disabled:cursor-not-allowed transition-colors",style:{background:"var(--bg-active)"},children:p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})}),"Send"]})})]})]})]})]}):p.jsx("div",{className:"flex-1 h-full flex items-center justify-center",style:{background:"var(--bg-surface)"},children:p.jsxs("div",{className:"text-center",children:[p.jsx("svg",{className:"w-16 h-16 mx-auto mb-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,style:{color:"var(--text-muted)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334a2.126 2.126 0 00-.476-.095 48.64 48.64 0 00-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})}),p.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-muted)"},children:"Select a channel to get started"}),p.jsx("p",{className:"text-caption mt-1",style:{color:"var(--text-muted)"},children:"Choose a channel from the sidebar"})]})})}function h5({msg:e,grouped:t,onOpenThread:r,onQuote:a,onCopy:o,onAction:c,onResolveAction:u,onStop:d}){const h=gr(),m=e.sender==="user"?"You":"OpenClaw Agent",b=e.sender==="user"?"#9B59B6":"#2BAC76",y=e.sender==="user"?"U":"A",v=h.threadReplyCounts[e.id]??0,[x,_]=I.useState(!1),S=I.useRef(null),O=I.useRef(!1),k=I.useCallback(()=>{O.current=!1,S.current=setTimeout(()=>{O.current||_(!0)},500)},[]),D=I.useCallback(()=>{O.current=!0,S.current&&clearTimeout(S.current)},[]),w=I.useCallback(()=>{S.current&&clearTimeout(S.current)},[]),[A,L]=I.useState(!1),M=I.useCallback(()=>{o(),L(!0),setTimeout(()=>L(!1),1500),_(!1)},[o]);return p.jsxs("div",{className:"group relative px-3 sm:px-5 hover:bg-[--bg-hover] transition-colors",style:{paddingTop:t?2:8,paddingBottom:2},onTouchStart:k,onTouchMove:D,onTouchEnd:w,onContextMenu:$=>{$.preventDefault(),_(!0)},children:[p.jsxs("div",{className:"flex gap-2 max-w-message",children:[p.jsx("div",{className:"flex-shrink-0",style:{width:36},children:!t&&p.jsx("div",{className:"w-9 h-9 rounded flex items-center justify-center text-white text-caption font-bold",style:{background:b},children:y})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[!t&&p.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[p.jsx("span",{className:"text-h2",style:{color:"var(--text-primary)"},children:m}),p.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:new Date(e.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),p.jsx(Jh,{text:e.text,mediaUrl:e.mediaUrl,messageId:e.id,encrypted:!!e.mediaUrl&&it.hasKey(),a2ui:e.a2ui,isStreaming:e.isStreaming,onAction:c,onResolveAction:u,resolvedActions:e.resolvedActions}),e.isStreaming&&p.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[p.jsx("span",{className:"inline-block w-1.5 h-4 rounded-sm animate-pulse",style:{background:"var(--text-link)",verticalAlign:"text-bottom"}}),d&&p.jsxs("button",{onClick:d,className:"flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium transition-colors",style:{color:"var(--text-secondary)",background:"var(--bg-hover)",border:"1px solid var(--border)"},onMouseEnter:$=>{$.currentTarget.style.background="#e74c3c",$.currentTarget.style.color="#fff",$.currentTarget.style.borderColor="#e74c3c"},onMouseLeave:$=>{$.currentTarget.style.background="var(--bg-hover)",$.currentTarget.style.color="var(--text-secondary)",$.currentTarget.style.borderColor="var(--border)"},title:"Stop generating",children:[p.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 24 24",children:p.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),"Stop"]})]}),v>0&&p.jsxs("button",{onClick:r,className:"flex items-center gap-2 mt-1 py-1 px-1 -ml-1 rounded hover:bg-[--bg-hover] transition-colors cursor-pointer group/thread",children:[p.jsxs("span",{className:"text-caption font-bold",style:{color:"var(--text-link)"},children:[v," ",v===1?"reply":"replies"]}),p.jsx("span",{className:"text-caption opacity-0 group-hover/thread:opacity-100 transition-opacity",style:{color:"var(--text-secondary)"},children:"View thread"}),p.jsx("svg",{className:"w-4 h-4 opacity-0 group-hover/thread:opacity-100 transition-opacity",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-secondary)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})]})]})]}),p.jsxs("div",{className:"absolute top-0 right-5 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity flex items-center gap-0.5 px-1 py-0.5 rounded",style:{background:"var(--bg-surface)",border:"1px solid var(--border)",boxShadow:"var(--shadow-sm)"},children:[p.jsx(Sh,{label:"Reply in thread",onClick:r,icon:p.jsx("svg",{className:"w-[18px] h-[18px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334a2.126 2.126 0 00-.476-.095 48.64 48.64 0 00-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})})}),p.jsx(Sh,{label:"Quote reply",onClick:()=>{a()},icon:p.jsx("svg",{className:"w-[18px] h-[18px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 15L3 9m0 0l6-6M3 9h12a6 6 0 010 12h-3"})})}),p.jsx(Sh,{label:A?"Copied!":"Copy text",onClick:M,icon:A?p.jsx("svg",{className:"w-[18px] h-[18px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):p.jsx("svg",{className:"w-[18px] h-[18px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9.75a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184"})})})]}),x&&p.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-center",style:{background:"rgba(0,0,0,0.4)"},onClick:()=>_(!1),children:p.jsxs("div",{className:"w-full max-w-md rounded-t-xl overflow-hidden",style:{background:"var(--bg-surface)",paddingBottom:"env(safe-area-inset-bottom, 12px)"},onClick:$=>$.stopPropagation(),children:[p.jsxs("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:[p.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:e.sender==="user"?"You":"Agent"}),p.jsxs("p",{className:"text-body mt-0.5 line-clamp-2",style:{color:"var(--text-primary)"},children:[e.text.slice(0,120),e.text.length>120?"...":""]})]}),p.jsx(Eh,{label:"Reply in thread",icon:p.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})}),onClick:()=>{_(!1),r()}}),p.jsx(Eh,{label:"Quote reply",icon:p.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 15L3 9m0 0l6-6M3 9h12a6 6 0 010 12h-3"})}),onClick:()=>{_(!1),a()}}),p.jsx(Eh,{label:"Copy text",icon:p.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9.75a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184"})}),onClick:M}),p.jsx("button",{onClick:()=>_(!1),className:"w-full py-3 text-body font-bold",style:{color:"var(--text-muted)",borderTop:"1px solid var(--border)"},children:"Cancel"})]})})]})}function Eh({label:e,icon:t,onClick:r}){return p.jsxs("button",{onClick:r,className:"w-full flex items-center gap-3 px-4 py-3 text-body transition-colors active:bg-[--bg-hover]",style:{color:"var(--text-primary)"},children:[p.jsx("span",{style:{color:"var(--text-secondary)"},children:t}),e]})}function Sh({label:e,icon:t,onClick:r}){return p.jsx("button",{onClick:r,className:"p-1 rounded hover:bg-[--bg-hover] transition-colors",style:{color:"var(--text-secondary)"},title:e,"aria-label":e,children:t})}function p5(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return t.toString(36)}function cE({sendMessage:e}){var v,x,_;const t=gr(),r=ai(),[a,o]=I.useState("");if(I.useEffect(()=>{if(!t.activeThreadId||!t.selectedSessionKey||!t.user)return;const S=`${t.selectedSessionKey}:thread:${t.activeThreadId}`;ne.info("Thread",`Loading history for thread ${t.activeThreadId}`),gx.list(t.user.id,S,t.activeThreadId).then(({messages:O})=>{ne.info("Thread",`Loaded ${O.length} thread messages`),O.length>0&&r({type:"OPEN_THREAD",threadId:t.activeThreadId,messages:O})}).catch(O=>{ne.error("Thread",`Failed to load thread history: ${O}`)})},[t.activeThreadId]),!t.activeThreadId)return null;const c=t.messages.find(S=>S.id===t.activeThreadId),u=t.selectedSessionKey?`${t.selectedSessionKey}:thread:${t.activeThreadId}`:null,d=I.useCallback(S=>{var k;if(!u)return;ne.info("Thread/A2UI",`Action triggered: ${S}`);const O={id:Gn(),sender:"user",text:S,timestamp:Date.now(),threadId:t.activeThreadId??void 0};r({type:"ADD_THREAD_MESSAGE",message:O}),e({type:"user.message",sessionKey:u,text:S,userId:((k=t.user)==null?void 0:k.id)??"",messageId:O.id})},[u,t.activeThreadId,(v=t.user)==null?void 0:v.id,e,r]),h=I.useCallback((S,O,k)=>{var A;if(!u)return;ne.info("Thread/ActionCard",`Resolved: "${k}" (value="${O}")`);const D=p5(k+O);r({type:"RESOLVE_ACTION",messageId:S,promptHash:D,value:O,label:k});const w={id:Gn(),sender:"user",text:k,timestamp:Date.now(),threadId:t.activeThreadId??void 0};r({type:"ADD_THREAD_MESSAGE",message:w}),e({type:"user.message",sessionKey:u,text:k,userId:((A=t.user)==null?void 0:A.id)??"",messageId:w.id})},[u,t.activeThreadId,(x=t.user)==null?void 0:x.id,e,r]),m=I.useCallback(()=>{var O;if(!u||!t.streamingRunId||!t.streamingThreadId)return;ne.info("Thread","Stop streaming requested");const S={id:Gn(),sender:"user",text:"/stop",timestamp:Date.now(),threadId:t.activeThreadId??void 0};r({type:"ADD_THREAD_MESSAGE",message:S}),e({type:"user.message",sessionKey:u,text:"/stop",userId:((O=t.user)==null?void 0:O.id)??"",messageId:S.id})},[u,t.streamingRunId,t.streamingThreadId,t.activeThreadId,(_=t.user)==null?void 0:_.id,e,r]),b=!!t.streamingRunId&&!!t.streamingThreadId,y=()=>{var k;if(!a.trim()||!t.selectedSessionKey)return;const S=a.trim();ne.info("Thread",`Send reply: ${S.length>120?S.slice(0,120)+"…":S}`,{threadId:t.activeThreadId});const O={id:Gn(),sender:"user",text:S,timestamp:Date.now(),threadId:t.activeThreadId??void 0};r({type:"ADD_THREAD_MESSAGE",message:O}),e({type:"user.message",sessionKey:u,text:S,userId:((k=t.user)==null?void 0:k.id)??"",messageId:O.id}),o("")};return p.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-surface)"},children:[p.jsxs("div",{className:"flex items-center justify-between px-4 flex-shrink-0",style:{height:44,borderBottom:"1px solid var(--border)"},children:[p.jsx("h3",{className:"text-h1",style:{color:"var(--text-primary)"},children:"Thread"}),p.jsx("button",{onClick:()=>r({type:"CLOSE_THREAD"}),className:"p-1 rounded hover:bg-[--bg-hover] transition-colors",style:{color:"var(--text-secondary)"},"aria-label":"Close thread",children:p.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),p.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[c&&p.jsx("div",{className:"px-5 py-3",style:{borderBottom:"1px solid var(--border)"},children:p.jsxs("div",{className:"flex gap-2",children:[p.jsx("div",{className:"w-9 h-9 rounded flex-shrink-0 flex items-center justify-center text-white text-caption font-bold",style:{background:c.sender==="user"?"#9B59B6":"#2BAC76"},children:c.sender==="user"?"U":"A"}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[p.jsx("span",{className:"text-h2",style:{color:"var(--text-primary)"},children:c.sender==="user"?"You":"OpenClaw Agent"}),p.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:new Date(c.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),p.jsx(Jh,{text:c.text,mediaUrl:c.mediaUrl,a2ui:c.a2ui,onAction:d,onResolveAction:(S,O)=>h(c.id,S,O),resolvedActions:c.resolvedActions})]})]})}),p.jsx("div",{className:"px-5 py-2",style:{borderBottom:"1px solid var(--border)"},children:p.jsxs("span",{className:"text-caption font-bold",style:{color:"var(--text-link)"},children:[t.threadMessages.length," ",t.threadMessages.length===1?"reply":"replies"]})}),t.threadMessages.map((S,O)=>{const k=O>0?t.threadMessages[O-1]:null,D=(k==null?void 0:k.sender)===S.sender&&S.timestamp-k.timestamp<3e5;return p.jsx("div",{className:"px-5 hover:bg-[--bg-hover] transition-colors",style:{paddingTop:D?2:8,paddingBottom:2},children:p.jsxs("div",{className:"flex gap-2",children:[p.jsx("div",{className:"flex-shrink-0",style:{width:36},children:!D&&p.jsx("div",{className:"w-9 h-9 rounded flex items-center justify-center text-white text-caption font-bold",style:{background:S.sender==="user"?"#9B59B6":"#2BAC76"},children:S.sender==="user"?"U":"A"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[!D&&p.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[p.jsx("span",{className:"text-h2",style:{color:"var(--text-primary)"},children:S.sender==="user"?"You":"OpenClaw Agent"}),p.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:new Date(S.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),p.jsx(Jh,{text:S.text,mediaUrl:S.mediaUrl,a2ui:S.a2ui,isStreaming:S.isStreaming,onAction:d,onResolveAction:(w,A)=>h(S.id,w,A),resolvedActions:S.resolvedActions}),S.isStreaming&&p.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[p.jsx("span",{className:"inline-block w-1.5 h-4 rounded-sm animate-pulse",style:{background:"var(--text-link)",verticalAlign:"text-bottom"}}),p.jsxs("button",{onClick:m,className:"flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium transition-colors",style:{color:"var(--text-secondary)",background:"var(--bg-hover)",border:"1px solid var(--border)"},onMouseEnter:w=>{w.currentTarget.style.background="#e74c3c",w.currentTarget.style.color="#fff",w.currentTarget.style.borderColor="#e74c3c"},onMouseLeave:w=>{w.currentTarget.style.background="var(--bg-hover)",w.currentTarget.style.color="var(--text-secondary)",w.currentTarget.style.borderColor="var(--border)"},title:"Stop generating",children:[p.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 24 24",children:p.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),"Stop"]})]})]})]})},S.id)})]})," ",p.jsx("div",{className:"px-4 pb-3 pt-2",children:p.jsxs("div",{className:"rounded-md",style:{border:"1px solid var(--border)",background:"var(--bg-surface)"},children:[p.jsx("textarea",{value:a,onChange:S=>o(S.target.value),onKeyDown:S=>{S.key==="Enter"&&!S.shiftKey&&!S.nativeEvent.isComposing&&(S.preventDefault(),y())},placeholder:"Reply…",rows:1,className:"w-full px-3 py-2 text-body bg-transparent resize-none focus:outline-none placeholder:text-[--text-muted]",style:{color:"var(--text-primary)",minHeight:36}}),p.jsx("div",{className:"flex justify-end px-3 pb-2",children:b?p.jsx("button",{onClick:m,className:"px-3 py-1 rounded-sm text-caption font-bold text-white transition-colors",style:{background:"#e74c3c"},onMouseEnter:S=>{S.currentTarget.style.background="#c0392b"},onMouseLeave:S=>{S.currentTarget.style.background="#e74c3c"},title:"Stop generating",children:p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:p.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),"Stop"]})}):p.jsx("button",{onClick:y,disabled:!a.trim(),className:"px-3 py-1 rounded-sm text-caption font-bold text-white disabled:opacity-40 disabled:cursor-not-allowed transition-colors",style:{background:"var(--bg-active)"},children:"Send"})})]})})]})}function m5(e){switch(e){case"ok":return"OK";case"error":return"ERR";case"skipped":return"SKIP";case"running":return"RUN";default:return e.toUpperCase()}}function g5(e){switch(e){case"ok":return{bg:"rgba(43,172,118,0.15)",fg:"var(--accent-green)"};case"error":return{bg:"rgba(224,30,90,0.15)",fg:"var(--accent-red)"};case"running":return{bg:"rgba(29,155,209,0.15)",fg:"var(--text-link)"};default:return{bg:"rgba(232,162,48,0.15)",fg:"var(--accent-yellow)"}}}function b5({jobs:e,selectedJobId:t,onSelectJob:r}){return e.length===0?p.jsx("div",{className:"flex items-center justify-center h-full",style:{background:"var(--bg-surface)"},children:p.jsxs("div",{className:"text-center p-4",children:[p.jsx("svg",{className:"w-8 h-8 mx-auto mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-muted)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),p.jsxs("p",{className:"text-tiny",style:{color:"var(--text-muted)"},children:["No runs yet.",p.jsx("br",{}),"Waiting for schedule..."]})]})}):p.jsxs("div",{className:"overflow-y-auto h-full",style:{background:"var(--bg-surface)"},children:[p.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:[p.jsx("span",{className:"text-tiny uppercase tracking-wider font-bold",style:{color:"var(--text-muted)"},children:"Job History"}),p.jsxs("span",{className:"text-tiny ml-1",style:{color:"var(--text-muted)"},children:["(",e.length,")"]})]}),e.map((a,o)=>{const c=g5(a.status),u=a.number||e.length-o;return p.jsxs("button",{onClick:()=>r(a.id),className:`w-full text-left px-3 py-2 hover:bg-[--bg-hover] transition-colors ${t===a.id?"bg-[--bg-hover]":""}`,style:{borderBottom:"1px solid var(--border)",...t===a.id?{borderLeft:"3px solid var(--bg-active)"}:{}},children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("span",{className:"text-tiny font-mono",style:{color:"var(--text-muted)"},children:["#",u]}),p.jsx("span",{className:"text-tiny px-1.5 py-0.5 rounded-sm font-bold",style:{background:c.bg,color:c.fg},children:m5(a.status)})]}),p.jsxs("div",{className:"text-tiny mt-0.5",style:{color:"var(--text-muted)"},children:[a.time,a.durationMs!=null&&p.jsxs("span",{className:"ml-1",children:["(",(a.durationMs/1e3).toFixed(1),"s)"]})]}),a.summary&&p.jsx("div",{className:"text-caption mt-1 truncate",style:{color:"var(--text-secondary)"},children:a.summary})]},a.id)})]})}const y5=()=>{};var y1={};/**
|
|
89
|
-
* @license
|
|
90
|
-
* Copyright 2017 Google LLC
|
|
91
|
-
*
|
|
92
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
93
|
-
* you may not use this file except in compliance with the License.
|
|
94
|
-
* You may obtain a copy of the License at
|
|
95
|
-
*
|
|
96
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
97
|
-
*
|
|
98
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
99
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
100
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
101
|
-
* See the License for the specific language governing permissions and
|
|
102
|
-
* limitations under the License.
|
|
103
|
-
*/const uE=function(e){const t=[];let r=0;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a);o<128?t[r++]=o:o<2048?(t[r++]=o>>6|192,t[r++]=o&63|128):(o&64512)===55296&&a+1<e.length&&(e.charCodeAt(a+1)&64512)===56320?(o=65536+((o&1023)<<10)+(e.charCodeAt(++a)&1023),t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=o&63|128):(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=o&63|128)}return t},v5=function(e){const t=[];let r=0,a=0;for(;r<e.length;){const o=e[r++];if(o<128)t[a++]=String.fromCharCode(o);else if(o>191&&o<224){const c=e[r++];t[a++]=String.fromCharCode((o&31)<<6|c&63)}else if(o>239&&o<365){const c=e[r++],u=e[r++],d=e[r++],h=((o&7)<<18|(c&63)<<12|(u&63)<<6|d&63)-65536;t[a++]=String.fromCharCode(55296+(h>>10)),t[a++]=String.fromCharCode(56320+(h&1023))}else{const c=e[r++],u=e[r++];t[a++]=String.fromCharCode((o&15)<<12|(c&63)<<6|u&63)}}return t.join("")},dE={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const r=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,a=[];for(let o=0;o<e.length;o+=3){const c=e[o],u=o+1<e.length,d=u?e[o+1]:0,h=o+2<e.length,m=h?e[o+2]:0,b=c>>2,y=(c&3)<<4|d>>4;let v=(d&15)<<2|m>>6,x=m&63;h||(x=64,u||(v=64)),a.push(r[b],r[y],r[v],r[x])}return a.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(uE(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):v5(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const r=t?this.charToByteMapWebSafe_:this.charToByteMap_,a=[];for(let o=0;o<e.length;){const c=r[e.charAt(o++)],d=o<e.length?r[e.charAt(o)]:0;++o;const m=o<e.length?r[e.charAt(o)]:64;++o;const y=o<e.length?r[e.charAt(o)]:64;if(++o,c==null||d==null||m==null||y==null)throw new x5;const v=c<<2|d>>4;if(a.push(v),m!==64){const x=d<<4&240|m>>2;if(a.push(x),y!==64){const _=m<<6&192|y;a.push(_)}}}return a},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class x5 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const E5=function(e){const t=uE(e);return dE.encodeByteArray(t,!0)},fE=function(e){return E5(e).replace(/\./g,"")},hE=function(e){try{return dE.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
|
|
104
|
-
* @license
|
|
105
|
-
* Copyright 2022 Google LLC
|
|
106
|
-
*
|
|
107
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
108
|
-
* you may not use this file except in compliance with the License.
|
|
109
|
-
* You may obtain a copy of the License at
|
|
110
|
-
*
|
|
111
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
112
|
-
*
|
|
113
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
114
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
115
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
116
|
-
* See the License for the specific language governing permissions and
|
|
117
|
-
* limitations under the License.
|
|
118
|
-
*/function S5(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
|
|
119
|
-
* @license
|
|
120
|
-
* Copyright 2022 Google LLC
|
|
121
|
-
*
|
|
122
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
123
|
-
* you may not use this file except in compliance with the License.
|
|
124
|
-
* You may obtain a copy of the License at
|
|
125
|
-
*
|
|
126
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
127
|
-
*
|
|
128
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
129
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
130
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
131
|
-
* See the License for the specific language governing permissions and
|
|
132
|
-
* limitations under the License.
|
|
133
|
-
*/const _5=()=>S5().__FIREBASE_DEFAULTS__,w5=()=>{if(typeof process>"u"||typeof y1>"u")return;const e=y1.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},k5=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&hE(e[1]);return t&&JSON.parse(t)},Up=()=>{try{return y5()||_5()||w5()||k5()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},T5=e=>{var t,r;return(r=(t=Up())==null?void 0:t.emulatorHosts)==null?void 0:r[e]},pE=()=>{var e;return(e=Up())==null?void 0:e.config},mE=e=>{var t;return(t=Up())==null?void 0:t[`_${e}`]};/**
|
|
134
|
-
* @license
|
|
135
|
-
* Copyright 2017 Google LLC
|
|
136
|
-
*
|
|
137
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
138
|
-
* you may not use this file except in compliance with the License.
|
|
139
|
-
* You may obtain a copy of the License at
|
|
140
|
-
*
|
|
141
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
142
|
-
*
|
|
143
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
144
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
145
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
146
|
-
* See the License for the specific language governing permissions and
|
|
147
|
-
* limitations under the License.
|
|
148
|
-
*/class N5{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,r)=>{this.resolve=t,this.reject=r})}wrapCallback(t){return(r,a)=>{r?this.reject(r):this.resolve(a),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(r):t(r,a))}}}/**
|
|
149
|
-
* @license
|
|
150
|
-
* Copyright 2025 Google LLC
|
|
151
|
-
*
|
|
152
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
153
|
-
* you may not use this file except in compliance with the License.
|
|
154
|
-
* You may obtain a copy of the License at
|
|
155
|
-
*
|
|
156
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
157
|
-
*
|
|
158
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
159
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
160
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
161
|
-
* See the License for the specific language governing permissions and
|
|
162
|
-
* limitations under the License.
|
|
163
|
-
*/function ju(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function C5(e){return(await fetch(e,{credentials:"include"})).ok}const nl={};function A5(){const e={prod:[],emulator:[]};for(const t of Object.keys(nl))nl[t]?e.emulator.push(t):e.prod.push(t);return e}function O5(e){let t=document.getElementById(e),r=!1;return t||(t=document.createElement("div"),t.setAttribute("id",e),r=!0),{created:r,element:t}}let v1=!1;function R5(e,t){if(typeof window>"u"||typeof document>"u"||!ju(window.location.host)||nl[e]===t||nl[e]||v1)return;nl[e]=t;function r(v){return`__firebase__banner__${v}`}const a="__firebase__banner",c=A5().prod.length>0;function u(){const v=document.getElementById(a);v&&v.remove()}function d(v){v.style.display="flex",v.style.background="#7faaf0",v.style.position="fixed",v.style.bottom="5px",v.style.left="5px",v.style.padding=".5em",v.style.borderRadius="5px",v.style.alignItems="center"}function h(v,x){v.setAttribute("width","24"),v.setAttribute("id",x),v.setAttribute("height","24"),v.setAttribute("viewBox","0 0 24 24"),v.setAttribute("fill","none"),v.style.marginLeft="-6px"}function m(){const v=document.createElement("span");return v.style.cursor="pointer",v.style.marginLeft="16px",v.style.fontSize="24px",v.innerHTML=" ×",v.onclick=()=>{v1=!0,u()},v}function b(v,x){v.setAttribute("id",x),v.innerText="Learn more",v.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",v.setAttribute("target","__blank"),v.style.paddingLeft="5px",v.style.textDecoration="underline"}function y(){const v=O5(a),x=r("text"),_=document.getElementById(x)||document.createElement("span"),S=r("learnmore"),O=document.getElementById(S)||document.createElement("a"),k=r("preprendIcon"),D=document.getElementById(k)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(v.created){const w=v.element;d(w),b(O,S);const A=m();h(D,k),w.append(D,_,O,A),document.body.appendChild(w)}c?(_.innerText="Preview backend disconnected.",D.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
|
|
164
|
-
<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
|
|
165
|
-
</g>
|
|
166
|
-
<defs>
|
|
167
|
-
<clipPath id="clip0_6013_33858">
|
|
168
|
-
<rect width="24" height="24" fill="white"/>
|
|
169
|
-
</clipPath>
|
|
170
|
-
</defs>`):(D.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
|
|
171
|
-
<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
|
|
172
|
-
</g>
|
|
173
|
-
<defs>
|
|
174
|
-
<clipPath id="clip0_6083_34804">
|
|
175
|
-
<rect width="24" height="24" fill="white"/>
|
|
176
|
-
</clipPath>
|
|
177
|
-
</defs>`,_.innerText="Preview backend running in this workspace."),_.setAttribute("id",x)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",y):y()}/**
|
|
178
|
-
* @license
|
|
179
|
-
* Copyright 2017 Google LLC
|
|
180
|
-
*
|
|
181
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
-
* you may not use this file except in compliance with the License.
|
|
183
|
-
* You may obtain a copy of the License at
|
|
184
|
-
*
|
|
185
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
-
*
|
|
187
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
188
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
-
* See the License for the specific language governing permissions and
|
|
191
|
-
* limitations under the License.
|
|
192
|
-
*/function En(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function M5(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(En())}function I5(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function D5(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function L5(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function j5(){const e=En();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function z5(){try{return typeof indexedDB=="object"}catch{return!1}}function B5(){return new Promise((e,t)=>{try{let r=!0;const a="validate-browser-context-for-indexeddb-analytics-module",o=self.indexedDB.open(a);o.onsuccess=()=>{o.result.close(),r||self.indexedDB.deleteDatabase(a),e(!0)},o.onupgradeneeded=()=>{r=!1},o.onerror=()=>{var c;t(((c=o.error)==null?void 0:c.message)||"")}}catch(r){t(r)}})}/**
|
|
193
|
-
* @license
|
|
194
|
-
* Copyright 2017 Google LLC
|
|
195
|
-
*
|
|
196
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
197
|
-
* you may not use this file except in compliance with the License.
|
|
198
|
-
* You may obtain a copy of the License at
|
|
199
|
-
*
|
|
200
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
201
|
-
*
|
|
202
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
203
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
204
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
205
|
-
* See the License for the specific language governing permissions and
|
|
206
|
-
* limitations under the License.
|
|
207
|
-
*/const U5="FirebaseError";class Ki extends Error{constructor(t,r,a){super(r),this.code=t,this.customData=a,this.name=U5,Object.setPrototypeOf(this,Ki.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,El.prototype.create)}}class El{constructor(t,r,a){this.service=t,this.serviceName=r,this.errors=a}create(t,...r){const a=r[0]||{},o=`${this.service}/${t}`,c=this.errors[t],u=c?P5(c,a):"Error",d=`${this.serviceName}: ${u} (${o}).`;return new Ki(o,d,a)}}function P5(e,t){return e.replace(H5,(r,a)=>{const o=t[a];return o!=null?String(o):`<${a}?>`})}const H5=/\{\$([^}]+)}/g;function F5(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function Ls(e,t){if(e===t)return!0;const r=Object.keys(e),a=Object.keys(t);for(const o of r){if(!a.includes(o))return!1;const c=e[o],u=t[o];if(x1(c)&&x1(u)){if(!Ls(c,u))return!1}else if(c!==u)return!1}for(const o of a)if(!r.includes(o))return!1;return!0}function x1(e){return e!==null&&typeof e=="object"}/**
|
|
208
|
-
* @license
|
|
209
|
-
* Copyright 2017 Google LLC
|
|
210
|
-
*
|
|
211
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
212
|
-
* you may not use this file except in compliance with the License.
|
|
213
|
-
* You may obtain a copy of the License at
|
|
214
|
-
*
|
|
215
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
216
|
-
*
|
|
217
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
218
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
219
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
220
|
-
* See the License for the specific language governing permissions and
|
|
221
|
-
* limitations under the License.
|
|
222
|
-
*/function Sl(e){const t=[];for(const[r,a]of Object.entries(e))Array.isArray(a)?a.forEach(o=>{t.push(encodeURIComponent(r)+"="+encodeURIComponent(o))}):t.push(encodeURIComponent(r)+"="+encodeURIComponent(a));return t.length?"&"+t.join("&"):""}function $5(e,t){const r=new G5(e,t);return r.subscribe.bind(r)}class G5{constructor(t,r){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=r,this.task.then(()=>{t(this)}).catch(a=>{this.error(a)})}next(t){this.forEachObserver(r=>{r.next(t)})}error(t){this.forEachObserver(r=>{r.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,r,a){let o;if(t===void 0&&r===void 0&&a===void 0)throw new Error("Missing Observer.");K5(t,["next","error","complete"])?o=t:o={next:t,error:r,complete:a},o.next===void 0&&(o.next=_h),o.error===void 0&&(o.error=_h),o.complete===void 0&&(o.complete=_h);const c=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?o.error(this.finalError):o.complete()}catch{}}),this.observers.push(o),c}unsubscribeOne(t){this.observers===void 0||this.observers[t]===void 0||(delete this.observers[t],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let r=0;r<this.observers.length;r++)this.sendOne(r,t)}sendOne(t,r){this.task.then(()=>{if(this.observers!==void 0&&this.observers[t]!==void 0)try{r(this.observers[t])}catch(a){typeof console<"u"&&console.error&&console.error(a)}})}close(t){this.finalized||(this.finalized=!0,t!==void 0&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function K5(e,t){if(typeof e!="object"||e===null)return!1;for(const r of t)if(r in e&&typeof e[r]=="function")return!0;return!1}function _h(){}/**
|
|
223
|
-
* @license
|
|
224
|
-
* Copyright 2021 Google LLC
|
|
225
|
-
*
|
|
226
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
227
|
-
* you may not use this file except in compliance with the License.
|
|
228
|
-
* You may obtain a copy of the License at
|
|
229
|
-
*
|
|
230
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
231
|
-
*
|
|
232
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
233
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
234
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
235
|
-
* See the License for the specific language governing permissions and
|
|
236
|
-
* limitations under the License.
|
|
237
|
-
*/function Na(e){return e&&e._delegate?e._delegate:e}class js{constructor(t,r,a){this.name=t,this.instanceFactory=r,this.type=a,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/**
|
|
238
|
-
* @license
|
|
239
|
-
* Copyright 2019 Google LLC
|
|
240
|
-
*
|
|
241
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
242
|
-
* you may not use this file except in compliance with the License.
|
|
243
|
-
* You may obtain a copy of the License at
|
|
244
|
-
*
|
|
245
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
246
|
-
*
|
|
247
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
248
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
249
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
250
|
-
* See the License for the specific language governing permissions and
|
|
251
|
-
* limitations under the License.
|
|
252
|
-
*/const ga="[DEFAULT]";/**
|
|
253
|
-
* @license
|
|
254
|
-
* Copyright 2019 Google LLC
|
|
255
|
-
*
|
|
256
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
257
|
-
* you may not use this file except in compliance with the License.
|
|
258
|
-
* You may obtain a copy of the License at
|
|
259
|
-
*
|
|
260
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
261
|
-
*
|
|
262
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
263
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
264
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
265
|
-
* See the License for the specific language governing permissions and
|
|
266
|
-
* limitations under the License.
|
|
267
|
-
*/class q5{constructor(t,r){this.name=t,this.container=r,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const r=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(r)){const a=new N5;if(this.instancesDeferred.set(r,a),this.isInitialized(r)||this.shouldAutoInitialize())try{const o=this.getOrInitializeService({instanceIdentifier:r});o&&a.resolve(o)}catch{}}return this.instancesDeferred.get(r).promise}getImmediate(t){const r=this.normalizeInstanceIdentifier(t==null?void 0:t.identifier),a=(t==null?void 0:t.optional)??!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(o){if(a)return null;throw o}else{if(a)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(Y5(t))try{this.getOrInitializeService({instanceIdentifier:ga})}catch{}for(const[r,a]of this.instancesDeferred.entries()){const o=this.normalizeInstanceIdentifier(r);try{const c=this.getOrInitializeService({instanceIdentifier:o});a.resolve(c)}catch{}}}}clearInstance(t=ga){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(r=>"INTERNAL"in r).map(r=>r.INTERNAL.delete()),...t.filter(r=>"_delete"in r).map(r=>r._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=ga){return this.instances.has(t)}getOptions(t=ga){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:r={}}=t,a=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(a))throw Error(`${this.name}(${a}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const o=this.getOrInitializeService({instanceIdentifier:a,options:r});for(const[c,u]of this.instancesDeferred.entries()){const d=this.normalizeInstanceIdentifier(c);a===d&&u.resolve(o)}return o}onInit(t,r){const a=this.normalizeInstanceIdentifier(r),o=this.onInitCallbacks.get(a)??new Set;o.add(t),this.onInitCallbacks.set(a,o);const c=this.instances.get(a);return c&&t(c,a),()=>{o.delete(t)}}invokeOnInitCallbacks(t,r){const a=this.onInitCallbacks.get(r);if(a)for(const o of a)try{o(t,r)}catch{}}getOrInitializeService({instanceIdentifier:t,options:r={}}){let a=this.instances.get(t);if(!a&&this.component&&(a=this.component.instanceFactory(this.container,{instanceIdentifier:V5(t),options:r}),this.instances.set(t,a),this.instancesOptions.set(t,r),this.invokeOnInitCallbacks(a,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,a)}catch{}return a||null}normalizeInstanceIdentifier(t=ga){return this.component?this.component.multipleInstances?t:ga:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function V5(e){return e===ga?void 0:e}function Y5(e){return e.instantiationMode==="EAGER"}/**
|
|
268
|
-
* @license
|
|
269
|
-
* Copyright 2019 Google LLC
|
|
270
|
-
*
|
|
271
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
272
|
-
* you may not use this file except in compliance with the License.
|
|
273
|
-
* You may obtain a copy of the License at
|
|
274
|
-
*
|
|
275
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
276
|
-
*
|
|
277
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
278
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
279
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
280
|
-
* See the License for the specific language governing permissions and
|
|
281
|
-
* limitations under the License.
|
|
282
|
-
*/class W5{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const r=this.getProvider(t.name);if(r.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);r.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const r=new q5(t,this);return this.providers.set(t,r),r}getProviders(){return Array.from(this.providers.values())}}/**
|
|
283
|
-
* @license
|
|
284
|
-
* Copyright 2017 Google LLC
|
|
285
|
-
*
|
|
286
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
287
|
-
* you may not use this file except in compliance with the License.
|
|
288
|
-
* You may obtain a copy of the License at
|
|
289
|
-
*
|
|
290
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
291
|
-
*
|
|
292
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
293
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
294
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
295
|
-
* See the License for the specific language governing permissions and
|
|
296
|
-
* limitations under the License.
|
|
297
|
-
*/var xt;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(xt||(xt={}));const X5={debug:xt.DEBUG,verbose:xt.VERBOSE,info:xt.INFO,warn:xt.WARN,error:xt.ERROR,silent:xt.SILENT},Z5=xt.INFO,J5={[xt.DEBUG]:"log",[xt.VERBOSE]:"log",[xt.INFO]:"info",[xt.WARN]:"warn",[xt.ERROR]:"error"},Q5=(e,t,...r)=>{if(t<e.logLevel)return;const a=new Date().toISOString(),o=J5[t];if(o)console[o](`[${a}] ${e.name}:`,...r);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class gE{constructor(t){this.name=t,this._logLevel=Z5,this._logHandler=Q5,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in xt))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?X5[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,xt.DEBUG,...t),this._logHandler(this,xt.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,xt.VERBOSE,...t),this._logHandler(this,xt.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,xt.INFO,...t),this._logHandler(this,xt.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,xt.WARN,...t),this._logHandler(this,xt.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,xt.ERROR,...t),this._logHandler(this,xt.ERROR,...t)}}const eI=(e,t)=>t.some(r=>e instanceof r);let E1,S1;function tI(){return E1||(E1=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function nI(){return S1||(S1=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const bE=new WeakMap,Qh=new WeakMap,yE=new WeakMap,wh=new WeakMap,Pp=new WeakMap;function rI(e){const t=new Promise((r,a)=>{const o=()=>{e.removeEventListener("success",c),e.removeEventListener("error",u)},c=()=>{r(Fi(e.result)),o()},u=()=>{a(e.error),o()};e.addEventListener("success",c),e.addEventListener("error",u)});return t.then(r=>{r instanceof IDBCursor&&bE.set(r,e)}).catch(()=>{}),Pp.set(t,e),t}function iI(e){if(Qh.has(e))return;const t=new Promise((r,a)=>{const o=()=>{e.removeEventListener("complete",c),e.removeEventListener("error",u),e.removeEventListener("abort",u)},c=()=>{r(),o()},u=()=>{a(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",c),e.addEventListener("error",u),e.addEventListener("abort",u)});Qh.set(e,t)}let ep={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return Qh.get(e);if(t==="objectStoreNames")return e.objectStoreNames||yE.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Fi(e[t])},set(e,t,r){return e[t]=r,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function aI(e){ep=e(ep)}function sI(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...r){const a=e.call(kh(this),t,...r);return yE.set(a,t.sort?t.sort():[t]),Fi(a)}:nI().includes(e)?function(...t){return e.apply(kh(this),t),Fi(bE.get(this))}:function(...t){return Fi(e.apply(kh(this),t))}}function oI(e){return typeof e=="function"?sI(e):(e instanceof IDBTransaction&&iI(e),eI(e,tI())?new Proxy(e,ep):e)}function Fi(e){if(e instanceof IDBRequest)return rI(e);if(wh.has(e))return wh.get(e);const t=oI(e);return t!==e&&(wh.set(e,t),Pp.set(t,e)),t}const kh=e=>Pp.get(e);function lI(e,t,{blocked:r,upgrade:a,blocking:o,terminated:c}={}){const u=indexedDB.open(e,t),d=Fi(u);return a&&u.addEventListener("upgradeneeded",h=>{a(Fi(u.result),h.oldVersion,h.newVersion,Fi(u.transaction),h)}),r&&u.addEventListener("blocked",h=>r(h.oldVersion,h.newVersion,h)),d.then(h=>{c&&h.addEventListener("close",()=>c()),o&&h.addEventListener("versionchange",m=>o(m.oldVersion,m.newVersion,m))}).catch(()=>{}),d}const cI=["get","getKey","getAll","getAllKeys","count"],uI=["put","add","delete","clear"],Th=new Map;function _1(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Th.get(t))return Th.get(t);const r=t.replace(/FromIndex$/,""),a=t!==r,o=uI.includes(r);if(!(r in(a?IDBIndex:IDBObjectStore).prototype)||!(o||cI.includes(r)))return;const c=async function(u,...d){const h=this.transaction(u,o?"readwrite":"readonly");let m=h.store;return a&&(m=m.index(d.shift())),(await Promise.all([m[r](...d),o&&h.done]))[0]};return Th.set(t,c),c}aI(e=>({...e,get:(t,r,a)=>_1(t,r)||e.get(t,r,a),has:(t,r)=>!!_1(t,r)||e.has(t,r)}));/**
|
|
298
|
-
* @license
|
|
299
|
-
* Copyright 2019 Google LLC
|
|
300
|
-
*
|
|
301
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
302
|
-
* you may not use this file except in compliance with the License.
|
|
303
|
-
* You may obtain a copy of the License at
|
|
304
|
-
*
|
|
305
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
306
|
-
*
|
|
307
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
308
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
309
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
310
|
-
* See the License for the specific language governing permissions and
|
|
311
|
-
* limitations under the License.
|
|
312
|
-
*/class dI{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(r=>{if(fI(r)){const a=r.getImmediate();return`${a.library}/${a.version}`}else return null}).filter(r=>r).join(" ")}}function fI(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const tp="@firebase/app",w1="0.14.8";/**
|
|
313
|
-
* @license
|
|
314
|
-
* Copyright 2019 Google LLC
|
|
315
|
-
*
|
|
316
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
317
|
-
* you may not use this file except in compliance with the License.
|
|
318
|
-
* You may obtain a copy of the License at
|
|
319
|
-
*
|
|
320
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
321
|
-
*
|
|
322
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
323
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
324
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
325
|
-
* See the License for the specific language governing permissions and
|
|
326
|
-
* limitations under the License.
|
|
327
|
-
*/const ri=new gE("@firebase/app"),hI="@firebase/app-compat",pI="@firebase/analytics-compat",mI="@firebase/analytics",gI="@firebase/app-check-compat",bI="@firebase/app-check",yI="@firebase/auth",vI="@firebase/auth-compat",xI="@firebase/database",EI="@firebase/data-connect",SI="@firebase/database-compat",_I="@firebase/functions",wI="@firebase/functions-compat",kI="@firebase/installations",TI="@firebase/installations-compat",NI="@firebase/messaging",CI="@firebase/messaging-compat",AI="@firebase/performance",OI="@firebase/performance-compat",RI="@firebase/remote-config",MI="@firebase/remote-config-compat",II="@firebase/storage",DI="@firebase/storage-compat",LI="@firebase/firestore",jI="@firebase/ai",zI="@firebase/firestore-compat",BI="firebase",UI="12.9.0";/**
|
|
328
|
-
* @license
|
|
329
|
-
* Copyright 2019 Google LLC
|
|
330
|
-
*
|
|
331
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
332
|
-
* you may not use this file except in compliance with the License.
|
|
333
|
-
* You may obtain a copy of the License at
|
|
334
|
-
*
|
|
335
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
336
|
-
*
|
|
337
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
338
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
339
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
340
|
-
* See the License for the specific language governing permissions and
|
|
341
|
-
* limitations under the License.
|
|
342
|
-
*/const np="[DEFAULT]",PI={[tp]:"fire-core",[hI]:"fire-core-compat",[mI]:"fire-analytics",[pI]:"fire-analytics-compat",[bI]:"fire-app-check",[gI]:"fire-app-check-compat",[yI]:"fire-auth",[vI]:"fire-auth-compat",[xI]:"fire-rtdb",[EI]:"fire-data-connect",[SI]:"fire-rtdb-compat",[_I]:"fire-fn",[wI]:"fire-fn-compat",[kI]:"fire-iid",[TI]:"fire-iid-compat",[NI]:"fire-fcm",[CI]:"fire-fcm-compat",[AI]:"fire-perf",[OI]:"fire-perf-compat",[RI]:"fire-rc",[MI]:"fire-rc-compat",[II]:"fire-gcs",[DI]:"fire-gcs-compat",[LI]:"fire-fst",[zI]:"fire-fst-compat",[jI]:"fire-vertex","fire-js":"fire-js",[BI]:"fire-js-all"};/**
|
|
343
|
-
* @license
|
|
344
|
-
* Copyright 2019 Google LLC
|
|
345
|
-
*
|
|
346
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
347
|
-
* you may not use this file except in compliance with the License.
|
|
348
|
-
* You may obtain a copy of the License at
|
|
349
|
-
*
|
|
350
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
351
|
-
*
|
|
352
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
353
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
354
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
355
|
-
* See the License for the specific language governing permissions and
|
|
356
|
-
* limitations under the License.
|
|
357
|
-
*/const Su=new Map,HI=new Map,rp=new Map;function k1(e,t){try{e.container.addComponent(t)}catch(r){ri.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,r)}}function hl(e){const t=e.name;if(rp.has(t))return ri.debug(`There were multiple attempts to register component ${t}.`),!1;rp.set(t,e);for(const r of Su.values())k1(r,e);for(const r of HI.values())k1(r,e);return!0}function vE(e,t){const r=e.container.getProvider("heartbeat").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),e.container.getProvider(t)}function Nr(e){return e==null?!1:e.settings!==void 0}/**
|
|
358
|
-
* @license
|
|
359
|
-
* Copyright 2019 Google LLC
|
|
360
|
-
*
|
|
361
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
362
|
-
* you may not use this file except in compliance with the License.
|
|
363
|
-
* You may obtain a copy of the License at
|
|
364
|
-
*
|
|
365
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
366
|
-
*
|
|
367
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
368
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
369
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
370
|
-
* See the License for the specific language governing permissions and
|
|
371
|
-
* limitations under the License.
|
|
372
|
-
*/const FI={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},$i=new El("app","Firebase",FI);/**
|
|
373
|
-
* @license
|
|
374
|
-
* Copyright 2019 Google LLC
|
|
375
|
-
*
|
|
376
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
377
|
-
* you may not use this file except in compliance with the License.
|
|
378
|
-
* You may obtain a copy of the License at
|
|
379
|
-
*
|
|
380
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
381
|
-
*
|
|
382
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
383
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
384
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
385
|
-
* See the License for the specific language governing permissions and
|
|
386
|
-
* limitations under the License.
|
|
387
|
-
*/class $I{constructor(t,r,a){this._isDeleted=!1,this._options={...t},this._config={...r},this._name=r.name,this._automaticDataCollectionEnabled=r.automaticDataCollectionEnabled,this._container=a,this.container.addComponent(new js("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw $i.create("app-deleted",{appName:this._name})}}/**
|
|
388
|
-
* @license
|
|
389
|
-
* Copyright 2019 Google LLC
|
|
390
|
-
*
|
|
391
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
392
|
-
* you may not use this file except in compliance with the License.
|
|
393
|
-
* You may obtain a copy of the License at
|
|
394
|
-
*
|
|
395
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
396
|
-
*
|
|
397
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
398
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
399
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
400
|
-
* See the License for the specific language governing permissions and
|
|
401
|
-
* limitations under the License.
|
|
402
|
-
*/const _l=UI;function xE(e,t={}){let r=e;typeof t!="object"&&(t={name:t});const a={name:np,automaticDataCollectionEnabled:!0,...t},o=a.name;if(typeof o!="string"||!o)throw $i.create("bad-app-name",{appName:String(o)});if(r||(r=pE()),!r)throw $i.create("no-options");const c=Su.get(o);if(c){if(Ls(r,c.options)&&Ls(a,c.config))return c;throw $i.create("duplicate-app",{appName:o})}const u=new W5(o);for(const h of rp.values())u.addComponent(h);const d=new $I(r,a,u);return Su.set(o,d),d}function GI(e=np){const t=Su.get(e);if(!t&&e===np&&pE())return xE();if(!t)throw $i.create("no-app",{appName:e});return t}function Ns(e,t,r){let a=PI[e]??e;r&&(a+=`-${r}`);const o=a.match(/\s|\//),c=t.match(/\s|\//);if(o||c){const u=[`Unable to register library "${a}" with version "${t}":`];o&&u.push(`library name "${a}" contains illegal characters (whitespace or "/")`),o&&c&&u.push("and"),c&&u.push(`version name "${t}" contains illegal characters (whitespace or "/")`),ri.warn(u.join(" "));return}hl(new js(`${a}-version`,()=>({library:a,version:t}),"VERSION"))}/**
|
|
403
|
-
* @license
|
|
404
|
-
* Copyright 2021 Google LLC
|
|
405
|
-
*
|
|
406
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
407
|
-
* you may not use this file except in compliance with the License.
|
|
408
|
-
* You may obtain a copy of the License at
|
|
409
|
-
*
|
|
410
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
411
|
-
*
|
|
412
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
413
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
414
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
415
|
-
* See the License for the specific language governing permissions and
|
|
416
|
-
* limitations under the License.
|
|
417
|
-
*/const KI="firebase-heartbeat-database",qI=1,pl="firebase-heartbeat-store";let Nh=null;function EE(){return Nh||(Nh=lI(KI,qI,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(pl)}catch(r){console.warn(r)}}}}).catch(e=>{throw $i.create("idb-open",{originalErrorMessage:e.message})})),Nh}async function VI(e){try{const r=(await EE()).transaction(pl),a=await r.objectStore(pl).get(SE(e));return await r.done,a}catch(t){if(t instanceof Ki)ri.warn(t.message);else{const r=$i.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});ri.warn(r.message)}}}async function T1(e,t){try{const a=(await EE()).transaction(pl,"readwrite");await a.objectStore(pl).put(t,SE(e)),await a.done}catch(r){if(r instanceof Ki)ri.warn(r.message);else{const a=$i.create("idb-set",{originalErrorMessage:r==null?void 0:r.message});ri.warn(a.message)}}}function SE(e){return`${e.name}!${e.options.appId}`}/**
|
|
418
|
-
* @license
|
|
419
|
-
* Copyright 2021 Google LLC
|
|
420
|
-
*
|
|
421
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
422
|
-
* you may not use this file except in compliance with the License.
|
|
423
|
-
* You may obtain a copy of the License at
|
|
424
|
-
*
|
|
425
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
426
|
-
*
|
|
427
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
428
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
429
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
430
|
-
* See the License for the specific language governing permissions and
|
|
431
|
-
* limitations under the License.
|
|
432
|
-
*/const YI=1024,WI=30;class XI{constructor(t){this.container=t,this._heartbeatsCache=null;const r=this.container.getProvider("app").getImmediate();this._storage=new JI(r),this._heartbeatsCachePromise=this._storage.read().then(a=>(this._heartbeatsCache=a,a))}async triggerHeartbeat(){var t,r;try{const o=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),c=N1();if(((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((r=this._heartbeatsCache)==null?void 0:r.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===c||this._heartbeatsCache.heartbeats.some(u=>u.date===c))return;if(this._heartbeatsCache.heartbeats.push({date:c,agent:o}),this._heartbeatsCache.heartbeats.length>WI){const u=QI(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(u,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(a){ri.warn(a)}}async getHeartbeatsHeader(){var t;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const r=N1(),{heartbeatsToSend:a,unsentEntries:o}=ZI(this._heartbeatsCache.heartbeats),c=fE(JSON.stringify({version:2,heartbeats:a}));return this._heartbeatsCache.lastSentHeartbeatDate=r,o.length>0?(this._heartbeatsCache.heartbeats=o,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),c}catch(r){return ri.warn(r),""}}}function N1(){return new Date().toISOString().substring(0,10)}function ZI(e,t=YI){const r=[];let a=e.slice();for(const o of e){const c=r.find(u=>u.agent===o.agent);if(c){if(c.dates.push(o.date),C1(r)>t){c.dates.pop();break}}else if(r.push({agent:o.agent,dates:[o.date]}),C1(r)>t){r.pop();break}a=a.slice(1)}return{heartbeatsToSend:r,unsentEntries:a}}class JI{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return z5()?B5().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const r=await VI(this.app);return r!=null&&r.heartbeats?r:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){if(await this._canUseIndexedDBPromise){const a=await this.read();return T1(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??a.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){if(await this._canUseIndexedDBPromise){const a=await this.read();return T1(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??a.lastSentHeartbeatDate,heartbeats:[...a.heartbeats,...t.heartbeats]})}else return}}function C1(e){return fE(JSON.stringify({version:2,heartbeats:e})).length}function QI(e){if(e.length===0)return-1;let t=0,r=e[0].date;for(let a=1;a<e.length;a++)e[a].date<r&&(r=e[a].date,t=a);return t}/**
|
|
433
|
-
* @license
|
|
434
|
-
* Copyright 2019 Google LLC
|
|
435
|
-
*
|
|
436
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
437
|
-
* you may not use this file except in compliance with the License.
|
|
438
|
-
* You may obtain a copy of the License at
|
|
439
|
-
*
|
|
440
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
441
|
-
*
|
|
442
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
443
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
444
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
445
|
-
* See the License for the specific language governing permissions and
|
|
446
|
-
* limitations under the License.
|
|
447
|
-
*/function e3(e){hl(new js("platform-logger",t=>new dI(t),"PRIVATE")),hl(new js("heartbeat",t=>new XI(t),"PRIVATE")),Ns(tp,w1,e),Ns(tp,w1,"esm2020"),Ns("fire-js","")}e3("");var t3="firebase",n3="12.9.0";/**
|
|
448
|
-
* @license
|
|
449
|
-
* Copyright 2020 Google LLC
|
|
450
|
-
*
|
|
451
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
452
|
-
* you may not use this file except in compliance with the License.
|
|
453
|
-
* You may obtain a copy of the License at
|
|
454
|
-
*
|
|
455
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
456
|
-
*
|
|
457
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
458
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
459
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
460
|
-
* See the License for the specific language governing permissions and
|
|
461
|
-
* limitations under the License.
|
|
462
|
-
*/Ns(t3,n3,"app");function _E(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const r3=_E,wE=new El("auth","Firebase",_E());/**
|
|
463
|
-
* @license
|
|
464
|
-
* Copyright 2020 Google LLC
|
|
465
|
-
*
|
|
466
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
467
|
-
* you may not use this file except in compliance with the License.
|
|
468
|
-
* You may obtain a copy of the License at
|
|
469
|
-
*
|
|
470
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
471
|
-
*
|
|
472
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
473
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
474
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
475
|
-
* See the License for the specific language governing permissions and
|
|
476
|
-
* limitations under the License.
|
|
477
|
-
*/const _u=new gE("@firebase/auth");function i3(e,...t){_u.logLevel<=xt.WARN&&_u.warn(`Auth (${_l}): ${e}`,...t)}function lu(e,...t){_u.logLevel<=xt.ERROR&&_u.error(`Auth (${_l}): ${e}`,...t)}/**
|
|
478
|
-
* @license
|
|
479
|
-
* Copyright 2020 Google LLC
|
|
480
|
-
*
|
|
481
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
482
|
-
* you may not use this file except in compliance with the License.
|
|
483
|
-
* You may obtain a copy of the License at
|
|
484
|
-
*
|
|
485
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
486
|
-
*
|
|
487
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
488
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
489
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
490
|
-
* See the License for the specific language governing permissions and
|
|
491
|
-
* limitations under the License.
|
|
492
|
-
*/function Ar(e,...t){throw Fp(e,...t)}function pr(e,...t){return Fp(e,...t)}function Hp(e,t,r){const a={...r3(),[t]:r};return new El("auth","Firebase",a).create(t,{appName:e.name})}function va(e){return Hp(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function a3(e,t,r){const a=r;if(!(t instanceof a))throw a.name!==t.constructor.name&&Ar(e,"argument-error"),Hp(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Fp(e,...t){if(typeof e!="string"){const r=t[0],a=[...t.slice(1)];return a[0]&&(a[0].appName=e.name),e._errorFactory.create(r,...a)}return wE.create(e,...t)}function ze(e,t,...r){if(!e)throw Fp(t,...r)}function ei(e){const t="INTERNAL ASSERTION FAILED: "+e;throw lu(t),new Error(t)}function ii(e,t){e||ei(t)}/**
|
|
493
|
-
* @license
|
|
494
|
-
* Copyright 2020 Google LLC
|
|
495
|
-
*
|
|
496
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
497
|
-
* you may not use this file except in compliance with the License.
|
|
498
|
-
* You may obtain a copy of the License at
|
|
499
|
-
*
|
|
500
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
501
|
-
*
|
|
502
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
503
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
504
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
505
|
-
* See the License for the specific language governing permissions and
|
|
506
|
-
* limitations under the License.
|
|
507
|
-
*/function ip(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function s3(){return A1()==="http:"||A1()==="https:"}function A1(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
|
|
508
|
-
* @license
|
|
509
|
-
* Copyright 2020 Google LLC
|
|
510
|
-
*
|
|
511
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
512
|
-
* you may not use this file except in compliance with the License.
|
|
513
|
-
* You may obtain a copy of the License at
|
|
514
|
-
*
|
|
515
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
516
|
-
*
|
|
517
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
518
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
519
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
520
|
-
* See the License for the specific language governing permissions and
|
|
521
|
-
* limitations under the License.
|
|
522
|
-
*/function o3(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(s3()||D5()||"connection"in navigator)?navigator.onLine:!0}function l3(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
|
|
523
|
-
* @license
|
|
524
|
-
* Copyright 2020 Google LLC
|
|
525
|
-
*
|
|
526
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
527
|
-
* you may not use this file except in compliance with the License.
|
|
528
|
-
* You may obtain a copy of the License at
|
|
529
|
-
*
|
|
530
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
531
|
-
*
|
|
532
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
533
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
534
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
535
|
-
* See the License for the specific language governing permissions and
|
|
536
|
-
* limitations under the License.
|
|
537
|
-
*/class wl{constructor(t,r){this.shortDelay=t,this.longDelay=r,ii(r>t,"Short delay should be less than long delay!"),this.isMobile=M5()||L5()}get(){return o3()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
|
|
538
|
-
* @license
|
|
539
|
-
* Copyright 2020 Google LLC
|
|
540
|
-
*
|
|
541
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
542
|
-
* you may not use this file except in compliance with the License.
|
|
543
|
-
* You may obtain a copy of the License at
|
|
544
|
-
*
|
|
545
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
546
|
-
*
|
|
547
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
548
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
549
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
550
|
-
* See the License for the specific language governing permissions and
|
|
551
|
-
* limitations under the License.
|
|
552
|
-
*/function $p(e,t){ii(e.emulator,"Emulator should always be set here");const{url:r}=e.emulator;return t?`${r}${t.startsWith("/")?t.slice(1):t}`:r}/**
|
|
553
|
-
* @license
|
|
554
|
-
* Copyright 2020 Google LLC
|
|
555
|
-
*
|
|
556
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
557
|
-
* you may not use this file except in compliance with the License.
|
|
558
|
-
* You may obtain a copy of the License at
|
|
559
|
-
*
|
|
560
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
561
|
-
*
|
|
562
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
563
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
564
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
565
|
-
* See the License for the specific language governing permissions and
|
|
566
|
-
* limitations under the License.
|
|
567
|
-
*/class kE{static initialize(t,r,a){this.fetchImpl=t,r&&(this.headersImpl=r),a&&(this.responseImpl=a)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;ei("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;ei("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;ei("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
|
|
568
|
-
* @license
|
|
569
|
-
* Copyright 2020 Google LLC
|
|
570
|
-
*
|
|
571
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
572
|
-
* you may not use this file except in compliance with the License.
|
|
573
|
-
* You may obtain a copy of the License at
|
|
574
|
-
*
|
|
575
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
576
|
-
*
|
|
577
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
578
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
579
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
580
|
-
* See the License for the specific language governing permissions and
|
|
581
|
-
* limitations under the License.
|
|
582
|
-
*/const c3={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
|
|
583
|
-
* @license
|
|
584
|
-
* Copyright 2020 Google LLC
|
|
585
|
-
*
|
|
586
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
587
|
-
* you may not use this file except in compliance with the License.
|
|
588
|
-
* You may obtain a copy of the License at
|
|
589
|
-
*
|
|
590
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
591
|
-
*
|
|
592
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
593
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
594
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
595
|
-
* See the License for the specific language governing permissions and
|
|
596
|
-
* limitations under the License.
|
|
597
|
-
*/const u3=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],d3=new wl(3e4,6e4);function Gp(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function Hs(e,t,r,a,o={}){return TE(e,o,async()=>{let c={},u={};a&&(t==="GET"?u=a:c={body:JSON.stringify(a)});const d=Sl({key:e.config.apiKey,...u}).slice(1),h=await e._getAdditionalHeaders();h["Content-Type"]="application/json",e.languageCode&&(h["X-Firebase-Locale"]=e.languageCode);const m={method:t,headers:h,...c};return I5()||(m.referrerPolicy="no-referrer"),e.emulatorConfig&&ju(e.emulatorConfig.host)&&(m.credentials="include"),kE.fetch()(await NE(e,e.config.apiHost,r,d),m)})}async function TE(e,t,r){e._canInitEmulator=!1;const a={...c3,...t};try{const o=new h3(e),c=await Promise.race([r(),o.promise]);o.clearNetworkTimeout();const u=await c.json();if("needConfirmation"in u)throw ru(e,"account-exists-with-different-credential",u);if(c.ok&&!("errorMessage"in u))return u;{const d=c.ok?u.errorMessage:u.error.message,[h,m]=d.split(" : ");if(h==="FEDERATED_USER_ID_ALREADY_LINKED")throw ru(e,"credential-already-in-use",u);if(h==="EMAIL_EXISTS")throw ru(e,"email-already-in-use",u);if(h==="USER_DISABLED")throw ru(e,"user-disabled",u);const b=a[h]||h.toLowerCase().replace(/[_\s]+/g,"-");if(m)throw Hp(e,b,m);Ar(e,b)}}catch(o){if(o instanceof Ki)throw o;Ar(e,"network-request-failed",{message:String(o)})}}async function f3(e,t,r,a,o={}){const c=await Hs(e,t,r,a,o);return"mfaPendingCredential"in c&&Ar(e,"multi-factor-auth-required",{_serverResponse:c}),c}async function NE(e,t,r,a){const o=`${t}${r}?${a}`,c=e,u=c.config.emulator?$p(e.config,o):`${e.config.apiScheme}://${o}`;return u3.includes(r)&&(await c._persistenceManagerAvailable,c._getPersistenceType()==="COOKIE")?c._getPersistence()._getFinalTarget(u).toString():u}class h3{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((r,a)=>{this.timer=setTimeout(()=>a(pr(this.auth,"network-request-failed")),d3.get())})}}function ru(e,t,r){const a={appName:e.name};r.email&&(a.email=r.email),r.phoneNumber&&(a.phoneNumber=r.phoneNumber);const o=pr(e,t,a);return o.customData._tokenResponse=r,o}/**
|
|
598
|
-
* @license
|
|
599
|
-
* Copyright 2020 Google LLC
|
|
600
|
-
*
|
|
601
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
602
|
-
* you may not use this file except in compliance with the License.
|
|
603
|
-
* You may obtain a copy of the License at
|
|
604
|
-
*
|
|
605
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
606
|
-
*
|
|
607
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
608
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
609
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
610
|
-
* See the License for the specific language governing permissions and
|
|
611
|
-
* limitations under the License.
|
|
612
|
-
*/async function p3(e,t){return Hs(e,"POST","/v1/accounts:delete",t)}async function wu(e,t){return Hs(e,"POST","/v1/accounts:lookup",t)}/**
|
|
613
|
-
* @license
|
|
614
|
-
* Copyright 2020 Google LLC
|
|
615
|
-
*
|
|
616
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
617
|
-
* you may not use this file except in compliance with the License.
|
|
618
|
-
* You may obtain a copy of the License at
|
|
619
|
-
*
|
|
620
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
621
|
-
*
|
|
622
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
623
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
624
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
625
|
-
* See the License for the specific language governing permissions and
|
|
626
|
-
* limitations under the License.
|
|
627
|
-
*/function rl(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function m3(e,t=!1){const r=Na(e),a=await r.getIdToken(t),o=Kp(a);ze(o&&o.exp&&o.auth_time&&o.iat,r.auth,"internal-error");const c=typeof o.firebase=="object"?o.firebase:void 0,u=c==null?void 0:c.sign_in_provider;return{claims:o,token:a,authTime:rl(Ch(o.auth_time)),issuedAtTime:rl(Ch(o.iat)),expirationTime:rl(Ch(o.exp)),signInProvider:u||null,signInSecondFactor:(c==null?void 0:c.sign_in_second_factor)||null}}function Ch(e){return Number(e)*1e3}function Kp(e){const[t,r,a]=e.split(".");if(t===void 0||r===void 0||a===void 0)return lu("JWT malformed, contained fewer than 3 sections"),null;try{const o=hE(r);return o?JSON.parse(o):(lu("Failed to decode base64 JWT payload"),null)}catch(o){return lu("Caught error parsing JWT payload as JSON",o==null?void 0:o.toString()),null}}function O1(e){const t=Kp(e);return ze(t,"internal-error"),ze(typeof t.exp<"u","internal-error"),ze(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
|
|
628
|
-
* @license
|
|
629
|
-
* Copyright 2020 Google LLC
|
|
630
|
-
*
|
|
631
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
632
|
-
* you may not use this file except in compliance with the License.
|
|
633
|
-
* You may obtain a copy of the License at
|
|
634
|
-
*
|
|
635
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
636
|
-
*
|
|
637
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
638
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
639
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
640
|
-
* See the License for the specific language governing permissions and
|
|
641
|
-
* limitations under the License.
|
|
642
|
-
*/async function ml(e,t,r=!1){if(r)return t;try{return await t}catch(a){throw a instanceof Ki&&g3(a)&&e.auth.currentUser===e&&await e.auth.signOut(),a}}function g3({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
|
|
643
|
-
* @license
|
|
644
|
-
* Copyright 2020 Google LLC
|
|
645
|
-
*
|
|
646
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
647
|
-
* you may not use this file except in compliance with the License.
|
|
648
|
-
* You may obtain a copy of the License at
|
|
649
|
-
*
|
|
650
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
651
|
-
*
|
|
652
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
653
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
654
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
655
|
-
* See the License for the specific language governing permissions and
|
|
656
|
-
* limitations under the License.
|
|
657
|
-
*/class b3{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(t){if(t){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const a=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,a)}}schedule(t=!1){if(!this.isRunning)return;const r=this.getInterval(t);this.timerId=setTimeout(async()=>{await this.iteration()},r)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){(t==null?void 0:t.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
|
|
658
|
-
* @license
|
|
659
|
-
* Copyright 2020 Google LLC
|
|
660
|
-
*
|
|
661
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
662
|
-
* you may not use this file except in compliance with the License.
|
|
663
|
-
* You may obtain a copy of the License at
|
|
664
|
-
*
|
|
665
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
666
|
-
*
|
|
667
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
668
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
669
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
670
|
-
* See the License for the specific language governing permissions and
|
|
671
|
-
* limitations under the License.
|
|
672
|
-
*/class ap{constructor(t,r){this.createdAt=t,this.lastLoginAt=r,this._initializeTime()}_initializeTime(){this.lastSignInTime=rl(this.lastLoginAt),this.creationTime=rl(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
|
|
673
|
-
* @license
|
|
674
|
-
* Copyright 2019 Google LLC
|
|
675
|
-
*
|
|
676
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
677
|
-
* you may not use this file except in compliance with the License.
|
|
678
|
-
* You may obtain a copy of the License at
|
|
679
|
-
*
|
|
680
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
681
|
-
*
|
|
682
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
683
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
684
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
685
|
-
* See the License for the specific language governing permissions and
|
|
686
|
-
* limitations under the License.
|
|
687
|
-
*/async function ku(e){var y;const t=e.auth,r=await e.getIdToken(),a=await ml(e,wu(t,{idToken:r}));ze(a==null?void 0:a.users.length,t,"internal-error");const o=a.users[0];e._notifyReloadListener(o);const c=(y=o.providerUserInfo)!=null&&y.length?CE(o.providerUserInfo):[],u=v3(e.providerData,c),d=e.isAnonymous,h=!(e.email&&o.passwordHash)&&!(u!=null&&u.length),m=d?h:!1,b={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:u,metadata:new ap(o.createdAt,o.lastLoginAt),isAnonymous:m};Object.assign(e,b)}async function y3(e){const t=Na(e);await ku(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function v3(e,t){return[...e.filter(a=>!t.some(o=>o.providerId===a.providerId)),...t]}function CE(e){return e.map(({providerId:t,...r})=>({providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}))}/**
|
|
688
|
-
* @license
|
|
689
|
-
* Copyright 2020 Google LLC
|
|
690
|
-
*
|
|
691
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
692
|
-
* you may not use this file except in compliance with the License.
|
|
693
|
-
* You may obtain a copy of the License at
|
|
694
|
-
*
|
|
695
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
696
|
-
*
|
|
697
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
698
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
699
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
700
|
-
* See the License for the specific language governing permissions and
|
|
701
|
-
* limitations under the License.
|
|
702
|
-
*/async function x3(e,t){const r=await TE(e,{},async()=>{const a=Sl({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:o,apiKey:c}=e.config,u=await NE(e,o,"/v1/token",`key=${c}`),d=await e._getAdditionalHeaders();d["Content-Type"]="application/x-www-form-urlencoded";const h={method:"POST",headers:d,body:a};return e.emulatorConfig&&ju(e.emulatorConfig.host)&&(h.credentials="include"),kE.fetch()(u,h)});return{accessToken:r.access_token,expiresIn:r.expires_in,refreshToken:r.refresh_token}}async function E3(e,t){return Hs(e,"POST","/v2/accounts:revokeToken",Gp(e,t))}/**
|
|
703
|
-
* @license
|
|
704
|
-
* Copyright 2020 Google LLC
|
|
705
|
-
*
|
|
706
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
707
|
-
* you may not use this file except in compliance with the License.
|
|
708
|
-
* You may obtain a copy of the License at
|
|
709
|
-
*
|
|
710
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
711
|
-
*
|
|
712
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
713
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
714
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
715
|
-
* See the License for the specific language governing permissions and
|
|
716
|
-
* limitations under the License.
|
|
717
|
-
*/class Cs{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){ze(t.idToken,"internal-error"),ze(typeof t.idToken<"u","internal-error"),ze(typeof t.refreshToken<"u","internal-error");const r="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):O1(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,r)}updateFromIdToken(t){ze(t.length!==0,"internal-error");const r=O1(t);this.updateTokensAndExpiration(t,null,r)}async getToken(t,r=!1){return!r&&this.accessToken&&!this.isExpired?this.accessToken:(ze(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(t,r){const{accessToken:a,refreshToken:o,expiresIn:c}=await x3(t,r);this.updateTokensAndExpiration(a,o,Number(c))}updateTokensAndExpiration(t,r,a){this.refreshToken=r||null,this.accessToken=t||null,this.expirationTime=Date.now()+a*1e3}static fromJSON(t,r){const{refreshToken:a,accessToken:o,expirationTime:c}=r,u=new Cs;return a&&(ze(typeof a=="string","internal-error",{appName:t}),u.refreshToken=a),o&&(ze(typeof o=="string","internal-error",{appName:t}),u.accessToken=o),c&&(ze(typeof c=="number","internal-error",{appName:t}),u.expirationTime=c),u}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new Cs,this.toJSON())}_performRefresh(){return ei("not implemented")}}/**
|
|
718
|
-
* @license
|
|
719
|
-
* Copyright 2020 Google LLC
|
|
720
|
-
*
|
|
721
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
722
|
-
* you may not use this file except in compliance with the License.
|
|
723
|
-
* You may obtain a copy of the License at
|
|
724
|
-
*
|
|
725
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
726
|
-
*
|
|
727
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
728
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
729
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
730
|
-
* See the License for the specific language governing permissions and
|
|
731
|
-
* limitations under the License.
|
|
732
|
-
*/function ji(e,t){ze(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class fr{constructor({uid:t,auth:r,stsTokenManager:a,...o}){this.providerId="firebase",this.proactiveRefresh=new b3(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=a,this.accessToken=a.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.providerData=o.providerData?[...o.providerData]:[],this.metadata=new ap(o.createdAt||void 0,o.lastLoginAt||void 0)}async getIdToken(t){const r=await ml(this,this.stsTokenManager.getToken(this.auth,t));return ze(r,this.auth,"internal-error"),this.accessToken!==r&&(this.accessToken=r,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),r}getIdTokenResult(t){return m3(this,t)}reload(){return y3(this)}_assign(t){this!==t&&(ze(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(r=>({...r})),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const r=new fr({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return r.metadata._copy(this.metadata),r}_onReload(t){ze(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,r=!1){let a=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),a=!0),r&&await ku(this),await this.auth._persistUserIfCurrent(this),a&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Nr(this.auth.app))return Promise.reject(va(this.auth));const t=await this.getIdToken();return await ml(this,p3(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>({...t})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,r){const a=r.displayName??void 0,o=r.email??void 0,c=r.phoneNumber??void 0,u=r.photoURL??void 0,d=r.tenantId??void 0,h=r._redirectEventId??void 0,m=r.createdAt??void 0,b=r.lastLoginAt??void 0,{uid:y,emailVerified:v,isAnonymous:x,providerData:_,stsTokenManager:S}=r;ze(y&&S,t,"internal-error");const O=Cs.fromJSON(this.name,S);ze(typeof y=="string",t,"internal-error"),ji(a,t.name),ji(o,t.name),ze(typeof v=="boolean",t,"internal-error"),ze(typeof x=="boolean",t,"internal-error"),ji(c,t.name),ji(u,t.name),ji(d,t.name),ji(h,t.name),ji(m,t.name),ji(b,t.name);const k=new fr({uid:y,auth:t,email:o,emailVerified:v,displayName:a,isAnonymous:x,photoURL:u,phoneNumber:c,tenantId:d,stsTokenManager:O,createdAt:m,lastLoginAt:b});return _&&Array.isArray(_)&&(k.providerData=_.map(D=>({...D}))),h&&(k._redirectEventId=h),k}static async _fromIdTokenResponse(t,r,a=!1){const o=new Cs;o.updateFromServerResponse(r);const c=new fr({uid:r.localId,auth:t,stsTokenManager:o,isAnonymous:a});return await ku(c),c}static async _fromGetAccountInfoResponse(t,r,a){const o=r.users[0];ze(o.localId!==void 0,"internal-error");const c=o.providerUserInfo!==void 0?CE(o.providerUserInfo):[],u=!(o.email&&o.passwordHash)&&!(c!=null&&c.length),d=new Cs;d.updateFromIdToken(a);const h=new fr({uid:o.localId,auth:t,stsTokenManager:d,isAnonymous:u}),m={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:c,metadata:new ap(o.createdAt,o.lastLoginAt),isAnonymous:!(o.email&&o.passwordHash)&&!(c!=null&&c.length)};return Object.assign(h,m),h}}/**
|
|
733
|
-
* @license
|
|
734
|
-
* Copyright 2020 Google LLC
|
|
735
|
-
*
|
|
736
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
737
|
-
* you may not use this file except in compliance with the License.
|
|
738
|
-
* You may obtain a copy of the License at
|
|
739
|
-
*
|
|
740
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
741
|
-
*
|
|
742
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
743
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
744
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
745
|
-
* See the License for the specific language governing permissions and
|
|
746
|
-
* limitations under the License.
|
|
747
|
-
*/const R1=new Map;function ti(e){ii(e instanceof Function,"Expected a class definition");let t=R1.get(e);return t?(ii(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,R1.set(e,t),t)}/**
|
|
748
|
-
* @license
|
|
749
|
-
* Copyright 2019 Google LLC
|
|
750
|
-
*
|
|
751
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
752
|
-
* you may not use this file except in compliance with the License.
|
|
753
|
-
* You may obtain a copy of the License at
|
|
754
|
-
*
|
|
755
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
756
|
-
*
|
|
757
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
758
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
759
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
760
|
-
* See the License for the specific language governing permissions and
|
|
761
|
-
* limitations under the License.
|
|
762
|
-
*/class AE{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,r){this.storage[t]=r}async _get(t){const r=this.storage[t];return r===void 0?null:r}async _remove(t){delete this.storage[t]}_addListener(t,r){}_removeListener(t,r){}}AE.type="NONE";const sp=AE;/**
|
|
763
|
-
* @license
|
|
764
|
-
* Copyright 2019 Google LLC
|
|
765
|
-
*
|
|
766
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
767
|
-
* you may not use this file except in compliance with the License.
|
|
768
|
-
* You may obtain a copy of the License at
|
|
769
|
-
*
|
|
770
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
771
|
-
*
|
|
772
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
773
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
774
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
775
|
-
* See the License for the specific language governing permissions and
|
|
776
|
-
* limitations under the License.
|
|
777
|
-
*/function cu(e,t,r){return`firebase:${e}:${t}:${r}`}class As{constructor(t,r,a){this.persistence=t,this.auth=r,this.userKey=a;const{config:o,name:c}=this.auth;this.fullUserKey=cu(this.userKey,o.apiKey,c),this.fullPersistenceKey=cu("persistence",o.apiKey,c),this.boundEventHandler=r._onStorageEvent.bind(r),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);if(!t)return null;if(typeof t=="string"){const r=await wu(this.auth,{idToken:t}).catch(()=>{});return r?fr._fromGetAccountInfoResponse(this.auth,r,t):null}return fr._fromJSON(this.auth,t)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const r=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=t,r)return this.setCurrentUser(r)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,r,a="authUser"){if(!r.length)return new As(ti(sp),t,a);const o=(await Promise.all(r.map(async m=>{if(await m._isAvailable())return m}))).filter(m=>m);let c=o[0]||ti(sp);const u=cu(a,t.config.apiKey,t.name);let d=null;for(const m of r)try{const b=await m._get(u);if(b){let y;if(typeof b=="string"){const v=await wu(t,{idToken:b}).catch(()=>{});if(!v)break;y=await fr._fromGetAccountInfoResponse(t,v,b)}else y=fr._fromJSON(t,b);m!==c&&(d=y),c=m;break}}catch{}const h=o.filter(m=>m._shouldAllowMigration);return!c._shouldAllowMigration||!h.length?new As(c,t,a):(c=h[0],d&&await c._set(u,d.toJSON()),await Promise.all(r.map(async m=>{if(m!==c)try{await m._remove(u)}catch{}})),new As(c,t,a))}}/**
|
|
778
|
-
* @license
|
|
779
|
-
* Copyright 2020 Google LLC
|
|
780
|
-
*
|
|
781
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
782
|
-
* you may not use this file except in compliance with the License.
|
|
783
|
-
* You may obtain a copy of the License at
|
|
784
|
-
*
|
|
785
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
786
|
-
*
|
|
787
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
788
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
789
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
790
|
-
* See the License for the specific language governing permissions and
|
|
791
|
-
* limitations under the License.
|
|
792
|
-
*/function M1(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(IE(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(OE(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(LE(t))return"Blackberry";if(jE(t))return"Webos";if(RE(t))return"Safari";if((t.includes("chrome/")||ME(t))&&!t.includes("edge/"))return"Chrome";if(DE(t))return"Android";{const r=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,a=e.match(r);if((a==null?void 0:a.length)===2)return a[1]}return"Other"}function OE(e=En()){return/firefox\//i.test(e)}function RE(e=En()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function ME(e=En()){return/crios\//i.test(e)}function IE(e=En()){return/iemobile/i.test(e)}function DE(e=En()){return/android/i.test(e)}function LE(e=En()){return/blackberry/i.test(e)}function jE(e=En()){return/webos/i.test(e)}function qp(e=En()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function S3(e=En()){var t;return qp(e)&&!!((t=window.navigator)!=null&&t.standalone)}function _3(){return j5()&&document.documentMode===10}function zE(e=En()){return qp(e)||DE(e)||jE(e)||LE(e)||/windows phone/i.test(e)||IE(e)}/**
|
|
793
|
-
* @license
|
|
794
|
-
* Copyright 2020 Google LLC
|
|
795
|
-
*
|
|
796
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
797
|
-
* you may not use this file except in compliance with the License.
|
|
798
|
-
* You may obtain a copy of the License at
|
|
799
|
-
*
|
|
800
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
801
|
-
*
|
|
802
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
803
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
804
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
805
|
-
* See the License for the specific language governing permissions and
|
|
806
|
-
* limitations under the License.
|
|
807
|
-
*/function BE(e,t=[]){let r;switch(e){case"Browser":r=M1(En());break;case"Worker":r=`${M1(En())}-${e}`;break;default:r=e}const a=t.length?t.join(","):"FirebaseCore-web";return`${r}/JsCore/${_l}/${a}`}/**
|
|
808
|
-
* @license
|
|
809
|
-
* Copyright 2022 Google LLC
|
|
810
|
-
*
|
|
811
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
812
|
-
* you may not use this file except in compliance with the License.
|
|
813
|
-
* You may obtain a copy of the License at
|
|
814
|
-
*
|
|
815
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
816
|
-
*
|
|
817
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
818
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
819
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
820
|
-
* See the License for the specific language governing permissions and
|
|
821
|
-
* limitations under the License.
|
|
822
|
-
*/class w3{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,r){const a=c=>new Promise((u,d)=>{try{const h=t(c);u(h)}catch(h){d(h)}});a.onAbort=r,this.queue.push(a);const o=this.queue.length-1;return()=>{this.queue[o]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const r=[];try{for(const a of this.queue)await a(t),a.onAbort&&r.push(a.onAbort)}catch(a){r.reverse();for(const o of r)try{o()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:a==null?void 0:a.message})}}}/**
|
|
823
|
-
* @license
|
|
824
|
-
* Copyright 2023 Google LLC
|
|
825
|
-
*
|
|
826
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
827
|
-
* you may not use this file except in compliance with the License.
|
|
828
|
-
* You may obtain a copy of the License at
|
|
829
|
-
*
|
|
830
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
831
|
-
*
|
|
832
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
833
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
834
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
835
|
-
* See the License for the specific language governing permissions and
|
|
836
|
-
* limitations under the License.
|
|
837
|
-
*/async function k3(e,t={}){return Hs(e,"GET","/v2/passwordPolicy",Gp(e,t))}/**
|
|
838
|
-
* @license
|
|
839
|
-
* Copyright 2023 Google LLC
|
|
840
|
-
*
|
|
841
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
842
|
-
* you may not use this file except in compliance with the License.
|
|
843
|
-
* You may obtain a copy of the License at
|
|
844
|
-
*
|
|
845
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
846
|
-
*
|
|
847
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
848
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
849
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
850
|
-
* See the License for the specific language governing permissions and
|
|
851
|
-
* limitations under the License.
|
|
852
|
-
*/const T3=6;class N3{constructor(t){var a;const r=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=r.minPasswordLength??T3,r.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=r.maxPasswordLength),r.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=r.containsLowercaseCharacter),r.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=r.containsUppercaseCharacter),r.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=r.containsNumericCharacter),r.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=r.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((a=t.allowedNonAlphanumericCharacters)==null?void 0:a.join(""))??"",this.forceUpgradeOnSignin=t.forceUpgradeOnSignin??!1,this.schemaVersion=t.schemaVersion}validatePassword(t){const r={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,r),this.validatePasswordCharacterOptions(t,r),r.isValid&&(r.isValid=r.meetsMinPasswordLength??!0),r.isValid&&(r.isValid=r.meetsMaxPasswordLength??!0),r.isValid&&(r.isValid=r.containsLowercaseLetter??!0),r.isValid&&(r.isValid=r.containsUppercaseLetter??!0),r.isValid&&(r.isValid=r.containsNumericCharacter??!0),r.isValid&&(r.isValid=r.containsNonAlphanumericCharacter??!0),r}validatePasswordLengthOptions(t,r){const a=this.customStrengthOptions.minPasswordLength,o=this.customStrengthOptions.maxPasswordLength;a&&(r.meetsMinPasswordLength=t.length>=a),o&&(r.meetsMaxPasswordLength=t.length<=o)}validatePasswordCharacterOptions(t,r){this.updatePasswordCharacterOptionsStatuses(r,!1,!1,!1,!1);let a;for(let o=0;o<t.length;o++)a=t.charAt(o),this.updatePasswordCharacterOptionsStatuses(r,a>="a"&&a<="z",a>="A"&&a<="Z",a>="0"&&a<="9",this.allowedNonAlphanumericCharacters.includes(a))}updatePasswordCharacterOptionsStatuses(t,r,a,o,c){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=r)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=a)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=o)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=c))}}/**
|
|
853
|
-
* @license
|
|
854
|
-
* Copyright 2020 Google LLC
|
|
855
|
-
*
|
|
856
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
857
|
-
* you may not use this file except in compliance with the License.
|
|
858
|
-
* You may obtain a copy of the License at
|
|
859
|
-
*
|
|
860
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
861
|
-
*
|
|
862
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
863
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
864
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
865
|
-
* See the License for the specific language governing permissions and
|
|
866
|
-
* limitations under the License.
|
|
867
|
-
*/class C3{constructor(t,r,a,o){this.app=t,this.heartbeatServiceProvider=r,this.appCheckServiceProvider=a,this.config=o,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new I1(this),this.idTokenSubscription=new I1(this),this.beforeStateQueue=new w3(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=wE,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=o.sdkClientVersion,this._persistenceManagerAvailable=new Promise(c=>this._resolvePersistenceManagerAvailable=c)}_initializeWithPersistence(t,r){return r&&(this._popupRedirectResolver=ti(r)),this._initializationPromise=this.queue(async()=>{var a,o,c;if(!this._deleted&&(this.persistenceManager=await As.create(this,t),(a=this._resolvePersistenceManagerAvailable)==null||a.call(this),!this._deleted)){if((o=this._popupRedirectResolver)!=null&&o._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(r),this.lastNotifiedUid=((c=this.currentUser)==null?void 0:c.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!t)){if(this.currentUser&&t&&this.currentUser.uid===t.uid){this._currentUser._assign(t),await this.currentUser.getIdToken();return}await this._updateCurrentUser(t,!0)}}async initializeCurrentUserFromIdToken(t){try{const r=await wu(this,{idToken:t}),a=await fr._fromGetAccountInfoResponse(this,r,t);await this.directlySetCurrentUser(a)}catch(r){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",r),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var c;if(Nr(this.app)){const u=this.app.settings.authIdToken;return u?new Promise(d=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(u).then(d,d))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let a=r,o=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const u=(c=this.redirectUser)==null?void 0:c._redirectEventId,d=a==null?void 0:a._redirectEventId,h=await this.tryRedirectSignIn(t);(!u||u===d)&&(h!=null&&h.user)&&(a=h.user,o=!0)}if(!a)return this.directlySetCurrentUser(null);if(!a._redirectEventId){if(o)try{await this.beforeStateQueue.runMiddleware(a)}catch(u){a=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(u))}return a?this.reloadAndSetCurrentUserOrClear(a):this.directlySetCurrentUser(null)}return ze(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===a._redirectEventId?this.directlySetCurrentUser(a):this.reloadAndSetCurrentUserOrClear(a)}async tryRedirectSignIn(t){let r=null;try{r=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch{await this._setRedirectUser(null)}return r}async reloadAndSetCurrentUserOrClear(t){try{await ku(t)}catch(r){if((r==null?void 0:r.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=l3()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(Nr(this.app))return Promise.reject(va(this));const r=t?Na(t):null;return r&&ze(r.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(r&&r._clone(this))}async _updateCurrentUser(t,r=!1){if(!this._deleted)return t&&ze(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),r||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return Nr(this.app)?Promise.reject(va(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return Nr(this.app)?Promise.reject(va(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(ti(t))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const r=this._getPasswordPolicyInternal();return r.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):r.validatePassword(t)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await k3(this),r=new N3(t);this.tenantId===null?this._projectPasswordPolicy=r:this._tenantPasswordPolicies[this.tenantId]=r}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(t){this._errorFactory=new El("auth","Firebase",t())}onAuthStateChanged(t,r,a){return this.registerStateListener(this.authStateSubscription,t,r,a)}beforeAuthStateChanged(t,r){return this.beforeStateQueue.pushCallback(t,r)}onIdTokenChanged(t,r,a){return this.registerStateListener(this.idTokenSubscription,t,r,a)}authStateReady(){return new Promise((t,r)=>{if(this.currentUser)t();else{const a=this.onAuthStateChanged(()=>{a(),t()},r)}})}async revokeAccessToken(t){if(this.currentUser){const r=await this.currentUser.getIdToken(),a={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:r};this.tenantId!=null&&(a.tenantId=this.tenantId),await E3(this,a)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)==null?void 0:t.toJSON()}}async _setRedirectUser(t,r){const a=await this.getOrInitRedirectPersistenceManager(r);return t===null?a.removeCurrentUser():a.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const r=t&&ti(t)||this._popupRedirectResolver;ze(r,this,"argument-error"),this.redirectPersistenceManager=await As.create(this,[ti(r._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var r,a;return this._isInitialized&&await this.queue(async()=>{}),((r=this._currentUser)==null?void 0:r._redirectEventId)===t?this._currentUser:((a=this.redirectUser)==null?void 0:a._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var r;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const t=((r=this.currentUser)==null?void 0:r.uid)??null;this.lastNotifiedUid!==t&&(this.lastNotifiedUid=t,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,r,a,o){if(this._deleted)return()=>{};const c=typeof r=="function"?r:r.next.bind(r);let u=!1;const d=this._isInitialized?Promise.resolve():this._initializationPromise;if(ze(d,this,"internal-error"),d.then(()=>{u||c(this.currentUser)}),typeof r=="function"){const h=t.addObserver(r,a,o);return()=>{u=!0,h()}}else{const h=t.addObserver(r);return()=>{u=!0,h()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return ze(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=BE(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var o;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const r=await((o=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:o.getHeartbeatsHeader());r&&(t["X-Firebase-Client"]=r);const a=await this._getAppCheckToken();return a&&(t["X-Firebase-AppCheck"]=a),t}async _getAppCheckToken(){var r;if(Nr(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await((r=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:r.getToken());return t!=null&&t.error&&i3(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function zu(e){return Na(e)}class I1{constructor(t){this.auth=t,this.observer=null,this.addObserver=$5(r=>this.observer=r)}get next(){return ze(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
|
|
868
|
-
* @license
|
|
869
|
-
* Copyright 2020 Google LLC
|
|
870
|
-
*
|
|
871
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
872
|
-
* you may not use this file except in compliance with the License.
|
|
873
|
-
* You may obtain a copy of the License at
|
|
874
|
-
*
|
|
875
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
876
|
-
*
|
|
877
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
878
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
879
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
880
|
-
* See the License for the specific language governing permissions and
|
|
881
|
-
* limitations under the License.
|
|
882
|
-
*/let Vp={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function A3(e){Vp=e}function O3(e){return Vp.loadJS(e)}function R3(){return Vp.gapiScript}function M3(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
|
|
883
|
-
* @license
|
|
884
|
-
* Copyright 2020 Google LLC
|
|
885
|
-
*
|
|
886
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
887
|
-
* you may not use this file except in compliance with the License.
|
|
888
|
-
* You may obtain a copy of the License at
|
|
889
|
-
*
|
|
890
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
891
|
-
*
|
|
892
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
893
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
894
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
895
|
-
* See the License for the specific language governing permissions and
|
|
896
|
-
* limitations under the License.
|
|
897
|
-
*/function I3(e,t){const r=vE(e,"auth");if(r.isInitialized()){const o=r.getImmediate(),c=r.getOptions();if(Ls(c,t??{}))return o;Ar(o,"already-initialized")}return r.initialize({options:t})}function D3(e,t){const r=(t==null?void 0:t.persistence)||[],a=(Array.isArray(r)?r:[r]).map(ti);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(a,t==null?void 0:t.popupRedirectResolver)}function L3(e,t,r){const a=zu(e);ze(/^https?:\/\//.test(t),a,"invalid-emulator-scheme");const o=!1,c=UE(t),{host:u,port:d}=j3(t),h=d===null?"":`:${d}`,m={url:`${c}//${u}${h}/`},b=Object.freeze({host:u,port:d,protocol:c.replace(":",""),options:Object.freeze({disableWarnings:o})});if(!a._canInitEmulator){ze(a.config.emulator&&a.emulatorConfig,a,"emulator-config-failed"),ze(Ls(m,a.config.emulator)&&Ls(b,a.emulatorConfig),a,"emulator-config-failed");return}a.config.emulator=m,a.emulatorConfig=b,a.settings.appVerificationDisabledForTesting=!0,ju(u)?(C5(`${c}//${u}${h}`),R5("Auth",!0)):z3()}function UE(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function j3(e){const t=UE(e),r=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!r)return{host:"",port:null};const a=r[2].split("@").pop()||"",o=/^(\[[^\]]+\])(:|$)/.exec(a);if(o){const c=o[1];return{host:c,port:D1(a.substr(c.length+1))}}else{const[c,u]=a.split(":");return{host:c,port:D1(u)}}}function D1(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function z3(){function e(){const t=document.createElement("p"),r=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",r.position="fixed",r.width="100%",r.backgroundColor="#ffffff",r.border=".1em solid #000000",r.color="#b50000",r.bottom="0px",r.left="0px",r.margin="0px",r.zIndex="10000",r.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):e())}/**
|
|
898
|
-
* @license
|
|
899
|
-
* Copyright 2020 Google LLC
|
|
900
|
-
*
|
|
901
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
902
|
-
* you may not use this file except in compliance with the License.
|
|
903
|
-
* You may obtain a copy of the License at
|
|
904
|
-
*
|
|
905
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
906
|
-
*
|
|
907
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
908
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
909
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
910
|
-
* See the License for the specific language governing permissions and
|
|
911
|
-
* limitations under the License.
|
|
912
|
-
*/class PE{constructor(t,r){this.providerId=t,this.signInMethod=r}toJSON(){return ei("not implemented")}_getIdTokenResponse(t){return ei("not implemented")}_linkToIdToken(t,r){return ei("not implemented")}_getReauthenticationResolver(t){return ei("not implemented")}}/**
|
|
913
|
-
* @license
|
|
914
|
-
* Copyright 2020 Google LLC
|
|
915
|
-
*
|
|
916
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
917
|
-
* you may not use this file except in compliance with the License.
|
|
918
|
-
* You may obtain a copy of the License at
|
|
919
|
-
*
|
|
920
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
921
|
-
*
|
|
922
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
923
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
924
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
925
|
-
* See the License for the specific language governing permissions and
|
|
926
|
-
* limitations under the License.
|
|
927
|
-
*/async function Os(e,t){return f3(e,"POST","/v1/accounts:signInWithIdp",Gp(e,t))}/**
|
|
928
|
-
* @license
|
|
929
|
-
* Copyright 2020 Google LLC
|
|
930
|
-
*
|
|
931
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
932
|
-
* you may not use this file except in compliance with the License.
|
|
933
|
-
* You may obtain a copy of the License at
|
|
934
|
-
*
|
|
935
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
936
|
-
*
|
|
937
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
938
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
939
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
940
|
-
* See the License for the specific language governing permissions and
|
|
941
|
-
* limitations under the License.
|
|
942
|
-
*/const B3="http://localhost";class _a extends PE{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const r=new _a(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(r.idToken=t.idToken),t.accessToken&&(r.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(r.nonce=t.nonce),t.pendingToken&&(r.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(r.accessToken=t.oauthToken,r.secret=t.oauthTokenSecret):Ar("argument-error"),r}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const r=typeof t=="string"?JSON.parse(t):t,{providerId:a,signInMethod:o,...c}=r;if(!a||!o)return null;const u=new _a(a,o);return u.idToken=c.idToken||void 0,u.accessToken=c.accessToken||void 0,u.secret=c.secret,u.nonce=c.nonce,u.pendingToken=c.pendingToken||null,u}_getIdTokenResponse(t){const r=this.buildRequest();return Os(t,r)}_linkToIdToken(t,r){const a=this.buildRequest();return a.idToken=r,Os(t,a)}_getReauthenticationResolver(t){const r=this.buildRequest();return r.autoCreate=!1,Os(t,r)}buildRequest(){const t={requestUri:B3,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const r={};this.idToken&&(r.id_token=this.idToken),this.accessToken&&(r.access_token=this.accessToken),this.secret&&(r.oauth_token_secret=this.secret),r.providerId=this.providerId,this.nonce&&!this.pendingToken&&(r.nonce=this.nonce),t.postBody=Sl(r)}return t}}/**
|
|
943
|
-
* @license
|
|
944
|
-
* Copyright 2020 Google LLC
|
|
945
|
-
*
|
|
946
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
947
|
-
* you may not use this file except in compliance with the License.
|
|
948
|
-
* You may obtain a copy of the License at
|
|
949
|
-
*
|
|
950
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
951
|
-
*
|
|
952
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
953
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
954
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
955
|
-
* See the License for the specific language governing permissions and
|
|
956
|
-
* limitations under the License.
|
|
957
|
-
*/class Yp{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/**
|
|
958
|
-
* @license
|
|
959
|
-
* Copyright 2019 Google LLC
|
|
960
|
-
*
|
|
961
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
962
|
-
* you may not use this file except in compliance with the License.
|
|
963
|
-
* You may obtain a copy of the License at
|
|
964
|
-
*
|
|
965
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
966
|
-
*
|
|
967
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
968
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
969
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
970
|
-
* See the License for the specific language governing permissions and
|
|
971
|
-
* limitations under the License.
|
|
972
|
-
*/class kl extends Yp{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
|
|
973
|
-
* @license
|
|
974
|
-
* Copyright 2020 Google LLC
|
|
975
|
-
*
|
|
976
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
977
|
-
* you may not use this file except in compliance with the License.
|
|
978
|
-
* You may obtain a copy of the License at
|
|
979
|
-
*
|
|
980
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
981
|
-
*
|
|
982
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
983
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
984
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
985
|
-
* See the License for the specific language governing permissions and
|
|
986
|
-
* limitations under the License.
|
|
987
|
-
*/class Bi extends kl{constructor(){super("facebook.com")}static credential(t){return _a._fromParams({providerId:Bi.PROVIDER_ID,signInMethod:Bi.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Bi.credentialFromTaggedObject(t)}static credentialFromError(t){return Bi.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return Bi.credential(t.oauthAccessToken)}catch{return null}}}Bi.FACEBOOK_SIGN_IN_METHOD="facebook.com";Bi.PROVIDER_ID="facebook.com";/**
|
|
988
|
-
* @license
|
|
989
|
-
* Copyright 2020 Google LLC
|
|
990
|
-
*
|
|
991
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
992
|
-
* you may not use this file except in compliance with the License.
|
|
993
|
-
* You may obtain a copy of the License at
|
|
994
|
-
*
|
|
995
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
996
|
-
*
|
|
997
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
998
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
999
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1000
|
-
* See the License for the specific language governing permissions and
|
|
1001
|
-
* limitations under the License.
|
|
1002
|
-
*/class Jr extends kl{constructor(){super("google.com"),this.addScope("profile")}static credential(t,r){return _a._fromParams({providerId:Jr.PROVIDER_ID,signInMethod:Jr.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:r})}static credentialFromResult(t){return Jr.credentialFromTaggedObject(t)}static credentialFromError(t){return Jr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:r,oauthAccessToken:a}=t;if(!r&&!a)return null;try{return Jr.credential(r,a)}catch{return null}}}Jr.GOOGLE_SIGN_IN_METHOD="google.com";Jr.PROVIDER_ID="google.com";/**
|
|
1003
|
-
* @license
|
|
1004
|
-
* Copyright 2020 Google LLC
|
|
1005
|
-
*
|
|
1006
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1007
|
-
* you may not use this file except in compliance with the License.
|
|
1008
|
-
* You may obtain a copy of the License at
|
|
1009
|
-
*
|
|
1010
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1011
|
-
*
|
|
1012
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1013
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1014
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1015
|
-
* See the License for the specific language governing permissions and
|
|
1016
|
-
* limitations under the License.
|
|
1017
|
-
*/class Qr extends kl{constructor(){super("github.com")}static credential(t){return _a._fromParams({providerId:Qr.PROVIDER_ID,signInMethod:Qr.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Qr.credentialFromTaggedObject(t)}static credentialFromError(t){return Qr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return Qr.credential(t.oauthAccessToken)}catch{return null}}}Qr.GITHUB_SIGN_IN_METHOD="github.com";Qr.PROVIDER_ID="github.com";/**
|
|
1018
|
-
* @license
|
|
1019
|
-
* Copyright 2020 Google LLC
|
|
1020
|
-
*
|
|
1021
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1022
|
-
* you may not use this file except in compliance with the License.
|
|
1023
|
-
* You may obtain a copy of the License at
|
|
1024
|
-
*
|
|
1025
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1026
|
-
*
|
|
1027
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1028
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1029
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1030
|
-
* See the License for the specific language governing permissions and
|
|
1031
|
-
* limitations under the License.
|
|
1032
|
-
*/class Ui extends kl{constructor(){super("twitter.com")}static credential(t,r){return _a._fromParams({providerId:Ui.PROVIDER_ID,signInMethod:Ui.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:r})}static credentialFromResult(t){return Ui.credentialFromTaggedObject(t)}static credentialFromError(t){return Ui.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:r,oauthTokenSecret:a}=t;if(!r||!a)return null;try{return Ui.credential(r,a)}catch{return null}}}Ui.TWITTER_SIGN_IN_METHOD="twitter.com";Ui.PROVIDER_ID="twitter.com";/**
|
|
1033
|
-
* @license
|
|
1034
|
-
* Copyright 2020 Google LLC
|
|
1035
|
-
*
|
|
1036
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1037
|
-
* you may not use this file except in compliance with the License.
|
|
1038
|
-
* You may obtain a copy of the License at
|
|
1039
|
-
*
|
|
1040
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1041
|
-
*
|
|
1042
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1043
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1044
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1045
|
-
* See the License for the specific language governing permissions and
|
|
1046
|
-
* limitations under the License.
|
|
1047
|
-
*/class zs{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,r,a,o=!1){const c=await fr._fromIdTokenResponse(t,a,o),u=L1(a);return new zs({user:c,providerId:u,_tokenResponse:a,operationType:r})}static async _forOperation(t,r,a){await t._updateTokensIfNecessary(a,!0);const o=L1(a);return new zs({user:t,providerId:o,_tokenResponse:a,operationType:r})}}function L1(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
|
|
1048
|
-
* @license
|
|
1049
|
-
* Copyright 2020 Google LLC
|
|
1050
|
-
*
|
|
1051
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1052
|
-
* you may not use this file except in compliance with the License.
|
|
1053
|
-
* You may obtain a copy of the License at
|
|
1054
|
-
*
|
|
1055
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1056
|
-
*
|
|
1057
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1058
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1059
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1060
|
-
* See the License for the specific language governing permissions and
|
|
1061
|
-
* limitations under the License.
|
|
1062
|
-
*/class Tu extends Ki{constructor(t,r,a,o){super(r.code,r.message),this.operationType=a,this.user=o,Object.setPrototypeOf(this,Tu.prototype),this.customData={appName:t.name,tenantId:t.tenantId??void 0,_serverResponse:r.customData._serverResponse,operationType:a}}static _fromErrorAndOperation(t,r,a,o){return new Tu(t,r,a,o)}}function HE(e,t,r,a){return(t==="reauthenticate"?r._getReauthenticationResolver(e):r._getIdTokenResponse(e)).catch(c=>{throw c.code==="auth/multi-factor-auth-required"?Tu._fromErrorAndOperation(e,c,t,a):c})}async function U3(e,t,r=!1){const a=await ml(e,t._linkToIdToken(e.auth,await e.getIdToken()),r);return zs._forOperation(e,"link",a)}/**
|
|
1063
|
-
* @license
|
|
1064
|
-
* Copyright 2019 Google LLC
|
|
1065
|
-
*
|
|
1066
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1067
|
-
* you may not use this file except in compliance with the License.
|
|
1068
|
-
* You may obtain a copy of the License at
|
|
1069
|
-
*
|
|
1070
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1071
|
-
*
|
|
1072
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1073
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1074
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1075
|
-
* See the License for the specific language governing permissions and
|
|
1076
|
-
* limitations under the License.
|
|
1077
|
-
*/async function P3(e,t,r=!1){const{auth:a}=e;if(Nr(a.app))return Promise.reject(va(a));const o="reauthenticate";try{const c=await ml(e,HE(a,o,t,e),r);ze(c.idToken,a,"internal-error");const u=Kp(c.idToken);ze(u,a,"internal-error");const{sub:d}=u;return ze(e.uid===d,a,"user-mismatch"),zs._forOperation(e,o,c)}catch(c){throw(c==null?void 0:c.code)==="auth/user-not-found"&&Ar(a,"user-mismatch"),c}}/**
|
|
1078
|
-
* @license
|
|
1079
|
-
* Copyright 2020 Google LLC
|
|
1080
|
-
*
|
|
1081
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1082
|
-
* you may not use this file except in compliance with the License.
|
|
1083
|
-
* You may obtain a copy of the License at
|
|
1084
|
-
*
|
|
1085
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1086
|
-
*
|
|
1087
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1088
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1089
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1090
|
-
* See the License for the specific language governing permissions and
|
|
1091
|
-
* limitations under the License.
|
|
1092
|
-
*/async function H3(e,t,r=!1){if(Nr(e.app))return Promise.reject(va(e));const a="signIn",o=await HE(e,a,t),c=await zs._fromIdTokenResponse(e,a,o);return r||await e._updateCurrentUser(c.user),c}/**
|
|
1093
|
-
* @license
|
|
1094
|
-
* Copyright 2020 Google LLC
|
|
1095
|
-
*
|
|
1096
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1097
|
-
* you may not use this file except in compliance with the License.
|
|
1098
|
-
* You may obtain a copy of the License at
|
|
1099
|
-
*
|
|
1100
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1101
|
-
*
|
|
1102
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1103
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1104
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1105
|
-
* See the License for the specific language governing permissions and
|
|
1106
|
-
* limitations under the License.
|
|
1107
|
-
*/function F3(e,t){return Na(e).setPersistence(t)}function $3(e,t,r,a){return Na(e).onIdTokenChanged(t,r,a)}function G3(e,t,r){return Na(e).beforeAuthStateChanged(t,r)}const Nu="__sak";/**
|
|
1108
|
-
* @license
|
|
1109
|
-
* Copyright 2019 Google LLC
|
|
1110
|
-
*
|
|
1111
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1112
|
-
* you may not use this file except in compliance with the License.
|
|
1113
|
-
* You may obtain a copy of the License at
|
|
1114
|
-
*
|
|
1115
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1116
|
-
*
|
|
1117
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1118
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1119
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1120
|
-
* See the License for the specific language governing permissions and
|
|
1121
|
-
* limitations under the License.
|
|
1122
|
-
*/class FE{constructor(t,r){this.storageRetriever=t,this.type=r}_isAvailable(){try{return this.storage?(this.storage.setItem(Nu,"1"),this.storage.removeItem(Nu),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,r){return this.storage.setItem(t,JSON.stringify(r)),Promise.resolve()}_get(t){const r=this.storage.getItem(t);return Promise.resolve(r?JSON.parse(r):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
|
|
1123
|
-
* @license
|
|
1124
|
-
* Copyright 2020 Google LLC
|
|
1125
|
-
*
|
|
1126
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1127
|
-
* you may not use this file except in compliance with the License.
|
|
1128
|
-
* You may obtain a copy of the License at
|
|
1129
|
-
*
|
|
1130
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1131
|
-
*
|
|
1132
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1133
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1134
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1135
|
-
* See the License for the specific language governing permissions and
|
|
1136
|
-
* limitations under the License.
|
|
1137
|
-
*/const K3=1e3,q3=10;class $E extends FE{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,r)=>this.onStorageEvent(t,r),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=zE(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const r of Object.keys(this.listeners)){const a=this.storage.getItem(r),o=this.localCache[r];a!==o&&t(r,o,a)}}onStorageEvent(t,r=!1){if(!t.key){this.forAllChangedKeys((u,d,h)=>{this.notifyListeners(u,h)});return}const a=t.key;r?this.detachListener():this.stopPolling();const o=()=>{const u=this.storage.getItem(a);!r&&this.localCache[a]===u||this.notifyListeners(a,u)},c=this.storage.getItem(a);_3()&&c!==t.newValue&&t.newValue!==t.oldValue?setTimeout(o,q3):o()}notifyListeners(t,r){this.localCache[t]=r;const a=this.listeners[t];if(a)for(const o of Array.from(a))o(r&&JSON.parse(r))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,r,a)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:r,newValue:a}),!0)})},K3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,r){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(t,r){await super._set(t,r),this.localCache[t]=JSON.stringify(r)}async _get(t){const r=await super._get(t);return this.localCache[t]=JSON.stringify(r),r}async _remove(t){await super._remove(t),delete this.localCache[t]}}$E.type="LOCAL";const V3=$E;/**
|
|
1138
|
-
* @license
|
|
1139
|
-
* Copyright 2020 Google LLC
|
|
1140
|
-
*
|
|
1141
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1142
|
-
* you may not use this file except in compliance with the License.
|
|
1143
|
-
* You may obtain a copy of the License at
|
|
1144
|
-
*
|
|
1145
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1146
|
-
*
|
|
1147
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1148
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1149
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1150
|
-
* See the License for the specific language governing permissions and
|
|
1151
|
-
* limitations under the License.
|
|
1152
|
-
*/class GE extends FE{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,r){}_removeListener(t,r){}}GE.type="SESSION";const KE=GE;/**
|
|
1153
|
-
* @license
|
|
1154
|
-
* Copyright 2019 Google LLC
|
|
1155
|
-
*
|
|
1156
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1157
|
-
* you may not use this file except in compliance with the License.
|
|
1158
|
-
* You may obtain a copy of the License at
|
|
1159
|
-
*
|
|
1160
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1161
|
-
*
|
|
1162
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1163
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1164
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1165
|
-
* See the License for the specific language governing permissions and
|
|
1166
|
-
* limitations under the License.
|
|
1167
|
-
*/function Y3(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(r){return{fulfilled:!1,reason:r}}}))}/**
|
|
1168
|
-
* @license
|
|
1169
|
-
* Copyright 2019 Google LLC
|
|
1170
|
-
*
|
|
1171
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1172
|
-
* you may not use this file except in compliance with the License.
|
|
1173
|
-
* You may obtain a copy of the License at
|
|
1174
|
-
*
|
|
1175
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1176
|
-
*
|
|
1177
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1178
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1179
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1180
|
-
* See the License for the specific language governing permissions and
|
|
1181
|
-
* limitations under the License.
|
|
1182
|
-
*/class Bu{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const r=this.receivers.find(o=>o.isListeningto(t));if(r)return r;const a=new Bu(t);return this.receivers.push(a),a}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const r=t,{eventId:a,eventType:o,data:c}=r.data,u=this.handlersMap[o];if(!(u!=null&&u.size))return;r.ports[0].postMessage({status:"ack",eventId:a,eventType:o});const d=Array.from(u).map(async m=>m(r.origin,c)),h=await Y3(d);r.ports[0].postMessage({status:"done",eventId:a,eventType:o,response:h})}_subscribe(t,r){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(r)}_unsubscribe(t,r){this.handlersMap[t]&&r&&this.handlersMap[t].delete(r),(!r||this.handlersMap[t].size===0)&&delete this.handlersMap[t],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Bu.receivers=[];/**
|
|
1183
|
-
* @license
|
|
1184
|
-
* Copyright 2020 Google LLC
|
|
1185
|
-
*
|
|
1186
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1187
|
-
* you may not use this file except in compliance with the License.
|
|
1188
|
-
* You may obtain a copy of the License at
|
|
1189
|
-
*
|
|
1190
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1191
|
-
*
|
|
1192
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1193
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1194
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1195
|
-
* See the License for the specific language governing permissions and
|
|
1196
|
-
* limitations under the License.
|
|
1197
|
-
*/function Wp(e="",t=10){let r="";for(let a=0;a<t;a++)r+=Math.floor(Math.random()*10);return e+r}/**
|
|
1198
|
-
* @license
|
|
1199
|
-
* Copyright 2019 Google LLC
|
|
1200
|
-
*
|
|
1201
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1202
|
-
* you may not use this file except in compliance with the License.
|
|
1203
|
-
* You may obtain a copy of the License at
|
|
1204
|
-
*
|
|
1205
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1206
|
-
*
|
|
1207
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1208
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1209
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1210
|
-
* See the License for the specific language governing permissions and
|
|
1211
|
-
* limitations under the License.
|
|
1212
|
-
*/class W3{constructor(t){this.target=t,this.handlers=new Set}removeMessageHandler(t){t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)}async _send(t,r,a=50){const o=typeof MessageChannel<"u"?new MessageChannel:null;if(!o)throw new Error("connection_unavailable");let c,u;return new Promise((d,h)=>{const m=Wp("",20);o.port1.start();const b=setTimeout(()=>{h(new Error("unsupported_event"))},a);u={messageChannel:o,onMessage(y){const v=y;if(v.data.eventId===m)switch(v.data.status){case"ack":clearTimeout(b),c=setTimeout(()=>{h(new Error("timeout"))},3e3);break;case"done":clearTimeout(c),d(v.data.response);break;default:clearTimeout(b),clearTimeout(c),h(new Error("invalid_response"));break}}},this.handlers.add(u),o.port1.addEventListener("message",u.onMessage),this.target.postMessage({eventType:t,eventId:m,data:r},[o.port2])}).finally(()=>{u&&this.removeMessageHandler(u)})}}/**
|
|
1213
|
-
* @license
|
|
1214
|
-
* Copyright 2020 Google LLC
|
|
1215
|
-
*
|
|
1216
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1217
|
-
* you may not use this file except in compliance with the License.
|
|
1218
|
-
* You may obtain a copy of the License at
|
|
1219
|
-
*
|
|
1220
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1221
|
-
*
|
|
1222
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1223
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1224
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1225
|
-
* See the License for the specific language governing permissions and
|
|
1226
|
-
* limitations under the License.
|
|
1227
|
-
*/function Cr(){return window}function X3(e){Cr().location.href=e}/**
|
|
1228
|
-
* @license
|
|
1229
|
-
* Copyright 2020 Google LLC.
|
|
1230
|
-
*
|
|
1231
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1232
|
-
* you may not use this file except in compliance with the License.
|
|
1233
|
-
* You may obtain a copy of the License at
|
|
1234
|
-
*
|
|
1235
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1236
|
-
*
|
|
1237
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1238
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1239
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1240
|
-
* See the License for the specific language governing permissions and
|
|
1241
|
-
* limitations under the License.
|
|
1242
|
-
*/function qE(){return typeof Cr().WorkerGlobalScope<"u"&&typeof Cr().importScripts=="function"}async function Z3(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function J3(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function Q3(){return qE()?self:null}/**
|
|
1243
|
-
* @license
|
|
1244
|
-
* Copyright 2019 Google LLC
|
|
1245
|
-
*
|
|
1246
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1247
|
-
* you may not use this file except in compliance with the License.
|
|
1248
|
-
* You may obtain a copy of the License at
|
|
1249
|
-
*
|
|
1250
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1251
|
-
*
|
|
1252
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1253
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1254
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1255
|
-
* See the License for the specific language governing permissions and
|
|
1256
|
-
* limitations under the License.
|
|
1257
|
-
*/const VE="firebaseLocalStorageDb",e4=1,Cu="firebaseLocalStorage",YE="fbase_key";class Tl{constructor(t){this.request=t}toPromise(){return new Promise((t,r)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{r(this.request.error)})})}}function Uu(e,t){return e.transaction([Cu],t?"readwrite":"readonly").objectStore(Cu)}function t4(){const e=indexedDB.deleteDatabase(VE);return new Tl(e).toPromise()}function op(){const e=indexedDB.open(VE,e4);return new Promise((t,r)=>{e.addEventListener("error",()=>{r(e.error)}),e.addEventListener("upgradeneeded",()=>{const a=e.result;try{a.createObjectStore(Cu,{keyPath:YE})}catch(o){r(o)}}),e.addEventListener("success",async()=>{const a=e.result;a.objectStoreNames.contains(Cu)?t(a):(a.close(),await t4(),t(await op()))})})}async function j1(e,t,r){const a=Uu(e,!0).put({[YE]:t,value:r});return new Tl(a).toPromise()}async function n4(e,t){const r=Uu(e,!1).get(t),a=await new Tl(r).toPromise();return a===void 0?null:a.value}function z1(e,t){const r=Uu(e,!0).delete(t);return new Tl(r).toPromise()}const r4=800,i4=3;class WE{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await op(),this.db)}async _withRetries(t){let r=0;for(;;)try{const a=await this._openDb();return await t(a)}catch(a){if(r++>i4)throw a;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return qE()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Bu._getInstance(Q3()),this.receiver._subscribe("keyChanged",async(t,r)=>({keyProcessed:(await this._poll()).includes(r.key)})),this.receiver._subscribe("ping",async(t,r)=>["keyChanged"])}async initializeSender(){var r,a;if(this.activeServiceWorker=await Z3(),!this.activeServiceWorker)return;this.sender=new W3(this.activeServiceWorker);const t=await this.sender._send("ping",{},800);t&&(r=t[0])!=null&&r.fulfilled&&(a=t[0])!=null&&a.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(!(!this.sender||!this.activeServiceWorker||J3()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await op();return await j1(t,Nu,"1"),await z1(t,Nu),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,r){return this._withPendingWrite(async()=>(await this._withRetries(a=>j1(a,t,r)),this.localCache[t]=r,this.notifyServiceWorker(t)))}async _get(t){const r=await this._withRetries(a=>n4(a,t));return this.localCache[t]=r,r}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(r=>z1(r,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(o=>{const c=Uu(o,!1).getAll();return new Tl(c).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const r=[],a=new Set;if(t.length!==0)for(const{fbase_key:o,value:c}of t)a.add(o),JSON.stringify(this.localCache[o])!==JSON.stringify(c)&&(this.notifyListeners(o,c),r.push(o));for(const o of Object.keys(this.localCache))this.localCache[o]&&!a.has(o)&&(this.notifyListeners(o,null),r.push(o));return r}notifyListeners(t,r){this.localCache[t]=r;const a=this.listeners[t];if(a)for(const o of Array.from(a))o(r)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),r4)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,r){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}WE.type="LOCAL";const a4=WE;new wl(3e4,6e4);/**
|
|
1258
|
-
* @license
|
|
1259
|
-
* Copyright 2021 Google LLC
|
|
1260
|
-
*
|
|
1261
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1262
|
-
* you may not use this file except in compliance with the License.
|
|
1263
|
-
* You may obtain a copy of the License at
|
|
1264
|
-
*
|
|
1265
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1266
|
-
*
|
|
1267
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1268
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1269
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1270
|
-
* See the License for the specific language governing permissions and
|
|
1271
|
-
* limitations under the License.
|
|
1272
|
-
*/function XE(e,t){return t?ti(t):(ze(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
|
|
1273
|
-
* @license
|
|
1274
|
-
* Copyright 2019 Google LLC
|
|
1275
|
-
*
|
|
1276
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1277
|
-
* you may not use this file except in compliance with the License.
|
|
1278
|
-
* You may obtain a copy of the License at
|
|
1279
|
-
*
|
|
1280
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1281
|
-
*
|
|
1282
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1283
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1284
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1285
|
-
* See the License for the specific language governing permissions and
|
|
1286
|
-
* limitations under the License.
|
|
1287
|
-
*/class Xp extends PE{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return Os(t,this._buildIdpRequest())}_linkToIdToken(t,r){return Os(t,this._buildIdpRequest(r))}_getReauthenticationResolver(t){return Os(t,this._buildIdpRequest())}_buildIdpRequest(t){const r={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(r.idToken=t),r}}function s4(e){return H3(e.auth,new Xp(e),e.bypassAuthState)}function o4(e){const{auth:t,user:r}=e;return ze(r,t,"internal-error"),P3(r,new Xp(e),e.bypassAuthState)}async function l4(e){const{auth:t,user:r}=e;return ze(r,t,"internal-error"),U3(r,new Xp(e),e.bypassAuthState)}/**
|
|
1288
|
-
* @license
|
|
1289
|
-
* Copyright 2020 Google LLC
|
|
1290
|
-
*
|
|
1291
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1292
|
-
* you may not use this file except in compliance with the License.
|
|
1293
|
-
* You may obtain a copy of the License at
|
|
1294
|
-
*
|
|
1295
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1296
|
-
*
|
|
1297
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1298
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1299
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1300
|
-
* See the License for the specific language governing permissions and
|
|
1301
|
-
* limitations under the License.
|
|
1302
|
-
*/class ZE{constructor(t,r,a,o,c=!1){this.auth=t,this.resolver=a,this.user=o,this.bypassAuthState=c,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(r)?r:[r]}execute(){return new Promise(async(t,r)=>{this.pendingPromise={resolve:t,reject:r};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(a){this.reject(a)}})}async onAuthEvent(t){const{urlResponse:r,sessionId:a,postBody:o,tenantId:c,error:u,type:d}=t;if(u){this.reject(u);return}const h={auth:this.auth,requestUri:r,sessionId:a,tenantId:c||void 0,postBody:o||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(d)(h))}catch(m){this.reject(m)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return s4;case"linkViaPopup":case"linkViaRedirect":return l4;case"reauthViaPopup":case"reauthViaRedirect":return o4;default:Ar(this.auth,"internal-error")}}resolve(t){ii(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){ii(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
|
|
1303
|
-
* @license
|
|
1304
|
-
* Copyright 2020 Google LLC
|
|
1305
|
-
*
|
|
1306
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1307
|
-
* you may not use this file except in compliance with the License.
|
|
1308
|
-
* You may obtain a copy of the License at
|
|
1309
|
-
*
|
|
1310
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1311
|
-
*
|
|
1312
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1313
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1314
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1315
|
-
* See the License for the specific language governing permissions and
|
|
1316
|
-
* limitations under the License.
|
|
1317
|
-
*/const c4=new wl(2e3,1e4);async function JE(e,t,r){if(Nr(e.app))return Promise.reject(pr(e,"operation-not-supported-in-this-environment"));const a=zu(e);a3(e,t,Yp);const o=XE(a,r);return new ba(a,"signInViaPopup",t,o).executeNotNull()}class ba extends ZE{constructor(t,r,a,o,c){super(t,r,o,c),this.provider=a,this.authWindow=null,this.pollId=null,ba.currentPopupAction&&ba.currentPopupAction.cancel(),ba.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return ze(t,this.auth,"internal-error"),t}async onExecution(){ii(this.filter.length===1,"Popup operations only handle one event");const t=Wp();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(r=>{this.reject(r)}),this.resolver._isIframeWebStorageSupported(this.auth,r=>{r||this.reject(pr(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(pr(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,ba.currentPopupAction=null}pollUserCancellation(){const t=()=>{var r,a;if((a=(r=this.authWindow)==null?void 0:r.window)!=null&&a.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(pr(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,c4.get())};t()}}ba.currentPopupAction=null;/**
|
|
1318
|
-
* @license
|
|
1319
|
-
* Copyright 2020 Google LLC
|
|
1320
|
-
*
|
|
1321
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1322
|
-
* you may not use this file except in compliance with the License.
|
|
1323
|
-
* You may obtain a copy of the License at
|
|
1324
|
-
*
|
|
1325
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1326
|
-
*
|
|
1327
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1328
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1329
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1330
|
-
* See the License for the specific language governing permissions and
|
|
1331
|
-
* limitations under the License.
|
|
1332
|
-
*/const u4="pendingRedirect",uu=new Map;class d4 extends ZE{constructor(t,r,a=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],r,void 0,a),this.eventId=null}async execute(){let t=uu.get(this.auth._key());if(!t){try{const a=await f4(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(a)}catch(r){t=()=>Promise.reject(r)}uu.set(this.auth._key(),t)}return this.bypassAuthState||uu.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if(t.type==="signInViaRedirect")return super.onAuthEvent(t);if(t.type==="unknown"){this.resolve(null);return}if(t.eventId){const r=await this.auth._redirectUserForId(t.eventId);if(r)return this.user=r,super.onAuthEvent(t);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function f4(e,t){const r=m4(t),a=p4(e);if(!await a._isAvailable())return!1;const o=await a._get(r)==="true";return await a._remove(r),o}function h4(e,t){uu.set(e._key(),t)}function p4(e){return ti(e._redirectPersistence)}function m4(e){return cu(u4,e.config.apiKey,e.name)}async function g4(e,t,r=!1){if(Nr(e.app))return Promise.reject(va(e));const a=zu(e),o=XE(a,t),u=await new d4(a,o,r).execute();return u&&!r&&(delete u.user._redirectEventId,await a._persistUserIfCurrent(u.user),await a._setRedirectUser(null,t)),u}/**
|
|
1333
|
-
* @license
|
|
1334
|
-
* Copyright 2020 Google LLC
|
|
1335
|
-
*
|
|
1336
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1337
|
-
* you may not use this file except in compliance with the License.
|
|
1338
|
-
* You may obtain a copy of the License at
|
|
1339
|
-
*
|
|
1340
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1341
|
-
*
|
|
1342
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1343
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1344
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1345
|
-
* See the License for the specific language governing permissions and
|
|
1346
|
-
* limitations under the License.
|
|
1347
|
-
*/const b4=600*1e3;class y4{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let r=!1;return this.consumers.forEach(a=>{this.isEventForConsumer(t,a)&&(r=!0,this.sendToConsumer(t,a),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!v4(t)||(this.hasHandledPotentialRedirect=!0,r||(this.queuedRedirectEvent=t,r=!0)),r}sendToConsumer(t,r){var a;if(t.error&&!QE(t)){const o=((a=t.error.code)==null?void 0:a.split("auth/")[1])||"internal-error";r.onError(pr(this.auth,o))}else r.onAuthEvent(t)}isEventForConsumer(t,r){const a=r.eventId===null||!!t.eventId&&t.eventId===r.eventId;return r.filter.includes(t.type)&&a}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=b4&&this.cachedEventUids.clear(),this.cachedEventUids.has(B1(t))}saveEventToCache(t){this.cachedEventUids.add(B1(t)),this.lastProcessedEventTime=Date.now()}}function B1(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function QE({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function v4(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return QE(e);default:return!1}}/**
|
|
1348
|
-
* @license
|
|
1349
|
-
* Copyright 2020 Google LLC
|
|
1350
|
-
*
|
|
1351
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1352
|
-
* you may not use this file except in compliance with the License.
|
|
1353
|
-
* You may obtain a copy of the License at
|
|
1354
|
-
*
|
|
1355
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1356
|
-
*
|
|
1357
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1358
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1359
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1360
|
-
* See the License for the specific language governing permissions and
|
|
1361
|
-
* limitations under the License.
|
|
1362
|
-
*/async function x4(e,t={}){return Hs(e,"GET","/v1/projects",t)}/**
|
|
1363
|
-
* @license
|
|
1364
|
-
* Copyright 2020 Google LLC
|
|
1365
|
-
*
|
|
1366
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1367
|
-
* you may not use this file except in compliance with the License.
|
|
1368
|
-
* You may obtain a copy of the License at
|
|
1369
|
-
*
|
|
1370
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1371
|
-
*
|
|
1372
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1373
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1374
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1375
|
-
* See the License for the specific language governing permissions and
|
|
1376
|
-
* limitations under the License.
|
|
1377
|
-
*/const E4=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,S4=/^https?/;async function _4(e){if(e.config.emulator)return;const{authorizedDomains:t}=await x4(e);for(const r of t)try{if(w4(r))return}catch{}Ar(e,"unauthorized-domain")}function w4(e){const t=ip(),{protocol:r,hostname:a}=new URL(t);if(e.startsWith("chrome-extension://")){const u=new URL(e);return u.hostname===""&&a===""?r==="chrome-extension:"&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):r==="chrome-extension:"&&u.hostname===a}if(!S4.test(r))return!1;if(E4.test(e))return a===e;const o=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+o+"|"+o+")$","i").test(a)}/**
|
|
1378
|
-
* @license
|
|
1379
|
-
* Copyright 2020 Google LLC.
|
|
1380
|
-
*
|
|
1381
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1382
|
-
* you may not use this file except in compliance with the License.
|
|
1383
|
-
* You may obtain a copy of the License at
|
|
1384
|
-
*
|
|
1385
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1386
|
-
*
|
|
1387
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1388
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1389
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1390
|
-
* See the License for the specific language governing permissions and
|
|
1391
|
-
* limitations under the License.
|
|
1392
|
-
*/const k4=new wl(3e4,6e4);function U1(){const e=Cr().___jsl;if(e!=null&&e.H){for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let r=0;r<e.CP.length;r++)e.CP[r]=null}}function T4(e){return new Promise((t,r)=>{var o,c,u;function a(){U1(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{U1(),r(pr(e,"network-request-failed"))},timeout:k4.get()})}if((c=(o=Cr().gapi)==null?void 0:o.iframes)!=null&&c.Iframe)t(gapi.iframes.getContext());else if((u=Cr().gapi)!=null&&u.load)a();else{const d=M3("iframefcb");return Cr()[d]=()=>{gapi.load?a():r(pr(e,"network-request-failed"))},O3(`${R3()}?onload=${d}`).catch(h=>r(h))}}).catch(t=>{throw du=null,t})}let du=null;function N4(e){return du=du||T4(e),du}/**
|
|
1393
|
-
* @license
|
|
1394
|
-
* Copyright 2020 Google LLC.
|
|
1395
|
-
*
|
|
1396
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1397
|
-
* you may not use this file except in compliance with the License.
|
|
1398
|
-
* You may obtain a copy of the License at
|
|
1399
|
-
*
|
|
1400
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1401
|
-
*
|
|
1402
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1403
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1404
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1405
|
-
* See the License for the specific language governing permissions and
|
|
1406
|
-
* limitations under the License.
|
|
1407
|
-
*/const C4=new wl(5e3,15e3),A4="__/auth/iframe",O4="emulator/auth/iframe",R4={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},M4=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function I4(e){const t=e.config;ze(t.authDomain,e,"auth-domain-config-required");const r=t.emulator?$p(t,O4):`https://${e.config.authDomain}/${A4}`,a={apiKey:t.apiKey,appName:e.name,v:_l},o=M4.get(e.config.apiHost);o&&(a.eid=o);const c=e._getFrameworks();return c.length&&(a.fw=c.join(",")),`${r}?${Sl(a).slice(1)}`}async function D4(e){const t=await N4(e),r=Cr().gapi;return ze(r,e,"internal-error"),t.open({where:document.body,url:I4(e),messageHandlersFilter:r.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:R4,dontclear:!0},a=>new Promise(async(o,c)=>{await a.restyle({setHideOnLeave:!1});const u=pr(e,"network-request-failed"),d=Cr().setTimeout(()=>{c(u)},C4.get());function h(){Cr().clearTimeout(d),o(a)}a.ping(h).then(h,()=>{c(u)})}))}/**
|
|
1408
|
-
* @license
|
|
1409
|
-
* Copyright 2020 Google LLC.
|
|
1410
|
-
*
|
|
1411
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1412
|
-
* you may not use this file except in compliance with the License.
|
|
1413
|
-
* You may obtain a copy of the License at
|
|
1414
|
-
*
|
|
1415
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1416
|
-
*
|
|
1417
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1418
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1419
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1420
|
-
* See the License for the specific language governing permissions and
|
|
1421
|
-
* limitations under the License.
|
|
1422
|
-
*/const L4={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},j4=500,z4=600,B4="_blank",U4="http://localhost";class P1{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function P4(e,t,r,a=j4,o=z4){const c=Math.max((window.screen.availHeight-o)/2,0).toString(),u=Math.max((window.screen.availWidth-a)/2,0).toString();let d="";const h={...L4,width:a.toString(),height:o.toString(),top:c,left:u},m=En().toLowerCase();r&&(d=ME(m)?B4:r),OE(m)&&(t=t||U4,h.scrollbars="yes");const b=Object.entries(h).reduce((v,[x,_])=>`${v}${x}=${_},`,"");if(S3(m)&&d!=="_self")return H4(t||"",d),new P1(null);const y=window.open(t||"",d,b);ze(y,e,"popup-blocked");try{y.focus()}catch{}return new P1(y)}function H4(e,t){const r=document.createElement("a");r.href=e,r.target=t;const a=document.createEvent("MouseEvent");a.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),r.dispatchEvent(a)}/**
|
|
1423
|
-
* @license
|
|
1424
|
-
* Copyright 2021 Google LLC
|
|
1425
|
-
*
|
|
1426
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1427
|
-
* you may not use this file except in compliance with the License.
|
|
1428
|
-
* You may obtain a copy of the License at
|
|
1429
|
-
*
|
|
1430
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1431
|
-
*
|
|
1432
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1433
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1434
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1435
|
-
* See the License for the specific language governing permissions and
|
|
1436
|
-
* limitations under the License.
|
|
1437
|
-
*/const F4="__/auth/handler",$4="emulator/auth/handler",G4=encodeURIComponent("fac");async function H1(e,t,r,a,o,c){ze(e.config.authDomain,e,"auth-domain-config-required"),ze(e.config.apiKey,e,"invalid-api-key");const u={apiKey:e.config.apiKey,appName:e.name,authType:r,redirectUrl:a,v:_l,eventId:o};if(t instanceof Yp){t.setDefaultLanguage(e.languageCode),u.providerId=t.providerId||"",F5(t.getCustomParameters())||(u.customParameters=JSON.stringify(t.getCustomParameters()));for(const[b,y]of Object.entries({}))u[b]=y}if(t instanceof kl){const b=t.getScopes().filter(y=>y!=="");b.length>0&&(u.scopes=b.join(","))}e.tenantId&&(u.tid=e.tenantId);const d=u;for(const b of Object.keys(d))d[b]===void 0&&delete d[b];const h=await e._getAppCheckToken(),m=h?`#${G4}=${encodeURIComponent(h)}`:"";return`${K4(e)}?${Sl(d).slice(1)}${m}`}function K4({config:e}){return e.emulator?$p(e,$4):`https://${e.authDomain}/${F4}`}/**
|
|
1438
|
-
* @license
|
|
1439
|
-
* Copyright 2020 Google LLC
|
|
1440
|
-
*
|
|
1441
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1442
|
-
* you may not use this file except in compliance with the License.
|
|
1443
|
-
* You may obtain a copy of the License at
|
|
1444
|
-
*
|
|
1445
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1446
|
-
*
|
|
1447
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1448
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1449
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1450
|
-
* See the License for the specific language governing permissions and
|
|
1451
|
-
* limitations under the License.
|
|
1452
|
-
*/const Ah="webStorageSupport";class q4{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=KE,this._completeRedirectFn=g4,this._overrideRedirectResult=h4}async _openPopup(t,r,a,o){var u;ii((u=this.eventManagers[t._key()])==null?void 0:u.manager,"_initialize() not called before _openPopup()");const c=await H1(t,r,a,ip(),o);return P4(t,c,Wp())}async _openRedirect(t,r,a,o){await this._originValidation(t);const c=await H1(t,r,a,ip(),o);return X3(c),new Promise(()=>{})}_initialize(t){const r=t._key();if(this.eventManagers[r]){const{manager:o,promise:c}=this.eventManagers[r];return o?Promise.resolve(o):(ii(c,"If manager is not set, promise should be"),c)}const a=this.initAndGetManager(t);return this.eventManagers[r]={promise:a},a.catch(()=>{delete this.eventManagers[r]}),a}async initAndGetManager(t){const r=await D4(t),a=new y4(t);return r.register("authEvent",o=>(ze(o==null?void 0:o.authEvent,t,"invalid-auth-event"),{status:a.onEvent(o.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:a},this.iframes[t._key()]=r,a}_isIframeWebStorageSupported(t,r){this.iframes[t._key()].send(Ah,{type:Ah},o=>{var u;const c=(u=o==null?void 0:o[0])==null?void 0:u[Ah];c!==void 0&&r(!!c),Ar(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const r=t._key();return this.originValidationPromises[r]||(this.originValidationPromises[r]=_4(t)),this.originValidationPromises[r]}get _shouldInitProactively(){return zE()||RE()||qp()}}const V4=q4;var F1="@firebase/auth",$1="1.12.0";/**
|
|
1453
|
-
* @license
|
|
1454
|
-
* Copyright 2020 Google LLC
|
|
1455
|
-
*
|
|
1456
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1457
|
-
* you may not use this file except in compliance with the License.
|
|
1458
|
-
* You may obtain a copy of the License at
|
|
1459
|
-
*
|
|
1460
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1461
|
-
*
|
|
1462
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1463
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1464
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1465
|
-
* See the License for the specific language governing permissions and
|
|
1466
|
-
* limitations under the License.
|
|
1467
|
-
*/class Y4{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var t;return this.assertAuthConfigured(),((t=this.auth.currentUser)==null?void 0:t.uid)||null}async getToken(t){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(t)}:null}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const r=this.auth.onIdTokenChanged(a=>{t((a==null?void 0:a.stsTokenManager.accessToken)||null)});this.internalListeners.set(t,r),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const r=this.internalListeners.get(t);r&&(this.internalListeners.delete(t),r(),this.updateProactiveRefresh())}assertAuthConfigured(){ze(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
|
|
1468
|
-
* @license
|
|
1469
|
-
* Copyright 2020 Google LLC
|
|
1470
|
-
*
|
|
1471
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1472
|
-
* you may not use this file except in compliance with the License.
|
|
1473
|
-
* You may obtain a copy of the License at
|
|
1474
|
-
*
|
|
1475
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1476
|
-
*
|
|
1477
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1478
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1479
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1480
|
-
* See the License for the specific language governing permissions and
|
|
1481
|
-
* limitations under the License.
|
|
1482
|
-
*/function W4(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function X4(e){hl(new js("auth",(t,{options:r})=>{const a=t.getProvider("app").getImmediate(),o=t.getProvider("heartbeat"),c=t.getProvider("app-check-internal"),{apiKey:u,authDomain:d}=a.options;ze(u&&!u.includes(":"),"invalid-api-key",{appName:a.name});const h={apiKey:u,authDomain:d,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:BE(e)},m=new C3(a,o,c,h);return D3(m,r),m},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,r,a)=>{t.getProvider("auth-internal").initialize()})),hl(new js("auth-internal",t=>{const r=zu(t.getProvider("auth").getImmediate());return(a=>new Y4(a))(r)},"PRIVATE").setInstantiationMode("EXPLICIT")),Ns(F1,$1,W4(e)),Ns(F1,$1,"esm2020")}/**
|
|
1483
|
-
* @license
|
|
1484
|
-
* Copyright 2021 Google LLC
|
|
1485
|
-
*
|
|
1486
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1487
|
-
* you may not use this file except in compliance with the License.
|
|
1488
|
-
* You may obtain a copy of the License at
|
|
1489
|
-
*
|
|
1490
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1491
|
-
*
|
|
1492
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1493
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1494
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1495
|
-
* See the License for the specific language governing permissions and
|
|
1496
|
-
* limitations under the License.
|
|
1497
|
-
*/const Z4=300,J4=mE("authIdTokenMaxAge")||Z4;let G1=null;const Q4=e=>async t=>{const r=t&&await t.getIdTokenResult(),a=r&&(new Date().getTime()-Date.parse(r.issuedAtTime))/1e3;if(a&&a>J4)return;const o=r==null?void 0:r.token;G1!==o&&(G1=o,await fetch(e,{method:o?"POST":"DELETE",headers:o?{Authorization:`Bearer ${o}`}:{}}))};function eD(e=GI()){const t=vE(e,"auth");if(t.isInitialized())return t.getImmediate();const r=I3(e,{popupRedirectResolver:V4,persistence:[a4,V3,KE]}),a=mE("authTokenSyncURL");if(a&&typeof isSecureContext=="boolean"&&isSecureContext){const c=new URL(a,location.origin);if(location.origin===c.origin){const u=Q4(c.toString());G3(r,u,()=>u(r.currentUser)),$3(r,d=>u(d))}}const o=T5("auth");return o&&L3(r,`http://${o}`),r}function tD(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}A3({loadJS(e){return new Promise((t,r)=>{const a=document.createElement("script");a.setAttribute("src",e),a.onload=t,a.onerror=o=>{const c=pr("internal-error");c.customData=o,r(c)},a.type="text/javascript",a.charset="UTF-8",tD().appendChild(a)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});X4("Browser");const fu={apiKey:"AIzaSyA8NdosgijoZoOSTHoRY4XA5WH-58OF3Yk",authDomain:"botschat-130ff.firebaseapp.com",projectId:"botschat-130ff"};let K1=null,iu=null;function eS(){return!!(fu.apiKey&&fu.authDomain&&fu.projectId)}function tS(){if(!iu){if(!eS())throw new Error("Firebase is not configured. Set VITE_FIREBASE_* env vars.");K1=xE(fu),iu=eD(K1),mr.isNativePlatform()&&F3(iu,sp).catch(()=>{})}return iu}let q1=!1;function nD(e,t,r){return new Promise((a,o)=>{const c=setTimeout(()=>o(new Error(`${r} timed out after ${t}ms`)),t);e.then(u=>{clearTimeout(c),a(u)},u=>{clearTimeout(c),o(u)})})}async function rD(){if(!mr.isNativePlatform()||q1)return;const{SocialLogin:e}=await Rs(async()=>{const{SocialLogin:a}=await import("./index-E-nzPZl8.js");return{SocialLogin:a}},[]),t="670756745871-ct1k370fk3h5oj3f3gdabqv1nq2b7r54.apps.googleusercontent.com",r="670756745871-1anrnjukhhu0a550j86blm771a2k3jou.apps.googleusercontent.com";console.log("[NativeGoogleSignIn] initialize: iOSClientId =",(t==null?void 0:t.substring(0,20))+"...","webClientId =",(r==null?void 0:r.substring(0,20))+"..."),await nD(e.initialize({google:{iOSClientId:t,iOSServerClientId:r}}),1e4,"SocialLogin.initialize"),q1=!0,console.log("[NativeGoogleSignIn] initialized OK")}async function iD(){var o;console.log("[NativeGoogleSignIn] Step 1: ensureNativeGoogleInit"),await rD(),console.log("[NativeGoogleSignIn] Step 2: calling SocialLogin.login()");const{SocialLogin:e}=await Rs(async()=>{const{SocialLogin:c}=await import("./index-E-nzPZl8.js");return{SocialLogin:c}},[]),t=await e.login({provider:"google",options:{scopes:["email","profile"]}});console.log("[NativeGoogleSignIn] Step 3: SocialLogin.login() returned, responseType =",(o=t==null?void 0:t.result)==null?void 0:o.responseType);const r=t.result;if(r.responseType!=="online")throw new Error(`Google Sign-In returned '${r.responseType}' response; expected 'online'. Full result: ${JSON.stringify(t)}`);const a=r.idToken;if(console.log("[NativeGoogleSignIn] Step 4: idToken present =",!!a,", length =",(a==null?void 0:a.length)??0),!a)throw new Error("Google Sign-In did not return an idToken. Ensure Web Client ID (iOSServerClientId) is correct.");return console.log("[NativeGoogleSignIn] Step 5: Skipping Firebase client, sending Google ID token directly to backend"),{idToken:a,email:r.profile.email??"",displayName:r.profile.name??null,photoURL:r.profile.imageUrl??null,provider:"google"}}async function aD(){if(mr.isNativePlatform())return iD();const e=tS(),t=new Jr;t.addScope("email"),t.addScope("profile");const r=await JE(e,t);return{idToken:await r.user.getIdToken(),email:r.user.email??"",displayName:r.user.displayName,photoURL:r.user.photoURL,provider:"google"}}async function sD(){const e=tS(),t=new Qr;t.addScope("user:email");const r=await JE(e,t);return{idToken:await r.user.getIdToken(),email:r.user.email??"",displayName:r.user.displayName,photoURL:r.user.photoURL,provider:"github"}}function oD(){return p.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 48 48",style:{flexShrink:0},children:[p.jsx("path",{fill:"#EA4335",d:"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"}),p.jsx("path",{fill:"#4285F4",d:"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"}),p.jsx("path",{fill:"#FBBC05",d:"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"}),p.jsx("path",{fill:"#34A853",d:"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"})]})}function lD(){return p.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",style:{flexShrink:0},children:p.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"})})}function cD(){const e=ai(),[t,r]=I.useState(!1),[a,o]=I.useState(""),[c,u]=I.useState(""),[d,h]=I.useState(""),[m,b]=I.useState(""),[y,v]=I.useState(!1),[x,_]=I.useState(null),[S,O]=I.useState(null),k=eS(),D=y||!!x;I.useEffect(()=>{zh.config().then(O).catch(()=>{O({emailEnabled:!0,googleEnabled:k,githubEnabled:k})})},[k]);const w=!1,A=S!==null,L=A&&(k||w),M=V=>{ya(V.token),V.refreshToken&&ll(V.refreshToken),e({type:"SET_USER",user:{id:V.id,email:V.email,displayName:V.displayName}})},$=async V=>{b(""),_(V);const ee=setTimeout(()=>{_(null),b(`${V} sign-in timed out. Please try again.`)},3e4);try{ne.info("Auth",`Starting ${V} sign-in`);const U=V==="google"?aD:sD,{idToken:F}=await U();ne.info("Auth",`Got Firebase ID token from ${V}, verifying with backend`);const Y=await zh.firebase(F);ne.info("Auth",`${V} sign-in success — user ${Y.id} (${Y.email})`),M(Y)}catch(U){if(U instanceof Error&&(U.message.includes("popup-closed-by-user")||U.message.includes("cancelled")))ne.info("Auth",`${V} sign-in cancelled by user`);else{const F=U instanceof Error?U.message:`${V} sign-in failed`;ne.error("Auth",`${V} sign-in failed: ${F}`),b(F)}}finally{clearTimeout(ee),_(null)}};return p.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--bg-secondary)"},children:p.jsxs("div",{className:"w-full max-w-md",children:[p.jsxs("div",{className:"text-center mb-8",children:[p.jsx("img",{src:"/botschat-logo.png",alt:"BotsChat",className:"inline-block w-16 h-16 mb-4"}),p.jsx("h1",{className:"text-3xl font-bold",style:{color:"var(--text-primary)"},children:"BotsChat"}),p.jsx("p",{className:"mt-2",style:{color:"var(--text-secondary)"},children:"Multi-channel AI chat powered by OpenClaw"})]}),p.jsxs("div",{className:"rounded-md p-8",style:{background:"var(--bg-surface)",boxShadow:"var(--shadow-lg)"},children:[p.jsx("h2",{className:"text-h1 mb-6",style:{color:"var(--text-primary)"},children:"Sign in"}),!A&&p.jsx("div",{className:"py-8 text-center",style:{color:"var(--text-muted)"},children:p.jsx("span",{className:"text-body",children:"Loading sign-in options…"})}),A&&!L&&p.jsx("div",{className:"py-4 text-caption",style:{color:"var(--text-secondary)"},children:"Sign-in is not configured. Please contact support."}),A&&k&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"space-y-3",children:[p.jsx("button",{type:"button",onClick:()=>$("google"),disabled:D,className:"w-full flex items-center justify-center gap-3 py-2.5 px-4 font-medium text-body rounded-sm disabled:opacity-50 transition-colors hover:brightness-95",style:{background:"var(--bg-surface)",color:"var(--text-primary)",border:"1px solid var(--border)"},children:x==="google"?p.jsx("span",{children:"Signing in..."}):p.jsxs(p.Fragment,{children:[p.jsx(oD,{}),p.jsx("span",{children:"Continue with Google"})]})}),p.jsx("button",{type:"button",onClick:()=>$("github"),disabled:D,className:"w-full flex items-center justify-center gap-3 py-2.5 px-4 font-medium text-body rounded-sm disabled:opacity-50 transition-colors hover:brightness-95",style:{background:"var(--bg-surface)",color:"var(--text-primary)",border:"1px solid var(--border)"},children:x==="github"?p.jsx("span",{children:"Signing in..."}):p.jsxs(p.Fragment,{children:[p.jsx(lD,{}),p.jsx("span",{children:"Continue with GitHub"})]})})]}),A&&w]}),m&&p.jsx("div",{className:"text-caption px-3 py-2 rounded-sm mt-4",style:{background:"rgba(224,30,90,0.1)",color:"var(--accent-red)"},children:m}),A&&w]})]})})}function uD({text:e}){const[t,r]=I.useState(!1),a=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)}catch{const o=document.createElement("textarea");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o),r(!0),setTimeout(()=>r(!1),2e3)}};return p.jsx("button",{onClick:a,className:"shrink-0 px-2.5 py-1 text-tiny font-medium rounded-sm transition-colors",style:{background:t?"var(--accent-green)":"var(--bg-hover)",color:t?"#fff":"var(--text-secondary)"},children:t?"Copied!":"Copy"})}function au({code:e,multiline:t}){return p.jsxs("div",{className:"flex items-start gap-2 rounded-md px-3 py-2.5",style:{background:"var(--code-bg)",border:"1px solid var(--border)"},children:[p.jsx("pre",{className:"flex-1 text-caption font-mono overflow-x-auto whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:e}),p.jsx(uD,{text:e})]})}function dD({color:e}){return p.jsxs("span",{className:"relative flex h-3 w-3",children:[p.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:e}}),p.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3",style:{backgroundColor:e}})]})}function fD({onSkip:e}){const t=gr(),[r,a]=I.useState(null),[o,c]=I.useState(!0),[u,d]=I.useState(""),[h,m]=I.useState(""),[b,y]=I.useState(!0),[v,x]=I.useState(!1),[_,S]=I.useState(""),[O,k]=I.useState(!1),[D,w]=I.useState(!1),[A,L]=I.useState(typeof window<"u"?window.location.origin:"https://console.botschat.app"),[M,$]=I.useState(!1),[V,ee]=I.useState(),[U,F]=I.useState(!1);I.useEffect(()=>{let B=!1;async function Q(){try{const ae=await bx.cloudUrl();if(B)return;L(ae.cloudUrl),$(ae.isLoopback),ee(ae.hint)}catch(ae){ne.warn("Onboarding",`Failed to fetch cloudUrl, using origin: ${ae}`);const P=window.location.hostname,T=P==="localhost"||P.startsWith("127.");$(T),T&&ee("This URL (localhost) only works on this machine. If your OpenClaw is on a different host, replace with its LAN IP.")}}return Q(),()=>{B=!0}},[]),I.useEffect(()=>{let B=!1;async function Q(){c(!0);try{const{token:ae}=await Ko.create("Default");B||a(ae)}catch(ae){ne.error("Onboarding",`Failed to create pairing token: ${ae}`)}finally{B||c(!1)}}return Q(),()=>{B=!0}},[]);const Y=u.length>=6&&u===h,ue=async()=>{var B;if(Y){if(!((B=t.user)!=null&&B.id)){S("User not loaded yet. Please wait.");return}k(!0),S("");try{await it.setPassword(u,t.user.id,b),x(!0)}catch{S("Failed to derive encryption key. Please try again.")}finally{k(!1)}}},ie=r?`openclaw plugins install @botschat/botschat && \\
|
|
1498
|
-
openclaw config set channels.botschat.cloudUrl ${A} && \\
|
|
1499
|
-
openclaw config set channels.botschat.pairingToken ${r} && \\
|
|
1500
|
-
openclaw config set channels.botschat.e2ePassword "${u}" && \\
|
|
1501
|
-
openclaw config set channels.botschat.enabled true && \\
|
|
1502
|
-
openclaw gateway restart`:"Loading...",K=t.openclawConnected;return p.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",style:{background:"var(--bg-secondary)"},children:p.jsxs("div",{className:"w-full max-w-xl",children:[p.jsxs("div",{className:"text-center mb-8",children:[p.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-xl text-white text-2xl font-bold mb-4",style:{background:"#1264A3"},children:"BC"}),p.jsx("h1",{className:"text-3xl font-bold",style:{color:"var(--text-primary)"},children:"Welcome to BotsChat!"}),p.jsx("p",{className:"mt-2",style:{color:"var(--text-secondary)"},children:"Connect your OpenClaw agent to start chatting."})]}),p.jsx("div",{className:"rounded-md p-8",style:{background:"var(--bg-surface)",boxShadow:"var(--shadow-lg)"},children:K?p.jsxs("div",{className:"text-center py-6",children:[p.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full mb-4",style:{background:"rgba(43, 172, 118, 0.15)"},children:p.jsx("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"var(--accent-green)",strokeWidth:2.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),p.jsx("h2",{className:"text-h1 font-bold mb-2",style:{color:"var(--text-primary)"},children:"OpenClaw Connected!"}),p.jsx("p",{className:"text-body mb-6",style:{color:"var(--text-secondary)"},children:"Your agent is ready. Start chatting now."}),p.jsx("button",{onClick:e,className:"px-6 py-2.5 font-bold text-body text-white rounded-sm transition-colors hover:brightness-110",style:{background:"var(--bg-active)"},children:"Start Chatting"})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex items-center gap-3 rounded-md px-4 py-3 mb-6",style:{background:"rgba(232, 162, 48, 0.1)",border:"1px solid rgba(232, 162, 48, 0.3)"},children:[p.jsx(dD,{color:"var(--accent-yellow)"}),p.jsx("span",{className:"text-caption font-medium",style:{color:"var(--accent-yellow)"},children:"Waiting for OpenClaw connection..."})]}),p.jsxs("div",{className:"mb-6",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 rounded-full text-tiny font-bold text-white",style:{background:v?"var(--accent-green)":"var(--bg-active)"},children:v?p.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):"1"}),p.jsx("h3",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:"Set your E2E encryption password"})]}),v?p.jsx("p",{className:"text-caption ml-8",style:{color:"var(--accent-green)"},children:"E2E encryption is active. Your encryption key has been derived."}):p.jsxs("div",{className:"ml-8",children:[p.jsxs("p",{className:"text-caption mb-3",style:{color:"var(--text-secondary)"},children:["Your messages, prompts, and task results will be ",p.jsx("strong",{children:"encrypted on this device"})," before they leave — the server only stores ciphertext it cannot read."]}),p.jsx("div",{className:"mb-3 rounded-md overflow-hidden",style:{border:"1px solid var(--border)"},children:p.jsx("img",{src:"/architecture.png",alt:"BotsChat E2E Encryption Architecture",className:"w-full",style:{display:"block"}})}),p.jsxs("p",{className:"text-caption mb-4",style:{color:"var(--text-muted)"},children:["Encryption keys are derived locally and never sent to the server."," ",p.jsx("a",{href:"https://botschat.app/#features",target:"_blank",rel:"noopener noreferrer",className:"underline",style:{color:"var(--text-link)"},children:"Learn more"})]}),p.jsxs("div",{className:"space-y-2.5",children:[p.jsxs("div",{className:"relative",children:[p.jsx("input",{type:D?"text":"password",value:u,onChange:B=>d(B.target.value),placeholder:"E2E encryption password (min 6 chars)",className:"w-full px-3 py-2 pr-10 rounded-sm text-caption",style:{background:"var(--code-bg)",border:"1px solid var(--border)",color:"var(--text-primary)",outline:"none"}}),p.jsx("button",{type:"button",onClick:()=>w(!D),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1",style:{color:"var(--text-muted)"},tabIndex:-1,children:D?p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"}),p.jsx("path",{d:"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"}),p.jsx("path",{d:"M14.12 14.12a3 3 0 1 1-4.24-4.24"}),p.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),p.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]}),p.jsxs("div",{className:"relative",children:[p.jsx("input",{type:D?"text":"password",value:h,onChange:B=>m(B.target.value),placeholder:"Confirm password",className:"w-full px-3 py-2 pr-10 rounded-sm text-caption",style:{background:"var(--code-bg)",border:`1px solid ${h&&u!==h?"var(--accent-red, #e53e3e)":"var(--border)"}`,color:"var(--text-primary)",outline:"none"}}),p.jsx("button",{type:"button",onClick:()=>w(!D),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1",style:{color:"var(--text-muted)"},tabIndex:-1,children:D?p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"}),p.jsx("path",{d:"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"}),p.jsx("path",{d:"M14.12 14.12a3 3 0 1 1-4.24-4.24"}),p.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),p.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]}),h&&u!==h&&p.jsx("p",{className:"text-caption",style:{color:"var(--accent-red, #e53e3e)"},children:"Passwords do not match."}),p.jsxs("label",{className:"flex items-center gap-2 text-caption",style:{color:"var(--text-secondary)"},children:[p.jsx("input",{type:"checkbox",checked:b,onChange:B=>y(B.target.checked)}),"Remember on this device"]}),_&&p.jsx("p",{className:"text-caption",style:{color:"var(--accent-red, #e53e3e)"},children:_}),p.jsx("button",{onClick:ue,disabled:!Y||O,className:"w-full py-2 font-bold text-caption text-white rounded-sm transition-colors",style:{background:Y&&!O?"var(--bg-active)":"var(--bg-hover)",cursor:Y&&!O?"pointer":"not-allowed",opacity:Y&&!O?1:.5},children:O?"Deriving key...":"Set E2E Password & Continue"})]})]})]}),p.jsxs("div",{className:"mb-6",style:{opacity:v?1:.4,pointerEvents:v?"auto":"none"},children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 rounded-full text-tiny font-bold text-white",style:{background:"var(--bg-active)"},children:"2"}),p.jsx("h3",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:"Run this command on your OpenClaw machine"})]}),p.jsx("p",{className:"text-caption mb-3 ml-8",style:{color:"var(--text-secondary)"},children:"This installs the BotsChat plugin, configures the connection, and restarts the gateway."}),M&&p.jsxs("div",{className:"flex items-start gap-2 rounded-md px-3 py-2.5 mb-3 ml-8 text-caption",style:{background:"rgba(232, 162, 48, 0.1)",border:"1px solid rgba(232, 162, 48, 0.25)",color:"var(--accent-yellow)"},children:[p.jsx("svg",{className:"w-4 h-4 mt-0.5 shrink-0",viewBox:"0 0 20 20",fill:"currentColor",children:p.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.168 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),p.jsxs("span",{children:[V||"localhost URL may not be reachable from other machines."," ",p.jsx("button",{onClick:()=>F(!0),className:"underline font-medium hover:brightness-110",style:{color:"var(--text-link)"},children:"Change URL"})]})]}),U&&p.jsxs("div",{className:"flex items-center gap-2 mb-3 ml-8",children:[p.jsx("label",{className:"text-caption font-bold shrink-0",style:{color:"var(--text-secondary)"},children:"Cloud URL:"}),p.jsx("input",{type:"text",value:A,onChange:B=>{L(B.target.value.replace(/\/+$/,"")),$(!1)},className:"flex-1 px-2.5 py-1.5 rounded-sm text-caption font-mono",style:{background:"var(--code-bg)",border:"1px solid var(--border)",color:"var(--text-primary)",outline:"none"},placeholder:"http://192.168.x.x:8787",autoFocus:!0}),p.jsx("button",{onClick:()=>F(!1),className:"px-2.5 py-1 text-tiny font-medium rounded-sm",style:{background:"var(--bg-active)",color:"#fff"},children:"Done"})]}),p.jsx("div",{className:"ml-8",children:o?p.jsx("div",{className:"rounded-md px-3 py-2.5 animate-pulse",style:{background:"var(--code-bg)",height:"80px"}}):p.jsx(au,{code:ie,multiline:!0})})]}),p.jsxs("div",{className:"mb-6",style:{opacity:v?1:.4,pointerEvents:v?"auto":"none"},children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 rounded-full text-tiny font-bold text-white",style:{background:"var(--bg-active)"},children:"3"}),p.jsx("h3",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:"Verify connection"})]}),p.jsx("p",{className:"text-caption ml-8",style:{color:"var(--text-secondary)"},children:'Check the gateway logs — you should see "Authenticated with BotsChat cloud":'}),p.jsx("div",{className:"ml-8 mt-2",children:p.jsx(au,{code:"openclaw gateway logs"})})]}),p.jsxs("details",{className:"mb-4",children:[p.jsx("summary",{className:"text-caption font-medium cursor-pointer select-none",style:{color:"var(--text-link)"},children:"Or configure manually"}),p.jsxs("div",{className:"mt-3 space-y-3 ml-1",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"Your Pairing Token"}),r?p.jsx(au,{code:r}):p.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:"Loading..."})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"Cloud URL"}),p.jsx(au,{code:A})]})]})]}),p.jsx("div",{className:"text-center pt-2",children:p.jsx("button",{onClick:e,className:"text-caption hover:underline",style:{color:"var(--text-muted)"},children:"Skip for now"})})]})})]})})}function nS({text:e}){const[t,r]=I.useState(!1),a=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)}catch{const o=document.createElement("textarea");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o),r(!0),setTimeout(()=>r(!1),2e3)}};return p.jsx("button",{onClick:a,className:"shrink-0 px-2.5 py-1 text-tiny font-medium rounded-sm transition-colors",style:{background:t?"var(--accent-green)":"var(--bg-hover)",color:t?"#fff":"var(--text-secondary)"},children:t?"Copied!":"Copy"})}function hD({code:e}){return p.jsxs("div",{className:"flex items-start gap-2 rounded-md px-3 py-2.5",style:{background:"var(--code-bg)",border:"1px solid var(--border)"},children:[p.jsx("pre",{className:"flex-1 text-caption font-mono overflow-x-auto whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:e}),p.jsx(nS,{text:e})]})}function pD(e){const r=Date.now()/1e3-e;return r<60?"Just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:r<604800?`${Math.floor(r/86400)}d ago`:new Date(e*1e3).toLocaleDateString()}function rS(){const e=gr(),[t,r]=I.useState([]),[a,o]=I.useState(!0),[c,u]=I.useState(typeof window<"u"?window.location.origin:"https://console.botschat.app"),[d,h]=I.useState(!1),[m,b]=I.useState(),[y,v]=I.useState(!1),[x,_]=I.useState(!1),[S,O]=I.useState(""),[k,D]=I.useState(!1),[w,A]=I.useState(null);I.useEffect(()=>{let F=!1;return bx.cloudUrl().then(Y=>{F||(u(Y.cloudUrl),h(Y.isLoopback),b(Y.hint))}).catch(Y=>{ne.warn("ConnectionSettings",`Failed to fetch cloudUrl: ${Y}`);const ue=window.location.hostname,ie=ue==="localhost"||ue.startsWith("127.");h(ie),ie&&b("This URL (localhost) only works on this machine. If your OpenClaw is on a different host, replace with its LAN IP.")}),()=>{F=!0}},[]),I.useEffect(()=>{let F=!1;return o(!0),Ko.list().then(({tokens:Y})=>{F||r(Y)}).catch(Y=>{ne.error("ConnectionSettings",`Failed to list tokens: ${Y}`)}).finally(()=>{F||o(!1)}),()=>{F=!0}},[]);const L=I.useCallback(async()=>{D(!0);try{const F=await Ko.create(S.trim()||void 0);A({id:F.id,token:F.token});const{tokens:Y}=await Ko.list();r(Y),O(""),_(!1)}catch(F){ne.error("ConnectionSettings",`Failed to create token: ${F}`)}finally{D(!1)}},[S]),M=I.useCallback(async F=>{try{await Ko.delete(F),r(Y=>Y.filter(ue=>ue.id!==F)),(w==null?void 0:w.id)===F&&A(null)}catch(Y){ne.error("ConnectionSettings",`Failed to revoke token: ${Y}`)}},[w]),$=(w==null?void 0:w.token)??null,V=it.getPassword(),ee=$?`openclaw plugins install @botschat/botschat && \\
|
|
1503
|
-
openclaw config set channels.botschat.cloudUrl ${c} && \\
|
|
1504
|
-
openclaw config set channels.botschat.pairingToken ${$} && \\${V?`
|
|
1505
|
-
openclaw config set channels.botschat.e2ePassword "${V}" && \\`:""}
|
|
1506
|
-
openclaw config set channels.botschat.enabled true && \\
|
|
1507
|
-
openclaw gateway restart`:null,U=e.openclawConnected;return p.jsxs("div",{className:"space-y-5",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"OpenClaw Status"}),p.jsxs("div",{className:"flex items-center gap-3 rounded-md px-4 py-3",style:{background:U?"rgba(43, 172, 118, 0.1)":"rgba(232, 162, 48, 0.1)",border:`1px solid ${U?"rgba(43, 172, 118, 0.3)":"rgba(232, 162, 48, 0.3)"}`},children:[p.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{background:U?"var(--accent-green)":"var(--accent-yellow)"}}),p.jsx("span",{className:"text-caption font-medium",style:{color:U?"var(--accent-green)":"var(--accent-yellow)"},children:U?"Connected to OpenClaw":"Not connected"})]})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Setup Command"}),p.jsx("p",{className:"text-tiny mb-2",style:{color:"var(--text-muted)"},children:"Run this on your OpenClaw machine to install and connect the plugin."}),d&&p.jsxs("div",{className:"flex items-start gap-2 rounded-md px-3 py-2 mb-2 text-tiny",style:{background:"rgba(232, 162, 48, 0.1)",border:"1px solid rgba(232, 162, 48, 0.25)",color:"var(--accent-yellow)"},children:[p.jsx("svg",{className:"w-3.5 h-3.5 mt-0.5 shrink-0",viewBox:"0 0 20 20",fill:"currentColor",children:p.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.168 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),p.jsxs("span",{children:[m||"localhost URL may not be reachable from other machines."," ",p.jsx("button",{onClick:()=>v(!0),className:"underline font-medium hover:brightness-110",style:{color:"var(--text-link)"},children:"Change URL"})]})]}),y&&p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("label",{className:"text-tiny font-bold shrink-0",style:{color:"var(--text-secondary)"},children:"Cloud URL:"}),p.jsx("input",{type:"text",value:c,onChange:F=>{u(F.target.value.replace(/\/+$/,"")),h(!1)},className:"flex-1 px-2.5 py-1 rounded-sm text-tiny font-mono",style:{background:"var(--code-bg)",border:"1px solid var(--border)",color:"var(--text-primary)",outline:"none"},placeholder:"http://192.168.x.x:8787",autoFocus:!0}),p.jsx("button",{onClick:()=>v(!1),className:"px-2.5 py-1 text-tiny font-medium rounded-sm",style:{background:"var(--bg-active)",color:"#fff"},children:"Done"})]}),a?p.jsx("div",{className:"rounded-md px-3 py-2.5 animate-pulse",style:{background:"var(--code-bg)",height:"64px"}}):ee?p.jsx(hD,{code:ee}):p.jsx("div",{className:"rounded-md px-4 py-3 text-caption",style:{background:"var(--code-bg)",border:"1px solid var(--border)",color:"var(--text-muted)"},children:t.length>0?"Create a new pairing token below to generate the setup command. (Token values are only shown once at creation time.)":"No pairing tokens available. Create one below to generate the setup command."}),!y&&p.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[p.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"Cloud URL:"}),p.jsx("code",{className:"text-tiny font-mono",style:{color:"var(--text-secondary)"},children:c}),p.jsx("button",{onClick:()=>v(!0),className:"text-tiny hover:underline",style:{color:"var(--text-link)"},children:"Edit"})]})]}),p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[p.jsx("label",{className:"text-caption font-bold",style:{color:"var(--text-secondary)"},children:"Pairing Tokens"}),p.jsx("button",{onClick:()=>_(!x),className:"text-tiny font-medium hover:underline",style:{color:"var(--text-link)"},children:x?"Cancel":"+ New Token"})]}),x&&p.jsxs("div",{className:"flex items-center gap-2 rounded-md px-3 py-2.5 mb-2",style:{background:"var(--code-bg)",border:"1px solid var(--border)"},children:[p.jsx("input",{type:"text",value:S,onChange:F=>O(F.target.value),placeholder:"Token label (optional)",className:"flex-1 px-2 py-1 rounded-sm text-tiny",style:{background:"var(--bg-surface)",border:"1px solid var(--border)",color:"var(--text-primary)",outline:"none"},onKeyDown:F=>{F.key==="Enter"&&L()},autoFocus:!0}),p.jsx("button",{onClick:L,disabled:k,className:"px-3 py-1 text-tiny font-medium rounded-sm text-white",style:{background:k?"var(--text-muted)":"var(--bg-active)"},children:k?"Creating...":"Create"})]}),w&&p.jsxs("div",{className:"rounded-md px-3 py-2.5 mb-2",style:{background:"rgba(43, 172, 118, 0.08)",border:"1px solid rgba(43, 172, 118, 0.3)"},children:[p.jsxs("div",{className:"flex items-center justify-between mb-1",children:[p.jsx("span",{className:"text-tiny font-bold",style:{color:"var(--accent-green)"},children:"New token created — copy it now (only shown once)"}),p.jsx("button",{onClick:()=>A(null),className:"text-tiny",style:{color:"var(--text-muted)"},children:"Dismiss"})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("code",{className:"flex-1 text-tiny font-mono break-all",style:{color:"var(--text-primary)"},children:w.token}),p.jsx(nS,{text:w.token})]})]}),a?p.jsx("div",{className:"rounded-md px-3 py-4 animate-pulse",style:{background:"var(--code-bg)"}}):t.length===0?p.jsx("p",{className:"text-tiny py-2",style:{color:"var(--text-muted)"},children:"No active pairing tokens. Create one to connect your OpenClaw agent."}):p.jsx("div",{className:"space-y-1",children:t.map(F=>p.jsxs("div",{className:"flex items-center gap-2 rounded-md px-3 py-2",style:{background:"var(--code-bg)",border:"1px solid var(--border)"},children:[p.jsx("code",{className:"text-tiny font-mono shrink-0",style:{color:"var(--text-primary)"},children:F.tokenPreview}),F.label&&p.jsx("span",{className:"text-tiny px-1.5 py-0.5 rounded",style:{background:"var(--bg-hover)",color:"var(--text-secondary)"},children:F.label}),p.jsx("span",{className:"flex-1"}),p.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:F.lastConnectedAt?pD(F.lastConnectedAt):"Never connected"}),p.jsx("button",{onClick:()=>M(F.id),className:"text-tiny font-medium hover:underline shrink-0",style:{color:"var(--accent-red)"},title:"Revoke this token",children:"Revoke"})]},F.id))})]})]})}function iS(){const{user:e}=al.useContext(Ss),[t,r]=I.useState(it.hasKey()),[a,o]=I.useState(""),[c,u]=I.useState(!1),[d,h]=I.useState(!1),[m,b]=I.useState(null),[y,v]=I.useState(!1);I.useEffect(()=>it.subscribe(()=>{r(it.hasKey())}),[]);const x=async()=>{if(!(!a||!e)){h(!0),b(null);try{await it.setPassword(a,e.id,c),o("")}catch{b("Failed to set password. check logs.")}finally{h(!1)}}},_=()=>{it.clear()};return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{children:[p.jsx("h3",{className:"text-h3 font-bold mb-2",style:{color:"var(--text-primary)"},children:"End-to-End Encryption"}),p.jsx("p",{className:"text-body",style:{color:"var(--text-muted)"},children:"Your messages and tasks are encrypted before leaving your device. Only your device (with this password) can decrypt them."})]}),p.jsxs("div",{className:"p-4 rounded-md border",style:{borderColor:"var(--border)",background:t?"rgba(0, 255, 0, 0.05)":"rgba(255, 0, 0, 0.05)"},children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("span",{className:"font-bold flex items-center gap-2",style:{color:t?"var(--success)":"var(--error)"},children:t?p.jsxs(p.Fragment,{children:[p.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),"Active (Unlocked)"]}):p.jsxs(p.Fragment,{children:[p.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"})}),"Inactive (Locked)"]})}),t&&p.jsx("button",{onClick:_,className:"text-caption font-bold hover:underline",style:{color:"var(--accent-red, #e53e3e)"},children:"Lock / Clear Key"})]}),!t&&p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"E2E Password"}),p.jsxs("div",{className:"relative",children:[p.jsx("input",{type:y?"text":"password",value:a,onChange:S=>o(S.target.value),className:"w-full px-3 py-2 pr-10 rounded border",style:{background:"var(--bg-input)",borderColor:"var(--border)",color:"var(--text-primary)"},placeholder:"Enter your encryption password"}),p.jsx("button",{type:"button",onClick:()=>v(!y),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1",style:{color:"var(--text-muted)"},tabIndex:-1,children:y?p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"}),p.jsx("path",{d:"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"}),p.jsx("path",{d:"M14.12 14.12a3 3 0 1 1-4.24-4.24"}),p.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):p.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),p.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("input",{type:"checkbox",id:"remember-e2e",checked:c,onChange:S=>u(S.target.checked)}),p.jsx("label",{htmlFor:"remember-e2e",className:"text-caption",style:{color:"var(--text-secondary)"},children:"Remember on this device"})]}),m&&p.jsx("p",{className:"text-caption text-red-500",children:m}),p.jsx("button",{onClick:x,disabled:!a||d,className:"px-4 py-2 rounded font-bold w-full",style:{background:"var(--bg-active, #6366f1)",color:"#fff",opacity:!a||d?.5:1},children:d?"Deriving Key...":"Unlock / Set Password"})]})]}),p.jsxs("div",{className:"text-caption",style:{color:"var(--text-muted)"},children:[p.jsx("p",{className:"font-bold text-red-400 mb-1",children:"Warning:"}),p.jsxs("ul",{className:"list-disc ml-5 space-y-1",children:[p.jsx("li",{children:"If you lose this password, your encrypted history is lost forever."}),p.jsx("li",{children:"We do not store this password on our servers."}),p.jsx("li",{children:"You must use the same password on all devices to access your history."})]})]})]})}const aS={info:"var(--text-muted)",warn:"var(--accent-yellow)",error:"var(--accent-red)","ws-in":"#6BCB77","ws-out":"#4D96FF",api:"#C77DFF"},sS={info:"INF",warn:"WRN",error:"ERR","ws-in":"WS↓","ws-out":"WS↑",api:"API"};function mD(e){const t=new Date(e);return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+String(t.getMilliseconds()).padStart(3,"0")}const Oh="botschat_debug_panel_height",V1=220,Rh=80,Mh=600;function gD(){const e=I.useSyncExternalStore(xk,yk),[t,r]=I.useState(!1),[a,o]=I.useState("all"),[c,u]=I.useState(new Set),d=I.useRef(null),h=I.useRef(!0),[m,b]=I.useState(()=>{try{const A=localStorage.getItem(Oh);if(A){const L=parseInt(A,10);if(L>=Rh&&L<=Mh)return L}}catch{}return V1}),y=I.useRef(!1),v=I.useRef(0),x=I.useRef(V1),_=I.useCallback(A=>{A.preventDefault(),A.stopPropagation(),y.current=!0,v.current=A.clientY,x.current=m;const L=$=>{if(!y.current)return;const V=v.current-$.clientY,ee=Math.max(Rh,Math.min(Mh,x.current+V));b(ee)},M=()=>{y.current&&(y.current=!1,document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",M),b($=>{try{localStorage.setItem(Oh,String($))}catch{}return $}))};document.addEventListener("mousemove",L),document.addEventListener("mouseup",M)},[m]),S=I.useCallback(A=>{A.stopPropagation();const L=A.touches[0];y.current=!0,v.current=L.clientY,x.current=m;const M=V=>{if(!y.current)return;const ee=V.touches[0],U=v.current-ee.clientY,F=Math.max(Rh,Math.min(Mh,x.current+U));b(F)},$=()=>{y.current&&(y.current=!1,document.removeEventListener("touchmove",M),document.removeEventListener("touchend",$),b(V=>{try{localStorage.setItem(Oh,String(V))}catch{}return V}))};document.addEventListener("touchmove",M,{passive:!1}),document.addEventListener("touchend",$)},[m]);I.useEffect(()=>{t&&h.current&&d.current&&(d.current.scrollTop=d.current.scrollHeight)},[e.length,t]);const O=()=>{if(!d.current)return;const{scrollTop:A,scrollHeight:L,clientHeight:M}=d.current;h.current=L-A-M<40},k=A=>{u(L=>{const M=new Set(L);return M.has(A)?M.delete(A):M.add(A),M})},D=a==="all"?e:e.filter(A=>A.level===a),w=e.length;return p.jsxs("div",{style:{flexShrink:0,fontFamily:"var(--font-mono)",fontSize:12,lineHeight:1.5},children:[t&&p.jsx("div",{onMouseDown:_,onTouchStart:S,className:"resize-handle group",style:{height:6,cursor:"row-resize",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-secondary)",borderTop:"1px solid var(--border)",flexShrink:0},children:p.jsx("div",{className:"resize-handle-line",style:{width:"100%",height:1,background:"var(--border)",transition:"height 150ms, background 150ms"}})}),p.jsxs("div",{onClick:()=>r(!t),style:{display:"flex",alignItems:"center",gap:8,padding:"3px 12px",background:"var(--bg-secondary)",borderTop:t?void 0:"1px solid var(--border)",cursor:"pointer",userSelect:"none"},children:[p.jsx("svg",{width:10,height:10,viewBox:"0 0 10 10",style:{transform:t?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s",flexShrink:0},children:p.jsx("path",{d:"M1 7L5 3l4 4",stroke:"var(--text-muted)",strokeWidth:1.5,fill:"none"})}),p.jsx("span",{style:{color:"var(--text-muted)",fontWeight:600,fontSize:11},children:"Debug Log"}),p.jsxs("span",{style:{color:"var(--text-muted)",fontSize:10},children:["(",w,")"]}),t&&p.jsx("div",{style:{display:"flex",gap:2,marginLeft:8},onClick:A=>A.stopPropagation(),children:["all","ws-in","ws-out","api","info","warn","error"].map(A=>p.jsx("button",{onClick:()=>o(A),style:{padding:"1px 6px",borderRadius:3,border:"none",fontSize:10,fontFamily:"var(--font-mono)",cursor:"pointer",background:a===A?"var(--bg-active)":"var(--bg-hover)",color:a===A?"#fff":A==="all"?"var(--text-muted)":aS[A]},children:A==="all"?"ALL":sS[A]},A))}),t&&p.jsx("button",{onClick:A=>{A.stopPropagation(),vk()},style:{marginLeft:"auto",padding:"1px 8px",borderRadius:3,border:"none",fontSize:10,fontFamily:"var(--font-mono)",cursor:"pointer",background:"var(--bg-hover)",color:"var(--text-muted)"},children:"Clear"})]}),t&&p.jsxs("div",{ref:d,onScroll:O,style:{height:m,overflowY:"auto",overflowX:"hidden",background:"var(--bg-primary)",borderTop:"1px solid var(--border)"},children:[D.length===0&&p.jsx("div",{style:{padding:"16px 12px",color:"var(--text-muted)",textAlign:"center"},children:"No log entries yet."}),D.map(A=>p.jsx(bD,{entry:A,expanded:c.has(A.id),onToggleExpand:()=>k(A.id)},A.id))]})]})}function bD({entry:e,expanded:t,onToggleExpand:r}){const a=aS[e.level],o=sS[e.level];return p.jsxs("div",{style:{padding:"1px 12px",borderBottom:"1px solid var(--border)",wordBreak:"break-all"},onMouseEnter:c=>c.currentTarget.style.background="var(--bg-hover)",onMouseLeave:c=>c.currentTarget.style.background="",children:[p.jsxs("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[p.jsx("span",{style:{color:"var(--text-muted)",flexShrink:0,width:85},children:mD(e.ts)}),p.jsx("span",{style:{color:a,fontWeight:700,flexShrink:0,width:28,textAlign:"center"},children:o}),p.jsxs("span",{style:{color:"var(--text-secondary)",flexShrink:0,minWidth:50},children:["[",e.tag,"]"]}),p.jsx("span",{style:{color:"var(--text-primary)",flex:1},children:e.message}),e.detail&&p.jsx("button",{onClick:r,style:{border:"none",background:"none",cursor:"pointer",color:"var(--text-muted)",fontSize:10,padding:"0 4px",flexShrink:0},children:t?"▼":"▶"})]}),t&&e.detail&&p.jsx("pre",{style:{margin:"2px 0 4px 121px",padding:"4px 8px",background:"var(--code-bg)",borderRadius:3,color:"var(--text-secondary)",fontSize:11,whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:200,overflowY:"auto"},children:e.detail})]})}function oS({onNavigate:e}={}){const t=gr(),r=ai(),[a,o]=I.useState(!1),[c,u]=I.useState(""),d=m=>{t.activeView!=="automations"&&r({type:"SET_ACTIVE_VIEW",view:"automations"}),r({type:"SELECT_CRON_TASK",taskId:m}),e==null||e()},h=async()=>{var b,y;if(!c.trim())return;let m=((b=t.channels.find(v=>v.name==="Default"))==null?void 0:b.id)??((y=t.channels[0])==null?void 0:y.id);if(!m)try{m=(await ir.create({name:"Default"})).id;const{channels:x}=await ir.list();r({type:"SET_CHANNELS",channels:x})}catch(v){ne.error("Cron",`Failed to create default channel: ${v}`);return}try{const v=await Mn.create(m,{name:c.trim(),kind:"background"});ne.info("Cron",`Created automation: ${v.name} (${v.id})`);const{tasks:x}=await Mn.listAll("background");r({type:"SET_CRON_TASKS",cronTasks:x}),r({type:"SELECT_CRON_TASK",taskId:v.id}),o(!1),u(""),e==null||e()}catch(v){ne.error("Cron",`Failed to create automation: ${v}`)}};return p.jsxs("div",{className:"flex flex-col",style:{background:"var(--bg-secondary)"},children:[p.jsxs("div",{className:"w-full flex items-center px-4 py-1.5",children:[p.jsx("button",{className:"flex items-center gap-1 text-tiny uppercase tracking-wider text-[--text-sidebar] hover:text-[--text-sidebar-active] transition-colors",children:"Automations"}),p.jsx("span",{className:"ml-1.5 text-tiny text-[--text-muted]",children:t.cronTasks.length>0&&`${t.cronTasks.length}`}),p.jsx("button",{onClick:()=>o(!a),className:"ml-auto p-0.5 rounded transition-colors text-[--text-sidebar] hover:text-[--text-sidebar-active] hover:bg-[--sidebar-hover]",title:"New automation",children:p.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})})})]}),a&&p.jsxs("div",{className:"px-4 py-2 space-y-2",children:[p.jsx("input",{type:"text",placeholder:"Automation name",value:c,onChange:m=>u(m.target.value),onKeyDown:m=>m.key==="Enter"&&!m.nativeEvent.isComposing&&h(),className:"w-full px-2 py-1.5 text-caption text-[--text-sidebar] rounded-sm focus:outline-none placeholder:text-[--text-muted]",style:{background:"var(--sidebar-hover)",border:"1px solid var(--sidebar-border)"},autoFocus:!0}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("button",{onClick:h,className:"flex-1 px-3 py-1.5 text-caption bg-[--bg-active] text-white rounded-sm font-bold hover:brightness-110",children:"Create"}),p.jsx("button",{onClick:()=>{o(!1),u("")},className:"px-3 py-1.5 text-caption text-[--text-muted] hover:text-[--text-sidebar]",children:"Cancel"})]})]}),p.jsx("div",{className:"flex-1 overflow-y-auto sidebar-scroll",children:t.cronTasks.length===0&&!a?p.jsxs("div",{className:"px-4 py-8 text-center",children:[p.jsx("svg",{className:"w-10 h-10 mx-auto mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,style:{color:"var(--text-muted)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),p.jsx("p",{className:"text-caption text-[--text-muted]",children:"No automations yet."}),p.jsx("p",{className:"text-tiny text-[--text-muted] mt-1",children:"Cron jobs from OpenClaw will appear here automatically."})]}):t.cronTasks.map(m=>{const b=t.selectedCronTaskId===m.id,y=m.enabled;let v="var(--accent-green)";return y||(v="var(--text-muted)"),p.jsxs("button",{onClick:()=>d(m.id),className:"w-full text-left py-2 transition-colors",style:{paddingLeft:b?13:16,paddingRight:16,background:b?"var(--bg-hover)":void 0,borderLeft:b?"3px solid var(--bg-active)":"3px solid transparent",color:b?"var(--text-sidebar-active)":"var(--text-sidebar)"},onMouseEnter:x=>{b||(x.currentTarget.style.background="var(--sidebar-hover)")},onMouseLeave:x=>{b||(x.currentTarget.style.background=b?"var(--bg-hover)":"")},children:[p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[p.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:v}}),p.jsx("span",{className:`text-body truncate ${b?"font-bold":""}`,children:m.name})]}),p.jsxs("div",{className:"flex items-center gap-2 mt-0.5 pl-4",children:[p.jsx("span",{className:"text-tiny truncate",style:{color:"var(--text-muted)"},children:m.schedule??"no schedule"}),!y&&p.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"paused"})]})]},m.id)})})]})}function lp(e){if(!e)return null;const t=e.trim().toLowerCase(),r=t.match(/^every\s+(\d+(?:\.\d+)?)\s*(s|m|h)$/);if(r)return{kind:"every",intervalValue:parseFloat(r[1]),intervalUnit:r[2]};const a=t.match(/^at\s+(\d{1,2}:\d{2})$/);return a?{kind:"at",atTime:a[1].padStart(5,"0")}:null}function yD(e){return e.kind==="every"&&e.intervalValue&&e.intervalUnit?`every ${e.intervalValue}${e.intervalUnit}`:e.kind==="at"&&e.atTime?`at ${e.atTime}`:""}function vD({value:e,onChange:t,onSave:r,onCancel:a,saving:o}){const c=lp(e),[u,d]=I.useState((c==null?void 0:c.kind)??"every"),[h,m]=I.useState((c==null?void 0:c.intervalValue)??1),[b,y]=I.useState((c==null?void 0:c.intervalUnit)??"h"),[v,x]=I.useState((c==null?void 0:c.atTime)??"09:00");I.useEffect(()=>{const A=lp(e);A&&(d(A.kind),A.kind==="every"?(m(A.intervalValue??1),y(A.intervalUnit??"h")):x(A.atTime??"09:00"))},[e]);const _=I.useCallback((A,L,M,$)=>{const V=yD(A==="every"?{kind:"every",intervalValue:L,intervalUnit:M}:{kind:"at",atTime:$});t(V)},[t]),S=A=>{d(A),_(A,h,b,v)},O=A=>{const L=Math.max(1,Math.min(A,999));m(L),_(u,L,b,v)},k=A=>{y(A),_(u,h,A,v)},D=A=>{x(A),_(u,h,b,A)},w=A=>{A.key==="Escape"&&a(),A.key==="Enter"&&(A.preventDefault(),r())};return p.jsxs("div",{className:"flex flex-col gap-2",onKeyDown:w,children:[p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx(Y1,{active:u==="every",onClick:()=>S("every"),label:"Interval",icon:p.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182"})})}),p.jsx(Y1,{active:u==="at",onClick:()=>S("at"),label:"Daily at",icon:p.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})})})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[u==="every"?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-caption flex-shrink-0",style:{color:"var(--text-muted)"},children:"Every"}),p.jsx("input",{type:"number",min:1,max:999,value:h,onChange:A=>O(parseInt(A.target.value,10)||1),className:"text-body px-2 py-1 rounded-sm focus:outline-none w-16 text-center",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)"},autoFocus:!0}),p.jsxs("div",{className:"flex items-center gap-0.5",children:[p.jsx(Ih,{active:b==="m",onClick:()=>k("m"),label:"min"}),p.jsx(Ih,{active:b==="h",onClick:()=>k("h"),label:"hr"}),p.jsx(Ih,{active:b==="s",onClick:()=>k("s"),label:"sec"})]})]}):p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-caption flex-shrink-0",style:{color:"var(--text-muted)"},children:"Daily at"}),p.jsx("input",{type:"time",value:v,onChange:A=>D(A.target.value),className:"text-body px-2 py-1 rounded-sm focus:outline-none",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)"},autoFocus:!0})]}),p.jsxs("div",{className:"flex items-center gap-1 ml-auto flex-shrink-0",children:[p.jsx("button",{onClick:r,disabled:o,className:"px-2 py-1 text-tiny font-bold text-white rounded-sm disabled:opacity-50",style:{background:"var(--bg-active)"},children:o?"...":"Save"}),p.jsx("button",{onClick:a,className:"px-2 py-1 text-tiny rounded-sm",style:{color:"var(--text-muted)"},children:"Cancel"})]})]}),p.jsx("div",{className:"text-tiny",style:{color:"var(--text-muted)"},children:u==="every"?`Runs every ${h} ${b==="h"?"hour":b==="m"?"minute":"second"}${h!==1?"s":""}`:`Runs daily at ${v}`})]})}function xD({schedule:e,onClick:t}){if(!e)return p.jsx("span",{className:"text-body cursor-pointer hover:underline",style:{color:"var(--text-muted)"},onClick:t,title:"Click to set schedule",children:"Not set"});const r=lp(e);return r?p.jsx("button",{className:"flex items-center gap-1.5 cursor-pointer group",onClick:t,title:"Click to edit schedule",children:r.kind==="every"?p.jsxs(p.Fragment,{children:[p.jsx("svg",{className:"w-3.5 h-3.5 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-muted)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182"})}),p.jsxs("span",{className:"text-body group-hover:underline",style:{color:"var(--text-primary)"},children:["Every ",r.intervalValue,r.intervalUnit==="h"?"h":r.intervalUnit==="m"?"m":"s"]})]}):p.jsxs(p.Fragment,{children:[p.jsx("svg",{className:"w-3.5 h-3.5 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-muted)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),p.jsxs("span",{className:"text-body group-hover:underline",style:{color:"var(--text-primary)"},children:["Daily at ",r.atTime]})]})}):p.jsx("span",{className:"text-body cursor-pointer hover:underline",style:{color:"var(--text-primary)"},onClick:t,title:"Click to edit schedule",children:e})}function Y1({active:e,onClick:t,label:r,icon:a}){return p.jsxs("button",{onClick:t,className:"flex items-center gap-1.5 px-2.5 py-1 text-caption rounded-sm transition-colors",style:{background:e?"rgba(29,155,209,0.15)":"transparent",color:e?"var(--text-link)":"var(--text-muted)",border:e?"1px solid rgba(29,155,209,0.3)":"1px solid transparent"},children:[a,r]})}function Ih({active:e,onClick:t,label:r}){return p.jsx("button",{onClick:t,className:"px-2 py-1 text-caption rounded-sm transition-colors",style:{background:e?"var(--bg-active)":"var(--bg-hover)",color:e?"#fff":"var(--text-secondary)",border:e?"1px solid var(--bg-active)":"1px solid var(--border)"},children:r})}function il({direction:e="horizontal",className:t=""}){const r=e==="vertical";return p.jsx(px,{className:`resize-handle group relative flex items-center justify-center ${r?"h-[6px] cursor-row-resize":"w-[6px] cursor-col-resize"} ${t}`,style:{flexShrink:0,flexGrow:0},children:p.jsx("div",{className:`resize-handle-line transition-all duration-150 ${r?"w-full h-px group-hover:h-[3px]":"h-full w-px group-hover:w-[3px]"}`,style:{background:"var(--border)"}})})}function W1(e){return new Date(e*1e3).toLocaleString()}function lS(e){switch(e){case"ok":return"OK";case"error":return"ERR";case"skipped":return"SKIP";case"running":return"RUN";default:return e.toUpperCase()}}function cS(e){switch(e){case"ok":return{bg:"rgba(43,172,118,0.15)",fg:"var(--accent-green)"};case"error":return{bg:"rgba(224,30,90,0.15)",fg:"var(--accent-red)"};case"running":return{bg:"rgba(29,155,209,0.15)",fg:"var(--text-link)"};default:return{bg:"rgba(232,162,48,0.15)",fg:"var(--accent-yellow)"}}}function uS(){const e=gr(),t=ai(),r=Bp(),a=e.cronTasks.find(K=>K.id===e.selectedCronTaskId),[o,c]=I.useState(null),[u,d]=I.useState(""),[h,m]=I.useState(!1),[b,y]=I.useState(!1),[v,x]=I.useState(!1),[_,S]=I.useState(!1),[O,k]=I.useState(!0),D=I.useRef(null);I.useEffect(()=>{c(null),y(!1)},[e.selectedCronTaskId]),I.useEffect(()=>{o&&D.current&&D.current.focus()},[o]);const w=I.useCallback(()=>{a&&(ne.info("Cron",`Loading jobs for task: ${a.name} (${a.id})`),Bh.listByTask(a.id).then(({jobs:K})=>{ne.info("Cron",`Loaded ${K.length} jobs for task ${a.name}`);const B=A.current,Q=new Map;for(const P of B)P.summary&&Q.set(P.id,P.summary);const ae=K.map(P=>{var R;const T=Q.get(P.id);return T&&T.length>(((R=P.summary)==null?void 0:R.length)||0)?{...P,summary:T}:P});t({type:"SET_CRON_JOBS",cronJobs:ae}),K.length>0&&!e.selectedCronJobId&&t({type:"SELECT_CRON_JOB",jobId:K[0].id,sessionKey:K[0].sessionKey})}).catch(K=>{ne.error("Cron",`Failed to load jobs: ${K}`)}))},[a==null?void 0:a.id]);I.useEffect(()=>{w()},[w]);const A=I.useRef(e.cronJobs);I.useEffect(()=>{A.current=e.cronJobs},[e.cronJobs]),I.useEffect(()=>{if(!e.cronJobs.some(ae=>ae.status==="running")||!a)return;const B=a.id,Q=setInterval(()=>{ne.info("Cron","Auto-refreshing jobs (running job detected)"),Bh.listByTask(B).then(({jobs:ae})=>{const P=A.current,T=new Map;for(const q of P)q.summary&&T.set(q.id,q.summary);const R=ae.map(q=>{var de;const C=T.get(q.id);return C&&C.length>(((de=q.summary)==null?void 0:de.length)||0)?{...q,summary:C}:q});t({type:"SET_CRON_JOBS",cronJobs:R})}).catch(()=>{})},3e3);return()=>clearInterval(Q)},[e.cronJobs,a==null?void 0:a.id]);const L=I.useCallback(async()=>{if(!a)return;const K=!a.enabled;ne.info("Cron",`Toggle task "${a.name}": ${a.enabled?"enabled → disabled":"disabled → enabled"}`),t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:{enabled:K}});try{await Mn.update(a.channelId,a.id,{schedule:a.schedule??"",instructions:a.instructions??"",enabled:K,model:a.model??""})}catch(B){ne.error("Cron",`Failed to toggle task: ${B}`),t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:{enabled:a.enabled}})}},[a]),M=I.useCallback(K=>{const B=e.cronJobs.find(Q=>Q.id===K);B&&(ne.info("Cron",`Selected job #${B.number||K} (status=${B.status})`),t({type:"SELECT_CRON_JOB",jobId:B.id,sessionKey:B.sessionKey||void 0}))},[e.cronJobs]),$=K=>{if(!a)return;const B=K==="name"?a.name:K==="schedule"?a.schedule??"":a.instructions??"";d(B),c(K)},V=I.useCallback(async K=>{if(!a)return;ne.info("Cron",`Change model for "${a.name}": → ${K||"default"}`);const B=a.model;t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:{model:K||null}});try{await Mn.update(a.channelId,a.id,{schedule:a.schedule??"",instructions:a.instructions??"",enabled:a.enabled,model:K})}catch(Q){ne.error("Cron",`Failed to update task model: ${Q}`),t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:{model:B}})}},[a]),ee=I.useCallback(async()=>{if(!(!a||_)){ne.info("Cron",`Triggering immediate run for "${a.name}"`),S(!0);try{await Mn.run(a.channelId,a.id),ne.info("Cron",`Task "${a.name}" triggered successfully`),setTimeout(()=>{w()},1500)}catch(K){ne.error("Cron",`Failed to trigger task: ${K}`)}finally{S(!1)}}},[a,_,w]),U=()=>{c(null),d("")},F=async()=>{if(!(!a||!o)){ne.info("Cron",`Save edit "${o}" for "${a.name}": ${u.length>80?u.slice(0,80)+"…":u}`),m(!0);try{if(o==="name")t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:{name:u}}),await Mn.update(a.channelId,a.id,{name:u});else{const K={[o]:u};t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:K}),await Mn.update(a.channelId,a.id,{schedule:o==="schedule"?u:a.schedule??"",instructions:o==="instructions"?u:a.instructions??"",enabled:a.enabled,model:a.model??""})}c(null)}catch(K){ne.error("Cron",`Failed to update task field "${o}": ${K}`)}finally{m(!1)}}},Y=async()=>{if(a){ne.info("Cron",`Deleting task: "${a.name}" (${a.id})`),x(!0);try{await Mn.delete(a.channelId,a.id),ne.info("Cron",`Task deleted: "${a.name}"`);const{tasks:K}=await Mn.listAll("background");t({type:"SET_CRON_TASKS",cronTasks:K}),t({type:"SELECT_CRON_TASK",taskId:K.length>0?K[0].id:null}),y(!1)}catch(K){ne.error("Cron",`Failed to delete task: ${K}`)}finally{x(!1)}}},ue=K=>{K.key==="Escape"&&U(),K.key==="Enter"&&!K.shiftKey&&o!=="instructions"&&(K.preventDefault(),F())};if(!a)return p.jsx("div",{className:"flex-1 h-full flex items-center justify-center",style:{background:"var(--bg-surface)"},children:p.jsxs("div",{className:"text-center",children:[p.jsx("svg",{className:"w-16 h-16 mx-auto mb-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,style:{color:"var(--text-muted)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),p.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-muted)"},children:"Select an automation"}),p.jsx("p",{className:"text-caption mt-1",style:{color:"var(--text-muted)"},children:"Choose a cron job from the sidebar to view details"})]})});const ie=e.channels.find(K=>K.id===a.channelId);return p.jsxs("div",{className:"flex-1 h-full flex flex-col min-w-0",style:{background:"var(--bg-surface)"},children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 px-4 sm:px-5 py-2 sm:py-3 flex-shrink-0",style:{borderBottom:"1px solid var(--border)"},children:[p.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0 flex-1",children:[p.jsx("svg",{className:"w-5 h-5 flex-shrink-0 hidden sm:block",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-secondary)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),o==="name"?p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[p.jsx("input",{ref:D,value:u,onChange:K=>d(K.target.value),onKeyDown:ue,className:"text-h2 font-bold px-2 py-0.5 rounded-sm focus:outline-none min-w-0 w-full",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)",maxWidth:280}}),p.jsx(dS,{saving:h,onSave:F,onCancel:U})]}):p.jsx("h2",{className:"text-h2 font-bold truncate cursor-pointer hover:underline",style:{color:"var(--text-primary)"},onClick:()=>$("name"),title:"Click to edit name",children:a.name}),!a.enabled&&p.jsx("span",{className:"text-tiny px-2 py-0.5 rounded-sm font-bold flex-shrink-0",style:{background:"rgba(232,162,48,0.15)",color:"var(--accent-yellow)"},children:"PAUSED"})]}),p.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 flex-shrink-0",children:[p.jsxs("button",{onClick:ee,disabled:_,className:"flex items-center gap-1 sm:gap-1.5 px-2 sm:px-3 py-1 sm:py-1.5 text-caption rounded-sm transition-colors disabled:opacity-50",style:{background:"rgba(29,155,209,0.15)",color:"var(--text-link)"},title:"Run task now (one-time)",children:[p.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{d:"M8 5v14l11-7z"})}),p.jsx("span",{className:"hidden sm:inline",children:_?"Running...":"Run Now"})]}),p.jsx("button",{onClick:()=>y(!0),className:"p-1 sm:p-1.5 rounded-sm transition-colors hover:bg-[--bg-hover]",style:{color:"var(--text-muted)"},title:"Delete task",children:p.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"})})}),p.jsxs("button",{onClick:L,className:"flex items-center gap-1.5 sm:gap-2 px-2 sm:px-3 py-1 sm:py-1.5 text-caption rounded-sm transition-colors",style:{background:a.enabled?"rgba(43,172,118,0.15)":"rgba(107,111,118,0.15)",color:a.enabled?"var(--accent-green)":"var(--text-muted)"},children:[p.jsx("div",{className:"w-7 h-4 rounded-full relative transition-colors flex-shrink-0",style:{background:a.enabled?"var(--accent-green)":"var(--text-muted)"},children:p.jsx("div",{className:"w-3 h-3 rounded-full bg-white absolute top-0.5 transition-all",style:{left:a.enabled?14:2}})}),p.jsx("span",{className:"hidden sm:inline",children:a.enabled?"Enabled":"Disabled"})]})]})]}),b&&p.jsxs("div",{className:"px-4 sm:px-5 py-2 sm:py-3 flex flex-wrap items-center justify-between gap-2",style:{background:"rgba(224,30,90,0.08)",borderBottom:"1px solid var(--border)"},children:[p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[p.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,style:{color:"var(--accent-red)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})}),p.jsxs("span",{className:"text-caption",style:{color:"var(--accent-red)"},children:['Delete "',a.name,'"?']})]}),p.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[p.jsx("button",{onClick:Y,disabled:v,className:"px-3 py-1.5 text-caption font-bold text-white rounded-sm disabled:opacity-50",style:{background:"var(--accent-red)"},children:v?"Deleting...":"Delete"}),p.jsx("button",{onClick:()=>y(!1),className:"px-3 py-1.5 text-caption rounded-sm",style:{color:"var(--text-muted)"},children:"Cancel"})]})]}),p.jsx(ED,{task:a,channel:ie,state:e,isMobile:r,infoExpanded:O,setInfoExpanded:k,editingField:o,editValue:u,setEditValue:d,editRef:D,handleKeyDown:ue,saving:h,saveEdit:F,cancelEdit:U,startEdit:$,handleModelSelectChange:V,handleSelectJob:M})]})}function ED({task:e,channel:t,state:r,isMobile:a,infoExpanded:o,setInfoExpanded:c,editingField:u,editValue:d,setEditValue:h,editRef:m,handleKeyDown:b,saving:y,saveEdit:v,cancelEdit:x,startEdit:_,handleModelSelectChange:S,handleSelectJob:O}){const k=hu({id:"botschat-cron-detail-v"}),[D,w]=I.useState(40),A=I.useRef(null),L=I.useRef({startY:0,startPct:40}),M=I.useCallback(ee=>{ee.preventDefault(),L.current.startY=ee.touches[0].clientY,L.current.startPct=D;const U=Y=>{if(Y.preventDefault(),!A.current)return;const ue=A.current.getBoundingClientRect().height,ie=(Y.touches[0].clientY-L.current.startY)/ue*100;w(Math.max(10,Math.min(70,L.current.startPct+ie)))},F=()=>{document.removeEventListener("touchmove",U),document.removeEventListener("touchend",F)};document.addEventListener("touchmove",U,{passive:!1}),document.addEventListener("touchend",F)},[D]),$=I.useCallback(ee=>{ee.preventDefault(),L.current.startY=ee.clientY,L.current.startPct=D;const U=Y=>{if(!A.current)return;const ue=A.current.getBoundingClientRect().height,ie=(Y.clientY-L.current.startY)/ue*100;w(Math.max(10,Math.min(70,L.current.startPct+ie)))},F=()=>{document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",F)};document.addEventListener("mousemove",U),document.addEventListener("mouseup",F)},[D]),V=p.jsxs("div",{className:"h-full flex flex-col",children:[p.jsxs("button",{className:"w-full flex items-center gap-2 px-4 sm:px-5 py-2 text-tiny uppercase tracking-wider hover:bg-[--bg-hover] transition-colors flex-shrink-0",style:{color:"var(--text-muted)"},onClick:()=>c(!o),children:[p.jsx("svg",{className:`w-3 h-3 transition-transform ${o?"rotate-0":"-rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})}),"Task Details"]}),o&&p.jsxs("div",{className:"flex-1 overflow-y-auto px-4 sm:px-5 pb-4 space-y-4",children:[u==="schedule"?p.jsx("div",{children:p.jsx(zi,{label:"Schedule",children:p.jsx(vD,{value:d,onChange:h,onSave:v,onCancel:x,saving:y})})}):p.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 sm:gap-4",children:[p.jsx(zi,{label:"Schedule",children:p.jsx(xD,{schedule:e.schedule,onClick:()=>_("schedule")})}),p.jsx(zi,{label:"Model",children:p.jsx(Au,{value:e.model??"",onChange:S,models:r.models,placeholder:"Default"})}),p.jsx(zi,{label:"Channel",children:p.jsx("span",{className:"text-body",style:{color:"var(--text-primary)"},children:(t==null?void 0:t.name)??"Default"})}),p.jsx(zi,{label:"Status",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:e.enabled?"var(--accent-green)":"var(--accent-yellow)"}}),p.jsx("span",{className:"text-body",style:{color:"var(--text-primary)"},children:e.enabled?"Active":"Paused"})]})})]}),p.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[p.jsx(zi,{label:"Cron Job ID",children:p.jsx("span",{className:"text-caption font-mono",style:{color:"var(--text-secondary)"},children:e.openclawCronJobId??"N/A"})}),p.jsx(zi,{label:"Created",children:p.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:e.createdAt?W1(e.createdAt):"N/A"})}),p.jsx(zi,{label:"Updated",children:p.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:e.updatedAt?W1(e.updatedAt):"N/A"})})]}),p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center justify-between mb-1",children:[p.jsx("span",{className:"text-tiny uppercase tracking-wider",style:{color:"var(--text-muted)"},children:"Prompt / Instructions"}),u!=="instructions"&&p.jsx("button",{onClick:()=>_("instructions"),className:"text-tiny px-2 py-0.5 rounded-sm transition-colors hover:bg-[--bg-hover]",style:{color:"var(--text-link)"},children:"Edit"})]}),u==="instructions"?p.jsxs("div",{children:[p.jsx("textarea",{ref:m,value:d,onChange:ee=>h(ee.target.value),onKeyDown:ee=>{ee.key==="Escape"&&x(),ee.key==="Enter"&&(ee.metaKey||ee.ctrlKey)&&(ee.preventDefault(),v())},placeholder:"Enter the prompt or instructions for this cron task...",rows:6,className:"w-full text-caption p-3 rounded-md resize-y focus:outline-none",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)",minHeight:80,maxHeight:300}}),p.jsxs("div",{className:"flex items-center justify-between mt-2",children:[p.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"Cmd/Ctrl+Enter to save, Esc to cancel"}),p.jsx(dS,{saving:y,onSave:v,onCancel:x})]})]}):p.jsx("div",{className:"text-caption p-3 rounded-md whitespace-pre-wrap cursor-pointer hover:border-[--text-muted] transition-colors",style:{background:"var(--bg-hover)",color:e.instructions?"var(--text-primary)":"var(--text-muted)",border:"1px solid transparent",minHeight:48},onClick:()=>_("instructions"),title:"Click to edit",children:e.instructions||"No instructions set. Click to add a prompt for this cron task."})]})]})]});return a?p.jsxs("div",{ref:A,className:"flex-1 min-h-0 flex flex-col",children:[p.jsx("div",{className:"flex-shrink-0 overflow-y-auto",style:{...o?{height:`${D}%`}:{},borderBottom:"1px solid var(--border)"},children:V}),o&&p.jsx("div",{className:"flex-shrink-0 flex items-center justify-center touch-none select-none",style:{height:20,cursor:"row-resize",background:"var(--bg-surface)",borderBottom:"1px solid var(--border)"},onTouchStart:M,onMouseDown:$,children:p.jsx("div",{className:"rounded-full",style:{width:36,height:4,background:"var(--text-muted)",opacity:.4}})}),p.jsx(X1,{cronJobs:r.cronJobs,selectedCronJobId:r.selectedCronJobId,handleSelectJob:O,mobile:!0})]}):p.jsxs(ol,{orientation:"vertical",defaultLayout:k.defaultLayout,onLayoutChanged:k.onLayoutChanged,id:"botschat-cron-detail-v",className:"flex-1 min-h-0",children:[p.jsx(Tr,{id:"cron-info",defaultSize:"40%",minSize:"5%",maxSize:"70%",children:p.jsx("div",{className:"h-full",style:{borderBottom:"1px solid var(--border)"},children:V})}),p.jsx(il,{direction:"vertical"}),p.jsx(Tr,{id:"cron-content-area",children:p.jsx(X1,{cronJobs:r.cronJobs,selectedCronJobId:r.selectedCronJobId,handleSelectJob:O,mobile:!1})})]})}function X1({cronJobs:e,selectedCronJobId:t,handleSelectJob:r,mobile:a}){const o=hu({id:"botschat-cron-content"}),[c,u]=I.useState(!1),d=m=>{r(m),u(!0)},h=p.jsxs("div",{className:"overflow-y-auto h-full",children:[p.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:[p.jsx("span",{className:"text-tiny uppercase tracking-wider font-bold",style:{color:"var(--text-muted)"},children:"Execution History"}),p.jsxs("span",{className:"text-tiny ml-1",style:{color:"var(--text-muted)"},children:["(",e.length,")"]})]}),e.length===0?p.jsxs("div",{className:"px-4 py-6 text-center",children:[p.jsx("p",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"No runs yet."}),p.jsx("p",{className:"text-tiny mt-1",style:{color:"var(--text-muted)"},children:"Waiting for schedule..."})]}):e.map((m,b)=>{const y=cS(m.status),v=m.number||e.length-b,x=t===m.id;return p.jsxs("button",{onClick:()=>a?d(m.id):r(m.id),className:`w-full text-left px-3 py-2 hover:bg-[--bg-hover] transition-colors ${x?"bg-[--bg-hover]":""}`,style:{borderBottom:"1px solid var(--border)",...x?{borderLeft:"3px solid var(--bg-active)"}:{}},children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("span",{className:"text-tiny font-mono",style:{color:"var(--text-muted)"},children:["#",v]}),p.jsxs("span",{className:"text-tiny px-1.5 py-0.5 rounded-sm font-bold flex items-center gap-1",style:{background:y.bg,color:y.fg},children:[m.status==="running"&&p.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),lS(m.status)]})]}),p.jsxs("div",{className:"text-tiny mt-0.5",style:{color:"var(--text-muted)"},children:[m.time,m.durationMs!=null&&p.jsxs("span",{className:"ml-1",children:["(",(m.durationMs/1e3).toFixed(1),"s)"]})]}),m.summary&&p.jsx("div",{className:"text-caption mt-1 truncate",style:{color:"var(--text-secondary)"},children:m.summary})]},m.id)})]});return a?c&&t?p.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[p.jsxs("button",{onClick:()=>u(!1),className:"flex items-center gap-1 px-4 py-2 text-caption flex-shrink-0",style:{borderBottom:"1px solid var(--border)",color:"var(--text-link)"},children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})}),"Back to History"]}),p.jsx("div",{className:"flex-1 min-h-0",children:p.jsx(Z1,{jobs:e,selectedJobId:t})})]}):p.jsx("div",{className:"flex-1 min-h-0",children:h}):p.jsxs(ol,{orientation:"horizontal",defaultLayout:o.defaultLayout,onLayoutChanged:o.onLayoutChanged,id:"botschat-cron-content",className:"flex-1 min-h-0",children:[p.jsx(Tr,{id:"cron-jobs",defaultSize:"20%",minSize:"8%",maxSize:"40%",children:h}),p.jsx(il,{}),p.jsx(Tr,{id:"cron-output",children:p.jsx(Z1,{jobs:e,selectedJobId:t})})]})}const SD=`prose prose-sm max-w-none
|
|
1508
|
-
prose-p:my-1.5 prose-ul:my-1.5 prose-ol:my-1.5
|
|
1509
|
-
prose-pre:my-2 prose-pre:rounded-md prose-pre:text-caption
|
|
1510
|
-
prose-code:before:content-none prose-code:after:content-none
|
|
1511
|
-
prose-code:px-1 prose-code:py-0.5 prose-code:rounded-sm prose-code:text-caption
|
|
1512
|
-
prose-table:my-2 prose-th:px-3 prose-th:py-1.5 prose-td:px-3 prose-td:py-1.5
|
|
1513
|
-
prose-h1:text-lg prose-h2:text-base prose-h3:text-sm
|
|
1514
|
-
prose-li:my-0.5
|
|
1515
|
-
prose-blockquote:border-l-2 prose-blockquote:pl-4 prose-blockquote:my-2
|
|
1516
|
-
prose-hr:my-4`,_D={color:"var(--text-primary)","--tw-prose-headings":"var(--text-primary)","--tw-prose-bold":"var(--text-primary)","--tw-prose-links":"var(--text-link)","--tw-prose-code":"var(--text-primary)","--tw-prose-pre-code":"var(--text-primary)","--tw-prose-pre-bg":"var(--code-bg)","--tw-prose-th-borders":"var(--border)","--tw-prose-td-borders":"var(--border)","--tw-prose-quotes":"var(--text-secondary)","--tw-prose-quote-borders":"var(--border)","--tw-prose-bullets":"var(--text-muted)","--tw-prose-counters":"var(--text-muted)","--tw-prose-hr":"var(--border)"};function wD(e){return e.split(/\n\n---\n\n/).filter(t=>t.trim())}function Z1({jobs:e,selectedJobId:t}){const r=t?e.find(d=>d.id===t):null,a=I.useRef(null);if(I.useEffect(()=>{a.current&&(r==null?void 0:r.status)==="running"&&(a.current.scrollTop=a.current.scrollHeight)},[r==null?void 0:r.summary,r==null?void 0:r.status]),!r)return p.jsx("div",{className:"flex-1 h-full flex items-center justify-center",style:{background:"var(--bg-surface)"},children:p.jsx("p",{className:"text-caption",style:{color:"var(--text-muted)"},children:e.length>0?"Select a run to view output":"No execution history yet"})});const o=cS(r.status),c=r.status==="running",u=r.summary?wD(r.summary):[];return p.jsxs("div",{className:"flex-1 h-full flex flex-col min-w-0",style:{background:"var(--bg-surface)"},children:[p.jsxs("div",{className:"flex items-center gap-3 px-5 py-2.5 flex-shrink-0",style:{borderBottom:"1px solid var(--border)"},children:[p.jsx("span",{className:"text-tiny px-2 py-0.5 rounded-sm font-bold",style:{background:o.bg,color:o.fg},children:lS(r.status)}),c&&p.jsx("span",{className:"inline-block w-2 h-2 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),p.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:r.time}),r.durationMs!=null&&p.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:r.durationMs>=6e4?`${(r.durationMs/6e4).toFixed(1)}m`:`${(r.durationMs/1e3).toFixed(1)}s`})]}),p.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",ref:a,children:u.length>0?p.jsxs("div",{className:"flex flex-col gap-3",children:[u.map((d,h)=>{const m=h===u.length-1,b=c&&m;return p.jsxs("div",{className:"rounded-md px-4 py-3",style:{background:"var(--bg-primary)",border:b?"1px solid var(--text-link)":"1px solid var(--border)"},children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("span",{className:"text-tiny font-bold px-1.5 py-0.5 rounded-sm",style:{background:b?"var(--text-link)":"var(--bg-surface)",color:b?"#fff":"var(--text-muted)"},children:u.length>1?`#${h+1}`:"Output"}),b&&p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),p.jsx("span",{className:"text-tiny",style:{color:"var(--text-link)"},children:"streaming..."})]}),!b&&!c&&u.length>1&&p.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"completed"})]}),p.jsx("div",{className:SD,style:_D,children:p.jsx(u0,{remarkPlugins:[D0],children:d})})]},h)}),c&&p.jsxs("div",{className:"flex items-center gap-1.5 pl-2",children:[p.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),p.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.2s"}}),p.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.4s"}})]})]}):c?p.jsxs("div",{className:"flex items-center gap-1.5 py-2 pl-1",children:[p.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),p.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.2s"}}),p.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.4s"}})]}):p.jsx("div",{className:"flex items-center justify-center h-full",children:p.jsx("p",{className:"text-caption",style:{color:"var(--text-muted)"},children:"No output recorded for this run."})})})]})}function zi({label:e,children:t}){return p.jsxs("div",{className:"min-w-0",children:[p.jsx("div",{className:"text-tiny uppercase tracking-wider mb-1",style:{color:"var(--text-muted)"},children:e}),t]})}function dS({saving:e,onSave:t,onCancel:r}){return p.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[p.jsx("button",{onClick:t,disabled:e,className:"px-2 py-1 text-tiny font-bold text-white rounded-sm disabled:opacity-50",style:{background:"var(--bg-active)"},children:e?"...":"Save"}),p.jsx("button",{onClick:r,className:"px-2 py-1 text-tiny rounded-sm",style:{color:"var(--text-muted)"},children:"Cancel"})]})}function kD({sendMessage:e,theme:t,onToggleTheme:r,showSettings:a,onOpenSettings:o,onCloseSettings:c,handleDefaultModelChange:u,handleSelectJob:d}){var w,A,L,M,$,V,ee,U,F,Y;const h=gr(),m=ai(),[b,y]=I.useState(()=>h.selectedAgentId&&h.selectedSessionKey?"chat":"home"),[v,x]=I.useState(!1);al.useEffect(()=>{h.activeThreadId&&b==="chat"&&y("thread")},[h.activeThreadId,b]),al.useEffect(()=>{!h.activeThreadId&&b==="thread"&&y("chat")},[h.activeThreadId,b]);const _=()=>{var ue;ne.info("Auth",`Mobile logout — user ${(ue=h.user)==null?void 0:ue.email}`),ya(null),ll(null),m({type:"LOGOUT"})},S=((L=(A=(w=h.user)==null?void 0:w.displayName)==null?void 0:A[0])==null?void 0:L.toUpperCase())??((V=($=(M=h.user)==null?void 0:M.email)==null?void 0:$[0])==null?void 0:V.toUpperCase())??"?",O=I.useCallback(()=>{switch(b){case"chat":y("home");break;case"thread":m({type:"CLOSE_THREAD"}),y("chat");break;case"cron-detail":y("home");break}},[b,m]),k=()=>{switch(b){case"home":return"BotsChat";case"chat":{const ue=h.agents.find(ie=>ie.id===h.selectedAgentId);return`# ${(ue==null?void 0:ue.name)??"Chat"}`}case"thread":return"Thread";case"cron-detail":{const ue=h.cronTasks.find(ie=>ie.id===h.selectedCronTaskId);return(ue==null?void 0:ue.name)??"Task Detail"}default:return"BotsChat"}},D=b!=="home";return p.jsxs("div",{className:"flex flex-col",style:{height:"calc(100vh - var(--keyboard-height, 0px))",background:"var(--bg-surface)",transition:"height 0.2s ease-out"},children:[p.jsxs("div",{className:"flex items-center justify-between px-4 flex-shrink-0",style:{minHeight:"calc(44px + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",background:"var(--bg-primary)",borderBottom:"1px solid var(--border)"},children:[p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[D&&p.jsx("button",{onClick:O,className:"p-1 -ml-1 rounded",style:{color:"var(--text-link)"},"aria-label":"Back",children:p.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})})}),p.jsx("span",{className:"text-h2 font-bold truncate",style:{color:"var(--text-primary)"},children:k()})]}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("div",{className:"w-2 h-2 rounded-full mr-1",style:{background:h.openclawConnected?"var(--accent-green)":"var(--accent-red)"}}),p.jsx("button",{onClick:o,className:"p-1.5 rounded",style:{color:"var(--text-muted)"},children:p.jsxs("svg",{className:"w-4.5 h-4.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),p.jsx("button",{onClick:()=>x(!v),className:"w-6 h-6 rounded flex items-center justify-center text-[10px] font-bold text-white",style:{background:"#9B59B6"},title:((ee=h.user)==null?void 0:ee.displayName)??((U=h.user)==null?void 0:U.email)??"User",children:S})]})]}),v&&p.jsx("div",{className:"fixed inset-0 z-50",onClick:()=>x(!1),children:p.jsxs("div",{className:"absolute right-4 rounded-lg py-1 min-w-[200px]",style:{top:"calc(44px + env(safe-area-inset-top, 0px) + 4px)",background:"var(--bg-surface)",border:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},onClick:ue=>ue.stopPropagation(),children:[p.jsxs("div",{className:"px-4 py-2.5",style:{borderBottom:"1px solid var(--border)"},children:[p.jsx("div",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:((F=h.user)==null?void 0:F.displayName)??"User"}),p.jsx("div",{className:"text-caption",style:{color:"var(--text-muted)"},children:(Y=h.user)==null?void 0:Y.email})]}),p.jsxs("button",{className:"w-full text-left px-4 py-2.5 text-body flex items-center gap-2.5",style:{color:"var(--text-primary)"},onClick:()=>{r(),x(!1)},children:[t==="dark"?p.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"})}):p.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"})}),t==="dark"?"Light Mode":"Dark Mode"]}),p.jsxs("button",{className:"w-full text-left px-4 py-2.5 text-body flex items-center gap-2.5",style:{color:"var(--text-primary)"},onClick:()=>{o(),x(!1)},children:[p.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),"Settings"]}),p.jsx("div",{style:{borderTop:"1px solid var(--border)"}}),p.jsxs("button",{className:"w-full text-left px-4 py-2.5 text-body flex items-center gap-2.5",style:{color:"var(--accent-red)"},onClick:()=>{_(),x(!1)},children:[p.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})}),"Logout"]})]})}),p.jsxs("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[b==="home"&&p.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",style:{background:"var(--bg-secondary)"},children:[p.jsx(Cx,{onOpenSettings:o,onNavigate:()=>y("chat")}),p.jsx(oS,{onNavigate:()=>y("cron-detail")})]}),b==="chat"&&p.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:p.jsx(lE,{sendMessage:e})}),b==="thread"&&p.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:p.jsx(cE,{sendMessage:e})}),b==="cron-detail"&&p.jsx("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:p.jsx(uS,{})})]}),a&&p.jsx(TD,{state:h,onClose:c,handleDefaultModelChange:u})]})}function TD({state:e,onClose:t,handleDefaultModelChange:r}){const[a,o]=I.useState("general");return p.jsx("div",{className:"fixed inset-0 flex items-end justify-center z-50",style:{background:"rgba(0,0,0,0.5)"},onClick:t,children:p.jsxs("div",{className:"w-full rounded-t-xl p-5 max-h-[85vh] flex flex-col",style:{background:"var(--bg-surface)",paddingBottom:"calc(20px + env(safe-area-inset-bottom, 0px))"},onClick:c=>c.stopPropagation(),children:[p.jsx("div",{className:"w-10 h-1 rounded-full mx-auto mb-4",style:{background:"var(--text-muted)"}}),p.jsx("h2",{className:"text-h1 font-bold mb-3",style:{color:"var(--text-primary)"},children:"Settings"}),p.jsxs("div",{className:"flex gap-4 mb-4",style:{borderBottom:"1px solid var(--border)"},children:[p.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:a==="general"?"var(--text-primary)":"var(--text-muted)",borderBottom:a==="general"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>o("general"),children:"General"}),p.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:a==="connection"?"var(--text-primary)":"var(--text-muted)",borderBottom:a==="connection"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>o("connection"),children:"Connection"}),p.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:a==="security"?"var(--text-primary)":"var(--text-muted)",borderBottom:a==="security"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>o("security"),children:"Security"})]}),p.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[a==="general"&&p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Default Model"}),p.jsx(Au,{value:e.defaultModel??"",onChange:r,models:e.models,placeholder:"Not set (use agent default)"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Current Session Model"}),p.jsx("span",{className:"text-body font-mono",style:{color:e.sessionModel||e.defaultModel?"var(--text-primary)":"var(--text-muted)"},children:e.sessionModel??e.defaultModel??"Not connected"})]})]}),a==="connection"&&p.jsx(rS,{}),a==="security"&&p.jsx(iS,{})]}),p.jsx("button",{onClick:t,className:"w-full mt-4 py-2.5 text-caption font-bold text-white rounded-md shrink-0",style:{background:"var(--bg-active)"},children:"Done"})]})})}const J1="G-HKJNG1X0JE";function ND(){if(typeof window>"u")return!1;if(window.gtag)return!0;window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",J1);const e=document.createElement("script");return e.async=!0,e.src=`https://www.googletagmanager.com/gtag/js?id=${J1}`,document.head.appendChild(e),!0}let Q1=!1;function CD(){Q1||(Q1=ND())}function AD(e,t){window.gtag&&window.gtag("event",e,t)}function OD(e){AD("page_view",{page_path:`/${e}`,page_title:e})}function RD(){var ae;const[e,t]=I.useReducer(gk,yp,P=>{try{const T=localStorage.getItem("botschat_active_view");if(T==="messages"||T==="automations")return{...P,activeView:T}}catch{}return P}),r=I.useRef(null),a=I.useRef(()=>{}),o=I.useRef(!1),[c,u]=I.useState(!1),[d,h]=I.useState("general"),[m,b]=I.useState(!1),[y,v]=I.useState(it.hasKey());I.useEffect(()=>it.subscribe(()=>v(it.hasKey())),[]);const x=Bp(),_=hu({id:"botschat-main"}),S=hu({id:"botschat-content"}),[O,k]=I.useState(()=>localStorage.getItem("botschat_onboarding_dismissed")==="1"),D=I.useCallback(()=>{k(!0),localStorage.setItem("botschat_onboarding_dismissed","1")},[]),[w,A]=I.useState(()=>{var T;const P=localStorage.getItem("botschat_theme");return P==="light"||P==="dark"?P:(T=window.matchMedia)!=null&&T.call(window,"(prefers-color-scheme: light)").matches?"light":"dark"});I.useEffect(()=>{document.documentElement.setAttribute("data-theme",w),localStorage.setItem("botschat_theme",w);const P=document.querySelector('meta[name="theme-color"]');P&&P.setAttribute("content",w==="dark"?"#1A1D21":"#FFFFFF")},[w]),I.useEffect(()=>{localStorage.setItem("botschat_active_view",e.activeView)},[e.activeView]),I.useEffect(()=>{OD(e.activeView)},[e.activeView]),I.useEffect(()=>{e.selectedCronTaskId&&localStorage.setItem("botschat_last_cron_task",e.selectedCronTaskId)},[e.selectedCronTaskId]),I.useEffect(()=>{if(e.selectedSessionId){const P=e.agents.find(T=>T.id===e.selectedAgentId);P!=null&&P.channelId&&localStorage.setItem(`botschat_last_session_${P.channelId}`,e.selectedSessionId)}},[e.selectedSessionId,e.selectedAgentId,e.agents]);const L=I.useCallback(()=>{A(P=>P==="dark"?"light":"dark")},[]);I.useEffect(()=>{const P=new URLSearchParams(window.location.search),T=P.get("dev_token"),R=P.get("dev_user");if(T){ne.info("Auth","Dev-token login attempt"),fetch("/api/dev-auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({secret:T,...R?{userId:R}:{}})}).then(C=>{if(!C.ok)throw new Error(`HTTP ${C.status}`);return C.json()}).then(async C=>{ya(C.token),t({type:"SET_USER",user:{id:C.userId,email:R?"auxtenwpc@gmail.com":"dev@botschat.test",displayName:R?"Auxten Wang":"Dev User"}});const de=P.get("dev_e2e");if(de)try{await it.setPassword(de,C.userId,!0),v(!0),ne.info("Auth","Dev E2E key derived successfully")}catch(he){ne.warn("Auth",`Dev E2E key derivation failed: ${he}`)}P.delete("dev_token"),P.delete("dev_user"),P.delete("dev_e2e");const fe=P.toString();window.history.replaceState({},"",window.location.pathname+(fe?`?${fe}`:"")),ne.info("Auth",`Dev-token login success: ${C.userId}`)}).catch(C=>{ne.warn("Auth",`Dev-token login failed: ${C}`)});return}if(Zf())ne.api("Auth","Auto-login with stored token"),zh.me().then(C=>{ne.info("Auth",`Logged in as ${C.email} (${C.id})`),t({type:"SET_USER",user:C})}).catch(C=>{ne.warn("Auth",`Auto-login failed: ${C}`),ya(null),ll(null)});else if(!mr.isNativePlatform()){const C="auxtenwpc@gmail.com",de="http://192.168.3.232:8787";{const fe=`${de}/api/auth/dev-login`;ne.info("Auth",`Debug auto-login as ${C} via ${fe}`),fetch(fe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:C})}).then(he=>he.json()).then(he=>{he.token?(ya(he.token),he.refreshToken&&ll(he.refreshToken),t({type:"SET_USER",user:{id:he.id,email:he.email,displayName:he.displayName}}),ne.info("Auth",`Debug auto-login success: ${he.email}`)):ne.warn("Auth","Debug auto-login returned no token",he)}).catch(he=>ne.warn("Auth",`Debug auto-login failed: ${he}`))}}},[]),I.useEffect(()=>{if(!e.user)return;const P=setTimeout(()=>{e.models.length===0&&_k.list().then(({models:T})=>{T.length>0&&t({type:"SET_MODELS",models:T})}).catch(()=>{})},2e3);return()=>clearTimeout(P)},[e.user,e.models.length]),I.useEffect(()=>{e.user&&(ne.api("Agents","Loading agents list"),ks.list().then(({agents:P})=>{if(ne.info("Agents",`Loaded ${P.length} agents`,P.map(T=>({id:T.id,name:T.name,channelId:T.channelId}))),t({type:"SET_AGENTS",agents:P}),P.length>0&&!e.selectedAgentId){let T=P[0];try{const R=localStorage.getItem("botschat_last_agent");if(R){const q=P.find(C=>C.id===R);q&&(ne.info("Agents",`Restoring last channel: ${q.name} (${q.id})`),T=q)}}catch{}t({type:"SELECT_AGENT",agentId:T.id,sessionKey:T.sessionKey})}}),ne.api("Channels","Loading channels list"),ir.list().then(({channels:P})=>{ne.info("Channels",`Loaded ${P.length} channels`,P.map(T=>({id:T.id,name:T.name}))),t({type:"SET_CHANNELS",channels:P}),b(!0)}))},[e.user]),I.useEffect(()=>{e.user&&e.activeView==="automations"&&(ne.api("Cron","Loading all background tasks + scan data"),Promise.all([Mn.listAll("background"),Mn.scanData()]).then(([{tasks:P},{tasks:T}])=>{if(ne.info("Cron",`Loaded ${P.length} cron tasks + ${T.length} scan entries`),t({type:"SET_CRON_TASKS",cronTasks:P}),t({type:"MERGE_SCAN_DATA",scanTasks:T.map(R=>({cronJobId:R.cronJobId,schedule:R.schedule,instructions:R.instructions,model:R.model||void 0,enabled:R.enabled}))}),P.length>0&&!e.selectedCronTaskId){let R=P[0].id;try{const q=localStorage.getItem("botschat_last_cron_task");if(q){const C=P.find(de=>de.id===q);C&&(ne.info("Cron",`Restoring last cron task: ${C.name} (${C.id})`),R=C.id)}}catch{}t({type:"SELECT_CRON_TASK",taskId:R})}}))},[e.user,e.activeView]);const M=(ae=e.agents.find(P=>P.id===e.selectedAgentId))==null?void 0:ae.channelId,$=e.activeView==="messages";I.useEffect(()=>{if(!$)return;if(!e.selectedAgentId){t({type:"SET_TASKS",tasks:[]}),t({type:"SELECT_TASK",taskId:null}),t({type:"SET_SESSIONS",sessions:[]});return}const P=e.agents.find(T=>T.id===e.selectedAgentId);P!=null&&P.channelId?(P.isDefault?(t({type:"SET_TASKS",tasks:[]}),t({type:"SELECT_TASK",taskId:null})):Mn.list(P.channelId).then(({tasks:T})=>{if(t({type:"SET_TASKS",tasks:T}),T.length>0){const R=T[0];t({type:"SELECT_TASK",taskId:R.id})}}),ws.list(P.channelId).then(({sessions:T})=>{if(ne.info("Sessions",`Loaded ${T.length} sessions for channel ${P.channelId}`),t({type:"SET_SESSIONS",sessions:T}),T.length>0){let R=T[0];try{const q=localStorage.getItem(`botschat_last_session_${P.channelId}`);if(q){const C=T.find(de=>de.id===q);C&&(ne.info("Sessions",`Restoring last session: ${C.name} (${C.id})`),R=C)}}catch{}t({type:"SELECT_SESSION",sessionId:R.id,sessionKey:R.sessionKey})}}).catch(T=>{ne.error("Sessions",`Failed to load sessions: ${T}`)})):P!=null&&P.isDefault&&!o.current&&O?(ne.info("Sessions","Default agent has no channel — auto-creating General channel"),o.current=!0,t({type:"SET_TASKS",tasks:[]}),t({type:"SELECT_TASK",taskId:null}),t({type:"SET_SESSIONS",sessions:[]}),ir.create({name:"General",openclawAgentId:"main"}).then(async T=>{ne.info("Sessions",`General channel created: ${T.id}`);const[{agents:R},{channels:q}]=await Promise.all([ks.list(),ir.list()]);t({type:"SET_AGENTS",agents:R}),t({type:"SET_CHANNELS",channels:q});const{sessions:C}=await ws.list(T.id);t({type:"SET_SESSIONS",sessions:C}),C.length>0&&t({type:"SELECT_SESSION",sessionId:C[0].id,sessionKey:C[0].sessionKey})}).catch(T=>{ne.error("Sessions",`Failed to auto-create General channel: ${T}`),o.current=!1})):(t({type:"SET_TASKS",tasks:[]}),t({type:"SELECT_TASK",taskId:null}),t({type:"SET_SESSIONS",sessions:[]}))},[e.selectedAgentId,M,$,O]),I.useEffect(()=>{if(!e.selectedTaskId)return;const P=e.tasks.find(R=>R.id===e.selectedTaskId);if(!P||P.kind!=="background"){t({type:"SET_JOBS",jobs:[]});return}const T=e.agents.find(R=>R.id===e.selectedAgentId);T!=null&&T.channelId&&Bh.list(T.channelId,P.id).then(({jobs:R})=>{t({type:"SET_JOBS",jobs:R}),R.length>0&&!e.selectedJobId&&t({type:"SELECT_JOB",jobId:R[0].id,sessionKey:R[0].sessionKey})}).catch(R=>{console.error("Failed to load jobs:",R)})},[e.selectedTaskId,e.tasks]),I.useEffect(()=>{if(!e.user||!e.selectedSessionKey)return;let P=!1;return gx.list(e.user.id,e.selectedSessionKey).then(async({messages:T,replyCounts:R})=>{if(P)return;const q=await Promise.all(T.map(async C=>{if(C.encrypted&&it.hasKey())try{const de=await it.decrypt(C.text,C.id);return{...C,text:de,isEncryptedLocked:!1}}catch(de){return console.warn(`Failed to decrypt message ${C.id}`,de),{...C,isEncryptedLocked:!0}}else if(C.encrypted)return{...C,isEncryptedLocked:!0};return C}));t({type:"SET_MESSAGES",messages:q,replyCounts:R})}).catch(T=>{console.error("Failed to load message history:",T)}),()=>{P=!0}},[e.user,e.selectedSessionKey,y]);const V=I.useRef(e);I.useEffect(()=>{V.current=e},[e]);const ee=I.useCallback(P=>{var de;const T=P.sessionKey,R=P.threadId??P.replyToId;ne.wsIn("WS",`${P.type}`,P);const q=fe=>{if(fe)return fe.replace(/:thread:.+$/,"")},C=fe=>fe?q(fe)===V.current.selectedSessionKey:!0;switch(P.type){case"connection.status":ne.info("Connection",`OpenClaw ${P.openclawConnected?"connected":"disconnected"}${P.defaultModel?` (default: ${P.defaultModel})`:""}`),t({type:"SET_OPENCLAW_CONNECTED",connected:P.openclawConnected,defaultModel:P.defaultModel||void 0}),Array.isArray(P.models)&&P.models.length>0&&t({type:"SET_MODELS",models:P.models});break;case"openclaw.disconnected":ne.warn("Connection","OpenClaw disconnected"),t({type:"SET_OPENCLAW_CONNECTED",connected:!1});break;case"model.changed":if(P.model&&P.sessionKey){ne.info("Model",`Session model changed to: ${P.model} (session: ${P.sessionKey})`),t({type:"SET_SESSION_MODEL",model:P.model});try{const fe=JSON.parse(localStorage.getItem("botschat:sessionModels")||"{}");fe[P.sessionKey]=P.model,localStorage.setItem("botschat:sessionModels",JSON.stringify(fe))}catch{}}break;case"agent.stream.start":if(T&&C(T)){const fe=R??((de=T.match(/:thread:(.+)$/))==null?void 0:de[1]);t({type:"STREAM_START",runId:P.runId,sessionKey:T,threadId:fe})}break;case"agent.stream.chunk":t({type:"STREAM_CHUNK",runId:P.runId,sessionKey:T??"",text:P.text});break;case"agent.stream.end":t({type:"STREAM_END",runId:P.runId});break;case"agent.text":{if(!C(T))break;const fe={id:Gn(),sender:"agent",text:P.text,timestamp:Date.now(),threadId:R};t(R&&T?{type:"ADD_THREAD_MESSAGE",message:fe}:{type:"ADD_MESSAGE",message:fe});break}case"agent.media":{if(!C(T))break;const fe={id:Gn(),sender:"agent",text:P.caption??"",mediaUrl:P.mediaUrl,timestamp:Date.now(),threadId:R};t(R&&T?{type:"ADD_THREAD_MESSAGE",message:fe}:{type:"ADD_MESSAGE",message:fe});break}case"agent.a2ui":{if(!C(T))break;const fe={id:Gn(),sender:"agent",text:"",a2ui:P.jsonl,timestamp:Date.now(),threadId:R};t(R&&T?{type:"ADD_THREAD_MESSAGE",message:fe}:{type:"ADD_MESSAGE",message:fe});break}case"job.update":{const fe={id:P.jobId,number:0,sessionKey:P.sessionKey,status:P.status,startedAt:P.startedAt,finishedAt:P.finishedAt??null,durationMs:P.durationMs??null,summary:P.summary??"",time:new Date((P.startedAt??0)*1e3).toLocaleString()};if(fe.status==="running")t({type:"ADD_JOB",job:fe});else{const he=V.current,Te=he.jobs.some(Le=>Le.id===fe.id);t(Te?{type:"SET_JOBS",jobs:he.jobs.map(Le=>Le.id===fe.id?{...Le,...fe}:Le)}:{type:"ADD_JOB",job:fe})}fe.status==="running"?t({type:"ADD_CRON_JOB",job:fe}):t({type:"UPDATE_CRON_JOB",job:fe});break}case"job.output":{const fe=P.jobId,he=P.text;fe&&he&&t({type:"APPEND_JOB_OUTPUT",jobId:fe,text:he});break}case"task.scan.result":{const fe=P.tasks??[];ne.info("TaskScan",`Scan result: ${fe.length} tasks reported`,fe),ks.list().then(({agents:Te})=>{ne.info("TaskScan",`Reloaded ${Te.length} agents`),t({type:"SET_AGENTS",agents:Te})}),ir.list().then(({channels:Te})=>{ne.info("TaskScan",`Reloaded ${Te.length} channels`),t({type:"SET_CHANNELS",channels:Te})}),Mn.listAll("background").then(({tasks:Te})=>{ne.info("TaskScan",`Reloaded ${Te.length} cron tasks, merging scan data`),t({type:"SET_CRON_TASKS",cronTasks:Te}),t({type:"MERGE_SCAN_DATA",scanTasks:fe.map(Le=>({cronJobId:Le.cronJobId,schedule:Le.schedule,instructions:Le.instructions??"",model:Le.model,enabled:Le.enabled}))})});const he=V.current;if(he.selectedAgentId){const Te=he.agents.find(Le=>Le.id===he.selectedAgentId);Te!=null&&Te.channelId&&Mn.list(Te.channelId).then(({tasks:Le})=>{t({type:"SET_TASKS",tasks:Le})})}break}case"status":break;case"models.list":Array.isArray(P.models)&&t({type:"SET_MODELS",models:P.models});break;case"task.schedule.ack":P.ok?ne.info("Task",`Schedule applied to OpenClaw: ${P.cronJobId}`):ne.error("Task",`Schedule push to OpenClaw failed: ${P.error}`,P);break;case"error":ne.error("Server",P.message,P);break}},[]);I.useEffect(()=>{a.current=ee},[ee]),I.useEffect(()=>{if(!e.user||!Zf())return;const P=Gn();ne.info("WS",`Connecting WebSocket (session=${P.slice(0,8)}...)`);const T=new Rk({userId:e.user.id,sessionId:P,getToken:Zf,onMessage:R=>{a.current(R)},onStatusChange:R=>{ne.info("WS",R?"WebSocket connected":"WebSocket disconnected"),t({type:"SET_WS_CONNECTED",connected:R})}});return T.connect(),r.current=T,()=>{T.disconnect(),r.current=null}},[e.user]);const U=I.useCallback(P=>{var T;ne.wsOut("WS",`${P.type}`,P),(T=r.current)==null||T.send(P)},[]),F=I.useCallback(async P=>{t({type:"SET_DEFAULT_MODEL",model:P||null});try{await Sk.updateSettings({defaultModel:P||void 0})}catch(T){console.error("Failed to update default model:",T)}},[]),Y=I.useCallback(P=>{const T=e.jobs.find(R=>R.id===P);T&&t({type:"SELECT_JOB",jobId:T.id,sessionKey:T.sessionKey||void 0})},[e.jobs]);if(I.useEffect(()=>{if(e.openclawConnected&&!O){const P=setTimeout(()=>{D()},1500);return()=>clearTimeout(P)}},[e.openclawConnected,O,D]),!e.user)return p.jsx(Ss.Provider,{value:e,children:p.jsx(Go.Provider,{value:t,children:p.jsx(cD,{})})});if(!O&&m&&e.channels.length===0&&!e.openclawConnected)return p.jsx(Ss.Provider,{value:e,children:p.jsx(Go.Provider,{value:t,children:p.jsx(fD,{onSkip:D})})});e.agents.find(P=>P.id===e.selectedAgentId);const ie=e.tasks.find(P=>P.id===e.selectedTaskId),K=(ie==null?void 0:ie.kind)==="background",B=!!e.selectedSessionKey,Q=e.activeView==="automations";return x?p.jsx(Ss.Provider,{value:e,children:p.jsx(Go.Provider,{value:t,children:p.jsx(kD,{sendMessage:U,theme:w,onToggleTheme:L,showSettings:c,onOpenSettings:()=>u(!0),onCloseSettings:()=>u(!1),handleDefaultModelChange:F,handleSelectJob:Y})})}):p.jsx(Ss.Provider,{value:e,children:p.jsxs(Go.Provider,{value:t,children:[p.jsxs("div",{className:"flex flex-col h-screen",children:[p.jsxs("div",{className:"flex flex-1 min-h-0",children:[p.jsx(Mk,{onToggleTheme:L,onOpenSettings:()=>u(!0),theme:w}),p.jsxs(ol,{orientation:"horizontal",defaultLayout:_.defaultLayout,onLayoutChanged:_.onLayoutChanged,id:"botschat-main",className:"flex-1",children:[p.jsx(Tr,{id:"sidebar",defaultSize:"15%",minSize:"5%",maxSize:"30%",children:Q?p.jsx(oS,{}):p.jsx(Cx,{})}),p.jsx(il,{}),p.jsx(Tr,{id:"content",children:Q?p.jsx(uS,{}):p.jsx("div",{className:"flex-1 flex flex-col min-w-0 h-full",children:B?p.jsxs(ol,{orientation:"horizontal",defaultLayout:S.defaultLayout,onLayoutChanged:S.onLayoutChanged,id:"botschat-content",children:[K&&p.jsxs(p.Fragment,{children:[p.jsx(Tr,{id:"joblist",defaultSize:"15%",minSize:"5%",maxSize:"30%",children:p.jsx(b5,{jobs:e.jobs,selectedJobId:e.selectedJobId,onSelectJob:Y})}),p.jsx(il,{})]}),p.jsx(Tr,{id:"chat",children:p.jsx(lE,{sendMessage:U})}),e.activeThreadId&&p.jsxs(p.Fragment,{children:[p.jsx(il,{}),p.jsx(Tr,{id:"thread",defaultSize:"28%",minSize:"10%",maxSize:"50%",children:p.jsx(cE,{sendMessage:U})})]})]}):p.jsx("div",{className:"flex-1 flex items-center justify-center",style:{background:"var(--bg-surface)"},children:p.jsxs("div",{className:"text-center",children:[p.jsx("svg",{className:"w-20 h-20 mx-auto mb-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,style:{color:"var(--text-muted)"},children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})}),p.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-muted)"},children:"Select a channel to get started"}),p.jsx("p",{className:"text-caption mt-1",style:{color:"var(--text-muted)"},children:"Choose a channel from the sidebar"})]})})})})]})]}),p.jsx(gD,{})]}),c&&p.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50",style:{background:"rgba(0,0,0,0.5)"},onClick:()=>u(!1),children:p.jsxs("div",{className:"rounded-lg p-6 w-[540px] max-w-[90vw] max-h-[85vh] flex flex-col",style:{background:"var(--bg-surface)",boxShadow:"var(--shadow-lg)"},onClick:P=>P.stopPropagation(),children:[p.jsxs("div",{className:"flex items-center justify-between mb-4",children:[p.jsx("h2",{className:"text-h1 font-bold",style:{color:"var(--text-primary)"},children:"Settings"}),p.jsx("button",{onClick:()=>u(!1),className:"p-1 hover:bg-[--bg-hover] rounded",style:{color:"var(--text-muted)"},children:p.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),p.jsxs("div",{className:"flex gap-4 mb-4",style:{borderBottom:"1px solid var(--border)"},children:[p.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:d==="general"?"var(--text-primary)":"var(--text-muted)",borderBottom:d==="general"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>h("general"),children:"General"}),p.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:d==="connection"?"var(--text-primary)":"var(--text-muted)",borderBottom:d==="connection"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>h("connection"),children:"Connection"}),p.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:d==="security"?"var(--text-primary)":"var(--text-muted)",borderBottom:d==="security"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>h("security"),children:"Security"})]}),p.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[d==="general"&&p.jsxs("div",{className:"space-y-5",children:[p.jsxs("div",{children:[p.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Default Model"}),p.jsx(Au,{value:e.defaultModel??"",onChange:F,models:e.models,placeholder:"Not set (use agent default)"}),p.jsxs("p",{className:"text-tiny mt-1.5",style:{color:"var(--text-muted)"},children:["Default model for new conversations. You can override per session using"," ",p.jsx("code",{children:"/model"})," or per automation in its settings."]})]}),p.jsxs("div",{children:[p.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Current Session Model"}),p.jsx("span",{className:"text-body font-mono",style:{color:e.sessionModel||e.defaultModel?"var(--text-primary)":"var(--text-muted)"},children:e.sessionModel??e.defaultModel??"Not connected"})]})]}),d==="connection"&&p.jsx(rS,{}),d==="security"&&p.jsx(iS,{})]}),p.jsx("div",{className:"mt-4 pt-4 flex justify-end",style:{borderTop:"1px solid var(--border)"},children:p.jsx("button",{onClick:()=>u(!1),className:"px-4 py-1.5 text-caption font-bold text-white rounded-sm",style:{background:"var(--bg-active)"},children:"Done"})})]})})]})})}CD();mr.isNativePlatform()&&(Rs(async()=>{const{StatusBar:e,Style:t}=await import("./index-Dx64BDkP.js");return{StatusBar:e,Style:t}},[]).then(({StatusBar:e,Style:t})=>{e.setStyle({style:t.Dark}).catch(()=>{}),e.setOverlaysWebView({overlay:!0}).catch(()=>{})}),Rs(async()=>{const{Keyboard:e}=await import("./index-CCFgKLX_.js");return{Keyboard:e}},[]).then(({Keyboard:e})=>{e.setAccessoryBarVisible({isVisible:!0}).catch(()=>{}),e.addListener("keyboardWillShow",t=>{document.documentElement.style.setProperty("--keyboard-height",`${t.keyboardHeight}px`)}),e.addListener("keyboardWillHide",()=>{document.documentElement.style.setProperty("--keyboard-height","0px")})}));Cw.createRoot(document.getElementById("root")).render(p.jsx(al.StrictMode,{children:p.jsx(RD,{})}));!mr.isNativePlatform()&&"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});export{dp as W,Rs as _,up as r};
|