@astrale-os/cli 1.0.0-beta.2 → 1.0.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -1
- package/dist/astrale.js +51105 -58057
- package/dist/public/connect-core.js +2085 -30702
- package/dist/public/keys/index.js +884 -29476
- package/dist/public/paths/index.js +13101 -41452
- package/dist/types/admin/contract.d.ts +26 -0
- package/dist/types/admin/instance/client.d.ts +20 -0
- package/dist/types/admin/instance/index.d.ts +2 -0
- package/dist/types/admin/instance/model.d.ts +6 -10
- package/dist/types/connection/auth.d.ts +3 -0
- package/dist/types/connection/call.d.ts +3 -0
- package/dist/types/connection/command.d.ts +27 -0
- package/dist/types/connection/credential.d.ts +14 -0
- package/dist/types/connection/errors.d.ts +1 -0
- package/dist/types/connection/exchange.d.ts +9 -0
- package/dist/types/connection/failure/classify.d.ts +2 -0
- package/dist/types/connection/failure/index.d.ts +5 -0
- package/dist/types/connection/failure/model.d.ts +25 -0
- package/dist/types/connection/failure/render.d.ts +3 -0
- package/dist/types/connection/index.d.ts +8 -0
- package/dist/types/connection/reasons.d.ts +37 -0
- package/dist/types/connection/self.d.ts +37 -0
- package/dist/types/connection/session.d.ts +31 -0
- package/dist/types/connection/target.d.ts +38 -0
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/lib/admin-instance.d.ts +17 -0
- package/dist/types/lib/admin-target.d.ts +11 -36
- package/dist/types/lib/config.d.ts +7 -59
- package/dist/types/lib/failure-debug.d.ts +1 -0
- package/dist/types/lib/idp.d.ts +25 -173
- package/dist/types/lib/instance-target.d.ts +1 -1
- package/dist/types/lib/instance.d.ts +30 -88
- package/dist/types/lib/log.d.ts +5 -3
- package/dist/types/lib/output.d.ts +1 -1
- package/dist/types/lib/proc.d.ts +43 -0
- package/dist/types/lib/self.d.ts +9 -0
- package/dist/types/lib/update.d.ts +109 -0
- package/dist/types/lib/validation.d.ts +4 -1
- package/package.json +15 -20
- package/src/__tests__/fixtures/publication.ts +20 -0
- package/src/admin/.spec/architecture.md +12 -5
- package/src/admin/__tests__/fixture.ts +25 -0
- package/src/admin/catalog/.spec/api.d.ts +1 -3
- package/src/admin/catalog/.spec/architecture.md +5 -4
- package/src/admin/catalog/__tests__/client.test.ts +143 -69
- package/src/admin/catalog/client.ts +40 -54
- package/src/admin/catalog/model.ts +3 -4
- package/src/admin/contract.ts +46 -0
- package/src/admin/graph/.spec/api.d.ts +4 -10
- package/src/admin/graph/nodes.ts +1 -1
- package/src/admin/instance/.spec/api.d.ts +5 -9
- package/src/admin/instance/.spec/architecture.md +7 -7
- package/src/admin/instance/__tests__/client.test.ts +157 -175
- package/src/admin/instance/client.ts +39 -128
- package/src/admin/instance/index.ts +1 -2
- package/src/admin/instance/model.ts +12 -18
- package/src/commands/__tests__/admin-instance.test.ts +11 -8
- package/src/commands/__tests__/call-describe.test.ts +46 -33
- package/src/commands/__tests__/call.test.ts +34 -0
- package/src/commands/__tests__/domain-install-operation.test.ts +7 -22
- package/src/commands/__tests__/domain-install-owned.test.ts +1 -1
- package/src/commands/__tests__/domain-list.test.ts +5 -25
- package/src/commands/__tests__/install-direct.test.ts +115 -8
- package/src/commands/__tests__/install-identity-override.test.ts +3 -14
- package/src/commands/__tests__/instance-list-rows.test.ts +1 -1
- package/src/commands/__tests__/instance-status.test.ts +139 -0
- package/src/commands/__tests__/introspect-parse.test.ts +80 -1
- package/src/commands/__tests__/logs.test.ts +250 -2
- package/src/commands/__tests__/read-commands.test.ts +62 -10
- package/src/commands/__tests__/token-ttl.test.ts +49 -4
- package/src/commands/__tests__/update.test.ts +25 -3
- package/src/commands/__tests__/view.test.ts +49 -0
- package/src/commands/call-describe.ts +60 -68
- package/src/commands/call.ts +71 -59
- package/src/commands/domain/install.ts +54 -35
- package/src/commands/domain/list.ts +1 -1
- package/src/commands/domain/publish.ts +14 -11
- package/src/commands/domain/uninstall.ts +2 -2
- package/src/commands/get.ts +14 -15
- package/src/commands/identity/__tests__/register.test.ts +3 -3
- package/src/commands/identity/register.ts +5 -4
- package/src/commands/instance/create.ts +8 -16
- package/src/commands/instance/delete.ts +12 -9
- package/src/commands/instance/list.ts +2 -2
- package/src/commands/instance/status.ts +66 -20
- package/src/commands/instance/use.ts +16 -12
- package/src/commands/introspect.ts +48 -35
- package/src/commands/logs.ts +123 -33
- package/src/commands/mutate.ts +6 -5
- package/src/commands/query.ts +35 -32
- package/src/commands/token.ts +42 -27
- package/src/commands/ui/__tests__/commands.test.ts +152 -0
- package/src/commands/ui/add.ts +51 -0
- package/src/commands/ui/doctor.ts +13 -0
- package/src/commands/ui/init.ts +38 -0
- package/src/commands/ui/list.ts +26 -0
- package/src/commands/ui/preset-apply.ts +19 -0
- package/src/commands/ui/preset-list.ts +12 -0
- package/src/commands/ui/shared.ts +25 -0
- package/src/commands/update.ts +31 -11
- package/src/commands/view.ts +82 -37
- package/src/connection/.spec/api.d.ts +7 -8
- package/src/connection/.spec/architecture.md +5 -4
- package/src/connection/.spec/flows/session.ts +2 -2
- package/src/connection/.spec/laws/connection.ts +6 -2
- package/src/connection/.spec/layout.ts +1 -0
- package/src/connection/__tests__/credential.test.ts +20 -1
- package/src/connection/__tests__/errors.test.ts +27 -20
- package/src/connection/__tests__/exchange.test.ts +30 -1
- package/src/connection/__tests__/failure-fixtures.ts +39 -0
- package/src/connection/__tests__/failure-safety.test.ts +75 -0
- package/src/connection/__tests__/self.test.ts +31 -11
- package/src/connection/__tests__/session.test.ts +3 -3
- package/src/connection/__tests__/target.test.ts +1 -0
- package/src/connection/auth.ts +13 -0
- package/src/connection/call.ts +1 -1
- package/src/connection/credential.ts +2 -2
- package/src/connection/errors.ts +1 -355
- package/src/connection/exchange.ts +47 -23
- package/src/connection/failure/classify.ts +110 -0
- package/src/connection/failure/index.ts +18 -0
- package/src/connection/failure/model.ts +28 -0
- package/src/connection/failure/render.ts +116 -0
- package/src/connection/reasons.ts +16 -0
- package/src/connection/self.ts +39 -21
- package/src/connection/session.ts +19 -8
- package/src/errors.ts +3 -2
- package/src/graph/.spec/api.d.ts +12 -5
- package/src/graph/.spec/layout.ts +9 -1
- package/src/graph/__tests__/mutation.test.ts +2 -2
- package/src/graph/__tests__/query.test.ts +25 -6
- package/src/graph/class.ts +30 -0
- package/src/graph/index.ts +1 -0
- package/src/graph/query.ts +21 -32
- package/src/identity/.spec/api.d.ts +2 -2
- package/src/identity/__tests__/registration.test.ts +1 -1
- package/src/identity/registration.ts +3 -3
- package/src/keys/__tests__/keys.test.ts +4 -0
- package/src/keys/credential.ts +1 -0
- package/src/lib/__tests__/admin-target.test.ts +12 -0
- package/src/lib/__tests__/binary.test.ts +16 -1
- package/src/lib/__tests__/command-dx.test.ts +1 -1
- package/src/lib/__tests__/domain-publication.test.ts +10 -16
- package/src/lib/__tests__/idp.test.ts +34 -4
- package/src/lib/__tests__/instance-candidates.test.ts +1 -3
- package/src/lib/__tests__/instance-target.test.ts +7 -39
- package/src/lib/__tests__/log-errors.test.ts +64 -0
- package/src/lib/__tests__/studio-server-deps.test.ts +1 -1
- package/src/lib/__tests__/update.test.ts +264 -11
- package/src/lib/__tests__/view-assets.test.ts +14 -0
- package/src/lib/__tests__/view-external-open-intent.test.ts +150 -0
- package/src/lib/__tests__/view-external-open-origins.test.ts +27 -0
- package/src/lib/__tests__/view-open-intent.test.ts +0 -2
- package/src/lib/__tests__/view-server.test.ts +26 -3
- package/src/lib/__tests__/view-session.test.ts +2 -1
- package/src/lib/admin-instance.ts +14 -8
- package/src/lib/admin-target.ts +21 -2
- package/src/lib/binary.ts +22 -5
- package/src/lib/command-dx.ts +9 -9
- package/src/lib/domain-publication.ts +9 -7
- package/src/lib/failure-debug.ts +26 -0
- package/src/lib/idp.ts +34 -3
- package/src/lib/instance-candidates.ts +2 -2
- package/src/lib/instance-target.ts +3 -14
- package/src/lib/instance.ts +16 -11
- package/src/lib/log.ts +16 -9
- package/src/lib/output.ts +1 -1
- package/src/lib/proc.ts +7 -2
- package/src/lib/provision-instance.ts +34 -57
- package/src/lib/update.ts +298 -45
- package/src/lib/validation.ts +2 -2
- package/src/lib/view/assets.ts +11 -2
- package/src/lib/view/external-open-intent.ts +41 -0
- package/src/lib/view/external-open-origins.ts +37 -0
- package/src/lib/view/host-capabilities.ts +17 -0
- package/src/lib/view/resolve.ts +1 -1
- package/src/lib/view/server.ts +18 -3
- package/src/lib/view/session.ts +2 -0
- package/src/program/.spec/api.d.ts +1 -0
- package/src/program/__tests__/program.test.ts +163 -6
- package/src/program/argv.ts +14 -0
- package/src/program/build.ts +26 -4
- package/src/program/command.ts +1 -0
- package/src/program/index.ts +1 -0
- package/src/program/registry.ts +2 -1
- package/src/setup/__tests__/instance-step.test.ts +27 -10
- package/src/setup/steps/instance.ts +22 -15
- package/src/telemetry/__tests__/recorder.test.ts +1 -0
- package/src/telemetry/recorder.ts +9 -1
- package/src/ui/.spec/api.d.ts +14 -0
- package/src/ui/.spec/architecture.md +10 -0
- package/src/ui/.spec/laws.ts +36 -0
- package/src/ui/.spec/layout.ts +16 -0
- package/src/ui/__tests__/ui.test.ts +981 -0
- package/src/ui/index.ts +13 -0
- package/src/ui/lock.ts +87 -0
- package/src/ui/model.ts +83 -0
- package/src/ui/operations.ts +710 -0
- package/src/ui/project.ts +219 -0
- package/src/ui/release.ts +321 -0
- package/src/ui/runner.ts +18 -0
- package/studio/client/dist/assets/elk-api-DjmKsHXc.js +1 -0
- package/studio/client/dist/assets/index-7YHdeCxp.js +81 -0
- package/studio/client/dist/assets/index-C0FAnwNw.css +2 -0
- package/studio/client/dist/assets/rolldown-runtime-Dd_uD5pT.js +1 -0
- package/studio/client/dist/assets/schema-studio-BilUNb6Z.css +1 -0
- package/studio/client/dist/assets/schema-studio-CABpTfvH.js +8 -0
- package/studio/client/dist/index.html +3 -2
- package/studio/package.json +7 -13
- package/studio/server/agent/ask.test.ts +1 -1
- package/studio/server/agent/bridge/grant.test.ts +1 -1
- package/studio/server/agent/bridge/routes.test.ts +1 -1
- package/studio/server/agent/harness/claude/adapter.test.ts +15 -5
- package/studio/server/agent/harness/gateway/token.test.ts +1 -1
- package/studio/server/agent/harness/gateway/token.ts +3 -3
- package/studio/server/agent/prompts/anchors.test.ts +32 -36
- package/studio/server/agent/prompts/anchors.ts +20 -49
- package/studio/server/agent/prompts/system.test.ts +3 -2
- package/studio/server/agent/prompts/system.ts +3 -3
- package/studio/server/agent/routes.test.ts +1 -1
- package/studio/server/agent/run/coordinator.test.ts +1 -1
- package/studio/server/api/canvas.ts +0 -1
- package/studio/server/api-agent-loadout.test.ts +1 -1
- package/studio/server/api.test.ts +1 -1
- package/studio/server/cache.test.ts +23 -12
- package/studio/server/cache.ts +12 -15
- package/studio/server/domain.test.ts +50 -68
- package/studio/server/domain.ts +82 -63
- package/studio/server/handoff/copy.ts +1 -1
- package/studio/server/index.ts +1 -1
- package/studio/server/instances/probe.test.ts +1 -1
- package/studio/server/introspect/anatomy/views/routes.ts +46 -37
- package/studio/server/introspect/anatomy/views.ts +9 -14
- package/studio/server/introspect/anatomy-extras.test.ts +26 -42
- package/studio/server/introspect/anatomy.test.ts +22 -14
- package/studio/server/introspect/anatomy.ts +6 -9
- package/studio/server/introspect/bundle.ts +0 -3
- package/studio/server/introspect/canonical-schema.test.ts +94 -389
- package/studio/server/introspect/canonical-schema.ts +227 -457
- package/studio/server/introspect/core-extractor.ts +18 -127
- package/studio/server/introspect/core.ts +1 -2
- package/studio/server/introspect/diff.test.ts +11 -7
- package/studio/server/introspect/diff.ts +18 -55
- package/studio/server/introspect/extractor.ts +22 -117
- package/studio/server/introspect/overlay-tsmorph.test.ts +119 -240
- package/studio/server/introspect/overlay.test.ts +26 -54
- package/studio/server/introspect/overlay.ts +10 -37
- package/studio/server/introspect/revision.test.ts +1 -1
- package/studio/server/introspect/revision.ts +1 -1
- package/studio/server/introspect/runtime.test.ts +65 -183
- package/studio/server/introspect/runtime.ts +8 -25
- package/studio/server/introspect/schema-ir-json.test.ts +70 -0
- package/studio/server/introspect/schema-ir-json.ts +38 -68
- package/studio/server/introspect/schema-refs.test.ts +43 -88
- package/studio/server/introspect/schema-refs.ts +14 -49
- package/studio/server/introspect/source-overlay/handlers.ts +116 -636
- package/studio/server/introspect/source-overlay/kernel-calls.ts +0 -3
- package/studio/server/introspect/source-overlay/spans.ts +15 -45
- package/studio/server/state/baseline.test.ts +14 -9
- package/studio/server/state/baseline.ts +3 -5
- package/studio/server/state/visibility.ts +1 -5
- package/studio/server/views/model.ts +3 -3
- package/studio/server/views/target.test.ts +17 -74
- package/studio/server/views/target.ts +24 -50
- package/studio/server/watch.test.ts +11 -11
- package/studio/server/watch.ts +8 -4
- package/studio/server/workspace-watch.ts +2 -2
- package/studio/shared/contracts/schema.ts +38 -107
- package/studio/shared/contracts/surface.test.ts +13 -15
- package/studio/shared/contracts/workspace.ts +2 -11
- package/studio/shared/schema/identity.test.ts +20 -44
- package/studio/shared/schema/identity.ts +9 -23
- package/viewer/dist/main.js +30 -51
- package/.check-workspace.cjs +0 -40
- package/src/admin/binding.ts +0 -168
- package/src/commands/__tests__/instance-create-hosts.test.ts +0 -29
- package/studio/client/dist/assets/elk-api-lwhFo7vB.js +0 -1
- package/studio/client/dist/assets/index-B-c-smo9.js +0 -8
- package/studio/client/dist/assets/index-BckHuAWk.js +0 -81
- package/studio/client/dist/assets/index-C4aNQ6dz.css +0 -1
- package/studio/client/dist/assets/index-ChOr3yP0.css +0 -1
- package/studio/server/introspect/anatomy/views/legacy.ts +0 -232
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/schema-studio-CABpTfvH.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/schema-studio-BilUNb6Z.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,n as t,t as n}from"./rolldown-runtime-Dd_uD5pT.js";(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),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},i=new class extends r{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},a={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},o=new class{#e=a;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function s(e){setTimeout(e,0)}var c=typeof window>`u`||`Deno`in globalThis;function l(){}function u(e,t){return typeof e==`function`?e(t):e}function d(e){return typeof e==`number`&&e>=0&&e!==1/0}function f(e,t){return Math.max(e+(t||0)-Date.now(),0)}function p(e,t){return typeof e==`function`?e(t):e}function m(e,t){return typeof e==`function`?e(t):e}function h(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==_(o,t.options))return!1}else if(!y(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function g(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(v(t.options.mutationKey)!==v(a))return!1}else if(!y(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function _(e,t){return(t?.queryKeyHashFn||v)(e)}function v(e){return JSON.stringify(e,(e,t)=>w(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function y(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!y(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!y(e[r],t[r]))return!1;return!0}return!1}var b=Object.prototype.hasOwnProperty;function x(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=C(e)&&C(t);if(!r&&!(w(e)&&w(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:b.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=x(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function S(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function C(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function w(e){if(!T(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!T(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function T(e){return Object.prototype.toString.call(e)===`[object Object]`}function E(e){return new Promise(t=>{o.setTimeout(t,e)})}function ee(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:x(e,t)}function D(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function O(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var te=Symbol();function ne(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===te?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function k(e,t){return typeof e==`function`?e(...t):!!e}function A(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var j=(()=>{let e=()=>c;return{isServer(){return e()},setIsServer(t){e=t}}})();function re(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var M=s;function ie(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=M,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var N=ie(),ae=new class extends r{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function oe(e){return Math.min(1e3*2**e,3e4)}function se(e){return(e??`online`)!==`online`||ae.isOnline()}var ce=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function le(e){let t=!1,n=0,r,a=re(),o=()=>a.status!==`pending`,s=t=>{if(!o()){let n=new ce(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>i.isFocused()&&(e.networkMode===`always`||ae.isOnline())&&e.canRun(),d=()=>se(e.networkMode)&&e.canRun(),f=e=>{o()||(r?.(),a.resolve(e))},p=e=>{o()||(r?.(),a.reject(e))},m=()=>new Promise(t=>{r=e=>{(o()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),h=()=>{if(o())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(o())return;let i=e.retry??(j.isServer()?0:3),a=e.retryDelay??oe,s=typeof a==`function`?a(n,r):a,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),E(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:a,status:()=>a.status,cancel:s,continue:()=>(r?.(),a),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),a)}}var ue=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),d(this.gcTime)&&(this.#e=o.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(j.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(o.clearTimeout(this.#e),this.#e=void 0)}};function de(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{A(e,()=>t.signal,()=>n=!0)},u=ne(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?O:D;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?pe:fe,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:fe(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function fe(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function pe(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var me=class extends ue{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=_e(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=_e(this.options);e.data!==void 0&&(this.setState(ge(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ee(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(l).catch(l):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>m(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===te||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>p(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!f(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ne(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?de(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=le({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ce&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ce){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...he(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ge(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),N.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function he(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:se(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ge(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function _e(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ve=class extends r{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=re(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),be(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return xe(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return xe(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof m(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!S(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Se(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||m(this.options.enabled,this.#t)!==m(t.enabled,this.#t)||p(this.options.staleTime,this.#t)!==p(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||m(this.options.enabled,this.#t)!==m(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return we(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(l)),t}#g(){this.#b();let e=p(this.options.staleTime,this.#t);if(j.isServer()||this.#r.isStale||!d(e))return;let t=f(this.#r.dataUpdatedAt,e)+1;this.#d=o.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(j.isServer()||m(this.options.enabled,this.#t)===!1||!d(this.#p)||this.#p===0)&&(this.#f=o.setInterval(()=>{(this.options.refetchIntervalInBackground||i.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(o.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(o.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&be(e,t),o=i&&Se(e,n,t,r);(a||o)&&(l={...l,...he(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:h}=l;d=l.data;let g=!1;if(t.placeholderData!==void 0&&d===void 0&&h===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,g=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(h=`success`,d=ee(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!g){if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=ee(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),h=`error`);let _=l.fetchStatus===`fetching`,v=h===`pending`,y=h===`error`,b=v&&_,x=d!==void 0,S={status:h,fetchStatus:l.fetchStatus,isPending:v,isSuccess:h===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:Ce(e,t),refetch:this.refetch,promise:this.#o,isEnabled:m(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{let e=this.#o=S.promise=re();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a()}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!S(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){N.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function ye(e,t){return m(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||m(t.retryOnMount,e)!==!1)}function be(e,t){return ye(e,t)||e.state.data!==void 0&&xe(e,t,t.refetchOnMount)}function xe(e,t,n){if(m(t.enabled,e)!==!1&&p(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Ce(e,t)}return!1}function Se(e,t,n,r){return(e!==t||m(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ce(e,n)}function Ce(e,t){return m(t.enabled,e)!==!1&&e.isStaleByTime(p(t.staleTime,e))}function we(e,t){return!S(e.getCurrentResult(),t)}var Te=class extends ue{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ee(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=le({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),N.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ee(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var De=class extends r{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Te({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Oe(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Oe(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Oe(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Oe(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){N.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>g(t,e))}findAll(e={}){return this.getAll().filter(t=>g(e,t))}notify(e){N.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return N.batch(()=>Promise.all(e.map(e=>e.continue().catch(l))))}};function Oe(e){return e.options.scope?.id}var ke=class extends r{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),S(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&v(t.mutationKey)!==v(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ee();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){N.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Ae=class extends r{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??_(r,t),a=this.get(i);return a||(a=new me({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){N.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>h(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>h(e,t)):t}notify(e){N.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){N.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){N.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},je=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ae,this.#t=e.mutationCache||new De,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=i.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ae.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(p(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=u(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return N.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;N.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return N.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=N.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(l).catch(l)}invalidateQueries(e,t={}){return N.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=N.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(l)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(l)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(p(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(l).catch(l)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(l).catch(l)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ae.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(v(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{y(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(v(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{y(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=_(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===te&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Me=n((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 ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function ne(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function k(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 A(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,A(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ne(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(te,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(te,`$&/`)+`/`)+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+ne(a,u),c+=A(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+ne(a,u++),c+=A(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return A(k(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 j(e,t,n){if(e==null)return e;var r=[],i=0;return A(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(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 M=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)},ie={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ie,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=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:re}},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,M)}catch(e){M(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.8`})),Ne=n(((e,t)=>{t.exports=Me()})),Pe=n((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})),Fe=n(((e,t)=>{t.exports=Pe()})),P=e(Ne(),1),F=Fe(),Ie=P.createContext(void 0),Le=e=>{let t=P.useContext(Ie);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Re=({client:e,children:t})=>(P.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,F.jsx)(Ie.Provider,{value:e,children:t})),ze=P.createContext(!1),Be=()=>P.useContext(ze);ze.Provider;function Ve(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var He=P.createContext(Ve()),Ue=()=>P.useContext(He),We=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?k(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ge=e=>{P.useEffect(()=>{e.clearReset()},[e])},Ke=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||k(n,[e.error,r])),qe=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Je=(e,t)=>e.isLoading&&e.isFetching&&!t,Ye=(e,t)=>e?.suspense&&t.isPending,Xe=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ze(e,t,n){let r=Be(),i=Ue(),a=Le(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,qe(o),We(o,i,s),Ge(i);let u=!a.getQueryCache().get(o.queryHash),[d]=P.useState(()=>new t(a,o)),f=d.getOptimisticResult(o),p=!r&&c;if(P.useSyncExternalStore(P.useCallback(e=>{let t=p?d.subscribe(N.batchCalls(e)):l;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),P.useEffect(()=>{d.setOptions(o)},[o,d]),Ye(o,f))throw Xe(o,d,i);if(Ke({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,f),o.experimental_prefetchInRender&&!j.isServer()&&Je(f,r)&&(u?Xe(o,d,i):s?.promise)?.catch(l).finally(()=>{d.updateResult()}),o.notifyOnChangeProps?f:d.trackResult(f)}function Qe(e,t){return Ze(e,ve,t)}function $e(e,t){let n=Le(t),[r]=P.useState(()=>new ke(n,e));P.useEffect(()=>{r.setOptions(e)},[r,e]);let i=P.useSyncExternalStore(P.useCallback(e=>r.subscribe(N.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=P.useCallback((e,t)=>{r.mutate(e,t).catch(l)},[r]);if(i.error&&k(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var et=n((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,D());else{var t=n(l);t!==null&&ne(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){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&&ne(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,te=O.port2;O.port1.onmessage=ee,D=function(){te.postMessage(null)}}else D=function(){_(ee,0)};function ne(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,ne(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),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}}}})),tt=n(((e,t)=>{t.exports=et()})),nt=n((e=>{var t=Ne();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.8`})),rt=n(((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=nt()})),it=n((e=>{var t=tt(),n=Ne(),r=rt();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`),ee=Symbol.for(`react.memo_cache_sentinel`),D=Symbol.iterator;function O(e){return typeof e!=`object`||!e?null:(e=D&&e[D]||e[`@@iterator`],typeof e==`function`?e:null)}var te=Symbol.for(`react.client.reference`);function ne(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===te?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?ne(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return ne(e(t))}catch{}}return null}var k=Array.isArray,A=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},M=[],ie=-1;function N(e){return{current:e}}function ae(e){0>ie||(e.current=M[ie],M[ie]=null,ie--)}function oe(e,t){ie++,M[ie]=e.current,e.current=t}var se=N(null),ce=N(null),le=N(null),ue=N(null);function de(e,t){switch(oe(le,t),oe(ce,e),oe(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(se),oe(se,e)}function fe(){ae(se),ae(ce),ae(le)}function pe(e){e.memoizedState!==null&&oe(ue,e);var t=se.current,n=Hd(t,e.type);t!==n&&(oe(ce,e),oe(se,n))}function me(e){ce.current===e&&(ae(se),ae(ce)),ue.current===e&&(ae(ue),Qf._currentValue=re)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||``,ge=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+he+e+ge}var ve=!1;function ye(e,t){if(!e||ve)return``;ve=!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(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);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=`
|
|
7
|
+
`+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{ve=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?_e(n):``}function be(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e(`Lazy`);case 13:return e.child!==t&&t!==null?_e(`Suspense Fallback`):_e(`Suspense`);case 19:return _e(`SuspenseList`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return _e(`Activity`);default:return``}}function xe(e){try{var t=``,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var Se=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,we=t.unstable_cancelCallback,Te=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Pe=t.unstable_IdlePriority,Fe=t.log,P=t.unstable_setDisableYieldValue,F=null,Ie=null;function Le(e){if(typeof Fe==`function`&&P(e),Ie&&typeof Ie.setStrictMode==`function`)try{Ie.setStrictMode(F,e)}catch{}}var Re=Math.clz32?Math.clz32:Ve,ze=Math.log,Be=Math.LN2;function Ve(e){return e>>>=0,e===0?32:31-(ze(e)/Be|0)|0}var He=256,Ue=262144,We=4194304;function Ge(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 Ke(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=Ge(n))):i=Ge(o):i=Ge(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ge(n))):i=Ge(o)):i=Ge(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 qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Je(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 Ye(){var e=We;return We<<=1,!(We&62914560)&&(We=4194304),e}function Xe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ze(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(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-Re(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&&$e(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function $e(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Re(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Re(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function nt(e,t){var n=t&-t;return n=n&42?1:it(n),(n&(e.suspendedLanes|t))===0?n:0}function it(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 at(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ot(){var e=j.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function st(e,t){var n=j.p;try{return j.p=e,t()}finally{j.p=n}}var ct=Math.random().toString(36).slice(2),lt=`__reactFiber$`+ct,ut=`__reactProps$`+ct,dt=`__reactContainer$`+ct,ft=`__reactEvents$`+ct,pt=`__reactListeners$`+ct,mt=`__reactHandles$`+ct,ht=`__reactResources$`+ct,gt=`__reactMarker$`+ct;function _t(e){delete e[lt],delete e[ut],delete e[ft],delete e[pt],delete e[mt]}function vt(e){var t=e[lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[dt]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[lt])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function yt(e){if(e=e[lt]||e[dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function bt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function xt(e){var t=e[ht];return t||=e[ht]={hoistableStyles:new Map,hoistableScripts:new Map},t}function St(e){e[gt]=!0}var I=new Set,Ct={};function wt(e,t){Tt(e,t),Tt(e+`Capture`,t)}function Tt(e,t){for(Ct[e]=t,e=0;e<t.length;e++)I.add(t[e])}var Et=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]*$`),Dt={},Ot={};function kt(e){return Se.call(Ot,e)?!0:Se.call(Dt,e)?!1:Et.test(e)?Ot[e]=!0:(Dt[e]=!0,!1)}function At(e,t,n){if(kt(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 jt(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 Mt(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 Nt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Pt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ft(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 It(e){if(!e._valueTracker){var t=Pt(e)?`checked`:`value`;e._valueTracker=Ft(e,t,``+e[t])}}function Lt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Pt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Rt(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 zt=/[\n"\\]/g;function Bt(e){return e.replace(zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Vt(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=``+Nt(t)):e.value!==``+Nt(t)&&(e.value=``+Nt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ut(e,o,Nt(n)):Ut(e,o,Nt(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=``+Nt(s):e.removeAttribute(`name`)}function Ht(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)){It(e);return}n=n==null?``:``+Nt(n),t=t==null?n:``+Nt(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),It(e)}function Ut(e,t,n){t===`number`&&Rt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Wt(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=``+Nt(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 Gt(e,t,n){if(t!=null&&(t=``+Nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Nt(n)}function Kt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(k(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Nt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),It(e)}function L(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qt=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 Jt(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||qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Yt(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&&Jt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Jt(e,o,t[o])}function Xt(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 Zt=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`]]),Qt=/^[\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 $t(e){return Qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function en(){}var tn=null;function nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rn=null,an=null;function on(e){var t=yt(e);if(t&&(e=t.stateNode)){var n=e[ut]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Vt(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="`+Bt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ut]||null;if(!a)throw Error(i(90));Vt(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&&Lt(r)}break a;case`textarea`:Gt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Wt(e,!!n.multiple,t,!1)}}}var sn=!1;function cn(e,t,n){if(sn)return e(t,n);sn=!0;try{return e(t)}finally{if(sn=!1,(rn!==null||an!==null)&&(vu(),rn&&(t=rn,e=an,an=rn=null,on(t),e)))for(t=0;t<e.length;t++)on(e[t])}}function ln(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ut]||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 un=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),dn=!1;if(un)try{var fn={};Object.defineProperty(fn,"passive",{get:function(){dn=!0}}),window.addEventListener(`test`,fn,fn),window.removeEventListener(`test`,fn,fn)}catch{dn=!1}var pn=null,mn=null,hn=null;function gn(){if(hn)return hn;var e,t=mn,n=t.length,r,i=`value`in pn?pn.value:pn.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 hn=i.slice(e,1<r?1-r:void 0)}function _n(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 vn(){return!0}function yn(){return!1}function bn(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)?vn:yn,this.isPropagationStopped=yn,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=vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=vn)},persist:function(){},isPersistent:vn}),t}var xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sn=bn(xn),Cn=f({},xn,{view:0,detail:0}),wn=bn(Cn),Tn,En,Dn,On=f({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zn,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!==Dn&&(Dn&&e.type===`mousemove`?(Tn=e.screenX-Dn.screenX,En=e.screenY-Dn.screenY):En=Tn=0,Dn=e),Tn)},movementY:function(e){return`movementY`in e?e.movementY:En}}),kn=bn(On),An=bn(f({},On,{dataTransfer:0})),jn=bn(f({},Cn,{relatedTarget:0})),Mn=bn(f({},xn,{animationName:0,elapsedTime:0,pseudoElement:0})),Nn=bn(f({},xn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Pn=bn(f({},xn,{data:0})),Fn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},In={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`},Ln={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ln[e])?!!t[e]:!1}function zn(){return Rn}var Bn=bn(f({},Cn,{key:function(e){if(e.key){var t=Fn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=_n(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?In[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zn,charCode:function(e){return e.type===`keypress`?_n(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?_n(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Vn=bn(f({},On,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Hn=bn(f({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zn})),Un=bn(f({},xn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Wn=bn(f({},On,{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})),Gn=bn(f({},xn,{newState:0,oldState:0})),Kn=[9,13,27,32],qn=un&&`CompositionEvent`in window,Jn=null;un&&`documentMode`in document&&(Jn=document.documentMode);var Yn=un&&`TextEvent`in window&&!Jn,Xn=un&&(!qn||Jn&&8<Jn&&11>=Jn),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return Kn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function nr(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function rr(e,t){if(tr)return e===`compositionend`||!qn&&$n(e,t)?(e=gn(),hn=mn=pn=null,tr=!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 Xn&&t.locale!==`ko`?null:t.data;default:return null}}var ir={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 ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ir[e.type]:t===`textarea`}function or(e,t,n,r){rn?an?an.push(r):an=[r]:rn=r,t=Td(t,`onChange`),0<t.length&&(n=new Sn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var sr=null,cr=null;function lr(e){vd(e,0)}function ur(e){if(Lt(bt(e)))return e}function dr(e,t){if(e===`change`)return t}var fr=!1;if(un){var pr;if(un){var mr=`oninput`in document;if(!mr){var hr=document.createElement(`div`);hr.setAttribute(`oninput`,`return;`),mr=typeof hr.oninput==`function`}pr=mr}else pr=!1;fr=pr&&(!document.documentMode||9<document.documentMode)}function gr(){sr&&(sr.detachEvent(`onpropertychange`,_r),cr=sr=null)}function _r(e){if(e.propertyName===`value`&&ur(cr)){var t=[];or(t,cr,e,nn(e)),cn(lr,t)}}function vr(e,t,n){e===`focusin`?(gr(),sr=t,cr=n,sr.attachEvent(`onpropertychange`,_r)):e===`focusout`&&gr()}function yr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ur(cr)}function br(e,t){if(e===`click`)return ur(t)}function xr(e,t){if(e===`input`||e===`change`)return ur(t)}function Sr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var R=typeof Object.is==`function`?Object.is:Sr;function z(e,t){if(R(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(!Se.call(t,i)||!R(e[i],t[i]))return!1}return!0}function B(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cr(e,t){var n=B(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=B(n)}}function wr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rt(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=Rt(e.document)}return t}function Er(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 Dr=un&&`documentMode`in document&&11>=document.documentMode,Or=null,kr=null,Ar=null,jr=!1;function Mr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Or==null||Or!==Rt(r)||(r=Or,`selectionStart`in r&&Er(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}),Ar&&z(Ar,r)||(Ar=r,r=Td(kr,`onSelect`),0<r.length&&(t=new Sn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Or)))}function Nr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Pr={animationend:Nr(`Animation`,`AnimationEnd`),animationiteration:Nr(`Animation`,`AnimationIteration`),animationstart:Nr(`Animation`,`AnimationStart`),transitionrun:Nr(`Transition`,`TransitionRun`),transitionstart:Nr(`Transition`,`TransitionStart`),transitioncancel:Nr(`Transition`,`TransitionCancel`),transitionend:Nr(`Transition`,`TransitionEnd`)},Fr={},Ir={};un&&(Ir=document.createElement(`div`).style,`AnimationEvent`in window||(delete Pr.animationend.animation,delete Pr.animationiteration.animation,delete Pr.animationstart.animation),`TransitionEvent`in window||delete Pr.transitionend.transition);function Lr(e){if(Fr[e])return Fr[e];if(!Pr[e])return e;var t=Pr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ir)return Fr[e]=t[n];return e}var Rr=Lr(`animationend`),zr=Lr(`animationiteration`),Br=Lr(`animationstart`),Vr=Lr(`transitionrun`),Hr=Lr(`transitionstart`),Ur=Lr(`transitioncancel`),Wr=Lr(`transitionend`),Gr=new Map,Kr=`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(` `);Kr.push(`scrollEnd`);function qr(e,t){Gr.set(e,t),wt(t,[e])}var Jr=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)},Yr=[],Xr=0,Zr=0;function Qr(){for(var e=Xr,t=Zr=Xr=0;t<e;){var n=Yr[t];Yr[t++]=null;var r=Yr[t];Yr[t++]=null;var i=Yr[t];Yr[t++]=null;var a=Yr[t];if(Yr[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&&ni(n,i,a)}}function $r(e,t,n,r){Yr[Xr++]=e,Yr[Xr++]=t,Yr[Xr++]=n,Yr[Xr++]=r,Zr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ei(e,t,n,r){return $r(e,t,n,r),ri(e)}function ti(e,t){return $r(e,null,null,t),ri(e)}function ni(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-Re(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ri(e){if(50<lu)throw lu=0,uu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ii={};function ai(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 oi(e,t,n,r){return new ai(e,t,n,r)}function si(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ci(e,t){var n=e.alternate;return n===null?(n=oi(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 li(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 ui(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)si(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=oi(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return V(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=oi(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=oi(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=oi(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=oi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function V(e,t,n,r){return e=oi(7,e,r,t),e.lanes=n,e}function di(e,t,n){return e=oi(6,e,null,t),e.lanes=n,e}function fi(e){var t=oi(18,null,null,0);return t.stateNode=e,t}function pi(e,t,n){return t=oi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var mi=new WeakMap;function hi(e,t){if(typeof e==`object`&&e){var n=mi.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},mi.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var gi=[],_i=0,vi=null,yi=0,bi=[],xi=0,Si=null,Ci=1,wi=``;function Ti(e,t){gi[_i++]=yi,gi[_i++]=vi,vi=e,yi=t}function Ei(e,t,n){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Si=e;var r=Ci;e=wi;var i=32-Re(r)-1;r&=~(1<<i),n+=1;var a=32-Re(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ci=1<<32-Re(t)+i|n<<i|r,wi=a+e}else Ci=1<<a|n<<i|r,wi=e}function Di(e){e.return!==null&&(Ti(e,1),Ei(e,1,0))}function Oi(e){for(;e===vi;)vi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null;for(;e===Si;)Si=bi[--xi],bi[xi]=null,wi=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null}function ki(e,t){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Ci=t.id,wi=t.overflow,Si=e}var Ai=null,ji=null,H=!1,Mi=null,Ni=!1,Pi=Error(i(519));function Fi(e){throw Vi(hi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Pi}function Ii(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[lt]=e,t[ut]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)$(gd[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),Ht(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Kt(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||jd(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=en),t=!0):t=!1,t||Fi(e,!0)}function Li(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Ni=!1;return;case 27:case 3:Ni=!0;return;default:Ai=Ai.return}}function Ri(e){if(e!==Ai)return!1;if(!H)return Li(e),H=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Ud(e.type,e.memoizedProps)),n=!n),n&&ji&&Fi(e),Li(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=uf(e)}else t===27?(t=ji,Zd(e.type)?(e=lf,lf=null,ji=e):ji=t):ji=Ai?cf(e.stateNode.nextSibling):null;return!0}function zi(){ji=Ai=null,H=!1}function Bi(){var e=Mi;return e!==null&&(Yl===null?Yl=e:Yl.push.apply(Yl,e),Mi=null),e}function Vi(e){Mi===null?Mi=[e]:Mi.push(e)}var Hi=N(null),Ui=null,Wi=null;function Gi(e,t,n){oe(Hi,t._currentValue),t._currentValue=n}function Ki(e){e._currentValue=Hi.current,ae(Hi)}function qi(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 Ji(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),qi(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),qi(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 Yi(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;R(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ue.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Ji(t,e,n,r),t.flags|=262144}function Xi(e){for(e=e.firstContext;e!==null;){if(!R(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zi(e){Ui=e,Wi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qi(e){return ea(Ui,e)}function $i(e,t){return Ui===null&&Zi(e),ea(e,t)}function ea(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Wi===null){if(e===null)throw Error(i(308));Wi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wi=Wi.next=t;return n}var U=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()})}},ta=t.unstable_scheduleCallback,na=t.unstable_NormalPriority,ra={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ia(){return{controller:new U,data:new Map,refCount:0}}function aa(e){e.refCount--,e.refCount===0&&ta(na,function(){e.controller.abort()})}var oa=null,sa=0,ca=0,la=null;function ua(e,t){if(oa===null){var n=oa=[];sa=0,ca=ud(),la={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return sa++,t.then(da,da),t}function da(){if(--sa===0&&oa!==null){la!==null&&(la.status=`fulfilled`);var e=oa;oa=null,ca=0,la=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function W(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 fa=A.S;A.S=function(e,t){Ql=De(),typeof t==`object`&&t&&typeof t.then==`function`&&ua(e,t),fa!==null&&fa(e,t)};var pa=N(null);function ma(){var e=pa.current;return e===null?Pl.pooledCache:e}function ha(e,t){t===null?oe(pa,pa.current):oe(pa,t.pool)}function ga(){var e=ma();return e===null?null:{parent:ra._currentValue,pool:e}}var _a=Error(i(460)),va=Error(i(474)),G=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(en,en),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(en,en);else{if(e=Pl,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,_a}}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,_a):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===_a||e===G)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=ci(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=di(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=ui(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=pi(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=V(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=di(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=ui(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case h:return t=pi(t,e.mode,n),t.return=e,t;case T:return t=Sa(t),f(e,t,n)}if(k(t)||O(t))return t=V(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,$i(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(k(n)||O(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,$i(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(k(r)||O(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,$i(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),H&&Ti(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 H&&Ti(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)}),H&&Ti(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),H&&Ti(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 H&&Ti(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)}),H&&Ti(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}t(e,r),r=r.sibling}o.type===g?(c=V(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ui(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}n(e,r);break}t(e,r),r=r.sibling}c=pi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Sa(o),x(e,r,o,c)}if(k(o))return v(e,r,o,c);if(O(o)){if(l=O(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,$i(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=di(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===_a||t===G)throw t;var a=oi(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 K(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function La(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Nl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ri(e),ni(e,null,n),t}return $r(e,r,t,n),ri(e)}function Ra(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,et(e,n)}}function za(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 Ba=!1;function Va(){if(Ba){var e=la;if(e!==null)throw e}}function Ha(e,t,n,r){Ba=!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?(Fl&p)===p:(r&p)===p){p!==0&&p===ca&&(Ba=!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),Ul|=o,e.lanes=o,e.memoizedState=d}}function Ua(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Wa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ua(n[e],t)}var Ga=N(null),Ka=N(0);function qa(e,t){e=Vl,oe(Ka,e),oe(Ga,t),Vl=e|t.baseLanes}function Ja(){oe(Ka,Vl),oe(Ga,Ga.current)}function Ya(){Vl=Ka.current,ae(Ga),ae(Ka)}var Xa=N(null),q=null;function Za(e){var t=e.alternate;oe(to,to.current&1),oe(Xa,e),q===null&&(t===null||Ga.current!==null||t.memoizedState!==null)&&(q=e)}function Qa(e){oe(to,to.current),oe(Xa,e),q===null&&(q=e)}function J(e){e.tag===22?(oe(to,to.current),oe(Xa,e),q===null&&(q=e)):$a(e)}function $a(){oe(to,to.current),oe(Xa,Xa.current)}function eo(e){ae(Xa),q===e&&(q=null),ae(to)}var to=N(0);function no(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(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 ro=0,Y=null,io=null,ao=null,oo=!1,so=!1,co=!1,lo=0,uo=0,fo=null,po=0;function mo(){throw Error(i(321))}function ho(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!R(e[n],t[n]))return!1;return!0}function go(e,t,n,r,i,a){return ro=a,Y=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?Ns:Ps,co=!1,a=n(r,i),co=!1,so&&(a=vo(t,n,r,i)),_o(e),a}function _o(e){A.H=Ms;var t=io!==null&&io.next!==null;if(ro=0,ao=io=Y=null,oo=!1,uo=0,fo=null,t)throw Error(i(300));e===null||Ys||(e=e.dependencies,e!==null&&Xi(e)&&(Ys=!0))}function vo(e,t,n,r){Y=e;var a=0;do{if(so&&(fo=null),uo=0,so=!1,25<=a)throw Error(i(301));if(a+=1,ao=io=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}A.H=X,o=t(n,r)}while(so);return o}function yo(){var e=A.H,t=e.useState()[0];return t=typeof t.then==`function`?Eo(t):t,e=e.useState()[0],(io===null?null:io.memoizedState)!==e&&(Y.flags|=1024),t}function bo(){var e=lo!==0;return lo=0,e}function xo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function So(e){if(oo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}oo=!1}ro=0,ao=io=Y=null,so=!1,uo=lo=0,fo=null}function Co(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ao===null?Y.memoizedState=ao=e:ao=ao.next=e,ao}function wo(){if(io===null){var e=Y.alternate;e=e===null?null:e.memoizedState}else e=io.next;var t=ao===null?Y.memoizedState:ao.next;if(t!==null)ao=t,io=e;else{if(e===null)throw Y.alternate===null?Error(i(467)):Error(i(310));io=e,e={memoizedState:io.memoizedState,baseState:io.baseState,baseQueue:io.baseQueue,queue:io.queue,next:null},ao===null?Y.memoizedState=ao=e:ao=ao.next=e}return ao}function To(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Eo(e){var t=uo;return uo+=1,fo===null&&(fo=[]),e=xa(fo,e,t),t=Y,(ao===null?t.memoizedState:ao.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?Ns:Ps),e}function Do(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Eo(e);if(e.$$typeof===b)return Qi(e)}throw Error(i(438,String(e)))}function Oo(e){var t=null,n=Y.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Y.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=To(),Y.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]=ee;return t.index++,n}function ko(e,t){return typeof t==`function`?t(e):t}function Ao(e){return jo(wo(),io,e)}function jo(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?(ro&f)===f:(Fl&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===ca&&(d=!0);else if((ro&p)===p){u=u.next,p===ca&&(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,Y.lanes|=p,Ul|=p;f=u.action,co&&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,Y.lanes|=f,Ul|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!R(o,e.memoizedState)&&(Ys=!0,d&&(n=la,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 Mo(e){var t=wo(),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);R(o,t.memoizedState)||(Ys=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function No(e,t,n){var r=Y,a=wo(),o=H;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!R((io||a).memoizedState,n);if(s&&(a.memoizedState=n,Ys=!0),a=a.queue,is(Io.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ao!==null&&ao.memoizedState.tag&1){if(r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,a,n,t),null),Pl===null)throw Error(i(349));o||ro&127||Po(r,t,n)}return n}function Po(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Y.updateQueue,t===null?(t=To(),Y.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Fo(e,t,n,r){t.value=n,t.getSnapshot=r,Lo(t)&&Ro(e)}function Io(e,t,n){return n(function(){Lo(t)&&Ro(e)})}function Lo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!R(e,n)}catch{return!0}}function Ro(e){var t=ti(e,2);t!==null&&pu(t,e,2)}function zo(e){var t=Co();if(typeof e==`function`){var n=e;if(e=n(),co){Le(!0);try{n()}finally{Le(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:e},t}function Bo(e,t,n,r){return e.baseState=n,jo(e,io,typeof r==`function`?r:ko)}function Vo(e,t,n,r,a){if(ks(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)}};A.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ho(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ho(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=A.T,o={};A.T=o;try{var s=n(i,r),c=A.S;c!==null&&c(o,s),Uo(e,t,s)}catch(n){Go(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),A.T=a}}else try{a=n(i,r),Uo(e,t,a)}catch(n){Go(e,t,n)}}function Uo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Wo(e,t,n)},function(n){return Go(e,t,n)}):Wo(e,t,n)}function Wo(e,t,n){t.status=`fulfilled`,t.value=n,Ko(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ho(e,n)))}function Go(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ko(t),t=t.next;while(t!==r)}e.action=null}function Ko(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qo(e,t){return t}function Jo(e,t){if(H){var n=Pl.formState;if(n!==null){a:{var r=Y;if(H){if(ji){b:{for(var i=ji,a=Ni;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ji=cf(i.nextSibling),r=i.data===`F!`;break a}}Fi(r)}r=!1}r&&(t=n[0])}}return n=Co(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qo,lastRenderedState:t},n.queue=r,n=Es.bind(null,Y,r),r.dispatch=n,r=zo(!1),a=Os.bind(null,Y,!1,r.queue),r=Co(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Vo.bind(null,Y,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Yo(e){return Xo(wo(),io,e)}function Xo(e,t,n){if(t=jo(e,t,qo)[0],e=Ao(ko)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Eo(t)}catch(e){throw e===_a?G:e}else r=t;t=wo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Y.flags|=2048,$o(9,{destroy:void 0},Zo.bind(null,i,n),null)),[r,a,e]}function Zo(e,t){e.action=t}function Qo(e){var t=wo(),n=io;if(n!==null)return Xo(t,n,e);wo(),t=t.memoizedState,n=wo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function $o(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Y.updateQueue,t===null&&(t=To(),Y.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 es(){return wo().memoizedState}function ts(e,t,n,r){var i=Co();Y.flags|=e,i.memoizedState=$o(1|t,{destroy:void 0},n,r===void 0?null:r)}function ns(e,t,n,r){var i=wo();r=r===void 0?null:r;var a=i.memoizedState.inst;io!==null&&r!==null&&ho(r,io.memoizedState.deps)?i.memoizedState=$o(t,a,n,r):(Y.flags|=e,i.memoizedState=$o(1|t,a,n,r))}function rs(e,t){ts(8390656,8,e,t)}function is(e,t){ns(2048,8,e,t)}function as(e){Y.flags|=4;var t=Y.updateQueue;if(t===null)t=To(),Y.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function os(e){var t=wo().memoizedState;return as({ref:t,nextImpl:e}),function(){if(Nl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ss(e,t){return ns(4,2,e,t)}function cs(e,t){return ns(4,4,e,t)}function ls(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 us(e,t,n){n=n==null?null:n.concat([e]),ns(4,4,ls.bind(null,t,e),n)}function ds(){}function fs(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ho(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ps(e,t){var n=wo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ho(t,r[1]))return r[0];if(r=e(),co){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r}function ms(e,t,n){return n===void 0||ro&1073741824&&!(Fl&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),Y.lanes|=e,Ul|=e,n)}function hs(e,t,n,r){return R(n,t)?n:Ga.current===null?!(ro&42)||ro&1073741824&&!(Fl&261930)?(Ys=!0,e.memoizedState=n):(e=fu(),Y.lanes|=e,Ul|=e,t):(e=ms(e,n,r),R(e,t)||(Ys=!0),e)}function gs(e,t,n,r,i){var a=j.p;j.p=a!==0&&8>a?a:8;var o=A.T,s={};A.T=s,Os(e,!1,t,n);try{var c=i(),l=A.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ds(e,t,W(c,r),du(e)):Ds(e,t,r,du(e))}catch(n){Ds(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{j.p=a,o!==null&&s.types!==null&&(o.types=s.types),A.T=o}}function _s(){}function vs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ys(e).queue;gs(e,a,t,re,n===null?_s:function(){return bs(e),n(r)})}function ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bs(e){var t=ys(e);t.next===null&&(t=e.alternate.memoizedState),Ds(e,t.next.queue,{},du())}function xs(){return Qi(Qf)}function Ss(){return wo().memoizedState}function Cs(){return wo().memoizedState}function ws(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=K(n);var r=La(t,e,n);r!==null&&(pu(r,t,n),Ra(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function Ts(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ks(e)?As(t,n):(n=ei(e,t,n,r),n!==null&&(pu(n,e,r),js(n,t,r)))}function Es(e,t,n){Ds(e,t,n,du())}function Ds(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ks(e))As(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,R(s,o))return $r(e,t,i,0),Pl===null&&Qr(),!1}catch{}if(n=ei(e,t,i,r),n!==null)return pu(n,e,r),js(n,t,r),!0}return!1}function Os(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ks(e)){if(t)throw Error(i(479))}else t=ei(e,n,r,2),t!==null&&pu(t,e,2)}function ks(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function As(e,t){so=oo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function js(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Ms={readContext:Qi,use:Do,useCallback:mo,useContext:mo,useEffect:mo,useImperativeHandle:mo,useLayoutEffect:mo,useInsertionEffect:mo,useMemo:mo,useReducer:mo,useRef:mo,useState:mo,useDebugValue:mo,useDeferredValue:mo,useTransition:mo,useSyncExternalStore:mo,useId:mo,useHostTransitionStatus:mo,useFormState:mo,useActionState:mo,useOptimistic:mo,useMemoCache:mo,useCacheRefresh:mo};Ms.useEffectEvent=mo;var Ns={readContext:Qi,use:Do,useCallback:function(e,t){return Co().memoizedState=[e,t===void 0?null:t],e},useContext:Qi,useEffect:rs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ts(4194308,4,ls.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ts(4194308,4,e,t)},useInsertionEffect:function(e,t){ts(4,2,e,t)},useMemo:function(e,t){var n=Co();t=t===void 0?null:t;var r=e();if(co){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Co();if(n!==void 0){var i=n(t);if(co){Le(!0);try{n(t)}finally{Le(!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=Ts.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=Co();return e={current:e},t.memoizedState=e},useState:function(e){e=zo(e);var t=e.queue,n=Es.bind(null,Y,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ds,useDeferredValue:function(e,t){return ms(Co(),e,t)},useTransition:function(){var e=zo(!1);return e=gs.bind(null,Y,e.queue,!0,!1),Co().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Y,a=Co();if(H){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Pl===null)throw Error(i(349));Fl&127||Po(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,rs(Io.bind(null,r,o,e),[e]),r.flags|=2048,$o(9,{destroy:void 0},Fo.bind(null,r,o,n,t),null),n},useId:function(){var e=Co(),t=Pl.identifierPrefix;if(H){var n=wi,r=Ci;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=lo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=po++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:xs,useFormState:Jo,useActionState:Jo,useOptimistic:function(e){var t=Co();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Os.bind(null,Y,!0,n),n.dispatch=t,[e,t]},useMemoCache:Oo,useCacheRefresh:function(){return Co().memoizedState=ws.bind(null,Y)},useEffectEvent:function(e){var t=Co(),n={impl:e};return t.memoizedState=n,function(){if(Nl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ps={readContext:Qi,use:Do,useCallback:fs,useContext:Qi,useEffect:is,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Ao,useRef:es,useState:function(){return Ao(ko)},useDebugValue:ds,useDeferredValue:function(e,t){return hs(wo(),io.memoizedState,e,t)},useTransition:function(){var e=Ao(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:Ss,useHostTransitionStatus:xs,useFormState:Yo,useActionState:Yo,useOptimistic:function(e,t){return Bo(wo(),io,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};Ps.useEffectEvent=os;var X={readContext:Qi,use:Do,useCallback:fs,useContext:Qi,useEffect:is,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Mo,useRef:es,useState:function(){return Mo(ko)},useDebugValue:ds,useDeferredValue:function(e,t){var n=wo();return io===null?ms(n,e,t):hs(n,io.memoizedState,e,t)},useTransition:function(){var e=Mo(ko)[0],t=wo().memoizedState;return[typeof e==`boolean`?e:Eo(e),t]},useSyncExternalStore:No,useId:Ss,useHostTransitionStatus:xs,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){var n=wo();return io===null?(n.baseState=e,[e,n.queue.dispatch]):Bo(n,io,e,t)},useMemoCache:Oo,useCacheRefresh:Cs};X.useEffectEvent=os;function Fs(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 Z={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=K(r);i.payload=t,n!=null&&(i.callback=n),t=La(e,i,r),t!==null&&(pu(t,e,r),Ra(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),i=K(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=La(e,i,r),t!==null&&(pu(t,e,r),Ra(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=K(n);r.tag=2,t!=null&&(r.callback=t),t=La(e,r,n),t!==null&&(pu(t,e,n),Ra(t,e,n))}};function Is(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?!z(n,r)||!z(i,a):!0}function Ls(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&&Z.enqueueReplaceState(t,t.state,null)}function Rs(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 zs(e){Jr(e)}function Bs(e){console.error(e)}function Vs(e){Jr(e)}function Hs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Us(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 Ws(e,t,n){return n=K(n),n.tag=3,n.payload={element:null},n.callback=function(){Hs(e,t)},n}function Gs(e){return e=K(e),e.tag=3,e}function Ks(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(){Us(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Us(t,n,r),typeof i!=`function`&&(tu===null?tu=new Set([this]):tu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function qs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Yi(t,n,a,!0),n=Xa.current,n!==null){switch(n.tag){case 31:case 13:return q===null?Tu():n.alternate===null&&Hl===0&&(Hl=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),Wu(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)),Wu(e,r,a)),!1}throw Error(i(435,n.tag))}return Wu(e,r,a),Tu(),!1}if(H)return t=Xa.current,t===null?(r!==Pi&&(t=Error(i(423),{cause:r}),Vi(hi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=hi(r,n),a=Ws(e.stateNode,r,a),za(e,a),Hl!==4&&(Hl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Pi&&(e=Error(i(422),{cause:r}),Vi(hi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=hi(o,n),Jl===null?Jl=[o]:Jl.push(o),Hl!==4&&(Hl=2),t===null)return!0;r=hi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ws(n.stateNode,r,e),za(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`&&(tu===null||!tu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Gs(a),Ks(a,e,n,r),za(n,a),!1}n=n.return}while(n!==null);return!1}var Js=Error(i(461)),Ys=!1;function Xs(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function Zs(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 Zi(t),r=go(e,t,n,o,a,i),s=bo(),e!==null&&!Ys?(xo(e,t,i),xc(e,t,i)):(H&&s&&Di(t),t.flags|=1,Xs(e,t,r,i),t.child)}function Qs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!si(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,$s(e,t,a,r,i)):(e=ui(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Sc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?z:n,n(o,r)&&e.ref===t.ref)return xc(e,t,i)}return t.flags|=1,e=ci(a,r),e.ref=t.ref,e.return=t,t.child=e}function $s(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(z(a,r)&&e.ref===t.ref){if(Ys=!1,t.pendingProps=r=a,Sc(e,i))e.flags&131072&&(Ys=!0);else return t.lanes=e.lanes,xc(e,t,i)}}return sc(e,t,n,r,i)}function ec(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 nc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ha(t,a===null?null:a.cachePool),a===null?Ja():qa(t,a),J(t);else return r=t.lanes=536870912,nc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ha(t,null),Ja(),$a(t)):(ha(t,a.cachePool),qa(t,a),$a(t),t.memoizedState=null);return Xs(e,t,i,n),t.child}function tc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function nc(e,t,n,r,i){var a=ma();return a=a===null?null:{parent:ra._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ha(t,null),Ja(),J(t),e!==null&&Yi(e,t,r,!0),t.childLanes=i,null}function rc(e,t){return t=gc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ic(e,t,n){return Ma(t,e.child,null,n),e=rc(t,t.pendingProps),e.flags|=2,eo(t),t.memoizedState=null,e}function ac(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(H){if(r.mode===`hidden`)return e=rc(t,r),t.lanes=536870912,tc(null,e);if(Qa(t),(e=ji)?(e=rf(e,Ni),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Fi(t);return t.lanes=536870912,null}return rc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Qa(t),a){if(t.flags&256)t.flags&=-257,t=ic(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Ys||Yi(e,t,n,!1),a=(n&e.childLanes)!==0,Ys||a){if(r=Pl,r!==null&&(s=nt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ti(e,s),pu(r,e,s),Js;Tu(),t=ic(e,t,n)}else e=o.treeContext,ji=cf(s.nextSibling),Ai=t,H=!0,Mi=null,Ni=!1,e!==null&&ki(t,e),t=rc(t,r),t.flags|=4096;return t}return e=ci(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function oc(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 sc(e,t,n,r,i){return Zi(t),n=go(e,t,n,r,void 0,i),r=bo(),e!==null&&!Ys?(xo(e,t,i),xc(e,t,i)):(H&&r&&Di(t),t.flags|=1,Xs(e,t,n,i),t.child)}function cc(e,t,n,r,i,a){return Zi(t),t.updateQueue=null,n=vo(t,r,n,i),_o(e),r=bo(),e!==null&&!Ys?(xo(e,t,a),xc(e,t,a)):(H&&r&&Di(t),t.flags|=1,Xs(e,t,n,a),t.child)}function lc(e,t,n,r,i){if(Zi(t),t.stateNode===null){var a=ii,o=n.contextType;typeof o==`object`&&o&&(a=Qi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Z,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?Qi(o):ii,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Fs(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&&Z.enqueueReplaceState(a,a.state,null),Ha(t,r,a,i),Va(),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=Rs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ii,typeof u==`object`&&u&&(o=Qi(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)&&Ls(t,a,r,o),Pa=!1;var f=t.memoizedState;a.state=f,Ha(t,r,a,i),Va(),l=t.memoizedState,s||f!==l||Pa?(typeof d==`function`&&(Fs(t,n,d,r),l=t.memoizedState),(c=Pa||Is(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=Rs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ii,typeof l==`object`&&l&&(c=Qi(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)&&Ls(t,a,r,c),Pa=!1,f=t.memoizedState,a.state=f,Ha(t,r,a,i),Va();var p=t.memoizedState;o!==d||f!==p||Pa||e!==null&&e.dependencies!==null&&Xi(e.dependencies)?(typeof s==`function`&&(Fs(t,n,s,r),p=t.memoizedState),(u=Pa||Is(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Xi(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,oc(e,t),r=!!(t.flags&128),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)):Xs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=xc(e,t,i),e}function uc(e,t,n,r){return zi(),t.flags|=256,Xs(e,t,n,r),t.child}var dc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fc(e){return{baseLanes:e,cachePool:ga()}}function pc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function mc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(to.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(H){if(a?Za(t):$a(t),(e=ji)?(e=rf(e,Ni),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Fi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?($a(t),a=t.mode,c=gc({mode:`hidden`,children:c},a),r=V(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=fc(n),r.childLanes=pc(e,s,n),t.memoizedState=dc,tc(null,r)):(Za(t),hc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Za(t),t.flags&=-257,t=_c(e,t,n)):t.memoizedState===null?($a(t),c=r.fallback,a=t.mode,r=gc({mode:`visible`,children:r.children},a),c=V(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=fc(n),r.childLanes=pc(e,s,n),t.memoizedState=dc,t=tc(null,r)):($a(t),t.child=e.child,t.flags|=128,t=null);else if(Za(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Vi({value:r,source:null,stack:null}),t=_c(e,t,n)}else if(Ys||Yi(e,t,n,!1),s=(n&e.childLanes)!==0,Ys||s){if(s=Pl,s!==null&&(r=nt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ti(e,r),pu(s,e,r),Js;af(c)||Tu(),t=_c(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ji=cf(c.nextSibling),Ai=t,H=!0,Mi=null,Ni=!1,e!==null&&ki(t,e),t=hc(t,r.children),t.flags|=4096);return t}return a?($a(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ci(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=V(c,a,n,null),c.flags|=2):c=ci(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,tc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=fc(n):(a=c.cachePool,a===null?a=ga():(l=ra._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=pc(e,s,n),t.memoizedState=dc,tc(e.child,r)):(Za(t),n=e.child,e=n.sibling,n=ci(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 hc(e,t){return t=gc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function gc(e,t){return e=oi(22,e,null,t),e.lanes=0,e}function _c(e,t,n){return Ma(t,e.child,null,n),e=hc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),qi(e.return,t,n)}function yc(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 bc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=to.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,oe(to,o),Xs(e,t,r,n),r=H?yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vc(e,n,t);else if(e.tag===19)vc(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&&no(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),yc(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&&no(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}yc(t,!0,n,null,a,r);break;case`together`:yc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function xc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Yi(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=ci(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ci(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Sc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Xi(e)))}function Cc(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Gi(t,ra,e.memoizedState.cache),zi();break;case 27:case 5:pe(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Gi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Qa(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Za(t),e=xc(e,t,n),e===null?null:e.sibling):mc(e,t,n):(Za(t),t.flags|=128,null);Za(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Yi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return bc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),oe(to,to.current),r)break;return null;case 22:return t.lanes=0,ec(e,t,n,t.pendingProps);case 24:Gi(t,ra,e.memoizedState.cache)}return xc(e,t,n)}function wc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ys=!0;else{if(!Sc(e,n)&&!(t.flags&128))return Ys=!1,Cc(e,t,n);Ys=!!(e.flags&131072)}}else Ys=!1,H&&t.flags&1048576&&Ei(t,yi,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`)si(e)?(r=Rs(e,r),t.tag=1,t=lc(null,t,e,r,n)):(t.tag=0,t=sc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=Zs(null,t,e,r,n);break a}if(a===w){t.tag=14,t=Qs(null,t,e,r,n);break a}}throw t=ne(e)||e,Error(i(306,t,``))}}return t;case 0:return sc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Rs(r,t.pendingProps),lc(e,t,r,a,n);case 3:a:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ia(e,t),Ha(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Gi(t,ra,r),r!==o.cache&&Ji(t,[ra],n,!0),Va(),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=uc(e,t,r,n);break a}if(r!==a){a=hi(Error(i(424)),t),Vi(a),t=uc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ji=cf(e.firstChild),Ai=t,H=!0,Mi=null,Ni=!0,n=Na(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(zi(),r===a){t=xc(e,t,n);break a}Xs(e,t,r,n)}t=t.child}return t;case 26:return oc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:H||(n=t.type,e=t.pendingProps,r=Bd(le.current).createElement(n),r[lt]=t,r[ut]=e,Pd(r,n,e),St(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&H&&(r=t.stateNode=ff(t.type,t.pendingProps,le.current),Ai=t,Ni=!0,a=ji,Zd(t.type)?(lf=a,ji=cf(r.firstChild)):ji=a),Xs(e,t,t.pendingProps.children,n),oc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&H&&((a=r=ji)&&(r=tf(r,t.type,t.pendingProps,Ni),r===null?a=!1:(t.stateNode=r,Ai=t,ji=cf(r.firstChild),Ni=!1,a=!0)),a||Fi(t)),pe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=go(e,t,yo,null,null,n),Qf._currentValue=a),oc(e,t),Xs(e,t,r,n),t.child;case 6:return e===null&&H&&((e=n=ji)&&(n=nf(n,t.pendingProps,Ni),n===null?e=!1:(t.stateNode=n,Ai=t,ji=null,e=!0)),e||Fi(t)),null;case 13:return mc(e,t,n);case 4:return de(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):Xs(e,t,r,n),t.child;case 11:return Zs(e,t,t.type,t.pendingProps,n);case 7:return Xs(e,t,t.pendingProps,n),t.child;case 8:return Xs(e,t,t.pendingProps.children,n),t.child;case 12:return Xs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Gi(t,t.type,r.value),Xs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Zi(t),a=Qi(a),r=r(a),t.flags|=1,Xs(e,t,r,n),t.child;case 14:return Qs(e,t,t.type,t.pendingProps,n);case 15:return $s(e,t,t.type,t.pendingProps,n);case 19:return bc(e,t,n);case 31:return ac(e,t,n);case 22:return ec(e,t,n,t.pendingProps);case 24:return Zi(t),r=Qi(ra),e===null?(a=ma(),a===null&&(a=Pl,o=ia(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Fa(t),Gi(t,ra,a)):((e.lanes&n)!==0&&(Ia(e,t),Ha(t,null,null,n),Va()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Gi(t,ra,r),r!==a.cache&&Ji(t,[ra],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Gi(t,ra,r))),Xs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Tc(e){e.flags|=4}function Ec(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Su())e.flags|=8192;else throw Ca=ya,va}}else e.flags&=-16777217}function Dc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t)){if(Su())e.flags|=8192;else throw Ca=ya,va}}function Oc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ye(),e.lanes|=t,ql|=t)}function kc(e,t){if(!H)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 Ac(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 jc(e,t,n){var r=t.pendingProps;switch(Oi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ac(t),null;case 1:return Ac(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ki(ra),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ri(t)?Tc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Bi())),Ac(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Tc(t),o===null?(Ac(t),Ec(t,a,null,r,n)):(Ac(t),Dc(t,o))):o?o===e.memoizedState?(Ac(t),t.flags&=-16777217):(Tc(t),Ac(t),Dc(t,o)):(e=e.memoizedProps,e!==r&&Tc(t),Ac(t),Ec(t,a,e,r,n)),null;case 27:if(me(t),n=le.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Tc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ac(t),null}e=se.current,Ri(t)?Ii(t,e):(e=ff(a,r,n),t.stateNode=e,Tc(t))}return Ac(t),null;case 5:if(me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Tc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ac(t),null}if(o=se.current,Ri(t))Ii(t,o);else{var s=Bd(le.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[lt]=t,o[ut]=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(Pd(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&&Tc(t)}}return Ac(t),Ec(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Tc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=le.current,Ri(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ai,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[lt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Fi(t,!0)}else e=Bd(e).createTextNode(r),e[lt]=t,t.stateNode=e}return Ac(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ri(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[lt]=t}else zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ac(t),e=!1}else n=Bi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(eo(t),t):(eo(t),null);if(t.flags&128)throw Error(i(558))}return Ac(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ri(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[lt]=t}else zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ac(t),a=!1}else a=Bi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(eo(t),t):(eo(t),null)}return eo(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),Oc(t,t.updateQueue),Ac(t),null);case 4:return fe(),e===null&&xd(t.stateNode.containerInfo),Ac(t),null;case 10:return Ki(t.type),Ac(t),null;case 19:if(ae(to),r=t.memoizedState,r===null)return Ac(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)kc(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=no(e),o!==null){for(t.flags|=128,kc(r,!1),e=o.updateQueue,t.updateQueue=e,Oc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)li(n,e),n=n.sibling;return oe(to,to.current&1|2),H&&Ti(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>$l&&(t.flags|=128,a=!0,kc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=no(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Oc(t,e),kc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!H)return Ac(t),null}else 2*De()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,a=!0,kc(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?(Ac(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=to.current,oe(to,a?n&1|2:n&1),H&&Ti(t,r.treeForkCount),e);case 22:case 23:return eo(t),Ya(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ac(t),t.subtreeFlags&6&&(t.flags|=8192)):Ac(t),n=t.updateQueue,n!==null&&Oc(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&&ae(pa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ki(ra),Ac(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Mc(e,t){switch(Oi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ki(ra),fe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(eo(t),t.alternate===null)throw Error(i(340));zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(eo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(to),null;case 4:return fe(),null;case 10:return Ki(t.type),null;case 22:case 23:return eo(t),Ya(),e!==null&&ae(pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ki(ra),null;case 25:return null;default:return null}}function Nc(e,t){switch(Oi(t),t.tag){case 3:Ki(ra),fe();break;case 26:case 27:case 5:me(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&eo(t);break;case 13:eo(t);break;case 19:ae(to);break;case 10:Ki(t.type);break;case 22:case 23:eo(t),Ya(),e!==null&&ae(pa);break;case 24:Ki(ra)}}function Pc(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){Uu(t,t.return,e)}}function Fc(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){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Ic(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Wa(t,n)}catch(t){Uu(e,e.return,t)}}}function Lc(e,t,n){n.props=Rs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function Rc(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){Uu(e,t,n)}}function zc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Uu(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){Uu(e,t,n)}else n.current=null}}function Bc(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){Uu(e,e.return,t)}}function Vc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[ut]=t}catch(t){Uu(e,e.return,t)}}function Hc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Uc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Hc(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&&Zd(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 Wc(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=en));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Wc(e,t,n),e=e.sibling;e!==null;)Wc(e,t,n),e=e.sibling}function Gc(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&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[lt]=e,t[ut]=n}catch(t){Uu(e,e.return,t)}}var qc=!1,Jc=!1,Yc=!1,Xc=typeof WeakSet==`function`?WeakSet:Set,Zc=null;function Qc(e,t){if(e=e.containerInfo,Rd=sp,e=Tr(e),Er(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(zd={focusedElem:e,selectionRange:n},sp=!1,Zc=t;Zc!==null;)if(t=Zc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Zc=e;else for(;Zc!==null;){switch(t=Zc,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=Rs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(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,Zc=e;break}Zc=t.return}}function $c(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ml(e,n),r&4&&Pc(5,n);break;case 1:if(ml(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=Rs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}}r&64&&Ic(n),r&512&&Rc(n,n.return);break;case 3:if(ml(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{Wa(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&Kc(n);case 26:case 5:ml(e,n),t===null&&r&4&&Bc(n),r&512&&Rc(n,n.return);break;case 12:ml(e,n);break;case 31:ml(e,n),r&4&&al(e,n);break;case 13:ml(e,n),r&4&&ol(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||qc,!r){t=t!==null&&t.memoizedState!==null||Jc,i=qc;var a=Jc;qc=r,(Jc=t)&&!a?gl(e,n,!!(n.subtreeFlags&8772)):ml(e,n),qc=i,Jc=a}break;case 30:break;default:ml(e,n)}}function el(e){var t=e.alternate;t!==null&&(e.alternate=null,el(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_t(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 tl=null,nl=!1;function rl(e,t,n){for(n=n.child;n!==null;)il(e,t,n),n=n.sibling}function il(e,t,n){if(Ie&&typeof Ie.onCommitFiberUnmount==`function`)try{Ie.onCommitFiberUnmount(F,n)}catch{}switch(n.tag){case 26:Jc||zc(n,t),rl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Jc||zc(n,t);var r=tl,i=nl;Zd(n.type)&&(tl=n.stateNode,nl=!1),rl(e,t,n),pf(n.stateNode),tl=r,nl=i;break;case 5:Jc||zc(n,t);case 6:if(r=tl,i=nl,tl=null,rl(e,t,n),tl=r,nl=i,tl!==null){if(nl)try{(tl.nodeType===9?tl.body:tl.nodeName===`HTML`?tl.ownerDocument.body:tl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{tl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}}break;case 18:tl!==null&&(nl?(e=tl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(tl,n.stateNode));break;case 4:r=tl,i=nl,tl=n.stateNode.containerInfo,nl=!0,rl(e,t,n),tl=r,nl=i;break;case 0:case 11:case 14:case 15:Fc(2,n,t),Jc||Fc(4,n,t),rl(e,t,n);break;case 1:Jc||(zc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Lc(n,t,r)),rl(e,t,n);break;case 21:rl(e,t,n);break;case 22:Jc=(r=Jc)||n.memoizedState!==null,rl(e,t,n),Jc=r;break;default:rl(e,t,n)}}function al(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Uu(t,t.return,e)}}}function ol(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Uu(t,t.return,e)}}function sl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Xc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Xc),t;default:throw Error(i(435,e.tag))}}function cl(e,t){var n=sl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function ll(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(Zd(c.type)){tl=c.stateNode,nl=!1;break a}break;case 5:tl=c.stateNode,nl=!1;break a;case 3:case 4:tl=c.stateNode.containerInfo,nl=!0;break a}c=c.return}if(tl===null)throw Error(i(160));il(o,s,a),tl=null,nl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)dl(t,e),t=t.sibling}var ul=null;function dl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ll(t,e),fl(e),r&4&&(Fc(3,e,e.return),Pc(3,e),Fc(5,e,e.return));break;case 1:ll(t,e),fl(e),r&512&&(Jc||n===null||zc(n,n.return)),r&64&&qc&&(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=ul;if(ll(t,e),fl(e),r&512&&(Jc||n===null||zc(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[gt]||o[lt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[lt]=e,St(o),r=o;break a;case`link`:var s=Vf(`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),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`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),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[lt]=e,St(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode)}else e.stateNode=If(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Vc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:ll(t,e),fl(e),r&512&&(Jc||n===null||zc(n,n.return)),n!==null&&r&4&&Vc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ll(t,e),fl(e),r&512&&(Jc||n===null||zc(n,n.return)),e.flags&32){a=e.stateNode;try{L(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Vc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Yc=!0);break;case 6:if(ll(t,e),fl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Bf=null,a=ul,ul=gf(t.containerInfo),ll(t,e),ul=a,fl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}Yc&&(Yc=!1,pl(e));break;case 4:r=ul,ul=gf(e.stateNode.containerInfo),ll(t,e),fl(e),ul=r;break;case 12:ll(t,e),fl(e);break;case 31:ll(t,e),fl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 13:ll(t,e),fl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zl=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=qc,d=Jc;if(qc=u||a,Jc=d||l,ll(t,e),Jc=d,qc=u,fl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||qc||Jc||hl(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){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Uu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Uu(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,cl(e,n))));break;case 19:ll(t,e),fl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,cl(e,r)));break;case 30:break;case 21:break;default:ll(t,e),fl(e)}}function fl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Hc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Gc(e,Uc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(L(o,``),n.flags&=-33),Gc(e,Uc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Wc(e,Uc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;pl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ml(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)$c(e,t.alternate,t),t=t.sibling}function hl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Fc(4,t,t.return),hl(t);break;case 1:zc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Lc(t,t.return,n),hl(t);break;case 27:pf(t.stateNode);case 26:case 5:zc(t,t.return),hl(t);break;case 22:t.memoizedState===null&&hl(t);break;case 30:hl(t);break;default:hl(t)}e=e.sibling}}function gl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),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:gl(i,a,n),Pc(4,a);break;case 1:if(gl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(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++)Ua(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Ic(a),Rc(a,a.return);break;case 27:Kc(a);case 26:case 5:gl(i,a,n),n&&r===null&&o&4&&Bc(a),Rc(a,a.return);break;case 12:gl(i,a,n);break;case 31:gl(i,a,n),n&&o&4&&al(i,a);break;case 13:gl(i,a,n),n&&o&4&&ol(i,a);break;case 22:a.memoizedState===null&&gl(i,a,n),Rc(a,a.return);break;case 30:break;default:gl(i,a,n)}t=t.sibling}}function _l(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&&aa(n))}function vl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e))}function yl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)bl(e,t,n,r),t=t.sibling}function bl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:yl(e,t,n,r),i&2048&&Pc(9,t);break;case 1:yl(e,t,n,r);break;case 3:yl(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&&aa(e)));break;case 12:if(i&2048){yl(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){Uu(t,t.return,e)}}else yl(e,t,n,r);break;case 31:yl(e,t,n,r);break;case 13:yl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?yl(e,t,n,r):(a._visibility|=2,xl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?yl(e,t,n,r):Sl(e,t),i&2048&&_l(o,t);break;case 24:yl(e,t,n,r),i&2048&&vl(t.alternate,t);break;default:yl(e,t,n,r)}}function xl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!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:xl(a,o,s,c,i),Pc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,xl(a,o,s,c,i)):u._visibility&2?xl(a,o,s,c,i):Sl(a,o),i&&l&2048&&_l(o.alternate,o);break;case 24:xl(a,o,s,c,i),i&&l&2048&&vl(o.alternate,o);break;default:xl(a,o,s,c,i)}t=t.sibling}}function Sl(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:Sl(n,r),i&2048&&_l(r.alternate,r);break;case 24:Sl(n,r),i&2048&&vl(r.alternate,r);break;default:Sl(n,r)}t=t.sibling}}var Cl=8192;function wl(e,t,n){if(e.subtreeFlags&Cl)for(e=e.child;e!==null;)Tl(e,t,n),e=e.sibling}function Tl(e,t,n){switch(e.tag){case 26:wl(e,t,n),e.flags&Cl&&e.memoizedState!==null&&Gf(n,ul,e.memoizedState,e.memoizedProps);break;case 5:wl(e,t,n);break;case 3:case 4:var r=ul;ul=gf(e.stateNode.containerInfo),wl(e,t,n),ul=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Cl,Cl=16777216,wl(e,t,n),Cl=r):wl(e,t,n));break;default:wl(e,t,n)}}function El(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 Dl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zc=r,Al(r,e)}El(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ol(e),e=e.sibling}function Ol(e){switch(e.tag){case 0:case 11:case 15:Dl(e),e.flags&2048&&Fc(9,e,e.return);break;case 3:Dl(e);break;case 12:Dl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,kl(e)):Dl(e);break;default:Dl(e)}}function kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Zc=r,Al(r,e)}El(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Fc(8,t,t.return),kl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,kl(t));break;default:kl(t)}e=e.sibling}}function Al(e,t){for(;Zc!==null;){var n=Zc;switch(n.tag){case 0:case 11:case 15:Fc(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:aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Zc=r;else a:for(n=e;Zc!==null;){r=Zc;var i=r.sibling,a=r.return;if(el(r),r===n){Zc=null;break a}if(i!==null){i.return=a,Zc=i;break a}Zc=a}}}var jl={getCacheForType:function(e){var t=Qi(ra),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Qi(ra).controller.signal}},Ml=typeof WeakMap==`function`?WeakMap:Map,Nl=0,Pl=null,Q=null,Fl=0,Il=0,Ll=null,Rl=!1,zl=!1,Bl=!1,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=null,Yl=null,Xl=!1,Zl=0,Ql=0,$l=1/0,eu=null,tu=null,nu=0,ru=null,iu=null,au=0,ou=0,su=null,cu=null,lu=0,uu=null;function du(){return Nl&2&&Fl!==0?Fl&-Fl:A.T===null?ot():ud()}function fu(){if(Kl===0){if(!(Fl&536870912)||H){var e=Ue;Ue<<=1,!(Ue&3932160)&&(Ue=262144),Kl=e}else Kl=536870912}return e=Xa.current,e!==null&&(e.flags|=32),Kl}function pu(e,t,n){(e===Pl&&(Il===2||Il===9)||e.cancelPendingCommit!==null)&&(bu(e,0),_u(e,Fl,Kl,!1)),Ze(e,n),(!(Nl&2)||e!==Pl)&&(e===Pl&&(!(Nl&2)&&(Wl|=n),Hl===4&&_u(e,Fl,Kl,!1)),nd(e))}function mu(e,t,n){if(Nl&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||qe(e,t),a=r?Ou(e,t):Eu(e,t,!0),o=r;do{if(a===0){zl&&!r&&_u(e,t,0,!1);break}if(n=e.current.alternate,o&&!gu(n)){a=Eu(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=Jl;var l=c.current.memoizedState.isDehydrated;if(l&&(bu(c,s).flags|=256),s=Eu(c,s,!1),s!==2){if(Bl&&!l){c.errorRecoveryDisabledLanes|=o,Wl|=o,a=4;break a}o=Yl,Yl=a,o!==null&&(Yl===null?Yl=o:Yl.push.apply(Yl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){bu(e,0),_u(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:_u(r,t,Kl,!Rl);break a;case 2:Yl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Zl+300-De(),10<a)){if(_u(r,t,Kl,!Rl),Ke(r,0,!0)!==0)break a;au=t,r.timeoutHandle=Kd(hu.bind(null,r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,`Throttled`,-0,0),a);break a}hu(r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,null,-0,0)}break}while(1);nd(e)}function hu(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:en},Tl(t,a,d);var m=(a&62914560)===a?Zl-De():(a&4194048)===a?Ql-De():0;if(m=qf(d,m),m!==null){au=a,e.cancelPendingCommit=m(Fu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),_u(e,a,o,!l);return}}Fu(e,t,a,n,r,i,o,s,c)}function gu(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(!R(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 _u(e,t,n,r){t&=~Gl,t&=~Wl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Re(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&$e(e,n,t)}function vu(){return Nl&6?!0:(rd(0,!1),!1)}function yu(){if(Q!==null){if(Il===0)var e=Q.return;else e=Q,Wi=Ui=null,So(e),Ea=null,Da=0,e=Q;for(;e!==null;)Nc(e.alternate,e),e=e.return;Q=null}}function bu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),au=0,yu(),Pl=e,Q=n=ci(e.current,null),Fl=t,Il=0,Ll=null,Rl=!1,zl=qe(e,t),Bl=!1,ql=Kl=Gl=Wl=Ul=Hl=0,Yl=Jl=null,Xl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Re(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,Qr(),n}function xu(e,t){Y=null,A.H=Ms,t===_a||t===G?(t=wa(),Il=3):t===va?(t=wa(),Il=4):Il=t===Js?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ll=t,Q===null&&(Hl=1,Hs(e,hi(t,e.current)))}function Su(){var e=Xa.current;return e===null?!0:(Fl&4194048)===Fl?q===null:(Fl&62914560)===Fl||Fl&536870912?e===q:!1}function Cu(){var e=A.H;return A.H=Ms,e===null?Ms:e}function wu(){var e=A.A;return A.A=jl,e}function Tu(){Hl=4,Rl||(Fl&4194048)!==Fl&&Xa.current!==null||(zl=!0),!(Ul&134217727)&&!(Wl&134217727)||Pl===null||_u(Pl,Fl,Kl,!1)}function Eu(e,t,n){var r=Nl;Nl|=2;var i=Cu(),a=wu();(Pl!==e||Fl!==t)&&(eu=null,bu(e,t)),t=!1;var o=Hl;a:do try{if(Il!==0&&Q!==null){var s=Q,c=Ll;switch(Il){case 8:yu(),o=6;break a;case 3:case 2:case 9:case 6:Xa.current===null&&(t=!0);var l=Il;if(Il=0,Ll=null,Mu(e,s,c,l),n&&zl){o=0;break a}break;default:l=Il,Il=0,Ll=null,Mu(e,s,c,l)}}Du(),o=Hl;break}catch(t){xu(e,t)}while(1);return t&&e.shellSuspendCounter++,Wi=Ui=null,Nl=r,A.H=i,A.A=a,Q===null&&(Pl=null,Fl=0,Qr()),o}function Du(){for(;Q!==null;)Au(Q)}function Ou(e,t){var n=Nl;Nl|=2;var r=Cu(),a=wu();Pl!==e||Fl!==t?(eu=null,$l=De()+500,bu(e,t)):zl=qe(e,t);a:do try{if(Il!==0&&Q!==null){t=Q;var o=Ll;b:switch(Il){case 1:Il=0,Ll=null,Mu(e,t,o,1);break;case 2:case 9:if(ba(o)){Il=0,Ll=null,ju(t);break}t=function(){Il!==2&&Il!==9||Pl!==e||(Il=7),nd(e)},o.then(t,t);break a;case 3:Il=7;break a;case 4:Il=5;break a;case 7:ba(o)?(Il=0,Ll=null,ju(t)):(Il=0,Ll=null,Mu(e,t,o,7));break;case 5:var s=null;switch(Q.tag){case 26:s=Q.memoizedState;case 5:case 27:var c=Q;if(s?Wf(s):c.stateNode.complete){Il=0,Ll=null;var l=c.sibling;if(l!==null)Q=l;else{var u=c.return;u===null?Q=null:(Q=u,Nu(u))}break b}}Il=0,Ll=null,Mu(e,t,o,5);break;case 6:Il=0,Ll=null,Mu(e,t,o,6);break;case 8:yu(),Hl=6;break a;default:throw Error(i(462))}}ku();break}catch(t){xu(e,t)}while(1);return Wi=Ui=null,A.H=r,A.A=a,Nl=n,Q===null?(Pl=null,Fl=0,Qr(),Hl):0}function ku(){for(;Q!==null&&!Te();)Au(Q)}function Au(e){var t=wc(e.alternate,e,Vl);e.memoizedProps=e.pendingProps,t===null?Nu(e):Q=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=cc(n,t,t.pendingProps,t.type,void 0,Fl);break;case 11:t=cc(n,t,t.pendingProps,t.type.render,t.ref,Fl);break;case 5:So(t);default:Nc(n,t),t=Q=li(t,Vl),t=wc(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):Q=t}function Mu(e,t,n,r){Wi=Ui=null,So(t),Ea=null,Da=0;var i=t.return;try{if(qs(e,i,t,n,Fl)){Hl=1,Hs(e,hi(n,e.current)),Q=null;return}}catch(t){if(i!==null)throw Q=i,t;Hl=1,Hs(e,hi(n,e.current)),Q=null;return}t.flags&32768?(H||r===1?e=!0:zl||Fl&536870912?e=!1:(Rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Xa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pu(t,e)):Nu(t)}function Nu(e){var t=e;do{if(t.flags&32768){Pu(t,Rl);return}e=t.return;var n=jc(t.alternate,t,Vl);if(n!==null){Q=n;return}if(t=t.sibling,t!==null){Q=t;return}Q=t=e}while(t!==null);Hl===0&&(Hl=5)}function Pu(e,t){do{var n=Mc(e.alternate,e);if(n!==null){n.flags&=32767,Q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Q=e;return}Q=e=n}while(e!==null);Hl=6,Q=null}function Fu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(Nl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Zr,Qe(e,n,o,s,c,l),e===Pl&&(Q=Pl=null,Fl=0),iu=t,ru=e,au=n,ou=o,su=a,cu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(je,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=A.T,A.T=null,a=j.p,j.p=2,s=Nl,Nl|=4;try{Qc(e,t,n)}finally{Nl=s,j.p=a,A.T=r}}nu=1,Iu(),Lu(),Ru()}}function Iu(){if(nu===1){nu=0;var e=ru,t=iu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=A.T,A.T=null;var r=j.p;j.p=2;var i=Nl;Nl|=4;try{dl(t,e);var a=zd,o=Tr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&wr(s.ownerDocument.documentElement,s)){if(c!==null&&Er(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 _=Cr(s,h),v=Cr(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}}sp=!!Rd,zd=Rd=null}finally{Nl=i,j.p=r,A.T=n}}e.current=t,nu=2}}function Lu(){if(nu===2){nu=0;var e=ru,t=iu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=A.T,A.T=null;var r=j.p;j.p=2;var i=Nl;Nl|=4;try{$c(e,t.alternate,t)}finally{Nl=i,j.p=r,A.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,Ee();var e=ru,t=iu,n=au,r=cu;t.subtreeFlags&10256||t.flags&10256?nu=5:(nu=0,iu=ru=null,zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(tu=null),at(n),t=t.stateNode,Ie&&typeof Ie.onCommitFiberRoot==`function`)try{Ie.onCommitFiberRoot(F,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=A.T,i=j.p,j.p=2,A.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{A.T=t,j.p=i}}au&3&&Bu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===uu?lu++:(lu=0,uu=e):lu=0,rd(0,!1)}}function zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,aa(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(nu!==5)return!1;var e=ru,t=ou;ou=0;var n=at(au),r=A.T,a=j.p;try{j.p=32>n?32:n,A.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,Nl&6)throw Error(i(331));var c=Nl;if(Nl|=4,Ol(o.current),bl(o,o.current,s,n),Nl=c,rd(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot==`function`)try{Ie.onPostCommitFiberRoot(F,o)}catch{}return!0}finally{j.p=a,A.T=r,zu(e,t)}}function Hu(e,t,n){t=hi(n,t),t=Ws(e.stateNode,t,2),e=La(e,t,2),e!==null&&(Ze(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=hi(n,e),n=Gs(2),r=La(t,n,2),r!==null&&(Ks(n,r,t,e),Ze(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ml;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)||(Bl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Pl===e&&(Fl&n)===n&&(Hl===4||Hl===3&&(Fl&62914560)===Fl&&300>De()-Zl?!(Nl&2)&&bu(e,0):Gl|=n,ql===Fl&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=Ye()),e=ti(e,t),e!==null&&(Ze(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(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),Ku(e,n)}function Yu(e,t){return Ce(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;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-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Fl,a=Ke(r,r===Pl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||qe(r,a)||(n=!0,cd(r,a))}r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=De(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}nu!==0&&nu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Re(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Je(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Pl,n=Fl,n=Ke(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Il===2||Il===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&we(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&we(r),at(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Pe;break;default:n=je}return r=sd.bind(null,e),n=Ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&we(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(nu!==0&&nu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var r=Fl;return r=Ke(e,e===Pl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,De()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;mu(e,t,!0)}function ld(){Yd(function(){Nl&6?Ce(ke,id):ad()})}function ud(){if(td===0){var e=ca;e===0&&(e=He,He<<=1,!(He&261888)&&(He=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:$t(``+e)}function fd(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 pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[ut]||null).action),o=r.submitter;o&&(t=(t=o[ut]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Sn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);vs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),vs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Kr.length;md++){var hd=Kr[md];qr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}qr(Rr,`onAnimationEnd`),qr(zr,`onAnimationIteration`),qr(Br,`onAnimationStart`),qr(`dblclick`,`onDoubleClick`),qr(`focusin`,`onFocus`),qr(`focusout`,`onBlur`),qr(Vr,`onTransitionRun`),qr(Hr,`onTransitionStart`),qr(Ur,`onTransitionCancel`),qr(Wr,`onTransitionEnd`),Tt(`onMouseEnter`,[`mouseout`,`mouseover`]),Tt(`onMouseLeave`,[`mouseout`,`mouseover`]),Tt(`onPointerEnter`,[`pointerout`,`pointerover`]),Tt(`onPointerLeave`,[`pointerout`,`pointerover`]),wt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),wt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),wt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),wt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`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(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=!!(t&4);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){Jr(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){Jr(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[ft];n===void 0&&(n=t[ft]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,I.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!dn||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 Cd(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=vt(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}cn(function(){var r=a,i=nn(n),s=[];a:{var c=Gr.get(e);if(c!==void 0){var l=Sn,u=e;switch(e){case`keypress`:if(_n(n)===0)break a;case`keydown`:case`keyup`:l=Bn;break;case`focusin`:u=`focus`,l=jn;break;case`focusout`:u=`blur`,l=jn;break;case`beforeblur`:case`afterblur`:l=jn;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=kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=An;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Hn;break;case Rr:case zr:case Br:l=Mn;break;case Wr:l=Un;break;case`scroll`:case`scrollend`:l=wn;break;case`wheel`:l=Wn;break;case`copy`:case`cut`:case`paste`:l=Nn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Vn;break;case`toggle`:case`beforetoggle`:l=Gn}var d=!!(t&4),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=ln(m,p),g!=null&&d.push(wd(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!==tn&&(u=n.relatedTarget||n.fromElement)&&(vt(u)||u[dt]))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?vt(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=kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Vn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:bt(l),h=u==null?c:bt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,vt(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=Ed,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&&Dd(s,c,l,d,!1),u!==null&&f!==null&&Dd(s,f,u,d,!0)}}a:{if(c=r?bt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=dr;else if(ar(c)){if(fr)v=xr;else{v=yr;var y=vr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Xt(r.elementType)&&(v=dr):v=br;if(v&&=v(e,r)){or(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ut(c,`number`,c.value)}switch(y=r?bt(r):window,e){case`focusin`:(ar(y)||y.contentEditable===`true`)&&(Or=y,kr=r,Ar=null);break;case`focusout`:Ar=kr=Or=null;break;case`mousedown`:jr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:jr=!1,Mr(s,n,i);break;case`selectionchange`:if(Dr)break;case`keydown`:case`keyup`:Mr(s,n,i)}var b;if(qn)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 tr?$n(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Xn&&n.locale!==`ko`&&(tr||x!==`onCompositionStart`?x===`onCompositionEnd`&&tr&&(b=gn()):(pn=i,mn=`value`in pn?pn.value:pn.textContent,tr=!0)),y=Td(r,x),0<y.length&&(x=new Pn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=er(n),b!==null&&(x.data=b)))),(b=Yn?nr(e,n):rr(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new Pn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),pd(s,e,r,n,i)}vd(s,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(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=ln(e,n),i!=null&&r.unshift(wd(e,i,a)),i=ln(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(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=ln(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=ln(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
|
|
10
|
+
`).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||L(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&L(e,``+r);break;case`className`:jt(e,`class`,r);break;case`tabIndex`:jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:jt(e,n,r);break;case`style`:Yt(e,r,o);break;case`data`:if(t!==`object`){jt(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=$t(``+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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,a.name,a,null),Md(e,t,`formEncType`,a.formEncType,a,null),Md(e,t,`formMethod`,a.formMethod,a,null),Md(e,t,`formTarget`,a.formTarget,a,null)):(Md(e,t,`encType`,a.encType,a,null),Md(e,t,`method`,a.method,a,null),Md(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=en);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`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=$t(``+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`:$(`beforetoggle`,e),$(`toggle`,e),At(e,`popover`,r);break;case`xlinkActuate`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:At(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=Zt.get(n)||n,At(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Yt(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`?L(e,r):(typeof r==`number`||typeof r==`bigint`)&&L(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=en);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ct.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[ut]||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,``):At(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`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:Md(e,t,o,s,n,null)}}a&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`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:Md(e,t,r,d,n,null)}}Ht(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`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:Md(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Wt(e,!!r,n,!0):Wt(e,!!r,t,!1);return;case`textarea`:for(s in $(`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:Md(e,t,s,c,n,null)}Kt(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:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`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:Md(e,t,u,r,n,null)}return;default:if(Xt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(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)||Md(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&&Md(e,t,p,m,r,f)}}Vt(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)||Md(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&&Md(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Wt(e,!!n,n?[]:``,!1):Wt(e,!!n,t,!0)):Wt(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:Md(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&&Md(e,t,s,a,r,o)}Gt(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:Md(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:Md(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)&&Md(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:Md(e,t,u,p,r,m)}return;default:if(Xt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(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||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(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||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){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&&Id(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&&Id(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 Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(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 Hd(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 Ud(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 Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e!==Wd&&(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(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),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[gt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body)}n=i}while(n);Np(t)}function $d(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 ef(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`:ef(n),_t(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(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[gt])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=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(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 cf(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 lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(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 ff(e,t,n){switch(t=Bd(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 pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_t(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=j.d;j.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=vu();return e||t}function yf(e){var t=yt(e);t!==null&&t.tag===5&&t.type===`form`?bs(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Bt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),St(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Bt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Bt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Bt(n.imageSizes)+`"]`)):i+=`[href="`+Bt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),St(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Bt(r)+`"][href="`+Bt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),St(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=xt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);St(c),Pd(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,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=xt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=f({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),St(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=xt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),St(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=le.current)?gf(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=Af(n.href),n=xt(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=Af(n.href);var o=xt(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(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.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},mf.set(e,n),o||Nf(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=Pf(n),n=xt(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 Af(e){return`href="`+Bt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(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}),Pd(t,`link`,n),St(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Bt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Bt(n.href)+`"]`);if(r)return t.instance=r,St(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`),St(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,St(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),St(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,St(a),a):(r=n,(a=mf.get(o))&&(r=f({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),St(a),Pd(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,Lf(r,n.precedence,e));return t.instance}function Lf(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 Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,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[gt]||a[lt]||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 Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(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=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,St(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),St(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(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=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.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=Jf.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 Qf={$$typeof:b,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function $f(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=Xe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xe(0),this.hiddenUpdates=Xe(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 ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=oi(3,null,null,t),e.current=a,a.stateNode=e,t=ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Fa(a),e}function tp(e){return e?(e=ii,e):ii}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=K(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=La(e,r,t),n!==null&&(pu(n,e,t),Ra(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ti(e,67108864);t!==null&&pu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=du();t=it(t);var n=ti(e,t);n!==null&&pu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=2,up(e,t,n,r)}finally{j.p=a,A.T=i}}function lp(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=8,up(e,t,n,r)}finally{j.p=a,A.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=yt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ge(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Re(o);s.entanglements[1]|=c,o&=~c}nd(a),!(Nl&6)&&($l=De()+500,rd(0,!1))}}break;case 31:case 13:s=ti(a,2),s!==null&&pu(s,a,2),vu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=nn(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=vt(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 fp=e,null}function mp(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(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(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=yt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=vt(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,st(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,st(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tn=r,n.target.dispatchEvent(r),tn=null}else return t=yt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=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(pp(r||n)===null)continue;break}var a=yt(n);a!==null&&(e.splice(t,3),t-=3,vs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.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[ut]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ut]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){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 Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,du(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),vu(),t[dt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=ot();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.8`)throw Error(i(527,Lp,`19.2.8`));j.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 Rp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:A,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{F=zp.inject(Rp),Ie=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=zs,s=Bs,c=Vs;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=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[dt]=t.current,xd(e),new Fp(t)}})),at=n(((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=it()}))(),ot=e(rt(),1);function st(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var ct=e=>{switch(e){case`success`:return dt;case`info`:return pt;case`warning`:return ft;case`error`:return mt;default:return null}},lt=Array(12).fill(0),ut=({visible:e,className:t})=>P.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},P.createElement(`div`,{className:`sonner-spinner`},lt.map((e,t)=>P.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),dt=P.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},P.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),ft=P.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},P.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),pt=P.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},P.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),mt=P.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},P.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),ht=P.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},P.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),P.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),gt=()=>{let[e,t]=P.useState(document.hidden);return P.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},_t=1,vt=100,yt=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:_t++,bt=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-vt;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=yt(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],P.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(St(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!P.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!P.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!P.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!P.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=yt(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},xt=(e,t)=>bt.message(e,t),St=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,I=Object.assign(xt,{success:bt.success,info:bt.info,warning:bt.warning,error:bt.error,custom:bt.custom,message:bt.message,promise:bt.promise,dismiss:bt.dismiss,loading:bt.loading},{getHistory:()=>bt.toasts,getToasts:()=>bt.getActiveToasts()});st(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Ct(e){return e.label!==void 0}var wt=3,Tt=`24px`,Et=`16px`,Dt=4e3,Ot=356,kt=14,At=45,jt=200;function Mt(...e){return e.filter(Boolean).join(` `)}function Nt(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Pt=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,ee]=P.useState(null),[D,O]=P.useState(null),[te,ne]=P.useState(!1),[k,A]=P.useState(!1),[j,re]=P.useState(!1),[M,ie]=P.useState(!1),[N,ae]=P.useState(!1),[oe,se]=P.useState(0),[ce,le]=P.useState(0),ue=P.useRef(n.duration||y||Dt),de=P.useRef(null),fe=P.useRef(null),pe=c===0,me=c+1<=o,he=n.type,ge=he??`default`,_e=n.dismissible!==!1,ve=n.className||``,ye=n.descriptionClassName||``,be=P.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),xe=P.useMemo(()=>n.closeButton??p,[n.closeButton,p]),Se=P.useMemo(()=>n.duration||y||Dt,[n.duration,y]),Ce=P.useRef(0),we=P.useRef(0),Te=P.useRef(0),Ee=P.useRef(null),[De,Oe]=b.split(`-`),ke=P.useMemo(()=>s.reduce((e,t,n)=>n>=be?e:e+t.height,0),[s,be]),Ae=gt(),je=P.useMemo(()=>e.swipeDirections??Nt(b),[e.swipeDirections,b]),Me=n.invert||t,Ne=he===`loading`;we.current=P.useMemo(()=>be*x+ke,[be,ke]),P.useEffect(()=>{ue.current=Se},[Se]),P.useEffect(()=>{ne(!0)},[]),P.useEffect(()=>{let e=fe.current;if(e){let t=e.getBoundingClientRect().height;return le(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),P.useLayoutEffect(()=>{if(!te)return;let e=fe.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,le(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[te,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Pe=P.useCallback(()=>{A(!0),se(we.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},jt)},[n,d,a,we]);P.useEffect(()=>{if(n.promise&&he===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Ae?(()=>{if(Te.current<Ce.current){let e=new Date().getTime()-Ce.current;ue.current-=e}Te.current=new Date().getTime()})():ue.current!==1/0&&(Ce.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Pe()},ue.current)),()=>clearTimeout(e)},[u,i,n,he,Ae,Pe]),P.useEffect(()=>{n.delete&&(Pe(),n.onDismiss==null||n.onDismiss.call(n,n))},[Pe,n.delete]);function Fe(){return w?.loading?P.createElement(`div`,{className:Mt(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":he===`loading`},w.loading):P.createElement(ut,{className:Mt(C?.loader,n?.classNames?.loader),visible:he===`loading`})}let F=n.icon||w?.[he]||ct(he);return P.createElement(`li`,{tabIndex:0,ref:fe,className:Mt(_,ve,C?.toast,n?.classNames?.toast,C?.[ge],n?.classNames?.[ge]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":te,"data-promise":!!n.promise,"data-swiped":N,"data-removed":k,"data-visible":me,"data-y-position":De,"data-x-position":Oe,"data-index":c,"data-front":pe,"data-swiping":j,"data-dismissible":_e,"data-type":he,"data-invert":Me,"data-swipe-out":M,"data-swipe-direction":D,"data-expanded":!!(u||S&&te),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${k?oe:we.current}px`,"--initial-height":S?`auto`:`${ce}px`,...m,...n.style},onDragEnd:()=>{re(!1),ee(null),Ee.current=null},onPointerDown:e=>{e.button!==2&&(Ne||!_e||(de.current=new Date,se(we.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(re(!0),Ee.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(M||!_e)return;Ee.current=null;let e=Number(fe.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(fe.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-de.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?je.includes(e>0?`right`:`left`):je.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=At||a>.11)){se(we.current),n.onDismiss==null||n.onDismiss.call(n,n),O(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Pe(),ie(!0);return}var o,s;(o=fe.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=fe.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),ae(!1),re(!1),ee(null)},onPointerMove:e=>{var t,n;if(!Ee.current||!_e||window.getSelection()?.toString().length>0)return;let r=e.clientY-Ee.current.y,i=e.clientX-Ee.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&ee(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(je.includes(`top`)||je.includes(`bottom`)){if(je.includes(`top`)&&r<0||je.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(je.includes(`left`)||je.includes(`right`))){if(je.includes(`left`)&&i<0||je.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&ae(!0),(t=fe.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=fe.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},xe&&!n.jsx&&he!==`loading`?P.createElement(`button`,{"aria-label":T,"data-disabled":Ne,"data-close-button":!0,onClick:Ne||!_e?()=>{}:()=>{Pe(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Mt(C?.closeButton,n?.classNames?.closeButton)},w?.close??ht):null,(he||n.icon||n.promise)&&n.icon!==null&&(w?.[he]!==null||n.icon)?P.createElement(`div`,{"data-icon":``,className:Mt(C?.icon,n?.classNames?.icon)},he===`loading`?n.icon||Fe():n.promise?Fe():null,he===`loading`?null:F):null,P.createElement(`div`,{"data-content":``,className:Mt(C?.content,n?.classNames?.content)},P.createElement(`div`,{"data-title":``,className:Mt(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?P.createElement(`div`,{"data-description":``,className:Mt(v,ye,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),P.isValidElement(n.cancel)?n.cancel:n.cancel&&Ct(n.cancel)?P.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Ct(n.cancel)&&_e&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Pe())},className:Mt(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,P.isValidElement(n.action)?n.action:n.action&&Ct(n.action)?P.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Ct(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Pe())},className:Mt(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Ft(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function It(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Et:Tt;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Lt=P.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=wt,toastOptions:g,dir:_=Ft(),gap:v=kt,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=P.useState([]),w=P.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=P.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,ee]=P.useState([]),[D,O]=P.useState(!1),[te,ne]=P.useState(!1),[k,A]=P.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),j=P.useRef(null),re=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),M=P.useRef(null),ie=P.useRef(!1),N=P.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||bt.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return P.useEffect(()=>bt.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{ot.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),P.useEffect(()=>{if(d!==`system`){A(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?A(`dark`):A(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{A(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{A(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),P.useEffect(()=>{S.length<=1&&O(!1)},[S]),P.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=j.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===j.current||j.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),P.useEffect(()=>{if(j.current)return()=>{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,ie.current=!1)}},[j.current]),P.createElement(`section`,{ref:t,"aria-label":b??`${x} ${re}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?P.createElement(`ol`,{key:t,dir:_===`auto`?Ft():_,tabIndex:-1,ref:j,className:c,"data-sonner-toaster":!0,"data-sonner-theme":k,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${Ot}px`,"--gap":`${v}px`,...m,...It(l,u)},onBlur:e=>{ie.current&&!e.currentTarget.contains(e.relatedTarget)&&(ie.current=!1,M.current&&=(M.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ie.current||(ie.current=!0,M.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{te||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ne(!0)},onPointerUp:()=>ne(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>P.createElement(Pt,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:te,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:N,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:ee,expandByDefault:o,gap:v,expanded:D,swipeDirections:e.swipeDirections}))):null}))}),Rt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),zt=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Bt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Vt=e=>{let t=Bt(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ht={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ut=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Wt=(0,P.createContext)({}),Gt=()=>(0,P.useContext)(Wt),Kt=(0,P.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Gt()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,P.createElement)(`svg`,{ref:c,...Ht,width:t??l??Ht.width,height:t??l??Ht.height,stroke:e??f,strokeWidth:m,className:Rt(`lucide`,p,i),...!a&&!Ut(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,P.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),L=(e,t)=>{let n=(0,P.forwardRef)(({className:n,...r},i)=>(0,P.createElement)(Kt,{ref:i,iconNode:t,className:Rt(`lucide-${zt(Vt(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Vt(e),n},qt=L(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Jt=L(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),Yt=L(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Xt=L(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),Zt=L(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),Qt=L(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),$t=L(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),en=L(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),tn=L(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),nn=L(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),rn=L(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),an=L(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),on=L(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),sn=L(`clipboard-copy`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]),cn=L(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),ln=L(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),un=L(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),dn=L(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]),fn=L(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),pn=L(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),mn=L(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),hn=L(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),gn=L(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),_n=L(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),vn=L(`file-spreadsheet`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),yn=L(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),bn=L(`file-type`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M11 18h2`,key:`12mj7e`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5`,key:`qbrxap`}]]),xn=L(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),Sn=L(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Cn=L(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),wn=L(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),Tn=L(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),En=L(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),Dn=L(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),On=L(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),kn=L(`layout-template`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]]),An=L(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),jn=L(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),Mn=L(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Nn=L(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),Pn=L(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Fn=L(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),In=L(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),Ln=L(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Rn=L(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),zn=L(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),Bn=L(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Vn=L(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),Hn=L(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Un=L(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Wn=L(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Gn=L(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Kn=L(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),qn=L(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Jn=L(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),Yn=L(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Xn=L(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Zn=L(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Qn=L(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),$n=L(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),er=L(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),tr=L(`spline`,[[`circle`,{cx:`19`,cy:`5`,r:`2`,key:`mhkx31`}],[`circle`,{cx:`5`,cy:`19`,r:`2`,key:`v8kfzx`}],[`path`,{d:`M5 17A12 12 0 0 1 17 5`,key:`1okkup`}]]),nr=L(`sprout`,[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),rr=L(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),ir=L(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ar=L(`toggle-left`,[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]),or=L(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),sr=L(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),cr=L(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),lr=L(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),ur=L(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),dr=L(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),fr=L(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),pr=L(`zap`,[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]),mr=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},hr=(e=>e?mr(e):mr),gr=e=>e;function _r(e,t=gr){let n=P.useSyncExternalStore(e.subscribe,P.useCallback(()=>t(e.getState()),[e,t]),P.useCallback(()=>t(e.getInitialState()),[e,t]));return P.useDebugValue(n),n}var vr=e=>{let t=hr(e),n=e=>_r(t,e);return Object.assign(n,t),n},yr=(e=>e?vr(e):vr);async function br(e,t){let n=await fetch(e,{...t,headers:{"content-type":`application/json`,...t?.headers??{}}});if(!n.ok){let t=await n.text().catch(()=>n.statusText);throw Error(`${n.status} ${e}: ${t}`)}if(n.status!==204)return await n.json()}var xr=e=>br(e),Sr=(e,t)=>br(e,{method:`POST`,body:JSON.stringify(t)}),R=e=>`/api/domain/${encodeURIComponent(e)}`,z={workspace:()=>xr(`/api/workspace`),createDomain:e=>Sr(`/api/workspace/create`,{name:e}),catalog:()=>xr(`/api/catalog`),instances:()=>xr(`/api/instances`),switchInstance:e=>Sr(`/api/instances/use`,{name:e}),bundle:e=>xr(`${R(e)}/bundle`),core:e=>xr(`${R(e)}/core`),anatomy:e=>xr(`${R(e)}/anatomy`),viewRuntime:(e,t)=>xr(`${R(e)}/views/${encodeURIComponent(t)}/runtime`),launchView:(e,t,n)=>Sr(`${R(e)}/views/${encodeURIComponent(t)}/session`,n),closeViewSession:(e,t)=>Sr(`${R(e)}/views/sessions/close`,{sessionId:t}),updates:e=>xr(`${R(e)}/updates`),applyUpdate:e=>Sr(`${R(e)}/updates/apply`,{}),instance:e=>xr(`${R(e)}/instance`),deployInstance:e=>Sr(`${R(e)}/instance/deploy`,{}),comments:e=>xr(`${R(e)}/comments`),createComment:(e,t)=>Sr(`${R(e)}/comments`,{action:`create`,...t}),replyComment:(e,t,n)=>Sr(`${R(e)}/comments`,{action:`reply`,id:t,entry:n}),editComment:(e,t,n,r)=>Sr(`${R(e)}/comments`,{action:`edit`,id:t,entryId:n,text:r}),setCommentStatus:(e,t,n,r)=>Sr(`${R(e)}/comments`,{action:`status`,id:t,status:n,closeNote:r}),deleteComment:(e,t)=>Sr(`${R(e)}/comments`,{action:`delete`,id:t}),mergeReply:(e,t)=>Sr(`${R(e)}/comments/merge`,{text:t}),context:e=>xr(`${R(e)}/context`),addContext:(e,t)=>Sr(`${R(e)}/context`,{action:`add`,...t}),updateContext:(e,t,n)=>Sr(`${R(e)}/context`,{action:`update`,id:t,...n}),deleteContext:(e,t)=>Sr(`${R(e)}/context`,{action:`delete`,id:t}),setAutoInclude:(e,t,n)=>Sr(`${R(e)}/context`,{action:`include`,id:t,include:n}),integrations:e=>xr(`${R(e)}/integrations`),upsertIntegration:(e,t)=>Sr(`${R(e)}/integrations`,{action:`upsert`,...t}),deleteIntegration:(e,t)=>Sr(`${R(e)}/integrations`,{action:`delete`,id:t}),settings:e=>xr(`${R(e)}/settings`),updateSettings:(e,t)=>Sr(`${R(e)}/settings`,{action:`update`,settings:t}),copyPayload:(e,t)=>Sr(`${R(e)}/copy-payload`,{includeAuto:t}),agentSnapshot:e=>xr(`${R(e)}/agent`),agentSubmit:(e,t)=>Sr(`${R(e)}/agent/submit`,t?{message:t}:{}),agentResume:e=>Sr(`${R(e)}/agent/submit`,{resume:!0}),agentCancel:e=>Sr(`${R(e)}/agent/cancel`,{}),agentReset:e=>Sr(`${R(e)}/agent/reset`,{}),agentSession:e=>xr(`${R(e)}/agent/session`),setAgentSession:(e,t,n)=>Sr(`${R(e)}/agent/session`,{harness:t,sessionId:n}),agentSystemPrompt:e=>xr(`${R(e)}/agent/prompt/system`),harness:e=>xr(`${R(e)}/agent/harness`),selectHarness:(e,t)=>Sr(`${R(e)}/agent/harness`,{id:t}),harnessGateway:e=>xr(`${R(e)}/agent/harness-gateway`),setHarnessGateway:(e,t,n)=>Sr(`${R(e)}/agent/harness-gateway`,{action:`set`,scope:t,config:n}),clearHarnessGateway:(e,t)=>Sr(`${R(e)}/agent/harness-gateway`,{action:`clear`,scope:t}),pushHostToken:(e,t)=>Sr(`${R(e)}/agent/harness-gateway/host-token`,{token:t}),loadout:(e,t=!1)=>xr(`${R(e)}/agent/loadout${t?`?refresh=1`:``}`),usage:e=>xr(`${R(e)}/agent/usage`),skillContent:(e,t)=>xr(`${R(e)}/agent/skill?command=${encodeURIComponent(t)}`),env:(e,t)=>xr(`${R(e)}/env?env=${t}`),setEnv:(e,t,n)=>Sr(`${R(e)}/env`,{env:t,updates:n}),documents:e=>xr(`${R(e)}/context/documents`),uploadDocuments:async(e,t)=>{let n=new FormData;for(let e of t)n.append(`files`,e);let r=await fetch(`${R(e)}/context/documents`,{method:`POST`,body:n});if(!r.ok)throw Error(`${r.status} upload failed`);return await r.json()},deleteDocument:(e,t)=>Sr(`${R(e)}/context/documents/delete`,{id:t}),updateDocument:(e,t,n)=>Sr(`${R(e)}/context/documents/update`,{id:t,content:n}),docUrl:(e,t)=>`${R(e)}/context/documents/${encodeURIComponent(t)}/raw`,docContent:(e,t)=>fetch(`${R(e)}/context/documents/${encodeURIComponent(t)}/raw`).then(e=>e.text()),layout:e=>xr(`${R(e)}/layout`),setLayout:(e,t)=>Sr(`${R(e)}/layout`,{action:`set`,positions:t}),resetLayout:e=>Sr(`${R(e)}/layout`,{action:`reset`}),visibility:e=>xr(`${R(e)}/visibility`),setVisibility:(e,t)=>Sr(`${R(e)}/visibility`,{action:`set`,...t}),resetVisibility:e=>Sr(`${R(e)}/visibility`,{action:`reset`})},B={workspace:[`workspace`],catalog:[`catalog`],instances:[`instances`],bundle:e=>[`bundle`,e],core:e=>[`core`,e],anatomy:e=>[`anatomy`,e],viewRuntime:(e,t)=>[`view-runtime`,e,t],updates:e=>[`updates`,e],instance:e=>[`instance`,e],comments:e=>[`comments`,e],context:e=>[`context`,e],integrations:e=>[`integrations`,e],settings:e=>[`settings`,e],layout:e=>[`layout`,e],visibility:e=>[`visibility`,e],documents:e=>[`documents`,e],agent:e=>[`agent`,e],agentSession:e=>[`agent-session`,e],agentSystemPrompt:e=>[`agent-system-prompt`,e],harness:e=>[`harness`,e],harnessGateway:e=>[`harness-gateway`,e],loadout:e=>[`loadout`,e],usage:e=>[`usage`,e],skillContent:(e,t)=>[`skill-content`,e,t],env:(e,t)=>[`env`,e,t]},Cr={queued:0,running:1,succeeded:2,failed:2,canceled:2,interrupted:2},wr=yr(e=>({runs:{},drawerOpen:!1,setRun:t=>e(e=>{let n=e.runs[t.domainId];if(n&&n.id===t.id){let r=t.events.length>=n.events.length?t.events:n.events,i=Cr[t.status]>=Cr[n.status]?t.status:n.status;return{runs:{...e.runs,[t.domainId]:{...n,...t,events:r,status:i}}}}return{runs:{...e.runs,[t.domainId]:t}}}),appendEvent:(t,n,r)=>e(e=>{let i=e.runs[t];return!i||i.id!==n||i.events.some(e=>e.id===r.id)?e:{runs:{...e.runs,[t]:{...i,events:[...i.events,r]}}}}),setDrawer:t=>e({drawerOpen:t})}));function Tr(e){return Qe({queryKey:B.agent(e??``),queryFn:()=>z.agentSnapshot(e),enabled:!!e})}function Er(e){let t=wr(t=>e?t.runs[e]:void 0),n=Tr(e);return t??n.data?.run??null}function Dr(e){return e?.status===`running`||e?.status===`queued`}var Or=new Set([`class`,`function`,`policy`,`view`,`core`]),kr=/^(.+):(class|function|policy|view|core)\.(.+)$/;function Ar(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.origin==`string`&&typeof t.name==`string`&&typeof t.kind==`string`&&Or.has(t.kind)}function jr(e){return Ar(e)&&e.kind===`class`}function Mr(e){return`${e.origin}:${e.kind}.${e.name}`}function Nr(e){if(typeof e!=`string`)return;let t=kr.exec(e);if(t)return{origin:t[1],kind:t[2],name:t[3]}}function Pr(e){let t=Nr(e);return t&&jr(t)?t:void 0}function Fr(e,t){return t.origin===e.domain?!!e.classes[t.name]:!!e.importsByKey[Mr(t)]}function Ir(e,t){let n=e?.views??[],r=e?.client.routes??{},i=new Set(Object.keys(t?.ir?.classes??{})),a=!!t?.depsInstalled&&!!t?.ir,o=n.map(e=>{let n=t?.ir?.views?.[e.slug]?.target,o=n?n.kind===`definition`?n.definitions.filter(jr):[]:void 0,s=o?o.map(e=>e.name):Array.isArray(e.viewFor)?e.viewFor:e.viewFor?[e.viewFor]:[],c=o?.filter(e=>t?.ir?Fr(t.ir,e):!1),l=o?void 0:s.filter(e=>i.has(e)),u=[...new Set(c?c.filter(e=>e.origin===t?.ir?.domain).map(e=>e.name):l??[])],d=c?.length??l?.length??0,f=u[0]??null,p=`ok`;s.length&&d<s.length?p=a?`unbound-class`:`schema-unavailable`:e.kind===`spa`&&e.mount&&!(e.mount in r)&&!t?.ir?.views?.[e.slug]&&(p=`missing-impl`);let m=s.length===0||u.length===0;return{...e,boundClasses:u,boundClass:f,unbound:m,drift:p}}),s=new Map;for(let e of o)for(let t of e.boundClasses){let n=s.get(t)??[];n.push(e),s.set(t,n)}let c=o.filter(e=>e.unbound),l=new Set(o.map(e=>e.mount).filter(e=>!!e)),u=Object.keys(r).filter(e=>!l.has(e));return{all:o,byClass:s,unbound:c,orphanRoutes:u,hasDrift:o.some(e=>e.drift===`missing-impl`||e.drift===`unbound-class`)||u.length>0}}function Lr(e,t){return e.byClass.get(t)??[]}function Rr(e){switch(e){case`missing-impl`:return{text:`no client route`,tone:`warn`};case`unbound-class`:return{text:`unknown class`,tone:`warn`};case`schema-unavailable`:return{text:`deps not installed`,tone:`muted`};default:return null}}function zr(){return Qe({queryKey:B.workspace,queryFn:z.workspace})}function Br(){return Qe({queryKey:B.catalog,queryFn:z.catalog})}function Vr(){return Qe({queryKey:B.instances,queryFn:z.instances,refetchInterval:3e4})}function Hr(e){return Qe({queryKey:B.bundle(e??``),queryFn:()=>z.bundle(e),enabled:!!e})}function Ur(e){return Qe({queryKey:B.anatomy(e??``),queryFn:()=>z.anatomy(e),enabled:!!e})}function Wr(e,t,n=!0){return Qe({queryKey:B.viewRuntime(e??``,t??``),queryFn:()=>z.viewRuntime(e,t),enabled:n&&!!e&&!!t,staleTime:2e3,refetchInterval:n?1e4:!1})}function Gr(e){let{data:t}=Ur(e),{data:n}=Hr(e);return(0,P.useMemo)(()=>Ir(t,n),[t,n])}function Kr(e){let{data:t}=ri(e);return Qe({queryKey:B.updates(e??``),queryFn:()=>z.updates(e),enabled:!!e,staleTime:3e5,refetchInterval:t?.updatesPollMs??6e5})}function qr(e){return Qe({queryKey:B.agentSession(e??``),queryFn:()=>z.agentSession(e),enabled:!!e})}function Jr(e){return Qe({queryKey:B.agentSystemPrompt(e??``),queryFn:()=>z.agentSystemPrompt(e),enabled:!!e,staleTime:3e5})}function Yr(e){return Qe({queryKey:B.harness(e??``),queryFn:()=>z.harness(e),enabled:!!e,staleTime:15e3})}function Xr(e){return Qe({queryKey:B.harnessGateway(e??``),queryFn:()=>z.harnessGateway(e),enabled:!!e})}function Zr(e){return Qe({queryKey:B.loadout(e??``),queryFn:()=>z.loadout(e),enabled:!!e,staleTime:6e4})}function Qr(e){return Qe({queryKey:B.usage(e??``),queryFn:()=>z.usage(e),enabled:!!e})}function $r(e,t){return Qe({queryKey:B.skillContent(e??``,t??``),queryFn:()=>z.skillContent(e,t),enabled:!!e&&!!t,staleTime:3e5})}function ei(e,t=`dev`,n=!0){return Qe({queryKey:B.env(e??``,t),queryFn:()=>z.env(e,t),enabled:n&&!!e})}function ti(e){let{data:t}=ri(e);return Qe({queryKey:B.instance(e??``),queryFn:()=>z.instance(e),enabled:!!e,refetchInterval:t?.instancePollMs??3e4})}function ni(e){return Qe({queryKey:B.comments(e??``),queryFn:()=>z.comments(e),enabled:!!e})}function ri(e){return Qe({queryKey:B.settings(e??``),queryFn:()=>z.settings(e),enabled:!!e})}function ii(e){return Qe({queryKey:B.core(e??``),queryFn:()=>z.core(e),enabled:!!e})}function ai(e){return Qe({queryKey:B.layout(e??``),queryFn:()=>z.layout(e),enabled:!!e,staleTime:1/0})}function oi(e){return Qe({queryKey:B.visibility(e??``),queryFn:()=>z.visibility(e),enabled:!!e,staleTime:1/0})}function si(e){return Qe({queryKey:B.documents(e??``),queryFn:()=>z.documents(e),enabled:!!e})}function ci(){let e=Le();return(0,P.useCallback)(t=>{for(let n of[`bundle`,`anatomy`,`comments`,`context`,`integrations`,`core`,`env`])e.invalidateQueries({queryKey:[n,t]})},[e])}function li(e){let t=Le(),n=()=>t.invalidateQueries({queryKey:B.comments(e)});return{create:$e({mutationFn:t=>z.createComment(e,t),onSuccess:n}),reply:$e({mutationFn:t=>z.replyComment(e,t.commentId,t.entry),onSuccess:n}),edit:$e({mutationFn:t=>z.editComment(e,t.commentId,t.entryId,t.text),onSuccess:n}),setStatus:$e({mutationFn:t=>z.setCommentStatus(e,t.commentId,t.status,t.closeNote),onSuccess:n}),remove:$e({mutationFn:t=>z.deleteComment(e,t),onSuccess:n}),merge:$e({mutationFn:t=>z.mergeReply(e,t),onSuccess:n})}}function ui(){try{let e=localStorage.getItem(`studio.lastSection`);if(e===`context`||e===`schema`||e===`process`||e===`comments`)return e}catch{}return`context`}var V=yr(e=>({section:ui(),focusId:null,canvasMode:`schema`,panelOverlay:null,selectionHistory:[],collapsedModules:[],commentDraft:null,hidden:{},showInheritedEdges:!0,openAnchorRef:null,openAnchorId:null,commentMode:!1,askMode:!1,paletteOpen:!1,settingsOpen:!1,copyOpen:!1,mergeOpen:!1,setDomain:t=>{try{t&&localStorage.setItem(`studio.lastDomain`,t)}catch{}e({domainId:t,canvasMode:`schema`,panelOverlay:null,selectedClass:void 0,focusId:null,openAnchorRef:null,selectionHistory:[],hidden:{},showInheritedEdges:!0})},setSection:t=>{try{localStorage.setItem(`studio.lastSection`,t)}catch{}e({section:t,canvasMode:`schema`,panelOverlay:null,openAnchorRef:null})},setCanvasMode:t=>e({canvasMode:t,panelOverlay:null,selectedClass:void 0,focusId:null,openAnchorRef:null,selectionHistory:[]}),setPanelOverlay:t=>e({panelOverlay:t}),selectClass:t=>e(e=>t===e.selectedClass&&!e.panelOverlay?{}:{selectedClass:t,panelOverlay:null,focusId:t?.startsWith(`class.`)?t:e.focusId,selectionHistory:e.selectedClass?[...e.selectionHistory,e.selectedClass].slice(-50):e.selectionHistory}),focusClass:t=>e(e=>({selectedClass:t,panelOverlay:null,focusId:e.focusId===t?null:t,selectionHistory:e.selectedClass&&e.selectedClass!==t?[...e.selectionHistory,e.selectedClass].slice(-50):e.selectionHistory})),setFocus:t=>e({focusId:t}),back:()=>e(e=>{if(!e.selectionHistory.length)return{};let t=e.selectionHistory[e.selectionHistory.length-1];return{selectedClass:t,panelOverlay:null,focusId:t.startsWith(`class.`)?t:e.focusId,selectionHistory:e.selectionHistory.slice(0,-1)}}),toggleModule:t=>e(e=>({collapsedModules:e.collapsedModules.includes(t)?e.collapsedModules.filter(e=>e!==t):[...e.collapsedModules,t]})),toggleHidden:t=>e(e=>{let n={...e.hidden};return n[t]?delete n[t]:n[t]=!0,{hidden:n}}),setVisibility:({hidden:t,showInheritedEdges:n})=>e({hidden:t,showInheritedEdges:n}),toggleInheritedEdges:()=>e(e=>({showInheritedEdges:!e.showInheritedEdges})),setOpenAnchor:(t,n=null)=>e({openAnchorRef:t,openAnchorId:n}),toggleCommentMode:t=>e(e=>({commentMode:t??!e.commentMode,askMode:!1,openAnchorRef:null})),toggleAskMode:t=>e(e=>({askMode:t??!e.askMode,commentMode:!1,openAnchorRef:null})),setCommentDraft:t=>e({commentDraft:t}),setPaletteOpen:t=>e({paletteOpen:t}),setSettingsOpen:t=>e({settingsOpen:t}),setCopyOpen:t=>e({copyOpen:t}),setMergeOpen:t=>e({mergeOpen:t})}));function di(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=di(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function fi(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=di(e))&&(r&&(r+=` `),r+=t);return r}var pi=(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},mi=(e,t)=>({classGroupId:e,validator:t}),hi=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),gi=`-`,_i=[],vi=`arbitrary..`,yi=e=>{let t=Si(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return xi(e);let n=e.split(gi);return bi(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?pi(i,t):t:i||_i}return n[e]||_i}}},bi=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=bi(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(gi):e.slice(t).join(gi),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},xi=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?vi+r:void 0})(),Si=e=>{let{theme:t,classGroups:n}=e;return Ci(n,t)},Ci=(e,t)=>{let n=hi();for(let r in e){let i=e[r];wi(i,n,r,t)}return n},wi=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Ti(i,t,n,r)}},Ti=(e,t,n,r)=>{if(typeof e==`string`){Ei(e,t,n);return}if(typeof e==`function`){Di(e,t,n,r);return}Oi(e,t,n,r)},Ei=(e,t,n)=>{let r=e===``?t:ki(t,e);r.classGroupId=n},Di=(e,t,n,r)=>{if(Ai(e)){wi(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(mi(n,e))},Oi=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];wi(o,ki(t,a),n,r)}},ki=(e,t)=>{let n=e,r=t.split(gi),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=hi(),n.nextPart.set(t,i)),n=i}return n},Ai=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ji=e=>{if(e<1)return{get:()=>void 0,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)}}},H=`!`,Mi=`:`,Ni=[],Pi=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Fi=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===Mi){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(H)?(c=s.slice(0,-1),l=!0):s.startsWith(H)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Pi(t,l,c,u)};if(t){let e=t+Mi,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Pi(Ni,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Ii=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:ji(e.cacheSize),parseClassName:Fi(e),sortModifiers:Ii(e),postfixLookupClassGroupIds:Ri(e),...yi(e)}),Ri=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},zi=/\s+/,Bi=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(zi),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+H:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Vi=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Hi(n))&&(i&&(i+=` `),i+=r);return i},Hi=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Hi(e[r]))&&(n&&(n+=` `),n+=t);return n},Ui=(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=Bi(e,n);return i(e,a),a};return a=o,(...e)=>a(Vi(...e))},Wi=[],Gi=e=>{let t=t=>t[e]||Wi;return t.isThemeGetter=!0,t},Ki=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ji=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Yi=/^(\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$/,Zi=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Qi=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$i=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ea=e=>Ji.test(e),U=e=>!!e&&!Number.isNaN(Number(e)),ta=e=>!!e&&Number.isInteger(Number(e)),na=e=>e.endsWith(`%`)&&U(e.slice(0,-1)),ra=e=>Yi.test(e),ia=()=>!0,aa=e=>Xi.test(e)&&!Zi.test(e),oa=()=>!1,sa=e=>Qi.test(e),ca=e=>$i.test(e),la=e=>!W(e)&&!G(e),ua=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),da=e=>Ea(e,Aa,oa),W=e=>Ki.test(e),fa=e=>Ea(e,ja,aa),pa=e=>Ea(e,Ma,U),ma=e=>Ea(e,Pa,ia),ha=e=>Ea(e,Na,oa),ga=e=>Ea(e,Oa,oa),_a=e=>Ea(e,ka,ca),va=e=>Ea(e,Fa,sa),G=e=>qi.test(e),ya=e=>Da(e,ja),ba=e=>Da(e,Na),xa=e=>Da(e,Oa),Sa=e=>Da(e,Aa),Ca=e=>Da(e,ka),wa=e=>Da(e,Fa,!0),Ta=e=>Da(e,Pa,!0),Ea=(e,t,n)=>{let r=Ki.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Da=(e,t,n=!1)=>{let r=qi.exec(e);return r?r[1]?t(r[1]):n:!1},Oa=e=>e===`position`||e===`percentage`,ka=e=>e===`image`||e===`url`,Aa=e=>e===`length`||e===`size`||e===`bg-size`,ja=e=>e===`length`,Ma=e=>e===`number`,Na=e=>e===`family-name`,Pa=e=>e===`number`||e===`weight`,Fa=e=>e===`shadow`,Ia=Ui(()=>{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=()=>[ea,`full`,`auto`,...w()],E=()=>[ta,`none`,`subgrid`,G,W],ee=()=>[`auto`,{span:[`full`,ta,G,W]},ta,G,W],D=()=>[ta,`auto`,G,W],O=()=>[`auto`,`min`,`max`,`fr`,G,W],te=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ne=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],k=()=>[`auto`,...w()],A=()=>[ea,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],j=()=>[ea,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],re=()=>[ea,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[e,G,W],ie=()=>[...b(),xa,ga,{position:[G,W]}],N=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,Sa,da,{size:[G,W]}],oe=()=>[na,ya,fa],se=()=>[``,`none`,`full`,l,G,W],ce=()=>[``,U,ya,fa],le=()=>[`solid`,`dashed`,`dotted`,`double`],ue=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],de=()=>[U,na,xa,ga],fe=()=>[``,`none`,m,G,W],pe=()=>[`none`,U,G,W],me=()=>[`none`,U,G,W],he=()=>[U,G,W],ge=()=>[ea,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[ra],breakpoint:[ra],color:[ia],container:[ra],"drop-shadow":[ra],ease:[`in`,`out`,`in-out`],font:[la],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[ra],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[ra],shadow:[ra],spacing:[`px`,U],text:[ra],"text-shadow":[ra],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ea,W,G,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,G,W]}],"container-named":[ua],columns:[{columns:[U,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:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[ta,`auto`,G,W]}],basis:[{basis:[ea,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[U,ea,`auto`,`initial`,`none`,W]}],grow:[{grow:[``,U,G,W]}],shrink:[{shrink:[``,U,G,W]}],order:[{order:[ta,`first`,`last`,`none`,G,W]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...te(),`normal`]}],"justify-items":[{"justify-items":[...ne(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ne()]}],"align-content":[{content:[`normal`,...te()]}],"align-items":[{items:[...ne(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ne(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...ne(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ne()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mbs:[{mbs:k()}],mbe:[{mbe:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:A()}],"inline-size":[{inline:[`auto`,...j()]}],"min-inline-size":[{"min-inline":[`auto`,...j()]}],"max-inline-size":[{"max-inline":[`none`,...j()]}],"block-size":[{block:[`auto`,...re()]}],"min-block-size":[{"min-block":[`auto`,...re()]}],"max-block-size":[{"max-block":[`none`,...re()]}],w:[{w:[s,`screen`,...A()]}],"min-w":[{"min-w":[s,`screen`,`none`,...A()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...A()]}],h:[{h:[`screen`,`lh`,...A()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...A()]}],"max-h":[{"max-h":[`screen`,`lh`,...A()]}],"font-size":[{text:[`base`,n,ya,fa]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ta,ma]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,na,W]}],"font-family":[{font:[ba,ha,t]}],"font-features":[{"font-features":[W]}],"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":[U,`none`,G,pa]}],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:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...le(),`wavy`]}],"text-decoration-thickness":[{decoration:[U,`from-font`,`auto`,G,fa]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[U,`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()}],"tab-size":[{tab:[ta,G,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:ie()}],"bg-repeat":[{bg:N()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},ta,G,W],radial:[``,G,W],conic:[ta,G,W]},Ca,_a]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...le(),`hidden`,`none`]}],"divide-style":[{divide:[...le(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...le(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[U,G,W]}],"outline-w":[{outline:[``,U,ya,fa]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`none`,u,wa,va]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,wa,va]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:ce()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[U,fa]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,wa,va]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[U,G,W]}],"mix-blend":[{"mix-blend":[...ue(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ue()}],"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":[U]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[G,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"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":[U]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:N()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,G,W]}],filter:[{filter:[``,`none`,G,W]}],blur:[{blur:fe()}],brightness:[{brightness:[U,G,W]}],contrast:[{contrast:[U,G,W]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,wa,va]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,U,G,W]}],"hue-rotate":[{"hue-rotate":[U,G,W]}],invert:[{invert:[``,U,G,W]}],saturate:[{saturate:[U,G,W]}],sepia:[{sepia:[``,U,G,W]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,G,W]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[U,G,W]}],"backdrop-contrast":[{"backdrop-contrast":[U,G,W]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,U,G,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[U,G,W]}],"backdrop-invert":[{"backdrop-invert":[``,U,G,W]}],"backdrop-opacity":[{"backdrop-opacity":[U,G,W]}],"backdrop-saturate":[{"backdrop-saturate":[U,G,W]}],"backdrop-sepia":[{"backdrop-sepia":[``,U,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:[U,`initial`,G,W]}],ease:[{ease:[`linear`,`initial`,_,G,W]}],delay:[{delay:[U,G,W]}],animate:[{animate:[`none`,v,G,W]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,G,W]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":[`scale-3d`],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[G,W,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"translate-none":[`translate-none`],zoom:[{zoom:[ta,G,W]}],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"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`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"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-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":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-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":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`,...M()]}],"stroke-w":[{stroke:[U,ya,fa,pa]}],stroke:[{stroke:[`none`,...M()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`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`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`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-bs`,`border-w-be`,`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-bs`,`border-color-be`,`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-mbs`,`scroll-mbe`,`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-pbs`,`scroll-pbe`,`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`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function K(...e){return Ia(fi(e))}function La(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ra=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,za=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ba={};function Va(e,t){return((t||Ba).jsx?za:Ra).test(e)}var Ha=/[ \t\n\f\r]/g;function Ua(e){return typeof e==`object`?e.type===`text`&&Wa(e.value):Wa(e)}function Wa(e){return e.replace(Ha,``)===``}var Ga=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Ga.prototype.normal={},Ga.prototype.property={},Ga.prototype.space=void 0;function Ka(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Ga(n,r,t)}function qa(e){return e.toLowerCase()}var Ja=class{constructor(e,t){this.attribute=t,this.property=e}};Ja.prototype.attribute=``,Ja.prototype.booleanish=!1,Ja.prototype.boolean=!1,Ja.prototype.commaOrSpaceSeparated=!1,Ja.prototype.commaSeparated=!1,Ja.prototype.defined=!1,Ja.prototype.mustUseProperty=!1,Ja.prototype.number=!1,Ja.prototype.overloadedBoolean=!1,Ja.prototype.property=``,Ja.prototype.spaceSeparated=!1,Ja.prototype.space=void 0;var Ya=t({boolean:()=>q,booleanish:()=>Za,commaOrSpaceSeparated:()=>to,commaSeparated:()=>eo,number:()=>J,overloadedBoolean:()=>Qa,spaceSeparated:()=>$a}),Xa=0,q=no(),Za=no(),Qa=no(),J=no(),$a=no(),eo=no(),to=no();function no(){return 2**++Xa}var ro=Object.keys(Ya),Y=class extends Ja{constructor(e,t,n,r){let i=-1;if(super(e,t),io(this,`space`,r),typeof n==`number`)for(;++i<ro.length;){let e=ro[i];io(this,ro[i],(n&Ya[e])===Ya[e])}}};Y.prototype.defined=!0;function io(e,t,n){n&&(e[t]=n)}function ao(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Y(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[qa(r)]=r,n[qa(a.attribute)]=r}return new Ga(t,n,e.space)}var oo=ao({properties:{ariaActiveDescendant:null,ariaAtomic:Za,ariaAutoComplete:null,ariaBusy:Za,ariaChecked:Za,ariaColCount:J,ariaColIndex:J,ariaColSpan:J,ariaControls:$a,ariaCurrent:null,ariaDescribedBy:$a,ariaDetails:null,ariaDisabled:Za,ariaDropEffect:$a,ariaErrorMessage:null,ariaExpanded:Za,ariaFlowTo:$a,ariaGrabbed:Za,ariaHasPopup:null,ariaHidden:Za,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$a,ariaLevel:J,ariaLive:null,ariaModal:Za,ariaMultiLine:Za,ariaMultiSelectable:Za,ariaOrientation:null,ariaOwns:$a,ariaPlaceholder:null,ariaPosInSet:J,ariaPressed:Za,ariaReadOnly:Za,ariaRelevant:null,ariaRequired:Za,ariaRoleDescription:$a,ariaRowCount:J,ariaRowIndex:J,ariaRowSpan:J,ariaSelected:Za,ariaSetSize:J,ariaSort:null,ariaValueMax:J,ariaValueMin:J,ariaValueNow:J,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function so(e,t){return t in e?e[t]:t}function co(e,t){return so(e,t.toLowerCase())}var lo=ao({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:eo,acceptCharset:$a,accessKey:$a,action:null,allow:null,allowFullScreen:q,allowPaymentRequest:q,allowUserMedia:q,alpha:q,alt:null,as:null,async:q,autoCapitalize:null,autoComplete:$a,autoFocus:q,autoPlay:q,blocking:$a,capture:null,charSet:null,checked:q,cite:null,className:$a,closedBy:null,colorSpace:null,cols:J,colSpan:J,command:null,commandFor:null,content:null,contentEditable:Za,controls:q,controlsList:$a,coords:J|eo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:q,defer:q,dir:null,dirName:null,disabled:q,download:Qa,draggable:Za,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:q,formTarget:null,headers:$a,height:J,hidden:Qa,high:J,href:null,hrefLang:null,htmlFor:$a,httpEquiv:$a,id:null,imageSizes:null,imageSrcSet:null,inert:q,inputMode:null,integrity:null,is:null,isMap:q,itemId:null,itemProp:$a,itemRef:$a,itemScope:q,itemType:$a,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:q,low:J,manifest:null,max:null,maxLength:J,media:null,method:null,min:null,minLength:J,multiple:q,muted:q,name:null,nonce:null,noModule:q,noValidate:q,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:q,optimum:J,pattern:null,ping:$a,placeholder:null,playsInline:q,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:q,referrerPolicy:null,rel:$a,required:q,reversed:q,rows:J,rowSpan:J,sandbox:$a,scope:null,scoped:q,seamless:q,selected:q,shadowRootClonable:q,shadowRootCustomElementRegistry:q,shadowRootDelegatesFocus:q,shadowRootMode:null,shadowRootSerializable:q,shape:null,size:J,sizes:null,slot:null,span:J,spellCheck:Za,src:null,srcDoc:null,srcLang:null,srcSet:null,start:J,step:null,style:null,tabIndex:J,target:null,title:null,translate:null,type:null,typeMustMatch:q,useMap:null,value:Za,width:J,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$a,axis:null,background:null,bgColor:null,border:J,borderColor:null,bottomMargin:J,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:q,declare:q,event:null,face:null,frame:null,frameBorder:null,hSpace:J,leftMargin:J,link:null,longDesc:null,lowSrc:null,marginHeight:J,marginWidth:J,noResize:q,noHref:q,noShade:q,noWrap:q,object:null,profile:null,prompt:null,rev:null,rightMargin:J,rules:null,scheme:null,scrolling:Za,standby:null,summary:null,text:null,topMargin:J,valueType:null,version:null,vAlign:null,vLink:null,vSpace:J,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:q,disablePictureInPicture:q,disableRemotePlayback:q,exportParts:eo,part:$a,prefix:null,property:null,results:J,security:null,unselectable:null},space:`html`,transform:co}),uo=ao({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:to,accentHeight:J,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:J,amplitude:J,arabicForm:null,ascent:J,attributeName:null,attributeType:null,azimuth:J,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:J,by:null,calcMode:null,capHeight:J,className:$a,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:J,diffuseConstant:J,direction:null,display:null,dur:null,divisor:J,dominantBaseline:null,download:q,dx:null,dy:null,edgeMode:null,editable:null,elevation:J,enableBackground:null,end:null,event:null,exponent:J,externalResourcesRequired:null,fill:null,fillOpacity:J,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:eo,g2:eo,glyphName:eo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:J,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:J,horizOriginX:J,horizOriginY:J,id:null,ideographic:J,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:J,k:J,k1:J,k2:J,k3:J,k4:J,kernelMatrix:to,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:J,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:J,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:J,overlineThickness:J,paintOrder:null,panose1:null,path:null,pathLength:J,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$a,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:J,pointsAtY:J,pointsAtZ:J,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:to,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:to,rev:to,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:to,requiredFeatures:to,requiredFonts:to,requiredFormats:to,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:J,specularExponent:J,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:J,strikethroughThickness:J,string:null,stroke:null,strokeDashArray:to,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:J,strokeOpacity:J,strokeWidth:null,style:null,surfaceScale:J,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:to,tabIndex:J,tableValues:null,target:null,targetX:J,targetY:J,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:to,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:J,underlineThickness:J,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:J,values:null,vAlphabetic:J,vMathematical:J,vectorEffect:null,vHanging:J,vIdeographic:J,version:null,vertAdvY:J,vertOriginX:J,vertOriginY:J,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:J,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:so}),fo=ao({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),po=ao({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:co}),mo=ao({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ho={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},go=/[A-Z]/g,_o=/-[a-z]/g,vo=/^data[-\w.:]+$/i;function yo(e,t){let n=qa(t),r=t,i=Ja;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&vo.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(_o,xo);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!_o.test(e)){let n=e.replace(go,bo);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Y}return new i(r,t)}function bo(e){return`-`+e.toLowerCase()}function xo(e){return e.charAt(1).toUpperCase()}var So=Ka([oo,lo,fo,po,mo],`html`),Co=Ka([oo,uo,fo,po,mo],`svg`);function wo(e){return e.join(` `).trim()}var To=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
11
|
+
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Eo=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(To());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),Do=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Oo=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Eo()),r=Do();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),ko=jo(`end`),Ao=jo(`start`);function jo(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Mo(e){let t=Ao(e),n=ko(e);if(t&&n)return{start:t,end:n}}function No(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Fo(e.position):`start`in e||`end`in e?Fo(e):`line`in e||`column`in e?Po(e):``}function Po(e){return Io(e&&e.line)+`:`+Io(e&&e.column)}function Fo(e){return Po(e&&e.start)+`-`+Po(e&&e.end)}function Io(e){return e&&typeof e==`number`?e:1}var Lo=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=No(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Lo.prototype.file=``,Lo.prototype.name=``,Lo.prototype.reason=``,Lo.prototype.message=``,Lo.prototype.stack=``,Lo.prototype.column=void 0,Lo.prototype.line=void 0,Lo.prototype.ancestors=void 0,Lo.prototype.cause=void 0,Lo.prototype.fatal=void 0,Lo.prototype.place=void 0,Lo.prototype.ruleId=void 0,Lo.prototype.source=void 0;var Ro=e(Oo(),1),zo={}.hasOwnProperty,Bo=new Map,Vo=/[A-Z]/g,Ho=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Uo=new Set([`td`,`th`]);function Wo(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=ts(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=es(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Co:So,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Go(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Go(e,t,n){if(t.type===`element`)return Ko(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return qo(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Yo(e,t,n);if(t.type===`mdxjsEsm`)return Jo(e,t);if(t.type===`root`)return Xo(e,t,n);if(t.type===`text`)return Zo(e,t)}function Ko(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Co,e.schema=i),e.ancestors.push(t);let a=ss(e,t.tagName,!1),o=ns(e,t),s=is(e,t);return Ho.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Ua(e)})),Qo(e,o,a,t),$o(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function qo(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}cs(e,t.position)}function Jo(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cs(e,t.position)}function Yo(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Co,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:ss(e,t.name,!0),o=rs(e,t),s=is(e,t);return Qo(e,o,a,t),$o(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Xo(e,t,n){let r={};return $o(r,is(e,t)),e.create(t,e.Fragment,r,n)}function Zo(e,t){return t.value}function Qo(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $o(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function es(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function ts(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Ao(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function ns(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&zo.call(t.properties,i)){let a=as(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Uo.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function rs(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else cs(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else cs(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function is(e,t){let n=[],r=-1,i=e.passKeys?new Map:Bo;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Go(e,a,o);s!==void 0&&n.push(s)}return n}function as(e,t,n){let r=yo(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?La(n):wo(n)),r.property===`style`){let t=typeof n==`object`?n:os(e,String(n));return e.stylePropertyNameCase===`css`&&(t=ls(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?ho[r.property]||r.property:r.attribute,n]}}function os(e,t){try{return(0,Ro.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Lo("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function ss(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Va(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Va(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return zo.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);cs(e)}function cs(e,t){let n=new Lo("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function ls(e){let t={},n;for(n in e)zo.call(e,n)&&(t[us(n)]=e[n]);return t}function us(e){let t=e.replace(Vo,ds);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function ds(e){return`-`+e.toLowerCase()}var fs={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},ps={};function ms(e,t){let n=t||ps;return hs(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function hs(e,t,n){if(_s(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return gs(e.children,t,n)}return Array.isArray(e)?gs(e,t,n):``}function gs(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=hs(e[i],t,n);return r.join(``)}function _s(e){return!!(e&&typeof e==`object`)}var vs=document.createElement(`i`);function ys(e){let t=`&`+e+`;`;vs.innerHTML=t;let n=vs.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function bs(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function xs(e,t){return e.length>0?(bs(e,e.length,0,t),e):t}var Ss={}.hasOwnProperty;function Cs(e){let t={},n=-1;for(;++n<e.length;)ws(t,e[n]);return t}function ws(e,t){let n;for(n in t){let r=(Ss.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Ss.call(r,a)||(r[a]=[]);let e=i[a];Ts(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Ts(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);bs(e,0,0,r)}function Es(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function Ds(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Os=Rs(/[A-Za-z]/),ks=Rs(/[\dA-Za-z]/),As=Rs(/[#-'*+\--9=?A-Z^-~]/);function js(e){return e!==null&&(e<32||e===127)}var Ms=Rs(/\d/),Ns=Rs(/[\dA-Fa-f]/),Ps=Rs(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function Fs(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}var Is=Rs(/\p{P}|\p{S}/u),Ls=Rs(/\s/);function Rs(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function zs(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&ks(e.charCodeAt(n+1))&&ks(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Bs(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Z(r)?(e.enter(n),s(r)):t(r)}function s(r){return Z(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Vs={tokenize:Hs};function Hs(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Bs(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return X(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Us={tokenize:Gs},Ws={tokenize:Ks};function Gs(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return bs(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ws,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Ws,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return X(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;bs(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Ks(e,t,n){return Bs(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function qs(e){if(e===null||Fs(e)||Ls(e))return 1;if(Is(e))return 2}function Js(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Ys={name:`attention`,resolveAll:Xs,tokenize:Zs};function Xs(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Qs(d,-c),Qs(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=xs(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=xs(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=xs(l,Js(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=xs(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=xs(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,bs(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Zs(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=qs(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=qs(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Qs(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var $s={name:`autolink`,tokenize:ec};function ec(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Os(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||ks(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||ks(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||js(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):As(t)?(e.consume(t),l):n(t)}function u(e){return ks(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||ks(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var tc={partial:!0,tokenize:nc};function nc(e,t,n){return r;function r(t){return Z(t)?Bs(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||X(e)?t(e):n(e)}}var rc={continuation:{tokenize:ac},exit:oc,name:`blockQuote`,tokenize:ic};function ic(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Z(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function ac(e,t,n){let r=this;return i;function i(t){return Z(t)?Bs(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(rc,t,n)(r)}}function oc(e){e.exit(`blockQuote`)}var sc={name:`characterEscape`,tokenize:cc};function cc(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Ps(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var lc={name:`characterReference`,tokenize:uc};function uc(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=ks,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Ns,u):(e.enter(`characterReferenceValue`),a=7,o=Ms,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===ks&&!ys(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var dc={partial:!0,tokenize:mc},fc={concrete:!0,name:`codeFenced`,tokenize:pc};function pc(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Z(t)?Bs(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||X(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(dc,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Bs(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||X(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Z(t)?Bs(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||X(t)?e.check(dc,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||X(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Z(t)?Bs(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Z(t)?Bs(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||X(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function mc(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var hc={name:`codeIndented`,tokenize:_c},gc={partial:!0,tokenize:vc};function _c(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Bs(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):X(t)?e.attempt(gc,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||X(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function vc(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Bs(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):X(e)?i(e):n(e)}}var yc={name:`codeText`,previous:xc,resolve:bc,tokenize:Sc};function bc(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function xc(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Sc(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||X(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Cc=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&wc(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),wc(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),wc(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);wc(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);wc(this.left,t.reverse())}}}};function wc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Tc(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Cc(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Ec(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return bs(e,0,1/0,u.slice(0)),!l}function Ec(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Dc={resolve:kc,tokenize:Ac},Oc={partial:!0,tokenize:jc};function kc(e){return Tc(e),e}function Ac(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):X(t)?e.check(Oc,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function jc(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Bs(e,a,`linePrefix`)}function a(i){if(i===null||X(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Mc(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||js(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||X(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Fs(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||js(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Nc(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):X(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||X(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Z(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Pc(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Bs(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||X(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Fc(e,t){let n;return r;function r(i){return X(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Z(i)?Bs(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Ic={name:`definition`,tokenize:Rc},Lc={partial:!0,tokenize:zc};function Rc(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Nc.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Ds(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Fs(t)?Fc(e,l)(t):l(t)}function l(t){return Mc(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Lc,d,d)(t)}function d(t){return Z(t)?Bs(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||X(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function zc(e,t,n){return r;function r(t){return Fs(t)?Fc(e,i)(t):n(t)}function i(t){return Pc(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Z(t)?Bs(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||X(e)?t(e):n(e)}}var Bc={name:`hardBreakEscape`,tokenize:Vc};function Vc(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return X(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Hc={name:`headingAtx`,resolve:Uc,tokenize:Wc};function Uc(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},bs(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Wc(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Fs(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||X(n)?(e.exit(`atxHeading`),t(n)):Z(n)?Bs(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Fs(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Gc=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Kc=[`pre`,`script`,`style`,`textarea`],qc={concrete:!0,name:`htmlFlow`,resolveTo:Xc,tokenize:Zc},Jc={partial:!0,tokenize:$c},Yc={partial:!0,tokenize:Qc};function Xc(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Zc(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:M):Os(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Os(a)?(e.consume(a),i=4,r.interrupt?t:M):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:M):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return Os(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Fs(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Kc.includes(l)?(i=1,r.interrupt?t(s):D(s)):Gc.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||ks(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return Z(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Os(t)?(e.consume(t),b):Z(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||ks(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Z(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Z(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||X(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Fs(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Z(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||X(t)?D(t):Z(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),k):t===60&&i===1?(e.consume(t),A):t===62&&i===4?(e.consume(t),ie):t===63&&i===3?(e.consume(t),M):t===93&&i===5?(e.consume(t),re):X(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Jc,N,O)(t)):t===null||X(t)?(e.exit(`htmlFlowData`),O(t)):(e.consume(t),D)}function O(t){return e.check(Yc,te,N)(t)}function te(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return t===null||X(t)?O(t):(e.enter(`htmlFlowData`),D(t))}function k(t){return t===45?(e.consume(t),M):D(t)}function A(t){return t===47?(e.consume(t),o=``,j):D(t)}function j(t){if(t===62){let n=o.toLowerCase();return Kc.includes(n)?(e.consume(t),ie):D(t)}return Os(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),j):D(t)}function re(t){return t===93?(e.consume(t),M):D(t)}function M(t){return t===62?(e.consume(t),ie):t===45&&i===2?(e.consume(t),M):D(t)}function ie(t){return t===null||X(t)?(e.exit(`htmlFlowData`),N(t)):(e.consume(t),ie)}function N(n){return e.exit(`htmlFlow`),t(n)}}function Qc(e,t,n){let r=this;return i;function i(t){return X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function $c(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(tc,t,n)}}var el={name:`htmlText`,tokenize:tl};function tl(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Os(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Os(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):X(t)?(o=d,A(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?k(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):X(t)?(o=h,A(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?k(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?k(t):X(t)?(o=v,A(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):X(t)?(o=y,A(t)):(e.consume(t),y)}function b(e){return e===62?k(e):y(e)}function x(t){return Os(t)?(e.consume(t),S):n(t)}function S(t){return t===45||ks(t)?(e.consume(t),S):C(t)}function C(t){return X(t)?(o=C,A(t)):Z(t)?(e.consume(t),C):k(t)}function w(t){return t===45||ks(t)?(e.consume(t),w):t===47||t===62||Fs(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),k):t===58||t===95||Os(t)?(e.consume(t),E):X(t)?(o=T,A(t)):Z(t)?(e.consume(t),T):k(t)}function E(t){return t===45||t===46||t===58||t===95||ks(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):X(t)?(o=ee,A(t)):Z(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,O):X(t)?(o=D,A(t)):Z(t)?(e.consume(t),D):(e.consume(t),te)}function O(t){return t===i?(e.consume(t),i=void 0,ne):t===null?n(t):X(t)?(o=O,A(t)):(e.consume(t),O)}function te(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Fs(t)?T(t):(e.consume(t),te)}function ne(e){return e===47||e===62||Fs(e)?T(e):n(e)}function k(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function A(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return Z(t)?Bs(e,re,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):re(t)}function re(t){return e.enter(`htmlTextData`),o(t)}}var nl={name:`labelEnd`,resolveAll:ol,resolveTo:sl,tokenize:cl},rl={tokenize:ll},il={tokenize:ul},al={tokenize:dl};function ol(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&bs(e,0,e.length,n),e}function sl(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=xs(s,e.slice(a+1,a+r+3)),s=xs(s,[[`enter`,u,t]]),s=xs(s,Js(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=xs(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=xs(s,e.slice(o+1)),s=xs(s,[[`exit`,c,t]]),bs(e,a,e.length,s),e}function cl(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Ds(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(rl,u,o?u:d)(t):t===91?e.attempt(il,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(al,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function ll(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Fs(t)?Fc(e,a)(t):a(t)}function a(t){return t===41?u(t):Mc(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Fs(t)?Fc(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Pc(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Fs(t)?Fc(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function ul(e,t,n){let r=this;return i;function i(t){return Nc.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Ds(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function dl(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var fl={name:`labelStartImage`,resolveAll:nl.resolveAll,tokenize:pl};function pl(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var ml={name:`labelStartLink`,resolveAll:nl.resolveAll,tokenize:hl};function hl(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var gl={name:`lineEnding`,tokenize:_l};function _l(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Bs(e,t,`linePrefix`)}}var vl={name:`thematicBreak`,tokenize:yl};function yl(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||X(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Z(t)?Bs(e,s,`whitespace`)(t):s(t))}}var bl={continuation:{tokenize:wl},exit:El,name:`list`,tokenize:Cl},xl={partial:!0,tokenize:Dl},Sl={partial:!0,tokenize:Tl};function Cl(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Ms(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(vl,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Ms(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(tc,r.interrupt?n:u,e.attempt(xl,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Z(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function wl(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(tc,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Bs(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Sl,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Bs(e,e.attempt(bl,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Tl(e,t,n){let r=this;return Bs(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function El(e){e.exit(this.containerState.type)}function Dl(e,t,n){let r=this;return Bs(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Ol={name:`setextUnderline`,resolveTo:kl,tokenize:Al};function kl(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Al(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Z(t)?Bs(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||X(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var jl={tokenize:Ml};function Ml(e){let t=this,n=e.attempt(tc,r,e.attempt(this.parser.constructs.flowInitial,i,Bs(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Dc,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Nl={resolveAll:Il()},Pl=Fl(`string`),Q=Fl(`text`);function Fl(e){return{resolveAll:Il(e===`text`?Ll:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Il(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Ll(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Rl=t({attentionMarkers:()=>Kl,contentInitial:()=>Bl,disable:()=>ql,document:()=>zl,flow:()=>Hl,flowInitial:()=>Vl,insideSpan:()=>Gl,string:()=>Ul,text:()=>Wl}),zl={42:bl,43:bl,45:bl,48:bl,49:bl,50:bl,51:bl,52:bl,53:bl,54:bl,55:bl,56:bl,57:bl,62:rc},Bl={91:Ic},Vl={[-2]:hc,[-1]:hc,32:hc},Hl={35:Hc,42:vl,45:[Ol,vl],60:qc,61:Ol,95:vl,96:fc,126:fc},Ul={38:lc,92:sc},Wl={[-5]:gl,[-4]:gl,[-3]:gl,33:fl,38:lc,42:Ys,60:[$s,el],91:ml,92:[Bc,sc],93:nl,95:Ys,96:yc},Gl={null:[Ys,Nl]},Kl={null:[42,95]},ql={null:[]};function Jl(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=xs(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Js(a,l.events,l),l.events):[]}function f(e,t){return Xl(p(e),t)}function p(e){return Yl(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){X(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&bs(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Yl(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Xl(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
12
|
+
`;break;case-3:o=`\r
|
|
13
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Zl(e){let t={constructs:Cs([Rl,...(e||{}).extensions||[]]),content:n(Vs),defined:[],document:n(Us),flow:n(jl),lazy:{},string:n(Pl),text:n(Q)};return t;function n(e){return n;function n(n){return Jl(t,e,n)}}}function Ql(e){for(;!Tc(e););return e}var $l=/[\0\t\n\r]/g;function eu(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if($l.lastIndex=u,c=$l.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var tu=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function nu(e){return e.replace(tu,ru)}function ru(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Es(n.slice(t?2:1),t?16:10)}return ys(n)||e}var iu={}.hasOwnProperty;function au(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),ou(n)(Ql(Zl(n).document().write(eu()(e,t,!0))))}function ou(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(xe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(_e),blockQuote:a(fe),characterEscape:T,characterReference:T,codeFenced:a(pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(pe,o),codeText:a(me,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(he),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ge),hardBreakEscape:a(ve),hardBreakTrailing:a(ve),htmlFlow:a(ye,o),htmlFlowData:T,htmlText:a(ye,o),htmlTextData:T,image:a(be),label:o,link:a(xe),listItem:a(Ce),listItemValue:f,listOrdered:a(Se,d),listUnordered:a(Se),paragraph:a(we),reference:ae,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(_e),strong:a(Te),thematicBreak:a(De)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ce,characterReference:le,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ne),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(O),htmlFlowData:E,htmlText:c(te),htmlTextData:E,image:c(A),label:re,labelText:j,lineEnding:ee,link:c(k),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:M,resourceTitleString:ie,resource:N,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};cu(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];iu.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||uu).call(a,void 0,e[0])}for(r.position={start:su(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:su(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:su(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||uu).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+No({start:e.start,end:e.end})+`): it’s not open`);n.position.end=su(e.end)}function u(){return ms(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ds(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ee(),n.position={start:su(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=su(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=su(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function D(){this.data.atHardBreak=!0}function O(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function k(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function A(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function j(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=nu(t),n.identifier=Ds(t).toLowerCase()}function re(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function N(){this.data.inReference=void 0}function ae(){this.data.referenceType=`collapsed`}function oe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ds(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function se(e){this.data.characterReferenceType=e.type}function ce(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Es(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=ys(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=su(e.end)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function fe(){return{type:`blockquote`,children:[]}}function pe(){return{type:`code`,lang:null,meta:null,value:``}}function me(){return{type:`inlineCode`,value:``}}function he(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ge(){return{type:`emphasis`,children:[]}}function _e(){return{type:`heading`,depth:0,children:[]}}function ve(){return{type:`break`}}function ye(){return{type:`html`,value:``}}function be(){return{type:`image`,title:null,url:``,alt:null}}function xe(){return{type:`link`,title:null,url:``,children:[]}}function Se(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Ce(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function we(){return{type:`paragraph`,children:[]}}function Te(){return{type:`strong`,children:[]}}function Ee(){return{type:`text`,value:``}}function De(){return{type:`thematicBreak`}}}function su(e){return{line:e.line,column:e.column,offset:e.offset}}function cu(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?cu(e,r):lu(e,r)}}function lu(e,t){let n;for(n in t)if(iu.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function uu(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+No({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+No({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+No({start:t.start,end:t.end})+`) is still open`)}function du(e){let t=this;t.parser=n;function n(n){return au(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function fu(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function pu(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
14
|
+
`}]}function mu(e,t){let n=t.value?t.value+`
|
|
15
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function hu(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gu(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _u(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=zs(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function vu(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yu(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function bu(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function xu(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bu(e,t);let i={src:zs(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Su(e,t){let n={src:zs(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Cu(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function wu(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bu(e,t);let i={href:zs(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Tu(e,t){let n={href:zs(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Eu(e,t,n){let r=e.all(t),i=n?Du(n):Ou(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
16
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
17
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Du(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Ou(n[r])}return t}function Ou(e){return e.spread??e.children.length>1}function ku(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Au(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ju(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Mu(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nu(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Ao(t.children[1]),o=ko(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Pu(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Fu(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Iu=9,Lu=32;function Ru(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(zu(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(zu(t.slice(i),i>0,!1)),a.join(``)}function zu(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Iu||t===Lu;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Iu||t===Lu;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Bu(e,t){let n={type:`text`,value:Ru(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Vu(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Hu={blockquote:fu,break:pu,code:mu,delete:hu,emphasis:gu,footnoteReference:_u,heading:vu,html:yu,imageReference:xu,image:Su,inlineCode:Cu,linkReference:wu,link:Tu,listItem:Eu,list:ku,paragraph:Au,root:ju,strong:Mu,table:Nu,tableCell:Fu,tableRow:Pu,text:Bu,thematicBreak:Vu,toml:Uu,yaml:Uu,definition:Uu,footnoteDefinition:Uu};function Uu(){}var Wu=typeof self==`object`?self:globalThis,Gu=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Wu[e](t)},Ku=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Wu[e]==`function`?Gu(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(Gu(a,o),i)};return r},qu=e=>Ku(new Map,e)(0),Ju=``,{toString:Yu}={},{keys:Xu}=Object,Zu=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Yu.call(e).slice(8,-1);switch(n){case`Array`:return[1,Ju];case`Object`:return[2,Ju];case`Date`:return[3,Ju];case`RegExp`:return[4,Ju];case`Map`:return[5,Ju];case`Set`:return[6,Ju];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Qu=([e,t])=>e===0&&(t===`function`||t===`symbol`),$u=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Zu(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Xu(r))(e||!Qu(Zu(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?Ju:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Qu(Zu(n))||Qu(Zu(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Qu(Zu(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},ed=(e,{json:t,lossy:n}={})=>{let r=[];return $u(!(t||n),!!t,new Map,r)(e),r},td=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?qu(ed(e,t)):structuredClone(e):(e,t)=>qu(ed(e,t));function nd(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function rd(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function id(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||nd,r=e.options.footnoteBackLabel||rd,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=zs(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...td(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
18
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
19
|
+
`}]}}var ad=(function(e){if(e==null)return ud;if(typeof e==`function`)return ld(e);if(typeof e==`object`)return Array.isArray(e)?od(e):sd(e);if(typeof e==`string`)return cd(e);throw Error(`Expected function, string, or object as test`)});function od(e){let t=[],n=-1;for(;++n<e.length;)t[n]=ad(e[n]);return ld(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function sd(e){let t=e;return ld(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function cd(e){return ld(t);function t(t){return t&&t.type===e}}function ld(e){return t;function t(t,n,r){return!!(dd(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function ud(){return!0}function dd(e){return typeof e==`object`&&!!e&&`type`in e}function fd(e){return e}var pd=[];function md(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=ad(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+fd(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=pd,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=hd(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function hd(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?pd:[e]}function gd(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),md(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var _d={}.hasOwnProperty,vd={};function $(e,t){let n=t||vd,r=new Map,i=new Map,a={all:s,applyData:bd,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Hu,...n.handlers},one:o,options:n,patch:yd,wrap:Sd};return gd(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(_d.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=td(n);return r.children=a.all(e),r}return td(e)}return(a.options.unknownHandler||xd)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Cd(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Cd(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function yd(e,t){e.position&&(t.position=Mo(e))}function bd(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,td(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function xd(e,t){let n=t.data||{},r=`value`in t&&!(_d.call(n,`hProperties`)||_d.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Sd(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
20
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
21
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
22
|
+
`}),n}function Cd(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function wd(e,t){let n=$(e,t),r=n.one(e,void 0),i=id(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
23
|
+
`},i)),a}function Td(e,t){return e&&`run`in e?async function(n,r){let i=wd(n,{file:r,...t});await e.run(i,r)}:function(n,r){return wd(n,{file:r,...e||t})}}function Ed(e){if(e)throw e}var Dd=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Od(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function kd(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Ad(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Ad(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var jd={basename:Md,dirname:Nd,extname:Pd,join:Fd,sep:`/`};function Md(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Rd(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Nd(e){if(Rd(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Pd(e){Rd(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Fd(...e){let t=-1,n;for(;++t<e.length;)Rd(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Id(n)}function Id(e){Rd(e);let t=e.codePointAt(0)===47,n=Ld(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Ld(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Rd(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var zd={cwd:Bd};function Bd(){return`/`}function Vd(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Hd(e){if(typeof e==`string`)e=new URL(e);else if(!Vd(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Ud(e)}function Ud(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Wd=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Gd=class{constructor(e){let t;t=e?Vd(e)?{path:e}:typeof e==`string`||Yd(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:zd.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Wd.length;){let e=Wd[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Wd.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?jd.basename(this.path):void 0}set basename(e){qd(e,`basename`),Kd(e,`basename`),this.path=jd.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?jd.dirname(this.path):void 0}set dirname(e){Jd(this.basename,`dirname`),this.path=jd.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?jd.extname(this.path):void 0}set extname(e){if(Kd(e,`extname`),Jd(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=jd.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Vd(e)&&(e=Hd(e)),qd(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?jd.basename(this.path,this.extname):void 0}set stem(e){qd(e,`stem`),Kd(e,`stem`),this.path=jd.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Lo(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Kd(e,t){if(e&&e.includes(jd.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+jd.sep+"`")}function qd(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Jd(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Yd(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Xd=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Zd=e(Dd(),1),Qd={}.hasOwnProperty,$d=new class e extends Xd{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=kd()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Zd.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(nf(`data`,this.frozen),this.namespace[e]=t,this):Qd.call(this.namespace,e)&&this.namespace[e]||void 0:e?(nf(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=of(e),n=this.parser||this.Parser;return ef(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),ef(`process`,this.parser||this.Parser),tf(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=of(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);cf(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),ef(`processSync`,this.parser||this.Parser),tf(`processSync`,this.compiler||this.Compiler),this.process(e,r),af(`processSync`,`process`,t),n;function r(e,r){t=!0,Ed(e),n=r}}run(e,t,n){rf(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=of(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),af(`runSync`,`run`,n),r;function i(e,t){Ed(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=of(t),r=this.compiler||this.Compiler;return tf(`stringify`,r),rf(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(nf(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Zd.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Od(o)&&Od(r)&&(r=(0,Zd.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function ef(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function tf(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function nf(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function rf(e){if(!Od(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function af(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function of(e){return sf(e)?e:new Gd(e)}function sf(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function cf(e){return typeof e==`string`||lf(e)}function lf(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var uf=[],df={allowDangerousHtml:!0},ff=/^(https?|ircs?|mailto|xmpp)$/i,pf=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function mf(e){let t=hf(e),n=gf(e);return _f(t.runSync(t.parse(n),n),e)}function hf(e){let t=e.rehypePlugins||uf,n=e.remarkPlugins||uf,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...df}:df;return $d().use(du).use(n).use(Td,r).use(t)}function gf(e){let t=e.children||``,n=new Gd;return typeof t==`string`?n.value=t:``+t,n}function _f(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||vf;for(let e of pf)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return gd(e,l),Wo(e,{Fragment:F.Fragment,components:i,ignoreInvalidStyle:!0,jsx:F.jsx,jsxs:F.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in fs)if(Object.hasOwn(fs,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=fs[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function vf(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||ff.test(e.slice(0,t))?e:``}function yf(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function bf(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function xf(e,t,n){let r=ad((n||{}).ignore||[]),i=Sf(t),a=-1;for(;++a<i.length;)md(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Sf(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Cf(e[0]),wf(e[1])])}return t}function Cf(e){return typeof e==`string`?new RegExp(bf(e),`g`):e}function wf(e){return typeof e==`function`?e:function(){return e}}var Tf=`phrasing`,Ef=[`autolink`,`link`,`image`,`label`];function Df(){return{transforms:[Ff],enter:{literalAutolink:kf,literalAutolinkEmail:Af,literalAutolinkHttp:Af,literalAutolinkWww:Af},exit:{literalAutolink:Pf,literalAutolinkEmail:Nf,literalAutolinkHttp:jf,literalAutolinkWww:Mf}}}function Of(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Tf,notInConstruct:Ef},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Tf,notInConstruct:Ef},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Tf,notInConstruct:Ef}]}}function kf(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Af(e){this.config.enter.autolinkProtocol.call(this,e)}function jf(e){this.config.exit.autolinkProtocol.call(this,e)}function Mf(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Nf(e){this.config.exit.autolinkEmail.call(this,e)}function Pf(e){this.exit(e)}function Ff(e){xf(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,If],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Lf]],{ignore:[`link`,`linkReference`]})}function If(e,t,n,r,i){let a=``;if(!Bf(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Rf(n)))return!1;let o=zf(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Lf(e,t,n,r){return!Bf(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Rf(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function zf(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=yf(e,`(`),a=yf(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Bf(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Ls(n)||Is(n))&&(!t||n!==47)}Xf.peek=Yf;function Vf(){this.buffer()}function Hf(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Uf(){this.buffer()}function Wf(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Gf(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ds(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Kf(e){this.exit(e)}function qf(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ds(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Jf(e){this.exit(e)}function Yf(){return`[`}function Xf(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Zf(){return{enter:{gfmFootnoteCallString:Vf,gfmFootnoteCall:Hf,gfmFootnoteDefinitionLabelString:Uf,gfmFootnoteDefinition:Wf},exit:{gfmFootnoteCallString:Gf,gfmFootnoteCall:Kf,gfmFootnoteDefinitionLabelString:qf,gfmFootnoteDefinition:Jf}}}function Qf(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Xf},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
24
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?ep:$f))),s(),o}}function $f(e,t,n){return t===0?e:ep(e,t,n)}function ep(e,t,n){return(n?``:` `)+e}var tp=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];op.peek=sp;function np(){return{canContainEols:[`delete`],enter:{strikethrough:ip},exit:{strikethrough:ap}}}function rp(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:tp}],handlers:{delete:op}}}function ip(e){this.enter({type:`delete`,children:[]},e)}function ap(e){this.exit(e)}function op(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function sp(){return`~`}function cp(e){return e.length}function lp(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||cp,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=up(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=dp(r[d]);else{let e=dp(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
25
|
+
`)}function up(e){return e==null?``:String(e)}function dp(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function fp(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),pp);return i(),o}function pp(e,t,n){return`>`+(n?``:` `)+e}function mp(e,t){return hp(e,t.inConstruct,!0)&&!hp(e,t.notInConstruct,!1)}function hp(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function gp(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
26
|
+
`&&mp(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
27
|
+
`}function _p(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function vp(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function yp(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function bp(e,t,n,r){let i=yp(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(vp(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,xp);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(_p(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
28
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
29
|
+
`),a&&(u+=s.move(a+`
|
|
30
|
+
`)),u+=s.move(c),l(),u}function xp(e,t,n){return(n?``:` `)+e}function Sp(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Cp(e,t,n,r){let i=Sp(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
31
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function wp(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Tp(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Ep(e,t,n){let r=qs(e),i=qs(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Dp.peek=Op;function Dp(e,t,n,r){let i=wp(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Ep(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Tp(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Ep(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Tp(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Op(e,t,n){return n.options.emphasis||`*`}function kp(e,t){let n=!1;return gd(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&ms(e)&&(t.options.setext||n))}function Ap(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(kp(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
32
|
+
`,after:`
|
|
33
|
+
`});return r(),t(),o+`
|
|
34
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
35
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
36
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=Tp(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}jp.peek=Mp;function jp(e){return e.value||``}function Mp(){return`<`}Np.peek=Pp;function Np(e,t,n,r){let i=Sp(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Pp(){return`!`}Fp.peek=Ip;function Fp(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ip(){return`!`}Lp.peek=Rp;function Lp(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Rp(){return"`"}function zp(e,t){let n=ms(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Bp.peek=Vp;function Bp(e,t,n,r){let i=Sp(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(zp(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Vp(e,t,n){return zp(e,n)?`<`:`[`}Hp.peek=Up;function Hp(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Up(){return`[`}function Wp(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Gp(e){let t=Wp(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Kp(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function qp(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Jp(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Kp(n):Wp(n),s=e.ordered?o===`.`?`)`:`.`:Gp(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),qp(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Yp(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Xp(e,t,n,r){let i=Yp(n),a=n.bulletCurrent||Wp(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Zp(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Qp=ad([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function $p(e,t,n,r){return(e.children.some(function(e){return Qp(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function em(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}tm.peek=nm;function tm(e,t,n,r){let i=em(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Ep(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Tp(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Ep(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Tp(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function nm(e,t,n){return n.options.strong||`*`}function rm(e,t,n,r){return n.safe(e.value,r)}function im(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function am(e,t,n){let r=(qp(n)+(n.options.ruleSpaces?` `:``)).repeat(im(n));return n.options.ruleSpaces?r.slice(0,-1):r}var om={blockquote:fp,break:gp,code:bp,definition:Cp,emphasis:Dp,hardBreak:gp,heading:Ap,html:jp,image:Np,imageReference:Fp,inlineCode:Lp,link:Bp,linkReference:Hp,list:Jp,listItem:Xp,paragraph:Zp,root:$p,strong:tm,text:rm,thematicBreak:am};function sm(){return{enter:{table:cm,tableData:fm,tableHeader:fm,tableRow:um},exit:{codeText:pm,table:lm,tableData:dm,tableHeader:dm,tableRow:dm}}}function cm(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function lm(e){this.exit(e),this.data.inTable=void 0}function um(e){this.enter({type:`tableRow`,children:[]},e)}function dm(e){this.exit(e)}function fm(e){this.enter({type:`tableCell`,children:[]},e)}function pm(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,mm));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function mm(e,t){return t===`|`?t:e}function hm(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
37
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
38
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return lp(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=om.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function gm(){return{exit:{taskListCheckValueChecked:vm,taskListCheckValueUnchecked:vm,paragraph:ym}}}function _m(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:bm}}}function vm(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function ym(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function bm(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=om.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function xm(){return[Df(),Zf(),np(),sm(),gm()]}function Sm(e){return{extensions:[Of(),Qf(e),rp(),hm(e),_m()]}}var Cm={tokenize:Lm,partial:!0},wm={tokenize:Rm,partial:!0},Tm={tokenize:zm,partial:!0},Em={tokenize:Bm,partial:!0},Dm={tokenize:Vm,partial:!0},Om={name:`wwwAutolink`,tokenize:Fm,previous:Hm},km={name:`protocolAutolink`,tokenize:Im,previous:Um},Am={name:`emailAutolink`,tokenize:Pm,previous:Wm},jm={};function Mm(){return{text:jm}}for(var Nm=48;Nm<123;)jm[Nm]=Am,Nm++,Nm===58?Nm=65:Nm===91&&(Nm=97);jm[43]=Am,jm[45]=Am,jm[46]=Am,jm[95]=Am,jm[72]=[Am,km],jm[104]=[Am,km],jm[87]=[Am,Om],jm[119]=[Am,Om];function Pm(e,t,n){let r=this,i,a;return o;function o(t){return!Gm(t)||!Wm.call(r,r.previous)||Km(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Gm(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Dm,u,l)(t):t===45||t===95||ks(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Os(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Fm(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Hm.call(r,r.previous)||Km(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Cm,e.attempt(wm,e.attempt(Tm,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Im(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Um.call(r,r.previous)&&!Km(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Os(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||js(t)||Fs(t)||Ls(t)||Is(t)?n(t):e.attempt(wm,e.attempt(Tm,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Lm(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Rm(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Em,c,s)(t):t===null||Fs(t)||Ls(t)||t!==45&&Is(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function zm(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Em,t,a)(o):o===null||Fs(o)||Ls(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Bm(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Fs(o)||Ls(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Fs(e)||Ls(e)?t(e):r(e)}function a(e){return Os(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Os(t)?(e.consume(t),o):n(t)}}function Vm(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return ks(e)?n(e):t(e)}}function Hm(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Fs(e)}function Um(e){return!Os(e)}function Wm(e){return!(e===47||Gm(e))}function Gm(e){return e===43||e===45||e===46||e===95||ks(e)}function Km(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var qm={tokenize:th,partial:!0};function Jm(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Qm,continuation:{tokenize:$m},exit:eh}},text:{91:{name:`gfmFootnoteCall`,tokenize:Zm},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Ym,resolveTo:Xm}}}}function Ym(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Ds(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Xm(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Zm(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Fs(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Ds(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Fs(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Qm(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Fs(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Ds(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Fs(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Bs(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function $m(e,t,n){return e.check(tc,t,e.attempt(qm,t,n))}function eh(e){e.exit(`gfmFootnoteDefinition`)}function th(e,t,n){let r=this;return Bs(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function nh(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&bs(o,o.length,0,Js(s,e.slice(r+1,n),t)),bs(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),bs(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=qs(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=qs(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var rh=class{constructor(){this.map=[]}add(e,t,n){ih(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function ih(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function ah(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function oh(){return{flow:{null:{name:`table`,tokenize:sh,resolveAll:ch}}}}function sh(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):X(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Z(t)?Bs(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Fs(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Z(t)?Bs(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Z(t)?Bs(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||X(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Z(t)?Bs(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||X(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||X(n)?(e.exit(`tableRow`),t(n)):Z(n)?Bs(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Fs(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function ch(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new rh;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(uh(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=lh(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=lh(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=lh(f,t,o,i,n,d)):(o[0]=o[1],d=lh(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&uh(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=ah(t.events,n))}return e}function lh(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},dh(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=dh(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=dh(t.events,n[2]),a=dh(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},dh(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function uh(e,t,n,r,i){let a=[],o=dh(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function dh(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var fh={name:`tasklistCheck`,tokenize:mh};function ph(){return{text:{91:fh}}}function mh(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Fs(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return X(r)?t(r):Z(r)?e.check({tokenize:hh},t,n)(r):n(r)}}function hh(e,t,n){return Bs(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function gh(e){return Cs([Mm(),Jm(),nh(e),oh(),ph()])}var _h={};function vh(e){let t=this,n=e||_h,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(gh(n)),a.push(xm()),o.push(Sm(n))}var yh={p:({node:e,...t})=>(0,F.jsx)(`p`,{className:`mb-2 leading-relaxed last:mb-0`,...t}),h1:({node:e,...t})=>(0,F.jsx)(`h3`,{className:`mb-1 mt-1.5 text-[13px] font-semibold first:mt-0`,...t}),h2:({node:e,...t})=>(0,F.jsx)(`h3`,{className:`mb-1 mt-1.5 text-[13px] font-semibold first:mt-0`,...t}),h3:({node:e,...t})=>(0,F.jsx)(`h4`,{className:`mb-1 mt-1.5 text-[13px] font-semibold first:mt-0`,...t}),ul:({node:e,...t})=>(0,F.jsx)(`ul`,{className:`mb-2 list-disc space-y-0.5 pl-4 last:mb-0`,...t}),ol:({node:e,...t})=>(0,F.jsx)(`ol`,{className:`mb-2 list-decimal space-y-0.5 pl-4 last:mb-0`,...t}),li:({node:e,...t})=>(0,F.jsx)(`li`,{className:`leading-relaxed`,...t}),a:({node:e,...t})=>(0,F.jsx)(`a`,{className:`text-primary underline underline-offset-2`,target:`_blank`,rel:`noreferrer`,...t}),strong:({node:e,...t})=>(0,F.jsx)(`strong`,{className:`font-semibold text-foreground`,...t}),em:({node:e,...t})=>(0,F.jsx)(`em`,{className:`italic`,...t}),code:({node:e,...t})=>(0,F.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[11.5px]`,...t}),pre:({node:e,...t})=>(0,F.jsx)(`pre`,{className:`mb-2 max-w-full overflow-x-auto rounded-md bg-muted/70 p-2.5 text-[11.5px] leading-relaxed last:mb-0 [&>code]:bg-transparent [&>code]:p-0`,...t}),blockquote:({node:e,...t})=>(0,F.jsx)(`blockquote`,{className:`mb-2 border-l-2 border-border pl-3 text-muted-foreground last:mb-0`,...t}),hr:({node:e,...t})=>(0,F.jsx)(`hr`,{className:`my-2 border-border`,...t}),table:({node:e,...t})=>(0,F.jsx)(`table`,{className:`mb-2 w-full table-fixed border-collapse text-[12px] last:mb-0`,...t}),th:({node:e,...t})=>(0,F.jsx)(`th`,{className:`border border-border px-2 py-1 text-left font-semibold [overflow-wrap:anywhere]`,...t}),td:({node:e,...t})=>(0,F.jsx)(`td`,{className:`border border-border px-2 py-1 align-top [overflow-wrap:anywhere]`,...t})};function bh({text:e,className:t}){return(0,F.jsx)(`div`,{className:K(`min-w-0 text-[13px] text-foreground/90 [overflow-wrap:anywhere]`,t),children:(0,F.jsx)(mf,{remarkPlugins:[vh],components:yh,children:e})})}var xh=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Sh=fi,Ch=(e,t)=>n=>{if(t?.variants==null)return Sh(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=xh(t)||xh(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Sh(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},wh=Ch(`inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium transition-colors whitespace-nowrap`,{variants:{variant:{default:`border-transparent bg-primary/15 text-primary`,secondary:`border-transparent bg-secondary text-secondary-foreground`,outline:`text-foreground`,muted:`border-transparent bg-muted text-muted-foreground`,success:`border-transparent bg-success/15 text-success`,warning:`border-transparent bg-warning/15 text-warning`,destructive:`border-transparent bg-destructive/15 text-destructive`}},defaultVariants:{variant:`default`}});function Th({className:e,variant:t,...n}){return(0,F.jsx)(`span`,{className:K(wh({variant:t}),e),...n})}var Eh=Object.defineProperty,Dh=(e,t)=>Eh(e,`name`,{value:t,configurable:!0});function Oh(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Dh(Oh,`setRef`);function kh(...e){return t=>{let n=!1,r=e.map(e=>{let r=Oh(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Oh(e[t],null)}}}}Dh(kh,`composeRefs`);function Ah(...e){return P.useCallback(kh(...e),e)}Dh(Ah,`useComposedRefs`);var jh=Object.defineProperty,Mh=(e,t)=>jh(e,`name`,{value:t,configurable:!0});function Nh(e){let t=P.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Hh(r)&&typeof Kh==`function`&&(r=Kh(r._payload)),P.Children.forEach(r,e=>{if(Bh(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Hh(n)&&typeof Kh==`function`&&(n=Kh(n._payload)),a=Lh(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=P.cloneElement(a,void 0,s):!o&&P.Children.count(r)===1&&P.isValidElement(r)&&(a=r);let c=a?zh(a):void 0,l=Ah(n,c);if(!a){if(r||r===0)throw Error(o?Gh(e):Wh(e));return r}let u=Rh(i,a.props??{});return a.type!==P.Fragment&&(u.ref=n?l:c),P.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Mh(Nh,`createSlot`);var Ph=Nh(`Slot`),Fh=Symbol.for(`radix.slottable`);function Ih(e){let t=Mh(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Fh,t}Mh(Ih,`createSlottable`);var Lh=Mh((e,t)=>{if(`child`in e.props){let t=e.props.child;return P.isValidElement(t)?P.cloneElement(t,void 0,e.props.children(t.props.children)):null}return P.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Rh(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}Mh(Rh,`mergeProps`);function zh(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Mh(zh,`getElementRef`);function Bh(e){return P.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Fh}Mh(Bh,`isSlottable`);var Vh=Symbol.for(`react.lazy`);function Hh(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Vh&&`_payload`in e&&Uh(e._payload)}Mh(Hh,`isLazyComponent`);function Uh(e){return typeof e==`object`&&!!e&&`then`in e}Mh(Uh,`isPromiseLike`);var Wh=Mh(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Gh=Mh(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Kh=P.use,qh=Ch(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,outline:`border border-input bg-transparent hover:bg-accent hover:text-accent-foreground`,ghost:`hover:bg-accent hover:text-accent-foreground`,destructive:`bg-destructive text-white hover:bg-destructive/90`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-6`,icon:`h-9 w-9`,xs:`h-7 rounded px-2 text-xs`}},defaultVariants:{variant:`default`,size:`default`}}),Jh=P.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,F.jsx)(r?Ph:`button`,{className:K(qh({variant:t,size:n,className:e})),ref:a,...i}));Jh.displayName=`Button`;var Yh=Object.defineProperty,Xh=(e,t)=>Yh(e,`name`,{value:t,configurable:!0}),Zh=!!(typeof window<`u`&&window.document&&window.document.createElement);function Qh(e,t,{checkForDefaultPrevented:n=!0}={}){return Xh(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Xh(Qh,`composeEventHandlers`);function $h(e){if(!Zh)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Xh($h,`getOwnerWindow`);function eg(e){if(!Zh)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Xh(eg,`getOwnerDocument`);function tg(e,t=!1){let{activeElement:n}=eg(e);if(!n?.nodeName)return null;if(ng(n)&&n.contentDocument)return tg(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=eg(n).getElementById(e);if(t)return t}}return n}Xh(tg,`getActiveElement`);function ng(e){return e.tagName===`IFRAME`}Xh(ng,`isFrame`);var rg=Object.defineProperty,ig=(e,t)=>rg(e,`name`,{value:t,configurable:!0});function ag(e,t){let n=P.createContext(t);n.displayName=e+`Context`;let r=ig(e=>{let{children:t,...r}=e,i=P.useMemo(()=>r,Object.values(r));return(0,F.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=P.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return ig(i,`useContext`),[r,i]}ig(ag,`createContext`);function og(e,t=[]){let n=[];function r(t,r){let i=P.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=ig(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=P.useMemo(()=>o,Object.values(o));return(0,F.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=P.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return ig(s,`useContext`),[o,s]}ig(r,`createContext`);let i=ig(()=>{let t=n.map(e=>P.createContext(e));return ig(function(n){let r=n?.[e]||t;return P.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,sg(i,...t)]}ig(og,`createContextScope`);function sg(...e){let t=e[0];if(e.length===1)return t;let n=ig(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return ig(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return P.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}ig(sg,`composeContextScopes`);var cg=globalThis?.document?P.useLayoutEffect:()=>{},lg=Object.defineProperty,ug=(e,t)=>lg(e,`name`,{value:t,configurable:!0}),dg=P.useId||(()=>void 0),fg=0;function pg(e){let[t,n]=P.useState(dg());return cg(()=>{e||n(e=>e??String(fg++))},[e]),e||(t?`radix-${t}`:``)}ug(pg,`useId`);var mg=Object.defineProperty,hg=(e,t)=>mg(e,`name`,{value:t,configurable:!0}),gg=P.useEffectEvent,_g=P.useInsertionEffect;function vg(e){if(typeof gg==`function`)return gg(e);let t=P.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof _g==`function`?_g(()=>{t.current=e}):cg(()=>{t.current=e}),P.useMemo(()=>((...e)=>t.current?.(...e)),[])}hg(vg,`useEffectEvent`);var yg=Object.defineProperty,bg=(e,t)=>yg(e,`name`,{value:t,configurable:!0}),xg=P.useInsertionEffect||cg;function Sg({prop:e,defaultProp:t,onChange:n=bg(()=>{},`onChange`),caller:r}){let[i,a,o]=Cg({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,P.useCallback(t=>{if(s){let n=wg(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}bg(Sg,`useControllableState`);function Cg({defaultProp:e,onChange:t}){let[n,r]=P.useState(e),i=P.useRef(n),a=P.useRef(t);return xg(()=>{a.current=t},[t]),P.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}bg(Cg,`useUncontrolledState`);function wg(e){return typeof e==`function`}bg(wg,`isFunction`);var Tg=Symbol(`RADIX:SYNC_STATE`);function Eg(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=vg(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=P.useReducer((t,n)=>{if(n.type===Tg)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=P.useRef(p);P.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=P.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return P.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Tg,state:i})},[i,d.state,c]),[h,f]}bg(Eg,`useControllableStateReducer`);var Dg=Object.defineProperty,Og=(e,t)=>Dg(e,`name`,{value:t,configurable:!0}),kg=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Nh(`Primitive.${t}`),r=P.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,F.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ag(e,t){e&&ot.flushSync(()=>e.dispatchEvent(t))}Og(Ag,`dispatchDiscreteCustomEvent`);var jg=Object.defineProperty,Mg=(e,t)=>jg(e,`name`,{value:t,configurable:!0});function Ng(e){let t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useMemo(()=>((...e)=>t.current?.(...e)),[])}Mg(Ng,`useCallbackRef`);var Pg=Object.defineProperty,Fg=(e,t)=>Pg(e,`name`,{value:t,configurable:!0}),Ig=`dismissableLayer.update`,Lg=`dismissableLayer.pointerDownOutside`,Rg=`dismissableLayer.focusOutside`,zg,Bg=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Vg=P.forwardRef(Fg(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=P.useContext(Bg),[d,f]=P.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=P.useState({}),h=Ah(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=P.useRef(!1),C=Wg(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:P.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=Gg(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=Ng(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return P.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),P.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(zg=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Kg(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=zg))}},[d,p,n,u]),P.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Kg())},[d,u]),P.useEffect(()=>{let e=Fg(()=>m({}),`handleUpdate`);return document.addEventListener(Ig,e),()=>document.removeEventListener(Ig,e)},[]),(0,F.jsx)(kg.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:Qh(e.onFocusCapture,w.onFocusCapture),onBlurCapture:Qh(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Qh(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function Hg(){let e=P.useContext(Bg),[t,n]=P.useState(null);return P.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Fg(Hg,`useDismissableLayerSurface`);var Ug=Fg(()=>!0,`IS_TRUE`);function Wg(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Ug}=t,s=Ng(e),c=P.useRef(!1),l=P.useRef(!1),u=P.useRef(new Map),d=P.useRef(()=>{});return P.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Fg(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Fg(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Fg(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Fg(p,`handleInteractionBubble`);let m=Fg(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||qg(Lg,s,p,{discrete:!0})};if(Fg(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Fg(()=>c.current=!0,`onPointerDownCapture`)}}Fg(Wg,`usePointerDownOutside`);function Gg(e,t=globalThis?.document){let n=Ng(e),r=P.useRef(!1);return P.useEffect(()=>{let e=Fg(e=>{e.target&&!r.current&&qg(Rg,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Fg(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Fg(()=>r.current=!1,`onBlurCapture`)}}Fg(Gg,`useFocusOutside`);function Kg(){let e=new CustomEvent(Ig);document.dispatchEvent(e)}Fg(Kg,`dispatchUpdate`);function qg(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ag(i,a):i.dispatchEvent(a)}Fg(qg,`handleAndDispatchCustomEvent`);var Jg=Object.defineProperty,Yg=(e,t)=>Jg(e,`name`,{value:t,configurable:!0}),Xg=`focusScope.autoFocusOnMount`,Zg=`focusScope.autoFocusOnUnmount`,Qg={bubbles:!1,cancelable:!0},$g=P.forwardRef(Yg(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=P.useState(null),l=Ng(i),u=Ng(a),d=P.useRef(null),f=Ah(t,c),p=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:o_(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||o_(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&o_(s)};Yg(e,`handleFocusIn`),Yg(t,`handleFocusOut`),Yg(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),P.useEffect(()=>{if(s){s_.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Xg,Qg);s.addEventListener(Xg,l),s.dispatchEvent(t),t.defaultPrevented||(e_(u_(n_(s)),{select:!0}),document.activeElement===e&&o_(s))}return()=>{s.removeEventListener(Xg,l),setTimeout(()=>{let t=new CustomEvent(Zg,Qg);s.addEventListener(Zg,u),s.dispatchEvent(t),t.defaultPrevented||o_(e??document.body,{select:!0}),s.removeEventListener(Zg,u),s_.remove(p)},0)}}},[s,l,u,p]);let m=P.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=t_(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&o_(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&o_(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,F.jsx)(kg.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function e_(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(o_(r,{select:t}),document.activeElement!==n)return}Yg(e_,`focusFirst`);function t_(e){let t=n_(e);return[r_(t,e),r_(t.reverse(),e)]}Yg(t_,`getTabbableEdges`);function n_(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Yg(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Yg(n_,`getTabbableCandidates`);function r_(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):i_(r,{upTo:t})))return r}Yg(r_,`findVisible`);function i_(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Yg(i_,`isHidden`);function a_(e){return e instanceof HTMLInputElement&&`select`in e}Yg(a_,`isSelectableInput`);function o_(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&a_(e)&&t&&e.select()}}Yg(o_,`focus`);var s_=c_();function c_(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=l_(e,t),e.unshift(t)},remove(t){e=l_(e,t),e[0]?.resume()}}}Yg(c_,`createFocusScopesStack`);function l_(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Yg(l_,`arrayRemove`);function u_(e){return e.filter(e=>e.tagName!==`A`)}Yg(u_,`removeLinks`);var d_=Object.defineProperty,f_=P.forwardRef(((e,t)=>d_(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=P.useState(!1);cg(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?ot.createPortal((0,F.jsx)(kg.div,{...r,ref:t}),o):null},`Portal`)),p_=Object.defineProperty,m_=(e,t)=>p_(e,`name`,{value:t,configurable:!0});function h_(e,t){return P.useReducer((e,n)=>t[e][n]??e,e)}m_(h_,`useStateMachine`);var g_=m_(e=>{let{present:t,children:n}=e,r=__(t),i=typeof n==`function`?n({present:r.isPresent}):P.Children.only(n),a=y_(r.ref,x_(i));return typeof n==`function`||r.isPresent?P.cloneElement(i,{ref:a}):null},`Presence`);function __(e){let[t,n]=P.useState(),r=P.useRef(null),i=P.useRef(e),a=P.useRef(`none`),o=P.useRef(void 0),[s,c]=h_(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return P.useEffect(()=>{s===`mounted`?(a.current=o.current??b_(r.current),o.current=void 0):a.current=`none`},[s]),cg(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=b_(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),cg(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=m_(a=>{let o=b_(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=m_(e=>{e.target===t&&(a.current=b_(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:P.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=b_(t)}else r.current=null;n(e)},[])}}m_(__,`usePresence`);function v_(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}m_(v_,`setRef`);function y_(...e){let t=P.useRef(e);return t.current=e,P.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=v_(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():v_(n[e],null)}}},[])}m_(y_,`useStableComposedRefs`);function b_(e){return e?.animationName||`none`}m_(b_,`getAnimationName`);function x_(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}m_(x_,`getElementRef`);var S_=Object.defineProperty,C_=(e,t)=>S_(e,`name`,{value:t,configurable:!0}),w_=0,T_=null;function E_(e){return D_(),e.children}C_(E_,`FocusGuards`);function D_(){P.useEffect(()=>{T_||={start:O_(),end:O_()};let{start:e,end:t}=T_;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),w_++,()=>{w_===1&&(T_?.start.remove(),T_?.end.remove(),T_=null),w_=Math.max(0,w_-1)}},[])}C_(D_,`useFocusGuards`);function O_(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}C_(O_,`createFocusGuard`);var k_=function(){return k_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},k_.apply(this,arguments)};function A_(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function j_(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var M_=`right-scroll-bar-position`,N_=`width-before-scroll-bar`,P_=`with-scroll-bars-hidden`,F_=`--removed-body-scroll-bar-size`;function I_(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function L_(e,t){var n=(0,P.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var R_=typeof window<`u`?P.useLayoutEffect:P.useEffect,z_=new WeakMap;function B_(e,t){var n=L_(t||null,function(t){return e.forEach(function(e){return I_(e,t)})});return R_(function(){var t=z_.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||I_(e,null)}),i.forEach(function(e){r.has(e)||I_(e,a)})}z_.set(n,e)},[e]),n}function V_(e){return e}function H_(e,t){t===void 0&&(t=V_);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function U_(e){e===void 0&&(e={});var t=H_(null);return t.options=k_({async:!0,ssr:!1},e),t}var W_=function(e){var t=e.sideCar,n=A_(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return P.createElement(r,k_({},n))};W_.isSideCarExport=!0;function G_(e,t){return e.useMedium(t),W_}var K_=U_(),q_=function(){},J_=P.forwardRef(function(e,t){var n=P.useRef(null),r=P.useState({onScrollCapture:q_,onWheelCapture:q_,onTouchMoveCapture:q_}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=A_(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=B_([n,t]),C=k_(k_({},b),i);return P.createElement(P.Fragment,null,u&&P.createElement(x,{sideCar:K_,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?P.cloneElement(P.Children.only(s),k_(k_({},C),{ref:S})):P.createElement(v,k_({},C,{className:c,ref:S}),s))});J_.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},J_.classNames={fullWidth:N_,zeroRight:M_};var Y_,X_=function(){if(Y_)return Y_;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Z_(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=X_();return t&&e.setAttribute(`nonce`,t),e}function Q_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $_(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ev=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Z_())&&(Q_(t,n),$_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tv=function(){var e=ev();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},nv=function(){var e=tv();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},rv={left:0,top:0,right:0,gap:0},iv=function(e){return parseInt(e||``,10)||0},av=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[iv(n),iv(r),iv(i)]},ov=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return rv;var t=av(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},sv=nv(),cv=`data-scroll-locked`,lv=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
39
|
+
.${P_} {
|
|
40
|
+
overflow: hidden ${r};
|
|
41
|
+
padding-right: ${s}px ${r};
|
|
42
|
+
}
|
|
43
|
+
body[${cv}] {
|
|
44
|
+
overflow: hidden ${r};
|
|
45
|
+
overscroll-behavior: contain;
|
|
46
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
47
|
+
padding-left: ${i}px;
|
|
48
|
+
padding-top: ${a}px;
|
|
49
|
+
padding-right: ${o}px;
|
|
50
|
+
margin-left:0;
|
|
51
|
+
margin-top:0;
|
|
52
|
+
margin-right: ${s}px ${r};
|
|
53
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.${M_} {
|
|
57
|
+
right: ${s}px ${r};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.${N_} {
|
|
61
|
+
margin-right: ${s}px ${r};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.${M_} .${M_} {
|
|
65
|
+
right: 0 ${r};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.${N_} .${N_} {
|
|
69
|
+
margin-right: 0 ${r};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
body[${cv}] {
|
|
73
|
+
${F_}: ${s}px;
|
|
74
|
+
}
|
|
75
|
+
`},uv=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},dv=function(){P.useEffect(function(){return document.body.setAttribute(cv,(uv()+1).toString()),function(){var e=uv()-1;e<=0?document.body.removeAttribute(cv):document.body.setAttribute(cv,e.toString())}},[])},fv=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;dv();var a=P.useMemo(function(){return ov(i)},[i]);return P.createElement(sv,{styles:lv(a,!t,i,n?``:`!important`)})},pv=!1;if(typeof window<`u`)try{var mv=Object.defineProperty({},"passive",{get:function(){return pv=!0,!0}});window.addEventListener(`test`,mv,mv),window.removeEventListener(`test`,mv,mv)}catch{pv=!1}var hv=pv?{passive:!1}:!1,gv=function(e){return e.tagName===`TEXTAREA`},_v=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!gv(e)&&n[t]===`visible`)},vv=function(e){return _v(e,`overflowY`)},yv=function(e){return _v(e,`overflowX`)},bv=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Cv(e,r)){var i=wv(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},xv=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Sv=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Cv=function(e,t){return e===`v`?vv(t):yv(t)},wv=function(e,t){return e===`v`?xv(t):Sv(t)},Tv=function(e,t){return e===`h`&&t===`rtl`?-1:1},Ev=function(e,t,n,r,i){var a=Tv(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=wv(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Cv(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Dv=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ov=function(e){return[e.deltaX,e.deltaY]},kv=function(e){return e&&`current`in e?e.current:e},Av=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jv=function(e){return`
|
|
76
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
77
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
78
|
+
`},Mv=0,Nv=[];function Pv(e){var t=P.useRef([]),n=P.useRef([0,0]),r=P.useRef(),i=P.useState(Mv++)[0],a=P.useState(nv)[0],o=P.useRef(e);P.useEffect(function(){o.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=j_([e.lockRef.current],(e.shards||[]).map(kv),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=P.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Dv(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=bv(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=bv(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Ev(h,t,e,h===`h`?s:c,!0)},[]),c=P.useCallback(function(e){var n=e;if(!(!Nv.length||Nv[Nv.length-1]!==a)){var r=`deltaY`in n?Ov(n):Dv(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Av(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(kv).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=P.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Fv(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=P.useCallback(function(e){n.current=Dv(e),r.current=void 0},[]),d=P.useCallback(function(t){l(t.type,Ov(t),t.target,s(t,e.lockRef.current))},[]),f=P.useCallback(function(t){l(t.type,Dv(t),t.target,s(t,e.lockRef.current))},[]);P.useEffect(function(){return Nv.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,hv),document.addEventListener(`touchmove`,c,hv),document.addEventListener(`touchstart`,u,hv),function(){Nv=Nv.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,hv),document.removeEventListener(`touchmove`,c,hv),document.removeEventListener(`touchstart`,u,hv)}},[]);var p=e.removeScrollBar,m=e.inert;return P.createElement(P.Fragment,null,m?P.createElement(a,{styles:jv(i)}):null,p?P.createElement(fv,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Fv(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Iv=G_(K_,Pv),Lv=P.forwardRef(function(e,t){return P.createElement(J_,k_({},e,{ref:t,sideCar:Iv}))});Lv.classNames=J_.classNames;var Rv=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},zv=new WeakMap,Bv=new WeakMap,Vv={},Hv=0,Uv=function(e){return e&&(e.host||Uv(e.parentNode))},Wv=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Uv(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Gv=function(e,t,n,r){var i=Wv(t,Array.isArray(e)?e:[e]);Vv[n]||(Vv[n]=new WeakMap);var a=Vv[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(zv.get(e)||0)+1,l=(a.get(e)||0)+1;zv.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Bv.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Hv++,function(){o.forEach(function(e){var t=zv.get(e)-1,i=a.get(e)-1;zv.set(e,t),a.set(e,i),t||(Bv.has(e)||e.removeAttribute(r),Bv.delete(e)),i||e.removeAttribute(n)}),Hv--,Hv||(zv=new WeakMap,zv=new WeakMap,Bv=new WeakMap,Vv={})}},Kv=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Rv(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Gv(r,i,n,`aria-hidden`)):function(){return null}},qv=Object.defineProperty,Jv=(e,t)=>qv(e,`name`,{value:t,configurable:!0}),Yv=`Dialog`,[Xv,Zv]=og(Yv),[Qv,$v]=Xv(Yv),ey=Jv(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=P.useRef(null),c=P.useRef(null),[l,u]=Sg({prop:r,defaultProp:i??!1,onChange:a,caller:Yv}),[d,f]=P.useState(0),[p,m]=P.useState(0);return(0,F.jsx)(Qv,{scope:t,triggerRef:s,contentRef:c,contentId:pg(),titleId:pg(),descriptionId:pg(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:P.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),ty=`DialogPortal`,[ny,ry]=Xv(ty,{forceMount:void 0}),iy=Jv(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=$v(ty,t);return(0,F.jsx)(ny,{scope:t,forceMount:n,children:P.Children.map(r,e=>(0,F.jsx)(g_,{present:n||a.open,children:(0,F.jsx)(f_,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),ay=`DialogOverlay`,oy=P.forwardRef(Jv(function(e,t){let n=ry(ay,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=$v(ay,e.__scopeDialog);return a.modal?(0,F.jsx)(g_,{present:r||a.open,children:(0,F.jsx)(cy,{...i,ref:t})}):null},`DialogOverlay`)),sy=Nh(`DialogOverlay.RemoveScroll`),cy=P.forwardRef(Jv(function(e,t){let{__scopeDialog:n,...r}=e,i=$v(ay,n),a=Ah(t,Hg());return(0,F.jsx)(Lv,{as:sy,allowPinchZoom:!0,shards:[i.contentRef],children:(0,F.jsx)(kg.div,{"data-state":by(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ly=`DialogContent`,uy=P.forwardRef(Jv(function(e,t){let n=ry(ly,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=$v(ly,e.__scopeDialog);return(0,F.jsx)(g_,{present:r||a.open,children:a.modal?(0,F.jsx)(dy,{...i,ref:t}):(0,F.jsx)(fy,{...i,ref:t})})},`DialogContent`)),dy=P.forwardRef(Jv(function(e,t){let n=$v(ly,e.__scopeDialog),r=P.useRef(null),i=Ah(t,n.contentRef,r);return P.useEffect(()=>{let e=r.current;if(e)return Kv(e)},[]),(0,F.jsx)(py,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Qh(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Qh(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Qh(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),fy=P.forwardRef(Jv(function(e,t){let n=$v(ly,e.__scopeDialog),r=P.useRef(!1),i=P.useRef(!1);return(0,F.jsx)(py,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),py=P.forwardRef(Jv(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=$v(ly,n);return D_(),(0,F.jsx)(F.Fragment,{children:(0,F.jsx)($g,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,F.jsx)(Vg,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":by(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),my=`DialogTitle`,hy=P.forwardRef(Jv(function(e,t){let{__scopeDialog:n,...r}=e,i=$v(my,n),{setTitleCount:a}=i;return cg(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,F.jsx)(kg.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),gy=`DialogDescription`,_y=P.forwardRef(Jv(function(e,t){let{__scopeDialog:n,...r}=e,i=$v(gy,n),{setDescriptionCount:a}=i;return cg(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,F.jsx)(kg.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),vy=`DialogClose`,yy=P.forwardRef(Jv(function(e,t){let{__scopeDialog:n,...r}=e,i=$v(vy,n);return(0,F.jsx)(kg.button,{type:`button`,...r,ref:t,onClick:Qh(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function by(e){return e?`open`:`closed`}Jv(by,`getState`);var xy=ey,Sy=iy,Cy=P.forwardRef(({className:e,...t},n)=>(0,F.jsx)(oy,{ref:n,className:K(`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out`,e),...t}));Cy.displayName=`DialogOverlay`;var wy=P.forwardRef(({className:e,children:t,hideClose:n,...r},i)=>(0,F.jsxs)(Sy,{children:[(0,F.jsx)(Cy,{}),(0,F.jsxs)(uy,{ref:i,className:K(`fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-card p-5 shadow-lg rounded-xl`,e),...r,children:[t,!n&&(0,F.jsxs)(yy,{className:`absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none cursor-pointer`,children:[(0,F.jsx)(fr,{className:`h-4 w-4`}),(0,F.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));wy.displayName=`DialogContent`;function Ty({className:e,...t}){return(0,F.jsx)(`div`,{className:K(`flex flex-col gap-1.5`,e),...t})}function Ey({className:e,...t}){return(0,F.jsx)(`div`,{className:K(`flex justify-end gap-2`,e),...t})}var Dy=P.forwardRef(({className:e,...t},n)=>(0,F.jsx)(hy,{ref:n,className:K(`text-lg font-semibold`,e),...t}));Dy.displayName=`DialogTitle`;var Oy=P.forwardRef(({className:e,...t},n)=>(0,F.jsx)(_y,{ref:n,className:K(`text-sm text-muted-foreground`,e),...t}));Oy.displayName=`DialogDescription`;var ky=Object.defineProperty,Ay=(e,t)=>ky(e,`name`,{value:t,configurable:!0}),jy=P.createContext(void 0);function My(e){let t=P.useContext(jy);return e||t||`ltr`}Ay(My,`useDirection`);var Ny=Object.defineProperty,Py=(e,t)=>Ny(e,`name`,{value:t,configurable:!0});function Fy(e,[t,n]){return Math.min(n,Math.max(t,e))}Py(Fy,`clamp`);var Iy=Object.defineProperty,Ly=(e,t)=>Iy(e,`name`,{value:t,configurable:!0});function Ry(e,t){return P.useReducer((e,n)=>t[e][n]??e,e)}Ly(Ry,`useStateMachine`);var zy=`ScrollArea`,[By,Vy]=og(zy),[Hy,Uy]=By(zy),Wy=P.forwardRef(Ly(function(e,t){let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=P.useState(null),[l,u]=P.useState(null),[d,f]=P.useState(null),[p,m]=P.useState(null),[h,g]=P.useState(null),[_,v]=P.useState(0),[y,b]=P.useState(0),[x,S]=P.useState(!1),[C,w]=P.useState(!1),T=Ah(t,c),E=My(i);return(0,F.jsx)(Hy,{scope:n,type:r,dir:E,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:S,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:v,onCornerHeightChange:b,children:(0,F.jsx)(kg.div,{dir:E,...o,ref:T,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})},`ScrollArea`)),Gy=`ScrollAreaViewport`,Ky=P.forwardRef(Ly(function(e,t){let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=Uy(Gy,n),s=Ah(t,P.useRef(null),o.onViewportChange);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(qy,{nonce:i}),(0,F.jsx)(kg.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,F.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})},`ScrollAreaViewport`)),qy=P.memo(Ly(function({nonce:e}){return(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:e})},`ScrollAreaViewportStyle`),(e,t)=>e.nonce===t.nonce),Jy=`ScrollAreaScrollbar`,Yy=P.forwardRef(Ly(function(e,t){let{forceMount:n,...r}=e,i=Uy(Jy,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return P.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,F.jsx)(Xy,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,F.jsx)(Zy,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,F.jsx)(Qy,{...r,ref:t,forceMount:n}):i.type===`always`?(0,F.jsx)($y,{...r,ref:t,"data-state":`visible`}):null},`ScrollAreaScrollbar`)),Xy=P.forwardRef(Ly(function(e,t){let{forceMount:n,...r}=e,i=Uy(Jy,e.__scopeScrollArea),[a,o]=P.useState(!1);return P.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=Ly(()=>{window.clearTimeout(t),o(!0)},`handlePointerEnter`),r=Ly(()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)},`handlePointerLeave`);return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,F.jsx)(g_,{present:n||a,children:(0,F.jsx)(Qy,{"data-state":a?`visible`:`hidden`,...r,ref:t})})},`ScrollAreaScrollbarHover`)),Zy=P.forwardRef(Ly(function(e,t){let{forceMount:n,...r}=e,i=Uy(Jy,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=yb(()=>c(`SCROLL_END`),100),[s,c]=Ry(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return P.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),P.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=Ly(()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r},`handleScroll`);return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,F.jsx)(g_,{present:n||s!==`hidden`,children:(0,F.jsx)($y,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:Qh(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:Qh(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})},`ScrollAreaScrollbarScroll`)),Qy=P.forwardRef(Ly(function(e,t){let n=Uy(Jy,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=P.useState(!1),s=e.orientation===`horizontal`,c=yb(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return bb(n.viewport,c),bb(n.content,c),(0,F.jsx)(g_,{present:r||a,children:(0,F.jsx)($y,{"data-state":a?`visible`:`hidden`,...i,ref:t})})},`ScrollAreaScrollbarAuto`)),$y=P.forwardRef(Ly(function(e,t){let{orientation:n=`vertical`,...r}=e,i=Uy(Jy,e.__scopeScrollArea),a=P.useRef(null),o=P.useRef(0),[s,c]=P.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=fb(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:Ly(e=>a.current=e,`onThumbChange`),onThumbPointerUp:Ly(()=>o.current=0,`onThumbPointerUp`),onThumbPointerDown:Ly(e=>o.current=e,`onThumbPointerDown`)};function d(e,t){return mb(e,o.current,s,t)}return Ly(d,`getScrollPosition`),n===`horizontal`?(0,F.jsx)(eb,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=hb(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,F.jsx)(tb,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=hb(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null},`ScrollAreaScrollbarVisible`)),eb=P.forwardRef(Ly(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=Uy(Jy,e.__scopeScrollArea),[o,s]=P.useState(),c=P.useRef(null),l=Ah(t,c,a.onScrollbarXChange);return P.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,F.jsx)(ib,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":pb(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),_b(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:db(o.paddingLeft),paddingEnd:db(o.paddingRight)}})}})},`ScrollAreaScrollbarX`)),tb=P.forwardRef(Ly(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=Uy(Jy,e.__scopeScrollArea),[o,s]=P.useState(),c=P.useRef(null),l=Ah(t,c,a.onScrollbarYChange);return P.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,F.jsx)(ib,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":pb(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),_b(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:db(o.paddingTop),paddingEnd:db(o.paddingBottom)}})}})},`ScrollAreaScrollbarY`)),[nb,rb]=By(Jy),ib=P.forwardRef(Ly(function(e,t){let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=Uy(Jy,n),[m,h]=P.useState(null),g=Ah(t,h),_=P.useRef(null),v=P.useRef(``),y=p.viewport,b=r.content-r.viewport,x=Ng(u),S=Ng(c),C=yb(d,10);function w(e){if(_.current){let t=e.clientX-_.current.left,n=e.clientY-_.current.top;l({x:t,y:n})}}return Ly(w,`handleDragScroll`),P.useEffect(()=>{let e=Ly(e=>{let t=e.target;m?.contains(t)&&x(e,b)},`handleWheel`);return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,b,x]),P.useEffect(S,[r,S]),bb(m,C),bb(p.content,C),(0,F.jsx)(nb,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:Ng(a),onThumbPointerUp:Ng(o),onThumbPositionChange:S,onThumbPointerDown:Ng(s),children:(0,F.jsx)(kg.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:Qh(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),w(e))}),onPointerMove:Qh(e.onPointerMove,w),onPointerUp:Qh(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})},`ScrollAreaScrollbarImpl`)),ab=`ScrollAreaThumb`,ob=P.forwardRef(Ly(function(e,t){let{forceMount:n,...r}=e,i=rb(ab,e.__scopeScrollArea);return(0,F.jsx)(g_,{present:n||i.hasThumb,children:(0,F.jsx)(sb,{ref:t,...r})})},`ScrollAreaThumb`)),sb=P.forwardRef(Ly(function(e,t){let{__scopeScrollArea:n,style:r,...i}=e,a=Uy(ab,n),o=rb(ab,n),{onThumbPositionChange:s}=o,c=Ah(t,o.onThumbChange),l=P.useRef(void 0),u=yb(()=>{l.current&&=(l.current(),void 0)},100);return P.useEffect(()=>{let e=a.viewport;if(e){let t=Ly(()=>{if(u(),!l.current){let t=vb(e,s);l.current=t,s()}},`handleScroll`);return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,F.jsx)(kg.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:Qh(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:Qh(e.onPointerUp,o.onThumbPointerUp)})},`ScrollAreaThumbImpl`)),cb=`ScrollAreaCorner`,lb=P.forwardRef(Ly(function(e,t){let n=Uy(cb,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,F.jsx)(ub,{...e,ref:t}):null},`ScrollAreaCorner`)),ub=P.forwardRef(Ly(function(e,t){let{__scopeScrollArea:n,...r}=e,i=Uy(cb,n),[a,o]=P.useState(0),[s,c]=P.useState(0),l=!!(a&&s),{onCornerWidthChange:u,onCornerHeightChange:d}=i;return bb(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),bb(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),P.useEffect(()=>()=>{u(0),d(0)},[u,d]),l?(0,F.jsx)(kg.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null},`ScrollAreaCornerImpl`));function db(e){return e?parseInt(e,10):0}Ly(db,`toInt`);function fb(e,t){let n=e/t;return isNaN(n)?0:n}Ly(fb,`getThumbRatio`);function pb(e){let t=fb(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}Ly(pb,`getThumbSize`);function mb(e,t,n,r=`ltr`){let i=pb(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return gb([c,l],d)(e)}Ly(mb,`getScrollPositionFromPointer`);function hb(e,t,n=`ltr`){let r=pb(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Fy(e,n===`ltr`?[0,o]:[o*-1,0]);return gb([0,o],[0,s])(c)}Ly(hb,`getThumbOffsetFromScroll`);function gb(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}Ly(gb,`linearScale`);function _b(e,t){return e>0&&e<t}Ly(_b,`isScrollingWithinScrollbarBounds`);var vb=Ly((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return Ly((function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)}),`loop`)(),()=>window.cancelAnimationFrame(r)},`addUnlinkedScrollListener`);function yb(e,t){let n=Ng(e),r=P.useRef(0);return P.useEffect(()=>()=>window.clearTimeout(r.current),[]),P.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}Ly(yb,`useDebounceCallback`);function bb(e,t){let n=Ng(t);cg(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}Ly(bb,`useResizeObserver`);var xb=Wy,Sb=Ky,Cb=Yy,wb=ob,Tb=lb,Eb=Object.defineProperty,Db=(e,t)=>Eb(e,`name`,{value:t,configurable:!0}),Ob=`horizontal`,kb=[`horizontal`,`vertical`],Ab=P.forwardRef(Db(function(e,t){let{decorative:n,orientation:r=Ob,...i}=e,a=jb(r)?r:Ob,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,F.jsx)(kg.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function jb(e){return kb.includes(e)}Db(jb,`isValidOrientation`);var Mb=Ab,Nb=[`top`,`right`,`bottom`,`left`],Pb=Math.min,Fb=Math.max,Ib=Math.round,Lb=Math.floor,Rb=e=>({x:e,y:e}),zb={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Bb(e,t,n){return Fb(e,Pb(t,n))}function Vb(e,t){return typeof e==`function`?e(t):e}function Hb(e){return e.split(`-`)[0]}function Ub(e){return e.split(`-`)[1]}function Wb(e){return e===`x`?`y`:`x`}function Gb(e){return e===`y`?`height`:`width`}function Kb(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function qb(e){return Wb(Kb(e))}function Jb(e,t,n){n===void 0&&(n=!1);let r=Ub(e),i=qb(e),a=Gb(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=rx(o)),[o,rx(o)]}function Yb(e){let t=rx(e);return[Xb(e),t,Xb(t)]}function Xb(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Zb=[`left`,`right`],Qb=[`right`,`left`],$b=[`top`,`bottom`],ex=[`bottom`,`top`];function tx(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Qb:Zb:t?Zb:Qb;case`left`:case`right`:return t?$b:ex;default:return[]}}function nx(e,t,n,r){let i=Ub(e),a=tx(Hb(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Xb)))),a}function rx(e){let t=Hb(e);return zb[t]+e.slice(t.length)}function ix(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ax(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ix(e)}function ox(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 sx(e,t,n){let{reference:r,floating:i}=e,a=Kb(t),o=qb(t),s=Gb(o),c=Hb(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}}let m=Ub(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function cx(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Vb(t,e),p=ax(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ox(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ox(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var lx=50,ux=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:cx},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=sx(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<lx&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=sx(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},dx=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}=Vb(e,t)||{};if(l==null)return{};let d=ax(u),f={x:n,y:r},p=qb(i),m=Gb(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Pb(d[_],T),ee=Pb(d[v],T),D=C-h[m]-ee,O=C/2-h[m]/2+w,te=Bb(E,O,D),ne=!c.arrow&&Ub(i)!=null&&O!==te&&a.reference[m]/2-(O<E?E:ee)-h[m]/2<0,k=ne?O<E?O-E:O-D:0;return{[p]:f[p]+k,data:{[p]:te,centerOffset:O-te-k,...ne&&{alignmentOffset:k}},reset:ne}}}),fx=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}=Vb(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Hb(r),_=Kb(o),v=Hb(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[rx(o)]:Yb(o)),x=p!==`none`;!d&&x&&b.push(...nx(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Jb(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`||_===Kb(t)||T.every(e=>Kb(e.placement)!==_||e.overflows[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=Kb(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}if(r!==n)return{reset:{placement:n}}}return{}}}};function px(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function mx(e){return Nb.some(t=>e[t]>=0)}var hx=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Vb(e,t);switch(i){case`referenceHidden`:{let e=px(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:mx(e)}}}case`escaped`:{let e=px(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:mx(e)}}}default:return{}}}}},gx=new Set([`left`,`top`]);async function _x(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Hb(n),s=Ub(n),c=Kb(n)===`y`,l=gx.has(o)?-1:1,u=a&&c?-1:1,d=Vb(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 vx=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 _x(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}}}}},yx=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Vb(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Kb(i),p=Wb(f),m=u[p],h=u[f],g=(e,t)=>Bb(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},bx=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}=Vb(e,t),u={x:n,y:r},d=Kb(i),f=Wb(d),p=u[f],m=u[d],h=Vb(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};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=gx.has(Hb(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}}}},xx=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Vb(e,t),c=await i.detectOverflow(t,s),l=Hb(n),u=Ub(n),d=Kb(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Pb(p-c[m],g),y=Pb(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Fb(c.left,c.right):S=p-2*Fb(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Sx(){return typeof window<`u`}function Cx(e){return Ex(e)?(e.nodeName||``).toLowerCase():`#document`}function wx(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Tx(e){return((Ex(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ex(e){return Sx()?e instanceof Node||e instanceof wx(e).Node:!1}function Dx(e){return Sx()?e instanceof Element||e instanceof wx(e).Element:!1}function Ox(e){return Sx()?e instanceof HTMLElement||e instanceof wx(e).HTMLElement:!1}function kx(e){return!Sx()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof wx(e).ShadowRoot}function Ax(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Vx(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function jx(e){return/^(table|td|th)$/.test(Cx(e))}function Mx(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Nx=/transform|translate|scale|rotate|perspective|filter/,Px=/paint|layout|strict|content/,Fx=e=>!!e&&e!==`none`,Ix;function Lx(e){let t=Dx(e)?Vx(e):e;return Fx(t.transform)||Fx(t.translate)||Fx(t.scale)||Fx(t.rotate)||Fx(t.perspective)||!zx()&&(Fx(t.backdropFilter)||Fx(t.filter))||Nx.test(t.willChange||``)||Px.test(t.contain||``)}function Rx(e){let t=Ux(e);for(;Ox(t)&&!Bx(t);){if(Lx(t))return t;if(Mx(t))return null;t=Ux(t)}return null}function zx(){return Ix??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ix}function Bx(e){return/^(html|body|#document)$/.test(Cx(e))}function Vx(e){return wx(e).getComputedStyle(e)}function Hx(e){return Dx(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ux(e){if(Cx(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||kx(e)&&e.host||Tx(e);return kx(t)?t.host:t}function Wx(e){let t=Ux(e);return Bx(t)?(e.ownerDocument||e).body:Ox(t)&&Ax(t)?t:Wx(t)}function Gx(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Wx(e),i=r===e.ownerDocument?.body,a=wx(r);if(i){let e=Kx(a);return t.concat(a,a.visualViewport||[],Ax(r)?r:[],e&&n?Gx(e):[])}return t.concat(r,Gx(r,[],n))}function Kx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qx(e){let t=Vx(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ox(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ib(n)!==a||Ib(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Jx(e){return Dx(e)?e:e.contextElement}function Yx(e){let t=Jx(e);if(!Ox(t))return Rb(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=qx(t),o=(a?Ib(n.width):n.width)/r,s=(a?Ib(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Xx=Rb(0);function Zx(e){let t=wx(e);return!zx()||!t.visualViewport?Xx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qx(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===wx(e)}function $x(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Jx(e),o=Rb(1);t&&(r?Dx(r)&&(o=Yx(r)):o=Yx(e));let s=Qx(a,n,r)?Zx(a):Rb(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&&r){let e=wx(a),t=Dx(r)?wx(r):r,n=e,i=Kx(n);for(;i&&t!==n;){let e=Yx(i),t=i.getBoundingClientRect(),r=Vx(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=wx(i),i=Kx(n)}}return ox({width:u,height:d,x:c,y:l})}function eS(e,t){let n=Hx(e).scrollLeft;return t?t.left+n:$x(Tx(e)).left+n}function tS(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-eS(e,n),y:n.top+t.scrollTop}}function nS(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Tx(r),s=t?Mx(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Rb(1),u=Rb(0),d=Ox(r);if((d||!a)&&((Cx(r)!==`body`||Ax(o))&&(c=Hx(r)),d)){let e=$x(r);l=Yx(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?tS(o,c):Rb(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 rS(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function iS(e){let t=Hx(e),n=e.ownerDocument.body,r=Fb(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Fb(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+eS(e),o=-t.scrollTop;return Vx(n).direction===`rtl`&&(a+=Fb(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var aS=25;function oS(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=wx(e),a=Tx(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!zx()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(eS(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=aS&&(s-=o)}return{width:s,height:c,x:l,y:u}}function sS(e,t){let n=$x(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Yx(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function cS(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=oS(e,n,t);else if(t===`document`)r=iS(Tx(e));else if(Dx(t))r=sS(t,n);else{let n=Zx(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ox(r)}function lS(e,t){let n=t.get(e);if(n)return n;let r=Gx(e,[],!1).filter(e=>Dx(e)&&Cx(e)!==`body`),i=null,a=Vx(e).position===`fixed`,o=a?Ux(e):e;for(;Dx(o)&&!Bx(o);){let e=Vx(o),t=Lx(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Ux(o)}return t.set(e,r),r}function uS(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Mx(t)?[]:lS(t,this._c):[].concat(n),r],o=cS(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=cS(t,a[e],i);s=Fb(n.top,s),c=Pb(n.right,c),l=Pb(n.bottom,l),u=Fb(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function dS(e){let{width:t,height:n}=qx(e);return{width:t,height:n}}function fS(e,t,n){let r=Ox(t),i=Tx(t),a=n===`fixed`,o=$x(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Rb(0);if((r||!a)&&((Cx(t)!==`body`||Ax(i))&&(s=Hx(t)),r)){let e=$x(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=eS(i));let l=i&&!r&&!a?tS(i,s):Rb(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function pS(e){return Vx(e).position===`static`}function mS(e,t){if(!Ox(e)||Vx(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Tx(e)===n&&(n=n.ownerDocument.body),n}function hS(e,t){let n=wx(e);if(Mx(e))return n;if(!Ox(e)){let t=Ux(e);for(;t&&!Bx(t);){if(Dx(t)&&!pS(t))return t;t=Ux(t)}return n}let r=mS(e,t);for(;r&&jx(r)&&pS(r);)r=mS(r,t);return r&&Bx(r)&&pS(r)&&!Lx(r)?n:r||Rx(e)||n}var gS=async function(e){let t=this.getOffsetParent||hS,n=this.getDimensions,r=await n(e.floating);return{reference:fS(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _S(e){return Vx(e).direction===`rtl`}var vS={convertOffsetParentRelativeRectToViewportRelativeRect:nS,getDocumentElement:Tx,getClippingRect:uS,getOffsetParent:hS,getElementRects:gS,getClientRects:rS,getDimensions:dS,getScale:Yx,isElement:Dx,isRTL:_S};function yS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bS(e,t,n){let r=null,i,a=Tx(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Lb(d),h=Lb(a.clientWidth-(u+f)),g=Lb(a.clientHeight-(d+p)),_=Lb(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Fb(0,Pb(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!yS(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=wx(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function xS(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=Jx(e),u=i||a?[...l?Gx(l):[],...t?Gx(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?bS(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?$x(e):null;c&&g();function g(){let t=$x(e);h&&!yS(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 SS=vx,CS=yx,wS=fx,TS=xx,ES=hx,DS=dx,OS=bx,kS=(e,t,n)=>{let r=new Map,i=n??{},a={...vS,...i.platform,_c:r};return ux(e,t,{...i,platform:a})},AS=typeof document<`u`?P.useLayoutEffect:function(){};function jS(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(!jS(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)&&!jS(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function MS(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function NS(e,t){let n=MS(e);return Math.round(t*n)/n}function PS(e){let t=P.useRef(e);return AS(()=>{t.current=e}),t}function FS(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]=P.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=P.useState(r);jS(f,r)||p(r);let[m,h]=P.useState(null),[g,_]=P.useState(null),v=P.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=P.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=P.useRef(null),C=P.useRef(null),w=P.useRef(u),T=c!=null,E=PS(c),ee=PS(i),D=PS(l),O=P.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),kS(S.current,C.current,e).then(e=>{let t={...e,isPositioned:D.current!==!1};te.current&&!jS(w.current,t)&&(w.current=t,ot.flushSync(()=>{d(t)}))})},[f,t,n,ee,D]);AS(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let te=P.useRef(!1);AS(()=>(te.current=!0,()=>{te.current=!1}),[]),AS(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,O);O()}},[b,x,O,E,T]);let ne=P.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),k=P.useMemo(()=>({reference:b,floating:x}),[b,x]),A=P.useMemo(()=>{let e={position:n,left:0,top:0};if(!k.floating)return e;let t=NS(k.floating,u.x),r=NS(k.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...MS(k.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,k.floating,u.x,u.y]);return P.useMemo(()=>({...u,update:O,refs:ne,elements:k,floatingStyles:A}),[u,O,ne,k,A])}var IS=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:DS({element:r.current,padding:i}).fn(n):r?DS({element:r,padding:i}).fn(n):{}}}},LS=(e,t)=>{let n=SS(e);return{name:n.name,fn:n.fn,options:[e,t]}},RS=(e,t)=>{let n=CS(e);return{name:n.name,fn:n.fn,options:[e,t]}},zS=(e,t)=>({fn:OS(e).fn,options:[e,t]}),BS=(e,t)=>{let n=wS(e);return{name:n.name,fn:n.fn,options:[e,t]}},VS=(e,t)=>{let n=TS(e);return{name:n.name,fn:n.fn,options:[e,t]}},HS=(e,t)=>{let n=ES(e);return{name:n.name,fn:n.fn,options:[e,t]}},US=(e,t)=>{let n=IS(e);return{name:n.name,fn:n.fn,options:[e,t]}},WS=Object.defineProperty,GS=(e,t)=>WS(e,`name`,{value:t,configurable:!0});function KS(e){let[t,n]=P.useState(void 0);return cg(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}GS(KS,`useSize`);var qS=Object.defineProperty,JS=(e,t)=>qS(e,`name`,{value:t,configurable:!0}),YS=`Popper`,[XS,ZS]=og(YS),[QS,$S]=XS(YS),eC=JS(e=>{let{__scopePopper:t,children:n}=e,[r,i]=P.useState(null),[a,o]=P.useState(void 0);return(0,F.jsx)(QS,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),tC=`PopperAnchor`,nC=P.forwardRef(JS(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=$S(tC,n),o=P.useRef(null),s=a.onAnchorChange,c=Ah(t,P.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=P.useRef(null);P.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&lC(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,F.jsx)(kg.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),rC=`PopperContent`,[iC,aC]=XS(rC),oC=P.forwardRef(JS(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=$S(rC,n),[_,v]=P.useState(null),y=Ah(t,v),[b,x]=P.useState(null),S=KS(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ee=Array.isArray(l)?l:[l],D=ee.length>0,O={padding:E,boundary:ee.filter(sC),altBoundary:D},{refs:te,floatingStyles:ne,placement:k,isPositioned:A,middlewareData:j}=FS({strategy:`fixed`,placement:T,whileElementsMounted:JS((...e)=>xS(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[LS({mainAxis:i+w,alignmentAxis:o}),c&&RS({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?zS():void 0,...O}),c&&BS({...O}),VS({...O,apply:JS(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&US({element:b,padding:s}),cC({arrowWidth:C,arrowHeight:w}),f&&HS({strategy:`referenceHidden`,...O,boundary:D?O.boundary:void 0})]}),re=g.setPlacementState;cg(()=>(re(k),()=>{re(void 0)}),[k,re]);let[M,ie]=lC(k),N=Ng(m);cg(()=>{A&&N?.()},[A,N]);let ae=j.arrow?.x,oe=j.arrow?.y,se=j.arrow?.centerOffset!==0,[ce,le]=P.useState();return cg(()=>{_&&le(window.getComputedStyle(_).zIndex)},[_]),(0,F.jsx)(`div`,{ref:te.setFloating,"data-radix-popper-content-wrapper":``,style:{...ne,transform:A?ne.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ce,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(` `),...j.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,F.jsx)(iC,{scope:n,placedSide:M,placedAlign:ie,onArrowChange:x,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:(0,F.jsx)(kg.div,{"data-side":M,"data-align":ie,...h,ref:y,style:{...h.style,animation:A?h.style?.animation:`none`}})})})},`PopperContent`));function sC(e){return e!==null}JS(sC,`isNotNull`);var cC=JS(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=lC(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function lC(e){let[t,n=`center`]=e.split(`-`);return[t,n]}JS(lC,`getSideAndAlignFromPlacement`);var uC=eC,dC=nC,fC=oC,pC=Object.defineProperty,mC=(e,t)=>pC(e,`name`,{value:t,configurable:!0}),hC=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),gC=P.forwardRef(mC(function(e,t){return(0,F.jsx)(kg.span,{...e,ref:t,style:{...hC,...e.style}})},`VisuallyHidden`)),_C=Object.defineProperty,vC=(e,t)=>_C(e,`name`,{value:t,configurable:!0}),[yC,bC]=og(`Tooltip`,[ZS]),xC=ZS(),SC=`TooltipProvider`,CC=700,wC=`tooltip.open`,[TC,EC]=yC(SC),DC=vC(e=>{let{__scopeTooltip:t,delayDuration:n=CC,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=P.useRef(!0),s=P.useRef(!1),c=P.useRef(0);return P.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,F.jsx)(TC,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:P.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:P.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:P.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),OC=`Tooltip`,[kC,AC]=yC(OC),jC=vC(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=EC(OC,e.__scopeTooltip),l=xC(t),[u,d]=P.useState(null),[f,p]=P.useState(void 0),m=pg(),h=P.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=P.useRef(!1),[y,b]=Sg({prop:r,defaultProp:i??!1,onChange:vC(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(wC))):c.onClose(),a?.(e)},`onChange`),caller:OC}),x=P.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=P.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=P.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=P.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);P.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let T=f??m;return(0,F.jsx)(uC,{...l,children:(0,F.jsx)(kC,{scope:t,contentId:T,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:P.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:P.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})},`Tooltip`),MC=`TooltipTrigger`,NC=P.forwardRef(vC(function(e,t){let{__scopeTooltip:n,...r}=e,i=AC(MC,n),a=EC(MC,n),o=xC(n),s=Ah(t,P.useRef(null),i.onTriggerChange),c=P.useRef(!1),l=P.useRef(!1),u=P.useCallback(()=>c.current=!1,[]);return P.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,F.jsx)(dC,{asChild:!0,...o,children:(0,F.jsx)(kg.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Qh(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:Qh(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:Qh(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:Qh(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Qh(e.onBlur,i.onClose),onClick:Qh(e.onClick,i.onClose)})})},`TooltipTrigger`)),PC=`TooltipPortal`,[FC,IC]=yC(PC,{forceMount:void 0}),LC=vC(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=AC(PC,t);return(0,F.jsx)(FC,{scope:t,forceMount:n,children:(0,F.jsx)(g_,{present:n||a.open,children:(0,F.jsx)(f_,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),RC=`TooltipContent`,zC=P.forwardRef(vC(function(e,t){let n=IC(RC,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=AC(RC,e.__scopeTooltip);return(0,F.jsx)(g_,{present:r||o.open,children:o.disableHoverableContent?(0,F.jsx)(HC,{side:i,...a,ref:t}):(0,F.jsx)(BC,{side:i,...a,ref:t})})},`TooltipContent`)),BC=P.forwardRef(vC(function(e,t){let n=AC(RC,e.__scopeTooltip),r=EC(RC,e.__scopeTooltip),i=P.useRef(null),a=Ah(t,i),[o,s]=P.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=P.useCallback(()=>{s(null),d(!1)},[d]),p=P.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=WC(r,UC(r,n.getBoundingClientRect())),a=GC(t.getBoundingClientRect()),o=qC([...i,...a]);s(o),d(!0)},[d]);return P.useEffect(()=>()=>f(),[f]),P.useEffect(()=>{if(c&&u){let e=vC(e=>p(e,u),`handleTriggerLeave`),t=vC(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),P.useEffect(()=>{if(o){let e=vC(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!KC(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,F.jsx)(HC,{...e,ref:a})},`TooltipContentHoverable`)),VC=Ih(`TooltipContent`),HC=P.forwardRef(vC(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=AC(RC,n),u=xC(n),{onClose:d}=l;P.useEffect(()=>(document.addEventListener(wC,d),()=>document.removeEventListener(wC,d)),[d]),P.useEffect(()=>{if(l.trigger){let e=vC(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return cg(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,F.jsx)(Vg,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,F.jsxs)(fC,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,F.jsx)(VC,{children:r}),i?(0,F.jsx)(gC,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function UC(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}vC(UC,`getExitSideFromRect`);function WC(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}vC(WC,`getPaddedExitPoints`);function GC(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}vC(GC,`getPointsFromRect`);function KC(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}vC(KC,`isPointInPolygon`);function qC(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),JC(t)}vC(qC,`getHull`);function JC(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}vC(JC,`getHullPresorted`);var YC=DC,XC=jC,ZC=NC,QC=LC,$C=zC,ew=P.forwardRef(({className:e,children:t,...n},r)=>(0,F.jsxs)(xb,{ref:r,className:K(`relative overflow-hidden`,e),...n,children:[(0,F.jsx)(Sb,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,F.jsx)(Cb,{orientation:`vertical`,className:`flex touch-none select-none transition-colors p-0.5 w-2.5`,children:(0,F.jsx)(wb,{className:`relative flex-1 rounded-full bg-border`})}),(0,F.jsx)(Tb,{})]}));ew.displayName=`ScrollArea`;var tw=P.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,F.jsx)(Mb,{ref:i,decorative:n,orientation:t,className:K(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...r}));tw.displayName=`Separator`;var nw=YC,rw=XC,iw=ZC,aw=P.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,F.jsx)(QC,{children:(0,F.jsx)($C,{ref:r,sideOffset:t,className:K(`z-50 overflow-hidden rounded-md border bg-popover px-2.5 py-1 text-xs text-popover-foreground shadow-md max-w-xs`,e),...n})}));aw.displayName=`TooltipContent`;function ow(e){let{data:t}=ni(e);return(t?.comments??[]).filter(e=>e.status===`open`&&e.thread.at(-1)?.role!==`author`).length}function sw(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${String(t%60).padStart(2,`0`)}s`:`${Math.floor(n/60)}h ${String(n%60).padStart(2,`0`)}m`}function cw(e,t,n){let[r,i]=(0,P.useState)(()=>Date.now());if((0,P.useEffect)(()=>{if(!n)return;i(Date.now());let e=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(e)},[n]),!e)return null;let a=Date.parse(e);return Number.isNaN(a)?null:Math.max(0,(n?r:t?Date.parse(t):r)-a)}function lw({run:e,className:t}){let n=Dr(e),r=cw(e?.createdAt,e?.finishedAt,n);return r==null?null:(0,F.jsx)(`span`,{className:K(`tabular-nums`,t),title:n?`Working time so far`:`Total run time`,children:sw(r)})}function uw(){let e=V(e=>e.domainId),t=Tr(e),n=Er(e),r=wr(e=>e.setRun),i=wr(e=>e.setDrawer),a=ow(e),[o,s]=(0,P.useState)(!1),c=Le(),l=Dr(n),u=t.data?.available??!1,d=async()=>{if(e){s(!0);try{let t=await z.agentSubmit(e);t.error?I.error(t.error):(r(t),I.success(`Sent to the agent`))}catch(e){I.error(String(e))}finally{s(!1),c.invalidateQueries({queryKey:B.agent(e)})}}};if(l)return(0,F.jsxs)(Jh,{size:`sm`,variant:`secondary`,onClick:()=>i(!0),title:`Show agent activity — running time so far`,children:[(0,F.jsx)(Pn,{className:`h-4 w-4 animate-spin`}),` Agent working…`,(0,F.jsx)(lw,{run:n,className:`ml-0.5 text-[11px] font-normal text-muted-foreground`})]});let f=o||!u,p=u?a===0?`No open threads awaiting a reply yet`:`Send ${a} open thread${a===1?``:`s`} to the agent`:`${t.data?.harness??`agent`} not available — set DOMAIN_STUDIO_HARNESS or install the CLI`;return(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsxs)(Jh,{size:`sm`,onClick:d,disabled:f,title:p,children:[o?(0,F.jsx)(Pn,{className:`h-4 w-4 animate-spin`}):(0,F.jsx)(Zn,{className:`h-4 w-4`}),` Submit to agent`,a>0&&(0,F.jsx)(`span`,{className:`rounded-full bg-primary-foreground/20 px-1.5 text-[10px] font-semibold`,children:a})]}),n&&(0,F.jsx)(Jh,{size:`icon`,variant:`ghost`,onClick:()=>i(!0),title:`Agent activity`,children:(0,F.jsx)(er,{className:`h-4 w-4`})})]})}function dw(e){switch(e.kind){case`message`:return{icon:(0,F.jsx)(Ln,{className:`h-3.5 w-3.5`}),tone:`text-primary`};case`thinking`:return{icon:(0,F.jsx)(er,{className:`h-3.5 w-3.5`}),tone:`text-muted-foreground`};case`reply`:return{icon:(0,F.jsx)(un,{className:`h-3.5 w-3.5`}),tone:`text-success`};case`error`:return{icon:(0,F.jsx)(sr,{className:`h-3.5 w-3.5`}),tone:`text-destructive`};case`tool`:{let t=e.tool??``;return t===`Edit`||t===`Write`||t===`MultiEdit`?{icon:(0,F.jsx)(_n,{className:`h-3.5 w-3.5`}),tone:`text-warning`}:t===`Bash`?{icon:(0,F.jsx)(ir,{className:`h-3.5 w-3.5`}),tone:`text-foreground/70`}:{icon:(0,F.jsx)(dr,{className:`h-3.5 w-3.5`}),tone:`text-foreground/60`}}default:return{icon:(0,F.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground/50`}),tone:`text-muted-foreground`}}}function fw(e){return e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(+(e<1e4))}k`:`${(e/1e6).toFixed(1)}M`}var pw=(0,P.memo)(function({e}){let{icon:t,tone:n}=dw(e),r=e.kind===`thinking`;return(0,F.jsxs)(`div`,{className:`flex gap-2.5 px-4 py-2`,children:[(0,F.jsx)(`div`,{className:K(`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center`,n),children:t}),(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.kind===`tool`?(0,F.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-[13px]`,children:[(0,F.jsx)(`span`,{className:`font-medium text-foreground/90`,children:e.tool}),e.target&&(0,F.jsx)(`span`,{className:`truncate font-mono text-xs text-muted-foreground`,children:e.target})]}):e.kind===`message`||e.kind===`reply`?(0,F.jsx)(bh,{text:e.text}):(0,F.jsx)(`p`,{className:K(`whitespace-pre-wrap break-words text-[13px] leading-relaxed`,r?`italic text-muted-foreground`:`text-foreground/90`),children:e.text})})]})}),mw={queued:`warning`,running:`warning`,succeeded:`success`,failed:`destructive`,canceled:`muted`,interrupted:`warning`};function hw({title:e,text:t}){return(0,F.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,F.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground/70`,children:e}),(0,F.jsx)(`pre`,{className:`max-h-[36vh] overflow-auto whitespace-pre-wrap break-words rounded-md border bg-muted/35 p-3 font-mono text-[11px] leading-relaxed`,children:t})]})}function gw({prompt:e,onClose:t}){return(0,F.jsx)(xy,{open:!0,onOpenChange:e=>!e&&t(),children:(0,F.jsxs)(wy,{className:`max-w-4xl`,children:[(0,F.jsx)(Ty,{children:(0,F.jsx)(Dy,{children:`Prompt sent to agent`})}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-muted-foreground`,children:[(0,F.jsx)(`span`,{children:e.firstTurn?`new session`:`follow-up turn`}),(0,F.jsx)(`span`,{children:e.resumed?`resumed`:`fresh`}),e.model&&(0,F.jsxs)(`span`,{className:`font-mono`,children:[`model `,e.model]}),e.effort&&(0,F.jsxs)(`span`,{children:[`effort `,e.effort]}),(0,F.jsx)(`span`,{children:new Date(e.createdAt).toLocaleString()}),e.sessionId&&(0,F.jsxs)(`span`,{className:`font-mono`,children:[`session `,e.sessionId]}),e.mcpTools.length>0&&(0,F.jsxs)(`span`,{children:[`bridge tools: `,e.mcpTools.join(`, `)]})]}),(0,F.jsxs)(`div`,{className:`max-h-[72vh] space-y-4 overflow-y-auto pr-1`,children:[(0,F.jsx)(hw,{title:`Turn prompt (stdin)`,text:e.turnPrompt}),(0,F.jsx)(hw,{title:`System appendix (--append-system-prompt)`,text:e.systemPrompt})]})]})})}function _w(){let e=wr(e=>e.drawerOpen),t=wr(e=>e.setDrawer),n=V(e=>e.domainId),r=V(e=>e.setSection),i=Er(n),a=Tr(n),o=wr(e=>e.setRun),s=Le(),[c,l]=(0,P.useState)(!1),[u,d]=(0,P.useState)(!1),[f,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(!1),g=(0,P.useRef)(null),_=Dr(i),v=i?.events??[],y=a.data?.conversation,b=y?.turns??0;return(0,P.useEffect)(()=>{e&&g.current&&(g.current.scrollTop=g.current.scrollHeight)},[v.length,e]),(0,P.useEffect)(()=>l(!1),[i?.id]),(0,P.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t(!1)};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),e?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`aside`,{className:`fixed inset-y-0 right-0 z-50 flex w-[440px] max-w-[92vw] flex-col border-l bg-card shadow-2xl`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2.5 border-b px-4 h-14 shrink-0`,children:[(0,F.jsx)(`div`,{className:K(`flex h-7 w-7 items-center justify-center rounded-lg`,_?`bg-warning/15 text-warning`:`bg-primary/15 text-primary`),children:_?(0,F.jsx)(Pn,{className:`h-4 w-4 animate-spin`}):(0,F.jsx)(Yt,{className:`h-4 w-4`})}),(0,F.jsx)(`div`,{className:`min-w-0`,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold`,children:[`Agent`,(0,F.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:a.data?.harness??i?.harness})]})}),i&&(0,F.jsx)(Th,{variant:mw[i.status],className:`ml-1 capitalize`,children:i.status}),i&&(0,F.jsx)(lw,{run:i,className:`text-[11px] text-muted-foreground/70`}),i?.prompt&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>h(!0),className:`ml-1 rounded-md px-1.5 py-0.5 text-[11px] text-muted-foreground/60 transition-colors hover:bg-accent hover:text-foreground`,title:`Show the exact prompt sent to the local agent`,children:`Sent prompt`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:`ml-auto inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground/60 hover:bg-accent hover:text-foreground`,children:(0,F.jsx)(fr,{className:`h-4 w-4`})})]}),y?.active&&(0,F.jsxs)(`div`,{className:`flex items-center gap-2 border-b bg-muted/30 px-4 py-1.5 text-xs text-muted-foreground shrink-0`,children:[(0,F.jsx)(Jn,{className:`h-3.5 w-3.5 shrink-0 opacity-70`}),(0,F.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Conversation · `,b,` turn`,b===1?``:`s`,(0,F.jsx)(`span`,{className:`opacity-60`,children:` · the agent remembers earlier turns`})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:async()=>{if(!(!n||u||_)){d(!0);try{(await z.agentReset(n)).ok?I.success(`Started a fresh conversation — the next submit won’t remember earlier turns`):I.error(`Could not reset — a run may be in progress`)}catch(e){I.error(String(e))}finally{d(!1),s.invalidateQueries({queryKey:B.agent(n)})}}},disabled:_||u,className:`ml-auto inline-flex shrink-0 items-center gap-1 rounded-md px-1.5 py-0.5 hover:bg-accent hover:text-foreground disabled:opacity-40`,title:`Start a fresh conversation — the next submit won't remember earlier turns`,children:[u?(0,F.jsx)(Pn,{className:`h-3 w-3 animate-spin`}):(0,F.jsx)(Yn,{className:`h-3 w-3`}),` `,`Start fresh`]})]}),(0,F.jsx)(ew,{className:`flex-1 min-h-0`,children:(0,F.jsx)(`div`,{ref:g,className:`h-full overflow-y-auto overflow-x-hidden py-1.5`,children:i?v.length===0?(0,F.jsx)(`div`,{className:`px-4 py-16 text-center text-sm text-muted-foreground`,children:`Starting the agent…`}):(0,F.jsx)(`div`,{className:`divide-y divide-border/40`,children:v.map(e=>(0,F.jsx)(pw,{e},e.id))}):(0,F.jsxs)(`div`,{className:`px-4 py-16 text-center text-sm text-muted-foreground`,children:[`No agent run yet. Add a comment and press`,` `,(0,F.jsx)(`span`,{className:`font-medium text-foreground`,children:`Submit to agent`}),`.`]})})}),(0,F.jsx)(`div`,{className:`border-t px-4 py-3 shrink-0`,children:_?(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Editing your domain…`}),(0,F.jsxs)(Jh,{size:`sm`,variant:`outline`,onClick:async()=>{if(!(!n||c)){l(!0);try{await z.agentCancel(n),I.message(`Cancelling the agent…`)}catch{l(!1)}}},disabled:c,children:[c?(0,F.jsx)(Pn,{className:`h-3.5 w-3.5 animate-spin`}):(0,F.jsx)(fr,{className:`h-3.5 w-3.5`}),` `,`Cancel`]})]}):i?(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground`,children:[i.status===`canceled`?(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`canceled — stopped before finishing`}):i.status===`interrupted`?(0,F.jsx)(`span`,{className:`text-warning`,children:`Interrupted by a studio restart — conversation intact.`}):i.status===`failed`?(0,F.jsx)(`span`,{className:`text-destructive`,children:i.error??`failed`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)($t,{className:`h-3.5 w-3.5 text-success`}),[i.liveReplies?`${i.liveReplies} live`:``,i.merge&&(i.merge.merged||i.merge.closed)?`merged ${i.merge.merged}, closed ${i.merge.closed}`:``].filter(Boolean).join(` · `)||`done`]}),i.merge?.schemaMismatch&&(0,F.jsx)(`span`,{className:`text-warning`,children:`⚠ replied against an older schema`}),i.merge&&i.merge.unknownIds.length>0&&(0,F.jsxs)(`span`,{className:`text-warning`,children:[`⚠ `,i.merge.unknownIds.length,` unknown id(s)`]}),typeof i.tokens==`number`&&i.tokens>0&&(0,F.jsxs)(`span`,{className:`opacity-60`,children:[`· `,fw(i.tokens),` tokens`]})]}),i.status===`interrupted`?(0,F.jsxs)(Jh,{size:`sm`,onClick:async()=>{if(!(!n||f||_)){p(!0);try{let e=await z.agentResume(n);e.error?I.error(e.error):(o(e),I.success(`Resuming where the agent left off`))}catch(e){I.error(String(e))}finally{p(!1),s.invalidateQueries({queryKey:B.agent(n)})}}},disabled:f,title:`Continue the agent from where it was interrupted`,children:[f?(0,F.jsx)(Pn,{className:`h-3.5 w-3.5 animate-spin`}):(0,F.jsx)(Wn,{className:`h-3.5 w-3.5`}),` `,`Resume`]}):(0,F.jsxs)(Jh,{size:`sm`,variant:`outline`,onClick:()=>{t(!1),r(`comments`)},children:[(0,F.jsx)(Ln,{className:`h-3.5 w-3.5`}),` View replies`]})]}):null})]}),m&&i?.prompt&&(0,F.jsx)(gw,{prompt:i.prompt,onClose:()=>h(!1)})]}):null}async function vw(e,t,n,r){let i=await fetch(`/api/domain/${encodeURIComponent(e)}/agent/ask`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t),signal:r});if(!i.ok||!i.body){let e=await i.text().catch(()=>i.statusText);return{text:``,error:`${i.status} ${e}`.trim()}}let a=i.body.getReader(),o=new TextDecoder,s=``,c=``,l;for(;;){let{value:e,done:t}=await a.read();if(t)break;s+=o.decode(e,{stream:!0});let r;for(;(r=s.indexOf(`
|
|
79
|
+
`))>=0;){let e=s.slice(0,r).trim();if(s=s.slice(r+1),e)try{let t=JSON.parse(e);typeof t.delta==`string`?n(t.delta):typeof t.done==`string`?c=t.done:t.error&&(l=String(t.error))}catch{}}}return{text:c,error:l}}var yw=(e,t)=>`${e}::${t}`,bw=new Map,xw=yr((e,t)=>({entries:{},openKey:null,start:(t,n,r,i,a)=>{let o=yw(t,n.ref);e(e=>{let s=e.entries[o],c=s?{...s,x:i,y:a,seen:!0}:{key:o,ref:n.ref,domainId:t,anchor:n,excerpt:r,x:i,y:a,question:``,answer:``,status:`composing`,seen:!0};return{entries:{...e.entries,[o]:c},openKey:o}})},submit:(n,r)=>{let i=t().entries[n];if(!i)return;bw.get(n)?.abort();let a=new AbortController;bw.set(n,a),e(e=>({entries:{...e.entries,[n]:{...i,question:r,answer:``,status:`streaming`,error:void 0,seen:!0}}}));let o=t=>e(e=>{let r=e.entries[n];return r?{entries:{...e.entries,[n]:t(r)}}:e});vw(i.domainId,{anchor:i.anchor,excerpt:i.excerpt,question:r},e=>{a.signal.aborted||o(t=>({...t,answer:t.answer+e}))},a.signal).then(e=>{a.signal.aborted||o(r=>({...r,status:e.error?`error`:`done`,error:e.error,answer:r.answer||e.text,seen:t().openKey===n}))}).catch(e=>{a.signal.aborted||o(r=>({...r,status:`error`,error:String(e),seen:t().openKey===n}))})},recompose:t=>{bw.get(t)?.abort(),e(e=>{let n=e.entries[t];return n?{entries:{...e.entries,[t]:{...n,question:``,answer:``,status:`composing`,error:void 0,seen:!0}}}:e})},open:t=>e(e=>({openKey:t,entries:e.entries[t]?{...e.entries,[t]:{...e.entries[t],seen:!0}}:e.entries})),collapse:()=>e({openKey:null}),remove:t=>{bw.get(t)?.abort(),bw.delete(t),e(e=>{let{[t]:n,...r}=e.entries;return{entries:r,openKey:e.openKey===t?null:e.openKey}})},keepOnly:t=>e(e=>{let n={};for(let[r,i]of Object.entries(e.entries))i.domainId===t?n[r]=i:(bw.get(r)?.abort(),bw.delete(r));return{entries:n,openKey:e.openKey&&n[e.openKey]?e.openKey:null}})})),Sw=Object.defineProperty,Cw=(e,t)=>Sw(e,`name`,{value:t,configurable:!0}),ww=`Popover`,[Tw,Ew]=og(ww,[ZS]),Dw=ZS(),[Ow,kw]=Tw(ww),Aw=Cw(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Dw(t),c=P.useRef(null),[l,u]=P.useState(!1),[d,f]=Sg({prop:r,defaultProp:i??!1,onChange:a,caller:ww});return(0,F.jsx)(uC,{...s,children:(0,F.jsx)(Ow,{scope:t,contentId:pg(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:P.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:P.useCallback(()=>u(!0),[]),onCustomAnchorRemove:P.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),jw=`PopoverAnchor`,Mw=P.forwardRef(Cw(function(e,t){let{__scopePopover:n,...r}=e,i=kw(jw,n),a=Dw(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return P.useEffect(()=>(o(),()=>s()),[o,s]),(0,F.jsx)(dC,{...a,...r,ref:t})},`PopoverAnchor`)),Nw=`PopoverTrigger`,Pw=P.forwardRef(Cw(function(e,t){let{__scopePopover:n,...r}=e,i=kw(Nw,n),a=Dw(n),o=Ah(t,i.triggerRef),s=(0,F.jsx)(kg.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Gw(i.open),...r,ref:o,onClick:Qh(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,F.jsx)(dC,{asChild:!0,...a,children:s})},`PopoverTrigger`)),Fw=`PopoverPortal`,[Iw,Lw]=Tw(Fw,{forceMount:void 0}),Rw=Cw(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=kw(Fw,t);return(0,F.jsx)(Iw,{scope:t,forceMount:n,children:(0,F.jsx)(g_,{present:n||a.open,children:(0,F.jsx)(f_,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),zw=`PopoverContent`,Bw=P.forwardRef(Cw(function(e,t){let n=Lw(zw,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=kw(zw,e.__scopePopover);return(0,F.jsx)(g_,{present:r||a.open,children:a.modal?(0,F.jsx)(Hw,{...i,ref:t}):(0,F.jsx)(Uw,{...i,ref:t})})},`PopoverContent`)),Vw=Nh(`PopoverContent.RemoveScroll`),Hw=P.forwardRef(Cw(function(e,t){let n=kw(zw,e.__scopePopover),r=P.useRef(null),i=Ah(t,r),a=P.useRef(!1);return P.useEffect(()=>{let e=r.current;if(e)return Kv(e)},[]),(0,F.jsx)(Lv,{as:Vw,allowPinchZoom:!0,children:(0,F.jsx)(Ww,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Qh(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Qh(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:Qh(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),Uw=P.forwardRef(Cw(function(e,t){let n=kw(zw,e.__scopePopover),r=P.useRef(!1),i=P.useRef(!1);return(0,F.jsx)(Ww,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),Ww=P.forwardRef(Cw(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=kw(zw,n),p=Dw(n);return D_(),(0,F.jsx)($g,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,F.jsx)(Vg,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,F.jsx)(fC,{"data-state":Gw(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function Gw(e){return e?`open`:`closed`}Cw(Gw,`getState`);var Kw=Aw,qw=Mw,Jw=Pw,Yw=Rw,Xw=Bw,Zw=Kw,Qw=Jw,$w=qw,eT=P.forwardRef(({className:e,align:t=`start`,side:n=`right`,sideOffset:r=8,...i},a)=>(0,F.jsx)(Yw,{children:(0,F.jsx)(Xw,{ref:a,align:t,side:n,sideOffset:r,collisionPadding:12,avoidCollisions:!0,sticky:`partial`,onOpenAutoFocus:e=>e.preventDefault(),className:K(`z-50 w-80 max-h-[var(--radix-popover-content-available-height)] overflow-hidden rounded-xl border bg-card p-3 shadow-lg outline-none`,`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...i})}));eT.displayName=`PopoverContent`;var tT=P.forwardRef(({className:e,...t},n)=>(0,F.jsx)(`textarea`,{ref:n,className:K(`flex min-h-20 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 font-mono`,e),...t}));tT.displayName=`Textarea`;function nT(e){let t=e.ref,n=null;try{n=t.startsWith(`module.`)?document.querySelector(`.react-flow__node[data-id="grp-${t.slice(7)}"]`):t.startsWith(`edge.`)?document.querySelector(`.react-flow__edge[data-id="edge-${t.slice(5)}"]`):document.querySelector(`.react-flow__node[data-id="${t}"]`)||document.querySelector(`[data-anchor-ref="${t}"]`)}catch{n=null}if(n){let e=n.getBoundingClientRect();if((e.width||e.height)&&e.bottom>0&&e.top<window.innerHeight)return{x:e.right-10,y:e.top+10}}return{x:e.x,y:e.y}}function rT({entry:e}){let t=xw(e=>e.submit),n=xw(e=>e.recompose),r=xw(e=>e.remove),i=xw(e=>e.collapse),[a,o]=(0,P.useState)(``),s=e.status===`composing`,c=e.status===`done`||e.status===`error`,l=()=>{let n=a.trim();n&&t(e.key,n)};return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium`,children:[(0,F.jsx)(er,{className:`h-3.5 w-3.5 text-violet-400`}),(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`Ask`}),(0,F.jsx)(`span`,{className:`truncate font-mono text-[11px] text-muted-foreground/70`,children:e.ref}),(0,F.jsx)(`span`,{className:`ml-auto shrink-0 text-[10px] text-muted-foreground/60`,children:`ephemeral`}),c&&(0,F.jsx)(`button`,{type:`button`,title:`Minimize`,onClick:i,className:`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground/50 hover:bg-accent hover:text-foreground`,children:(0,F.jsx)(Bn,{className:`h-3.5 w-3.5`})}),(s||c)&&(0,F.jsx)(`button`,{type:`button`,title:s?`Cancel`:`Close`,onClick:()=>r(e.key),className:`-mr-1 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground/50 hover:bg-accent hover:text-foreground`,children:(0,F.jsx)(fr,{className:`h-3.5 w-3.5`})})]}),!s&&(0,F.jsxs)(`div`,{className:`space-y-1.5 rounded-md border bg-background/40 p-2`,children:[(0,F.jsxs)(`div`,{className:`text-[13px] leading-snug`,children:[(0,F.jsx)(`span`,{className:`mr-1.5 text-[10px] font-medium uppercase text-muted-foreground`,children:`you`}),e.question]}),(0,F.jsxs)(`div`,{className:`text-[13px] leading-snug`,children:[(0,F.jsx)(`span`,{className:`mr-1.5 text-[10px] font-medium uppercase text-violet-400`,children:`agent`}),e.status===`streaming`&&!e.answer?(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,F.jsx)(Pn,{className:`h-3 w-3 animate-spin`}),` thinking…`]}):e.status===`error`?(0,F.jsx)(`span`,{className:`text-destructive`,children:e.error}):(0,F.jsxs)(`span`,{className:`whitespace-pre-wrap break-words`,children:[e.answer,e.status===`streaming`&&(0,F.jsx)(`span`,{className:`ml-0.5 inline-block h-3 w-[3px] animate-pulse bg-foreground/50 align-middle`})]})]})]}),s?(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(tT,{autoFocus:!0,className:`min-h-16 text-[13px]`,placeholder:`Ask about ${e.excerpt}…`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),l())}}),(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,F.jsx)(`span`,{className:`mr-auto text-[10px] text-muted-foreground`,children:`⌘↵ to ask · forked aside`}),(0,F.jsxs)(Jh,{size:`sm`,onClick:l,disabled:!a.trim(),children:[(0,F.jsx)(Zn,{className:`h-3.5 w-3.5`}),` Ask`]})]})]}):c?(0,F.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,F.jsx)(Jh,{size:`xs`,variant:`secondary`,onClick:()=>{n(e.key),o(``)},children:`Ask another`})}):null]})}function iT({entry:e,pos:t}){let n=xw(e=>e.openKey),r=xw(e=>e.open),i=xw(e=>e.collapse),a=xw(e=>e.remove),o=n===e.key,s=e.status===`streaming`?`streaming`:e.status===`error`?`error`:e.status===`done`&&!e.seen?`ready`:`idle`;return(0,F.jsxs)(Zw,{open:o,modal:!1,onOpenChange:t=>{t?r(e.key):e.status===`composing`?a(e.key):i()},children:[(0,F.jsx)($w,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,title:e.status===`streaming`?`Ask — answering…`:e.status===`done`?`Ask — answer ready`:e.status===`error`?`Ask — error`:`Ask`,onClick:()=>o?i():r(e.key),style:{position:`fixed`,left:t.x,top:t.y,transform:`translate(-50%, -50%)`},className:K(`z-40 inline-flex h-5 w-5 items-center justify-center rounded-full text-white shadow-md ring-2 ring-card transition-colors`,s===`streaming`&&`bg-violet-500`,s===`ready`&&`bg-emerald-500`,s===`error`&&`bg-destructive`,s===`idle`&&`bg-violet-500/80 hover:bg-violet-500`),children:[e.status===`streaming`?(0,F.jsx)(Pn,{className:`h-3 w-3 animate-spin`}):(0,F.jsx)(er,{className:`h-3 w-3`}),s===`ready`&&(0,F.jsx)(`span`,{className:`absolute -right-0.5 -top-0.5 h-2 w-2 animate-pulse rounded-full bg-emerald-300 ring-2 ring-card`})]})}),(0,F.jsx)(eT,{side:`bottom`,align:`start`,sideOffset:8,className:`w-96`,onInteractOutside:t=>{e.status===`composing`&&t.preventDefault()},children:(0,F.jsx)(rT,{entry:e})})]})}function aT(){let e=V(e=>e.domainId),t=xw(e=>e.entries),n=xw(e=>e.keepOnly),r=Object.values(t).filter(t=>t.domainId===e),[i,a]=(0,P.useState)({});(0,P.useEffect)(()=>{e&&n(e)},[e,n]);let o=r.map(e=>e.key).join(`|`);return(0,P.useEffect)(()=>{if(!o){a({});return}let e=0,t=()=>{let n=xw.getState().entries;a(e=>{let t={},r=!1;for(let i of o.split(`|`)){let a=n[i];if(!a)continue;let o=nT(a);t[i]=o;let s=e[i];(!s||s.x!==o.x||s.y!==o.y)&&(r=!0)}return!r&&Object.keys(e).length===Object.keys(t).length?e:t}),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[o]),(0,F.jsx)(F.Fragment,{children:r.map(e=>i[e.key]?(0,F.jsx)(iT,{entry:e,pos:i[e.key]},e.key):null)})}var oT=1,sT=.9,cT=.8,lT=.17,uT=.1,dT=.999,fT=.9999,pT=.99,mT=/[\\\/_+.#"@\[\(\{&]/,hT=/[\\\/_+.#"@\[\(\{&]/g,gT=/[\s-]/,_T=/[\s-]/g;function vT(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?oT:pT;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=vT(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=oT:mT.test(e.charAt(l-1))?(d*=cT,p=e.slice(i,l-1).match(hT),p&&i>0&&(d*=dT**+p.length)):gT.test(e.charAt(l-1))?(d*=sT,m=e.slice(i,l-1).match(_T),m&&i>0&&(d*=dT**+m.length)):(d*=lT,i>0&&(d*=dT**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=fT)),(d<uT&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=vT(e,t,n,r,l+1,a+2,o),f*uT>d&&(d=f*uT)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function yT(e){return e.toLowerCase().replace(_T,` `)}function bT(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,vT(e,t,yT(e),yT(t),0,0,{})}var xT=`[cmdk-group=""]`,ST=`[cmdk-group-items=""]`,CT=`[cmdk-group-heading=""]`,wT=`[cmdk-item=""]`,TT=`${wT}:not([aria-disabled="true"])`,ET=`cmdk-item-select`,DT=`data-value`,OT=(e,t,n)=>bT(e,t,n),kT=P.createContext(void 0),AT=()=>P.useContext(kT),jT=P.createContext(void 0),MT=()=>P.useContext(jT),NT=P.createContext(void 0),PT=P.forwardRef((e,t)=>{let n=JT(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=JT(()=>new Set),i=JT(()=>new Map),a=JT(()=>new Map),o=JT(()=>new Set),s=KT(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=pg(),y=pg(),b=pg(),x=P.useRef(null),S=ZT();qT(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),qT(()=>{S(6,O)},[]);let C=P.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)D(),E(),S(1,ee);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=te()?.id,C.emit()}),r||S(5,O),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=P.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{D(),E(),n.current.value||ee(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=te();S(4,()=>{D(),t?.getAttribute(`id`)===e&&ee(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??OT;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;ne().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(ST);t?t.appendChild(e.parentElement===t?e:e.closest(`${ST} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${ST} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${xT}[${DT}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function ee(){let e=ne().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(DT);C.setState(`value`,e||void 0)}function D(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function O(){var e;let t=te();t&&(t.parentElement?.firstChild===t&&((e=t.closest(xT)?.querySelector(CT))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function te(){return x.current?.querySelector(`${wT}[aria-selected="true"]`)}function ne(){return Array.from(x.current?.querySelectorAll(TT)||[])}function k(e){let t=ne()[e];t&&C.setState(`value`,t.getAttribute(DT))}function A(e){var t;let n=te(),r=ne(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(DT))}function j(e){let t=te()?.closest(xT),n;for(;t&&!n;)t=e>0?WT(t,xT):GT(t,xT),n=t?.querySelector(TT);n?C.setState(`value`,n.getAttribute(DT)):A(e)}let re=()=>k(ne().length-1),M=e=>{e.preventDefault(),e.metaKey?re():e.altKey?j(1):A(1)},ie=e=>{e.preventDefault(),e.metaKey?k(0):e.altKey?j(-1):A(-1)};return P.createElement(kg.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&M(e);break;case`ArrowDown`:M(e);break;case`p`:case`k`:g&&e.ctrlKey&&ie(e);break;case`ArrowUp`:ie(e);break;case`Home`:e.preventDefault(),k(0);break;case`End`:e.preventDefault(),re();break;case`Enter`:{e.preventDefault();let t=te();if(t){let e=new Event(ET);t.dispatchEvent(e)}}}}},P.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:eE},c),$T(e,e=>P.createElement(jT.Provider,{value:C},P.createElement(kT.Provider,{value:w},e))))}),FT=P.forwardRef((e,t)=>{let n=pg(),r=P.useRef(null),i=P.useContext(NT),a=AT(),o=KT(e),s=o.current?.forceMount??i?.forceMount;qT(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=XT(n,r,[e.value,e.children,r],e.keywords),l=MT(),u=YT(e=>e.value&&e.value===c.current),d=YT(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);P.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(ET,f),()=>t.removeEventListener(ET,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return P.createElement(kg.div,{ref:kh(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),IT=P.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=pg(),s=P.useRef(null),c=P.useRef(null),l=pg(),u=AT(),d=YT(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));qT(()=>u.group(o),[]),XT(o,s,[e.value,e.heading,c]);let f=P.useMemo(()=>({id:o,forceMount:i}),[i]);return P.createElement(kg.div,{ref:kh(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&P.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),$T(e,e=>P.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},P.createElement(NT.Provider,{value:f},e))))}),LT=P.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=P.useRef(null),a=YT(e=>!e.search);return!n&&!a?null:P.createElement(kg.div,{ref:kh(i,t),...r,"cmdk-separator":``,role:`separator`})}),RT=P.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=MT(),o=YT(e=>e.search),s=YT(e=>e.selectedItemId),c=AT();return P.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),P.createElement(kg.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),zT=P.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=P.useRef(null),o=P.useRef(null),s=YT(e=>e.selectedItemId),c=AT();return P.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),P.createElement(kg.div,{ref:kh(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},$T(e,e=>P.createElement(`div`,{ref:kh(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),BT=P.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return P.createElement(ey,{open:n,onOpenChange:r},P.createElement(iy,{container:o},P.createElement(oy,{"cmdk-overlay":``,className:i}),P.createElement(uy,{"aria-label":e.label,"cmdk-dialog":``,className:a},P.createElement(PT,{ref:t,...s}))))}),VT=P.forwardRef((e,t)=>YT(e=>e.filtered.count===0)?P.createElement(kg.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),HT=P.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return P.createElement(kg.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},$T(e,e=>P.createElement(`div`,{"aria-hidden":!0},e)))}),UT=Object.assign(PT,{List:zT,Item:FT,Input:RT,Group:IT,Separator:LT,Dialog:BT,Empty:VT,Loading:HT});function WT(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function GT(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function KT(e){let t=P.useRef(e);return qT(()=>{t.current=e}),t}var qT=typeof window>`u`?P.useEffect:P.useLayoutEffect;function JT(e){let t=P.useRef();return t.current===void 0&&(t.current=e()),t}function YT(e){let t=MT(),n=()=>e(t.snapshot());return P.useSyncExternalStore(t.subscribe,n,n)}function XT(e,t,n,r=[]){let i=P.useRef(),a=AT();return qT(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(DT,s),i.current=s}),i}var ZT=()=>{let[e,t]=P.useState(),n=JT(()=>new Map);return qT(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function QT(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function $T({asChild:e,children:t},n){return e&&P.isValidElement(t)?P.cloneElement(QT(t),{ref:t.ref},n(t.props.children)):n(t)}var eE={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},tE=[264,190,150,90,30,320,220,55,0,170,120,290];function nE(e){return tE[e%tE.length]}function rE(e,t){return`${e}.${t}`}function iE(e,t){if(!e)return{sourcePath:`root`,modulePath:`root`};let n=e.split(`/`).filter(Boolean),r=t.split(`/`).filter(Boolean),i=-1;for(let e=0;e<=n.length-r.length;e+=1)r.every((t,r)=>n[e+r]===t)&&(i=e+r.length);let a=i>=0?n.slice(i):n;return a.length===0?{sourcePath:`root`,modulePath:`root`}:(a[a.length-1]=a[a.length-1].replace(/\.tsx?$/u,``),{sourcePath:a.join(`/`),modulePath:a.length>1?a.slice(0,-1).join(`/`):`root`})}function aE(e,t){return e.ir?Object.entries(e.ir.classes).map(([n,r])=>{let i=r.type===`edge`?`edge`:`class`;return{name:n,kind:i,...iE(e.overlay.sourceSpans[`${i}.${n}`]?.file,t),icon:r.icon}}):[]}function oE(e){let t=[...new Set(e.map(e=>e.modulePath.split(`/`)[0]))].sort();return new Map(t.map((e,t)=>[e,nE(t)]))}function sE(e){return{name:e.name,kind:e.kind,selectId:`class.${e.name}`,ref:rE(e.kind,e.name),icon:e.icon}}function cE(e,t=`schema`){let n=aE(e,t),r=oE(n),i={name:t,path:``,hue:0,children:[],members:[]};for(let e of n){let n=e.modulePath===`root`?[]:e.modulePath.split(`/`),a=r.get(n[0]??`root`)??264,o=i;if(n.length===0){let e=i.children.find(e=>e.path===`root`);e||(e={name:t,path:`root`,hue:a,children:[],members:[]},i.children.push(e)),o=e}for(let e=0;e<n.length;e+=1){let t=n.slice(0,e+1).join(`/`),r=o.children.find(e=>e.path===t);r||(r={name:n[e],path:t,hue:a,children:[],members:[]},o.children.push(r)),o=r}o.members.push(sE(e))}return lE(i),i}function lE(e){e.children.sort((e,t)=>e.name.localeCompare(t.name)),e.members.sort((e,t)=>Number(e.kind===`edge`)-Number(t.kind===`edge`)||e.name.localeCompare(t.name)),e.children.forEach(lE)}function uE(e,t=`schema`){let n=aE(e,t),r=oE(n),i=new Map;for(let e of n){let n=e.modulePath.split(`/`)[0],a=i.get(e.modulePath)??{path:e.modulePath,label:e.modulePath===`root`?t:e.modulePath,hue:r.get(n)??264,classes:[],edges:[]};a[e.kind===`edge`?`edges`:`classes`].push(e.name),i.set(e.modulePath,a)}for(let e of i.values())e.classes.sort(),e.edges.sort();return[...i.values()].sort((e,t)=>e.path.localeCompare(t.path))}function dE(e,t,n=`schema`){return iE(e.overlay.sourceSpans[`class.${t}`]?.file,n).modulePath}function fE(e,t,n=`schema`){let r=aE(e,n),i=oE(r),a=r.filter(e=>e.modulePath===t||t!==`root`&&e.modulePath.startsWith(`${t}/`));return{path:t,label:t===`root`?n:t,hue:i.get(t.split(`/`)[0])??264,classes:a.filter(e=>e.kind===`class`).map(sE).sort(pE),edges:a.filter(e=>e.kind===`edge`).map(sE).sort(pE),files:[...new Set(a.map(e=>e.sourcePath))].sort()}}function pE(e,t){return e.name.localeCompare(t.name)}var mE=[{key:`context`,label:`Context`},{key:`schema`,label:`Schema`},{key:`process`,label:`Process`},{key:`comments`,label:`Comments`}];function hE(e,t){if(!e)return`unknown`;if(Array.isArray(e.enum)&&e.enum.length)return t?`enum?`:`enum`;let n=e.type;if(Array.isArray(n)){let e=n.filter(e=>e!==`null`),r=t??n.includes(`null`),i=e.length===1?e[0]:e.join(` | `)||`unknown`;return r?`${i}?`:i}let r=n===`array`?`${e.items?.type??`unknown`}[]`:n??`unknown`;return t?`${r}?`:r}function gE({icon:e,label:t,meta:n}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(e,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,F.jsx)(`span`,{className:`flex-1 truncate`,children:t}),n?(0,F.jsx)(`span`,{className:`ml-2 shrink-0 truncate text-xs text-muted-foreground`,children:n}):null]})}var _E=`flex cursor-pointer items-center gap-2 rounded-md px-2 py-2 text-sm text-foreground outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground`;function vE(){let e=V(e=>e.paletteOpen),t=V(e=>e.setPaletteOpen),n=V(e=>e.domainId),r=V(e=>e.setSection),i=V(e=>e.selectClass),a=V(e=>e.focusClass),o=V(e=>e.setSettingsOpen),{data:s}=Hr(n);(0,P.useEffect)(()=>{function e(e){e.key.toLowerCase()===`k`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),t(!V.getState().paletteOpen))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]);let c=()=>t(!1),l=(0,P.useMemo)(()=>{let e=s?.ir;if(!e||!s)return{classes:[],edges:[],properties:[],modules:[]};let t=Object.values(e.classes).filter(e=>e.type===`node`).map(e=>{let t=Object.keys(e.properties).length,n=Object.keys(e.methods).length,r=dE(s,e.name),i=`${t}p · ${n}m`;return{name:e.name,value:`class ${e.name} ${r} ${i}`,meta:r===`root`?i:`${r} · ${i}`}}).sort((e,t)=>e.name.localeCompare(t.name)),n=Object.values(e.classes).filter(e=>e.type===`edge`).map(e=>{let[t,n]=e.endpoints??[],r=t?.types.join(`|`)??`?`,i=n?.types.join(`|`)??`?`;return{name:e.name,value:`edge ${e.name} ${r} ${i} relationship`,meta:`${r} → ${i}`}}).sort((e,t)=>e.name.localeCompare(t.name)),r=[];for(let t of Object.values(e.classes))if(t.type===`node`)for(let[e,n]of Object.entries(t.properties)){let i=t.required?!t.required.includes(e):void 0;r.push({id:`class.${t.name}.property.${e}`,owner:t.name,prop:e,value:`${t.name}.${e} property ${hE(n,i)}`,meta:hE(n,i)})}return r.sort((e,t)=>e.value.localeCompare(t.value)),{classes:t,edges:n,properties:r,modules:uE(s).map(e=>{let t=e.classes.length+e.edges.length;return{path:e.path,firstClass:e.classes[0],value:`module ${e.path} ${e.classes.join(` `)} ${e.edges.join(` `)}`,meta:`${t} member${t===1?``:`s`}`}})}},[s]);return(0,F.jsxs)(UT.Dialog,{open:e,onOpenChange:t,label:`Command palette`,shouldFilter:!0,overlayClassName:`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm`,contentClassName:K(`fixed left-1/2 top-[15%] z-50 w-full max-w-[640px] -translate-x-1/2`,`overflow-hidden rounded-xl border bg-card text-card-foreground shadow-2xl`,`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5`,`[&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium`,`[&_[cmdk-group-heading]]:text-muted-foreground`),children:[(0,F.jsx)(`div`,{className:`flex items-center border-b px-3`,children:(0,F.jsx)(UT.Input,{autoFocus:!0,placeholder:`Search classes, interfaces, edges, properties, modules…`,className:`h-12 w-full bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground`})}),(0,F.jsxs)(UT.List,{className:`max-h-[60vh] overflow-y-auto overflow-x-hidden p-2`,children:[(0,F.jsx)(UT.Empty,{className:`py-8 text-center text-sm text-muted-foreground`,children:`No results`}),(0,F.jsx)(UT.Group,{heading:`Studio`,children:(0,F.jsxs)(UT.Item,{value:`settings power-user options integrations folder configuration`,className:_E,onSelect:()=>{o(!0),c()},children:[(0,F.jsx)(Qn,{className:`h-4 w-4 text-muted-foreground`}),`Settings…`]})}),l.classes.length>0&&(0,F.jsx)(UT.Group,{heading:`Classes`,children:l.classes.map(e=>(0,F.jsx)(UT.Item,{value:e.value,className:_E,onSelect:()=>{r(`schema`),a(`class.${e.name}`),c()},children:(0,F.jsx)(gE,{icon:Xt,label:e.name,meta:e.meta})},`class.${e.name}`))}),l.edges.length>0&&(0,F.jsx)(UT.Group,{heading:`Relationships`,children:l.edges.map(e=>(0,F.jsx)(UT.Item,{value:e.value,className:_E,onSelect:()=>{r(`schema`),i(`class.${e.name}`),c()},children:(0,F.jsx)(gE,{icon:tr,label:(0,F.jsxs)(F.Fragment,{children:[e.name,` `,(0,F.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,e.meta,`)`]})]})})},`edge.${e.name}`))}),l.properties.length>0&&(0,F.jsx)(UT.Group,{heading:`Properties`,children:l.properties.map(e=>(0,F.jsx)(UT.Item,{value:e.value,className:_E,onSelect:()=>{r(`schema`),a(`class.${e.owner}`),c()},children:(0,F.jsx)(gE,{icon:rr,label:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.owner,`.`]}),e.prop]}),meta:e.meta})},e.id))}),l.modules.length>0&&(0,F.jsx)(UT.Group,{heading:`Modules`,children:l.modules.map(e=>(0,F.jsx)(UT.Item,{value:e.value,className:_E,onSelect:()=>{r(`schema`),e.firstClass&&a(`class.${e.firstClass}`),c()},children:(0,F.jsx)(gE,{icon:Cn,label:e.path,meta:e.meta})},`module.${e.path}`))}),(0,F.jsx)(UT.Group,{heading:`Go to`,children:mE.map(e=>(0,F.jsx)(UT.Item,{value:`go to ${e.label} ${e.key} section`,className:_E,onSelect:()=>{r(e.key),c()},children:(0,F.jsx)(gE,{icon:qt,label:e.label,meta:`section`})},`section.${e.key}`))})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-3 border-t px-3 py-2 text-[11px] text-muted-foreground`,children:[(0,F.jsx)(`span`,{children:`↑↓ navigate`}),(0,F.jsx)(`span`,{children:`·`}),(0,F.jsx)(`span`,{children:`↵ select`}),(0,F.jsx)(`span`,{children:`·`}),(0,F.jsx)(`span`,{children:`esc close`})]})]})}function yE({count:e,status:t,orphaned:n,onClick:r,className:i}){return(0,F.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),r?.(e)},title:`${e} ${e===1?`thread`:`threads`}${n?` · orphaned`:t===`resolved`?` · resolved`:``}`,className:K(`inline-flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[10px] font-semibold leading-none tabular-nums shadow-sm transition-colors`,`ring-1 ring-inset cursor-pointer select-none`,t===`open`?`bg-primary text-primary-foreground ring-primary/40 hover:bg-primary/90`:`bg-muted text-muted-foreground ring-border hover:bg-muted/80`,n&&`ring-2 ring-destructive text-destructive bg-destructive/15`,i),children:e})}var bE=Object.defineProperty,xE=(e,t)=>bE(e,`name`,{value:t,configurable:!0}),SE=`Collapsible`,[CE,wE]=og(SE),[TE,EE]=CE(SE),DE=P.forwardRef(xE(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Sg({prop:r,defaultProp:i??!1,onChange:o,caller:SE});return(0,F.jsx)(TE,{scope:n,disabled:a,contentId:pg(),open:c,onOpenToggle:P.useCallback(()=>l(e=>!e),[l]),children:(0,F.jsx)(kg.div,{"data-state":NE(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),OE=`CollapsibleTrigger`,kE=P.forwardRef(xE(function(e,t){let{__scopeCollapsible:n,...r}=e,i=EE(OE,n);return(0,F.jsx)(kg.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":NE(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:Qh(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),AE=`CollapsibleContent`,jE=P.forwardRef(xE(function(e,t){let{forceMount:n,...r}=e,i=EE(AE,e.__scopeCollapsible);return(0,F.jsx)(g_,{present:n||i.open,children:({present:e})=>(0,F.jsx)(ME,{...r,ref:t,present:e})})},`CollapsibleContent`)),ME=P.forwardRef(xE(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=EE(AE,n),[s,c]=P.useState(r),l=P.useRef(null),u=Ah(t,l),d=P.useRef(0),f=d.current,p=P.useRef(0),m=p.current,h=o.open||s,g=P.useRef(h),_=P.useRef(void 0);return P.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),cg(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,F.jsx)(kg.div,{"data-state":NE(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})},`CollapsibleContentImpl`));function NE(e){return e?`open`:`closed`}xE(NE,`getState`);var PE=DE,FE=kE,IE=jE,LE=PE,RE=FE,zE=IE;function BE({title:e,subtitle:t,icon:n,actions:r,children:i,wide:a,className:o}){return(0,F.jsx)(`div`,{className:`h-full overflow-y-auto`,children:(0,F.jsxs)(`div`,{className:K(`mx-auto px-8 pt-8 pb-28`,a?`max-w-6xl`:`max-w-3xl`,o),children:[(0,F.jsxs)(`header`,{className:`flex items-start gap-3 mb-7`,children:[n&&(0,F.jsx)(`div`,{className:`text-muted-foreground mt-0.5`,children:n}),(0,F.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,F.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:e}),t&&(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 leading-relaxed`,children:t})]}),r&&(0,F.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:r})]}),i]})})}function VE({label:e,hint:t,children:n,className:r}){return(0,F.jsxs)(`section`,{className:K(`mb-8`,r),children:[e&&(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between mb-2.5 px-1`,children:[(0,F.jsx)(`h2`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:e}),t!=null&&(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground/70`,children:t})]}),n]})}function HE({className:e,...t}){return(0,F.jsx)(`div`,{className:K(`rounded-xl border bg-card`,e),...t})}var UE={violet:`bg-primary/12 text-primary`,sky:`bg-sky-500/12 text-sky-400`,emerald:`bg-emerald-500/12 text-emerald-400`,amber:`bg-amber-500/12 text-amber-400`,rose:`bg-rose-500/12 text-rose-400`,fuchsia:`bg-fuchsia-500/12 text-fuchsia-400`,muted:`bg-muted text-muted-foreground`};function WE({children:e,tone:t=`muted`,size:n=`md`,className:r,style:i}){let a=n===`lg`?`h-10 w-10 [&_svg]:h-5 [&_svg]:w-5`:n===`sm`?`h-7 w-7 [&_svg]:h-3.5 [&_svg]:w-3.5`:`h-9 w-9 [&_svg]:h-[18px] [&_svg]:w-[18px]`;return(0,F.jsx)(`div`,{className:K(`inline-flex items-center justify-center rounded-lg shrink-0`,UE[t]??t,a,r),style:i,children:e})}function GE({leading:e,title:t,subtitle:n,trailing:r,onClick:i,active:a,className:o,children:s,anchorRef:c,anchorExcerpt:l}){return(0,F.jsxs)(i?`button`:`div`,{onClick:i,"data-anchor-ref":c,"data-anchor-excerpt":l,"data-commentable":c?``:void 0,className:K(`group/row w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-left transition-colors`,i&&`hover:bg-accent/60 cursor-pointer`,a&&`bg-accent`,o),children:[e,(t||n)&&(0,F.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[t&&(0,F.jsx)(`div`,{className:`text-sm font-extrabold truncate`,children:t}),n&&(0,F.jsx)(`div`,{className:`text-[13px] text-muted-foreground truncate leading-snug`,children:n})]}),s,r&&(0,F.jsx)(`div`,{className:`shrink-0 flex items-center gap-1.5`,children:r})]})}var KE={default:`bg-muted text-muted-foreground`,primary:`bg-primary/12 text-primary`,success:`bg-success/12 text-success`,warning:`bg-warning/15 text-warning`,danger:`bg-destructive/12 text-destructive`,fuchsia:`bg-fuchsia-500/12 text-fuchsia-300`,outline:`border border-border text-muted-foreground`};function qE({children:e,tone:t=`default`,className:n,...r}){return(0,F.jsx)(`span`,{className:K(`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium whitespace-nowrap`,KE[t],n),...r,children:e})}function JE({label:e=`Details`,children:t,className:n}){return(0,F.jsxs)(LE,{className:n,children:[(0,F.jsxs)(RE,{className:`group/disc inline-flex items-center gap-1 text-xs text-muted-foreground/80 hover:text-foreground transition-colors`,children:[(0,F.jsx)(tn,{className:`h-3 w-3 transition-transform group-data-[state=open]/disc:rotate-90`}),e]}),(0,F.jsx)(zE,{className:`overflow-hidden data-[state=open]:animate-in data-[state=closed]:animate-out`,children:(0,F.jsx)(`div`,{className:`pt-2`,children:t})})]})}function YE({items:e,className:t}){return(0,F.jsx)(`dl`,{className:K(`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-xs`,t),children:e.map((e,t)=>(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(`dt`,{className:`text-muted-foreground/70 whitespace-nowrap`,children:e.label}),(0,F.jsx)(`dd`,{className:`font-mono text-muted-foreground break-all`,children:e.value})]},t))})}function XE({icon:e,title:t,hint:n}){return(0,F.jsxs)(`div`,{className:`flex flex-col items-center justify-center text-center py-12 px-6`,children:[e&&(0,F.jsx)(`div`,{className:`text-muted-foreground/40 mb-3 [&_svg]:h-8 [&_svg]:w-8`,children:e}),(0,F.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:t}),n&&(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground/60 mt-1 max-w-xs`,children:n})]})}var ZE=Object.defineProperty,QE=(e,t)=>ZE(e,`name`,{value:t,configurable:!0}),$E,eD=`HoverCard`,[tD,nD]=og(eD,[ZS]),rD=ZS(),[iD,aD]=tD(eD),oD=QE(e=>{let{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:a,openDelay:o=700,closeDelay:s=300}=e,c=rD(t),l=P.useRef(0),u=P.useRef(0),d=P.useRef(!1),f=P.useRef(!1),[p,m]=Sg({prop:r,defaultProp:i??!1,onChange:a,caller:eD}),h=P.useCallback(()=>{clearTimeout(u.current),l.current=window.setTimeout(()=>m(!0),o)},[o,m]),g=P.useCallback(()=>{clearTimeout(l.current),!d.current&&!f.current&&(u.current=window.setTimeout(()=>m(!1),s))},[s,m]),_=P.useCallback(()=>m(!1),[m]);return P.useEffect(()=>()=>{clearTimeout(l.current),clearTimeout(u.current)},[]),(0,F.jsx)(iD,{scope:t,open:p,onOpenChange:m,onOpen:h,onClose:g,onDismiss:_,hasSelectionRef:d,isPointerDownOnContentRef:f,children:(0,F.jsx)(uC,{...c,children:n})})},`HoverCard`),sD=`HoverCardTrigger`,cD=P.forwardRef(QE(function(e,t){let{__scopeHoverCard:n,...r}=e,i=aD(sD,n),a=rD(n);return(0,F.jsx)(dC,{asChild:!0,...a,children:(0,F.jsx)(kg.a,{"data-state":i.open?`open`:`closed`,...r,ref:t,onPointerEnter:Qh(e.onPointerEnter,gD(i.onOpen)),onPointerLeave:Qh(e.onPointerLeave,gD(i.onClose)),onFocus:Qh(e.onFocus,i.onOpen),onBlur:Qh(e.onBlur,i.onClose),onTouchStart:Qh(e.onTouchStart,e=>e.preventDefault())})})},`HoverCardTrigger`)),lD=`HoverCardPortal`,[uD,dD]=tD(lD,{forceMount:void 0}),fD=QE(e=>{let{__scopeHoverCard:t,forceMount:n,children:r,container:i}=e,a=aD(lD,t);return(0,F.jsx)(uD,{scope:t,forceMount:n,children:(0,F.jsx)(g_,{present:n||a.open,children:(0,F.jsx)(f_,{asChild:!0,container:i,children:r})})})},`HoverCardPortal`),pD=`HoverCardContent`,mD=P.forwardRef(QE(function(e,t){let n=dD(pD,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,a=aD(pD,e.__scopeHoverCard);return(0,F.jsx)(g_,{present:r||a.open,children:(0,F.jsx)(hD,{"data-state":a.open?`open`:`closed`,...i,onPointerEnter:Qh(e.onPointerEnter,gD(a.onOpen)),onPointerLeave:Qh(e.onPointerLeave,gD(a.onClose)),ref:t})})},`HoverCardContent`)),hD=P.forwardRef(QE(function(e,t){let{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,...s}=e,c=aD(pD,n),l=rD(n),u=P.useRef(null),d=Ah(t,u),[f,p]=P.useState(!1);return P.useEffect(()=>{if(f){let e=document.body;return $E=e.style.userSelect||e.style.webkitUserSelect,e.style.userSelect=`none`,e.style.webkitUserSelect=`none`,()=>{e.style.userSelect=$E,e.style.webkitUserSelect=$E}}},[f]),P.useEffect(()=>{if(u.current){let e=QE(()=>{p(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==``&&(c.hasSelectionRef.current=!0)})},`handlePointerUp`);return document.addEventListener(`pointerup`,e),()=>{document.removeEventListener(`pointerup`,e),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),P.useEffect(()=>{u.current&&_D(u.current).forEach(e=>e.setAttribute(`tabindex`,`-1`))}),(0,F.jsx)(Vg,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:o,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:Qh(a,e=>{e.preventDefault()}),onDismiss:c.onDismiss,children:(0,F.jsx)(fC,{...l,...s,onPointerDown:Qh(s.onPointerDown,e=>{e.currentTarget.contains(e.target)&&p(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:d,style:{...s.style,userSelect:f?`text`:void 0,WebkitUserSelect:f?`text`:void 0,"--radix-hover-card-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-hover-card-content-available-width":`var(--radix-popper-available-width)`,"--radix-hover-card-content-available-height":`var(--radix-popper-available-height)`,"--radix-hover-card-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-hover-card-trigger-height":`var(--radix-popper-anchor-height)`}})})},`HoverCardContentImpl`));function gD(e){return t=>t.pointerType===`touch`?void 0:e()}QE(gD,`excludeTouch`);function _D(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:QE(e=>e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP,`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}QE(_D,`getTabbableNodes`);var vD=oD,yD=cD,bD=fD,xD=mD,SD=vD,CD=yD,wD=P.forwardRef(({className:e,align:t=`start`,sideOffset:n=8,...r},i)=>(0,F.jsx)(bD,{children:(0,F.jsx)(xD,{ref:i,align:t,sideOffset:n,className:K(`z-50 w-72 rounded-xl border bg-popover p-3 text-popover-foreground shadow-lg outline-none`,`data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0`,e),...r})}));wD.displayName=`HoverCardContent`;function TD({domainId:e,anchor:t,excerpt:n,threads:r,onClose:i}){let a=V(e=>e.domainId),o=e??a??``;return(0,F.jsxs)(`div`,{className:`flex max-h-[calc(var(--radix-popover-content-available-height)-1.5rem)] min-h-0 flex-col gap-2 text-sm`,children:[(0,F.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between`,children:[(0,F.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:r.length>0?`${r.length} comment${r.length===1?``:`s`}`:`New comment`}),(0,F.jsxs)(SD,{openDelay:120,children:[(0,F.jsx)(CD,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,title:`Target`,className:`text-muted-foreground/40 transition-colors hover:text-muted-foreground`,children:(0,F.jsx)(dn,{className:`h-3.5 w-3.5`})})}),(0,F.jsx)(wD,{className:`w-auto max-w-xs`,children:(0,F.jsx)(YE,{items:[{label:`target`,value:t.ref},...n&&n!==t.ref?[{label:`on`,value:n}]:[],...t.file?[{label:`file`,value:t.file}]:[]]})})]})]}),r.length>0&&(0,F.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:r.map(e=>(0,F.jsx)(DD,{domainId:o,comment:e},e.id))}),(0,F.jsx)(kD,{domainId:o,anchor:t,excerpt:n,hasThreads:r.length>0,onClose:i})]})}function ED({domainId:e,commentId:t,entryId:n,text:r}){let i=V(e=>e.domainId),{edit:a}=li(e??i??``),[o,s]=(0,P.useState)(!1),[c,l]=(0,P.useState)(r),u=()=>{let e=c.trim();!e||a.isPending||a.mutate({commentId:t,entryId:n,text:e},{onSuccess:()=>{s(!1),I.success(`Edited`)},onError:e=>I.error(String(e))})};return o?(0,F.jsxs)(`span`,{className:`mt-1 flex items-end gap-1.5`,children:[(0,F.jsx)(tT,{autoFocus:!0,className:`min-h-8 flex-1 text-[13px]`,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),u()):e.key===`Escape`&&(l(r),s(!1))}}),(0,F.jsx)(Jh,{size:`xs`,variant:`secondary`,disabled:!c.trim()||a.isPending,onClick:u,children:`Save`})]}):(0,F.jsxs)(`div`,{className:`group/e relative`,children:[(0,F.jsx)(bh,{text:r}),(0,F.jsx)(`button`,{type:`button`,title:`Edit`,onClick:()=>{l(r),s(!0)},className:`absolute right-0 top-0 inline-flex h-5 w-5 items-center justify-center rounded bg-background/80 text-transparent backdrop-blur-sm transition-colors group-hover/e:text-muted-foreground/50 hover:!text-foreground`,children:(0,F.jsx)(Un,{className:`h-3 w-3`})})]})}function DD({domainId:e,comment:t}){let{reply:n,setStatus:r,remove:i}=li(e),[a,o]=(0,P.useState)(``),s=t.status===`closed`,[c,l]=(0,P.useState)(!s),u=(t.thread.at(-1)?.text??t.thread[0]?.text??``).trim();return(0,P.useEffect)(()=>{l(t.status!==`closed`)},[t.status]),(0,F.jsxs)(`div`,{className:K(`rounded-md border bg-background/40 p-2 space-y-1.5`,s&&`bg-muted/20`),children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(Th,{variant:t.status===`open`?`secondary`:`muted`,children:s?`resolved`:`open`}),t.orphaned&&(0,F.jsx)(Th,{variant:`destructive`,children:`orphaned`}),s&&(0,F.jsxs)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`ml-auto inline-flex h-6 items-center gap-1 rounded-md px-1.5 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:[c?(0,F.jsx)(en,{className:`h-3.5 w-3.5`}):(0,F.jsx)(tn,{className:`h-3.5 w-3.5`}),c?`Hide`:`Show`]}),(0,F.jsx)(`button`,{type:`button`,title:`Delete comment`,disabled:i.isPending,onClick:()=>i.mutate(t.id,{onSuccess:()=>I.success(`Deleted`)}),className:K(`inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground/50 transition-colors hover:bg-destructive/10 hover:text-destructive disabled:opacity-50`,!s&&`ml-auto`),children:(0,F.jsx)(or,{className:`h-3.5 w-3.5`})})]}),s&&!c&&u&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>l(!0),className:`block w-full truncate rounded-sm px-0.5 py-0.5 text-left text-[12px] leading-snug text-muted-foreground/75 hover:text-foreground`,children:u}),(!s||c)&&(0,F.jsx)(`div`,{className:K(`space-y-1`,s&&`opacity-75`),children:t.thread.map((n,r)=>{let i=n.type===`choice`&&!!n.options&&n.role===`author`&&t.status===`open`&&r===t.thread.length-1;return(0,F.jsxs)(`div`,{className:`text-[13px] leading-snug`,children:[(0,F.jsx)(`span`,{className:K(`mb-0.5 block text-[10px] font-medium uppercase`,n.role===`author`?`text-primary`:`text-muted-foreground`),children:n.role===`author`?`agent`:`you`}),(0,F.jsx)(ED,{domainId:e,commentId:t.id,entryId:n.id,text:n.text}),n.type===`choice`&&n.options&&(i?(0,F.jsx)(OD,{commentId:t.id,options:n.options,domainId:e}):(0,F.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:n.options.map(e=>(0,F.jsx)(Th,{variant:n.answer===e?`default`:`outline`,children:e},e))}))]},n.id)})}),t.status===`open`&&(0,F.jsxs)(`div`,{className:`flex items-end gap-1.5 pt-0.5`,children:[(0,F.jsx)(tT,{className:`min-h-8 flex-1 text-[13px]`,placeholder:`Reply…`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&a.trim()&&n.mutate({commentId:t.id,entry:{role:`user`,type:`text`,text:a.trim()}},{onSuccess:()=>o(``)})}}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(Jh,{size:`xs`,variant:`secondary`,disabled:!a.trim()||n.isPending,onClick:()=>n.mutate({commentId:t.id,entry:{role:`user`,type:`text`,text:a.trim()}},{onSuccess:()=>o(``)}),children:`Reply`}),(0,F.jsxs)(Jh,{size:`xs`,onClick:()=>r.mutate({commentId:t.id,status:`closed`},{onSuccess:()=>I.success(`Resolved`)}),children:[(0,F.jsx)($t,{className:`h-3 w-3`}),` Resolve`]})]})]})]})}function OD({commentId:e,options:t,domainId:n}){let{reply:r}=li(n),[i,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(!1),c=t=>{let n=t.trim();!n||r.isPending||r.mutate({commentId:e,entry:{role:`user`,type:`text`,text:n}},{onSuccess:()=>{a(``),s(!1)}})};return(0,F.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1.5`,children:[t.map(e=>(0,F.jsx)(`button`,{type:`button`,disabled:r.isPending,onClick:()=>c(e),className:`rounded-full border border-primary/35 bg-primary/5 px-2.5 py-1 text-[12px] font-medium transition-colors hover:border-primary hover:bg-primary/15 disabled:opacity-50`,children:e},e)),o?(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,F.jsx)(`input`,{autoFocus:!0,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c(i))},placeholder:`Your answer…`,className:`h-7 w-36 rounded-md border bg-background px-2 text-[12px] outline-none focus:border-primary`}),(0,F.jsx)(Jh,{size:`xs`,variant:`secondary`,disabled:!i.trim()||r.isPending,onClick:()=>c(i),children:`Send`})]}):(0,F.jsx)(`button`,{type:`button`,onClick:()=>s(!0),className:`rounded-full border border-dashed px-2.5 py-1 text-[12px] text-muted-foreground transition-colors hover:border-foreground/40 hover:text-foreground`,children:`Other…`})]})}function kD({domainId:e,anchor:t,excerpt:n,hasThreads:r,onClose:i}){let{create:a}=li(e),[o,s]=(0,P.useState)(``),c=()=>{o.trim()&&a.mutate({anchors:[n],anchorRefs:[t],text:o.trim(),firstRole:`user`,type:`text`},{onSuccess:()=>{I.success(`Comment added`),i()},onError:e=>I.error(String(e))})};return(0,F.jsxs)(`div`,{className:`shrink-0 space-y-2 border-t pt-2`,children:[(0,F.jsx)(tT,{autoFocus:!r,className:`min-h-16 text-[13px]`,placeholder:r?`Add another comment…`:`Note for the agent…`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),c())}}),(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,F.jsx)(`span`,{className:`mr-auto text-[10px] text-muted-foreground`,children:`⌘↵ to submit`}),(0,F.jsx)(Jh,{size:`sm`,onClick:c,disabled:!o.trim()||a.isPending,children:`Add comment`})]})]})}function AD(e,t){let n=V(e=>e.domainId),{data:r}=ni(t??n),i=(r?.comments??[]).filter(t=>t.anchorRefs.some(t=>t.ref===e));return{threads:i,status:i.some(e=>e.status===`open`)?`open`:`resolved`,orphaned:i.some(e=>e.orphaned)}}function jD({anchorRef:e,excerpt:t,className:n,domainId:r}){let i=(0,P.useId)(),a=V(e=>e.openAnchorRef),o=V(e=>e.openAnchorId),s=r?`${r}::${e.ref}`:e.ref,c=a===s&&(o===null||o===i),l=V(e=>e.setOpenAnchor),{threads:u,status:d,orphaned:f}=AD(e.ref,r);return u.length===0?null:(0,F.jsxs)(Zw,{modal:!1,open:c,onOpenChange:e=>l(e?s:null,e?i:null),children:[(0,F.jsx)($w,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,"data-anchor-ref":e.ref,"data-domain-id":r,"aria-label":`Comments on ${e.ref}`,onClick:e=>{e.stopPropagation(),l(c?null:s,i)},className:K(`inline-flex shrink-0 align-middle`,n),children:(0,F.jsx)(yE,{count:u.length,status:d,orphaned:f})})}),(0,F.jsx)(eT,{onInteractOutside:e=>e.preventDefault(),className:`max-h-[var(--radix-popover-content-available-height)] overflow-y-auto`,children:(0,F.jsx)(TD,{domainId:r,anchor:e,excerpt:t,threads:u,onClose:()=>l(null)})})]})}function MD(){let e=V(e=>e.commentDraft),t=V(e=>e.setCommentDraft),{threads:n}=AD(e?.anchor.ref??`__none__`,e?.domainId);return e?(0,F.jsxs)(Zw,{modal:!1,open:!0,onOpenChange:e=>{e||t(null)},children:[(0,F.jsx)($w,{asChild:!0,children:(0,F.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none fixed`,style:{left:e.x,top:e.y,width:1,height:1}})}),(0,F.jsx)(eT,{side:`bottom`,align:`start`,sideOffset:6,className:`w-80`,onInteractOutside:e=>e.preventDefault(),children:(0,F.jsx)(TD,{domainId:e.domainId,anchor:e.anchor,excerpt:e.excerpt,threads:n,onClose:()=>t(null)})})]},`${e.anchor.ref}:${e.x}:${e.y}`):null}function ND(e){return/^(class|edge)\./.test(e)?`schema`:/^(module|section|view)\./.test(e)?`section`:e.startsWith(`file.`)?`file`:`free`}function PD(e,t){return`${e}.${t}`}function FD(e){let t=(e.startsWith(`workspace-edge:`)?`edge-${e.split(`:`)[2]??``}`:e.startsWith(`workspace:`)?e.split(`:`).slice(2).join(`:`):e).replace(/^edge-/,``).split(`__`)[0]?.trim();return t?`edge.${t}`:null}function ID(e,t){return{"data-anchor-ref":e,"data-anchor-excerpt":t,"data-commentable":``}}function LD(e,t,n){let r=e.closest(`.react-flow`),i=r?.querySelector(`.react-flow__viewport`);if(!r||!i)return null;let a=r.getBoundingClientRect(),o=getComputedStyle(i).transform,s=0,c=0,l=1;if(o&&o!==`none`)try{let e=new DOMMatrixReadOnly(o);s=e.e,c=e.f,l=e.a||1}catch{return null}let u=(t-a.left-s)/l,d=(n-a.top-c)/l;return!Number.isFinite(u)||!Number.isFinite(d)?null:{x:Math.round(u),y:Math.round(d)}}function RD(e,t,n,r,i){if(!e)return null;let a=e.closest(`[data-domain-id]`)?.dataset.domainId,o=e.closest(`[data-anchor-ref]`);if(o?.dataset.anchorRef){let e=o.dataset.anchorRef,t=(o.dataset.anchorExcerpt||o.textContent||e).trim().slice(0,80);return{mode:n,domainId:o.dataset.domainId??a,anchor:{ref:e,kind:ND(e)},excerpt:t,x:r,y:i}}let s=e.closest(`.react-flow__node`);if(s){let e=s.getAttribute(`data-id`)??``,t=e.startsWith(`workspace:`)?e.split(`:`).slice(2).join(`:`):e;if(t.startsWith(`class.`))return{mode:n,domainId:a,anchor:{ref:t,kind:`schema`},excerpt:t.slice(6),x:r,y:i};if(t.startsWith(`grp-`)){let e=t.slice(4);return{mode:n,domainId:a,anchor:{ref:`module.${e}`,kind:`section`},excerpt:e,x:r,y:i}}}let c=e.closest(`.react-flow__edge`);if(c){let e=c.getAttribute(`data-id`)??``,t=FD(e),o=e.startsWith(`workspace-edge:`)?e.split(`:`)[1]:void 0;if(t)return{mode:n,domainId:o?decodeURIComponent(o):a,anchor:{ref:t,kind:`schema`},excerpt:t.slice(5),x:r,y:i}}if(e.closest(`main`)){let o=LD(e,r,i);return{mode:n,domainId:a,anchor:{ref:`section.${t}`,kind:`section`,...o},excerpt:t,x:r,y:i}}return null}function zD(){let e=V(e=>e.commentMode),t=V(e=>e.askMode),n=V(e=>e.toggleCommentMode),r=V(e=>e.toggleAskMode),i=V(e=>e.setCommentDraft),a=e||t,o=t?`ask`:`comment`;if((0,P.useEffect)(()=>{if(!a)return;let e=document.body.style.cursor;document.body.style.cursor=`crosshair`;let t=()=>V.getState().askMode?r(!1):n(!1),o=e=>{e.preventDefault(),e.stopPropagation();let n=V.getState(),r=n.askMode?`ask`:`comment`,a=RD(e.target,n.section,r,e.clientX,e.clientY);if(t(),a){if(a.mode===`ask`){let e=a.domainId??n.domainId;e&&requestAnimationFrame(()=>xw.getState().start(e,a.anchor,a.excerpt,a.x,a.y))}else requestAnimationFrame(()=>i(a))}},s=e=>{e.key===`Escape`&&(e.preventDefault(),t())};return document.addEventListener(`click`,o,!0),document.addEventListener(`keydown`,s,!0),()=>{document.body.style.cursor=e,document.removeEventListener(`click`,o,!0),document.removeEventListener(`keydown`,s,!0)}},[a,n,r,i]),!a)return null;let s=o===`ask`;return(0,F.jsx)(`div`,{className:`pointer-events-none fixed inset-x-0 top-3 z-50 flex justify-center`,children:(0,F.jsxs)(`div`,{className:K(`flex items-center gap-2 rounded-full border bg-card/95 px-4 py-1.5 text-xs font-medium text-foreground shadow-lg backdrop-blur`,s?`border-violet-400/50`:`border-primary/40`),children:[s?(0,F.jsx)(er,{className:`h-3.5 w-3.5 text-violet-400`}):(0,F.jsx)(Vn,{className:`h-3.5 w-3.5 text-primary`}),(0,F.jsxs)(`span`,{children:[s?`Ask mode — click anything to ask a quick question`:`Comment mode — click anything to comment`,` `,(0,F.jsx)(`kbd`,{className:`ml-1 rounded border bg-muted px-1 py-0.5 text-[10px] text-muted-foreground`,children:`Esc`}),` `,`to exit`]})]})})}var BD=`studio.schemaWorkspace.v1`,VD={selectedDomainIds:[],domainPositions:{},externalPositions:{},domainSizes:{},domainContentOffsets:{},collapsedModules:{}};function HD(e){return[...new Set(e.filter(Boolean))]}function UD(e,t,n){let r=HD(e);return t&&!r.includes(t)&&r.unshift(t),r.length<=1?[n]:(r.includes(n)||r.push(n),r)}function WD(){try{let e=JSON.parse(localStorage.getItem(BD)??`null`);return e?{selectedDomainIds:HD(e.selectedDomainIds??[]),domainPositions:e.domainPositions??{},externalPositions:e.externalPositions??{},domainSizes:e.domainSizes??{},domainContentOffsets:e.domainContentOffsets??{},collapsedModules:e.collapsedModules??{}}:VD}catch{return VD}}function GD(e){try{localStorage.setItem(BD,JSON.stringify(e))}catch{}}function KD(e){return{selectedDomainIds:e.selectedDomainIds,domainPositions:e.domainPositions,externalPositions:e.externalPositions,domainSizes:e.domainSizes,domainContentOffsets:e.domainContentOffsets,collapsedModules:e.collapsedModules}}var qD=WD(),JD=yr(e=>({...qD,replaceDomains:t=>e(e=>{let n=HD(t);return GD({...KD(e),selectedDomainIds:n}),{selectedDomainIds:n}}),toggleDomain:(t,n)=>e(e=>{let r=new Set(e.selectedDomainIds);r.has(t)&&t!==n?r.delete(t):r.add(t),r.add(n);let i=[...r];return GD({...KD(e),selectedDomainIds:i}),{selectedDomainIds:i}}),setDomainPosition:(t,n)=>e(e=>{let r={...e.domainPositions,[t]:n};return GD({...KD(e),domainPositions:r}),{domainPositions:r}}),setDomainSize:(t,n)=>e(e=>{let r={...e.domainSizes,[t]:n};return GD({...KD(e),domainSizes:r}),{domainSizes:r}}),ensureDomainPositions:t=>e(e=>{let n={...e.domainPositions},r=!1;for(let[e,i]of Object.entries(t))n[e]||(n[e]=i,r=!0);return r?(GD({...KD(e),domainPositions:n}),{domainPositions:n}):e}),ensureExternalPositions:t=>e(e=>{let n={...e.externalPositions},r=!1;for(let[e,i]of Object.entries(t))n[e]||(n[e]=i,r=!0);return r?(GD({...KD(e),externalPositions:n}),{externalPositions:n}):e}),ensureDomainContentOffsets:t=>e(e=>{let n={...e.domainContentOffsets},r=!1;for(let[e,i]of Object.entries(t))n[e]||(n[e]=i,r=!0);return r?(GD({...KD(e),domainContentOffsets:n}),{domainContentOffsets:n}):e}),resetWorkspaceFrames:()=>e(e=>(GD({...KD(e),domainPositions:{},externalPositions:{},domainSizes:{}}),{domainPositions:{},externalPositions:{},domainSizes:{}})),toggleModule:(t,n)=>e(e=>{let r=new Set(e.collapsedModules[t]??[]);r.has(n)?r.delete(n):r.add(n);let i={...e.collapsedModules,[t]:[...r]};return GD({...KD(e),collapsedModules:i}),{collapsedModules:i}})})),YD=P.forwardRef(({className:e,type:t,...n},r)=>(0,F.jsx)(`input`,{ref:r,type:t,className:K(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,e),...n}));YD.displayName=`Input`;var XD=/^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/;function ZD(){let{data:e}=zr(),t=V(e=>e.domainId),n=V(e=>e.setDomain),r=V(e=>e.setSection),i=JD(e=>e.selectedDomainIds),a=JD(e=>e.replaceDomains),o=JD(e=>e.toggleDomain),[s,c]=(0,P.useState)(!1),[l,u]=(0,P.useState)(!1),d=e?.find(e=>e.id===t),f=(0,P.useMemo)(()=>new Set((e??[]).map(e=>e.id)),[e]);(0,P.useEffect)(()=>{if(!t||!e)return;let n=i.filter(e=>f.has(e));n.includes(t)||n.unshift(t),(n.length!==i.length||n.some((e,t)=>e!==i[t]))&&a(n)},[t,e,a,i,f]);let p=new Set(i);t&&p.add(t);let m=p.size,h=e=>{a(t?UD([...p],t,e):[e]),n(e),c(!1)};return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(Zw,{open:s,onOpenChange:c,children:[(0,F.jsx)(Qw,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,"data-testid":`domain-selector`,title:`Domain canvas — choose the active domain and optional companions`,className:K(`inline-flex h-8 items-center gap-2 rounded-lg border pl-1.5 pr-2 text-sm font-medium outline-none transition-colors`,m>1?`border-sky-400/35 bg-sky-400/10 text-sky-100 hover:bg-sky-400/15`:`bg-card hover:bg-accent/50`),children:[(0,F.jsx)(`span`,{className:`grid h-5 w-5 place-items-center rounded-md bg-primary/10 text-primary`,children:(0,F.jsx)(Zt,{className:`h-3.5 w-3.5`})}),(0,F.jsx)(`span`,{className:`max-w-[15rem] truncate`,children:d?.origin??`select domain`}),(0,F.jsxs)(`span`,{className:K(`inline-flex h-5 items-center gap-1 rounded-full px-1.5 text-[10px] tabular-nums`,m>1?`bg-sky-300/15 text-sky-100`:`bg-muted text-muted-foreground`),children:[(0,F.jsx)(On,{className:`h-3 w-3`}),` `,m]}),(0,F.jsx)(nn,{className:`h-3.5 w-3.5 text-muted-foreground`})]})}),(0,F.jsxs)(eT,{align:`start`,className:`w-80 p-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-3 px-2 pb-2 pt-1`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Domain canvas`}),(0,F.jsx)(`p`,{className:`mt-0.5 text-[11px] leading-snug text-muted-foreground/70`,children:`Open one domain, then check companions to compose their schemas.`})]}),!!e?.length&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>a(e.map(e=>e.id)),className:`shrink-0 rounded-md px-1.5 py-1 text-[10px] font-medium text-sky-300 hover:bg-sky-400/10`,children:`Select all`})]}),(0,F.jsxs)(`div`,{className:`max-h-[50vh] space-y-0.5 overflow-y-auto`,children:[(e??[]).map(e=>{let n=p.has(e.id),r=e.id===t;return(0,F.jsxs)(`div`,{className:K(`flex items-center gap-1 rounded-md transition-colors`,n?`bg-accent/55`:`hover:bg-accent/35`),children:[(0,F.jsx)(`button`,{type:`button`,role:`checkbox`,"aria-label":r?`${e.origin} is the active domain on canvas`:`${n?`Remove`:`Add`} ${e.origin} ${n?`from`:`to`} canvas`,"aria-checked":n,disabled:r,title:r?`The active domain is always on the canvas`:void 0,onClick:()=>t&&o(e.id,t),className:`group ml-2 grid h-5 w-5 shrink-0 place-items-center rounded border border-border text-transparent transition-colors enabled:hover:border-sky-400/60 disabled:cursor-default`,children:n&&(0,F.jsx)(`span`,{className:`grid h-full w-full place-items-center rounded bg-sky-400/15 text-sky-200`,children:(0,F.jsx)($t,{className:`h-3 w-3`})})}),(0,F.jsxs)(`button`,{type:`button`,"aria-current":r?`true`:void 0,onClick:()=>h(e.id),className:`flex min-w-0 flex-1 items-center gap-2 px-1.5 py-2 text-left`,children:[(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`block truncate text-[13px] font-semibold`,children:e.origin}),(0,F.jsxs)(`span`,{className:`block truncate text-[10px] text-muted-foreground/65`,children:[e.path.split(`/`).pop(),!e.depsInstalled&&` · deps missing`]})]}),r&&(0,F.jsx)(`span`,{className:`rounded-full border border-primary/25 bg-primary/10 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-primary`,children:`active`})]})]},e.id)}),!e?.length&&(0,F.jsx)(`div`,{className:`px-2 py-3 text-center text-[12px] text-muted-foreground`,children:`No domains found`})]}),(0,F.jsx)(`div`,{className:`my-1 h-px bg-border/60`}),t&&m>1&&(0,F.jsxs)(`button`,{type:`button`,onClick:()=>a([t]),className:`flex w-full items-center rounded-md px-2 py-1.5 text-left text-[11px] font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground`,children:[`Show only `,d?.origin??`active domain`]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>{c(!1),u(!0)},className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm font-medium text-primary transition-colors hover:bg-primary/10`,children:[(0,F.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:(0,F.jsx)(Sn,{className:`h-3.5 w-3.5`})}),`Create new domain`]})]})]}),(0,F.jsx)(QD,{open:l,onOpenChange:u,onCreated:e=>{a([e]),n(e),r(`context`)}})]})}function QD({open:e,onOpenChange:t,onCreated:n}){let r=Le(),[i,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(!1),[c,l]=(0,P.useState)(null),u=i.trim().toLowerCase(),d=!!u&&u.length<=64&&XD.test(u),f=u?u.includes(`.`)?u:`${u}.example.dev`:``,p=()=>{a(``),l(null),s(!1)},m=e=>{o||(e||p(),t(e))},h=async()=>{if(!(!d||o)){s(!0),l(null);try{let e=await z.createDomain(u);e.ok&&e.id?(await r.invalidateQueries({queryKey:B.workspace}),n(e.id),I.success(`Created ${e.origin??u}`),p(),t(!1)):l(e.error||`Could not create the domain — check the studio logs.`)}catch(e){l(e?.message??String(e))}finally{s(!1)}}};return(0,F.jsx)(xy,{open:e,onOpenChange:m,children:(0,F.jsxs)(wy,{className:`max-w-md`,children:[(0,F.jsxs)(Ty,{children:[(0,F.jsx)(Dy,{children:`Create a new domain`}),(0,F.jsxs)(Oy,{children:[`Scaffolds a fresh Astrale domain with`,` `,(0,F.jsx)(`span`,{className:`font-mono text-[12px]`,children:`create-astrale-domain`}),` and installs its dependencies.`]})]}),(0,F.jsxs)(`div`,{className:`space-y-3 py-1`,children:[(0,F.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,F.jsx)(`label`,{htmlFor:`new-domain-name`,className:`text-[12px] font-medium text-muted-foreground`,children:`Domain name`}),(0,F.jsx)(YD,{id:`new-domain-name`,autoFocus:!0,value:i,disabled:o,placeholder:`crm`,spellCheck:!1,autoComplete:`off`,className:`font-mono`,onChange:e=>{a(e.target.value),l(null)},onKeyDown:e=>{e.key===`Enter`&&h()}})]}),u&&d&&(0,F.jsxs)(`div`,{className:`space-y-0.5 rounded-lg border bg-muted/30 px-3 py-2 text-[12px] leading-relaxed text-muted-foreground`,children:[(0,F.jsxs)(`div`,{children:[`origin `,(0,F.jsx)(`span`,{className:`font-mono text-foreground`,children:f}),!u.includes(`.`)&&(0,F.jsx)(`span`,{className:`text-muted-foreground/70`,children:` · placeholder, edit later`})]}),(0,F.jsxs)(`div`,{children:[`folder `,(0,F.jsxs)(`span`,{className:`font-mono text-foreground`,children:[u,`/`]}),` · managed (astrale) adapter`]})]}),u&&!d&&(0,F.jsx)(`p`,{className:`text-[12px] text-destructive`,children:`Use lowercase letters, digits, dots and dashes.`}),c&&(0,F.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] leading-relaxed text-destructive`,children:c}),o&&(0,F.jsxs)(`p`,{className:`flex items-center gap-2 text-[12px] text-muted-foreground`,children:[(0,F.jsx)(Pn,{className:`h-3.5 w-3.5 animate-spin`}),` Scaffolding and installing dependencies — this can take a moment…`]})]}),(0,F.jsxs)(Ey,{children:[(0,F.jsx)(Jh,{variant:`ghost`,onClick:()=>m(!1),disabled:o,children:`Cancel`}),(0,F.jsx)(Jh,{onClick:h,disabled:!d||o,children:o?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Pn,{className:`h-4 w-4 animate-spin`}),` Creating…`]}):`Create domain`})]})]})})}function $D({domainId:e}){let{data:t}=ei(e,`dev`),n=V(e=>e.setSettingsOpen),r=t?.requiredMissing??0;return r===0?null:(0,F.jsxs)(`button`,{type:`button`,onClick:()=>n(!0),title:`${r} required env var${r===1?``:`s`} need a value — open Settings → Environment`,className:`inline-flex h-7 items-center gap-1.5 rounded-md border border-destructive/40 bg-destructive/10 px-2 text-xs font-medium text-destructive transition-colors hover:bg-destructive/20`,children:[(0,F.jsx)(Dn,{className:`h-3.5 w-3.5`}),(0,F.jsxs)(`span`,{children:[r,` env`]}),(0,F.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-destructive`})]})}function eO(e,t){return e.declared?!e.optional&&t===``?{dot:`bg-destructive`,label:`required`,tone:`text-destructive`}:t===``?{dot:`bg-muted-foreground/40`,label:`optional`,tone:`text-muted-foreground/60`}:{dot:`bg-emerald-500`,label:`set`,tone:`text-muted-foreground/60`}:{dot:`bg-amber-500`,label:`orphan`,tone:`text-amber-600 dark:text-amber-500`}}var tO=[`dev`,`prod`];function nO({domainId:e}){let[t,n]=(0,P.useState)(`dev`),{data:r,isLoading:i}=ei(e,t),a=Le(),[o,s]=(0,P.useState)({}),[c,l]=(0,P.useState)(()=>new Set);(0,P.useEffect)(()=>{s({}),l(new Set)},[t,e]);let u=$e({mutationFn:()=>z.setEnv(e,t,o),onSuccess:n=>{a.setQueryData(B.env(e,t),n),s({}),I.success(`Saved ${n.file}`)},onError:e=>I.error(String(e))}),d=(r?.rows??[]).filter(e=>o[e.name]!==null),f=Object.keys(o).length>0,p=e=>e.name in o?o[e.name]??``:e.value,m=e=>l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between px-1`,children:[(0,F.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70`,children:`Environment`}),(0,F.jsx)(`div`,{className:`flex items-center gap-0.5 rounded-md border bg-card/40 p-0.5`,children:tO.map(e=>(0,F.jsx)(`button`,{type:`button`,onClick:()=>n(e),className:K(`rounded px-2 py-0.5 text-[11px] font-medium transition-colors`,t===e?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground`),children:e},e))})]}),r&&(0,F.jsxs)(`div`,{className:`mb-1.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 px-1 text-[10px] text-muted-foreground/60`,children:[(0,F.jsx)(`span`,{className:`font-mono`,children:r.file}),!r.exists&&(0,F.jsx)(`span`,{children:`· new on save`}),!r.configured&&(0,F.jsx)(`span`,{className:`text-amber-600 dark:text-amber-500`,children:`· not wired in astrale.config`}),t===`prod`&&r.adapter===`astrale`&&(0,F.jsx)(`span`,{children:"· managed prod → platform store on `pnpm prod`"}),r.requiredMissing>0&&(0,F.jsxs)(`span`,{className:`font-medium text-destructive`,children:[`· `,r.requiredMissing,` required missing`]})]}),(0,F.jsx)(`div`,{className:`divide-y divide-border/50 rounded-lg border bg-card/40`,children:i&&!r?(0,F.jsxs)(`div`,{className:`px-3 py-2.5 text-[12px] text-muted-foreground/70`,children:[`Loading `,t,` env…`]}):d.length===0?(0,F.jsxs)(`div`,{className:`px-3 py-2.5 text-[12px] text-muted-foreground/70`,children:[`No variables declared in env.ts and none set in `,r?.file,`.`]}):d.map(e=>{let t=p(e),n=eO(e,t),r=c.has(e.name);return(0,F.jsxs)(`div`,{className:`space-y-1 px-3 py-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:K(`h-1.5 w-1.5 shrink-0 rounded-full`,n.dot),title:n.label}),(0,F.jsx)(`span`,{className:`truncate font-mono text-[12px]`,children:e.name}),(0,F.jsx)(`span`,{className:K(`shrink-0 text-[10px]`,n.tone),children:n.label}),(0,F.jsxs)(`div`,{className:`ml-auto flex min-w-0 flex-1 items-center gap-1`,children:[(0,F.jsx)(`input`,{type:r?`text`:`password`,value:t,onChange:t=>s(n=>({...n,[e.name]:t.target.value})),placeholder:!e.optional&&e.declared?`required — set a value`:`unset`,spellCheck:!1,autoComplete:`off`,className:`w-full min-w-0 rounded-md border bg-background px-2 py-1 font-mono text-[12px] outline-none placeholder:text-muted-foreground/40 focus:border-primary`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>m(e.name),title:r?`Hide`:`Reveal`,className:`shrink-0 rounded p-1 text-muted-foreground/50 hover:text-foreground`,children:r?(0,F.jsx)(pn,{className:`h-3.5 w-3.5`}):(0,F.jsx)(mn,{className:`h-3.5 w-3.5`})}),!e.declared&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>s(t=>({...t,[e.name]:null})),title:`Remove this variable from the file`,className:`shrink-0 rounded p-1 text-muted-foreground/50 hover:text-destructive`,children:(0,F.jsx)(or,{className:`h-3.5 w-3.5`})})]})]}),e.doc&&(0,F.jsx)(`p`,{className:`pl-3.5 text-[11px] leading-snug text-muted-foreground/70`,children:e.doc})]},e.name)})}),(0,F.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2 px-1`,children:[(0,F.jsxs)(`p`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground/50`,children:[(0,F.jsx)(sr,{className:`h-3 w-3`}),` Plaintext in `,r?.file??`.env.${t}`,` `,`(gitignored) · edits the file, not a deploy`]}),f&&(0,F.jsxs)(`button`,{type:`button`,onClick:()=>u.mutate(),disabled:u.isPending,className:`ml-auto inline-flex items-center gap-1 rounded-md bg-primary px-2.5 py-1 text-[12px] font-medium text-primary-foreground transition-opacity hover:opacity-90 disabled:opacity-50`,children:[u.isPending&&(0,F.jsx)(Pn,{className:`h-3 w-3 animate-spin`}),` Save `,t]})]})]})}function rO(e){if(!e)return{kind:`unknown`,optional:!1};let t=e.type,n=Array.isArray(t)?t.includes(`null`):!1,r=Array.isArray(t)?t.find(e=>e!==`null`):t;if(e.enum)return{kind:`enum`,values:e.enum,optional:n};if(e.$nodeRef)return{kind:`ref`,target:`node`,refKind:`node`,optional:n};if(e.$dataRef)return{kind:`ref`,target:`data`,refKind:`data`,optional:n};if(r===`array`)return{kind:`array`,items:rO(e.items),optional:n};if(r===`object`){let t={};for(let[n,r]of Object.entries(e.properties??{}))t[n]=rO(r);return{kind:`object`,fields:t,required:e.required??[],optional:n}}return r===`string`||r===`number`||r===`integer`||r===`boolean`||r===`null`?{kind:r,optional:n}:{kind:`unknown`,optional:n}}function iO(e){switch(e.kind){case`enum`:return`enum(${e.values.map(String).join(` | `)})`;case`array`:return`${iO(e.items)}[]`;case`object`:return`{ ${Object.keys(e.fields).join(`, `)} }`;case`ref`:return`→${e.target}`;default:return e.kind}}function aO({schema:e,className:t}){let n=rO(e);return(0,F.jsxs)(`span`,{className:K(`font-mono text-xs`,{string:`text-emerald-400`,integer:`text-sky-400`,number:`text-sky-400`,boolean:`text-amber-400`,enum:`text-fuchsia-400`,object:`text-violet-400`,array:`text-violet-400`,ref:`text-rose-400`,unknown:`text-muted-foreground`,null:`text-muted-foreground`}[n.kind]??`text-muted-foreground`,t),children:[iO(n),n.optional&&(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`?`})]})}function oO(e){return e?e.replace(/^sha256:/,``).replace(/^sha-?/,``).slice(0,8):`—`}function sO(e){return e.deployable?e.install===`unknown`?{word:`unreachable`,tone:`text-muted-foreground`,dot:`bg-muted-foreground/40`}:e.install===`not-installed`?{word:`not installed`,tone:`text-warning`,dot:`bg-warning`}:e.drift===`drifted`?{word:`drifted`,tone:`text-warning`,dot:`bg-warning`}:{word:`installed`,tone:`text-success`,dot:`bg-success`}:{word:`local only`,tone:`text-muted-foreground`,dot:`bg-muted-foreground/40`}}function cO({domainId:e}){let{data:t}=ti(e),{data:n}=Hr(e),{data:r}=Vr(),i=Le(),[a,o]=(0,P.useState)(`idle`),[s,c]=(0,P.useState)(null);if(!t)return null;let l=sO(t),u=n?!n.depsInstalled:!1,d=r?.active??null,f=!!t.deployTarget&&!!d&&t.deployTarget!==d;return(0,F.jsxs)(Zw,{onOpenChange:e=>{!e&&a!==`deploying`&&(o(`idle`),c(null))},children:[(0,F.jsx)(Qw,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,title:`Deploy — ${l.word}`,className:`inline-flex h-7 items-center gap-1.5 rounded-md border bg-card px-2 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground`,children:[(0,F.jsx)(cn,{className:`h-3.5 w-3.5`}),(0,F.jsx)(`span`,{children:`Deploy`}),(0,F.jsx)(`span`,{className:K(`h-1.5 w-1.5 rounded-full`,u?`bg-warning`:l.dot)})]})}),(0,F.jsxs)(eT,{align:`end`,className:`w-64 space-y-2.5 p-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70`,children:`Deploy target instance`}),(0,F.jsxs)(`div`,{className:`mt-0.5 flex items-center justify-between gap-2`,children:[(0,F.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:t.deployTarget??`no target`}),(0,F.jsxs)(`span`,{className:K(`inline-flex shrink-0 items-center gap-1 text-xs font-medium`,l.tone),children:[(0,F.jsx)(`span`,{className:K(`h-1.5 w-1.5 rounded-full`,l.dot)}),` `,l.word]})]}),t.deployTarget&&(0,F.jsxs)(`div`,{className:`mt-0.5 text-[10px] text-muted-foreground/60`,children:[`from `,(0,F.jsx)(`code`,{className:`font-mono`,children:`astrale.config.ts`})]})]}),t.drift===`drifted`?(0,F.jsxs)(`div`,{className:`space-y-0.5 font-mono text-[11px]`,children:[(0,F.jsxs)(`div`,{className:`text-warning`,children:[`local `,oO(t.localRevision??``)]}),(0,F.jsxs)(`div`,{className:`text-muted-foreground`,children:[`on instance `,oO(t.installedRevision??``)]})]}):(0,F.jsx)(`div`,{className:`font-mono text-[11px] text-muted-foreground`,children:t.localRevision?oO(t.localRevision):`revision unavailable`}),t.install===`unknown`&&t.deployTarget&&(0,F.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:`Can’t reach it to check status — deploy still works.`}),u&&(0,F.jsx)(`div`,{className:`text-[11px] text-warning`,children:`Dependencies not installed`}),f&&(0,F.jsxs)(`div`,{className:`text-[11px] leading-snug text-muted-foreground`,children:[`Independent of your active instance (`,(0,F.jsx)(`b`,{children:d}),`).`]}),t.deployable?a===`idle`?(0,F.jsxs)(Jh,{size:`sm`,className:`w-full`,onClick:async()=>{o(`deploying`),c(null);try{let t=await z.deployInstance(e);c(t),o(`done`),i.invalidateQueries({queryKey:B.instance(e)}),t.ok?I.success(`Deployed & installed`):I.error(`Deploy failed`)}catch(e){c({ok:!1,url:null,output:String(e)}),o(`done`)}},children:[(0,F.jsx)(cn,{className:`h-3.5 w-3.5`}),` `,t.install===`installed`?`Re-deploy`:`Deploy & install`]}):a===`deploying`?(0,F.jsxs)(Jh,{size:`sm`,className:`w-full`,disabled:!0,children:[(0,F.jsx)(Pn,{className:`h-3.5 w-3.5 animate-spin`}),` Deploying…`]}):(0,F.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,F.jsxs)(`div`,{className:K(`flex items-center gap-1.5 text-xs font-medium`,s?.ok?`text-success`:`text-destructive`),children:[s?.ok?(0,F.jsx)($t,{className:`h-3.5 w-3.5`}):(0,F.jsx)(sr,{className:`h-3.5 w-3.5`}),s?.ok?`Deployed`:`Failed`]}),s?.output&&(0,F.jsx)(`pre`,{className:`max-h-28 overflow-auto whitespace-pre-wrap break-all rounded bg-muted/50 p-1.5 text-[10px] leading-tight text-muted-foreground`,children:s.output.slice(-1200)}),(0,F.jsx)(Jh,{size:`xs`,variant:`outline`,className:`w-full`,onClick:()=>o(`idle`),children:`Done`})]}):null]})]})}function lO(e){let t=e?.trim();if(!t)return null;try{let e=new URL(t);return(e.pathname===`/api`||e.pathname===`/api/`)&&(e.pathname=`/`),e.href.replace(/\/$/,``)}catch{return t.replace(/\/api\/?$/,``)}}function uO(){let{data:e}=Vr(),t=Le(),[n,r]=(0,P.useState)(!1),[i,a]=(0,P.useState)(null),o=e?.active??null,s=e?.instances??[],c=async e=>{if(!(e===o||i)){a(e);try{let n=await z.switchInstance(e);n.ok?(await t.invalidateQueries({queryKey:B.instances}),I.success(`Switched to ${n.active??e}`),r(!1)):I.error(`Couldn't switch: ${n.output.split(`
|
|
80
|
+
`).filter(Boolean).pop()??`failed`}`)}finally{a(null)}}};return(0,F.jsxs)(Zw,{open:n,onOpenChange:r,children:[(0,F.jsx)(`div`,{className:`-ml-1 inline-flex items-center gap-0.5`,children:(0,F.jsx)(Qw,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,title:`Active instance — click to switch`,className:`inline-flex items-center gap-2 rounded-lg px-2 py-1 transition-colors hover:bg-accent/50`,children:[(0,F.jsx)(`span`,{className:`grid h-7 w-7 place-items-center rounded-lg bg-primary/15 text-primary`,children:(0,F.jsx)(Hn,{className:`h-4 w-4`})}),(0,F.jsx)(`span`,{className:`font-semibold tracking-tight`,children:o??`no instance`}),(0,F.jsx)(nn,{className:`h-3.5 w-3.5 text-muted-foreground`})]})})}),(0,F.jsxs)(eT,{align:`start`,className:`w-64 p-1.5`,children:[(0,F.jsx)(`div`,{className:`px-2 py-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Active instance`}),(0,F.jsxs)(`div`,{className:`space-y-0.5`,children:[s.map(e=>{let t=lO(e.url);return(0,F.jsxs)(`div`,{className:K(`flex w-full items-center gap-1 rounded-md transition-colors hover:bg-accent`,e.active&&`bg-accent/40`),children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>c(e.name),className:`flex min-w-0 flex-1 items-center gap-2 px-2 py-1.5 text-left`,children:[(0,F.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:i===e.name?(0,F.jsx)(Pn,{className:`h-3.5 w-3.5 animate-spin text-primary`}):e.active?(0,F.jsx)($t,{className:`h-3.5 w-3.5 text-primary`}):null}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,F.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:t?t.replace(/^https?:\/\//,``):`no URL`})]}),e.kind===`managed`&&(0,F.jsx)(`span`,{className:`shrink-0 text-[9px] uppercase tracking-wide text-muted-foreground/50`,children:`managed`})]}),t&&(0,F.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,title:`Open ${e.name} in a new tab`,className:`mr-1 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-background/60 hover:text-foreground`,children:(0,F.jsx)(fn,{className:`h-3.5 w-3.5`})})]},e.name)}),s.length===0&&(0,F.jsx)(`div`,{className:`px-2 py-3 text-center text-[12px] text-muted-foreground`,children:`No instances found`})]})]})]})}function dO(e,t){if(t)return e.includes(t)?t:t===`max`&&e.includes(`xhigh`)||t===`ultracode`&&e.includes(`xhigh`)?`xhigh`:t===`minimal`&&e.includes(`low`)?`low`:e.includes(`high`)?`high`:e[0]}var fO=[`minimal`,`low`,`medium`,`high`,`xhigh`,`max`,`ultracode`],pO=[`workspace`,`full`];function mO(e,t,n){let r=t.trim().toLowerCase();if(!r)return e;let i={...e},a=n.trim();return a?i[r]=a:delete i[r],i}function hO({text:e}){return(0,F.jsxs)(SD,{openDelay:80,children:[(0,F.jsx)(CD,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,"aria-label":`What's this?`,className:`text-muted-foreground/40 transition-colors hover:text-foreground`,children:(0,F.jsx)(an,{className:`h-3.5 w-3.5`})})}),(0,F.jsx)(wD,{className:`w-auto max-w-xs text-[13px] leading-relaxed text-muted-foreground`,children:e})]})}function gO({selected:e,loadout:t,modelOptions:n,onChange:r}){let i=t?.models??n??[],a=e||t?.model||`harness default`;return(0,F.jsxs)(`div`,{className:`space-y-1.5 px-3 py-2.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[13px]`,children:[(0,F.jsx)(`span`,{children:`Model`}),(0,F.jsx)(hO,{text:`Leave this on Default to preserve the selected harness's own config and account default. An explicit choice is remembered independently for this domain and harness, then passed as --model to normal turns, resumed turns, and Ask forks.`}),(0,F.jsx)(`span`,{className:`ml-auto max-w-[55%] truncate font-mono text-[11px] text-muted-foreground/70`,children:a})]}),(0,F.jsx)(`input`,{"aria-label":`Agent model`,list:i.length>0?`agent-model-options`:void 0,value:e,onChange:e=>r(e.target.value),placeholder:t?.nativeModel?`Default — ${t.nativeModel}`:`Default — choose an alias or type a full model id`,spellCheck:!1,className:`w-full rounded-md border bg-background px-2 py-1 font-mono text-[12px] outline-none focus:border-primary`}),i.length>0&&(0,F.jsx)(`datalist`,{id:`agent-model-options`,children:i.map(e=>(0,F.jsx)(`option`,{value:e.id,label:`${e.label}${e.isDefault?` — catalog default`:``}`},e.id))}),(0,F.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50`,children:e?`Studio override · saved when you press Save`:t?.modelSource===`config`?`Codex effective config`:t?.modelSource==="default"?`Harness catalog default`:t?.modelSource===`runtime`?`Harness runtime default`:`Harness-native selection`})]})}var _O={minimal:`Minimal`,low:`Low`,medium:`Medium`,high:`High`,xhigh:`X-high`,max:`Max`,ultracode:`Ultracode`},vO={workspace:`Workspace`,full:`Full automation`};function yO({value:e,levels:t,onChange:n}){let r=dO(t,e);return(0,F.jsx)(`div`,{className:`grid grid-cols-3 gap-1 rounded-md bg-muted/45 p-1 sm:grid-cols-6`,role:`radiogroup`,"aria-label":`Agent effort`,children:t.map(e=>(0,F.jsx)(`button`,{type:`button`,value:e,title:e===`ultracode`?`Claude: X-high effort plus dynamic workflow orchestration`:void 0,role:`radio`,"aria-checked":r===e,onClick:()=>n(e),className:K(`min-w-0 rounded px-1.5 py-1 text-center text-[11px] font-medium transition-colors`,r===e?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:bg-background/60 hover:text-foreground`),children:_O[e]},e))})}function bO({value:e,levels:t,onChange:n}){let r=pO.includes(e)&&t.includes(e)?e:t.includes(`full`)?`full`:t[0];return(0,F.jsx)(`div`,{className:`grid grid-cols-2 gap-1 rounded-md bg-muted/45 p-1`,role:`radiogroup`,children:t.map(e=>(0,F.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":r===e,onClick:()=>n(e),className:K(`rounded px-2 py-1 text-center text-[11px] font-medium transition-colors`,r===e?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:bg-background/60 hover:text-foreground`),children:vO[e]},e))})}function xO({domainId:e,harness:t}){let{data:n,isFetching:r}=qr(e),i=Le(),[a,o]=(0,P.useState)(``),s=!n?.harness||n.harness===t?.id;(0,P.useEffect)(()=>{if(!e||!t||r||!s){o(``);return}o(n?.sessionId??``)},[e,t?.id,r,s,n?.harness,n?.sessionId]);let c=$e({mutationFn:e=>z.setAgentSession(e.domainId,e.harness,e.sessionId),onSuccess:(e,t)=>{i.setQueryData(B.agentSession(t.domainId),e),i.invalidateQueries({queryKey:B.agent(t.domainId)}),I.success(e.sessionId?`Agent session changed`:`Agent session cleared`)},onError:e=>I.error(String(e))});return(0,F.jsxs)(`div`,{className:`space-y-1.5 px-3 py-2.5`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[13px]`,children:[(0,F.jsx)(`span`,{children:`Session ID`}),(0,F.jsx)(hO,{text:`The agent's resumable conversation id. Paste another to resume that conversation; clear it to start fresh on the next turn. Cannot be changed while a turn is running.`}),n&&(0,F.jsx)(`span`,{className:`ml-auto text-[11px] text-muted-foreground/60`,children:n.sessionId?`${n.turns} turn${n.turns===1?``:`s`}${n.harness?` · ${n.harness}`:``}`:`no active conversation`})]}),(0,F.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),placeholder:`(none — a fresh conversation starts next turn)`,spellCheck:!1,className:`w-full rounded-md border bg-background px-2 py-1 font-mono text-[12px] outline-none focus:border-primary`}),(0,F.jsx)(`div`,{className:`flex justify-end`,children:(0,F.jsx)(`button`,{type:`button`,disabled:!e||!t||r||!s||a.trim()===(n?.sessionId??``)||c.isPending,onClick:()=>c.mutate({domainId:e,harness:t.id,sessionId:a.trim()}),className:`rounded-md px-2.5 py-1 text-[12px] font-medium text-primary transition-colors hover:bg-primary/10 disabled:opacity-40`,children:c.isPending?`Applying…`:`Apply session`})})]})}var SO=[`astrale-cli`,`astrale-domain`,`agent-browser`],CO={"astrale-cli":[`npx skills add astrale-os/cli -g`],"astrale-domain":[`npx skills add astrale-os/cli -g`],"agent-browser":[`npm install -g agent-browser && agent-browser install`,`npx skills add vercel-labs/agent-browser -g`]};function wO({skill:e,domainId:t,expanded:n,onToggle:r}){let{data:i,isLoading:a}=$r(n?t:void 0,n?e.command:void 0),o=e.source===`plugin`?e.plugin??`plugin`:e.source;return(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`button`,{type:`button`,onClick:r,className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left transition-colors hover:bg-muted/40`,title:e.description??e.command,children:[(0,F.jsx)(`span`,{className:K(`h-1.5 w-1.5 shrink-0 rounded-full`,e.loaded?`bg-emerald-500`:`bg-amber-500`),title:e.loaded?`available to the selected harness here`:`installed but disabled here`}),(0,F.jsx)(`span`,{className:`truncate font-mono text-[12px]`,children:e.command}),(0,F.jsx)(`span`,{className:`ml-auto shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground/80`,children:o}),(0,F.jsx)(tn,{className:K(`h-3 w-3 shrink-0 text-muted-foreground/50 transition-transform`,n&&`rotate-90`)})]}),n&&(0,F.jsx)(`div`,{className:`border-t bg-background/60 px-2.5 py-2`,children:a?(0,F.jsx)(`p`,{className:`text-[11px] text-muted-foreground/60`,children:`Loading…`}):i?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words rounded bg-muted/40 p-2 text-[11px] leading-relaxed`,children:i.content}),(0,F.jsx)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-muted-foreground/50`,title:i.path,children:i.path})]}):(0,F.jsx)(`p`,{className:`text-[11px] text-muted-foreground/60`,children:`Couldn't read this skill's SKILL.md.`})})]})}function TO({command:e}){let[t,n]=(0,P.useState)(!1);return(0,F.jsxs)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{I.error(`Copy failed — select the command and copy it manually.`)}},className:`group flex w-full items-center gap-2 rounded bg-muted/40 px-2 py-1 text-left font-mono text-[11px] transition-colors hover:bg-muted`,title:`Copy to clipboard`,children:[(0,F.jsx)(`span`,{className:`truncate`,children:e}),t?(0,F.jsx)($t,{className:`ml-auto h-3 w-3 shrink-0 text-emerald-500`}):(0,F.jsx)(ln,{className:`ml-auto h-3 w-3 shrink-0 text-muted-foreground/50 transition-colors group-hover:text-foreground`})]})}function EO({command:e}){let[t,n]=(0,P.useState)(!1),r=CO[e];return(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r&&n(e=>!e),className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left transition-colors hover:bg-muted/40`,title:`not installed on disk in this workspace — click to see how`,children:[(0,F.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full bg-destructive`,title:`not installed`}),(0,F.jsx)(`span`,{className:`truncate font-mono text-[12px] text-muted-foreground/60 line-through`,children:e}),(0,F.jsx)(`span`,{className:`ml-auto shrink-0 rounded bg-destructive/15 px-1.5 py-0.5 text-[10px] font-medium text-destructive`,children:`not installed`}),r&&(0,F.jsx)(tn,{className:K(`h-3 w-3 shrink-0 text-muted-foreground/50 transition-transform`,t&&`rotate-90`)})]}),t&&r&&(0,F.jsxs)(`div`,{className:`space-y-1.5 border-t bg-background/60 px-2.5 py-2`,children:[(0,F.jsx)(`p`,{className:`text-[11px] text-muted-foreground/70`,children:`Run, then hit re-probe above:`}),r.map(e=>(0,F.jsx)(TO,{command:e},e)),(0,F.jsxs)(`p`,{className:`text-[10px] text-muted-foreground/50`,children:[`Or run `,(0,F.jsx)(`span`,{className:`font-mono`,children:`astrale setup`}),` to equip everything at once.`]})]})]})}function DO({skills:e,domainId:t}){let[n,r]=(0,P.useState)(!1),[i,a]=(0,P.useState)(null),o=new Map(e.map(e=>[e.command,e])),s=new Set(SO),c=e.filter(e=>!s.has(e.command)).sort((e,t)=>Number(e.loaded)-Number(t.loaded)||e.command.localeCompare(t.command));return(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,F.jsx)(`span`,{children:`Skills`}),(0,F.jsxs)(`span`,{className:`ml-auto font-mono text-[11px] text-muted-foreground/80`,children:[e.filter(e=>e.loaded).length,` loaded / `,e.length]})]}),(0,F.jsxs)(`div`,{className:K(`divide-y divide-border/50 overflow-hidden rounded-md border bg-background/40`,n&&`max-h-64 overflow-y-auto`),children:[SO.map(e=>{let n=o.get(e);return n?(0,F.jsx)(wO,{skill:n,domainId:t,expanded:i===e,onToggle:()=>a(t=>t===e?null:e)},e):(0,F.jsx)(EO,{command:e},e)}),n&&c.map(e=>(0,F.jsx)(wO,{skill:e,domainId:t,expanded:i===e.command,onToggle:()=>a(t=>t===e.command?null:e.command)},e.command))]}),c.length>0&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`px-1 text-[11px] text-muted-foreground/60 transition-colors hover:text-foreground`,children:n?`Hide others`:`Show all (${c.length} more)`})]})}function OO({label:e,value:t,title:n,hint:r}){return(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,title:n,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[e,r&&(0,F.jsx)(hO,{text:r})]}),(0,F.jsx)(`span`,{className:`ml-auto truncate font-mono text-[11px]`,children:t})]})}var kO=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e);function AO({domainId:e}){let[t,n]=(0,P.useState)(!1),{data:r,isLoading:i,error:a}=Jr(t?e:void 0);return(0,F.jsxs)(`div`,{className:`space-y-2 px-3 py-2.5 text-[12px]`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[13px]`,children:[(0,F.jsx)(`span`,{children:`Injected system prompt`}),(0,F.jsx)(hO,{text:`The exact developer/system appendix passed to the selected local harness. It is hidden by default because it is long and mostly protocol.`})]}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`ml-auto rounded-md px-1.5 py-0.5 text-[11px] text-muted-foreground/70 transition-colors hover:bg-accent hover:text-foreground`,children:t?`Hide`:`Show`})]}),t&&(0,F.jsx)(`div`,{children:i?(0,F.jsx)(`p`,{className:`text-[11px] text-muted-foreground/70`,children:`Loading…`}):a?(0,F.jsx)(`p`,{className:`text-[11px] text-destructive`,children:String(a?.message??a)}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words rounded bg-muted/40 p-2 font-mono text-[11px] leading-relaxed`,children:r?.systemPrompt??``}),(0,F.jsxs)(`p`,{className:`mt-1 text-[10px] text-muted-foreground/50`,children:[`bridge tools: `,r?.bridge?`enabled`:`disabled`]})]})})]})}function jO({loadout:e,loading:t,errorMessage:n,usage:r,domainId:i,onRefresh:a}){let o=e?.source===`configured`?`What the selected harness has configured or installed for this folder. Codex discovers runtime tools when a turn starts.`:`What the selected harness actually loaded for this folder, probed from its runtime initialization event.`;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(AO,{domainId:i}),(0,F.jsxs)(`div`,{className:`space-y-2 px-3 py-2.5 text-[12px]`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[13px]`,children:[(0,F.jsx)(`span`,{children:`Loaded by the harness`}),(0,F.jsx)(hO,{text:o}),(0,F.jsxs)(`button`,{type:`button`,disabled:t,onClick:a,className:`ml-auto inline-flex items-center gap-1 text-[11px] text-muted-foreground/60 transition-colors hover:text-foreground disabled:opacity-50`,title:`Re-probe`,children:[(0,F.jsx)(qn,{className:K(`h-3 w-3`,t&&`animate-spin`)}),` re-probe`]})]}),n?(0,F.jsx)(`p`,{className:`text-[11px] leading-relaxed text-destructive`,children:n.includes(`404`)?`The studio server predates this feature (no /agent/loadout route). Restart it — bun server/index.ts … — to pick it up.`:n}):t&&!e?(0,F.jsx)(`p`,{className:`text-[11px] text-muted-foreground/70`,children:`Probing the harness…`}):e?.ok?(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(OO,{label:`Model`,value:e.model??`—`}),(0,F.jsx)(OO,{label:`Source`,value:e.source===`configured`?`configured`:`runtime`,title:e.detail}),(0,F.jsx)(OO,{label:`Tools`,value:e.tools.length,title:e.tools.join(`, `)}),(0,F.jsx)(OO,{label:`Subagents`,value:e.agents.length,title:e.agents.join(`, `)}),(0,F.jsx)(DO,{skills:e.skills,domainId:i})]}):(0,F.jsx)(`p`,{className:`text-[11px] text-muted-foreground/70`,children:e?.detail??`Loadout unavailable.`})]}),(0,F.jsxs)(`div`,{className:`space-y-1.5 px-3 py-2.5 text-[12px]`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[13px]`,children:[(0,F.jsx)(`span`,{children:`Usage`}),(0,F.jsx)(hO,{text:`This Studio's agent turns on this domain (succeeded or not). Machine-wide harness totals are out of scope.`}),(0,F.jsx)(`span`,{className:`ml-auto text-[11px] text-muted-foreground/60`,children:`this domain`})]}),(0,F.jsx)(OO,{label:`Turns`,value:r?.runs??0}),(0,F.jsx)(OO,{label:`Tokens`,value:kO(r?.tokens??0)}),(0,F.jsx)(OO,{label:`Cost`,value:`$${(r?.costUsd??0).toFixed(4)}`}),r?.lastTokens!=null&&(0,F.jsx)(OO,{label:`Last turn`,value:`${kO(r.lastTokens)} tok · $${(r.lastCostUsd??0).toFixed(4)}`})]})]})}function MO({domainId:e,settings:t,harness:n,values:r,setValues:i,agentModels:a,setAgentModels:o}){let{data:s,isFetching:c,error:l}=Zr(e),{data:u}=Qr(e),d=Le(),f=n?.capabilities.effortLevels??[...fO],p=n?.capabilities.accessLevels??[...pO],m=dO(f,r.agentEffort??t?.agentEffort),h=$e({mutationFn:e=>z.selectHarness(e.domainId,e.harness),onSuccess:(e,t)=>{d.setQueryData(B.harness(t.domainId),e),d.setQueryData(B.agentSession(t.domainId),void 0),d.setQueryData(B.loadout(t.domainId),void 0),d.invalidateQueries({queryKey:B.harness(t.domainId)}),d.invalidateQueries({queryKey:B.agentSession(t.domainId)}),d.invalidateQueries({queryKey:B.agent(t.domainId)}),d.invalidateQueries({queryKey:B.loadout(t.domainId)}),I.success(`Using ${e.label}`)},onError:e=>I.error(String(e))}),g=$e({mutationFn:e=>z.loadout(e,!0),onSuccess:(e,t)=>d.setQueryData(B.loadout(t),e),onError:e=>I.error(String(e))}),_=n?.options??[{id:`claude`,label:`Claude Code (local)`}],v=n?.id??`claude`,y=a[v]??``;return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`mb-1.5 px-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70`,children:`Agent`}),(0,F.jsxs)(`div`,{className:`divide-y divide-border/50 rounded-lg border bg-card/40`,children:[(0,F.jsxs)(`div`,{className:`space-y-2 px-3 py-2.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 text-[13px]`,children:[(0,F.jsx)(`span`,{className:`truncate`,children:`Harness`}),(0,F.jsx)(hO,{text:`Which installed local coding agent handles Studio turns. Conversations are preserved independently per harness.`})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[n?.locked&&(0,F.jsx)(Fn,{className:`h-3 w-3 shrink-0 text-muted-foreground/40`}),(0,F.jsx)(`select`,{disabled:!e||!n||n.locked||h.isPending,value:n?.id??`claude`,onChange:t=>h.mutate({domainId:e,harness:t.target.value}),className:`w-40 shrink-0 rounded-md border bg-background px-2 py-1 text-[13px] outline-none disabled:cursor-not-allowed disabled:text-muted-foreground`,children:_.map(e=>(0,F.jsx)(`option`,{value:e.id,children:e.label},e.id))})]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px]`,children:[(0,F.jsx)(`span`,{className:K(`h-2 w-2 shrink-0 rounded-full`,n?n.ok?`bg-emerald-500`:`bg-destructive`:`bg-muted-foreground/30`)}),(0,F.jsx)(`span`,{className:K(`truncate`,n&&!n.ok?`font-medium text-destructive`:`text-muted-foreground/70`),children:n?n.message:`Checking…`}),n?.locked&&(0,F.jsx)(`span`,{className:`ml-auto shrink-0 text-muted-foreground/50`,children:`locked by --harness`})]})]}),(0,F.jsx)(gO,{selected:y,loadout:s,modelOptions:n?.capabilities.modelOptions,onChange:e=>o(t=>mO(t,v,e))}),(0,F.jsxs)(`div`,{className:`space-y-1.5 px-3 py-2.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[13px]`,children:[(0,F.jsx)(`span`,{children:`Effort`}),(0,F.jsx)(hO,{text:`Passed using the selected harness's native reasoning-effort setting. Only values supported by that harness are shown.`}),(0,F.jsx)(`span`,{className:`ml-auto font-mono text-[11px] text-muted-foreground/70`,children:m??`high`})]}),(0,F.jsx)(yO,{value:r.agentEffort??t?.agentEffort,levels:f,onChange:e=>i(t=>({...t,agentEffort:e}))})]}),(0,F.jsxs)(`div`,{className:`space-y-1.5 px-3 py-2.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[13px]`,children:[(0,F.jsx)(`span`,{children:`Access`}),(0,F.jsx)(hO,{text:`Workspace keeps the agent sandboxed to local edits. Full automation preserves Studio's deploy/install capability and grants unrestricted local command access.`}),(0,F.jsx)(`span`,{className:`ml-auto font-mono text-[11px] text-muted-foreground/70`,children:r.agentAccess??t?.agentAccess??`full`})]}),(0,F.jsx)(bO,{value:r.agentAccess??t?.agentAccess,levels:p,onChange:e=>i(t=>({...t,agentAccess:e}))})]}),(0,F.jsx)(xO,{domainId:e,harness:n}),(0,F.jsx)(jO,{loadout:s,loading:c||g.isPending,errorMessage:l?String(l?.message??l):void 0,usage:u,domainId:e,onRefresh:()=>g.mutate(e)})]})]})}var NO={introspectTimeoutMs:{min:250,max:3e5},instancePollMs:{min:1e3,max:36e5},updatesPollMs:{min:1e4,max:864e5},viewProbeTimeoutMs:{min:250,max:12e4}};function PO(e,t){if(typeof t!=`number`&&typeof t!=`string`||typeof t==`string`&&!t.trim())return null;let n=typeof t==`number`?t:Number(t),{min:r,max:i}=NO[e];return Number.isInteger(n)&&n>=r&&n<=i?n:null}var FO=[{title:`Detection`,fields:[{key:`integrationsDir`,label:`Integrations folder`,hint:`Folder under the domain root scanned for integrations.`,type:`text`,placeholder:`integrations`}]},{title:`Performance`,fields:[{key:`introspectTimeoutMs`,label:`Schema extraction timeout`,hint:`How long the Bun introspector may run before it is killed (ms). Raise for very large domains.`,type:`number`,placeholder:`20000`},{key:`instancePollMs`,label:`Instance status poll`,hint:`How often the deploy / instance status refreshes (ms). Raise to make fewer CLI calls.`,type:`number`,placeholder:`30000`},{key:`updatesPollMs`,label:`Updates check interval`,hint:`How often the studio re-checks for stale schema / available updates (ms).`,type:`number`,placeholder:`600000`},{key:`viewProbeTimeoutMs`,label:`View URL probe timeout`,hint:`How long to wait when resolving a live view URL from the instance (ms).`,type:`number`,placeholder:`8000`}]}];function IO(e,t){let n={};for(let r of FO)for(let i of r.fields){let r=e[i.key]??``;if(i.type===`number`){let e=PO(i.key,r);if(e===null)throw Error(`${i.label} must be a whole number from ${NO[i.key].min} to ${NO[i.key].max} ms`);n[i.key]=e}else n[i.key]=r.trim()||t[i.key]}return n}function LO({values:e,onChange:t}){return FO.map(n=>(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`mb-1.5 px-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70`,children:n.title}),(0,F.jsx)(`div`,{className:`divide-y divide-border/50 rounded-lg border bg-card/40`,children:n.fields.map(n=>(0,F.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-2`,children:[(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 text-[13px]`,children:[(0,F.jsx)(`span`,{className:`truncate`,children:n.label}),(0,F.jsx)(hO,{text:n.hint})]}),(0,F.jsx)(`input`,{type:n.type,min:n.type===`number`?NO[n.key].min:void 0,max:n.type===`number`?NO[n.key].max:void 0,step:n.type===`number`?1:void 0,value:e[n.key]??``,onChange:e=>t(n.key,e.target.value),placeholder:n.placeholder,className:`w-32 shrink-0 rounded-md border bg-background px-2 py-1 text-right font-mono text-[13px] outline-none focus:border-primary`})]},n.key))})]},n.title))}var RO=typeof window<`u`&&window.self!==window.top,zO={mint:`Auto-mint`,token:`Static token`,host:`Host-managed`},BO=[`mint`,`token`,`host`];function VO({mode:e,setMode:t,instance:n,setInstance:r,token:i,setToken:a,reveal:o,setReveal:s}){return(0,F.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[12px] text-muted-foreground`,children:[`Authentication`,(0,F.jsx)(hO,{text:"How the harness gets its bearer token. Auto-mint: the studio mints a short-lived delegation token per run via `astrale token` (no secret stored) — best for Astrale gateways. Static token: a bearer you paste. Host-managed: the embedding Astrale app supplies it via the shell (used when the studio runs inside the Astrale GUI)."})]}),(0,F.jsx)(`div`,{className:`grid grid-cols-3 gap-1 rounded-md bg-muted/45 p-1`,role:`radiogroup`,"aria-label":`Auth mode`,children:BO.map(n=>(0,F.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e===n,onClick:()=>t(n),className:K(`rounded px-1.5 py-1 text-center text-[11px] font-medium transition-colors`,e===n?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:bg-background/60 hover:text-foreground`),children:zO[n]},n))}),e===`mint`&&(0,F.jsxs)(`div`,{className:`space-y-1 pt-0.5`,children:[(0,F.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`instance to mint on (blank = active instance)`,spellCheck:!1,autoComplete:`off`,className:`w-full rounded-md border bg-background px-2 py-1 font-mono text-[12px] outline-none placeholder:text-muted-foreground/40 focus:border-primary`}),(0,F.jsx)(`p`,{className:`text-[10px] leading-relaxed text-muted-foreground/60`,children:`A fresh delegation token is minted per run (no secret stored). You must be signed in to the instance and have USE on the model node.`})]}),e===`token`&&(0,F.jsxs)(`div`,{className:`space-y-1 pt-0.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(`input`,{type:o?`text`:`password`,value:i,onChange:e=>a(e.target.value),placeholder:`bearer token (e.g. astrale token --audience <gateway-origin>)`,spellCheck:!1,autoComplete:`off`,className:`w-full min-w-0 rounded-md border bg-background px-2 py-1 font-mono text-[12px] outline-none placeholder:text-muted-foreground/40 focus:border-primary`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>s(!o),title:o?`Hide`:`Reveal`,className:`shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground`,children:o?(0,F.jsx)(pn,{className:`h-3.5 w-3.5`}):(0,F.jsx)(mn,{className:`h-3.5 w-3.5`})})]}),(0,F.jsx)(`p`,{className:`text-[10px] leading-relaxed text-muted-foreground/60`,children:`Stored locally in .domain-studio. It will stop working when the token expires.`})]}),e===`host`&&(0,F.jsx)(`p`,{className:`pt-0.5 text-[10px] leading-relaxed text-muted-foreground/60`,children:RO?`The embedding Astrale app supplies (and refreshes) the token via the shell.`:`For when the studio runs embedded in the Astrale GUI — the host then supplies the token via the shell. No effect standalone.`})]})}function HO({status:e,help:t=!1}){return(0,F.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 px-1`,children:[(0,F.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70`,children:`Model gateway`}),t&&(0,F.jsx)(hO,{text:"Route the local Claude Code harness through a custom Anthropic-compatible endpoint (e.g. an Astrale ai-gateway model node) instead of its built-in auth. The URL + token are set as ANTHROPIC_BASE_URL / ANTHROPIC_AUTH_TOKEN on the spawned `claude` child ONLY — never your shell or a `claude` you run outside the studio."}),(0,F.jsx)(`span`,{className:`ml-auto text-[10px] text-muted-foreground/60`,children:e})]})}function UO({label:e,hint:t,value:n,onChange:r,placeholder:i}){return(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[12px] text-muted-foreground`,children:[e,(0,F.jsx)(hO,{text:t})]}),(0,F.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:i,spellCheck:!1,autoComplete:`off`,className:`w-full rounded-md border bg-background px-2 py-1 font-mono text-[12px] outline-none placeholder:text-muted-foreground/40 focus:border-primary`})]})}function WO(e,t,n,r){if(!e)return null;let i=t.trim();if(!i)return`Base URL is required while the custom gateway is enabled.`;try{let e=new URL(i);if(e.protocol!==`http:`&&e.protocol!==`https:`)return`Base URL must use http:// or https://.`}catch{return`Base URL must be a valid URL.`}return n===`token`&&!r.trim()?`A static bearer token is required in token mode.`:null}function GO({domainId:e,harness:t}){let n=t?.capabilities.gateway===`anthropic`,{data:r,isFetching:i}=Xr(n?e:void 0),a=Le(),[o,s]=(0,P.useState)(!1),[c,l]=(0,P.useState)(``),[u,d]=(0,P.useState)(``),[f,p]=(0,P.useState)(RO?`host`:`mint`),[m,h]=(0,P.useState)(``),[g,_]=(0,P.useState)(``),[v,y]=(0,P.useState)(!1),[b,x]=(0,P.useState)(!1);(0,P.useEffect)(()=>{let e=r?.local??r?.global??null;s(e?.enabled??!1),l(e?.baseUrl??``),d(e?.model??``),p(e?.auth.mode??(RO?`host`:`mint`)),h(e?.auth.mode===`mint`?e.auth.instance??``:``),_(e?.auth.mode===`token`?e.auth.token:``),y(r?.local==null&&r?.global!=null),x(!1)},[e,r]);let S=()=>f===`token`?{mode:`token`,token:g.trim()}:f===`host`?{mode:`host`}:{mode:`mint`,...m.trim()?{instance:m.trim()}:{}},C=WO(o,c,f,g),w=$e({mutationFn:e=>z.setHarnessGateway(e.domainId,e.scope,e.config),onSuccess:(e,t)=>{a.invalidateQueries({queryKey:B.harnessGateway(t.domainId)}),a.invalidateQueries({queryKey:B.loadout(t.domainId)}),I.success(t.scope===`global`?`Saved for all domains`:`Saved for this domain`)},onError:e=>I.error(String(e))}),T=$e({mutationFn:e=>z.clearHarnessGateway(e,`domain`),onSuccess:(e,t)=>{a.invalidateQueries({queryKey:B.harnessGateway(t)}),a.invalidateQueries({queryKey:B.loadout(t)}),I.success(`Override removed — inheriting the default`)},onError:e=>I.error(String(e))});if(t&&!n)return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(HO,{status:`not applicable`}),(0,F.jsx)(`div`,{className:`rounded-lg border bg-card/40 px-3 py-2.5 text-[12px] leading-relaxed text-muted-foreground`,children:t.id===`codex`?`Codex uses its own local login. The Astrale gateway currently exposes Chat Completions and Anthropic Messages, while Codex custom providers require the Responses API.`:`${t.label} does not expose a Studio model-gateway adapter.`})]});let E=r?.source??`none`;return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(HO,{status:E===`domain`?`active for this domain`:E===`global`?`inherited from the studio-wide default`:`off — the harness uses its own Claude Code auth`,help:!0}),(0,F.jsxs)(`div`,{className:`space-y-2.5 rounded-lg border bg-card/40 px-3 py-2.5`,children:[(0,F.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-[13px]`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>s(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),(0,F.jsx)(`span`,{children:`Use a custom model gateway`})]}),o&&(0,F.jsxs)(`div`,{className:`space-y-2.5 border-t pt-2.5`,children:[(0,F.jsx)(UO,{label:`Base URL`,hint:"ANTHROPIC_BASE_URL. Claude Code POSTs to `${baseUrl}/v1/messages`. For an Astrale model node: https://<gateway-host>/v1/models/<modelNodeId>. The token audience is derived from this URL's origin.",value:c,onChange:l,placeholder:`https://ai-gateway.astrale.ai/v1/models/<modelNodeId>`}),(0,F.jsx)(UO,{label:`Model label`,hint:"ANTHROPIC_MODEL — shown in the loadout and sent as the request `model`. Cosmetic: an Astrale gateway pins the real model by URL, so this is just a name (e.g. glm-5.2).",value:u,onChange:d,placeholder:`glm-5.2 (optional)`}),(0,F.jsx)(VO,{mode:f,setMode:p,instance:m,setInstance:h,token:g,setToken:_,reveal:b,setReveal:x})]}),(0,F.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 border-t pt-2.5 text-[12px]`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:v,onChange:e=>y(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Apply to all domains`,(0,F.jsx)(hO,{text:`Save as the studio-wide default for every domain (and clear this domain's own override so it inherits it). Off ⇒ this setting applies to THIS domain only. Either way it never leaks outside the studio.`})]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2 pt-0.5`,children:[(0,F.jsx)(`button`,{type:`button`,disabled:!e||!r||i||!!C||w.isPending,onClick:()=>w.mutate({domainId:e,scope:v?`global`:`domain`,config:{enabled:o,baseUrl:c.trim(),model:u.trim()||void 0,auth:S()}}),className:`rounded-md bg-primary px-2.5 py-1 text-[12px] font-medium text-primary-foreground transition-opacity hover:opacity-90 disabled:opacity-50`,children:w.isPending?`Saving…`:v?`Save for all domains`:`Save for this domain`}),r?.local!=null&&(0,F.jsx)(`button`,{type:`button`,disabled:i||T.isPending,onClick:()=>T.mutate(e),className:`rounded-md px-2.5 py-1 text-[12px] text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,title:`Remove this domain's override and inherit the studio-wide default (or default auth)`,children:`Reset to default`})]}),C&&(0,F.jsx)(`p`,{className:`text-[11px] text-destructive`,children:C})]})]})}function KO(){let e=V(e=>e.settingsOpen),t=V(e=>e.setSettingsOpen),n=V(e=>e.domainId),{data:r}=ri(e?n:void 0),{data:i}=Yr(e?n:void 0),a=Le(),[o,s]=(0,P.useState)({}),[c,l]=(0,P.useState)({});(0,P.useEffect)(()=>{r&&(s(Object.fromEntries(Object.entries(r).filter(([,e])=>typeof e!=`object`).map(([e,t])=>[e,String(t)]))),l({...r.agentModels}))},[r]);let u=$e({mutationFn:async e=>{let t=IO(e.values,e.settings),n=e.harness?.capabilities.effortLevels??[...fO],r=e.harness?.capabilities.accessLevels??[...pO],i=dO(n,e.values.agentEffort);i&&(t.agentEffort=i);let a=r.includes(e.values.agentAccess)?e.values.agentAccess:r.includes(`full`)?`full`:r[0];return a&&(t.agentAccess=a),t.agentModels=e.agentModels,z.updateSettings(e.domainId,t)},onSuccess:(e,n)=>{a.invalidateQueries({queryKey:B.settings(n.domainId)}),a.invalidateQueries({queryKey:B.anatomy(n.domainId)}),a.invalidateQueries({queryKey:B.agent(n.domainId)}),a.invalidateQueries({queryKey:B.loadout(n.domainId)}),I.success(`Settings saved`),t(!1)},onError:e=>I.error(String(e))});return(0,F.jsx)(xy,{open:e,onOpenChange:t,children:(0,F.jsxs)(wy,{className:`w-[calc(100%-2rem)] max-w-xl`,children:[(0,F.jsxs)(Ty,{children:[(0,F.jsx)(Dy,{children:`Settings`}),(0,F.jsx)(Oy,{children:`Power-user overrides for this domain — stored in .domain-studio/settings.json.`})]}),(0,F.jsxs)(`div`,{className:`-mx-1 max-h-[60vh] space-y-5 overflow-y-auto px-1`,children:[(0,F.jsx)(MO,{domainId:e?n:void 0,settings:r,harness:i,values:o,setValues:s,agentModels:c,setAgentModels:l}),(0,F.jsx)(GO,{domainId:n,harness:i}),(0,F.jsx)(nO,{domainId:n}),(0,F.jsx)(LO,{values:o,onChange:(e,t)=>s(n=>({...n,[e]:t}))})]}),(0,F.jsxs)(`div`,{className:`flex justify-end gap-2 pt-1`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:`rounded-md px-3 py-1.5 text-[13px] text-muted-foreground transition-colors hover:text-foreground`,children:`Cancel`}),(0,F.jsx)(`button`,{type:`button`,disabled:!n||!r||u.isPending,onClick:()=>u.mutate({domainId:n,settings:r,harness:i,values:{...o},agentModels:{...c}}),className:`rounded-md bg-primary px-3 py-1.5 text-[13px] font-medium text-primary-foreground transition-opacity hover:opacity-90 disabled:opacity-50`,children:`Save`})]})]})})}function qO({domainId:e}){let{data:t}=Kr(e),n=Le(),[r,i]=(0,P.useState)(`idle`),[a,o]=(0,P.useState)(null);if(!t?.stale&&r===`idle`)return null;let{cli:s,sdk:c}=t??{cli:{stale:!1},sdk:{stale:!1,outdated:[]}};return(0,F.jsxs)(Zw,{onOpenChange:e=>{e||(i(`idle`),o(null))},children:[(0,F.jsx)(Qw,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,title:`Update available`,className:`inline-flex h-7 items-center gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-2 text-xs font-medium text-warning transition-colors hover:bg-warning/20`,children:[(0,F.jsx)(rn,{className:`h-3.5 w-3.5`}),(0,F.jsx)(`span`,{children:`Update`}),(0,F.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-warning`})]})}),(0,F.jsxs)(eT,{align:`end`,className:`w-72 space-y-2.5 p-3`,children:[(0,F.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70`,children:`Update available`}),s.stale&&(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-[11px]`,children:[(0,F.jsx)(`span`,{className:`font-medium text-foreground`,children:`Astrale CLI`}),(0,F.jsxs)(`span`,{className:`shrink-0 font-mono text-muted-foreground`,children:[s.current,` → `,s.latest,s.channel?(0,F.jsxs)(`span`,{className:`text-muted-foreground/60`,children:[` (`,s.channel,`)`]}):null]})]}),c.stale&&(0,F.jsxs)(`div`,{className:`space-y-0.5 text-[11px]`,children:[(0,F.jsx)(`div`,{className:`font-medium text-foreground`,children:`SDK packages`}),c.outdated.map(e=>(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 font-mono text-muted-foreground`,children:[(0,F.jsx)(`span`,{className:`truncate`,children:e.pkg}),(0,F.jsxs)(`span`,{className:`shrink-0`,children:[e.current,` → `,e.latest]})]},e.pkg))]}),r===`idle`?(0,F.jsxs)(Jh,{size:`sm`,className:`w-full`,onClick:async()=>{i(`running`),o(null);try{let t=await z.applyUpdate(e);o(t),i(`done`),t.ok?(I.success(`Updated`),n.invalidateQueries({queryKey:B.updates(e)})):I.error(`Update failed`)}catch(e){o({ok:!1,output:String(e)}),i(`done`)}},children:[(0,F.jsx)(rn,{className:`h-3.5 w-3.5`}),` Update now`]}):r===`running`?(0,F.jsxs)(Jh,{size:`sm`,className:`w-full`,disabled:!0,children:[(0,F.jsx)(Pn,{className:`h-3.5 w-3.5 animate-spin`}),` Updating…`]}):(0,F.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,F.jsxs)(`div`,{className:K(`flex items-center gap-1.5 text-xs font-medium`,a?.ok?`text-success`:`text-destructive`),children:[a?.ok?(0,F.jsx)($t,{className:`h-3.5 w-3.5`}):(0,F.jsx)(sr,{className:`h-3.5 w-3.5`}),a?.ok?`Updated`:`Failed`]}),a?.output&&(0,F.jsx)(`pre`,{className:`max-h-32 overflow-auto whitespace-pre-wrap break-all rounded bg-muted/50 p-1.5 text-[10px] leading-tight text-muted-foreground`,children:a.output.slice(-1600)}),(0,F.jsx)(Jh,{size:`xs`,variant:`outline`,className:`w-full`,onClick:()=>i(`idle`),children:`Done`})]})]})]})}function JO(e){let t=(0,P.useRef)(e);(0,P.useEffect)(()=>{t.current=e}),(0,P.useEffect)(()=>{let e=null,n,r=!1,i=1e3,a=()=>{e=new EventSource(`/api/events`),e.onmessage=e=>{i=1e3;try{t.current(JSON.parse(e.data))}catch{}},e.onerror=()=>{e&&e.readyState===EventSource.CLOSED&&!r&&(e.close(),n=setTimeout(a,i),i=Math.min(i*2,15e3))}};return a(),()=>{r=!0,clearTimeout(n),e?.close()}},[])}function YO(){let e=V(e=>e.copyOpen),t=V(e=>e.setCopyOpen),n=V(e=>e.domainId),[r,i]=(0,P.useState)(!1),[a,o]=(0,P.useState)(``),[s,c]=(0,P.useState)(0),[l,u]=(0,P.useState)(!1),[d,f]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{!e||!n||(u(!0),z.copyPayload(n,r).then(e=>{o(e.markdown),c(e.openComments)}).catch(e=>I.error(String(e))).finally(()=>u(!1)))},[e,n,r]),(0,F.jsx)(xy,{open:e,onOpenChange:t,children:(0,F.jsxs)(wy,{className:`max-w-3xl`,children:[(0,F.jsxs)(Ty,{children:[(0,F.jsx)(Dy,{children:`Copy handoff for the agent`}),(0,F.jsxs)(Oy,{children:[s,` open thread`,s===1?``:`s`,` + embedded context and document paths. Paste into Claude Code / Codex.`]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(Jh,{size:`sm`,variant:r?`default`:`outline`,onClick:()=>i(e=>!e),children:r?`Including auto-context`:`Include auto-context`}),(0,F.jsx)(Th,{variant:`muted`,children:`read-only handoff`})]}),(0,F.jsx)(ew,{className:`h-[50vh] rounded-md border bg-muted/40`,children:(0,F.jsx)(`pre`,{className:`p-3 text-xs font-mono whitespace-pre-wrap`,children:l?`Building payload…`:a})}),(0,F.jsx)(Ey,{children:(0,F.jsxs)(Jh,{onClick:async()=>{await navigator.clipboard.writeText(a),f(!0),I.success(`Copied — paste into your terminal agent`),setTimeout(()=>f(!1),1500)},disabled:l||!a,children:[d?(0,F.jsx)($t,{className:`h-4 w-4`}):(0,F.jsx)(sn,{className:`h-4 w-4`}),d?`Copied`:`Copy to clipboard`]})})]})})}function XO(){let e=V(e=>e.mergeOpen),t=V(e=>e.setMergeOpen),n=V(e=>e.domainId),r=Le(),[i,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(!1);return(0,F.jsx)(xy,{open:e,onOpenChange:t,children:(0,F.jsxs)(wy,{className:`max-w-2xl`,children:[(0,F.jsxs)(Ty,{children:[(0,F.jsx)(Dy,{children:`Paste the agent's reply`}),(0,F.jsxs)(Oy,{children:[`Paste the agent's response (prose + its trailing`,` `,(0,F.jsx)(`code`,{className:`font-mono`,children:"```json"}),` block). Threads merge by id.`]})]}),(0,F.jsx)(tT,{className:`min-h-[40vh] text-xs`,placeholder:`Paste the agent reply here…`,value:i,onChange:e=>a(e.target.value)}),(0,F.jsxs)(Ey,{children:[(0,F.jsx)(Jh,{variant:`ghost`,onClick:()=>t(!1),children:`Cancel`}),(0,F.jsxs)(Jh,{onClick:async()=>{if(!(!n||!i.trim())){s(!0);try{let e=await z.mergeReply(n,i);r.invalidateQueries({queryKey:B.comments(n)});let o=[`merged ${e.merged}`,`closed ${e.closed}`];e.unknownIds.length&&o.push(`${e.unknownIds.length} unknown id(s)`),e.schemaMismatch&&o.push(`⚠ authored against an older schema`),I.success(`Reply merged — ${o.join(`, `)}`),a(``),t(!1)}catch(e){I.error(String(e))}finally{s(!1)}}},disabled:o||!i.trim(),children:[(0,F.jsx)(wn,{className:`h-4 w-4`}),` Merge reply`]})]})]})})}function ZO(e){return e===`section.schema`?`Schema canvas`:e.startsWith(`view.`)?`View · ${e.slice(5)}`:e.startsWith(`module.`)?`Module · ${e.slice(7)}`:e.startsWith(`class.`)?`Class · ${e.slice(6)}`:e.startsWith(`edge.`)?`Edge · ${e.slice(5)}`:e.startsWith(`section.`)?e.slice(8).replace(/\./g,` · `):e}function QO({domainId:e}){let{data:t,isLoading:n}=ni(e),[r,i]=(0,P.useState)(`open`),a=V(e=>e.setCopyOpen),o=V(e=>e.setMergeOpen),s=`Pin notes to any element, then Submit to the agent — it edits the code and replies here.`;if(n)return(0,F.jsx)(BE,{title:`Comments`,subtitle:s,icon:(0,F.jsx)(Ln,{className:`h-5 w-5`}),children:(0,F.jsx)(`div`,{className:`flex items-center justify-center py-12 text-sm text-muted-foreground`,children:`Loading comments…`})});let c=t?.comments??[],l=c.filter(e=>e.status===`open`),u=c.filter(e=>e.status===`closed`),d=r===`open`?l:u,f=[{key:`open`,label:`Open`,count:l.length},{key:`closed`,label:`Resolved`,count:u.length}];return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(BE,{title:`Comments`,subtitle:s,icon:(0,F.jsx)(Ln,{className:`h-5 w-5`}),actions:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(Jh,{variant:`outline`,size:`sm`,onClick:()=>a(!0),children:[(0,F.jsx)(sn,{className:`h-3.5 w-3.5`}),`Copy for agent`]}),(0,F.jsxs)(Jh,{variant:`outline`,size:`sm`,onClick:()=>o(!0),children:[(0,F.jsx)(wn,{className:`h-3.5 w-3.5`}),`Merge reply`]}),(0,F.jsx)(`div`,{className:`inline-flex items-center gap-0.5 rounded-lg bg-muted/60 p-0.5`,children:f.map(e=>(0,F.jsxs)(`button`,{type:`button`,onClick:()=>i(e.key),className:K(`inline-flex items-center gap-1.5 rounded-md px-3 py-1 text-[13px] font-medium transition-colors`,r===e.key?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`),children:[e.label,(0,F.jsx)(`span`,{className:K(`text-xs`,r===e.key?`text-muted-foreground`:`text-muted-foreground/60`),children:e.count})]},e.key))})]}),children:d.length===0?(0,F.jsx)(HE,{children:(0,F.jsx)(XE,{icon:(0,F.jsx)(Ln,{}),title:r===`open`?`No open threads`:`No resolved threads yet`,hint:r===`open`?`Hover any element and click the comment icon to start one.`:void 0})}):(0,F.jsx)(`div`,{className:`flex flex-col gap-3`,children:d.map(t=>(0,F.jsx)(ek,{domainId:e,comment:t},t.id))})}),(0,F.jsx)(YO,{}),(0,F.jsx)(XO,{})]})}function $O({entry:e,commentId:t,open:n,isLast:r,domainId:i}){let a=e.role===`author`,o=e.type===`choice`&&!!e.options&&a&&n&&r;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-0.5 text-[13px] leading-relaxed`,children:[(0,F.jsx)(`span`,{className:K(`text-[11px] font-semibold uppercase tracking-wider`,a?`text-primary`:`text-muted-foreground`),children:a?`agent`:`you`}),(0,F.jsx)(ED,{commentId:t,entryId:e.id,text:e.text})]}),e.type===`choice`&&e.options&&(o?(0,F.jsx)(OD,{commentId:t,options:e.options,domainId:i}):(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.options.map(t=>(0,F.jsx)(qE,{tone:e.answer===t?`primary`:`outline`,children:t},t))}))]})}function ek({domainId:e,comment:t}){let{reply:n,setStatus:r,remove:i}=li(e),[a,o]=(0,P.useState)(``),s=t.anchorRefs[0];return(0,F.jsxs)(HE,{className:K(`overflow-hidden`,t.status===`closed`&&`opacity-70`),children:[(0,F.jsx)(GE,{className:`border-b py-3`,leading:(0,F.jsx)(Ln,{className:`h-4 w-4 text-muted-foreground/70`}),trailing:(0,F.jsx)(`button`,{type:`button`,title:`Remove thread`,onClick:()=>i.mutate(t.id,{onSuccess:()=>I.success(`Deleted`)}),className:`inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground/50 opacity-0 transition-all hover:bg-destructive/10 hover:text-destructive group-hover/row:opacity-100`,children:(0,F.jsx)(or,{className:`h-3.5 w-3.5`})}),children:(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-2`,children:[(0,F.jsx)(qE,{tone:t.status===`open`?`primary`:`default`,children:t.status}),t.orphaned&&(0,F.jsx)(qE,{tone:`danger`,children:`orphaned`}),s&&(0,F.jsx)(`span`,{className:`truncate text-xs text-muted-foreground/70`,title:s.ref,children:ZO(s.ref)})]})}),(0,F.jsx)(`div`,{className:`flex flex-col gap-3 px-4 py-3.5`,children:t.thread.map((n,r)=>(0,F.jsx)($O,{entry:n,commentId:t.id,open:t.status===`open`,isLast:r===t.thread.length-1,domainId:e},n.id))}),t.status===`open`&&(0,F.jsxs)(`div`,{className:`flex flex-col gap-2.5 border-t px-4 py-3`,children:[(0,F.jsx)(tT,{className:`min-h-16 resize-none font-sans text-[13px]`,placeholder:`Reply…`,value:a,onChange:e=>o(e.target.value)}),(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r.mutate({commentId:t.id,status:`closed`},{onSuccess:()=>I.success(`Resolved`)}),className:`inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-medium text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground`,children:[(0,F.jsx)($t,{className:`h-3.5 w-3.5`}),`Resolve`]}),(0,F.jsx)(`button`,{type:`button`,disabled:!a.trim()||n.isPending,onClick:()=>n.mutate({commentId:t.id,entry:{role:`user`,type:`text`,text:a.trim()}},{onSuccess:()=>o(``)}),className:`inline-flex items-center gap-1.5 rounded-lg bg-primary/12 px-3 py-1.5 text-[13px] font-medium text-primary transition-colors hover:bg-primary/20 disabled:opacity-50`,children:`Reply`})]})]})]})}function tk(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function nk(e){let t=e.name.toLowerCase(),n=e.type;return/\.pdf$/.test(t)||n===`application/pdf`?{Icon:yn,tint:`bg-red-400/10 text-red-400`,label:`PDF`}:/\.(xlsx?|csv|tsv)$/.test(t)||n.includes(`sheet`)||n===`text/csv`?{Icon:vn,tint:`bg-emerald-400/10 text-emerald-400`,label:/\.csv$/.test(t)?`CSV`:`XLS`}:/\.(md|mdx|markdown)$/.test(t)||n===`text/markdown`?{Icon:En,tint:`bg-sky-400/10 text-sky-400`,label:`MD`}:/\.(docx?|rtf)$/.test(t)||n.includes(`word`)?{Icon:bn,tint:`bg-blue-400/10 text-blue-400`,label:`DOC`}:n.startsWith(`image/`)||/\.(png|jpe?g|gif|webp|svg|avif)$/.test(t)?{Icon:gn,tint:`bg-fuchsia-400/10 text-fuchsia-400`,label:`IMG`}:/\.(json|ya?ml|toml|ts|tsx|js|jsx|py|go|rs|sh|html|css)$/.test(t)||n.includes(`json`)?{Icon:hn,tint:`bg-amber-400/10 text-amber-400`,label:`CODE`}:n.startsWith(`text/`)||/\.(txt|log|env)$/.test(t)?{Icon:yn,tint:`bg-slate-400/10 text-slate-400`,label:`TXT`}:{Icon:xn,tint:`bg-muted text-muted-foreground`,label:(t.split(`.`).pop()??`file`).slice(0,4).toUpperCase()}}var rk=e=>e.type===`text/markdown`||/\.(md|mdx|markdown)$/i.test(e.name),ik=e=>e.type.startsWith(`text/`)||e.type.includes(`json`)||rk(e)||/\.(txt|json|ya?ml|csv|tsv|ts|tsx|js|jsx|html|css|toml|env|log)$/i.test(e.name);function ak(e){return`${e.trim().toLowerCase().replace(/[^a-z0-9\s-]/g,``).replace(/\s+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``).slice(0,60)||`note`}.md`}var ok=e=>ak((e.split(`
|
|
81
|
+
`).map(e=>e.replace(/^#+\s*/,``).trim()).find(Boolean)??``).slice(0,60));function sk({domainId:e}){let{data:t}=si(e),n=Le(),r=()=>n.invalidateQueries({queryKey:B.documents(e)}),[i,a]=(0,P.useState)(!1),[o,s]=(0,P.useState)(null),c=$e({mutationFn:t=>z.uploadDocuments(e,t),onSuccess:e=>{r(),I.success(`Added ${e.length} document${e.length===1?``:`s`}`)},onError:e=>I.error(String(e))}),l=$e({mutationFn:t=>z.deleteDocument(e,t),onSuccess:r}),u=e=>{let t=e?[...e]:[];t.length&&c.mutate(t)},d=(e,t)=>c.mutate([new File([e],t?ak(t):ok(e),{type:`text/markdown`})]),f=e=>{let t=e.dataTransfer.files;if(t?.length){e.preventDefault(),a(!1),u(t);return}if(a(!1),e.target.closest(`textarea, input`))return;let n=e.dataTransfer.getData(`text/plain`);n.trim()&&(e.preventDefault(),d(n))};if(!t)return(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Loading…`});let p=t.length;return(0,F.jsxs)(`div`,{className:`relative h-full`,onDragOver:e=>{Array.from(e.dataTransfer.types).includes(`Files`)&&(e.preventDefault(),a(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||a(!1)},onDrop:f,children:[(0,F.jsx)(`div`,{className:`h-full overflow-y-auto`,children:(0,F.jsxs)(`div`,{className:`mx-auto w-full max-w-3xl space-y-6 px-6 pb-28 pt-10`,children:[(0,F.jsx)(lk,{domainId:e}),p===0?(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsx)(uk,{busy:c.isPending,onText:d,onFiles:u}),(0,F.jsx)(dk,{busy:c.isPending,onFiles:u})]}):(0,F.jsxs)(`div`,{className:`space-y-6`,children:[(0,F.jsx)(uk,{busy:c.isPending,onText:d,onFiles:u}),(0,F.jsx)(`div`,{className:`grid grid-cols-2 gap-2.5 sm:grid-cols-3`,children:t.map(t=>(0,F.jsx)(fk,{domainId:e,doc:t,onEdit:()=>s(t),onDelete:()=>l.mutate(t.id)},t.id))})]})]})}),i&&(0,F.jsx)(`div`,{className:`pointer-events-none absolute inset-0 z-30 flex items-center justify-center bg-background/80 backdrop-blur-sm`,children:(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-3 rounded-2xl border-2 border-dashed border-primary/60 px-16 py-12 text-primary`,children:[(0,F.jsx)(lr,{className:`h-8 w-8`}),(0,F.jsx)(`p`,{className:`text-sm font-medium`,children:`Drop to add`})]})}),o&&(0,F.jsx)(mk,{domainId:e,doc:o,onClose:()=>s(null),onSaved:r})]})}function ck({expanded:e,onClick:t}){let n=e?zn:In,r=e?`Collapse editor`:`Expand editor`;return(0,F.jsx)(`button`,{type:`button`,title:r,"aria-label":r,onClick:t,className:`absolute right-2 top-2 z-10 flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground/60 transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,F.jsx)(n,{className:`h-3.5 w-3.5`})})}function lk({domainId:e}){let[t,n]=(0,P.useState)(``),[r,i]=(0,P.useState)(!1),[a,o]=(0,P.useState)(!1),s=Tr(e),c=Er(e),l=wr(e=>e.setRun),u=Le(),d=Dr(c),f=s.data?.available??!1,p=t.trim().length>0&&!a&&!d&&f,m=async()=>{if(p){o(!0);try{let r=await z.agentSubmit(e,t.trim());if(r.error){I.error(r.error);return}l(r),n(``),I.success(`Sent to the agent`)}catch(e){I.error(String(e))}finally{o(!1),u.invalidateQueries({queryKey:B.agent(e)})}}};return(0,F.jsxs)(`div`,{className:`rounded-2xl border bg-card/50 shadow-sm transition-colors focus-within:border-primary/50`,children:[(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(tT,{autoFocus:!0,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),m())},placeholder:`Tell me what you want to do?`,className:K(`max-h-[65vh] min-h-[120px] resize-y border-0 bg-transparent pr-10 text-[15px] leading-relaxed shadow-none focus-visible:ring-0`,r&&`min-h-[45vh]`)}),(0,F.jsx)(ck,{expanded:r,onClick:()=>i(e=>!e)})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-t px-3 py-2`,children:[(0,F.jsx)(`span`,{className:`text-[11px] text-muted-foreground/50`,children:d?`Agent working…`:f?`⌘↵ to send`:`agent unavailable`}),(0,F.jsxs)(Jh,{size:`sm`,onClick:m,disabled:!p,children:[a||d?(0,F.jsx)(Pn,{className:`h-3.5 w-3.5 animate-spin`}):(0,F.jsx)(Zn,{className:`h-3.5 w-3.5`}),` `,`Send to agent`]})]})]})}function uk({hero:e,busy:t,onText:n,onFiles:r}){let[i,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(!1),c=(0,P.useRef)(null),l=()=>{!i.trim()||t||(n(i),a(``))};return(0,F.jsxs)(`div`,{className:`rounded-2xl border bg-card/50 shadow-sm transition-colors focus-within:border-primary/50`,children:[(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(tT,{autoFocus:e,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),l())},placeholder:e?`Paste anything — notes, specs, decisions…`:`Paste text to save as markdown…`,className:K(`max-h-[65vh] resize-y border-0 bg-transparent pr-10 leading-relaxed shadow-none focus-visible:ring-0`,o?e?`min-h-[45vh] text-[15px]`:`min-h-[32vh]`:e?`min-h-[180px] text-[15px]`:`min-h-[80px]`)}),(0,F.jsx)(ck,{expanded:o,onClick:()=>s(e=>!e)})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-t px-3 py-2`,children:[e?(0,F.jsx)(`span`,{className:`text-[11px] text-muted-foreground/50`,children:`⌘↵ to save`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>c.current?.click(),className:`inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-[13px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:[(0,F.jsx)(lr,{className:`h-4 w-4`}),` `,t?`Uploading…`:`Upload`]}),(0,F.jsx)(`input`,{ref:c,type:`file`,multiple:!0,className:`hidden`,onChange:e=>{r(e.target.files),e.target.value=``}})]}),i.trim()&&(0,F.jsxs)(Jh,{size:`sm`,onClick:l,disabled:t,children:[(0,F.jsx)(un,{className:`h-3.5 w-3.5`}),` Save`]})]})]})}function dk({busy:e,onFiles:t}){let n=(0,P.useRef)(null);return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>n.current?.click(),className:`flex w-full flex-col items-center justify-center gap-2 rounded-2xl border border-dashed py-10 text-muted-foreground transition-colors hover:border-muted-foreground/40 hover:bg-accent/20`,children:[(0,F.jsx)(lr,{className:`h-6 w-6`}),(0,F.jsx)(`p`,{className:`text-[13px]`,children:e?`Uploading…`:`Drop files or browse`}),(0,F.jsx)(`input`,{ref:n,type:`file`,multiple:!0,className:`hidden`,onChange:e=>{t(e.target.files),e.target.value=``}})]})}function fk({domainId:e,doc:t,onEdit:n,onDelete:r}){let i=nk(t);return(0,F.jsxs)(`div`,{className:`group flex flex-col gap-2.5 rounded-xl border bg-card/50 p-3 transition-colors hover:border-muted-foreground/30 hover:bg-accent/30`,children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,F.jsx)(`div`,{className:K(`flex h-9 w-9 items-center justify-center rounded-lg`,i.tint),children:(0,F.jsx)(i.Icon,{className:`h-[18px] w-[18px]`})}),(0,F.jsxs)(`div`,{className:`flex items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100`,children:[ik(t)&&(0,F.jsx)(pk,{title:`Copy`,onClick:async()=>{try{await navigator.clipboard.writeText(await z.docContent(e,t.id)),I.success(`Copied`)}catch{I.error(`Copy failed`)}},children:(0,F.jsx)(ln,{className:`h-3.5 w-3.5`})}),rk(t)&&(0,F.jsx)(pk,{title:`Edit`,onClick:n,children:(0,F.jsx)(Un,{className:`h-3.5 w-3.5`})}),(0,F.jsx)(pk,{title:`Remove`,danger:!0,onClick:r,children:(0,F.jsx)(fr,{className:`h-3.5 w-3.5`})})]})]}),(0,F.jsxs)(`a`,{href:z.docUrl(e,t.id),target:`_blank`,rel:`noreferrer`,className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`truncate text-[13px] font-medium leading-snug`,title:t.name,children:t.name}),(0,F.jsxs)(`div`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:[i.label,` · `,tk(t.size)]})]})]})}function pk({title:e,onClick:t,danger:n,children:r}){return(0,F.jsx)(`button`,{type:`button`,title:e,onClick:t,className:K(`flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground/60 transition-colors`,n?`hover:bg-destructive/10 hover:text-destructive`:`hover:bg-accent hover:text-foreground`),children:r})}function mk({domainId:e,doc:t,onClose:n,onSaved:r}){let[i,a]=(0,P.useState)(null),[o,s]=(0,P.useState)(!1);(0,P.useEffect)(()=>{let n=!0;return a(null),z.docContent(e,t.id).then(e=>n&&a(e)).catch(()=>{n&&(I.error(`Could not load document`),a(``))}),()=>{n=!1}},[e,t.id]);let c=async()=>{if(i!=null){s(!0);try{await z.updateDocument(e,t.id,i),I.success(`Saved`),r(),n()}catch(e){I.error(String(e))}finally{s(!1)}}};return(0,F.jsx)(xy,{open:!0,onOpenChange:e=>!e&&n(),children:(0,F.jsxs)(wy,{className:`max-w-2xl`,children:[(0,F.jsx)(Ty,{children:(0,F.jsx)(Dy,{className:`truncate text-sm`,children:t.name})}),(0,F.jsx)(tT,{autoFocus:!0,value:i??``,disabled:i==null,onChange:e=>a(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),c())},placeholder:i==null?`Loading…`:``,className:`min-h-[50vh] resize-none font-mono text-[12px] leading-relaxed`}),(0,F.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,F.jsx)(`span`,{className:`mr-auto text-[11px] text-muted-foreground/60`,children:`⌘↵ to save`}),(0,F.jsx)(Jh,{variant:`ghost`,size:`sm`,onClick:n,children:`Cancel`}),(0,F.jsx)(Jh,{size:`sm`,onClick:c,disabled:o||i==null,children:o?`Saving…`:`Save`})]})]})})}function hk(e,t,n,r){return e.find(e=>e.owner===t&&e.method===n&&e.ownerKind===r)}function gk(e){let t=e?.auth;return t?t===`anonymous`?{level:`public`,icon:Tn,tone:`sky`,label:`Anonymous`,auth:t,blurb:`The callable contract permits anonymous callers.`}:{level:`secured`,icon:$n,tone:`emerald`,label:t===`authorized`?`Authorized`:`Authenticated`,auth:t,blurb:t===`authorized`?`The callable contract requires authorization.`:`The callable contract requires an authenticated principal.`}:null}var _k={emerald:`text-emerald-400 hover:text-emerald-300`,sky:`text-sky-400 hover:text-sky-300`,amber:`text-amber-400 hover:text-amber-300`,rose:`text-rose-400 hover:text-rose-300`};function vk({method:e,interactive:t=!0}){let n=gk(e);if(!n)return null;let r=n.icon,i=K(`inline-flex items-center justify-center rounded-md transition-colors`,_k[n.tone]);return(0,F.jsxs)(SD,{openDelay:80,children:[(0,F.jsx)(CD,{asChild:!0,children:t?(0,F.jsx)(`button`,{type:`button`,"aria-label":`Authorization: ${n.label}`,className:i,children:(0,F.jsx)(r,{className:`h-3.5 w-3.5`})}):(0,F.jsx)(`span`,{role:`img`,"aria-label":`Authorization: ${n.label}`,className:i,children:(0,F.jsx)(r,{className:`h-3.5 w-3.5`})})}),(0,F.jsx)(wD,{align:`start`,className:`w-96 p-0 overflow-hidden`,children:(0,F.jsx)(yk,{method:e})})]})}function yk({method:e}){let t=gk(e);if(!t)return null;let n=t.icon;return(0,F.jsxs)(`div`,{className:`text-[13px]`,children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-2.5 p-3`,children:[(0,F.jsx)(WE,{tone:t.tone,size:`sm`,children:(0,F.jsx)(n,{})}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,F.jsx)(`span`,{className:`font-semibold text-foreground`,children:t.label})}),(0,F.jsx)(`p`,{className:`mt-1 leading-relaxed text-muted-foreground`,children:t.blurb})]})]}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5 border-t px-3 py-2`,children:(0,F.jsxs)(qE,{tone:`outline`,className:`font-mono`,children:[`auth: `,t.auth]})})]})}function bk(e,t){let n=rO(e),r=t??n.optional;switch(n.kind){case`string`:return{label:`Text`,icon:cr,optional:r};case`number`:case`integer`:return{label:`Number`,icon:En,optional:r};case`boolean`:return{label:`Yes / no`,icon:ar,optional:r};case`enum`:{let e=n.values.map(String);return{label:`One of: ${e.slice(0,3).join(`, `)}${e.length>3?`…`:``}`,icon:Mn,optional:r}}case`array`:return{label:`List`,icon:Nn,optional:r};case`object`:return{label:`Object`,icon:Qt,optional:r};case`ref`:return{label:`Reference`,icon:jn,optional:r};default:return{label:`Value`,icon:on,optional:r}}}function xk(e){return e.inheritance===`sealed`?{icon:Fn,tone:`amber`}:e.inheritance===`abstract`?{icon:Gn,tone:`fuchsia`}:{icon:pr,tone:`violet`}}function Sk(e){if(!e||typeof e!=`object`||Array.isArray(e))return 0;let t=e;return(t.nodes&&typeof t.nodes==`object`&&!Array.isArray(t.nodes)?Object.keys(t.nodes).length:0)+(Array.isArray(t.edges)?t.edges.length:0)}function Ck(e){let t=new Set,n=[];for(let r of e)for(let e of Array.isArray(r.viewFor)?r.viewFor:r.viewFor?[r.viewFor]:[])t.has(e)||(t.add(e),n.push(e));return n}function wk({domainId:e}){let t=Hr(e),n=Ur(e),r=V(e=>e.setSection),i=V(e=>e.focusClass),a=V(e=>e.setPanelOverlay),o=t.data,s=n.data,c=o?.ir??null,l=(0,P.useMemo)(()=>Sk(c?.core),[c?.core]),u=(0,P.useMemo)(()=>{if(!c||!o)return[];let e=[],t=Object.entries(c.functions);t.length>0&&e.push({owner:c.domain,label:`Domain callables`,className:null,fns:t.map(([e,t])=>({owner:c.domain,ownerKind:`function`,name:e,method:t,link:hk(o.overlay.handlerLinks,c.domain,e,`function`)}))});for(let t of Object.values(c.classes)){let n=Object.entries(t.methods??{});if(n.length===0)continue;let r=n.map(([e,n])=>({owner:t.name,ownerKind:`class`,name:e,method:n,link:hk(o.overlay.handlerLinks,t.name,e,`class`)}));e.push({owner:t.name,label:t.name,className:t.name,fns:r})}return e.sort((e,t)=>e.className===null&&t.className!==null?-1:+(e.className!==null&&t.className===null))},[c,o]),d=u.reduce((e,t)=>e+t.fns.length,0),f=s?.views??[],p=(0,P.useMemo)(()=>Ck(f),[f]),m=e=>{r(`schema`),i(`class.${e}`)};return t.isLoading||n.isLoading?(0,F.jsx)(`div`,{className:`flex items-center justify-center p-8 text-sm text-muted-foreground`,children:`Loading…`}):(0,F.jsx)(BE,{title:`Process`,subtitle:`Actions and workflows implementing callable contracts`,icon:(0,F.jsx)(ur,{className:`h-5 w-5`}),children:c?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(VE,{label:`Entrypoints`,children:(0,F.jsxs)(`div`,{className:`space-y-2`,children:[l>0?(0,F.jsxs)(HE,{className:`flex items-center gap-3 border-emerald-500/30 bg-emerald-500/[0.04] px-4 py-3`,children:[(0,F.jsx)(WE,{tone:`emerald`,children:(0,F.jsx)(nr,{})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`div`,{className:`truncate text-sm font-semibold`,children:`Core genesis`}),(0,F.jsxs)(`div`,{className:`mt-0.5 text-[13px] text-muted-foreground`,children:[l,` portable element`,l===1?``:`s`,` installed with the schema`]})]})]}):(0,F.jsxs)(HE,{className:`flex items-center gap-3 px-4 py-3 text-muted-foreground`,children:[(0,F.jsx)(WE,{tone:`muted`,children:(0,F.jsx)(nr,{})}),(0,F.jsx)(`div`,{className:`min-w-0 flex-1 text-[13px]`,children:`No Core genesis data declared in this schema.`})]}),f.length>0&&(0,F.jsxs)(HE,{onClick:()=>{r(`schema`),a(`views`)},className:`flex cursor-pointer items-center gap-3 px-4 py-3 transition-colors hover:bg-accent/50`,children:[(0,F.jsx)(WE,{tone:`sky`,children:(0,F.jsx)(kn,{})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`text-sm font-semibold`,children:[f.length,` view`,f.length===1?``:`s`,` `,(0,F.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`· UI entrypoints`})]}),p.length>0&&(0,F.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:[p.slice(0,8).map(e=>(0,F.jsx)(qE,{tone:`outline`,children:e},e)),p.length>8&&(0,F.jsxs)(qE,{tone:`default`,children:[`+`,p.length-8]})]})]}),(0,F.jsx)(Jt,{className:`h-4 w-4 shrink-0 text-muted-foreground`})]}),(0,F.jsxs)(HE,{className:`flex items-center gap-3 border-dashed px-4 py-3 text-muted-foreground`,children:[(0,F.jsx)(WE,{tone:`muted`,children:(0,F.jsx)(Kn,{})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`div`,{className:`text-sm font-medium text-muted-foreground`,children:`Triggers`}),(0,F.jsx)(`div`,{className:`mt-0.5 text-[13px] text-muted-foreground/70`,children:`On event · polling · cron — wired via the services domain. Not parsed yet.`})]})]})]})}),d===0?(0,F.jsx)(XE,{icon:(0,F.jsx)(ur,{}),title:`No callable contracts yet`,hint:`Add a standalone Function or class Method to the schema to see it here.`}):(0,F.jsx)(VE,{label:`Runtime`,hint:`${d}`,children:(0,F.jsx)(`div`,{className:`space-y-3`,children:u.map(e=>(0,F.jsxs)(HE,{className:`overflow-hidden`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:e.className?()=>m(e.className):void 0,className:K(`flex w-full items-center gap-2.5 px-3 py-2 text-left transition-colors`,e.className&&`hover:bg-accent/40`),children:[(0,F.jsx)(WE,{tone:`muted`,size:`sm`,children:e.className?(0,F.jsx)(Xt,{}):(0,F.jsx)(Qt,{})}),(0,F.jsx)(`span`,{className:`flex-1 truncate text-[13px] font-semibold`,children:e.label}),(0,F.jsxs)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:[e.fns.length,` callable`]})]}),(0,F.jsx)(`div`,{className:`border-t`,children:e.fns.map(e=>(0,F.jsx)(Tk,{fn:e,onClick:e.ownerKind===`class`?()=>m(e.owner):void 0},e.name))})]},e.owner))})})]}):(0,F.jsx)(HE,{className:`px-4 py-3 text-sm text-muted-foreground`,children:`Schema unavailable — install dependencies to see this domain’s callable contracts.`})})}function Tk({fn:e,onClick:t}){let n=e.link?.kind===`workflow`?{icon:ur,tone:`fuchsia`}:e.link?.kind===`action`?{icon:pr,tone:`violet`}:`inheritance`in e.method?xk(e.method):{icon:pr,tone:`violet`},r=n.icon,i=e.link?.kernelCalls??[],a=e.link&&!e.link.implemented;return(0,F.jsx)(GE,{onClick:t,className:`px-3 py-2 border-t first:border-t-0 rounded-none`,leading:(0,F.jsx)(WE,{tone:n.tone,size:`sm`,children:(0,F.jsx)(r,{})}),title:(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`font-semibold`,children:e.name}),(0,F.jsx)(vk,{method:e.method,interactive:!t}),e.link&&(0,F.jsx)(qE,{tone:`primary`,children:e.link.kind}),`static`in e.method&&e.method.static&&(0,F.jsx)(qE,{tone:`default`,children:`static`}),`inheritance`in e.method&&e.method.inheritance===`abstract`&&(0,F.jsx)(qE,{tone:`fuchsia`,children:`contract`}),a&&(0,F.jsx)(qE,{tone:`warning`,children:`needs handler`}),e.link?.unlinked&&(0,F.jsx)(qE,{tone:`default`,children:`unlinked`})]}),trailing:i.length>0?(0,F.jsxs)(`div`,{className:`hidden items-center gap-1 sm:flex`,children:[i.slice(0,3).map(e=>(0,F.jsx)(qE,{tone:`outline`,className:`font-mono`,children:e},e)),i.length>3&&(0,F.jsxs)(qE,{tone:`default`,children:[`+`,i.length-3]})]}):void 0})}var Ek=`modulepreload`,Dk=function(e){return`/`+e},Ok={},kk=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}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Dk(t,n),t=s(t),t in Ok)return;Ok[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Ek,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.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)})},Ak=(0,P.lazy)(()=>kk(async()=>{let{SchemaSection:e}=await import(`./schema-studio-CABpTfvH.js`);return{SchemaSection:e}},__vite__mapDeps([0,1,2])).then(({SchemaSection:e})=>({default:e}))),jk=[{key:`context`,label:`Context`,icon:An},{key:`schema`,label:`Schema`,icon:Hn},{key:`process`,label:`Process`,icon:ur},{key:`comments`,label:`Comments`,icon:Ln}];function Mk({section:e,domainId:t}){switch(e){case`schema`:return(0,F.jsx)(P.Suspense,{fallback:(0,F.jsx)(`div`,{className:`h-full flex items-center justify-center text-muted-foreground`,children:`Loading schema studio…`}),children:(0,F.jsx)(Ak,{domainId:t})});case`context`:return(0,F.jsx)(sk,{domainId:t});case`process`:return(0,F.jsx)(wk,{domainId:t});case`comments`:return(0,F.jsx)(QO,{domainId:t})}}function Nk(){let{data:e}=zr(),t=V(e=>e.domainId),n=V(e=>e.section),r=V(e=>e.setDomain),i=V(e=>e.setSection),a=V(e=>e.setPaletteOpen),o=V(e=>e.setSettingsOpen),s=V(e=>e.commentMode),c=V(e=>e.toggleCommentMode),l=V(e=>e.toggleAskMode),u=ci(),d=wr(e=>e.setRun),f=wr(e=>e.appendEvent),p=Le();(0,P.useEffect)(()=>{if(!t&&e&&e.length){let t=null;try{t=localStorage.getItem(`studio.lastDomain`)}catch{}r(t&&e.some(e=>e.id===t)?t:e[0].id)}},[e,t,r]),JO((0,P.useCallback)(e=>{if(e.type===`hello`){let e=V.getState().domainId;e&&(u(e),p.invalidateQueries({queryKey:B.agent(e)}));return}if(e.type===`workspace`){p.invalidateQueries({queryKey:B.workspace});return}if(e.type===`agent-event`){f(e.domainId,e.runId,e.event);return}if(e.type===`agent-run`){d(e.run),p.invalidateQueries({queryKey:B.agent(e.domainId)});return}if(e.type===`schema-diff`){u(e.domainId),p.invalidateQueries({queryKey:B.workspace});return}`domainId`in e&&e.domainId&&u(e.domainId)},[u,d,f,p]));let{data:m}=Tr(t);(0,P.useEffect)(()=>{m?.run&&d(m.run)},[m,d]),(0,P.useEffect)(()=>{let e=e=>{let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||e.metaKey||e.ctrlKey||e.altKey||(e.key===`c`||e.key===`C`?(e.preventDefault(),c()):(e.key===`a`||e.key===`A`)&&(e.preventDefault(),l()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[c,l]);let{data:h}=ni(t),g=h?.comments.filter(e=>e.status===`open`&&e.thread.at(-1)?.role===`author`).length??0;return e?(0,F.jsxs)(nw,{delayDuration:200,children:[(0,F.jsxs)(`div`,{className:`h-full flex flex-col`,children:[(0,F.jsxs)(`header`,{className:`flex items-center gap-3 px-5 h-14 border-b shrink-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(uO,{}),(0,F.jsx)(ZD,{}),t&&(0,F.jsx)(cO,{domainId:t}),t&&(0,F.jsx)(`button`,{type:`button`,"aria-label":`Settings`,title:`Settings`,onClick:()=>o(!0),className:`flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground/40 transition-colors hover:bg-accent/60 hover:text-foreground`,children:(0,F.jsx)(Qn,{className:`h-4 w-4`})}),t&&(0,F.jsx)(qO,{domainId:t}),t&&(0,F.jsx)($D,{domainId:t})]}),(0,F.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,F.jsxs)(Jh,{variant:`ghost`,size:`sm`,onClick:()=>a(!0),title:`Search (⌘K)`,children:[(0,F.jsx)(Xn,{className:`h-4 w-4`}),(0,F.jsx)(`kbd`,{className:`rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:`⌘K`})]}),(0,F.jsxs)(Jh,{variant:s?`default`:`ghost`,size:`sm`,"aria-label":`Comment mode`,onClick:()=>c(),title:`Comment mode — click any element to comment (C)`,children:[(0,F.jsx)(Rn,{className:`h-4 w-4`}),(0,F.jsx)(`kbd`,{className:K(`rounded px-1.5 py-0.5 text-[10px]`,s?`bg-primary-foreground/20 text-primary-foreground`:`bg-muted text-muted-foreground`),children:`C`})]}),(0,F.jsx)(`div`,{className:`h-5 w-px bg-border mx-0.5`}),(0,F.jsx)(uw,{})]})]}),(0,F.jsxs)(`main`,{className:`flex-1 min-h-0 relative overflow-hidden`,children:[t?(0,F.jsx)(Mk,{section:n,domainId:t}):(0,F.jsx)(`div`,{className:`h-full flex items-center justify-center text-muted-foreground`,children:`No domain selected`}),(0,F.jsx)(`nav`,{className:`absolute bottom-5 left-1/2 -translate-x-1/2 z-40`,children:(0,F.jsx)(`div`,{className:`flex items-center gap-1 rounded-2xl border bg-card/70 px-2 py-2 shadow-2xl shadow-black/40 backdrop-blur-xl`,children:jk.map(e=>{let t=e.icon,r=n===e.key,a=e.key===`comments`?g:0;return(0,F.jsxs)(rw,{children:[(0,F.jsx)(iw,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,"aria-label":e.label,"aria-current":r?`page`:void 0,onClick:()=>i(e.key),className:K(`relative h-11 w-11 rounded-xl flex items-center justify-center transition-all duration-150`,r?`bg-primary/15 text-primary`:`text-muted-foreground hover:-translate-y-1 hover:bg-accent hover:text-foreground`),children:[(0,F.jsx)(t,{className:`h-[19px] w-[19px]`}),a>0&&(0,F.jsx)(`span`,{className:`absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-primary px-1 text-[10px] font-semibold leading-none text-primary-foreground`,children:a>99?`99+`:a}),r&&(0,F.jsx)(`span`,{className:`absolute -bottom-0.5 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full bg-primary`})]})}),(0,F.jsx)(aw,{side:`top`,sideOffset:10,children:e.label})]},e.key)})})})]})]}),(0,F.jsx)(vE,{}),(0,F.jsx)(zD,{}),(0,F.jsx)(MD,{}),(0,F.jsx)(aT,{}),(0,F.jsx)(_w,{}),(0,F.jsx)(KO,{})]}):(0,F.jsx)(`div`,{className:`h-full flex items-center justify-center text-muted-foreground`,children:`Connecting to studio…`})}var Pk=new je({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1,retry:1}}});(0,at.createRoot)(document.getElementById(`root`)).render((0,F.jsx)(P.StrictMode,{children:(0,F.jsxs)(Re,{client:Pk,children:[(0,F.jsx)(Nk,{}),(0,F.jsx)(Lt,{theme:`dark`,position:`bottom-right`,richColors:!0,closeButton:!0})]})}));export{Gr as $,S as $t,nE as A,$t as At,wy as B,Ye as Bt,YE as C,mn as Ct,cE as D,nn as Dt,yE as E,an as Et,eT as F,L as Ft,Ur as G,Be as Gt,Jh as H,Ke as Ht,Qw as I,I as It,li as J,Ne as Jt,Hr as K,Le as Kt,ew as L,rt as Lt,dE as M,Xt as Mt,Zw as N,Jt as Nt,uE as O,tn as Ot,$w as P,qt as Pt,Wr as Q,x as Qt,tw as R,qe as Rt,WE as S,hn as St,HE as T,fn as Tt,K as U,Ge as Ut,Dy as V,We as Vt,V as W,Ue as Wt,ii as X,N as Xt,ni as Y,ve as Yt,ai as Z,l as Zt,CD as _,Vn as _t,hk as a,Mr as at,XE as b,On as bt,iO as c,z as ct,PD as d,sr as dt,r as en,oi as et,jD as f,tr as ft,wD as g,Hn as gt,SD as h,Wn as ht,vk as i,Lr as it,fE as j,Zt as jt,rE as k,en as kt,JD as l,B as lt,TD as m,qn as mt,bk as n,Ir as nt,aO as o,jr as ot,AD as p,Xn as pt,Br as q,Fe as qt,xk as r,Rr as rt,rO as s,Pr as st,kk as t,zr as tt,ID as u,fr as ut,qE as v,Ln as vt,GE as w,pn as wt,VE as x,Tn as xt,JE as y,Pn as yt,xy as z,Xe as zt};
|