@engenty/wizards-runtime 0.7.5 → 0.7.6
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/cli/environment.js +2 -0
- package/apps/runtime/dist/cli/main.js +10 -1
- package/apps/runtime/dist/cli/sandbox.js +77 -0
- package/apps/runtime/dist/cli/status.js +9 -0
- package/apps/runtime/dist/debug.js +2 -1
- package/apps/runtime/dist/docs/user/command-line.md +3 -0
- package/apps/runtime/dist/docs/user/server.md +1 -1
- package/apps/runtime/dist/env.js +10 -26
- package/apps/runtime/dist/sandbox/agentos-package.js +73 -0
- package/apps/runtime/dist/sandbox/agentos.js +162 -0
- package/apps/runtime/dist/sandbox/docker.js +32 -62
- package/apps/runtime/dist/sandbox/index.js +37 -8
- package/apps/runtime/dist/sandbox/install.js +122 -0
- package/apps/runtime/dist/sandbox/mastra.js +71 -0
- package/apps/runtime/dist/services/spaces.js +2 -1
- package/apps/web/dist/assets/{AboutDialog-D4mvc-zu.js → AboutDialog-DYgXPagX.js} +1 -1
- package/apps/web/dist/assets/{ChangelogDialog-DLqpJsF6.js → ChangelogDialog-BXqBW8j3.js} +1 -1
- package/apps/web/dist/assets/{ChatView-3laypRcE.js → ChatView-CK2--tsE.js} +1 -1
- package/apps/web/dist/assets/{EditorPage-BalA5U2Y.js → EditorPage-jvcwyXbU.js} +1 -1
- package/apps/web/dist/assets/{Harness-iYLtOLaK.js → Harness-CV9uYzbv.js} +1 -1
- package/apps/web/dist/assets/{NewWizardChannels-CbwJ9A56.js → NewWizardChannels-BakW5q6s.js} +1 -1
- package/apps/web/dist/assets/{NewWizardPage-BOBYiB9i.js → NewWizardPage-BoA-LJuW.js} +1 -1
- package/apps/web/dist/assets/{OnboardingPage-CUwCiVIr.js → OnboardingPage-DaD1XnOe.js} +1 -1
- package/apps/web/dist/assets/{ProjectPage-Bb16MdYG.js → ProjectPage-BFgk1DEv.js} +1 -1
- package/apps/web/dist/assets/{PublicRunner-BCt7Q6C-.js → PublicRunner-C9MwEvxy.js} +1 -1
- package/apps/web/dist/assets/{ReadOnly-kIHX2TEy.js → ReadOnly-DC2Kp7l8.js} +1 -1
- package/apps/web/dist/assets/{RunDrawer-hZ9oeSXu.js → RunDrawer-CY6NZSrI.js} +1 -1
- package/apps/web/dist/assets/{RunnerView-DUS9fPmx.js → RunnerView-BT26XgcY.js} +1 -1
- package/apps/web/dist/assets/{SettingsPage-BzwR50fi.js → SettingsPage-AFt9IDLt.js} +1 -1
- package/apps/web/dist/assets/{SetupPage-gAp7rPxp.js → SetupPage-DtFYAbwJ.js} +1 -1
- package/apps/web/dist/assets/{SharePage-DqZWHva_.js → SharePage-t2xwNS61.js} +1 -1
- package/apps/web/dist/assets/changelog-CATQFxCQ.js +1 -0
- package/apps/web/dist/assets/{index-C5Sm7tTR.js → index-Drw7FMTQ.js} +3 -3
- package/apps/web/dist/index.html +1 -1
- package/package.json +1 -1
- package/apps/web/dist/assets/changelog-DugmCNSf.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-DYgXPagX.js","assets/ui-dzGvc3xk.js","assets/preload-helper-CNEI7N0N.js","assets/settings-menu-2IMOOlLl.js","assets/ChangelogDialog-BXqBW8j3.js","assets/FlowPreview-CusP7ci9.js","assets/esm-DXeMu8Lb.js","assets/PublicRunner-C9MwEvxy.js","assets/ChatView-CK2--tsE.js","assets/phone-CgrIS4_-.js","assets/RunnerView-BT26XgcY.js","assets/SharePage-t2xwNS61.js","assets/EditorPage-jvcwyXbU.js","assets/RunDrawer-CY6NZSrI.js","assets/upload-BSuTilFF.js","assets/lock-R_CfU0Xo.js","assets/NewWizardChannels-BakW5q6s.js","assets/OnboardingPage-DaD1XnOe.js","assets/NewWizardPage-BoA-LJuW.js","assets/SettingsPage-AFt9IDLt.js","assets/ReadOnly-DC2Kp7l8.js","assets/Harness-CV9uYzbv.js","assets/Harness-BrP-ENHg.css","assets/ProjectPage-BFgk1DEv.js","assets/SetupPage-DtFYAbwJ.js"])))=>i.map(i=>d[i]);
|
|
2
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,$n as o,$r as s,$t as c,Ar as l,At as u,B as d,Br as f,Bt as p,Ct as m,Dr as h,En as g,Fn as _,Fr as v,Ft as y,G as b,Gr as ee,Gt as x,Hn as S,Hr as te,Ir as C,It as ne,J as re,Jn as w,Jr as T,Jt as E,K as ie,Kn as ae,Kr as oe,Kt as D,Lr as se,Lt as ce,Mr as O,Mt as k,Nr as le,Nt as ue,Or as de,Pr as fe,Pt as pe,Q as me,Qn as he,Qr as ge,Qt as _e,Rr as ve,Sr as ye,St as A,Tr as j,Un as be,Ur as xe,Vn as Se,Vr as Ce,Vt as M,W as N,Wr as we,Wt as Te,X as Ee,Xn as De,Xr as Oe,Xt as ke,Y as Ae,Yr as je,Yt as Me,Z as Ne,Zr as Pe,ai as Fe,br as Ie,c as Le,ci as Re,cr as ze,dn as Be,dr as Ve,ei as He,en as Ue,er as We,f as Ge,fn as Ke,fr as qe,gr as Je,hn as Ye,hr as Xe,i as Ze,ii as Qe,in as $e,ir as et,jr as tt,jt as nt,kn as rt,kr as it,l as at,li as ot,m as st,mn as ct,mr as lt,n as ut,ni as dt,nr as ft,o as pt,oi as mt,or as ht,ot as gt,pr as _t,q as vt,qn as yt,qr as bt,r as xt,ri as St,rr as Ct,s as wt,si as Tt,t as Et,ti as Dt,tr as Ot,u as kt,ui as At,ur as jt,w as Mt,wr as Nt,yr as Pt,zr as Ft}from"./ui-dzGvc3xk.js";import{t as It}from"./preload-helper-CNEI7N0N.js";import{c as Lt,l as Rt,t as zt,u as Bt}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 Vt=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:xe(t,n.data),hasPreviousPage:we(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Ht=class extends ee{#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||Ut(),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=oe({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),T.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ut(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Wt=class extends Oe{#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 Ht({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=Gt(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=Gt(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=Gt(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=Gt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){T.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=>Dt(t,e))}findAll(e={}){return this.getAll().filter(t=>Dt(e,t))}notify(e){T.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return T.batch(()=>Promise.all(e.map(e=>e.continue().catch(St))))}};function Gt(e){return e.options.scope?.id}var Kt=class extends Oe{#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),mt(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&ge(t.mutationKey)!==ge(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??Ut();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){T.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)})})}},qt=class extends Oe{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??s(r,t),a=this.get(i);return a||(a=new te({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(){T.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=>dt(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>dt(e,t)):t}notify(e){T.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){T.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){T.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Jt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new qt,this.#t=e.mutationCache||new Wt,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=je.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=bt.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(Fe(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=Pe(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return T.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;T.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return T.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=T.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(St).catch(St)}invalidateQueries(e,t={}){return T.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=T.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(St)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(St)}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(Fe(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(Fe(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(St).catch(St)}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(St).catch(St)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return bt.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(ge(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Qe(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(ge(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Qe(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||=s(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===Re&&(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()}},P=t(r(),1);function F(e,t){let n=At(t),[r]=P.useState(()=>new Kt(n,e));P.useEffect(()=>{r.setOptions(e)},[r,e]);let i=P.useSyncExternalStore(P.useCallback(e=>r.subscribe(T.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=P.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(St)},[r]);if(i.error&&Tt(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function Yt(e,t){return f(e,Vt,t)}var Xt=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,x||(x=!0,w());else{var t=n(l);t!==null&&ie(ee,t.startTime-e)}}}var x=!1,S=-1,te=5,C=-1;function ne(){return g?!0:!(e.unstable_now()-C<te)}function re(){if(g=!1,x){var t=e.unstable_now();C=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(S),S=-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&&ie(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?w():x=!1}}}var w;if(typeof y==`function`)w=function(){y(re)};else if(typeof MessageChannel<`u`){var T=new MessageChannel,E=T.port2;T.port1.onmessage=re,w=function(){E.postMessage(null)}}else w=function(){_(re,0)};function ie(t,n){S=_(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`):te=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(S),S=-1):h=!0,ie(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,x||(x=!0,w()))),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}}}})),Zt=n(((e,t)=>{t.exports=Xt()})),Qt=n((e=>{var t=Zt(),n=r(),i=ve();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 x(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function S(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 te(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`),w=Symbol.for(`react.portal`),T=Symbol.for(`react.fragment`),E=Symbol.for(`react.strict_mode`),ie=Symbol.for(`react.profiler`),ae=Symbol.for(`react.consumer`),oe=Symbol.for(`react.context`),D=Symbol.for(`react.forward_ref`),se=Symbol.for(`react.suspense`),ce=Symbol.for(`react.suspense_list`),O=Symbol.for(`react.memo`),k=Symbol.for(`react.lazy`),le=Symbol.for(`react.activity`),ue=Symbol.for(`react.legacy_hidden`),de=Symbol.for(`react.memo_cache_sentinel`),fe=Symbol.for(`react.view_transition`),pe=Symbol.for(`react.recoverable`),me=Symbol.iterator;function he(e){return typeof e!=`object`||!e?null:(e=me&&e[me]||e[`@@iterator`],typeof e==`function`?e:null)}var ge=Symbol.for(`react.client.reference`);function _e(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case T:return`Fragment`;case ie:return`Profiler`;case E:return`StrictMode`;case se:return`Suspense`;case ce:return`SuspenseList`;case le:return`Activity`;case fe:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case w:return`Portal`;case oe:return e.displayName||`Context`;case ae:return(e._context.displayName||`Context`)+`.Consumer`;case D:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case O:return t=e.displayName||null,t===null?_e(e.type)||`Memo`:t;case k:t=e._payload,e=e._init;try{return _e(e(t))}catch{}}return null}var ye=Array.isArray,A=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be={pending:!1,data:null,method:null,action:null},xe=[],Se=-1;function Ce(e){return{current:e}}function M(e){0>Se||(e.current=xe[Se],xe[Se]=null,Se--)}function N(e,t){Se++,xe[Se]=e.current,e.current=t}var we=Ce(null),Te=Ce(null),Ee=Ce(null),De=Ce(null);function Oe(e,t){switch(N(Ee,t),N(Te,e),N(we,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}}M(we),N(we,e)}function ke(){M(we),M(Te),M(Ee)}function Ae(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,N(De,e)),t=we.current;var n=dp(t,e.type);t!==n&&(N(Te,e),N(we,n))}function je(e){Te.current===e&&(M(we),M(Te)),De.current===e&&(M(De),sh._currentValue=be)}var Me,Ne;function Pe(e){if(Me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Me=t&&t[1]||``,Ne=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+Me+e+Ne}var Fe=!1;function Ie(e,t){if(!e||Fe)return``;Fe=!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(`
|
|
@@ -7,8 +7,8 @@ import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{n as r,t
|
|
|
7
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{Fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Pe(n):``}function Le(e,t){switch(e.tag){case 26:case 27:case 5:return Pe(e.type);case 16:return Pe(`Lazy`);case 13:return e.child!==t&&t!==null?Pe(`Suspense Fallback`):Pe(`Suspense`);case 19:return Pe(`SuspenseList`);case 0:case 15:return Ie(e.type,!1);case 11:return Ie(e.type.render,!1);case 1:return Ie(e.type,!0);case 31:return Pe(`Activity`);case 30:return Pe(`ViewTransition`);default:return``}}function Re(e){try{var t=``,n=null;do t+=Le(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
8
|
Error generating stack: `+e.message+`
|
|
9
9
|
`+e.stack}}var ze=Object.prototype.hasOwnProperty,Be=t.unstable_scheduleCallback,Ve=t.unstable_cancelCallback,He=t.unstable_shouldYield,Ue=t.unstable_requestPaint,We=t.unstable_now,Ge=t.unstable_getCurrentPriorityLevel,Ke=t.unstable_ImmediatePriority,qe=t.unstable_UserBlockingPriority,Je=t.unstable_NormalPriority,Ye=t.unstable_LowPriority,Xe=t.unstable_IdlePriority,Ze=t.log,Qe=t.unstable_setDisableYieldValue,$e=null,et=null;function tt(e){if(typeof Ze==`function`&&Qe(e),et&&typeof et.setStrictMode==`function`)try{et.setStrictMode($e,e)}catch{}}var nt=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-nt(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-nt(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-nt(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-nt(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=j.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function wt(e,t){var n=j.p;try{return j.p=e,t()}finally{j.p=n}}var Tt=Math.random().toString(36).slice(2),Et=`__reactFiber$`+Tt,Dt=`__reactProps$`+Tt,Ot=`__reactContainer$`+Tt,kt=`__reactEvents$`+Tt,At=`__reactListeners$`+Tt,jt=`__reactHandles$`+Tt,Mt=`__reactResources$`+Tt,Nt=`__reactMarker$`+Tt,Pt=`__reactLoad$`+Tt;function Ft(e){delete e[Et],delete e[Dt],delete e[At],delete e[jt]}function It(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 Lt(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 Rt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function zt(e){var t=e[Mt];return t||=e[Mt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Bt(e){e[Nt]=!0}function Vt(e){e[Pt]=void 0}var Ht=new Set,Ut={};function Wt(e,t){Gt(e,t),Gt(e+`Capture`,t)}function Gt(e,t){for(Ut[e]=t,e=0;e<t.length;e++)Ht.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 P(e){return ze.call(Jt,e)?!0:ze.call(qt,e)?!1:Kt.test(e)?Jt[e]=!0:(qt[e]=!0,!1)}var F=!1;function Yt(){var e=F;return F=!1,e}function Xt(e,t,n){if(P(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 Qt(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 $t(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 en(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function tn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function nn(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 rn(e){if(!e._valueTracker){var t=tn(e)?`checked`:`value`;e._valueTracker=nn(e,t,``+e[t])}}function an(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=tn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var on=/[\n"\\]/g;function sn(e){return e.replace(on,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function cn(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=``+en(t)):e.value!==``+en(t)&&(e.value=``+en(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):un(e,en(n)):o===`number`&&e.value==t?un(e,en(e.value)):un(e,en(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=``+en(s):e.removeAttribute(`name`)}function ln(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)){rn(e);return}n=n==null?``:``+en(n),t=t==null?n:``+en(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),rn(e)}function un(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function dn(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=``+en(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 fn(e,t,n){if(t!=null&&(t=``+en(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+en(n)}function pn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(ye(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=en(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),rn(e)}function mn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var hn=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 gn(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||hn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function _n(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]=``,F=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(gn(e,i,r),F=!0)}else for(var o in t)t.hasOwnProperty(o)&&gn(e,o,t[o])}function vn(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 yn=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`]]),bn=/^[\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 xn(e){return bn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Sn(){}var Cn=null;function wn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Tn=null,En=null;function Dn(e){var t=Lt(e);if(t&&(e=t.stateNode)){var n=e[Dt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(cn(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="`+sn(``+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));cn(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&&an(r)}break a;case`textarea`:fn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&dn(e,!!n.multiple,t,!1)}}}var On=!1;function kn(e,t,n){if(On)return e(t,n);On=!0;try{return e(t)}finally{if(On=!1,(Tn!==null||En!==null)&&(zd(),Tn&&(t=Tn,e=En,En=Tn=null,Dn(t),e)))for(t=0;t<e.length;t++)Dn(e[t])}}function An(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 jn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Mn=!1;if(jn)try{var Nn={};Object.defineProperty(Nn,"passive",{get:function(){Mn=!0}}),window.addEventListener(`test`,Nn,Nn),window.removeEventListener(`test`,Nn,Nn)}catch{Mn=!1}var Pn=null,Fn=null,In=null;function Ln(){if(In)return In;var e,t=Fn,n=t.length,r,i=`value`in Pn?Pn.value:Pn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return In=i.slice(e,1<r?1-r:void 0)}function Rn(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 zn(){return!0}function Bn(){return!1}function Vn(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)?zn:Bn,this.isPropagationStopped=Bn,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=zn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=zn)},persist:function(){},isPersistent:zn}),t}var Hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Un=Vn(Hn),Wn=C({},Hn,{view:0,detail:0}),Gn=Vn(Wn),Kn,qn,Jn,Yn=C({},Wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:or,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!==Jn&&(Jn&&e.type===`mousemove`?(Kn=e.screenX-Jn.screenX,qn=e.screenY-Jn.screenY):qn=Kn=0,Jn=e),Kn)},movementY:function(e){return`movementY`in e?e.movementY:qn}}),Xn=Vn(Yn),Zn=Vn(C({},Yn,{dataTransfer:0})),Qn=Vn(C({},Wn,{relatedTarget:0})),$n=Vn(C({},Hn,{animationName:0,elapsedTime:0,pseudoElement:0})),er=Vn(C({},Hn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),tr=Vn(C({},Hn,{data:0})),nr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},rr={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`},ir={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ar(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ir[e])?!!t[e]:!1}function or(){return ar}var sr=Vn(C({},Wn,{key:function(e){if(e.key){var t=nr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Rn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?rr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:or,charCode:function(e){return e.type===`keypress`?Rn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Rn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),cr=Vn(C({},Yn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),lr=Vn(C({},Hn,{submitter:0})),ur=Vn(C({},Wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:or})),dr=Vn(C({},Hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),fr=Vn(C({},Yn,{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})),pr=Vn(C({},Hn,{newState:0,oldState:0,source:0})),mr=[9,13,27,32],hr=jn&&`CompositionEvent`in window,gr=null;jn&&`documentMode`in document&&(gr=document.documentMode);var _r=jn&&`TextEvent`in window&&!gr,vr=jn&&(!hr||gr&&8<gr&&11>=gr),yr=` `,br=!1;function xr(e,t){switch(e){case`keyup`:return mr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Sr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Cr=!1;function wr(e,t){switch(e){case`compositionend`:return Sr(t);case`keypress`:return t.which===32?(br=!0,yr):null;case`textInput`:return e=t.data,e===yr&&br?null:e;default:return null}}function Tr(e,t){if(Cr)return e===`compositionend`||!hr&&xr(e,t)?(e=Ln(),In=Fn=Pn=null,Cr=!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 vr&&t.locale!==`ko`?null:t.data;default:return null}}var Er={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 Dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Er[e.type]:t===`textarea`}function Or(e,t,n,r){Tn?En?En.push(r):En=[r]:Tn=r,t=Jf(t,`onChange`),0<t.length&&(n=new Un(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var kr=null,Ar=null;function jr(e){Vf(e,0)}function Mr(e){if(an(Rt(e)))return e}function Nr(e,t){if(e===`change`)return t}var Pr=!1;if(jn){var Fr;if(jn){var Ir=`oninput`in document;if(!Ir){var Lr=document.createElement(`div`);Lr.setAttribute(`oninput`,`return;`),Ir=typeof Lr.oninput==`function`}Fr=Ir}else Fr=!1;Pr=Fr&&(!document.documentMode||9<document.documentMode)}function Rr(){kr&&(kr.detachEvent(`onpropertychange`,zr),Ar=kr=null)}function zr(e){if(e.propertyName===`value`&&Mr(Ar)){var t=[];Or(t,Ar,e,wn(e)),kn(jr,t)}}function Br(e,t,n){e===`focusin`?(Rr(),kr=t,Ar=n,kr.attachEvent(`onpropertychange`,zr)):e===`focusout`&&Rr()}function Vr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Mr(Ar)}function Hr(e,t){if(e===`click`)return Mr(t)}function Ur(e,t){if(e===`input`||e===`change`)return Mr(t)}function Wr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Gr=typeof Object.is==`function`?Object.is:Wr;function Kr(e,t){if(Gr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ze.call(t,i)||!Gr(e[i],t[i]))return!1}return!0}function qr(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 Jr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yr(e,t){var n=Jr(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=Jr(n)}}function Xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qr(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=qr(e.document)}return t}function Qr(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 $r=jn&&`documentMode`in document&&11>=document.documentMode,ei=null,ti=null,ni=null,ri=!1;function ii(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ri||ei==null||ei!==qr(r)||(r=ei,`selectionStart`in r&&Qr(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}),ni&&Kr(ni,r)||(ni=r,r=Jf(ti,`onSelect`),0<r.length&&(t=new Un(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ei)))}function ai(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var oi={animationend:ai(`Animation`,`AnimationEnd`),animationiteration:ai(`Animation`,`AnimationIteration`),animationstart:ai(`Animation`,`AnimationStart`),transitionrun:ai(`Transition`,`TransitionRun`),transitionstart:ai(`Transition`,`TransitionStart`),transitioncancel:ai(`Transition`,`TransitionCancel`),transitionend:ai(`Transition`,`TransitionEnd`)},si={},ci={};jn&&(ci=document.createElement(`div`).style,`AnimationEvent`in window||(delete oi.animationend.animation,delete oi.animationiteration.animation,delete oi.animationstart.animation),`TransitionEvent`in window||delete oi.transitionend.transition);function li(e){if(si[e])return si[e];if(!oi[e])return e;var t=oi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ci)return si[e]=t[n];return e}var ui=li(`animationend`),di=li(`animationiteration`),fi=li(`animationstart`),pi=li(`transitionrun`),mi=li(`transitionstart`),hi=li(`transitioncancel`),gi=li(`transitionend`),_i=new Map,vi=`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(` `);vi.push(`scrollEnd`);function yi(e,t){_i.set(e,t),Wt(t,[e])}var bi=0;function xi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=xd.identifierPrefix;var n=bi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Si(e){if(e==null||typeof e==`string`)return e;var t=null,n=kd;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 Ci(e,t){return e=Si(e),t=Si(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},wi=[],Ti=0,Ei=0;function Di(){for(var e=Ti,t=Ei=Ti=0;t<e;){var n=wi[t];wi[t++]=null;var r=wi[t];wi[t++]=null;var i=wi[t];wi[t++]=null;var a=wi[t];if(wi[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&&ji(n,i,a)}}function Oi(e,t,n,r){wi[Ti++]=e,wi[Ti++]=t,wi[Ti++]=n,wi[Ti++]=r,Ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ki(e,t,n,r){return Oi(e,t,n,r),Mi(e)}function Ai(e,t){return Oi(e,null,null,t),Mi(e)}function ji(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-nt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Mi(e){if(50<Ad)throw Ad=0,jd=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ni={};function Pi(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 Fi(e,t,n,r){return new Pi(e,t,n,r)}function Ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Li(e,t){var n=e.alternate;return n===null?(n=Fi(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 Ri(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 zi(e,t,n,r,i,o){var s=0;if(r=e,typeof r==`function`)Ii(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,we.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case le:return e=Fi(31,n,t,i),e.elementType=le,e.lanes=o,e;case T:return Bi(n.children,i,o,t);case E:s=8,i|=24;break;case ie:return e=Fi(12,n,t,i|2),e.elementType=ie,e.lanes=o,e;case se:return e=Fi(13,n,t,i),e.elementType=se,e.lanes=o,e;case ce:return e=Fi(19,n,t,i),e.elementType=ce,e.lanes=o,e;case ue:case fe:return e=i|32,e=Fi(30,n,t,e),e.elementType=fe,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case oe:s=10;break a;case ae:s=9;break a;case D:s=11;break a;case O:s=14;break a;case k:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=Fi(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Bi(e,t,n,r){return e=Fi(7,e,r,t),e.lanes=n,e}function Vi(e,t,n){return e=Fi(6,e,null,t),e.lanes=n,e}function Hi(e){var t=Fi(18,null,null,0);return t.stateNode=e,t}function Ui(e,t,n){return t=Fi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Wi=new WeakMap;function Gi(e,t){if(typeof e==`object`&&e){var n=Wi.get(e);return n===void 0?(t={value:e,source:t,stack:Re(t)},Wi.set(e,t),t):n}return{value:e,source:t,stack:Re(t)}}var Ki=[],qi=0,Ji=null,Yi=0,Xi=[],Zi=0,Qi=null,$i=1,ea=``;function ta(e,t){Ki[qi++]=Yi,Ki[qi++]=Ji,Ji=e,Yi=t}function na(e,t,n){Xi[Zi++]=$i,Xi[Zi++]=ea,Xi[Zi++]=Qi,Qi=e;var r=$i;e=ea;var i=32-nt(r)-1;r&=~(1<<i),n+=1;var a=32-nt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,$i=1<<32-nt(t)+i|n<<i|r,ea=a+e}else $i=1<<a|n<<i|r,ea=e}function ra(e){e.return!==null&&(ta(e,1),na(e,1,0))}function ia(e){for(;e===Ji;)Ji=Ki[--qi],Ki[qi]=null,Yi=Ki[--qi],Ki[qi]=null;for(;e===Qi;)Qi=Xi[--Zi],Xi[Zi]=null,ea=Xi[--Zi],Xi[Zi]=null,$i=Xi[--Zi],Xi[Zi]=null}function aa(e,t){Xi[Zi++]=$i,Xi[Zi++]=ea,Xi[Zi++]=Qi,$i=t.id,ea=t.overflow,Qi=e}var oa=null,L=null,R=!1,sa=null,ca=!1,la=Error(a(519));function ua(e){throw ga(Gi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),la}function da(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),ln(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),pn(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=Sn),t=!0):t=!1,t||ua(e,!0)}function fa(e){for(oa=e.return;oa;)switch(oa.tag){case 5:case 31:case 13:ca=!1;return;case 27:case 3:ca=!0;return;default:oa=oa.return}}function pa(e){if(e!==oa)return!1;if(!R)return fa(e),R=!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&&L&&ua(e),fa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));L=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));L=dm(e)}else t===27?(t=L,Sp(e.type)?(e=um,um=null,L=e):L=t):L=oa?lm(e.stateNode.nextSibling):null;return!0}function ma(){L=oa=null,R=!1}function ha(){var e=sa;return e!==null&&(pd===null?pd=e:pd.push.apply(pd,e),sa=null),e}function ga(e){sa===null?sa=[e]:sa.push(e)}var _a=Ce(null),va=null,ya=null;function ba(e,t,n){N(_a,t._currentValue),t._currentValue=n}function xa(e){e._currentValue=_a.current,M(_a)}function Sa(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 Ca(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),Sa(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),Sa(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),Sa(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 wa(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;Gr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===De.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&&Ca(t,e,n,r),t.flags|=262144,e!==null}function Ta(e){for(e=e.firstContext;e!==null;){if(!Gr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ea(e){va=e,ya=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Da(e){return ka(va,e)}function Oa(e,t){return va===null&&Ea(e),ka(e,t)}function ka(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ya===null){if(e===null)throw Error(a(308));ya=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ya=ya.next=t;return n}var Aa=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()})}},ja=t.unstable_scheduleCallback,Ma=t.unstable_NormalPriority,Na={$$typeof:oe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pa(){return{controller:new Aa,data:new Map,refCount:0}}function Fa(e){e.refCount--,e.refCount===0&&ja(Ma,function(){e.controller.abort()})}function Ia(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 La=null;function Ra(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var za=null,Ba=0,Va=0,Ha=null;function Ua(e,t){if(za===null){var n=za=[];Ba=0,Va=Pf(),Ha={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ba++,t.then(Wa,Wa),t}function Wa(){if(--Ba===0&&(La=null,za!==null)){Ha!==null&&(Ha.status=`fulfilled`);var e=za;za=null,Va=0,Ha=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ga(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 Ka=A.S;A.S=function(e,t){if(gd=We(),typeof t==`object`&&t&&typeof t.then==`function`&&Ua(e,t),La!==null)for(var n=bf;n!==null;)Ia(n,La),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)Ia(r,n),r=r.next;if(Va!==0){r=La,r===null&&(r=La=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ka!==null&&Ka(e,t)};var qa=Ce(null);function Ja(){var e=qa.current;return e===null?K.pooledCache:e}function Ya(e,t){t===null?N(qa,qa.current):N(qa,t.pool)}function Xa(){var e=Ja();return e===null?null:{parent:Na._currentValue,pool:e}}var Za=Error(a(460)),Qa=Error(a(474)),$a=Error(a(542)),eo={then:function(){}};function to(e){return e=e.status,e===`fulfilled`||e===`rejected`}function no(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Sn,Sn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,oo(e),e===void 0&&!(`reason`in t)?Error(a(600)):e;default:if(typeof t.status==`string`)t.then(Sn,Sn);else{if(e=K,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,oo(e),e}throw io=t,Za}}function ro(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(io=e,Za):e}}var io=null;function ao(){if(io===null)throw Error(a(459));var e=io;return io=null,e}function oo(e){if(e===Za||e===$a)throw Error(a(483))}var so=null,co=0;function lo(e){var t=co;return co+=1,so===null&&(so=[]),no(so,e,t)}function uo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function fo(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 po(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=Li(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=Vi(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===T?(e=d(e,t,n.props.children,r,n.key),uo(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===k&&ro(a)===t.type)?(t=i(t,n.props),uo(t,n),t.return=e,t):(t=zi(n.type,n.key,n.props,null,e.mode,r),uo(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=Ui(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=Bi(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=Vi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case re:return n=zi(t.type,t.key,t.props,null,e.mode,n),uo(n,t),n.return=e,n;case w:return t=Ui(t,e.mode,n),t.return=e,t;case k:return t=ro(t),f(e,t,n)}if(ye(t)||he(t))return t=Bi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,lo(t),n);if(t.$$typeof===oe)return f(e,Oa(e,t),n);fo(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 w:return n.key===i?u(e,t,n,r):null;case k:return n=ro(n),p(e,t,n,r)}if(ye(n)||he(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,lo(n),r);if(n.$$typeof===oe)return p(e,t,Oa(e,n),r);fo(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 w:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case k:return r=ro(r),m(e,t,n,r,i)}if(ye(r)||he(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,lo(r),i);if(r.$$typeof===oe)return m(e,t,n,Oa(t,r),i);fo(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),R&&ta(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 R&&ta(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)}),R&&ta(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),R&&ta(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 R&&ta(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)}),R&&ta(i,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===T&&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===T){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),uo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===k&&ro(l)===r.type){n(e,r.sibling),c=i(r,o.props),uo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===T?(c=Bi(o.props.children,e.mode,c,o.key),uo(c,o),c.return=e,e=c):(c=zi(o.type,o.key,o.props,null,e.mode,c),uo(c,o),c.return=e,e=c)}return s(e);case w: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=Ui(o,e.mode,c),c.return=e,e=c}return s(e);case k:return o=ro(o),_(e,r,o,c)}if(ye(o))return h(e,r,o,c);if(he(o)){if(l=he(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,lo(o),c);if(o.$$typeof===oe)return _(e,r,Oa(e,o),c);fo(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=Vi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{co=0;var i=_(e,t,n,r);return so=null,i}catch(t){if(t===Za||t===$a)throw t;var a=Fi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var mo=po(!0),ho=po(!1),go=!1;function _o(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vo(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 yo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function bo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Mi(e),ji(e,null,n),t}return Oi(e,r,t,n),Mi(e)}function xo(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 So(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 Co=!1;function wo(){if(Co){var e=Ha;if(e!==null)throw e}}function To(e,t,n,r){Co=!1;var i=e.updateQueue;go=!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?(J&f)===f:(r&f)===f){f!==0&&f===Va&&(Co=!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:go=!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),sd|=o,e.lanes=o,e.memoizedState=d}}function Eo(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Do(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Eo(n[e],t)}var Oo=Ce(null),ko=Ce(0);function Ao(e,t){e=ad,N(ko,e),N(Oo,t),ad=e|t.baseLanes}function jo(){N(ko,ad),N(Oo,Oo.current)}function Mo(){ad=ko.current,M(Oo),M(ko)}var No=Ce(null),Po=null;function Fo(e){var t=e.alternate;N(Bo,Bo.current&1),N(No,e),Po===null&&(t===null||Oo.current!==null||t.memoizedState!==null)&&(Po=e)}function Io(e){N(Bo,Bo.current),N(No,e),Po===null&&(Po=e)}function Lo(e){e.tag===22?(N(Bo,Bo.current),N(No,e),Po===null&&(Po=e)):Ro()}function Ro(){N(Bo,Bo.current),N(No,No.current)}function zo(e){M(No),Po===e&&(Po=null),M(Bo)}var Bo=Ce(0);function Vo(e,t){N(No,No.current),N(Bo,t)}function Ho(e){M(Bo),M(No),Po===e&&(Po=null)}function Uo(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 Wo=0,z=null,B=null,Go=null,Ko=!1,qo=!1,Jo=!1,Yo=0,Xo=0,Zo=null,Qo=0;function V(){throw Error(a(321))}function $o(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Gr(e[n],t[n]))return!1;return!0}function es(e,t,n,r,i,a){return Wo=a,z=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?gc:_c,Jo=!1,a=n(r,i),Jo=!1,qo&&(a=ns(t,n,r,i)),ts(e),a}function ts(e){A.H=hc;var t=B!==null&&B.next!==null;if(Wo=0,Go=B=z=null,Ko=!1,Xo=0,Zo=null,t)throw Error(a(300));e===null||Pc||(e=e.dependencies,e!==null&&Ta(e)&&(Pc=!0))}function ns(e,t,n,r){z=e;var i=0;do{if(qo&&(Zo=null),Xo=0,qo=!1,25<=i)throw Error(a(301));if(i+=1,Go=B=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}A.H=vc,o=t(n,r)}while(qo);return o}function rs(){var e=A.H,t=e.useState()[0];return t=typeof t.then==`function`?ls(t):t,e=e.useState()[0],(B===null?null:B.memoizedState)!==e&&(z.flags|=1024),t}function is(){var e=Yo!==0;return Yo=0,e}function as(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function os(e){if(Ko){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ko=!1}Wo=0,Go=B=z=null,qo=!1,Xo=Yo=0,Zo=null}function ss(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Go===null?z.memoizedState=Go=e:Go=Go.next=e,Go}function H(){if(B===null){var e=z.alternate;e=e===null?null:e.memoizedState}else e=B.next;var t=Go===null?z.memoizedState:Go.next;if(t!==null)Go=t,B=e;else{if(e===null)throw z.alternate===null?Error(a(467)):Error(a(310));B=e,e={memoizedState:B.memoizedState,baseState:B.baseState,baseQueue:B.baseQueue,queue:B.queue,next:null},Go===null?z.memoizedState=Go=e:Go=Go.next=e}return Go}function cs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ls(e){var t=Xo;return Xo+=1,Zo===null&&(Zo=[]),e=no(Zo,e,t),t=z,(Go===null?t.memoizedState:Go.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?gc:_c),e}function us(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ls(e);if(e.$$typeof===pe)return;if(e.$$typeof===oe)return Da(e)}throw Error(a(438,String(e)))}function ds(e){var t=null,n=z.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=z.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=cs(),z.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]=de;return t.index++,n}function fs(e,t){return typeof t==`function`?t(e):t}function ps(e){return ms(H(),B,e)}function ms(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?(Wo&f)===f:(J&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===Va&&(d=!0);else if((Wo&p)===p){u=u.next,p===Va&&(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,z.lanes|=p,sd|=p;f=u.action,Jo&&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,z.lanes|=f,sd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Gr(o,e.memoizedState)&&(Pc=!0,d&&(n=Ha,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 hs(e){var t=H(),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);Gr(o,t.memoizedState)||(Pc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function gs(e,t,n){var r=z,i=H(),o=R;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!Gr((B||i).memoizedState,n);if(s&&(i.memoizedState=n,Pc=!0),i=i.queue,Vs(ys.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||Go!==null&&!!(Go.memoizedState.tag&1),Is(e?9:8,{destroy:void 0},vs.bind(null,r,i,n,t),null),e){if(r.flags|=2048,K===null)throw Error(a(349));o||Wo&127||_s(r,t,n)}return n}function _s(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=z.updateQueue,t===null?(t=cs(),z.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vs(e,t,n,r){t.value=n,t.getSnapshot=r,bs(t)&&xs(e)}function ys(e,t,n){return n(function(){bs(t)&&xs(e)})}function bs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Gr(e,n)}catch{return!0}}function xs(e){var t=Ai(e,2);t!==null&&Fd(t,e,2)}function Ss(e){var t=ss();if(typeof e==`function`){var n=e;if(e=n(),Jo){tt(!0);try{n()}finally{tt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:e},t}function Cs(e,t,n,r){return e.baseState=n,ms(e,B,typeof r==`function`?r:fs)}function ws(e,t,n,r,i){if(fc(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)}};A.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ts(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ts(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=A.T,o={};o.types=a===null?null:a.types,A.T=o;try{var s=n(i,r),c=A.S;c!==null&&c(o,s),Es(e,t,s)}catch(n){Os(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),A.T=a}}else try{a=n(i,r),Es(e,t,a)}catch(n){Os(e,t,n)}}function Es(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ds(e,t,n)},function(n){return Os(e,t,n)}):Ds(e,t,n)}function Ds(e,t,n){t.status=`fulfilled`,t.value=n,ks(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ts(e,n)))}function Os(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ks(t),t=t.next;while(t!==r)}e.action=null}function ks(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function As(e,t){return t}function js(e,t){if(R){var n=K.formState;if(n!==null){a:{var r=z;if(R){if(L){b:{for(var i=L,a=ca;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){L=lm(i.nextSibling),r=i.data===`F!`;break a}}ua(r)}r=!1}r&&(t=n[0])}}return n=ss(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:As,lastRenderedState:t},n.queue=r,n=lc.bind(null,z,r),r.dispatch=n,r=Ss(!1),a=dc.bind(null,z,!1,r.queue),r=ss(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ws.bind(null,z,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ms(e){return Ns(H(),B,e)}function Ns(e,t,n){if(t=ms(e,t,As)[0],e=ps(fs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ls(t)}catch(e){throw e===Za?$a:e}else r=t;t=H();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(z.flags|=2048,Is(9,{destroy:void 0},Ps.bind(null,i,n),null)),[r,a,e]}function Ps(e,t){e.action=t}function Fs(e){var t=H(),n=B;if(n!==null)return Ns(t,n,e);H(),t=t.memoizedState,n=H();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Is(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=z.updateQueue,t===null&&(t=cs(),z.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 Ls(){return H().memoizedState}function Rs(e,t,n,r){var i=ss();z.flags|=e,i.memoizedState=Is(1|t,{destroy:void 0},n,r===void 0?null:r)}function zs(e,t,n,r){var i=H();r=r===void 0?null:r;var a=i.memoizedState.inst;B!==null&&r!==null&&$o(r,B.memoizedState.deps)?i.memoizedState=Is(t,a,n,r):(z.flags|=e,i.memoizedState=Is(1|t,a,n,r))}function Bs(e,t){Rs(8390656,8,e,t)}function Vs(e,t){zs(2048,8,e,t)}function Hs(e){z.flags|=4;var t=z.updateQueue;if(t===null)t=cs(),z.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Us(e){var t=H().memoizedState;return Hs({ref:t,nextImpl:e}),function(){if(G&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function Ws(e,t){return zs(4,2,e,t)}function Gs(e,t){return zs(4,4,e,t)}function Ks(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 qs(e,t,n){n=n==null?null:n.concat([e]),zs(4,4,Ks.bind(null,t,e),n)}function Js(){}function Ys(e,t){var n=H();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&$o(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Xs(e,t){var n=H();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&$o(t,r[1]))return r[0];if(r=e(),Jo){tt(!0);try{e()}finally{tt(!1)}}return n.memoizedState=[r,t],r}function Zs(e,t,n){return n===void 0||Wo&1073741824&&!(J&261930)?e.memoizedState=t:(e.memoizedState=n,e=Nd(),z.lanes|=e,sd|=e,n)}function Qs(e,t,n,r){return Gr(n,t)?n:Oo.current===null?!(Wo&106)||Wo&1073741824&&!(J&261930)?(Pc=!0,e.memoizedState=n):(e=Nd(),z.lanes|=e,sd|=e,t):(e=Zs(e,n,r),Gr(e,t)||(Pc=!0),e)}function $s(e,t,n,r,i){var a=j.p;j.p=a!==0&&8>a?a:8;var o=A.T,s={};s.types=o===null?null:o.types,A.T=s,dc(e,!1,t,n);try{var c=i(),l=A.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?uc(e,t,Ga(c,r),Md(e)):uc(e,t,r,Md(e))}catch(n){uc(e,t,{then:function(){},status:`rejected`,reason:n},Md())}finally{j.p=a,o!==null&&s.types!==null&&(o.types=s.types),A.T=o}}function ec(){}function tc(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=nc(e).queue;$s(e,i,t,be,n===null?ec:function(){return rc(e),n(r)})}function nc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:be,baseState:be,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:be},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rc(e){var t=nc(e);t.next===null&&(t=e.alternate.memoizedState),uc(e,t.next.queue,{},Md())}function ic(){return Da(sh)}function ac(){return H().memoizedState}function oc(){return H().memoizedState}function sc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Md();e=yo(n);var r=bo(t,e,n);r!==null&&(Fd(r,t,n),xo(r,t,n)),t={cache:Pa()},e.payload=t;return}t=t.return}}function cc(e,t,n){var r=Md();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fc(e)?pc(t,n):(n=ki(e,t,n,r),n!==null&&(Fd(n,e,r),mc(n,t,r)))}function lc(e,t,n){uc(e,t,n,Md())}function uc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(fc(e))pc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Gr(s,o))return Oi(e,t,i,0),K===null&&Di(),!1}catch{}if(n=ki(e,t,i,r),n!==null)return Fd(n,e,r),mc(n,t,r),!0}return!1}function dc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},fc(e)){if(t)throw Error(a(479))}else t=ki(e,n,r,2),t!==null&&Fd(t,e,2)}function fc(e){var t=e.alternate;return e===z||t!==null&&t===z}function pc(e,t){qo=Ko=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yt(e,n)}}var hc={readContext:Da,use:us,useCallback:V,useContext:V,useEffect:V,useImperativeHandle:V,useLayoutEffect:V,useInsertionEffect:V,useMemo:V,useReducer:V,useRef:V,useState:V,useDebugValue:V,useDeferredValue:V,useTransition:V,useSyncExternalStore:V,useId:V,useHostTransitionStatus:V,useFormState:V,useActionState:V,useOptimistic:V,useMemoCache:V,useCacheRefresh:V,useEffectEvent:V},gc={readContext:Da,use:us,useCallback:function(e,t){return ss().memoizedState=[e,t===void 0?null:t],e},useContext:Da,useEffect:Bs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Rs(4194308,4,Ks.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rs(4194308,4,e,t)},useInsertionEffect:function(e,t){Rs(4,2,e,t)},useMemo:function(e,t){var n=ss();t=t===void 0?null:t;var r=e();if(Jo){tt(!0);try{e()}finally{tt(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ss();if(n!==void 0){var i=n(t);if(Jo){tt(!0);try{n(t)}finally{tt(!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=cc.bind(null,z,e),[r.memoizedState,e]},useRef:function(e){var t=ss();return e={current:e},t.memoizedState=e},useState:function(e){e=Ss(e);var t=e.queue,n=lc.bind(null,z,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Js,useDeferredValue:function(e,t){return Zs(ss(),e,t)},useTransition:function(){var e=Ss(!1);return e=$s.bind(null,z,e.queue,!0,!1),ss().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=z,i=ss();if(R){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),K===null)throw Error(a(349));J&127||_s(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Bs(ys.bind(null,r,o,e),[e]),r.flags|=2048,Is(9,{destroy:void 0},vs.bind(null,r,o,n,t),null),n},useId:function(){var e=ss(),t=K.identifierPrefix;if(R){var n=ea,r=$i;n=(r&~(1<<32-nt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ic,useFormState:js,useActionState:js,useOptimistic:function(e){var t=ss();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=dc.bind(null,z,!0,n),n.dispatch=t,[e,t]},useMemoCache:ds,useCacheRefresh:function(){return ss().memoizedState=sc.bind(null,z)},useEffectEvent:function(e){var t=ss(),n={impl:e};return t.memoizedState=n,function(){if(G&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},_c={readContext:Da,use:us,useCallback:Ys,useContext:Da,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:ps,useRef:Ls,useState:function(){return ps(fs)},useDebugValue:Js,useDeferredValue:function(e,t){return Qs(H(),B.memoizedState,e,t)},useTransition:function(){var e=ps(fs)[0],t=H().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){return Cs(H(),B,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us},vc={readContext:Da,use:us,useCallback:Ys,useContext:Da,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:hs,useRef:Ls,useState:function(){return hs(fs)},useDebugValue:Js,useDeferredValue:function(e,t){var n=H();return B===null?Zs(n,e,t):Qs(n,B.memoizedState,e,t)},useTransition:function(){var e=hs(fs)[0],t=H().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Fs,useActionState:Fs,useOptimistic:function(e,t){var n=H();return B===null?(n.baseState=e,[e,n.queue.dispatch]):Cs(n,B,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us};function yc(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 bc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Md(),i=yo(r);i.payload=t,n!=null&&(i.callback=n),t=bo(e,i,r),t!==null&&(Fd(t,e,r),xo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Md(),i=yo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=bo(e,i,r),t!==null&&(Fd(t,e,r),xo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Md(),r=yo(n);r.tag=2,t!=null&&(r.callback=t),t=bo(e,r,n),t!==null&&(Fd(t,e,n),xo(t,e,n))}};function xc(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?!Kr(n,r)||!Kr(i,a):!0}function Sc(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&&bc.enqueueReplaceState(t,t.state,null)}function Cc(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 wc(e){I(e)}function Tc(e){console.error(e)}function Ec(e){I(e)}function Dc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Oc(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 kc(e,t,n){return n=yo(n),n.tag=3,n.payload={element:null},n.callback=function(){Dc(e,t)},n}function Ac(e){return e=yo(e),e.tag=3,e}function jc(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(){Oc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Oc(t,n,r),typeof i!=`function`&&(yd===null?yd=new Set([this]):yd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Mc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&wa(t,n,i,!0),n=No.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Po===null?Kd():n.alternate===null&&od===0&&(od=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===eo?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===eo?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(R)return t=No.current,t===null?(r!==la&&(t=Error(a(423),{cause:r}),ga(Gi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Gi(r,n),i=kc(e.stateNode,r,i),So(e,i),od!==4&&(od=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==la&&(e=Error(a(422),{cause:r}),ga(Gi(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=Gi(o,n),fd===null?fd=[o]:fd.push(o),od!==4&&(od=2),t===null)return!0;r=Gi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=kc(n.stateNode,r,e),So(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`&&(yd===null||!yd.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Ac(i),jc(i,e,n,r),So(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Nc=Error(a(461)),Pc=!1;function Fc(e,t,n,r){t.child=e===null?ho(t,null,n,r):mo(t,e.child,n,r)}function Ic(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 Ea(t),r=es(e,t,n,o,a,i),s=is(),e!==null&&!Pc?(as(e,t,i),ul(e,t,i)):(R&&s&&ra(t),t.flags|=1,Fc(e,t,r,i),t.child)}function Lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Rc(e,t,a,r,i)):(e=zi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!dl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Kr:n,n(o,r)&&e.ref===t.ref)return ul(e,t,i)}return t.flags|=1,e=Li(a,r),e.ref=t.ref,e.return=t,t.child=e}function Rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Kr(a,r)&&e.ref===t.ref){if(Pc=!1,t.pendingProps=r=a,dl(e,i))e.flags&131072&&(Pc=!0);else return t.lanes=e.lanes,ul(e,t,i)}}return Kc(e,t,n,r,i)}function zc(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 Vc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ya(t,a===null?null:a.cachePool),a===null?jo():Ao(t,a),Lo(t);else return r=t.lanes=536870912,Vc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ya(t,null),jo(),Ro()):(Ya(t,a.cachePool),Ao(t,a),Ro(),t.memoizedState=null);return Fc(e,t,i,n),t.child}function Bc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vc(e,t,n,r,i){var a=Ja();return a=a===null?null:{parent:Na._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ya(t,null),jo(),Lo(t),e!==null&&wa(e,t,r,!0),t.childLanes=i,null}function Hc(e,t){return t=tl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Uc(e,t,n){return mo(t,e.child,null,n),e=Hc(t,t.pendingProps),e.flags|=2,zo(t),t.memoizedState=null,e}function Wc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(R){if(r.mode===`hidden`)return e=Hc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Bc(null,e);if(Io(t),(e=L)?(e=am(e,ca),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi===null?null:{id:$i,overflow:ea},retryLane:536870912,hydrationErrors:null},n=Hi(e),n.return=t,t.child=n,oa=t,L=null)):e=null,e===null)throw ua(t);return t.lanes=536870912,null}return Hc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Io(t),i){if(t.flags&256)t.flags&=-257,t=Uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558))}else if(Pc||wa(e,t,n,!1),i=(n&e.childLanes)!==0,Pc||i){if(Oo.current===null){if(r=K,r!==null&&(s=bt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ai(e,s),Fd(r,e,s),Nc;Kd()}t=Uc(e,t,n)}else e=o.treeContext,L=lm(s.nextSibling),oa=t,R=!0,sa=null,ca=!1,e!==null&&aa(t,e),t=Hc(t,r),t.flags|=134221824;return t}return e=Li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gc(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 Kc(e,t,n,r,i){return Ea(t),n=es(e,t,n,r,void 0,i),r=is(),e!==null&&!Pc?(as(e,t,i),ul(e,t,i)):(R&&r&&ra(t),t.flags|=1,Fc(e,t,n,i),t.child)}function qc(e,t,n,r,i,a){return Ea(t),t.updateQueue=null,n=ns(t,r,n,i),ts(e),r=is(),e!==null&&!Pc?(as(e,t,a),ul(e,t,a)):(R&&r&&ra(t),t.flags|=1,Fc(e,t,n,a),t.child)}function Jc(e,t,n,r,i){if(Ea(t),t.stateNode===null){var a=Ni,o=n.contextType;typeof o==`object`&&o&&(a=Da(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=bc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},_o(t),o=n.contextType,a.context=typeof o==`object`&&o?Da(o):Ni,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(yc(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&&bc.enqueueReplaceState(a,a.state,null),To(t,r,a,i),wo(),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=Cc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ni,typeof u==`object`&&u&&(o=Da(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)&&Sc(t,a,r,o),go=!1;var f=t.memoizedState;a.state=f,To(t,r,a,i),wo(),l=t.memoizedState,s||f!==l||go?(typeof d==`function`&&(yc(t,n,d,r),l=t.memoizedState),(c=go||xc(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,vo(e,t),o=t.memoizedProps,u=Cc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ni,typeof l==`object`&&l&&(c=Da(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)&&Sc(t,a,r,c),go=!1,f=t.memoizedState,a.state=f,To(t,r,a,i),wo();var p=t.memoizedState;o!==d||f!==p||go||e!==null&&e.dependencies!==null&&Ta(e.dependencies)?(typeof s==`function`&&(yc(t,n,s,r),p=t.memoizedState),(u=go||xc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ta(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,Gc(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=mo(t,e.child,null,i),t.child=mo(t,null,n,i)):Fc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ul(e,t,i),e}function Yc(e,t,n,r){return ma(),t.flags|=256,Fc(e,t,n,r),t.child}var Xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zc(e){return{baseLanes:e,cachePool:Xa()}}function Qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ud),e}function $c(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Bo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(R){if(i?Fo(t):Ro(),(e=L)?(e=am(e,ca),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi===null?null:{id:$i,overflow:ea},retryLane:536870912,hydrationErrors:null},n=Hi(e),n.return=t,t.child=n,oa=t,L=null)):e=null,e===null)throw ua(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Ro(),i=t.mode,a=tl({mode:`hidden`,children:a},i),r=Bi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Zc(n),r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(null,r)):(Fo(t),el(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return rl(e,t,a,o,r,c,s,n)}return i?(Ro(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Li(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Bi(i,a,n,null),i.flags|=2):i=Li(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Bc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Zc(n):(a=i.cachePool,a===null?a=Xa():(s=Na._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(e.child,r)):(Fo(t),n=e.child,e=n.sibling,n=Li(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 el(e,t){return t=tl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function tl(e,t){return e=Fi(22,e,null,t),e.lanes=0,e}function nl(e,t,n){return mo(t,e.child,null,n),e=el(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rl(e,t,n,r,i,o,s,c){if(n)return t.flags&256?(Fo(t),t.flags&=-257,nl(e,t,c)):t.memoizedState===null?(Ro(),o=i.fallback,s=t.mode,i=tl({mode:`visible`,children:i.children},s),o=Bi(o,s,c,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,mo(t,e.child,null,c),i=t.child,i.memoizedState=Zc(c),i.childLanes=Qc(e,r,c),t.memoizedState=Xc,Bc(null,i)):(Ro(),t.child=e.child,t.flags|=128,null);if(Fo(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,ga({value:i,source:null,stack:null})),nl(e,t,c)}if(Pc||wa(e,t,c,!1),r=(c&e.childLanes)!==0,Pc||r){if(Oo.current!==null)return nl(e,t,c);if(r=K,r!==null&&(i=bt(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,Ai(e,i),Fd(r,e,i),Nc;return om(o)||Kd(),nl(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,L=lm(o.nextSibling),oa=t,R=!0,sa=null,ca=!1,e!==null&&aa(t,e),t=el(t,i.children),t.flags|=134221824,t)}function il(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Sa(e.return,t,n)}function al(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Uo(n)===null&&(t=e),e=e.sibling}return t}function ol(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 sl(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 cl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Bo.current;if(t.flags&128)return Vo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Vo(t,o),i===`backwards`&&e!==null?(sl(e),Fc(e,t,r,n),sl(e)):Fc(e,t,r,n),r=R?Yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&il(e,n,t);else if(e.tag===19)il(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=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,sl(t)),ol(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&&Uo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ol(t,!0,n,null,a,r);break;case`together`:ol(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ol(t,!1,i,n,a,r)}return t.child}function ll(e,t,n){var r=t.pendingProps;return ba(t,t.type,r.value),Fc(e,t,r.children,n),t.child}function ul(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),sd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(wa(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=Li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ta(e)))}function fl(e,t,n){switch(t.tag){case 3:Oe(t,t.stateNode.containerInfo),ba(t,Na,e.memoizedState.cache),ma();break;case 27:case 5:Ae(t);break;case 4:Oe(t,t.stateNode.containerInfo);break;case 10:ba(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Io(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Fo(t),t.flags|=128,null;r=wa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?$c(e,t,n):(Fo(t),e=ul(e,t,n),e===null?null:e.sibling)}Fo(t);break;case 19:if(t.flags&128)return cl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(wa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return cl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Vo(t,Bo.current),r)break;return null;case 22:return t.lanes=0,zc(e,t,n,t.pendingProps);case 24:ba(t,Na,e.memoizedState.cache)}return ul(e,t,n)}function pl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Pc=!0;else{if(!dl(e,n)&&!(t.flags&128))return Pc=!1,fl(e,t,n);Pc=!!(e.flags&131072)}}else Pc=!1,R&&t.flags&1048576&&na(t,Yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ro(t.elementType),t.type=e,typeof e==`function`)Ii(e)?(r=Cc(e,r),t.tag=1,t=Jc(null,t,e,r,n)):(t.tag=0,t=Kc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===D){t.tag=11,t=Ic(null,t,e,r,n);break a}if(i===O){t.tag=14,t=Lc(null,t,e,r,n);break a}if(i===oe){t.tag=10,t.type=e,t=ll(null,t,n);break a}}throw t=_e(e)||e,Error(a(306,t,``))}}return t;case 0:return Kc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Cc(r,t.pendingProps),Jc(e,t,r,i,n);case 3:a:{if(Oe(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,vo(e,t),To(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ba(t,Na,r),r!==o.cache&&Ca(t,[Na],n,!0),wo(),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=Yc(e,t,r,n);break a}if(r!==i){i=Gi(Error(a(424)),t),ga(i),t=Yc(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(L=lm(e.firstChild),oa=t,R=!0,sa=null,ca=!0,n=ho(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ma(),r===i){t=ul(e,t,n);break a}Fc(e,t,r,n)}t=t.child}return t;case 26:return Gc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:R||(t.stateNode=fp(t.type,t.pendingProps,Ee.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ae(t),e===null&&R&&(r=t.stateNode=hm(t.type,t.pendingProps,Ee.current),oa=t,ca=!0,i=L,Sp(t.type)?(um=i,L=lm(r.firstChild)):L=i),Fc(e,t,t.pendingProps.children,n),Gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&R&&((i=r=L)&&(r=rm(r,t.type,t.pendingProps,ca),r===null?i=!1:(t.stateNode=r,oa=t,L=lm(r.firstChild),ca=!1,i=!0)),i||ua(t)),Ae(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=es(e,t,rs,null,null,n),sh._currentValue=i),Gc(e,t),Fc(e,t,r,n),t.child;case 6:return e===null&&R&&((e=n=L)&&(n=im(n,t.pendingProps,ca),n===null?e=!1:(t.stateNode=n,oa=t,L=null,e=!0)),e||ua(t)),null;case 13:return $c(e,t,n);case 4:return Oe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mo(t,null,r,n):Fc(e,t,r,n),t.child;case 11:return Ic(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Gc(e,t),Fc(e,t,r,n),t.child;case 8:return Fc(e,t,t.pendingProps.children,n),t.child;case 12:return Fc(e,t,t.pendingProps.children,n),t.child;case 10:return ll(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,Ea(t),i=Da(i),r=r(i),t.flags|=1,Fc(e,t,r,n),t.child;case 14:return Lc(e,t,t.type,t.pendingProps,n);case 15:return Rc(e,t,t.type,t.pendingProps,n);case 19:return cl(e,t,n);case 31:return Wc(e,t,n);case 22:return zc(e,t,n,t.pendingProps);case 24:return Ea(t),r=Da(Na),e===null?(i=Ja(),i===null&&(i=K,o=Pa(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},_o(t),ba(t,Na,i)):((e.lanes&n)!==0&&(vo(e,t),To(t,null,null,n),wo()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,ba(t,Na,r),r!==i.cache&&Ca(t,[Na],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ba(t,Na,r))),Fc(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:R&&ra(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Gc(e,t),Fc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function ml(e){e.flags|=4}function hl(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 io=eo,Qa}}else e.flags&=-16777217}function gl(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 io=eo,Qa}}function _l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:mt(),e.lanes|=t,dd|=t)}function vl(e,t){if(!R)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 U(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 yl(e,t,n){var r=t.pendingProps;switch(ia(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return U(t),null;case 1:return U(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),xa(Na),ke(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(pa(t)?ml(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ha())),U(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(ml(t),o===null?(U(t),hl(t,i,null,r,n)):(U(t),gl(t,o))):o?o===e.memoizedState?(U(t),t.flags&=-16777217):(ml(t),U(t),gl(t,o)):(e=e.memoizedProps,e!==r&&ml(t),U(t),hl(t,i,e,r,n)),null;case 27:if(je(t),n=Ee.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return U(t),t.subtreeFlags&=-33554433,null}e=we.current,pa(t)?da(t,e):(e=hm(i,r,n),t.stateNode=e,ml(t))}return U(t),t.subtreeFlags&=-33554433,null;case 5:if(je(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return U(t),t.subtreeFlags&=-33554433,null}if(o=we.current,pa(t))da(t,o);else{var s=lp(Ee.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&&ml(t)}}return U(t),t.subtreeFlags&=-33554433,hl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=Ee.current,pa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=oa,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||ua(t,!0)}else e=lp(e).createTextNode(r),e[Et]=t,t.stateNode=e}return U(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=pa(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 ma(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;U(t),e=!1}else n=ha(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(zo(t),t):(zo(t),null);if(t.flags&128)throw Error(a(558))}return U(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=pa(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 ma(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;U(t),i=!1}else i=ha(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(zo(t),t):(zo(t),null)}return zo(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),_l(t,t.updateQueue),U(t),null);case 4:return ke(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,U(t),null;case 10:return xa(t.type),U(t),null;case 19:if(Ho(t),r=t.memoizedState,r===null)return U(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)vl(r,!1);else{if(od!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Uo(e),o!==null){for(t.flags|=128,vl(r,!1),e=o.updateQueue,t.updateQueue=e,_l(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ri(n,e),n=n.sibling;return Vo(t,Bo.current&1|2),R&&ta(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&We()>_d&&(t.flags|=128,i=!0,vl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Uo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,_l(t,e),vl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!R)return U(t),null}else 2*We()-r.renderingStartTime>_d&&n!==536870912&&(t.flags|=128,i=!0,vl(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=We(),e.sibling=null,o=Bo.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||R?Vo(t,o):(n=o,N(No,t),N(Bo,n),Po===null&&(Po=t)),R&&ta(t,r.treeForkCount),e}return U(t),null;case 22:case 23:return zo(t),Mo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(U(t),t.subtreeFlags&6&&(t.flags|=8192)):U(t),n=t.updateQueue,n!==null&&_l(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&&M(qa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),xa(Na),U(t),null;case 25:return null;case 30:return t.flags|=33554432,U(t),null}throw Error(a(156,t.tag))}function bl(e,t){switch(ia(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xa(Na),ke(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return je(t),null;case 31:if(t.memoizedState!==null){if(zo(t),t.alternate===null)throw Error(a(340));ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(zo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ho(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 ke(),null;case 10:return xa(t.type),null;case 22:case 23:return zo(t),Mo(),e!==null&&M(qa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return xa(Na),null;case 25:return null;default:return null}}function xl(e,t){switch(ia(t),t.tag){case 3:xa(Na),ke();break;case 26:case 27:case 5:je(t);break;case 4:ke();break;case 31:t.memoizedState!==null&&zo(t);break;case 13:zo(t);break;case 19:Ho(t);break;case 10:xa(t.type);break;case 22:case 23:zo(t),Mo(),e!==null&&M(qa);break;case 24:xa(Na)}}function Sl(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 Cl(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 wl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Do(t,n)}catch(t){Z(e,e.return,t)}}}function Tl(e,t,n){n.props=Cc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function El(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=xi(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 Dl(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 Ol(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 kl(e){for(var t=e.return;t!==null&&(Ml(t)&&em(e.stateNode,t.stateNode),!jl(t));)t=t.return}function Al(e){for(var t=e.return;t!==null&&(Ml(t)&&tm(e.stateNode,t.stateNode),!jl(t));)t=t.return}function jl(e){return e.tag===5||e.tag===3||e.tag===27}function Ml(e){return e&&e.tag===7&&e.stateNode!==null}function Nl(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 Pl(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 Fl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Il(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Fl(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 Ll(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=Sn)),Ol(e,r),F=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ol(e,r),F=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),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){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 Bl=!1,Vl=null;function Hl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Bl=!0)}var Ul=null;function Wl(){var e=Ul;return Ul=null,e}var Gl=0;function Kl(e,t,n,r,i){return Gl=0,ql(e.child,t,n,r,i)}function ql(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);Bl=!0,Tp(o,Gl===0?t:t+`_`+Gl,n),Gl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||ql(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Jl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Jl(e.child,t)),e=e.sibling}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Yl(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=Ci(t.default,t.share),t!==`none`&&(Kl(e,n,t,null,!1)||Jl(e.child,!1))}e=e.sibling}}function Xl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=xi(r,n),a=Ci(r.default,n.paired?r.share:r.enter);a===`none`?Yl(e):Kl(e,i,a,null,!1)?(Yl(e),n.paired||t||Pd(e,r.onEnter)):Jl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e,t),e=e.sibling;else Yl(e)}function Zl(e){if(Vl!==null&&Vl.size!==0){var t=Vl;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=Ci(n.default,n.share);if(a!==`none`&&(Kl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Pd(e,n.onShare)):Jl(e.child,!1)),t.delete(r),t.size===0)break}}}Zl(e)}e=e.sibling}}}function Ql(e){if(e.tag===30){var t=e.memoizedProps,n=xi(t,e.stateNode),r=Vl===null?void 0:Vl.get(n),i=Ci(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Kl(e,n,i,null,!1)?r===void 0?Pd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Vl.delete(n),Pd(e,t.onShare)):Jl(e.child,!1)),Vl!==null&&Zl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Vl!==null&&Zl(e)}function $l(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=xi(t,e.stateNode);t=Ci(t.default,t.update),e.flags&=-5,t!==`none`&&Kl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&$l(e);e=e.sibling}}function eu(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,Jl(e.child,!1))}eu(e)}e=e.sibling}}function tu(e){if(e.tag===30)e.stateNode.paired=null,Jl(e.child,!1),eu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)tu(e),e=e.sibling;else eu(e)}function nu(e){for(e=e.child;e!==null;)e.tag===30?Jl(e.child,!1):e.subtreeFlags&33554432&&nu(e),e=e.sibling}function ru(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Gl<a.length){var l=a[Gl],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,Gl===0?n:n+`_`+Gl,i),s&&e.flags&4||(Ul===null&&(Ul=[]),Ul.push(c,Gl===0?r:r+`_`+Gl,t.memoizedProps)),Gl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:ru(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function iu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=xi(n,r),a=Ci(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;Gl=0,i=ru(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Pd(e,n.onUpdate))}else e.subtreeFlags&33554432&&iu(e,t);e=e.sibling}}var au=!1,W=!1,ou=!1,su=!1,cu=typeof WeakSet==`function`?WeakSet:Set,lu=null,uu=!1,du=!1,fu=!1,pu=!1;function mu(e,t,n){if(e=e.containerInfo,sp=gh,e=Zr(e),Qr(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,lu=t,t=n?9270:1024;lu!==null;){if(e=lu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Hl(e),hu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Ql(r),hu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Hl(e),hu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,lu=r):(n&&$l(e),hu(n))}}Vl=null}function hu(e){for(;lu!==null;){var t=lu,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=Cc(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=xi(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=Ci(i.default,i.update),i!==`none`&&Kl(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,lu=r;break}lu=t.return}}function gu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Iu(e,n),r&4&&Sl(5,n);break;case 1:if(Iu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Cc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}}r&64&&wl(n),r&512&&El(n,n.return);break;case 3:if(Iu(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{Do(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&zl(n);case 26:case 5:Iu(e,n),t===null&&r&4&&Nl(n),r&512&&El(n,n.return);break;case 12:Iu(e,n);break;case 31:Iu(e,n),r&4&&Tu(e,n);break;case 13:Iu(e,n),r&4&&Eu(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||au,!r){var a=t!==null&&t.memoizedState!==null||W;t=au,i=W,au=r,(W=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Ru(e,n,r)):Iu(e,n),au=t,W=i}break;case 30:Iu(e,n),r&512&&El(n,n.return);break;case 7:r&512&&El(n,n.return);default:Iu(e,n)}}function _u(e,t){for(e=e.child;e!==null;)vu(e,t),e=e.sibling}function vu(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)}yu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,F=!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&&_u(e,t);break;default:_u(e,t)}}function yu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:vu(n,r);break a;case 22:n.memoizedState===null&&yu(n,r);break a;default:yu(n,r)}}e=e.sibling}}function bu(e){var t=e.alternate;t!==null&&(e.alternate=null,bu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ft(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 xu=null,Su=!1;function Cu(e,t,n){for(n=n.child;n!==null;)wu(e,t,n),n=n.sibling}function wu(e,t,n){if(et&&typeof et.onCommitFiberUnmount==`function`)try{et.onCommitFiberUnmount($e,n)}catch{}switch(n.tag){case 26:W||Dl(n,t),Cu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!W&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:W||Dl(n,t),Al(n);var r=xu,i=Su;Sp(n.type)&&(xu=n.stateNode,Su=!1),Cu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),xu=r,Su=i;break;case 5:W||Dl(n,t),Al(n);case 6:if(n.tag===6&&Al(n),r=xu,i=Su,xu=null,Cu(e,t,n),xu=r,Su=i,xu!==null){if(Su)try{(xu.nodeType===9?xu.body:xu.nodeName===`HTML`?xu.ownerDocument.body:xu).removeChild(n.stateNode),F=!0}catch(e){Z(n,t,e)}else try{xu.removeChild(n.stateNode),F=!0}catch(e){Z(n,t,e)}}break;case 18:xu!==null&&(Su?(e=xu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(xu,n.stateNode));break;case 4:r=xu,i=Su,xu=n.stateNode.containerInfo,Su=!0,Cu(e,t,n),xu=r,Su=i;break;case 0:case 11:case 14:case 15:Cl(2,n,t),W||Cl(4,n,t),Cu(e,t,n);break;case 1:W||(Dl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Tl(n,t,r)),Cu(e,t,n);break;case 21:Cu(e,t,n);break;case 22:W=(r=W)||n.memoizedState!==null,Cu(e,t,n),W=r;break;case 30:Dl(n,t),Cu(e,t,n);break;case 7:W||Dl(n,t),Cu(e,t,n);break;default:Cu(e,t,n)}}function Tu(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 Eu(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 Du(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cu),t;default:throw Error(a(435,e.tag))}}function Ou(e,t){var n=Du(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function ku(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)){xu=l.stateNode,Su=!1;break a}break;case 5:xu=l.stateNode,Su=!1;break a;case 3:case 4:xu=l.stateNode.containerInfo,Su=!0;break a}l=l.return}if(xu===null)throw Error(a(160));wu(s,c,o),xu=null,Su=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ju(t,e,n),t=t.sibling}var Au=null;function ju(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}ku(t,e,n),Mu(e),i&4&&(Cl(3,e,e.return),Sl(3,e),Cl(5,e,e.return));break;case 1:ku(t,e,n),Mu(e),i&512&&(W||r===null||Dl(r,r.return)),i&64&&au&&(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=Au,ku(t,e,n),Mu(e),i&512&&(W||r===null||Dl(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(au)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[Nt]||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,Bt(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,Bt(r),t=r}e.stateNode=t}}else au||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Pl(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||W||t.parentNode.removeChild(t)):i.count--,n===null?au||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:ku(t,e,n),Mu(e),i&512&&(W||r===null||Dl(r,r.return)),r!==null&&i&4&&Pl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=ou,ou=!1,ku(t,e,n),ou=o,Mu(e),i&512&&(W||r===null||Dl(r,r.return)),e.flags&32){t=e.stateNode;try{mn(t,``),F=!0}catch(t){Z(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Pl(e,t,r===null?t:r.memoizedProps)),i&1024&&(su=!0);break;case 6:if(ku(t,e,n),Mu(e),i&4){if(e.stateNode===null)throw Error(a(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,F=!0}catch(t){Z(e,e.return,t)}}break;case 3:if(F=!1,Wm=null,o=Au,Au=bm(t.containerInfo),ku(t,e,n),Au=o,Mu(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){Z(e,e.return,t)}su&&(su=!1,Nu(e)),F=!1;break;case 4:i=ou,ou=au,r=Yt(),o=Au,Au=bm(e.stateNode.containerInfo),ku(t,e,n),Mu(e),Au=o,F&&du&&(fu=!0),F=r,ou=i;break;case 12:ku(t,e,n),Mu(e);break;case 31:ku(t,e,n),Mu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 13:ku(t,e,n),Mu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(hd=We()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=au,l=W,u=ou;au=c||o,ou=u||o,W=l||s,ku(t,e,n),W=l,ou=u,au=c,Mu(e),i&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||au||W||(t=s||W,n=au,r=W,au=o||au,W=t,Lu(e,2),au=n,W=r),!o&&ou||_u(e,o)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Ou(e,n))));break;case 19:ku(t,e,n),Mu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 30:i&512&&(W||r===null||Dl(r,r.return)),i=Yt(),o=du,s=(n&335544064)===n,c=e.memoizedProps,du=s&&Ci(c.default,c.update)!==`none`,ku(t,e,n),Mu(e),s&&r!==null&&F&&(e.flags|=4),du=o,F=i;break;case 21:break;case 7:i&512&&(W||r===null||Dl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:ku(t,e,n),Mu(e)}}function Mu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Fl(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Ml(i)){var o=i.stateNode;r===null?r=[o]:r.push(o)}if(jl(i))break;i=i.return}var s=r;if(n==null)throw Error(a(160));switch(n.tag){case 27:var c=n.stateNode;Rl(e,Il(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(mn(l,``),n.flags&=-33),Rl(e,Il(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ll(e,Il(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 Nu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Nu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Pu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Fu(t,e),t=t.sibling;else iu(t,!1)}function Fu(e,t){var n=e.alternate;if(n===null)Xl(e,!1);else switch(e.tag){case 3:if(pu=uu=!1,Wl(),Pu(t,e),!uu&&!fu){if(e=Ul,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`})),pu=!0}Ul=null;break;case 5:Pu(t,e);break;case 4:r=uu,uu=!1,Pu(t,e),uu&&(fu=!0),uu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Pu(t,e):Xl(e,!1));break;case 30:r=uu,i=Wl(),uu=!1,Pu(t,e),uu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=xi(a,o),o=xi(n.memoizedProps,o);var s=Ci(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Gl=0,t=ru(e,n,t,o,s,a,!0),Gl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Pd(e,e.memoizedProps.onUpdate),Ul=i):i!==null&&(i.push.apply(i,Ul),Ul=i),uu=e.flags&32?!0:r;break;default:Pu(t,e)}}function Iu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gu(e,t.alternate,t),t=t.sibling}function Lu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Cl(4,n,n.return),Lu(n,r);break;case 1:Dl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Tl(n,n.return,i),Lu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:Dl(n,n.return),n.tag!==5&&n.tag!==27||Al(n),Lu(n,r);break;case 6:Al(n);break;case 26:Dl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||W||i.parentNode.removeChild(i),Lu(n,r);break;case 22:n.memoizedState===null&&Lu(n,r);break;case 30:Dl(n,n.return),Lu(n,r);break;case 7:Dl(n,n.return);default:Lu(n,r)}e=e.sibling}}function Ru(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:Ru(i,a,n),Sl(4,a);break;case 1:if(Ru(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++)Eo(l[i],c)}catch(e){Z(r,r.return,e)}}s&&o&64&&wl(a),El(a,a.return);break;case 27:n&2&&zl(a);case 5:a.tag!==5&&a.tag!==27||kl(a),Ru(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 6:kl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||au||Km(bm(c.ownerDocument),a.type,c),Ru(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 12:Ru(i,a,n);break;case 31:Ru(i,a,n),s&&o&4&&Tu(i,a);break;case 13:Ru(i,a,n),s&&o&4&&Eu(i,a);break;case 22:a.memoizedState===null&&Ru(i,a,n),El(a,a.return);break;case 30:Ru(i,a,n),El(a,a.return);break;case 7:El(a,a.return);default:Ru(i,a,n)}t=t.sibling}}function zu(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&&Fa(n))}function Bu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Fa(e))}function Vu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Hu(e,t,n,r),t=t.sibling;else i&&nu(t)}function Hu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&tu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Vu(e,t,n,r),a&2048&&Sl(9,t);break;case 1:Vu(e,t,n,r);break;case 3:Vu(e,t,n,r),i&&pu&&(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&&Fa(a)));break;case 12:if(a&2048){Vu(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 Vu(e,t,n,r);break;case 31:Vu(e,t,n,r);break;case 13:Vu(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&&tu(t),o._visibility&2?Vu(e,t,n,r):(o._visibility|=2,Uu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&tu(s),o._visibility&2?Vu(e,t,n,r):Wu(e,t)),a&2048&&zu(s,t);break;case 24:Vu(e,t,n,r),a&2048&&Bu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Jl(a.child,!0),Jl(t.child,!0))),Vu(e,t,n,r);break;default:Vu(e,t,n,r)}}function Uu(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:Uu(a,o,s,c,i),Sl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Uu(a,o,s,c,i)):u._visibility&2?Uu(a,o,s,c,i):Wu(a,o),i&&l&2048&&zu(o.alternate,o);break;case 24:Uu(a,o,s,c,i),i&&l&2048&&Bu(o.alternate,o);break;default:Uu(a,o,s,c,i)}t=t.sibling}}function Wu(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:Wu(n,r),i&2048&&zu(r.alternate,r);break;case 24:Wu(n,r),i&2048&&Bu(r.alternate,r);break;default:Wu(n,r)}t=t.sibling}}var Gu=8192;function Ku(e,t,n){if(e.subtreeFlags&Gu)for(e=e.child;e!==null;)qu(e,t,n),e=e.sibling}function qu(e,t,n){switch(e.tag){case 26:Ku(e,t,n),e.flags&Gu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Au,e.memoizedState,e.memoizedProps));break;case 5:Ku(e,t,n),e.flags&Gu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Au;Au=bm(e.stateNode.containerInfo),Ku(e,t,n),Au=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Gu,Gu=16777216,Ku(e,t,n),Gu=r):Ku(e,t,n));break;case 30:if((e.flags&Gu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Vl===null&&(Vl=new Map),Vl.set(r,i)}Ku(e,t,n);break;default:Ku(e,t,n)}}function Ju(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 Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Qu(r,e)}Ju(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xu(e),e=e.sibling}function Xu(e){switch(e.tag){case 0:case 11:case 15:Yu(e),e.flags&2048&&Cl(9,e,e.return);break;case 3:Yu(e);break;case 12:Yu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zu(e)):Yu(e);break;default:Yu(e)}}function Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Qu(r,e)}Ju(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Cl(8,t,t.return),Zu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Zu(t));break;default:Zu(t)}e=e.sibling}}function Qu(e,t){for(;lu!==null;){var n=lu;switch(n.tag){case 0:case 11:case 15:Cl(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:Fa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,lu=r;else a:for(n=e;lu!==null;){r=lu;var i=r.sibling,a=r.return;if(bu(r),r===n){lu=null;break a}if(i!==null){i.return=a,lu=i;break a}lu=a}}}var $u={getCacheForType:function(e){var t=Da(Na),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Da(Na).controller.signal}},ed=typeof WeakMap==`function`?WeakMap:Map,G=0,K=null,q=null,J=0,Y=0,td=null,nd=!1,rd=!1,id=!1,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=0,fd=null,pd=null,md=!1,hd=0,gd=0,_d=1/0,vd=null,yd=null,bd=0,xd=null,Sd=null,Cd=0,wd=0,Td=null,Ed=null,Dd=null,Od=null,kd=null,Ad=0,jd=null;function Md(){return G&2&&J!==0?J&-J:A.T===null?Ct():Pf()}function Nd(){if(ud===0){if(!(J&536870912)||R){var e=st;st<<=1,!(st&3932160)&&(st=262144),ud=e}else ud=536870912}return e=No.current,e!==null&&(e.flags|=32),ud}function Pd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(xi(e.memoizedProps,n))),Od===null&&(Od=[]),Od.push(t.bind(null,r))}}function Fd(e,t,n){(e===K&&(Y===2||Y===9)||e.cancelPendingCommit!==null)&&(Vd(e,0),X(e,J,ud,!1)),gt(e,n),(!(G&2)||e!==K)&&(e===K&&(!(G&2)&&(cd|=n),od===4&&X(e,J,ud,!1)),Ef(e))}function Id(e,t,n){if(G&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){rd&&!r&&X(e,t,0,!1);break}if(n=e.current.alternate,o&&!Rd(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=fd;var l=c.current.memoizedState.isDehydrated;if(l&&(Vd(c,s).flags|=256),s=qd(c,s,!1),s!==2&&s!==6){if(id&&!l){c.errorRecoveryDisabledLanes|=o,cd|=o,i=4;break a}o=pd,pd=i,o!==null&&(pd===null?pd=o:pd.push.apply(pd,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Vd(e,0),X(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:X(r,t,ud,!nd);break a;case 2:pd=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=hd+300-We(),10<i)){if(X(r,t,ud,!nd),ut(r,0,!0)!==0)break a;Cd=t,r.timeoutHandle=gp(Ld.bind(null,r,n,pd,vd,md,t,ud,cd,dd,nd,o,`Throttled`,-0,0),i);break a}Ld(r,n,pd,vd,md,t,ud,cd,dd,nd,o,null,-0,0)}break}while(1);Ef(e)}function Ld(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:Sn},Vl=null,qu(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?hd-We():(a&4194048)===a?gd-We():0,m=eh(d,m),m!==null)){Cd=a,e.cancelPendingCommit=m(nf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),X(e,a,o,!l);return}nf(e,t,a,n,r,i,o,s,c,l,u,d)}function Rd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Gr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function X(e,t,n,r){t=ft(e,t),t&=~ld,t&=~cd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-nt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&vt(e,n,t)}function zd(){return G&6?!0:(Df(0,!1),!1)}function Bd(){if(q!==null){if(Y===0)var e=q.return;else e=q,ya=va=null,os(e),so=null,co=0,e=q;for(;e!==null;)xl(e.alternate,e),e=e.return;q=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()),Cd=0,Bd(),K=e,q=n=Li(e.current,null),J=t,Y=0,td=null,nd=!1,rd=dt(e,t),id=!1,dd=ud=ld=cd=sd=od=0,pd=fd=null,md=!1,ad=ft(e,t),Di(),n}function Hd(e,t){z=null,A.H=hc,t===Za||t===$a?(t=ao(),Y=3):t===Qa?(t=ao(),Y=4):Y=t===Nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,td=t,q===null&&(od=1,Dc(e,Gi(t,e.current)))}function Ud(){var e=No.current;return e===null?!0:(J&4194048)===J?Po===null:(J&62914560)===J||J&536870912?e===Po:!1}function Wd(){var e=A.H;return A.H=hc,e===null?hc:e}function Gd(){var e=A.A;return A.A=$u,e}function Kd(){od=4,nd||(J&4194048)!==J&&No.current!==null||(rd=!0),!(sd&134217727)&&!(cd&134217727)||K===null||X(K,J,ud,!1)}function qd(e,t,n){var r=G;G|=2;var i=Wd(),a=Gd();(K!==e||J!==t)&&(vd=null,Vd(e,t)),t=!1;var o=od;a:do try{if(Y!==0&&q!==null){var s=q,c=td;switch(Y){case 8:Bd(),o=6;break a;case 3:case 2:case 9:case 6:No.current===null&&(t=!0);var l=Y;if(Y=0,td=null,$d(e,s,c,l),n&&rd){o=0;break a}break;default:l=Y,Y=0,td=null,$d(e,s,c,l)}}Jd(),o=od;break}catch(t){Hd(e,t)}while(1);return t&&e.shellSuspendCounter++,ya=va=null,G=r,A.H=i,A.A=a,q===null&&(K=null,J=0,Di()),o}function Jd(){for(;q!==null;)Zd(q)}function Yd(e,t){var n=G;G|=2;var r=Wd(),i=Gd();K!==e||J!==t?(vd=null,_d=We()+500,Vd(e,t)):rd=dt(e,t);a:do try{if(Y!==0&&q!==null){t=q;var o=td;b:switch(Y){case 1:Y=0,td=null,$d(e,t,o,1);break;case 2:case 9:if(to(o)){Y=0,td=null,Qd(t);break}t=function(){Y!==2&&Y!==9||K!==e||(Y=7),Ef(e)},o.then(t,t);break a;case 3:Y=7;break a;case 4:Y=5;break a;case 7:to(o)?(Y=0,td=null,Qd(t)):(Y=0,td=null,$d(e,t,o,7));break;case 5:var s=null;switch(q.tag){case 26:s=q.memoizedState;case 5:case 27:var c=q;if(s?Ym(s):c.stateNode.complete){Y=0,td=null;var l=c.sibling;if(l!==null)q=l;else{var u=c.return;u===null?q=null:(q=u,ef(u))}break b}}Y=0,td=null,$d(e,t,o,5);break;case 6:Y=0,td=null,$d(e,t,o,6);break;case 8:Bd(),od=6;break a;default:throw Error(a(462))}}Xd();break}catch(t){Hd(e,t)}while(1);return ya=va=null,A.H=r,A.A=i,G=n,q===null?(K=null,J=0,Di(),od):0}function Xd(){for(;q!==null&&!He();)Zd(q)}function Zd(e){var t=pl(e.alternate,e,ad);e.memoizedProps=e.pendingProps,t===null?ef(e):q=t}function Qd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=qc(n,t,t.pendingProps,t.type,void 0,J);break;case 11:t=qc(n,t,t.pendingProps,t.type.render,t.ref,J);break;case 5:os(t);var r=t;r===oa&&(R?(fa(r),r.tag===5&&r.stateNode!=null&&(L=r.stateNode)):(fa(r),R=!0));default:xl(n,t),t=q=Ri(t,ad),t=pl(n,t,ad)}e.memoizedProps=e.pendingProps,t===null?ef(e):q=t}function $d(e,t,n,r){ya=va=null,os(t),so=null,co=0;var i=t.return;try{if(Mc(e,i,t,n,J)){od=1,Dc(e,Gi(n,e.current)),q=null;return}}catch(t){if(i!==null)throw q=i,t;od=1,Dc(e,Gi(n,e.current)),q=null;return}t.flags&32768?(R||r===1?e=!0:rd||J&536870912?e=!1:(nd=e=!0,(r===2||r===9||r===3||r===6)&&(r=No.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,nd);return}e=t.return;var n=yl(t.alternate,t,ad);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);od===0&&(od=5)}function tf(e,t){do{var n=bl(e.alternate,e);if(n!==null){n.flags&=32767,q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){q=e;return}q=e=n}while(e!==null);od=6,q=null}function nf(e,t,n,r,i,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do df();while(bd!==0);if(G&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));e===K&&(q=K=null,J=0),Sd=t,xd=e,Cd=n,Td=i,Ed=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(wd=s,s|=Ei,_t(e,n,s,r,i,a),Od=null,(n&335544064)===n?(kd=Ra(e),r=10262):(kd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(Je,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Bl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=A.T,A.T=null,i=j.p,j.p=2,a=G,G|=4;try{mu(e,t,n)}finally{G=a,j.p=i,A.T=r}}bd=1,Bl?Dd=Mp(o,e.containerInfo,kd,sf,cf,of,lf,ff,af,null,null):(sf(),cf(),lf())}function af(e){if(bd!==0){var t=xd.onRecoverableError;t(e,{componentStack:null})}}function of(){bd===3&&(bd=0,Fu(Sd,xd),bd=4)}function sf(){if(bd===1){bd=0;var e=xd,t=Sd,n=Cd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=A.T,A.T=null;var i=j.p;j.p=2;var a=G;G|=4;try{du=fu=!1,ju(t,e,n),n=cp;var o=Zr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Xr(s.ownerDocument.documentElement,s)){if(c!==null&&Qr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Yr(s,h),v=Yr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{G=a,j.p=i,A.T=r}}e.current=t,bd=2}}function cf(){if(bd===2){bd=0;var e=xd,t=Sd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=A.T,A.T=null;var r=j.p;j.p=2;var i=G;G|=4;try{gu(e,t.alternate,t)}finally{G=i,j.p=r,A.T=n}}bd=3}}function lf(){if(bd===4||bd===3){bd=0;var e=Dd;Dd=null,Ue();var t=xd,n=Sd,r=Cd,i=Ed,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?bd=5:(bd=0,Sd=xd=null,uf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(yd=null),St(r),n=n.stateNode,et&&typeof et.onCommitFiberRoot==`function`)try{et.onCommitFiberRoot($e,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=A.T,a=j.p,j.p=2,A.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{A.T=n,j.p=a}}if(i=Od,o=kd,kd=null,i!==null&&(Od=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);Cd&3&&df(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===jd?Ad++:(Ad=0,jd=t):(Ad=0,jd=null),Df(0,!1)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Fa(t)))}function df(){return Dd!==null&&(Dd.skipTransition(),Dd=null),sf(),cf(),lf(),ff()}function ff(){if(bd!==5)return!1;var e=xd,t=wd;wd=0;var n=St(Cd),r=A.T,i=j.p;try{j.p=32>n?32:n,A.T=null,n=Td,Td=null;var o=xd,s=Cd;if(bd=0,Sd=xd=null,Cd=0,G&6)throw Error(a(331));var c=G;if(G|=4,Xu(o.current),Hu(o,o.current,s,n),G=c,Df(0,!1),et&&typeof et.onPostCommitFiberRoot==`function`)try{et.onPostCommitFiberRoot($e,o)}catch{}return!0}finally{j.p=i,A.T=r,uf(e,t)}}function pf(e,t,n){t=Gi(n,t),t=kc(e.stateNode,t,2),e=bo(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`&&(yd===null||!yd.has(r))){e=Gi(n,e),n=Ac(2),r=bo(t,n,2),r!==null&&(jc(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 ed;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)||(id=!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,K===e&&(J&n)===n&&(od===4||od===3&&(J&62914560)===J&&300>We()-hd?G&2?ld|=n:Vd(e,0):ld|=n,dd===J&&(dd=0)),Ef(e)}function gf(e,t){t===0&&(t=mt()),e=Ai(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 Be(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-nt(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=J,a=ut(r,r===K?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=We(),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}bd!==0&&bd!==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-nt(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=K,n=J,n=ut(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Y===2||Y===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ve(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&&Ve(r),St(n)){case 2:case 8:n=qe;break;case 32:n=Je;break;case 268435456:n=Xe;break;default:n=Je}return r=jf.bind(null,e),n=Be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ve(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(bd!==0&&bd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(df()&&e.callbackNode!==n)return null;var r=J;return r=ut(e,e===K?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Id(e,r,t),Af(e,We()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(df())return null;Id(e,t,!0)}function Nf(){bp(function(){G&6?Be(Ke,Of):kf()})}function Pf(){if(Tf===0){var e=Va;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:xn(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 Un(`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);tc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),tc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<vi.length;Lf++){var Rf=vi[Lf];yi(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}yi(ui,`onAnimationEnd`),yi(di,`onAnimationIteration`),yi(fi,`onAnimationStart`),yi(`dblclick`,`onDoubleClick`),yi(`focusin`,`onFocus`),yi(`focusout`,`onBlur`),yi(pi,`onTransitionRun`),yi(mi,`onTransitionStart`),yi(hi,`onTransitionCancel`),yi(gi,`onTransitionEnd`),Gt(`onMouseEnter`,[`mouseout`,`mouseover`]),Gt(`onMouseLeave`,[`mouseout`,`mouseover`]),Gt(`onPointerEnter`,[`pointerout`,`pointerover`]),Gt(`onPointerLeave`,[`pointerout`,`pointerover`]),Wt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Wt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Wt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Wt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Wt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Wt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var 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){I(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){I(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[kt];n===void 0&&(n=t[kt]=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,Ht.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,!Mn||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=It(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}kn(function(){var r=a,i=wn(n),o=[];a:{var c=_i.get(e);if(c!==void 0){var l=Un,u=e;switch(e){case`keypress`:if(Rn(n)===0)break a;case`keydown`:case`keyup`:l=sr;break;case`focusin`:u=`focus`,l=Qn;break;case`focusout`:u=`blur`,l=Qn;break;case`beforeblur`:case`afterblur`:l=Qn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Xn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Zn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=ur;break;case ui:case di:case fi:l=$n;break;case gi:l=dr;break;case`scroll`:case`scrollend`:l=Gn;break;case`wheel`:l=fr;break;case`copy`:case`cut`:case`paste`:l=er;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=cr;break;case`submit`:l=lr;break;case`toggle`:case`beforetoggle`:l=pr}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=An(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!==Cn&&(u=n.relatedTarget||n.fromElement)&&(It(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?It(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=Xn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=cr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Rt(c),h=l==null?u:Rt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,It(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?te(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?Rt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Nr;else if(Dr(c)){if(Pr)_=Ur;else{_=Vr;var v=Br}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&vn(r.elementType)&&(_=Nr):_=Hr;if(_&&=_(e,r)){Or(o,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Rt(r):window,e){case`focusin`:(Dr(v)||v.contentEditable===`true`)&&(ei=v,ti=r,ni=null);break;case`focusout`:ni=ti=ei=null;break;case`mousedown`:ri=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ri=!1,ii(o,n,i);break;case`selectionchange`:if($r)break;case`keydown`:case`keyup`:ii(o,n,i)}var y;if(hr)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 Cr?xr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(vr&&n.locale!==`ko`&&(Cr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Cr&&(y=Ln()):(Pn=i,Fn=`value`in Pn?Pn.value:Pn.textContent,Cr=!0)),v=Jf(r,b),0<v.length&&(b=new tr(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=Sr(n),y!==null&&(b.data=y)))),(y=_r?wr(e,n):Tr(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new tr(`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=An(e,n),i!=null&&r.unshift(qf(e,i,a)),i=An(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=An(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=An(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===``||mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&mn(e,``+r);else return;break;case`className`:Qt(e,`class`,r);break;case`tabIndex`:Qt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Qt(e,n,r);break;case`style`:_n(e,r,o);return;case`data`:if(t!==`object`){Qt(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=xn(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=xn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Sn);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=xn(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),Xt(e,`popover`,r);break;case`xlinkActuate`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Xt(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=yn.get(n)||n,Xt(e,n,r);else return}F=!0}function tp(e,t,n,r,i,o){switch(n){case`style`:_n(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`)mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)mn(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=Sn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ut.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}F=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Xt(e,n,r)}return}F=!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)}}ln(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&&dn(e,!!r,n,!0):dn(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)}pn(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(vn(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&&(F=!0),o=m;break;case`name`:m!==f&&(F=!0),i=m;break;case`checked`:m!==f&&(F=!0),u=m;break;case`defaultChecked`:m!==f&&(F=!0),d=m;break;case`value`:m!==f&&(F=!0),s=m;break;case`defaultValue`:m!==f&&(F=!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)}}cn(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&&(F=!0),p=o;break;case`defaultValue`:o!==l&&(F=!0),c=o;break;case`multiple`:o!==l&&(F=!0),s=o;default:o!==l&&$(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?dn(e,!!n,n?[]:``,!1):dn(e,!!n,t,!0)):dn(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&&(F=!0),p=i;break;case`defaultValue`:i!==o&&(F=!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)}fn(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&&(F=!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(vn(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),Bt(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[Nt]||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=It(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=te(n,a,S),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=te(r,a,S),t===null?t=!1:(p(t,!0,x,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),Ft(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[Nt])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===Sn&&(e.onclick=null),Ft(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ft(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=j.d;j.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=Lt(e);t!==null&&t.tag===5&&t.type===`form`?rc(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=sn(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),Bt(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="`+sn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+sn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+sn(n.imageSizes)+`"]`)):i+=`[href="`+sn(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[Pt]=!0,o.onload=o.onerror=function(){Vt(o)}),Bt(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="`+sn(r)+`"][href="`+sn(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),Bt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=zt(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`);Bt(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=zt(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`),Bt(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=zt(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`),Bt(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=Ee.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=zt(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=zt(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=zt(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="`+sn(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[Pt]){r.loading=1;return}}else t=e.createElement(`link`),t[Pt]=!0,t.onload=t.onerror=Vt.bind(null,t),np(t,`link`,n),Bt(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="`+sn(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~="`+sn(n.href)+`"]`);if(r)return t.instance=r,Bt(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`),Bt(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,Bt(o),o;r=Im(n),(i=vm.get(i))&&Hm(r,i),o=(e.ownerDocument||e).createElement(`link`),Bt(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,Bt(i),i):(r=n,(i=vm.get(o))&&(r=C({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Bt(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[Nt]||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,Bt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Bt(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:oe,Provider:null,Consumer:null,_currentValue:be,_currentValue2:be,_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=Fi(3,null,null,t),e.current=a,a.stateNode=e,t=Pa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},_o(a),e}function uh(e){return e?(e=Ni,e):Ni}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=yo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=bo(e,r,t),n!==null&&(Fd(n,e,t),xo(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=Ai(e,67108864);t!==null&&Fd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=Md();t=xt(t);var n=Ai(e,t);n!==null&&Fd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=2,yh(e,t,n,r)}finally{j.p=a,A.T=i}}function vh(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=8,yh(e,t,n,r)}finally{j.p=a,A.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=Lt(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-nt(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(G&6)&&(_d=We()+500,Df(0,!1))}}break;case 31:case 13:s=Ai(a,2),s!==null&&Fd(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=wn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=It(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(Ge()){case Ke:return 2;case qe:return 8;case Je:case Ye:return 32;case Xe: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=Lt(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=It(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);Cn=r,n.target.dispatchEvent(r),Cn=null}else return t=Lt(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=Lt(n);a!==null&&(e.splice(t,3),t-=3,tc(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,Md(),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`));j.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:A,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{$e=Jh.inject(qh),et=Jh}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=wc,s=Tc,c=Ec;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)}})),$t=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=Qt()})),en={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`}]]};en.node;var tn=h(en),nn={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`}]]};nn.node;var rn=h(nn),an={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`}]]};an.node;var on=h(an),sn={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};sn.node;var cn=h(sn),ln={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`}]]};ln.node;var un=h(ln),dn={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`}]]};dn.node;var fn=h(dn),pn={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`}]]};pn.node;var mn=h(pn),hn={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`}]]};hn.node;var gn=h(hn),_n={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`]};_n.node;var vn=h(_n),yn={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};yn.node;var bn=h(yn),xn={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`}]]};xn.node;var Sn=h(xn),Cn={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`}]]};Cn.node;var wn=h(Cn),Tn={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`}]]};Tn.node;var En=h(Tn),Dn={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`}]]};Dn.node;var On=h(Dn),kn={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`}]]};kn.node;var An=h(kn),jn={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`}]]};jn.node;var Mn=h(jn),Nn={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`}]]};Nn.node;var Pn=h(Nn),Fn={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`}]]};Fn.node;var In=h(Fn),Ln={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`}]]};Ln.node;var Rn=h(Ln),zn={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`]};zn.node;var Bn=h(zn),Vn={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`}]]};Vn.node;var Hn=h(Vn),Un={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`}]]};Un.node;var Wn=h(Un),Gn={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`}]]};Gn.node;var Kn=h(Gn),qn={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`}]]};qn.node;var Jn=h(qn),Yn={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`]};Yn.node;var Xn=h(Yn),Zn={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`}]]};Zn.node;var Qn=h(Zn),$n={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`}]]};$n.node;var er=h($n),tr={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`}]]};tr.node;var nr=h(tr),rr={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`}]]};rr.node;var ir=h(rr),ar={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`}]]};ar.node;var or=h(ar),sr={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`}]]};sr.node;var cr=h(sr),lr={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`}]]};lr.node;var ur=h(lr),dr={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`}]]};dr.node;var fr=h(dr),pr={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`}]]};pr.node;var mr=h(pr),hr={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`}]]};hr.node;var gr=h(hr),_r={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`}]]};_r.node;var vr=h(_r),yr={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`}]]};yr.node;var br=h(yr),xr={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`}]]};xr.node;var Sr=h(xr),Cr={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`}]]};Cr.node;var wr=h(Cr),Tr={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`}]]};Tr.node;var Er=h(Tr),Dr={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`}]]};Dr.node;var Or=h(Dr),kr={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`}]]};kr.node;var Ar=h(kr),jr={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`]};jr.node;var Mr=h(jr),Nr={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`}]]};Nr.node;var Pr=h(Nr),Fr={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`}]]};Fr.node;var Ir=h(Fr),Lr={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`}]]};Lr.node;var Rr=h(Lr),zr={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`}]]};zr.node;var Br=h(zr),Vr={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`}]]};Vr.node;var Hr=h(Vr),Ur={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`}]]};Ur.node;var Wr=h(Ur),Gr={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`}]]};Gr.node;var Kr=h(Gr),qr={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`]};qr.node;var Jr=h(qr),Yr={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`]};Yr.node;var Xr=h(Yr),Zr={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`}]]};Zr.node;var Qr=h(Zr),$r={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`}]]};$r.node;var ei=h($r),ti={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`}]]};ti.node;var ni=h(ti),ri={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`]};ri.node;var ii=h(ri),ai={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`}]]};ai.node;var oi=h(ai),si={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`}]]};si.node;var ci=h(si),li={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`}]]};li.node;var ui=h(li),di={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};di.node;var fi=h(di),pi={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`}]]};pi.node;var mi=h(pi),hi={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`]};hi.node;var gi=h(hi),_i={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`}]]};_i.node;var vi=h(_i),yi={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`}]]};yi.node;var bi=h(yi),xi={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`]};xi.node;var Si=h(xi),Ci=$t(),I=t(i(),1),wi=2800;function Ti({size:e=72}){let[t,n]=(0,P.useState)(0);return(0,P.useEffect)(()=>{if(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=window.setInterval(()=>n(e=>(e+1)%Lt.length),wi);return()=>window.clearInterval(e)},[]),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`relative inline-block shrink-0`,style:{width:e,height:e},children:Lt.map((n,r)=>(0,I.jsx)(`span`,{className:`absolute inset-0`,style:{opacity:+(r===t),transition:`opacity 0.45s ease`},children:(0,I.jsx)(zt,{kind:n,size:e})},n))})}function Ei({className:e,style:t,onDark:n=!1}){return(0,I.jsxs)(`span`,{className:e,style:t,children:[`engenty`,(0,I.jsx)(`span`,{style:{color:n?`oklch(88% 0.11 75)`:`var(--ember, oklch(64% 0.195 35))`},children:`.`})]})}var Di=`wizards.theme`,Oi=new Set,ki=window.matchMedia(`(prefers-color-scheme: dark)`),Ai=`engenty_theme`;function ji(){let e=document.cookie.split(`;`).map(e=>e.trim()).find(e=>e.startsWith(`${Ai}=`))?.slice(14);return e===`light`||e===`dark`||e===`system`?e:null}function Mi(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=`${Ai}=${e}; Path=/; Max-Age=31536000; SameSite=Lax${r?`; Domain=${r}`:``}${i}`}function Ni(){try{let e=ji()??localStorage.getItem(Di);return e===`system`?null:e===`light`?`light`:`dark`}catch{return`dark`}}var Pi=0;function Fi(){return Pi>0?`dark`:Ni()??(ki.matches?`dark`:`light`)}function Ii(){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 Li(){let e=Fi()===`dark`;document.documentElement.classList.toggle(`dark`,e),Ii();for(let e of Oi)e()}ki.addEventListener(`change`,Li),ji()||Mi(Ni()??`system`),Li();function Ri(e){Mi(e??`system`);try{localStorage.setItem(Di,e??`system`)}catch{document.documentElement.classList.toggle(`dark`,(e??Fi())===`dark`);return}Li()}function zi(){return(0,P.useSyncExternalStore)(e=>(Oi.add(e),()=>Oi.delete(e)),Ni)}function Bi(){return(0,P.useSyncExternalStore)(e=>(Oi.add(e),()=>Oi.delete(e)),()=>Ni()??(ki.matches?`dark`:`light`))}function Vi(){return(0,P.useSyncExternalStore)(e=>(Oi.add(e),()=>Oi.delete(e)),()=>document.documentElement.classList.contains(`dark`)?`dark`:`light`)}var Hi=e=>`oklch(from ${Rt[Bt[e]??`cobalt`]} 0.34 calc(c * 0.6) h)`;function Ui(e){(0,P.useEffect)(()=>{if(!e)return;let t=document.documentElement;return Pi+=1,t.style.setProperty(`--stage`,e),Li(),()=>{--Pi,t.style.removeProperty(`--stage`),Li()}},[e])}function Wi(e){(0,P.useEffect)(()=>{if(!e)return;let t=document.documentElement;return t.style.setProperty(`--engenty-stage`,Hi(e)),Ii(),()=>{t.style.removeProperty(`--engenty-stage`),Ii()}},[e])}var Gi={name:`engenty wizards`,short:`wizards`},Ki=(0,P.lazy)(()=>It(()=>import(`./fluffy-engenty-ClRou7yu.js`).then(e=>({default:e.FluffyEngenty})),__vite__mapDeps([0,1,2,3])));function qi({kind:e,size:t=64,fluffy:n,coat:r,goggles:i=!1,interactive:a=!0}){let o=e||`round`,s=Vi(),c=r??(s===`dark`?`jelly`:`fur`);if(n&&t>=120&&(c===`fur`||s===`dark`))return(0,I.jsx)(P.Suspense,{fallback:(0,I.jsx)(zt,{goggles:i,kind:o,size:Math.round(t*.62)}),children:(0,I.jsx)(Ki,{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,I.jsxs)(`div`,{"aria-hidden":`true`,className:`relative flex items-center justify-center overflow-hidden`,style:{background:Hi(o),borderRadius:t*.28,height:t,width:t},children:[(0,I.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,I.jsx)(`div`,{className:`relative`,style:{marginTop:t*.04},children:(0,I.jsx)(P.Suspense,{fallback:(0,I.jsx)(zt,{goggles:i,kind:o,size:Math.round(e*.62)}),children:(0,I.jsx)(Ki,{goggles:i,coat:`jelly`,kind:o,size:e,quality:`medium`,interactive:a})})})]})}return(0,I.jsx)(zt,{goggles:i,kind:o,size:t,animated:a})}function Ji(){let e=Vi(),t=e===`dark`?`light`:`dark`;return(0,I.jsx)(y,{label:c(t===`dark`?`theme.dark`:`theme.light`),onClick:()=>Ri(t),children:e===`dark`?(0,I.jsx)(ci,{className:`size-4`}):(0,I.jsx)(Er,{className:`size-4`})})}function Yi(e){return Object.fromEntries(Ye.filter(t=>e[t]?.startsWith(`apple:`)).map(e=>[e,``]))}function Xi(e){return e.split(/\s+/).map(e=>e[0]??``).join(``).slice(0,2).toUpperCase()}function Zi(){let e=ia().data?.limits.projects;return e===null||(e??1)>1}function Qi(){return ia().data?.limits.build??!0}function $i(){return ia().data?.limits.create??!0}function ea(){let e=ia().data;return!e||e.mode===`local`||e.tenant.role!==`member`}function ta(e){return e.mode===`managed`?e.credits:e.models?.source===`account`?e.account?.credits??null:null}function na(){let e=At();return t=>{ke(t),e.setQueryData([`me`],e=>e&&{...e,lang:t}),N.put(`/api/studio/lang`,{lang:t}).catch(()=>void 0)}}function ra(e){let t=At();(0,P.useEffect)(()=>{if(!e)return;if(e.lang){ke(e.lang);return}let n=_e();n&&(t.setQueryData([`me`],e=>e&&{...e,lang:n}),N.put(`/api/studio/lang`,{lang:n}).catch(()=>void 0))},[e,t])}function ia(){return Ft({queryKey:[`me`],queryFn:async()=>{try{return await N.get(`/api/studio/me`)}catch(e){if(e instanceof m&&e.status===401)return null;throw e}},staleTime:3e4})}function aa(e=!0){return Ft({queryKey:[`projects`],queryFn:()=>N.get(`/api/studio/projects`),enabled:e})}var oa=`wz.project`;function L(){try{return localStorage.getItem(oa)}catch{return null}}var R=L(),sa=new Set;function ca(e){R=e;try{localStorage.setItem(oa,e)}catch{}for(let e of sa)e()}function la(){let e=aa(),t=(0,P.useSyncExternalStore)(e=>(sa.add(e),()=>sa.delete(e)),()=>R),n=e.data??[];return{project:n.find(e=>e.id===t)??n[0]??null,projects:n,select:ca,loading:e.isLoading}}function ua(e,t){return Ft({queryKey:[`cloud`,e],queryFn:()=>N.get(`/api/studio/wizards/${e}/cloud`),enabled:t})}function da(e){return e instanceof m&&e.body?.code===`read_only`?e.message:null}async function fa(){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=`${Ae}/`;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}${Ae}/`,t.append(n),document.body.append(t),t.submit()}function pa(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 ma=`wizards.wish`,ha=1;function ga(e){try{localStorage.setItem(ma,JSON.stringify({text:e,at:Date.now()}))}catch{}}function _a(){try{let e=JSON.parse(localStorage.getItem(ma)??`null`);if(typeof e?.text==`string`&&typeof e.at==`number`&&Date.now()-e.at<ha*864e5)return e.text}catch{}return null}function va(){try{localStorage.removeItem(ma)}catch{}}var ya=e({defineStudioPlugin:()=>ba});function ba(e){return e}var xa=ve(),Sa=[`left`,`top`,`right`,`bottom`],Ca=`wizards.appbar`,wa={position:`left`},Ta=e=>Sa.includes(e);function Ea(){try{let e=JSON.parse(localStorage.getItem(Ca)??`null`);return{position:Ta(e?.position)?e.position:wa.position}}catch{return wa}}var Da=Ea(),Oa=new Set;function ka(e){Da={...Da,...e};try{localStorage.setItem(Ca,JSON.stringify(Da))}catch{}for(let e of Oa)e()}function Aa(){return wt(`(max-width: 767px)`)}function ja(){let e=(0,P.useSyncExternalStore)(e=>(Oa.add(e),()=>Oa.delete(e)),()=>Da),t=Aa();return(0,P.useMemo)(()=>t?{position:e.position===`top`?`top`:`bottom`,phone:t}:{...e,phone:t},[e,t])}var Ma=e=>e===`top`||e===`bottom`;function Na(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 Pa={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.`}};function Fa(e,t){let n=e?.[t];return typeof n==`boolean`?n:Object.hasOwn(Pa,t)?Pa[t].default:!1}function Ia(e=Pa){let t={};for(let[n,r]of Object.entries(e))t[n]=r.default;return t}function La(){return Ft({queryKey:[`config`],queryFn:async()=>{let e=await N.get(`/api/config`);return me(e.publicUrl),e},staleTime:6e4})}function Ra(){let e=ia(),t=La();return e.data?.features??t.data?.features??Ia()}function za(e){return Fa(Ra(),e)}var Ba=()=>matchMedia(`(display-mode: standalone)`).matches||matchMedia(`(display-mode: window-controls-overlay)`).matches||navigator.standalone===!0,Va=()=>navigator.userAgent,Ha=()=>/iPhone|iPad|iPod/.test(Va())||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1,Ua=()=>!!navigator.userAgentData?.brands?.length||/Chrome|Chromium|Edg/.test(Va()),Wa=()=>/Safari/.test(Va())&&!/Chrome|Chromium|Edg|Firefox|FxiOS/.test(Va());function Ga(e){return e?`prompt`:/Android/.test(Va())?Ua()?`android`:`none`:Ha()?`ios`:Wa()?`mac`:Ua()?`chromium`:`none`}function Ka(){return(0,P.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 qa(e){try{await e.prompt()}finally{window.wizardInstall=null,window.dispatchEvent(new Event(`wizard-install`))}}var Ja=(0,P.lazy)(()=>It(()=>import(`./AboutDialog-D4mvc-zu.js`).then(e=>({default:e.AboutDialog})),__vite__mapDeps([4,1,2,5,6,7,8])));function Ya(e){return D(`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 Xa({me:e}){let{project:t}=la();return(0,I.jsx)(Td,{me:e,placement:`bar-start`,label:t?.name??c(`nav.project`),className:e=>D(`block rounded-lg transition`,e?`ring-2 ring-ink/80 ring-offset-2 ring-offset-sidebar`:`hover:shadow-soft`),children:(0,I.jsx)(wd,{project:t})})}var Za={left:Mr,top:Ir,right:Pr,bottom:Ar},Qa=[{pick:`light`,icon:ci,label:`appbar.light`},{pick:`dark`,icon:Er,label:`appbar.dark`},{pick:null,icon:wr,label:`appbar.system`}];function $a({at:e,onClose:t}){let{position:n,phone:r}=ja(),i=zi(),a=r?[`top`,`bottom`]:Sa,o=(0,P.useRef)(null);xd(o,!0,t);let[s,l]=(0,P.useState)({x:0,y:0});(0,P.useLayoutEffect)(()=>{let e=o.current?.getBoundingClientRect();e&&l({x:Math.min(0,window.innerWidth-8-e.right),y:Math.min(0,window.innerHeight-8-e.bottom)})},[]);let u=`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`,d=`px-3 pt-2 pb-1 font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.07em]`;return(0,I.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,I.jsx)(`div`,{className:d,children:c(`appbar.position`)}),a.map(e=>{let r=Za[e];return(0,I.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===n,className:D(u,e===n&&`text-ink`),onClick:()=>{ka({position:e}),t()},children:[(0,I.jsx)(r,{className:`size-4`}),(0,I.jsx)(`span`,{className:`flex-1`,children:c(`appbar.${e}`)}),e===n?(0,I.jsx)(Ie,{className:`size-4 text-ember-strong`}):null]},e)}),(0,I.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,I.jsx)(`div`,{className:d,children:c(`appbar.theme`)}),Qa.map(({pick:e,icon:n,label:r})=>(0,I.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===i,className:D(u,e===i&&`text-ink`),onClick:()=>{Ri(e),t()},children:[(0,I.jsx)(n,{className:`size-4`}),(0,I.jsx)(`span`,{className:`flex-1`,children:c(r)}),e===i?(0,I.jsx)(Ie,{className:`size-4 text-ember-strong`}):null]},r))]})}function eo({me:e}){let t=Vd(),{position:n}=ja(),r=Ma(n),[i,a]=(0,P.useState)(null),[o,s]=(0,P.useState)(!1),u=e=>{e.preventDefault(),a({x:e.clientX,y:e.clientY})},d=(0,P.useRef)(null),f=(0,P.useRef)(!1),p=()=>{d.current&&=(window.clearTimeout(d.current.timer),null)};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`aside`,{"aria-label":Gi.name,onContextMenu:u,onPointerDown:e=>{if(e.pointerType===`mouse`)return;p();let{clientX:t,clientY:n}=e;d.current={x:t,y:n,timer:window.setTimeout(()=>{d.current=null,f.current=!0,window.setTimeout(()=>{f.current=!1},700),a({x:t,y:n})},500)}},onPointerMove:e=>{d.current&&Math.hypot(e.clientX-d.current.x,e.clientY-d.current.y)>10&&p()},onPointerUp:p,onPointerCancel:p,onPointerLeave:p,onClickCapture:e=>{f.current&&(f.current=!1,e.preventDefault(),e.stopPropagation())},className:D(`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,I.jsx)(`button`,{type:`button`,onClick:()=>s(!0),title:c(`about.title`),"aria-label":c(`about.title`),className:D(`grid shrink-0 place-items-center rounded-lg transition hover:bg-ink/10`,r?`size-11`:`h-12 w-11`),children:(0,I.jsx)(Ti,{size:32})}),(0,I.jsx)(`div`,{className:r?`ml-1`:`mt-2`,children:(0,I.jsx)(Xa,{me:e})}),(0,I.jsx)(l,{to:`/space`,title:c(`nav.project`),"aria-label":c(`nav.project`),className:({isActive:e})=>D(Ya(e),r?`ml-1.5`:`mt-2`),children:(0,I.jsx)(Xn,{className:`size-5`})}),t.nav.length?(0,I.jsx)(`div`,{className:D(`shrink-0 bg-border`,r?`mx-2 h-7 w-px`:`my-3 h-px w-7`)}):null,(0,I.jsx)(`nav`,{className:D(`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,I.jsx)(pf,{of:e,children:(0,I.jsx)(l,{to:e.to,title:e.label(),"aria-label":e.label(),className:({isActive:e})=>Ya(e),children:(0,I.jsx)(e.icon,{className:`size-5`})})},e.serial))}),(0,I.jsxs)(`div`,{className:D(`flex shrink-0 items-center gap-2`,r?`flex-row pl-3`:`flex-col pt-3`),children:[(0,I.jsx)(l,{to:`/settings`,title:c(`nav.settings`),"aria-label":c(`nav.settings`),className:({isActive:e})=>Ya(e),children:(0,I.jsx)(ei,{className:`size-5`})}),(0,I.jsx)(kd,{me:e,placement:`bar-end`})]}),i?(0,I.jsx)($a,{at:i,onClose:()=>a(null)}):null]}),o?(0,I.jsx)(P.Suspense,{fallback:null,children:(0,I.jsx)(Ja,{open:!0,me:e,onClose:()=>s(!1)})}):null]})}var to=`wz.readAloud`,no=typeof window<`u`&&`speechSynthesis`in window&&`SpeechSynthesisUtterance`in window;function ro(){try{return localStorage.getItem(to)===`1`}catch{return!1}}function io(e){try{localStorage.setItem(to,e?`1`:`0`)}catch{}}function ao(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 oo(e,t=E,n=!1){if(!no||!e.trim())return;let r=window.speechSynthesis;n&&r.cancel();let i=_(t),a=new SpeechSynthesisUtterance(e.trim().slice(0,2e3));a.lang=i;let o=ao(i);o&&(a.voice=o),r.speak(a)}function so(e,t=E){if(!no||!e.trim())return Promise.resolve();let n=window.speechSynthesis;n.cancel();let r=_(t),i=new SpeechSynthesisUtterance(e.trim().slice(0,4e3));i.lang=r;let a=ao(r);return a&&(i.voice=a),new Promise(e=>{i.onend=()=>e(),i.onerror=()=>e(),n.speak(i)})}function co(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 lo(){no&&window.speechSynthesis.cancel()}function uo(){let[e,t]=(0,P.useState)(()=>no&&ro()),n=(0,P.useCallback)(e=>{t(e),io(e),e||lo()},[]);return(0,P.useEffect)(()=>{no&&window.speechSynthesis.getVoices()},[]),(0,P.useEffect)(()=>()=>lo(),[]),[e,n]}function fo(e,t,n,r){let i=(0,P.useRef)(null);(0,P.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&&oo(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`)&&lo();for(let e of o)if(e.who===`bot`&&e.spoken!==!1){let n=r(e.key);n&&oo(n,t)}},[e,t,n,r])}var po=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function mo(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 ho(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 go({names:e,previews:t,fileUrl:n}){let r=e.filter(e=>t?.[e]||n&&po.test(e)),i=e.filter(e=>!r.includes(e));return(0,I.jsxs)(`div`,{className:`flex flex-col items-end gap-1.5`,children:[r.map(e=>{let r=t?.[e]??n?.(e)??``;return(0,I.jsx)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,title:e,children:(0,I.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,I.jsx)(`div`,{className:`flex flex-wrap justify-end gap-1.5`,children:i.map(e=>(0,I.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,I.jsx)(ft,{className:`size-3 shrink-0 text-ink-4`}),(0,I.jsx)(`span`,{className:`truncate`,children:e})]},e))}):null]})}function _o(e,t){let n=At(),[r,i]=(0,P.useState)([]),[o,s]=(0,P.useState)(`idle`),[l,u]=(0,P.useState)(null),[d,f]=(0,P.useState)(null),[p,m]=(0,P.useState)(null),[h,g]=(0,P.useState)(null),_=(0,P.useRef)(null);return(0,P.useEffect)(()=>{if(e){if(_.current!==e.id){_.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:d,thought:p,startedAt:h,error:l,send:async(r,l=[])=>{if(!e||!(r.trim()||l.length)||o!==`idle`)return!1;if(u(null),g(Date.now()),m(null),l.length){s(`thinking`);try{for(let t of l){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":E},body:t});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??n.statusText)}}}catch(t){return u(t.message),s(`idle`),g(null),await n.invalidateQueries({queryKey:[`wizard`,e.id]}),!1}let t=`${c(`editor.attached`)}: ${l.map(e=>e.name).join(`, `)}`;r=r.trim()?`${r}\n\n${t}`:t}let d=`p-${Date.now()}`;i(e=>[...e,{id:`u-${Date.now()}`,role:`user`,content:r,previews:mo(l)},{id:d,role:`assistant`,content:``,pending:!0}]),s(`thinking`),f(null);let p=!1;try{await b(`/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===d?{...t,content:t.content+e}:t))}else if(e===`activity`)f(JSON.parse(n));else if(e===`thought`)m(JSON.parse(n));else if(e===`building`)s(`building`);else if(e===`done`){p=!0;let e=JSON.parse(n);i(t=>t.map(t=>t.id===d?{...t,content:e.reply,changed:e.changed,pending:!1}:t)),e.changed&&t(e.draft,e.revision)}else e===`error`&&(p=!0,u(JSON.parse(n).message))}),p||u(c(`editor.chatBroken`))}catch(e){u(e.message)}finally{f(null),m(null),g(null),i(e=>e.filter(e=>!(e.id===d&&!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 vo(e){let[t,n]=(0,P.useState)(()=>Date.now());return(0,P.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 yo(e){return e<60?`${e} s`:`${Math.floor(e/60)}:${String(e%60).padStart(2,`0`)} min`}function bo({chat:e,thought:t,className:n,spinner:r=`size-3.5`}){let i=vo(e.startedAt);return(0,I.jsxs)(`div`,{className:D(`min-w-0`,n),children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(M,{className:D(`shrink-0`,r)}),(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:e.activity??(e.phase===`building`?c(`editor.building`):c(`editor.thinking`))}),i===null?null:(0,I.jsx)(`span`,{className:`shrink-0 text-ink-4 tabular-nums`,children:yo(i)})]}),t&&e.thought?(0,I.jsx)(`p`,{className:`mt-0.5 truncate pl-5.5 text-[0.75rem] text-ink-4`,children:e.thought}):null]})}function xo({message:e,fileUrl:t}){let{text:n,names:r}=ho(e.content);return(0,I.jsxs)(`div`,{className:`ml-8 flex flex-col items-end gap-1.5 self-end`,children:[e.signal?(0,I.jsx)(`span`,{className:`text-[0.6875rem] text-ink-4`,children:c(`assistant.signalled`)}):null,r.length?(0,I.jsx)(go,{names:r,previews:e.previews,fileUrl:t}):null,n?(0,I.jsx)(`div`,{className:`rounded-xl rounded-br-md bg-paper-2 px-4 py-2.5 text-[0.875rem] leading-relaxed`,children:(0,I.jsx)(`span`,{className:`whitespace-pre-wrap`,children:n})}):null]})}function So({chat:e,avatar:t,changedLabel:n,card:r,calls:i,foot:a}){return(0,I.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.messages.map(o=>o.role===`user`?(0,I.jsx)(xo,{message:o,fileUrl:e.fileUrl},o.id):(0,I.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,I.jsx)(`div`,{className:`shrink-0`,children:(0,I.jsx)(qi,{kind:t,size:28,interactive:!1})}),(0,I.jsxs)(`div`,{className:`min-w-0 pt-0.5 text-[0.875rem]`,children:[o.source===`mcp`?(0,I.jsxs)(`div`,{className:`mb-1 inline-flex items-center gap-1.5 text-[0.75rem] text-ink-3`,children:[(0,I.jsx)(Hr,{className:`size-3`}),` `,c(`editor.viaClient`,{client:o.client??`MCP`})]}):null,i?i(o):null,o.content?(0,I.jsx)(gt,{text:o.content,className:`text-[0.875rem]`}):null,r&&o.cards?.length?(0,I.jsx)(`div`,{className:`mt-2 flex flex-col gap-2`,children:o.cards.map(e=>(0,I.jsx)(P.Fragment,{children:r(e)},e.id))}):null,o.pending?(0,I.jsx)(bo,{chat:e,thought:!0,className:`mt-1 text-[0.8125rem] text-ink-3`}):null,o.changed?(0,I.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,I.jsx)(ae,{className:`size-3`}),` `,n]}):null,a?a(o):null]})]},o.id))})}function Co({chat:e,avatar:t,hello:n=c(`editor.chatHello`),placeholder:r=c(`editor.composer`),changedLabel:i=c(`editor.flowChanged`),compact:a,intro:o,closed:s,card:l}){let[u,d]=(0,P.useState)(!1),f=(0,P.useRef)(null),p=(0,P.useRef)(null);(0,P.useEffect)(()=>{f.current?.scrollTo({top:f.current.scrollHeight,behavior:`smooth`})},[e.messages,e.phase]);let m=!a||u,h=e.messages.at(-1),[g,_]=(0,P.useState)(!1),v=(0,P.useRef)(0),y=e=>!s&&e.dataTransfer.types.includes(`Files`);return(0,I.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,onDragEnter:e=>{y(e)&&(e.preventDefault(),v.current+=1,_(!0))},onDragOver:e=>{y(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)},onDragLeave:()=>{v.current=Math.max(0,v.current-1),v.current===0&&_(!1)},onDrop:e=>{y(e)&&(e.preventDefault(),v.current=0,_(!1),p.current?.add(Array.from(e.dataTransfer.files).map(Ge)),p.current?.focus())},children:[g?(0,I.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,I.jsx)(ft,{className:`size-6`}),c(`editor.dropToAttach`)]}):null,(0,I.jsxs)(`div`,{className:a?D(`mb-2 flex min-h-0 flex-col overflow-hidden rounded-2xl bg-card shadow-overlay ring-1 ring-border`,!(h||e.error)&&`hidden`):`contents`,children:[a&&(h||e.error)?(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":u,"aria-label":c(`editor.thread`),onClick:()=>d(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||u)&&h?.pending?(0,I.jsx)(bo,{chat:e,className:`flex-1`}):(0,I.jsx)(`span`,{className:D(`min-w-0 flex-1 truncate`,e.error&&`text-rose`),children:e.error??(u?c(`editor.thread`):h?.content)}),u?(0,I.jsx)(Pt,{className:`size-4 shrink-0`}):(0,I.jsx)(bn,{className:`size-4 shrink-0`})]}):null,(0,I.jsxs)(`div`,{ref:f,className:D(`min-h-0 flex-1 overflow-y-auto px-5 py-5`,!m&&`hidden`),children:[e.messages.length===0&&!s?o??(0,I.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,I.jsx)(qi,{kind:t,size:32,interactive:!1}),(0,I.jsx)(`p`,{className:`pt-1 text-[0.875rem] text-ink-2 leading-relaxed`,children:n})]}):null,(0,I.jsx)(So,{chat:e,avatar:t,changedLabel:i,card:l}),e.error?(0,I.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,I.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,I.jsx)(Le,{ref:p,floating:a,className:a?void 0:`p-3`,placeholder:r,disabled:e.phase!==`idle`,onSend:(t,n)=>e.send(t,n)})]})}function wo(e,t){return[{id:`account`,label:c(`account.title`),icon:gi,menu:!0},...e?.mode===`managed`&&Fa(e.features,`teamPlans`)?[{id:`team`,label:c(`team.title`),icon:vi,menu:!0}]:[],{id:`connectors`,label:c(`connectors.title`),icon:Hr,menu:!0},{id:`models`,label:c(`local.title`),icon:Pn,menu:!0},{id:`integrate`,label:c(`integrate.nav`),icon:gn,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:c(`plugins.title`),icon:un,menu:!1}]:[]]}var To=`wizards.assistant`,Eo={place:`center`,free:null,height:null,dev:!1};function Do(){try{let e=JSON.parse(localStorage.getItem(To)??`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 Eo}}var Oo=Do(),ko=new Set,Ao=()=>{for(let e of ko)e()},jo=e=>(ko.add(e),()=>ko.delete(e));function Mo(e){Oo={...Oo,...e};try{localStorage.setItem(To,JSON.stringify(Oo))}catch{}Ao()}function No(){return(0,P.useSyncExternalStore)(jo,()=>Oo)}var Po=64,Fo=12,Io=null,Lo=new Set;function Ro(e){Io=e;for(let e of Lo)e()}function zo(){return(0,P.useSyncExternalStore)(e=>(Lo.add(e),()=>Lo.delete(e)),()=>Io)}var Bo=e=>Math.min(600,e-24);function Vo(e,t,n){let r=Bo(e.width),i=e.height-Fo-t;return{center:{left:(e.width-r)/2,top:i,width:r,height:t},right:e.width>=r+24+240?{left:e.width-Fo-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 Ho=e=>e>=Bo(e)+24+240;function Uo(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=Bo(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=Vo(s,u,t.sidebar),m=s.height-(f+u)<Po,h=s.width-(d+l)<Po||window.innerWidth-r.clientX<Po,g=null;if(p.sidebar&&h&&(!m||window.innerWidth-r.clientX<Po))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},Ro(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(Ro(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 Wo=1300,z=3e3;function B(){let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition}var Go=typeof window<`u`&&(!!B()||!!navigator.mediaDevices?.getUserMedia&&typeof MediaRecorder<`u`);function Ko(e){return e.toLowerCase().split(/[\s\-–—/]+/).map(e=>e.replace(/[^\p{L}\p{N}]/gu,``)).filter(Boolean)}function qo(e,t){let n=new Set(Ko(t)),r=Ko(e);return r.length<2||r.filter(e=>n.has(e)).length/r.length>=.75}function Jo(e){let[t,n]=(0,P.useState)(`off`),[r,i]=(0,P.useState)(!1),[o,s]=(0,P.useState)(null),[c,l]=(0,P.useState)(null),[u,d]=(0,P.useState)(0),[f,p]=(0,P.useState)(``),[m,h]=(0,P.useState)(null),g=(0,P.useRef)(`off`),_=(0,P.useRef)(!1),v=(0,P.useRef)(null),y=(0,P.useRef)(null),b=(0,P.useRef)(null),ee=(0,P.useRef)(``),x=(0,P.useRef)({text:``,until:0}),S=(0,P.useRef)(``),te=(0,P.useRef)(null),C=(0,P.useRef)(null),ne=(0,P.useRef)(e);ne.current=e;let re=(0,P.useRef)(m);re.current=m;let w=(0,P.useCallback)(e=>{g.current=e,n(e)},[]),T=(0,P.useCallback)(()=>{lo(),b.current&&=(b.current.pause(),null),ee.current=``},[]),ie=(0,P.useCallback)(()=>{te.current&&=(clearTimeout(te.current),null);let e=S.current.trim();S.current=``,p(``),e&&g.current!==`off`&&(w(`thinking`),C.current=ne.current.messages.at(-1)?.id??null,ne.current.send(e).then(e=>{!e&&g.current===`thinking`&&w(`listening`)}))},[w]),ae=(0,P.useCallback)((e,t)=>{if(!(_.current||g.current===`off`||g.current===`thinking`)){if(g.current===`speaking`){if(qo(e,ee.current))return;T(),w(`listening`)}else if(Date.now()<x.current.until&&qo(e,x.current.text))return;p(e),t&&(S.current=`${S.current} ${e}`.trim(),p(S.current)),te.current&&clearTimeout(te.current),te.current=setTimeout(ie,Wo)}},[ie,T,w]),oe=(0,P.useCallback)(()=>{let e=B();if(!e||v.current)return;let t=new e;t.continuous=!0,t.interimResults=!0,t.lang=ct[E],t.onresult=e=>{let t=``;for(let n=e.resultIndex;n<e.results.length;n++){let r=e.results[n];r.isFinal?ae(r[0].transcript,!0):t+=r[0].transcript}t.trim()&&ae(`${S.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(oe,200)},v.current=t;try{t.start()}catch{v.current=null}},[ae]),D=(0,P.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()<x.current.until?x.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 N.upload(`/api/studio/transcribe`,e);if(t&&qo(n,t)){w(`listening`);return}S.current=n,ie()}catch(e){l(e.message),w(`listening`)}}},n.start()}}else n&&Date.now()-i>Wo&&n.stop();setTimeout(o,100)};o()},[ie,w]),se=(0,P.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,C.current=ne.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(),B()?oe():D(e,n),re.current||N.get(`/api/studio/assistant/voice`).then(({way:e})=>h({way:e,natural:e===`key`||e===`local`})).catch(()=>h({way:`none`,natural:!1}))},[oe,D,w]),ce=(0,P.useCallback)(()=>{w(`off`),s(null),p(``),d(0),S.current=``,te.current&&clearTimeout(te.current),v.current?.abort(),v.current=null,T();for(let e of y.current?.getTracks()??[])e.stop();y.current=null},[T,w]),O=(0,P.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`&&oe()},[oe]),k=(0,P.useCallback)(async e=>{let t=co(e);if(!t){w(`listening`);return}w(`speaking`),ee.current=t;let n=re.current?.natural&&re.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 so(t,E),b.current=null,ee.current=``,g.current===`speaking`&&(x.current={text:t,until:Date.now()+z},S.current=``,p(``),v.current?.abort(),w(`listening`))},[w]);return(0,P.useEffect)(()=>{if(t!==`thinking`||e.phase!==`idle`)return;let n=e.messages.at(-1);n?.role===`assistant`&&n.id!==C.current&&!n.pending?(C.current=n.id,k(n.content)):e.error&&w(`listening`)},[t,e.phase,e.messages,e.error,k,w]),(0,P.useEffect)(()=>()=>ce(),[ce]),{state:t,muted:r,since:o,error:c,level:u,heard:f,voice:m,setNatural:e=>h(t=>t&&{...t,natural:e}),start:se,end:ce,toggleMute:O}}var Yo=new Map,Xo={},Zo=new Set;function Qo(){Xo=Object.assign({},...Yo.values());for(let e of Zo)e()}function V(){return(0,P.useSyncExternalStore)(e=>(Zo.add(e),()=>Zo.delete(e)),()=>Xo)}function $o(){for(let e of Yo.values())e.onChanged?.()}function es(e){let t=(0,P.useId)(),n=(0,P.useRef)(e);n.current=e;let{onChanged:r,...i}=e,a=JSON.stringify(i);(0,P.useEffect)(()=>{Yo.set(t,{...JSON.parse(a),onChanged:()=>n.current.onChanged?.()}),Qo()},[t,a]),(0,P.useEffect)(()=>()=>{Yo.delete(t),Qo()},[t])}function ts(){let e=document.getElementById(Nd);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 ns(){let{title:e,hello:t,placeholder:n,suggestions:r,compact:i,onChanged:a,...o}=Xo,s=md().map(e=>e.label),c=window.location.pathname,l=c.startsWith(Ae)?c.slice(Ae.length)||`/`:c,u=ts(),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 rs=()=>document.getElementById(`studio-scroll`)??document.body,is=`[data-assist],h1,h2,h3,h4,button,a[href],input,textarea,select,[role=switch],[role=checkbox],[role=tab],[contenteditable=true]`,as=150,os=0;function ss(e){return e.dataset.assist?e.dataset.assist:(e.dataset.assistRef||(os+=1,e.dataset.assistRef=`e${os}`),e.dataset.assistRef)}var H=(e,t=120)=>(e??``).replace(/\s+/g,` `).trim().slice(0,t);function cs(e){if(e.dataset.assistLabel)return H(e.dataset.assistLabel);let t=e.getAttribute(`aria-label`);if(t)return H(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 H(t.getAttribute(`data-assist-section`)||t.textContent)}if(e.id){let t=document.querySelector(`label[for="${CSS.escape(e.id)}"]`);if(t)return H(t.textContent)}let n=e.closest(`label`);if(n&&n!==e)return H(n.textContent);let r=e.parentElement?.querySelector(`label`);return r&&(e.matches(`input,textarea,select`)||e.getAttribute(`role`)===`switch`)?H(r.textContent):H(e.textContent||e.placeholder||e.getAttribute(`title`)||``)}function ls(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 H(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 H(e.textContent,600)}function us(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 ds(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 fs(e){let t=e.getBoundingClientRect();return t.bottom>0&&t.top<window.innerHeight&&t.right>0&&t.left<window.innerWidth}function ps(e,t){let n=[];for(let r of e.querySelectorAll(is)){if(n.length>=as)break;if(!ds(r)||t&&!fs(r))continue;let e=us(r),i=cs(r);if(!i&&e!==`field`)continue;let a=e===`field`?ls(r):void 0,o=r.disabled||r.getAttribute(`aria-disabled`)===`true`;n.push({ref:ss(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 ms(e){let t=rs(),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(is)){if(!ds(e))continue;let t=cs(e).toLowerCase();if(t===i)return e;!a&&t.includes(i)&&(a=e)}return a}var hs=e=>({error:`Nothing on the page is "${e}". look_at_page lists what is there.`}),gs=null,_s=0,vs=new Set;function ys(e){gs=e;for(let e of vs)e()}function bs(){return(0,P.useSyncExternalStore)(e=>(vs.add(e),()=>vs.delete(e)),()=>gs)}var xs=null,Ss=()=>[];function Cs(e,t){xs=e,Ss=t}function ws(e){let t=e.split(/[?#]/)[0]||`/`;return Ss().some(e=>RegExp(`^${e.split(`/`).map(e=>e.startsWith(`:`)?e.endsWith(`?`)?`(?:[^/]+)?`:`[^/]+`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`/`)}/?$`).test(t))}var Ts=()=>new Promise(e=>setTimeout(e,450));function Es(e){return!e.startsWith(`/`)||e.startsWith(`//`)||/^\/(api|w|s)\//.test(e)||!(xs&&ws(e))?!1:(xs(e),!0)}var Ds={type:`string`,description:`A ref or area from look_at_page, or the label`},Os=new Map;function ks(){return[...Os.values()].map(({name:e,description:t,parameters:n})=>({name:e,description:t,parameters:n}))}var As=[{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(`/`)&&ws(t)?(xs?.(t),await Ts(),{opened:t,pageTools:ks()}):{error:`The studio has no page "${t}".`,pages:Ss()}}},{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:Ds,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=ms(String(e??``));return a?(a.scrollIntoView({behavior:`smooth`,block:`center`}),await Ts(),_s+=1,ys({id:_s,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:cs(a)}):hs(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(rs().scrollTop),items:ps(rs(),!0),pageTools:ks()})},{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:Ds},required:[`target`]},run:({target:e})=>{let t=ms(String(e??``));return t?{area:cs(t),items:ps(t,!1),text:H(t.innerText,4e3)}:hs(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:Ds,value:{type:[`string`,`number`,`boolean`]}},required:[`target`,`value`]},run:async({target:e,value:t})=>{let n=ms(String(e??``));if(!n)return hs(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)||H(e.textContent).toLowerCase()===String(t).toLowerCase());if(!e)return{error:`No such choice.`,choices:[...n.options].map(e=>H(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:cs(n),value:ls(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=Os.get(String(e??``));return n?n.run(t??{}):{error:`The page offers no tool "${String(e)}".`,pageTools:ks()}}},{name:`scroll_to`,description:`Scroll an element of the page into view.`,parameters:{type:`object`,properties:{target:Ds},required:[`target`]},run:async({target:e})=>{let t=ms(String(e??``));return t?(t.scrollIntoView({behavior:`smooth`,block:`start`}),await Ts(),{at:cs(t)}):hs(String(e))}}];function js(e,t,n){let r=(0,P.useRef)(n);r.current=n;let i=JSON.stringify(t);(0,P.useEffect)(()=>{if(As.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 Os.set(e,{name:e,description:t,parameters:n??{type:`object`,properties:{}},run:e=>r.current(e)}),()=>{Os.delete(e)}},[e,i])}function Ms(){return[...As,...Os.values()].map(({name:e,description:t,parameters:n})=>({name:e,description:t,parameters:n}))}async function Ns(e,t){let n=As.find(t=>t.name===e)??Os.get(e);if(!n)return null;try{return{result:await n.run(t??{})}}catch(e){return{result:{error:e.message}}}}var Ps=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 Fs(e){return e.type.startsWith(`image/`)&&/logo/i.test(e.name)?`logo`:/^(image|video|audio)\//.test(e.type)?`asset`:`document`}var Is=0,Ls=e=>`${e}-${Date.now()}-${++Is}`,Rs=(0,P.createContext)(null);function zs(){return(0,P.useContext)(Rs)}function Bs(){let e=Vd(),t=ia(),n=(0,P.useRef)([]);return n.current=[`/`,`/new`,`/edit/:id`,`/space`,`/space/:group`,`/settings`,...wo(t.data,e).map(e=>`/settings/${e.id}`),...e.pages.map(e=>e.path)],(0,P.useCallback)(()=>n.current,[])}function Vs({children:e}){let t=At(),n=ia(),r=!!n.data,{project:i}=la(),a=v(),o=Bs();(0,P.useEffect)(()=>{Cs(e=>a(e),o)},[a,o]);let s=Ft({queryKey:[`assistant-chat`],queryFn:()=>N.get(`/api/studio/assistant/chat`),enabled:r,staleTime:1/0}),l=Ft({queryKey:[`assistant-layout`],queryFn:()=>N.get(`/api/studio/assistant/layout`),enabled:r,staleTime:1/0}),[u,d]=(0,P.useState)([]),[f,p]=(0,P.useState)(`idle`),[m,h]=(0,P.useState)(null),[g,_]=(0,P.useState)(null),[y,ee]=(0,P.useState)(null),[x,S]=(0,P.useState)(!1),[te,C]=(0,P.useState)(!1),[ne,re]=(0,P.useState)({kind:`chat`}),[w,T]=(0,P.useState)(null),[ie,ae]=(0,P.useState)([]),[oe,D]=(0,P.useState)([]),se=(0,P.useRef)(null),ce=No(),O=!!n.data?.assistantDev,k=O&&ce.dev,le=(0,P.useRef)(k);le.current=k,(0,P.useEffect)(()=>{s.data&&se.current!==s.data.id&&(se.current=s.data.id,d(s.data.messages.map(Ps)))},[s.data]);let ue=(0,P.useCallback)(e=>{T(e),t.setQueryData([`assistant-layout`],{layout:e}),N.put(`/api/studio/assistant/layout`,{layout:e}).catch(()=>null)},[t]),de=(0,P.useRef)(null),fe=(0,P.useCallback)(()=>(de.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]),$o(),de.current=null})(),de.current),[t,i]),pe=(0,P.useRef)([]),me=(0,P.useCallback)(e=>{pe.current=e(pe.current),ae(pe.current)},[]),he=(0,P.useRef)(!1),ge=(0,P.useRef)(null),_e=(0,P.useRef)(null),ve=(0,P.useRef)(()=>void 0),ye=(0,P.useRef)(new Set),A=(0,P.useCallback)(()=>{let e=ge.current?.runId;if(e)for(let t of pe.current)t.way!==`signal`||ye.current.has(t.id)||(ye.current.add(t.id),N.post(`/api/studio/assistant/run/${e}/signal`,{ref:t.id,message:t.text}).catch(()=>{}))},[]),j=(0,P.useCallback)(async(e,t)=>{if(!t.length)return e;if(!i||i.readOnly)return h(c(`assistant.filesNeedSpace`)),null;try{for(let e of t)await N.upload(`/api/studio/projects/${i.id}/files?kind=${Fs(e)}`,e)}catch(e){return h(e.message),await fe(),null}await fe();let n=`${c(`editor.attached`)}: ${t.map(e=>e.name).join(`, `)}`;return e.trim()?`${e}\n\n${n}`:n},[i,fe]),be=(0,P.useCallback)(async(e,n)=>{he.current=!0,h(null),p(`thinking`),ee(Date.now()),ys(null),re({kind:`chat`});let r=Ls(`p`),a=Ls(`u`);d(t=>[...t,{id:a,role:`user`,content:e,previews:n},{id:r,role:`assistant`,content:``,pending:!0}]),_(null);let o=e=>{let t=r;d(n=>n.map(n=>n.id===t?e(n):n))},s=le.current?{id:Ls(`t`),message:e,startedAt:Date.now(),endedAt:null,prompt:null,events:[]}:null;s&&D(e=>[...e,s]);let l=(e,t)=>{s&&(s.events.push({at:Date.now(),event:e,data:t}),e===`prompt`&&(s.prompt=t),D(e=>e.map(e=>e.id===s.id?{...s}:e)))},u=new AbortController,f={runId:null,abort:u,stopped:!1};ge.current=f;let m=!1;try{await b(`/api/studio/assistant/turn`,{message:e,projectId:i?.id,page:ns(),tools:Ms(),lang:E,...le.current?{debug:!0}:{}},(e,t)=>{let n=JSON.parse(t);switch(l(e,n),e){case`run_started`:{let e=n;f.runId=e.runId,d(t=>t.map(t=>t.id===a?{...t,id:e.messageId}:t)),A();break}case`text`:o(e=>({...e,content:e.content+n.delta}));break;case`activity`:_(n.label);break;case`tool_call`:{let e=n;o(t=>({...t,toolCalls:[...t.toolCalls??[],e]})),Ns(e.toolCallName,e.args).then(t=>{t&&N.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`:fe();break;case`step`:o(e=>({...e,steps:[...e.steps??[],n]}));break;case`signal`:{let e=n,t=r;r=Ls(`p`),me(t=>t.filter(t=>t.id!==e.ref)),d(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`:{m=!0;let e=n;o(t=>({...t,id:e.messageId,content:e.reply,changed:e.changed,pending:!1}));break}case`error`:m=!0,h(n.message)}},u.signal),m||h(c(`editor.chatBroken`))}catch(e){f.stopped||h(e.message)}finally{s&&(s.endedAt=Date.now(),D(e=>e.map(e=>e.id===s.id?{...s}:e))),ge.current=null,_(null),ee(null),d(e=>e.filter(e=>!(e.pending&&!e.content&&!e.cards?.length&&!e.toolCalls?.length&&!e.steps?.length)).map(e=>({...e,pending:!1}))),p(`idle`),he.current=!1,await de.current,t.invalidateQueries({queryKey:[`me`]})}let g=_e.current;if(_e.current=null,!(g||f.stopped)){let e=pe.current.filter(e=>e.way===`signal`),t=e.length?e:pe.current.filter(e=>e.way===`queue`).slice(0,1);t.length&&(me(e=>e.filter(e=>!t.includes(e))),g=t.map(e=>e.text).join(`
|
|
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===``||mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&mn(e,``+r);else return;break;case`className`:Qt(e,`class`,r);break;case`tabIndex`:Qt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Qt(e,n,r);break;case`style`:_n(e,r,o);return;case`data`:if(t!==`object`){Qt(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=xn(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=xn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Sn);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=xn(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),Xt(e,`popover`,r);break;case`xlinkActuate`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Xt(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=yn.get(n)||n,Xt(e,n,r);else return}F=!0}function tp(e,t,n,r,i,o){switch(n){case`style`:_n(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`)mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)mn(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=Sn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ut.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}F=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Xt(e,n,r)}return}F=!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)}}ln(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&&dn(e,!!r,n,!0):dn(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)}pn(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(vn(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&&(F=!0),o=m;break;case`name`:m!==f&&(F=!0),i=m;break;case`checked`:m!==f&&(F=!0),u=m;break;case`defaultChecked`:m!==f&&(F=!0),d=m;break;case`value`:m!==f&&(F=!0),s=m;break;case`defaultValue`:m!==f&&(F=!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)}}cn(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&&(F=!0),p=o;break;case`defaultValue`:o!==l&&(F=!0),c=o;break;case`multiple`:o!==l&&(F=!0),s=o;default:o!==l&&$(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?dn(e,!!n,n?[]:``,!1):dn(e,!!n,t,!0)):dn(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&&(F=!0),p=i;break;case`defaultValue`:i!==o&&(F=!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)}fn(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&&(F=!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(vn(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),Bt(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[Nt]||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=It(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=te(n,a,S),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=te(r,a,S),t===null?t=!1:(p(t,!0,x,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),Ft(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[Nt])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===Sn&&(e.onclick=null),Ft(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ft(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=j.d;j.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=Lt(e);t!==null&&t.tag===5&&t.type===`form`?rc(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=sn(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),Bt(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="`+sn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+sn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+sn(n.imageSizes)+`"]`)):i+=`[href="`+sn(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[Pt]=!0,o.onload=o.onerror=function(){Vt(o)}),Bt(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="`+sn(r)+`"][href="`+sn(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),Bt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=zt(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`);Bt(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=zt(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`),Bt(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=zt(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`),Bt(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=Ee.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=zt(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=zt(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=zt(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="`+sn(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[Pt]){r.loading=1;return}}else t=e.createElement(`link`),t[Pt]=!0,t.onload=t.onerror=Vt.bind(null,t),np(t,`link`,n),Bt(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="`+sn(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~="`+sn(n.href)+`"]`);if(r)return t.instance=r,Bt(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`),Bt(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,Bt(o),o;r=Im(n),(i=vm.get(i))&&Hm(r,i),o=(e.ownerDocument||e).createElement(`link`),Bt(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,Bt(i),i):(r=n,(i=vm.get(o))&&(r=C({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Bt(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[Nt]||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,Bt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Bt(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:oe,Provider:null,Consumer:null,_currentValue:be,_currentValue2:be,_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=Fi(3,null,null,t),e.current=a,a.stateNode=e,t=Pa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},_o(a),e}function uh(e){return e?(e=Ni,e):Ni}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=yo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=bo(e,r,t),n!==null&&(Fd(n,e,t),xo(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=Ai(e,67108864);t!==null&&Fd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=Md();t=xt(t);var n=Ai(e,t);n!==null&&Fd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=2,yh(e,t,n,r)}finally{j.p=a,A.T=i}}function vh(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=8,yh(e,t,n,r)}finally{j.p=a,A.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=Lt(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-nt(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(G&6)&&(_d=We()+500,Df(0,!1))}}break;case 31:case 13:s=Ai(a,2),s!==null&&Fd(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=wn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=It(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(Ge()){case Ke:return 2;case qe:return 8;case Je:case Ye:return 32;case Xe: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=Lt(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=It(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);Cn=r,n.target.dispatchEvent(r),Cn=null}else return t=Lt(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=Lt(n);a!==null&&(e.splice(t,3),t-=3,tc(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,Md(),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`));j.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:A,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{$e=Jh.inject(qh),et=Jh}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=wc,s=Tc,c=Ec;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)}})),$t=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=Qt()})),en={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`}]]};en.node;var tn=h(en),nn={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`}]]};nn.node;var rn=h(nn),an={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`}]]};an.node;var on=h(an),sn={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};sn.node;var cn=h(sn),ln={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`}]]};ln.node;var un=h(ln),dn={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`}]]};dn.node;var fn=h(dn),pn={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`}]]};pn.node;var mn=h(pn),hn={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`}]]};hn.node;var gn=h(hn),_n={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`]};_n.node;var vn=h(_n),yn={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};yn.node;var bn=h(yn),xn={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`}]]};xn.node;var Sn=h(xn),Cn={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`}]]};Cn.node;var wn=h(Cn),Tn={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`}]]};Tn.node;var En=h(Tn),Dn={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`}]]};Dn.node;var On=h(Dn),kn={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`}]]};kn.node;var An=h(kn),jn={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`}]]};jn.node;var Mn=h(jn),Nn={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`}]]};Nn.node;var Pn=h(Nn),Fn={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`}]]};Fn.node;var In=h(Fn),Ln={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`}]]};Ln.node;var Rn=h(Ln),zn={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`]};zn.node;var Bn=h(zn),Vn={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`}]]};Vn.node;var Hn=h(Vn),Un={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`}]]};Un.node;var Wn=h(Un),Gn={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`}]]};Gn.node;var Kn=h(Gn),qn={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`}]]};qn.node;var Jn=h(qn),Yn={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`]};Yn.node;var Xn=h(Yn),Zn={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`}]]};Zn.node;var Qn=h(Zn),$n={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`}]]};$n.node;var er=h($n),tr={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`}]]};tr.node;var nr=h(tr),rr={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`}]]};rr.node;var ir=h(rr),ar={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`}]]};ar.node;var or=h(ar),sr={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`}]]};sr.node;var cr=h(sr),lr={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`}]]};lr.node;var ur=h(lr),dr={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`}]]};dr.node;var fr=h(dr),pr={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`}]]};pr.node;var mr=h(pr),hr={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`}]]};hr.node;var gr=h(hr),_r={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`}]]};_r.node;var vr=h(_r),yr={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`}]]};yr.node;var br=h(yr),xr={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`}]]};xr.node;var Sr=h(xr),Cr={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`}]]};Cr.node;var wr=h(Cr),Tr={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`}]]};Tr.node;var Er=h(Tr),Dr={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`}]]};Dr.node;var Or=h(Dr),kr={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`}]]};kr.node;var Ar=h(kr),jr={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`]};jr.node;var Mr=h(jr),Nr={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`}]]};Nr.node;var Pr=h(Nr),Fr={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`}]]};Fr.node;var Ir=h(Fr),Lr={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`}]]};Lr.node;var Rr=h(Lr),zr={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`}]]};zr.node;var Br=h(zr),Vr={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`}]]};Vr.node;var Hr=h(Vr),Ur={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`}]]};Ur.node;var Wr=h(Ur),Gr={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`}]]};Gr.node;var Kr=h(Gr),qr={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`]};qr.node;var Jr=h(qr),Yr={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`]};Yr.node;var Xr=h(Yr),Zr={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`}]]};Zr.node;var Qr=h(Zr),$r={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`}]]};$r.node;var ei=h($r),ti={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`}]]};ti.node;var ni=h(ti),ri={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`]};ri.node;var ii=h(ri),ai={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`}]]};ai.node;var oi=h(ai),si={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`}]]};si.node;var ci=h(si),li={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`}]]};li.node;var ui=h(li),di={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};di.node;var fi=h(di),pi={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`}]]};pi.node;var mi=h(pi),hi={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`]};hi.node;var gi=h(hi),_i={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`}]]};_i.node;var vi=h(_i),yi={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`}]]};yi.node;var bi=h(yi),xi={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`]};xi.node;var Si=h(xi),Ci=$t(),I=t(i(),1),wi=2800;function Ti({size:e=72}){let[t,n]=(0,P.useState)(0);return(0,P.useEffect)(()=>{if(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=window.setInterval(()=>n(e=>(e+1)%Lt.length),wi);return()=>window.clearInterval(e)},[]),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`relative inline-block shrink-0`,style:{width:e,height:e},children:Lt.map((n,r)=>(0,I.jsx)(`span`,{className:`absolute inset-0`,style:{opacity:+(r===t),transition:`opacity 0.45s ease`},children:(0,I.jsx)(zt,{kind:n,size:e})},n))})}function Ei({className:e,style:t,onDark:n=!1}){return(0,I.jsxs)(`span`,{className:e,style:t,children:[`engenty`,(0,I.jsx)(`span`,{style:{color:n?`oklch(88% 0.11 75)`:`var(--ember, oklch(64% 0.195 35))`},children:`.`})]})}var Di=`wizards.theme`,Oi=new Set,ki=window.matchMedia(`(prefers-color-scheme: dark)`),Ai=`engenty_theme`;function ji(){let e=document.cookie.split(`;`).map(e=>e.trim()).find(e=>e.startsWith(`${Ai}=`))?.slice(14);return e===`light`||e===`dark`||e===`system`?e:null}function Mi(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=`${Ai}=${e}; Path=/; Max-Age=31536000; SameSite=Lax${r?`; Domain=${r}`:``}${i}`}function Ni(){try{let e=ji()??localStorage.getItem(Di);return e===`system`?null:e===`light`?`light`:`dark`}catch{return`dark`}}var Pi=0;function Fi(){return Pi>0?`dark`:Ni()??(ki.matches?`dark`:`light`)}function Ii(){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 Li(){let e=Fi()===`dark`;document.documentElement.classList.toggle(`dark`,e),Ii();for(let e of Oi)e()}ki.addEventListener(`change`,Li),ji()||Mi(Ni()??`system`),Li();function Ri(e){Mi(e??`system`);try{localStorage.setItem(Di,e??`system`)}catch{document.documentElement.classList.toggle(`dark`,(e??Fi())===`dark`);return}Li()}function zi(){return(0,P.useSyncExternalStore)(e=>(Oi.add(e),()=>Oi.delete(e)),Ni)}function Bi(){return(0,P.useSyncExternalStore)(e=>(Oi.add(e),()=>Oi.delete(e)),()=>Ni()??(ki.matches?`dark`:`light`))}function Vi(){return(0,P.useSyncExternalStore)(e=>(Oi.add(e),()=>Oi.delete(e)),()=>document.documentElement.classList.contains(`dark`)?`dark`:`light`)}var Hi=e=>`oklch(from ${Rt[Bt[e]??`cobalt`]} 0.34 calc(c * 0.6) h)`;function Ui(e){(0,P.useEffect)(()=>{if(!e)return;let t=document.documentElement;return Pi+=1,t.style.setProperty(`--stage`,e),Li(),()=>{--Pi,t.style.removeProperty(`--stage`),Li()}},[e])}function Wi(e){(0,P.useEffect)(()=>{if(!e)return;let t=document.documentElement;return t.style.setProperty(`--engenty-stage`,Hi(e)),Ii(),()=>{t.style.removeProperty(`--engenty-stage`),Ii()}},[e])}var Gi={name:`engenty wizards`,short:`wizards`},Ki=(0,P.lazy)(()=>It(()=>import(`./fluffy-engenty-ClRou7yu.js`).then(e=>({default:e.FluffyEngenty})),__vite__mapDeps([0,1,2,3])));function qi({kind:e,size:t=64,fluffy:n,coat:r,goggles:i=!1,interactive:a=!0}){let o=e||`round`,s=Vi(),c=r??(s===`dark`?`jelly`:`fur`);if(n&&t>=120&&(c===`fur`||s===`dark`))return(0,I.jsx)(P.Suspense,{fallback:(0,I.jsx)(zt,{goggles:i,kind:o,size:Math.round(t*.62)}),children:(0,I.jsx)(Ki,{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,I.jsxs)(`div`,{"aria-hidden":`true`,className:`relative flex items-center justify-center overflow-hidden`,style:{background:Hi(o),borderRadius:t*.28,height:t,width:t},children:[(0,I.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,I.jsx)(`div`,{className:`relative`,style:{marginTop:t*.04},children:(0,I.jsx)(P.Suspense,{fallback:(0,I.jsx)(zt,{goggles:i,kind:o,size:Math.round(e*.62)}),children:(0,I.jsx)(Ki,{goggles:i,coat:`jelly`,kind:o,size:e,quality:`medium`,interactive:a})})})]})}return(0,I.jsx)(zt,{goggles:i,kind:o,size:t,animated:a})}function Ji(){let e=Vi(),t=e===`dark`?`light`:`dark`;return(0,I.jsx)(y,{label:c(t===`dark`?`theme.dark`:`theme.light`),onClick:()=>Ri(t),children:e===`dark`?(0,I.jsx)(ci,{className:`size-4`}):(0,I.jsx)(Er,{className:`size-4`})})}function Yi(e){return Object.fromEntries(Ye.filter(t=>e[t]?.startsWith(`apple:`)).map(e=>[e,``]))}function Xi(e){return e.split(/\s+/).map(e=>e[0]??``).join(``).slice(0,2).toUpperCase()}function Zi(){let e=ia().data?.limits.projects;return e===null||(e??1)>1}function Qi(){return ia().data?.limits.build??!0}function $i(){return ia().data?.limits.create??!0}function ea(){let e=ia().data;return!e||e.mode===`local`||e.tenant.role!==`member`}function ta(e){return e.mode===`managed`?e.credits:e.models?.source===`account`?e.account?.credits??null:null}function na(){let e=At();return t=>{ke(t),e.setQueryData([`me`],e=>e&&{...e,lang:t}),N.put(`/api/studio/lang`,{lang:t}).catch(()=>void 0)}}function ra(e){let t=At();(0,P.useEffect)(()=>{if(!e)return;if(e.lang){ke(e.lang);return}let n=_e();n&&(t.setQueryData([`me`],e=>e&&{...e,lang:n}),N.put(`/api/studio/lang`,{lang:n}).catch(()=>void 0))},[e,t])}function ia(){return Ft({queryKey:[`me`],queryFn:async()=>{try{return await N.get(`/api/studio/me`)}catch(e){if(e instanceof m&&e.status===401)return null;throw e}},staleTime:3e4})}function aa(e=!0){return Ft({queryKey:[`projects`],queryFn:()=>N.get(`/api/studio/projects`),enabled:e})}var oa=`wz.project`;function L(){try{return localStorage.getItem(oa)}catch{return null}}var R=L(),sa=new Set;function ca(e){R=e;try{localStorage.setItem(oa,e)}catch{}for(let e of sa)e()}function la(){let e=aa(),t=(0,P.useSyncExternalStore)(e=>(sa.add(e),()=>sa.delete(e)),()=>R),n=e.data??[];return{project:n.find(e=>e.id===t)??n[0]??null,projects:n,select:ca,loading:e.isLoading}}function ua(e,t){return Ft({queryKey:[`cloud`,e],queryFn:()=>N.get(`/api/studio/wizards/${e}/cloud`),enabled:t})}function da(e){return e instanceof m&&e.body?.code===`read_only`?e.message:null}async function fa(){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=`${Ae}/`;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}${Ae}/`,t.append(n),document.body.append(t),t.submit()}function pa(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 ma=`wizards.wish`,ha=1;function ga(e){try{localStorage.setItem(ma,JSON.stringify({text:e,at:Date.now()}))}catch{}}function _a(){try{let e=JSON.parse(localStorage.getItem(ma)??`null`);if(typeof e?.text==`string`&&typeof e.at==`number`&&Date.now()-e.at<ha*864e5)return e.text}catch{}return null}function va(){try{localStorage.removeItem(ma)}catch{}}var ya=e({defineStudioPlugin:()=>ba});function ba(e){return e}var xa=ve(),Sa=[`left`,`top`,`right`,`bottom`],Ca=`wizards.appbar`,wa={position:`left`},Ta=e=>Sa.includes(e);function Ea(){try{let e=JSON.parse(localStorage.getItem(Ca)??`null`);return{position:Ta(e?.position)?e.position:wa.position}}catch{return wa}}var Da=Ea(),Oa=new Set;function ka(e){Da={...Da,...e};try{localStorage.setItem(Ca,JSON.stringify(Da))}catch{}for(let e of Oa)e()}function Aa(){return wt(`(max-width: 767px)`)}function ja(){let e=(0,P.useSyncExternalStore)(e=>(Oa.add(e),()=>Oa.delete(e)),()=>Da),t=Aa();return(0,P.useMemo)(()=>t?{position:e.position===`top`?`top`:`bottom`,phone:t}:{...e,phone:t},[e,t])}var Ma=e=>e===`top`||e===`bottom`;function Na(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 Pa={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.`}};function Fa(e,t){let n=e?.[t];return typeof n==`boolean`?n:Object.hasOwn(Pa,t)?Pa[t].default:!1}function Ia(e=Pa){let t={};for(let[n,r]of Object.entries(e))t[n]=r.default;return t}function La(){return Ft({queryKey:[`config`],queryFn:async()=>{let e=await N.get(`/api/config`);return me(e.publicUrl),e},staleTime:6e4})}function Ra(){let e=ia(),t=La();return e.data?.features??t.data?.features??Ia()}function za(e){return Fa(Ra(),e)}var Ba=()=>matchMedia(`(display-mode: standalone)`).matches||matchMedia(`(display-mode: window-controls-overlay)`).matches||navigator.standalone===!0,Va=()=>navigator.userAgent,Ha=()=>/iPhone|iPad|iPod/.test(Va())||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1,Ua=()=>!!navigator.userAgentData?.brands?.length||/Chrome|Chromium|Edg/.test(Va()),Wa=()=>/Safari/.test(Va())&&!/Chrome|Chromium|Edg|Firefox|FxiOS/.test(Va());function Ga(e){return e?`prompt`:/Android/.test(Va())?Ua()?`android`:`none`:Ha()?`ios`:Wa()?`mac`:Ua()?`chromium`:`none`}function Ka(){return(0,P.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 qa(e){try{await e.prompt()}finally{window.wizardInstall=null,window.dispatchEvent(new Event(`wizard-install`))}}var Ja=(0,P.lazy)(()=>It(()=>import(`./AboutDialog-DYgXPagX.js`).then(e=>({default:e.AboutDialog})),__vite__mapDeps([4,1,2,5,6,7,8])));function Ya(e){return D(`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 Xa({me:e}){let{project:t}=la();return(0,I.jsx)(Td,{me:e,placement:`bar-start`,label:t?.name??c(`nav.project`),className:e=>D(`block rounded-lg transition`,e?`ring-2 ring-ink/80 ring-offset-2 ring-offset-sidebar`:`hover:shadow-soft`),children:(0,I.jsx)(wd,{project:t})})}var Za={left:Mr,top:Ir,right:Pr,bottom:Ar},Qa=[{pick:`light`,icon:ci,label:`appbar.light`},{pick:`dark`,icon:Er,label:`appbar.dark`},{pick:null,icon:wr,label:`appbar.system`}];function $a({at:e,onClose:t}){let{position:n,phone:r}=ja(),i=zi(),a=r?[`top`,`bottom`]:Sa,o=(0,P.useRef)(null);xd(o,!0,t);let[s,l]=(0,P.useState)({x:0,y:0});(0,P.useLayoutEffect)(()=>{let e=o.current?.getBoundingClientRect();e&&l({x:Math.min(0,window.innerWidth-8-e.right),y:Math.min(0,window.innerHeight-8-e.bottom)})},[]);let u=`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`,d=`px-3 pt-2 pb-1 font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.07em]`;return(0,I.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,I.jsx)(`div`,{className:d,children:c(`appbar.position`)}),a.map(e=>{let r=Za[e];return(0,I.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===n,className:D(u,e===n&&`text-ink`),onClick:()=>{ka({position:e}),t()},children:[(0,I.jsx)(r,{className:`size-4`}),(0,I.jsx)(`span`,{className:`flex-1`,children:c(`appbar.${e}`)}),e===n?(0,I.jsx)(Ie,{className:`size-4 text-ember-strong`}):null]},e)}),(0,I.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,I.jsx)(`div`,{className:d,children:c(`appbar.theme`)}),Qa.map(({pick:e,icon:n,label:r})=>(0,I.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===i,className:D(u,e===i&&`text-ink`),onClick:()=>{Ri(e),t()},children:[(0,I.jsx)(n,{className:`size-4`}),(0,I.jsx)(`span`,{className:`flex-1`,children:c(r)}),e===i?(0,I.jsx)(Ie,{className:`size-4 text-ember-strong`}):null]},r))]})}function eo({me:e}){let t=Vd(),{position:n}=ja(),r=Ma(n),[i,a]=(0,P.useState)(null),[o,s]=(0,P.useState)(!1),u=e=>{e.preventDefault(),a({x:e.clientX,y:e.clientY})},d=(0,P.useRef)(null),f=(0,P.useRef)(!1),p=()=>{d.current&&=(window.clearTimeout(d.current.timer),null)};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`aside`,{"aria-label":Gi.name,onContextMenu:u,onPointerDown:e=>{if(e.pointerType===`mouse`)return;p();let{clientX:t,clientY:n}=e;d.current={x:t,y:n,timer:window.setTimeout(()=>{d.current=null,f.current=!0,window.setTimeout(()=>{f.current=!1},700),a({x:t,y:n})},500)}},onPointerMove:e=>{d.current&&Math.hypot(e.clientX-d.current.x,e.clientY-d.current.y)>10&&p()},onPointerUp:p,onPointerCancel:p,onPointerLeave:p,onClickCapture:e=>{f.current&&(f.current=!1,e.preventDefault(),e.stopPropagation())},className:D(`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,I.jsx)(`button`,{type:`button`,onClick:()=>s(!0),title:c(`about.title`),"aria-label":c(`about.title`),className:D(`grid shrink-0 place-items-center rounded-lg transition hover:bg-ink/10`,r?`size-11`:`h-12 w-11`),children:(0,I.jsx)(Ti,{size:32})}),(0,I.jsx)(`div`,{className:r?`ml-1`:`mt-2`,children:(0,I.jsx)(Xa,{me:e})}),(0,I.jsx)(l,{to:`/space`,title:c(`nav.project`),"aria-label":c(`nav.project`),className:({isActive:e})=>D(Ya(e),r?`ml-1.5`:`mt-2`),children:(0,I.jsx)(Xn,{className:`size-5`})}),t.nav.length?(0,I.jsx)(`div`,{className:D(`shrink-0 bg-border`,r?`mx-2 h-7 w-px`:`my-3 h-px w-7`)}):null,(0,I.jsx)(`nav`,{className:D(`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,I.jsx)(pf,{of:e,children:(0,I.jsx)(l,{to:e.to,title:e.label(),"aria-label":e.label(),className:({isActive:e})=>Ya(e),children:(0,I.jsx)(e.icon,{className:`size-5`})})},e.serial))}),(0,I.jsxs)(`div`,{className:D(`flex shrink-0 items-center gap-2`,r?`flex-row pl-3`:`flex-col pt-3`),children:[(0,I.jsx)(l,{to:`/settings`,title:c(`nav.settings`),"aria-label":c(`nav.settings`),className:({isActive:e})=>Ya(e),children:(0,I.jsx)(ei,{className:`size-5`})}),(0,I.jsx)(kd,{me:e,placement:`bar-end`})]}),i?(0,I.jsx)($a,{at:i,onClose:()=>a(null)}):null]}),o?(0,I.jsx)(P.Suspense,{fallback:null,children:(0,I.jsx)(Ja,{open:!0,me:e,onClose:()=>s(!1)})}):null]})}var to=`wz.readAloud`,no=typeof window<`u`&&`speechSynthesis`in window&&`SpeechSynthesisUtterance`in window;function ro(){try{return localStorage.getItem(to)===`1`}catch{return!1}}function io(e){try{localStorage.setItem(to,e?`1`:`0`)}catch{}}function ao(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 oo(e,t=E,n=!1){if(!no||!e.trim())return;let r=window.speechSynthesis;n&&r.cancel();let i=_(t),a=new SpeechSynthesisUtterance(e.trim().slice(0,2e3));a.lang=i;let o=ao(i);o&&(a.voice=o),r.speak(a)}function so(e,t=E){if(!no||!e.trim())return Promise.resolve();let n=window.speechSynthesis;n.cancel();let r=_(t),i=new SpeechSynthesisUtterance(e.trim().slice(0,4e3));i.lang=r;let a=ao(r);return a&&(i.voice=a),new Promise(e=>{i.onend=()=>e(),i.onerror=()=>e(),n.speak(i)})}function co(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 lo(){no&&window.speechSynthesis.cancel()}function uo(){let[e,t]=(0,P.useState)(()=>no&&ro()),n=(0,P.useCallback)(e=>{t(e),io(e),e||lo()},[]);return(0,P.useEffect)(()=>{no&&window.speechSynthesis.getVoices()},[]),(0,P.useEffect)(()=>()=>lo(),[]),[e,n]}function fo(e,t,n,r){let i=(0,P.useRef)(null);(0,P.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&&oo(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`)&&lo();for(let e of o)if(e.who===`bot`&&e.spoken!==!1){let n=r(e.key);n&&oo(n,t)}},[e,t,n,r])}var po=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function mo(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 ho(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 go({names:e,previews:t,fileUrl:n}){let r=e.filter(e=>t?.[e]||n&&po.test(e)),i=e.filter(e=>!r.includes(e));return(0,I.jsxs)(`div`,{className:`flex flex-col items-end gap-1.5`,children:[r.map(e=>{let r=t?.[e]??n?.(e)??``;return(0,I.jsx)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,title:e,children:(0,I.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,I.jsx)(`div`,{className:`flex flex-wrap justify-end gap-1.5`,children:i.map(e=>(0,I.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,I.jsx)(ft,{className:`size-3 shrink-0 text-ink-4`}),(0,I.jsx)(`span`,{className:`truncate`,children:e})]},e))}):null]})}function _o(e,t){let n=At(),[r,i]=(0,P.useState)([]),[o,s]=(0,P.useState)(`idle`),[l,u]=(0,P.useState)(null),[d,f]=(0,P.useState)(null),[p,m]=(0,P.useState)(null),[h,g]=(0,P.useState)(null),_=(0,P.useRef)(null);return(0,P.useEffect)(()=>{if(e){if(_.current!==e.id){_.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:d,thought:p,startedAt:h,error:l,send:async(r,l=[])=>{if(!e||!(r.trim()||l.length)||o!==`idle`)return!1;if(u(null),g(Date.now()),m(null),l.length){s(`thinking`);try{for(let t of l){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":E},body:t});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??n.statusText)}}}catch(t){return u(t.message),s(`idle`),g(null),await n.invalidateQueries({queryKey:[`wizard`,e.id]}),!1}let t=`${c(`editor.attached`)}: ${l.map(e=>e.name).join(`, `)}`;r=r.trim()?`${r}\n\n${t}`:t}let d=`p-${Date.now()}`;i(e=>[...e,{id:`u-${Date.now()}`,role:`user`,content:r,previews:mo(l)},{id:d,role:`assistant`,content:``,pending:!0}]),s(`thinking`),f(null);let p=!1;try{await b(`/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===d?{...t,content:t.content+e}:t))}else if(e===`activity`)f(JSON.parse(n));else if(e===`thought`)m(JSON.parse(n));else if(e===`building`)s(`building`);else if(e===`done`){p=!0;let e=JSON.parse(n);i(t=>t.map(t=>t.id===d?{...t,content:e.reply,changed:e.changed,pending:!1}:t)),e.changed&&t(e.draft,e.revision)}else e===`error`&&(p=!0,u(JSON.parse(n).message))}),p||u(c(`editor.chatBroken`))}catch(e){u(e.message)}finally{f(null),m(null),g(null),i(e=>e.filter(e=>!(e.id===d&&!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 vo(e){let[t,n]=(0,P.useState)(()=>Date.now());return(0,P.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 yo(e){return e<60?`${e} s`:`${Math.floor(e/60)}:${String(e%60).padStart(2,`0`)} min`}function bo({chat:e,thought:t,className:n,spinner:r=`size-3.5`}){let i=vo(e.startedAt);return(0,I.jsxs)(`div`,{className:D(`min-w-0`,n),children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(M,{className:D(`shrink-0`,r)}),(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:e.activity??(e.phase===`building`?c(`editor.building`):c(`editor.thinking`))}),i===null?null:(0,I.jsx)(`span`,{className:`shrink-0 text-ink-4 tabular-nums`,children:yo(i)})]}),t&&e.thought?(0,I.jsx)(`p`,{className:`mt-0.5 truncate pl-5.5 text-[0.75rem] text-ink-4`,children:e.thought}):null]})}function xo({message:e,fileUrl:t}){let{text:n,names:r}=ho(e.content);return(0,I.jsxs)(`div`,{className:`ml-8 flex flex-col items-end gap-1.5 self-end`,children:[e.signal?(0,I.jsx)(`span`,{className:`text-[0.6875rem] text-ink-4`,children:c(`assistant.signalled`)}):null,r.length?(0,I.jsx)(go,{names:r,previews:e.previews,fileUrl:t}):null,n?(0,I.jsx)(`div`,{className:`rounded-xl rounded-br-md bg-paper-2 px-4 py-2.5 text-[0.875rem] leading-relaxed`,children:(0,I.jsx)(`span`,{className:`whitespace-pre-wrap`,children:n})}):null]})}function So({chat:e,avatar:t,changedLabel:n,card:r,calls:i,foot:a}){return(0,I.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.messages.map(o=>o.role===`user`?(0,I.jsx)(xo,{message:o,fileUrl:e.fileUrl},o.id):(0,I.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,I.jsx)(`div`,{className:`shrink-0`,children:(0,I.jsx)(qi,{kind:t,size:28,interactive:!1})}),(0,I.jsxs)(`div`,{className:`min-w-0 pt-0.5 text-[0.875rem]`,children:[o.source===`mcp`?(0,I.jsxs)(`div`,{className:`mb-1 inline-flex items-center gap-1.5 text-[0.75rem] text-ink-3`,children:[(0,I.jsx)(Hr,{className:`size-3`}),` `,c(`editor.viaClient`,{client:o.client??`MCP`})]}):null,i?i(o):null,o.content?(0,I.jsx)(gt,{text:o.content,className:`text-[0.875rem]`}):null,r&&o.cards?.length?(0,I.jsx)(`div`,{className:`mt-2 flex flex-col gap-2`,children:o.cards.map(e=>(0,I.jsx)(P.Fragment,{children:r(e)},e.id))}):null,o.pending?(0,I.jsx)(bo,{chat:e,thought:!0,className:`mt-1 text-[0.8125rem] text-ink-3`}):null,o.changed?(0,I.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,I.jsx)(ae,{className:`size-3`}),` `,n]}):null,a?a(o):null]})]},o.id))})}function Co({chat:e,avatar:t,hello:n=c(`editor.chatHello`),placeholder:r=c(`editor.composer`),changedLabel:i=c(`editor.flowChanged`),compact:a,intro:o,closed:s,card:l}){let[u,d]=(0,P.useState)(!1),f=(0,P.useRef)(null),p=(0,P.useRef)(null);(0,P.useEffect)(()=>{f.current?.scrollTo({top:f.current.scrollHeight,behavior:`smooth`})},[e.messages,e.phase]);let m=!a||u,h=e.messages.at(-1),[g,_]=(0,P.useState)(!1),v=(0,P.useRef)(0),y=e=>!s&&e.dataTransfer.types.includes(`Files`);return(0,I.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,onDragEnter:e=>{y(e)&&(e.preventDefault(),v.current+=1,_(!0))},onDragOver:e=>{y(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)},onDragLeave:()=>{v.current=Math.max(0,v.current-1),v.current===0&&_(!1)},onDrop:e=>{y(e)&&(e.preventDefault(),v.current=0,_(!1),p.current?.add(Array.from(e.dataTransfer.files).map(Ge)),p.current?.focus())},children:[g?(0,I.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,I.jsx)(ft,{className:`size-6`}),c(`editor.dropToAttach`)]}):null,(0,I.jsxs)(`div`,{className:a?D(`mb-2 flex min-h-0 flex-col overflow-hidden rounded-2xl bg-card shadow-overlay ring-1 ring-border`,!(h||e.error)&&`hidden`):`contents`,children:[a&&(h||e.error)?(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":u,"aria-label":c(`editor.thread`),onClick:()=>d(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||u)&&h?.pending?(0,I.jsx)(bo,{chat:e,className:`flex-1`}):(0,I.jsx)(`span`,{className:D(`min-w-0 flex-1 truncate`,e.error&&`text-rose`),children:e.error??(u?c(`editor.thread`):h?.content)}),u?(0,I.jsx)(Pt,{className:`size-4 shrink-0`}):(0,I.jsx)(bn,{className:`size-4 shrink-0`})]}):null,(0,I.jsxs)(`div`,{ref:f,className:D(`min-h-0 flex-1 overflow-y-auto px-5 py-5`,!m&&`hidden`),children:[e.messages.length===0&&!s?o??(0,I.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,I.jsx)(qi,{kind:t,size:32,interactive:!1}),(0,I.jsx)(`p`,{className:`pt-1 text-[0.875rem] text-ink-2 leading-relaxed`,children:n})]}):null,(0,I.jsx)(So,{chat:e,avatar:t,changedLabel:i,card:l}),e.error?(0,I.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,I.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,I.jsx)(Le,{ref:p,floating:a,className:a?void 0:`p-3`,placeholder:r,disabled:e.phase!==`idle`,onSend:(t,n)=>e.send(t,n)})]})}function wo(e,t){return[{id:`account`,label:c(`account.title`),icon:gi,menu:!0},...e?.mode===`managed`&&Fa(e.features,`teamPlans`)?[{id:`team`,label:c(`team.title`),icon:vi,menu:!0}]:[],{id:`connectors`,label:c(`connectors.title`),icon:Hr,menu:!0},{id:`models`,label:c(`local.title`),icon:Pn,menu:!0},{id:`integrate`,label:c(`integrate.nav`),icon:gn,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:c(`plugins.title`),icon:un,menu:!1}]:[]]}var To=`wizards.assistant`,Eo={place:`center`,free:null,height:null,dev:!1};function Do(){try{let e=JSON.parse(localStorage.getItem(To)??`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 Eo}}var Oo=Do(),ko=new Set,Ao=()=>{for(let e of ko)e()},jo=e=>(ko.add(e),()=>ko.delete(e));function Mo(e){Oo={...Oo,...e};try{localStorage.setItem(To,JSON.stringify(Oo))}catch{}Ao()}function No(){return(0,P.useSyncExternalStore)(jo,()=>Oo)}var Po=64,Fo=12,Io=null,Lo=new Set;function Ro(e){Io=e;for(let e of Lo)e()}function zo(){return(0,P.useSyncExternalStore)(e=>(Lo.add(e),()=>Lo.delete(e)),()=>Io)}var Bo=e=>Math.min(600,e-24);function Vo(e,t,n){let r=Bo(e.width),i=e.height-Fo-t;return{center:{left:(e.width-r)/2,top:i,width:r,height:t},right:e.width>=r+24+240?{left:e.width-Fo-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 Ho=e=>e>=Bo(e)+24+240;function Uo(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=Bo(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=Vo(s,u,t.sidebar),m=s.height-(f+u)<Po,h=s.width-(d+l)<Po||window.innerWidth-r.clientX<Po,g=null;if(p.sidebar&&h&&(!m||window.innerWidth-r.clientX<Po))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},Ro(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(Ro(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 Wo=1300,z=3e3;function B(){let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition}var Go=typeof window<`u`&&(!!B()||!!navigator.mediaDevices?.getUserMedia&&typeof MediaRecorder<`u`);function Ko(e){return e.toLowerCase().split(/[\s\-–—/]+/).map(e=>e.replace(/[^\p{L}\p{N}]/gu,``)).filter(Boolean)}function qo(e,t){let n=new Set(Ko(t)),r=Ko(e);return r.length<2||r.filter(e=>n.has(e)).length/r.length>=.75}function Jo(e){let[t,n]=(0,P.useState)(`off`),[r,i]=(0,P.useState)(!1),[o,s]=(0,P.useState)(null),[c,l]=(0,P.useState)(null),[u,d]=(0,P.useState)(0),[f,p]=(0,P.useState)(``),[m,h]=(0,P.useState)(null),g=(0,P.useRef)(`off`),_=(0,P.useRef)(!1),v=(0,P.useRef)(null),y=(0,P.useRef)(null),b=(0,P.useRef)(null),ee=(0,P.useRef)(``),x=(0,P.useRef)({text:``,until:0}),S=(0,P.useRef)(``),te=(0,P.useRef)(null),C=(0,P.useRef)(null),ne=(0,P.useRef)(e);ne.current=e;let re=(0,P.useRef)(m);re.current=m;let w=(0,P.useCallback)(e=>{g.current=e,n(e)},[]),T=(0,P.useCallback)(()=>{lo(),b.current&&=(b.current.pause(),null),ee.current=``},[]),ie=(0,P.useCallback)(()=>{te.current&&=(clearTimeout(te.current),null);let e=S.current.trim();S.current=``,p(``),e&&g.current!==`off`&&(w(`thinking`),C.current=ne.current.messages.at(-1)?.id??null,ne.current.send(e).then(e=>{!e&&g.current===`thinking`&&w(`listening`)}))},[w]),ae=(0,P.useCallback)((e,t)=>{if(!(_.current||g.current===`off`||g.current===`thinking`)){if(g.current===`speaking`){if(qo(e,ee.current))return;T(),w(`listening`)}else if(Date.now()<x.current.until&&qo(e,x.current.text))return;p(e),t&&(S.current=`${S.current} ${e}`.trim(),p(S.current)),te.current&&clearTimeout(te.current),te.current=setTimeout(ie,Wo)}},[ie,T,w]),oe=(0,P.useCallback)(()=>{let e=B();if(!e||v.current)return;let t=new e;t.continuous=!0,t.interimResults=!0,t.lang=ct[E],t.onresult=e=>{let t=``;for(let n=e.resultIndex;n<e.results.length;n++){let r=e.results[n];r.isFinal?ae(r[0].transcript,!0):t+=r[0].transcript}t.trim()&&ae(`${S.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(oe,200)},v.current=t;try{t.start()}catch{v.current=null}},[ae]),D=(0,P.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()<x.current.until?x.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 N.upload(`/api/studio/transcribe`,e);if(t&&qo(n,t)){w(`listening`);return}S.current=n,ie()}catch(e){l(e.message),w(`listening`)}}},n.start()}}else n&&Date.now()-i>Wo&&n.stop();setTimeout(o,100)};o()},[ie,w]),se=(0,P.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,C.current=ne.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(),B()?oe():D(e,n),re.current||N.get(`/api/studio/assistant/voice`).then(({way:e})=>h({way:e,natural:e===`key`||e===`local`})).catch(()=>h({way:`none`,natural:!1}))},[oe,D,w]),ce=(0,P.useCallback)(()=>{w(`off`),s(null),p(``),d(0),S.current=``,te.current&&clearTimeout(te.current),v.current?.abort(),v.current=null,T();for(let e of y.current?.getTracks()??[])e.stop();y.current=null},[T,w]),O=(0,P.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`&&oe()},[oe]),k=(0,P.useCallback)(async e=>{let t=co(e);if(!t){w(`listening`);return}w(`speaking`),ee.current=t;let n=re.current?.natural&&re.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 so(t,E),b.current=null,ee.current=``,g.current===`speaking`&&(x.current={text:t,until:Date.now()+z},S.current=``,p(``),v.current?.abort(),w(`listening`))},[w]);return(0,P.useEffect)(()=>{if(t!==`thinking`||e.phase!==`idle`)return;let n=e.messages.at(-1);n?.role===`assistant`&&n.id!==C.current&&!n.pending?(C.current=n.id,k(n.content)):e.error&&w(`listening`)},[t,e.phase,e.messages,e.error,k,w]),(0,P.useEffect)(()=>()=>ce(),[ce]),{state:t,muted:r,since:o,error:c,level:u,heard:f,voice:m,setNatural:e=>h(t=>t&&{...t,natural:e}),start:se,end:ce,toggleMute:O}}var Yo=new Map,Xo={},Zo=new Set;function Qo(){Xo=Object.assign({},...Yo.values());for(let e of Zo)e()}function V(){return(0,P.useSyncExternalStore)(e=>(Zo.add(e),()=>Zo.delete(e)),()=>Xo)}function $o(){for(let e of Yo.values())e.onChanged?.()}function es(e){let t=(0,P.useId)(),n=(0,P.useRef)(e);n.current=e;let{onChanged:r,...i}=e,a=JSON.stringify(i);(0,P.useEffect)(()=>{Yo.set(t,{...JSON.parse(a),onChanged:()=>n.current.onChanged?.()}),Qo()},[t,a]),(0,P.useEffect)(()=>()=>{Yo.delete(t),Qo()},[t])}function ts(){let e=document.getElementById(Nd);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 ns(){let{title:e,hello:t,placeholder:n,suggestions:r,compact:i,onChanged:a,...o}=Xo,s=md().map(e=>e.label),c=window.location.pathname,l=c.startsWith(Ae)?c.slice(Ae.length)||`/`:c,u=ts(),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 rs=()=>document.getElementById(`studio-scroll`)??document.body,is=`[data-assist],h1,h2,h3,h4,button,a[href],input,textarea,select,[role=switch],[role=checkbox],[role=tab],[contenteditable=true]`,as=150,os=0;function ss(e){return e.dataset.assist?e.dataset.assist:(e.dataset.assistRef||(os+=1,e.dataset.assistRef=`e${os}`),e.dataset.assistRef)}var H=(e,t=120)=>(e??``).replace(/\s+/g,` `).trim().slice(0,t);function cs(e){if(e.dataset.assistLabel)return H(e.dataset.assistLabel);let t=e.getAttribute(`aria-label`);if(t)return H(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 H(t.getAttribute(`data-assist-section`)||t.textContent)}if(e.id){let t=document.querySelector(`label[for="${CSS.escape(e.id)}"]`);if(t)return H(t.textContent)}let n=e.closest(`label`);if(n&&n!==e)return H(n.textContent);let r=e.parentElement?.querySelector(`label`);return r&&(e.matches(`input,textarea,select`)||e.getAttribute(`role`)===`switch`)?H(r.textContent):H(e.textContent||e.placeholder||e.getAttribute(`title`)||``)}function ls(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 H(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 H(e.textContent,600)}function us(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 ds(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 fs(e){let t=e.getBoundingClientRect();return t.bottom>0&&t.top<window.innerHeight&&t.right>0&&t.left<window.innerWidth}function ps(e,t){let n=[];for(let r of e.querySelectorAll(is)){if(n.length>=as)break;if(!ds(r)||t&&!fs(r))continue;let e=us(r),i=cs(r);if(!i&&e!==`field`)continue;let a=e===`field`?ls(r):void 0,o=r.disabled||r.getAttribute(`aria-disabled`)===`true`;n.push({ref:ss(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 ms(e){let t=rs(),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(is)){if(!ds(e))continue;let t=cs(e).toLowerCase();if(t===i)return e;!a&&t.includes(i)&&(a=e)}return a}var hs=e=>({error:`Nothing on the page is "${e}". look_at_page lists what is there.`}),gs=null,_s=0,vs=new Set;function ys(e){gs=e;for(let e of vs)e()}function bs(){return(0,P.useSyncExternalStore)(e=>(vs.add(e),()=>vs.delete(e)),()=>gs)}var xs=null,Ss=()=>[];function Cs(e,t){xs=e,Ss=t}function ws(e){let t=e.split(/[?#]/)[0]||`/`;return Ss().some(e=>RegExp(`^${e.split(`/`).map(e=>e.startsWith(`:`)?e.endsWith(`?`)?`(?:[^/]+)?`:`[^/]+`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`/`)}/?$`).test(t))}var Ts=()=>new Promise(e=>setTimeout(e,450));function Es(e){return!e.startsWith(`/`)||e.startsWith(`//`)||/^\/(api|w|s)\//.test(e)||!(xs&&ws(e))?!1:(xs(e),!0)}var Ds={type:`string`,description:`A ref or area from look_at_page, or the label`},Os=new Map;function ks(){return[...Os.values()].map(({name:e,description:t,parameters:n})=>({name:e,description:t,parameters:n}))}var As=[{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(`/`)&&ws(t)?(xs?.(t),await Ts(),{opened:t,pageTools:ks()}):{error:`The studio has no page "${t}".`,pages:Ss()}}},{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:Ds,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=ms(String(e??``));return a?(a.scrollIntoView({behavior:`smooth`,block:`center`}),await Ts(),_s+=1,ys({id:_s,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:cs(a)}):hs(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(rs().scrollTop),items:ps(rs(),!0),pageTools:ks()})},{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:Ds},required:[`target`]},run:({target:e})=>{let t=ms(String(e??``));return t?{area:cs(t),items:ps(t,!1),text:H(t.innerText,4e3)}:hs(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:Ds,value:{type:[`string`,`number`,`boolean`]}},required:[`target`,`value`]},run:async({target:e,value:t})=>{let n=ms(String(e??``));if(!n)return hs(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)||H(e.textContent).toLowerCase()===String(t).toLowerCase());if(!e)return{error:`No such choice.`,choices:[...n.options].map(e=>H(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:cs(n),value:ls(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=Os.get(String(e??``));return n?n.run(t??{}):{error:`The page offers no tool "${String(e)}".`,pageTools:ks()}}},{name:`scroll_to`,description:`Scroll an element of the page into view.`,parameters:{type:`object`,properties:{target:Ds},required:[`target`]},run:async({target:e})=>{let t=ms(String(e??``));return t?(t.scrollIntoView({behavior:`smooth`,block:`start`}),await Ts(),{at:cs(t)}):hs(String(e))}}];function js(e,t,n){let r=(0,P.useRef)(n);r.current=n;let i=JSON.stringify(t);(0,P.useEffect)(()=>{if(As.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 Os.set(e,{name:e,description:t,parameters:n??{type:`object`,properties:{}},run:e=>r.current(e)}),()=>{Os.delete(e)}},[e,i])}function Ms(){return[...As,...Os.values()].map(({name:e,description:t,parameters:n})=>({name:e,description:t,parameters:n}))}async function Ns(e,t){let n=As.find(t=>t.name===e)??Os.get(e);if(!n)return null;try{return{result:await n.run(t??{})}}catch(e){return{result:{error:e.message}}}}var Ps=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 Fs(e){return e.type.startsWith(`image/`)&&/logo/i.test(e.name)?`logo`:/^(image|video|audio)\//.test(e.type)?`asset`:`document`}var Is=0,Ls=e=>`${e}-${Date.now()}-${++Is}`,Rs=(0,P.createContext)(null);function zs(){return(0,P.useContext)(Rs)}function Bs(){let e=Vd(),t=ia(),n=(0,P.useRef)([]);return n.current=[`/`,`/new`,`/edit/:id`,`/space`,`/space/:group`,`/settings`,...wo(t.data,e).map(e=>`/settings/${e.id}`),...e.pages.map(e=>e.path)],(0,P.useCallback)(()=>n.current,[])}function Vs({children:e}){let t=At(),n=ia(),r=!!n.data,{project:i}=la(),a=v(),o=Bs();(0,P.useEffect)(()=>{Cs(e=>a(e),o)},[a,o]);let s=Ft({queryKey:[`assistant-chat`],queryFn:()=>N.get(`/api/studio/assistant/chat`),enabled:r,staleTime:1/0}),l=Ft({queryKey:[`assistant-layout`],queryFn:()=>N.get(`/api/studio/assistant/layout`),enabled:r,staleTime:1/0}),[u,d]=(0,P.useState)([]),[f,p]=(0,P.useState)(`idle`),[m,h]=(0,P.useState)(null),[g,_]=(0,P.useState)(null),[y,ee]=(0,P.useState)(null),[x,S]=(0,P.useState)(!1),[te,C]=(0,P.useState)(!1),[ne,re]=(0,P.useState)({kind:`chat`}),[w,T]=(0,P.useState)(null),[ie,ae]=(0,P.useState)([]),[oe,D]=(0,P.useState)([]),se=(0,P.useRef)(null),ce=No(),O=!!n.data?.assistantDev,k=O&&ce.dev,le=(0,P.useRef)(k);le.current=k,(0,P.useEffect)(()=>{s.data&&se.current!==s.data.id&&(se.current=s.data.id,d(s.data.messages.map(Ps)))},[s.data]);let ue=(0,P.useCallback)(e=>{T(e),t.setQueryData([`assistant-layout`],{layout:e}),N.put(`/api/studio/assistant/layout`,{layout:e}).catch(()=>null)},[t]),de=(0,P.useRef)(null),fe=(0,P.useCallback)(()=>(de.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]),$o(),de.current=null})(),de.current),[t,i]),pe=(0,P.useRef)([]),me=(0,P.useCallback)(e=>{pe.current=e(pe.current),ae(pe.current)},[]),he=(0,P.useRef)(!1),ge=(0,P.useRef)(null),_e=(0,P.useRef)(null),ve=(0,P.useRef)(()=>void 0),ye=(0,P.useRef)(new Set),A=(0,P.useCallback)(()=>{let e=ge.current?.runId;if(e)for(let t of pe.current)t.way!==`signal`||ye.current.has(t.id)||(ye.current.add(t.id),N.post(`/api/studio/assistant/run/${e}/signal`,{ref:t.id,message:t.text}).catch(()=>{}))},[]),j=(0,P.useCallback)(async(e,t)=>{if(!t.length)return e;if(!i||i.readOnly)return h(c(`assistant.filesNeedSpace`)),null;try{for(let e of t)await N.upload(`/api/studio/projects/${i.id}/files?kind=${Fs(e)}`,e)}catch(e){return h(e.message),await fe(),null}await fe();let n=`${c(`editor.attached`)}: ${t.map(e=>e.name).join(`, `)}`;return e.trim()?`${e}\n\n${n}`:n},[i,fe]),be=(0,P.useCallback)(async(e,n)=>{he.current=!0,h(null),p(`thinking`),ee(Date.now()),ys(null),re({kind:`chat`});let r=Ls(`p`),a=Ls(`u`);d(t=>[...t,{id:a,role:`user`,content:e,previews:n},{id:r,role:`assistant`,content:``,pending:!0}]),_(null);let o=e=>{let t=r;d(n=>n.map(n=>n.id===t?e(n):n))},s=le.current?{id:Ls(`t`),message:e,startedAt:Date.now(),endedAt:null,prompt:null,events:[]}:null;s&&D(e=>[...e,s]);let l=(e,t)=>{s&&(s.events.push({at:Date.now(),event:e,data:t}),e===`prompt`&&(s.prompt=t),D(e=>e.map(e=>e.id===s.id?{...s}:e)))},u=new AbortController,f={runId:null,abort:u,stopped:!1};ge.current=f;let m=!1;try{await b(`/api/studio/assistant/turn`,{message:e,projectId:i?.id,page:ns(),tools:Ms(),lang:E,...le.current?{debug:!0}:{}},(e,t)=>{let n=JSON.parse(t);switch(l(e,n),e){case`run_started`:{let e=n;f.runId=e.runId,d(t=>t.map(t=>t.id===a?{...t,id:e.messageId}:t)),A();break}case`text`:o(e=>({...e,content:e.content+n.delta}));break;case`activity`:_(n.label);break;case`tool_call`:{let e=n;o(t=>({...t,toolCalls:[...t.toolCalls??[],e]})),Ns(e.toolCallName,e.args).then(t=>{t&&N.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`:fe();break;case`step`:o(e=>({...e,steps:[...e.steps??[],n]}));break;case`signal`:{let e=n,t=r;r=Ls(`p`),me(t=>t.filter(t=>t.id!==e.ref)),d(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`:{m=!0;let e=n;o(t=>({...t,id:e.messageId,content:e.reply,changed:e.changed,pending:!1}));break}case`error`:m=!0,h(n.message)}},u.signal),m||h(c(`editor.chatBroken`))}catch(e){f.stopped||h(e.message)}finally{s&&(s.endedAt=Date.now(),D(e=>e.map(e=>e.id===s.id?{...s}:e))),ge.current=null,_(null),ee(null),d(e=>e.filter(e=>!(e.pending&&!e.content&&!e.cards?.length&&!e.toolCalls?.length&&!e.steps?.length)).map(e=>({...e,pending:!1}))),p(`idle`),he.current=!1,await de.current,t.invalidateQueries({queryKey:[`me`]})}let g=_e.current;if(_e.current=null,!(g||f.stopped)){let e=pe.current.filter(e=>e.way===`signal`),t=e.length?e:pe.current.filter(e=>e.way===`queue`).slice(0,1);t.length&&(me(e=>e.filter(e=>!t.includes(e))),g=t.map(e=>e.text).join(`
|
|
11
11
|
|
|
12
12
|
`))}g&&ve.current(g)},[i,fe,t,A,me]);ve.current=e=>void be(e);let xe=(0,P.useCallback)(async(e,t=[],n=`signal`)=>{if(!(e.trim()||t.length))return!1;if(C(!0),!he.current){he.current=!0,p(`thinking`);let n=await j(e,t);return n===null?(he.current=!1,p(`idle`),!1):(be(n,mo(t)),!0)}let r=await j(e,t);return r!==null&&(me(e=>[...e,{id:Ls(`s`),text:r,way:n}]),A(),!0)},[j,be,A,me]),Se=(0,P.useCallback)(()=>{let e=ge.current;e&&(e.stopped=!0,e.abort.abort())},[]),Ce=(0,P.useCallback)(e=>{let t=pe.current.find(t=>t.id===e);t&&(me(e=>e.filter(e=>e!==t)),ge.current?(_e.current=t.text,Se()):he.current||be(t.text))},[be,Se,me]),M=(0,P.useCallback)(e=>{let t=pe.current.find(t=>t.id===e);return me(e=>e.filter(e=>e!==t)),t},[me]),we=(0,P.useCallback)(async()=>{Se(),me(()=>[]),d([]),D([]),h(null),re({kind:`chat`}),S(!0);try{let e=await N.post(`/api/studio/assistant/chat/new`);se.current=e.id,t.setQueryData([`assistant-chat`],e),await t.invalidateQueries({queryKey:[`assistant-chats`]})}catch(e){h(e.message)}finally{S(!1)}},[t,Se,me]),Te=(0,P.useCallback)((e,t)=>xe(e,t),[xe]),Ee=(0,P.useMemo)(()=>({messages:u,phase:f,activity:g,startedAt:y,error:m,send:Te}),[u,f,g,y,m,Te]),De=Jo(Ee),Oe=(0,P.useCallback)(e=>Mo({dev:e}),[]),ke=(0,P.useMemo)(()=>({chat:Ee,ready:!!s.data,renewing:x,newChat:we,send:xe,pending:ie,sendNow:Ce,takeBack:M,stop:Se,layout:w??l.data?.layout??`bottom`,setLayout:ue,open:te,setOpen:C,view:ne,setView:re,live:De,dev:{offered:O,on:k,set:Oe,turns:oe}}),[Ee,s.data,x,we,xe,ie,Ce,M,Se,w,l.data,ue,te,ne,De,O,k,Oe,oe]);return(0,I.jsx)(Rs.Provider,{value:ke,children:e})}function Hs(e){return Ft({queryKey:[`assistant-chats`],queryFn:()=>N.get(`/api/studio/assistant/chats`),enabled:e,refetchInterval:e=>e.state.data?.chats.some(e=>e.summarising)?2e3:!1})}function Us(e){return Ft({queryKey:[`assistant-chat`,e],queryFn:async()=>{let t=await N.get(`/api/studio/assistant/chats/${e}`);return{...t,messages:t.messages.map(Ps)}},enabled:!!e})}var Ws=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e),Gs=e=>e<1e3?`${e} ms`:`${(e/1e3).toFixed(1)} s`,Ks=e=>e?`$${e<.01?e.toFixed(4):e.toFixed(3)}`:`$0`,qs=e=>Math.round(e/4),Js=(e,t)=>c(`assistant.tokens`,{input:Ws(e),output:Ws(t),total:Ws(e+t)});function Ys({steps:e}){return e?.length?(0,I.jsx)(`div`,{className:`mt-1.5 flex flex-col gap-0.5`,children:e.map(e=>(0,I.jsxs)(`details`,{className:`group text-[0.75rem] text-ink-4`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer list-none truncate hover:text-ink-3`,children:[c(`assistant.step`,{n:e.step}),e.model,Js(e.inputTokens,e.outputTokens),Gs(e.ms),e.costUsd?Ks(e.costUsd):null].filter(Boolean).join(` · `)}),(0,I.jsxs)(`div`,{className:`mt-1 rounded-lg bg-paper-2 px-3 py-2 font-mono text-[0.6875rem] text-ink-3`,children:[c(`assistant.stepTools`),`: `,e.tools.length?e.tools.join(`, `):`–`,e.cachedInputTokens?` · cache ${Ws(e.cachedInputTokens)}`:``]})]},e.step))}):null}function Xs(e){if(typeof e!=`string`)return JSON.stringify(e,null,2)??``;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function Zs({calls:e}){return e?.length?(0,I.jsx)(`div`,{className:`mb-1.5 flex flex-col gap-1`,children:e.map(e=>(0,I.jsxs)(`details`,{className:`rounded-lg bg-paper-2 text-[0.75rem]`,children:[(0,I.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,I.jsxs)(`div`,{className:`flex flex-col gap-1 px-2.5 pb-2`,children:[(0,I.jsx)(`span`,{className:`text-ink-4`,children:c(`assistant.args`)}),(0,I.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-[0.6875rem] text-ink-2`,children:Xs(e.args)}),e.result===void 0?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-ink-4`,children:c(`assistant.result`)}),(0,I.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-[0.6875rem] text-ink-2`,children:Xs(e.result)})]})]})]},e.toolCallId))}):null}function Qs(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 $s({ratio:e}){let t=2*Math.PI*7;return(0,I.jsxs)(`svg`,{viewBox:`0 0 18 18`,className:`size-[18px] -rotate-90`,"aria-hidden":`true`,children:[(0,I.jsx)(`circle`,{cx:`9`,cy:`9`,r:7,fill:`none`,strokeWidth:`2.5`,className:`stroke-paper-3`}),(0,I.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 ec({messages:e,narrow:t}){let[n,r]=(0,P.useState)(!1),i=(0,P.useRef)(null);xd(i,n,()=>r(!1));let a=Qs(e);if(!a.lastStep)return null;let o=a.window?a.context/a.window:0,s=(e,t)=>(0,I.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,I.jsx)(`span`,{className:`text-ink-3`,children:e}),(0,I.jsx)(`span`,{className:`font-mono tabular-nums`,children:t})]});return(0,I.jsxs)(`div`,{className:`relative`,ref:i,children:[(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":n,title:c(`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,I.jsxs)(`span`,{className:`whitespace-nowrap max-sm:hidden`,children:[Ws(a.last.input+a.last.output),` / `,Ws(a.thread.input+a.thread.output)]}),(0,I.jsx)($s,{ratio:o})]}),n?(0,I.jsxs)(`div`,{role:`dialog`,"aria-label":c(`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,I.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,I.jsx)(`span`,{className:`font-medium`,children:c(`assistant.window`)}),(0,I.jsxs)(`span`,{className:`font-mono text-[0.75rem] text-ink-3`,children:[Ws(a.context),` /`,` `,a.window?`${Ws(a.window)} (${Math.round(o*100)}%)`:`?`]})]}),(0,I.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-paper-2`,children:(0,I.jsx)(`span`,{className:D(`block h-full rounded-full`,o>.8?`bg-rose`:`bg-ember`),style:{width:`${Math.min(100,o*100)}%`}})}),(0,I.jsx)(`span`,{className:`truncate text-[0.75rem] text-ink-4`,children:a.lastStep.model}),(0,I.jsx)(`span`,{className:`mt-1 font-medium text-[0.75rem] text-ink-3`,children:c(`assistant.lastTurn`)}),s(c(`assistant.promptTokens`),Ws(a.last.input)),s(c(`assistant.answerTokens`),Ws(a.last.output)),s(c(`assistant.duration`),Gs(a.last.ms)),s(c(`assistant.cost`),Ks(a.last.cost)),(0,I.jsx)(`span`,{className:`mt-1 font-medium text-[0.75rem] text-ink-3`,children:c(`assistant.wholeChat`)}),s(c(`assistant.promptTokens`),Ws(a.thread.input)),s(c(`assistant.answerTokens`),Ws(a.thread.output)),s(c(`assistant.steps`),String(a.thread.steps)),s(c(`assistant.cost`),Ks(a.thread.cost))]}):null]})}function tc(e,t){return JSON.stringify({messages:e.map(({previews:e,...t})=>t),turns:t},null,2)}function nc({messages:e,turns:t}){let[n,r]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>r(!1),1500);return()=>clearTimeout(e)},[n]),(0,I.jsx)(y,{label:c(n?`assistant.copied`:`assistant.copyThread`),onClick:()=>void navigator.clipboard.writeText(tc(e,t)).then(()=>r(!0)),className:`size-8`,children:n?(0,I.jsx)(Ie,{className:`size-4`}):(0,I.jsx)(Xe,{className:`size-4`})})}function rc({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:c(`assistant.system`),chars:e.system.length},{label:c(`assistant.context`),chars:e.context.length},{label:c(`assistant.history`,{n:e.history.length}),chars:t},{label:c(`assistant.tools`,{n:e.tools.length}),chars:n}],i=r.reduce((e,t)=>e+t.chars,0)||1,a=(e,t)=>(0,I.jsxs)(`details`,{className:`rounded-lg bg-paper-2`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer px-3 py-2 font-medium text-[0.8125rem]`,children:e}),(0,I.jsx)(`div`,{className:`px-3 pb-3`,children:t})]});return(0,I.jsxs)(`div`,{className:`flex flex-col gap-3 text-[0.8125rem]`,children:[(0,I.jsxs)(`div`,{className:`flex justify-between text-ink-3`,children:[(0,I.jsx)(`span`,{className:`font-mono`,children:e.model}),(0,I.jsx)(`span`,{children:c(`assistant.estimate`,{tokens:Ws(qs(i))})})]}),(0,I.jsx)(`div`,{className:`flex h-2 overflow-hidden rounded-full bg-paper-2`,children:r.map((e,t)=>(0,I.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,I.jsx)(`ul`,{className:`flex flex-col gap-1`,children:r.map(e=>(0,I.jsxs)(`li`,{className:`flex justify-between gap-4`,children:[(0,I.jsx)(`span`,{children:e.label}),(0,I.jsxs)(`span`,{className:`font-mono text-ink-3 tabular-nums`,children:[Ws(qs(e.chars)),` · `,Math.round(e.chars/i*100),`%`]})]},e.label))}),a(c(`assistant.system`),(0,I.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap font-mono text-[0.6875rem] text-ink-2`,children:e.system})),a(c(`assistant.context`),(0,I.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap font-mono text-[0.6875rem] text-ink-2`,children:e.context})),a(c(`assistant.tools`,{n:e.tools.length}),(0,I.jsx)(`ul`,{className:`flex flex-col gap-0.5 font-mono text-[0.6875rem]`,children:e.tools.map(e=>(0,I.jsxs)(`li`,{className:`flex justify-between gap-4`,children:[(0,I.jsx)(`span`,{children:e.name}),(0,I.jsx)(`span`,{className:`text-ink-3`,children:Ws(qs(e.chars))})]},e.name))}))]})}function ic({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:`${c(`assistant.step`,{n:e.step})} · ${Js(e.inputTokens,e.outputTokens)}`,from:t.at-e.ms,to:t.at,kind:`step`})}return r.sort((e,t)=>e.from-t.from),(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`div`,{className:`flex justify-between gap-3 text-[0.8125rem]`,children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.message}),(0,I.jsx)(`span`,{className:`shrink-0 text-ink-3 tabular-nums`,children:Gs(n)})]}),r.map((t,r)=>(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-[0.75rem]`,children:[(0,I.jsx)(`span`,{className:`w-40 shrink-0 truncate font-mono text-ink-3`,children:t.label}),(0,I.jsx)(`span`,{className:`relative h-3 flex-1 rounded bg-paper-2`,children:(0,I.jsx)(`span`,{className:D(`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,I.jsx)(`span`,{className:`w-14 shrink-0 text-right text-ink-4 tabular-nums`,children:Gs(t.to-t.from)})]},`${t.label}-${r}`))]})}function ac({open:e,onClose:t,turns:n,messages:r}){let[i,a]=(0,P.useState)(`timeline`),o=n.at(-1);return(0,I.jsx)(ue,{open:e,onClose:t,title:c(`assistant.turns`),wide:!0,height:`tall`,children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsx)(Te,{value:i,onChange:a,options:[{id:`timeline`,label:c(`assistant.turnsTimeline`)},{id:`prompt`,label:c(`assistant.turnsPrompt`)},{id:`events`,label:c(`assistant.turnsEvents`)}]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(nc,{messages:r,turns:n}),(0,I.jsx)(y,{label:c(`assistant.download`),onClick:()=>{let e=n.flatMap(e=>e.events.map(t=>JSON.stringify({turn:e.id,...t}))),t=new Blob([`${e.join(`
|
|
13
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,I.jsx)(_t,{className:`size-4`})})]})]}),n.length?i===`timeline`?(0,I.jsx)(`div`,{className:`flex flex-col gap-5`,children:n.map(e=>(0,I.jsx)(ic,{turn:e},e.id))}):i===`prompt`?o?.prompt?(0,I.jsx)(rc,{prompt:o.prompt}):(0,I.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:c(`assistant.noTurns`)}):(0,I.jsx)(`div`,{className:`flex flex-col gap-1 font-mono text-[0.6875rem]`,children:n.flatMap(e=>e.events.map((t,n)=>(0,I.jsxs)(`details`,{className:`rounded bg-paper-2`,children:[(0,I.jsxs)(`summary`,{className:`cursor-pointer px-2 py-1 text-ink-3`,children:[(0,I.jsxs)(`span`,{className:`tabular-nums`,children:[`+`,Gs(t.at-e.startedAt)]}),` `,(0,I.jsx)(`span`,{className:`text-ink`,children:t.event})]}),(0,I.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,I.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:c(`assistant.noTurns`)})]})})}var oc=(0,P.lazy)(()=>It(()=>Promise.resolve().then(()=>au).then(e=>({default:e.MarketplaceCards})),void 0)),sc=1520,cc=768,lc={min:120,max:900};function uc(){return(0,P.useSyncExternalStore)(e=>(window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)),()=>window.innerWidth)}function dc(e){let t=uc(),n=V(),r=t>=sc,i=t<cc,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 fc=new Set([`scroll_to`]);function pc(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 c(`assistant.tool.navigate`,{where:String(t.to??``)});case`highlight`:return c(`assistant.tool.highlight`,{what:i});case`look_at_page`:return c(`assistant.tool.look`);case`read_section`:return c(`assistant.tool.read`,{what:i});case`fill_field`:return c(`assistant.tool.fill`,{what:i});case`docs_search`:case`docs_read`:case`authoring_guide`:return c(`assistant.tool.docs`);case`gallery_search`:case`gallery_detail`:case`show_templates`:return c(`assistant.tool.gallery`);case`plans`:case`account`:case`usage`:return c(`assistant.tool.account`);case`chats_search`:case`chat_read`:return c(`assistant.tool.chats`);case`wizards`:case`runs`:return c(`assistant.tool.space`);case`models`:return c(`assistant.tool.models`);default:return null}}function mc({calls:e}){let t=[...new Set((e??[]).filter(e=>!fc.has(e.toolCallName)).map(pc).filter(e=>!!e))];return t.length?(0,I.jsx)(`div`,{className:`mb-1.5 flex flex-wrap gap-1.5`,children:t.map(e=>(0,I.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,I.jsx)(`span`,{className:`truncate`,children:e})},e))}):null}function hc({card:e,send:t}){if(!e.plugin&&e.tool===`templates`){let{entries:t}=e.data;return(0,I.jsx)(P.Suspense,{fallback:(0,I.jsx)(M,{className:`m-2 size-4`}),children:(0,I.jsx)(oc,{entries:t})})}return(0,I.jsx)(gc,{card:e,send:t})}function gc({card:e,send:t}){let n=Vd().cards.find(t=>t.plugin===e.plugin&&t.tool===e.tool);return n?(0,I.jsx)(pf,{of:n,children:(0,I.jsx)(n.component,{data:e.data,send:t})}):null}function _c(){return[{label:c(`assistant.suggest.what`)},{label:c(`assistant.suggest.models`)},{label:c(`assistant.suggest.credits`)}]}function vc({state:e,composer:t}){let n=V(),r=(n.suggestions?.length?n.suggestions:_c()).slice(0,3);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,I.jsx)(`div`,{className:`shrink-0`,children:(0,I.jsx)(qi,{kind:`round`,size:44,goggles:!0,interactive:!1})}),(0,I.jsxs)(`div`,{className:`min-w-0 pt-0.5`,children:[(0,I.jsx)(`h2`,{className:`font-display font-semibold text-[1.0625rem] leading-tight tracking-tight`,children:n.title??c(`assistant.helloTitle`)}),(0,I.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-2 leading-relaxed`,children:n.hello??c(`assistant.hello`)})]})]}),(0,I.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:r.map(n=>(0,I.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,I.jsx)(`span`,{className:`min-w-0 flex-1`,children:n.label}),n.fill?(0,I.jsx)(ii,{className:`size-3.5 shrink-0 text-ink-4`}):null]},n.label))})]})}function yc({state:e}){let t=Hs(!0);if(t.isLoading)return(0,I.jsx)(M,{className:`m-4 size-4`});let n=t.data?.chats??[];return n.length?(0,I.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.map(t=>(0,I.jsx)(`li`,{children:(0,I.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,I.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-[0.875rem]`,children:t.title||c(`assistant.untitled`)}),(0,I.jsx)(`span`,{className:`shrink-0 text-[0.75rem] text-ink-4 tabular-nums`,children:new Date(t.closedAt).toLocaleDateString(E)})]}),(0,I.jsx)(`span`,{className:`line-clamp-1 text-[0.8125rem] text-ink-3`,children:t.summarising?c(`assistant.summarising`):t.summary.split(`
|
|
14
|
-
`)[0]})]})},t.id))}):(0,I.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:c(`assistant.noEarlier`)})}function bc({id:e}){let t=Us(e);return t.data?(0,I.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,I.jsxs)(`div`,{className:`rounded-xl bg-paper-2 px-4 py-3 text-[0.8125rem] text-ink-2 leading-relaxed`,children:[(0,I.jsx)(`div`,{className:`font-medium text-ink`,children:t.data.title||c(`assistant.untitled`)}),(0,I.jsx)(`p`,{className:`mt-1 whitespace-pre-line`,children:t.data.summary})]}),(0,I.jsx)(So,{chat:{messages:t.data.messages,phase:`idle`,activity:null,startedAt:null,error:null,send:async()=>!1},avatar:`round`,changedLabel:c(`project.assistantChanged`),card:e=>(0,I.jsx)(hc,{card:e,send:()=>void 0}),calls:e=>(0,I.jsx)(mc,{calls:e.toolCalls})})]}):(0,I.jsx)(M,{className:`m-4 size-4`})}function xc({state:e,composer:t}){let n=(0,P.useRef)(null),{chat:r,view:i}=e;return(0,P.useEffect)(()=>{let e=n.current,t=e=>{let t=e.target.closest(`a`)?.getAttribute(`href`);!t||e.metaKey||e.ctrlKey||e.shiftKey||(Es(t)?e.preventDefault():/^https?:\/\//.test(t)&&(e.preventDefault(),window.open(t,`_blank`,`noopener,noreferrer`)))};return e?.addEventListener(`click`,t),()=>e?.removeEventListener(`click`,t)},[]),(0,P.useEffect)(()=>{n.current?.scrollTo({top:n.current.scrollHeight,behavior:`smooth`})},[r.messages,r.phase,i]),(0,I.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,I.jsx)(yc,{state:e}):i.kind===`read`?(0,I.jsx)(bc,{id:i.id}):r.messages.length?(0,I.jsx)(So,{chat:r,avatar:`round`,changedLabel:c(`project.assistantChanged`),card:e=>(0,I.jsx)(hc,{card:e,send:e=>void r.send(e)}),calls:t=>e.dev.on?(0,I.jsx)(Zs,{calls:t.toolCalls}):(0,I.jsx)(mc,{calls:t.toolCalls}),foot:t=>e.dev.on?(0,I.jsx)(Ys,{steps:t.steps}):null}):(0,I.jsx)(vc,{state:e,composer:t}),r.error&&i.kind===`chat`?(0,I.jsx)(`div`,{className:`mt-4 rounded-lg bg-rose-tint px-3 py-2 text-[0.8125rem] text-rose`,children:r.error}):null]})}function Sc({state:e}){let[t,n]=(0,P.useState)(!1),r=(0,P.useRef)(null);xd(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,I.jsxs)(`div`,{className:`relative shrink-0`,ref:r,children:[(0,I.jsxs)(`button`,{type:`button`,"aria-haspopup":`menu`,"aria-expanded":t,"aria-label":c(`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:[c(`assistant.name`),(0,I.jsx)(Pt,{className:`size-3.5 text-ink-4`})]}),t?(0,I.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,I.jsxs)(`button`,{type:`button`,role:`menuitem`,className:i,disabled:e.renewing,onClick:()=>{n(!1),e.newChat()},children:[(0,I.jsx)(ii,{className:`size-4`}),` `,c(`assistant.newChat`)]}),(0,I.jsxs)(`button`,{type:`button`,role:`menuitem`,className:i,onClick:()=>{n(!1),e.setView({kind:`earlier`})},children:[(0,I.jsx)(Jr,{className:`size-4`}),` `,c(`assistant.earlier`)]})]}):null]})}function Cc({state:e}){let t=e.dev.on;return(0,I.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"aria-label":c(`assistant.dev`),title:c(t?`assistant.devOn`:`assistant.devOff`),onClick:()=>e.dev.set(!t),className:D(`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,I.jsx)(`span`,{className:`size-4 rounded-full bg-white shadow-sm`})]})}function wc({state:e,where:t,wide:n,phone:r,compact:i,grip:a}){let o=e.live,[s,l]=(0,P.useState)(!1),u=hd().map(e=>e.label).join(` · `),d=e.dev.on&&e.view.kind===`chat`,f=t===`sidebar`,p=e.chat.messages;return(0,I.jsxs)(`div`,{className:D(`flex items-center border-border-soft border-b py-2`,f?`gap-1 px-3`:`gap-1.5 px-3 sm:px-4`),children:[a,e.view.kind===`chat`?t===`sidebar`?(0,I.jsx)(qi,{kind:`round`,size:26,goggles:!0,interactive:!1}):null:(0,I.jsx)(y,{label:c(`assistant.back`),onClick:()=>e.setView({kind:e.view.kind===`read`?`earlier`:`chat`}),className:`size-8`,children:(0,I.jsx)(j,{className:`size-4`})}),(0,I.jsxs)(`div`,{className:`ml-0.5 min-w-[8.5rem] flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[e.view.kind===`chat`?(0,I.jsx)(Sc,{state:e}):(0,I.jsx)(`span`,{className:`font-display font-semibold text-[0.9375rem]`,children:c(`assistant.earlier`)}),e.dev.offered&&e.view.kind===`chat`?(0,I.jsx)(Cc,{state:e}):null]}),o.state===`off`?u?(0,I.jsx)(`div`,{className:`truncate text-[0.75rem] text-ink-4`,children:c(`assistant.sees`,{page:u})}):null:(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[0.75rem] text-ember-strong`,children:[(0,I.jsx)(`span`,{className:`size-1.5 animate-pulse-dot rounded-full bg-ember`}),c(`assistant.live`),` · `,(0,I.jsx)(Tc,{since:o.since})]})]}),d?(0,I.jsx)(ec,{messages:p,narrow:f}):null,d?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(y,{label:c(`assistant.inspect`),onClick:()=>l(!0),className:`size-8 max-sm:hidden`,children:(0,I.jsx)(rn,{className:`size-4`})}),p.length&&!f?(0,I.jsx)(`span`,{className:`max-sm:hidden`,children:(0,I.jsx)(nc,{messages:p,turns:e.dev.turns})}):null,(0,I.jsx)(ac,{open:s,onClose:()=>l(!1),turns:e.dev.turns,messages:p})]}):null,e.view.kind===`chat`&&p.length?(0,I.jsx)(y,{label:c(`assistant.newChat`),disabled:e.renewing,onClick:()=>void e.newChat(),className:`size-8`,children:(0,I.jsx)(ii,{className:`size-4`})}):null,t!==`sidebar`&&n?(0,I.jsx)(y,{label:c(`assistant.layoutSidebar`),onClick:()=>e.setLayout(`sidebar`),className:`size-8`,children:(0,I.jsx)(Pr,{className:`size-4`})}):null,t===`sidebar`||t===`avatar`&&!r&&!i?(0,I.jsx)(y,{label:c(`assistant.layoutBottom`),onClick:()=>{e.setLayout(`bottom`),e.setOpen(!0)},className:`size-8`,children:(0,I.jsx)(Ar,{className:`size-4`})}):null,(0,I.jsx)(y,{label:c(`assistant.close`),onClick:()=>{t!==`avatar`&&e.setLayout(`avatar`),e.setOpen(!1)},className:`size-8`,children:(0,I.jsx)(Se,{className:`size-4`})})]})}function Tc({since:e}){let[t,n]=(0,P.useState)(()=>Date.now());(0,P.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,I.jsxs)(`span`,{className:`tabular-nums`,children:[String(Math.floor(r/60)).padStart(2,`0`),`:`,String(r%60).padStart(2,`0`)]})}function Ec({state:e}){let t=e.live,n=t.state===`thinking`?c(`assistant.liveThinking`):t.state===`speaking`?c(`assistant.liveSpeaking`):t.muted?c(`assistant.liveMuted`):c(`assistant.liveListening`);return(0,I.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,I.jsx)(`span`,{className:`size-2 shrink-0 animate-pulse-dot rounded-full bg-ember`}),(0,I.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,I.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,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[0.8125rem] text-ink-2`,children:t.heard?(0,I.jsx)(`span`,{className:`text-ink`,children:t.heard}):t.state===`thinking`?(0,I.jsx)(bo,{chat:e.chat,className:`text-ink-3`}):(0,I.jsxs)(I.Fragment,{children:[n,` · `,(0,I.jsx)(Tc,{since:t.since})]})}),t.voice&&t.voice.way!==`none`?(0,I.jsx)(y,{label:c(`assistant.naturalVoice`),"aria-pressed":t.voice.natural,onClick:()=>t.setNatural(!t.voice?.natural),className:D(t.voice.natural&&`bg-ember-tint text-ember-strong`),children:(0,I.jsx)(bi,{className:`size-4`})}):null,(0,I.jsx)(y,{label:t.muted?c(`assistant.unmute`):c(`assistant.mute`),"aria-pressed":t.muted,onClick:t.toggleMute,children:t.muted?(0,I.jsx)(Sr,{className:`size-4`}):(0,I.jsx)(et,{className:`size-4`})}),(0,I.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,I.jsx)(Br,{className:`size-4`}),` `,c(`assistant.end`)]})]})}function Dc({state:e,composer:t}){return e.pending.length?(0,I.jsx)(`ul`,{"aria-label":c(`assistant.pending`),className:`mb-2 flex flex-col gap-1`,children:e.pending.map(n=>(0,I.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,I.jsx)(`span`,{title:n.way===`queue`?c(`assistant.pendingQueueHint`):c(`assistant.pendingSignalHint`),className:D(`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`?c(`assistant.pendingQueue`):c(`assistant.pendingSignal`)}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n.text}),(0,I.jsx)(`button`,{type:`button`,title:c(`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:c(`assistant.sendNow`)}),(0,I.jsx)(y,{label:c(`assistant.edit`),onClick:()=>{let r=e.takeBack(n.id);r&&t.current?.fill(r.text)},className:`size-7`,children:(0,I.jsx)(o,{className:`size-3.5`})}),(0,I.jsx)(y,{label:c(`assistant.remove`),onClick:()=>e.takeBack(n.id),className:`size-7`,children:(0,I.jsx)(Se,{className:`size-3.5`})})]},n.id))}):null}function Oc({state:e,composer:t,floating:n,bare:r}){let i=V(),a=e.live;if(e.view.kind===`earlier`)return null;if(e.view.kind===`read`)return(0,I.jsx)(`p`,{className:`m-3 rounded-xl bg-paper-2 px-4 py-3 text-[0.8125rem] text-ink-2 leading-relaxed`,children:c(`assistant.readOnly`)});let o=e.chat.phase!==`idle`;return(0,I.jsxs)(`div`,{className:n?void 0:`p-3`,children:[a.state===`off`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Dc,{state:e,composer:t}),(0,I.jsx)(Le,{ref:t,floating:n,bare:r,placeholder:o?c(`assistant.busyComposer`,{keys:kt}):i.placeholder??c(`assistant.composer`),busy:o,onStop:e.stop,onSend:(t,n,r)=>e.send(t,n,r?`queue`:`signal`),onTalk:Go?()=>{e.setOpen(!0),a.start()}:void 0})]}):(0,I.jsx)(Ec,{state:e}),a.error?(0,I.jsx)(`p`,{className:`mt-2 px-3 text-[0.75rem] text-rose`,children:a.error===`denied`?c(`editor.micDenied`):a.error}):null]})}function kc({composer:e,children:t,className:n,style:r}){return(0,I.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 Ac(e){let[t,n]=(0,P.useState)({width:0,height:0});return(0,P.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 jc(e){return(t,n)=>{if(t===`sidebar`){e.setLayout(`sidebar`);return}Mo(t===`free`?{place:`free`,free:n}:{place:t})}}function Mc({state:e,column:t,frame:n,wide:r,from:i}){let a=No(),o=jc(e);return(0,I.jsx)(`button`,{type:`button`,title:c(`assistant.move`),"aria-label":c(`assistant.move`),onPointerDown:a=>Uo(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=Ho(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,I.jsx)(ze,{className:`size-4`})})}function Nc(){let e=zo();return e?.spot?(0,I.jsx)(`div`,{"aria-hidden":!0,className:D(`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 Pc({place:e,free:t,width:n,column:r,frame:i,children:a}){let o=zo(),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,I.jsx)(`div`,{ref:i,className:D(`pointer-events-none absolute flex flex-col`,o?`opacity-90`:`transition-[left,bottom] duration-300 ease-out`),style:s,children:a})}function Fc({thread:e,max:t,folded:n,onFold:r,onOpen:i}){let a=No(),o=(0,P.useRef)(null),s=e=>Math.round(Math.min(Math.max(e,lc.min),t)),l=a.height??e.current?.offsetHeight??lc.min;return(0,I.jsx)(`div`,{role:`separator`,tabIndex:0,"aria-orientation":`horizontal`,"aria-valuenow":l,"aria-valuemin":lc.min,"aria-valuemax":t,"aria-label":c(n?`assistant.open`:`assistant.flap`),title:c(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,Mo({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}Mo({height:s(l+(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,I.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 Ic({column:e}){let t=zs(),n=!!bs(),r=(0,P.useRef)(null),i=(0,P.useRef)(null),a=(0,P.useRef)(null),o=(0,P.useRef)(null),s=(0,P.useRef)(null),l=Rc(t),u=No(),d=Ac(e),f=t&&l&&l.where!==`sidebar`,p=Bo(d.width),m=l?.phone||u.place===`right`&&!Ho(d.width)||u.place===`free`&&!u.free?`center`:u.place,h=m!==`free`,g=l?.where===`avatar`,_=!!t?.open,[v,b]=(0,P.useState)(!1),ee=v||_||t?.chat.phase!==`idle`||(t?.live.state??`off`)!==`off`,x=g?!_:h;if((0,P.useLayoutEffect)(()=>{let t=i.current,n=e.current;if(!(t&&n&&f&&x)){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,f,x,g,_]),(0,P.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&&l&&f))return null;if(g&&!_)return(0,I.jsx)(kc,{composer:r,className:D(`pointer-events-none absolute inset-0`,n?`z-[61]`:`z-30`),children:(0,I.jsx)(`div`,{ref:i,className:`pointer-events-auto absolute right-3 bottom-3 sm:right-4 sm:bottom-4`,children:(0,I.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,I.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,I.jsxs)(`span`,{className:`relative`,children:[(0,I.jsx)(qi,{kind:`round`,size:36,goggles:!0,interactive:!1}),t.chat.phase!==`idle`||t.live.state!==`off`?(0,I.jsx)(`span`,{className:`absolute top-0 right-0 size-2.5 animate-pulse-dot rounded-full bg-ember ring-2 ring-card`}):null]}),(0,I.jsx)(`span`,{className:`max-sm:hidden`,children:c(`assistant.ask`)})]}),Go?(0,I.jsx)(y,{label:c(`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,I.jsx)(ye,{className:`size-4`})}):null]})})});let S=(0,I.jsx)(`button`,{type:`button`,"aria-label":c(`assistant.open`),title:`${c(`assistant.open`)} · ${c(`assistant.move`)}`,tabIndex:-1,onPointerDown:n=>Uo(n,{column:()=>e.current,frame:()=>o.current,sidebar:l.wide,onClick:()=>t.setOpen(!0),onDrop:jc(t)}),onClick:e=>{e.detail===0&&t.setOpen(!0)},className:D(`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`,ee?`translate-y-0 scale-100 opacity-100`:`pointer-events-none translate-y-3 scale-75 opacity-0`),children:(0,I.jsx)(qi,{kind:`round`,size:44,goggles:!0,interactive:ee})}),te=Math.max(lc.min,Math.min(lc.max,d.height-220)),C=u.height===null?null:Math.min(u.height,te),ne=l.phone?void 0:(0,I.jsx)(Mc,{state:t,column:e,frame:()=>o.current,wide:l.wide,from:`bottom`});return(0,I.jsxs)(kc,{composer:r,className:D(`pointer-events-none absolute inset-0`,n?`z-[61]`:`z-30`),children:[h&&!g?(0,I.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,I.jsx)(Nc,{}),(0,I.jsxs)(Pc,{place:m,free:u.free,width:p,column:d,frame:o,children:[S,(0,I.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,I.jsx)(Fc,{thread:s,max:te,folded:!_,onFold:()=>t.setOpen(!1),onOpen:()=>t.setOpen(!0)}),_?(0,I.jsx)(`div`,{className:`relative flex min-h-0 flex-col`,children:(0,I.jsxs)(`div`,{className:`flex min-h-0 animate-rise flex-col border-border-soft border-b`,style:{maxHeight:te+60},children:[(0,I.jsx)(wc,{state:t,where:g?`avatar`:`bottom`,wide:l.wide,phone:l.phone,compact:l.compact,grip:ne}),(0,I.jsx)(`div`,{ref:s,className:`flex min-h-0 flex-col`,style:C===null?{maxHeight:te}:{height:C},children:(0,I.jsx)(xc,{state:t,composer:r})})]})}):t.chat.messages.length||t.chat.error?(0,I.jsx)(Lc,{state:t}):null,(0,I.jsx)(`div`,{ref:i,onFocusCapture:()=>b(!0),onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||b(!1)},className:`relative w-full`,children:(0,I.jsx)(Oc,{state:t,composer:r,floating:!0,bare:!0})})]}),h?(0,I.jsx)(`div`,{ref:a,className:`h-[max(0.75rem,env(safe-area-inset-bottom))] shrink-0`}):null]})]})}function Lc({state:e}){let t=e.chat.messages.at(-1);return(0,I.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,I.jsx)(bo,{chat:e.chat,className:`flex-1`}):(0,I.jsx)(`span`,{className:D(`min-w-0 flex-1 truncate`,e.chat.error&&`text-rose`),children:e.chat.error??co(t?.content??``)})})}function Rc(e){let t=dc(e??zc);return e?t:null}var zc={layout:`bottom`,open:!1,chat:{messages:[]}};function Bc({column:e}){let t=zs(),n=!!bs(),r=(0,P.useRef)(null),i=Rc(t);return t&&i&&i.where===`sidebar`?(0,I.jsxs)(kc,{composer:r,className:D(`flex w-[400px] shrink-0 flex-col border-border-soft border-l bg-card`,n&&`relative z-[61]`),children:[(0,I.jsx)(wc,{state:t,where:`sidebar`,wide:i.wide,phone:i.phone,grip:(0,I.jsx)(Mc,{state:t,column:e,frame:()=>null,wide:i.wide,from:`sidebar`})}),(0,I.jsx)(xc,{state:t,composer:r}),(0,I.jsx)(Oc,{state:t,composer:r})]}):null}function Vc(){let e=bs(),t=zs(),[n,r]=(0,P.useState)(null);if((0,P.useEffect)(()=>{if(!e){r(null);return}let t=0,n=()=>{if(!e.el.isConnected){ys(null);return}r(e.el.getBoundingClientRect()),t=requestAnimationFrame(n)};n();let i=e=>{e.key===`Escape`&&ys(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),l=e=>{ys(null),t?.chat.send(e)};return(0,xa.createPortal)((0,I.jsxs)(`div`,{"data-assistant-ui":!0,className:`pointer-events-none fixed inset-0 z-[60]`,children:[e.mode===`spotlight`?(0,I.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:()=>ys(null),onKeyDown:void 0,role:`presentation`}):null,(0,I.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,I.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,I.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,I.jsx)(qi,{kind:`round`,size:28,goggles:!0,interactive:!1}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[e.title?(0,I.jsx)(`div`,{className:`font-medium text-[0.875rem]`,children:e.title}):null,e.text?(0,I.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-2 leading-relaxed`,children:e.text}):null]})]}),(0,I.jsxs)(`div`,{className:`mt-3 flex flex-wrap justify-end gap-1.5`,children:[e.buttons.map(e=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>l(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,I.jsx)(`button`,{type:`button`,onClick:()=>ys(null),className:`rounded-full bg-primary px-3 py-1.5 font-medium text-[0.8125rem] text-primary-foreground`,children:c(`assistant.gotIt`)})]})]}):null]}),document.body)}var Hc=[`update`],Uc=36e5;function Wc(e=!0){let t=At(),[n,r]=(0,P.useState)(null),i=Ft({queryKey:Hc,queryFn:()=>N.get(`/api/studio/update`),staleTime:Uc,refetchInterval:Uc,retry:!1,enabled:e}),a=F({mutationFn:()=>N.get(`/api/studio/update?fresh=1`),onSuccess:e=>t.setQueryData(Hc,e)}),o=F({mutationFn:()=>N.post(`/api/studio/update`),onSuccess:e=>t.setQueryData(Hc,e)}),s=i.data,l=s?.latest??null,u=s?.restarts&&(s.applying===`running`||s.applying===`done`),d=s?.current;return(0,P.useEffect)(()=>{if(!(u||s?.applying===`running`)||!l)return;let e=setInterval(async()=>{try{let e=await N.get(`/api/studio/update`);if(e.current!==d){window.location.reload();return}t.setQueryData(Hc,e),e.applying===`done`&&e.restarts&&r(l)}catch{r(l)}},2e3);return()=>clearInterval(e)},[u,s?.applying,l,d,t]),{status:i,data:s,latest:l,check:a,apply:o,busy:s?.applying===`running`||n!==null,progress:!s||!l?null:n===null?s.applying===`running`?c(`about.update.installing`,{v:l}):s.applying===`done`?c(`about.update.done`,{v:l}):s.applying===`failed`?c(`about.update.failed`):null:c(`about.update.restarting`,{v:l})}}var Gc=(0,P.lazy)(()=>It(()=>import(`./AboutDialog-D4mvc-zu.js`).then(e=>({default:e.AboutDialog})),__vite__mapDeps([4,1,2,5,6,7,8]))),Kc=`0.7.5`;function qc({me:e}){let[t,n]=(0,P.useState)(!1);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{type:`button`,className:`tabular-nums transition hover:text-ink-2`,onClick:()=>n(!0),children:c(`about.version`,{v:Kc})}),t?(0,I.jsx)(P.Suspense,{fallback:null,children:(0,I.jsx)(Gc,{open:!0,me:e,onClose:()=>n(!1)})}):null]})}function Jc({enabled:e=!0,align:t=`center`}){let{status:n,data:r,latest:i,check:a,apply:o,busy:s,progress:l}=Wc(e),d=r?.checkedAt?new Date(r.checkedAt).toLocaleTimeString(E,{hour:`2-digit`,minute:`2-digit`}):null,f=t===`center`;return(0,I.jsxs)(`div`,{className:D(`flex flex-col gap-3 text-[0.875rem] text-ink-2`,f?`items-center text-center`:`items-start`),children:[n.isPending||a.isPending?(0,I.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,I.jsx)(M,{className:`size-4 text-ember-strong`}),c(`about.update.checking`)]}):l?(0,I.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[s?(0,I.jsx)(M,{className:`size-4 text-ember-strong`}):null,l]}):r?.newer&&i?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2.5 font-medium text-ink`,children:[(0,I.jsx)(_t,{className:`size-4 shrink-0 text-ember-strong`}),c(`about.update.available`,{v:i})]}),r.canApply?null:(0,I.jsx)(`p`,{className:`text-ink-3`,children:c(`about.update.manual`)})]}):r?.enabled?r.latest===null?(0,I.jsx)(`p`,{children:c(`about.update.unknown`)}):(0,I.jsxs)(`p`,{children:[c(`about.update.upToDate`),d?(0,I.jsxs)(`span`,{className:`text-ink-4`,children:[` `,`· `,c(`about.update.checkedAt`,{when:d})]}):null]}):(0,I.jsx)(`p`,{children:c(`about.update.off`)}),s||n.isPending?null:(0,I.jsxs)(`div`,{className:D(`flex flex-wrap gap-2`,f&&`justify-center`),children:[r?.newer&&r.canApply&&r.applying!==`running`?(0,I.jsxs)(u,{size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(),children:[(0,I.jsx)(_t,{className:`size-4`}),` `,c(`about.update.install`)]}):null,r?.enabled===!1?null:(0,I.jsxs)(u,{size:`sm`,variant:`secondary`,disabled:a.isPending,onClick:()=>a.mutate(),children:[(0,I.jsx)(De,{className:D(`size-4`,a.isPending&&`animate-spin`)}),` `,c(`about.update.check`)]})]})]})}function Yc({me:e}){let t=e.mode===`local`,{status:n,data:r,latest:i,check:a,apply:o,busy:s,progress:l}=Wc(t),d=n.isPending||a.isPending;return(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-2 text-[0.8125rem] text-ink-3`,children:[(0,I.jsx)(qc,{me:e}),(0,I.jsx)(`span`,{"aria-hidden":!0,children:`·`}),t?d?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,I.jsx)(M,{className:`size-3.5 text-ember-strong`}),` `,c(`about.update.checking`)]}):l?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[s?(0,I.jsx)(M,{className:`size-3.5 text-ember-strong`}):null,l]}):r?.newer&&i?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-ink`,children:[(0,I.jsx)(_t,{className:`size-3.5 shrink-0 text-ember-strong`}),c(`about.update.available`,{v:i})]}):r?.enabled?r.latest===null?(0,I.jsx)(`span`,{children:c(`about.update.unknown`)}):(0,I.jsx)(`span`,{children:c(`about.update.upToDate`)}):(0,I.jsx)(`span`,{children:c(`about.update.off`)}):(0,I.jsx)(`span`,{children:c(`about.kind.cloud`)}),!t||d||s?null:r?.newer&&r.canApply?(0,I.jsxs)(u,{size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(),children:[(0,I.jsx)(_t,{className:`size-4`}),` `,c(`about.update.install`)]}):r?.enabled?(0,I.jsx)(y,{label:c(`about.update.check`),className:`size-7 coarse:size-9`,onClick:()=>a.mutate(),children:(0,I.jsx)(De,{className:`size-3.5`})}):null]})}var Xc=`cubic-bezier(0.3, 0.7, 0.2, 1)`,Zc=`(max-width: 639px)`;function Qc({tone:e=`ground`,ink:t}){let n=Ue(),r=na(),i=Me();return i?(0,I.jsx)($c,{langs:[`en`,i],value:n,onPick:e=>{g(e)&&r(e)},tone:e,ink:t}):null}function $c({langs:e,value:t,onPick:n,tone:r=`ground`,ink:i,label:a}){let o=wt(Zc),s=(0,P.useRef)({}),[l,u]=(0,P.useState)(null),d=e=>a?a(e):rt(e),f=e.join(`|`);(0,P.useLayoutEffect)(()=>{let e=()=>{let e={};for(let[t,n]of Object.entries(s.current))e[t]=n?Math.ceil(n.getBoundingClientRect().width):0;u(e)};e(),document.fonts?.ready.then(e)},[f]);let p=e=>l?(l[e===t&&!o?`${e}-full`:`${e}-short`]??0)+24:void 0,m=l?e.slice(0,e.indexOf(t)).reduce((e,t)=>e+(p(t)??0),0):0,h=`300ms ${Xc}`,g=r===`ground`;return(0,I.jsxs)(`fieldset`,{className:D(`relative inline-flex items-center rounded-full border-0 p-0.5 ring-1`,g?`bg-white/10 ring-white/15`:`bg-paper-2 ring-border-soft`),children:[(0,I.jsx)(`legend`,{className:`sr-only`,children:c(`nav.language`)}),l?(0,I.jsx)(`span`,{"aria-hidden":`true`,className:D(`absolute top-0.5 bottom-0.5 left-0.5 rounded-full shadow-sm motion-reduce:transition-none`,g?`bg-white`:`bg-card`),style:{width:p(t),transform:`translateX(${m}px)`,transition:`transform ${h}, width ${h}`}}):null,e.map(e=>{let r=e===t;return(0,I.jsxs)(`button`,{"aria-pressed":r,className:D(`relative h-7 cursor-pointer overflow-hidden whitespace-nowrap rounded-full font-medium text-[0.75rem] motion-reduce:transition-none`,g?r?`text-[oklch(32%_0.15_262)]`:`text-white/70`:r?`text-ink`:`text-ink-3`),lang:e,onClick:()=>{r||n(e)},style:{width:p(e),transition:`width ${h}, color ${h}`,...g&&r&&i?{color:i}:{}},title:d(e),type:`button`,children:[[d(e),e.toUpperCase()].map((e,t)=>{let n=r&&!o?t===0:t===1;return(0,I.jsx)(`span`,{"aria-hidden":!n,className:`absolute inset-0 grid place-items-center motion-reduce:transition-none`,style:{opacity:+!!n,transition:`opacity 220ms ${Xc}`},children:e},`${t}:${e}`)}),(0,I.jsx)(`span`,{ref:t=>{s.current[`${e}-full`]=t},"aria-hidden":`true`,className:`invisible absolute`,children:d(e)}),(0,I.jsx)(`span`,{ref:t=>{s.current[`${e}-short`]=t},"aria-hidden":`true`,className:`invisible absolute`,children:e.toUpperCase()}),(0,I.jsx)(`span`,{className:`invisible px-3`,children:r?d(e):e.toUpperCase()})]},e)})]})}function el(){let e=Ue(),t=na();return(0,I.jsx)(p,{className:`w-44`,value:e,onChange:e=>{g(e)&&t(e)},options:Be.map(e=>({value:e,label:Ke[e]}))})}var tl=[`text`,`image`,`video`,`speech`,`listening`],nl={text:[`classifier`,`standard`,`high`,`highest`],image:[`image`],video:[`video`],speech:[`speech`],listening:[`audio`]},rl=`credits`,il=`${rl}:`;function al(e){return e===`credits`||!!e?.startsWith(il)}function ol(e){return e?.startsWith(il)&&e.slice(il.length)||null}function sl(e){return e?`${il}${e}`:rl}function cl(e){return e===`transcription`?`listening`:e}var ll=[`openai`,`anthropic`,`google`,`fal`,`elevenlabs`,`replicate`,`gateway`],ul={en:{"about.openai":`GPT models, GPT Image and voices.`,fast:`fast`,thorough:`thorough`,versatile:`versatile`,lowCost:`low cost`,fastLowCost:`fast, low cost`,"about.anthropic":`The Claude models.`,strongest:`strongest`,"about.google":`Gemini, Veo for video and voices – one key from AI Studio.`,fastEditsPhotos:`fast, edits photos`,bestQuality:`best quality`,withSound:`with sound`,"about.fal":`Hundreds of image, video and audio models with one key: FLUX, Recraft, Veo, Luma, MiniMax.`,highQuality:`high quality`,graphicsLogosTextIn:`graphics, logos, text in images`,photorealistic:`photorealistic`,"about.elevenlabs":`Natural voices in many languages and accurate transcripts.`,naturalManyLanguages:`natural, many languages`,expressive:`expressive`,veryAccurate:`very accurate`,"about.replicate":`Open image and video models, billed per run.`,"about.gateway":`One key for many providers’ models, billed by Vercel.`},de:{"about.openai":`GPT-Modelle, GPT Image und Stimmen.`,fast:`schnell`,thorough:`gründlich`,versatile:`vielseitig`,lowCost:`günstig`,fastLowCost:`schnell, günstig`,"about.anthropic":`Die Claude-Modelle.`,strongest:`am stärksten`,"about.google":`Gemini, Veo für Videos und Stimmen – ein Key aus dem AI Studio.`,fastEditsPhotos:`schnell, bearbeitet Fotos`,bestQuality:`beste Qualität`,withSound:`mit Ton`,"about.fal":`Hunderte Bild-, Video- und Audio-Modelle mit einem Key: FLUX, Recraft, Veo, Luma, MiniMax.`,highQuality:`hohe Qualität`,graphicsLogosTextIn:`Grafiken, Logos, Text im Bild`,photorealistic:`fotorealistisch`,"about.elevenlabs":`Natürliche Stimmen in vielen Sprachen und genaue Transkripte.`,naturalManyLanguages:`natürlich, viele Sprachen`,expressive:`ausdrucksstark`,veryAccurate:`sehr genau`,"about.replicate":`Offene Bild- und Video-Modelle, abgerechnet pro Lauf.`,"about.gateway":`Ein Key für die Modelle vieler Anbieter, abgerechnet bei Vercel.`}},dl=(e,t)=>$e(ul,e,t),fl=[{id:`openai`,name:`OpenAI`,about:`about.openai`,keyUrl:`https://platform.openai.com/api-keys`,keyPlaceholder:`sk-…`,text:{classifier:`openai:gpt-5.4-mini`,standard:`openai:gpt-5.4-mini`,high:`openai:gpt-5.5`,highest:`openai:gpt-5.5`},models:{text:[{ref:`openai:gpt-5.4-mini`,label:`GPT-5.4 mini`,note:`fast`},{ref:`openai:gpt-5.5`,label:`GPT-5.5`,note:`thorough`}],image:[{ref:`openai:gpt-image-2`,label:`GPT Image 2`,note:`versatile`},{ref:`openai:gpt-image-1-mini`,label:`GPT Image 1 mini`,note:`lowCost`}],speech:[{ref:`openai:gpt-4o-mini-tts`,label:`GPT-4o mini TTS`,note:`lowCost`}],listening:[{ref:`openai:gpt-4o-mini-transcribe`,label:`GPT-4o mini Transcribe`,note:`fastLowCost`},{ref:`openai:whisper-1`,label:`Whisper`}]}},{id:`anthropic`,name:`Anthropic`,about:`about.anthropic`,keyUrl:`https://console.anthropic.com/settings/keys`,keyPlaceholder:`sk-ant-…`,text:{classifier:`anthropic:claude-haiku-4-5`,standard:`anthropic:claude-haiku-4-5`,high:`anthropic:claude-sonnet-5-5`,highest:`anthropic:claude-opus-5-5`},models:{text:[{ref:`anthropic:claude-haiku-4-5`,label:`Claude Haiku 4.5`,note:`fast`},{ref:`anthropic:claude-sonnet-5-5`,label:`Claude Sonnet 5.5`},{ref:`anthropic:claude-opus-5-5`,label:`Claude Opus 5.5`,note:`strongest`}]}},{id:`google`,name:`Google Gemini`,about:`about.google`,keyUrl:`https://aistudio.google.com/apikey`,keyPlaceholder:`AIza…`,text:{classifier:`google:gemini-flash-lite-latest`,standard:`google:gemini-flash-latest`,high:`google:gemini-pro-latest`,highest:`google:gemini-pro-latest`},models:{text:[{ref:`google:gemini-flash-lite-latest`,label:`Gemini Flash-Lite`,note:`lowCost`},{ref:`google:gemini-flash-latest`,label:`Gemini Flash`},{ref:`google:gemini-pro-latest`,label:`Gemini Pro`,note:`thorough`}],image:[{ref:`google:gemini-3.1-flash-image-preview`,label:`Gemini 3.1 Flash Image`,note:`fastEditsPhotos`},{ref:`google:gemini-3-pro-image-preview`,label:`Gemini 3 Pro Image`,note:`bestQuality`}],video:[{ref:`google:veo-3.1-fast-generate-preview`,label:`Veo 3.1 Fast`,note:`withSound`},{ref:`google:veo-3.1-generate-preview`,label:`Veo 3.1`,note:`bestQuality`}],speech:[{ref:`google:gemini-3.8-flash-tts`,label:`Gemini Flash TTS`}],listening:[{ref:`google:gemini-flash-lite-latest`,label:`Gemini Flash-Lite`}]}},{id:`fal`,name:`fal.ai`,about:`about.fal`,keyUrl:`https://fal.ai/dashboard/keys`,keyPlaceholder:`xxxxxxxx-…:…`,models:{image:[{ref:`fal:fal-ai/flux/schnell`,label:`FLUX.1 schnell`,note:`fastLowCost`},{ref:`fal:fal-ai/flux-pro/v1.1`,label:`FLUX 1.1 pro`,note:`highQuality`},{ref:`fal:fal-ai/recraft/v3/text-to-image`,label:`Recraft V3`,note:`graphicsLogosTextIn`},{ref:`fal:fal-ai/imagen4/preview`,label:`Imagen 4`,note:`photorealistic`}],video:[{ref:`fal:veo3/fast`,label:`Veo 3 Fast`,note:`withSound`},{ref:`fal:luma-ray-2-flash`,label:`Luma Ray 2 Flash`,note:`fast`},{ref:`fal:minimax-video`,label:`MiniMax Hailuo`}],speech:[{ref:`fal:fal-ai/minimax/speech-02-turbo`,label:`MiniMax Speech-02 Turbo`,note:`fast`},{ref:`fal:fal-ai/minimax/speech-02-hd`,label:`MiniMax Speech-02 HD`}],listening:[{ref:`fal:wizper`,label:`Wizper`,note:`fast`},{ref:`fal:whisper`,label:`Whisper`}]}},{id:`elevenlabs`,name:`ElevenLabs`,about:`about.elevenlabs`,keyUrl:`https://elevenlabs.io/app/settings/api-keys`,keyPlaceholder:`sk_…`,models:{speech:[{ref:`elevenlabs:eleven_multilingual_v2`,label:`Multilingual v2`,note:`naturalManyLanguages`},{ref:`elevenlabs:eleven_flash_v2_5`,label:`Flash v2.5`,note:`fastLowCost`},{ref:`elevenlabs:eleven_v3`,label:`Eleven v3`,note:`expressive`}],listening:[{ref:`elevenlabs:scribe_v2`,label:`Scribe v2`,note:`veryAccurate`}]}},{id:`replicate`,name:`Replicate`,about:`about.replicate`,keyUrl:`https://replicate.com/account/api-tokens`,keyPlaceholder:`r8_…`,models:{image:[{ref:`replicate:black-forest-labs/flux-schnell`,label:`FLUX.1 schnell`,note:`fastLowCost`},{ref:`replicate:black-forest-labs/flux-1.1-pro`,label:`FLUX 1.1 pro`},{ref:`replicate:recraft-ai/recraft-v3`,label:`Recraft V3`}],video:[{ref:`replicate:minimax/video-01`,label:`MiniMax Video-01`}]}},{id:`gateway`,name:`Vercel AI Gateway`,about:`about.gateway`,keyUrl:`https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai-gateway%2Fapi-keys`,keyPlaceholder:`vck_…`,text:{classifier:`anthropic/claude-haiku-4.5`,standard:`anthropic/claude-haiku-4.5`,high:`anthropic/claude-sonnet-5.5`,highest:`anthropic/claude-sonnet-5.5`},models:{text:[{ref:`anthropic/claude-haiku-4.5`,label:`Claude Haiku 4.5`,note:`fast`},{ref:`anthropic/claude-sonnet-5.5`,label:`Claude Sonnet 5.5`},{ref:`openai/gpt-5.5`,label:`GPT-5.5`},{ref:`google/gemini-3.5-flash`,label:`Gemini 3.5 Flash`}],image:[{ref:`google/gemini-3.1-flash-image`,label:`Gemini 3.1 Flash Image`}],video:[{ref:`google/veo-3.1-fast-generate-001`,label:`Veo 3.1 Fast`,note:`withSound`}],speech:[{ref:`google/gemini-3.8-flash-tts`,label:`Gemini Flash TTS`}],listening:[{ref:`google/gemini-3.5-flash-lite`,label:`Gemini 3.5 Flash-Lite`}]}}];function pl(e){return fl.find(t=>t.id===e)??null}function ml(e){if(al(e))return null;let t=/^([a-z]+):/.exec(e)?.[1];return t?ll.includes(t)?t:null:e?.includes(`/`)?`gateway`:null}function hl(e){for(let t of fl)for(let n of Object.values(t.models)){let t=n?.find(t=>t.ref===e);if(t)return t.label}return e.replace(/^[a-z]+:/,``)}function gl(e){let t=window.engentyDesktop;t?t.open(e):window.open(e,`_blank`,`noopener`)}var _l=fl.filter(e=>e.text);function vl({models:e}){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(ce,{children:c(`local.keys`)}),(0,I.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:c(`local.keysHint`)})]}),(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[_l.map(t=>(0,I.jsx)(yl,{provider:t,stored:!!e.keys[t.id]},t.id)),(0,I.jsx)(bl,{url:e.ollamaUrl})]}),(0,I.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:c(`local.modelsLater`)})]})}function U(e){let t=At();return F({mutationFn:t=>N.post(e,t),onSuccess:()=>t.invalidateQueries({queryKey:[`me`]})})}function yl({provider:e,stored:t}){let n=At(),[r,i]=(0,P.useState)(``),a=U(`/api/studio/local/keys/${e.id}`),o=()=>a.mutate(r.trim()?{key:r.trim()}:{},{onSuccess:e=>e.ok?i(``):void 0}),s=F({mutationFn:()=>N.put(`/api/studio/local/models`,{keys:{[e.id]:``}}),onSuccess:async()=>{a.reset(),await n.invalidateQueries({queryKey:[`me`]})}});return(0,I.jsx)(Sl,{label:e.name,sub:(0,I.jsxs)(`button`,{type:`button`,onClick:()=>gl(e.keyUrl),className:`inline-flex items-center gap-1 text-left hover:text-ink-2 hover:underline`,children:[c(`local.keyGet`),` `,(0,I.jsx)(Ve,{className:`size-3`})]}),input:(0,I.jsx)(ne,{type:`password`,autoComplete:`off`,className:`min-w-0 flex-1 font-mono text-[0.8125rem]`,placeholder:t?c(`local.keySet`):e.keyPlaceholder,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&r.trim()&&o()}}),actions:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u,{variant:`secondary`,busy:a.isPending,disabled:!t&&!r.trim(),onClick:o,children:c(`local.test`)}),t?(0,I.jsx)(u,{variant:`ghost`,size:`sm`,busy:s.isPending,onClick:()=>s.mutate(),children:c(`local.keyRemove`)}):null]}),said:xl(a,t=>ml(t)===e.id)})}function bl({url:e}){let[t,n]=(0,P.useState)(e),r=U(`/api/studio/local/ollama`);return(0,I.jsx)(Sl,{label:`Ollama`,sub:c(`local.ollamaWhere`),input:(0,I.jsx)(ne,{className:`min-w-0 flex-1 font-mono text-[0.8125rem]`,value:t,onChange:e=>n(e.target.value)}),actions:(0,I.jsx)(u,{variant:`secondary`,busy:r.isPending,disabled:!t.trim(),onClick:()=>r.mutate({url:t.trim()}),children:c(`local.test`)}),said:xl(r,e=>e.startsWith(`ollama:`))})}function xl(e,t){if(e.isError)return{ok:!1,text:e.error.message};let n=e.data;if(!n)return null;if(!n.ok)return{ok:!1,text:n.message??c(`models.keyBad`)};if(!n.text)return{ok:!0,text:c(`local.keyWorksPlain`)};let r=hl(n.text);return{ok:!0,text:c(t(n.text)?`local.keyWorks`:`local.keyWorksOther`,{model:r})}}function Sl({label:e,sub:t,input:n,actions:r,said:i}){return(0,I.jsxs)(`div`,{className:`grid gap-x-3 gap-y-1.5 border-border-soft border-t py-3 sm:grid-cols-[10rem_minmax(0,1fr)]`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[0.875rem] text-ink-2`,children:e}),(0,I.jsx)(`div`,{className:`text-[0.75rem] text-ink-4`,children:t})]}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[n,r]}),i?(0,I.jsxs)(`p`,{className:D(`flex items-start gap-1.5 text-[0.8125rem]`,i.ok?`text-moss`:`text-rose`),children:[i.ok?(0,I.jsx)(Ie,{className:`mt-0.5 size-3.5 shrink-0`,strokeWidth:3}):null,i.text]}):null]})]})}var Cl=[{theme:`light`,icon:ci,label:`theme.light`},{theme:`dark`,icon:Er,label:`theme.dark`}],wl=`cubic-bezier(0.3, 0.7, 0.2, 1)`;function Tl({tone:e=`surface`}){let t=Vi(),n=Bi(),r=e===`ground`,i=r?n:t,a=Cl.findIndex(e=>e.theme===i);return(0,I.jsxs)(`fieldset`,{className:D(`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,I.jsx)(`legend`,{className:`sr-only`,children:c(`nav.theme`)}),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:D(`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 ${wl}`}}),Cl.map(({theme:e,icon:t,label:n})=>(0,I.jsx)(`button`,{"aria-label":c(n),"aria-pressed":e===i,className:D(`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:()=>Ri(e),title:c(n),type:`button`,children:(0,I.jsx)(t,{className:`size-3.5`})},e))]})}function El(e){try{return new URL(e).host}catch{return e}}var Dl=e=>`${Ne()}/w/${e.shareToken}`;function Ol(e,t,n){if(!e.published)return{kind:`draft`};if(t.mode===`managed`)return{kind:`live`,url:Dl(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:c(`cloud.notSent`)}:!r.runnable||!o||a===null?{kind:`missing`,url:o,runs:a,why:`${c(`cloud.notRunnable`,{v:r.version})} ${a===null?c(`cloud.nothingRuns`):c(`cloud.keepsRunning`,{v:a})}`}:{kind:`live`,url:o,runs:a,notes:r.problems.filter(e=>!e.blocking).length,cloud:!0}}function kl(e){return e.kind===`live`||e.kind===`sending`||e.kind===`missing`?e.url:null}function Al({where:e,me:t,version:n}){let r=El(t.account?.cloudUrl??``),i=`size-3.5`;switch(e.kind){case`draft`:return null;case`unknown`:return(0,I.jsx)(k,{tone:`live`,children:c(`home.live`)});case`here`:return(0,I.jsx)(k,{icon:(0,I.jsx)(ir,{className:i}),title:c(`where.hereHint`),children:n?c(`where.hereVersion`,{v:n}):c(`where.here`)});case`live`:{let t=n?c(`editor.published`,{v:e.runs}):c(`home.live`),a=e.notes===1?c(`where.note`):e.notes>1?c(`where.notes`,{n:e.notes}):null;return(0,I.jsx)(k,{tone:`live`,icon:e.cloud?(0,I.jsx)(An,{className:i}):void 0,title:e.cloud?c(`where.liveHint`,{host:r}):void 0,children:a?`${t} · ${a}`:t})}case`sending`:return(0,I.jsx)(k,{tone:`warn`,icon:(0,I.jsx)(Je,{className:i}),title:c(`cloud.again`,{when:new Intl.DateTimeFormat(E,{timeStyle:`short`}).format(new Date(e.again))}),children:c(`where.sending`)});case`missing`:return(0,I.jsx)(k,{tone:`warn`,icon:(0,I.jsx)(On,{className:i}),title:e.why,children:e.runs===null?c(`where.missing`):c(`editor.published`,{v:e.runs})})}}var jl=`mt-1.5 text-[0.8125rem] text-ink-3`;function Ml(e){let t=At(),[n,r]=(0,P.useState)(!1),i=F({mutationFn:e=>N.post(`/api/studio/account/link`,e),onSuccess:({url:e})=>{gl(e),r(!0)}});return(0,P.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,P.useEffect)(()=>{e&&r(!1)},[e]),{link:i,waiting:n}}function Nl({link:e,waiting:t}){return e.isError?(0,I.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:c(`local.accountFailed`)}):t?(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,I.jsx)(M,{className:`size-3.5`}),` `,c(`local.accountWaiting`)]}):null}function Pl({me:e}){let t=za(`account`),n=Ml(!1),{link:r}=n,[i,a]=(0,P.useState)(``);return(0,I.jsxs)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-4 py-5 first:pt-0 last:pb-0`,children:[(0,I.jsx)(`div`,{className:`flex size-11 shrink-0 items-center justify-center rounded-full bg-paper-2 text-ink-2`,children:(0,I.jsx)(Jn,{className:`size-5`})}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`font-medium text-[0.9375rem]`,children:c(`account.local`)}),(0,I.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-3 leading-relaxed`,children:c(`account.localText`)}),(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(Yc,{me:e})})]})]}),t?(0,I.jsxs)(`div`,{className:`flex flex-col gap-4 py-5 last:pb-0`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`font-medium text-[0.9375rem]`,children:c(`account.with`)}),(0,I.jsxs)(`ul`,{className:`mt-2 flex flex-col gap-2 text-[0.875rem] text-ink-2 leading-snug`,children:[(0,I.jsxs)(`li`,{className:`flex items-start gap-2.5`,children:[(0,I.jsx)(Mn,{className:`mt-0.5 size-4 shrink-0 text-amber`}),c(`account.withCredits`)]}),(0,I.jsxs)(`li`,{className:`flex items-start gap-2.5`,children:[(0,I.jsx)(An,{className:`mt-0.5 size-4 shrink-0 text-cobalt`}),c(`account.withCloud`)]})]})]}),(0,I.jsx)(`div`,{children:(0,I.jsx)(u,{busy:r.isPending&&!r.variables?.signup,onClick:()=>r.mutate({}),children:c(`account.signIn`)})})]}):null,t?(0,I.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,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`font-medium text-[0.9375rem]`,children:c(`account.new`)}),(0,I.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-3 leading-relaxed`,children:c(`account.newHint`)})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(ne,{value:i,maxLength:64,autoComplete:`off`,spellCheck:!1,placeholder:c(`account.code`),"aria-label":c(`account.code`),onChange:e=>a(e.target.value),className:`w-56 font-mono text-[0.875rem]`}),(0,I.jsx)(u,{type:`submit`,variant:`secondary`,className:`h-11`,busy:r.isPending&&!!r.variables?.signup,children:c(`account.create`)})]}),(0,I.jsx)(Nl,{...n})]}):null]})}var Fl={start:`account.kind.start`,monthly:`account.kind.monthly`,gift:`account.kind.gift`};function Il({account:e,me:t}){let n=At(),r=Ml(e.signedIn),i=F({mutationFn:()=>N.del(`/api/studio/account`),onSuccess:()=>n.invalidateQueries({queryKey:[`me`]})}),a=new Intl.DateTimeFormat(E,{dateStyle:`medium`});return(0,I.jsxs)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3 py-5 first:pt-0`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`truncate font-medium text-[0.9375rem]`,children:e.name||e.email}),e.signedIn?(0,I.jsx)(k,{tone:`live`,children:c(`account.linked`)}):null]}),(0,I.jsx)(`div`,{className:`truncate text-[0.875rem] text-ink-3`,children:e.email}),(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(Yc,{me:t})})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsxs)(u,{variant:`secondary`,onClick:()=>gl(e.url),children:[c(`setup.openAccount`),` `,(0,I.jsx)(Ve,{className:`size-4`})]}),(0,I.jsxs)(u,{variant:`ghost`,busy:i.isPending,onClick:()=>i.mutate(),children:[(0,I.jsx)(fr,{className:`size-4`}),` `,c(`nav.logout`)]})]})]}),e.signedIn?null:(0,I.jsxs)(`div`,{className:`flex flex-col gap-3 py-5`,children:[(0,I.jsx)(`p`,{className:`text-[0.875rem] text-ink-2`,children:c(`local.accountExpired`)}),(0,I.jsx)(`div`,{children:(0,I.jsx)(u,{busy:r.link.isPending,onClick:()=>r.link.mutate({}),children:c(`account.signInAgain`)})}),(0,I.jsx)(Nl,{...r})]}),e.credits===null?null:(0,I.jsxs)(`div`,{className:`py-5`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:c(`account.credits`)}),(0,I.jsx)(`div`,{className:`font-display font-semibold text-[1.375rem] tabular-nums leading-tight`,children:c(`nav.credits`,{n:Math.floor(e.credits).toLocaleString(E)})})]}),(0,I.jsxs)(u,{variant:`secondary`,onClick:()=>gl(`${e.url}/billing`),children:[c(`account.topUp`),` `,(0,I.jsx)(Ve,{className:`size-4`})]})]}),e.expiring.length?(0,I.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1 text-[0.8125rem] text-ink-3 tabular-nums`,children:e.expiring.map(e=>(0,I.jsxs)(`li`,{children:[c(`account.expires`,{n:Math.floor(e.credits).toLocaleString(E),date:a.format(new Date(e.expiresAt))}),Fl[e.kind]?(0,I.jsxs)(`span`,{className:`text-ink-4`,children:[` · `,c(Fl[e.kind])]}):null]},`${e.kind}:${e.expiresAt}`))}):null]}),(0,I.jsxs)(`div`,{className:`flex items-start gap-2.5 py-5 text-[0.875rem] text-ink-2 leading-snug last:pb-0`,children:[(0,I.jsx)(An,{className:`mt-0.5 size-4 shrink-0 text-cobalt`}),(0,I.jsx)(`p`,{children:c(`account.cloud`,{host:El(e.cloudUrl)})})]})]})}function Ll({me:e,fromAccount:t}){let n=At(),[r,i]=(0,P.useState)(e.profile),a=e=>i(t=>({...t,...e})),o=d(r,async e=>{await N.put(`/api/studio/profile`,e),await n.invalidateQueries({queryKey:[`me`]})});return(0,I.jsx)(Mt,{title:c(`account.profile`),hint:c(`account.hint`),save:o,children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-6 sm:flex-row sm:gap-8`,children:[(0,I.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center gap-2 sm:w-32`,children:[(0,I.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,I.jsx)(`img`,{src:e.user.image,alt:``,className:`size-full object-cover`}):Xi(r.name)||`?`}),(0,I.jsx)(`p`,{className:`text-center text-[0.75rem] text-ink-3 leading-snug`,children:c(`account.initials`)})]}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-5`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(ce,{children:c(`account.name`)}),(0,I.jsx)(ne,{value:r.name,maxLength:80,disabled:t,onChange:e=>a({name:e.target.value})}),(0,I.jsx)(`p`,{className:jl,children:c(t?`account.fromAccount`:`account.nameHint`)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(ce,{children:c(`account.about`)}),(0,I.jsx)(x,{minRows:3,maxLength:2e3,value:r.about,onChange:e=>a({about:e.target.value})}),(0,I.jsx)(`p`,{className:jl,children:c(`account.aboutHint`)})]}),(0,I.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(ce,{children:c(`account.email`)}),(0,I.jsx)(ne,{type:`email`,value:r.email,maxLength:200,disabled:t,onChange:e=>a({email:e.target.value})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(ce,{children:c(`account.phone`)}),(0,I.jsx)(ne,{type:`tel`,value:r.phone,maxLength:40,onChange:e=>a({phone:e.target.value})})]})]})]})]})})}function Rl({me:e}){let t=e.mode===`managed`,n=t||!!e.account;return(0,I.jsxs)(`div`,{className:`flex flex-col gap-9`,children:[(0,I.jsx)(Mt,{title:c(`account.connection`),hint:c(`account.connectionHint`),children:t?(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`truncate font-medium text-[0.9375rem]`,children:e.user.name}),(0,I.jsx)(k,{tone:`live`,children:c(`account.linked`)})]}),(0,I.jsx)(`div`,{className:`truncate text-[0.875rem] text-ink-3`,children:e.user.email}),(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(Yc,{me:e})})]}),e.manageUrl?(0,I.jsxs)(u,{variant:`secondary`,onClick:()=>gl(`${e.manageUrl}/account`),children:[c(`setup.openAccount`),` `,(0,I.jsx)(Ve,{className:`size-4`})]}):null]}):e.account?(0,I.jsx)(Il,{account:e.account,me:e}):(0,I.jsx)(Pl,{me:e})}),(0,I.jsx)(Ll,{me:e,fromAccount:n},n?`account`:`own`),(0,I.jsx)(Mt,{title:c(`account.look`),hint:c(`account.lookHint`),children:(0,I.jsxs)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-4 pb-4`,children:[(0,I.jsx)(`span`,{className:`font-medium text-[0.875rem]`,children:c(`nav.language`)}),(0,I.jsx)(el,{})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-4 pt-4`,children:[(0,I.jsx)(`span`,{className:`font-medium text-[0.875rem]`,children:c(`nav.theme`)}),(0,I.jsx)(Tl,{})]})]})})]})}var zl={steps:Xr,chat:vr,talk:et,whatsapp:gr,sms:br,call:Rr,video:S},Bl=e=>zl[e]??Wr,Vl=[`steps`,`chat`];function Hl(){return Ft({queryKey:[`runners`],queryFn:()=>N.get(`/api/studio/runners`),staleTime:6e4})}function Ul(e,t){let n=new Set(t.map(e=>e.id)),r=(e.runners?.enabled??Vl).filter(e=>n.has(e)),i=e.runners?.default??`steps`;return[...r].sort((e,t)=>e===i?-1:+(t===i))}function Wl({w:e,runners:t}){let n=Ul(e,t),r=e.runners?.default??`steps`;return(0,I.jsx)(`span`,{className:`inline-flex items-center gap-1.5`,children:n.map(e=>{let n=Bl(e),i=t.find(t=>t.id===e)?.label[E]??e;return(0,I.jsx)(n,{"aria-label":i,className:D(`size-3.5`,e===r?`text-ink-2`:`text-ink-4`),children:(0,I.jsx)(`title`,{children:i})},e)})})}var Gl=[`text`,`document`,`table`,`image`,`video`,`audio`,`dashboard`],Kl=[`any`,`trades`,`gastronomy`,`hospitality`,`realEstate`,`retail`,`health`,`professional`,`agency`,`events`,`publicSector`],ql=[`marketing`,`sales`,`accounting`,`service`,`research`,`hr`,`operations`,`website`,`visuals`,`inquiries`,`advice`],Jl=[`text`,`web`,`browser`,`documents`,`image`,`video`,`speech`,`listening`,`code`,`connectors`,`film`],Yl=[`free`,`pro`],Xl={"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}`},Zl={en:Xl,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 Ql(e,t,n,r){let i=`${e}.${t}`;return i in Xl?$e(Zl,i,n,r):t}function $l(e){switch(e.type){case`page`:return ur;case`agent`:return mn;case`generate`:return e.asset===`image`?Qn:e.asset===`video`?S:e.asset===`dashboard`?or:jt;case`widget`:return on;case`surface`:return cr;case`film`:return En;case`review`:return Rn;case`result`:return Hn}return Si}var eu={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 tu(e){return c(`type.${e.type}`)}var nu=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`];function ru(e){return nu.includes(e)?c(`tool.${e}`):e}function iu(e){switch(e.type){case`page`:return e.fields.map(e=>e.label).join(` · `);case`agent`:{let t=e.tools.map(ru),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?c(`editor.reviewEditable`):null,e.regenerate?c(`editor.reviewRedo`):null].filter(Boolean).join(` · `);case`result`:return e.deliverables.map(e=>`${e.label??e.from} (${e.formats.join(`, `)})`).join(` · `)}return``}var au=e({EntryDialog:()=>Du,MarketplaceBrowser:()=>Nu,MarketplaceCards:()=>Mu,MarketplaceHits:()=>ju,ProChip:()=>hu,useSettled:()=>ku}),W=(0,P.lazy)(()=>It(()=>import(`./FlowPreview-CusP7ci9.js`),__vite__mapDeps([9,1,2,5,6,10]))),ou={useCase:``,industry:``,format:``,capability:``,plan:``},su=(e,t)=>Ql(e,t,E),cu={en:Sn,de:wn};function lu(e){if(e<1)return 1;let t=10**Math.floor(Math.log10(e));return Math.round(e/t)*t}function uu(e){return e.credits?c(`market.credits`,{n:lu(e.credits.credits)}):su(`cost`,e.costTier)}var du={text:mi,document:jt,table:ui,image:Qn,video:S,audio:ye,dashboard:vn};function fu({format:e,className:t}){let n=du[e],r=su(`format`,e);return(0,I.jsx)(`span`,{title:r,className:`inline-flex`,children:(0,I.jsx)(n,{className:t,"aria-label":r,role:`img`})})}var pu=[`low`,`medium`,`high`];function mu({entry:e}){let t=pu.indexOf(e.costTier)+1,n=cu[E];return(0,I.jsxs)(`span`,{title:uu(e),className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex shrink-0`,children:pu.slice(0,t).map((e,t)=>(0,I.jsx)(`span`,{className:D(`rounded-full bg-(--coin-bg,var(--color-card))`,t>0&&`-ml-1.5`),children:(0,I.jsx)(n,{className:`size-4`})},e))}),su(`cost`,e.costTier)]})}function hu(){return(0,I.jsx)(k,{tone:`ember`,title:c(`market.proHint`),children:c(`market.pro`)})}function gu({plugin:e}){return(0,I.jsx)(k,{icon:(0,I.jsx)(Wr,{className:`size-3.5`}),title:c(`market.fromPlugin`,{name:e.name}),children:e.name})}function _u({entry:e,onOpen:t}){return(0,I.jsxs)(nt,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:D(`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,I.jsx)(`span`,{className:`-top-4 pointer-events-none absolute right-4`,children:(0,I.jsx)(qi,{kind:e.avatar,size:68})}),(0,I.jsxs)(`div`,{className:`min-w-0 pr-20`,children:[(0,I.jsxs)(`div`,{className:`font-display font-semibold text-[0.9375rem]`,children:[e.title,e.plan===`pro`?(0,I.jsx)(`span`,{className:`ml-1.5 inline-flex align-middle`,children:(0,I.jsx)(hu,{})}):null,e.starred?(0,I.jsx)(oi,{className:`ml-1.5 inline size-3.5 fill-amber align-[-2px] text-amber`,"aria-label":c(`market.starred`)}):null]}),(0,I.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3 leading-snug`,children:e.pitch})]}),(0,I.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,I.jsx)(gu,{plugin:e.plugin}):null,e.needs?.length?(0,I.jsx)(k,{tone:`warn`,children:c(`market.needsPro`,{list:e.needs.join(`, `)})}):e.usable&&e.missing.length?(0,I.jsx)(k,{tone:`warn`,children:c(`market.missing`,{list:yu(e.missing)})}):e.usable?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(Je,{className:`size-3.5`}),` `,c(`market.minutes`,{n:e.effort.minutes})]}),(0,I.jsx)(mu,{entry:e}),e.optional?.length?(0,I.jsx)(k,{title:c(`market.optionalHint`,{list:yu(e.optional)}),children:c(`market.without`,{list:yu(e.optional)})}):null,(0,I.jsx)(`span`,{className:`ml-auto inline-flex items-center gap-1.5`,children:e.formats.map(e=>(0,I.jsx)(fu,{format:e,className:`size-4`},e))})]}):(0,I.jsx)(k,{tone:`warn`,children:c(`market.needsUpdate`)})]})]})}function vu({title:e,children:t}){return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1.5 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:e}),t]})}var yu=e=>e.map(e=>su(`capability`,e)).join(`, `),bu={text:Ot,web:Kn,browser:Ct,documents:Qr,image:Qn,video:S,speech:bi,listening:et,code:fi,connectors:Hr,film:En};function xu(e){switch(e.type){case`page`:return ur;case`agent`:return mn;case`generate`:return e.asset===`image`?Qn:e.asset===`video`?S:e.asset===`voice`?bi:e.asset===`dashboard`?vn:jt;case`widget`:return e.video?En:on;case`surface`:return on;case`film`:return En;case`review`:return Rn;case`result`:return Hn}return Si}function Su(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 Cu(e){let t=Su(e);return e.map(e=>({id:e.id,title:e.title,icon:xu(e),tone:eu[e.type]??`bg-paper-2 text-ink-2`,optional:t.has(e.id),branches:e.branches}))}function wu({title:e,children:t}){return(0,I.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 Tu({icon:e,children:t,more:n}){return(0,I.jsxs)(`div`,{className:`flex gap-2.5`,children:[(0,I.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:e}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-[0.875rem] text-ink leading-snug`,children:t}),n?(0,I.jsx)(`div`,{className:`text-[0.75rem] text-ink-3 leading-snug`,children:n}):null]})]})}function Eu({className:e,children:t}){let n=(0,P.useRef)(null),[r,i]=(0,P.useState)({above:!1,below:!1});(0,P.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,I.jsx)(`div`,{ref:n,className:e,style:{maskImage:a,WebkitMaskImage:a},children:(0,I.jsx)(`div`,{children:t})})}function Du({id:e,fallback:t,onClose:n,onUse:r,busy:i}){let a=At(),o=v(),s=Ft({queryKey:[`marketplace-entry`,e,E],queryFn:()=>N.get(`/api/studio/marketplace/${encodeURIComponent(e)}?lang=${E}`),enabled:!!e,retry:!1}),l=s.data??t,d=F({mutationFn:t=>{let n=`/api/studio/marketplace/${encodeURIComponent(e)}/star`;return t?N.put(n):N.del(n)},onSuccess:()=>Promise.all([a.invalidateQueries({queryKey:[`marketplace`]}),a.invalidateQueries({queryKey:[`marketplace-entry`,e]})])}),f=Vi()===`dark`,p=Rt[Bt[l?.avatar||`round`]],m=f?`var(--card)`:`color-mix(in oklch, ${p??`var(--ink-4)`} 14%, var(--paper-2))`;return(0,I.jsx)(ue,{open:!!e,onClose:n,wide:!0,bare:!0,children:l?(0,I.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,I.jsx)(`button`,{type:`button`,"aria-label":c(`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,I.jsx)(Se,{className:`size-4`})}),(0,I.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:m,"--coin-bg":m},children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 overflow-hidden sm:rounded-t-2xl`,children:(0,I.jsx)(`span`,{className:D(`-top-28 -right-10 absolute size-80 rounded-full bg-white blur-3xl`,f?`opacity-[0.14]`:`opacity-80`)})}),(0,I.jsx)(`div`,{className:`-bottom-5 absolute right-9 z-10 max-sm:hidden`,children:(0,I.jsx)(qi,{kind:l.avatar,size:104})}),(0,I.jsxs)(`div`,{className:`relative sm:pr-36`,children:[(0,I.jsx)(`h2`,{className:`font-display font-semibold text-[1.375rem] leading-tight tracking-tight max-sm:pr-10`,children:l.title}),(0,I.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-2 leading-snug`,children:s.data?.description||l.pitch})]}),l.usable?(0,I.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,I.jsxs)(wu,{title:c(`market.duration`),children:[(0,I.jsx)(Je,{className:`size-4 text-ink-3`}),c(`market.minutes`,{n:l.effort.minutes})]}),(0,I.jsx)(wu,{title:c(`market.cost`),children:(0,I.jsx)(mu,{entry:l})}),(0,I.jsx)(wu,{title:c(`market.result`),children:l.formats.map(e=>(0,I.jsx)(fu,{format:e,className:`size-4`},e))})]}):null]}),l.usable?(0,I.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,I.jsxs)(`div`,{className:`flex flex-col gap-5 sm:min-h-0 sm:overflow-y-auto`,children:[(0,I.jsx)(vu,{title:c(`market.duration`),children:(0,I.jsx)(Tu,{icon:(0,I.jsx)(Je,{className:`size-4 text-moss`}),more:c(`market.durationHint`,{n:l.effort.fields}),children:c(`market.minutes`,{n:l.effort.minutes})})}),(0,I.jsx)(vu,{title:c(`market.cost`),children:(0,I.jsx)(Tu,{icon:(0,I.jsx)(Mn,{className:`size-4 text-amber`}),more:l.credits?c(`market.creditsHint`):void 0,children:(0,I.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2`,children:[(0,I.jsx)(mu,{entry:l}),l.credits?(0,I.jsx)(`span`,{className:`text-ink-2`,children:c(`market.creditsRange`,{n:lu(l.credits.credits)})}):null]})})}),(0,I.jsx)(vu,{title:c(`market.result`),children:(0,I.jsx)(`div`,{className:`flex flex-col gap-2`,children:(s.data?.results??[]).map(e=>(0,I.jsx)(Tu,{icon:(0,I.jsx)(fu,{format:e.kind,className:`size-4 text-ember-strong`}),more:e.formats.map(e=>e.toUpperCase()).join(` · `),children:e.title},e.title))})}),(0,I.jsx)(vu,{title:c(`market.needs`),children:(0,I.jsx)(`ul`,{className:`flex flex-col gap-2`,children:l.capabilities.map(e=>{let t=bu[e],n=l.missing.includes(e),r=l.optional?.includes(e);return(0,I.jsxs)(`li`,{className:D(`flex items-center gap-2.5 text-[0.875rem]`,n?`text-ink-3`:`text-ink-2`),children:[(0,I.jsx)(t,{className:D(`size-4 shrink-0`,n?`text-rose`:r?`text-amber`:`text-cobalt`)}),su(`capability`,e),n?(0,I.jsx)(`span`,{className:`text-[0.75rem] text-rose`,children:c(`market.unavailable`)}):r?(0,I.jsx)(`span`,{className:`text-[0.75rem] text-amber`,children:c(`market.optional`)}):null]},e)})})})]}),(0,I.jsxs)(`div`,{className:`flex flex-col sm:min-h-0`,children:[(0,I.jsx)(`div`,{className:`mb-1.5 shrink-0 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:c(`market.steps`)}),(0,I.jsx)(Eu,{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,I.jsx)(M,{className:`size-5 text-ink-3`}):(0,I.jsx)(P.Suspense,{fallback:(0,I.jsx)(M,{className:`size-5 text-ink-3`}),children:(0,I.jsx)(W,{steps:Cu(s.data?.outline??[])})})})]})]}):(0,I.jsx)(`div`,{className:`flex-1 px-5 pt-6 sm:px-7`,children:(0,I.jsx)(`p`,{className:`rounded-lg bg-amber-tint p-3 text-[0.875rem] text-ink-2`,children:c(`market.needsUpdateHint`)})}),(0,I.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,I.jsx)(`span`,{className:`mr-auto flex items-center`,children:(0,I.jsx)(gu,{plugin:l.plugin})}):(0,I.jsxs)(u,{variant:`ghost`,className:`mr-auto`,title:c(`market.starHint`),"aria-pressed":l.starred,busy:d.isPending,onClick:()=>d.mutate(!l.starred),children:[(0,I.jsx)(oi,{className:D(`size-4`,l.starred&&`fill-amber text-amber`)}),(0,I.jsx)(`span`,{className:`max-sm:sr-only`,children:c(l.starred?`market.starred`:`market.star`)})]}),(0,I.jsx)(u,{variant:`secondary`,onClick:n,children:c(`common.close`)}),l.usable&&l.missing.length?(0,I.jsx)(u,{variant:`secondary`,onClick:()=>o(`/settings/models`),children:c(`editor.models.settings`)}):null,r?(0,I.jsx)(u,{disabled:!l.usable||l.missing.length>0||!!l.needs?.length,title:l.needs?.length?c(`market.needsProHint`,{list:l.needs.join(`, `)}):l.missing.length?c(`market.missingHint`,{list:yu(l.missing)}):l.optional?.length?c(`market.optionalHint`,{list:yu(l.optional)}):void 0,busy:i,onClick:()=>r(l),children:c(`market.use`)}):null]})]}):(0,I.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,I.jsx)(M,{className:`size-6 text-ink-3`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`p`,{children:c(`market.notFound`)}),(0,I.jsx)(u,{variant:`secondary`,onClick:n,children:c(`common.close`)})]})})})}function Ou({name:e,value:t,options:n,onChange:r}){let[i,a]=(0,P.useState)(!1),o=(0,P.useRef)(null);(0,P.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,I.jsxs)(`div`,{ref:o,className:`relative`,children:[(0,I.jsxs)(`div`,{className:D(`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,I.jsx)(`button`,{type:`button`,"aria-haspopup":`listbox`,"aria-expanded":i,onClick:()=>a(!i),className:D(`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,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-ink-3`,children:e}),(0,I.jsx)(`span`,{className:`font-medium`,children:s.label})]}):(0,I.jsxs)(I.Fragment,{children:[e,(0,I.jsx)(Pt,{className:D(`size-3.5 transition`,i&&`rotate-180`)})]})}),s?(0,I.jsx)(`button`,{type:`button`,"aria-label":`${e}: ${c(`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,I.jsx)(Se,{className:`size-3.5`})}):null]}),i?(0,I.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,I.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:D(`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,I.jsx)(`span`,{className:`flex-1 whitespace-nowrap`,children:e.label}),e.value===t?(0,I.jsx)(Ie,{className:`size-4 text-ember`}):e.unavailable?(0,I.jsx)(`span`,{className:`whitespace-nowrap text-[0.75rem] text-ink-4`,children:c(`market.unavailable`)}):(0,I.jsx)(`span`,{className:`text-[0.75rem] text-ink-4 tabular-nums`,children:e.count})]},e.value))}):null]})}function ku(e,t){let[n,r]=(0,P.useState)(e);return(0,P.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var Au=60;function ju({query:e,onUse:t,busy:n,limit:r=6}){let[i,a]=(0,P.useState)(null),o=ku(e.trim(),250),s=Ft({queryKey:[`marketplace`,E,o,`hits`,r],queryFn:()=>N.get(`/api/studio/marketplace?${new URLSearchParams({lang:E,limit:String(r),offset:`0`,q:o})}`),enabled:!!o,placeholderData:He}),l=o?s.data?.entries??[]:[];return l.length?(0,I.jsxs)(`section`,{className:`mt-10`,children:[(0,I.jsxs)(`h2`,{className:`mb-5 flex items-center gap-2 font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:[c(`market.hits`),s.isFetching?(0,I.jsx)(M,{className:`size-3.5`}):null]}),(0,I.jsx)(`div`,{className:`flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:l.map(e=>(0,I.jsx)(_u,{entry:e,onOpen:()=>a(e.id)},e.id))}),(0,I.jsx)(Du,{id:i,fallback:l.find(e=>e.id===i)??null,onClose:()=>a(null),onUse:t,busy:n})]}):null}function Mu({entries:e}){let t=At(),n=v(),{project:r}=la(),i=$i()&&!!r&&!r?.readOnly,[a,o]=(0,P.useState)(null),s=F({mutationFn:e=>N.post(`/api/studio/wizards`,{projectId:r.id,starterId:e,lang:E}),onSuccess:async({id:e})=>{await t.invalidateQueries({queryKey:[`projects`]}),await t.invalidateQueries({queryKey:[`wizards`]}),o(null),n(`/edit/${e}`)}});return(0,I.jsxs)(`div`,{className:`@container mt-3`,children:[(0,I.jsx)(`div`,{className:`flex flex-col gap-4 @xl:grid @xl:grid-cols-2`,children:e.map(e=>(0,I.jsx)(_u,{entry:e,onOpen:()=>o(e.id)},e.id))}),s.error?(0,I.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:s.error.message}):null,(0,I.jsx)(Du,{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 Nu({onUse:e,busy:t,open:n,search:r,onGuestOpen:i}){let[a,o]=(0,P.useState)(``);(0,P.useEffect)(()=>{r&&o(r.text)},[r]);let[s,l]=(0,P.useState)(ou),[d,f]=(0,P.useState)(!1),[p,m]=(0,P.useState)(n??null),h=ku(a.trim(),250),g=(0,P.useRef)(null);(0,P.useEffect)(()=>{let e=g.current;h&&e&&window.matchMedia(`(max-width: 639px)`).matches&&e.scrollIntoView({behavior:`smooth`,block:`start`})},[h]);let _=Yt({queryKey:[`marketplace`,E,h,s,d],queryFn:({pageParam:e})=>{let t=new URLSearchParams({lang:E,limit:String(Au),offset:String(e)});h&&t.set(`q`,h);for(let[e,n]of Object.entries(s))n&&t.set(e,n);return d&&t.set(`starred`,`1`),N.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:He}),v=_.data?.pages[0],y=_.data?.pages.flatMap(e=>e.entries)??[],b=v?.all??0,ee=a.trim()!==h||_.isFetching&&!_.isFetchingNextPage,x=(e,t,n,r)=>n.filter(t=>v?.facets[e]?.[t]!==void 0).map(n=>({value:n,label:su(t,n),icon:r?.(n),count:(v?.facets[e])[n]??0,unavailable:e===`capability`&&S.has(n)})),S=new Set(v?.unavailable??[]),te=x(`useCase`,`useCase`,ql),C=[{key:`industry`,name:c(`market.industry`),options:x(`industry`,`industry`,Kl)},{key:`format`,name:c(`market.format`),options:x(`format`,`format`,Gl,e=>(0,I.jsx)(fu,{format:e,className:`size-4 text-ink-3`}))},{key:`plan`,name:c(`market.plan`),options:x(`plan`,`plan`,Yl)},{key:`capability`,name:c(`market.capability`),options:x(`capability`,`capability`,Jl,e=>{let t=bu[e];return(0,I.jsx)(t,{className:`size-4 text-ink-3`})})}],ne=!!a.trim()||d||Object.values(s).some(Boolean),re=()=>{l(ou),o(``),f(!1)};if(_.isLoading)return(0,I.jsx)(`div`,{className:`flex justify-center py-10`,children:(0,I.jsx)(M,{className:`size-6 text-ink-3`})});let T=v?.offline?(0,I.jsxs)(`p`,{className:`mt-4 flex items-center justify-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,I.jsx)(On,{className:`size-4 shrink-0`}),c(`market.offline`)]}):null;if(!b&&!ne)return T;let ie=a?(0,I.jsx)(`button`,{type:`button`,"aria-label":c(`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,I.jsx)(Se,{className:`size-4`})}):null,ae=e=>D(`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,I.jsxs)(`div`,{children:[(0,I.jsxs)(`label`,{ref:g,className:`relative mx-auto flex h-10 max-w-md scroll-mt-4 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:[ee?(0,I.jsx)(M,{className:`size-4 shrink-0 text-ink-3`}):(0,I.jsx)(w,{className:`size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`input`,{type:`search`,value:a,onChange:e=>o(e.target.value),placeholder:c(`market.search`),"aria-label":c(`market.search`),className:`min-w-0 flex-1 bg-transparent text-[0.9375rem] outline-none placeholder:text-ink-4 [&::-webkit-search-cancel-button]:hidden`}),ie]}),T,(0,I.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:c(`market.all`)},...te].map(e=>(0,I.jsx)(`button`,{type:`button`,"aria-pressed":!d&&s.useCase===e.value,onClick:()=>{f(!1),l({...s,useCase:e.value})},className:ae(!d&&s.useCase===e.value),children:e.label},e.value)),i?null:(0,I.jsxs)(`button`,{type:`button`,"aria-pressed":d,onClick:()=>f(!d),className:ae(d),children:[(0,I.jsx)(oi,{className:D(`size-3.5`,d&&`fill-amber text-amber`)}),c(`market.starred`)]})]}),(0,I.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-1 gap-y-2 sm:mt-6`,children:[d?null:C.map(e=>(0,I.jsx)(Ou,{name:e.name,value:s[e.key],options:e.options,onChange:t=>l({...s,[e.key]:t})},e.key)),(0,I.jsxs)(`span`,{className:`ml-auto flex items-center gap-3 whitespace-nowrap pl-2 text-[0.8125rem] text-ink-3`,children:[ne?(0,I.jsxs)(`button`,{type:`button`,onClick:re,className:`inline-flex items-center gap-1 text-ember-strong underline-offset-2 hover:underline`,children:[(0,I.jsx)(Se,{className:`size-3.5 max-sm:size-4`}),(0,I.jsx)(`span`,{className:`max-sm:sr-only`,children:c(`market.resetShort`)})]}):null,ne?(0,I.jsx)(`span`,{className:`tabular-nums sm:hidden`,children:c(`market.countOfShort`,{n:v?.total??0,all:b})}):null,(0,I.jsx)(`span`,{className:D(`tabular-nums`,ne&&`max-sm:hidden`),children:ne?c(`market.countOf`,{n:v?.total??0,all:b}):c(`market.count`,{n:b})})]})]}),y.length?(0,I.jsx)(`div`,{className:`mt-4 flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:y.map(e=>(0,I.jsx)(_u,{entry:e,onOpen:()=>i?i(e):m(e.id)},e.id))}):(0,I.jsxs)(`div`,{className:`py-10 text-center text-[0.875rem] text-ink-3`,children:[(0,I.jsx)(`p`,{children:c(d?`market.noneStarred`:`market.none`)}),(0,I.jsx)(u,{variant:`ghost`,className:`mt-2`,onClick:re,children:c(`market.reset`)})]}),_.hasNextPage?(0,I.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,I.jsx)(u,{variant:`secondary`,busy:_.isFetchingNextPage,onClick:()=>void _.fetchNextPage(),children:c(`market.more`)})}):null,(0,I.jsx)(Du,{id:p,fallback:y.find(e=>e.id===p)??null,onClose:()=>m(null),onUse:e,busy:t})]})}function Pu({wizard:e,className:t,onDeleted:n}){let r=At(),i=v(),o=ea(),[s,l]=(0,P.useState)(!1),[d,f]=(0,P.useState)(!1),p=(0,P.useRef)(null);xd(p,s,()=>l(!1));let m=F({mutationFn:()=>N.post(`/api/studio/wizards/${e.id}/duplicate`),onSuccess:async({id:e})=>{await r.invalidateQueries({queryKey:[`wizards`]}),i(`/edit/${e}`)}}),h=F({mutationFn:()=>N.del(`/api/studio/wizards/${e.id}`),onSuccess:async()=>{f(!1),await r.invalidateQueries({queryKey:[`wizards`]}),await r.invalidateQueries({queryKey:[`projects`]}),n?.()}}),g=`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,I.jsxs)(`div`,{ref:p,className:D(`relative`,t),onClick:e=>e.stopPropagation(),children:[(0,I.jsx)(`button`,{type:`button`,"aria-label":c(`wizardMenu.label`),title:c(`wizardMenu.label`),"aria-haspopup":`menu`,"aria-expanded":s,onClick:()=>l(e=>!e),className:D(`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,I.jsx)(qe,{className:`size-4`})}),s?(0,I.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,I.jsxs)(`button`,{type:`button`,role:`menuitem`,className:g,disabled:m.isPending,onClick:()=>{l(!1),m.mutate()},children:[(0,I.jsx)(Xe,{className:`size-4 shrink-0`}),` `,c(`wizardMenu.duplicate`)]}),(0,I.jsxs)(`a`,{role:`menuitem`,href:a(`/api/studio/wizards/${e.id}/export`),download:!0,className:g,onClick:()=>l(!1),children:[(0,I.jsx)(_t,{className:`size-4 shrink-0`}),` `,c(`editor.export`)]}),o?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,I.jsxs)(`button`,{type:`button`,role:`menuitem`,className:D(g,`text-rose hover:bg-rose-tint hover:text-rose`),onClick:()=>{l(!1),f(!0)},children:[(0,I.jsx)(be,{className:`size-4 shrink-0`}),` `,c(`wizardMenu.delete`)]})]}):null]}):null,(0,I.jsxs)(ue,{open:d,onClose:()=>f(!1),title:c(`wizardMenu.deleteTitle`,{title:e.title}),children:[(0,I.jsx)(`p`,{className:`-mt-2 text-[0.875rem] text-ink-2`,children:e.published?c(`wizardMenu.deletePublished`):c(`wizardMenu.deleteDraft`)}),h.error?(0,I.jsx)(`p`,{className:`mt-3 text-[0.8125rem] text-rose`,children:h.error.message}):null,(0,I.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,I.jsx)(u,{variant:`ghost`,onClick:()=>f(!1),children:c(`common.cancel`)}),(0,I.jsxs)(u,{variant:`danger`,busy:h.isPending,onClick:()=>h.mutate(),children:[(0,I.jsx)(be,{className:`size-4`}),` `,c(`wizardMenu.delete`)]})]})]})]})}var Fu=e({HomePage:()=>Qu,NewSpaceDialog:()=>Lu,ProjectSwitcher:()=>Ru}),Iu=[{icon:Si,name:()=>c(`nav.wizards`),what:`space.holds.wizards`},{icon:Bn,name:()=>c(`space.info`),what:`space.holds.info`},{icon:fn,name:()=>`${c(`space.knowledge`)} & ${c(`space.data`)}`,what:`space.holds.knowledge`},{icon:Hr,name:()=>c(`connectors.title`),what:`space.holds.connectors`},{icon:nr,name:()=>c(`space.results`),what:`space.holds.results`}];function Lu({open:e,onClose:t}){let{select:n}=la(),r=At(),[i,a]=(0,P.useState)(``),o=F({mutationFn:()=>N.post(`/api/studio/projects`,{name:i}),onSuccess:async({id:e})=>{await r.invalidateQueries({queryKey:[`projects`]}),n(e),a(``),t()}});return(0,I.jsxs)(ue,{open:e,onClose:t,title:c(`home.newProject`),children:[(0,I.jsx)(`p`,{className:`-mt-2 text-[0.875rem] text-ink-2`,children:c(`space.holds.intro`)}),(0,I.jsx)(`dl`,{className:`mt-4 flex flex-col gap-2.5 text-[0.8125rem]`,children:Iu.map(e=>(0,I.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,I.jsx)(e.icon,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`dt`,{className:`w-28 shrink-0 font-medium text-ink`,children:e.name()}),(0,I.jsx)(`dd`,{className:`min-w-0 text-ink-3`,children:c(e.what)})]},e.what))}),(0,I.jsx)(`p`,{className:`mt-3 text-[0.8125rem] text-ink-4`,children:c(`space.holds.shared`)}),(0,I.jsxs)(`form`,{className:`mt-5`,onSubmit:e=>{e.preventDefault(),i.trim()&&o.mutate()},children:[(0,I.jsx)(ne,{autoFocus:!0,placeholder:c(`home.projectName`),value:i,onChange:e=>a(e.target.value)}),(0,I.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,I.jsx)(u,{variant:`ghost`,onClick:t,children:c(`common.cancel`)}),(0,I.jsx)(u,{type:`submit`,busy:o.isPending,disabled:!i.trim(),children:c(`home.newProject`)})]})]})]})}function Ru(){let{project:e,projects:t,select:n}=la(),r=ia().data?.limits.projects??1,i=$i(),[a,o]=(0,P.useState)(!1);return!e||r!==null&&r<=1?null:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(p,{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:`+ ${c(`home.newProject`)}`}:{value:`__new`,label:c(`home.projectLimit`,{n:r}),disabled:!0}]:[]]}),(0,I.jsx)(Lu,{open:a,onClose:()=>o(!1)})]})}function zu({url:e}){let[t,n]=(0,P.useState)(!1);return(0,I.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,I.jsx)(Ie,{className:`size-3.5`}):(0,I.jsx)(Xe,{className:`size-3.5`}),c(t?`share.copied`:`share.link`)]})}function Bu(){let e=v(),t=Ml(!1),[n,r]=(0,P.useState)(!1),i=(0,P.useRef)(null);return(0,P.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,I.jsxs)(`div`,{className:`relative`,ref:i,onClick:e=>e.stopPropagation(),children:[(0,I.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,I.jsx)(Xe,{className:`size-3.5`}),` `,c(`share.link`)]}),n?(0,I.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,I.jsx)(`p`,{className:`text-[0.8125rem] text-ink-2 leading-relaxed`,children:c(`teaser.link`)}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(u,{size:`sm`,busy:t.link.isPending,onClick:()=>t.link.mutate({}),children:c(`account.signIn`)}),(0,I.jsx)(u,{size:`sm`,variant:`secondary`,onClick:()=>e(`/settings/account`),children:c(`account.create`)})]}),(0,I.jsx)(Nl,{...t})]}):null]})}function Vu({w:e,me:t,runners:n}){let r=za(`account`),i=v(),a=Ol(e,t,e.cloud),o=kl(a),s=o??(e.published?Dl(e):null);return(0,I.jsxs)(`div`,{className:`group/card relative pt-6`,children:[(0,I.jsx)(`div`,{className:`pointer-events-none absolute top-0 left-4 z-10`,children:(0,I.jsx)(qi,{kind:e.avatar,size:52})}),(0,I.jsxs)(nt,{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,I.jsx)(`div`,{className:`absolute top-3 right-3`,children:e.published?(0,I.jsx)(Al,{where:a,me:t}):(0,I.jsx)(k,{children:c(`home.draft`)})}),(0,I.jsx)(`h3`,{className:`font-display font-semibold text-[1.0625rem] leading-snug`,children:e.title}),(0,I.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[0.875rem] text-ink-3`,children:e.description}),(0,I.jsxs)(`div`,{className:`mt-auto flex min-h-8 items-center justify-between pt-3`,children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-2.5 text-[0.75rem] text-ink-4`,children:[c(`home.steps`,{n:e.stepCount}),(0,I.jsx)(Wl,{w:e,runners:n})]}),(0,I.jsxs)(`div`,{className:`flex items-center`,children:[(0,I.jsx)(Pu,{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,I.jsx)(zu,{url:o}):a.kind===`here`&&r?(0,I.jsx)(Bu,{}):null,s?(0,I.jsx)(y,{label:c(o?`share.open`:`share.openHere`),className:`ml-1 size-8`,onClick:e=>{e.stopPropagation(),gl(s)},children:(0,I.jsx)(cn,{className:`size-4`})}):null]})]})]})]})}var Hu=[`draft`,`here`,`live`,`missing`],Uu={draft:We,here:ir,live:Kr,missing:On},Wu=e=>c(e===`draft`?`home.draft`:e===`here`?`where.here`:e===`live`?`home.live`:`where.missing`);function Gu(e,t){let{kind:n}=Ol(e,t,e.cloud);return n===`draft`||n===`here`?n:n===`live`||n===`unknown`?`live`:`missing`}function Ku({wizards:e,me:t,value:n,onChange:r}){let i=new Map;for(let n of e){let e=Gu(n,t);i.set(e,(i.get(e)??0)+1)}if(i.size<2)return null;let a=e=>D(`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,I.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-1`,children:[(0,I.jsxs)(`button`,{type:`button`,className:a(n===null),onClick:()=>r(null),children:[c(`home.all`),(0,I.jsx)(`span`,{className:`text-[0.75rem] text-ink-4`,children:e.length})]}),Hu.filter(e=>i.has(e)).map(e=>{let t=Uu[e];return(0,I.jsxs)(`button`,{type:`button`,"aria-pressed":n===e,className:a(n===e),onClick:()=>r(n===e?null:e),children:[(0,I.jsx)(t,{className:`size-3.5`}),Wu(e),(0,I.jsx)(`span`,{className:`text-[0.75rem] text-ink-4`,children:i.get(e)})]},e)})]})}var qu=12,Ju=3;function Yu({value:e,onChange:t}){return(0,I.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,I.jsx)(w,{className:`size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`input`,{type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:c(`home.search`),"aria-label":c(`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,I.jsx)(`button`,{type:`button`,"aria-label":c(`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,I.jsx)(Se,{className:`size-4`})}):null]})}var Xu=`curl -fsSL https://engenty.ai/install.sh | bash`;function Zu(){let[e,t]=(0,P.useState)(!1),n=[c(`home.local.install`),c(`home.local.signIn`),c(`home.local.publish`)];return(0,I.jsxs)(`div`,{className:`mx-auto flex max-w-xl animate-rise flex-col items-center pt-4 text-center`,children:[(0,I.jsx)(qi,{kind:`round`,size:120}),(0,I.jsx)(`h1`,{className:`mt-2 font-display font-semibold text-[1.75rem] leading-tight tracking-tight`,children:c(`home.local.title`)}),(0,I.jsx)(`p`,{className:`mt-3 text-[0.9375rem] text-ink-2 leading-relaxed`,children:c(`home.local.text`)}),(0,I.jsx)(`ol`,{className:`mt-8 flex w-full flex-col gap-4 text-left`,children:n.map((n,r)=>(0,I.jsxs)(`li`,{className:`flex gap-3`,children:[(0,I.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,I.jsxs)(`div`,{className:`min-w-0 flex-1 pt-0.5`,children:[(0,I.jsx)(`p`,{className:`text-[0.9375rem] leading-snug`,children:n}),r===0?(0,I.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,I.jsx)(`code`,{className:`min-w-0 flex-1 select-all overflow-x-auto whitespace-nowrap font-mono text-[0.8125rem] text-ink-2`,children:Xu}),(0,I.jsxs)(u,{variant:`secondary`,size:`sm`,onClick:()=>{navigator.clipboard.writeText(Xu),t(!0),setTimeout(()=>t(!1),1500)},children:[e?(0,I.jsx)(Ie,{className:`size-3.5`}):(0,I.jsx)(Xe,{className:`size-3.5`}),c(e?`share.copied`:`share.copy`)]})]}):null]})]},n))})]})}function Qu(){let e=v(),t=At(),{project:n,projects:r,loading:i}=la(),a=ia().data,o=Qi(),s=$i(),l=Ft({queryKey:[`wizards`,n?.id,!!a?.account],queryFn:()=>N.get(`/api/studio/projects/${n.id}/wizards`),enabled:!!n}),d=Hl().data??[],[f,p]=(0,P.useState)(null),[m,h]=(0,P.useState)(``),g=(l.data?.length??0)>qu,_=g?m.trim().toLowerCase():``,y=(l.data??[]).filter(e=>(!f||!a||Gu(e,a)===f)&&(!_||`${e.title} ${e.description}`.toLowerCase().includes(_))),b=!!_&&y.length<Ju,ee=F({mutationFn:e=>N.post(`/api/studio/wizards`,{projectId:n.id,starterId:e,lang:E}),onSuccess:async({id:n})=>{await t.invalidateQueries({queryKey:[`projects`]}),await t.invalidateQueries({queryKey:[`wizards`]}),e(`/edit/${n}`)}}),x=r.reduce((e,t)=>e+t.wizardCount,0),S=s&&!n?.readOnly;return!i&&S&&r.length&&x===0?(0,I.jsx)(tt,{to:`/new`,replace:!0}):!i&&!o&&r.length===0?(0,I.jsx)(Zu,{}):(0,I.jsxs)(`div`,{className:`animate-rise`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[g?(0,I.jsx)(Yu,{value:m,onChange:h}):(0,I.jsx)(`h1`,{className:`font-display font-semibold text-[1.75rem] tracking-tight`,children:c(`home.title`,{space:n?.name??``})}),S?(0,I.jsxs)(u,{onClick:()=>e(`/new`),children:[(0,I.jsx)(he,{className:`size-4`}),` `,c(`home.new`)]}):null]}),n?.origin===`local`?(0,I.jsxs)(`p`,{className:`mt-2 text-[0.875rem] text-ink-3`,children:[c(`home.fromLocal`),` `,n.syncedAt?c(`home.syncedAt`,{when:new Intl.DateTimeFormat(E,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(n.syncedAt))}):null]}):null,l.data&&l.data.length===0?(0,I.jsxs)(pe,{children:[(0,I.jsx)(`p`,{children:c(`home.empty`)}),S?(0,I.jsxs)(u,{className:`mt-5`,onClick:()=>e(`/new`),children:[(0,I.jsx)(he,{className:`size-4`}),` `,c(`home.new`)]}):null]}):null,l.data?.length&&a?(0,I.jsx)(Ku,{wizards:l.data,me:a,value:f,onChange:p}):null,_&&y.length===0?(0,I.jsx)(`p`,{className:`mt-6 text-[0.875rem] text-ink-3`,children:c(`home.noMatch`)}):null,(0,I.jsx)(`div`,{className:`mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:a?y.map(e=>(0,I.jsx)(Vu,{w:e,me:a,runners:d},e.id)):null}),b?(0,I.jsxs)(I.Fragment,{children:[S?(0,I.jsx)(ju,{query:m,busy:ee.isPending,onUse:e=>n&&!ee.isPending&&ee.mutate(e.id)}):(0,I.jsx)(ju,{query:m}),S?(0,I.jsx)(`div`,{className:`mt-8 flex justify-center`,children:(0,I.jsxs)(u,{variant:`secondary`,onClick:()=>e(`/new?wish=${encodeURIComponent(m.trim())}`),children:[(0,I.jsx)(ae,{className:`size-4`}),` `,c(`home.newFromSearch`,{q:m.trim()})]})}):null]}):null]})}var $u=`wizards.install-banner`,ed=()=>window.matchMedia(`(pointer: coarse)`).matches;function G({open:e,onClose:t}){let n=Ka(),r=Ga(n),i=c(r===`prompt`?`install.app.offer`:r===`none`?`install.app.browser`:`install.app.how.${r}`);return(0,I.jsxs)(ue,{open:e,onClose:t,title:c(`install.app.action`),children:[(0,I.jsx)(`p`,{className:`text-[0.9375rem] text-ink-2 leading-relaxed`,children:i}),(0,I.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,I.jsx)(u,{variant:`ghost`,onClick:t,children:c(`install.app.close`)}),n?(0,I.jsx)(u,{onClick:()=>{qa(n),t()},children:c(`install.app.action`)}):null]})]})}function K(){try{return localStorage.getItem($u)===`1`}catch{return!1}}function q(){let e=Ka(),[t,n]=(0,P.useState)(K),r=Ga(e);return t||Ba()||ed()||r===`chromium`?null:(0,I.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,I.jsx)(on,{className:`size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`p`,{className:`min-w-0 flex-1`,children:c(e?`install.app.offer`:`install.app.browser`)}),e?(0,I.jsx)(u,{size:`sm`,onClick:()=>void qa(e),children:c(`install.app.action`)}):null,(0,I.jsx)(y,{label:c(`install.app.close`),onClick:()=>{try{localStorage.setItem($u,`1`)}catch{}n(!0)},className:`size-8`,children:(0,I.jsx)(Se,{className:`size-4`})})]})}function J(){return[{id:`info`,label:c(`space.info`),icon:Bn},{id:`knowledge`,label:c(`space.knowledge`),icon:fn},{id:`data`,label:c(`space.data`),icon:lt},{id:`results`,label:c(`space.results`),icon:nr}]}function Y(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 td(e){return e===`info`||e===`knowledge`||e===`data`||e===`results`}var nd=[{id:`base`,group:`info`,label:`project.base`,icon:mi},{id:`facts`,group:`info`,label:`project.facts`,icon:ur},{id:`logos`,group:`info`,label:`project.logos`,icon:ni},{id:`colors`,group:`info`,label:`project.colors`,icon:Or},{id:`typography`,group:`info`,label:`project.typography`,icon:tn},{id:`assets`,group:`info`,label:`project.assets`,icon:er},{id:`documents`,group:`knowledge`,label:`project.documents`,icon:jt}],rd=nd.map(e=>e.id);function id(e,t){let n=t.spaceSections.find(t=>t.id===e);return nd.find(t=>t.id===e)?.group??(n?n.group??`knowledge`:null)}function ad(e,t,n=[]){let r=nd.filter(t=>t.group===e&&!n.includes(t.id)).map(e=>({id:e.id,label:c(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 od=(0,P.lazy)(()=>It(()=>import(`./ChangelogDialog-DLqpJsF6.js`).then(e=>({default:e.ChangelogDialog})),__vite__mapDeps([8,1,2,5,6]))),sd=`wizards.update-banner`;function cd(){try{return localStorage.getItem(sd)}catch{return null}}function ld(){let[e,t]=(0,P.useState)(cd),[n,r]=(0,P.useState)(!1),{data:i,latest:a,apply:o,busy:s,progress:l}=Wc(),d=i&&!i.newer?i.updated?.to??null:null,f=d??(i?.newer?a:null);if(!(i&&f)||e===f&&i.applying===`idle`)return null;let p=()=>{try{localStorage.setItem(sd,f)}catch{}t(f)},m=l??(d?c(`about.update.updated`,{v:f}):i.pending?.version===f?c(`about.update.ready`,{v:f}):c(`about.update.available`,{v:f}));return(0,I.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,I.jsx)(M,{className:`size-4 shrink-0 text-ember-strong`}):(0,I.jsx)(_t,{className:`size-4 shrink-0 text-ember-strong`}),(0,I.jsx)(`p`,{className:`min-w-0 flex-1`,children:m}),s?null:(0,I.jsx)(`button`,{type:`button`,onClick:()=>r(!0),className:`shrink-0 underline transition hover:text-ink`,children:c(`about.update.notes`)}),n?(0,I.jsx)(P.Suspense,{fallback:null,children:(0,I.jsx)(od,{open:!0,version:f,onClose:()=>r(!1)})}):null,i.canApply&&!d&&(i.applying===`idle`||i.applying===`failed`)?(0,I.jsx)(u,{size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(),children:c(`about.update.install`)}):null,s?null:(0,I.jsx)(y,{label:c(`install.app.close`),onClick:p,className:`size-8`,children:(0,I.jsx)(Se,{className:`size-4`})})]})}var ud=[],dd=new Set;function fd(e){ud=e;for(let e of dd)e()}function pd(e){let t=JSON.stringify(e);(0,P.useEffect)(()=>(fd(JSON.parse(t)),()=>fd([])),[t])}function md(){return ud}function hd(){return(0,P.useSyncExternalStore)(e=>(dd.add(e),()=>dd.delete(e)),()=>ud)}function gd(){let e=hd();return e.length?(0,I.jsx)(`nav`,{"aria-label":c(`nav.breadcrumb`),className:`flex min-w-0 items-center text-[0.9375rem] max-sm:hidden`,children:e.map((t,n)=>(0,I.jsxs)(P.Fragment,{children:[(0,I.jsx)(`span`,{className:D(`mr-2 text-ink-4`,n===0?`-ml-1 sm:-ml-2`:`ml-2`),children:`/`}),t.to&&n<e.length-1?(0,I.jsx)(it,{to:t.to,className:`truncate text-ink-3 transition hover:text-ink`,children:t.label}):(0,I.jsx)(`span`,{"aria-current":`page`,className:`truncate font-medium text-ink`,children:t.label})]},`${n}:${t.label}`))}):null}var _d=e=>e.manageUrl??e.account?.url??null;function vd(e){let t=_d(e);return t?`${t}/billing`:null}function yd({me:e}){let t=ta(e),n=vd(e);return t===null||!n?null:(0,I.jsx)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,className:D(`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:c(`nav.credits`,{n:Math.floor(t).toLocaleString(E)})})}function bd(e,t){return e.mode===`local`?e.account?e.account.signedIn?`linked`:`expired`:t?`alone`:null:null}function xd(e,t,n){let r=(0,P.useRef)(n);r.current=n,(0,P.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 Sd(e,t,n){return e===`below`?n:Na(t,e===`bar-start`?`start`:`end`)}var Cd=e=>`oklch(from ${e} calc(0.16 + 0.83 * clamp(0, (0.65 - l) * 1000, 1)) 0.01 h)`;function wd({project:e,size:t=`md`}){let n=e?.brand.colors?.[0]?.value,r=Xi(e?.name??``),i=(0,I.jsx)(`span`,{className:D(`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:Cd(n)}:void 0,children:r||(0,I.jsx)(Wn,{className:`size-4`})});return e?.origin===`local`?(0,I.jsxs)(`span`,{className:`relative shrink-0`,title:c(`readonly.project`),children:[i,(0,I.jsx)(`span`,{className:`-right-1 -bottom-1 absolute grid size-4 place-items-center rounded-full bg-amber ring-2 ring-paper`,children:(0,I.jsx)(ir,{className:`size-2.5 text-paper`})})]}):i}function Td({me:e,placement:t,label:n,className:r,children:i}){let a=v(),{position:s}=ja(),{project:l,projects:u,select:d}=la(),f=$i(),[p,m]=(0,P.useState)(!1),[h,g]=(0,P.useState)(!1),[_,y]=(0,P.useState)(!1),[b,ee]=(0,P.useState)({top:0,left:0}),x=(0,P.useRef)(null);xd(x,p,()=>m(!1));let S=e.limits.projects,te=S!==null&&u.length>=S,C=`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,I.jsx)(`div`,{className:`shrink-0`,ref:x,children:(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:e=>{let t=e.currentTarget.getBoundingClientRect();ee({top:t.bottom+6,left:t.left}),m(e=>!e)},"aria-expanded":p,"aria-haspopup":`menu`,"aria-label":n,title:c(`nav.switchSpace`),className:typeof r==`function`?r(p):r,children:i}),p?(0,I.jsxs)(`div`,{role:`menu`,style:t===`below`?{position:`fixed`,...b}:void 0,className:D(`z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,t===`below`?null:D(`absolute`,Sd(t,s,`top-10 left-0`))),children:[u.map(e=>{let t=e.id===l?.id;return(0,I.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:()=>{m(!1),t?a(`/`):d(e.id)},children:[(0,I.jsx)(wd,{project:e,size:`sm`}),(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,I.jsx)(`span`,{className:D(`truncate text-[0.875rem]`,t?`font-semibold text-ink`:`font-medium text-ink-2`),children:e.name}),(0,I.jsx)(`span`,{className:`truncate text-[0.75rem] text-ink-4`,children:c(`nav.wizardCount`,{n:e.wizardCount})})]}),t?(0,I.jsx)(Ie,{className:`size-4 shrink-0 text-ember-strong`}):null]},e.id)}),(0,I.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),[{to:`/`,icon:Si,label:c(`nav.wizardsInSpace`),show:!0},{to:`/new`,icon:he,label:c(`nav.addWizard`),show:f}].filter(e=>e.show).map(e=>(0,I.jsxs)(`button`,{type:`button`,role:`menuitem`,className:C,onClick:()=>{m(!1),a(e.to)},children:[(0,I.jsx)(e.icon,{className:`size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`span`,{className:`truncate`,children:e.label})]},e.to)),l&&!l.readOnly?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,I.jsxs)(`button`,{type:`button`,role:`menuitem`,className:C,onClick:()=>{m(!1),y(!0)},children:[(0,I.jsx)(o,{className:`size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`span`,{className:`truncate`,children:c(`nav.renameSpace`)})]})]}):null,f&&!te?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,I.jsxs)(`button`,{type:`button`,role:`menuitem`,className:C,onClick:()=>{m(!1),g(!0)},children:[(0,I.jsx)(he,{className:`size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:(0,I.jsx)(`span`,{className:`truncate`,children:c(`nav.addSpace`)})})]})]}):null]}):null,(0,I.jsx)(Lu,{open:h,onClose:()=>g(!1)}),l?(0,I.jsx)(Ed,{project:l,open:_,onClose:()=>y(!1)}):null]})})}function Ed({project:e,open:t,onClose:n}){let r=At(),[i,a]=(0,P.useState)(e.name);(0,P.useEffect)(()=>{t&&a(e.name)},[t,e.name]);let o=F({mutationFn:()=>N.patch(`/api/studio/projects/${e.id}`,{name:i.trim()}),onSuccess:async()=>{await r.invalidateQueries({queryKey:[`projects`]}),n()}});return(0,I.jsx)(ue,{open:t,onClose:n,title:c(`nav.renameSpace`),children:(0,I.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),i.trim()&&o.mutate()},children:[(0,I.jsx)(ne,{autoFocus:!0,maxLength:80,"aria-label":c(`nav.renameSpace`),value:i,onChange:e=>a(e.target.value)}),(0,I.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,I.jsx)(u,{variant:`ghost`,onClick:n,children:c(`common.cancel`)}),(0,I.jsx)(u,{type:`submit`,busy:o.isPending,disabled:!i.trim(),children:c(`settings.save`)})]})]})})}function Dd({me:e,project:t}){let n=e.mode===`local`||t.origin===`local`,r=n?ir:An,i=c(n?`nav.spaceLocal`:`nav.spaceCloud`);return(0,I.jsx)(`span`,{title:i,className:`grid size-6 shrink-0 place-items-center text-ink-4`,children:(0,I.jsx)(r,{className:`size-3.5`,"aria-label":i})})}function Od({me:e}){let{project:t}=la();return t?(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[(0,I.jsx)(Td,{me:e,placement:`below`,label:t.name,className:e=>D(`-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,I.jsx)(Dd,{me:e,project:t})]}):null}function kd({me:e,placement:t=`below`}){let[n,r]=(0,P.useState)(!1),i=(0,P.useRef)(null),a=v(),{position:o}=ja(),s=Vd();xd(i,n,()=>r(!1));let l=Ka(),[u,d]=(0,P.useState)(!1),f=Xi(e.user.name),p=bd(e,za(`account`)),m=`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,I.jsxs)(`div`,{className:`relative`,ref:i,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:D(`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,I.jsx)(`img`,{src:e.user.image,alt:``,className:`size-full rounded-full object-cover`}):f,p===`linked`||p===`expired`?(0,I.jsx)(`span`,{title:p===`linked`?c(`nav.connected`,{host:El(e.account?.cloudUrl??``)}):c(`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:p===`linked`?(0,I.jsx)(An,{className:`size-2.5 text-moss`}):(0,I.jsx)(On,{className:`size-2.5 text-amber`})}):null]}),n?(0,I.jsxs)(`div`,{className:D(`absolute z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,Sd(t,o,`top-11 right-0`)),children:[(0,I.jsxs)(`div`,{className:`px-3 pt-2 pb-2.5`,children:[(0,I.jsxs)(`div`,{className:`truncate font-medium text-[0.875rem]`,children:[e.user.name,p===`alone`?(0,I.jsxs)(`span`,{className:`font-normal text-ink-4`,children:[` (`,c(`nav.local`),`)`]}):null]}),(0,I.jsx)(`div`,{className:`truncate text-[0.75rem] text-ink-3`,children:e.user.email})]}),p?(0,I.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:[p===`linked`?(0,I.jsx)(An,{className:`mt-0.5 size-4 shrink-0 text-moss`}):p===`expired`?(0,I.jsx)(On,{className:`mt-0.5 size-4 shrink-0 text-amber`}):(0,I.jsx)(ir,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-snug`,children:[(0,I.jsx)(`span`,{className:`break-words`,children:p===`linked`?c(`nav.connected`,{host:El(e.account?.cloudUrl??``)}):c(p===`expired`?`nav.expired`:`nav.onlyHere`)}),(0,I.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:p===`linked`?e.account?.credits!==null&&e.account?.credits!==void 0?c(`nav.credits`,{n:Math.floor(e.account.credits).toLocaleString(E)}):null:c(p===`expired`?`account.signInAgain`:`account.signIn`)})]})]}):null,(0,I.jsx)(`div`,{className:`px-3 pt-1.5 pb-1 font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.07em]`,children:c(`nav.settings`)}),wo(e,s).filter(e=>e.menu).map(e=>(0,I.jsxs)(`button`,{type:`button`,className:m,onClick:()=>{r(!1),a(`/settings/${e.id}`)},children:[(0,I.jsx)(e.icon,{className:`size-4`}),` `,e.label]},e.id)),(0,I.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),Ba()?null:(0,I.jsxs)(`button`,{type:`button`,className:m,onClick:()=>{r(!1),l?qa(l):d(!0)},children:[(0,I.jsx)(on,{className:`size-4`}),` `,c(`install.app.action`)]}),e.manageUrl?(0,I.jsxs)(`a`,{className:m,href:`${e.manageUrl}/account`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(In,{className:`size-4`}),` `,c(`nav.account`)]}):null,(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2 text-[0.875rem] text-ink-2`,children:[c(`nav.language`),(0,I.jsx)(Qc,{tone:`surface`})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2 text-[0.875rem] text-ink-2`,children:[c(`nav.theme`),(0,I.jsx)(Tl,{})]}),e.mode===`managed`?(0,I.jsxs)(`button`,{type:`button`,className:m,onClick:()=>void fa(),children:[(0,I.jsx)(fr,{className:`size-4`}),` `,c(`nav.logout`)]}):null]}):null,(0,I.jsx)(G,{open:u,onClose:()=>d(!1)})]})}function Ad(){let e=pt();return(0,I.jsx)(`button`,{type:`button`,"aria-pressed":e,"aria-label":c(`nav.spaceMenu`),title:c(`nav.spaceMenu`),onClick:()=>xt(!e),className:D(`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,I.jsx)(Mr,{className:`size-[1.125rem]`})})}function jd(){let e=pt(),t=Ze(),{project:n}=la(),r=Vd(),i=$i();if(!n)return null;let a=({isActive:e})=>D(`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:c(`nav.wizards`),icon:Si,end:!0},...i?[{to:`/new`,label:c(`home.new`),icon:he,end:!1}]:[]],s=Y(J(),r).map(e=>({to:`/space/${e.id}`,label:e.label,icon:e.icon,end:!1})),u=e=>(0,I.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsxs)(l,{to:e.to,end:e.end,className:a,children:[(0,I.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center`,children:(0,I.jsx)(e.icon,{className:`size-4 transition-transform duration-200 ease-out group-hover:scale-110`})}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label})]})},e.to))});return(0,I.jsx)(`aside`,{"aria-hidden":!e,inert:!e,className:D(`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,I.jsxs)(`div`,{className:`flex h-full w-64 flex-col overflow-y-auto px-4 pb-4`,children:[(0,I.jsx)(`div`,{ref:ut,className:t?`pt-4 animate-rise sm:pt-6`:`hidden`}),t?null:(0,I.jsxs)(`div`,{className:`pt-4 animate-rise sm:pt-6`,children:[u(o),(0,I.jsx)(`p`,{className:`mt-5 mb-1 px-2 font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.12em]`,children:c(`nav.project`)}),u(s)]})]})})}function Md({me:e,children:t}){return(0,I.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,I.jsx)(Ad,{}),(0,I.jsx)(Od,{me:e}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center`,children:[(0,I.jsx)(gd,{}),t]}),(0,I.jsx)(yd,{me:e})]})}var Nd=`studio-scroll`;function Pd(){return document.getElementById(`studio-scroll`)??document.documentElement}var Fd={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`},Id={left:`flex-row`,right:`flex-row-reverse`,top:`flex-col`,bottom:`flex-col-reverse`};function Ld({me:e,wide:t,full:n,children:r}){let{position:i}=ja(),a=(0,P.useRef)(null),o=za(`goose`);return(0,I.jsxs)(`div`,{className:D(`flex h-dvh overflow-hidden bg-sidebar`,Id[i]),children:[(0,I.jsx)(eo,{me:e}),(0,I.jsx)(`div`,{className:D(`flex min-h-0 min-w-0 flex-1 flex-col`,Fd[i]),children:(0,I.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,I.jsx)(ld,{}),(0,I.jsx)(q,{}),n?(0,I.jsx)(`main`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,children:r}):(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,I.jsx)(Md,{me:e}),(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,I.jsx)(jd,{}),(0,I.jsxs)(`div`,{ref:a,className:`relative flex min-w-0 flex-1 flex-col`,children:[(0,I.jsx)(`main`,{id:Nd,className:`relative min-h-0 flex-1 overflow-y-auto`,style:{paddingBottom:`var(--assistant-dock, 0px)`},children:(0,I.jsx)(`div`,{className:D(`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,I.jsx)(Ic,{column:a})]}),o&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Bc,{column:a}),(0,I.jsx)(Vc,{})]})]})]})]})})]})}globalThis.__WIZARDS_STUDIO__={react:P,jsx:I,reactDom:{createPortal:xa.createPortal,flushSync:xa.flushSync},router:{Link:it,Navigate:tt,NavLink:l,useLocation:fe,useNavigate:v,useParams:C,useSearchParams:se},query:{useMutation:F,useQuery:Ft,useQueryClient:At},ui:Et,sdk:ya};var Rd=0,X={status:`idle`,plugins:[],canReload:!1,problems:[],failed:{},pages:[],nav:[],sections:[],spaceSections:[],spaceParts:[],spaceMenus:{},shareSections:[],shareSetups:[],cards:[]},zd=new Set;function Bd(e){X={...X,...e};for(let e of zd)e()}function Vd(){return(0,P.useSyncExternalStore)(e=>(zd.add(e),()=>zd.delete(e)),()=>X)}var Hd=new Set([``,`new`,`edit`,`settings`,`space`,`setup`,`sign-in`]),Ud=new Set([`account`,`project`,`connectors`,`models`,`build`,`plugins`]),Wd=new Set([`info`,`knowledge`,`data`,`results`]),Gd=new Map,Kd=null,qd=e=>`${e.script}|${e.styles}`,Jd=e=>`__wizardsPlugin_${e.replaceAll(`-`,`_`)}`;function Yd(){let{project:e}=la(),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,P.useMemo)(()=>t?{id:t,name:n,readOnly:r,brand:JSON.parse(i)}:null,[t,n,r,i])}var Xd=(0,P.createContext)(null);function Zd({part:e,children:t}){return(0,I.jsx)(Xd.Provider,{value:e,children:t})}function Qd(e){let t=(0,P.useContext)(Xd),n=JSON.stringify(e.map(e=>[e.id,e.label]));(0,P.useEffect)(()=>{if(t)return Bd({spaceMenus:{...X.spaceMenus,[t]:e}}),()=>{let{[t]:e,...n}=X.spaceMenus;Bd({spaceMenus:n})}},[t,n])}function $d({plugin:e,...t}){return es({...t,plugin:e}),null}function ef(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(`/`)||Hd.has(r))throw Error(`"${e.path}" is an address of the studio itself.`);if([...i(X.pages),...t.pages].some(t=>t.path===e.path))throw Error(`"${e.path}" is registered already.`);t.pages.push({...e,plugin:n,serial:++Rd})},registerNav(e){t.nav.push({...e,plugin:n,serial:++Rd})},registerSettingsSection(e){let r=[...i(X.sections),...t.sections].some(t=>t.id===e.id);if(Ud.has(e.id)||r)throw Error(`The settings have a section "${e.id}" already.`);t.sections.push({...e,plugin:n,serial:++Rd})},registerSpaceSection(e){let r=[...i(X.spaceSections),...t.spaceSections].some(t=>t.id===e.id);if(rd.includes(e.id)||r)throw Error(`The space page has a section "${e.id}" already.`);t.spaceSections.push({...e,plugin:n,serial:++Rd})},registerSpacePart(e){let r=[...i(X.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:++Rd})},registerShareSection(e){if([...i(X.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:++Rd})},registerShareSetup(e){if([...i(X.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:++Rd})},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:++Rd})},useSpace:Yd,useSpaceMenu:Qd,useCrumbs:pd,Assistant:e=>(0,I.jsx)($d,{plugin:n,...e}),useAssistantPage:e=>es({...e,plugin:n}),useAssistantTool:(e,t,r)=>js(`${n.replaceAll(`-`,`_`)}_${e}`,t,r),i18n:{register:e=>(t,n)=>{let r=e[E]?.[t]??e.de[t]??t;for(let[e,t]of Object.entries(n??{}))r=r.replace(`{${e}}`,String(t));return r},lang:()=>E},api:{get:e=>N.get(r(e)),post:(e,t)=>N.post(r(e),t),put:(e,t)=>N.put(r(e),t),patch:(e,t)=>N.patch(r(e),t),del:e=>N.del(r(e))},me:()=>({user:{id:Kd.user.id,name:Kd.user.name,email:Kd.user.email},tenant:Kd.tenant,mode:Kd.mode}),onUnload(e){t.disposers.push(e)}}}function tf(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 nf(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 rf(e,t,n){for(let n of t)try{n()}catch(t){console.error(`[plugin ${e}]`,t)}n?.remove()}function af(e){let t=Gd.get(e);Gd.delete(e),rf(e,t?.disposers??[],t?.link??null);let{[e]:n,...r}=X.failed;Bd({failed:r,pages:X.pages.filter(t=>t.plugin!==e),nav:X.nav.filter(t=>t.plugin!==e),sections:X.sections.filter(t=>t.plugin!==e),spaceSections:X.spaceSections.filter(t=>t.plugin!==e),spaceParts:X.spaceParts.filter(t=>t.plugin!==e),shareSections:X.shareSections.filter(t=>t.plugin!==e),shareSetups:X.shareSetups.filter(t=>t.plugin!==e),cards:X.cards.filter(t=>t.plugin!==e)})}async function of(e){let{id:t}=e,n={pages:[],nav:[],sections:[],spaceSections:[],spaceParts:[],shareSections:[],shareSetups:[],cards:[],disposers:[]},r=null;try{e.styles&&(r=await nf(t,a(e.styles))),await tf(a(e.script));let i=globalThis,o=Jd(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(ef(e,n))}catch(i){console.error(`[plugin ${t}]`,i),rf(t,n.disposers,r),af(t),Gd.set(t,{key:qd(e),disposers:[],link:null}),Bd({failed:{...X.failed,[t]:i.message}});return}let i=Gd.get(t);Gd.set(t,{key:qd(e),disposers:n.disposers,link:r});let{[t]:o,...s}=X.failed;Bd({failed:s,pages:[...X.pages.filter(e=>e.plugin!==t),...n.pages],nav:[...X.nav.filter(e=>e.plugin!==t),...n.nav],sections:[...X.sections.filter(e=>e.plugin!==t),...n.sections],spaceSections:[...X.spaceSections.filter(e=>e.plugin!==t),...n.spaceSections],spaceParts:[...X.spaceParts.filter(e=>e.plugin!==t),...n.spaceParts],shareSections:[...X.shareSections.filter(e=>e.plugin!==t),...n.shareSections],shareSetups:[...X.shareSetups.filter(e=>e.plugin!==t),...n.shareSetups],cards:[...X.cards.filter(e=>e.plugin!==t),...n.cards]}),rf(t,i?.disposers??[],i?.link??null)}var sf=Promise.resolve();function cf(){return sf=sf.catch(()=>void 0).then(async()=>{let e=await N.get(`/api/studio/plugins`);for(let t of[...Gd.keys()])e.plugins.some(e=>e.id===t&&e.script)||af(t);Bd(e);for(let t of e.plugins)t.script&&Gd.get(t.id)?.key!==qd(t)&&await of(t)}).catch(e=>console.error(`[plugins]`,e)).finally(()=>Bd({status:`ready`})),sf}var lf=null;function uf(e){Kd=e,X.status===`idle`&&(Bd({status:`loading`}),cf().then(()=>{X.canReload&&!lf&&(lf=new EventSource(a(`/api/studio/plugins/-/events`),{withCredentials:!0}),lf.addEventListener(`change`,()=>void cf()))}))}async function df(e){await N.post(e?`/api/studio/plugins/-/reload/${e}`:`/api/studio/plugins/-/reload`),await cf()}var ff=class extends P.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error(`[plugin]`,e)}render(){return this.state.failed?(0,I.jsx)(pe,{children:c(`plugins.crashed`)}):this.props.children}};function pf({of:e,children:t}){return(0,I.jsx)(`div`,{"data-plugin":e.plugin,className:`contents`,children:(0,I.jsx)(ff,{children:t},e.serial)})}function Z({end:e,className:t}){return(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-4 ${t??``}`,children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-2.5`,children:[(0,I.jsx)(Ti,{size:28}),(0,I.jsxs)(`span`,{className:`font-display font-semibold text-[1.0625rem] tracking-tight ${e?`max-sm:sr-only`:``}`,children:[`engenty`,(0,I.jsx)(`span`,{className:`mr-[0.09em] ml-[0.06em] text-ember-strong`,children:`.`}),(0,I.jsx)(`span`,{className:`font-normal text-ink-2`,children:`wizards`})]})]}),(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:e?`flex max-sm:hidden`:`flex`,children:(0,I.jsx)(Tl,{tone:`surface`})}),(0,I.jsx)(Qc,{tone:`surface`}),e]})]})}var mf={de:{imprint:`/de/impressum`,privacy:`/de/datenschutz`,terms:`/de/nutzungsbedingungen`},en:{imprint:`/imprint`,privacy:`/privacy`,terms:`/terms`}};function hf({failed:e}){let t=Ue(),[n,r]=(0,P.useState)(()=>_a()??``),[i,a]=(0,P.useState)(!1),o=st(n,r,{endpoint:null}),s=()=>{let e=n.trim();e&&!i&&(o.listening&&o.stop(),a(!0),ga(e),pa(`/new`,e))};return(0,I.jsxs)(`div`,{className:`min-h-dvh px-6 pb-16 sm:px-10`,children:[(0,I.jsx)(Z,{className:`pt-6 sm:pt-8`,end:(0,I.jsx)(u,{variant:`secondary`,size:`sm`,onClick:()=>pa(`/`),children:c(`guest.signIn`)})}),(0,I.jsxs)(`div`,{className:`mx-auto max-w-2xl animate-rise pt-8 md:pt-12`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,I.jsx)(`div`,{className:`size-[84px] md:size-auto`,children:(0,I.jsx)(`div`,{className:`origin-top-left scale-[0.56] md:scale-100`,children:(0,I.jsx)(qi,{kind:`sprout`,size:150,fluffy:!0})})}),(0,I.jsx)(`h1`,{className:`mt-1 font-display font-semibold text-[1.5rem] leading-tight tracking-tight md:mt-2 md:text-[2.375rem]`,children:c(`new.title`)})]}),(0,I.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,I.jsx)(x,{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?c(`editor.listening`):c(`new.placeholder`),className:`border-0 bg-transparent text-[1rem] shadow-none focus:ring-0`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 px-1 pb-1`,children:[o.supported?(0,I.jsx)(at,{speech:o,labelled:!0}):null,(0,I.jsx)(`span`,{className:`flex-1`}),(0,I.jsxs)(u,{size:`md`,onClick:s,busy:i,disabled:!n.trim(),children:[c(`new.build`),` `,(0,I.jsx)(Nt,{className:`size-4`})]})]})]}),o.error?(0,I.jsx)(`p`,{className:`mt-2 px-3 text-[0.75rem] text-rose`,children:o.error===`denied`?c(`editor.micDenied`):o.error}):null,e?(0,I.jsx)(`p`,{className:`mt-3 text-center text-[0.875rem] text-rose`,children:c(`auth.failed`)}):null,(0,I.jsx)(`p`,{className:`mt-3 text-center text-[0.875rem] text-ink-3`,children:c(`guest.hint`)})]}),(0,I.jsxs)(`section`,{className:`mx-auto max-w-5xl`,children:[(0,I.jsx)(`h2`,{className:`mt-16 mb-5 text-center font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:c(`new.orStarter`)}),(0,I.jsx)(Nu,{onGuestOpen:e=>pa(`/new?starter=${encodeURIComponent(e.id)}`)})]}),(0,I.jsxs)(`footer`,{className:`mt-16 flex flex-wrap justify-center gap-x-5 gap-y-1 text-[0.75rem] text-ink-3`,children:[(0,I.jsx)(`span`,{children:`engenty.wizards`}),[`imprint`,`privacy`,`terms`].map(e=>(0,I.jsx)(`a`,{href:mf[t][e],className:`transition hover:text-ink-2`,children:c(`legal.${e}`)},e))]})]})}var gf=/(?:^|;\s*)engenty_signed_in=1(?:;|$)/;function _f(){return!!window.engentyDesktop}function vf({text:e}){return e.split(/(?<=[.!?])\s+/).map(e=>(0,I.jsx)(`span`,{className:`block`,children:e},e))}function yf({title:e,children:t,className:n=`mt-8`}){return(0,I.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,I.jsx)(`div`,{className:`mb-1.5 font-medium text-ink`,children:e}),t]})}function bf(){let e=Ft({queryKey:[`config`],queryFn:()=>N.get(`/api/config`),refetchInterval:e=>e.state.status===`error`&&!(e.state.error instanceof m&&e.state.error.body?.code===`host`)&&2e3,retry:!1}),t=At(),[n,r]=(0,P.useState)(!1),[i,a]=(0,P.useState)(!1),o=new URLSearchParams(window.location.search).get(`signin`)===`failed`,s=e.data?.mode===`local`&&e.data.devLogin,[l,d]=(0,P.useState)(!1),f=e.data?.mode===`managed`&&!o&&!_f()&&gf.test(document.cookie);if((0,P.useEffect)(()=>{f&&pa()},[f]),(0,P.useEffect)(()=>{if(!s||l)return;let e=!0;return N.post(`/api/dev/login`).then(()=>t.invalidateQueries()).catch(()=>{e&&d(!0)}),()=>{e=!1}},[s,l,t]),e.isLoading||f||s&&!l)return(0,I.jsx)(`div`,{className:`flex min-h-dvh items-center justify-center`,children:(0,I.jsx)(qi,{kind:`round`,size:56})});if(e.data?.mode===`managed`&&!e.data.devLogin&&!_f())return(0,I.jsx)(hf,{failed:o});let p=e.data?.mode===`local`&&!e.data.devLogin,h=e.error instanceof m&&e.error.body?.code===`host`?e.error:null,g=h?String(h.body.appUrl??``):null;return(0,I.jsxs)(`div`,{className:`relative flex min-h-dvh flex-col items-center justify-center px-6 py-16`,children:[(0,I.jsx)(Z,{className:`absolute inset-x-6 top-6 sm:inset-x-10 sm:top-8`}),(0,I.jsxs)(`div`,{className:`flex w-full max-w-md animate-rise flex-col items-center text-center`,children:[(0,I.jsx)(qi,{kind:`round`,size:p||e.isError?140:200,fluffy:!0}),(0,I.jsxs)(`span`,{className:`mt-2 font-display font-semibold text-[0.9375rem] text-ink-3 tracking-tight`,children:[(0,I.jsx)(Ei,{}),(0,I.jsx)(`span`,{className:`font-normal`,children:`wizards`})]}),(0,I.jsx)(`h1`,{className:`mt-3 text-balance font-display font-semibold text-[2.125rem] leading-[1.1] tracking-tight`,children:(0,I.jsx)(vf,{text:c(`brand.tagline`)})}),(0,I.jsx)(`p`,{className:`mt-4 text-balance text-[1rem] text-ink-2 leading-relaxed`,children:(0,I.jsx)(vf,{text:c(`brand.sub`)})}),g?(0,I.jsxs)(yf,{title:c(`auth.wrongHost`),children:[(0,I.jsx)(`p`,{children:c(`auth.wrongHostWhy`)}),(0,I.jsx)(`a`,{href:`${g}${window.location.pathname}`,className:`mt-1.5 block break-all font-medium text-ember-strong underline-offset-2 hover:underline`,children:g})]}):e.isError?(0,I.jsx)(yf,{title:c(`auth.unreachable`),children:c(`auth.unreachableWhy`,{address:window.location.host})}):null,(0,I.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-3`,children:[o?(0,I.jsx)(`p`,{className:`text-[0.875rem] text-rose`,children:c(`auth.failed`)}):null,e.data?.mode===`managed`?(0,I.jsx)(u,{size:`lg`,busy:n,className:`w-full`,onClick:async()=>{r(!0);let e=window.engentyDesktop;if(!e){pa();return}let{url:t}=await N.post(`/api/auth/desktop/start`);e.open(t),a(!0),r(!1)},children:c(i?`local.accountWaiting`:`auth.signIn`)}):null,e.data?.devLogin?(0,I.jsx)(u,{size:`lg`,busy:n,className:`w-full`,onClick:async()=>{r(!0),await N.post(`/api/dev/login`),await t.invalidateQueries(),r(!1)},children:c(`auth.dev`)}):null,p?(0,I.jsxs)(yf,{title:c(`auth.localTitle`),className:`-mt-2`,children:[(0,I.jsx)(`p`,{children:c(`auth.localWhy`)}),(0,I.jsx)(`p`,{className:`mt-3`,children:c(`auth.localLink`)}),(0,I.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,I.jsx)(`p`,{className:`mt-3 text-ink-3`,children:c(`auth.localStartLink`)}),(0,I.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,I.jsx)(`p`,{className:`mt-6 text-[0.8125rem] text-ink-3`,children:c(`auth.legal`)}):null]}),(0,I.jsxs)(`footer`,{className:`absolute inset-x-0 bottom-6 text-center text-[0.75rem] text-ink-3 sm:bottom-8`,children:[`© engenty · `,c(`about.version`,{v:Kc})]})]})}var xf=(0,P.lazy)(()=>It(()=>import(`./PublicRunner-BCt7Q6C-.js`).then(e=>({default:e.PublicRunner})),__vite__mapDeps([11,1,2,5,6,12,13,14]))),Sf=(0,P.lazy)(()=>It(()=>import(`./SharePage-DqZWHva_.js`).then(e=>({default:e.SharePage})),__vite__mapDeps([15,1,2,5,6,11,12,13,14]))),Cf=(0,P.lazy)(()=>It(()=>import(`./EditorPage-BalA5U2Y.js`).then(e=>({default:e.EditorPage})),__vite__mapDeps([16,1,2,5,6,17,18,19,12,13,14,20,10]))),wf=(0,P.lazy)(()=>It(()=>Promise.resolve().then(()=>Fu).then(e=>({default:e.HomePage})),void 0)),Tf=(0,P.lazy)(()=>It(()=>import(`./OnboardingPage-CUwCiVIr.js`).then(e=>({default:e.OnboardingPage})),__vite__mapDeps([21,1,2,5,6,18]))),Ef=(0,P.lazy)(()=>It(()=>import(`./NewWizardPage-BOBYiB9i.js`).then(e=>({default:e.NewWizardPage})),__vite__mapDeps([22,1,2,5,6,20,13,18]))),Df=(0,P.lazy)(()=>It(()=>import(`./SettingsPage-BzwR50fi.js`).then(e=>({default:e.SettingsPage})),__vite__mapDeps([23,1,2,5,6,19,24,7,25,26]))),Of=(0,P.lazy)(()=>It(()=>import(`./ProjectPage-Bb16MdYG.js`).then(e=>({default:e.ProjectPage})),__vite__mapDeps([27,1,2,5,6,17,18,13,24,7,14]))),kf=(0,P.lazy)(()=>It(()=>import(`./SetupPage-gAp7rPxp.js`).then(e=>({default:e.SetupPage})),__vite__mapDeps([28,1,2,5,6,25,26]))),Af=null,jf=null;function Mf(){return(0,I.jsx)(`div`,{className:`flex min-h-dvh items-center justify-center`,children:(0,I.jsx)(qi,{kind:`round`,size:56})})}function Nf({children:e,bare:t,wide:n,full:r}){let i=ia(),a=fe();return ra(i.data),(0,P.useEffect)(()=>{i.data&&uf(i.data)},[i.data]),i.isLoading?(0,I.jsx)(Mf,{}):i.data?i.data.mode===`local`&&!i.data.setupDone&&a.pathname!==`/setup`?(0,I.jsx)(tt,{to:`/setup`,replace:!0}):i.data.onboarding&&a.pathname!==`/start`?(0,I.jsx)(tt,{to:`/start`,replace:!0}):t?e:(0,I.jsx)(Ld,{me:i.data,wide:n,full:r,children:e}):(0,I.jsx)(bf,{})}function Pf(){return Ue(),(0,I.jsx)(P.Suspense,{fallback:(0,I.jsx)(Mf,{}),children:(0,I.jsxs)(le,{children:[jf,Af,(0,I.jsx)(O,{path:`/w/:token`,element:(0,I.jsx)(xf,{})}),(0,I.jsx)(O,{path:`/w/:token/steps`,element:(0,I.jsx)(xf,{steps:!0})}),(0,I.jsx)(O,{path:`/w/:token/steps/:runId`,element:(0,I.jsx)(xf,{steps:!0})}),(0,I.jsx)(O,{path:`/w/:token/chat`,element:(0,I.jsx)(xf,{chat:!0})}),(0,I.jsx)(O,{path:`/w/:token/chat/:runId`,element:(0,I.jsx)(xf,{chat:!0})}),(0,I.jsx)(O,{path:`/w/:token/talk`,element:(0,I.jsx)(xf,{chat:!0,talk:!0})}),(0,I.jsx)(O,{path:`/w/:token/talk/:runId`,element:(0,I.jsx)(xf,{chat:!0,talk:!0})}),(0,I.jsx)(O,{path:`/w/:token/video`,element:(0,I.jsx)(xf,{chat:!0,video:!0})}),(0,I.jsx)(O,{path:`/w/:token/video/:runId`,element:(0,I.jsx)(xf,{chat:!0,video:!0})}),(0,I.jsx)(O,{path:`/w/:token/:runId`,element:(0,I.jsx)(xf,{})}),(0,I.jsx)(O,{path:`/s/:token`,element:(0,I.jsx)(Sf,{})}),(0,I.jsx)(O,{path:`*`,element:(0,I.jsx)(Ff,{})})]})})}function Ff(){return(0,P.useEffect)(()=>{window.location.replace(`${Ae}/`)},[]),(0,I.jsx)(Mf,{})}function If(){return Vd().status===`ready`?(0,I.jsx)(tt,{to:`/`,replace:!0}):(0,I.jsx)(Mf,{})}function Lf(){Ue(),(0,P.useEffect)(()=>(document.documentElement.dataset.studio=``,()=>{delete document.documentElement.dataset.studio}),[]);let e=Vd();return(0,I.jsx)(Vs,{children:(0,I.jsx)(P.Suspense,{fallback:(0,I.jsx)(Mf,{}),children:(0,I.jsxs)(le,{children:[(0,I.jsx)(O,{path:`/`,element:(0,I.jsx)(Nf,{children:(0,I.jsx)(wf,{})})}),(0,I.jsx)(O,{path:`/sign-in`,element:(0,I.jsx)(Nf,{children:(0,I.jsx)(tt,{to:`/`,replace:!0})})}),(0,I.jsx)(O,{path:`/new`,element:(0,I.jsx)(Nf,{children:(0,I.jsx)(Ef,{})})}),(0,I.jsx)(O,{path:`/edit/:id`,element:(0,I.jsx)(Nf,{full:!0,children:(0,I.jsx)(Cf,{})})}),(0,I.jsx)(O,{path:`/space/:group?`,element:(0,I.jsx)(Nf,{wide:!0,children:(0,I.jsx)(Of,{})})}),(0,I.jsx)(O,{path:`/settings/:section?`,element:(0,I.jsx)(Nf,{wide:!0,children:(0,I.jsx)(Df,{})})}),(0,I.jsx)(O,{path:`/setup`,element:(0,I.jsx)(Nf,{bare:!0,children:(0,I.jsx)(kf,{})})}),(0,I.jsx)(O,{path:`/start`,element:(0,I.jsx)(Nf,{bare:!0,children:(0,I.jsx)(Tf,{})})}),e.pages.map(e=>(0,I.jsx)(O,{path:e.path,element:(0,I.jsx)(Nf,{wide:e.wide,children:(0,I.jsx)(pf,{of:e,children:(0,I.jsx)(e.component,{})})})},e.serial)),(0,I.jsx)(O,{path:`*`,element:(0,I.jsx)(Nf,{bare:!0,children:(0,I.jsx)(If,{})})})]})})})}function Rf(){if(typeof window>`u`)return null;let e=window.engentyApp;return e&&typeof e.call==`function`&&Array.isArray(e.can)?e:null}var zf=Rf(),Bf=zf!==null||typeof window<`u`&&new URLSearchParams(window.location.search).get(`app`)===`1`;Bf&&typeof document<`u`&&document.documentElement.classList.add(`in-app`);var Vf=e=>zf?.can.includes(e)===!0;function Q(e,t){return zf&&Vf(e)?zf.call(e,t):Promise.reject(Error(`the app cannot ${e}`))}function Hf(e,t){Vf(e)&&Q(e,t).catch(()=>void 0)}function Uf(e,t,n){return Vf(`download`)?(e.preventDefault(),Q(`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 Gf(e,t){let n=encodeURIComponent(e),r=encodeURIComponent(t);return[{id:`mail`,label:c(`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 Kf={x:`𝕏`,linkedin:`in`,whatsapp:`WA`,facebook:`f`};function qf({runId:e,title:t,initial:n}){let[r,i]=(0,P.useState)(!1),[a,o]=(0,P.useState)(n),[s,l]=(0,P.useState)(!1),[d,f]=(0,P.useState)(!1),[p,m]=(0,P.useState)(null),h=async()=>{if(i(!0),!a){l(!0),m(null);try{o(await N.post(`/api/runs/${e}/share`))}catch(e){m(e.message)}finally{l(!1)}}},g=async()=>{await N.del(`/api/runs/${e}/share`),o(null),i(!1)},_=()=>{a&&(navigator.clipboard.writeText(a.url),f(!0),setTimeout(()=>f(!1),1500))},v=Vf(`share`)||typeof navigator<`u`&&`share`in navigator,y=a?.expiresAt?new Intl.DateTimeFormat(E,{dateStyle:`long`}).format(new Date(a.expiresAt)):null;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(u,{variant:`secondary`,onClick:()=>void h(),children:[(0,I.jsx)(yt,{className:`size-4`}),` `,c(`shareRun.button`)]}),(0,I.jsx)(ue,{open:r,onClose:()=>i(!1),title:c(`shareRun.title`),children:s?(0,I.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,I.jsx)(M,{})}):p?(0,I.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[0.875rem] text-rose`,children:p}):a?(0,I.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-paper-2 p-1.5 pl-3`,children:[(0,I.jsx)(ht,{className:`size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`input`,{readOnly:!0,value:a.url,onFocus:e=>e.target.select(),"aria-label":c(`share.link`),className:`min-w-0 flex-1 bg-transparent text-[0.875rem] outline-none coarse:h-11`}),(0,I.jsxs)(u,{size:`sm`,onClick:_,children:[d?(0,I.jsx)(Ie,{className:`size-3.5`}):(0,I.jsx)(Xe,{className:`size-3.5`}),c(d?`share.copied`:`share.copy`)]})]}),(0,I.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 sm:grid-cols-6`,children:[Gf(a.url,t).map(e=>(0,I.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,I.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,I.jsx)(mr,{className:`size-5`}):Kf[e.id]}),e.label]},e.id)),v?(0,I.jsxs)(`button`,{type:`button`,onClick:()=>void(Vf(`share`)?Q(`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,I.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 transition hover:bg-paper-3`,children:(0,I.jsx)(yt,{className:`size-5`})}),c(`shareRun.more`)]}):null]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[0.8125rem] text-ink-3`,children:[(0,I.jsx)(`span`,{children:y?c(`shareRun.until`,{date:y}):c(`shareRun.kept`)}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>void g(),className:`shrink-0 hover:text-rose coarse:min-h-11`,children:c(`shareRun.withdraw`)})]})]}):null})]})}A({lang:E,runBase:e=>`/api/runs/${e}`,withBase:a,asset:Ee,serviceWorker:`${re}/sw.js`,app:{can:Vf,call:Q,tell:Hf,download:Uf},Mascot:qi,ShareResultButton:qf,onServerError:e=>ie(`error`,e)}),vt(),`engentyDesktop`in window&&(document.documentElement.dataset.desktop=``);var Jf=window.location.pathname,Yf=Jf===Ae||Jf.startsWith(`${Ae}/`);Yf&&`serviceWorker`in navigator&&navigator.serviceWorker.register(`${re}/sw.js`).catch(()=>void 0);var Xf=new Jt({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});(0,Ci.createRoot)(document.getElementById(`root`)).render((0,I.jsx)(P.StrictMode,{children:(0,I.jsx)(ot,{client:Xf,children:(0,I.jsx)(de,{basename:Yf?Ae:re,children:Yf?(0,I.jsx)(Lf,{}):(0,I.jsx)(Pf,{})})})}));export{$c as $,ir as $t,tu as A,Ui as At,gl as B,ei as Bt,Nu as C,$i as Ct,$l as D,Gi as Dt,eu as E,Yi as Et,Al as F,bi as Ft,cl as G,Or as Gt,rl as H,Wr as Ht,kl as I,gi as It,al as J,br as Jt,ol as K,wr as Kt,Ol as L,mi as Lt,Rl as M,Wi as Mt,Nl as N,Ti as Nt,iu as O,qi as Ot,Ml as P,Si as Pt,dl as Q,cr as Qt,Tl as R,ui as Rt,Du as S,Zi as St,ku as T,aa as Tt,tl as U,Hr as Ut,nl as V,Xr as Vt,fl as W,Br as Wt,pl as X,mr as Xt,hl as Y,vr as Yt,ml as Z,ur as Zt,ad as _,_a as _t,Wf as a,An as an,wo as at,Ru as b,la as bt,Zd as c,mn as cn,_o as ct,yd as d,fo as dt,Qn as en,Qc as et,vd as f,La as ft,td as g,Xi as gt,id as h,va as ht,Vf as i,Mn as in,es as it,Ql as j,Bi as jt,ru as k,Ji as kt,df as l,on as ln,no as lt,pd as m,Fa as mt,Bf as n,Kn as nn,Kc as nt,Hf as o,En as on,Co as ot,Pd as p,za as pt,sl as q,Sr as qt,Q as r,Rn as rn,Wc as rt,pf as s,bn as sn,bo as st,qf as t,Xn as tn,Jc as tt,Vd as u,F as un,uo as ut,J as v,da as vt,hu as w,ia as wt,Pu as x,ea as xt,Y as y,ua as yt,vl as z,oi as zt};
|
|
14
|
+
`)[0]})]})},t.id))}):(0,I.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:c(`assistant.noEarlier`)})}function bc({id:e}){let t=Us(e);return t.data?(0,I.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,I.jsxs)(`div`,{className:`rounded-xl bg-paper-2 px-4 py-3 text-[0.8125rem] text-ink-2 leading-relaxed`,children:[(0,I.jsx)(`div`,{className:`font-medium text-ink`,children:t.data.title||c(`assistant.untitled`)}),(0,I.jsx)(`p`,{className:`mt-1 whitespace-pre-line`,children:t.data.summary})]}),(0,I.jsx)(So,{chat:{messages:t.data.messages,phase:`idle`,activity:null,startedAt:null,error:null,send:async()=>!1},avatar:`round`,changedLabel:c(`project.assistantChanged`),card:e=>(0,I.jsx)(hc,{card:e,send:()=>void 0}),calls:e=>(0,I.jsx)(mc,{calls:e.toolCalls})})]}):(0,I.jsx)(M,{className:`m-4 size-4`})}function xc({state:e,composer:t}){let n=(0,P.useRef)(null),{chat:r,view:i}=e;return(0,P.useEffect)(()=>{let e=n.current,t=e=>{let t=e.target.closest(`a`)?.getAttribute(`href`);!t||e.metaKey||e.ctrlKey||e.shiftKey||(Es(t)?e.preventDefault():/^https?:\/\//.test(t)&&(e.preventDefault(),window.open(t,`_blank`,`noopener,noreferrer`)))};return e?.addEventListener(`click`,t),()=>e?.removeEventListener(`click`,t)},[]),(0,P.useEffect)(()=>{n.current?.scrollTo({top:n.current.scrollHeight,behavior:`smooth`})},[r.messages,r.phase,i]),(0,I.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,I.jsx)(yc,{state:e}):i.kind===`read`?(0,I.jsx)(bc,{id:i.id}):r.messages.length?(0,I.jsx)(So,{chat:r,avatar:`round`,changedLabel:c(`project.assistantChanged`),card:e=>(0,I.jsx)(hc,{card:e,send:e=>void r.send(e)}),calls:t=>e.dev.on?(0,I.jsx)(Zs,{calls:t.toolCalls}):(0,I.jsx)(mc,{calls:t.toolCalls}),foot:t=>e.dev.on?(0,I.jsx)(Ys,{steps:t.steps}):null}):(0,I.jsx)(vc,{state:e,composer:t}),r.error&&i.kind===`chat`?(0,I.jsx)(`div`,{className:`mt-4 rounded-lg bg-rose-tint px-3 py-2 text-[0.8125rem] text-rose`,children:r.error}):null]})}function Sc({state:e}){let[t,n]=(0,P.useState)(!1),r=(0,P.useRef)(null);xd(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,I.jsxs)(`div`,{className:`relative shrink-0`,ref:r,children:[(0,I.jsxs)(`button`,{type:`button`,"aria-haspopup":`menu`,"aria-expanded":t,"aria-label":c(`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:[c(`assistant.name`),(0,I.jsx)(Pt,{className:`size-3.5 text-ink-4`})]}),t?(0,I.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,I.jsxs)(`button`,{type:`button`,role:`menuitem`,className:i,disabled:e.renewing,onClick:()=>{n(!1),e.newChat()},children:[(0,I.jsx)(ii,{className:`size-4`}),` `,c(`assistant.newChat`)]}),(0,I.jsxs)(`button`,{type:`button`,role:`menuitem`,className:i,onClick:()=>{n(!1),e.setView({kind:`earlier`})},children:[(0,I.jsx)(Jr,{className:`size-4`}),` `,c(`assistant.earlier`)]})]}):null]})}function Cc({state:e}){let t=e.dev.on;return(0,I.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"aria-label":c(`assistant.dev`),title:c(t?`assistant.devOn`:`assistant.devOff`),onClick:()=>e.dev.set(!t),className:D(`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,I.jsx)(`span`,{className:`size-4 rounded-full bg-white shadow-sm`})]})}function wc({state:e,where:t,wide:n,phone:r,compact:i,grip:a}){let o=e.live,[s,l]=(0,P.useState)(!1),u=hd().map(e=>e.label).join(` · `),d=e.dev.on&&e.view.kind===`chat`,f=t===`sidebar`,p=e.chat.messages;return(0,I.jsxs)(`div`,{className:D(`flex items-center border-border-soft border-b py-2`,f?`gap-1 px-3`:`gap-1.5 px-3 sm:px-4`),children:[a,e.view.kind===`chat`?t===`sidebar`?(0,I.jsx)(qi,{kind:`round`,size:26,goggles:!0,interactive:!1}):null:(0,I.jsx)(y,{label:c(`assistant.back`),onClick:()=>e.setView({kind:e.view.kind===`read`?`earlier`:`chat`}),className:`size-8`,children:(0,I.jsx)(j,{className:`size-4`})}),(0,I.jsxs)(`div`,{className:`ml-0.5 min-w-[8.5rem] flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[e.view.kind===`chat`?(0,I.jsx)(Sc,{state:e}):(0,I.jsx)(`span`,{className:`font-display font-semibold text-[0.9375rem]`,children:c(`assistant.earlier`)}),e.dev.offered&&e.view.kind===`chat`?(0,I.jsx)(Cc,{state:e}):null]}),o.state===`off`?u?(0,I.jsx)(`div`,{className:`truncate text-[0.75rem] text-ink-4`,children:c(`assistant.sees`,{page:u})}):null:(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[0.75rem] text-ember-strong`,children:[(0,I.jsx)(`span`,{className:`size-1.5 animate-pulse-dot rounded-full bg-ember`}),c(`assistant.live`),` · `,(0,I.jsx)(Tc,{since:o.since})]})]}),d?(0,I.jsx)(ec,{messages:p,narrow:f}):null,d?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(y,{label:c(`assistant.inspect`),onClick:()=>l(!0),className:`size-8 max-sm:hidden`,children:(0,I.jsx)(rn,{className:`size-4`})}),p.length&&!f?(0,I.jsx)(`span`,{className:`max-sm:hidden`,children:(0,I.jsx)(nc,{messages:p,turns:e.dev.turns})}):null,(0,I.jsx)(ac,{open:s,onClose:()=>l(!1),turns:e.dev.turns,messages:p})]}):null,e.view.kind===`chat`&&p.length?(0,I.jsx)(y,{label:c(`assistant.newChat`),disabled:e.renewing,onClick:()=>void e.newChat(),className:`size-8`,children:(0,I.jsx)(ii,{className:`size-4`})}):null,t!==`sidebar`&&n?(0,I.jsx)(y,{label:c(`assistant.layoutSidebar`),onClick:()=>e.setLayout(`sidebar`),className:`size-8`,children:(0,I.jsx)(Pr,{className:`size-4`})}):null,t===`sidebar`||t===`avatar`&&!r&&!i?(0,I.jsx)(y,{label:c(`assistant.layoutBottom`),onClick:()=>{e.setLayout(`bottom`),e.setOpen(!0)},className:`size-8`,children:(0,I.jsx)(Ar,{className:`size-4`})}):null,(0,I.jsx)(y,{label:c(`assistant.close`),onClick:()=>{t!==`avatar`&&e.setLayout(`avatar`),e.setOpen(!1)},className:`size-8`,children:(0,I.jsx)(Se,{className:`size-4`})})]})}function Tc({since:e}){let[t,n]=(0,P.useState)(()=>Date.now());(0,P.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,I.jsxs)(`span`,{className:`tabular-nums`,children:[String(Math.floor(r/60)).padStart(2,`0`),`:`,String(r%60).padStart(2,`0`)]})}function Ec({state:e}){let t=e.live,n=t.state===`thinking`?c(`assistant.liveThinking`):t.state===`speaking`?c(`assistant.liveSpeaking`):t.muted?c(`assistant.liveMuted`):c(`assistant.liveListening`);return(0,I.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,I.jsx)(`span`,{className:`size-2 shrink-0 animate-pulse-dot rounded-full bg-ember`}),(0,I.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,I.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,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[0.8125rem] text-ink-2`,children:t.heard?(0,I.jsx)(`span`,{className:`text-ink`,children:t.heard}):t.state===`thinking`?(0,I.jsx)(bo,{chat:e.chat,className:`text-ink-3`}):(0,I.jsxs)(I.Fragment,{children:[n,` · `,(0,I.jsx)(Tc,{since:t.since})]})}),t.voice&&t.voice.way!==`none`?(0,I.jsx)(y,{label:c(`assistant.naturalVoice`),"aria-pressed":t.voice.natural,onClick:()=>t.setNatural(!t.voice?.natural),className:D(t.voice.natural&&`bg-ember-tint text-ember-strong`),children:(0,I.jsx)(bi,{className:`size-4`})}):null,(0,I.jsx)(y,{label:t.muted?c(`assistant.unmute`):c(`assistant.mute`),"aria-pressed":t.muted,onClick:t.toggleMute,children:t.muted?(0,I.jsx)(Sr,{className:`size-4`}):(0,I.jsx)(et,{className:`size-4`})}),(0,I.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,I.jsx)(Br,{className:`size-4`}),` `,c(`assistant.end`)]})]})}function Dc({state:e,composer:t}){return e.pending.length?(0,I.jsx)(`ul`,{"aria-label":c(`assistant.pending`),className:`mb-2 flex flex-col gap-1`,children:e.pending.map(n=>(0,I.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,I.jsx)(`span`,{title:n.way===`queue`?c(`assistant.pendingQueueHint`):c(`assistant.pendingSignalHint`),className:D(`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`?c(`assistant.pendingQueue`):c(`assistant.pendingSignal`)}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n.text}),(0,I.jsx)(`button`,{type:`button`,title:c(`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:c(`assistant.sendNow`)}),(0,I.jsx)(y,{label:c(`assistant.edit`),onClick:()=>{let r=e.takeBack(n.id);r&&t.current?.fill(r.text)},className:`size-7`,children:(0,I.jsx)(o,{className:`size-3.5`})}),(0,I.jsx)(y,{label:c(`assistant.remove`),onClick:()=>e.takeBack(n.id),className:`size-7`,children:(0,I.jsx)(Se,{className:`size-3.5`})})]},n.id))}):null}function Oc({state:e,composer:t,floating:n,bare:r}){let i=V(),a=e.live;if(e.view.kind===`earlier`)return null;if(e.view.kind===`read`)return(0,I.jsx)(`p`,{className:`m-3 rounded-xl bg-paper-2 px-4 py-3 text-[0.8125rem] text-ink-2 leading-relaxed`,children:c(`assistant.readOnly`)});let o=e.chat.phase!==`idle`;return(0,I.jsxs)(`div`,{className:n?void 0:`p-3`,children:[a.state===`off`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Dc,{state:e,composer:t}),(0,I.jsx)(Le,{ref:t,floating:n,bare:r,placeholder:o?c(`assistant.busyComposer`,{keys:kt}):i.placeholder??c(`assistant.composer`),busy:o,onStop:e.stop,onSend:(t,n,r)=>e.send(t,n,r?`queue`:`signal`),onTalk:Go?()=>{e.setOpen(!0),a.start()}:void 0})]}):(0,I.jsx)(Ec,{state:e}),a.error?(0,I.jsx)(`p`,{className:`mt-2 px-3 text-[0.75rem] text-rose`,children:a.error===`denied`?c(`editor.micDenied`):a.error}):null]})}function kc({composer:e,children:t,className:n,style:r}){return(0,I.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 Ac(e){let[t,n]=(0,P.useState)({width:0,height:0});return(0,P.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 jc(e){return(t,n)=>{if(t===`sidebar`){e.setLayout(`sidebar`);return}Mo(t===`free`?{place:`free`,free:n}:{place:t})}}function Mc({state:e,column:t,frame:n,wide:r,from:i}){let a=No(),o=jc(e);return(0,I.jsx)(`button`,{type:`button`,title:c(`assistant.move`),"aria-label":c(`assistant.move`),onPointerDown:a=>Uo(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=Ho(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,I.jsx)(ze,{className:`size-4`})})}function Nc(){let e=zo();return e?.spot?(0,I.jsx)(`div`,{"aria-hidden":!0,className:D(`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 Pc({place:e,free:t,width:n,column:r,frame:i,children:a}){let o=zo(),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,I.jsx)(`div`,{ref:i,className:D(`pointer-events-none absolute flex flex-col`,o?`opacity-90`:`transition-[left,bottom] duration-300 ease-out`),style:s,children:a})}function Fc({thread:e,max:t,folded:n,onFold:r,onOpen:i}){let a=No(),o=(0,P.useRef)(null),s=e=>Math.round(Math.min(Math.max(e,lc.min),t)),l=a.height??e.current?.offsetHeight??lc.min;return(0,I.jsx)(`div`,{role:`separator`,tabIndex:0,"aria-orientation":`horizontal`,"aria-valuenow":l,"aria-valuemin":lc.min,"aria-valuemax":t,"aria-label":c(n?`assistant.open`:`assistant.flap`),title:c(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,Mo({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}Mo({height:s(l+(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,I.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 Ic({column:e}){let t=zs(),n=!!bs(),r=(0,P.useRef)(null),i=(0,P.useRef)(null),a=(0,P.useRef)(null),o=(0,P.useRef)(null),s=(0,P.useRef)(null),l=Rc(t),u=No(),d=Ac(e),f=t&&l&&l.where!==`sidebar`,p=Bo(d.width),m=l?.phone||u.place===`right`&&!Ho(d.width)||u.place===`free`&&!u.free?`center`:u.place,h=m!==`free`,g=l?.where===`avatar`,_=!!t?.open,[v,b]=(0,P.useState)(!1),ee=v||_||t?.chat.phase!==`idle`||(t?.live.state??`off`)!==`off`,x=g?!_:h;if((0,P.useLayoutEffect)(()=>{let t=i.current,n=e.current;if(!(t&&n&&f&&x)){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,f,x,g,_]),(0,P.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&&l&&f))return null;if(g&&!_)return(0,I.jsx)(kc,{composer:r,className:D(`pointer-events-none absolute inset-0`,n?`z-[61]`:`z-30`),children:(0,I.jsx)(`div`,{ref:i,className:`pointer-events-auto absolute right-3 bottom-3 sm:right-4 sm:bottom-4`,children:(0,I.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,I.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,I.jsxs)(`span`,{className:`relative`,children:[(0,I.jsx)(qi,{kind:`round`,size:36,goggles:!0,interactive:!1}),t.chat.phase!==`idle`||t.live.state!==`off`?(0,I.jsx)(`span`,{className:`absolute top-0 right-0 size-2.5 animate-pulse-dot rounded-full bg-ember ring-2 ring-card`}):null]}),(0,I.jsx)(`span`,{className:`max-sm:hidden`,children:c(`assistant.ask`)})]}),Go?(0,I.jsx)(y,{label:c(`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,I.jsx)(ye,{className:`size-4`})}):null]})})});let S=(0,I.jsx)(`button`,{type:`button`,"aria-label":c(`assistant.open`),title:`${c(`assistant.open`)} · ${c(`assistant.move`)}`,tabIndex:-1,onPointerDown:n=>Uo(n,{column:()=>e.current,frame:()=>o.current,sidebar:l.wide,onClick:()=>t.setOpen(!0),onDrop:jc(t)}),onClick:e=>{e.detail===0&&t.setOpen(!0)},className:D(`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`,ee?`translate-y-0 scale-100 opacity-100`:`pointer-events-none translate-y-3 scale-75 opacity-0`),children:(0,I.jsx)(qi,{kind:`round`,size:44,goggles:!0,interactive:ee})}),te=Math.max(lc.min,Math.min(lc.max,d.height-220)),C=u.height===null?null:Math.min(u.height,te),ne=l.phone?void 0:(0,I.jsx)(Mc,{state:t,column:e,frame:()=>o.current,wide:l.wide,from:`bottom`});return(0,I.jsxs)(kc,{composer:r,className:D(`pointer-events-none absolute inset-0`,n?`z-[61]`:`z-30`),children:[h&&!g?(0,I.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,I.jsx)(Nc,{}),(0,I.jsxs)(Pc,{place:m,free:u.free,width:p,column:d,frame:o,children:[S,(0,I.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,I.jsx)(Fc,{thread:s,max:te,folded:!_,onFold:()=>t.setOpen(!1),onOpen:()=>t.setOpen(!0)}),_?(0,I.jsx)(`div`,{className:`relative flex min-h-0 flex-col`,children:(0,I.jsxs)(`div`,{className:`flex min-h-0 animate-rise flex-col border-border-soft border-b`,style:{maxHeight:te+60},children:[(0,I.jsx)(wc,{state:t,where:g?`avatar`:`bottom`,wide:l.wide,phone:l.phone,compact:l.compact,grip:ne}),(0,I.jsx)(`div`,{ref:s,className:`flex min-h-0 flex-col`,style:C===null?{maxHeight:te}:{height:C},children:(0,I.jsx)(xc,{state:t,composer:r})})]})}):t.chat.messages.length||t.chat.error?(0,I.jsx)(Lc,{state:t}):null,(0,I.jsx)(`div`,{ref:i,onFocusCapture:()=>b(!0),onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||b(!1)},className:`relative w-full`,children:(0,I.jsx)(Oc,{state:t,composer:r,floating:!0,bare:!0})})]}),h?(0,I.jsx)(`div`,{ref:a,className:`h-[max(0.75rem,env(safe-area-inset-bottom))] shrink-0`}):null]})]})}function Lc({state:e}){let t=e.chat.messages.at(-1);return(0,I.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,I.jsx)(bo,{chat:e.chat,className:`flex-1`}):(0,I.jsx)(`span`,{className:D(`min-w-0 flex-1 truncate`,e.chat.error&&`text-rose`),children:e.chat.error??co(t?.content??``)})})}function Rc(e){let t=dc(e??zc);return e?t:null}var zc={layout:`bottom`,open:!1,chat:{messages:[]}};function Bc({column:e}){let t=zs(),n=!!bs(),r=(0,P.useRef)(null),i=Rc(t);return t&&i&&i.where===`sidebar`?(0,I.jsxs)(kc,{composer:r,className:D(`flex w-[400px] shrink-0 flex-col border-border-soft border-l bg-card`,n&&`relative z-[61]`),children:[(0,I.jsx)(wc,{state:t,where:`sidebar`,wide:i.wide,phone:i.phone,grip:(0,I.jsx)(Mc,{state:t,column:e,frame:()=>null,wide:i.wide,from:`sidebar`})}),(0,I.jsx)(xc,{state:t,composer:r}),(0,I.jsx)(Oc,{state:t,composer:r})]}):null}function Vc(){let e=bs(),t=zs(),[n,r]=(0,P.useState)(null);if((0,P.useEffect)(()=>{if(!e){r(null);return}let t=0,n=()=>{if(!e.el.isConnected){ys(null);return}r(e.el.getBoundingClientRect()),t=requestAnimationFrame(n)};n();let i=e=>{e.key===`Escape`&&ys(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),l=e=>{ys(null),t?.chat.send(e)};return(0,xa.createPortal)((0,I.jsxs)(`div`,{"data-assistant-ui":!0,className:`pointer-events-none fixed inset-0 z-[60]`,children:[e.mode===`spotlight`?(0,I.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:()=>ys(null),onKeyDown:void 0,role:`presentation`}):null,(0,I.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,I.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,I.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,I.jsx)(qi,{kind:`round`,size:28,goggles:!0,interactive:!1}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[e.title?(0,I.jsx)(`div`,{className:`font-medium text-[0.875rem]`,children:e.title}):null,e.text?(0,I.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-2 leading-relaxed`,children:e.text}):null]})]}),(0,I.jsxs)(`div`,{className:`mt-3 flex flex-wrap justify-end gap-1.5`,children:[e.buttons.map(e=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>l(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,I.jsx)(`button`,{type:`button`,onClick:()=>ys(null),className:`rounded-full bg-primary px-3 py-1.5 font-medium text-[0.8125rem] text-primary-foreground`,children:c(`assistant.gotIt`)})]})]}):null]}),document.body)}var Hc=[`update`],Uc=36e5;function Wc(e=!0){let t=At(),[n,r]=(0,P.useState)(null),i=Ft({queryKey:Hc,queryFn:()=>N.get(`/api/studio/update`),staleTime:Uc,refetchInterval:Uc,retry:!1,enabled:e}),a=F({mutationFn:()=>N.get(`/api/studio/update?fresh=1`),onSuccess:e=>t.setQueryData(Hc,e)}),o=F({mutationFn:()=>N.post(`/api/studio/update`),onSuccess:e=>t.setQueryData(Hc,e)}),s=i.data,l=s?.latest??null,u=s?.restarts&&(s.applying===`running`||s.applying===`done`),d=s?.current;return(0,P.useEffect)(()=>{if(!(u||s?.applying===`running`)||!l)return;let e=setInterval(async()=>{try{let e=await N.get(`/api/studio/update`);if(e.current!==d){window.location.reload();return}t.setQueryData(Hc,e),e.applying===`done`&&e.restarts&&r(l)}catch{r(l)}},2e3);return()=>clearInterval(e)},[u,s?.applying,l,d,t]),{status:i,data:s,latest:l,check:a,apply:o,busy:s?.applying===`running`||n!==null,progress:!s||!l?null:n===null?s.applying===`running`?c(`about.update.installing`,{v:l}):s.applying===`done`?c(`about.update.done`,{v:l}):s.applying===`failed`?c(`about.update.failed`):null:c(`about.update.restarting`,{v:l})}}var Gc=(0,P.lazy)(()=>It(()=>import(`./AboutDialog-DYgXPagX.js`).then(e=>({default:e.AboutDialog})),__vite__mapDeps([4,1,2,5,6,7,8]))),Kc=`0.7.6`;function qc({me:e}){let[t,n]=(0,P.useState)(!1);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{type:`button`,className:`tabular-nums transition hover:text-ink-2`,onClick:()=>n(!0),children:c(`about.version`,{v:Kc})}),t?(0,I.jsx)(P.Suspense,{fallback:null,children:(0,I.jsx)(Gc,{open:!0,me:e,onClose:()=>n(!1)})}):null]})}function Jc({enabled:e=!0,align:t=`center`}){let{status:n,data:r,latest:i,check:a,apply:o,busy:s,progress:l}=Wc(e),d=r?.checkedAt?new Date(r.checkedAt).toLocaleTimeString(E,{hour:`2-digit`,minute:`2-digit`}):null,f=t===`center`;return(0,I.jsxs)(`div`,{className:D(`flex flex-col gap-3 text-[0.875rem] text-ink-2`,f?`items-center text-center`:`items-start`),children:[n.isPending||a.isPending?(0,I.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,I.jsx)(M,{className:`size-4 text-ember-strong`}),c(`about.update.checking`)]}):l?(0,I.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[s?(0,I.jsx)(M,{className:`size-4 text-ember-strong`}):null,l]}):r?.newer&&i?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2.5 font-medium text-ink`,children:[(0,I.jsx)(_t,{className:`size-4 shrink-0 text-ember-strong`}),c(`about.update.available`,{v:i})]}),r.canApply?null:(0,I.jsx)(`p`,{className:`text-ink-3`,children:c(`about.update.manual`)})]}):r?.enabled?r.latest===null?(0,I.jsx)(`p`,{children:c(`about.update.unknown`)}):(0,I.jsxs)(`p`,{children:[c(`about.update.upToDate`),d?(0,I.jsxs)(`span`,{className:`text-ink-4`,children:[` `,`· `,c(`about.update.checkedAt`,{when:d})]}):null]}):(0,I.jsx)(`p`,{children:c(`about.update.off`)}),s||n.isPending?null:(0,I.jsxs)(`div`,{className:D(`flex flex-wrap gap-2`,f&&`justify-center`),children:[r?.newer&&r.canApply&&r.applying!==`running`?(0,I.jsxs)(u,{size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(),children:[(0,I.jsx)(_t,{className:`size-4`}),` `,c(`about.update.install`)]}):null,r?.enabled===!1?null:(0,I.jsxs)(u,{size:`sm`,variant:`secondary`,disabled:a.isPending,onClick:()=>a.mutate(),children:[(0,I.jsx)(De,{className:D(`size-4`,a.isPending&&`animate-spin`)}),` `,c(`about.update.check`)]})]})]})}function Yc({me:e}){let t=e.mode===`local`,{status:n,data:r,latest:i,check:a,apply:o,busy:s,progress:l}=Wc(t),d=n.isPending||a.isPending;return(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-2 text-[0.8125rem] text-ink-3`,children:[(0,I.jsx)(qc,{me:e}),(0,I.jsx)(`span`,{"aria-hidden":!0,children:`·`}),t?d?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,I.jsx)(M,{className:`size-3.5 text-ember-strong`}),` `,c(`about.update.checking`)]}):l?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[s?(0,I.jsx)(M,{className:`size-3.5 text-ember-strong`}):null,l]}):r?.newer&&i?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-ink`,children:[(0,I.jsx)(_t,{className:`size-3.5 shrink-0 text-ember-strong`}),c(`about.update.available`,{v:i})]}):r?.enabled?r.latest===null?(0,I.jsx)(`span`,{children:c(`about.update.unknown`)}):(0,I.jsx)(`span`,{children:c(`about.update.upToDate`)}):(0,I.jsx)(`span`,{children:c(`about.update.off`)}):(0,I.jsx)(`span`,{children:c(`about.kind.cloud`)}),!t||d||s?null:r?.newer&&r.canApply?(0,I.jsxs)(u,{size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(),children:[(0,I.jsx)(_t,{className:`size-4`}),` `,c(`about.update.install`)]}):r?.enabled?(0,I.jsx)(y,{label:c(`about.update.check`),className:`size-7 coarse:size-9`,onClick:()=>a.mutate(),children:(0,I.jsx)(De,{className:`size-3.5`})}):null]})}var Xc=`cubic-bezier(0.3, 0.7, 0.2, 1)`,Zc=`(max-width: 639px)`;function Qc({tone:e=`ground`,ink:t}){let n=Ue(),r=na(),i=Me();return i?(0,I.jsx)($c,{langs:[`en`,i],value:n,onPick:e=>{g(e)&&r(e)},tone:e,ink:t}):null}function $c({langs:e,value:t,onPick:n,tone:r=`ground`,ink:i,label:a}){let o=wt(Zc),s=(0,P.useRef)({}),[l,u]=(0,P.useState)(null),d=e=>a?a(e):rt(e),f=e.join(`|`);(0,P.useLayoutEffect)(()=>{let e=()=>{let e={};for(let[t,n]of Object.entries(s.current))e[t]=n?Math.ceil(n.getBoundingClientRect().width):0;u(e)};e(),document.fonts?.ready.then(e)},[f]);let p=e=>l?(l[e===t&&!o?`${e}-full`:`${e}-short`]??0)+24:void 0,m=l?e.slice(0,e.indexOf(t)).reduce((e,t)=>e+(p(t)??0),0):0,h=`300ms ${Xc}`,g=r===`ground`;return(0,I.jsxs)(`fieldset`,{className:D(`relative inline-flex items-center rounded-full border-0 p-0.5 ring-1`,g?`bg-white/10 ring-white/15`:`bg-paper-2 ring-border-soft`),children:[(0,I.jsx)(`legend`,{className:`sr-only`,children:c(`nav.language`)}),l?(0,I.jsx)(`span`,{"aria-hidden":`true`,className:D(`absolute top-0.5 bottom-0.5 left-0.5 rounded-full shadow-sm motion-reduce:transition-none`,g?`bg-white`:`bg-card`),style:{width:p(t),transform:`translateX(${m}px)`,transition:`transform ${h}, width ${h}`}}):null,e.map(e=>{let r=e===t;return(0,I.jsxs)(`button`,{"aria-pressed":r,className:D(`relative h-7 cursor-pointer overflow-hidden whitespace-nowrap rounded-full font-medium text-[0.75rem] motion-reduce:transition-none`,g?r?`text-[oklch(32%_0.15_262)]`:`text-white/70`:r?`text-ink`:`text-ink-3`),lang:e,onClick:()=>{r||n(e)},style:{width:p(e),transition:`width ${h}, color ${h}`,...g&&r&&i?{color:i}:{}},title:d(e),type:`button`,children:[[d(e),e.toUpperCase()].map((e,t)=>{let n=r&&!o?t===0:t===1;return(0,I.jsx)(`span`,{"aria-hidden":!n,className:`absolute inset-0 grid place-items-center motion-reduce:transition-none`,style:{opacity:+!!n,transition:`opacity 220ms ${Xc}`},children:e},`${t}:${e}`)}),(0,I.jsx)(`span`,{ref:t=>{s.current[`${e}-full`]=t},"aria-hidden":`true`,className:`invisible absolute`,children:d(e)}),(0,I.jsx)(`span`,{ref:t=>{s.current[`${e}-short`]=t},"aria-hidden":`true`,className:`invisible absolute`,children:e.toUpperCase()}),(0,I.jsx)(`span`,{className:`invisible px-3`,children:r?d(e):e.toUpperCase()})]},e)})]})}function el(){let e=Ue(),t=na();return(0,I.jsx)(p,{className:`w-44`,value:e,onChange:e=>{g(e)&&t(e)},options:Be.map(e=>({value:e,label:Ke[e]}))})}var tl=[`text`,`image`,`video`,`speech`,`listening`],nl={text:[`classifier`,`standard`,`high`,`highest`],image:[`image`],video:[`video`],speech:[`speech`],listening:[`audio`]},rl=`credits`,il=`${rl}:`;function al(e){return e===`credits`||!!e?.startsWith(il)}function ol(e){return e?.startsWith(il)&&e.slice(il.length)||null}function sl(e){return e?`${il}${e}`:rl}function cl(e){return e===`transcription`?`listening`:e}var ll=[`openai`,`anthropic`,`google`,`fal`,`elevenlabs`,`replicate`,`gateway`],ul={en:{"about.openai":`GPT models, GPT Image and voices.`,fast:`fast`,thorough:`thorough`,versatile:`versatile`,lowCost:`low cost`,fastLowCost:`fast, low cost`,"about.anthropic":`The Claude models.`,strongest:`strongest`,"about.google":`Gemini, Veo for video and voices – one key from AI Studio.`,fastEditsPhotos:`fast, edits photos`,bestQuality:`best quality`,withSound:`with sound`,"about.fal":`Hundreds of image, video and audio models with one key: FLUX, Recraft, Veo, Luma, MiniMax.`,highQuality:`high quality`,graphicsLogosTextIn:`graphics, logos, text in images`,photorealistic:`photorealistic`,"about.elevenlabs":`Natural voices in many languages and accurate transcripts.`,naturalManyLanguages:`natural, many languages`,expressive:`expressive`,veryAccurate:`very accurate`,"about.replicate":`Open image and video models, billed per run.`,"about.gateway":`One key for many providers’ models, billed by Vercel.`},de:{"about.openai":`GPT-Modelle, GPT Image und Stimmen.`,fast:`schnell`,thorough:`gründlich`,versatile:`vielseitig`,lowCost:`günstig`,fastLowCost:`schnell, günstig`,"about.anthropic":`Die Claude-Modelle.`,strongest:`am stärksten`,"about.google":`Gemini, Veo für Videos und Stimmen – ein Key aus dem AI Studio.`,fastEditsPhotos:`schnell, bearbeitet Fotos`,bestQuality:`beste Qualität`,withSound:`mit Ton`,"about.fal":`Hunderte Bild-, Video- und Audio-Modelle mit einem Key: FLUX, Recraft, Veo, Luma, MiniMax.`,highQuality:`hohe Qualität`,graphicsLogosTextIn:`Grafiken, Logos, Text im Bild`,photorealistic:`fotorealistisch`,"about.elevenlabs":`Natürliche Stimmen in vielen Sprachen und genaue Transkripte.`,naturalManyLanguages:`natürlich, viele Sprachen`,expressive:`ausdrucksstark`,veryAccurate:`sehr genau`,"about.replicate":`Offene Bild- und Video-Modelle, abgerechnet pro Lauf.`,"about.gateway":`Ein Key für die Modelle vieler Anbieter, abgerechnet bei Vercel.`}},dl=(e,t)=>$e(ul,e,t),fl=[{id:`openai`,name:`OpenAI`,about:`about.openai`,keyUrl:`https://platform.openai.com/api-keys`,keyPlaceholder:`sk-…`,text:{classifier:`openai:gpt-5.4-mini`,standard:`openai:gpt-5.4-mini`,high:`openai:gpt-5.5`,highest:`openai:gpt-5.5`},models:{text:[{ref:`openai:gpt-5.4-mini`,label:`GPT-5.4 mini`,note:`fast`},{ref:`openai:gpt-5.5`,label:`GPT-5.5`,note:`thorough`}],image:[{ref:`openai:gpt-image-2`,label:`GPT Image 2`,note:`versatile`},{ref:`openai:gpt-image-1-mini`,label:`GPT Image 1 mini`,note:`lowCost`}],speech:[{ref:`openai:gpt-4o-mini-tts`,label:`GPT-4o mini TTS`,note:`lowCost`}],listening:[{ref:`openai:gpt-4o-mini-transcribe`,label:`GPT-4o mini Transcribe`,note:`fastLowCost`},{ref:`openai:whisper-1`,label:`Whisper`}]}},{id:`anthropic`,name:`Anthropic`,about:`about.anthropic`,keyUrl:`https://console.anthropic.com/settings/keys`,keyPlaceholder:`sk-ant-…`,text:{classifier:`anthropic:claude-haiku-4-5`,standard:`anthropic:claude-haiku-4-5`,high:`anthropic:claude-sonnet-5-5`,highest:`anthropic:claude-opus-5-5`},models:{text:[{ref:`anthropic:claude-haiku-4-5`,label:`Claude Haiku 4.5`,note:`fast`},{ref:`anthropic:claude-sonnet-5-5`,label:`Claude Sonnet 5.5`},{ref:`anthropic:claude-opus-5-5`,label:`Claude Opus 5.5`,note:`strongest`}]}},{id:`google`,name:`Google Gemini`,about:`about.google`,keyUrl:`https://aistudio.google.com/apikey`,keyPlaceholder:`AIza…`,text:{classifier:`google:gemini-flash-lite-latest`,standard:`google:gemini-flash-latest`,high:`google:gemini-pro-latest`,highest:`google:gemini-pro-latest`},models:{text:[{ref:`google:gemini-flash-lite-latest`,label:`Gemini Flash-Lite`,note:`lowCost`},{ref:`google:gemini-flash-latest`,label:`Gemini Flash`},{ref:`google:gemini-pro-latest`,label:`Gemini Pro`,note:`thorough`}],image:[{ref:`google:gemini-3.1-flash-image-preview`,label:`Gemini 3.1 Flash Image`,note:`fastEditsPhotos`},{ref:`google:gemini-3-pro-image-preview`,label:`Gemini 3 Pro Image`,note:`bestQuality`}],video:[{ref:`google:veo-3.1-fast-generate-preview`,label:`Veo 3.1 Fast`,note:`withSound`},{ref:`google:veo-3.1-generate-preview`,label:`Veo 3.1`,note:`bestQuality`}],speech:[{ref:`google:gemini-3.8-flash-tts`,label:`Gemini Flash TTS`}],listening:[{ref:`google:gemini-flash-lite-latest`,label:`Gemini Flash-Lite`}]}},{id:`fal`,name:`fal.ai`,about:`about.fal`,keyUrl:`https://fal.ai/dashboard/keys`,keyPlaceholder:`xxxxxxxx-…:…`,models:{image:[{ref:`fal:fal-ai/flux/schnell`,label:`FLUX.1 schnell`,note:`fastLowCost`},{ref:`fal:fal-ai/flux-pro/v1.1`,label:`FLUX 1.1 pro`,note:`highQuality`},{ref:`fal:fal-ai/recraft/v3/text-to-image`,label:`Recraft V3`,note:`graphicsLogosTextIn`},{ref:`fal:fal-ai/imagen4/preview`,label:`Imagen 4`,note:`photorealistic`}],video:[{ref:`fal:veo3/fast`,label:`Veo 3 Fast`,note:`withSound`},{ref:`fal:luma-ray-2-flash`,label:`Luma Ray 2 Flash`,note:`fast`},{ref:`fal:minimax-video`,label:`MiniMax Hailuo`}],speech:[{ref:`fal:fal-ai/minimax/speech-02-turbo`,label:`MiniMax Speech-02 Turbo`,note:`fast`},{ref:`fal:fal-ai/minimax/speech-02-hd`,label:`MiniMax Speech-02 HD`}],listening:[{ref:`fal:wizper`,label:`Wizper`,note:`fast`},{ref:`fal:whisper`,label:`Whisper`}]}},{id:`elevenlabs`,name:`ElevenLabs`,about:`about.elevenlabs`,keyUrl:`https://elevenlabs.io/app/settings/api-keys`,keyPlaceholder:`sk_…`,models:{speech:[{ref:`elevenlabs:eleven_multilingual_v2`,label:`Multilingual v2`,note:`naturalManyLanguages`},{ref:`elevenlabs:eleven_flash_v2_5`,label:`Flash v2.5`,note:`fastLowCost`},{ref:`elevenlabs:eleven_v3`,label:`Eleven v3`,note:`expressive`}],listening:[{ref:`elevenlabs:scribe_v2`,label:`Scribe v2`,note:`veryAccurate`}]}},{id:`replicate`,name:`Replicate`,about:`about.replicate`,keyUrl:`https://replicate.com/account/api-tokens`,keyPlaceholder:`r8_…`,models:{image:[{ref:`replicate:black-forest-labs/flux-schnell`,label:`FLUX.1 schnell`,note:`fastLowCost`},{ref:`replicate:black-forest-labs/flux-1.1-pro`,label:`FLUX 1.1 pro`},{ref:`replicate:recraft-ai/recraft-v3`,label:`Recraft V3`}],video:[{ref:`replicate:minimax/video-01`,label:`MiniMax Video-01`}]}},{id:`gateway`,name:`Vercel AI Gateway`,about:`about.gateway`,keyUrl:`https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai-gateway%2Fapi-keys`,keyPlaceholder:`vck_…`,text:{classifier:`anthropic/claude-haiku-4.5`,standard:`anthropic/claude-haiku-4.5`,high:`anthropic/claude-sonnet-5.5`,highest:`anthropic/claude-sonnet-5.5`},models:{text:[{ref:`anthropic/claude-haiku-4.5`,label:`Claude Haiku 4.5`,note:`fast`},{ref:`anthropic/claude-sonnet-5.5`,label:`Claude Sonnet 5.5`},{ref:`openai/gpt-5.5`,label:`GPT-5.5`},{ref:`google/gemini-3.5-flash`,label:`Gemini 3.5 Flash`}],image:[{ref:`google/gemini-3.1-flash-image`,label:`Gemini 3.1 Flash Image`}],video:[{ref:`google/veo-3.1-fast-generate-001`,label:`Veo 3.1 Fast`,note:`withSound`}],speech:[{ref:`google/gemini-3.8-flash-tts`,label:`Gemini Flash TTS`}],listening:[{ref:`google/gemini-3.5-flash-lite`,label:`Gemini 3.5 Flash-Lite`}]}}];function pl(e){return fl.find(t=>t.id===e)??null}function ml(e){if(al(e))return null;let t=/^([a-z]+):/.exec(e)?.[1];return t?ll.includes(t)?t:null:e?.includes(`/`)?`gateway`:null}function hl(e){for(let t of fl)for(let n of Object.values(t.models)){let t=n?.find(t=>t.ref===e);if(t)return t.label}return e.replace(/^[a-z]+:/,``)}function gl(e){let t=window.engentyDesktop;t?t.open(e):window.open(e,`_blank`,`noopener`)}var _l=fl.filter(e=>e.text);function vl({models:e}){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(ce,{children:c(`local.keys`)}),(0,I.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:c(`local.keysHint`)})]}),(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[_l.map(t=>(0,I.jsx)(yl,{provider:t,stored:!!e.keys[t.id]},t.id)),(0,I.jsx)(bl,{url:e.ollamaUrl})]}),(0,I.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:c(`local.modelsLater`)})]})}function U(e){let t=At();return F({mutationFn:t=>N.post(e,t),onSuccess:()=>t.invalidateQueries({queryKey:[`me`]})})}function yl({provider:e,stored:t}){let n=At(),[r,i]=(0,P.useState)(``),a=U(`/api/studio/local/keys/${e.id}`),o=()=>a.mutate(r.trim()?{key:r.trim()}:{},{onSuccess:e=>e.ok?i(``):void 0}),s=F({mutationFn:()=>N.put(`/api/studio/local/models`,{keys:{[e.id]:``}}),onSuccess:async()=>{a.reset(),await n.invalidateQueries({queryKey:[`me`]})}});return(0,I.jsx)(Sl,{label:e.name,sub:(0,I.jsxs)(`button`,{type:`button`,onClick:()=>gl(e.keyUrl),className:`inline-flex items-center gap-1 text-left hover:text-ink-2 hover:underline`,children:[c(`local.keyGet`),` `,(0,I.jsx)(Ve,{className:`size-3`})]}),input:(0,I.jsx)(ne,{type:`password`,autoComplete:`off`,className:`min-w-0 flex-1 font-mono text-[0.8125rem]`,placeholder:t?c(`local.keySet`):e.keyPlaceholder,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&r.trim()&&o()}}),actions:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u,{variant:`secondary`,busy:a.isPending,disabled:!t&&!r.trim(),onClick:o,children:c(`local.test`)}),t?(0,I.jsx)(u,{variant:`ghost`,size:`sm`,busy:s.isPending,onClick:()=>s.mutate(),children:c(`local.keyRemove`)}):null]}),said:xl(a,t=>ml(t)===e.id)})}function bl({url:e}){let[t,n]=(0,P.useState)(e),r=U(`/api/studio/local/ollama`);return(0,I.jsx)(Sl,{label:`Ollama`,sub:c(`local.ollamaWhere`),input:(0,I.jsx)(ne,{className:`min-w-0 flex-1 font-mono text-[0.8125rem]`,value:t,onChange:e=>n(e.target.value)}),actions:(0,I.jsx)(u,{variant:`secondary`,busy:r.isPending,disabled:!t.trim(),onClick:()=>r.mutate({url:t.trim()}),children:c(`local.test`)}),said:xl(r,e=>e.startsWith(`ollama:`))})}function xl(e,t){if(e.isError)return{ok:!1,text:e.error.message};let n=e.data;if(!n)return null;if(!n.ok)return{ok:!1,text:n.message??c(`models.keyBad`)};if(!n.text)return{ok:!0,text:c(`local.keyWorksPlain`)};let r=hl(n.text);return{ok:!0,text:c(t(n.text)?`local.keyWorks`:`local.keyWorksOther`,{model:r})}}function Sl({label:e,sub:t,input:n,actions:r,said:i}){return(0,I.jsxs)(`div`,{className:`grid gap-x-3 gap-y-1.5 border-border-soft border-t py-3 sm:grid-cols-[10rem_minmax(0,1fr)]`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[0.875rem] text-ink-2`,children:e}),(0,I.jsx)(`div`,{className:`text-[0.75rem] text-ink-4`,children:t})]}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[n,r]}),i?(0,I.jsxs)(`p`,{className:D(`flex items-start gap-1.5 text-[0.8125rem]`,i.ok?`text-moss`:`text-rose`),children:[i.ok?(0,I.jsx)(Ie,{className:`mt-0.5 size-3.5 shrink-0`,strokeWidth:3}):null,i.text]}):null]})]})}var Cl=[{theme:`light`,icon:ci,label:`theme.light`},{theme:`dark`,icon:Er,label:`theme.dark`}],wl=`cubic-bezier(0.3, 0.7, 0.2, 1)`;function Tl({tone:e=`surface`}){let t=Vi(),n=Bi(),r=e===`ground`,i=r?n:t,a=Cl.findIndex(e=>e.theme===i);return(0,I.jsxs)(`fieldset`,{className:D(`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,I.jsx)(`legend`,{className:`sr-only`,children:c(`nav.theme`)}),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:D(`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 ${wl}`}}),Cl.map(({theme:e,icon:t,label:n})=>(0,I.jsx)(`button`,{"aria-label":c(n),"aria-pressed":e===i,className:D(`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:()=>Ri(e),title:c(n),type:`button`,children:(0,I.jsx)(t,{className:`size-3.5`})},e))]})}function El(e){try{return new URL(e).host}catch{return e}}var Dl=e=>`${Ne()}/w/${e.shareToken}`;function Ol(e,t,n){if(!e.published)return{kind:`draft`};if(t.mode===`managed`)return{kind:`live`,url:Dl(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:c(`cloud.notSent`)}:!r.runnable||!o||a===null?{kind:`missing`,url:o,runs:a,why:`${c(`cloud.notRunnable`,{v:r.version})} ${a===null?c(`cloud.nothingRuns`):c(`cloud.keepsRunning`,{v:a})}`}:{kind:`live`,url:o,runs:a,notes:r.problems.filter(e=>!e.blocking).length,cloud:!0}}function kl(e){return e.kind===`live`||e.kind===`sending`||e.kind===`missing`?e.url:null}function Al({where:e,me:t,version:n}){let r=El(t.account?.cloudUrl??``),i=`size-3.5`;switch(e.kind){case`draft`:return null;case`unknown`:return(0,I.jsx)(k,{tone:`live`,children:c(`home.live`)});case`here`:return(0,I.jsx)(k,{icon:(0,I.jsx)(ir,{className:i}),title:c(`where.hereHint`),children:n?c(`where.hereVersion`,{v:n}):c(`where.here`)});case`live`:{let t=n?c(`editor.published`,{v:e.runs}):c(`home.live`),a=e.notes===1?c(`where.note`):e.notes>1?c(`where.notes`,{n:e.notes}):null;return(0,I.jsx)(k,{tone:`live`,icon:e.cloud?(0,I.jsx)(An,{className:i}):void 0,title:e.cloud?c(`where.liveHint`,{host:r}):void 0,children:a?`${t} · ${a}`:t})}case`sending`:return(0,I.jsx)(k,{tone:`warn`,icon:(0,I.jsx)(Je,{className:i}),title:c(`cloud.again`,{when:new Intl.DateTimeFormat(E,{timeStyle:`short`}).format(new Date(e.again))}),children:c(`where.sending`)});case`missing`:return(0,I.jsx)(k,{tone:`warn`,icon:(0,I.jsx)(On,{className:i}),title:e.why,children:e.runs===null?c(`where.missing`):c(`editor.published`,{v:e.runs})})}}var jl=`mt-1.5 text-[0.8125rem] text-ink-3`;function Ml(e){let t=At(),[n,r]=(0,P.useState)(!1),i=F({mutationFn:e=>N.post(`/api/studio/account/link`,e),onSuccess:({url:e})=>{gl(e),r(!0)}});return(0,P.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,P.useEffect)(()=>{e&&r(!1)},[e]),{link:i,waiting:n}}function Nl({link:e,waiting:t}){return e.isError?(0,I.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:c(`local.accountFailed`)}):t?(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,I.jsx)(M,{className:`size-3.5`}),` `,c(`local.accountWaiting`)]}):null}function Pl({me:e}){let t=za(`account`),n=Ml(!1),{link:r}=n,[i,a]=(0,P.useState)(``);return(0,I.jsxs)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-4 py-5 first:pt-0 last:pb-0`,children:[(0,I.jsx)(`div`,{className:`flex size-11 shrink-0 items-center justify-center rounded-full bg-paper-2 text-ink-2`,children:(0,I.jsx)(Jn,{className:`size-5`})}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`font-medium text-[0.9375rem]`,children:c(`account.local`)}),(0,I.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-3 leading-relaxed`,children:c(`account.localText`)}),(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(Yc,{me:e})})]})]}),t?(0,I.jsxs)(`div`,{className:`flex flex-col gap-4 py-5 last:pb-0`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`font-medium text-[0.9375rem]`,children:c(`account.with`)}),(0,I.jsxs)(`ul`,{className:`mt-2 flex flex-col gap-2 text-[0.875rem] text-ink-2 leading-snug`,children:[(0,I.jsxs)(`li`,{className:`flex items-start gap-2.5`,children:[(0,I.jsx)(Mn,{className:`mt-0.5 size-4 shrink-0 text-amber`}),c(`account.withCredits`)]}),(0,I.jsxs)(`li`,{className:`flex items-start gap-2.5`,children:[(0,I.jsx)(An,{className:`mt-0.5 size-4 shrink-0 text-cobalt`}),c(`account.withCloud`)]})]})]}),(0,I.jsx)(`div`,{children:(0,I.jsx)(u,{busy:r.isPending&&!r.variables?.signup,onClick:()=>r.mutate({}),children:c(`account.signIn`)})})]}):null,t?(0,I.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,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`font-medium text-[0.9375rem]`,children:c(`account.new`)}),(0,I.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-3 leading-relaxed`,children:c(`account.newHint`)})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(ne,{value:i,maxLength:64,autoComplete:`off`,spellCheck:!1,placeholder:c(`account.code`),"aria-label":c(`account.code`),onChange:e=>a(e.target.value),className:`w-56 font-mono text-[0.875rem]`}),(0,I.jsx)(u,{type:`submit`,variant:`secondary`,className:`h-11`,busy:r.isPending&&!!r.variables?.signup,children:c(`account.create`)})]}),(0,I.jsx)(Nl,{...n})]}):null]})}var Fl={start:`account.kind.start`,monthly:`account.kind.monthly`,gift:`account.kind.gift`};function Il({account:e,me:t}){let n=At(),r=Ml(e.signedIn),i=F({mutationFn:()=>N.del(`/api/studio/account`),onSuccess:()=>n.invalidateQueries({queryKey:[`me`]})}),a=new Intl.DateTimeFormat(E,{dateStyle:`medium`});return(0,I.jsxs)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3 py-5 first:pt-0`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`truncate font-medium text-[0.9375rem]`,children:e.name||e.email}),e.signedIn?(0,I.jsx)(k,{tone:`live`,children:c(`account.linked`)}):null]}),(0,I.jsx)(`div`,{className:`truncate text-[0.875rem] text-ink-3`,children:e.email}),(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(Yc,{me:t})})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsxs)(u,{variant:`secondary`,onClick:()=>gl(e.url),children:[c(`setup.openAccount`),` `,(0,I.jsx)(Ve,{className:`size-4`})]}),(0,I.jsxs)(u,{variant:`ghost`,busy:i.isPending,onClick:()=>i.mutate(),children:[(0,I.jsx)(fr,{className:`size-4`}),` `,c(`nav.logout`)]})]})]}),e.signedIn?null:(0,I.jsxs)(`div`,{className:`flex flex-col gap-3 py-5`,children:[(0,I.jsx)(`p`,{className:`text-[0.875rem] text-ink-2`,children:c(`local.accountExpired`)}),(0,I.jsx)(`div`,{children:(0,I.jsx)(u,{busy:r.link.isPending,onClick:()=>r.link.mutate({}),children:c(`account.signInAgain`)})}),(0,I.jsx)(Nl,{...r})]}),e.credits===null?null:(0,I.jsxs)(`div`,{className:`py-5`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:c(`account.credits`)}),(0,I.jsx)(`div`,{className:`font-display font-semibold text-[1.375rem] tabular-nums leading-tight`,children:c(`nav.credits`,{n:Math.floor(e.credits).toLocaleString(E)})})]}),(0,I.jsxs)(u,{variant:`secondary`,onClick:()=>gl(`${e.url}/billing`),children:[c(`account.topUp`),` `,(0,I.jsx)(Ve,{className:`size-4`})]})]}),e.expiring.length?(0,I.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1 text-[0.8125rem] text-ink-3 tabular-nums`,children:e.expiring.map(e=>(0,I.jsxs)(`li`,{children:[c(`account.expires`,{n:Math.floor(e.credits).toLocaleString(E),date:a.format(new Date(e.expiresAt))}),Fl[e.kind]?(0,I.jsxs)(`span`,{className:`text-ink-4`,children:[` · `,c(Fl[e.kind])]}):null]},`${e.kind}:${e.expiresAt}`))}):null]}),(0,I.jsxs)(`div`,{className:`flex items-start gap-2.5 py-5 text-[0.875rem] text-ink-2 leading-snug last:pb-0`,children:[(0,I.jsx)(An,{className:`mt-0.5 size-4 shrink-0 text-cobalt`}),(0,I.jsx)(`p`,{children:c(`account.cloud`,{host:El(e.cloudUrl)})})]})]})}function Ll({me:e,fromAccount:t}){let n=At(),[r,i]=(0,P.useState)(e.profile),a=e=>i(t=>({...t,...e})),o=d(r,async e=>{await N.put(`/api/studio/profile`,e),await n.invalidateQueries({queryKey:[`me`]})});return(0,I.jsx)(Mt,{title:c(`account.profile`),hint:c(`account.hint`),save:o,children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-6 sm:flex-row sm:gap-8`,children:[(0,I.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center gap-2 sm:w-32`,children:[(0,I.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,I.jsx)(`img`,{src:e.user.image,alt:``,className:`size-full object-cover`}):Xi(r.name)||`?`}),(0,I.jsx)(`p`,{className:`text-center text-[0.75rem] text-ink-3 leading-snug`,children:c(`account.initials`)})]}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-5`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(ce,{children:c(`account.name`)}),(0,I.jsx)(ne,{value:r.name,maxLength:80,disabled:t,onChange:e=>a({name:e.target.value})}),(0,I.jsx)(`p`,{className:jl,children:c(t?`account.fromAccount`:`account.nameHint`)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(ce,{children:c(`account.about`)}),(0,I.jsx)(x,{minRows:3,maxLength:2e3,value:r.about,onChange:e=>a({about:e.target.value})}),(0,I.jsx)(`p`,{className:jl,children:c(`account.aboutHint`)})]}),(0,I.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(ce,{children:c(`account.email`)}),(0,I.jsx)(ne,{type:`email`,value:r.email,maxLength:200,disabled:t,onChange:e=>a({email:e.target.value})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(ce,{children:c(`account.phone`)}),(0,I.jsx)(ne,{type:`tel`,value:r.phone,maxLength:40,onChange:e=>a({phone:e.target.value})})]})]})]})]})})}function Rl({me:e}){let t=e.mode===`managed`,n=t||!!e.account;return(0,I.jsxs)(`div`,{className:`flex flex-col gap-9`,children:[(0,I.jsx)(Mt,{title:c(`account.connection`),hint:c(`account.connectionHint`),children:t?(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`truncate font-medium text-[0.9375rem]`,children:e.user.name}),(0,I.jsx)(k,{tone:`live`,children:c(`account.linked`)})]}),(0,I.jsx)(`div`,{className:`truncate text-[0.875rem] text-ink-3`,children:e.user.email}),(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(Yc,{me:e})})]}),e.manageUrl?(0,I.jsxs)(u,{variant:`secondary`,onClick:()=>gl(`${e.manageUrl}/account`),children:[c(`setup.openAccount`),` `,(0,I.jsx)(Ve,{className:`size-4`})]}):null]}):e.account?(0,I.jsx)(Il,{account:e.account,me:e}):(0,I.jsx)(Pl,{me:e})}),(0,I.jsx)(Ll,{me:e,fromAccount:n},n?`account`:`own`),(0,I.jsx)(Mt,{title:c(`account.look`),hint:c(`account.lookHint`),children:(0,I.jsxs)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-4 pb-4`,children:[(0,I.jsx)(`span`,{className:`font-medium text-[0.875rem]`,children:c(`nav.language`)}),(0,I.jsx)(el,{})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-4 pt-4`,children:[(0,I.jsx)(`span`,{className:`font-medium text-[0.875rem]`,children:c(`nav.theme`)}),(0,I.jsx)(Tl,{})]})]})})]})}var zl={steps:Xr,chat:vr,talk:et,whatsapp:gr,sms:br,call:Rr,video:S},Bl=e=>zl[e]??Wr,Vl=[`steps`,`chat`];function Hl(){return Ft({queryKey:[`runners`],queryFn:()=>N.get(`/api/studio/runners`),staleTime:6e4})}function Ul(e,t){let n=new Set(t.map(e=>e.id)),r=(e.runners?.enabled??Vl).filter(e=>n.has(e)),i=e.runners?.default??`steps`;return[...r].sort((e,t)=>e===i?-1:+(t===i))}function Wl({w:e,runners:t}){let n=Ul(e,t),r=e.runners?.default??`steps`;return(0,I.jsx)(`span`,{className:`inline-flex items-center gap-1.5`,children:n.map(e=>{let n=Bl(e),i=t.find(t=>t.id===e)?.label[E]??e;return(0,I.jsx)(n,{"aria-label":i,className:D(`size-3.5`,e===r?`text-ink-2`:`text-ink-4`),children:(0,I.jsx)(`title`,{children:i})},e)})})}var Gl=[`text`,`document`,`table`,`image`,`video`,`audio`,`dashboard`],Kl=[`any`,`trades`,`gastronomy`,`hospitality`,`realEstate`,`retail`,`health`,`professional`,`agency`,`events`,`publicSector`],ql=[`marketing`,`sales`,`accounting`,`service`,`research`,`hr`,`operations`,`website`,`visuals`,`inquiries`,`advice`],Jl=[`text`,`web`,`browser`,`documents`,`image`,`video`,`speech`,`listening`,`code`,`connectors`,`film`],Yl=[`free`,`pro`],Xl={"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}`},Zl={en:Xl,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 Ql(e,t,n,r){let i=`${e}.${t}`;return i in Xl?$e(Zl,i,n,r):t}function $l(e){switch(e.type){case`page`:return ur;case`agent`:return mn;case`generate`:return e.asset===`image`?Qn:e.asset===`video`?S:e.asset===`dashboard`?or:jt;case`widget`:return on;case`surface`:return cr;case`film`:return En;case`review`:return Rn;case`result`:return Hn}return Si}var eu={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 tu(e){return c(`type.${e.type}`)}var nu=[`web_search`,`web_fetch`,`browser`,`sandbox`,`image`,`http`,`pages`];function ru(e){return nu.includes(e)?c(`tool.${e}`):e}function iu(e){switch(e.type){case`page`:return e.fields.map(e=>e.label).join(` · `);case`agent`:{let t=e.tools.map(ru),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?c(`editor.reviewEditable`):null,e.regenerate?c(`editor.reviewRedo`):null].filter(Boolean).join(` · `);case`result`:return e.deliverables.map(e=>`${e.label??e.from} (${e.formats.join(`, `)})`).join(` · `)}return``}var au=e({EntryDialog:()=>Du,MarketplaceBrowser:()=>Nu,MarketplaceCards:()=>Mu,MarketplaceHits:()=>ju,ProChip:()=>hu,useSettled:()=>ku}),W=(0,P.lazy)(()=>It(()=>import(`./FlowPreview-CusP7ci9.js`),__vite__mapDeps([9,1,2,5,6,10]))),ou={useCase:``,industry:``,format:``,capability:``,plan:``},su=(e,t)=>Ql(e,t,E),cu={en:Sn,de:wn};function lu(e){if(e<1)return 1;let t=10**Math.floor(Math.log10(e));return Math.round(e/t)*t}function uu(e){return e.credits?c(`market.credits`,{n:lu(e.credits.credits)}):su(`cost`,e.costTier)}var du={text:mi,document:jt,table:ui,image:Qn,video:S,audio:ye,dashboard:vn};function fu({format:e,className:t}){let n=du[e],r=su(`format`,e);return(0,I.jsx)(`span`,{title:r,className:`inline-flex`,children:(0,I.jsx)(n,{className:t,"aria-label":r,role:`img`})})}var pu=[`low`,`medium`,`high`];function mu({entry:e}){let t=pu.indexOf(e.costTier)+1,n=cu[E];return(0,I.jsxs)(`span`,{title:uu(e),className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex shrink-0`,children:pu.slice(0,t).map((e,t)=>(0,I.jsx)(`span`,{className:D(`rounded-full bg-(--coin-bg,var(--color-card))`,t>0&&`-ml-1.5`),children:(0,I.jsx)(n,{className:`size-4`})},e))}),su(`cost`,e.costTier)]})}function hu(){return(0,I.jsx)(k,{tone:`ember`,title:c(`market.proHint`),children:c(`market.pro`)})}function gu({plugin:e}){return(0,I.jsx)(k,{icon:(0,I.jsx)(Wr,{className:`size-3.5`}),title:c(`market.fromPlugin`,{name:e.name}),children:e.name})}function _u({entry:e,onOpen:t}){return(0,I.jsxs)(nt,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:D(`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,I.jsx)(`span`,{className:`-top-4 pointer-events-none absolute right-4`,children:(0,I.jsx)(qi,{kind:e.avatar,size:68})}),(0,I.jsxs)(`div`,{className:`min-w-0 pr-20`,children:[(0,I.jsxs)(`div`,{className:`font-display font-semibold text-[0.9375rem]`,children:[e.title,e.plan===`pro`?(0,I.jsx)(`span`,{className:`ml-1.5 inline-flex align-middle`,children:(0,I.jsx)(hu,{})}):null,e.starred?(0,I.jsx)(oi,{className:`ml-1.5 inline size-3.5 fill-amber align-[-2px] text-amber`,"aria-label":c(`market.starred`)}):null]}),(0,I.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3 leading-snug`,children:e.pitch})]}),(0,I.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,I.jsx)(gu,{plugin:e.plugin}):null,e.needs?.length?(0,I.jsx)(k,{tone:`warn`,children:c(`market.needsPro`,{list:e.needs.join(`, `)})}):e.usable&&e.missing.length?(0,I.jsx)(k,{tone:`warn`,children:c(`market.missing`,{list:yu(e.missing)})}):e.usable?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(Je,{className:`size-3.5`}),` `,c(`market.minutes`,{n:e.effort.minutes})]}),(0,I.jsx)(mu,{entry:e}),e.optional?.length?(0,I.jsx)(k,{title:c(`market.optionalHint`,{list:yu(e.optional)}),children:c(`market.without`,{list:yu(e.optional)})}):null,(0,I.jsx)(`span`,{className:`ml-auto inline-flex items-center gap-1.5`,children:e.formats.map(e=>(0,I.jsx)(fu,{format:e,className:`size-4`},e))})]}):(0,I.jsx)(k,{tone:`warn`,children:c(`market.needsUpdate`)})]})]})}function vu({title:e,children:t}){return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1.5 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:e}),t]})}var yu=e=>e.map(e=>su(`capability`,e)).join(`, `),bu={text:Ot,web:Kn,browser:Ct,documents:Qr,image:Qn,video:S,speech:bi,listening:et,code:fi,connectors:Hr,film:En};function xu(e){switch(e.type){case`page`:return ur;case`agent`:return mn;case`generate`:return e.asset===`image`?Qn:e.asset===`video`?S:e.asset===`voice`?bi:e.asset===`dashboard`?vn:jt;case`widget`:return e.video?En:on;case`surface`:return on;case`film`:return En;case`review`:return Rn;case`result`:return Hn}return Si}function Su(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 Cu(e){let t=Su(e);return e.map(e=>({id:e.id,title:e.title,icon:xu(e),tone:eu[e.type]??`bg-paper-2 text-ink-2`,optional:t.has(e.id),branches:e.branches}))}function wu({title:e,children:t}){return(0,I.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 Tu({icon:e,children:t,more:n}){return(0,I.jsxs)(`div`,{className:`flex gap-2.5`,children:[(0,I.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:e}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-[0.875rem] text-ink leading-snug`,children:t}),n?(0,I.jsx)(`div`,{className:`text-[0.75rem] text-ink-3 leading-snug`,children:n}):null]})]})}function Eu({className:e,children:t}){let n=(0,P.useRef)(null),[r,i]=(0,P.useState)({above:!1,below:!1});(0,P.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,I.jsx)(`div`,{ref:n,className:e,style:{maskImage:a,WebkitMaskImage:a},children:(0,I.jsx)(`div`,{children:t})})}function Du({id:e,fallback:t,onClose:n,onUse:r,busy:i}){let a=At(),o=v(),s=Ft({queryKey:[`marketplace-entry`,e,E],queryFn:()=>N.get(`/api/studio/marketplace/${encodeURIComponent(e)}?lang=${E}`),enabled:!!e,retry:!1}),l=s.data??t,d=F({mutationFn:t=>{let n=`/api/studio/marketplace/${encodeURIComponent(e)}/star`;return t?N.put(n):N.del(n)},onSuccess:()=>Promise.all([a.invalidateQueries({queryKey:[`marketplace`]}),a.invalidateQueries({queryKey:[`marketplace-entry`,e]})])}),f=Vi()===`dark`,p=Rt[Bt[l?.avatar||`round`]],m=f?`var(--card)`:`color-mix(in oklch, ${p??`var(--ink-4)`} 14%, var(--paper-2))`;return(0,I.jsx)(ue,{open:!!e,onClose:n,wide:!0,bare:!0,children:l?(0,I.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,I.jsx)(`button`,{type:`button`,"aria-label":c(`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,I.jsx)(Se,{className:`size-4`})}),(0,I.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:m,"--coin-bg":m},children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 overflow-hidden sm:rounded-t-2xl`,children:(0,I.jsx)(`span`,{className:D(`-top-28 -right-10 absolute size-80 rounded-full bg-white blur-3xl`,f?`opacity-[0.14]`:`opacity-80`)})}),(0,I.jsx)(`div`,{className:`-bottom-5 absolute right-9 z-10 max-sm:hidden`,children:(0,I.jsx)(qi,{kind:l.avatar,size:104})}),(0,I.jsxs)(`div`,{className:`relative sm:pr-36`,children:[(0,I.jsx)(`h2`,{className:`font-display font-semibold text-[1.375rem] leading-tight tracking-tight max-sm:pr-10`,children:l.title}),(0,I.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-2 leading-snug`,children:s.data?.description||l.pitch})]}),l.usable?(0,I.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,I.jsxs)(wu,{title:c(`market.duration`),children:[(0,I.jsx)(Je,{className:`size-4 text-ink-3`}),c(`market.minutes`,{n:l.effort.minutes})]}),(0,I.jsx)(wu,{title:c(`market.cost`),children:(0,I.jsx)(mu,{entry:l})}),(0,I.jsx)(wu,{title:c(`market.result`),children:l.formats.map(e=>(0,I.jsx)(fu,{format:e,className:`size-4`},e))})]}):null]}),l.usable?(0,I.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,I.jsxs)(`div`,{className:`flex flex-col gap-5 sm:min-h-0 sm:overflow-y-auto`,children:[(0,I.jsx)(vu,{title:c(`market.duration`),children:(0,I.jsx)(Tu,{icon:(0,I.jsx)(Je,{className:`size-4 text-moss`}),more:c(`market.durationHint`,{n:l.effort.fields}),children:c(`market.minutes`,{n:l.effort.minutes})})}),(0,I.jsx)(vu,{title:c(`market.cost`),children:(0,I.jsx)(Tu,{icon:(0,I.jsx)(Mn,{className:`size-4 text-amber`}),more:l.credits?c(`market.creditsHint`):void 0,children:(0,I.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2`,children:[(0,I.jsx)(mu,{entry:l}),l.credits?(0,I.jsx)(`span`,{className:`text-ink-2`,children:c(`market.creditsRange`,{n:lu(l.credits.credits)})}):null]})})}),(0,I.jsx)(vu,{title:c(`market.result`),children:(0,I.jsx)(`div`,{className:`flex flex-col gap-2`,children:(s.data?.results??[]).map(e=>(0,I.jsx)(Tu,{icon:(0,I.jsx)(fu,{format:e.kind,className:`size-4 text-ember-strong`}),more:e.formats.map(e=>e.toUpperCase()).join(` · `),children:e.title},e.title))})}),(0,I.jsx)(vu,{title:c(`market.needs`),children:(0,I.jsx)(`ul`,{className:`flex flex-col gap-2`,children:l.capabilities.map(e=>{let t=bu[e],n=l.missing.includes(e),r=l.optional?.includes(e);return(0,I.jsxs)(`li`,{className:D(`flex items-center gap-2.5 text-[0.875rem]`,n?`text-ink-3`:`text-ink-2`),children:[(0,I.jsx)(t,{className:D(`size-4 shrink-0`,n?`text-rose`:r?`text-amber`:`text-cobalt`)}),su(`capability`,e),n?(0,I.jsx)(`span`,{className:`text-[0.75rem] text-rose`,children:c(`market.unavailable`)}):r?(0,I.jsx)(`span`,{className:`text-[0.75rem] text-amber`,children:c(`market.optional`)}):null]},e)})})})]}),(0,I.jsxs)(`div`,{className:`flex flex-col sm:min-h-0`,children:[(0,I.jsx)(`div`,{className:`mb-1.5 shrink-0 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:c(`market.steps`)}),(0,I.jsx)(Eu,{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,I.jsx)(M,{className:`size-5 text-ink-3`}):(0,I.jsx)(P.Suspense,{fallback:(0,I.jsx)(M,{className:`size-5 text-ink-3`}),children:(0,I.jsx)(W,{steps:Cu(s.data?.outline??[])})})})]})]}):(0,I.jsx)(`div`,{className:`flex-1 px-5 pt-6 sm:px-7`,children:(0,I.jsx)(`p`,{className:`rounded-lg bg-amber-tint p-3 text-[0.875rem] text-ink-2`,children:c(`market.needsUpdateHint`)})}),(0,I.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,I.jsx)(`span`,{className:`mr-auto flex items-center`,children:(0,I.jsx)(gu,{plugin:l.plugin})}):(0,I.jsxs)(u,{variant:`ghost`,className:`mr-auto`,title:c(`market.starHint`),"aria-pressed":l.starred,busy:d.isPending,onClick:()=>d.mutate(!l.starred),children:[(0,I.jsx)(oi,{className:D(`size-4`,l.starred&&`fill-amber text-amber`)}),(0,I.jsx)(`span`,{className:`max-sm:sr-only`,children:c(l.starred?`market.starred`:`market.star`)})]}),(0,I.jsx)(u,{variant:`secondary`,onClick:n,children:c(`common.close`)}),l.usable&&l.missing.length?(0,I.jsx)(u,{variant:`secondary`,onClick:()=>o(`/settings/models`),children:c(`editor.models.settings`)}):null,r?(0,I.jsx)(u,{disabled:!l.usable||l.missing.length>0||!!l.needs?.length,title:l.needs?.length?c(`market.needsProHint`,{list:l.needs.join(`, `)}):l.missing.length?c(`market.missingHint`,{list:yu(l.missing)}):l.optional?.length?c(`market.optionalHint`,{list:yu(l.optional)}):void 0,busy:i,onClick:()=>r(l),children:c(`market.use`)}):null]})]}):(0,I.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,I.jsx)(M,{className:`size-6 text-ink-3`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`p`,{children:c(`market.notFound`)}),(0,I.jsx)(u,{variant:`secondary`,onClick:n,children:c(`common.close`)})]})})})}function Ou({name:e,value:t,options:n,onChange:r}){let[i,a]=(0,P.useState)(!1),o=(0,P.useRef)(null);(0,P.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,I.jsxs)(`div`,{ref:o,className:`relative`,children:[(0,I.jsxs)(`div`,{className:D(`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,I.jsx)(`button`,{type:`button`,"aria-haspopup":`listbox`,"aria-expanded":i,onClick:()=>a(!i),className:D(`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,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-ink-3`,children:e}),(0,I.jsx)(`span`,{className:`font-medium`,children:s.label})]}):(0,I.jsxs)(I.Fragment,{children:[e,(0,I.jsx)(Pt,{className:D(`size-3.5 transition`,i&&`rotate-180`)})]})}),s?(0,I.jsx)(`button`,{type:`button`,"aria-label":`${e}: ${c(`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,I.jsx)(Se,{className:`size-3.5`})}):null]}),i?(0,I.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,I.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:D(`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,I.jsx)(`span`,{className:`flex-1 whitespace-nowrap`,children:e.label}),e.value===t?(0,I.jsx)(Ie,{className:`size-4 text-ember`}):e.unavailable?(0,I.jsx)(`span`,{className:`whitespace-nowrap text-[0.75rem] text-ink-4`,children:c(`market.unavailable`)}):(0,I.jsx)(`span`,{className:`text-[0.75rem] text-ink-4 tabular-nums`,children:e.count})]},e.value))}):null]})}function ku(e,t){let[n,r]=(0,P.useState)(e);return(0,P.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var Au=60;function ju({query:e,onUse:t,busy:n,limit:r=6}){let[i,a]=(0,P.useState)(null),o=ku(e.trim(),250),s=Ft({queryKey:[`marketplace`,E,o,`hits`,r],queryFn:()=>N.get(`/api/studio/marketplace?${new URLSearchParams({lang:E,limit:String(r),offset:`0`,q:o})}`),enabled:!!o,placeholderData:He}),l=o?s.data?.entries??[]:[];return l.length?(0,I.jsxs)(`section`,{className:`mt-10`,children:[(0,I.jsxs)(`h2`,{className:`mb-5 flex items-center gap-2 font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:[c(`market.hits`),s.isFetching?(0,I.jsx)(M,{className:`size-3.5`}):null]}),(0,I.jsx)(`div`,{className:`flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:l.map(e=>(0,I.jsx)(_u,{entry:e,onOpen:()=>a(e.id)},e.id))}),(0,I.jsx)(Du,{id:i,fallback:l.find(e=>e.id===i)??null,onClose:()=>a(null),onUse:t,busy:n})]}):null}function Mu({entries:e}){let t=At(),n=v(),{project:r}=la(),i=$i()&&!!r&&!r?.readOnly,[a,o]=(0,P.useState)(null),s=F({mutationFn:e=>N.post(`/api/studio/wizards`,{projectId:r.id,starterId:e,lang:E}),onSuccess:async({id:e})=>{await t.invalidateQueries({queryKey:[`projects`]}),await t.invalidateQueries({queryKey:[`wizards`]}),o(null),n(`/edit/${e}`)}});return(0,I.jsxs)(`div`,{className:`@container mt-3`,children:[(0,I.jsx)(`div`,{className:`flex flex-col gap-4 @xl:grid @xl:grid-cols-2`,children:e.map(e=>(0,I.jsx)(_u,{entry:e,onOpen:()=>o(e.id)},e.id))}),s.error?(0,I.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:s.error.message}):null,(0,I.jsx)(Du,{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 Nu({onUse:e,busy:t,open:n,search:r,onGuestOpen:i}){let[a,o]=(0,P.useState)(``);(0,P.useEffect)(()=>{r&&o(r.text)},[r]);let[s,l]=(0,P.useState)(ou),[d,f]=(0,P.useState)(!1),[p,m]=(0,P.useState)(n??null),h=ku(a.trim(),250),g=(0,P.useRef)(null);(0,P.useEffect)(()=>{let e=g.current;h&&e&&window.matchMedia(`(max-width: 639px)`).matches&&e.scrollIntoView({behavior:`smooth`,block:`start`})},[h]);let _=Yt({queryKey:[`marketplace`,E,h,s,d],queryFn:({pageParam:e})=>{let t=new URLSearchParams({lang:E,limit:String(Au),offset:String(e)});h&&t.set(`q`,h);for(let[e,n]of Object.entries(s))n&&t.set(e,n);return d&&t.set(`starred`,`1`),N.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:He}),v=_.data?.pages[0],y=_.data?.pages.flatMap(e=>e.entries)??[],b=v?.all??0,ee=a.trim()!==h||_.isFetching&&!_.isFetchingNextPage,x=(e,t,n,r)=>n.filter(t=>v?.facets[e]?.[t]!==void 0).map(n=>({value:n,label:su(t,n),icon:r?.(n),count:(v?.facets[e])[n]??0,unavailable:e===`capability`&&S.has(n)})),S=new Set(v?.unavailable??[]),te=x(`useCase`,`useCase`,ql),C=[{key:`industry`,name:c(`market.industry`),options:x(`industry`,`industry`,Kl)},{key:`format`,name:c(`market.format`),options:x(`format`,`format`,Gl,e=>(0,I.jsx)(fu,{format:e,className:`size-4 text-ink-3`}))},{key:`plan`,name:c(`market.plan`),options:x(`plan`,`plan`,Yl)},{key:`capability`,name:c(`market.capability`),options:x(`capability`,`capability`,Jl,e=>{let t=bu[e];return(0,I.jsx)(t,{className:`size-4 text-ink-3`})})}],ne=!!a.trim()||d||Object.values(s).some(Boolean),re=()=>{l(ou),o(``),f(!1)};if(_.isLoading)return(0,I.jsx)(`div`,{className:`flex justify-center py-10`,children:(0,I.jsx)(M,{className:`size-6 text-ink-3`})});let T=v?.offline?(0,I.jsxs)(`p`,{className:`mt-4 flex items-center justify-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,I.jsx)(On,{className:`size-4 shrink-0`}),c(`market.offline`)]}):null;if(!b&&!ne)return T;let ie=a?(0,I.jsx)(`button`,{type:`button`,"aria-label":c(`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,I.jsx)(Se,{className:`size-4`})}):null,ae=e=>D(`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,I.jsxs)(`div`,{children:[(0,I.jsxs)(`label`,{ref:g,className:`relative mx-auto flex h-10 max-w-md scroll-mt-4 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:[ee?(0,I.jsx)(M,{className:`size-4 shrink-0 text-ink-3`}):(0,I.jsx)(w,{className:`size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`input`,{type:`search`,value:a,onChange:e=>o(e.target.value),placeholder:c(`market.search`),"aria-label":c(`market.search`),className:`min-w-0 flex-1 bg-transparent text-[0.9375rem] outline-none placeholder:text-ink-4 [&::-webkit-search-cancel-button]:hidden`}),ie]}),T,(0,I.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:c(`market.all`)},...te].map(e=>(0,I.jsx)(`button`,{type:`button`,"aria-pressed":!d&&s.useCase===e.value,onClick:()=>{f(!1),l({...s,useCase:e.value})},className:ae(!d&&s.useCase===e.value),children:e.label},e.value)),i?null:(0,I.jsxs)(`button`,{type:`button`,"aria-pressed":d,onClick:()=>f(!d),className:ae(d),children:[(0,I.jsx)(oi,{className:D(`size-3.5`,d&&`fill-amber text-amber`)}),c(`market.starred`)]})]}),(0,I.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-1 gap-y-2 sm:mt-6`,children:[d?null:C.map(e=>(0,I.jsx)(Ou,{name:e.name,value:s[e.key],options:e.options,onChange:t=>l({...s,[e.key]:t})},e.key)),(0,I.jsxs)(`span`,{className:`ml-auto flex items-center gap-3 whitespace-nowrap pl-2 text-[0.8125rem] text-ink-3`,children:[ne?(0,I.jsxs)(`button`,{type:`button`,onClick:re,className:`inline-flex items-center gap-1 text-ember-strong underline-offset-2 hover:underline`,children:[(0,I.jsx)(Se,{className:`size-3.5 max-sm:size-4`}),(0,I.jsx)(`span`,{className:`max-sm:sr-only`,children:c(`market.resetShort`)})]}):null,ne?(0,I.jsx)(`span`,{className:`tabular-nums sm:hidden`,children:c(`market.countOfShort`,{n:v?.total??0,all:b})}):null,(0,I.jsx)(`span`,{className:D(`tabular-nums`,ne&&`max-sm:hidden`),children:ne?c(`market.countOf`,{n:v?.total??0,all:b}):c(`market.count`,{n:b})})]})]}),y.length?(0,I.jsx)(`div`,{className:`mt-4 flex flex-col gap-4 sm:grid sm:grid-cols-2 lg:grid-cols-3`,children:y.map(e=>(0,I.jsx)(_u,{entry:e,onOpen:()=>i?i(e):m(e.id)},e.id))}):(0,I.jsxs)(`div`,{className:`py-10 text-center text-[0.875rem] text-ink-3`,children:[(0,I.jsx)(`p`,{children:c(d?`market.noneStarred`:`market.none`)}),(0,I.jsx)(u,{variant:`ghost`,className:`mt-2`,onClick:re,children:c(`market.reset`)})]}),_.hasNextPage?(0,I.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,I.jsx)(u,{variant:`secondary`,busy:_.isFetchingNextPage,onClick:()=>void _.fetchNextPage(),children:c(`market.more`)})}):null,(0,I.jsx)(Du,{id:p,fallback:y.find(e=>e.id===p)??null,onClose:()=>m(null),onUse:e,busy:t})]})}function Pu({wizard:e,className:t,onDeleted:n}){let r=At(),i=v(),o=ea(),[s,l]=(0,P.useState)(!1),[d,f]=(0,P.useState)(!1),p=(0,P.useRef)(null);xd(p,s,()=>l(!1));let m=F({mutationFn:()=>N.post(`/api/studio/wizards/${e.id}/duplicate`),onSuccess:async({id:e})=>{await r.invalidateQueries({queryKey:[`wizards`]}),i(`/edit/${e}`)}}),h=F({mutationFn:()=>N.del(`/api/studio/wizards/${e.id}`),onSuccess:async()=>{f(!1),await r.invalidateQueries({queryKey:[`wizards`]}),await r.invalidateQueries({queryKey:[`projects`]}),n?.()}}),g=`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,I.jsxs)(`div`,{ref:p,className:D(`relative`,t),onClick:e=>e.stopPropagation(),children:[(0,I.jsx)(`button`,{type:`button`,"aria-label":c(`wizardMenu.label`),title:c(`wizardMenu.label`),"aria-haspopup":`menu`,"aria-expanded":s,onClick:()=>l(e=>!e),className:D(`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,I.jsx)(qe,{className:`size-4`})}),s?(0,I.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,I.jsxs)(`button`,{type:`button`,role:`menuitem`,className:g,disabled:m.isPending,onClick:()=>{l(!1),m.mutate()},children:[(0,I.jsx)(Xe,{className:`size-4 shrink-0`}),` `,c(`wizardMenu.duplicate`)]}),(0,I.jsxs)(`a`,{role:`menuitem`,href:a(`/api/studio/wizards/${e.id}/export`),download:!0,className:g,onClick:()=>l(!1),children:[(0,I.jsx)(_t,{className:`size-4 shrink-0`}),` `,c(`editor.export`)]}),o?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,I.jsxs)(`button`,{type:`button`,role:`menuitem`,className:D(g,`text-rose hover:bg-rose-tint hover:text-rose`),onClick:()=>{l(!1),f(!0)},children:[(0,I.jsx)(be,{className:`size-4 shrink-0`}),` `,c(`wizardMenu.delete`)]})]}):null]}):null,(0,I.jsxs)(ue,{open:d,onClose:()=>f(!1),title:c(`wizardMenu.deleteTitle`,{title:e.title}),children:[(0,I.jsx)(`p`,{className:`-mt-2 text-[0.875rem] text-ink-2`,children:e.published?c(`wizardMenu.deletePublished`):c(`wizardMenu.deleteDraft`)}),h.error?(0,I.jsx)(`p`,{className:`mt-3 text-[0.8125rem] text-rose`,children:h.error.message}):null,(0,I.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,I.jsx)(u,{variant:`ghost`,onClick:()=>f(!1),children:c(`common.cancel`)}),(0,I.jsxs)(u,{variant:`danger`,busy:h.isPending,onClick:()=>h.mutate(),children:[(0,I.jsx)(be,{className:`size-4`}),` `,c(`wizardMenu.delete`)]})]})]})]})}var Fu=e({HomePage:()=>Qu,NewSpaceDialog:()=>Lu,ProjectSwitcher:()=>Ru}),Iu=[{icon:Si,name:()=>c(`nav.wizards`),what:`space.holds.wizards`},{icon:Bn,name:()=>c(`space.info`),what:`space.holds.info`},{icon:fn,name:()=>`${c(`space.knowledge`)} & ${c(`space.data`)}`,what:`space.holds.knowledge`},{icon:Hr,name:()=>c(`connectors.title`),what:`space.holds.connectors`},{icon:nr,name:()=>c(`space.results`),what:`space.holds.results`}];function Lu({open:e,onClose:t}){let{select:n}=la(),r=At(),[i,a]=(0,P.useState)(``),o=F({mutationFn:()=>N.post(`/api/studio/projects`,{name:i}),onSuccess:async({id:e})=>{await r.invalidateQueries({queryKey:[`projects`]}),n(e),a(``),t()}});return(0,I.jsxs)(ue,{open:e,onClose:t,title:c(`home.newProject`),children:[(0,I.jsx)(`p`,{className:`-mt-2 text-[0.875rem] text-ink-2`,children:c(`space.holds.intro`)}),(0,I.jsx)(`dl`,{className:`mt-4 flex flex-col gap-2.5 text-[0.8125rem]`,children:Iu.map(e=>(0,I.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,I.jsx)(e.icon,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`dt`,{className:`w-28 shrink-0 font-medium text-ink`,children:e.name()}),(0,I.jsx)(`dd`,{className:`min-w-0 text-ink-3`,children:c(e.what)})]},e.what))}),(0,I.jsx)(`p`,{className:`mt-3 text-[0.8125rem] text-ink-4`,children:c(`space.holds.shared`)}),(0,I.jsxs)(`form`,{className:`mt-5`,onSubmit:e=>{e.preventDefault(),i.trim()&&o.mutate()},children:[(0,I.jsx)(ne,{autoFocus:!0,placeholder:c(`home.projectName`),value:i,onChange:e=>a(e.target.value)}),(0,I.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,I.jsx)(u,{variant:`ghost`,onClick:t,children:c(`common.cancel`)}),(0,I.jsx)(u,{type:`submit`,busy:o.isPending,disabled:!i.trim(),children:c(`home.newProject`)})]})]})]})}function Ru(){let{project:e,projects:t,select:n}=la(),r=ia().data?.limits.projects??1,i=$i(),[a,o]=(0,P.useState)(!1);return!e||r!==null&&r<=1?null:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(p,{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:`+ ${c(`home.newProject`)}`}:{value:`__new`,label:c(`home.projectLimit`,{n:r}),disabled:!0}]:[]]}),(0,I.jsx)(Lu,{open:a,onClose:()=>o(!1)})]})}function zu({url:e}){let[t,n]=(0,P.useState)(!1);return(0,I.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,I.jsx)(Ie,{className:`size-3.5`}):(0,I.jsx)(Xe,{className:`size-3.5`}),c(t?`share.copied`:`share.link`)]})}function Bu(){let e=v(),t=Ml(!1),[n,r]=(0,P.useState)(!1),i=(0,P.useRef)(null);return(0,P.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,I.jsxs)(`div`,{className:`relative`,ref:i,onClick:e=>e.stopPropagation(),children:[(0,I.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,I.jsx)(Xe,{className:`size-3.5`}),` `,c(`share.link`)]}),n?(0,I.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,I.jsx)(`p`,{className:`text-[0.8125rem] text-ink-2 leading-relaxed`,children:c(`teaser.link`)}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(u,{size:`sm`,busy:t.link.isPending,onClick:()=>t.link.mutate({}),children:c(`account.signIn`)}),(0,I.jsx)(u,{size:`sm`,variant:`secondary`,onClick:()=>e(`/settings/account`),children:c(`account.create`)})]}),(0,I.jsx)(Nl,{...t})]}):null]})}function Vu({w:e,me:t,runners:n}){let r=za(`account`),i=v(),a=Ol(e,t,e.cloud),o=kl(a),s=o??(e.published?Dl(e):null);return(0,I.jsxs)(`div`,{className:`group/card relative pt-6`,children:[(0,I.jsx)(`div`,{className:`pointer-events-none absolute top-0 left-4 z-10`,children:(0,I.jsx)(qi,{kind:e.avatar,size:52})}),(0,I.jsxs)(nt,{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,I.jsx)(`div`,{className:`absolute top-3 right-3`,children:e.published?(0,I.jsx)(Al,{where:a,me:t}):(0,I.jsx)(k,{children:c(`home.draft`)})}),(0,I.jsx)(`h3`,{className:`font-display font-semibold text-[1.0625rem] leading-snug`,children:e.title}),(0,I.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[0.875rem] text-ink-3`,children:e.description}),(0,I.jsxs)(`div`,{className:`mt-auto flex min-h-8 items-center justify-between pt-3`,children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-2.5 text-[0.75rem] text-ink-4`,children:[c(`home.steps`,{n:e.stepCount}),(0,I.jsx)(Wl,{w:e,runners:n})]}),(0,I.jsxs)(`div`,{className:`flex items-center`,children:[(0,I.jsx)(Pu,{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,I.jsx)(zu,{url:o}):a.kind===`here`&&r?(0,I.jsx)(Bu,{}):null,s?(0,I.jsx)(y,{label:c(o?`share.open`:`share.openHere`),className:`ml-1 size-8`,onClick:e=>{e.stopPropagation(),gl(s)},children:(0,I.jsx)(cn,{className:`size-4`})}):null]})]})]})]})}var Hu=[`draft`,`here`,`live`,`missing`],Uu={draft:We,here:ir,live:Kr,missing:On},Wu=e=>c(e===`draft`?`home.draft`:e===`here`?`where.here`:e===`live`?`home.live`:`where.missing`);function Gu(e,t){let{kind:n}=Ol(e,t,e.cloud);return n===`draft`||n===`here`?n:n===`live`||n===`unknown`?`live`:`missing`}function Ku({wizards:e,me:t,value:n,onChange:r}){let i=new Map;for(let n of e){let e=Gu(n,t);i.set(e,(i.get(e)??0)+1)}if(i.size<2)return null;let a=e=>D(`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,I.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-1`,children:[(0,I.jsxs)(`button`,{type:`button`,className:a(n===null),onClick:()=>r(null),children:[c(`home.all`),(0,I.jsx)(`span`,{className:`text-[0.75rem] text-ink-4`,children:e.length})]}),Hu.filter(e=>i.has(e)).map(e=>{let t=Uu[e];return(0,I.jsxs)(`button`,{type:`button`,"aria-pressed":n===e,className:a(n===e),onClick:()=>r(n===e?null:e),children:[(0,I.jsx)(t,{className:`size-3.5`}),Wu(e),(0,I.jsx)(`span`,{className:`text-[0.75rem] text-ink-4`,children:i.get(e)})]},e)})]})}var qu=12,Ju=3;function Yu({value:e,onChange:t}){return(0,I.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,I.jsx)(w,{className:`size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`input`,{type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:c(`home.search`),"aria-label":c(`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,I.jsx)(`button`,{type:`button`,"aria-label":c(`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,I.jsx)(Se,{className:`size-4`})}):null]})}var Xu=`curl -fsSL https://engenty.ai/install.sh | bash`;function Zu(){let[e,t]=(0,P.useState)(!1),n=[c(`home.local.install`),c(`home.local.signIn`),c(`home.local.publish`)];return(0,I.jsxs)(`div`,{className:`mx-auto flex max-w-xl animate-rise flex-col items-center pt-4 text-center`,children:[(0,I.jsx)(qi,{kind:`round`,size:120}),(0,I.jsx)(`h1`,{className:`mt-2 font-display font-semibold text-[1.75rem] leading-tight tracking-tight`,children:c(`home.local.title`)}),(0,I.jsx)(`p`,{className:`mt-3 text-[0.9375rem] text-ink-2 leading-relaxed`,children:c(`home.local.text`)}),(0,I.jsx)(`ol`,{className:`mt-8 flex w-full flex-col gap-4 text-left`,children:n.map((n,r)=>(0,I.jsxs)(`li`,{className:`flex gap-3`,children:[(0,I.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,I.jsxs)(`div`,{className:`min-w-0 flex-1 pt-0.5`,children:[(0,I.jsx)(`p`,{className:`text-[0.9375rem] leading-snug`,children:n}),r===0?(0,I.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,I.jsx)(`code`,{className:`min-w-0 flex-1 select-all overflow-x-auto whitespace-nowrap font-mono text-[0.8125rem] text-ink-2`,children:Xu}),(0,I.jsxs)(u,{variant:`secondary`,size:`sm`,onClick:()=>{navigator.clipboard.writeText(Xu),t(!0),setTimeout(()=>t(!1),1500)},children:[e?(0,I.jsx)(Ie,{className:`size-3.5`}):(0,I.jsx)(Xe,{className:`size-3.5`}),c(e?`share.copied`:`share.copy`)]})]}):null]})]},n))})]})}function Qu(){let e=v(),t=At(),{project:n,projects:r,loading:i}=la(),a=ia().data,o=Qi(),s=$i(),l=Ft({queryKey:[`wizards`,n?.id,!!a?.account],queryFn:()=>N.get(`/api/studio/projects/${n.id}/wizards`),enabled:!!n}),d=Hl().data??[],[f,p]=(0,P.useState)(null),[m,h]=(0,P.useState)(``),g=(l.data?.length??0)>qu,_=g?m.trim().toLowerCase():``,y=(l.data??[]).filter(e=>(!f||!a||Gu(e,a)===f)&&(!_||`${e.title} ${e.description}`.toLowerCase().includes(_))),b=!!_&&y.length<Ju,ee=F({mutationFn:e=>N.post(`/api/studio/wizards`,{projectId:n.id,starterId:e,lang:E}),onSuccess:async({id:n})=>{await t.invalidateQueries({queryKey:[`projects`]}),await t.invalidateQueries({queryKey:[`wizards`]}),e(`/edit/${n}`)}}),x=r.reduce((e,t)=>e+t.wizardCount,0),S=s&&!n?.readOnly;return!i&&S&&r.length&&x===0?(0,I.jsx)(tt,{to:`/new`,replace:!0}):!i&&!o&&r.length===0?(0,I.jsx)(Zu,{}):(0,I.jsxs)(`div`,{className:`animate-rise`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[g?(0,I.jsx)(Yu,{value:m,onChange:h}):(0,I.jsx)(`h1`,{className:`font-display font-semibold text-[1.75rem] tracking-tight`,children:c(`home.title`,{space:n?.name??``})}),S?(0,I.jsxs)(u,{onClick:()=>e(`/new`),children:[(0,I.jsx)(he,{className:`size-4`}),` `,c(`home.new`)]}):null]}),n?.origin===`local`?(0,I.jsxs)(`p`,{className:`mt-2 text-[0.875rem] text-ink-3`,children:[c(`home.fromLocal`),` `,n.syncedAt?c(`home.syncedAt`,{when:new Intl.DateTimeFormat(E,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(n.syncedAt))}):null]}):null,l.data&&l.data.length===0?(0,I.jsxs)(pe,{children:[(0,I.jsx)(`p`,{children:c(`home.empty`)}),S?(0,I.jsxs)(u,{className:`mt-5`,onClick:()=>e(`/new`),children:[(0,I.jsx)(he,{className:`size-4`}),` `,c(`home.new`)]}):null]}):null,l.data?.length&&a?(0,I.jsx)(Ku,{wizards:l.data,me:a,value:f,onChange:p}):null,_&&y.length===0?(0,I.jsx)(`p`,{className:`mt-6 text-[0.875rem] text-ink-3`,children:c(`home.noMatch`)}):null,(0,I.jsx)(`div`,{className:`mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:a?y.map(e=>(0,I.jsx)(Vu,{w:e,me:a,runners:d},e.id)):null}),b?(0,I.jsxs)(I.Fragment,{children:[S?(0,I.jsx)(ju,{query:m,busy:ee.isPending,onUse:e=>n&&!ee.isPending&&ee.mutate(e.id)}):(0,I.jsx)(ju,{query:m}),S?(0,I.jsx)(`div`,{className:`mt-8 flex justify-center`,children:(0,I.jsxs)(u,{variant:`secondary`,onClick:()=>e(`/new?wish=${encodeURIComponent(m.trim())}`),children:[(0,I.jsx)(ae,{className:`size-4`}),` `,c(`home.newFromSearch`,{q:m.trim()})]})}):null]}):null]})}var $u=`wizards.install-banner`,ed=()=>window.matchMedia(`(pointer: coarse)`).matches;function G({open:e,onClose:t}){let n=Ka(),r=Ga(n),i=c(r===`prompt`?`install.app.offer`:r===`none`?`install.app.browser`:`install.app.how.${r}`);return(0,I.jsxs)(ue,{open:e,onClose:t,title:c(`install.app.action`),children:[(0,I.jsx)(`p`,{className:`text-[0.9375rem] text-ink-2 leading-relaxed`,children:i}),(0,I.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,I.jsx)(u,{variant:`ghost`,onClick:t,children:c(`install.app.close`)}),n?(0,I.jsx)(u,{onClick:()=>{qa(n),t()},children:c(`install.app.action`)}):null]})]})}function K(){try{return localStorage.getItem($u)===`1`}catch{return!1}}function q(){let e=Ka(),[t,n]=(0,P.useState)(K),r=Ga(e);return t||Ba()||ed()||r===`chromium`?null:(0,I.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,I.jsx)(on,{className:`size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`p`,{className:`min-w-0 flex-1`,children:c(e?`install.app.offer`:`install.app.browser`)}),e?(0,I.jsx)(u,{size:`sm`,onClick:()=>void qa(e),children:c(`install.app.action`)}):null,(0,I.jsx)(y,{label:c(`install.app.close`),onClick:()=>{try{localStorage.setItem($u,`1`)}catch{}n(!0)},className:`size-8`,children:(0,I.jsx)(Se,{className:`size-4`})})]})}function J(){return[{id:`info`,label:c(`space.info`),icon:Bn},{id:`knowledge`,label:c(`space.knowledge`),icon:fn},{id:`data`,label:c(`space.data`),icon:lt},{id:`results`,label:c(`space.results`),icon:nr}]}function Y(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 td(e){return e===`info`||e===`knowledge`||e===`data`||e===`results`}var nd=[{id:`base`,group:`info`,label:`project.base`,icon:mi},{id:`facts`,group:`info`,label:`project.facts`,icon:ur},{id:`logos`,group:`info`,label:`project.logos`,icon:ni},{id:`colors`,group:`info`,label:`project.colors`,icon:Or},{id:`typography`,group:`info`,label:`project.typography`,icon:tn},{id:`assets`,group:`info`,label:`project.assets`,icon:er},{id:`documents`,group:`knowledge`,label:`project.documents`,icon:jt}],rd=nd.map(e=>e.id);function id(e,t){let n=t.spaceSections.find(t=>t.id===e);return nd.find(t=>t.id===e)?.group??(n?n.group??`knowledge`:null)}function ad(e,t,n=[]){let r=nd.filter(t=>t.group===e&&!n.includes(t.id)).map(e=>({id:e.id,label:c(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 od=(0,P.lazy)(()=>It(()=>import(`./ChangelogDialog-BXqBW8j3.js`).then(e=>({default:e.ChangelogDialog})),__vite__mapDeps([8,1,2,5,6]))),sd=`wizards.update-banner`;function cd(){try{return localStorage.getItem(sd)}catch{return null}}function ld(){let[e,t]=(0,P.useState)(cd),[n,r]=(0,P.useState)(!1),{data:i,latest:a,apply:o,busy:s,progress:l}=Wc(),d=i&&!i.newer?i.updated?.to??null:null,f=d??(i?.newer?a:null);if(!(i&&f)||e===f&&i.applying===`idle`)return null;let p=()=>{try{localStorage.setItem(sd,f)}catch{}t(f)},m=l??(d?c(`about.update.updated`,{v:f}):i.pending?.version===f?c(`about.update.ready`,{v:f}):c(`about.update.available`,{v:f}));return(0,I.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,I.jsx)(M,{className:`size-4 shrink-0 text-ember-strong`}):(0,I.jsx)(_t,{className:`size-4 shrink-0 text-ember-strong`}),(0,I.jsx)(`p`,{className:`min-w-0 flex-1`,children:m}),s?null:(0,I.jsx)(`button`,{type:`button`,onClick:()=>r(!0),className:`shrink-0 underline transition hover:text-ink`,children:c(`about.update.notes`)}),n?(0,I.jsx)(P.Suspense,{fallback:null,children:(0,I.jsx)(od,{open:!0,version:f,onClose:()=>r(!1)})}):null,i.canApply&&!d&&(i.applying===`idle`||i.applying===`failed`)?(0,I.jsx)(u,{size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(),children:c(`about.update.install`)}):null,s?null:(0,I.jsx)(y,{label:c(`install.app.close`),onClick:p,className:`size-8`,children:(0,I.jsx)(Se,{className:`size-4`})})]})}var ud=[],dd=new Set;function fd(e){ud=e;for(let e of dd)e()}function pd(e){let t=JSON.stringify(e);(0,P.useEffect)(()=>(fd(JSON.parse(t)),()=>fd([])),[t])}function md(){return ud}function hd(){return(0,P.useSyncExternalStore)(e=>(dd.add(e),()=>dd.delete(e)),()=>ud)}function gd(){let e=hd();return e.length?(0,I.jsx)(`nav`,{"aria-label":c(`nav.breadcrumb`),className:`flex min-w-0 items-center text-[0.9375rem] max-sm:hidden`,children:e.map((t,n)=>(0,I.jsxs)(P.Fragment,{children:[(0,I.jsx)(`span`,{className:D(`mr-2 text-ink-4`,n===0?`-ml-1 sm:-ml-2`:`ml-2`),children:`/`}),t.to&&n<e.length-1?(0,I.jsx)(it,{to:t.to,className:`truncate text-ink-3 transition hover:text-ink`,children:t.label}):(0,I.jsx)(`span`,{"aria-current":`page`,className:`truncate font-medium text-ink`,children:t.label})]},`${n}:${t.label}`))}):null}var _d=e=>e.manageUrl??e.account?.url??null;function vd(e){let t=_d(e);return t?`${t}/billing`:null}function yd({me:e}){let t=ta(e),n=vd(e);return t===null||!n?null:(0,I.jsx)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,className:D(`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:c(`nav.credits`,{n:Math.floor(t).toLocaleString(E)})})}function bd(e,t){return e.mode===`local`?e.account?e.account.signedIn?`linked`:`expired`:t?`alone`:null:null}function xd(e,t,n){let r=(0,P.useRef)(n);r.current=n,(0,P.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 Sd(e,t,n){return e===`below`?n:Na(t,e===`bar-start`?`start`:`end`)}var Cd=e=>`oklch(from ${e} calc(0.16 + 0.83 * clamp(0, (0.65 - l) * 1000, 1)) 0.01 h)`;function wd({project:e,size:t=`md`}){let n=e?.brand.colors?.[0]?.value,r=Xi(e?.name??``),i=(0,I.jsx)(`span`,{className:D(`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:Cd(n)}:void 0,children:r||(0,I.jsx)(Wn,{className:`size-4`})});return e?.origin===`local`?(0,I.jsxs)(`span`,{className:`relative shrink-0`,title:c(`readonly.project`),children:[i,(0,I.jsx)(`span`,{className:`-right-1 -bottom-1 absolute grid size-4 place-items-center rounded-full bg-amber ring-2 ring-paper`,children:(0,I.jsx)(ir,{className:`size-2.5 text-paper`})})]}):i}function Td({me:e,placement:t,label:n,className:r,children:i}){let a=v(),{position:s}=ja(),{project:l,projects:u,select:d}=la(),f=$i(),[p,m]=(0,P.useState)(!1),[h,g]=(0,P.useState)(!1),[_,y]=(0,P.useState)(!1),[b,ee]=(0,P.useState)({top:0,left:0}),x=(0,P.useRef)(null);xd(x,p,()=>m(!1));let S=e.limits.projects,te=S!==null&&u.length>=S,C=`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,I.jsx)(`div`,{className:`shrink-0`,ref:x,children:(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:e=>{let t=e.currentTarget.getBoundingClientRect();ee({top:t.bottom+6,left:t.left}),m(e=>!e)},"aria-expanded":p,"aria-haspopup":`menu`,"aria-label":n,title:c(`nav.switchSpace`),className:typeof r==`function`?r(p):r,children:i}),p?(0,I.jsxs)(`div`,{role:`menu`,style:t===`below`?{position:`fixed`,...b}:void 0,className:D(`z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,t===`below`?null:D(`absolute`,Sd(t,s,`top-10 left-0`))),children:[u.map(e=>{let t=e.id===l?.id;return(0,I.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:()=>{m(!1),t?a(`/`):d(e.id)},children:[(0,I.jsx)(wd,{project:e,size:`sm`}),(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,I.jsx)(`span`,{className:D(`truncate text-[0.875rem]`,t?`font-semibold text-ink`:`font-medium text-ink-2`),children:e.name}),(0,I.jsx)(`span`,{className:`truncate text-[0.75rem] text-ink-4`,children:c(`nav.wizardCount`,{n:e.wizardCount})})]}),t?(0,I.jsx)(Ie,{className:`size-4 shrink-0 text-ember-strong`}):null]},e.id)}),(0,I.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),[{to:`/`,icon:Si,label:c(`nav.wizardsInSpace`),show:!0},{to:`/new`,icon:he,label:c(`nav.addWizard`),show:f}].filter(e=>e.show).map(e=>(0,I.jsxs)(`button`,{type:`button`,role:`menuitem`,className:C,onClick:()=>{m(!1),a(e.to)},children:[(0,I.jsx)(e.icon,{className:`size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`span`,{className:`truncate`,children:e.label})]},e.to)),l&&!l.readOnly?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,I.jsxs)(`button`,{type:`button`,role:`menuitem`,className:C,onClick:()=>{m(!1),y(!0)},children:[(0,I.jsx)(o,{className:`size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`span`,{className:`truncate`,children:c(`nav.renameSpace`)})]})]}):null,f&&!te?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,I.jsxs)(`button`,{type:`button`,role:`menuitem`,className:C,onClick:()=>{m(!1),g(!0)},children:[(0,I.jsx)(he,{className:`size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:(0,I.jsx)(`span`,{className:`truncate`,children:c(`nav.addSpace`)})})]})]}):null]}):null,(0,I.jsx)(Lu,{open:h,onClose:()=>g(!1)}),l?(0,I.jsx)(Ed,{project:l,open:_,onClose:()=>y(!1)}):null]})})}function Ed({project:e,open:t,onClose:n}){let r=At(),[i,a]=(0,P.useState)(e.name);(0,P.useEffect)(()=>{t&&a(e.name)},[t,e.name]);let o=F({mutationFn:()=>N.patch(`/api/studio/projects/${e.id}`,{name:i.trim()}),onSuccess:async()=>{await r.invalidateQueries({queryKey:[`projects`]}),n()}});return(0,I.jsx)(ue,{open:t,onClose:n,title:c(`nav.renameSpace`),children:(0,I.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),i.trim()&&o.mutate()},children:[(0,I.jsx)(ne,{autoFocus:!0,maxLength:80,"aria-label":c(`nav.renameSpace`),value:i,onChange:e=>a(e.target.value)}),(0,I.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,I.jsx)(u,{variant:`ghost`,onClick:n,children:c(`common.cancel`)}),(0,I.jsx)(u,{type:`submit`,busy:o.isPending,disabled:!i.trim(),children:c(`settings.save`)})]})]})})}function Dd({me:e,project:t}){let n=e.mode===`local`||t.origin===`local`,r=n?ir:An,i=c(n?`nav.spaceLocal`:`nav.spaceCloud`);return(0,I.jsx)(`span`,{title:i,className:`grid size-6 shrink-0 place-items-center text-ink-4`,children:(0,I.jsx)(r,{className:`size-3.5`,"aria-label":i})})}function Od({me:e}){let{project:t}=la();return t?(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[(0,I.jsx)(Td,{me:e,placement:`below`,label:t.name,className:e=>D(`-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,I.jsx)(Dd,{me:e,project:t})]}):null}function kd({me:e,placement:t=`below`}){let[n,r]=(0,P.useState)(!1),i=(0,P.useRef)(null),a=v(),{position:o}=ja(),s=Vd();xd(i,n,()=>r(!1));let l=Ka(),[u,d]=(0,P.useState)(!1),f=Xi(e.user.name),p=bd(e,za(`account`)),m=`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,I.jsxs)(`div`,{className:`relative`,ref:i,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:D(`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,I.jsx)(`img`,{src:e.user.image,alt:``,className:`size-full rounded-full object-cover`}):f,p===`linked`||p===`expired`?(0,I.jsx)(`span`,{title:p===`linked`?c(`nav.connected`,{host:El(e.account?.cloudUrl??``)}):c(`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:p===`linked`?(0,I.jsx)(An,{className:`size-2.5 text-moss`}):(0,I.jsx)(On,{className:`size-2.5 text-amber`})}):null]}),n?(0,I.jsxs)(`div`,{className:D(`absolute z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,Sd(t,o,`top-11 right-0`)),children:[(0,I.jsxs)(`div`,{className:`px-3 pt-2 pb-2.5`,children:[(0,I.jsxs)(`div`,{className:`truncate font-medium text-[0.875rem]`,children:[e.user.name,p===`alone`?(0,I.jsxs)(`span`,{className:`font-normal text-ink-4`,children:[` (`,c(`nav.local`),`)`]}):null]}),(0,I.jsx)(`div`,{className:`truncate text-[0.75rem] text-ink-3`,children:e.user.email})]}),p?(0,I.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:[p===`linked`?(0,I.jsx)(An,{className:`mt-0.5 size-4 shrink-0 text-moss`}):p===`expired`?(0,I.jsx)(On,{className:`mt-0.5 size-4 shrink-0 text-amber`}):(0,I.jsx)(ir,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-snug`,children:[(0,I.jsx)(`span`,{className:`break-words`,children:p===`linked`?c(`nav.connected`,{host:El(e.account?.cloudUrl??``)}):c(p===`expired`?`nav.expired`:`nav.onlyHere`)}),(0,I.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:p===`linked`?e.account?.credits!==null&&e.account?.credits!==void 0?c(`nav.credits`,{n:Math.floor(e.account.credits).toLocaleString(E)}):null:c(p===`expired`?`account.signInAgain`:`account.signIn`)})]})]}):null,(0,I.jsx)(`div`,{className:`px-3 pt-1.5 pb-1 font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.07em]`,children:c(`nav.settings`)}),wo(e,s).filter(e=>e.menu).map(e=>(0,I.jsxs)(`button`,{type:`button`,className:m,onClick:()=>{r(!1),a(`/settings/${e.id}`)},children:[(0,I.jsx)(e.icon,{className:`size-4`}),` `,e.label]},e.id)),(0,I.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),Ba()?null:(0,I.jsxs)(`button`,{type:`button`,className:m,onClick:()=>{r(!1),l?qa(l):d(!0)},children:[(0,I.jsx)(on,{className:`size-4`}),` `,c(`install.app.action`)]}),e.manageUrl?(0,I.jsxs)(`a`,{className:m,href:`${e.manageUrl}/account`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(In,{className:`size-4`}),` `,c(`nav.account`)]}):null,(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2 text-[0.875rem] text-ink-2`,children:[c(`nav.language`),(0,I.jsx)(Qc,{tone:`surface`})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2 text-[0.875rem] text-ink-2`,children:[c(`nav.theme`),(0,I.jsx)(Tl,{})]}),e.mode===`managed`?(0,I.jsxs)(`button`,{type:`button`,className:m,onClick:()=>void fa(),children:[(0,I.jsx)(fr,{className:`size-4`}),` `,c(`nav.logout`)]}):null]}):null,(0,I.jsx)(G,{open:u,onClose:()=>d(!1)})]})}function Ad(){let e=pt();return(0,I.jsx)(`button`,{type:`button`,"aria-pressed":e,"aria-label":c(`nav.spaceMenu`),title:c(`nav.spaceMenu`),onClick:()=>xt(!e),className:D(`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,I.jsx)(Mr,{className:`size-[1.125rem]`})})}function jd(){let e=pt(),t=Ze(),{project:n}=la(),r=Vd(),i=$i();if(!n)return null;let a=({isActive:e})=>D(`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:c(`nav.wizards`),icon:Si,end:!0},...i?[{to:`/new`,label:c(`home.new`),icon:he,end:!1}]:[]],s=Y(J(),r).map(e=>({to:`/space/${e.id}`,label:e.label,icon:e.icon,end:!1})),u=e=>(0,I.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsxs)(l,{to:e.to,end:e.end,className:a,children:[(0,I.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center`,children:(0,I.jsx)(e.icon,{className:`size-4 transition-transform duration-200 ease-out group-hover:scale-110`})}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label})]})},e.to))});return(0,I.jsx)(`aside`,{"aria-hidden":!e,inert:!e,className:D(`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,I.jsxs)(`div`,{className:`flex h-full w-64 flex-col overflow-y-auto px-4 pb-4`,children:[(0,I.jsx)(`div`,{ref:ut,className:t?`pt-4 animate-rise sm:pt-6`:`hidden`}),t?null:(0,I.jsxs)(`div`,{className:`pt-4 animate-rise sm:pt-6`,children:[u(o),(0,I.jsx)(`p`,{className:`mt-5 mb-1 px-2 font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.12em]`,children:c(`nav.project`)}),u(s)]})]})})}function Md({me:e,children:t}){return(0,I.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,I.jsx)(Ad,{}),(0,I.jsx)(Od,{me:e}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center`,children:[(0,I.jsx)(gd,{}),t]}),(0,I.jsx)(yd,{me:e})]})}var Nd=`studio-scroll`;function Pd(){return document.getElementById(`studio-scroll`)??document.documentElement}var Fd={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`},Id={left:`flex-row`,right:`flex-row-reverse`,top:`flex-col`,bottom:`flex-col-reverse`};function Ld({me:e,wide:t,full:n,children:r}){let{position:i}=ja(),a=(0,P.useRef)(null),o=za(`goose`);return(0,I.jsxs)(`div`,{className:D(`flex h-dvh overflow-hidden bg-sidebar`,Id[i]),children:[(0,I.jsx)(eo,{me:e}),(0,I.jsx)(`div`,{className:D(`flex min-h-0 min-w-0 flex-1 flex-col`,Fd[i]),children:(0,I.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,I.jsx)(ld,{}),(0,I.jsx)(q,{}),n?(0,I.jsx)(`main`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,children:r}):(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,I.jsx)(Md,{me:e}),(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,I.jsx)(jd,{}),(0,I.jsxs)(`div`,{ref:a,className:`relative flex min-w-0 flex-1 flex-col`,children:[(0,I.jsx)(`main`,{id:Nd,className:`relative min-h-0 flex-1 overflow-y-auto`,style:{paddingBottom:`var(--assistant-dock, 0px)`},children:(0,I.jsx)(`div`,{className:D(`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,I.jsx)(Ic,{column:a})]}),o&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Bc,{column:a}),(0,I.jsx)(Vc,{})]})]})]})]})})]})}globalThis.__WIZARDS_STUDIO__={react:P,jsx:I,reactDom:{createPortal:xa.createPortal,flushSync:xa.flushSync},router:{Link:it,Navigate:tt,NavLink:l,useLocation:fe,useNavigate:v,useParams:C,useSearchParams:se},query:{useMutation:F,useQuery:Ft,useQueryClient:At},ui:Et,sdk:ya};var Rd=0,X={status:`idle`,plugins:[],canReload:!1,problems:[],failed:{},pages:[],nav:[],sections:[],spaceSections:[],spaceParts:[],spaceMenus:{},shareSections:[],shareSetups:[],cards:[]},zd=new Set;function Bd(e){X={...X,...e};for(let e of zd)e()}function Vd(){return(0,P.useSyncExternalStore)(e=>(zd.add(e),()=>zd.delete(e)),()=>X)}var Hd=new Set([``,`new`,`edit`,`settings`,`space`,`setup`,`sign-in`]),Ud=new Set([`account`,`project`,`connectors`,`models`,`build`,`plugins`]),Wd=new Set([`info`,`knowledge`,`data`,`results`]),Gd=new Map,Kd=null,qd=e=>`${e.script}|${e.styles}`,Jd=e=>`__wizardsPlugin_${e.replaceAll(`-`,`_`)}`;function Yd(){let{project:e}=la(),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,P.useMemo)(()=>t?{id:t,name:n,readOnly:r,brand:JSON.parse(i)}:null,[t,n,r,i])}var Xd=(0,P.createContext)(null);function Zd({part:e,children:t}){return(0,I.jsx)(Xd.Provider,{value:e,children:t})}function Qd(e){let t=(0,P.useContext)(Xd),n=JSON.stringify(e.map(e=>[e.id,e.label]));(0,P.useEffect)(()=>{if(t)return Bd({spaceMenus:{...X.spaceMenus,[t]:e}}),()=>{let{[t]:e,...n}=X.spaceMenus;Bd({spaceMenus:n})}},[t,n])}function $d({plugin:e,...t}){return es({...t,plugin:e}),null}function ef(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(`/`)||Hd.has(r))throw Error(`"${e.path}" is an address of the studio itself.`);if([...i(X.pages),...t.pages].some(t=>t.path===e.path))throw Error(`"${e.path}" is registered already.`);t.pages.push({...e,plugin:n,serial:++Rd})},registerNav(e){t.nav.push({...e,plugin:n,serial:++Rd})},registerSettingsSection(e){let r=[...i(X.sections),...t.sections].some(t=>t.id===e.id);if(Ud.has(e.id)||r)throw Error(`The settings have a section "${e.id}" already.`);t.sections.push({...e,plugin:n,serial:++Rd})},registerSpaceSection(e){let r=[...i(X.spaceSections),...t.spaceSections].some(t=>t.id===e.id);if(rd.includes(e.id)||r)throw Error(`The space page has a section "${e.id}" already.`);t.spaceSections.push({...e,plugin:n,serial:++Rd})},registerSpacePart(e){let r=[...i(X.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:++Rd})},registerShareSection(e){if([...i(X.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:++Rd})},registerShareSetup(e){if([...i(X.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:++Rd})},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:++Rd})},useSpace:Yd,useSpaceMenu:Qd,useCrumbs:pd,Assistant:e=>(0,I.jsx)($d,{plugin:n,...e}),useAssistantPage:e=>es({...e,plugin:n}),useAssistantTool:(e,t,r)=>js(`${n.replaceAll(`-`,`_`)}_${e}`,t,r),i18n:{register:e=>(t,n)=>{let r=e[E]?.[t]??e.de[t]??t;for(let[e,t]of Object.entries(n??{}))r=r.replace(`{${e}}`,String(t));return r},lang:()=>E},api:{get:e=>N.get(r(e)),post:(e,t)=>N.post(r(e),t),put:(e,t)=>N.put(r(e),t),patch:(e,t)=>N.patch(r(e),t),del:e=>N.del(r(e))},me:()=>({user:{id:Kd.user.id,name:Kd.user.name,email:Kd.user.email},tenant:Kd.tenant,mode:Kd.mode}),onUnload(e){t.disposers.push(e)}}}function tf(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 nf(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 rf(e,t,n){for(let n of t)try{n()}catch(t){console.error(`[plugin ${e}]`,t)}n?.remove()}function af(e){let t=Gd.get(e);Gd.delete(e),rf(e,t?.disposers??[],t?.link??null);let{[e]:n,...r}=X.failed;Bd({failed:r,pages:X.pages.filter(t=>t.plugin!==e),nav:X.nav.filter(t=>t.plugin!==e),sections:X.sections.filter(t=>t.plugin!==e),spaceSections:X.spaceSections.filter(t=>t.plugin!==e),spaceParts:X.spaceParts.filter(t=>t.plugin!==e),shareSections:X.shareSections.filter(t=>t.plugin!==e),shareSetups:X.shareSetups.filter(t=>t.plugin!==e),cards:X.cards.filter(t=>t.plugin!==e)})}async function of(e){let{id:t}=e,n={pages:[],nav:[],sections:[],spaceSections:[],spaceParts:[],shareSections:[],shareSetups:[],cards:[],disposers:[]},r=null;try{e.styles&&(r=await nf(t,a(e.styles))),await tf(a(e.script));let i=globalThis,o=Jd(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(ef(e,n))}catch(i){console.error(`[plugin ${t}]`,i),rf(t,n.disposers,r),af(t),Gd.set(t,{key:qd(e),disposers:[],link:null}),Bd({failed:{...X.failed,[t]:i.message}});return}let i=Gd.get(t);Gd.set(t,{key:qd(e),disposers:n.disposers,link:r});let{[t]:o,...s}=X.failed;Bd({failed:s,pages:[...X.pages.filter(e=>e.plugin!==t),...n.pages],nav:[...X.nav.filter(e=>e.plugin!==t),...n.nav],sections:[...X.sections.filter(e=>e.plugin!==t),...n.sections],spaceSections:[...X.spaceSections.filter(e=>e.plugin!==t),...n.spaceSections],spaceParts:[...X.spaceParts.filter(e=>e.plugin!==t),...n.spaceParts],shareSections:[...X.shareSections.filter(e=>e.plugin!==t),...n.shareSections],shareSetups:[...X.shareSetups.filter(e=>e.plugin!==t),...n.shareSetups],cards:[...X.cards.filter(e=>e.plugin!==t),...n.cards]}),rf(t,i?.disposers??[],i?.link??null)}var sf=Promise.resolve();function cf(){return sf=sf.catch(()=>void 0).then(async()=>{let e=await N.get(`/api/studio/plugins`);for(let t of[...Gd.keys()])e.plugins.some(e=>e.id===t&&e.script)||af(t);Bd(e);for(let t of e.plugins)t.script&&Gd.get(t.id)?.key!==qd(t)&&await of(t)}).catch(e=>console.error(`[plugins]`,e)).finally(()=>Bd({status:`ready`})),sf}var lf=null;function uf(e){Kd=e,X.status===`idle`&&(Bd({status:`loading`}),cf().then(()=>{X.canReload&&!lf&&(lf=new EventSource(a(`/api/studio/plugins/-/events`),{withCredentials:!0}),lf.addEventListener(`change`,()=>void cf()))}))}async function df(e){await N.post(e?`/api/studio/plugins/-/reload/${e}`:`/api/studio/plugins/-/reload`),await cf()}var ff=class extends P.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error(`[plugin]`,e)}render(){return this.state.failed?(0,I.jsx)(pe,{children:c(`plugins.crashed`)}):this.props.children}};function pf({of:e,children:t}){return(0,I.jsx)(`div`,{"data-plugin":e.plugin,className:`contents`,children:(0,I.jsx)(ff,{children:t},e.serial)})}function Z({end:e,className:t}){return(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-4 ${t??``}`,children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-2.5`,children:[(0,I.jsx)(Ti,{size:28}),(0,I.jsxs)(`span`,{className:`font-display font-semibold text-[1.0625rem] tracking-tight ${e?`max-sm:sr-only`:``}`,children:[`engenty`,(0,I.jsx)(`span`,{className:`mr-[0.09em] ml-[0.06em] text-ember-strong`,children:`.`}),(0,I.jsx)(`span`,{className:`font-normal text-ink-2`,children:`wizards`})]})]}),(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:e?`flex max-sm:hidden`:`flex`,children:(0,I.jsx)(Tl,{tone:`surface`})}),(0,I.jsx)(Qc,{tone:`surface`}),e]})]})}var mf={de:{imprint:`/de/impressum`,privacy:`/de/datenschutz`,terms:`/de/nutzungsbedingungen`},en:{imprint:`/imprint`,privacy:`/privacy`,terms:`/terms`}};function hf({failed:e}){let t=Ue(),[n,r]=(0,P.useState)(()=>_a()??``),[i,a]=(0,P.useState)(!1),o=st(n,r,{endpoint:null}),s=()=>{let e=n.trim();e&&!i&&(o.listening&&o.stop(),a(!0),ga(e),pa(`/new`,e))};return(0,I.jsxs)(`div`,{className:`min-h-dvh px-6 pb-16 sm:px-10`,children:[(0,I.jsx)(Z,{className:`pt-6 sm:pt-8`,end:(0,I.jsx)(u,{variant:`secondary`,size:`sm`,onClick:()=>pa(`/`),children:c(`guest.signIn`)})}),(0,I.jsxs)(`div`,{className:`mx-auto max-w-2xl animate-rise pt-8 md:pt-12`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,I.jsx)(`div`,{className:`size-[84px] md:size-auto`,children:(0,I.jsx)(`div`,{className:`origin-top-left scale-[0.56] md:scale-100`,children:(0,I.jsx)(qi,{kind:`sprout`,size:150,fluffy:!0})})}),(0,I.jsx)(`h1`,{className:`mt-1 font-display font-semibold text-[1.5rem] leading-tight tracking-tight md:mt-2 md:text-[2.375rem]`,children:c(`new.title`)})]}),(0,I.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,I.jsx)(x,{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?c(`editor.listening`):c(`new.placeholder`),className:`border-0 bg-transparent text-[1rem] shadow-none focus:ring-0`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 px-1 pb-1`,children:[o.supported?(0,I.jsx)(at,{speech:o,labelled:!0}):null,(0,I.jsx)(`span`,{className:`flex-1`}),(0,I.jsxs)(u,{size:`md`,onClick:s,busy:i,disabled:!n.trim(),children:[c(`new.build`),` `,(0,I.jsx)(Nt,{className:`size-4`})]})]})]}),o.error?(0,I.jsx)(`p`,{className:`mt-2 px-3 text-[0.75rem] text-rose`,children:o.error===`denied`?c(`editor.micDenied`):o.error}):null,e?(0,I.jsx)(`p`,{className:`mt-3 text-center text-[0.875rem] text-rose`,children:c(`auth.failed`)}):null,(0,I.jsx)(`p`,{className:`mt-3 text-center text-[0.875rem] text-ink-3`,children:c(`guest.hint`)})]}),(0,I.jsxs)(`section`,{className:`mx-auto max-w-5xl`,children:[(0,I.jsx)(`h2`,{className:`mt-16 mb-5 text-center font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:c(`new.orStarter`)}),(0,I.jsx)(Nu,{onGuestOpen:e=>pa(`/new?starter=${encodeURIComponent(e.id)}`)})]}),(0,I.jsxs)(`footer`,{className:`mt-16 flex flex-wrap justify-center gap-x-5 gap-y-1 text-[0.75rem] text-ink-3`,children:[(0,I.jsx)(`span`,{children:`engenty.wizards`}),[`imprint`,`privacy`,`terms`].map(e=>(0,I.jsx)(`a`,{href:mf[t][e],className:`transition hover:text-ink-2`,children:c(`legal.${e}`)},e))]})]})}var gf=/(?:^|;\s*)engenty_signed_in=1(?:;|$)/;function _f(){return!!window.engentyDesktop}function vf({text:e}){return e.split(/(?<=[.!?])\s+/).map(e=>(0,I.jsx)(`span`,{className:`block`,children:e},e))}function yf({title:e,children:t,className:n=`mt-8`}){return(0,I.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,I.jsx)(`div`,{className:`mb-1.5 font-medium text-ink`,children:e}),t]})}function bf(){let e=Ft({queryKey:[`config`],queryFn:()=>N.get(`/api/config`),refetchInterval:e=>e.state.status===`error`&&!(e.state.error instanceof m&&e.state.error.body?.code===`host`)&&2e3,retry:!1}),t=At(),[n,r]=(0,P.useState)(!1),[i,a]=(0,P.useState)(!1),o=new URLSearchParams(window.location.search).get(`signin`)===`failed`,s=e.data?.mode===`local`&&e.data.devLogin,[l,d]=(0,P.useState)(!1),f=e.data?.mode===`managed`&&!o&&!_f()&&gf.test(document.cookie);if((0,P.useEffect)(()=>{f&&pa()},[f]),(0,P.useEffect)(()=>{if(!s||l)return;let e=!0;return N.post(`/api/dev/login`).then(()=>t.invalidateQueries()).catch(()=>{e&&d(!0)}),()=>{e=!1}},[s,l,t]),e.isLoading||f||s&&!l)return(0,I.jsx)(`div`,{className:`flex min-h-dvh items-center justify-center`,children:(0,I.jsx)(qi,{kind:`round`,size:56})});if(e.data?.mode===`managed`&&!e.data.devLogin&&!_f())return(0,I.jsx)(hf,{failed:o});let p=e.data?.mode===`local`&&!e.data.devLogin,h=e.error instanceof m&&e.error.body?.code===`host`?e.error:null,g=h?String(h.body.appUrl??``):null;return(0,I.jsxs)(`div`,{className:`relative flex min-h-dvh flex-col items-center justify-center px-6 py-16`,children:[(0,I.jsx)(Z,{className:`absolute inset-x-6 top-6 sm:inset-x-10 sm:top-8`}),(0,I.jsxs)(`div`,{className:`flex w-full max-w-md animate-rise flex-col items-center text-center`,children:[(0,I.jsx)(qi,{kind:`round`,size:p||e.isError?140:200,fluffy:!0}),(0,I.jsxs)(`span`,{className:`mt-2 font-display font-semibold text-[0.9375rem] text-ink-3 tracking-tight`,children:[(0,I.jsx)(Ei,{}),(0,I.jsx)(`span`,{className:`font-normal`,children:`wizards`})]}),(0,I.jsx)(`h1`,{className:`mt-3 text-balance font-display font-semibold text-[2.125rem] leading-[1.1] tracking-tight`,children:(0,I.jsx)(vf,{text:c(`brand.tagline`)})}),(0,I.jsx)(`p`,{className:`mt-4 text-balance text-[1rem] text-ink-2 leading-relaxed`,children:(0,I.jsx)(vf,{text:c(`brand.sub`)})}),g?(0,I.jsxs)(yf,{title:c(`auth.wrongHost`),children:[(0,I.jsx)(`p`,{children:c(`auth.wrongHostWhy`)}),(0,I.jsx)(`a`,{href:`${g}${window.location.pathname}`,className:`mt-1.5 block break-all font-medium text-ember-strong underline-offset-2 hover:underline`,children:g})]}):e.isError?(0,I.jsx)(yf,{title:c(`auth.unreachable`),children:c(`auth.unreachableWhy`,{address:window.location.host})}):null,(0,I.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-3`,children:[o?(0,I.jsx)(`p`,{className:`text-[0.875rem] text-rose`,children:c(`auth.failed`)}):null,e.data?.mode===`managed`?(0,I.jsx)(u,{size:`lg`,busy:n,className:`w-full`,onClick:async()=>{r(!0);let e=window.engentyDesktop;if(!e){pa();return}let{url:t}=await N.post(`/api/auth/desktop/start`);e.open(t),a(!0),r(!1)},children:c(i?`local.accountWaiting`:`auth.signIn`)}):null,e.data?.devLogin?(0,I.jsx)(u,{size:`lg`,busy:n,className:`w-full`,onClick:async()=>{r(!0),await N.post(`/api/dev/login`),await t.invalidateQueries(),r(!1)},children:c(`auth.dev`)}):null,p?(0,I.jsxs)(yf,{title:c(`auth.localTitle`),className:`-mt-2`,children:[(0,I.jsx)(`p`,{children:c(`auth.localWhy`)}),(0,I.jsx)(`p`,{className:`mt-3`,children:c(`auth.localLink`)}),(0,I.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,I.jsx)(`p`,{className:`mt-3 text-ink-3`,children:c(`auth.localStartLink`)}),(0,I.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,I.jsx)(`p`,{className:`mt-6 text-[0.8125rem] text-ink-3`,children:c(`auth.legal`)}):null]}),(0,I.jsxs)(`footer`,{className:`absolute inset-x-0 bottom-6 text-center text-[0.75rem] text-ink-3 sm:bottom-8`,children:[`© engenty · `,c(`about.version`,{v:Kc})]})]})}var xf=(0,P.lazy)(()=>It(()=>import(`./PublicRunner-C9MwEvxy.js`).then(e=>({default:e.PublicRunner})),__vite__mapDeps([11,1,2,5,6,12,13,14]))),Sf=(0,P.lazy)(()=>It(()=>import(`./SharePage-t2xwNS61.js`).then(e=>({default:e.SharePage})),__vite__mapDeps([15,1,2,5,6,11,12,13,14]))),Cf=(0,P.lazy)(()=>It(()=>import(`./EditorPage-jvcwyXbU.js`).then(e=>({default:e.EditorPage})),__vite__mapDeps([16,1,2,5,6,17,18,19,12,13,14,20,10]))),wf=(0,P.lazy)(()=>It(()=>Promise.resolve().then(()=>Fu).then(e=>({default:e.HomePage})),void 0)),Tf=(0,P.lazy)(()=>It(()=>import(`./OnboardingPage-DaD1XnOe.js`).then(e=>({default:e.OnboardingPage})),__vite__mapDeps([21,1,2,5,6,18]))),Ef=(0,P.lazy)(()=>It(()=>import(`./NewWizardPage-BoA-LJuW.js`).then(e=>({default:e.NewWizardPage})),__vite__mapDeps([22,1,2,5,6,20,13,18]))),Df=(0,P.lazy)(()=>It(()=>import(`./SettingsPage-AFt9IDLt.js`).then(e=>({default:e.SettingsPage})),__vite__mapDeps([23,1,2,5,6,19,24,7,25,26]))),Of=(0,P.lazy)(()=>It(()=>import(`./ProjectPage-BFgk1DEv.js`).then(e=>({default:e.ProjectPage})),__vite__mapDeps([27,1,2,5,6,17,18,13,24,7,14]))),kf=(0,P.lazy)(()=>It(()=>import(`./SetupPage-DtFYAbwJ.js`).then(e=>({default:e.SetupPage})),__vite__mapDeps([28,1,2,5,6,25,26]))),Af=null,jf=null;function Mf(){return(0,I.jsx)(`div`,{className:`flex min-h-dvh items-center justify-center`,children:(0,I.jsx)(qi,{kind:`round`,size:56})})}function Nf({children:e,bare:t,wide:n,full:r}){let i=ia(),a=fe();return ra(i.data),(0,P.useEffect)(()=>{i.data&&uf(i.data)},[i.data]),i.isLoading?(0,I.jsx)(Mf,{}):i.data?i.data.mode===`local`&&!i.data.setupDone&&a.pathname!==`/setup`?(0,I.jsx)(tt,{to:`/setup`,replace:!0}):i.data.onboarding&&a.pathname!==`/start`?(0,I.jsx)(tt,{to:`/start`,replace:!0}):t?e:(0,I.jsx)(Ld,{me:i.data,wide:n,full:r,children:e}):(0,I.jsx)(bf,{})}function Pf(){return Ue(),(0,I.jsx)(P.Suspense,{fallback:(0,I.jsx)(Mf,{}),children:(0,I.jsxs)(le,{children:[jf,Af,(0,I.jsx)(O,{path:`/w/:token`,element:(0,I.jsx)(xf,{})}),(0,I.jsx)(O,{path:`/w/:token/steps`,element:(0,I.jsx)(xf,{steps:!0})}),(0,I.jsx)(O,{path:`/w/:token/steps/:runId`,element:(0,I.jsx)(xf,{steps:!0})}),(0,I.jsx)(O,{path:`/w/:token/chat`,element:(0,I.jsx)(xf,{chat:!0})}),(0,I.jsx)(O,{path:`/w/:token/chat/:runId`,element:(0,I.jsx)(xf,{chat:!0})}),(0,I.jsx)(O,{path:`/w/:token/talk`,element:(0,I.jsx)(xf,{chat:!0,talk:!0})}),(0,I.jsx)(O,{path:`/w/:token/talk/:runId`,element:(0,I.jsx)(xf,{chat:!0,talk:!0})}),(0,I.jsx)(O,{path:`/w/:token/video`,element:(0,I.jsx)(xf,{chat:!0,video:!0})}),(0,I.jsx)(O,{path:`/w/:token/video/:runId`,element:(0,I.jsx)(xf,{chat:!0,video:!0})}),(0,I.jsx)(O,{path:`/w/:token/:runId`,element:(0,I.jsx)(xf,{})}),(0,I.jsx)(O,{path:`/s/:token`,element:(0,I.jsx)(Sf,{})}),(0,I.jsx)(O,{path:`*`,element:(0,I.jsx)(Ff,{})})]})})}function Ff(){return(0,P.useEffect)(()=>{window.location.replace(`${Ae}/`)},[]),(0,I.jsx)(Mf,{})}function If(){return Vd().status===`ready`?(0,I.jsx)(tt,{to:`/`,replace:!0}):(0,I.jsx)(Mf,{})}function Lf(){Ue(),(0,P.useEffect)(()=>(document.documentElement.dataset.studio=``,()=>{delete document.documentElement.dataset.studio}),[]);let e=Vd();return(0,I.jsx)(Vs,{children:(0,I.jsx)(P.Suspense,{fallback:(0,I.jsx)(Mf,{}),children:(0,I.jsxs)(le,{children:[(0,I.jsx)(O,{path:`/`,element:(0,I.jsx)(Nf,{children:(0,I.jsx)(wf,{})})}),(0,I.jsx)(O,{path:`/sign-in`,element:(0,I.jsx)(Nf,{children:(0,I.jsx)(tt,{to:`/`,replace:!0})})}),(0,I.jsx)(O,{path:`/new`,element:(0,I.jsx)(Nf,{children:(0,I.jsx)(Ef,{})})}),(0,I.jsx)(O,{path:`/edit/:id`,element:(0,I.jsx)(Nf,{full:!0,children:(0,I.jsx)(Cf,{})})}),(0,I.jsx)(O,{path:`/space/:group?`,element:(0,I.jsx)(Nf,{wide:!0,children:(0,I.jsx)(Of,{})})}),(0,I.jsx)(O,{path:`/settings/:section?`,element:(0,I.jsx)(Nf,{wide:!0,children:(0,I.jsx)(Df,{})})}),(0,I.jsx)(O,{path:`/setup`,element:(0,I.jsx)(Nf,{bare:!0,children:(0,I.jsx)(kf,{})})}),(0,I.jsx)(O,{path:`/start`,element:(0,I.jsx)(Nf,{bare:!0,children:(0,I.jsx)(Tf,{})})}),e.pages.map(e=>(0,I.jsx)(O,{path:e.path,element:(0,I.jsx)(Nf,{wide:e.wide,children:(0,I.jsx)(pf,{of:e,children:(0,I.jsx)(e.component,{})})})},e.serial)),(0,I.jsx)(O,{path:`*`,element:(0,I.jsx)(Nf,{bare:!0,children:(0,I.jsx)(If,{})})})]})})})}function Rf(){if(typeof window>`u`)return null;let e=window.engentyApp;return e&&typeof e.call==`function`&&Array.isArray(e.can)?e:null}var zf=Rf(),Bf=zf!==null||typeof window<`u`&&new URLSearchParams(window.location.search).get(`app`)===`1`;Bf&&typeof document<`u`&&document.documentElement.classList.add(`in-app`);var Vf=e=>zf?.can.includes(e)===!0;function Q(e,t){return zf&&Vf(e)?zf.call(e,t):Promise.reject(Error(`the app cannot ${e}`))}function Hf(e,t){Vf(e)&&Q(e,t).catch(()=>void 0)}function Uf(e,t,n){return Vf(`download`)?(e.preventDefault(),Q(`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 Gf(e,t){let n=encodeURIComponent(e),r=encodeURIComponent(t);return[{id:`mail`,label:c(`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 Kf={x:`𝕏`,linkedin:`in`,whatsapp:`WA`,facebook:`f`};function qf({runId:e,title:t,initial:n}){let[r,i]=(0,P.useState)(!1),[a,o]=(0,P.useState)(n),[s,l]=(0,P.useState)(!1),[d,f]=(0,P.useState)(!1),[p,m]=(0,P.useState)(null),h=async()=>{if(i(!0),!a){l(!0),m(null);try{o(await N.post(`/api/runs/${e}/share`))}catch(e){m(e.message)}finally{l(!1)}}},g=async()=>{await N.del(`/api/runs/${e}/share`),o(null),i(!1)},_=()=>{a&&(navigator.clipboard.writeText(a.url),f(!0),setTimeout(()=>f(!1),1500))},v=Vf(`share`)||typeof navigator<`u`&&`share`in navigator,y=a?.expiresAt?new Intl.DateTimeFormat(E,{dateStyle:`long`}).format(new Date(a.expiresAt)):null;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(u,{variant:`secondary`,onClick:()=>void h(),children:[(0,I.jsx)(yt,{className:`size-4`}),` `,c(`shareRun.button`)]}),(0,I.jsx)(ue,{open:r,onClose:()=>i(!1),title:c(`shareRun.title`),children:s?(0,I.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,I.jsx)(M,{})}):p?(0,I.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[0.875rem] text-rose`,children:p}):a?(0,I.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-paper-2 p-1.5 pl-3`,children:[(0,I.jsx)(ht,{className:`size-4 shrink-0 text-ink-3`}),(0,I.jsx)(`input`,{readOnly:!0,value:a.url,onFocus:e=>e.target.select(),"aria-label":c(`share.link`),className:`min-w-0 flex-1 bg-transparent text-[0.875rem] outline-none coarse:h-11`}),(0,I.jsxs)(u,{size:`sm`,onClick:_,children:[d?(0,I.jsx)(Ie,{className:`size-3.5`}):(0,I.jsx)(Xe,{className:`size-3.5`}),c(d?`share.copied`:`share.copy`)]})]}),(0,I.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 sm:grid-cols-6`,children:[Gf(a.url,t).map(e=>(0,I.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,I.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,I.jsx)(mr,{className:`size-5`}):Kf[e.id]}),e.label]},e.id)),v?(0,I.jsxs)(`button`,{type:`button`,onClick:()=>void(Vf(`share`)?Q(`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,I.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 transition hover:bg-paper-3`,children:(0,I.jsx)(yt,{className:`size-5`})}),c(`shareRun.more`)]}):null]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[0.8125rem] text-ink-3`,children:[(0,I.jsx)(`span`,{children:y?c(`shareRun.until`,{date:y}):c(`shareRun.kept`)}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>void g(),className:`shrink-0 hover:text-rose coarse:min-h-11`,children:c(`shareRun.withdraw`)})]})]}):null})]})}A({lang:E,runBase:e=>`/api/runs/${e}`,withBase:a,asset:Ee,serviceWorker:`${re}/sw.js`,app:{can:Vf,call:Q,tell:Hf,download:Uf},Mascot:qi,ShareResultButton:qf,onServerError:e=>ie(`error`,e)}),vt(),`engentyDesktop`in window&&(document.documentElement.dataset.desktop=``);var Jf=window.location.pathname,Yf=Jf===Ae||Jf.startsWith(`${Ae}/`);Yf&&`serviceWorker`in navigator&&navigator.serviceWorker.register(`${re}/sw.js`).catch(()=>void 0);var Xf=new Jt({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});(0,Ci.createRoot)(document.getElementById(`root`)).render((0,I.jsx)(P.StrictMode,{children:(0,I.jsx)(ot,{client:Xf,children:(0,I.jsx)(de,{basename:Yf?Ae:re,children:Yf?(0,I.jsx)(Lf,{}):(0,I.jsx)(Pf,{})})})}));export{$c as $,ir as $t,tu as A,Ui as At,gl as B,ei as Bt,Nu as C,$i as Ct,$l as D,Gi as Dt,eu as E,Yi as Et,Al as F,bi as Ft,cl as G,Or as Gt,rl as H,Wr as Ht,kl as I,gi as It,al as J,br as Jt,ol as K,wr as Kt,Ol as L,mi as Lt,Rl as M,Wi as Mt,Nl as N,Ti as Nt,iu as O,qi as Ot,Ml as P,Si as Pt,dl as Q,cr as Qt,Tl as R,ui as Rt,Du as S,Zi as St,ku as T,aa as Tt,tl as U,Hr as Ut,nl as V,Xr as Vt,fl as W,Br as Wt,pl as X,mr as Xt,hl as Y,vr as Yt,ml as Z,ur as Zt,ad as _,_a as _t,Wf as a,An as an,wo as at,Ru as b,la as bt,Zd as c,mn as cn,_o as ct,yd as d,fo as dt,Qn as en,Qc as et,vd as f,La as ft,td as g,Xi as gt,id as h,va as ht,Vf as i,Mn as in,es as it,Ql as j,Bi as jt,ru as k,Ji as kt,df as l,on as ln,no as lt,pd as m,Fa as mt,Bf as n,Kn as nn,Kc as nt,Hf as o,En as on,Co as ot,Pd as p,za as pt,sl as q,Sr as qt,Q as r,Rn as rn,Wc as rt,pf as s,bn as sn,bo as st,qf as t,Xn as tn,Jc as tt,Vd as u,F as un,uo as ut,J as v,da as vt,hu as w,ia as wt,Pu as x,ea as xt,Y as y,ua as yt,vl as z,oi as zt};
|