miniflare
Version:
Fun, full-featured, fully-local simulator for Cloudflare Workers
42 lines • 1.02 MB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-oEXSY3AA.js","assets/Copy.es-D_-QRTV1.js","assets/_workflowName-Dvp2E4Ej.js","assets/ResourceError-Cm1UdHlj.js","assets/_bucketName-BZzOJiLm.js","assets/_namespaceId-Bm0P_JmR.js","assets/Breadcrumbs-CEo9kTmA.js","assets/dialog-oqh8l3l3zutpibxx-5_bvLLm7.js","assets/dropdown-ncwhcd912vmone8k-B21iHmGo.js","assets/table-inweecadl3her7pd-BOgC5mM4.js","assets/checkbox-kt1uojk2f9e0d0h1-Be_3OgAv.js","assets/label-latndvb1ngem7we8-CO7sxSXt.js","assets/DotsThree.es-DlSAzjaQ.js","assets/Pencil.es-oZy-hm2K.js","assets/CopyButton-CAmAekjd.js","assets/_namespaceId-Db7qPt77.js","assets/_className-Clyn4ODQ.js","assets/_databaseId-DKV0AVD1.js","assets/TableSelect-pjLFrFfg.js","assets/input-group-lxdd09p60cf27pe1-CRAZ_Isa.js","assets/text-nmyi1rkwdj37f30f-CmzPexmP.js","assets/Plus.es-xLjXVsFy.js","assets/Spinner.es-C_n6HP-q.js","assets/_databaseId-CdtZCI__.js","assets/_workflowName-XnNI8_83.js","assets/ArrowClockwise.es-D3ltv0_F.js","assets/types-Xf_TaJtQ.js","assets/async-H4wXUxPi.js","assets/_workflowName-D6aLbpPO.js","assets/_bucketName-BuHFqJ3G.js","assets/format-CcNF3Yqm.js","assets/_bucketName-CS1L-PCq.js","assets/_className-SARYBJoc.js","assets/_className-BWgbIQPi.js","assets/_instanceId-ZzudZhdh.js","assets/_instanceId-CHeCjR3S.js","assets/_objectId-CEwoHdwv.js","assets/_objectId-CvZVbyZa.js","assets/object._-BkmJF051.js","assets/object._-B9df25nO.js"])))=>i.map(i=>d[i]);
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=new WeakMap,u=new WeakMap,d={current:[]},f=!1,p=0,m=new Set,h=new Map;function g(e){for(let t of e){if(d.current.includes(t))continue;d.current.push(t),t.recompute();let e=u.get(t);if(e)for(let t of e){let e=l.get(t);e?.length&&g(e)}}}function _(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function v(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function y(e){if(p>0&&!h.has(e)&&h.set(e,e.prevState),m.add(e),!(p>0)&&!f)try{for(f=!0;m.size>0;){let e=Array.from(m);m.clear();for(let t of e)t.prevState=h.get(t)??t.prevState,_(t);for(let t of e){let e=l.get(t);e&&(d.current.push(t),g(e))}for(let t of e){let e=l.get(t);if(e)for(let t of e)v(t)}}}finally{f=!1,d.current=[],h.clear()}}function b(e){p++;try{e()}finally{if(p--,p===0){let e=m.values().next().value;e&&y(e)}}}function x(e){return typeof e==`function`}var S=class{constructor(e,t){this.listeners=new Set,this.subscribe=e=>{var t;this.listeners.add(e);let n=((t=this.options)?.onSubscribe)?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,n;this.prevState=this.state,this.options?.updateFn?this.state=this.options.updateFn(this.prevState)(e):x(e)?this.state=e(this.prevState):this.state=e,(n=(t=this.options)?.onUpdate)==null||n.call(t),y(this)}},C=`__TSR_index`,w=`popstate`,T=`beforeunload`;function E(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=A(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[C];i=D(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[C];i=D(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[C]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function D(e,t){t||={};let n=j();return{...t,key:n,__TSR_key:n,[C]:e}}function O(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>A(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=j();t.history.replaceState({[C]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(D._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),D._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=A(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),D.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[C]-l.state[C],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),D.notify(u);return}}}l=c(),D.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},D=E({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(T,S,{capture:!0}),t.removeEventListener(w,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(T,S,{capture:!0}),t.addEventListener(w,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return D._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return D._ignoreSubscribers||b(`REPLACE`),n},D}function k(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function A(e,t){let n=k(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=j();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[C]:0,key:a,__TSR_key:a}}}function j(){return(Math.random()+1).toString(36).substring(7)}function M(e){let t;return b(()=>{t=e()}),t}function N(e){return e[e.length-1]}function P(e){return typeof e==`function`}function F(e,t){return P(e)?e(t):e}var I=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable;function L(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=t,i=te(e)&&te(r);if(!i&&!(z(e)&&z(r)))return r;let a=i?e:R(e);if(!a)return r;let o=i?r:R(r);if(!o)return r;let s=a.length,c=o.length,l=i?Array(c):{},u=0;for(let t=0;t<c;t++){let a=i?t:o[t],c=e[a],d=r[a];if(c===d){l[a]=c,(i?t<s:I.call(e,a))&&u++;continue}if(c===null||d===null||typeof c!=`object`||typeof d!=`object`){l[a]=d;continue}let f=L(c,d,n+1);l[a]=f,f===c&&u++}return s===c&&u===s?e:l}function R(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!ee.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!ee.call(e,t))return!1;r.push(t)}return r}function z(e){if(!B(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!B(n)||!n.hasOwnProperty(`isPrototypeOf`))}function B(e){return Object.prototype.toString.call(e)===`[object Object]`}function te(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ne(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!ne(e[r],t[r],n))return!1;return!0}if(z(e)&&z(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!ne(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!ne(e[o],t[o],n)))return!1;return i===a}return!1}function re(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function V(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function ie(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function ae(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function oe(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return ae(t)}var se=[`http:`,`https:`,`mailto:`,`tel:`];function ce(e){if(!e)return!1;try{let t=new URL(e);return!se.includes(t.protocol)}catch{return!1}}var le={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},ue=/[&><\u2028\u2029]/g;function de(e){return e.replace(ue,e=>le[e])}function fe(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=oe(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=oe(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function pe(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var me=!0,he=`Invariant failed`;function ge(e,t){if(!e){if(me)throw Error(he);var n=typeof t==`function`?t():t,r=n?`${he}: ${n}`:he;throw Error(r)}}function _e(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var ve=4,ye=5;function be(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function xe(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=be(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Se(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;s<o;){let e=xe(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=Te(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=Te(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Ee(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Ee(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=Ee(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=Te(n.fullPath??n.from);e.kind=ye,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=Te(n.fullPath??n.from);e.kind=ve,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=n.options?.params?.parse??null,i.skipOnParamError=l,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)Se(e,t,r,s,i,a,o)}function Ce(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function we(e){if(e.pathless)for(let t of e.pathless)we(t);if(e.static)for(let t of e.static.values())we(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())we(t);if(e.dynamic?.length){e.dynamic.sort(Ce);for(let t of e.dynamic)we(t)}if(e.optional?.length){e.optional.sort(Ce);for(let t of e.optional)we(t)}if(e.wildcard?.length){e.wildcard.sort(Ce);for(let t of e.wildcard)we(t)}}function Te(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Ee(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function De(e,t){let n=Te(`/`),r=new Uint16Array(6);for(let t of e)Se(!1,r,t,1,n,0);we(n),t.masksTree=n,t.flatCache=_e(1e3)}function Oe(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Ne(e,t.masksTree);return t.flatCache.set(e,r),r}function ke(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Te(`/`),Se(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Ne(r,o,n)}function Ae(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Ne(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Fe(a.route)),t.matchCache.set(r,a),a}function je(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Me(e,t=!1,n){let r=Te(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return Se(t,i,e,1,r,0,e=>{if(n?.(e,s),ge(!(e.id in a),`Duplicate routes found with id: ${String(e.id)}`),a[e.id]=e,s!==0&&e.path){let t=je(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),we(r),{processedTree:{segmentTree:r,singleCache:_e(1e3),matchCache:_e(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Ne(e,t,n=!1){let r=e.split(`/`),i=Le(e,r,t,n);if(!i)return null;let[a]=Pe(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function Pe(e,t,n){let r=Ie(n.node),i=null,a={},o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===ve)break;if(u.kind===ye){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Fe(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Ie(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Le(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!N(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:d,skipped:f,depth:p,statics:m,dynamics:h,optionals:g}=n,{extract:_,rawParams:v,parsedParams:y}=n;if(i.skipOnParamError){if(!Re(e,t,n))continue;v=n.rawParams,_=n.extract,y=n.parsedParams}r&&i.route&&i.kind!==ve&&ze(l,n)&&(l=n);let b=d===o;if(b&&(i.route&&!a&&ze(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let x=b?void 0:t[d],S;if(b&&i.index){let n={node:i.index,index:d,skipped:f,depth:p+1,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y},r=!0;if(i.index.skipOnParamError&&(Re(e,t,n)||(r=!1)),r){if(m===o&&!h&&!g&&!f)return n;ze(u,n)&&(u=n)}}if(i.wildcard&&ze(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r&&(b||!(n.caseSensitive?x:S??=x.toLowerCase()).startsWith(r)))continue;if(i){if(b)continue;let e=t.slice(d).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:f,depth:p,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(!(n.skipOnParamError&&!Re(e,t,a))){c=a;break}}if(i.optional){let e=f|1<<p,t=p+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:d,skipped:e,depth:t,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?x:S??=x.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:d+1,skipped:f,depth:t,statics:m,dynamics:h,optionals:g+1,extract:_,rawParams:v,parsedParams:y})}}if(!b&&i.dynamic&&x)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?x:S??=x.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:d+1,skipped:f,depth:p+1,statics:m,dynamics:h+1,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.staticInsensitive){let e=i.staticInsensitive.get(S??=x.toLowerCase());e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.static){let e=i.static.get(x);e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(i.pathless){let e=p+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:d,skipped:f,depth:e,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}}}if(u&&c)return ze(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??={},l.rawParams[`**`]=decodeURIComponent(r),l}return null}function Re(e,t,n){try{let[r,i]=Pe(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,a),!0}catch{return null}}function ze(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===ve)>(e.node.kind===ve)||t.node.kind===ve==(e.node.kind===ve)&&t.depth>e.depth))):!0}function Be(e){return Ve(e.filter(e=>e!==void 0).join(`/`))}function Ve(e){return e.replace(/\/{2,}/g,`/`)}function He(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Ue(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function We(e){return Ue(He(e))}function Ge(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Ke(e,t,n){return Ge(e,n)===Ge(t,n)}function qe({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&N(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(N(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=xe(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=Ve(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function Je(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Ye(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ze(e,n)).join(`/`):Ze(r,n):r}function Xe({path:e,params:t,decoder:n,...r}){let i=!1,a={};if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=xe(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Ye(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ye(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ye(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Ze(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Qe(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function $e(e){return!!e?.isNotFound}function et(){try{if(typeof window<`u`&&typeof window.sessionStorage==`object`)return window.sessionStorage}catch{}}var tt=`tsr-scroll-restoration-v1_3`,nt=(e,t)=>{let n;return(...r)=>{n||=setTimeout(()=>{e(...r),n=null},t)}};function rt(){let e=et();if(!e)return null;let t=e.getItem(tt),n=t?JSON.parse(t):{};return{state:n,set:t=>{n=F(t,n)||n;try{e.setItem(tt,JSON.stringify(n))}catch{console.warn(`[ts-router] Could not persist scroll restoration state to sessionStorage.`)}}}}var it=rt(),at=e=>e.state.__TSR_key||e.href;function ot(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var st=!1;function ct({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||`{}`)}catch(e){console.error(e);return}let s=t||window.history.state?.__TSR_key,c=o[s];st=!0;scroll:{if(r&&c&&Object.keys(c).length>0){for(let e in c){let t=c[e];if(e===`window`)window.scrollTo({top:t.scrollY,left:t.scrollX,behavior:n});else if(e){let n=document.querySelector(e);n&&(n.scrollLeft=t.scrollX,n.scrollTop=t.scrollY)}}break scroll}let e=(a??window.location).hash.split(`#`,2)[1];if(e){let t=window.history.state?.__hashScrollIntoViewOptions??!0;if(t){let n=document.getElementById(e);n&&n.scrollIntoView(t)}break scroll}let t={top:0,left:0,behavior:n};if(window.scrollTo(t),i)for(let e of i){if(e===`window`)continue;let n=typeof e==`function`?e():document.querySelector(e);n&&n.scrollTo(t)}}st=!1}function lt(e,t){if(!it||((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!it))return;e.isScrollRestorationSetup=!0,st=!1;let n=e.options.getScrollRestorationKey||at;window.history.scrollRestoration=`manual`,typeof document<`u`&&document.addEventListener(`scroll`,nt(t=>{if(st||!e.isScrollRestoring)return;let r=``;if(t.target===document||t.target===window)r=`window`;else{let e=t.target.getAttribute(`data-scroll-restoration-id`);r=e?`[data-scroll-restoration-id="${e}"]`:ot(t.target)}let i=n(e.state.location);it.set(e=>{let t=e[i]||={},n=t[r]||={};if(r===`window`)n.scrollX=window.scrollX||0,n.scrollY=window.scrollY||0;else if(r){let e=document.querySelector(r);e&&(n.scrollX=e.scrollLeft||0,n.scrollY=e.scrollTop||0)}return e})},100),!0),e.subscribe(`onRendered`,t=>{let r=n(t.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation})||(ct({storageKey:tt,key:r,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&it.set(e=>(e[r]||={},e)))})}function ut(e){if(typeof document<`u`&&document.querySelector){let t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==``){let n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function dt(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function ft(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function pt(e){let t=new URLSearchParams(e),n={};for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=ft(r):Array.isArray(t)?t.push(ft(r)):n[e]=[t,ft(r)]}return n}var mt=gt(JSON.parse),ht=_t(JSON.stringify,JSON.parse);function gt(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=pt(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function _t(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=dt(e,r);return t?`?${t}`:``}}var vt=`__root__`;function yt(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href==`string`&&ce(e.href))throw Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${se.join(`, `)} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function bt(e){return e instanceof Response&&!!e.options}var xt=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},St=(e,t)=>!!(e.preload&&!e.router.state.matches.some(e=>e.id===t)),Ct=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},wt=(e,t)=>{let n=e.router.routesById[t.routeId??``]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),ge(n.options.notFoundComponent,`No notFoundComponent found. Please set a notFoundComponent on your route or provide a defaultNotFoundComponent to the router.`);let r=e.matches.find(e=>e.routeId===n.id);ge(r,`Could not find match for route: `+n.id),e.updateMatch(r.id,e=>({...e,status:`notFound`,error:t,isFetching:!1})),t.routerCode===`BEFORE_LOAD`&&n.parentRoute&&(t.routeId=n.parentRoute.id,wt(e,t))},Tt=(e,t,n)=>{if(!(!bt(n)&&!$e(n))){if(bt(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;let r=bt(n)?`redirected`:`notFound`;t._nonReactive.error=n,e.updateMatch(t.id,i=>({...i,status:r,context:Ct(e,t.index),isFetching:!1,error:n})),$e(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw bt(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(wt(e,n),n)}},Et=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,Dt=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Tt(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,Tt(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},Ot=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!St(e,t)&&(n.options.loader||n.options.beforeLoad||Rt(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{xt(e)},i);r._nonReactive.pendingTimeout=t}},kt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Ot(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&Tt(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},At=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=re(()=>{a?.resolve()});let{paramsError:o,searchError:s}=i;o&&Dt(e,n,o,`PARSE_PARAMS`),s&&Dt(e,n,s,`VALIDATE_SEARCH`),Ot(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){M(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=re();let f={...Ct(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=St(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){M(()=>{u(),d()});return}(bt(r)||$e(r))&&(u(),Dt(e,n,r,`BEFORE_LOAD`)),M(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),ie(y))return u(),y.catch(t=>{Dt(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),Dt(e,n,t,`BEFORE_LOAD`)}v(y)},jt=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>At(e,n,t,i),s=()=>{if(Et(e,n))return;let t=kt(e,n,i);return ie(t)?t.then(o):o()};return a()},Mt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Nt=(e,t,n,r)=>{let i=e.matchPromises[n-1],{params:a,loaderDeps:o,abortController:s,cause:c}=e.router.getMatch(t),l=Ct(e,n),u=St(e,t);return{params:a,deps:o,preload:!!u,parentMatchPromise:i,abortController:s,context:l,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:u?`preload`:c,route:r,...e.router.options.additionalContext}},Pt=async(e,t,n,r)=>{try{let i=e.router.getMatch(t);try{Lt(r);let a=r.options.loader?.(Nt(e,t,n,r)),o=r.options.loader&&ie(a);if((o||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,e=>({...e,isFetching:`loader`})),r.options.loader){let n=o?await a:a;Tt(e,e.router.getMatch(t),n),n!==void 0&&e.updateMatch(t,e=>({...e,loaderData:n}))}r._lazyPromise&&await r._lazyPromise;let s=i._nonReactive.minPendingPromise;s&&await s,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,t=>({...t,error:void 0,context:Ct(e,n),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(a){let o=a;if(o?.name===`AbortError`){if(i.abortController.signal.aborted){i._nonReactive.loaderPromise?.resolve(),i._nonReactive.loaderPromise=void 0;return}e.updateMatch(t,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:Ct(e,n)}));return}let s=i._nonReactive.minPendingPromise;s&&await s,$e(a)&&await r.options.notFoundComponent?.preload?.(),Tt(e,e.router.getMatch(t),a);try{r.options.onError?.(a)}catch(n){o=n,Tt(e,e.router.getMatch(t),n)}e.updateMatch(t,t=>({...t,error:o,context:Ct(e,n),status:`error`,isFetching:!1}))}}catch(n){let r=e.router.getMatch(t);r&&(r._nonReactive.loaderPromise=void 0),Tt(e,r,n)}},Ft=async(e,t)=>{async function n(n,i,s,c){let l=Date.now()-i.updatedAt,u=n?c.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.router.options.defaultStaleTime??0,d=c.options.shouldReload,f=typeof d==`function`?d(Nt(e,r,t,c)):d,{status:p,invalid:m}=s;a=p===`success`&&(m||(f??l>u)),n&&c.options.preload===!1||(a&&!e.sync?(o=!0,(async()=>{try{await Pt(e,r,t,c);let n=e.router.getMatch(r);n._nonReactive.loaderPromise?.resolve(),n._nonReactive.loadPromise?.resolve(),n._nonReactive.loaderPromise=void 0}catch(t){bt(t)&&await e.router.navigate(t.options)}})()):(p!==`success`||a&&e.sync)&&await Pt(e,r,t,c))}let{id:r,routeId:i}=e.matches[t],a=!1,o=!1,s=e.router.looseRoutesById[i];if(!Et(e,r)){let t=e.router.getMatch(r),i=St(e,r);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload)return t;await t._nonReactive.loaderPromise;let a=e.router.getMatch(r),o=a._nonReactive.error||a.error;o&&Tt(e,a,o),a.status===`pending`&&await n(i,t,a,s)}else{let a=i&&!e.router.state.matches.some(e=>e.id===r),o=e.router.getMatch(r);o._nonReactive.loaderPromise=re(),a!==o.preload&&e.updateMatch(r,e=>({...e,preload:a})),await n(i,t,o,s)}}let c=e.router.getMatch(r);o||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,o||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;let l=o?c.isFetching:!1;return l!==c.isFetching||c.invalid!==!1?(e.updateMatch(r,e=>({...e,isFetching:l,invalid:!1})),e.router.getMatch(r)):c};async function It(e){let t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(e=>e._forcePending)&&xt(t);try{for(let e=0;e<t.matches.length;e++){let n=jt(t,e);ie(n)&&await n}let e=t.firstBadMatchIndex??t.matches.length;for(let n=0;n<e;n++)t.matchPromises.push(Ft(t,n));let n=(await Promise.allSettled(t.matchPromises)).filter(e=>e.status===`rejected`).map(e=>e.reason),r;for(let e of n){if(bt(e))throw e;!r&&$e(e)&&(r=e)}for(let e of t.matches){let{id:n,routeId:r}=e,i=t.router.looseRoutesById[r];try{let e=Mt(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}if(r)throw r;let i=xt(t);ie(i)&&await i}catch(e){if($e(e)&&!t.preload){let n=xt(t);throw ie(n)&&await n,e}if(bt(e))throw e}return t.matches}async function Lt(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){let t=()=>{let t=[];for(let n of zt){let r=e.options[n]?.preload;r&&t.push(r())}if(t.length)return Promise.all(t).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Rt(e){for(let t of zt)if(e.options[t]?.preload)return!0;return!1}var zt=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function Bt(e){return{input:({url:t})=>{for(let n of e)t=Ht(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Ut(e[n],t);return t}}}function Vt(e){let t=We(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Be([`/`,t,e.pathname]),e)}}function Ht(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Ut(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Wt(e){let t=e.resolvedLocation,n=e.location;return{fromLocation:t,toLocation:n,pathChanged:t?.pathname!==n.pathname,hrefChanged:t?.href!==n.href,hashChanged:t?.hash!==n.hash}}var Gt=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{e.notFoundRoute&&console.warn(`The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.`);let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Je(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=O()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=_e(1e3),e=this.buildRouteTree(),this.setRoutes(e)}!this.__store&&this.latestLocation&&(this.__store=new S(Jt(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(e=>![`redirected`].includes(e.status))}}}),lt(this));let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=We(o);t&&t!==`/`&&e.push(Vt({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Bt(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Me(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&De(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let o=this.options.parseSearch(n),s=this.options.stringifySearch(o);return{href:e+s+r,publicHref:i,pathname:fe(e).path,external:!1,searchStr:s,search:L(t?.search,o),hash:fe(r.slice(1)).path,state:L(t?.state,a)}}let o=new URL(i,this.origin),s=Ht(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:fe(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:L(t?.search,c),hash:fe(s.hash.slice(1)).path,state:L(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>qe({base:e,to:Ve(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Xt({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{let e=this.state.matches.filter(e=>e.status===`pending`),t=this.state.matches.filter(e=>e.isFetching===`loader`);new Set([...this.state.pendingMatches??[],...e,...t]).forEach(e=>{this.cancelMatch(e.id)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,s={...r.params},c=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),l=t.params===!1||t.params===null?{}:(t.params??!0)===!0?s:Object.assign(s,F(t.params,s)),u=Xe({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,d=this.getMatchedRoutes(u),f=d.matchedRoutes;(d.foundRoute?d.foundRoute.path!==`/`&&d.routeParams[`**`]:Ue(u))&&this.options.notFoundRoute&&(f=[...f,this.options.notFoundRoute]);let p=!1;if(Object.keys(l).length>0)for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;t&&(p=!0,Object.assign(l,t(l)))}let m=e.leaveParams?c:fe(p?Xe({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:u).path,h=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Yt(t.options.validateSearch,{...e,...h}))}catch{}}),h=e}h=Zt({search:h,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),h=L(o,h);let g=this.options.stringifySearch(h),_=t.hash===!0?n.hash:t.hash?F(t.hash,n.hash):void 0,v=_?`#${_}`:``,y=t.state===!0?n.state:t.state?F(t.state,n.state):{};y=L(n.state,y);let b=`${m}${g}${v}`,x,S,C=!1;if(this.rewrite){let e=new URL(b,this.origin),t=Ut(this.rewrite,e);x=e.href.replace(e.origin,``),t.origin===this.origin?S=t.pathname+t.search+t.hash:(S=t.href,C=!0)}else x=pe(b),S=x;return{publicHref:S,href:x,pathname:m,search:h,searchStr:g,state:y,hash:_??``,external:C,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n={};if(this.options.routeMasks){let o=Oe(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?{}:(s??!0)===!0?n:Object.assign(n,F(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=ne(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=Ue(this.latestLocation.href)===Ue(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=re(()=>{a?.resolve()}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=A(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Ht(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(ce(t))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation);this.__store.setState(t=>({...t,status:`pending`,statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:t.cachedMatches.filter(t=>!e.some(e=>e.id===t.id))}))},this.load=async e=>{let t,n,r;for(r=new Promise(i=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.state.resolvedLocation;this.state.redirect||this.emit({type:`onBeforeNavigate`,...Wt({resolvedLocation:n,location:t})}),this.emit({type:`onBeforeLoad`,...Wt({resolvedLocation:n,location:t})}),await It({router:this,sync:e?.sync,matches:this.state.pendingMatches,location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=[],t=[],n=[];M(()=>{this.__store.setState(r=>{let i=r.matches,a=r.pendingMatches||r.matches;return e=i.filter(e=>!a.some(t=>t.id===e.id)),t=a.filter(e=>!i.some(t=>t.id===e.id)),n=a.filter(e=>i.some(t=>t.id===e.id)),{...r,isLoading:!1,loadedAt:Date.now(),matches:a,pendingMatches:void 0,cachedMatches:[...r.cachedMatches,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`)]}}),this.clearExpiredCache()}),[[e,`onLeave`],[t,`onEnter`],[n,`onStay`]].forEach(([e,t])=>{e.forEach(e=>{this.looseRoutesById[e.routeId].options[t]?.(e)})})})})}})}catch(e){bt(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):$e(e)&&(n=e),this.__store.setState(e=>({...e,statusCode:t?t.status:n?404:e.matches.some(e=>e.status===`error`)?500:200,redirect:t}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(e=>e.status===`error`)&&(i=500),i!==void 0&&this.__store.setState(e=>({...e,statusCode:i}))},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.state.resolvedLocation,a=typeof t.types==`function`?t.types(Wt({resolvedLocation:i,location:r})):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.state.pendingMatches?.some(t=>t.id===e)?`pendingMatches`:this.state.matches.some(t=>t.id===e)?`matches`:this.state.cachedMatches.some(t=>t.id===e)?`cachedMatches`:``;n&&this.__store.setState(r=>({...r,[n]:r[n]?.map(n=>n.id===e?t(n):n)}))})},this.getMatch=e=>{let t=t=>t.id===e;return this.state.cachedMatches.find(t)??this.state.pendingMatches?.find(t)??this.state.matches.find(t)},this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.__store.setState(e=>({...e,matches:e.matches.map(t),cachedMatches:e.cachedMatches.map(t),pendingMatches:e.pendingMatches?.map(t)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.__store.setState(e=>({...e,cachedMatches:[]})):this.__store.setState(e=>({...e,cachedMatches:e.cachedMatches.filter(e=>!t(e))}))},this.clearExpiredCache=()=>{this.clearCache({filter:e=>{let t=this.looseRoutesById[e.routeId];if(!t.options.loader)return!0;let n=(e.preload?t.options.preloadGcTime??this.options.defaultPreloadGcTime:t.options.gcTime??this.options.defaultGcTime)??300*1e3;return e.status===`error`?!0:Date.now()-e.updatedAt>=n}})},this.loadRouteChunk=Lt,this.preloadRoute=async e=>{let t=this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(e=>e.id)),i=new Set([...r,...this.state.cachedMatches.map(e=>e.id)]);M(()=>{n.forEach(e=>{i.has(e.id)||this.__store.setState(t=>({...t,cachedMatches:[...t.cachedMatches,e]}))})});try{return n=await It({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(bt(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});$e(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.state.status!==`pending`)return!1;let i=(t?.pending===void 0?!this.state.isLoading:t.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=ke(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!ne(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?ne(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status===`notFound`||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??ht,parseSearch:e.parseSearch??mt}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:Ue(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?$t(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map(this.state.matches.map(e=>[e.routeId,e]));for(let n=0;n<o.length;n++){let r=o[n],s=l[n-1],d,f,p;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=Yt(r.options.validateSearch,{...n})??void 0;d={...n,...e},f={...i,...e},p=void 0}catch(e){let r=e;if(e instanceof Kt||(r=new Kt(e.message,{cause:e})),t?.throwOnError)throw r;d=n,f={},p=r}}let m=r.options.loaderDeps?.({search:d})??``,h=m?JSON.stringify(m):``,{interpolatedPath:g,usedParams:_}=Xe({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),v=r.id+g+h,y=this.getMatch(v),b=u.get(r.id),x=y?._strictParams??_,S;if(!y)try{en(r,_,a,x)}catch(e){if(S=$e(e)||bt(e)?e:new qt(e.message,{cause:e}),t?.throwOnError)throw S}Object.assign(i,x);let C=b?`stay`:`enter`,w;if(y)w={...y,cause:C,params:b?.params??i,_strictParams:x,search:L(b?b.search:y.search,d),_strictSearch:f};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||Rt(r)?`pending`:`success`;w={id:v,ssr:r.options.ssr,index:n,routeId:r.id,params:b?.params??i,_strictParams:x,pathname:g,updatedAt:Date.now(),search:b?L(b.search,d):d,_strictSearch:f,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:S,__routeContext:void 0,_nonReactive:{loadPromise:re()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:b?L(b.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(w.globalNotFound=c===r.id),w.searchError=p;let T=this.getParentContext(s);w.context={...T,...w.__routeContext,...w.__beforeLoadContext},l[n]=w}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?L(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=N(t),a={...e.search};for(let e of t)try{Object.assign(a,Yt(e.options.validateSearch,a))}catch{}let o=N(this.state.matches),s=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname,c;if(s)c=o.params;else{let e={...n};for(let i of t)try{en(i,n,r??{},e)}catch{}c=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:c}}},Kt=class extends Error{},qt=class extends Error{};function Jt(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Yt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Kt(`Async validation not supported`);if(n.issues)throw new Kt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Xt({pathname:e,routesById:t,processedTree:n}){let r={},i=Ue(e),a,o,s=Ae(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign({},s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function Zt({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Qt(n)(e,t,r??!1)}function Qt(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...Yt(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:F(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function $t(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return vt}function en(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}var tn=`Error preloading route! ☝️`,nn=class{constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=vt:this.parentRoute||ge(!1,`Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);let r=n?vt:t?.path;r&&r!==`/`&&(r=He(r));let i=t?.id||r,a=n?vt:Be([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Be([`/`,a]));let o=a===`__root__`?`/`:Be([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Ue(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>yt({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}},rn=class{constructor({id:e}){this.notFound=e=>Qe({routeId:this.id,...e}),this.redirect=e=>yt({from:this.id,...e}),this.id=e}},an=class extends nn{constructor(e){super(e)}},on=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),sn=o(((e,t)=>{t.exports=on()})),cn=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ee={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ee,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),ln=o(((e,t)=>{t.exports=cn()})),H=c(ln(),1),un=H.use,dn=typeof window<`u`?H.useLayoutEffect:H.useEffect;function fn(e){let t=H.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function pn(e,t,n={},r={}){H.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function mn(e){let t=H.useRef(null);return H.useImperativeHandle(e,()=>t.current,[]),t}var U=sn();function hn(e){let t=e.errorComponent??_n;return(0,U.jsx)(gn,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?H.createElement(t,{error:n,reset:r}):e.children})}var gn=class extends H.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey===this.props.getResetKey()?this.state.error:null,reset:()=>{this.reset()}})}};function _n({error:e}){let[t,n]=H.useState(!1);return(0,U.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,U.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,U.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,U.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,U.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,U.jsx)(`div`,{children:(0,U.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,U.jsx)(`code`,{children:e.message}):null})}):null]})}function vn({children:e,fallback:t=null}){return yn()?(0,U.jsx)(H.Fragment,{children:e}):(0,U.jsx)(H.Fragment,{children:t})}function yn(){return H.useSyncExternalStore(bn,()=>!0,()=>!1)}function bn(){return()=>{}}var xn=!0;function Sn(e,t){if(!xn){if(e)return;var n=`Warning: `+t;typeof console<`u`&&console.warn(n);try{throw Error(n)}catch{}}}var Cn=o((e=>{var t=ln();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),wn=o(((e,t)=>{t.exports=Cn()})),Tn=o((e=>{var t=ln(),n=wn();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),En=o(((e,t)=>{t.exports=Tn()}))();function Dn(e,t=e=>e,n={}){let r=n.equal??On;return(0,En.useSyncExternalStoreWithSelector)(e.subscribe,()=>e.state,()=>e.state,t,r)}function On(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=kn(e);if(n.length!==kn(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function kn(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var An=H.createContext(null);function jn(){return typeof document>`u`?An:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=An,An)}function Mn(e){let t=H.useContext(jn());return Sn(!((e?.warn??!0)&&!t),`useRouter must be used inside a <RouterProvider> component!`),t}function Nn(e){let t=Mn({warn:e?.router===void 0}),n=e?.router||t,r=(0,H.useRef)(void 0);return Dn(n.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=L(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var Pn=H.createContext(void 0),Fn=H.createContext(void 0);function In(e){let t=H.useContext(e.from?Fn:Pn);return Nn({select:n=>{let r=n.matches.find(n=>e.from?e.from===n.routeId:n.id===t);if(ge(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:`a nearest match!`}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function Ln(e){return In({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Rn(e){let{select:t,...n}=e;return In({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function zn(e){return In({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Bn(e){return In({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Vn(e){let t=Mn();return H.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var Hn=o((e=>{var t=ln();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),Un=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Hn()})),Wn=c(Un(),1);function Gn(e,t){let n=Mn(),r=mn(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,hashScrollIntoView:u,replace:d,startTransition:f,resetScroll:p,viewTransition:m,children:h,target:g,disabled:_,style:v,className:y,onClick:b,onFocus:x,onMouseEnter:S,onMouseLeave:C,onTouchStart:w,ignoreBlocker:T,params:E,search:D,hash:O,state:k,mask:A,reloadDocument:j,unsafeRelative:M,from:N,_fromLocation:P,...I}=e,ee=yn(),L=Nn({select:e=>e.location.search,structuralSharing:!0}),R=e.from,z=H.useMemo(()=>({...e,from:R}),[n,L,R,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),B=H.useMemo(()=>n.buildLocation({...z}),[n,z]),te=B.maskedLocation?B.maskedLocation.publicHref:B.publicHref,re=B.maskedLocation?B.maskedLocation.external:B.external,V=H.useMemo(()=>er(te,re,n.history,_),[_,re,te,n.history]),ie=H.useMemo(()=>{if(V?.external)return ce(V.href)?void 0:V.href;if(!tr(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),ce(s)?void 0:s}catch{}},[s,V]),ae=Nn({select:e=>{if(ie)return!1;if(o?.exact){if(!Ke(e.location.pathname,B.pathname,n.basepath))return!1}else{let t=Ge(e.location.pathname,n.basepath),r=Ge(B.pathname,n.basepath);if(!(t.startsWith(r)&&(t.length===r.length||t[r.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!ne(e.location.search,B.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?ee&&e.location.hash===B.hash:!0}}),oe=ae?F(i,{})??qn:Kn,se=ae?Kn:F(a,{})??Kn,le=[y,oe.className,se.className].filter(Boolean).join(` `),ue=(v||oe.style||se.style)&&{...v,...oe.style,...se.style},[de,fe]=H.useState(!1),pe=H.useRef(!1),me=e.reloadDocument||ie?!1:c??n.options.defaultPreload,he=l??n.options.defaultPreloadDelay??0,ge=H.useCallback(()=>{n.preloadRoute({...z}).catch(e=>{console.warn(e),console.warn(tn)})},[n,z]);pn(r,H.useCallback(e=>{e?.isIntersecting&&ge()},[ge]),Qn,{disabled:!!_||me!==`viewport`}),H.useEffect(()=>{pe.current||!_&&me===`render`&&(ge(),pe.current=!0)},[_,ge,me]);let _e=e=>{let t=e.currentTarget.getAttribute(`target`),r=g===void 0?t:g;if(!_&&!rr(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Wn.flushSync)(()=>{fe(!0)});let t=n.subscribe(`onResolved`,()=>{t(),fe(!1)});n.navigate({...z,replace:d,resetScroll:p,hashScrollIntoView:u,startTransition:f,viewTransition:m,ignoreBlocker:T})}};if(ie)return{...I,ref:r,href:ie,...h&&{children:h},...g&&{target:g},..._&&{disabled:_},...v&&{style:v},...y&&{className:y},...b&&{onClick:b},...x&&{onFocus:x},...S&&{onMouseEnter:S},...C&&{onMouseLeave:C},...w&&{onTouchStart:w}};let ve=e=>{_||me&&ge()},ye=ve,be=e=>{if(!(_||!me))if(!he)ge();else{let t=e.target;if(Zn.has(t))return;let n=setTimeout(()=>{Zn.delete(t),ge()},he);Zn.set(t,n)}},xe=e=>{if(_||!me||!he)return;let t=e.target,n=Zn.get(t);n&&(clearTimeout(n),Zn.delete(t))};return{...I,...oe,...se,href:V?.href,ref:r,onClick:$n([b,_e]),onFocus:$n([x,ve]),onMouseEnter:$n([S,be]),onMouseLeave:$n([C,xe]),onTouchStart:$n([w,ye]),disabled:!!_,target:g,...ue&&{style:ue},...le&&{className:le},..._&&Jn,...ae&&Yn,...ee&&de&&Xn}}var Kn={},qn={className:`active`},Jn={role:`link`,"aria-disabled":!0},Yn={"data-status":`active`,"aria-current":`page`},Xn={"data-transitioning":`transitioning`},Zn=new WeakMap,Qn={rootMargin:`100px`},$n=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function er(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function tr(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var nr=H.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Gn(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return H.createElement(`a`,t,o)}return H.createElement(n,a,o)});function rr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ir(e){return new ar({id:e})}var ar=class extends rn{constructor({id:e}){super({id:e}),this.useMatch=e=>In({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>Bn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>zn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Rn({...e,from:this.id,strict:!1}),this.useLoaderData=e=>Ln({...e,from:this.id,strict:!1}),this.useNavigate=()=>Vn({from:Mn().routesById[this.id].fullPath}),this.notFound=e=>Qe({routeId:this.id,...e}),this.Link=H.forwardRef((e,t)=>{let n=Mn().routesById[this.id].fullPath;return(0,U.jsx)(nr,{ref:t,from:n,...e})})}},or=class extends nn{constructor(e){super(e),this.useMatch=e=>In({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>Bn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>zn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Rn({...e,from:this.id}),this.useLoaderData=e=>Ln({...e,from:this.id}),this.useNavigate=()=>Vn({from:this.fullPath}),this.Link=H.forwardRef((e,t)=>(0,U.jsx)(nr,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function sr(e){return new or(e)}var cr=class extends an{constructor(e){super(e),this.useMatch=e=>In({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>Bn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>zn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Rn({...e,from:this.id}),this.useLoaderData=e=>Ln({...e,from:this.id}),this.useNavigate=()=>Vn({from:this.fullPath}),this.Link=H.forwardRef((e,t)=>(0,U.jsx)(nr,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function lr(e){return new cr(e)}function ur(e){return typeof e==`object`?new dr(e,{silent:!0}).createRoute(e):new dr(e,{silent:!0}).createRoute}var dr=class{constructor(e,t){this.path=e,this.createRoute=e=>{Sn(this.silent,`FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.`);let t=sr(e);return t.isRoot=!1,t},this.silent=t?.silent}},fr=class{constructor(e){this.useMatch=e=>In({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({from:this.options.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>Bn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>zn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>Rn({...e,from:this.options.id}),this.useLoaderData=e=>Ln({...e,from:this.options.id}),this.useNavigate=()=>Vn({from:Mn().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for(`react.memo`)}};function pr(e){return typeof e==`object`?new fr(e):t=>new fr({id:e,...t})}function mr(e,t){let n,r,i,a,o=()=>(n||=e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{if(i=e,V(i)&&i instanceof Error&&typeof window<`u`&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(e)||(sessionStorage.setItem(e,`1`),a=!0)}}),n),s=function(e){if(a)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)if(un)un(o());else throw o();return H.createElement(r,e)};return s.preload=o,s}function hr(){let e=Mn(),t=H.useRef({router:e,mounted:!1}),[n,r]=H.useState(!1),{hasPendingMatches:i,isLoading:a}=Nn({select:e=>({isLoading:e.isLoading,hasPendingMatches:e.matches.some(e=>e.status===`pending`)}),structuralSharing:!0}),o=fn(a),s=a||n||i,c=fn(s),l=a||i,u=fn(l);return e.startTransition=e=>{r(!0),H.startTransition(()=>{e(),r(!1)})},H.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ue(e.latestLocation.publicHref)!==Ue(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),dn(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),dn(()=>{o&&!a&&e.emit({type:`onLoad`,...Wt(e.state)})},[o,e,a]),dn(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...Wt(e.state)})},[l,u,e]),dn(()=>{if(c&&!s){let t=Wt(e.state);e.emit({type:`onResolved`,...t}),e.__store.setState(e=>({...e,status:`idle`,resolvedLocation:e.location})),t.hrefChanged&&ut(e)}},[s,c,e]),null}function gr(e){let t=Nn({select:e=>`not-found-${e.location.pathname}-${e.status}`});return(0,U.jsx)(hn,{getResetKey:()=>t,onCatch:(t,n)=>{if($e(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if($e(t))return e.fallback?.(t);throw t},children:e.children})}function _r(){return(0,U.jsx)(`p`,{children:`Not Found`})}function vr(e){return(0,U.jsx)(U.Fragment,{children:e.children})}function yr(e,t,n){return t.options.notFoundComponent?(0,U.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,U.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,U.jsx)(_r,{})}function br({children:e}){return Mn(),null}function xr(){let e=Mn();if(!e.isScrollRestoring||!0)return null;let t=(e.options.getScrollRestorationKey||at)(e.latestLocation),n=t===at(e.latestLocation)?void 0:t,r={storageKey:tt,shouldScrollRestoration:!0};return n&&(r.key=n),(0,U.jsx)(br,{children:`(${ct.toString()})(${de(JSON.stringify(r))})`})}var Sr=H.memo(function({matchId:e}){let t=Mn(),n=Nn({select:t=>{let n=t.matches.findIndex(t=>t.id===e),r=t.matches[n];return ge(r,`Could not find match for matchId "${e}". Please file an issue!`),{routeId:r.routeId,ssr:r.ssr,_displayPending:r._displayPending,resetKey:t.loadedAt,parentRouteId:t.matches[n-1]?.routeId}},structuralSharing:!0}),r=t.routesById[n.routeId],i=r.options.pendingComponent??t.options.defaultPendingComponent,a=i?(0,U.jsx)(i,{}):null,o=r.options.errorComponent??t.options.defaultErrorComponent,s=r.options.onCatch??t.options.defaultOnCatch,c=r.isRoot?r.options.notFoundComponent??t.options.notFoundRoute?.options.component:r.options.notFoundComponent,l=n.ssr===!1||n.ssr===`data-only`,u=(!r.isRoot||r.options.wrapInSuspense||l)&&(r.options.wrapInSuspense??i??(r.options.errorComponent?.preload||l))?H.Suspense:vr,d=o?hn:vr,f=c?gr:vr;return(0,U.jsxs)(r.isRoot?r.options.shellComponent??vr:vr,{children:[(0,U.jsx)(Pn.Provider,{value:e,children:(0,U.jsx)(u,{fallback:a,children:(0,U.jsx)(d,{getResetKey:()=>n.resetKey,errorComponent:o||_n,onCatch:(t,n)=>{if($e(t))throw t;Sn(!1,`Error in route match: ${e}`),s?.(t,n)},children:(0,U.jsx)(f,{fallback:e=>{if(!c||e.routeId&&e.routeId!==n.routeId||!e.routeId&&!r.isRoot)throw e;return H.createElement(c,e)},children:l||n._displayPending?(0,U.jsx)(vn,{fallback:a,children:(0,U.jsx)(wr,{matchId:e})}):(0,U.jsx)(wr,{matchId:e})})})})}),n.parentRouteId===`__root__`&&t.options.scrollRestoration?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Cr,{}),(0,U.jsx)(xr,{})]}):null]})});function Cr(){let e=Mn(),t=H.useRef(void 0);return(0,U.jsx)(`script`,{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:`onRendered`,...Wt(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var wr=H.memo(function({matchId:e}){let t=Mn(),{match:n,key:r,routeId:i}=Nn({select:n=>{let r=n.matches.find(t=>t.id===e),i=r.routeId,a=(t.routesById[i].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:i,loaderDeps:r.loaderDeps,params:r._strictParams,search:r._strictSearch});return{key:a?JSON.stringify(a):void 0,routeId:i,match:{id:r.id,status:r.status,error:r.error,invalid:r.invalid,_forcePending:r._forcePending,_displayPending:r._displayPending}}},structuralSharing:!0}),a=t.routesById[i],o=H.useMemo(()=>{let e=a.options.component??t.options.defaultComponent;return e?(0,U.jsx)(e,{},r):(0,U.jsx)(Tr,{})},[r,a.options.component,t.options.defaultComponent]);if(n._displayPending)throw t.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw t.getMatch(n.id)?._nonReactive.minPendingPromise;if(n.status===`pending`){let e=a.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let r=t.getMatch(n.id);if(r&&!r._nonReactive.minPendingPromise){let t=re();r._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),r._nonReactive.minPendingPromise=void 0},e)}}throw t.getMatch(n.id)?._nonReactive.loadPromise}if(n.status===`notFound`)return ge($e(n.error),`Expected a notFound error`),yr(t,a,n.error);if(n.status===`redirected`)throw ge(bt(n.error),`Expected a redirect error`),t.getMatch(n.id)?._nonReactive.loadPromise;if(n.status===`error`)throw n.error;return o}),Tr=H.memo(function(){let e=Mn(),t=H.useContext(Pn),n=Nn({select:e=>e.matches.find(e=>e.id===t)?.routeId}),r=e.routesById[n],i=Nn({select:e=>{let n=e.matches.find(e=>e.id===t);return ge(n,`Could not find parent match for matchId "${t}"`),n.globalNotFound}}),a=Nn({select:e=>{let n=e.matches;return n[n.findIndex(e=>e.id===t)+1]?.id}}),o=e.options.defaultPendingComponent?(0,U.jsx)(e.options.defaultPendingComponent,{}):null;if(i)return yr(e,r,void 0);if(!a)return null;let s=(0,U.jsx)(Sr,{matchId:a});return n===`__root__`?(0,U.jsx)(H.Suspense,{fallback:o,children:s}):s});function Er(){let e=Mn(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,U.jsx)(t,{}):null,r=(0,U.jsxs)(typeof document<`u`&&e.ssr?vr:H.Suspense,{fallback:n,children:[(0,U.jsx)(hr,{}),(0,U.jsx)(Dr,{})]});return e.options.InnerWrap?(0,U.jsx)(e.options.InnerWrap,{children:r}):r}function Dr(){let e=Mn(),t=Nn({select:e=>e.matches[0]?.id}),n=Nn({select:e=>e.loadedAt}),r=t?(0,U.jsx)(Sr,{matchId:t}):null;return(0,U.jsx)(Pn.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,U.jsx)(hn,{getResetKey:()=>n,errorComponent:_n,onCatch:e=>{Sn(!1,`The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`),Sn(!1,e.message||e.toString())},children:r})})}var Or=e=>new kr(e),kr=class extends Gt{constructor(e){super(e)}};typeof globalThis<`u`?(globalThis.createFileRoute=ur,globalThis.createLazyFileRoute=pr):typeof window<`u`&&(window.createFileRoute=ur,window.createLazyFileRoute=pr);function Ar({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,U.jsx)(jn().Provider,{value:e,children:t});return e.options.Wrap?(0,U.jsx)(e.options.Wrap,{children:r}):r}function jr({router:e,...t}){return(0,U.jsx)(Ar,{router:e,...t,children:(0,U.jsx)(Er,{})})}var Mr=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Nr=o(((e,t)=>{t.exports=Mr()})),Pr=o((e=>{var t=Nr(),n=ln(),r=Un();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var M=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},I=[],ee=-1;function L(e){return{current:e}}function R(e){0>ee||(e.current=I[ee],I[ee]=null,ee--)}function z(e,t){ee++,I[ee]=e.current,e.current=t}var B=L(null),te=L(null),ne=L(null),re=L(null);function V(e,t){switch(z(ne,t),z(te,e),z(B,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kd(t),e=qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(B),z(B,e)}function ie(){R(B),R(te),R(ne)}function ae(e){e.memoizedState!==null&&z(re,e);var t=B.current,n=qd(t,e.type);t!==n&&(z(te,e),z(B,n))}function oe(e){te.current===e&&(R(B),R(te)),re.current===e&&(R(re),tp._currentValue=F)}var se,ce;function le(e){if(se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);se=t&&t[1]||``,ce=-1<e.stack.indexOf(`
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
`+se+e+ce}var ue=!1;function de(e,t){if(!e||ue)return``;ue=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
`),l=s.split(`
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ue=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?le(n):``}function fe(e,t){switch(e.tag){case 26:case 27:case 5:return le(e.type);case 16:return le(`Lazy`);case 13:return e.child!==t&&t!==null?le(`Suspense Fallback`):le(`Suspense`);case 19:return le(`SuspenseList`);case 0:case 15:return de(e.type,!1);case 11:return de(e.type.render,!1);case 1:return de(e.type,!0);case 31:return le(`Activity`);default:return``}}function pe(e){try{var t=``,n=null;do t+=fe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
Error generating stack: `+e.message+`
`+e.stack}}var me=Object.prototype.hasOwnProperty,he=t.unstable_scheduleCallback,ge=t.unstable_cancelCallback,_e=t.unstable_shouldYield,ve=t.unstable_requestPaint,ye=t.unstable_now,be=t.unstable_getCurrentPriorityLevel,xe=t.unstable_ImmediatePriority,Se=t.unstable_UserBlockingPriority,Ce=t.unstable_NormalPriority,we=t.unstable_LowPriority,Te=t.unstable_IdlePriority,Ee=t.log,De=t.unstable_setDisableYieldValue,Oe=null,ke=null;function Ae(e){if(typeof Ee==`function`&&De(e),ke&&typeof ke.setStrictMode==`function`)try{ke.setStrictMode(Oe,e)}catch{}}var je=Math.clz32?Math.clz32:Pe,Me=Math.log,Ne=Math.LN2;function Pe(e){return e>>>=0,e===0?32:31-(Me(e)/Ne|0)|0}var Fe=256,Ie=262144,Le=4194304;function Re(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ze(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Re(n))):i=Re(o):i=Re(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Re(n))):i=Re(o)):i=Re(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Be(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ve(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 He(){var e=Le;return Le<<=1,!(Le&62914560)&&(Le=4194304),e}function Ue(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function We(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ge(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-je(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ke(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ke(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function qe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Je(e,t){var n=t&-t;return n=n&42?1:Ye(n),(n&(e.suspendedLanes|t))===0?n:0}function Ye(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Xe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ze(){var e=P.p;return e===0?(e=window.event,e===void 0?32:_p(e.type)):e}function Qe(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var $e=Math.random().toString(36).slice(2),et=`__reactFiber$`+$e,tt=`__reactProps$`+$e,nt=`__reactContainer$`+$e,rt=`__reactEvents$`+$e,it=`__reactListeners$`+$e,at=`__reactHandles$`+$e,ot=`__reactResources$`+$e,st=`__reactMarker$`+$e;function ct(e){delete e[et],delete e[tt],delete e[rt],delete e[it],delete e[at]}function lt(e){var t=e[et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nt]||n[et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gf(e);e!==null;){if(n=e[et])return n;e=gf(e)}return t}e=n,n=e.parentNode}return null}function ut(e){if(e=e[et]||e[nt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ft(e){var t=e[ot];return t||=e[ot]={hoistableStyles:new Map,hoistableScripts:new Map},t}function pt(e){e[st]=!0}var mt=new Set,ht={};function gt(e,t){_t(e,t),_t(e+`Capture`,t)}function _t(e,t){for(ht[e]=t,e=0;e<t.length;e++)mt.add(t[e])}var vt=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]*$`),yt={},bt={};function xt(e){return me.call(bt,e)?!0:me.call(yt,e)?!1:vt.test(e)?bt[e]=!0:(yt[e]=!0,!1)}function St(e,t,n){if(xt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Ct(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function wt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Tt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Et(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Dt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ot(e){if(!e._valueTracker){var t=Et(e)?`checked`:`value`;e._valueTracker=Dt(e,t,``+e[t])}}function kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Et(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function At(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var jt=/[\n"\\]/g;function Mt(e){return e.replace(jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Nt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Tt(t)):e.value!==``+Tt(t)&&(e.value=``+Tt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ft(e,o,Tt(n)):Ft(e,o,Tt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Tt(s):e.removeAttribute(`name`)}function Pt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ot(e);return}n=n==null?``:``+Tt(n),t=t==null?n:``+Tt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ot(e)}function Ft(e,t,n){t===`number`&&At(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function It(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Tt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Lt(e,t,n){if(t!=null&&(t=``+Tt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Tt(n)}function Rt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(M(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Tt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ot(e)}function zt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Bt=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 Vt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Bt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ht(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Vt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Vt(e,o,t[o])}function Ut(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Wt=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`]]),Gt=/^[\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 Kt(e){return Gt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function qt(){}var Jt=null;function Yt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xt=null,Zt=null;function Qt(e){var t=ut(e);if(t&&(e=t.stateNode)){var n=e[tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Nt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Mt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[tt]||null;if(!a)throw Error(i(90));Nt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&kt(r)}break a;case`textarea`:Lt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&It(e,!!n.multiple,t,!1)}}}var $t=!1;function en(e,t,n){if($t)return e(t,n);$t=!0;try{return e(t)}finally{if($t=!1,(Xt!==null||Zt!==null)&&(Su(),Xt&&(t=Xt,e=Zt,Zt=Xt=null,Qt(t),e)))for(t=0;t<e.length;t++)Qt(e[t])}}function tn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[tt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var nn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),rn=!1;if(nn)try{var an={};Object.defineProperty(an,`passive`,{get:function(){rn=!0}}),window.addEventListener(`test`,an,an),window.removeEventListener(`test`,an,an)}catch{rn=!1}var on=null,sn=null,cn=null;function H(){if(cn)return cn;var e,t=sn,n=t.length,r,i=`value`in on?on.value:on.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return cn=i.slice(e,1<r?1-r:void 0)}function un(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function dn(){return!0}function fn(){return!1}function pn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?dn:fn,this.isPropagationStopped=fn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=dn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=dn)},persist:function(){},isPersistent:dn}),t}var mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},U=pn(mn),hn=f({},mn,{view:0,detail:0}),gn=pn(hn),_n,vn,yn,bn=f({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==yn&&(yn&&e.type===`mousemove`?(_n=e.screenX-yn.screenX,vn=e.screenY-yn.screenY):vn=_n=0,yn=e),_n)},movementY:function(e){return`movementY`in e?e.movementY:vn}}),xn=pn(bn),Sn=pn(f({},bn,{dataTransfer:0})),Cn=pn(f({},hn,{relatedTarget:0})),wn=pn(f({},mn,{animationName:0,elapsedTime:0,pseudoElement:0})),Tn=pn(f({},mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),En=pn(f({},mn,{data:0})),Dn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},On={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`},kn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function An(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kn[e])?!!t[e]:!1}function jn(){return An}var Mn=pn(f({},hn,{key:function(e){if(e.key){var t=Dn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=un(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?On[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jn,charCode:function(e){return e.type===`keypress`?un(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?un(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Nn=pn(f({},bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Pn=pn(f({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jn})),Fn=pn(f({},mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),In=pn(f({},bn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Ln=pn(f({},mn,{newState:0,oldState:0})),Rn=[9,13,27,32],zn=nn&&`CompositionEvent`in window,Bn=null;nn&&`documentMode`in document&&(Bn=document.documentMode);var Vn=nn&&`TextEvent`in window&&!Bn,Hn=nn&&(!zn||Bn&&8<Bn&&11>=Bn),Wn=` `,Gn=!1;function Kn(e,t){switch(e){case`keyup`:return Rn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Jn=!1;function Yn(e,t){switch(e){case`compositionend`:return qn(t);case`keypress`:return t.which===32?(Gn=!0,Wn):null;case`textInput`:return e=t.data,e===Wn&&Gn?null:e;default:return null}}function Xn(e,t){if(Jn)return e===`compositionend`||!zn&&Kn(e,t)?(e=H(),cn=sn=on=null,Jn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Hn&&t.locale!==`ko`?null:t.data;default:return null}}var Zn={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 Qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Zn[e.type]:t===`textarea`}function $n(e,t,n,r){Xt?Zt?Zt.push(r):Zt=[r]:Xt=r,t=Ad(t,`onChange`),0<t.length&&(n=new U(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var er=null,tr=null;function nr(e){Sd(e,0)}function rr(e){if(kt(dt(e)))return e}function ir(e,t){if(e===`change`)return t}var ar=!1;if(nn){var or;if(nn){var sr=`oninput`in document;if(!sr){var cr=document.createElement(`div`);cr.setAttribute(`oninput`,`return;`),sr=typeof cr.oninput==`function`}or=sr}else or=!1;ar=or&&(!document.documentMode||9<document.documentMode)}function lr(){er&&(er.detachEvent(`onpropertychange`,ur),tr=er=null)}function ur(e){if(e.propertyName===`value`&&rr(tr)){var t=[];$n(t,tr,e,Yt(e)),en(nr,t)}}function dr(e,t,n){e===`focusin`?(lr(),er=t,tr=n,er.attachEvent(`onpropertychange`,ur)):e===`focusout`&&lr()}function fr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return rr(tr)}function pr(e,t){if(e===`click`)return rr(t)}function mr(e,t){if(e===`input`||e===`change`)return rr(t)}function hr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var gr=typeof Object.is==`function`?Object.is:hr;function _r(e,t){if(gr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!me.call(t,i)||!gr(e[i],t[i]))return!1}return!0}function vr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yr(e,t){var n=vr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=vr(n)}}function br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=At(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=At(e.document)}return t}function Sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Cr=nn&&`documentMode`in document&&11>=document.documentMode,wr=null,Tr=null,Er=null,Dr=!1;function Or(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dr||wr==null||wr!==At(r)||(r=wr,`selectionStart`in r&&Sr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Er&&_r(Er,r)||(Er=r,r=Ad(Tr,`onSelect`),0<r.length&&(t=new U(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=wr)))}function kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ar={animationend:kr(`Animation`,`AnimationEnd`),animationiteration:kr(`Animation`,`AnimationIteration`),animationstart:kr(`Animation`,`AnimationStart`),transitionrun:kr(`Transition`,`TransitionRun`),transitionstart:kr(`Transition`,`TransitionStart`),transitioncancel:kr(`Transition`,`TransitionCancel`),transitionend:kr(`Transition`,`TransitionEnd`)},jr={},Mr={};nn&&(Mr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),`TransitionEvent`in window||delete Ar.transitionend.transition);function Pr(e){if(jr[e])return jr[e];if(!Ar[e])return e;var t=Ar[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mr)return jr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),Br=Pr(`transitioncancel`),Vr=Pr(`transitionend`),Hr=new Map,Ur=`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(` `);Ur.push(`scrollEnd`);function Wr(e,t){Hr.set(e,t),gt(t,[e])}var Gr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Kr=[],qr=0,Jr=0;function Yr(){for(var e=qr,t=Jr=qr=0;t<e;){var n=Kr[t];Kr[t++]=null;var r=Kr[t];Kr[t++]=null;var i=Kr[t];Kr[t++]=null;var a=Kr[t];if(Kr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&$r(n,i,a)}}function Xr(e,t,n,r){Kr[qr++]=e,Kr[qr++]=t,Kr[qr++]=n,Kr[qr++]=r,Jr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Zr(e,t,n,r){return Xr(e,t,n,r),ei(e)}function Qr(e,t){return Xr(e,null,null,t),ei(e)}function $r(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-je(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ei(e){if(50<pu)throw pu=0,mu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ti={};function ni(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ri(e,t,n,r){return new ni(e,t,n,r)}function ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ai(e,t){var n=e.alternate;return n===null?(n=ri(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function oi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function si(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ii(e)&&(s=1);else if(typeof e==`string`)s=qf(e,n,B.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=ri(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return ci(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=ri(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=ri(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=ri(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ri(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ci(e,t,n,r){return e=ri(7,e,r,t),e.lanes=n,e}function li(e,t,n){return e=ri(6,e,null,t),e.lanes=n,e}function ui(e){var t=ri(18,null,null,0);return t.stateNode=e,t}function di(e,t,n){return t=ri(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var fi=new WeakMap;function pi(e,t){if(typeof e==`object`&&e){var n=fi.get(e);return n===void 0?(t={value:e,source:t,stack:pe(t)},fi.set(e,t),t):n}return{value:e,source:t,stack:pe(t)}}var mi=[],hi=0,gi=null,_i=0,vi=[],yi=0,bi=null,xi=1,Si=``;function Ci(e,t){mi[hi++]=_i,mi[hi++]=gi,gi=e,_i=t}function wi(e,t,n){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,bi=e;var r=xi;e=Si;var i=32-je(r)-1;r&=~(1<<i),n+=1;var a=32-je(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xi=1<<32-je(t)+i|n<<i|r,Si=a+e}else xi=1<<a|n<<i|r,Si=e}function Ti(e){e.return!==null&&(Ci(e,1),wi(e,1,0))}function Ei(e){for(;e===gi;)gi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null;for(;e===bi;)bi=vi[--yi],vi[yi]=null,Si=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null}function Di(e,t){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,xi=t.id,Si=t.overflow,bi=e}var Oi=null,ki=null,Ai=!1,ji=null,Mi=!1,Ni=Error(i(519));function Pi(e){throw zi(pi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ni}function Fi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[et]=e,t[tt]=r,n){case`dialog`:Cd(`cancel`,t),Cd(`close`,t);break;case`iframe`:case`object`:case`embed`:Cd(`load`,t);break;case`video`:case`audio`:for(n=0;n<bd.length;n++)Cd(bd[n],t);break;case`source`:Cd(`error`,t);break;case`img`:case`image`:case`link`:Cd(`error`,t),Cd(`load`,t);break;case`details`:Cd(`toggle`,t);break;case`input`:Cd(`invalid`,t),Pt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Cd(`invalid`,t);break;case`textarea`:Cd(`invalid`,t),Rt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Id(t.textContent,n)?(r.popover!=null&&(Cd(`beforetoggle`,t),Cd(`toggle`,t)),r.onScroll!=null&&Cd(`scroll`,t),r.onScrollEnd!=null&&Cd(`scrollend`,t),r.onClick!=null&&(t.onclick=qt),t=!0):t=!1,t||Pi(e,!0)}function Ii(e){for(Oi=e.return;Oi;)switch(Oi.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:Oi=Oi.return}}function W(e){if(e!==Oi)return!1;if(!Ai)return Ii(e),Ai=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Jd(e.type,e.memoizedProps)),n=!n),n&&ki&&Pi(e),Ii(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=hf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=hf(e)}else t===27?(t=ki,nf(e.type)?(e=mf,mf=null,ki=e):ki=t):ki=Oi?pf(e.stateNode.nextSibling):null;return!0}function Li(){ki=Oi=null,Ai=!1}function Ri(){var e=ji;return e!==null&&($l===null?$l=e:$l.push.apply($l,e),ji=null),e}function zi(e){ji===null?ji=[e]:ji.push(e)}var Bi=L(null),Vi=null,G=null;function Hi(e,t,n){z(Bi,t._currentValue),t._currentValue=n}function Ui(e){e._currentValue=Bi.current,R(Bi)}function Wi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Gi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Wi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Wi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ki(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;gr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===re.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[tp]:e.push(tp))}a=a.return}e!==null&&Gi(t,e,n,r),t.flags|=262144}function qi(e){for(e=e.firstContext;e!==null;){if(!gr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ji(e){Vi=e,G=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yi(e){return Zi(Vi,e)}function Xi(e,t){return Vi===null&&Ji(e),Zi(e,t)}function Zi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},G===null){if(e===null)throw Error(i(308));G=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else G=G.next=t;return n}var Qi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},$i=t.unstable_scheduleCallback,ea=t.unstable_NormalPriority,ta={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function na(){return{controller:new Qi,data:new Map,refCount:0}}function ra(e){e.refCount--,e.refCount===0&&$i(ea,function(){e.controller.abort()})}var ia=null,aa=0,oa=0,sa=null;function ca(e,t){if(ia===null){var n=ia=[];aa=0,oa=md(),sa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return aa++,t.then(la,la),t}function la(){if(--aa===0&&ia!==null){sa!==null&&(sa.status=`fulfilled`);var e=ia;ia=null,oa=0,sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var da=N.S;N.S=function(e,t){nu=ye(),typeof t==`object`&&t&&typeof t.then==`function`&&ca(e,t),da!==null&&da(e,t)};var fa=L(null);function pa(){var e=fa.current;return e===null?Ll.pooledCache:e}function ma(e,t){t===null?z(fa,fa.current):z(fa,t.pool)}function ha(){var e=pa();return e===null?null:{parent:ta._currentValue,pool:e}}var ga=Error(i(460)),_a=Error(i(474)),va=Error(i(542)),ya={then:function(){}};function ba(e){return e=e.status,e===`fulfilled`||e===`rejected`}function xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(qt,qt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e;default:if(typeof t.status==`string`)t.then(qt,qt);else{if(e=Ll,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e}throw Ca=t,ga}}function Sa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ca=e,ga):e}}var Ca=null;function wa(){if(Ca===null)throw Error(i(459));var e=Ca;return Ca=null,e}function Ta(e){if(e===ga||e===va)throw Error(i(483))}var Ea=null,Da=0;function Oa(e){var t=Da;return Da+=1,Ea===null&&(Ea=[]),xa(Ea,e,t)}function ka(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Aa(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ja(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ai(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=li(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&Sa(i)===t.type)?(t=a(t,n.props),ka(t,n),t.return=e,t):(t=si(n.type,n.key,n.props,null,e.mode,r),ka(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=di(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ci(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=si(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case h:return t=di(t,e.mode,n),t.return=e,t;case T:return t=Sa(t),f(e,t,n)}if(M(t)||k(t))return t=ci(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Oa(t),n);if(t.$$typeof===b)return f(e,Xi(e,t),n);Aa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=Sa(n),p(e,t,n,r)}if(M(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Oa(n),r);if(n.$$typeof===b)return p(e,t,Xi(e,n),r);Aa(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=Sa(r),_(e,t,n,r,i)}if(M(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Oa(r),i);if(r.$$typeof===b)return _(e,t,n,Xi(t,r),i);Aa(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Ai&&Ci(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return Ai&&Ci(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),Ai&&Ci(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Ai&&Ci(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Ai&&Ci(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Ai&&Ci(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Sa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ka(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===g?(c=ci(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=si(o.type,o.key,o.props,null,e.mode,c),ka(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=di(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Sa(o),x(e,r,o,c)}if(M(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Oa(o),c);if(o.$$typeof===b)return x(e,r,Xi(e,o),c);Aa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Da=0;var i=x(e,t,n,r);return Ea=null,i}catch(t){if(t===ga||t===va)throw t;var a=ri(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ma=ja(!0),Na=ja(!1),Pa=!1;function Fa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ia(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ei(e),$r(e,null,n),t}return Xr(e,r,t,n),ei(e)}function za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}function Ba(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Va=!1;function Ha(){if(Va){var e=sa;if(e!==null)throw e}}function Ua(e,t,n,r){Va=!1;var i=e.updateQueue;Pa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(zl&p)===p:(r&p)===p){p!==0&&p===oa&&(Va=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Pa=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ql|=o,e.lanes=o,e.memoizedState=d}}function Wa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ga(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Wa(n[e],t)}var Ka=L(null),qa=L(0);function Ja(e,t){e=Gl,z(qa,e),z(Ka,t),Gl=e|t.baseLanes}function Ya(){z(qa,Gl),z(Ka,Ka.current)}function Xa(){Gl=qa.current,R(Ka),R(qa)}var Za=L(null),Qa=null;function $a(e){var t=e.alternate;z(io,io.current&1),z(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){z(io,io.current),z(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(z(io,io.current),z(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){z(io,io.current),z(Za,Za.current)}function ro(e){R(Za),Qa===e&&(Qa=null),R(io)}var io=L(0);function ao(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||uf(n)||df(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var oo=0,so=null,co=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(i(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!gr(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return oo=a,so=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Ls:Rs,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){N.H=Is;var t=co!==null&&co.next!==null;if(oo=0,lo=co=so=null,uo=!1,ho=0,go=null,t)throw Error(i(300));e===null||tc||(e=e.dependencies,e!==null&&qi(e)&&(tc=!0))}function So(e,t,n,r){so=e;var a=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=a)throw Error(i(301));if(a+=1,lo=co=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=zs,o=t(n,r)}while(fo);return o}function Co(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(co===null?null:co.memoizedState)!==e&&(so.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}oo=0,lo=co=so=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?so.memoizedState=lo=e:lo=lo.next=e,lo}function Oo(){if(co===null){var e=so.alternate;e=e===null?null:e.memoizedState}else e=co.next;var t=lo===null?so.memoizedState:lo.next;if(t!==null)lo=t,co=e;else{if(e===null)throw so.alternate===null?Error(i(467)):Error(i(310));co=e,e={memoizedState:co.memoizedState,baseState:co.baseState,baseQueue:co.baseQueue,queue:co.queue,next:null},lo===null?so.memoizedState=lo=e:lo=lo.next=e}return lo}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=xa(go,e,t),t=so,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Ls:Rs),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===b)return Yi(e)}throw Error(i(438,String(e)))}function Mo(e){var t=null,n=so.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=so.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ko(),so.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=D;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),co,e)}function Fo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(oo&f)===f:(zl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===oa&&(d=!0);else if((oo&p)===p){u=u.next,p===oa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,so.lanes|=p,ql|=p;f=u.action,po&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,so.lanes|=f,ql|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!gr(o,e.memoizedState)&&(tc=!0,d&&(n=sa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Io(e){var t=Oo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);gr(o,t.memoizedState)||(tc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=so,a=Oo(),o=Ai;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!gr((co||a).memoizedState,n);if(s&&(a.memoizedState=n,tc=!0),a=a.queue,cs(Bo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,a,n,t),null),Ll===null)throw Error(i(349));o||oo&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=so.updateQueue,t===null?(t=ko(),so.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gr(e,n)}catch{return!0}}function Ho(e){var t=Qr(e,2);t!==null&&_u(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){Ae(!0);try{n()}finally{Ae(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,co,typeof r==`function`?r:No)}function Go(e,t,n,r,a){if(Ns(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ko(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ko(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),qo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),qo(e,t,a)}catch(n){Yo(e,t,n)}}function qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Jo(e,t,n)},function(n){return Yo(e,t,n)}):Jo(e,t,n)}function Jo(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ko(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(Ai){var n=Ll.formState;if(n!==null){a:{var r=so;if(Ai){if(ki){b:{for(var i=ki,a=Mi;i.nodeType!==8;){if(!a){i=null;break b}if(i=pf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ki=pf(i.nextSibling),r=i.data===`F!`;break a}}Pi(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=As.bind(null,so,r),r.dispatch=n,r=Uo(!1),a=Ms.bind(null,so,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Go.bind(null,so,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Oo(),co,e)}function es(e,t,n){if(t=Fo(e,t,Zo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===ga?va:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(so.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Oo(),n=co;if(n!==null)return es(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=so.updateQueue,t===null&&(t=ko(),so.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function is(){return Oo().memoizedState}function as(e,t,n,r){var i=Do();so.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;co!==null&&r!==null&&yo(r,co.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(so.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){so.flags|=4;var t=so.updateQueue;if(t===null)t=ko(),so.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=Oo().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(J&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){Ae(!0);try{e()}finally{Ae(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||oo&1073741824&&!(zl&261930)?e.memoizedState=t:(e.memoizedState=n,e=gu(),so.lanes|=e,ql|=e,n)}function ys(e,t,n,r){return gr(n,t)?n:Ka.current===null?!(oo&42)||oo&1073741824&&!(zl&261930)?(tc=!0,e.memoizedState=n):(e=gu(),so.lanes|=e,ql|=e,t):(e=vs(e,n,r),gr(e,t)||(tc=!0),e)}function bs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,Ms(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,ua(c,r),hu(e)):js(e,t,r,hu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},hu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Cs(e).queue;bs(e,a,t,F,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},hu())}function Ts(){return Yi(tp)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=hu();e=La(n);var r=Ra(t,e,n);r!==null&&(_u(r,t,n),za(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=hu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=Zr(e,t,n,r),n!==null&&(_u(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,hu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,gr(s,o))return Xr(e,t,i,0),Ll===null&&Yr(),!1}catch{}if(n=Zr(e,t,i,r),n!==null)return _u(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:md(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(i(479))}else t=Zr(e,n,r,2),t!==null&&_u(t,e,2)}function Ns(e){var t=e.alternate;return e===so||t!==null&&t===so}function Ps(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}var Is={readContext:Yi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Is.useEffectEvent=vo;var Ls={readContext:Yi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){Ae(!0);try{e()}finally{Ae(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){Ae(!0);try{n(t)}finally{Ae(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ks.bind(null,so,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,so,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,so,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=so,a=Do();if(Ai){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ll===null)throw Error(i(349));zl&127||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=Ll.identifierPrefix;if(Ai){var n=Si,r=xi;n=(r&~(1<<32-je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ms.bind(null,so,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Os.bind(null,so)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(J&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Rs={readContext:Yi,use:jo,useCallback:gs,useContext:Yi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Po,useRef:is,useState:function(){return Po(No)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(Oo(),co.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Wo(Oo(),co,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};Rs.useEffectEvent=us;var zs={readContext:Yi,use:jo,useCallback:gs,useContext:Yi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Io,useRef:is,useState:function(){return Io(No)},useDebugValue:hs,useDeferredValue:function(e,t){var n=Oo();return co===null?vs(n,e,t):ys(n,co.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Oo();return co===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,co,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};zs.useEffectEvent=us;function Bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=hu(),i=La(r);i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(_u(t,e,r),za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=hu(),i=La(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(_u(t,e,r),za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=hu(),r=La(n);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,n),t!==null&&(_u(t,e,n),za(t,e,n))}};function Hs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!_r(n,r)||!_r(i,a):!0}function Us(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Vs.enqueueReplaceState(t,t.state,null)}function Ws(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Gs(e){Gr(e)}function Ks(e){console.error(e)}function qs(e){Gr(e)}function Js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){Js(e,t)},n}function Zs(e){return e=La(e),e.tag=3,e}function Qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ys(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ys(t,n,r),typeof i!=`function`&&(au===null?au=new Set([this]):au.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function $s(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ki(t,n,a,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Qa===null?ku():n.alternate===null&&Kl===0&&(Kl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Ju(e,r,a)),!1;case 22:return n.flags|=65536,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Ju(e,r,a)),!1}throw Error(i(435,n.tag))}return Ju(e,r,a),ku(),!1}if(Ai)return t=Za.current,t===null?(r!==Ni&&(t=Error(i(423),{cause:r}),zi(pi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=pi(r,n),a=Xs(e.stateNode,r,a),Ba(e,a),Kl!==4&&(Kl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ni&&(e=Error(i(422),{cause:r}),zi(pi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=pi(o,n),Ql===null?Ql=[o]:Ql.push(o),Kl!==4&&(Kl=2),t===null)return!0;r=pi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Xs(n.stateNode,r,e),Ba(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(au===null||!au.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Zs(a),Qs(a,e,n,r),Ba(n,a),!1}n=n.return}while(n!==null);return!1}var ec=Error(i(461)),tc=!1;function nc(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function rc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ji(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(Ai&&s&&Ti(t),t.flags|=1,nc(e,t,r,i),t.child)}function ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ac(e,t,a,r,i)):(e=si(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Oc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?_r:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(_r(a,r)&&e.ref===t.ref)if(tc=!1,t.pendingProps=r=a,Oc(e,i))e.flags&131072&&(tc=!0);else return t.lanes=e.lanes,Dc(e,t,i)}return pc(e,t,n,r,i)}function oc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return cc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ma(t,a===null?null:a.cachePool),a===null?Ya():Ja(t,a),to(t);else return r=t.lanes=536870912,cc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ma(t,null),Ya(),no(t)):(ma(t,a.cachePool),Ja(t,a),no(t),t.memoizedState=null);return nc(e,t,i,n),t.child}function sc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cc(e,t,n,r,i){var a=pa();return a=a===null?null:{parent:ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ma(t,null),Ya(),to(t),e!==null&&Ki(e,t,r,!0),t.childLanes=i,null}function lc(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uc(e,t,n){return Ma(t,e.child,null,n),e=lc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function dc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Ai){if(r.mode===`hidden`)return e=lc(t,r),t.lanes=536870912,sc(null,e);if(eo(t),(e=ki)?(e=lf(e,Mi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Pi(t);return t.lanes=536870912,null}return lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(eo(t),a)if(t.flags&256)t.flags&=-257,t=uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(tc||Ki(e,t,n,!1),a=(n&e.childLanes)!==0,tc||a){if(r=Ll,r!==null&&(s=Je(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Qr(e,s),_u(r,e,s),ec;ku(),t=uc(e,t,n)}else e=o.treeContext,ki=pf(s.nextSibling),Oi=t,Ai=!0,ji=null,Mi=!1,e!==null&&Di(t,e),t=lc(t,r),t.flags|=4096;return t}return e=ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function pc(e,t,n,r,i){return Ji(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(Ai&&r&&Ti(t),t.flags|=1,nc(e,t,n,i),t.child)}function mc(e,t,n,r,i,a){return Ji(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!tc?(To(e,t,a),Dc(e,t,a)):(Ai&&r&&Ti(t),t.flags|=1,nc(e,t,n,a),t.child)}function hc(e,t,n,r,i){if(Ji(t),t.stateNode===null){var a=ti,o=n.contextType;typeof o==`object`&&o&&(a=Yi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Vs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Fa(t),o=n.contextType,a.context=typeof o==`object`&&o?Yi(o):ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Bs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Vs.enqueueReplaceState(a,a.state,null),Ua(t,r,a,i),Ha(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ws(n,s);a.props=c;var l=a.context,u=n.contextType;o=ti,typeof u==`object`&&u&&(o=Yi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Us(t,a,r,o),Pa=!1;var f=t.memoizedState;a.state=f,Ua(t,r,a,i),Ha(),l=t.memoizedState,s||f!==l||Pa?(typeof d==`function`&&(Bs(t,n,d,r),l=t.memoizedState),(c=Pa||Hs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ia(e,t),o=t.memoizedProps,u=Ws(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ti,typeof l==`object`&&l&&(c=Yi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Us(t,a,r,c),Pa=!1,f=t.memoizedState,a.state=f,Ua(t,r,a,i),Ha();var p=t.memoizedState;o!==d||f!==p||Pa||e!==null&&e.dependencies!==null&&qi(e.dependencies)?(typeof s==`function`&&(Bs(t,n,s,r),p=t.memoizedState),(u=Pa||Hs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&qi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,fc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ma(t,e.child,null,i),t.child=Ma(t,null,n,i)):nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function gc(e,t,n,r){return Li(),t.flags|=256,nc(e,t,n,r),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:ha()}}function yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Xl),e}function bc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(io.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Ai){if(a?$a(t):no(t),(e=ki)?(e=lf(e,Mi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Pi(t);return df(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(no(t),a=t.mode,c=Sc({mode:`hidden`,children:c},a),r=ci(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(null,r)):($a(t),xc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?($a(t),t.flags&=-257,t=Cc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,a=t.mode,r=Sc({mode:`visible`,children:r.children},a),c=ci(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ma(t,e.child,null,n),r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,t=sc(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),df(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,zi({value:r,source:null,stack:null}),t=Cc(e,t,n)}else if(tc||Ki(e,t,n,!1),s=(n&e.childLanes)!==0,tc||s){if(s=Ll,s!==null&&(r=Je(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Qr(e,r),_u(s,e,r),ec;uf(c)||ku(),t=Cc(e,t,n)}else uf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ki=pf(c.nextSibling),Oi=t,Ai=!0,ji=null,Mi=!1,e!==null&&Di(t,e),t=xc(t,r.children),t.flags|=4096);return t}return a?(no(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ai(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ci(c,a,n,null),c.flags|=2):c=ai(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,sc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=vc(n):(a=c.cachePool,a===null?a=ha():(l=ta._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(e.child,r)):($a(t),n=e.child,e=n.sibling,n=ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function xc(e,t){return t=Sc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=ri(22,e,null,t),e.lanes=0,e}function Cc(e,t,n){return Ma(t,e.child,null,n),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,n)}function Tc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,z(io,o),nc(e,t,r,n),r=Ai?_i:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ao(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ao(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tc(t,!0,n,null,a,r);break;case`together`:Tc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ql|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ki(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&qi(e))):!0}function kc(e,t,n){switch(t.tag){case 3:V(t,t.stateNode.containerInfo),Hi(t,ta,e.memoizedState.cache),Li();break;case 27:case 5:ae(t);break;case 4:V(t,t.stateNode.containerInfo);break;case 10:Hi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($a(t),e=Dc(e,t,n),e===null?null:e.sibling):bc(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ki(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),z(io,io.current),r)break;return null;case 22:return t.lanes=0,oc(e,t,n,t.pendingProps);case 24:Hi(t,ta,e.memoizedState.cache)}return Dc(e,t,n)}function Ac(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)tc=!0;else{if(!Oc(e,n)&&!(t.flags&128))return tc=!1,kc(e,t,n);tc=!!(e.flags&131072)}else tc=!1,Ai&&t.flags&1048576&&wi(t,_i,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Sa(t.elementType),t.type=e,typeof e==`function`)ii(e)?(r=Ws(e,r),t.tag=1,t=hc(null,t,e,r,n)):(t.tag=0,t=pc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=rc(null,t,e,r,n);break a}else if(a===w){t.tag=14,t=ic(null,t,e,r,n);break a}}throw t=j(e)||e,Error(i(306,t,``))}}return t;case 0:return pc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ws(r,t.pendingProps),hc(e,t,r,a,n);case 3:a:{if(V(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ia(e,t),Ua(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Hi(t,ta,r),r!==o.cache&&Gi(t,[ta],n,!0),Ha(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=gc(e,t,r,n);break a}else if(r!==a){a=pi(Error(i(424)),t),zi(a),t=gc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ki=pf(e.firstChild),Oi=t,Ai=!0,ji=null,Mi=!0,n=Na(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Li(),r===a){t=Dc(e,t,n);break a}nc(e,t,r,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=Nf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ai||(n=t.type,e=t.pendingProps,r=Gd(ne.current).createElement(n),r[et]=t,r[tt]=e,zd(r,n,e),pt(r),t.stateNode=r):t.memoizedState=Nf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ae(t),e===null&&Ai&&(r=t.stateNode=_f(t.type,t.pendingProps,ne.current),Oi=t,Mi=!0,a=ki,nf(t.type)?(mf=a,ki=pf(r.firstChild)):ki=a),nc(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ai&&((a=r=ki)&&(r=sf(r,t.type,t.pendingProps,Mi),r===null?a=!1:(t.stateNode=r,Oi=t,ki=pf(r.firstChild),Mi=!1,a=!0)),a||Pi(t)),ae(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Jd(a,o)?r=null:s!==null&&Jd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=bo(e,t,Co,null,null,n),tp._currentValue=a),fc(e,t),nc(e,t,r,n),t.child;case 6:return e===null&&Ai&&((e=n=ki)&&(n=cf(n,t.pendingProps,Mi),n===null?e=!1:(t.stateNode=n,Oi=t,ki=null,e=!0)),e||Pi(t)),null;case 13:return bc(e,t,n);case 4:return V(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):nc(e,t,r,n),t.child;case 11:return rc(e,t,t.type,t.pendingProps,n);case 7:return nc(e,t,t.pendingProps,n),t.child;case 8:return nc(e,t,t.pendingProps.children,n),t.child;case 12:return nc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Hi(t,t.type,r.value),nc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ji(t),a=Yi(a),r=r(a),t.flags|=1,nc(e,t,r,n),t.child;case 14:return ic(e,t,t.type,t.pendingProps,n);case 15:return ac(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return dc(e,t,n);case 22:return oc(e,t,n,t.pendingProps);case 24:return Ji(t),r=Yi(ta),e===null?(a=pa(),a===null&&(a=Ll,o=na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Fa(t),Hi(t,ta,a)):((e.lanes&n)!==0&&(Ia(e,t),Ua(t,null,null,n),Ha()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Hi(t,ta,r),r!==a.cache&&Gi(t,[ta],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Hi(t,ta,r))),nc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function jc(e){e.flags|=4}function Mc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Eu())e.flags|=8192;else throw Ca=ya,_a}else e.flags&=-16777217}function Nc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Jf(t))if(Eu())e.flags|=8192;else throw Ca=ya,_a}function Pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:He(),e.lanes|=t,Zl|=t)}function Fc(e,t){if(!Ai)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ic(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lc(e,t,n){var r=t.pendingProps;switch(Ei(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ic(t),null;case 1:return Ic(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ui(ta),ie(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(W(t)?jc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ri())),Ic(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(jc(t),o===null?(Ic(t),Mc(t,a,null,r,n)):(Ic(t),Nc(t,o))):o?o===e.memoizedState?(Ic(t),t.flags&=-16777217):(jc(t),Ic(t),Nc(t,o)):(e=e.memoizedProps,e!==r&&jc(t),Ic(t),Mc(t,a,e,r,n)),null;case 27:if(oe(t),n=ne.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}e=B.current,W(t)?Fi(t,e):(e=_f(a,r,n),t.stateNode=e,jc(t))}return Ic(t),null;case 5:if(oe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}if(o=B.current,W(t))Fi(t,o);else{var s=Gd(ne.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[et]=t,o[tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(zd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ne.current,W(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Oi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[et]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Id(e.nodeValue,n)),e||Pi(t,!0)}else e=Gd(e).createTextNode(r),e[et]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=W(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[et]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ro(t),t):(ro(t),null);if(t.flags&128)throw Error(i(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=W(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[et]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),a=!1}else a=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ro(t),t):(ro(t),null)}return ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return ie(),e===null&&Ed(t.stateNode.containerInfo),Ic(t),null;case 10:return Ui(t.type),Ic(t),null;case 19:if(R(io),r=t.memoizedState,r===null)return Ic(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Fc(r,!1);else{if(Kl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oi(n,e),n=n.sibling;return z(io,io.current&1|2),Ai&&Ci(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ye()>ru&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304)}else{if(!a)if(e=ao(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ai)return Ic(t),null}else 2*ye()-r.renderingStartTime>ru&&n!==536870912&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ye(),e.sibling=null,n=io.current,z(io,a?n&1|2:n&1),Ai&&Ci(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&R(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ta),Ic(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Rc(e,t){switch(Ei(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),ie(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return oe(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(io),null;case 4:return ie(),null;case 10:return Ui(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&R(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(ta),null;case 25:return null;default:return null}}function zc(e,t){switch(Ei(t),t.tag){case 3:Ui(ta),ie();break;case 26:case 27:case 5:oe(t);break;case 4:ie();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:R(io);break;case 10:Ui(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&R(fa);break;case 24:Ui(ta)}}function Bc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){qu(t,t.return,e)}}function Vc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){qu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){qu(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){qu(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){qu(e,t,n)}}function Wc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){qu(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){qu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){qu(e,t,n)}else n.current=null}function Kc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){qu(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Bd(r,e.type,n,t),r[tt]=t}catch(t){qu(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&nf(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&nf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=qt));else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zd(t,r,n),t[et]=e,t[tt]=n}catch(t){qu(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Ud=up,e=xr(e),Sr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Wd={focusedElem:e,selectionRange:n},up=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ws(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){qu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)of(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:of(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,rl=e;break}rl=t.return}}function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Bc(5,n);break;case 1:if(bl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){qu(n,n.return,e)}else{var i=Ws(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){qu(n,n.return,e)}}r&64&&Hc(n),r&512&&Wc(n,n.return);break;case 3:if(bl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ga(e,t)}catch(e){qu(n,n.return,e)}}break;case 27:t===null&&r&4&&Qc(n);case 26:case 5:bl(e,n),t===null&&r&4&&Kc(n),r&512&&Wc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&dl(e,n);break;case 13:bl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Zu.bind(null,n),ff(e,n))));break;case 22:if(r=n.memoizedState!==null||$c,!r){t=t!==null&&t.memoizedState!==null||el,i=$c;var a=el;$c=r,(el=t)&&!a?Sl(e,n,(n.subtreeFlags&8772)!=0):bl(e,n),$c=i,el=a}break;case 30:break;default:bl(e,n)}}function ol(e){var t=e.alternate;t!==null&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ct(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var sl=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(ke&&typeof ke.onCommitFiberUnmount==`function`)try{ke.onCommitFiberUnmount(Oe,n)}catch{}switch(n.tag){case 26:el||Gc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:el||Gc(n,t);var r=sl,i=cl;nf(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),vf(n.stateNode),sl=r,cl=i;break;case 5:el||Gc(n,t);case 6:if(r=sl,i=cl,sl=null,ll(e,t,n),sl=r,cl=i,sl!==null)if(cl)try{(sl.nodeType===9?sl.body:sl.nodeName===`HTML`?sl.ownerDocument.body:sl).removeChild(n.stateNode)}catch(e){qu(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){qu(n,t,e)}break;case 18:sl!==null&&(cl?(e=sl,rf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Ip(e)):rf(sl,n.stateNode));break;case 4:r=sl,i=cl,sl=n.stateNode.containerInfo,cl=!0,ll(e,t,n),sl=r,cl=i;break;case 0:case 11:case 14:case 15:Vc(2,n,t),el||Vc(4,n,t),ll(e,t,n);break;case 1:el||(Gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Uc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:el=(r=el)||n.memoizedState!==null,ll(e,t,n),el=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ip(e)}catch(e){qu(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ip(e)}catch(e){qu(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nl),t;default:throw Error(i(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Qu.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(nf(c.type)){sl=c.stateNode,cl=!1;break a}break;case 5:sl=c.stateNode,cl=!1;break a;case 3:case 4:sl=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(sl===null)throw Error(i(160));ul(o,s,a),sl=null,cl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Vc(3,e,e.return),Bc(3,e),Vc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&64&&$c&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[st]||o[et]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),zd(o,r,n),o[et]=e,pt(o),r=o;break a;case`link`:var s=Gf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Gf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[et]=e,pt(o),r=o}e.stateNode=r}else Kf(a,e.type,e.stateNode);else e.stateNode=Bf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Kf(a,e.type,e.stateNode):Bf(a,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),n!==null&&r&4&&qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),e.flags&32){a=e.stateNode;try{zt(a,``)}catch(t){qu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){qu(e,e.return,t)}}break;case 3:if(Wf=null,a=gl,gl=xf(t.containerInfo),hl(t,e),gl=a,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ip(t.containerInfo)}catch(t){qu(e,e.return,t)}tl&&(tl=!1,yl(e));break;case 4:r=gl,gl=xf(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(tu=ye()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=$c,d=el;if($c=u||a,el=d||l,hl(t,e),el=d,$c=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||$c||el||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){qu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){qu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?af(m,!0):af(l.stateNode,!1)}catch(e){qu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Zc(e,Yc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(zt(o,``),n.flags&=-33),Zc(e,Yc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Xc(e,Yc(e),s);break;default:throw Error(i(161))}}catch(t){qu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)al(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vc(4,t,t.return),xl(t);break;case 1:Gc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Uc(t,t.return,n),xl(t);break;case 27:vf(t.stateNode);case 26:case 5:Gc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Bc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){qu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Wa(c[i],s)}catch(e){qu(r,r.return,e)}}n&&o&64&&Hc(a),Wc(a,a.return);break;case 27:Qc(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&Kc(a),Wc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&dl(i,a);break;case 13:Sl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Wc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function K(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ra(n))}function Cl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e))}function wl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tl(e,t,n,r),t=t.sibling}function Tl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:wl(e,t,n,r),i&2048&&Bc(9,t);break;case 1:wl(e,t,n,r);break;case 3:wl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e)));break;case 12:if(i&2048){wl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){qu(t,t.return,e)}}else wl(e,t,n,r);break;case 31:wl(e,t,n,r);break;case 13:wl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?wl(e,t,n,r):(a._visibility|=2,El(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?wl(e,t,n,r):Dl(e,t),i&2048&&K(o,t);break;case 24:wl(e,t,n,r),i&2048&&Cl(t.alternate,t);break;default:wl(e,t,n,r)}}function El(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:El(a,o,s,c,i),Bc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,El(a,o,s,c,i)):u._visibility&2?El(a,o,s,c,i):Dl(a,o),i&&l&2048&&K(o.alternate,o);break;case 24:El(a,o,s,c,i),i&&l&2048&&Cl(o.alternate,o);break;default:El(a,o,s,c,i)}t=t.sibling}}function Dl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Dl(n,r),i&2048&&K(r.alternate,r);break;case 24:Dl(n,r),i&2048&&Cl(r.alternate,r);break;default:Dl(n,r)}t=t.sibling}}var Ol=8192;function kl(e,t,n){if(e.subtreeFlags&Ol)for(e=e.child;e!==null;)Al(e,t,n),e=e.sibling}function Al(e,t,n){switch(e.tag){case 26:kl(e,t,n),e.flags&Ol&&e.memoizedState!==null&&Yf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:kl(e,t,n);break;case 3:case 4:var r=gl;gl=xf(e.stateNode.containerInfo),kl(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ol,Ol=16777216,kl(e,t,n),Ol=r):kl(e,t,n));break;default:kl(e,t,n)}}function jl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,q(r,e)}jl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nl(e),e=e.sibling}function Nl(e){switch(e.tag){case 0:case 11:case 15:Ml(e),e.flags&2048&&Vc(9,e,e.return);break;case 3:Ml(e);break;case 12:Ml(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pl(e)):Ml(e);break;default:Ml(e)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,q(r,e)}jl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vc(8,t,t.return),Pl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pl(t));break;default:Pl(t)}e=e.sibling}}function q(e,t){for(;rl!==null;){var n=rl;switch(n.tag){case 0:case 11:case 15:Vc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,rl=r;else a:for(n=e;rl!==null;){r=rl;var i=r.sibling,a=r.return;if(ol(r),r===n){rl=null;break a}if(i!==null){i.return=a,rl=i;break a}rl=a}}}var Fl={getCacheForType:function(e){var t=Yi(ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Yi(ta).controller.signal}},Il=typeof WeakMap==`function`?WeakMap:Map,J=0,Ll=null,Rl=null,zl=0,Bl=0,Vl=null,Hl=!1,Ul=!1,Wl=!1,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=null,$l=null,eu=!1,tu=0,nu=0,ru=1/0,iu=null,au=null,ou=0,su=null,cu=null,lu=0,uu=0,du=null,fu=null,pu=0,mu=null;function hu(){return J&2&&zl!==0?zl&-zl:N.T===null?Ze():md()}function gu(){if(Xl===0)if(!(zl&536870912)||Ai){var e=Ie;Ie<<=1,!(Ie&3932160)&&(Ie=262144),Xl=e}else Xl=536870912;return e=Za.current,e!==null&&(e.flags|=32),Xl}function _u(e,t,n){(e===Ll&&(Bl===2||Bl===9)||e.cancelPendingCommit!==null)&&(wu(e,0),xu(e,zl,Xl,!1)),We(e,n),(!(J&2)||e!==Ll)&&(e===Ll&&(!(J&2)&&(Jl|=n),Kl===4&&xu(e,zl,Xl,!1)),od(e))}function vu(e,t,n){if(J&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Be(e,t),a=r?Mu(e,t):Au(e,t,!0),o=r;do{if(a===0){Ul&&!r&&xu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!bu(n)){a=Au(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Ql;var l=c.current.memoizedState.isDehydrated;if(l&&(wu(c,s).flags|=256),s=Au(c,s,!1),s!==2){if(Wl&&!l){c.errorRecoveryDisabledLanes|=o,Jl|=o,a=4;break a}o=$l,$l=a,o!==null&&($l===null?$l=o:$l.push.apply($l,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){wu(e,0),xu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:xu(r,t,Xl,!Hl);break a;case 2:$l=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=tu+300-ye(),10<a)){if(xu(r,t,Xl,!Hl),ze(r,0,!0)!==0)break a;lu=t,r.timeoutHandle=Zd(yu.bind(null,r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,`Throttled`,-0,0),a);break a}yu(r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,null,-0,0)}}break}while(1);od(e)}function yu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qt},Al(t,a,d);var m=(a&62914560)===a?tu-ye():(a&4194048)===a?nu-ye():0;if(m=Zf(d,m),m!==null){lu=a,e.cancelPendingCommit=m(zu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),xu(e,a,o,!l);return}}zu(e,t,a,n,r,i,o,s,c)}function bu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!gr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xu(e,t,n,r){t&=~Yl,t&=~Jl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-je(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ke(e,n,t)}function Su(){return J&6?!0:(sd(0,!1),!1)}function Cu(){if(Rl!==null){if(Bl===0)var e=Rl.return;else e=Rl,G=Vi=null,Eo(e),Ea=null,Da=0,e=Rl;for(;e!==null;)zc(e.alternate,e),e=e.return;Rl=null}}function wu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),lu=0,Cu(),Ll=e,Rl=n=ai(e.current,null),zl=t,Bl=0,Vl=null,Hl=!1,Ul=Be(e,t),Wl=!1,Zl=Xl=Yl=Jl=ql=Kl=0,$l=Ql=null,eu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-je(r),a=1<<i;t|=e[i],r&=~a}return Gl=t,Yr(),n}function Tu(e,t){so=null,N.H=Is,t===ga||t===va?(t=wa(),Bl=3):t===_a?(t=wa(),Bl=4):Bl=t===ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Vl=t,Rl===null&&(Kl=1,Js(e,pi(t,e.current)))}function Eu(){var e=Za.current;return e===null?!0:(zl&4194048)===zl?Qa===null:(zl&62914560)===zl||zl&536870912?e===Qa:!1}function Du(){var e=N.H;return N.H=Is,e===null?Is:e}function Ou(){var e=N.A;return N.A=Fl,e}function ku(){Kl=4,Hl||(zl&4194048)!==zl&&Za.current!==null||(Ul=!0),!(ql&134217727)&&!(Jl&134217727)||Ll===null||xu(Ll,zl,Xl,!1)}function Au(e,t,n){var r=J;J|=2;var i=Du(),a=Ou();(Ll!==e||zl!==t)&&(iu=null,wu(e,t)),t=!1;var o=Kl;a:do try{if(Bl!==0&&Rl!==null){var s=Rl,c=Vl;switch(Bl){case 8:Cu(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=Bl;if(Bl=0,Vl=null,Iu(e,s,c,l),n&&Ul){o=0;break a}break;default:l=Bl,Bl=0,Vl=null,Iu(e,s,c,l)}}ju(),o=Kl;break}catch(t){Tu(e,t)}while(1);return t&&e.shellSuspendCounter++,G=Vi=null,J=r,N.H=i,N.A=a,Rl===null&&(Ll=null,zl=0,Yr()),o}function ju(){for(;Rl!==null;)Pu(Rl)}function Mu(e,t){var n=J;J|=2;var r=Du(),a=Ou();Ll!==e||zl!==t?(iu=null,ru=ye()+500,wu(e,t)):Ul=Be(e,t);a:do try{if(Bl!==0&&Rl!==null){t=Rl;var o=Vl;b:switch(Bl){case 1:Bl=0,Vl=null,Iu(e,t,o,1);break;case 2:case 9:if(ba(o)){Bl=0,Vl=null,Fu(t);break}t=function(){Bl!==2&&Bl!==9||Ll!==e||(Bl=7),od(e)},o.then(t,t);break a;case 3:Bl=7;break a;case 4:Bl=5;break a;case 7:ba(o)?(Bl=0,Vl=null,Fu(t)):(Bl=0,Vl=null,Iu(e,t,o,7));break;case 5:var s=null;switch(Rl.tag){case 26:s=Rl.memoizedState;case 5:case 27:var c=Rl;if(s?Jf(s):c.stateNode.complete){Bl=0,Vl=null;var l=c.sibling;if(l!==null)Rl=l;else{var u=c.return;u===null?Rl=null:(Rl=u,Lu(u))}break b}}Bl=0,Vl=null,Iu(e,t,o,5);break;case 6:Bl=0,Vl=null,Iu(e,t,o,6);break;case 8:Cu(),Kl=6;break a;default:throw Error(i(462))}}Nu();break}catch(t){Tu(e,t)}while(1);return G=Vi=null,N.H=r,N.A=a,J=n,Rl===null?(Ll=null,zl=0,Yr(),Kl):0}function Nu(){for(;Rl!==null&&!_e();)Pu(Rl)}function Pu(e){var t=Ac(e.alternate,e,Gl);e.memoizedProps=e.pendingProps,t===null?Lu(e):Rl=t}function Fu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mc(n,t,t.pendingProps,t.type,void 0,zl);break;case 11:t=mc(n,t,t.pendingProps,t.type.render,t.ref,zl);break;case 5:Eo(t);default:zc(n,t),t=Rl=oi(t,Gl),t=Ac(n,t,Gl)}e.memoizedProps=e.pendingProps,t===null?Lu(e):Rl=t}function Iu(e,t,n,r){G=Vi=null,Eo(t),Ea=null,Da=0;var i=t.return;try{if($s(e,i,t,n,zl)){Kl=1,Js(e,pi(n,e.current)),Rl=null;return}}catch(t){if(i!==null)throw Rl=i,t;Kl=1,Js(e,pi(n,e.current)),Rl=null;return}t.flags&32768?(Ai||r===1?e=!0:Ul||zl&536870912?e=!1:(Hl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ru(t,e)):Lu(t)}function Lu(e){var t=e;do{if(t.flags&32768){Ru(t,Hl);return}e=t.return;var n=Lc(t.alternate,t,Gl);if(n!==null){Rl=n;return}if(t=t.sibling,t!==null){Rl=t;return}Rl=t=e}while(t!==null);Kl===0&&(Kl=5)}function Ru(e,t){do{var n=Rc(e.alternate,e);if(n!==null){n.flags&=32767,Rl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Rl=e;return}Rl=e=n}while(e!==null);Kl=6,Rl=null}function zu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Wu();while(ou!==0);if(J&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Jr,Ge(e,n,o,s,c,l),e===Ll&&(Rl=Ll=null,zl=0),cu=t,su=e,lu=n,uu=o,du=a,fu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,$u(Ce,function(){return Gu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=J,J|=4;try{il(e,t,n)}finally{J=s,P.p=a,N.T=r}}ou=1,Bu(),Vu(),Hu()}}function Bu(){if(ou===1){ou=0;var e=su,t=cu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=J;J|=4;try{_l(t,e);var a=Wd,o=xr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&br(s.ownerDocument.documentElement,s)){if(c!==null&&Sr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=yr(s,h),v=yr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}up=!!Ud,Wd=Ud=null}finally{J=i,P.p=r,N.T=n}}e.current=t,ou=2}}function Vu(){if(ou===2){ou=0;var e=su,t=cu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=J;J|=4;try{al(e,t.alternate,t)}finally{J=i,P.p=r,N.T=n}}ou=3}}function Hu(){if(ou===4||ou===3){ou=0,ve();var e=su,t=cu,n=lu,r=fu;t.subtreeFlags&10256||t.flags&10256?ou=5:(ou=0,cu=su=null,Uu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(au=null),Xe(n),t=t.stateNode,ke&&typeof ke.onCommitFiberRoot==`function`)try{ke.onCommitFiberRoot(Oe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}lu&3&&Wu(),od(e),i=e.pendingLanes,n&261930&&i&42?e===mu?pu++:(pu=0,mu=e):pu=0,sd(0,!1)}}function Uu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Wu(){return Bu(),Vu(),Hu(),Gu()}function Gu(){if(ou!==5)return!1;var e=su,t=uu;uu=0;var n=Xe(lu),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=du,du=null;var o=su,s=lu;if(ou=0,cu=su=null,lu=0,J&6)throw Error(i(331));var c=J;if(J|=4,Nl(o.current),Tl(o,o.current,s,n),J=c,sd(0,!1),ke&&typeof ke.onPostCommitFiberRoot==`function`)try{ke.onPostCommitFiberRoot(Oe,o)}catch{}return!0}finally{P.p=a,N.T=r,Uu(e,t)}}function Ku(e,t,n){t=pi(n,t),t=Xs(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(We(e,2),od(e))}function qu(e,t,n){if(e.tag===3)Ku(e,e,n);else for(;t!==null;){if(t.tag===3){Ku(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(au===null||!au.has(r))){e=pi(n,e),n=Zs(2),r=Ra(t,n,2),r!==null&&(Qs(n,r,t,e),We(r,2),od(r));break}}t=t.return}}function Ju(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Il;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Wl=!0,i.add(n),e=Yu.bind(null,e,t,n),t.then(e,e))}function Yu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ll===e&&(zl&n)===n&&(Kl===4||Kl===3&&(zl&62914560)===zl&&300>ye()-tu?!(J&2)&&wu(e,0):Yl|=n,Zl===zl&&(Zl=0)),od(e)}function Xu(e,t){t===0&&(t=He()),e=Qr(e,t),e!==null&&(We(e,t),od(e))}function Zu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xu(e,n)}function Qu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Xu(e,n)}function $u(e,t){return he(e,t)}var ed=null,td=null,nd=!1,rd=!1,id=!1,ad=0;function od(e){e!==td&&e.next===null&&(td===null?ed=td=e:td=td.next=e),rd=!0,nd||(nd=!0,pd())}function sd(e,t){if(!id&&rd){id=!0;do for(var n=!1,r=ed;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-je(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,fd(r,a))}else a=zl,a=ze(r,r===Ll?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Be(r,a)||(n=!0,fd(r,a));r=r.next}while(n);id=!1}}function cd(){ld()}function ld(){rd=nd=!1;var e=0;ad!==0&&Xd()&&(e=ad);for(var t=ye(),n=null,r=ed;r!==null;){var i=r.next,a=ud(r,t);a===0?(r.next=null,n===null?ed=i:n.next=i,i===null&&(td=n)):(n=r,(e!==0||a&3)&&(rd=!0)),r=i}ou!==0&&ou!==5||sd(e,!1),ad!==0&&(ad=0)}function ud(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-je(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ve(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ll,n=zl,n=ze(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Bl===2||Bl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ge(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Be(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ge(r),Xe(n)){case 2:case 8:n=Se;break;case 32:n=Ce;break;case 268435456:n=Te;break;default:n=Ce}return r=dd.bind(null,e),n=he(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ge(r),e.callbackPriority=2,e.callbackNode=null,2}function dd(e,t){if(ou!==0&&ou!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Wu()&&e.callbackNode!==n)return null;var r=zl;return r=ze(e,e===Ll?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(vu(e,r,t),ud(e,ye()),e.callbackNode!=null&&e.callbackNode===n?dd.bind(null,e):null)}function fd(e,t){if(Wu())return null;vu(e,t,!0)}function pd(){ef(function(){J&6?he(xe,cd):ld()})}function md(){if(ad===0){var e=oa;e===0&&(e=Fe,Fe<<=1,!(Fe&261888)&&(Fe=256)),ad=e}return ad}function hd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Kt(``+e)}function gd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function _d(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=hd((i[tt]||null).action),o=r.submitter;o&&(t=(t=o[tt]||null)?hd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new U(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ad!==0){var e=o?gd(i,o):new FormData(i);Ss(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?gd(i,o):new FormData(i),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var vd=0;vd<Ur.length;vd++){var yd=Ur[vd];Wr(yd.toLowerCase(),`on`+(yd[0].toUpperCase()+yd.slice(1)))}Wr(Fr,`onAnimationEnd`),Wr(Ir,`onAnimationIteration`),Wr(Lr,`onAnimationStart`),Wr(`dblclick`,`onDoubleClick`),Wr(`focusin`,`onFocus`),Wr(`focusout`,`onBlur`),Wr(Rr,`onTransitionRun`),Wr(zr,`onTransitionStart`),Wr(Br,`onTransitionCancel`),Wr(Vr,`onTransitionEnd`),_t(`onMouseEnter`,[`mouseout`,`mouseover`]),_t(`onMouseLeave`,[`mouseout`,`mouseover`]),_t(`onPointerEnter`,[`pointerout`,`pointerover`]),_t(`onPointerLeave`,[`pointerout`,`pointerover`]),gt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),gt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),gt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),gt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var bd=`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(` `),xd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(bd));function Sd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}}}}function Cd(e,t){var n=t[rt];n===void 0&&(n=t[rt]=new Set);var r=e+`__bubble`;n.has(r)||(Dd(t,e,2,!1),n.add(r))}function wd(e,t,n){var r=0;t&&(r|=4),Dd(n,e,r,t)}var Td=`_reactListening`+Math.random().toString(36).slice(2);function Ed(e){if(!e[Td]){e[Td]=!0,mt.forEach(function(t){t!==`selectionchange`&&(xd.has(t)||wd(t,!1,e),wd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Td]||(t[Td]=!0,wd(`selectionchange`,!1,t))}}function Dd(e,t,n,r){switch(_p(t)){case 2:var i=dp;break;case 8:i=fp;break;default:i=pp}n=i.bind(null,t,n,e),i=void 0,!rn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Od(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=lt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}en(function(){var r=a,i=Yt(n),s=[];a:{var c=Hr.get(e);if(c!==void 0){var l=U,u=e;switch(e){case`keypress`:if(un(n)===0)break a;case`keydown`:case`keyup`:l=Mn;break;case`focusin`:u=`focus`,l=Cn;break;case`focusout`:u=`blur`,l=Cn;break;case`beforeblur`:case`afterblur`:l=Cn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=xn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Sn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Pn;break;case Fr:case Ir:case Lr:l=wn;break;case Vr:l=Fn;break;case`scroll`:case`scrollend`:l=gn;break;case`wheel`:l=In;break;case`copy`:case`cut`:case`paste`:l=Tn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Nn;break;case`toggle`:case`beforetoggle`:l=Ln}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=tn(m,p),g!=null&&d.push(kd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Jt&&(u=n.relatedTarget||n.fromElement)&&(lt(u)||u[nt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?lt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=xn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Nn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:dt(l),h=u==null?c:dt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,lt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=jd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Md(s,c,l,d,!1),u!==null&&f!==null&&Md(s,f,u,d,!0)}}a:{if(c=r?dt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ir;else if(Qn(c))if(ar)v=mr;else{v=fr;var y=dr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Ut(r.elementType)&&(v=ir):v=pr;if(v&&=v(e,r)){$n(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ft(c,`number`,c.value)}switch(y=r?dt(r):window,e){case`focusin`:(Qn(y)||y.contentEditable===`true`)&&(wr=y,Tr=r,Er=null);break;case`focusout`:Er=Tr=wr=null;break;case`mousedown`:Dr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Dr=!1,Or(s,n,i);break;case`selectionchange`:if(Cr)break;case`keydown`:case`keyup`:Or(s,n,i)}var b;if(zn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Jn?Kn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Hn&&n.locale!==`ko`&&(Jn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Jn&&(b=H()):(on=i,sn=`value`in on?on.value:on.textContent,Jn=!0)),y=Ad(r,x),0<y.length&&(x=new En(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=qn(n),b!==null&&(x.data=b)))),(b=Vn?Yn(e,n):Xn(e,n))&&(x=Ad(r,`onBeforeInput`),0<x.length&&(y=new En(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),_d(s,e,r,n,i)}Sd(s,t)})}function kd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ad(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=tn(e,n),i!=null&&r.unshift(kd(e,i,a)),i=tn(e,t),i!=null&&r.push(kd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function jd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Md(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=tn(n,a),l!=null&&o.unshift(kd(n,l,c))):i||(l=tn(n,a),l!=null&&o.push(kd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Nd=/\r\n?/g,Pd=/\u0000|\uFFFD/g;function Fd(e){return(typeof e==`string`?e:``+e).replace(Nd,`
`).replace(Pd,``)}function Id(e,t){return t=Fd(t),Fd(e)===t}function Ld(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&zt(e,``+r);break;case`className`:Ct(e,`class`,r);break;case`tabIndex`:Ct(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ct(e,n,r);break;case`style`:Ht(e,r,o);break;case`data`:if(t!==`object`){Ct(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Kt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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 o==`function`&&(n===`formAction`?(t!==`input`&&Ld(e,t,`name`,a.name,a,null),Ld(e,t,`formEncType`,a.formEncType,a,null),Ld(e,t,`formMethod`,a.formMethod,a,null),Ld(e,t,`formTarget`,a.formTarget,a,null)):(Ld(e,t,`encType`,a.encType,a,null),Ld(e,t,`method`,a.method,a,null),Ld(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Kt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`onScroll`:r!=null&&Cd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Cd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Kt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Cd(`beforetoggle`,e),Cd(`toggle`,e),St(e,`popover`,r);break;case`xlinkActuate`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:St(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Wt.get(n)||n,St(e,n,r))}}function Rd(e,t,n,r,a,o){switch(n){case`style`:Ht(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&zt(e,``+r);break;case`onScroll`:r!=null&&Cd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Cd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ht.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[tt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):St(e,n,r)}}}function zd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Cd(`error`,e),Cd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,o,s,n,null)}}a&&Ld(e,t,`srcSet`,n.srcSet,n,null),r&&Ld(e,t,`src`,n.src,n,null);return;case`input`:Cd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Ld(e,t,r,d,n,null)}}Pt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Cd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Ld(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&It(e,!!r,n,!0):It(e,!!r,t,!1);return;case`textarea`:for(s in Cd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Ld(e,t,s,c,n,null)}Rt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Ld(e,t,l,r,n,null)}return;case`dialog`:Cd(`beforetoggle`,e),Cd(`toggle`,e),Cd(`cancel`,e),Cd(`close`,e);break;case`iframe`:case`object`:Cd(`load`,e);break;case`video`:case`audio`:for(r=0;r<bd.length;r++)Cd(bd[r],e);break;case`image`:Cd(`error`,e),Cd(`load`,e);break;case`details`:Cd(`toggle`,e);break;case`embed`:case`source`:case`link`:Cd(`error`,e),Cd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,u,r,n,null)}return;default:if(Ut(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Rd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ld(e,t,c,r,n,null))}function Bd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Ld(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Ld(e,t,p,m,r,f)}}Nt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Ld(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Ld(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?It(e,!!n,n?[]:``,!1):It(e,!!n,t,!0)):It(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Ld(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Ld(e,t,s,a,r,o)}Lt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Ld(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Ld(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Ld(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Ld(e,t,u,p,r,m)}return;default:if(Ut(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Rd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Rd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ld(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Ld(e,t,f,p,r,m)}function Vd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Hd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Vd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Vd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Ud=null,Wd=null;function Gd(e){return e.nodeType===9?e:e.ownerDocument}function Kd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function qd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Jd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Yd=null;function Xd(){var e=window.event;return e&&e.type===`popstate`?e===Yd?!1:(Yd=e,!0):(Yd=null,!1)}var Zd=typeof setTimeout==`function`?setTimeout:void 0,Qd=typeof clearTimeout==`function`?clearTimeout:void 0,$d=typeof Promise==`function`?Promise:void 0,ef=typeof queueMicrotask==`function`?queueMicrotask:$d===void 0?Zd:function(e){return $d.resolve(null).then(e).catch(tf)};function tf(e){setTimeout(function(){throw e})}function nf(e){return e===`head`}function rf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Ip(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[st]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vf(e.ownerDocument.body);n=i}while(n);Ip(t)}function af(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function of(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:of(n),ct(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[st])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=pf(e.nextSibling),e===null)break}return null}function cf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pf(e.nextSibling),e===null))return null;return e}function lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pf(e.nextSibling),e===null))return null;return e}function uf(e){return e.data===`$?`||e.data===`$~`}function df(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function ff(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function pf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var mf=null;function hf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function _f(e,t,n){switch(t=Gd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function vf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ct(e)}var yf=new Map,bf=new Set;function xf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Sf=P.d;P.d={f:Cf,r:Y,D:Ef,C:Df,L:Of,m:kf,X:jf,S:Af,M:Mf};function Cf(){var e=Sf.f(),t=Su();return e||t}function Y(e){var t=ut(e);t!==null&&t.tag===5&&t.type===`form`?ws(t):Sf.r(e)}var wf=typeof document>`u`?null:document;function Tf(e,t,n){var r=wf;if(r&&typeof t==`string`&&t){var i=Mt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bf.has(i)||(bf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),zd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function Ef(e){Sf.D(e),Tf(`dns-prefetch`,e,null)}function Df(e,t){Sf.C(e,t),Tf(`preconnect`,e,t)}function Of(e,t,n){Sf.L(e,t,n);var r=wf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Mt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Mt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Mt(n.imageSizes)+`"]`)):i+=`[href="`+Mt(e)+`"]`;var a=i;switch(t){case`style`:a=Pf(e);break;case`script`:a=Rf(e)}yf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),yf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Ff(a))||t===`script`&&r.querySelector(zf(a))||(t=r.createElement(`link`),zd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function kf(e,t){Sf.m(e,t);var n=wf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Mt(r)+`"][href="`+Mt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rf(e)}if(!yf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),yf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zf(a)))return}r=n.createElement(`link`),zd(r,`link`,e),pt(r),n.head.appendChild(r)}}}function Af(e,t,n){Sf.S(e,t,n);var r=wf;if(r&&e){var i=ft(r).hoistableStyles,a=Pf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Ff(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=yf.get(a))&&Hf(e,n);var c=o=r.createElement(`link`);pt(c),zd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jf(e,t){Sf.X(e,t);var n=wf;if(n&&e){var r=ft(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=f({src:e,async:!0},t),(t=yf.get(i))&&Uf(e,t),a=n.createElement(`script`),pt(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t){Sf.M(e,t);var n=wf;if(n&&e){var r=ft(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=yf.get(i))&&Uf(e,t),a=n.createElement(`script`),pt(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t,n,r){var a=(a=ne.current)?xf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Pf(n.href),n=ft(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pf(n.href);var o=ft(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Ff(e)))&&!o._p&&(s.instance=o,s.state.loading=5),yf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},yf.set(e,n),o||Lf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Rf(n),n=ft(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pf(e){return`href="`+Mt(e)+`"`}function Ff(e){return`link[rel="stylesheet"][`+e+`]`}function If(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Lf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),zd(t,`link`,n),pt(t),e.head.appendChild(t))}function Rf(e){return`[src="`+Mt(e)+`"]`}function zf(e){return`script[async]`+e}function Bf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Mt(n.href)+`"]`);if(r)return t.instance=r,pt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),pt(r),zd(r,`style`,a),Vf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pf(n.href);var o=e.querySelector(Ff(a));if(o)return t.state.loading|=4,t.instance=o,pt(o),o;r=If(n),(a=yf.get(a))&&Hf(r,a),o=(e.ownerDocument||e).createElement(`link`),pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),zd(o,`link`,r),t.state.loading|=4,Vf(o,n.precedence,e),t.instance=o;case`script`:return o=Rf(n.src),(a=e.querySelector(zf(o)))?(t.instance=a,pt(a),a):(r=n,(a=yf.get(o))&&(r=f({},n),Uf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),pt(a),zd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vf(r,n.precedence,e));return t.instance}function Vf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wf=null;function Gf(e,t,n){if(Wf===null){var r=new Map,i=Wf=new Map;i.set(n,r)}else i=Wf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[st]||a[et]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Kf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Yf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pf(r.href),a=t.querySelector(Ff(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=X.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,pt(a);return}a=t.ownerDocument||t,r=If(r),(i=yf.get(i))&&Hf(r,i),a=a.createElement(`link`),pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),zd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=X.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Xf=0;function Zf(e,t){return e.stylesheets&&e.count===0&&$f(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Xf===0&&(Xf=62500*Hd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Xf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function X(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$f(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qf=null;function $f(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qf=new Map,t.forEach(ep,e),Qf=null,X.call(e))}function ep(e,t){if(!(t.state.loading&4)){var n=Qf.get(e);if(n)var r=n.get(null);else{n=new Map,Qf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=X.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var tp={$$typeof:b,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function np(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=Ue(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ue(0),this.hiddenUpdates=Ue(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function rp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new np(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ri(3,null,null,t),e.current=a,a.stateNode=e,t=na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Fa(a),e}function ip(e){return e?(e=ti,e):ti}function ap(e,t,n,r,i,a){i=ip(i),r.context===null?r.context=i:r.pendingContext=i,r=La(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ra(e,r,t),n!==null&&(_u(n,e,t),za(n,e,t))}function op(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sp(e,t){op(e,t),(e=e.alternate)&&op(e,t)}function cp(e){if(e.tag===13||e.tag===31){var t=Qr(e,67108864);t!==null&&_u(t,e,67108864),sp(e,67108864)}}function lp(e){if(e.tag===13||e.tag===31){var t=hu();t=Ye(t);var n=Qr(e,t);n!==null&&_u(n,e,t),sp(e,t)}}var up=!0;function dp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,pp(e,t,n,r)}finally{P.p=a,N.T=i}}function fp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,pp(e,t,n,r)}finally{P.p=a,N.T=i}}function pp(e,t,n,r){if(up){var i=mp(r);if(i===null)Od(e,t,r,hp,n),Ep(e,r);else if(Op(i,e,t,n,r))r.stopPropagation();else if(Ep(e,r),t&4&&-1<Tp.indexOf(e)){for(;i!==null;){var a=ut(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Re(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-je(o);s.entanglements[1]|=c,o&=~c}od(a),!(J&6)&&(ru=ye()+500,sd(0,!1))}}break;case 31:case 13:s=Qr(a,2),s!==null&&_u(s,a,2),Su(),sp(a,2)}if(a=mp(r),a===null&&Od(e,t,r,hp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Od(e,t,r,null,n)}}function mp(e){return e=Yt(e),gp(e)}var hp=null;function gp(e){if(hp=null,e=lt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return hp=e,null}function _p(e){switch(e){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(be()){case xe:return 2;case Se:return 8;case Ce:case we:return 32;case Te:return 268435456;default:return 32}default:return 32}}var vp=!1,yp=null,bp=null,xp=null,Sp=new Map,Cp=new Map,wp=[],Tp=`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 Ep(e,t){switch(e){case`focusin`:case`focusout`:yp=null;break;case`dragenter`:case`dragleave`:bp=null;break;case`mouseover`:case`mouseout`:xp=null;break;case`pointerover`:case`pointerout`:Sp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Cp.delete(t.pointerId)}}function Dp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ut(t),t!==null&&cp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Op(e,t,n,r,i){switch(t){case`focusin`:return yp=Dp(yp,e,t,n,r,i),!0;case`dragenter`:return bp=Dp(bp,e,t,n,r,i),!0;case`mouseover`:return xp=Dp(xp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Sp.set(a,Dp(Sp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Cp.set(a,Dp(Cp.get(a)||null,e,t,n,r,i)),!0}return!1}function kp(e){var t=lt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Qe(e.priority,function(){lp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Qe(e.priority,function(){lp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ap(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=mp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Jt=r,n.target.dispatchEvent(r),Jt=null}else return t=ut(n),t!==null&&cp(t),e.blockedOn=n,!1;t.shift()}return!0}function jp(e,t,n){Ap(e)&&n.delete(t)}function Mp(){vp=!1,yp!==null&&Ap(yp)&&(yp=null),bp!==null&&Ap(bp)&&(bp=null),xp!==null&&Ap(xp)&&(xp=null),Sp.forEach(jp),Cp.forEach(jp)}function Np(e,n){e.blockedOn===n&&(e.blockedOn=null,vp||(vp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Mp)))}var Pp=null;function Fp(e){Pp!==e&&(Pp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Pp===e&&(Pp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(gp(r||n)===null)continue;break}var a=ut(n);a!==null&&(e.splice(t,3),t-=3,Ss(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Ip(e){function t(t){return Np(t,e)}yp!==null&&Np(yp,e),bp!==null&&Np(bp,e),xp!==null&&Np(xp,e),Sp.forEach(t),Cp.forEach(t);for(var n=0;n<wp.length;n++){var r=wp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<wp.length&&(n=wp[0],n.blockedOn===null);)kp(n),n.blockedOn===null&&wp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[tt]||null;if(typeof a==`function`)o||Fp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[tt]||null)s=o.formAction;else if(gp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Fp(n)}}}function Lp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Rp(e){this._internalRoot=e}zp.prototype.render=Rp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ap(n,hu(),e,t,null,null)},zp.prototype.unmount=Rp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ap(e.current,2,null,e,null,null),Su(),t[nt]=null}};function zp(e){this._internalRoot=e}zp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ze();e={blockedOn:null,target:e,priority:t};for(var n=0;n<wp.length&&t!==0&&t<wp[n].priority;n++);wp.splice(n,0,e),n===0&&kp(e)}};var Bp=n.version;if(Bp!==`19.2.4`)throw Error(i(527,Bp,`19.2.4`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Vp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Hp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hp.isDisabled&&Hp.supportsFiber)try{Oe=Hp.inject(Vp),ke=Hp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Gs,s=Ks,c=qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=rp(e,1,!1,null,null,n,r,null,o,s,c,Lp),e[nt]=t.current,Ed(e),new Rp(t)}})),Fr=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Pr()}))();function Ir(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ir(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Lr(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ir(e))&&(r&&(r+=` `),r+=t);return r}var Rr=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},zr=(e,t)=>({classGroupId:e,validator:t}),Br=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Vr=`-`,Hr=[],Ur=`arbitrary..`,Wr=e=>{let t=qr(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Kr(e);let n=e.split(Vr);return Gr(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Rr(i,t):t:i||Hr}return n[e]||Hr}}},Gr=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Gr(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Vr):e.slice(t).join(Vr),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Kr=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ur+r:void 0})(),qr=e=>{let{theme:t,classGroups:n}=e;return Jr(n,t)},Jr=(e,t)=>{let n=Br();for(let r in e){let i=e[r];Yr(i,n,r,t)}return n},Yr=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Xr(i,t,n,r)}},Xr=(e,t,n,r)=>{if(typeof e==`string`){Zr(e,t,n);return}if(typeof e==`function`){Qr(e,t,n,r);return}$r(e,t,n,r)},Zr=(e,t,n)=>{let r=e===``?t:ei(t,e);r.classGroupId=n},Qr=(e,t,n,r)=>{if(ti(e)){Yr(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(zr(n,e))},$r=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Yr(o,ei(t,a),n,r)}},ei=(e,t)=>{let n=e,r=t.split(Vr),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Br(),n.nextPart.set(t,i)),n=i}return n},ti=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ni=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},ri=`!`,ii=`:`,ai=[],oi=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),si=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===ii){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(ri)?(c=s.slice(0,-1),l=!0):s.startsWith(ri)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return oi(t,l,c,u)};if(t){let e=t+ii,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):oi(ai,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ci=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},li=e=>({cache:ni(e.cacheSize),parseClassName:si(e),sortModifiers:ci(e),...Wr(e)}),ui=/\s+/,di=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(ui),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+ri:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},fi=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=pi(n))&&(i&&(i+=` `),i+=r);return i},pi=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=pi(e[r]))&&(n&&(n+=` `),n+=t);return n},mi=(e,...t)=>{let n,r,i,a,o=o=>(n=li(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=di(e,n);return i(e,a),a};return a=o,(...e)=>a(fi(...e))},hi=[],gi=e=>{let t=t=>t[e]||hi;return t.isThemeGetter=!0,t},_i=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,vi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,yi=/^\d+\/\d+$/,bi=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xi=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Si=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ci=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wi=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ti=e=>yi.test(e),Ei=e=>!!e&&!Number.isNaN(Number(e)),Di=e=>!!e&&Number.isInteger(Number(e)),Oi=e=>e.endsWith(`%`)&&Ei(e.slice(0,-1)),ki=e=>bi.test(e),Ai=()=>!0,ji=e=>xi.test(e)&&!Si.test(e),Mi=()=>!1,Ni=e=>Ci.test(e),Pi=e=>wi.test(e),Fi=e=>!W(e)&&!G(e),Ii=e=>Ji(e,Qi,Mi),W=e=>_i.test(e),Li=e=>Ji(e,$i,ji),Ri=e=>Ji(e,ea,Ei),zi=e=>Ji(e,Xi,Mi),Bi=e=>Ji(e,Zi,Pi),Vi=e=>Ji(e,na,Ni),G=e=>vi.test(e),Hi=e=>Yi(e,$i),Ui=e=>Yi(e,ta),Wi=e=>Yi(e,Xi),Gi=e=>Yi(e,Qi),Ki=e=>Yi(e,Zi),qi=e=>Yi(e,na,!0),Ji=(e,t,n)=>{let r=_i.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Yi=(e,t,n=!1)=>{let r=vi.exec(e);return r?r[1]?t(r[1]):n:!1},Xi=e=>e===`position`||e===`percentage`,Zi=e=>e===`image`||e===`url`,Qi=e=>e===`length`||e===`size`||e===`bg-size`,$i=e=>e===`length`,ea=e=>e===`number`,ta=e=>e===`family-name`,na=e=>e===`shadow`,ra=mi(()=>{let e=gi(`color`),t=gi(`font`),n=gi(`text`),r=gi(`font-weight`),i=gi(`tracking`),a=gi(`leading`),o=gi(`breakpoint`),s=gi(`container`),c=gi(`spacing`),l=gi(`radius`),u=gi(`shadow`),d=gi(`inset-shadow`),f=gi(`text-shadow`),p=gi(`drop-shadow`),m=gi(`blur`),h=gi(`perspective`),g=gi(`aspect`),_=gi(`ease`),v=gi(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),G,W],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[G,W,c],T=()=>[Ti,`full`,`auto`,...w()],E=()=>[Di,`none`,`subgrid`,G,W],D=()=>[`auto`,{span:[`full`,Di,G,W]},Di,G,W],O=()=>[Di,`auto`,G,W],k=()=>[`auto`,`min`,`max`,`fr`,G,W],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Ti,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,G,W],F=()=>[...b(),Wi,zi,{position:[G,W]}],I=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ee=()=>[`auto`,`cover`,`contain`,Gi,Ii,{size:[G,W]}],L=()=>[Oi,Hi,Li],R=()=>[``,`none`,`full`,l,G,W],z=()=>[``,Ei,Hi,Li],B=()=>[`solid`,`dashed`,`dotted`,`double`],te=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ne=()=>[Ei,Oi,Wi,zi],re=()=>[``,`none`,m,G,W],V=()=>[`none`,Ei,G,W],ie=()=>[`none`,Ei,G,W],ae=()=>[Ei,G,W],oe=()=>[Ti,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[ki],breakpoint:[ki],color:[Ai],container:[ki],"drop-shadow":[ki],ease:[`in`,`out`,`in-out`],font:[Fi],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[ki],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[ki],shadow:[ki],spacing:[`px`,Ei],text:[ki],"text-shadow":[ki],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Ti,W,G,g]}],container:[`container`],columns:[{columns:[Ei,W,G,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Di,`auto`,G,W]}],basis:[{basis:[Ti,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Ei,Ti,`auto`,`initial`,`none`,W]}],grow:[{grow:[``,Ei,G,W]}],shrink:[{shrink:[``,Ei,G,W]}],order:[{order:[Di,`first`,`last`,`none`,G,W]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,Hi,Li]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,G,Ri]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Oi,W]}],"font-family":[{font:[Ui,W,t]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,G,W]}],"line-clamp":[{"line-clamp":[Ei,`none`,G,Ri]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,G,W]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,G,W]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...B(),`wavy`]}],"text-decoration-thickness":[{decoration:[Ei,`from-font`,`auto`,G,Li]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Ei,`auto`,G,W]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,G,W]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,G,W]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:I()}],"bg-size":[{bg:ee()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Di,G,W],radial:[``,G,W],conic:[Di,G,W]},Ki,Bi]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:L()}],"gradient-via-pos":[{via:L()}],"gradient-to-pos":[{to:L()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:z()}],"border-w-x":[{"border-x":z()}],"border-w-y":[{"border-y":z()}],"border-w-s":[{"border-s":z()}],"border-w-e":[{"border-e":z()}],"border-w-t":[{"border-t":z()}],"border-w-r":[{"border-r":z()}],"border-w-b":[{"border-b":z()}],"border-w-l":[{"border-l":z()}],"divide-x":[{"divide-x":z()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":z()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...B(),`hidden`,`none`]}],"divide-style":[{divide:[...B(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...B(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Ei,G,W]}],"outline-w":[{outline:[``,Ei,Hi,Li]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`none`,u,qi,Vi]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,qi,Vi]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:z()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Ei,Li]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":z()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,qi,Vi]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Ei,G,W]}],"mix-blend":[{"mix-blend":[...te(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Ei]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[G,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Ei]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:I()}],"mask-size":[{mask:ee()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,G,W]}],filter:[{filter:[``,`none`,G,W]}],blur:[{blur:re()}],brightness:[{brightness:[Ei,G,W]}],contrast:[{contrast:[Ei,G,W]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,qi,Vi]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,Ei,G,W]}],"hue-rotate":[{"hue-rotate":[Ei,G,W]}],invert:[{invert:[``,Ei,G,W]}],saturate:[{saturate:[Ei,G,W]}],sepia:[{sepia:[``,Ei,G,W]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,G,W]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[Ei,G,W]}],"backdrop-contrast":[{"backdrop-contrast":[Ei,G,W]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Ei,G,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ei,G,W]}],"backdrop-invert":[{"backdrop-invert":[``,Ei,G,W]}],"backdrop-opacity":[{"backdrop-opacity":[Ei,G,W]}],"backdrop-saturate":[{"backdrop-saturate":[Ei,G,W]}],"backdrop-sepia":[{"backdrop-sepia":[``,Ei,G,W]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,G,W]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Ei,`initial`,G,W]}],ease:[{ease:[`linear`,`initial`,_,G,W]}],delay:[{delay:[Ei,G,W]}],animate:[{animate:[`none`,v,G,W]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,G,W]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":[`scale-3d`],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[G,W,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":[`translate-none`],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,G,W]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,G,W]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[Ei,Hi,Li,Ri]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function ia(...e){return ra(Lr(e))}var aa=`inline-flex w-fit flex-none shrink-0 items-center justify-self-start rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap`,oa={variant:{primary:{classes:`bg-kumo-badge-inverted text-kumo-badge-inverted`,description:`Primary badge`},secondary:{classes:`bg-kumo-fill text-kumo-badge-neutral-subtle`,description:`Secondary badge`},error:{classes:`bg-kumo-danger-tint/60 text-kumo-danger`,description:`Error badge`},warning:{classes:`bg-kumo-warning-tint/70 text-kumo-warning`,description:`Warning badge`},success:{classes:`bg-kumo-success-tint/70 text-kumo-success`,description:`Success badge`},destructive:{classes:`bg-kumo-badge-red text-white`,description:`Deprecated. Use red instead.`},info:{classes:`bg-kumo-info-tint/70 text-kumo-info`,description:`Info badge`},beta:{classes:`border border-dashed border-kumo-brand bg-transparent text-kumo-link`,description:`Indicates beta or experimental features`},outline:{classes:`border border-kumo-fill bg-transparent text-kumo-default`,description:`Bordered badge with transparent background`},red:{classes:`bg-kumo-badge-red text-white`,description:`Red badge`},green:{classes:`bg-kumo-badge-green text-white`,description:`Green badge`},neutral:{classes:`bg-kumo-badge-neutral text-white`,description:`Neutral badge`},orange:{classes:`bg-kumo-badge-orange text-black`,description:`Orange badge`},purple:{classes:`bg-kumo-badge-purple text-white`,description:`Purple badge`},teal:{classes:`bg-kumo-badge-teal text-white`,description:`Teal badge`},"teal-subtle":{classes:`bg-kumo-badge-teal-subtle text-kumo-badge-teal-subtle`,description:`Subtle teal badge`},blue:{classes:`bg-kumo-badge-blue text-white`,description:`Blue badge`}}},sa={variant:`primary`};function ca({variant:e=sa.variant}={}){let t=oa.variant[e];return ia(aa,t?.classes??oa.variant[sa.variant].classes)}function la({variant:e=sa.variant,className:t,children:n}){return(0,U.jsx)(`span`,{className:ia(ca({variant:e}),t),children:n})}var ua=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M228,48V96a12,12,0,0,1-12,12H168a12,12,0,0,1,0-24h19l-7.8-7.8a75.55,75.55,0,0,0-53.32-22.26h-.43A75.49,75.49,0,0,0,72.39,75.57,12,12,0,1,1,55.61,58.41a99.38,99.38,0,0,1,69.87-28.47H126A99.42,99.42,0,0,1,196.2,59.23L204,67V48a12,12,0,0,1,24,0ZM183.61,180.43a75.49,75.49,0,0,1-53.09,21.63h-.43A75.55,75.55,0,0,1,76.77,179.8L69,172H88a12,12,0,0,0,0-24H40a12,12,0,0,0-12,12v48a12,12,0,0,0,24,0V189l7.8,7.8A99.42,99.42,0,0,0,130,226.06h.56a99.38,99.38,0,0,0,69.87-28.47,12,12,0,0,0-16.78-17.16Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M222,48V96a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h33.52L183.47,72a81.51,81.51,0,0,0-57.53-24h-.46A81.5,81.5,0,0,0,68.19,71.28a6,6,0,1,1-8.38-8.58,93.38,93.38,0,0,1,65.67-26.76H126a93.45,93.45,0,0,1,66,27.53l18,18V48a6,6,0,0,1,12,0ZM187.81,184.72a81.5,81.5,0,0,1-57.29,23.34h-.46a81.51,81.51,0,0,1-57.53-24L54.48,166H88a6,6,0,0,0,0-12H40a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V174.48l18,18.05a93.45,93.45,0,0,0,66,27.53h.52a93.38,93.38,0,0,0,65.67-26.76,6,6,0,1,0-8.38-8.58Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M220,48V96a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h38.34L184.89,70.54A84,84,0,0,0,66.8,69.85a4,4,0,1,1-5.6-5.72,92,92,0,0,1,129.34.76L212,86.34V48a4,4,0,0,1,8,0ZM189.2,186.15a83.44,83.44,0,0,1-58.68,23.91h-.47a83.52,83.52,0,0,1-58.94-24.6L49.66,164H88a4,4,0,0,0,0-8H40a4,4,0,0,0-4,4v48a4,4,0,0,0,8,0V169.66l21.46,21.45A91.43,91.43,0,0,0,130,218.06h.51a91.45,91.45,0,0,0,64.28-26.19,4,4,0,1,0-5.6-5.72Z`}))]]),da=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),fa=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M184.49,167.51a12,12,0,0,1,0,17l-48,48a12,12,0,0,1-17,0l-48-48a12,12,0,0,1,17-17L128,207l39.51-39.52A12,12,0,0,1,184.49,167.51Zm-96-79L128,49l39.51,39.52a12,12,0,0,0,17-17l-48-48a12,12,0,0,0-17,0l-48,48a12,12,0,0,0,17,17Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M80,176h96l-48,48ZM128,32,80,80h96Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M176,168H80a8,8,0,0,0-5.66,13.66l48,48a8,8,0,0,0,11.32,0l48-48A8,8,0,0,0,176,168Zm-48,44.69L99.31,184h57.38ZM80,88h96a8,8,0,0,0,5.66-13.66l-48-48a8,8,0,0,0-11.32,0l-48,48A8,8,0,0,0,80,88Zm48-44.69L156.69,72H99.31Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M72.61,83.06a8,8,0,0,1,1.73-8.72l48-48a8,8,0,0,1,11.32,0l48,48A8,8,0,0,1,176,88H80A8,8,0,0,1,72.61,83.06ZM176,168H80a8,8,0,0,0-5.66,13.66l48,48a8,8,0,0,0,11.32,0l48-48A8,8,0,0,0,176,168Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M180.24,171.76a6,6,0,0,1,0,8.48l-48,48a6,6,0,0,1-8.48,0l-48-48a6,6,0,0,1,8.48-8.48L128,215.51l43.76-43.75A6,6,0,0,1,180.24,171.76Zm-96-87.52L128,40.49l43.76,43.75a6,6,0,0,0,8.48-8.48l-48-48a6,6,0,0,0-8.48,0l-48,48a6,6,0,0,0,8.48,8.48Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M181.66,170.34a8,8,0,0,1,0,11.32l-48,48a8,8,0,0,1-11.32,0l-48-48a8,8,0,0,1,11.32-11.32L128,212.69l42.34-42.35A8,8,0,0,1,181.66,170.34Zm-96-84.68L128,43.31l42.34,42.35a8,8,0,0,0,11.32-11.32l-48-48a8,8,0,0,0-11.32,0l-48,48A8,8,0,0,0,85.66,85.66Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M178.83,173.17a4,4,0,0,1,0,5.66l-48,48a4,4,0,0,1-5.66,0l-48-48a4,4,0,0,1,5.66-5.66L128,218.34l45.17-45.17A4,4,0,0,1,178.83,173.17Zm-96-90.34L128,37.66l45.17,45.17a4,4,0,1,0,5.66-5.66l-48-48a4,4,0,0,0-5.66,0l-48,48a4,4,0,0,0,5.66,5.66Z`}))]]),pa=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z`}))]]),ma=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),ha=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M208,36H48A28,28,0,0,0,20,64V176a28,28,0,0,0,28,28H208a28,28,0,0,0,28-28V64A28,28,0,0,0,208,36Zm4,140a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Zm-40,52a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,228Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M224,64V176a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V64A16,16,0,0,1,48,48H208A16,16,0,0,1,224,64Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8Zm-48,48a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M232,64V176a24,24,0,0,1-24,24H48a24,24,0,0,1-24-24V64A24,24,0,0,1,48,40H208A24,24,0,0,1,232,64ZM160,216H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M208,42H48A22,22,0,0,0,26,64V176a22,22,0,0,0,22,22H208a22,22,0,0,0,22-22V64A22,22,0,0,0,208,42Zm10,134a10,10,0,0,1-10,10H48a10,10,0,0,1-10-10V64A10,10,0,0,1,48,54H208a10,10,0,0,1,10,10Zm-52,48a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,224Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8Zm-48,48a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M208,44H48A20,20,0,0,0,28,64V176a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V64A20,20,0,0,0,208,44Zm12,132a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V64A12,12,0,0,1,48,52H208a12,12,0,0,1,12,12Zm-56,48a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,224Z`}))]]),ga=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),_a=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z`}))]]),va=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M248,160a40,40,0,1,0-52.64,37.94A28,28,0,0,1,168,220H144a28,28,0,0,1-28-28V154.9c31.73-5.78,56-34.09,56-67.73V40a12,12,0,0,0-12-12H136a12,12,0,0,0,0,24h12V87.17c0,24.4-19.47,44.52-43.41,44.83A44,44,0,0,1,60,88V52H72a12,12,0,0,0,0-24H48A12,12,0,0,0,36,40V88a68,68,0,0,0,56,66.93V192a52.06,52.06,0,0,0,52,52h24a52.06,52.06,0,0,0,51.61-45.72A40.08,40.08,0,0,0,248,160Zm-40,16a16,16,0,1,1,16-16A16,16,0,0,1,208,176Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M240,160a32,32,0,1,1-32-32A32,32,0,0,1,240,160Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M220,160a12,12,0,1,1-12-12A12,12,0,0,1,220,160Zm-4.55,39.29A48.08,48.08,0,0,1,168,240H144a48.05,48.05,0,0,1-48-48V151.49A64,64,0,0,1,40,88V40a8,8,0,0,1,8-8H72a8,8,0,0,1,0,16H56V88a48,48,0,0,0,48.64,48c26.11-.34,47.36-22.25,47.36-48.83V48H136a8,8,0,0,1,0-16h24a8,8,0,0,1,8,8V87.17c0,32.84-24.53,60.29-56,64.31V192a32,32,0,0,0,32,32h24a32.06,32.06,0,0,0,31.22-25,40,40,0,1,1,16.23.27ZM232,160a24,24,0,1,0-24,24A24,24,0,0,0,232,160Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M240,160a32,32,0,1,0-39.93,31,8,8,0,0,0-.07,1,32,32,0,0,1-32,32H144a32,32,0,0,1-32-32V151.48c31.47-4,56-31.47,56-64.31V40a8,8,0,0,0-8-8H136a8,8,0,0,0,0,16h16V87.17c0,26.58-21.25,48.49-47.36,48.83A48,48,0,0,1,56,88V48H72a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V88a64,64,0,0,0,56,63.49V192a48.05,48.05,0,0,0,48,48h24a48.05,48.05,0,0,0,48-48,8,8,0,0,0-.07-1A32,32,0,0,0,240,160Zm-32,8a8,8,0,1,1,8-8A8,8,0,0,1,208,168Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M218,160a10,10,0,1,1-10-10A10,10,0,0,1,218,160Zm-4.35,37.58A46.05,46.05,0,0,1,168,238H144a46.06,46.06,0,0,1-46-46V149.71A62,62,0,0,1,42,88V40a6,6,0,0,1,6-6H72a6,6,0,0,1,0,12H54V88a50,50,0,0,0,50,50h.67c27.2-.36,49.33-23.16,49.33-50.83V46H136a6,6,0,0,1,0-12h24a6,6,0,0,1,6,6V87.17c0,32.43-24.68,59.44-56,62.52V192a34,34,0,0,0,34,34h24a34.05,34.05,0,0,0,33.56-28.56,38,38,0,1,1,12.09.14ZM234,160a26,26,0,1,0-26,26A26,26,0,0,0,234,160Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M220,160a12,12,0,1,1-12-12A12,12,0,0,1,220,160Zm-4.55,39.29A48.08,48.08,0,0,1,168,240H144a48.05,48.05,0,0,1-48-48V151.49A64,64,0,0,1,40,88V40a8,8,0,0,1,8-8H72a8,8,0,0,1,0,16H56V88a48,48,0,0,0,48.64,48c26.11-.34,47.36-22.25,47.36-48.83V48H136a8,8,0,0,1,0-16h24a8,8,0,0,1,8,8V87.17c0,32.84-24.53,60.29-56,64.31V192a32,32,0,0,0,32,32h24a32.06,32.06,0,0,0,31.22-25,40,40,0,1,1,16.23.27ZM232,160a24,24,0,1,0-24,24A24,24,0,0,0,232,160Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,160a8,8,0,1,1-8-8A8,8,0,0,1,216,160Zm-4.17,35.79A44.06,44.06,0,0,1,168,236H144a44.05,44.05,0,0,1-44-44V147.85A60,60,0,0,1,44,88V40a4,4,0,0,1,4-4H72a4,4,0,0,1,0,8H52V88a52,52,0,0,0,52.69,52C133,139.63,156,115.93,156,87.17V44H136a4,4,0,0,1,0-8h24a4,4,0,0,1,4,4V87.17c0,32-24.84,58.59-56,60.69V192a36,36,0,0,0,36,36h24a36.05,36.05,0,0,0,35.8-32.25,36,36,0,1,1,8,0ZM236,160a28,28,0,1,0-28,28A28,28,0,0,0,236,160Z`}))]]),ya=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),ba=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M224,44H32A12,12,0,0,0,20,56V192a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A12,12,0,0,0,224,44ZM44,116H76v24H44Zm56,0H212v24H100ZM212,68V92H44V68ZM44,164H76v24H44Zm56,24V164H212v24Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M88,104v96H32V104Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM216,64V96H40V64ZM40,160H80v32H40Zm176,32H96V160H216v32Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM40,160H80v32H40Zm176,32H96V160H216v32Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M224,50H32a6,6,0,0,0-6,6V192a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A6,6,0,0,0,224,50ZM38,110H82v36H38Zm56,0H218v36H94ZM218,62V98H38V62ZM38,192V158H82v36H40A2,2,0,0,1,38,192Zm178,2H94V158H218v34A2,2,0,0,1,216,194Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM216,64V96H40V64ZM40,160H80v32H40Zm176,32H96V160H216v32Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M224,52H32a4,4,0,0,0-4,4V192a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A4,4,0,0,0,224,52ZM36,108H84v40H36Zm56,0H220v40H92ZM220,60v40H36V60ZM36,192V156H84v40H40A4,4,0,0,1,36,192Zm180,4H92V156H220v36A4,4,0,0,1,216,196Z`}))]]),xa=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M120,137,48,201A12,12,0,1,1,32,183l61.91-55L32,73A12,12,0,1,1,48,55l72,64A12,12,0,0,1,120,137Zm96,43H120a12,12,0,0,0,0,24h96a12,12,0,0,0,0-24Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,80V192H40V64H200A16,16,0,0,1,216,80Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M117.31,134l-72,64a8,8,0,1,1-10.63-12L100,128,34.69,70A8,8,0,1,1,45.32,58l72,64a8,8,0,0,1,0,12ZM216,184H120a8,8,0,0,0,0,16h96a8,8,0,0,0,0-16Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM77.66,173.66a8,8,0,0,1-11.32-11.32L100.69,128,66.34,93.66A8,8,0,0,1,77.66,82.34l40,40a8,8,0,0,1,0,11.32ZM192,176H128a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M116,132.48l-72,64a6,6,0,0,1-8-9L103,128,36,68.49a6,6,0,0,1,8-9l72,64a6,6,0,0,1,0,9ZM216,186H120a6,6,0,0,0,0,12h96a6,6,0,0,0,0-12Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M117.31,134l-72,64a8,8,0,1,1-10.63-12L100,128,34.69,70A8,8,0,1,1,45.32,58l72,64a8,8,0,0,1,0,12ZM216,184H120a8,8,0,0,0,0,16h96a8,8,0,0,0,0-16Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M116,128a4,4,0,0,1-1.34,3l-72,64a4,4,0,1,1-5.32-6L106,128,37.34,67a4,4,0,0,1,5.32-6l72,64A4,4,0,0,1,116,128Zm100,60H120a4,4,0,0,0,0,8h96a4,4,0,0,0,0-8Z`}))]]),Sa=(0,H.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),Ca=H.forwardRef((e,t)=>{let{alt:n,color:r,size:i,weight:a,mirrored:o,children:s,weights:c,...l}=e,{color:u=`currentColor`,size:d,weight:f=`regular`,mirrored:p=!1,...m}=H.useContext(Sa);return H.createElement(`svg`,{ref:t,xmlns:`http://www.w3.org/2000/svg`,width:i??d,height:i??d,fill:r??u,viewBox:`0 0 256 256`,transform:o||p?`scale(-1, 1)`:void 0,...m,...l},!!n&&H.createElement(`title`,null,n),s,c.get(a??f))});Ca.displayName=`IconBase`;var wa=H.forwardRef((e,t)=>H.createElement(Ca,{ref:t,...e,weights:ua}));wa.displayName=`ArrowsClockwiseIcon`;var Ta=H.forwardRef((e,t)=>H.createElement(Ca,{ref:t,...e,weights:da}));Ta.displayName=`CaretRightIcon`;var Ea=H.forwardRef((e,t)=>H.createElement(Ca,{ref:t,...e,weights:fa}));Ea.displayName=`CaretUpDownIcon`;var Da=H.forwardRef((e,t)=>H.createElement(Ca,{ref:t,...e,weights:pa}));Da.displayName=`CheckIcon`;var Oa=H.forwardRef((e,t)=>H.createElement(Ca,{ref:t,...e,weights:ma}));Oa.displayName=`MagnifyingGlassIcon`;var ka=H.forwardRef((e,t)=>H.createElement(Ca,{ref:t,...e,weights:ha}));ka.displayName=`MonitorIcon`;var Aa=H.forwardRef((e,t)=>H.createElement(Ca,{ref:t,...e,weights:ga}));Aa.displayName=`MoonIcon`;var ja=H.forwardRef((e,t)=>H.createElement(Ca,{ref:t,...e,weights:_a}));ja.displayName=`SidebarSimpleIcon`;var Ma=H.forwardRef((e,t)=>H.createElement(Ca,{ref:t,...e,weights:va}));Ma.displayName=`StethoscopeIcon`;var Na=H.forwardRef((e,t)=>H.createElement(Ca,{ref:t,...e,weights:ya}));Na.displayName=`SunIcon`;var Pa=H.forwardRef((e,t)=>H.createElement(Ca,{ref:t,...e,weights:ba}));Pa.displayName=`TableIcon`;var Fa=H.forwardRef((e,t)=>H.createElement(Ca,{ref:t,...e,weights:xa}));Fa.displayName=`TerminalIcon`;var Ia={size:{sm:{value:16,description:`Small loader for inline use`},base:{value:24,description:`Default loader size`},lg:{value:32,description:`Large loader for prominent loading states`}}},La={size:`base`};function Ra({size:e=La.size}={}){return typeof e==`number`?e:Ia.size[e].value}var za=({className:e,size:t=La.size,"aria-label":n=`Loading`})=>{let r=Ra({size:t});return(0,U.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,stroke:`currentColor`,className:e,style:{height:r,width:r},role:`status`,"aria-label":n,children:[(0,U.jsxs)(`circle`,{cx:`12`,cy:`12`,r:`9.5`,fill:`none`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,U.jsx)(`animateTransform`,{attributeName:`transform`,type:`rotate`,from:`0 12 12`,to:`360 12 12`,dur:`2s`,repeatCount:`indefinite`}),(0,U.jsx)(`animate`,{attributeName:`stroke-dasharray`,values:`0 150;42 150;42 150`,keyTimes:`0;0.5;1`,dur:`1.5s`,repeatCount:`indefinite`}),(0,U.jsx)(`animate`,{attributeName:`stroke-dashoffset`,values:`0;-16;-59`,keyTimes:`0;0.5;1`,dur:`1.5s`,repeatCount:`indefinite`})]}),(0,U.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9.5`,fill:`none`,opacity:.1,strokeWidth:`2`,strokeLinecap:`round`})]})},Ba=(0,H.createContext)(null);function Va(){return(0,H.useContext)(Ba)}function Ha(){return typeof window<`u`}function Ua(e){return Ka(e)?(e.nodeName||``).toLowerCase():`#document`}function Wa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ga(e){return((Ka(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ka(e){return Ha()?e instanceof Node||e instanceof Wa(e).Node:!1}function qa(e){return Ha()?e instanceof Element||e instanceof Wa(e).Element:!1}function Ja(e){return Ha()?e instanceof HTMLElement||e instanceof Wa(e).HTMLElement:!1}function Ya(e){return!Ha()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Wa(e).ShadowRoot}var Xa=new Set([`inline`,`contents`]);function Za(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=uo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Xa.has(i)}var Qa=new Set([`table`,`td`,`th`]);function $a(e){return Qa.has(Ua(e))}var eo=[`:popover-open`,`:modal`];function to(e){return eo.some(t=>{try{return e.matches(t)}catch{return!1}})}var no=[`transform`,`translate`,`scale`,`rotate`,`perspective`],ro=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],io=[`paint`,`layout`,`strict`,`content`];function ao(e){let t=so(),n=qa(e)?uo(e):e;return no.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||ro.some(e=>(n.willChange||``).includes(e))||io.some(e=>(n.contain||``).includes(e))}function oo(e){let t=po(e);for(;Ja(t)&&!lo(t);){if(ao(t))return t;if(to(t))return null;t=po(t)}return null}function so(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var co=new Set([`html`,`body`,`#document`]);function lo(e){return co.has(Ua(e))}function uo(e){return Wa(e).getComputedStyle(e)}function fo(e){return qa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function po(e){if(Ua(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ya(e)&&e.host||Ga(e);return Ya(t)?t.host:t}function mo(e){let t=po(e);return lo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ja(t)&&Za(t)?t:mo(t)}function ho(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=mo(e),i=r===e.ownerDocument?.body,a=Wa(r);if(i){let e=go(a);return t.concat(a,a.visualViewport||[],Za(r)?r:[],e&&n?ho(e):[])}return t.concat(r,ho(r,[],n))}function go(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var _o=[`top`,`right`,`bottom`,`left`],vo=Math.min,yo=Math.max,bo=Math.round,xo=Math.floor,So=e=>({x:e,y:e}),Co={left:`right`,right:`left`,bottom:`top`,top:`bottom`},wo={start:`end`,end:`start`};function To(e,t,n){return yo(e,vo(t,n))}function Eo(e,t){return typeof e==`function`?e(t):e}function Do(e){return e.split(`-`)[0]}function Oo(e){return e.split(`-`)[1]}function ko(e){return e===`x`?`y`:`x`}function Ao(e){return e===`y`?`height`:`width`}var jo=new Set([`top`,`bottom`]);function Mo(e){return jo.has(Do(e))?`y`:`x`}function No(e){return ko(Mo(e))}function Po(e,t,n){n===void 0&&(n=!1);let r=Oo(e),i=No(e),a=Ao(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Uo(o)),[o,Uo(o)]}function Fo(e){let t=Uo(e);return[Io(e),t,Io(t)]}function Io(e){return e.replace(/start|end/g,e=>wo[e])}var Lo=[`left`,`right`],Ro=[`right`,`left`],zo=[`top`,`bottom`],Bo=[`bottom`,`top`];function Vo(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ro:Lo:t?Lo:Ro;case`left`:case`right`:return t?zo:Bo;default:return[]}}function Ho(e,t,n,r){let i=Oo(e),a=Vo(Do(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Io)))),a}function Uo(e){return e.replace(/left|right|bottom|top/g,e=>Co[e])}function Wo(e){return{top:0,right:0,bottom:0,left:0,...e}}function Go(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Wo(e)}function Ko(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function qo(e,t,n){let{reference:r,floating:i}=e,a=Mo(t),o=No(t),s=Ao(o),c=Do(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Oo(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var Jo=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=qo(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=qo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function Yo(e,t){var n;t===void 0&&(t={});let{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=Eo(t,e),m=Go(p),h=s[f?d===`floating`?`reference`:`floating`:d],g=Ko(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(h)))==null||n?h:h.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),_=d===`floating`?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,v=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),y=await(a.isElement==null?void 0:a.isElement(v))&&await(a.getScale==null?void 0:a.getScale(v))||{x:1,y:1},b=Ko(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:_,offsetParent:v,strategy:c}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}var Xo=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Eo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Do(r),_=Mo(o),v=Do(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Uo(o)]:Fo(o)),x=p!==`none`;!d&&x&&b.push(...Ho(o,m,p,y));let S=[o,...b],C=await Yo(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Po(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Mo(t))||T.every(e=>Mo(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Mo(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Zo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qo(e){return _o.some(t=>e[t]>=0)}var $o=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=Eo(e,t);switch(r){case`referenceHidden`:{let e=Zo(await Yo(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Qo(e)}}}case`escaped`:{let e=Zo(await Yo(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Qo(e)}}}default:return{}}}}},es=new Set([`left`,`top`]);async function ts(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Do(n),s=Oo(n),c=Mo(n)===`y`,l=es.has(o)?-1:1,u=a&&c?-1:1,d=Eo(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ns=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ts(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},rs=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Eo(e,t),l={x:n,y:r},u=await Yo(t,c),d=Mo(Do(i)),f=ko(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=To(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=To(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},is=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Eo(e,t),u={x:n,y:r},d=Mo(i),f=ko(d),p=u[f],m=u[d],h=Eo(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=es.has(Do(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},as=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Eo(e,t),u=await Yo(t,l),d=Do(i),f=Oo(i),p=Mo(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=vo(h-u[g],v),x=vo(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=yo(u.left,0),t=yo(u.right,0),n=yo(u.top,0),r=yo(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:yo(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:yo(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function os(e){let t=uo(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ja(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=bo(n)!==a||bo(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ss(e){return qa(e)?e:e.contextElement}function cs(e){let t=ss(e);if(!Ja(t))return So(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=os(t),o=(a?bo(n.width):n.width)/r,s=(a?bo(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ls=So(0);function us(e){let t=Wa(e);return!so()||!t.visualViewport?ls:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ds(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wa(e)?!1:t}function fs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ss(e),o=So(1);t&&(r?qa(r)&&(o=cs(r)):o=cs(e));let s=ds(a,n,r)?us(a):So(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Wa(a),t=r&&qa(r)?Wa(r):r,n=e,i=go(n);for(;i&&r&&t!==n;){let e=cs(i),t=i.getBoundingClientRect(),r=uo(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Wa(i),i=go(n)}}return Ko({width:u,height:d,x:c,y:l})}function ps(e,t){let n=fo(e).scrollLeft;return t?t.left+n:fs(Ga(e)).left+n}function ms(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ps(e,n),y:n.top+t.scrollTop}}function hs(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ga(r),s=t?to(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=So(1),u=So(0),d=Ja(r);if((d||!d&&!a)&&((Ua(r)!==`body`||Za(o))&&(c=fo(r)),Ja(r))){let e=fs(r);l=cs(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ms(o,c):So(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function gs(e){return Array.from(e.getClientRects())}function _s(e){let t=Ga(e),n=fo(e),r=e.ownerDocument.body,i=yo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=yo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+ps(e),s=-n.scrollTop;return uo(r).direction===`rtl`&&(o+=yo(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var vs=25;function ys(e,t){let n=Wa(e),r=Ga(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=so();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=ps(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=vs&&(a-=o)}else l<=vs&&(a+=l);return{width:a,height:o,x:s,y:c}}var bs=new Set([`absolute`,`fixed`]);function xs(e,t){let n=fs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ja(e)?cs(e):So(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ss(e,t,n){let r;if(t===`viewport`)r=ys(e,n);else if(t===`document`)r=_s(Ga(e));else if(qa(t))r=xs(t,n);else{let n=us(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ko(r)}function Cs(e,t){let n=po(e);return n===t||!qa(n)||lo(n)?!1:uo(n).position===`fixed`||Cs(n,t)}function ws(e,t){let n=t.get(e);if(n)return n;let r=ho(e,[],!1).filter(e=>qa(e)&&Ua(e)!==`body`),i=null,a=uo(e).position===`fixed`,o=a?po(e):e;for(;qa(o)&&!lo(o);){let t=uo(o),n=ao(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&bs.has(i.position)||Za(o)&&!n&&Cs(e,o))?r=r.filter(e=>e!==o):i=t,o=po(o)}return t.set(e,r),r}function Ts(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?to(t)?[]:ws(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Ss(t,n,i);return e.top=yo(r.top,e.top),e.right=vo(r.right,e.right),e.bottom=vo(r.bottom,e.bottom),e.left=yo(r.left,e.left),e},Ss(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Es(e){let{width:t,height:n}=os(e);return{width:t,height:n}}function Ds(e,t,n){let r=Ja(t),i=Ga(t),a=n===`fixed`,o=fs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=So(0);function l(){c.x=ps(i)}if(r||!r&&!a)if((Ua(t)!==`body`||Za(i))&&(s=fo(t)),r){let e=fs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?ms(i,s):So(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Os(e){return uo(e).position===`static`}function ks(e,t){if(!Ja(e)||uo(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ga(e)===n&&(n=n.ownerDocument.body),n}function As(e,t){let n=Wa(e);if(to(e))return n;if(!Ja(e)){let t=po(e);for(;t&&!lo(t);){if(qa(t)&&!Os(t))return t;t=po(t)}return n}let r=ks(e,t);for(;r&&$a(r)&&Os(r);)r=ks(r,t);return r&&lo(r)&&Os(r)&&!ao(r)?n:r||oo(e)||n}var js=async function(e){let t=this.getOffsetParent||As,n=this.getDimensions,r=await n(e.floating);return{reference:Ds(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ms(e){return uo(e).direction===`rtl`}var Ns={convertOffsetParentRelativeRectToViewportRelativeRect:hs,getDocumentElement:Ga,getClippingRect:Ts,getOffsetParent:As,getElementRects:js,getClientRects:gs,getDimensions:Es,getScale:cs,isElement:qa,isRTL:Ms};function Ps(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fs(e,t){let n=null,r,i=Ga(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=xo(d),h=xo(i.clientWidth-(u+f)),g=xo(i.clientHeight-(d+p)),_=xo(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:yo(0,vo(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Ps(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Is(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ss(e),u=i||a?[...l?ho(l):[],...ho(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Fs(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?fs(e):null;c&&g();function g(){let t=fs(e);h&&!Ps(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ls=ns,Rs=rs,zs=Xo,Bs=as,Vs=$o,Hs=is,Us=(e,t,n)=>{let r=new Map,i={platform:Ns,...n},a={...i.platform,_c:r};return Jo(e,t,{...i,platform:a})},Ws=typeof document<`u`?H.useLayoutEffect:function(){};function Gs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Gs(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Gs(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ks(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qs(e,t){let n=Ks(e);return Math.round(t*n)/n}function Js(e){let t=H.useRef(e);return Ws(()=>{t.current=e}),t}function Ys(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=H.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=H.useState(r);Gs(f,r)||p(r);let[m,h]=H.useState(null),[g,_]=H.useState(null),v=H.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=H.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=H.useRef(null),C=H.useRef(null),w=H.useRef(u),T=c!=null,E=Js(c),D=Js(i),O=Js(l),k=H.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Us(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Gs(w.current,t)&&(w.current=t,Wn.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Ws(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=H.useRef(!1);Ws(()=>(A.current=!0,()=>{A.current=!1}),[]),Ws(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=H.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=H.useMemo(()=>({reference:b,floating:x}),[b,x]),N=H.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=qs(M.floating,u.x),r=qs(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ks(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return H.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Xs=(e,t)=>({...Ls(e),options:[e,t]}),Zs=(e,t)=>({...Rs(e),options:[e,t]}),Qs=(e,t)=>({...Hs(e),options:[e,t]}),$s=(e,t)=>({...zs(e),options:[e,t]}),ec=(e,t)=>({...Bs(e),options:[e,t]}),tc=(e,t)=>({...Vs(e),options:[e,t]}),nc=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),rc=typeof Element>`u`,ic=rc?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ac=!rc&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)==null?void 0:t.call(e)}:function(e){return e?.ownerDocument},oc=function(e,t){var n;t===void 0&&(t=!0);var r=e==null||(n=e.getAttribute)==null?void 0:n.call(e,`inert`);return r===``||r===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):oc(e.parentNode))},sc=function(e){var t,n=e==null||(t=e.getAttribute)==null?void 0:t.call(e,`contenteditable`);return n===``||n===`true`},cc=function(e,t,n){if(oc(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(nc));return t&&ic.call(e,nc)&&r.unshift(e),r=r.filter(n),r},lc=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!oc(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=lc(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{ic.call(a,nc)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!oc(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=lc(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},uc=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},dc=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||sc(e))&&!uc(e)?0:e.tabIndex},fc=function(e,t){var n=dc(e);return n<0&&t&&!uc(e)?0:n},pc=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},mc=function(e){return e.tagName===`INPUT`},hc=function(e){return mc(e)&&e.type===`hidden`},gc=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},_c=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},vc=function(e){if(!e.name)return!0;var t=e.form||ac(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&typeof window.CSS<`u`&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=_c(r,e.form);return!i||i===e},yc=function(e){return mc(e)&&e.type===`radio`},bc=function(e){return yc(e)&&!vc(e)},xc=function(e){var t=e&&ac(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=ac(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Sc=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Cc=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=ic.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(ic.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=ac(e);if(o&&!o.shadowRoot&&r(o)===!0)return Sc(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(xc(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Sc(e);return!1},wc=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return ic.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Tc=function(e,t){return!(t.disabled||hc(t)||Cc(t,e)||gc(t)||wc(t))},Ec=function(e,t){return!(bc(t)||dc(t)<0||!Tc(e,t))},Dc=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Oc=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=fc(a,i),s=i?Oc(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(pc).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},kc=function(e,t){t||={};var n;return n=t.getShadowRoot?lc([e],t.includeContainer,{filter:Ec.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Dc}):cc(e,t.includeContainer,Ec.bind(null,t)),Oc(n)},Ac=function(e,t){t||={};var n;return n=t.getShadowRoot?lc([e],t.includeContainer,{filter:Tc.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):cc(e,t.includeContainer,Tc.bind(null,t)),n},jc=function(e,t){if(t||={},!e)throw Error(`No node provided`);return ic.call(e,nc)===!1?!1:Ec(t,e)},Mc=Symbol(`NOT_FOUND`);function Nc(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function Pc(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function Fc(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var Ic=e=>Array.isArray(e)?e:[e];function Lc(e){let t=Array.isArray(e[0])?e[0]:e;return Fc(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function Rc(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function zc(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Mc},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Bc(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return Mc}function i(t,i){r(t)===Mc&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var Vc=(e,t)=>e===t;function Hc(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function Uc(e,t){let{equalityCheck:n=Vc,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=Hc(n),o=0,s=r<=1?zc(a):Bc(r,a);function c(){let t=s.get(arguments);if(t===Mc){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var Wc=class{constructor(e){this.value=e}deref(){return this.value}},Gc=typeof WeakRef<`u`?WeakRef:Wc,Kc=0,qc=1;function Jc(){return{s:Kc,v:void 0,o:null,p:null}}function Yc(e,t={}){let n=Jc(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=Jc(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=Jc(),e.set(n,t)):t=r}}let s=t,c;if(t.s===qc)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new Gc(c):c}return s.s=qc,s.v=c,c}return o.clearCache=()=>{n=Jc(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Xc(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),Nc(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=Yc,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=Ic(c),p=Ic(u),m=Lc(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=Rc(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var Zc=Xc(Yc),Qc=Object.assign((e,t=Zc)=>{Pc(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>Qc}),$c={exports:{}},el={},tl;function nl(){if(tl)return el;tl=1;var e=H.default;function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var n=typeof Object.is==`function`?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function s(e,t){var n=t(),s=r({inst:{value:n,getSnapshot:t}}),l=s[0].inst,u=s[1];return a(function(){l.value=n,l.getSnapshot=t,c(l)&&u({inst:l})},[e,n,t]),i(function(){return c(l)&&u({inst:l}),e(function(){c(l)&&u({inst:l})})},[e]),o(n),n}function c(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch{return!0}}function l(e,t){return t()}var u=typeof window>`u`||typeof window.document>`u`||typeof window.document.createElement>`u`?l:s;return el.useSyncExternalStore=e.useSyncExternalStore===void 0?u:e.useSyncExternalStore,el}var rl;function il(){return rl||(rl=1,$c.exports=nl()),$c.exports}var al=il(),ol={exports:{}},sl={},cl;function ll(){if(cl)return sl;cl=1;var e=H.default,t=il();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,s=e.useMemo,c=e.useDebugValue;return sl.useSyncExternalStoreWithSelector=function(e,t,n,l,u){var d=a(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,a=e,e=l(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return o=t}return o=e}if(t=o,r(a,e))return t;var n=l(e);return u!==void 0&&u(t,n)?(a=e,t):(a=e,o=n)}var i=!1,a,o,s=n===void 0?null:n;return[function(){return e(t())},s===null?void 0:function(){return e(s())}]},[t,n,l,u]);var p=i(e,d[0],d[1]);return o(function(){f.hasValue=!0,f.value=p},[p]),c(p),p},sl}var ul;function dl(){return ul||(ul=1,ol.exports=ll()),ol.exports}var fl=dl(),pl={};function ml(e,t){let n=H.useRef(pl);return n.current===pl&&(n.current=e(t)),n}var hl=[],gl;function _l(){return gl}function vl(e){hl.push(e)}function yl(e){let t=(t,n)=>{let r=ml(xl).current,i;try{gl=r;for(let e of hl)e.before(r);i=e(t,n);for(let e of hl)e.after(r);r.didInitialize=!0}finally{gl=void 0}return i};return t.displayName=e.displayName||e.name,t}function bl(e){return H.forwardRef(yl(e))}function xl(){return{didInitialize:!1}}function Sl(e){let t=H.useRef(!0);t.current&&(t.current=!1,e())}var K=typeof document<`u`?H.useLayoutEffect:()=>{};function Cl(e,...t){let n=new URL(`https://base-ui.com/production-error`);return n.searchParams.set(`code`,e.toString()),t.forEach(e=>n.searchParams.append(`args[]`,e)),`Base UI error #${e}; visit ${n} for the full message.`}var wl=H.createContext(void 0);function Tl(e){let t=H.useContext(wl);if(t===void 0&&!e)throw Error(Cl(72));return t}var El=[];function Dl(e){H.useEffect(e,El)}var Ol=0,kl=class e{static create(){return new e}currentId=Ol;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ol,t()},e)}isStarted(){return this.currentId!==Ol}clear=()=>{this.currentId!==Ol&&(clearTimeout(this.currentId),this.currentId=Ol)};disposeEffect=()=>this.clear};function Al(){let e=ml(kl.create).current;return Dl(e.disposeEffect),e}function jl(e){let t=ml(Ml,e).current;return t.next=e,K(t.effect),t}function Ml(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Nl=H[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Pl=Nl&&Nl!==H.useLayoutEffect?Nl:e=>e();function q(e){let t=ml(Fl).current;return t.next=e,Pl(t.effect),t.trampoline}function Fl(){let e={next:void 0,callback:Il,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Il(){}function J(e){return e?.ownerDocument||document}var Ll=typeof navigator<`u`,Rl=ql(),zl=Yl(),Bl=Jl(),Vl=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),Hl=Rl.platform===`MacIntel`&&Rl.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Rl.platform);Ll&&/firefox/i.test(Bl);var Ul=Ll&&/apple/i.test(navigator.vendor),Wl=Ll&&/android/i.test(zl)||/android/i.test(Bl),Gl=Ll&&zl.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,Kl=Bl.includes(`jsdom/`);function ql(){if(!Ll)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function Jl(){if(!Ll)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function Yl(){if(!Ll)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var Xl=`data-base-ui-focusable`,Zl=`active`,Ql=`selected`,$l=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,eu=`ArrowLeft`,tu=`ArrowRight`,nu=`ArrowUp`,ru=`ArrowDown`;function iu(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function au(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Ya(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ou(e,t){if(!qa(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(au(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function su(e){return`composedPath`in e?e.composedPath()[0]:e.target}function cu(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function lu(e){return e.matches(`html,body`)}function uu(e){return Ja(e)&&e.matches($l)}function du(e){return e?e.getAttribute(`role`)===`combobox`&&uu(e):!1}function fu(e){if(!e||Kl)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function pu(e){return e?e.hasAttribute(Xl)?e:e.querySelector(`[${Xl}]`)||e:null}function mu(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...mu(e,t.id,n)])}function hu(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function gu(e){e.preventDefault(),e.stopPropagation()}function _u(e){return`nativeEvent`in e}function vu(e){return e.pointerType===``&&e.isTrusted?!0:Wl&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function yu(e){return Kl?!1:!Wl&&e.width===0&&e.height===0||Wl&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function bu(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function xu(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function Su(e,t,n){return Math.floor(e/t)!==n}function Cu(e,t){return t<0||t>=e.current.length}function wu(e,t){return Eu(e,{disabledIndices:t})}function Tu(e,t){return Eu(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Eu(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.current.length-1&&ju(e,a,r));return a}function Du(e,{event:t,orientation:n,loopFocus:r,rtl:i,cols:a,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:l,stopEvent:u=!1}){let d=l,f=[],p={},m=!1;{let t=null,n=-1;e.current.forEach((e,r)=>{if(e==null)return;let i=e.closest(`[role="row"]`);i&&(m=!0),(i!==t||n===-1)&&(t=i,n+=1,f[n]=[]),f[n].push(r),p[r]=n})}let h=m&&f.length>0&&f.some(e=>e.length!==a);function g(t){if(!h||l===-1)return;let n=p[l];if(n==null)return;let i=f[n].indexOf(l),a=t===`up`?n-1:n+1;r&&(a<0?a=f.length-1:a>=f.length&&(a=0));let s=new Set;for(;a>=0&&a<f.length&&!s.has(a);){s.add(a);let n=f[a];if(n.length===0){a=t===`up`?a-1:a+1;continue}let c=Math.min(i,n.length-1);for(let t=c;t>=0;--t){let r=n[t];if(!ju(e,r,o))return r}a=t===`up`?a-1:a+1,r&&(a<0?a=f.length-1:a>=f.length&&(a=0))}}if(t.key===nu){let n=g(`up`);if(n!==void 0)u&&gu(t),d=n;else{if(u&&gu(t),l===-1)d=c;else if(d=Eu(e,{startingIndex:d,amount:a,decrement:!0,disabledIndices:o}),r&&(l-a<s||d<0)){let e=l%a,t=c%a,n=c-(t-e);d=t===e?c:t>e?n:n-a}Cu(e,d)&&(d=l)}}if(t.key===ru){let n=g(`down`);n===void 0?(u&&gu(t),l===-1?d=s:(d=Eu(e,{startingIndex:l,amount:a,disabledIndices:o}),r&&l+a>c&&(d=Eu(e,{startingIndex:l%a-a,amount:a,disabledIndices:o}))),Cu(e,d)&&(d=l)):(u&&gu(t),d=n)}if(n===`both`){let n=xo(l/a);t.key===(i?eu:tu)&&(u&&gu(t),l%a===a-1?r&&(d=Eu(e,{startingIndex:l-l%a-1,disabledIndices:o})):(d=Eu(e,{startingIndex:l,disabledIndices:o}),r&&Su(d,a,n)&&(d=Eu(e,{startingIndex:l-l%a-1,disabledIndices:o}))),Su(d,a,n)&&(d=l)),t.key===(i?tu:eu)&&(u&&gu(t),l%a===0?r&&(d=Eu(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o})):(d=Eu(e,{startingIndex:l,decrement:!0,disabledIndices:o}),r&&Su(d,a,n)&&(d=Eu(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o}))),Su(d,a,n)&&(d=l));let s=xo(c/a)===n;Cu(e,d)&&(d=r&&s?t.key===(i?tu:eu)?c:Eu(e,{startingIndex:l-l%a-1,disabledIndices:o}):l)}return d}function Ou(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function ku(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function Au(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function ju(e,t,n){if(typeof n==`function`)return n(t);if(n)return n.includes(t);let r=e.current[t];return r?r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`:!1}var Mu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function Nu(e,t){let n=kc(e,Mu()),r=n.length;if(r===0)return;let i=iu(J(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Pu(e){return Nu(J(e).body,1)||e}function Fu(e){return Nu(J(e).body,-1)||e}function Iu(e,t){if(!e)return null;let n=kc(J(e).body,Mu()),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Lu(e){return Iu(e,1)}function Ru(e){return Iu(e,-1)}function zu(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!au(n,r)}function Bu(e){kc(e,Mu()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Vu(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var Hu={...H},Uu=0;function Wu(e,t=`mui`){let[n,r]=H.useState(e),i=e||n;return H.useEffect(()=>{n??(Uu+=1,r(`${t}-${Uu}`))},[n,t]),i}var Gu=Hu.useId;function Ku(e,t){if(Gu!==void 0){let n=Gu();return e??(t?`${t}-${n}`:n)}return Wu(e,t)}function qu(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Ju=class{nodesRef={current:[]};events=qu();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Yu=H.createContext(null),Xu=H.createContext(null),Zu=()=>H.useContext(Yu)?.id||null,Qu=e=>{let t=H.useContext(Xu);return e??t};function $u(e){let t=Ku(),n=Qu(e),r=Zu();return K(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function ed(e){let{children:t,id:n}=e,r=Zu();return(0,U.jsx)(Yu.Provider,{value:H.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function td(e){let{children:t,externalTree:n}=e,r=ml(()=>n??new Ju).current;return(0,U.jsx)(Xu.Provider,{value:r,children:t})}function nd(){}var rd=Object.freeze([]),id=Object.freeze({}),ad=500,od=500,sd={style:{transition:`none`}},cd=`data-base-ui-click-trigger`,ld={fallbackAxisSide:`none`},ud={fallbackAxisSide:`end`},dd={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},fd=`none`,pd=`trigger-press`,md=`trigger-hover`,hd=`trigger-focus`,gd=`outside-press`,_d=`item-press`,vd=`close-press`,yd=`focus-out`,bd=`escape-key`,xd=`list-navigation`,Sd=`cancel-open`,Cd=`sibling-open`,wd=`disabled`,Td=`imperative-action`,Ed=`window-resize`;function Dd(e,t,n,r){let i=!1,a=!1,o=r??id;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Od(e){return`data-base-ui-${e}`}Od(`safe-polygon`),`${$l}`;function kd(e,t,n){if(n&&!bu(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}var Ad=H.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new kl,currentIdRef:{current:null},currentContextRef:{current:null}});function jd(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=H.useRef(n),a=H.useRef(n),o=H.useRef(null),s=H.useRef(null),c=Al();return(0,U.jsx)(Ad.Provider,{value:H.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Md(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{open:i}=t,{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=H.useContext(Ad),[f,p]=H.useState(!1);return K(()=>{function e(){p(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current}if(a.current&&!i&&a.current===r){if(p(!1),s){let t=r;return d.start(s,()=>{n.select(`open`)||a.current&&a.current!==t||e()}),()=>{d.clear()}}e()}},[i,r,a,o,s,c,l,d,n]),K(()=>{if(!i)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:n.setOpen,setIsInstantPhase:p},a.current=r,o.current={open:0,close:kd(c.current,`close`)},t!==null&&t!==r?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Dd(fd))):(p(!1),e?.setIsInstantPhase(!1))},[i,r,n,a,o,s,c,l,d]),K(()=>()=>{l.current=null},[l]),H.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function Nd(e,t,n,r){let i=ml(Fd).current;return Id(i,e,t,n,r)&&Rd(i,[e,t,n,r]),i.callback}function Pd(e){let t=ml(Fd).current;return Ld(t,e)&&Rd(t,e),t.callback}function Fd(){return{callback:null,cleanup:null,refs:[]}}function Id(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Ld(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Rd(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break}}}}}}var zd={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Bd={...zd,position:`fixed`,top:0,left:0},Vd={...zd,position:`absolute`},Hd=null;globalThis.requestAnimationFrame;var Ud=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Wd=class e{static create(){return new e}static request(e){return Ud.request(e)}static cancel(e){return Ud.cancel(e)}currentId=Hd;request(e){this.cancel(),this.currentId=Ud.request(()=>{this.currentId=Hd,e()})}cancel=()=>{this.currentId!==Hd&&(Ud.cancel(this.currentId),this.currentId=Hd)};disposeEffect=()=>this.cancel};function Gd(){let e=ml(Wd.create).current;return Dl(e.disposeEffect),e}var Kd=H.forwardRef(function(e,t){let[n,r]=H.useState();return K(()=>{Ul&&r(`button`)},[]),(0,U.jsx)(`span`,{...e,ref:t,style:Bd,"aria-hidden":n?void 0:!0,tabIndex:0,role:n,"data-base-ui-focus-guard":``})}),qd=0;function Jd(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(qd);let a=()=>e?.focus({preventScroll:n});i?a():qd=requestAnimationFrame(a)}var Yd={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Xd(e){return e===`inert`?Yd.inert:e===`aria-hidden`?Yd[`aria-hidden`]:Yd.none}var Zd=new WeakSet,Qd={},$d=0,ef=e=>e&&(e.host||ef(e.parentNode)),tf=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=ef(t);return e.contains(n)?n:null}).filter(e=>e!=null);function nf(e,t,n,r){let i=`data-base-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=tf(t,e),s=new Set,c=new Set(o),l=[];Qd[i]||(Qd[i]=new WeakMap);let u=Qd[i];o.forEach(d),f(t),s.clear();function d(e){!e||s.has(e)||(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){!e||c.has(e)||[].forEach.call(e.children,e=>{if(Ua(e)!==`script`)if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Xd(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&Zd.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return $d+=1,()=>{l.forEach(e=>{let t=Xd(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!Zd.has(e)&&a&&e.removeAttribute(a),Zd.delete(e)),r||e.removeAttribute(i)}),--$d,$d||(Yd.inert=new WeakMap,Yd[`aria-hidden`]=new WeakMap,Yd.none=new WeakMap,Zd=new WeakSet,Qd={})}}function rf(e,t=!1,n=!1){let r=J(e[0]).body;return nf(e.concat(Array.from(r.querySelectorAll(`[aria-live]`))),r,t,n)}var af=19;function of(e){return af>=e}function sf(e){if(!H.isValidElement(e))return null;let t=e,n=t.props;return(of(19)?n?.ref:t.ref)??null}function cf(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function lf(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function uf(e,t){return typeof e==`function`?e(t):e}function df(e,t){return typeof e==`function`?e(t):e}var ff={};function pf(e,t,n,r,i){let a={...yf(e,ff)};return t&&(a=hf(a,t)),n&&(a=hf(a,n)),r&&(a=hf(a,r)),i&&(a=hf(a,i)),a}function mf(e){if(e.length===0)return ff;if(e.length===1)return yf(e[0],ff);let t={...yf(e[0],ff)};for(let n=1;n<e.length;n+=1)t=hf(t,e[n]);return t}function hf(e,t){return vf(t)?t(e):gf(e,t)}function gf(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=cf(e.style,r);break;case`className`:e[n]=Sf(e.className,r);break;default:_f(n,r)?e[n]=bf(e[n],r):e[n]=r}}return e}function _f(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||typeof t>`u`)}function vf(e){return typeof e==`function`}function yf(e,t){return vf(e)?e(t):e??ff}function bf(e,t){return t?e?n=>{if(Cf(n)){let r=n;xf(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function xf(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Sf(e,t){return t?e?t+` `+e:t:e}function Cf(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Y(e,t,n={}){let r=t.render,i=wf(t,n);return n.enabled===!1?null:Ef(e,r,i,n.state??id)}function wf(e,t={}){let{className:n,style:r,render:i}=e,{state:a=id,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?uf(n,a):void 0,d=l?df(r,a):void 0,f=l?lf(a,c):id,p=l?cf(f,Array.isArray(s)?mf(s):s)??id:id;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=Pd([p.ref,sf(i),...o]):p.ref=Nd(p.ref,sf(i),o):Nd(null,null)),l?(u!==void 0&&(p.className=Sf(p.className,u)),d!==void 0&&(p.style=cf(p.style,d)),p):id}var Tf=Symbol.for(`react.lazy`);function Ef(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=pf(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===Tf&&(i=H.Children.toArray(t)[0]),H.cloneElement(i,e)}if(e&&typeof e==`string`)return Df(e,n);throw Error(Cl(8))}function Df(e,t){return e===`button`?(0,H.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,H.createElement)(`img`,{alt:``,...t,key:t.key}):H.createElement(e,t)}var Of=H.createContext(null),kf=()=>H.useContext(Of),Af=Od(`portal`);function jf(e={}){let{ref:t,container:n,componentProps:r=id,elementProps:i}=e,a=Ku(),o=kf()?.portalNode,[s,c]=H.useState(null),[l,u]=H.useState(null),d=q(e=>{e!==null&&u(e)}),f=H.useRef(null);K(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}if(a==null)return;let e=(n&&(Ka(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o,a]);let p=Y(`div`,r,{ref:[t,d],props:[{id:a,[Af]:``},i]});return{portalNode:l,portalSubtree:s&&p?Wn.createPortal(p,s):null}}var Mf=H.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,...s}=e,{portalNode:c,portalSubtree:l}=jf({container:r,ref:t,componentProps:e,elementProps:s}),u=H.useRef(null),d=H.useRef(null),f=H.useRef(null),p=H.useRef(null),[m,h]=H.useState(null),g=m?.modal,_=m?.open,v=typeof o==`boolean`?o:!!m&&!m.modal&&m.open&&!!c;H.useEffect(()=>{if(!c||g)return;function e(e){c&&e.relatedTarget&&zu(e)&&(e.type===`focusin`?Vu:Bu)(c)}return c.addEventListener(`focusin`,e,!0),c.addEventListener(`focusout`,e,!0),()=>{c.removeEventListener(`focusin`,e,!0),c.removeEventListener(`focusout`,e,!0)}},[c,g]),H.useEffect(()=>{!c||_||Vu(c)},[_,c]);let y=H.useMemo(()=>({beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:p,portalNode:c,setFocusManagerState:h}),[c]);return(0,U.jsxs)(H.Fragment,{children:[l,(0,U.jsxs)(Of.Provider,{value:y,children:[v&&c&&(0,U.jsx)(Kd,{"data-type":`outside`,ref:u,onFocus:e=>{zu(e,c)?f.current?.focus():Fu(m?m.domReference:null)?.focus()}}),v&&c&&(0,U.jsx)(`span`,{"aria-owns":c.id,style:dd}),c&&Wn.createPortal(n,c),v&&c&&(0,U.jsx)(Kd,{"data-type":`outside`,ref:d,onFocus:e=>{zu(e,c)?p.current?.focus():(Pu(m?m.domReference:null)?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,Dd(yd,e.nativeEvent)))}})]})]})});function Nf(e){return e==null?e:`current`in e?e.current:e}function Pf(e,t){let n=Wa(e.target);return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Ff=20,If=[];function Lf(){If=If.filter(e=>e.deref()?.isConnected)}function Rf(e){Lf(),e&&Ua(e)!==`body`&&(If.push(new WeakRef(e)),If.length>Ff&&(If=If.slice(-Ff)))}function zf(){return Lf(),If[If.length-1]?.deref()}function Bf(e){if(!e)return null;let t=Mu();return jc(e,t)?e:kc(e,t)[0]||e}function Vf(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():uo(e).display!==`none`}function Hf(e,t){if(!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=Mu(),r=Ac(e,n).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return jc(e,n)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),i=e.getAttribute(`tabindex`);t.current.includes(`floating`)||r.length===0?i!==`0`&&e.setAttribute(`tabindex`,`0`):(i!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Uf(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p}=e,m=`rootStore`in t?t.rootStore:t,h=m.useState(`open`),g=m.useState(`domReferenceElement`),_=m.useState(`floatingElement`),{events:v,dataRef:y}=m.context,b=q(()=>y.current.floatingContext?.nodeId),x=i===!1,S=du(g)&&x,C=H.useRef([`content`]),w=jl(i),T=jl(a),E=jl(l),D=Qu(p),O=kf(),k=H.useRef(null),A=H.useRef(null),j=H.useRef(!1),M=H.useRef(!1),N=H.useRef(!1),P=H.useRef(-1),F=H.useRef(``),I=H.useRef(``),ee=H.useRef(null),L=H.useRef(null),R=Nd(ee,f,O?.beforeInsideRef),z=Nd(L,O?.afterInsideRef),B=Al(),te=Al(),ne=Gd(),re=O!=null,V=pu(_),ie=q((e=V)=>e?kc(e,Mu()):[]),ae=q(e=>{let t=ie(e);return C.current.map(()=>t).filter(Boolean).flat()});H.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&au(V,iu(J(V)))&&ie().length===0&&!S&&gu(e)}let t=J(V);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,g,V,s,C,S,ie,ae]),H.useEffect(()=>{if(r||!h)return;let e=J(V);function t(){N.current=!1}function n(e){let t=su(e);N.current=!(au(_,t)||au(g,t)||au(O?.portalNode,t)),I.current=e.pointerType||`keyboard`,t?.closest(`[${cd}]`)&&(M.current=!0)}function i(){I.current=`keyboard`}return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`pointerup`,t,!0),e.addEventListener(`pointercancel`,t,!0),e.addEventListener(`keydown`,i,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`pointerup`,t,!0),e.removeEventListener(`pointercancel`,t,!0),e.removeEventListener(`keydown`,i,!0)}},[r,_,g,V,h,O]),H.useEffect(()=>{if(r||!c)return;let e=J(V);function t(){M.current=!0,te.start(0,()=>{M.current=!1})}function n(e){let t=su(e),n=ie().indexOf(t);n!==-1&&(P.current=n)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=su(t);queueMicrotask(()=>{let a=b(),c=m.context.triggerElements,l=n?.hasAttribute(Od(`focus-guard`))&&[ee.current,L.current,O?.beforeInsideRef.current,O?.afterInsideRef.current,O?.beforeOutsideRef.current,O?.afterOutsideRef.current,Nf(d),Nf(u)].includes(n),f=!(au(g,n)||au(_,n)||au(n,_)||au(O?.portalNode,n)||n!=null&&c.hasElement(n)||c.hasMatchingElement(e=>au(e,n))||l||D&&(mu(D.nodesRef.current,a).find(e=>au(e.context?.elements.floating,n)||au(e.context?.elements.domReference,n))||hu(D.nodesRef.current,a).find(e=>[e.context?.elements.floating,pu(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===g&&V&&Hf(V,C),o&&r!==g&&!Vf(i)&&iu(e)===e.body){if(Ja(V)&&(V.focus(),o===`popup`)){ne.request(()=>{V.focus()});return}let e=P.current,t=ie(),n=t[e]||t[t.length-1]||V;Ja(n)&&n.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(S||!s)&&n&&f&&!M.current&&(S||n!==zf())&&(j.current=!0,m.setOpen(!1,Dd(yd,t)))})}function a(){N.current||(y.current.insideReactTree=!0,B.start(0,()=>{y.current.insideReactTree=!1}))}let l=Ja(g)?g:null,f=[];if(!(!_&&!l))return l&&(l.addEventListener(`focusout`,i),l.addEventListener(`pointerdown`,t),f.push(()=>{l.removeEventListener(`focusout`,i),l.removeEventListener(`pointerdown`,t)})),_&&(_.addEventListener(`focusin`,n),_.addEventListener(`focusout`,i),O&&(_.addEventListener(`focusout`,a,!0),f.push(()=>{_.removeEventListener(`focusout`,a,!0)})),f.push(()=>{_.removeEventListener(`focusin`,n),_.removeEventListener(`focusout`,i)})),()=>{f.forEach(e=>{e()})}},[r,g,_,V,s,D,O,m,c,o,ie,S,b,C,y,B,te,ne,u,d]),H.useEffect(()=>{if(r||!_||!h)return;let e=Array.from(O?.portalNode?.querySelectorAll(`[${Od(`portal`)}]`)||[]);return rf([_,(D?hu(D.nodesRef.current,b()):[]).find(e=>du(e.context?.elements.domReference||null))?.context?.elements.domReference,...e,k.current,A.current,ee.current,L.current,O?.beforeOutsideRef.current,O?.afterOutsideRef.current,Nf(d),Nf(u),S?g:null].filter(e=>e!=null),s||S)},[h,r,g,_,s,C,O,S,D,b,u,d]),K(()=>{if(!h||r||!Ja(V))return;let e=iu(J(V));queueMicrotask(()=>{let t=ae(V),n=w.current,r=typeof n==`function`?n(E.current||``):n;if(r===void 0||r===!1)return;let i;i=r===!0||r===null?t[0]||V:Nf(r),i=i||t[0]||V,!au(V,e)&&Jd(i,{preventScroll:i===V})})},[r,h,V,x,ae,w,E]),K(()=>{if(r||!V)return;let e=J(V);Rf(iu(e));function t(e){if(e.open||(F.current=Pf(e.nativeEvent,I.current)),e.reason===md&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===gd)if(e.nested)j.current=!1;else if(vu(e.nativeEvent)||yu(e.nativeEvent))j.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}v.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,Bd),re&&g&&g.insertAdjacentElement(`afterend`,n);function i(){let e=T.current,t=typeof e==`function`?e(F.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=g||zf();return e&&e.isConnected?e:n}let r=g||zf()||n;return Nf(t)||r}return()=>{v.off(`openchange`,t);let r=iu(e),a=au(_,r)||D&&mu(D.nodesRef.current,b(),!1).some(e=>au(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=Bf(o),i=typeof T.current!=`boolean`;T.current&&!j.current&&Ja(t)&&(!(!i&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove(),j.current=!1})}},[r,_,V,T,y,v,D,re,g,b]),K(()=>{if(!Vl||h||!_)return;let e=iu(J(_));!Ja(e)||!uu(e)||au(_,e)&&e.blur()},[h,_]),K(()=>{if(!(r||!O))return O.setFocusManagerState({modal:s,closeOnFocusOut:c,open:h,onOpenChange:m.setOpen,domReference:g}),()=>{O.setFocusManagerState(null)}},[r,O,s,h,m,c,g]),K(()=>{if(!(r||!V))return Hf(V,C),()=>{queueMicrotask(Lf)}},[r,V,C]);let oe=!r&&(s?!S:!0)&&(re||s);return(0,U.jsxs)(H.Fragment,{children:[oe&&(0,U.jsx)(Kd,{"data-type":`inside`,ref:R,onFocus:e=>{if(s){let e=ae();Jd(e[e.length-1])}else O?.portalNode&&(j.current=!1,zu(e,O.portalNode)?Pu(g)?.focus():Nf(d??O.beforeOutsideRef)?.focus())}}),n,oe&&(0,U.jsx)(Kd,{"data-type":`inside`,ref:z,onFocus:e=>{s?Jd(ae()[0]):O?.portalNode&&(c&&(j.current=!0),zu(e,O.portalNode)?Fu(g)?.focus():Nf(u??O.afterOutsideRef)?.focus())}})]})}function Wf(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,{enabled:i=!0,event:a=`click`,toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:c=!0,touchOpenDelay:l=0,reason:u=pd}=t,d=H.useRef(void 0),f=Gd(),p=Al(),m=H.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){let t=d.current,i=e.nativeEvent,m=n.select(`open`);if(e.button!==0||a===`click`||bu(t,!0)&&s)return;let h=r.current.openEvent,g=h?.type,_=n.select(`domReferenceElement`)!==e.currentTarget,v=m&&_||!(m&&o&&(!(h&&c)||g===`click`||g===`mousedown`));if(uu(i.target)){let e=Dd(u,i,i.target);v&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e);return}let y=e.currentTarget;f.request(()=>{let e=Dd(u,i,y);v&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e)})},onClick(e){if(a===`mousedown-only`)return;let t=d.current;if(a===`mousedown`&&t){d.current=void 0;return}if(bu(t,!0)&&s)return;let i=n.select(`open`),f=r.current.openEvent,m=n.select(`domReferenceElement`)!==e.currentTarget,h=i&&m||!(i&&o&&(!(f&&c)||xu(f))),g=Dd(u,e.nativeEvent,e.currentTarget);h&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,g)}):n.setOpen(h,g)},onKeyDown(){d.current=void 0}}),[r,a,s,n,c,o,f,p,l,u]);return H.useMemo(()=>i?{reference:m}:id,[i,m])}function Gf(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Kf(e){return e!=null&&e.clientX!=null}function qf(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`}=t,l=H.useRef(!1),u=H.useRef(null),[d,f]=H.useState(),[p,m]=H.useState([]),h=q((e,t,r)=>{l.current||o.current.openEvent&&!Kf(o.current.openEvent)||n.set(`positionReference`,Gf(r??a,{x:e,y:t,axis:c,dataRef:o,pointerType:d}))}),g=q(e=>{r?u.current||m([]):h(e.clientX,e.clientY,e.currentTarget)}),_=bu(d)?i:r,v=H.useCallback(()=>{if(!_||!s)return;let e=Wa(i);function t(n){au(i,su(n))?(e.removeEventListener(`mousemove`,t),u.current=null):h(n.clientX,n.clientY)}if(!o.current.openEvent||Kf(o.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),u.current=null};return u.current=n,n}n.set(`positionReference`,a)},[_,s,i,o,a,n,h]);H.useEffect(()=>v(),[v,p]),H.useEffect(()=>{s&&!i&&(l.current=!1)},[s,i]),H.useEffect(()=>{!s&&r&&(l.current=!0)},[s,r]);let y=H.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return H.useMemo(()=>s?{reference:y,trigger:y}:{},[s,y])}var Jf={intentional:`onClick`,sloppy:`onPointerDown`};function Yf(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Xf(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`referenceElement`),o=n.useState(`domReferenceElement`),{onOpenChange:s,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:f=`sloppy`,referencePress:p=!1,referencePressEvent:m=`sloppy`,ancestorScroll:h=!1,bubbles:g,externalTree:_}=t,v=Qu(_),y=q(typeof d==`function`?d:()=>!1),b=typeof d==`function`?y:d,x=H.useRef(!1),{escapeKey:S,outsidePress:C}=Yf(g),w=H.useRef(null),T=Al(),E=Al(),D=q(()=>{E.clear(),c.current.insideReactTree=!1}),O=H.useRef(!1),k=H.useRef(``),A=q(e=>{k.current=e.pointerType}),j=q(()=>{let e=k.current,t=e===`pen`||!e?`mouse`:e,n=typeof f==`function`?f():f;return typeof n==`string`?n:n[t]}),M=q(e=>{if(!r||!l||!u||e.key!==`Escape`||O.current)return;let t=c.current.floatingContext?.nodeId,i=v?mu(v.nodesRef.current,t):[];if(!S&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a=Dd(bd,_u(e)?e.nativeEvent:e);n.setOpen(!1,a),!S&&!a.isPropagationAllowed&&e.stopPropagation()}),N=q(e=>{let t=j();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}),P=q(()=>{c.current.insideReactTree=!0,E.start(0,D)}),F=q((e,t=!1)=>{if(N(e)){D();return}if(c.current.insideReactTree){D();return}if(j()===`intentional`&&t||typeof b==`function`&&!b(e))return;let r=su(e),i=`[${Od(`inert`)}]`,a=J(n.select(`floatingElement`)).querySelectorAll(i),o=n.context.triggerElements;if(r&&(o.hasElement(r)||o.hasMatchingElement(e=>au(e,r))))return;let s=qa(r)?r:null;for(;s&&!lo(s);){let e=po(s);if(lo(e)||!qa(e))break;s=e}if(a.length&&qa(r)&&!lu(r)&&!au(r,n.select(`floatingElement`))&&Array.from(a).every(e=>!au(s,e)))return;if(Ja(r)&&!(`touches`in e)){let t=lo(r),n=uo(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}let l=c.current.floatingContext?.nodeId,u=v&&mu(v.nodesRef.current,l).some(t=>cu(e,t.context?.elements.floating));if(cu(e,n.select(`floatingElement`))||cu(e,n.select(`domReferenceElement`))||u)return;let d=v?mu(v.nodesRef.current,l):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,Dd(gd,e)),D()}),I=q(e=>{j()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!l||cu(e,n.select(`floatingElement`))||cu(e,n.select(`domReferenceElement`))||F(e)}),ee=q(e=>{if(j()!==`sloppy`||!n.select(`open`)||!l||cu(e,n.select(`floatingElement`))||cu(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(w.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{w.current&&(w.current.dismissOnTouchEnd=!1,w.current.dismissOnMouseDown=!1)}))}),L=q(e=>{let t=su(e);function n(){ee(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),R=q(e=>{let t=x.current;if(x.current=!1,T.clear(),e.type===`mousedown`&&w.current&&!w.current.dismissOnMouseDown)return;let n=su(e);function r(){e.type===`pointerdown`?I(e):F(e,t),n?.removeEventListener(e.type,r)}n?.addEventListener(e.type,r)}),z=q(e=>{if(j()!==`sloppy`||!w.current||cu(e,n.select(`floatingElement`))||cu(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-w.current.startX),i=Math.abs(t.clientY-w.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(w.current.dismissOnTouchEnd=!0),a>10&&(F(e),T.clear(),w.current=null)}),B=q(e=>{let t=su(e);function n(){z(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}),te=q(e=>{j()!==`sloppy`||!w.current||cu(e,n.select(`floatingElement`))||cu(e,n.select(`domReferenceElement`))||(w.current.dismissOnTouchEnd&&F(e),T.clear(),w.current=null)}),ne=q(e=>{let t=su(e);function n(){te(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)});H.useEffect(()=>{if(!r||!l)return;c.current.__escapeKeyBubbles=S,c.current.__outsidePressBubbles=C;let e=new kl;function t(e){n.setOpen(!1,Dd(fd,e))}function s(){e.clear(),O.current=!0}function d(){e.start(so()?5:0,()=>{O.current=!1})}let f=J(i);f.addEventListener(`pointerdown`,A,!0),u&&(f.addEventListener(`keydown`,M),f.addEventListener(`compositionstart`,s),f.addEventListener(`compositionend`,d)),b&&(f.addEventListener(`click`,R,!0),f.addEventListener(`pointerdown`,R,!0),f.addEventListener(`touchstart`,L,!0),f.addEventListener(`touchmove`,B,!0),f.addEventListener(`touchend`,ne,!0),f.addEventListener(`mousedown`,R,!0));let p=[];return h&&(qa(o)&&(p=ho(o)),qa(i)&&(p=p.concat(ho(i))),!qa(a)&&a&&a.contextElement&&(p=p.concat(ho(a.contextElement)))),p=p.filter(e=>e!==f.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{f.removeEventListener(`pointerdown`,A,!0),u&&(f.removeEventListener(`keydown`,M),f.removeEventListener(`compositionstart`,s),f.removeEventListener(`compositionend`,d)),b&&(f.removeEventListener(`click`,R,!0),f.removeEventListener(`pointerdown`,R,!0),f.removeEventListener(`touchstart`,L,!0),f.removeEventListener(`touchmove`,B,!0),f.removeEventListener(`touchend`,ne,!0),f.removeEventListener(`mousedown`,R,!0)),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),e.clear(),x.current=!1}},[c,i,a,o,u,b,r,s,h,l,S,C,M,F,R,I,L,B,ne,A,n]),H.useEffect(D,[b,D]);let re=H.useMemo(()=>({onKeyDown:M,...p&&{[Jf[m]]:e=>{n.setOpen(!1,Dd(pd,e.nativeEvent))},...m!==`intentional`&&{onClick(e){n.setOpen(!1,Dd(pd,e.nativeEvent))}}}}),[M,n,p,m]),V=q(e=>{let t=su(e.nativeEvent);!au(n.select(`floatingElement`),t)||e.button!==0||(x.current=!0)}),ie=q(e=>{!r||!l||e.button!==0||(x.current=!0)}),ae=H.useMemo(()=>({onKeyDown:M,onPointerDown:V,onMouseDown:V,onMouseUp:V,onClickCapture:P,onMouseDownCapture(e){P(),ie(e)},onPointerDownCapture(e){P(),ie(e)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[M,V,P,ie]);return H.useMemo(()=>l?{reference:re,floating:ae,trigger:re}:{},[l,re,ae])}var Zf=Xc({memoize:Uc,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),X=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(Cl(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},Qf=(...e)=>{let t=new WeakMap,n=1,r=e[e.length-1],i=e.length-1||1,a=r.length-i;if(a>3)throw Error(Cl(2));return(i,o,s,c)=>{let l=i.__cacheKey__;l||(l={id:n},i.__cacheKey__=l,n+=1);let u=t.get(l);if(!u){let n=e,i=[void 0,void 0,void 0];switch(a){case 0:break;case 1:n=[...e.slice(0,-1),()=>i[0],r];break;case 2:n=[...e.slice(0,-1),()=>i[0],()=>i[1],r];break;case 3:n=[...e.slice(0,-1),()=>i[0],()=>i[1],()=>i[2],r];break;default:throw Error(Cl(2))}u=Zf(...n),u.selectorArgs=i,t.set(l,u)}switch(u.selectorArgs[0]=o,u.selectorArgs[1]=s,u.selectorArgs[2]=c,a){case 0:return u(i);case 1:return u(i,o);case 2:return u(i,o,s);case 3:return u(i,o,s,c);default:throw Error(`unreachable`)}}},$f=of(19)?np:rp;function ep(e,t,n,r,i){return $f(e,t,n,r,i)}function tp(e,t,n,r,i){let a=H.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return al.useSyncExternalStore(e.subscribe,a,a)}vl({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),al.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function np(e,t,n,r,i){let a=_l();if(!a)return tp(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function rp(e,t,n,r,i){return fl.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var ip=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return ep(this,e,t,n,r)}},ap=class extends ip{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){H.useDebugValue(e),K(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;K(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;K(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){H.useDebugValue(e);let n=t!==void 0;K(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return H.useDebugValue(e),ep(this,this.selectors[e],t,n,r)}useContextCallback(e,t){H.useDebugValue(e);let n=q(t??nd);this.context[e]=n}useStateSetter(e){let t=H.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},op={open:X(e=>e.open),domReferenceElement:X(e=>e.domReferenceElement),referenceElement:X(e=>e.positionReference??e.referenceElement),floatingElement:X(e=>e.floatingElement),floatingId:X(e=>e.floatingId)},sp=class extends ap{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:qu(),nested:t,noEmit:n,triggerElements:i},op)}setOpen=(e,t)=>{if((!e||!this.state.open||xu(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}this.context.onOpenChange?.(e,t)}};function cp(e,t=!1,n=!1){let[r,i]=H.useState(e&&t?`idle`:void 0),[a,o]=H.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),K(()=>{if(!e&&a&&r!==`ending`&&n){let e=Wd.request(()=>{i(`ending`)});return()=>{Wd.cancel(e)}}},[e,a,r,n]),K(()=>{if(!e||t)return;let n=Wd.request(()=>{i(void 0)});return()=>{Wd.cancel(n)}},[t,e]),K(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Wd.request(()=>{i(`idle`)});return()=>{Wd.cancel(n)}},[t,e,a,i,r]),H.useMemo(()=>({mounted:a,setMounted:o,transitionStatus:r}),[a,r])}var lp=(function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e})({}),up={[lp.startingStyle]:``},dp={[lp.endingStyle]:``},fp={transitionStatus(e){return e===`starting`?up:e===`ending`?dp:null}};function pp(e,t=!1,n=!0){let r=Gd();return q((i,a=null)=>{r.cancel();function o(){Wn.flushSync(i)}let s=Nf(e);if(s==null)return;let c=s;if(typeof c.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let e=function(){let e=lp.startingStyle;if(!c.hasAttribute(e)){r.request(i);return}let t=new MutationObserver(()=>{c.hasAttribute(e)||(t.disconnect(),i())});t.observe(c,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})},i=function(){Promise.all(c.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||o()}).catch(()=>{let e=c.getAnimations();if(n){if(a?.aborted)return;o()}else e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&i()})};if(t){e();return}r.request(i)}})}function mp(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=q(i),o=pp(r,n,!1);H.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}function hp(e,t){let n=H.useRef(null),r=H.useRef(null);return H.useCallback(i=>{if(e!==void 0){if(n.current!==null){let e=n.current,i=r.current,a=t.context.triggerElements.getById(e);i&&a===i&&t.context.triggerElements.delete(e),n.current=null,r.current=null}i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function gp(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=hp(e,n),o=q(t=>{if(a(t),!t||!n.select(`open`))return;let i=n.select(`activeTriggerId`);if(i===e){n.update({activeTriggerElement:t,...r});return}i??n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return K(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function _p(e){let t=e.useState(`open`);K(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function vp(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=cp(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=q(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return mp({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var yp=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function bp(){return new sp({open:!1,floatingElement:null,referenceElement:null,triggerElements:new yp,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function xp(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:`idle`,floatingRootContext:bp(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:id,inactiveTriggerProps:id,popupProps:id}}var Sp=X(e=>e.triggerIdProp??e.activeTriggerId),Cp={open:X(e=>e.openProp??e.open),mounted:X(e=>e.mounted),transitionStatus:X(e=>e.transitionStatus),floatingRootContext:X(e=>e.floatingRootContext),preventUnmountingOnClose:X(e=>e.preventUnmountingOnClose),payload:X(e=>e.payload),activeTriggerId:Sp,activeTriggerElement:X(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:X((e,t)=>t!==void 0&&Sp(e)===t),isOpenedByTrigger:X((e,t)=>t!==void 0&&Sp(e)===t&&e.open),isMountedByTrigger:X((e,t)=>t!==void 0&&Sp(e)===t&&e.mounted),triggerProps:X((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:X(e=>e.popupProps),popupElement:X(e=>e.popupElement),positionerElement:X(e=>e.positionerElement)};function wp(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Ku(),a=Zu()!=null,o=ml(()=>new sp({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new yp,floatingId:i,nested:a,noEmit:!1})).current;return K(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=qa(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o.context.noEmit=!1,o}function Tp(e={}){let{nodeId:t,externalTree:n}=e,r=wp(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=H.useState(null),c=H.useRef(null),l=Qu(n);K(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=Ys({...e,elements:{...a,...o&&{reference:o}}}),d=H.useCallback(e=>{let t=qa(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=H.useState(null),[m,h]=H.useState(null);i.useSyncedValue(`referenceElement`,f),i.useSyncedValue(`domReferenceElement`,qa(f)?f:null),i.useSyncedValue(`floatingElement`,m);let g=H.useCallback(e=>{(qa(e)||e===null)&&(c.current=e,p(e)),(qa(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!qa(e))&&u.refs.setReference(e)},[u.refs,p]),_=H.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),v=H.useMemo(()=>({...u.refs,setReference:g,setFloating:_,setPositionReference:d,domReference:c}),[u.refs,g,_,d]),y=H.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),b=i.useState(`open`),x=i.useState(`floatingId`),S=H.useMemo(()=>({...u,dataRef:i.context.dataRef,open:b,onOpenChange:i.setOpen,events:i.context.events,floatingId:x,refs:v,elements:y,nodeId:t,rootStore:i}),[u,v,y,t,i,b,x]);return K(()=>{i.context.dataRef.current.floatingContext=S;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=S)}),H.useMemo(()=>({...u,context:S,refs:v,elements:y,rootStore:i}),[u,v,y,S,i])}function Ep(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=Ku(),o=Zu()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=ml(()=>new sp({open:s,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:a,nested:o,noEmit:n})).current;return K(()=>{let e={open:s,floatingId:a,referenceElement:c,floatingElement:l};qa(c)&&(e.domReferenceElement=c),d.state.positionReference===d.state.referenceElement&&(e.positionReference=c),d.update(e)},[s,a,c,l,d]),d.context.onOpenChange=i,d.context.nested=o,d.context.noEmit=n,d}var Dp=Gl&&Ul;function Op(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,delay:o}=t,s=H.useRef(!1),c=H.useRef(null),l=Al(),u=H.useRef(!0);H.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=Wa(e);function r(){let e=n.select(`domReferenceElement`);!n.select(`open`)&&Ja(e)&&e===iu(J(e))&&(s.current=!0)}function i(){u.current=!0}function o(){u.current=!1}return t.addEventListener(`blur`,r),Dp&&(t.addEventListener(`keydown`,i,!0),t.addEventListener(`pointerdown`,o,!0)),()=>{t.removeEventListener(`blur`,r),Dp&&(t.removeEventListener(`keydown`,i,!0),t.removeEventListener(`pointerdown`,o,!0))}},[n,a]),H.useEffect(()=>{if(!a)return;function e(e){if(e.reason===pd||e.reason===bd){let e=n.select(`domReferenceElement`);qa(e)&&(c.current=e,s.current=!0)}}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a,n]);let d=H.useMemo(()=>({onMouseLeave(){s.current=!1,c.current=null},onFocus(e){let t=e.currentTarget;if(s.current){if(c.current===t)return;s.current=!1,c.current=null}let r=su(e.nativeEvent);if(qa(r)){if(Dp&&!e.relatedTarget){if(!u.current&&!uu(r))return}else if(!fu(r))return}let i=ou(e.relatedTarget,n.context.triggerElements),{nativeEvent:a,currentTarget:d}=e,f=typeof o==`function`?o():o;if(n.select(`open`)&&i||f===0||f===void 0){n.setOpen(!0,Dd(hd,a,d));return}l.start(f,()=>{s.current||n.setOpen(!0,Dd(hd,a,d))})},onBlur(e){s.current=!1,c.current=null;let t=e.relatedTarget,r=e.nativeEvent,a=qa(t)&&t.hasAttribute(Od(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let e=n.select(`domReferenceElement`),o=iu(e?e.ownerDocument:document);!t&&o===e||au(i.current.floatingContext?.refs.floating.current,o)||au(e,o)||a||ou(t??o,n.context.triggerElements)||n.setOpen(!1,Dd(hd,r))})}}),[i,n,l,o]);return H.useMemo(()=>a?{reference:d,trigger:d}:{},[a,d])}var kp=Od(`safe-polygon`),Ap=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${$l}`;function jp(e){return e?!!e.closest(Ap):!1}var Mp=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new kl,this.restTimeout=new kl,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose};function Np(e){let t=ml(Mp.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||=t,Dl(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}var Pp=new Set([`click`,`mousedown`]);function Fp(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0}=t,l=Np(n),u=Qu(),d=Zu(),f=q(()=>l.interactedInside?!0:o.current.openEvent?Pp.has(o.current.openEvent.type):!1),p=q(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),m=q(e=>ou(e,n.context.triggerElements)),h=H.useCallback((e,t=!0)=>{let r=Ip(c,l.pointerType);r&&!l.handler?l.openChangeTimeout.start(r,()=>n.setOpen(!1,Dd(md,e))):t&&(l.openChangeTimeout.clear(),n.setOpen(!1,Dd(md,e)))},[c,n,l]),g=q(()=>{l.unbindMouseMove(),l.handler=void 0}),_=q(()=>{if(l.performedPointerEventsMutation){let e=J(i).body;e.style.pointerEvents=``,e.removeAttribute(kp),l.performedPointerEventsMutation=!1}}),v=q(e=>{if(!jp(su(e))){l.interactedInside=!1;return}l.interactedInside=!0});K(()=>{r||(l.pointerType=void 0,l.restTimeoutPending=!1,l.interactedInside=!1,g(),_())},[r,l,g,_]),H.useEffect(()=>()=>{g()},[g]),H.useEffect(()=>_,[_]),K(()=>{if(s&&r&&l.handleCloseOptions?.blockPointerEvents&&p()&&qa(a)&&i){l.performedPointerEventsMutation=!0;let e=J(i).body;e.setAttribute(kp,``);let t=a,n=i,r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),e.style.pointerEvents=`none`,t.style.pointerEvents=`auto`,n.style.pointerEvents=`auto`,()=>{e.style.pointerEvents=``,t.style.pointerEvents=``,n.style.pointerEvents=``}}},[s,r,a,i,l,p,u,d]),H.useEffect(()=>{if(!s)return;function e(e){f()||!o.current.floatingContext||!n.select(`open`)||m(e.relatedTarget)||(_(),g(),f()||h(e))}function t(e){l.openChangeTimeout.clear(),_(),l.handler?.(e),g()}function r(e){f()||h(e,!1)}let a=i;return a&&(a.addEventListener(`mouseleave`,e),a.addEventListener(`mouseenter`,t),a.addEventListener(`mouseleave`,r),a.addEventListener(`pointerdown`,v,!0)),()=>{a&&(a.removeEventListener(`mouseleave`,e),a.removeEventListener(`mouseenter`,t),a.removeEventListener(`mouseleave`,r),a.removeEventListener(`pointerdown`,v,!0))}},[s,i,n,o,f,m,h,_,g,v,l])}function Ip(e,t){return t&&!bu(t)?0:typeof e==`function`?e():e}function Lp(e){return typeof e==`function`?e():e}var Rp={current:null};function zp(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=Rp,externalTree:f,isActiveTrigger:p=!0}=t,m=Qu(f),h=Np(n),g=jl(s),_=jl(o),v=jl(l),y=jl(a);p&&(h.handleCloseOptions=g.current?.__options);let b=q(()=>h.interactedInside?!0:r.current.openEvent?[`click`,`mousedown`].includes(r.current.openEvent.type):!1),x=q(e=>ou(e,n.context.triggerElements)),S=H.useCallback((e,t=!0)=>{let r=kd(_.current,`close`,h.pointerType);r&&!h.handler?h.openChangeTimeout.start(r,()=>n.setOpen(!1,Dd(md,e))):t&&(h.openChangeTimeout.clear(),n.setOpen(!1,Dd(md,e)))},[_,n,h]),C=q(()=>{h.unbindMouseMove(),h.handler=void 0}),w=q(()=>{if(h.performedPointerEventsMutation){let e=J(n.select(`domReferenceElement`)).body;e.style.pointerEvents=``,e.removeAttribute(kp),h.performedPointerEventsMutation=!1}});H.useEffect(()=>{if(!a)return;function e(e){e.open||(h.openChangeTimeout.clear(),h.restTimeout.clear(),h.blockMouseMove=!0,h.restTimeoutPending=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,h]);let T=q(e=>{if(b()||!r.current.floatingContext||x(e.relatedTarget))return;let t=d.current;g.current?.({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){w(),C(),!b()&&t===n.select(`domReferenceElement`)&&S(e)}})(e)});return H.useEffect(()=>{if(!a)return;let e=d.current??(p?n.select(`domReferenceElement`):null);if(!qa(e))return;function t(e){if(h.openChangeTimeout.clear(),h.blockMouseMove=!1,c&&!bu(h.pointerType)||Lp(v.current)>0&&!kd(_.current,`open`))return;let t=kd(_.current,`open`,h.pointerType),r=n.select(`domReferenceElement`),i=n.context.triggerElements,a=(i.hasElement(e.target)||i.hasMatchingElement(t=>au(t,e.target)))&&(!r||!au(r,e.target)),o=e.currentTarget??null,s=n.select(`open`),l=!s||a;a&&s?n.setOpen(!0,Dd(md,e,o)):t?h.openChangeTimeout.start(t,()=>{l&&n.setOpen(!0,Dd(md,e,o))}):l&&n.setOpen(!0,Dd(md,e,o))}function i(e){if(b()){w();return}h.unbindMouseMove();let t=J(n.select(`domReferenceElement`));if(h.restTimeout.clear(),h.restTimeoutPending=!1,!x(e.relatedTarget)){if(g.current&&r.current.floatingContext){n.select(`open`)||h.openChangeTimeout.clear();let i=d.current;h.handler=g.current({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){w(),C(),y.current&&!b()&&i===n.select(`domReferenceElement`)&&S(e,!0)}});let a=h.handler;a(e),t.addEventListener(`mousemove`,a),h.unbindMouseMove=()=>{t.removeEventListener(`mousemove`,a)};return}(h.pointerType!==`touch`||!au(n.select(`floatingElement`),e.relatedTarget))&&S(e)}}function o(e){T(e)}return n.select(`open`)&&e.addEventListener(`mouseleave`,o),u&&e.addEventListener(`mousemove`,t,{once:!0}),e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,i),()=>{e.removeEventListener(`mouseleave`,o),u&&e.removeEventListener(`mousemove`,t),e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,i)}},[C,w,r,_,S,n,a,g,T,h,p,b,x,c,u,v,d,m,y]),H.useMemo(()=>{if(!a)return;function e(e){h.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.context.triggerElements,o=n.select(`open`),s=(a.hasElement(e.target)||a.hasMatchingElement(t=>au(t,e.target)))&&(!i||!au(i,e.target));if(c&&!bu(h.pointerType)||o&&!s||Lp(v.current)===0||!s&&h.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;h.restTimeout.clear();function l(){if(h.restTimeoutPending=!1,b())return;let e=n.select(`open`);!h.blockMouseMove&&(!e||s)&&n.setOpen(!0,Dd(md,t,r))}h.pointerType===`touch`?Wn.flushSync(()=>{l()}):s&&o?l():(h.restTimeoutPending=!0,h.restTimeout.start(Lp(v.current),l))}}},[a,h,b,c,n,v])}function Bp(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=H.useCallback(t=>Vp(t,e,`reference`),t),o=H.useCallback(t=>Vp(t,e,`floating`),n),s=H.useCallback(t=>Vp(t,e,`item`),r),c=H.useCallback(t=>Vp(t,e,`trigger`),i);return H.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function Vp(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[Xl]=``);for(let t in e)i&&e&&(t===Zl||t===Ql)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&Hp(a,s,i,r)}return Hp(a,e,i,r),a}function Hp(e,t,n,r){for(let i in t){let a=t[i];n&&(i===Zl||i===Ql)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var Up=`Escape`;function Wp(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Gp(e,t){return Wp(t,e===nu||e===ru,e===eu||e===tu)}function Kp(e,t,n){return Wp(t,e===ru,n?e===eu:e===tu)||e===`Enter`||e===` `||e===``}function qp(e,t,n){return Wp(t,n?e===eu:e===tu,e===ru)}function Jp(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===Up:Wp(t,n?e===tu:e===eu,e===nu)}function Yp(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{listRef:s,activeIndex:c,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:f=!1,loopFocus:p=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:_=`auto`,focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:b=void 0,orientation:x=`vertical`,parentOrientation:S,cols:C=1,id:w,resetOnPointerLeave:T=!0,externalTree:E}=t,D=jl(pu(i)),O=Zu(),k=Qu(E);K(()=>{o.current.orientation=x},[o,x]);let A=du(a),j=H.useRef(_),M=H.useRef(d??-1),N=H.useRef(null),P=H.useRef(!0),F=q(e=>{l(M.current===-1?null:M.current,e)}),I=H.useRef(F),ee=H.useRef(!!i),L=H.useRef(r),R=H.useRef(!1),z=H.useRef(!1),B=jl(b),te=jl(r),ne=jl(d),re=jl(T),V=q(()=>{function e(e){g?k?.events.emit(`virtualfocus`,e):Jd(e,{sync:R.current,preventScroll:!0})}let t=s.current[M.current],n=z.current;t&&e(t),(R.current?e=>e():requestAnimationFrame)(()=>{let r=s.current[M.current]||t;r&&(t||e(r),ae&&(n||!P.current)&&r.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});K(()=>{u&&(r&&i?(M.current=d??-1,j.current&&d!=null&&(z.current=!0,F())):ee.current&&(M.current=-1,I.current()))},[u,r,i,d,F]),K(()=>{if(u){if(!r){R.current=!1;return}if(i)if(c==null){if(R.current=!1,ne.current!=null)return;if(ee.current&&(M.current=-1,V()),(!L.current||!ee.current)&&j.current&&(N.current!=null||j.current===!0&&N.current==null)){let e=0,t=()=>{s.current[0]==null?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e+=1):(M.current=N.current==null||Kp(N.current,x,h)||m?wu(s):Tu(s),N.current=null,F())};t()}}else Cu(s,c)||(M.current=c,V(),z.current=!1)}},[u,r,i,c,ne,m,s,x,h,F,V,B]),K(()=>{if(!u||i||!k||g||!ee.current)return;let e=k.nodesRef.current,t=e.find(e=>e.id===O)?.context?.elements.floating,n=iu(J(i)),r=e.some(e=>e.context&&au(e.context.elements.floating,n));t&&!r&&P.current&&t.focus({preventScroll:!0})},[u,i,k,O,g]),K(()=>{I.current=F,L.current=r,ee.current=!!i}),K(()=>{r||(N.current=null,j.current=_)},[r,_]);let ie=c!=null,ae=H.useMemo(()=>{function e(e){if(!te.current)return;let t=s.current.indexOf(e.currentTarget);t!==-1&&M.current!==t&&(M.current=t,F(e))}return{onFocus(t){R.current=!0,e(t)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(t){R.current=!0,z.current=!1,v&&e(t)},onPointerLeave(e){if(!te.current||!P.current||e.pointerType===`touch`)return;R.current=!0;let t=e.relatedTarget;!v||s.current.includes(t)||re.current&&(Jd(null,{sync:!0}),M.current=-1,F(e),g||D.current?.focus({preventScroll:!0}))}}},[te,D,v,s,F,re,g]),oe=H.useCallback(()=>S??k?.nodesRef.current.find(e=>e.id===O)?.context?.dataRef?.current.orientation,[O,k,S]),se=q(e=>{if(P.current=!1,R.current=!0,e.which===229||!te.current&&e.currentTarget===D.current)return;if(m&&Jp(e.key,x,h,C)){Gp(e.key,oe())||gu(e),n.setOpen(!1,Dd(xd,e.nativeEvent)),Ja(a)&&(g?k?.events.emit(`virtualfocus`,a):a.focus());return}let t=M.current,i=wu(s,b),o=Tu(s,b);if(A||(e.key===`Home`&&(gu(e),M.current=i,F(e)),e.key===`End`&&(gu(e),M.current=o,F(e))),C>1){let t=Array.from({length:s.current.length},()=>({width:1,height:1})),n=Ou(t,C,!1),r=n.findIndex(e=>e!=null&&!ju(s,e,b)),a=n.reduce((e,t,n)=>t!=null&&!ju(s,t,b)?n:e,-1),c=n[Du({current:n.map(e=>e==null?null:s.current[e])},{event:e,orientation:x,loopFocus:p,rtl:h,cols:C,disabledIndices:Au([...(typeof b==`function`?null:b)||s.current.map((e,t)=>ju(s,t,b)?t:void 0),void 0],n),minIndex:r,maxIndex:a,prevIndex:ku(M.current>o?i:M.current,t,n,C,e.key===ru?`bl`:e.key===(h?eu:tu)?`tr`:`tl`),stopEvent:!0})];if(c!=null&&(M.current=c,F(e)),x===`both`)return}if(Gp(e.key,x)){if(gu(e),r&&!g&&iu(e.currentTarget.ownerDocument)===e.currentTarget){M.current=Kp(e.key,x,h)?i:o,F(e);return}Kp(e.key,x,h)?p?t>=o?f&&t!==s.current.length?M.current=-1:(R.current=!1,M.current=i):M.current=Eu(s,{startingIndex:t,disabledIndices:b}):M.current=Math.min(o,Eu(s,{startingIndex:t,disabledIndices:b})):p?t<=i?f&&t!==-1?M.current=s.current.length:(R.current=!1,M.current=o):M.current=Eu(s,{startingIndex:t,decrement:!0,disabledIndices:b}):M.current=Math.max(i,Eu(s,{startingIndex:t,decrement:!0,disabledIndices:b})),Cu(s,M.current)&&(M.current=-1),F(e)}}),ce=H.useMemo(()=>g&&r&&ie&&{"aria-activedescendant":`${w}-${c}`},[g,r,ie,w,c]),le=H.useMemo(()=>({"aria-orientation":x===`both`?void 0:x,...A?{}:ce,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&r&&!g){let t=su(e.nativeEvent);if(t&&!au(D.current,t))return;gu(e),n.setOpen(!1,Dd(yd,e.nativeEvent)),Ja(a)&&a.focus();return}se(e)},onPointerMove(){P.current=!0}}),[ce,se,D,x,A,n,r,g,a]),ue=H.useMemo(()=>{function e(e){_===`auto`&&vu(e.nativeEvent)&&(j.current=!g)}function t(e){j.current=_,_===`auto`&&yu(e.nativeEvent)&&(j.current=!0)}return{onKeyDown(e){let t=n.select(`open`);P.current=!1;let r=e.key.startsWith(`Arrow`),i=qp(e.key,oe(),h),a=Gp(e.key,x),o=(m?i:a)||e.key===`Enter`||e.key.trim()===``;if(g&&t)return se(e);if(!(!t&&!y&&r)){if(o){let t=Gp(e.key,oe());N.current=m&&t?null:e.key}if(m){i&&(gu(e),t?(M.current=wu(s,B.current),F(e)):n.setOpen(!0,Dd(xd,e.nativeEvent,e.currentTarget)));return}a&&(ne.current!=null&&(M.current=ne.current),gu(e),!t&&y?n.setOpen(!0,Dd(xd,e.nativeEvent,e.currentTarget)):se(e),t&&F(e))}},onFocus(e){n.select(`open`)&&!g&&(M.current=-1,F(e))},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[se,B,_,s,m,F,n,y,x,oe,h,ne,g]),de=H.useMemo(()=>({...ce,...ue}),[ce,ue]);return H.useMemo(()=>u?{reference:de,floating:le,item:ae,trigger:ue}:{},[u,de,le,ue,ae])}var Xp=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Zp(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{role:s=`dialog`}=t,c=Ku(),l=a?.id||c,u=H.useMemo(()=>pu(o)?.id||i,[o,i]),d=Xp.get(s)??s,f=Zu()!=null,p=H.useMemo(()=>d===`tooltip`||s===`label`?id:{"aria-haspopup":d===`alertdialog`?`dialog`:d,"aria-expanded":`false`,...d===`listbox`&&{role:`combobox`},...d===`menu`&&f&&{role:`menuitem`},...s===`select`&&{"aria-autocomplete":`none`},...s===`combobox`&&{"aria-autocomplete":`list`}},[d,f,s]),m=H.useMemo(()=>d===`tooltip`||s===`label`?{[`aria-${s===`label`?`labelledby`:`describedby`}`]:r?u:void 0}:{...p,"aria-expanded":r?`true`:`false`,"aria-controls":r?u:void 0,...d===`menu`&&{id:l}},[d,u,r,l,s,p]),h=H.useMemo(()=>{let e={id:u,...d&&{role:d}};return d===`tooltip`||s===`label`?e:{...e,...d===`menu`&&{"aria-labelledby":l}}},[d,u,l,s]),g=H.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${u}-fui-option`}};switch(s){case`select`:case`combobox`:return{...n,"aria-selected":t}}return{}},[u,s]);return H.useMemo(()=>({reference:m,floating:h,item:g,trigger:p}),[m,h,p,g])}function Qp(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,i=n.useState(`open`),{listRef:a,activeIndex:o,onMatch:s,onTypingChange:c,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,f=Al(),p=H.useRef(``),m=H.useRef(d??o??-1),h=H.useRef(null);K(()=>{!i&&d!==null||(f.clear(),h.current=null,p.current!==``&&(p.current=``))},[i,d,f]),K(()=>{i&&p.current===``&&(m.current=d??o??-1)},[i,d,o]);let g=q(e=>{e?r.current.typing||(r.current.typing=e,c?.(e)):r.current.typing&&(r.current.typing=e,c?.(e))}),_=q(e=>{function t(e,t,n){let r=t.find(e=>e?.toLocaleLowerCase().indexOf(n.toLocaleLowerCase())===0);return r?e.indexOf(r):-1}let n=a.current;if(p.current.length>0&&p.current[0]!==` `&&(t(n,n,p.current)===-1?g(!1):e.key===` `&&gu(e)),n==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;i&&e.key!==` `&&(gu(e),g(!0));let r=p.current===``;r&&(m.current=d??o??-1),n.every(e=>e?e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase():!0)&&p.current===e.key&&(p.current=``,m.current=h.current),p.current+=e.key,f.start(u,()=>{p.current=``,m.current=h.current,g(!1)});let c=r?d??o??-1:m.current,l=t(n,[...n.slice((c||0)+1),...n.slice(0,(c||0)+1)],p.current);l===-1?e.key!==` `&&(p.current=``,g(!1)):(s?.(l),h.current=l)}),v=q(e=>{let t=e.relatedTarget,r=n.select(`domReferenceElement`),i=n.select(`floatingElement`),a=au(r,t),o=au(i,t);a||o||(f.clear(),p.current=``,m.current=h.current,g(!1))}),y=H.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]),b=H.useMemo(()=>({onKeyDown:_,onKeyUp(e){e.key===` `&&g(!1)},onBlur:v}),[_,v,g]);return H.useMemo(()=>l?{reference:y,floating:b}:{},[l,y,b])}function $p(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function em(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function tm(e={}){let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i=new kl,a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=({x:e,y:n,placement:o,elements:s,onClose:c,nodeId:u,tree:d})=>function(f){function p(){i.clear(),c()}if(i.clear(),!s.domReference||!s.floating||o==null||e==null||n==null)return;let{clientX:m,clientY:h}=f,g=[m,h],_=su(f),v=f.type===`mouseleave`,y=au(s.floating,_),b=au(s.domReference,_),x=s.domReference.getBoundingClientRect(),S=s.floating.getBoundingClientRect(),C=o.split(`-`)[0],w=e>S.right-S.width/2,T=n>S.bottom-S.height/2,E=em(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,A=(D?x:S).right,j=(O?x:S).top,M=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&qa(f.relatedTarget)&&au(s.floating,f.relatedTarget)||d&&mu(d.nodesRef.current,u).some(({context:e})=>e?.open))return;if(C===`top`&&n>=x.bottom-1||C===`bottom`&&n<=x.top+1||C===`left`&&e>=x.right-1||C===`right`&&e<=x.left+1)return p();let N=[];switch(C){case`top`:N=[[k,x.top+1],[k,S.bottom-1],[A,S.bottom-1],[A,x.top+1]];break;case`bottom`:N=[[k,S.top+1],[k,x.bottom-1],[A,x.bottom-1],[A,S.top+1]];break;case`left`:N=[[S.right-1,M],[S.right-1,j],[x.left+1,j],[x.left+1,M]];break;case`right`:N=[[x.right-1,M],[x.right-1,j],[S.left+1,j],[S.left+1,M]];break}function P([e,n]){switch(C){case`top`:return[[D?e+t/2:w?e+t*4:e-t*4,n+t+1],[D?e-t/2:w?e+t*4:e-t*4,n+t+1],[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]];case`bottom`:return[[D?e+t/2:w?e+t*4:e-t*4,n-t],[D?e-t/2:w?e+t*4:e-t*4,n-t],[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]];case`left`:{let r=[e+t+1,O?n+t/2:T?n+t*4:n-t*4],i=[e+t+1,O?n-t/2:T?n+t*4:n-t*4];return[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom],r,i]}case`right`:return[[e-t,O?n+t/2:T?n+t*4:n-t*4],[e-t,O?n-t/2:T?n+t*4:n-t*4],[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]];default:return[]}}if(!$p([m,h],N)){if(a&&!E)return p();if(!v&&r){let e=l(f.clientX,f.clientY);if(e!==null&&e<.1)return p()}$p([m,h],P([e,n]))?!a&&r&&i.start(40,p):p()}};return u.__options={blockPointerEvents:n},u}var nm={...Cp,disabled:X(e=>e.disabled),instantType:X(e=>e.instantType),isInstantPhase:X(e=>e.isInstantPhase),trackCursorAxis:X(e=>e.trackCursorAxis),disableHoverablePopup:X(e=>e.disableHoverablePopup),lastOpenChangeReason:X(e=>e.openChangeReason),closeDelay:X(e=>e.closeDelay),hasViewport:X(e=>e.hasViewport)},rm=class e extends ap{constructor(e){super({...im(),...e},{popupRef:H.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new yp},nm)}setOpen=(e,t)=>{let n=t.reason,r=n===md,i=e&&n===hd,a=!e&&(n===pd||n===bd);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===md&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?Wn.flushSync(o):o()};static useStore(t,n){let r=ml(()=>new e(n)).current,i=t??r,a=Ep({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=a,i}};function im(){return{...xp(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}var am=yl(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=rm.useStore(l?.store,{open:n,openProp:r,activeTriggerId:d,triggerIdProp:u});Sl(()=>{r===void 0&&p.state.open===!1&&n===!0&&p.update({open:!0,activeTriggerId:d})}),p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i}),K(()=>{m&&t&&p.setOpen(!1,Dd(wd))},[m,t,p]),p.useSyncedValue(`disabled`,t),_p(p);let{forceUnmount:v,transitionStatus:y}=vp(h,p),b=p.useState(`isInstantPhase`),x=p.useState(`instantType`),S=p.useState(`lastOpenChangeReason`),C=H.useRef(null);K(()=>{y===`ending`&&S===fd||y!==`ending`&&b?(x!==`delay`&&(C.current=x),p.set(`instantType`,`delay`)):C.current!==null&&(p.set(`instantType`,C.current),C.current=null)},[y,b,S,x,p]),K(()=>{h&&g==null&&p.set(`payload`,void 0)},[p,g,h]);let w=H.useCallback(()=>{p.setOpen(!1,om(p,Td))},[p]);H.useImperativeHandle(o,()=>({unmount:v,close:w}),[v,w]);let T=p.useState(`floatingRootContext`),{getReferenceProps:E,getFloatingProps:D,getTriggerProps:O}=Bp([Xf(T,{enabled:!t,referencePress:!0}),qf(T,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),k=H.useMemo(()=>E(),[E]),A=H.useMemo(()=>O(),[O]),j=H.useMemo(()=>D(),[D]);return p.useSyncedValues({activeTriggerProps:k,inactiveTriggerProps:A,popupProps:j}),(0,U.jsx)(wl.Provider,{value:p,children:typeof f==`function`?f({payload:_}):f})});function om(e,t){let n=Dd(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}var sm=(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=lp.startingStyle]=`startingStyle`,e[e.endingStyle=lp.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({}),cm=(function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e})({}),lm={[cm.popupOpen]:``},um={[cm.popupOpen]:``,[cm.pressed]:``},dm={[sm.open]:``},fm={[sm.closed]:``},pm={[sm.anchorHidden]:``},mm={open(e){return e?lm:null}},hm={open(e){return e?um:null}},gm={open(e){return e?dm:fm},anchorHidden(e){return e?pm:null}};function _m(e){return Ku(e,`base-ui`)}var vm=H.createContext(void 0);function ym(){return H.useContext(vm)}var bm=(function(e){return e[e.popupOpen=cm.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e})({}),xm=600,Sm=bl(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeDelay:c,id:l,...u}=e,d=Tl(!0),f=i?.store??d;if(!f)throw Error(Cl(82));let p=_m(l),m=f.useState(`isTriggerActive`,p),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`floatingRootContext`),_=H.useRef(null),v=s??xm,y=c??0,{registerTrigger:b,isMountedByThisTrigger:x}=gp(p,_,f,{payload:a,closeDelay:y}),S=ym(),{delayRef:C,isInstantPhase:w,hasProvider:T}=Md(g,{open:h});f.useSyncedValue(`isInstantPhase`,w);let E=f.useState(`disabled`),D=o??E,O=f.useState(`trackCursorAxis`),k=f.useState(`disableHoverablePopup`),A=zp(g,{enabled:!D,mouseOnly:!0,move:!1,handleClose:!k&&O!==`both`?tm():null,restMs(){let e=S?.delay,t=typeof C.current==`object`?C.current.open:void 0,n=v;return T&&(n=t===0?0:s??e??v),n},delay(){let e=typeof C.current==`object`?C.current.close:void 0,t=y;return c==null&&T&&(t=e),{close:t}},triggerElementRef:_,isActiveTrigger:m}),j=Op(g,{enabled:!D}).reference,M={open:h},N=f.useState(`triggerProps`,x);return Y(`button`,e,{state:M,ref:[t,b,_],props:[A,j,N,{id:p,[bm.triggerDisabled]:D?``:void 0},u],stateAttributesMapping:mm})}),Cm=H.createContext(void 0);function wm(){let e=H.useContext(Cm);if(e===void 0)throw Error(Cl(70));return e}var Tm=H.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,...o}=e,{portalNode:s,portalSubtree:c}=jf({container:r,ref:t,componentProps:e,elementProps:o});return!c&&!s?null:(0,U.jsxs)(H.Fragment,{children:[c,s&&Wn.createPortal(n,s)]})}),Em=H.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Tl().useState(`mounted`)||n?(0,U.jsx)(Cm.Provider,{value:n,children:(0,U.jsx)(Tm,{ref:t,...r})}):null}),Dm=H.createContext(void 0);function Om(){let e=H.useContext(Dm);if(e===void 0)throw Error(Cl(71));return e}var km=H.createContext(void 0);function Am(){return H.useContext(km)?.direction??`ltr`}var jm=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Eo(e,t)||{};if(l==null)return{};let f=Go(u),p={x:n,y:r},m=No(i),h=Ao(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=To(k,j,A),N=!c.arrow&&Oo(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Mm=(e,t)=>({...jm(e),options:[e,t]}),Nm={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await tc().fn(e)).data?.referenceHidden||a}}}},Pm={sideX:`left`,sideY:`top`},Fm={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=Wa(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:Pm};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=J(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Do(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:Pm.sideX,g=f===`top`?`bottom`:Pm.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function Im(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Lm(e,t,n){let{rects:r,placement:i}=e;return{side:Im(t,Do(i),n),align:Oo(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Rm(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:b}=e,[x,S]=H.useState(null);!m&&x!==null&&S(null);let C=h.side||`flip`,w=h.align||`flip`,T=h.fallbackAxisSide||`end`,E=typeof t==`function`?t:void 0,D=q(E),O=E?D:t,k=jl(t),A=Am()===`rtl`,j=x||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":A?`left`:`right`,"inline-start":A?`right`:`left`}[r],M=a===`center`?j:`${j}-${a}`,N=c,P=+(r===`bottom`),F=+(r===`top`),I=+(r===`right`),ee=+(r===`left`);typeof N==`number`?N={top:N+P,right:N+ee,bottom:N+F,left:N+I}:N&&={top:(N.top||0)+P,right:(N.right||0)+ee,bottom:(N.bottom||0)+F,left:(N.left||0)+I};let L={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:N},R=H.useRef(null),z=jl(i),B=jl(o),te=[Xs(e=>{let t=Lm(e,r,A),n=typeof z.current==`function`?z.current(t):z.current,i=typeof B.current==`function`?B.current(t):B.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,A,r])],ne=w===`none`&&C!==`shift`,re=!ne&&(l||g||C===`shift`),V=C===`none`?null:$s({...L,padding:{top:N.top+1,right:N.right+1,bottom:N.bottom+1,left:N.left+1},mainAxis:!g&&C===`flip`,crossAxis:w===`flip`?`alignment`:!1,fallbackAxisSideDirection:T}),ie=ne?null:Zs(e=>{let t=J(e.elements.floating).documentElement;return{...L,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:w!==`none`,crossAxis:re,limiter:l||g?void 0:Qs(e=>{if(!R.current)return{};let{width:t,height:n}=R.current.getBoundingClientRect(),r=Mo(Do(e.placement)),i=r===`y`?t:n,a=r===`y`?N.left+N.right:N.top+N.bottom;return{offset:i/2+a/2}})}},[L,l,g,N,w]);C===`shift`||w===`shift`||a===`center`?te.push(ie,V):te.push(V,ie),te.push(ec({...L,apply({elements:{floating:e},rects:{reference:t},availableWidth:n,availableHeight:r}){let i=e.style;i.setProperty(`--available-width`,`${n}px`),i.setProperty(`--available-height`,`${r}px`),i.setProperty(`--anchor-width`,`${t.width}px`),i.setProperty(`--anchor-height`,`${t.height}px`)}}),Mm(()=>({element:R.current||document.createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=Do(a),l=Mo(c),u=R.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(Lm(e,r,A)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,re&&l===`y`&&b?S:x),{}}},Nm,v),K(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,p]);let ae=H.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:oe,elements:se,x:ce,y:le,middlewareData:ue,update:de,placement:fe,context:pe,isPositioned:me,floatingStyles:he}=Tp({rootContext:p,placement:M,middleware:te,strategy:n,whileElementsMounted:f?void 0:(...e)=>Is(...e,ae),nodeId:_,externalTree:b}),{sideX:ge,sideY:_e}=ue.adaptiveOrigin||Pm,ve=me?n:`fixed`,ye=H.useMemo(()=>{let e=v?{position:ve,[ge]:ce,[_e]:le}:{position:ve,...he};return me||(e.opacity=0),e},[v,ve,ge,ce,_e,le,he,me]),be=H.useRef(null);K(()=>{if(!m)return;let e=k.current,t=typeof e==`function`?e():e,n=(zm(t)?t.current:t)||null;n!==be.current&&(oe.setPositionReference(n),be.current=n)},[m,oe,O,k]),H.useEffect(()=>{if(!m)return;let e=k.current;typeof e!=`function`&&zm(e)&&e.current!==be.current&&(oe.setPositionReference(e.current),be.current=e.current)},[m,oe,O,k]),H.useEffect(()=>{if(f&&m&&se.domReference&&se.floating)return Is(se.domReference,se.floating,de,ae)},[f,m,se,de,ae]);let xe=Do(fe),Se=Im(r,xe,A),Ce=Oo(fe)||`center`,we=!!ue.hide?.referenceHidden;K(()=>{y&&m&&me&&S(xe)},[y,m,me,xe]);let Te=H.useMemo(()=>({position:`absolute`,top:ue.arrow?.y,left:ue.arrow?.x}),[ue.arrow]),Ee=ue.arrow?.centerOffset!==0;return H.useMemo(()=>({positionerStyles:ye,arrowStyles:Te,arrowRef:R,arrowUncentered:Ee,side:Se,align:Ce,physicalSide:xe,anchorHidden:we,refs:oe,context:pe,isPositioned:me,update:de}),[ye,Te,R,Ee,Se,Ce,xe,we,oe,pe,me,de])}function zm(e){return e!=null&&`current`in e}function Bm(e){return e===`starting`?sd:id}var Vm=H.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=ud,...g}=e,_=Tl(),v=wm(),y=_.useState(`open`),b=_.useState(`mounted`),x=_.useState(`trackCursorAxis`),S=_.useState(`disableHoverablePopup`),C=_.useState(`floatingRootContext`),w=_.useState(`instantType`),T=_.useState(`transitionStatus`),E=Rm({anchor:i,positionMethod:a,floatingRootContext:C,mounted:b,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:v,collisionAvoidance:h,adaptiveOrigin:_.useState(`hasViewport`)?Fm:void 0}),D=H.useMemo(()=>{let e={};return(!y||x===`both`||S)&&(e.pointerEvents=`none`),{role:`presentation`,hidden:!b,style:{...E.positionerStyles,...e}}},[y,x,S,b,E.positionerStyles]),O=H.useMemo(()=>({open:y,side:E.side,align:E.align,anchorHidden:E.anchorHidden,instant:x===`none`?w:`tracking-cursor`}),[y,E.side,E.align,E.anchorHidden,x,w]),k=H.useMemo(()=>({...O,arrowRef:E.arrowRef,arrowStyles:E.arrowStyles,arrowUncentered:E.arrowUncentered}),[O,E.arrowRef,E.arrowStyles,E.arrowUncentered]),A=Y(`div`,e,{state:O,props:[D,Bm(T),g],ref:[t,_.useStateSetter(`positionerElement`)],stateAttributesMapping:gm});return(0,U.jsx)(Dm.Provider,{value:k,children:A})}),Hm={...gm,...fp},Um=H.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=Tl(),{side:o,align:s}=Om(),c=a.useState(`open`),l=a.useState(`instantType`),u=a.useState(`transitionStatus`),d=a.useState(`popupProps`),f=a.useState(`floatingRootContext`);mp({open:c,ref:a.context.popupRef,onComplete(){c&&a.context.onOpenChangeComplete?.(!0)}});let p=a.useState(`disabled`),m=a.useState(`closeDelay`);return Fp(f,{enabled:!p,closeDelay:m}),Y(`div`,e,{state:{open:c,side:o,align:s,instant:l,transitionStatus:u},ref:[t,a.context.popupRef,a.useStateSetter(`popupElement`)],props:[d,Bm(u),i],stateAttributesMapping:Hm})}),Wm=H.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=Tl().useState(`instantType`),{open:o,arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=Om();return Y(`div`,e,{state:{open:o,side:c,align:l,uncentered:u,instant:a},ref:[t,s],props:[{style:d,"aria-hidden":!0},i],stateAttributesMapping:gm})}),Gm=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=H.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=H.useMemo(()=>({open:t,close:n}),[t,n]);return(0,U.jsx)(vm.Provider,{value:i,children:(0,U.jsx)(jd,{delay:a,timeoutMs:r,children:e.children})})};function Km(e){return of(19)?e:e?`true`:void 0}function qm(e){let[t,n]=H.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function Jm(e){let t=uo(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ja(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(bo(n)!==a||bo(r)!==o)&&(n=a,r=o),{width:n,height:r}}var Ym=typeof ResizeObserver<`u`,Xm=()=>!0;function Zm(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=Xm,onMeasureLayout:o,onMeasureLayoutComplete:s,side:c,direction:l}=e,u=pp(t,!0,!1),d=Gd(),f=H.useRef(null),p=H.useRef(null),m=H.useRef(!0),h=H.useRef(nd),g=q(o),_=q(s),v=H.useMemo(()=>{let e=c===`top`,t=c===`left`;return l===`rtl`?(e||=c===`inline-end`,t||=c===`inline-end`):(e||=c===`inline-start`,t||=c===`inline-start`),e?{position:`absolute`,[c===`top`?`bottom`:`top`]:`0`,[t?`right`:`left`]:`0`}:id},[c,l]);K(()=>{if(!i||!a()||!Ym){h.current=nd,m.current=!0,f.current=null,p.current=null;return}if(!t||!n)return;h.current=$m(t,v);let e=new ResizeObserver(e=>{let t=e[0];t&&(p.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)})});e.observe(t),eh(t,`auto`);let r=Qm(t,`position`,`static`),o=Qm(t,`transform`,`none`),s=Qm(t,`scale`,`1`),c=$m(n,{"--available-width":`max-content`,"--available-height":`max-content`});function l(){r(),o(),c()}function y(){l(),s()}if(g?.(),m.current||f.current===null){th(n,`max-content`);let r=Jm(t);return f.current=r,th(n,r),y(),_?.(null,r),m.current=!1,()=>{e.disconnect(),h.current(),h.current=nd}}eh(t,`auto`),th(n,`max-content`);let b=f.current??p.current,x=Jm(t);if(f.current=x,!b)return th(n,x),y(),_?.(null,x),()=>{e.disconnect(),d.cancel(),h.current(),h.current=nd};eh(t,b),y(),_?.(b,x),th(n,x);let S=new AbortController;return d.request(()=>{eh(t,x),u(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},S.signal)}),()=>{e.disconnect(),S.abort(),d.cancel(),h.current(),h.current=nd}},[r,t,n,u,d,a,i,g,_,v])}function Qm(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function $m(e,t){let n=[];for(let[r,i]of Object.entries(t))n.push(Qm(e,r,i));return n.length?()=>{n.forEach(e=>e())}:nd}function eh(e,t){let n=t===`auto`?`auto`:`${t.width}px`,r=t===`auto`?`auto`:`${t.height}px`;e.style.setProperty(`--popup-width`,n),e.style.setProperty(`--popup-height`,r)}function th(e,t){let n=t===`max-content`?`max-content`:`${t.width}px`,r=t===`max-content`?`max-content`:`${t.height}px`;e.style.setProperty(`--positioner-width`,n),e.style.setProperty(`--positioner-height`,r)}function nh(e){let{store:t,side:n,cssVars:r,children:i}=e,a=Am(),o=t.useState(`activeTriggerElement`),s=t.useState(`activeTriggerId`),c=t.useState(`open`),l=t.useState(`payload`),u=t.useState(`mounted`),d=t.useState(`popupElement`),f=t.useState(`positionerElement`),p=qm(c?o:null),m=oh(s,l),h=H.useRef(null),[g,_]=H.useState(null),[v,y]=H.useState(null),b=H.useRef(null),x=H.useRef(null),S=pp(b,!0,!1),C=Gd(),[w,T]=H.useState(null),[E,D]=H.useState(!1);K(()=>(t.set(`hasViewport`,!0),()=>{t.set(`hasViewport`,!1)}),[t]);let O=q(()=>{b.current?.style.setProperty(`animation`,`none`),b.current?.style.setProperty(`transition`,`none`),x.current?.style.setProperty(`display`,`none`)}),k=q(e=>{b.current?.style.removeProperty(`animation`),b.current?.style.removeProperty(`transition`),x.current?.style.removeProperty(`display`),e&&T(e)}),A=H.useRef(null);K(()=>{o&&p&&o!==p&&A.current!==o&&h.current&&(_(h.current),D(!0),y(ah(p,o)),C.request(()=>{C.request(()=>{D(!1),S(()=>{_(null),T(null),h.current=null})})}),A.current=o)},[o,p,g,S,C]),K(()=>{let e=b.current;if(!e)return;let t=document.createElement(`div`);for(let n of Array.from(e.childNodes))t.appendChild(n.cloneNode(!0));h.current=t});let j=g!=null,M;M=j?(0,U.jsxs)(H.Fragment,{children:[(0,U.jsx)(`div`,{"data-previous":!0,inert:Km(!0),ref:x,style:{[r.popupWidth]:`${w?.width}px`,[r.popupHeight]:`${w?.height}px`,position:`absolute`},"data-ending-style":E?void 0:``},`previous`),(0,U.jsx)(`div`,{"data-current":!0,ref:b,"data-starting-style":E?``:void 0,children:i},m)]}):(0,U.jsx)(`div`,{"data-current":!0,ref:b,children:i},m),K(()=>{let e=x.current;!e||!g||e.replaceChildren(...Array.from(g.childNodes))},[g]),Zm({popupElement:d,positionerElement:f,mounted:u,content:l,onMeasureLayout:O,onMeasureLayoutComplete:k,side:n,direction:a});let N={activationDirection:rh(v),transitioning:j};return{children:M,state:N}}function rh(e){if(e)return`${ih(e.horizontal,5,`right`,`left`)} ${ih(e.vertical,5,`down`,`up`)}`}function ih(e,t,n,r){return e>t?n:e<-t?r:``}function ah(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={x:n.left+n.width/2,y:n.top+n.height/2},a={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:a.x-i.x,vertical:a.y-i.y}}function oh(e,t){let[n,r]=H.useState(0),i=H.useRef(e),a=H.useRef(t),o=H.useRef(!1);return K(()=>{let n=i.current,s=a.current,c=e!==n,l=t!==s;c?(r(e=>e+1),o.current=!l):o.current&&l&&(r(e=>e+1),o.current=!1),i.current=e,a.current=t},[e,t]),`${e??`current`}-${n}`}var sh=H.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function ch(e=!1){let t=H.useContext(sh);if(!t&&!e)throw Error(Cl(86));return t}var lh=H.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,...a}=e,[o,s]=H.useState(void 0),c=Y(`fieldset`,e,{ref:t,state:{disabled:i},props:[{"aria-labelledby":o},a]}),l=H.useMemo(()=>({legendId:o,setLegendId:s,disabled:i}),[o,s,i]);return(0,U.jsx)(sh.Provider,{value:l,children:c})}),uh=H.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{disabled:o,setLegendId:s}=ch(),c=_m(i);return K(()=>(s(c),()=>{s(void 0)}),[s,c]),Y(`div`,e,{state:{disabled:o??!1},ref:t,props:[{id:c},a]})}),dh=(function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e})({}),fh={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ph={valid(e){return e===null?null:e?{[dh.valid]:``}:{[dh.invalid]:``}}},mh=H.createContext({invalid:void 0,name:void 0,validityData:{state:fh,errors:[],error:``,value:``,initialValue:null},setValidityData:nd,disabled:void 0,touched:!1,setTouched:nd,dirty:!1,setDirty:nd,filled:!1,setFilled:nd,focused:!1,setFocused:nd,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=id)=>e,getInputValidationProps:(e=id)=>e,inputRef:{current:null},commit:async()=>{}}});function hh(e=!0){let t=H.useContext(mh);if(t.setValidityData===nd&&!e)throw Error(Cl(28));return t}var gh=H.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:nd,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function _h(){return H.useContext(gh)}var vh=H.createContext({controlId:void 0,registerControlId:nd,labelId:void 0,setLabelId:nd,messageIds:[],setMessageIds:nd,getDescriptionProps:e=>e});function yh(){return H.useContext(vh)}var bh=function(e){let t=_m(),[n,r]=H.useState(e.initialControlId===void 0?t:e.initialControlId),[i,a]=H.useState(void 0),[o,s]=H.useState([]),c=ml(()=>new Map),{messageIds:l}=yh(),u=q((e,t)=>{let n=c.current;if(t===void 0){n.delete(e);return}n.set(e,t),r(e=>{if(n.size===0)return;let t;for(let r of n.values()){if(e!==void 0&&r===e)return e;t===void 0&&(t=r)}return t})}),d=H.useCallback(e=>pf({"aria-describedby":l.concat(o).join(` `)||void 0},e),[l,o]),f=H.useMemo(()=>({controlId:n,registerControlId:u,labelId:i,setLabelId:a,messageIds:o,setMessageIds:s,getDescriptionProps:d}),[n,u,i,a,o,s,d]);return(0,U.jsx)(vh.Provider,{value:f,children:e.children})};function xh(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}var Sh=Object.keys(fh);function Ch(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(let n of Sh)n!==`valid`&&(n===`valueMissing`&&(t=e[n]),e[n]&&(t=!1));return t}function wh(e){let{formRef:t,clearErrors:n}=_h(),{setValidityData:r,validate:i,validityData:a,validationDebounceTime:o,invalid:s,markedDirtyRef:c,state:l,name:u,shouldValidateOnChange:d}=e,{controlId:f,getDescriptionProps:p}=yh(),m=Al(),h=H.useRef(null),g=q(async(e,n=!1)=>{let o=h.current;if(!o)return;if(n){if(l.valid!==!1)return;let n=o.validity;if(!n.valueMissing){let n={value:e,state:{...fh,valid:!0},error:``,errors:[],initialValue:a.initialValue};if(o.setCustomValidity(``),f){let e=t.current.fields.get(f);e&&t.current.fields.set(f,{...e,...xh(n,!1)})}r(n);return}let i=Sh.reduce((e,t)=>(e[t]=n[t],e),{});if(!i.valid&&!Ch(i))return}function u(e){let t=Sh.reduce((t,n)=>(t[n]=e.validity[n],t),{}),n=!1;for(let e of Sh)if(e!==`valid`){if(e===`valueMissing`&&t[e])n=!0;else if(t[e])return t}return n&&!c.current&&(t.valid=!0,t.valueMissing=!1),t}m.clear();let p=null,g=[],_=u(o),v,y=d();if(o.validationMessage&&!y)v=o.validationMessage,g=[o.validationMessage];else{let n=i(e,Array.from(t.current.fields.values()).reduce((e,t)=>(t.name&&(e[t.name]=t.getValue()),e),{}));p=typeof n==`object`&&n&&`then`in n?await n:n,p===null?y&&(o.setCustomValidity(``),_.customError=!1,o.validationMessage?(v=o.validationMessage,g=[o.validationMessage]):o.validity.valid&&!_.valid&&(_.valid=!0)):(_.valid=!1,_.customError=!0,Array.isArray(p)?(g=p,o.setCustomValidity(p.join(`
`))):p&&(g=[p],o.setCustomValidity(p)))}let b={value:e,state:_,error:v??(Array.isArray(p)?p[0]:p??``),errors:g,initialValue:a.initialValue};if(f){let e=t.current.fields.get(f);e&&t.current.fields.set(f,{...e,...xh(b,s)})}r(b)}),_=H.useCallback((e={})=>pf(p,l.valid===!1?{"aria-invalid":!0}:id,e),[p,l.valid]),v=H.useCallback((e={})=>pf({onChange(e){if(e.nativeEvent.defaultPrevented)return;if(n(u),!d()){g(e.currentTarget.value,!0);return}if(s)return;let t=e.currentTarget;if(t.value===``){g(t.value);return}m.clear(),o?m.start(o,()=>{g(t.value)}):g(t.value)}},_(e)),[_,n,u,m,g,s,o,d]);return H.useMemo(()=>({getValidationProps:_,getInputValidationProps:v,inputRef:h,commit:g}),[_,v,g])}var Th=H.forwardRef(function(e,t){let{errors:n,validationMode:r,submitAttemptedRef:i}=_h(),{render:a,className:o,validate:s,validationDebounceTime:c=0,validationMode:l=r,name:u,disabled:d=!1,invalid:f,dirty:p,touched:m,actionsRef:h,...g}=e,{disabled:_}=ch(),v=q(s||(()=>null)),y=_||d,[b,x]=H.useState(!1),[S,C]=H.useState(!1),[w,T]=H.useState(!1),[E,D]=H.useState(!1),O=p??S,k=m??b,A=H.useRef(!1),j=q(e=>{p===void 0&&(e&&(A.current=!0),C(e))}),M=q(e=>{m===void 0&&x(e)}),N=q(()=>l===`onChange`||l===`onSubmit`&&i.current),P=!!(f||u&&{}.hasOwnProperty.call(n,u)&&n[u]!==void 0),[F,I]=H.useState({state:fh,error:``,errors:[],value:null,initialValue:null}),ee=!P&&F.state.valid,L=H.useMemo(()=>({disabled:y,touched:k,dirty:O,valid:ee,filled:w,focused:E}),[y,k,O,ee,w,E]),R=wh({setValidityData:I,validate:v,validityData:F,validationDebounceTime:c,invalid:P,markedDirtyRef:A,state:L,name:u,shouldValidateOnChange:N}),z=H.useCallback(()=>{A.current=!0,R.commit(F.value)},[R,F]);H.useImperativeHandle(h,()=>({validate:z}),[z]);let B=H.useMemo(()=>({invalid:P,name:u,validityData:F,setValidityData:I,disabled:y,touched:k,setTouched:M,dirty:O,setDirty:j,filled:w,setFilled:T,focused:E,setFocused:D,validate:v,validationMode:l,validationDebounceTime:c,shouldValidateOnChange:N,state:L,markedDirtyRef:A,validation:R}),[P,u,F,y,k,M,O,j,w,T,E,D,v,l,c,N,L,R]),te=Y(`div`,e,{ref:t,state:L,props:g,stateAttributesMapping:ph});return(0,U.jsx)(mh.Provider,{value:B,children:te})}),Eh=H.forwardRef(function(e,t){return(0,U.jsx)(bh,{children:(0,U.jsx)(Th,{...e,ref:t})})}),Dh=H.forwardRef(function(e,t){let{render:n,className:r,id:i,nativeLabel:a=!0,...o}=e,s=hh(!1),{controlId:c,setLabelId:l,labelId:u}=yh(),d=_m(i),f=H.useRef(null),p=q(e=>{if(su(e.nativeEvent)?.closest(`button,input,select,textarea`)||(!e.defaultPrevented&&e.detail>1&&e.preventDefault(),a||!c))return;let t=J(e.currentTarget).getElementById(c);Ja(t)&&t.focus({focusVisible:!0})});return K(()=>(d&&l(d),()=>{l(void 0)}),[d,l]),Y(`label`,e,{ref:[t,f],state:s.state,props:[{id:u},a?{htmlFor:c??void 0,onMouseDown:p}:{onClick:p,onPointerDown(e){e.preventDefault()}},o],stateAttributesMapping:ph})}),Oh={...ph,...fp},kh=H.forwardRef(function(e,t){let{render:n,id:r,className:i,match:a,...o}=e,s=_m(r),{validityData:c,state:l,name:u}=hh(!1),{setMessageIds:d}=yh(),{errors:f}=_h(),p=u?f[u]:null,m=!1;m=p||a===!0?!0:a?!!c.state[a]:c.state.valid===!1;let{mounted:h,transitionStatus:g,setMounted:_}=cp(m);K(()=>{if(!(!m||!s))return d(e=>e.concat(s)),()=>{d(e=>e.filter(e=>e!==s))}},[m,s,d]);let v=H.useRef(null),[y,b]=H.useState(null),[x,S]=H.useState(null),C=p||(c.errors.length>1?(0,U.jsx)(`ul`,{children:c.errors.map(e=>(0,U.jsx)(`li`,{children:e},e))}):c.error),w=c.error;p==null?c.errors.length>1&&(w=JSON.stringify(c.errors)):w=Array.isArray(p)?JSON.stringify(p):p,m&&w!==x&&(S(w),b(C)),mp({open:m,ref:v,onComplete(){m||_(!1)}});let T={...l,transitionStatus:g},E=Y(`div`,e,{ref:[t,v],state:T,props:[{id:s,children:m?C:y},o],stateAttributesMapping:Oh,enabled:h});return h?E:null}),Ah=H.forwardRef(function(e,t){let{render:n,id:r,className:i,...a}=e,o=_m(r),s=hh(!1),{setMessageIds:c}=yh();return K(()=>{if(o)return c(e=>e.concat(o)),()=>{c(e=>e.filter(e=>e!==o))}},[o,c]),Y(`p`,e,{ref:t,state:s.state,props:[{id:o},a],stateAttributesMapping:ph})});function jh({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=H.useRef(e!==void 0),[a,o]=H.useState(t);return[i?e:a,H.useCallback(e=>{i||o(e)},[])]}function Mh(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=yh(),o=_m(t),s=n?i:void 0,c=ml(()=>Symbol(`labelable-control`)),l=H.useRef(!1),u=H.useRef(t!=null),d=q(()=>{!l.current||a===nd||(l.current=!1,a(c.current,void 0))});return K(()=>{if(a===nd)return;let e;if(n){let n=r?.current;e=qa(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),H.useEffect(()=>d,[d]),i??o}function Nh(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=_h(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:d}=hh(),f=q(e.getValue);K(()=>{if(!t)return;let e=n;e===void 0&&(e=f()),u.initialValue===null&&e!==null&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),K(()=>{!t||!r||s.current.fields.set(r,{getValue:f,name:i,controlRef:a,validityData:xh(u,c),validate(e=!0){let t=n;t===void 0&&(t=f()),l.current=!0,e?Wn.flushSync(()=>o(t)):o(t)}})},[o,a,t,s,f,r,c,l,i,u,n]),K(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}var Ph=H.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,...d}=e,{state:f,name:p,disabled:m,setTouched:h,setDirty:g,validityData:_,setFocused:v,setFilled:y,validationMode:b,validation:x}=hh(),S=m||s,C=p??a,w={...f,disabled:S},{labelId:T}=yh(),E=Mh({id:i});K(()=>{let e=o!=null;x.inputRef.current?.value||e&&o!==``?y(!0):e&&o===``&&y(!1)},[x.inputRef,y,o]);let D=H.useRef(null);K(()=>{u&&D.current===iu(J(D.current))&&v(!0)},[u,v]);let[O]=jh({controlled:o,default:l,name:`FieldControl`,state:`value`}),k=o!==void 0,A=k?O:void 0;return Nh({id:E,name:C,commit:x.commit,value:A,getValue:()=>x.inputRef.current?.value,controlRef:x.inputRef}),Y(`input`,e,{ref:[t,D],state:w,props:[{id:E,disabled:S,name:C,ref:x.inputRef,"aria-labelledby":T,autoFocus:u,...k?{value:A}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,Dd(fd,e.nativeEvent)),g(t!==_.initialValue),y(t!==``)},onFocus(){v(!0)},onBlur(e){h(!0),v(!1),b===`onBlur`&&x.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(h(!0),x.commit(e.currentTarget.value))}},x.getInputValidationProps(),d],stateAttributesMapping:ph})}),Fh=H.createContext({disabled:!1});function Ih(){return H.useContext(Fh)}var Lh=H.createContext(void 0);function Rh(e=!0){let t=H.useContext(Lh);if(t===void 0&&!e)throw Error(Cl(3));return t}var zh=(function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.indeterminate=`data-indeterminate`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e})({});function Bh(e){return H.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[zh.checked]:``}:{[zh.unchecked]:``}},...ph}),[e.indeterminate])}var Vh=H.createContext(void 0);function Hh(e=!1){let t=H.useContext(Vh);if(t===void 0&&!e)throw Error(Cl(16));return t}function Uh(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:H.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Wh(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=H.useRef(null),o=Hh(!0)!==void 0,s=q(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=Uh({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i}),l=H.useCallback(()=>{let e=a.current;Gh(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return K(l,[l]),{getButtonProps:H.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return pf({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(xf(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(xf(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:q(e=>{a.current=e,l()})}}function Gh(e){return Ja(e)&&e.tagName===`BUTTON`}var Kh=H.createContext(void 0);function qh(){let e=H.useContext(Kh);if(e===void 0)throw Error(Cl(14));return e}function Jh(e,t){let n=H.useRef(e),r=q(t);K(()=>{n.current!==e&&r(n.current)},[e,r]),K(()=>{n.current=e},[e])}var Yh=`data-parent`,Xh=H.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,disabled:a=!1,id:o,indeterminate:s=!1,inputRef:c,name:l,onCheckedChange:u,parent:d=!1,readOnly:f=!1,render:p,required:m=!1,uncheckedValue:h,value:g,nativeButton:_=!1,...v}=e,{clearErrors:y}=_h(),{disabled:b,name:x,setDirty:S,setFilled:C,setFocused:w,setTouched:T,state:E,validationMode:D,validityData:O,shouldValidateOnChange:k,validation:A}=hh(),j=Ih(),{labelId:M,controlId:N,registerControlId:P,getDescriptionProps:F}=yh(),I=Rh(),ee=I?.parent,L=ee&&I.allValues,R=b||j.disabled||I?.disabled||a,z=x??l,B=g??z,te=_m(),ne=_m(),re=N;L?re=d?ne:`${ee.id}-${B}`:o&&(re=o);let V={};L&&(d?V=I.parent.getParentProps():B&&(V=I.parent.getChildProps(B)));let ie=q(u),{checked:ae=n,indeterminate:oe=s,onCheckedChange:se,...ce}=V,le=I?.value,ue=I?.setValue,de=I?.defaultValue,fe=H.useRef(null),pe=ml(()=>Symbol(`checkbox-control`)),me=H.useRef(!1),{getButtonProps:he,buttonRef:ge}=Wh({disabled:R,native:_}),_e=I?.validation??A,[ve,ye]=jh({controlled:B&&le&&!d?le.includes(B):ae,default:B&&de&&!d?de.includes(B):i,name:`Checkbox`,state:`checked`});K(()=>{P!==nd&&(me.current=!0,P(pe.current,re))},[re,I,P,d,pe]),H.useEffect(()=>{let e=pe.current;return()=>{!me.current||P===nd||(me.current=!1,P(e,void 0))}},[P,pe]),Nh({enabled:!I,id:te,commit:_e.commit,value:ve,controlRef:fe,name:z,getValue:()=>ve});let be=H.useRef(null),xe=Nd(c,be,_e.inputRef);K(()=>{be.current&&(be.current.indeterminate=oe,ve&&C(!0))},[ve,oe,C]),Jh(ve,()=>{I&&!d||(y(z),C(ve),S(ve!==O.initialValue),k()?_e.commit(ve):_e.commit(ve,!0))});let Se=pf({checked:ve,disabled:R,name:d?void 0:z,id:_?void 0:re??void 0,required:m,ref:xe,style:z?Vd:Bd,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=Dd(fd,e.nativeEvent);se?.(t,n),ie(t,n),!n.isCanceled&&(ye(t),B&&le&&ue&&!d)&&ue(t?[...le,B]:le.filter(e=>e!==B),n)},onFocus(){fe.current?.focus()}},g===void 0?id:{value:(I?ve&&g:g)||``},F,I?_e.getValidationProps:_e.getInputValidationProps),Ce=L?!!ae:ve,we=L&&oe||s;H.useEffect(()=>{if(!ee||!B)return;let e=ee.disabledStatesRef.current;return e.set(B,R),()=>{e.delete(B)}},[ee,R,B]);let Te=H.useMemo(()=>({...E,checked:Ce,disabled:R,readOnly:f,required:m,indeterminate:we}),[E,Ce,R,f,m,we]),Ee=Bh(Te),De=Y(`span`,e,{state:Te,ref:[ge,fe,t,I?.registerControlRef],props:[{id:_?re??void 0:te,role:`checkbox`,"aria-checked":oe?`mixed`:ve,"aria-readonly":f||void 0,"aria-required":m||void 0,"aria-labelledby":M,[Yh]:d?``:void 0,onFocus(){w(!0)},onBlur(){let e=be.current;e&&(T(!0),w(!1),D===`onBlur`&&_e.commit(I?le:e.checked))},onClick(e){f||R||(e.preventDefault(),be.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},F,_e.getValidationProps,v,ce,he],stateAttributesMapping:Ee});return(0,U.jsxs)(Kh.Provider,{value:Te,children:[De,!ve&&!I&&z&&!d&&h!==void 0&&(0,U.jsx)(`input`,{type:`hidden`,name:z,value:h}),(0,U.jsx)(`input`,{...Se})]})}),Zh=[];function Qh(e){let{allValues:t=Zh,value:n=Zh,onValueChange:r}=e,i=H.useRef(n),a=H.useRef(new Map),[o,s]=H.useState(`mixed`),c=_m(),l=n.length===t.length,u=n.length!==t.length&&n.length>0,d=q(r),f=H.useCallback(()=>({id:c,indeterminate:u,checked:l,"aria-controls":t.map(e=>`${c}-${e}`).join(` `),onCheckedChange(e,r){let c=i.current,l=t.filter(e=>a.current.get(e)&&c.includes(e)),u=t.filter(e=>!a.current.get(e)||a.current.get(e)&&c.includes(e));if(c.length===u.length||c.length===0){n.length===u.length?d(l,r):d(u,r);return}o===`mixed`?(d(u,r),s(`on`)):o===`on`?(d(l,r),s(`off`)):o===`off`&&(d(c,r),s(`mixed`))}}),[t,l,c,u,d,o,n.length]),p=H.useCallback(e=>({checked:n.includes(e),onCheckedChange(t,r){let a=n.slice();t?a.push(e):a.splice(a.indexOf(e),1),i.current=a,d(a,r),s(`mixed`)}}),[d,n]);return H.useMemo(()=>({id:c,indeterminate:u,getParentProps:f,getChildProps:p,disabledStatesRef:a}),[c,u,f,p])}function $h(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}var eg=H.forwardRef(function(e,t){let{allValues:n,className:r,defaultValue:i,disabled:a=!1,id:o,onValueChange:s,render:c,value:l,...u}=e,{disabled:d,name:f,state:p,validation:m,setFilled:h,setDirty:g,shouldValidateOnChange:_,validityData:v}=hh(),{labelId:y,getDescriptionProps:b}=yh(),{clearErrors:x}=_h(),S=d||a,[C,w]=jh({controlled:l,default:i,name:`CheckboxGroup`,state:`value`}),T=q((e,t)=>{s?.(e,t),!t.isCanceled&&w(e)}),E=Qh({allValues:n,value:l,onValueChange:s}),D=_m(o),O=H.useRef(null),k=H.useCallback(e=>{O.current==null&&e!=null&&!e.hasAttribute(Yh)&&(O.current=e)},[]);Nh({enabled:!!f,id:D,commit:m.commit,value:C,controlRef:O,name:f,getValue:()=>C});let A=C??rd;Jh(A,()=>{f&&x(f);let e=Array.isArray(v.initialValue)?v.initialValue:rd;h(A.length>0),g(!$h(A,e)),_()?m.commit(A):m.commit(A,!0)});let j={...p,disabled:S},M=H.useMemo(()=>({allValues:n,value:C,defaultValue:i,setValue:T,parent:E,disabled:S,validation:m,registerControlRef:k}),[n,C,i,T,E,S,m,k]),N=Y(`div`,e,{state:j,ref:t,props:[{role:`group`,"aria-labelledby":y},b,u],stateAttributesMapping:ph});return(0,U.jsx)(Lh.Provider,{value:M,children:N})}),tg=H.forwardRef(function(e,t){let{render:n,className:r,keepMounted:i=!1,...a}=e,o=qh(),s=o.checked||o.indeterminate,{mounted:c,transitionStatus:l,setMounted:u}=cp(s),d=H.useRef(null),f={...o,transitionStatus:l};mp({open:s,ref:d,onComplete(){s||u(!1)}});let p=Bh(o),m=H.useMemo(()=>({...p,...fp,...ph}),[p]),h=i||c,g=Y(`span`,e,{ref:[t,d],state:f,stateAttributesMapping:m,props:a});return h?g:null}),ng=H.createContext(void 0);function rg(){let e=H.useContext(ng);if(!e)throw Error(Cl(73));return e}var ig=0;function ag(e){return ig+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${ig}`}function og(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}var sg=Qf(e=>e.toasts,e=>{let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}),cg={toasts:X(e=>e.toasts),isEmpty:X(e=>e.toasts.length===0),toast:X(sg,(e,t)=>e.get(t)?.value),toastIndex:X(sg,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:X(sg,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:X(sg,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:X(e=>e.hovering),focused:X(e=>e.focused),expanded:X(e=>e.hovering||e.focused),expandedOrOutOfFocus:X(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:X(e=>e.prevFocusElement)},lg=class extends ap{timers=new Map;areTimersPaused=!1;constructor(e){super(e,{},cg)}setFocused(e){this.set(`focused`,e)}setHovering(e){this.set(`hovering`,e)}setIsWindowFocused(e){this.set(`isWindowFocused`,e)}setPrevFocusElement(e){this.set(`prevFocusElement`,e)}setViewport=e=>{this.set(`viewport`,e)};disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e){let t=cg.toastIndex(this.state,e);if(t===-1)return;this.state.toasts[t]?.onRemove?.();let n=[...this.state.toasts];n.splice(t,1),this.setToasts(n)}addToast=e=>{let{toasts:t,timeout:n,limit:r}=this.state,i=e.id||ag(`toast`),a={...e,id:i,transitionStatus:`starting`},o=[a,...t],s=o.filter(e=>e.transitionStatus!==`ending`);if(s.length>r){let e=s.length-r,t=s.slice(-e),n=new Set(t.map(e=>e.id));this.setToasts(o.map(e=>{let t=n.has(e.id);return e.limited===t?e:{...e,limited:t}}))}else this.setToasts(o.map(e=>e.limited?{...e,limited:!1}:e));let c=a.timeout??n;return a.type!==`loading`&&c>0&&this.scheduleTimer(i,c,()=>this.closeToast(i)),cg.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),i};updateToast=(e,t)=>{this.updateToastInternal(e,t)};updateToastInternal=(e,t)=>{let{timeout:n,toasts:r}=this.state,i=cg.toast(this.state,e)??null;if(!i||i.transitionStatus===`ending`)return;let a={...i,...t};this.setToasts(r.map(n=>n.id===e?{...n,...t}:n));let o=a.timeout??n,s=i?.timeout??n,c=Object.hasOwn(t,`timeout`),l=a.transitionStatus!==`ending`&&a.type!==`loading`&&o>0,u=this.timers.has(e),d=s!==o,f=i?.type===`loading`;if(!l&&u){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e);return}if(l&&(!u||d||c||f)){let t=this.timers.get(e);t&&(t.timeout?.clear(),this.timers.delete(e)),this.scheduleTimer(e,o,()=>this.closeToast(e)),cg.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=e=>{cg.toast(this.state,e)?.onClose?.();let{limit:t,toasts:n}=this.state,r=0,i=n.map(n=>{if(n.id===e)return{...n,transitionStatus:`ending`,height:0};if(n.transitionStatus===`ending`)return n;let i=r>=t;return r+=1,n.limited===i?n:{...n,limited:i}}),a=this.timers.get(e);a&&a.timeout&&(a.timeout.clear(),this.timers.delete(e)),this.handleFocusManagement(e),this.setToasts(i)};promiseToast=(e,t)=>{let n=og(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=og(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=og(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{if(e.timeout){e.timeout.clear();let t=Date.now()-e.start,n=e.delay-t;e.remaining=n>0?n:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=kl.create(),e.timeout.start(e.remaining,()=>{this.timers.delete(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=su(e);au(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=!cg.expandedOrOutOfFocus(this.state),a=i?kl.create():void 0;a?.start(t,()=>{this.timers.delete(e),n()}),this.timers.set(e,{timeout:a,start:i?r:0,delay:t,remaining:t,callback:n})}setToasts(e){let t={toasts:e};e.length===0&&(t.hovering=!1,t.focused=!1),this.update(t)}handleFocusManagement(e){let t=iu(J(this.state.viewport));if(!this.state.viewport||!au(this.state.viewport,t)||!fu(t))return;let n=cg.toasts(this.state),r=cg.toastIndex(this.state,e),i=null,a=r+1;for(;a<n.length;){if(n[a].transitionStatus!==`ending`){i=n[a];break}a+=1}if(!i)for(a=r-1;a>=0;){if(n[a].transitionStatus!==`ending`){i=n[a];break}--a}i?i.ref?.current?.focus():this.restoreFocusToPrevElement()}},ug=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=ml(()=>new lg({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Dl(a.disposeEffect),H.useEffect(function(){return i?i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t):e===`close`&&n?a.closeToast(n):a.addToast(t)}):void 0},[a,n,i]),a.useSyncedValues({timeout:n,limit:r}),(0,U.jsx)(ng.Provider,{value:a,children:t})},dg=(function(e){return e.frontmostHeight=`--toast-frontmost-height`,e})({}),fg=H.forwardRef(function(e,t){let{render:n,className:r,children:i,...a}=e,o=rg(),s=Al(),c=H.useRef(!1),l=H.useRef(!1),u=o.useState(`isEmpty`),d=o.useState(`toasts`),f=o.useState(`focused`),p=o.useState(`expanded`),m=o.useState(`prevFocusElement`),h=d[0]?.height??0,g=H.useMemo(()=>d.some(e=>e.transitionStatus===`ending`),[d]);H.useEffect(()=>{let e=o.state.viewport;if(!e)return;function t(t){u||t.key===`F6`&&t.target!==e&&(t.preventDefault(),o.setPrevFocusElement(iu(J(e))),e?.focus({preventScroll:!0}),o.pauseTimers(),o.setFocused(!0))}let n=Wa(e);return n.addEventListener(`keydown`,t),()=>{n.removeEventListener(`keydown`,t)}},[o,u]),H.useEffect(()=>{let e=o.state.viewport;if(!e||u)return;let t=Wa(e);function n(e){e.target===t&&(o.setIsWindowFocused(!1),o.pauseTimers())}function r(n){if(n.relatedTarget||n.target===t)return;let r=su(n),i=iu(J(e));(!au(e,r)||!fu(i))&&o.resumeTimers(),s.start(0,()=>o.setIsWindowFocused(!0))}return t.addEventListener(`blur`,n,!0),t.addEventListener(`focus`,r,!0),()=>{t.removeEventListener(`blur`,n,!0),t.removeEventListener(`focus`,r,!0)}},[o,s,u]),H.useEffect(()=>{let e=o.state.viewport;if(!e||u)return;let t=J(e);return t.addEventListener(`pointerdown`,o.handleDocumentPointerDown,!0),()=>{t.removeEventListener(`pointerdown`,o.handleDocumentPointerDown,!0)}},[u,o]);function _(e){let t=o.state.viewport;t&&(c.current=!0,e.relatedTarget===t?d[0]?.ref?.current?.focus():o.restoreFocusToPrevElement())}function v(e){e.key===`Tab`&&e.shiftKey&&e.target===o.state.viewport&&(e.preventDefault(),o.restoreFocusToPrevElement(),o.resumeTimers())}H.useEffect(()=>{!o.state.isWindowFocused||g||!l.current||(o.resumeTimers(),o.setHovering(!1),l.current=!1)},[g,o]);function y(){o.pauseTimers(),o.setHovering(!0),l.current=!1}function b(){g?l.current=!0:(o.resumeTimers(),o.setHovering(!1))}function x(){if(c.current){c.current=!1;return}f||fu(J(o.state.viewport).activeElement)&&(o.setFocused(!0),o.pauseTimers())}function S(e){!f||au(o.state.viewport,e.relatedTarget)||(o.setFocused(!1),o.resumeTimers())}let C={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:y,onMouseMove:y,onMouseLeave:b,onFocus:x,onBlur:S,onKeyDown:v,onClick:x},w={expanded:p},T=Y(`div`,e,{ref:[t,o.setViewport],state:w,props:[C,{style:{[dg.frontmostHeight]:h?`${h}px`:void 0}},a,{children:(0,U.jsxs)(H.Fragment,{children:[!u&&m&&(0,U.jsx)(Kd,{onFocus:_}),i,!u&&m&&(0,U.jsx)(Kd,{onFocus:_})]})}]}),E=H.useMemo(()=>d.filter(e=>e.priority===`high`),[d]);return(0,U.jsxs)(H.Fragment,{children:[!u&&m&&(0,U.jsx)(Kd,{onFocus:_}),T,!f&&E.length>0&&(0,U.jsx)(`div`,{style:Bd,children:E.map(e=>(0,U.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,U.jsx)(`div`,{children:e.title}),(0,U.jsx)(`div`,{children:e.description})]},e.id))})]})}),pg=H.createContext(void 0);function mg(){let e=H.useContext(pg);if(!e)throw Error(Cl(66));return e}var hg=(function(e){return e.index=`--toast-index`,e.offsetY=`--toast-offset-y`,e.height=`--toast-height`,e.swipeMovementX=`--toast-swipe-movement-x`,e.swipeMovementY=`--toast-swipe-movement-y`,e})({}),gg={...fp,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},_g=40,vg=10,yg=.5,bg=1;function xg(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function Sg(e){let t=window.getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}var Cg=H.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],...o}=e,s=n.positionerProps?.anchor!==void 0,c=[];s||(c=Array.isArray(a)?a:[a]);let l=c.length>0,u=rg(),[d,f]=H.useState(void 0),[p,m]=H.useState(!1),[h,g]=H.useState(!1),[_,v]=H.useState(!1),[y,b]=H.useState({x:0,y:0}),[x,S]=H.useState({x:0,y:0,scale:1}),[C,w]=H.useState(),[T,E]=H.useState(),[D,O]=H.useState(null),k=H.useRef(null),A=H.useRef({x:0,y:0}),j=H.useRef({x:0,y:0,scale:1}),M=H.useRef(void 0),N=H.useRef(0),P=H.useRef(!1),F=H.useRef({x:0,y:0}),I=H.useRef(!1),ee=u.useState(`toastIndex`,n.id),L=u.useState(`toastVisibleIndex`,n.id),R=u.useState(`toastOffsetY`,n.id),z=u.useState(`focused`),B=u.useState(`expanded`);mp({open:n.transitionStatus!==`ending`,ref:k,onComplete(){n.transitionStatus===`ending`&&u.removeToast(n.id)}});let te=q((e=!1)=>{let t=k.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){u.updateToastInternal(n.id,{ref:k,height:i,...n.transitionStatus===`starting`?{transitionStatus:void 0}:{}})}e?Wn.flushSync(a):a()});K(te,[te]);function ne(e,t){let n=e,r=t;return!c.includes(`left`)&&!c.includes(`right`)?n=e>0?e**yg:-(Math.abs(e)**yg):(!c.includes(`right`)&&e>0&&(n=e**yg),!c.includes(`left`)&&e<0&&(n=-(Math.abs(e)**yg))),!c.includes(`up`)&&!c.includes(`down`)?r=t>0?t**yg:-(Math.abs(t)**yg):(!c.includes(`down`)&&t>0&&(r=t**yg),!c.includes(`up`)&&t<0&&(r=-(Math.abs(t)**yg))),{x:n,y:r}}function re(e){if(e.button!==0)return;e.pointerType===`touch`&&u.pauseTimers();let t=su(e.nativeEvent);if(!(t&&t.closest(`button,a,input,textarea,[role="button"],[data-swipe-ignore]`))){if(P.current=!1,M.current=void 0,N.current=0,A.current={x:e.clientX,y:e.clientY},F.current=A.current,k.current){let e=Sg(k.current);j.current=e,S(e),b({x:e.x,y:e.y})}u.setHovering(!0),m(!0),g(!1),O(null),I.current=!0,k.current?.setPointerCapture(e.pointerId)}}function V(e){if(!p)return;e.preventDefault(),I.current&&=(A.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>F.current.y||i>0&&t<F.current.y)&&(F.current={x:F.current.x,y:t}),(r<0&&n>F.current.x||r>0&&n<F.current.x)&&(F.current={x:n,y:F.current.y});let a=n-A.current.x,o=t-A.current.y,s=t-F.current.y,l=n-F.current.x;if(!h&&Math.sqrt(a*a+o*o)>=bg&&(g(!0),D===null)){let e=c.includes(`left`)||c.includes(`right`),t=c.includes(`up`)||c.includes(`down`);e&&t&&O(Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`)}let u;if(!M.current)D===`vertical`?o>0?u=`down`:o<0&&(u=`up`):D===`horizontal`?a>0?u=`right`:a<0&&(u=`left`):u=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,u&&c.includes(u)&&(M.current=u,N.current=xg(u,a,o),f(u));else{let e=M.current,t=xg(e,l,s);t>_g?(P.current=!1,f(e)):!(c.includes(`left`)&&c.includes(`right`))&&!(c.includes(`up`)&&c.includes(`down`))&&N.current-t>=vg&&(P.current=!0)}let d=ne(a,o),m=j.current.x,_=j.current.y;D===`horizontal`?(c.includes(`left`)||c.includes(`right`))&&(m+=d.x):(D===`vertical`||(c.includes(`left`)||c.includes(`right`))&&(m+=d.x),(c.includes(`up`)||c.includes(`down`))&&(_+=d.y)),b({x:m,y:_})}function ie(e){if(!p)return;if(m(!1),g(!1),O(null),k.current?.releasePointerCapture(e.pointerId),P.current){b({x:x.x,y:x.y}),f(void 0);return}let t=!1,r=y.x-x.x,i=y.y-x.y,a;for(let e of c){switch(e){case`right`:r>_g&&(t=!0,a=`right`);break;case`left`:r<-_g&&(t=!0,a=`left`);break;case`down`:i>_g&&(t=!0,a=`down`);break;case`up`:i<-_g&&(t=!0,a=`up`);break}if(t)break}t?(f(a),v(!0),u.closeToast(n.id)):(b({x:x.x,y:x.y}),f(void 0))}function ae(e){if(e.key===`Escape`){if(!k.current||!au(k.current,iu(J(k.current))))return;u.closeToast(n.id)}}H.useEffect(()=>{if(!l)return;let e=k.current;if(!e)return;function t(t){au(e,t.target)&&t.preventDefault()}return e.addEventListener(`touchmove`,t,{passive:!1}),()=>{e.removeEventListener(`touchmove`,t)}},[l]);function oe(){if(!p&&y.x===x.x&&y.y===x.y&&!_)return{[hg.swipeMovementX]:`0px`,[hg.swipeMovementY]:`0px`};let e=y.x-x.x,t=y.y-x.y;return{transition:p?`none`:void 0,transform:p?`translateX(${y.x}px) translateY(${y.y}px) scale(${x.scale})`:void 0,[hg.swipeMovementX]:`${e}px`,[hg.swipeMovementY]:`${t}px`}}let se=n.priority===`high`,ce={role:se?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":C,"aria-describedby":T,"aria-hidden":se&&!z?!0:void 0,onPointerDown:l?re:void 0,onPointerMove:l?V:void 0,onPointerUp:l?ie:void 0,onKeyDown:ae,inert:Km(n.limited),style:{...oe(),[hg.index]:n.transitionStatus===`ending`?ee:L,[hg.offsetY]:`${R}px`,[hg.height]:n.height?`${n.height}px`:void 0}},le=H.useMemo(()=>({rootRef:k,toast:n,titleId:C,setTitleId:w,descriptionId:T,setDescriptionId:E,swiping:p,swipeDirection:d,recalculateHeight:te,index:ee,visibleIndex:L,expanded:B}),[n,C,T,p,d,te,ee,L,B]),ue={transitionStatus:n.transitionStatus,expanded:B,limited:n.limited||!1,type:n.type,swiping:le.swiping,swipeDirection:le.swipeDirection},de=Y(`div`,e,{ref:[t,le.rootRef],state:ue,stateAttributesMapping:gg,props:[ce,o]});return(0,U.jsx)(pg.Provider,{value:le,children:de})}),wg=H.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{visibleIndex:a,expanded:o,recalculateHeight:s}=mg(),c=H.useRef(null);return K(()=>{let e=c.current;if(!e||(s(),typeof ResizeObserver!=`function`||typeof MutationObserver!=`function`))return;let t=new ResizeObserver(()=>s(!0)),n=new MutationObserver(()=>s(!0));return t.observe(e),n.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t.disconnect(),n.disconnect()}},[s]),Y(`div`,e,{ref:[t,c],state:{expanded:o,behind:a>0},props:i})}),Tg=H.forwardRef(function(e,t){let{render:n,className:r,id:i,children:a,...o}=e,{toast:s,setDescriptionId:c}=mg(),l=a??s.description,u=!!l,d=Ku(i);K(()=>{if(u)return c(d),()=>{c(void 0)}},[u,d,c]);let f=Y(`p`,e,{ref:t,state:{type:s.type},props:{...o,id:d,children:l}});return u?f:null}),Eg=H.forwardRef(function(e,t){let{render:n,className:r,id:i,children:a,...o}=e,{toast:s,setTitleId:c}=mg(),l=a??s.title,u=!!l,d=Ku(i);K(()=>{if(u)return c(d),()=>{c(void 0)}},[u,d,c]);let f=Y(`h2`,e,{ref:t,state:{type:s.type},props:{...o,id:d,children:l}});return u?f:null}),Dg=H.forwardRef(function(e,t){let{render:n,className:r,disabled:i,nativeButton:a=!0,...o}=e,s=rg(),{toast:c}=mg(),l=s.useState(`expanded`),[u,d]=H.useState(!1),{getButtonProps:f,buttonRef:p}=Wh({disabled:i,native:a}),m={type:c.type};return Y(`button`,e,{ref:[t,p],state:m,props:[{"aria-hidden":!l&&!u,onClick(){s.closeToast(c.id)},onFocus(){d(!0)},onBlur(){d(!1)}},o,f]})}),Og=Tm;function kg(){let e=H.useContext(ng);if(!e)throw Error(Cl(73));let t=e.useState(`toasts`);return H.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}var Ag=H.forwardRef(function(e,t){return(0,U.jsx)(Ph,{ref:t,...e})}),jg=(e,t)=>Object.is(e,t);function Mg(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Ng(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:Mg(t,e,n))}function Pg(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:Mg(e,t,n))}function Fg(e,t,n){return e.filter(e=>!Mg(t,e,n))}function Ig(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Lg(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function Rg(e){if(!Array.isArray(e))return e!=null&&!(`null`in e);if(Lg(e)){for(let t of e)for(let e of t.items)if(e&&e.value==null&&e.label!=null)return!0;return!1}for(let t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function zg(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return Ig(e)}function Bg(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Ig(e.value):Ig(e)}function Vg(e,t,n){function r(){return zg(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=Lg(t)?t.flatMap(e=>e.items):t;if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Hg(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,U.jsx)(H.Fragment,{children:Vg(r,t,n)},i)),e),[])}X(e=>e.id),X(e=>e.query),X(e=>e.items),X(e=>e.selectedValue),X(e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0}),X(e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0}),X((e,t)=>t?Rg(e.items):!1),X(e=>e.open),X(e=>e.mounted),X(e=>e.forceMounted),X(e=>e.inline),X(e=>e.activeIndex),X(e=>e.selectedIndex),X((e,t)=>e.activeIndex===t),X((e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>Mg(t,e,n)):Mg(t,r,n)}),X(e=>e.transitionStatus),X(e=>e.popupProps),X(e=>e.inputProps),X(e=>e.triggerProps),X(e=>e.getItemProps),X(e=>e.positionerElement),X(e=>e.listElement),X(e=>e.triggerElement),X(e=>e.inputElement),X(e=>e.popupSide),X(e=>e.openMethod),X(e=>e.inputInsidePopup),X(e=>e.selectionMode),X(e=>e.listRef),X(e=>e.labelsRef),X(e=>e.popupRef),X(e=>e.emptyRef),X(e=>e.inputRef),X(e=>e.keyboardActiveRef),X(e=>e.chipsContainerRef),X(e=>e.clearRef),X(e=>e.valuesRef),X(e=>e.allValuesRef),X(e=>e.name),X(e=>e.disabled),X(e=>e.readOnly),X(e=>e.required),X(e=>e.grid),X(e=>e.isGrouped),X(e=>e.virtualized),X(e=>e.onOpenChangeComplete),X(e=>e.openOnInputClick),X(e=>e.itemToStringLabel),X(e=>e.isItemEqualToValue),X(e=>e.modal),X(e=>e.autoHighlight),X(e=>e.submitOnItemClick);function Ug(e){return Array.isArray(e)?e.map(e=>Ug(e)).join(`,`):e==null?``:String(e)}function Wg(e){let t=H.useRef(``),n=H.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:H.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Gg(e){let[t,n]=H.useState(null),r=q((t,r)=>{e||n(r||(Hl?`touch`:``))}),i=H.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:o}=Wg(r);return H.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:o}}),[t,i,a,o])}({...hm,...ph});function Kg(e){let t=e.getBoundingClientRect(),n=window.getComputedStyle(e,`::before`),r=window.getComputedStyle(e,`::after`);if(!(n.content!==`none`||r.content!==`none`))return t;let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0,o=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=Math.max(t.width,i,o),l=Math.max(t.height,a,s),u=c-t.width,d=l-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-d/2,bottom:t.bottom+d/2}}var qg=H.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Jg(){return H.useContext(qg)}function Yg(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=q(i),o=H.useRef(0),s=ml(Zg).current,c=ml(Xg).current,[l,u]=H.useState(0),d=H.useRef(l),f=q((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=q(e=>{c.delete(e),d.current+=1,u(d.current)}),m=H.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(Qg).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);K(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),K(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),K(()=>()=>{n.current=[]},[n]),K(()=>()=>{r&&(r.current=[])},[r]);let h=q(e=>(s.add(e),()=>{s.delete(e)}));K(()=>{s.forEach(e=>e(m))},[s,m]);let g=H.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,U.jsx)(qg.Provider,{value:g,children:t})}function Xg(){return new Map}function Zg(){return new Set}function Qg(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}({...gm,...fp});var $g={},e_={},t_=``;function n_(e){if(typeof document>`u`)return!1;let t=J(e);return Wa(t).innerWidth-t.documentElement.clientWidth>0}function r_(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=J(e),n=t.documentElement,r=t.body,i=Za(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function i_(e){let t=J(e),n=t.documentElement,r=t.body,i=Za(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function a_(e){let t=J(e),n=t.documentElement,r=t.body,i=Wa(n),a=0,o=0,s=!1,c=Wd.create();if(Vl&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,$g={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},t_=n.style.scrollBehavior,e_={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Za(n)?n:r;if(s=r_(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,$g),Object.assign(r.style,e_),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=t_)}function d(){u(),c.request(l)}return l(),i.addEventListener(`resize`,d),()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var o_=new class{lockCount=0;restore=null;timeoutLock=kl.create();timeoutUnlock=kl.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=J(e).documentElement,n=Wa(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=nd;return}let r=Hl||!n_(e);this.restore=r?i_(e):a_(e)}};function s_(e=!0,t=null){K(()=>{if(e)return o_.acquire(t)},[e,t])}var c_=H.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
0% 0%,
100% 0%,
100% 100%,
0% 100%,
0% 0%,
${e.left}px ${e.top}px,
${e.left}px ${e.bottom}px,
${e.right}px ${e.bottom}px,
${e.right}px ${e.top}px,
${e.left}px ${e.top}px
)`}return(0,U.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});({...gm,...fp});var l_=(function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e})({});function u_(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=Jg(),f=H.useRef(-1),[p,m]=H.useState(a??(i===l_.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=H.useRef(null),g=H.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return K(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),K(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),H.useMemo(()=>({ref:g,index:p}),[p,g])}({...fp,...mm});var d_=H.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,...a}=e;return Y(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},a]})}),f_=H.createContext(void 0);function p_(e){let t=H.useContext(f_);if(e===!1&&t===void 0)throw Error(Cl(27));return t}var m_={...gm,...fp},h_=H.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=p_(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`);return Y(`div`,e,{state:{open:s,transitionStatus:o.useState(`transitionStatus`)},ref:[o.context.backdropRef,t],stateAttributesMapping:m_,props:[{role:`presentation`,hidden:!l,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})}),g_=H.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{store:s}=p_(),c=s.useState(`open`);function l(e){c&&s.setOpen(!1,Dd(vd,e.nativeEvent))}let{getButtonProps:u,buttonRef:d}=Wh({disabled:i,native:a});return Y(`button`,e,{state:{disabled:i},ref:[t,d],props:[{onClick:l},o,u]})}),__=H.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=p_(),s=_m(i);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),Y(`p`,e,{ref:t,props:[{id:s},a]})}),v_=(function(e){return e.nestedDialogs=`--nested-dialogs`,e})({}),y_=(function(e){return e[e.open=sm.open]=`open`,e[e.closed=sm.closed]=`closed`,e[e.startingStyle=sm.startingStyle]=`startingStyle`,e[e.endingStyle=sm.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e})({}),b_=H.createContext(void 0);function x_(){let e=H.useContext(b_);if(e===void 0)throw Error(Cl(26));return e}var S_=`ArrowUp`,C_=`ArrowDown`,w_=`ArrowLeft`,T_=`ArrowRight`,E_=`Home`,D_=`End`,O_=new Set([w_,T_]),k_=new Set([S_,C_]);[...new Set([...O_,...k_])];var A_=new Set([S_,C_,w_,T_,E_,D_]),j_={...gm,...fp,nestedDialogOpen(e){return e?{[y_.nestedDialogOpen]:``}:null}},M_=H.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=p_(),c=s.useState(`descriptionElementId`),l=s.useState(`disablePointerDismissal`),u=s.useState(`floatingRootContext`),d=s.useState(`popupProps`),f=s.useState(`modal`),p=s.useState(`mounted`),m=s.useState(`nested`),h=s.useState(`nestedOpenDialogCount`),g=s.useState(`open`),_=s.useState(`openMethod`),v=s.useState(`titleElementId`),y=s.useState(`transitionStatus`),b=s.useState(`role`);x_(),mp({open:g,ref:s.context.popupRef,onComplete(){g&&s.context.onOpenChangeComplete?.(!0)}});function x(e){return e===`touch`?s.context.popupRef.current:!0}let S=i===void 0?x:i,C=Y(`div`,e,{state:{open:g,nested:m,transitionStatus:y,nestedDialogOpen:h>0},props:[d,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:b,tabIndex:-1,hidden:!p,onKeyDown(e){A_.has(e.key)&&e.stopPropagation()},style:{[v_.nestedDialogs]:h}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:j_});return(0,U.jsx)(Uf,{context:u,openInteractionType:_,disabled:!p,closeOnFocusOut:!l,initialFocus:S,returnFocus:r,modal:f!==!1,restoreFocus:`popup`,children:C})}),N_=H.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=p_(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,U.jsx)(b_.Provider,{value:n,children:(0,U.jsxs)(Mf,{ref:t,...r,children:[a&&o===!0&&(0,U.jsx)(c_,{ref:i.context.internalBackdropRef,inert:Km(!s)}),e.children]})}):null});function P_(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l,reset:u}=Gg(i);_p(t);let{forceUnmount:d}=vp(i,t,()=>{u()}),f=q(e=>{let n=Dd(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=H.useCallback(()=>{t.setOpen(!1,f(Td))},[t,f]);H.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=Ep({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,g]=H.useState(0),_=h===0,v=Zp(m),y=Xf(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=su(e);if(_&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||au(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:_});s_(i&&o===!0,s);let{getReferenceProps:b,getFloatingProps:x,getTriggerProps:S}=Bp([v,y]);t.useContextCallback(`onNestedDialogOpen`,e=>{g(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0)}),H.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,h]);let C=H.useMemo(()=>b(l),[b,l]),w=H.useMemo(()=>S(l),[S,l]),T=H.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:w,popupProps:T,floatingRootContext:m,nestedOpenDialogCount:h})}var F_={...Cp,modal:X(e=>e.modal),nested:X(e=>e.nested),nestedOpenDialogCount:X(e=>e.nestedOpenDialogCount),disablePointerDismissal:X(e=>e.disablePointerDismissal),openMethod:X(e=>e.openMethod),descriptionElementId:X(e=>e.descriptionElementId),titleElementId:X(e=>e.titleElementId),viewportElement:X(e=>e.viewportElement),role:X(e=>e.role)},I_=class extends ap{constructor(e){super(L_(e),{popupRef:H.createRef(),backdropRef:H.createRef(),internalBackdropRef:H.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new yp,onOpenChange:void 0,onOpenChangeComplete:void 0},F_)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function L_(e={}){return{...xp(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function R_(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=p_(!0),p=!!f,m=ml(()=>l?.store??new I_({open:r,openProp:n,activeTriggerId:d,triggerIdProp:u,modal:s,disablePointerDismissal:o,nested:p})).current;Sl(()=>{n===void 0&&m.state.open===!1&&r===!0&&m.update({open:!0,activeTriggerId:d})}),m.useControlledProp(`openProp`,n),m.useControlledProp(`triggerIdProp`,u),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);P_({store:m,actionsRef:c,parentContext:f?.store.context});let g=H.useMemo(()=>({store:m}),[m]);return(0,U.jsx)(f_.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}(function(e){return e[e.open=sm.open]=`open`,e[e.closed=sm.closed]=`closed`,e[e.startingStyle=sm.startingStyle]=`startingStyle`,e[e.endingStyle=sm.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e})({}),{...gm,...fp};var z_=H.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=p_(),s=_m(i);return o.useSyncedValueWithCleanup(`titleElementId`,s),Y(`h2`,e,{ref:t,props:[{id:s},a]})}),B_=H.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,payload:s,handle:c,...l}=e,u=p_(!0),d=c?.store??u?.store;if(!d)throw Error(Cl(79));let f=_m(o),p=d.useState(`floatingRootContext`),m=d.useState(`isOpenedByTrigger`,f),h=H.useRef(null),{registerTrigger:g,isMountedByThisTrigger:_}=gp(f,h,d,{payload:s}),{getButtonProps:v,buttonRef:y}=Wh({disabled:i,native:a}),b=Bp([Wf(p,{enabled:p!=null})]),x={disabled:i,open:m},S=d.useState(`triggerProps`,_);return Y(`button`,e,{state:x,ref:[y,t,g,h],props:[b.getReferenceProps(),S,{[cd]:``,id:f},l,v],stateAttributesMapping:mm})});function V_(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,actionsRef:o,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=p_(),d=!!u,f=ml(()=>s?.store??new I_({open:r,openProp:n,activeTriggerId:l,triggerIdProp:c,modal:!0,disablePointerDismissal:!0,nested:d,role:`alertdialog`})).current;f.useControlledProp(`openProp`,n),f.useControlledProp(`triggerIdProp`,c),f.useSyncedValue(`nested`,d),f.useContextCallback(`onOpenChange`,i),f.useContextCallback(`onOpenChangeComplete`,a);let p=f.useState(`payload`);P_({store:f,actionsRef:o,parentContext:u?.store.context});let m=H.useMemo(()=>({store:f}),[f]);return(0,U.jsx)(f_.Provider,{value:m,children:typeof t==`function`?t({payload:p}):t})}function H_(e){return Y(e.defaultTagName??`div`,e,e)}var U_=H.createContext(void 0);function W_(e){let t=H.useContext(U_);if(t===void 0&&!e)throw Error(Cl(33));return t}var G_=H.createContext(void 0);function K_(e){let t=H.useContext(G_);if(t===void 0&&!e)throw Error(Cl(36));return t}var q_=H.createContext(void 0);function J_(e=!0){let t=H.useContext(q_);if(t===void 0&&!e)throw Error(Cl(25));return t}({...gm,...fp});var Y_=H.createContext(void 0);function X_(){let e=H.useContext(Y_);if(e===void 0)throw Error(Cl(30));return e}function Z_(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,itemRef:o,itemMetadata:s}=e,{events:c}=a.useState(`floatingTreeRoot`),l=J_(!0),u=l!==void 0;return H.useMemo(()=>({id:r,role:`menuitem`,tabIndex:n?0:-1,onMouseMove(e){i&&c.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&c.emit(`close`,{domEvent:e,reason:_d})},onMouseUp(e){if(l){let t=l.initialCursorPointRef.current;if(l.initialCursorPointRef.current=null,u&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1)return}o.current&&a.context.allowMouseUpTriggerRef.current&&(!u||e.button===2)&&(!s||s.type===`regular-item`)&&o.current.click()}}),[t,n,r,c,i,a,o,l,u,s])}var Q_={type:`regular-item`};function $_(e){let{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,nativeButton:o,itemMetadata:s,nodeId:c}=e,l=H.useRef(null),{getButtonProps:u,buttonRef:d}=Wh({disabled:n,focusableWhenDisabled:!0,native:o}),f=Z_({closeOnClick:t,highlighted:r,id:i,nodeId:c,store:a,itemRef:l,itemMetadata:s}),p=H.useCallback(e=>pf(f,{onMouseEnter(){s.type===`submenu-trigger`&&s.setActive()},onKeyUp(e){e.key===` `&&a.context.typingRef.current&&e.preventBaseUIHandler()}},e,u),[f,u,a,s]),m=Nd(l,d);return H.useMemo(()=>({getItemProps:p,itemRef:m}),[p,m])}var ev=(function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.highlighted=`data-highlighted`,e})({}),tv={checked(e){return e?{[ev.checked]:``}:{[ev.unchecked]:``}},...fp},nv=H.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,checked:l,defaultChecked:u,onCheckedChange:d,...f}=e,p=u_({label:a}),m=W_(!0),h=_m(i),{store:g}=K_(),_=g.useState(`isActive`,p.index),v=g.useState(`itemProps`),[y,b]=jh({controlled:l,default:u??!1,name:`MenuCheckboxItem`,state:`checked`}),{getItemProps:x,itemRef:S}=$_({closeOnClick:c,disabled:s,highlighted:_,id:h,store:g,nativeButton:o,nodeId:m?.nodeId,itemMetadata:Q_}),C=H.useMemo(()=>({disabled:s,highlighted:_,checked:y}),[s,_,y]),w=Y(`div`,e,{state:C,stateAttributesMapping:tv,props:[v,{role:`menuitemcheckbox`,"aria-checked":y,onClick:q(e=>{let t={...Dd(_d,e.nativeEvent),preventUnmountOnClose:()=>{}};d?.(!y,t),!t.isCanceled&&b(e=>!e)})},f,x],ref:[S,t,p.ref]});return(0,U.jsx)(Y_.Provider,{value:C,children:w})}),rv=H.forwardRef(function(e,t){let{render:n,className:r,keepMounted:i=!1,...a}=e,o=X_(),s=H.useRef(null),{transitionStatus:c,setMounted:l}=cp(o.checked);return mp({open:o.checked,ref:s,onComplete(){o.checked||l(!1)}}),Y(`span`,e,{state:{checked:o.checked,disabled:o.disabled,highlighted:o.highlighted,transitionStatus:c},ref:[t,s],stateAttributesMapping:tv,props:{"aria-hidden":!0,...a},enabled:i||o.checked})}),iv=H.createContext(void 0);function av(){let e=H.useContext(iv);if(e===void 0)throw Error(Cl(31));return e}var ov=H.forwardRef(function(e,t){let{render:n,className:r,...i}=e,[a,o]=H.useState(void 0),s=H.useMemo(()=>({setLabelId:o}),[o]),c=Y(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":a,...i}});return(0,U.jsx)(iv.Provider,{value:s,children:c})}),sv=H.forwardRef(function(e,t){let{className:n,render:r,id:i,...a}=e,o=_m(i),{setLabelId:s}=av();return K(()=>(s(o),()=>{s(void 0)}),[s,o]),Y(`div`,e,{ref:t,props:{id:o,role:`presentation`,...a}})}),cv=H.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,...l}=e,u=u_({label:a}),d=W_(!0),f=_m(i),{store:p}=K_(),m=p.useState(`isActive`,u.index),h=p.useState(`itemProps`),{getItemProps:g,itemRef:_}=$_({closeOnClick:c,disabled:s,highlighted:m,id:f,store:p,nativeButton:o,nodeId:d?.nodeId,itemMetadata:Q_});return Y(`div`,e,{state:{disabled:s,highlighted:m},props:[h,l,g],ref:[_,t,u.ref]})}),lv=H.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,closeOnClick:o=!1,...s}=e,c=H.useRef(null),l=u_({label:a}),u=W_(!0)?.nodeId,d=_m(i),{store:f}=K_(),p=f.useState(`isActive`,l.index),m=f.useState(`itemProps`),h=Z_({closeOnClick:o,highlighted:p,id:d,nodeId:u,store:f,itemRef:c});return Y(`a`,e,{state:H.useMemo(()=>({highlighted:p}),[p]),props:[m,s,h],ref:[c,t,l.ref]})}),uv=H.createContext(void 0);function dv(e){let t=H.useContext(uv);if(t===void 0&&!e)throw Error(Cl(69));return t}var fv={...gm,...fp},pv=H.forwardRef(function(e,t){let{render:n,className:r,finalFocus:i,...a}=e,{store:o}=K_(),{side:s,align:c}=W_(),l=dv(!0)!=null,u=o.useState(`open`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`mounted`),m=o.useState(`instantType`),h=o.useState(`activeTriggerElement`),g=o.useState(`parent`),_=o.useState(`lastOpenChangeReason`),v=o.useState(`rootId`),y=o.useState(`floatingRootContext`),b=o.useState(`floatingTreeRoot`),x=o.useState(`closeDelay`),S=o.useState(`activeTriggerElement`),C=g.type===`context-menu`;mp({open:u,ref:o.context.popupRef,onComplete(){u&&o.context.onOpenChangeComplete?.(!0)}}),H.useEffect(()=>{function e(e){o.setOpen(!1,Dd(e.reason,e.domEvent))}return b.events.on(`close`,e),()=>{b.events.off(`close`,e)}},[b.events,o]);let w=o.useState(`hoverEnabled`),T=o.useState(`disabled`);Fp(y,{enabled:w&&!T&&!C&&g.type!==`menubar`,closeDelay:x});let E=Y(`div`,e,{state:{transitionStatus:d,side:s,align:c,open:u,nested:g.type===`menu`,instant:m},ref:[t,o.context.popupRef],stateAttributesMapping:fv,props:[f,{onKeyDown(e){l&&A_.has(e.key)&&e.stopPropagation()}},Bm(d),a,{"data-rootownerid":v}]}),D=g.type===void 0||C;return(h||g.type===`menubar`&&_!==gd)&&(D=!0),(0,U.jsx)(Uf,{context:y,modal:C,disabled:!p,returnFocus:i===void 0?D:i,initialFocus:g.type!==`menu`,restoreFocus:!0,externalTree:g.type===`menubar`?void 0:b,previousFocusableElement:S,nextFocusableElement:g.type===void 0?o.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:g.type===void 0?o.context.beforeContentFocusGuardRef:void 0,children:E})}),mv=H.createContext(void 0);function hv(){let e=H.useContext(mv);if(e===void 0)throw Error(Cl(32));return e}var gv=H.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=K_();return i.useState(`mounted`)||n?(0,U.jsx)(mv.Provider,{value:n,children:(0,U.jsx)(Mf,{ref:t,...r})}):null}),_v=H.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=ld,...g}=e,{store:_}=K_(),v=hv(),y=J_(!0),b=_.useState(`parent`),x=_.useState(`floatingRootContext`),S=_.useState(`floatingTreeRoot`),C=_.useState(`mounted`),w=_.useState(`open`),T=_.useState(`modal`),E=_.useState(`activeTriggerElement`),D=_.useState(`transitionStatus`),O=_.useState(`lastOpenChangeReason`),k=_.useState(`floatingNodeId`),A=_.useState(`floatingParentNodeId`),j=n,M=c,N=l,P=s,F=h;b.type===`context-menu`&&(j=n??b.context?.anchor,P??=`start`,!o&&P!==`center`&&(N=e.alignOffset??2,M=e.sideOffset??-5));let I=o,ee=P;b.type===`menu`?(I??=`inline-end`,ee??=`start`,F=e.collisionAvoidance??ud):b.type===`menubar`&&(I??=`bottom`,ee??=`start`);let L=b.type===`context-menu`,R=Rm({anchor:j,floatingRootContext:x,positionMethod:y?`fixed`:r,mounted:C,side:I,sideOffset:M,align:ee,alignOffset:N,arrowPadding:L?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:k,keepMounted:v,disableAnchorTracking:m,collisionAvoidance:F,shiftCrossAxis:L&&!(`side`in F&&F.side===`flip`),externalTree:S}),z=H.useMemo(()=>{let e={};return w||(e.pointerEvents=`none`),{role:`presentation`,hidden:!C,style:{...R.positionerStyles,...e}}},[w,C,R.positionerStyles]);H.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===k&&_.set(`hoverEnabled`,!1),e.nodeId!==k&&e.parentNodeId===_.select(`floatingParentNodeId`)&&_.setOpen(!1,Dd(Cd)))}return S.events.on(`menuopenchange`,e),()=>{S.events.off(`menuopenchange`,e)}},[_,S.events,k]),H.useEffect(()=>{if(_.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==_.select(`floatingParentNodeId`))return;let t=e.reason??Cd;_.setOpen(!1,Dd(t))}return S.events.on(`menuopenchange`,e),()=>{S.events.off(`menuopenchange`,e)}},[S.events,_]),H.useEffect(()=>{function e(e){!w||e.nodeId!==_.select(`floatingParentNodeId`)||e.target&&E&&E!==e.target&&_.setOpen(!1,Dd(Cd))}return S.events.on(`itemhover`,e),()=>{S.events.off(`itemhover`,e)}},[S.events,w,E,_]),H.useEffect(()=>{let e={open:w,nodeId:k,parentNodeId:A,reason:_.select(`lastOpenChangeReason`)};S.events.emit(`menuopenchange`,e)},[S.events,w,_,k,A]);let B={open:w,side:R.side,align:R.align,anchorHidden:R.anchorHidden,nested:b.type===`menu`},te=H.useMemo(()=>({side:R.side,align:R.align,arrowRef:R.arrowRef,arrowUncentered:R.arrowUncentered,arrowStyles:R.arrowStyles,nodeId:R.context.nodeId}),[R.side,R.align,R.arrowRef,R.arrowUncentered,R.arrowStyles,R.context.nodeId]),ne=Y(`div`,e,{state:B,stateAttributesMapping:gm,ref:[t,_.useStateSetter(`positionerElement`)],props:[z,Bm(D),g]}),re=C&&b.type!==`menu`&&(b.type!==`menubar`&&T&&O!==md||b.type===`menubar`&&b.context.modal),V=null;return b.type===`menubar`?V=b.context.contentElement:b.type===void 0&&(V=E),(0,U.jsxs)(U_.Provider,{value:te,children:[re&&(0,U.jsx)(c_,{ref:b.type===`context-menu`||b.type===`nested-context-menu`?b.context.internalBackdropRef:null,inert:Km(!w),cutout:V}),(0,U.jsx)(ed,{id:k,children:(0,U.jsx)(Yg,{elementsRef:_.context.itemDomElements,labelsRef:_.context.itemLabels,children:ne})})]})}),vv=H.createContext(void 0);function yv(){let e=H.useContext(vv);if(e===void 0)throw Error(Cl(34));return e}var bv=H.memo(H.forwardRef(function(e,t){let{render:n,className:r,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,...c}=e,[l,u]=jh({controlled:i,default:a,name:`MenuRadioGroup`}),d=q(o),f=q((e,t)=>{d?.(e,t),!t.isCanceled&&u(e)}),p=Y(`div`,e,{state:{disabled:s},ref:t,props:{role:`group`,"aria-disabled":s||void 0,...c}}),m=H.useMemo(()=>({value:l,setValue:f,disabled:s}),[l,f,s]);return(0,U.jsx)(vv.Provider,{value:m,children:p})})),xv=H.createContext(void 0);function Sv(){let e=H.useContext(xv);if(e===void 0)throw Error(Cl(35));return e}var Cv=H.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,value:l,...u}=e,d=u_({label:a}),f=W_(!0),p=_m(i),{store:m}=K_(),h=m.useState(`isActive`,d.index),g=m.useState(`itemProps`),{value:_,setValue:v,disabled:y}=yv(),b=y||s,x=_===l,{getItemProps:S,itemRef:C}=$_({closeOnClick:c,disabled:b,highlighted:h,id:p,store:m,nativeButton:o,nodeId:f?.nodeId,itemMetadata:Q_}),w=H.useMemo(()=>({disabled:b,highlighted:h,checked:x}),[b,h,x]),T=Y(`div`,e,{state:w,stateAttributesMapping:tv,props:[g,{role:`menuitemradio`,"aria-checked":x,onClick:q(e=>{v(l,{...Dd(_d,e.nativeEvent),preventUnmountOnClose:()=>{}})})},u,S],ref:[C,t,d.ref]});return(0,U.jsx)(xv.Provider,{value:w,children:T})}),wv=H.forwardRef(function(e,t){let{render:n,className:r,keepMounted:i=!1,...a}=e,o=Sv(),s=H.useRef(null),{transitionStatus:c,setMounted:l}=cp(o.checked);return mp({open:o.checked,ref:s,onComplete(){o.checked||l(!1)}}),Y(`span`,e,{state:{checked:o.checked,disabled:o.disabled,highlighted:o.highlighted,transitionStatus:c},stateAttributesMapping:tv,ref:[t,s],props:{"aria-hidden":!0,...a},enabled:i||o.checked})}),Tv=H.createContext(null);function Ev(e){let t=H.useContext(Tv);if(t===null&&!e)throw Error(Cl(5));return t}var Dv={...Cp,disabled:X(e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled),modal:X(e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0)),allowMouseEnter:X(e=>e.allowMouseEnter),stickIfOpen:X(e=>e.stickIfOpen),parent:X(e=>e.parent),rootId:X(e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId),activeIndex:X(e=>e.activeIndex),isActive:X((e,t)=>e.activeIndex===t),hoverEnabled:X(e=>e.hoverEnabled),instantType:X(e=>e.instantType),lastOpenChangeReason:X(e=>e.openChangeReason),floatingTreeRoot:X(e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot),floatingNodeId:X(e=>e.floatingNodeId),floatingParentNodeId:X(e=>e.floatingParentNodeId),itemProps:X(e=>e.itemProps),closeDelay:X(e=>e.closeDelay),keyboardEventRelay:X(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)})},Ov=class e extends ap{constructor(e){super({...kv(),...e},{positionerRef:H.createRef(),popupRef:H.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:H.createRef(),beforeContentFocusGuardRef:H.createRef(),onOpenChangeComplete:void 0,triggerElements:new yp},Dv),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){this.unsubscribeParentListener=e.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}static useStore(t,n){let r=ml(()=>new e(n)).current;return t??r}unsubscribeParentListener=null};function kv(){return{...xp(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Ju,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:id,keyboardEventRelay:void 0,closeDelay:0}}var Av=H.createContext(void 0);function jv(){return H.useContext(Av)}var Mv=yl(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=J_(!0),_=K_(!0),v=Ev(!0),y=jv(),b=H.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=Ov.useStore(f?.store,{open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b});Sl(()=>{n===void 0&&x.state.open===!1&&a===!0&&x.update({open:!0,activeTriggerId:m})}),x.useControlledProp(`openProp`,n),x.useControlledProp(`triggerIdProp`,p),x.useContextCallback(`onOpenChangeComplete`,i);let S=x.useState(`floatingTreeRoot`),C=$u(S),w=Zu();K(()=>{g&&!_?x.update({parent:{type:`context-menu`,context:g},floatingNodeId:C,floatingParentNodeId:w}):_&&x.update({floatingNodeId:C,floatingParentNodeId:w})},[g,_,C,w,x]);let T=x.useState(`open`),E=x.useState(`activeTriggerElement`),D=x.useState(`positionerElement`),O=x.useState(`hoverEnabled`),k=x.useState(`modal`),A=x.useState(`disabled`),j=x.useState(`lastOpenChangeReason`),M=x.useState(`parent`),N=x.useState(`activeIndex`),P=x.useState(`payload`),F=x.useState(`floatingParentNodeId`),I=H.useRef(null),ee=F!=null,L;x.useSyncedValues({disabled:o,modal:M.type===void 0?s:void 0,rootId:Ku()});let{openMethod:R,triggerProps:z,reset:B}=Gg(T);_p(x);let{forceUnmount:te}=vp(T,x,()=>{x.update({allowMouseEnter:!1,stickIfOpen:!0}),B()}),ne=H.useRef(M.type!==`context-menu`),re=Al();H.useEffect(()=>{if(T||(I.current=null),M.type===`context-menu`){if(!T){re.clear(),ne.current=!1;return}re.start(500,()=>{ne.current=!0})}},[re,T,M.type]),s_(T&&k&&j!==md&&R!==`touch`,D),K(()=>{!T&&!O&&x.set(`hoverEnabled`,!0)},[T,O,x]);let V=H.useRef(!0),ie=Al(),ae=q((e,t)=>{let n=t.reason;if(T===e&&t.trigger===E&&j===n||(t.preventUnmountOnClose=()=>{x.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&(t.trigger=E??void 0),r?.(e,t),t.isCanceled))return;let i={open:e,nativeEvent:t.event,reason:t.reason,nested:ee};L?.emit(`openchange`,i);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!V.current)return;if(!e&&N!==null){let e=x.context.itemDomElements.current[N];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}e&&n===hd?(V.current=!1,ie.start(300,()=>{V.current=!0})):(V.current=!0,ie.clear());let o=(n===pd||n===_d)&&a.detail===0&&a?.isTrusted,s=!e&&(n===bd||n==null),c={open:e,openChangeReason:n};I.current=t.event??null;let l=t.trigger?.id??null;(l||e)&&(c.activeTriggerId=l,c.activeTriggerElement=t.trigger??null),x.update(c),M.type===`menubar`&&(n===hd||n===yd||n===md||n===xd||n===Cd)?x.set(`instantType`,`group`):o||s?x.set(`instantType`,o?`click`:`dismiss`):x.set(`instantType`,void 0)}),oe=H.useCallback(e=>{let t=Dd(e);return t.preventUnmountOnClose=()=>{x.set(`preventUnmountingOnClose`,!0)},t},[x]),se=H.useCallback(()=>{x.setOpen(!1,oe(Td))},[x,oe]);H.useImperativeHandle(u,()=>({unmount:te,close:se}),[te,se]);let ce;M.type===`context-menu`&&(ce=M.context),H.useImperativeHandle(ce?.positionerRef,()=>D,[D]),H.useImperativeHandle(ce?.actionsRef,()=>({setOpen:ae}),[ae]);let le=Ep({popupStore:x,onOpenChange:ae});L=le.context.events,H.useEffect(()=>{let e=({open:e,eventDetails:t})=>ae(e,t);return L.on(`setOpen`,e),()=>{L?.off(`setOpen`,e)}},[L,ae]);let ue=Xf(le,{enabled:!A,bubbles:{escapeKey:d&&M.type===`menu`},outsidePress(){return M.type!==`context-menu`||I.current?.type===`contextmenu`?!0:ne.current},externalTree:ee?S:void 0}),de=Zp(le,{role:`menu`}),fe=Am(),pe=H.useCallback(e=>{x.select(`activeIndex`)!==e&&x.set(`activeIndex`,e)},[x]),me=Yp(le,{enabled:!A,listRef:x.context.itemDomElements,activeIndex:N,nested:M.type!==void 0,loopFocus:c,orientation:l,parentOrientation:M.type===`menubar`?M.context.orientation:void 0,rtl:fe===`rtl`,disabledIndices:rd,onNavigate:pe,openOnArrowKeyDown:M.type!==`context-menu`,externalTree:ee?S:void 0,focusItemOnHover:h}),he=H.useCallback(e=>{x.context.typingRef.current=e},[x]),{getReferenceProps:ge,getFloatingProps:_e,getItemProps:ve,getTriggerProps:ye}=Bp([ue,de,me,Qp(le,{listRef:x.context.itemLabels,activeIndex:N,resetMs:ad,onMatch:e=>{T&&e!==N&&x.set(`activeIndex`,e)},onTypingChange:he})]),be=H.useMemo(()=>{let e=pf(ge(),{onMouseMove(){x.set(`allowMouseEnter`,!0)}},z);return delete e.role,e},[ge,x,z]),xe=H.useMemo(()=>{let e=ye();if(!e)return e;let t=pf(e,z);return delete t.role,delete t[`aria-controls`],t},[ye,z]),Se=H.useMemo(()=>_e({onMouseMove(){x.set(`allowMouseEnter`,!0),M.type===`menu`&&x.set(`hoverEnabled`,!1)},onClick(){x.select(`hoverEnabled`)&&x.set(`hoverEnabled`,!1)},onKeyDown(e){let t=x.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}}),[_e,M.type,x]),Ce=H.useMemo(()=>ve(),[ve]);x.useSyncedValues({floatingRootContext:le,activeTriggerProps:be,inactiveTriggerProps:xe,popupProps:Se,itemProps:Ce});let we=H.useMemo(()=>({store:x,parent:b}),[x,b]),Te=(0,U.jsx)(G_.Provider,{value:we,children:typeof t==`function`?t({payload:P}):t});return M.type===void 0||M.type===`context-menu`?(0,U.jsx)(td,{externalTree:S,children:Te}):Te});function Nv(e){let t=K_().store,n=H.useMemo(()=>({parentMenu:t}),[t]);return(0,U.jsx)(Av.Provider,{value:n,children:(0,U.jsx)(Mv,{...e})})}function Pv(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Hh(),{ref:i,index:a}=u_(e),o=n===a,s=H.useRef(null),c=Nd(i,s);return{compositeProps:H.useMemo(()=>({tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}}),[o,r,a,t]),compositeRef:c,index:a}}function Fv(e){let{render:t,className:n,state:r=id,props:i=rd,refs:a=rd,metadata:o,stateAttributesMapping:s,tag:c=`div`,...l}=e,{compositeProps:u,compositeRef:d}=Pv({metadata:o});return Y(c,e,{state:r,ref:[...a,d],props:[u,...i,l],stateAttributesMapping:s})}function Iv(e){if(Ja(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`)??void 0;if(!lo(e))return Iv(po(e))}function Lv(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=H.useRef(!1);return H.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,J(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:id,[t,n,r])}var Rv=2,zv=bl(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,openOnHover:s,delay:c=100,closeDelay:l=0,handle:u,payload:d,...f}=e,p=K_(!0),m=u?.store??p?.store;if(!m)throw Error(Cl(85));let h=_m(o),g=m.useState(`isTriggerActive`,h),_=m.useState(`floatingRootContext`),v=m.useState(`isOpenedByTrigger`,h),y=H.useRef(null),b=Vv(),x=Hh(!0),S=Qu(),C=H.useMemo(()=>S??new Ju,[S]),{registerTrigger:w,isMountedByThisTrigger:T}=gp(h,y,m,{payload:d,closeDelay:l,parent:b,floatingTreeRoot:C,floatingNodeId:$u(C),floatingParentNodeId:Zu(),keyboardEventRelay:x?.relayKeyboardEvent}),E=b.type===`menubar`,D=m.useState(`disabled`),O=i||D||E&&b.context.disabled,{getButtonProps:k,buttonRef:A}=Wh({disabled:O,native:a});H.useEffect(()=>{!v&&b.type===void 0&&(m.context.allowMouseUpTriggerRef.current=!1)},[m,v,b.type]);let j=H.useRef(null),M=Al(),N=q(e=>{if(!j.current)return;M.clear(),m.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(au(j.current,t)||au(m.select(`positionerElement`),t)||t===j.current||t!=null&&Iv(t)===m.select(`rootId`))return;let n=Kg(j.current);e.clientX>=n.left-Rv&&e.clientX<=n.right+Rv&&e.clientY>=n.top-Rv&&e.clientY<=n.bottom+Rv||C.events.emit(`close`,{domEvent:e,reason:Sd})});H.useEffect(()=>{v&&m.select(`lastOpenChangeReason`)===md&&J(j.current).addEventListener(`mouseup`,N,{once:!0})},[v,N,m]);let P=E&&b.context.hasSubmenuOpen,F=zp(_,{enabled:(s??P)&&!O&&b.type!==`context-menu`&&(!E||P&&!T),handleClose:tm({blockPointerEvents:!E}),mouseOnly:!0,move:!1,restMs:b.type===void 0?c:void 0,delay:{close:l},triggerElementRef:y,externalTree:C,isActiveTrigger:g}),I=Bv(v,m.select(`lastOpenChangeReason`)),ee=Wf(_,{enabled:!O&&b.type!==`context-menu`,event:v&&E?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:b.type===void 0?I:!1}),L=Op(_,{enabled:!O&&P}),R=Lv({open:v,enabled:E,mouseDownAction:`open`}),z=Bp([ee,L]),B={disabled:O,open:v},te=m.useState(`triggerProps`,T),ne=[j,t,A,w,y],re=[z.getReferenceProps(),F??id,te,{"aria-haspopup":`menu`,id:h,onMouseDown:e=>{m.select(`open`)||(M.start(200,()=>{m.context.allowMouseUpTriggerRef.current=!0}),J(e.currentTarget).addEventListener(`mouseup`,N,{once:!0}))}},E?{role:`menuitem`}:{},R,f,k],V=H.useRef(null),ie=q(e=>{Wn.flushSync(()=>{m.setOpen(!1,Dd(yd,e.nativeEvent,e.currentTarget))}),Ru(V.current)?.focus()}),ae=q(e=>{let t=m.select(`positionerElement`);if(t&&zu(e,t))m.context.beforeContentFocusGuardRef.current?.focus();else{Wn.flushSync(()=>{m.setOpen(!1,Dd(yd,e.nativeEvent,e.currentTarget))});let n=Lu(m.context.triggerFocusTargetRef.current||y.current);for(;n!==null&&au(t,n);){let e=n;if(n=Pu(n),n===e)break}n?.focus()}}),oe=Y(`button`,e,{enabled:!E,stateAttributesMapping:hm,state:B,ref:ne,props:re});return E?(0,U.jsx)(Fv,{tag:`button`,render:n,className:r,state:B,refs:ne,props:re,stateAttributesMapping:hm}):v?(0,U.jsxs)(H.Fragment,{children:[(0,U.jsx)(Kd,{ref:V,onFocus:ie},`${h}-pre-focus-guard`),(0,U.jsx)(H.Fragment,{children:oe},h),(0,U.jsx)(Kd,{ref:m.context.triggerFocusTargetRef,onFocus:ae},`${h}-post-focus-guard`)]}):(0,U.jsx)(H.Fragment,{children:oe},h)});function Bv(e,t){let n=Al(),[r,i]=H.useState(!1);return K(()=>{e&&t===`trigger-hover`?(i(!0),n.start(od,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Vv(){let e=J_(!0),t=K_(!0),n=Ev(!0);return H.useMemo(()=>n?{type:`menubar`,context:n}:e&&!t?{type:`context-menu`,context:e}:{type:void 0},[e,t,n])}var Hv=H.forwardRef(function(e,t){let{render:n,className:r,label:i,id:a,nativeButton:o=!1,openOnHover:s=!0,delay:c=100,closeDelay:l=0,disabled:u=!1,...d}=e,f=u_(),p=W_(),{store:m}=K_(),h=_m(a),g=m.useState(`open`),_=m.useState(`floatingRootContext`),v=m.useState(`floatingTreeRoot`),y=hp(h,m),b=H.useCallback(e=>{let t=y(e);return e!==null&&m.select(`open`)&&m.select(`activeTriggerId`)==null&&m.update({activeTriggerId:h,activeTriggerElement:e,closeDelay:l}),t},[y,l,m,h]),x=H.useRef(null),S=H.useCallback(e=>{x.current=e,m.set(`activeTriggerElement`,e)},[m]),C=jv();if(!C?.parentMenu)throw Error(Cl(37));m.useSyncedValue(`closeDelay`,l);let w=C.parentMenu,T=w.useState(`itemProps`),E=w.useState(`isActive`,f.index),D=H.useMemo(()=>({type:`submenu-trigger`,setActive(){w.set(`activeIndex`,f.index)}}),[w,f.index]),O=m.useState(`disabled`),k=u||O,{getItemProps:A,itemRef:j}=$_({closeOnClick:!1,disabled:k,highlighted:E,id:h,store:m,nativeButton:o,itemMetadata:D,nodeId:p?.nodeId}),M=m.useState(`hoverEnabled`),N=w.useState(`allowMouseEnter`),P=zp(_,{enabled:M&&s&&!k,handleClose:tm({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:c,delay:N?{open:c,close:l}:0,triggerElementRef:x,externalTree:v}),F=Bp([Wf(_,{enabled:!k,event:`mousedown`,toggle:!s,ignoreMouse:s,stickIfOpen:!1})]),I=m.useState(`triggerProps`,!0);return delete I.id,Y(`div`,e,{state:{disabled:k,highlighted:E,open:g},stateAttributesMapping:mm,props:[F.getReferenceProps(),P,I,T,{tabIndex:g||E?0:-1,onBlur(){E&&w.set(`activeIndex`,null)}},d,A],ref:[t,f.ref,j,b,S]})}),Uv=H.createContext(null),Wv=H.createContext(null);function Gv(){let e=H.useContext(Uv);if(e===null)throw Error(Cl(60));return e}function Kv(){let e=H.useContext(Wv);if(e===null)throw Error(Cl(61));return e}var qv={id:X(e=>e.id),modal:X(e=>e.modal),multiple:X(e=>e.multiple),items:X(e=>e.items),itemToStringLabel:X(e=>e.itemToStringLabel),itemToStringValue:X(e=>e.itemToStringValue),isItemEqualToValue:X(e=>e.isItemEqualToValue),value:X(e=>e.value),hasSelectedValue:X(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Bg(t,r)!==``}),hasNullItemLabel:X((e,t)=>t?Rg(e.items):!1),open:X(e=>e.open),mounted:X(e=>e.mounted),forceMount:X(e=>e.forceMount),transitionStatus:X(e=>e.transitionStatus),openMethod:X(e=>e.openMethod),activeIndex:X(e=>e.activeIndex),selectedIndex:X(e=>e.selectedIndex),isActive:X((e,t)=>e.activeIndex===t),isSelected:X((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>Mg(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Mg(n,i,r)}),isSelectedByFocus:X((e,t)=>e.selectedIndex===t),popupProps:X(e=>e.popupProps),triggerProps:X(e=>e.triggerProps),triggerElement:X(e=>e.triggerElement),positionerElement:X(e=>e.positionerElement),listElement:X(e=>e.listElement),scrollUpArrowVisible:X(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:X(e=>e.scrollDownArrowVisible),hasScrollArrows:X(e=>e.hasScrollArrows)};function Jv(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,autoComplete:l,disabled:u=!1,readOnly:d=!1,required:f=!1,modal:p=!0,actionsRef:m,inputRef:h,onOpenChangeComplete:g,items:_,multiple:v=!1,itemToStringLabel:y,itemToStringValue:b,isItemEqualToValue:x=jg,highlightItemOnHover:S=!0,children:C}=e,{clearErrors:w}=_h(),{setDirty:T,setTouched:E,setFocused:D,shouldValidateOnChange:O,validityData:k,setFilled:A,name:j,disabled:M,validation:N,validationMode:P}=hh(),F=Mh({id:t}),I=M||u,ee=j??c,[L,R]=jh({controlled:n,default:v?r??rd:r,name:`Select`,state:`value`}),[z,B]=jh({controlled:a,default:o,name:`Select`,state:`open`}),te=H.useRef([]),ne=H.useRef([]),re=H.useRef(null),V=H.useRef(null),ie=H.useRef(0),ae=H.useRef(null),oe=H.useRef([]),se=H.useRef(!1),ce=H.useRef(!1),le=H.useRef(null),ue=H.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),de=H.useRef(!1),{mounted:fe,setMounted:pe,transitionStatus:me}=cp(z),{openMethod:he,triggerProps:ge,reset:_e}=Gg(z),ve=ml(()=>new ip({id:F,modal:p,multiple:v,itemToStringLabel:y,itemToStringValue:b,isItemEqualToValue:x,value:L,open:z,mounted:fe,transitionStatus:me,items:_,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ye=ep(ve,qv.activeIndex),be=ep(ve,qv.selectedIndex),xe=ep(ve,qv.triggerElement),Se=ep(ve,qv.positionerElement),Ce=H.useMemo(()=>v&&Array.isArray(L)&&L.length===0?``:Bg(L,b),[v,L,b]),we=H.useMemo(()=>v&&Array.isArray(L)?L.map(e=>Bg(e,b)):Bg(L,b),[v,L,b]),Te=jl(ve.state.triggerElement);Nh({id:F,commit:N.commit,value:L,controlRef:Te,name:ee,getValue:()=>we});let Ee=H.useRef(L);K(()=>{L!==Ee.current&&ve.set(`forceMount`,!0)},[ve,L]),K(()=>{A(v?Array.isArray(L)&&L.length>0:L!=null)},[v,L,A]),K(function(){if(z)return;let e=oe.current;if(v){let t=Array.isArray(L)?L:[];if(t.length===0){ve.set(`selectedIndex`,null);return}let n=t[t.length-1],r=Pg(e,n,x);ve.set(`selectedIndex`,r===-1?null:r);return}let t=Pg(e,L,x);ve.set(`selectedIndex`,t===-1?null:t)},[v,z,L,oe,x,ve]),Jh(L,()=>{w(ee),T(L!==k.initialValue),O()?N.commit(L):N.commit(L,!0)});let De=q((e,t)=>{if(s?.(e,t),!t.isCanceled&&(B(e),!e&&(t.reason===yd||t.reason===gd)&&(E(!0),D(!1),P===`onBlur`&&N.commit(L)),!e&&ve.state.activeIndex!==null)){let e=te.current[ve.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),Oe=q(()=>{pe(!1),ve.set(`activeIndex`,null),_e(),g?.(!1)});mp({enabled:!m,open:z,ref:re,onComplete(){z||Oe()}}),H.useImperativeHandle(m,()=>({unmount:Oe}),[Oe]);let ke=q((e,t)=>{i?.(e,t),!t.isCanceled&&R(e)}),Ae=q(()=>{let e=ve.state.listElement||re.current;if(!e)return;let t=e.scrollTop,n=e.scrollTop+e.clientHeight,r=t>1,i=n<e.scrollHeight-1;ve.state.scrollUpArrowVisible!==r&&ve.set(`scrollUpArrowVisible`,r),ve.state.scrollDownArrowVisible!==i&&ve.set(`scrollDownArrowVisible`,i)}),je=wp({open:z,onOpenChange:De,elements:{reference:xe,floating:Se}}),{getReferenceProps:Me,getFloatingProps:Ne,getItemProps:Pe}=Bp([Wf(je,{enabled:!d&&!I,event:`mousedown`}),Xf(je,{bubbles:!1}),Yp(je,{enabled:!d&&!I,listRef:te,activeIndex:ye,selectedIndex:be,disabledIndices:rd,onNavigate(e){e===null&&!z||ve.set(`activeIndex`,e)},focusItemOnHover:!1}),Qp(je,{enabled:!d&&!I&&(z||!v),listRef:ne,activeIndex:ye,selectedIndex:be,onMatch(e){z?ve.set(`activeIndex`,e):ke(oe.current[e],Dd(`none`))},onTypingChange(e){se.current=e}})]),Fe=H.useMemo(()=>pf(Me(),ge,F?{id:F}:id),[Me,ge,F]);Sl(()=>{ve.update({popupProps:Ne(),triggerProps:Fe})}),K(()=>{ve.update({id:F,modal:p,multiple:v,value:L,open:z,mounted:fe,transitionStatus:me,popupProps:Ne(),triggerProps:Fe,items:_,itemToStringLabel:y,itemToStringValue:b,isItemEqualToValue:x,openMethod:he})},[ve,F,p,v,L,z,fe,me,Ne,Fe,_,y,b,x,he]);let Ie=H.useMemo(()=>({store:ve,name:ee,required:f,disabled:I,readOnly:d,multiple:v,itemToStringLabel:y,itemToStringValue:b,highlightItemOnHover:S,setValue:ke,setOpen:De,listRef:te,popupRef:re,scrollHandlerRef:V,handleScrollArrowVisibility:Ae,scrollArrowsMountedCountRef:ie,getItemProps:Pe,events:je.context.events,valueRef:ae,valuesRef:oe,labelsRef:ne,typingRef:se,selectionRef:ue,selectedItemTextRef:le,validation:N,onOpenChangeComplete:g,keyboardActiveRef:ce,alignItemWithTriggerActiveRef:de,initialValueRef:Ee}),[ve,ee,f,I,d,v,y,b,S,ke,De,Pe,je.context.events,N,g,Ae]),Le=Nd(h,N.inputRef),Re=v&&Array.isArray(L)&&L.length>0,ze=H.useMemo(()=>!v||!Array.isArray(L)||!ee?null:L.map(e=>{let t=Bg(e,b);return(0,U.jsx)(`input`,{type:`hidden`,name:ee,value:t},t)}),[v,L,ee,b]);return(0,U.jsx)(Uv.Provider,{value:Ie,children:(0,U.jsxs)(Wv.Provider,{value:je,children:[C,(0,U.jsx)(`input`,{...N.getInputValidationProps({onFocus(){ve.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.value,n=Dd(fd,e.nativeEvent);function r(){if(v)return;let e=oe.current.find(e=>Bg(e,b).toLowerCase()===t.toLowerCase());e!=null&&(T(e!==k.initialValue),ke(e,n),O()&&N.commit(e))}ve.set(`forceMount`,!0),queueMicrotask(r)}}),name:v?void 0:ee,autoComplete:l,value:Ce,disabled:I,required:f&&!Re,readOnly:d,ref:Le,style:ee?Vd:Bd,tabIndex:-1,"aria-hidden":!0}),ze]})})}var Yv=2,Xv=400,Zv=200,Qv={...hm,...ph,value:()=>null},$v=H.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{setTouched:c,setFocused:l,validationMode:u,state:d,disabled:f}=hh(),{labelId:p}=yh(),{store:m,setOpen:h,selectionRef:g,validation:_,readOnly:v,required:y,alignItemWithTriggerActiveRef:b,disabled:x,keyboardActiveRef:S}=Gv(),C=f||x||a,w=ep(m,qv.open),T=ep(m,qv.value),E=ep(m,qv.triggerProps),D=ep(m,qv.positionerElement),O=ep(m,qv.listElement),k=ep(m,qv.id),A=ep(m,qv.hasSelectedValue),j=!A&&w,M=ep(m,qv.hasNullItemLabel,j),N=i??k;Mh({id:N});let P=jl(D),F=H.useRef(null),{getButtonProps:I,buttonRef:ee}=Wh({disabled:C,native:o}),L=Nd(t,F,ee,q(e=>{m.set(`triggerElement`,e)})),R=Al(),z=Al(),B=Al(),te=Al();H.useEffect(()=>{if(w)return A||M?te.start(Zv,()=>{g.current.allowUnselectedMouseUp=!0,B.start(Zv,()=>{g.current.allowSelectedMouseUp=!0})}):B.start(Xv,()=>{g.current.allowUnselectedMouseUp=!0,g.current.allowSelectedMouseUp=!0}),()=>{B.clear(),te.clear()};g.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},z.clear()},[w,A,M,g,z,B,te]);let ne=H.useMemo(()=>O?.id??pu(D)?.id,[O,D]),re=pf(E,{id:N,role:`combobox`,"aria-expanded":w?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":w?ne:void 0,"aria-labelledby":p,"aria-readonly":v||void 0,"aria-required":y||void 0,tabIndex:C?-1:0,ref:L,onFocus(e){l(!0),w&&b.current&&h(!1,Dd(fd,e.nativeEvent)),R.start(0,()=>{m.set(`forceMount`,!0)})},onBlur(e){au(D,e.relatedTarget)||(c(!0),l(!1),u===`onBlur`&&_.commit(T))},onPointerMove(){S.current=!1},onKeyDown(){S.current=!0},onMouseDown(e){if(w)return;let t=J(e.currentTarget);function n(e){if(!F.current)return;let t=e.target;if(au(F.current,t)||au(P.current,t)||t===F.current)return;let n=Kg(F.current);e.clientX>=n.left-Yv&&e.clientX<=n.right+Yv&&e.clientY>=n.top-Yv&&e.clientY<=n.bottom+Yv||h(!1,Dd(Sd,e))}z.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},_.getValidationProps,s,I);re.role=`combobox`;let V={...d,open:w,disabled:C,value:T,readOnly:v,placeholder:!A};return Y(`button`,e,{ref:[t,F],state:V,stateAttributesMapping:Qv,props:re})}),ey={value:()=>null},ty=H.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,...o}=e,{store:s,valueRef:c}=Gv(),l=ep(s,qv.value),u=ep(s,qv.items),d=ep(s,qv.itemToStringLabel),f=ep(s,qv.hasSelectedValue),p=!f&&a!=null&&i==null,m=ep(s,qv.hasNullItemLabel,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(!f&&a!=null&&!m?a:Array.isArray(l)?Hg(l,u,d):Vg(l,u,d)),Y(`span`,e,{state:h,ref:[t,c],props:[{children:g},o],stateAttributesMapping:ey})}),ny=H.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a}=Gv();return Y(`span`,e,{state:{open:ep(a,qv.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},i],stateAttributesMapping:mm})}),ry=H.createContext(void 0),iy=H.forwardRef(function(e,t){let{store:n}=Gv(),r=ep(n,qv.mounted),i=ep(n,qv.forceMount);return r||i?(0,U.jsx)(ry.Provider,{value:!0,children:(0,U.jsx)(Mf,{ref:t,...e})}):null}),ay={...gm,...fp},oy=H.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a}=Gv(),o=ep(a,qv.open),s=ep(a,qv.mounted);return Y(`div`,e,{state:{open:o,transitionStatus:ep(a,qv.transitionStatus)},ref:t,props:[{role:`presentation`,hidden:!s,style:{userSelect:`none`,WebkitUserSelect:`none`}},i],stateAttributesMapping:ay})}),sy=H.createContext(void 0);function cy(){let e=H.useContext(sy);if(!e)throw Error(Cl(59));return e}function ly(e,t){e&&Object.assign(e.style,t)}var uy={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},dy={position:`fixed`},fy=H.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=ld,..._}=e,{store:v,listRef:y,labelsRef:b,alignItemWithTriggerActiveRef:x,selectedItemTextRef:S,valuesRef:C,initialValueRef:w,popupRef:T,setValue:E}=Gv(),D=Kv(),O=ep(v,qv.open),k=ep(v,qv.mounted),A=ep(v,qv.modal),j=ep(v,qv.value),M=ep(v,qv.openMethod),N=ep(v,qv.positionerElement),P=ep(v,qv.triggerElement),F=ep(v,qv.isItemEqualToValue),I=ep(v,qv.transitionStatus),ee=H.useRef(null),L=H.useRef(null),[R,z]=H.useState(h),B=k&&R&&M!==`touch`;!k&&R!==h&&z(h),K(()=>{k||(qv.scrollUpArrowVisible(v.state)&&v.set(`scrollUpArrowVisible`,!1),qv.scrollDownArrowVisible(v.state)&&v.set(`scrollDownArrowVisible`,!1))},[v,k]),H.useImperativeHandle(x,()=>B),s_((B||A)&&O&&M!==`touch`,P);let te=Rm({anchor:n,floatingRootContext:D,positionMethod:r,mounted:k,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??B,collisionAvoidance:g,keepMounted:!0}),ne=B?`none`:te.side,re=B?dy:te.positionerStyles,V=H.useMemo(()=>{let e={};return O||(e.pointerEvents=`none`),{role:`presentation`,hidden:!k,style:{...re,...e}}},[O,k,re]),ie={open:O,side:ne,align:te.align,anchorHidden:te.anchorHidden},ae=Y(`div`,e,{ref:[t,q(e=>{v.set(`positionerElement`,e)})],state:ie,stateAttributesMapping:gm,props:[V,Bm(I),_]}),oe=H.useRef(0),se=q(e=>{if(e.size===0&&oe.current===0||C.current.length===0)return;let t=oe.current;if(oe.current=e.size,e.size===t)return;let n=Dd(fd);if(t!==0&&!v.state.multiple&&j!==null&&Pg(C.current,j,F)===-1){let e=w.current,t=e!=null&&Pg(C.current,e,F)!==-1?e:null;E(t,n),t===null&&(v.set(`selectedIndex`,null),S.current=null)}if(t!==0&&v.state.multiple&&Array.isArray(j)){let e=e=>Pg(C.current,e,F)!==-1,t=j.filter(t=>e(t));(t.length!==j.length||t.some(e=>!Ng(j,e,F)))&&(E(t,n),t.length===0&&(v.set(`selectedIndex`,null),S.current=null))}if(O&&B){v.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};ly(N,e),ly(T.current,e)}}),ce=H.useMemo(()=>({...te,side:ne,alignItemWithTriggerActive:B,setControlledAlignItemWithTrigger:z,scrollUpArrowRef:ee,scrollDownArrowRef:L}),[te,ne,B,z]);return(0,U.jsx)(Yg,{elementsRef:y,labelsRef:b,onMapChange:se,children:(0,U.jsxs)(sy.Provider,{value:ce,children:[k&&A&&(0,U.jsx)(c_,{inert:Km(!O),cutout:P}),ae]})})});function py(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}var my=`base-ui-disable-scrollbar`,hy={className:my,getElement(e){return(0,U.jsx)(`style`,{nonce:e,href:my,precedence:`base-ui:low`,children:`.${my}{scrollbar-width:none}.${my}::-webkit-scrollbar{display:none}`})}};function gy(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var _y=H.createContext(void 0),vy={disableStyleElements:!1};function yy(){return H.useContext(_y)??vy}var by=1,xy={...gm,...fp},Sy=H.forwardRef(function(e,t){let{render:n,className:r,finalFocus:i,...a}=e,{store:o,popupRef:s,onOpenChangeComplete:c,setOpen:l,valueRef:u,selectedItemTextRef:d,keyboardActiveRef:f,multiple:p,handleScrollArrowVisibility:m,scrollHandlerRef:h,highlightItemOnHover:g}=Gv(),{side:_,align:v,alignItemWithTriggerActive:y,setControlledAlignItemWithTrigger:b,scrollDownArrowRef:x,scrollUpArrowRef:S}=cy(),C=dv(!0)!=null,w=Kv(),{nonce:T,disableStyleElements:E}=yy(),D=Al(),O=ep(o,qv.id),k=ep(o,qv.open),A=ep(o,qv.mounted),j=ep(o,qv.popupProps),M=ep(o,qv.transitionStatus),N=ep(o,qv.triggerElement),P=ep(o,qv.positionerElement),F=ep(o,qv.listElement),I=H.useRef(0),ee=H.useRef(!1),L=H.useRef(0),R=H.useRef(!1),z=H.useRef({}),B=Gd(),te=q(e=>{if(!P||!s.current||!R.current)return;if(ee.current||!y){m();return}let t=P.style.top===`0px`,n=P.style.bottom===`0px`,r=P.getBoundingClientRect().height,i=J(P),a=getComputedStyle(P),o=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),l=Cy(getComputedStyle(s.current)),u=Math.min(i.documentElement.clientHeight-o-c,l),d=e.scrollTop,f=wy(e),p=0,h=null,g=!1,_=!1,v=e=>{P.style.height=`${e}px`},b=(t,n)=>{let i=gy(t,0,u-r);i>0&&v(r+i),e.scrollTop=n,u-(r+i)<=by&&(ee.current=!0),m()};if(t){let e=f-d,t=r+e,n=Math.min(t,u);if(p=n,e<=by){b(e,f);return}u-n>by?_=!0:g=!0}else if(n){let e=d,t=r+e,n=Math.min(t,u),i=t-u;if(p=n,e<=by){b(e,0);return}u-n>by?h=0:(g=!0,d<f&&(h=d-(e-i)))}if(p=Math.ceil(p),p!==0&&v(p),_||h!=null){let t=wy(e),n=_?t:gy(h,0,t);Math.abs(e.scrollTop-n)>by&&(e.scrollTop=n)}(g||p>=u-by)&&(ee.current=!0),m()});H.useImperativeHandle(h,()=>te,[te]),mp({open:k,ref:s,onComplete(){k&&c?.(!0)}});let ne={open:k,transitionStatus:M,side:_,align:v};K(()=>{!P||!s.current||Object.keys(z.current).length||(z.current={top:P.style.top||`0`,left:P.style.left||`0`,right:P.style.right,height:P.style.height,bottom:P.style.bottom,minHeight:P.style.minHeight,maxHeight:P.style.maxHeight,marginTop:P.style.marginTop,marginBottom:P.style.marginBottom})},[s,P]),K(()=>{k||y||(R.current=!1,ee.current=!1,I.current=0,L.current=0,ly(P,z.current))},[k,y,P,s]),K(()=>{let e=s.current;if(!(!k||!N||!P||!e||o.state.transitionStatus===`ending`)){if(!y){R.current=!0,B.request(m),e.style.removeProperty(`--transform-origin`);return}queueMicrotask(()=>{let t=Ey(e);e.style.removeProperty(`--transform-origin`);try{let t=getComputedStyle(P),n=getComputedStyle(e),r=J(N),i=Wa(P),a=N.getBoundingClientRect(),o=P.getBoundingClientRect(),s=a.left,c=a.height,l=F||e,f=l.scrollHeight,p=parseFloat(n.borderBottomWidth),h=parseFloat(t.marginTop)||10,g=parseFloat(t.marginBottom)||10,_=parseFloat(t.minHeight)||100,v=Cy(n),y=r.documentElement.clientHeight-h-g,x=r.documentElement.clientWidth,S=y-a.bottom+c,C=d.current,w=u.current,T,E=0,D=0;if(C&&w){let e=w.getBoundingClientRect();T=C.getBoundingClientRect();let t=e.left-s,n=T.left-o.left,r=e.top-a.top+e.height/2,i=T.top-o.top+T.height/2;E=t-n,D=i-r}let O=S+D+g+p,k=Math.min(y,O),A=y-h-g,j=O-k,M=Math.max(5,s+E),L=x-5,B=Math.max(0,M+o.width-L);P.style.left=`${M-B}px`,P.style.height=`${k}px`,P.style.maxHeight=`auto`,P.style.marginTop=`${h}px`,P.style.marginBottom=`${g}px`,e.style.height=`100%`;let te=l.scrollHeight-l.clientHeight,ne=j>=te;ne&&(k=Math.min(y,o.height)-(j-te));let re=a.top<20||a.bottom>y-20||k<Math.min(f,_),V=(i.visualViewport?.scale??1)!==1&&Vl;if(re||V){R.current=!0,ly(P,z.current),Wn.flushSync(()=>b(!1));return}if(ne){let e=Math.max(0,y-O);P.style.top=o.height>=A?`0`:`${e}px`,P.style.height=`${k}px`,l.scrollTop=l.scrollHeight-l.clientHeight,I.current=Math.max(_,k)}else P.style.bottom=`0`,I.current=Math.max(_,k),l.scrollTop=j;if(T){let t=o.top,n=o.height,r=T.top+T.height/2,i=gy(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(I.current===y||k>=v)&&(ee.current=!0),m(),setTimeout(()=>{R.current=!0})}finally{t()}})}},[o,k,P,N,u,d,s,m,y,b,B,x,S,F]),H.useEffect(()=>{if(!y||!P||!k)return;let e=Wa(P);function t(e){l(!1,Dd(Ed,e))}return e.addEventListener(`resize`,t),()=>{e.removeEventListener(`resize`,t)}},[l,y,P,k]);let re={...F?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":p||void 0,id:`${O}-list`},onKeyDown(e){f.current=!0,C&&A_.has(e.key)&&e.stopPropagation()},onMouseMove(){f.current=!1},onPointerLeave(e){if(!g||py(e)||e.pointerType===`touch`)return;let t=e.currentTarget;D.start(0,()=>{o.set(`activeIndex`,null),t.focus({preventScroll:!0})})},onScroll(e){F||te(e.currentTarget)},...y&&{style:F?{height:`100%`}:uy}},V=Y(`div`,e,{ref:[t,s],state:ne,stateAttributesMapping:xy,props:[j,re,Bm(M),{className:!F&&y?hy.className:void 0},a]});return(0,U.jsxs)(H.Fragment,{children:[!E&&hy.getElement(T),(0,U.jsx)(Uf,{context:w,modal:!1,disabled:!A,returnFocus:i,restoreFocus:!0,children:V})]})});function Cy(e){let t=e.maxHeight||``;return t.endsWith(`px`)&&parseFloat(t)||1/0}function wy(e){return Math.max(0,e.scrollHeight-e.clientHeight)}var Ty=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function Ey(e){let{style:t}=e,n={};for(let[e,r]of Ty)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Ty){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var Dy=H.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a,scrollHandlerRef:o}=Gv(),{alignItemWithTriggerActive:s}=cy(),c=ep(a,qv.hasScrollArrows),l=ep(a,qv.openMethod),u=ep(a,qv.multiple),d={id:`${ep(a,qv.id)}-list`,role:`listbox`,"aria-multiselectable":u||void 0,onScroll(e){o.current?.(e.currentTarget)},...s&&{style:uy},className:c&&l!==`touch`?hy.className:void 0};return Y(`div`,e,{ref:[t,q(e=>{a.set(`listElement`,e)})],props:[d,i]})}),Oy=H.createContext(void 0);function ky(){let e=H.useContext(Oy);if(!e)throw Error(Cl(57));return e}var Ay=H.memo(H.forwardRef(function(e,t){let{render:n,className:r,value:i=null,label:a,disabled:o=!1,nativeButton:s=!1,...c}=e,l=H.useRef(null),u=u_({label:a,textRef:l,indexGuessBehavior:l_.GuessFromOrder}),{store:d,getItemProps:f,setOpen:p,setValue:m,selectionRef:h,typingRef:g,valuesRef:_,keyboardActiveRef:v,multiple:y,highlightItemOnHover:b}=Gv(),x=Al(),S=ep(d,qv.isActive,u.index),C=ep(d,qv.isSelected,u.index,i),w=ep(d,qv.isSelectedByFocus,u.index),T=ep(d,qv.isItemEqualToValue),E=u.index,D=E!==-1,O=H.useRef(null),k=jl(E);K(()=>{if(!D)return;let e=_.current;return e[E]=i,()=>{delete e[E]}},[D,E,i,_]),K(()=>{if(!D)return;let e=d.state.value,t=e;y&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&Mg(i,t,T)&&d.set(`selectedIndex`,E)},[D,E,y,T,d,i]);let A={disabled:o,selected:C,highlighted:S},j=f({active:S,selected:C});j.onFocus=void 0,j.id=void 0;let M=H.useRef(null),N=H.useRef(`mouse`),P=H.useRef(!1),{getButtonProps:F,buttonRef:I}=Wh({disabled:o,focusableWhenDisabled:!0,native:s});function ee(e){let t=d.state.value;if(y){let n=Array.isArray(t)?t:[];m(C?Fg(n,i,T):[...n,i],Dd(_d,e))}else m(i,Dd(_d,e)),p(!1,Dd(_d,e))}let L={role:`option`,"aria-selected":C,tabIndex:S?0:-1,onFocus(){d.set(`activeIndex`,E)},onMouseEnter(){!v.current&&d.state.selectedIndex===null&&b&&d.set(`activeIndex`,E)},onMouseMove(){b&&d.set(`activeIndex`,E)},onMouseLeave(e){!b||v.current||py(e)||x.start(0,()=>{d.state.activeIndex===E&&d.set(`activeIndex`,null)})},onTouchStart(){h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){M.current=e.key,d.set(`activeIndex`,E)},onClick(e){P.current=!1,!(e.type===`keydown`&&M.current===null)&&(o||M.current===` `&&g.current||N.current!==`touch`&&!S||(M.current=null,ee(e.nativeEvent)))},onPointerEnter(e){N.current=e.pointerType},onPointerDown(e){N.current=e.pointerType,P.current=!0},onMouseUp(e){if(o)return;if(P.current){P.current=!1;return}let t=!h.current.allowSelectedMouseUp&&C,n=!h.current.allowUnselectedMouseUp&&!C;t||n||N.current!==`touch`&&!S||ee(e.nativeEvent)}},R=Y(`div`,e,{ref:[I,t,u.ref,O],state:A,props:[j,L,c,F]}),z=H.useMemo(()=>({selected:C,indexRef:k,textRef:l,selectedByFocus:w,hasRegistered:D}),[C,k,l,w,D]);return(0,U.jsx)(Oy.Provider,{value:z,children:R})})),jy=H.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=ky();return n||r?(0,U.jsx)(My,{...e,ref:t}):null}),My=H.memo(H.forwardRef((e,t)=>{let{render:n,className:r,keepMounted:i,...a}=e,{selected:o}=ky(),s=H.useRef(null),{transitionStatus:c,setMounted:l}=cp(o),u=Y(`span`,e,{ref:[t,s],state:{selected:o,transitionStatus:c},props:[{"aria-hidden":!0,children:`✔️`},a],stateAttributesMapping:fp});return mp({open:o,ref:s,onComplete(){o||l(!1)}}),u})),Ny=H.memo(H.forwardRef(function(e,t){let{indexRef:n,textRef:r,selectedByFocus:i,hasRegistered:a}=ky(),{selectedItemTextRef:o}=Gv(),{className:s,render:c,...l}=e;return Y(`div`,e,{ref:[H.useCallback(e=>{if(!e||!a)return;let t=o.current===null||!o.current.isConnected;(i||t&&n.current===0)&&(o.current=e)},[o,n,i,a]),t,r],props:l})})),Py={...gm,...fp},Fy=H.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a}=Gv(),{side:o,align:s,arrowRef:c,arrowStyles:l,arrowUncentered:u,alignItemWithTriggerActive:d}=cy(),f=Y(`div`,e,{state:{open:ep(a,qv.open,!0),side:o,align:s,uncentered:u},ref:[c,t],props:[{style:l,"aria-hidden":!0},i],stateAttributesMapping:Py});return d?null:f}),Iy=H.forwardRef(function(e,t){let{render:n,className:r,direction:i,keepMounted:a=!1,...o}=e,{store:s,popupRef:c,listRef:l,handleScrollArrowVisibility:u,scrollArrowsMountedCountRef:d}=Gv(),{side:f,scrollDownArrowRef:p,scrollUpArrowRef:m}=cy(),h=ep(s,i===`up`?qv.scrollUpArrowVisible:qv.scrollDownArrowVisible),g=ep(s,qv.openMethod),_=h&&g!==`touch`,v=Al(),y=i===`up`?m:p,{transitionStatus:b,setMounted:x}=cp(_);K(()=>(d.current+=1,s.state.hasScrollArrows||s.set(`hasScrollArrows`,!0),()=>{d.current=Math.max(0,d.current-1),d.current===0&&s.state.hasScrollArrows&&s.set(`hasScrollArrows`,!1)}),[s,d]),mp({open:_,ref:y,onComplete(){_||x(!1)}});let S=Y(`div`,e,{ref:[t,y],state:{direction:i,visible:_,side:f,transitionStatus:b},props:[{"aria-hidden":!0,children:i===`up`?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||v.isStarted())return;s.set(`activeIndex`,null);function t(){let e=s.state.listElement??c.current;if(!e)return;s.set(`activeIndex`,null),u();let n=e.scrollTop===0,r=Math.round(e.scrollTop+e.clientHeight)>=e.scrollHeight;if(l.current.length===0&&(i===`up`?s.set(`scrollUpArrowVisible`,!n):s.set(`scrollDownArrowVisible`,!r)),i===`up`&&n||i===`down`&&r){v.clear();return}if((s.state.listElement||c.current)&&l.current&&l.current.length>0){let t=l.current,n=y.current?.offsetHeight||0;if(i===`up`){let r=0,i=e.scrollTop+n;for(let e=0;e<t.length;e+=1){let n=t[e];if(n&&n.offsetTop>=i){r=e;break}}let a=Math.max(0,r-1);if(a<r){let r=t[a];r&&(e.scrollTop=Math.max(0,r.offsetTop-n))}else e.scrollTop=0}else{let r=t.length-1,i=e.scrollTop+e.clientHeight-n;for(let e=0;e<t.length;e+=1){let n=t[e];if(n&&n.offsetTop+n.offsetHeight>i){r=Math.max(0,e-1);break}}let a=Math.min(t.length-1,r+1);if(a>r){let r=t[a];r&&(e.scrollTop=r.offsetTop+r.offsetHeight-e.clientHeight+n)}else e.scrollTop=e.scrollHeight-e.clientHeight}}v.start(40,t)}v.start(40,t)},onMouseLeave(){v.clear()}},o]});return _||a?S:null}),Ly=H.forwardRef(function(e,t){return(0,U.jsx)(Iy,{...e,ref:t,direction:`down`})}),Ry=H.forwardRef(function(e,t){return(0,U.jsx)(Iy,{...e,ref:t,direction:`up`})}),zy=H.createContext(void 0);function By(){let e=H.useContext(zy);if(e===void 0)throw Error(Cl(56));return e}var Vy=H.forwardRef(function(e,t){let{className:n,render:r,...i}=e,[a,o]=H.useState(),s=H.useMemo(()=>({labelId:a,setLabelId:o}),[a,o]),c=Y(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":a},i]});return(0,U.jsx)(zy.Provider,{value:s,children:c})}),Hy=H.forwardRef(function(e,t){let{className:n,render:r,id:i,...a}=e,{setLabelId:o}=By(),s=_m(i);return K(()=>{o(s)},[s,o]),Y(`div`,e,{ref:t,props:[{id:s},a]})}),Uy=Object.freeze(Object.defineProperty({__proto__:null,Arrow:Fy,Backdrop:oy,Group:Vy,GroupLabel:Hy,Icon:ny,Item:Ay,ItemIndicator:jy,ItemText:Ny,List:Dy,Popup:Sy,Portal:iy,Positioner:fy,Root:Jv,ScrollDownArrow:Ly,ScrollUpArrow:Ry,Separator:d_,Trigger:$v,Value:ty},Symbol.toStringTag,{value:`Module`})),Wy=H.createContext(void 0),Gy=(function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e})({}),Ky={...ph,checked(e){return e?{[Gy.checked]:``}:{[Gy.unchecked]:``}}},qy=H.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,id:a,inputRef:o,name:s,nativeButton:c=!1,onCheckedChange:l,readOnly:u=!1,required:d=!1,disabled:f=!1,render:p,uncheckedValue:m,value:h,...g}=e,{clearErrors:_}=_h(),{state:v,setTouched:y,setDirty:b,validityData:x,setFilled:S,setFocused:C,shouldValidateOnChange:w,validationMode:T,disabled:E,name:D,validation:O}=hh(),{labelId:k}=yh(),A=E||f,j=D??s,M=q(l),N=H.useRef(null),P=Nd(N,o,O.inputRef),F=H.useRef(null),I=_m(),ee=Mh({id:a,implicit:!1,controlRef:F}),L=c?void 0:ee,[R,z]=jh({controlled:n,default:!!i,name:`Switch`,state:`checked`});Nh({id:I,commit:O.commit,value:R,controlRef:F,name:j,getValue:()=>R}),K(()=>{N.current&&S(N.current.checked)},[N,S]),Jh(R,()=>{_(j),b(R!==x.initialValue),S(R),w()?O.commit(R):O.commit(R,!0)});let{getButtonProps:B,buttonRef:te}=Wh({disabled:A,native:c}),ne={id:c?ee:I,role:`switch`,"aria-checked":R,"aria-readonly":u||void 0,"aria-required":d||void 0,"aria-labelledby":k,onFocus(){A||C(!0)},onBlur(){let e=N.current;!e||A||(y(!0),C(!1),T===`onBlur`&&O.commit(e.checked))},onClick(e){u||A||(e.preventDefault(),N.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},re=H.useMemo(()=>pf({checked:R,disabled:A,id:L,name:j,required:d,style:j?Vd:Bd,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:P,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=Dd(fd,e.nativeEvent);M?.(t,n),!n.isCanceled&&z(t)},onFocus(){F.current?.focus()}},O.getInputValidationProps,h===void 0?id:{value:h}),[R,A,P,L,j,M,d,z,O,h]),V=H.useMemo(()=>({...v,checked:R,disabled:A,readOnly:u,required:d}),[v,R,A,u,d]),ie=Y(`span`,e,{state:V,ref:[t,F,te],props:[ne,O.getValidationProps,g,B],stateAttributesMapping:Ky});return(0,U.jsxs)(Wy.Provider,{value:V,children:[ie,!R&&j&&m!==void 0&&(0,U.jsx)(`input`,{type:`hidden`,name:j,value:m}),(0,U.jsx)(`input`,{...re})]})}),Jy=(function(e){return e.activationDirection=`data-activation-direction`,e.orientation=`data-orientation`,e})({}),Yy={tabActivationDirection:e=>({[Jy.activationDirection]:e})};({...Yy}),{...Yy,...fp};var Xy=H.createContext(void 0);function Zy(e){let t=H.useContext(Xy);if(t===void 0&&!e)throw Error(Cl(47));return t}function Qy(){return{...xp(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var $y={...Cp,disabled:X(e=>e.disabled),instantType:X(e=>e.instantType),openMethod:X(e=>e.openMethod),openChangeReason:X(e=>e.openChangeReason),modal:X(e=>e.modal),stickIfOpen:X(e=>e.stickIfOpen),titleElementId:X(e=>e.titleElementId),descriptionElementId:X(e=>e.descriptionElementId),openOnHover:X(e=>e.openOnHover),closeDelay:X(e=>e.closeDelay),hasViewport:X(e=>e.hasViewport)},eb=class e extends ap{constructor(e){let t={...Qy(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:H.createRef(),backdropRef:H.createRef(),internalBackdropRef:H.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:H.createRef(),beforeContentFocusGuardRef:H.createRef(),stickIfOpenTimeout:new kl,triggerElements:new yp},$y)}setOpen=(e,t)=>{let n=t.reason===md,r=t.reason===pd&&t.event.detail===0,i=!e&&(t.reason===bd||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let a={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger};this.state.floatingRootContext.context.events?.emit(`openchange`,a);let o=()=>{let n={open:e,openChangeReason:t.reason},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(od,()=>{this.set(`stickIfOpen`,!1)}),Wn.flushSync(o)):o(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===yd?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let r=ml(()=>new e(n)).current,i=t??r;return Dl(r.disposeEffect),i}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function tb({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=eb.useStore(s?.store,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});Sl(()=>{n===void 0&&u.state.open===!1&&r===!0&&u.update({open:!0,activeTriggerId:l})}),u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`positionerElement`),p=u.useState(`payload`),m=u.useState(`openChangeReason`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a);let{openMethod:h,triggerProps:g,reset:_}=Gg(d);_p(u);let{forceUnmount:v}=vp(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null}),_()});s_(d&&o===!0&&m!==md&&h!==`touch`,f),H.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let y=H.useCallback(e=>{let t=Dd(e);return t.preventUnmountOnClose=()=>{u.set(`preventUnmountingOnClose`,!0)},t},[u]),b=H.useCallback(()=>{u.setOpen(!1,y(Td))},[u,y]);H.useImperativeHandle(e.actionsRef,()=>({unmount:v,close:b}),[v,b]);let x=Ep({popupStore:u,onOpenChange:u.setOpen}),{getReferenceProps:S,getFloatingProps:C,getTriggerProps:w}=Bp([Xf(x,{outsidePressEvent:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),Zp(x)]),T=H.useMemo(()=>S(g),[S,g]),E=H.useMemo(()=>w(g),[w,g]),D=H.useMemo(()=>C(),[C]);u.useSyncedValues({modal:o,openMethod:h,activeTriggerProps:T,inactiveTriggerProps:E,popupProps:D,floatingRootContext:x,nested:Zu()!=null});let O=H.useMemo(()=>({store:u}),[u]);return(0,U.jsx)(Xy.Provider,{value:O,children:typeof t==`function`?t({payload:p}):t})}function nb(e){return Zy(!0)?(0,U.jsx)(tb,{props:e}):(0,U.jsx)(td,{children:(0,U.jsx)(tb,{props:e})})}var rb=300,ib=H.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,handle:o,payload:s,openOnHover:c=!1,delay:l=rb,closeDelay:u=0,id:d,...f}=e,p=Zy(!0),m=o?.store??p?.store;if(!m)throw Error(Cl(74));let h=_m(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`floatingRootContext`),v=m.useState(`isOpenedByTrigger`,h),y=H.useRef(null),{registerTrigger:b,isMountedByThisTrigger:x}=gp(h,y,m,{payload:s,disabled:i,openOnHover:c,closeDelay:u}),S=m.useState(`openChangeReason`),C=m.useState(`stickIfOpen`),w=m.useState(`openMethod`),T=zp(_,{enabled:_!=null&&c&&(w!==`touch`||S!==pd),mouseOnly:!0,move:!1,handleClose:tm(),restMs:l,delay:{close:u},triggerElementRef:y,isActiveTrigger:g}),E=Bp([Wf(_,{enabled:_!=null,stickIfOpen:C})]),D=m.useState(`triggerProps`,x),O={disabled:i,open:v},{getButtonProps:k,buttonRef:A}=Wh({disabled:i,native:a}),j=H.useMemo(()=>({open(e){return e&&S===pd?hm.open(e):mm.open(e)}}),[S]),M=Y(`button`,e,{state:O,ref:[A,t,b,y],props:[E.getReferenceProps(),T,D,{[cd]:``,id:h},f,k],stateAttributesMapping:j}),N=H.useRef(null),P=q(e=>{Wn.flushSync(()=>{m.setOpen(!1,Dd(yd,e.nativeEvent,e.currentTarget))}),Ru(N.current)?.focus()}),F=q(e=>{let t=m.select(`positionerElement`);if(t&&zu(e,t))m.context.beforeContentFocusGuardRef.current?.focus();else{Wn.flushSync(()=>{m.setOpen(!1,Dd(yd,e.nativeEvent,e.currentTarget))});let n=Lu(m.context.triggerFocusTargetRef.current||y.current);for(;n!==null&&au(t,n);){let e=n;if(n=Pu(n),n===e)break}n?.focus()}});return g?(0,U.jsxs)(H.Fragment,{children:[(0,U.jsx)(Kd,{ref:N,onFocus:P}),(0,U.jsx)(H.Fragment,{children:M},h),(0,U.jsx)(Kd,{ref:m.context.triggerFocusTargetRef,onFocus:F})]}):(0,U.jsx)(H.Fragment,{children:M},h)}),ab=H.createContext(void 0);function ob(){let e=H.useContext(ab);if(e===void 0)throw Error(Cl(45));return e}var sb=H.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Zy();return i.useState(`mounted`)||n?(0,U.jsx)(ab.Provider,{value:n,children:(0,U.jsx)(Mf,{ref:t,...r})}):null}),cb=H.createContext(void 0);function lb(){let e=H.useContext(cb);if(!e)throw Error(Cl(46));return e}var ub=H.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=ud,...g}=e,{store:_}=Zy(),v=ob(),y=$u(),b=_.useState(`floatingRootContext`),x=_.useState(`mounted`),S=_.useState(`open`),C=_.useState(`openChangeReason`),w=_.useState(`activeTriggerElement`),T=_.useState(`modal`),E=_.useState(`positionerElement`),D=_.useState(`instantType`),O=_.useState(`transitionStatus`),k=_.useState(`hasViewport`),A=H.useRef(null),j=pp(E,!1,!1),M=Rm({anchor:i,floatingRootContext:b,positionMethod:a,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:v,nodeId:y,collisionAvoidance:h,adaptiveOrigin:k?Fm:void 0}),N=H.useMemo(()=>{let e={};return S||(e.pointerEvents=`none`),{role:`presentation`,hidden:!x,style:{...M.positionerStyles,...e}}},[S,x,M.positionerStyles]),P=H.useMemo(()=>({props:N,...M}),[N,M]),F=b.useState(`domReferenceElement`);K(()=>{let e=F,t=A.current;if(e&&(A.current=e),t&&e&&e!==t){_.set(`instantType`,void 0);let e=new AbortController;return j(()=>{_.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[F,j,_]);let I={open:S,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:D},ee=H.useCallback(e=>{_.set(`positionerElement`,e)},[_]),L=Y(`div`,e,{state:I,props:[P.props,Bm(O),g],ref:[t,ee],stateAttributesMapping:gm});return(0,U.jsxs)(cb.Provider,{value:P,children:[x&&T===!0&&C!==md&&(0,U.jsx)(c_,{ref:_.context.internalBackdropRef,inert:Km(!S),cutout:w}),(0,U.jsx)(ed,{id:y,children:L})]})}),db={...gm,...fp},fb=H.forwardRef(function(e,t){let{className:n,render:r,initialFocus:i,finalFocus:a,...o}=e,{store:s}=Zy(),c=lb(),l=dv(!0)!=null,u=s.useState(`open`),d=s.useState(`openMethod`),f=s.useState(`instantType`),p=s.useState(`transitionStatus`),m=s.useState(`popupProps`),h=s.useState(`titleElementId`),g=s.useState(`descriptionElementId`),_=s.useState(`modal`),v=s.useState(`mounted`),y=s.useState(`openChangeReason`),b=s.useState(`activeTriggerElement`),x=s.useState(`floatingRootContext`);mp({open:u,ref:s.context.popupRef,onComplete(){u&&s.context.onOpenChangeComplete?.(!0)}});let S=s.useState(`disabled`),C=s.useState(`openOnHover`),w=s.useState(`closeDelay`);Fp(x,{enabled:C&&!S,closeDelay:w});function T(e){return e===`touch`?s.context.popupRef.current:!0}let E=i===void 0?T:i,D={open:u,side:c.side,align:c.align,instant:f,transitionStatus:p},O=H.useCallback(e=>{s.set(`popupElement`,e)},[s]),k=Y(`div`,e,{state:D,ref:[t,s.context.popupRef,O],props:[m,{"aria-labelledby":h,"aria-describedby":g,onKeyDown(e){l&&A_.has(e.key)&&e.stopPropagation()}},Bm(p),o],stateAttributesMapping:db});return(0,U.jsx)(Uf,{context:x,openInteractionType:d,modal:_===`trap-focus`,disabled:!v||y===md,initialFocus:E,returnFocus:a,restoreFocus:`popup`,previousFocusableElement:Ja(b)?b:void 0,nextFocusableElement:s.context.triggerFocusTargetRef,beforeContentFocusGuardRef:s.context.beforeContentFocusGuardRef,children:k})}),pb=H.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a}=Zy(),o=a.useState(`open`),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=lb();return Y(`div`,e,{state:{open:o,side:c,align:l,uncentered:u},ref:[t,s],props:[{style:d,"aria-hidden":!0},i],stateAttributesMapping:gm})}),mb={...gm,...fp},hb=H.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a}=Zy(),o=a.useState(`open`),s=a.useState(`mounted`),c=a.useState(`transitionStatus`),l=a.useState(`openChangeReason`);return Y(`div`,e,{state:{open:o,transitionStatus:c},ref:[a.context.backdropRef,t],props:[{role:`presentation`,hidden:!s,style:{pointerEvents:l===md?`none`:void 0,userSelect:`none`,WebkitUserSelect:`none`}},i],stateAttributesMapping:mb})}),gb=H.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{store:a}=Zy(),o=_m(i.id);return K(()=>(a.set(`titleElementId`,o),()=>{a.set(`titleElementId`,void 0)}),[a,o]),Y(`h2`,e,{ref:t,props:[{id:o},i]})}),_b=H.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{store:a}=Zy(),o=_m(i.id);return K(()=>(a.set(`descriptionElementId`,o),()=>{a.set(`descriptionElementId`,void 0)}),[a,o]),Y(`p`,e,{ref:t,props:[{id:o},i]})}),vb=H.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,...o}=e,{buttonRef:s,getButtonProps:c}=Wh({disabled:i,focusableWhenDisabled:!1,native:a}),{store:l}=Zy();return Y(`button`,e,{ref:[t,s],props:[{onClick(e){l.setOpen(!1,Dd(vd,e.nativeEvent,e.currentTarget))}},o,c]})}),yb=(function(e){return e.popupWidth=`--popup-width`,e.popupHeight=`--popup-height`,e})({}),bb={activationDirection:e=>e?{"data-activation-direction":e}:null},xb=H.forwardRef(function(e,t){let{render:n,className:r,children:i,...a}=e,{store:o}=Zy(),{side:s}=lb(),c=o.useState(`instantType`),{children:l,state:u}=nh({store:o,side:s,cssVars:yb,children:i});return Y(`div`,e,{state:{activationDirection:u.activationDirection,transitioning:u.transitioning,instant:c},ref:t,props:[a,{children:l}],stateAttributesMapping:bb})}),Sb=class{constructor(){this.store=new eb}open(e){let t=e?this.store.context.triggerElements.getById(e)??void 0:void 0;if(e&&!t)throw Error(Cl(80,e));this.store.setOpen(!0,Dd(Td,void 0,t))}close(){this.store.setOpen(!1,Dd(Td,void 0,void 0))}get isOpen(){return this.store.state.open}};function Cb(){return new Sb}var wb=Object.freeze(Object.defineProperty({__proto__:null,Arrow:pb,Backdrop:hb,Close:vb,Description:_b,Handle:Sb,Popup:fb,Portal:sb,Positioner:ub,Root:nb,Title:gb,Trigger:ib,Viewport:xb,createHandle:Cb},Symbol.toStringTag,{value:`Module`}));({...fp,...ph});function Tb(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,a=t!==void 0,[o,s]=jh({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:c,setMounted:l,transitionStatus:u}=cp(o,!0,!0),[d,f]=H.useState(o),[{height:p,width:m},h]=H.useState({height:void 0,width:void 0}),g=_m(),[_,v]=H.useState(),y=_??g,[b,x]=H.useState(!1),[S,C]=H.useState(!1),w=H.useRef(null),T=H.useRef(null),E=H.useRef(null),D=H.useRef(null),O=pp(D,!1),k=q(e=>{let t=!o,n=Dd(pd,e.nativeEvent);if(r(t,n),n.isCanceled)return;let i=D.current;T.current===`css-animation`&&i!=null&&i.style.removeProperty(`animation-name`),!b&&!S&&(T.current!=null&&T.current!==`css-animation`&&!c&&t&&l(!0),T.current===`css-animation`&&(!d&&t&&f(!0),!c&&t&&l(!0))),s(t),T.current===`none`&&c&&!t&&l(!1)});return K(()=>{a&&T.current===`none`&&!S&&!o&&l(!1)},[a,S,o,t,l]),H.useMemo(()=>({abortControllerRef:w,animationTypeRef:T,disabled:i,handleTrigger:k,height:p,mounted:c,open:o,panelId:y,panelRef:D,runOnceAnimationsFinish:O,setDimensions:h,setHiddenUntilFound:x,setKeepMounted:C,setMounted:l,setOpen:s,setPanelIdState:v,setVisible:f,transitionDimensionRef:E,transitionStatus:u,visible:d,width:m}),[w,T,i,k,p,c,o,y,D,O,h,x,C,l,s,f,E,u,d,m])}var Eb=H.createContext(void 0);function Db(){let e=H.useContext(Eb);if(e===void 0)throw Error(Cl(15));return e}var Ob=(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=lp.startingStyle]=`startingStyle`,e[e.endingStyle=lp.endingStyle]=`endingStyle`,e})({}),kb=(function(e){return e.panelOpen=`data-panel-open`,e})({}),Ab={[Ob.open]:``},jb={[Ob.closed]:``},Mb={open(e){return e?{[kb.panelOpen]:``}:null}},Nb={open(e){return e?Ab:jb}},Pb={...Nb,...fp},Fb=H.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,...c}=e,l=q(o),u=Tb({open:s,defaultOpen:i,onOpenChange:l,disabled:a}),d=H.useMemo(()=>({open:u.open,disabled:u.disabled,transitionStatus:u.transitionStatus}),[u.open,u.disabled,u.transitionStatus]),f=H.useMemo(()=>({...u,onOpenChange:l,state:d}),[u,l,d]),p=Y(`div`,e,{state:d,ref:t,props:c,stateAttributesMapping:Pb});return(0,U.jsx)(Eb.Provider,{value:f,children:p})}),Ib={...Mb,...fp},Lb=H.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=Db(),{className:s,disabled:c=o,id:l,render:u,nativeButton:d=!0,...f}=e,{getButtonProps:p,buttonRef:m}=Wh({disabled:c,focusableWhenDisabled:!0,native:d}),h=H.useMemo(()=>({"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i}),[n,r,i]);return Y(`button`,e,{state:a,ref:[t,m],props:[h,f,p],stateAttributesMapping:Ib})}),Rb=(function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e})({});function zb(e){let{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:i,hiddenUntilFound:a,keepMounted:o,id:s,mounted:c,onOpenChange:l,open:u,panelRef:d,runOnceAnimationsFinish:f,setDimensions:p,setMounted:m,setOpen:h,setVisible:g,transitionDimensionRef:_,visible:v,width:y}=e,b=H.useRef(!1),x=H.useRef(null),S=H.useRef(u),C=H.useRef(u),w=Gd(),T=H.useMemo(()=>n.current===`css-animation`?!v:!u&&!c,[u,c,v,n]),E=Nd(r,d,q(e=>{if(!e)return;if(n.current==null||_.current==null){let t=getComputedStyle(e),r=t.animationName!==`none`&&t.animationName!==``,i=t.transitionDuration!==`0s`&&t.transitionDuration!==``;r&&i||(t.animationName===`none`&&t.transitionDuration!==`0s`?n.current=`css-transition`:t.animationName!==`none`&&t.transitionDuration===`0s`?n.current=`css-animation`:n.current=`none`),e.getAttribute(Rb.orientation)===`horizontal`||t.transitionProperty.indexOf(`width`)>-1?_.current=`width`:_.current=`height`}if(n.current!==`css-transition`)return;(i===void 0||y===void 0)&&(p({height:e.scrollHeight,width:e.scrollWidth}),C.current&&e.style.setProperty(`transition-duration`,`0s`));let t=-1,r=-1;return t=Wd.request(()=>{C.current=!1,r=Wd.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})}),()=>{Wd.cancel(t),Wd.cancel(r)}}));return K(()=>{if(n.current!==`css-transition`)return;let e=d.current;if(!e)return;let r=-1;if(t.current!=null&&(t.current.abort(),t.current=null),u){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)}),!C.current&&!o&&e.setAttribute(Ob.startingStyle,``),p({height:e.scrollHeight,width:e.scrollWidth}),r=Wd.request(()=>{Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})})}else{if(e.scrollHeight===0&&e.scrollWidth===0)return;p({height:e.scrollHeight,width:e.scrollWidth});let n=new AbortController;t.current=n;let r=n.signal,i=null,a=Ob.endingStyle;return i=new MutationObserver(o=>{o.some(e=>e.type===`attributes`&&e.attributeName===a)&&(i?.disconnect(),i=null,f(()=>{p({height:0,width:0}),e.style.removeProperty(`content-visibility`),m(!1),t.current===n&&(t.current=null)},r))}),i.observe(e,{attributes:!0,attributeFilter:[a]}),()=>{i?.disconnect(),w.cancel(),t.current===n&&(n.abort(),t.current=null)}}return()=>{Wd.cancel(r)}},[t,n,w,a,o,c,u,d,f,p,m]),K(()=>{if(n.current!==`css-animation`)return;let e=d.current;e&&(x.current=e.style.animationName||x.current,e.style.setProperty(`animation-name`,`none`),p({height:e.scrollHeight,width:e.scrollWidth}),!S.current&&!b.current&&e.style.removeProperty(`animation-name`),u?(t.current!=null&&(t.current.abort(),t.current=null),m(!0),g(!0)):(t.current=new AbortController,f(()=>{m(!1),g(!1),t.current=null},t.current.signal)))},[t,n,u,d,f,p,m,g,v]),Dl(()=>{let e=Wd.request(()=>{S.current=!1});return()=>Wd.cancel(e)}),K(()=>{if(!a)return;let e=d.current;if(!e)return;let t=-1,n=-1;return u&&b.current&&(e.style.transitionDuration=`0s`,p({height:e.scrollHeight,width:e.scrollWidth}),t=Wd.request(()=>{b.current=!1,n=Wd.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})})),()=>{Wd.cancel(t),Wd.cancel(n)}},[a,u,d,p]),K(()=>{let e=d.current;e&&a&&T&&(e.setAttribute(`hidden`,`until-found`),n.current===`css-transition`&&e.setAttribute(Ob.startingStyle,``))},[a,T,n,d]),H.useEffect(function(){let e=d.current;if(!e)return;function t(e){b.current=!0,h(!0),l(!0,Dd(fd,e))}return e.addEventListener(`beforematch`,t),()=>{e.removeEventListener(`beforematch`,t)}},[l,d,h]),H.useMemo(()=>({props:{hidden:T,id:s,ref:E}}),[T,s,E])}var Bb=(function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e})({}),Vb=H.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,...s}=e,{abortControllerRef:c,animationTypeRef:l,height:u,mounted:d,onOpenChange:f,open:p,panelId:m,panelRef:h,runOnceAnimationsFinish:g,setDimensions:_,setHiddenUntilFound:v,setKeepMounted:y,setMounted:b,setPanelIdState:x,setOpen:S,setVisible:C,state:w,transitionDimensionRef:T,visible:E,width:D,transitionStatus:O}=Db(),k=r??!1,A=i??!1;K(()=>{if(o)return x(o),()=>{x(void 0)}},[o,x]),K(()=>{v(k)},[v,k]),K(()=>{y(A)},[y,A]);let{props:j}=zb({abortControllerRef:c,animationTypeRef:l,externalRef:t,height:u,hiddenUntilFound:k,id:m,keepMounted:A,mounted:d,onOpenChange:f,open:p,panelRef:h,runOnceAnimationsFinish:g,setDimensions:_,setMounted:b,setOpen:S,setVisible:C,transitionDimensionRef:T,visible:E,width:D});mp({open:p&&O===`idle`,ref:h,onComplete(){p&&_({height:void 0,width:void 0})}});let M=Y(`div`,e,{state:H.useMemo(()=>({...w,transitionStatus:O}),[w,O]),ref:[t,h],props:[j,{style:{[Bb.collapsiblePanelHeight]:u===void 0?`auto`:`${u}px`,[Bb.collapsiblePanelWidth]:D===void 0?`auto`:`${D}px`}},s],stateAttributesMapping:Pb});return A||k||!A&&d?M:null});({...Nb}),{...fp};var Hb={imageLoadingStatus:()=>null};({...Hb,...fp}),{...Hb,...fp},{...gm,...fp},{...gm,...fp},{...gm,...fp},bp(),bp(),{...gm,...fp},{...gm,...fp};var Ub={inputValue:()=>null,value:()=>null,...ph},Wb=[`零`,`〇`,`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`],Gb=[`٠`,`١`,`٢`,`٣`,`٤`,`٥`,`٦`,`٧`,`٨`,`٩`],Kb=[`۰`,`۱`,`۲`,`۳`,`۴`,`۵`,`۶`,`۷`,`۸`,`۹`],qb=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],Jb=[`%`,`٪`,`%`,`﹪`],Yb=[`‰`,`؉`],Xb=[`−`,`-`,`‒`,`–`,`—`,`﹣`],Zb=[`+`,`﹢`];RegExp(`[${Gb.join(``)}]`,`g`),RegExp(`[${Kb.join(``)}]`,`g`),RegExp(`[${qb.join(``)}]`,`g`),RegExp(`[${Wb.join(``)}]`,`g`),RegExp(`[${Jb.join(``)}]`),RegExp(`[${Yb.join(``)}]`),RegExp(`[${qb.join(``)}]`),[...Zb],[...Xb];var Qb=e=>e.replace(/[-\\\]^]/g,e=>`\\${e}`),$b=e=>`[${e.map(Qb).join(``)}]`,ex=$b([`-`].concat(Xb)),tx=$b([`+`].concat(Zb));new RegExp(ex,`gu`),new RegExp(tx,`gu`),new RegExp(ex),new RegExp(tx),{...ph,...Ub},{...Cp},X(e=>e.instantType),X(e=>e.hasViewport),{...gm,...fp},{...gm,...fp},{...ph};var nx=Gm;function rx({content:e,children:t,align:n,asChild:r,side:i,className:a,container:o,closeDelay:s,delay:c,...l}){let u=Va(),d=o??u??void 0;return(0,U.jsxs)(am,{...l,children:[(0,U.jsx)(Sm,{closeDelay:s,delay:c,className:ia(!r&&`inline-flex items-center bg-transparent border-none shadow-none p-0 m-0 h-auto min-h-0 leading-[0]`,a),render:r?t:void 0,children:r?void 0:t}),(0,U.jsx)(Em,{container:d,children:(0,U.jsx)(Vm,{align:n,side:i,sideOffset:10,children:(0,U.jsxs)(Um,{className:ia(`flex origin-[var(--transform-origin)] flex-col rounded-md bg-kumo-base px-2.5 py-1.5 text-sm text-kumo-default`,`shadow-lg shadow-kumo-tip-shadow outline outline-kumo-fill`,`transition-[transform,opacity] duration-150`,`data-[starting-style]:scale-90 data-[starting-style]:opacity-0`,`data-[ending-style]:scale-90 data-[ending-style]:opacity-0`,`data-[instant]:duration-0`,`kumo-tooltip-popup`),children:[(0,U.jsx)(Wm,{className:ia(`flex`,`data-[side=bottom]:top-[-8px]`,`data-[side=left]:right-[-13px] data-[side=left]:rotate-90`,`data-[side=right]:left-[-13px] data-[side=right]:-rotate-90`,`data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180`),children:(0,U.jsx)(ix,{})}),e]})})})]})}function ix(e){return(0,U.jsxs)(`svg`,{width:`20`,height:`10`,viewBox:`0 0 20 10`,fill:`none`,...e,children:[(0,U.jsx)(`path`,{d:`M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z`,className:`fill-kumo-base`}),(0,U.jsx)(`path`,{d:`M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z`,className:`fill-kumo-tip-shadow`}),(0,U.jsx)(`path`,{d:`M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z`,className:`fill-kumo-tip-stroke`})]})}var ax=(0,H.forwardRef)(function({to:e,href:t,...n},r){return(0,U.jsx)(`a`,{ref:r,href:t??e??void 0,...n})}),ox=(0,H.createContext)(ax);function sx(){return(0,H.useContext)(ox)}var cx={shape:{base:{classes:``,description:`Default rectangular button shape`},square:{classes:`items-center justify-center p-0`,description:`Square button for icon-only actions`},circle:{classes:`items-center justify-center p-0 rounded-full`,description:`Circular button for icon-only actions`}},size:{xs:{classes:`h-5 gap-1 rounded-sm px-1.5 text-xs`,description:`Extra small button for compact UIs`},sm:{classes:`h-6.5 gap-1 rounded-md px-2 text-xs`,description:`Small button for secondary actions`},base:{classes:`h-9 gap-1.5 rounded-lg px-3 text-base`,description:`Default button size`},lg:{classes:`h-10 gap-2 rounded-lg px-4 text-base`,description:`Large button for primary CTAs`}},compactSize:{xs:{classes:`size-3.5`},sm:{classes:`size-6.5`},base:{classes:`size-9`},lg:{classes:`size-10`}},variant:{primary:{classes:`bg-kumo-brand !text-white hover:bg-kumo-brand-hover focus:bg-kumo-brand-hover disabled:bg-kumo-brand/50`,description:`High-emphasis button for primary actions`},secondary:{classes:`bg-kumo-base !text-kumo-default ring not-disabled:hover:border-secondary! not-disabled:hover:bg-kumo-tint disabled:bg-kumo-base/50 disabled:!text-kumo-default/70 ring-kumo-hairline data-[state=open]:bg-kumo-base`,description:`Default button style for most actions`},ghost:{classes:`text-kumo-default hover:bg-kumo-tint shadow-none bg-inherit`,description:`Minimal button with no background`},destructive:{classes:`bg-kumo-danger !text-white hover:bg-kumo-danger/70`,description:`Danger button for destructive actions like delete`},"secondary-destructive":{classes:`bg-kumo-base !text-kumo-danger ring not-disabled:hover:border-secondary! not-disabled:hover:bg-kumo-base disabled:bg-kumo-base/50 disabled:!text-kumo-danger/70 ring-kumo-line data-[state=open]:bg-kumo-base`,description:`Secondary button with destructive text for less prominent dangerous actions`},outline:{classes:`bg-transparent text-kumo-default ring ring-kumo-hairline`,description:`Bordered button with transparent background`}}},lx={shape:`base`,size:`base`,variant:`secondary`};function ux({variant:e=lx.variant,size:t=lx.size,shape:n=lx.shape}={}){let r=n===`square`||n===`circle`;return ia(`group flex w-max shrink-0 items-center font-medium select-none`,`border-0 shadow-xs`,`cursor-pointer`,`disabled:cursor-not-allowed disabled:text-kumo-subtle`,cx.variant[e].classes,cx.size[t].classes,cx.shape[n].classes,r&&cx.compactSize[t].classes)}var dx=e=>e?H.isValidElement(e)?e:(0,U.jsx)(e,{}):null,fx=H.forwardRef(({children:e,className:t,disabled:n,loading:r,shape:i=`base`,size:a=`base`,variant:o=`secondary`,icon:s,title:c,...l},u)=>{let{type:d,...f}=l,p=(0,U.jsxs)(`button`,{ref:u,className:ia(ux({variant:o,size:a,shape:i}),`focus:opacity-100 focus-visible:ring-1 focus-visible:ring-kumo-hairline *:in-focus:opacity-100`,n&&`cursor-not-allowed opacity-50`,t),disabled:r||n,type:d??`button`,...f,children:[r&&(0,U.jsx)(za,{size:a===`lg`?16:14}),!r&&dx(s),e]});return c?(0,U.jsx)(rx,{content:c,asChild:!0,children:p}):p});fx.displayName=`Button`;var px=H.forwardRef(({children:e,className:t,external:n,href:r,shape:i=`base`,size:a=`base`,variant:o=`ghost`,icon:s,...c},l)=>{let u=sx(),d=n?{target:`_blank`,rel:`noopener noreferrer`}:{};return(0,U.jsxs)(u,{ref:l,className:ia(ux({variant:o,size:a,shape:i}),`flex items-center no-underline!`,t),href:r,to:typeof r==`string`?r:void 0,...d,...c,children:[dx(s),e]})});px.displayName=`LinkButton`;var mx=H.forwardRef((e,t)=>{let{alt:n,color:r=`currentColor`,size:i=`1em`,weight:a=`regular`,mirrored:o=!1,children:s,weights:c,...l}=e;return H.createElement(`svg`,{ref:t,xmlns:`http://www.w3.org/2000/svg`,width:i,height:i,fill:r,viewBox:`0 0 256 256`,transform:o?`scale(-1, 1)`:void 0,...l},!!n&&H.createElement(`title`,null,n),s,c.get(a))});mx.displayName=`SSRBase`;var hx=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M170.83,101.17a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),gx=H.forwardRef((e,t)=>H.createElement(mx,{ref:t,...e,weights:hx}));gx.displayName=`CheckCircleIcon`;var _x=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),vx=H.forwardRef((e,t)=>H.createElement(mx,{ref:t,...e,weights:_x}));vx.displayName=`InfoIcon`;var yx=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z`}))]]),bx=H.forwardRef((e,t)=>H.createElement(mx,{ref:t,...e,weights:yx}));bx.displayName=`WarningIcon`;var xx=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M116,132V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0ZM236,91.55v72.9a19.86,19.86,0,0,1-5.86,14.14l-51.55,51.55A19.85,19.85,0,0,1,164.45,236H91.55a19.85,19.85,0,0,1-14.14-5.86L25.86,178.59A19.86,19.86,0,0,1,20,164.45V91.55a19.86,19.86,0,0,1,5.86-14.14L77.41,25.86A19.85,19.85,0,0,1,91.55,20h72.9a19.85,19.85,0,0,1,14.14,5.86l51.55,51.55A19.86,19.86,0,0,1,236,91.55Zm-24,1.66L162.79,44H93.21L44,93.21v69.58L93.21,212h69.58L212,162.79ZM128,156a16,16,0,1,0,16,16A16,16,0,0,0,128,156Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M224,91.55v72.9a8,8,0,0,1-2.34,5.66l-51.55,51.55a8,8,0,0,1-5.66,2.34H91.55a8,8,0,0,1-5.66-2.34L34.34,170.11A8,8,0,0,1,32,164.45V91.55a8,8,0,0,1,2.34-5.66L85.89,34.34A8,8,0,0,1,91.55,32h72.9a8,8,0,0,1,5.66,2.34l51.55,51.55A8,8,0,0,1,224,91.55Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M120,136V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0ZM232,91.55v72.9a15.86,15.86,0,0,1-4.69,11.31l-51.55,51.55A15.86,15.86,0,0,1,164.45,232H91.55a15.86,15.86,0,0,1-11.31-4.69L28.69,175.76A15.86,15.86,0,0,1,24,164.45V91.55a15.86,15.86,0,0,1,4.69-11.31L80.24,28.69A15.86,15.86,0,0,1,91.55,24h72.9a15.86,15.86,0,0,1,11.31,4.69l51.55,51.55A15.86,15.86,0,0,1,232,91.55Zm-16,0L164.45,40H91.55L40,91.55v72.9L91.55,216h72.9L216,164.45ZM128,160a12,12,0,1,0,12,12A12,12,0,0,0,128,160Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M227.31,80.23,175.77,28.69A16.13,16.13,0,0,0,164.45,24H91.55a16.13,16.13,0,0,0-11.32,4.69L28.69,80.23A16.13,16.13,0,0,0,24,91.55v72.9a16.13,16.13,0,0,0,4.69,11.32l51.54,51.54A16.13,16.13,0,0,0,91.55,232h72.9a16.13,16.13,0,0,0,11.32-4.69l51.54-51.54A16.13,16.13,0,0,0,232,164.45V91.55A16.13,16.13,0,0,0,227.31,80.23ZM120,80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M122,136V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0ZM230,91.55v72.9a13.92,13.92,0,0,1-4.1,9.9L174.35,225.9a13.92,13.92,0,0,1-9.9,4.1H91.55a13.92,13.92,0,0,1-9.9-4.1L30.1,174.35a13.92,13.92,0,0,1-4.1-9.9V91.55a13.92,13.92,0,0,1,4.1-9.9L81.65,30.1a13.92,13.92,0,0,1,9.9-4.1h72.9a13.92,13.92,0,0,1,9.9,4.1L225.9,81.65A13.92,13.92,0,0,1,230,91.55Zm-12,0a2,2,0,0,0-.59-1.42L165.87,38.59a2,2,0,0,0-1.42-.59H91.55a2,2,0,0,0-1.41.59L38.58,90.13A2,2,0,0,0,38,91.55v72.9a2,2,0,0,0,.59,1.42l51.54,51.54a2,2,0,0,0,1.42.59h72.9a2,2,0,0,0,1.41-.59l51.56-51.54a2,2,0,0,0,.58-1.42ZM128,162a10,10,0,1,0,10,10A10,10,0,0,0,128,162Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M120,136V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0ZM232,91.55v72.9a15.86,15.86,0,0,1-4.69,11.31l-51.55,51.55A15.86,15.86,0,0,1,164.45,232H91.55a15.86,15.86,0,0,1-11.31-4.69L28.69,175.76A15.86,15.86,0,0,1,24,164.45V91.55a15.86,15.86,0,0,1,4.69-11.31L80.24,28.69A15.86,15.86,0,0,1,91.55,24h72.9a15.86,15.86,0,0,1,11.31,4.69l51.55,51.55A15.86,15.86,0,0,1,232,91.55Zm-16,0L164.45,40H91.55L40,91.55v72.9L91.55,216h72.9L216,164.45ZM128,160a12,12,0,1,0,12,12A12,12,0,0,0,128,160Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M124,136V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0ZM228,91.55v72.9a12,12,0,0,1-3.51,8.49l-51.55,51.55a12,12,0,0,1-8.49,3.51H91.55a12,12,0,0,1-8.49-3.51L31.51,172.94A12,12,0,0,1,28,164.45V91.55a12,12,0,0,1,3.51-8.49L83.06,31.51A12,12,0,0,1,91.55,28h72.9a12,12,0,0,1,8.49,3.51l51.55,51.55A12,12,0,0,1,228,91.55Zm-8,0a4,4,0,0,0-1.17-2.83L167.28,37.17A4.06,4.06,0,0,0,164.45,36H91.55a4.06,4.06,0,0,0-2.83,1.17L37.17,88.72A4,4,0,0,0,36,91.55v72.9a4,4,0,0,0,1.17,2.83l51.55,51.55A4.06,4.06,0,0,0,91.55,220h72.9a4.06,4.06,0,0,0,2.83-1.17l51.55-51.55a4,4,0,0,0,1.17-2.83ZM128,164a8,8,0,1,0,8,8A8,8,0,0,0,128,164Z`}))]]),Sx=H.forwardRef((e,t)=>H.createElement(mx,{ref:t,...e,weights:xx}));Sx.displayName=`WarningOctagonIcon`;var Cx=new Map([[`bold`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),H.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,H.createElement(H.Fragment,null,H.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),wx=H.forwardRef((e,t)=>H.createElement(mx,{ref:t,...e,weights:Cx}));wx.displayName=`XIcon`;var Tx={variant:{default:{classes:`border-kumo-fill bg-kumo-base`,description:`Default toast style`},success:{classes:`ring-[0.3px] ring-kumo-success bg-kumo-base [&_[data-toast-icon]]:text-kumo-success [&_[data-toast-title]]:text-kumo-success`,description:`Success toast for confirmations and positive outcomes`,icon:gx},error:{classes:`ring-[0.3px] ring-kumo-danger bg-kumo-base [&_[data-toast-icon]]:text-kumo-danger [&_[data-toast-title]]:text-kumo-danger`,description:`Error toast for critical issues`,icon:Sx},warning:{classes:`ring-[0.3px] ring-kumo-warning bg-kumo-base [&_[data-toast-icon]]:text-kumo-warning [&_[data-toast-title]]:text-kumo-warning`,description:`Warning toast for cautionary messages`,icon:bx},info:{classes:`ring-[0.3px] ring-kumo-info bg-kumo-control [&_[data-toast-icon]]:text-kumo-info [&_[data-toast-title]]:text-kumo-info`,description:`Info toast for neutral informational messages`,icon:vx}}},Ex={variant:`default`};function Dx({variant:e=Ex.variant}={}){return ia(`rounded-xl ring ring-kumo-hairline bg-clip-padding p-4 shadow-lg`,Tx.variant[e].classes)}function Ox(e){return{...e,add:t=>{if(t.id){let n=e.toasts;if(n){let r=n.find(e=>e.id===t.id);if(r&&r.transitionStatus!==`ending`)return e.update(t.id,{bump:!1}),requestAnimationFrame(()=>{e.update(t.id,{bump:!0,...t.timeout!==void 0&&{timeout:t.timeout}})}),t.id;if(r&&r.transitionStatus===`ending`)return t.id}}return e.add({...t})},update:(t,n)=>e.update(t,{...n}),promise:(t,n)=>e.promise(t,{loading:{...n.loading},success:typeof n.success==`function`?e=>({...n.success(e)}):{...n.success},error:typeof n.error==`function`?e=>({...n.error(e)}):{...n.error}})}}var kx=()=>{let e=kg();return{...Ox(e),toasts:e.toasts}};function Ax({children:e,container:t}){let n=Va();return(0,U.jsxs)(ug,{children:[e,(0,U.jsx)(Og,{container:t??n??void 0,children:(0,U.jsx)(fg,{className:`fixed top-auto right-4 bottom-4 z-1 mx-auto flex w-[calc(100%-2rem)] sm:right-8 sm:bottom-8 sm:w-[340px]`,children:(0,U.jsx)(jx,{})})})]})}function jx(){let{toasts:e}=kx();return e.map(e=>(0,U.jsxs)(Cg,{toast:e,className:ia(`absolute right-0 bottom-0 left-auto z-[calc(1000-var(--toast-index))] mr-0 h-[var(--height)] w-full origin-bottom select-none`,Dx({variant:e.variant}),`[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]`,`[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_0.5s_cubic-bezier(0.22,1,0.36,1),opacity_0.5s,height_0.15s]`,`after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']`,`data-[ending-style]:opacity-0 data-[expanded]:h-[var(--toast-height)] data-[expanded]:[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--offset-y)))] data-[limited]:opacity-0 data-[starting-style]:[transform:translateY(150%)]`,`data-[ending-style]:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))] data-[expanded]:data-[ending-style]:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]`,`data-[ending-style]:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))] data-[expanded]:data-[ending-style]:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]`,`data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))] data-[expanded]:data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]`,`data-[ending-style]:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))] data-[expanded]:data-[ending-style]:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]`,`[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]`,e.bump&&`animate-toast-bump`),children:[(0,U.jsx)(Nx,{variant:e.variant}),(0,U.jsxs)(wg,{className:`isolate flex flex-col gap-1 transition-opacity [transition-duration:250ms] data-[behind]:pointer-events-none data-[behind]:opacity-0 data-[expanded]:pointer-events-auto data-[expanded]:opacity-100`,children:[e.content??(0,U.jsx)(U.Fragment,{children:(0,U.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,U.jsx)(Px,{variant:e.variant}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1 overflow-hidden`,children:[(0,U.jsx)(Eg,{"data-toast-title":!0,className:`text-[0.975rem] leading-5 font-medium text-kumo-default`}),(0,U.jsx)(Tg,{className:`text-[0.925rem] leading-5 text-kumo-subtle`}),!!e.actions&&(0,U.jsx)(`div`,{className:`mt-2 flex min-w-0 flex-nowrap gap-2 overflow-x-auto p-px`,children:e.actions.map((e,t)=>(0,U.jsx)(fx,{...e},t))})]})]})}),(0,U.jsx)(Dg,{className:`absolute top-2 right-2 flex h-4 w-4 items-center justify-center rounded border-none bg-transparent text-current/50 hover:bg-kumo-contrast/10 hover:text-current`,"aria-label":`Close`,children:(0,U.jsx)(wx,{className:`h-3 w-3`})})]})]},e.id))}var Mx={success:`bg-kumo-success/5`,error:`bg-kumo-danger/5`,warning:`bg-kumo-warning/5`,info:`bg-kumo-info/5`};function Nx({variant:e}){return(0,U.jsx)(`div`,{className:ia(`absolute inset-0 rounded-[11px] bg-kumo-base/90`,e&&Mx[e])})}function Px({variant:e}){if(!e||e===`default`)return null;let t=Tx.variant[e];if(!(`icon`in t))return null;let n=t.icon;return(0,U.jsx)(n,{"data-toast-icon":!0,className:`mt-0.5 h-4 w-4 shrink-0`,weight:`fill`})}var Fx=`#F48120`,Ix=`#FAAD3F`,Lx=`0 0 49 22`,Rx=`0 0 101.4 33.5`,zx={variant:`full`,color:`color`},Bx=(0,H.forwardRef)(({variant:e=zx.variant,color:t=zx.color,className:n,...r},i)=>{let a=e===`glyph`,o=t===`color`?Fx:`currentColor`,s=t===`color`?Ix:`currentColor`;return a?(0,U.jsxs)(`svg`,{ref:i,viewBox:Lx,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,role:`img`,"aria-label":`Cloudflare logo`,className:ia(t===`white`&&`text-white`,t===`black`&&`text-black`,n),...r,children:[(0,U.jsx)(`path`,{d:`M33.204 20.4C33.3649 19.9741 33.4217 19.5159 33.3695 19.0636C33.3173 18.6113 33.1577 18.1781 32.904 17.8C32.6435 17.4876 32.3239 17.2297 31.9636 17.0409C31.6032 16.8522 31.2092 16.7363 30.804 16.7L13.404 16.5C13.304 16.5 13.204 16.4 13.104 16.4C13.0808 16.3825 13.0618 16.3599 13.0488 16.3339C13.0358 16.3078 13.029 16.2791 13.029 16.25C13.029 16.2209 13.0358 16.1922 13.0488 16.1662C13.0618 16.1401 13.0808 16.1175 13.104 16.1C13.204 15.9 13.304 15.8 13.504 15.8L31.004 15.6C32.115 15.4767 33.1731 15.0597 34.0695 14.3918C34.9659 13.7239 35.6681 12.8293 36.104 11.8L37.104 9.20002C37.104 9.10002 37.204 9.00001 37.104 8.90001C36.5604 6.47843 35.2411 4.30052 33.3466 2.69721C31.4521 1.09391 29.086 0.152865 26.6079 0.0170769C24.1298 -0.118712 21.675 0.558179 19.6167 1.94489C17.5584 3.33161 16.009 5.35233 15.204 7.70002C14.159 6.95365 12.8843 6.59957 11.604 6.70002C10.4291 6.83102 9.33369 7.35777 8.49774 8.19372C7.66179 9.02966 7.13505 10.1251 7.00404 11.3C6.93745 11.9014 6.97125 12.5097 7.10404 13.1C5.20298 13.1526 3.39743 13.9448 2.07147 15.3081C0.745511 16.6714 0.00377461 18.4982 0.00403983 20.4C-0.0123708 20.7695 0.0212659 21.1395 0.104038 21.5C0.10863 21.5781 0.141713 21.6517 0.19701 21.707C0.252307 21.7623 0.325975 21.7954 0.404041 21.8H32.504C32.704 21.8 32.904 21.7 32.904 21.5L33.204 20.4Z`,fill:o}),(0,U.jsx)(`path`,{d:`M38.704 9.20002H38.204C38.104 9.20002 38.004 9.30001 37.904 9.40001L37.204 11.8C37.0431 12.2259 36.9864 12.6841 37.0386 13.1364C37.0908 13.5887 37.2504 14.0219 37.504 14.4C37.7646 14.7124 38.0842 14.9704 38.4445 15.1591C38.8049 15.3479 39.1989 15.4637 39.604 15.5L43.304 15.7C43.404 15.7 43.504 15.8 43.604 15.8C43.6273 15.8175 43.6462 15.8401 43.6592 15.8662C43.6723 15.8922 43.679 15.9209 43.679 15.95C43.679 15.9791 43.6723 16.0078 43.6592 16.0339C43.6462 16.0599 43.6273 16.0826 43.604 16.1C43.504 16.3 43.404 16.4 43.204 16.4L39.404 16.6C38.293 16.7233 37.2349 17.1403 36.3386 17.8082C35.4422 18.4761 34.74 19.3707 34.304 20.4L34.104 21.3C34.004 21.4 34.104 21.6 34.304 21.6H47.504C47.5448 21.6058 47.5863 21.6021 47.6254 21.5891C47.6644 21.5761 47.6999 21.5541 47.729 21.525C47.7581 21.4959 47.7801 21.4604 47.7931 21.4214C47.8061 21.3823 47.8099 21.3408 47.804 21.3C48.0421 20.4527 48.1764 19.5797 48.204 18.7C48.1882 16.1854 47.1822 13.7782 45.404 12C43.6259 10.2218 41.2187 9.21587 38.704 9.20002Z`,fill:s})]}):(0,U.jsxs)(`svg`,{ref:i,viewBox:Rx,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,role:`img`,"aria-label":`Cloudflare logo`,className:ia(t===`color`&&`text-kumo-default`,t===`white`&&`text-white`,t===`black`&&`text-black`,n),...r,children:[(0,U.jsx)(`path`,{d:`M84.2,20.4a2.85546,2.85546,0,0,0-.3-2.6,3.09428,3.09428,0,0,0-2.1-1.1l-17.4-.2c-.1,0-.2-.1-.3-.1a.1875.1875,0,0,1,0-.3c.1-.2.2-.3.4-.3L82,15.6a6.29223,6.29223,0,0,0,5.1-3.8l1-2.6c0-.1.1-.2,0-.3A11.39646,11.39646,0,0,0,66.2,7.7a5.45941,5.45941,0,0,0-3.6-1A5.20936,5.20936,0,0,0,58,11.3a5.46262,5.46262,0,0,0,.1,1.8A7.30177,7.30177,0,0,0,51,20.4a4.102,4.102,0,0,0,.1,1.1.3193.3193,0,0,0,.3.3H83.5c.2,0,.4-.1.4-.3Z`,fill:o}),(0,U.jsx)(`path`,{d:`M89.7,9.2h-.5c-.1,0-.2.1-.3.2l-.7,2.4a2.85546,2.85546,0,0,0,.3,2.6,3.09428,3.09428,0,0,0,2.1,1.1l3.7.2c.1,0,.2.1.3.1a.1875.1875,0,0,1,0,.3c-.1.2-.2.3-.4.3l-3.8.2a6.29223,6.29223,0,0,0-5.1,3.8l-.2.9c-.1.1,0,.3.2.3H98.5a.26517.26517,0,0,0,.3-.3,10.87184,10.87184,0,0,0,.4-2.6,9.56045,9.56045,0,0,0-9.5-9.5`,fill:s}),(0,U.jsx)(`path`,{d:`M100.5,27.2a.9.9,0,1,1,.9-.9.89626.89626,0,0,1-.9.9m0-1.6a.7.7,0,1,0,.7.7.68354.68354,0,0,0-.7-.7m.4,1.2h-.2l-.2-.3h-.2v.3h-.2v-.9h.5a.26517.26517,0,0,1,.3.3c0,.1-.1.2-.2.3l.2.3Zm-.3-.5c.1,0,.1,0,.1-.1a.09794.09794,0,0,0-.1-.1h-.3v.3h.3Zm-89.7-.9h2.2v6h3.8v1.9h-6Zm8.3,3.9a4.10491,4.10491,0,0,1,4.3-4.1,4.02,4.02,0,0,1,4.2,4.1,4.10491,4.10491,0,0,1-4.3,4.1,4.07888,4.07888,0,0,1-4.2-4.1m6.3,0a2.05565,2.05565,0,0,0-2-2.2,2.1025,2.1025,0,0,0,0,4.2c1.2.2,2-.8,2-2m4.9.5V25.4h2.2v4.4c0,1.1.6,1.7,1.5,1.7a1.39926,1.39926,0,0,0,1.5-1.6V25.4h2.2v4.4c0,2.6-1.5,3.7-3.7,3.7-2.3-.1-3.7-1.2-3.7-3.7m10.7-4.4h3.1c2.8,0,4.5,1.6,4.5,3.9s-1.7,4-4.5,4h-3V25.4Zm3.1,5.9a2.00909,2.00909,0,1,0,0-4h-.9v4Zm7.6-5.9h6.3v1.9H54v1.3h3.7v1.8H54v2.9H51.8Zm9.4,0h2.2v6h3.8v1.9h-6Zm11.7-.1h2.2l3.4,8H76.1l-.6-1.4H72.4l-.6,1.4H69.5Zm2,4.9L74,28l-.9,2.2Zm6.4-4.8H85a3.41818,3.41818,0,0,1,2.6.9,2.62373,2.62373,0,0,1-.9,4.2l1.9,2.8H86.1l-1.6-2.4h-1v2.4H81.3Zm3.6,3.8c.7,0,1.2-.4,1.2-.9,0-.6-.5-.9-1.2-.9H83.5v1.9h1.4Zm6.5-3.8h6.4v1.8H93.6v1.2h3.8v1.8H93.6v1.2h4.3v1.9H91.4ZM6.1,30.3a1.97548,1.97548,0,0,1-1.8,1.2,2.1025,2.1025,0,0,1,0-4.2,2.0977,2.0977,0,0,1,1.9,1.3H8.5a4.13459,4.13459,0,0,0-4.2-3.3A4.1651,4.1651,0,0,0,0,29.4a4.07888,4.07888,0,0,0,4.2,4.1,4.31812,4.31812,0,0,0,4.2-3.2Z`,fill:`currentColor`})]})});Bx.displayName=`CloudflareLogo`;var Vx=(0,H.forwardRef)(({color:e=`color`,href:t=`https://www.cloudflare.com`,className:n,...r},i)=>(0,U.jsxs)(`a`,{ref:i,href:t,target:`_blank`,rel:`noopener noreferrer`,className:ia(`inline-flex items-center gap-2 rounded-lg py-2 pl-2.5 pr-3 text-sm font-medium`,`ring-1 ring-inset transition-all hover:shadow-sm`,e===`color`&&`bg-kumo-base text-kumo-default ring-kumo-line`,e===`black`&&`bg-white text-black ring-black/20`,e===`white`&&`bg-black text-white ring-white/20`,n),...r,children:[(0,U.jsx)(Bx,{variant:`glyph`,color:e,className:`h-4 w-auto`}),(0,U.jsxs)(`span`,{children:[`Powered by `,(0,U.jsx)(`span`,{className:`font-semibold`,children:`Cloudflare`})]})]}));Vx.displayName=`PoweredByCloudflare`;var Hx={variant:`sidebar`,collapsible:`icon`,side:`left`},Ux=`16rem`,Wx=`3rem`,Gx=768;function Kx(){let[e,t]=(0,H.useState)(!1);return(0,H.useEffect)(()=>{let e=window.matchMedia(`(max-width: ${Gx-1}px)`),n=()=>t(e.matches);return e.addEventListener(`change`,n),t(e.matches),()=>e.removeEventListener(`change`,n)},[]),e}var qx=(0,H.createContext)(null);function Jx(){let e=(0,H.useContext)(qx);if(!e)throw Error(`useSidebar must be used within a Sidebar.Provider`);return e}var Yx=256,Xx=200,Zx=480;function Qx({defaultOpen:e=!0,open:t,onOpenChange:n,variant:r=Hx.variant,side:i=Hx.side,collapsible:a=Hx.collapsible,resizable:o=!1,defaultWidth:s=Yx,minWidth:c=Xx,maxWidth:l=Zx,onWidthChange:u,children:d,className:f,style:p}){let m=Kx(),[h,g]=(0,H.useState)(!1),[_,v]=(0,H.useState)(s),[y,b]=(0,H.useState)(!1),x=(0,H.useCallback)(e=>{let t=Math.min(l,Math.max(c,e));v(t),u?.(t)},[c,l,u]),[S,C]=(0,H.useState)(e),w=t??S,T=(0,H.useCallback)(e=>{let t=typeof e==`function`?e(w):e;n?.(t),C(t)},[n,w]),E=(0,H.useCallback)(()=>{m?g(e=>!e):T(e=>!e)},[m,T]),D=w?`expanded`:`collapsed`,O=o?`${_}px`:Ux,k=(0,H.useMemo)(()=>({state:D,open:w,setOpen:T,openMobile:h,setOpenMobile:g,isMobile:m,toggleSidebar:E,variant:r,side:i,collapsible:a,width:_,resizable:o,minWidth:c,maxWidth:l,isResizing:y,setIsResizing:b,setWidth:x}),[D,w,T,h,g,m,E,r,i,a,_,o,c,l,y,b,x]);return(0,U.jsx)(qx.Provider,{value:k,children:(0,U.jsx)(`div`,{"data-sidebar-wrapper":``,"data-state":D,"data-side":i,style:{"--sidebar-width":O,"--sidebar-width-icon":Wx,...p},className:ia(`group/sidebar-wrapper flex min-h-svh w-full`,`has-data-[variant=inset]:bg-kumo-recessed`,y&&`select-none`,f),children:d})})}Qx.displayName=`Sidebar.Provider`;var $x=(0,H.forwardRef)(({className:e,children:t,...n},r)=>{let{state:i,isMobile:a,openMobile:o,setOpenMobile:s,side:c,variant:l,collapsible:u,isResizing:d,resizable:f,width:p}=Jx();if(u===`none`)return(0,U.jsx)(`aside`,{ref:r,"data-state":`expanded`,"data-side":c,"data-variant":l,"data-sidebar":`sidebar`,style:{width:`var(--sidebar-width)`,minWidth:`var(--sidebar-width)`,maxWidth:`var(--sidebar-width)`},className:ia(`relative flex h-full shrink-0 grow-0 flex-col overflow-hidden bg-kumo-base text-kumo-default`,l===`sidebar`&&(c===`left`?`border-r border-kumo-line`:`border-l border-kumo-line`),l===`floating`&&`m-2 rounded-lg border border-kumo-line shadow-lg`,e),...n,children:t});if(a)return(0,U.jsx)(R_,{open:o,onOpenChange:s,children:(0,U.jsxs)(N_,{children:[(0,U.jsx)(h_,{className:`fixed inset-0 z-50 bg-black/50 transition-opacity duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0`}),(0,U.jsx)(M_,{className:ia(`fixed inset-y-0 z-50 flex w-[--sidebar-width] flex-col bg-kumo-base p-0`,`duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0`,c===`left`&&`left-0 data-[ending-style]:-translate-x-full data-[starting-style]:-translate-x-full`,c===`right`&&`right-0 data-[ending-style]:translate-x-full data-[starting-style]:translate-x-full`),style:{"--sidebar-width":Ux,transitionProperty:`transform, opacity`,transitionTimingFunction:`var(--default-transition-timing-function)`},children:(0,U.jsx)(`div`,{"data-sidebar":`sidebar`,"data-mobile":`true`,className:ia(`flex h-full w-full flex-col bg-kumo-base text-kumo-default`,e),children:t})})]})});let m=u===`icon`?`var(--sidebar-width-icon)`:`0px`,h=f?`${p}px`:`var(--sidebar-width)`;return(0,U.jsx)(`aside`,{ref:r,"data-state":i,"data-side":c,"data-variant":l,"data-collapsible":u,"data-sidebar":`sidebar`,style:{width:i===`expanded`?h:m},className:ia(`group/sidebar relative flex h-full shrink-0 grow-0 flex-col`,`min-w-0 overflow-hidden whitespace-nowrap`,`bg-kumo-base text-kumo-default`,`transition-[width] duration-250 ease-[cubic-bezier(0.77,0,0.175,1)] will-change-[width]`,`motion-reduce:transition-none`,d&&`transition-none!`,l===`sidebar`&&(c===`left`?`border-r border-kumo-line`:`border-l border-kumo-line`),l===`floating`&&`m-2 rounded-lg border border-kumo-line shadow-lg`,e),...n,children:(0,U.jsx)(nx,{children:t})})});$x.displayName=`Sidebar`;var eS=(0,H.forwardRef)(({className:e,...t},n)=>(0,U.jsx)(`div`,{ref:n,"data-sidebar":`header`,className:ia(`flex items-center gap-2 border-b border-kumo-line px-2 py-3`,`overflow-hidden`,`group-data-[state=collapsed]/sidebar:border-b-0`,e),...t}));eS.displayName=`Sidebar.Header`;var tS=(0,H.forwardRef)(({className:e,...t},n)=>(0,U.jsx)(`div`,{ref:n,"data-sidebar":`content`,className:ia(`flex min-w-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden px-2 py-2`,`group-data-[state=collapsed]/sidebar:gap-0 group-data-[state=collapsed]/sidebar:py-0`,`group-data-[state=collapsed]/sidebar:overflow-x-hidden`,e),...t}));tS.displayName=`Sidebar.Content`;var nS=(0,H.forwardRef)(({className:e,...t},n)=>(0,U.jsx)(`div`,{ref:n,"data-sidebar":`footer`,className:ia(`flex min-w-0 flex-col gap-2 border-t border-kumo-line px-2 py-2`,`group-data-[state=collapsed]/sidebar:border-t-0 group-data-[state=collapsed]/sidebar:py-1`,e),...t}));nS.displayName=`Sidebar.Footer`;var rS=(0,H.createContext)({isCollapsible:!1,isOpen:!0}),iS=(0,H.forwardRef)(({className:e,collapsible:t=!1,defaultOpen:n=!0,open:r,onOpenChange:i,children:a,...o},s)=>{let[c,l]=(0,H.useState)(n),u=r??c,d=(0,H.useCallback)(e=>{l(e),i?.(e)},[i]),f=(0,H.useMemo)(()=>({isCollapsible:t,isOpen:u}),[t,u]),p=(0,U.jsx)(`div`,{ref:s,"data-sidebar":`group`,className:ia(`flex min-w-0 flex-col gap-0.5`,`group-data-[state=collapsed]/sidebar:gap-0`,e),...o,children:a});return t?(0,U.jsx)(rS.Provider,{value:f,children:(0,U.jsx)(Fb,{defaultOpen:n,open:r,onOpenChange:d,className:`min-w-0`,children:p})}):(0,U.jsx)(rS.Provider,{value:f,children:p})});iS.displayName=`Sidebar.Group`;var aS=(0,H.forwardRef)(({className:e,children:t,...n},r)=>{let{isCollapsible:i}=(0,H.useContext)(rS);return i?(0,U.jsxs)(Lb,{ref:r,"data-sidebar":`group-label`,className:ia(`group/group-label flex w-full cursor-pointer items-center px-3 py-1 text-xs font-medium text-kumo-subtle`,`group-data-[state=collapsed]/sidebar:hidden`,e),...n,children:[(0,U.jsx)(`span`,{className:`flex-1 truncate text-left`,children:t}),(0,U.jsx)(Ta,{className:ia(`ml-auto size-3 shrink-0 text-kumo-subtle transition-transform duration-200`,`group-data-[panel-open]/group-label:rotate-90`)})]}):(0,U.jsx)(`div`,{ref:r,"data-sidebar":`group-label`,className:ia(`truncate px-3 py-1 text-xs font-medium text-kumo-subtle`,`group-data-[state=collapsed]/sidebar:hidden`,e),...n,children:t})});aS.displayName=`Sidebar.GroupLabel`;var oS=(0,H.forwardRef)(({className:e,children:t,...n},r)=>{let{isCollapsible:i,isOpen:a}=(0,H.useContext)(rS);return i?(0,U.jsx)(`div`,{ref:r,"data-sidebar":`group-content`,className:ia(`grid`,`transition-[grid-template-rows] duration-250 ease-[cubic-bezier(0.77,0,0.175,1)]`,`motion-reduce:transition-none`,`grid-rows-[0fr]`,a?`group-data-[state=expanded]/sidebar:grid-rows-[1fr]`:`group-data-[state=expanded]/sidebar:grid-rows-[0fr]`,e),...n,children:(0,U.jsx)(`div`,{className:`overflow-hidden`,children:t})}):(0,U.jsx)(`div`,{ref:r,"data-sidebar":`group-content`,className:ia(`flex flex-col`,e),...n,children:t})});oS.displayName=`Sidebar.GroupContent`;var sS=(0,H.createContext)(!1),cS=(0,H.createContext)(!1),lS=(0,H.forwardRef)(({className:e,...t},n)=>(0,U.jsx)(`ul`,{ref:n,"data-sidebar":`menu`,className:ia(`m-0 flex min-w-0 list-none flex-col gap-0.5 p-0`,`group-data-[state=collapsed]/sidebar:gap-0`,e),...t}));lS.displayName=`Sidebar.Menu`;var uS=(0,H.forwardRef)(({className:e,children:t,...n},r)=>(0,U.jsx)(sS.Provider,{value:!0,children:(0,U.jsx)(`li`,{ref:r,"data-sidebar":`menu-item`,className:ia(`relative`,e),...n,children:t})}));uS.displayName=`Sidebar.MenuItem`;var dS=(0,H.forwardRef)(({className:e,icon:t,active:n=!1,size:r=`base`,href:i,tooltip:a,children:o,...s},c)=>{let{state:l}=Jx(),u=sx(),d=(0,H.useContext)(sS),f=(0,U.jsxs)(U.Fragment,{children:[t?H.isValidElement(t)?t:(0,U.jsx)(t,{className:ia(`shrink-0`,r===`base`?`size-4`:`size-3.5`)}):null,(0,U.jsx)(`span`,{className:ia(`flex flex-1 items-center min-w-0 text-left overflow-hidden`,`group-data-[state=collapsed]/sidebar:hidden`),children:o})]}),p=ia(`group/menu-button flex w-full min-w-0 items-center gap-2 rounded-lg outline-none cursor-pointer`,r===`base`&&`min-h-[34px] px-3 py-1.5 text-sm font-medium`,r===`sm`&&`min-h-[28px] px-2 py-1 text-sm`,`text-kumo-default`,`transition-[color,background-color,padding] duration-0 ease-[cubic-bezier(0.77,0,0.175,1)]`,`[&>svg]:text-kumo-subtle`,!n&&`hover:bg-kumo-tint`,n&&`bg-kumo-tint`,`has-[[data-active]]:bg-transparent has-[[data-active]]:hover:bg-kumo-tint`,`focus-visible:ring-1 focus-visible:ring-kumo-hairline`,`group-data-[state=collapsed]/sidebar:px-2`,e),m;return m=i?(0,U.jsx)(u,{ref:c,className:ia(p,`no-underline!`),href:i,to:i,"data-active":n||void 0,"data-sidebar":`menu-button`,"data-size":r,onClick:s.onClick,children:f}):(0,U.jsx)(`button`,{ref:c,type:`button`,className:p,"data-active":n||void 0,"data-sidebar":`menu-button`,"data-size":r,...s,children:f}),l===`collapsed`&&a&&(m=(0,U.jsx)(rx,{content:a,side:`right`,asChild:!0,children:m})),d?m:(0,U.jsx)(`li`,{"data-sidebar":`menu-item`,className:`relative`,children:m})});dS.displayName=`Sidebar.MenuButton`;var fS=(0,H.forwardRef)(({className:e,...t},n)=>(0,U.jsx)(`button`,{ref:n,type:`button`,"data-sidebar":`menu-action`,className:ia(`absolute right-1.5 top-1/2 flex -translate-y-1/2 items-center justify-center rounded-md p-1`,`text-kumo-strong hover:bg-kumo-overlay`,`transition-colors duration-150`,`group-data-[state=collapsed]/sidebar:hidden`,e),...t}));fS.displayName=`Sidebar.MenuAction`;var pS=(0,H.forwardRef)(({className:e,...t},n)=>(0,U.jsx)(`span`,{ref:n,"data-sidebar":`menu-badge`,className:ia(`inline-flex shrink-0 items-center rounded-full border border-dashed border-kumo-line`,`select-none px-1.5 py-0.5 text-[11px]/none font-medium text-kumo-strong`,`group-data-[state=collapsed]/sidebar:hidden`,e),...t}));pS.displayName=`Sidebar.MenuBadge`;var mS=(0,H.forwardRef)(({className:e,...t},n)=>(0,U.jsx)(`ul`,{ref:n,"data-sidebar":`menu-sub`,className:ia(`m-0 ml-3.5 flex min-w-0 list-none flex-col gap-0.5 border-l border-kumo-line p-0 pl-2.5`,`group-data-[state=collapsed]/sidebar:hidden`,e),...t}));mS.displayName=`Sidebar.MenuSub`;var hS=(0,H.forwardRef)(({className:e,children:t,...n},r)=>(0,U.jsx)(cS.Provider,{value:!0,children:(0,U.jsx)(`li`,{ref:r,"data-sidebar":`menu-sub-item`,className:ia(`relative`,e),...n,children:t})}));hS.displayName=`Sidebar.MenuSubItem`;var gS=(0,H.forwardRef)(({className:e,active:t=!1,href:n,children:r,...i},a)=>{let o=sx(),s=(0,H.useContext)(cS),c=ia(`flex w-full min-w-0 items-center gap-2 rounded-lg min-h-[34px] px-3 py-1 text-sm font-medium outline-none`,`text-kumo-default transition-colors duration-150`,!t&&`hover:bg-kumo-tint`,t&&`bg-kumo-tint`,`focus-visible:ring-1 focus-visible:ring-kumo-hairline`,e),l=(0,U.jsx)(`span`,{className:`flex-1 truncate text-left`,children:r}),u;return u=n?(0,U.jsx)(o,{ref:a,className:ia(c,`no-underline!`),href:n,to:n,"data-active":t||void 0,"data-sidebar":`menu-sub-button`,onClick:i.onClick,children:l}):(0,U.jsx)(`button`,{ref:a,type:`button`,className:c,"data-active":t||void 0,"data-sidebar":`menu-sub-button`,...i,children:l}),s?u:(0,U.jsx)(`li`,{"data-sidebar":`menu-sub-item`,className:`relative`,children:u})});gS.displayName=`Sidebar.MenuSubButton`;var _S=(0,H.forwardRef)(({className:e,...t},n)=>(0,U.jsx)(`hr`,{ref:n,"data-sidebar":`separator`,className:ia(`mx-2 min-h-px h-px border-0 bg-kumo-line`,e),...t}));_S.displayName=`Sidebar.Separator`;var vS=(0,H.forwardRef)(({className:e,placeholder:t=`Search...`,shortcut:n,children:r,...i},a)=>(0,U.jsxs)(`button`,{ref:a,type:`button`,"data-sidebar":`input`,className:ia(`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm`,`bg-kumo-base text-kumo-subtle ring ring-kumo-line`,`transition-[color,background-color,padding,box-shadow] duration-250 ease-[cubic-bezier(0.77,0,0.175,1)]`,`hover:bg-kumo-overlay`,`group-data-[state=collapsed]/sidebar:px-2 group-data-[state=collapsed]/sidebar:ring-0`,e),...i,children:[(0,U.jsx)(Oa,{className:`size-4 shrink-0 text-kumo-subtle`}),(0,U.jsx)(`span`,{className:`flex-1 truncate text-left group-data-[state=collapsed]/sidebar:hidden`,children:r??t}),n&&(0,U.jsx)(`kbd`,{className:`ml-auto font-sans text-xs text-kumo-subtle group-data-[state=collapsed]/sidebar:hidden`,children:n})]}));vS.displayName=`Sidebar.Input`;var yS=(0,H.forwardRef)(({className:e,children:t,onClick:n,...r},i)=>{let{toggleSidebar:a}=Jx();return(0,U.jsx)(`button`,{ref:i,type:`button`,"data-sidebar":`trigger`,"aria-label":`Toggle sidebar`,className:ia(`flex items-center rounded-md p-1.5`,`text-kumo-subtle hover:text-kumo-strong hover:bg-kumo-overlay`,`transition-colors duration-150`,e),onClick:e=>{n?.(e),a()},...r,children:t??(0,U.jsx)(ja,{className:`size-5`})})});yS.displayName=`Sidebar.Trigger`;var bS=(0,H.forwardRef)(({className:e,...t},n)=>{let{toggleSidebar:r}=Jx();return(0,U.jsx)(`button`,{ref:n,type:`button`,"data-sidebar":`rail`,"aria-label":`Toggle sidebar`,tabIndex:-1,className:ia(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 cursor-pointer transition-all`,`after:absolute after:inset-y-0 after:left-1/2 after:w-0.5`,`hover:after:bg-kumo-brand/20`,`group-data-[side=left]/sidebar-wrapper:right-0`,`group-data-[side=right]/sidebar-wrapper:left-0`,`sm:flex`,e),onClick:r,...t})});bS.displayName=`Sidebar.Rail`;var xS=(0,H.forwardRef)(({className:e,...t},n)=>{let{side:r,resizable:i,setIsResizing:a,setWidth:o,setOpen:s,open:c,minWidth:l}=Jx(),u=(0,H.useRef)(0),d=(0,H.useRef)(0),f=(0,H.useRef)(!1);return i?(0,U.jsx)(`div`,{ref:n,"data-sidebar":`resize-handle`,className:ia(`absolute inset-y-0 z-20 hidden w-1 cursor-col-resize transition-colors sm:block`,`hover:bg-kumo-brand/30 active:bg-kumo-brand/50`,r===`left`&&`right-0`,r===`right`&&`left-0`,e),onPointerDown:e=>{e.preventDefault(),a(!0),u.current=e.clientX,f.current=!c,d.current=(e.currentTarget.closest(`[data-sidebar-wrapper]`)?.querySelector(`[data-sidebar='sidebar']`))?.getBoundingClientRect().width??0;let t=()=>{a(!1),document.removeEventListener(`pointermove`,n),document.removeEventListener(`pointerup`,i)},n=e=>{let t=r===`left`?e.clientX-u.current:u.current-e.clientX,n=d.current+t;if(f.current){n>=l&&(f.current=!1,s(!0),o(n));return}if(n<l){s(!1),f.current=!0;return}o(n)},i=()=>{t()};document.addEventListener(`pointermove`,n),document.addEventListener(`pointerup`,i)},...t}):null});xS.displayName=`Sidebar.ResizeHandle`;function SS({className:e}){return(0,U.jsx)(Ta,{className:ia(`ml-auto size-4 shrink-0 text-kumo-subtle transition-transform duration-200`,`group-data-[panel-open]/menu-button:rotate-90`,`group-data-[state=collapsed]/sidebar:hidden`,e)})}SS.displayName=`Sidebar.MenuChevron`;var CS=Fb,wS=Lb,TS=(0,H.forwardRef)(({className:e,keepMounted:t=!0,...n},r)=>(0,U.jsx)(Vb,{ref:r,keepMounted:t,className:ia(`overflow-hidden`,`h-[var(--collapsible-panel-height)]`,`transition-[height] duration-250 ease-[cubic-bezier(0.77,0,0.175,1)]`,`motion-reduce:transition-none`,`data-[closed]:h-0 data-[starting-style]:h-0 data-[ending-style]:h-0`,e),...n}));TS.displayName=`Sidebar.CollapsibleContent`;var ES=Object.assign($x,{Provider:Qx,Header:eS,Content:tS,Footer:nS,Group:iS,GroupLabel:aS,GroupContent:oS,Menu:lS,MenuItem:uS,MenuButton:dS,MenuAction:fS,MenuBadge:pS,MenuSub:mS,MenuSubItem:hS,MenuSubButton:gS,Separator:_S,Input:vS,Trigger:yS,Rail:bS,ResizeHandle:xS,MenuChevron:SS,Collapsible:CS,CollapsibleTrigger:wS,CollapsibleContent:TS}),DS=e=>({...e,baseUrl:`/cdn-cgi/explorer/api`,throwOnError:!0}),OS={bodySerializer:e=>JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t)};Object.entries({$body_:`body`,$headers_:`headers`,$path_:`path`,$query_:`query`});var kS=({onRequest:e,onSseError:t,onSseEvent:n,responseTransformer:r,responseValidator:i,sseDefaultRetryDelay:a,sseMaxRetryAttempts:o,sseMaxRetryDelay:s,sseSleepFn:c,url:l,...u})=>{let d,f=c??(e=>new Promise(t=>setTimeout(t,e)));return{stream:async function*(){let c=a??3e3,p=0,m=u.signal??new AbortController().signal;for(;!m.aborted;){p++;let a=u.headers instanceof Headers?u.headers:new Headers(u.headers);d!==void 0&&a.set(`Last-Event-ID`,d);try{let t={redirect:`follow`,...u,body:u.serializedBody,headers:a,signal:m},o=new Request(l,t);e&&(o=await e(l,t));let s=await(u.fetch??globalThis.fetch)(o);if(!s.ok)throw Error(`SSE failed: ${s.status} ${s.statusText}`);if(!s.body)throw Error(`No body in SSE response`);let f=s.body.pipeThrough(new TextDecoderStream).getReader(),p=``,h=()=>{try{f.cancel()}catch{}};m.addEventListener(`abort`,h);try{for(;;){let{done:e,value:t}=await f.read();if(e)break;p+=t,p=p.replace(/\r\n/g,`
`).replace(/\r/g,`
`);let a=p.split(`
`);p=a.pop()??``;for(let e of a){let t=e.split(`
`),a=[],o;for(let e of t)if(e.startsWith(`data:`))a.push(e.replace(/^data:\s*/,``));else if(e.startsWith(`event:`))o=e.replace(/^event:\s*/,``);else if(e.startsWith(`id:`))d=e.replace(/^id:\s*/,``);else if(e.startsWith(`retry:`)){let t=Number.parseInt(e.replace(/^retry:\s*/,``),10);Number.isNaN(t)||(c=t)}let s,l=!1;if(a.length){let e=a.join(`
`);try{s=JSON.parse(e),l=!0}catch{s=e}}l&&(i&&await i(s),r&&(s=await r(s))),n?.({data:s,event:o,id:d,retry:c}),a.length&&(yield s)}}}finally{m.removeEventListener(`abort`,h),f.releaseLock()}break}catch(e){if(t?.(e),o!==void 0&&p>=o)break;await f(Math.min(c*2**(p-1),s??3e4))}}}()}},AS=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},jS=e=>{switch(e){case`form`:return`,`;case`pipeDelimited`:return`|`;case`spaceDelimited`:return`%20`;default:return`,`}},MS=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},NS=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let t=(e?i:i.map(e=>encodeURIComponent(e))).join(jS(r));switch(r){case`label`:return`.${t}`;case`matrix`:return`;${n}=${t}`;case`simple`:return t;default:return`${n}=${t}`}}let a=AS(r),o=i.map(t=>r===`label`||r===`simple`?e?t:encodeURIComponent(t):PS({allowReserved:e,name:n,value:t})).join(a);return r===`label`||r===`matrix`?a+o:o},PS=({allowReserved:e,name:t,value:n})=>{if(n==null)return``;if(typeof n==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},FS=({allowReserved:e,explode:t,name:n,style:r,value:i,valueOnly:a})=>{if(i instanceof Date)return a?i.toISOString():`${n}=${i.toISOString()}`;if(r!==`deepObject`&&!t){let t=[];Object.entries(i).forEach(([n,r])=>{t=[...t,n,e?r:encodeURIComponent(r)]});let a=t.join(`,`);switch(r){case`form`:return`${n}=${a}`;case`label`:return`.${a}`;case`matrix`:return`;${n}=${a}`;default:return a}}let o=MS(r),s=Object.entries(i).map(([t,i])=>PS({allowReserved:e,name:r===`deepObject`?`${n}[${t}]`:t,value:i})).join(o);return r===`label`||r===`matrix`?o+s:s},IS=/\{[^{}]+\}/g,LS=({path:e,url:t})=>{let n=t,r=t.match(IS);if(r)for(let t of r){let r=!1,i=t.substring(1,t.length-1),a=`simple`;i.endsWith(`*`)&&(r=!0,i=i.substring(0,i.length-1)),i.startsWith(`.`)?(i=i.substring(1),a=`label`):i.startsWith(`;`)&&(i=i.substring(1),a=`matrix`);let o=e[i];if(o==null)continue;if(Array.isArray(o)){n=n.replace(t,NS({explode:r,name:i,style:a,value:o}));continue}if(typeof o==`object`){n=n.replace(t,FS({explode:r,name:i,style:a,value:o,valueOnly:!0}));continue}if(a===`matrix`){n=n.replace(t,`;${PS({name:i,value:o})}`);continue}let s=encodeURIComponent(a===`label`?`.${o}`:o);n=n.replace(t,s)}return n},RS=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let a=i.startsWith(`/`)?i:`/${i}`,o=(e??``)+a;t&&(o=LS({path:t,url:o}));let s=n?r(n):``;return s.startsWith(`?`)&&(s=s.substring(1)),s&&(o+=`?${s}`),o};function zS(e){let t=e.body!==void 0;if(t&&e.bodySerializer)return`serializedBody`in e?e.serializedBody!==void 0&&e.serializedBody!==``?e.serializedBody:null:e.body===``?null:e.body;if(t)return e.body}var BS=async(e,t)=>{let n=typeof t==`function`?await t(e):t;if(n)return e.scheme===`bearer`?`Bearer ${n}`:e.scheme===`basic`?`Basic ${btoa(n)}`:n},VS=({parameters:e={},...t}={})=>n=>{let r=[];if(n&&typeof n==`object`)for(let i in n){let a=n[i];if(a==null)continue;let o=e[i]||t;if(Array.isArray(a)){let e=NS({allowReserved:o.allowReserved,explode:!0,name:i,style:`form`,value:a,...o.array});e&&r.push(e)}else if(typeof a==`object`){let e=FS({allowReserved:o.allowReserved,explode:!0,name:i,style:`deepObject`,value:a,...o.object});e&&r.push(e)}else{let e=PS({allowReserved:o.allowReserved,name:i,value:a});e&&r.push(e)}}return r.join(`&`)},HS=e=>{if(!e)return`stream`;let t=e.split(`;`)[0]?.trim();if(t){if(t.startsWith(`application/json`)||t.endsWith(`+json`))return`json`;if(t===`multipart/form-data`)return`formData`;if([`application/`,`audio/`,`image/`,`video/`].some(e=>t.startsWith(e)))return`blob`;if(t.startsWith(`text/`))return`text`}},US=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get(`Cookie`)?.includes(`${t}=`)):!1,WS=async({security:e,...t})=>{for(let n of e){if(US(t,n.name))continue;let e=await BS(n,t.auth);if(!e)continue;let r=n.name??`Authorization`;switch(n.in){case`query`:t.query||={},t.query[r]=e;break;case`cookie`:t.headers.append(`Cookie`,`${r}=${e}`);break;default:t.headers.set(r,e);break}}},GS=e=>RS({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer==`function`?e.querySerializer:VS(e.querySerializer),url:e.url}),KS=(e,t)=>{let n={...e,...t};return n.baseUrl?.endsWith(`/`)&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=JS(e.headers,t.headers),n},qS=e=>{let t=[];return e.forEach((e,n)=>{t.push([n,e])}),t},JS=(...e)=>{let t=new Headers;for(let n of e){if(!n)continue;let e=n instanceof Headers?qS(n):Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,typeof r==`object`?JSON.stringify(r):r)}return t},YS=class{fns=[];clear(){this.fns=[]}eject(e){let t=this.getInterceptorIndex(e);this.fns[t]&&(this.fns[t]=null)}exists(e){let t=this.getInterceptorIndex(e);return!!this.fns[t]}getInterceptorIndex(e){return typeof e==`number`?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,t){let n=this.getInterceptorIndex(e);return this.fns[n]?(this.fns[n]=t,e):!1}use(e){return this.fns.push(e),this.fns.length-1}},XS=()=>({error:new YS,request:new YS,response:new YS}),ZS=VS({allowReserved:!1,array:{explode:!0,style:`form`},object:{explode:!0,style:`deepObject`}}),QS={"Content-Type":`application/json`},$S=(e={})=>({...OS,headers:QS,parseAs:`auto`,querySerializer:ZS,...e}),eC=((e={})=>{let t=KS($S(),e),n=()=>({...t}),r=e=>(t=KS(t,e),n()),i=XS(),a=async e=>{let n={...t,...e,fetch:e.fetch??t.fetch??globalThis.fetch,headers:JS(t.headers,e.headers),serializedBody:void 0};return n.security&&await WS({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody===``)&&n.headers.delete(`Content-Type`),{opts:n,url:GS(n)}},o=async e=>{let{opts:t,url:n}=await a(e),r={redirect:`follow`,...t,body:zS(t)},o=new Request(n,r);for(let e of i.request.fns)e&&(o=await e(o,t));let s=t.fetch,c;try{c=await s(o)}catch(e){let n=e;for(let r of i.error.fns)r&&(n=await r(e,void 0,o,t));if(n||={},t.throwOnError)throw n;return t.responseStyle===`data`?void 0:{error:n,request:o,response:void 0}}for(let e of i.response.fns)e&&(c=await e(c,o,t));let l={request:o,response:c};if(c.ok){let e=(t.parseAs===`auto`?HS(c.headers.get(`Content-Type`)):t.parseAs)??`json`;if(c.status===204||c.headers.get(`Content-Length`)===`0`){let n;switch(e){case`arrayBuffer`:case`blob`:case`text`:n=await c[e]();break;case`formData`:n=new FormData;break;case`stream`:n=c.body;break;default:n={};break}return t.responseStyle===`data`?n:{data:n,...l}}let n;switch(e){case`arrayBuffer`:case`blob`:case`formData`:case`text`:n=await c[e]();break;case`json`:{let e=await c.text();n=e?JSON.parse(e):{};break}case`stream`:return t.responseStyle===`data`?c.body:{data:c.body,...l}}return e===`json`&&(t.responseValidator&&await t.responseValidator(n),t.responseTransformer&&(n=await t.responseTransformer(n))),t.responseStyle===`data`?n:{data:n,...l}}let u=await c.text(),d;try{d=JSON.parse(u)}catch{}let f=d??u,p=f;for(let e of i.error.fns)e&&(p=await e(f,c,o,t));if(p||={},t.throwOnError)throw p;return t.responseStyle===`data`?void 0:{error:p,...l}},s=e=>t=>o({...t,method:e}),c=e=>async t=>{let{opts:n,url:r}=await a(t);return kS({...n,body:n.body,headers:n.headers,method:e,onRequest:async(e,t)=>{let r=new Request(e,t);for(let e of i.request.fns)e&&(r=await e(r,n));return r},serializedBody:zS(n),url:r})};return{buildUrl:e=>GS({...t,...e}),connect:s(`CONNECT`),delete:s(`DELETE`),get:s(`GET`),getConfig:n,head:s(`HEAD`),interceptors:i,options:s(`OPTIONS`),patch:s(`PATCH`),post:s(`POST`),put:s(`PUT`),request:o,setConfig:r,sse:{connect:c(`CONNECT`),delete:c(`DELETE`),get:c(`GET`),head:c(`HEAD`),options:c(`OPTIONS`),patch:c(`PATCH`),post:c(`POST`),put:c(`PUT`),trace:c(`TRACE`)},trace:s(`TRACE`)}})(DS($S({baseUrl:`/cdn-cgi/explorer/api`}))),tC=e=>(e.client??eC).get({url:`/storage/kv/namespaces/{namespace_id}/keys`,...e}),nC=e=>(e.client??eC).delete({url:`/storage/kv/namespaces/{namespace_id}/values/{key_name}`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),rC=e=>(e.client??eC).get({url:`/storage/kv/namespaces/{namespace_id}/values/{key_name}`,...e}),iC=e=>(e.client??eC).put({bodySerializer:null,url:`/storage/kv/namespaces/{namespace_id}/values/{key_name}`,...e,headers:{"Content-Type":`application/octet-stream`,...e.headers}}),aC=e=>(e.client??eC).post({url:`/d1/database/{database_id}/raw`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),oC=e=>(e?.client??eC).get({url:`/workers/durable_objects/namespaces`,...e}),sC=e=>(e.client??eC).get({url:`/workers/durable_objects/namespaces/{id}/objects`,...e}),cC=e=>(e.client??eC).delete({url:`/r2/buckets/{bucket_name}/objects`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),lC=e=>(e.client??eC).get({url:`/r2/buckets/{bucket_name}/objects`,...e}),uC=e=>(e.client??eC).get({url:`/r2/buckets/{bucket_name}/objects/{object_key}`,...e}),dC=e=>(e.client??eC).put({bodySerializer:null,url:`/r2/buckets/{bucket_name}/objects/{object_key}`,...e,headers:{"content-type":`application/octet-stream`,...e.headers}}),fC=e=>(e.client??eC).post({url:`/workers/durable_objects/namespaces/{namespace_id}/query`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),pC=e=>(e?.client??eC).get({url:`/local/workers`,...e}),mC=e=>(e.client??eC).delete({url:`/workflows/{workflow_name}`,...e}),hC=e=>(e.client??eC).get({url:`/workflows/{workflow_name}/instances`,...e}),gC=e=>(e.client??eC).post({url:`/workflows/{workflow_name}/instances`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),_C=e=>(e.client??eC).delete({url:`/workflows/{workflow_name}/instances/{instance_id}`,...e}),vC=e=>(e.client??eC).get({url:`/workflows/{workflow_name}/instances/{instance_id}`,...e}),yC=e=>(e.client??eC).patch({url:`/workflows/{workflow_name}/instances/{instance_id}/status`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),bC=e=>(e.client??eC).post({url:`/workflows/{workflow_name}/instances/{instance_id}/events/{event_type}`,...e,headers:{"Content-Type":`application/json`,...e.headers}});function xC(e){return(0,U.jsxs)(`div`,{className:`text-text-secondary flex flex-1 flex-col items-center justify-center space-y-4 p-12 text-center`,children:[(0,U.jsx)(`h2`,{className:`text-text text-3xl font-bold`,children:`Page not found`}),(0,U.jsx)(`p`,{className:`text-text-secondary text-sm font-light`,children:`The resource you're looking for doesn't exist or has been removed.`}),(0,U.jsx)(nr,{to:`/`,children:(0,U.jsx)(fx,{variant:`secondary`,children:`Go home`})})]})}var SC=e=>(0,U.jsx)(`svg`,{width:16,height:16,viewBox:`-4 -2 73 68`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,U.jsx)(`path`,{fill:`currentColor`,d:`m23.6 22.2 3.03 1.75v3.5L23.6 29.2l-3.03-1.75v-3.5zM20.06 49l3.54-3.54L27.14 49l-3.54 3.54zm3.54-14.7c.593 0 1.17.176 1.67.506.493.33.878.798 1.1 1.35a3 3 0 0 1-.65 3.27c-.42.42-.954.705-1.54.821a3 3 0 0 1-1.73-.171 3.04 3.04 0 0 1-1.35-1.1 3 3 0 0 1-.506-1.67c0-.796.316-1.56.879-2.12a3 3 0 0 1 2.12-.879zM10.3 11.2l6.42-4.89 1.21-.37h29l1.19.39 6.61 4.89.82 1.61v38L55 52.21l-4.83 5.11-1.46.63h-31.7l-1.37-.54-5.48-5.11-.64-1.47v-38zm3.21 25.4 4.47 4.94h.056v4h-1.83l-2.7-3v7.39l4.26 4h30l3.7-3.91V42.3l-3.67 3.24h-18.6v-4h17.2l5.19-4.61v-7.44l-3.67 3.25h-18.7v-4h17.2l5.19-4.6v-6.92l-3.67 3.26h-31.6l-2.74-2.8v6.12l4.47 4.94h.056v4h-1.83l-2.7-3zm32.7-26.7h-27.6l-4.07 3.11 3.4 3.48h28.4l4-3.56z`})}),CC=e=>(0,U.jsx)(`svg`,{width:16,height:16,viewBox:`-4 -2 72 68`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,U.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M32.214 6h-.202a26 26 0 1 0 .327 52q.266 0 .527-.014A26 26 0 0 0 58.012 32 26 26 0 0 0 32.865 6.014a10 10 0 0 0-.65-.013m-9.503 6.063A22 22 0 0 0 10.104 30h7.804q.068-1.79.252-3.51l3.998.24A46 46 0 0 0 21.91 30H30V10.519c-1.784.81-3.475 2.582-4.9 5.41q-.139.278-.274.567l-3.873-1.145q.276-.627.575-1.221c.363-.72.757-1.412 1.182-2.067M30 34h-8.09c.226 5.584 1.392 10.5 3.19 14.071 1.425 2.829 3.116 4.6 4.9 5.41zm-7.29 17.937a22 22 0 0 1-1.182-2.067c-2.131-4.233-3.393-9.795-3.62-15.87h-7.806A22 22 0 0 0 22.71 51.937m19.554-.472A22 22 0 0 0 53.921 34h-7.15a51 51 0 0 1-.26 3.589l-3.998-.24q.185-1.627.255-3.349H34v19.742c2.032-.641 3.973-2.486 5.577-5.671q.129-.255.252-.517l3.874 1.145q-.267.6-.553 1.171a23 23 0 0 1-.885 1.595M42.768 30H34V10.258c2.032.641 3.973 2.486 5.577 5.671 1.799 3.572 2.965 8.487 3.191 14.071m4.003 0c-.227-6.075-1.49-11.637-3.621-15.87a22 22 0 0 0-.885-1.595A22 22 0 0 1 53.921 30z`})}),wC=e=>(0,U.jsxs)(`svg`,{width:16,height:16,viewBox:`-4 -2 72 68`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,U.jsx)(`path`,{fill:`currentColor`,d:`M22 44.95h-7v-4h7zm-7-8h7v-4h-7zm7-8h-7v-4h7zm4 16h23v-4H26zm23-8H26v-4h23zm-23-8h23v-4H26z`}),(0,U.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`m6 12 2-2h19l1.675.907 3.408 5.225H56l2 2V52l-2 2H8l-2-2zm4 2v36h44V20.132H31l-1.675-.908L25.917 14z`})]}),TC=e=>(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:20,height:20,viewBox:`0 0 40 40`,fill:`none`,...e,children:(0,U.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,d:`M30.289 6.423c-2.43-.813-5.958-1.362-9.977-1.362-4.018 0-7.545.549-9.976 1.362-1.228.41-2.033.842-2.48 1.195q-.14.111-.204.18c.052.171.196.395.562.67.524.394 1.372.783 2.563 1.119 2.368.666 5.731 1.023 9.536 1.023s7.167-.357 9.535-1.023c1.191-.336 2.04-.725 2.563-1.119.366-.275.51-.499.562-.67a2 2 0 0 0-.204-.18c-.447-.353-1.252-.784-2.48-1.195m-20.24 5.624c-.885-.25-1.71-.552-2.424-.922v4.393c0 .196.097.514.625.941.535.433 1.391.869 2.576 1.252 2.36.764 5.71 1.222 9.486 1.222 3.778 0 7.128-.458 9.487-1.222 1.185-.383 2.041-.82 2.576-1.252.528-.427.625-.745.625-.94v-4.394c-.715.37-1.539.673-2.424.922-2.7.76-6.336 1.124-10.264 1.124s-7.564-.364-10.263-1.124m25.576 3.471V7.622c0-2.829-6.856-5.122-15.313-5.122C11.857 2.5 5 4.793 5 7.622v24.756c0 2.829 6.856 5.122 15.313 5.122 8.456 0 15.312-2.293 15.312-5.122zM33 19.134c-.7.393-1.505.726-2.375 1.008-2.708.877-6.358 1.352-10.313 1.352-3.954 0-7.604-.475-10.312-1.352-.87-.282-1.676-.615-2.375-1.008v4.28c0 .196.097.514.625.942.535.432 1.391.868 2.576 1.252 2.36.763 5.71 1.221 9.486 1.221 3.778 0 7.128-.458 9.487-1.221 1.185-.384 2.041-.82 2.576-1.252.528-.428.625-.746.625-.941v-4.28Zm-23 8.904c-.87-.281-1.676-.615-2.375-1.007v5.143c.044.048.116.117.231.208.447.353 1.252.785 2.48 1.195 2.43.813 5.958 1.362 9.976 1.362s7.546-.549 9.977-1.362c1.228-.41 2.033-.842 2.48-1.195a2 2 0 0 0 .231-.208v-5.143c-.7.392-1.505.726-2.375 1.007-2.708.877-6.358 1.352-10.313 1.352-3.954 0-7.604-.475-10.312-1.352m23.06 4.06-.01.016zm-25.495 0 .01.016zm3.997-15.726c.725 0 1.313-.573 1.313-1.28s-.588-1.281-1.313-1.281c-.724 0-1.312.573-1.312 1.28s.588 1.281 1.313 1.281Zm1.313 6.83c0 .706-.588 1.28-1.313 1.28-.724 0-1.312-.574-1.312-1.28 0-.708.588-1.281 1.313-1.281.724 0 1.312.573 1.312 1.28Zm-1.313 9.176c.725 0 1.313-.573 1.313-1.28s-.588-1.28-1.313-1.28c-.724 0-1.312.572-1.312 1.28 0 .707.588 1.28 1.313 1.28Z`,clipRule:`evenodd`})}),EC=e=>(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 17`,fill:`currentColor`,...e,children:(0,U.jsx)(`path`,{d:`m2 11-.5.5v2.75l.5.5h2.75l.5-.5V11.5l-.5-.5H2Zm2.25 2.75H2.5V12h1.75v1.75ZM7.93 2 5.68 4.25 7.93 6.5l2.25-2.25L7.93 2ZM3.76 9.56h8.34v1.14h.98V8.57H8.43v-1.6h-1v1.6H2.78v2.13h.98V9.56ZM12.5 11a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm0 3a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z`})}),DC=`local-explorer.sidebar.groups.v1`,OC=`local-explorer.sidebar.open.v1`,kC=[`d1`,`do`,`kv`,`r2`,`workflows`],AC={d1:!0,do:!0,kv:!0,r2:!0,workflows:!0};function jC(){try{let e=localStorage.getItem(DC);if(e===null)return AC;let t=JSON.parse(e);if(typeof t!=`object`||!t||Array.isArray(t))return AC;let n=t,r={...AC};for(let e of kC)typeof n[e]==`boolean`&&(r[e]=n[e]);return r}catch{return AC}}function MC(e){try{localStorage.setItem(DC,JSON.stringify(e))}catch{}}function NC(){try{let e=localStorage.getItem(OC);if(e===null)return!0;let t=JSON.parse(e);return typeof t==`boolean`?t:!0}catch{return!0}}function PC(e){try{localStorage.setItem(OC,JSON.stringify(e))}catch{}}var FC=`local-explorer.theme.v1`,IC=[`light`,`dark`,`system`];function LC(e){return IC[(IC.indexOf(e)+1)%IC.length]??`system`}function RC(e,t){return e===`system`?t?`dark`:`light`:e}function zC(){try{let e=localStorage.getItem(FC);return e!==null&&HC(e)?e:`system`}catch{return`system`}}function BC(e){try{localStorage.setItem(FC,e)}catch{}}function VC(e,t){document.documentElement.dataset.mode=RC(e,t)}function HC(e){return IC.includes(e)}function UC({emptyLabel:e,icon:t,items:n,title:r}){let i=n.some(e=>e.isActive);return(0,U.jsxs)(wb.Root,{children:[(0,U.jsx)(wb.Trigger,{render:(0,U.jsx)(ES.MenuButton,{active:i,icon:t})}),(0,U.jsx)(wb.Portal,{children:(0,U.jsx)(wb.Positioner,{align:`start`,className:`z-100`,side:`right`,sideOffset:8,children:(0,U.jsxs)(wb.Popup,{className:`max-h-72 min-w-48 overflow-y-auto rounded-lg border border-kumo-fill bg-kumo-base shadow-[0_4px_12px_rgba(0,0,0,0.15)] transition-[opacity,transform] duration-150 data-ending-style:-translate-x-1 data-ending-style:opacity-0 data-starting-style:-translate-x-1 data-starting-style:opacity-0`,children:[(0,U.jsx)(`div`,{className:`border-b border-kumo-fill px-3 py-2`,children:(0,U.jsx)(`span`,{className:`text-xs font-medium text-kumo-subtle`,children:r})}),(0,U.jsx)(`div`,{className:`p-1`,children:n.length===0?(0,U.jsx)(`div`,{className:`px-2 py-1.5 text-sm text-kumo-subtle italic`,children:e}):n.map(e=>(0,U.jsx)(nr,{className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors outline-none select-none ${e.isActive?`bg-kumo-elevated font-medium text-kumo-default`:`text-kumo-default hover:bg-kumo-elevated`}`,params:e.link.params,search:e.link.search,to:e.link.to,children:(0,U.jsx)(`span`,{className:`truncate`,children:e.label})},e.id))})]})})})]})}var WC=new Set([`__router-worker__`,`__asset-worker__`,`__vite_proxy_worker__`]);function GC(e){return WC.has(e)}function KC(e){return e.filter(e=>!GC(e.name))}function qC(e,t){let n=KC(e),r=new URLSearchParams(t).get(`worker`),i=n.find(e=>e.isSelf)?.name??n[0]?.name,a=r&&n.some(e=>e.name===r)?r:i;return n.find(e=>e.name===a)}function JC({workers:e,selectedWorker:t,onWorkerChange:n}){let r=Jx(),[i,a]=(0,H.useState)(!1),o=e=>{e!==null&&n(e)},s=e.find(e=>e.isSelf),c=(0,U.jsxs)(Uy.Root,{onOpenChange:a,onValueChange:o,open:i,value:t,children:[r.open?(0,U.jsxs)(Uy.Trigger,{className:`flex w-full cursor-pointer items-center justify-between gap-2 rounded-md border border-kumo-fill bg-kumo-base px-3 py-2 text-sm text-kumo-default transition-colors hover:bg-kumo-elevated data-popup-open:border-kumo-brand`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2 truncate`,children:[(0,U.jsx)(Fa,{className:`h-4 w-4 shrink-0 text-kumo-subtle`}),(0,U.jsx)(`span`,{className:`truncate`,children:t})]}),(0,U.jsx)(Uy.Icon,{children:(0,U.jsx)(Ea,{className:`h-3.5 w-3.5 shrink-0 text-kumo-subtle`})})]}):(0,U.jsx)(Uy.Trigger,{"aria-label":`Selected worker: ${t}`,className:`flex cursor-pointer items-center justify-center rounded-md p-2 text-kumo-subtle transition-colors hover:bg-kumo-fill hover:text-kumo-default data-popup-open:bg-kumo-fill data-popup-open:text-kumo-default`,children:(0,U.jsx)(Fa,{className:`h-4 w-4 shrink-0`})}),(0,U.jsx)(Uy.Portal,{children:(0,U.jsx)(Uy.Positioner,{align:`start`,alignItemWithTrigger:!1,className:`z-100`,side:r.open?`bottom`:`right`,sideOffset:r.open?4:8,children:(0,U.jsx)(Uy.Popup,{className:`max-h-72 min-w-48 overflow-hidden rounded-lg border border-kumo-fill bg-kumo-base shadow-[0_4px_12px_rgba(0,0,0,0.15)] transition-[opacity,transform] duration-150 data-ending-style:-translate-y-1 data-ending-style:opacity-0 data-starting-style:-translate-y-1 data-starting-style:opacity-0`,children:(0,U.jsx)(Uy.List,{className:`max-h-72 overflow-y-auto p-1`,children:e.map(e=>{let n=t===e.name,r=n?Da:Fa;return(0,U.jsxs)(Uy.Item,{className:`flex w-full cursor-pointer items-center gap-2 rounded-md px-2 py-2 text-sm text-kumo-default transition-colors outline-none select-none data-highlighted:bg-kumo-elevated`,value:e.name,children:[(0,U.jsx)(`span`,{className:`flex w-4 items-center`,children:(0,U.jsx)(r,{className:`h-3.5 w-3.5 ${n?``:`text-kumo-subtle`}`})}),(0,U.jsx)(Uy.ItemText,{children:(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.name,e.isSelf&&s&&(0,U.jsx)(`span`,{className:`rounded bg-kumo-brand/10 px-1.5 py-0.5 text-[10px] font-medium text-kumo-link`,children:`Host`})]})})]},e.name)})})})})})]});return r.open?(0,U.jsx)(`div`,{className:`px-3`,children:c}):(0,U.jsx)(`div`,{className:`flex justify-center py-2`,children:(0,U.jsx)(rx,{content:t,side:`right`,children:c})})}var YC={light:{icon:Na,label:`Light`},dark:{icon:Aa,label:`Dark`},system:{icon:ka,label:`System`}};function XC({bindings:e,currentPath:t,onCycleTheme:n,onWorkerChange:r,selectedWorker:i,themeMode:a,workers:o}){let s=Mn(),c=Jx(),[l,u]=(0,H.useState)(jC),d=(0,H.useCallback)((e,t)=>{u(n=>{let r={...n,[e]:t};return MC(r),r})},[]),f=o.length>1,p=o.length>1?{worker:i}:{},m=e?.d1??[],h=(e?.do??[]).filter(e=>e.useSqlite),g=e?.kv??[],_=e?.r2??[],v=e?.workflows??[],y=[{emptyLabel:`No databases`,groupId:`d1`,icon:SC,items:m.map(e=>({id:e.id,isActive:t===`/d1/${e.id}`,label:e.bindingName,link:{params:{databaseId:e.id},search:{table:void 0,...p},to:`/d1/$databaseId`}})),title:`D1 Databases`},{emptyLabel:`No SQLite namespaces`,groupId:`do`,icon:CC,items:h.map(e=>({id:e.id,isActive:t===`/do/${e.className}`||t.startsWith(`/do/${e.className}/`),label:e.className,link:{params:{className:e.className},search:p,to:`/do/$className`}})),title:`Durable Objects`},{emptyLabel:`No namespaces`,groupId:`kv`,icon:wC,items:g.map(e=>({id:e.id,isActive:t===`/kv/${e.id}`,label:e.bindingName,link:{params:{namespaceId:e.id},search:p,to:`/kv/$namespaceId`}})),title:`KV Namespaces`},{emptyLabel:`No buckets`,groupId:`r2`,icon:TC,items:_.map(e=>({id:e.id,isActive:t===`/r2/${e.id}`||t.startsWith(`/r2/${e.id}/`),label:e.bindingName,link:{params:{bucketName:e.id},search:p,to:`/r2/$bucketName`}})),title:`R2 Buckets`},{emptyLabel:`No workflows`,groupId:`workflows`,icon:EC,items:v.map(e=>({id:e.id,isActive:t===`/workflows/${e.id}`||t.startsWith(`/workflows/${e.id}/`),label:e.bindingName,link:{params:{workflowName:e.id},search:p,to:`/workflows/$workflowName`}})),title:`Workflows`}];return(0,U.jsxs)(ES,{className:`bg-kumo-elevated`,children:[(0,U.jsx)(ES.Header,{className:`min-h-14.5 border-b`,children:(0,U.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[(0,U.jsxs)(`a`,{className:`box-border flex items-center gap-2.5 px-1`,href:`/cdn-cgi/explorer/`,children:[(0,U.jsx)(Bx,{className:ia(`shrink-0 transition-all duration-200`,c.open?`h-8 w-8`:`h-6 w-6`),variant:`glyph`}),c.open?(0,U.jsxs)(`div`,{className:`flex flex-col gap-px`,children:[(0,U.jsx)(`h3`,{className:`text-text text-sm leading-tight font-semibold`,children:`Local Explorer`}),(0,U.jsx)(`p`,{className:`text-text-secondary text-[9px] font-medium tracking-wide uppercase`,children:`Cloudflare DevTools`})]}):null]}),c.open?(0,U.jsx)(la,{className:`mr-1`,variant:`beta`,children:`Beta`}):null]})}),(0,U.jsxs)(ES.Content,{children:[f&&(0,U.jsx)(JC,{workers:o,selectedWorker:i,onWorkerChange:r}),c.open?(0,U.jsx)(ES.MenuItem,{className:`space-y-1`,children:y.map(e=>(0,U.jsxs)(ES.Collapsible,{open:l[e.groupId],onOpenChange:t=>{d(e.groupId,t)},children:[(0,U.jsx)(ES.CollapsibleTrigger,{render:(0,U.jsxs)(ES.MenuButton,{icon:(0,U.jsx)(e.icon,{width:20,height:20}),children:[e.title,` `,(0,U.jsx)(ES.MenuChevron,{})]})}),(0,U.jsx)(ES.CollapsibleContent,{children:(0,U.jsx)(ES.MenuSub,{className:`mt-1 ml-5.5 space-y-0.5`,children:e.items.length===0?(0,U.jsx)(`div`,{className:`text-text-secondary ml-8 px-2 py-1.5 text-sm italic`,children:e.emptyLabel}):e.items.map(e=>(0,U.jsx)(ES.MenuSubButton,{active:e.isActive,className:`cursor-pointer`,href:s.buildLocation(e.link).href,children:e.label},e.id))})})]},e.groupId))}):(0,U.jsx)(ES.MenuItem,{className:`space-y-1`,children:y.map(e=>(0,U.jsx)(UC,{emptyLabel:e.emptyLabel,icon:(0,U.jsx)(e.icon,{width:20,height:20}),items:e.items,title:e.title},e.groupId))})]}),(0,U.jsxs)(ES.Footer,{className:`gap-1`,children:[(()=>{let{icon:e,label:t}=YC[a],r=YC[LC(a)].label;return(0,U.jsx)(ES.MenuButton,{"aria-label":`Theme: ${t}. Switch to ${r}`,className:`px-2`,icon:(0,U.jsx)(e,{size:18,weight:`bold`}),onClick:n,tooltip:`Theme: ${t}`,type:`button`})})(),(0,U.jsx)(ES.Trigger,{className:`cursor-pointer hover:bg-kumo-tint`})]})]})}var ZC=lr({component:QC,notFoundComponent:xC,loader:async()=>({workers:(await pC()).data?.result??[]})});function QC(){let e=ZC.useLoaderData(),t=Nn(),n=t.location.pathname,r=Mn(),[i,a]=(0,H.useState)(NC),[o,s]=(0,H.useState)(zC),c=(0,H.useCallback)(e=>{a(e),PC(e)},[]),l=(0,H.useCallback)(()=>{let e=LC(o);BC(e),VC(e,window.matchMedia(`(prefers-color-scheme: dark)`).matches),s(e)},[o]),u=(0,H.useMemo)(()=>KC(e.workers),[e.workers]),d=(0,H.useMemo)(()=>qC(e.workers,t.location.searchStr),[e.workers,t.location.searchStr]),f=d?.name??``,p=(0,H.useCallback)(e=>{let n=new URLSearchParams(t.location.searchStr);n.set(`worker`,e),r.history.push(`${window.location.pathname}?${n.toString()}`)},[r,t.location.searchStr]);return(0,U.jsx)(Ax,{children:(0,U.jsx)(`div`,{className:`flex h-screen`,children:(0,U.jsxs)(ES.Provider,{onOpenChange:c,open:i,resizable:!0,children:[(0,U.jsx)(XC,{bindings:d?.bindings,currentPath:n,onCycleTheme:l,onWorkerChange:p,selectedWorker:f,themeMode:o,workers:u}),(0,U.jsx)(`main`,{className:`flex flex-1 flex-col overflow-y-auto`,children:(0,U.jsx)(Tr,{})})]})})})}var $C=`You have access to local Cloudflare services (KV, R2, D1, Durable Objects, and Workflows) for this app via the Explorer API.
API endpoint: {{apiEndpoint}}
Fetch the OpenAPI schema from {{apiEndpoint}} to discover available operations. Use these endpoints to list, query, and manage local resources during development.`;function ew(e,t){return`${e}${t}`}function tw(e){return $C.replaceAll(`{{apiEndpoint}}`,e)}async function nw(e,t=navigator.clipboard){await t.writeText(e)}var rw=`modulepreload`,iw=function(e){return`/cdn-cgi/explorer/`+e},aw={},ow=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=iw(t,n),t in aw)return;aw[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:rw,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},sw=ur(`/`)({component:mr(()=>ow(()=>import(`./routes-oEXSY3AA.js`),__vite__mapDeps([0,1])),`component`),loader:()=>({prompt:tw(ew(window.location.origin,`/cdn-cgi/explorer/api`))})}),cw=ur(`/workflows/$workflowName`)({component:mr(()=>ow(()=>import(`./_workflowName-Bb8rtCbO.js`),[]),`component`),errorComponent:mr(()=>ow(()=>import(`./_workflowName-Dvp2E4Ej.js`),__vite__mapDeps([2,3])),`errorComponent`),loader:async({params:e})=>({workflowName:e.workflowName}),validateSearch:e=>({worker:typeof e.worker==`string`?e.worker:void 0})}),lw=ur(`/r2/$bucketName`)({component:mr(()=>ow(()=>import(`./_bucketName-CmaXpnbr.js`),[]),`component`),errorComponent:mr(()=>ow(()=>import(`./_bucketName-BZzOJiLm.js`),__vite__mapDeps([4,3])),`errorComponent`),validateSearch:e=>({worker:typeof e.worker==`string`?e.worker:void 0})}),uw=ur(`/kv/$namespaceId`)({component:mr(()=>ow(()=>import(`./_namespaceId-Bm0P_JmR.js`),__vite__mapDeps([5,6,1,7,8,9,10,11,12,13,14])),`component`),errorComponent:mr(()=>ow(()=>import(`./_namespaceId-Db7qPt77.js`),__vite__mapDeps([15,3])),`errorComponent`),loader:async({params:e})=>{let t=await tC({path:{namespace_id:e.namespaceId},query:{limit:50}}),n=t.data?.result??[],r=new Map;n.length>0&&(r=await fw(e.namespaceId,n));let i=t.data?.result_info?.cursor??null;return{cursor:i,entries:n.map(e=>({key:e,value:r.get(e)??null})),hasMore:!!i}},validateSearch:e=>({worker:typeof e.worker==`string`?e.worker:void 0})});function dw(e){if(typeof e!=`object`||!e||!(`errors`in e))return!1;let{errors:t}=e;return t?.some(e=>e.code===10009)??!1}async function fw(e,t){let n=new Map;return await Promise.all(t.map(async t=>{try{let r=await rC({path:{namespace_id:e,key_name:t.name},parseAs:`text`});n.set(t,r.data??null)}catch(e){if(dw(e)){n.set(t,null);return}throw e}})),n}var pw=ur(`/do/$className`)({component:mr(()=>ow(()=>import(`./_className-Bq4IeO52.js`),[]),`component`),errorComponent:mr(()=>ow(()=>import(`./_className-Clyn4ODQ.js`),__vite__mapDeps([16,3])),`errorComponent`),loader:async({params:e})=>{let t=((await oC()).data?.result??[]).find(t=>t.class===e.className||t.name===e.className||t.id===e.className);if(!t?.id)throw Qe();return{className:e.className,namespaceId:t.id}},notFoundComponent:mr(()=>ow(()=>import(`./_className-C2ILN6Rp.js`),[]),`notFoundComponent`),validateSearch:e=>({worker:typeof e.worker==`string`?e.worker:void 0})});function mw(e,t){if(e===t)return!0;if(e===null||t===null||typeof e!=`object`||typeof t!=`object`||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!mw(e[r],t[r]))return!1;return!0}var hw=1024,gw=0,_w=class{constructor(e,t){this.from=e,this.to=t}},vw=class{constructor(e={}){this.id=gw++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=xw.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};vw.closedBy=new vw({deserialize:e=>e.split(` `)}),vw.openedBy=new vw({deserialize:e=>e.split(` `)}),vw.group=new vw({deserialize:e=>e.split(` `)}),vw.isolate=new vw({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),vw.contextHash=new vw({perNode:!0}),vw.lookAhead=new vw({perNode:!0}),vw.mounted=new vw({perNode:!0});var yw=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[vw.mounted.id]}},bw=Object.create(null),xw=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):bw,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(vw.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(vw.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};xw.none=new xw(``,Object.create(null),0,8);var Sw=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new xw(e.name,r,e.id,e.flags):e)}return new e(n)}},Cw=new WeakMap,ww=new WeakMap,Tw;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(Tw||={});var Ew=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=yw.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new Bw(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new Bw(Cw.get(this)||this.topNode);return r.moveTo(e,t),Cw.set(this,r._tree),r}get topNode(){return new Mw(this,0,0,null)}resolve(e,t=0){let n=Aw(Cw.get(this)||this.topNode,e,t,!1);return Cw.set(this,n),n}resolveInner(e,t=0){let n=Aw(ww.get(this)||this.topNode,e,t,!0);return ww.set(this,n),n}resolveStack(e,t=0){return zw(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&Tw.IncludeAnonymous)>0;for(let e=this.cursor(a|Tw.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:Gw(xw.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(xw.none,t,n,r)))}static build(e){return Hw(e)}};Ew.empty=new Ew(xw.none,[],[],0);var Dw=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},Ow=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return xw.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(kw(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function kw(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function Aw(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof Mw&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:Tw.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof Mw&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var jw=class{cursor(e=0){return new Bw(this,e)}getChild(e,t=null,n=null){let r=Nw(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return Nw(this,e,t,n)}resolve(e,t=0){return Aw(this,e,t,!1)}resolveInner(e,t=0){return Aw(this,e,t,!0)}matchContext(e){return Pw(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},Mw=class e extends jw{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(!(!(a&Tw.EnterBracketed&&l instanceof Ew&&(d=yw.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length)&&!kw(i,r,u,u+l.length))){if(l instanceof Ow){if(a&Tw.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new Iw(new Fw(o,l,t,u),null,e)}else if(a&Tw.IncludeAnonymous||!l.type.isAnonymous||Vw(l)){let s;if(!(a&Tw.IgnoreMounts)&&(s=yw.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&Tw.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&Tw.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&Tw.IgnoreOverlays)&&(i=yw.get(this._tree))&&i.overlay){let a=t-this.from,o=r&Tw.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function Nw(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function Pw(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var Fw=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},Iw=class e extends jw{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&Tw.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new Ew(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function Lw(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof Mw&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new Rw(i,n)}var Rw=class{constructor(e,t){this.heads=e,this.node=t}get next(){return Lw(this.heads)}};function zw(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof Mw?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=yw.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new Mw(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(Aw(o,t,n,!1))}}return i?Lw(i):r}var Bw=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~Tw.EnterBracketed,e instanceof Mw)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof Mw?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&Tw.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Tw.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Tw.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else ({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&Tw.IncludeAnonymous||e instanceof Ow||!e.type.isAnonymous||Vw(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new Iw(this.buffer,t,this.stack[e]);return this.bufferNode=new Iw(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return Pw(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return Pw(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function Vw(e){return e.children.some(e=>e instanceof Ow||!e.type.isAnonymous||Vw(e))}function Hw(e){let{buffer:t,nodeSet:n,maxBufferLength:r=hw,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new Dw(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:C,size:w}=o,T=l,E=c;if(w<0)if(o.next(),w==-1){let t=i[x];_.push(t),v.push(S-e);return}else if(w==-3){c=x;return}else if(w==-4){l=x;return}else throw RangeError(`Unrecognized record size: ${w}`);let D=s[x],O,k,A=S-e;if(C-S<=r&&(k=h(o.pos-t,y))){let t=new Uint16Array(k.size-k.skip),r=o.pos-k.size,i=t.length;for(;o.pos>r;)i=g(k.start,t,i);O=new Ow(t,C-k.start,n),A=k.start-e}else{let e=o.pos-w;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=C;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,T,E),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,T,E),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(D,E);O=Gw(D,t,n,0,t.length,0,C-S,e,e)}else O=m(D,t,n,C-S,T-C,E)}_.push(O),v.push(A)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new Ow(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof Ew){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(vw.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[vw.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[vw.lookAhead,i];o=o?[e].concat(o):[e]}return new Ew(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0)if(n.size==-3||n.size==-4)d+=4;else break scan;else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new Ew(s[e.topID],_.reverse(),v.reverse(),y)}var Uw=new WeakMap;function Ww(e,t){if(!e.isAnonymous||t instanceof Ow||t.type!=e)return 1;let n=Uw.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof Ew)){n=1;break}n+=Ww(e,r)}Uw.set(t,n)}return n}function Gw(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=Ww(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=Ww(e,t[s]);for(s++;s<i;s++){let n=Ww(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(Gw(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var Kw=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},qw=class{startParse(e,t,n){return typeof e==`string`&&(e=new Jw(e)),n=n?n.length?n.map(e=>new _w(e.from,e.to)):[new _w(0,0)]:[new _w(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},Jw=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};new vw({perNode:!0});var Yw=[],Xw=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?Xw:Yw).push(n+=e[t])})();function Zw(e){if(e<768)return!1;for(let t=0,n=Yw.length;;){let r=t+n>>1;if(e<Yw[r])n=r;else if(e>=Xw[r])t=r+1;else return!0;if(t==n)return!1}}function Qw(e){return e>=127462&&e<=127487}var $w=8205;function eT(e,t,n=!0,r=!0){return(n?tT:nT)(e,t,r)}function tT(e,t,n){if(t==e.length)return t;t&&iT(e.charCodeAt(t))&&aT(e.charCodeAt(t-1))&&t--;let r=rT(e,t);for(t+=oT(r);t<e.length;){let i=rT(e,t);if(r==$w||i==$w||n&&Zw(i))t+=oT(i),r=i;else if(Qw(i)){let n=0,r=t-2;for(;r>=0&&Qw(rT(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function nT(e,t,n){for(;t>0;){let r=tT(e,t-2,n);if(r<t)return r;t--}return 0}function rT(e,t){let n=e.charCodeAt(t);if(!aT(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return iT(r)?(n-55296<<10)+(r-56320)+65536:n}function iT(e){return e>=56320&&e<57344}function aT(e){return e>=55296&&e<56320}function oT(e){return e<65536?1:2}var sT=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=_T(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),lT.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=_T(this,e,t);let n=[];return this.decompose(e,t,n,0),lT.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new pT(this),i=new pT(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new pT(this,e)}iterRange(e,t=this.length){return new mT(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new hT(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new cT(t):lT.from(cT.split(t,[]))}},cT=class e extends sT{constructor(e,t=uT(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new gT(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(fT(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=dT(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=_T(this,t,n);let i=dT(this.text,dT(r.text,fT(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):lT.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
`){[e,t]=_T(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},lT=class e extends sT{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=_T(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
`){[e,t]=_T(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new cT(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof cT&&c&&(n=u[u.length-1])instanceof cT&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new cT(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};sT.empty=new cT([``],0);function uT(e){let t=-1;for(let n of e)t+=n.length+1;return t}function dT(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function fT(e,t,n){return dT(e,[``],t,n)}var pT=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof cT?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof cT?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(r instanceof cT){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof cT?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},mT=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new pT(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},hT=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(sT.prototype[Symbol.iterator]=function(){return this.iter()},pT.prototype[Symbol.iterator]=mT.prototype[Symbol.iterator]=hT.prototype[Symbol.iterator]=function(){return this});var gT=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function _T(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function vT(e,t,n=!0,r=!0){return eT(e,t,n,r)}function yT(e){return e>=56320&&e<57344}function bT(e){return e>=55296&&e<56320}function xT(e,t){let n=e.charCodeAt(t);if(!bT(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return yT(r)?(n-55296<<10)+(r-56320)+65536:n}function ST(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function CT(e){return e<65536?1:2}var wT=/\r\n?|\n/,TT=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(TT||={}),ET=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){AT(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:MT(this,e)}mapDesc(e,t=!1){return e.empty?this:jT(this,e,t)}mapPos(e,t=-1,n=TT.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=TT.Simple&&c>=e&&(n==TT.TrackDel&&r<e&&c>e||n==TT.TrackBefore&&r<e||n==TT.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},DT=class e extends ET{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return AT(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return jT(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(sT.empty);r.push(a?t.slice(i,i+a):sT.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:MT(this,e,!0)}map(e,t=!1){return e.empty?this:jT(this,e,t,!0)}iterChanges(e,t=!1){AT(this,e,t)}get desc(){return ET.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new NT(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);OT(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;OT(n,e,t),t>0&&kT(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);OT(n,e,-1),OT(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:ET.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&OT(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?sT.of(l.split(r||wT)):l:sT.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&OT(i,e-o,-1),OT(i,s-e,d),kT(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(sT.empty);r[e]=sT.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function OT(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function kT(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(sT.empty);e.push(n)}}function AT(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=sT.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function jT(e,t,n,r=!1){let i=[],a=r?[]:null,o=new NT(e),s=new NT(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);OT(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(OT(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(OT(i,0,o.ins),a&&kT(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;OT(i,t,e<o.i?o.ins:0),a&&e<o.i&&kT(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?DT.createSet(i,a):ET.create(i);else throw Error(`Mismatched change set lengths`)}function MT(e,t,n=!1){let r=[],i=n?[]:null,a=new NT(e),o=new NT(t);for(let e=!1;;)if(a.done&&o.done)return i?DT.createSet(r,i):ET.create(r);else if(a.ins==0)OT(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)OT(r,0,o.ins,e),i&&kT(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;OT(r,t,n,e),i&&n&&kT(i,r,o.text)}else o.ins==-1?(OT(r,a.off?0:a.len,t,e),i&&kT(i,r,a.textBit(t))):(OT(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&kT(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var NT=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?sT.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?sT.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},PT=class e{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return FT.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return FT.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return FT.range(e.anchor,e.head)}static create(t,n,r){return new e(t,n,r)}},FT=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>PT.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return PT.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,t,n,r){let i=(n??16777215)<<6|(r==null?7:Math.min(6,r));return t<e?PT.create(t,e,48|i):PT.create(e,t,(t>e?8:0)|i)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function IT(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var LT=0,RT=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=LT++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:zT),!!t.static,t.enables)}of(e){return new BT([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new BT(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new BT(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function zT(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var BT=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=LT++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||HT(e,c)){let r=t(e);if(a?!VT(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=tE(o,c);if(this.dependencies.every(t=>t instanceof RT?o.facet(t)===e.facet(t):t instanceof GT?o.field(t,!1)==e.field(t,!1):!0)||(a?VT(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}};function VT(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function HT(e,t){let n=!1;for(let r of t)eE(e,r)&1&&(n=!0);return n}function UT(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=tE(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)eE(e,t);return e.values[o]=s(e),1},update(e,n){if(!HT(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=HT(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&zT(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var WT=RT.define({static:!0}),GT=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(LT++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(WT).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(WT),i=n.facet(WT),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,WT.of({field:this,create:e})]}get extension(){return this}},KT={lowest:4,low:3,default:2,high:1,highest:0};function qT(e){return t=>new YT(t,e)}var JT={highest:qT(KT.highest),high:qT(KT.high),default:qT(KT.default),low:qT(KT.low),lowest:qT(KT.lowest)},YT=class{constructor(e,t){this.inner=e,this.prec=t}},XT=class e{of(e){return new ZT(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},ZT=class{constructor(e,t){this.compartment=e,this.inner=t}},QT=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of $T(t,n,o))e instanceof GT?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0))if(s[n.id]=c.length<<1|1,zT(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>UT(e,n,t))}}return new e(t,o,l.map(e=>e(s)),s,c,a)}};function $T(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof ZT&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof ZT){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof YT)a(e.inner,e.prec);else if(e instanceof GT)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof BT)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,KT.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,KT.default),r.reduce((e,t)=>e.concat(t))}function eE(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function tE(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var nE=RT.define(),rE=RT.define({combine:e=>e.some(e=>e),static:!0}),iE=RT.define({combine:e=>e.length?e[0]:void 0,static:!0}),aE=RT.define(),oE=RT.define(),sE=RT.define(),cE=RT.define({combine:e=>e.length?e[0]:!1}),lE=class{constructor(e,t){this.type=e,this.value=t}static define(){return new uE}},uE=class{of(e){return new lE(this,e)}},dE=class{constructor(e){this.map=e}of(e){return new fE(this,e)}},fE=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new dE(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};fE.reconfigure=fE.define(),fE.appendConfig=fE.define();var pE=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&IT(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};pE.time=lE.define(),pE.userEvent=lE.define(),pE.addToHistory=lE.define(),pE.remote=lE.define();function mE(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function hE(e,t,n){let r,i,a;return n?(r=t.changes,i=DT.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:fE.mapEffects(e.effects,r).concat(fE.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function gE(e,t,n){let r=t.selection,i=xE(t.annotations);return t.userEvent&&(i=i.concat(pE.userEvent.of(t.userEvent))),{changes:t.changes instanceof DT?t.changes:DT.of(t.changes||[],n,e.facet(iE)),selection:r&&(r instanceof FT?r:FT.single(r.anchor,r.head)),effects:xE(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function _E(e,t,n){let r=gE(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=hE(r,gE(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=pE.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return yE(n?vE(i):i)}function vE(e){let t=e.startState,n=!0;for(let r of t.facet(aE)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:mE(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=DT.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=pE.create(t,r,e.selection&&e.selection.map(i),fE.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(oE);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof pE?i:Array.isArray(i)&&i.length==1&&i[0]instanceof pE?i[0]:_E(t,xE(i),!1)}return e}function yE(e){let t=e.startState,n=t.facet(sE),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=hE(r,gE(t,a,e.changes.newLength),!0))}return r==e?e:pE.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var bE=[];function xE(e){return e==null?bE:Array.isArray(e)?e:[e]}var SE=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(SE||={}),CE=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,wE;try{wE=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function TE(e){if(wE)return wE.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>``&&(n.toUpperCase()!=n.toLowerCase()||CE.test(n)))return!0}return!1}function EE(e){return t=>{if(!/\S/.test(t))return SE.Space;if(TE(t))return SE.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return SE.Word;return SE.Other}}var DE=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)eE(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return eE(this,n),tE(this,n)}update(...e){return _E(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(XT.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(fE.reconfigure)?(n=null,r=e.value):e.is(fE.appendConfig)&&(n=null,r=xE(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=QT.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(rE)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:FT.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=xE(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=fE.mapEffects(a,c).concat(fE.mapEffects(xE(o.effects),l))}return{changes:r,selection:FT.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof DT?t:DT.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return sT.of(t.split(this.facet(e.lineSeparator)||wT))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(eE(this,t),tE(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof GT&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:FT.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=QT.resolve(t.extensions||[],new Map),r=t.doc instanceof sT?t.doc:sT.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||wT)),i=t.selection?t.selection instanceof FT?t.selection:FT.single(t.selection.anchor,t.selection.head):FT.single(0);return IT(i,r.length),n.staticFacet(rE)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`
`}get readOnly(){return this.facet(cE)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(nE))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt(`wordChars`,e);return EE(t.length?t[0]:``)}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=vT(t,a,!1);if(i(t.slice(e,a))!=SE.Word)break;a=e}for(;o<r;){let e=vT(t,o);if(i(t.slice(o,e))!=SE.Word)break;o=e}return a==o?null:FT.range(a+n,o+n)}};DE.allowMultipleSelections=rE,DE.tabSize=RT.define({combine:e=>e.length?e[0]:4}),DE.lineSeparator=iE,DE.readOnly=cE,DE.phrases=RT.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),DE.languageData=nE,DE.changeFilter=aE,DE.transactionFilter=oE,DE.transactionExtender=sE,XT.reconfigure=fE.define();function OE(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(!(a===i||i===void 0))if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}var kE=class{eq(e){return this==e}range(e,t=e){return jE.create(e,t,this)}};kE.prototype.startSide=kE.prototype.endSide=0,kE.prototype.point=!1,kE.prototype.mapMode=TT.TrackDel;function AE(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}var jE=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}};function ME(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var NE=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},PE=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(ME)),this.isEmpty)return n.length?e.of(n):this;let s=new RE(this,null,-1).goto(0),c=0,l=[],u=new IE;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(jE.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return zE.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return zE.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=LE(a,o,n),c=new VE(a,s,i),l=new VE(o,s,i);n.iterGaps((e,t,n)=>HE(c,e,l,t,n,r)),n.empty&&n.length==0&&HE(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=999999999;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=LE(i,a),s=new VE(i,o,0).goto(n),c=new VE(a,o,0).goto(n);for(;;){if(s.to!=c.to||!UE(s.active,c.active)||s.point&&(!c.point||!AE(s.point,c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new VE(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new IE;for(let r of e instanceof jE?[e]:t?FE(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}};PE.empty=new PE([],[],null,-1);function FE(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(ME(t,r)>0)return e.slice().sort(ME);t=r}return e}PE.empty.nextLayer=PE.empty;var IE=class e{finishChunk(e){this.chunks.push(new NE(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||=new e).add(t,n,r)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(PE.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=PE.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function LE(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}var RE=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},zE=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new RE(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)BE(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)BE(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),BE(this.heap,0)}}};function BE(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var VE=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=zE.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){WE(this.active,e),WE(this.activeTo,e),WE(this.activeRank,e),this.minActive=KE(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;GE(this.active,t,n),GE(this.activeTo,t,r),GE(this.activeRank,t,i),e&&GE(e,t,this.cursor.from),this.minActive=KE(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&WE(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function HE(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t,l=!!a.boundChange;for(let t=!1;;){let r=e.to+c-n.to,i=r||e.endSide-n.endSide,u=i<0?e.to+c:n.to,d=Math.min(u,o);if(e.point||n.point?(e.point&&n.point&&AE(e.point,n.point)&&UE(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,d,e.point,n.point),t=!1):(t&&a.boundChange(s),d>s&&!UE(e.active,n.active)&&a.compareRange(s,d,e.active,n.active),l&&d<o&&(r||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>o)break;s=u,i<=0&&e.next(),i>=0&&n.next()}}function UE(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!AE(e[n],t[n]))return!1;return!0}function WE(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function GE(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function KE(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function qE(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=vT(e,i));return r}function JE(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=vT(e,r)}return r===!0?-1:e.length}for(var YE=`ͼ`,XE=typeof Symbol>`u`?`__`+YE:Symbol.for(YE),ZE=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),QE=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},$E=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`
`)}static newName(){let e=QE[XE]||1;return QE[XE]=e+1,YE+e.toString(36)}static mount(e,t,n){let r=e[ZE],i=n&&n.nonce;r?i&&r.setNonce(i):r=new tD(e,i),r.mount(Array.isArray(t)?t:[t],e)}},eD=new Map,tD=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=eD.get(n);if(t)return e[ZE]=t;this.sheet=new r.CSSStyleSheet,eD.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[ZE]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t],o=this.modules.indexOf(a);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,a),n)for(let e=0;e<a.rules.length;e++)n.insertRule(a.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
`;this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}},nD={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},rD={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},iD=typeof navigator<`u`&&/Mac/.test(navigator.platform),aD=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),oD=0;oD<10;oD++)nD[48+oD]=nD[96+oD]=String(oD);for(var oD=1;oD<=24;oD++)nD[oD+111]=`F`+oD;for(var oD=65;oD<=90;oD++)nD[oD]=String.fromCharCode(oD+32),rD[oD]=String.fromCharCode(oD);for(var sD in nD)rD.hasOwnProperty(sD)||(rD[sD]=nD[sD]);function cD(e){var t=!(iD&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||aD&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?rD:nD)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var lD=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},uD=typeof document<`u`?document:{documentElement:{style:{}}},dD=/Edge\/(\d+)/.exec(lD.userAgent),fD=/MSIE \d/.test(lD.userAgent),pD=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(lD.userAgent),mD=!!(fD||pD||dD),hD=!mD&&/gecko\/(\d+)/i.test(lD.userAgent),gD=!mD&&/Chrome\/(\d+)/.exec(lD.userAgent),_D=`webkitFontSmoothing`in uD.documentElement.style,vD=!mD&&/Apple Computer/.test(lD.vendor),yD=vD&&(/Mobile\/\w+/.test(lD.userAgent)||lD.maxTouchPoints>2),Z={mac:yD||/Mac/.test(lD.platform),windows:/Win/.test(lD.platform),linux:/Linux|X11/.test(lD.platform),ie:mD,ie_version:fD?uD.documentMode||6:pD?+pD[1]:dD?+dD[1]:0,gecko:hD,gecko_version:hD?+(/Firefox\/(\d+)/.exec(lD.userAgent)||[0,0])[1]:0,chrome:!!gD,chrome_version:gD?+gD[1]:0,ios:yD,android:/Android\b/.test(lD.userAgent),webkit:_D,webkit_version:_D?+(/\bAppleWebKit\/(\d+)/.exec(lD.userAgent)||[0,0])[1]:0,safari:vD,safari_version:vD?+(/\bVersion\/(\d+(\.\d+)?)/.exec(lD.userAgent)||[0,0])[1]:0,tabSize:uD.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function bD(e,t){for(let n in e)n==`class`&&t.class?t.class+=` `+e.class:n==`style`&&t.style?t.style+=`;`+e.style:t[n]=e[n];return t}var xD=Object.create(null);function SD(e,t,n){if(e==t)return!0;e||=xD,t||=xD;let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function CD(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??e.removeAttribute(r)}for(let n in t){let r=t[n];n==`style`?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function wD(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i==`style`?e.style.cssText=``:e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i==`style`?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function TD(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}var ED=class{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},DD=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(DD||={}),OD=class extends kE{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new kD(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new jD(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=MD(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new jD(e,n,r,t,e.widget||null,!0)}static line(e){return new AD(e)}static set(e,t=!1){return PE.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};OD.none=PE.empty;var kD=class e extends OD{constructor(e){let{start:t,end:n}=MD(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?bD(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||xD}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&SD(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}};kD.prototype.point=!1;var AD=class e extends OD{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&SD(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}};AD.prototype.mapMode=TT.TrackBefore,AD.prototype.point=!0;var jD=class e extends OD{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?TT.TrackBefore:TT.TrackAfter:TT.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?DD.WidgetBefore:DD.WidgetAfter:DD.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&ND(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}};jD.prototype.point=!0;function MD(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function ND(e,t){return e==t||!!(e&&t&&e.compare(t))}function PD(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}var FD=class e extends kE{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&SD(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||xD)}static set(e,t=!1){return PE.of(e,t)}};FD.prototype.startSide=FD.prototype.endSide=-1;function ID(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function LD(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function RD(e,t){if(!t.anchorNode)return!1;try{return LD(e,t.anchorNode)}catch{return!1}}function zD(e){return e.nodeType==3?eO(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function BD(e,t,n,r){return n?UD(e,t,n,r,-1)||UD(e,t,n,r,1):!1}function VD(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function HD(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function UD(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:WD(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=VD(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?WD(e):0}else return!1}}function WD(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function GD(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function KD(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function qD(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function JD(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=KD(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=qD(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g)if(f)l.scrollBy(h,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/m,n=(u.scrollTop-e)*m}if(h){let t=u.scrollLeft;u.scrollLeft+=h/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-h)<1&&(r=`nearest`),n&&Math.abs(n-g)<1&&(i=`nearest`)}if(f)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function YD(e){let t=e.ownerDocument,n,r;for(let i=e.parentNode;i&&!(i==t.body||n&&r);)if(i.nodeType==1)!r&&i.scrollHeight>i.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:n,y:r}}var XD=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?WD(t):0),n,Math.min(e.focusOffset,n?WD(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},ZD=null;Z.safari&&Z.safari_version>=26&&(ZD=!1);function QD(e){if(e.setActive)return e.setActive();if(ZD)return e.focus(ZD);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(ZD==null?{get preventScroll(){return ZD={preventScroll:!0},!0}}:void 0),!ZD){ZD=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],i=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}}}var $D;function eO(e,t,n=t){let r=$D||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function tO(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function nO(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function rO(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,WD(n));;)if(r){if(n.nodeType!=1)return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=WD(n))}else if(n==e)return!0;else r=VD(n),n=n.parentNode}function iO(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function aO(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r>0)return{node:n,offset:r};else if(n.nodeType==1&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=WD(n)}else if(n.parentNode&&!HD(n))r=VD(n),n=n.parentNode;else return null}function oO(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};else if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!HD(n))r=VD(n)+1,n=n.parentNode;else return null}var sO=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,VD(t),n)}static after(t,n){return new e(t.parentNode,VD(t)+1,n)}},cO=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(cO||={}),lO=cO.LTR,uO=cO.RTL;function dO(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}var fO=dO(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),pO=dO(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),mO=Object.create(null),hO=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);mO[t]=n,mO[n]=-t}function gO(e){return e<=247?fO[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?pO[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}var _O=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,vO=class{get dir(){return this.level%2?uO:lO}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}};function yO(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!yO(r.inner,i.inner))return!1}return!0}var bO=[];function xO(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=gO(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),bO[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=bO[e];if(i==128)e<s-1&&t==bO[e+1]&&t&24?i=bO[e]=t:bO[e]=256;else if(i==64){let i=e+1;for(;i<s&&bO[i]==64;)i++;let a=e&&t==8||i<n&&bO[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)bO[t]=a;e=i-1}else i==8&&r==1&&(bO[e]=1);t=i,i&7&&(r=i)}}}function SO(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=mO[n=e.charCodeAt(t)])if(r<0){for(let e=s-3;e>=0;e-=3)if(hO[e+1]==-r){let n=hO[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(bO[t]=bO[hO[e]]=r),s=e;break}}else if(hO.length==189)break;else hO[s++]=t,hO[s++]=n,hO[s++]=c;else if((o=bO[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=hO[t+2];if(n&2)break;if(e)hO[t+2]|=2;else{if(n&4)break;hO[t+2]|=4}}}}}function CO(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=bO[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(bO[o]==256)o++;else break;let l=a==1,u=l==((o<t?bO[o]:r)==1)?l?1:2:r;for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),bO[--t]=u;c=o}else a=o,c++}}}function wO(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=bO[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(bO[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new vO(c,m.from,f)),TO(e,m.direction==lO==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?bO[p]!=s:bO[p]==s))break;else p++;d?wO(e,c,p,r+1,i,d,o):c<p&&o.push(new vO(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=bO[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(bO[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new vO(m.to,c,f)),TO(e,m.direction==lO==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?bO[p-1]!=s:bO[p-1]==s))break;else p--;d?wO(e,p,c,r+1,i,d,o):p<c&&o.push(new vO(p,c,f)),c=p}}function TO(e,t,n,r,i,a,o){let s=t%2?2:1;xO(e,i,a,r,s),SO(e,i,a,r,s),CO(i,a,r,s),wO(e,i,a,t,n,r,o)}function EO(e,t,n){if(!e)return[new vO(0,0,+(t==uO))];if(t==lO&&!n.length&&!_O.test(e))return DO(e.length);if(n.length)for(;e.length>bO.length;)bO[bO.length]=256;let r=[],i=t==lO?0:1;return TO(e,i,i,n,0,e.length,r),r}function DO(e){return[new vO(0,e,0)]}var OO=``;function kO(e,t,n,r,i){let a=r.head-e.from,o=vO.find(t,a,r.bidiLevel??-1,r.assoc),s=t[o],c=s.side(i,n);if(a==c){let e=o+=i?1:-1;if(e<0||e>=t.length)return null;s=t[o=e],a=s.side(!i,n),c=s.side(i,n)}let l=vT(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),OO=e.text.slice(Math.min(a,l),Math.max(a,l));let u=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];return u&&l==c&&u.level+ +!i<s.level?FT.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level):FT.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function AO(e,t,n){for(let r=t;r<n;r++){let t=gO(e.charCodeAt(r));if(t==1)return lO;if(t==2||t==4)return uO}return lO}var jO=RT.define(),MO=RT.define(),NO=RT.define(),PO=RT.define(),FO=RT.define(),IO=RT.define(),LO=RT.define(),RO=RT.define(),zO=RT.define(),BO=RT.define({combine:e=>e.some(e=>e)}),VO=RT.define({combine:e=>e.some(e=>e)}),HO=RT.define(),UO=class e{constructor(e,t=`nearest`,n=`nearest`,r=5,i=5,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new e(FT.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},WO=fE.define({map:(e,t)=>e.map(t)}),GO=fE.define();function KO(e,t,n){let r=e.facet(PO);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+`:`,t):console.error(t))}var qO=RT.define({combine:e=>e.length?e[0]:!0}),JO=0,YO=RT.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),XO=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(YO.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(YO.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(JO++,t,r,i,e=>{let t=[];return o&&t.push(ek.of(t=>{let n=t.plugin(e);return n?o(n):OD.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},ZO=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){KO(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(KO(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){KO(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},QO=RT.define(),$O=RT.define(),ek=RT.define(),tk=RT.define(),nk=RT.define(),rk=RT.define(),ik=RT.define();function ak(e,t){let n=e.state.facet(ik);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return PE.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let n=r[e].spec.bidiIsolate,i;if(n??=AO(t.text,o,s),a>0&&c.length&&(i=c[c.length-1]).to==o&&i.direction==n)i.to=s,c=i.inner;else{let e={from:o,to:s,direction:n,inner:[]};c.push(e),c=e.inner}}}}),i}var ok=RT.define();function sk(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(ok)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}var ck=RT.define(),lk=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},uk=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=DT.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new lk(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},dk=[],fk=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return dk}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&CD(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:``)+(this.breakAfter?`#`:``)}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=VD(this.dom),r=this.length?e>0:t>0;return new sO(this.parent.dom,n+ +!!r,e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof hk)return e;return null}static get(e){return e.cmTile}},pk=class extends fk{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=mk(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=mk(r);this.length=a}};function mk(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var hk=class extends pk{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=fk.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof gk)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},gk=class e extends pk{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},_k=class e extends pk{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||a.isHidden&&(t>0||n&&yk(a,d)))&&(f>c||d.flags&32)?(a=d,o=c-u):(u<c||d.flags&16&&!d.isHidden)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):vk(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new sO(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new sO(e.dom,0);e==n.tile&&(a=!0)}}return new sO(this.dom,0)}};function vk(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=zD(t);return n[n.length-1]||null}function yk(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}var bk=class e extends pk{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},xk=class e extends fk{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,i=e,a=0;e==0&&t<0||e==n&&t>=0?Z.chrome||Z.gecko||(e?(r--,a=1):i<n&&(i++,a=-1)):t<0?r--:i<n&&i++;let o=eO(this.dom,r,i).getClientRects();if(!o.length)return null;let s=o[(a?a<0:t>=0)?0:o.length-1];return Z.safari&&!a&&s.width==0&&(s=Array.prototype.find.call(o,e=>e.width)||s),a?GD(s,a<0):s||null}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},Sk=class e extends fk{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return GD(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return GD(n,!r)}}get overrideDOMText(){if(!this.length)return sT.empty;let{root:e}=this;if(!e)return sT.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},Ck=class extends fk{constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return sT.empty}coordsIn(e){return this.dom.getBoundingClientRect()}},wk=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite())if(i==r.length)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(e){let t=Math.min(e,r.length-i);n&&n.skip(r,i,i+t),e-=t,i+=t}else break;else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},Tk=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},Ek=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new xk(a.dom,a.text+e);t.parent=i}else i.append(r||xk.of(e,this.cache.find(xk)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?Ik(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof bk&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(Ik(n.dom)),r=i;else{if(this.cache.reused.get(n)){let e=fk.get(n.dom);e&&e.setDOM(Ik(n.dom))}let e=bk.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let i=fk.get(e.text);i&&this.cache.reused.set(i,2);let a=new xk(e.text,e.text.nodeValue);a.flags|=8,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=Nk;let n=_k.start(e,t||this.cache.find(_k)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof bk&&a.mark.eq(i))n=a,t--;else{let e=bk.of(i,this.cache.find(bk,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!jk(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(Z.ios&&jk(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Rk,0,32)||new Sk(Rk.toDOM(),0,Rk,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new Tk(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-t.rank||this.wrappers[n-1].to-t.to)<0;)n--;this.wrappers.splice(n,0,t)}this.wrapperPos=this.pos}getBlockPos(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof gk&&n.wrapper.eq(t.wrapper))e=n;else{let n=gk.of(t.wrapper,this.cache.find(gk,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(Ck,void 0,1);return n&&(n.flags=t),n||new Ck(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},Dk=class{constructor(e){this.skipCount=0,this.text=``,this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=``,this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},Ok=[Sk,_k,xk,bk,Ck,gk,hk];for(let e=0;e<Ok.length;e++)Ok[e].bucket=e;var kk=class{constructor(e){this.view=e,this.buckets=Ok.map(()=>[]),this.index=Ok.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=i.length-1;e>=0;e--){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new Sk(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},Ak=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new kk(e),this.text=new Dk(e.state.doc),this.builder=new Ek(this.cache,new hk(e,e.contentDOM),PE.iter(n)),this.cache.reused.set(t,2),this.old=new wk(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=Fk(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?Sk.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof Ck)this.cache.add(e);else if(e instanceof bk)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof bk&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof bk&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=0,a=PE.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof jD){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?Lk.block:Lk.inline),c=Mk(a),l=this.cache.findWidget(i,t-e,c)||Sk.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=Pk(n,a);t>e&&this.text.skip(t-e)},span:(e,t,i,a)=>{for(let o=e;o<t;){let s=this.text.next(Math.min(512,t-o));s==null?(r.addLineStartIfNotCovered(n),r.addBreak(),o++):(r.ensureLine(n),r.addText(s,i,o==e?a:i.length),o+=s.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=a>i,this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=fk.get(r);if(r==this.view.contentDOM)break;e instanceof bk?t.push(e):e?.isLine()?n=e:e instanceof gk||(r.nodeName==`DIV`&&!n&&r!=this.view.contentDOM?n=new _k(r,Nk):n||t.push(bk.of(new kD({tagName:r.nodeName.toLowerCase(),attributes:TD(r)}),r)))}return{line:n,marks:t}}};function jk(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function Mk(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}var Nk={class:`cm-line`};function Pk(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r?e:(e||={class:`cm-line`},n&&bD(n,e),r&&(e.class+=` `+r),e)}function Fk(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof bk&&t.push(r.mark)}return t}function Ik(e){let t=fk.get(e);return t&&t.setDOM(e.cloneNode()),e}var Lk=class extends ED{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};Lk.inline=new Lk(`span`),Lk.block=new Lk(`div`);var Rk=new class extends ED{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},zk=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=OD.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new hk(e,e.contentDOM),this.updateInner([new lk(0,0,0,e.state.doc.length)],null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!Xk(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?Uk(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new lk(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(Z.ie||Z.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=Kk(i,this.decorations,e.changes);o.length&&(t=lk.extendWithRanges(t,o));let s=Jk(a,this.blockWrappers,e.changes);return s.length&&(t=lk.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new Ak(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=r.run(e,t),Bk(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+`px`,this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+`px`:``;let r=Z.chrome||Z.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof Zk&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(GO)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(qO)||n.tabIndex>-1)&&RD(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),Z.gecko&&s.empty&&!this.hasComposition&&Vk(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new sO(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!BD(c.node,c.offset,u.anchorNode,u.anchorOffset)||!BD(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{Z.android&&Z.chrome&&n.contains(u.focusNode)&&Yk(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=ID(this.view.root);if(e)if(s.empty){if(Z.gecko){let e=Wk(c.node,c.offset);if(e&&e!=3){let t=(e==1?aO:oO)(c.node,c.offset);t&&(c=new sO(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new sO(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new sO(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&BD(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=ID(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(l.node,l.offset),n.modify(`move`,t.assoc<0?`forward`:`backward`,`lineboundary`),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=WD(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!fk.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof Zk?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=r(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let n=vT(e.text,t);if(n==t)return null;let r=eO(e.dom,t,n).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==cO.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof gk)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?zD(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?cO.RTL:cO.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=zD(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement(`div`),n,r,i;return t.className=`cm-line`,t.style.width=`99999px`,t.style.position=`absolute`,t.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=zD(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(OD.replace({widget:new Zk(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return OD.set(e)}updateDeco(){let e=1,t=this.view.state.facet(ek).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(nk).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(PE.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(tk).map(e=>typeof e==`function`?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(HO))try{if(t(this.view,e.range,e))return!0}catch(e){KO(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=sk(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;if(JD(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==cO.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(t.head,1);e&&e.dom.scrollIntoView({block:`nearest`})}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Bk(this.tile)}};function Bk(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)Bk(n,t)}}function Vk(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable==`false`)&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable==`false`)}function Hk(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=aO(n.focusNode,n.focusOffset),i=oO(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=fk.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=fk.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function Uk(e,t,n){let r=Hk(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new lk(c.mapPos(a),c.mapPos(o),a,o),text:i}}function Wk(e,t){return e.nodeType==1?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}var Gk=class{constructor(){this.changes=[]}compareRange(e,t){PD(e,t,this.changes)}comparePoint(e,t){PD(e,t,this.changes)}boundChange(e){PD(e,e,this.changes)}};function Kk(e,t,n){let r=new Gk;return PE.compare(e,t,n,r),r.changes}var qk=class{constructor(){this.changes=[]}compareRange(e,t){PD(e,t,this.changes)}comparePoint(){}boundChange(e){PD(e,e,this.changes)}};function Jk(e,t,n){let r=new qk;return PE.compare(e,t,n,r),r.changes}function Yk(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable==`false`)return!0;return!1}function Xk(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}var Zk=class extends ED{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(`div`);return e.className=`cm-gap`,this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+`px`,!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function Qk(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return FT.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=vT(i.text,a,!1):s=vT(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;){let e=vT(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=vT(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return FT.range(o+i.from,s+i.from)}function $k(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,r=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t);a+=r*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+JE(o,a,e.state.tabSize)}function eA(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==DD.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function tA(e,t,n,r){let i=eA(e,t.head,t.assoc||-1),a=!r||i.type!=DD.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),o=e.posAtCoords({x:n==(r==cO.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return FT.cursor(o,n?-1:1)}return FT.cursor(n?i.to:i.from,n?-1:1)}function nA(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=e.textDirectionAt(i.from);for(let s=t,c=null;;){let t=kO(i,a,o,s,n),l=OO;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=`
`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function rA(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==SE.Space&&(i=t),i==t}}function iA(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return FT.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,(t.empty?t.assoc:0)||(n?1:-1)),u=e.documentTop;if(l)o??=l.left-c.left,s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from)),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=r??e.viewState.heightOracle.textHeight>>1,p=lA(e,{x:d,y:s+f*a},!1,a);return FT.cursor(p.pos,p.assoc,void 0,o)}function aA(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function oA(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=aA(e,i.from,0);t!=i.from&&(a=FT.cursor(t,-1))}else{let t=aA(e,i.from,-1),n=aA(e,i.to,1);(t!=i.from||n!=i.to)&&(a=FT.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?FT.create(n,t.mainIndex):t}function sA(e,t,n){let r=aA(e.state.facet(rk).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:FT.cursor(r,r<n.from?1:-1)}var cA=class{constructor(e,t){this.pos=e,this.assoc=t}};function lA(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new cA(0,1);if(c>e.viewState.docHeight)return new cA(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==DD.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==DD.Text){let t=$k(e,i,l,o,s);return new cA(t,t==l.from?1:-1)}}if(l.type!=DD.Text)return c<(l.top+l.bottom)/2?new cA(l.from,1):new cA(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new uA(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}var uA=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[vO.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[vO.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t){let n=0,r=e.length-1,i=new Set,a=this.bidiIn(e[0],e[r]),o,s,c=-1,l=1e9,u;search:for(;n<r;){let d=r-n,f=n+r>>1;adjust:if(i.has(f)){let e=n+Math.floor(Math.random()*d);for(let t=0;t<d;t++){if(!i.has(e)){f=e;break adjust}e++,e==r&&(e=n)}break search}i.add(f);let p=t(f);if(p)for(let t=0;t<p.length;t++){let i=p[t],d=0;if(i.bottom<this.y)(!o||o.bottom<i.bottom)&&(o=i),d=1;else if(i.top>this.y)(!s||s.top>i.top)&&(s=i),d=-1;else{let e=i.left>this.x?this.x-i.left:i.right<this.x?this.x-i.right:0,t=Math.abs(e);t<l&&(c=f,l=t,u=i),e&&(d=e<0==(this.baseDir==cO.LTR)?-1:1)}d==-1&&(!a||this.baseDirAt(e[f],1))?r=f:d==1&&(!a||this.baseDirAt(e[f+1],-1))&&(n=f+1)}}if(!u){let n=o&&(!s||this.y-o.bottom<s.top-this.y)?o:s;return this.y=(n.top+n.bottom)/2,this.scan(e,t)}let d=(a?this.dirAt(e[c],1):this.baseDir)==cO.LTR;return{i:c,after:this.x>(u.left+u.right)/2==d}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=vT(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return eO(e.dom,i,a).getClientRects()});return r.after?new cA(n[r.i+1],-1):new cA(n[r.i],1)}scanTile(e,t){if(!e.length)return new cA(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(n.dom.nodeType==1?n.dom:eO(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new cA(n[r.i+1],-1):new cA(a,1)}},dA=``,fA=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet(DE.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=dA}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=fk.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=fk.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:HD(r))||HD(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!mA(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=fk.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==`BR`?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(pA(e,n.node,n.offset)?t:0))}};function pA(e,t,n){for(;;){if(!t||n<WD(t))return!1;if(t==e)return!0;n=VD(t)+1,t=t.parentNode}}function mA(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let t=fk.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}var hA=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},gA=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=_A(e.docView.tile,t,n,0))){let t=i||a?[]:SA(e),n=new fA(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=CA(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!LD(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!LD(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),o=e.viewport;if((Z.ios||Z.chrome)&&e.state.selection.main.empty&&n!=r&&(o.from>0||o.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=o.from-t,s=o.to-i;(a==0||a==1||t==0)&&(s==0||s==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(FT.range(r,n)):this.newSel=FT.single(r,n)}}};function _A(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return _A(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}else if(e.isText())return{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling};else return null}function vA(e,t){let n,{newSel:r}=t,i=e.state.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:r,to:o}=t.bounds,s=i.from,c=null;(a===8||Z.android&&t.text.length<o-r)&&(s=i.to,c=`end`);let l=xA(e.state.doc.sliceString(r,o,dA),t.text,s-r,c);l&&(Z.chrome&&a==13&&l.toB==l.from+2&&t.text.slice(l.from,l.toB)==dA+dA&&l.toB--,n={from:r+l.from,to:r+l.toA,insert:sT.of(t.text.slice(l.from,l.toB).split(dA))})}else r&&(!e.hasFocus&&e.state.facet(qO)||wA(r,i))&&(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,i.to)}:(Z.mac||Z.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=FT.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:sT.of([n.insert.toString().replace(`.`,` `)])}):n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,i.to))}:e.state.doc.lineAt(i.from).to<i.to&&e.docView.lineHasWidget(i.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:i.from,to:i.to,insert:e.state.toText(e.inputState.insertingText)}:Z.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==`
`&&e.lineWrapping&&(r&&=FT.single(r.main.anchor-1,r.main.head-1),n={from:i.from,to:i.to,insert:sT.of([` `])}),n)return yA(e,n,r,a);if(r&&!wA(r,i)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=oA(e.state.facet(rk).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function yA(e,t,n,r=-1){if(Z.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(Z.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&tO(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&tO(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&tO(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=bA(e,t,n);return e.state.facet(IO).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function bA(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=aA(i.facet(rk).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:FT.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&Hk(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?FT.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function xA(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function SA(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new hA(n,r)),(i!=n||a!=r)&&t.push(new hA(i,a))),t}function CA(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?FT.single(n+t,r+t):null}function wA(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var TA=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=``,this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Z.safari&&e.contentDOM.addEventListener(`input`,()=>null),Z.gecko&&sj(e.contentDOM.ownerDocument)}handleEvent(e){!RA(this.view,e)||this.ignoreDuringComposition(e)||e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=DA(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&AA.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Z.android&&Z.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Z.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=OA.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||kA.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,tO(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Z.safari&&!Z.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function EA(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){KO(n.state,e)}}}function DA(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(EA(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(EA(t.value,r))}}for(let e in zA)n(e).handlers.push(zA[e]);for(let e in BA)n(e).observers.push(BA[e]);return t}var OA=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],kA=`dthko`,AA=[16,17,18,20,91,92,224,225],jA=6;function MA(e){return Math.max(0,e)*.7+8}function NA(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var PA=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=YD(e.contentDOM),this.atoms=e.state.facet(rk).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(DE.allowMultipleSelections)&&FA(e,t),this.dragging=LA(e,t)&&XA(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&NA(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=sk(this.view);e.clientX-s.left<=r+jA?t=-MA(r-e.clientX):e.clientX+s.right>=a-jA&&(t=MA(e.clientX-a)),e.clientY-s.top<=i+jA?n=-MA(i-e.clientY):e.clientY+s.bottom>=o-jA&&(n=MA(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){this.dragging??this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(`mousemove`,this.move),e.removeEventListener(`mouseup`,this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=oA(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function FA(e,t){let n=e.state.facet(jO);return n.length?n[0](t):Z.mac?t.metaKey:t.ctrlKey}function IA(e,t){let n=e.state.facet(MO);return n.length?n[0](t):Z.mac?!t.altKey:!t.ctrlKey}function LA(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=ID(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function RA(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=fk.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}var zA=Object.create(null),BA=Object.create(null),VA=Z.ie&&Z.ie_version<15||Z.ios&&Z.webkit_version<604;function HA(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textarea`));n.style.cssText=`position: fixed; left: -10000px; top: 10px`,n.focus(),setTimeout(()=>{e.focus(),n.remove(),WA(e,n.value)},50)}function UA(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function WA(e,t){t=UA(e.state,RO,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(nj!=null&&n.selection.ranges.every(e=>e.empty)&&nj==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:FT.cursor(r.from+c.length)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:FT.cursor(e.from+t.length)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}BA.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},zA.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),BA.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin(`select.pointer`)},BA.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},zA.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(NO))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=ZA(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new PA(e,t,n,r)),r&&e.observer.ignore(()=>{QD(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin(`select.pointer`);return!1};function GA(e,t,n,r){if(r==1)return FT.cursor(t,n);if(r==2)return Qk(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,FT.range(a,o)}}var KA=Z.ie&&Z.ie_version<=11,qA=null,JA=0,YA=0;function XA(e){if(!KA)return e.detail;let t=qA,n=YA;return qA=e,YA=Date.now(),JA=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(JA+1)%3:1}function ZA(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=XA(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=GA(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=GA(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?FT.range(i,a):FT.range(a,i)}return a?i.replaceRange(i.main.extend(l.from,l.to)):o&&r==1&&i.ranges.length>1&&(c=QA(i,s.pos))?c:o?i.addRange(l):FT.create([l])}}}function QA(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return FT.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}zA.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=FT.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,UA(e.state,zO,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},zA.dragend=e=>(e.inputState.draggedContent=null,!1);function $A(e,t,n,r){if(n=UA(e.state,RO,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&IA(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}zA.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&$A(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}else{let n=t.dataTransfer.getData(`Text`);if(n)return $A(e,t,n,!0),!0}return!1},zA.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=VA?null:t.clipboardData;return n?(WA(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(HA(e),!1)};function ej(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function tj(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:UA(e,zO,t.join(e.lineBreak)),ranges:n,linewise:r}}var nj=null;zA.copy=zA.cut=(e,t)=>{if(!RD(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=tj(e.state);if(!n&&!i)return!1;nj=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=VA?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(ej(e,n),!1)};var rj=lE.define();function ij(e,t){let n=[];for(let r of e.facet(LO)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:rj.of(!0)}):null}function aj(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=ij(e.state,t);n?e.dispatch(n):e.update([])}},10)}BA.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),aj(e)},BA.blur=e=>{e.observer.clearSelectionRange(),aj(e)},BA.compositionstart=BA.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},BA.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,Z.chrome&&Z.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},BA.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},zA.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return yA(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(Z.chrome&&Z.android&&(n=OA.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return Z.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),Z.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>BA.compositionend(e,t),20),!1};var oj=new Set;function sj(e){oj.has(e)||(oj.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var cj=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],lj=!1;function uj(){lj=!1}var dj=class{constructor(e){this.lineWrapping=e,this.doc=sT.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return cj.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=cj.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},fj=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},pj=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?DD.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof jD?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},mj=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(mj||={}),hj=.001,gj=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>hj&&(lj=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,mj.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,mj.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,mj.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=Tj.build(n.setDoc(a),e,l,u);i=_j(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new bj(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r)if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break;else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=0;return t[n-1]==null?(o=1,n--):t[n]??(o=1,r++),new Sj(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function _j(e,t){return e==t?e:(e.constructor!=t.constructor&&(lj=!0),t)}gj.prototype.size=1;var vj=OD.replace({}),yj=class extends gj{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new pj(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new pj(r,0,n,this.spaceAbove,vj):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,mj.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},bj=class e extends yj{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new pj(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof xj&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof xj?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):gj.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},xj=class e extends gj{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new pj(a.from,a.length,l,c,0)}else{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new pj(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==mj.ByHeight)return this.blockAt(e,n,r,i);if(t==mj.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new pj(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new pj(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new pj(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return gj.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=hj&&(s=-2);let c=new bj(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=gj.of(r);return(s<0||Math.abs(c.height-this.height)>=hj||Math.abs(s-this.heightMetrics(t,n).perLine)>=hj)&&(lj=!0),_j(this,c)}else (r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},Sj=class extends gj{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==mj.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==mj.ByPosNoHeight?mj.ByPosNoHeight:mj.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,mj.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&Cj(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),Cj(i,e)}return gj.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?gj.of(this.break?[e,null,t]:[e,t]):(this.left=_j(this.left,e),this.right=_j(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}};function Cj(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof xj&&(r=e[t+1])instanceof xj&&e.splice(t-1,3,new xj(n.length+1+r.length))}var wj=5,Tj=class e{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof bj?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new bj(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new yj(a,r,n)):(a||i||r>=wj)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new bj(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new xj(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof bj)return e;let t=new bj(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof bj)&&!this.isCovered?this.nodes.push(new bj(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof bj&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return PE.spans(n,r,i,a,0),a.finish(r)}};function Ej(e,t,n){let r=new Dj;return PE.compare(e,t,n,r,0),r.changes}var Dj=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&PD(e,t,this.changes,5)}};function Oj(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function kj(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function Aj(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var jj=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return OD.replace({widget:new Mj(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},Mj=class extends ED{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},Nj=class{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=zj,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=cO.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet($O).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new dj(t),this.stateDeco=Bj(e),this.heightMap=gj.empty().applyChanges(this.stateDeco,sT.empty,this.heightOracle.setDoc(e.doc),[new lk(0,0,0,e.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=OD.set(this.lineGaps.map(e=>e.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new Pj(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?zj:new Vj(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Hj(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=Bj(this.state);let r=e.changedRanges,i=lk.extendWithRanges(r,Ej(n,this.stateDeco,e?e.changes:DT.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);uj(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||lj)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(VO)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?cO.RTL:cO.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent===`refresh`,o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=qD(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=f&&(this.scrollAnchorHeight=-1,this.scrollTop=f),this.scrolledToBottom=iO(e.scrollDOM);let p=(this.printing?Aj:Oj)(t,this.paddingTop),m=p.top-this.pixelViewport.top,h=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(s=!0)),!this.inView&&!this.scrollTarget&&!kj(e.dom))return 0;let _=o.width;if((this.contentDOMWidth!=_||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(_-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,_/o),t),a&&(e.docView.minWidth=0,c|=16)}m>0&&h>0?l=Math.max(m,h):m<0&&h<0&&(l=Math.min(m,h)),uj();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?gj.empty().applyChanges(this.stateDeco,sT.empty,this.heightOracle,[new lk(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new fj(n.from,i))}lj&&(c|=2)}let v=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return v&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||v)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new Pj(r.lineAt(a-n*1e3,mj.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,mj.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,mj.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new Pj(r.lineAt(o-1e3/2,mj.ByHeight,i,0,0).from,r.lineAt(o+n+1e3/2,mj.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new Pj(this.heightMap.lineAt(n,mj.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,mj.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,mj.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,mj.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2*1e3&&i<o+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new jj(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=cO.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=Rj(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(FT.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new jj(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=DD.Text)return;let i=Fj(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=Lj(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=Ij(i,n),l=Ij(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=Lj(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=Ij(i,f),l=Ij(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=Lj(r,n)-Lj(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){jj.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=OD.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];PE.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Hj(this.heightMap.lineAt(e,mj.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Hj(this.heightMap.lineAt(this.scaler.fromDOM(e),mj.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Hj(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},Pj=class{constructor(e,t){this.from=e,this.to=t}};function Fj(e,t,n){let r=[],i=e,a=0;return PE.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function Ij({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function Lj(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function Rj(e,t){for(let n of e)if(t(n))return n}var zj={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function Bj(e){let t=e.facet(ek).filter(e=>typeof e!=`function`),n=e.facet(nk).filter(e=>typeof e!=`function`);return n.length&&t.push(PE.join(n)),t}var Vj=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,mj.ByPos,e,0,0).top,o=t.lineAt(i,mj.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to):!1}};function Hj(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new pj(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>Hj(e,t)):e._content)}var Uj=RT.define({combine:e=>e.join(` `)}),Wj=RT.define({combine:e=>e.indexOf(!0)>-1}),Gj=$E.newName(),Kj=$E.newName(),qj=$E.newName(),Jj={"&light":`.`+Kj,"&dark":`.`+qj};function Yj(e,t,n){return new $E(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}var Xj=Yj(`.`+Gj,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:`#f5f5f5`,color:`#6c6c6c`,border:`0px solid #ddd`,"&.cm-gutters-before":{borderRightWidth:`1px`},"&.cm-gutters-after":{borderLeftWidth:`1px`}},"&dark .cm-gutters":{backgroundColor:`#333338`,color:`#ccc`},".cm-gutter":{display:`flex !important`,flexDirection:`column`,flexShrink:0,boxSizing:`border-box`,minHeight:`100%`,overflow:`hidden`},".cm-gutterElement":{boxSizing:`border-box`},".cm-lineNumbers .cm-gutterElement":{padding:`0 3px 0 5px`,minWidth:`20px`,textAlign:`right`,whiteSpace:`nowrap`},"&light .cm-activeLineGutter":{backgroundColor:`#e2f2ff`},"&dark .cm-activeLineGutter":{backgroundColor:`#222227`},".cm-panels":{boxSizing:`border-box`,position:`sticky`,left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-dialog":{padding:`2px 19px 4px 6px`,position:`relative`,"& label":{fontSize:`80%`}},".cm-dialog-close":{position:`absolute`,top:`3px`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,fontSize:`14px`,padding:`0`},".cm-tab":{display:`inline-block`,overflow:`hidden`,verticalAlign:`bottom`},".cm-widgetBuffer":{verticalAlign:`text-top`,height:`1em`,width:0,display:`inline`},".cm-placeholder":{color:`#888`,display:`inline-block`,verticalAlign:`top`,userSelect:`none`},".cm-highlightSpace":{backgroundImage:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)`,backgroundPosition:`center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},Jj),Zj={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Qj=Z.ie&&Z.ie_version<=11,$j=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new XD,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(Z.ie&&Z.ie_version<=11||Z.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Z.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Z.chrome&&Z.chrome_version<126)&&(this.editContext=new rM(e),e.state.facet(qO)&&(e.contentDOM.editContext=this.editContext.editContext)),Qj&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(`Event`)))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(`Event`))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(`scroll`,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==`change`||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(qO)?n.root.activeElement!=this.dom:!RD(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Z.ie&&Z.ie_version<=11||Z.android&&Z.chrome)&&!n.state.selection.main.empty&&r.focusNode&&BD(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=ID(e.root);if(!t)return!1;let n=Z.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&nM(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=RD(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&rO(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,Zj),Qj&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Qj&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&tO(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&RD(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new gA(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=vA(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!wA(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=eM(t,e.previousSibling||e.target.previousSibling,-1),r=eM(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else if(e.type==`characterData`)return{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue};else return null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(qO)!=e.state.facet(qO)&&(e.view.contentDOM.editContext=e.state.facet(qO)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function eM(e,t,n){for(;t;){let r=fk.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function tM(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return BD(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function nM(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return tM(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?tM(e,n):null}var rM=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=xA(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=FT.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));wA(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:sT.of(n.text.slice(l.from,l.toB).split(`
`))};if((Z.mac||Z.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:sT.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);yA(e,u,FT.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(OD.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:GO.of(OD.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=ID(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to)if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}else r=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},iM=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement(`div`),this.scrollDOM=document.createElement(`div`),this.scrollDOM.tabIndex=-1,this.scrollDOM.className=`cm-scroller`,this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement(`div`),this.announceDOM.className=`cm-announced`,this.announceDOM.setAttribute(`aria-live`,`polite`),this.dom=document.createElement(`div`),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||nO(e.parent)||document,this.viewState=new Nj(e.state||DE.create(e)),e.scrollTo&&e.scrollTo.is(WO)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(YO).map(e=>new ZO(e));for(let e of this.plugins)e.update(this);this.observer=new $j(this),this.inputState=new TA(this),this.inputState.ensureHandlers(this.plugins),this.docView=new zk(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=`refresh`,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof pE?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let t=!1,n=!1,r,i=this.state;for(let t of e){if(t.startState!=i)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);i=t.state}if(this.destroyed){this.viewState.state=i;return}let a=this.hasFocus,o=0,s=null;e.some(e=>e.annotation(rj))?(this.inputState.notifiedFocused=a,o=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,s=ij(i,a),s||(o=1));let c=this.observer.delayedAndroidKey,l=null;if(c?(this.observer.clearDelayedAndroidKey(),l=this.observer.readChange(),(l&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(l=null)):this.observer.clear(),i.facet(DE.phrases)!=this.state.facet(DE.phrases))return this.setState(i);r=uk.create(this,i,e),r.flags|=o;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&=u.map(t.changes),t.scrollIntoView){let{main:e}=t.state.selection;u=new UO(e.empty?e:FT.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(WO)&&(u=e.value.clip(this.state))}this.viewState.update(r,u),this.bidiCache=sM.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(ck)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(r.startState.facet(Uj)!=r.state.facet(Uj)&&(this.viewState.mustMeasureContent=!0),(t||n||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let e of this.state.facet(FO))try{e(r)}catch(e){KO(this.state,e,`update listener`)}(s||l)&&Promise.resolve().then(()=>{s&&this.state==s.startState&&this.dispatch(s),l&&!vA(this,l)&&c.force&&tO(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new Nj(e),this.plugins=e.facet(YO).map(e=>new ZO(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new zk(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(YO),n=e.state.facet(YO);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new ZO(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){KO(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0)if(iO(n))i=-1,a=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}this.updateState=1;let o=this.viewState.measure(this);if(!o&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let s=[];o&4||([this.measureRequests,s]=[s,this.measureRequests]);let c=s.map(e=>{try{return e.read(this)}catch(e){return KO(this.state,e),oM}}),l=uk.create(this,this.state,[]),u=!1;l.flags|=o,t?t.flags|=o:t=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),u=this.docView.update(l),u&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(c[e]!=oM)try{let t=s[e];t.write&&t.write(c[e],this)}catch(e){KO(this.state,e)}if(u&&this.docView.updateSelection(!0),!l.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let e=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-a;if(e>1||e<-1){r+=e,n.scrollTop=r/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(FO))e(t)}get themeClasses(){return Gj+` `+(this.state.facet(Wj)?qj:Kj)+` `+this.state.facet(Uj)}updateAttrs(){let e=cM(this,QO,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(qO)?`true`:`false`,class:`cm-content`,style:`${Z.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),cM(this,$O,t);let n=this.observer.ignore(()=>{let n=wD(this.contentDOM,this.contentAttrs,t),r=wD(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&(this.announceDOM.textContent=``),n=!1;let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(ck);let t=this.state.facet(e.cspNonce);$E.mount(this.root,this.styleModules.concat(Xj).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return sA(this,e,nA(this,e,t,n))}moveByGroup(e,t){return sA(this,e,nA(this,e,t,t=>rA(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return FT.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return tA(this,e,t,n)}moveVertically(e,t,n){return sA(this,e,iA(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=lA(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),lA(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),a=i[vO.find(i,e-r.from,-1,t)];return GD(n,a.dir==cO.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(BO)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>aM)return DO(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||yO(r.isolates,n=ak(this,e))))return r.order;n||=ak(this,e);let r=EO(e.text,t,n);return this.bidiCache.push(new sM(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||Z.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{QD(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return WO.of(new UO(typeof e==`number`?FT.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return WO.of(new UO(FT.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return XO.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return XO.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=$E.newName(),r=[Uj.of(n),ck.of(Yj(`.${n}`,e))];return t&&t.dark&&r.push(Wj.of(!0)),r}static baseTheme(e){return JT.lowest(ck.of(Yj(`.`+Gj,e,Jj)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&fk.get(t)||fk.get(e))?.root?.view||null}};iM.styleModule=ck,iM.inputHandler=IO,iM.clipboardInputFilter=RO,iM.clipboardOutputFilter=zO,iM.scrollHandler=HO,iM.focusChangeEffect=LO,iM.perLineTextDirection=BO,iM.exceptionSink=PO,iM.updateListener=FO,iM.editable=qO,iM.mouseSelectionStyle=NO,iM.dragMovesSelection=MO,iM.clickAddsSelectionRange=jO,iM.decorations=ek,iM.blockWrappers=tk,iM.outerDecorations=nk,iM.atomicRanges=rk,iM.bidiIsolatedRanges=ik,iM.scrollMargins=ok,iM.darkTheme=Wj,iM.cspNonce=RT.define({combine:e=>e.length?e[0]:``}),iM.contentAttributes=$O,iM.editorAttributes=QO,iM.lineWrapping=iM.contentAttributes.of({class:`cm-lineWrapping`}),iM.announce=fE.define();var aM=4096,oM={},sM=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:cO.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}};function cM(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&bD(a,n)}return n}var lM=Z.mac?`mac`:Z.windows?`win`:Z.linux?`linux`:`key`;function uM(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function dM(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}var fM=JT.default(iM.domEventHandlers({keydown(e,t){return bM(hM(t.state),e,t,`editor`)}})),pM=RT.define({enables:fM}),mM=new WeakMap;function hM(e){let t=e.facet(pM),n=mM.get(t);return n||mM.set(t,n=vM(t.reduce((e,t)=>e.concat(t),[]))),n}var gM=null,_M=4e3;function vM(e,t=lM){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>uM(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=gM={view:t,prefix:n,scope:e};return setTimeout(()=>{gM==r&&(gM=null)},_M),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,yM))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}var yM=null;function bM(e,t,n,r){yM=t;let i=cD(t),a=CT(xT(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;gM&&gM.view==n&&gM.scope==r&&(o=gM.prefix+` `,AA.indexOf(t.keyCode)<0&&(c=!0,gM=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+dM(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(Z.windows&&t.ctrlKey&&t.altKey)&&!(Z.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=nD[t.keyCode])&&p!=i?(d(f[o+dM(p,t,!0)])||t.shiftKey&&(m=rD[t.keyCode])!=i&&m!=p&&d(f[o+dM(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+dM(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),yM=null,s}/x/.unicode;var xM=class extends ED{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement(`span`);return t.className=`cm-placeholder`,t.style.pointerEvents=`none`,t.appendChild(typeof this.content==`string`?document.createTextNode(this.content):typeof this.content==`function`?this.content(e):this.content.cloneNode(!0)),t.setAttribute(`aria-hidden`,`true`),t}coordsAt(e){let t=e.firstChild?zD(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=GD(t[0],n.direction!=`rtl`),i=parseInt(n.lineHeight);return r.bottom-r.top>i*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}};function SM(e){let t=XO.fromClass(class{constructor(t){this.view=t,this.placeholder=e?OD.set([OD.widget({widget:new xM(e),side:1}).range(0)]):OD.none}get decorations(){return this.view.state.doc.length?OD.none:this.placeholder}},{decorations:e=>e.decorations});return typeof e==`string`?[t,iM.contentAttributes.of({"aria-placeholder":e})]:t}var CM=`-10000px`,wM=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}};function TM(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}var EM=RT.define({combine:e=>({position:Z.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||TM})}),DM=new WeakMap,OM=XO.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(EM);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new wM(e,MM,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(EM);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add(`cm-tooltip`),e.arrow&&!n.dom.querySelector(`.cm-tooltip > .cm-tooltip-arrow`)){let e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=CM,n.dom.style.left=`0px`,this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener(`resize`,this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(Z.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||this.position==`absolute`)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else ({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=sk(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(EM).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=CM;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=DM.get(c)??d.bottom-d.top,g=c.offset||jM,_=this.view.textDirection==cO.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let b=(y?u.top-n.top:n.bottom-u.bottom)-p;if(b<h&&c.resize!==!1){if(b<this.view.defaultLineHeight){l.style.top=CM;continue}DM.set(c,h),l.style.height=(h=b)/i+`px`}else l.style.height&&(l.style.height=``);let x=y?u.top-h-p-g.y:u.bottom+p+g.y,S=v+m;if(c.overlap!==!0)for(let e of a)e.left<S&&e.right>v&&e.top<x+h&&e.bottom>x&&(x=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(x-e.parent.top)/i+`px`,kM(l,(v-e.parent.left)/r)):(l.style.top=x/i+`px`,kM(l,v/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:x,right:S,bottom:x+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=CM}},{eventObservers:{scroll(){this.maybeMeasure()}}});function kM(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}var AM=iM.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:`border-box`},"&light .cm-tooltip":{border:`1px solid #bbb`,backgroundColor:`#f5f5f5`},"&light .cm-tooltip-section:not(:first-child)":{borderTop:`1px solid #bbb`},"&dark .cm-tooltip":{backgroundColor:`#333338`,color:`white`},".cm-tooltip-arrow":{height:`7px`,width:`14px`,position:`absolute`,zIndex:-1,overflow:`hidden`,"&:before, &:after":{content:`''`,position:`absolute`,width:0,height:0,borderLeft:`7px solid transparent`,borderRight:`7px solid transparent`},".cm-tooltip-above &":{bottom:`-7px`,"&:before":{borderTop:`7px solid #bbb`},"&:after":{borderTop:`7px solid #f5f5f5`,bottom:`1px`}},".cm-tooltip-below &":{top:`-7px`,"&:before":{borderBottom:`7px solid #bbb`},"&:after":{borderBottom:`7px solid #f5f5f5`,top:`1px`}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:`#333338`,borderBottomColor:`#333338`},"&:after":{borderTopColor:`transparent`,borderBottomColor:`transparent`}}}),jM={x:0,y:0},MM=RT.define({enables:[OM,AM]});function NM(e,t){let n=e.plugin(OM);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}var PM=class extends kE{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};PM.prototype.elementClass=``,PM.prototype.toDOM=void 0,PM.prototype.mapMode=TT.TrackBefore,PM.prototype.startSide=PM.prototype.endSide=-1,PM.prototype.point=!0;var FM=RT.define(),IM=RT.define(),LM=RT.define(),RM=RT.define({combine:e=>e.some(e=>e)});function zM(e){let t=[BM];return e&&e.fixed===!1&&t.push(RM.of(!0)),t}var BM=XO.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement(`div`),this.dom.className=`cm-gutters cm-gutters-before`,this.dom.setAttribute(`aria-hidden`,`true`),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.gutters=e.state.facet(LM).map(t=>new WM(e,t)),this.fixed=!e.state.facet(RM);for(let e of this.gutters)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position=`sticky`),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement(`div`),this.domAfter.className=`cm-gutters cm-gutters-after`,this.domAfter.setAttribute(`aria-hidden`,`true`),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.domAfter.style.position=this.fixed?`sticky`:``,this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+`px`;this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(RM)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?`sticky`:``,this.domAfter&&(this.domAfter.style.position=this.fixed?`sticky`:``)),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=PE.iter(this.view.state.facet(FM),this.view.viewport.from),r=[],i=this.gutters.map(e=>new UM(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let a of e.type)if(a.type==DD.Text&&t){HM(n,r,a.from);for(let e of i)e.line(this.view,a,r);t=!1}else if(a.widget)for(let e of i)e.widget(this.view,a)}else if(e.type==DD.Text){HM(n,r,e.from);for(let t of i)t.line(this.view,e,r)}else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(LM),n=e.state.facet(LM),r=e.docChanged||e.heightChanged||e.viewportChanged||!PE.eq(e.startState.facet(FM),e.state.facet(FM),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new WM(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),i.indexOf(e)<0&&e.destroy();for(let e of i)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>iM.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==cO.LTR?{left:r,right:i}:{right:r,left:i}})});function VM(e){return Array.isArray(e)?e:[e]}function HM(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}var UM=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=PE.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let t=new GM(e,a,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,a,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];HM(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(IM)){let i=n(e,t.widget,t);i&&(r||=[]).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},WM=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement(`div`),this.dom.className=`cm-gutter`+(this.config.class?` `+this.config.class:``);for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();a=(e.top+e.bottom)/2}else a=r.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[n](e,o,r)&&r.preventDefault()});this.markers=VM(t.markers(e)),t.initialSpacer&&(this.spacer=new GM(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+=`visibility: hidden; pointer-events: none`)}update(e){let t=this.markers;if(this.markers=VM(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!PE.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},GM=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement(`div`),this.dom.className=`cm-gutterElement`,this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+`px`),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+`px`:``),KM(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n=`cm-gutterElement`,r=this.dom.firstChild;for(let i=0,a=0;;){let o=a,s=i<t.length?t[i++]:null,c=!1;if(s){let e=s.elementClass;e&&(n+=` `+e);for(let e=a;e<this.markers.length;e++)if(this.markers[e].compare(s)){o=e,c=!0;break}}else o=this.markers.length;for(;a<o;){let e=this.markers[a++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),c&&a++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}};function KM(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}var qM=RT.define(),JM=RT.define(),YM=RT.define({combine(e){return OE(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})}}),XM=class extends PM{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function ZM(e,t){return e.state.facet(YM).formatNumber(t,e.state)}var QM=LM.compute([YM],e=>({class:`cm-lineNumbers`,renderEmptyElements:!1,markers(e){return e.state.facet(qM)},lineMarker(e,t,n){return n.some(e=>e.toDOM)?null:new XM(ZM(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(JM)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(YM)!=e.state.facet(YM),initialSpacer(e){return new XM(ZM(e,eN(e.state.doc.lines)))},updateSpacer(e,t){let n=ZM(t.view,eN(t.view.state.doc.lines));return n==e.number?e:new XM(n)},domEventHandlers:e.facet(YM).domEventHandlers,side:`before`}));function $M(e={}){return[YM.of(e),zM(),QM]}function eN(e){let t=9;for(;t<e;)t=t*10+9;return t}var tN=0,nN=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=tN++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new iN(e);return e=>e.modified.indexOf(t)>-1?e:iN.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},rN=0,iN=class e{constructor(e){this.name=e,this.instances=[],this.id=rN++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&aN(n,e.modified));if(r)return r;let i=[],a=new nN(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=oN(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function aN(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function oN(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function sN(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new lN(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return cN.add(t)}var cN=new vw({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new lN(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),lN=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};lN.empty=new lN([],2,null);function uN(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function dN(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function fN(e,t,n,r=0,i=e.length){let a=new pN(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var pN=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=mN(e)||lN.empty,u=dN(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(vw.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function mN(e){let t=e.type.prop(cN);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var Q=nN.define,hN=Q(),gN=Q(),_N=Q(gN),vN=Q(gN),yN=Q(),bN=Q(yN),xN=Q(yN),SN=Q(),CN=Q(SN),wN=Q(),TN=Q(),EN=Q(),DN=Q(EN),ON=Q(),$={comment:hN,lineComment:Q(hN),blockComment:Q(hN),docComment:Q(hN),name:gN,variableName:Q(gN),typeName:_N,tagName:Q(_N),propertyName:vN,attributeName:Q(vN),className:Q(gN),labelName:Q(gN),namespace:Q(gN),macroName:Q(gN),literal:yN,string:bN,docString:Q(bN),character:Q(bN),attributeValue:Q(bN),number:xN,integer:Q(xN),float:Q(xN),bool:Q(yN),regexp:Q(yN),escape:Q(yN),color:Q(yN),url:Q(yN),keyword:wN,self:Q(wN),null:Q(wN),atom:Q(wN),unit:Q(wN),modifier:Q(wN),operatorKeyword:Q(wN),controlKeyword:Q(wN),definitionKeyword:Q(wN),moduleKeyword:Q(wN),operator:TN,derefOperator:Q(TN),arithmeticOperator:Q(TN),logicOperator:Q(TN),bitwiseOperator:Q(TN),compareOperator:Q(TN),updateOperator:Q(TN),definitionOperator:Q(TN),typeOperator:Q(TN),controlOperator:Q(TN),punctuation:EN,separator:Q(EN),bracket:DN,angleBracket:Q(DN),squareBracket:Q(DN),paren:Q(DN),brace:Q(DN),content:SN,heading:CN,heading1:Q(CN),heading2:Q(CN),heading3:Q(CN),heading4:Q(CN),heading5:Q(CN),heading6:Q(CN),contentSeparator:Q(SN),list:Q(SN),quote:Q(SN),emphasis:Q(SN),strong:Q(SN),link:Q(SN),monospace:Q(SN),strikethrough:Q(SN),inserted:Q(),deleted:Q(),changed:Q(),invalid:Q(),meta:ON,documentMeta:Q(ON),annotation:Q(ON),processingInstruction:Q(ON),definition:nN.defineModifier(`definition`),constant:nN.defineModifier(`constant`),function:nN.defineModifier(`function`),standard:nN.defineModifier(`standard`),local:nN.defineModifier(`local`),special:nN.defineModifier(`special`)};for(let e in $){let t=$[e];t instanceof nN&&(t.name=e)}var kN=uN([{tag:$.link,class:`tok-link`},{tag:$.heading,class:`tok-heading`},{tag:$.emphasis,class:`tok-emphasis`},{tag:$.strong,class:`tok-strong`},{tag:$.keyword,class:`tok-keyword`},{tag:$.atom,class:`tok-atom`},{tag:$.bool,class:`tok-bool`},{tag:$.url,class:`tok-url`},{tag:$.labelName,class:`tok-labelName`},{tag:$.inserted,class:`tok-inserted`},{tag:$.deleted,class:`tok-deleted`},{tag:$.literal,class:`tok-literal`},{tag:$.string,class:`tok-string`},{tag:$.number,class:`tok-number`},{tag:[$.regexp,$.escape,$.special($.string)],class:`tok-string2`},{tag:$.variableName,class:`tok-variableName`},{tag:$.local($.variableName),class:`tok-variableName tok-local`},{tag:$.definition($.variableName),class:`tok-variableName tok-definition`},{tag:$.special($.variableName),class:`tok-variableName2`},{tag:$.definition($.propertyName),class:`tok-propertyName tok-definition`},{tag:$.typeName,class:`tok-typeName`},{tag:$.namespace,class:`tok-namespace`},{tag:$.className,class:`tok-className`},{tag:$.macroName,class:`tok-macroName`},{tag:$.propertyName,class:`tok-propertyName`},{tag:$.operator,class:`tok-operator`},{tag:$.comment,class:`tok-comment`},{tag:$.meta,class:`tok-meta`},{tag:$.invalid,class:`tok-invalid`},{tag:$.punctuation,class:`tok-punctuation`}]),AN=new vw;function jN(e){return RT.define({combine:e?t=>t.concat(e):void 0})}var MN=new vw,NN=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,DE.prototype.hasOwnProperty(`tree`)||Object.defineProperty(DE.prototype,`tree`,{get(){return IN(this)}}),this.parser=t,this.extension=[GN.of(this),DE.languageData.of((e,t,n)=>{let r=PN(e,t,n),i=r.type.prop(AN);if(!i)return[];let a=e.facet(i),o=r.type.prop(MN);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return PN(e,t,n).type.prop(AN)==this.data}findRegions(e){let t=e.facet(GN);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(AN)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(vw.mounted);if(i){if(i.tree.prop(AN)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof Ew&&r(i,e.positions[n]+t)}};return r(IN(e),0),n}get allowsNesting(){return!0}};NN.setState=fE.define();function PN(e,t,n){let r=e.facet(GN),i=IN(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,Tw.ExcludeBuffers|Tw.EnterBracketed))e.type.isTop&&(i=e);return i}var FN=class e extends NN{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=jN(t.languageData);return new e(n,t.parser.configure({props:[AN.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function IN(e){let t=e.field(NN.state,!1);return t?t.tree:Ew.empty}var LN=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},RN=null,zN=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],Ew.empty,0,r,[],null)}startParse(){return this.parser.startParse(new LN(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Ew.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(Kw.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Kw.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=RN;RN=this;try{return e()}finally{RN=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=BN(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=Kw.applyChanges(r,e),i=Ew.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=BN(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends qw{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=RN;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new Ew(xw.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return RN}};function BN(e,t,n){return Kw.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var VN=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=zN.create(t.facet(GN).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};NN.state=GT.define({create:VN.init,update(e,t){for(let e of t.effects)if(e.is(NN.setState))return e.value;return t.startState.facet(GN)==t.state.facet(GN)?e.apply(t):VN.init(t.state)}});var HN=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(HN=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var UN=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,WN=XO.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(NN.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(NN.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=HN(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(NN.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!UN?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>UN&&UN()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:NN.setState.of(new VN(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>KO(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),GN=RT.define({combine(e){return e.length?e[0]:null},enables:e=>[NN.state,WN,iM.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),KN=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},qN=RT.define(),JN=RT.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function YN(e){let t=e.facet(JN);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function XN(e,t){let n=``,r=e.tabSize,i=e.facet(JN)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function ZN(e,t){e instanceof DE&&(e=new QN(e));for(let n of e.state.facet(qN)){let r=n(e,t);if(r!==void 0)return r}let n=IN(e.state);return n.length>=t?eP(e,n,t):null}var QN=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=YN(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return qE(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},$N=new vw;function eP(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return tP(r,e,n)}function tP(e,t,n){for(let r=e;r;r=r.next){let e=rP(r.node);if(e)return e(aP.create(t,n,r))}return 0}function nP(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function rP(e){let t=e.type.prop($N);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(vw.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>cP(e,!0,1,void 0,n&&!nP(e)?t.from:void 0)}return e.parent==null?iP:null}function iP(){return 0}var aP=class e extends QN{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(oP(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return tP(this.context.next,this.base,this.pos)}};function oP(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function sP(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function cP(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?sP(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}function lP({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var uP=new vw,dP=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=$E.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof NN?e=>e.prop(AN)==a.data:a?e=>e==a:void 0,this.style=uN(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new $E(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},fP=RT.define(),pP=RT.define({combine(e){return e.length?[e[0]]:null}});function mP(e){let t=e.facet(fP);return t.length?t:e.facet(pP)}function hP(e,t){let n=[_P],r;return e instanceof dP&&(e.module&&n.push(iM.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(pP.of(e)):r?n.push(fP.computeN([iM.darkTheme],t=>t.facet(iM.darkTheme)==(r==`dark`)?[e]:[])):n.push(fP.of(e)),n}var gP=class{constructor(e){this.markCache=Object.create(null),this.tree=IN(e.state),this.decorations=this.buildDeco(e,mP(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=IN(e.state),n=mP(e.state),r=n!=mP(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return OD.none;let n=new IE;for(let{from:r,to:i}of e.visibleRanges)fN(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=OD.mark({class:r})))},r,i);return n.finish()}},_P=JT.high(XO.fromClass(gP,{decorations:e=>e.decorations}));$.meta,$.link,$.heading,$.emphasis,$.strong,$.strikethrough,$.keyword,$.atom,$.bool,$.url,$.contentSeparator,$.labelName,$.literal,$.inserted,$.string,$.deleted,$.regexp,$.escape,$.string,$.variableName,$.variableName,$.typeName,$.namespace,$.className,$.variableName,$.macroName,$.propertyName,$.comment,$.invalid;var vP=1e4,yP=`()[]{}`,bP=new vw;function xP(e,t,n){let r=e.prop(t<0?vw.openedBy:vw.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function SP(e){let t=e.type.prop(bP);return t?t(e.node):e}function CP(e,t,n,r={}){let i=r.maxScanDistance||vP,a=r.brackets||yP,o=IN(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=xP(r.type,n,a);if(i&&r.from<r.to){let o=SP(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return wP(e,t,n,r,o,i,a)}}return TP(e,t,n,o,s.type,i,a)}function wP(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=SP(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(xP(u.type,n,o))l++;else if(xP(u.type,-n,o)){if(l==0){let e=SP(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function TP(e,t,n,r,i,a,o){let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i))if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}var EP=Object.create(null),DP=[xw.none],OP=[],kP=Object.create(null),AP=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])AP[e]=MP(EP,t);function jP(e,t){OP.indexOf(e)>-1||(OP.push(e),console.warn(t))}function MP(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||$[n];r?typeof r==`function`?t.length?t=t.map(r):jP(n,`Modifier ${n} used at start of tag`):t.length?jP(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:jP(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=kP[i];if(a)return a.id;let o=kP[i]=xw.define({id:DP.length,name:r,props:[sN({[r]:n})]});return DP.push(o),o.id}cO.RTL,cO.LTR;var NP=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new PP(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from,c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this,r=this.buffer.length;if(r==0&&e.parent&&(r=e.bufferBase-e.parent.bufferBase,e=e.parent),r>0&&e.buffer[r-4]==0&&e.buffer[r-1]>-1){if(t==n)return;if(e.buffer[r-2]>=t){e.buffer[r-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new FP(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216))if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new PP(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},PP=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},FP=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},IP=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function LP(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var RP=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},zP=new RP,BP=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=zP,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=zP,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},VP=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;WP(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};VP.prototype.contextual=VP.prototype.fallback=VP.prototype.extend=!1;var HP=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?LP(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(WP(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};HP.prototype.contextual=VP.prototype.fallback=VP.prototype.extend=!1;var UP=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function WP(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||KP(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function GP(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function KP(e,t,n,r){let i=GP(n,r,t);return i<0||GP(n,r,e)<i}var qP=typeof process<`u`&&/\bparse\b/.test({}.LOG),JP=null;function YP(e,t,n){let r=e.cursor(Tw.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var XP=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?YP(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?YP(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof Ew){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(vw.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},ZP=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new RP)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if(!(n&&!c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new RP,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new RP,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535)if(o[s+1]==1)s=nF(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(nF(o,s+2),t,n,r));break}o[s]==t&&(r=this.putAction(nF(o,s+1),t,n,r))}return r}},QP=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new BP(t,r),this.tokens=new ZP(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[NP.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new XP(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&rF(r);if(e)return qP&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw qP&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return qP&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500)if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=qP?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(vw.contextHash)||0)==n))return e.useNode(o,r),qP&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof Ew)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof Ew&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),qP&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),qP&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return $P(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=qP?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),qP&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(qP&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)qP&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))qP&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),qP&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),$P(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),Ew.build({buffer:IP.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(JP||=new WeakMap).get(e);return t||JP.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function $P(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var eF=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},tF=class e extends qw{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=vw[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new Sw(t.map((t,i)=>xw.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=hw;let a=LP(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(iF),this.states=LP(e.states,Uint32Array),this.data=LP(e.stateData),this.goto=LP(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new VP(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new QP(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535)if(n[i+1]==1)a=n[i=nF(n,i+2)];else if(n[i+1]==2)return nF(n,i+2);else break;if(a==t||a==0)return nF(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=nF(this.data,n+2);else break;r=t(nF(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=nF(this.data,n+2);else break;if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=iF(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new eF(e,n,r)}static deserialize(t){return new e(t)}};function nF(e,t){return e[t]|e[t+1]<<16}function rF(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function iF(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var aF=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=IN(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(fF(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function oF(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function sF(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=oF(t)+oF(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function cF(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:sF(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function lF(e,t){return n=>{for(let t=IN(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}var uF=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function dF(e){return e.selection.main.from}function fF(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var pF=lE.define();function mF(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:FT.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var hF=new WeakMap;function gF(e){if(!Array.isArray(e))return e;let t=hF.get(e);return t||hF.set(e,t=cF(e)),t}var _F=fE.define(),vF=fE.define(),yF=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=xT(e,t),r=CT(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(xT(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=xT(e,0),i=CT(r),a=i==e.length?0:-100;if(r!=t[0])if(r==n[0])a+=-200;else return null;return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=xT(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=CT(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=xT(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let v,y=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(v=ST(c))==v.toLowerCase()?v==v.toUpperCase()?0:2:1;(!r||y==1&&h||_==0&&y!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=y,r+=CT(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?CT(xT(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},bF=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},xF=RT.define({combine(e){return OE(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:CF,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>SF(e(n),t(n)),optionClass:(e,t)=>n=>SF(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function SF(e,t){return e?t?e+` `+t:e:t}function CF(e,t,n,r,i,a){let o=e.textDirection==cO.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}function wF(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function TF(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}var EF=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(xF);this.optionContent=wF(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=TF(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(xF).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:vF.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=TF(r.length,i,e.state.facet(xF).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=TF(t.options.length,t.selected,this.view.state.facet(xF).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>KO(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&OF(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(xF).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0))if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function DF(e,t){return n=>new EF(n,e,t)}function OF(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function kF(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function AF(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(xF);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new uF(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new bF(n):new yF(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new uF(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):kF(e.completion)>kF(c)&&(s[s.length-1]=e),c=e.completion}return s}var jF=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,IF(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=AF(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(xF).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,IF(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:KF,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},MF=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(LF,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(xF),i=(r.override||n.languageDataAt(`autocomplete`,dF(n)).map(gF)).map(e=>(this.active.find(t=>t.source==e)||new zF(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(HF));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!NF(i,this.active)||o?a=jF.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new zF(e.source,0):e));for(let e of t.effects)e.is(UF)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?PF:FF}};function NF(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var PF={"aria-autocomplete":`list`},FF={};function IF(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var LF=[];function RF(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(pF);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var zF=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=RF(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(_F))i=new e(i.source,1,n.value);else if(n.is(vF))i=new e(i.source,0);else if(n.is(HF))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(dF(e.state))}},BF=class e extends zF{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=dF(t.state);if(o>a||!r||n&2&&(dF(t.startState)==this.from||o<this.limit))return new zF(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return VF(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new aF(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??dF(t.state)):new zF(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new e(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new zF(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function VF(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):fF(e,!0).test(i)}var HF=fE.define({map(e,t){return e.map(e=>e.map(t))}}),UF=fE.define(),WF=GT.define({create(){return MF.start()},update(e,t){return e.update(t)},provide:e=>[MM.from(e,e=>e.tooltip),iM.contentAttributes.from(e,e=>e.attrs)]});function GF(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(WF).active.find(e=>e.source==t.source);return r instanceof BF?(typeof n==`string`?e.dispatch({...mF(e.state,n,r.from,r.to),annotations:pF.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}var KF=DF(WF,GF);function qF(e,t=`option`){return n=>{let r=n.state.field(WF,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(xF).interactionDelay)return!1;let i=1,a;t==`page`&&(a=NM(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:UF.of(s)}),!0}}var JF=e=>{let t=e.state.field(WF,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(xF).interactionDelay?!1:GF(e,t.open.options[t.open.selected])},YF=e=>e.state.field(WF,!1)?(e.dispatch({effects:_F.of(!0)}),!0):!1,XF=e=>{let t=e.state.field(WF,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:vF.of(null)}),!0)},ZF=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},QF=50,$F=1e3,eI=XO.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(WF).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(WF),n=e.state.facet(xF);if(!e.selectionSet&&!e.docChanged&&e.startState.field(WF)==t)return;let r=e.transactions.some(e=>{let t=RF(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>QF&&Date.now()-n.time>$F){for(let e of n.context.abortListeners)try{e()}catch(e){KO(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(_F)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(WF);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(xF).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new aF(t,dF(t),e.explicit,this.view),r=new ZF(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:vF.of(null)}),KO(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(xF).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(xF),n=this.view.state.field(WF);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=dF(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new BF(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(i.done==null){let n=new zF(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:HF.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(WF,!1);if(t&&t.tooltip&&this.view.state.facet(xF).closeOnBlur){let n=t.open&&NM(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:vF.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:_F.of(!1)}),20),this.composing=0}}}),tI=typeof navigator==`object`&&/Win/.test(navigator.platform),nI=JT.highest(iM.domEventHandlers({keydown(e,t){let n=t.state.field(WF,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(tI&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&GF(t,r),!1}})),rI=iM.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),iI=new class extends kE{};iI.startSide=1,iI.endSide=-1,typeof navigator==`object`&&navigator.userAgent;function aI(e={}){return[nI,WF,xF.of(e),eI,sI,rI]}var oI=[{key:`Ctrl-Space`,run:YF},{mac:"Alt-`",run:YF},{mac:`Alt-i`,run:YF},{key:`Escape`,run:XF},{key:`ArrowDown`,run:qF(!0)},{key:`ArrowUp`,run:qF(!1)},{key:`PageDown`,run:qF(!0,`page`)},{key:`PageUp`,run:qF(!1,`page`)},{key:`Enter`,run:JF}],sI=JT.highest(pM.computeN([xF],e=>e.facet(xF).defaultKeymap?[oI]:[]));function cI(e){let t=e.field(WF,!1);return t&&t.active.some(e=>e.isPending)?`pending`:t&&t.active.some(e=>e.state!=0)?`active`:null}var lI=36,uI=1,dI=2,fI=3,pI=4,mI=5,hI=6,gI=7,_I=8,vI=9,yI=10,bI=11,xI=12,SI=13,CI=14,wI=15,TI=16,EI=17,DI=18,OI=19,kI=20,AI=21,jI=22,MI=23,NI=24;function PI(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function FI(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function II(e,t,n){for(let r=!1;;){if(e.next<0)return;if(e.next==t&&!r){e.advance();return}r=n&&!r&&e.next==92,e.advance()}}function LI(e,t){scan:for(;;){if(e.next<0)return;if(e.next==36){e.advance();for(let n=0;n<t.length;n++){if(e.next!=t.charCodeAt(n))continue scan;e.advance()}if(e.next==36){e.advance();return}}else e.advance()}}function RI(e,t){let n=`[{<(`.indexOf(String.fromCharCode(t)),r=n<0?t:`]}>)`.charCodeAt(n);for(;;){if(e.next<0)return;if(e.next==r&&e.peek(1)==39){e.advance(2);return}e.advance()}}function zI(e,t){for(;!(e.next!=95&&!PI(e.next));)t!=null&&(t+=String.fromCharCode(e.next)),e.advance();return t}function BI(e){if(e.next==39||e.next==34||e.next==96){let t=e.next;e.advance(),II(e,t,!1)}else zI(e)}function VI(e,t){for(;e.next==48||e.next==49;)e.advance();t&&e.next==t&&e.advance()}function HI(e,t){for(;;){if(e.next==46){if(t)break;t=!0}else if(e.next<48||e.next>57)break;e.advance()}if(e.next==69||e.next==101)for(e.advance(),(e.next==43||e.next==45)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function UI(e){for(;!(e.next<0||e.next==10);)e.advance()}function WI(e,t){for(let n=0;n<t.length;n++)if(t.charCodeAt(n)==e)return!0;return!1}var GI=` \r
`;function KI(e,t,n){let r=Object.create(null);r.true=r.false=mI,r.null=r.unknown=hI;for(let t of e.split(` `))t&&(r[t]=kI);for(let e of t.split(` `))e&&(r[e]=AI);for(let e of(n||``).split(` `))e&&(r[e]=NI);return r}var qI=`array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying `,JI=`absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone `,YI={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,plsqlQuotingMechanism:!1,operatorChars:`*+-%<>!=&|~^/`,specialVar:`?`,identifierQuotes:`"`,caseInsensitiveIdentifiers:!1,words:KI(JI,qI)};function XI(e,t,n,r){let i={};for(let t in YI)i[t]=(e.hasOwnProperty(t)?e:YI)[t];return t&&(i.words=KI(t,n||``,r)),i}function ZI(e){return new UP(t=>{let{next:n}=t;if(t.advance(),WI(n,GI)){for(;WI(t.next,GI);)t.advance();t.acceptToken(lI)}else if(n==36&&e.doubleDollarQuotedStrings){let e=zI(t,``);t.next==36&&(t.advance(),LI(t,e),t.acceptToken(fI))}else if(n==39||n==34&&e.doubleQuotedStrings)II(t,n,e.backslashEscapes),t.acceptToken(fI);else if(n==35&&e.hashComments||n==47&&t.next==47&&e.slashComments)UI(t),t.acceptToken(uI);else if(n==45&&t.next==45&&(!e.spaceAfterDashes||t.peek(1)==32))UI(t),t.acceptToken(uI);else if(n==47&&t.next==42){t.advance();for(let e=1;;){let n=t.next;if(t.next<0)break;if(t.advance(),n==42&&t.next==47){if(e--,t.advance(),!e)break}else n==47&&t.next==42&&(e++,t.advance())}t.acceptToken(dI)}else if((n==101||n==69)&&t.next==39)t.advance(),II(t,39,!0),t.acceptToken(fI);else if((n==110||n==78)&&t.next==39&&e.charSetCasts)t.advance(),II(t,39,e.backslashEscapes),t.acceptToken(fI);else if(n==95&&e.charSetCasts)for(let n=0;;n++){if(t.next==39&&n>1){t.advance(),II(t,39,e.backslashEscapes),t.acceptToken(fI);break}if(!PI(t.next))break;t.advance()}else if(e.plsqlQuotingMechanism&&(n==113||n==81)&&t.next==39&&t.peek(1)>0&&!WI(t.peek(1),GI)){let e=t.peek(1);t.advance(2),RI(t,e),t.acceptToken(fI)}else if(WI(n,e.identifierQuotes))II(t,n==91?93:n,!1),t.acceptToken(OI);else if(n==40)t.acceptToken(gI);else if(n==41)t.acceptToken(_I);else if(n==123)t.acceptToken(vI);else if(n==125)t.acceptToken(yI);else if(n==91)t.acceptToken(bI);else if(n==93)t.acceptToken(xI);else if(n==59)t.acceptToken(SI);else if(e.unquotedBitLiterals&&n==48&&t.next==98)t.advance(),VI(t),t.acceptToken(jI);else if((n==98||n==66)&&(t.next==39||t.next==34)){let n=t.next;t.advance(),e.treatBitsAsBytes?(II(t,n,e.backslashEscapes),t.acceptToken(MI)):(VI(t,n),t.acceptToken(jI))}else if(n==48&&(t.next==120||t.next==88)||(n==120||n==88)&&t.next==39){let e=t.next==39;for(t.advance();FI(t.next);)t.advance();e&&t.next==39&&t.advance(),t.acceptToken(pI)}else if(n==46&&t.next>=48&&t.next<=57)HI(t,!0),t.acceptToken(pI);else if(n==46)t.acceptToken(CI);else if(n>=48&&n<=57)HI(t,!1),t.acceptToken(pI);else if(WI(n,e.operatorChars)){for(;WI(t.next,e.operatorChars);)t.advance();t.acceptToken(wI)}else if(WI(n,e.specialVar))t.next==n&&t.advance(),BI(t),t.acceptToken(EI);else if(n==58||n==44)t.acceptToken(TI);else if(PI(n)){let r=zI(t,String.fromCharCode(n));t.acceptToken(t.next==46||t.peek(-r.length-1)==46?DI:e.words[r.toLowerCase()]??DI)}})}var QI=ZI(YI),$I=tF.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:`⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement`,maxTerm:38,nodeProps:[[`isolate`,-4,1,2,3,19,``]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:`RORO`,tokenizers:[0,QI],topRules:{Script:[0,25]},tokenPrec:0});function eL(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function tL(e,t){let n=e.sliceString(t.from,t.to),r=/^([`'"\[])(.*)([`'"\]])$/.exec(n);return r?r[2]:n}function nL(e){return e&&(e.name==`Identifier`||e.name==`QuotedIdentifier`)}function rL(e,t){if(t.name==`CompositeIdentifier`){let n=[];for(let r=t.firstChild;r;r=r.nextSibling)nL(r)&&n.push(tL(e,r));return n}return[tL(e,t)]}function iL(e,t){for(let n=[];;){if(!t||t.name!=`.`)return n;let r=eL(t);if(!nL(r))return n;n.unshift(tL(e,r)),t=eL(r)}}function aL(e,t){let n=IN(e).resolveInner(t,-1),r=sL(e.doc,n);return n.name==`Identifier`||n.name==`QuotedIdentifier`||n.name==`Keyword`?{from:n.from,quoted:n.name==`QuotedIdentifier`?e.doc.sliceString(n.from,n.from+1):null,parents:iL(e.doc,eL(n)),aliases:r}:n.name==`.`?{from:t,quoted:null,parents:iL(e.doc,n),aliases:r}:{from:t,quoted:null,parents:[],empty:!0,aliases:r}}var oL=new Set(`where group having order union intersect except all distinct limit offset fetch for`.split(` `));function sL(e,t){let n;for(let e=t;!n;e=e.parent){if(!e)return null;e.name==`Statement`&&(n=e)}let r=null;for(let t=n.firstChild,i=!1,a=null;t;t=t.nextSibling){let n=t.name==`Keyword`?e.sliceString(t.from,t.to).toLowerCase():null,o=null;if(!i)i=n==`from`;else if(n==`as`&&a&&nL(t.nextSibling))o=tL(e,t.nextSibling);else if(n&&oL.has(n))break;else a&&nL(t)&&(o=tL(e,t));o&&(r||=Object.create(null),r[o]=rL(e,a)),a=/Identifier$/.test(t.name)?t:null}return r}function cL(e,t,n){return n.map(n=>({...n,label:n.label[0]==e?n.label:e+n.label+t,apply:void 0}))}var lL=/^\w*$/,uL=/^[`'"\[]?\w*[`'"\]]?$/;function dL(e){return e.self&&typeof e.self.label==`string`}var fL=class e{constructor(e,t){this.idQuote=e,this.idCaseInsensitive=t,this.list=[],this.children=void 0}child(t){let n=this.children||=Object.create(null);return n[t]||(t&&!this.list.some(e=>e.label==t)&&this.list.push(pL(t,`type`,this.idQuote,this.idCaseInsensitive)),n[t]=new e(this.idQuote,this.idCaseInsensitive))}maybeChild(e){return this.children?this.children[e]:null}addCompletion(e){let t=this.list.findIndex(t=>t.label==e.label);t>-1?this.list[t]=e:this.list.push(e)}addCompletions(e){for(let t of e)this.addCompletion(typeof t==`string`?pL(t,`property`,this.idQuote,this.idCaseInsensitive):t)}addNamespace(e){Array.isArray(e)?this.addCompletions(e):dL(e)?this.addNamespace(e.children):this.addNamespaceObject(e)}addNamespaceObject(e){for(let t of Object.keys(e)){let n=e[t],r=null,i=t.replace(/\\?\./g,e=>e==`.`?`\0`:e).split(`\0`),a=this;dL(n)&&(r=n.self,n=n.children);for(let e=0;e<i.length;e++)r&&e==i.length-1&&a.addCompletion(r),a=a.child(i[e].replace(/\\\./g,`.`));a.addNamespace(n)}}};function pL(e,t,n,r){return RegExp(`^[a-z_][a-z_\\d]*$`,r?`i`:``).test(e)?{label:e,type:t}:{label:e,type:t,apply:n+e+mL(n)}}function mL(e){return e===`[`?`]`:e}function hL(e,t,n,r,i,a){let o=new fL(a?.spec.identifierQuotes?.[0]||`"`,!!a?.spec.caseInsensitiveIdentifiers),s=i?o.child(i):null;return o.addNamespace(e),t&&(s||o).addCompletions(t),n&&o.addCompletions(n),s&&o.addCompletions(s.list),r&&o.addCompletions((s||o).child(r).list),e=>{let{parents:t,from:n,quoted:i,empty:a,aliases:c}=aL(e.state,e.pos);if(a&&!e.explicit)return null;c&&t.length==1&&(t=c[t[0]]||t);let l=o;for(let e of t){for(;!l.children||!l.children[e];)if(l==o&&s)l=s;else if(l==s&&r)l=l.child(r);else return null;let t=l.maybeChild(e);if(!t)return null;l=t}let u=l.list;if(l==o&&c&&(u=u.concat(Object.keys(c).map(e=>({label:e,type:`constant`})))),i){let t=i[0],r=mL(t);return{from:n,to:e.state.sliceDoc(e.pos,e.pos+1)==r?e.pos+1:void 0,options:cL(t,r,u),validFor:uL}}else return{from:n,options:u,validFor:lL}}}function gL(e){return e==AI?`type`:e==kI?`keyword`:`variable`}function _L(e,t,n){return lF([`QuotedIdentifier`,`String`,`LineComment`,`BlockComment`,`.`],cF(Object.keys(e).map(r=>n(t?r.toUpperCase():r,gL(e[r])))))}var vL=$I.configure({props:[$N.add({Statement:lP()}),uP.add({Statement(e,t){return{from:Math.min(e.from+100,t.doc.lineAt(e.from).to),to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}}),sN({Keyword:$.keyword,Type:$.typeName,Builtin:$.standard($.name),Bits:$.number,Bytes:$.string,Bool:$.bool,Null:$.null,Number:$.number,String:$.string,Identifier:$.name,QuotedIdentifier:$.special($.string),SpecialVar:$.special($.name),LineComment:$.lineComment,BlockComment:$.blockComment,Operator:$.operator,"Semi Punctuation":$.punctuation,"( )":$.paren,"{ }":$.brace,"[ ]":$.squareBracket})]}),yL=class e{constructor(e,t,n){this.dialect=e,this.language=t,this.spec=n}get extension(){return this.language.extension}configureLanguage(t,n){return new e(this.dialect,this.language.configure(t,n),this.spec)}static define(t){let n=XI(t,t.keywords,t.types,t.builtin);return new e(n,FN.define({name:`sql`,parser:vL.configure({tokenizers:[{from:QI,to:ZI(n)}]}),languageData:{commentTokens:{line:`--`,block:{open:`/*`,close:`*/`}},closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]}}}),t)}};function bL(e,t){return{label:e,type:t,boost:-1}}function xL(e,t=!1,n){return _L(e.dialect.words,t,n||bL)}function SL(e){return e.schema?hL(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||TL):()=>null}function CL(e){return e.schema?(e.dialect||TL).language.data.of({autocomplete:SL(e)}):[]}function wL(e={}){let t=e.dialect||TL;return new KN(t.language,[CL(e),t.language.data.of({autocomplete:xL(t,e.upperCaseKeywords,e.keywordCompletion)})])}var TL=yL.define({});JI+``,qI+``,qI+``,JI+``,JI+``,JI+``,qI+``,JI+``,qI+``,qI+``,JI+``,qI+``;var EL=`abs.changes.char.coalesce.glob.hex.ifnull.iif.instr.last_insert_rowid.length.like.likelihood.likely.load_extension.lower.ltrim.max.min.random.randomblob.replace.round.rtrim.soundex.sqlite_compileoption_get.sqlite_compileoption_used.sqlite_source_id.sqlite_version.substr.substring.total_changes.trim.typeof.unhex.unicode.unistr_quote.unistr.unlikely.upper.zeroblob.date.datetime.julianday.strftime.time.timediff.unixepoch.avg.count.count.group_concat.max.min.sum.total.acos.asin.atan.atan2.ceil.ceiling.cos.cosh.degrees.exp.floor.ln.log.log10.mod.pi.pow.power.radians.rand.sign.sin.sinh.sqrt.tan.tanh.trunc.json_array_length.json_extract.json_insert.json_patch.json_quote.json_remove.json_replace.json_set.json_type.json_valid.json`.split(`.`),DL=`ABORT.ADD.AFTER.ALL.ALTER.ALWAYS.ANALYZE.AND.AS.ASC.ATTACH.AUTOINCREMENT.BEFORE.BEGIN.BETWEEN.BY.CASCADE.CASE.CAST.CHECK.COLLATE.COLUMN.COMMIT.CONFLICT.CONSTRAINT.CREATE.CROSS.CURRENT_DATE.CURRENT_TIME.CURRENT_TIMESTAMP.DATABASE.DEFAULT.DEFERRABLE.DEFERRED.DELETE.DESC.DETACH.DISTINCT.DROP.EACH.ELSE.ESCAPE.EXCEPT.EXCLUSIVE.EXISTS.EXPLAIN.FAIL.FOR.FOREIGN.FROM.FULL.GENERATED.GLOB.GROUP.HAVING.IF.IGNORE.IMMEDIATE.IN.INDEX.INITIALLY.INNER.INSERT.INSTEAD.INTERSECT.INTO.IS.ISNULL.JOIN.KEY.LEFT.LIKE.LIMIT.MATCH.NATURAL.NOT.NOTNULL.NULL.OF.OFFSET.ON.OR.ORDER.OUTER.PLAN.PRAGMA.PRIMARY.QUERY.RAISE.REFERENCES.REGEXP.REINDEX.RENAME.REPLACE.RESTRICT.RIGHT.ROLLBACK.ROW.SELECT.SET.TABLE.TEMP.TEMPORARY.THEN.TO.TRANSACTION.TRIGGER.UNION.UNIQUE.UPDATE.USING.VACUUM.VALUES.VIEW.VIRTUAL.WHEN.WHERE`.split(`.`),OL=`BIGINT.INT.INT2.INT8.INTEGER.MEDIUMINT.SMALLINT.TINYINT.UNSIGNED BIG INT.CHARACTER.CLOB.NATIVE CHARACTER.NCHAR.NVARCHAR.TEXT.VARCHAR.VARYING CHARACTER.DOUBLE PRECISION.DOUBLE.FLOAT.REAL.BOOLEAN.DATE.DATETIME.DECIMAL.NUMERIC.BLOB`.split(`.`),kL=yL.define({keywords:[...DL,...EL,...OL].join(` `).toLowerCase(),builtin:``,types:``,operatorChars:`*/+-%<>!=~`,doubleQuotedStrings:!0,charSetCasts:!1}),AL=/^\s+/,jL=/^(`([^`\n]|``)+`|"([^"\n]|"")+"|\[[^\]\n]+\]|[a-zA-Z_][a-zA-Z0-9_]*)/,ML=/^(?:'(?:[^'\n]|'')*'|"(?:[^"\n]|"")*")/,NL=/^\d+(\.\d+)?/,PL=/^:[a-zA-Z_][a-zA-Z0-9_]*/,FL=/^(--.*|\/\*[\s\S]*?\*\/)/,IL=/^(::|<>|!=|<=|>=|=|<|>|\+|-|\*|\/)/,LL=/^[`,;().]/,RL=[{matchToken:e=>AL.exec(e)?.[0]??null,type:`WHITESPACE`},{matchToken:e=>jL.exec(e)?.[0]??null,type:`IDENTIFIER`},{matchToken:e=>ML.exec(e)?.[0]??null,type:`STRING`},{matchToken:e=>NL.exec(e)?.[0]??null,type:`NUMBER`},{matchToken:e=>PL.exec(e)?.[0]??null,type:`PLACEHOLDER`},{matchToken:e=>FL.exec(e)?.[0]??null,type:`COMMENT`},{matchToken:e=>IL.exec(e)?.[0]??null,type:`OPERATOR`},{matchToken:e=>LL.exec(e)?.[0]??null,type:`PUNCTUATION`}];function zL(e,t){try{let t=[],n=e.length,r=0,i=``;for(;r<n;){let n=!1,a=e.substring(r);for(let{type:e,matchToken:o}of RL){let s=o(a);if(s){i!==``&&(t.push({type:`UNKNOWN`,value:i}),i=``),t.push({type:e,value:s}),r+=s.length,n=!0;break}}n||(i+=a[0],r++)}return i!==``&&t.push({type:`UNKNOWN`,value:i}),t}catch{return[{type:`SQL`,value:e}]}}function BL(e,t){let n=zL(e,`sqlite`).filter(e=>e.type!==`WHITESPACE`),r=VL(n,EL).map(e=>e.value).join(``).trim(),i=zL(r,`sqlite`).filter(e=>e.type!==`WHITESPACE`);if(i.length!==n.length)throw Error(`Fail to format the query`);for(let e=0;e<i.length;e++){let t=n[e],r=i[e];if(t.value!==r.value)throw Error(`Fail to format the query at token #${e}: "${t.value}" -> "${r.value}"`)}return r}function VL(e,t){let n=[],r=new Set(t.map(e=>e.toUpperCase())),i=[];for(let t=0;t<e.length;t++){let a=e[t],o=t>0?e[t-1]:void 0,s=a.value.toUpperCase();if(a.type===`COMMENT`){KL(n)&&UL(n,i),n.push(a),UL(n,i);continue}if([`SELECT`,`SET`,`WHERE`].includes(s)){for(;[`SET`,`JOIN`].includes(HL(i)??``);)i.pop();KL(n)&&UL(n,i),n.push(a),i.push(s),UL(n,i);continue}if([`INNER`,`LEFT`,`RIGHT`].includes(s)){HL(i)!==`JOIN`&&i.push(`JOIN`),UL(n,i),n.push(a);continue}if(s===`FROM`){HL(i)===`SELECT`&&i.pop(),UL(n,i),n.push(a);continue}if([`VALUES`,`ORDER`,`GROUP`,`LIMIT`,`OFFSET`,`HAVING`].includes(s)){[`SET`,`WHERE`].includes(HL(i)??``)&&i.pop(),UL(n,i),n.push(a);continue}if([`AND`,`OR`].includes(s)){HL(i)!==`LPAREN-INLINE`&&UL(n,i),n.push(a);continue}if(s===`,`){n.push(a),HL(i)!==`LPAREN-INLINE`&&UL(n,i);continue}if(s===`(`){let s=!0,c=o?.type===`IDENTIFIER`&&r.has(o?.value.toUpperCase());(c||GL(e,t,2)===`INTO`||GL(e,t)===`VALUES`)&&(s=!1),[`TABLE`].includes((WL(e,t,2)?.value??``).toUpperCase())&&WL(e,t)?.type===`IDENTIFIER`&&(s=!0),KL(n)&&!c&&n.push({type:`WHITESPACE`,value:` `}),i.push(s?`LPAREN`:`LPAREN-INLINE`),n.push(a),s&&UL(n,i);continue}if(s===`)`){for(;i.length>0&&![`LPAREN`,`LPAREN-INLINE`].includes(HL(i)??``);)i.pop();HL(i)===`LPAREN`?(i.pop(),UL(n,i)):HL(i)===`LPAREN-INLINE`&&i.pop(),n.push(a);continue}if(s===`;`){n.push(a),i=[],UL(n,i),UL(n,i);continue}if([`,`,`.`].includes(s)){n.push(a);continue}KL(n)&&n.push({type:`WHITESPACE`,value:` `}),n.push(a)}return n}function HL(e,t=1){return e.length-t>=0?e[e.length-t]:void 0}function UL(e,t){let n=t.reduce((e,t)=>t===`LPAREN-INLINE`?e:e+1,0);e.push({type:`WHITESPACE`,value:`
`+` `.repeat(n)})}function WL(e,t,n=1){let r=t-n;if(!(t-n<0))return e[r]}function GL(e,t,n=1){return(WL(e,t,n)?.value??``).toUpperCase()}function KL(e){if(e.length===0)return!1;let t=e[e.length-1];return!(t.type===`WHITESPACE`||t.value===`.`||t.value===`(`)}function qL(e){try{let t=zL(e,`sqlite`).filter(e=>e.type!==`WHITESPACE`),n=t.findIndex(e=>e.value.toUpperCase()===`FROM`);if(n===-1)return``;let r=t[n+1];return!r||r.type!==`IDENTIFIER`?``:r.value}catch{return``}}function JL(e){if(e instanceof Error)return e.message;if(typeof e==`object`&&e&&`errors`in e){let t=e.errors;if(Array.isArray(t)&&t.length>0&&t[0]?.message)return t[0].message}if(typeof e==`string`)return e;try{let t=String(e);return t===`[object Object]`?JSON.stringify(e):t}catch{return`Unknown error`}}function YL(e){return e.name.new!==e.name.old||e.columns.some(e=>!mw(e.new,e.old))||e.constraints.some(e=>!mw(e.new,e.old))}function XL(e){return`'${e.replace(/'/g,`''`)}'`}function ZL(e){if(e===void 0)return`DEFAULT`;if(e===null)return`NULL`;if(typeof e==`string`)return XL(e);if(typeof e==`number`||typeof e==`bigint`)return e.toString();throw e instanceof ArrayBuffer||Array.isArray(e)?Error(`Blob escape is not supported yet`):Error(e.toString()+` is unrecognized type of value`)}function QL({headers:e,rows:t,transformHeader:n,transformValue:r}){let i=new Set,a=e.map((e,t)=>{let r=n(e,t),a=r.name,o=1;for(;i.has(a);)a=`${r.name}_${o++}`;return i.add(a),{...r,name:a}});return{headers:a,rows:t.map(e=>a.reduce((t,n,i)=>(t[n.name]=r?r(e[i],n):e[i],t),{}))}}async function $L(e,t,n){let r=[],i=[],a=t.length;function o(e,t=!1){n?.({error:t,logs:r,progress:e,total:a})}for(let n=0;n<t.length;n++){let a=t[n],s=a,c={order:n,sql:s,start:Date.now()};r.push(c),o(n+1);try{let t=await e.query(s);if(c.end=Date.now(),c.stats=t.stat,t.stat={...t.stat,requestDurationMs:c.end?c.end-c.start:null},t.headers.length>0){let e=qL(s);i.push({sql:a,order:n,predictedTableName:e,result:t})}o(n+1)}catch(e){c.end=Date.now(),c.error=JL(e),o(n+1,!0);break}}return{logs:r,result:i}}function eR({data:e}){let t=e.rows.map(e=>({...e,children:[]})),n=t.reduce((e,t)=>({...e,[t.id]:t}),{});for(let e of t)e.parent&&n[e.parent]?.children.push(e);return t=t.filter(e=>e.parent===0),(0,U.jsx)(`div`,{className:`h-full w-full grow overflow-auto p-8`,children:(0,U.jsx)(`div`,{className:`font-mono text-sm`,children:(0,U.jsx)(tR,{data:t})})})}function tR({data:e}){return(0,U.jsx)(U.Fragment,{children:e.map(e=>{let{label:t,performance:n}=nR(e.detail);return(0,U.jsxs)(H.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex h-8 items-center gap-2`,children:[(0,U.jsx)(`div`,{className:ia(`inline-flex rounded-full border`,{"bg-green-500":n===`fast`,"bg-red-500":n===`slow`,"bg-yellow-500":n===`medium`,"bg-gray-500":n===`neutral`}),style:{width:10,height:10,marginLeft:-5}}),(0,U.jsx)(`div`,{children:t})]}),(0,U.jsx)(`div`,{className:`border-l pl-4`,children:(0,U.jsx)(tR,{data:e.children})})]},e.id)})})}function nR(e){return e.startsWith(`SCAN `)?{performance:`slow`,label:(0,U.jsxs)(`div`,{className:`flex items-center`,children:[(0,U.jsx)(`strong`,{children:`SCAN `}),(0,U.jsxs)(`span`,{className:`mx-2 flex items-center gap-2 rounded border border-kumo-fill p-1`,children:[(0,U.jsx)(Pa,{}),e.substring(5)]})]})}:e.startsWith(`CORRELATED `)?{performance:`slow`,label:(0,U.jsxs)(`div`,{children:[(0,U.jsx)(rx,{side:`bottom`,content:(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{children:[`This subquery depends on values from the outer query, so it's evaluated once per outer row.`,` `,(0,U.jsx)(`strong`,{className:`text-red-500`,children:`Can be slow on large inputs`}),`.`]}),(0,U.jsx)(`div`,{className:`text-green-500`,children:`Mitigate by indexing the correlated columns or rewriting as a JOIN + aggregate.`})]}),children:(0,U.jsx)(`strong`,{className:`cursor-pointer underline`,children:`CORRELATED`})}),(0,U.jsx)(`span`,{children:e.substring(10)})]})}:e.startsWith(`SEARCH `)?{performance:`fast`,label:(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:`SEARCH `}),(0,U.jsx)(`span`,{children:e.substring(6)})]})}:e.startsWith(`USE TEMP B-TREE FOR ORDER BY`)||e.startsWith(`USE TEMP B-TREE FOR GROUP BY`)||e.startsWith(`USE TEMP B-TREE FOR DISTINCT`)?{performance:`medium`,label:(0,U.jsx)(rx,{side:`bottom`,content:(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{children:[`SQLite can’t return rows in the requested order/grouping directly, so it gathers them into a temporary structure and processes them before returning results.`,` `,(0,U.jsx)(`span`,{className:`text-red-500`,children:`This adds extra work and grows with result size.`})]}),(0,U.jsx)(`div`,{className:`text-green-500`,children:`Add an index that matches the clause (ORDER BY / GROUP BY / DISTINCT) to avoid the temp structure.`})]}),children:(0,U.jsx)(`strong`,{className:`cursor-pointer underline`,children:e})})}:{label:(0,U.jsx)(`span`,{children:e}),performance:`neutral`}}var rR=class{dialect=`sqlite`;isSupportDropTable=!0;isSupportEditTable=!0;isSupportExplain=!1;isSupportReturningValue=!1;isSupportRowid=!1},iR=class extends rR{conn;constructor(e){super(),this.conn=e}escapeValue(e){return ZL(e)}getColumnTypeHint(){return null}async query(e){return this.conn.query(e)}async transaction(e){return this.conn.transaction(e)}async batch(e){if(this.conn.batch)return this.conn.batch(e);let t=[];for(let n of e){let e=await this.query(n);t.push(e)}return t}async dropTable(e,t){await this.query(`DROP TABLE ${this.escapeId(e)}.${this.escapeId(t)}`)}generateTableSchemaStatement(e){throw Error(`Not yet implemented`)}async findFirst(e,t,n){let r=Object.entries(n).map(([e,t])=>`${this.escapeId(e)} = ${this.escapeValue(t)}`).join(` AND `),i=`SELECT * FROM ${this.escapeId(e)}.${this.escapeId(t)} ${r?`WHERE `+r:``} LIMIT 1 OFFSET 0`;return this.query(i)}createMutationStatements(e,t,n,r){r&&n.forEach(e=>aR(e,r));let i=this.isSupportRowid&&!r?.withoutRowId;return n.map(n=>n.operation===`INSERT`?lR(this,e,t,n.values,this.isSupportReturningValue,i):n.operation===`DELETE`?dR(this,e,t,n.where):uR(this,e,t,n.values,n.where,this.isSupportReturningValue,i))}async mutateTableRows(e,t,n,r){let i=this.createMutationStatements(e,t,n,r),a=await this.transaction(i),o=[];for(let r=0;r<a.length;r++){let i=a[r],s=n[r];if(!i||!s){o.push({});continue}let{operation:c}=s;if(c===`UPDATE`){if(i.rows.length===1)o.push({record:i.rows[0]});else{let n=await this.findFirst(e,t,s.where);o.push({lastId:i.lastInsertRowid,record:n.rows[0]})}continue}if(c===`INSERT`){if(i.rows.length===1)o.push({record:i.rows[0]});else if(s.autoIncrementPkColumn){let n=await this.findFirst(e,t,{[s.autoIncrementPkColumn]:i.lastInsertRowid});o.push({lastId:i.lastInsertRowid,record:n.rows[0]})}else if(s.pk?.length){let n=s.pk.reduce((e,t)=>(e[t]=s.values[t],e),{}),r=await this.findFirst(e,t,n);o.push({lastId:i.lastInsertRowid,record:r.rows[0]})}else o.push({});continue}o.push({})}return o}buildExplainStatement(e){throw Error(`Not implemented`)}getQueryTabOverride(e,t){return null}};function aR(e,t){let{operation:n}=e,{pk:r,autoIncrement:i}=t,a=n===`INSERT`?{}:e.where,o=n===`DELETE`?{}:e.values,s=r.some(e=>a[e]==null),c=r.some(e=>(e in o?o[e]:a[e])==null);if(r.length===0)throw Error(`This table has no primary key. Unsafe to perform insert, update, or delete operations.`);switch(n){case`DELETE`:if(s)throw Error(`Cannot delete a row with NULL in primary key columns.`);break;case`UPDATE`:if(s)throw Error(`Cannot update a row with NULL in primary key columns.`);if(c)throw Error(`Cannot update a row causing NULL in primary key columns.`);break;case`INSERT`:{let e=r[0];if(i&&e&&o[e]===null)throw Error(`Cannot insert a row with NULL in the auto-increment primary key column.`);if(!i&&c)throw Error(`Cannot insert a row with NULL in primary key columns.`);break}}}function oR(e,t){let n=Object.entries(t).map(([t,n])=>n==null?`${e.escapeId(t)} IS NULL`:`${e.escapeId(t)} = ${e.escapeValue(n)}`).join(` AND `);return n.length>0?`WHERE `+n:null}function sR(e,t){return Object.entries(t).map(([t,n])=>`${e.escapeId(t)} = ${e.escapeValue(n)}`).join(`, `)}function cR(e,t){let n=[],r=[];for(let[i,a]of Object.entries(t))n.push(e.escapeId(i)),r.push(e.escapeValue(a));return`(${n.join(`, `)}) VALUES(${r.join(`, `)})`}function lR(e,t,n,r,i,a){return[`INSERT INTO`,`${e.escapeId(t)}.${e.escapeId(n)}`,cR(e,r),i?`RETURNING ${a?`rowid, `:``}*`:``].join(` `)}function uR(e,t,n,r,i,a,o){return[`UPDATE`,`${e.escapeId(t)}.${e.escapeId(n)}`,`SET`,sR(e,r),oR(e,i),a?`RETURNING ${o?`rowid, `:``}*`:``].filter(Boolean).join(` `)}function dR(e,t,n,r){return[`DELETE FROM`,`${e.escapeId(t)}.${e.escapeId(n)}`,oR(e,r)].filter(Boolean).join(` `)}function fR(e,t){let n={...e};for(let e of t)delete n[e];return n}function pR(e){return e.length>=2&&e.startsWith(`(`)&&e.endsWith(`)`)?e:`(${e})`}function mR(e,t){let n=[e.escapeId(t.name),t.type];t.constraint?.primaryKey&&n.push([`PRIMARY KEY`,t.constraint.primaryKeyOrder,t.constraint.primaryKeyConflict?`ON CONFLICT ${t.constraint.primaryKeyConflict}`:void 0,t.constraint.autoIncrement?`AUTOINCREMENT`:void 0].filter(Boolean).join(` `)),t.constraint?.unique&&n.push([`UNIQUE`,t.constraint.uniqueConflict?`ON CONFLICT ${t.constraint.uniqueConflict}`:void 0].filter(Boolean).join(` `)),t.constraint?.notNull&&n.push([`NOT NULL`,t.constraint.notNullConflict?`ON CONFLICT ${t.constraint.notNullConflict}`:void 0].filter(Boolean).join(` `)),t.constraint?.defaultValue&&n.push([`DEFAULT`,e.escapeValue(t.constraint.defaultValue)].join(` `)),t.constraint?.defaultExpression&&n.push([`DEFAULT`,pR(t.constraint.defaultExpression)].join(` `)),t.constraint?.generatedExpression&&n.push([`GENERATED ALWAYS AS`,pR(t.constraint.generatedExpression),t.constraint.generatedType].join(` `)),t.constraint?.checkExpression&&n.push(`CHECK `+pR(t.constraint.checkExpression));let r=t.constraint?.foreignKey?.foreignTableName,i=(t.constraint?.foreignKey?.foreignColumns??[void 0])[0];return r&&i&&n.push([`REFERENCES`,e.escapeId(r)+`(${e.escapeId(i)})`].join(` `)),n.join(` `)}function hR(e,t){return t.primaryKey?`PRIMARY KEY (${t.primaryColumns?.map(e.escapeId).join(`, `)})`:t.unique?`UNIQUE (${t.uniqueColumns?.map(e.escapeId).join(`, `)})`:t.checkExpression===void 0?t.foreignKey?`FOREIGN KEY (${t.foreignKey.columns?.map(e.escapeId).join(`, `)}) REFERENCES ${e.escapeId(t.foreignKey.foreignTableName??``)} (${t.foreignKey.foreignColumns?.map(e.escapeId).join(`, `)})`:``:`CHECK (${t.checkExpression})`}function gR(e,t){let n=!t.name.old,r=[];for(let i of t.columns)i.new===null?r.push(`DROP COLUMN ${e.escapeId(i.old?.name??``)}`):i.old===null?n?r.push(mR(e,i.new)):r.push(`ADD `+mR(e,i.new)):(i.new.name!==i.old.name&&r.push(`RENAME COLUMN ${e.escapeId(i.old.name)} TO ${e.escapeId(i.new.name)}`),mw(fR(i.old,[`name`]),fR(i.new,[`name`]))||r.push(`ALTER COLUMN ${e.escapeId(i.new.name)} TO ${mR(e,i.new)}`));for(let i of t.constraints)i.new&&n&&r.push(hR(e,i.new));if(n||t.name.new!==t.name.old&&r.push(`RENAME TO ${e.escapeId(t.name.new??``)}`),n)return[`CREATE TABLE ${e.escapeId(t.schemaName??`main`)}.${e.escapeId(t.name.new||`no_table_name`)}(\n${r.map(e=>` `+e).join(`,
`)}\n)`];let i=`ALTER TABLE ${e.escapeId(t.schemaName??`main`)}.${e.escapeId(t.name.old??``)} `;return r.map(e=>i+e)}function _R(e){let t=e.replace(/^["`[]/g,``);return t=t.replace(/["`\]]$/g,``),t=t.replace(/""/g,`"`),t}var vR=class e{tokens;ptr=0;constructor(e){for(this.tokens=e;this.tokens.length>0&&this.tokens[0].type===`WHITESPACE`;)this.tokens.shift();for(;this.tokens.length>0&&this.tokens[this.tokens.length-1].type===`WHITESPACE`;)this.tokens.pop()}getPointer(){return this.ptr}toStringRange(e,t){return this.tokens.slice(e,t).map(e=>e.value).join(``)}read(){return this.end()?``:this.tokens[this.ptr].value}consumeBlock(){return this.match(`(`)?this.consumeParen().toString():this.consume()}currentType(){return this.tokens[this.ptr].type}consumeParen(){if(this.read()!==`(`)throw Error(`Expecting (`);let t=this.ptr+1,n=1;for(;n>0;){if(!this.next())throw Error(`Expecting closing paren`);this.read()===`(`&&n++,this.read()===`)`&&n--}let r=new e(this.tokens.slice(t,this.ptr));return this.next(),r}consume(){let e=this.read();return this.next(),e}consumeIdentifier(){let e=_R(this.read());return this.next(),e}expectToken(e){if(!this.match(e))throw Error(`Expecting ${e}`);this.next()}expectTokenOptional(e){this.match(e)&&this.next()}expectTokensOptional(e){if(e.length===0)return;let[t]=e;if(this.match(t)){this.next();for(let t of e.slice(1))this.expectToken(t)}}expectTokens(e){for(let t of e)this.expectToken(t)}next(){for(this.ptr+=1;this.ptr<this.tokens.length;this.ptr++)if(this.currentType()!==`WHITESPACE`)return!0;return!1}match(e){return this.end()?!1:this.read().toLowerCase()===e.toLowerCase()}matchTokens(e){return e.some(e=>this.read().toLowerCase()===e.toLowerCase())}end(){return this.ptr>=this.tokens.length}toString(){return this.tokens.map(e=>e.value).join(``)}toStringWithParen(){return`(`+this.toString()+`)`}};function yR(e,t){let n=t.consumeIdentifier();if(!n)return null;let r=t.read();[`,`,`CHECK`,`COLLATE`,`CONSTRAINT`,`DEFAULT`,`GENERATED`,`NOT`,`PRIMARY`,`REFERENCES`,`UNIQUE`].includes(r.toUpperCase())?r=``:t.next(),t.match(`(`)&&(r+=t.consumeParen().toStringWithParen());let i=SR(e,t);return{name:n,pk:i?.primaryKey,constraint:i,type:r}}function bR(e){if(e.match(`ON`)&&(e.next(),e.match(`CONFLICT`)&&(e.next(),!e.end()))){let t=e.read().toUpperCase();return e.next(),t}}function xR(e){let t=[];for(;!e.end()&&(t.push(e.consumeIdentifier()),e.match(`,`));)e.next();return t}function SR(e,t){if(t.match(`CONSTRAINT`)){t.next();let n=t.consume();return{...SR(e,t),name:n}}else if(t.match(`PRIMARY`)){let n,r,i=!1;if(t.next(),!t.match(`KEY`))throw Error(`PRIMARY must follow by KEY`);t.next(),t.match(`(`)&&(r=xR(t.consumeParen())),t.match(`ASC`)?(n=`ASC`,t.next()):t.match(`DESC`)&&(n=`DESC`,t.next());let a=bR(t);return t.match(`AUTOINCREMENT`)&&(i=!0,t.next()),{primaryKey:!0,primaryKeyOrder:n,primaryColumns:r,autoIncrement:i,primaryKeyConflict:a,...SR(e,t)}}else if(t.match(`NOT`)){if(t.next(),!t.match(`NULL`))throw Error(`NOT should follow by NULL`);return t.next(),{notNull:!0,notNullConflict:bR(t),...SR(e,t)}}else if(t.match(`NULL`))return t.next(),{notNull:!1,...SR(e,t)};else if(t.match(`UNIQUE`)){let n;return t.next(),t.read()===`(`&&(n=xR(t.consumeParen())),{unique:!0,uniqueConflict:bR(t),uniqueColumns:n,...SR(e,t)}}else if(t.match(`DEFAULT`)){let n,r;return t.next(),t.currentType()===`STRING`?(n=t.read().slice(1,-1),t.next()):t.currentType()===`OPERATOR`?t.match(`+`)?(t.next(),n=Number(t.read()),t.next()):t.match(`-`)&&(t.next(),n=-Number(t.read()),t.next()):t.currentType()===`NUMBER`?(n=Number(t.read()),t.next()):t.match(`(`)?r=t.consumeParen().toString():(t.match(`current_timestamp`)||t.match(`current_time`)||t.match(`current_date`)||t.match(`true`)||t.match(`false`)||t.match(`null`))&&(r=t.read(),t.next()),{defaultValue:n,defaultExpression:r,...SR(e,t)}}else if(t.match(`CHECK`))return t.next(),{checkExpression:t.consumeBlock(),...SR(e,t)};else if(t.match(`COLLATE`)){t.next();let n=t.read();return t.next(),{collate:n,...SR(e,t)}}else if(t.match(`FOREIGN`)){if(t.next(),!t.match(`KEY`))throw Error(`FOREIGN should follow by KEY`);t.next();let n=xR(t.consumeParen()),r=SR(e,t);return{foreignKey:{foreignSchemaName:e,foreignTableName:r?.foreignKey?.foreignTableName??``,foreignColumns:r?.foreignKey?.foreignColumns??[],columns:n}}}else if(t.match(`REFERENCES`)){t.next();let n=t.consumeIdentifier(),r=[];for(;!t.end()&&!t.match(`(`)&&!t.match(`,`);)t.next();return t.match(`(`)&&(r=xR(t.consumeParen())),{foreignKey:{foreignSchemaName:e,foreignTableName:n,foreignColumns:r},...SR(e,t)}}else if(t.match(`GENERATED`)){if(t.next(),!t.match(`ALWAYS`))throw Error(`GENERATED should follow by ALWAYS`);if(t.next(),!t.match(`AS`))throw Error(`GENERATED ALWAYS should follow by AS`);t.next();let n=t.consumeBlock();return{generatedType:t.match(`STORED`)?`STORED`:`VIRTUAL`,generatedExpression:n,...SR(e,t)}}}function CR(e,t){let n=!0,r=!1,i=[],a=[];for(;n;){if(n=!1,t.matchTokens([`CHECK`,`CONSTRAINT`,`FOREIGN`,`PRIMARY`,`UNIQUE`])){let i=SR(e,t);i&&(r=!0,a.push(i),n=!0)}else if(!r){let r=yR(e,t);r&&(i.push(r),n=!0)}for(;t.read()!==`,`&&!t.end();)t.next();if(t.end())break;t.next()}for(let e of a)if(e.primaryKey&&e.primaryColumns)for(let t of e.primaryColumns){let e=i.find(e=>t.toLowerCase()===e.name.toLowerCase());e&&(e.pk=!0)}for(let e of i){let t=e.constraint?.foreignKey;t?.foreignColumns&&t.foreignColumns.length===0&&(t.foreignColumns=[e.name])}return{columns:i,constraints:a}}function wR(e){if(!e)return{};let t,n,r=e;for(;!r.end();)r.match(`content`)?(r.next(),r.match(`=`)&&(r.next(),r.end()||(t=_R(r.read()),r.next()))):r.match(`content_rowid`)&&(r.next(),r.match(`=`)&&(r.next(),r.end()||(n=_R(r.read()),r.next()))),r.next();return{content:t,contentRowId:n}}function TR(e){if(e.match(`WITHOUT`)){if(e.next(),e.match(`ROWID`))return e.next(),e.match(`,`)?(e.next(),{withoutRowId:!0,...TR(e)}):{withoutRowId:!0}}else if(e.match(`STRICT`))return e.next(),e.match(`,`)?(e.next(),{strict:!0,...TR(e)}):{strict:!0}}function ER(e,t){let n=new vR(zL(t,`sqlite`).filter(e=>e.type!==`COMMENT`));n.expectToken(`CREATE`),n.expectTokenOptional(`TEMP`),n.expectTokenOptional(`TEMPORARY`),n.expectTokenOptional(`VIRTUAL`),n.expectToken(`TABLE`),n.expectTokensOptional([`IF`,`NOT`,`EXISTS`]);let r=n.consumeIdentifier(),i;n.match(`USING`)&&(n.next(),n.match(`FTS5`)&&(n.next(),i=wR(n.consumeParen())));let a=n.match(`(`)?CR(e,n.consumeParen()):{columns:[],constraints:[]},o=a.columns.filter(e=>e.pk).map(e=>e.name),s=a.columns.some(e=>!!e.constraint?.autoIncrement);return{schemaName:e,tableName:r,...a,autoIncrement:s,fts5:i,pk:o,...TR(n)}}function DR(e){let t=new vR(zL(e,`sqlite`)),n={columns:[],name:``,tableName:``,type:`KEY`};return t.expectToken(`CREATE`),t.match(`UNIQUE`)&&(n.type=`UNIQUE`,t.next()),t.expectToken(`INDEX`),t.expectTokensOptional([`IF`,`NOT`,`EXISTS`]),n.name=t.consumeIdentifier(),t.expectToken(`ON`),n.tableName=t.consumeIdentifier(),t.match(`(`)&&(n.columns=xR(t.consumeParen())),n}var OR=class extends iR{isSupportEditTable=!0;isSupportExplain=!0;isSupportReturningValue=!0;isSupportRowid=!0;escapeId(e){return`"${e.replace(/"/g,`""`)}"`}getColumnTypeHint(e){return e?(e=e.toUpperCase(),e.includes(`TEXT`)||e.includes(`CHAR`)||e.includes(`CLOB`)||e.includes(`STRING`)?`TEXT`:e.includes(`INT`)||e.includes(`NUMBER`)||e.includes(`REAL`)||e.includes(`DOUBLE`)||e.includes(`FLOAT`)?`NUMBER`:e.includes(`BLOB`)?`BLOB`:`TEXT`):null}async schemas(){let e=`main`,t=await this.query(`SELECT * FROM sqlite_master;`),n=[],r=t.rows;for(let t of r){if(t.type===`table`){try{n.push({type:`table`,schemaName:e,name:t.name,tableSchema:{...ER(e,t.sql),createScript:t.sql}})}catch{console.warn(`Failed to parse schema for table: ${t.name}`),n.push({type:`table`,name:t.name,schemaName:e})}continue}if(t.type===`trigger`){n.push({type:`trigger`,name:t.name,tableName:t.tbl_name,schemaName:e});continue}t.type===`view`&&n.push({type:`view`,name:t.name,schemaName:e})}let i=n.filter(e=>e.tableSchema?.fts5).map(e=>e.name),a=new Set(i.map(e=>[`${e}_content`,`${e}_idx`,`${e}_docsize`,`${e}_config`,`${e}_data`]).flat());return n=n.filter(e=>!a.has(e.name)),{[e]:n}}async tableSchema(e,t){let n=`SELECT * FROM ${this.escapeId(e)}.sqlite_schema WHERE tbl_name = ${this.escapeValue(t)} AND "type" IN ('table', 'view', 'index');`,r=(await this.query(n)).rows,i=r.filter(e=>e.type===`index`&&e.sql!==null),a=[];for(let e of i)try{a.push(DR(e.sql))}catch{continue}let o=r.find(e=>e.type===`table`||e.type===`view`);if(!o)throw Error(`Unexpected error finding table `+t);if(o.type===`view`)return this.getFallbackTableSchema(e,t);try{let n=o.sql,r={...ER(e,n),createScript:n,indexes:a,schemaName:e,type:`table`};return r.fts5?{...await this.getFallbackTableSchema(e,t),fts5:r.fts5}:r}catch{throw Error(`Failed to parse CREATE TABLE script for '${t}'`)}}async getFallbackTableSchema(e,t){let n=`SELECT * FROM ${this.escapeId(e)}.pragma_table_info(${this.escapeValue(t)});`,r=(await this.query(n)).rows.map(e=>({name:e.name,pk:!!e.pk,type:e.type}));return{autoIncrement:!1,columns:r,pk:r.filter(e=>e.pk).map(e=>e.name),schemaName:e,tableName:t}}async selectTable(e,t,n){let r=await this.tableSchema(e,t),{limit:i,offset:a,orderByColumn:o,orderByDirection:s}=n,c=!r.fts5&&r.pk.length===0&&!r.withoutRowId&&!r.columns.find(e=>e.name===`rowid`)&&r.type===`table`;c&&(r.columns=[{constraint:{primaryKey:!0,autoIncrement:!0},name:`rowid`,type:`INTEGER`},...r.columns],r.pk=[`rowid`],r.autoIncrement=!0);let l=`${this.escapeId(e)}.${this.escapeId(t)}`,u=`*`;c?u=`rowid, *`:r.fts5&&(u=`rank, *`);let d=`SELECT ${u} FROM ${l}`,f=o&&s&&[`ASC`,`DESC`].includes(s)?`ORDER BY ${this.escapeId(o)} ${s}`:``,p=`LIMIT ${this.escapeValue(i)} OFFSET ${this.escapeValue(a)}`,m=[d,n.whereRaw?`WHERE ${n.whereRaw}`:``,f,p].filter(Boolean).join(` `),h=await this.conn.query(m);return r.fts5?{result:h,schema:{...r,columns:[{name:`rank`,type:`INTEGER`},...r.columns]}}:{result:h,schema:r}}generateTableSchemaStatement(e){return gR(this,e)}buildExplainStatement(e){let t=zL(e.trim(),`sqlite`).filter(e=>e.type!==`COMMENT`).map(e=>e.value===`?`?{type:`STRING`,value:`''`}:e).map(e=>e.value).join(``).replace(/^(?!EXPLAIN\s+QUERY\s+PLAN\b)(?:EXPLAIN\b(?:\s+ANALYZE\b)?\s*)?/i,`EXPLAIN QUERY PLAN `);if(!t.startsWith(`EXPLAIN QUERY PLAN `))throw Error(`Explain statement must start with EXPLAIN QUERY PLAN`);return t}getQueryTabOverride(e,t){return e.toUpperCase().startsWith(`EXPLAIN QUERY PLAN `)?{component:eR({data:t}),icon:Ma,label:`Explain`}:null}},kR=class{databaseId;constructor(e){this.databaseId=e}async query(e){let[t]=await this.transaction([e]);if(!t)throw Error(`No result returned from query`);return t}async transaction(e){let t=await aC({body:{sql:e.map(e=>e.trim().replace(/;+$/,``)).join(`;`)},path:{database_id:this.databaseId}});if(!t.data?.result)throw Error(`Invalid response: missing result data`);return t.data.result.map(e=>this.transformResult(e))}transformResult(e){let t=e.results?.rows??[];return{...QL({headers:e.results?.columns??[],rows:t,transformHeader:e=>({name:e,displayName:e})}),lastInsertRowid:e.meta?.last_row_id,stat:{queryDurationMs:e.meta?.duration??null,rowsAffected:e.meta?.changes??0,rowsRead:e.meta?.rows_read??null,rowsWritten:e.meta?.rows_written??null,rowCount:t.length}}}},AR=class extends OR{constructor(e){super(new kR(e))}async schemas(){let e=await super.schemas(),t=new Set([`_cf_METADATA`]);return Object.fromEntries(Object.entries(e).map(([e,n])=>[e,n.filter(e=>!t.has(e.name))]))}},jR=ur(`/d1/$databaseId`)({component:mr(()=>ow(()=>import(`./_databaseId-DKV0AVD1.js`),__vite__mapDeps([17,6,1,7,18,10,11,8,19,20,21,13,22])),`component`),errorComponent:mr(()=>ow(()=>import(`./_databaseId-CdtZCI__.js`),__vite__mapDeps([23,3])),`errorComponent`),loader:async e=>({tables:((await new AR(e.params.databaseId).schemas()).main??[]).filter(e=>e.type===`table`||e.type===`view`).map(e=>({label:e.name,value:e.name})).sort((e,t)=>e.label.localeCompare(t.label))}),validateSearch:e=>({table:typeof e.table==`string`?e.table:void 0,worker:typeof e.worker==`string`?e.worker:void 0})}),MR=ur(`/workflows/$workflowName/`)({component:mr(()=>ow(()=>import(`./_workflowName-XnNI8_83.js`),__vite__mapDeps([24,6,1,7,8,19,11,25,26,12,27,22])),`component`),errorComponent:mr(()=>ow(()=>import(`./_workflowName-D6aLbpPO.js`),__vite__mapDeps([28,3])),`errorComponent`),loader:async({params:e})=>{let t=await hC({path:{workflow_name:e.workflowName},query:{page:1,per_page:25},throwOnError:!1});if(t.response?.status===404)throw Qe();if(t.error)throw Error(`Failed to list instances for workflow "${e.workflowName}"`);return{instances:t.data?.result??[],resultInfo:t.data?.result_info??{page:1,per_page:25,total_count:0,total_pages:0}}},notFoundComponent:mr(()=>ow(()=>import(`./_workflowName-CilyTuV7.js`),[]),`notFoundComponent`)}),NR=ur(`/r2/$bucketName/`)({component:mr(()=>ow(()=>import(`./_bucketName-BuHFqJ3G.js`),__vite__mapDeps([29,6,1,10,11,7,8,9,20,25,21,12,30,27])),`component`),errorComponent:mr(()=>ow(()=>import(`./_bucketName-CS1L-PCq.js`),__vite__mapDeps([31,3])),`errorComponent`),loaderDeps:({search:e})=>({prefix:e.prefix,delimiter:e.delimiter}),loader:async({params:e,deps:t})=>{let n=await lC({path:{bucket_name:e.bucketName},query:{delimiter:t.delimiter===!1?void 0:`/`,per_page:100,prefix:t.prefix||void 0},throwOnError:!1});if(n.response?.status===404)throw Qe();if(n.error)throw Error(`Failed to list objects in bucket "${e.bucketName}"`);return{objects:n.data?.result??[],delimitedPrefixes:n.data?.result_info?.delimited??[],cursor:n.data?.result_info?.cursor??null,isTruncated:n.data?.result_info?.is_truncated===`true`,delimiterEnabled:t.delimiter!==!1}},notFoundComponent:mr(()=>ow(()=>import(`./_bucketName-pN5Q7B2g.js`),[]),`notFoundComponent`),validateSearch:e=>({delimiter:e.delimiter!==!1,prefix:typeof e.prefix==`string`?e.prefix:void 0})}),PR=ur(`/do/$className/`)({component:mr(()=>ow(()=>import(`./_className-SARYBJoc.js`),__vite__mapDeps([32,6,1,11,9,10])),`component`),errorComponent:mr(()=>ow(()=>import(`./_className-BWgbIQPi.js`),__vite__mapDeps([33,3])),`errorComponent`),loader:async({params:e})=>{let t=((await oC()).data?.result??[]).find(t=>t.class===e.className||t.name===e.className||t.id===e.className);if(!t?.id)throw Qe();let n=await sC({path:{id:t.id},query:{limit:50}}),r=n.data?.result??[],i=n.data?.result_info?.cursor??null;return{cursor:i,hasMore:!!i,namespaceId:t.id,objects:r}},notFoundComponent:mr(()=>ow(()=>import(`./_className-BQICKsOR.js`),[]),`notFoundComponent`)}),FR=ur(`/workflows/$workflowName/$instanceId`)({component:mr(()=>ow(()=>import(`./_instanceId-ZzudZhdh.js`),__vite__mapDeps([34,6,1,7,8,25,21,26,22])),`component`),errorComponent:mr(()=>ow(()=>import(`./_instanceId-CHeCjR3S.js`),__vite__mapDeps([35,3])),`errorComponent`),loader:async({params:e})=>{let t=await vC({path:{instance_id:e.instanceId,workflow_name:e.workflowName},throwOnError:!1});if(t.response?.status===404)throw Qe();if(t.error)throw Error(`Failed to fetch workflow instance "${e.instanceId}"`);let n=t.data?.result;if(!n)throw Qe();return{details:n}},notFoundComponent:mr(()=>ow(()=>import(`./_instanceId-BkMduKSZ.js`),[]),`notFoundComponent`)}),IR=class{namespaceId;objectId;objectName;constructor(e,t,n){if(this.namespaceId=e,this.objectId=t,this.objectName=n,!t&&!n)throw Error("Either `objectId` or `objectName` must be provided to identify the Durable Object")}async query(e){let[t]=await this.transaction([e]);if(!t)throw Error(`No result returned from query`);return t}async transaction(e){let t=e.map(e=>e.trim().replace(/;+$/,``)).map(e=>({sql:e})),n=await fC({body:this.objectId?{durable_object_id:this.objectId,queries:t}:{durable_object_name:this.objectName,queries:t},path:{namespace_id:this.namespaceId}});if(!n.data?.result)throw Error(`Invalid response: missing result data`);return n.data.result.map(e=>this.transformResult(e))}transformResult(e){let t=e.rows??[];return{...QL({headers:e.columns??[],rows:t,transformHeader:e=>({name:e,displayName:e})}),stat:{queryDurationMs:null,rowsAffected:0,rowsRead:e.meta?.rows_read??null,rowsWritten:e.meta?.rows_written??null,rowCount:t.length}}}},LR=class extends OR{constructor(e,t,n){super(new IR(e,t,n))}async schemas(){let e=await super.schemas(),t=new Set([`_cf_KV`,`_cf_METADATA`,`__miniflare_do_name`]);return Object.fromEntries(Object.entries(e).map(([e,n])=>[e,n.filter(e=>!t.has(e.name))]))}},RR=()=>ow(()=>import(`./_objectId-BJ3ks-A8.js`),[]),zR=()=>ow(()=>import(`./_objectId-CEwoHdwv.js`),__vite__mapDeps([36,3])),BR=()=>ow(()=>import(`./_objectId-CvZVbyZa.js`),__vite__mapDeps([37,6,1,7,18,10,11,8,19,20,21,13,22]));function VR(e){return/^[0-9a-f]{64}$/i.test(e)}var HR=ur(`/do/$className/$objectId`)({component:mr(BR,`component`),errorComponent:mr(zR,`errorComponent`),loader:async({params:e})=>{let t=((await oC()).data?.result??[]).find(t=>t.class===e.className||t.name===e.className||t.id===e.className);if(!t?.id)throw Qe();let n=VR(e.objectId),r=n?e.objectId:null,i=n?null:e.objectId,a=((await new LR(t.id,r,i).schemas()).main??[]).filter(e=>e.type===`table`||e.type===`view`).map(e=>({label:e.name,value:e.name})).sort((e,t)=>e.label.localeCompare(t.label));return{isId:n,namespaceId:t.id,objectId:r,objectName:i,tables:a}},notFoundComponent:mr(RR,`notFoundComponent`),validateSearch:e=>({table:typeof e.table==`string`?e.table:void 0})}),UR=ur(`/r2/$bucketName/object/$`)({component:mr(()=>ow(()=>import(`./object._-BkmJF051.js`),__vite__mapDeps([38,6,1,7,30,14])),`component`),errorComponent:mr(()=>ow(()=>import(`./object._-B9df25nO.js`),__vite__mapDeps([39,3])),`errorComponent`),validateSearch:e=>({delimiter:e.delimiter!==!1}),loader:async({params:e})=>{let t=e._splat;if(!t)throw Error(`Object key is required`);let n=await uC({path:{bucket_name:e.bucketName,object_key:t},headers:{"cf-metadata-only":`true`},throwOnError:!1});if(n.response?.status===404)throw Qe();if(n.error)throw Error(`Failed to fetch object "${t}"`);let r=n.data?.result;if(!r)throw Qe();return{object:r,objectKey:t}},notFoundComponent:mr(()=>ow(()=>import(`./object._-DNcjX7jD.js`),[]),`notFoundComponent`)}),WR=sw.update({id:`/`,path:`/`,getParentRoute:()=>ZC}),GR=cw.update({id:`/workflows/$workflowName`,path:`/workflows/$workflowName`,getParentRoute:()=>ZC}),KR=lw.update({id:`/r2/$bucketName`,path:`/r2/$bucketName`,getParentRoute:()=>ZC}),qR=uw.update({id:`/kv/$namespaceId`,path:`/kv/$namespaceId`,getParentRoute:()=>ZC}),JR=pw.update({id:`/do/$className`,path:`/do/$className`,getParentRoute:()=>ZC}),YR=jR.update({id:`/d1/$databaseId`,path:`/d1/$databaseId`,getParentRoute:()=>ZC}),XR=MR.update({id:`/`,path:`/`,getParentRoute:()=>GR}),ZR=NR.update({id:`/`,path:`/`,getParentRoute:()=>KR}),QR=PR.update({id:`/`,path:`/`,getParentRoute:()=>JR}),$R=FR.update({id:`/$instanceId`,path:`/$instanceId`,getParentRoute:()=>GR}),ez=HR.update({id:`/$objectId`,path:`/$objectId`,getParentRoute:()=>JR}),tz=UR.update({id:`/object/$`,path:`/object/$`,getParentRoute:()=>KR}),nz={DoClassNameObjectIdRoute:ez,DoClassNameIndexRoute:QR},rz=JR._addFileChildren(nz),iz={R2BucketNameIndexRoute:ZR,R2BucketNameObjectSplatRoute:tz},az=KR._addFileChildren(iz),oz={WorkflowsWorkflowNameInstanceIdRoute:$R,WorkflowsWorkflowNameIndexRoute:XR},sz={IndexRoute:WR,D1DatabaseIdRoute:YR,DoClassNameRoute:rz,KvNamespaceIdRoute:qR,R2BucketNameRoute:az,WorkflowsWorkflowNameRoute:GR._addFileChildren(oz)},cz=ZC._addFileChildren(sz)._addFileTypes(),lz=window.matchMedia(`(prefers-color-scheme: dark)`);VC(zC(),lz.matches),lz.addEventListener(`change`,()=>{VC(zC(),lz.matches)});var uz=Or({routeTree:cz,basepath:`/cdn-cgi/explorer/`}),dz=document.getElementById(`root`);dz&&(0,Fr.createRoot)(dz).render((0,U.jsx)(H.StrictMode,{children:(0,U.jsx)(jr,{router:uz})}));export{uw as $,pf as $t,kN as A,Aa as An,Nv as At,DT as B,nr as Bn,uh as Bt,YN as C,Hv as Cn,bC as Ct,CP as D,Va as Dn,sx as Dt,JN as E,Ah as En,ux as Et,pM as F,wa as Fn,nv as Ft,GT as G,ln as Gn,zv as Gt,DE as H,Vn as Hn,Ag as Ht,$M as I,Ca as In,N_ as It,OE as J,c as Jn,fy as Jt,sT as K,sn as Kn,__ as Kt,SM as L,ia as Ln,R_ as Lt,cO as M,Da as Mn,M_ as Mt,iM as N,Ea as Nn,kh as Nt,hP as O,za as On,rx as Ot,XO as P,Ta as Pn,d_ as Pt,mw as Q,$v as Qt,lE as R,Tr as Rn,rv as Rt,QN as S,eg as Sn,hC as St,XN as T,H_ as Tn,fx as Tt,RT as U,Nn as Un,Eh as Ut,FT as V,Un as Vn,Jv as Vt,fE as W,Mn as Wn,Dh as Wt,vT as X,bv as Xt,qE as Y,gv as Yt,vw as Z,Ay as Zt,wL as _,ty as _n,yC as _t,PR as a,wv as an,wC as at,cI as b,V_ as bn,mC as bt,jR as c,sv as cn,xC as ct,$L as d,Cv as dn,lC as dt,Xh as en,sw as et,BL as f,g_ as fn,dC as ft,yL as g,ov as gn,iC as gt,kL as h,z_ as hn,rC as ht,FR as i,Sy as in,TC as it,OD as j,Oa as jn,lh as jt,IN as k,Pa as kn,h_ as kt,AR as l,ny as ln,sC as lt,zL as m,iy as mn,tC as mt,HR as n,pv as nn,qC as nt,NR as o,Ny as on,CC as ot,JL as p,lv as pn,nC as pt,pE as q,o as qn,Mv as qt,LR as r,_v as rn,EC as rt,MR as s,B_ as sn,SC as st,UR as t,jy as tn,nw as tt,YL as u,cv as un,cC as ut,JF as v,tg as vn,gC as vt,ZN as w,Hy as wn,kx as wt,YF as x,Vy as xn,vC as xt,aI as y,Dy as yn,_C as yt,ET as z,ir as zn,qy as zt};