wizards 0.5.11 → 0.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/runtime/dist/browser/fast/action-space.js +0 -2
- package/apps/runtime/dist/cli/mcp.js +2 -15
- package/apps/runtime/dist/cli/report.js +2 -15
- package/apps/runtime/dist/cli/start.js +28 -14
- package/apps/runtime/dist/cli/status.js +1 -1
- package/apps/runtime/dist/credits/credits.js +0 -3
- package/apps/runtime/dist/db/client.js +0 -7
- package/apps/runtime/dist/db/control-schema.js +10 -0
- package/apps/runtime/dist/db/migrations/control/0010_tan_snowbird.sql +6 -0
- package/apps/runtime/dist/db/migrations/control/meta/0010_snapshot.json +600 -0
- package/apps/runtime/dist/db/migrations/control/meta/_journal.json +7 -0
- package/apps/runtime/dist/db/migrations/tenant/0016_even_trish_tilby.sql +12 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0016_snapshot.json +3326 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +7 -0
- package/apps/runtime/dist/db/schema.js +20 -0
- package/apps/runtime/dist/docs/user/build-a-wizard.md +1 -1
- package/apps/runtime/dist/engine/runner.js +31 -10
- package/apps/runtime/dist/engine/steps.js +15 -4
- package/apps/runtime/dist/harness/index.js +0 -4
- package/apps/runtime/dist/manage.js +7 -7
- package/apps/runtime/dist/model-errors.js +20 -7
- package/apps/runtime/dist/plugins/pro.js +0 -6
- package/apps/runtime/dist/render/convert.js +0 -3
- package/apps/runtime/dist/routes/runs.js +170 -23
- package/apps/runtime/dist/routes/studio.js +83 -9
- package/apps/runtime/dist/services/api.js +8 -6
- package/apps/runtime/dist/services/cloud.js +1 -0
- package/apps/runtime/dist/services/spaces.js +1 -0
- package/apps/runtime/dist/services/translations.js +303 -0
- package/apps/runtime/dist/services/wizards.js +3 -1
- package/apps/runtime/dist/store/index.js +0 -11
- package/apps/runtime/dist/texts.js +47 -39
- package/apps/web/dist/assets/{AboutDialog-L1hcshAX.js → AboutDialog-CkE7uZNL.js} +1 -1
- package/apps/web/dist/assets/{ChangelogDialog-DZLYVOkl.js → ChangelogDialog-BCS3WIRA.js} +1 -1
- package/apps/web/dist/assets/ChatView-DClGzMte.js +10 -0
- package/apps/web/dist/assets/EditorPage-Dg27sIZ7.js +3 -0
- package/apps/web/dist/assets/{FlowPreview-CTEJi5TQ.js → FlowPreview-D2haAZwo.js} +1 -1
- package/apps/web/dist/assets/{Harness-CApAHvJE.js → Harness-CGI6ZMTA.js} +2 -2
- package/apps/web/dist/assets/{NewWizardChannels-tst10rkV.js → NewWizardChannels-C4b_phHw.js} +1 -1
- package/apps/web/dist/assets/{NewWizardPage-BAKaUY1g.js → NewWizardPage-DhDXrjKX.js} +2 -2
- package/apps/web/dist/assets/OnboardingPage-DgySdBgo.js +1 -0
- package/apps/web/dist/assets/ProjectPage-dvtJn_3c.js +1 -0
- package/apps/web/dist/assets/PublicRunner-lP4sVF1q.js +1 -0
- package/apps/web/dist/assets/{ReadOnly-Bb8khbuH.js → ReadOnly-B-4l3bVt.js} +1 -1
- package/apps/web/dist/assets/RunDrawer-B2bsB9Z6.js +4 -0
- package/apps/web/dist/assets/RunnerView-BZ83HUnO.js +1 -0
- package/apps/web/dist/assets/SettingsPage-C0_wAa_j.js +1 -0
- package/apps/web/dist/assets/SetupPage-kuvBk0G0.js +1 -0
- package/apps/web/dist/assets/{SharePage-Bb-BIvAX.js → SharePage-COLVxXMI.js} +1 -1
- package/apps/web/dist/assets/changelog-CIYdRaa5.js +1 -0
- package/apps/web/dist/assets/{esm-pbWES-Cu.js → esm-BqbWrbsa.js} +1 -1
- package/apps/web/dist/assets/index-Da9Pvzpj.js +14 -0
- package/apps/web/dist/assets/index-DaKjB676.css +1 -0
- package/apps/web/dist/assets/{lock-C6LaSCq_.js → lock-BkN0Fai6.js} +1 -1
- package/apps/web/dist/assets/{phone-BUWpzNWn.js → phone-Dip_wSUZ.js} +1 -1
- package/apps/web/dist/assets/{settings-menu-yO8b8LjQ.js → settings-menu-B7eXkvba.js} +1 -1
- package/apps/web/dist/assets/ui-B9AOCT0v.js +134 -0
- package/apps/web/dist/assets/{upload-D89fyY2-.js → upload-DPQ4pwnl.js} +1 -1
- package/apps/web/dist/index.html +3 -3
- package/apps/web/dist/mcp/flow.html +54 -54
- package/node_modules/@engenty-wizards/plugin-sdk/dist/thread.js +34 -34
- package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +19 -6
- package/node_modules/@engenty-wizards/shared/dist/definition.js +51 -10
- package/node_modules/@engenty-wizards/shared/dist/features.d.ts +0 -1
- package/node_modules/@engenty-wizards/shared/dist/features.js +0 -1
- package/node_modules/@engenty-wizards/shared/dist/marketplace.d.ts +0 -5
- package/node_modules/@engenty-wizards/shared/dist/marketplace.js +0 -5
- package/node_modules/@engenty-wizards/shared/dist/providers.d.ts +1 -1
- package/node_modules/@engenty-wizards/shared/dist/providers.js +1 -1
- package/node_modules/@engenty-wizards/shared/dist/run.d.ts +46 -4
- package/node_modules/@engenty-wizards/shared/dist/run.js +24 -9
- package/node_modules/@engenty-wizards/shared/dist/runner-texts.d.ts +506 -0
- package/node_modules/@engenty-wizards/shared/dist/runner-texts.js +483 -0
- package/node_modules/@engenty-wizards/shared/dist/texts.d.ts +11 -2
- package/node_modules/@engenty-wizards/shared/dist/texts.js +16 -8
- package/node_modules/@engenty-wizards/shared/dist/translation.d.ts +23 -0
- package/node_modules/@engenty-wizards/shared/dist/translation.js +154 -0
- package/package.json +1 -1
- package/apps/web/dist/assets/ChatView-GNHi9ZnZ.js +0 -10
- package/apps/web/dist/assets/EditorPage-COJunH8K.js +0 -3
- package/apps/web/dist/assets/OnboardingPage-Di8AuZj_.js +0 -1
- package/apps/web/dist/assets/ProjectPage-DaerYm8A.js +0 -1
- package/apps/web/dist/assets/PublicRunner-Hms0Vi88.js +0 -1
- package/apps/web/dist/assets/RunDrawer-DWaC_ryo.js +0 -4
- package/apps/web/dist/assets/RunnerView-D5BQ99ah.js +0 -1
- package/apps/web/dist/assets/SettingsPage-CQX6fKsa.js +0 -1
- package/apps/web/dist/assets/SetupPage-BZkbpN_V.js +0 -1
- package/apps/web/dist/assets/changelog-BUHje4CT.js +0 -1
- package/apps/web/dist/assets/index-BVWLhiGX.js +0 -14
- package/apps/web/dist/assets/index-DmQEcSlY.css +0 -1
- package/apps/web/dist/assets/ui-i5saQjmD.js +0 -134
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/fluffy-engenty-ClRou7yu.js","assets/rolldown-runtime-hePW80VL.js","assets/jsx-runtime-BNakU3Ej.js","assets/engenty-eXZ-EAwd.js","assets/AboutDialog-L1hcshAX.js","assets/ui-i5saQjmD.js","assets/preload-helper-CNEI7N0N.js","assets/settings-menu-yO8b8LjQ.js","assets/ChangelogDialog-DZLYVOkl.js","assets/FlowPreview-CTEJi5TQ.js","assets/esm-pbWES-Cu.js","assets/PublicRunner-Hms0Vi88.js","assets/ChatView-GNHi9ZnZ.js","assets/phone-BUWpzNWn.js","assets/RunnerView-D5BQ99ah.js","assets/SharePage-Bb-BIvAX.js","assets/EditorPage-COJunH8K.js","assets/RunDrawer-DWaC_ryo.js","assets/upload-D89fyY2-.js","assets/lock-C6LaSCq_.js","assets/NewWizardChannels-tst10rkV.js","assets/OnboardingPage-Di8AuZj_.js","assets/NewWizardPage-BAKaUY1g.js","assets/SettingsPage-CQX6fKsa.js","assets/ReadOnly-Bb8khbuH.js","assets/Harness-CApAHvJE.js","assets/Harness-BrP-ENHg.css","assets/ProjectPage-DaerYm8A.js","assets/SetupPage-BZkbpN_V.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{n as r,t as i}from"./jsx-runtime-BNakU3Ej.js";import{$ as a,An as o,Ar as s,At as c,B as l,Bn as u,Br as d,C as f,Cr as p,Dn as m,Dr as h,Dt as g,En as _,Er as v,Fn as y,Fr as b,G as ee,Gn as te,Gr as x,Gt as S,Hr as C,Ht as ne,In as re,Ir as ie,J as w,Jn as ae,Jt as oe,K as se,Kt as ce,Ln as le,Lr as ue,Lt as de,Mr as fe,Mt as T,Nn as pe,Nr as me,Nt as he,Or as ge,Ot as _e,Pr as ve,Pt as ye,Q as be,Qn as xe,Rn as Se,Rr as E,Rt as D,Sr as Ce,Tn as we,Tr as Te,Un as Ee,Ur as De,Ut as O,Vn as Oe,Vr as ke,Vt as Ae,W as k,Wr as je,X as Me,Xn as Ne,Xt as Pe,Y as Fe,Yn as Ie,Yt as A,Z as Le,Zn as Re,Zt as ze,_r as Be,an as Ve,ar as He,br as Ue,bt as We,c as Ge,cn as Ke,cr as j,d as qe,dr as Je,fr as Ye,gr as Xe,hr as Ze,i as Qe,in as $e,jn as et,jr as tt,jt as nt,kr as M,kt as rt,l as it,ln as at,lr as ot,mr as st,n as ct,nr as lt,o as ut,or as dt,ot as ft,p as pt,pr as mt,q as ht,qn as gt,qt as _t,r as vt,rr as yt,s as bt,sn as xt,t as St,tr as Ct,ur as wt,vn as Tt,vr as Et,wr as Dt,xr as Ot,yr as kt,yt as At,zn as jt,zr as Mt}from"./ui-i5saQjmD.js";import{t as Nt}from"./preload-helper-CNEI7N0N.js";import{c as Pt,l as Ft,t as It,u as Lt}from"./engenty-eXZ-EAwd.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 Rt=class extends Ce{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Dt(t,n.data),hasPreviousPage:Te(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},zt=class extends v{#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||Bt(),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.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=h({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)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),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:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}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.#r===r&&(this.#r=void 0),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),M.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Bt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Vt=class extends tt{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new zt({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=Ht(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=Ht(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=Ht(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=Ht(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){M.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=>ie(t,e))}findAll(e={}){return this.getAll().filter(t=>ie(e,t))}notify(e){M.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return M.batch(()=>Promise.all(e.map(e=>e.continue().catch(E))))}};function Ht(e){return e.options.scope?.id}var Ut=class extends tt{#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),ke(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&me(t.mutationKey)!==me(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}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??Bt();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){M.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)})})}},Wt=class extends tt{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??ve(r,t),a=this.get(i);return a||(a=new p({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){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){M.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=>ue(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ue(e,t)):t}notify(e){M.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){M.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){M.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Gt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Wt,this.#t=e.mutationCache||new Vt,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=s.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ge.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(d(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=fe(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return M.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;M.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return M.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=M.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(E).catch(E)}invalidateQueries(e,t={}){return M.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=M.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(E)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(E)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(d(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(d(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(E).catch(E)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(E).catch(E)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ge.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(me(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Mt(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(me(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Mt(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||=ve(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===De&&(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()}},N=t(r(),1);function Kt(e,t){let n=x(t),[r]=N.useState(()=>new Ut(n,e));N.useEffect(()=>{r.setOptions(e)},[r,e]);let i=N.useSyncExternalStore(N.useCallback(e=>r.subscribe(M.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=N.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(E)},[r]);if(i.error&&C(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function qt(e,t){return Ot(e,Rt,t)}var Jt=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 ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,te||(te=!0,ie());else{var t=n(l);t!==null&&oe(ee,t.startTime-e)}}}var te=!1,x=-1,S=5,C=-1;function ne(){return g?!0:!(e.unstable_now()-C<S)}function re(){if(g=!1,te){var t=e.unstable_now();C=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(x),x=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ne());){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&&oe(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ie():te=!1}}}var ie;if(typeof y==`function`)ie=function(){y(re)};else if(typeof MessageChannel<`u`){var w=new MessageChannel,ae=w.port2;w.port1.onmessage=re,ie=function(){ae.postMessage(null)}}else ie=function(){_(re,0)};function oe(t,n){x=_(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`):S=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(x),x=-1):h=!0,oe(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,te||(te=!0,ie()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Yt=n(((e,t)=>{t.exports=Jt()})),Xt=n((e=>{var t=Yt(),n=r(),i=kt();function a(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 o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function c(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 l(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 u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function h(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var y=null,b=null;function ee(e,t,n){return e===n||e===t&&(y=e,!0)}function te(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function x(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function S(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var C=Object.assign,ne=Symbol.for(`react.element`),re=Symbol.for(`react.transitional.element`),ie=Symbol.for(`react.portal`),w=Symbol.for(`react.fragment`),ae=Symbol.for(`react.strict_mode`),oe=Symbol.for(`react.profiler`),se=Symbol.for(`react.consumer`),ce=Symbol.for(`react.context`),le=Symbol.for(`react.forward_ref`),ue=Symbol.for(`react.suspense`),de=Symbol.for(`react.suspense_list`),fe=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),pe=Symbol.for(`react.activity`),me=Symbol.for(`react.legacy_hidden`),he=Symbol.for(`react.memo_cache_sentinel`),ge=Symbol.for(`react.view_transition`),_e=Symbol.for(`react.recoverable`),ve=Symbol.iterator;function ye(e){return typeof e!=`object`||!e?null:(e=ve&&e[ve]||e[`@@iterator`],typeof e==`function`?e:null)}var be=Symbol.for(`react.client.reference`);function xe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===be?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case w:return`Fragment`;case oe:return`Profiler`;case ae:return`StrictMode`;case ue:return`Suspense`;case de:return`SuspenseList`;case pe:return`Activity`;case ge:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case ie:return`Portal`;case ce:return e.displayName||`Context`;case se:return(e._context.displayName||`Context`)+`.Consumer`;case le:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case fe:return t=e.displayName||null,t===null?xe(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}var Se=Array.isArray,E=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ce={pending:!1,data:null,method:null,action:null},we=[],Te=-1;function Ee(e){return{current:e}}function De(e){0>Te||(e.current=we[Te],we[Te]=null,Te--)}function O(e,t){Te++,we[Te]=e.current,e.current=t}var Oe=Ee(null),ke=Ee(null),Ae=Ee(null),k=Ee(null);function je(e,t){switch(O(Ae,t),O(ke,e),O(Oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}De(Oe),O(Oe,e)}function Me(){De(Oe),De(ke),De(Ae)}function Ne(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,O(k,e)),t=Oe.current;var n=dp(t,e.type);t!==n&&(O(ke,e),O(Oe,n))}function Pe(e){ke.current===e&&(De(Oe),De(ke)),k.current===e&&(De(k),sh._currentValue=Ce)}var Fe,Ie;function A(e){if(Fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Fe=t&&t[1]||``,Ie=-1<e.stack.indexOf(`
|
|
3
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
-
`+Fe+e+Ie}var Le=!1;function Re(e,t){if(!e||Le)return``;Le=!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}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}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{Le=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?A(n):``}function ze(e,t){switch(e.tag){case 26:case 27:case 5:return A(e.type);case 16:return A(`Lazy`);case 13:return e.child!==t&&t!==null?A(`Suspense Fallback`):A(`Suspense`);case 19:return A(`SuspenseList`);case 0:case 15:return Re(e.type,!1);case 11:return Re(e.type.render,!1);case 1:return Re(e.type,!0);case 31:return A(`Activity`);case 30:return A(`ViewTransition`);default:return``}}function Be(e){try{var t=``,n=null;do t+=ze(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
-
Error generating stack: `+e.message+`
|
|
9
|
-
`+e.stack}}var Ve=Object.prototype.hasOwnProperty,He=t.unstable_scheduleCallback,Ue=t.unstable_cancelCallback,We=t.unstable_shouldYield,Ge=t.unstable_requestPaint,Ke=t.unstable_now,j=t.unstable_getCurrentPriorityLevel,qe=t.unstable_ImmediatePriority,Je=t.unstable_UserBlockingPriority,Ye=t.unstable_NormalPriority,Xe=t.unstable_LowPriority,Ze=t.unstable_IdlePriority,Qe=t.log,$e=t.unstable_setDisableYieldValue,et=null,tt=null;function nt(e){if(typeof Qe==`function`&&$e(e),tt&&typeof tt.setStrictMode==`function`)try{tt.setStrictMode(et,e)}catch{}}var M=Math.clz32?Math.clz32:at,rt=Math.log,it=Math.LN2;function at(e){return e>>>=0,e===0?32:31-(rt(e)/it|0)|0}var ot=256,st=262144,ct=4194304;function lt(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&-e;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 ut(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=lt(n))):i=lt(o):i=lt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=lt(n))):i=lt(o)):i=lt(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 dt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ft(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-M(n),i=1<<r;t|=e[r],n&=~i}return t}function pt(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 mt(){var e=ct;return ct<<=1,!(ct&62914560)&&(ct=4194304),e}function ht(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function gt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _t(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-M(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&&vt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function vt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-M(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function yt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-M(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function bt(e,t){var n=t&-t;return n=n&42?1:xt(n),(n&(e.suspendedLanes|t))===0?n:0}function xt(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 St(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ct(){var e=D.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function wt(e,t){var n=D.p;try{return D.p=e,t()}finally{D.p=n}}var Tt=Math.random().toString(36).slice(2),Et=`__reactFiber$`+Tt,Dt=`__reactProps$`+Tt,Ot=`__reactContainer$`+Tt,At=`__reactEvents$`+Tt,jt=`__reactListeners$`+Tt,Mt=`__reactHandles$`+Tt,Nt=`__reactResources$`+Tt,Pt=`__reactMarker$`+Tt,Ft=`__reactLoad$`+Tt;function It(e){delete e[Et],delete e[Dt],delete e[jt],delete e[Mt]}function Lt(e){var t;if(t=e[Et])return t;for(var n=e.parentNode;n;){if(t=n[Ot]||n[Et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[Et])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Rt(e){if(e=e[Et]||e[Ot]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function zt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function Bt(e){var t=e[Nt];return t||=e[Nt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Vt(e){e[Pt]=!0}function Ht(e){e[Ft]=void 0}var Ut=new Set,Wt={};function Gt(e,t){N(e,t),N(e+`Capture`,t)}function N(e,t){for(Wt[e]=t,e=0;e<t.length;e++)Ut.add(t[e])}var Kt=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]*$`),qt={},Jt={};function Xt(e){return Ve.call(Jt,e)?!0:Ve.call(qt,e)?!1:Kt.test(e)?Jt[e]=!0:(qt[e]=!0,!1)}var P=!1;function Zt(){var e=P;return P=!1,e}function Qt(e,t,n){if(Xt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function $t(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 en(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 tn(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function nn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function rn(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 an(e){if(!e._valueTracker){var t=nn(e)?`checked`:`value`;e._valueTracker=rn(e,t,``+e[t])}}function on(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=nn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var sn=/[\n"\\]/g;function cn(e){return e.replace(sn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function ln(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=``+tn(t)):e.value!==``+tn(t)&&(e.value=``+tn(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):dn(e,tn(n)):o===`number`&&e.value==t?dn(e,tn(e.value)):dn(e,tn(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=``+tn(s):e.removeAttribute(`name`)}function un(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)){an(e);return}n=n==null?``:``+tn(n),t=t==null?n:``+tn(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),an(e)}function dn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function fn(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=``+tn(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 pn(e,t,n){if(t!=null&&(t=``+tn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+tn(n)}function mn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(Se(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=tn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),an(e)}function hn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var gn=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 _n(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||gn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function vn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(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]=``,P=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(_n(e,i,r),P=!0)}else for(var o in t)t.hasOwnProperty(o)&&_n(e,o,t[o])}function yn(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 bn=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`],[`maskType`,`mask-type`],[`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`]]),xn=/^[\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 Sn(e){return xn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Cn(){}var wn=null;function Tn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var En=null,Dn=null;function On(e){var t=Rt(e);if(t&&(e=t.stateNode)){var n=e[Dt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(ln(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="`+cn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[Dt]||null;if(!i)throw Error(a(90));ln(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&on(r)}break a;case`textarea`:pn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&fn(e,!!n.multiple,t,!1)}}}var kn=!1;function An(e,t,n){if(kn)return e(t,n);kn=!0;try{return e(t)}finally{if(kn=!1,(En!==null||Dn!==null)&&(zd(),En&&(t=En,e=Dn,Dn=En=null,On(t),e)))for(t=0;t<e.length;t++)On(e[t])}}function jn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Dt]||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(a(231,t,typeof n));return n}var Mn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Nn=!1;if(Mn)try{var Pn={};Object.defineProperty(Pn,"passive",{get:function(){Nn=!0}}),window.addEventListener(`test`,Pn,Pn),window.removeEventListener(`test`,Pn,Pn)}catch{Nn=!1}var Fn=null,In=null,Ln=null;function Rn(){if(Ln)return Ln;var e,t=In,n=t.length,r,i=`value`in Fn?Fn.value:Fn.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 Ln=i.slice(e,1<r?1-r:void 0)}function zn(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 Bn(){return!0}function Vn(){return!1}function Hn(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)?Bn:Vn,this.isPropagationStopped=Vn,this}return C(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=Bn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Bn)},persist:function(){},isPersistent:Bn}),t}var Un={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wn=Hn(Un),Gn=C({},Un,{view:0,detail:0}),Kn=Hn(Gn),qn,Jn,Yn,Xn=C({},Gn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Yn&&(Yn&&e.type===`mousemove`?(qn=e.screenX-Yn.screenX,Jn=e.screenY-Yn.screenY):Jn=qn=0,Yn=e),qn)},movementY:function(e){return`movementY`in e?e.movementY:Jn}}),Zn=Hn(Xn),Qn=Hn(C({},Xn,{dataTransfer:0})),$n=Hn(C({},Gn,{relatedTarget:0})),er=Hn(C({},Un,{animationName:0,elapsedTime:0,pseudoElement:0})),tr=Hn(C({},Un,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),nr=Hn(C({},Un,{data:0})),rr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},ir={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`},ar={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function or(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ar[e])?!!t[e]:!1}function sr(){return or}var cr=Hn(C({},Gn,{key:function(e){if(e.key){var t=rr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=zn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?ir[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sr,charCode:function(e){return e.type===`keypress`?zn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?zn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),lr=Hn(C({},Xn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),ur=Hn(C({},Un,{submitter:0})),dr=Hn(C({},Gn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sr})),fr=Hn(C({},Un,{propertyName:0,elapsedTime:0,pseudoElement:0})),pr=Hn(C({},Xn,{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})),mr=Hn(C({},Un,{newState:0,oldState:0,source:0})),hr=[9,13,27,32],gr=Mn&&`CompositionEvent`in window,_r=null;Mn&&`documentMode`in document&&(_r=document.documentMode);var vr=Mn&&`TextEvent`in window&&!_r,yr=Mn&&(!gr||_r&&8<_r&&11>=_r),br=` `,xr=!1;function Sr(e,t){switch(e){case`keyup`:return hr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Cr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var wr=!1;function Tr(e,t){switch(e){case`compositionend`:return Cr(t);case`keypress`:return t.which===32?(xr=!0,br):null;case`textInput`:return e=t.data,e===br&&xr?null:e;default:return null}}function Er(e,t){if(wr)return e===`compositionend`||!gr&&Sr(e,t)?(e=Rn(),Ln=In=Fn=null,wr=!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 yr&&t.locale!==`ko`?null:t.data;default:return null}}var Dr={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 Or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Dr[e.type]:t===`textarea`}function kr(e,t,n,r){En?Dn?Dn.push(r):Dn=[r]:En=r,t=Jf(t,`onChange`),0<t.length&&(n=new Wn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Ar=null,jr=null;function Mr(e){Vf(e,0)}function Nr(e){if(on(zt(e)))return e}function Pr(e,t){if(e===`change`)return t}var Fr=!1;if(Mn){var Ir;if(Mn){var Lr=`oninput`in document;if(!Lr){var Rr=document.createElement(`div`);Rr.setAttribute(`oninput`,`return;`),Lr=typeof Rr.oninput==`function`}Ir=Lr}else Ir=!1;Fr=Ir&&(!document.documentMode||9<document.documentMode)}function zr(){Ar&&(Ar.detachEvent(`onpropertychange`,Br),jr=Ar=null)}function Br(e){if(e.propertyName===`value`&&Nr(jr)){var t=[];kr(t,jr,e,Tn(e)),An(Mr,t)}}function Vr(e,t,n){e===`focusin`?(zr(),Ar=t,jr=n,Ar.attachEvent(`onpropertychange`,Br)):e===`focusout`&&zr()}function Hr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Nr(jr)}function Ur(e,t){if(e===`click`)return Nr(t)}function Wr(e,t){if(e===`input`||e===`change`)return Nr(t)}function Gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Kr=typeof Object.is==`function`?Object.is:Gr;function qr(e,t){if(Kr(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(!Ve.call(t,i)||!Kr(e[i],t[i]))return!1}return!0}function Jr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xr(e,t){var n=Yr(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=Yr(n)}}function Zr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Jr(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=Jr(e.document)}return t}function $r(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 ei=Mn&&`documentMode`in document&&11>=document.documentMode,ti=null,ni=null,ri=null,ii=!1;function ai(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ii||ti==null||ti!==Jr(r)||(r=ti,`selectionStart`in r&&$r(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}),ri&&qr(ri,r)||(ri=r,r=Jf(ni,`onSelect`),0<r.length&&(t=new Wn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ti)))}function oi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var si={animationend:oi(`Animation`,`AnimationEnd`),animationiteration:oi(`Animation`,`AnimationIteration`),animationstart:oi(`Animation`,`AnimationStart`),transitionrun:oi(`Transition`,`TransitionRun`),transitionstart:oi(`Transition`,`TransitionStart`),transitioncancel:oi(`Transition`,`TransitionCancel`),transitionend:oi(`Transition`,`TransitionEnd`)},ci={},li={};Mn&&(li=document.createElement(`div`).style,`AnimationEvent`in window||(delete si.animationend.animation,delete si.animationiteration.animation,delete si.animationstart.animation),`TransitionEvent`in window||delete si.transitionend.transition);function ui(e){if(ci[e])return ci[e];if(!si[e])return e;var t=si[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in li)return ci[e]=t[n];return e}var di=ui(`animationend`),fi=ui(`animationiteration`),pi=ui(`animationstart`),mi=ui(`transitionrun`),hi=ui(`transitionstart`),gi=ui(`transitioncancel`),_i=ui(`transitionend`),vi=new Map,yi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);yi.push(`scrollEnd`);function bi(e,t){vi.set(e,t),Gt(t,[e])}var xi=0;function Si(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=bd.identifierPrefix;var n=xi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Ci(e){if(e==null||typeof e==`string`)return e;var t=null,n=Od;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function wi(e,t){return e=Ci(e),t=Ci(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var F=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)},Ti=[],Ei=0,Di=0;function Oi(){for(var e=Ei,t=Di=Ei=0;t<e;){var n=Ti[t];Ti[t++]=null;var r=Ti[t];Ti[t++]=null;var i=Ti[t];Ti[t++]=null;var a=Ti[t];if(Ti[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&&Mi(n,i,a)}}function ki(e,t,n,r){Ti[Ei++]=e,Ti[Ei++]=t,Ti[Ei++]=n,Ti[Ei++]=r,Di|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ai(e,t,n,r){return ki(e,t,n,r),Ni(e)}function ji(e,t){return ki(e,null,null,t),Ni(e)}function Mi(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-M(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ni(e){if(50<kd)throw kd=0,Ad=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Pi={};function Fi(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 Ii(e,t,n,r){return new Fi(e,t,n,r)}function Li(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ri(e,t){var n=e.alternate;return n===null?(n=Ii(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&1206910976,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 zi(e,t){e.flags&=1206910978;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 Bi(e,t,n,r,i,o){var s=0;if(r=e,typeof r==`function`)Li(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,Oe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case pe:return e=Ii(31,n,t,i),e.elementType=pe,e.lanes=o,e;case w:return Vi(n.children,i,o,t);case ae:s=8,i|=24;break;case oe:return e=Ii(12,n,t,i|2),e.elementType=oe,e.lanes=o,e;case ue:return e=Ii(13,n,t,i),e.elementType=ue,e.lanes=o,e;case de:return e=Ii(19,n,t,i),e.elementType=de,e.lanes=o,e;case me:case ge:return e=i|32,e=Ii(30,n,t,e),e.elementType=ge,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case ce:s=10;break a;case se:s=9;break a;case le:s=11;break a;case fe:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=Ii(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Vi(e,t,n,r){return e=Ii(7,e,r,t),e.lanes=n,e}function Hi(e,t,n){return e=Ii(6,e,null,t),e.lanes=n,e}function Ui(e){var t=Ii(18,null,null,0);return t.stateNode=e,t}function Wi(e,t,n){return t=Ii(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Gi=new WeakMap;function Ki(e,t){if(typeof e==`object`&&e){var n=Gi.get(e);return n===void 0?(t={value:e,source:t,stack:Be(t)},Gi.set(e,t),t):n}return{value:e,source:t,stack:Be(t)}}var qi=[],Ji=0,Yi=null,Xi=0,Zi=[],Qi=0,$i=null,ea=1,ta=``;function na(e,t){qi[Ji++]=Xi,qi[Ji++]=Yi,Yi=e,Xi=t}function ra(e,t,n){Zi[Qi++]=ea,Zi[Qi++]=ta,Zi[Qi++]=$i,$i=e;var r=ea;e=ta;var i=32-M(r)-1;r&=~(1<<i),n+=1;var a=32-M(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ea=1<<32-M(t)+i|n<<i|r,ta=a+e}else ea=1<<a|n<<i|r,ta=e}function ia(e){e.return!==null&&(na(e,1),ra(e,1,0))}function aa(e){for(;e===Yi;)Yi=qi[--Ji],qi[Ji]=null,Xi=qi[--Ji],qi[Ji]=null;for(;e===$i;)$i=Zi[--Qi],Zi[Qi]=null,ta=Zi[--Qi],Zi[Qi]=null,ea=Zi[--Qi],Zi[Qi]=null}function oa(e,t){Zi[Qi++]=ea,Zi[Qi++]=ta,Zi[Qi++]=$i,ea=t.id,ta=t.overflow,$i=e}var sa=null,I=null,L=!1,ca=null,la=!1,ua=Error(a(519));function da(e){throw _a(Ki(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ua}function fa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Et]=e,t[Dt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Q(zf[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),un(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),mn(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||ep(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=Cn),t=!0):t=!1,t||da(e,!0)}function pa(e){for(sa=e.return;sa;)switch(sa.tag){case 5:case 31:case 13:la=!1;return;case 27:case 3:la=!0;return;default:sa=sa.return}}function ma(e){if(e!==sa)return!1;if(!L)return pa(e),L=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&I&&da(e),pa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));I=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));I=dm(e)}else t===27?(t=I,Sp(e.type)?(e=um,um=null,I=e):I=t):I=sa?lm(e.stateNode.nextSibling):null;return!0}function ha(){I=sa=null,L=!1}function ga(){var e=ca;return e!==null&&(md===null?md=e:md.push.apply(md,e),ca=null),e}function _a(e){ca===null?ca=[e]:ca.push(e)}var va=Ee(null),ya=null,ba=null;function xa(e,t,n){O(va,t._currentValue),t._currentValue=n}function Sa(e){e._currentValue=va.current,De(va)}function Ca(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 wa(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ca(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ca(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),Ca(i.return,n,e),s=i.child,s=s===null?null:s.sibling):s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Ta(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;Kr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===k.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}i=i.return}return e!==null&&wa(t,e,n,r),t.flags|=262144,e!==null}function Ea(e){for(e=e.firstContext;e!==null;){if(!Kr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Da(e){ya=e,ba=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Oa(e){return Aa(ya,e)}function ka(e,t){return ya===null&&Da(e),Aa(e,t)}function Aa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ba===null){if(e===null)throw Error(a(308));ba=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ba=ba.next=t;return n}var ja=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()})}},Ma=t.unstable_scheduleCallback,Na=t.unstable_NormalPriority,Pa={$$typeof:ce,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fa(){return{controller:new ja,data:new Map,refCount:0}}function Ia(e){e.refCount--,e.refCount===0&&Ma(Na,function(){e.controller.abort()})}function La(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ra=null;function za(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ba=null,Va=0,Ha=0,Ua=null;function Wa(e,t){if(Ba===null){var n=Ba=[];Va=0,Ha=Pf(),Ua={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Va++,t.then(Ga,Ga),t}function Ga(){if(--Va===0&&(Ra=null,Ba!==null)){Ua!==null&&(Ua.status=`fulfilled`);var e=Ba;Ba=null,Ha=0,Ua=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ka(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 qa=E.S;E.S=function(e,t){if(_d=Ke(),typeof t==`object`&&t&&typeof t.then==`function`&&Wa(e,t),Ra!==null)for(var n=bf;n!==null;)La(n,Ra),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)La(r,n),r=r.next;if(Ha!==0){r=Ra,r===null&&(r=Ra=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}qa!==null&&qa(e,t)};var Ja=Ee(null);function Ya(){var e=Ja.current;return e===null?G.pooledCache:e}function Xa(e,t){t===null?O(Ja,Ja.current):O(Ja,t.pool)}function Za(){var e=Ya();return e===null?null:{parent:Pa._currentValue,pool:e}}var Qa=Error(a(460)),$a=Error(a(474)),eo=Error(a(542)),to={then:function(){}};function no(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ro(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Cn,Cn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,so(e),e===void 0&&!(`reason`in t)?Error(a(600)):e;default:if(typeof t.status==`string`)t.then(Cn,Cn);else{if(e=G,e!==null&&100<e.shellSuspendCounter)throw Error(a(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,so(e),e}throw ao=t,Qa}}function io(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ao=e,Qa):e}}var ao=null;function oo(){if(ao===null)throw Error(a(459));var e=ao;return ao=null,e}function so(e){if(e===Qa||e===eo)throw Error(a(483))}var co=null,lo=0;function uo(e){var t=lo;return lo+=1,co===null&&(co=[]),ro(co,e,t)}function fo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function po(e,t){throw t.$$typeof===ne?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function mo(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 i(e,t){return e=Ri(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|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Hi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===w?(e=d(e,t,n.props.children,r,n.key),fo(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===T&&io(a)===t.type)?(t=i(t,n.props),fo(t,n),t.return=e,t):(t=Bi(n.type,n.key,n.props,null,e.mode,r),fo(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=Wi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Vi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case re:return n=Bi(t.type,t.key,t.props,null,e.mode,n),fo(n,t),n.return=e,n;case ie:return t=Wi(t,e.mode,n),t.return=e,t;case T:return t=io(t),f(e,t,n)}if(Se(t)||ye(t))return t=Vi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,uo(t),n);if(t.$$typeof===ce)return f(e,ka(e,t),n);po(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 re:return n.key===i?l(e,t,n,r):null;case ie:return n.key===i?u(e,t,n,r):null;case T:return n=io(n),p(e,t,n,r)}if(Se(n)||ye(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,uo(n),r);if(n.$$typeof===ce)return p(e,t,ka(e,n),r);po(e,n)}return null}function m(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 re:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case ie:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=io(r),m(e,t,n,r,i)}if(Se(r)||ye(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,uo(r),i);if(r.$$typeof===ce)return m(e,t,n,ka(t,r),i);po(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),L&&na(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return L&&na(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),L&&na(i,h),l}function g(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),L&&na(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return L&&na(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),L&&na(i,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===w&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case re:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===w){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),fo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&io(l)===r.type){n(e,r.sibling),c=i(r,o.props),fo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===w?(c=Vi(o.props.children,e.mode,c,o.key),fo(c,o),c.return=e,e=c):(c=Bi(o.type,o.key,o.props,null,e.mode,c),fo(c,o),c.return=e,e=c)}return s(e);case ie: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=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Wi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=io(o),_(e,r,o,c)}if(Se(o))return h(e,r,o,c);if(ye(o)){if(l=ye(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,uo(o),c);if(o.$$typeof===ce)return _(e,r,ka(e,o),c);po(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=i(r,o),c.return=e,e=c):(n(e,r),c=Hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{lo=0;var i=_(e,t,n,r);return co=null,i}catch(t){if(t===Qa||t===eo)throw t;var a=Ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ho=mo(!0),go=mo(!1),_o=!1;function vo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yo(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 bo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,W&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ni(e),Mi(e,null,n),t}return ki(e,r,t,n),Ni(e)}function So(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,yt(e,n)}}function Co(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 wo=!1;function To(){if(wo){var e=Ua;if(e!==null)throw e}}function Eo(e,t,n,r){wo=!1;var i=e.updateQueue;_o=!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 f=s.lane&-536870913,p=f!==s.lane;if(p?(q&f)===f:(r&f)===f){f!==0&&f===Ha&&(wo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=C({},d,f);break a;case 2:_o=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,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),cd|=o,e.lanes=o,e.memoizedState=d}}function Do(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Oo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Do(n[e],t)}var ko=Ee(null),Ao=Ee(0);function jo(e,t){e=od,O(Ao,e),O(ko,t),od=e|t.baseLanes}function Mo(){O(Ao,od),O(ko,ko.current)}function No(){od=Ao.current,De(ko),De(Ao)}var Po=Ee(null),Fo=null;function Io(e){var t=e.alternate;O(Vo,Vo.current&1),O(Po,e),Fo===null&&(t===null||ko.current!==null||t.memoizedState!==null)&&(Fo=e)}function Lo(e){O(Vo,Vo.current),O(Po,e),Fo===null&&(Fo=e)}function Ro(e){e.tag===22?(O(Vo,Vo.current),O(Po,e),Fo===null&&(Fo=e)):zo()}function zo(){O(Vo,Vo.current),O(Po,Po.current)}function Bo(e){De(Po),Fo===e&&(Fo=null),De(Vo)}var Vo=Ee(0);function Ho(e,t){O(Po,Po.current),O(Vo,t)}function Uo(e){De(Vo),De(Po),Fo===e&&(Fo=null)}function Wo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Go=0,R=null,z=null,Ko=null,qo=!1,Jo=!1,Yo=!1,Xo=0,Zo=0,Qo=null,$o=0;function B(){throw Error(a(321))}function es(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Kr(e[n],t[n]))return!1;return!0}function ts(e,t,n,r,i,a){return Go=a,R=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?_c:vc,Yo=!1,a=n(r,i),Yo=!1,Jo&&(a=rs(t,n,r,i)),ns(e),a}function ns(e){E.H=gc;var t=z!==null&&z.next!==null;if(Go=0,Ko=z=R=null,qo=!1,Zo=0,Qo=null,t)throw Error(a(300));e===null||Fc||(e=e.dependencies,e!==null&&Ea(e)&&(Fc=!0))}function rs(e,t,n,r){R=e;var i=0;do{if(Jo&&(Qo=null),Zo=0,Jo=!1,25<=i)throw Error(a(301));if(i+=1,Ko=z=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}E.H=yc,o=t(n,r)}while(Jo);return o}function is(){var e=E.H,t=e.useState()[0];return t=typeof t.then==`function`?us(t):t,e=e.useState()[0],(z===null?null:z.memoizedState)!==e&&(R.flags|=1024),t}function as(){var e=Xo!==0;return Xo=0,e}function os(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ss(e){if(qo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}qo=!1}Go=0,Ko=z=R=null,Jo=!1,Zo=Xo=0,Qo=null}function cs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ko===null?R.memoizedState=Ko=e:Ko=Ko.next=e,Ko}function V(){if(z===null){var e=R.alternate;e=e===null?null:e.memoizedState}else e=z.next;var t=Ko===null?R.memoizedState:Ko.next;if(t!==null)Ko=t,z=e;else{if(e===null)throw R.alternate===null?Error(a(467)):Error(a(310));z=e,e={memoizedState:z.memoizedState,baseState:z.baseState,baseQueue:z.baseQueue,queue:z.queue,next:null},Ko===null?R.memoizedState=Ko=e:Ko=Ko.next=e}return Ko}function ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function us(e){var t=Zo;return Zo+=1,Qo===null&&(Qo=[]),e=ro(Qo,e,t),t=R,(Ko===null?t.memoizedState:Ko.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?_c:vc),e}function ds(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return us(e);if(e.$$typeof===_e)return;if(e.$$typeof===ce)return Oa(e)}throw Error(a(438,String(e)))}function fs(e){var t=null,n=R.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=R.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=ls(),R.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]=he;return t.index++,n}function ps(e,t){return typeof t==`function`?t(e):t}function ms(e){return hs(V(),z,e)}function hs(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Go&f)===f:(q&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===Ha&&(d=!0);else if((Go&p)===p){u=u.next,p===Ha&&(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,R.lanes|=p,cd|=p;f=u.action,Yo&&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,R.lanes|=f,cd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Kr(o,e.memoizedState)&&(Fc=!0,d&&(n=Ua,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function gs(e){var t=V(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);Kr(o,t.memoizedState)||(Fc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function _s(e,t,n){var r=R,i=V(),o=L;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!Kr((z||i).memoizedState,n);if(s&&(i.memoizedState=n,Fc=!0),i=i.queue,Hs(bs.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||Ko!==null&&!!(Ko.memoizedState.tag&1),Ls(e?9:8,{destroy:void 0},ys.bind(null,r,i,n,t),null),e){if(r.flags|=2048,G===null)throw Error(a(349));o||Go&127||vs(r,t,n)}return n}function vs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=R.updateQueue,t===null?(t=ls(),R.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ys(e,t,n,r){t.value=n,t.getSnapshot=r,xs(t)&&Ss(e)}function bs(e,t,n){return n(function(){xs(t)&&Ss(e)})}function xs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Kr(e,n)}catch{return!0}}function Ss(e){var t=ji(e,2);t!==null&&Pd(t,e,2)}function Cs(e){var t=cs();if(typeof e==`function`){var n=e;if(e=n(),Yo){nt(!0);try{n()}finally{nt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:e},t}function ws(e,t,n,r){return e.baseState=n,hs(e,z,typeof r==`function`?r:ps)}function Ts(e,t,n,r,i){if(pc(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};E.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Es(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Es(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=E.T,o={};o.types=a===null?null:a.types,E.T=o;try{var s=n(i,r),c=E.S;c!==null&&c(o,s),Ds(e,t,s)}catch(n){ks(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),E.T=a}}else try{a=n(i,r),Ds(e,t,a)}catch(n){ks(e,t,n)}}function Ds(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Os(e,t,n)},function(n){return ks(e,t,n)}):Os(e,t,n)}function Os(e,t,n){t.status=`fulfilled`,t.value=n,As(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Es(e,n)))}function ks(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,As(t),t=t.next;while(t!==r)}e.action=null}function As(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function js(e,t){return t}function Ms(e,t){if(L){var n=G.formState;if(n!==null){a:{var r=R;if(L){if(I){b:{for(var i=I,a=la;i.nodeType!==8;){if(!a){i=null;break b}if(i=lm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){I=lm(i.nextSibling),r=i.data===`F!`;break a}}da(r)}r=!1}r&&(t=n[0])}}return n=cs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:t},n.queue=r,n=uc.bind(null,R,r),r.dispatch=n,r=Cs(!1),a=fc.bind(null,R,!1,r.queue),r=cs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ts.bind(null,R,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ns(e){return Ps(V(),z,e)}function Ps(e,t,n){if(t=hs(e,t,js)[0],e=ms(ps)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=us(t)}catch(e){throw e===Qa?eo:e}else r=t;t=V();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(R.flags|=2048,Ls(9,{destroy:void 0},Fs.bind(null,i,n),null)),[r,a,e]}function Fs(e,t){e.action=t}function Is(e){var t=V(),n=z;if(n!==null)return Ps(t,n,e);V(),t=t.memoizedState,n=V();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ls(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=R.updateQueue,t===null&&(t=ls(),R.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 Rs(){return V().memoizedState}function zs(e,t,n,r){var i=cs();R.flags|=e,i.memoizedState=Ls(1|t,{destroy:void 0},n,r===void 0?null:r)}function Bs(e,t,n,r){var i=V();r=r===void 0?null:r;var a=i.memoizedState.inst;z!==null&&r!==null&&es(r,z.memoizedState.deps)?i.memoizedState=Ls(t,a,n,r):(R.flags|=e,i.memoizedState=Ls(1|t,a,n,r))}function Vs(e,t){zs(8390656,8,e,t)}function Hs(e,t){Bs(2048,8,e,t)}function Us(e){R.flags|=4;var t=R.updateQueue;if(t===null)t=ls(),R.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ws(e){var t=V().memoizedState;return Us({ref:t,nextImpl:e}),function(){if(W&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function Gs(e,t){return Bs(4,2,e,t)}function Ks(e,t){return Bs(4,4,e,t)}function qs(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 Js(e,t,n){n=n==null?null:n.concat([e]),Bs(4,4,qs.bind(null,t,e),n)}function Ys(){}function Xs(e,t){var n=V();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&es(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zs(e,t){var n=V();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&es(t,r[1]))return r[0];if(r=e(),Yo){nt(!0);try{e()}finally{nt(!1)}}return n.memoizedState=[r,t],r}function Qs(e,t,n){return n===void 0||Go&1073741824&&!(q&261930)?e.memoizedState=t:(e.memoizedState=n,e=Md(),R.lanes|=e,cd|=e,n)}function $s(e,t,n,r){return Kr(n,t)?n:ko.current===null?!(Go&106)||Go&1073741824&&!(q&261930)?(Fc=!0,e.memoizedState=n):(e=Md(),R.lanes|=e,cd|=e,t):(e=Qs(e,n,r),Kr(e,t)||(Fc=!0),e)}function ec(e,t,n,r,i){var a=D.p;D.p=a!==0&&8>a?a:8;var o=E.T,s={};s.types=o===null?null:o.types,E.T=s,fc(e,!1,t,n);try{var c=i(),l=E.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?dc(e,t,Ka(c,r),jd(e)):dc(e,t,r,jd(e))}catch(n){dc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{D.p=a,o!==null&&s.types!==null&&(o.types=s.types),E.T=o}}function tc(){}function nc(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=rc(e).queue;ec(e,i,t,Ce,n===null?tc:function(){return ic(e),n(r)})}function rc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ce,baseState:Ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:Ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ic(e){var t=rc(e);t.next===null&&(t=e.alternate.memoizedState),dc(e,t.next.queue,{},jd())}function ac(){return Oa(sh)}function oc(){return V().memoizedState}function sc(){return V().memoizedState}function cc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=bo(n);var r=xo(t,e,n);r!==null&&(Pd(r,t,n),So(r,t,n)),t={cache:Fa()},e.payload=t;return}t=t.return}}function lc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},pc(e)?mc(t,n):(n=Ai(e,t,n,r),n!==null&&(Pd(n,e,r),hc(n,t,r)))}function uc(e,t,n){dc(e,t,n,jd())}function dc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(pc(e))mc(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,Kr(s,o))return ki(e,t,i,0),G===null&&Oi(),!1}catch{}if(n=Ai(e,t,i,r),n!==null)return Pd(n,e,r),hc(n,t,r),!0}return!1}function fc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},pc(e)){if(t)throw Error(a(479))}else t=Ai(e,n,r,2),t!==null&&Pd(t,e,2)}function pc(e){var t=e.alternate;return e===R||t!==null&&t===R}function mc(e,t){Jo=qo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yt(e,n)}}var gc={readContext:Oa,use:ds,useCallback:B,useContext:B,useEffect:B,useImperativeHandle:B,useLayoutEffect:B,useInsertionEffect:B,useMemo:B,useReducer:B,useRef:B,useState:B,useDebugValue:B,useDeferredValue:B,useTransition:B,useSyncExternalStore:B,useId:B,useHostTransitionStatus:B,useFormState:B,useActionState:B,useOptimistic:B,useMemoCache:B,useCacheRefresh:B,useEffectEvent:B},_c={readContext:Oa,use:ds,useCallback:function(e,t){return cs().memoizedState=[e,t===void 0?null:t],e},useContext:Oa,useEffect:Vs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),zs(4194308,4,qs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zs(4194308,4,e,t)},useInsertionEffect:function(e,t){zs(4,2,e,t)},useMemo:function(e,t){var n=cs();t=t===void 0?null:t;var r=e();if(Yo){nt(!0);try{e()}finally{nt(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=cs();if(n!==void 0){var i=n(t);if(Yo){nt(!0);try{n(t)}finally{nt(!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=lc.bind(null,R,e),[r.memoizedState,e]},useRef:function(e){var t=cs();return e={current:e},t.memoizedState=e},useState:function(e){e=Cs(e);var t=e.queue,n=uc.bind(null,R,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ys,useDeferredValue:function(e,t){return Qs(cs(),e,t)},useTransition:function(){var e=Cs(!1);return e=ec.bind(null,R,e.queue,!0,!1),cs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=R,i=cs();if(L){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),G===null)throw Error(a(349));q&127||vs(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Vs(bs.bind(null,r,o,e),[e]),r.flags|=2048,Ls(9,{destroy:void 0},ys.bind(null,r,o,n,t),null),n},useId:function(){var e=cs(),t=G.identifierPrefix;if(L){var n=ta,r=ea;n=(r&~(1<<32-M(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Xo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=$o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ac,useFormState:Ms,useActionState:Ms,useOptimistic:function(e){var t=cs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=fc.bind(null,R,!0,n),n.dispatch=t,[e,t]},useMemoCache:fs,useCacheRefresh:function(){return cs().memoizedState=cc.bind(null,R)},useEffectEvent:function(e){var t=cs(),n={impl:e};return t.memoizedState=n,function(){if(W&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},vc={readContext:Oa,use:ds,useCallback:Xs,useContext:Oa,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:ms,useRef:Rs,useState:function(){return ms(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){return $s(V(),z.memoizedState,e,t)},useTransition:function(){var e=ms(ps)[0],t=V().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Ns,useActionState:Ns,useOptimistic:function(e,t){return ws(V(),z,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws},yc={readContext:Oa,use:ds,useCallback:Xs,useContext:Oa,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:gs,useRef:Rs,useState:function(){return gs(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){var n=V();return z===null?Qs(n,e,t):$s(n,z.memoizedState,e,t)},useTransition:function(){var e=gs(ps)[0],t=V().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Is,useActionState:Is,useOptimistic:function(e,t){var n=V();return z===null?(n.baseState=e,[e,n.queue.dispatch]):ws(n,z,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws};function bc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:C({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var xc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=jd(),i=bo(r);i.payload=t,n!=null&&(i.callback=n),t=xo(e,i,r),t!==null&&(Pd(t,e,r),So(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=jd(),i=bo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=xo(e,i,r),t!==null&&(Pd(t,e,r),So(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jd(),r=bo(n);r.tag=2,t!=null&&(r.callback=t),t=xo(e,r,n),t!==null&&(Pd(t,e,n),So(t,e,n))}};function Sc(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?!qr(n,r)||!qr(i,a):!0}function Cc(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&&xc.enqueueReplaceState(t,t.state,null)}function wc(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=C({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Tc(e){F(e)}function Ec(e){console.error(e)}function Dc(e){F(e)}function Oc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function kc(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 Ac(e,t,n){return n=bo(n),n.tag=3,n.payload={element:null},n.callback=function(){Oc(e,t)},n}function jc(e){return e=bo(e),e.tag=3,e}function Mc(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(){kc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){kc(t,n,r),typeof i!=`function`&&(Y===null?Y=new Set([this]):Y.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Nc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ta(t,n,i,!0),n=Po.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Fo===null?Kd():n.alternate===null&&sd===0&&(sd=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===to?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,i)),!1;case 22:return n.flags|=65536,r===to?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)),mf(e,r,i)),!1}throw Error(a(435,n.tag))}return mf(e,r,i),Kd(),!1}if(L)return t=Po.current,t===null?(r!==ua&&(t=Error(a(423),{cause:r}),_a(Ki(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Ki(r,n),i=Ac(e.stateNode,r,i),Co(e,i),sd!==4&&(sd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==ua&&(e=Error(a(422),{cause:r}),_a(Ki(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=Ki(o,n),pd===null?pd=[o]:pd.push(o),sd!==4&&(sd=2),t===null)return!0;r=Ki(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Ac(n.stateNode,r,e),Co(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`&&(Y===null||!Y.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=jc(i),Mc(i,e,n,r),Co(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Pc=Error(a(461)),Fc=!1;function Ic(e,t,n,r){t.child=e===null?go(t,null,n,r):ho(t,e.child,n,r)}function Lc(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 Da(t),r=ts(e,t,n,o,a,i),s=as(),e!==null&&!Fc?(os(e,t,i),dl(e,t,i)):(L&&s&&ia(t),t.flags|=1,Ic(e,t,r,i),t.child)}function Rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Li(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,zc(e,t,a,r,i)):(e=Bi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!fl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?qr:n,n(o,r)&&e.ref===t.ref)return dl(e,t,i)}return t.flags|=1,e=Ri(a,r),e.ref=t.ref,e.return=t,t.child=e}function zc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(qr(a,r)&&e.ref===t.ref){if(Fc=!1,t.pendingProps=r=a,fl(e,i))e.flags&131072&&(Fc=!0);else return t.lanes=e.lanes,dl(e,t,i)}}return qc(e,t,n,r,i)}function Bc(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 Hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xa(t,a===null?null:a.cachePool),a===null?Mo():jo(t,a),Ro(t);else return r=t.lanes=536870912,Hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Xa(t,null),Mo(),zo()):(Xa(t,a.cachePool),jo(t,a),zo(),t.memoizedState=null);return Ic(e,t,i,n),t.child}function Vc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Hc(e,t,n,r,i){var a=Ya();return a=a===null?null:{parent:Pa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Xa(t,null),Mo(),Ro(t),e!==null&&Ta(e,t,r,!0),t.childLanes=i,null}function Uc(e,t){return t=nl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wc(e,t,n){return ho(t,e.child,null,n),e=Uc(t,t.pendingProps),e.flags|=2,Bo(t),t.memoizedState=null,e}function Gc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(L){if(r.mode===`hidden`)return e=Uc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Vc(null,e);if(Lo(t),(e=I)?(e=am(e,la),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$i===null?null:{id:ea,overflow:ta},retryLane:536870912,hydrationErrors:null},n=Ui(e),n.return=t,t.child=n,sa=t,I=null)):e=null,e===null)throw da(t);return t.lanes=536870912,null}return Uc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Lo(t),i){if(t.flags&256)t.flags&=-257,t=Wc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558))}else if(Fc||Ta(e,t,n,!1),i=(n&e.childLanes)!==0,Fc||i){if(ko.current===null){if(r=G,r!==null&&(s=bt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ji(e,s),Pd(r,e,s),Pc;Kd()}t=Wc(e,t,n)}else e=o.treeContext,I=lm(s.nextSibling),sa=t,L=!0,ca=null,la=!1,e!==null&&oa(t,e),t=Uc(t,r),t.flags|=134221824;return t}return e=Ri(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Kc(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(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function qc(e,t,n,r,i){return Da(t),n=ts(e,t,n,r,void 0,i),r=as(),e!==null&&!Fc?(os(e,t,i),dl(e,t,i)):(L&&r&&ia(t),t.flags|=1,Ic(e,t,n,i),t.child)}function Jc(e,t,n,r,i,a){return Da(t),t.updateQueue=null,n=rs(t,r,n,i),ns(e),r=as(),e!==null&&!Fc?(os(e,t,a),dl(e,t,a)):(L&&r&&ia(t),t.flags|=1,Ic(e,t,n,a),t.child)}function Yc(e,t,n,r,i){if(Da(t),t.stateNode===null){var a=Pi,o=n.contextType;typeof o==`object`&&o&&(a=Oa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=xc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},vo(t),o=n.contextType,a.context=typeof o==`object`&&o?Oa(o):Pi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(bc(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&&xc.enqueueReplaceState(a,a.state,null),Eo(t,r,a,i),To(),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=wc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Pi,typeof u==`object`&&u&&(o=Oa(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)&&Cc(t,a,r,o),_o=!1;var f=t.memoizedState;a.state=f,Eo(t,r,a,i),To(),l=t.memoizedState,s||f!==l||_o?(typeof d==`function`&&(bc(t,n,d,r),l=t.memoizedState),(c=_o||Sc(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,yo(e,t),o=t.memoizedProps,u=wc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Pi,typeof l==`object`&&l&&(c=Oa(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)&&Cc(t,a,r,c),_o=!1,f=t.memoizedState,a.state=f,Eo(t,r,a,i),To();var p=t.memoizedState;o!==d||f!==p||_o||e!==null&&e.dependencies!==null&&Ea(e.dependencies)?(typeof s==`function`&&(bc(t,n,s,r),p=t.memoizedState),(u=_o||Sc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ea(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,Kc(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=ho(t,e.child,null,i),t.child=ho(t,null,n,i)):Ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=dl(e,t,i),e}function Xc(e,t,n,r){return ha(),t.flags|=256,Ic(e,t,n,r),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qc(e){return{baseLanes:e,cachePool:Za()}}function $c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=dd),e}function el(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Vo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(L){if(i?Io(t):zo(),(e=I)?(e=am(e,la),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$i===null?null:{id:ea,overflow:ta},retryLane:536870912,hydrationErrors:null},n=Ui(e),n.return=t,t.child=n,sa=t,I=null)):e=null,e===null)throw da(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(zo(),i=t.mode,a=nl({mode:`hidden`,children:a},i),r=Vi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Qc(n),r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(null,r)):(Io(t),tl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return il(e,t,a,o,r,c,s,n)}return i?(zo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ri(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Vi(i,a,n,null),i.flags|=2):i=Ri(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Vc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Qc(n):(a=i.cachePool,a===null?a=Za():(s=Pa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(e.child,r)):(Io(t),n=e.child,e=n.sibling,n=Ri(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function tl(e,t){return t=nl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function nl(e,t){return e=Ii(22,e,null,t),e.lanes=0,e}function rl(e,t,n){return ho(t,e.child,null,n),e=tl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function il(e,t,n,r,i,o,s,c){if(n)return t.flags&256?(Io(t),t.flags&=-257,rl(e,t,c)):t.memoizedState===null?(zo(),o=i.fallback,s=t.mode,i=nl({mode:`visible`,children:i.children},s),o=Vi(o,s,c,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,ho(t,e.child,null,c),i=t.child,i.memoizedState=Qc(c),i.childLanes=$c(e,r,c),t.memoizedState=Zc,Vc(null,i)):(zo(),t.child=e.child,t.flags|=128,null);if(Io(t),sm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(a(419)),i.stack=``,i.digest=r,_a({value:i,source:null,stack:null})),rl(e,t,c)}if(Fc||Ta(e,t,c,!1),r=(c&e.childLanes)!==0,Fc||r){if(ko.current!==null)return rl(e,t,c);if(r=G,r!==null&&(i=bt(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,ji(e,i),Pd(r,e,i),Pc;return om(o)||Kd(),rl(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,I=lm(o.nextSibling),sa=t,L=!0,ca=null,la=!1,e!==null&&oa(t,e),t=tl(t,i.children),t.flags|=134221824,t)}function al(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ca(e.return,t,n)}function ol(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Wo(n)===null&&(t=e),e=e.sibling}return t}function sl(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 cl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function ll(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Vo.current;if(t.flags&128)return Ho(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ho(t,o),i===`backwards`&&e!==null?(cl(e),Ic(e,t,r,n),cl(e)):Ic(e,t,r,n),r=L?Xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&al(e,n,t);else if(e.tag===19)al(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`backwards`:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,cl(t)),sl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Wo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}sl(t,!0,n,null,a,r);break;case`together`:sl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),sl(t,!1,i,n,a,r)}return t.child}function ul(e,t,n){var r=t.pendingProps;return xa(t,t.type,r.value),Ic(e,t,r.children,n),t.child}function dl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),cd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ta(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=Ri(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ri(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ea(e)))}function pl(e,t,n){switch(t.tag){case 3:je(t,t.stateNode.containerInfo),xa(t,Pa,e.memoizedState.cache),ha();break;case 27:case 5:Ne(t);break;case 4:je(t,t.stateNode.containerInfo);break;case 10:xa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Lo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Io(t),t.flags|=128,null;r=Ta(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?el(e,t,n):(Io(t),e=dl(e,t,n),e===null?null:e.sibling)}Io(t);break;case 19:if(t.flags&128)return ll(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ta(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ll(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ho(t,Vo.current),r)break;return null;case 22:return t.lanes=0,Bc(e,t,n,t.pendingProps);case 24:xa(t,Pa,e.memoizedState.cache)}return dl(e,t,n)}function ml(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Fc=!0;else{if(!fl(e,n)&&!(t.flags&128))return Fc=!1,pl(e,t,n);Fc=!!(e.flags&131072)}}else Fc=!1,L&&t.flags&1048576&&ra(t,Xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=io(t.elementType),t.type=e,typeof e==`function`)Li(e)?(r=wc(e,r),t.tag=1,t=Yc(null,t,e,r,n)):(t.tag=0,t=qc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===le){t.tag=11,t=Lc(null,t,e,r,n);break a}if(i===fe){t.tag=14,t=Rc(null,t,e,r,n);break a}if(i===ce){t.tag=10,t.type=e,t=ul(null,t,n);break a}}throw t=xe(e)||e,Error(a(306,t,``))}}return t;case 0:return qc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=wc(r,t.pendingProps),Yc(e,t,r,i,n);case 3:a:{if(je(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,yo(e,t),Eo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,xa(t,Pa,r),r!==o.cache&&wa(t,[Pa],n,!0),To(),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=Xc(e,t,r,n);break a}if(r!==i){i=Ki(Error(a(424)),t),_a(i),t=Xc(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(I=lm(e.firstChild),sa=t,L=!0,ca=null,la=!0,n=go(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ha(),r===i){t=dl(e,t,n);break a}Ic(e,t,r,n)}t=t.child}return t;case 26:return Kc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:L||(t.stateNode=fp(t.type,t.pendingProps,Ae.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ne(t),e===null&&L&&(r=t.stateNode=hm(t.type,t.pendingProps,Ae.current),sa=t,la=!0,i=I,Sp(t.type)?(um=i,I=lm(r.firstChild)):I=i),Ic(e,t,t.pendingProps.children,n),Kc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&L&&((i=r=I)&&(r=rm(r,t.type,t.pendingProps,la),r===null?i=!1:(t.stateNode=r,sa=t,I=lm(r.firstChild),la=!1,i=!0)),i||da(t)),Ne(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(i,o)?r=null:s!==null&&pp(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=ts(e,t,is,null,null,n),sh._currentValue=i),Kc(e,t),Ic(e,t,r,n),t.child;case 6:return e===null&&L&&((e=n=I)&&(n=im(n,t.pendingProps,la),n===null?e=!1:(t.stateNode=n,sa=t,I=null,e=!0)),e||da(t)),null;case 13:return el(e,t,n);case 4:return je(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ho(t,null,r,n):Ic(e,t,r,n),t.child;case 11:return Lc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Kc(e,t),Ic(e,t,r,n),t.child;case 8:return Ic(e,t,t.pendingProps.children,n),t.child;case 12:return Ic(e,t,t.pendingProps.children,n),t.child;case 10:return ul(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,Da(t),i=Oa(i),r=r(i),t.flags|=1,Ic(e,t,r,n),t.child;case 14:return Rc(e,t,t.type,t.pendingProps,n);case 15:return zc(e,t,t.type,t.pendingProps,n);case 19:return ll(e,t,n);case 31:return Gc(e,t,n);case 22:return Bc(e,t,n,t.pendingProps);case 24:return Da(t),r=Oa(Pa),e===null?(i=Ya(),i===null&&(i=G,o=Fa(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},vo(t),xa(t,Pa,i)):((e.lanes&n)!==0&&(yo(e,t),Eo(t,null,null,n),To()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,xa(t,Pa,r),r!==i.cache&&wa(t,[Pa],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),xa(t,Pa,r))),Ic(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:L&&ia(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Kc(e,t),Ic(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function hl(e){e.flags|=4}function gl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Ud())e.flags|=8192;else throw ao=to,$a}}else e.flags&=-16777217}function _l(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Ud())e.flags|=8192;else throw ao=to,$a}}function vl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:mt(),e.lanes|=t,fd|=t)}function yl(e,t){if(!L)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function H(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&1206910976,r|=i.flags&1206910976,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 bl(e,t,n){var r=t.pendingProps;switch(aa(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return H(t),null;case 1:return H(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Sa(Pa),Me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ma(t)?hl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ga())),H(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(hl(t),o===null?(H(t),gl(t,i,null,r,n)):(H(t),_l(t,o))):o?o===e.memoizedState?(H(t),t.flags&=-16777217):(hl(t),H(t),_l(t,o)):(e=e.memoizedProps,e!==r&&hl(t),H(t),gl(t,i,e,r,n)),null;case 27:if(Pe(t),n=Ae.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return H(t),t.subtreeFlags&=-33554433,null}e=Oe.current,ma(t)?fa(t,e):(e=hm(i,r,n),t.stateNode=e,hl(t))}return H(t),t.subtreeFlags&=-33554433,null;case 5:if(Pe(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return H(t),t.subtreeFlags&=-33554433,null}if(o=Oe.current,ma(t))fa(t,o);else{var s=lp(Ae.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);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(i,{is:r.is}):s.createElement(i)}}o[Et]=t,o[Dt]=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(np(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&hl(t)}}return H(t),t.subtreeFlags&=-33554433,gl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=Ae.current,ma(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=sa,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Et]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||da(t,!0)}else e=lp(e).createTextNode(r),e[Et]=t,t.stateNode=e}return H(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ma(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[Et]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;H(t),e=!1}else n=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Bo(t),t):(Bo(t),null);if(t.flags&128)throw Error(a(558))}return H(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ma(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[Et]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;H(t),i=!1}else i=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Bo(t),t):(Bo(t),null)}return Bo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),vl(t,t.updateQueue),H(t),null);case 4:return Me(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,H(t),null;case 10:return Sa(t.type),H(t),null;case 19:if(Uo(t),r=t.memoizedState,r===null)return H(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)yl(r,!1);else{if(sd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Wo(e),o!==null){for(t.flags|=128,yl(r,!1),e=o.updateQueue,t.updateQueue=e,vl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)zi(n,e),n=n.sibling;return Ho(t,Vo.current&1|2),L&&na(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ke()>vd&&(t.flags|=128,i=!0,yl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Wo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,vl(t,e),yl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!L)return H(t),null}else 2*Ke()-r.renderingStartTime>vd&&n!==536870912&&(t.flags|=128,i=!0,yl(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ke(),e.sibling=null,o=Vo.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||L?Ho(t,o):(n=o,O(Po,t),O(Vo,n),Fo===null&&(Fo=t)),L&&na(t,r.treeForkCount),e}return H(t),null;case 22:case 23:return Bo(t),No(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(H(t),t.subtreeFlags&6&&(t.flags|=8192)):H(t),n=t.updateQueue,n!==null&&vl(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&&De(Ja),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Sa(Pa),H(t),null;case 25:return null;case 30:return t.flags|=33554432,H(t),null}throw Error(a(156,t.tag))}function xl(e,t){switch(aa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Sa(Pa),Me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Pe(t),null;case 31:if(t.memoizedState!==null){if(Bo(t),t.alternate===null)throw Error(a(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Bo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Uo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Me(),null;case 10:return Sa(t.type),null;case 22:case 23:return Bo(t),No(),e!==null&&De(Ja),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Sa(Pa),null;case 25:return null;default:return null}}function Sl(e,t){switch(aa(t),t.tag){case 3:Sa(Pa),Me();break;case 26:case 27:case 5:Pe(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&Bo(t);break;case 13:Bo(t);break;case 19:Uo(t);break;case 10:Sa(t.type);break;case 22:case 23:Bo(t),No(),e!==null&&De(Ja);break;case 24:Sa(Pa)}}function Cl(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){Z(t,t.return,e)}}function wl(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){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Oo(t,n)}catch(t){Z(e,e.return,t)}}}function El(e,t,n){n.props=wc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Dl(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:var i=e.stateNode,a=Si(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);p(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Ol(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(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){Z(e,t,n)}else n.current=null}}function kl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function Al(e){for(var t=e.return;t!==null&&(Nl(t)&&em(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function jl(e){for(var t=e.return;t!==null&&(Nl(t)&&tm(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function Ml(e){return e.tag===5||e.tag===3||e.tag===27}function Nl(e){return e&&e.tag===7&&e.stateNode!==null}function Pl(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){Z(e,e.return,t)}}function Fl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[Dt]=t}catch(t){Z(e,e.return,t)}}function Il(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Ll(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Il(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&&Sp(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 Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Cn)),kl(e,r),P=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),kl(e,r),P=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[Et]=e,t[Dt]=n}catch(t){Z(e,e.return,t)}}var Vl=!1,Hl=null;function Ul(e){(e.tag===30||e.subtreeFlags&33554432)&&(Vl=!0)}var Wl=null;function Gl(){var e=Wl;return Wl=null,e}var Kl=0;function ql(e,t,n,r,i){return Kl=0,Jl(e.child,t,n,r,i)}function Jl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Vl=!0,Tp(o,Kl===0?t:t+`_`+Kl,n),Kl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Jl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Yl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Yl(e.child,t)),e=e.sibling}function Xl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Xl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(a(544));var n=t.name;t=wi(t.default,t.share),t!==`none`&&(ql(e,n,t,null,!1)||Yl(e.child,!1))}e=e.sibling}}function Zl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=Si(r,n),a=wi(r.default,n.paired?r.share:r.enter);a===`none`?Xl(e):ql(e,i,a,null,!1)?(Xl(e),n.paired||t||Nd(e,r.onEnter)):Yl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e,t),e=e.sibling;else Xl(e)}function Ql(e){if(Hl!==null&&Hl.size!==0){var t=Hl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=wi(n.default,n.share);if(a!==`none`&&(ql(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Nd(e,n.onShare)):Yl(e.child,!1)),t.delete(r),t.size===0)break}}}Ql(e)}e=e.sibling}}}function $l(e){if(e.tag===30){var t=e.memoizedProps,n=Si(t,e.stateNode),r=Hl===null?void 0:Hl.get(n),i=wi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(ql(e,n,i,null,!1)?r===void 0?Nd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Hl.delete(n),Nd(e,t.onShare)):Yl(e.child,!1)),Hl!==null&&Ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Hl!==null&&Ql(e)}function eu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Si(t,e.stateNode);t=wi(t.default,t.update),e.flags&=-5,t!==`none`&&ql(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&eu(e);e=e.sibling}}function tu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Yl(e.child,!1))}tu(e)}e=e.sibling}}function nu(e){if(e.tag===30)e.stateNode.paired=null,Yl(e.child,!1),tu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else tu(e)}function ru(e){for(e=e.child;e!==null;)e.tag===30?Yl(e.child,!1):e.subtreeFlags&33554432&&ru(e),e=e.sibling}function iu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Kl<a.length){var l=a[Kl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Kl===0?n:n+`_`+Kl,i),s&&e.flags&4||(Wl===null&&(Wl=[]),Wl.push(c,Kl===0?r:r+`_`+Kl,t.memoizedProps)),Kl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:iu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function au(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=Si(n,r),a=wi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Kl=0,i=iu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Nd(e,n.onUpdate))}else e.subtreeFlags&33554432&&au(e,t);e=e.sibling}}var ou=!1,U=!1,su=!1,cu=!1,lu=typeof WeakSet==`function`?WeakSet:Set,uu=null,du=!1,fu=!1,pu=!1,mu=!1;function hu(e,t,n){if(e=e.containerInfo,sp=gh,e=Qr(e),$r(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,uu=t,t=n?9270:1024;uu!==null;){if(e=uu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&$l(r[a]);if(e.alternate===null&&e.flags&2)n&&Ul(e),gu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&$l(r),gu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ul(e),gu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,uu=r):(n&&eu(e),gu(n))}}Hl=null}function gu(e){for(;uu!==null;){var t=uu,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=wc(t.type,i);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Z(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=Si(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=wi(i.default,i.update),i!==`none`&&ql(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(a(163))}if(r=t.sibling,r!==null){r.return=t.return,uu=r;break}uu=t.return}}function _u(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Lu(e,n),r&4&&Cl(5,n);break;case 1:if(Lu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=wc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}}r&64&&Tl(n),r&512&&Dl(n,n.return);break;case 3:if(Lu(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{Oo(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Bl(n);case 26:case 5:Lu(e,n),t===null&&r&4&&Pl(n),r&512&&Dl(n,n.return);break;case 12:Lu(e,n);break;case 31:Lu(e,n),r&4&&Eu(e,n);break;case 13:Lu(e,n),r&4&&Du(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||ou,!r){var a=t!==null&&t.memoizedState!==null||U;t=ou,i=U,ou=r,(U=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),zu(e,n,r)):Lu(e,n),ou=t,U=i}break;case 30:Lu(e,n),r&512&&Dl(n,n.return);break;case 7:r&512&&Dl(n,n.return);default:Lu(e,n)}}function vu(e,t){for(e=e.child;e!==null;)yu(e,t),e=e.sibling}function yu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Z(e,e.return,t)}bu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,P=!0}catch(t){Z(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){Z(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&vu(e,t);break;default:vu(e,t)}}function bu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:yu(n,r);break a;case 22:n.memoizedState===null&&bu(n,r);break a;default:bu(n,r)}}e=e.sibling}}function xu(e){var t=e.alternate;t!==null&&(e.alternate=null,xu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&It(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 Su=null,Cu=!1;function wu(e,t,n){for(n=n.child;n!==null;)Tu(e,t,n),n=n.sibling}function Tu(e,t,n){if(tt&&typeof tt.onCommitFiberUnmount==`function`)try{tt.onCommitFiberUnmount(et,n)}catch{}switch(n.tag){case 26:U||Ol(n,t),wu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!U&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:U||Ol(n,t),jl(n);var r=Su,i=Cu;Sp(n.type)&&(Su=n.stateNode,Cu=!1),wu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),Su=r,Cu=i;break;case 5:U||Ol(n,t),jl(n);case 6:if(n.tag===6&&jl(n),r=Su,i=Cu,Su=null,wu(e,t,n),Su=r,Cu=i,Su!==null){if(Cu)try{(Su.nodeType===9?Su.body:Su.nodeName===`HTML`?Su.ownerDocument.body:Su).removeChild(n.stateNode),P=!0}catch(e){Z(n,t,e)}else try{Su.removeChild(n.stateNode),P=!0}catch(e){Z(n,t,e)}}break;case 18:Su!==null&&(Cu?(e=Su,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(Su,n.stateNode));break;case 4:r=Su,i=Cu,Su=n.stateNode.containerInfo,Cu=!0,wu(e,t,n),Su=r,Cu=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),U||wl(4,n,t),wu(e,t,n);break;case 1:U||(Ol(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&El(n,t,r)),wu(e,t,n);break;case 21:wu(e,t,n);break;case 22:U=(r=U)||n.memoizedState!==null,wu(e,t,n),U=r;break;case 30:Ol(n,t),wu(e,t,n);break;case 7:U||Ol(n,t),wu(e,t,n);break;default:wu(e,t,n)}}function Eu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){Z(t,t.return,e)}}}function Du(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){Z(t,t.return,e)}}function Ou(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lu),t;default:throw Error(a(435,e.tag))}}function ku(e,t){var n=Ou(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Au(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var o=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){Su=l.stateNode,Cu=!1;break a}break;case 5:Su=l.stateNode,Cu=!1;break a;case 3:case 4:Su=l.stateNode.containerInfo,Cu=!0;break a}l=l.return}if(Su===null)throw Error(a(160));Tu(s,c,o),Su=null,Cu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Mu(t,e,n),t=t.sibling}var ju=null;function Mu(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Au(t,e,n),Nu(e),i&4&&(wl(3,e,e.return),Cl(3,e),wl(5,e,e.return));break;case 1:Au(t,e,n),Nu(e),i&512&&(U||r===null||Ol(r,r.return)),i&64&&ou&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=ju,Au(t,e,n),Nu(e),i&512&&(U||r===null||Ol(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ou)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=o.ownerDocument||o;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[Pt]||r[Et]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),np(r,t,n),r[Et]=e,Vt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;default:throw Error(a(468,t))}r[Et]=e,Vt(r),t=r}e.stateNode=t}}else ou||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Fl(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||U||t.parentNode.removeChild(t)):i.count--,n===null?ou||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:Au(t,e,n),Nu(e),i&512&&(U||r===null||Ol(r,r.return)),r!==null&&i&4&&Fl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=su,su=!1,Au(t,e,n),su=o,Nu(e),i&512&&(U||r===null||Ol(r,r.return)),e.flags&32){t=e.stateNode;try{hn(t,``),P=!0}catch(t){Z(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Fl(e,t,r===null?t:r.memoizedProps)),i&1024&&(cu=!0);break;case 6:if(Au(t,e,n),Nu(e),i&4){if(e.stateNode===null)throw Error(a(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,P=!0}catch(t){Z(e,e.return,t)}}break;case 3:if(P=!1,Wm=null,o=ju,ju=bm(t.containerInfo),Au(t,e,n),ju=o,Nu(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){Z(e,e.return,t)}cu&&(cu=!1,Pu(e)),P=!1;break;case 4:i=su,su=ou,r=Zt(),o=ju,ju=bm(e.stateNode.containerInfo),Au(t,e,n),Nu(e),ju=o,P&&fu&&(pu=!0),P=r,su=i;break;case 12:Au(t,e,n),Nu(e);break;case 31:Au(t,e,n),Nu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 13:Au(t,e,n),Nu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(gd=Ke()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ou,l=U,u=su;ou=c||o,su=u||o,U=l||s,Au(t,e,n),U=l,su=u,ou=c,Nu(e),i&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ou||U||(t=s||U,n=ou,r=U,ou=o||ou,U=t,Ru(e,2),ou=n,U=r),!o&&su||vu(e,o)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ku(e,n))));break;case 19:Au(t,e,n),Nu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 30:i&512&&(U||r===null||Ol(r,r.return)),i=Zt(),o=fu,s=(n&335544064)===n,c=e.memoizedProps,fu=s&&wi(c.default,c.update)!==`none`,Au(t,e,n),Nu(e),s&&r!==null&&P&&(e.flags|=4),fu=o,P=i;break;case 21:break;case 7:i&512&&(U||r===null||Ol(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Au(t,e,n),Nu(e)}}function Nu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Il(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Nl(i)){var o=i.stateNode;r===null?r=[o]:r.push(o)}if(Ml(i))break;i=i.return}var s=r;if(n==null)throw Error(a(160));switch(n.tag){case 27:var c=n.stateNode;zl(e,Ll(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(hn(l,``),n.flags&=-33),zl(e,Ll(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Rl(e,Ll(e),u,s);break;default:throw Error(a(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Pu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Fu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Iu(t,e),t=t.sibling;else au(t,!1)}function Iu(e,t){var n=e.alternate;if(n===null)Zl(e,!1);else switch(e.tag){case 3:if(mu=du=!1,Gl(),Fu(t,e),!du&&!pu){if(e=Wl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),mu=!0}Wl=null;break;case 5:Fu(t,e);break;case 4:r=du,du=!1,Fu(t,e),du&&(pu=!0),du=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Fu(t,e):Zl(e,!1));break;case 30:r=du,i=Gl(),du=!1,Fu(t,e),du&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=Si(a,o),o=Si(n.memoizedProps,o);var s=wi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Kl=0,t=iu(e,n,t,o,s,a,!0),Kl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Nd(e,e.memoizedProps.onUpdate),Wl=i):i!==null&&(i.push.apply(i,Wl),Wl=i),du=e.flags&32?!0:r;break;default:Fu(t,e)}}function Lu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_u(e,t.alternate,t),t=t.sibling}function Ru(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:wl(4,n,n.return),Ru(n,r);break;case 1:Ol(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&El(n,n.return,i),Ru(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:Ol(n,n.return),n.tag!==5&&n.tag!==27||jl(n),Ru(n,r);break;case 6:jl(n);break;case 26:Ol(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||U||i.parentNode.removeChild(i),Ru(n,r);break;case 22:n.memoizedState===null&&Ru(n,r);break;case 30:Ol(n,n.return),Ru(n,r);break;case 7:Ol(n,n.return);default:Ru(n,r)}e=e.sibling}}function zu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:zu(i,a,n),Cl(4,a);break;case 1:if(zu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Do(l[i],c)}catch(e){Z(r,r.return,e)}}s&&o&64&&Tl(a),Dl(a,a.return);break;case 27:n&2&&Bl(a);case 5:a.tag!==5&&a.tag!==27||Al(a),zu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 6:Al(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ou||Km(bm(c.ownerDocument),a.type,c),zu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 12:zu(i,a,n);break;case 31:zu(i,a,n),s&&o&4&&Eu(i,a);break;case 13:zu(i,a,n),s&&o&4&&Du(i,a);break;case 22:a.memoizedState===null&&zu(i,a,n),Dl(a,a.return);break;case 30:zu(i,a,n),Dl(a,a.return);break;case 7:Dl(a,a.return);default:zu(i,a,n)}t=t.sibling}}function Bu(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&&Ia(n))}function Vu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ia(e))}function Hu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Uu(e,t,n,r),t=t.sibling;else i&&ru(t)}function Uu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&nu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Hu(e,t,n,r),a&2048&&Cl(9,t);break;case 1:Hu(e,t,n,r);break;case 3:Hu(e,t,n,r),i&&mu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ia(a)));break;case 12:if(a&2048){Hu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Hu(e,t,n,r);break;case 31:Hu(e,t,n,r);break;case 13:Hu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&nu(t),o._visibility&2?Hu(e,t,n,r):(o._visibility|=2,Wu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&nu(s),o._visibility&2?Hu(e,t,n,r):Gu(e,t)),a&2048&&Bu(s,t);break;case 24:Hu(e,t,n,r),a&2048&&Vu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Yl(a.child,!0),Yl(t.child,!0))),Hu(e,t,n,r);break;default:Hu(e,t,n,r)}}function Wu(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:Wu(a,o,s,c,i),Cl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Wu(a,o,s,c,i)):u._visibility&2?Wu(a,o,s,c,i):Gu(a,o),i&&l&2048&&Bu(o.alternate,o);break;case 24:Wu(a,o,s,c,i),i&&l&2048&&Vu(o.alternate,o);break;default:Wu(a,o,s,c,i)}t=t.sibling}}function Gu(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:Gu(n,r),i&2048&&Bu(r.alternate,r);break;case 24:Gu(n,r),i&2048&&Vu(r.alternate,r);break;default:Gu(n,r)}t=t.sibling}}var Ku=8192;function qu(e,t,n){if(e.subtreeFlags&Ku)for(e=e.child;e!==null;)Ju(e,t,n),e=e.sibling}function Ju(e,t,n){switch(e.tag){case 26:qu(e,t,n),e.flags&Ku&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,ju,e.memoizedState,e.memoizedProps));break;case 5:qu(e,t,n),e.flags&Ku&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=ju;ju=bm(e.stateNode.containerInfo),qu(e,t,n),ju=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ku,Ku=16777216,qu(e,t,n),Ku=r):qu(e,t,n));break;case 30:if((e.flags&Ku)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Hl===null&&(Hl=new Map),Hl.set(r,i)}qu(e,t,n);break;default:qu(e,t,n)}}function Yu(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 Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,$u(r,e)}Yu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zu(e),e=e.sibling}function Zu(e){switch(e.tag){case 0:case 11:case 15:Xu(e),e.flags&2048&&wl(9,e,e.return);break;case 3:Xu(e);break;case 12:Xu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Qu(e)):Xu(e);break;default:Xu(e)}}function Qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,$u(r,e)}Yu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:wl(8,t,t.return),Qu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Qu(t));break;default:Qu(t)}e=e.sibling}}function $u(e,t){for(;uu!==null;){var n=uu;switch(n.tag){case 0:case 11:case 15:wl(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:Ia(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,uu=r;else a:for(n=e;uu!==null;){r=uu;var i=r.sibling,a=r.return;if(xu(r),r===n){uu=null;break a}if(i!==null){i.return=a,uu=i;break a}uu=a}}}var ed={getCacheForType:function(e){var t=Oa(Pa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Oa(Pa).controller.signal}},td=typeof WeakMap==`function`?WeakMap:Map,W=0,G=null,K=null,q=0,J=0,nd=null,rd=!1,id=!1,ad=!1,od=0,sd=0,cd=0,ld=0,ud=0,dd=0,fd=0,pd=null,md=null,hd=!1,gd=0,_d=0,vd=1/0,yd=null,Y=null,X=0,bd=null,xd=null,Sd=0,Cd=0,wd=null,Td=null,Ed=null,Dd=null,Od=null,kd=0,Ad=null;function jd(){return W&2&&q!==0?q&-q:E.T===null?Ct():Pf()}function Md(){if(dd===0){if(!(q&536870912)||L){var e=st;st<<=1,!(st&3932160)&&(st=262144),dd=e}else dd=536870912}return e=Po.current,e!==null&&(e.flags|=32),dd}function Nd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(Si(e.memoizedProps,n))),Dd===null&&(Dd=[]),Dd.push(t.bind(null,r))}}function Pd(e,t,n){(e===G&&(J===2||J===9)||e.cancelPendingCommit!==null)&&(Vd(e,0),Rd(e,q,dd,!1)),gt(e,n),(!(W&2)||e!==G)&&(e===G&&(!(W&2)&&(ld|=n),sd===4&&Rd(e,q,dd,!1)),Ef(e))}function Fd(e,t,n){if(W&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||dt(e,t),i=r?Yd(e,t):qd(e,t,!0),o=r;do{if(i===0){id&&!r&&Rd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ld(n)){i=qd(e,t,!1),o=!1;continue}if(i===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;i=pd;var l=c.current.memoizedState.isDehydrated;if(l&&(Vd(c,s).flags|=256),s=qd(c,s,!1),s!==2&&s!==6){if(ad&&!l){c.errorRecoveryDisabledLanes|=o,ld|=o,i=4;break a}o=md,md=i,o!==null&&(md===null?md=o:md.push.apply(md,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Vd(e,0),Rd(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Rd(r,t,dd,!rd);break a;case 2:md=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=gd+300-Ke(),10<i)){if(Rd(r,t,dd,!rd),ut(r,0,!0)!==0)break a;Sd=t,r.timeoutHandle=gp(Id.bind(null,r,n,md,yd,hd,t,dd,ld,fd,rd,o,`Throttled`,-0,0),i);break a}Id(r,n,md,yd,hd,t,dd,ld,fd,rd,o,null,-0,0)}break}while(1);Ef(e)}function Id(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Cn},Hl=null,Ju(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?gd-Ke():(a&4194048)===a?_d-Ke():0,m=eh(d,m),m!==null)){Sd=a,e.cancelPendingCommit=m(nf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Rd(e,a,o,!l);return}nf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ld(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(!Kr(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 Rd(e,t,n,r){t=ft(e,t),t&=~ud,t&=~ld,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-M(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&vt(e,n,t)}function zd(){return W&6?!0:(Df(0,!1),!1)}function Bd(){if(K!==null){if(J===0)var e=K.return;else e=K,ba=ya=null,ss(e),co=null,lo=0,e=K;for(;e!==null;)Sl(e.alternate,e),e=e.return;K=null}}function Vd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sd=0,Bd(),G=e,K=n=Ri(e.current,null),q=t,J=0,nd=null,rd=!1,id=dt(e,t),ad=!1,fd=dd=ud=ld=cd=sd=0,md=pd=null,hd=!1,od=ft(e,t),Oi(),n}function Hd(e,t){R=null,E.H=gc,t===Qa||t===eo?(t=oo(),J=3):t===$a?(t=oo(),J=4):J=t===Pc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,nd=t,K===null&&(sd=1,Oc(e,Ki(t,e.current)))}function Ud(){var e=Po.current;return e===null?!0:(q&4194048)===q?Fo===null:(q&62914560)===q||q&536870912?e===Fo:!1}function Wd(){var e=E.H;return E.H=gc,e===null?gc:e}function Gd(){var e=E.A;return E.A=ed,e}function Kd(){sd=4,rd||(q&4194048)!==q&&Po.current!==null||(id=!0),!(cd&134217727)&&!(ld&134217727)||G===null||Rd(G,q,dd,!1)}function qd(e,t,n){var r=W;W|=2;var i=Wd(),a=Gd();(G!==e||q!==t)&&(yd=null,Vd(e,t)),t=!1;var o=sd;a:do try{if(J!==0&&K!==null){var s=K,c=nd;switch(J){case 8:Bd(),o=6;break a;case 3:case 2:case 9:case 6:Po.current===null&&(t=!0);var l=J;if(J=0,nd=null,$d(e,s,c,l),n&&id){o=0;break a}break;default:l=J,J=0,nd=null,$d(e,s,c,l)}}Jd(),o=sd;break}catch(t){Hd(e,t)}while(1);return t&&e.shellSuspendCounter++,ba=ya=null,W=r,E.H=i,E.A=a,K===null&&(G=null,q=0,Oi()),o}function Jd(){for(;K!==null;)Zd(K)}function Yd(e,t){var n=W;W|=2;var r=Wd(),i=Gd();G!==e||q!==t?(yd=null,vd=Ke()+500,Vd(e,t)):id=dt(e,t);a:do try{if(J!==0&&K!==null){t=K;var o=nd;b:switch(J){case 1:J=0,nd=null,$d(e,t,o,1);break;case 2:case 9:if(no(o)){J=0,nd=null,Qd(t);break}t=function(){J!==2&&J!==9||G!==e||(J=7),Ef(e)},o.then(t,t);break a;case 3:J=7;break a;case 4:J=5;break a;case 7:no(o)?(J=0,nd=null,Qd(t)):(J=0,nd=null,$d(e,t,o,7));break;case 5:var s=null;switch(K.tag){case 26:s=K.memoizedState;case 5:case 27:var c=K;if(s?Ym(s):c.stateNode.complete){J=0,nd=null;var l=c.sibling;if(l!==null)K=l;else{var u=c.return;u===null?K=null:(K=u,ef(u))}break b}}J=0,nd=null,$d(e,t,o,5);break;case 6:J=0,nd=null,$d(e,t,o,6);break;case 8:Bd(),sd=6;break a;default:throw Error(a(462))}}Xd();break}catch(t){Hd(e,t)}while(1);return ba=ya=null,E.H=r,E.A=i,W=n,K===null?(G=null,q=0,Oi(),sd):0}function Xd(){for(;K!==null&&!We();)Zd(K)}function Zd(e){var t=ml(e.alternate,e,od);e.memoizedProps=e.pendingProps,t===null?ef(e):K=t}function Qd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Jc(n,t,t.pendingProps,t.type,void 0,q);break;case 11:t=Jc(n,t,t.pendingProps,t.type.render,t.ref,q);break;case 5:ss(t);var r=t;r===sa&&(L?(pa(r),r.tag===5&&r.stateNode!=null&&(I=r.stateNode)):(pa(r),L=!0));default:Sl(n,t),t=K=zi(t,od),t=ml(n,t,od)}e.memoizedProps=e.pendingProps,t===null?ef(e):K=t}function $d(e,t,n,r){ba=ya=null,ss(t),co=null,lo=0;var i=t.return;try{if(Nc(e,i,t,n,q)){sd=1,Oc(e,Ki(n,e.current)),K=null;return}}catch(t){if(i!==null)throw K=i,t;sd=1,Oc(e,Ki(n,e.current)),K=null;return}t.flags&32768?(L||r===1?e=!0:id||q&536870912?e=!1:(rd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Po.current,r!==null&&r.tag===13&&(r.flags|=16384))),tf(t,e)):ef(t)}function ef(e){var t=e;do{if(t.flags&32768){tf(t,rd);return}e=t.return;var n=bl(t.alternate,t,od);if(n!==null){K=n;return}if(t=t.sibling,t!==null){K=t;return}K=t=e}while(t!==null);sd===0&&(sd=5)}function tf(e,t){do{var n=xl(e.alternate,e);if(n!==null){n.flags&=32767,K=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){K=e;return}K=e=n}while(e!==null);sd=6,K=null}function nf(e,t,n,r,i,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do df();while(X!==0);if(W&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));e===G&&(K=G=null,q=0),xd=t,bd=e,Sd=n,wd=i,Td=r,rf(e,t,n,s,c,l,f)}}function rf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Cd=s,s|=Di,_t(e,n,s,r,i,a),Dd=null,(n&335544064)===n?(Od=za(e),r=10262):(Od=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(Ye,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Vl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=E.T,E.T=null,i=D.p,D.p=2,a=W,W|=4;try{hu(e,t,n)}finally{W=a,D.p=i,E.T=r}}X=1,Vl?Ed=Mp(o,e.containerInfo,Od,sf,cf,of,lf,ff,af,null,null):(sf(),cf(),lf())}function af(e){if(X!==0){var t=bd.onRecoverableError;t(e,{componentStack:null})}}function of(){X===3&&(X=0,Iu(xd,bd),X=4)}function sf(){if(X===1){X=0;var e=bd,t=xd,n=Sd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=E.T,E.T=null;var i=D.p;D.p=2;var a=W;W|=4;try{fu=pu=!1,Mu(t,e,n),n=cp;var o=Qr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Zr(s.ownerDocument.documentElement,s)){if(c!==null&&$r(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 _=Xr(s,h),v=Xr(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}}gh=!!sp,cp=sp=null}finally{W=a,D.p=i,E.T=r}}e.current=t,X=2}}function cf(){if(X===2){X=0;var e=bd,t=xd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=E.T,E.T=null;var r=D.p;D.p=2;var i=W;W|=4;try{_u(e,t.alternate,t)}finally{W=i,D.p=r,E.T=n}}X=3}}function lf(){if(X===4||X===3){X=0;var e=Ed;Ed=null,Ge();var t=bd,n=xd,r=Sd,i=Td,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?X=5:(X=0,xd=bd=null,uf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Y=null),St(r),n=n.stateNode,tt&&typeof tt.onCommitFiberRoot==`function`)try{tt.onCommitFiberRoot(et,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=E.T,a=D.p,D.p=2,E.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{E.T=n,D.p=a}}if(i=Dd,o=Od,Od=null,i!==null&&(Dd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Sd&3&&df(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===Ad?kd++:(kd=0,Ad=t):(kd=0,Ad=null),Df(0,!1)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ia(t)))}function df(){return Ed!==null&&(Ed.skipTransition(),Ed=null),sf(),cf(),lf(),ff()}function ff(){if(X!==5)return!1;var e=bd,t=Cd;Cd=0;var n=St(Sd),r=E.T,i=D.p;try{D.p=32>n?32:n,E.T=null,n=wd,wd=null;var o=bd,s=Sd;if(X=0,xd=bd=null,Sd=0,W&6)throw Error(a(331));var c=W;if(W|=4,Zu(o.current),Uu(o,o.current,s,n),W=c,Df(0,!1),tt&&typeof tt.onPostCommitFiberRoot==`function`)try{tt.onPostCommitFiberRoot(et,o)}catch{}return!0}finally{D.p=i,E.T=r,uf(e,t)}}function pf(e,t,n){t=Ki(n,t),t=Ac(e.stateNode,t,2),e=xo(e,t,2),e!==null&&(gt(e,2),Ef(e))}function Z(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Y===null||!Y.has(r))){e=Ki(n,e),n=jc(2),r=xo(t,n,2),r!==null&&(Mc(n,r,t,e),gt(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new td;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)||(ad=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,G===e&&(q&n)===n&&(sd===4||sd===3&&(q&62914560)===q&&300>Ke()-gd?W&2?ud|=n:Vd(e,0):ud|=n,fd===q&&(fd=0)),Ef(e)}function gf(e,t){t===0&&(t=mt()),e=ji(e,t),e!==null&&(gt(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),gf(e,n)}function yf(e,t){return He(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;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-M(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=q,a=ut(r,r===G?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||dt(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&hp()&&(e=Tf);for(var t=Ke(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}X!==0&&X!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-M(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=pt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=G,n=q,n=ut(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(J===2||J===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ue(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||dt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ue(r),St(n)){case 2:case 8:n=Je;break;case 32:n=Ye;break;case 268435456:n=Ze;break;default:n=Ye}return r=jf.bind(null,e),n=He(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ue(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(X!==0&&X!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(df()&&e.callbackNode!==n)return null;var r=q;return r=ut(e,e===G?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Fd(e,r,t),Af(e,Ke()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(df())return null;Fd(e,t,!0)}function Nf(){bp(function(){W&6?He(qe,Of):kf()})}function Pf(){if(Tf===0){var e=Ha;e===0&&(e=ot,ot<<=1,!(ot&261888)&&(ot=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Sn(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[Dt]||null).action),o=r.submitter;o&&(t=(t=o[Dt]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Wn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);nc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),nc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<yi.length;Lf++){var Rf=yi[Lf];bi(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}bi(di,`onAnimationEnd`),bi(fi,`onAnimationIteration`),bi(pi,`onAnimationStart`),bi(`dblclick`,`onDoubleClick`),bi(`focusin`,`onFocus`),bi(`focusout`,`onBlur`),bi(mi,`onTransitionRun`),bi(hi,`onTransitionStart`),bi(gi,`onTransitionCancel`),bi(_i,`onTransitionEnd`),N(`onMouseEnter`,[`mouseout`,`mouseover`]),N(`onMouseLeave`,[`mouseout`,`mouseover`]),N(`onPointerEnter`,[`pointerout`,`pointerover`]),N(`onPointerLeave`,[`pointerout`,`pointerover`]),Gt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Gt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Gt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Gt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Gt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Gt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`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(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(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){F(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){F(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[At];n===void 0&&(n=t[At]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,Ut.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!Nn||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 Kf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=Lt(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}An(function(){var r=a,i=Tn(n),o=[];a:{var c=vi.get(e);if(c!==void 0){var l=Wn,u=e;switch(e){case`keypress`:if(zn(n)===0)break a;case`keydown`:case`keyup`:l=cr;break;case`focusin`:u=`focus`,l=$n;break;case`focusout`:u=`blur`,l=$n;break;case`beforeblur`:case`afterblur`:l=$n;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=Zn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Qn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=dr;break;case di:case fi:case pi:l=er;break;case _i:l=fr;break;case`scroll`:case`scrollend`:l=Kn;break;case`wheel`:l=pr;break;case`copy`:case`cut`:case`paste`:l=tr;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=lr;break;case`submit`:l=ur;break;case`toggle`:case`beforetoggle`:l=mr}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=jn(m,p),g!=null&&d.push(qf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==wn&&(u=n.relatedTarget||n.fromElement)&&(Lt(u)||u[Ot]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Lt(l):null,l!==null&&(f=s(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Zn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=lr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:zt(c),h=l==null?u:zt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Lt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?S(c,l,Yf):null,c!==null&&Xf(o,u,c,d,!1),l!==null&&f!==null&&Xf(o,f,l,d,!0)))}a:{if(c=r?zt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Pr;else if(Or(c)){if(Fr)_=Wr;else{_=Hr;var v=Vr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&yn(r.elementType)&&(_=Pr):_=Ur;if(_&&=_(e,r)){kr(o,_,n,i);break a}v&&v(e,c,r)}switch(v=r?zt(r):window,e){case`focusin`:(Or(v)||v.contentEditable===`true`)&&(ti=v,ni=r,ri=null);break;case`focusout`:ri=ni=ti=null;break;case`mousedown`:ii=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ii=!1,ai(o,n,i);break;case`selectionchange`:if(ei)break;case`keydown`:case`keyup`:ai(o,n,i)}var y;if(gr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else wr?Sr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(yr&&n.locale!==`ko`&&(wr||b!==`onCompositionStart`?b===`onCompositionEnd`&&wr&&(y=Rn()):(Fn=i,In=`value`in Fn?Fn.value:Fn.textContent,wr=!0)),v=Jf(r,b),0<v.length&&(b=new nr(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=Cr(n),y!==null&&(b.data=y)))),(y=vr?Tr(e,n):Er(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new nr(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),If(o,e,r,n,i)}Vf(o,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(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=jn(e,n),i!=null&&r.unshift(qf(e,i,a)),i=jn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(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=jn(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=jn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
|
|
10
|
-
`).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function $(e,t,n,r,i,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||hn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&hn(e,``+r);else return;break;case`className`:$t(e,`class`,r);break;case`tabIndex`:$t(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:$t(e,n,r);break;case`style`:vn(e,r,o);return;case`data`:if(t!==`object`){$t(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=Sn(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`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Sn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Cn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(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=Sn(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`credentialless`: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`:Q(`beforetoggle`,e),Q(`toggle`,e),Qt(e,`popover`,r);break;case`xlinkActuate`:en(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:en(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:en(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:en(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:en(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:en(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:en(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:en(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:en(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Qt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=bn.get(n)||n,Qt(e,n,r);else return}P=!0}function tp(e,t,n,r,i,o){switch(n){case`style`:vn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)hn(e,r);else if(typeof r==`number`||typeof r==`bigint`)hn(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=Cn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Wt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),o=n.slice(2,i?n.length-7:void 0),t=e[Dt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,i);break a}P=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Qt(e,n,r)}return}P=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,i=!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`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:$(e,t,o,s,n,null)}}i&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=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(a(137,t));break;default:$(e,t,r,d,n,null)}}un(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&fn(e,!!r,n,!0):fn(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:$(e,t,s,c,n,null)}mn(e,r,i,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:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`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(a(137,t));default:$(e,t,u,r,n,null)}return;default:if(yn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}var rp={};function ip(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 i=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)||$(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`:m!==f&&(P=!0),o=m;break;case`name`:m!==f&&(P=!0),i=m;break;case`checked`:m!==f&&(P=!0),u=m;break;case`defaultChecked`:m!==f&&(P=!0),d=m;break;case`value`:m!==f&&(P=!0),s=m;break;case`defaultValue`:m!==f&&(P=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}ln(e,s,c,l,u,d,o,i);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)||$(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:o!==l&&(P=!0),p=o;break;case`defaultValue`:o!==l&&(P=!0),c=o;break;case`multiple`:o!==l&&(P=!0),s=o;default:o!==l&&$(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?fn(e,!!n,n?[]:``,!1):fn(e,!!n,t,!0)):fn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:i!==o&&(P=!0),p=i;break;case`defaultValue`:i!==o&&(P=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&$(e,t,s,i,r,o)}pn(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:$(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`:p!==m&&(P=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(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)&&$(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(a(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(yn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(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||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(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||$(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){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&&ap(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&&ap(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 sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(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 dp(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 fp(e,t,n,r){return n=lp(n).createElement(e),n[Et]=r,n[Dt]=t,np(n,e,t),Vt(n),n}function pp(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 mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(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),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Pt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(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 Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:C({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=v(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=lp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag!==6&&(e=v(e),t.observe(e),!1)}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag!==6&&(e=v(e),t.unobserve(e),!1)}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Lt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=S(n,a,x),t===null?t=!1:(p(t,!0,ee,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=S(r,a,x),t===null?t=!1:(p(t,!0,te,a,r),a=y,b=y=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(a(566));var t=[];p(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),Zp(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=v(i),Zp(i,n)):v(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=v(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(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`:nm(n),It(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(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[Pt])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=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(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 lm(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 um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(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 pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&$(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===Cn&&(e.onclick=null),It(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);It(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=D.d;D.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=zd();return e||t}function Cm(e){var t=Rt(e);t!==null&&t.tag===5&&t.type===`form`?ic(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=cn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Vt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+cn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+cn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+cn(n.imageSizes)+`"]`)):i+=`[href="`+cn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=C({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Ft]=!0,o.onload=o.onerror=function(){Ht(o)}),Vt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+cn(r)+`"][href="`+cn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=C({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Vt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Bt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=C({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Vt(c),np(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,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Bt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=C({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Vt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Bt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=C({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Vt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=Ae.current)?bm(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Bt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Pm(n.href);var o=Bt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(i,e,o,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Bt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Pm(e){return`href="`+cn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ft]){r.loading=1;return}}else t=e.createElement(`link`),t[Ft]=!0,t.onload=t.onerror=Ht.bind(null,t),np(t,`link`,n),Vt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+cn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+cn(n.href)+`"]`);if(r)return t.instance=r,Vt(r),r;var i=C({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Vt(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var o=e.querySelector(Fm(i));if(o)return t.state.loading|=4,t.instance=o,Vt(o),o;r=Im(n),(i=vm.get(i))&&Hm(r,i),o=(e.ownerDocument||e).createElement(`link`),Vt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(i=e.querySelector(zm(o)))?(t.instance=i,Vt(i),i):(r=n,(i=vm.get(o))&&(r=C({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Vt(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(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 Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,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[Pt]||a[Et]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(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 Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(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=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Vt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Vt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(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=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.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=nh.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 sh={$$typeof:ce,Provider:null,Consumer:null,_currentValue:Ce,_currentValue2:Ce,_threadCount:0};function ch(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=ht(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ht(0),this.hiddenUpdates=ht(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ii(3,null,null,t),e.current=a,a.stateNode=e,t=Fa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},vo(a),e}function uh(e){return e?(e=Pi,e):Pi}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=bo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=xo(e,r,t),n!==null&&(Pd(n,e,t),So(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=ji(e,67108864);t!==null&&Pd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=jd();t=xt(t);var n=ji(e,t);n!==null&&Pd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=2,yh(e,t,n,r)}finally{D.p=a,E.T=i}}function vh(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=8,yh(e,t,n,r)}finally{D.p=a,E.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Kf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Rt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=lt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-M(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(W&6)&&(vd=Ke()+500,Df(0,!1))}}break;case 31:case 13:s=ji(a,2),s!==null&&Pd(s,a,2),zd(),ph(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=Tn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Lt(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(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 xh=e,null}function Ch(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(j()){case qe:return 2;case Je:return 8;case Ye:case Xe:return 32;case Ze:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(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=Rt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Lt(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,wt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,wt(e.priority,function(){hh(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 Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);wn=r,n.target.dispatchEvent(r),wn=null}else return t=Rt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=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(Sh(r||n)===null)continue;break}var a=Rt(n);a!==null&&(e.splice(t,3),t-=3,nc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.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[Dt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Dt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){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 Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;dh(n,jd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),zd(),t[Ot]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ct();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.0`)throw Error(a(527,Kh,`19.3.0`));D.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:E,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{et=Jh.inject(qh),tt=Jh}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=Tc,s=Ec,c=Dc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,s,c,Uh),e[Ot]=t.current,Wf(e),new Wh(t)}})),P=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=Xt()})),Zt={name:`a-large-small`,size:24,node:[[`path`,{d:`m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16`,key:`xik6mr`}],[`path`,{d:`M15.697 14h5.606`,key:`1stdlc`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]]};Zt.node;var Qt=j(Zt),$t={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};$t.node;var en=j($t),tn={name:`app-window`,size:24,node:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]};tn.node;var nn=j(tn),rn={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};rn.node;var an=j(rn),on={name:`blocks`,size:24,node:[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]};on.node;var sn=j(on),cn={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};cn.node;var ln=j(cn),un={name:`bot`,size:24,node:[[`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`}]]};un.node;var dn=j(un),fn={name:`cable`,size:24,node:[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]};fn.node;var pn=j(fn),mn={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};mn.node;var hn=j(mn),gn={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};gn.node;var _n=j(gn),vn={name:`circle-dollar-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]};vn.node;var yn=j(vn),bn={name:`circle-euro`,size:24,node:[[`path`,{d:`M15 9.4a4 4 0 1 0 0 5.2`,key:`1makmb`}],[`path`,{d:`M7 12h5`,key:`gblrwe`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};bn.node;var xn=j(bn),Sn={name:`clapperboard`,size:24,node:[[`path`,{d:`m12.296 3.464 3.02 3.956`,key:`qash78`}],[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z`,key:`1h7j8b`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`4lm6w1`}],[`path`,{d:`m6.18 5.276 3.1 3.899`,key:`zjj9t3`}]]};Sn.node;var Cn=j(Sn),wn={name:`cloud-off`,size:24,node:[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};wn.node;var Tn=j(wn),En={name:`cloud`,size:24,node:[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]};En.node;var Dn=j(En),On={name:`coins`,size:24,node:[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]};On.node;var kn=j(On),An={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};An.node;var jn=j(An),Mn={name:`credit-card`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}],[`path`,{d:`M6 14h2`,key:`mk7k0u`}]]};Mn.node;var Nn=j(Mn),Pn={name:`ellipsis-vertical`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]],aliases:[`more-vertical`]};Pn.node;var Fn=j(Pn),In={name:`eye`,size:24,node:[[`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`}]]};In.node;var Ln=j(In),Rn={name:`fingerprint-pattern`,size:24,node:[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]],aliases:[`fingerprint`]};Rn.node;var zn=j(Rn),Bn={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};Bn.node;var Vn=j(Bn),Hn={name:`folder`,size:24,node:[[`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`}]]};Hn.node;var Un=j(Hn),Wn={name:`globe`,size:24,node:[[`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`}]]};Wn.node;var Gn=j(Wn),Kn={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};Kn.node;var qn=j(Kn),Jn={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};Jn.node;var Yn=j(Jn),Xn={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};Xn.node;var Zn=j(Xn),Qn={name:`images`,size:24,node:[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]};Qn.node;var $n=j(Qn),er={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};er.node;var tr=j(er),nr={name:`laptop`,size:24,node:[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]};nr.node;var rr=j(nr),ir={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};ir.node;var ar=j(ir),or={name:`layout-template`,size:24,node:[[`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`}]]};or.node;var sr=j(or),cr={name:`list-checks`,size:24,node:[[`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`}]]};cr.node;var lr=j(cr),ur={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};ur.node;var dr=j(ur),fr={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};fr.node;var pr=j(fr),mr={name:`message-circle-more`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}]]};mr.node;var hr=j(mr),gr={name:`message-circle`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]};gr.node;var _r=j(gr),vr={name:`message-square-text`,size:24,node:[[`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`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]};vr.node;var yr=j(vr),br={name:`mic-off`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]};br.node;var xr=j(br),Sr={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};Sr.node;var Cr=j(Sr),wr={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};wr.node;var Tr=j(wr),Er={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};Er.node;var Dr=j(Er),Or={name:`panel-bottom`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]};Or.node;var kr=j(Or),Ar={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};Ar.node;var jr=j(Ar),Mr={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};Mr.node;var Nr=j(Mr),Pr={name:`panel-top`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Pr.node;var Fr=j(Pr),Ir={name:`phone-call`,size:24,node:[[`path`,{d:`M13 2a9 9 0 0 1 9 9`,key:`1itnx2`}],[`path`,{d:`M13 6a5 5 0 0 1 5 5`,key:`11nki7`}],[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]};Ir.node;var Lr=j(Ir),Rr={name:`phone-off`,size:24,node:[[`path`,{d:`M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272`,key:`1wngk7`}],[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}],[`path`,{d:`M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473`,key:`10hv5p`}]]};Rr.node;var zr=j(Rr),Br={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};Br.node;var Vr=j(Br),Hr={name:`puzzle`,size:24,node:[[`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`}]]};Hr.node;var Ur=j(Hr),Wr={name:`radio`,size:24,node:[[`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`}]]};Wr.node;var Gr=j(Wr),Kr={name:`rotate-ccw-clock`,size:24,node:[[`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`}]],aliases:[`history`]};Kr.node;var qr=j(Kr),Jr={name:`rows-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]],aliases:[`panels-top-bottom`]};Jr.node;var Yr=j(Jr),Xr={name:`scan-text`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 8h8`,key:`1jbsf9`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h6`,key:`1vyc9m`}]]};Xr.node;var Zr=j(Xr),Qr={name:`settings`,size:24,node:[[`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`}]]};Qr.node;var $r=j(Qr),ei={name:`shapes`,size:24,node:[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]};ei.node;var ti=j(ei),ni={name:`share-2`,size:24,node:[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]};ni.node;var ri=j(ni),ii={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};ii.node;var ai=j(ii),oi={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};oi.node;var si=j(oi),ci={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};ci.node;var li=j(ci),ui={name:`table-2`,size:24,node:[[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]};ui.node;var di=j(ui),fi={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};fi.node;var pi=j(fi),mi={name:`type`,size:24,node:[[`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`}]]};mi.node;var hi=j(mi),gi={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};gi.node;var _i=j(gi),vi={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};vi.node;var yi=j(vi),bi={name:`volume-2`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]};bi.node;var xi=j(bi),Si={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};Si.node;var Ci=j(Si),wi=P(),F=t(i(),1),Ti=2800;function Ei({size:e=72}){let[t,n]=(0,N.useState)(0);return(0,N.useEffect)(()=>{if(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=window.setInterval(()=>n(e=>(e+1)%Pt.length),Ti);return()=>window.clearInterval(e)},[]),(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`relative inline-block shrink-0`,style:{width:e,height:e},children:Pt.map((n,r)=>(0,F.jsx)(`span`,{className:`absolute inset-0`,style:{opacity:+(r===t),transition:`opacity 0.45s ease`},children:(0,F.jsx)(It,{kind:n,size:e})},n))})}function Di({className:e,style:t,onDark:n=!1}){return(0,F.jsxs)(`span`,{className:e,style:t,children:[`engenty`,(0,F.jsx)(`span`,{style:{color:n?`oklch(88% 0.11 75)`:`var(--ember, oklch(64% 0.195 35))`},children:`.`})]})}var Oi=`wizards.theme`,ki=new Set,Ai=window.matchMedia(`(prefers-color-scheme: dark)`),ji=`engenty_theme`;function Mi(){let e=document.cookie.split(`;`).map(e=>e.trim()).find(e=>e.startsWith(`${ji}=`))?.slice(14);return e===`light`||e===`dark`||e===`system`?e:null}function Ni(e){let t=window.location.hostname,n=t.split(`.`),r=n.length>1&&!/^\d+$/.test(n[n.length-1])?n.length>2?n.slice(1).join(`.`):t:``,i=window.location.protocol===`https:`?`; Secure`:``;document.cookie=`${ji}=${e}; Path=/; Max-Age=31536000; SameSite=Lax${r?`; Domain=${r}`:``}${i}`}function Pi(){try{let e=Mi()??localStorage.getItem(Oi);return e===`system`?null:e===`light`?`light`:`dark`}catch{return`dark`}}var Fi=0;function Ii(){return Fi>0?`dark`:Pi()??(Ai.matches?`dark`:`light`)}function Li(){requestAnimationFrame(()=>{let e=document.querySelector(`meta[name="theme-color"]`),t=document.createElement(`canvas`).getContext(`2d`);if(!e||!t||!document.body)return;t.fillStyle=getComputedStyle(document.body).backgroundColor,t.fillRect(0,0,1,1);let[n,r,i]=t.getImageData(0,0,1,1).data;e.content=`#${[n,r,i].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`})}function Ri(){let e=Ii()===`dark`;document.documentElement.classList.toggle(`dark`,e),Li();for(let e of ki)e()}Ai.addEventListener(`change`,Ri),Mi()||Ni(Pi()??`system`),Ri();function zi(e){Ni(e??`system`);try{localStorage.setItem(Oi,e??`system`)}catch{document.documentElement.classList.toggle(`dark`,(e??Ii())===`dark`);return}Ri()}function Bi(){return(0,N.useSyncExternalStore)(e=>(ki.add(e),()=>ki.delete(e)),Pi)}function Vi(){return(0,N.useSyncExternalStore)(e=>(ki.add(e),()=>ki.delete(e)),()=>Pi()??(Ai.matches?`dark`:`light`))}function Hi(){return(0,N.useSyncExternalStore)(e=>(ki.add(e),()=>ki.delete(e)),()=>document.documentElement.classList.contains(`dark`)?`dark`:`light`)}var Ui=e=>`oklch(from ${Ft[Lt[e]??`cobalt`]} 0.34 calc(c * 0.6) h)`;function Wi(e){(0,N.useEffect)(()=>{if(!e)return;let t=document.documentElement;return Fi+=1,t.style.setProperty(`--stage`,e),Ri(),()=>{--Fi,t.style.removeProperty(`--stage`),Ri()}},[e])}function Gi(e){(0,N.useEffect)(()=>{if(!e)return;let t=document.documentElement;return t.style.setProperty(`--stage`,Ui(e)),Li(),()=>{t.style.removeProperty(`--stage`),Li()}},[e])}var Ki={name:`engenty wizards`,short:`wizards`},qi=(0,N.lazy)(()=>Nt(()=>import(`./fluffy-engenty-ClRou7yu.js`).then(e=>({default:e.FluffyEngenty})),__vite__mapDeps([0,1,2,3])));function Ji({kind:e,size:t=64,fluffy:n,coat:r,goggles:i=!1,interactive:a=!0}){let o=e||`round`,s=Hi(),c=r??(s===`dark`?`jelly`:`fur`);if(n&&t>=120&&(c===`fur`||s===`dark`))return(0,F.jsx)(N.Suspense,{fallback:(0,F.jsx)(It,{goggles:i,kind:o,size:Math.round(t*.62)}),children:(0,F.jsx)(qi,{goggles:i,coat:c,kind:o,size:t,quality:`medium`,interactive:a})});if(n&&t>=120){let e=Math.round(t*1.08);return(0,F.jsxs)(`div`,{"aria-hidden":`true`,className:`relative flex items-center justify-center overflow-hidden`,style:{background:Ui(o),borderRadius:t*.28,height:t,width:t},children:[(0,F.jsx)(`span`,{className:`pointer-events-none absolute rounded-full bg-white`,style:{filter:`blur(${t*.18}px)`,height:t*.8,opacity:.16,right:-t*.3,top:-t*.3,width:t*.8}}),(0,F.jsx)(`div`,{className:`relative`,style:{marginTop:t*.04},children:(0,F.jsx)(N.Suspense,{fallback:(0,F.jsx)(It,{goggles:i,kind:o,size:Math.round(e*.62)}),children:(0,F.jsx)(qi,{goggles:i,coat:`jelly`,kind:o,size:e,quality:`medium`,interactive:a})})})]})}return(0,F.jsx)(It,{goggles:i,kind:o,size:t,animated:a})}function Yi(){let e=Hi(),t=e===`dark`?`light`:`dark`;return(0,F.jsx)(T,{label:A(t===`dark`?`theme.dark`:`theme.light`),onClick:()=>zi(t),children:e===`dark`?(0,F.jsx)(li,{className:`size-4`}):(0,F.jsx)(Tr,{className:`size-4`})})}function Xi(e){return Object.fromEntries(at.filter(t=>e[t]?.startsWith(`apple:`)).map(e=>[e,``]))}function Zi(e){return e.split(/\s+/).map(e=>e[0]??``).join(``).slice(0,2).toUpperCase()}function Qi(){let e=aa().data?.limits.projects;return e===null||(e??1)>1}function $i(){return aa().data?.limits.build??!0}function ea(){return aa().data?.limits.create??!0}function ta(){let e=aa().data;return!e||e.mode===`local`||e.tenant.role!==`member`}function na(e){return e.mode===`managed`?e.credits:e.models?.source===`account`?e.account?.credits??null:null}function ra(){let e=x();return t=>{_t(t),e.setQueryData([`me`],e=>e&&{...e,lang:t}),k.put(`/api/studio/lang`,{lang:t}).catch(()=>void 0)}}function ia(e){let t=x();(0,N.useEffect)(()=>{if(!e)return;if(e.lang){_t(e.lang);return}let n=oe();n&&(t.setQueryData([`me`],e=>e&&{...e,lang:n}),k.put(`/api/studio/lang`,{lang:n}).catch(()=>void 0))},[e,t])}function aa(){return Ue({queryKey:[`me`],queryFn:async()=>{try{return await k.get(`/api/studio/me`)}catch(e){if(e instanceof We&&e.status===401)return null;throw e}},staleTime:3e4})}function oa(e=!0){return Ue({queryKey:[`projects`],queryFn:()=>k.get(`/api/studio/projects`),enabled:e})}var sa=`wz.project`;function I(){try{return localStorage.getItem(sa)}catch{return null}}var L=I(),ca=new Set;function la(e){L=e;try{localStorage.setItem(sa,e)}catch{}for(let e of ca)e()}function ua(){let e=oa(),t=(0,N.useSyncExternalStore)(e=>(ca.add(e),()=>ca.delete(e)),()=>L),n=e.data??[];return{project:n.find(e=>e.id===t)??n[0]??null,projects:n,select:la,loading:e.isLoading}}function da(e,t){return Ue({queryKey:[`cloud`,e],queryFn:()=>k.get(`/api/studio/wizards/${e}/cloud`),enabled:t})}function fa(e){return e instanceof We&&e.body?.code===`read_only`?e.message:null}async function pa(){let{account:e}=await(await fetch(a(`/api/auth/sign-out`),{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:`{}`})).json().catch(()=>({}));if(!e){window.location.href=`${Fe}/`;return}let t=document.createElement(`form`);t.method=`POST`,t.action=e;let n=document.createElement(`input`);n.type=`hidden`,n.name=`return`,n.value=`${window.location.origin}${Fe}/`,t.append(n),document.body.append(t),t.submit()}function ma(e=window.location.pathname,t){let n=new URLSearchParams({return:e});t?.trim()&&n.set(`wish`,t.trim()),window.location.href=a(`/api/auth/login?${n}`)}var ha=`wizards.wish`,ga=1;function _a(e){try{localStorage.setItem(ha,JSON.stringify({text:e,at:Date.now()}))}catch{}}function va(){try{let e=JSON.parse(localStorage.getItem(ha)??`null`);if(typeof e?.text==`string`&&typeof e.at==`number`&&Date.now()-e.at<ga*864e5)return e.text}catch{}return null}function ya(){try{localStorage.removeItem(ha)}catch{}}var ba=e({defineStudioPlugin:()=>xa});function xa(e){return e}var Sa=kt(),Ca=[`left`,`top`,`right`,`bottom`],wa=`wizards.appbar`,Ta={position:`left`},Ea=e=>Ca.includes(e);function Da(){try{let e=JSON.parse(localStorage.getItem(wa)??`null`);return{position:Ea(e?.position)?e.position:Ta.position}}catch{return Ta}}var Oa=Da(),ka=new Set;function Aa(e){Oa={...Oa,...e};try{localStorage.setItem(wa,JSON.stringify(Oa))}catch{}for(let e of ka)e()}var ja=`(max-width: 767px)`;function Ma(){return(0,N.useSyncExternalStore)(e=>{let t=window.matchMedia(ja);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)},()=>window.matchMedia(ja).matches)}function Na(){let e=(0,N.useSyncExternalStore)(e=>(ka.add(e),()=>ka.delete(e)),()=>Oa),t=Ma();return(0,N.useMemo)(()=>t?{position:e.position===`top`?`top`:`bottom`,phone:t}:{...e,phone:t},[e,t])}var Pa=e=>e===`top`||e===`bottom`;function Fa(e,t){switch(e){case`left`:return t===`start`?`top-0 left-full ml-3`:`bottom-0 left-full ml-3`;case`right`:return t===`start`?`top-0 right-full mr-3`:`bottom-0 right-full mr-3`;case`top`:return t===`start`?`top-full left-0 mt-3`:`top-full right-0 mt-3`;case`bottom`:return t===`start`?`bottom-full left-0 mb-3`:`bottom-full right-0 mb-3`}}var Ia={account:{kind:`release`,default:!0,label:`Account in a local install`,hint:`Linking, Settings → Account, the offer to sign in.`},unsetConnectors:{kind:`release`,default:!1,label:`Connectors without an OAuth client`,hint:`Built-in connectors are shown although their client is not set up.`},site:{kind:`release`,default:!1,label:`Link to the website in the setup`,hint:`The local install's setup links the product's site.`},teamPlans:{kind:`release`,default:!1,label:`Team plans`,hint:`The team page in the cloud studio, and plans that carry this switch on the account pages.`},brandSections:{kind:`release`,default:!1,label:`Sections in Info & brand`,hint:`Sections of logos and of colours, gradients and patterns among them.`},brandRules:{kind:`release`,default:!1,label:`Rules in Info & brand`,hint:`Rules for how the logos, the colours and the type may be used.`},typography:{kind:`release`,default:!1,label:`Typography in Info & brand`,hint:`The brand's fonts, their licences and a type scale.`},goose:{kind:`release`,default:!1,label:`Goose`,hint:`The studio's assistant: its chat at the foot of the page and in the sidebar.`},ownKeys:{kind:`plan`,default:!0,label:`Own API keys`,hint:`The team puts its providers' keys into the cloud studio instead of running on credits.`}};Object.keys(Ia);function La(e=Ia){let t={};for(let[n,r]of Object.entries(e))t[n]=r.default;return t}function Ra(){return Ue({queryKey:[`config`],queryFn:async()=>{let e=await k.get(`/api/config`);return be(e.publicUrl),e},staleTime:6e4})}function za(){let e=aa(),t=Ra();return e.data?.features??t.data?.features??La()}function Ba(e){return za()[e]===!0}var Va=()=>matchMedia(`(display-mode: standalone)`).matches||matchMedia(`(display-mode: window-controls-overlay)`).matches||navigator.standalone===!0,Ha=()=>navigator.userAgent,Ua=()=>/iPhone|iPad|iPod/.test(Ha())||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1,Wa=()=>!!navigator.userAgentData?.brands?.length||/Chrome|Chromium|Edg/.test(Ha()),Ga=()=>/Safari/.test(Ha())&&!/Chrome|Chromium|Edg|Firefox|FxiOS/.test(Ha());function Ka(e){return e?`prompt`:/Android/.test(Ha())?Wa()?`android`:`none`:Ua()?`ios`:Ga()?`mac`:Wa()?`chromium`:`none`}function qa(){return(0,N.useSyncExternalStore)(e=>(window.addEventListener(`wizard-install`,e),window.addEventListener(`appinstalled`,e),()=>{window.removeEventListener(`wizard-install`,e),window.removeEventListener(`appinstalled`,e)}),()=>window.wizardInstall??null)}async function Ja(e){try{await e.prompt()}finally{window.wizardInstall=null,window.dispatchEvent(new Event(`wizard-install`))}}var Ya=(0,N.lazy)(()=>Nt(()=>import(`./AboutDialog-L1hcshAX.js`).then(e=>({default:e.AboutDialog})),__vite__mapDeps([4,1,2,5,6,7,8])));function Xa(e){return O(`grid size-10 shrink-0 place-items-center rounded-lg transition`,e?`bg-paper text-ink shadow-soft dark:ring-1 dark:ring-border-soft`:`text-ink-3 hover:bg-ink/10 hover:text-ink`)}function Za({me:e}){let{project:t}=ua();return(0,F.jsx)(od,{me:e,placement:`bar-start`,label:t?.name??A(`nav.project`),className:e=>O(`block rounded-lg transition`,e?`ring-2 ring-ink/80 ring-offset-2 ring-offset-sidebar`:`hover:shadow-soft`),children:(0,F.jsx)(ad,{project:t})})}var Qa={left:jr,top:Fr,right:Nr,bottom:kr},$a=[{pick:`light`,icon:li,label:`appbar.light`},{pick:`dark`,icon:Tr,label:`appbar.dark`},{pick:null,icon:Cr,label:`appbar.system`}];function eo({at:e,onClose:t}){let{position:n,phone:r}=Na(),i=Bi(),a=r?[`top`,`bottom`]:Ca,o=(0,N.useRef)(null);nd(o,!0,t);let[s,c]=(0,N.useState)({x:0,y:0});(0,N.useLayoutEffect)(()=>{let e=o.current?.getBoundingClientRect();e&&c({x:Math.min(0,window.innerWidth-8-e.right),y:Math.min(0,window.innerHeight-8-e.bottom)})},[]);let l=`flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-[0.875rem] text-ink-2 hover:bg-accent hover:text-ink`,u=`px-3 pt-2 pb-1 font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.07em]`;return(0,F.jsxs)(`div`,{ref:o,role:`menu`,className:`fixed z-[60] w-56 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,style:{left:Math.max(8,e.x+s.x),top:Math.max(8,e.y+s.y)},onContextMenu:e=>e.preventDefault(),children:[(0,F.jsx)(`div`,{className:u,children:A(`appbar.position`)}),a.map(e=>{let r=Qa[e];return(0,F.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===n,className:O(l,e===n&&`text-ink`),onClick:()=>{Aa({position:e}),t()},children:[(0,F.jsx)(r,{className:`size-4`}),(0,F.jsx)(`span`,{className:`flex-1`,children:A(`appbar.${e}`)}),e===n?(0,F.jsx)(lt,{className:`size-4 text-ember-strong`}):null]},e)}),(0,F.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,F.jsx)(`div`,{className:u,children:A(`appbar.theme`)}),$a.map(({pick:e,icon:n,label:r})=>(0,F.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===i,className:O(l,e===i&&`text-ink`),onClick:()=>{zi(e),t()},children:[(0,F.jsx)(n,{className:`size-4`}),(0,F.jsx)(`span`,{className:`flex-1`,children:A(r)}),e===i?(0,F.jsx)(lt,{className:`size-4 text-ember-strong`}):null]},r))]})}function to({me:e}){let t=xd(),{position:n}=Na(),r=Pa(n),[i,a]=(0,N.useState)(null),[o,s]=(0,N.useState)(!1),c=e=>{e.preventDefault(),a({x:e.clientX,y:e.clientY})},l=(0,N.useRef)(null),u=(0,N.useRef)(!1),d=()=>{l.current&&=(window.clearTimeout(l.current.timer),null)};return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`aside`,{"aria-label":Ki.name,onContextMenu:c,onPointerDown:e=>{if(e.pointerType===`mouse`)return;d();let{clientX:t,clientY:n}=e;l.current={x:t,y:n,timer:window.setTimeout(()=>{l.current=null,u.current=!0,window.setTimeout(()=>{u.current=!1},700),a({x:t,y:n})},500)}},onPointerMove:e=>{l.current&&Math.hypot(e.clientX-l.current.x,e.clientY-l.current.y)>10&&d()},onPointerUp:d,onPointerCancel:d,onPointerLeave:d,onClickCapture:e=>{u.current&&(u.current=!1,e.preventDefault(),e.stopPropagation())},className:O(`flex shrink-0 select-none items-center bg-sidebar [-webkit-touch-callout:none]`,r?`w-full flex-row gap-1.5 px-2`:`h-full w-16 flex-col pt-2 pb-3`,n===`bottom`&&`pt-1.5 pb-[calc(0.375rem+env(safe-area-inset-bottom))]`,n===`top`&&`pt-[calc(0.375rem+env(safe-area-inset-top))] pb-1.5`),children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>s(!0),title:A(`about.title`),"aria-label":A(`about.title`),className:O(`grid shrink-0 place-items-center rounded-lg transition hover:bg-ink/10`,r?`size-11`:`h-12 w-11`),children:(0,F.jsx)(Ei,{size:32})}),(0,F.jsx)(`div`,{className:r?`ml-1`:`mt-2`,children:(0,F.jsx)(Za,{me:e})}),(0,F.jsx)(Je,{to:`/space`,title:A(`nav.project`),"aria-label":A(`nav.project`),className:({isActive:e})=>O(Xa(e),r?`ml-1.5`:`mt-2`),children:(0,F.jsx)(Yn,{className:`size-5`})}),t.nav.length?(0,F.jsx)(`div`,{className:O(`shrink-0 bg-border`,r?`mx-2 h-7 w-px`:`my-3 h-px w-7`)}):null,(0,F.jsx)(`nav`,{className:O(`flex min-h-0 min-w-0 flex-1 items-center gap-1.5`,r?`flex-row overflow-x-auto`:`flex-col overflow-y-auto`),children:t.nav.map(e=>(0,F.jsx)(Kd,{of:e,children:(0,F.jsx)(Je,{to:e.to,title:e.label(),"aria-label":e.label(),className:({isActive:e})=>Xa(e),children:(0,F.jsx)(e.icon,{className:`size-5`})})},e.serial))}),(0,F.jsxs)(`div`,{className:O(`flex shrink-0 items-center gap-2`,r?`flex-row pl-3`:`flex-col pt-3`),children:[(0,F.jsx)(Je,{to:`/settings`,title:A(`nav.settings`),"aria-label":A(`nav.settings`),className:({isActive:e})=>Xa(e),children:(0,F.jsx)($r,{className:`size-5`})}),(0,F.jsx)(ud,{me:e,placement:`bar-end`})]}),i?(0,F.jsx)(eo,{at:i,onClose:()=>a(null)}):null]}),o?(0,F.jsx)(N.Suspense,{fallback:null,children:(0,F.jsx)(Ya,{open:!0,me:e,onClose:()=>s(!1)})}):null]})}var no=`wz.readAloud`,ro=typeof window<`u`&&`speechSynthesis`in window&&`SpeechSynthesisUtterance`in window;function io(){try{return localStorage.getItem(no)===`1`}catch{return!1}}function ao(e){try{localStorage.setItem(no,e?`1`:`0`)}catch{}}function oo(e){let t=window.speechSynthesis.getVoices(),n=e.slice(0,2);return t.find(t=>t.lang===e&&t.default)??t.find(t=>t.lang===e)??t.find(e=>e.lang.startsWith(n)&&e.default)??t.find(e=>e.lang.startsWith(n))??null}function so(e,t=S,n=!1){if(!ro||!e.trim())return;let r=window.speechSynthesis;n&&r.cancel();let i=Ke[t],a=new SpeechSynthesisUtterance(e.trim().slice(0,2e3));a.lang=i;let o=oo(i);o&&(a.voice=o),r.speak(a)}function co(e,t=S){if(!ro||!e.trim())return Promise.resolve();let n=window.speechSynthesis;n.cancel();let r=Ke[t],i=new SpeechSynthesisUtterance(e.trim().slice(0,4e3));i.lang=r;let a=oo(r);return a&&(i.voice=a),new Promise(e=>{i.onend=()=>e(),i.onerror=()=>e(),n.speak(i)})}function lo(e){return e.replace(/```[\s\S]*?```/g,``).replace(/!\[[^\]]*\]\([^)]*\)/g,``).replace(/\[([^\]]+)\]\([^)]*\)/g,`$1`).replace(/https?:\/\/\S+/g,``).replace(/^#+\s*/gm,``).replace(/^\s*[-*]\s+/gm,``).replace(/[*_`>|]/g,``).replace(/\n{2,}/g,`. `).replace(/\s+/g,` `).trim()}function uo(){ro&&window.speechSynthesis.cancel()}function fo(){let[e,t]=(0,N.useState)(()=>ro&&io()),n=(0,N.useCallback)(e=>{t(e),ao(e),e||uo()},[]);return(0,N.useEffect)(()=>{ro&&window.speechSynthesis.getVoices()},[]),(0,N.useEffect)(()=>()=>uo(),[]),[e,n]}function po(e,t,n,r){let i=(0,N.useRef)(null);(0,N.useEffect)(()=>{if(!e){i.current=null;return}let a=n.map(e=>e.key);if(!i.current){i.current=new Set(a);let e=[...n].reverse().find(e=>e.who===`bot`&&e.spoken!==!1);if(e){let n=r(e.key);n&&so(n,t,!0)}return}let o=n.filter(e=>!i.current?.has(e.key));for(let e of a)i.current.add(e);o.some(e=>e.who===`me`)&&uo();for(let e of o)if(e.who===`bot`&&e.spoken!==!1){let n=r(e.key);n&&so(n,t)}},[e,t,n,r])}var mo=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function ho(e){let t=e.filter(e=>e.type.startsWith(`image/`));return t.length?Object.fromEntries(t.map(e=>[e.name,URL.createObjectURL(e)])):void 0}function go(e){let t=e.match(/(?:^|\n\n)(?:Angehängt|Attached): ([^\n]+)$/);return t?{text:e.slice(0,t.index).trim(),names:t[1].split(`, `).filter(Boolean)}:{text:e,names:[]}}function _o({names:e,previews:t,fileUrl:n}){let r=e.filter(e=>t?.[e]||n&&mo.test(e)),i=e.filter(e=>!r.includes(e));return(0,F.jsxs)(`div`,{className:`flex flex-col items-end gap-1.5`,children:[r.map(e=>{let r=t?.[e]??n?.(e)??``;return(0,F.jsx)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,title:e,children:(0,F.jsx)(`img`,{src:r,alt:e,className:`max-h-60 w-auto max-w-full rounded-xl bg-paper-2 object-contain ring-1 ring-border`})},e)}),i.length?(0,F.jsx)(`div`,{className:`flex flex-wrap justify-end gap-1.5`,children:i.map(e=>(0,F.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1.5 rounded-full bg-paper-2 px-2.5 py-1 text-[0.75rem] text-ink-2`,children:[(0,F.jsx)(jt,{className:`size-3 shrink-0 text-ink-4`}),(0,F.jsx)(`span`,{className:`truncate`,children:e})]},e))}):null]})}function vo(e,t){let n=x(),[r,i]=(0,N.useState)([]),[o,s]=(0,N.useState)(`idle`),[c,l]=(0,N.useState)(null),[u,d]=(0,N.useState)(null),[f,p]=(0,N.useState)(null),[m,h]=(0,N.useState)(null),g=(0,N.useRef)(null);return(0,N.useEffect)(()=>{if(e){if(g.current!==e.id){g.current=e.id,i(e.messages);return}o===`idle`&&i(t=>e.messages.length>=t.length?e.messages:t)}},[e,o]),{messages:r,phase:o,activity:u,thought:f,startedAt:m,error:c,send:async(r,c=[])=>{if(!e||!(r.trim()||c.length)||o!==`idle`)return!1;if(l(null),h(Date.now()),p(null),c.length){s(`thinking`);try{for(let t of c){let n=await fetch(a(`/api/studio/wizards/${e.id}/files/${encodeURIComponent(t.name)}`),{method:`PUT`,credentials:`include`,headers:{"content-type":t.type||`application/octet-stream`,"accept-language":S},body:t});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??n.statusText)}}}catch(t){return l(t.message),s(`idle`),h(null),await n.invalidateQueries({queryKey:[`wizard`,e.id]}),!1}let t=`${A(`editor.attached`)}: ${c.map(e=>e.name).join(`, `)}`;r=r.trim()?`${r}\n\n${t}`:t}let u=`p-${Date.now()}`;i(e=>[...e,{id:`u-${Date.now()}`,role:`user`,content:r,previews:ho(c)},{id:u,role:`assistant`,content:``,pending:!0}]),s(`thinking`),d(null);let f=!1;try{await ee(`/api/studio/wizards/${e.id}/chat`,{message:r},(e,n)=>{if(e===`text`){let e=JSON.parse(n);i(t=>t.map(t=>t.id===u?{...t,content:t.content+e}:t))}else if(e===`activity`)d(JSON.parse(n));else if(e===`thought`)p(JSON.parse(n));else if(e===`building`)s(`building`);else if(e===`done`){f=!0;let e=JSON.parse(n);i(t=>t.map(t=>t.id===u?{...t,content:e.reply,changed:e.changed,pending:!1}:t)),e.changed&&t(e.draft,e.revision)}else e===`error`&&(f=!0,l(JSON.parse(n).message))}),f||l(A(`editor.chatBroken`))}catch(e){l(e.message)}finally{d(null),p(null),h(null),i(e=>e.filter(e=>!(e.id===u&&!e.content)).map(e=>({...e,pending:!1}))),s(`idle`),await n.invalidateQueries({queryKey:[`wizard`,e.id]}),await n.invalidateQueries({queryKey:[`me`]})}return!0},fileUrl:t=>a(`/api/studio/wizards/${e?.id}/files/${encodeURIComponent(t)}`)}}function yo(e){let[t,n]=(0,N.useState)(()=>Date.now());return(0,N.useEffect)(()=>{if(e===null)return;n(Date.now());let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),e===null?null:Math.max(0,Math.floor((t-e)/1e3))}function bo(e){return e<60?`${e} s`:`${Math.floor(e/60)}:${String(e%60).padStart(2,`0`)} min`}function xo({chat:e,thought:t,className:n,spinner:r=`size-3.5`}){let i=yo(e.startedAt);return(0,F.jsxs)(`div`,{className:O(`min-w-0`,n),children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,F.jsx)(D,{className:O(`shrink-0`,r)}),(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:e.activity??(e.phase===`building`?A(`editor.building`):A(`editor.thinking`))}),i===null?null:(0,F.jsx)(`span`,{className:`shrink-0 text-ink-4 tabular-nums`,children:bo(i)})]}),t&&e.thought?(0,F.jsx)(`p`,{className:`mt-0.5 truncate pl-5.5 text-[0.75rem] text-ink-4`,children:e.thought}):null]})}function So({message:e,fileUrl:t}){let{text:n,names:r}=go(e.content);return(0,F.jsxs)(`div`,{className:`ml-8 flex flex-col items-end gap-1.5 self-end`,children:[e.signal?(0,F.jsx)(`span`,{className:`text-[0.6875rem] text-ink-4`,children:A(`assistant.signalled`)}):null,r.length?(0,F.jsx)(_o,{names:r,previews:e.previews,fileUrl:t}):null,n?(0,F.jsx)(`div`,{className:`rounded-xl rounded-br-md bg-paper-2 px-4 py-2.5 text-[0.875rem] leading-relaxed`,children:(0,F.jsx)(`span`,{className:`whitespace-pre-wrap`,children:n})}):null]})}function Co({chat:e,avatar:t,changedLabel:n,card:r,calls:i,foot:a}){return(0,F.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.messages.map(s=>s.role===`user`?(0,F.jsx)(So,{message:s,fileUrl:e.fileUrl},s.id):(0,F.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,F.jsx)(`div`,{className:`shrink-0`,children:(0,F.jsx)(Ji,{kind:t,size:28,interactive:!1})}),(0,F.jsxs)(`div`,{className:`min-w-0 pt-0.5 text-[0.875rem]`,children:[s.source===`mcp`?(0,F.jsxs)(`div`,{className:`mb-1 inline-flex items-center gap-1.5 text-[0.75rem] text-ink-3`,children:[(0,F.jsx)(Vr,{className:`size-3`}),` `,A(`editor.viaClient`,{client:s.client??`MCP`})]}):null,i?i(s):null,s.content?(0,F.jsx)(ft,{text:s.content,className:`text-[0.875rem]`}):null,r&&s.cards?.length?(0,F.jsx)(`div`,{className:`mt-2 flex flex-col gap-2`,children:s.cards.map(e=>(0,F.jsx)(N.Fragment,{children:r(e)},e.id))}):null,s.pending?(0,F.jsx)(xo,{chat:e,thought:!0,className:`mt-1 text-[0.8125rem] text-ink-3`}):null,s.changed?(0,F.jsxs)(`div`,{className:`mt-2 inline-flex items-center gap-1.5 rounded-full bg-ember-tint px-2.5 py-0.5 text-[0.75rem] text-ember-strong`,children:[(0,F.jsx)(o,{className:`size-3`}),` `,n]}):null,a?a(s):null]})]},s.id))})}function wo({chat:e,avatar:t,hello:n=A(`editor.chatHello`),placeholder:r=A(`editor.composer`),changedLabel:i=`Ablauf aktualisiert`,compact:a,intro:o,closed:s,card:c}){let[l,u]=(0,N.useState)(!1),d=(0,N.useRef)(null),f=(0,N.useRef)(null);(0,N.useEffect)(()=>{d.current?.scrollTo({top:d.current.scrollHeight,behavior:`smooth`})},[e.messages,e.phase]);let p=!a||l,m=e.messages.at(-1),[h,g]=(0,N.useState)(!1),_=(0,N.useRef)(0),v=e=>!s&&e.dataTransfer.types.includes(`Files`);return(0,F.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,onDragEnter:e=>{v(e)&&(e.preventDefault(),_.current+=1,g(!0))},onDragOver:e=>{v(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)},onDragLeave:()=>{_.current=Math.max(0,_.current-1),_.current===0&&g(!1)},onDrop:e=>{v(e)&&(e.preventDefault(),_.current=0,g(!1),f.current?.add(Array.from(e.dataTransfer.files).map(qe)),f.current?.focus())},children:[h?(0,F.jsxs)(`div`,{className:`pointer-events-none absolute inset-3 z-20 flex flex-col items-center justify-center gap-2 rounded-2xl border-2 border-ember border-dashed bg-ember-veil text-[0.875rem] text-ember-strong`,children:[(0,F.jsx)(jt,{className:`size-6`}),A(`editor.dropToAttach`)]}):null,(0,F.jsxs)(`div`,{className:a?O(`mb-2 flex min-h-0 flex-col overflow-hidden rounded-2xl bg-card shadow-overlay ring-1 ring-border`,!(m||e.error)&&`hidden`):`contents`,children:[a&&(m||e.error)?(0,F.jsxs)(`button`,{type:`button`,"aria-expanded":l,"aria-label":A(`editor.thread`),onClick:()=>u(e=>!e),className:`flex items-center gap-2 px-4 pt-2.5 pb-0.5 text-left text-[0.8125rem] text-ink-3 transition hover:text-ink`,children:[!(e.error||l)&&m?.pending?(0,F.jsx)(xo,{chat:e,className:`flex-1`}):(0,F.jsx)(`span`,{className:O(`min-w-0 flex-1 truncate`,e.error&&`text-rose`),children:e.error??(l?A(`editor.thread`):m?.content)}),l?(0,F.jsx)(Ct,{className:`size-4 shrink-0`}):(0,F.jsx)(_n,{className:`size-4 shrink-0`})]}):null,(0,F.jsxs)(`div`,{ref:d,className:O(`min-h-0 flex-1 overflow-y-auto px-5 py-5`,!p&&`hidden`),children:[e.messages.length===0&&!s?o??(0,F.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,F.jsx)(Ji,{kind:t,size:32,interactive:!1}),(0,F.jsx)(`p`,{className:`pt-1 text-[0.875rem] text-ink-2 leading-relaxed`,children:n})]}):null,(0,F.jsx)(Co,{chat:e,avatar:t,changedLabel:i,card:c}),e.error?(0,F.jsx)(`div`,{className:`mt-4 rounded-lg bg-rose-tint px-3 py-2 text-[0.8125rem] text-rose`,children:e.error}):null]})]}),s?(0,F.jsx)(`p`,{className:`m-3 rounded-xl bg-paper-2 px-4 py-3 text-[0.8125rem] text-ink-2 leading-relaxed`,children:s}):(0,F.jsx)(bt,{ref:f,floating:a,className:a?void 0:`p-3`,placeholder:r,disabled:e.phase!==`idle`,onSend:(t,n)=>e.send(t,n)})]})}function To(e,t){return[{id:`account`,label:A(`account.title`),icon:_i,menu:!0},...e?.mode===`managed`&&e.features.teamPlans?[{id:`team`,label:A(`team.title`),icon:yi,menu:!0}]:[],{id:`connectors`,label:A(`connectors.title`),icon:Vr,menu:!0},{id:`models`,label:A(`local.title`),icon:jn,menu:!0},{id:`integrate`,label:A(`integrate.nav`),icon:pn,menu:!0},...t.sections.map(e=>({id:e.id,label:e.label(),icon:e.icon,menu:e.menu??!1,plugin:e})),...t.plugins.length||t.problems.length||t.canReload&&e?.account?[{id:`plugins`,label:A(`plugins.title`),icon:sn,menu:!1}]:[]]}var Eo=`wizards.assistant`,Do={place:`center`,free:null,height:null,dev:!1};function Oo(){try{let e=JSON.parse(localStorage.getItem(Eo)??`null`);return{place:e?.place===`right`||e?.place===`free`?e.place:`center`,free:typeof e?.free?.left==`number`&&typeof e.free.bottom==`number`?{left:e.free.left,bottom:e.free.bottom}:null,height:typeof e?.height==`number`?e.height:null,dev:e?.dev===!0}}catch{return Do}}var ko=Oo(),Ao=new Set,jo=()=>{for(let e of Ao)e()},Mo=e=>(Ao.add(e),()=>Ao.delete(e));function No(e){ko={...ko,...e};try{localStorage.setItem(Eo,JSON.stringify(ko))}catch{}jo()}function Po(){return(0,N.useSyncExternalStore)(Mo,()=>ko)}var Fo=64,Io=12,Lo=null,Ro=new Set;function zo(e){Lo=e;for(let e of Ro)e()}function Bo(){return(0,N.useSyncExternalStore)(e=>(Ro.add(e),()=>Ro.delete(e)),()=>Lo)}var Vo=e=>Math.min(600,e-24);function Ho(e,t,n){let r=Vo(e.width),i=e.height-Io-t;return{center:{left:(e.width-r)/2,top:i,width:r,height:t},right:e.width>=r+24+240?{left:e.width-Io-r,top:i,width:r,height:t}:null,sidebar:n?{left:e.width-400+8,top:8,width:384,height:e.height-16}:null}}var Uo=e=>e>=Vo(e)+24+240;function Wo(e,t){if(e.button!==0)return;e.preventDefault();let n={x:e.clientX,y:e.clientY},r=t.frame()?.getBoundingClientRect(),i=r?{x:n.x-r.left,y:n.y-r.top}:{x:28,y:24},a=!1,o=null,s=r=>{if(r.pointerId!==e.pointerId||!a&&Math.hypot(r.clientX-n.x,r.clientY-n.y)<5)return;a||(a=!0,document.body.style.userSelect=`none`,t.onLeave?.());let s=t.column()?.getBoundingClientRect();if(!s)return;let c=t.frame()?.getBoundingClientRect(),l=Vo(s.width),u=c?.height??160,d=Math.min(Math.max(r.clientX-s.left-i.x,8),Math.max(8,s.width-120)),f=Math.min(Math.max(r.clientY-s.top-i.y,8),Math.max(8,s.height-u-8)),p=Ho(s,u,t.sidebar),m=s.height-(f+u)<Fo,h=s.width-(d+l)<Fo||window.innerWidth-r.clientX<Fo,g=null;if(p.sidebar&&h&&(!m||window.innerWidth-r.clientX<Fo))g=`sidebar`;else if(m){let e=d+l/2;g=p.right&&Math.abs(e-(p.right.left+l/2))<Math.abs(e-(p.center.left+l/2))?`right`:`center`}o={left:d,top:f,width:l,zone:g,spot:g&&p[g]||o?.spot||null},zo(o)},c=n=>{if(n.pointerId!==e.pointerId)return;window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),document.body.style.userSelect=``;let r=o;if(zo(null),!a){t.onClick?.();return}if(!r)return;if(r.zone){t.onDrop(r.zone);return}let i=t.column()?.getBoundingClientRect(),l=t.frame()?.getBoundingClientRect().height??0;t.onDrop(`free`,{left:Math.round(r.left),bottom:Math.round((i?.height??0)-r.top-l)})};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,c),window.addEventListener(`pointercancel`,c)}var Go=1300,R=3e3;function z(){let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition}var Ko=typeof window<`u`&&(!!z()||!!navigator.mediaDevices?.getUserMedia&&typeof MediaRecorder<`u`);function qo(e){return e.toLowerCase().split(/[\s\-–—/]+/).map(e=>e.replace(/[^\p{L}\p{N}]/gu,``)).filter(Boolean)}function Jo(e,t){let n=new Set(qo(t)),r=qo(e);return r.length<2||r.filter(e=>n.has(e)).length/r.length>=.75}function Yo(e){let[t,n]=(0,N.useState)(`off`),[r,i]=(0,N.useState)(!1),[o,s]=(0,N.useState)(null),[c,l]=(0,N.useState)(null),[u,d]=(0,N.useState)(0),[f,p]=(0,N.useState)(``),[m,h]=(0,N.useState)(null),g=(0,N.useRef)(`off`),_=(0,N.useRef)(!1),v=(0,N.useRef)(null),y=(0,N.useRef)(null),b=(0,N.useRef)(null),ee=(0,N.useRef)(``),te=(0,N.useRef)({text:``,until:0}),x=(0,N.useRef)(``),C=(0,N.useRef)(null),ne=(0,N.useRef)(null),re=(0,N.useRef)(e);re.current=e;let ie=(0,N.useRef)(m);ie.current=m;let w=(0,N.useCallback)(e=>{g.current=e,n(e)},[]),ae=(0,N.useCallback)(()=>{uo(),b.current&&=(b.current.pause(),null),ee.current=``},[]),oe=(0,N.useCallback)(()=>{C.current&&=(clearTimeout(C.current),null);let e=x.current.trim();x.current=``,p(``),e&&g.current!==`off`&&(w(`thinking`),ne.current=re.current.messages.at(-1)?.id??null,re.current.send(e).then(e=>{!e&&g.current===`thinking`&&w(`listening`)}))},[w]),se=(0,N.useCallback)((e,t)=>{if(!(_.current||g.current===`off`||g.current===`thinking`)){if(g.current===`speaking`){if(Jo(e,ee.current))return;ae(),w(`listening`)}else if(Date.now()<te.current.until&&Jo(e,te.current.text))return;p(e),t&&(x.current=`${x.current} ${e}`.trim(),p(x.current)),C.current&&clearTimeout(C.current),C.current=setTimeout(oe,Go)}},[oe,ae,w]),ce=(0,N.useCallback)(()=>{let e=z();if(!e||v.current)return;let t=new e;t.continuous=!0,t.interimResults=!0,t.lang=Ke[S],t.onresult=e=>{let t=``;for(let n=e.resultIndex;n<e.results.length;n++){let r=e.results[n];r.isFinal?se(r[0].transcript,!0):t+=r[0].transcript}t.trim()&&se(`${x.current} ${t}`.trim(),!1)},t.onerror=e=>{(e.error===`not-allowed`||e.error===`service-not-allowed`)&&l(`denied`)},t.onend=()=>{v.current=null,g.current!==`off`&&!_.current&&setTimeout(ce,200)},v.current=t;try{t.start()}catch{v.current=null}},[se]),le=(0,N.useCallback)((e,t)=>{let n=null,r=[],i=0,a=new Uint8Array(t.fftSize),o=()=>{if(g.current===`off`){n?.stop();return}t.getByteTimeDomainData(a);let s=0;for(let e of a)s=Math.max(s,Math.abs(e-128)/128);if(s>.08&&!_.current&&g.current===`listening`){if(i=Date.now(),!n){let t=Date.now()<te.current.until?te.current.text:``;r=[],n=new MediaRecorder(e),n.ondataavailable=e=>e.data.size&&r.push(e.data),n.onstop=async()=>{let e=new File(r,`live`,{type:(n?.mimeType||`audio/webm`).split(`;`)[0]});if(n=null,e.size&&g.current!==`off`){w(`thinking`);try{let{text:n}=await k.upload(`/api/studio/transcribe`,e);if(t&&Jo(n,t)){w(`listening`);return}x.current=n,oe()}catch(e){l(e.message),w(`listening`)}}},n.start()}}else n&&Date.now()-i>Go&&n.stop();setTimeout(o,100)};o()},[oe,w]),ue=(0,N.useCallback)(async()=>{if(g.current!==`off`)return;l(null);let e;try{e=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})}catch{l(`denied`);return}y.current=e,ne.current=re.current.messages.at(-1)?.id??null,w(`listening`),s(Date.now());let t=new AudioContext,n=t.createAnalyser();n.fftSize=512,t.createMediaStreamSource(e).connect(n);let r=new Uint8Array(n.fftSize),i=()=>{if(g.current===`off`){t.close();return}n.getByteTimeDomainData(r);let e=0;for(let t of r)e=Math.max(e,Math.abs(t-128)/128);d(_.current?0:Math.min(1,e*3)),setTimeout(i,90)};i(),z()?ce():le(e,n),ie.current||k.get(`/api/studio/assistant/voice`).then(({way:e})=>h({way:e,natural:e===`key`||e===`local`})).catch(()=>h({way:`none`,natural:!1}))},[ce,le,w]),de=(0,N.useCallback)(()=>{w(`off`),s(null),p(``),d(0),x.current=``,C.current&&clearTimeout(C.current),v.current?.abort(),v.current=null,ae();for(let e of y.current?.getTracks()??[])e.stop();y.current=null},[ae,w]),fe=(0,N.useCallback)(()=>{let e=!_.current;_.current=e,i(e);for(let t of y.current?.getAudioTracks()??[])t.enabled=!e;e?(v.current?.abort(),v.current=null):g.current!==`off`&&ce()},[ce]),T=(0,N.useCallback)(async e=>{let t=lo(e);if(!t){w(`listening`);return}w(`speaking`),ee.current=t;let n=ie.current?.natural&&ie.current.way!==`none`,r=!1;if(n)try{let e=await fetch(a(`/api/studio/assistant/speak`),{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify({text:t.slice(0,4e3)})});if(e.ok&&g.current===`speaking`){let t=URL.createObjectURL(await e.blob()),n=new Audio(t);b.current=n,await new Promise(e=>{n.onended=()=>e(),n.onerror=()=>e(),n.onpause=()=>e(),n.play().catch(()=>e())}),URL.revokeObjectURL(t),r=!0}}catch{}!r&&g.current===`speaking`&&await co(t,S),b.current=null,ee.current=``,g.current===`speaking`&&(te.current={text:t,until:Date.now()+R},x.current=``,p(``),v.current?.abort(),w(`listening`))},[w]);return(0,N.useEffect)(()=>{if(t!==`thinking`||e.phase!==`idle`)return;let n=e.messages.at(-1);n?.role===`assistant`&&n.id!==ne.current&&!n.pending?(ne.current=n.id,T(n.content)):e.error&&w(`listening`)},[t,e.phase,e.messages,e.error,T,w]),(0,N.useEffect)(()=>()=>de(),[de]),{state:t,muted:r,since:o,error:c,level:u,heard:f,voice:m,setNatural:e=>h(t=>t&&{...t,natural:e}),start:ue,end:de,toggleMute:fe}}var Xo=new Map,Zo={},Qo=new Set;function $o(){Zo=Object.assign({},...Xo.values());for(let e of Qo)e()}function B(){return(0,N.useSyncExternalStore)(e=>(Qo.add(e),()=>Qo.delete(e)),()=>Zo)}function es(){for(let e of Xo.values())e.onChanged?.()}function ts(e){let t=(0,N.useId)(),n=(0,N.useRef)(e);n.current=e;let{onChanged:r,...i}=e,a=JSON.stringify(i);(0,N.useEffect)(()=>{Xo.set(t,{...JSON.parse(a),onChanged:()=>n.current.onChanged?.()}),$o()},[t,a]),(0,N.useEffect)(()=>()=>{Xo.delete(t),$o()},[t])}function ns(){let e=document.getElementById(md);if(!e)return;let t=e.getBoundingClientRect().top;for(let n of e.querySelectorAll(`[data-assist-section]`)){let e=n.getBoundingClientRect();if(e.bottom>t+40&&e.top<window.innerHeight*.6)return n.dataset.assistSection||void 0}}function rs(){let{title:e,hello:t,placeholder:n,suggestions:r,compact:i,onChanged:a,...o}=Zo,s=ed().map(e=>e.label),c=window.location.pathname,l=c.startsWith(Fe)?c.slice(Fe.length)||`/`:c,u=ns(),d=(e,t)=>e&&e.length>t?`${e.slice(0,t-1)}…`:e;return{route:`${l}${window.location.search}`.slice(0,400),...s.length?{title:d(s.join(` / `),200)}:{},...u?{view:d(u,200)}:{},...o.open?{open:{kind:o.open.kind.slice(0,60),...o.open.id?{id:o.open.id.slice(0,120)}:{},label:d(o.open.label,200)??``}}:{},...o.selection?{selection:o.selection.slice(0,100).map(e=>e.slice(0,120))}:{},...o.summary?{summary:d(o.summary,2e3)}:{},...o.fields?{fields:o.fields.slice(0,60).map(e=>({id:e.id.slice(0,120),label:d(e.label,200)??``,value:e.value}))}:{},...o.plugin?{plugin:o.plugin}:{}}}var is=()=>document.getElementById(`studio-scroll`)??document.body,as=`[data-assist],h1,h2,h3,h4,button,a[href],input,textarea,select,[role=switch],[role=checkbox],[role=tab],[contenteditable=true]`,os=150,ss=0;function cs(e){return e.dataset.assist?e.dataset.assist:(e.dataset.assistRef||(ss+=1,e.dataset.assistRef=`e${ss}`),e.dataset.assistRef)}var V=(e,t=120)=>(e??``).replace(/\s+/g,` `).trim().slice(0,t);function ls(e){if(e.dataset.assistLabel)return V(e.dataset.assistLabel);let t=e.getAttribute(`aria-label`);if(t)return V(t);if(e.dataset.assist&&!e.matches(`input,textarea,select,button,a`)){let t=e.querySelector(`h1,h2,h3,h4,[data-assist-section]`);if(t)return V(t.getAttribute(`data-assist-section`)||t.textContent)}if(e.id){let t=document.querySelector(`label[for="${CSS.escape(e.id)}"]`);if(t)return V(t.textContent)}let n=e.closest(`label`);if(n&&n!==e)return V(n.textContent);let r=e.parentElement?.querySelector(`label`);return r&&(e.matches(`input,textarea,select`)||e.getAttribute(`role`)===`switch`)?V(r.textContent):V(e.textContent||e.placeholder||e.getAttribute(`title`)||``)}function us(e){if(e instanceof HTMLInputElement)return e.type===`password`?e.value?`••••`:``:e.type===`checkbox`||e.type===`radio`?e.checked:e.value.slice(0,300);if(e instanceof HTMLTextAreaElement)return e.value.slice(0,600);if(e instanceof HTMLSelectElement)return V(e.selectedOptions[0]?.textContent??e.value);let t=e.getAttribute(`role`);if(t===`switch`||t===`checkbox`)return e.getAttribute(`aria-checked`)===`true`;if(e.isContentEditable)return V(e.textContent,600)}function ds(e){return e.dataset.assist&&!e.matches(`input,textarea,select,button,a`)?`area`:/^H[1-4]$/.test(e.tagName)?`heading`:e.matches(`input,textarea,select,[role=switch],[role=checkbox],[contenteditable=true]`)?`field`:e.getAttribute(`role`)===`tab`?`tab`:e.tagName===`A`?`link`:`button`}function fs(e){if(e.closest(`[data-assistant-ui],[aria-hidden=true]`))return!1;let t=getComputedStyle(e);if(t.display===`none`||t.visibility===`hidden`)return!1;let n=e.getBoundingClientRect();return n.width>0||n.height>0}function ps(e){let t=e.getBoundingClientRect();return t.bottom>0&&t.top<window.innerHeight&&t.right>0&&t.left<window.innerWidth}function ms(e,t){let n=[];for(let r of e.querySelectorAll(as)){if(n.length>=os)break;if(!fs(r)||t&&!ps(r))continue;let e=ds(r),i=ls(r);if(!i&&e!==`field`)continue;let a=e===`field`?us(r):void 0,o=r.disabled||r.getAttribute(`aria-disabled`)===`true`;n.push({ref:cs(r),kind:e,label:i,...a===void 0?{}:{value:a},...o?{disabled:!0}:{},...r.getAttribute(`aria-current`)||r.getAttribute(`aria-selected`)===`true`?{current:!0}:{}})}return n}function hs(e){let t=is(),n=e.trim(),r=document.querySelector(`[data-assist="${CSS.escape(n)}"]`)??document.querySelector(`[data-assist-ref="${CSS.escape(n)}"]`)??(/^[A-Za-z][\w-]*$/.test(n)?document.getElementById(n):null);if(r)return r;let i=n.toLowerCase(),a=null;for(let e of t.querySelectorAll(as)){if(!fs(e))continue;let t=ls(e).toLowerCase();if(t===i)return e;!a&&t.includes(i)&&(a=e)}return a}var gs=e=>({error:`Nothing on the page is "${e}". look_at_page lists what is there.`}),_s=null,vs=0,ys=new Set;function bs(e){_s=e;for(let e of ys)e()}function xs(){return(0,N.useSyncExternalStore)(e=>(ys.add(e),()=>ys.delete(e)),()=>_s)}var Ss=null,Cs=()=>[];function ws(e,t){Ss=e,Cs=t}function Ts(e){let t=e.split(/[?#]/)[0]||`/`;return Cs().some(e=>RegExp(`^${e.split(`/`).map(e=>e.startsWith(`:`)?e.endsWith(`?`)?`(?:[^/]+)?`:`[^/]+`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`/`)}/?$`).test(t))}var Es=()=>new Promise(e=>setTimeout(e,450));function Ds(e){return!e.startsWith(`/`)||e.startsWith(`//`)||/^\/(api|w|s)\//.test(e)||!(Ss&&Ts(e))?!1:(Ss(e),!0)}var Os={type:`string`,description:`A ref or area from look_at_page, or the label`},ks=new Map;function As(){return[...ks.values()].map(({name:e,description:t,parameters:n})=>({name:e,description:t,parameters:n}))}var js=[{name:`navigate`,description:`Open a page of the studio by its address (/settings/models, /space/knowledge, /space/data, a plugin's page). The chat stays open.`,parameters:{type:`object`,properties:{to:{type:`string`,description:`The studio address, starting with /`}},required:[`to`]},run:async({to:e})=>{let t=String(e??``);return t.startsWith(`/`)&&Ts(t)?(Ss?.(t),await Es(),{opened:t,pageTools:As()}):{error:`The studio has no page "${t}".`,pages:Cs()}}},{name:`highlight`,description:"Point at one element: `spotlight` dims the page except it, `ring` only rings it. A small card beside it shows a title, a text and buttons; a button the person presses comes back as their next message. Scrolls it into view.",parameters:{type:`object`,properties:{target:Os,mode:{type:`string`,enum:[`spotlight`,`ring`]},title:{type:`string`,maxLength:80},text:{type:`string`,maxLength:400},buttons:{type:`array`,items:{type:`string`,maxLength:40},maxItems:3,description:`Answers the person can give with one click`}},required:[`target`]},run:async({target:e,mode:t,title:n,text:r,buttons:i})=>{let a=hs(String(e??``));return a?(a.scrollIntoView({behavior:`smooth`,block:`center`}),await Es(),vs+=1,bs({id:vs,el:a,mode:t===`ring`?`ring`:`spotlight`,title:n?String(n):void 0,text:r?String(r):void 0,buttons:Array.isArray(i)?i.map(String).slice(0,3):[]}),{shown:ls(a)}):gs(String(e))}},{name:`look_at_page`,description:`What is on the screen now, as a list: headings, areas, buttons, links, tabs and fields with their values, each with a ref to point at (at most 150). Not a picture.`,parameters:{type:`object`,properties:{}},run:()=>({route:window.location.pathname,scrolled:Math.round(is().scrollTop),items:ms(is(),!0),pageTools:As()})},{name:`read_section`,description:`Everything in one area of the page, also what is scrolled away: its elements with values, and its text.`,parameters:{type:`object`,properties:{target:Os},required:[`target`]},run:({target:e})=>{let t=hs(String(e??``));return t?{area:ls(t),items:ms(t,!1),text:V(t.innerText,4e3)}:gs(String(e))}},{name:`fill_field`,description:`Put a value into a field of the page, as if typed: text, a choice by its label, yes/no for a switch. Not saved by you: the person checks and saves.`,parameters:{type:`object`,properties:{target:Os,value:{type:[`string`,`number`,`boolean`]}},required:[`target`,`value`]},run:async({target:e,value:t})=>{let n=hs(String(e??``));if(!n)return gs(String(e));if(n.scrollIntoView({behavior:`smooth`,block:`center`}),n instanceof HTMLInputElement&&(n.type===`checkbox`||n.type===`radio`))n.checked!==!!t&&n.click();else if(n.getAttribute(`role`)===`switch`||n.getAttribute(`role`)===`checkbox`)n.getAttribute(`aria-checked`)===`true`!=!!t&&n.click();else if(n instanceof HTMLSelectElement){let e=[...n.options].find(e=>e.value===String(t)||V(e.textContent).toLowerCase()===String(t).toLowerCase());if(!e)return{error:`No such choice.`,choices:[...n.options].map(e=>V(e.textContent))};n.value=e.value,n.dispatchEvent(new Event(`change`,{bubbles:!0}))}else if(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement){if(n.disabled||n.readOnly)return{error:`The field takes nothing here.`};let e=n instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLTextAreaElement.prototype;Object.getOwnPropertyDescriptor(e,`value`)?.set?.call(n,String(t)),n.dispatchEvent(new Event(`input`,{bubbles:!0})),n.dispatchEvent(new Event(`change`,{bubbles:!0}))}else return{error:`That is not a field.`};return n.focus({preventScroll:!0}),{filled:ls(n),value:us(n)}}},{name:`page_tool`,description:`Runs a tool the page shown now offers, by its name, with its arguments: a page opened during this answer brings tools that are not among yours (navigate and look_at_page list them with their parameters).`,parameters:{type:`object`,properties:{name:{type:`string`},args:{type:`object`,description:`The tool's arguments, as its parameters say`}},required:[`name`]},run:async({name:e,args:t})=>{let n=ks.get(String(e??``));return n?n.run(t??{}):{error:`The page offers no tool "${String(e)}".`,pageTools:As()}}},{name:`scroll_to`,description:`Scroll an element of the page into view.`,parameters:{type:`object`,properties:{target:Os},required:[`target`]},run:async({target:e})=>{let t=hs(String(e??``));return t?(t.scrollIntoView({behavior:`smooth`,block:`start`}),await Es(),{at:ls(t)}):gs(String(e))}}];function Ms(e,t,n){let r=(0,N.useRef)(n);r.current=n;let i=JSON.stringify(t);(0,N.useEffect)(()=>{if(js.some(t=>t.name===e))throw Error(`"${e}" is a tool of the assistant itself.`);if(!/^[a-z][a-z0-9_]{1,62}$/.test(e))throw Error(`"${e}": a tool's name is lower case letters, digits and _.`);let{description:t,parameters:n}=JSON.parse(i);return ks.set(e,{name:e,description:t,parameters:n??{type:`object`,properties:{}},run:e=>r.current(e)}),()=>{ks.delete(e)}},[e,i])}function Ns(){return[...js,...ks.values()].map(({name:e,description:t,parameters:n})=>({name:e,description:t,parameters:n}))}async function Ps(e,t){let n=js.find(t=>t.name===e)??ks.get(e);if(!n)return null;try{return{result:await n.run(t??{})}}catch(e){return{result:{error:e.message}}}}var Fs=e=>({id:e.id,role:e.role,content:e.content,cards:e.cards.map((t,n)=>({...t,id:`${e.id}-${n}`})),toolCalls:e.toolCalls,changed:e.changed});function Is(e){return e.type.startsWith(`image/`)&&/logo/i.test(e.name)?`logo`:/^(image|video|audio)\//.test(e.type)?`asset`:`document`}var Ls=0,Rs=e=>`${e}-${Date.now()}-${++Ls}`,zs=(0,N.createContext)(null);function Bs(){return(0,N.useContext)(zs)}function Vs(){let e=xd(),t=aa(),n=(0,N.useRef)([]);return n.current=[`/`,`/new`,`/edit/:id`,`/space`,`/space/:group`,`/settings`,...To(t.data,e).map(e=>`/settings/${e.id}`),...e.pages.map(e=>e.path)],(0,N.useCallback)(()=>n.current,[])}function Hs({children:e}){let t=x(),n=aa(),r=!!n.data,{project:i}=ua(),a=Xe(),o=Vs();(0,N.useEffect)(()=>{ws(e=>a(e),o)},[a,o]);let s=Ue({queryKey:[`assistant-chat`],queryFn:()=>k.get(`/api/studio/assistant/chat`),enabled:r,staleTime:1/0}),c=Ue({queryKey:[`assistant-layout`],queryFn:()=>k.get(`/api/studio/assistant/layout`),enabled:r,staleTime:1/0}),[l,u]=(0,N.useState)([]),[d,f]=(0,N.useState)(`idle`),[p,m]=(0,N.useState)(null),[h,g]=(0,N.useState)(null),[_,v]=(0,N.useState)(null),[y,b]=(0,N.useState)(!1),[te,C]=(0,N.useState)(!1),[ne,re]=(0,N.useState)({kind:`chat`}),[ie,w]=(0,N.useState)(null),[ae,oe]=(0,N.useState)([]),[se,ce]=(0,N.useState)([]),le=(0,N.useRef)(null),ue=Po(),de=!!n.data?.assistantDev,fe=de&&ue.dev,T=(0,N.useRef)(fe);T.current=fe,(0,N.useEffect)(()=>{s.data&&le.current!==s.data.id&&(le.current=s.data.id,u(s.data.messages.map(Fs)))},[s.data]);let pe=(0,N.useCallback)(e=>{w(e),t.setQueryData([`assistant-layout`],{layout:e}),k.put(`/api/studio/assistant/layout`,{layout:e}).catch(()=>null)},[t]),me=(0,N.useRef)(null),he=(0,N.useCallback)(()=>(me.current??=(async()=>{await Promise.all([t.invalidateQueries({queryKey:[`projects`]}),i?t.invalidateQueries({queryKey:[`project-files`,i.id]}):null,i?t.invalidateQueries({queryKey:[`knowledge`,i.id]}):null]),es(),me.current=null})(),me.current),[t,i]),ge=(0,N.useRef)([]),_e=(0,N.useCallback)(e=>{ge.current=e(ge.current),oe(ge.current)},[]),ve=(0,N.useRef)(!1),ye=(0,N.useRef)(null),be=(0,N.useRef)(null),xe=(0,N.useRef)(()=>void 0),Se=(0,N.useRef)(new Set),E=(0,N.useCallback)(()=>{let e=ye.current?.runId;if(e)for(let t of ge.current)t.way!==`signal`||Se.current.has(t.id)||(Se.current.add(t.id),k.post(`/api/studio/assistant/run/${e}/signal`,{ref:t.id,message:t.text}).catch(()=>{}))},[]),D=(0,N.useCallback)(async(e,t)=>{if(!t.length)return e;if(!i||i.readOnly)return m(A(`assistant.filesNeedSpace`)),null;try{for(let e of t)await k.upload(`/api/studio/projects/${i.id}/files?kind=${Is(e)}`,e)}catch(e){return m(e.message),await he(),null}await he();let n=`${A(`editor.attached`)}: ${t.map(e=>e.name).join(`, `)}`;return e.trim()?`${e}\n\n${n}`:n},[i,he]),Ce=(0,N.useCallback)(async(e,n)=>{ve.current=!0,m(null),f(`thinking`),v(Date.now()),bs(null),re({kind:`chat`});let r=Rs(`p`),a=Rs(`u`);u(t=>[...t,{id:a,role:`user`,content:e,previews:n},{id:r,role:`assistant`,content:``,pending:!0}]),g(null);let o=e=>{let t=r;u(n=>n.map(n=>n.id===t?e(n):n))},s=T.current?{id:Rs(`t`),message:e,startedAt:Date.now(),endedAt:null,prompt:null,events:[]}:null;s&&ce(e=>[...e,s]);let c=(e,t)=>{s&&(s.events.push({at:Date.now(),event:e,data:t}),e===`prompt`&&(s.prompt=t),ce(e=>e.map(e=>e.id===s.id?{...s}:e)))},l=new AbortController,d={runId:null,abort:l,stopped:!1};ye.current=d;let p=!1;try{await ee(`/api/studio/assistant/turn`,{message:e,projectId:i?.id,page:rs(),tools:Ns(),lang:S,...T.current?{debug:!0}:{}},(e,t)=>{let n=JSON.parse(t);switch(c(e,n),e){case`run_started`:{let e=n;d.runId=e.runId,u(t=>t.map(t=>t.id===a?{...t,id:e.messageId}:t)),E();break}case`text`:o(e=>({...e,content:e.content+n.delta}));break;case`activity`:g(n.label);break;case`tool_call`:{let e=n;o(t=>({...t,toolCalls:[...t.toolCalls??[],e]})),Ps(e.toolCallName,e.args).then(t=>{t&&k.post(`/api/studio/assistant/tool/${e.toolCallId}`,{result:t.result??null}).catch(()=>null)});break}case`tool_result`:{let e=n;o(t=>({...t,toolCalls:t.toolCalls?.map(t=>t.toolCallId===e.toolCallId?{...t,result:e.content}:t)}));break}case`card`:{let e=n;o(t=>({...t,cards:[...t.cards??[],{...e,id:`${t.id}-${t.cards?.length??0}`}]}));break}case`changed`:he();break;case`step`:o(e=>({...e,steps:[...e.steps??[],n]}));break;case`signal`:{let e=n,t=r;r=Rs(`p`),_e(t=>t.filter(t=>t.id!==e.ref)),u(n=>[...n.flatMap(n=>n.id===t?n.content||n.toolCalls?.length||n.cards?.length||n.steps?.length?[{...n,id:e.answerId??n.id,pending:!1}]:[]:[n]),{id:e.messageId,role:`user`,content:e.content,signal:!0},{id:r,role:`assistant`,content:``,pending:!0}]);break}case`done`:{p=!0;let e=n;o(t=>({...t,id:e.messageId,content:e.reply,changed:e.changed,pending:!1}));break}case`error`:p=!0,m(n.message)}},l.signal),p||m(A(`editor.chatBroken`))}catch(e){d.stopped||m(e.message)}finally{s&&(s.endedAt=Date.now(),ce(e=>e.map(e=>e.id===s.id?{...s}:e))),ye.current=null,g(null),v(null),u(e=>e.filter(e=>!(e.pending&&!e.content&&!e.cards?.length&&!e.toolCalls?.length&&!e.steps?.length)).map(e=>({...e,pending:!1}))),f(`idle`),ve.current=!1,await me.current,t.invalidateQueries({queryKey:[`me`]})}let h=be.current;if(be.current=null,!(h||d.stopped)){let e=ge.current.filter(e=>e.way===`signal`),t=e.length?e:ge.current.filter(e=>e.way===`queue`).slice(0,1);t.length&&(_e(e=>e.filter(e=>!t.includes(e))),h=t.map(e=>e.text).join(`
|
|
11
|
-
|
|
12
|
-
`))}h&&xe.current(h)},[i,he,t,E,_e]);xe.current=e=>void Ce(e);let we=(0,N.useCallback)(async(e,t=[],n=`signal`)=>{if(!(e.trim()||t.length))return!1;if(C(!0),!ve.current){ve.current=!0,f(`thinking`);let n=await D(e,t);return n===null?(ve.current=!1,f(`idle`),!1):(Ce(n,ho(t)),!0)}let r=await D(e,t);return r!==null&&(_e(e=>[...e,{id:Rs(`s`),text:r,way:n}]),E(),!0)},[D,Ce,E,_e]),Te=(0,N.useCallback)(()=>{let e=ye.current;e&&(e.stopped=!0,e.abort.abort())},[]),Ee=(0,N.useCallback)(e=>{let t=ge.current.find(t=>t.id===e);t&&(_e(e=>e.filter(e=>e!==t)),ye.current?(be.current=t.text,Te()):ve.current||Ce(t.text))},[Ce,Te,_e]),De=(0,N.useCallback)(e=>{let t=ge.current.find(t=>t.id===e);return _e(e=>e.filter(e=>e!==t)),t},[_e]),O=(0,N.useCallback)(async()=>{Te(),_e(()=>[]),u([]),ce([]),m(null),re({kind:`chat`}),b(!0);try{let e=await k.post(`/api/studio/assistant/chat/new`);le.current=e.id,t.setQueryData([`assistant-chat`],e),await t.invalidateQueries({queryKey:[`assistant-chats`]})}catch(e){m(e.message)}finally{b(!1)}},[t,Te,_e]),Oe=(0,N.useCallback)((e,t)=>we(e,t),[we]),ke=(0,N.useMemo)(()=>({messages:l,phase:d,activity:h,startedAt:_,error:p,send:Oe}),[l,d,h,_,p,Oe]),Ae=Yo(ke),je=(0,N.useCallback)(e=>No({dev:e}),[]),Me=(0,N.useMemo)(()=>({chat:ke,ready:!!s.data,renewing:y,newChat:O,send:we,pending:ae,sendNow:Ee,takeBack:De,stop:Te,layout:ie??c.data?.layout??`bottom`,setLayout:pe,open:te,setOpen:C,view:ne,setView:re,live:Ae,dev:{offered:de,on:fe,set:je,turns:se}}),[ke,s.data,y,O,we,ae,Ee,De,Te,ie,c.data,pe,te,ne,Ae,de,fe,je,se]);return(0,F.jsx)(zs.Provider,{value:Me,children:e})}function Us(e){return Ue({queryKey:[`assistant-chats`],queryFn:()=>k.get(`/api/studio/assistant/chats`),enabled:e,refetchInterval:e=>e.state.data?.chats.some(e=>e.summarising)?2e3:!1})}function Ws(e){return Ue({queryKey:[`assistant-chat`,e],queryFn:async()=>{let t=await k.get(`/api/studio/assistant/chats/${e}`);return{...t,messages:t.messages.map(Fs)}},enabled:!!e})}var Gs=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e),Ks=e=>e<1e3?`${e} ms`:`${(e/1e3).toFixed(1)} s`,qs=e=>e?`$${e<.01?e.toFixed(4):e.toFixed(3)}`:`$0`,Js=e=>Math.round(e/4),Ys=(e,t)=>A(`assistant.tokens`,{input:Gs(e),output:Gs(t),total:Gs(e+t)});function Xs({steps:e}){return e?.length?(0,F.jsx)(`div`,{className:`mt-1.5 flex flex-col gap-0.5`,children:e.map(e=>(0,F.jsxs)(`details`,{className:`group text-[0.75rem] text-ink-4`,children:[(0,F.jsx)(`summary`,{className:`cursor-pointer list-none truncate hover:text-ink-3`,children:[A(`assistant.step`,{n:e.step}),e.model,Ys(e.inputTokens,e.outputTokens),Ks(e.ms),e.costUsd?qs(e.costUsd):null].filter(Boolean).join(` · `)}),(0,F.jsxs)(`div`,{className:`mt-1 rounded-lg bg-paper-2 px-3 py-2 font-mono text-[0.6875rem] text-ink-3`,children:[A(`assistant.stepTools`),`: `,e.tools.length?e.tools.join(`, `):`–`,e.cachedInputTokens?` · cache ${Gs(e.cachedInputTokens)}`:``]})]},e.step))}):null}function Zs(e){if(typeof e!=`string`)return JSON.stringify(e,null,2)??``;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function Qs({calls:e}){return e?.length?(0,F.jsx)(`div`,{className:`mb-1.5 flex flex-col gap-1`,children:e.map(e=>(0,F.jsxs)(`details`,{className:`rounded-lg bg-paper-2 text-[0.75rem]`,children:[(0,F.jsxs)(`summary`,{className:`cursor-pointer px-2.5 py-1 font-mono text-ink-3 hover:text-ink`,children:[e.toolCallName,e.result===void 0?` …`:``]}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-1 px-2.5 pb-2`,children:[(0,F.jsx)(`span`,{className:`text-ink-4`,children:A(`assistant.args`)}),(0,F.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-[0.6875rem] text-ink-2`,children:Zs(e.args)}),e.result===void 0?null:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`text-ink-4`,children:A(`assistant.result`)}),(0,F.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-[0.6875rem] text-ink-2`,children:Zs(e.result)})]})]})]},e.toolCallId))}):null}function $s(e){let t=[];for(let n of e)n.role===`user`&&!n.signal?t.push([]):n.steps?.length&&(t.length||t.push([]),t[t.length-1].push(...n.steps));let n=e=>({input:e.reduce((e,t)=>e+t.inputTokens,0),output:e.reduce((e,t)=>e+t.outputTokens,0),ms:e.reduce((e,t)=>e+t.ms,0),cost:e.reduce((e,t)=>e+t.costUsd,0),steps:e.length}),r=t.flat(),i=r.at(-1);return{last:n([...t].reverse().find(e=>e.length)??[]),thread:n(r),lastStep:i,context:i?.inputTokens??0,window:i?.window??null}}function ec({ratio:e}){let t=2*Math.PI*7;return(0,F.jsxs)(`svg`,{viewBox:`0 0 18 18`,className:`size-[18px] -rotate-90`,"aria-hidden":`true`,children:[(0,F.jsx)(`circle`,{cx:`9`,cy:`9`,r:7,fill:`none`,strokeWidth:`2.5`,className:`stroke-paper-3`}),(0,F.jsx)(`circle`,{cx:`9`,cy:`9`,r:7,fill:`none`,strokeWidth:`2.5`,strokeDasharray:`${Math.min(1,e)*t} ${t}`,strokeLinecap:`round`,className:e>.8?`stroke-rose`:`stroke-ember`})]})}function tc({messages:e,narrow:t}){let[n,r]=(0,N.useState)(!1),i=(0,N.useRef)(null);nd(i,n,()=>r(!1));let a=$s(e);if(!a.lastStep)return null;let o=a.window?a.context/a.window:0,s=(e,t)=>(0,F.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,F.jsx)(`span`,{className:`text-ink-3`,children:e}),(0,F.jsx)(`span`,{className:`font-mono tabular-nums`,children:t})]});return(0,F.jsxs)(`div`,{className:`relative`,ref:i,children:[(0,F.jsxs)(`button`,{type:`button`,"aria-expanded":n,title:A(`assistant.usage`),onClick:()=>r(e=>!e),className:`flex h-8 items-center gap-1.5 rounded-lg px-1.5 font-mono text-[0.75rem] text-ink-3 tabular-nums transition hover:bg-accent hover:text-ink`,children:[t?null:(0,F.jsxs)(`span`,{className:`whitespace-nowrap max-sm:hidden`,children:[Gs(a.last.input+a.last.output),` / `,Gs(a.thread.input+a.thread.output)]}),(0,F.jsx)(ec,{ratio:o})]}),n?(0,F.jsxs)(`div`,{role:`dialog`,"aria-label":A(`assistant.window`),className:`absolute top-9 right-0 z-50 flex w-72 animate-rise flex-col gap-1.5 rounded-xl bg-card p-3 text-[0.8125rem] shadow-overlay ring-1 ring-border-soft`,children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,F.jsx)(`span`,{className:`font-medium`,children:A(`assistant.window`)}),(0,F.jsxs)(`span`,{className:`font-mono text-[0.75rem] text-ink-3`,children:[Gs(a.context),` /`,` `,a.window?`${Gs(a.window)} (${Math.round(o*100)}%)`:`?`]})]}),(0,F.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-paper-2`,children:(0,F.jsx)(`span`,{className:O(`block h-full rounded-full`,o>.8?`bg-rose`:`bg-ember`),style:{width:`${Math.min(100,o*100)}%`}})}),(0,F.jsx)(`span`,{className:`truncate text-[0.75rem] text-ink-4`,children:a.lastStep.model}),(0,F.jsx)(`span`,{className:`mt-1 font-medium text-[0.75rem] text-ink-3`,children:A(`assistant.lastTurn`)}),s(A(`assistant.promptTokens`),Gs(a.last.input)),s(A(`assistant.answerTokens`),Gs(a.last.output)),s(A(`assistant.duration`),Ks(a.last.ms)),s(A(`assistant.cost`),qs(a.last.cost)),(0,F.jsx)(`span`,{className:`mt-1 font-medium text-[0.75rem] text-ink-3`,children:A(`assistant.wholeChat`)}),s(A(`assistant.promptTokens`),Gs(a.thread.input)),s(A(`assistant.answerTokens`),Gs(a.thread.output)),s(A(`assistant.steps`),String(a.thread.steps)),s(A(`assistant.cost`),qs(a.thread.cost))]}):null]})}function nc(e,t){return JSON.stringify({messages:e.map(({previews:e,...t})=>t),turns:t},null,2)}function rc({messages:e,turns:t}){let[n,r]=(0,N.useState)(!1);return(0,N.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>r(!1),1500);return()=>clearTimeout(e)},[n]),(0,F.jsx)(T,{label:A(n?`assistant.copied`:`assistant.copyThread`),onClick:()=>void navigator.clipboard.writeText(nc(e,t)).then(()=>r(!0)),className:`size-8`,children:n?(0,F.jsx)(lt,{className:`size-4`}):(0,F.jsx)(Re,{className:`size-4`})})}function ic({prompt:e}){let t=e.history.reduce((e,t)=>e+t.chars,0),n=e.tools.reduce((e,t)=>e+t.chars,0),r=[{label:A(`assistant.system`),chars:e.system.length},{label:A(`assistant.context`),chars:e.context.length},{label:A(`assistant.history`,{n:e.history.length}),chars:t},{label:A(`assistant.tools`,{n:e.tools.length}),chars:n}],i=r.reduce((e,t)=>e+t.chars,0)||1,a=(e,t)=>(0,F.jsxs)(`details`,{className:`rounded-lg bg-paper-2`,children:[(0,F.jsx)(`summary`,{className:`cursor-pointer px-3 py-2 font-medium text-[0.8125rem]`,children:e}),(0,F.jsx)(`div`,{className:`px-3 pb-3`,children:t})]});return(0,F.jsxs)(`div`,{className:`flex flex-col gap-3 text-[0.8125rem]`,children:[(0,F.jsxs)(`div`,{className:`flex justify-between text-ink-3`,children:[(0,F.jsx)(`span`,{className:`font-mono`,children:e.model}),(0,F.jsx)(`span`,{children:A(`assistant.estimate`,{tokens:Gs(Js(i))})})]}),(0,F.jsx)(`div`,{className:`flex h-2 overflow-hidden rounded-full bg-paper-2`,children:r.map((e,t)=>(0,F.jsx)(`span`,{title:e.label,className:[`bg-ember`,`bg-ink-3`,`bg-ember-strong`,`bg-ink-4`][t],style:{width:`${e.chars/i*100}%`}},e.label))}),(0,F.jsx)(`ul`,{className:`flex flex-col gap-1`,children:r.map(e=>(0,F.jsxs)(`li`,{className:`flex justify-between gap-4`,children:[(0,F.jsx)(`span`,{children:e.label}),(0,F.jsxs)(`span`,{className:`font-mono text-ink-3 tabular-nums`,children:[Gs(Js(e.chars)),` · `,Math.round(e.chars/i*100),`%`]})]},e.label))}),a(A(`assistant.system`),(0,F.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap font-mono text-[0.6875rem] text-ink-2`,children:e.system})),a(A(`assistant.context`),(0,F.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap font-mono text-[0.6875rem] text-ink-2`,children:e.context})),a(A(`assistant.tools`,{n:e.tools.length}),(0,F.jsx)(`ul`,{className:`flex flex-col gap-0.5 font-mono text-[0.6875rem]`,children:e.tools.map(e=>(0,F.jsxs)(`li`,{className:`flex justify-between gap-4`,children:[(0,F.jsx)(`span`,{children:e.name}),(0,F.jsx)(`span`,{className:`text-ink-3`,children:Gs(Js(e.chars))})]},e.name))}))]})}function ac({turn:e}){let t=e.endedAt??e.events.at(-1)?.at??e.startedAt,n=Math.max(1,t-e.startedAt),r=[],i=new Map;for(let t of e.events){let e=t.data;if(t.event===`tool_call`)i.set(e.toolCallId,{name:e.toolCallName,at:t.at});else if(t.event===`tool_result`&&i.has(e.toolCallId)){let n=i.get(e.toolCallId);r.push({label:n.name,from:n.at,to:t.at,kind:`tool`})}else t.event===`step`&&r.push({label:`${A(`assistant.step`,{n:e.step})} · ${Ys(e.inputTokens,e.outputTokens)}`,from:t.at-e.ms,to:t.at,kind:`step`})}return r.sort((e,t)=>e.from-t.from),(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsxs)(`div`,{className:`flex justify-between gap-3 text-[0.8125rem]`,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.message}),(0,F.jsx)(`span`,{className:`shrink-0 text-ink-3 tabular-nums`,children:Ks(n)})]}),r.map((t,r)=>(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-[0.75rem]`,children:[(0,F.jsx)(`span`,{className:`w-40 shrink-0 truncate font-mono text-ink-3`,children:t.label}),(0,F.jsx)(`span`,{className:`relative h-3 flex-1 rounded bg-paper-2`,children:(0,F.jsx)(`span`,{className:O(`absolute inset-y-0 rounded`,t.kind===`step`?`bg-ember`:`bg-ink-4`),style:{left:`${Math.max(0,t.from-e.startedAt)/n*100}%`,width:`${Math.max(1,(t.to-t.from)/n*100)}%`}})}),(0,F.jsx)(`span`,{className:`w-14 shrink-0 text-right text-ink-4 tabular-nums`,children:Ks(t.to-t.from)})]},`${t.label}-${r}`))]})}function oc({open:e,onClose:t,turns:n,messages:r}){let[i,a]=(0,N.useState)(`timeline`),o=n.at(-1);return(0,F.jsx)(c,{open:e,onClose:t,title:A(`assistant.turns`),wide:!0,height:`tall`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,F.jsx)(Ae,{value:i,onChange:a,options:[{id:`timeline`,label:A(`assistant.turnsTimeline`)},{id:`prompt`,label:A(`assistant.turnsPrompt`)},{id:`events`,label:A(`assistant.turnsEvents`)}]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(rc,{messages:r,turns:n}),(0,F.jsx)(T,{label:A(`assistant.download`),onClick:()=>{let e=n.flatMap(e=>e.events.map(t=>JSON.stringify({turn:e.id,...t}))),t=new Blob([`${e.join(`
|
|
13
|
-
`)}\n`],{type:`application/x-ndjson`}),r=document.createElement(`a`);r.href=URL.createObjectURL(t),r.download=`goose-${new Date().toISOString().slice(0,19)}.jsonl`,r.click(),setTimeout(()=>URL.revokeObjectURL(r.href),1e3)},disabled:!n.length,className:`size-8`,children:(0,F.jsx)(Ie,{className:`size-4`})})]})]}),n.length?i===`timeline`?(0,F.jsx)(`div`,{className:`flex flex-col gap-5`,children:n.map(e=>(0,F.jsx)(ac,{turn:e},e.id))}):i===`prompt`?o?.prompt?(0,F.jsx)(ic,{prompt:o.prompt}):(0,F.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:A(`assistant.noTurns`)}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1 font-mono text-[0.6875rem]`,children:n.flatMap(e=>e.events.map((t,n)=>(0,F.jsxs)(`details`,{className:`rounded bg-paper-2`,children:[(0,F.jsxs)(`summary`,{className:`cursor-pointer px-2 py-1 text-ink-3`,children:[(0,F.jsxs)(`span`,{className:`tabular-nums`,children:[`+`,Ks(t.at-e.startedAt)]}),` `,(0,F.jsx)(`span`,{className:`text-ink`,children:t.event})]}),(0,F.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-all px-2 pb-2 text-ink-2`,children:JSON.stringify(t.data,null,2)})]},`${e.id}-${n}`)))}):(0,F.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:A(`assistant.noTurns`)})]})})}var sc=(0,N.lazy)(()=>Nt(()=>Promise.resolve().then(()=>Bl).then(e=>({default:e.MarketplaceCards})),void 0)),cc=1520,lc=768,uc={min:120,max:900};function dc(){return(0,N.useSyncExternalStore)(e=>(window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)),()=>window.innerWidth)}function fc(e){let t=dc(),n=B(),r=t>=cc,i=t<lc,a=e.layout;a===`sidebar`&&(!r||i)&&(a=`bottom`);let o=a===`bottom`&&!!n.compact;return o&&(a=`avatar`),{where:a,wide:r&&!i,phone:i,compact:o}}var pc=new Set([`scroll_to`]);function mc(e){let t=e.args??{},n={};try{n=e.result?JSON.parse(e.result):{}}catch{}let r=/^e\d+$/.test(String(t.target??``))?``:String(t.target??``),i=String(n.shown||n.filled||n.area||r);switch(e.toolCallName){case`navigate`:return A(`assistant.tool.navigate`,{where:String(t.to??``)});case`highlight`:return A(`assistant.tool.highlight`,{what:i});case`look_at_page`:return A(`assistant.tool.look`);case`read_section`:return A(`assistant.tool.read`,{what:i});case`fill_field`:return A(`assistant.tool.fill`,{what:i});case`docs_search`:case`docs_read`:case`authoring_guide`:return A(`assistant.tool.docs`);case`gallery_search`:case`gallery_detail`:case`show_templates`:return A(`assistant.tool.gallery`);case`plans`:case`account`:case`usage`:return A(`assistant.tool.account`);case`chats_search`:case`chat_read`:return A(`assistant.tool.chats`);case`wizards`:case`runs`:return A(`assistant.tool.space`);case`models`:return A(`assistant.tool.models`);default:return null}}function hc({calls:e}){let t=[...new Set((e??[]).filter(e=>!pc.has(e.toolCallName)).map(mc).filter(e=>!!e))];return t.length?(0,F.jsx)(`div`,{className:`mb-1.5 flex flex-wrap gap-1.5`,children:t.map(e=>(0,F.jsx)(`span`,{className:`inline-flex max-w-full items-center rounded-full bg-paper-2 px-2.5 py-0.5 text-[0.75rem] text-ink-3`,children:(0,F.jsx)(`span`,{className:`truncate`,children:e})},e))}):null}function gc({card:e,send:t}){if(!e.plugin&&e.tool===`templates`){let{entries:t}=e.data;return(0,F.jsx)(N.Suspense,{fallback:(0,F.jsx)(D,{className:`m-2 size-4`}),children:(0,F.jsx)(sc,{entries:t})})}return(0,F.jsx)(_c,{card:e,send:t})}function _c({card:e,send:t}){let n=xd().cards.find(t=>t.plugin===e.plugin&&t.tool===e.tool);return n?(0,F.jsx)(Kd,{of:n,children:(0,F.jsx)(n.component,{data:e.data,send:t})}):null}function vc(){return[{label:A(`assistant.suggest.what`)},{label:A(`assistant.suggest.models`)},{label:A(`assistant.suggest.credits`)}]}function yc({state:e,composer:t}){let n=B(),r=(n.suggestions?.length?n.suggestions:vc()).slice(0,3);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,F.jsx)(`div`,{className:`shrink-0`,children:(0,F.jsx)(Ji,{kind:`round`,size:44,goggles:!0,interactive:!1})}),(0,F.jsxs)(`div`,{className:`min-w-0 pt-0.5`,children:[(0,F.jsx)(`h2`,{className:`font-display font-semibold text-[1.0625rem] leading-tight tracking-tight`,children:n.title??A(`assistant.helloTitle`)}),(0,F.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-2 leading-relaxed`,children:n.hello??A(`assistant.hello`)})]})]}),(0,F.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:r.map(n=>(0,F.jsxs)(`button`,{type:`button`,disabled:e.chat.phase!==`idle`,onClick:()=>{let r=n.message??n.label;n.fill?t.current?.fill(r):e.chat.send(r)},className:`flex items-center gap-2 rounded-xl bg-paper-2 px-3.5 py-2.5 text-left text-[0.875rem] text-ink-2 transition hover:bg-paper-3 hover:text-ink disabled:opacity-60`,children:[(0,F.jsx)(`span`,{className:`min-w-0 flex-1`,children:n.label}),n.fill?(0,F.jsx)(ai,{className:`size-3.5 shrink-0 text-ink-4`}):null]},n.label))})]})}function bc({state:e}){let t=Us(!0);if(t.isLoading)return(0,F.jsx)(D,{className:`m-4 size-4`});let n=t.data?.chats??[];return n.length?(0,F.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.map(t=>(0,F.jsx)(`li`,{children:(0,F.jsxs)(`button`,{type:`button`,onClick:()=>e.setView({kind:`read`,id:t.id}),className:`flex w-full flex-col gap-0.5 rounded-lg px-3 py-2.5 text-left transition hover:bg-accent`,children:[(0,F.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-[0.875rem]`,children:t.title||A(`assistant.untitled`)}),(0,F.jsx)(`span`,{className:`shrink-0 text-[0.75rem] text-ink-4 tabular-nums`,children:new Date(t.closedAt).toLocaleDateString(S)})]}),(0,F.jsx)(`span`,{className:`line-clamp-1 text-[0.8125rem] text-ink-3`,children:t.summarising?A(`assistant.summarising`):t.summary.split(`
|
|
14
|
-
`)[0]})]})},t.id))}):(0,F.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:A(`assistant.noEarlier`)})}function xc({id:e}){let t=Ws(e);return t.data?(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsxs)(`div`,{className:`rounded-xl bg-paper-2 px-4 py-3 text-[0.8125rem] text-ink-2 leading-relaxed`,children:[(0,F.jsx)(`div`,{className:`font-medium text-ink`,children:t.data.title||A(`assistant.untitled`)}),(0,F.jsx)(`p`,{className:`mt-1 whitespace-pre-line`,children:t.data.summary})]}),(0,F.jsx)(Co,{chat:{messages:t.data.messages,phase:`idle`,activity:null,startedAt:null,error:null,send:async()=>!1},avatar:`round`,changedLabel:A(`project.assistantChanged`),card:e=>(0,F.jsx)(gc,{card:e,send:()=>void 0}),calls:e=>(0,F.jsx)(hc,{calls:e.toolCalls})})]}):(0,F.jsx)(D,{className:`m-4 size-4`})}function Sc({state:e,composer:t}){let n=(0,N.useRef)(null),{chat:r,view:i}=e;return(0,N.useEffect)(()=>{let e=n.current,t=e=>{let t=e.target.closest(`a`)?.getAttribute(`href`);!t||e.metaKey||e.ctrlKey||e.shiftKey||(Ds(t)?e.preventDefault():/^https?:\/\//.test(t)&&(e.preventDefault(),window.open(t,`_blank`,`noopener,noreferrer`)))};return e?.addEventListener(`click`,t),()=>e?.removeEventListener(`click`,t)},[]),(0,N.useEffect)(()=>{n.current?.scrollTo({top:n.current.scrollHeight,behavior:`smooth`})},[r.messages,r.phase,i]),(0,F.jsxs)(`div`,{ref:n,className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-5`,children:[i.kind===`earlier`?(0,F.jsx)(bc,{state:e}):i.kind===`read`?(0,F.jsx)(xc,{id:i.id}):r.messages.length?(0,F.jsx)(Co,{chat:r,avatar:`round`,changedLabel:A(`project.assistantChanged`),card:e=>(0,F.jsx)(gc,{card:e,send:e=>void r.send(e)}),calls:t=>e.dev.on?(0,F.jsx)(Qs,{calls:t.toolCalls}):(0,F.jsx)(hc,{calls:t.toolCalls}),foot:t=>e.dev.on?(0,F.jsx)(Xs,{steps:t.steps}):null}):(0,F.jsx)(yc,{state:e,composer:t}),r.error&&i.kind===`chat`?(0,F.jsx)(`div`,{className:`mt-4 rounded-lg bg-rose-tint px-3 py-2 text-[0.8125rem] text-rose`,children:r.error}):null]})}function Cc({state:e}){let[t,n]=(0,N.useState)(!1),r=(0,N.useRef)(null);nd(r,t,()=>n(!1));let i=`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left text-[0.875rem] text-ink-2 hover:bg-accent hover:text-ink disabled:opacity-50`;return(0,F.jsxs)(`div`,{className:`relative shrink-0`,ref:r,children:[(0,F.jsxs)(`button`,{type:`button`,"aria-haspopup":`menu`,"aria-expanded":t,"aria-label":A(`assistant.menu`),onClick:()=>n(e=>!e),className:`-ml-1 flex items-center gap-1 rounded-lg px-1.5 py-0.5 font-display font-semibold text-[0.9375rem] transition hover:bg-accent`,children:[A(`assistant.name`),(0,F.jsx)(Ct,{className:`size-3.5 text-ink-4`})]}),t?(0,F.jsxs)(`div`,{role:`menu`,className:`absolute top-8 left-0 z-50 w-56 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,children:[(0,F.jsxs)(`button`,{type:`button`,role:`menuitem`,className:i,disabled:e.renewing,onClick:()=>{n(!1),e.newChat()},children:[(0,F.jsx)(ai,{className:`size-4`}),` `,A(`assistant.newChat`)]}),(0,F.jsxs)(`button`,{type:`button`,role:`menuitem`,className:i,onClick:()=>{n(!1),e.setView({kind:`earlier`})},children:[(0,F.jsx)(qr,{className:`size-4`}),` `,A(`assistant.earlier`)]})]}):null]})}function wc({state:e}){let t=e.dev.on;return(0,F.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"aria-label":A(`assistant.dev`),title:A(t?`assistant.devOn`:`assistant.devOff`),onClick:()=>e.dev.set(!t),className:O(`inline-flex h-5 shrink-0 items-center gap-1 rounded-full font-mono font-semibold text-[0.625rem] uppercase tracking-wide transition`,t?`bg-ember pr-0.5 pl-2 text-white`:`flex-row-reverse bg-paper-3 pr-2 pl-0.5 text-ink-3`),children:[`dev`,(0,F.jsx)(`span`,{className:`size-4 rounded-full bg-white shadow-sm`})]})}function Tc({state:e,where:t,wide:n,phone:r,compact:i,grip:a}){let o=e.live,[s,c]=(0,N.useState)(!1),l=td().map(e=>e.label).join(` · `),u=e.dev.on&&e.view.kind===`chat`,d=t===`sidebar`,f=e.chat.messages;return(0,F.jsxs)(`div`,{className:O(`flex items-center border-border-soft border-b py-2`,d?`gap-1 px-3`:`gap-1.5 px-3 sm:px-4`),children:[a,e.view.kind===`chat`?t===`sidebar`?(0,F.jsx)(Ji,{kind:`round`,size:26,goggles:!0,interactive:!1}):null:(0,F.jsx)(T,{label:A(`assistant.back`),onClick:()=>e.setView({kind:e.view.kind===`read`?`earlier`:`chat`}),className:`size-8`,children:(0,F.jsx)(dt,{className:`size-4`})}),(0,F.jsxs)(`div`,{className:`ml-0.5 min-w-[8.5rem] flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[e.view.kind===`chat`?(0,F.jsx)(Cc,{state:e}):(0,F.jsx)(`span`,{className:`font-display font-semibold text-[0.9375rem]`,children:A(`assistant.earlier`)}),e.dev.offered&&e.view.kind===`chat`?(0,F.jsx)(wc,{state:e}):null]}),o.state===`off`?l?(0,F.jsx)(`div`,{className:`truncate text-[0.75rem] text-ink-4`,children:A(`assistant.sees`,{page:l})}):null:(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[0.75rem] text-ember-strong`,children:[(0,F.jsx)(`span`,{className:`size-1.5 animate-pulse-dot rounded-full bg-ember`}),A(`assistant.live`),` · `,(0,F.jsx)(Ec,{since:o.since})]})]}),u?(0,F.jsx)(tc,{messages:f,narrow:d}):null,u?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(T,{label:A(`assistant.inspect`),onClick:()=>c(!0),className:`size-8 max-sm:hidden`,children:(0,F.jsx)(en,{className:`size-4`})}),f.length&&!d?(0,F.jsx)(`span`,{className:`max-sm:hidden`,children:(0,F.jsx)(rc,{messages:f,turns:e.dev.turns})}):null,(0,F.jsx)(oc,{open:s,onClose:()=>c(!1),turns:e.dev.turns,messages:f})]}):null,e.view.kind===`chat`&&f.length?(0,F.jsx)(T,{label:A(`assistant.newChat`),disabled:e.renewing,onClick:()=>void e.newChat(),className:`size-8`,children:(0,F.jsx)(ai,{className:`size-4`})}):null,t!==`sidebar`&&n?(0,F.jsx)(T,{label:A(`assistant.layoutSidebar`),onClick:()=>e.setLayout(`sidebar`),className:`size-8`,children:(0,F.jsx)(Nr,{className:`size-4`})}):null,t===`sidebar`||t===`avatar`&&!r&&!i?(0,F.jsx)(T,{label:A(`assistant.layoutBottom`),onClick:()=>{e.setLayout(`bottom`),e.setOpen(!0)},className:`size-8`,children:(0,F.jsx)(kr,{className:`size-4`})}):null,(0,F.jsx)(T,{label:A(`assistant.close`),onClick:()=>{t!==`avatar`&&e.setLayout(`avatar`),e.setOpen(!1)},className:`size-8`,children:(0,F.jsx)(we,{className:`size-4`})})]})}function Ec({since:e}){let[t,n]=(0,N.useState)(()=>Date.now());(0,N.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(e)},[]);let r=e?Math.max(0,Math.floor((t-e)/1e3)):0;return(0,F.jsxs)(`span`,{className:`tabular-nums`,children:[String(Math.floor(r/60)).padStart(2,`0`),`:`,String(r%60).padStart(2,`0`)]})}function Dc({state:e}){let t=e.live,n=t.state===`thinking`?A(`assistant.liveThinking`):t.state===`speaking`?A(`assistant.liveSpeaking`):t.muted?A(`assistant.liveMuted`):A(`assistant.liveListening`);return(0,F.jsxs)(`div`,{className:`flex items-center gap-2 rounded-full bg-card p-1 pl-4 shadow-overlay ring-1 ring-ember-veil`,children:[(0,F.jsx)(`span`,{className:`size-2 shrink-0 animate-pulse-dot rounded-full bg-ember`}),(0,F.jsx)(`span`,{"aria-hidden":!0,className:`flex h-5 shrink-0 items-center gap-0.5`,children:[.5,.8,1,.75,.45].map((e,n)=>(0,F.jsx)(`span`,{className:`w-1 rounded-full bg-ember transition-[height] duration-100`,style:{height:`${Math.max(3,Math.round(t.level*e*20))}px`}},n))}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[0.8125rem] text-ink-2`,children:t.heard?(0,F.jsx)(`span`,{className:`text-ink`,children:t.heard}):t.state===`thinking`?(0,F.jsx)(xo,{chat:e.chat,className:`text-ink-3`}):(0,F.jsxs)(F.Fragment,{children:[n,` · `,(0,F.jsx)(Ec,{since:t.since})]})}),t.voice&&t.voice.way!==`none`?(0,F.jsx)(T,{label:A(`assistant.naturalVoice`),"aria-pressed":t.voice.natural,onClick:()=>t.setNatural(!t.voice?.natural),className:O(t.voice.natural&&`bg-ember-tint text-ember-strong`),children:(0,F.jsx)(xi,{className:`size-4`})}):null,(0,F.jsx)(T,{label:t.muted?A(`assistant.unmute`):A(`assistant.mute`),"aria-pressed":t.muted,onClick:t.toggleMute,children:t.muted?(0,F.jsx)(xr,{className:`size-4`}):(0,F.jsx)(Oe,{className:`size-4`})}),(0,F.jsxs)(`button`,{type:`button`,onClick:t.end,className:`inline-flex h-9 shrink-0 items-center gap-1.5 rounded-full bg-rose px-3.5 font-medium text-[0.8125rem] text-white coarse:h-11`,children:[(0,F.jsx)(zr,{className:`size-4`}),` `,A(`assistant.end`)]})]})}function Oc({state:e,composer:t}){return e.pending.length?(0,F.jsx)(`ul`,{"aria-label":A(`assistant.pending`),className:`mb-2 flex flex-col gap-1`,children:e.pending.map(n=>(0,F.jsxs)(`li`,{className:`flex items-center gap-2 rounded-xl bg-card py-1 pr-1 pl-3 text-[0.8125rem] shadow-soft ring-1 ring-border`,children:[(0,F.jsx)(`span`,{title:n.way===`queue`?A(`assistant.pendingQueueHint`):A(`assistant.pendingSignalHint`),className:O(`shrink-0 rounded-full px-2 py-0.5 text-[0.6875rem]`,n.way===`queue`?`bg-paper-2 text-ink-3`:`bg-ember-tint text-ember-strong`),children:n.way===`queue`?A(`assistant.pendingQueue`):A(`assistant.pendingSignal`)}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n.text}),(0,F.jsx)(`button`,{type:`button`,title:A(`assistant.sendNowHint`),onClick:()=>e.sendNow(n.id),className:`shrink-0 rounded-full px-2 py-1 font-medium text-[0.75rem] text-ember-strong transition hover:bg-ember-tint`,children:A(`assistant.sendNow`)}),(0,F.jsx)(T,{label:A(`assistant.edit`),onClick:()=>{let r=e.takeBack(n.id);r&&t.current?.fill(r.text)},className:`size-7`,children:(0,F.jsx)(re,{className:`size-3.5`})}),(0,F.jsx)(T,{label:A(`assistant.remove`),onClick:()=>e.takeBack(n.id),className:`size-7`,children:(0,F.jsx)(we,{className:`size-3.5`})})]},n.id))}):null}function kc({state:e,composer:t,floating:n,bare:r}){let i=B(),a=e.live;if(e.view.kind===`earlier`)return null;if(e.view.kind===`read`)return(0,F.jsx)(`p`,{className:`m-3 rounded-xl bg-paper-2 px-4 py-3 text-[0.8125rem] text-ink-2 leading-relaxed`,children:A(`assistant.readOnly`)});let o=e.chat.phase!==`idle`;return(0,F.jsxs)(`div`,{className:n?void 0:`p-3`,children:[a.state===`off`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Oc,{state:e,composer:t}),(0,F.jsx)(bt,{ref:t,floating:n,bare:r,placeholder:o?A(`assistant.busyComposer`,{keys:it}):i.placeholder??A(`assistant.composer`),busy:o,onStop:e.stop,onSend:(t,n,r)=>e.send(t,n,r?`queue`:`signal`),onTalk:Ko?()=>{e.setOpen(!0),a.start()}:void 0})]}):(0,F.jsx)(Dc,{state:e}),a.error?(0,F.jsx)(`p`,{className:`mt-2 px-3 text-[0.75rem] text-rose`,children:a.error===`denied`?A(`editor.micDenied`):a.error}):null]})}function Ac({composer:e,children:t,className:n,style:r}){return(0,F.jsx)(`div`,{"data-assistant-ui":!0,className:n,style:r,onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&e.preventDefault()},onDrop:t=>{t.dataTransfer.files.length&&(t.preventDefault(),e.current?.add(Array.from(t.dataTransfer.files)),e.current?.focus())},children:t})}function jc(e){let[t,n]=(0,N.useState)({width:0,height:0});return(0,N.useLayoutEffect)(()=>{let t=null,r=0,i=()=>{let a=e.current;if(!a){r=requestAnimationFrame(i);return}let o=()=>n({width:a.clientWidth,height:a.clientHeight});o(),t=new ResizeObserver(o),t.observe(a)};return i(),()=>{cancelAnimationFrame(r),t?.disconnect()}},[e]),t}function Mc(e){return(t,n)=>{if(t===`sidebar`){e.setLayout(`sidebar`);return}No(t===`free`?{place:`free`,free:n}:{place:t})}}function Nc({state:e,column:t,frame:n,wide:r,from:i}){let a=Po(),o=Mc(e);return(0,F.jsx)(`button`,{type:`button`,title:A(`assistant.move`),"aria-label":A(`assistant.move`),onPointerDown:a=>Wo(a,{column:()=>t.current,frame:n,sidebar:r,onLeave:i===`sidebar`?()=>{e.setLayout(`bottom`),e.setOpen(!0)}:void 0,onDrop:o}),onKeyDown:e=>{let n=null;i===`sidebar`?n=e.key===`ArrowLeft`||e.key===`ArrowDown`?`right`:null:e.key===`ArrowLeft`?n=`center`:e.key===`ArrowRight`&&(n=Uo(t.current?.clientWidth??0)&&a.place!==`right`?`right`:r?`sidebar`:null),n&&(e.preventDefault(),o(n))},className:`-ml-1.5 inline-flex h-8 w-5 shrink-0 cursor-grab touch-none items-center justify-center rounded-md text-ink-4 transition hover:bg-accent hover:text-ink active:cursor-grabbing`,children:(0,F.jsx)(te,{className:`size-4`})})}function Pc(){let e=Bo();return e?.spot?(0,F.jsx)(`div`,{"aria-hidden":!0,className:O(`pointer-events-none absolute rounded-2xl border-2 border-dashed transition-all duration-200`,e.zone?`border-ember bg-ember-veil opacity-100`:`border-ink-4 opacity-0`),style:e.spot}):null}function Fc({place:e,free:t,width:n,column:r,frame:i,children:a}){let o=Bo(),s;return s=o?{left:o.left,top:o.top,width:n}:e===`free`&&t?{left:Math.min(Math.max(t.left,8),Math.max(8,r.width-n-8)),bottom:Math.min(Math.max(t.bottom,8),Math.max(8,r.height-200)),width:n}:{left:e===`right`?r.width-n-12:(r.width-n)/2,bottom:0,width:n},(0,F.jsx)(`div`,{ref:i,className:O(`pointer-events-none absolute flex flex-col`,o?`opacity-90`:`transition-[left,bottom] duration-300 ease-out`),style:s,children:a})}function Ic({thread:e,max:t,folded:n,onFold:r,onOpen:i}){let a=Po(),o=(0,N.useRef)(null),s=e=>Math.round(Math.min(Math.max(e,uc.min),t)),c=a.height??e.current?.offsetHeight??uc.min;return(0,F.jsx)(`div`,{role:`separator`,tabIndex:0,"aria-orientation":`horizontal`,"aria-valuenow":c,"aria-valuemin":uc.min,"aria-valuemax":t,"aria-label":A(n?`assistant.open`:`assistant.flap`),title:A(n?`assistant.open`:`assistant.flap`),onPointerDown:t=>{t.button===0&&(t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId),o.current={y:t.clientY,height:e.current?.offsetHeight??0,moved:!1})},onPointerMove:e=>{let t=o.current;!t||!t.moved&&Math.abs(e.clientY-t.y)<4||n&&e.clientY>t.y||(n&&!t.moved&&i(),t.moved=!0,No({height:s(t.height+(t.y-e.clientY))}))},onPointerUp:()=>{let e=o.current&&!o.current.moved;o.current=null,e&&(n?i:r)()},onPointerCancel:()=>{o.current=null},onKeyDown:e=>{if(e.key===`ArrowUp`||e.key===`ArrowDown`){if(e.preventDefault(),n){e.key===`ArrowUp`&&i();return}No({height:s(c+(e.key===`ArrowUp`?32:-32))})}else(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),(n?i:r)())},className:`group flex h-3.5 shrink-0 cursor-row-resize touch-none items-center justify-center outline-none`,children:(0,F.jsx)(`span`,{className:`h-1 w-10 rounded-full bg-ink-4/40 transition group-hover:bg-ink-4 group-focus-visible:bg-ember`})})}function Lc({column:e}){let t=Bs(),n=!!xs(),r=(0,N.useRef)(null),i=(0,N.useRef)(null),a=(0,N.useRef)(null),o=(0,N.useRef)(null),s=(0,N.useRef)(null),c=zc(t),l=Po(),u=jc(e),d=t&&c&&c.where!==`sidebar`,f=Vo(u.width),p=c?.phone||l.place===`right`&&!Uo(u.width)||l.place===`free`&&!l.free?`center`:l.place,m=p!==`free`,h=c?.where===`avatar`,g=!!t?.open,[_,v]=(0,N.useState)(!1),y=_||g||t?.chat.phase!==`idle`||(t?.live.state??`off`)!==`off`,b=h?!g:m;if((0,N.useLayoutEffect)(()=>{let t=i.current,n=e.current;if(!(t&&n&&d&&b)){n?.style.setProperty(`--assistant-dock`,`0px`);return}let r=new ResizeObserver(()=>{let e=a.current?.offsetHeight??0;n.style.setProperty(`--assistant-dock`,`${Math.ceil(t.offsetHeight+e)+8}px`)});return r.observe(t),()=>{r.disconnect(),n.style.setProperty(`--assistant-dock`,`0px`)}},[e,d,b,h,g]),(0,N.useEffect)(()=>{if(!t?.open)return;let e=e=>{e.key===`Escape`&&!document.querySelector(`[role=dialog], dialog[open]`)&&t.setOpen(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t]),!(t&&c&&d))return null;if(h&&!g)return(0,F.jsx)(Ac,{composer:r,className:O(`pointer-events-none absolute inset-0`,n?`z-[61]`:`z-30`),children:(0,F.jsx)(`div`,{ref:i,className:`pointer-events-auto absolute right-3 bottom-3 sm:right-4 sm:bottom-4`,children:(0,F.jsxs)(`div`,{className:`flex items-center gap-1 rounded-full bg-card p-1 pr-1.5 shadow-overlay ring-1 ring-border`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>t.setOpen(!0),className:`flex items-center gap-2 rounded-full py-0.5 pr-2 pl-0.5 text-[0.875rem] text-ink-2 transition hover:text-ink`,children:[(0,F.jsxs)(`span`,{className:`relative`,children:[(0,F.jsx)(Ji,{kind:`round`,size:36,goggles:!0,interactive:!1}),t.chat.phase!==`idle`||t.live.state!==`off`?(0,F.jsx)(`span`,{className:`absolute top-0 right-0 size-2.5 animate-pulse-dot rounded-full bg-ember ring-2 ring-card`}):null]}),(0,F.jsx)(`span`,{className:`max-sm:hidden`,children:A(`assistant.ask`)})]}),Ko?(0,F.jsx)(T,{label:A(`assistant.talk`),onClick:()=>{t.setOpen(!0),t.live.start()},className:`size-8 bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground`,children:(0,F.jsx)(yt,{className:`size-4`})}):null]})})});let ee=(0,F.jsx)(`button`,{type:`button`,"aria-label":A(`assistant.open`),title:`${A(`assistant.open`)} · ${A(`assistant.move`)}`,tabIndex:-1,onPointerDown:n=>Wo(n,{column:()=>e.current,frame:()=>o.current,sidebar:c.wide,onClick:()=>t.setOpen(!0),onDrop:Mc(t)}),onClick:e=>{e.detail===0&&t.setOpen(!0)},className:O(`pointer-events-auto absolute bottom-full left-6 -mb-3 origin-bottom cursor-grab touch-none transition duration-300 ease-out active:cursor-grabbing max-sm:hidden`,y?`translate-y-0 scale-100 opacity-100`:`pointer-events-none translate-y-3 scale-75 opacity-0`),children:(0,F.jsx)(Ji,{kind:`round`,size:44,goggles:!0,interactive:y})}),te=Math.max(uc.min,Math.min(uc.max,u.height-220)),x=l.height===null?null:Math.min(l.height,te),S=c.phone?void 0:(0,F.jsx)(Nc,{state:t,column:e,frame:()=>o.current,wide:c.wide,from:`bottom`});return(0,F.jsxs)(Ac,{composer:r,className:O(`pointer-events-none absolute inset-0`,n?`z-[61]`:`z-30`),children:[m&&!h?(0,F.jsx)(`div`,{"aria-hidden":!0,className:`absolute inset-x-0 bottom-0 h-24 bg-linear-to-t from-paper/85 via-paper/55 to-paper/0 backdrop-blur-xl [mask-image:linear-gradient(to_top,black_45%,transparent)]`}):null,(0,F.jsx)(Pc,{}),(0,F.jsxs)(Fc,{place:p,free:l.free,width:f,column:u,frame:o,children:[ee,(0,F.jsxs)(`div`,{className:`pointer-events-auto flex min-h-0 flex-col overflow-hidden rounded-[1.375rem] bg-card shadow-overlay ring-1 ring-border focus-within:ring-focus`,children:[(0,F.jsx)(Ic,{thread:s,max:te,folded:!g,onFold:()=>t.setOpen(!1),onOpen:()=>t.setOpen(!0)}),g?(0,F.jsx)(`div`,{className:`relative flex min-h-0 flex-col`,children:(0,F.jsxs)(`div`,{className:`flex min-h-0 animate-rise flex-col border-border-soft border-b`,style:{maxHeight:te+60},children:[(0,F.jsx)(Tc,{state:t,where:h?`avatar`:`bottom`,wide:c.wide,phone:c.phone,compact:c.compact,grip:S}),(0,F.jsx)(`div`,{ref:s,className:`flex min-h-0 flex-col`,style:x===null?{maxHeight:te}:{height:x},children:(0,F.jsx)(Sc,{state:t,composer:r})})]})}):t.chat.messages.length||t.chat.error?(0,F.jsx)(Rc,{state:t}):null,(0,F.jsx)(`div`,{ref:i,onFocusCapture:()=>v(!0),onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||v(!1)},className:`relative w-full`,children:(0,F.jsx)(kc,{state:t,composer:r,floating:!0,bare:!0})})]}),m?(0,F.jsx)(`div`,{ref:a,className:`h-[max(0.75rem,env(safe-area-inset-bottom))] shrink-0`}):null]})]})}function Rc({state:e}){let t=e.chat.messages.at(-1);return(0,F.jsx)(`button`,{type:`button`,onClick:()=>e.setOpen(!0),className:`flex w-full items-center gap-2 border-border-soft border-b px-4 py-3.5 text-left text-[0.8125rem] text-ink-3 transition hover:text-ink`,children:t?.pending?(0,F.jsx)(xo,{chat:e.chat,className:`flex-1`}):(0,F.jsx)(`span`,{className:O(`min-w-0 flex-1 truncate`,e.chat.error&&`text-rose`),children:e.chat.error??lo(t?.content??``)})})}function zc(e){let t=fc(e??Bc);return e?t:null}var Bc={layout:`bottom`,open:!1,chat:{messages:[]}};function Vc({column:e}){let t=Bs(),n=!!xs(),r=(0,N.useRef)(null),i=zc(t);return t&&i&&i.where===`sidebar`?(0,F.jsxs)(Ac,{composer:r,className:O(`flex w-[400px] shrink-0 flex-col border-border-soft border-l bg-card`,n&&`relative z-[61]`),children:[(0,F.jsx)(Tc,{state:t,where:`sidebar`,wide:i.wide,phone:i.phone,grip:(0,F.jsx)(Nc,{state:t,column:e,frame:()=>null,wide:i.wide,from:`sidebar`})}),(0,F.jsx)(Sc,{state:t,composer:r}),(0,F.jsx)(kc,{state:t,composer:r})]}):null}function Hc(){let e=xs(),t=Bs(),[n,r]=(0,N.useState)(null);if((0,N.useEffect)(()=>{if(!e){r(null);return}let t=0,n=()=>{if(!e.el.isConnected){bs(null);return}r(e.el.getBoundingClientRect()),t=requestAnimationFrame(n)};n();let i=e=>{e.key===`Escape`&&bs(null)};return document.addEventListener(`keydown`,i),()=>{cancelAnimationFrame(t),document.removeEventListener(`keydown`,i)}},[e]),!(e&&n))return null;let i={left:n.left-6,top:n.top-6,width:n.width+12,height:n.height+12},a=i.top+i.height+220<window.innerHeight,o=a?i.top+i.height+10:Math.max(10,i.top-10),s=Math.min(Math.max(10,i.left),window.innerWidth-330),c=e=>{bs(null),t?.chat.send(e)};return(0,Sa.createPortal)((0,F.jsxs)(`div`,{"data-assistant-ui":!0,className:`pointer-events-none fixed inset-0 z-[60]`,children:[e.mode===`spotlight`?(0,F.jsx)(`div`,{className:`pointer-events-auto absolute rounded-xl transition-all duration-200`,style:{...i,boxShadow:`0 0 0 100vmax oklch(0.2 0.01 60 / 0.45)`},onClick:()=>bs(null),onKeyDown:void 0,role:`presentation`}):null,(0,F.jsx)(`div`,{className:`absolute rounded-xl ring-2 ring-ember ring-offset-2 ring-offset-transparent transition-all duration-200`,style:i}),e.title||e.text||e.buttons.length?(0,F.jsxs)(`div`,{className:`pointer-events-auto absolute w-80 max-w-[calc(100vw-20px)] animate-rise rounded-xl bg-card p-3.5 shadow-overlay ring-1 ring-border`,style:{left:s,...a?{top:o}:{bottom:window.innerHeight-o}},children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,F.jsx)(Ji,{kind:`round`,size:28,goggles:!0,interactive:!1}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[e.title?(0,F.jsx)(`div`,{className:`font-medium text-[0.875rem]`,children:e.title}):null,e.text?(0,F.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-2 leading-relaxed`,children:e.text}):null]})]}),(0,F.jsxs)(`div`,{className:`mt-3 flex flex-wrap justify-end gap-1.5`,children:[e.buttons.map(e=>(0,F.jsx)(`button`,{type:`button`,onClick:()=>c(e),className:`rounded-full bg-paper-2 px-3 py-1.5 text-[0.8125rem] text-ink-2 transition hover:bg-paper-3 hover:text-ink`,children:e},e)),(0,F.jsx)(`button`,{type:`button`,onClick:()=>bs(null),className:`rounded-full bg-primary px-3 py-1.5 font-medium text-[0.8125rem] text-primary-foreground`,children:A(`assistant.gotIt`)})]})]}):null]}),document.body)}var Uc=[`update`],Wc=36e5;function Gc(e=!0){let t=x(),[n,r]=(0,N.useState)(null),i=Ue({queryKey:Uc,queryFn:()=>k.get(`/api/studio/update`),staleTime:Wc,refetchInterval:Wc,retry:!1,enabled:e}),a=Kt({mutationFn:()=>k.get(`/api/studio/update?fresh=1`),onSuccess:e=>t.setQueryData(Uc,e)}),o=Kt({mutationFn:()=>k.post(`/api/studio/update`),onSuccess:e=>t.setQueryData(Uc,e)}),s=i.data,c=s?.latest??null,l=s?.restarts&&(s.applying===`running`||s.applying===`done`),u=s?.current;return(0,N.useEffect)(()=>{if(!(l||s?.applying===`running`)||!c)return;let e=setInterval(async()=>{try{let e=await k.get(`/api/studio/update`);if(e.current!==u){window.location.reload();return}t.setQueryData(Uc,e),e.applying===`done`&&e.restarts&&r(c)}catch{r(c)}},2e3);return()=>clearInterval(e)},[l,s?.applying,c,u,t]),{status:i,data:s,latest:c,check:a,apply:o,busy:s?.applying===`running`||n!==null,progress:!s||!c?null:n===null?s.applying===`running`?A(`about.update.installing`,{v:c}):s.applying===`done`?A(`about.update.done`,{v:c}):s.applying===`failed`?A(`about.update.failed`):null:A(`about.update.restarting`,{v:c})}}var Kc=(0,N.lazy)(()=>Nt(()=>import(`./AboutDialog-L1hcshAX.js`).then(e=>({default:e.AboutDialog})),__vite__mapDeps([4,1,2,5,6,7,8]))),qc=`0.5.11`;function Jc({me:e}){let[t,n]=(0,N.useState)(!1);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`button`,{type:`button`,className:`tabular-nums transition hover:text-ink-2`,onClick:()=>n(!0),children:A(`about.version`,{v:qc})}),t?(0,F.jsx)(N.Suspense,{fallback:null,children:(0,F.jsx)(Kc,{open:!0,me:e,onClose:()=>n(!1)})}):null]})}function Yc({enabled:e=!0,align:t=`center`}){let{status:n,data:r,latest:i,check:a,apply:o,busy:s,progress:c}=Gc(e),l=r?.checkedAt?new Date(r.checkedAt).toLocaleTimeString(S,{hour:`2-digit`,minute:`2-digit`}):null,u=t===`center`;return(0,F.jsxs)(`div`,{className:O(`flex flex-col gap-3 text-[0.875rem] text-ink-2`,u?`items-center text-center`:`items-start`),children:[n.isPending||a.isPending?(0,F.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,F.jsx)(D,{className:`size-4 text-ember-strong`}),A(`about.update.checking`)]}):c?(0,F.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[s?(0,F.jsx)(D,{className:`size-4 text-ember-strong`}):null,c]}):r?.newer&&i?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2.5 font-medium text-ink`,children:[(0,F.jsx)(Ie,{className:`size-4 shrink-0 text-ember-strong`}),A(`about.update.available`,{v:i})]}),r.canApply?null:(0,F.jsx)(`p`,{className:`text-ink-3`,children:A(`about.update.manual`)})]}):r?.enabled?r.latest===null?(0,F.jsx)(`p`,{children:A(`about.update.unknown`)}):(0,F.jsxs)(`p`,{children:[A(`about.update.upToDate`),l?(0,F.jsxs)(`span`,{className:`text-ink-4`,children:[` `,`· `,A(`about.update.checkedAt`,{when:l})]}):null]}):(0,F.jsx)(`p`,{children:A(`about.update.off`)}),s||n.isPending?null:(0,F.jsxs)(`div`,{className:O(`flex flex-wrap gap-2`,u&&`justify-center`),children:[r?.newer&&r.canApply&&r.applying!==`running`?(0,F.jsxs)(g,{size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(),children:[(0,F.jsx)(Ie,{className:`size-4`}),` `,A(`about.update.install`)]}):null,r?.enabled===!1?null:(0,F.jsxs)(g,{size:`sm`,variant:`secondary`,disabled:a.isPending,onClick:()=>a.mutate(),children:[(0,F.jsx)(pe,{className:O(`size-4`,a.isPending&&`animate-spin`)}),` `,A(`about.update.check`)]})]})]})}function Xc({me:e}){let t=e.mode===`local`,{status:n,data:r,latest:i,check:a,apply:o,busy:s,progress:c}=Gc(t),l=n.isPending||a.isPending;return(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-2 text-[0.8125rem] text-ink-3`,children:[(0,F.jsx)(Jc,{me:e}),(0,F.jsx)(`span`,{"aria-hidden":!0,children:`·`}),t?l?(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(D,{className:`size-3.5 text-ember-strong`}),` `,A(`about.update.checking`)]}):c?(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[s?(0,F.jsx)(D,{className:`size-3.5 text-ember-strong`}):null,c]}):r?.newer&&i?(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-ink`,children:[(0,F.jsx)(Ie,{className:`size-3.5 shrink-0 text-ember-strong`}),A(`about.update.available`,{v:i})]}):r?.enabled?r.latest===null?(0,F.jsx)(`span`,{children:A(`about.update.unknown`)}):(0,F.jsx)(`span`,{children:A(`about.update.upToDate`)}):(0,F.jsx)(`span`,{children:A(`about.update.off`)}):(0,F.jsx)(`span`,{children:A(`about.kind.cloud`)}),!t||l||s?null:r?.newer&&r.canApply?(0,F.jsxs)(g,{size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(),children:[(0,F.jsx)(Ie,{className:`size-4`}),` `,A(`about.update.install`)]}):r?.enabled?(0,F.jsx)(T,{label:A(`about.update.check`),className:`size-7 coarse:size-9`,onClick:()=>a.mutate(),children:(0,F.jsx)(pe,{className:`size-3.5`})}):null]})}var Zc=`cubic-bezier(0.3, 0.7, 0.2, 1)`,Qc=`(max-width: 639px)`;function $c(){return(0,N.useSyncExternalStore)(e=>{let t=window.matchMedia(Qc);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)},()=>window.matchMedia(Qc).matches,()=>!1)}function el({tone:e=`ground`,ink:t}){let n=Pe(),r=ra(),i=$c(),a=(0,N.useRef)({}),[o,s]=(0,N.useState)(null),c=ce(),l=c?[`en`,c]:[];(0,N.useLayoutEffect)(()=>{let e=()=>{let e={};for(let[t,n]of Object.entries(a.current))e[t]=n?Math.ceil(n.getBoundingClientRect().width):0;s(e)};e(),document.fonts?.ready.then(e)},[c]);let u=e=>o?o[e===n&&!i?`${e}-full`:`${e}-short`]+24:void 0,d=o?l.slice(0,l.indexOf(n)).reduce((e,t)=>e+(u(t)??0),0):0,f=`300ms ${Zc}`,p=e===`ground`;return c?(0,F.jsxs)(`fieldset`,{className:O(`relative inline-flex items-center rounded-full border-0 p-0.5 ring-1`,p?`bg-white/10 ring-white/15`:`bg-paper-2 ring-border-soft`),children:[(0,F.jsx)(`legend`,{className:`sr-only`,children:A(`nav.language`)}),o?(0,F.jsx)(`span`,{"aria-hidden":`true`,className:O(`absolute top-0.5 bottom-0.5 left-0.5 rounded-full shadow-sm motion-reduce:transition-none`,p?`bg-white`:`bg-card`),style:{width:u(n),transform:`translateX(${d}px)`,transition:`transform ${f}, width ${f}`}}):null,l.map(e=>{let o=e===n;return(0,F.jsxs)(`button`,{"aria-pressed":o,className:O(`relative h-7 cursor-pointer overflow-hidden whitespace-nowrap rounded-full font-medium text-[0.75rem] motion-reduce:transition-none`,p?o?`text-[oklch(32%_0.15_262)]`:`text-white/70`:o?`text-ink`:`text-ink-3`),lang:e,onClick:()=>{r(e)},style:{width:u(e),transition:`width ${f}, color ${f}`,...p&&o&&t?{color:t}:{}},title:Ve[e],type:`button`,children:[[Ve[e],e.toUpperCase()].map((e,t)=>{let n=o&&!i?t===0:t===1;return(0,F.jsx)(`span`,{"aria-hidden":!n,className:`absolute inset-0 grid place-items-center motion-reduce:transition-none`,style:{opacity:+!!n,transition:`opacity 220ms ${Zc}`},children:e},e)}),(0,F.jsx)(`span`,{ref:t=>{a.current[`${e}-full`]=t},"aria-hidden":`true`,className:`invisible absolute`,children:Ve[e]}),(0,F.jsx)(`span`,{ref:t=>{a.current[`${e}-short`]=t},"aria-hidden":`true`,className:`invisible absolute`,children:e.toUpperCase()}),(0,F.jsx)(`span`,{className:`invisible px-3`,children:o?Ve[e]:e.toUpperCase()})]},e)})]}):null}function tl(){let e=Pe(),t=ra();return(0,F.jsx)(de,{className:`w-44`,value:e,onChange:e=>{Tt(e)&&t(e)},options:$e.map(e=>({value:e,label:Ve[e]}))})}function nl(e){let t=window.engentyDesktop;t?t.open(e):window.open(e,`_blank`,`noopener`)}var rl={gateway:`Vercel AI Gateway`,anthropic:`Anthropic`,openai:`OpenAI`};function il({models:e}){let t=x(),[n,r]=(0,N.useState)({}),[i,a]=(0,N.useState)(e.bindings),[o,s]=(0,N.useState)(e.ollamaUrl),[c,l]=(0,N.useState)(!1),u=Kt({mutationFn:()=>k.put(`/api/studio/local/models`,{keys:n,bindings:i,ollamaUrl:o}),onSuccess:async()=>{r({}),l(!0),setTimeout(()=>l(!1),1500),await t.invalidateQueries({queryKey:[`me`]})}});return(0,F.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(ye,{children:A(`local.keys`)}),(0,F.jsx)(`p`,{className:`mb-3 text-[0.8125rem] text-ink-3`,children:A(`local.keysHint`)}),(0,F.jsx)(`div`,{className:`flex flex-col gap-2`,children:Object.keys(rl).map(i=>(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`w-40 text-[0.875rem] text-ink-2`,children:rl[i]}),(0,F.jsx)(he,{type:`password`,autoComplete:`off`,className:`min-w-0 flex-1 font-mono text-[0.8125rem]`,placeholder:e.keys[i]?A(`local.keySet`):A(`local.keyEmpty`),value:n[i]??``,onChange:e=>r({...n,[i]:e.target.value})}),e.keys[i]?(0,F.jsx)(g,{variant:`ghost`,size:`sm`,onClick:()=>{r({...n,[i]:``}),k.put(`/api/studio/local/models`,{keys:{[i]:``}}).then(()=>t.invalidateQueries({queryKey:[`me`]}))},children:A(`local.keyRemove`)}):null]},i))})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(ye,{children:A(`local.classes`)}),(0,F.jsx)(`p`,{className:`mb-3 text-[0.8125rem] text-ink-3`,children:A(`local.classesHint`)}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[xt.map(e=>(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`w-40 text-[0.875rem] text-ink-2`,children:A(`class.${e}`)}),(0,F.jsx)(he,{className:`min-w-0 flex-1 font-mono text-[0.8125rem]`,value:i[e]??``,onChange:t=>a({...i,[e]:t.target.value})})]},e)),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`w-40 text-[0.875rem] text-ink-2`,children:`Ollama`}),(0,F.jsx)(he,{className:`min-w-0 flex-1 font-mono text-[0.8125rem]`,value:o,onChange:e=>s(e.target.value)})]})]})]}),(0,F.jsx)(`div`,{children:(0,F.jsxs)(g,{variant:`secondary`,busy:u.isPending,onClick:()=>u.mutate(),children:[c?(0,F.jsx)(lt,{className:`size-4`}):null,A(c?`local.saved`:`local.save`)]})})]})}var al=[{theme:`light`,icon:li,label:`theme.light`},{theme:`dark`,icon:Tr,label:`theme.dark`}],ol=`cubic-bezier(0.3, 0.7, 0.2, 1)`;function sl({tone:e=`surface`}){let t=Hi(),n=Vi(),r=e===`ground`,i=r?n:t,a=al.findIndex(e=>e.theme===i);return(0,F.jsxs)(`fieldset`,{className:O(`relative inline-flex items-center rounded-full border-0 p-0.5 ring-1`,r?`bg-white/10 ring-white/15`:`bg-paper-2 ring-border-soft`),children:[(0,F.jsx)(`legend`,{className:`sr-only`,children:A(`nav.theme`)}),(0,F.jsx)(`span`,{"aria-hidden":`true`,className:O(`absolute top-0.5 bottom-0.5 left-0.5 w-9 rounded-full shadow-sm motion-reduce:transition-none`,r?`bg-white`:`bg-card`),style:{transform:`translateX(${a*36}px)`,transition:`transform 300ms ${ol}`}}),al.map(({theme:e,icon:t,label:n})=>(0,F.jsx)(`button`,{"aria-label":A(n),"aria-pressed":e===i,className:O(`relative grid h-7 w-9 cursor-pointer place-items-center rounded-full transition-colors motion-reduce:transition-none`,r?e===i?`text-[oklch(32%_0.15_262)]`:`text-white/70 hover:text-white`:e===i?`text-ink`:`text-ink-3 hover:text-ink-2`),onClick:()=>zi(e),title:A(n),type:`button`,children:(0,F.jsx)(t,{className:`size-3.5`})},e))]})}function cl(e){try{return new URL(e).host}catch{return e}}var ll=e=>`${Le()}/w/${e.shareToken}`;function ul(e,t,n){if(!e.published)return{kind:`draft`};if(t.mode===`managed`)return{kind:`live`,url:ll(e),runs:e.publishedVersion??0,notes:0,cloud:!1};if(!t.account||n===null)return{kind:`here`};if(n===void 0)return{kind:`unknown`};let{copy:r,error:i}=n,a=r?.publishedVersion??null,o=r&&a!==null?r.shareUrl:null;return i?.again?{kind:`sending`,url:o,runs:a,again:i.again}:i?{kind:`missing`,url:o,runs:a,why:i.message}:!r||r.version<(e.publishedVersion??0)?{kind:`missing`,url:o,runs:a,why:A(`cloud.notSent`)}:!r.runnable||!o||a===null?{kind:`missing`,url:o,runs:a,why:`${A(`cloud.notRunnable`,{v:r.version})} ${a===null?A(`cloud.nothingRuns`):A(`cloud.keepsRunning`,{v:a})}`}:{kind:`live`,url:o,runs:a,notes:r.problems.filter(e=>!e.blocking).length,cloud:!0}}function dl(e){return e.kind===`live`||e.kind===`sending`||e.kind===`missing`?e.url:null}function fl({where:e,me:t,version:n}){let r=cl(t.account?.cloudUrl??``),i=`size-3.5`;switch(e.kind){case`draft`:return null;case`unknown`:return(0,F.jsx)(rt,{tone:`live`,children:A(`home.live`)});case`here`:return(0,F.jsx)(rt,{icon:(0,F.jsx)(rr,{className:i}),title:A(`where.hereHint`),children:n?A(`where.hereVersion`,{v:n}):A(`where.here`)});case`live`:{let t=n?A(`editor.published`,{v:e.runs}):A(`home.live`),a=e.notes===1?A(`where.note`):e.notes>1?A(`where.notes`,{n:e.notes}):null;return(0,F.jsx)(rt,{tone:`live`,icon:e.cloud?(0,F.jsx)(Dn,{className:i}):void 0,title:e.cloud?A(`where.liveHint`,{host:r}):void 0,children:a?`${t} · ${a}`:t})}case`sending`:return(0,F.jsx)(rt,{tone:`warn`,icon:(0,F.jsx)(xe,{className:i}),title:A(`cloud.again`,{when:new Intl.DateTimeFormat(S,{timeStyle:`short`}).format(new Date(e.again))}),children:A(`where.sending`)});case`missing`:return(0,F.jsx)(rt,{tone:`warn`,icon:(0,F.jsx)(Tn,{className:i}),title:e.why,children:e.runs===null?A(`where.missing`):A(`editor.published`,{v:e.runs})})}}var pl=`mt-1.5 text-[0.8125rem] text-ink-3`;function ml(e){let t=x(),[n,r]=(0,N.useState)(!1),i=Kt({mutationFn:e=>k.post(`/api/studio/account/link`,e),onSuccess:({url:e})=>{nl(e),r(!0)}});return(0,N.useEffect)(()=>{if(!n)return;let e=setInterval(()=>void t.invalidateQueries({queryKey:[`me`]}),2e3),i=setTimeout(()=>r(!1),3e5);return()=>{clearInterval(e),clearTimeout(i)}},[n,t]),(0,N.useEffect)(()=>{e&&r(!1)},[e]),{link:i,waiting:n}}function hl({link:e,waiting:t}){return e.isError?(0,F.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:A(`local.accountFailed`)}):t?(0,F.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,F.jsx)(D,{className:`size-3.5`}),` `,A(`local.accountWaiting`)]}):null}function gl({me:e}){let t=Ba(`account`),n=ml(!1),{link:r}=n,[i,a]=(0,N.useState)(``);return(0,F.jsxs)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:[(0,F.jsxs)(`div`,{className:`flex items-start gap-4 py-5 first:pt-0 last:pb-0`,children:[(0,F.jsx)(`div`,{className:`flex size-11 shrink-0 items-center justify-center rounded-full bg-paper-2 text-ink-2`,children:(0,F.jsx)(qn,{className:`size-5`})}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`font-medium text-[0.9375rem]`,children:A(`account.local`)}),(0,F.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-3 leading-relaxed`,children:A(`account.localText`)}),(0,F.jsx)(`div`,{className:`mt-2`,children:(0,F.jsx)(Xc,{me:e})})]})]}),t?(0,F.jsxs)(`div`,{className:`flex flex-col gap-4 py-5 last:pb-0`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`font-medium text-[0.9375rem]`,children:A(`account.with`)}),(0,F.jsxs)(`ul`,{className:`mt-2 flex flex-col gap-2 text-[0.875rem] text-ink-2 leading-snug`,children:[(0,F.jsxs)(`li`,{className:`flex items-start gap-2.5`,children:[(0,F.jsx)(kn,{className:`mt-0.5 size-4 shrink-0 text-amber`}),A(`account.withCredits`)]}),(0,F.jsxs)(`li`,{className:`flex items-start gap-2.5`,children:[(0,F.jsx)(Dn,{className:`mt-0.5 size-4 shrink-0 text-cobalt`}),A(`account.withCloud`)]})]})]}),(0,F.jsx)(`div`,{children:(0,F.jsx)(g,{busy:r.isPending&&!r.variables?.signup,onClick:()=>r.mutate({}),children:A(`account.signIn`)})})]}):null,t?(0,F.jsxs)(`form`,{className:`flex flex-col gap-3 py-5 last:pb-0`,onSubmit:e=>{e.preventDefault(),r.mutate({signup:!0,code:i.trim()||void 0})},children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`font-medium text-[0.9375rem]`,children:A(`account.new`)}),(0,F.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-3 leading-relaxed`,children:A(`account.newHint`)})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,F.jsx)(he,{value:i,maxLength:64,autoComplete:`off`,spellCheck:!1,placeholder:A(`account.code`),"aria-label":A(`account.code`),onChange:e=>a(e.target.value),className:`w-56 font-mono text-[0.875rem]`}),(0,F.jsx)(g,{type:`submit`,variant:`secondary`,className:`h-11`,busy:r.isPending&&!!r.variables?.signup,children:A(`account.create`)})]}),(0,F.jsx)(hl,{...n})]}):null]})}var _l={start:`account.kind.start`,monthly:`account.kind.monthly`,gift:`account.kind.gift`};function vl({account:e,me:t}){let n=x(),r=ml(e.signedIn),i=Kt({mutationFn:()=>k.del(`/api/studio/account`),onSuccess:()=>n.invalidateQueries({queryKey:[`me`]})}),a=new Intl.DateTimeFormat(S,{dateStyle:`medium`});return(0,F.jsxs)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3 py-5 first:pt-0`,children:[(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`truncate font-medium text-[0.9375rem]`,children:e.name||e.email}),e.signedIn?(0,F.jsx)(rt,{tone:`live`,children:A(`account.linked`)}):null]}),(0,F.jsx)(`div`,{className:`truncate text-[0.875rem] text-ink-3`,children:e.email}),(0,F.jsx)(`div`,{className:`mt-2`,children:(0,F.jsx)(Xc,{me:t})})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsxs)(g,{variant:`secondary`,onClick:()=>nl(e.url),children:[A(`setup.openAccount`),` `,(0,F.jsx)(ae,{className:`size-4`})]}),(0,F.jsxs)(g,{variant:`ghost`,busy:i.isPending,onClick:()=>i.mutate(),children:[(0,F.jsx)(dr,{className:`size-4`}),` `,A(`nav.logout`)]})]})]}),e.signedIn?null:(0,F.jsxs)(`div`,{className:`flex flex-col gap-3 py-5`,children:[(0,F.jsx)(`p`,{className:`text-[0.875rem] text-ink-2`,children:A(`local.accountExpired`)}),(0,F.jsx)(`div`,{children:(0,F.jsx)(g,{busy:r.link.isPending,onClick:()=>r.link.mutate({}),children:A(`account.signInAgain`)})}),(0,F.jsx)(hl,{...r})]}),e.credits===null?null:(0,F.jsxs)(`div`,{className:`py-5`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3`,children:[(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:A(`account.credits`)}),(0,F.jsx)(`div`,{className:`font-display font-semibold text-[1.375rem] tabular-nums leading-tight`,children:A(`nav.credits`,{n:Math.floor(e.credits).toLocaleString(S)})})]}),(0,F.jsxs)(g,{variant:`secondary`,onClick:()=>nl(`${e.url}/billing`),children:[A(`account.topUp`),` `,(0,F.jsx)(ae,{className:`size-4`})]})]}),e.expiring.length?(0,F.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1 text-[0.8125rem] text-ink-3 tabular-nums`,children:e.expiring.map(e=>(0,F.jsxs)(`li`,{children:[A(`account.expires`,{n:Math.floor(e.credits).toLocaleString(S),date:a.format(new Date(e.expiresAt))}),_l[e.kind]?(0,F.jsxs)(`span`,{className:`text-ink-4`,children:[` · `,A(_l[e.kind])]}):null]},`${e.kind}:${e.expiresAt}`))}):null]}),(0,F.jsxs)(`div`,{className:`flex items-start gap-2.5 py-5 text-[0.875rem] text-ink-2 leading-snug last:pb-0`,children:[(0,F.jsx)(Dn,{className:`mt-0.5 size-4 shrink-0 text-cobalt`}),(0,F.jsx)(`p`,{children:A(`account.cloud`,{host:cl(e.cloudUrl)})})]})]})}function yl({me:e,fromAccount:t}){let n=x(),[r,i]=(0,N.useState)(e.profile),a=e=>i(t=>({...t,...e})),o=l(r,async e=>{await k.put(`/api/studio/profile`,e),await n.invalidateQueries({queryKey:[`me`]})});return(0,F.jsx)(f,{title:A(`account.profile`),hint:A(`account.hint`),save:o,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-6 sm:flex-row sm:gap-8`,children:[(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center gap-2 sm:w-32`,children:[(0,F.jsx)(`div`,{className:`flex size-20 items-center justify-center overflow-hidden rounded-full bg-ember-tint font-semibold text-[1.75rem] text-ember-strong ring-1 ring-border-soft`,children:e.user.image?(0,F.jsx)(`img`,{src:e.user.image,alt:``,className:`size-full object-cover`}):Zi(r.name)||`?`}),(0,F.jsx)(`p`,{className:`text-center text-[0.75rem] text-ink-3 leading-snug`,children:A(`account.initials`)})]}),(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-5`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(ye,{children:A(`account.name`)}),(0,F.jsx)(he,{value:r.name,maxLength:80,disabled:t,onChange:e=>a({name:e.target.value})}),(0,F.jsx)(`p`,{className:pl,children:A(t?`account.fromAccount`:`account.nameHint`)})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(ye,{children:A(`account.about`)}),(0,F.jsx)(ne,{minRows:3,maxLength:2e3,value:r.about,onChange:e=>a({about:e.target.value})}),(0,F.jsx)(`p`,{className:pl,children:A(`account.aboutHint`)})]}),(0,F.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(ye,{children:A(`account.email`)}),(0,F.jsx)(he,{type:`email`,value:r.email,maxLength:200,disabled:t,onChange:e=>a({email:e.target.value})})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(ye,{children:A(`account.phone`)}),(0,F.jsx)(he,{type:`tel`,value:r.phone,maxLength:40,onChange:e=>a({phone:e.target.value})})]})]})]})]})})}function H({me:e}){let t=e.mode===`managed`,n=t||!!e.account;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-9`,children:[(0,F.jsx)(f,{title:A(`account.connection`),hint:A(`account.connectionHint`),children:t?(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`truncate font-medium text-[0.9375rem]`,children:e.user.name}),(0,F.jsx)(rt,{tone:`live`,children:A(`account.linked`)})]}),(0,F.jsx)(`div`,{className:`truncate text-[0.875rem] text-ink-3`,children:e.user.email}),(0,F.jsx)(`div`,{className:`mt-2`,children:(0,F.jsx)(Xc,{me:e})})]}),e.manageUrl?(0,F.jsxs)(g,{variant:`secondary`,onClick:()=>nl(`${e.manageUrl}/account`),children:[A(`setup.openAccount`),` `,(0,F.jsx)(ae,{className:`size-4`})]}):null]}):e.account?(0,F.jsx)(vl,{account:e.account,me:e}):(0,F.jsx)(gl,{me:e})}),(0,F.jsx)(yl,{me:e,fromAccount:n},n?`account`:`own`),(0,F.jsx)(f,{title:A(`account.look`),hint:A(`account.lookHint`),children:(0,F.jsxs)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-4 pb-4`,children:[(0,F.jsx)(`span`,{className:`font-medium text-[0.875rem]`,children:A(`nav.language`)}),(0,F.jsx)(tl,{})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-4 pt-4`,children:[(0,F.jsx)(`span`,{className:`font-medium text-[0.875rem]`,children:A(`nav.theme`)}),(0,F.jsx)(sl,{})]})]})})]})}var bl={steps:Yr,chat:_r,talk:Oe,whatsapp:hr,sms:yr,call:Lr,video:_},xl=e=>bl[e]??Ur,Sl=[`steps`,`chat`];function Cl(){return Ue({queryKey:[`runners`],queryFn:()=>k.get(`/api/studio/runners`),staleTime:6e4})}function wl(e,t){let n=new Set(t.map(e=>e.id)),r=(e.runners?.enabled??Sl).filter(e=>n.has(e)),i=e.runners?.default??`steps`;return[...r].sort((e,t)=>e===i?-1:+(t===i))}function Tl({w:e,runners:t}){let n=wl(e,t),r=e.runners?.default??`steps`;return(0,F.jsx)(`span`,{className:`inline-flex items-center gap-1.5`,children:n.map(e=>{let n=xl(e),i=t.find(t=>t.id===e)?.label[S]??e;return(0,F.jsx)(n,{"aria-label":i,className:O(`size-3.5`,e===r?`text-ink-2`:`text-ink-4`),children:(0,F.jsx)(`title`,{children:i})},e)})})}var El=[`text`,`document`,`table`,`image`,`video`,`audio`,`dashboard`],Dl=[`any`,`trades`,`gastronomy`,`hospitality`,`realEstate`,`retail`,`health`,`professional`,`agency`,`events`,`publicSector`],Ol=[`marketing`,`sales`,`accounting`,`service`,`research`,`hr`,`operations`,`website`,`visuals`,`inquiries`,`advice`],kl=[`text`,`web`,`browser`,`documents`,`image`,`video`,`speech`,`listening`,`code`,`connectors`,`film`],Al=[`free`,`pro`],jl={"format.text":`Text`,"format.document":`Document (PDF, Word)`,"format.table":`Table`,"format.image":`Image`,"format.video":`Video`,"format.audio":`Audio`,"format.dashboard":`Dashboard`,"industry.any":`Any industry`,"industry.trades":`Trades`,"industry.gastronomy":`Food service`,"industry.hospitality":`Hotels & tourism`,"industry.realEstate":`Real estate`,"industry.retail":`Retail`,"industry.health":`Health`,"industry.professional":`Professional services`,"industry.agency":`Agency & marketing`,"industry.events":`Events`,"industry.publicSector":`Associations & public sector`,"useCase.marketing":`Marketing & social media`,"useCase.sales":`Offers & sales`,"useCase.accounting":`Accounting & receipts`,"useCase.service":`Customer service`,"useCase.research":`Research & analysis`,"useCase.hr":`HR & applications`,"useCase.operations":`Planning & operations`,"useCase.website":`Website helpers`,"useCase.visuals":`Images & video`,"useCase.inquiries":`Inquiries & bookings`,"useCase.advice":`Advice & pricing`,"capability.text":`Writes text`,"capability.web":`Web search`,"capability.browser":`Drives a browser`,"capability.documents":`Reads documents & photos`,"capability.image":`Makes images`,"capability.video":`Makes video`,"capability.speech":`Speech output`,"capability.listening":`Understands voice notes`,"capability.code":`Runs code`,"capability.connectors":`Connected accounts & systems`,"capability.film":`Films with Claude Code (on your subscription)`,"cost.low":`low cost`,"cost.medium":`medium cost`,"cost.high":`high cost`,"plan.free":`Free`,"plan.pro":`Pro`,"outline.otherwise":`otherwise`,"outline.and":`{first} and {second}`,"outline.with":`with {name}`,"outline.without":`without {name}`,"outline.contains":`{name} contains {value}`},Ml={en:jl,de:{"format.text":`Text`,"format.document":`Dokument (PDF, Word)`,"format.table":`Tabelle`,"format.image":`Bild`,"format.video":`Video`,"format.audio":`Audio`,"format.dashboard":`Dashboard`,"industry.any":`Jede Branche`,"industry.trades":`Handwerk`,"industry.gastronomy":`Gastronomie`,"industry.hospitality":`Hotel & Tourismus`,"industry.realEstate":`Immobilien`,"industry.retail":`Handel`,"industry.health":`Gesundheit`,"industry.professional":`Kanzlei & Beratung`,"industry.agency":`Agentur & Marketing`,"industry.events":`Veranstaltungen`,"industry.publicSector":`Vereine & Öffentliches`,"useCase.marketing":`Marketing & Social Media`,"useCase.sales":`Angebote & Verkauf`,"useCase.accounting":`Buchhaltung & Belege`,"useCase.service":`Kundenservice`,"useCase.research":`Recherche & Analyse`,"useCase.hr":`Personal & Bewerbungen`,"useCase.operations":`Planung & Abläufe`,"useCase.website":`Helfer für die Website`,"useCase.visuals":`Bilder & Video`,"useCase.inquiries":`Anfragen & Termine`,"useCase.advice":`Beratung & Preise`,"capability.text":`Text schreiben`,"capability.web":`Websuche`,"capability.browser":`Browser bedienen`,"capability.documents":`Dokumente & Fotos lesen`,"capability.image":`Bilder erzeugen`,"capability.video":`Videos erzeugen`,"capability.speech":`Sprachausgabe`,"capability.listening":`Sprachnotizen verstehen`,"capability.code":`Code ausführen`,"capability.connectors":`Verbundene Konten & Systeme`,"capability.film":`Filme mit Claude Code (auf deinem Abo)`,"cost.low":`günstig`,"cost.medium":`mittel`,"cost.high":`teuer`,"plan.free":`Kostenlos`,"plan.pro":`Pro`,"outline.otherwise":`sonst`,"outline.and":`{first} und {second}`,"outline.with":`mit {name}`,"outline.without":`ohne {name}`,"outline.contains":`{name} enthält {value}`}};function Nl(e,t,n,r){let i=`${e}.${t}`;return i in jl?ze(Ml,i,n,r):t}function Pl(e){switch(e.type){case`page`:return lr;case`agent`:return dn;case`generate`:return e.asset===`image`?Zn:e.asset===`video`?_:e.asset===`dashboard`?ar:gt;case`widget`:return nn;case`surface`:return sr;case`film`:return Cn;case`review`:return Ln;case`result`:return Vn}return Ci}var Fl={page:`bg-cobalt-tint text-cobalt`,agent:`bg-ember-tint text-ember-strong`,generate:`bg-amber-tint text-ink-2`,widget:`bg-ember-veil text-ember-strong`,surface:`bg-ember-veil text-ember-strong`,film:`bg-amber-tint text-ink-2`,review:`bg-moss-tint text-moss`,result:`bg-paper-2 text-ink-2`};function Il(e){return A(`type.${e.type}`)}var Ll=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`];function Rl(e){return Ll.includes(e)?A(`tool.${e}`):e}function zl(e){switch(e.type){case`page`:return e.fields.map(e=>e.label).join(` · `);case`agent`:{let t=e.tools.map(Rl),n=e.mcp?.length?[`MCP: ${e.mcp.join(`, `)}`]:[];return[...t,...n].join(` · `)||e.instructions.slice(0,90)}case`generate`:{let t=[e.asset];return e.options?.aspectRatio&&t.push(e.options.aspectRatio),e.options?.duration&&t.push(`${e.options.duration}s`),e.options?.resolution&&t.push(e.options.resolution),e.options?.template&&t.push(e.options.template),t.join(` · `)}case`widget`:return[e.entry,Object.keys(e.data).join(`, `)].filter(Boolean).join(` · `);case`surface`:return e.candidates?e.candidates.map(e=>e.id).join(` · `):Object.keys(e.data).join(`, `);case`film`:return[e.format,e.seconds?`${e.seconds}s`:null,e.skills.join(`, `)].filter(Boolean).join(` · `);case`review`:return[e.edit?A(`editor.reviewEditable`):null,e.regenerate?A(`editor.reviewRedo`):null].filter(Boolean).join(` · `);case`result`:return e.deliverables.map(e=>`${e.label??e.from} (${e.formats.join(`, `)})`).join(` · `)}return``}var Bl=e({EntryDialog:()=>cu,MarketplaceBrowser:()=>mu,MarketplaceCards:()=>pu,MarketplaceHits:()=>fu,ProChip:()=>Zl,useSettled:()=>uu}),Vl=(0,N.lazy)(()=>Nt(()=>import(`./FlowPreview-CTEJi5TQ.js`),__vite__mapDeps([9,1,2,5,6,10]))),Hl={useCase:``,industry:``,format:``,capability:``,plan:``},Ul=(e,t)=>Nl(e,t,S),Wl={en:yn,de:xn};function Gl(e){if(e<1)return 1;let t=10**Math.floor(Math.log10(e));return Math.round(e/t)*t}function Kl(e){return e.credits?A(`market.credits`,{n:Gl(e.credits.credits)}):Ul(`cost`,e.costTier)}var ql={text:hi,document:gt,table:di,image:Zn,video:_,audio:yt,dashboard:hn};function Jl({format:e,className:t}){let n=ql[e],r=Ul(`format`,e);return(0,F.jsx)(`span`,{title:r,className:`inline-flex`,children:(0,F.jsx)(n,{className:t,"aria-label":r,role:`img`})})}var Yl=[`low`,`medium`,`high`];function Xl({entry:e}){let t=Yl.indexOf(e.costTier)+1,n=Wl[S];return(0,F.jsxs)(`span`,{title:Kl(e),className:`inline-flex items-center gap-1`,children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex shrink-0`,children:Yl.slice(0,t).map((e,t)=>(0,F.jsx)(`span`,{className:O(`rounded-full bg-(--coin-bg,var(--color-card))`,t>0&&`-ml-1.5`),children:(0,F.jsx)(n,{className:`size-4`})},e))}),Ul(`cost`,e.costTier)]})}function Zl(){return(0,F.jsx)(rt,{tone:`ember`,title:A(`market.proHint`),children:A(`market.pro`)})}function Ql({plugin:e}){return(0,F.jsx)(rt,{icon:(0,F.jsx)(Ur,{className:`size-3.5`}),title:A(`market.fromPlugin`,{name:e.name}),children:e.name})}function $l({entry:e,onOpen:t}){return(0,F.jsxs)(_e,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:O(`relative flex min-h-[124px] cursor-pointer flex-col gap-5 p-4 text-left transition sm:min-h-[136px] sm:p-5 hover:shadow-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,(!e.usable||e.missing.length>0||!!e.needs?.length)&&`opacity-60`),children:[(0,F.jsx)(`span`,{className:`-top-4 pointer-events-none absolute right-4`,children:(0,F.jsx)(Ji,{kind:e.avatar,size:68})}),(0,F.jsxs)(`div`,{className:`min-w-0 pr-20`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 font-display font-semibold text-[0.9375rem]`,children:[e.title,e.plan===`pro`?(0,F.jsx)(Zl,{}):null,e.starred?(0,F.jsx)(si,{className:`size-3.5 shrink-0 fill-amber text-amber`,"aria-label":A(`market.starred`)}):null]}),(0,F.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3 leading-snug`,children:e.pitch})]}),(0,F.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center gap-x-3 gap-y-1.5 text-[0.75rem] text-ink-3`,children:[e.plugin?(0,F.jsx)(Ql,{plugin:e.plugin}):null,e.needs?.length?(0,F.jsx)(rt,{tone:`warn`,children:A(`market.needsPro`,{list:e.needs.join(`, `)})}):e.usable&&e.missing.length?(0,F.jsx)(rt,{tone:`warn`,children:A(`market.missing`,{list:tu(e.missing)})}):e.usable?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,F.jsx)(xe,{className:`size-3.5`}),` `,A(`market.minutes`,{n:e.effort.minutes})]}),(0,F.jsx)(Xl,{entry:e}),e.optional?.length?(0,F.jsx)(rt,{title:A(`market.optionalHint`,{list:tu(e.optional)}),children:A(`market.without`,{list:tu(e.optional)})}):null,(0,F.jsx)(`span`,{className:`ml-auto inline-flex items-center gap-1.5`,children:e.formats.map(e=>(0,F.jsx)(Jl,{format:e,className:`size-4`},e))})]}):(0,F.jsx)(rt,{tone:`warn`,children:A(`market.needsUpdate`)})]})]})}function eu({title:e,children:t}){return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`mb-1.5 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:e}),t]})}var tu=e=>e.map(e=>Ul(`capability`,e)).join(`, `),nu={text:Se,web:Gn,browser:u,documents:Zr,image:Zn,video:_,speech:xi,listening:Oe,code:pi,connectors:Vr,film:Cn};function ru(e){switch(e.type){case`page`:return lr;case`agent`:return dn;case`generate`:return e.asset===`image`?Zn:e.asset===`video`?_:e.asset===`voice`?xi:e.asset===`dashboard`?hn:gt;case`widget`:return e.video?Cn:nn;case`surface`:return nn;case`film`:return Cn;case`review`:return Ln;case`result`:return Vn}return Ci}function iu(e){let t=new Set;for(let[n,r]of e.entries())for(let i of r.branches??[]){let r=i.to===`end`?e.length:e.findIndex(e=>e.id===i.to);for(let i=n+1;i<r;i++)t.add(e[i].id)}return t}function au(e){let t=iu(e);return e.map(e=>({id:e.id,title:e.title,icon:ru(e),tone:Fl[e.type]??`bg-paper-2 text-ink-2`,optional:t.has(e.id),branches:e.branches}))}function ou({title:e,children:t}){return(0,F.jsx)(`span`,{title:e,className:`inline-flex items-center gap-2 border-border border-l px-4 first:border-l-0 first:pl-0`,children:t})}function U({icon:e,children:t,more:n}){return(0,F.jsxs)(`div`,{className:`flex gap-2.5`,children:[(0,F.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:e}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`text-[0.875rem] text-ink leading-snug`,children:t}),n?(0,F.jsx)(`div`,{className:`text-[0.75rem] text-ink-3 leading-snug`,children:n}):null]})]})}function su({className:e,children:t}){let n=(0,N.useRef)(null),[r,i]=(0,N.useState)({above:!1,below:!1});(0,N.useEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{let t=e.scrollTop>1,n=e.scrollTop+e.clientHeight<e.scrollHeight-1;i(e=>e.above===t&&e.below===n?e:{above:t,below:n})};t(),e.addEventListener(`scroll`,t,{passive:!0});let r=new ResizeObserver(t);return r.observe(e),e.firstElementChild&&r.observe(e.firstElementChild),()=>{e.removeEventListener(`scroll`,t),r.disconnect()}},[]);let a=`linear-gradient(to bottom, ${r.above?`transparent`:`black`} 0, black 28px, black calc(100% - 44px), ${r.below?`transparent`:`black`} 100%)`;return(0,F.jsx)(`div`,{ref:n,className:e,style:{maskImage:a,WebkitMaskImage:a},children:(0,F.jsx)(`div`,{children:t})})}function cu({id:e,fallback:t,onClose:n,onUse:r,busy:i}){let a=x(),o=Xe(),s=Ue({queryKey:[`marketplace-entry`,e,S],queryFn:()=>k.get(`/api/studio/marketplace/${encodeURIComponent(e)}?lang=${S}`),enabled:!!e,retry:!1}),l=s.data??t,u=Kt({mutationFn:t=>{let n=`/api/studio/marketplace/${encodeURIComponent(e)}/star`;return t?k.put(n):k.del(n)},onSuccess:()=>Promise.all([a.invalidateQueries({queryKey:[`marketplace`]}),a.invalidateQueries({queryKey:[`marketplace-entry`,e]})])}),d=Hi()===`dark`,f=Ft[Lt[l?.avatar||`round`]],p=d?`var(--card)`:`color-mix(in oklch, ${f??`var(--ink-4)`} 14%, var(--paper-2))`;return(0,F.jsx)(c,{open:!!e,onClose:n,wide:!0,bare:!0,children:l?(0,F.jsxs)(`div`,{className:`relative flex max-h-[calc(100dvh-48px)] flex-col rounded-2xl bg-card shadow-overlay max-sm:h-dvh max-sm:max-h-none max-sm:rounded-none`,children:[(0,F.jsx)(`button`,{type:`button`,"aria-label":A(`common.close`),onClick:n,className:`sm:-top-3.5 sm:-right-3.5 absolute top-3 right-3 z-20 flex size-9 items-center justify-center rounded-full bg-card text-ink-2 shadow-elevated ring-1 ring-border-soft transition hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,children:(0,F.jsx)(we,{className:`size-4`})}),(0,F.jsxs)(`header`,{className:`relative shrink-0 border-border-soft border-b px-5 pt-5 pb-4 text-ink sm:rounded-t-2xl sm:px-7`,style:{background:p,"--coin-bg":p},children:[(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 overflow-hidden sm:rounded-t-2xl`,children:(0,F.jsx)(`span`,{className:O(`-top-28 -right-10 absolute size-80 rounded-full bg-white blur-3xl`,d?`opacity-[0.14]`:`opacity-80`)})}),(0,F.jsx)(`div`,{className:`-bottom-5 absolute right-9 z-10 max-sm:hidden`,children:(0,F.jsx)(Ji,{kind:l.avatar,size:104})}),(0,F.jsxs)(`div`,{className:`relative sm:pr-36`,children:[(0,F.jsx)(`h2`,{className:`font-display font-semibold text-[1.375rem] leading-tight tracking-tight max-sm:pr-10`,children:l.title}),(0,F.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-2 leading-snug`,children:s.data?.description||l.pitch})]}),l.usable?(0,F.jsxs)(`div`,{className:`-mx-5 sm:-mx-7 relative mt-3.5 flex flex-wrap items-center gap-y-2 border-border-soft border-t px-5 pt-3 font-medium text-[0.875rem] sm:px-7 sm:pr-40`,children:[(0,F.jsxs)(ou,{title:A(`market.duration`),children:[(0,F.jsx)(xe,{className:`size-4 text-ink-3`}),A(`market.minutes`,{n:l.effort.minutes})]}),(0,F.jsx)(ou,{title:A(`market.cost`),children:(0,F.jsx)(Xl,{entry:l})}),(0,F.jsx)(ou,{title:A(`market.result`),children:l.formats.map(e=>(0,F.jsx)(Jl,{format:e,className:`size-4`},e))})]}):null]}),l.usable?(0,F.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-x-7 gap-y-6 px-5 pt-6 max-sm:overflow-y-auto max-sm:pb-4 sm:grid-cols-[230px_minmax(0,1fr)] sm:grid-rows-[minmax(0,1fr)] sm:px-7`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-5 sm:min-h-0 sm:overflow-y-auto`,children:[(0,F.jsx)(eu,{title:A(`market.duration`),children:(0,F.jsx)(U,{icon:(0,F.jsx)(xe,{className:`size-4 text-moss`}),more:A(`market.durationHint`,{n:l.effort.fields}),children:A(`market.minutes`,{n:l.effort.minutes})})}),(0,F.jsx)(eu,{title:A(`market.cost`),children:(0,F.jsx)(U,{icon:(0,F.jsx)(kn,{className:`size-4 text-amber`}),more:l.credits?A(`market.creditsHint`):void 0,children:(0,F.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2`,children:[(0,F.jsx)(Xl,{entry:l}),l.credits?(0,F.jsx)(`span`,{className:`text-ink-2`,children:A(`market.creditsRange`,{n:Gl(l.credits.credits)})}):null]})})}),(0,F.jsx)(eu,{title:A(`market.result`),children:(0,F.jsx)(`div`,{className:`flex flex-col gap-2`,children:(s.data?.results??[]).map(e=>(0,F.jsx)(U,{icon:(0,F.jsx)(Jl,{format:e.kind,className:`size-4 text-ember-strong`}),more:e.formats.map(e=>e.toUpperCase()).join(` · `),children:e.title},e.title))})}),(0,F.jsx)(eu,{title:A(`market.needs`),children:(0,F.jsx)(`ul`,{className:`flex flex-col gap-2`,children:l.capabilities.map(e=>{let t=nu[e],n=l.missing.includes(e),r=l.optional?.includes(e);return(0,F.jsxs)(`li`,{className:O(`flex items-center gap-2.5 text-[0.875rem]`,n?`text-ink-3`:`text-ink-2`),children:[(0,F.jsx)(t,{className:O(`size-4 shrink-0`,n?`text-rose`:r?`text-amber`:`text-cobalt`)}),Ul(`capability`,e),n?(0,F.jsx)(`span`,{className:`text-[0.75rem] text-rose`,children:A(`market.unavailable`)}):r?(0,F.jsx)(`span`,{className:`text-[0.75rem] text-amber`,children:A(`market.optional`)}):null]},e)})})})]}),(0,F.jsxs)(`div`,{className:`flex flex-col sm:min-h-0`,children:[(0,F.jsx)(`div`,{className:`mb-1.5 shrink-0 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:A(`market.steps`)}),(0,F.jsx)(su,{className:`-mr-2 overscroll-contain pt-1 pr-2 pl-1 sm:min-h-0 sm:flex-1 sm:overflow-y-auto`,children:s.isLoading?(0,F.jsx)(D,{className:`size-5 text-ink-3`}):(0,F.jsx)(N.Suspense,{fallback:(0,F.jsx)(D,{className:`size-5 text-ink-3`}),children:(0,F.jsx)(Vl,{steps:au(s.data?.outline??[])})})})]})]}):(0,F.jsx)(`div`,{className:`flex-1 px-5 pt-6 sm:px-7`,children:(0,F.jsx)(`p`,{className:`rounded-lg bg-amber-tint p-3 text-[0.875rem] text-ink-2`,children:A(`market.needsUpdateHint`)})}),(0,F.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 px-5 pt-4 pb-5 max-sm:border-border-soft max-sm:border-t sm:px-7 sm:pb-6`,children:[l.plugin?(0,F.jsx)(`span`,{className:`mr-auto flex items-center`,children:(0,F.jsx)(Ql,{plugin:l.plugin})}):(0,F.jsxs)(g,{variant:`ghost`,className:`mr-auto`,title:A(`market.starHint`),"aria-pressed":l.starred,busy:u.isPending,onClick:()=>u.mutate(!l.starred),children:[(0,F.jsx)(si,{className:O(`size-4`,l.starred&&`fill-amber text-amber`)}),(0,F.jsx)(`span`,{className:`max-sm:sr-only`,children:A(l.starred?`market.starred`:`market.star`)})]}),(0,F.jsx)(g,{variant:`secondary`,onClick:n,children:A(`common.close`)}),l.usable&&l.missing.length?(0,F.jsx)(g,{variant:`secondary`,onClick:()=>o(`/settings/models`),children:A(`editor.models.settings`)}):null,r?(0,F.jsx)(g,{disabled:!l.usable||l.missing.length>0||!!l.needs?.length,title:l.needs?.length?A(`market.needsProHint`,{list:l.needs.join(`, `)}):l.missing.length?A(`market.missingHint`,{list:tu(l.missing)}):l.optional?.length?A(`market.optionalHint`,{list:tu(l.optional)}):void 0,busy:i,onClick:()=>r(l),children:A(`market.use`)}):null]})]}):(0,F.jsx)(`div`,{className:`flex min-h-48 flex-col items-center justify-center gap-3 rounded-2xl bg-card p-8 text-[0.875rem] text-ink-2 shadow-overlay`,children:s.isLoading?(0,F.jsx)(D,{className:`size-6 text-ink-3`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`p`,{children:A(`market.notFound`)}),(0,F.jsx)(g,{variant:`secondary`,onClick:n,children:A(`common.close`)})]})})})}function lu({name:e,value:t,options:n,onChange:r}){let[i,a]=(0,N.useState)(!1),o=(0,N.useRef)(null);(0,N.useEffect)(()=>{if(!i)return;let e=e=>{o.current?.contains(e.target)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]);let s=n.find(e=>e.value===t);return(0,F.jsxs)(`div`,{ref:o,className:`relative`,children:[(0,F.jsxs)(`div`,{className:O(`flex h-8 items-center rounded-full text-[0.8125rem] transition`,s?`bg-ember-tint text-ink`:`text-ink-2 hover:bg-paper-2 hover:text-ink`,i&&!s&&`bg-paper-2 text-ink`),children:[(0,F.jsx)(`button`,{type:`button`,"aria-haspopup":`listbox`,"aria-expanded":i,onClick:()=>a(!i),className:O(`flex h-full items-center gap-1.5 rounded-full pl-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus`,s?`pr-1`:`pr-2.5`),children:s?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{className:`text-ink-3`,children:e}),(0,F.jsx)(`span`,{className:`font-medium`,children:s.label})]}):(0,F.jsxs)(F.Fragment,{children:[e,(0,F.jsx)(Ct,{className:O(`size-3.5 transition`,i&&`rotate-180`)})]})}),s?(0,F.jsx)(`button`,{type:`button`,"aria-label":`${e}: ${A(`market.reset`)}`,onClick:()=>r(``),className:`mr-1 flex size-6 items-center justify-center rounded-full text-ink-3 hover:bg-card hover:text-ink`,children:(0,F.jsx)(we,{className:`size-3.5`})}):null]}),i?(0,F.jsx)(`div`,{role:`listbox`,"aria-label":e,className:`absolute top-full left-0 z-30 mt-1.5 max-h-80 min-w-60 overflow-y-auto rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,children:n.map(e=>(0,F.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":e.value===t,disabled:!e.count||e.unavailable,onClick:()=>{r(e.value===t?``:e.value),a(!1)},className:O(`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left text-[0.875rem] transition coarse:py-2.5`,e.count&&!e.unavailable?`text-ink-2 hover:bg-paper-2 hover:text-ink`:`text-ink-4`,e.value===t&&`font-medium text-ink`),children:[e.icon,(0,F.jsx)(`span`,{className:`flex-1 whitespace-nowrap`,children:e.label}),e.value===t?(0,F.jsx)(lt,{className:`size-4 text-ember`}):e.unavailable?(0,F.jsx)(`span`,{className:`whitespace-nowrap text-[0.75rem] text-ink-4`,children:A(`market.unavailable`)}):(0,F.jsx)(`span`,{className:`text-[0.75rem] text-ink-4 tabular-nums`,children:e.count})]},e.value))}):null]})}function uu(e,t){let[n,r]=(0,N.useState)(e);return(0,N.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var du=60;function fu({query:e,onUse:t,busy:n,limit:r=6}){let[i,a]=(0,N.useState)(null),o=uu(e.trim(),250),s=Ue({queryKey:[`marketplace`,S,o,`hits`,r],queryFn:()=>k.get(`/api/studio/marketplace?${new URLSearchParams({lang:S,limit:String(r),offset:`0`,q:o})}`),enabled:!!o,placeholderData:b}),c=o?s.data?.entries??[]:[];return c.length?(0,F.jsxs)(`section`,{className:`mt-10`,children:[(0,F.jsxs)(`h2`,{className:`mb-5 flex items-center gap-2 font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:[A(`market.hits`),s.isFetching?(0,F.jsx)(D,{className:`size-3.5`}):null]}),(0,F.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:c.map(e=>(0,F.jsx)($l,{entry:e,onOpen:()=>a(e.id)},e.id))}),(0,F.jsx)(cu,{id:i,fallback:c.find(e=>e.id===i)??null,onClose:()=>a(null),onUse:t,busy:n})]}):null}function pu({entries:e}){let t=x(),n=Xe(),{project:r}=ua(),i=ea()&&!!r&&!r?.readOnly,[a,o]=(0,N.useState)(null),s=Kt({mutationFn:e=>k.post(`/api/studio/wizards`,{projectId:r.id,starterId:e,lang:S}),onSuccess:async({id:e})=>{await t.invalidateQueries({queryKey:[`projects`]}),await t.invalidateQueries({queryKey:[`wizards`]}),o(null),n(`/edit/${e}`)}});return(0,F.jsxs)(`div`,{className:`@container mt-3`,children:[(0,F.jsx)(`div`,{className:`grid gap-4 @xl:grid-cols-2`,children:e.map(e=>(0,F.jsx)($l,{entry:e,onOpen:()=>o(e.id)},e.id))}),s.error?(0,F.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:s.error.message}):null,(0,F.jsx)(cu,{id:a,fallback:e.find(e=>e.id===a)??null,onClose:()=>o(null),onUse:i?e=>!s.isPending&&s.mutate(e.id):void 0,busy:s.isPending})]})}function mu({onUse:e,busy:t,open:n,search:r,onGuestOpen:i}){let[a,o]=(0,N.useState)(``);(0,N.useEffect)(()=>{r&&o(r.text)},[r]);let[s,c]=(0,N.useState)(Hl),[l,u]=(0,N.useState)(!1),[d,f]=(0,N.useState)(n??null),p=uu(a.trim(),250),m=qt({queryKey:[`marketplace`,S,p,s,l],queryFn:({pageParam:e})=>{let t=new URLSearchParams({lang:S,limit:String(du),offset:String(e)});p&&t.set(`q`,p);for(let[e,n]of Object.entries(s))n&&t.set(e,n);return l&&t.set(`starred`,`1`),k.get(`/api/${i?`guest`:`studio`}/marketplace?${t}`)},initialPageParam:0,getNextPageParam:(e,t)=>{let n=t.reduce((e,t)=>e+t.entries.length,0);return n<e.total?n:void 0},placeholderData:b}),h=m.data?.pages[0],_=m.data?.pages.flatMap(e=>e.entries)??[],v=h?.all??0,y=a.trim()!==p||m.isFetching&&!m.isFetchingNextPage,ee=(e,t,n,r)=>n.filter(t=>h?.facets[e]?.[t]!==void 0).map(n=>({value:n,label:Ul(t,n),icon:r?.(n),count:(h?.facets[e])[n]??0,unavailable:e===`capability`&&te.has(n)})),te=new Set(h?.unavailable??[]),x=ee(`useCase`,`useCase`,Ol),C=[{key:`industry`,name:A(`market.industry`),options:ee(`industry`,`industry`,Dl)},{key:`format`,name:A(`market.format`),options:ee(`format`,`format`,El,e=>(0,F.jsx)(Jl,{format:e,className:`size-4 text-ink-3`}))},{key:`plan`,name:A(`market.plan`),options:ee(`plan`,`plan`,Al)},{key:`capability`,name:A(`market.capability`),options:ee(`capability`,`capability`,kl,e=>{let t=nu[e];return(0,F.jsx)(t,{className:`size-4 text-ink-3`})})}],ne=!!a.trim()||l||Object.values(s).some(Boolean),re=()=>{c(Hl),o(``),u(!1)};if(m.isLoading)return(0,F.jsx)(`div`,{className:`flex justify-center py-10`,children:(0,F.jsx)(D,{className:`size-6 text-ink-3`})});let ie=h?.offline?(0,F.jsxs)(`p`,{className:`mt-4 flex items-center justify-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,F.jsx)(Tn,{className:`size-4 shrink-0`}),A(`market.offline`)]}):null;if(!v&&!ne)return ie;let w=a?(0,F.jsx)(`button`,{type:`button`,"aria-label":A(`market.reset`),onClick:()=>o(``),className:`-mr-1.5 flex size-7 shrink-0 items-center justify-center rounded-full text-ink-3 hover:bg-paper-2 hover:text-ink`,children:(0,F.jsx)(we,{className:`size-4`})}):null,ae=e=>O(`inline-flex h-7 shrink-0 items-center gap-1 whitespace-nowrap rounded-full px-2.5 text-[0.78125rem] transition`,e?`bg-card font-medium text-ink shadow-soft ring-1 ring-border-soft`:`text-ink-3 hover:bg-card/60 hover:text-ink`);return(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`label`,{className:`relative mx-auto flex h-10 max-w-md items-center gap-2.5 rounded-full bg-card px-4 shadow-soft ring-1 ring-border-soft transition focus-within:ring-2 focus-within:ring-focus sm:h-11`,children:[y?(0,F.jsx)(D,{className:`size-4 shrink-0 text-ink-3`}):(0,F.jsx)(et,{className:`size-4 shrink-0 text-ink-3`}),(0,F.jsx)(`input`,{type:`search`,value:a,onChange:e=>o(e.target.value),placeholder:A(`market.search`),"aria-label":A(`market.search`),className:`min-w-0 flex-1 bg-transparent text-[0.9375rem] outline-none placeholder:text-ink-4 [&::-webkit-search-cancel-button]:hidden`}),w]}),ie,(0,F.jsxs)(`div`,{className:`max-sm:-mx-3 mt-4 flex gap-1 max-sm:overflow-x-auto max-sm:px-3 max-sm:[scrollbar-width:none] sm:flex-wrap sm:justify-center max-sm:[&::-webkit-scrollbar]:hidden`,children:[[{value:``,label:A(`market.all`)},...x].map(e=>(0,F.jsx)(`button`,{type:`button`,"aria-pressed":!l&&s.useCase===e.value,onClick:()=>{u(!1),c({...s,useCase:e.value})},className:ae(!l&&s.useCase===e.value),children:e.label},e.value)),i?null:(0,F.jsxs)(`button`,{type:`button`,"aria-pressed":l,onClick:()=>u(!l),className:ae(l),children:[(0,F.jsx)(si,{className:O(`size-3.5`,l&&`fill-amber text-amber`)}),A(`market.starred`)]})]}),(0,F.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-1 gap-y-2 sm:mt-6`,children:[l?null:C.map(e=>(0,F.jsx)(lu,{name:e.name,value:s[e.key],options:e.options,onChange:t=>c({...s,[e.key]:t})},e.key)),(0,F.jsxs)(`span`,{className:`ml-auto flex items-center gap-3 whitespace-nowrap pl-2 text-[0.8125rem] text-ink-3`,children:[ne?(0,F.jsxs)(`button`,{type:`button`,onClick:re,className:`inline-flex items-center gap-1 text-ember-strong underline-offset-2 hover:underline`,children:[(0,F.jsx)(we,{className:`size-3.5 max-sm:size-4`}),(0,F.jsx)(`span`,{className:`max-sm:sr-only`,children:A(`market.resetShort`)})]}):null,ne?(0,F.jsx)(`span`,{className:`tabular-nums sm:hidden`,children:A(`market.countOfShort`,{n:h?.total??0,all:v})}):null,(0,F.jsx)(`span`,{className:O(`tabular-nums`,ne&&`max-sm:hidden`),children:ne?A(`market.countOf`,{n:h?.total??0,all:v}):A(`market.count`,{n:v})})]})]}),_.length?(0,F.jsx)(`div`,{className:`mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:_.map(e=>(0,F.jsx)($l,{entry:e,onOpen:()=>i?i(e):f(e.id)},e.id))}):(0,F.jsxs)(`div`,{className:`py-10 text-center text-[0.875rem] text-ink-3`,children:[(0,F.jsx)(`p`,{children:A(l?`market.noneStarred`:`market.none`)}),(0,F.jsx)(g,{variant:`ghost`,className:`mt-2`,onClick:re,children:A(`market.reset`)})]}),m.hasNextPage?(0,F.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,F.jsx)(g,{variant:`secondary`,busy:m.isFetchingNextPage,onClick:()=>void m.fetchNextPage(),children:A(`market.more`)})}):null,(0,F.jsx)(cu,{id:d,fallback:_.find(e=>e.id===d)??null,onClose:()=>f(null),onUse:e,busy:t})]})}function hu({wizard:e,className:t,onDeleted:n}){let r=x(),i=Xe(),o=ta(),[s,l]=(0,N.useState)(!1),[u,d]=(0,N.useState)(!1),f=(0,N.useRef)(null);nd(f,s,()=>l(!1));let p=Kt({mutationFn:()=>k.post(`/api/studio/wizards/${e.id}/duplicate`),onSuccess:async({id:e})=>{await r.invalidateQueries({queryKey:[`wizards`]}),i(`/edit/${e}`)}}),h=Kt({mutationFn:()=>k.del(`/api/studio/wizards/${e.id}`),onSuccess:async()=>{d(!1),await r.invalidateQueries({queryKey:[`wizards`]}),await r.invalidateQueries({queryKey:[`projects`]}),n?.()}}),_=`flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-[0.875rem] text-ink-2 transition hover:bg-accent hover:text-ink`;return(0,F.jsxs)(`div`,{ref:f,className:O(`relative`,t),onClick:e=>e.stopPropagation(),children:[(0,F.jsx)(`button`,{type:`button`,"aria-label":A(`wizardMenu.label`),title:A(`wizardMenu.label`),"aria-haspopup":`menu`,"aria-expanded":s,onClick:()=>l(e=>!e),className:O(`grid size-8 place-items-center rounded-full text-ink-3 transition hover:bg-accent hover:text-ink`,s&&`bg-accent text-ink`),children:(0,F.jsx)(Fn,{className:`size-4`})}),s?(0,F.jsxs)(`div`,{role:`menu`,className:`absolute top-full right-0 z-50 mt-1 w-60 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,children:[(0,F.jsxs)(`button`,{type:`button`,role:`menuitem`,className:_,disabled:p.isPending,onClick:()=>{l(!1),p.mutate()},children:[(0,F.jsx)(Re,{className:`size-4 shrink-0`}),` `,A(`wizardMenu.duplicate`)]}),(0,F.jsxs)(`a`,{role:`menuitem`,href:a(`/api/studio/wizards/${e.id}/export`),download:!0,className:_,onClick:()=>l(!1),children:[(0,F.jsx)(Ie,{className:`size-4 shrink-0`}),` `,A(`editor.export`)]}),o?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,F.jsxs)(`button`,{type:`button`,role:`menuitem`,className:O(_,`text-rose hover:bg-rose-tint hover:text-rose`),onClick:()=>{l(!1),d(!0)},children:[(0,F.jsx)(m,{className:`size-4 shrink-0`}),` `,A(`wizardMenu.delete`)]})]}):null]}):null,(0,F.jsxs)(c,{open:u,onClose:()=>d(!1),title:A(`wizardMenu.deleteTitle`,{title:e.title}),children:[(0,F.jsx)(`p`,{className:`-mt-2 text-[0.875rem] text-ink-2`,children:e.published?A(`wizardMenu.deletePublished`):A(`wizardMenu.deleteDraft`)}),h.error?(0,F.jsx)(`p`,{className:`mt-3 text-[0.8125rem] text-rose`,children:h.error.message}):null,(0,F.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,F.jsx)(g,{variant:`ghost`,onClick:()=>d(!1),children:A(`common.cancel`)}),(0,F.jsxs)(g,{variant:`danger`,busy:h.isPending,onClick:()=>h.mutate(),children:[(0,F.jsx)(m,{className:`size-4`}),` `,A(`wizardMenu.delete`)]})]})]})]})}var gu=e({HomePage:()=>Nu,NewSpaceDialog:()=>vu,ProjectSwitcher:()=>yu}),_u=[{icon:Ci,name:()=>A(`nav.wizards`),what:`space.holds.wizards`},{icon:zn,name:()=>A(`space.info`),what:`space.holds.info`},{icon:ln,name:()=>`${A(`space.knowledge`)} & ${A(`space.data`)}`,what:`space.holds.knowledge`},{icon:Vr,name:()=>A(`connectors.title`),what:`space.holds.connectors`},{icon:tr,name:()=>A(`space.results`),what:`space.holds.results`}];function vu({open:e,onClose:t}){let{select:n}=ua(),r=x(),[i,a]=(0,N.useState)(``),o=Kt({mutationFn:()=>k.post(`/api/studio/projects`,{name:i}),onSuccess:async({id:e})=>{await r.invalidateQueries({queryKey:[`projects`]}),n(e),a(``),t()}});return(0,F.jsxs)(c,{open:e,onClose:t,title:A(`home.newProject`),children:[(0,F.jsx)(`p`,{className:`-mt-2 text-[0.875rem] text-ink-2`,children:A(`space.holds.intro`)}),(0,F.jsx)(`dl`,{className:`mt-4 flex flex-col gap-2.5 text-[0.8125rem]`,children:_u.map(e=>(0,F.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,F.jsx)(e.icon,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),(0,F.jsx)(`dt`,{className:`w-28 shrink-0 font-medium text-ink`,children:e.name()}),(0,F.jsx)(`dd`,{className:`min-w-0 text-ink-3`,children:A(e.what)})]},e.what))}),(0,F.jsx)(`p`,{className:`mt-3 text-[0.8125rem] text-ink-4`,children:A(`space.holds.shared`)}),(0,F.jsxs)(`form`,{className:`mt-5`,onSubmit:e=>{e.preventDefault(),i.trim()&&o.mutate()},children:[(0,F.jsx)(he,{autoFocus:!0,placeholder:A(`home.projectName`),value:i,onChange:e=>a(e.target.value)}),(0,F.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,F.jsx)(g,{variant:`ghost`,onClick:t,children:A(`common.cancel`)}),(0,F.jsx)(g,{type:`submit`,busy:o.isPending,disabled:!i.trim(),children:A(`home.newProject`)})]})]})]})}function yu(){let{project:e,projects:t,select:n}=ua(),r=aa().data?.limits.projects??1,i=ea(),[a,o]=(0,N.useState)(!1);return!e||r!==null&&r<=1?null:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(de,{className:`w-56`,value:e.id,onChange:e=>e===`__new`?o(!0):n(e),options:[...t.map(e=>({value:e.id,label:e.name})),...i?[r===null||t.length<r?{value:`__new`,label:`+ ${A(`home.newProject`)}`}:{value:`__new`,label:A(`home.projectLimit`,{n:r}),disabled:!0}]:[]]}),(0,F.jsx)(vu,{open:a,onClose:()=>o(!1)})]})}function bu({url:e}){let[t,n]=(0,N.useState)(!1);return(0,F.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)},className:`inline-flex h-8 items-center gap-1.5 rounded-full px-3 text-[0.8125rem] text-ink-3 hover:bg-accent hover:text-ink`,children:[t?(0,F.jsx)(lt,{className:`size-3.5`}):(0,F.jsx)(Re,{className:`size-3.5`}),A(t?`share.copied`:`share.link`)]})}function xu(){let e=Xe(),t=ml(!1),[n,r]=(0,N.useState)(!1),i=(0,N.useRef)(null);return(0,N.useEffect)(()=>{if(!n)return;let e=e=>{i.current?.contains(e.target)||r(!1)},t=e=>{e.key===`Escape`&&r(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[n]),(0,F.jsxs)(`div`,{className:`relative`,ref:i,onClick:e=>e.stopPropagation(),children:[(0,F.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>r(e=>!e),className:`inline-flex h-8 items-center gap-1.5 rounded-full px-3 text-[0.8125rem] text-ink-3 hover:bg-accent hover:text-ink`,children:[(0,F.jsx)(Re,{className:`size-3.5`}),` `,A(`share.link`)]}),n?(0,F.jsxs)(`div`,{className:`absolute right-0 bottom-10 z-20 flex w-72 animate-rise flex-col gap-3 rounded-xl bg-card p-3.5 shadow-overlay ring-1 ring-border-soft`,children:[(0,F.jsx)(`p`,{className:`text-[0.8125rem] text-ink-2 leading-relaxed`,children:A(`teaser.link`)}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,F.jsx)(g,{size:`sm`,busy:t.link.isPending,onClick:()=>t.link.mutate({}),children:A(`account.signIn`)}),(0,F.jsx)(g,{size:`sm`,variant:`secondary`,onClick:()=>e(`/settings/account`),children:A(`account.create`)})]}),(0,F.jsx)(hl,{...t})]}):null]})}function Su({w:e,me:t,runners:n}){let r=Ba(`account`),i=Xe(),a=ul(e,t,e.cloud),o=dl(a),s=o??(e.published?ll(e):null);return(0,F.jsxs)(`div`,{className:`group/card relative pt-6`,children:[(0,F.jsx)(`div`,{className:`pointer-events-none absolute top-0 left-4 z-10`,children:(0,F.jsx)(Ji,{kind:e.avatar,size:52})}),(0,F.jsxs)(_e,{className:`relative flex h-full cursor-pointer flex-col px-5 pt-10 pb-3 transition hover:shadow-elevated`,onClick:()=>i(`/edit/${e.id}`),children:[(0,F.jsx)(`div`,{className:`absolute top-3 right-3`,children:e.published?(0,F.jsx)(fl,{where:a,me:t}):(0,F.jsx)(rt,{children:A(`home.draft`)})}),(0,F.jsx)(`h3`,{className:`font-display font-semibold text-[1.0625rem] leading-snug`,children:e.title}),(0,F.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[0.875rem] text-ink-3`,children:e.description}),(0,F.jsxs)(`div`,{className:`mt-auto flex min-h-8 items-center justify-between pt-3`,children:[(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2.5 text-[0.75rem] text-ink-4`,children:[A(`home.steps`,{n:e.stepCount}),(0,F.jsx)(Tl,{w:e,runners:n})]}),(0,F.jsxs)(`div`,{className:`flex items-center`,children:[(0,F.jsx)(hu,{wizard:e,className:`opacity-0 transition group-hover/card:opacity-100 has-[[aria-expanded=true]]:opacity-100 focus-within:opacity-100 coarse:opacity-100`}),o?(0,F.jsx)(bu,{url:o}):a.kind===`here`&&r?(0,F.jsx)(xu,{}):null,s?(0,F.jsx)(T,{label:A(o?`share.open`:`share.openHere`),className:`ml-1 size-8`,onClick:e=>{e.stopPropagation(),nl(s)},children:(0,F.jsx)(an,{className:`size-4`})}):null]})]})]})]})}var Cu=[`draft`,`here`,`live`,`missing`],wu={draft:le,here:rr,live:Gr,missing:Tn},Tu=e=>A(e===`draft`?`home.draft`:e===`here`?`where.here`:e===`live`?`home.live`:`where.missing`);function Eu(e,t){let{kind:n}=ul(e,t,e.cloud);return n===`draft`||n===`here`?n:n===`live`||n===`unknown`?`live`:`missing`}function Du({wizards:e,me:t,value:n,onChange:r}){let i=new Map;for(let n of e){let e=Eu(n,t);i.set(e,(i.get(e)??0)+1)}if(i.size<2)return null;let a=e=>O(`inline-flex h-8 items-center gap-1.5 rounded-full px-3 font-medium text-[0.8125rem] transition`,e?`bg-paper-2 text-ink`:`text-ink-3 hover:text-ink`);return(0,F.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-1`,children:[(0,F.jsxs)(`button`,{type:`button`,className:a(n===null),onClick:()=>r(null),children:[A(`home.all`),(0,F.jsx)(`span`,{className:`text-[0.75rem] text-ink-4`,children:e.length})]}),Cu.filter(e=>i.has(e)).map(e=>{let t=wu[e];return(0,F.jsxs)(`button`,{type:`button`,"aria-pressed":n===e,className:a(n===e),onClick:()=>r(n===e?null:e),children:[(0,F.jsx)(t,{className:`size-3.5`}),Tu(e),(0,F.jsx)(`span`,{className:`text-[0.75rem] text-ink-4`,children:i.get(e)})]},e)})]})}var Ou=12,ku=3;function Au({value:e,onChange:t}){return(0,F.jsxs)(`label`,{className:`relative flex h-10 w-full max-w-md items-center gap-2.5 rounded-full bg-card px-4 shadow-soft ring-1 ring-border-soft transition focus-within:ring-2 focus-within:ring-focus sm:h-11`,children:[(0,F.jsx)(et,{className:`size-4 shrink-0 text-ink-3`}),(0,F.jsx)(`input`,{type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:A(`home.search`),"aria-label":A(`home.search`),className:`min-w-0 flex-1 bg-transparent text-[0.9375rem] outline-none placeholder:text-ink-4 [&::-webkit-search-cancel-button]:hidden`}),e?(0,F.jsx)(`button`,{type:`button`,"aria-label":A(`market.reset`),onClick:()=>t(``),className:`-mr-1.5 flex size-7 shrink-0 items-center justify-center rounded-full text-ink-3 hover:bg-paper-2 hover:text-ink`,children:(0,F.jsx)(we,{className:`size-4`})}):null]})}var ju=`curl -fsSL https://engenty.ai/install.sh | bash`;function Mu(){let[e,t]=(0,N.useState)(!1),n=[A(`home.local.install`),A(`home.local.signIn`),A(`home.local.publish`)];return(0,F.jsxs)(`div`,{className:`mx-auto flex max-w-xl animate-rise flex-col items-center pt-4 text-center`,children:[(0,F.jsx)(Ji,{kind:`round`,size:120}),(0,F.jsx)(`h1`,{className:`mt-2 font-display font-semibold text-[1.75rem] leading-tight tracking-tight`,children:A(`home.local.title`)}),(0,F.jsx)(`p`,{className:`mt-3 text-[0.9375rem] text-ink-2 leading-relaxed`,children:A(`home.local.text`)}),(0,F.jsx)(`ol`,{className:`mt-8 flex w-full flex-col gap-4 text-left`,children:n.map((n,r)=>(0,F.jsxs)(`li`,{className:`flex gap-3`,children:[(0,F.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-paper-2 font-medium text-[0.8125rem] text-ink-2`,children:r+1}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1 pt-0.5`,children:[(0,F.jsx)(`p`,{className:`text-[0.9375rem] leading-snug`,children:n}),r===0?(0,F.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 rounded-lg bg-paper-2 py-1.5 pr-1.5 pl-3`,children:[(0,F.jsx)(`code`,{className:`min-w-0 flex-1 select-all overflow-x-auto whitespace-nowrap font-mono text-[0.8125rem] text-ink-2`,children:ju}),(0,F.jsxs)(g,{variant:`secondary`,size:`sm`,onClick:()=>{navigator.clipboard.writeText(ju),t(!0),setTimeout(()=>t(!1),1500)},children:[e?(0,F.jsx)(lt,{className:`size-3.5`}):(0,F.jsx)(Re,{className:`size-3.5`}),A(e?`share.copied`:`share.copy`)]})]}):null]})]},n))})]})}function Nu(){let e=Xe(),t=x(),{project:n,projects:r,loading:i}=ua(),a=aa().data,s=$i(),c=ea(),l=Ue({queryKey:[`wizards`,n?.id,!!a?.account],queryFn:()=>k.get(`/api/studio/projects/${n.id}/wizards`),enabled:!!n}),u=Cl().data??[],[d,f]=(0,N.useState)(null),[p,m]=(0,N.useState)(``),h=(l.data?.length??0)>Ou,_=h?p.trim().toLowerCase():``,v=(l.data??[]).filter(e=>(!d||!a||Eu(e,a)===d)&&(!_||`${e.title} ${e.description}`.toLowerCase().includes(_))),b=!!_&&v.length<ku,ee=Kt({mutationFn:e=>k.post(`/api/studio/wizards`,{projectId:n.id,starterId:e,lang:S}),onSuccess:async({id:n})=>{await t.invalidateQueries({queryKey:[`projects`]}),await t.invalidateQueries({queryKey:[`wizards`]}),e(`/edit/${n}`)}}),te=r.reduce((e,t)=>e+t.wizardCount,0),C=c&&!n?.readOnly;return!i&&C&&r.length&&te===0?(0,F.jsx)(Ye,{to:`/new`,replace:!0}):!i&&!s&&r.length===0?(0,F.jsx)(Mu,{}):(0,F.jsxs)(`div`,{className:`animate-rise`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[h?(0,F.jsx)(Au,{value:p,onChange:m}):(0,F.jsx)(`h1`,{className:`font-display font-semibold text-[1.75rem] tracking-tight`,children:A(`home.title`,{space:n?.name??``})}),C?(0,F.jsxs)(g,{onClick:()=>e(`/new`),children:[(0,F.jsx)(y,{className:`size-4`}),` `,A(`home.new`)]}):null]}),n?.origin===`local`?(0,F.jsxs)(`p`,{className:`mt-2 text-[0.875rem] text-ink-3`,children:[A(`home.fromLocal`),` `,n.syncedAt?A(`home.syncedAt`,{when:new Intl.DateTimeFormat(S,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(n.syncedAt))}):null]}):null,l.data&&l.data.length===0?(0,F.jsxs)(nt,{children:[(0,F.jsx)(`p`,{children:A(`home.empty`)}),C?(0,F.jsxs)(g,{className:`mt-5`,onClick:()=>e(`/new`),children:[(0,F.jsx)(y,{className:`size-4`}),` `,A(`home.new`)]}):null]}):null,l.data?.length&&a?(0,F.jsx)(Du,{wizards:l.data,me:a,value:d,onChange:f}):null,_&&v.length===0?(0,F.jsx)(`p`,{className:`mt-6 text-[0.875rem] text-ink-3`,children:A(`home.noMatch`)}):null,(0,F.jsx)(`div`,{className:`mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:a?v.map(e=>(0,F.jsx)(Su,{w:e,me:a,runners:u},e.id)):null}),b?(0,F.jsxs)(F.Fragment,{children:[C?(0,F.jsx)(fu,{query:p,busy:ee.isPending,onUse:e=>n&&!ee.isPending&&ee.mutate(e.id)}):(0,F.jsx)(fu,{query:p}),C?(0,F.jsx)(`div`,{className:`mt-8 flex justify-center`,children:(0,F.jsxs)(g,{variant:`secondary`,onClick:()=>e(`/new?wish=${encodeURIComponent(p.trim())}`),children:[(0,F.jsx)(o,{className:`size-4`}),` `,A(`home.newFromSearch`,{q:p.trim()})]})}):null]}):null]})}var Pu=`wizards.install-banner`,Fu=()=>window.matchMedia(`(pointer: coarse)`).matches;function Iu({open:e,onClose:t}){let n=qa(),r=Ka(n),i=A(r===`prompt`?`install.app.offer`:r===`none`?`install.app.browser`:`install.app.how.${r}`);return(0,F.jsxs)(c,{open:e,onClose:t,title:A(`install.app.action`),children:[(0,F.jsx)(`p`,{className:`text-[0.9375rem] text-ink-2 leading-relaxed`,children:i}),(0,F.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,F.jsx)(g,{variant:`ghost`,onClick:t,children:A(`install.app.close`)}),n?(0,F.jsx)(g,{onClick:()=>{Ja(n),t()},children:A(`install.app.action`)}):null]})]})}function Lu(){try{return localStorage.getItem(Pu)===`1`}catch{return!1}}function Ru(){let e=qa(),[t,n]=(0,N.useState)(Lu),r=Ka(e);return t||Va()||Fu()||r===`chromium`?null:(0,F.jsxs)(`div`,{className:`flex items-center gap-3 border-border-soft border-b bg-paper-2 px-4 py-2 text-[0.8125rem] text-ink-2 sm:px-6`,children:[(0,F.jsx)(nn,{className:`size-4 shrink-0 text-ink-3`}),(0,F.jsx)(`p`,{className:`min-w-0 flex-1`,children:A(e?`install.app.offer`:`install.app.browser`)}),e?(0,F.jsx)(g,{size:`sm`,onClick:()=>void Ja(e),children:A(`install.app.action`)}):null,(0,F.jsx)(T,{label:A(`install.app.close`),onClick:()=>{try{localStorage.setItem(Pu,`1`)}catch{}n(!0)},className:`size-8`,children:(0,F.jsx)(we,{className:`size-4`})})]})}function zu(){return[{id:`info`,label:A(`space.info`),icon:zn},{id:`knowledge`,label:A(`space.knowledge`),icon:ln},{id:`data`,label:A(`space.data`),icon:Ne},{id:`results`,label:A(`space.results`),icon:tr}]}function Bu(e,t){let n=[...e];for(let e of t.spaceParts){let r=n.findIndex(t=>t.id===(e.after??`data`))+1;for(;r<n.length&&t.spaceParts.some(e=>e.id===n[r].id);)r++;n.splice(r,0,{id:e.id,label:e.label(),icon:e.icon})}return n}function Vu(e){return e===`info`||e===`knowledge`||e===`data`||e===`results`}var Hu=[{id:`base`,group:`info`,label:`project.base`,icon:hi},{id:`facts`,group:`info`,label:`project.facts`,icon:lr},{id:`logos`,group:`info`,label:`project.logos`,icon:ti},{id:`colors`,group:`info`,label:`project.colors`,icon:Dr},{id:`typography`,group:`info`,label:`project.typography`,icon:Qt},{id:`assets`,group:`info`,label:`project.assets`,icon:$n},{id:`documents`,group:`knowledge`,label:`project.documents`,icon:gt}],Uu=Hu.map(e=>e.id);function Wu(e,t){let n=t.spaceSections.find(t=>t.id===e);return Hu.find(t=>t.id===e)?.group??(n?n.group??`knowledge`:null)}function Gu(e,t,n=[]){let r=Hu.filter(t=>t.group===e&&!n.includes(t.id)).map(e=>({id:e.id,label:A(e.label),icon:e.icon})),i=new Map;for(let n of t.spaceSections){if((n.group??`knowledge`)!==e)continue;let t=i.get(n.plugin)??[];t.push({id:n.id,label:n.label()}),i.set(n.plugin,t)}return[...r.length?[{plugin:null,label:null,sections:r}]:[],...[...i].map(([e,n])=>({plugin:e,label:t.plugins.find(t=>t.id===e)?.name??e,sections:n}))]}var Ku=(0,N.lazy)(()=>Nt(()=>import(`./ChangelogDialog-DZLYVOkl.js`).then(e=>({default:e.ChangelogDialog})),__vite__mapDeps([8,1,2,5,6]))),qu=`wizards.update-banner`;function Ju(){try{return localStorage.getItem(qu)}catch{return null}}function Yu(){let[e,t]=(0,N.useState)(Ju),[n,r]=(0,N.useState)(!1),{data:i,latest:a,apply:o,busy:s,progress:c}=Gc();if(!(i?.newer&&a)||e===a&&i.applying===`idle`)return null;let l=()=>{try{localStorage.setItem(qu,a)}catch{}t(a)},u=c??A(`about.update.available`,{v:a});return(0,F.jsxs)(`div`,{className:`flex items-center gap-3 border-border-soft border-b bg-ember-tint px-4 py-2 text-[0.8125rem] text-ink-2 sm:px-6`,children:[s?(0,F.jsx)(D,{className:`size-4 shrink-0 text-ember-strong`}):(0,F.jsx)(Ie,{className:`size-4 shrink-0 text-ember-strong`}),(0,F.jsx)(`p`,{className:`min-w-0 flex-1`,children:u}),s?null:(0,F.jsx)(`button`,{type:`button`,onClick:()=>r(!0),className:`shrink-0 underline transition hover:text-ink`,children:A(`about.update.notes`)}),n?(0,F.jsx)(N.Suspense,{fallback:null,children:(0,F.jsx)(Ku,{open:!0,version:a,onClose:()=>r(!1)})}):null,i.canApply&&(i.applying===`idle`||i.applying===`failed`)?(0,F.jsx)(g,{size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(),children:A(`about.update.install`)}):null,s?null:(0,F.jsx)(T,{label:A(`install.app.close`),onClick:l,className:`size-8`,children:(0,F.jsx)(we,{className:`size-4`})})]})}var Xu=[],Zu=new Set;function Qu(e){Xu=e;for(let e of Zu)e()}function $u(e){let t=JSON.stringify(e);(0,N.useEffect)(()=>(Qu(JSON.parse(t)),()=>Qu([])),[t])}function ed(){return Xu}function td(){return(0,N.useSyncExternalStore)(e=>(Zu.add(e),()=>Zu.delete(e)),()=>Xu)}function W(){let e=td();return e.length?(0,F.jsx)(`nav`,{"aria-label":A(`nav.breadcrumb`),className:`flex min-w-0 items-center text-[0.9375rem] max-sm:hidden`,children:e.map((t,n)=>(0,F.jsxs)(N.Fragment,{children:[(0,F.jsx)(`span`,{className:O(`mr-2 text-ink-4`,n===0?`-ml-1 sm:-ml-2`:`ml-2`),children:`/`}),t.to&&n<e.length-1?(0,F.jsx)(wt,{to:t.to,className:`truncate text-ink-3 transition hover:text-ink`,children:t.label}):(0,F.jsx)(`span`,{"aria-current":`page`,className:`truncate font-medium text-ink`,children:t.label})]},`${n}:${t.label}`))}):null}var G=e=>e.manageUrl??e.account?.url??null;function K(e){let t=G(e);return t?`${t}/billing`:null}function q({me:e}){let t=na(e),n=K(e);return t===null||!n?null:(0,F.jsx)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,className:O(`flex h-8 shrink-0 items-center whitespace-nowrap rounded-full px-3 font-medium text-[0.8125rem] tabular-nums transition`,t<50?`bg-amber-tint text-ink`:`bg-paper-2 text-ink-2 hover:text-ink`),children:A(`nav.credits`,{n:Math.floor(t).toLocaleString(S)})})}function J(e,t){return e.mode===`local`?e.account?e.account.signedIn?`linked`:`expired`:t?`alone`:null:null}function nd(e,t,n){let r=(0,N.useRef)(n);r.current=n,(0,N.useEffect)(()=>{if(!t)return;let n=t=>{e.current?.contains(t.target)||r.current()},i=e=>{e.key===`Escape`&&r.current()};return document.addEventListener(`mousedown`,n),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,n),document.removeEventListener(`keydown`,i)}},[e,t])}function rd(e,t,n){return e===`below`?n:Fa(t,e===`bar-start`?`start`:`end`)}var id=e=>`oklch(from ${e} calc(0.16 + 0.83 * clamp(0, (0.65 - l) * 1000, 1)) 0.01 h)`;function ad({project:e,size:t=`md`}){let n=e?.brand.colors?.[0]?.value,r=Zi(e?.name??``),i=(0,F.jsx)(`span`,{className:O(`grid shrink-0 place-items-center rounded-lg font-semibold tracking-wide`,t===`md`?`size-10 text-[0.8125rem]`:`size-9 text-[0.75rem]`,n?null:`bg-paper-3 text-ink ring-1 ring-border`),style:n?{background:n,color:id(n)}:void 0,children:r||(0,F.jsx)(Un,{className:`size-4`})});return e?.origin===`local`?(0,F.jsxs)(`span`,{className:`relative shrink-0`,title:A(`readonly.project`),children:[i,(0,F.jsx)(`span`,{className:`-right-1 -bottom-1 absolute grid size-4 place-items-center rounded-full bg-amber ring-2 ring-paper`,children:(0,F.jsx)(rr,{className:`size-2.5 text-paper`})})]}):i}function od({me:e,placement:t,label:n,className:r,children:i}){let a=Xe(),{position:o}=Na(),{project:s,projects:c,select:l}=ua(),u=ea(),[d,f]=(0,N.useState)(!1),[p,m]=(0,N.useState)(!1),[h,g]=(0,N.useState)(!1),[_,v]=(0,N.useState)({top:0,left:0}),b=(0,N.useRef)(null);nd(b,d,()=>f(!1));let ee=e.limits.projects,te=ee!==null&&c.length>=ee,x=`flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-[0.875rem] text-ink-2 transition hover:bg-accent hover:text-ink`;return(0,F.jsx)(`div`,{className:`shrink-0`,ref:b,children:(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(`button`,{type:`button`,onClick:e=>{let t=e.currentTarget.getBoundingClientRect();v({top:t.bottom+6,left:t.left}),f(e=>!e)},"aria-expanded":d,"aria-haspopup":`menu`,"aria-label":n,title:A(`nav.switchSpace`),className:typeof r==`function`?r(d):r,children:i}),d?(0,F.jsxs)(`div`,{role:`menu`,style:t===`below`?{position:`fixed`,..._}:void 0,className:O(`z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,t===`below`?null:O(`absolute`,rd(t,o,`top-10 left-0`))),children:[c.map(e=>{let t=e.id===s?.id;return(0,F.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`flex w-full items-center gap-3 rounded-lg px-2 py-1.5 text-left transition hover:bg-accent`,onClick:()=>{f(!1),t?a(`/`):l(e.id)},children:[(0,F.jsx)(ad,{project:e,size:`sm`}),(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,F.jsx)(`span`,{className:O(`truncate text-[0.875rem]`,t?`font-semibold text-ink`:`font-medium text-ink-2`),children:e.name}),(0,F.jsx)(`span`,{className:`truncate text-[0.75rem] text-ink-4`,children:A(`nav.wizardCount`,{n:e.wizardCount})})]}),t?(0,F.jsx)(lt,{className:`size-4 shrink-0 text-ember-strong`}):null]},e.id)}),(0,F.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),[{to:`/`,icon:Ci,label:A(`nav.wizardsInSpace`),show:!0},{to:`/new`,icon:y,label:A(`nav.addWizard`),show:u}].filter(e=>e.show).map(e=>(0,F.jsxs)(`button`,{type:`button`,role:`menuitem`,className:x,onClick:()=>{f(!1),a(e.to)},children:[(0,F.jsx)(e.icon,{className:`size-4 shrink-0 text-ink-3`}),(0,F.jsx)(`span`,{className:`truncate`,children:e.label})]},e.to)),s&&!s.readOnly?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,F.jsxs)(`button`,{type:`button`,role:`menuitem`,className:x,onClick:()=>{f(!1),g(!0)},children:[(0,F.jsx)(re,{className:`size-4 shrink-0 text-ink-3`}),(0,F.jsx)(`span`,{className:`truncate`,children:A(`nav.renameSpace`)})]})]}):null,u&&!te?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,F.jsxs)(`button`,{type:`button`,role:`menuitem`,className:x,onClick:()=>{f(!1),m(!0)},children:[(0,F.jsx)(y,{className:`size-4 shrink-0 text-ink-3`}),(0,F.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:(0,F.jsx)(`span`,{className:`truncate`,children:A(`nav.addSpace`)})})]})]}):null]}):null,(0,F.jsx)(vu,{open:p,onClose:()=>m(!1)}),s?(0,F.jsx)(sd,{project:s,open:h,onClose:()=>g(!1)}):null]})})}function sd({project:e,open:t,onClose:n}){let r=x(),[i,a]=(0,N.useState)(e.name);(0,N.useEffect)(()=>{t&&a(e.name)},[t,e.name]);let o=Kt({mutationFn:()=>k.patch(`/api/studio/projects/${e.id}`,{name:i.trim()}),onSuccess:async()=>{await r.invalidateQueries({queryKey:[`projects`]}),n()}});return(0,F.jsx)(c,{open:t,onClose:n,title:A(`nav.renameSpace`),children:(0,F.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),i.trim()&&o.mutate()},children:[(0,F.jsx)(he,{autoFocus:!0,maxLength:80,"aria-label":A(`nav.renameSpace`),value:i,onChange:e=>a(e.target.value)}),(0,F.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,F.jsx)(g,{variant:`ghost`,onClick:n,children:A(`common.cancel`)}),(0,F.jsx)(g,{type:`submit`,busy:o.isPending,disabled:!i.trim(),children:A(`settings.save`)})]})]})})}function cd({me:e,project:t}){let n=e.mode===`local`||t.origin===`local`,r=n?rr:Dn,i=A(n?`nav.spaceLocal`:`nav.spaceCloud`);return(0,F.jsx)(`span`,{title:i,className:`grid size-6 shrink-0 place-items-center text-ink-4`,children:(0,F.jsx)(r,{className:`size-3.5`,"aria-label":i})})}function ld({me:e}){let{project:t}=ua();return t?(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[(0,F.jsx)(od,{me:e,placement:`below`,label:t.name,className:e=>O(`-mx-1 max-w-[16rem] translate-y-[0.5px] truncate rounded-md px-2 py-0.5 text-left font-medium text-[0.9375rem] text-ink transition hover:bg-accent`,e&&`bg-accent`),children:t.name}),(0,F.jsx)(cd,{me:e,project:t})]}):null}function ud({me:e,placement:t=`below`}){let[n,r]=(0,N.useState)(!1),i=(0,N.useRef)(null),a=Xe(),{position:o}=Na(),s=xd();nd(i,n,()=>r(!1));let c=qa(),[l,u]=(0,N.useState)(!1),d=Zi(e.user.name),f=J(e,Ba(`account`)),p=`flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left text-[0.875rem] text-ink-2 hover:bg-accent hover:text-ink`;return(0,F.jsxs)(`div`,{className:`relative`,ref:i,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:O(`relative flex shrink-0 items-center justify-center rounded-full bg-ember-tint font-semibold text-[0.8125rem] text-ember-strong ring-1 ring-border-soft`,t===`below`?`size-9`:`size-10`),"aria-label":e.user.name||`Menu`,children:[e.user.image?(0,F.jsx)(`img`,{src:e.user.image,alt:``,className:`size-full rounded-full object-cover`}):d,f===`linked`||f===`expired`?(0,F.jsx)(`span`,{title:f===`linked`?A(`nav.connected`,{host:cl(e.account?.cloudUrl??``)}):A(`nav.expired`),className:`-right-1 -bottom-1 absolute flex size-4 items-center justify-center rounded-full bg-card ring-1 ring-border-soft`,children:f===`linked`?(0,F.jsx)(Dn,{className:`size-2.5 text-moss`}):(0,F.jsx)(Tn,{className:`size-2.5 text-amber`})}):null]}),n?(0,F.jsxs)(`div`,{className:O(`absolute z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,rd(t,o,`top-11 right-0`)),children:[(0,F.jsxs)(`div`,{className:`px-3 pt-2 pb-2.5`,children:[(0,F.jsxs)(`div`,{className:`truncate font-medium text-[0.875rem]`,children:[e.user.name,f===`alone`?(0,F.jsxs)(`span`,{className:`font-normal text-ink-4`,children:[` (`,A(`nav.local`),`)`]}):null]}),(0,F.jsx)(`div`,{className:`truncate text-[0.75rem] text-ink-3`,children:e.user.email})]}),f?(0,F.jsxs)(`button`,{type:`button`,className:`mx-1.5 mb-1.5 flex w-[calc(100%-0.75rem)] items-start gap-2.5 rounded-lg bg-paper-2 px-2.5 py-2 text-left text-[0.8125rem] text-ink-2 hover:text-ink`,onClick:()=>{r(!1),a(`/settings/account`)},children:[f===`linked`?(0,F.jsx)(Dn,{className:`mt-0.5 size-4 shrink-0 text-moss`}):f===`expired`?(0,F.jsx)(Tn,{className:`mt-0.5 size-4 shrink-0 text-amber`}):(0,F.jsx)(rr,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-snug`,children:[(0,F.jsx)(`span`,{className:`break-words`,children:f===`linked`?A(`nav.connected`,{host:cl(e.account?.cloudUrl??``)}):A(f===`expired`?`nav.expired`:`nav.onlyHere`)}),(0,F.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:f===`linked`?e.account?.credits!==null&&e.account?.credits!==void 0?A(`nav.credits`,{n:Math.floor(e.account.credits).toLocaleString(S)}):null:A(f===`expired`?`account.signInAgain`:`account.signIn`)})]})]}):null,(0,F.jsx)(`div`,{className:`px-3 pt-1.5 pb-1 font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.07em]`,children:A(`nav.settings`)}),To(e,s).filter(e=>e.menu).map(e=>(0,F.jsxs)(`button`,{type:`button`,className:p,onClick:()=>{r(!1),a(`/settings/${e.id}`)},children:[(0,F.jsx)(e.icon,{className:`size-4`}),` `,e.label]},e.id)),(0,F.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),Va()?null:(0,F.jsxs)(`button`,{type:`button`,className:p,onClick:()=>{r(!1),c?Ja(c):u(!0)},children:[(0,F.jsx)(nn,{className:`size-4`}),` `,A(`install.app.action`)]}),e.manageUrl?(0,F.jsxs)(`a`,{className:p,href:`${e.manageUrl}/account`,target:`_blank`,rel:`noreferrer`,children:[(0,F.jsx)(Nn,{className:`size-4`}),` `,A(`nav.account`)]}):null,(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2 text-[0.875rem] text-ink-2`,children:[A(`nav.language`),(0,F.jsx)(el,{tone:`surface`})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2 text-[0.875rem] text-ink-2`,children:[A(`nav.theme`),(0,F.jsx)(sl,{})]}),e.mode===`managed`?(0,F.jsxs)(`button`,{type:`button`,className:p,onClick:()=>void pa(),children:[(0,F.jsx)(dr,{className:`size-4`}),` `,A(`nav.logout`)]}):null]}):null,(0,F.jsx)(Iu,{open:l,onClose:()=>u(!1)})]})}function dd(){let e=ut();return(0,F.jsx)(`button`,{type:`button`,"aria-pressed":e,"aria-label":A(`nav.spaceMenu`),title:A(`nav.spaceMenu`),onClick:()=>vt(!e),className:O(`grid size-8 shrink-0 place-items-center rounded-lg transition hover:bg-accent hover:text-ink max-lg:hidden`,e?`bg-accent text-ink`:`text-ink-3`),children:(0,F.jsx)(jr,{className:`size-[1.125rem]`})})}function fd(){let e=ut(),t=Qe(),{project:n}=ua(),r=xd(),i=ea();if(!n)return null;let a=({isActive:e})=>O(`group flex items-center gap-2 rounded-lg px-2 py-1 text-[0.875rem] transition`,e?`bg-paper-2 font-medium text-ink`:`text-ink-2 hover:bg-accent hover:text-ink`),o=[{to:`/`,label:A(`nav.wizards`),icon:Ci,end:!0},...i?[{to:`/new`,label:A(`home.new`),icon:y,end:!1}]:[]],s=Bu(zu(),r).map(e=>({to:`/space/${e.id}`,label:e.label,icon:e.icon,end:!1})),c=e=>(0,F.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.map(e=>(0,F.jsx)(`li`,{children:(0,F.jsxs)(Je,{to:e.to,end:e.end,className:a,children:[(0,F.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center`,children:(0,F.jsx)(e.icon,{className:`size-4 transition-transform duration-200 ease-out group-hover:scale-110`})}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label})]})},e.to))});return(0,F.jsx)(`aside`,{"aria-hidden":!e,inert:!e,className:O(`shrink-0 overflow-hidden transition-[width] duration-300 ease-out motion-reduce:transition-none max-md:hidden`,e?`w-64 max-lg:w-0`:`w-0`),children:(0,F.jsxs)(`div`,{className:`flex h-full w-64 flex-col overflow-y-auto px-4 pb-4`,children:[(0,F.jsx)(`div`,{ref:ct,className:t?`pt-4 animate-rise sm:pt-6`:`hidden`}),t?null:(0,F.jsxs)(`div`,{className:`pt-4 animate-rise sm:pt-6`,children:[c(o),(0,F.jsx)(`p`,{className:`mt-5 mb-1 px-2 font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.12em]`,children:A(`nav.project`)}),c(s)]})]})})}function pd({me:e,children:t}){return(0,F.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-2 px-3 coarse:h-14 sm:gap-3 sm:px-4 md:px-5`,children:[(0,F.jsx)(dd,{}),(0,F.jsx)(ld,{me:e}),(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center`,children:[(0,F.jsx)(W,{}),t]}),(0,F.jsx)(q,{me:e})]})}var md=`studio-scroll`;function hd(){return document.getElementById(`studio-scroll`)??document.documentElement}var gd={left:`md:py-2 md:pr-2`,right:`md:py-2 md:pl-2`,top:`md:px-2 md:pb-2`,bottom:`md:px-2 md:pt-2`},_d={left:`flex-row`,right:`flex-row-reverse`,top:`flex-col`,bottom:`flex-col-reverse`};function vd({me:e,wide:t,full:n,children:r}){let{position:i}=Na(),a=(0,N.useRef)(null),o=Ba(`goose`);return(0,F.jsxs)(`div`,{className:O(`flex h-dvh overflow-hidden bg-sidebar`,_d[i]),children:[(0,F.jsx)(to,{me:e}),(0,F.jsx)(`div`,{className:O(`flex min-h-0 min-w-0 flex-1 flex-col`,gd[i]),children:(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background md:rounded-xl md:shadow-elevated md:dark:ring-1 md:dark:ring-border-soft`,children:[(0,F.jsx)(Yu,{}),(0,F.jsx)(Ru,{}),n?(0,F.jsx)(`main`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,children:r}):(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,F.jsx)(pd,{me:e}),(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,F.jsx)(fd,{}),(0,F.jsxs)(`div`,{ref:a,className:`relative flex min-w-0 flex-1 flex-col`,children:[(0,F.jsx)(`main`,{id:md,className:`relative min-h-0 flex-1 overflow-y-auto`,style:{paddingBottom:`var(--assistant-dock, 0px)`},children:(0,F.jsx)(`div`,{className:O(`mx-auto w-full px-3 pt-4 pb-12 sm:px-6 sm:pt-6`,t?`max-w-[88rem]`:`max-w-5xl`),children:r})}),o&&(0,F.jsx)(Lc,{column:a})]}),o&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Vc,{column:a}),(0,F.jsx)(Hc,{})]})]})]})]})})]})}globalThis.__WIZARDS_STUDIO__={react:N,jsx:F,reactDom:{createPortal:Sa.createPortal,flushSync:Sa.flushSync},router:{Link:wt,Navigate:Ye,NavLink:Je,useLocation:Ze,useNavigate:Xe,useParams:Be,useSearchParams:Et},query:{useMutation:Kt,useQuery:Ue,useQueryClient:x},ui:St,sdk:ba};var yd=0,Y={status:`idle`,plugins:[],canReload:!1,problems:[],failed:{},pages:[],nav:[],sections:[],spaceSections:[],spaceParts:[],spaceMenus:{},shareSections:[],shareSetups:[],cards:[]},X=new Set;function bd(e){Y={...Y,...e};for(let e of X)e()}function xd(){return(0,N.useSyncExternalStore)(e=>(X.add(e),()=>X.delete(e)),()=>Y)}var Sd=new Set([``,`new`,`edit`,`settings`,`space`,`setup`,`sign-in`]),Cd=new Set([`account`,`project`,`connectors`,`models`,`build`,`plugins`]),wd=new Set([`info`,`knowledge`,`data`,`results`]),Td=new Map,Ed=null,Dd=e=>`${e.script}|${e.styles}`,Od=e=>`__wizardsPlugin_${e.replaceAll(`-`,`_`)}`;function kd(){let{project:e}=ua(),t=e?.id,n=e?.name??``,r=e?.readOnly??!1,i=JSON.stringify({name:e?.brand.name??``,colors:(e?.brand.colors??[]).map(({name:e,value:t})=>({name:e,value:t})),fonts:(e?.brand.fonts??[]).map(({family:e,role:t,weights:n})=>({family:e,role:t,weights:n}))});return(0,N.useMemo)(()=>t?{id:t,name:n,readOnly:r,brand:JSON.parse(i)}:null,[t,n,r,i])}var Ad=(0,N.createContext)(null);function jd({part:e,children:t}){return(0,F.jsx)(Ad.Provider,{value:e,children:t})}function Md(e){let t=(0,N.useContext)(Ad),n=JSON.stringify(e.map(e=>[e.id,e.label]));(0,N.useEffect)(()=>{if(t)return bd({spaceMenus:{...Y.spaceMenus,[t]:e}}),()=>{let{[t]:e,...n}=Y.spaceMenus;bd({spaceMenus:n})}},[t,n])}function Nd({plugin:e,...t}){return ts({...t,plugin:e}),null}function Pd(e,t){let{id:n}=e,r=e=>`/api/studio/plugins/${n}${e.startsWith(`/`)?e:`/${e}`}`,i=e=>e.filter(e=>e.plugin!==n);return{plugin:{id:n,name:e.name,version:e.version},registerPage(e){let r=e.path.split(`/`)[1]??``;if(!e.path.startsWith(`/`)||Sd.has(r))throw Error(`"${e.path}" is an address of the studio itself.`);if([...i(Y.pages),...t.pages].some(t=>t.path===e.path))throw Error(`"${e.path}" is registered already.`);t.pages.push({...e,plugin:n,serial:++yd})},registerNav(e){t.nav.push({...e,plugin:n,serial:++yd})},registerSettingsSection(e){let r=[...i(Y.sections),...t.sections].some(t=>t.id===e.id);if(Cd.has(e.id)||r)throw Error(`The settings have a section "${e.id}" already.`);t.sections.push({...e,plugin:n,serial:++yd})},registerSpaceSection(e){let r=[...i(Y.spaceSections),...t.spaceSections].some(t=>t.id===e.id);if(Uu.includes(e.id)||r)throw Error(`The space page has a section "${e.id}" already.`);t.spaceSections.push({...e,plugin:n,serial:++yd})},registerSpacePart(e){let r=[...i(Y.spaceParts),...t.spaceParts].some(t=>t.id===e.id);if(!/^[a-z][a-z0-9-]{0,39}$/.test(e.id)||wd.has(e.id)||r)throw Error(`The space page has a part "${e.id}" already.`);t.spaceParts.push({...e,plugin:n,serial:++yd})},registerShareSection(e){if([...i(Y.shareSections),...t.shareSections].some(t=>t.runner===e.runner))throw Error(`The runner "${e.runner}" has a share section already.`);t.shareSections.push({...e,plugin:n,serial:++yd})},registerShareSetup(e){if([...i(Y.shareSetups),...t.shareSetups].some(t=>t.runner===e.runner))throw Error(`The runner "${e.runner}" has a share setup already.`);t.shareSetups.push({...e,plugin:n,serial:++yd})},registerAssistantCard(e){if(t.cards.some(t=>t.tool===e.tool))throw Error(`The tool "${e.tool}" has a card already.`);t.cards.push({...e,plugin:n,serial:++yd})},useSpace:kd,useSpaceMenu:Md,useCrumbs:$u,Assistant:e=>(0,F.jsx)(Nd,{plugin:n,...e}),useAssistantPage:e=>ts({...e,plugin:n}),useAssistantTool:(e,t,r)=>Ms(`${n.replaceAll(`-`,`_`)}_${e}`,t,r),i18n:{register:e=>(t,n)=>{let r=e[S]?.[t]??e.de[t]??t;for(let[e,t]of Object.entries(n??{}))r=r.replace(`{${e}}`,String(t));return r},lang:()=>S},api:{get:e=>k.get(r(e)),post:(e,t)=>k.post(r(e),t),put:(e,t)=>k.put(r(e),t),patch:(e,t)=>k.patch(r(e),t),del:e=>k.del(r(e))},me:()=>({user:{id:Ed.user.id,name:Ed.user.name,email:Ed.user.email},tenant:Ed.tenant,mode:Ed.mode}),onUnload(e){t.disposers.push(e)}}}function Fd(e){return new Promise((t,n)=>{let r=document.createElement(`script`);r.src=e,r.onload=()=>{r.remove(),t()},r.onerror=()=>{r.remove(),n(Error(`The plugin's script did not load.`))},document.head.append(r)})}function Id(e,t){return new Promise(n=>{let r=document.createElement(`link`);r.rel=`stylesheet`,r.href=t,r.dataset.plugin=e,r.onload=()=>n(r),r.onerror=()=>n(r),document.head.append(r)})}function Ld(e,t,n){for(let n of t)try{n()}catch(t){console.error(`[plugin ${e}]`,t)}n?.remove()}function Rd(e){let t=Td.get(e);Td.delete(e),Ld(e,t?.disposers??[],t?.link??null);let{[e]:n,...r}=Y.failed;bd({failed:r,pages:Y.pages.filter(t=>t.plugin!==e),nav:Y.nav.filter(t=>t.plugin!==e),sections:Y.sections.filter(t=>t.plugin!==e),spaceSections:Y.spaceSections.filter(t=>t.plugin!==e),spaceParts:Y.spaceParts.filter(t=>t.plugin!==e),shareSections:Y.shareSections.filter(t=>t.plugin!==e),shareSetups:Y.shareSetups.filter(t=>t.plugin!==e),cards:Y.cards.filter(t=>t.plugin!==e)})}async function zd(e){let{id:t}=e,n={pages:[],nav:[],sections:[],spaceSections:[],spaceParts:[],shareSections:[],shareSetups:[],cards:[],disposers:[]},r=null;try{e.styles&&(r=await Id(t,a(e.styles))),await Fd(a(e.script));let i=globalThis,o=Od(t),s=i[o];i[o]=void 0;let c=typeof s==`function`?s:s?.default;if(typeof c!=`function`)throw Error(`The plugin's script has no default export.`);c(Pd(e,n))}catch(i){console.error(`[plugin ${t}]`,i),Ld(t,n.disposers,r),Rd(t),Td.set(t,{key:Dd(e),disposers:[],link:null}),bd({failed:{...Y.failed,[t]:i.message}});return}let i=Td.get(t);Td.set(t,{key:Dd(e),disposers:n.disposers,link:r});let{[t]:o,...s}=Y.failed;bd({failed:s,pages:[...Y.pages.filter(e=>e.plugin!==t),...n.pages],nav:[...Y.nav.filter(e=>e.plugin!==t),...n.nav],sections:[...Y.sections.filter(e=>e.plugin!==t),...n.sections],spaceSections:[...Y.spaceSections.filter(e=>e.plugin!==t),...n.spaceSections],spaceParts:[...Y.spaceParts.filter(e=>e.plugin!==t),...n.spaceParts],shareSections:[...Y.shareSections.filter(e=>e.plugin!==t),...n.shareSections],shareSetups:[...Y.shareSetups.filter(e=>e.plugin!==t),...n.shareSetups],cards:[...Y.cards.filter(e=>e.plugin!==t),...n.cards]}),Ld(t,i?.disposers??[],i?.link??null)}var Bd=Promise.resolve();function Vd(){return Bd=Bd.catch(()=>void 0).then(async()=>{let e=await k.get(`/api/studio/plugins`);for(let t of[...Td.keys()])e.plugins.some(e=>e.id===t&&e.script)||Rd(t);bd(e);for(let t of e.plugins)t.script&&Td.get(t.id)?.key!==Dd(t)&&await zd(t)}).catch(e=>console.error(`[plugins]`,e)).finally(()=>bd({status:`ready`})),Bd}var Hd=null;function Ud(e){Ed=e,Y.status===`idle`&&(bd({status:`loading`}),Vd().then(()=>{Y.canReload&&!Hd&&(Hd=new EventSource(a(`/api/studio/plugins/-/events`),{withCredentials:!0}),Hd.addEventListener(`change`,()=>void Vd()))}))}async function Wd(e){await k.post(e?`/api/studio/plugins/-/reload/${e}`:`/api/studio/plugins/-/reload`),await Vd()}var Gd=class extends N.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error(`[plugin]`,e)}render(){return this.state.failed?(0,F.jsx)(nt,{children:A(`plugins.crashed`)}):this.props.children}};function Kd({of:e,children:t}){return(0,F.jsx)(`div`,{"data-plugin":e.plugin,className:`contents`,children:(0,F.jsx)(Gd,{children:t},e.serial)})}function qd({end:e,className:t}){return(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-4 ${t??``}`,children:[(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-2.5`,children:[(0,F.jsx)(Ei,{size:28}),(0,F.jsxs)(`span`,{className:`font-display font-semibold text-[1.0625rem] tracking-tight ${e?`max-sm:sr-only`:``}`,children:[`engenty`,(0,F.jsx)(`span`,{className:`mr-[0.09em] ml-[0.06em] text-ember-strong`,children:`.`}),(0,F.jsx)(`span`,{className:`font-normal text-ink-2`,children:`wizards`})]})]}),(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:e?`flex max-sm:hidden`:`flex`,children:(0,F.jsx)(sl,{tone:`surface`})}),(0,F.jsx)(el,{tone:`surface`}),e]})]})}var Jd={de:{imprint:`/de/impressum`,privacy:`/de/datenschutz`,terms:`/de/nutzungsbedingungen`},en:{imprint:`/imprint`,privacy:`/privacy`,terms:`/terms`}};function Yd({failed:e}){let t=Pe(),[n,r]=(0,N.useState)(()=>va()??``),[i,a]=(0,N.useState)(!1),o=pt(n,r,{endpoint:null}),s=()=>{let e=n.trim();e&&!i&&(o.listening&&o.stop(),a(!0),_a(e),ma(`/new`,e))};return(0,F.jsxs)(`div`,{className:`min-h-dvh px-6 pb-16 sm:px-10`,children:[(0,F.jsx)(qd,{className:`pt-6 sm:pt-8`,end:(0,F.jsx)(g,{variant:`secondary`,size:`sm`,onClick:()=>ma(`/`),children:A(`guest.signIn`)})}),(0,F.jsxs)(`div`,{className:`mx-auto max-w-2xl animate-rise pt-8 md:pt-12`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,F.jsx)(`div`,{className:`size-[84px] md:size-auto`,children:(0,F.jsx)(`div`,{className:`origin-top-left scale-[0.56] md:scale-100`,children:(0,F.jsx)(Ji,{kind:`sprout`,size:150,fluffy:!0})})}),(0,F.jsx)(`h1`,{className:`mt-1 font-display font-semibold text-[1.5rem] leading-tight tracking-tight md:mt-2 md:text-[2.375rem]`,children:A(`new.title`)})]}),(0,F.jsxs)(`div`,{className:`relative mt-6 rounded-2xl bg-card p-2 shadow-elevated ring-1 ring-border-soft focus-within:ring-focus md:mt-8`,children:[(0,F.jsx)(ne,{autoFocus:!0,minRows:4,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&s()},placeholder:o.listening?A(`editor.listening`):A(`new.placeholder`),className:`border-0 bg-transparent text-[1rem] shadow-none focus:ring-0`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2 px-1 pb-1`,children:[o.supported?(0,F.jsx)(Ge,{speech:o,labelled:!0}):null,(0,F.jsx)(`span`,{className:`flex-1`}),(0,F.jsxs)(g,{size:`md`,onClick:s,busy:i,disabled:!n.trim(),children:[A(`new.build`),` `,(0,F.jsx)(He,{className:`size-4`})]})]})]}),o.error?(0,F.jsx)(`p`,{className:`mt-2 px-3 text-[0.75rem] text-rose`,children:o.error===`denied`?A(`editor.micDenied`):o.error}):null,e?(0,F.jsx)(`p`,{className:`mt-3 text-center text-[0.875rem] text-rose`,children:A(`auth.failed`)}):null,(0,F.jsx)(`p`,{className:`mt-3 text-center text-[0.875rem] text-ink-3`,children:A(`guest.hint`)})]}),(0,F.jsxs)(`section`,{className:`mx-auto max-w-5xl`,children:[(0,F.jsx)(`h2`,{className:`mt-16 mb-5 text-center font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:A(`new.orStarter`)}),(0,F.jsx)(mu,{onGuestOpen:e=>ma(`/new?starter=${encodeURIComponent(e.id)}`)})]}),(0,F.jsxs)(`footer`,{className:`mt-16 flex flex-wrap justify-center gap-x-5 gap-y-1 text-[0.75rem] text-ink-3`,children:[(0,F.jsx)(`span`,{children:`engenty`}),[`imprint`,`privacy`,`terms`].map(e=>(0,F.jsx)(`a`,{href:Jd[t][e],className:`transition hover:text-ink-2`,children:A(`legal.${e}`)},e))]})]})}var Xd=/(?:^|;\s*)engenty_signed_in=1(?:;|$)/;function Zd(){return!!window.engentyDesktop}function Qd({text:e}){return e.split(/(?<=[.!?])\s+/).map(e=>(0,F.jsx)(`span`,{className:`block`,children:e},e))}function $d({title:e,children:t,className:n=`mt-8`}){return(0,F.jsxs)(`div`,{className:`${n} w-full rounded-xl bg-card px-5 py-4 text-left text-[0.875rem] text-ink-2 leading-relaxed shadow-soft ring-1 ring-border-soft`,children:[(0,F.jsx)(`div`,{className:`mb-1.5 font-medium text-ink`,children:e}),t]})}function ef(){let e=Ue({queryKey:[`config`],queryFn:()=>k.get(`/api/config`),refetchInterval:e=>e.state.status===`error`&&!(e.state.error instanceof We&&e.state.error.body?.code===`host`)&&2e3,retry:!1}),t=x(),[n,r]=(0,N.useState)(!1),[i,a]=(0,N.useState)(!1),o=new URLSearchParams(window.location.search).get(`signin`)===`failed`,s=e.data?.mode===`local`&&e.data.devLogin,[c,l]=(0,N.useState)(!1),u=e.data?.mode===`managed`&&!o&&!Zd()&&Xd.test(document.cookie);if((0,N.useEffect)(()=>{u&&ma()},[u]),(0,N.useEffect)(()=>{if(!s||c)return;let e=!0;return k.post(`/api/dev/login`).then(()=>t.invalidateQueries()).catch(()=>{e&&l(!0)}),()=>{e=!1}},[s,c,t]),e.isLoading||u||s&&!c)return(0,F.jsx)(`div`,{className:`flex min-h-dvh items-center justify-center`,children:(0,F.jsx)(Ji,{kind:`round`,size:56})});if(e.data?.mode===`managed`&&!e.data.devLogin&&!Zd())return(0,F.jsx)(Yd,{failed:o});let d=e.data?.mode===`local`&&!e.data.devLogin,f=e.error instanceof We&&e.error.body?.code===`host`?e.error:null,p=f?String(f.body.appUrl??``):null;return(0,F.jsxs)(`div`,{className:`relative flex min-h-dvh flex-col items-center justify-center px-6 py-16`,children:[(0,F.jsx)(qd,{className:`absolute inset-x-6 top-6 sm:inset-x-10 sm:top-8`}),(0,F.jsxs)(`div`,{className:`flex w-full max-w-md animate-rise flex-col items-center text-center`,children:[(0,F.jsx)(Ji,{kind:`round`,size:d||e.isError?140:200,fluffy:!0}),(0,F.jsx)(Di,{className:`mt-2 font-display font-semibold text-[0.9375rem] text-ink-3 tracking-tight`}),(0,F.jsx)(`h1`,{className:`mt-3 text-balance font-display font-semibold text-[2.125rem] leading-[1.1] tracking-tight`,children:(0,F.jsx)(Qd,{text:A(`brand.tagline`)})}),(0,F.jsx)(`p`,{className:`mt-4 text-balance text-[1rem] text-ink-2 leading-relaxed`,children:(0,F.jsx)(Qd,{text:A(`brand.sub`)})}),p?(0,F.jsxs)($d,{title:A(`auth.wrongHost`),children:[(0,F.jsx)(`p`,{children:A(`auth.wrongHostWhy`)}),(0,F.jsx)(`a`,{href:`${p}${window.location.pathname}`,className:`mt-1.5 block break-all font-medium text-ember-strong underline-offset-2 hover:underline`,children:p})]}):e.isError?(0,F.jsx)($d,{title:A(`auth.unreachable`),children:A(`auth.unreachableWhy`,{address:window.location.host})}):null,(0,F.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-3`,children:[o?(0,F.jsx)(`p`,{className:`text-[0.875rem] text-rose`,children:A(`auth.failed`)}):null,e.data?.mode===`managed`?(0,F.jsx)(g,{size:`lg`,busy:n,className:`w-full`,onClick:async()=>{r(!0);let e=window.engentyDesktop;if(!e){ma();return}let{url:t}=await k.post(`/api/auth/desktop/start`);e.open(t),a(!0),r(!1)},children:A(i?`local.accountWaiting`:`auth.signIn`)}):null,e.data?.devLogin?(0,F.jsx)(g,{size:`lg`,busy:n,className:`w-full`,onClick:async()=>{r(!0),await k.post(`/api/dev/login`),await t.invalidateQueries(),r(!1)},children:A(`auth.dev`)}):null,d?(0,F.jsxs)($d,{title:A(`auth.localTitle`),className:`-mt-2`,children:[(0,F.jsx)(`p`,{children:A(`auth.localWhy`)}),(0,F.jsx)(`p`,{className:`mt-3`,children:A(`auth.localLink`)}),(0,F.jsx)(`code`,{className:`mt-1.5 block select-all rounded-lg bg-paper-2 px-3 py-2 font-mono text-[0.8125rem] text-ink`,children:`wizards open`}),(0,F.jsx)(`p`,{className:`mt-3 text-ink-3`,children:A(`auth.localStartLink`)}),(0,F.jsx)(`code`,{className:`mt-1.5 block select-all rounded-lg bg-paper-2 px-3 py-2 font-mono text-[0.8125rem] text-ink`,children:`wizards open --print`})]}):null]}),e.data?.mode===`managed`?(0,F.jsx)(`p`,{className:`mt-6 text-[0.8125rem] text-ink-3`,children:A(`auth.legal`)}):null]}),(0,F.jsxs)(`footer`,{className:`absolute inset-x-0 bottom-6 text-center text-[0.75rem] text-ink-3 sm:bottom-8`,children:[`© engenty · `,A(`about.version`,{v:qc})]})]})}var tf=(0,N.lazy)(()=>Nt(()=>import(`./PublicRunner-Hms0Vi88.js`).then(e=>({default:e.PublicRunner})),__vite__mapDeps([11,1,2,5,6,12,13,14]))),nf=(0,N.lazy)(()=>Nt(()=>import(`./SharePage-Bb-BIvAX.js`).then(e=>({default:e.SharePage})),__vite__mapDeps([15,1,2,5,6,11,12,13,14]))),rf=(0,N.lazy)(()=>Nt(()=>import(`./EditorPage-COJunH8K.js`).then(e=>({default:e.EditorPage})),__vite__mapDeps([16,1,2,5,6,17,18,19,12,13,14,20,10]))),af=(0,N.lazy)(()=>Nt(()=>Promise.resolve().then(()=>gu).then(e=>({default:e.HomePage})),void 0)),of=(0,N.lazy)(()=>Nt(()=>import(`./OnboardingPage-Di8AuZj_.js`).then(e=>({default:e.OnboardingPage})),__vite__mapDeps([21,1,2,5,6,18]))),sf=(0,N.lazy)(()=>Nt(()=>import(`./NewWizardPage-BAKaUY1g.js`).then(e=>({default:e.NewWizardPage})),__vite__mapDeps([22,1,2,5,6,20,13,18]))),cf=(0,N.lazy)(()=>Nt(()=>import(`./SettingsPage-CQX6fKsa.js`).then(e=>({default:e.SettingsPage})),__vite__mapDeps([23,1,2,5,6,19,24,7,25,26]))),lf=(0,N.lazy)(()=>Nt(()=>import(`./ProjectPage-DaerYm8A.js`).then(e=>({default:e.ProjectPage})),__vite__mapDeps([27,1,2,5,6,17,18,13,24,7,14]))),uf=(0,N.lazy)(()=>Nt(()=>import(`./SetupPage-BZkbpN_V.js`).then(e=>({default:e.SetupPage})),__vite__mapDeps([28,1,2,5,6,25,26]))),df=null;function ff(){return(0,F.jsx)(`div`,{className:`flex min-h-dvh items-center justify-center`,children:(0,F.jsx)(Ji,{kind:`round`,size:56})})}function pf({children:e,bare:t,wide:n,full:r}){let i=aa(),a=Ze();return ia(i.data),(0,N.useEffect)(()=>{i.data&&Ud(i.data)},[i.data]),i.isLoading?(0,F.jsx)(ff,{}):i.data?i.data.mode===`local`&&!i.data.setupDone&&a.pathname!==`/setup`?(0,F.jsx)(Ye,{to:`/setup`,replace:!0}):i.data.onboarding&&a.pathname!==`/start`?(0,F.jsx)(Ye,{to:`/start`,replace:!0}):t?e:(0,F.jsx)(vd,{me:i.data,wide:n,full:r,children:e}):(0,F.jsx)(ef,{})}function Z(){return Pe(),(0,F.jsx)(N.Suspense,{fallback:(0,F.jsx)(ff,{}),children:(0,F.jsxs)(st,{children:[df,(0,F.jsx)(mt,{path:`/w/:token`,element:(0,F.jsx)(tf,{})}),(0,F.jsx)(mt,{path:`/w/:token/steps`,element:(0,F.jsx)(tf,{steps:!0})}),(0,F.jsx)(mt,{path:`/w/:token/steps/:runId`,element:(0,F.jsx)(tf,{steps:!0})}),(0,F.jsx)(mt,{path:`/w/:token/chat`,element:(0,F.jsx)(tf,{chat:!0})}),(0,F.jsx)(mt,{path:`/w/:token/chat/:runId`,element:(0,F.jsx)(tf,{chat:!0})}),(0,F.jsx)(mt,{path:`/w/:token/talk`,element:(0,F.jsx)(tf,{chat:!0,talk:!0})}),(0,F.jsx)(mt,{path:`/w/:token/talk/:runId`,element:(0,F.jsx)(tf,{chat:!0,talk:!0})}),(0,F.jsx)(mt,{path:`/w/:token/video`,element:(0,F.jsx)(tf,{chat:!0,video:!0})}),(0,F.jsx)(mt,{path:`/w/:token/video/:runId`,element:(0,F.jsx)(tf,{chat:!0,video:!0})}),(0,F.jsx)(mt,{path:`/w/:token/:runId`,element:(0,F.jsx)(tf,{})}),(0,F.jsx)(mt,{path:`/s/:token`,element:(0,F.jsx)(nf,{})}),(0,F.jsx)(mt,{path:`*`,element:(0,F.jsx)(mf,{})})]})})}function mf(){return(0,N.useEffect)(()=>{window.location.replace(`${Fe}/`)},[]),(0,F.jsx)(ff,{})}function hf(){return xd().status===`ready`?(0,F.jsx)(Ye,{to:`/`,replace:!0}):(0,F.jsx)(ff,{})}function gf(){Pe(),(0,N.useEffect)(()=>(document.documentElement.dataset.studio=``,()=>{delete document.documentElement.dataset.studio}),[]);let e=xd();return(0,F.jsx)(Hs,{children:(0,F.jsx)(N.Suspense,{fallback:(0,F.jsx)(ff,{}),children:(0,F.jsxs)(st,{children:[(0,F.jsx)(mt,{path:`/`,element:(0,F.jsx)(pf,{children:(0,F.jsx)(af,{})})}),(0,F.jsx)(mt,{path:`/sign-in`,element:(0,F.jsx)(pf,{children:(0,F.jsx)(Ye,{to:`/`,replace:!0})})}),(0,F.jsx)(mt,{path:`/new`,element:(0,F.jsx)(pf,{children:(0,F.jsx)(sf,{})})}),(0,F.jsx)(mt,{path:`/edit/:id`,element:(0,F.jsx)(pf,{full:!0,children:(0,F.jsx)(rf,{})})}),(0,F.jsx)(mt,{path:`/space/:group?`,element:(0,F.jsx)(pf,{wide:!0,children:(0,F.jsx)(lf,{})})}),(0,F.jsx)(mt,{path:`/settings/:section?`,element:(0,F.jsx)(pf,{wide:!0,children:(0,F.jsx)(cf,{})})}),(0,F.jsx)(mt,{path:`/setup`,element:(0,F.jsx)(pf,{bare:!0,children:(0,F.jsx)(uf,{})})}),(0,F.jsx)(mt,{path:`/start`,element:(0,F.jsx)(pf,{bare:!0,children:(0,F.jsx)(of,{})})}),e.pages.map(e=>(0,F.jsx)(mt,{path:e.path,element:(0,F.jsx)(pf,{wide:e.wide,children:(0,F.jsx)(Kd,{of:e,children:(0,F.jsx)(e.component,{})})})},e.serial)),(0,F.jsx)(mt,{path:`*`,element:(0,F.jsx)(pf,{bare:!0,children:(0,F.jsx)(hf,{})})})]})})})}function _f(){if(typeof window>`u`)return null;let e=window.engentyApp;return e&&typeof e.call==`function`&&Array.isArray(e.can)?e:null}var vf=_f(),yf=vf!==null||typeof window<`u`&&new URLSearchParams(window.location.search).get(`app`)===`1`;yf&&typeof document<`u`&&document.documentElement.classList.add(`in-app`);var bf=e=>vf?.can.includes(e)===!0;function xf(e,t){return vf&&bf(e)?vf.call(e,t):Promise.reject(Error(`the app cannot ${e}`))}function Sf(e,t){bf(e)&&xf(e,t).catch(()=>void 0)}function Cf(e,t,n){return bf(`download`)?(e.preventDefault(),xf(`download`,{url:new URL(t,window.location.href).href,filename:n}).catch(()=>void 0),!0):!1}var wf=e=>`engenty-wizards://w?url=${encodeURIComponent(e)}`;function Tf(e,t){let n=encodeURIComponent(e),r=encodeURIComponent(t);return[{id:`mail`,label:A(`shareRun.email`),href:`mailto:?subject=${r}&body=${r}%0A%0A${n}`},{id:`x`,label:`X`,href:`https://x.com/intent/post?text=${r}&url=${n}`},{id:`linkedin`,label:`LinkedIn`,href:`https://www.linkedin.com/sharing/share-offsite/?url=${n}`},{id:`whatsapp`,label:`WhatsApp`,href:`https://wa.me/?text=${r}%20${n}`},{id:`facebook`,label:`Facebook`,href:`https://www.facebook.com/sharer/sharer.php?u=${n}`}]}var Ef={x:`𝕏`,linkedin:`in`,whatsapp:`WA`,facebook:`f`};function Df({runId:e,title:t,initial:n}){let[r,i]=(0,N.useState)(!1),[a,o]=(0,N.useState)(n),[s,l]=(0,N.useState)(!1),[u,d]=(0,N.useState)(!1),[f,p]=(0,N.useState)(null),m=async()=>{if(i(!0),!a){l(!0),p(null);try{o(await k.post(`/api/runs/${e}/share`))}catch(e){p(e.message)}finally{l(!1)}}},h=async()=>{await k.del(`/api/runs/${e}/share`),o(null),i(!1)},_=()=>{a&&(navigator.clipboard.writeText(a.url),d(!0),setTimeout(()=>d(!1),1500))},v=bf(`share`)||typeof navigator<`u`&&`share`in navigator,y=a?.expiresAt?new Intl.DateTimeFormat(S,{dateStyle:`long`}).format(new Date(a.expiresAt)):null;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(g,{variant:`secondary`,onClick:()=>void m(),children:[(0,F.jsx)(ri,{className:`size-4`}),` `,A(`shareRun.button`)]}),(0,F.jsx)(c,{open:r,onClose:()=>i(!1),title:A(`shareRun.title`),children:s?(0,F.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,F.jsx)(D,{})}):f?(0,F.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[0.875rem] text-rose`,children:f}):a?(0,F.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-paper-2 p-1.5 pl-3`,children:[(0,F.jsx)(Ee,{className:`size-4 shrink-0 text-ink-3`}),(0,F.jsx)(`input`,{readOnly:!0,value:a.url,onFocus:e=>e.target.select(),"aria-label":A(`share.link`),className:`min-w-0 flex-1 bg-transparent text-[0.875rem] outline-none coarse:h-11`}),(0,F.jsxs)(g,{size:`sm`,onClick:_,children:[u?(0,F.jsx)(lt,{className:`size-3.5`}):(0,F.jsx)(Re,{className:`size-3.5`}),A(u?`share.copied`:`share.copy`)]})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 sm:grid-cols-6`,children:[Tf(a.url,t).map(e=>(0,F.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`flex flex-col items-center gap-1.5 text-[0.75rem] text-ink-2 hover:text-ink`,children:[(0,F.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 font-semibold text-[0.9375rem] transition hover:bg-paper-3`,children:e.id===`mail`?(0,F.jsx)(pr,{className:`size-5`}):Ef[e.id]}),e.label]},e.id)),v?(0,F.jsxs)(`button`,{type:`button`,onClick:()=>void(bf(`share`)?xf(`share`,{link:a.url,title:t}):navigator.share({title:t,url:a.url})).catch(()=>void 0),className:`flex flex-col items-center gap-1.5 text-[0.75rem] text-ink-2 hover:text-ink`,children:[(0,F.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 transition hover:bg-paper-3`,children:(0,F.jsx)(ri,{className:`size-5`})}),A(`shareRun.more`)]}):null]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[0.8125rem] text-ink-3`,children:[(0,F.jsx)(`span`,{children:y?A(`shareRun.until`,{date:y}):A(`shareRun.kept`)}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>void h(),className:`shrink-0 hover:text-rose coarse:min-h-11`,children:A(`shareRun.withdraw`)})]})]}):null})]})}At({lang:S,runBase:e=>`/api/runs/${e}`,withBase:a,asset:Me,serviceWorker:`${w}/sw.js`,app:{can:bf,call:xf,tell:Sf,download:Cf},Mascot:Ji,ShareResultButton:Df,onServerError:e=>se(`error`,e)}),ht(),`engentyDesktop`in window&&(document.documentElement.dataset.desktop=``);var Of=window.location.pathname,kf=Of===Fe||Of.startsWith(`${Fe}/`);kf&&`serviceWorker`in navigator&&navigator.serviceWorker.register(`${w}/sw.js`).catch(()=>void 0);var Af=new Gt({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});(0,wi.createRoot)(document.getElementById(`root`)).render((0,F.jsx)(N.StrictMode,{children:(0,F.jsx)(je,{client:Af,children:(0,F.jsx)(ot,{basename:kf?Fe:w,children:kf?(0,F.jsx)(gf,{}):(0,F.jsx)(Z,{})})})}));export{Ra as $,Il as A,Vr as At,nl as B,rr as Bt,mu as C,hi as Ct,Pl as D,$r as Dt,Fl as E,ri as Et,fl as F,yr as Ft,ts as G,kn as Gt,Yc as H,Yn as Ht,dl as I,_r as It,xo as J,_n as Jt,To as K,Dn as Kt,ul as L,pr as Lt,H as M,Dr as Mt,hl as N,Cr as Nt,zl as O,Yr as Ot,ml as P,xr as Pt,po as Q,sl as R,lr as Rt,cu as S,_i as St,uu as T,si as Tt,qc as U,Gn as Ut,el as V,Zn as Vt,Gc as W,Ln as Wt,ro as X,nn as Xt,vo as Y,dn as Yt,fo as Z,Kt as Zt,Gu as _,Vi as _t,wf as a,da as at,yu as b,Ci as bt,jd as c,Qi as ct,q as d,oa as dt,Ba as et,K as f,Xi as ft,Vu as g,Wi as gt,Wu as h,Yi as ht,bf as i,fa as it,Nl as j,zr as jt,Rl as k,Ur as kt,Wd as l,ea as lt,$u as m,Ji as mt,yf as n,Zi as nt,Sf as o,ua as ot,hd as p,Ki as pt,wo as q,Cn as qt,xf as r,va as rt,Kd as s,ta as st,Df as t,ya as tt,xd as u,aa as ut,zu as v,Gi as vt,Zl as w,di as wt,hu as x,xi as xt,Bu as y,Ei as yt,il as z,sr as zt};
|